Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

feat: enhance thought bubble styling and functionality

nirholas477c115e50d6
diff --git a/api/_lib/agent-pumpfun.js b/api/_lib/agent-pumpfun.js
index 390e32005..ecafe824a 100644
--- a/api/_lib/agent-pumpfun.js
+++ b/api/_lib/agent-pumpfun.js
@@ -14,10 +14,19 @@ const RPC = {
devnet: process.env.SOLANA_RPC_URL_DEVNET || 'https://api.devnet.solana.com',
};
+const RPC_PUBLIC = {
+ mainnet: 'https://api.mainnet-beta.solana.com',
+ devnet: 'https://api.devnet.solana.com',
+};
+
export function solanaConnection(network = 'mainnet') {
return new Connection(RPC[network] || RPC.mainnet, 'confirmed');
}
+export function solanaPublicConnection(network = 'mainnet') {
+ return new Connection(RPC_PUBLIC[network] || RPC_PUBLIC.mainnet, 'confirmed');
+}
+
/**
* Load an agent owned by `userId`. If the agent has no Solana wallet yet
* (older rows from before pump-fun integration), one is generated and
diff --git a/api/_lib/r2.js b/api/_lib/r2.js
index 74a56e092..cb56da808 100644
--- a/api/_lib/r2.js
+++ b/api/_lib/r2.js
@@ -75,6 +75,25 @@ export async function deleteObject(key) {
await r2.send(new DeleteObjectCommand({ Bucket: env.S3_BUCKET, Key: key }));
}
+export async function putObject({ key, body, contentType, metadata = {} }) {
+ await r2.send(
+ new PutObjectCommand({
+ Bucket: env.S3_BUCKET,
+ Key: key,
+ Body: body,
+ ContentType: contentType,
+ Metadata: metadata,
+ }),
+ );
+}
+
+export async function getObjectBuffer(key) {
+ const { Body } = await r2.send(new GetObjectCommand({ Bucket: env.S3_BUCKET, Key: key }));
+ const chunks = [];
+ for await (const chunk of Body) chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk));
+ return Buffer.concat(chunks);
+}
+
// Public CDN URL for objects served via R2 custom domain / r2.dev.
export function publicUrl(key) {
return `${env.S3_PUBLIC_DOMAIN}/${encodeR2Key(key)}`;
diff --git a/api/_lib/validate.js b/api/_lib/validate.js
index fda30971d..362884d7d 100644
--- a/api/_lib/validate.js
+++ b/api/_lib/validate.js
@@ -76,6 +76,14 @@ export const presignUploadBody = z.object({
.optional(),
});
+export function isValidSolanaAddress(address) {
+ return typeof address === 'string' && /^[1-9A-HJ-NP-Za-km-z]{32,44}$/.test(address);
+}
+
+export function isValidEvmAddress(address) {
+ return typeof address === 'string' && /^0x[a-fA-F0-9]{40}$/.test(address);
+}
+
export function parse(schema, input) {
const res = schema.safeParse(input);
if (!res.success) {
diff --git a/api/agents/solana-wallet.js b/api/agents/solana-wallet.js
index 65e2d93f4..2c40ac3e1 100644
--- a/api/agents/solana-wallet.js
+++ b/api/agents/solana-wallet.js
@@ -6,7 +6,7 @@ import { sql } from '../_lib/db.js';
import { cors, json, method, error, readJson } from '../_lib/http.js';
import { limits, clientIp } from '../_lib/rate-limit.js';
import { generateSolanaAgentWallet } from '../_lib/agent-wallet.js';
-import { solanaConnection } from '../_lib/agent-pumpfun.js';
+import { solanaConnection, solanaPublicConnection } from '../_lib/agent-pumpfun.js';
import { Keypair, PublicKey, LAMPORTS_PER_SOL } from '@solana/web3.js';
import { webcrypto } from 'node:crypto';
import { env } from '../_lib/env.js';
@@ -186,12 +186,21 @@ async function handleWallet(req, res, id) {
if (!meta.solana_address) return error(res, 404, 'not_found', 'agent has no solana wallet — POST to provision');
const network = (req.query?.network || new URL(req.url, 'http://x').searchParams.get('network') || 'mainnet').toString();
+ const net = network === 'devnet' ? 'devnet' : 'mainnet';
let lamports = null;
try {
- const conn = solanaConnection(network === 'devnet' ? 'devnet' : 'mainnet');
+ const conn = solanaConnection(net);
lamports = await conn.getBalance(new PublicKey(meta.solana_address));
} catch (err) {
- console.error('[agents/solana/wallet] balance fetch failed', err);
+ if (err?.message?.includes('401') || err?.message?.includes('invalid api key')) {
+ try {
+ lamports = await solanaPublicConnection(net).getBalance(new PublicKey(meta.solana_address));
+ } catch (fallbackErr) {
+ console.error('[agents/solana/wallet] balance fetch failed (fallback)', fallbackErr);
+ }
+ } else {
+ console.error('[agents/solana/wallet] balance fetch failed', err);
+ }
}
return json(res, req.method === 'POST' ? 201 : 200, {
diff --git a/chat/src/AvatarPreview.svelte b/chat/src/AvatarPreview.svelte
new file mode 100644
index 000000000..44017a1cf
--- /dev/null
+++ b/chat/src/AvatarPreview.svelte
@@ -0,0 +1,120 @@
+<script>
+ import { onMount, onDestroy } from 'svelte';
+ import {
+ Scene,
+ PerspectiveCamera,
+ WebGLRenderer,
+ HemisphereLight,
+ DirectionalLight,
+ Color,
+ Box3,
+ Vector3,
+ SRGBColorSpace,
+ ACESFilmicToneMapping,
+ } from 'three';
+ import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
+
+ export let thumbnail_url = null;
+ export let model_url = null;
+ export let alt = '';
+ export let size = 128;
+
+ let canvas;
+ let state = thumbnail_url ? 'done' : model_url ? 'idle' : 'none';
+ let observer;
+
+ onMount(() => {
+ if (state !== 'idle') return;
+ observer = new IntersectionObserver(
+ (entries) => {
+ if (entries[0].isIntersecting) {
+ observer.disconnect();
+ renderPreview();
+ }
+ },
+ { rootMargin: '100px' },
+ );
+ observer.observe(canvas);
+ });
+
+ onDestroy(() => {
+ observer?.disconnect();
+ });
+
+ async function renderPreview() {
+ state = 'loading';
+ try {
+ const resp = await fetch(model_url, { mode: 'cors' });
+ if (!resp.ok) throw new Error(resp.status);
+ const buffer = await resp.arrayBuffer();
+
+ const loader = new GLTFLoader();
+ const gltf = await new Promise((resolve, reject) =>
+ loader.parse(buffer, '', resolve, reject),
+ );
+
+ const scene = new Scene();
+ scene.background = new Color('#e8e8e8');
+ scene.add(gltf.scene);
+
+ const box = new Box3().setFromObject(gltf.scene);
+ const center = box.getCenter(new Vector3());
+ const boxSize = box.getSize(new Vector3());
+ const maxDim = Math.max(boxSize.x, boxSize.y, boxSize.z) || 1;
+
+ const fov = 35;
+ const camera = new PerspectiveCamera(fov, 1, 0.01, 1000);
+ const dist = maxDim / (2 * Math.tan((Math.PI * fov) / 360));
+ camera.position.set(center.x, center.y + boxSize.y * 0.05, center.z + dist * 1.8);
+ camera.lookAt(center.x, center.y, center.z);
+
+ scene.add(new HemisphereLight(0xffffff, 0x444444, 2.0));
+ const dir = new DirectionalLight(0xffffff, 2.5);
+ dir.position.set(3, 10, 7);
+ scene.add(dir);
+
+ const renderer = new WebGLRenderer({ canvas, antialias: true, alpha: false });
+ renderer.setPixelRatio(1);
+ renderer.setSize(size, size, false);
+ renderer.outputColorSpace = SRGBColorSpace;
+ renderer.toneMapping = ACESFilmicToneMapping;
+ renderer.toneMappingExposure = 1.0;
+ renderer.render(scene, camera);
+ renderer.dispose();
+
+ scene.traverse((obj) => {
+ obj.geometry?.dispose();
+ const mats = obj.material
+ ? Array.isArray(obj.material)
+ ? obj.material
+ : [obj.material]
+ : [];
+ for (const m of mats) m.dispose();
+ });
+
+ state = 'done';
+ } catch {
+ state = 'error';
+ }
+ }
+</script>
+
+{#if thumbnail_url}
+ <img src={thumbnail_url} {alt} class="h-16 w-full rounded object-cover" loading="lazy" />
+{:else if state === 'none'}
+ <div class="flex h-16 w-full items-center justify-center rounded bg-slate-100 text-[10px] text-slate-400">
+ No preview
+ </div>
+{:else}
+ <canvas
+ bind:this={canvas}
+ width={size}
+ height={size}
+ class="h-16 w-full rounded object-cover {state === 'loading' ? 'animate-pulse bg-slate-100' : ''} {state === 'error' ? 'hidden' : ''}"
+ />
+ {#if state === 'error'}
+ <div class="flex h-16 w-full items-center justify-center rounded bg-slate-100 text-[10px] text-slate-400">
+ No preview
+ </div>
+ {/if}
+{/if}
diff --git a/chat/src/SettingsModal.svelte b/chat/src/SettingsModal.svelte
index 6b7e510eb..1a6c35a80 100644
--- a/chat/src/SettingsModal.svelte
+++ b/chat/src/SettingsModal.svelte
@@ -39,6 +39,7 @@
import Tooltip from './Tooltip.svelte';
import ModelSelector from './ModelSelector.svelte';
import { sendSingleItem, resetSyncCircuit } from './sync.js';
+ import AvatarPreview from './AvatarPreview.svelte';
const dispatch = createEventDispatcher();
@@ -455,6 +456,10 @@
variant="outline"
class="self-start"
on:click={async () => {
+ if (!$remoteServer.address) {
+ elRefreshToolSchema.dispatchEvent(new CustomEvent('flashError'));
+ return;
+ }
try {
const schema = await (
await fetch(`${$remoteServer.address}/tool_schema`, {
@@ -687,11 +692,7 @@
? 'border-indigo-400 bg-indigo-50'
: 'border-slate-200 hover:border-indigo-300'}"
>
- {#if a.thumbnail_url}
- <img src={a.thumbnail_url} alt={a.name} class="h-16 w-full rounded object-cover" loading="lazy" />
- {:else}
- <div class="flex h-16 w-full items-center justify-center rounded bg-slate-100 text-[10px] text-slate-400">No preview</div>
- {/if}
+ <AvatarPreview thumbnail_url={a.thumbnail_url} model_url={a.model_url} alt={a.name} />
<span class="w-full truncate text-[11px] text-slate-700">{a.name || a.slug}</span>
</button>
{/each}
@@ -711,11 +712,7 @@
? 'border-indigo-400 bg-indigo-50'
: 'border-slate-200 hover:border-indigo-300'}"
>
- {#if a.thumbnail_url}
- <img src={a.thumbnail_url} alt={a.name} class="h-16 w-full rounded object-cover" loading="lazy" />
- {:else}
- <div class="flex h-16 w-full items-center justify-center rounded bg-slate-100 text-[10px] text-slate-400">No preview</div>
- {/if}
+ <AvatarPreview thumbnail_url={a.thumbnail_url} model_url={a.model_url} alt={a.name} />
<span class="w-full truncate text-[11px] text-slate-700">{a.name || a.slug}</span>
</button>
{/each}
diff --git a/chat/src/SkillsMarketplaceModal.svelte b/chat/src/SkillsMarketplaceModal.svelte
index c7df1d4a6..b940c3ecd 100644
--- a/chat/src/SkillsMarketplaceModal.svelte
+++ b/chat/src/SkillsMarketplaceModal.svelte
@@ -814,7 +814,7 @@
on:error={() => { failedAvatars = new Set([...failedAvatars, plugin.identifier]); }}
/>
{:else}
- <span class="shrink-0 text-2xl leading-none">{/^https?:\/\//.test(plugin.avatar) ? '🔧' : plugin.avatar}</span>
+ <span class="shrink-0 text-2xl leading-none">{plugin.avatar?.startsWith('http') ? '🔧' : plugin.avatar}</span>
{/if}
<div class="min-w-0 flex-1">
<div class="flex flex-wrap items-center gap-x-1.5 gap-y-1">
diff --git a/prompts/avatar-chat-vision.md b/prompts/avatar-chat-vision.md
deleted file mode 100644
index ab3f27343..000000000
--- a/prompts/avatar-chat-vision.md
+++ /dev/null
@@ -1,214 +0,0 @@
-# Avatar-in-Chat Vision — Implementation Prompts
-
-Three self-contained prompts to be executed in order. Each builds on the previous.
-
----
-
-## Prompt 1 — Add token streaming to the LLM provider and runtime
-
-**Goal:** The provider currently does a blocking `await res.json()` and returns the full response at once. Change it to stream tokens via SSE so the runtime can emit each chunk as it arrives.
-
-**File:** `src/runtime/providers.js` — `AnthropicProvider.complete()`
-**File:** `src/runtime/index.js` — `_loop()`
-
-### What to change in providers.js
-
-Replace the `complete()` method in `AnthropicProvider` with a streaming version:
-
-1. Add `stream: true` to the fetch body.
-2. Read the response as an SSE stream (`response.body.getReader()`).
-3. Parse `data:` lines, decode JSON events. Anthropic streaming event types you care about:
- - `content_block_delta` with `delta.type === 'text_delta'` → accumulate `delta.text` into `out.text`
- - `content_block_delta` with `delta.type === 'thinking_delta'` → accumulate into `out.thinking`
- - `content_block_start` with `block.type === 'tool_use'` → start buffering a tool call `{ id, name, input: '' }`
- - `content_block_delta` with `delta.type === 'input_json_delta'` → append `delta.partial_json` to the current tool call's input string
- - `content_block_stop` → finalize the current tool call (parse the input JSON string)
- - `message_stop` → stream is done
-4. Add an optional `onChunk(text: string)` callback parameter to `complete({ ..., onChunk })`. Call it with each `text_delta` chunk as it arrives.
-5. Return the same normalized shape `{ text, toolCalls, thinking, stopReason }` as before — the method signature doesn't change for callers.
-
-Keep `NullProvider.complete()` unchanged.
-
-### What to change in runtime/index.js
-
-In `_loop()`, where `this.provider.complete(...)` is called, pass an `onChunk` callback:
-
-```js
-const response = await this.provider.complete({
- system: this.systemPrompt,
- messages: this.messages,
- tools: this.tools,
- onChunk: (chunk) => {
- this.dispatchEvent(new CustomEvent('brain:stream', { detail: { chunk } }));
- },
-});
-```
-
-Also: fire `brain:thinking` with `{ thinking: true }` at the start of `_loop()` iteration, and `{ thinking: false }` once `response` resolves (before the tool dispatch block). This replaces the existing post-hoc thinking event which only fires when `response.thinking` has content.
-
-```js
-// At start of each iteration:
-this.dispatchEvent(new CustomEvent('brain:thinking', { detail: { thinking: true } }));
-
-// After provider.complete() resolves:
-this.dispatchEvent(new CustomEvent('brain:thinking', { detail: { thinking: false } }));
-```
-
-Add `'brain:stream'` to the re-dispatch list in `element.js` (the `for (const ev of [...])` loop around line 1127).
-
-**Verification:** After this change, typing a message in the UI should cause `brain:stream` events to fire rapidly in the browser console (`window.VIEWER.agent_protocol` won't have them — listen on the Runtime instance directly or add a console.log temporarily).
-
----
-
-## Prompt 2 — Stream tokens into the thought bubble above the avatar
-
-**Goal:** While the LLM is generating, the thought bubble above the avatar's head should display the tokens as they arrive — like a comic-book speech bubble showing the character's words forming in real time. When the full message lands in the chat, the bubble clears.
-
-**Files:** `src/element.js`
-
-### CSS changes
-
-Update `.thought-bubble` in `BASE_STYLE`:
-
-- Remove the fixed `white-space: nowrap` — replace with `max-width: min(280px, 60%)` and `white-space: normal` so longer text wraps.
-- Add `min-width: 80px; min-height: 28px;` so the bubble has a stable minimum size.
-- Keep the existing transition and box-shadow.
-
-Add a `.thought-bubble .text` child rule:
-```css
-.thought-bubble .text {
- font: 13px/1.4 var(--agent-chat-font);
- color: #1a1a2e;
- display: none;
-}
-.thought-bubble[data-streaming="true"] .text { display: block; }
-.thought-bubble[data-streaming="true"] .dot { display: none; }
-```
-
-So: dots show when `data-active="true"` (thinking / waiting), text shows when `data-streaming="true"` (tokens arriving).
-
-### DOM changes in `_renderShell`
-
-Change the thought bubble innerHTML from three dots to:
-```js
-thoughtBubble.innerHTML =
- '<span class="text"></span>' +
- '<span class="dot"></span><span class="dot"></span><span class="dot"></span>';
-```
-
-Store a reference to the text span: `this._thoughtTextEl = thoughtBubble.querySelector('.text');`
-
-### Event wiring in the `brain:*` listener block
-
-**On `brain:stream`:**
-```js
-if (ev === 'brain:stream') {
- if (this._thoughtBubbleEl && this.getAttribute('avatar-chat') !== 'off') {
- const chunk = e.detail?.chunk ?? '';
- this._streamToBubble(chunk);
- }
-}
-```
-
-Add `'brain:stream'` to the `for (const ev of [...])` array.
-
-**On `brain:thinking` when `thinking: false`** (stream finished):
-- Clear the bubble text and switch it back to dots-only mode.
-
-### New method `_streamToBubble(chunk)`
-
-```js
-_streamToBubble(chunk) {
- if (!this._thoughtBubbleEl || !this._thoughtTextEl) return;
- this._thoughtBubbleEl.dataset.active = 'true';
- this._thoughtBubbleEl.dataset.streaming = 'true';
- this._thoughtTextEl.textContent += chunk;
- // Keep only the last ~120 chars so the bubble doesn't grow forever
- const t = this._thoughtTextEl.textContent;
- if (t.length > 120) {
- this._thoughtTextEl.textContent = '…' + t.slice(-110);
- }
-}
-
-_clearThoughtBubble() {
- if (!this._thoughtBubbleEl) return;
- this._thoughtBubbleEl.dataset.active = 'false';
- this._thoughtBubbleEl.dataset.streaming = 'false';
- if (this._thoughtTextEl) this._thoughtTextEl.textContent = '';
-}
-```
-
-Call `_clearThoughtBubble()` when `brain:thinking` fires with `thinking: false`, and also when `brain:message` fires with `role: 'assistant'` (the full message has landed — bubble can go away).
-
-**Verification:** Prompt the agent. The thought bubble should appear, fill with streaming words, then disappear when the final message appears in the chat.
-
----
-
-## Prompt 3 — Walk animation synchronized to streaming, not a fixed timer
-
-**Goal:** The avatar walks while tokens are actively arriving (chat is scrolling upward). It stops as soon as streaming ends. This replaces the current fixed-duration timer approach.
-
-**Files:** `src/element.js`
-
-### Replace `_startWalkAnimation` with stream-aware version
-
-Remove the current `_startWalkAnimation(text)` method and its call site in `brain:message`.
-
-Instead, control walk state from two events:
-
-**When `brain:stream` fires** (tokens arriving → walk):
-```js
-if (ev === 'brain:stream') {
- // ... bubble update (from Prompt 2) ...
- this._onStreamChunk();
-}
-```
-
-**When `brain:thinking` fires with `thinking: false`** (stream done → return to idle):
-```js
-this._stopWalkAnimation();
-```
-
-### New methods
-
-```js
-_onStreamChunk() {
- if (!this._scene || this.getAttribute('avatar-chat') === 'off') return;
- if (!this._isWalking) {
- this._isWalking = true;
- this._scene.playClipByName('walk', { loop: true, fade_ms: 300 });
- }
- // Reset a short debounce — if chunks stop arriving for 600ms, stop walking
- clearTimeout(this._walkStopDebounce);
- this._walkStopDebounce = setTimeout(() => this._stopWalkAnimation(), 600);
-}
-
-_stopWalkAnimation() {
- if (!this._isWalking) return;
- this._isWalking = false;
- clearTimeout(this._walkStopDebounce);
- this._scene?.playClipByName('idle', { loop: true, fade_ms: 500 });
-}
-```
-
-Add `this._isWalking = false` and `this._walkStopDebounce = null` to the constructor.
-
-In `_teardown()`, add `clearTimeout(this._walkStopDebounce)` alongside the existing `clearTimeout(this._walkReturnTimer)`. Remove `_walkReturnTimer` cleanup since that method is gone.
-
-### Chat scroll synchronization (bonus — makes it feel physical)
-
-In `_renderMessage()`, after appending the message and scrolling:
-```js
-// Nudge the walk animation each time a new message causes a scroll
-if (this._isWalking) {
- // already walking — the scroll is visually consistent, nothing extra needed
-} else if (this.getAttribute('avatar-chat') !== 'off') {
- // A message arrived outside of streaming (e.g. tool result card) — brief walk
- this._onStreamChunk();
-}
-```
-
-**Verification:**
-1. Send a message. Avatar starts walking immediately when the first token arrives.
-2. Streaming ends. Avatar smoothly crossfades back to idle within 600ms of the last token.
-3. No walk occurs if `avatar-chat="off"`.
diff --git a/public/chat/index.html b/public/chat/index.html
index 7e326c78b..a7e56e686 100644
--- a/public/chat/index.html
+++ b/public/chat/index.html
@@ -43,7 +43,7 @@
}
}
</script>
- <script type="module" crossorigin src="/chat/assets/index-C6OW_Rhh.js"></script>
+ <script type="module" crossorigin src="/chat/assets/index-BoQasYoQ.js"></script>
<link rel="stylesheet" crossorigin href="/chat/assets/index-CgrzNPtI.css">
</head>
<body>
diff --git a/rider/build/build.js b/rider/build/build.js
index 594e6ce27..1d7d2157f 100644
--- a/rider/build/build.js
+++ b/rider/build/build.js
@@ -1,4 +1,4 @@
-!function(e){var t=this.webpackHotUpdate;this.webpackHotUpdate=function(e,n){!function(e,t){if(!A[e]||!w[e])return;for(var n in w[e]=!1,t)Object.prototype.hasOwnProperty.call(t,n)&&(f[n]=t[n]);0==--y&&0===v&&S()}(e,n),t&&t(e,n)};var n,r=!0,i="0eb3afe3ce20db27d2ce",a={},o=[],s=[];function c(e){var t=k[e];if(!t)return C;var r=function(r){return t.hot.active?(k[r]?-1===k[r].parents.indexOf(e)&&k[r].parents.push(e):(o=[e],n=r),-1===t.children.indexOf(r)&&t.children.push(r)):(console.warn("[HMR] unexpected require("+r+") from disposed module "+e),o=[]),C(r)},i=function(e){return{configurable:!0,enumerable:!0,get:function(){return C[e]},set:function(t){C[e]=t}}};for(var a in C)Object.prototype.hasOwnProperty.call(C,a)&&"e"!==a&&"t"!==a&&Object.defineProperty(r,a,i(a));return r.e=function(e){return"ready"===h&&d("prepare"),v++,C.e(e).then(t,(function(e){throw t(),e}));function t(){v--,"prepare"===h&&(b[e]||_(e),0===v&&0===y&&S())}},r.t=function(e,t){return 1&t&&(e=r(e)),C.t(e,-2&t)},r}function l(t){var r={_acceptedDependencies:{},_declinedDependencies:{},_selfAccepted:!1,_selfDeclined:!1,_selfInvalidated:!1,_disposeHandlers:[],_main:n!==t,active:!0,accept:function(e,t){if(void 0===e)r._selfAccepted=!0;else if("function"==typeof e)r._selfAccepted=e;else if("object"==typeof e)for(var n=0;n<e.length;n++)r._acceptedDependencies[e[n]]=t||function(){};else r._acceptedDependencies[e]=t||function(){}},decline:function(e){if(void 0===e)r._selfDeclined=!0;else if("object"==typeof e)for(var t=0;t<e.length;t++)r._declinedDependencies[e[t]]=!0;else r._declinedDependencies[e]=!0},dispose:function(e){r._disposeHandlers.push(e)},addDisposeHandler:function(e){r._disposeHandlers.push(e)},removeDisposeHandler:function(e){var t=r._disposeHandlers.indexOf(e);t>=0&&r._disposeHandlers.splice(t,1)},invalidate:function(){switch(this._selfInvalidated=!0,h){case"idle":(f={})[t]=e[t],d("ready");break;case"ready":R(t);break;case"prepare":case"check":case"dispose":case"apply":(g=g||[]).push(t)}},check:x,apply:M,status:function(e){if(!e)return h;u.push(e)},addStatusHandler:function(e){u.push(e)},removeStatusHandler:function(e){var t=u.indexOf(e);t>=0&&u.splice(t,1)},data:a[t]};return n=void 0,r}var u=[],h="idle";function d(e){h=e;for(var t=0;t<u.length;t++)u[t].call(null,e)}var p,f,m,g,y=0,v=0,b={},w={},A={};function E(e){return+e+""===e?+e:e}function x(e){if("idle"!==h)throw new Error("check() is only allowed in idle status");return r=e,d("check"),(t=1e4,t=t||1e4,new Promise((function(e,n){if("undefined"==typeof XMLHttpRequest)return n(new Error("No browser support"));try{var r=new XMLHttpRequest,a=C.p+""+i+".hot-update.json";r.open("GET",a,!0),r.timeout=t,r.send(null)}catch(e){return n(e)}r.onreadystatechange=function(){if(4===r.readyState)if(0===r.status)n(new Error("Manifest request to "+a+" timed out."));else if(404===r.status)e();else if(200!==r.status&&304!==r.status)n(new Error("Manifest request to "+a+" failed."));else{try{var t=JSON.parse(r.responseText)}catch(e){return void n(e)}e(t)}}}))).then((function(e){if(!e)return d(T()?"ready":"idle"),null;w={},b={},A=e.c,m=e.h,d("prepare");var t=new Promise((function(e,t){p={resolve:e,reject:t}}));f={};return _(0),"prepare"===h&&0===v&&0===y&&S(),t}));var t}function _(e){A[e]?(w[e]=!0,y++,function(e){var t=document.createElement("script");t.charset="utf-8",t.src=C.p+""+e+"."+i+".hot-update.js",document.head.appendChild(t)}(e)):b[e]=!0}function S(){d("ready");var e=p;if(p=null,e)if(r)Promise.resolve().then((function(){return M(r)})).then((function(t){e.resolve(t)}),(function(t){e.reject(t)}));else{var t=[];for(var n in f)Object.prototype.hasOwnProperty.call(f,n)&&t.push(E(n));e.resolve(t)}}function M(t){if("ready"!==h)throw new Error("apply() is only allowed in ready status");return function t(r){var s,c,l,u,h;function p(e){for(var t=[e],n={},r=t.map((function(e){return{chain:[e],id:e}}));r.length>0;){var i=r.pop(),a=i.id,o=i.chain;if((u=k[a])&&(!u.hot._selfAccepted||u.hot._selfInvalidated)){if(u.hot._selfDeclined)return{type:"self-declined",chain:o,moduleId:a};if(u.hot._main)return{type:"unaccepted",chain:o,moduleId:a};for(var s=0;s<u.parents.length;s++){var c=u.parents[s],l=k[c];if(l){if(l.hot._declinedDependencies[a])return{type:"declined",chain:o.concat([c]),moduleId:a,parentId:c};-1===t.indexOf(c)&&(l.hot._acceptedDependencies[a]?(n[c]||(n[c]=[]),y(n[c],[a])):(delete n[c],t.push(c),r.push({chain:o.concat([c]),id:c})))}}}}return{type:"accepted",moduleId:e,outdatedModules:t,outdatedDependencies:n}}function y(e,t){for(var n=0;n<t.length;n++){var r=t[n];-1===e.indexOf(r)&&e.push(r)}}T();var v={},b=[],w={},x=function(){console.warn("[HMR] unexpected require("+S.moduleId+") to disposed module")};for(var _ in f)if(Object.prototype.hasOwnProperty.call(f,_)){var S;h=E(_),S=f[_]?p(h):{type:"disposed",moduleId:_};var M=!1,R=!1,O=!1,P="";switch(S.chain&&(P="\nUpdate propagation: "+S.chain.join(" -> ")),S.type){case"self-declined":r.onDeclined&&r.onDeclined(S),r.ignoreDeclined||(M=new Error("Aborted because of self decline: "+S.moduleId+P));break;case"declined":r.onDeclined&&r.onDeclined(S),r.ignoreDeclined||(M=new Error("Aborted because of declined dependency: "+S.moduleId+" in "+S.parentId+P));break;case"unaccepted":r.onUnaccepted&&r.onUnaccepted(S),r.ignoreUnaccepted||(M=new Error("Aborted because "+h+" is not accepted"+P));break;case"accepted":r.onAccepted&&r.onAccepted(S),R=!0;break;case"disposed":r.onDisposed&&r.onDisposed(S),O=!0;break;default:throw new Error("Unexception type "+S.type)}if(M)return d("abort"),Promise.reject(M);if(R)for(h in w[h]=f[h],y(b,S.outdatedModules),S.outdatedDependencies)Object.prototype.hasOwnProperty.call(S.outdatedDependencies,h)&&(v[h]||(v[h]=[]),y(v[h],S.outdatedDependencies[h]));O&&(y(b,[S.moduleId]),w[h]=x)}var I,N=[];for(c=0;c<b.length;c++)h=b[c],k[h]&&k[h].hot._selfAccepted&&w[h]!==x&&!k[h].hot._selfInvalidated&&N.push({module:h,parents:k[h].parents.slice(),errorHandler:k[h].hot._selfAccepted});d("dispose"),Object.keys(A).forEach((function(e){!1===A[e]&&function(e){delete installedChunks[e]}(e)}));var L,D,F=b.slice();for(;F.length>0;)if(h=F.pop(),u=k[h]){var j={},U=u.hot._disposeHandlers;for(l=0;l<U.length;l++)(s=U[l])(j);for(a[h]=j,u.hot.active=!1,delete k[h],delete v[h],l=0;l<u.children.length;l++){var B=k[u.children[l]];B&&((I=B.parents.indexOf(h))>=0&&B.parents.splice(I,1))}}for(h in v)if(Object.prototype.hasOwnProperty.call(v,h)&&(u=k[h]))for(D=v[h],l=0;l<D.length;l++)L=D[l],(I=u.children.indexOf(L))>=0&&u.children.splice(I,1);d("apply"),void 0!==m&&(i=m,m=void 0);for(h in f=void 0,w)Object.prototype.hasOwnProperty.call(w,h)&&(e[h]=w[h]);var V=null;for(h in v)if(Object.prototype.hasOwnProperty.call(v,h)&&(u=k[h])){D=v[h];var z=[];for(c=0;c<D.length;c++)if(L=D[c],s=u.hot._acceptedDependencies[L]){if(-1!==z.indexOf(s))continue;z.push(s)}for(c=0;c<z.length;c++){s=z[c];try{s(D)}catch(e){r.onErrored&&r.onErrored({type:"accept-errored",moduleId:h,dependencyId:D[c],error:e}),r.ignoreErrored||V||(V=e)}}}for(c=0;c<N.length;c++){var H=N[c];h=H.module,o=H.parents,n=h;try{C(h)}catch(e){if("function"==typeof H.errorHandler)try{H.errorHandler(e)}catch(t){r.onErrored&&r.onErrored({type:"self-accept-error-handler-errored",moduleId:h,error:t,originalError:e}),r.ignoreErrored||V||(V=t),V||(V=e)}else r.onErrored&&r.onErrored({type:"self-accept-errored",moduleId:h,error:e}),r.ignoreErrored||V||(V=e)}}if(V)return d("fail"),Promise.reject(V);if(g)return t(r).then((function(e){return b.forEach((function(t){e.indexOf(t)<0&&e.push(t)})),e}));return d("idle"),new Promise((function(e){e(b)}))}(t=t||{})}function T(){if(g)return f||(f={}),g.forEach(R),g=void 0,!0}function R(t){Object.prototype.hasOwnProperty.call(f,t)||(f[t]=e[t])}var k={};function C(t){if(k[t])return k[t].exports;var n=k[t]={i:t,l:!1,exports:{},hot:l(t),parents:(s=o,o=[],s),children:[]};return e[t].call(n.exports,n,n.exports,c(t)),n.l=!0,n.exports}C.m=e,C.c=k,C.d=function(e,t,n){C.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},C.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},C.t=function(e,t){if(1&t&&(e=C(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(C.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)C.d(n,r,function(t){return e[t]}.bind(null,r));return n},C.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return C.d(t,"a",t),t},C.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},C.p="",C.h=function(){return i},c(40)(C.s=40)}([function(e,t){const n={OFF:"#111",WHITE:"#f0f0f0",DARKRED:"#5A354B",RED:"#f971c3",BRIGHTRED:"#ffd3ee",DARKBLUE:"#2B4D4C",BLUE:"#6ff9ea",BRIGHTBLUE:"#d7fdf9",YELLOW:"#fff568",UI_ACCENT:"#08bfa2",UI_ACCENT2:"#f01978"};n.schemes={default:{name:"Super Medium",off:"#111",primary:n.RED,primarybright:n.BRIGHTRED,secondary:n.BLUE,secondarybright:n.BRIGHTBLUE,tertiary:n.YELLOW},blue:{name:"Star Warrior",off:"#111",primary:"#1e4482",primarybright:"#0B4BB3",secondary:"#c27727",secondarybright:"#FFD840",tertiary:"#d7fdf9"},purple:{name:"Galactic Royal",off:"#111",primary:"#6A39B3",primarybright:"#B685FF",secondary:"#FAF239",secondarybright:"#FFFC9E",tertiary:"#50FFF2"},green:{name:"Space Joker",off:"#111",primary:"#779E37",primarybright:"#C0FF59",secondary:"#6A39B3",secondarybright:"#B685FF",tertiary:"#FAFAFA"},yellow:{name:"Solar Flare",off:"#111",primary:"#C2C04C",primarybright:"#FAF761",secondary:"#E03A3E",secondarybright:"#FA7578",tertiary:"#278ECC"},red:{name:"Trail Blazer",off:"#111",primary:"#E03A3E",primarybright:"#FA7578",secondary:"#DADADA",secondarybright:"#EFEFEF",tertiary:"#666"},rgb:{name:"Mint Choco",off:"#111",primary:"#34eb89",primarYBRIGht:"#40fb95",secondary:"#34ebd8",secondarybright:"#40fbeA",tertiary:"#eb3434"},cheetah:{name:"Cheetah SoL",off:"#111",primary:"#c27727",primarYBright:"#e68319",secondary:"#635c54",secondarybright:"#8a857f",tertiary:"#ebebeb"},black:{name:"Ash Nova",off:"#111",primary:"#555",primarybright:"#808080",secondary:"#FFF",secondarybright:"#FFF",tertiary:"#B8B8B8"}},n.options=Object.keys(n.schemes),"undefined"==typeof localStorage?n.initial="default":n.initial=n.schemes[localStorage.getItem("colorScheme")||"blue"],e.exports=n},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},,function(e,t){var n,r,i=e.exports={};function a(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===a||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:a}catch(e){n=a}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(e){r=o}}();var c,l=[],u=!1,h=-1;function d(){u&&c&&(u=!1,c.length?l=c.concat(l):h=-1,l.length&&p())}function p(){if(!u){var e=s(d);u=!0;for(var t=l.length;t;){for(c=l,l=[];++h<t;)c&&c[h].run();h=-1,t=l.length}c=null,u=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===o||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function f(e,t){this.fun=e,this.array=t}function m(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];l.push(new f(e,t)),1!==l.length||u||s(p)},f.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=m,i.addListener=m,i.once=m,i.off=m,i.removeListener=m,i.removeAllListeners=m,i.emit=m,i.prependListener=m,i.prependOnceListener=m,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},,,function(e,t){var n;e.exports.getS3FileUrl=function(e,t){return`https://previews.three.ws/${e}-${t}?v=2`},console.line=(n={},function(e,t,r,i){i=i||"#FFF",n[r=r||"default"]||(n[r]=document.createElement("a-entity"),n[r].setAttribute("line","color",i||"#FFF"),n[r].setAttribute("id",r),AFRAME.scenes[0].appendChild(n[r])),n[r].setAttribute("line","start",e.clone()),n[r].setAttribute("line","end",t.clone())}),console.vec3=function(){const e={},t={primitive:"box",width:.05,height:.05,depth:.05},n={shader:"flat"};return function(r,i,a){a=a||"#FFF",e[i=i||"default"]||(e[i]=document.createElement("a-entity"),n.color=a||"#FFF",e[i].setAttribute("geometry",t),e[i].setAttribute("material",n),e[i].setAttribute("id",i),e[i].setAttribute("text",{align:"center",value:i,side:"double"}),AFRAME.scenes[0].appendChild(e[i])),e[i].object3D.position.copy(r)}}()},function(e,t){e.exports="varying vec2 uvs;\nvarying float distance;\nvoid main() {\n uvs.xy = uv.xy;\n distance = length((modelMatrix * vec4(position, 1.0)).xyz - cameraPosition);\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n"},function(e,t){e.exports="varying vec2 uvs;\nvarying float distance;\nuniform sampler2D src;\nuniform vec3 color;\n\nvoid main() {\n float alpha = texture2D(src, uvs).a;\n alpha *= 1.0 - clamp(distance / 40.0, 0.0, 1.0);\n gl_FragColor = vec4(color, alpha);\n}\n"},,,function(e,t,n){"use strict";n.r(t),n.d(t,"__extends",(function(){return i})),n.d(t,"__assign",(function(){return a})),n.d(t,"__rest",(function(){return o})),n.d(t,"__decorate",(function(){return s})),n.d(t,"__param",(function(){return c})),n.d(t,"__metadata",(function(){return l})),n.d(t,"__awaiter",(function(){return u})),n.d(t,"__generator",(function(){return h})),n.d(t,"__exportStar",(function(){return d})),n.d(t,"__values",(function(){return p})),n.d(t,"__read",(function(){return f})),n.d(t,"__spread",(function(){return m})),n.d(t,"__spreadArrays",(function(){return g})),n.d(t,"__await",(function(){return y})),n.d(t,"__asyncGenerator",(function(){return v})),n.d(t,"__asyncDelegator",(function(){return b})),n.d(t,"__asyncValues",(function(){return w})),n.d(t,"__makeTemplateObject",(function(){return A})),n.d(t,"__importStar",(function(){return E})),n.d(t,"__importDefault",(function(){return x}));
+!function(e){var t=this.webpackHotUpdate;this.webpackHotUpdate=function(e,n){!function(e,t){if(!A[e]||!w[e])return;for(var n in w[e]=!1,t)Object.prototype.hasOwnProperty.call(t,n)&&(f[n]=t[n]);0==--y&&0===v&&S()}(e,n),t&&t(e,n)};var n,r=!0,i="1a8adbc0448dc70a9168",a={},o=[],s=[];function c(e){var t=k[e];if(!t)return C;var r=function(r){return t.hot.active?(k[r]?-1===k[r].parents.indexOf(e)&&k[r].parents.push(e):(o=[e],n=r),-1===t.children.indexOf(r)&&t.children.push(r)):(console.warn("[HMR] unexpected require("+r+") from disposed module "+e),o=[]),C(r)},i=function(e){return{configurable:!0,enumerable:!0,get:function(){return C[e]},set:function(t){C[e]=t}}};for(var a in C)Object.prototype.hasOwnProperty.call(C,a)&&"e"!==a&&"t"!==a&&Object.defineProperty(r,a,i(a));return r.e=function(e){return"ready"===h&&d("prepare"),v++,C.e(e).then(t,(function(e){throw t(),e}));function t(){v--,"prepare"===h&&(b[e]||_(e),0===v&&0===y&&S())}},r.t=function(e,t){return 1&t&&(e=r(e)),C.t(e,-2&t)},r}function l(t){var r={_acceptedDependencies:{},_declinedDependencies:{},_selfAccepted:!1,_selfDeclined:!1,_selfInvalidated:!1,_disposeHandlers:[],_main:n!==t,active:!0,accept:function(e,t){if(void 0===e)r._selfAccepted=!0;else if("function"==typeof e)r._selfAccepted=e;else if("object"==typeof e)for(var n=0;n<e.length;n++)r._acceptedDependencies[e[n]]=t||function(){};else r._acceptedDependencies[e]=t||function(){}},decline:function(e){if(void 0===e)r._selfDeclined=!0;else if("object"==typeof e)for(var t=0;t<e.length;t++)r._declinedDependencies[e[t]]=!0;else r._declinedDependencies[e]=!0},dispose:function(e){r._disposeHandlers.push(e)},addDisposeHandler:function(e){r._disposeHandlers.push(e)},removeDisposeHandler:function(e){var t=r._disposeHandlers.indexOf(e);t>=0&&r._disposeHandlers.splice(t,1)},invalidate:function(){switch(this._selfInvalidated=!0,h){case"idle":(f={})[t]=e[t],d("ready");break;case"ready":R(t);break;case"prepare":case"check":case"dispose":case"apply":(g=g||[]).push(t)}},check:x,apply:M,status:function(e){if(!e)return h;u.push(e)},addStatusHandler:function(e){u.push(e)},removeStatusHandler:function(e){var t=u.indexOf(e);t>=0&&u.splice(t,1)},data:a[t]};return n=void 0,r}var u=[],h="idle";function d(e){h=e;for(var t=0;t<u.length;t++)u[t].call(null,e)}var p,f,m,g,y=0,v=0,b={},w={},A={};function E(e){return+e+""===e?+e:e}function x(e){if("idle"!==h)throw new Error("check() is only allowed in idle status");return r=e,d("check"),(t=1e4,t=t||1e4,new Promise((function(e,n){if("undefined"==typeof XMLHttpRequest)return n(new Error("No browser support"));try{var r=new XMLHttpRequest,a=C.p+""+i+".hot-update.json";r.open("GET",a,!0),r.timeout=t,r.send(null)}catch(e){return n(e)}r.onreadystatechange=function(){if(4===r.readyState)if(0===r.status)n(new Error("Manifest request to "+a+" timed out."));else if(404===r.status)e();else if(200!==r.status&&304!==r.status)n(new Error("Manifest request to "+a+" failed."));else{try{var t=JSON.parse(r.responseText)}catch(e){return void n(e)}e(t)}}}))).then((function(e){if(!e)return d(T()?"ready":"idle"),null;w={},b={},A=e.c,m=e.h,d("prepare");var t=new Promise((function(e,t){p={resolve:e,reject:t}}));f={};return _(0),"prepare"===h&&0===v&&0===y&&S(),t}));var t}function _(e){A[e]?(w[e]=!0,y++,function(e){var t=document.createElement("script");t.charset="utf-8",t.src=C.p+""+e+"."+i+".hot-update.js",document.head.appendChild(t)}(e)):b[e]=!0}function S(){d("ready");var e=p;if(p=null,e)if(r)Promise.resolve().then((function(){return M(r)})).then((function(t){e.resolve(t)}),(function(t){e.reject(t)}));else{var t=[];for(var n in f)Object.prototype.hasOwnProperty.call(f,n)&&t.push(E(n));e.resolve(t)}}function M(t){if("ready"!==h)throw new Error("apply() is only allowed in ready status");return function t(r){var s,c,l,u,h;function p(e){for(var t=[e],n={},r=t.map((function(e){return{chain:[e],id:e}}));r.length>0;){var i=r.pop(),a=i.id,o=i.chain;if((u=k[a])&&(!u.hot._selfAccepted||u.hot._selfInvalidated)){if(u.hot._selfDeclined)return{type:"self-declined",chain:o,moduleId:a};if(u.hot._main)return{type:"unaccepted",chain:o,moduleId:a};for(var s=0;s<u.parents.length;s++){var c=u.parents[s],l=k[c];if(l){if(l.hot._declinedDependencies[a])return{type:"declined",chain:o.concat([c]),moduleId:a,parentId:c};-1===t.indexOf(c)&&(l.hot._acceptedDependencies[a]?(n[c]||(n[c]=[]),y(n[c],[a])):(delete n[c],t.push(c),r.push({chain:o.concat([c]),id:c})))}}}}return{type:"accepted",moduleId:e,outdatedModules:t,outdatedDependencies:n}}function y(e,t){for(var n=0;n<t.length;n++){var r=t[n];-1===e.indexOf(r)&&e.push(r)}}T();var v={},b=[],w={},x=function(){console.warn("[HMR] unexpected require("+S.moduleId+") to disposed module")};for(var _ in f)if(Object.prototype.hasOwnProperty.call(f,_)){var S;h=E(_),S=f[_]?p(h):{type:"disposed",moduleId:_};var M=!1,R=!1,O=!1,P="";switch(S.chain&&(P="\nUpdate propagation: "+S.chain.join(" -> ")),S.type){case"self-declined":r.onDeclined&&r.onDeclined(S),r.ignoreDeclined||(M=new Error("Aborted because of self decline: "+S.moduleId+P));break;case"declined":r.onDeclined&&r.onDeclined(S),r.ignoreDeclined||(M=new Error("Aborted because of declined dependency: "+S.moduleId+" in "+S.parentId+P));break;case"unaccepted":r.onUnaccepted&&r.onUnaccepted(S),r.ignoreUnaccepted||(M=new Error("Aborted because "+h+" is not accepted"+P));break;case"accepted":r.onAccepted&&r.onAccepted(S),R=!0;break;case"disposed":r.onDisposed&&r.onDisposed(S),O=!0;break;default:throw new Error("Unexception type "+S.type)}if(M)return d("abort"),Promise.reject(M);if(R)for(h in w[h]=f[h],y(b,S.outdatedModules),S.outdatedDependencies)Object.prototype.hasOwnProperty.call(S.outdatedDependencies,h)&&(v[h]||(v[h]=[]),y(v[h],S.outdatedDependencies[h]));O&&(y(b,[S.moduleId]),w[h]=x)}var I,N=[];for(c=0;c<b.length;c++)h=b[c],k[h]&&k[h].hot._selfAccepted&&w[h]!==x&&!k[h].hot._selfInvalidated&&N.push({module:h,parents:k[h].parents.slice(),errorHandler:k[h].hot._selfAccepted});d("dispose"),Object.keys(A).forEach((function(e){!1===A[e]&&function(e){delete installedChunks[e]}(e)}));var L,D,F=b.slice();for(;F.length>0;)if(h=F.pop(),u=k[h]){var j={},U=u.hot._disposeHandlers;for(l=0;l<U.length;l++)(s=U[l])(j);for(a[h]=j,u.hot.active=!1,delete k[h],delete v[h],l=0;l<u.children.length;l++){var B=k[u.children[l]];B&&((I=B.parents.indexOf(h))>=0&&B.parents.splice(I,1))}}for(h in v)if(Object.prototype.hasOwnProperty.call(v,h)&&(u=k[h]))for(D=v[h],l=0;l<D.length;l++)L=D[l],(I=u.children.indexOf(L))>=0&&u.children.splice(I,1);d("apply"),void 0!==m&&(i=m,m=void 0);for(h in f=void 0,w)Object.prototype.hasOwnProperty.call(w,h)&&(e[h]=w[h]);var V=null;for(h in v)if(Object.prototype.hasOwnProperty.call(v,h)&&(u=k[h])){D=v[h];var z=[];for(c=0;c<D.length;c++)if(L=D[c],s=u.hot._acceptedDependencies[L]){if(-1!==z.indexOf(s))continue;z.push(s)}for(c=0;c<z.length;c++){s=z[c];try{s(D)}catch(e){r.onErrored&&r.onErrored({type:"accept-errored",moduleId:h,dependencyId:D[c],error:e}),r.ignoreErrored||V||(V=e)}}}for(c=0;c<N.length;c++){var H=N[c];h=H.module,o=H.parents,n=h;try{C(h)}catch(e){if("function"==typeof H.errorHandler)try{H.errorHandler(e)}catch(t){r.onErrored&&r.onErrored({type:"self-accept-error-handler-errored",moduleId:h,error:t,originalError:e}),r.ignoreErrored||V||(V=t),V||(V=e)}else r.onErrored&&r.onErrored({type:"self-accept-errored",moduleId:h,error:e}),r.ignoreErrored||V||(V=e)}}if(V)return d("fail"),Promise.reject(V);if(g)return t(r).then((function(e){return b.forEach((function(t){e.indexOf(t)<0&&e.push(t)})),e}));return d("idle"),new Promise((function(e){e(b)}))}(t=t||{})}function T(){if(g)return f||(f={}),g.forEach(R),g=void 0,!0}function R(t){Object.prototype.hasOwnProperty.call(f,t)||(f[t]=e[t])}var k={};function C(t){if(k[t])return k[t].exports;var n=k[t]={i:t,l:!1,exports:{},hot:l(t),parents:(s=o,o=[],s),children:[]};return e[t].call(n.exports,n,n.exports,c(t)),n.l=!0,n.exports}C.m=e,C.c=k,C.d=function(e,t,n){C.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},C.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},C.t=function(e,t){if(1&t&&(e=C(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(C.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)C.d(n,r,function(t){return e[t]}.bind(null,r));return n},C.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return C.d(t,"a",t),t},C.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},C.p="",C.h=function(){return i},c(40)(C.s=40)}([function(e,t){const n={OFF:"#111",WHITE:"#f0f0f0",DARKRED:"#5A354B",RED:"#f971c3",BRIGHTRED:"#ffd3ee",DARKBLUE:"#2B4D4C",BLUE:"#6ff9ea",BRIGHTBLUE:"#d7fdf9",YELLOW:"#fff568",UI_ACCENT:"#08bfa2",UI_ACCENT2:"#f01978"};n.schemes={default:{name:"Super Medium",off:"#111",primary:n.RED,primarybright:n.BRIGHTRED,secondary:n.BLUE,secondarybright:n.BRIGHTBLUE,tertiary:n.YELLOW},blue:{name:"Star Warrior",off:"#111",primary:"#1e4482",primarybright:"#0B4BB3",secondary:"#c27727",secondarybright:"#FFD840",tertiary:"#d7fdf9"},purple:{name:"Galactic Royal",off:"#111",primary:"#6A39B3",primarybright:"#B685FF",secondary:"#FAF239",secondarybright:"#FFFC9E",tertiary:"#50FFF2"},green:{name:"Space Joker",off:"#111",primary:"#779E37",primarybright:"#C0FF59",secondary:"#6A39B3",secondarybright:"#B685FF",tertiary:"#FAFAFA"},yellow:{name:"Solar Flare",off:"#111",primary:"#C2C04C",primarybright:"#FAF761",secondary:"#E03A3E",secondarybright:"#FA7578",tertiary:"#278ECC"},red:{name:"Trail Blazer",off:"#111",primary:"#E03A3E",primarybright:"#FA7578",secondary:"#DADADA",secondarybright:"#EFEFEF",tertiary:"#666"},rgb:{name:"Mint Choco",off:"#111",primary:"#34eb89",primarYBRIGht:"#40fb95",secondary:"#34ebd8",secondarybright:"#40fbeA",tertiary:"#eb3434"},cheetah:{name:"Cheetah SoL",off:"#111",primary:"#c27727",primarYBright:"#e68319",secondary:"#635c54",secondarybright:"#8a857f",tertiary:"#ebebeb"},black:{name:"Ash Nova",off:"#111",primary:"#555",primarybright:"#808080",secondary:"#FFF",secondarybright:"#FFF",tertiary:"#B8B8B8"}},n.options=Object.keys(n.schemes),"undefined"==typeof localStorage?n.initial="default":n.initial=n.schemes[localStorage.getItem("colorScheme")||"blue"],e.exports=n},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},,function(e,t){var n,r,i=e.exports={};function a(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===a||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:a}catch(e){n=a}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(e){r=o}}();var c,l=[],u=!1,h=-1;function d(){u&&c&&(u=!1,c.length?l=c.concat(l):h=-1,l.length&&p())}function p(){if(!u){var e=s(d);u=!0;for(var t=l.length;t;){for(c=l,l=[];++h<t;)c&&c[h].run();h=-1,t=l.length}c=null,u=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===o||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function f(e,t){this.fun=e,this.array=t}function m(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];l.push(new f(e,t)),1!==l.length||u||s(p)},f.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=m,i.addListener=m,i.once=m,i.off=m,i.removeListener=m,i.removeAllListeners=m,i.emit=m,i.prependListener=m,i.prependOnceListener=m,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},,,function(e,t){var n;e.exports.getS3FileUrl=function(e,t){return`https://previews.three.ws/${e}-${t}?v=2`},console.line=(n={},function(e,t,r,i){i=i||"#FFF",n[r=r||"default"]||(n[r]=document.createElement("a-entity"),n[r].setAttribute("line","color",i||"#FFF"),n[r].setAttribute("id",r),AFRAME.scenes[0].appendChild(n[r])),n[r].setAttribute("line","start",e.clone()),n[r].setAttribute("line","end",t.clone())}),console.vec3=function(){const e={},t={primitive:"box",width:.05,height:.05,depth:.05},n={shader:"flat"};return function(r,i,a){a=a||"#FFF",e[i=i||"default"]||(e[i]=document.createElement("a-entity"),n.color=a||"#FFF",e[i].setAttribute("geometry",t),e[i].setAttribute("material",n),e[i].setAttribute("id",i),e[i].setAttribute("text",{align:"center",value:i,side:"double"}),AFRAME.scenes[0].appendChild(e[i])),e[i].object3D.position.copy(r)}}()},function(e,t){e.exports="varying vec2 uvs;\nvarying float distance;\nvoid main() {\n uvs.xy = uv.xy;\n distance = length((modelMatrix * vec4(position, 1.0)).xyz - cameraPosition);\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n"},function(e,t){e.exports="varying vec2 uvs;\nvarying float distance;\nuniform sampler2D src;\nuniform vec3 color;\n\nvoid main() {\n float alpha = texture2D(src, uvs).a;\n alpha *= 1.0 - clamp(distance / 40.0, 0.0, 1.0);\n gl_FragColor = vec4(color, alpha);\n}\n"},,,function(e,t,n){"use strict";n.r(t),n.d(t,"__extends",(function(){return i})),n.d(t,"__assign",(function(){return a})),n.d(t,"__rest",(function(){return o})),n.d(t,"__decorate",(function(){return s})),n.d(t,"__param",(function(){return c})),n.d(t,"__metadata",(function(){return l})),n.d(t,"__awaiter",(function(){return u})),n.d(t,"__generator",(function(){return h})),n.d(t,"__exportStar",(function(){return d})),n.d(t,"__values",(function(){return p})),n.d(t,"__read",(function(){return f})),n.d(t,"__spread",(function(){return m})),n.d(t,"__spreadArrays",(function(){return g})),n.d(t,"__await",(function(){return y})),n.d(t,"__asyncGenerator",(function(){return v})),n.d(t,"__asyncDelegator",(function(){return b})),n.d(t,"__asyncValues",(function(){return w})),n.d(t,"__makeTemplateObject",(function(){return A})),n.d(t,"__importStar",(function(){return E})),n.d(t,"__importDefault",(function(){return x}));
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
@@ -340,7 +340,7 @@ function r(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;v
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- */var i;n.r(t),n.d(t,"LogLevel",(function(){return a})),n.d(t,"Logger",(function(){return h})),n.d(t,"setLogLevel",(function(){return d})),n.d(t,"setUserLogHandler",(function(){return p}));var a,o=[];!function(e){e[e.DEBUG=0]="DEBUG",e[e.VERBOSE=1]="VERBOSE",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR",e[e.SILENT=5]="SILENT"}(a||(a={}));var s={debug:a.DEBUG,verbose:a.VERBOSE,info:a.INFO,warn:a.WARN,error:a.ERROR,silent:a.SILENT},c=a.INFO,l=((i={})[a.DEBUG]="log",i[a.VERBOSE]="log",i[a.INFO]="info",i[a.WARN]="warn",i[a.ERROR]="error",i),u=function(e,t){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];if(!(t<e.logLevel)){var a=(new Date).toISOString(),o=l[t];if(!o)throw new Error("Attempted to log a message with an invalid logType (value: "+t+")");console[o].apply(console,r(["["+a+"] "+e.name+":"],n))}},h=function(){function e(e){this.name=e,this._logLevel=c,this._logHandler=u,this._userLogHandler=null,o.push(this)}return Object.defineProperty(e.prototype,"logLevel",{get:function(){return this._logLevel},set:function(e){if(!(e in a))throw new TypeError('Invalid value "'+e+'" assigned to `logLevel`');this._logLevel=e},enumerable:!1,configurable:!0}),e.prototype.setLogLevel=function(e){this._logLevel="string"==typeof e?s[e]:e},Object.defineProperty(e.prototype,"logHandler",{get:function(){return this._logHandler},set:function(e){if("function"!=typeof e)throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"userLogHandler",{get:function(){return this._userLogHandler},set:function(e){this._userLogHandler=e},enumerable:!1,configurable:!0}),e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._userLogHandler&&this._userLogHandler.apply(this,r([this,a.DEBUG],e)),this._logHandler.apply(this,r([this,a.DEBUG],e))},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._userLogHandler&&this._userLogHandler.apply(this,r([this,a.VERBOSE],e)),this._logHandler.apply(this,r([this,a.VERBOSE],e))},e.prototype.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._userLogHandler&&this._userLogHandler.apply(this,r([this,a.INFO],e)),this._logHandler.apply(this,r([this,a.INFO],e))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._userLogHandler&&this._userLogHandler.apply(this,r([this,a.WARN],e)),this._logHandler.apply(this,r([this,a.WARN],e))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._userLogHandler&&this._userLogHandler.apply(this,r([this,a.ERROR],e)),this._logHandler.apply(this,r([this,a.ERROR],e))},e}();function d(e){o.forEach((function(t){t.setLogLevel(e)}))}function p(e,t){for(var n=function(n){var r=null;t&&t.level&&(r=s[t.level]),n.userLogHandler=null===e?null:function(t,n){for(var i=[],o=2;o<arguments.length;o++)i[o-2]=arguments[o];var s=i.map((function(e){if(null==e)return null;if("string"==typeof e)return e;if("number"==typeof e||"boolean"==typeof e)return e.toString();if(e instanceof Error)return e.message;try{return JSON.stringify(e)}catch(e){return null}})).filter((function(e){return e})).join(" ");n>=(null!=r?r:t.logLevel)&&e({level:a[n].toLowerCase(),message:s,args:i,type:t.name})}},r=0,i=o;r<i.length;r++){n(i[r])}}},function(e,t){e.exports="#define T time * 0.06\nvarying vec2 uvs;\nuniform float time;\nuniform float thickness;\nvoid main() {\n uvs.xy = uv.xy;\n vec3 pos = position;\n\n pos.x *= thickness + sin(T) * ((0.1 + uv.x) * 16.0 + uv.y * 4.9) * thickness * 0.005;\n pos.z *= thickness + cos(T) * ((0.1 + uv.x) * 13.0 + uv.y * 14.9) * thickness * 0.005;\n\n gl_Position = projectionMatrix * modelViewMatrix * vec4(pos, 1.0);\n}"},function(e,t){e.exports="varying vec2 uvs;\nuniform sampler2D src;\nuniform vec3 color;\nuniform float time;\n\n#define T time * 0.04\n\nvoid main() {\n vec2 uv = uvs;\n uv += T * 0.05;\n vec3 col = texture2D(src, uv).xyz;\n float core = step(0.125, uvs.x);\n gl_FragColor = vec4(col * color, mix(1.0, 0.07, core));\n}"},function(e,t){e.exports="varying vec2 uvs;\nuniform sampler2D src;\nuniform vec3 color;\nuniform float time;\n\n#define T time * 0.03\n\nvoid main() {\n vec3 col = texture2D(src, uvs * vec2(1.0, 0.7) + vec2(T * 0.01, T * 0.05)).xyz;\n gl_FragColor = vec4(col * color, 0.4 * uvs.y);\n}\n"},function(e,t){e.exports=function(e){if(e.converted)return e;e.map&&(e=e.map),e.version=e.versions[0].hash,e.directDownload=e.versions[0].downloadURL,e.coverURL=e.versions[0].coverURL.replace(/^https?:\/\/[^/]+\//,"https://eu.cdn.beatsaver.com/");let t=e.versions[0].diffs;e.metadata.characteristics={};for(const n of t)void 0===e.metadata.characteristics[n.characteristic]&&(e.metadata.characteristics[n.characteristic]={}),e.metadata.characteristics[n.characteristic][n.difficulty]=n;return e.metadata.characteristics=JSON.stringify(e.metadata.characteristics),e.converted=!0,e}},,,,,,,,,,,,function(e,t,n){function r(e){e.keys().forEach(e)}console.time=()=>{},console.timeEnd=()=>{},n(41),n(42),n(43),n(44),n(45),n(46),n(48),n(49),AFRAME.log=()=>{},n(51),n(53),n(54),n(55),n(56),n(57),r(n(58)),r(n(192)),n(196),n(203),e.hot.accept(),"http:"!==window.location.protocol||window.location.host.startsWith("localhost")||window.location.replace("https:"+location.href.substring(location.protocol.length))},function(e,t){THREE.BufferGeometryUtils={computeTangents:function(e){var t=e.index,n=e.attributes;if(null!==t&&void 0!==n.position&&void 0!==n.normal&&void 0!==n.uv){var r=t.array,i=n.position.array,a=n.normal.array,o=n.uv.array,s=i.length/3;void 0===n.tangent&&e.addAttribute("tangent",new THREE.BufferAttribute(new Float32Array(4*s),4));for(var c=n.tangent.array,l=[],u=[],h=0;h<s;h++)l[h]=new THREE.Vector3,u[h]=new THREE.Vector3;var d=new THREE.Vector3,p=new THREE.Vector3,f=new THREE.Vector3,m=new THREE.Vector2,g=new THREE.Vector2,y=new THREE.Vector2,v=new THREE.Vector3,b=new THREE.Vector3,w=e.groups;0===w.length&&(w=[{start:0,count:r.length}]);for(var A=0,E=w.length;A<E;++A)for(var x=I=(P=w[A]).start,_=I+P.count;x<_;x+=3)N(r[x+0],r[x+1],r[x+2]);var S,M,T,R=new THREE.Vector3,k=new THREE.Vector3,C=new THREE.Vector3,O=new THREE.Vector3;for(A=0,E=w.length;A<E;++A){var P,I;for(x=I=(P=w[A]).start,_=I+P.count;x<_;x+=3)L(r[x+0]),L(r[x+1]),L(r[x+2])}}else console.warn("THREE.BufferGeometry: Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()");function N(e,t,n){d.fromArray(i,3*e),p.fromArray(i,3*t),f.fromArray(i,3*n),m.fromArray(o,2*e),g.fromArray(o,2*t),y.fromArray(o,2*n);var r=p.x-d.x,a=f.x-d.x,s=p.y-d.y,c=f.y-d.y,h=p.z-d.z,w=f.z-d.z,A=g.x-m.x,E=y.x-m.x,x=g.y-m.y,_=y.y-m.y,S=1/(A*_-E*x);v.set((_*r-x*a)*S,(_*s-x*c)*S,(_*h-x*w)*S),b.set((A*a-E*r)*S,(A*c-E*s)*S,(A*w-E*h)*S),l[e].add(v),l[t].add(v),l[n].add(v),u[e].add(b),u[t].add(b),u[n].add(b)}function L(e){C.fromArray(a,3*e),O.copy(C),M=l[e],R.copy(M),R.sub(C.multiplyScalar(C.dot(M))).normalize(),k.crossVectors(O,M),T=k.dot(u[e]),S=T<0?-1:1,c[4*e]=R.x,c[4*e+1]=R.y,c[4*e+2]=R.z,c[4*e+3]=S}},mergeBufferGeometries:function(e,t){for(var n=null!==e[0].index,r=new Set(Object.keys(e[0].attributes)),i=new Set(Object.keys(e[0].morphAttributes)),a={},o={},s=new THREE.BufferGeometry,c=0,l=0;l<e.length;++l){var u=e[l];if(n!==(null!==u.index))return null;for(var h in u.attributes){if(!r.has(h))return null;void 0===a[h]&&(a[h]=[]),a[h].push(u.attributes[h])}for(var h in u.morphAttributes){if(!i.has(h))return null;void 0===o[h]&&(o[h]=[]),o[h].push(u.morphAttributes[h])}if(s.userData.mergedUserData=s.userData.mergedUserData||[],s.userData.mergedUserData.push(u.userData),t){var d;if(n)d=u.index.count;else{if(void 0===u.attributes.position)return null;d=u.attributes.position.count}s.addGroup(c,d,l),c+=d}}if(n){var p=0,f=[];for(l=0;l<e.length;++l){var m=e[l].index;if(p>0){m=m.clone();for(var g=0;g<m.count;++g)m.setX(g,m.getX(g)+p)}f.push(m),p+=e[l].attributes.position.count}var y=this.mergeBufferAttributes(f);if(!y)return null;s.index=y}for(var h in a){var v=this.mergeBufferAttributes(a[h]);if(!v)return null;s.addAttribute(h,v)}for(var h in o){var b=o[h][0].length;if(0===b)break;s.morphAttributes=s.morphAttributes||{},s.morphAttributes[h]=[];for(l=0;l<b;++l){var w=[];for(g=0;g<o[h].length;++g)w.push(o[h][g][l]);var A=this.mergeBufferAttributes(w);if(!A)return null;s.morphAttributes[h].push(A)}}return s},mergeBufferAttributes:function(e){for(var t,n,r,i=0,a=0;a<e.length;++a){var o=e[a];if(o.isInterleavedBufferAttribute)return null;if(void 0===t&&(t=o.array.constructor),t!==o.array.constructor)return null;if(void 0===n&&(n=o.itemSize),n!==o.itemSize)return null;if(void 0===r&&(r=o.normalized),r!==o.normalized)return null;i+=o.array.length}for(var s=new t(i),c=0,l=0;l<e.length;++l)s.set(e[l].array,c),c+=e[l].array.length;return new THREE.BufferAttribute(s,n,r)},toTrianglesDrawMode:function(e,t){if(t===THREE.TrianglesDrawMode)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),e;if(t===THREE.TriangleFanDrawMode||t===THREE.TriangleStripDrawMode){var n=e.getIndex();if(null===n){var r=[],i=e.getAttribute("position");if(void 0===i)return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),e;for(var a=0;a<i.count;a++)r.push(a);e.setIndex(r),n=e.getIndex()}var o=n.count-2,s=[];if(t===THREE.TriangleFanDrawMode)for(a=1;a<=o;a++)s.push(n.getX(0)),s.push(n.getX(a)),s.push(n.getX(a+1));else for(a=0;a<o;a++)a%2==0?(s.push(n.getX(a)),s.push(n.getX(a+1)),s.push(n.getX(a+2))):(s.push(n.getX(a+2)),s.push(n.getX(a+1)),s.push(n.getX(a)));s.length/3!==o&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");var c=e.clone();return c.setIndex(s),c.clearGroups(),c}return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",t),e}}},function(e,t){if("undefined"==typeof AFRAME)throw new Error("Component attempted to register before AFRAME was available.");const n={childList:!0,attributes:!0,subtree:!0};AFRAME.registerComponent("aabb-collider",{schema:{collideNonVisible:{default:!1},debug:{default:!1},enabled:{default:!0},interval:{default:80},objects:{default:""}},init:function(){this.centerDifferenceVec3=new THREE.Vector3,this.clearedIntersectedEls=[],this.closestIntersectedEl=null,this.boundingBox=new THREE.Box3,this.boxCenter=new THREE.Vector3,this.boxHelper=new THREE.BoxHelper,this.boxMax=new THREE.Vector3,this.boxMin=new THREE.Vector3,this.hitClosestClearEventDetail={},this.hitClosestEventDetail={},this.intersectedEls=[],this.objectEls=[],this.newIntersectedEls=[],this.prevCheckTime=void 0,this.previousIntersectedEls=[],this.setDirty=this.setDirty.bind(this),this.observer=new MutationObserver(this.setDirty),this.dirty=!0,this.hitStartEventDetail={intersectedEls:this.newIntersectedEls}},play:function(){this.observer.observe(this.el.sceneEl,n),this.el.sceneEl.addEventListener("object3dset",this.setDirty),this.el.sceneEl.addEventListener("object3dremove",this.setDirty)},remove:function(){this.observer.disconnect(),this.el.sceneEl.removeEventListener("object3dset",this.setDirty),this.el.sceneEl.removeEventListener("object3dremove",this.setDirty)},tick:function(e){const t=this.boundingBox,n=this.centerDifferenceVec3,r=this.clearedIntersectedEls,i=this.el,a=this.intersectedEls,o=this.newIntersectedEls,s=this.objectEls,c=this.prevCheckTime,l=this.previousIntersectedEls;let u,h,d;if(this.data.enabled&&!(c&&e-c<this.data.interval)){for(this.prevCheckTime=e,this.dirty&&this.refreshObjects(),t.setFromObject(i.object3D),this.boxMin.copy(t.min),this.boxMax.copy(t.max),t.getCenter(this.boxCenter),this.data.debug&&(this.boxHelper.setFromObject(i.object3D),this.boxHelper.parent||i.sceneEl.object3D.add(this.boxHelper)),function(e,t){e.length=0;for(let n=0;n<t.length;n++)e[n]=t[n]}(l,a),a.length=0,d=0;d<s.length;d++)if(s[d]!==this.el)if(this.data.collideNonVisible||s[d].getAttribute("visible"))this.isIntersecting(s[d])&&a.push(s[d]);else if(this.data.debug){const e=s[d].object3D.boxHelper;e&&(i.sceneEl.object3D.remove(e),s[d].object3D.boxHelper=null)}for(o.length=0,d=0;d<a.length;d++)-1===l.indexOf(a[d])&&o.push(a[d]);for(r.length=0,d=0;d<l.length;d++)-1===a.indexOf(l[d])&&(l[d].hasAttribute("aabb-collider")||l[d].emit("hitend"),r.push(l[d]));for(d=0;d<o.length;d++)o[d]!==this.el&&(o[d].hasAttribute("aabb-collider")||o[d].emit("hitstart"));for(d=0;d<a.length;d++)a[d]!==this.el&&(n.copy(a[d].object3D.boundingBoxCenter).sub(this.boxCenter),(void 0===u||n.length()<u)&&(u=n.length(),h=a[d]));!a.length&&this.closestIntersectedEl?(this.hitClosestClearEventDetail.el=this.closestIntersectedEl,this.closestIntersectedEl.emit("hitclosestclear"),this.closestIntersectedEl=null,i.emit("hitclosestclear",this.hitClosestClearEventDetail)):h!==this.closestIntersectedEl&&(this.closestIntersectedEl&&(this.hitClosestClearEventDetail.el=this.closestIntersectedEl,this.closestIntersectedEl.emit("hitclosestclear",this.hitClosestClearEventDetail)),h&&(h.emit("hitclosest"),this.closestIntersectedEl=h,this.hitClosestEventDetail.el=h,i.emit("hitclosest",this.hitClosestEventDetail))),r.length&&i.emit("hitend"),o.length&&i.emit("hitstart",this.hitStartEventDetail)}},isIntersecting:function(){const e=new THREE.Box3;return function(t){let n;t.dataset.aabbColliderDynamic&&(e.setFromObject(t.object3D),n=e,t.object3D.boundingBoxCenter=t.object3D.boundingBoxCenter||new THREE.Vector3,n.getCenter(t.object3D.boundingBoxCenter)),t.dataset.aabbColliderDynamic||(t.object3D.aabbBox||(t.object3D.aabbBox=(new THREE.Box3).setFromObject(t.object3D),t.object3D.boundingBoxCenter=new THREE.Vector3,t.object3D.aabbBox.getCenter(t.object3D.boundingBoxCenter)),n=t.object3D.aabbBox),this.data.debug&&(t.object3D.boxHelper||(t.object3D.boxHelper=new THREE.BoxHelper(t.object3D,new THREE.Color(Math.random(),Math.random(),Math.random())),t.sceneEl.object3D.add(t.object3D.boxHelper)),t.object3D.boxHelper.setFromObject(t.object3D));const r=n.min,i=n.max;return this.boxMin.x<=i.x&&this.boxMax.x>=r.x&&this.boxMin.y<=i.y&&this.boxMax.y>=r.y&&this.boxMin.z<=i.z&&this.boxMax.z>=r.z}}(),setDirty:function(){this.dirty=!0},refreshObjects:function(){const e=this.data;this.objectEls=e.objects?this.el.sceneEl.querySelectorAll(e.objects):this.el.sceneEl.children,this.dirty=!1}})},function(e,t){var n=[new THREE.Vector2,new THREE.Vector2,new THREE.Vector2,new THREE.Vector2];function r(e,t,r,i){const a=1/i,o=1/r;return n[0].set(a*t,o*e+o),n[1].set(a*t,o*e),n[2].set(a*t+a,o*e),n[3].set(a*t+a,o*e+o),n}AFRAME.registerComponent("atlas-uvs",{dependencies:["geometry"],schema:{totalColumns:{type:"int",default:1},totalRows:{type:"int",default:1},column:{type:"int",default:1},row:{type:"int",default:1}},update:function(){const e=this.data,t=r(e.row-1,e.column-1,e.totalRows,e.totalColumns),n=this.el.getObject3D("mesh").geometry;var i=new Float32Array([t[0].x,t[0].y,t[3].x,t[3].y,t[1].x,t[1].y,t[2].x,t[2].y]);n.setAttribute("uv",new THREE.BufferAttribute(i,2)),n.uvsNeedUpdate=!0}}),AFRAME.registerComponent("dynamic-texture-atlas",{schema:{canvasId:{default:"dynamicAtlas"},canvasHeight:{default:1024},canvasWidth:{default:1024},debug:{default:!1},numColumns:{default:8},numRows:{default:8}},multiple:!0,init:function(){const e=this.canvas=document.createElement("canvas");e.id=this.data.canvasId,e.height=this.data.canvasHeight,e.width=this.data.canvasWidth,this.ctx=e.getContext("2d"),document.body.appendChild(e),this.data.debug&&(e.style.left=0,e.style.top=0,e.style.position="fixed",e.style.zIndex=9999999999)},drawTexture:function(e,t,n,i,a){const o=this.canvas,s=this.data;e.complete||(e.onload=()=>{this.drawTexture(e,t,n)});const c=a||o.height/s.numRows,l=i||o.width/s.numColumns;return this.ctx.drawImage(e,l*t,l*n,l,c),r(t,n,s.numRows,s.numColumns)}}),e.exports.getGridUvs=r},function(e,t){if("undefined"==typeof AFRAME)throw new Error("Component attempted to register before AFRAME was available.");var n={};AFRAME.registerComponent("audioanalyser",{schema:{buffer:{default:!1},beatDetectionDecay:{default:.99},beatDetectionMinVolume:{default:15},beatDetectionThrottle:{default:250},cache:{default:!1},enabled:{default:!0},enableBeatDetection:{default:!0},enableLevels:{default:!0},enableWaveform:{default:!0},enableVolume:{default:!0},fftSize:{default:2048},smoothingTimeConstant:{default:.8},src:{parse:function(e){return e.constructor!==String?e:e.startsWith("#")||e.startsWith(".")?document.querySelector(e):e}},unique:{default:!1}},init:function(){this.audioEl=null,this.levels=null,this.waveform=null,this.volume=0,this.xhr=null,this.initContext()},update:function(e){var t=this.analyser,n=this.data;e.fftSize===n.fftSize&&e.smoothingTimeConstant===n.smoothingTimeConstant||(t.fftSize=n.fftSize,t.smoothingTimeConstant=n.smoothingTimeConstant,this.levels=new Uint8Array(t.frequencyBinCount),this.waveform=new Uint8Array(t.fftSize)),n.src&&this.refreshSource()},tick:function(e,t){var n,r=this.data;if(r.enabled){if((r.enableLevels||r.enableVolume)&&this.analyser.getByteFrequencyData(this.levels),r.enableWaveform&&this.analyser.getByteTimeDomainData(this.waveform),r.enableVolume||r.enableBeatDetection){for(var i=0,a=0;a<this.levels.length;a++)i+=this.levels[a];this.volume=i/this.levels.length}r.enableBeatDetection&&(n=this.volume,this.beatCutOff||(this.beatCutOff=n),n>this.beatCutOff&&n>this.data.beatDetectionMinVolume?(this.el.emit("audioanalyserbeat",null,!1),this.beatCutOff=1.5*n,this.beatTime=0):this.beatTime<=this.data.beatDetectionThrottle?this.beatTime+=t:(this.beatCutOff*=this.data.beatDetectionDecay,this.beatCutOff=Math.max(this.beatCutOff,this.data.beatDetectionMinVolume)))}},initContext:function(){var e,t=this.data;this.context=new(window.webkitAudioContext||window.AudioContext),e=this.analyser=this.context.createAnalyser(),(this.gainNode=this.context.createGain()).connect(e),e.connect(this.context.destination),e.fftSize=t.fftSize,e.smoothingTimeConstant=t.smoothingTimeConstant,this.levels=new Uint8Array(e.frequencyBinCount),this.waveform=new Uint8Array(e.fftSize)},refreshSource:function(){this.analyser;var e=this.data;e.buffer&&e.src.constructor===String?this.getBufferSource().then(e=>{this.source=e,this.source.connect(this.gainNode)}):(this.source=this.getMediaSource(),this.source.connect(this.gainNode))},suspendContext:function(){this.context.suspend()},resumeContext:function(){this.context.resume()},fetchAudioBuffer:function(e){return n[e]?n[e].constructor===Promise?n[e]:Promise.resolve(n[e]):(this.data.cache||Object.keys(n).forEach((function(e){delete n[e]})),n[e]=new Promise(t=>{const r=this.xhr=new XMLHttpRequest;r.open("GET",e),r.responseType="arraybuffer",r.addEventListener("load",()=>{function i(r){n[e]=r,t(r)}const a=this.context.decodeAudioData(r.response,i);a&&a.constructor===Promise&&a.then(i).catch(console.error)}),r.send()}),n[e])},getBufferSource:function(){var e=this.data;return this.fetchAudioBuffer(e.src).then(()=>{var t;return(t=this.context.createBufferSource()).buffer=n[e.src],this.el.emit("audioanalyserbuffersource",t,!1),t}).catch(console.error)},getMediaSource:function(){const e={};return function(){const t=this.data.src.constructor===String?this.data.src:this.data.src.src;if(e[t])return e[t];this.data.src.constructor===String?(this.audio=document.createElement("audio"),this.audio.crossOrigin="anonymous",this.audio.setAttribute("src",this.data.src)):this.audio=this.data.src;const n=this.context.createMediaElementSource(this.audio);return e[t]=n,n}}()})},function(e,t){var n=AFRAME.utils.styleParser;if("undefined"==typeof AFRAME)throw new Error("Component attempted to register before AFRAME was available.");AFRAME.registerComponent("event-set",{schema:{default:"",parse:function(e){return n.parse(e)}},multiple:!0,init:function(){this.eventHandler=null,this.eventName=null},update:function(e){this.removeEventListener(),this.updateEventListener(),this.addEventListener()},remove:function(){this.removeEventListener()},pause:function(){this.removeEventListener()},play:function(){this.addEventListener()},updateEventListener:function(){var e,t,n,r=this.data,i=this.el;e=r._event||this.id,t=r._target,n=t?i.sceneEl.querySelector(t):i,this.eventName=e;const a=()=>{var e;for(e in r)"_event"!==e&&"_target"!==e&&AFRAME.utils.entity.setComponentProperty.call(this,n,e,r[e])};isNaN(r._delay)?this.eventHandler=a:this.eventHandler=()=>{setTimeout(a,parseFloat(r._delay))}},addEventListener:function(){this.el.addEventListener(this.eventName,this.eventHandler)},removeEventListener:function(){this.el.removeEventListener(this.eventName,this.eventHandler)}})},function(e,t,n){THREE.BufferGeometryUtils||n(47),AFRAME.registerComponent("geometry-merger",{schema:{preserveOriginal:{default:!1}},init:function(){var e=this;this.geometry=new THREE.Geometry,this.mesh=new THREE.Mesh(this.geometry),this.el.setObject3D("mesh",this.mesh),this.faceIndex={},this.vertexIndex={},this.el.object3D.traverse((function(t){"Mesh"===t.type&&t!==e.mesh&&(e.faceIndex[t.parent.uuid]=[e.geometry.faces.length,e.geometry.faces.length+t.geometry.faces.length-1],e.vertexIndex[t.parent.uuid]=[e.geometry.vertices.length,e.geometry.vertices.length+t.geometry.vertices.length-1],t.parent.updateMatrix(),e.geometry.merge(t.geometry,t.parent.matrix),e.data.preserveOriginal||t.parent.remove(t))}))}}),AFRAME.registerComponent("buffer-geometry-merger",{schema:{preserveOriginal:{default:!1}},init:function(){var e=[];this.el.sceneEl.object3D.updateMatrixWorld(),this.el.object3D.traverse((function(t){"Mesh"===t.type&&t.el!==self.el&&(t.geometry.applyMatrix(t.matrixWorld),e.push(t.geometry.clone()),t.parent.remove(t))}));const t=THREE.BufferGeometryUtils.mergeBufferGeometries(e);this.mesh=new THREE.Mesh(t),this.el.setObject3D("mesh",this.mesh)}})},function(e,t){THREE.BufferGeometryUtils={computeTangents:function(e){var t=e.index,n=e.attributes;if(null!==t&&void 0!==n.position&&void 0!==n.normal&&void 0!==n.uv){var r=t.array,i=n.position.array,a=n.normal.array,o=n.uv.array,s=i.length/3;void 0===n.tangent&&e.addAttribute("tangent",new THREE.BufferAttribute(new Float32Array(4*s),4));for(var c=n.tangent.array,l=[],u=[],h=0;h<s;h++)l[h]=new THREE.Vector3,u[h]=new THREE.Vector3;var d=new THREE.Vector3,p=new THREE.Vector3,f=new THREE.Vector3,m=new THREE.Vector2,g=new THREE.Vector2,y=new THREE.Vector2,v=new THREE.Vector3,b=new THREE.Vector3,w=e.groups;0===w.length&&(w=[{start:0,count:r.length}]);h=0;for(var A=w.length;h<A;++h)for(var E=P=(O=w[h]).start,x=P+O.count;E<x;E+=3)I(r[E+0],r[E+1],r[E+2]);var _,S,M,T=new THREE.Vector3,R=new THREE.Vector3,k=new THREE.Vector3,C=new THREE.Vector3;for(h=0,A=w.length;h<A;++h){var O,P;for(E=P=(O=w[h]).start,x=P+O.count;E<x;E+=3)N(r[E+0]),N(r[E+1]),N(r[E+2])}}else console.warn("THREE.BufferGeometry: Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()");function I(e,t,n){d.fromArray(i,3*e),p.fromArray(i,3*t),f.fromArray(i,3*n),m.fromArray(o,2*e),g.fromArray(o,2*t),y.fromArray(o,2*n);var r=p.x-d.x,a=f.x-d.x,s=p.y-d.y,c=f.y-d.y,h=p.z-d.z,w=f.z-d.z,A=g.x-m.x,E=y.x-m.x,x=g.y-m.y,_=y.y-m.y,S=1/(A*_-E*x);v.set((_*r-x*a)*S,(_*s-x*c)*S,(_*h-x*w)*S),b.set((A*a-E*r)*S,(A*c-E*s)*S,(A*w-E*h)*S),l[e].add(v),l[t].add(v),l[n].add(v),u[e].add(b),u[t].add(b),u[n].add(b)}function N(e){k.fromArray(a,3*e),C.copy(k),S=l[e],T.copy(S),T.sub(k.multiplyScalar(k.dot(S))).normalize(),R.crossVectors(C,S),M=R.dot(u[e]),_=M<0?-1:1,c[4*e]=T.x,c[4*e+1]=T.y,c[4*e+2]=T.z,c[4*e+3]=_}},mergeBufferGeometries:function(e,t){for(var n=null!==e[0].index,r=new Set(Object.keys(e[0].attributes)),i=new Set(Object.keys(e[0].morphAttributes)),a={},o={},s=new THREE.BufferGeometry,c=0,l=0;l<e.length;++l){var u=e[l];if(n!==(null!==u.index))return null;for(var h in u.attributes){if(!r.has(h))return null;void 0===a[h]&&(a[h]=[]),a[h].push(u.attributes[h])}for(var h in u.morphAttributes){if(!i.has(h))return null;void 0===o[h]&&(o[h]=[]),o[h].push(u.morphAttributes[h])}if(s.userData&&(s.userData.mergedUserData=s.userData.mergedUserData||[],s.userData.mergedUserData.push(u.userData)),t){var d;if(n)d=u.index.count;else{if(void 0===u.attributes.position)return null;d=u.attributes.position.count}s.addGroup(c,d,l),c+=d}}if(n){var p=0,f=[];for(l=0;l<e.length;++l){for(var m=e[l].index,g=0;g<m.count;++g)f.push(m.getX(g)+p);p+=e[l].attributes.position.count}s.setIndex(f)}for(var h in a){var y=this.mergeBufferAttributes(a[h]);if(!y)return null;s.addAttribute(h,y)}for(var h in o){var v=o[h][0].length;if(0===v)break;s.morphAttributes=s.morphAttributes||{},s.morphAttributes[h]=[];for(l=0;l<v;++l){var b=[];for(g=0;g<o[h].length;++g)b.push(o[h][g][l]);var w=this.mergeBufferAttributes(b);if(!w)return null;s.morphAttributes[h].push(w)}}return s},mergeBufferAttributes:function(e){for(var t,n,r,i=0,a=0;a<e.length;++a){var o=e[a];if(o.isInterleavedBufferAttribute)return null;if(void 0===t&&(t=o.array.constructor),t!==o.array.constructor)return null;if(void 0===n&&(n=o.itemSize),n!==o.itemSize)return null;if(void 0===r&&(r=o.normalized),r!==o.normalized)return null;i+=o.array.length}var s=new t(i),c=0;for(a=0;a<e.length;++a)s.set(e[a].array,c),c+=e[a].array.length;return new THREE.BufferAttribute(s,n,r)}}},function(e,t){if("undefined"==typeof AFRAME)throw new Error("Component attempted to register before AFRAME was available.");AFRAME.registerComponent("haptics",{schema:{actuatorIndex:{default:0},dur:{default:100},enabled:{default:!0},events:{type:"array"},eventsFrom:{type:"string"},force:{default:1}},multiple:!0,init:function(){this.data;var e=this;this.callPulse=function(){e.pulse()};var t=function(){e.gamepad=e.el.components["tracked-controls"].controller,e.gamepad.gamepad&&(e.gamepad=e.gamepad.gamepad),e.gamepad&&e.gamepad.hapticActuators&&e.gamepad.hapticActuators.length&&e.addEventListeners()};this.el.components["tracked-controls"]&&this.el.components["tracked-controls"].controller?t():this.el.addEventListener("controllerconnected",(function(){t()}))},remove:function(){this.removeEventListeners()},pulse:function(e,t){var n=this.data;n.enabled&&this.gamepad&&this.gamepad.hapticActuators&&this.gamepad.hapticActuators[n.actuatorIndex].pulse(e||n.force,t||n.dur)},addEventListeners:function(){var e,t,n=this.data;for(t=n.eventsFrom?document.querySelector(n.eventsFrom):this.el,e=0;e<n.events.length;e++)t.addEventListener(n.events[e],this.callPulse)},removeEventListeners:function(){var e,t,n=this.data;for(t=n.eventsFrom?document.querySelector(n.eventsFrom):this.el,e=0;e<n.events.length;e++)t.removeEventListener(n.events[e],this.callPulse)}})},function(e,t){var n=[],r=new THREE.Vector3;function i(e,t,i){var a,o,s,c,l,h,d=Math.ceil(t/e.columns);for(o=e.marginColumn,s=e.marginRow,i&&(o=e.margin,s=e.margin),l=u(e.align,d),c=u(e.align,e.columns),h=0;h<d;h++)for(a=0;a<e.columns;a++)r.set(0,0,0),0===e.plane.indexOf("x")&&(r.x=(a-c)*o),0===e.plane.indexOf("y")&&(r.y=(a-c)*o),1===e.plane.indexOf("y")&&(r.y=(h-l)*s),1===e.plane.indexOf("z")&&(r.z=(h-l)*s),f(r);return n}function a(e,t){var i,a;for(i=0;i<t;i++)a=isNaN(e.angle)?i*(2*Math.PI)/t:i*e.angle*.01745329252,r.set(0,0,0),0===e.plane.indexOf("x")&&(r.x=e.radius*Math.cos(a)),0===e.plane.indexOf("y")&&(r.y=e.radius*Math.cos(a)),1===e.plane.indexOf("y")&&(r.y=e.radius*Math.sin(a)),1===e.plane.indexOf("z")&&(r.z=e.radius*Math.sin(a)),f(r);return n}function o(e,t){return e.columns=t,i(e,t,!0)}function s(e,t){return p(1,0,0,0,1,0,0,0,1,-1,0,0,0,-1,0,0,0,-1),h(e.radius/2),n}function c(e,t){var r=(1+Math.sqrt(5))/2,i=1/r,a=2-r,o=-1*i,s=-1*a;return p(-1,a,0,-1,s,0,0,-1,a,0,-1,s,0,1,a,0,1,s,1,a,0,1,s,0,i,i,i,i,i,o,i,o,i,i,o,o,a,0,1,a,0,-1,o,i,i,o,i,o,o,o,i,o,o,o,s,0,1,s,0,-1),h(e.radius/2),n}function l(e,t){var r=Math.sqrt(3),i=-1/Math.sqrt(3);return p(0,0,r+i,-1,0,i,1,0,i,0,2*Math.sqrt(2/3),0),h(e.radius/2),n}function u(e,t){switch(e){case"start":return t-1;case"center":return(t-1)/2;case"end":return 0}}function h(e){var t;for(t=0;t<n.length;t++)n[t]=n[t]*e}function d(e,t,n){var r,i,a;if(n)for(i=0;i<e.length;i++)null!=(r=e[i].getAttribute(n))&&(a=3*parseInt(r,10),e[i].object3D.position.set(t[a],t[a+1],t[a+2]));else for(i=0;i<t.length;i+=3){if(!e[i/3])return;e[i/3].object3D.position.set(t[i],t[i+1],t[i+2])}}function p(){var e;for(e=0;e<arguments.length;e++)n.push(e)}function f(e){n.push(e.x),n.push(e.y),n.push(e.z)}AFRAME.registerComponent("layout",{schema:{angle:{type:"number",default:!1,min:0,max:360,if:{type:["circle"]}},columns:{default:1,min:0,if:{type:["box"]}},margin:{default:1,min:0,if:{type:["box","line"]}},marginColumn:{default:1,min:0,if:{type:["box"]}},marginRow:{default:1,min:0,if:{type:["box"]}},orderAttribute:{default:""},plane:{default:"xy"},radius:{default:1,min:0,if:{type:["circle","cube","dodecahedron","pyramid"]}},reverse:{default:!1},type:{default:"line",oneOf:["box","circle","cube","dodecahedron","line","pyramid"]},fill:{default:!0,if:{type:["circle"]}},align:{default:"end",oneOf:["start","center","end"]}},init:function(){var e=this,t=this.el;this.children=t.getChildEntities(),this.initialPositions=[],this.children.forEach((function(t){if(t.hasLoaded)return n();function n(){e.initialPositions.push(t.object3D.position.x),e.initialPositions.push(t.object3D.position.y),e.initialPositions.push(t.object3D.position.z)}t.addEventListener("loaded",n)})),this.handleChildAttached=this.handleChildAttached.bind(this),this.handleChildDetached=this.handleChildDetached.bind(this),t.addEventListener("child-attached",this.handleChildAttached),t.addEventListener("child-detached",this.handleChildDetached),t.addEventListener("layoutrefresh",this.update.bind(this))},update:function(e){var t,r,u,h=this.children,p=this.data,f=this.el;switch(r=h.length,p.type){case"box":u=i;break;case"circle":u=a;break;case"cube":u=s;break;case"dodecahedron":u=c;break;case"pyramid":u=l;break;default:u=o}t=f.getDOMAttribute("layout"),n.length=0,n=u(p,r,"string"==typeof t?-1!==t.indexOf("margin"):"margin"in t),p.reverse&&n.reverse(),d(h,n,p.orderAttribute)},remove:function(){this.el.removeEventListener("child-attached",this.handleChildAttached),this.el.removeEventListener("child-detached",this.handleChildDetached),d(this.children,this.initialPositions)},handleChildAttached:function(e){var t=this.el;e.detail.el.parentNode===t&&(this.children.push(e.detail.el),this.update())},handleChildDetached:function(e){-1!==this.children.indexOf(e.detail.el)&&(this.children.splice(this.children.indexOf(e.detail.el),1),this.initialPositions.splice(this.children.indexOf(e.detail.el),1),this.update())}}),e.exports.getBoxPositions=i,e.exports.getCirclePositions=a,e.exports.getLinePositions=o,e.exports.getCubePositions=s,e.exports.getDodecahedronPositions=c,e.exports.getPyramidPositions=l},function(e,t){if("undefined"==typeof AFRAME)throw new Error("Component attempted to register before AFRAME was available.");AFRAME.registerPrimitive("a-log",{defaultComponents:{geometry:{primitive:"plane",height:5},log:{},material:{color:"#111",shader:"flat",side:"double"},text:{color:"lightgreen",baseline:"top",align:"center",height:5}},mappings:{channel:"log.channel"}}),AFRAME.registerSystem("log",{schema:{console:{default:!0}},init:function(){var e=this.data,t=this.logs=[],n=this.loggers=[];AFRAME.log=function(r,i){t.push([r,i]),n.forEach((function(e){e.receiveLog(r,i)})),e.console&&console.log("[log:"+(i||"")+"] "+r)}},registerLogger:function(e){this.loggers.push(e),this.logs.forEach((function(t){e.receiveLog.apply(e,t)}))},unregisterLogger:function(e){this.loggers.splice(this.loggers.indexOf(e),1)}}),AFRAME.registerComponent("log",{schema:{channel:{type:"string"},filter:{type:"string"},max:{default:100},showErrors:{default:!0}},init:function(){this.logs=[],this.system.registerLogger(this)},play:function(){var e=this;this.el.sceneEl.addEventListener("log",(function(t){t.detail&&e.receiveLog(t.detail.message,t.detail.channel)})),window.onerror=function(t,n,r,i,a){e.receiveLog("Error: "+t)}},receiveLog:function(e,t){var n=this.data;"string"!=typeof e&&(e=JSON.stringify(e)),n.channel&&t&&n.channel!==t||n.filter&&-1===e.indexOf(n.filter)||(this.logs.push(e),n.max&&this.logs.length>n.max&&this.logs.shift(),this.el.setAttribute("text",{value:this.logs.join("\n")}))},remove:function(){this.el.removeAttribute("text"),this.system.unregisterLogger(this)}})},function(e,t,n){n(52),AFRAME.registerComponent("orbit-controls",{dependencies:["camera"],schema:{autoRotate:{type:"boolean"},autoRotateSpeed:{default:2},dampingFactor:{default:.1},enabled:{default:!0},enableDamping:{default:!0},enableKeys:{default:!0},enablePan:{default:!0},enableRotate:{default:!0},enableZoom:{default:!0},initialPosition:{type:"vec3"},keyPanSpeed:{default:7},minAzimuthAngle:{type:"number",default:1/0},maxAzimuthAngle:{type:"number",default:1/0},maxDistance:{default:1e3},maxPolarAngle:{default:AFRAME.utils.device.isMobile()?90:120},minDistance:{default:1},minPolarAngle:{default:0},minZoom:{default:0},panSpeed:{default:1},rotateSpeed:{default:.05},screenSpacePanning:{default:!1},target:{type:"vec3"},zoomSpeed:{default:.5}},init:function(){var e,t=this.el;this.controls=new THREE.OrbitControls(t.getObject3D("camera"),t.sceneEl.renderer.domElement),e=new THREE.Vector3,t.sceneEl.addEventListener("enter-vr",()=>{(AFRAME.utils.device.checkHeadsetConnected()||AFRAME.utils.device.isMobile())&&(this.controls.enabled=!1,t.hasAttribute("look-controls")&&(t.setAttribute("look-controls","enabled",!0),e.copy(t.getObject3D("camera").position),t.getObject3D("camera").position.set(0,0,0)))}),t.sceneEl.addEventListener("exit-vr",()=>{(AFRAME.utils.device.checkHeadsetConnected()||AFRAME.utils.device.isMobile())&&(this.controls.enabled=!0,t.getObject3D("camera").position.copy(e),t.hasAttribute("look-controls")&&t.setAttribute("look-controls","enabled",!1))}),document.body.style.cursor="grab",document.addEventListener("mousedown",()=>{document.body.style.cursor="grabbing"}),document.addEventListener("mouseup",()=>{document.body.style.cursor="grab"}),this.target=new THREE.Vector3,t.getObject3D("camera").position.copy(this.data.initialPosition)},update:function(e){var t=this.controls,n=this.data;t.target=this.target.copy(n.target),t.autoRotate=n.autoRotate,t.autoRotateSpeed=n.autoRotateSpeed,t.dampingFactor=n.dampingFactor,t.enabled=n.enabled,t.enableDamping=n.enableDamping,t.enableKeys=n.enableKeys,t.enablePan=n.enablePan,t.enableRotate=n.enableRotate,t.enableZoom=n.enableZoom,t.keyPanSpeed=n.keyPanSpeed,t.maxPolarAngle=THREE.Math.degToRad(n.maxPolarAngle),t.maxDistance=n.maxDistance,t.minDistance=n.minDistance,t.minPolarAngle=THREE.Math.degToRad(n.minPolarAngle),t.minZoom=n.minZoom,t.panSpeed=n.panSpeed,t.rotateSpeed=n.rotateSpeed,t.screenSpacePanning=n.screenSpacePanning,t.zoomSpeed=n.zoomSpeed},tick:function(){var e=this.controls;this.data.enabled&&e.enabled&&(e.enableDamping||e.autoRotate)&&this.controls.update()}})},function(e,t){THREE.OrbitControls=function(e,t){var n,r,i,a,o;this.object=e,this.domElement=void 0!==t?t:document,this.enabled=!0,this.target=new THREE.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.25,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.enableKeys=!0,this.keys={LEFT:37,UP:38,RIGHT:39,BOTTOM:40},this.mouseButtons={ORBIT:THREE.MOUSE.LEFT,ZOOM:THREE.MOUSE.MIDDLE,PAN:THREE.MOUSE.RIGHT},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(){s.target0.copy(s.target),s.position0.copy(s.object.position),s.zoom0=s.object.zoom},this.reset=function(){s.target.copy(s.target0),s.object.position.copy(s.position0),s.object.zoom=s.zoom0,s.object.updateProjectionMatrix(),s.dispatchEvent(c),s.update(),d=h.NONE},this.update=(n=new THREE.Vector3,r=(new THREE.Quaternion).setFromUnitVectors(e.up,new THREE.Vector3(0,1,0)),i=r.clone().inverse(),a=new THREE.Vector3,o=new THREE.Quaternion,function(){var e=s.object.position;return n.copy(e).sub(s.target),n.applyQuaternion(r),f.setFromVector3(n),s.autoRotate&&d===h.NONE&&k(2*Math.PI/60/60*s.autoRotateSpeed),f.theta+=m.theta,f.phi+=m.phi,f.theta=Math.max(s.minAzimuthAngle,Math.min(s.maxAzimuthAngle,f.theta)),f.phi=Math.max(s.minPolarAngle,Math.min(s.maxPolarAngle,f.phi)),f.makeSafe(),f.radius*=g,f.radius=Math.max(s.minDistance,Math.min(s.maxDistance,f.radius)),s.target.add(y),n.setFromSpherical(f),n.applyQuaternion(i),e.copy(s.target).add(n),s.object.lookAt(s.target),!0===s.enableDamping?(m.theta*=1-s.dampingFactor,m.phi*=1-s.dampingFactor):m.set(0,0,0),g=1,y.set(0,0,0),!!(v||a.distanceToSquared(s.object.position)>p||8*(1-o.dot(s.object.quaternion))>p)&&(s.dispatchEvent(c),a.copy(s.object.position),o.copy(s.object.quaternion),v=!1,!0)}),this.dispose=function(){s.domElement.removeEventListener("contextmenu",q,!1),s.domElement.removeEventListener("mousedown",F,!1),s.domElement.removeEventListener("wheel",B,!1),s.domElement.removeEventListener("touchstart",z,!1),s.domElement.removeEventListener("touchend",G,!1),s.domElement.removeEventListener("touchmove",H,!1),document.removeEventListener("mousemove",j,!1),document.removeEventListener("mouseup",U,!1),window.removeEventListener("keydown",V,!1)};var s=this,c={type:"change"},l={type:"start"},u={type:"end"},h={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_DOLLY:4,TOUCH_PAN:5},d=h.NONE,p=1e-6,f=new THREE.Spherical,m=new THREE.Spherical,g=1,y=new THREE.Vector3,v=!1,b=new THREE.Vector2,w=new THREE.Vector2,A=new THREE.Vector2,E=new THREE.Vector2,x=new THREE.Vector2,_=new THREE.Vector2,S=new THREE.Vector2,M=new THREE.Vector2,T=new THREE.Vector2;function R(){return Math.pow(.95,s.zoomSpeed)}function k(e){m.theta-=e}function C(e){m.phi-=e}var O,P=(O=new THREE.Vector3,function(e,t){O.setFromMatrixColumn(t,0),O.multiplyScalar(-e),y.add(O)}),I=function(){var e=new THREE.Vector3;return function(t,n){e.setFromMatrixColumn(n,1),e.multiplyScalar(t),y.add(e)}}(),N=function(){var e=new THREE.Vector3;return function(t,n){var r=s.domElement===document?s.domElement.body:s.domElement;if(s.object.isPerspectiveCamera){var i=s.object.position;e.copy(i).sub(s.target);var a=e.length();a*=Math.tan(s.object.fov/2*Math.PI/180),P(2*t*a/r.clientHeight,s.object.matrix),I(2*n*a/r.clientHeight,s.object.matrix)}else s.object.isOrthographicCamera?(P(t*(s.object.right-s.object.left)/s.object.zoom/r.clientWidth,s.object.matrix),I(n*(s.object.top-s.object.bottom)/s.object.zoom/r.clientHeight,s.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),s.enablePan=!1)}}();function L(e){s.object.isPerspectiveCamera?g/=e:s.object.isOrthographicCamera?(s.object.zoom=Math.max(s.minZoom,Math.min(s.maxZoom,s.object.zoom*e)),s.object.updateProjectionMatrix(),v=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),s.enableZoom=!1)}function D(e){s.object.isPerspectiveCamera?g*=e:s.object.isOrthographicCamera?(s.object.zoom=Math.max(s.minZoom,Math.min(s.maxZoom,s.object.zoom/e)),s.object.updateProjectionMatrix(),v=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),s.enableZoom=!1)}function F(e){if(!1!==s.enabled){switch(e.preventDefault(),e.button){case s.mouseButtons.ORBIT:if(!1===s.enableRotate)return;!function(e){b.set(e.clientX,e.clientY)}(e),d=h.ROTATE;break;case s.mouseButtons.ZOOM:if(!1===s.enableZoom)return;!function(e){S.set(e.clientX,e.clientY)}(e),d=h.DOLLY;break;case s.mouseButtons.PAN:if(!1===s.enablePan)return;!function(e){E.set(e.clientX,e.clientY)}(e),d=h.PAN}d!==h.NONE&&(document.addEventListener("mousemove",j,!1),document.addEventListener("mouseup",U,!1),s.dispatchEvent(l))}}function j(e){if(!1!==s.enabled)switch(e.preventDefault(),d){case h.ROTATE:if(!1===s.enableRotate)return;!function(e){w.set(e.clientX,e.clientY),A.subVectors(w,b);var t=s.domElement===document?s.domElement.body:s.domElement;k(2*Math.PI*A.x/t.clientWidth*s.rotateSpeed),C(2*Math.PI*A.y/t.clientHeight*s.rotateSpeed),b.copy(w),s.update()}(e);break;case h.DOLLY:if(!1===s.enableZoom)return;!function(e){M.set(e.clientX,e.clientY),T.subVectors(M,S),T.y>0?L(R()):T.y<0&&D(R()),S.copy(M),s.update()}(e);break;case h.PAN:if(!1===s.enablePan)return;!function(e){x.set(e.clientX,e.clientY),_.subVectors(x,E),N(_.x,_.y),E.copy(x),s.update()}(e)}}function U(e){!1!==s.enabled&&(document.removeEventListener("mousemove",j,!1),document.removeEventListener("mouseup",U,!1),s.dispatchEvent(u),d=h.NONE)}function B(e){!1===s.enabled||!1===s.enableZoom||d!==h.NONE&&d!==h.ROTATE||(e.preventDefault(),e.stopPropagation(),s.dispatchEvent(l),function(e){e.deltaY<0?D(R()):e.deltaY>0&&L(R()),s.update()}(e),s.dispatchEvent(u))}function V(e){!1!==s.enabled&&!1!==s.enableKeys&&!1!==s.enablePan&&function(e){switch(e.keyCode){case s.keys.UP:N(0,s.keyPanSpeed),s.update();break;case s.keys.BOTTOM:N(0,-s.keyPanSpeed),s.update();break;case s.keys.LEFT:N(s.keyPanSpeed,0),s.update();break;case s.keys.RIGHT:N(-s.keyPanSpeed,0),s.update()}}(e)}function z(e){if(!1!==s.enabled){switch(e.touches.length){case 1:if(!1===s.enableRotate)return;!function(e){b.set(e.touches[0].pageX,e.touches[0].pageY)}(e),d=h.TOUCH_ROTATE;break;case 2:if(!1===s.enableZoom)return;!function(e){var t=e.touches[0].pageX-e.touches[1].pageX,n=e.touches[0].pageY-e.touches[1].pageY,r=Math.sqrt(t*t+n*n);S.set(0,r)}(e),d=h.TOUCH_DOLLY;break;case 3:if(!1===s.enablePan)return;!function(e){E.set(e.touches[0].pageX,e.touches[0].pageY)}(e),d=h.TOUCH_PAN;break;default:d=h.NONE}d!==h.NONE&&s.dispatchEvent(l)}}function H(e){if(!1!==s.enabled)switch(e.preventDefault(),e.stopPropagation(),e.touches.length){case 1:if(!1===s.enableRotate)return;if(d!==h.TOUCH_ROTATE)return;!function(e){w.set(e.touches[0].pageX,e.touches[0].pageY),A.subVectors(w,b);var t=s.domElement===document?s.domElement.body:s.domElement;k(2*Math.PI*A.x/t.clientWidth*s.rotateSpeed),C(2*Math.PI*A.y/t.clientHeight*s.rotateSpeed),b.copy(w),s.update()}(e);break;case 2:if(!1===s.enableZoom)return;if(d!==h.TOUCH_DOLLY)return;!function(e){var t=e.touches[0].pageX-e.touches[1].pageX,n=e.touches[0].pageY-e.touches[1].pageY,r=Math.sqrt(t*t+n*n);M.set(0,r),T.subVectors(M,S),T.y>0?D(R()):T.y<0&&L(R()),S.copy(M),s.update()}(e);break;case 3:if(!1===s.enablePan)return;if(d!==h.TOUCH_PAN)return;!function(e){x.set(e.touches[0].pageX,e.touches[0].pageY),_.subVectors(x,E),N(_.x,_.y),E.copy(x),s.update()}(e);break;default:d=h.NONE}}function G(e){!1!==s.enabled&&(s.dispatchEvent(u),d=h.NONE)}function q(e){!1!==s.enabled&&e.preventDefault()}s.domElement.addEventListener("contextmenu",q,!1),s.domElement.addEventListener("mousedown",F,!1),s.domElement.addEventListener("wheel",B,!1),s.domElement.addEventListener("touchstart",z,!1),s.domElement.addEventListener("touchend",G,!1),s.domElement.addEventListener("touchmove",H,!1),window.addEventListener("keydown",V,!1),this.update()},THREE.OrbitControls.prototype=Object.create(THREE.EventDispatcher.prototype),THREE.OrbitControls.prototype.constructor=THREE.OrbitControls,Object.defineProperties(THREE.OrbitControls.prototype,{center:{get:function(){return console.warn("THREE.OrbitControls: .center has been renamed to .target"),this.target}},noZoom:{get:function(){return console.warn("THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),!this.enableZoom},set:function(e){console.warn("THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),this.enableZoom=!e}},noRotate:{get:function(){return console.warn("THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),!this.enableRotate},set:function(e){console.warn("THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),this.enableRotate=!e}},noPan:{get:function(){return console.warn("THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead."),!this.enablePan},set:function(e){console.warn("THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead."),this.enablePan=!e}},noKeys:{get:function(){return console.warn("THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),!this.enableKeys},set:function(e){console.warn("THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),this.enableKeys=!e}},staticMoving:{get:function(){return console.warn("THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),!this.enableDamping},set:function(e){console.warn("THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),this.enableDamping=!e}},dynamicDampingFactor:{get:function(){return console.warn("THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.dampingFactor},set:function(e){console.warn("THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.dampingFactor=e}}})},function(e,t){AFRAME.registerComponent("proxy-event",{schema:{captureBubbles:{default:!1},enabled:{default:!0},event:{type:"string"},from:{type:"string"},to:{type:"string"},as:{type:"string"},bubbles:{default:!1}},multiple:!0,init:function(){var e,t,n,r=this.data,i=this.el,a=this;if(r.from?e="PARENT"===r.from?[i.parentNode]:document.querySelectorAll(r.from):n="CHILDREN"===r.to?i.querySelectorAll("*"):"SELF"===r.to?[i]:document.querySelectorAll(r.to),r.from)for(t=0;t<e.length;t++)this.addEventListenerFrom(e[t]);else i.addEventListener(r.event,(function(e){var r=a.data;if(r.enabled&&(r.captureBubbles||e.target===i))for(t=0;t<n.length;t++)n[t].emit(r.as||r.event,e.detail?e.detail:null,r.bubbles)}))},addEventListenerFrom:function(e){var t=this.data,n=this;e.addEventListener(t.event,(function(t){var r=n.data;r.enabled&&(r.captureBubbles||t.target===e)&&n.el.emit(r.as||r.event,t.detail?t.detail:null,!1)}))}})},function(e,t){AFRAME.registerSystem("render-order",{schema:{type:"array"},init:function(){this.el.renderer.sortObjects=!0},update:function(){for(this.order={},i=0;i<this.data.length;i++)this.order[this.data[i]]=i}}),AFRAME.registerComponent("render-order",{schema:{type:"string"},multiple:!0,init:function(){this.set=this.set.bind(this),this.el.addEventListener("object3dset",e=>{"nonrecursive"!==this.id&&e.detail.object.traverse(this.set)})},update:function(){"nonrecursive"===this.id?this.set(this.el.object3D):this.el.object3D.traverse(this.set)},set:function(e){isNaN(this.data)?e.renderOrder=this.system.order[this.data]:e.renderOrder=parseFloat(this.data)}}),AFRAME.registerComponent("render-order-recursive",{init:function(){this.el.addEventListener("child-attached",e=>{e.detail.el.setAttribute("render-order",this.el.getAttribute("render-order"))})}})},function(e,t,n){var r;"undefined"!=typeof self&&self,r=function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([function(e,t,n){"use strict";var r={};e.exports.select=function(e,t,n){return r[t]||(r[t]=new Function("state","item","return "+c(t)+";")),r[t](e,n)};var i=/\.([A-Za-z][\w_-]*)/g,a=/([=&|!?:+-])(\s*)([\(]?)([A-Za-z][\w_-]*)/g,o=/^([\(]?)([A-Za-z][\w_-]*)/g,s=/state\["item"\]/g;function c(e){return e=(e=(e=(e=e.replace(i,'["$1"]')).replace(o,'$1state["$2"]')).replace(a,'$1$2$3state["$4"]')).replace(s,"item")}function l(){var e=arguments;return function(){var t;for(t=0;t<e.length;t++)e[t].apply(this,arguments)}}e.exports.generateExpression=c,e.exports.clearObject=function(e){for(var t in e)delete e[t]},e.exports.composeHandlers=function(){var e,t,n,r=arguments;for(n={},t=0;t<r.length;t++)for(e in r[t])e in n?n[e].constructor===Array?n[e].push(r[t][e]):n[e]=[n[e],r[t][e]]:n[e]=r[t][e];for(e in n)n[e].constructor===Array&&(n[e]=l.apply(this,n[e]));return n},e.exports.composeFunctions=l;var u=["||","&&","!=","!==","==","===",">","<","<=",">="],h=/\s+/,d=/\(|\)|\!/g;function p(e){return-1===(e=function(e){return 0===e.indexOf("!!")?e.replace("!!",""):0===e.indexOf("!")?e.replace("!",""):e}(e.trim())).indexOf(".")?e:e.substring(0,e.indexOf("."))}e.exports.parseKeysToWatch=function(e,t,n){var r,i;for(i=m(t,h),r=0;r<i.length;r++)if(-1===u.indexOf(i[r])&&!i[r].startsWith("'")&&-1===e.indexOf(i[r])){if(n&&"item"===i[r])continue;e.push(p(i[r]).replace(d,""))}return e};var f={};function m(e,t){return f[t]||(f[t]={}),f[t][e]||(f[t][e]=e.split(t)),f[t][e]}e.exports.split=m,e.exports.copyArray=function(e,t){var n;for(e.length=0,n=0;n<t.length;n++)e[n]=t[n]}},function(e,t,n){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};n(2);var i,a,o=n(3),s=n(0),c=n(4).wrapArray,l={initialState:{},nonBindedStateKeys:[],handlers:{},computeState:function(){}};AFRAME.registerState=function(e){AFRAME.utils.extend(l,e)},AFRAME.registerSystem("state",{init:function(){var e,t=this;for(e in this.arrays=[],this.dirtyArrays=[],this.diff={},this.state=AFRAME.utils.clone(l.initialState),this.subscriptions=[],this.initEventHandlers(),this.state)this.state[e]&&this.state[e].constructor===Array&&(this.arrays.push(e),this.state[e].__dirty=!0,c(this.state[e]));this.lastState=AFRAME.utils.clone(this.state),this.eventDetail={lastState:this.lastState,state:this.state},this.el.addEventListener("loaded",(function(){var e;for(l.computeState(t.state,"@@INIT"),e=0;e<t.subscriptions.length;e++)t.subscriptions[e].onStateUpdate(t.state)}))},dispatch:(a=[],function(e,t){var n,r;for(r in l.handlers[e](this.state,t),l.computeState(this.state,e,t),this.diff)delete this.diff[r];for(o(this.lastState,this.state,this.diff,l.nonBindedStateKeys),this.dirtyArrays.length=0,n=0;n<this.arrays.length;n++)this.state[this.arrays[n]].__dirty&&this.dirtyArrays.push(this.arrays[n]);for(a.length=0,n=0;n<this.subscriptions.length;n++){if("bind-for"===this.subscriptions[n].name){if(!this.state[this.subscriptions[n].keysToWatch[0]].__dirty)continue}else if(!this.shouldUpdate(this.subscriptions[n].keysToWatch,this.diff,this.dirtyArrays))continue;-1===a.indexOf(this.subscriptions[n])&&a.push(this.subscriptions[n])}for(n=0;n<a.length;n++)a[n].onStateUpdate();for(r in this.state)this.state[r]&&this.state[r].constructor===Array&&(this.state[r].__dirty=!1);this.copyState(this.lastState,this.state),this.eventDetail.action=e,this.eventDetail.payload=t,this.el.emit("stateupdate",this.eventDetail)}),copyState:function(e,t,n){var r;for(r in t)if(n||-1===l.nonBindedStateKeys.indexOf(r))if(t[r]&&t[r].constructor===Object){if(!(r in e)){e[r]=AFRAME.utils.clone(t[r]);continue}this.copyState(e[r],t[r],!0)}else e[r]=t[r]},subscribe:function(e){this.subscriptions.push(e)},unsubscribe:function(e){this.subscriptions.splice(this.subscriptions.indexOf(e),1)},shouldUpdate:function(e,t,n){for(var r=0;r<e.length;r++)if(e[r]in t||-1!==n.indexOf(e[r]))return!0;return!1},initEventHandlers:function(){var e,t=[];for(e in n=n.bind(this),l.handlers)-1===t.indexOf(e)&&(t.push(e),n(e));function n(e){var t=this;this.el.addEventListener(e,(function(n){t.dispatch(e,n.detail)}))}},renderTemplate:(i=/{{\s*(\w*\.)?([\w.]+)\s*}}/g,function(e,t,n){var a,o;if(o=e,t)for(;a=i.exec(e);)o=o.replace(a[0],"object"===(void 0===t?"undefined":r(t))?s.select(t,a[2])||"":t);return n?o:document.createRange().createContextualFragment(o)}),select:s.select}),AFRAME.registerComponent("bind",{schema:{default:{},parse:function(e){var t,n,r,i;if(e.constructor===Object)return e;if(-1===e.indexOf(":"))return e;for(t={},r=s.split(e,";"),n=0;n<r.length;n++)t[(i=s.split(r[n].trim(),":"))[0]]=i[1].trim();return t}},multiple:!0,init:function(){var e;this.data,this.keysToWatch=[],this.onStateUpdate=this.onStateUpdate.bind(this),this.system=this.el.sceneEl.systems.state,this.id&&(e=s.split(this.id,"__")[0]),this.isNamespacedBind=this.id&&e in AFRAME.components&&!AFRAME.components[e].isSingleProp||e in AFRAME.systems,this.lastData={},this.updateObj={},this.system.subscribe(this),this.onStateUpdate=this.onStateUpdate.bind(this)},update:function(){var e,t=this.data;if(this.keysToWatch.length=0,"string"==typeof t)s.parseKeysToWatch(this.keysToWatch,t);else for(e in t)s.parseKeysToWatch(this.keysToWatch,t[e]);this.onStateUpdate()},onStateUpdate:function(){var e,t,n,i,a=!1,o=this.el;if(o.parentNode){if(this.isNamespacedBind&&s.clearObject(this.updateObj),n=this.system.state,"object"!==r(this.data)){try{i=s.select(n,this.data)}catch(e){throw new Error("[aframe-state-component] Key '"+this.data+"' not found in state. #"+this.el.getAttribute("id")+"["+this.attrName+"]")}if("object"!==(void 0===i?"undefined":r(i))&&"object"!==r(this.lastData)&&this.lastData===i)return;return AFRAME.utils.entity.setComponentProperty(o,this.id,i),void(this.lastData=i)}for(e in this.data){t=this.data[e].trim();try{i=s.select(n,t)}catch(e){throw console.log(e),new Error("[aframe-state-component] Key '"+t+"' not found in state. #"+this.el.getAttribute("id")+"["+this.attrName+"]")}if("object"===(void 0===i?"undefined":r(i))||"object"===r(this.lastData[e])||this.lastData[e]!==i){if(e in AFRAME.components&&void 0===i)return void o.removeAttribute(e);this.isNamespacedBind?this.updateObj[e]=i:AFRAME.utils.entity.setComponentProperty(o,e,i),this.lastData[e]=i}}for(a in this.updateObj);this.isNamespacedBind&&a&&o.setAttribute(this.id,this.updateObj)}},remove:function(){this.system.unsubscribe(this)}}),AFRAME.registerComponent("bind-toggle",{schema:{type:"string"},multiple:!0,init:function(){this.system=this.el.sceneEl.systems.state,this.keysToWatch=[],this.onStateUpdate=this.onStateUpdate.bind(this),this.system.subscribe(this),this.onStateUpdate()},update:function(){this.keysToWatch.length=0,s.parseKeysToWatch(this.keysToWatch,this.data)},onStateUpdate:function(){var e,t,n=this.el;e=this.system.state;try{t=s.select(e,this.data)}catch(e){throw new Error("[aframe-state-component] Key '"+this.data+"' not found in state. #"+this.el.getAttribute("id")+"["+this.attrName+"]")}t?n.setAttribute(this.id,""):n.removeAttribute(this.id)},remove:function(){this.system.unsubscribe(this)}}),e.exports={composeFunctions:s.composeFunctions,composeHandlers:s.composeHandlers,select:s.select}},function(e,t,n){"use strict";var r,i,a=n(0);AFRAME.registerComponent("bind-for",{schema:{delay:{default:0},for:{type:"string",default:"item"},in:{type:"string"},key:{type:"string"},pool:{default:0},template:{type:"string"},updateInPlace:{default:!1}},init:function(){this.system=this.el.sceneEl.systems.state,this.onStateUpdate=this.onStateUpdate.bind(this),this.keysToWatch=[],this.renderedKeys=[],this.system.subscribe(this),this.el.children[0]&&"TEMPLATE"===this.el.children[0].tagName?this.template=this.el.children[0].innerHTML.trim():this.template=document.querySelector(this.data.template).innerHTML.trim();for(var e=0;e<this.data.pool;e++)this.el.appendChild(this.generateFromTemplate(null,e))},update:function(){this.keysToWatch[0]=a.split(this.data.in,".")[0],this.onStateUpdate()},onStateUpdateNaive:(i=[],function(){var e,t=this.data,n=this.el;try{e=a.select(this.system.state,t.in)}catch(e){throw new Error("[aframe-state-component] Key '"+t.in+"' not found in state. #"+n.getAttribute("id")+"["+this.attrName+"]")}i.length=0;for(var r=0;r<e.length;r++){var o=e[r];i.push(t.key?o[t.key].toString():o.toString())}for(var s=this.getElsToRemove(i,this.renderedKeys),c=0;c<s.length;c++)s[c].parentNode.removeChild(s[c]);e.length&&this.renderItems(e,i,0)}),renderItems:function(e,t,n){var r,i=this,a=this.data,o=this.el,s=e[n],c=a.key?s[a.key].toString():s.toString();if(-1===this.renderedKeys.indexOf(c))r=this.generateFromTemplate(s,n),o.appendChild(r),this.renderedKeys.push(c);else{if(e.length&&e[0].constructor===String){var l=a.key?s[a.key].toString():s.toString();(r=o.querySelector('[data-bind-for-value="'+l+'"]')).setAttribute("data-bind-for-key",n)}else{var u=this.getBindForKey(s,n);r=o.querySelector('[data-bind-for-key="'+u+'"]')}r.emit("bindforupdate",s,!1)}e[n+1]&&(this.data.delay?setTimeout((function(){i.renderItems(e,t,n+1)}),this.data.delay):this.renderItems(e,t,n+1))},onStateUpdateInPlace:function(){var e=[];return function(){var t,n,r=this.data,i=this.el;try{t=a.select(this.system.state,r.in)}catch(e){throw console.log(e),new Error("[aframe-state-component] Key '"+r.in+"' not found in state. #"+i.getAttribute("id")+"["+this.attrName+"]")}e.length=0;for(var o=0;o<t.length;o++){var s=t[o];n=r.key?s[r.key].toString():s.toString(),e.push(n)}for(var c=this.getElsToRemove(e,this.renderedKeys),l=0;l<c.length;l++)c[l].object3D.visible=!1,c[l].setAttribute("data-bind-for-active","false"),c[l].removeAttribute("data-bind-for-key"),c[l].removeAttribute("data-bind-for-value"),c[l].emit("bindfordeactivate",null,!1),c[l].pause();t.length&&this.renderItemsInPlace(t,e,0)}}(),renderItemsInPlace:function(e,t,n){var r,i=this,a=this.data,o=this.el,s=e[n],c=this.getBindForKey(s,n),l=a.key?s[a.key].toString():s.toString();if(-1===this.renderedKeys.indexOf(l)){if(o.querySelector(':scope > [data-bind-for-active="false"]'))(r=o.querySelector('[data-bind-for-active="false"]')).setAttribute("data-bind-for-key",c),r.setAttribute("data-bind-for-value",l),r.object3D.visible=!0,r.play(),r.setAttribute("data-bind-for-active","true"),r.emit("bindforupdateinplace",s,!1);else{var u=this.generateFromTemplate(s,n);u.addEventListener("loaded",(function(){u.emit("bindforupdateinplace",s,!1)})),o.appendChild(u)}this.renderedKeys.push(l)}else-1!==t.indexOf(l)&&(e.length&&e[0].constructor===String?(r=o.querySelector('[data-bind-for-value="'+l+'"]')).setAttribute("data-bind-for-key",n):r=o.querySelector('[data-bind-for-key="'+c+'"]'),r.emit("bindforupdateinplace",s,!1));e[n+1]&&(this.data.delay?setTimeout((function(){i.renderItemsInPlace(e,t,n+1)}),this.data.delay):this.renderItemsInPlace(e,t,n+1))},generateFromTemplate:function(e,t){var n=this.data;this.el.appendChild(this.system.renderTemplate(this.template,e));var r=this.el.children[this.el.children.length-1];if(!e)return r.setAttribute("data-bind-for-key",""),r.setAttribute("data-bind-for-active","false"),r;var i=this.getBindForKey(e,t);return r.setAttribute("data-bind-for-key",i),n.key||r.setAttribute("data-bind-for-value",e),r.setAttribute("data-bind-for-active","true"),r},getElsToRemove:(r=[],function(e,t){var n=this.data,i=this.el;r.length=0;for(var a=0;a<i.children.length;a++)if("TEMPLATE"!==i.children[a].tagName){var o=n.key?i.children[a].getAttribute("data-bind-for-key"):i.children[a].getAttribute("data-bind-for-value");-1===e.indexOf(o)&&-1!==t.indexOf(o)&&(r.push(i.children[a]),t.splice(t.indexOf(o),1))}return r}),getBindForKey:function(e,t){return this.data.key?e[this.data.key].toString():t.toString()},onStateUpdate:function(){this.data.updateInPlace?this.onStateUpdateInPlace():this.onStateUpdateNaive()}}),AFRAME.registerComponent("bind-item",{schema:{type:"string"},multiple:!0,init:function(){this.itemData=null,this.keysToWatch=[],this.prevValues={};var e=this.rootEl=this.el.closest("[data-bind-for-key]");if(!e)throw new Error("bind-item component must be attached to entity under a bind-for item.");e.addEventListener("bindforupdateinplace",this.updateInPlace.bind(this)),e.addEventListener("bindfordeactivate",this.deactivate.bind(this)),this.el.sceneEl.systems.state.subscribe(this)},update:function(){this.parseSelector()},updateInPlace:function(e){var t=this.propertyMap;if("false"!==this.rootEl.getAttribute("data-bind-for-active"))for(var n in e&&(this.itemData=e.detail),t){var r=this.select(this.itemData,t[n]);r!==this.prevValues[n]&&(AFRAME.utils.entity.setComponentProperty(this.el,n,r),this.prevValues[n]=r)}},onStateUpdate:function(){this.updateInPlace()},select:function(e,t){return a.select(this.el.sceneEl.systems.state.state,t,e)},deactivate:function(){this.prevValues={}},parseSelector:function(){var e=this.propertyMap={};this.keysToWatch.length=0;var t=a.split(this.id,"__")[0];if(!(t in AFRAME.components)||AFRAME.components[t].isSingleProp)e[this.id]=this.data,a.parseKeysToWatch(this.keysToWatch,this.data,!0);else for(var n=a.split(this.data,";"),r=0;r<n.length;r++){var i=a.split(n[r],":");e[this.id+"."+i[0].trim()]=i[1].trim(),a.parseKeysToWatch(this.keysToWatch,i[1].trim(),!0)}}})},function(e,t,n){"use strict";var r;e.exports=(r=[],function(e,t,n,i){var a,o,s,c,l,u,h;for(l in c=n||{},r.length=0,e)r.push(l);if(!t)return c;for(s in t)-1===r.indexOf(s)&&r.push(s);for(u=0;u<r.length;u++)l=r[u],i&&-1!==i.indexOf(l)||(a=e[l],o=t[l],((h=a&&o&&a.constructor===Object&&o.constructor===Object)&&!AFRAME.utils.deepEqual(a,o)||!h&&a!==o)&&(c[l]=o));return c})},function(e,t,n){"use strict";var r=["push","pop","shift","unshift","splice"];function i(e,t){var n=e[t];e[t]=function(){n.apply(e,arguments),e.__dirty=!0}}e.exports.wrapArray=function(e){var t;if(!e.__wrapped){for(t=0;t<r.length;t++)i(e,r[t]);e.__wrapped=!0}}}])},e.exports=r()},function(e,t){if("undefined"==typeof AFRAME)throw new Error("Component attempted to register before AFRAME was available.");AFRAME.registerComponent("slice9",{schema:{width:{default:1,min:0},height:{default:1,min:0},left:{default:0,min:0},right:{default:0,min:0},bottom:{default:0,min:0},top:{default:0,min:0},side:{default:"front",oneOf:["front","back","double"]},padding:{default:.1,min:.01},color:{type:"color",default:"#fff"},opacity:{default:1,min:0,max:1},transparent:{default:!0},debug:{default:!1},src:{type:"map"}},multiple:!1,init:function(){var e=this.data,t=this.material=new THREE.MeshBasicMaterial({color:e.color,opacity:e.opacity,transparent:e.transparent,wireframe:e.debug}),n=this.geometry=new THREE.PlaneBufferGeometry(e.width,e.height,3,3);new THREE.TextureLoader;this.plane=new THREE.Mesh(n,t),this.el.setObject3D("mesh",this.plane),this.textureSrc=null},updateMap:function(){var e=this.data.src;if(e){if(e===this.textureSrc)return;return this.textureSrc=e,void this.el.sceneEl.systems.material.loadTexture(e,{src:e},t.bind(this))}function t(e){this.material.map=e,this.material.needsUpdate=!0,this.regenerateMesh()}this.material.map&&t(null)},regenerateMesh:function(){var e=this.data,t=this.geometry.attributes.position.array,n=this.geometry.attributes.uv.array,r=this.material.map.image;if(r){var i={left:e.left/r.width,right:e.right/r.width,top:e.top/r.height,bottom:e.bottom/r.height};d(1,i.left,1),d(2,i.right,1),d(4,0,i.bottom),d(5,i.left,i.bottom),d(6,i.right,i.bottom),d(7,1,i.bottom),d(8,0,i.top),d(9,i.left,i.top),d(10,i.right,i.top),d(11,1,i.top),d(13,i.left,0),d(14,i.right,0);var a=e.width/2,o=e.height/2,s=-a+e.padding,c=a-e.padding,l=o-e.padding,u=-o+e.padding;h(0,-a,o),h(1,s,o),h(2,c,o),h(3,a,o),h(4,-a,l),h(5,s,l),h(6,c,l),h(7,a,l),h(8,-a,u),h(9,s,u),h(10,c,u),h(11,a,u),h(13,s,-o),h(14,c,-o),h(12,-a,-o),h(15,a,-o),this.geometry.attributes.position.needsUpdate=!0,this.geometry.attributes.uv.needsUpdate=!0}function h(e,n,r){t[3*e]=n,t[3*e+1]=r}function d(e,t,r){n[2*e]=t,n[2*e+1]=r}},update:function(e){var t=this.data;this.material.color.setStyle(t.color),this.material.opacity=t.opacity,this.material.transparent=t.transparent,this.material.wireframe=t.debug,this.material.side=function(e){switch(e){case"back":return THREE.BackSide;case"double":return THREE.DoubleSide;default:return THREE.FrontSide}}(t.side);var n=AFRAME.utils.diff(t,e);"src"in n?this.updateMap():("width"in n||"height"in n||"padding"in n||"left"in n||"top"in n||"bottom"in n||"right"in n)&&this.regenerateMesh()},remove:function(){},pause:function(){},play:function(){}})},function(e,t){var n=[0,90,180,270],r=["right","up","left","down"],i={NULL:{START:"thumbstart",END:"thumbend"}};r.forEach(e=>{i[e]={},i[e].START="thumb"+e+"start",i[e].END="thumb"+e+"end"});AFRAME.registerComponent("thumb-controls",{schema:{thresholdAngle:{default:89.5},thresholdPad:{default:.05},thresholdStick:{default:.75}},init:function(){var e=this.el;this.onTrackpadDown=this.onTrackpadDown.bind(this),this.onTrackpadUp=this.onTrackpadUp.bind(this),this.directionStick="",this.directionTrackpad="",e.components["tracked-controls"]&&(this.axis=e.components["tracked-controls"].axis),this.type="STICK",e.addEventListener("controllerconnected",t=>{this.axis=e.components["tracked-controls"].axis,"oculus-touch-controls"!==t.detail.name&&"windows-motion-controls"!==t.detail.name?this.type="PAD":this.type="STICK"})},play:function(){var e=this.el;e.addEventListener("trackpaddown",this.onTrackpadDown),e.addEventListener("trackpadup",this.onTrackpadUp),e.addEventListener("touchpaddown",this.onTrackpadDown),e.addEventListener("touchpadup",this.onTrackpadUp)},pause:function(){var e=this.el;e.removeEventListener("trackpaddown",this.onTrackpadDown),e.removeEventListener("trackpadup",this.onTrackpadUp),e.removeEventListener("touchpaddown",this.onTrackpadDown),e.removeEventListener("touchpadup",this.onTrackpadUp)},onTrackpadDown:function(){var e,t=this.el;this.getDistance()<this.data.thresholdPad||(e=this.getDirection())&&(this.directionTrackpad=e,t.emit(i.NULL.START,null,!1),t.emit(i[this.directionTrackpad].START,null,!1))},onTrackpadUp:function(){var e=this.el;this.directionTrackpad&&(e.emit(i.NULL.END,null,!1),e.emit(i[this.directionTrackpad].END,null,!1),this.directionTrackpad="")},tick:function(){var e,t=this.el;if("PAD"!==this.type){if(!this.directionStick&&this.getDistance()>this.data.thresholdStick){if(!(e=this.getDirection()))return;return this.directionStick=e,t.emit(i.NULL.START,null,!1),void t.emit(i[this.directionStick].START,null,!1)}this.directionStick&&this.getDistance()<this.data.thresholdStick&&(t.emit(i.NULL.END,null,!1),t.emit(i[this.directionStick].END,null,!1),this.directionStick="")}},getDistance:function(){var e=this.axis;return this.axis?"PAD"===this.type?Math.sqrt(e[1]*e[1]+e[0]*e[0]):Math.sqrt(e[3]*e[3]+e[2]*e[2]):0},getDirection:function(){var e,t,i,a,o;for(e=this.getAngle(),a=this.data.thresholdAngle/2,i=0;i<n.length;i++){if((o=n[i]+a)>360&&(o-=360),(t=n[i]-a)<0&&(e>=360+t&&e<=360||e>=0&&e<=o))return r[i];if(e>=t&&e<=o)return r[i]}},getAngle:function(){var e,t=this.axis;return this.axis?((e="PAD"===this.type?Math.atan2(-t[1],t[0]):Math.atan2(-t[3],t[2]))<0&&(e=2*Math.PI+e),THREE.Math.radToDeg(e)):0}}),AFRAME.registerComponent("thumb-controls-debug",{dependencies:["thumb-controls"],schema:{controllerType:{type:"string"},hand:{type:"string"},enabled:{default:!1}},init:function(){var e,t,n,r,i=this.el;if(this.data.enabled||AFRAME.utils.getUrlParameter("debug-thumb")){console.log("%c debug-thumb","background: #111; color: red");var a=function(){i.components["tracked-controls"].handleAxes=()=>{},n={axis:t=[0,0,0]},i.components["tracked-controls"].axis=t,i.components["thumb-controls"].axis=t};i.components["tracked-controls"]?a():this.el.addEventListener("controllerconnected",(function(){a()})),(r=this.createCanvas()).addEventListener("click",r=>{"vive-controls"===this.data.controllerType?e?i.emit("trackpadup"):i.emit("trackpaddown"):e&&(t[0]=0,t[1]=0,i.emit("axismove",n,!1)),e=!e}),r.addEventListener("mousemove",a=>{var o;e&&(o=r.getBoundingClientRect(),t[0]=(a.clientX-o.left)/240*2-1,t[1]=(a.clientY-o.top)/240*2-1,i.emit("axismove",n,!1))}),r.addEventListener("mouseleave",r=>{e&&(t[0]=0,t[1]=0,i.emit("axismove",n,!1))})}},createCanvas:function(){var e,t;return(e=document.createElement("canvas")).classList.add("debugThumb"),e.height=240,e.width=240,e.style.bottom=0,e.style.borderRadius="250px",e.style.opacity=.5,e.style.position="fixed",e.style.zIndex=999999999,"left"===this.data.hand?e.style.left=0:e.style.right=0,(t=e.getContext("2d")).fillStyle="#333",t.fillRect(0,0,240,240),document.body.appendChild(e),e}})},function(e,t,n){var r={"./active-item.js":59,"./agent-dance.js":60,"./agent-picker.js":61,"./beat-cut-fx.js":62,"./beat-generator.js":15,"./beat-hit-sound.js":63,"./beat.js":21,"./blade.js":64,"./check-vr.js":65,"./console-shortcuts.js":66,"./controller.js":67,"./copy-texture.js":68,"./cursor-laser.js":69,"./cursor-mesh.js":70,"./curve-follow-rig-reset.js":71,"./cutfx-shader.js":72,"./debug-beat-generator.js":75,"./debug-beat-positioning.js":76,"./debug-controller.js":77,"./debug-cursor.js":78,"./debug-intro.js":79,"./debug-song-time.js":80,"./debug-state.js":81,"./delayed-proxy-event.js":82,"./difficulty-background.js":83,"./difficulty-filter.js":84,"./difficulty-text.js":85,"./follow-position.js":86,"./follow-z.js":87,"./gameover.js":88,"./gpu-preloader.js":89,"./gradient-shader.js":90,"./hand-swapper.js":92,"./handstar-shader.js":93,"./haptics-wall.js":96,"./haptics-weapon.js":97,"./headfist.js":98,"./history.js":99,"./intro-song.js":100,"./keyboard-raycastable.js":101,"./leaderboard.js":102,"./materials.js":109,"./menu-controls.js":124,"./menu-difficulty-select.js":125,"./menu-genre.js":126,"./menu-midsection.js":127,"./menu-mode.js":128,"./menu-playlist-button.js":129,"./menu-playlist.js":130,"./menu-selected-challenge-image.js":131,"./menu-slide-animation.js":132,"./multiplier-ring.js":133,"./no-frustum-cull.js":134,"./panel-shader.js":135,"./pause.js":138,"./pauser.js":139,"./play-sound.js":140,"./player-height.js":142,"./plume.js":143,"./punch.js":144,"./raycaster-target.js":145,"./recenter.js":146,"./ring.js":147,"./score-texts.js":150,"./search-thumbnail-atlas.js":151,"./search.js":152,"./song-info-positioner.js":155,"./song-preview.js":156,"./song-progress-info.js":157,"./song.js":158,"./stage-colors.js":159,"./stage-lasers.js":160,"./stars.js":161,"./stats-param.js":162,"./stepback.js":163,"./sub-object.js":164,"./super-keyboard.js":165,"./supercurve-color.js":166,"./supercurve-shader.js":167,"./supercurve.js":170,"./supercutfx-shader.js":173,"./supercutfx.js":174,"./tail.js":175,"./text-counter.js":176,"./text-geometry.js":236,"./text-truncate.js":177,"./text-uppercase.js":178,"./toggle-pause-play.js":179,"./trail.js":180,"./tunnels.js":181,"./vertex-colors-buffer.js":182,"./victory-accuracy-ring.js":183,"./victory-rank.js":184,"./visible-raycastable.js":185,"./wall-shader.js":186,"./wall.js":189,"./weapon-particles.js":190,"./zip-loader.js":191};function i(e){var t=a(e);return n(t)}function a(e){if(!n.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}i.keys=function(){return Object.keys(r)},i.resolve=a,e.exports=i,i.id=58},function(e,t,n){if(AFRAME.registerComponent("active-item",{dependencies:["material"],schema:{active:{default:!1},opacity:{default:1}},init:function(){this.defaultOpacity=this.el.getAttribute("material").opacity,this.materialObj={opacity:this.data.opacity}},update:function(){var e=this.el;this.data.active?(e.setAttribute("material",this.materialObj),e.object3D.visible=!0):(e.setAttribute("material","opacity",this.defaultOpacity),e.components.animation__mouseleave&&setTimeout(()=>{e.emit("mouseleave",null,!1)}))}}),AFRAME.registerComponent("active-text-color",{dependencies:["text"],schema:{active:{default:!1},color:{default:"#333"}},init:function(){this.defaultColor=this.el.getAttribute("text").color},update:function(){var e=this.el;this.data.active?e.setAttribute("text","color",this.data.color):e.setAttribute("text","color",this.defaultColor)}}),window.AFRAME){const t=["active-item","active-text-color"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){const r=["dance","rumba","capoeira","thriller","wave","celebrate","taunt","silly","jump","pray","reaction","sitclap","sitlaugh","kiss","angry","defeated","falling","dying","idle"];if(AFRAME.registerComponent("agent-dance",{schema:{base:{default:"assets/clips/"},initial:{default:"dance"}},init:function(){this.clips={},this.currentAction=null;const e=this.el,t=()=>{const t=e.getObject3D("mesh");t&&(this.mixer=new THREE.AnimationMixer(t),this.play(this.data.initial),this.buildUI())};e.getObject3D("mesh")?t():e.addEventListener("model-loaded",t),this.onKeyDown=e=>{if("INPUT"===e.target.tagName||"TEXTAREA"===e.target.tagName)return;const t="1234567890".indexOf(e.key);t>=0&&r[t]&&(this.play(r[t]),this.ui&&(this.ui.value=r[t]))},window.addEventListener("keydown",this.onKeyDown)},remove:function(){window.removeEventListener("keydown",this.onKeyDown),this.ui&&this.ui.remove()},play:function(e){if(!this.mixer)return;const t=e=>{const t=this.mixer.clipAction(e);t.reset().play(),this.currentAction&&this.currentAction!==t&&this.currentAction.crossFadeTo(t,.3,!1),this.currentAction=t};this.clips[e]?t(this.clips[e]):fetch(this.data.base+e+".json").then(e=>e.ok?e.json():null).then(n=>{if(!n)return;const r=THREE.AnimationClip.parse(n);this.clips[e]=r,t(r)}).catch(()=>{})},buildUI:function(){const e=document.createElement("select");e.style.cssText="position:fixed;top:10px;left:10px;z-index:9999998;background:rgba(0,0,0,0.7);color:#fff;font-family:monospace;padding:6px;border:1px solid #444;border-radius:4px;",e.title="Agent animation (1-0 keys also work)",r.forEach((t,n)=>{const r=document.createElement("option");r.value=t;const i=n<10?`[${(n+1)%10}] `:"";r.textContent=i+t,t===this.data.initial&&(r.selected=!0),e.appendChild(r)}),e.addEventListener("change",()=>this.play(e.value)),document.body.appendChild(e),this.ui=e},tick:function(e,t){this.mixer&&this.mixer.update(t/1e3)}}),window.AFRAME){const t=["agent-dance"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){const r=[{id:"cz",name:"CZ",url:"https://raw.githubusercontent.com/overstepping/-/main/cz.glb"}];function i(e){return String(e).replace(/[&<>"']/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"}[e]))}function a(e){return"three.ws"===window.location.hostname?e:e.replace(/^https:\/\/pub-2534e921bf9c4314addcd4d8a6e98b7b\.r2\.dev/,"/r2-proxy")}if(AFRAME.registerSystem("agent-picker",{init:function(){this.agents=r.slice(),this.currentId=null,this.companionEl=null,this.searchQuery="";const e=()=>{this.companionEl=document.querySelector("#agentCompanion"),this.companionEl&&(this.buildOverlay(),this.applyInitialSelection(),this.wireSceneEvents(),this.wirePostMessage(),this.fetchPublicAvatars())};this.sceneEl.hasLoaded?e():this.sceneEl.addEventListener("loaded",e)},fetchPublicAvatars:function(e=""){const t=new URL("https://three.ws/api/explore");t.searchParams.set("only3d","1"),t.searchParams.set("limit","40"),e&&t.searchParams.set("q",e),fetch(t.toString()).then(e=>e.ok?e.json():null).then(e=>{if(!e||!Array.isArray(e.items))return;const t=e.items.filter(e=>e.glbUrl).map(e=>({id:`${e.kind}-${e.agentId||e.name}-${e.sortDate}`,name:e.name||"Untitled",url:a(e.glbUrl),owner:e.ownerShort||""}));this.agents=r.concat(t),this.renderList()}).catch(()=>{})},buildOverlay:function(){if(document.getElementById("agentPicker"))return;const e=document.createElement("div");e.id="agentPicker",e.innerHTML='\n <style>\n #agentPicker {\n position: fixed; top: 12px; right: 12px; z-index: 9999;\n font-family: system-ui, sans-serif; user-select: none;\n transition: opacity 0.3s;\n }\n #agentPicker.playing { opacity: 0; pointer-events: none; }\n #agentPicker .ap-toggle {\n background: rgba(8, 10, 24, 0.85); color: #cfd6ff;\n border: 1px solid rgba(120, 140, 255, 0.4); border-radius: 8px;\n padding: 8px 14px; font-size: 12px; letter-spacing: 0.08em;\n cursor: pointer; backdrop-filter: blur(6px);\n }\n #agentPicker .ap-toggle:hover { background: rgba(40, 50, 100, 0.9); }\n #agentPicker .ap-panel {\n margin-top: 8px; background: rgba(8, 10, 24, 0.92);\n border: 1px solid rgba(120, 140, 255, 0.3); border-radius: 8px;\n padding: 8px; width: 260px; display: none;\n backdrop-filter: blur(6px);\n }\n #agentPicker.open .ap-panel { display: block; }\n #agentPicker .ap-search {\n width: 100%; box-sizing: border-box; background: rgba(0,0,0,0.4);\n color: #cfd6ff; border: 1px solid rgba(120, 140, 255, 0.3);\n border-radius: 6px; padding: 6px 8px; font-size: 12px;\n margin-bottom: 6px; outline: none;\n }\n #agentPicker .ap-list { max-height: 320px; overflow-y: auto; }\n #agentPicker .ap-item {\n display: flex; align-items: center; gap: 10px;\n padding: 8px 10px; border-radius: 6px; cursor: pointer;\n color: #cfd6ff; font-size: 13px;\n }\n #agentPicker .ap-item:hover { background: rgba(80, 100, 200, 0.25); }\n #agentPicker .ap-item.active { background: rgba(80, 100, 200, 0.4); }\n #agentPicker .ap-dot {\n width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;\n background: linear-gradient(135deg, #6699ff, #ff4488);\n }\n #agentPicker .ap-name {\n flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;\n }\n #agentPicker .ap-owner { color: #6677aa; font-size: 10px; }\n #agentPicker .ap-empty { padding: 10px; color: #6677aa; font-size: 12px; text-align: center; }\n </style>\n <button class="ap-toggle" type="button">AGENT</button>\n <div class="ap-panel">\n <input class="ap-search" type="text" placeholder="Search avatars on three.ws..." />\n <div class="ap-list"></div>\n </div>\n ',document.body.appendChild(e);const t=e.querySelector(".ap-toggle"),n=e.querySelector(".ap-search");let r;t.addEventListener("click",()=>e.classList.toggle("open")),n.addEventListener("input",()=>{clearTimeout(r),this.searchQuery=n.value.trim(),r=setTimeout(()=>this.fetchPublicAvatars(this.searchQuery),300)}),this.overlayEl=e,this.listEl=e.querySelector(".ap-list")},renderList:function(){this.listEl&&(this.listEl.innerHTML="",this.agents.length?this.agents.forEach(e=>{const t=document.createElement("div");t.className="ap-item"+(e.id===this.currentId?" active":""),t.dataset.id=e.id,t.innerHTML=`\n <span class="ap-dot"></span>\n <span class="ap-name">${i(e.name)}</span>\n ${e.owner?`<span class="ap-owner">${i(e.owner)}</span>`:""}\n `,t.addEventListener("click",()=>{this.selectAgent(e.id),this.overlayEl.classList.remove("open")}),this.listEl.appendChild(t)}):this.listEl.innerHTML='<div class="ap-empty">No avatars found.</div>')},applyInitialSelection:function(){const e=new URLSearchParams(window.location.search).get("agent");e&&this.agents.some(t=>t.id===e)?this.selectAgent(e):this.selectAgent(this.agents[0].id),this.renderList()},selectAgent:function(e){let t;"string"==typeof e?t=this.agents.find(t=>t.id===e):e&&e.url&&(t=e,this.agents.some(e=>e.id===t.id)||this.agents.push(t)),t&&this.companionEl&&(this.currentId=t.id,this.companionEl.setAttribute("gltf-model",`url(${t.url})`),this.renderList(),this.sceneEl.emit("agentchanged",{agentId:t.id,url:t.url}))},wireSceneEvents:function(){const e=()=>this.overlayEl&&this.overlayEl.classList.remove("playing");this.sceneEl.addEventListener("songstartfade",()=>this.overlayEl&&this.overlayEl.classList.add("playing")),this.sceneEl.addEventListener("cleargame",e),this.sceneEl.addEventListener("gameover",e),this.sceneEl.addEventListener("songcomplete",e)},wirePostMessage:function(){window.addEventListener("message",e=>{const t=e.data;t&&"rider:setAgent"===t.type&&(t.url?this.selectAgent({id:t.agentId||"external-"+Date.now(),name:t.name||"Agent",url:t.url}):t.agentId&&this.selectAgent(t.agentId))})}}),window.AFRAME){const t=[],n=[],r=["agent-picker"];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){const r=new THREE.Vector3,i={right:0,upright:45,up:90,upleft:135,left:180,downleft:225,down:270,downright:315},a={right:new THREE.Vector2(0,1),upright:new THREE.Vector2(-.5,.5),up:new THREE.Vector2(-1,0),upleft:new THREE.Vector2(-.5,-.5),left:new THREE.Vector2(0,-1),downleft:new THREE.Vector2(.5,-.5),down:new THREE.Vector2(1,0),downright:new THREE.Vector2(.5,.5)};function o(e,t){e.x+=(Math.random()-.5)*t,e.y+=(Math.random()-.5)*t,e.z+=(Math.random()-.5)*t}if(AFRAME.registerComponent("beat-cut-fx",{schema:{color:{type:"string"},type:{oneOf:["beat","dot","mine"],default:"beat"}},init:function(){this.breaking=!1,this.fx=null,this.fxpool=null,this.pieces=[],this.pool=null,this.returnToPoolTimer=500,this.el.addEventListener("model-loaded",this.setupModel.bind(this)),this.el.addEventListener("explode",this.explode.bind(this),!1)},update:function(){const e=this.el.sceneEl,t=this.data.color;"beat"===this.data.type?(this.material=e.systems.materials[t+"BeatPieces"],this.poolBeat=e.components["pool__beat-broken-"+t],this.poolBeatFx=e.components["pool__beat-fx-"+t],this.poolPunchFx=e.components["pool__punch-fx-"+t]):"dot"===this.data.type?(this.material=e.systems.materials[t+"BeatPieces"],this.poolBeat=e.components[`pool__beat-broken-${t}-dot`],this.poolPunch=e.components[`pool__punch-broken-${t}-dot`],this.poolBeatFx=e.components["pool__beat-fx-"+t],this.poolPunchFx=e.components["pool__punch-fx-"+t]):(this.material=e.systems.materials.minePieces,this.poolBeat=e.components["pool__beat-broken-mine"],this.poolBeatFx=e.components["pool__beat-fx-mine"],this.poolPunchFx=e.components["pool__punch-fx-mine"])},setupModel:function(e){const t=e.detail.model;this.pieces=t.children;for(let e=0;e<this.pieces.length;e++){let t=this.pieces[e];t.restPosition=t.position.clone(),t.restRotation=t.rotation.clone(),t.posVelocity=new THREE.Vector3,t.rotVelocity=new THREE.Vector3,t.material=this.material}},explode:function(e){const t=e.detail.direction,n=e.detail.gameMode,s=e.detail.correctHit,c=e.detail.position,l=e.detail.rotation;let u=e.detail.beatDirection;if(c&&l&&t&&this.data.color===e.detail.color){if(this.el.object3D.position.copy(c),"classic"===n&&"mine"!==this.data.type){const e="dot"===this.data.type;e&&(u=Math.abs(t.x)>Math.abs(t.y)?"right":"down"),t.z*=.01,r.copy(t).multiplyScalar(-.0025).clampLength(0,.01);for(let t=0;t<this.pieces.length;t++){let n=this.pieces[t];if(n.posVelocity.copy(r),n.rotation.z=THREE.Math.degToRad(i[u]),s){let r=t%2==0?-.001:.001;n.posVelocity.x+=a[u].x*r,n.posVelocity.y+=a[u].y*r,!e||t<2?(o(n.posVelocity,.002),o(n.rotVelocity,.004)):(n.posVelocity.copy(this.pieces[t-2].posVelocity),n.rotVelocity.copy(this.pieces[t-2].rotVelocity))}else n.posVelocity.y+=.001,n.rotVelocity.z+=.01}}else for(let e=0;e<this.pieces.length;e++){let t=this.pieces[e];s?(t.posVelocity.copy(t.position).normalize().multiplyScalar(.002),t.posVelocity.z=-.004,o(t.posVelocity,.001),o(t.rotVelocity,.01)):(t.posVelocity.y+=.001,t.posVelocity.z-=.001)}this.pool=this["classic"===n?"poolBeat":"poolPunch"],null===this.fx&&(this.fxpool=this["classic"===n?"poolBeatFx":"poolPunchFx"],this.fx=this.fxpool.requestEntity()),this.fx&&(this.fx.play(),this.fx.object3D.position.copy(c),this.fx.object3D.rotation.copy(l),this.fx.emit("explode")),this.returnToPoolTimer=500,this.breaking=!0,this.el.play()}},returnToPool:function(){for(let e=0;e<this.pieces.length;e++){let t=this.pieces[e];t.position.copy(t.restPosition),t.rotation.copy(t.restRotation),t.posVelocity.set(0,0,0),t.rotVelocity.set(0,0,0),t.scale.set(1,1,1)}this.fx&&(this.fxpool.returnEntity(this.fx),this.fx=null),this.pool.returnEntity(this.el),this.breaking=!1},tick:function(e,t){if(this.breaking)if(this.returnToPoolTimer-=t,this.returnToPoolTimer<=0)this.returnToPool();else for(let e=0;e<this.pieces.length;e++){const n=this.pieces[e];n.position.addScaledVector(n.posVelocity,t),n.rotation.set(n.rotation.x+n.rotVelocity.x*t,n.rotation.y+n.rotVelocity.y*t,n.rotation.z+n.rotVelocity.z*t),"mine"!==this.data.type?(this.returnToPoolTimer<250&&n.scale.multiplyScalar(.94),n.posVelocity.multiplyScalar(.97),n.posVelocity.y-=3e-6*t):(n.scale.multiplyScalar(.94),n.posVelocity.multiplyScalar(.97))}}}),window.AFRAME){const t=["beat-cut-fx"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("beat-hit-sound",{directionsToSounds:{up:"",down:"",upleft:"left",upright:"right",downleft:"left",downright:"right",left:"left",right:"right"},init:function(){this.currentBeatEl=null,this.currentCutDirection="",this.processSound=this.processSound.bind(this),this.sourceCreatedCallback.bind(this);for(let e=1;e<=10;e++)this.el.setAttribute("sound__beathit"+e,{poolSize:8,positional:!1,src:"#hitSound"+e,volume:.185}),this.el.setAttribute(`sound__beathit${e}left`,{poolSize:8,positional:!1,src:`#hitSound${e}left`,volume:.185}),this.el.setAttribute(`sound__beathit${e}right`,{poolSize:8,positional:!1,src:`#hitSound${e}right`,volume:.185})},play:function(){for(let e=1;e<=10;e++)this.el.components["sound__beathit"+e].loaded||(this.el.setAttribute("sound__beathit"+e,"src",""),this.el.setAttribute("sound__beathit"+e,"src","#hitSound"+e)),this.el.components[`sound__beathit${e}left`].loaded||(this.el.setAttribute(`sound__beathit${e}left`,"src",""),this.el.setAttribute(`sound__beathit${e}left`,"src",`#hitSound${e}left`)),this.el.components[`sound__beathit${e}right`].loaded||(this.el.setAttribute(`sound__beathit${e}right`,"src",""),this.el.setAttribute(`sound__beathit${e}right`,"src",`#hitSound${e}right`))},playSound:function(e,t,n){const r=1+Math.floor(10*Math.random()),i=this.directionsToSounds[n||"up"];this.el.components[`sound__beathit${r}${i}`].playSound(this.processSound)},processSound:function(e){e.detune=0},sourceCreatedCallback:function(e){const t=this.getLayer(this.currentBeatEl.object3D.position.y);"bottom"===t?e.detune.setValueAtTime(-400,0):"top"===t&&e.detune.setValueAtTime(200,0),"down"===this.currentCutDirection&&e.detune.linearRampToValueAtTime(-400,1),"up"===this.currentCutDirection&&e.detune.linearRampToValueAtTime(400,1)},getLayer:function(e){return 1===e?"bottom":1.7===e?"top":"middle"}}),window.AFRAME){const t=["beat-hit-sound"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("blade",{schema:{enabled:{default:!1}},init:function(){const e=this.el;this.data;this.bladeHandle=e.querySelector(".bladeHandleHelper").object3D,this.bladeTip=e.querySelector(".bladeTipHelper").object3D,this.rigEl=document.getElementById("curveFollowRig"),this.strokeDirectionVector=new THREE.Vector3,this.strokeSpeed=0,this.bladeBottomPosition=new THREE.Vector3,this.bladeTipPositions=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3],this.bladeWorldPositions=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3],this.bladeEl=this.el.querySelector(".blade")},update:function(e){!e.enabled&&this.data.enabled&&this.bladeEl.emit("drawblade")},tickBeatSystem:function(e,t){this.data.enabled&&this.updateVelocity(t)},updateVelocity:function(e){const t=this.bladeTipPositions,n=this.bladeWorldPositions;this.data;n[2].copy(n[0]),n[3].copy(n[1]),this.bladeTip.getWorldPosition(n[0]),this.bladeHandle.getWorldPosition(n[1]),t[2].copy(n[0]),this.rigEl.object3D.worldToLocal(t[2]),this.strokeDirectionVector.copy(t[2]).sub(t[0]);const r=this.strokeDirectionVector.length();this.strokeSpeed=r/(e/1e3),this.strokeDirectionVector.z=0,this.strokeDirectionVector.normalize();const i=t.shift();t.push(i)},checkCollision:function(){const e=new THREE.Box3,t=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3],n=new THREE.Triangle;return function(r){if(this.strokeSpeed<1)return!1;for(let e=0;e<3;e++)t[e].copy(this.bladeWorldPositions[e]),r.blockEl.object3D.worldToLocal(t[e]),t[e].multiplyScalar(1.75);return n.set(t[0],t[1],t[2]),e.copy(r.bbox),e.expandByScalar(.02),"left"!==r.horizontalPosition&&"right"!==r.horizontalPosition||e.expandByScalar(.07),!!e.intersectsTriangle(n)||(t[3].copy(this.bladeWorldPositions[3]),r.blockEl.object3D.worldToLocal(t[3]),n.set(t[2],t[3],t[0]),!!e.intersectsTriangle(n))}}(),createDebugCube:function(e,t){const n=new THREE.BoxGeometry(.05,.05,.05),r=new THREE.Mesh(n,new THREE.MeshBasicMaterial({color:t,side:THREE.DoubleSide}));r.position.copy(e),this.el.sceneEl.object3D.add(r)}}),window.AFRAME){const t=["blade"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerSystem("check-vr",{init:function(){AFRAME.utils.device.isMobile()&&(document.getElementById("vrButton").style.display="none"),setTimeout(()=>{AFRAME.utils.device.checkHeadsetConnected()&&this.el.emit("displayconnected")},250)}}),window.AFRAME){const t=[],n=[],r=["check-vr"];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("console-shortcuts",{play:function(){window.$=e=>document.querySelector(e),window.$$=e=>document.querySelectorAll(e),window.$$$=e=>document.querySelector(`[${e}]`).getAttribute(e),window.$$$$=e=>document.querySelector(`[${e}]`).components[e],window.scene=this.el,window.state=this.el.systems.state.state}}),window.AFRAME){const t=["console-shortcuts"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("controller",{schema:{hand:{default:"right",oneOf:["left","right"]}},init:function(){const e=this.el,t=this.data;this.controllerType="",e.addEventListener("controllerconnected",e=>{this.controllerType=e.detail.name,this.el.setAttribute("cursor",this.config[this.controllerType].cursor||{})});const n={hand:t.hand,model:!1};e.setAttribute("daydream-controls",n),e.setAttribute("oculus-go-controls",n),e.setAttribute("oculus-touch-controls",{hand:t.hand,model:!1,orientationOffset:{x:0,y:0,z:0}}),e.setAttribute("vive-controls",n),e.setAttribute("vive-focus-controls",n),e.setAttribute("windows-motion-controls",n),e.setAttribute("generic-tracked-controller-controls",n)},config:{"daydream-controls":{cursor:{downEvents:["trackpaddown","triggerdown"],upEvents:["trackpadup","triggerup"]}},"oculus-go-controls":{cursor:{downEvents:["trackpaddown","triggerdown"],upEvents:["trackpadup","triggerup"]}},"oculus-touch-controls":{cursor:{downEvents:["triggerdown","gripdown","abuttondown","bbuttondown","xbuttondown","ybuttondown"],upEvents:["triggerup","gripup","abuttonup","bbuttonup","xbuttonup","ybuttonup"]}},"vive-controls":{cursor:{downEvents:["trackpaddown","triggerdown","gripdown"],upEvents:["trackpadup","triggerup","gripup"]}},"vive-focus-controls":{cursor:{downEvents:["trackpaddown","triggerdown","gripdown"],upEvents:["trackpadup","triggerup","gripup"]}},"windows-motion-controls":{cursor:{downEvents:["trackpaddown","triggerdown","gripdown"],upEvents:["trackpadup","triggerup","gripup"]}},"generic-tracked-controller-controls":{cursor:{downEvents:["triggerdown"],upEvents:["triggerup"]}}}}),window.AFRAME){const t=["controller"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("copy-texture",{dependencies:["geometry","material"],schema:{from:{type:"selector"}},init:function(){this.data.from.addEventListener("materialtextureloaded",()=>{this.copyTexture()}),this.copyTexture()},copyTexture:function(){const e=this.el,t=this.data.from,n=e.getObject3D("mesh").material;t.getObject3D("mesh")&&(n.map=t.getObject3D("mesh").material.map,n.map&&(n.map.needsUpdate=!0,n.needsUpdate=!0))}}),window.AFRAME){const t=["copy-texture"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("cursor-laser",{dependencies:["geometry"],schema:{enabled:{default:!0}},init:function(){const e=this.el;this.weaponEl=this.el.closest(".weapon");const t=this.el.getAttribute("geometry");e.object3D.position.z=-1*t.height/2,this.originalSize=t.height,this.currentLength=t.height},update:function(){this.el.object3D.visible=this.data.enabled},tick:function(){const e=this.el;if(!this.data.enabled)return;const t=this.weaponEl.components.cursor;if(!t)return;if(!t.intersectedEl)return e.object3D.position.z=-24.98,e.object3D.scale.x=.75,e.getObject3D("mesh").scale.y=50,void(this.currentLength=1);const n=this.weaponEl.components.raycaster.intersections[0];n&&(e.object3D.scale.x=1,e.object3D.position.z=-n.distance/2,e.getObject3D("mesh").scale.y=this.currentLength=n.distance)}}),window.AFRAME){const t=["cursor-laser"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("cursor-mesh",{schema:{active:{default:!0},cursorEl:{type:"selector"}},init:function(){this.scenePivotEl=document.getElementById("scenePivot")},update:function(){this.el.object3D.visible=this.data.active},tick:function(){var e,t,n=this.data.cursorEl,r=this.el,i=this.scenePivotEl;this.data.active&&n.components.cursor&&((t=n.components.cursor.intersectedEl)?(r.object3D.visible=!0,(e=n.components.raycaster.getIntersection(t))&&(r.object3D.position.copy(e.point),i&&r.object3D.rotation.copy(i.object3D.rotation))):r.object3D.visible=!1)}}),window.AFRAME){const t=["cursor-mesh"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("curve-follow-rig-reset",{schema:{isVictory:{type:"string"}},init:function(){this.el.sceneEl.addEventListener("cleargame",()=>{this.reset()})},update:function(e){const t=this.data;this.el;!e.isVictory&&t.isVictory&&this.reset()},reset:function(){this.el.components["supercurve-follow"].curveProgress=0,this.el.object3D.position.set(0,0,0),this.el.object3D.rotation.set(0,0,0)}}),window.AFRAME){const t=["curve-follow-rig-reset"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerShader("cutfxShader",{schema:{src:{type:"map",is:"uniform",default:"#cutfxImg"},color:{type:"color",is:"uniform",default:"#fff"},progress:{type:"number",is:"uniform"},transparent:{default:!0},blending:{default:"additive"},side:{default:"double"},depthTest:{default:!1},depthWrite:{default:!1}},vertexShader:n(73),fragmentShader:n(74)}),window.AFRAME){const t=[],n=["cutfxShader"],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t){e.exports="varying vec2 uvs;\nvoid main() {\n uvs.xy = uv.xy;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n"},function(e,t){e.exports="varying vec2 uvs;\nuniform sampler2D src;\nuniform vec3 color;\nuniform float progress;\n\nvoid main() {\n vec3 col = color;\n float alpha = smoothstep(progress, 1.0, texture2D(src, uvs).a);\n gl_FragColor = vec4(col, alpha);\n}\n"},function(e,t,n){if(AFRAME.registerComponent("debug-beat-generator",{dependencies:["beat-generator"],schema:{beatEnabled:{default:!1},stageEnabled:{default:!1}},init:function(){this.beatLoader=this.el.components["beat-generator"],this.selectedBeat={color:"red",position:"middleCenterLeft",type:"arrow",orientation:"up"},this.beats={},this.onKeyDown=this.onKeyDown.bind(this),(this.data.stageEnabled||AFRAME.utils.getUrlParameter("debugstage"))&&this.addDebugStageControls(),(this.data.beatEnabled||"gameplay"===AFRAME.utils.getUrlParameter("debugstate").trim())&&(window.addEventListener("keydown",this.onKeyDown),this.addDebugBeatControls())},spawn:function(){var e=this;Object.keys(this.beats).forEach((function(t){e.generateBeat(e.beats[t])}))},generateBeat:function(e){var t;"wall"!==e.type?(t="mine"===e.type?3:"red"===e.color?0:1,this.beatLoader.generateBeat({_lineIndex:this.beatLoader.positionHumanized[e.position].index,_lineLayer:this.beatLoader.positionHumanized[e.position].layer,_cutDirection:"dot"===e.type?8:this.beatLoader.orientationsHumanized.indexOf(e.orientation),_type:t})):this.generateWall(e)},generateWall:function(e){this.beatLoader.bpm=90,this.beatLoader.generateWall({_lineIndex:this.beatLoader.positionHumanized[e.position].index,_width:1,_duration:3})},onKeyDown:function(e){switch(e.keyCode){case 32:this.spawn()}},addDebugBeatControls:function(){const e=document.createElement("div"),t=this;var n;function r(t){const n=document.createElement("div");return n.id=t,n.style.marginBottom="20px",n.style.width="500px",n.style.display="inline-block",e.appendChild(n),n}function i(e,n,r){const i=document.createElement("div"),a=r||function(){const e=i.parentElement.querySelectorAll(".button");for(let t=0;t<e.length;t++)e[t].style.background="#000";i.style.background="#66f",t.selectedBeat[i.parentElement.id]=this.id,t["selected"+i.parentElement.id.charAt(0).toUpperCase()+i.parentElement.id.slice(1)+"El"]=this};return i.classList.add("button"),i.id=e,i.style.width="100px",i.style.height="30px",i.style.background="#000",i.style.color="#fff",i.style.zIndex=999999999,i.style.padding="5px",i.style.margin="5px",i.style.font="14px sans-serif",i.style.textAlign="center",i.style.lineHeight="30px",i.style.cursor="pointer",i.style.display="inline-block",i.innerHTML=e,n.appendChild(i),i.addEventListener("click",a),i}e.style.position="absolute",e.style.right="0",e.style.top="0",e.style.padding="10px",e.style.width="500px",e.style.height="600px",document.body.appendChild(e),function(){const t=r("type");i("arrow",t),i("dot",t),i("mine",t),i("wall",t),e.appendChild(t)}(),function(){const t=r("color");i("blue",t),i("red",t),e.appendChild(t)}(),function(){const t=r("orientation");i("top",t),i("left",t),i("right",t),i("down",t),e.appendChild(t)}(),(n=i("Set Beat",e,(function(){var e="mine"!==t.selectedBeat.type?" "+t.selectedBeat.color:"",n="arrow"!==t.selectedBeat.type?"":" "+t.selectedBeat.orientation;t.selectedBeat={position:t.selectedBeat.position,type:t.selectedBeat.type,orientation:t.selectedBeat.orientation,color:t.selectedBeat.color},t.selectedPositionEl&&(t.selectedPositionEl.innerHTML=t.selectedBeat.type+e+n,t.beats[t.selectedPositionEl.id]={position:t.selectedBeat.position,type:t.selectedBeat.type,orientation:t.selectedBeat.orientation,color:t.selectedBeat.color})}))).style.width="460px",n.style.bottomMargin="10px",function(){const e=r("position");i("topLeft",e),i("topCenterLeft",e),i("topCenterRight",e),i("topRight",e),i("middleLeft",e),i("middleCenterLeft",e),i("middleCenterRight",e),i("middleRight",e),i("bottomLeft",e),i("bottomCenterLeft",e),i("bottomCenterRight",e),i("bottomRight",e)}(),function(n,r){const a=i("Spawn (Space Bar)",e,()=>{t.spawn()});a.style.width="460px",a.style.bottomMargin="10px"}()},addDebugStageControls:function(){var e=0;const t=(t,n,r)=>{const i=document.createElement("div");i.style.position="absolute",i.id="stagecontrol"+t,i.style.width="100px",i.style.height="30px",i.style.top="element"===r?"20px":"70px",i.style.background="#000",i.style.color="#fff",i.style.zIndex=999999999,i.style.padding="5px",i.style.font="14px sans-serif",i.style.textAlign="center",i.style.cursor="pointer",i.style.left=20+120*t+"px",i.innerHTML=n,"element"===r?i.addEventListener("click",()=>{document.getElementById("stagecontrol"+e).style.background="#000",i.style.background="#66f",e=t}):i.addEventListener("click",()=>{this.beatLoader.generateEvent({_type:e,_value:t})}),document.body.appendChild(i)};["sky","tunnelNeon","leftStageLasers","rightStageLasers","floor"].forEach((e,n)=>{t(n,e,"element")}),["off","blue","blue","bluefade","","red","red","redfade"].forEach((e,n)=>{t(n,e,"value")})}}),window.AFRAME){const t=["debug-beat-generator"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){const r=["left","middleleft","middleright","right"],i=["bottom","middle","top"];if(AFRAME.registerComponent("debug-beat-positioning",{play:function(){let e=AFRAME.utils.getUrlParameter("debugbeatpositioning");e&&("punch"!==e&&"classic"!==e&&(e="classic"),this.el.emit("debugbeatpositioning"),setTimeout(()=>{const t=this.el.sceneEl.components["beat-generator"];t.data.gameMode=e,scene.components["beat-system"].data.gameMode=e,scene.components["beat-system"].updateBeatPositioning(),r.forEach(n=>{i.forEach(r=>{let i=t.requestBeat("punch"===e?"dot":"arrow","red"),a=Math.random()<.5?"left":"right";i.components.beat.onGenerate(.001,n,r,a),i.object3D.renderOrder=9999,i.play(),i=t.requestBeat("dot","blue"),a=Math.random()<.5?"down":"up",i.components.beat.onGenerate(.0015,n,r,a),i.object3D.renderOrder=9999,i.play()})});const n=scene.components.pool__wall.requestEntity();n.components.wall.onGenerate(.0015,"left",4,4,!0),n.play(),document.getElementById("beatContainer").removeAttribute("bind__visible"),document.getElementById("beatContainer").object3D.visible=!0},500))}}),window.AFRAME){const t=["debug-beat-positioning"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("debug-controller",{init:function(){var e,t;AFRAME.utils.getUrlParameter("debug")&&(console.log("%c debug-controller enabled ","background: #111; color: red"),e=document.getElementById("rightHand"),t=document.getElementById("leftHand"),e.setAttribute("tracked-controls","autoHide",!1),e.object3D.visible=!0,t.object3D.visible=!0,t.setAttribute("tracked-controls","autoHide",!1),AFRAME.utils.getUrlParameter("headfist")||(window.addEventListener("click",t=>{t.isTrusted&&(e.emit("triggerdown"),e.emit("triggerup"))}),"oculus"===AFRAME.utils.getUrlParameter("debug")?(e.emit("controllerconnected",{name:"oculus-touch-controls"}),t.emit("controllerconnected",{name:"oculus-touch-controls"}),e.setAttribute("controller","controllerType","oculus-touch-controls"),t.setAttribute("controller","controllerType","oculus-touch-controls")):(e.emit("controllerconnected",{name:"vive-controls"}),t.emit("controllerconnected",{name:"vive-controls"}),e.setAttribute("controller","controllerType","vive-controls"),t.setAttribute("controller","controllerType","vive-controls")),this.el.emit("enter-vr",null,!1),document.addEventListener("keydown",n=>{var r,i,a,o;n.shiftKey&&(32!==n.keyCode?81!==n.keyCode?(78===n.keyCode&&(this.secondaryGripDown?(t.emit("gripup"),this.secondaryGripDown=!1):(t.emit("gripdown"),this.secondaryGripDown=!0)),77===n.keyCode&&(this.primaryGripDown?(e.emit("gripup"),this.primaryGripDown=!1):(e.emit("gripdown"),this.primaryGripDown=!0)),49===n.keyCode&&t.emit("menudown"),n.ctrlKey?(a=t.getAttribute("position"),72===n.keyCode&&(a.x-=.02),74===n.keyCode&&(a.y-=.02),75===n.keyCode&&(a.y+=.02),76===n.keyCode&&(a.x+=.02),59!==n.keyCode&&186!==n.keyCode||(a.z-=.01),222===n.keyCode&&(a.z+=.01),t.setAttribute("position",AFRAME.utils.clone(a))):(r=e.getAttribute("position"),72===n.keyCode&&(r.x-=.02),74===n.keyCode&&(r.y-=.02),75===n.keyCode&&(r.y+=.02),76===n.keyCode&&(r.x+=.02),59!==n.keyCode&&186!==n.keyCode||(r.z-=.02),222===n.keyCode&&(r.z+=.02),e.setAttribute("position",AFRAME.utils.clone(r))),n.ctrlKey?(o=t.getAttribute("rotation"),89===n.keyCode&&(o.x-=10),79===n.keyCode&&(o.x+=10),85===n.keyCode&&(o.y-=10),73===n.keyCode&&(o.y+=10),t.setAttribute("rotation",AFRAME.utils.clone(o))):(i=e.getAttribute("rotation"),89===n.keyCode&&(i.x-=10),79===n.keyCode&&(i.x+=10),85===n.keyCode&&(i.y-=10),73===n.keyCode&&(i.y+=10),e.setAttribute("rotation",AFRAME.utils.clone(i)))):this.isSecondaryTriggerDown?(t.emit("triggerup"),this.isSecondaryTriggerDown=!1):(t.emit("triggerdown"),this.isSecondaryTriggerDown=!0):this.isTriggerDown?(e.emit("triggerup"),this.isTriggerDown=!1):(e.emit("triggerdown"),this.isTriggerDown=!0))})))},play:function(){var e,t;if(this.bounds=document.body.getBoundingClientRect(),!AFRAME.utils.getUrlParameter("debug"))return;if(AFRAME.utils.getUrlParameter("headfist"))return;e=document.getElementById("rightHand"),(t=document.getElementById("leftHand")).object3D.position.set(-.2,1.5,-.5),e.object3D.position.set(.2,1.5,-.5),t.setAttribute("rotation",{x:35,y:0,z:0});const n=AFRAME.utils.getUrlParameter("type");[e,t].forEach(e=>{e.querySelector(".laser").object3D.visible=!1,"classic"===n?(e.querySelector(".bladeContainer").removeAttribute("bind__visible"),e.querySelector(".bladeContainer").object3D.visible=!0,e.querySelector(".bladeContainer").object3D.scale.set(1,1,1)):"punch"===n?(e.querySelector(".punch").removeAttribute("bind__visible"),e.querySelector(".punch").object3D.visible=!0,e.querySelector(".punch").object3D.visible=!0,e.querySelector(".bladeHandle").object3D.visible=!1):"ride"===n&&(e.querySelector(".handStar").removeAttribute("bind__visible"),e.querySelector(".handStar").object3D.visible=!0,e.querySelector(".bladeHandle").object3D.visible=!1)})},onMouseMove:function(){const e=new THREE.Vector3,t=new THREE.Vector2,n=new THREE.Vector3;return function(r){const i=this.bounds,a=this.el.sceneEl.camera,o=r.clientX-i.left,s=r.clientY-i.top;t.x=o/i.width*2-1,t.y=-s/i.height*2-1,document.getElementById("camera").object3D.getWorldPosition(n),e.set(t.x,t.y,.5).unproject(a).sub(n).normalize();const c=document.getElementById("rightHand").object3D.position,l=-n.z/e.z;a.getWorldPosition(c).add(e.multiplyScalar(l)),c.y+=.8}}()}),window.AFRAME){const t=["debug-controller"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("debug-cursor",{init:function(){},log:function(e,t,n){t.id?console.log(`%c[${e}] ${t.id}`,"color: "+n):(console.log(`%c[${e}]`,"color: "+n),console.log(t))}}),window.AFRAME){const t=["debug-cursor"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){const r=AFRAME.utils.getUrlParameter("skipintro");if(AFRAME.registerComponent("debug-intro",{play:function(){r&&document.getElementById("startButton").emit("click")}}),window.AFRAME){const t=["debug-intro"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("debug-song-time",{dependencies:["song"],init:function(){AFRAME.utils.getUrlParameter("debug-song-time")&&setInterval(()=>{console.log(this.el.components.song.getCurrentTime())},250)}}),window.AFRAME){const t=["debug-song-time"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("debug-state",{play:function(){const e=AFRAME.utils.getUrlParameter("debugstate").trim();e&&setTimeout(()=>{e.split(",").forEach(e=>{this.el.sceneEl.emit("debug"+e.trim(),null,!1)})},500)}}),window.AFRAME){const t=["debug-state"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("delayed-proxy-event",{schema:{captureBubbles:{default:!1},enabled:{default:!0},event:{type:"string"},from:{type:"string"},to:{type:"string"},as:{type:"string"},bubbles:{default:!1},delay:{default:0,type:"int"}},multiple:!0,init:function(){var e,t,n,r=this.data,i=this.el,a=this;if(r.from?e="PARENT"===r.from?[i.parentNode]:document.querySelectorAll(r.from):n="CHILDREN"===r.to?i.querySelectorAll("*"):"SELF"===r.to?[i]:document.querySelectorAll(r.to),r.from)for(t=0;t<e.length;t++)this.addEventListenerFrom(e[t]);else i.addEventListener(r.event,(function(e){setTimeout(()=>{var r=a.data;if(r.enabled&&(r.captureBubbles||e.target===i))for(t=0;t<n.length;t++)n[t].emit(r.as||r.event,e.detail?e.detail:null,r.bubbles)},r.delay)}))},addEventListenerFrom:function(e){var t=this.data,n=this;e.addEventListener(t.event,(function(r){setTimeout(()=>{var t=n.data;t.enabled&&(t.captureBubbles||r.target===e)&&n.el.emit(t.as||t.event,r.detail?r.detail:null,!1)},t.delay)}))}}),window.AFRAME){const t=["delayed-proxy-event"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("difficulty-background",{schema:{enabled:{type:!1}},update:function(){this.data.enabled?this.el.setAttribute("raycastable",""):this.el.removeAttribute("raycastable")}}),window.AFRAME){const t=["difficulty-background"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("difficulty-filter",{events:{click:function(e){this.el.sceneEl.emit("difficultyfilter",e.target.parentNode.dataset.difficultyFilter)}}}),window.AFRAME){const t=["difficulty-filter"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("difficulty-text",{schema:{id:{value:"Standard-Easy"}},update:function(){this.el.setAttribute("text","value",this.data.id.replace("Standard-","").replace("-","\n"))}}),window.AFRAME){const t=["difficulty-text"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("follow-position",{schema:{target:{type:"selector"}},tick:function(){this.el.object3D.position.copy(this.data.target.object3D.position)}}),window.AFRAME){const t=["follow-position"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("follow-z",{schema:{offset:{type:"vec3"},target:{type:"selector"}},tick:function(){this.data.target&&(this.el.object3D.position.copy(this.data.offset),this.el.object3D.position.z+=this.data.target.object3D.position.z)}}),window.AFRAME){const t=["follow-z"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("gameover",{schema:{isGameOver:{default:!1}},init:function(){this.beatContainer=document.getElementById("beatContainer"),this.gameOverEls=document.querySelectorAll("[animation__gameover]")},update:function(e){this.data;!e.isGameOver&&this.data.isGameOver&&(this.triggerAnimations(),this.countDown=1),e.isGameOver&&!this.data.isGameOver&&this.reset()},tick:function(e,t){this.data.isGameOver&&this.countDown>=0&&(this.beatContainer.object3D.position.z=1.5*-Math.pow(1-this.countDown,2),this.countDown-=t/1e3)},reset:function(){this.beatContainer.object3D.position.z=0,this.el.sceneEl.setAttribute("stage-colors","color","blue")},triggerAnimations:function(){for(let e=0;e<this.gameOverEls.length;e++)this.gameOverEls[e].emit("gameover",null,!1);this.el.emit("textglowoff",null,!1),this.el.emit("bgcolorgameover",null,!1)}}),window.AFRAME){const t=["gameover"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){let r=0;if(AFRAME.registerComponent("gpu-preloader",{dependencies:["materials"],play:function(){setTimeout(()=>{this.preloadFromSelector("#mainLogo"),this.preloadFromSelector("#prevArrow"),this.preloadFromSelector("#stepback"),this.preloadFromSelector(".difficultyBackground"),this.preloadFromSelector(".genreIcon"),this.preloadFromSelector(".merkababloom"),this.preloadFromSelector(".searchResultBackground"),this.preloadMaterialsComponentTextures(),this.preloadKeyboard(),this.preloadSlice(),this.preloadEnvMap(),this.preloadFXs()},1e3)},preloadFromSelector:function(e){const t=document.querySelector(e);this.preloadTexture(t.getObject3D("mesh").material.map)},preloadMaterialsComponentTextures:function(){const e=this.el.systems.materials.textureList;for(var t=0;t<e.length;t++)this.preloadTexture(e[t])},preloadKeyboard:function(){const e=document.getElementById("keyboard").components["super-keyboard"];this.preloadTexture(e.kbImg.getObject3D("mesh").material.map),this.preloadTexture(e.keyColorPlane.getObject3D("mesh").material.map)},preloadSlice:function(){const e=document.getElementById("searchPrevPage");this.preloadTexture(e.components.slice9.material.map)},preloadEnvMap:function(){const e=document.querySelector("#wallContainer [wall]");this.preloadTexture(e.components.material.material.uniforms.environment.value)},preloadFXs:function(){const e=document.querySelector("#rigContainer [mixin~=blueBeatFX]");this.preloadTexture(e.components.material.material.uniforms.src.value);const t=document.querySelector("#rigContainer [mixin~=mineFX]");this.preloadTexture(t.components.material.material.map)},preloadTexture:function(e){e&&e.image?e.image.complete?this.el.renderer.setTexture2D(e,r++%8):console.warn("[gpu-preloader] Error preloading, image not loaded",e):console.warn("[gpu-preloader] Error preloading texture",e)}}),window.AFRAME){const t=["gpu-preloader"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerShader("gradientShader",{schema:{color1:{type:"color",is:"uniform"},color2:{type:"color",is:"uniform"}},vertexShader:n(16),fragmentShader:n(91)}),window.AFRAME){const t=[],n=["gradientShader"],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t){e.exports="varying vec2 uvs;\nuniform vec3 color1;\nuniform vec3 color2;\n\nvoid main () {\n float mixDistance = distance(uvs, vec2(0.5, 0));\n float alphaDistance = min(1., (0.5 - distance(uvs, vec2(0.5))) * 2.5);\n gl_FragColor = vec4(mix(color1, color2, pow(mixDistance, 2.4)), alphaDistance);\n}\n"},function(e,t,n){const r=["triggerdown","gripdown","abuttondown","bbuttondown","xbuttondown","ybuttondown","trackpaddown"];if(AFRAME.registerComponent("hand-swapper",{schema:{enabled:{default:!1}},init:function(){this.swapHand=this.swapHand.bind(this),r.forEach(e=>{this.el.addEventListener(e,this.swapHand)})},swapHand:function(){this.data.enabled&&this.el.sceneEl.emit("activehandswap",null,!1)}}),window.AFRAME){const t=["hand-swapper"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){"use strict";n.r(t);var r=n(0),i=n.n(r);if(AFRAME.registerShader("handStar",{schema:{colorPrimary:{type:"color",is:"uniform",default:i.a.initial.primary},colorSecondary:{type:"color",is:"uniform",default:i.a.initial.secondary},colorTertiary:{type:"color",is:"uniform",default:i.a.initial.tertiary},pulse:{type:"number",is:"uniform",default:0},transparent:{default:!0},side:{default:"back"},depthTest:{default:!1}},vertexShader:n(94),fragmentShader:n(95)}),window.AFRAME){const t=[],n=["handStar"],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t){e.exports="varying vec3 vWorldPosition;\nvarying float fresnel;\nuniform float pulse;\n\nvoid main() {\n vWorldPosition = (modelMatrix * vec4(position, 1.0)).xyz;\n vec3 worldNormal = normalize(mat3(modelMatrix[0].xyz, modelMatrix[1].xyz, modelMatrix[2].xyz) * normal);\n vec3 viewVector = normalize(vWorldPosition - cameraPosition);\n fresnel = 0.08 * pow(0.4 + dot(viewVector, worldNormal), 6.0 + pulse);\n\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n"},function(e,t){e.exports="varying vec3 vWorldPosition;\nvarying float fresnel;\nuniform float pulse;\nuniform vec3 colorPrimary;\nuniform vec3 colorSecondary;\nuniform vec3 colorTertiary;\n\nvoid main() {\n vec3 colorize = vWorldPosition-cameraPosition;\n colorize = clamp(colorize + 0.5, vec3(0.0), vec3(1.0));\n vec3 col = mix(mix(colorPrimary, colorSecondary, colorize.x), colorTertiary, colorize.z);\n col += (fresnel * pulse) * 0.1;\n gl_FragColor = vec4 (col, clamp(fresnel, 0.0, 1.0));\n}\n"},function(e,t,n){if(AFRAME.registerComponent("haptics-wall",{schema:{enabled:{default:!1}},init:function(){const e=this.el;this.isHittingWall=!1,e.setAttribute("haptics__wall",{dur:50,force:.15}),this.checkIfHittingWall=this.checkIfHittingWall.bind(this),e.addEventListener("mouseenter",this.checkIfHittingWall),e.addEventListener("mouseleave",this.checkIfHittingWall),this.tick=AFRAME.utils.throttleTick(this.tick.bind(this),50)},checkIfHittingWall:function(){const e=this.el.components.raycaster__game.intersectedEls;this.isHittingWall=!1;for(let t=0;t<e.length;t++)if(e[t].components.wall)return void(this.isHittingWall=!0)},tick:function(){this.data.enabled&&this.isHittingWall&&this.el.components.haptics__wall.pulse()}}),window.AFRAME){const t=["haptics-wall"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("haptics-weapons",{schema:{enabled:{default:!1}},init:function(){const e=this.el;this.isColliding=!1,this.tick=AFRAME.utils.throttleTick(this.tick.bind(this),100),e.setAttribute("haptics__weapon",{dur:100,force:.075}),e.addEventListener("mouseenter",t=>{if(!t.detail||!t.detail.intersectedEl||!this.data.enabled)return;const n=t.detail.intersectedEl;n.classList.contains("blade")&&n!==e?(this.isColliding=!0,this.el.components.haptics__weapon.pulse()):this.isColliding=!1}),e.addEventListener("mouseleave",e=>{this.isColliding=!1})},tick:function(){this.isColliding&&this.data.enabled&&this.el.components.haptics__weapon.pulse()}}),window.AFRAME){const t=["haptics-weapons"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){const r=!!AFRAME.utils.getUrlParameter("headfist");if(AFRAME.registerComponent("headfist",{schema:{hand:{type:"string"},isPlaying:{default:!1}},init:function(){console.log("[headfist] "+r),r&&(this.camera=document.getElementById("camera").object3D,this.originalParent=this.el.object3D.parent)},update:function(){const e=this.el;if(r&&this.camera)return this.data.isPlaying?(this.camera.add(e.object3D),e.object3D.rotation.set(-5,0,0),e.object3D.position.set("right"===this.data.hand?.175:-.175,.15,-.2),e.components["tracked-controls"].pause(),e.components["tracked-controls-webvr"]&&e.components["tracked-controls-webvr"].pause(),void(e.components["tracked-controls-webxr"]&&e.components["tracked-controls-webxr"].pause())):void(e.object3D.parent!==this.originalParent&&(console.log("[headfist] Detach."),this.originalParent.add(e.object3D),e.components["tracked-controls-webvr"]&&e.components["tracked-controls-webvr"].play(),e.components["tracked-controls-webxr"]&&e.components["tracked-controls-webxr"].play()))}}),window.AFRAME){const t=["headfist"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("history",{schema:{challengeId:{type:"string"},songName:{type:"string"},songSubName:{type:"string"}},update:function(){const e=this.data;history.pushState("",e.songName,updateQueryParam(window.location.href,"challenge",e.challengeId)),document.title="Super Saber - "+e.songName}}),window.AFRAME){const t=["history"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("intro-song",{schema:{isPlaying:{default:!0},isSearching:{default:!1}},init:function(){this.analyserEl=document.getElementById("audioAnalyser"),this.audio=document.getElementById("introSong"),this.timeout=null},update:function(e){const t=this.audio;this.el.sceneEl.isPlaying&&(!e.isSearching&&this.data.isSearching||(!e.isPlaying&&this.data.isPlaying&&(this.analyserEl.components.audioanalyser.resumeContext(),this.analyserEl.setAttribute("audioanalyser","src",t),this.fadeInAudio()),e.isPlaying&&!this.data.isPlaying&&t.pause()))},pause:function(){this.audio.pause()},play:function(){this.fadeInAudio()},fadeInAudio:function(){if(AFRAME.utils.getUrlParameter("mute"))return;const e=this.analyserEl.components.audioanalyser.context,t=this.analyserEl.components.audioanalyser.gainNode;t.gain.setValueAtTime(0,e.currentTime),this.audio.play(),t.gain.linearRampToValueAtTime(.5,e.currentTime+.5)}}),window.AFRAME){const t=["intro-song"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("keyboard-raycastable",{dependencies:["super-keyboard"],schema:{condition:{default:""}},play:function(){this.el.components["super-keyboard"].kbImg.setAttribute("bind-toggle__raycastable",this.data.condition)}}),window.AFRAME){const t=["keyboard-raycastable"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){const r=n(103),i=n(104);n(106);const a=/(fuc)|(ass)|(nig)|(shit)|(retard)/gi;if(AFRAME.registerComponent("leaderboard",{schema:{apiKey:{type:"string"},authDomain:{type:"string"},databaseURL:{type:"string"},projectId:{type:"string"},storageBucket:{type:"string"},messagingSenderId:{type:"string"},challengeId:{default:""},difficulty:{default:""},beatmapCharacteristic:{default:""},inVR:{default:!1},gameMode:{type:"string"},menuSelectedChallengeId:{default:""},isVictory:{default:!1}},init:function(){this.qualifyingIndex=void 0,this.scores=[],this.eventDetail={scores:this.scores},this.addEventDetail={scoreData:void 0,index:void 0},this.username=localStorage.getItem("threewsusername")||"Super Zealot",this.el.addEventListener("leaderboardusername",e=>{this.username=e.detail.value,localStorage.setItem("threewsusername",this.username)}),this.el.addEventListener("leaderboardsubmit",this.addScore.bind(this))},update:function(e){!r.apps.length&&this.data.apiKey&&(r.initializeApp({apiKey:this.data.apiKey,authDomain:this.data.authDomain,databaseURL:this.data.databaseURL,projectId:this.data.projectId,storageBucket:this.data.storageBucket,messagingSenderId:this.data.messagingSenderId}),this.firestore=r.firestore(),this.firestore.settings({}),this.db=this.firestore.collection("scores")),!e.isVictory&&this.data.isVictory&&this.checkLeaderboardQualify(),this.data.difficulty&&e.difficulty!==this.data.difficulty||this.data.menuSelectedChallengeId&&e.menuSelectedChallengeId!==this.data.menuSelectedChallengeId?this.fetchScores(this.data.menuSelectedChallengeId):this.data.challengeId&&e.challengeId!==this.data.challengeId&&this.fetchScores(this.data.challengeId)},addScore:function(){const e=this.el.sceneEl.systems.state.state;if(!e.isVictory||!e.inVR)return;const t={accuracy:e.score.accuracy,challengeId:e.challenge.id,gameMode:this.data.gameMode,score:e.score.score,username:this.username,difficulty:this.data.difficulty||e.challenge.difficulty,time:new Date};i.includes(this.username.toLowerCase())||this.username.match(a)||this.db.add(t),this.addEventDetail.scoreData=t,this.el.emit("leaderboardscoreadded",this.addEventDetail,!1)},fetchScores:function(e){if("ride"===this.data.gameMode)return;const t=this.el.sceneEl.systems.state.state;this.db.where("challengeId","==",e).where("difficulty","==",t.menuSelectedChallenge.id?t.menuSelectedChallenge.difficulty:t.challenge.difficulty).where("gameMode","==",this.data.gameMode).orderBy("score","desc").orderBy("time","asc").limit(10).get().then(t=>{this.eventDetail.challengeId=e,this.scores.length=0,t.empty||t.forEach(e=>this.scores.push(e.data())),this.el.sceneEl.emit("leaderboard",this.eventDetail,!1)}).catch(e=>{console.error("[firestore]",e)})},checkLeaderboardQualify:function(){const e=this.el.sceneEl.systems.state.state.score.score;if(!AFRAME.utils.getUrlParameter("dot")){if(this.scores.length<10)return this.qualifyingIndex=this.scores.length,void this.el.sceneEl.emit("leaderboardqualify",this.scores.length,!1);for(let t=0;t<this.scores.length;t++)if(e>this.scores[t].score)return this.qualifyingIndex=t,void this.el.sceneEl.emit("leaderboardqualify",t,!1)}}}),window.AFRAME){const t=["leaderboard"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){"use strict";var r,i=(r=n(22))&&"object"==typeof r&&"default"in r?r.default:r;
+ */var i;n.r(t),n.d(t,"LogLevel",(function(){return a})),n.d(t,"Logger",(function(){return h})),n.d(t,"setLogLevel",(function(){return d})),n.d(t,"setUserLogHandler",(function(){return p}));var a,o=[];!function(e){e[e.DEBUG=0]="DEBUG",e[e.VERBOSE=1]="VERBOSE",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR",e[e.SILENT=5]="SILENT"}(a||(a={}));var s={debug:a.DEBUG,verbose:a.VERBOSE,info:a.INFO,warn:a.WARN,error:a.ERROR,silent:a.SILENT},c=a.INFO,l=((i={})[a.DEBUG]="log",i[a.VERBOSE]="log",i[a.INFO]="info",i[a.WARN]="warn",i[a.ERROR]="error",i),u=function(e,t){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];if(!(t<e.logLevel)){var a=(new Date).toISOString(),o=l[t];if(!o)throw new Error("Attempted to log a message with an invalid logType (value: "+t+")");console[o].apply(console,r(["["+a+"] "+e.name+":"],n))}},h=function(){function e(e){this.name=e,this._logLevel=c,this._logHandler=u,this._userLogHandler=null,o.push(this)}return Object.defineProperty(e.prototype,"logLevel",{get:function(){return this._logLevel},set:function(e){if(!(e in a))throw new TypeError('Invalid value "'+e+'" assigned to `logLevel`');this._logLevel=e},enumerable:!1,configurable:!0}),e.prototype.setLogLevel=function(e){this._logLevel="string"==typeof e?s[e]:e},Object.defineProperty(e.prototype,"logHandler",{get:function(){return this._logHandler},set:function(e){if("function"!=typeof e)throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"userLogHandler",{get:function(){return this._userLogHandler},set:function(e){this._userLogHandler=e},enumerable:!1,configurable:!0}),e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._userLogHandler&&this._userLogHandler.apply(this,r([this,a.DEBUG],e)),this._logHandler.apply(this,r([this,a.DEBUG],e))},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._userLogHandler&&this._userLogHandler.apply(this,r([this,a.VERBOSE],e)),this._logHandler.apply(this,r([this,a.VERBOSE],e))},e.prototype.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._userLogHandler&&this._userLogHandler.apply(this,r([this,a.INFO],e)),this._logHandler.apply(this,r([this,a.INFO],e))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._userLogHandler&&this._userLogHandler.apply(this,r([this,a.WARN],e)),this._logHandler.apply(this,r([this,a.WARN],e))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._userLogHandler&&this._userLogHandler.apply(this,r([this,a.ERROR],e)),this._logHandler.apply(this,r([this,a.ERROR],e))},e}();function d(e){o.forEach((function(t){t.setLogLevel(e)}))}function p(e,t){for(var n=function(n){var r=null;t&&t.level&&(r=s[t.level]),n.userLogHandler=null===e?null:function(t,n){for(var i=[],o=2;o<arguments.length;o++)i[o-2]=arguments[o];var s=i.map((function(e){if(null==e)return null;if("string"==typeof e)return e;if("number"==typeof e||"boolean"==typeof e)return e.toString();if(e instanceof Error)return e.message;try{return JSON.stringify(e)}catch(e){return null}})).filter((function(e){return e})).join(" ");n>=(null!=r?r:t.logLevel)&&e({level:a[n].toLowerCase(),message:s,args:i,type:t.name})}},r=0,i=o;r<i.length;r++){n(i[r])}}},function(e,t){e.exports="#define T time * 0.06\nvarying vec2 uvs;\nuniform float time;\nuniform float thickness;\nvoid main() {\n uvs.xy = uv.xy;\n vec3 pos = position;\n\n pos.x *= thickness + sin(T) * ((0.1 + uv.x) * 16.0 + uv.y * 4.9) * thickness * 0.005;\n pos.z *= thickness + cos(T) * ((0.1 + uv.x) * 13.0 + uv.y * 14.9) * thickness * 0.005;\n\n gl_Position = projectionMatrix * modelViewMatrix * vec4(pos, 1.0);\n}"},function(e,t){e.exports="varying vec2 uvs;\nuniform sampler2D src;\nuniform vec3 color;\nuniform float time;\n\n#define T time * 0.04\n\nvoid main() {\n vec2 uv = uvs;\n uv += T * 0.05;\n vec3 col = texture2D(src, uv).xyz;\n float core = step(0.125, uvs.x);\n gl_FragColor = vec4(col * color, mix(1.0, 0.07, core));\n}"},function(e,t){e.exports="varying vec2 uvs;\nuniform sampler2D src;\nuniform vec3 color;\nuniform float time;\n\n#define T time * 0.03\n\nvoid main() {\n vec3 col = texture2D(src, uvs * vec2(1.0, 0.7) + vec2(T * 0.01, T * 0.05)).xyz;\n gl_FragColor = vec4(col * color, 0.4 * uvs.y);\n}\n"},function(e,t){e.exports=function(e){if(e.converted)return e;e.map&&(e=e.map),e.version=e.versions[0].hash,e.directDownload=e.versions[0].downloadURL,e.coverURL=e.versions[0].coverURL.replace(/^https?:\/\/[^/]+\//,"https://eu.cdn.beatsaver.com/");let t=e.versions[0].diffs;e.metadata.characteristics={};for(const n of t)void 0===e.metadata.characteristics[n.characteristic]&&(e.metadata.characteristics[n.characteristic]={}),e.metadata.characteristics[n.characteristic][n.difficulty]=n;return e.metadata.characteristics=JSON.stringify(e.metadata.characteristics),e.converted=!0,e}},,,,,,,,,,,,function(e,t,n){function r(e){e.keys().forEach(e)}console.time=()=>{},console.timeEnd=()=>{},n(41),n(42),n(43),n(44),n(45),n(46),n(48),n(49),AFRAME.log=()=>{},n(51),n(53),n(54),n(55),n(56),n(57),r(n(58)),r(n(192)),n(196),n(203),e.hot.accept(),"http:"!==window.location.protocol||window.location.host.startsWith("localhost")||window.location.replace("https:"+location.href.substring(location.protocol.length))},function(e,t){THREE.BufferGeometryUtils={computeTangents:function(e){var t=e.index,n=e.attributes;if(null!==t&&void 0!==n.position&&void 0!==n.normal&&void 0!==n.uv){var r=t.array,i=n.position.array,a=n.normal.array,o=n.uv.array,s=i.length/3;void 0===n.tangent&&e.addAttribute("tangent",new THREE.BufferAttribute(new Float32Array(4*s),4));for(var c=n.tangent.array,l=[],u=[],h=0;h<s;h++)l[h]=new THREE.Vector3,u[h]=new THREE.Vector3;var d=new THREE.Vector3,p=new THREE.Vector3,f=new THREE.Vector3,m=new THREE.Vector2,g=new THREE.Vector2,y=new THREE.Vector2,v=new THREE.Vector3,b=new THREE.Vector3,w=e.groups;0===w.length&&(w=[{start:0,count:r.length}]);for(var A=0,E=w.length;A<E;++A)for(var x=I=(P=w[A]).start,_=I+P.count;x<_;x+=3)N(r[x+0],r[x+1],r[x+2]);var S,M,T,R=new THREE.Vector3,k=new THREE.Vector3,C=new THREE.Vector3,O=new THREE.Vector3;for(A=0,E=w.length;A<E;++A){var P,I;for(x=I=(P=w[A]).start,_=I+P.count;x<_;x+=3)L(r[x+0]),L(r[x+1]),L(r[x+2])}}else console.warn("THREE.BufferGeometry: Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()");function N(e,t,n){d.fromArray(i,3*e),p.fromArray(i,3*t),f.fromArray(i,3*n),m.fromArray(o,2*e),g.fromArray(o,2*t),y.fromArray(o,2*n);var r=p.x-d.x,a=f.x-d.x,s=p.y-d.y,c=f.y-d.y,h=p.z-d.z,w=f.z-d.z,A=g.x-m.x,E=y.x-m.x,x=g.y-m.y,_=y.y-m.y,S=1/(A*_-E*x);v.set((_*r-x*a)*S,(_*s-x*c)*S,(_*h-x*w)*S),b.set((A*a-E*r)*S,(A*c-E*s)*S,(A*w-E*h)*S),l[e].add(v),l[t].add(v),l[n].add(v),u[e].add(b),u[t].add(b),u[n].add(b)}function L(e){C.fromArray(a,3*e),O.copy(C),M=l[e],R.copy(M),R.sub(C.multiplyScalar(C.dot(M))).normalize(),k.crossVectors(O,M),T=k.dot(u[e]),S=T<0?-1:1,c[4*e]=R.x,c[4*e+1]=R.y,c[4*e+2]=R.z,c[4*e+3]=S}},mergeBufferGeometries:function(e,t){for(var n=null!==e[0].index,r=new Set(Object.keys(e[0].attributes)),i=new Set(Object.keys(e[0].morphAttributes)),a={},o={},s=new THREE.BufferGeometry,c=0,l=0;l<e.length;++l){var u=e[l];if(n!==(null!==u.index))return null;for(var h in u.attributes){if(!r.has(h))return null;void 0===a[h]&&(a[h]=[]),a[h].push(u.attributes[h])}for(var h in u.morphAttributes){if(!i.has(h))return null;void 0===o[h]&&(o[h]=[]),o[h].push(u.morphAttributes[h])}if(s.userData.mergedUserData=s.userData.mergedUserData||[],s.userData.mergedUserData.push(u.userData),t){var d;if(n)d=u.index.count;else{if(void 0===u.attributes.position)return null;d=u.attributes.position.count}s.addGroup(c,d,l),c+=d}}if(n){var p=0,f=[];for(l=0;l<e.length;++l){var m=e[l].index;if(p>0){m=m.clone();for(var g=0;g<m.count;++g)m.setX(g,m.getX(g)+p)}f.push(m),p+=e[l].attributes.position.count}var y=this.mergeBufferAttributes(f);if(!y)return null;s.index=y}for(var h in a){var v=this.mergeBufferAttributes(a[h]);if(!v)return null;s.addAttribute(h,v)}for(var h in o){var b=o[h][0].length;if(0===b)break;s.morphAttributes=s.morphAttributes||{},s.morphAttributes[h]=[];for(l=0;l<b;++l){var w=[];for(g=0;g<o[h].length;++g)w.push(o[h][g][l]);var A=this.mergeBufferAttributes(w);if(!A)return null;s.morphAttributes[h].push(A)}}return s},mergeBufferAttributes:function(e){for(var t,n,r,i=0,a=0;a<e.length;++a){var o=e[a];if(o.isInterleavedBufferAttribute)return null;if(void 0===t&&(t=o.array.constructor),t!==o.array.constructor)return null;if(void 0===n&&(n=o.itemSize),n!==o.itemSize)return null;if(void 0===r&&(r=o.normalized),r!==o.normalized)return null;i+=o.array.length}for(var s=new t(i),c=0,l=0;l<e.length;++l)s.set(e[l].array,c),c+=e[l].array.length;return new THREE.BufferAttribute(s,n,r)},toTrianglesDrawMode:function(e,t){if(t===THREE.TrianglesDrawMode)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),e;if(t===THREE.TriangleFanDrawMode||t===THREE.TriangleStripDrawMode){var n=e.getIndex();if(null===n){var r=[],i=e.getAttribute("position");if(void 0===i)return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),e;for(var a=0;a<i.count;a++)r.push(a);e.setIndex(r),n=e.getIndex()}var o=n.count-2,s=[];if(t===THREE.TriangleFanDrawMode)for(a=1;a<=o;a++)s.push(n.getX(0)),s.push(n.getX(a)),s.push(n.getX(a+1));else for(a=0;a<o;a++)a%2==0?(s.push(n.getX(a)),s.push(n.getX(a+1)),s.push(n.getX(a+2))):(s.push(n.getX(a+2)),s.push(n.getX(a+1)),s.push(n.getX(a)));s.length/3!==o&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");var c=e.clone();return c.setIndex(s),c.clearGroups(),c}return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",t),e}}},function(e,t){if("undefined"==typeof AFRAME)throw new Error("Component attempted to register before AFRAME was available.");const n={childList:!0,attributes:!0,subtree:!0};AFRAME.registerComponent("aabb-collider",{schema:{collideNonVisible:{default:!1},debug:{default:!1},enabled:{default:!0},interval:{default:80},objects:{default:""}},init:function(){this.centerDifferenceVec3=new THREE.Vector3,this.clearedIntersectedEls=[],this.closestIntersectedEl=null,this.boundingBox=new THREE.Box3,this.boxCenter=new THREE.Vector3,this.boxHelper=new THREE.BoxHelper,this.boxMax=new THREE.Vector3,this.boxMin=new THREE.Vector3,this.hitClosestClearEventDetail={},this.hitClosestEventDetail={},this.intersectedEls=[],this.objectEls=[],this.newIntersectedEls=[],this.prevCheckTime=void 0,this.previousIntersectedEls=[],this.setDirty=this.setDirty.bind(this),this.observer=new MutationObserver(this.setDirty),this.dirty=!0,this.hitStartEventDetail={intersectedEls:this.newIntersectedEls}},play:function(){this.observer.observe(this.el.sceneEl,n),this.el.sceneEl.addEventListener("object3dset",this.setDirty),this.el.sceneEl.addEventListener("object3dremove",this.setDirty)},remove:function(){this.observer.disconnect(),this.el.sceneEl.removeEventListener("object3dset",this.setDirty),this.el.sceneEl.removeEventListener("object3dremove",this.setDirty)},tick:function(e){const t=this.boundingBox,n=this.centerDifferenceVec3,r=this.clearedIntersectedEls,i=this.el,a=this.intersectedEls,o=this.newIntersectedEls,s=this.objectEls,c=this.prevCheckTime,l=this.previousIntersectedEls;let u,h,d;if(this.data.enabled&&!(c&&e-c<this.data.interval)){for(this.prevCheckTime=e,this.dirty&&this.refreshObjects(),t.setFromObject(i.object3D),this.boxMin.copy(t.min),this.boxMax.copy(t.max),t.getCenter(this.boxCenter),this.data.debug&&(this.boxHelper.setFromObject(i.object3D),this.boxHelper.parent||i.sceneEl.object3D.add(this.boxHelper)),function(e,t){e.length=0;for(let n=0;n<t.length;n++)e[n]=t[n]}(l,a),a.length=0,d=0;d<s.length;d++)if(s[d]!==this.el)if(this.data.collideNonVisible||s[d].getAttribute("visible"))this.isIntersecting(s[d])&&a.push(s[d]);else if(this.data.debug){const e=s[d].object3D.boxHelper;e&&(i.sceneEl.object3D.remove(e),s[d].object3D.boxHelper=null)}for(o.length=0,d=0;d<a.length;d++)-1===l.indexOf(a[d])&&o.push(a[d]);for(r.length=0,d=0;d<l.length;d++)-1===a.indexOf(l[d])&&(l[d].hasAttribute("aabb-collider")||l[d].emit("hitend"),r.push(l[d]));for(d=0;d<o.length;d++)o[d]!==this.el&&(o[d].hasAttribute("aabb-collider")||o[d].emit("hitstart"));for(d=0;d<a.length;d++)a[d]!==this.el&&(n.copy(a[d].object3D.boundingBoxCenter).sub(this.boxCenter),(void 0===u||n.length()<u)&&(u=n.length(),h=a[d]));!a.length&&this.closestIntersectedEl?(this.hitClosestClearEventDetail.el=this.closestIntersectedEl,this.closestIntersectedEl.emit("hitclosestclear"),this.closestIntersectedEl=null,i.emit("hitclosestclear",this.hitClosestClearEventDetail)):h!==this.closestIntersectedEl&&(this.closestIntersectedEl&&(this.hitClosestClearEventDetail.el=this.closestIntersectedEl,this.closestIntersectedEl.emit("hitclosestclear",this.hitClosestClearEventDetail)),h&&(h.emit("hitclosest"),this.closestIntersectedEl=h,this.hitClosestEventDetail.el=h,i.emit("hitclosest",this.hitClosestEventDetail))),r.length&&i.emit("hitend"),o.length&&i.emit("hitstart",this.hitStartEventDetail)}},isIntersecting:function(){const e=new THREE.Box3;return function(t){let n;t.dataset.aabbColliderDynamic&&(e.setFromObject(t.object3D),n=e,t.object3D.boundingBoxCenter=t.object3D.boundingBoxCenter||new THREE.Vector3,n.getCenter(t.object3D.boundingBoxCenter)),t.dataset.aabbColliderDynamic||(t.object3D.aabbBox||(t.object3D.aabbBox=(new THREE.Box3).setFromObject(t.object3D),t.object3D.boundingBoxCenter=new THREE.Vector3,t.object3D.aabbBox.getCenter(t.object3D.boundingBoxCenter)),n=t.object3D.aabbBox),this.data.debug&&(t.object3D.boxHelper||(t.object3D.boxHelper=new THREE.BoxHelper(t.object3D,new THREE.Color(Math.random(),Math.random(),Math.random())),t.sceneEl.object3D.add(t.object3D.boxHelper)),t.object3D.boxHelper.setFromObject(t.object3D));const r=n.min,i=n.max;return this.boxMin.x<=i.x&&this.boxMax.x>=r.x&&this.boxMin.y<=i.y&&this.boxMax.y>=r.y&&this.boxMin.z<=i.z&&this.boxMax.z>=r.z}}(),setDirty:function(){this.dirty=!0},refreshObjects:function(){const e=this.data;this.objectEls=e.objects?this.el.sceneEl.querySelectorAll(e.objects):this.el.sceneEl.children,this.dirty=!1}})},function(e,t){var n=[new THREE.Vector2,new THREE.Vector2,new THREE.Vector2,new THREE.Vector2];function r(e,t,r,i){const a=1/i,o=1/r;return n[0].set(a*t,o*e+o),n[1].set(a*t,o*e),n[2].set(a*t+a,o*e),n[3].set(a*t+a,o*e+o),n}AFRAME.registerComponent("atlas-uvs",{dependencies:["geometry"],schema:{totalColumns:{type:"int",default:1},totalRows:{type:"int",default:1},column:{type:"int",default:1},row:{type:"int",default:1}},update:function(){const e=this.data,t=r(e.row-1,e.column-1,e.totalRows,e.totalColumns),n=this.el.getObject3D("mesh").geometry;var i=new Float32Array([t[0].x,t[0].y,t[3].x,t[3].y,t[1].x,t[1].y,t[2].x,t[2].y]);n.setAttribute("uv",new THREE.BufferAttribute(i,2)),n.uvsNeedUpdate=!0}}),AFRAME.registerComponent("dynamic-texture-atlas",{schema:{canvasId:{default:"dynamicAtlas"},canvasHeight:{default:1024},canvasWidth:{default:1024},debug:{default:!1},numColumns:{default:8},numRows:{default:8}},multiple:!0,init:function(){const e=this.canvas=document.createElement("canvas");e.id=this.data.canvasId,e.height=this.data.canvasHeight,e.width=this.data.canvasWidth,this.ctx=e.getContext("2d"),document.body.appendChild(e),this.data.debug&&(e.style.left=0,e.style.top=0,e.style.position="fixed",e.style.zIndex=9999999999)},drawTexture:function(e,t,n,i,a){const o=this.canvas,s=this.data;e.complete||(e.onload=()=>{this.drawTexture(e,t,n)});const c=a||o.height/s.numRows,l=i||o.width/s.numColumns;return this.ctx.drawImage(e,l*t,l*n,l,c),r(t,n,s.numRows,s.numColumns)}}),e.exports.getGridUvs=r},function(e,t){if("undefined"==typeof AFRAME)throw new Error("Component attempted to register before AFRAME was available.");var n={};AFRAME.registerComponent("audioanalyser",{schema:{buffer:{default:!1},beatDetectionDecay:{default:.99},beatDetectionMinVolume:{default:15},beatDetectionThrottle:{default:250},cache:{default:!1},enabled:{default:!0},enableBeatDetection:{default:!0},enableLevels:{default:!0},enableWaveform:{default:!0},enableVolume:{default:!0},fftSize:{default:2048},smoothingTimeConstant:{default:.8},src:{parse:function(e){return e.constructor!==String?e:e.startsWith("#")||e.startsWith(".")?document.querySelector(e):e}},unique:{default:!1}},init:function(){this.audioEl=null,this.levels=null,this.waveform=null,this.volume=0,this.xhr=null,this.initContext()},update:function(e){var t=this.analyser,n=this.data;e.fftSize===n.fftSize&&e.smoothingTimeConstant===n.smoothingTimeConstant||(t.fftSize=n.fftSize,t.smoothingTimeConstant=n.smoothingTimeConstant,this.levels=new Uint8Array(t.frequencyBinCount),this.waveform=new Uint8Array(t.fftSize)),n.src&&this.refreshSource()},tick:function(e,t){var n,r=this.data;if(r.enabled){if((r.enableLevels||r.enableVolume)&&this.analyser.getByteFrequencyData(this.levels),r.enableWaveform&&this.analyser.getByteTimeDomainData(this.waveform),r.enableVolume||r.enableBeatDetection){for(var i=0,a=0;a<this.levels.length;a++)i+=this.levels[a];this.volume=i/this.levels.length}r.enableBeatDetection&&(n=this.volume,this.beatCutOff||(this.beatCutOff=n),n>this.beatCutOff&&n>this.data.beatDetectionMinVolume?(this.el.emit("audioanalyserbeat",null,!1),this.beatCutOff=1.5*n,this.beatTime=0):this.beatTime<=this.data.beatDetectionThrottle?this.beatTime+=t:(this.beatCutOff*=this.data.beatDetectionDecay,this.beatCutOff=Math.max(this.beatCutOff,this.data.beatDetectionMinVolume)))}},initContext:function(){var e,t=this.data;this.context=new(window.webkitAudioContext||window.AudioContext),e=this.analyser=this.context.createAnalyser(),(this.gainNode=this.context.createGain()).connect(e),e.connect(this.context.destination),e.fftSize=t.fftSize,e.smoothingTimeConstant=t.smoothingTimeConstant,this.levels=new Uint8Array(e.frequencyBinCount),this.waveform=new Uint8Array(e.fftSize)},refreshSource:function(){this.analyser;var e=this.data;e.buffer&&e.src.constructor===String?this.getBufferSource().then(e=>{this.source=e,this.source.connect(this.gainNode)}):(this.source=this.getMediaSource(),this.source.connect(this.gainNode))},suspendContext:function(){this.context.suspend()},resumeContext:function(){this.context.resume()},fetchAudioBuffer:function(e){return n[e]?n[e].constructor===Promise?n[e]:Promise.resolve(n[e]):(this.data.cache||Object.keys(n).forEach((function(e){delete n[e]})),n[e]=new Promise(t=>{const r=this.xhr=new XMLHttpRequest;r.open("GET",e),r.responseType="arraybuffer",r.addEventListener("load",()=>{function i(r){n[e]=r,t(r)}const a=this.context.decodeAudioData(r.response,i);a&&a.constructor===Promise&&a.then(i).catch(console.error)}),r.send()}),n[e])},getBufferSource:function(){var e=this.data;return this.fetchAudioBuffer(e.src).then(()=>{var t;return(t=this.context.createBufferSource()).buffer=n[e.src],this.el.emit("audioanalyserbuffersource",t,!1),t}).catch(console.error)},getMediaSource:function(){const e={};return function(){const t=this.data.src.constructor===String?this.data.src:this.data.src.src;if(e[t])return e[t];this.data.src.constructor===String?(this.audio=document.createElement("audio"),this.audio.crossOrigin="anonymous",this.audio.setAttribute("src",this.data.src)):this.audio=this.data.src;const n=this.context.createMediaElementSource(this.audio);return e[t]=n,n}}()})},function(e,t){var n=AFRAME.utils.styleParser;if("undefined"==typeof AFRAME)throw new Error("Component attempted to register before AFRAME was available.");AFRAME.registerComponent("event-set",{schema:{default:"",parse:function(e){return n.parse(e)}},multiple:!0,init:function(){this.eventHandler=null,this.eventName=null},update:function(e){this.removeEventListener(),this.updateEventListener(),this.addEventListener()},remove:function(){this.removeEventListener()},pause:function(){this.removeEventListener()},play:function(){this.addEventListener()},updateEventListener:function(){var e,t,n,r=this.data,i=this.el;e=r._event||this.id,t=r._target,n=t?i.sceneEl.querySelector(t):i,this.eventName=e;const a=()=>{var e;for(e in r)"_event"!==e&&"_target"!==e&&AFRAME.utils.entity.setComponentProperty.call(this,n,e,r[e])};isNaN(r._delay)?this.eventHandler=a:this.eventHandler=()=>{setTimeout(a,parseFloat(r._delay))}},addEventListener:function(){this.el.addEventListener(this.eventName,this.eventHandler)},removeEventListener:function(){this.el.removeEventListener(this.eventName,this.eventHandler)}})},function(e,t,n){THREE.BufferGeometryUtils||n(47),AFRAME.registerComponent("geometry-merger",{schema:{preserveOriginal:{default:!1}},init:function(){var e=this;this.geometry=new THREE.Geometry,this.mesh=new THREE.Mesh(this.geometry),this.el.setObject3D("mesh",this.mesh),this.faceIndex={},this.vertexIndex={},this.el.object3D.traverse((function(t){"Mesh"===t.type&&t!==e.mesh&&(e.faceIndex[t.parent.uuid]=[e.geometry.faces.length,e.geometry.faces.length+t.geometry.faces.length-1],e.vertexIndex[t.parent.uuid]=[e.geometry.vertices.length,e.geometry.vertices.length+t.geometry.vertices.length-1],t.parent.updateMatrix(),e.geometry.merge(t.geometry,t.parent.matrix),e.data.preserveOriginal||t.parent.remove(t))}))}}),AFRAME.registerComponent("buffer-geometry-merger",{schema:{preserveOriginal:{default:!1}},init:function(){var e=[];this.el.sceneEl.object3D.updateMatrixWorld(),this.el.object3D.traverse((function(t){"Mesh"===t.type&&t.el!==self.el&&(t.geometry.applyMatrix(t.matrixWorld),e.push(t.geometry.clone()),t.parent.remove(t))}));const t=THREE.BufferGeometryUtils.mergeBufferGeometries(e);this.mesh=new THREE.Mesh(t),this.el.setObject3D("mesh",this.mesh)}})},function(e,t){THREE.BufferGeometryUtils={computeTangents:function(e){var t=e.index,n=e.attributes;if(null!==t&&void 0!==n.position&&void 0!==n.normal&&void 0!==n.uv){var r=t.array,i=n.position.array,a=n.normal.array,o=n.uv.array,s=i.length/3;void 0===n.tangent&&e.addAttribute("tangent",new THREE.BufferAttribute(new Float32Array(4*s),4));for(var c=n.tangent.array,l=[],u=[],h=0;h<s;h++)l[h]=new THREE.Vector3,u[h]=new THREE.Vector3;var d=new THREE.Vector3,p=new THREE.Vector3,f=new THREE.Vector3,m=new THREE.Vector2,g=new THREE.Vector2,y=new THREE.Vector2,v=new THREE.Vector3,b=new THREE.Vector3,w=e.groups;0===w.length&&(w=[{start:0,count:r.length}]);h=0;for(var A=w.length;h<A;++h)for(var E=P=(O=w[h]).start,x=P+O.count;E<x;E+=3)I(r[E+0],r[E+1],r[E+2]);var _,S,M,T=new THREE.Vector3,R=new THREE.Vector3,k=new THREE.Vector3,C=new THREE.Vector3;for(h=0,A=w.length;h<A;++h){var O,P;for(E=P=(O=w[h]).start,x=P+O.count;E<x;E+=3)N(r[E+0]),N(r[E+1]),N(r[E+2])}}else console.warn("THREE.BufferGeometry: Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()");function I(e,t,n){d.fromArray(i,3*e),p.fromArray(i,3*t),f.fromArray(i,3*n),m.fromArray(o,2*e),g.fromArray(o,2*t),y.fromArray(o,2*n);var r=p.x-d.x,a=f.x-d.x,s=p.y-d.y,c=f.y-d.y,h=p.z-d.z,w=f.z-d.z,A=g.x-m.x,E=y.x-m.x,x=g.y-m.y,_=y.y-m.y,S=1/(A*_-E*x);v.set((_*r-x*a)*S,(_*s-x*c)*S,(_*h-x*w)*S),b.set((A*a-E*r)*S,(A*c-E*s)*S,(A*w-E*h)*S),l[e].add(v),l[t].add(v),l[n].add(v),u[e].add(b),u[t].add(b),u[n].add(b)}function N(e){k.fromArray(a,3*e),C.copy(k),S=l[e],T.copy(S),T.sub(k.multiplyScalar(k.dot(S))).normalize(),R.crossVectors(C,S),M=R.dot(u[e]),_=M<0?-1:1,c[4*e]=T.x,c[4*e+1]=T.y,c[4*e+2]=T.z,c[4*e+3]=_}},mergeBufferGeometries:function(e,t){for(var n=null!==e[0].index,r=new Set(Object.keys(e[0].attributes)),i=new Set(Object.keys(e[0].morphAttributes)),a={},o={},s=new THREE.BufferGeometry,c=0,l=0;l<e.length;++l){var u=e[l];if(n!==(null!==u.index))return null;for(var h in u.attributes){if(!r.has(h))return null;void 0===a[h]&&(a[h]=[]),a[h].push(u.attributes[h])}for(var h in u.morphAttributes){if(!i.has(h))return null;void 0===o[h]&&(o[h]=[]),o[h].push(u.morphAttributes[h])}if(s.userData&&(s.userData.mergedUserData=s.userData.mergedUserData||[],s.userData.mergedUserData.push(u.userData)),t){var d;if(n)d=u.index.count;else{if(void 0===u.attributes.position)return null;d=u.attributes.position.count}s.addGroup(c,d,l),c+=d}}if(n){var p=0,f=[];for(l=0;l<e.length;++l){for(var m=e[l].index,g=0;g<m.count;++g)f.push(m.getX(g)+p);p+=e[l].attributes.position.count}s.setIndex(f)}for(var h in a){var y=this.mergeBufferAttributes(a[h]);if(!y)return null;s.addAttribute(h,y)}for(var h in o){var v=o[h][0].length;if(0===v)break;s.morphAttributes=s.morphAttributes||{},s.morphAttributes[h]=[];for(l=0;l<v;++l){var b=[];for(g=0;g<o[h].length;++g)b.push(o[h][g][l]);var w=this.mergeBufferAttributes(b);if(!w)return null;s.morphAttributes[h].push(w)}}return s},mergeBufferAttributes:function(e){for(var t,n,r,i=0,a=0;a<e.length;++a){var o=e[a];if(o.isInterleavedBufferAttribute)return null;if(void 0===t&&(t=o.array.constructor),t!==o.array.constructor)return null;if(void 0===n&&(n=o.itemSize),n!==o.itemSize)return null;if(void 0===r&&(r=o.normalized),r!==o.normalized)return null;i+=o.array.length}var s=new t(i),c=0;for(a=0;a<e.length;++a)s.set(e[a].array,c),c+=e[a].array.length;return new THREE.BufferAttribute(s,n,r)}}},function(e,t){if("undefined"==typeof AFRAME)throw new Error("Component attempted to register before AFRAME was available.");AFRAME.registerComponent("haptics",{schema:{actuatorIndex:{default:0},dur:{default:100},enabled:{default:!0},events:{type:"array"},eventsFrom:{type:"string"},force:{default:1}},multiple:!0,init:function(){this.data;var e=this;this.callPulse=function(){e.pulse()};var t=function(){e.gamepad=e.el.components["tracked-controls"].controller,e.gamepad.gamepad&&(e.gamepad=e.gamepad.gamepad),e.gamepad&&e.gamepad.hapticActuators&&e.gamepad.hapticActuators.length&&e.addEventListeners()};this.el.components["tracked-controls"]&&this.el.components["tracked-controls"].controller?t():this.el.addEventListener("controllerconnected",(function(){t()}))},remove:function(){this.removeEventListeners()},pulse:function(e,t){var n=this.data;n.enabled&&this.gamepad&&this.gamepad.hapticActuators&&this.gamepad.hapticActuators[n.actuatorIndex].pulse(e||n.force,t||n.dur)},addEventListeners:function(){var e,t,n=this.data;for(t=n.eventsFrom?document.querySelector(n.eventsFrom):this.el,e=0;e<n.events.length;e++)t.addEventListener(n.events[e],this.callPulse)},removeEventListeners:function(){var e,t,n=this.data;for(t=n.eventsFrom?document.querySelector(n.eventsFrom):this.el,e=0;e<n.events.length;e++)t.removeEventListener(n.events[e],this.callPulse)}})},function(e,t){var n=[],r=new THREE.Vector3;function i(e,t,i){var a,o,s,c,l,h,d=Math.ceil(t/e.columns);for(o=e.marginColumn,s=e.marginRow,i&&(o=e.margin,s=e.margin),l=u(e.align,d),c=u(e.align,e.columns),h=0;h<d;h++)for(a=0;a<e.columns;a++)r.set(0,0,0),0===e.plane.indexOf("x")&&(r.x=(a-c)*o),0===e.plane.indexOf("y")&&(r.y=(a-c)*o),1===e.plane.indexOf("y")&&(r.y=(h-l)*s),1===e.plane.indexOf("z")&&(r.z=(h-l)*s),f(r);return n}function a(e,t){var i,a;for(i=0;i<t;i++)a=isNaN(e.angle)?i*(2*Math.PI)/t:i*e.angle*.01745329252,r.set(0,0,0),0===e.plane.indexOf("x")&&(r.x=e.radius*Math.cos(a)),0===e.plane.indexOf("y")&&(r.y=e.radius*Math.cos(a)),1===e.plane.indexOf("y")&&(r.y=e.radius*Math.sin(a)),1===e.plane.indexOf("z")&&(r.z=e.radius*Math.sin(a)),f(r);return n}function o(e,t){return e.columns=t,i(e,t,!0)}function s(e,t){return p(1,0,0,0,1,0,0,0,1,-1,0,0,0,-1,0,0,0,-1),h(e.radius/2),n}function c(e,t){var r=(1+Math.sqrt(5))/2,i=1/r,a=2-r,o=-1*i,s=-1*a;return p(-1,a,0,-1,s,0,0,-1,a,0,-1,s,0,1,a,0,1,s,1,a,0,1,s,0,i,i,i,i,i,o,i,o,i,i,o,o,a,0,1,a,0,-1,o,i,i,o,i,o,o,o,i,o,o,o,s,0,1,s,0,-1),h(e.radius/2),n}function l(e,t){var r=Math.sqrt(3),i=-1/Math.sqrt(3);return p(0,0,r+i,-1,0,i,1,0,i,0,2*Math.sqrt(2/3),0),h(e.radius/2),n}function u(e,t){switch(e){case"start":return t-1;case"center":return(t-1)/2;case"end":return 0}}function h(e){var t;for(t=0;t<n.length;t++)n[t]=n[t]*e}function d(e,t,n){var r,i,a;if(n)for(i=0;i<e.length;i++)null!=(r=e[i].getAttribute(n))&&(a=3*parseInt(r,10),e[i].object3D.position.set(t[a],t[a+1],t[a+2]));else for(i=0;i<t.length;i+=3){if(!e[i/3])return;e[i/3].object3D.position.set(t[i],t[i+1],t[i+2])}}function p(){var e;for(e=0;e<arguments.length;e++)n.push(e)}function f(e){n.push(e.x),n.push(e.y),n.push(e.z)}AFRAME.registerComponent("layout",{schema:{angle:{type:"number",default:!1,min:0,max:360,if:{type:["circle"]}},columns:{default:1,min:0,if:{type:["box"]}},margin:{default:1,min:0,if:{type:["box","line"]}},marginColumn:{default:1,min:0,if:{type:["box"]}},marginRow:{default:1,min:0,if:{type:["box"]}},orderAttribute:{default:""},plane:{default:"xy"},radius:{default:1,min:0,if:{type:["circle","cube","dodecahedron","pyramid"]}},reverse:{default:!1},type:{default:"line",oneOf:["box","circle","cube","dodecahedron","line","pyramid"]},fill:{default:!0,if:{type:["circle"]}},align:{default:"end",oneOf:["start","center","end"]}},init:function(){var e=this,t=this.el;this.children=t.getChildEntities(),this.initialPositions=[],this.children.forEach((function(t){if(t.hasLoaded)return n();function n(){e.initialPositions.push(t.object3D.position.x),e.initialPositions.push(t.object3D.position.y),e.initialPositions.push(t.object3D.position.z)}t.addEventListener("loaded",n)})),this.handleChildAttached=this.handleChildAttached.bind(this),this.handleChildDetached=this.handleChildDetached.bind(this),t.addEventListener("child-attached",this.handleChildAttached),t.addEventListener("child-detached",this.handleChildDetached),t.addEventListener("layoutrefresh",this.update.bind(this))},update:function(e){var t,r,u,h=this.children,p=this.data,f=this.el;switch(r=h.length,p.type){case"box":u=i;break;case"circle":u=a;break;case"cube":u=s;break;case"dodecahedron":u=c;break;case"pyramid":u=l;break;default:u=o}t=f.getDOMAttribute("layout"),n.length=0,n=u(p,r,"string"==typeof t?-1!==t.indexOf("margin"):"margin"in t),p.reverse&&n.reverse(),d(h,n,p.orderAttribute)},remove:function(){this.el.removeEventListener("child-attached",this.handleChildAttached),this.el.removeEventListener("child-detached",this.handleChildDetached),d(this.children,this.initialPositions)},handleChildAttached:function(e){var t=this.el;e.detail.el.parentNode===t&&(this.children.push(e.detail.el),this.update())},handleChildDetached:function(e){-1!==this.children.indexOf(e.detail.el)&&(this.children.splice(this.children.indexOf(e.detail.el),1),this.initialPositions.splice(this.children.indexOf(e.detail.el),1),this.update())}}),e.exports.getBoxPositions=i,e.exports.getCirclePositions=a,e.exports.getLinePositions=o,e.exports.getCubePositions=s,e.exports.getDodecahedronPositions=c,e.exports.getPyramidPositions=l},function(e,t){if("undefined"==typeof AFRAME)throw new Error("Component attempted to register before AFRAME was available.");AFRAME.registerPrimitive("a-log",{defaultComponents:{geometry:{primitive:"plane",height:5},log:{},material:{color:"#111",shader:"flat",side:"double"},text:{color:"lightgreen",baseline:"top",align:"center",height:5}},mappings:{channel:"log.channel"}}),AFRAME.registerSystem("log",{schema:{console:{default:!0}},init:function(){var e=this.data,t=this.logs=[],n=this.loggers=[];AFRAME.log=function(r,i){t.push([r,i]),n.forEach((function(e){e.receiveLog(r,i)})),e.console&&console.log("[log:"+(i||"")+"] "+r)}},registerLogger:function(e){this.loggers.push(e),this.logs.forEach((function(t){e.receiveLog.apply(e,t)}))},unregisterLogger:function(e){this.loggers.splice(this.loggers.indexOf(e),1)}}),AFRAME.registerComponent("log",{schema:{channel:{type:"string"},filter:{type:"string"},max:{default:100},showErrors:{default:!0}},init:function(){this.logs=[],this.system.registerLogger(this)},play:function(){var e=this;this.el.sceneEl.addEventListener("log",(function(t){t.detail&&e.receiveLog(t.detail.message,t.detail.channel)})),window.onerror=function(t,n,r,i,a){e.receiveLog("Error: "+t)}},receiveLog:function(e,t){var n=this.data;"string"!=typeof e&&(e=JSON.stringify(e)),n.channel&&t&&n.channel!==t||n.filter&&-1===e.indexOf(n.filter)||(this.logs.push(e),n.max&&this.logs.length>n.max&&this.logs.shift(),this.el.setAttribute("text",{value:this.logs.join("\n")}))},remove:function(){this.el.removeAttribute("text"),this.system.unregisterLogger(this)}})},function(e,t,n){n(52),AFRAME.registerComponent("orbit-controls",{dependencies:["camera"],schema:{autoRotate:{type:"boolean"},autoRotateSpeed:{default:2},dampingFactor:{default:.1},enabled:{default:!0},enableDamping:{default:!0},enableKeys:{default:!0},enablePan:{default:!0},enableRotate:{default:!0},enableZoom:{default:!0},initialPosition:{type:"vec3"},keyPanSpeed:{default:7},minAzimuthAngle:{type:"number",default:1/0},maxAzimuthAngle:{type:"number",default:1/0},maxDistance:{default:1e3},maxPolarAngle:{default:AFRAME.utils.device.isMobile()?90:120},minDistance:{default:1},minPolarAngle:{default:0},minZoom:{default:0},panSpeed:{default:1},rotateSpeed:{default:.05},screenSpacePanning:{default:!1},target:{type:"vec3"},zoomSpeed:{default:.5}},init:function(){var e,t=this.el;this.controls=new THREE.OrbitControls(t.getObject3D("camera"),t.sceneEl.renderer.domElement),e=new THREE.Vector3,t.sceneEl.addEventListener("enter-vr",()=>{(AFRAME.utils.device.checkHeadsetConnected()||AFRAME.utils.device.isMobile())&&(this.controls.enabled=!1,t.hasAttribute("look-controls")&&(t.setAttribute("look-controls","enabled",!0),e.copy(t.getObject3D("camera").position),t.getObject3D("camera").position.set(0,0,0)))}),t.sceneEl.addEventListener("exit-vr",()=>{(AFRAME.utils.device.checkHeadsetConnected()||AFRAME.utils.device.isMobile())&&(this.controls.enabled=!0,t.getObject3D("camera").position.copy(e),t.hasAttribute("look-controls")&&t.setAttribute("look-controls","enabled",!1))}),document.body.style.cursor="grab",document.addEventListener("mousedown",()=>{document.body.style.cursor="grabbing"}),document.addEventListener("mouseup",()=>{document.body.style.cursor="grab"}),this.target=new THREE.Vector3,t.getObject3D("camera").position.copy(this.data.initialPosition)},update:function(e){var t=this.controls,n=this.data;t.target=this.target.copy(n.target),t.autoRotate=n.autoRotate,t.autoRotateSpeed=n.autoRotateSpeed,t.dampingFactor=n.dampingFactor,t.enabled=n.enabled,t.enableDamping=n.enableDamping,t.enableKeys=n.enableKeys,t.enablePan=n.enablePan,t.enableRotate=n.enableRotate,t.enableZoom=n.enableZoom,t.keyPanSpeed=n.keyPanSpeed,t.maxPolarAngle=THREE.Math.degToRad(n.maxPolarAngle),t.maxDistance=n.maxDistance,t.minDistance=n.minDistance,t.minPolarAngle=THREE.Math.degToRad(n.minPolarAngle),t.minZoom=n.minZoom,t.panSpeed=n.panSpeed,t.rotateSpeed=n.rotateSpeed,t.screenSpacePanning=n.screenSpacePanning,t.zoomSpeed=n.zoomSpeed},tick:function(){var e=this.controls;this.data.enabled&&e.enabled&&(e.enableDamping||e.autoRotate)&&this.controls.update()}})},function(e,t){THREE.OrbitControls=function(e,t){var n,r,i,a,o;this.object=e,this.domElement=void 0!==t?t:document,this.enabled=!0,this.target=new THREE.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.25,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.enableKeys=!0,this.keys={LEFT:37,UP:38,RIGHT:39,BOTTOM:40},this.mouseButtons={ORBIT:THREE.MOUSE.LEFT,ZOOM:THREE.MOUSE.MIDDLE,PAN:THREE.MOUSE.RIGHT},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(){s.target0.copy(s.target),s.position0.copy(s.object.position),s.zoom0=s.object.zoom},this.reset=function(){s.target.copy(s.target0),s.object.position.copy(s.position0),s.object.zoom=s.zoom0,s.object.updateProjectionMatrix(),s.dispatchEvent(c),s.update(),d=h.NONE},this.update=(n=new THREE.Vector3,r=(new THREE.Quaternion).setFromUnitVectors(e.up,new THREE.Vector3(0,1,0)),i=r.clone().inverse(),a=new THREE.Vector3,o=new THREE.Quaternion,function(){var e=s.object.position;return n.copy(e).sub(s.target),n.applyQuaternion(r),f.setFromVector3(n),s.autoRotate&&d===h.NONE&&k(2*Math.PI/60/60*s.autoRotateSpeed),f.theta+=m.theta,f.phi+=m.phi,f.theta=Math.max(s.minAzimuthAngle,Math.min(s.maxAzimuthAngle,f.theta)),f.phi=Math.max(s.minPolarAngle,Math.min(s.maxPolarAngle,f.phi)),f.makeSafe(),f.radius*=g,f.radius=Math.max(s.minDistance,Math.min(s.maxDistance,f.radius)),s.target.add(y),n.setFromSpherical(f),n.applyQuaternion(i),e.copy(s.target).add(n),s.object.lookAt(s.target),!0===s.enableDamping?(m.theta*=1-s.dampingFactor,m.phi*=1-s.dampingFactor):m.set(0,0,0),g=1,y.set(0,0,0),!!(v||a.distanceToSquared(s.object.position)>p||8*(1-o.dot(s.object.quaternion))>p)&&(s.dispatchEvent(c),a.copy(s.object.position),o.copy(s.object.quaternion),v=!1,!0)}),this.dispose=function(){s.domElement.removeEventListener("contextmenu",q,!1),s.domElement.removeEventListener("mousedown",F,!1),s.domElement.removeEventListener("wheel",B,!1),s.domElement.removeEventListener("touchstart",z,!1),s.domElement.removeEventListener("touchend",G,!1),s.domElement.removeEventListener("touchmove",H,!1),document.removeEventListener("mousemove",j,!1),document.removeEventListener("mouseup",U,!1),window.removeEventListener("keydown",V,!1)};var s=this,c={type:"change"},l={type:"start"},u={type:"end"},h={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_DOLLY:4,TOUCH_PAN:5},d=h.NONE,p=1e-6,f=new THREE.Spherical,m=new THREE.Spherical,g=1,y=new THREE.Vector3,v=!1,b=new THREE.Vector2,w=new THREE.Vector2,A=new THREE.Vector2,E=new THREE.Vector2,x=new THREE.Vector2,_=new THREE.Vector2,S=new THREE.Vector2,M=new THREE.Vector2,T=new THREE.Vector2;function R(){return Math.pow(.95,s.zoomSpeed)}function k(e){m.theta-=e}function C(e){m.phi-=e}var O,P=(O=new THREE.Vector3,function(e,t){O.setFromMatrixColumn(t,0),O.multiplyScalar(-e),y.add(O)}),I=function(){var e=new THREE.Vector3;return function(t,n){e.setFromMatrixColumn(n,1),e.multiplyScalar(t),y.add(e)}}(),N=function(){var e=new THREE.Vector3;return function(t,n){var r=s.domElement===document?s.domElement.body:s.domElement;if(s.object.isPerspectiveCamera){var i=s.object.position;e.copy(i).sub(s.target);var a=e.length();a*=Math.tan(s.object.fov/2*Math.PI/180),P(2*t*a/r.clientHeight,s.object.matrix),I(2*n*a/r.clientHeight,s.object.matrix)}else s.object.isOrthographicCamera?(P(t*(s.object.right-s.object.left)/s.object.zoom/r.clientWidth,s.object.matrix),I(n*(s.object.top-s.object.bottom)/s.object.zoom/r.clientHeight,s.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),s.enablePan=!1)}}();function L(e){s.object.isPerspectiveCamera?g/=e:s.object.isOrthographicCamera?(s.object.zoom=Math.max(s.minZoom,Math.min(s.maxZoom,s.object.zoom*e)),s.object.updateProjectionMatrix(),v=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),s.enableZoom=!1)}function D(e){s.object.isPerspectiveCamera?g*=e:s.object.isOrthographicCamera?(s.object.zoom=Math.max(s.minZoom,Math.min(s.maxZoom,s.object.zoom/e)),s.object.updateProjectionMatrix(),v=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),s.enableZoom=!1)}function F(e){if(!1!==s.enabled){switch(e.preventDefault(),e.button){case s.mouseButtons.ORBIT:if(!1===s.enableRotate)return;!function(e){b.set(e.clientX,e.clientY)}(e),d=h.ROTATE;break;case s.mouseButtons.ZOOM:if(!1===s.enableZoom)return;!function(e){S.set(e.clientX,e.clientY)}(e),d=h.DOLLY;break;case s.mouseButtons.PAN:if(!1===s.enablePan)return;!function(e){E.set(e.clientX,e.clientY)}(e),d=h.PAN}d!==h.NONE&&(document.addEventListener("mousemove",j,!1),document.addEventListener("mouseup",U,!1),s.dispatchEvent(l))}}function j(e){if(!1!==s.enabled)switch(e.preventDefault(),d){case h.ROTATE:if(!1===s.enableRotate)return;!function(e){w.set(e.clientX,e.clientY),A.subVectors(w,b);var t=s.domElement===document?s.domElement.body:s.domElement;k(2*Math.PI*A.x/t.clientWidth*s.rotateSpeed),C(2*Math.PI*A.y/t.clientHeight*s.rotateSpeed),b.copy(w),s.update()}(e);break;case h.DOLLY:if(!1===s.enableZoom)return;!function(e){M.set(e.clientX,e.clientY),T.subVectors(M,S),T.y>0?L(R()):T.y<0&&D(R()),S.copy(M),s.update()}(e);break;case h.PAN:if(!1===s.enablePan)return;!function(e){x.set(e.clientX,e.clientY),_.subVectors(x,E),N(_.x,_.y),E.copy(x),s.update()}(e)}}function U(e){!1!==s.enabled&&(document.removeEventListener("mousemove",j,!1),document.removeEventListener("mouseup",U,!1),s.dispatchEvent(u),d=h.NONE)}function B(e){!1===s.enabled||!1===s.enableZoom||d!==h.NONE&&d!==h.ROTATE||(e.preventDefault(),e.stopPropagation(),s.dispatchEvent(l),function(e){e.deltaY<0?D(R()):e.deltaY>0&&L(R()),s.update()}(e),s.dispatchEvent(u))}function V(e){!1!==s.enabled&&!1!==s.enableKeys&&!1!==s.enablePan&&function(e){switch(e.keyCode){case s.keys.UP:N(0,s.keyPanSpeed),s.update();break;case s.keys.BOTTOM:N(0,-s.keyPanSpeed),s.update();break;case s.keys.LEFT:N(s.keyPanSpeed,0),s.update();break;case s.keys.RIGHT:N(-s.keyPanSpeed,0),s.update()}}(e)}function z(e){if(!1!==s.enabled){switch(e.touches.length){case 1:if(!1===s.enableRotate)return;!function(e){b.set(e.touches[0].pageX,e.touches[0].pageY)}(e),d=h.TOUCH_ROTATE;break;case 2:if(!1===s.enableZoom)return;!function(e){var t=e.touches[0].pageX-e.touches[1].pageX,n=e.touches[0].pageY-e.touches[1].pageY,r=Math.sqrt(t*t+n*n);S.set(0,r)}(e),d=h.TOUCH_DOLLY;break;case 3:if(!1===s.enablePan)return;!function(e){E.set(e.touches[0].pageX,e.touches[0].pageY)}(e),d=h.TOUCH_PAN;break;default:d=h.NONE}d!==h.NONE&&s.dispatchEvent(l)}}function H(e){if(!1!==s.enabled)switch(e.preventDefault(),e.stopPropagation(),e.touches.length){case 1:if(!1===s.enableRotate)return;if(d!==h.TOUCH_ROTATE)return;!function(e){w.set(e.touches[0].pageX,e.touches[0].pageY),A.subVectors(w,b);var t=s.domElement===document?s.domElement.body:s.domElement;k(2*Math.PI*A.x/t.clientWidth*s.rotateSpeed),C(2*Math.PI*A.y/t.clientHeight*s.rotateSpeed),b.copy(w),s.update()}(e);break;case 2:if(!1===s.enableZoom)return;if(d!==h.TOUCH_DOLLY)return;!function(e){var t=e.touches[0].pageX-e.touches[1].pageX,n=e.touches[0].pageY-e.touches[1].pageY,r=Math.sqrt(t*t+n*n);M.set(0,r),T.subVectors(M,S),T.y>0?D(R()):T.y<0&&L(R()),S.copy(M),s.update()}(e);break;case 3:if(!1===s.enablePan)return;if(d!==h.TOUCH_PAN)return;!function(e){x.set(e.touches[0].pageX,e.touches[0].pageY),_.subVectors(x,E),N(_.x,_.y),E.copy(x),s.update()}(e);break;default:d=h.NONE}}function G(e){!1!==s.enabled&&(s.dispatchEvent(u),d=h.NONE)}function q(e){!1!==s.enabled&&e.preventDefault()}s.domElement.addEventListener("contextmenu",q,!1),s.domElement.addEventListener("mousedown",F,!1),s.domElement.addEventListener("wheel",B,!1),s.domElement.addEventListener("touchstart",z,!1),s.domElement.addEventListener("touchend",G,!1),s.domElement.addEventListener("touchmove",H,!1),window.addEventListener("keydown",V,!1),this.update()},THREE.OrbitControls.prototype=Object.create(THREE.EventDispatcher.prototype),THREE.OrbitControls.prototype.constructor=THREE.OrbitControls,Object.defineProperties(THREE.OrbitControls.prototype,{center:{get:function(){return console.warn("THREE.OrbitControls: .center has been renamed to .target"),this.target}},noZoom:{get:function(){return console.warn("THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),!this.enableZoom},set:function(e){console.warn("THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),this.enableZoom=!e}},noRotate:{get:function(){return console.warn("THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),!this.enableRotate},set:function(e){console.warn("THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),this.enableRotate=!e}},noPan:{get:function(){return console.warn("THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead."),!this.enablePan},set:function(e){console.warn("THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead."),this.enablePan=!e}},noKeys:{get:function(){return console.warn("THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),!this.enableKeys},set:function(e){console.warn("THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),this.enableKeys=!e}},staticMoving:{get:function(){return console.warn("THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),!this.enableDamping},set:function(e){console.warn("THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),this.enableDamping=!e}},dynamicDampingFactor:{get:function(){return console.warn("THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.dampingFactor},set:function(e){console.warn("THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.dampingFactor=e}}})},function(e,t){AFRAME.registerComponent("proxy-event",{schema:{captureBubbles:{default:!1},enabled:{default:!0},event:{type:"string"},from:{type:"string"},to:{type:"string"},as:{type:"string"},bubbles:{default:!1}},multiple:!0,init:function(){var e,t,n,r=this.data,i=this.el,a=this;if(r.from?e="PARENT"===r.from?[i.parentNode]:document.querySelectorAll(r.from):n="CHILDREN"===r.to?i.querySelectorAll("*"):"SELF"===r.to?[i]:document.querySelectorAll(r.to),r.from)for(t=0;t<e.length;t++)this.addEventListenerFrom(e[t]);else i.addEventListener(r.event,(function(e){var r=a.data;if(r.enabled&&(r.captureBubbles||e.target===i))for(t=0;t<n.length;t++)n[t].emit(r.as||r.event,e.detail?e.detail:null,r.bubbles)}))},addEventListenerFrom:function(e){var t=this.data,n=this;e.addEventListener(t.event,(function(t){var r=n.data;r.enabled&&(r.captureBubbles||t.target===e)&&n.el.emit(r.as||r.event,t.detail?t.detail:null,!1)}))}})},function(e,t){AFRAME.registerSystem("render-order",{schema:{type:"array"},init:function(){this.el.renderer.sortObjects=!0},update:function(){for(this.order={},i=0;i<this.data.length;i++)this.order[this.data[i]]=i}}),AFRAME.registerComponent("render-order",{schema:{type:"string"},multiple:!0,init:function(){this.set=this.set.bind(this),this.el.addEventListener("object3dset",e=>{"nonrecursive"!==this.id&&e.detail.object.traverse(this.set)})},update:function(){"nonrecursive"===this.id?this.set(this.el.object3D):this.el.object3D.traverse(this.set)},set:function(e){isNaN(this.data)?e.renderOrder=this.system.order[this.data]:e.renderOrder=parseFloat(this.data)}}),AFRAME.registerComponent("render-order-recursive",{init:function(){this.el.addEventListener("child-attached",e=>{e.detail.el.setAttribute("render-order",this.el.getAttribute("render-order"))})}})},function(e,t,n){var r;"undefined"!=typeof self&&self,r=function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([function(e,t,n){"use strict";var r={};e.exports.select=function(e,t,n){return r[t]||(r[t]=new Function("state","item","return "+c(t)+";")),r[t](e,n)};var i=/\.([A-Za-z][\w_-]*)/g,a=/([=&|!?:+-])(\s*)([\(]?)([A-Za-z][\w_-]*)/g,o=/^([\(]?)([A-Za-z][\w_-]*)/g,s=/state\["item"\]/g;function c(e){return e=(e=(e=(e=e.replace(i,'["$1"]')).replace(o,'$1state["$2"]')).replace(a,'$1$2$3state["$4"]')).replace(s,"item")}function l(){var e=arguments;return function(){var t;for(t=0;t<e.length;t++)e[t].apply(this,arguments)}}e.exports.generateExpression=c,e.exports.clearObject=function(e){for(var t in e)delete e[t]},e.exports.composeHandlers=function(){var e,t,n,r=arguments;for(n={},t=0;t<r.length;t++)for(e in r[t])e in n?n[e].constructor===Array?n[e].push(r[t][e]):n[e]=[n[e],r[t][e]]:n[e]=r[t][e];for(e in n)n[e].constructor===Array&&(n[e]=l.apply(this,n[e]));return n},e.exports.composeFunctions=l;var u=["||","&&","!=","!==","==","===",">","<","<=",">="],h=/\s+/,d=/\(|\)|\!/g;function p(e){return-1===(e=function(e){return 0===e.indexOf("!!")?e.replace("!!",""):0===e.indexOf("!")?e.replace("!",""):e}(e.trim())).indexOf(".")?e:e.substring(0,e.indexOf("."))}e.exports.parseKeysToWatch=function(e,t,n){var r,i;for(i=m(t,h),r=0;r<i.length;r++)if(-1===u.indexOf(i[r])&&!i[r].startsWith("'")&&-1===e.indexOf(i[r])){if(n&&"item"===i[r])continue;e.push(p(i[r]).replace(d,""))}return e};var f={};function m(e,t){return f[t]||(f[t]={}),f[t][e]||(f[t][e]=e.split(t)),f[t][e]}e.exports.split=m,e.exports.copyArray=function(e,t){var n;for(e.length=0,n=0;n<t.length;n++)e[n]=t[n]}},function(e,t,n){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};n(2);var i,a,o=n(3),s=n(0),c=n(4).wrapArray,l={initialState:{},nonBindedStateKeys:[],handlers:{},computeState:function(){}};AFRAME.registerState=function(e){AFRAME.utils.extend(l,e)},AFRAME.registerSystem("state",{init:function(){var e,t=this;for(e in this.arrays=[],this.dirtyArrays=[],this.diff={},this.state=AFRAME.utils.clone(l.initialState),this.subscriptions=[],this.initEventHandlers(),this.state)this.state[e]&&this.state[e].constructor===Array&&(this.arrays.push(e),this.state[e].__dirty=!0,c(this.state[e]));this.lastState=AFRAME.utils.clone(this.state),this.eventDetail={lastState:this.lastState,state:this.state},this.el.addEventListener("loaded",(function(){var e;for(l.computeState(t.state,"@@INIT"),e=0;e<t.subscriptions.length;e++)t.subscriptions[e].onStateUpdate(t.state)}))},dispatch:(a=[],function(e,t){var n,r;for(r in l.handlers[e](this.state,t),l.computeState(this.state,e,t),this.diff)delete this.diff[r];for(o(this.lastState,this.state,this.diff,l.nonBindedStateKeys),this.dirtyArrays.length=0,n=0;n<this.arrays.length;n++)this.state[this.arrays[n]].__dirty&&this.dirtyArrays.push(this.arrays[n]);for(a.length=0,n=0;n<this.subscriptions.length;n++){if("bind-for"===this.subscriptions[n].name){if(!this.state[this.subscriptions[n].keysToWatch[0]].__dirty)continue}else if(!this.shouldUpdate(this.subscriptions[n].keysToWatch,this.diff,this.dirtyArrays))continue;-1===a.indexOf(this.subscriptions[n])&&a.push(this.subscriptions[n])}for(n=0;n<a.length;n++)a[n].onStateUpdate();for(r in this.state)this.state[r]&&this.state[r].constructor===Array&&(this.state[r].__dirty=!1);this.copyState(this.lastState,this.state),this.eventDetail.action=e,this.eventDetail.payload=t,this.el.emit("stateupdate",this.eventDetail)}),copyState:function(e,t,n){var r;for(r in t)if(n||-1===l.nonBindedStateKeys.indexOf(r))if(t[r]&&t[r].constructor===Object){if(!(r in e)){e[r]=AFRAME.utils.clone(t[r]);continue}this.copyState(e[r],t[r],!0)}else e[r]=t[r]},subscribe:function(e){this.subscriptions.push(e)},unsubscribe:function(e){this.subscriptions.splice(this.subscriptions.indexOf(e),1)},shouldUpdate:function(e,t,n){for(var r=0;r<e.length;r++)if(e[r]in t||-1!==n.indexOf(e[r]))return!0;return!1},initEventHandlers:function(){var e,t=[];for(e in n=n.bind(this),l.handlers)-1===t.indexOf(e)&&(t.push(e),n(e));function n(e){var t=this;this.el.addEventListener(e,(function(n){t.dispatch(e,n.detail)}))}},renderTemplate:(i=/{{\s*(\w*\.)?([\w.]+)\s*}}/g,function(e,t,n){var a,o;if(o=e,t)for(;a=i.exec(e);)o=o.replace(a[0],"object"===(void 0===t?"undefined":r(t))?s.select(t,a[2])||"":t);return n?o:document.createRange().createContextualFragment(o)}),select:s.select}),AFRAME.registerComponent("bind",{schema:{default:{},parse:function(e){var t,n,r,i;if(e.constructor===Object)return e;if(-1===e.indexOf(":"))return e;for(t={},r=s.split(e,";"),n=0;n<r.length;n++)t[(i=s.split(r[n].trim(),":"))[0]]=i[1].trim();return t}},multiple:!0,init:function(){var e;this.data,this.keysToWatch=[],this.onStateUpdate=this.onStateUpdate.bind(this),this.system=this.el.sceneEl.systems.state,this.id&&(e=s.split(this.id,"__")[0]),this.isNamespacedBind=this.id&&e in AFRAME.components&&!AFRAME.components[e].isSingleProp||e in AFRAME.systems,this.lastData={},this.updateObj={},this.system.subscribe(this),this.onStateUpdate=this.onStateUpdate.bind(this)},update:function(){var e,t=this.data;if(this.keysToWatch.length=0,"string"==typeof t)s.parseKeysToWatch(this.keysToWatch,t);else for(e in t)s.parseKeysToWatch(this.keysToWatch,t[e]);this.onStateUpdate()},onStateUpdate:function(){var e,t,n,i,a=!1,o=this.el;if(o.parentNode){if(this.isNamespacedBind&&s.clearObject(this.updateObj),n=this.system.state,"object"!==r(this.data)){try{i=s.select(n,this.data)}catch(e){throw new Error("[aframe-state-component] Key '"+this.data+"' not found in state. #"+this.el.getAttribute("id")+"["+this.attrName+"]")}if("object"!==(void 0===i?"undefined":r(i))&&"object"!==r(this.lastData)&&this.lastData===i)return;return AFRAME.utils.entity.setComponentProperty(o,this.id,i),void(this.lastData=i)}for(e in this.data){t=this.data[e].trim();try{i=s.select(n,t)}catch(e){throw console.log(e),new Error("[aframe-state-component] Key '"+t+"' not found in state. #"+this.el.getAttribute("id")+"["+this.attrName+"]")}if("object"===(void 0===i?"undefined":r(i))||"object"===r(this.lastData[e])||this.lastData[e]!==i){if(e in AFRAME.components&&void 0===i)return void o.removeAttribute(e);this.isNamespacedBind?this.updateObj[e]=i:AFRAME.utils.entity.setComponentProperty(o,e,i),this.lastData[e]=i}}for(a in this.updateObj);this.isNamespacedBind&&a&&o.setAttribute(this.id,this.updateObj)}},remove:function(){this.system.unsubscribe(this)}}),AFRAME.registerComponent("bind-toggle",{schema:{type:"string"},multiple:!0,init:function(){this.system=this.el.sceneEl.systems.state,this.keysToWatch=[],this.onStateUpdate=this.onStateUpdate.bind(this),this.system.subscribe(this),this.onStateUpdate()},update:function(){this.keysToWatch.length=0,s.parseKeysToWatch(this.keysToWatch,this.data)},onStateUpdate:function(){var e,t,n=this.el;e=this.system.state;try{t=s.select(e,this.data)}catch(e){throw new Error("[aframe-state-component] Key '"+this.data+"' not found in state. #"+this.el.getAttribute("id")+"["+this.attrName+"]")}t?n.setAttribute(this.id,""):n.removeAttribute(this.id)},remove:function(){this.system.unsubscribe(this)}}),e.exports={composeFunctions:s.composeFunctions,composeHandlers:s.composeHandlers,select:s.select}},function(e,t,n){"use strict";var r,i,a=n(0);AFRAME.registerComponent("bind-for",{schema:{delay:{default:0},for:{type:"string",default:"item"},in:{type:"string"},key:{type:"string"},pool:{default:0},template:{type:"string"},updateInPlace:{default:!1}},init:function(){this.system=this.el.sceneEl.systems.state,this.onStateUpdate=this.onStateUpdate.bind(this),this.keysToWatch=[],this.renderedKeys=[],this.system.subscribe(this),this.el.children[0]&&"TEMPLATE"===this.el.children[0].tagName?this.template=this.el.children[0].innerHTML.trim():this.template=document.querySelector(this.data.template).innerHTML.trim();for(var e=0;e<this.data.pool;e++)this.el.appendChild(this.generateFromTemplate(null,e))},update:function(){this.keysToWatch[0]=a.split(this.data.in,".")[0],this.onStateUpdate()},onStateUpdateNaive:(i=[],function(){var e,t=this.data,n=this.el;try{e=a.select(this.system.state,t.in)}catch(e){throw new Error("[aframe-state-component] Key '"+t.in+"' not found in state. #"+n.getAttribute("id")+"["+this.attrName+"]")}i.length=0;for(var r=0;r<e.length;r++){var o=e[r];i.push(t.key?o[t.key].toString():o.toString())}for(var s=this.getElsToRemove(i,this.renderedKeys),c=0;c<s.length;c++)s[c].parentNode.removeChild(s[c]);e.length&&this.renderItems(e,i,0)}),renderItems:function(e,t,n){var r,i=this,a=this.data,o=this.el,s=e[n],c=a.key?s[a.key].toString():s.toString();if(-1===this.renderedKeys.indexOf(c))r=this.generateFromTemplate(s,n),o.appendChild(r),this.renderedKeys.push(c);else{if(e.length&&e[0].constructor===String){var l=a.key?s[a.key].toString():s.toString();(r=o.querySelector('[data-bind-for-value="'+l+'"]')).setAttribute("data-bind-for-key",n)}else{var u=this.getBindForKey(s,n);r=o.querySelector('[data-bind-for-key="'+u+'"]')}r.emit("bindforupdate",s,!1)}e[n+1]&&(this.data.delay?setTimeout((function(){i.renderItems(e,t,n+1)}),this.data.delay):this.renderItems(e,t,n+1))},onStateUpdateInPlace:function(){var e=[];return function(){var t,n,r=this.data,i=this.el;try{t=a.select(this.system.state,r.in)}catch(e){throw console.log(e),new Error("[aframe-state-component] Key '"+r.in+"' not found in state. #"+i.getAttribute("id")+"["+this.attrName+"]")}e.length=0;for(var o=0;o<t.length;o++){var s=t[o];n=r.key?s[r.key].toString():s.toString(),e.push(n)}for(var c=this.getElsToRemove(e,this.renderedKeys),l=0;l<c.length;l++)c[l].object3D.visible=!1,c[l].setAttribute("data-bind-for-active","false"),c[l].removeAttribute("data-bind-for-key"),c[l].removeAttribute("data-bind-for-value"),c[l].emit("bindfordeactivate",null,!1),c[l].pause();t.length&&this.renderItemsInPlace(t,e,0)}}(),renderItemsInPlace:function(e,t,n){var r,i=this,a=this.data,o=this.el,s=e[n],c=this.getBindForKey(s,n),l=a.key?s[a.key].toString():s.toString();if(-1===this.renderedKeys.indexOf(l)){if(o.querySelector(':scope > [data-bind-for-active="false"]'))(r=o.querySelector('[data-bind-for-active="false"]')).setAttribute("data-bind-for-key",c),r.setAttribute("data-bind-for-value",l),r.object3D.visible=!0,r.play(),r.setAttribute("data-bind-for-active","true"),r.emit("bindforupdateinplace",s,!1);else{var u=this.generateFromTemplate(s,n);u.addEventListener("loaded",(function(){u.emit("bindforupdateinplace",s,!1)})),o.appendChild(u)}this.renderedKeys.push(l)}else-1!==t.indexOf(l)&&(e.length&&e[0].constructor===String?(r=o.querySelector('[data-bind-for-value="'+l+'"]')).setAttribute("data-bind-for-key",n):r=o.querySelector('[data-bind-for-key="'+c+'"]'),r.emit("bindforupdateinplace",s,!1));e[n+1]&&(this.data.delay?setTimeout((function(){i.renderItemsInPlace(e,t,n+1)}),this.data.delay):this.renderItemsInPlace(e,t,n+1))},generateFromTemplate:function(e,t){var n=this.data;this.el.appendChild(this.system.renderTemplate(this.template,e));var r=this.el.children[this.el.children.length-1];if(!e)return r.setAttribute("data-bind-for-key",""),r.setAttribute("data-bind-for-active","false"),r;var i=this.getBindForKey(e,t);return r.setAttribute("data-bind-for-key",i),n.key||r.setAttribute("data-bind-for-value",e),r.setAttribute("data-bind-for-active","true"),r},getElsToRemove:(r=[],function(e,t){var n=this.data,i=this.el;r.length=0;for(var a=0;a<i.children.length;a++)if("TEMPLATE"!==i.children[a].tagName){var o=n.key?i.children[a].getAttribute("data-bind-for-key"):i.children[a].getAttribute("data-bind-for-value");-1===e.indexOf(o)&&-1!==t.indexOf(o)&&(r.push(i.children[a]),t.splice(t.indexOf(o),1))}return r}),getBindForKey:function(e,t){return this.data.key?e[this.data.key].toString():t.toString()},onStateUpdate:function(){this.data.updateInPlace?this.onStateUpdateInPlace():this.onStateUpdateNaive()}}),AFRAME.registerComponent("bind-item",{schema:{type:"string"},multiple:!0,init:function(){this.itemData=null,this.keysToWatch=[],this.prevValues={};var e=this.rootEl=this.el.closest("[data-bind-for-key]");if(!e)throw new Error("bind-item component must be attached to entity under a bind-for item.");e.addEventListener("bindforupdateinplace",this.updateInPlace.bind(this)),e.addEventListener("bindfordeactivate",this.deactivate.bind(this)),this.el.sceneEl.systems.state.subscribe(this)},update:function(){this.parseSelector()},updateInPlace:function(e){var t=this.propertyMap;if("false"!==this.rootEl.getAttribute("data-bind-for-active"))for(var n in e&&(this.itemData=e.detail),t){var r=this.select(this.itemData,t[n]);r!==this.prevValues[n]&&(AFRAME.utils.entity.setComponentProperty(this.el,n,r),this.prevValues[n]=r)}},onStateUpdate:function(){this.updateInPlace()},select:function(e,t){return a.select(this.el.sceneEl.systems.state.state,t,e)},deactivate:function(){this.prevValues={}},parseSelector:function(){var e=this.propertyMap={};this.keysToWatch.length=0;var t=a.split(this.id,"__")[0];if(!(t in AFRAME.components)||AFRAME.components[t].isSingleProp)e[this.id]=this.data,a.parseKeysToWatch(this.keysToWatch,this.data,!0);else for(var n=a.split(this.data,";"),r=0;r<n.length;r++){var i=a.split(n[r],":");e[this.id+"."+i[0].trim()]=i[1].trim(),a.parseKeysToWatch(this.keysToWatch,i[1].trim(),!0)}}})},function(e,t,n){"use strict";var r;e.exports=(r=[],function(e,t,n,i){var a,o,s,c,l,u,h;for(l in c=n||{},r.length=0,e)r.push(l);if(!t)return c;for(s in t)-1===r.indexOf(s)&&r.push(s);for(u=0;u<r.length;u++)l=r[u],i&&-1!==i.indexOf(l)||(a=e[l],o=t[l],((h=a&&o&&a.constructor===Object&&o.constructor===Object)&&!AFRAME.utils.deepEqual(a,o)||!h&&a!==o)&&(c[l]=o));return c})},function(e,t,n){"use strict";var r=["push","pop","shift","unshift","splice"];function i(e,t){var n=e[t];e[t]=function(){n.apply(e,arguments),e.__dirty=!0}}e.exports.wrapArray=function(e){var t;if(!e.__wrapped){for(t=0;t<r.length;t++)i(e,r[t]);e.__wrapped=!0}}}])},e.exports=r()},function(e,t){if("undefined"==typeof AFRAME)throw new Error("Component attempted to register before AFRAME was available.");AFRAME.registerComponent("slice9",{schema:{width:{default:1,min:0},height:{default:1,min:0},left:{default:0,min:0},right:{default:0,min:0},bottom:{default:0,min:0},top:{default:0,min:0},side:{default:"front",oneOf:["front","back","double"]},padding:{default:.1,min:.01},color:{type:"color",default:"#fff"},opacity:{default:1,min:0,max:1},transparent:{default:!0},debug:{default:!1},src:{type:"map"}},multiple:!1,init:function(){var e=this.data,t=this.material=new THREE.MeshBasicMaterial({color:e.color,opacity:e.opacity,transparent:e.transparent,wireframe:e.debug}),n=this.geometry=new THREE.PlaneBufferGeometry(e.width,e.height,3,3);new THREE.TextureLoader;this.plane=new THREE.Mesh(n,t),this.el.setObject3D("mesh",this.plane),this.textureSrc=null},updateMap:function(){var e=this.data.src;if(e){if(e===this.textureSrc)return;return this.textureSrc=e,void this.el.sceneEl.systems.material.loadTexture(e,{src:e},t.bind(this))}function t(e){this.material.map=e,this.material.needsUpdate=!0,this.regenerateMesh()}this.material.map&&t(null)},regenerateMesh:function(){var e=this.data,t=this.geometry.attributes.position.array,n=this.geometry.attributes.uv.array,r=this.material.map.image;if(r){var i={left:e.left/r.width,right:e.right/r.width,top:e.top/r.height,bottom:e.bottom/r.height};d(1,i.left,1),d(2,i.right,1),d(4,0,i.bottom),d(5,i.left,i.bottom),d(6,i.right,i.bottom),d(7,1,i.bottom),d(8,0,i.top),d(9,i.left,i.top),d(10,i.right,i.top),d(11,1,i.top),d(13,i.left,0),d(14,i.right,0);var a=e.width/2,o=e.height/2,s=-a+e.padding,c=a-e.padding,l=o-e.padding,u=-o+e.padding;h(0,-a,o),h(1,s,o),h(2,c,o),h(3,a,o),h(4,-a,l),h(5,s,l),h(6,c,l),h(7,a,l),h(8,-a,u),h(9,s,u),h(10,c,u),h(11,a,u),h(13,s,-o),h(14,c,-o),h(12,-a,-o),h(15,a,-o),this.geometry.attributes.position.needsUpdate=!0,this.geometry.attributes.uv.needsUpdate=!0}function h(e,n,r){t[3*e]=n,t[3*e+1]=r}function d(e,t,r){n[2*e]=t,n[2*e+1]=r}},update:function(e){var t=this.data;this.material.color.setStyle(t.color),this.material.opacity=t.opacity,this.material.transparent=t.transparent,this.material.wireframe=t.debug,this.material.side=function(e){switch(e){case"back":return THREE.BackSide;case"double":return THREE.DoubleSide;default:return THREE.FrontSide}}(t.side);var n=AFRAME.utils.diff(t,e);"src"in n?this.updateMap():("width"in n||"height"in n||"padding"in n||"left"in n||"top"in n||"bottom"in n||"right"in n)&&this.regenerateMesh()},remove:function(){},pause:function(){},play:function(){}})},function(e,t){var n=[0,90,180,270],r=["right","up","left","down"],i={NULL:{START:"thumbstart",END:"thumbend"}};r.forEach(e=>{i[e]={},i[e].START="thumb"+e+"start",i[e].END="thumb"+e+"end"});AFRAME.registerComponent("thumb-controls",{schema:{thresholdAngle:{default:89.5},thresholdPad:{default:.05},thresholdStick:{default:.75}},init:function(){var e=this.el;this.onTrackpadDown=this.onTrackpadDown.bind(this),this.onTrackpadUp=this.onTrackpadUp.bind(this),this.directionStick="",this.directionTrackpad="",e.components["tracked-controls"]&&(this.axis=e.components["tracked-controls"].axis),this.type="STICK",e.addEventListener("controllerconnected",t=>{this.axis=e.components["tracked-controls"].axis,"oculus-touch-controls"!==t.detail.name&&"windows-motion-controls"!==t.detail.name?this.type="PAD":this.type="STICK"})},play:function(){var e=this.el;e.addEventListener("trackpaddown",this.onTrackpadDown),e.addEventListener("trackpadup",this.onTrackpadUp),e.addEventListener("touchpaddown",this.onTrackpadDown),e.addEventListener("touchpadup",this.onTrackpadUp)},pause:function(){var e=this.el;e.removeEventListener("trackpaddown",this.onTrackpadDown),e.removeEventListener("trackpadup",this.onTrackpadUp),e.removeEventListener("touchpaddown",this.onTrackpadDown),e.removeEventListener("touchpadup",this.onTrackpadUp)},onTrackpadDown:function(){var e,t=this.el;this.getDistance()<this.data.thresholdPad||(e=this.getDirection())&&(this.directionTrackpad=e,t.emit(i.NULL.START,null,!1),t.emit(i[this.directionTrackpad].START,null,!1))},onTrackpadUp:function(){var e=this.el;this.directionTrackpad&&(e.emit(i.NULL.END,null,!1),e.emit(i[this.directionTrackpad].END,null,!1),this.directionTrackpad="")},tick:function(){var e,t=this.el;if("PAD"!==this.type){if(!this.directionStick&&this.getDistance()>this.data.thresholdStick){if(!(e=this.getDirection()))return;return this.directionStick=e,t.emit(i.NULL.START,null,!1),void t.emit(i[this.directionStick].START,null,!1)}this.directionStick&&this.getDistance()<this.data.thresholdStick&&(t.emit(i.NULL.END,null,!1),t.emit(i[this.directionStick].END,null,!1),this.directionStick="")}},getDistance:function(){var e=this.axis;return this.axis?"PAD"===this.type?Math.sqrt(e[1]*e[1]+e[0]*e[0]):Math.sqrt(e[3]*e[3]+e[2]*e[2]):0},getDirection:function(){var e,t,i,a,o;for(e=this.getAngle(),a=this.data.thresholdAngle/2,i=0;i<n.length;i++){if((o=n[i]+a)>360&&(o-=360),(t=n[i]-a)<0&&(e>=360+t&&e<=360||e>=0&&e<=o))return r[i];if(e>=t&&e<=o)return r[i]}},getAngle:function(){var e,t=this.axis;return this.axis?((e="PAD"===this.type?Math.atan2(-t[1],t[0]):Math.atan2(-t[3],t[2]))<0&&(e=2*Math.PI+e),THREE.Math.radToDeg(e)):0}}),AFRAME.registerComponent("thumb-controls-debug",{dependencies:["thumb-controls"],schema:{controllerType:{type:"string"},hand:{type:"string"},enabled:{default:!1}},init:function(){var e,t,n,r,i=this.el;if(this.data.enabled||AFRAME.utils.getUrlParameter("debug-thumb")){console.log("%c debug-thumb","background: #111; color: red");var a=function(){i.components["tracked-controls"].handleAxes=()=>{},n={axis:t=[0,0,0]},i.components["tracked-controls"].axis=t,i.components["thumb-controls"].axis=t};i.components["tracked-controls"]?a():this.el.addEventListener("controllerconnected",(function(){a()})),(r=this.createCanvas()).addEventListener("click",r=>{"vive-controls"===this.data.controllerType?e?i.emit("trackpadup"):i.emit("trackpaddown"):e&&(t[0]=0,t[1]=0,i.emit("axismove",n,!1)),e=!e}),r.addEventListener("mousemove",a=>{var o;e&&(o=r.getBoundingClientRect(),t[0]=(a.clientX-o.left)/240*2-1,t[1]=(a.clientY-o.top)/240*2-1,i.emit("axismove",n,!1))}),r.addEventListener("mouseleave",r=>{e&&(t[0]=0,t[1]=0,i.emit("axismove",n,!1))})}},createCanvas:function(){var e,t;return(e=document.createElement("canvas")).classList.add("debugThumb"),e.height=240,e.width=240,e.style.bottom=0,e.style.borderRadius="250px",e.style.opacity=.5,e.style.position="fixed",e.style.zIndex=999999999,"left"===this.data.hand?e.style.left=0:e.style.right=0,(t=e.getContext("2d")).fillStyle="#333",t.fillRect(0,0,240,240),document.body.appendChild(e),e}})},function(e,t,n){var r={"./active-item.js":59,"./agent-dance.js":60,"./agent-picker.js":61,"./beat-cut-fx.js":62,"./beat-generator.js":15,"./beat-hit-sound.js":63,"./beat.js":21,"./blade.js":64,"./check-vr.js":65,"./console-shortcuts.js":66,"./controller.js":67,"./copy-texture.js":68,"./cursor-laser.js":69,"./cursor-mesh.js":70,"./curve-follow-rig-reset.js":71,"./cutfx-shader.js":72,"./debug-beat-generator.js":75,"./debug-beat-positioning.js":76,"./debug-controller.js":77,"./debug-cursor.js":78,"./debug-intro.js":79,"./debug-song-time.js":80,"./debug-state.js":81,"./delayed-proxy-event.js":82,"./difficulty-background.js":83,"./difficulty-filter.js":84,"./difficulty-text.js":85,"./follow-position.js":86,"./follow-z.js":87,"./gameover.js":88,"./gpu-preloader.js":89,"./gradient-shader.js":90,"./hand-swapper.js":92,"./handstar-shader.js":93,"./haptics-wall.js":96,"./haptics-weapon.js":97,"./headfist.js":98,"./history.js":99,"./intro-song.js":100,"./keyboard-raycastable.js":101,"./leaderboard.js":102,"./materials.js":109,"./menu-controls.js":124,"./menu-difficulty-select.js":125,"./menu-genre.js":126,"./menu-midsection.js":127,"./menu-mode.js":128,"./menu-playlist-button.js":129,"./menu-playlist.js":130,"./menu-selected-challenge-image.js":131,"./menu-slide-animation.js":132,"./multiplier-ring.js":133,"./no-frustum-cull.js":134,"./panel-shader.js":135,"./pause.js":138,"./pauser.js":139,"./play-sound.js":140,"./player-height.js":142,"./plume.js":143,"./punch.js":144,"./raycaster-target.js":145,"./recenter.js":146,"./ring.js":147,"./score-texts.js":150,"./search-thumbnail-atlas.js":151,"./search.js":152,"./song-info-positioner.js":155,"./song-preview.js":156,"./song-progress-info.js":157,"./song.js":158,"./stage-colors.js":159,"./stage-lasers.js":160,"./stars.js":161,"./stats-param.js":162,"./stepback.js":163,"./sub-object.js":164,"./super-keyboard.js":165,"./supercurve-color.js":166,"./supercurve-shader.js":167,"./supercurve.js":170,"./supercutfx-shader.js":173,"./supercutfx.js":174,"./tail.js":175,"./text-counter.js":176,"./text-geometry.js":236,"./text-truncate.js":177,"./text-uppercase.js":178,"./toggle-pause-play.js":179,"./trail.js":180,"./tunnels.js":181,"./vertex-colors-buffer.js":182,"./victory-accuracy-ring.js":183,"./victory-rank.js":184,"./visible-raycastable.js":185,"./wall-shader.js":186,"./wall.js":189,"./weapon-particles.js":190,"./zip-loader.js":191};function i(e){var t=a(e);return n(t)}function a(e){if(!n.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}i.keys=function(){return Object.keys(r)},i.resolve=a,e.exports=i,i.id=58},function(e,t,n){if(AFRAME.registerComponent("active-item",{dependencies:["material"],schema:{active:{default:!1},opacity:{default:1}},init:function(){this.defaultOpacity=this.el.getAttribute("material").opacity,this.materialObj={opacity:this.data.opacity}},update:function(){var e=this.el;this.data.active?(e.setAttribute("material",this.materialObj),e.object3D.visible=!0):(e.setAttribute("material","opacity",this.defaultOpacity),e.components.animation__mouseleave&&setTimeout(()=>{e.emit("mouseleave",null,!1)}))}}),AFRAME.registerComponent("active-text-color",{dependencies:["text"],schema:{active:{default:!1},color:{default:"#333"}},init:function(){this.defaultColor=this.el.getAttribute("text").color},update:function(){var e=this.el;this.data.active?e.setAttribute("text","color",this.data.color):e.setAttribute("text","color",this.defaultColor)}}),window.AFRAME){const t=["active-item","active-text-color"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){const r=["dance","rumba","capoeira","thriller","wave","celebrate","taunt","silly","jump","pray","reaction","sitclap","sitlaugh","kiss","angry","defeated","falling","dying","idle"];if(AFRAME.registerComponent("agent-dance",{schema:{base:{default:"assets/clips/"},initial:{default:"dance"}},init:function(){this.clips={},this.currentAction=null;const e=this.el,t=()=>{const t=e.getObject3D("mesh");t&&(this.mixer=new THREE.AnimationMixer(t),this.play(this.data.initial),this.buildUI())};e.getObject3D("mesh")?t():e.addEventListener("model-loaded",t),this.onKeyDown=e=>{if("INPUT"===e.target.tagName||"TEXTAREA"===e.target.tagName)return;const t="1234567890".indexOf(e.key);t>=0&&r[t]&&(this.play(r[t]),this.ui&&(this.ui.value=r[t]))},window.addEventListener("keydown",this.onKeyDown)},remove:function(){window.removeEventListener("keydown",this.onKeyDown),this.ui&&this.ui.remove()},play:function(e){if(!this.mixer)return;const t=e=>{const t=this.mixer.clipAction(e);t.reset().play(),this.currentAction&&this.currentAction!==t&&this.currentAction.crossFadeTo(t,.3,!1),this.currentAction=t};this.clips[e]?t(this.clips[e]):fetch(this.data.base+e+".json").then(e=>e.ok?e.json():null).then(n=>{if(!n)return;const r=THREE.AnimationClip.parse(n);this.clips[e]=r,t(r)}).catch(()=>{})},buildUI:function(){const e=document.createElement("select");e.style.cssText="position:fixed;top:10px;left:10px;z-index:9999998;background:rgba(0,0,0,0.7);color:#fff;font-family:monospace;padding:6px;border:1px solid #444;border-radius:4px;",e.title="Agent animation (1-0 keys also work)",r.forEach((t,n)=>{const r=document.createElement("option");r.value=t;const i=n<10?`[${(n+1)%10}] `:"";r.textContent=i+t,t===this.data.initial&&(r.selected=!0),e.appendChild(r)}),e.addEventListener("change",()=>this.play(e.value)),document.body.appendChild(e),this.ui=e},tick:function(e,t){this.mixer&&this.mixer.update(t/1e3)}}),window.AFRAME){const t=["agent-dance"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){const r=[{id:"cz",name:"CZ",url:"assets/avatars/cz.glb"}];function i(e){return String(e).replace(/[&<>"']/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"}[e]))}function a(e){return"three.ws"===window.location.hostname?e:e.replace(/^https:\/\/pub-2534e921bf9c4314addcd4d8a6e98b7b\.r2\.dev/,"/r2-proxy")}if(AFRAME.registerSystem("agent-picker",{init:function(){this.agents=r.slice(),this.currentId=null,this.companionEl=null,this.searchQuery="";const e=()=>{this.companionEl=document.querySelector("#agentCompanion"),this.companionEl&&(this.buildOverlay(),this.applyInitialSelection(),this.wireSceneEvents(),this.wirePostMessage(),this.fetchPublicAvatars())};this.sceneEl.hasLoaded?e():this.sceneEl.addEventListener("loaded",e)},fetchPublicAvatars:function(e=""){const t=new URL("https://three.ws/api/explore");t.searchParams.set("only3d","1"),t.searchParams.set("limit","40"),e&&t.searchParams.set("q",e),fetch(t.toString()).then(e=>e.ok?e.json():null).then(e=>{if(!e||!Array.isArray(e.items))return;const t=e.items.filter(e=>e.glbUrl).map(e=>({id:`${e.kind}-${e.agentId||e.name}-${e.sortDate}`,name:e.name||"Untitled",url:a(e.glbUrl),owner:e.ownerShort||""}));this.agents=r.concat(t),this.renderList()}).catch(()=>{})},buildOverlay:function(){if(document.getElementById("agentPicker"))return;const e=document.createElement("div");e.id="agentPicker",e.innerHTML='\n <style>\n #agentPicker {\n position: fixed; top: 12px; right: 12px; z-index: 9999;\n font-family: system-ui, sans-serif; user-select: none;\n transition: opacity 0.3s;\n }\n #agentPicker.playing { opacity: 0; pointer-events: none; }\n #agentPicker .ap-toggle {\n background: rgba(8, 10, 24, 0.85); color: #cfd6ff;\n border: 1px solid rgba(120, 140, 255, 0.4); border-radius: 8px;\n padding: 8px 14px; font-size: 12px; letter-spacing: 0.08em;\n cursor: pointer; backdrop-filter: blur(6px);\n }\n #agentPicker .ap-toggle:hover { background: rgba(40, 50, 100, 0.9); }\n #agentPicker .ap-panel {\n margin-top: 8px; background: rgba(8, 10, 24, 0.92);\n border: 1px solid rgba(120, 140, 255, 0.3); border-radius: 8px;\n padding: 8px; width: 260px; display: none;\n backdrop-filter: blur(6px);\n }\n #agentPicker.open .ap-panel { display: block; }\n #agentPicker .ap-search {\n width: 100%; box-sizing: border-box; background: rgba(0,0,0,0.4);\n color: #cfd6ff; border: 1px solid rgba(120, 140, 255, 0.3);\n border-radius: 6px; padding: 6px 8px; font-size: 12px;\n margin-bottom: 6px; outline: none;\n }\n #agentPicker .ap-list { max-height: 320px; overflow-y: auto; }\n #agentPicker .ap-item {\n display: flex; align-items: center; gap: 10px;\n padding: 8px 10px; border-radius: 6px; cursor: pointer;\n color: #cfd6ff; font-size: 13px;\n }\n #agentPicker .ap-item:hover { background: rgba(80, 100, 200, 0.25); }\n #agentPicker .ap-item.active { background: rgba(80, 100, 200, 0.4); }\n #agentPicker .ap-dot {\n width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;\n background: linear-gradient(135deg, #6699ff, #ff4488);\n }\n #agentPicker .ap-name {\n flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;\n }\n #agentPicker .ap-owner { color: #6677aa; font-size: 10px; }\n #agentPicker .ap-empty { padding: 10px; color: #6677aa; font-size: 12px; text-align: center; }\n </style>\n <button class="ap-toggle" type="button">AGENT</button>\n <div class="ap-panel">\n <input class="ap-search" type="text" placeholder="Search avatars on three.ws..." />\n <div class="ap-list"></div>\n </div>\n ',document.body.appendChild(e);const t=e.querySelector(".ap-toggle"),n=e.querySelector(".ap-search");let r;t.addEventListener("click",()=>e.classList.toggle("open")),n.addEventListener("input",()=>{clearTimeout(r),this.searchQuery=n.value.trim(),r=setTimeout(()=>this.fetchPublicAvatars(this.searchQuery),300)}),this.overlayEl=e,this.listEl=e.querySelector(".ap-list")},renderList:function(){this.listEl&&(this.listEl.innerHTML="",this.agents.length?this.agents.forEach(e=>{const t=document.createElement("div");t.className="ap-item"+(e.id===this.currentId?" active":""),t.dataset.id=e.id,t.innerHTML=`\n <span class="ap-dot"></span>\n <span class="ap-name">${i(e.name)}</span>\n ${e.owner?`<span class="ap-owner">${i(e.owner)}</span>`:""}\n `,t.addEventListener("click",()=>{this.selectAgent(e.id),this.overlayEl.classList.remove("open")}),this.listEl.appendChild(t)}):this.listEl.innerHTML='<div class="ap-empty">No avatars found.</div>')},applyInitialSelection:function(){const e=new URLSearchParams(window.location.search).get("agent");e&&this.agents.some(t=>t.id===e)?this.selectAgent(e):this.selectAgent(this.agents[0].id),this.renderList()},selectAgent:function(e){let t;"string"==typeof e?t=this.agents.find(t=>t.id===e):e&&e.url&&(t=e,this.agents.some(e=>e.id===t.id)||this.agents.push(t)),t&&this.companionEl&&(this.currentId=t.id,this.companionEl.setAttribute("gltf-model",t.url),this.renderList(),this.sceneEl.emit("agentchanged",{agentId:t.id,url:t.url}))},wireSceneEvents:function(){const e=()=>this.overlayEl&&this.overlayEl.classList.remove("playing");this.sceneEl.addEventListener("songstartfade",()=>this.overlayEl&&this.overlayEl.classList.add("playing")),this.sceneEl.addEventListener("cleargame",e),this.sceneEl.addEventListener("gameover",e),this.sceneEl.addEventListener("songcomplete",e)},wirePostMessage:function(){window.addEventListener("message",e=>{const t=e.data;t&&"rider:setAgent"===t.type&&(t.url?this.selectAgent({id:t.agentId||"external-"+Date.now(),name:t.name||"Agent",url:t.url}):t.agentId&&this.selectAgent(t.agentId))})}}),window.AFRAME){const t=[],n=[],r=["agent-picker"];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){const r=new THREE.Vector3,i={right:0,upright:45,up:90,upleft:135,left:180,downleft:225,down:270,downright:315},a={right:new THREE.Vector2(0,1),upright:new THREE.Vector2(-.5,.5),up:new THREE.Vector2(-1,0),upleft:new THREE.Vector2(-.5,-.5),left:new THREE.Vector2(0,-1),downleft:new THREE.Vector2(.5,-.5),down:new THREE.Vector2(1,0),downright:new THREE.Vector2(.5,.5)};function o(e,t){e.x+=(Math.random()-.5)*t,e.y+=(Math.random()-.5)*t,e.z+=(Math.random()-.5)*t}if(AFRAME.registerComponent("beat-cut-fx",{schema:{color:{type:"string"},type:{oneOf:["beat","dot","mine"],default:"beat"}},init:function(){this.breaking=!1,this.fx=null,this.fxpool=null,this.pieces=[],this.pool=null,this.returnToPoolTimer=500,this.el.addEventListener("model-loaded",this.setupModel.bind(this)),this.el.addEventListener("explode",this.explode.bind(this),!1)},update:function(){const e=this.el.sceneEl,t=this.data.color;"beat"===this.data.type?(this.material=e.systems.materials[t+"BeatPieces"],this.poolBeat=e.components["pool__beat-broken-"+t],this.poolBeatFx=e.components["pool__beat-fx-"+t],this.poolPunchFx=e.components["pool__punch-fx-"+t]):"dot"===this.data.type?(this.material=e.systems.materials[t+"BeatPieces"],this.poolBeat=e.components[`pool__beat-broken-${t}-dot`],this.poolPunch=e.components[`pool__punch-broken-${t}-dot`],this.poolBeatFx=e.components["pool__beat-fx-"+t],this.poolPunchFx=e.components["pool__punch-fx-"+t]):(this.material=e.systems.materials.minePieces,this.poolBeat=e.components["pool__beat-broken-mine"],this.poolBeatFx=e.components["pool__beat-fx-mine"],this.poolPunchFx=e.components["pool__punch-fx-mine"])},setupModel:function(e){const t=e.detail.model;this.pieces=t.children;for(let e=0;e<this.pieces.length;e++){let t=this.pieces[e];t.restPosition=t.position.clone(),t.restRotation=t.rotation.clone(),t.posVelocity=new THREE.Vector3,t.rotVelocity=new THREE.Vector3,t.material=this.material}},explode:function(e){const t=e.detail.direction,n=e.detail.gameMode,s=e.detail.correctHit,c=e.detail.position,l=e.detail.rotation;let u=e.detail.beatDirection;if(c&&l&&t&&this.data.color===e.detail.color){if(this.el.object3D.position.copy(c),"classic"===n&&"mine"!==this.data.type){const e="dot"===this.data.type;e&&(u=Math.abs(t.x)>Math.abs(t.y)?"right":"down"),t.z*=.01,r.copy(t).multiplyScalar(-.0025).clampLength(0,.01);for(let t=0;t<this.pieces.length;t++){let n=this.pieces[t];if(n.posVelocity.copy(r),n.rotation.z=THREE.Math.degToRad(i[u]),s){let r=t%2==0?-.001:.001;n.posVelocity.x+=a[u].x*r,n.posVelocity.y+=a[u].y*r,!e||t<2?(o(n.posVelocity,.002),o(n.rotVelocity,.004)):(n.posVelocity.copy(this.pieces[t-2].posVelocity),n.rotVelocity.copy(this.pieces[t-2].rotVelocity))}else n.posVelocity.y+=.001,n.rotVelocity.z+=.01}}else for(let e=0;e<this.pieces.length;e++){let t=this.pieces[e];s?(t.posVelocity.copy(t.position).normalize().multiplyScalar(.002),t.posVelocity.z=-.004,o(t.posVelocity,.001),o(t.rotVelocity,.01)):(t.posVelocity.y+=.001,t.posVelocity.z-=.001)}this.pool=this["classic"===n?"poolBeat":"poolPunch"],null===this.fx&&(this.fxpool=this["classic"===n?"poolBeatFx":"poolPunchFx"],this.fx=this.fxpool.requestEntity()),this.fx&&(this.fx.play(),this.fx.object3D.position.copy(c),this.fx.object3D.rotation.copy(l),this.fx.emit("explode")),this.returnToPoolTimer=500,this.breaking=!0,this.el.play()}},returnToPool:function(){for(let e=0;e<this.pieces.length;e++){let t=this.pieces[e];t.position.copy(t.restPosition),t.rotation.copy(t.restRotation),t.posVelocity.set(0,0,0),t.rotVelocity.set(0,0,0),t.scale.set(1,1,1)}this.fx&&(this.fxpool.returnEntity(this.fx),this.fx=null),this.pool.returnEntity(this.el),this.breaking=!1},tick:function(e,t){if(this.breaking)if(this.returnToPoolTimer-=t,this.returnToPoolTimer<=0)this.returnToPool();else for(let e=0;e<this.pieces.length;e++){const n=this.pieces[e];n.position.addScaledVector(n.posVelocity,t),n.rotation.set(n.rotation.x+n.rotVelocity.x*t,n.rotation.y+n.rotVelocity.y*t,n.rotation.z+n.rotVelocity.z*t),"mine"!==this.data.type?(this.returnToPoolTimer<250&&n.scale.multiplyScalar(.94),n.posVelocity.multiplyScalar(.97),n.posVelocity.y-=3e-6*t):(n.scale.multiplyScalar(.94),n.posVelocity.multiplyScalar(.97))}}}),window.AFRAME){const t=["beat-cut-fx"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("beat-hit-sound",{directionsToSounds:{up:"",down:"",upleft:"left",upright:"right",downleft:"left",downright:"right",left:"left",right:"right"},init:function(){this.currentBeatEl=null,this.currentCutDirection="",this.processSound=this.processSound.bind(this),this.sourceCreatedCallback.bind(this);for(let e=1;e<=10;e++)this.el.setAttribute("sound__beathit"+e,{poolSize:8,positional:!1,src:"#hitSound"+e,volume:.185}),this.el.setAttribute(`sound__beathit${e}left`,{poolSize:8,positional:!1,src:`#hitSound${e}left`,volume:.185}),this.el.setAttribute(`sound__beathit${e}right`,{poolSize:8,positional:!1,src:`#hitSound${e}right`,volume:.185})},play:function(){for(let e=1;e<=10;e++)this.el.components["sound__beathit"+e].loaded||(this.el.setAttribute("sound__beathit"+e,"src",""),this.el.setAttribute("sound__beathit"+e,"src","#hitSound"+e)),this.el.components[`sound__beathit${e}left`].loaded||(this.el.setAttribute(`sound__beathit${e}left`,"src",""),this.el.setAttribute(`sound__beathit${e}left`,"src",`#hitSound${e}left`)),this.el.components[`sound__beathit${e}right`].loaded||(this.el.setAttribute(`sound__beathit${e}right`,"src",""),this.el.setAttribute(`sound__beathit${e}right`,"src",`#hitSound${e}right`))},playSound:function(e,t,n){const r=1+Math.floor(10*Math.random()),i=this.directionsToSounds[n||"up"];this.el.components[`sound__beathit${r}${i}`].playSound(this.processSound)},processSound:function(e){e.detune=0},sourceCreatedCallback:function(e){const t=this.getLayer(this.currentBeatEl.object3D.position.y);"bottom"===t?e.detune.setValueAtTime(-400,0):"top"===t&&e.detune.setValueAtTime(200,0),"down"===this.currentCutDirection&&e.detune.linearRampToValueAtTime(-400,1),"up"===this.currentCutDirection&&e.detune.linearRampToValueAtTime(400,1)},getLayer:function(e){return 1===e?"bottom":1.7===e?"top":"middle"}}),window.AFRAME){const t=["beat-hit-sound"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("blade",{schema:{enabled:{default:!1}},init:function(){const e=this.el;this.data;this.bladeHandle=e.querySelector(".bladeHandleHelper").object3D,this.bladeTip=e.querySelector(".bladeTipHelper").object3D,this.rigEl=document.getElementById("curveFollowRig"),this.strokeDirectionVector=new THREE.Vector3,this.strokeSpeed=0,this.bladeBottomPosition=new THREE.Vector3,this.bladeTipPositions=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3],this.bladeWorldPositions=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3],this.bladeEl=this.el.querySelector(".blade")},update:function(e){!e.enabled&&this.data.enabled&&this.bladeEl.emit("drawblade")},tickBeatSystem:function(e,t){this.data.enabled&&this.updateVelocity(t)},updateVelocity:function(e){const t=this.bladeTipPositions,n=this.bladeWorldPositions;this.data;n[2].copy(n[0]),n[3].copy(n[1]),this.bladeTip.getWorldPosition(n[0]),this.bladeHandle.getWorldPosition(n[1]),t[2].copy(n[0]),this.rigEl.object3D.worldToLocal(t[2]),this.strokeDirectionVector.copy(t[2]).sub(t[0]);const r=this.strokeDirectionVector.length();this.strokeSpeed=r/(e/1e3),this.strokeDirectionVector.z=0,this.strokeDirectionVector.normalize();const i=t.shift();t.push(i)},checkCollision:function(){const e=new THREE.Box3,t=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3],n=new THREE.Triangle;return function(r){if(this.strokeSpeed<1)return!1;for(let e=0;e<3;e++)t[e].copy(this.bladeWorldPositions[e]),r.blockEl.object3D.worldToLocal(t[e]),t[e].multiplyScalar(1.75);return n.set(t[0],t[1],t[2]),e.copy(r.bbox),e.expandByScalar(.02),"left"!==r.horizontalPosition&&"right"!==r.horizontalPosition||e.expandByScalar(.07),!!e.intersectsTriangle(n)||(t[3].copy(this.bladeWorldPositions[3]),r.blockEl.object3D.worldToLocal(t[3]),n.set(t[2],t[3],t[0]),!!e.intersectsTriangle(n))}}(),createDebugCube:function(e,t){const n=new THREE.BoxGeometry(.05,.05,.05),r=new THREE.Mesh(n,new THREE.MeshBasicMaterial({color:t,side:THREE.DoubleSide}));r.position.copy(e),this.el.sceneEl.object3D.add(r)}}),window.AFRAME){const t=["blade"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerSystem("check-vr",{init:function(){AFRAME.utils.device.isMobile()&&(document.getElementById("vrButton").style.display="none"),setTimeout(()=>{AFRAME.utils.device.checkHeadsetConnected()&&this.el.emit("displayconnected")},250)}}),window.AFRAME){const t=[],n=[],r=["check-vr"];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("console-shortcuts",{play:function(){window.$=e=>document.querySelector(e),window.$$=e=>document.querySelectorAll(e),window.$$$=e=>document.querySelector(`[${e}]`).getAttribute(e),window.$$$$=e=>document.querySelector(`[${e}]`).components[e],window.scene=this.el,window.state=this.el.systems.state.state}}),window.AFRAME){const t=["console-shortcuts"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("controller",{schema:{hand:{default:"right",oneOf:["left","right"]}},init:function(){const e=this.el,t=this.data;this.controllerType="",e.addEventListener("controllerconnected",e=>{this.controllerType=e.detail.name,this.el.setAttribute("cursor",this.config[this.controllerType].cursor||{})});const n={hand:t.hand,model:!1};e.setAttribute("daydream-controls",n),e.setAttribute("oculus-go-controls",n),e.setAttribute("oculus-touch-controls",{hand:t.hand,model:!1,orientationOffset:{x:0,y:0,z:0}}),e.setAttribute("vive-controls",n),e.setAttribute("vive-focus-controls",n),e.setAttribute("windows-motion-controls",n),e.setAttribute("generic-tracked-controller-controls",n)},config:{"daydream-controls":{cursor:{downEvents:["trackpaddown","triggerdown"],upEvents:["trackpadup","triggerup"]}},"oculus-go-controls":{cursor:{downEvents:["trackpaddown","triggerdown"],upEvents:["trackpadup","triggerup"]}},"oculus-touch-controls":{cursor:{downEvents:["triggerdown","gripdown","abuttondown","bbuttondown","xbuttondown","ybuttondown"],upEvents:["triggerup","gripup","abuttonup","bbuttonup","xbuttonup","ybuttonup"]}},"vive-controls":{cursor:{downEvents:["trackpaddown","triggerdown","gripdown"],upEvents:["trackpadup","triggerup","gripup"]}},"vive-focus-controls":{cursor:{downEvents:["trackpaddown","triggerdown","gripdown"],upEvents:["trackpadup","triggerup","gripup"]}},"windows-motion-controls":{cursor:{downEvents:["trackpaddown","triggerdown","gripdown"],upEvents:["trackpadup","triggerup","gripup"]}},"generic-tracked-controller-controls":{cursor:{downEvents:["triggerdown"],upEvents:["triggerup"]}}}}),window.AFRAME){const t=["controller"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("copy-texture",{dependencies:["geometry","material"],schema:{from:{type:"selector"}},init:function(){this.data.from.addEventListener("materialtextureloaded",()=>{this.copyTexture()}),this.copyTexture()},copyTexture:function(){const e=this.el,t=this.data.from,n=e.getObject3D("mesh").material;t.getObject3D("mesh")&&(n.map=t.getObject3D("mesh").material.map,n.map&&(n.map.needsUpdate=!0,n.needsUpdate=!0))}}),window.AFRAME){const t=["copy-texture"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("cursor-laser",{dependencies:["geometry"],schema:{enabled:{default:!0}},init:function(){const e=this.el;this.weaponEl=this.el.closest(".weapon");const t=this.el.getAttribute("geometry");e.object3D.position.z=-1*t.height/2,this.originalSize=t.height,this.currentLength=t.height},update:function(){this.el.object3D.visible=this.data.enabled},tick:function(){const e=this.el;if(!this.data.enabled)return;const t=this.weaponEl.components.cursor;if(!t)return;if(!t.intersectedEl)return e.object3D.position.z=-24.98,e.object3D.scale.x=.75,e.getObject3D("mesh").scale.y=50,void(this.currentLength=1);const n=this.weaponEl.components.raycaster.intersections[0];n&&(e.object3D.scale.x=1,e.object3D.position.z=-n.distance/2,e.getObject3D("mesh").scale.y=this.currentLength=n.distance)}}),window.AFRAME){const t=["cursor-laser"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("cursor-mesh",{schema:{active:{default:!0},cursorEl:{type:"selector"}},init:function(){this.scenePivotEl=document.getElementById("scenePivot")},update:function(){this.el.object3D.visible=this.data.active},tick:function(){var e,t,n=this.data.cursorEl,r=this.el,i=this.scenePivotEl;this.data.active&&n.components.cursor&&((t=n.components.cursor.intersectedEl)?(r.object3D.visible=!0,(e=n.components.raycaster.getIntersection(t))&&(r.object3D.position.copy(e.point),i&&r.object3D.rotation.copy(i.object3D.rotation))):r.object3D.visible=!1)}}),window.AFRAME){const t=["cursor-mesh"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("curve-follow-rig-reset",{schema:{isVictory:{type:"string"}},init:function(){this.el.sceneEl.addEventListener("cleargame",()=>{this.reset()})},update:function(e){const t=this.data;this.el;!e.isVictory&&t.isVictory&&this.reset()},reset:function(){this.el.components["supercurve-follow"].curveProgress=0,this.el.object3D.position.set(0,0,0),this.el.object3D.rotation.set(0,0,0)}}),window.AFRAME){const t=["curve-follow-rig-reset"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerShader("cutfxShader",{schema:{src:{type:"map",is:"uniform",default:"#cutfxImg"},color:{type:"color",is:"uniform",default:"#fff"},progress:{type:"number",is:"uniform"},transparent:{default:!0},blending:{default:"additive"},side:{default:"double"},depthTest:{default:!1},depthWrite:{default:!1}},vertexShader:n(73),fragmentShader:n(74)}),window.AFRAME){const t=[],n=["cutfxShader"],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t){e.exports="varying vec2 uvs;\nvoid main() {\n uvs.xy = uv.xy;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n"},function(e,t){e.exports="varying vec2 uvs;\nuniform sampler2D src;\nuniform vec3 color;\nuniform float progress;\n\nvoid main() {\n vec3 col = color;\n float alpha = smoothstep(progress, 1.0, texture2D(src, uvs).a);\n gl_FragColor = vec4(col, alpha);\n}\n"},function(e,t,n){if(AFRAME.registerComponent("debug-beat-generator",{dependencies:["beat-generator"],schema:{beatEnabled:{default:!1},stageEnabled:{default:!1}},init:function(){this.beatLoader=this.el.components["beat-generator"],this.selectedBeat={color:"red",position:"middleCenterLeft",type:"arrow",orientation:"up"},this.beats={},this.onKeyDown=this.onKeyDown.bind(this),(this.data.stageEnabled||AFRAME.utils.getUrlParameter("debugstage"))&&this.addDebugStageControls(),(this.data.beatEnabled||"gameplay"===AFRAME.utils.getUrlParameter("debugstate").trim())&&(window.addEventListener("keydown",this.onKeyDown),this.addDebugBeatControls())},spawn:function(){var e=this;Object.keys(this.beats).forEach((function(t){e.generateBeat(e.beats[t])}))},generateBeat:function(e){var t;"wall"!==e.type?(t="mine"===e.type?3:"red"===e.color?0:1,this.beatLoader.generateBeat({_lineIndex:this.beatLoader.positionHumanized[e.position].index,_lineLayer:this.beatLoader.positionHumanized[e.position].layer,_cutDirection:"dot"===e.type?8:this.beatLoader.orientationsHumanized.indexOf(e.orientation),_type:t})):this.generateWall(e)},generateWall:function(e){this.beatLoader.bpm=90,this.beatLoader.generateWall({_lineIndex:this.beatLoader.positionHumanized[e.position].index,_width:1,_duration:3})},onKeyDown:function(e){switch(e.keyCode){case 32:this.spawn()}},addDebugBeatControls:function(){const e=document.createElement("div"),t=this;var n;function r(t){const n=document.createElement("div");return n.id=t,n.style.marginBottom="20px",n.style.width="500px",n.style.display="inline-block",e.appendChild(n),n}function i(e,n,r){const i=document.createElement("div"),a=r||function(){const e=i.parentElement.querySelectorAll(".button");for(let t=0;t<e.length;t++)e[t].style.background="#000";i.style.background="#66f",t.selectedBeat[i.parentElement.id]=this.id,t["selected"+i.parentElement.id.charAt(0).toUpperCase()+i.parentElement.id.slice(1)+"El"]=this};return i.classList.add("button"),i.id=e,i.style.width="100px",i.style.height="30px",i.style.background="#000",i.style.color="#fff",i.style.zIndex=999999999,i.style.padding="5px",i.style.margin="5px",i.style.font="14px sans-serif",i.style.textAlign="center",i.style.lineHeight="30px",i.style.cursor="pointer",i.style.display="inline-block",i.innerHTML=e,n.appendChild(i),i.addEventListener("click",a),i}e.style.position="absolute",e.style.right="0",e.style.top="0",e.style.padding="10px",e.style.width="500px",e.style.height="600px",document.body.appendChild(e),function(){const t=r("type");i("arrow",t),i("dot",t),i("mine",t),i("wall",t),e.appendChild(t)}(),function(){const t=r("color");i("blue",t),i("red",t),e.appendChild(t)}(),function(){const t=r("orientation");i("top",t),i("left",t),i("right",t),i("down",t),e.appendChild(t)}(),(n=i("Set Beat",e,(function(){var e="mine"!==t.selectedBeat.type?" "+t.selectedBeat.color:"",n="arrow"!==t.selectedBeat.type?"":" "+t.selectedBeat.orientation;t.selectedBeat={position:t.selectedBeat.position,type:t.selectedBeat.type,orientation:t.selectedBeat.orientation,color:t.selectedBeat.color},t.selectedPositionEl&&(t.selectedPositionEl.innerHTML=t.selectedBeat.type+e+n,t.beats[t.selectedPositionEl.id]={position:t.selectedBeat.position,type:t.selectedBeat.type,orientation:t.selectedBeat.orientation,color:t.selectedBeat.color})}))).style.width="460px",n.style.bottomMargin="10px",function(){const e=r("position");i("topLeft",e),i("topCenterLeft",e),i("topCenterRight",e),i("topRight",e),i("middleLeft",e),i("middleCenterLeft",e),i("middleCenterRight",e),i("middleRight",e),i("bottomLeft",e),i("bottomCenterLeft",e),i("bottomCenterRight",e),i("bottomRight",e)}(),function(n,r){const a=i("Spawn (Space Bar)",e,()=>{t.spawn()});a.style.width="460px",a.style.bottomMargin="10px"}()},addDebugStageControls:function(){var e=0;const t=(t,n,r)=>{const i=document.createElement("div");i.style.position="absolute",i.id="stagecontrol"+t,i.style.width="100px",i.style.height="30px",i.style.top="element"===r?"20px":"70px",i.style.background="#000",i.style.color="#fff",i.style.zIndex=999999999,i.style.padding="5px",i.style.font="14px sans-serif",i.style.textAlign="center",i.style.cursor="pointer",i.style.left=20+120*t+"px",i.innerHTML=n,"element"===r?i.addEventListener("click",()=>{document.getElementById("stagecontrol"+e).style.background="#000",i.style.background="#66f",e=t}):i.addEventListener("click",()=>{this.beatLoader.generateEvent({_type:e,_value:t})}),document.body.appendChild(i)};["sky","tunnelNeon","leftStageLasers","rightStageLasers","floor"].forEach((e,n)=>{t(n,e,"element")}),["off","blue","blue","bluefade","","red","red","redfade"].forEach((e,n)=>{t(n,e,"value")})}}),window.AFRAME){const t=["debug-beat-generator"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){const r=["left","middleleft","middleright","right"],i=["bottom","middle","top"];if(AFRAME.registerComponent("debug-beat-positioning",{play:function(){let e=AFRAME.utils.getUrlParameter("debugbeatpositioning");e&&("punch"!==e&&"classic"!==e&&(e="classic"),this.el.emit("debugbeatpositioning"),setTimeout(()=>{const t=this.el.sceneEl.components["beat-generator"];t.data.gameMode=e,scene.components["beat-system"].data.gameMode=e,scene.components["beat-system"].updateBeatPositioning(),r.forEach(n=>{i.forEach(r=>{let i=t.requestBeat("punch"===e?"dot":"arrow","red"),a=Math.random()<.5?"left":"right";i.components.beat.onGenerate(.001,n,r,a),i.object3D.renderOrder=9999,i.play(),i=t.requestBeat("dot","blue"),a=Math.random()<.5?"down":"up",i.components.beat.onGenerate(.0015,n,r,a),i.object3D.renderOrder=9999,i.play()})});const n=scene.components.pool__wall.requestEntity();n.components.wall.onGenerate(.0015,"left",4,4,!0),n.play(),document.getElementById("beatContainer").removeAttribute("bind__visible"),document.getElementById("beatContainer").object3D.visible=!0},500))}}),window.AFRAME){const t=["debug-beat-positioning"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("debug-controller",{init:function(){var e,t;AFRAME.utils.getUrlParameter("debug")&&(console.log("%c debug-controller enabled ","background: #111; color: red"),e=document.getElementById("rightHand"),t=document.getElementById("leftHand"),e.setAttribute("tracked-controls","autoHide",!1),e.object3D.visible=!0,t.object3D.visible=!0,t.setAttribute("tracked-controls","autoHide",!1),AFRAME.utils.getUrlParameter("headfist")||(window.addEventListener("click",t=>{t.isTrusted&&(e.emit("triggerdown"),e.emit("triggerup"))}),"oculus"===AFRAME.utils.getUrlParameter("debug")?(e.emit("controllerconnected",{name:"oculus-touch-controls"}),t.emit("controllerconnected",{name:"oculus-touch-controls"}),e.setAttribute("controller","controllerType","oculus-touch-controls"),t.setAttribute("controller","controllerType","oculus-touch-controls")):(e.emit("controllerconnected",{name:"vive-controls"}),t.emit("controllerconnected",{name:"vive-controls"}),e.setAttribute("controller","controllerType","vive-controls"),t.setAttribute("controller","controllerType","vive-controls")),this.el.emit("enter-vr",null,!1),document.addEventListener("keydown",n=>{var r,i,a,o;n.shiftKey&&(32!==n.keyCode?81!==n.keyCode?(78===n.keyCode&&(this.secondaryGripDown?(t.emit("gripup"),this.secondaryGripDown=!1):(t.emit("gripdown"),this.secondaryGripDown=!0)),77===n.keyCode&&(this.primaryGripDown?(e.emit("gripup"),this.primaryGripDown=!1):(e.emit("gripdown"),this.primaryGripDown=!0)),49===n.keyCode&&t.emit("menudown"),n.ctrlKey?(a=t.getAttribute("position"),72===n.keyCode&&(a.x-=.02),74===n.keyCode&&(a.y-=.02),75===n.keyCode&&(a.y+=.02),76===n.keyCode&&(a.x+=.02),59!==n.keyCode&&186!==n.keyCode||(a.z-=.01),222===n.keyCode&&(a.z+=.01),t.setAttribute("position",AFRAME.utils.clone(a))):(r=e.getAttribute("position"),72===n.keyCode&&(r.x-=.02),74===n.keyCode&&(r.y-=.02),75===n.keyCode&&(r.y+=.02),76===n.keyCode&&(r.x+=.02),59!==n.keyCode&&186!==n.keyCode||(r.z-=.02),222===n.keyCode&&(r.z+=.02),e.setAttribute("position",AFRAME.utils.clone(r))),n.ctrlKey?(o=t.getAttribute("rotation"),89===n.keyCode&&(o.x-=10),79===n.keyCode&&(o.x+=10),85===n.keyCode&&(o.y-=10),73===n.keyCode&&(o.y+=10),t.setAttribute("rotation",AFRAME.utils.clone(o))):(i=e.getAttribute("rotation"),89===n.keyCode&&(i.x-=10),79===n.keyCode&&(i.x+=10),85===n.keyCode&&(i.y-=10),73===n.keyCode&&(i.y+=10),e.setAttribute("rotation",AFRAME.utils.clone(i)))):this.isSecondaryTriggerDown?(t.emit("triggerup"),this.isSecondaryTriggerDown=!1):(t.emit("triggerdown"),this.isSecondaryTriggerDown=!0):this.isTriggerDown?(e.emit("triggerup"),this.isTriggerDown=!1):(e.emit("triggerdown"),this.isTriggerDown=!0))})))},play:function(){var e,t;if(this.bounds=document.body.getBoundingClientRect(),!AFRAME.utils.getUrlParameter("debug"))return;if(AFRAME.utils.getUrlParameter("headfist"))return;e=document.getElementById("rightHand"),(t=document.getElementById("leftHand")).object3D.position.set(-.2,1.5,-.5),e.object3D.position.set(.2,1.5,-.5),t.setAttribute("rotation",{x:35,y:0,z:0});const n=AFRAME.utils.getUrlParameter("type");[e,t].forEach(e=>{e.querySelector(".laser").object3D.visible=!1,"classic"===n?(e.querySelector(".bladeContainer").removeAttribute("bind__visible"),e.querySelector(".bladeContainer").object3D.visible=!0,e.querySelector(".bladeContainer").object3D.scale.set(1,1,1)):"punch"===n?(e.querySelector(".punch").removeAttribute("bind__visible"),e.querySelector(".punch").object3D.visible=!0,e.querySelector(".punch").object3D.visible=!0,e.querySelector(".bladeHandle").object3D.visible=!1):"ride"===n&&(e.querySelector(".handStar").removeAttribute("bind__visible"),e.querySelector(".handStar").object3D.visible=!0,e.querySelector(".bladeHandle").object3D.visible=!1)})},onMouseMove:function(){const e=new THREE.Vector3,t=new THREE.Vector2,n=new THREE.Vector3;return function(r){const i=this.bounds,a=this.el.sceneEl.camera,o=r.clientX-i.left,s=r.clientY-i.top;t.x=o/i.width*2-1,t.y=-s/i.height*2-1,document.getElementById("camera").object3D.getWorldPosition(n),e.set(t.x,t.y,.5).unproject(a).sub(n).normalize();const c=document.getElementById("rightHand").object3D.position,l=-n.z/e.z;a.getWorldPosition(c).add(e.multiplyScalar(l)),c.y+=.8}}()}),window.AFRAME){const t=["debug-controller"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("debug-cursor",{init:function(){},log:function(e,t,n){t.id?console.log(`%c[${e}] ${t.id}`,"color: "+n):(console.log(`%c[${e}]`,"color: "+n),console.log(t))}}),window.AFRAME){const t=["debug-cursor"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){const r=AFRAME.utils.getUrlParameter("skipintro");if(AFRAME.registerComponent("debug-intro",{play:function(){r&&document.getElementById("startButton").emit("click")}}),window.AFRAME){const t=["debug-intro"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("debug-song-time",{dependencies:["song"],init:function(){AFRAME.utils.getUrlParameter("debug-song-time")&&setInterval(()=>{console.log(this.el.components.song.getCurrentTime())},250)}}),window.AFRAME){const t=["debug-song-time"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("debug-state",{play:function(){const e=AFRAME.utils.getUrlParameter("debugstate").trim();e&&setTimeout(()=>{e.split(",").forEach(e=>{this.el.sceneEl.emit("debug"+e.trim(),null,!1)})},500)}}),window.AFRAME){const t=["debug-state"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("delayed-proxy-event",{schema:{captureBubbles:{default:!1},enabled:{default:!0},event:{type:"string"},from:{type:"string"},to:{type:"string"},as:{type:"string"},bubbles:{default:!1},delay:{default:0,type:"int"}},multiple:!0,init:function(){var e,t,n,r=this.data,i=this.el,a=this;if(r.from?e="PARENT"===r.from?[i.parentNode]:document.querySelectorAll(r.from):n="CHILDREN"===r.to?i.querySelectorAll("*"):"SELF"===r.to?[i]:document.querySelectorAll(r.to),r.from)for(t=0;t<e.length;t++)this.addEventListenerFrom(e[t]);else i.addEventListener(r.event,(function(e){setTimeout(()=>{var r=a.data;if(r.enabled&&(r.captureBubbles||e.target===i))for(t=0;t<n.length;t++)n[t].emit(r.as||r.event,e.detail?e.detail:null,r.bubbles)},r.delay)}))},addEventListenerFrom:function(e){var t=this.data,n=this;e.addEventListener(t.event,(function(r){setTimeout(()=>{var t=n.data;t.enabled&&(t.captureBubbles||r.target===e)&&n.el.emit(t.as||t.event,r.detail?r.detail:null,!1)},t.delay)}))}}),window.AFRAME){const t=["delayed-proxy-event"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("difficulty-background",{schema:{enabled:{type:!1}},update:function(){this.data.enabled?this.el.setAttribute("raycastable",""):this.el.removeAttribute("raycastable")}}),window.AFRAME){const t=["difficulty-background"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("difficulty-filter",{events:{click:function(e){this.el.sceneEl.emit("difficultyfilter",e.target.parentNode.dataset.difficultyFilter)}}}),window.AFRAME){const t=["difficulty-filter"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("difficulty-text",{schema:{id:{value:"Standard-Easy"}},update:function(){this.el.setAttribute("text","value",this.data.id.replace("Standard-","").replace("-","\n"))}}),window.AFRAME){const t=["difficulty-text"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("follow-position",{schema:{target:{type:"selector"}},tick:function(){this.el.object3D.position.copy(this.data.target.object3D.position)}}),window.AFRAME){const t=["follow-position"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("follow-z",{schema:{offset:{type:"vec3"},target:{type:"selector"}},tick:function(){this.data.target&&(this.el.object3D.position.copy(this.data.offset),this.el.object3D.position.z+=this.data.target.object3D.position.z)}}),window.AFRAME){const t=["follow-z"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("gameover",{schema:{isGameOver:{default:!1}},init:function(){this.beatContainer=document.getElementById("beatContainer"),this.gameOverEls=document.querySelectorAll("[animation__gameover]")},update:function(e){this.data;!e.isGameOver&&this.data.isGameOver&&(this.triggerAnimations(),this.countDown=1),e.isGameOver&&!this.data.isGameOver&&this.reset()},tick:function(e,t){this.data.isGameOver&&this.countDown>=0&&(this.beatContainer.object3D.position.z=1.5*-Math.pow(1-this.countDown,2),this.countDown-=t/1e3)},reset:function(){this.beatContainer.object3D.position.z=0,this.el.sceneEl.setAttribute("stage-colors","color","blue")},triggerAnimations:function(){for(let e=0;e<this.gameOverEls.length;e++)this.gameOverEls[e].emit("gameover",null,!1);this.el.emit("textglowoff",null,!1),this.el.emit("bgcolorgameover",null,!1)}}),window.AFRAME){const t=["gameover"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){let r=0;if(AFRAME.registerComponent("gpu-preloader",{dependencies:["materials"],play:function(){setTimeout(()=>{this.preloadFromSelector("#mainLogo"),this.preloadFromSelector("#prevArrow"),this.preloadFromSelector("#stepback"),this.preloadFromSelector(".difficultyBackground"),this.preloadFromSelector(".genreIcon"),this.preloadFromSelector(".merkababloom"),this.preloadFromSelector(".searchResultBackground"),this.preloadMaterialsComponentTextures(),this.preloadKeyboard(),this.preloadSlice(),this.preloadEnvMap(),this.preloadFXs()},1e3)},preloadFromSelector:function(e){const t=document.querySelector(e);this.preloadTexture(t.getObject3D("mesh").material.map)},preloadMaterialsComponentTextures:function(){const e=this.el.systems.materials.textureList;for(var t=0;t<e.length;t++)this.preloadTexture(e[t])},preloadKeyboard:function(){const e=document.getElementById("keyboard").components["super-keyboard"];this.preloadTexture(e.kbImg.getObject3D("mesh").material.map),this.preloadTexture(e.keyColorPlane.getObject3D("mesh").material.map)},preloadSlice:function(){const e=document.getElementById("searchPrevPage");this.preloadTexture(e.components.slice9.material.map)},preloadEnvMap:function(){const e=document.querySelector("#wallContainer [wall]");this.preloadTexture(e.components.material.material.uniforms.environment.value)},preloadFXs:function(){const e=document.querySelector("#rigContainer [mixin~=blueBeatFX]");this.preloadTexture(e.components.material.material.uniforms.src.value);const t=document.querySelector("#rigContainer [mixin~=mineFX]");this.preloadTexture(t.components.material.material.map)},preloadTexture:function(e){e&&e.image?e.image.complete?this.el.renderer.setTexture2D(e,r++%8):console.warn("[gpu-preloader] Error preloading, image not loaded",e):console.warn("[gpu-preloader] Error preloading texture",e)}}),window.AFRAME){const t=["gpu-preloader"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerShader("gradientShader",{schema:{color1:{type:"color",is:"uniform"},color2:{type:"color",is:"uniform"}},vertexShader:n(16),fragmentShader:n(91)}),window.AFRAME){const t=[],n=["gradientShader"],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t){e.exports="varying vec2 uvs;\nuniform vec3 color1;\nuniform vec3 color2;\n\nvoid main () {\n float mixDistance = distance(uvs, vec2(0.5, 0));\n float alphaDistance = min(1., (0.5 - distance(uvs, vec2(0.5))) * 2.5);\n gl_FragColor = vec4(mix(color1, color2, pow(mixDistance, 2.4)), alphaDistance);\n}\n"},function(e,t,n){const r=["triggerdown","gripdown","abuttondown","bbuttondown","xbuttondown","ybuttondown","trackpaddown"];if(AFRAME.registerComponent("hand-swapper",{schema:{enabled:{default:!1}},init:function(){this.swapHand=this.swapHand.bind(this),r.forEach(e=>{this.el.addEventListener(e,this.swapHand)})},swapHand:function(){this.data.enabled&&this.el.sceneEl.emit("activehandswap",null,!1)}}),window.AFRAME){const t=["hand-swapper"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){"use strict";n.r(t);var r=n(0),i=n.n(r);if(AFRAME.registerShader("handStar",{schema:{colorPrimary:{type:"color",is:"uniform",default:i.a.initial.primary},colorSecondary:{type:"color",is:"uniform",default:i.a.initial.secondary},colorTertiary:{type:"color",is:"uniform",default:i.a.initial.tertiary},pulse:{type:"number",is:"uniform",default:0},transparent:{default:!0},side:{default:"back"},depthTest:{default:!1}},vertexShader:n(94),fragmentShader:n(95)}),window.AFRAME){const t=[],n=["handStar"],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t){e.exports="varying vec3 vWorldPosition;\nvarying float fresnel;\nuniform float pulse;\n\nvoid main() {\n vWorldPosition = (modelMatrix * vec4(position, 1.0)).xyz;\n vec3 worldNormal = normalize(mat3(modelMatrix[0].xyz, modelMatrix[1].xyz, modelMatrix[2].xyz) * normal);\n vec3 viewVector = normalize(vWorldPosition - cameraPosition);\n fresnel = 0.08 * pow(0.4 + dot(viewVector, worldNormal), 6.0 + pulse);\n\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n"},function(e,t){e.exports="varying vec3 vWorldPosition;\nvarying float fresnel;\nuniform float pulse;\nuniform vec3 colorPrimary;\nuniform vec3 colorSecondary;\nuniform vec3 colorTertiary;\n\nvoid main() {\n vec3 colorize = vWorldPosition-cameraPosition;\n colorize = clamp(colorize + 0.5, vec3(0.0), vec3(1.0));\n vec3 col = mix(mix(colorPrimary, colorSecondary, colorize.x), colorTertiary, colorize.z);\n col += (fresnel * pulse) * 0.1;\n gl_FragColor = vec4 (col, clamp(fresnel, 0.0, 1.0));\n}\n"},function(e,t,n){if(AFRAME.registerComponent("haptics-wall",{schema:{enabled:{default:!1}},init:function(){const e=this.el;this.isHittingWall=!1,e.setAttribute("haptics__wall",{dur:50,force:.15}),this.checkIfHittingWall=this.checkIfHittingWall.bind(this),e.addEventListener("mouseenter",this.checkIfHittingWall),e.addEventListener("mouseleave",this.checkIfHittingWall),this.tick=AFRAME.utils.throttleTick(this.tick.bind(this),50)},checkIfHittingWall:function(){const e=this.el.components.raycaster__game.intersectedEls;this.isHittingWall=!1;for(let t=0;t<e.length;t++)if(e[t].components.wall)return void(this.isHittingWall=!0)},tick:function(){this.data.enabled&&this.isHittingWall&&this.el.components.haptics__wall.pulse()}}),window.AFRAME){const t=["haptics-wall"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("haptics-weapons",{schema:{enabled:{default:!1}},init:function(){const e=this.el;this.isColliding=!1,this.tick=AFRAME.utils.throttleTick(this.tick.bind(this),100),e.setAttribute("haptics__weapon",{dur:100,force:.075}),e.addEventListener("mouseenter",t=>{if(!t.detail||!t.detail.intersectedEl||!this.data.enabled)return;const n=t.detail.intersectedEl;n.classList.contains("blade")&&n!==e?(this.isColliding=!0,this.el.components.haptics__weapon.pulse()):this.isColliding=!1}),e.addEventListener("mouseleave",e=>{this.isColliding=!1})},tick:function(){this.isColliding&&this.data.enabled&&this.el.components.haptics__weapon.pulse()}}),window.AFRAME){const t=["haptics-weapons"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){const r=!!AFRAME.utils.getUrlParameter("headfist");if(AFRAME.registerComponent("headfist",{schema:{hand:{type:"string"},isPlaying:{default:!1}},init:function(){console.log("[headfist] "+r),r&&(this.camera=document.getElementById("camera").object3D,this.originalParent=this.el.object3D.parent)},update:function(){const e=this.el;if(r&&this.camera)return this.data.isPlaying?(this.camera.add(e.object3D),e.object3D.rotation.set(-5,0,0),e.object3D.position.set("right"===this.data.hand?.175:-.175,.15,-.2),e.components["tracked-controls"].pause(),e.components["tracked-controls-webvr"]&&e.components["tracked-controls-webvr"].pause(),void(e.components["tracked-controls-webxr"]&&e.components["tracked-controls-webxr"].pause())):void(e.object3D.parent!==this.originalParent&&(console.log("[headfist] Detach."),this.originalParent.add(e.object3D),e.components["tracked-controls-webvr"]&&e.components["tracked-controls-webvr"].play(),e.components["tracked-controls-webxr"]&&e.components["tracked-controls-webxr"].play()))}}),window.AFRAME){const t=["headfist"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("history",{schema:{challengeId:{type:"string"},songName:{type:"string"},songSubName:{type:"string"}},update:function(){const e=this.data;history.pushState("",e.songName,updateQueryParam(window.location.href,"challenge",e.challengeId)),document.title="Super Saber - "+e.songName}}),window.AFRAME){const t=["history"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("intro-song",{schema:{isPlaying:{default:!0},isSearching:{default:!1}},init:function(){this.analyserEl=document.getElementById("audioAnalyser"),this.audio=document.getElementById("introSong"),this.timeout=null},update:function(e){const t=this.audio;this.el.sceneEl.isPlaying&&(!e.isSearching&&this.data.isSearching||(!e.isPlaying&&this.data.isPlaying&&(this.analyserEl.components.audioanalyser.resumeContext(),this.analyserEl.setAttribute("audioanalyser","src",t),this.fadeInAudio()),e.isPlaying&&!this.data.isPlaying&&t.pause()))},pause:function(){this.audio.pause()},play:function(){this.fadeInAudio()},fadeInAudio:function(){if(AFRAME.utils.getUrlParameter("mute"))return;const e=this.analyserEl.components.audioanalyser.context,t=this.analyserEl.components.audioanalyser.gainNode;t.gain.setValueAtTime(0,e.currentTime),this.audio.play(),t.gain.linearRampToValueAtTime(.5,e.currentTime+.5)}}),window.AFRAME){const t=["intro-song"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("keyboard-raycastable",{dependencies:["super-keyboard"],schema:{condition:{default:""}},play:function(){this.el.components["super-keyboard"].kbImg.setAttribute("bind-toggle__raycastable",this.data.condition)}}),window.AFRAME){const t=["keyboard-raycastable"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){const r=n(103),i=n(104);n(106);const a=/(fuc)|(ass)|(nig)|(shit)|(retard)/gi;if(AFRAME.registerComponent("leaderboard",{schema:{apiKey:{type:"string"},authDomain:{type:"string"},databaseURL:{type:"string"},projectId:{type:"string"},storageBucket:{type:"string"},messagingSenderId:{type:"string"},challengeId:{default:""},difficulty:{default:""},beatmapCharacteristic:{default:""},inVR:{default:!1},gameMode:{type:"string"},menuSelectedChallengeId:{default:""},isVictory:{default:!1}},init:function(){this.qualifyingIndex=void 0,this.scores=[],this.eventDetail={scores:this.scores},this.addEventDetail={scoreData:void 0,index:void 0},this.username=localStorage.getItem("threewsusername")||"Super Zealot",this.el.addEventListener("leaderboardusername",e=>{this.username=e.detail.value,localStorage.setItem("threewsusername",this.username)}),this.el.addEventListener("leaderboardsubmit",this.addScore.bind(this))},update:function(e){!r.apps.length&&this.data.apiKey&&(r.initializeApp({apiKey:this.data.apiKey,authDomain:this.data.authDomain,databaseURL:this.data.databaseURL,projectId:this.data.projectId,storageBucket:this.data.storageBucket,messagingSenderId:this.data.messagingSenderId}),this.firestore=r.firestore(),this.firestore.settings({}),this.db=this.firestore.collection("scores")),!e.isVictory&&this.data.isVictory&&this.checkLeaderboardQualify(),this.data.difficulty&&e.difficulty!==this.data.difficulty||this.data.menuSelectedChallengeId&&e.menuSelectedChallengeId!==this.data.menuSelectedChallengeId?this.fetchScores(this.data.menuSelectedChallengeId):this.data.challengeId&&e.challengeId!==this.data.challengeId&&this.fetchScores(this.data.challengeId)},addScore:function(){const e=this.el.sceneEl.systems.state.state;if(!e.isVictory||!e.inVR)return;const t={accuracy:e.score.accuracy,challengeId:e.challenge.id,gameMode:this.data.gameMode,score:e.score.score,username:this.username,difficulty:this.data.difficulty||e.challenge.difficulty,time:new Date};i.includes(this.username.toLowerCase())||this.username.match(a)||this.db.add(t),this.addEventDetail.scoreData=t,this.el.emit("leaderboardscoreadded",this.addEventDetail,!1)},fetchScores:function(e){if("ride"===this.data.gameMode)return;const t=this.el.sceneEl.systems.state.state;this.db.where("challengeId","==",e).where("difficulty","==",t.menuSelectedChallenge.id?t.menuSelectedChallenge.difficulty:t.challenge.difficulty).where("gameMode","==",this.data.gameMode).orderBy("score","desc").orderBy("time","asc").limit(10).get().then(t=>{this.eventDetail.challengeId=e,this.scores.length=0,t.empty||t.forEach(e=>this.scores.push(e.data())),this.el.sceneEl.emit("leaderboard",this.eventDetail,!1)}).catch(e=>{console.error("[firestore]",e)})},checkLeaderboardQualify:function(){const e=this.el.sceneEl.systems.state.state.score.score;if(!AFRAME.utils.getUrlParameter("dot")){if(this.scores.length<10)return this.qualifyingIndex=this.scores.length,void this.el.sceneEl.emit("leaderboardqualify",this.scores.length,!1);for(let t=0;t<this.scores.length;t++)if(e>this.scores[t].score)return this.qualifyingIndex=t,void this.el.sceneEl.emit("leaderboardqualify",t,!1)}}}),window.AFRAME){const t=["leaderboard"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){"use strict";var r,i=(r=n(22))&&"object"==typeof r&&"default"in r?r.default:r;
/**
* @license
* Copyright 2018 Google LLC
@@ -1289,7 +1289,7 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
-var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function i(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}var a,o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:{},s=s||{},c=o||self;function l(){}function u(e){var t=typeof e;return"object"!=t?t:e?Array.isArray(e)?"array":t:"null"}function h(e){var t=u(e);return"array"==t||"object"==t&&"number"==typeof e.length}function d(e){var t=typeof e;return"object"==t&&null!=e||"function"==t}var p="closure_uid_"+(1e9*Math.random()>>>0),f=0;function m(e,t,n){return e.call.apply(e.bind,arguments)}function g(e,t,n){if(!e)throw Error();if(2<arguments.length){var r=Array.prototype.slice.call(arguments,2);return function(){var n=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(n,r),e.apply(t,n)}}return function(){return e.apply(t,arguments)}}function y(e,t,n){return(y=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?m:g).apply(null,arguments)}function v(e,t){var n=Array.prototype.slice.call(arguments,1);return function(){var t=n.slice();return t.push.apply(t,arguments),e.apply(this,t)}}var b=Date.now;function w(e,t){function n(){}n.prototype=t.prototype,e.S=t.prototype,e.prototype=new n,e.prototype.constructor=e}function A(){this.j=this.j,this.i=this.i}A.prototype.j=!1,A.prototype.ja=function(){if(!this.j&&(this.j=!0,this.G(),0))(function(e){Object.prototype.hasOwnProperty.call(e,p)&&e[p]||(e[p]=++f)})(this)},A.prototype.G=function(){if(this.i)for(;this.i.length;)this.i.shift()()};var E=Array.prototype.indexOf?function(e,t){return Array.prototype.indexOf.call(e,t,void 0)}:function(e,t){if("string"==typeof e)return"string"!=typeof t||1!=t.length?-1:e.indexOf(t,0);for(var n=0;n<e.length;n++)if(n in e&&e[n]===t)return n;return-1},x=Array.prototype.forEach?function(e,t,n){Array.prototype.forEach.call(e,t,n)}:function(e,t,n){for(var r=e.length,i="string"==typeof e?e.split(""):e,a=0;a<r;a++)a in i&&t.call(n,i[a],a,e)};function _(e){return Array.prototype.concat.apply([],arguments)}function S(e){var t=e.length;if(0<t){for(var n=Array(t),r=0;r<t;r++)n[r]=e[r];return n}return[]}function M(e){return/^[\s\xa0]*$/.test(e)}var T,R=String.prototype.trim?function(e){return e.trim()}:function(e){return/^[\s\xa0]*([\s\S]*?)[\s\xa0]*$/.exec(e)[1]};function k(e,t){return-1!=e.indexOf(t)}function C(e,t){return e<t?-1:e>t?1:0}e:{var O=c.navigator;if(O){var P=O.userAgent;if(P){T=P;break e}}T=""}function I(e,t,n){for(var r in e)t.call(n,e[r],r,e)}function N(e){var t={};for(var n in e)t[n]=e[n];return t}var L="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function D(e,t){for(var n,r,i=1;i<arguments.length;i++){for(n in r=arguments[i])e[n]=r[n];for(var a=0;a<L.length;a++)n=L[a],Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}}function F(e){return F[" "](e),e}F[" "]=l;var j,U,B=k(T,"Opera"),V=k(T,"Trident")||k(T,"MSIE"),z=k(T,"Edge"),H=z||V,G=k(T,"Gecko")&&!(k(T.toLowerCase(),"webkit")&&!k(T,"Edge"))&&!(k(T,"Trident")||k(T,"MSIE"))&&!k(T,"Edge"),q=k(T.toLowerCase(),"webkit")&&!k(T,"Edge");function W(){var e=c.document;return e?e.documentMode:void 0}e:{var J="",Z=(U=T,G?/rv:([^\);]+)(\)|;)/.exec(U):z?/Edge\/([\d\.]+)/.exec(U):V?/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(U):q?/WebKit\/(\S+)/.exec(U):B?/(?:Version)[ \/]?(\S+)/.exec(U):void 0);if(Z&&(J=Z?Z[1]:""),V){var X=W();if(null!=X&&X>parseFloat(J)){j=String(X);break e}}j=J}var Y,K={};function Q(e){return function(e,t){var n=K;return Object.prototype.hasOwnProperty.call(n,e)?n[e]:n[e]=t(e)}(e,(function(){for(var t=0,n=R(String(j)).split("."),r=R(String(e)).split("."),i=Math.max(n.length,r.length),a=0;0==t&&a<i;a++){var o=n[a]||"",s=r[a]||"";do{if(o=/(\d*)(\D*)(.*)/.exec(o)||["","","",""],s=/(\d*)(\D*)(.*)/.exec(s)||["","","",""],0==o[0].length&&0==s[0].length)break;t=C(0==o[1].length?0:parseInt(o[1],10),0==s[1].length?0:parseInt(s[1],10))||C(0==o[2].length,0==s[2].length)||C(o[2],s[2]),o=o[3],s=s[3]}while(0==t)}return 0<=t}))}if(c.document&&V){var $=W();Y=$||(parseInt(j,10)||void 0)}else Y=void 0;var ee=Y,te=!V||9<=Number(ee),ne=V&&!Q("9"),re=function(){if(!c.addEventListener||!Object.defineProperty)return!1;var e=!1,t=Object.defineProperty({},"passive",{get:function(){e=!0}});try{c.addEventListener("test",l,t),c.removeEventListener("test",l,t)}catch(e){}return e}();function ie(e,t){this.type=e,this.a=this.target=t,this.defaultPrevented=!1}function ae(e,t){if(ie.call(this,e?e.type:""),this.relatedTarget=this.a=this.target=null,this.button=this.screenY=this.screenX=this.clientY=this.clientX=0,this.key="",this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1,this.pointerId=0,this.pointerType="",this.c=null,e){var n=this.type=e.type,r=e.changedTouches&&e.changedTouches.length?e.changedTouches[0]:null;if(this.target=e.target||e.srcElement,this.a=t,t=e.relatedTarget){if(G){e:{try{F(t.nodeName);var i=!0;break e}catch(e){}i=!1}i||(t=null)}}else"mouseover"==n?t=e.fromElement:"mouseout"==n&&(t=e.toElement);this.relatedTarget=t,r?(this.clientX=void 0!==r.clientX?r.clientX:r.pageX,this.clientY=void 0!==r.clientY?r.clientY:r.pageY,this.screenX=r.screenX||0,this.screenY=r.screenY||0):(this.clientX=void 0!==e.clientX?e.clientX:e.pageX,this.clientY=void 0!==e.clientY?e.clientY:e.pageY,this.screenX=e.screenX||0,this.screenY=e.screenY||0),this.button=e.button,this.key=e.key||"",this.ctrlKey=e.ctrlKey,this.altKey=e.altKey,this.shiftKey=e.shiftKey,this.metaKey=e.metaKey,this.pointerId=e.pointerId||0,this.pointerType="string"==typeof e.pointerType?e.pointerType:oe[e.pointerType]||"",this.c=e,e.defaultPrevented&&this.b()}}ie.prototype.b=function(){this.defaultPrevented=!0},w(ae,ie);var oe={2:"touch",3:"pen",4:"mouse"};ae.prototype.b=function(){ae.S.b.call(this);var e=this.c;if(e.preventDefault)e.preventDefault();else if(e.returnValue=!1,ne)try{(e.ctrlKey||112<=e.keyCode&&123>=e.keyCode)&&(e.keyCode=-1)}catch(e){}};var se="closure_listenable_"+(1e6*Math.random()|0),ce=0;function le(e,t,n,r,i){this.listener=e,this.proxy=null,this.src=t,this.type=n,this.capture=!!r,this.ca=i,this.key=++ce,this.Y=this.Z=!1}function ue(e){e.Y=!0,e.listener=null,e.proxy=null,e.src=null,e.ca=null}function he(e){this.src=e,this.a={},this.b=0}function de(e,t){var n=t.type;if(n in e.a){var r,i=e.a[n],a=E(i,t);(r=0<=a)&&Array.prototype.splice.call(i,a,1),r&&(ue(t),0==e.a[n].length&&(delete e.a[n],e.b--))}}function pe(e,t,n,r){for(var i=0;i<e.length;++i){var a=e[i];if(!a.Y&&a.listener==t&&a.capture==!!n&&a.ca==r)return i}return-1}he.prototype.add=function(e,t,n,r,i){var a=e.toString();(e=this.a[a])||(e=this.a[a]=[],this.b++);var o=pe(e,t,r,i);return-1<o?(t=e[o],n||(t.Z=!1)):((t=new le(t,this.src,a,!!r,i)).Z=n,e.push(t)),t};var fe="closure_lm_"+(1e6*Math.random()|0),me={};function ge(e,t,n,r,i){if(r&&r.once)return function e(t,n,r,i,a){if(Array.isArray(n)){for(var o=0;o<n.length;o++)e(t,n[o],r,i,a);return null}return r=_e(r),t&&t[se]?t.wa(n,r,d(i)?!!i.capture:!!i,a):ye(t,n,r,!0,i,a)}(e,t,n,r,i);if(Array.isArray(t)){for(var a=0;a<t.length;a++)ge(e,t[a],n,r,i);return null}return n=_e(n),e&&e[se]?e.va(t,n,d(r)?!!r.capture:!!r,i):ye(e,t,n,!1,r,i)}function ye(e,t,n,r,i,a){if(!t)throw Error("Invalid event type");var o=d(i)?!!i.capture:!!i;if(o&&!te)return null;var s=Ee(e);if(s||(e[fe]=s=new he(e)),(n=s.add(t,n,r,o,a)).proxy)return n;if(r=function(){var e=Ae,t=te?function(n){return e.call(t.src,t.listener,n)}:function(n){if(!(n=e.call(t.src,t.listener,n)))return n};return t}(),n.proxy=r,r.src=e,r.listener=n,e.addEventListener)re||(i=o),void 0===i&&(i=!1),e.addEventListener(t.toString(),r,i);else if(e.attachEvent)e.attachEvent(be(t.toString()),r);else{if(!e.addListener||!e.removeListener)throw Error("addEventListener and attachEvent are unavailable.");e.addListener(r)}return n}function ve(e){if("number"!=typeof e&&e&&!e.Y){var t=e.src;if(t&&t[se])de(t.c,e);else{var n=e.type,r=e.proxy;t.removeEventListener?t.removeEventListener(n,r,e.capture):t.detachEvent?t.detachEvent(be(n),r):t.addListener&&t.removeListener&&t.removeListener(r),(n=Ee(t))?(de(n,e),0==n.b&&(n.src=null,t[fe]=null)):ue(e)}}}function be(e){return e in me?me[e]:me[e]="on"+e}function we(e,t){var n=e.listener,r=e.ca||e.src;return e.Z&&ve(e),n.call(r,t)}function Ae(e,t){if(e.Y)return!0;if(!te){if(!t)e:{t=["window","event"];for(var n=c,r=0;r<t.length;r++)if(null==(n=n[t[r]])){t=null;break e}t=n}return we(e,t=new ae(t,this))}return we(e,new ae(t,this))}function Ee(e){return(e=e[fe])instanceof he?e:null}var xe="__closure_events_fn_"+(1e9*Math.random()>>>0);function _e(e){return"function"==u(e)?e:(e[xe]||(e[xe]=function(t){return e.handleEvent(t)}),e[xe])}function Se(){A.call(this),this.c=new he(this),this.J=this,this.C=null}function Me(e,t,n,r){if(!(t=e.c.a[String(t)]))return!0;t=t.concat();for(var i=!0,a=0;a<t.length;++a){var o=t[a];if(o&&!o.Y&&o.capture==n){var s=o.listener,c=o.ca||o.src;o.Z&&de(e.c,o),i=!1!==s.call(c,r)&&i}}return i&&!r.defaultPrevented}w(Se,A),Se.prototype[se]=!0,(a=Se.prototype).addEventListener=function(e,t,n,r){ge(this,e,t,n,r)},a.removeEventListener=function(e,t,n,r){!function e(t,n,r,i,a){if(Array.isArray(n))for(var o=0;o<n.length;o++)e(t,n[o],r,i,a);else i=d(i)?!!i.capture:!!i,r=_e(r),t&&t[se]?(t=t.c,(n=String(n).toString())in t.a&&(-1<(r=pe(o=t.a[n],r,i,a))&&(ue(o[r]),Array.prototype.splice.call(o,r,1),0==o.length&&(delete t.a[n],t.b--)))):t&&(t=Ee(t))&&(n=t.a[n.toString()],t=-1,n&&(t=pe(n,r,i,a)),(r=-1<t?n[t]:null)&&ve(r))}(this,e,t,n,r)},a.dispatchEvent=function(e){var t,n=this.C;if(n)for(t=[];n;n=n.C)t.push(n);n=this.J;var r=e.type||e;if("string"==typeof e)e=new ie(e,n);else if(e instanceof ie)e.target=e.target||n;else{var i=e;D(e=new ie(r,n),i)}if(i=!0,t)for(var a=t.length-1;0<=a;a--){var o=e.a=t[a];i=Me(o,r,!0,e)&&i}if(i=Me(o=e.a=n,r,!0,e)&&i,i=Me(o,r,!1,e)&&i,t)for(a=0;a<t.length;a++)i=Me(o=e.a=t[a],r,!1,e)&&i;return i},a.G=function(){if(Se.S.G.call(this),this.c){var e,t=this.c;for(e in t.a){for(var n=t.a[e],r=0;r<n.length;r++)ue(n[r]);delete t.a[e],t.b--}}this.C=null},a.va=function(e,t,n,r){return this.c.add(String(e),t,!1,n,r)},a.wa=function(e,t,n,r){return this.c.add(String(e),t,!0,n,r)};var Te=c.JSON.stringify;function Re(){this.b=this.a=null}var ke,Ce=new(function(){function e(e,t,n){this.f=n,this.c=e,this.g=t,this.b=0,this.a=null}return e.prototype.get=function(){var e;return 0<this.b?(this.b--,e=this.a,this.a=e.next,e.next=null):e=this.c(),e},e}())((function(){return new Pe}),(function(e){e.reset()}),100);function Oe(){var e=De,t=null;return e.a&&(t=e.a,e.a=e.a.next,e.a||(e.b=null),t.next=null),t}function Pe(){this.next=this.b=this.a=null}function Ie(e){c.setTimeout((function(){throw e}),0)}function Ne(e,t){ke||function(){var e=c.Promise.resolve(void 0);ke=function(){e.then(Fe)}}(),Le||(ke(),Le=!0),De.add(e,t)}Re.prototype.add=function(e,t){var n=Ce.get();n.set(e,t),this.b?this.b.next=n:this.a=n,this.b=n},Pe.prototype.set=function(e,t){this.a=e,this.b=t,this.next=null},Pe.prototype.reset=function(){this.next=this.b=this.a=null};var Le=!1,De=new Re;function Fe(){for(var e;e=Oe();){try{e.a.call(e.b)}catch(e){Ie(e)}var t=Ce;t.g(e),t.b<t.f&&(t.b++,e.next=t.a,t.a=e)}Le=!1}function je(e,t){Se.call(this),this.b=e||1,this.a=t||c,this.f=y(this.Ya,this),this.g=b()}function Ue(e){e.aa=!1,e.M&&(e.a.clearTimeout(e.M),e.M=null)}function Be(e,t,n){if("function"==u(e))n&&(e=y(e,n));else{if(!e||"function"!=typeof e.handleEvent)throw Error("Invalid listener argument");e=y(e.handleEvent,e)}return 2147483647<Number(t)?-1:c.setTimeout(e,t||0)}function Ve(e){e.a=Be((function(){e.a=null,e.c&&(e.c=!1,Ve(e))}),e.h);var t=e.b;e.b=null,e.g.apply(null,t)}w(je,Se),(a=je.prototype).aa=!1,a.M=null,a.Ya=function(){if(this.aa){var e=b()-this.g;0<e&&e<.8*this.b?this.M=this.a.setTimeout(this.f,this.b-e):(this.M&&(this.a.clearTimeout(this.M),this.M=null),this.dispatchEvent("tick"),this.aa&&(Ue(this),this.start()))}},a.start=function(){this.aa=!0,this.M||(this.M=this.a.setTimeout(this.f,this.b),this.g=b())},a.G=function(){je.S.G.call(this),Ue(this),delete this.a};var ze=function(e){function t(t,n,r){var i=e.call(this)||this;return i.g=null!=r?t.bind(r):t,i.h=n,i.b=null,i.c=!1,i.a=null,i}return function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t.prototype.f=function(e){this.b=arguments,this.a?this.c=!0:Ve(this)},t.prototype.G=function(){e.prototype.G.call(this),this.a&&(c.clearTimeout(this.a),this.a=null,this.c=!1,this.b=null)},t}(A);function He(e){A.call(this),this.b=e,this.a={}}w(He,A);var Ge=[];function qe(e,t,n,r){Array.isArray(n)||(n&&(Ge[0]=n.toString()),n=Ge);for(var i=0;i<n.length;i++){var a=ge(t,n[i],r||e.handleEvent,!1,e.b||e);if(!a)break;e.a[a.key]=a}}function We(e){I(e.a,(function(e,t){this.a.hasOwnProperty(t)&&ve(e)}),e),e.a={}}function Je(){this.a=!0}function Ze(e,t,n,r){e.info((function(){return"XMLHTTP TEXT ("+t+"): "+function(e,t){if(!e.a)return t;if(!t)return null;try{var n=JSON.parse(t);if(n)for(e=0;e<n.length;e++)if(Array.isArray(n[e])){var r=n[e];if(!(2>r.length)){var i=r[1];if(Array.isArray(i)&&!(1>i.length)){var a=i[0];if("noop"!=a&&"stop"!=a&&"close"!=a)for(var o=1;o<i.length;o++)i[o]=""}}}return Te(n)}catch(e){return t}}(e,n)+(r?" "+r:"")}))}He.prototype.G=function(){He.S.G.call(this),We(this)},He.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented")},Je.prototype.info=function(){};var Xe=null;function Ye(){return Xe=Xe||new Se}function Ke(e){ie.call(this,"serverreachability",e)}function Qe(e){var t=Ye();t.dispatchEvent(new Ke(t,e))}function $e(e){ie.call(this,"statevent",e)}function et(e){var t=Ye();t.dispatchEvent(new $e(t,e))}function tt(e){ie.call(this,"timingevent",e)}function nt(e,t){if("function"!=u(e))throw Error("Fn must not be null and must be a function");return c.setTimeout((function(){e()}),t)}w(Ke,ie),w($e,ie),w(tt,ie);var rt={NO_ERROR:0,Za:1,gb:2,fb:3,bb:4,eb:5,hb:6,Da:7,TIMEOUT:8,kb:9},it={ab:"complete",ob:"success",Ea:"error",Da:"abort",mb:"ready",nb:"readystatechange",TIMEOUT:"timeout",ib:"incrementaldata",lb:"progress",cb:"downloadprogress",pb:"uploadprogress"};function at(){}function ot(e){var t;return(t=e.a)||(t=e.a={}),t}function st(){}at.prototype.a=null;var ct,lt={OPEN:"a",$a:"b",Ea:"c",jb:"d"};function ut(){ie.call(this,"d")}function ht(){ie.call(this,"c")}function dt(){}function pt(e,t,n,r){this.g=e,this.c=t,this.f=n,this.T=r||1,this.J=new He(this),this.P=ft,e=H?125:void 0,this.R=new je(e),this.B=null,this.b=!1,this.j=this.l=this.i=this.H=this.u=this.U=this.o=null,this.s=[],this.a=null,this.D=0,this.h=this.m=null,this.N=-1,this.A=!1,this.O=0,this.F=null,this.W=this.C=this.V=this.I=!1}w(ut,ie),w(ht,ie),w(dt,at),ct=new dt;var ft=45e3,mt={},gt={};function yt(e,t,n){e.H=1,e.i=Ut(It(t)),e.j=n,e.I=!0,vt(e,null)}function vt(e,t){e.u=b(),At(e),e.l=It(e.i);var n=e.l,r=e.T;Array.isArray(r)||(r=[String(r)]),Qt(n.b,"t",r),e.D=0,e.a=Jn(e.g,e.g.C?t:null),0<e.O&&(e.F=new ze(y(e.Ca,e,e.a),e.O)),qe(e.J,e.a,"readystatechange",e.Wa),t=e.B?N(e.B):{},e.j?(e.m||(e.m="POST"),t["Content-Type"]="application/x-www-form-urlencoded",e.a.ba(e.l,e.m,e.j,t)):(e.m="GET",e.a.ba(e.l,e.m,null,t)),Qe(1),function(e,t,n,r,i,a){e.info((function(){if(e.a)if(a)for(var o="",s=a.split("&"),c=0;c<s.length;c++){var l=s[c].split("=");if(1<l.length){var u=l[0];l=l[1];var h=u.split("_");o=2<=h.length&&"type"==h[1]?o+(u+"=")+l+"&":o+(u+"=redacted&")}}else o=null;else o=a;return"XMLHTTP REQ ("+r+") [attempt "+i+"]: "+t+"\n"+n+"\n"+o}))}(e.c,e.m,e.l,e.f,e.T,e.j)}function bt(e,t,n){for(var r=!0;!e.A&&e.D<n.length;){var i=wt(e,n);if(i==gt){4==t&&(e.h=4,et(14),r=!1),Ze(e.c,e.f,null,"[Incomplete Response]");break}if(i==mt){e.h=4,et(15),Ze(e.c,e.f,n,"[Invalid Chunk]"),r=!1;break}Ze(e.c,e.f,i,null),Mt(e,i)}4==t&&0==n.length&&(e.h=1,et(16),r=!1),e.b=e.b&&r,r?0<n.length&&!e.W&&(e.W=!0,(t=e.g).a==e&&t.V&&!t.F&&(t.c.info("Great, no buffering proxy detected. Bytes received: "+n.length),Un(t),t.F=!0)):(Ze(e.c,e.f,n,"[Invalid Chunked Response]"),St(e),_t(e))}function wt(e,t){var n=e.D,r=t.indexOf("\n",n);return-1==r?gt:(n=Number(t.substring(n,r)),isNaN(n)?mt:(r+=1)+n>t.length?gt:(t=t.substr(r,n),e.D=r+n,t))}function At(e){e.U=b()+e.P,Et(e,e.P)}function Et(e,t){if(null!=e.o)throw Error("WatchDog timer not null");e.o=nt(y(e.Ua,e),t)}function xt(e){e.o&&(c.clearTimeout(e.o),e.o=null)}function _t(e){0==e.g.v||e.A||zn(e.g,e)}function St(e){xt(e);var t=e.F;t&&"function"==typeof t.ja&&t.ja(),e.F=null,Ue(e.R),We(e.J),e.a&&(t=e.a,e.a=null,t.abort(),t.ja())}function Mt(e,t){try{var n=e.g;if(0!=n.v&&(n.a==e||on(n.b,e)))if(n.I=e.N,!e.C&&on(n.b,e)&&3==n.v){try{var r=n.ka.a.parse(t)}catch(e){r=null}if(Array.isArray(r)&&3==r.length){var i=r;if(0==i[0]){e:if(!n.j){if(n.a){if(!(n.a.u+3e3<e.u))break e;Vn(n),Cn(n)}jn(n),et(18)}}else n.oa=i[1],0<n.oa-n.P&&37500>i[2]&&n.H&&0==n.o&&!n.m&&(n.m=nt(y(n.Ra,n),6e3));if(1>=an(n.b)&&n.ea){try{n.ea()}catch(e){}n.ea=void 0}}else Gn(n,11)}else if((e.C||n.a==e)&&Vn(n),!M(t))for(t=r=n.ka.a.parse(t),r=0;r<t.length;r++)if(i=t[r],n.P=i[0],i=i[1],2==n.v)if("c"==i[0]){n.J=i[1],n.ga=i[2];var a=i[3];null!=a&&(n.ha=a,n.c.info("VER="+n.ha));var o=i[4];null!=o&&(n.pa=o,n.c.info("SVER="+n.pa));var s=i[5];if(null!=s&&"number"==typeof s&&0<s){var c=1.5*s;n.D=c,n.c.info("backChannelRequestTimeoutMs_="+c)}c=n;var l=e.a;if(l){var u=l.a?l.a.getResponseHeader("X-Client-Wire-Protocol"):null;if(u){var h=c.b;!h.a&&(k(u,"spdy")||k(u,"quic")||k(u,"h2"))&&(h.f=h.g,h.a=new Set,h.b&&(sn(h,h.b),h.b=null))}if(c.A){var d=l.a?l.a.getResponseHeader("X-HTTP-Session-Id"):null;d&&(c.na=d,jt(c.B,c.A,d))}}n.v=3,n.f&&n.f.ta(),n.V&&(n.N=b()-e.u,n.c.info("Handshake RTT: "+n.N+"ms"));var p=e;if((c=n).la=Wn(c,c.C?c.ga:null,c.fa),p.C){cn(c.b,p);var f=p,m=c.D;m&&f.setTimeout(m),f.o&&(xt(f),At(f)),c.a=p}else Fn(c);0<n.g.length&&In(n)}else"stop"!=i[0]&&"close"!=i[0]||Gn(n,7);else 3==n.v&&("stop"==i[0]||"close"==i[0]?"stop"==i[0]?Gn(n,7):kn(n):"noop"!=i[0]&&n.f&&n.f.sa(i),n.o=0);Qe(4)}catch(e){}}function Tt(e,t){if(e.forEach&&"function"==typeof e.forEach)e.forEach(t,void 0);else if(h(e)||"string"==typeof e)x(e,t,void 0);else{if(e.L&&"function"==typeof e.L)var n=e.L();else if(e.K&&"function"==typeof e.K)n=void 0;else if(h(e)||"string"==typeof e){n=[];for(var r=e.length,i=0;i<r;i++)n.push(i)}else for(i in n=[],r=0,e)n[r++]=i;i=(r=function(e){if(e.K&&"function"==typeof e.K)return e.K();if("string"==typeof e)return e.split("");if(h(e)){for(var t=[],n=e.length,r=0;r<n;r++)t.push(e[r]);return t}for(r in t=[],n=0,e)t[n++]=e[r];return t}(e)).length;for(var a=0;a<i;a++)t.call(void 0,r[a],n&&n[a],e)}}function Rt(e,t){this.b={},this.a=[],this.c=0;var n=arguments.length;if(1<n){if(n%2)throw Error("Uneven number of arguments");for(var r=0;r<n;r+=2)this.set(arguments[r],arguments[r+1])}else if(e)if(e instanceof Rt)for(n=e.L(),r=0;r<n.length;r++)this.set(n[r],e.get(n[r]));else for(r in e)this.set(r,e[r])}function kt(e){if(e.c!=e.a.length){for(var t=0,n=0;t<e.a.length;){var r=e.a[t];Ct(e.b,r)&&(e.a[n++]=r),t++}e.a.length=n}if(e.c!=e.a.length){var i={};for(n=t=0;t<e.a.length;)Ct(i,r=e.a[t])||(e.a[n++]=r,i[r]=1),t++;e.a.length=n}}function Ct(e,t){return Object.prototype.hasOwnProperty.call(e,t)}(a=pt.prototype).setTimeout=function(e){this.P=e},a.Wa=function(e){e=e.target;var t=this.F;t&&3==Sn(e)?t.f():this.Ca(e)},a.Ca=function(e){try{if(e==this.a)e:{var t=Sn(this.a),n=this.a.ua(),r=this.a.X();if(!(3>t||3==t&&!H&&!this.a.$())){this.A||4!=t||7==n||Qe(8==n||0>=r?3:2),xt(this);var i=this.a.X();this.N=i;var a=this.a.$();if(this.b=200==i,function(e,t,n,r,i,a,o){e.info((function(){return"XMLHTTP RESP ("+r+") [ attempt "+i+"]: "+t+"\n"+n+"\n"+a+" "+o}))}(this.c,this.m,this.l,this.f,this.T,t,i),this.b){if(this.V&&!this.C){t:{if(this.a){var o,s=this.a;if((o=s.a?s.a.getResponseHeader("X-HTTP-Initial-Response"):null)&&!M(o)){var c=o;break t}}c=null}if(!c){this.b=!1,this.h=3,et(12),St(this),_t(this);break e}Ze(this.c,this.f,c,"Initial handshake response via X-HTTP-Initial-Response"),this.C=!0,Mt(this,c)}this.I?(bt(this,t,a),H&&this.b&&3==t&&(qe(this.J,this.R,"tick",this.Va),this.R.start())):(Ze(this.c,this.f,a,null),Mt(this,a)),4==t&&St(this),this.b&&!this.A&&(4==t?zn(this.g,this):(this.b=!1,At(this)))}else 400==i&&0<a.indexOf("Unknown SID")?(this.h=3,et(12)):(this.h=0,et(13)),St(this),_t(this)}}}catch(e){}},a.Va=function(){if(this.a){var e=Sn(this.a),t=this.a.$();this.D<t.length&&(xt(this),bt(this,e,t),this.b&&4!=e&&At(this))}},a.cancel=function(){this.A=!0,St(this)},a.Ua=function(){this.o=null;var e=b();0<=e-this.U?(function(e,t){e.info((function(){return"TIMEOUT: "+t}))}(this.c,this.l),2!=this.H&&(Qe(3),et(17)),St(this),this.h=2,_t(this)):Et(this,this.U-e)},(a=Rt.prototype).K=function(){kt(this);for(var e=[],t=0;t<this.a.length;t++)e.push(this.b[this.a[t]]);return e},a.L=function(){return kt(this),this.a.concat()},a.get=function(e,t){return Ct(this.b,e)?this.b[e]:t},a.set=function(e,t){Ct(this.b,e)||(this.c++,this.a.push(e)),this.b[e]=t},a.forEach=function(e,t){for(var n=this.L(),r=0;r<n.length;r++){var i=n[r],a=this.get(i);e.call(t,a,i,this)}};var Ot=/^(?:([^:/?#.]+):)?(?:\/\/(?:([^\\/?#]*)@)?([^\\/?#]*?)(?::([0-9]+))?(?=[\\/?#]|$))?([^?#]+)?(?:\?([^#]*))?(?:#([\s\S]*))?$/;function Pt(e,t){if(this.c=this.j=this.f="",this.h=null,this.i=this.g="",this.a=!1,e instanceof Pt){this.a=void 0!==t?t:e.a,Nt(this,e.f),this.j=e.j,Lt(this,e.c),Dt(this,e.h),this.g=e.g,t=e.b;var n=new Zt;n.c=t.c,t.a&&(n.a=new Rt(t.a),n.b=t.b),Ft(this,n),this.i=e.i}else e&&(n=String(e).match(Ot))?(this.a=!!t,Nt(this,n[1]||"",!0),this.j=Bt(n[2]||""),Lt(this,n[3]||"",!0),Dt(this,n[4]),this.g=Bt(n[5]||"",!0),Ft(this,n[6]||"",!0),this.i=Bt(n[7]||"")):(this.a=!!t,this.b=new Zt(null,this.a))}function It(e){return new Pt(e)}function Nt(e,t,n){e.f=n?Bt(t,!0):t,e.f&&(e.f=e.f.replace(/:$/,""))}function Lt(e,t,n){e.c=n?Bt(t,!0):t}function Dt(e,t){if(t){if(t=Number(t),isNaN(t)||0>t)throw Error("Bad port number "+t);e.h=t}else e.h=null}function Ft(e,t,n){t instanceof Zt?(e.b=t,function(e,t){t&&!e.f&&(Xt(e),e.c=null,e.a.forEach((function(e,t){var n=t.toLowerCase();t!=n&&(Yt(this,t),Qt(this,n,e))}),e)),e.f=t}(e.b,e.a)):(n||(t=Vt(t,Wt)),e.b=new Zt(t,e.a))}function jt(e,t,n){e.b.set(t,n)}function Ut(e){return jt(e,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^b()).toString(36)),e}function Bt(e,t){return e?t?decodeURI(e.replace(/%25/g,"%2525")):decodeURIComponent(e):""}function Vt(e,t,n){return"string"==typeof e?(e=encodeURI(e).replace(t,zt),n&&(e=e.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),e):null}function zt(e){return"%"+((e=e.charCodeAt(0))>>4&15).toString(16)+(15&e).toString(16)}Pt.prototype.toString=function(){var e=[],t=this.f;t&&e.push(Vt(t,Ht,!0),":");var n=this.c;return(n||"file"==t)&&(e.push("//"),(t=this.j)&&e.push(Vt(t,Ht,!0),"@"),e.push(encodeURIComponent(String(n)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),null!=(n=this.h)&&e.push(":",String(n))),(n=this.g)&&(this.c&&"/"!=n.charAt(0)&&e.push("/"),e.push(Vt(n,"/"==n.charAt(0)?qt:Gt,!0))),(n=this.b.toString())&&e.push("?",n),(n=this.i)&&e.push("#",Vt(n,Jt)),e.join("")};var Ht=/[#\/\?@]/g,Gt=/[#\?:]/g,qt=/[#\?]/g,Wt=/[#\?@]/g,Jt=/#/g;function Zt(e,t){this.b=this.a=null,this.c=e||null,this.f=!!t}function Xt(e){e.a||(e.a=new Rt,e.b=0,e.c&&function(e,t){if(e){e=e.split("&");for(var n=0;n<e.length;n++){var r=e[n].indexOf("="),i=null;if(0<=r){var a=e[n].substring(0,r);i=e[n].substring(r+1)}else a=e[n];t(a,i?decodeURIComponent(i.replace(/\+/g," ")):"")}}}(e.c,(function(t,n){e.add(decodeURIComponent(t.replace(/\+/g," ")),n)})))}function Yt(e,t){Xt(e),t=$t(e,t),Ct(e.a.b,t)&&(e.c=null,e.b-=e.a.get(t).length,Ct((e=e.a).b,t)&&(delete e.b[t],e.c--,e.a.length>2*e.c&&kt(e)))}function Kt(e,t){return Xt(e),t=$t(e,t),Ct(e.a.b,t)}function Qt(e,t,n){Yt(e,t),0<n.length&&(e.c=null,e.a.set($t(e,t),S(n)),e.b+=n.length)}function $t(e,t){return t=String(t),e.f&&(t=t.toLowerCase()),t}function en(e,t){this.b=e,this.a=t}function tn(e){this.g=e||nn,c.PerformanceNavigationTiming?e=0<(e=c.performance.getEntriesByType("navigation")).length&&("hq"==e[0].nextHopProtocol||"h2"==e[0].nextHopProtocol):e=!!(c.ia&&c.ia.ya&&c.ia.ya()&&c.ia.ya().qb),this.f=e?this.g:1,this.a=null,1<this.f&&(this.a=new Set),this.b=null,this.c=[]}(a=Zt.prototype).add=function(e,t){Xt(this),this.c=null,e=$t(this,e);var n=this.a.get(e);return n||this.a.set(e,n=[]),n.push(t),this.b+=1,this},a.forEach=function(e,t){Xt(this),this.a.forEach((function(n,r){x(n,(function(n){e.call(t,n,r,this)}),this)}),this)},a.L=function(){Xt(this);for(var e=this.a.K(),t=this.a.L(),n=[],r=0;r<t.length;r++)for(var i=e[r],a=0;a<i.length;a++)n.push(t[r]);return n},a.K=function(e){Xt(this);var t=[];if("string"==typeof e)Kt(this,e)&&(t=_(t,this.a.get($t(this,e))));else{e=this.a.K();for(var n=0;n<e.length;n++)t=_(t,e[n])}return t},a.set=function(e,t){return Xt(this),this.c=null,Kt(this,e=$t(this,e))&&(this.b-=this.a.get(e).length),this.a.set(e,[t]),this.b+=1,this},a.get=function(e,t){return e&&0<(e=this.K(e)).length?String(e[0]):t},a.toString=function(){if(this.c)return this.c;if(!this.a)return"";for(var e=[],t=this.a.L(),n=0;n<t.length;n++){var r=t[n],i=encodeURIComponent(String(r));r=this.K(r);for(var a=0;a<r.length;a++){var o=i;""!==r[a]&&(o+="="+encodeURIComponent(String(r[a]))),e.push(o)}}return this.c=e.join("&")};var nn=10;function rn(e){return!!e.b||!!e.a&&e.a.size>=e.f}function an(e){return e.b?1:e.a?e.a.size:0}function on(e,t){return e.b?e.b==t:!!e.a&&e.a.has(t)}function sn(e,t){e.a?e.a.add(t):e.b=t}function cn(e,t){e.b&&e.b==t?e.b=null:e.a&&e.a.has(t)&&e.a.delete(t)}function ln(e){var t,n;if(null!=e.b)return e.c.concat(e.b.s);if(null!=e.a&&0!==e.a.size){var r=e.c;try{for(var a=i(e.a.values()),o=a.next();!o.done;o=a.next()){var s=o.value;r=r.concat(s.s)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return r}return S(e.c)}function un(){}function hn(){this.a=new un}function dn(e,t,n){var r=n||"";try{Tt(e,(function(e,n){var i=e;d(e)&&(i=Te(e)),t.push(r+n+"="+encodeURIComponent(i))}))}catch(e){throw t.push(r+"type="+encodeURIComponent("_badmap")),e}}function pn(e,t,n,r,i){try{t.onload=null,t.onerror=null,t.onabort=null,t.ontimeout=null,i(r)}catch(e){}}tn.prototype.cancel=function(){var e,t;if(this.c=ln(this),this.b)this.b.cancel(),this.b=null;else if(this.a&&0!==this.a.size){try{for(var n=i(this.a.values()),r=n.next();!r.done;r=n.next()){r.value.cancel()}}catch(t){e={error:t}}finally{try{r&&!r.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}this.a.clear()}},un.prototype.stringify=function(e){return c.JSON.stringify(e,void 0)},un.prototype.parse=function(e){return c.JSON.parse(e,void 0)};var fn=c.JSON.parse;function mn(e){Se.call(this),this.headers=new Rt,this.H=e||null,this.b=!1,this.s=this.a=null,this.B="",this.h=0,this.f="",this.g=this.A=this.l=this.u=!1,this.o=0,this.m=null,this.I=gn,this.D=this.F=!1}w(mn,Se);var gn="",yn=/^https?$/i,vn=["POST","PUT"];function bn(e){return"content-type"==e.toLowerCase()}function wn(e,t){e.b=!1,e.a&&(e.g=!0,e.a.abort(),e.g=!1),e.f=t,e.h=5,An(e),xn(e)}function An(e){e.u||(e.u=!0,e.dispatchEvent("complete"),e.dispatchEvent("error"))}function En(e){if(e.b&&void 0!==s&&(!e.s[1]||4!=Sn(e)||2!=e.X()))if(e.l&&4==Sn(e))Be(e.za,0,e);else if(e.dispatchEvent("readystatechange"),4==Sn(e)){e.b=!1;try{var t,n=e.X();e:switch(n){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var r=!0;break e;default:r=!1}if(!(t=r)){var i;if(i=0===n){var a=String(e.B).match(Ot)[1]||null;if(!a&&c.self&&c.self.location){var o=c.self.location.protocol;a=o.substr(0,o.length-1)}i=!yn.test(a?a.toLowerCase():"")}t=i}if(t)e.dispatchEvent("complete"),e.dispatchEvent("success");else{e.h=6;try{var l=2<Sn(e)?e.a.statusText:""}catch(e){l=""}e.f=l+" ["+e.X()+"]",An(e)}}finally{xn(e)}}}function xn(e,t){if(e.a){_n(e);var n=e.a,r=e.s[0]?l:null;e.a=null,e.s=null,t||e.dispatchEvent("ready");try{n.onreadystatechange=r}catch(e){}}}function _n(e){e.a&&e.D&&(e.a.ontimeout=null),e.m&&(c.clearTimeout(e.m),e.m=null)}function Sn(e){return e.a?e.a.readyState:0}function Mn(e,t,n){e:{for(r in n){var r=!1;break e}r=!0}r||(n=function(e){var t="";return I(e,(function(e,n){t+=n,t+=":",t+=e,t+="\r\n"})),t}(n),"string"==typeof e?null!=n&&encodeURIComponent(String(n)):jt(e,t,n))}function Tn(e,t,n){return n&&n.internalChannelParams&&n.internalChannelParams[e]||t}function Rn(e){this.pa=0,this.g=[],this.c=new Je,this.ga=this.la=this.B=this.fa=this.a=this.na=this.A=this.W=this.i=this.O=this.l=null,this.La=this.R=0,this.Ia=Tn("failFast",!1,e),this.H=this.m=this.j=this.h=this.f=null,this.T=!0,this.I=this.oa=this.P=-1,this.U=this.o=this.u=0,this.Fa=Tn("baseRetryDelayMs",5e3,e),this.Ma=Tn("retryDelaySeedMs",1e4,e),this.Ja=Tn("forwardChannelMaxRetries",2,e),this.ma=Tn("forwardChannelRequestTimeoutMs",2e4,e),this.Ka=e&&e.g||void 0,this.D=void 0,this.C=e&&e.supportsCrossDomainXhr||!1,this.J="",this.b=new tn(e&&e.concurrentRequestLimit),this.ka=new hn,this.da=e&&e.fastHandshake||!1,this.Ga=e&&e.b||!1,e&&e.f&&(this.c.a=!1),e&&e.forceLongPolling&&(this.T=!1),this.V=!this.da&&this.T&&e&&e.c||!1,this.ea=void 0,this.N=0,this.F=!1,this.s=null}function kn(e){if(On(e),3==e.v){var t=e.R++,n=It(e.B);jt(n,"SID",e.J),jt(n,"RID",t),jt(n,"TYPE","terminate"),Ln(e,n),(t=new pt(e,e.c,t,void 0)).H=2,t.i=Ut(It(n)),n=!1,c.navigator&&c.navigator.sendBeacon&&(n=c.navigator.sendBeacon(t.i.toString(),"")),!n&&c.Image&&((new Image).src=t.i,n=!0),n||(t.a=Jn(t.g,null),t.a.ba(t.i)),t.u=b(),At(t)}qn(e)}function Cn(e){e.a&&(Un(e),e.a.cancel(),e.a=null)}function On(e){Cn(e),e.j&&(c.clearTimeout(e.j),e.j=null),Vn(e),e.b.cancel(),e.h&&("number"==typeof e.h&&c.clearTimeout(e.h),e.h=null)}function Pn(e,t){e.g.push(new en(e.La++,t)),3==e.v&&In(e)}function In(e){rn(e.b)||e.h||(e.h=!0,Ne(e.Ba,e),e.u=0)}function Nn(e,t){var n;n=t?t.f:e.R++;var r=It(e.B);jt(r,"SID",e.J),jt(r,"RID",n),jt(r,"AID",e.P),Ln(e,r),e.i&&e.l&&Mn(r,e.i,e.l),n=new pt(e,e.c,n,e.u+1),null===e.i&&(n.B=e.l),t&&(e.g=t.s.concat(e.g)),t=Dn(e,n,1e3),n.setTimeout(Math.round(.5*e.ma)+Math.round(.5*e.ma*Math.random())),sn(e.b,n),yt(n,r,t)}function Ln(e,t){e.f&&Tt({},(function(e,n){jt(t,n,e)}))}function Dn(e,t,n){n=Math.min(e.g.length,n);var r=e.f?y(e.f.Ha,e.f,e):null;e:for(var i=e.g,a=-1;;){var o=["count="+n];-1==a?0<n?(a=i[0].b,o.push("ofs="+a)):a=0:o.push("ofs="+a);for(var s=!0,c=0;c<n;c++){var l=i[c].b,u=i[c].a;if(0>(l-=a))a=Math.max(0,i[c].b-100),s=!1;else try{dn(u,o,"req"+l+"_")}catch(e){r&&r(u)}}if(s){r=o.join("&");break e}}return e=e.g.splice(0,n),t.s=e,r}function Fn(e){e.a||e.j||(e.U=1,Ne(e.Aa,e),e.o=0)}function jn(e){return!(e.a||e.j||3<=e.o)&&(e.U++,e.j=nt(y(e.Aa,e),Hn(e,e.o)),e.o++,!0)}function Un(e){null!=e.s&&(c.clearTimeout(e.s),e.s=null)}function Bn(e){e.a=new pt(e,e.c,"rpc",e.U),null===e.i&&(e.a.B=e.l),e.a.O=0;var t=It(e.la);jt(t,"RID","rpc"),jt(t,"SID",e.J),jt(t,"CI",e.H?"0":"1"),jt(t,"AID",e.P),Ln(e,t),jt(t,"TYPE","xmlhttp"),e.i&&e.l&&Mn(t,e.i,e.l),e.D&&e.a.setTimeout(e.D);var n=e.a;e=e.ga,n.H=1,n.i=Ut(It(t)),n.j=null,n.I=!0,vt(n,e)}function Vn(e){null!=e.m&&(c.clearTimeout(e.m),e.m=null)}function zn(e,t){var n=null;if(e.a==t){Vn(e),Un(e),e.a=null;var r=2}else{if(!on(e.b,t))return;n=t.s,cn(e.b,t),r=1}if(e.I=t.N,0!=e.v)if(t.b)if(1==r){n=t.j?t.j.length:0,t=b()-t.u;var i=e.u;(r=Ye()).dispatchEvent(new tt(r,n,t,i)),In(e)}else Fn(e);else if(3==(i=t.h)||0==i&&0<e.I||!(1==r&&function(e,t){return!(an(e.b)>=e.b.f-(e.h?1:0))&&(e.h?(e.g=t.s.concat(e.g),!0):!(1==e.v||2==e.v||e.u>=(e.Ia?0:e.Ja))&&(e.h=nt(y(e.Ba,e,t),Hn(e,e.u)),e.u++,!0))}(e,t)||2==r&&jn(e)))switch(n&&0<n.length&&(t=e.b,t.c=t.c.concat(n)),i){case 1:Gn(e,5);break;case 4:Gn(e,10);break;case 3:Gn(e,6);break;default:Gn(e,2)}}function Hn(e,t){var n=e.Fa+Math.floor(Math.random()*e.Ma);return e.f||(n*=2),n*t}function Gn(e,t){if(e.c.info("Error code "+t),2==t){var n=null;e.f&&(n=null);var r=y(e.Xa,e);n||(n=new Pt("//www.google.com/images/cleardot.gif"),c.location&&"http"==c.location.protocol||Nt(n,"https"),Ut(n)),function(e,t){var n=new Je;if(c.Image){var r=new Image;r.onload=v(pn,n,r,"TestLoadImage: loaded",!0,t),r.onerror=v(pn,n,r,"TestLoadImage: error",!1,t),r.onabort=v(pn,n,r,"TestLoadImage: abort",!1,t),r.ontimeout=v(pn,n,r,"TestLoadImage: timeout",!1,t),c.setTimeout((function(){r.ontimeout&&r.ontimeout()}),1e4),r.src=e}else t(!1)}(n.toString(),r)}else et(2);e.v=0,e.f&&e.f.ra(t),qn(e),On(e)}function qn(e){e.v=0,e.I=-1,e.f&&(0==ln(e.b).length&&0==e.g.length||(e.b.c.length=0,S(e.g),e.g.length=0),e.f.qa())}function Wn(e,t,n){var r=function(e){return e instanceof Pt?It(e):new Pt(e,void 0)}(n);if(""!=r.c)t&&Lt(r,t+"."+r.c),Dt(r,r.h);else{var i=c.location;r=function(e,t,n,r){var i=new Pt(null,void 0);return e&&Nt(i,e),t&&Lt(i,t),n&&Dt(i,n),r&&(i.g=r),i}(i.protocol,t?t+"."+i.hostname:i.hostname,+i.port,n)}return e.W&&I(e.W,(function(e,t){jt(r,t,e)})),t=e.A,n=e.na,t&&n&&jt(r,t,n),jt(r,"VER",e.ha),Ln(e,r),r}function Jn(e,t){if(t&&!e.C)throw Error("Can't create secondary domain capable XhrIo object.");return(t=new mn(e.Ka)).F=e.C,t}function Zn(){}function Xn(){if(V&&!(10<=Number(ee)))throw Error("Environmental error: no available transport.")}function Yn(e,t){Se.call(this),this.a=new Rn(t),this.l=e,this.b=t&&t.messageUrlParams||null,e=t&&t.messageHeaders||null,t&&t.clientProtocolHeaderRequired&&(e?e["X-Client-Protocol"]="webchannel":e={"X-Client-Protocol":"webchannel"}),this.a.l=e,e=t&&t.initMessageHeaders||null,t&&t.messageContentType&&(e?e["X-WebChannel-Content-Type"]=t.messageContentType:e={"X-WebChannel-Content-Type":t.messageContentType}),t&&t.a&&(e?e["X-WebChannel-Client-Profile"]=t.a:e={"X-WebChannel-Client-Profile":t.a}),this.a.O=e,(e=t&&t.httpHeadersOverwriteParam)&&!M(e)&&(this.a.i=e),this.h=t&&t.supportsCrossDomainXhr||!1,this.g=t&&t.sendRawJson||!1,(t=t&&t.httpSessionIdParam)&&!M(t)&&(this.a.A=t,null!==(e=this.b)&&t in e&&(t in(e=this.b)&&delete e[t])),this.f=new $n(this)}function Kn(e){ut.call(this);var t=e.__sm__;if(t){e:{for(var n in t){e=n;break e}e=void 0}(this.c=e)?(e=this.c,this.data=null!==t&&e in t?t[e]:void 0):this.data=t}else this.data=e}function Qn(){ht.call(this),this.status=1}function $n(e){this.a=e}(a=mn.prototype).ba=function(e,t,n,r){if(this.a)throw Error("[goog.net.XhrIo] Object is active with another request="+this.B+"; newUri="+e);t=t?t.toUpperCase():"GET",this.B=e,this.f="",this.h=0,this.u=!1,this.b=!0,this.a=new XMLHttpRequest,this.s=this.H?ot(this.H):ot(ct),this.a.onreadystatechange=y(this.za,this);try{this.A=!0,this.a.open(t,String(e),!0),this.A=!1}catch(e){return void wn(this,e)}e=n||"";var i=new Rt(this.headers);r&&Tt(r,(function(e,t){i.set(t,e)})),r=function(e){e:{for(var t=bn,n=e.length,r="string"==typeof e?e.split(""):e,i=0;i<n;i++)if(i in r&&t.call(void 0,r[i],i,e)){t=i;break e}t=-1}return 0>t?null:"string"==typeof e?e.charAt(t):e[t]}(i.L()),n=c.FormData&&e instanceof c.FormData,!(0<=E(vn,t))||r||n||i.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8"),i.forEach((function(e,t){this.a.setRequestHeader(t,e)}),this),this.I&&(this.a.responseType=this.I),"withCredentials"in this.a&&this.a.withCredentials!==this.F&&(this.a.withCredentials=this.F);try{_n(this),0<this.o&&((this.D=function(e){return V&&Q(9)&&"number"==typeof e.timeout&&void 0!==e.ontimeout}(this.a))?(this.a.timeout=this.o,this.a.ontimeout=y(this.xa,this)):this.m=Be(this.xa,this.o,this)),this.l=!0,this.a.send(e),this.l=!1}catch(e){wn(this,e)}},a.xa=function(){void 0!==s&&this.a&&(this.f="Timed out after "+this.o+"ms, aborting",this.h=8,this.dispatchEvent("timeout"),this.abort(8))},a.abort=function(e){this.a&&this.b&&(this.b=!1,this.g=!0,this.a.abort(),this.g=!1,this.h=e||7,this.dispatchEvent("complete"),this.dispatchEvent("abort"),xn(this))},a.G=function(){this.a&&(this.b&&(this.b=!1,this.g=!0,this.a.abort(),this.g=!1),xn(this,!0)),mn.S.G.call(this)},a.za=function(){this.j||(this.A||this.l||this.g?En(this):this.Ta())},a.Ta=function(){En(this)},a.X=function(){try{return 2<Sn(this)?this.a.status:-1}catch(e){return-1}},a.$=function(){try{return this.a?this.a.responseText:""}catch(e){return""}},a.Na=function(e){if(this.a){var t=this.a.responseText;return e&&0==t.indexOf(e)&&(t=t.substring(e.length)),fn(t)}},a.ua=function(){return this.h},a.Qa=function(){return"string"==typeof this.f?this.f:String(this.f)},(a=Rn.prototype).ha=8,a.v=1,a.Ba=function(e){if(this.h)if(this.h=null,1==this.v){if(!e){this.R=Math.floor(1e5*Math.random()),e=this.R++;var t,n=new pt(this,this.c,e,void 0),r=this.l;if(this.O&&(r?D(r=N(r),this.O):r=this.O),null===this.i&&(n.B=r),this.da)e:{for(var i=t=0;i<this.g.length;i++){var a=this.g[i];if(void 0===(a="__data__"in a.a&&"string"==typeof(a=a.a.__data__)?a.length:void 0))break;if(4096<(t+=a)){t=i;break e}if(4096===t||i===this.g.length-1){t=i+1;break e}}t=1e3}else t=1e3;t=Dn(this,n,t),jt(i=It(this.B),"RID",e),jt(i,"CVER",22),this.A&&jt(i,"X-HTTP-Session-Id",this.A),Ln(this,i),this.i&&r&&Mn(i,this.i,r),sn(this.b,n),this.Ga&&jt(i,"TYPE","init"),this.da?(jt(i,"$req",t),jt(i,"SID","null"),n.V=!0,yt(n,i,null)):yt(n,i,t),this.v=2}}else 3==this.v&&(e?Nn(this,e):0==this.g.length||rn(this.b)||Nn(this))},a.Aa=function(){if(this.j=null,Bn(this),this.V&&!(this.F||null==this.a||0>=this.N)){var e=2*this.N;this.c.info("BP detection timer enabled: "+e),this.s=nt(y(this.Sa,this),e)}},a.Sa=function(){this.s&&(this.s=null,this.c.info("BP detection timeout reached."),this.c.info("Buffering proxy detected and switch to long-polling!"),this.H=!1,this.F=!0,Cn(this),Bn(this))},a.Ra=function(){null!=this.m&&(this.m=null,Cn(this),jn(this),et(19))},a.Xa=function(e){e?(this.c.info("Successfully pinged google.com"),et(2)):(this.c.info("Failed to ping google.com"),et(1))},(a=Zn.prototype).ta=function(){},a.sa=function(){},a.ra=function(){},a.qa=function(){},a.Ha=function(){},Xn.prototype.a=function(e,t){return new Yn(e,t)},w(Yn,Se),(a=Yn.prototype).addEventListener=function(e,t,n,r){Yn.S.addEventListener.call(this,e,t,n,r)},a.removeEventListener=function(e,t,n,r){Yn.S.removeEventListener.call(this,e,t,n,r)},a.Oa=function(){this.a.f=this.f,this.h&&(this.a.C=!0);var e=this.a,t=this.l,n=this.b||void 0;et(0),e.fa=t,e.W=n||{},e.H=e.T,e.B=Wn(e,null,e.fa),In(e)},a.close=function(){kn(this.a)},a.Pa=function(e){if("string"==typeof e){var t={};t.__data__=e,Pn(this.a,t)}else this.g?((t={}).__data__=Te(e),Pn(this.a,t)):Pn(this.a,e)},a.G=function(){this.a.f=null,delete this.f,kn(this.a),delete this.a,Yn.S.G.call(this)},w(Kn,ut),w(Qn,ht),w($n,Zn),$n.prototype.ta=function(){this.a.dispatchEvent("a")},$n.prototype.sa=function(e){this.a.dispatchEvent(new Kn(e))},$n.prototype.ra=function(e){this.a.dispatchEvent(new Qn(e))},$n.prototype.qa=function(){this.a.dispatchEvent("b")},Xn.prototype.createWebChannel=Xn.prototype.a,Yn.prototype.send=Yn.prototype.Pa,Yn.prototype.open=Yn.prototype.Oa,Yn.prototype.close=Yn.prototype.close,rt.NO_ERROR=0,rt.TIMEOUT=8,rt.HTTP_ERROR=6,it.COMPLETE="complete",st.EventType=lt,lt.OPEN="a",lt.CLOSE="b",lt.ERROR="c",lt.MESSAGE="d",Se.prototype.listen=Se.prototype.va,mn.prototype.listenOnce=mn.prototype.wa,mn.prototype.getLastError=mn.prototype.Qa,mn.prototype.getLastErrorCode=mn.prototype.ua,mn.prototype.getStatus=mn.prototype.X,mn.prototype.getResponseJson=mn.prototype.Na,mn.prototype.getResponseText=mn.prototype.$,mn.prototype.send=mn.prototype.ba;var er={createWebChannelTransport:function(){return new Xn},ErrorCode:rt,EventType:it,WebChannel:st,XhrIo:mn},tr=er.createWebChannelTransport,nr=er.ErrorCode,rr=er.EventType,ir=er.WebChannel,ar=er.XhrIo;t.default=er}.call(this,n(1))},function(e,t,n){const r=n(0),i=new THREE.Color;function a(e,t,n){i.set(n),e.uniforms?(e.uniforms[t].value.x=i.r,e.uniforms[t].value.y=i.g,e.uniforms[t].value.z=i.b):e[t].set(n)}function o(e,t,n,r,i,a){e.fillStyle=t,e.fillRect(n,r,i,a)}function s(e,t,n,r,i,a,o){let s;s=a>o?e.createLinearGradient(0,0,a,0):e.createLinearGradient(0,0,0,o),s.addColorStop(0,t),s.addColorStop(1,n),e.fillStyle=s,e.fillRect(r,i,a,o)}if(AFRAME.registerSystem("materials",{schema:{},init:function(){this.curve=null,this.panelMaterials=[];const e=localStorage.getItem("colorScheme")||"default";this.scheme=r.schemes[e],this.textureList=[],this.beatsCanvas=document.createElement("canvas"),this.beatsTexture=new THREE.CanvasTexture(this.beatsCanvas),this.generateBeatsTexture(),this.textureList.push(this.beatsTexture),this.envmapCanvas=document.createElement("canvas"),this.envmapTexture=new THREE.CanvasTexture(this.envmapCanvas),this.generateEnvmapTexture(),this.textureList.push(this.envmapTexture),this.fistsCanvas=document.createElement("canvas"),this.fistsTexture=new THREE.CanvasTexture(this.fistsCanvas),this.generateFistsTexture(),this.textureList.push(this.fistsTexture),"loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>{this.createMaterials()}):this.createMaterials()},play:function(){this.setColorScheme()},tick:function(e,t){this.aurora.uniforms.time.value=e,this.home.animate&&(this.home.uniforms.time.value=e),this.leftFistWeapon.uniforms.time.value=e,this.leftWeapon.uniforms.time.value=e,this.rightFistWeapon.uniforms.time.value=e,this.rightWeapon.uniforms.time.value=e,this.rings.uniforms.time.value=e,this.tube.uniforms.time.value=e},createMaterials:function(){const e=this.scheme;this.tunnel=new THREE.ShaderMaterial({vertexShader:n(110),fragmentShader:n(111),uniforms:{fogColor:{value:new THREE.Color(e.primary)},color1:{value:new THREE.Color(e.primary)},color2:{value:new THREE.Color(e.secondary)},color3:{value:new THREE.Color(e.tertiary)},scale:{value:1}},transparent:!0}),this.merkaba=new THREE.MeshBasicMaterial({color:new THREE.Color(e.primary)}),this.backglow=new THREE.MeshBasicMaterial({transparent:!0,map:(new THREE.TextureLoader).load(document.getElementById("backGlowImg").src),color:new THREE.Color(e.primary)}),this.textureList.push(this.backglow.map),this.aurora=new THREE.ShaderMaterial({vertexShader:n(112),fragmentShader:n(113),uniforms:{colorPrimary:{value:new THREE.Color(e.primary)},colorSecondary:{value:new THREE.Color(e.secondary)},time:{value:0}},transparent:!0}),this.rings=new THREE.ShaderMaterial({vertexShader:n(114),fragmentShader:n(115),uniforms:{colorPrimary:{value:new THREE.Color(e.primary)},colorSecondary:{value:new THREE.Color(e.secondary)},colorTertiary:{value:new THREE.Color(e.tertiary)},time:{value:0}},transparent:!0,depthWrite:!1}),this.moon=new THREE.ShaderMaterial({vertexShader:n(116),fragmentShader:n(117),uniforms:{map:{value:(new THREE.TextureLoader).load(document.getElementById("moonImg").src)},tint:{value:new THREE.Color(e.secondarybright)}},transparent:!0}),this.textureList.push(this.moon.uniforms.map.value),this.home=new THREE.ShaderMaterial({vertexShader:n(118),fragmentShader:n(119),uniforms:{color1:{value:new THREE.Color(e.primary)},color2:{value:new THREE.Color(e.secondary)},color3:{value:new THREE.Color(e.tertiary)},src:{value:(new THREE.TextureLoader).load(document.getElementById("homeShadowImg").src)},time:{value:0}},transparent:!0}),this.textureList.push(this.home.uniforms.src.value);const t=(new THREE.TextureLoader).load(document.getElementById("weaponImg").src);t.wrapS=THREE.RepeatWrapping,t.wrapT=THREE.RepeatWrapping,t.repeat.set(2,2),t.magFilter=THREE.NearestFilter,this.textureList.push(t),this.rightWeapon=new THREE.ShaderMaterial({vertexShader:n(25),fragmentShader:n(26),uniforms:{src:{value:t},color:{value:new THREE.Color(e.secondary)},thickness:{value:1.6},time:{value:0}},transparent:!0,blending:THREE.AdditiveBlending}),this.leftWeapon=new THREE.ShaderMaterial({vertexShader:n(25),fragmentShader:n(26),uniforms:{src:{value:t},color:{value:new THREE.Color(e.primary)},thickness:{value:1.6},time:{value:0}},transparent:!0,blending:THREE.AdditiveBlending}),this.leftFistWeapon=new THREE.ShaderMaterial({vertexShader:n(16),fragmentShader:n(27),uniforms:{src:{value:t},color:{value:new THREE.Color(e.primary)},time:{value:0}},side:THREE.DoubleSide,transparent:!0,blending:THREE.AdditiveBlending}),this.rightFistWeapon=new THREE.ShaderMaterial({vertexShader:n(16),fragmentShader:n(27),uniforms:{src:{value:t},color:{value:new THREE.Color(e.secondary)},time:{value:0}},side:THREE.DoubleSide,transparent:!0,blending:THREE.AdditiveBlending});const i=(new THREE.TextureLoader).load(document.getElementById("weaponImg").src),a=(new THREE.TextureLoader).load(document.getElementById("weaponHandleImg").src);i.mapping=THREE.SphericalReflectionMapping,this.textureList.push(i),this.textureList.push(a),this.leftWeaponHandle=new THREE.MeshStandardMaterial({roughness:.4,metalness:.5,color:new THREE.Color(e.primary),map:a,envMap:i}),this.rightWeaponHandle=new THREE.MeshStandardMaterial({roughness:.4,metalness:.5,color:new THREE.Color(e.secondary),map:a,envMap:i});const o=(new THREE.TextureLoader).load(document.getElementById("weapon2Img").src);o.mapping=THREE.SphericalReflectionMapping,this.leftFist=new THREE.MeshStandardMaterial({roughness:.3,metalness:.8,map:this.fistsTexture,envMap:o,transparent:!0}),this.rightFist=new THREE.MeshStandardMaterial({roughness:.3,metalness:.8,map:this.fistsTexture,envMap:o,transparent:!0}),this.beat=new THREE.MeshLambertMaterial({map:this.beatsTexture,transparent:!0}),this.blueBeatPieces=new THREE.MeshLambertMaterial({map:this.beatsTexture,color:e.secondary,emissive:e.secondary,emissiveIntensity:.2}),this.redBeatPieces=new THREE.MeshLambertMaterial({map:this.beatsTexture,color:e.primary,emissive:e.primary,emissiveIntensity:.2}),this.minePieces=new THREE.MeshLambertMaterial({color:e.tertiary,emissive:e.tertiary,emissiveIntensity:.2});const s=(new THREE.TextureLoader).load(document.getElementById("backGlowImg").src);this.redBeatGlow=new THREE.MeshBasicMaterial({color:e.primary,map:s,blending:THREE.AdditiveBlending,transparent:!0}),this.blueBeatGlow=new THREE.MeshBasicMaterial({color:e.secondary,map:s,blending:THREE.AdditiveBlending,transparent:!0}),this.textureList.push(s),this.stars=new THREE.PointsMaterial({size:1,map:(new THREE.TextureLoader).load(document.getElementById("starImg").src),blending:THREE.AdditiveBlending,transparent:!0,color:new THREE.Color(e.secondary)}),this.textureList.push(this.stars.map);const c=(new THREE.TextureLoader).load(document.getElementById("sideglowImg").src);this.textureList.push(c),this.leftsideglow=new THREE.MeshBasicMaterial({map:c,transparent:!0,blending:THREE.AdditiveBlending,depthTest:!1,side:THREE.BackSide,color:new THREE.Color(r.OFF)}),this.rightsideglow=new THREE.MeshBasicMaterial({map:c,transparent:!0,blending:THREE.AdditiveBlending,depthTest:!1,color:new THREE.Color(r.OFF)});const l=(new THREE.TextureLoader).load(document.getElementById("plumeImg").src);l.minFilter=THREE.LinearFilter,this.arrowBluePlume=new THREE.ShaderMaterial({vertexShader:n(7),fragmentShader:n(8),uniforms:{color:{value:new THREE.Color(e.secondary)},src:{value:l}},transparent:!0,depthTest:!1}),this.arrowRedPlume=new THREE.ShaderMaterial({vertexShader:n(7),fragmentShader:n(8),uniforms:{color:{value:new THREE.Color(e.primary)},src:{value:l}},transparent:!0,depthTest:!1}),this.dotBluePlume=new THREE.ShaderMaterial({vertexShader:n(7),fragmentShader:n(8),uniforms:{color:{value:new THREE.Color(e.secondary)},src:{value:l}},transparent:!0,depthTest:!1}),this.dotRedPlume=new THREE.ShaderMaterial({vertexShader:n(7),fragmentShader:n(8),uniforms:{color:{value:new THREE.Color(e.primary)},src:{value:l}},transparent:!0,depthTest:!1}),this.minePlume=new THREE.ShaderMaterial({vertexShader:n(7),fragmentShader:n(8),uniforms:{color:{value:new THREE.Color(e.tertiary)},src:{value:l}},transparent:!0,depthTest:!1});const u=(new THREE.TextureLoader).load(document.getElementById("tubeImg").src),h=(new THREE.TextureLoader).load(document.getElementById("tubeColorImg").src);u.generateMipmaps=!1,u.minFilter=THREE.LinearFilter,h.generateMipmaps=!1,h.minFilter=THREE.LinearFilter,this.tube=new THREE.ShaderMaterial({vertexShader:n(120),fragmentShader:n(121),uniforms:{time:{value:0},opacity:{value:0},src:{value:u},color:{value:h}},transparent:!0,depthTest:!1,side:THREE.BackSide});const d=(new THREE.TextureLoader).load(document.getElementById("handStarTrailImg").src);d.generateMipmaps=!1,d.minFilter=THREE.LinearFilter,this.handStarTrail=new THREE.ShaderMaterial({vertexShader:n(122),fragmentShader:n(123),uniforms:{colorPrimary:{value:new THREE.Color(e.primary)},colorSecondary:{value:new THREE.Color(e.secondary)},colorTertiary:{value:new THREE.Color(e.tertiary)},pulse:{value:0},src:{value:d}},transparent:!0,depthTest:!1,blending:THREE.AdditiveBlending,side:THREE.DoubleSide})},setColorScheme:function(e){this.el.sceneEl;const t=this.scheme=r.schemes[e]||r.schemes.default;a(this.arrowBluePlume,"color",t.secondary),a(this.arrowRedPlume,"color",t.primary),a(this.aurora,"colorPrimary",t.primary),a(this.aurora,"colorSecondary",t.secondary),a(this.backglow,"color",t.primary),a(this.blueBeatGlow,"color",t.secondary),a(this.blueBeatGlow,"color",t.secondary),a(this.blueBeatPieces,"color",t.secondary),a(this.blueBeatPieces,"emissive",t.secondary),a(this.dotBluePlume,"color",t.secondary),a(this.dotRedPlume,"color",t.primary),a(this.handStarTrail,"colorPrimary",t.primary),a(this.handStarTrail,"colorSecondary",t.secondary),a(this.handStarTrail,"colorTertiary",t.tertiary),a(this.home,"color1",t.primary),a(this.home,"color2",t.secondary),a(this.home,"color3",t.tertiary),a(this.leftFist,"color",t.primarybright),a(this.leftFistWeapon,"color",t.primary),a(this.leftWeapon,"color",t.primary),a(this.leftWeaponHandle,"color",t.primary),a(this.merkaba,"color",t.primary),a(this.minePieces,"color",t.tertiary),a(this.minePieces,"emissive",t.tertiary),a(this.minePlume,"color",t.tertiary),a(this.moon,"tint",t.secondarybright),a(this.redBeatGlow,"color",t.primary),a(this.redBeatGlow,"color",t.primary),a(this.redBeatPieces,"color",t.primary),a(this.redBeatPieces,"emissive",t.primary),a(this.rightFist,"color",t.secondarybright),a(this.rightWeapon,"color",t.secondary),a(this.rightFistWeapon,"color",t.secondary),a(this.rightWeaponHandle,"color",t.secondary),a(this.rings,"colorPrimary",t.primary),a(this.rings,"colorSecondary",t.secondary),a(this.rings,"colorTertiary",t.tertiary),a(this.stars,"color",t.secondary),a(this.tunnel,"fogColor",t.primary),a(this.tunnel,"color1",t.primary),a(this.tunnel,"color2",t.secondary),a(this.tunnel,"color3",t.tertiary),this.generateBeatsTexture(),this.generateEnvmapTexture(),this.generateFistsTexture(),document.querySelectorAll("a-entity[wall]").forEach(e=>{a(e.getObject3D("mesh").material,"colorTertiary",t.tertiary)}),this.panelMaterials.forEach(e=>{a(e,"colorPrimary",t.primary),a(e,"colorSecondary",t.secondary)}),a(this.curve,"fogColor",t.primary),a(this.curve,"color1",t.primary),a(this.curve,"color2",t.secondary)},generateBeatsTexture:function(){const e=this.scheme,t=new THREE.Color(e.primary),n=new THREE.Color(e.secondary),r=new THREE.Color(e.tertiary),i=this.beatsCanvas,a=i.getContext("2d");i.width=512,i.height=32,o(a,r.getStyle(),0,0,128,6),o(a,"#000",128,0,128,6),o(a,n.getStyle(),256,0,128,6),o(a,t.getStyle(),384,0,105,6),o(a,"#FFF",489,0,23,6),s(a,"#000000",n.getStyle(),0,6,512,4),s(a,"#000",t.getStyle(),0,10,512,5),s(a,"#000",r.getStyle(),0,15,512,4),s(a,`rgba(${n.r}, ${n.g}, ${n.b}, 0)`,n.getStyle(),0,19,512,5),s(a,`rgba(${t.r}, ${t.g}, ${t.b}, 0)`,t.getStyle(),0,24,512,4),s(a,`rgba(${r.r}, ${r.g}, ${r.b}, 0)`,r.getStyle(),0,28,512,4);const c=this.beatsTexture;return c.generateMipmaps=!1,c.magFilter=THREE.LinearFilter,c.minFilter=THREE.LinearFilter,c.needsUpdate=!0,c},generateFistsTexture:function(){const e=this.scheme,t=new THREE.Color(e.primarybright),n=new THREE.Color(e.secondarybright),r=this.fistsCanvas,i=r.getContext("2d");return r.width=8,r.height=128,s(i,t.getStyle(),`rgba(${t.r}, ${t.g}, ${t.b}, 0)`,0,0,4,128),s(i,n.getStyle(),`rgba(${n.r}, ${n.g}, ${n.b}, 0)`,4,0,4,128),this.fistsTexture.needsUpdate=!0,this.fistsTexture},generateEnvmapTexture:function(){const e=this.scheme,t=new THREE.Color(e.primary),n=new THREE.Color(e.secondary),r=document.getElementById("envmapTemplateImg");r.addEventListener("load",()=>{const e=r.width,i=r.height,a=this.envmapCanvas;a.width=e,a.height=i;const o=a.getContext("2d");o.drawImage(r,0,0);const s=o.getImageData(0,0,e,i),c=s.data;let l,u;for(let e=0;e<c.length;e+=4)l=c[e],u=c[e+1],l*=1-u/255,c[e+0]=Math.floor(t.r*l+n.r*u),c[e+1]=Math.floor(t.g*l+n.g*u),c[e+2]=Math.floor(t.b*l+n.b*u),c[e+3]=255;o.putImageData(s,0,0),document.getElementById("envmapImg").src=a.toDataURL("image/png")})},registerCurve:function(e){this.curve=e},registerPanel:function(e){this.panelMaterials.push(e)}}),AFRAME.registerComponent("materials",{schema:{animate:{default:!0},name:{default:""},recursive:{default:!0}},update:function(){if(""===this.data.name)return;if(this.material=this.system[this.data.name],!this.material)return void console.warn("[materials] Unknown material: "+this.data.name);let e=this.el.getObject3D("mesh");e?this.applyMaterial(e):this.el.addEventListener("object3dset",t=>{"mesh"===t.detail.type&&(e=this.el.getObject3D("mesh"),e&&this.applyMaterial(e))}),this.material.animate=this.data.animate},applyMaterial:function(e){e.detail&&(e=e.detail.model),this.data.recursive?e.traverse(e=>{"Mesh"===e.type&&(e.material=this.material)}):e.material=this.material}}),AFRAME.registerComponent("materials-color-menu",{play:function(){this.text=document.getElementById("colorName")},events:{mouseenter:function(e){this.text.setAttribute("text","value",e.target.dataset.colorName)},mouseleave:function(e){this.text.setAttribute("text","value","")},click:function(e){this.el.sceneEl.systems.materials.setColorScheme(e.target.dataset.colorScheme),this.el.sceneEl.emit("colorschemechange",e.target.dataset.colorScheme,!1)}}}),window.AFRAME){const t=["materials","materials-color-menu"],n=[],r=["materials"];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t){e.exports="varying vec3 vWorldPos;\nvarying vec3 vPos;\nvarying vec3 vNormal;\n\nvoid main() {\n vNormal = normal;\n vPos = position;\n vWorldPos = (modelMatrix * vec4( position, 1.0 )).xyz;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n"},function(e,t){e.exports="uniform sampler2D src;\nuniform float scale;\nvarying vec3 vPos;\nvarying vec3 vWorldPos;\nvarying vec3 vNormal;\nuniform vec3 color1;\nuniform vec3 color2;\nuniform vec3 color3;\nuniform vec3 fogColor;\n\nvoid main() {\n vec3 pw = vWorldPos - cameraPosition;\n vec3 p = pw / scale;\n float pz = p.z * 0.3;\n\n // build color weights\n float f = clamp( (sin(p.x * 0.6 + pz ) + sin(p.y * 0.3 - pz)) * 0.3 + 0.17, 0.0, 1.0);\n float g = clamp( (sin(p.x * 0.7 + pz) + cos(p.y * 0.6 - 15.0) + sin(pz * 0.1)) * 0.25 + 0.15, 0.0, 1.0);\n float h = clamp( (sin(p.x * 0.4 + pz + 3.0) + cos(p.y * 0.8 - 5.0) + sin(pz * 0.3)) * 0.16 + 0.08, 0.0, 1.0);\n\n\n // mix colors using weights\n vec3 col = vec3(0.3);\n col = mix(col, color1, f);\n col = mix(col, color2, g);\n col = mix(col, color3, h);\n\n float fog = 1.0 - clamp(length(pw) / 180.0 - 0.1, 0.0, 1.0);\n\n // mix color with fog\n col = mix(fogColor, col, smoothstep(0.2, 0.9, fog));\n\n // calc shadow (using normal and fixed light pos + fade to black in y)\n float shadow = 0.5 + dot(vec3(0.0, 1.0, 1.0), vNormal) * 0.5;\n float shadowGrad = clamp((vPos.y + 2.0) / 6.0, 0.1, 1.0);\n // fade in fog\n shadow = mix(1.0, shadow, fog);\n shadowGrad = mix(1.0, shadowGrad, smoothstep(0.3, 1.0, fog));\n\n gl_FragColor = vec4(col * shadow * shadowGrad, smoothstep(0.3, 0.6, fog));\n //gl_FragColor = vec4(vec3(fog), 1.0);\n}"},function(e,t){e.exports="uniform float time;\nvarying vec2 uvs;\nvoid main() {\n uvs.xy = uv.xy;\n float t = time * 0.0005;\n vec3 pos = position;\n pos.y += sin(t + uv.x * 3.0 + pos.x * 0.01) * 20.0;\n pos.y += sin(-t * 1.3 + uv.x * 7.0 + pos.x * 0.008) * 10.0;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( pos, 1.0 );\n}"},function(e,t){e.exports="uniform float time;\nuniform vec3 colorPrimary;\nuniform vec3 colorSecondary;\nvarying vec2 uvs;\n\nvoid main() {\n vec3 col = vec3(1.0);\n float t = time * 0.001;\n col *= 0.80 + sin(-t * 3.4 + 5.5 + uvs.x * 6.0) * 0.1;\n col *= 0.80 + sin(t * 1.4 + 0.5 + uvs.x * 12.0) * 0.2;\n col *= 0.80 + sin(t * 1.0 + 0.2 + uvs.x * 30.0) * 0.2;\n col *= 0.90 + sin(-t * 1.6 + 5.2 + uvs.x * 43.0) * 0.1;\n col *= 0.95 + sin(-t * 0.3 + 1.2 + uvs.x * 50.0) * 0.05;\n col *= 0.95 + sin(t * 0.8 + 1.2 + uvs.x * 80.0) * 0.05;\n col *= 0.94 + sin(-t + 0.1 + uvs.x * 180.0) * 0.01;\n col *= 0.90 + sin(t * 2.49 + 0.1 + uvs.x * 120.0) * 0.01;\n col *= 0.86 + sin(-t * 1.7 + 4.7 + uvs.x * 80.0) * 0.03;\n col *= 0.86 + sin(-t * 1.2 + 0.7 + uvs.x * 180.0) * 0.02;\n\n // border fades\n float alpha = 1.0;\n alpha *= 1.0 - smoothstep(0.0, 1.0, uvs.y);\n alpha *= smoothstep(0.0, 0.3, uvs.y);\n alpha *= sin(uvs.x * 3.141592);\n\n // colorize\n col = col * mix(colorPrimary, colorSecondary, uvs.y);\n gl_FragColor = vec4(col, alpha);\n}\n"},function(e,t){e.exports="varying vec2 uvs;\nvoid main() {\n uvs.xy = uv.xy;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}"},function(e,t){e.exports="uniform float time;\nuniform vec3 colorPrimary;\nuniform vec3 colorSecondary;\nuniform vec3 colorTertiary;\nvarying vec2 uvs;\n#define PI 3.14159265358979\n\nfloat pulse(float x, float t, float r){\n return 1.0 - smoothstep(0.0, r, abs((x - t)));\n}\n\nvoid main() {\n float t = time * 0.002;\n vec2 uv = uvs - 0.5;\n uv = vec2(-uv.y, uv.x);\n float d = length(uv);\n float f = pulse(d, 0.44, 0.012);\n float f2 = pulse(d, 0.44, 0.002);\n\n float g = pulse(d, 0.20, 0.01);\n float g1 = pulse(d, 0.20, 0.0018);\n\n float g2 = pulse(d, 0.21, 0.01);\n float g3 = pulse(d, 0.21, 0.0018);\n\n float ang = abs(atan(uv.y, uv.x)) / PI;\n float angalpha = sin(ang * 20.0 - t * 0.1) * 0.4 + 0.6;\n\n float sparks = pulse(angalpha, 0.4, 0.17) * (pulse(d, 0.435, 0.035) + pulse(d, 0.205, 0.026)) * 0.14;\n sparks += pulse(angalpha, 0.4, 0.2) * (pulse(d, 0.44, 0.002) + pulse(d, 0.2, 0.0018)) * 0.4;\n sparks *= sin(ang * 14.0 + t) * 0.5 + 0.5;\n vec3 col = mix(colorPrimary, colorSecondary, ang);\n col = mix (col, colorPrimary, g3);\n col = mix (col, colorSecondary, g1);\n col = mix (col, colorTertiary, sparks * 2.4);\n gl_FragColor = vec4(col, ((f + g + g2) * 0.1 + (f2 + g1 + g3) * 0.4) * angalpha + sparks);\n}\n"},function(e,t){e.exports="varying vec2 uvs;\nvoid main() {\n uvs.xy = uv.xy;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n"},function(e,t){e.exports="varying vec2 uvs;\nuniform sampler2D map;\nuniform vec3 tint;\n\nvoid main() {\n vec4 tex = texture2D(map, uvs);\n vec3 col = mix(tex.rgb * tint, tex.rgb, uvs.y);\n gl_FragColor = vec4(col, tex.a );\n}\n"},function(e,t){e.exports="uniform float time;\nvarying vec3 vWorldPos;\nvarying vec2 uvs;\nvoid main() {\n uvs.xy = uv.xy;\n vWorldPos = (modelMatrix * vec4( position, 1.0 )).xyz;\n vec3 pos = vec3(position.x, position.y + sin(time * 0.002 - position.z) * 0.05 + 0.04, position.z);\n gl_Position = projectionMatrix * modelViewMatrix * vec4(pos, 1.0);\n}\n"},function(e,t){e.exports="varying vec2 uvs;\nvarying vec3 vWorldPos;\nuniform sampler2D src;\nuniform vec3 color1;\nuniform vec3 color2;\nuniform vec3 color3;\n\nvoid main() {\n vec4 tex = texture2D(src, uvs);\n vec3 p = vWorldPos + cameraPosition;\n float pz = p.z * 0.36;\n float f = clamp( (sin(p.x + pz ) + sin(p.y - pz)) * 0.35 + 0.14, 0.0, 1.0);\n float g = clamp( (sin(p.x + pz + 2.0) + cos(p.y * 0.6 - 15.0) + sin(pz * 0.5)) * 0.3 + 0.1, 0.0, 1.0);\n float h = clamp( (sin(p.x * 0.7 + pz + 2.0) + cos(p.y * 0.8 - 5.0) + sin(pz * 0.8)) * 0.3 + 0.05, 0.0, 1.0);\n\n vec3 col = vec3(0.1);\n col = mix(col, color1, f);\n col = mix(col, color2, g);\n col = mix(col, color3, h);\n\n gl_FragColor = vec4((col * 1.5) * tex.r, 1.0);\n}"},function(e,t){e.exports="varying vec2 uvs;\nuniform float time;\nvoid main() {\n uvs.xy = uv.xy;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n"},function(e,t){e.exports="varying vec2 uvs;\nuniform sampler2D src;\nuniform sampler2D color;\nuniform float time;\nuniform float opacity;\n\nvoid main() {\n vec2 uvanim = vec2(\n mod(uvs.x + sin(time / 20000.0), 1.0),\n mod(uvs.y + time / 2000.0, 1.0));\n vec4 texAlpha = texture2D(src, uvanim);\n float alpha = texAlpha.a * smoothstep(0.0, 0.5, uvs.y) * (1.0 - smoothstep(0.5, 1.0, uvs.y));\n gl_FragColor = vec4(texture2D(color, uvs).rgb, alpha * 0.7 * opacity);\n}\n"},function(e,t){e.exports="varying vec3 vWorldPosition;\nvarying vec2 uvs;\n\nvoid main() {\n uvs = uv;\n vWorldPosition = (modelMatrix * vec4(position, 1.0)).xyz;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n"},function(e,t){e.exports="varying vec3 vWorldPosition;\nvarying vec2 uvs;\nuniform vec3 colorPrimary;\nuniform vec3 colorSecondary;\nuniform vec3 colorTertiary;\nuniform float pulse;\nuniform sampler2D src;\n\nvoid main() {\n vec3 colorize = vWorldPosition-cameraPosition;\n colorize = clamp(colorize + 0.5, vec3(0.0), vec3(1.0));\n vec3 col = mix(mix(colorPrimary, colorSecondary, colorize.x), colorTertiary, colorize.z);\n col += vec3(pulse) * 0.1;\n gl_FragColor = vec4 (col, texture2D(src, uvs).a);\n}\n"},function(e,t,n){if(AFRAME.registerComponent("menu-controls",{schema:{enabled:{default:!0}},events:{thumbdownstart:function(){this.data.enabled&&this.el.sceneEl.emit("searchnextpage",null,!1)},thumbleftstart:function(){this.data.enabled&&this.el.sceneEl.emit("menuchallengeunselect",null,!1)},thumbupstart:function(){this.data.enabled&&this.el.sceneEl.emit("searchprevpage",null,!1)}}}),window.AFRAME){const t=["menu-controls"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("menu-difficulty-select",{init:function(){this.el.sceneEl.addEventListener("menuchallengeselect",()=>{this.el.object3D.visible=!1,setTimeout(()=>{this.el.components.layout.update(),this.el.object3D.visible=!0},150)})},events:{click:function(e){this.el.sceneEl.emit("menudifficultyselect",e.target.closest(".difficultyOption").dataset.difficulty,!1)}}}),window.AFRAME){const t=["menu-difficulty-select"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("menu-genre",{init:function(){this.el.addEventListener("click",e=>{this.el.sceneEl.emit("genreselect",e.target.closest(".genre").dataset.bindForKey)})}}),window.AFRAME){const t=["menu-genre"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("menu-midsection",{schema:{active:{default:!1},selectedChallenge:{default:""}},update:function(e){e.active&&!this.data.active&&this.el.emit("hidedifficultysection",null,!1),(!e.active&&this.data.active||this.data.selectedChallenge&&e.selectedChallenge!==this.data.selectedChallenge)&&this.el.emit("showdifficultysection",null,!1)}}),window.AFRAME){const t=["menu-midsection"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){const r=n(0),i={classicvr:-.6,punchvr:.87,ride2d:.87,ridevr:.15,viewer2d:.15},a={classicvr:"classic",punchvr:"punch",ride2d:"ride",ridevr:"ride",viewer2d:"viewer"};if(AFRAME.registerComponent("menu-mode",{schema:{colorScheme:{default:"default"},hasVR:{default:!1}},init:function(){this.el.addEventListener("click",e=>{const t=e.target.closest("[data-mode]"),n=t.dataset.mode,r=t.dataset.name;this.el.sceneEl.emit("gamemode",n,!1),this.data.hasVR&&localStorage.setItem("gameMode",r),this.setModeOption(r)})},update:function(){this.data.hasVR?(this.setModeOption(localStorage.getItem("gameMode")||"punchvr"),this.el.sceneEl.emit("gamemode",a[localStorage.getItem("gameMode")||"punchvr"])):this.setModeOption("ride2d")},setModeOption:function(e){const t=this.el.querySelectorAll(".modeItem");document.getElementById("modeIcon").object3D.position.y=i[e];for(let n=0;n<t.length;n++){const i=t[n],a=i.dataset.name===e;i.emit(a?"select":"deselect",null,!1);const o=i.querySelector(".modeBackground");o.emit(a?"select":"deselect",null,!1),o.setAttribute("mixin","modeBackgroundSelect"+(a?"":" modeBackgroundHover"));i.querySelector(".modeThumb").emit(a?"select":"deselect",null,!1);i.querySelector(".modeTitle").setAttribute("text","color",a?r.WHITE:r.schemes[this.data.colorScheme].secondary);i.querySelector(".modeInstructions").setAttribute("text","color",a?r.WHITE:r.schemes[this.data.colorScheme].primary)}}}),window.AFRAME){const t=["menu-mode"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("menu-playlist-button",{schema:{isFavorited:{default:!1},selectedChallenge:{default:""}},init:function(){const e=this.el;e.setAttribute("animation__scaleup",{property:"scale",from:"1 1 1",to:"1.2 1.2 1.2",dur:800,autoplay:!1,easing:"easeInOutElastic"}),e.setAttribute("animation__scaledown",{property:"scale",from:"1.2 1.2 1.2",to:"1 1 1",dur:100,autoplay:!1,easing:"easeInOutCubic"})},update:function(e){!e.isFavorited&&this.data.isFavorited&&e.selectedChallenge===this.data.selectedChallenge&&(this.el.object3D.position.z=.01,this.el.components.animation__scaleup.beginAnimation(),setTimeout(()=>{this.el.components.animation__scaledown.beginAnimation(),this.el.object3D.position.z=0},800))}}),window.AFRAME){const t=["menu-playlist-button"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("menu-playlist",{init:function(){this.eventDetail={id:"",title:""},this.el.addEventListener("click",e=>{const t=e.target.closest(".playlist");this.eventDetail.id=t.dataset.playlist,this.eventDetail.title=t.dataset.title,this.el.sceneEl.emit("playlistselect",this.eventDetail)})}}),window.AFRAME){const t=["menu-playlist"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("menu-selected-challenge-image",{schema:{coverURL:{type:"string"}},update:function(){this.el.setAttribute("material","src",this.data.coverURL)}}),window.AFRAME){const t=["menu-selected-challenge-image"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("menu-slide-animation",{schema:{isSearching:{default:!1},menuSelectedChallengeId:{type:"string"}},init:function(){this.isLeft=!1},update:function(e){const t=this.data;if(this.isLeft)return!e.menuSelectedChallengeId||t.menuSelectedChallengeId||t.isSearching||this.rightMenu(),void(!e.isSearching||t.isSearching||t.menuSelectedChallengeId||this.rightMenu());this.isLeft||(!e.menuSelectedChallengeId&&t.menuSelectedChallengeId&&this.leftMenu(),!e.isSearching&&t.isSearching&&this.leftMenu())},rightMenu:function(){this.isLeft&&(this.el.components.animation__menuright.beginAnimation(),this.isLeft=!1)},leftMenu:function(){this.isLeft||(this.el.components.animation__menuleft.beginAnimation(),this.isLeft=!0)}}),window.AFRAME){const t=["menu-slide-animation"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){const r={0:0,1:.5,2:0,3:.25,4:.5,5:.75,6:0,7:.125,8:.25,9:.375,10:.5,11:.625,12:.75,13:.875};if(AFRAME.registerComponent("multiplier-ring",{dependencies:["geometry","material"],schema:{combo:{default:0},multiplier:{default:1}},init:function(){this.animationSet={from:void 0,to:void 0},this.progress=this.el.getObject3D("mesh").material.uniforms.progress,this.el.setAttribute("animation",{property:"components.material.material.uniforms.progress.value",dur:100,autoplay:!1})},update:function(){this.updateRing()},updateRing:function(){const e=this.data,t=this.el,n=this.progress;if(8===e.multiplier)return void(n.value=1);const i=this.animationSet;i.from=n.value,i.to=r[e.combo],t.setAttribute("animation",i),t.components.animation.beginAnimation()}}),window.AFRAME){const t=["multiplier-ring"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("no-frustum-cull",{init:function(){this.el.object3D.frustumCulled=!1}}),window.AFRAME){const t=["no-frustum-cull"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){"use strict";n.r(t);var r=n(0),i=n.n(r);if(AFRAME.registerShader("panelShader",{schema:{activePanel:{type:"number",is:"uniform",default:0},brightness:{type:"number",is:"uniform",default:.3},borderWidth:{type:"number",is:"uniform",default:.004},borderRadius:{type:"number",is:"uniform",default:.15},colorPrimary:{type:"color",is:"uniform",default:i.a.initial.primary},colorSecondary:{type:"color",is:"uniform",default:i.a.initial.secondary},midSection:{type:"number",is:"uniform",default:0},opacity:{type:"number",is:"uniform",default:1},ratio:{type:"number",is:"uniform",default:.5},transparent:{default:!0}},vertexShader:n(136),fragmentShader:n(137),update:function(e){this.updateVariables(e,"attribute"),this.updateVariables(e,"uniform"),this.el.sceneEl.systems.materials.registerPanel(this.material)}}),window.AFRAME){const t=[],n=["panelShader"],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t){e.exports="varying vec2 uvs;\nvoid main() {\n uvs.xy = uv.xy;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}"},function(e,t){e.exports="#if __VERSION__ == 100\n #extension GL_OES_standard_derivatives : enable\n#endif\n\nuniform vec3 colorPrimary;\nuniform vec3 colorSecondary;\n\n#define PI 3.141592\n#define DIFF_SECTION_WIDTH 0.06\n\nuniform float borderWidth;\nuniform float borderRadius;\nuniform float brightness;\nuniform float ratio;\nuniform float midSection;\nuniform float opacity;\nuniform float activePanel;\n\nvarying vec2 uvs;\n\nfloat sdBox( in vec2 p, in vec2 b )\n{\n vec2 d = abs(p)-b;\n return length(max(d,vec2(0.0))) + min(max(d.x,d.y), 0.0);\n}\n\nvoid main()\n{\n vec2 uv = uvs;\n vec2 uv2 = uv * 2.0 - 1.0; // from -1 to 1\n uv2.x *= ratio;\n\n vec3 col = mix(colorSecondary * uv.y, colorPrimary * uv.y, uv.x) * (brightness + activePanel * 0.4);\n vec3 borderCol = mix(colorSecondary, colorPrimary, uv.y);\n\n vec2 size = vec2(0.83 * ratio, 0.86) - borderRadius;\n float grad = sdBox(uv2, size) - borderRadius;\n grad = min(grad, sdBox(uv2 - size, vec2(borderRadius)));\n grad = min(grad, sdBox(uv2 + size, vec2(borderRadius)));\n grad = -grad;\n float aa = fwidth(grad);\n\n float isShape = smoothstep(-aa, 0.0, grad);\n float alpha = clamp(isShape + smoothstep(-0.15, 0.15, grad), 0.0, 1.0);\n float isBorder = smoothstep(-aa - borderWidth, aa - borderWidth, grad) - smoothstep(-aa + borderWidth, aa + borderWidth, grad);\n float mid = clamp(midSection, 0.0, 1.0);\n col *= 1.0 - mid * (step(0.5 - DIFF_SECTION_WIDTH * mid, uv.x) - step(0.5 + DIFF_SECTION_WIDTH * midSection, uv.x)) * 0.3;\n\n gl_FragColor = vec4(mix(col * isShape, borderCol, isBorder), alpha * opacity);\n}\n"},function(e,t,n){if(AFRAME.registerComponent("pause",{schema:{isPaused:{default:!1}},update:function(){this.data.isPaused&&this.el.isPlaying?this.el.pause():this.data.isPaused||this.el.isPlaying||!this.el.sceneEl.isPlaying||this.el.play()}}),window.AFRAME){const t=["pause"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("pauser",{schema:{enabled:{default:!0}},init:function(){this.pauseGame=this.pauseGame.bind(this),document.addEventListener("keydown",e=>{27===e.keyCode&&this.pauseGame()}),this.el.sceneEl.addEventListener("controllerconnected",e=>{"vive-controls"===e.detail.name?this.el.addEventListener("menudown",this.pauseGame):(this.el.addEventListener("thumbstickdown",this.pauseGame),this.el.addEventListener("trackpaddown",this.pauseGame))}),document.addEventListener("visibilitychange",()=>{"hidden"===document.visibilityState&&this.pauseGame()})},pauseGame:function(){this.data.enabled&&this.el.sceneEl.emit("pausegame",null,!1)}}),window.AFRAME){const t=["pauser"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){var r=n(141);if(AFRAME.registerSystem("play-sound",{init:function(){this.lastSoundPlayed="",this.lastSoundPlayedTime=0,this.pools={}},createPool:function(e,t){this.pools[e]||(this.pools[e]=new r(e,t))},playSound:function(e,t){this.pools[e]||this.createPool(e,t),this.pools[e].play(),this.lastSoundPlayed=e,this.lastSoundTime=this.el.time}}),AFRAME.registerComponent("play-sound",{schema:{enabled:{default:!0},event:{type:"string"},sound:{type:"string"},volume:{type:"number",default:1}},multiple:!0,init:function(){this.el.addEventListener(this.data.event,e=>{this.data.enabled&&this.system.playSound(this.src,this.data.volume)})},update:function(){this.src=this.data.sound,this.data.sound.startsWith("#")&&(this.src=document.querySelector(this.data.sound).getAttribute("src"))}}),window.AFRAME){const t=["play-sound"],n=[],r=["play-sound"];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t){e.exports=function(e,t){var n,r=0,i=[];return(n=new Audio(e)).volume=t,i.push(n),{play:function(){0===i[r].currentTime&&i[r].ended||((n=new Audio(e)).volume=t,i.push(n),r++),(0===i[r].currentTime||i[r].ended)&&i[r].play(),r=(r+1)%i.length}}}},function(e,t,n){function r(e,t){return e-t}if(AFRAME.registerComponent("player-height",{init:function(){this.beatOffset=0,this.heights=[],this.height=0,this.el.sceneEl.addEventListener("menuchallengeselect",this.updateHeight.bind(this)),this.el.sceneEl.addEventListener("playbuttonclick",this.updateHeight.bind(this))},pause:function(){this.heights.length=0},updateHeight:function(){const e=this.heights;e.length>3&&e.shift(),e.push(this.el.object3D.position.y),this.height=function(e){e.sort(r);const t=e.length/2;return t%1?e[t-.5]:(e[t-1]+e[t])/2}(e);const t=(n=this.height,i=1.6,a=2.2,Math.min(Math.max(n,i),a));var n,i,a,o,s;this.beatOffset=(s=0)+(.2-s)*(t-(o=1.6))/(2.2-o)}}),window.AFRAME){const t=["player-height"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("plume",{schema:{color:{default:""},cutDirection:{default:""},horizontalPosition:{default:"middleleft",oneOf:["left","middleleft","middleright","right"]},songPosition:{default:0},type:{default:"arrow",oneOf:["arrow","dot","mine"]},verticalPosition:{default:"middle",oneOf:["bottom","middle","top"]}},horizontalPositions:{left:-.95,middleleft:-.6,middleright:.6,right:.95},init:function(){this.curveEl=document.getElementById("curve"),this.curveFollowRig=document.getElementById("curveFollowRig"),this.handsEls=this.el.sceneEl.querySelectorAll(".handStar"),this.handPos=new THREE.Vector3,this.verticalPositions=this.el.sceneEl.components["beat-system"].verticalPositions,this.el.sceneEl.addEventListener("cleargame",this.returnToPool.bind(this))},update:function(){"mine"===this.data.type?this.poolName="pool__plume-mine":this.poolName=`pool__plume-${this.data.type}-${this.data.color}`},onGenerate:function(e,t,n,r){this.data;const i=this.el,a=this.curveEl.components.supercurve;a.getPointAt(e,i.object3D.position),a.alignToCurve(e,i.object3D),i.object3D.position.x+=this.horizontalPositions[t],i.object3D.position.y+=this.verticalPositions[n]+r,i.object3D.rotation.z=Math.random()*Math.PI*2,this.songPosition=e},tock:function(){if(this.el.object3D.position.z>this.curveFollowRig.object3D.position.z+10)this.returnToPool();else for(let e=0;e<this.handsEls.length;e++){const t=this.handsEls[e];t.object3D.getWorldPosition(this.handPos),this.handPos.distanceToSquared(this.el.object3D.position)<.2&&t.emit("plumepulse")}},returnToPool:function(){this.el.object3D.position.set(0,0,-9999),this.el.object3D.visible=!1,this.el.isPlaying&&this.el.sceneEl.components[this.poolName].returnEntity(this.el)}}),window.AFRAME){const t=["plume"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("punch",{schema:{enabled:{default:!1}},init:function(){this.currentPos=new THREE.Vector3,this.direction=0,this.lastSample=new THREE.Vector3,this.lastSampleTime=0,this.speed=0,this.bbox=new THREE.Box3,this.bboxEl=this.el.querySelector(".punchBbox")},play:function(){this.rig=this.el.closest("#curveFollowRig")},tick:function(e,t){this.data.enabled&&(this.direction=this.currentPos.copy(this.el.object3D.position).sub(this.lastSample),this.speed=this.direction.length()/((e-this.lastSampleTime)/1e3),this.lastSample.copy(this.el.object3D.position),this.lastSampleTime=e)},tickBeatSystem:function(){this.bbox.setFromObject(this.bboxEl.getObject3D("mesh"))},checkCollision:function(){const e=new THREE.Box3,t=new THREE.Vector3(0,0,.2);return function(n){return e.copy(n.bbox).translate(n.el.object3D.position).expandByScalar(.1).expandByVector(t),this.bbox.intersectsBox(e)}}()}),window.AFRAME){const t=["punch"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){var r,i;if(AFRAME.registerComponent("raycaster-target",{schema:{bindToggle:{default:""},depth:{type:"number"},height:{type:"number"},position:{type:"vec3",default:{x:0,y:0,z:0}},rotation:{type:"vec3",default:{x:0,y:0,z:0}},useBoxTarget:{default:!1},width:{type:"number"}},init:(r={primitive:"box"},i={primitive:"plane"},function(){var e,t,n=this.data,a=this.el;(t=document.createElement("a-entity")).classList.add("raycasterTarget"),n.bindToggle?t.setAttribute("bind-toggle__raycastable",n.bindToggle):t.setAttribute("data-raycastable",""),n.useBoxTarget?((e=r).depth=n.depth,e.height=n.height,e.width=n.width):((e=i).height=n.height,e.width=n.width),t.setAttribute("geometry",e),t.object3D.visible=!1,t.object3D.position.copy(n.position),t.object3D.rotation.x=THREE.Math.degToRad(n.rotation.x),t.object3D.rotation.y=THREE.Math.degToRad(n.rotation.y),t.object3D.rotation.z=THREE.Math.degToRad(n.rotation.z),a.appendChild(t)})}),window.AFRAME){const t=["raycaster-target"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){var r,i,a,o;if(AFRAME.registerComponent("recenter",{schema:{enabled:{default:!0}},init:function(){this.el.sceneEl;this.recenter=this.recenter.bind(this),document.querySelectorAll("[tracked-controls]").forEach(e=>{e.addEventListener("menudown",this.recenter),e.addEventListener("thumbstickdown",this.recenter)}),this.el.addEventListener("recenter",this.recenter)},recenter:(r=new THREE.Euler,i=new THREE.Matrix4,a=new THREE.Matrix4,o=new THREE.Matrix4,function(){const e=this.el;if(!this.data.enabled)return;const t=e.sceneEl.camera.el.object3D;i.identity(),r.set(0,-1*t.rotation.y,0),a.makeRotationFromEuler(r),o.makeTranslation(-1*t.position.x,0,-1*t.position.z),i.multiply(a).multiply(o),i.decompose(e.object3D.position,e.object3D.quaternion,e.object3D.scale),e.object3D.updateMatrixWorld(!0),e.emit("recentered",null,!1)})}),window.AFRAME){const t=["recenter"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerShader("ring",{schema:{blur:{default:.01,is:"uniform"},color:{type:"color",is:"uniform"},progress:{default:0,is:"uniform"},radiusInner:{default:.6,is:"uniform"},radiusOuter:{default:1,is:"uniform"}},vertexShader:n(148),fragmentShader:n(149)}),window.AFRAME){const t=[],n=["ring"],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t){e.exports="varying vec2 vUv;\n\nvoid main () {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n"},function(e,t){e.exports="#if __VERSION__ == 100\n #extension GL_OES_standard_derivatives : enable\n#endif\n#define PI 3.14159265358979\nuniform float blur;\nuniform float progress;\nuniform float radiusInner;\nuniform float radiusOuter;\nuniform vec3 color;\n\nvarying vec2 vUv;\n\nvoid main () {\n // make uvs go from -1 to 1\n vec2 uv = vec2(vUv.x * 2.0 - 1.0, vUv.y * 2.0 - 1.0);\n // calculate distance of fragment to center\n float r = uv.x * uv.x + uv.y * uv.y;\n // calculate antialias\n float aa = fwidth(r);\n // make full circle (radiusOuter - radiusInner)\n float col = (1.0 - smoothstep(radiusOuter - aa, radiusOuter + blur + aa, r)) * smoothstep(radiusInner - aa, radiusInner + blur + aa, r);\n // radial gradient\n float a = smoothstep(-PI-aa, PI+aa, atan(uv.y, uv.x));\n // progress angle\n float p = 1.0 - progress - blur;\n // apply progress to full circle (1 for done part, 0 for part to go)\n col *= smoothstep(p, p + blur, a);\n // multiply by user color\n gl_FragColor = vec4(color * col, col);\n}\n"},function(e,t,n){if(AFRAME.registerComponent("score-texts",{schema:{isLoading:{default:!1}},init:function(){this.textEls=this.el.querySelectorAll("[text]");for(let e=0;e<this.textEls.length;e++)this.textEls[e].setAttribute("animation__fadein",{autoplay:!1,property:"components.text.material.uniforms.opacity.value",delay:250,dur:750,easing:"easeInOutCubic",from:0,to:1})},update:function(e){if(e.isLoading&&!this.data.isLoading){for(let e=0;e<this.textEls.length;e++)this.textEls[e].components.animation__fadein.beginAnimation();this.el.sceneEl.emit("textglownormal",null,!1)}if(!e.isLoading&&this.data.isLoading){for(let e=0;e<this.textEls.length;e++)this.textEls[e].components.text.material.uniforms.opacity.value=0;this.el.sceneEl.emit("textglowoff",null,!1)}}}),window.AFRAME){const t=["score-texts"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){"use strict";n.r(t);n(6);if(AFRAME.registerComponent("search-thumbnail-atlas",{dependencies:["geometry","material"],schema:{dummyUpdater:{type:"string"}},init:function(){const e=this.canvas=document.createElement("canvas");e.setAttribute("id","thumbnailAtlasMap"),e.height=512,e.width=64,e.style.visibility="hidden",this.ctx=e.getContext("2d"),this.clearCanvas(),document.body.appendChild(e);const t=this.alphaCanvas=document.createElement("canvas");t.setAttribute("id","thumbnailAlphaMap"),t.height=512,t.width=64,t.style.visibility="hidden",this.alphaCtx=t.getContext("2d"),document.body.appendChild(t),this.el.components.material.material.alphaMap=new THREE.CanvasTexture(t),this.el.setAttribute("material","src",e),this.images=[],this.lastNumResults=6},update:function(){const e=this.el.sceneEl.systems.state.state.searchResultsPage;for(let t=0;t<e.length;t++){let n=this.images[t]=this.images[t]||document.createElement("img");n.crossOrigin="anonymous",n.src=e[t].coverURL,n.complete?this.draw(n,t):n.onload=()=>{this.draw(n,t)}}e.length!==this.lastNumResults&&this.updateAlphaMap(e.length),this.lastNumResults=e.length},draw:function(e,t){this.ctx.drawImage(e,0,t*(512/384*64),64,512/384*64),this.el.getObject3D("mesh").material.map.needsUpdate=!0},clearCanvas:function(){const e=this.canvas;this.ctx.fillStyle="#111",this.ctx.fillRect(0,0,e.width,e.height)},updateAlphaMap:function(e){const t=this.alphaCanvas,n=this.alphaCtx;n.fillStyle="#FFF",n.fillRect(0,0,t.width,t.height),n.fillStyle="#000",n.fillRect(0,e*(512/384*64),t.width,t.height-e*(512/384*64)),this.el.getObject3D("mesh").material.alphaMap.needsUpdate=!0,this.el.getObject3D("mesh").material.needsUpdate=!0}}),window.AFRAME){const t=["search-thumbnail-atlas"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){const r=n(153),i=n(28),a=n(154).map(i);if(AFRAME.registerComponent("search",{schema:{difficultyFilter:{default:"All"},genre:{default:""},playlist:{default:""},query:{default:""}},init:function(){this.eventDetail={query:"",results:a,url:"",page:0},this.keyboardEl=document.getElementById("keyboard"),this.popularHits=a,function(e){for(let t=e.length-1;t>0;t--){const n=Math.floor(Math.random()*(t+1));[e[t],e[n]]=[e[n],e[t]]}}(this.popularHits),this.queryObject={hitsPerPage:0,query:""},this.el.sceneEl.addEventListener("searchclear",()=>{this.search("")})},update:function(e){this.popularHits&&(e.query&&!this.data.query&&(this.keyboardEl.components["super-keyboard"].data.value="",this.keyboardEl.components["super-keyboard"].updateTextInput("")),this.debouncedSearch=r(this.search.bind(this),1e3),(this.data.genre||this.data.playlist||this.data.query)&&this.search(this.data.query))},play:function(){this.el.sceneEl.emit("searchresults",this.eventDetail),this.search("")},events:{superkeyboardchange:function(e){e.target===this.el&&this.debouncedSearch(e.detail.value)}},search:function(e){if(!e&&"All"===this.data.difficultyFilter&&!this.data.genre&&!this.data.playlist&&this.popularHits)return this.eventDetail.results=this.popularHits,this.eventDetail.query="",void this.el.sceneEl.emit("searchresults",this.eventDetail);if(this.eventDetail.query=e,this.queryObject.query=e,this.queryObject.hitsPerPage=e?30:150,"favorites"===this.data.playlist)return this.eventDetail.results=JSON.parse(localStorage.getItem("favorites-v2")),void this.el.sceneEl.emit("searchresults",this.eventDetail);let t="https://api.beatsaver.com/search/text/CURRENT_PAGE_INDEX?sortOrder=Rating&automapper=true&q="+encodeURIComponent(e);if(this.data.playlist)t=`https://api.beatsaver.com/playlists/id/${this.data.playlist}/CURRENT_PAGE_INDEX`;else if(this.data.genre){const e={Pop:"pop","R&B":"rb",Rap:"hip-hop-rap",Rock:"rock",Soundtrack:"tv-movie-soundtrack","Video Games":"video-game-soundtrack",Electronic:"electronic","Hip Hop":"hip-hop-rap",House:"house","J-Pop":"j-pop","K-Pop":"k-pop",Meme:"comedy-meme",Alternative:"alternative",Anime:"anime",Comedy:"comedy-meme",Dubstep:"dubstep",Dance:"dance"}[this.data.genre];t="https://api.beatsaver.com/search/text/CURRENT_PAGE_INDEX?sortOrder=Rating&automapper=true&tags="+encodeURIComponent(e)}else if(e&&e.length<3)return;fetch(t.replaceAll("CURRENT_PAGE_INDEX",0)).then(e=>e.json()).then(e=>{var n=(e.docs||e.maps).map(i);this.eventDetail.results=n,this.eventDetail.url=t,this.eventDetail.urlPage=0,this.el.sceneEl.emit("searchresults",this.eventDetail)})}}),AFRAME.registerComponent("search-result-list",{init:function(){new MutationObserver(e=>{for(let t=0;t<e.length;t++)"data-index"===e[t].attributeName&&this.refreshLayout()}).observe(this.el,{attributes:!0,childList:!1,subtree:!0})},events:{click:function(e){this.el.sceneEl.emit("menuchallengeselect",e.target.closest(".searchResult").dataset.id,!1)}},refreshLayout:function(){this.el.emit("layoutrefresh",null,!1)}}),window.AFRAME){const t=["search","search-result-list"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){(function(t){var n=/^\s+|\s+$/g,r=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,a=/^0o[0-7]+$/i,o=parseInt,s="object"==typeof t&&t&&t.Object===Object&&t,c="object"==typeof self&&self&&self.Object===Object&&self,l=s||c||Function("return this")(),u=Object.prototype.toString,h=Math.max,d=Math.min,p=function(){return l.Date.now()};function f(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function m(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==u.call(e)}(e))return NaN;if(f(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=f(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(n,"");var s=i.test(e);return s||a.test(e)?o(e.slice(2),s?2:8):r.test(e)?NaN:+e}e.exports=function(e,t,n){var r,i,a,o,s,c,l=0,u=!1,g=!1,y=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function v(t){var n=r,a=i;return r=i=void 0,l=t,o=e.apply(a,n)}function b(e){return l=e,s=setTimeout(A,t),u?v(e):o}function w(e){var n=e-c;return void 0===c||n>=t||n<0||g&&e-l>=a}function A(){var e=p();if(w(e))return E(e);s=setTimeout(A,function(e){var n=t-(e-c);return g?d(n,a-(e-l)):n}(e))}function E(e){return s=void 0,y&&r?v(e):(r=i=void 0,o)}function x(){var e=p(),n=w(e);if(r=arguments,i=this,c=e,n){if(void 0===s)return b(c);if(g)return s=setTimeout(A,t),v(c)}return void 0===s&&(s=setTimeout(A,t)),o}return t=m(t)||0,f(n)&&(u=!!n.leading,a=(g="maxWait"in n)?h(m(n.maxWait)||0,t):a,y="trailing"in n?!!n.trailing:y),x.cancel=function(){void 0!==s&&clearTimeout(s),l=0,r=c=i=s=void 0},x.flush=function(){return void 0===s?o:E(p())},x}}).call(this,n(1))},function(e,t){e.exports=[{id:"43a25",name:"[Extra Sensory II] Porter Robinson - Lifelike",description:"// MAP 3 OF EXTRA SENSORY II\n[ https://beatsaver.com/playlists/797071 ]\n\nthis is only the beginning...*\n\nVideo:\nhttps://www.youtube.com/watch?v=dlqYqNKcLII",uploader:{id:4340055,name:"nasafrasa",avatar:"https://cdn.beatsaver.com/avatar/16a6108559271b0c0a8d254ceb5ad43f896a0a28.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4340055/playlist"},metadata:{bpm:100.72,duration:96,songName:"Lifelike",songSubName:"",songAuthorName:"Porter Robinson",levelAuthorName:"nasafrasa"},stats:{plays:0,downloads:0,upvotes:3632,downvotes:14,score:.9918,reviews:6,sentiment:"VERY_POSITIVE"},uploaded:"2025-01-26T23:35:01.030128Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"cb5470be988e526c08e1c7e98f2ba9c26ec6fbd0",state:"Published",createdAt:"2025-01-26T05:53:34.451213Z",sageScore:5,diffs:[{njs:16,offset:0,notes:123,bombs:0,obstacles:0,nps:1.564,length:132,characteristic:"Standard",difficulty:"Easy",events:77,chroma:!0,me:!1,ne:!0,cinema:!1,vivify:!0,seconds:78.634,paritySummary:{errors:0,warns:0,resets:0},maxScore:106395,label:"Nurture",environment:"BillieEnvironment"},{njs:16,offset:0,notes:145,bombs:0,obstacles:0,nps:1.844,length:132,characteristic:"Standard",difficulty:"Normal",events:77,chroma:!0,me:!1,ne:!0,cinema:!1,vivify:!0,seconds:78.634,paritySummary:{errors:0,warns:0,resets:0},maxScore:128235,label:"Lifelike",environment:"BillieEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/cb5470be988e526c08e1c7e98f2ba9c26ec6fbd0.zip",coverURL:"https://eu.cdn.beatsaver.com/cb5470be988e526c08e1c7e98f2ba9c26ec6fbd0.jpg",previewURL:"https://eu.cdn.beatsaver.com/cb5470be988e526c08e1c7e98f2ba9c26ec6fbd0.mp3"}],curator:{id:4292041,name:"symphonic",avatar:"https://cdn.beatsaver.com/avatar/2dc906ee5b78c2cb723f0eae964c2c203babf3f4.png",type:"DISCORD",admin:!0,curator:!0,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4292041/playlist"},curatedAt:"2025-01-27T00:42:00.509882Z",createdAt:"2025-01-26T05:53:34.451213Z",updatedAt:"2025-11-07T23:01:19.839738Z",lastPublishedAt:"2025-01-26T23:35:01.030128Z",tags:["accuracy","balanced","ambient","classical-orchestral"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"43a1f",name:"[Extra Sensory II] Simplifi - you",description:"// MAP 4 OF EXTRA SENSORY II\n[ https://beatsaver.com/playlists/797071 ]\n\n====================================================\n\neverything you see in this map was created (from scratch!) by me\n\nlong time coming. this map represents the end of a chapter, and the start of a new one. I've been dreaming of releasing a map with Vivify almost as long as I've been a Beat Saber creative. I was stuck for so long, but I finally had a breakthrough!\n\nand it's yours to keep.\n\n====================================================\n\nproject source: https://github.com/Swifter1243/you_map\ngameplay video: https://youtu.be/2SgLtmqxu-k \nExtra Sensory II website: https://exsii.totalbs.dev/",uploader:{id:4284246,name:"Swifter",hash:"5dcf3af29eccad0006a0b45f",avatar:"https://cdn.beatsaver.com/avatar/9473c86aef59ee6780dce3b2f091ee167e75bbc3.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4284246/playlist"},metadata:{bpm:70,duration:157,songName:"you",songSubName:"",songAuthorName:"Simplifi",levelAuthorName:"Swifter"},stats:{plays:0,downloads:0,upvotes:5380,downvotes:28,score:.9914,reviews:35,sentiment:"VERY_POSITIVE"},uploaded:"2025-01-26T23:35:01.797228Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"d265d40935983502ad6f05ddeb5417f3e37c2290",state:"Published",createdAt:"2025-01-26T04:23:47.346441Z",sageScore:3,diffs:[{njs:8,offset:-.25,notes:160,bombs:0,obstacles:0,nps:1.106,length:168.75,characteristic:"Standard",difficulty:"Normal",events:0,chroma:!0,me:!1,ne:!0,cinema:!1,vivify:!0,seconds:144.643,paritySummary:{errors:0,warns:0,resets:0},maxScore:140835,environment:"BillieEnvironment"},{njs:8,offset:-.25,notes:160,bombs:0,obstacles:0,nps:1.106,length:168.75,characteristic:"Standard",difficulty:"Hard",events:0,chroma:!0,me:!1,ne:!0,cinema:!1,vivify:!0,seconds:144.643,paritySummary:{errors:0,warns:0,resets:0},maxScore:140675,environment:"BillieEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/d265d40935983502ad6f05ddeb5417f3e37c2290.zip",coverURL:"https://eu.cdn.beatsaver.com/d265d40935983502ad6f05ddeb5417f3e37c2290.jpg",previewURL:"https://eu.cdn.beatsaver.com/d265d40935983502ad6f05ddeb5417f3e37c2290.mp3"}],curator:{id:4331555,name:"TheBlackParrot",avatar:"https://cdn.beatsaver.com/avatar/213097af5fb746f71825aad761723951ce4807ab.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,playlistUrl:"https://api.beatsaver.com/users/id/4331555/playlist"},curatedAt:"2025-01-26T23:47:25.274685Z",createdAt:"2025-01-26T04:23:47.346441Z",updatedAt:"2025-02-09T02:00:19.217070Z",lastPublishedAt:"2025-01-26T23:35:01.797228Z",tags:["electronic","accuracy"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"1a0b6",name:"[Electro Swing Pack] The Electric Swing Circus - Empires",description:"Nixie Presents: Electro Swing Pack!\n\n10 electro swing songs with expert and expert+ diffs to make your booty swing!\n\nGet The Pack: \nhttps://bsaber.com/electro-swing-pack/\n\nMap Gameplay:\nhttps://youtu.be/WJy6_2cTPYg\n\nComplete Pack Playthrough:\nhttps://youtu.be/yj9rw4MEh7s\n\n\nHuge thanks in particular to:\nMonstor, Bearly, Noxn, Bullet, Vaser888, Tocxx, Jafdy, Storm Knight and Pixelguy!\n\n\nMore Maps: https://beatsaver.com/profile/4286374\nDiscord Tag: Nixie.Korten#6944\nJoin My Server: https://discord.gg/RjxPpZtH7w\nTwitter: https://twitter.com/Nixie_Korten\nInstagram: https://www.instagram.com/nixie.korten/",uploader:{id:4286374,name:"Nixie.Korten",hash:"6096752e12772e0006e2f7e6",avatar:"https://cdn.beatsaver.com/avatar/bb97db2b49d21f5cbc1a5ba50742fa0e5c86ed3c.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4286374/playlist"},metadata:{bpm:120,duration:173,songName:"Empires",songSubName:"",songAuthorName:"The Electric Swing Circus",levelAuthorName:"Nixie.Korten"},stats:{plays:0,downloads:0,upvotes:5096,downvotes:31,score:.9905,reviews:2},uploaded:"2021-07-08T15:24:55.769Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"cecc89118b3a75ea7d65ceff5949b3ef19fea716",key:"1a0b6",state:"Published",createdAt:"2021-07-08T15:24:55.769Z",sageScore:4,diffs:[{njs:16,offset:-.5,notes:522,bombs:0,obstacles:24,nps:3.173,length:329,characteristic:"Standard",difficulty:"Expert",events:2051,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:164.5,paritySummary:{errors:0,warns:0,resets:0},maxScore:472995,environment:"PanicEnvironment"},{njs:19,offset:.25,notes:823,bombs:0,obstacles:0,nps:5.003,length:329,characteristic:"Standard",difficulty:"ExpertPlus",events:2051,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:164.5,paritySummary:{errors:0,warns:0,resets:0},maxScore:749915,environment:"PanicEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/cecc89118b3a75ea7d65ceff5949b3ef19fea716.zip",coverURL:"https://eu.cdn.beatsaver.com/cecc89118b3a75ea7d65ceff5949b3ef19fea716.jpg",previewURL:"https://eu.cdn.beatsaver.com/cecc89118b3a75ea7d65ceff5949b3ef19fea716.mp3"}],curator:{id:57657,name:"Pixelguy",hash:"5cff0b7698cc5a672c8541a8",avatar:"https://cdn.beatsaver.com/avatar/57657.jpg",type:"SIMPLE",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/57657/playlist"},curatedAt:"2021-07-08T15:24:55.769Z",createdAt:"2021-07-08T15:24:55.769Z",updatedAt:"2024-11-02T11:17:18.878282Z",lastPublishedAt:"2021-07-08T15:24:55.769Z",tags:["swing","balanced","dance-style","electronic"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"1e6ff",name:"{Modchart} acloudyskye - Somewhere Out There",description:"MAP 10. https://beatsaver.com/playlists/8713\n\nWhat can I say about this map.\n\nI feel like this is the culmination of everything thats happened for modcharting this entire year. All of the advancements I've made with environments, mawntee has made with notemods, and reddek has made with walls come together into this piece that I can only describe as the next step. \n\nI really hope everyone enjoys this one. It's one of a kind.\n\nVideo: https://www.youtube.com/watch?v=rphHsDxJbpg",uploader:{id:4284246,name:"Swifter",hash:"5dcf3af29eccad0006a0b45f",avatar:"https://cdn.beatsaver.com/avatar/9473c86aef59ee6780dce3b2f091ee167e75bbc3.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4284246/playlist"},metadata:{bpm:160,duration:323,songName:"Somewhere Out There",songSubName:"",songAuthorName:"acloudyskye",levelAuthorName:"Swifter, Mawntee, Reddek"},stats:{plays:0,downloads:0,upvotes:20023,downvotes:170,score:.9901,reviews:34,sentiment:"VERY_POSITIVE"},uploaded:"2021-11-30T01:27:30.018531Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"448d219117992026eb23c98dc920ce73a912f289",state:"Published",createdAt:"2022-09-26T15:58:45.498795Z",sageScore:1,diffs:[{njs:19,offset:-.5,notes:892,bombs:8,obstacles:3746,nps:2.973,length:800,characteristic:"Standard",difficulty:"Expert",events:38114,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:300,paritySummary:{errors:0,warns:0,resets:0},maxScore:813395,label:"Experience Recommended",environment:"BTSEnvironment"},{njs:19,offset:-.5,notes:1134,bombs:8,obstacles:3530,nps:3.78,length:800,characteristic:"Lawless",difficulty:"ExpertPlus",events:38114,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:300,paritySummary:{errors:719,warns:26,resets:1},maxScore:1036035,label:"Busier Mapping",environment:"BTSEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/448d219117992026eb23c98dc920ce73a912f289.zip",coverURL:"https://eu.cdn.beatsaver.com/448d219117992026eb23c98dc920ce73a912f289.jpg",previewURL:"https://eu.cdn.beatsaver.com/448d219117992026eb23c98dc920ce73a912f289.mp3"}],curator:{id:4284942,name:"blackjack",hash:"5e96ca3a16c96800062400fe",avatar:"https://cdn.beatsaver.com/avatar/dcd6d334252b91670180855821886983a1818f4a.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4284942/playlist"},curatedAt:"2021-11-30T01:27:30.018531Z",createdAt:"2021-11-30T01:03:02.982731Z",updatedAt:"2023-08-26T19:08:38.528705Z",lastPublishedAt:"2022-09-26T16:01:29.467930Z",tags:["pop","balanced"],bookmarked:!1,collaborators:[{id:4233941,name:"reddek",hash:"5dbfb4426dea0b0006bd328d",avatar:"https://cdn.beatsaver.com/avatar/fc462a26fa97d9b2fdadbdf5d7a45ef75026f8e9.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4233941/playlist"},{id:4285959,name:"Mawntee",hash:"5cff0b7698cc5a672c854ca6",avatar:"https://cdn.beatsaver.com/avatar/e373d502d75ed37d9cc60d2aa58b08f8ab6ebc90.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4285959/playlist"}],declaredAi:"None",blRanked:!1,blQualified:!1},{id:"d7fa",name:"Geoxor - Gloom [Wallmap]",description:"REUPLOAD due to last minute mapping error\n\nSpecial thanks to:\nNyri0 - For providing scripts that were crucial to making this map possible, and for helping me along the way.\nLayanmeta - For giving me so much encouragement throughout the final stages and making a brilliant YouTube video on this map.\nBSMG discord - For the continued support throughout the development process\nAll you people/birds - For playing my map :D\n\nBRIAN HAS BECOME SENTIENT. ALL HAIL BRIAN",uploader:{id:18761,name:"minething",hash:"5e9b4ead16c9680006287387",avatar:"https://www.gravatar.com/avatar/f9bed76044f22e33e287d984993c59797049f1315d399c641b1ea7778975c926?d=retro",type:"SIMPLE",admin:!1,curator:!1,seniorCurator:!1,playlistUrl:"https://api.beatsaver.com/users/id/18761/playlist"},metadata:{bpm:93,duration:167,songName:"Gloom",songSubName:"",songAuthorName:"Geoxor",levelAuthorName:"Mine Thing"},stats:{plays:0,downloads:0,upvotes:9917,downvotes:81,score:.9896,reviews:8,sentiment:"VERY_POSITIVE"},uploaded:"2020-08-16T19:13:40.774Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"823b4e880baac024728ae96a7c20e28026c4585d",key:"d7fa",state:"Published",createdAt:"2020-08-16T19:13:40.774Z",sageScore:3,diffs:[{njs:12,offset:6,notes:0,bombs:0,obstacles:15605,nps:0,length:0,characteristic:"Standard",difficulty:"Easy",events:144,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:0,paritySummary:{errors:0,warns:0,resets:0},maxScore:0,label:"Lightshow",environment:"RocketEnvironment"},{njs:12,offset:6,notes:202,bombs:0,obstacles:15605,nps:1.309,length:239.125,characteristic:"Standard",difficulty:"Hard",events:144,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:154.274,paritySummary:{errors:48,warns:6,resets:0},maxScore:178595,environment:"RocketEnvironment"},{njs:12,offset:6,notes:411,bombs:4,obstacles:15605,nps:2.665,length:239,characteristic:"Standard",difficulty:"Expert",events:144,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:154.194,paritySummary:{errors:0,warns:0,resets:1},maxScore:370875,environment:"RocketEnvironment"},{njs:12,offset:3,notes:411,bombs:4,obstacles:12340,nps:2.665,length:239,characteristic:"Standard",difficulty:"ExpertPlus",events:144,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:154.194,paritySummary:{errors:0,warns:0,resets:1},maxScore:370875,label:"Less Lag",environment:"RocketEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/823b4e880baac024728ae96a7c20e28026c4585d.zip",coverURL:"https://eu.cdn.beatsaver.com/823b4e880baac024728ae96a7c20e28026c4585d.jpg",previewURL:"https://eu.cdn.beatsaver.com/823b4e880baac024728ae96a7c20e28026c4585d.mp3"}],curator:{id:4316945,name:"BeastSaber",avatar:"https://cdn.beatsaver.com/avatar/4316945.jpg",type:"SIMPLE",admin:!1,curator:!0,seniorCurator:!1,curatorTab:!0,playlistUrl:"https://api.beatsaver.com/users/id/4316945/playlist"},curatedAt:"2020-08-16T19:13:40.774Z",createdAt:"2020-08-16T19:13:40.774Z",updatedAt:"2020-08-16T19:13:40.774Z",lastPublishedAt:"2020-08-16T19:13:40.774Z",bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"43a24",name:"[Extra Sensory II] Andrew Prahlow - End Times",description:"// MAP 2 OF EXTRA SENSORY II\n[https://beatsaver.com/playlists/797071]\n\n=================================================\n\nFirst off, I just want to say thank you. Thank you to the entire TotalBS team (Especially Swifter and Aeroluna) for giving me a chance with this project. When I started on this map, I honestly never thought it would turn into anything like this. At first, it was just going to be something simple with the sun, stars, and you. But as I kept learning more about Unity and Vivify, the project just kept growing little by little, until it became what it is now.\n\nI’ve gotta give a special shoutout to Swifter for helping so much with the shaders, and to Aeroluna for making the custom UI possible. Without those two, this map would not have been able to become what it is now.\n\nOver the past year or so working on this, I feel like my goals and what I want in life have completely shifted. I’ve got more drive and motivation now than I’ve ever had before, and I’m so thankful for that.\n\nI'd like to also thank my closest friend, Azushii, for introducing me to Outer Wilds and encouraging me to start this map in the first place. Rest in peace buddy.. <3\n\n=================================================\nCustom Saber Model: [Coming Soon]\nCustom Note Model: [Coming Soon]\nProject Source: [Coming Soon]\nGameplay Video: https://youtu.be/YtETILVC4V4\nExtra Sensory II Website: https://exsii.totalbs.dev/",uploader:{id:70911,name:"Chaimzy",hash:"605ae0535ab13d000609b331",avatar:"https://cdn.beatsaver.com/avatar/70911.jpg",type:"SIMPLE",admin:!1,curator:!1,seniorCurator:!1,playlistUrl:"https://api.beatsaver.com/users/id/70911/playlist"},metadata:{bpm:128,duration:157,songName:"End Times",songSubName:"Outer Wilds",songAuthorName:"Andrew Prahlow",levelAuthorName:"Chaimzy"},stats:{plays:0,downloads:0,upvotes:3127,downvotes:20,score:.9889,reviews:8,sentiment:"VERY_POSITIVE"},uploaded:"2025-01-26T23:35:01.057933Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"b4acc042f6541c06e57a384fa9796a10c45ff558",state:"Published",createdAt:"2025-01-26T05:32:44.984680Z",sageScore:3,diffs:[{njs:16,offset:0,notes:32,bombs:8,obstacles:0,nps:.533,length:128,characteristic:"Standard",difficulty:"Hard",events:0,chroma:!0,me:!1,ne:!0,cinema:!1,vivify:!0,seconds:60,paritySummary:{errors:0,warns:0,resets:0},maxScore:22195,label:"There's more to explore here",environment:"DefaultEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/b4acc042f6541c06e57a384fa9796a10c45ff558.zip",coverURL:"https://eu.cdn.beatsaver.com/b4acc042f6541c06e57a384fa9796a10c45ff558.jpg",previewURL:"https://eu.cdn.beatsaver.com/b4acc042f6541c06e57a384fa9796a10c45ff558.mp3"}],curator:{id:4286182,name:"MadChase",avatar:"https://cdn.beatsaver.com/avatar/99feaf0fe97b6c67dde2ae7ba055fab744b0ac61.png",type:"DISCORD",admin:!1,curator:!0,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4286182/playlist"},curatedAt:"2025-01-27T00:06:25.521273Z",createdAt:"2025-01-26T05:32:44.984680Z",updatedAt:"2025-01-30T01:51:28.961316Z",lastPublishedAt:"2025-01-26T23:35:01.057934Z",tags:["accuracy","ambient","video-game-soundtrack"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"d4a5",name:"[FUTURE FUNK PACK] Shiawase No Monosashi (VANTAGE // Short Ver.)",description:'FUTURE FUNK MAP PACK\n2 songs uploaded everyday through August 10th - 14th!\n\n"Shiawase No Monosashi" is performed by Mariya Takeuchi. This version of the song is a short edit I made from VANTAGE //\'s edit. The original length of the song is 5 minutes long\n\nPlease look forward to the upcoming maps!\n\nDM any feedback on Discord\nETAN#8341',uploader:{id:4235140,name:"ETAN",hash:"5cff0b7798cc5a672c855775",avatar:"https://cdn.beatsaver.com/avatar/652a9b5d335007c8668b43aa727c75e84794dbe1.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4235140/playlist"},metadata:{bpm:128,duration:171,songName:"Shiawase No Monosashi",songSubName:"(VANTAGE // Short Ver.)",songAuthorName:"Mariya Takeuchi",levelAuthorName:"ETAN"},stats:{plays:0,downloads:0,upvotes:9325,downvotes:95,score:.9876,reviews:2},uploaded:"2020-08-12T18:17:44.285Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"d7cb32f23041dec272de3da0ac141dd8f91478ca",key:"d4a5",state:"Published",createdAt:"2020-08-12T18:17:44.285Z",sageScore:7,diffs:[{njs:10,offset:1,notes:168,bombs:16,obstacles:1,nps:1.029,length:348.25,characteristic:"Standard",difficulty:"Easy",events:7775,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:163.242,paritySummary:{errors:0,warns:0,resets:0},maxScore:147315,environment:"BigMirrorEnvironment"},{njs:11,offset:1,notes:255,bombs:16,obstacles:1,nps:1.562,length:348.25,characteristic:"Standard",difficulty:"Normal",events:7775,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:163.242,paritySummary:{errors:1,warns:1,resets:0},maxScore:227355,environment:"BigMirrorEnvironment"},{njs:12,offset:1,notes:358,bombs:16,obstacles:1,nps:2.193,length:348.25,characteristic:"Standard",difficulty:"Hard",events:7775,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:163.242,paritySummary:{errors:0,warns:0,resets:0},maxScore:322115,environment:"BigMirrorEnvironment"},{njs:15,offset:0,notes:557,bombs:16,obstacles:1,nps:3.335,length:356.25,characteristic:"Standard",difficulty:"Expert",events:7775,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:166.992,paritySummary:{errors:0,warns:0,resets:0},maxScore:505195,environment:"BigMirrorEnvironment"},{njs:19,offset:-.5,notes:778,bombs:16,obstacles:1,nps:4.659,length:356.25,characteristic:"Standard",difficulty:"ExpertPlus",events:7775,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:166.992,paritySummary:{errors:0,warns:0,resets:0},maxScore:708515,environment:"BigMirrorEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/d7cb32f23041dec272de3da0ac141dd8f91478ca.zip",coverURL:"https://eu.cdn.beatsaver.com/d7cb32f23041dec272de3da0ac141dd8f91478ca.jpg",previewURL:"https://eu.cdn.beatsaver.com/d7cb32f23041dec272de3da0ac141dd8f91478ca.mp3"}],curator:{id:4316945,name:"BeastSaber",avatar:"https://cdn.beatsaver.com/avatar/4316945.jpg",type:"SIMPLE",admin:!1,curator:!0,seniorCurator:!1,curatorTab:!0,playlistUrl:"https://api.beatsaver.com/users/id/4316945/playlist"},curatedAt:"2020-08-12T18:17:44.285Z",createdAt:"2020-08-12T18:17:44.285Z",updatedAt:"2020-08-12T18:17:44.285Z",lastPublishedAt:"2020-08-12T18:17:44.285Z",tags:["j-pop","house"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"4968d",name:"{Vivify} Jaron - 743⁺Aether*✧ ˳ ⁎ ¹¹¹} ⁺ . ˳",description:"**Originally, this map was going to be my Extra Sensory II map.**\n\nHowever, given the insane density of this song, it demanded rapidly changing visuals that kept up with how dynamic it felt to listen to. I did not have the technical or artistic skill to pull off this song. I tried and failed, for 3 years. Finally, after executing Extra Sensory II this year, I realized it was time to tackle this behemoth of a project. This project took over ~350 hours, and 1000 repository commits. The majority of it was put together over the last 3 months.\n\nI really think that I executed on this vision to a tee, landing every single visual cue that I imagined ever since I heard the song for the first time in 2022. I hope you can feel the electricity of this experience <3\n\n✧\n\n**Special Thanks:**\n- **Frautcres** - Doing extensive technical performance investigations in order to make the map run without a hitch, as well as assisting with technical difficulties\n- **Chaimzy, Astra, HAMCORE, Mawntee, TheBlackParrot, TinyPawb, Klondike, RidgeVR, UGEcko** - Doing loads of playtesting and giving feedback to make the map feel as polished as it does\n- **SKYZA.** - Beautiful ribbon & saber textures\n- **Jaron** - Creating this incredible song, and supporting me over the years as I tried to make visuals that shaped up\n\nvideo: https://youtu.be/qZ1prxep0Wc\nproject source: https://github.com/Swifter1243/aether_map",uploader:{id:4284246,name:"Swifter",hash:"5dcf3af29eccad0006a0b45f",avatar:"https://cdn.beatsaver.com/avatar/9473c86aef59ee6780dce3b2f091ee167e75bbc3.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4284246/playlist"},metadata:{bpm:145,duration:274,songName:"743+Aether*✧ . * 111} + , .",songSubName:"",songAuthorName:"Jaron",levelAuthorName:"Swifter"},stats:{plays:0,downloads:0,upvotes:2252,downvotes:15,score:.9876,reviews:34,sentiment:"VERY_POSITIVE"},uploaded:"2025-08-14T16:00:00.354832Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"cc66335f2b8bf50fe49591dd925860b2e596018e",state:"Published",createdAt:"2025-08-14T16:13:20.156249Z",sageScore:3,diffs:[{njs:12,offset:-.5,notes:444,bombs:0,obstacles:0,nps:1.698,length:632,characteristic:"Standard",difficulty:"Expert",events:0,chroma:!0,me:!1,ne:!0,cinema:!1,vivify:!0,seconds:261.517,paritySummary:{errors:0,warns:0,resets:0},maxScore:401235,label:"✧",environment:"BillieEnvironment"},{njs:16,offset:-.5,notes:703,bombs:0,obstacles:0,nps:2.688,length:632,characteristic:"Lawless",difficulty:"ExpertPlus",events:0,chroma:!0,me:!1,ne:!0,cinema:!1,vivify:!0,seconds:261.517,paritySummary:{errors:0,warns:0,resets:0},maxScore:639515,label:"\\___*",environment:"BillieEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/cc66335f2b8bf50fe49591dd925860b2e596018e.zip",coverURL:"https://eu.cdn.beatsaver.com/cc66335f2b8bf50fe49591dd925860b2e596018e.jpg",previewURL:"https://eu.cdn.beatsaver.com/cc66335f2b8bf50fe49591dd925860b2e596018e.mp3"}],curator:{id:4285538,name:"Darkrealm7",hash:"5ffa2803f2cdd000075e24ed",avatar:"https://cdn.beatsaver.com/avatar/7b66a32ba61dcfb938aa0d2207911eb08d28a06f.png",type:"DISCORD",admin:!1,curator:!0,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4285538/playlist"},curatedAt:"2025-08-14T21:11:11.210516Z",createdAt:"2025-08-14T04:02:49.366190Z",updatedAt:"2025-08-20T16:41:30.561039Z",lastPublishedAt:"2025-08-20T16:41:30.561039Z",bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"1362d",name:"Ghost Choir - Louie Zong (modchart)",description:"This is a relaxing modchart and a technical proof of concept. If you haven't played my modchart Dondante yet, please check it out: https://beatsaver.com/beatmap/123b5\r\n\r\nThe map requires the mods Noodle Extensions and Chroma. If Noodle Extensions is not available yet on ModAssistant, you can get the latest release at https://github.com/Aeroluna/NoodleExtensions/releases/tag/v1.3.5\r\n\r\nTips for a better experience:\r\n- Disable static lights; there are no lights anyway\r\n- Hide the HUD\r\n- Turn the SFX volume down (0 or low value like 0.2)\r\n- Enable bloom post-processing\r\n\r\nPreview: https://youtu.be/XC7RY9C_EHs\r\n\r\nI adapted this from Louie Zong's original animation: https://youtu.be/kXF3VYYa5TI\r\n\r\n",uploader:{id:4288814,name:"nyri0",hash:"5e792df416c9680006086a78",avatar:"https://cdn.beatsaver.com/avatar/233323d456510756fbbc0140c1a0698caf8b096c.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,playlistUrl:"https://api.beatsaver.com/users/id/4288814/playlist"},metadata:{bpm:67,duration:90,songName:"Ghost Choir",songSubName:"",songAuthorName:"Louie Zong",levelAuthorName:"nyri0"},stats:{plays:0,downloads:0,upvotes:4478,downvotes:42,score:.987,reviews:6,sentiment:"VERY_POSITIVE"},uploaded:"2021-01-30T12:31:29.825Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"1d373506c0b2b82867411f18696a1ad53d4ea01d",key:"1362d",state:"Published",createdAt:"2021-01-30T12:31:29.825Z",sageScore:2,diffs:[{njs:14,offset:0,notes:138,bombs:0,obstacles:1460,nps:1.684,length:91.5,characteristic:"Standard",difficulty:"Hard",events:5,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:81.94,paritySummary:{errors:4,warns:3,resets:0},maxScore:119715,label:"Oooo",environment:"BigMirrorEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/1d373506c0b2b82867411f18696a1ad53d4ea01d.zip",coverURL:"https://eu.cdn.beatsaver.com/1d373506c0b2b82867411f18696a1ad53d4ea01d.jpg",previewURL:"https://eu.cdn.beatsaver.com/1d373506c0b2b82867411f18696a1ad53d4ea01d.mp3"}],createdAt:"2021-01-30T12:31:29.825Z",updatedAt:"2021-01-30T12:31:29.825Z",lastPublishedAt:"2021-01-30T12:31:29.825Z",bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"198f3",name:"Spider Dance - Toby Fox (Undertale modchart)",description:"There are countless Undertale maps on Beat Saber, but what if you could actually experience a real boss fight? It's now possible thanks to Noodle Extensions, and I'm proud to present to you the first Undertale modchart: Spider Dance, where you will confront Muffet.\r\n\r\nTips for a better experience:\r\n- Don't use static lights; there shouldn't be any lights\r\n- Hide the HUD in player settings\r\n- Enable \"bloom post-processing\"\r\n- Enable \"screen distortion effects\"\r\n\r\nInstallation instructions:\r\n- You will need Noodle Extensions and Chroma and their dependencies. All are now available on ModAssistant.\r\n- If you read this in a future where the update broke the mods and they haven't been approved on ModAssistant yet, install the basic mods from ModAssistant and get the latest releases of Noodle Extensions, Heck, and Chroma from Aeroluna's GitHub: https://github.com/Aeroluna\r\n\r\nVideo: https://youtu.be/fy8KmUor6fI\r\n\r\nI started this a while ago before Ghost Choir and then abandoned the project. But I finally decided to finish the work, so I hope you'll enjoy it :)\r\nThanks to Reaxt and Cyansnow, who testplayed and made detailed suggestions that helped me improve the quality of this map. I really appreciate it.\r\n\r\nMy social media links (please follow/subscribe): https://linktr.ee/nyri0",uploader:{id:4288814,name:"nyri0",hash:"5e792df416c9680006086a78",avatar:"https://cdn.beatsaver.com/avatar/233323d456510756fbbc0140c1a0698caf8b096c.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,playlistUrl:"https://api.beatsaver.com/users/id/4288814/playlist"},metadata:{bpm:115,duration:114,songName:"Spider Dance",songSubName:"",songAuthorName:"Toby Fox",levelAuthorName:"nyri0"},stats:{plays:0,downloads:0,upvotes:10995,downvotes:123,score:.9868,reviews:6,sentiment:"VERY_POSITIVE"},uploaded:"2021-06-25T17:47:40.296Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"09246637fa63ac55aa518718fd1eb4b876960480",key:"198f3",state:"Published",createdAt:"2021-06-25T17:47:40.296Z",sageScore:2,diffs:[{njs:16,offset:0,notes:434,bombs:88,obstacles:1153,nps:4.377,length:190.063,characteristic:"Standard",difficulty:"ExpertPlus",events:5,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:99.163,paritySummary:{errors:13,warns:13,resets:0},maxScore:392035,label:"9999G",environment:"BigMirrorEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/09246637fa63ac55aa518718fd1eb4b876960480.zip",coverURL:"https://eu.cdn.beatsaver.com/09246637fa63ac55aa518718fd1eb4b876960480.jpg",previewURL:"https://eu.cdn.beatsaver.com/09246637fa63ac55aa518718fd1eb4b876960480.mp3"}],curator:{id:73032,name:"Bytrius",hash:"5de442271dc9e8000696cd15",avatar:"https://cdn.beatsaver.com/avatar/62ed9906317427e9b14435ca144c7189b83a711a.png",type:"DISCORD",admin:!0,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/73032/playlist"},curatedAt:"2021-06-25T17:47:40.296Z",createdAt:"2021-06-25T17:47:40.296Z",updatedAt:"2021-06-25T17:47:40.296Z",lastPublishedAt:"2021-06-25T17:47:40.296Z",tags:["electronic","video-game-soundtrack","balanced"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"23f6b",name:"acloudyskye & N33T - Nothing Else (Modchart)",description:"9 months ago I created my first chroma map. At this time I didn't think I could make a map that you are about to play\nIn these 9 months, I learned a lot about walls, notes, environment enhancement, etc... but mostly how to properly polish a map.\nI wanted to make something big, something even bigger than SOT(as in scale swifter silly u) and here I am today publishing this map.\nThis map contains 7 different unique environments that connect together with seamless transitions.\nThis map is a big step in the journey of modhcarts just like SOT.\nI hope more people will see this modhcart as a place they can start and learn Noodle Extensions, You can also check the script of the modhcart on my Github. https://github.com/TzurS11/NoodleScript/tree/main/Examples/Scripts\n\nLastly, I wanna thank all the people that helped. even if you are not on this list I appreciate What you've done a lot!\n@GojiCrafter, @tall_chilis_boi, @Swifter, @Mawntee, Stick, kiwii.\n\nShowcase: https://youtu.be/qkSe0gOctEU\n\nbtw HAHA get fucked swifter! I got more environments than in SOT",uploader:{id:4284455,name:"TzurS11",hash:"6040a8135ab13d0006093512",avatar:"https://cdn.beatsaver.com/avatar/87d26d1223ba8840e9dca8d433165f717e7584e1.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,playlistUrl:"https://api.beatsaver.com/users/id/4284455/playlist"},metadata:{bpm:125,duration:291,songName:"Nothing Else",songSubName:"",songAuthorName:"acloudyskye & N33T",levelAuthorName:"TzurS11"},stats:{plays:0,downloads:0,upvotes:2949,downvotes:25,score:.9867,reviews:3},uploaded:"2022-04-10T19:30:00.565807Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"e45b69a9428505e93f73f1bdc43909d43fc844e3",state:"Published",createdAt:"2022-04-10T20:32:24.193634Z",sageScore:3,diffs:[{njs:16,offset:0,notes:919,bombs:0,obstacles:0,nps:3.298,length:580.5,characteristic:"Standard",difficulty:"ExpertPlus",events:18391,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:278.64,paritySummary:{errors:25,warns:13,resets:0},maxScore:838235,label:"You can hide away the fears you face\n\nRead Warnings!",environment:"BTSEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/e45b69a9428505e93f73f1bdc43909d43fc844e3.zip",coverURL:"https://eu.cdn.beatsaver.com/e45b69a9428505e93f73f1bdc43909d43fc844e3.jpg",previewURL:"https://eu.cdn.beatsaver.com/e45b69a9428505e93f73f1bdc43909d43fc844e3.mp3"}],curator:{id:4284947,name:"Phoenix",hash:"5fa08b5281e1d70006f1b322",avatar:"https://cdn.beatsaver.com/avatar/4284947.jpg",type:"SIMPLE",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4284947/playlist"},curatedAt:"2022-04-10T20:55:22.272218Z",createdAt:"2022-04-05T14:25:21.240039Z",updatedAt:"2022-08-25T11:32:19.554653Z",lastPublishedAt:"2022-04-10T20:32:58.830331Z",tags:["balanced","electronic","dance"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"32693",name:"Fall Out Boy - The Phoenix",description:"Might be one of my most accessible mapsets yet as a custom-lit full spread of difficulties paired with both a lawless expert+ and one saber difficulties! Made this one for a friend of mine who's a big FoB fan. Enjoy!\n\nFeedback via reviews down below is always appreciated!\n\nPreview: https://youtu.be/2LFQLJd0pOQ\n\nSocials:\nhttps://twitter.com/bytrius\nhttps://www.youtube.com/c/bytrius\nhttps://bsaber.com/members/bytrius/\nhttps://www.twitch.tv/bytrius",uploader:{id:73032,name:"Bytrius",hash:"5de442271dc9e8000696cd15",avatar:"https://cdn.beatsaver.com/avatar/62ed9906317427e9b14435ca144c7189b83a711a.png",type:"DISCORD",admin:!0,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/73032/playlist"},metadata:{bpm:138,duration:246,songName:"The Phoenix",songSubName:"",songAuthorName:"Fall Out Boy",levelAuthorName:"Bytrius"},stats:{plays:0,downloads:0,upvotes:5122,downvotes:52,score:.9865,reviews:6,sentiment:"VERY_POSITIVE"},uploaded:"2023-05-31T23:01:59.709120Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"bf2c367d29b133b66dc27f6f8e20467d0ec3301f",state:"Published",createdAt:"2023-05-31T22:51:42.410637Z",sageScore:5,diffs:[{njs:10,offset:-.95,notes:494,bombs:0,obstacles:44,nps:2.055,length:553,characteristic:"Standard",difficulty:"Easy",events:4607,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:240.435,paritySummary:{errors:0,warns:0,resets:0},maxScore:447235,blStars:2.56,environment:"NiceEnvironment"},{njs:12,offset:.3,notes:545,bombs:0,obstacles:38,nps:2.267,length:553,characteristic:"Standard",difficulty:"Normal",events:4607,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:240.435,paritySummary:{errors:0,warns:0,resets:0},maxScore:494155,blStars:3.04,environment:"NiceEnvironment"},{njs:14,offset:-.2,notes:767,bombs:0,obstacles:6,nps:3.19,length:553,characteristic:"Standard",difficulty:"Hard",events:4607,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:240.435,paritySummary:{errors:0,warns:0,resets:0},maxScore:700075,blStars:4.07,environment:"NiceEnvironment"},{njs:15,offset:-.475,notes:851,bombs:0,obstacles:9,nps:3.539,length:553,characteristic:"Standard",difficulty:"Expert",events:4607,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:240.435,paritySummary:{errors:0,warns:0,resets:0},maxScore:779035,blStars:4.86,environment:"NiceEnvironment"},{njs:17,offset:-.75,notes:1384,bombs:0,obstacles:4,nps:5.756,length:553,characteristic:"Standard",difficulty:"ExpertPlus",events:4607,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:240.435,paritySummary:{errors:0,warns:0,resets:0},maxScore:1272275,blStars:6.51,environment:"NiceEnvironment"},{njs:16,offset:-.65,notes:816,bombs:0,obstacles:29,nps:3.394,length:553,characteristic:"OneSaber",difficulty:"ExpertPlus",events:4607,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:240.435,paritySummary:{errors:0,warns:0,resets:0},maxScore:743475,blStars:8.35,environment:"NiceEnvironment"},{njs:17,offset:-.75,notes:1388,bombs:0,obstacles:4,nps:5.773,length:553,characteristic:"Lawless",difficulty:"ExpertPlus",events:4607,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:240.435,paritySummary:{errors:0,warns:0,resets:0},maxScore:1275955,label:"Double Downs",environment:"NiceEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/bf2c367d29b133b66dc27f6f8e20467d0ec3301f.zip",coverURL:"https://eu.cdn.beatsaver.com/bf2c367d29b133b66dc27f6f8e20467d0ec3301f.jpg",previewURL:"https://eu.cdn.beatsaver.com/bf2c367d29b133b66dc27f6f8e20467d0ec3301f.mp3"}],curator:{id:4284947,name:"Phoenix",hash:"5fa08b5281e1d70006f1b322",avatar:"https://cdn.beatsaver.com/avatar/4284947.jpg",type:"SIMPLE",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4284947/playlist"},curatedAt:"2023-06-01T02:16:21.699148Z",createdAt:"2023-05-16T06:12:18.475582Z",updatedAt:"2024-08-27T09:34:28.073772Z",lastPublishedAt:"2023-05-31T23:01:59.709120Z",tags:["dance-style","pop","punk"],bookmarked:!1,declaredAi:"None",blRanked:!0,blQualified:!1},{id:"1dcf4",name:"DYES IWASAKI - Bad Hatter ft. Lily Mizusaki",description:'Part of my second custom map pack!\n\nGameplay preview:\nhttps://www.youtube.com/watch?v=ZE5enFMVsv8\n\nGet the pack here:\nhttps://bsaber.com/tokyo-neo-swing/\n\nThis time around I took the extra time and made full spreads and chroma lightshows for each of the 6 songs of the album "Tokyo Neo Swing" by DYES IWASAKI & Lily Mizusaki.\n\nHuge thanks to the lovely playtesters MaybeeMae, Cocci, Monstor, Vaser888, and Kansas!\n\nAlso here is my playthrough of the entire pack on Expert Plus:\nhttps://www.youtube.com/watch?v=lgXR4sBl_kk\n\n\nMore Maps: https://beatsaver.com/profile/4286374\nDiscord Tag: Nixie.Korten#6944\nJoin My Server: https://discord.gg/RjxPpZtH7w\nTwitter: https://twitter.com/Nixie_Korten\nInstagram: https://www.instagram.com/nixie.korten/',uploader:{id:4286374,name:"Nixie.Korten",hash:"6096752e12772e0006e2f7e6",avatar:"https://cdn.beatsaver.com/avatar/bb97db2b49d21f5cbc1a5ba50742fa0e5c86ed3c.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4286374/playlist"},metadata:{bpm:122,duration:176,songName:"Bad Hatter",songSubName:"(ft. Lily Mizusaki)",songAuthorName:"DYES IWASAKI",levelAuthorName:"Nixie.Korten"},stats:{plays:0,downloads:0,upvotes:4470,downvotes:44,score:.9865,reviews:3},uploaded:"2021-11-11T13:06:30.332180Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"ebcf0c8780551bfe0feb96fbc255accad548798b",state:"Published",createdAt:"2021-11-14T11:39:03.473167Z",sageScore:6,diffs:[{njs:12,offset:1,notes:212,bombs:0,obstacles:0,nps:1.249,length:345.167,characteristic:"Standard",difficulty:"Easy",events:4454,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:169.754,paritySummary:{errors:46,warns:12,resets:0},maxScore:187795,environment:"FitBeatEnvironment"},{njs:12,offset:.5,notes:320,bombs:0,obstacles:0,nps:1.885,length:345.167,characteristic:"Standard",difficulty:"Normal",events:4454,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:169.754,paritySummary:{errors:29,warns:14,resets:0},maxScore:287155,environment:"FitBeatEnvironment"},{njs:14,offset:0,notes:491,bombs:0,obstacles:2,nps:2.89,length:345.5,characteristic:"Standard",difficulty:"Hard",events:4454,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:169.918,paritySummary:{errors:4,warns:0,resets:0},maxScore:444475,environment:"FitBeatEnvironment"},{njs:16,offset:-.5,notes:697,bombs:0,obstacles:0,nps:4.102,length:345.5,characteristic:"Standard",difficulty:"Expert",events:4454,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:169.918,paritySummary:{errors:0,warns:9,resets:0},maxScore:633995,environment:"FitBeatEnvironment"},{njs:19,offset:.25,notes:924,bombs:0,obstacles:0,nps:5.438,length:345.5,characteristic:"Standard",difficulty:"ExpertPlus",events:4454,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:169.918,paritySummary:{errors:0,warns:0,resets:0},maxScore:842835,environment:"FitBeatEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/ebcf0c8780551bfe0feb96fbc255accad548798b.zip",coverURL:"https://eu.cdn.beatsaver.com/ebcf0c8780551bfe0feb96fbc255accad548798b.jpg",previewURL:"https://eu.cdn.beatsaver.com/ebcf0c8780551bfe0feb96fbc255accad548798b.mp3"}],curator:{id:4299228,name:"tan",avatar:"https://cdn.beatsaver.com/avatar/19d0c285757c0eea70e922961581953cfd96769b.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,playlistUrl:"https://api.beatsaver.com/users/id/4299228/playlist"},curatedAt:"2021-11-11T13:06:30.332180Z",createdAt:"2021-11-10T18:01:16.390803Z",updatedAt:"2024-11-02T11:19:03.182227Z",lastPublishedAt:"2021-11-14T11:39:08.754762Z",tags:["swing","dance-style","balanced","electronic"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"b7aa",name:"Powerwolf - Venom of Venus",description:"Back to my more regular style, Powerwolf is a power-metal band that perform around the themes of werewolves and religion, a strange but interesting mixture.\r\n\r\nEx+ has a no-colours mode for those who wish to play without the custom block colours, but unfortunately I can't fit such an option for all difficulties.\r\n\r\nNormal 1.85 NPS\r\nHard 3.15 NPS\r\nExpert 4.43 NPS\r\nExpert+ 5.11 NPS\r\n\r\nThere is no easy difficulty, as that I needed the slot for the no-colour mode.",uploader:{id:4285369,name:"Cyrix",hash:"5eb6eb9a7abb000006c85add",avatar:"https://cdn.beatsaver.com/avatar/4213c7b05b9778149ae4536dd10842c6ed307ec5.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4285369/playlist"},metadata:{bpm:164,duration:211,songName:"Venom of Venus",songSubName:"",songAuthorName:"Powerwolf",levelAuthorName:"Cyrix"},stats:{plays:0,downloads:0,upvotes:8e3,downvotes:91,score:.9862,reviews:14,sentiment:"VERY_POSITIVE"},uploaded:"2020-06-29T18:24:10.081Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"f88b43c770dcd85a4ba18368853fbf062d41a09c",key:"b7aa",state:"Published",createdAt:"2020-06-29T18:24:10.081Z",sageScore:7,diffs:[{njs:12,offset:.5,notes:392,bombs:0,obstacles:63,nps:1.948,length:549.938,characteristic:"Standard",difficulty:"Easy",events:4188,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:201.197,paritySummary:{errors:44,warns:15,resets:0},maxScore:353395,label:"Normal",environment:"PanicEnvironment"},{njs:13,offset:1,notes:666,bombs:8,obstacles:36,nps:3.31,length:549.938,characteristic:"Standard",difficulty:"Normal",events:4188,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:201.197,paritySummary:{errors:1,warns:0,resets:1},maxScore:605475,label:"Hard",environment:"PanicEnvironment"},{njs:17,offset:0,notes:934,bombs:9,obstacles:7,nps:4.642,length:549.938,characteristic:"Standard",difficulty:"Hard",events:4188,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:201.197,paritySummary:{errors:0,warns:0,resets:2},maxScore:852035,label:"Ex",environment:"PanicEnvironment"},{njs:20,offset:-.25,notes:1079,bombs:4,obstacles:7,nps:5.353,length:551,characteristic:"Standard",difficulty:"Expert",events:4192,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:201.585,paritySummary:{errors:1,warns:0,resets:2},maxScore:985435,label:"Ex+ No Colour",environment:"PanicEnvironment"},{njs:20,offset:-.25,notes:1079,bombs:4,obstacles:7,nps:5.353,length:551,characteristic:"Standard",difficulty:"ExpertPlus",events:4192,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:201.585,paritySummary:{errors:1,warns:0,resets:2},maxScore:985435,label:"Ex+",environment:"PanicEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/f88b43c770dcd85a4ba18368853fbf062d41a09c.zip",coverURL:"https://eu.cdn.beatsaver.com/f88b43c770dcd85a4ba18368853fbf062d41a09c.jpg",previewURL:"https://eu.cdn.beatsaver.com/f88b43c770dcd85a4ba18368853fbf062d41a09c.mp3"}],curator:{id:4316945,name:"BeastSaber",avatar:"https://cdn.beatsaver.com/avatar/4316945.jpg",type:"SIMPLE",admin:!1,curator:!0,seniorCurator:!1,curatorTab:!0,playlistUrl:"https://api.beatsaver.com/users/id/4316945/playlist"},curatedAt:"2020-06-29T18:24:10.081Z",createdAt:"2020-06-29T18:24:10.081Z",updatedAt:"2020-06-29T18:24:10.081Z",lastPublishedAt:"2020-06-29T18:24:10.081Z",tags:["metal","balanced"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"210e3",name:"[Modchart] Sarah Cothran - As The World Caves In",description:"This started out as just a simple environment animation test, and then quickly snowballed out into one of my favourite maps I've made so far!\n\nAlso big ups to Fatalution for doing the lighting on this!\nThis is our first collab together, and the first time I've collaborated on a map with someone who shared the same ideas/thought process as myself. \nThis definitely won't be our last collab :)\n\nCheck out their profile and lightshow preview here:\nhttps://beatsaver.com/profile/84945\nhttps://youtu.be/1Fh5jL_UJBc\n\n\nWARNING:\nThis map may cause mild motion sickness! \nIf you feel sick at any point, remember that you can pause and it will stop everything!\n\n(If you have frequent issues with motion sickness in VR, I recommend having a fan on, or keeping smaller carpet with a different texture in your playspace)",uploader:{id:4285959,name:"Mawntee",hash:"5cff0b7698cc5a672c854ca6",avatar:"https://cdn.beatsaver.com/avatar/e373d502d75ed37d9cc60d2aa58b08f8ab6ebc90.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4285959/playlist"},metadata:{bpm:124,duration:164,songName:"As The World Caves In",songSubName:"",songAuthorName:"Sarah Cothran",levelAuthorName:"Mawntee & Fatalution"},stats:{plays:0,downloads:0,upvotes:8562,downvotes:100,score:.986,reviews:22,sentiment:"VERY_POSITIVE"},uploaded:"2022-02-02T20:18:54.976546Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"d4d847465bff16bc936e8281b5e3c703a4ca1c93",state:"Published",createdAt:"2022-02-02T20:27:55.445283Z",sageScore:4,diffs:[{njs:18,offset:1.961111,notes:259,bombs:20,obstacles:0,nps:1.63,length:328.466,characteristic:"Standard",difficulty:"ExpertPlus",events:31028,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:158.935,paritySummary:{errors:403,warns:36,resets:11},maxScore:231035,label:"Our Final Night Alive",environment:"TimbalandEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/d4d847465bff16bc936e8281b5e3c703a4ca1c93.zip",coverURL:"https://eu.cdn.beatsaver.com/d4d847465bff16bc936e8281b5e3c703a4ca1c93.jpg",previewURL:"https://eu.cdn.beatsaver.com/d4d847465bff16bc936e8281b5e3c703a4ca1c93.mp3"}],curator:{id:4234800,name:"AllieeCute",avatar:"https://cdn.beatsaver.com/avatar/f3788635ba87f3e1144e26501fe02c26b29aaccc.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,playlistUrl:"https://api.beatsaver.com/users/id/4234800/playlist"},curatedAt:"2022-02-02T20:18:54.976546Z",createdAt:"2022-02-02T20:07:53.311141Z",updatedAt:"2023-10-16T18:16:00.863418Z",lastPublishedAt:"2023-06-06T14:03:19.315272Z",tags:["accuracy","dance-style"],bookmarked:!1,collaborators:[{id:84945,name:"fatalution",hash:"5cff0b7398cc5a672c84f30a",avatar:"https://cdn.beatsaver.com/avatar/7b7e7792dd5a8b250b5205c3a823d7d4006182f5.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/84945/playlist"}],declaredAi:"None",blRanked:!1,blQualified:!1},{id:"352d8",name:"Belle - Lend Me Your Voice [Noodle Extension, Chrom+] (Remastered!!!)",description:'If you are seasick in VR, do not play the "ALL EFFECTS" and "NO rotation (360 °)". For you, difficulty - "NO effects"\n\nIf there are performance problems disable "Mirror" in the graphics settings\n\nSong - https://music.youtube.com/watch?v=nSbhUCM5Z6s',uploader:{id:4284370,name:"hickeychan",hash:"6001ba1539ce5b000682a59f",avatar:"https://cdn.beatsaver.com/avatar/ecb540d442d3dbcd21881c32b050977d282a7438.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4284370/playlist"},metadata:{bpm:121,duration:304,songName:"Lend Me Your Voice",songSubName:"",songAuthorName:"Kaho Nakamura",levelAuthorName:"HickeyChan"},stats:{plays:0,downloads:0,upvotes:1156,downvotes:6,score:.9859,reviews:3},uploaded:"2023-08-24T10:14:50.865197Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"be0ab6e5f1b5581a9a053f4a4c144c785696d349",state:"Published",createdAt:"2023-08-24T10:12:42.966966Z",sageScore:1,diffs:[{njs:16,offset:-.7,notes:687,bombs:0,obstacles:2859,nps:2.34,length:592.155,characteristic:"Standard",difficulty:"Hard",events:25577,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:293.631,paritySummary:{errors:0,warns:0,resets:0},maxScore:624795,label:"NO effects",environment:"BTSEnvironment"},{njs:16,offset:-.7,notes:687,bombs:0,obstacles:2859,nps:2.34,length:592.155,characteristic:"Standard",difficulty:"Expert",events:25577,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:293.631,paritySummary:{errors:0,warns:0,resets:0},maxScore:624795,label:"NO rotation (360 °)",environment:"BTSEnvironment"},{njs:16,offset:-.7,notes:687,bombs:0,obstacles:2859,nps:2.34,length:592.155,characteristic:"Standard",difficulty:"ExpertPlus",events:25577,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:293.631,paritySummary:{errors:0,warns:0,resets:0},maxScore:624795,label:"ALL EFFECTS",environment:"BTSEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/be0ab6e5f1b5581a9a053f4a4c144c785696d349.zip",coverURL:"https://eu.cdn.beatsaver.com/be0ab6e5f1b5581a9a053f4a4c144c785696d349.jpg",previewURL:"https://eu.cdn.beatsaver.com/be0ab6e5f1b5581a9a053f4a4c144c785696d349.mp3"}],curator:{id:4292041,name:"symphonic",avatar:"https://cdn.beatsaver.com/avatar/2dc906ee5b78c2cb723f0eae964c2c203babf3f4.png",type:"DISCORD",admin:!0,curator:!0,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4292041/playlist"},curatedAt:"2023-08-25T06:09:54.756879Z",createdAt:"2023-08-24T10:12:42.966966Z",updatedAt:"2023-09-04T05:38:48.731043Z",lastPublishedAt:"2023-08-24T10:14:50.865197Z",tags:["accuracy","balanced","anime","classical-orchestral"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"1a0b8",name:"[Electro Swing Pack] Wolfgang Lohr & The Swinghoppers - Party Like It's 1920",description:"Nixie Presents: Electro Swing Pack!\n\n10 electro swing songs with expert and expert+ diffs to make your booty swing!\n\nGet The Pack: \nhttps://bsaber.com/electro-swing-pack/\n\nMap Gameplay:\nhttps://youtu.be/ye22W_xrXnk\n\nComplete Pack Playthrough:\nhttps://youtu.be/yj9rw4MEh7s\n\n\nHuge thanks in particular to:\nMonstor, Bearly, Noxn, Bullet, Vaser888, Tocxx, Jafdy, Storm Knight and Pixelguy!\n\n\nMore Maps: https://beatsaver.com/profile/4286374\nDiscord Tag: Nixie.Korten#6944\nJoin My Server: https://discord.gg/RjxPpZtH7w\nTwitter: https://twitter.com/Nixie_Korten\nInstagram: https://www.instagram.com/nixie.korten/",uploader:{id:4286374,name:"Nixie.Korten",hash:"6096752e12772e0006e2f7e6",avatar:"https://cdn.beatsaver.com/avatar/bb97db2b49d21f5cbc1a5ba50742fa0e5c86ed3c.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4286374/playlist"},metadata:{bpm:120,duration:187,songName:"Party Like It's 1920",songSubName:"",songAuthorName:"The Swinghoppers & Wolfgang Lohr",levelAuthorName:"Nixie.Korten"},stats:{plays:0,downloads:0,upvotes:4194,downvotes:45,score:.9855,reviews:1},uploaded:"2021-07-08T15:25:28.451Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"973bab980b568e41b0a17a772e61377b01ef85ec",key:"1a0b8",state:"Published",createdAt:"2021-07-08T15:25:28.451Z",sageScore:4,diffs:[{njs:16,offset:-.5,notes:556,bombs:0,obstacles:0,nps:3.063,length:363,characteristic:"Standard",difficulty:"Expert",events:2057,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:181.5,paritySummary:{errors:0,warns:0,resets:0},maxScore:504275,environment:"PanicEnvironment"},{njs:19,offset:.25,notes:850,bombs:0,obstacles:0,nps:4.683,length:363,characteristic:"Standard",difficulty:"ExpertPlus",events:2057,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:181.5,paritySummary:{errors:0,warns:0,resets:0},maxScore:774755,environment:"PanicEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/973bab980b568e41b0a17a772e61377b01ef85ec.zip",coverURL:"https://eu.cdn.beatsaver.com/973bab980b568e41b0a17a772e61377b01ef85ec.jpg",previewURL:"https://eu.cdn.beatsaver.com/973bab980b568e41b0a17a772e61377b01ef85ec.mp3"}],curator:{id:73032,name:"Bytrius",hash:"5de442271dc9e8000696cd15",avatar:"https://cdn.beatsaver.com/avatar/62ed9906317427e9b14435ca144c7189b83a711a.png",type:"DISCORD",admin:!0,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/73032/playlist"},curatedAt:"2021-07-08T15:25:28.451Z",createdAt:"2021-07-08T15:25:28.451Z",updatedAt:"2024-11-02T11:17:34.643709Z",lastPublishedAt:"2021-07-08T15:25:28.451Z",tags:["swing","balanced","dance-style","electronic"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"1181f",name:"Royal & the Serpent - Overwhelmed",description:"Feeling that finals crunch? Worried about the pandemic? General anxiety with the news, and just feeling overwhelmed? Don't forget to take a step back and take a breath. Maybe by dancing along to this song that perfectly captures all of those feelings! Complete with overwhelming Chroma 2.0 lights! And now the extra details:\n\nBPM: 87\nNPS: Ez - 1.71; N - 2.09; H - 2.75; Ex - 3.19; Ex+ - 4.11\nNotes: Ez - 277; N - 338; H - 444; Ex - 516; Ex+ - 664\nBombs: Ez - 0; N - 0; H - 4; Ex - 4; Ex+ - 4\nWalls: Ez - 136; N - 134; H - 144; Ex - 109; Ex+ - 109\n\nSpecial thanks to qwasyx, Smay, and Cyrix for playtesting!",uploader:{id:4285188,name:"fruhead",hash:"5cff0b7598cc5a672c852683",avatar:"https://cdn.beatsaver.com/avatar/bcfbb8e5ac8665ae28d37b76a402daf0b88a68d0.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4285188/playlist"},metadata:{bpm:87,duration:161,songName:"Overwhelmed",songSubName:"",songAuthorName:"Royal & the Serpent",levelAuthorName:"fruhead"},stats:{plays:0,downloads:0,upvotes:7135,downvotes:85,score:.9854,reviews:4},uploaded:"2020-11-29T23:09:47.309Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"b748894960a346f1568b9f4876643f1358cfa897",key:"1181f",state:"Published",createdAt:"2020-11-29T23:09:47.309Z",sageScore:6,diffs:[{njs:10,offset:0,notes:277,bombs:0,obstacles:136,nps:1.793,length:224,characteristic:"Standard",difficulty:"Easy",events:7200,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:154.483,paritySummary:{errors:43,warns:9,resets:0},maxScore:247595,environment:"PanicEnvironment"},{njs:12,offset:-.3,notes:338,bombs:0,obstacles:134,nps:2.188,length:224,characteristic:"Standard",difficulty:"Normal",events:7200,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:154.483,paritySummary:{errors:22,warns:11,resets:0},maxScore:303715,environment:"PanicEnvironment"},{njs:14,offset:.4,notes:444,bombs:4,obstacles:144,nps:2.874,length:224,characteristic:"Standard",difficulty:"Hard",events:7200,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:154.483,paritySummary:{errors:14,warns:4,resets:4},maxScore:401235,environment:"PanicEnvironment"},{njs:16,offset:.25,notes:516,bombs:4,obstacles:109,nps:3.34,length:224,characteristic:"Standard",difficulty:"Expert",events:7200,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:154.483,paritySummary:{errors:0,warns:0,resets:2},maxScore:467475,environment:"PanicEnvironment"},{njs:18,offset:.1,notes:664,bombs:4,obstacles:109,nps:4.298,length:224,characteristic:"Standard",difficulty:"ExpertPlus",events:7200,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:154.483,paritySummary:{errors:0,warns:0,resets:2},maxScore:603635,environment:"PanicEnvironment"},{njs:16,offset:0,notes:0,bombs:0,obstacles:0,nps:0,length:0,characteristic:"Lightshow",difficulty:"Expert",events:7200,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:0,paritySummary:{errors:0,warns:0,resets:0},maxScore:0,label:"Overwhelmed",environment:"PanicEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/b748894960a346f1568b9f4876643f1358cfa897.zip",coverURL:"https://eu.cdn.beatsaver.com/b748894960a346f1568b9f4876643f1358cfa897.jpg",previewURL:"https://eu.cdn.beatsaver.com/b748894960a346f1568b9f4876643f1358cfa897.mp3"}],curator:{id:76372,name:"brightknight",hash:"5f30421b8a13d900061fe595",avatar:"https://cdn.beatsaver.com/avatar/236b93ff0df8c0f0305e52b6d3d01fa3e588b7ec.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/76372/playlist"},curatedAt:"2020-11-29T23:09:47.309Z",createdAt:"2020-11-29T23:09:47.309Z",updatedAt:"2020-11-29T23:09:47.309Z",lastPublishedAt:"2020-11-29T23:09:47.309Z",tags:["balanced"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"4980",name:"(Old Version) Paradise - Coldplay",description:"\"Paradise\" is a song by the British rock band Coldplay. The song was released on 12 September 2011. I kinda like this song for relaxing on long car rides and I don't know how it will feel as a beat saber map but I'ma try mapping it anyways. So here it is :)\n\n2022 EDIT: Download the new map here: https://beatsaver.com/maps/28102",uploader:{id:58338,name:"Joetastic",hash:"5cff0b7498cc5a672c85050e",avatar:"https://cdn.beatsaver.com/avatar/91bb7b0510cea647179bc95e032f8a25608b09f1.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/58338/playlist"},metadata:{bpm:70,duration:278,songName:"Paradise",songSubName:"",songAuthorName:"Coldplay",levelAuthorName:"Joetastic"},stats:{plays:0,downloads:0,upvotes:6216,downvotes:74,score:.9852,reviews:1},uploaded:"2019-04-30T05:45:51Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"b14639af36673a43fe32bc7563619deff438d438",key:"4980",state:"Published",createdAt:"2019-04-30T05:45:51Z",sageScore:6,diffs:[{njs:13,offset:0,notes:1023,bombs:0,obstacles:35,nps:3.816,length:312.75,characteristic:"Standard",difficulty:"Expert",events:4651,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:268.071,paritySummary:{errors:28,warns:29,resets:0},maxScore:933915,environment:"TriangleEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/b14639af36673a43fe32bc7563619deff438d438.zip",coverURL:"https://eu.cdn.beatsaver.com/b14639af36673a43fe32bc7563619deff438d438.jpg",previewURL:"https://eu.cdn.beatsaver.com/b14639af36673a43fe32bc7563619deff438d438.mp3"}],curator:{id:4316945,name:"BeastSaber",avatar:"https://cdn.beatsaver.com/avatar/4316945.jpg",type:"SIMPLE",admin:!1,curator:!0,seniorCurator:!1,curatorTab:!0,playlistUrl:"https://api.beatsaver.com/users/id/4316945/playlist"},curatedAt:"2019-04-30T05:45:51Z",createdAt:"2019-04-30T05:45:51Z",updatedAt:"2022-07-22T08:36:01.092595Z",lastPublishedAt:"2019-04-30T05:45:51Z",tags:["alternative","indie"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"bdc7",name:"That's Life - Frank Sinatra",description:"Here is an honest-to-goodness human-mapped version of Frank Sinatra's 1966 hit, That's Life. This song is way too good to just have a crappy beat sage map.\n\nNormal and Hard Standard levels, and Expert Standard, 90, and 360 levels. Note that the expert levels are all essentially the same, just with varying degrees of wobbles.\n\nThanks to Maybeemae for the playtests!\n\nhttps://youtu.be/QXjj2-fgK8U",uploader:{id:78593,name:"techbutterfly",hash:"5cff0b7798cc5a672c8566f7",avatar:"https://cdn.beatsaver.com/avatar/99c0065fcfac5bfcf11adc69a58a8d3251bd748e.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/78593/playlist"},metadata:{bpm:77,duration:187,songName:"That's Life",songSubName:"",songAuthorName:"Frank Sinatra",levelAuthorName:"TechButterfly"},stats:{plays:0,downloads:0,upvotes:3713,downvotes:40,score:.9851,reviews:8,sentiment:"VERY_POSITIVE"},uploaded:"2020-07-11T22:35:42.033Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"7cca8c1afecd782cfd74f158c312201b780043d8",key:"bdc7",state:"Published",createdAt:"2020-07-11T22:35:42.033Z",sageScore:4,diffs:[{njs:10,offset:-.3,notes:321,bombs:0,obstacles:6,nps:1.768,length:233,characteristic:"Standard",difficulty:"Normal",events:1086,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:181.558,paritySummary:{errors:30,warns:41,resets:0},maxScore:288075,environment:"NiceEnvironment"},{njs:12,offset:.3,notes:418,bombs:0,obstacles:8,nps:2.302,length:233,characteristic:"Standard",difficulty:"Hard",events:1086,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:181.558,paritySummary:{errors:24,warns:38,resets:0},maxScore:377315,environment:"NiceEnvironment"},{njs:13,offset:.1,notes:492,bombs:0,obstacles:8,nps:2.71,length:233,characteristic:"Standard",difficulty:"Expert",events:1086,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:181.558,paritySummary:{errors:24,warns:26,resets:0},maxScore:445395,environment:"NiceEnvironment"},{njs:13,offset:.3,notes:489,bombs:0,obstacles:8,nps:2.693,length:233,characteristic:"90Degree",difficulty:"Expert",events:1192,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:181.558,paritySummary:{errors:25,warns:27,resets:0},maxScore:442635,label:"Expert 90",environment:"GlassDesertEnvironment"},{njs:13,offset:.3,notes:489,bombs:0,obstacles:8,nps:2.693,length:233,characteristic:"360Degree",difficulty:"Expert",events:1166,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:181.558,paritySummary:{errors:25,warns:26,resets:0},maxScore:442635,label:"Expert360",environment:"GlassDesertEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/7cca8c1afecd782cfd74f158c312201b780043d8.zip",coverURL:"https://eu.cdn.beatsaver.com/7cca8c1afecd782cfd74f158c312201b780043d8.jpg",previewURL:"https://eu.cdn.beatsaver.com/7cca8c1afecd782cfd74f158c312201b780043d8.mp3"}],curator:{id:32269,name:"maybeemae",hash:"5e1123516d774b0006a953ec",avatar:"https://cdn.beatsaver.com/avatar/d2119e1ff402b2cd380caf8b074d3f7c037f0ec2.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,playlistUrl:"https://api.beatsaver.com/users/id/32269/playlist"},curatedAt:"2020-07-11T22:35:42.033Z",createdAt:"2020-07-11T22:35:42.033Z",updatedAt:"2020-07-11T22:35:42.033Z",lastPublishedAt:"2020-07-11T22:35:42.033Z",tags:["pop","jazz","dance-style"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"3bbb0",name:"[Modchart] Leslie Wai - Paradigm",description:"MAP IS NOT WORKING ON QUEST 1.37+\nMAP IS NOT WORKING ON QUEST 1.37+\nMAP IS NOT WORKING ON QUEST 1.37+\n\nNOTE: If your sabers are in the wrong position after the intro try disabling any room offset/rotation\nNOTE 2: The map is broken on some versions including 1.34 and quest, I am gonna work on report all the issues\nNOTE 3: The map should be playable now on Quest native (just a few visual bugs)\n\nMy biggest project so far!\nenjoy it\n\nMap preview: https://youtu.be/gokZx0QjqZQ\n\nReupload: Thanks for the 429 people that played the map so far! i am reuploading to fix a few bugs:\n- Fix saber positions being wrong for some people\n- Disable left handed option\n- Disable Intro Skip\n\nReupload 2: Thanks for the another 170 plays I hope this is the final reupload:\n- Fix light id errors\n- Fix cinema suggestion not needed\n- Trying another fix for sabers wrong position\n\nReupload 3: And I hope this is the last one, thanks for the 124 new plays!\n- Fix player position bug on quest\n- Fix notes position bug on quest\n- Fix gimmik part on quest\n- Added suggested colors for notes\n- Changed NJS and JD\n- Fix sabers coming from the wrong direction in the intro",uploader:{id:4284535,name:"Elecast",hash:"6069279f5ab13d000609e874",avatar:"https://cdn.beatsaver.com/avatar/4dd111a1ec473c3559cfc73caaac650be56b65a1.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4284535/playlist"},metadata:{bpm:130,duration:441,songName:"Paradigm",songSubName:"",songAuthorName:"Leslie Wai",levelAuthorName:"Elecast"},stats:{plays:0,downloads:0,upvotes:2734,downvotes:27,score:.9851,reviews:35,sentiment:"VERY_POSITIVE"},uploaded:"2024-04-13T20:59:13.608905Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"a504aafe70cf723f46503568f65813ef616d030f",state:"Published",createdAt:"2024-04-24T23:51:45.788382Z",sageScore:3,diffs:[{njs:17,offset:-.75,notes:1051,bombs:360,obstacles:249,nps:3.038,length:749.5,characteristic:"Standard",difficulty:"ExpertPlus",events:12016,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:345.923,paritySummary:{errors:0,warns:0,resets:0},maxScore:959675,label:"You can't escape",environment:"BillieEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/a504aafe70cf723f46503568f65813ef616d030f.zip",coverURL:"https://eu.cdn.beatsaver.com/a504aafe70cf723f46503568f65813ef616d030f.jpg",previewURL:"https://eu.cdn.beatsaver.com/a504aafe70cf723f46503568f65813ef616d030f.mp3"}],curator:{id:4284445,name:"Emilia",hash:"5cff0b7898cc5a672c856ed3",avatar:"https://cdn.beatsaver.com/avatar/4284445.jpg",type:"SIMPLE",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4284445/playlist"},curatedAt:"2024-04-13T23:47:05.160104Z",createdAt:"2024-04-12T23:23:24.101391Z",updatedAt:"2024-08-18T18:18:25.185313Z",lastPublishedAt:"2024-04-24T23:51:50.910171Z",tags:["balanced","electronic"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"1a0ba",name:"[Electro Swing Pack] Wolfgang Lohr & Maskarade - Hit The Road Jack",description:"Nixie Presents: Electro Swing Pack!\n\n10 electro swing songs with expert and expert+ diffs to make your booty swing!\n\nGet The Pack: \nhttps://bsaber.com/electro-swing-pack/\n\nMap Gameplay:\nhttps://youtu.be/0ObNR9n_dDs\n\nComplete Pack Playthrough:\nhttps://youtu.be/yj9rw4MEh7s\n\n\nHuge thanks in particular to:\nMonstor, Bearly, Noxn, Bullet, Vaser888, Tocxx, Jafdy, Storm Knight and Pixelguy!\n\n\nMore Maps: https://beatsaver.com/profile/4286374\nDiscord Tag: Nixie.Korten#6944\nJoin My Server: https://discord.gg/RjxPpZtH7w\nTwitter: https://twitter.com/Nixie_Korten\nInstagram: https://www.instagram.com/nixie.korten/",uploader:{id:4286374,name:"Nixie.Korten",hash:"6096752e12772e0006e2f7e6",avatar:"https://cdn.beatsaver.com/avatar/bb97db2b49d21f5cbc1a5ba50742fa0e5c86ed3c.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4286374/playlist"},metadata:{bpm:124,duration:159,songName:"Hit The Road Jack",songSubName:"",songAuthorName:"Wolfgang Lohr & Maskarade",levelAuthorName:"Nixie.Korten"},stats:{plays:0,downloads:0,upvotes:3787,downvotes:42,score:.9849},uploaded:"2021-07-08T15:26:18.072Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"75f10751d58f6f1ab0bc36e94039a144256adccb",key:"1a0ba",state:"Published",createdAt:"2021-07-08T15:26:18.072Z",sageScore:4,diffs:[{njs:16,offset:-.25,notes:475,bombs:0,obstacles:0,nps:3.089,length:317.75,characteristic:"Standard",difficulty:"Expert",events:1846,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:153.75,paritySummary:{errors:0,warns:0,resets:0},maxScore:429755,environment:"PanicEnvironment"},{njs:19,offset:.25,notes:750,bombs:0,obstacles:0,nps:4.878,length:317.75,characteristic:"Standard",difficulty:"ExpertPlus",events:1846,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:153.75,paritySummary:{errors:0,warns:0,resets:0},maxScore:682755,environment:"PanicEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/75f10751d58f6f1ab0bc36e94039a144256adccb.zip",coverURL:"https://eu.cdn.beatsaver.com/75f10751d58f6f1ab0bc36e94039a144256adccb.jpg",previewURL:"https://eu.cdn.beatsaver.com/75f10751d58f6f1ab0bc36e94039a144256adccb.mp3"}],curator:{id:73032,name:"Bytrius",hash:"5de442271dc9e8000696cd15",avatar:"https://cdn.beatsaver.com/avatar/62ed9906317427e9b14435ca144c7189b83a711a.png",type:"DISCORD",admin:!0,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/73032/playlist"},curatedAt:"2021-07-08T15:26:18.072Z",createdAt:"2021-07-08T15:26:18.072Z",updatedAt:"2024-11-02T11:17:50.904586Z",lastPublishedAt:"2021-07-08T15:26:18.072Z",tags:["swing","balanced","dance-style","electronic"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"1a0b7",name:"[Electro Swing Pack] Jamie Berry - Lost In The Rhythm (ft. Octavia Rose)",description:"Nixie Presents: Electro Swing Pack!\n\n10 electro swing songs with expert and expert+ diffs to make your booty swing!\n\nGet The Pack: \nhttps://bsaber.com/electro-swing-pack/\n\nMap Gameplay:\nhttps://youtu.be/4O8l7rq4eHI\n\nComplete Pack Playthrough:\nhttps://youtu.be/yj9rw4MEh7s\n\n\nHuge thanks in particular to:\nMonstor, Bearly, Noxn, Bullet, Vaser888, Tocxx, Jafdy, Storm Knight and Pixelguy!\n\n\nMore Maps: https://beatsaver.com/profile/4286374\nDiscord Tag: Nixie.Korten#6944\nJoin My Server: https://discord.gg/RjxPpZtH7w\nTwitter: https://twitter.com/Nixie_Korten\nInstagram: https://www.instagram.com/nixie.korten/",uploader:{id:4286374,name:"Nixie.Korten",hash:"6096752e12772e0006e2f7e6",avatar:"https://cdn.beatsaver.com/avatar/bb97db2b49d21f5cbc1a5ba50742fa0e5c86ed3c.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4286374/playlist"},metadata:{bpm:121,duration:187,songName:"Lost In The Rhythm",songSubName:"(ft. Octavia Rose)",songAuthorName:"Jamie Berry",levelAuthorName:"Nixie.Korten"},stats:{plays:0,downloads:0,upvotes:3307,downvotes:36,score:.9847,reviews:1},uploaded:"2021-07-08T15:24:57.679Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"6d006d47880a45a134844f3787f3c184881d4673",key:"1a0b7",state:"Published",createdAt:"2021-07-08T15:24:57.679Z",sageScore:5,diffs:[{njs:16,offset:-.25,notes:591,bombs:0,obstacles:8,nps:3.274,length:364,characteristic:"Standard",difficulty:"Expert",events:3271,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:180.496,paritySummary:{errors:0,warns:0,resets:0},maxScore:536475,environment:"PanicEnvironment"},{njs:19,offset:.25,notes:821,bombs:0,obstacles:8,nps:4.549,length:364,characteristic:"Standard",difficulty:"ExpertPlus",events:3271,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:180.496,paritySummary:{errors:0,warns:0,resets:0},maxScore:748075,environment:"PanicEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/6d006d47880a45a134844f3787f3c184881d4673.zip",coverURL:"https://eu.cdn.beatsaver.com/6d006d47880a45a134844f3787f3c184881d4673.jpg",previewURL:"https://eu.cdn.beatsaver.com/6d006d47880a45a134844f3787f3c184881d4673.mp3"}],curator:{id:73032,name:"Bytrius",hash:"5de442271dc9e8000696cd15",avatar:"https://cdn.beatsaver.com/avatar/62ed9906317427e9b14435ca144c7189b83a711a.png",type:"DISCORD",admin:!0,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/73032/playlist"},curatedAt:"2021-07-08T15:24:57.679Z",createdAt:"2021-07-08T15:24:57.679Z",updatedAt:"2024-11-02T11:17:26.961219Z",lastPublishedAt:"2021-07-08T15:24:57.679Z",tags:["swing","balanced","dance-style","electronic"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"77e9",name:"Jingo Jungle [Saga of Tanya the Evil Opening] - AmaLee",description:'AmaLee\'s English cover of "Jingo Jungle", the opening from Saga of Tanya the Evil (Youjo Senki). Original song by MYTH & ROID.',uploader:{id:58338,name:"Joetastic",hash:"5cff0b7498cc5a672c85050e",avatar:"https://cdn.beatsaver.com/avatar/91bb7b0510cea647179bc95e032f8a25608b09f1.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/58338/playlist"},metadata:{bpm:130,duration:226,songName:"Jingo Jungle",songSubName:"",songAuthorName:"AmaLee",levelAuthorName:"Joetastic"},stats:{plays:0,downloads:0,upvotes:4125,downvotes:48,score:.9846,reviews:1},uploaded:"2019-12-21T02:44:34.295Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"f90a2e4f8ee7b1f33543cddccb8baea660253d4a",key:"77e9",state:"Published",createdAt:"2019-12-21T02:44:34.295Z",sageScore:5,diffs:[{njs:12,offset:0,notes:581,bombs:104,obstacles:28,nps:2.647,length:475.5,characteristic:"Standard",difficulty:"Hard",events:5987,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:219.462,paritySummary:{errors:35,warns:15,resets:10},maxScore:527275,environment:"DefaultEnvironment"},{njs:15,offset:0,notes:950,bombs:78,obstacles:14,nps:4.329,length:475.5,characteristic:"Standard",difficulty:"Expert",events:5987,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:219.462,paritySummary:{errors:42,warns:48,resets:8},maxScore:866755,environment:"DefaultEnvironment"},{njs:17,offset:0,notes:1184,bombs:105,obstacles:17,nps:5.395,length:475.5,characteristic:"Standard",difficulty:"ExpertPlus",events:5987,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:219.462,paritySummary:{errors:32,warns:43,resets:16},maxScore:1082035,environment:"DefaultEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/f90a2e4f8ee7b1f33543cddccb8baea660253d4a.zip",coverURL:"https://eu.cdn.beatsaver.com/f90a2e4f8ee7b1f33543cddccb8baea660253d4a.jpg",previewURL:"https://eu.cdn.beatsaver.com/f90a2e4f8ee7b1f33543cddccb8baea660253d4a.mp3"}],createdAt:"2019-12-21T02:44:34.295Z",updatedAt:"2019-12-21T02:44:34.295Z",lastPublishedAt:"2019-12-21T02:44:34.295Z",tags:["pop","anime"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"a438",name:"Wait - M83 (wall map)",description:"I wanted to do something special for this great song, and also see the potential of Noodle Extensions. A few tips for a better experience:\r\n- disable the mirror effect in the game settings\r\n- turn the SFX volume down in the player settings\r\n- hide the HUD in the player settings\r\n\r\nVideo: https://youtu.be/oe6ThhijPy0\r\n\r\nThe map has a lot of walls, so you might not be able to run it on the lower-end hardware. I've included a version with less walls in case it helps.",uploader:{id:4288814,name:"nyri0",hash:"5e792df416c9680006086a78",avatar:"https://cdn.beatsaver.com/avatar/233323d456510756fbbc0140c1a0698caf8b096c.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,playlistUrl:"https://api.beatsaver.com/users/id/4288814/playlist"},metadata:{bpm:148,duration:336,songName:"Wait",songSubName:"",songAuthorName:"M83",levelAuthorName:"nyri0"},stats:{plays:0,downloads:0,upvotes:4116,downvotes:48,score:.9845,reviews:9,sentiment:"VERY_POSITIVE"},uploaded:"2020-05-08T23:53:02.030Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"0d8921ef06a889cbd9db13afcc43f09a1619b173",key:"a438",state:"Published",createdAt:"2020-05-08T23:53:02.030Z",sageScore:6,diffs:[{njs:8,offset:6,notes:735,bombs:0,obstacles:6684,nps:2.225,length:815,characteristic:"Standard",difficulty:"Easy",events:5,chroma:!1,me:!1,ne:!0,cinema:!1,seconds:330.405,paritySummary:{errors:93,warns:27,resets:0},maxScore:668955,label:"Hard (less lag)",environment:"BigMirrorEnvironment"},{njs:8,offset:6,notes:735,bombs:0,obstacles:10499,nps:2.225,length:815,characteristic:"Standard",difficulty:"Hard",events:5,chroma:!1,me:!1,ne:!0,cinema:!1,seconds:330.405,paritySummary:{errors:93,warns:27,resets:0},maxScore:668955,label:"Hard (original)",environment:"BigMirrorEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/0d8921ef06a889cbd9db13afcc43f09a1619b173.zip",coverURL:"https://eu.cdn.beatsaver.com/0d8921ef06a889cbd9db13afcc43f09a1619b173.jpg",previewURL:"https://eu.cdn.beatsaver.com/0d8921ef06a889cbd9db13afcc43f09a1619b173.mp3"}],curator:{id:4316945,name:"BeastSaber",avatar:"https://cdn.beatsaver.com/avatar/4316945.jpg",type:"SIMPLE",admin:!1,curator:!0,seniorCurator:!1,curatorTab:!0,playlistUrl:"https://api.beatsaver.com/users/id/4316945/playlist"},curatedAt:"2020-05-08T23:53:02.030Z",createdAt:"2020-05-08T23:53:02.030Z",updatedAt:"2020-05-08T23:53:02.030Z",lastPublishedAt:"2020-05-08T23:53:02.030Z",tags:["rock","indie","techno"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"12ad1",name:"Minnesota - Colors (ft. Jackie Rain) | Chroma RGB",description:"Chroma 2.0 HIGHLY RECOMMENDED!\n\nHad this map sitting in my project folder for some months and finally got to finish it! \nIt features a Chroma RGB lightshow AND Rainbow notes, for the full COLOR experience :)\n\nPreview: https://www.youtube.com/watch?v=8Omzd7IdJt0",uploader:{id:4284201,name:"nitronik.exe",hash:"5cff0b7798cc5a672c855d84",avatar:"https://cdn.beatsaver.com/avatar/ab054640a94777ed7e92d91a505a85f8c5047be5.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4284201/playlist"},metadata:{bpm:140,duration:202,songName:"Colors",songSubName:"(ft. Jackie Rain)",songAuthorName:"Minnesota",levelAuthorName:"nitronik.exe"},stats:{plays:0,downloads:0,upvotes:4295,downvotes:51,score:.9844,reviews:7,sentiment:"VERY_POSITIVE"},uploaded:"2021-01-13T15:55:44.846Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"03fcb98091e50600d9d777251d765c53384c2735",key:"12ad1",state:"Published",createdAt:"2021-01-13T15:55:44.846Z",sageScore:4,diffs:[{njs:13,offset:.5,notes:395,bombs:0,obstacles:221,nps:2.057,length:448,characteristic:"Standard",difficulty:"Hard",events:16569,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:192,paritySummary:{errors:0,warns:0,resets:0},maxScore:356155,environment:"BigMirrorEnvironment"},{njs:16,offset:0,notes:601,bombs:0,obstacles:113,nps:3.13,length:448,characteristic:"Standard",difficulty:"Expert",events:16569,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:192,paritySummary:{errors:0,warns:0,resets:0},maxScore:545675,environment:"BigMirrorEnvironment"},{njs:19,offset:-.5,notes:911,bombs:0,obstacles:120,nps:4.745,length:448,characteristic:"Standard",difficulty:"ExpertPlus",events:16569,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:192,paritySummary:{errors:0,warns:0,resets:0},maxScore:830875,label:"Colors",environment:"BigMirrorEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/03fcb98091e50600d9d777251d765c53384c2735.zip",coverURL:"https://eu.cdn.beatsaver.com/03fcb98091e50600d9d777251d765c53384c2735.jpg",previewURL:"https://eu.cdn.beatsaver.com/03fcb98091e50600d9d777251d765c53384c2735.mp3"}],curator:{id:1096,name:"pyrowarfare",hash:"5e99c7df3f476a0006596cdf",avatar:"https://www.gravatar.com/avatar/28fcd25e8adfa72a17daa766767daf781bee89776333a3ed7a4cc84146e6a3e8?d=retro",type:"SIMPLE",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/1096/playlist"},curatedAt:"2021-01-13T15:55:44.846Z",createdAt:"2021-01-13T15:55:44.846Z",updatedAt:"2021-01-13T15:55:44.846Z",lastPublishedAt:"2021-01-13T15:55:44.846Z",tags:["dubstep","balanced"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"4a2b3",name:"[Vivify] Turret Orchestra (Cara Mia Addio) - Portal 2",description:"Portal •⩊•\n\nWork done:\nMadChase - Vivify and Standard Mapping\nRateGyro - OneSaber Mapping\nXentha - 3d Modeling \n\nAll Lawless: No Vivify difficulties \n\nThis took FAR too long to make too..... hope you enjoy this product of my sufferings as much as I do :)\n\nGo check out @rategyro, they did the mapping for all the Onesaber diffs and HUGE thanks to @Xentha for making a majority of the env used in this map, this would not have been possible without them. \n\nCredits: https://docs.google.com/document/d/1gR8x4iIk_n2i4ScYRPGEyD8OfZNsrDftmy6Z9cC5L_E/edit?usp=sharing",uploader:{id:4286182,name:"MadChase",avatar:"https://cdn.beatsaver.com/avatar/99feaf0fe97b6c67dde2ae7ba055fab744b0ac61.png",type:"DISCORD",admin:!1,curator:!0,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4286182/playlist"},metadata:{bpm:204,duration:120,songName:"Turret Orchestra",songSubName:"(Cara Mia Addio)",songAuthorName:"Portal 2",levelAuthorName:"MadChase, RateGyro, Xentha\r"},stats:{plays:0,downloads:0,upvotes:758,downvotes:3,score:.9844},uploaded:"2025-09-05T19:09:19.619055Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"3a2a0fead6eb8a8ab325aa54efdfb84bd4220375",state:"Published",createdAt:"2025-09-06T02:29:05.366Z",sageScore:4,diffs:[{njs:12,offset:0,notes:107,bombs:0,obstacles:0,nps:1.304,length:279,characteristic:"Standard",difficulty:"Hard",events:0,chroma:!0,me:!1,ne:!0,cinema:!1,vivify:!0,seconds:82.059,paritySummary:{errors:0,warns:0,resets:0},maxScore:91195,label:"Basic Bloqs",environment:"GagaEnvironment"},{njs:15,offset:-1.625,notes:149,bombs:0,obstacles:0,nps:1.816,length:279,characteristic:"Standard",difficulty:"Expert",events:0,chroma:!0,me:!1,ne:!0,cinema:!1,vivify:!0,seconds:82.059,paritySummary:{errors:0,warns:0,resets:0},maxScore:129835,label:"Bloqs",environment:"GagaEnvironment"},{njs:15,offset:-1.625,notes:714,bombs:0,obstacles:0,nps:8.701,length:279,characteristic:"Standard",difficulty:"ExpertPlus",events:0,chroma:!0,me:!1,ne:!0,cinema:!1,vivify:!0,seconds:82.059,paritySummary:{errors:0,warns:0,resets:0},maxScore:649635,label:"Poodles",environment:"GagaEnvironment"},{njs:15,offset:-1.625,notes:131,bombs:0,obstacles:0,nps:1.591,length:279.937,characteristic:"OneSaber",difficulty:"Expert",events:0,chroma:!0,me:!1,ne:!0,cinema:!1,vivify:!0,seconds:82.334,paritySummary:{errors:0,warns:0,resets:0},maxScore:113275,label:"Bloqs",environment:"GagaEnvironment"},{njs:15,offset:-1.625,notes:612,bombs:0,obstacles:0,nps:7.433,length:279.937,characteristic:"OneSaber",difficulty:"ExpertPlus",events:0,chroma:!0,me:!1,ne:!0,cinema:!1,vivify:!0,seconds:82.334,paritySummary:{errors:0,warns:0,resets:0},maxScore:555795,label:"Poodles",environment:"GagaEnvironment"},{njs:15,offset:-1.625,notes:0,bombs:0,obstacles:0,nps:0,length:0,characteristic:"Lightshow",difficulty:"ExpertPlus",events:0,chroma:!0,me:!1,ne:!0,cinema:!1,vivify:!0,seconds:0,paritySummary:{errors:0,warns:0,resets:0},maxScore:0,label:"Just Viv",environment:"GagaEnvironment"},{njs:12,offset:0,notes:111,bombs:0,obstacles:473,nps:1.343,length:281,characteristic:"Lawless",difficulty:"Easy",events:7,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:82.647,paritySummary:{errors:0,warns:0,resets:0},maxScore:94875,label:"Basic Bloqs",environment:"GagaEnvironment"},{njs:15,offset:-1.625,notes:130,bombs:0,obstacles:473,nps:1.584,length:279,characteristic:"Lawless",difficulty:"Normal",events:7,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:82.059,paritySummary:{errors:0,warns:0,resets:0},maxScore:112355,label:"One Saber Bloqs",environment:"GagaEnvironment"},{njs:15,offset:-1.625,notes:153,bombs:0,obstacles:473,nps:1.851,length:281,characteristic:"Lawless",difficulty:"Hard",events:7,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:82.647,paritySummary:{errors:0,warns:0,resets:0},maxScore:133515,label:"Bloqs",environment:"GagaEnvironment"},{njs:15,offset:-1.625,notes:611,bombs:0,obstacles:473,nps:7.446,length:279,characteristic:"Lawless",difficulty:"Expert",events:7,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:82.059,paritySummary:{errors:0,warns:0,resets:0},maxScore:554875,label:"One Saber Poodles",environment:"GagaEnvironment"},{njs:15,offset:-1.625,notes:734,bombs:0,obstacles:473,nps:8.859,length:281.688,characteristic:"Lawless",difficulty:"ExpertPlus",events:7,chroma:!1,me:!1,ne:!0,cinema:!1,seconds:82.849,paritySummary:{errors:0,warns:0,resets:0},maxScore:668035,label:"Poodles",environment:"GagaEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/3a2a0fead6eb8a8ab325aa54efdfb84bd4220375.zip",coverURL:"https://eu.cdn.beatsaver.com/3a2a0fead6eb8a8ab325aa54efdfb84bd4220375.jpg",previewURL:"https://eu.cdn.beatsaver.com/3a2a0fead6eb8a8ab325aa54efdfb84bd4220375.mp3"}],createdAt:"2025-09-05T18:27:26.937639Z",updatedAt:"2025-09-30T15:48:59.259473Z",lastPublishedAt:"2025-09-06T02:29:10.640787Z",tags:["video-game-soundtrack","balanced","poodle"],bookmarked:!1,collaborators:[{id:103109,name:"Xentha",avatar:"https://cdn.beatsaver.com/avatar/da02df6ec7f6d28e226510b3f8ecb786d24634ca.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,playlistUrl:"https://api.beatsaver.com/users/id/103109/playlist"},{id:4280701,name:"rategyro",hash:"605e50f0cd73ba00060a45e3",avatar:"https://cdn.beatsaver.com/avatar/06d29645455d6652940b240658617d968fc53d91.png",type:"DISCORD",admin:!0,curator:!0,seniorCurator:!0,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4280701/playlist"}],declaredAi:"None",blRanked:!1,blQualified:!1},{id:"14d64",name:"Try - MitiS Feat. RORY",description:"Twenty-Sixth Upload\n\nThis map means the whole world to me, so I hope everyone enjoys this map. My father passed away on Jan. 23, 2021, in the middle of making this map. I am dedicating this map for him because of how much this songs means to me now. \nPouring my heart and soul into this map took a lot out of me, making it as perfect to my little abilities I have for mapping.\n\nBig shout outs to Lonely and Jamman for lighting this beautiful song and for agreeing to light it, it means the world to me.\nBig shout outs to thelightdesigner for making such amazing and beautiful walls. Thank you for taking the time to make this, it means the world to me.\nBig shout outs to Mawntee for giving me advice on how to make this map feel and shout outs to thelitlewiseowl for modding it, showing me what I can improve in this map. \nBiggest shout outs to everyone that play tested it multiple times. I am sorry for bugging them for multiple play test. \n\nAnd Biggest shoutout to my favorite chillstep/melodic dubstep artist, MitiS and Rory for making this beautiful song. \nYou have no idea how much this song means to me, I thank you so much. Keep up the good work MitiS.\n\n**NOODLES AND CHROMA REQUIRED**\n\nI hope this map can show you the feeling in this song, as well as what it portrays. I tried my best, I hope it turns out great and everyone enjoys it. \nThank you everyone for taking the time to download and play this map. I appreciate it everyone.\n\nFeedback is always welcome!",uploader:{id:4285346,name:"remie",hash:"5f6efd989824150006d740ac",avatar:"https://cdn.beatsaver.com/avatar/736cde47222d5d00f4affea115772681d0e070eb.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,playlistUrl:"https://api.beatsaver.com/users/id/4285346/playlist"},metadata:{bpm:132,duration:273,songName:"Try",songSubName:"",songAuthorName:"MitiS Feat. RORY",levelAuthorName:"Remie & Lone"},stats:{plays:0,downloads:0,upvotes:7683,downvotes:102,score:.9843,reviews:36,sentiment:"VERY_POSITIVE"},uploaded:"2021-03-01T13:29:26.471Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"6db3d9da217b41607d250aa7a28c5dc26a082188",key:"14d64",state:"Published",createdAt:"2021-03-01T13:29:26.471Z",sageScore:3,diffs:[{njs:17,offset:-.7,notes:1447,bombs:21,obstacles:77,nps:6.217,length:512.083,characteristic:"Standard",difficulty:"ExpertPlus",events:36825,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:232.765,paritySummary:{errors:0,warns:0,resets:2},maxScore:1323995,label:"EXPERT+",environment:"OriginsEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/6db3d9da217b41607d250aa7a28c5dc26a082188.zip",coverURL:"https://eu.cdn.beatsaver.com/6db3d9da217b41607d250aa7a28c5dc26a082188.jpg",previewURL:"https://eu.cdn.beatsaver.com/6db3d9da217b41607d250aa7a28c5dc26a082188.mp3"}],curator:{id:2381,name:"bearly",hash:"5ea9efbf16c968000636dba4",avatar:"https://cdn.beatsaver.com/avatar/2381.jpg",type:"SIMPLE",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,playlistUrl:"https://api.beatsaver.com/users/id/2381/playlist"},curatedAt:"2021-03-01T13:29:26.471Z",createdAt:"2021-03-01T13:29:26.471Z",updatedAt:"2021-03-01T13:29:26.471Z",lastPublishedAt:"2021-03-01T13:29:26.471Z",tags:["balanced"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"27a13",name:"Jimmy Eat World - The Middle [Arcs][V3 Lights]",description:" - everything'll be alright, alright? \n\nYes, @Bytrius already has a great map of this song in the 2000's Rock Pack (check it out here https://beatsaver.com/maps/157fa) but I thought I'd try it with my own arc map style and provide some lower difficulties as well. \n\nGameplay video by @onespookyboi: https://youtu.be/SjiqMsMkFuU\nLIghtshow: https://streamable.com/zhomzm\n\nThank you testers!\n@maybeemae\n@swukpuff\n@onespookyboi\n@namaki_mono\nFlaemmchenFlame - https://www.twitch.tv/flaemmchenflame\n",uploader:{id:4321171,name:"tetsubeats",avatar:"https://cdn.beatsaver.com/avatar/532b0f3d23e1e795c5e1404c4a807c0dfbe1adf2.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4321171/playlist"},metadata:{bpm:162.2,duration:169,songName:"The Middle",songSubName:"",songAuthorName:"Jimmy Eat World",levelAuthorName:"TetsuBeats"},stats:{plays:0,downloads:0,upvotes:3397,downvotes:39,score:.9842,reviews:1},uploaded:"2022-07-10T05:30:32.964512Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"4b980371b6005cc176aed1b402bd104af56c31a3",state:"Published",createdAt:"2022-07-10T04:29:32.041843Z",sageScore:5,diffs:[{njs:10,offset:-1.1,notes:320,bombs:0,obstacles:0,nps:1.951,length:443.5,characteristic:"Standard",difficulty:"Easy",events:460,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:164.057,paritySummary:{errors:0,warns:0,resets:0},maxScore:287155,environment:"PyroEnvironment"},{njs:12,offset:-1.5,notes:528,bombs:0,obstacles:0,nps:3.218,length:443.5,characteristic:"Standard",difficulty:"Normal",events:460,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:164.057,paritySummary:{errors:0,warns:0,resets:0},maxScore:478515,environment:"PyroEnvironment"},{njs:14,offset:.1,notes:629,bombs:0,obstacles:0,nps:3.834,length:443.5,characteristic:"Standard",difficulty:"Hard",events:460,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:164.057,paritySummary:{errors:0,warns:0,resets:0},maxScore:571435,environment:"PyroEnvironment"},{njs:16.5,offset:-.1,notes:758,bombs:0,obstacles:0,nps:4.62,length:443.5,characteristic:"Standard",difficulty:"Expert",events:460,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:164.057,paritySummary:{errors:0,warns:0,resets:0},maxScore:690115,environment:"PyroEnvironment"},{njs:17.5,offset:-.3,notes:826,bombs:0,obstacles:0,nps:5.035,length:443.5,characteristic:"Standard",difficulty:"ExpertPlus",events:460,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:164.057,paritySummary:{errors:0,warns:0,resets:0},maxScore:752675,environment:"PyroEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/4b980371b6005cc176aed1b402bd104af56c31a3.zip",coverURL:"https://eu.cdn.beatsaver.com/4b980371b6005cc176aed1b402bd104af56c31a3.jpg",previewURL:"https://eu.cdn.beatsaver.com/4b980371b6005cc176aed1b402bd104af56c31a3.mp3"}],curator:{id:32269,name:"maybeemae",hash:"5e1123516d774b0006a953ec",avatar:"https://cdn.beatsaver.com/avatar/d2119e1ff402b2cd380caf8b074d3f7c037f0ec2.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,playlistUrl:"https://api.beatsaver.com/users/id/32269/playlist"},curatedAt:"2022-07-10T05:52:53.577094Z",createdAt:"2022-07-10T04:29:32.041843Z",updatedAt:"2022-07-10T14:14:52.319313Z",lastPublishedAt:"2022-07-10T05:30:32.964512Z",tags:["dance-style","balanced","rock","pop"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"271dc",name:"[Electro Swing Pack Vol. 2] Swingrowers - Butterfly (Wolfgang Lohr Remix)",description:"Electro Swing Pack Volume 2: Electric Boogaloo!\n\nFor the anniversary of my first pack, I am making a sequel.\n10 Electro Swing songs, 3 difficulties each + custom vanilla lights!\n\nGet the pack here:\nhttps://bsaber.com/electro-swing-pack-2/\nhttps://beatsaver.com/playlists/6572\n\nPreview this map:\nhttps://youtu.be/91zWh1dLLV4\n\nPack Preview Playlist:\nhttps://youtube.com/playlist?list=PLrVm0whzsGKL5NYTUIEzDyITjl6WuLSJ4\n\n\nThank you to all the Playtesters!\nAlice, MaybeeMae, Pixelguy, Raaknys, Namaki Mono, DeeDee, and WolfieBeat ❤️\n\n\nMore Maps: https://beatsaver.com/profile/4286374\nDiscord: Nixie.Korten#6944\nJoin My Server: https://discord.gg/RjxPpZtH7w\nTwitter: https://twitter.com/Nixie_Korten\nInstagram: https://www.instagram.com/nixie.korten/",uploader:{id:4286374,name:"Nixie.Korten",hash:"6096752e12772e0006e2f7e6",avatar:"https://cdn.beatsaver.com/avatar/bb97db2b49d21f5cbc1a5ba50742fa0e5c86ed3c.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4286374/playlist"},metadata:{bpm:126,duration:189,songName:"Butterfly",songSubName:"(Wolfgang Lohr Remix)",songAuthorName:"Swingrowers",levelAuthorName:"Nixie.Korten"},stats:{plays:0,downloads:0,upvotes:1900,downvotes:18,score:.9842},uploaded:"2022-07-08T13:00:00.564Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"8a1f9c4ddd15a7c1ab69769542c9409ce630aaa7",state:"Published",createdAt:"2022-06-25T18:10:24.485756Z",sageScore:5,diffs:[{njs:14,offset:0,notes:522,bombs:0,obstacles:9,nps:2.818,length:389,characteristic:"Standard",difficulty:"Hard",events:2570,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:185.238,paritySummary:{errors:0,warns:0,resets:0},maxScore:472995,environment:"PanicEnvironment"},{njs:16,offset:-.5,notes:752,bombs:0,obstacles:9,nps:4.06,length:389,characteristic:"Standard",difficulty:"Expert",events:2570,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:185.238,paritySummary:{errors:0,warns:0,resets:0},maxScore:684595,environment:"PanicEnvironment"},{njs:19,offset:.25,notes:903,bombs:0,obstacles:9,nps:4.875,length:389,characteristic:"Standard",difficulty:"ExpertPlus",events:2570,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:185.238,paritySummary:{errors:0,warns:0,resets:0},maxScore:823515,environment:"PanicEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/8a1f9c4ddd15a7c1ab69769542c9409ce630aaa7.zip",coverURL:"https://eu.cdn.beatsaver.com/8a1f9c4ddd15a7c1ab69769542c9409ce630aaa7.jpg",previewURL:"https://eu.cdn.beatsaver.com/8a1f9c4ddd15a7c1ab69769542c9409ce630aaa7.mp3"}],curator:{id:4284746,name:"Dee-Dee",avatar:"https://cdn.beatsaver.com/avatar/3853d99b74fe4eb9a3954df5946123f67a95da3d.png",type:"DISCORD",admin:!1,curator:!0,seniorCurator:!0,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4284746/playlist"},curatedAt:"2022-07-09T12:03:07.374428Z",createdAt:"2022-06-25T18:10:24.485756Z",updatedAt:"2024-11-09T20:31:57.830788Z",lastPublishedAt:"2022-07-08T13:00:00.559037Z",tags:["balanced","electronic","swing","dance-style"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"39624",name:"[Chroma] DNCE - Cake By The Ocean",description:"[Explicit Lyrics]\n[Flashing Lights Warning]\n\nMy first full spread map!\n\nJan 28th 2024: Reupload with fixed lighting\n-----------------------------------------------------\nSong: Cake By The Ocean by DNCE\nhttps://www.youtube.com/watch?v=vWaRiD5ym74\n\nMap Preview (Expert+):\nhttps://www.youtube.com/watch?v=UZyrFB9vKDo\n-----------------------------------------------------\nThank you to @Noveliniel for playtesting this map.\n-----------------------------------------------------\nMessage wunkoo on Discord for any feedback (must be in the BeastSaber discord).\nOr just leave a BeatSaver review",uploader:{id:4302396,name:"Koreami",avatar:"https://cdn.beatsaver.com/avatar/f5542fc9f09f21504d7e82a61b06d494389ba3d3.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,playlistUrl:"https://api.beatsaver.com/users/id/4302396/playlist"},metadata:{bpm:119,duration:221,songName:"Cake By The Ocean",songSubName:"",songAuthorName:"DNCE",levelAuthorName:"Koreami"},stats:{plays:0,downloads:0,upvotes:2819,downvotes:31,score:.9841,reviews:3},uploaded:"2024-01-27T19:00:00.269841Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"2cb2f496ef6e33a09a56d301923ade73b9a53c3d",state:"Published",createdAt:"2024-01-28T18:55:36.350370Z",sageScore:5,diffs:[{njs:12,offset:-.1,notes:431,bombs:6,obstacles:37,nps:2.021,length:423,characteristic:"Standard",difficulty:"Easy",events:2073,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:213.277,paritySummary:{errors:0,warns:0,resets:0},maxScore:389275,label:"Puddle",environment:"DragonsEnvironment"},{njs:12,offset:-.2,notes:554,bombs:0,obstacles:21,nps:2.598,length:423,characteristic:"Standard",difficulty:"Normal",events:2073,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:213.277,paritySummary:{errors:0,warns:0,resets:0},maxScore:502515,label:"Pond",environment:"DragonsEnvironment"},{njs:13,offset:-.25,notes:677,bombs:0,obstacles:31,nps:3.174,length:423,characteristic:"Standard",difficulty:"Hard",events:2073,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:213.277,paritySummary:{errors:0,warns:0,resets:0},maxScore:615595,label:"Lake",environment:"DragonsEnvironment"},{njs:16,offset:-.7,notes:800,bombs:0,obstacles:33,nps:3.751,length:423,characteristic:"Standard",difficulty:"Expert",events:2073,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:213.277,paritySummary:{errors:0,warns:0,resets:0},maxScore:728755,label:"Sea",environment:"DragonsEnvironment"},{njs:16,offset:-.7,notes:971,bombs:4,obstacles:41,nps:4.553,length:423,characteristic:"Standard",difficulty:"ExpertPlus",events:2073,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:213.277,paritySummary:{errors:0,warns:0,resets:0},maxScore:886075,label:"Ocean",environment:"DragonsEnvironment"},{njs:16,offset:0,notes:0,bombs:0,obstacles:0,nps:0,length:0,characteristic:"Lightshow",difficulty:"Normal",events:2073,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:0,paritySummary:{errors:0,warns:0,resets:0},maxScore:0,label:"Fluorescent Coral",environment:"DragonsEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/2cb2f496ef6e33a09a56d301923ade73b9a53c3d.zip",coverURL:"https://eu.cdn.beatsaver.com/2cb2f496ef6e33a09a56d301923ade73b9a53c3d.jpg",previewURL:"https://eu.cdn.beatsaver.com/2cb2f496ef6e33a09a56d301923ade73b9a53c3d.mp3"}],curator:{id:169636,name:"Duffelsalat",avatar:"https://cdn.beatsaver.com/avatar/42f17c520f53b67cf400a66f65e49038263042de.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,playlistUrl:"https://api.beatsaver.com/users/id/169636/playlist"},curatedAt:"2024-01-28T15:09:46.809093Z",createdAt:"2024-01-27T18:49:42.362618Z",updatedAt:"2025-05-27T05:59:37.010902Z",lastPublishedAt:"2024-01-28T18:55:43.801969Z",tags:["accuracy","balanced","pop","dance"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"9a0c",name:"Thnks fr th Mmrs - Fall Out Boy",description:"Thnks fr th Mmrs (or Thanks for the Memories) from Fall Out Boy.\nSo far the map that I have put the most work into (and which probably made me age by 3 years). Hope you enjoy it!\n\nThe map has Chroma lighting but can also be played without the Chroma mod.\nExpert+ contains single saber sections and polyrhythm parts. Just so you are warned ;)\n\nBig thanks to Sorukun for playtesting this map and especially to Timeweaver for pointing out all issues it had during its creation!",uploader:{id:21367,name:"hamsta",hash:"5de27451fffaa600066f2842",avatar:"https://www.gravatar.com/avatar/36e8d99105e1e9c1d2173853194691e2b2d5c0552b6e96bfd7a2fd8108310685?d=retro",type:"SIMPLE",admin:!1,curator:!1,seniorCurator:!1,playlistUrl:"https://api.beatsaver.com/users/id/21367/playlist"},metadata:{bpm:154.791,duration:198,songName:"Thnks fr th Mmrs",songSubName:"",songAuthorName:"Fall Out Boy",levelAuthorName:"Hamsta"},stats:{plays:0,downloads:0,upvotes:10577,downvotes:148,score:.984,reviews:2},uploaded:"2020-04-12T09:50:46.516Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"0e8ef3006db854c67f04fe72322bccea410f69ee",key:"9a0c",state:"Published",createdAt:"2020-04-12T09:50:46.516Z",sageScore:5,diffs:[{njs:14,offset:0,notes:580,bombs:0,obstacles:51,nps:3.092,length:484,characteristic:"Standard",difficulty:"Hard",events:2597,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:187.355,paritySummary:{errors:0,warns:0,resets:0},maxScore:526355,environment:"PanicEnvironment"},{njs:14,offset:0,notes:637,bombs:0,obstacles:51,nps:3.395,length:484,characteristic:"Standard",difficulty:"Expert",events:2597,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:187.355,paritySummary:{errors:0,warns:0,resets:0},maxScore:578795,environment:"PanicEnvironment"},{njs:16,offset:0,notes:844,bombs:0,obstacles:39,nps:4.499,length:484,characteristic:"Standard",difficulty:"ExpertPlus",events:2597,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:187.355,paritySummary:{errors:1,warns:2,resets:0},maxScore:769235,environment:"PanicEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/0e8ef3006db854c67f04fe72322bccea410f69ee.zip",coverURL:"https://eu.cdn.beatsaver.com/0e8ef3006db854c67f04fe72322bccea410f69ee.jpg",previewURL:"https://eu.cdn.beatsaver.com/0e8ef3006db854c67f04fe72322bccea410f69ee.mp3"}],curator:{id:4299228,name:"tan",avatar:"https://cdn.beatsaver.com/avatar/19d0c285757c0eea70e922961581953cfd96769b.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,playlistUrl:"https://api.beatsaver.com/users/id/4299228/playlist"},curatedAt:"2020-04-12T09:50:46.516Z",createdAt:"2020-04-12T09:50:46.516Z",updatedAt:"2020-04-12T09:50:46.516Z",lastPublishedAt:"2020-04-12T09:50:46.516Z",tags:["pop","dance-style"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"11b7a",name:"Still Alive - Portal",description:"I've wanted to map this song for a while now. And since this one's probably the last Portal song I'll map, I gave it my best. \r\n\r\nP.S. - I'm so glad to be back mapping this month. I had to take a break due to overwhelming stress, but now I'm feeling ready again.\r\nI hope you enjoy.\r\n\r\nPortal on Steam:\r\nhttps://store.steampowered.com/app/400/Portal/",uploader:{id:4284694,name:"Jokidum",hash:"5e15518d47f1600006e912cc",avatar:"https://cdn.beatsaver.com/avatar/da6133c71c7c84b75622f59dd2fce215f8c444f3.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,playlistUrl:"https://api.beatsaver.com/users/id/4284694/playlist"},metadata:{bpm:120,duration:176,songName:"Still Alive",songSubName:"- Portal",songAuthorName:"Jonathan Coulton",levelAuthorName:"Jokidum"},stats:{plays:0,downloads:0,upvotes:6908,downvotes:92,score:.984,reviews:2},uploaded:"2020-12-04T20:30:44.132Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"8c03b43484b0dd1fc7d8a3104a82f0992a001c6c",key:"11b7a",state:"Published",createdAt:"2020-12-04T20:30:44.132Z",sageScore:4,diffs:[{njs:12,offset:0,notes:490,bombs:0,obstacles:13,nps:2.853,length:343.5,characteristic:"Standard",difficulty:"Expert",events:1060,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:171.75,paritySummary:{errors:0,warns:0,resets:0},maxScore:443555,environment:"TriangleEnvironment"},{njs:16,offset:0,notes:0,bombs:0,obstacles:0,nps:0,length:0,characteristic:"Lightshow",difficulty:"Easy",events:1060,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:0,paritySummary:{errors:0,warns:0,resets:0},maxScore:0,label:"Lightshow",environment:"TriangleEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/8c03b43484b0dd1fc7d8a3104a82f0992a001c6c.zip",coverURL:"https://eu.cdn.beatsaver.com/8c03b43484b0dd1fc7d8a3104a82f0992a001c6c.jpg",previewURL:"https://eu.cdn.beatsaver.com/8c03b43484b0dd1fc7d8a3104a82f0992a001c6c.mp3"}],createdAt:"2020-12-04T20:30:44.132Z",updatedAt:"2020-12-04T20:30:44.132Z",lastPublishedAt:"2020-12-04T20:30:44.132Z",bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"24227",name:"DADDY! DADDY! DO! (TV Size) (2022 Remaster) [Kaguya-sama: Love Is War Season 2 Opening] - Masayuki Suzuki ft. Airi Suzuki ",description:"Just a small remaster of my old daddy daddy do map from 2020, fixed a few parity errors and updated the NJS. There's also 2 additional down maps now. \n\nThanks to https://twitter.com/WicKedBassline for the special request!\n\nDADDY! DADDY! DO! is opening theme for the second season of the Kaguya-sama: Love Is War anime adaptation.\n\nKeep up to date on my maps: https://twitter.com/Joetastic_\nMy mapper's profile: https://bsaber.com/members/joetastic/\nContact me on discord: @Joetastic#2501",uploader:{id:58338,name:"Joetastic",hash:"5cff0b7498cc5a672c85050e",avatar:"https://cdn.beatsaver.com/avatar/91bb7b0510cea647179bc95e032f8a25608b09f1.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/58338/playlist"},metadata:{bpm:138,duration:91,songName:"DADDY! DADDY! DO! (TV Size) (2022 Remaster)",songSubName:"ft. Airi Suzuki",songAuthorName:"Masayuki Suzuki",levelAuthorName:"Joetastic"},stats:{plays:0,downloads:0,upvotes:3282,downvotes:38,score:.984,reviews:1},uploaded:"2022-04-09T06:56:40.572610Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"9eb5c6cc6e55bc17ee7833a5e8b67f8793a3ed17",state:"Published",createdAt:"2022-04-09T06:56:26.910837Z",sageScore:4,diffs:[{njs:12,offset:0,notes:205,bombs:4,obstacles:23,nps:2.352,length:200.5,characteristic:"Standard",difficulty:"Hard",events:1053,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:87.174,paritySummary:{errors:0,warns:0,resets:0},maxScore:181355,environment:"PanicEnvironment"},{njs:15,offset:-.3,notes:306,bombs:4,obstacles:23,nps:3.51,length:200.5,characteristic:"Standard",difficulty:"Expert",events:1053,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:87.174,paritySummary:{errors:0,warns:0,resets:0},maxScore:274275,environment:"PanicEnvironment"},{njs:18,offset:-.6,notes:381,bombs:0,obstacles:23,nps:4.371,length:200.5,characteristic:"Standard",difficulty:"ExpertPlus",events:1053,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:87.174,paritySummary:{errors:0,warns:0,resets:0},maxScore:343275,environment:"PanicEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/9eb5c6cc6e55bc17ee7833a5e8b67f8793a3ed17.zip",coverURL:"https://eu.cdn.beatsaver.com/9eb5c6cc6e55bc17ee7833a5e8b67f8793a3ed17.jpg",previewURL:"https://eu.cdn.beatsaver.com/9eb5c6cc6e55bc17ee7833a5e8b67f8793a3ed17.mp3"}],curator:{id:4285122,name:"Lasso-Catsidy",avatar:"https://cdn.beatsaver.com/avatar/1daf0e4ecc153a86d14ec7913800a38fd0f0187d.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,playlistUrl:"https://api.beatsaver.com/users/id/4285122/playlist"},curatedAt:"2022-04-11T06:44:59.068414Z",createdAt:"2022-04-09T06:56:26.910837Z",updatedAt:"2022-04-11T06:44:59.068414Z",lastPublishedAt:"2022-04-09T06:56:40.572610Z",tags:["dance-style","anime","j-pop"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"291b9",name:"BLOODY STREAM (TV Size) (2022 Remaster) [JoJo's Bizarre Adventure 2nd Opening] - Coda",description:'---------Map uses the new 1.20 Note mechanics (eg: arc and chains) and won\'t work on any versions of Beat Saber below 1.20---------\n\nThanks to https://twitter.com/EuclaseW for the special request!\n\nThis map is a remap of my old Bloody Stream map. Changes include:\n- Parity fixes\n- Additional difficulties\n- Custom colors!\n- Addition of Arcs and Chains!\n\n"BLOODY STREAM" is the second opening of the JoJo\'s Bizarre Adventure by Japanese musician Kazuso Oda under the stage name "Coda".\n\nKeep up to date on my maps: https://twitter.com/Joetastic_\nMy mapper\'s profile: https://bsaber.com/members/joetastic/\nContact me on discord: @Joetastic#2501',uploader:{id:58338,name:"Joetastic",hash:"5cff0b7498cc5a672c85050e",avatar:"https://cdn.beatsaver.com/avatar/91bb7b0510cea647179bc95e032f8a25608b09f1.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/58338/playlist"},metadata:{bpm:132,duration:93,songName:"BLOODY STREAM (TV Size) (2022 Remaster)",songSubName:"",songAuthorName:"Coda",levelAuthorName:"Joetastic"},stats:{plays:0,downloads:0,upvotes:4309,downvotes:54,score:.9838},uploaded:"2022-08-21T14:25:59.776857Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"2c6a5186b7e3f4a3b453065ee8ad042d72947102",state:"Published",createdAt:"2022-08-21T14:25:52.329353Z",sageScore:2,diffs:[{njs:12,offset:0,notes:326,bombs:29,obstacles:16,nps:3.659,length:196,characteristic:"Standard",difficulty:"Hard",events:1780,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:89.091,paritySummary:{errors:0,warns:0,resets:0},maxScore:292915,environment:"BigMirrorEnvironment"},{njs:15,offset:-.3,notes:446,bombs:18,obstacles:13,nps:5.006,length:196,characteristic:"Standard",difficulty:"Expert",events:1780,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:89.091,paritySummary:{errors:0,warns:0,resets:0},maxScore:403315,environment:"BigMirrorEnvironment"},{njs:18,offset:-.6,notes:561,bombs:22,obstacles:15,nps:6.297,length:196,characteristic:"Standard",difficulty:"ExpertPlus",events:1780,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:89.091,paritySummary:{errors:0,warns:0,resets:0},maxScore:510715,environment:"BigMirrorEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/2c6a5186b7e3f4a3b453065ee8ad042d72947102.zip",coverURL:"https://eu.cdn.beatsaver.com/2c6a5186b7e3f4a3b453065ee8ad042d72947102.jpg",previewURL:"https://eu.cdn.beatsaver.com/2c6a5186b7e3f4a3b453065ee8ad042d72947102.mp3"}],curator:{id:4285122,name:"Lasso-Catsidy",avatar:"https://cdn.beatsaver.com/avatar/1daf0e4ecc153a86d14ec7913800a38fd0f0187d.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,playlistUrl:"https://api.beatsaver.com/users/id/4285122/playlist"},curatedAt:"2022-09-09T02:00:15.130726Z",createdAt:"2022-08-21T14:25:52.329353Z",updatedAt:"2022-09-09T02:00:15.130726Z",lastPublishedAt:"2022-08-21T14:25:59.776857Z",tags:["dance-style","anime","j-pop","balanced"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"2ab5b",name:"Handclap - fitz and the tantrums",description:"twitch : https://www.twitch.tv/emiru_milk\ntwitter : https://twitter.com/EmirTart\ndiscord : https://discord.gg/DHwuND8K7K\nEmiru#9999",uploader:{id:4284894,name:"emiru",hash:"5d3dac6586729100069260cc",avatar:"https://cdn.beatsaver.com/avatar/59d2538aa7b938cbd28629073dc6d9be2357bee9.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4284894/playlist"},metadata:{bpm:139.867,duration:196,songName:"Handclap",songSubName:"",songAuthorName:"Fitz and the Tantrums",levelAuthorName:"Emir"},stats:{plays:0,downloads:0,upvotes:5631,downvotes:75,score:.9836,reviews:3},uploaded:"2022-10-08T08:58:23.778044Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"3da135c11207f5f4f2dfe7b18a6416931f66936e",state:"Published",createdAt:"2022-10-08T09:11:55.226599Z",sageScore:3,diffs:[{njs:16,offset:0,notes:196,bombs:0,obstacles:58,nps:1.078,length:423.891,characteristic:"Standard",difficulty:"Easy",events:5218,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:181.841,paritySummary:{errors:0,warns:0,resets:0},maxScore:173075,environment:"FitBeatEnvironment"},{njs:13,offset:.152,notes:302,bombs:0,obstacles:66,nps:1.655,length:425.39,characteristic:"Standard",difficulty:"Normal",events:5218,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:182.483,paritySummary:{errors:0,warns:0,resets:0},maxScore:270595,environment:"FitBeatEnvironment"},{njs:14,offset:-.168,notes:546,bombs:0,obstacles:184,nps:2.992,length:425.39,characteristic:"Standard",difficulty:"Hard",events:5221,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:182.483,paritySummary:{errors:0,warns:0,resets:0},maxScore:495075,environment:"FitBeatEnvironment"},{njs:15,offset:-.368,notes:739,bombs:0,obstacles:130,nps:3.894,length:442.374,characteristic:"Standard",difficulty:"Expert",events:5218,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:189.769,paritySummary:{errors:0,warns:0,resets:0},maxScore:672635,environment:"FitBeatEnvironment"},{njs:16,offset:-.543,notes:925,bombs:8,obstacles:315,nps:5.057,length:426.389,characteristic:"Standard",difficulty:"ExpertPlus",events:4390,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:182.912,paritySummary:{errors:0,warns:0,resets:8},maxScore:843755,environment:"FitBeatEnvironment"},{njs:12,offset:.526,notes:350,bombs:0,obstacles:34,nps:1.844,length:442.374,characteristic:"Lawless",difficulty:"Easy",events:5219,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:189.769,paritySummary:{errors:43,warns:22,resets:0},maxScore:314755,label:"Lawless Tutorial",environment:"FitBeatEnvironment"},{njs:13,offset:.152,notes:657,bombs:0,obstacles:2,nps:3.462,length:442.374,characteristic:"Lawless",difficulty:"Normal",events:5219,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:189.769,paritySummary:{errors:623,warns:0,resets:0},maxScore:597195,label:"Down Notes",environment:"FitBeatEnvironment"},{njs:14,offset:-.002,notes:670,bombs:0,obstacles:2,nps:3.531,length:442.374,characteristic:"Lawless",difficulty:"Hard",events:5219,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:189.769,paritySummary:{errors:635,warns:16,resets:0},maxScore:609155,label:"Up Notes",environment:"FitBeatEnvironment"},{njs:15,offset:-.29,notes:1050,bombs:0,obstacles:2,nps:5.533,length:442.374,characteristic:"Lawless",difficulty:"Expert",events:5218,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:189.769,paritySummary:{errors:0,warns:78,resets:0},maxScore:958755,label:"90°Directions",environment:"FitBeatEnvironment"},{njs:16,offset:-.543,notes:1260,bombs:0,obstacles:246,nps:6.625,length:443.373,characteristic:"Lawless",difficulty:"ExpertPlus",events:5218,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:190.198,paritySummary:{errors:0,warns:6,resets:0},maxScore:1151955,label:"Dodge Walls",environment:"FitBeatEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/3da135c11207f5f4f2dfe7b18a6416931f66936e.zip",coverURL:"https://eu.cdn.beatsaver.com/3da135c11207f5f4f2dfe7b18a6416931f66936e.jpg",previewURL:"https://eu.cdn.beatsaver.com/3da135c11207f5f4f2dfe7b18a6416931f66936e.mp3"}],curator:{id:58338,name:"Joetastic",hash:"5cff0b7498cc5a672c85050e",avatar:"https://cdn.beatsaver.com/avatar/91bb7b0510cea647179bc95e032f8a25608b09f1.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/58338/playlist"},curatedAt:"2022-10-08T09:19:15.538197Z",createdAt:"2022-10-08T08:57:08.316867Z",updatedAt:"2022-10-08T09:19:15.538197Z",lastPublishedAt:"2022-10-08T09:12:01.774147Z",tags:["dance-style","balanced","rock","pop"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"212cf",name:"Someone Else's Hat - David Maxim Micic (modchart)",description:"David Maxim Micic is a prog rock genius. I wish I had the courage to map the 8 minutes of Mbinguni Amina but a few minutes of Someone Else's Hat will have to do. I really encourage you to check his stuff, because it's so good: https://open.spotify.com/artist/0wQa1N4q3HmLwxqkpVcYhs?si=aB4m1yonTg2qk5ounpOEUw\n\nThis modchart was an opportunity for me to have fun with environment animations, and push animations to a new level. The first scene is based on the album cover that Yelka made for Who Bit the Moon, and the rest is random ideas that I thought would be cool with this music.\n\nHuge thanks to the playtesters and in particular Mawntee and Aggrogahu, who took time to give detailed feedback. I appreciate.\n\nPreview: https://youtu.be/RX-payaVsKU\n\nThe map should work on Quest too, though it won't look as good due to the difference in how walls look.\n\nIf you like what I create, tell me, I love to hear from you:\n- YouTube: https://youtube.com/c/nyri0\n- Twitter: https://twitter.com/nyri0z\n- Ko-Fi: https://ko-fi.com/nyri0",uploader:{id:4288814,name:"nyri0",hash:"5e792df416c9680006086a78",avatar:"https://cdn.beatsaver.com/avatar/233323d456510756fbbc0140c1a0698caf8b096c.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,playlistUrl:"https://api.beatsaver.com/users/id/4288814/playlist"},metadata:{bpm:130,duration:207,songName:"Someone Else's Hat",songSubName:"",songAuthorName:"David Maxim Micic",levelAuthorName:"nyri0"},stats:{plays:0,downloads:0,upvotes:3304,downvotes:40,score:.9835,reviews:3},uploaded:"2022-02-04T23:50:20.027446Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"3662e733501d7a77850c20f0fcea792ed2187943",state:"Published",createdAt:"2022-02-04T23:05:01.786046Z",sageScore:1,diffs:[{njs:16,offset:0,notes:465,bombs:12,obstacles:1460,nps:2.38,length:423.333,characteristic:"Standard",difficulty:"Expert",events:875,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:195.385,paritySummary:{errors:83,warns:0,resets:0},maxScore:420555,label:"haut-de-forme",environment:"BTSEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/3662e733501d7a77850c20f0fcea792ed2187943.zip",coverURL:"https://eu.cdn.beatsaver.com/3662e733501d7a77850c20f0fcea792ed2187943.jpg",previewURL:"https://eu.cdn.beatsaver.com/3662e733501d7a77850c20f0fcea792ed2187943.mp3"}],curator:{id:4284947,name:"Phoenix",hash:"5fa08b5281e1d70006f1b322",avatar:"https://cdn.beatsaver.com/avatar/4284947.jpg",type:"SIMPLE",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4284947/playlist"},curatedAt:"2022-02-04T23:50:20.027446Z",createdAt:"2022-02-04T23:05:01.786046Z",updatedAt:"2022-02-04T23:52:36.995020Z",lastPublishedAt:"2022-02-04T23:50:20.027446Z",tags:["balanced","rock"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"2c785",name:"[Arc/Chain] Let's Groove - Earth, Wind & Fire",description:"I've been wanting to do a lower tempo dance map for a while and I knew this would be the perfect song. \n\nThanks to @dolledupchaos for playtesting!",uploader:{id:4232648,name:"ramenator05",hash:"60ecf439686b9f0006a67a41",avatar:"https://cdn.beatsaver.com/avatar/4232648.jpg",type:"SIMPLE",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4232648/playlist"},metadata:{bpm:124,duration:236,songName:"[Arc/Chain] Let's Groove - Earth Wind & Fire",songSubName:"",songAuthorName:"Earth Wind & Fire",levelAuthorName:"ramenator05"},stats:{plays:0,downloads:0,upvotes:3479,downvotes:43,score:.9834,reviews:3},uploaded:"2022-11-28T23:00:29.688269Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"bf86263deda5f2e09867f3ddad625dfc269709be",state:"Published",createdAt:"2022-11-28T22:59:23.889170Z",sageScore:2,diffs:[{njs:15,offset:.2,notes:550,bombs:0,obstacles:0,nps:2.39,length:480,characteristic:"Standard",difficulty:"Hard",events:115,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:232.258,paritySummary:{errors:0,warns:0,resets:0},maxScore:500755,environment:"LizzoEnvironment"},{njs:17,offset:-.2,notes:708,bombs:0,obstacles:0,nps:3.076,length:480,characteristic:"Standard",difficulty:"Expert",events:115,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:232.258,paritySummary:{errors:0,warns:0,resets:0},maxScore:646195,environment:"LizzoEnvironment"},{njs:19,offset:.5,notes:715,bombs:0,obstacles:0,nps:3.107,length:480,characteristic:"Standard",difficulty:"ExpertPlus",events:115,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:232.258,paritySummary:{errors:0,warns:0,resets:0},maxScore:652635,environment:"LizzoEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/bf86263deda5f2e09867f3ddad625dfc269709be.zip",coverURL:"https://eu.cdn.beatsaver.com/bf86263deda5f2e09867f3ddad625dfc269709be.jpg",previewURL:"https://eu.cdn.beatsaver.com/bf86263deda5f2e09867f3ddad625dfc269709be.mp3"}],curator:{id:4292041,name:"symphonic",avatar:"https://cdn.beatsaver.com/avatar/2dc906ee5b78c2cb723f0eae964c2c203babf3f4.png",type:"DISCORD",admin:!0,curator:!0,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4292041/playlist"},curatedAt:"2022-11-29T21:39:24.794532Z",createdAt:"2022-11-28T22:59:23.889170Z",updatedAt:"2022-11-29T21:39:24.794532Z",lastPublishedAt:"2022-11-28T23:00:29.688269Z",tags:["dance-style","soul","dance"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"21bf8",name:"Marina and the Diamonds - Are You Satisfied?",description:"Thanks, Cryston!\n\nSocials: \nhttps://twitter.com/bytrius\nhttps://www.youtube.com/c/bytrius\nhttps://bsaber.com/members/bytrius/\nhttps://www.twitch.tv/bytrius",uploader:{id:73032,name:"Bytrius",hash:"5de442271dc9e8000696cd15",avatar:"https://cdn.beatsaver.com/avatar/62ed9906317427e9b14435ca144c7189b83a711a.png",type:"DISCORD",admin:!0,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/73032/playlist"},metadata:{bpm:124,duration:200,songName:"Are You Satisfied?",songSubName:"",songAuthorName:"Marina and the Diamonds",levelAuthorName:"Bytrius"},stats:{plays:0,downloads:0,upvotes:604,downvotes:2,score:.9832,reviews:1},uploaded:"2022-02-15T21:07:43.593089Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"7fe7f6e0f0f1687b6821891b42f3ae080d6e1270",state:"Published",createdAt:"2022-02-15T20:59:06.806428Z",sageScore:4,diffs:[{njs:15,offset:-.55,notes:459,bombs:4,obstacles:124,nps:2.585,length:367,characteristic:"Standard",difficulty:"Hard",events:4532,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:177.581,paritySummary:{errors:0,warns:0,resets:2},maxScore:415035,environment:"DefaultEnvironment"},{njs:17,offset:-.725,notes:679,bombs:16,obstacles:122,nps:3.508,length:400,characteristic:"Standard",difficulty:"Expert",events:4532,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:193.548,paritySummary:{errors:0,warns:0,resets:4},maxScore:617435,environment:"DefaultEnvironment"},{njs:19,offset:.125,notes:944,bombs:24,obstacles:122,nps:4.877,length:400,characteristic:"Standard",difficulty:"ExpertPlus",events:4532,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:193.548,paritySummary:{errors:0,warns:0,resets:4},maxScore:861235,environment:"DefaultEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/7fe7f6e0f0f1687b6821891b42f3ae080d6e1270.zip",coverURL:"https://eu.cdn.beatsaver.com/7fe7f6e0f0f1687b6821891b42f3ae080d6e1270.jpg",previewURL:"https://eu.cdn.beatsaver.com/7fe7f6e0f0f1687b6821891b42f3ae080d6e1270.mp3"}],curator:{id:32269,name:"maybeemae",hash:"5e1123516d774b0006a953ec",avatar:"https://cdn.beatsaver.com/avatar/d2119e1ff402b2cd380caf8b074d3f7c037f0ec2.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,playlistUrl:"https://api.beatsaver.com/users/id/32269/playlist"},curatedAt:"2022-02-15T21:07:43.593089Z",createdAt:"2022-02-15T20:59:06.806428Z",updatedAt:"2024-08-27T09:23:17.201003Z",lastPublishedAt:"2022-02-15T21:07:43.593089Z",tags:["dance-style","pop","electronic"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"b514",name:"[[Wall Show + Chroma]] GAS GAS GAS | Manuel",description:"This wall map is a bit more intense than my others, you will need a very hefty pc to run and record this. Have Fun!\n\nHere's a playthrough: https://www.youtube.com/watch?v=hlS6r-Usnro\nHere's a playthrough by Nico (HQ Version): https://youtu.be/F_3qRxDdQc0\n\nREQUIREMENTS: \n -Noodle Extensions\n -Chroma/ChromaLite\n(fixed formatting + removed stupid metadata ;)",uploader:{id:73008,name:"thelightdesigner",hash:"5cff0b7798cc5a672c85627a",avatar:"https://cdn.beatsaver.com/avatar/fa1a30d2b4146dd93cb42537759669dcf961cf29.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,playlistUrl:"https://api.beatsaver.com/users/id/73008/playlist"},metadata:{bpm:154,duration:108,songName:"GAS GAS GAS",songSubName:"(Short Ver.)",songAuthorName:"Manuel",levelAuthorName:"KyleT"},stats:{plays:0,downloads:0,upvotes:9158,downvotes:134,score:.9832,reviews:4},uploaded:"2020-06-22T20:02:06.271Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"95e11f39b2898a38e3b5e61d2156ef5f5835f40f",key:"b514",state:"Published",createdAt:"2020-06-22T20:02:06.271Z",sageScore:3,diffs:[{njs:16.5,offset:0,notes:390,bombs:13,obstacles:13898,nps:3.832,length:261.25,characteristic:"Standard",difficulty:"Expert",events:1462,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:101.786,paritySummary:{errors:0,warns:0,resets:2},maxScore:351555,label:"GAS GAS GAS!!!!!",environment:"NiceEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/95e11f39b2898a38e3b5e61d2156ef5f5835f40f.zip",coverURL:"https://eu.cdn.beatsaver.com/95e11f39b2898a38e3b5e61d2156ef5f5835f40f.jpg",previewURL:"https://eu.cdn.beatsaver.com/95e11f39b2898a38e3b5e61d2156ef5f5835f40f.mp3"}],curator:{id:1096,name:"pyrowarfare",hash:"5e99c7df3f476a0006596cdf",avatar:"https://www.gravatar.com/avatar/28fcd25e8adfa72a17daa766767daf781bee89776333a3ed7a4cc84146e6a3e8?d=retro",type:"SIMPLE",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/1096/playlist"},curatedAt:"2020-06-22T20:02:06.271Z",createdAt:"2020-06-22T20:02:06.271Z",updatedAt:"2020-06-22T20:02:06.271Z",lastPublishedAt:"2020-06-22T20:02:06.271Z",tags:["anime","electronic","house"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1}]},function(e,t,n){if(AFRAME.registerComponent("song-info-positioner",{schema:{victory:{default:!1}},update:function(){this.data.victory?this.el.object3D.position.y=-1.2:this.el.object3D.position.y=-1}}),window.AFRAME){const t=["song-info-positioner"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){n(6);if(AFRAME.registerComponent("song-preview-system",{schema:{selectedChallengeId:{type:"string"},selectedChallengeVersion:{type:"string"}},init:function(){this.audio=document.createElement("audio"),this.audio.volume=.5},update:function(e){const t=this.data;console.log("update-song",e,t),t.selectedChallengeId&&e.selectedChallengeId!==t.selectedChallengeId?(this.audio.pause(),this.audio.setAttribute("src","https://cdn.beatsaver.com/"+t.selectedChallengeVersion+".mp3"),this.audio.currentTime=0,this.audio.play()):t.selectedChallengeId||this.audio.pause()}}),window.AFRAME){const t=["song-preview-system"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("song-progress-info",{dependencies:["geometry","material"],schema:{enabled:{default:!1}},init:function(){this.tick=AFRAME.utils.throttleTick(this.tick.bind(this),1e3),this.progress=this.el.getObject3D("mesh"),this.progress.geometry.translate(.285,0,0),this.el.sceneEl.addEventListener("cleargame",()=>{this.progress.scale.x=1e-4})},update:function(e){this.progress.scale.x=1e-4},updateInfo:function(){const e=this.el.sceneEl.components.song.source;if(!e||!e.buffer)return;const t=this.el.sceneEl.components.song.getCurrentTime()/e.buffer.duration;t&&(this.progress.scale.x=t)},tick:function(){this.data.enabled&&this.updateInfo()}}),window.AFRAME){const t=["song-progress-info"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){n(6);const r={once:!0};let i=AFRAME.utils.getUrlParameter("skip");if(i=i?parseInt(i)/1e3:0,AFRAME.registerComponent("song",{schema:{audio:{type:"string"},analyserEl:{type:"selector",default:"#audioAnalyser"},challengeId:{default:""},isBeatsPreloaded:{default:!1},isGameOver:{default:!1},isLoading:{default:!1},isPlaying:{default:!1},isVictory:{default:!1}},init:function(){this.analyserSetter={buffer:!0},this.audioAnalyser=this.data.analyserEl.components.audioanalyser,this.context=this.audioAnalyser.context,this.isAudioPlaying=!1,this.songStartTime=0,this.onSongComplete=this.onSongComplete.bind(this),this.audioAnalyser.gainNode.gain.value=.5,this.el.addEventListener("gamemenurestart",this.onRestart.bind(this)),this.el.addEventListener("wallhitstart",this.onWallHitStart.bind(this)),this.el.addEventListener("wallhitend",this.onWallHitEnd.bind(this))},update:function(e){const t=this.data;if(!e.isLoading&&t.isLoading&&t.audio)this.processAudio();else if(!e.audio&&t.audio&&t.isLoading)this.processAudio();else if(e.isGameOver||!t.isGameOver){if(e.isGameOver&&!t.isGameOver&&(this.audioAnalyser.gainNode.value=.5),!e.isVictory&&t.isVictory)return this.data.analyserEl.addEventListener("audioanalyserbuffersource",e=>{this.audioAnalyser.resumeContext();const t=this.audioAnalyser.gainNode.gain;t.cancelScheduledValues(0),t.setValueAtTime(.05,0),this.source=e.detail,this.source.start(),this.el.emit("victory")},r),void this.audioAnalyser.refreshSource();!e.isBeatsPreloaded&&this.data.isBeatsPreloaded&&this.source&&this.startAudio(),!e.challengeId||t.challengeId?(e.isPlaying&&!t.isPlaying&&(this.audioAnalyser.suspendContext(),this.isAudioPlaying=!1),!e.isPlaying&&t.isPlaying&&this.source&&(this.audioAnalyser.resumeContext(),this.isAudioPlaying=!0)):this.stopAudio()}else this.onGameOver()},processAudio:function(){this.el.sceneEl.emit("songprocessstart",null,!1),this.getAudio().then(e=>{this.el.sceneEl.emit("songprocessfinish",null,!1)}).catch(console.error)},getAudio:function(){const e=this.data;return this.source&&this.stopAudio(),this.isAudioPlaying=!1,new Promise(t=>{e.analyserEl.addEventListener("audioanalyserbuffersource",e=>{this.source=e.detail,t(this.source)},r),this.analyserSetter.src=this.data.audio,e.analyserEl.setAttribute("audioanalyser",this.analyserSetter)})},stopAudio:function(){this.source?(this.source.onended=null,this.isAudioPlaying&&this.source.stop(),this.source.disconnect(),this.source=null,this.isAudioPlaying=!1):console.warn("[song] Tried to stopAudio, but not playing.")},onSongComplete:function(){this.data.isPlaying&&this.el.emit("songcomplete")},onGameOver:function(){this.isAudioPlaying=!1;const e=this.source.playbackRate;e.setValueAtTime(e.value,this.context.currentTime),e.linearRampToValueAtTime(0,this.context.currentTime+3.5);const t=this.audioAnalyser.gainNode.gain;t.setValueAtTime(t.value,this.context.currentTime),t.linearRampToValueAtTime(0,this.context.currentTime+3.5),setTimeout(()=>{this.data.isGameOver&&this.stopAudio()},3500)},onRestart:function(){this.isAudioPlaying=!1,this.source&&this.source.disconnect();this.audioAnalyser.gainNode.gain.cancelScheduledValues(0),this.data.analyserEl.addEventListener("audioanalyserbuffersource",e=>{this.source=e.detail,this.el.sceneEl.emit("songloadfinish",null,!1)},r),this.audioAnalyser.refreshSource()},onWallHitStart:function(){this.audioAnalyser.gainNode.gain.linearRampToValueAtTime(.1,this.context.currentTime+.1)},onWallHitEnd:function(){this.audioAnalyser.gainNode.gain.linearRampToValueAtTime(.5,this.context.currentTime+.1)},startAudio:function(){this.audioAnalyser.gainNode.gain.setValueAtTime(.5,this.context.currentTime),this.songStartTime=this.context.currentTime,this.source.onended=this.onSongComplete,this.source.start(0,i||0),this.isAudioPlaying=!0},getCurrentTime:function(){return this.context.currentTime-this.songStartTime}}),window.AFRAME){const t=["song"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){"use strict";n.r(t);var r=n(0),i=n.n(r);const a=[{name:"bgcolor",property:"backglow.color"},{name:"leftglow",property:"leftsideglow.color"},{name:"rightglow",property:"rightsideglow.color"}],o=[{id:"off",dur:500,to:"off"},{id:"primary",dur:5,to:"primary"},{id:"primarybright",dur:500,from:"tertiary",to:"primarybright"},{id:"secondary",dur:5,to:"secondary"},{id:"secondarybright",dur:500,from:"tertiary",to:"secondarybright"}],s=["off","secondary","secondary","secondarybright","","primary","primary","primarybright","primarybright"];AFRAME.registerComponent("stage-colors",{schema:{colorScheme:{default:"default"}},init:function(){this.el.addEventListener("cleargame",this.resetColors.bind(this)),this.el.sceneEl.addEventListener("playbuttonclick",this.resetColors.bind(this)),function(e,t){for(let n=0;n<a.length;n++){const r=a[n];for(let n=0;n<o.length;n++){const a=o[n];e.setAttribute(`animation__${r.name}${a.id}`,{property:"systems.materials."+r.property,type:"color",isRawProperty:!0,easing:"linear",dur:a.dur,from:a.from?i.a.schemes[t][a.from]:"",startEvents:`${r.name}${a.id}`,to:i.a.schemes[t][a.to]})}}}(this.el.sceneEl,this.data.colorScheme)},update:function(e){e.colorScheme&&this.data.colorScheme!==e.colorScheme&&function(e,t){for(let n=0;n<a.length;n++){const r=a[n];for(let n=0;n<o.length;n++){const a=o[n],s=`animation__${r.name}${a.id}`;a.from&&e.setAttribute(s,"from",i.a.schemes[t][a.from]),e.setAttribute(s,"to",i.a.schemes[t][a.to])}}}(this.el.sceneEl,this.data.colorScheme)},play:function(){this.el.emit("bgcolorsecondary",null,!1)},setColor:function(e,t){s[t]||(t=5),e.startsWith("curve")?this.el.emit(e+"stageeventcolor",s[t].replace("bright",""),!1):this.el.emit(`${e}color${s[t]}`,null,!1)},setColorInstant:function(e,t){const n=this.el.sceneEl.systems.materials;if("stars"===e){let e;return e=0===t?i.a.schemes[this.data.colorScheme].secondarybright:i.a.schemes[this.data.colorScheme].secondary,void l(n.stars,"color",e)}const r=i.a.schemes[this.data.colorScheme][s[t]];"moon"===e&&l(n.moon,"tint",r)},resetColors:function(){this.el.emit("bgcolorsecondary",null,!1),this.el.emit("curveevenstageeventcolor","off",!1),this.el.emit("curveoddstageeventcolor","off",!1)}});const c=new THREE.Color;function l(e,t,n){c.set(n),e.uniforms?(e.uniforms[t].value.x=c.r,e.uniforms[t].value.y=c.g,e.uniforms[t].value.z=c.b):e[t].set(n)}if(window.AFRAME){const t=["stage-colors"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("stage-lasers",{schema:{enabled:{default:!0}},init:function(){this.speed=0,this.lasers=[this.el.children[0].object3D,this.el.children[1].object3D,this.el.children[2].object3D]},pulse:function(e){this.speed=e/8},tick:function(e,t){0!==this.speed&&(t/=1e3,!this.data.enabled&&(this.speed*=.97,Math.abs(this.speed)<.01)?this.speed=0:(this.lasers[0].rotation.z+=this.speed*t,this.lasers[1].rotation.z-=this.speed*t*1.01,this.lasers[2].rotation.z+=this.speed*t*1.02))}}),window.AFRAME){const t=["stage-lasers"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){const r=n(0);if(AFRAME.registerComponent("stars",{schema:{color:{type:"color",default:r.initial.secondary},count:{default:500},radius:{default:300}},init:function(){const e=()=>(Math.random()-.5)*this.data.radius*2,t=new THREE.BufferGeometry;this.material=this.el.sceneEl.systems.materials.stars;const n=[];for(let t=0;t<this.data.count;t++)n.push(e(),e(),4*e());t.setAttribute("position",new THREE.Float32BufferAttribute(n,3)),t.computeBoundingSphere();const r=new THREE.Points(t,this.material);this.el.setObject3D("stars",r)},update:function(){this.material.color.setStyle(this.data.color)}}),window.AFRAME){const t=["stars"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("stats-param",{init:function(){"true"===AFRAME.utils.getUrlParameter("stats")&&this.el.setAttribute("stats","")}}),window.AFRAME){const t=["stats-param"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("stepback",{init:function(){this.message=document.getElementById("stepback"),this.camera=document.getElementById("camera"),this.lastTime=0,this.limit=-.9,this.throttling=300},tick:function(e,t){if(!(e-this.lastTime<this.throttling)){var n=this.camera.object3D.position,r=this.message.object3D.position;n.z<this.limit?(this.throttling=10,this.message.object3D.visible=!0,this.message.getObject3D("mesh").material.opacity=1-Math.abs(n.z-r.z),r.x=n.x,r.y=n.y):(this.message.object3D.visible=!1,this.throttling=500),this.lastTime=e}}}),window.AFRAME){const t=["stepback"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("sub-object",{schema:{from:{type:"selector"},name:{type:"string"}},init:function(){var e=this.el,t=this.data;t.from.addEventListener("model-loaded",n=>{const r=n.detail.model.getObjectByName(t.name);e.setObject3D("mesh",r.clone()),e.setAttribute("material","shader","flat"),e.emit("subobjectloaded",null,!1)})}}),window.AFRAME){const t=["sub-object"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){var r={superkeyboard:{wrapCount:30,inputOffsetY:.008,inputOffsetX:.08,img:"keyboard.png",hoverImg:"keyboard-hover.png",layout:[{key:"1",x:.013,y:.03,w:.093,h:.176},{key:"2",x:.106,y:.03,w:.088,h:.176},{key:"3",x:.194,y:.03,w:.077,h:.176},{key:"4",x:.271,y:.03,w:.085,h:.176},{key:"5",x:.356,y:.03,w:.081,h:.176},{key:"6",x:.437,y:.03,w:.081,h:.176},{key:"8",x:.603,y:.03,w:.082,h:.176},{key:"7",x:.519,y:.03,w:.084,h:.176},{key:"9",x:.685,y:.03,w:.076,h:.176},{key:"0",x:.76,y:.03,w:.088,h:.176},{key:"Delete",x:.867,y:.03,w:.124,h:.176},{key:"q",x:.013,y:.213,w:.098,h:.186},{key:"w",x:.111,y:.213,w:.107,h:.186},{key:"e",x:.218,y:.213,w:.096,h:.186},{key:"r",x:.313,y:.213,w:.095,h:.186},{key:"t",x:.408,y:.213,w:.094,h:.186},{key:"y",x:.503,y:.213,w:.099,h:.186},{key:"u",x:.602,y:.213,w:.097,h:.186},{key:"i",x:.701,y:.213,w:.085,h:.186},{key:"o",x:.786,y:.213,w:.099,h:.186},{key:"p",x:.885,y:.213,w:.097,h:.186},{key:"a",x:.063,y:.408,w:.1,h:.182},{key:"s",x:.163,y:.408,w:.097,h:.182},{key:"d",x:.26,y:.408,w:.098,h:.182},{key:"f",x:.358,y:.408,w:.094,h:.182},{key:"g",x:.452,y:.408,w:.1,h:.182},{key:"h",x:.552,y:.408,w:.105,h:.182},{key:"j",x:.657,y:.408,w:.085,h:.182},{key:"k",x:.743,y:.408,w:.105,h:.182},{key:"l",x:.848,y:.408,w:.1,h:.182},{key:"z",x:.107,y:.596,w:.106,h:.197},{key:"x",x:.213,y:.596,w:.1,h:.197},{key:"c",x:.313,y:.596,w:.093,h:.197},{key:"v",x:.406,y:.596,w:.096,h:.197},{key:"b",x:.502,y:.596,w:.093,h:.197},{key:"n",x:.595,y:.596,w:.099,h:.197},{key:"m",x:.694,y:.596,w:.106,h:.197},{key:" ",x:.372,y:.798,w:.249,h:.169},{key:"Insert",x:.017,y:-.001,w:.038,h:.018}]}};if("undefined"==typeof AFRAME)throw new Error("Component attempted to register before AFRAME was available.");var i={roboto:17,aileronsemibold:20,dejavu:20.5,exo2bold:20,exo2semibold:20.3,kelsonsans:22.8,monoid:19.5,mozillavr:9.5,sourcecodepro:20.3};function a(e,t){for(var n=0;n<e.length;n++)if(e[n].id===t)return e[n];return null}if(AFRAME.registerComponent("super-keyboard",{schema:{align:{default:"left",oneOf:["left","center","right"]},blinkingSpeed:{type:"int",default:400},filters:{type:"array"},font:{default:"aileronsemibold"},hand:{type:"selector"},imagePath:{default:"."},injectToRaycasterObjects:{default:!0},inputColor:{type:"color",default:"#6699ff"},interval:{type:"int",default:50},keyBgColor:{type:"color",default:"#000"},keyColor:{type:"color",default:"#6699ff"},keyHoverColor:{type:"color",default:"#1A407F"},keyPressColor:{type:"color",default:"#5290F6"},label:{type:"string",default:""},labelColor:{type:"color",default:"#aaa"},maxLength:{type:"int",default:0},model:{default:"basic"},show:{default:!0},multipleInputs:{default:!1},value:{type:"string",default:""},width:{default:.8}},init:function(){this.el.addEventListener("click",this.click.bind(this)),this.changeEventDetail={},this.textInputObject={},this.keys=null,this.focused=!1,this.keyHover=null,this.prevCheckTime=null,this.shift=!1,this.rawValue=this.data.value,this.defaultValue=this.data.value,this.userFilterFunc=null,this.intervalId=0,this.kbImg=document.createElement("a-entity"),this.kbImg.classList.add("keyboardRaycastable"),this.kbImg.classList.add("superKeyboardImage"),this.kbImg.addEventListener("raycaster-intersected",this.hover.bind(this)),this.kbImg.addEventListener("raycaster-intersected-cleared",this.blur.bind(this)),this.el.appendChild(this.kbImg),this.label=document.createElement("a-entity"),this.label.setAttribute("text",{align:"center",font:this.data.font,baseline:"bottom",lineHeight:40,shader:"msdf",negate:!0,value:this.data.label,color:this.data.labelColor,width:this.data.width,wrapCount:30}),this.el.appendChild(this.label),this.textInput=document.createElement("a-entity"),this.textInput.setAttribute("mixin","superKeyboardTextInput"),this.textInput.setAttribute("text",{align:this.data.align,font:this.data.font,lineHeight:35,shader:"msdf",value:this.data.value,color:this.data.inputColor,width:this.data.width}),this.el.appendChild(this.textInput),this.cursor=document.createElement("a-entity"),this.cursor.object3D.position.set(0,0,.001),this.cursor.setAttribute("material",{shader:"flat",color:this.data.inputColor}),this.textInput.appendChild(this.cursor),this.cursorUpdated=!1,this.keyBgColor=new THREE.Color,this.keyHoverColor=new THREE.Color,this.keyPressColor=new THREE.Color;var e=this;document.addEventListener("keydown",(function(t){if("t"===t.key){for(var n="",r="abcdefghijklmopqrstuvQWIEUTGASDLIGKBXACQWETL102394676457",i=Math.floor(20*Math.random()),a=0;a<i;a++)n+=r[Math.floor(Math.random()*r.length)];e.el.setAttribute("super-keyboard",{value:n})}})),document.addEventListener("show",this.open.bind(this)),this.hand=null,this.handListenersSet=!1,this.raycaster=null},update:function(e){var t=r[this.data.model],n=this.data.width,i=this.data.width/2;if(void 0!==t){e&&this.defaultValue===e.defaultValue?this.updateTextInput(this.filter(this.rawValue)):(this.rawValue=this.data.value,this.defaultValue=this.data.value,this.updateTextInput(this.filter(this.data.value))),this.data.width===e.width&&this.data.height===e.height&&this.data.keyColor===e.keyColor||(this.kbImg.setAttribute("geometry",{primitive:"plane",width:n,height:i}),this.kbImg.setAttribute("material",{shader:"flat",src:this.data.imagePath+"/"+t.img,color:this.data.keyColor,transparent:!0})),this.data.label===e.label&&this.data.labelColor===e.labelColor&&this.data.width===e.width||(this.label.setAttribute("text",{value:this.data.label,color:this.data.labelColor,width:this.data.width}),this.label.object3D.position.set(0,.3*n,-.02)),this.data.width===e.width&&this.data.keyBgColor===e.keyBgColor||this.initKeyColorPlane();var a="center"!==this.data.align?t.inputOffsetX*n:0;"right"===this.data.align&&(a*=-1),this.data.font===e.font&&this.data.inputColor===e.inputColor&&this.data.width===e.width&&this.data.align===e.align||this.textInput.setAttribute("text",{font:this.data.font,color:this.data.inputColor,width:n,wrapCount:t.wrapCount,align:this.data.align});for(var o=0;o<t.layout.length;o++){var s=t.layout[o];"Insert"===s.key&&(this.inputRect=s)}this.textInput.object3D.position.set(a,n/4-(this.inputRect.y+this.inputRect.h/2)*n/2+t.inputOffsetY*n,.002),this.data.width!==e.width&&this.cursor.setAttribute("geometry",{primitive:"plane",width:.03*n,height:.01*n}),this.updateCursorPosition(),this.setupHand(),this.keyBgColor.set(this.data.keyBgColor),this.keyHoverColor.set(this.data.keyHoverColor),this.keyPressColor.set(this.data.keyPressColor),this.data.show?this.open():this.close()}else console.error('super-keyboard ERROR: model "'+this.data.model+'" undefined.')},tick:function(e){var t;if(!(this.prevCheckTime&&e-this.prevCheckTime<this.data.interval))if(this.prevCheckTime){if(this.raycaster&&this.focused&&(t=this.raycaster.getIntersection(this.kbImg)))for(var n=t.uv,i=r[this.data.model].layout,a=0;a<i.length;a++){var o=i[a];if(n.x>o.x&&n.x<o.x+o.w&&1-n.y>o.y&&1-n.y<o.y+o.h){this.keyHover!==o&&(this.keyHover=o,this.updateKeyColorPlane(this.keyHover.key,this.keyHoverColor));break}}}else this.prevCheckTime=e},play:function(){this.cursorUpdated&&this.startBlinking()},pause:function(){this.stopBlinking()},initKeyColorPlane:function(){var e=this.keyColorPlane=document.createElement("a-entity");e.classList.add("superKeyboardKeyColorPlane"),e.object3D.position.z=.001,e.object3D.visible=!1,e.setAttribute("geometry",{primitive:"plane"}),e.setAttribute("material",{shader:"flat",color:this.data.keyBgColor,transparent:!0}),e.addEventListener("componentinitialized",(function(e){"material"===e.detail.name&&(this.getObject3D("mesh").material.blending=THREE.AdditiveBlending)})),this.el.appendChild(e)},updateKeyColorPlane:function(e,t){var n=r[this.data.model],i=this.keyColorPlane;if(e){for(var a=0;a<n.layout.length;a++){var o=n.layout[a];if(o.key===e){var s=this.data.width,c=this.data.width/2,l=s/2,u=c/2,h=o.w*s,d=o.h*c;i.object3D.scale.x=h,i.object3D.scale.y=d,i.object3D.position.x=o.x*s-l+h/2,i.object3D.position.y=(1-o.y)*c-u-d/2,i.getObject3D("mesh").material.color.copy(t);break}}i.object3D.visible=!0}else i.object3D.visible=!1},setupHand:function(){if(this.hand&&this.hand.ownRaycaster&&this.hand.removeAttribute("raycaster"),this.data.hand?this.hand=this.data.hand:this.hand=document.querySelector(["[cursor]","[vive-controls]","[tracked-controls]","[gearvr-controls]","[oculus-go-controls]","[oculus-touch-controls]","[windows-motion-controls]","[hand-controls]","[daydream-controls] [cursor] > [raycaster]"].join(",")),this.hand){if(!this.hand.hasLoaded)return void this.hand.addEventListener("loaded",this.setupHand.bind(this));var e=this.hand.components.raycaster,t={};if(e){if(this.hand.ownRaycaster=!1,this.data.injectToRaycasterObjects){var n=e.data.objects.split(",");-1===n.indexOf(".keyboardRaycastable")&&n.push(".keyboardRaycastable"),t.objects=n.join(",").replace(/^,/,""),this.hand.setAttribute("raycaster",t)}}else this.hand.ownRaycaster=!0,t.showLine=this.data.show,t.enabled=this.data.show,this.data.injectToRaycasterObjects&&(t.objects=".keyboardRaycastable"),this.hand.setAttribute("raycaster",t);this.raycaster=this.hand.components.raycaster}else console.error('super-keyboard: no controller found. Add <a-entity> with controller or specify with super-keyboard="hand: #selectorToController".')},filter:function(e){if(""===e)return"";for(var t=0;t<this.data.filters.length;t++)switch(this.data.filters[t]){case"custom":this.userFilterFunc&&(e=this.userFilterFunc(e));break;case"allupper":e=e.toUpperCase();break;case"alllower":e=e.toLowerCase();break;case"title":e=e.split(" ").map((function(e){return e[0].toUpperCase()+e.substr(1)})).join(" ");break;case"numbers":e=e.split("").filter((function(e){return!isNaN(parseInt(e))||"."===e})).join("");break;case"first":e=e[0].toUpperCase()+e.substr(1);break;case"trim":e=e.trim()}return this.data.maxLength>0?e.substr(0,this.data.maxLength):e},click:function(e){if(this.keyHover){switch(this.keyHover.key){case"Enter":this.accept();break;case"Insert":return;case"Delete":this.rawValue=this.rawValue.substr(0,this.rawValue.length-1);var t=this.filter(this.rawValue);this.el.setAttribute("super-keyboard","value",t),this.updateTextInput(t),this.changeEventDetail.value=t,this.el.emit("superkeyboardchange",this.changeEventDetail);break;case"Shift":this.shift=!this.shift,this.keyHover.el.setAttribute("material","color",this.shift?this.data.keyHoverColor:this.data.keyBgColor);break;case"Escape":this.dismiss();break;default:if(this.data.maxLength>0&&this.rawValue.length>this.data.maxLength)break;this.rawValue+=this.shift?this.keyHover.key.toUpperCase():this.keyHover.key;t=this.filter(this.rawValue);this.el.setAttribute("super-keyboard","value",t),this.updateTextInput(t),this.changeEventDetail.value=t,this.el.emit("superkeyboardchange",this.changeEventDetail)}this.updateKeyColorPlane(this.keyHover.key,this.keyPressColor);var n=this;setTimeout((function(){n.updateKeyColorPlane(n.keyHover.key,n.keyHoverColor)}),100),this.updateCursorPosition()}},open:function(){this.el.object3D.visible=!0,this.hand&&this.hand.ownRaycaster&&this.hand.setAttribute("raycaster",{showLine:!0,enabled:!0})},close:function(){this.el.object3D.visible=!1,this.hand&&this.hand.ownRaycaster&&this.hand.setAttribute("raycaster",{showLine:!1,enabled:!1})},accept:function(){this.el.emit("superkeyboardinput",{value:this.data.value}),this.data.multipleInputs?(this.rawValue="",this.data.value="",this.updateTextInput("")):(this.el.object3D.visible=!1,this.hand&&this.hand.ownRaycaster&&this.hand.setAttribute("raycaster",{showLine:!1,enabled:!1}),this.data.show=!1)},dismiss:function(){this.data.value=this.defaultValue,this.updateTextInput(),this.el.object3D.visible=!1,this.hand&&this.hand.ownRaycaster&&this.hand.setAttribute("raycaster",{showLine:!1,enabled:!1}),this.el.emit("superkeyboarddismiss"),this.data.show=!1},blur:function(e){this.focused=!1,this.keyHover&&"Shift"!==this.keyHover.key&&this.updateKeyColorPlane(this.keyHover.key,this.keyBgColor),this.keyHover=null},hover:function(e){this.focused=!0},startBlinking:function(){this.stopBlinking(),this.intervalId=window.setInterval(this.blink.bind(this),this.data.blinkingSpeed)},stopBlinking:function(){window.clearInterval(this.intervalId),this.intervalId=0},blink:function(){this.cursor.object3D.visible=!this.cursor.object3D.visible},setCustomFilter:function(e){this.userFilterFunc=e},addCustomModel:function(e,t){e&&(r[e]=t)},updateCursorPosition:function(){var e=this.textInput.components.text.currentFont;if(!e){var t=this;return this.cursor.object3D.visible=!1,void window.setTimeout((function(){t.updateCursorPosition(),t.startBlinking()}),700)}var n=this.data.width,o=r[this.data.model],s=-this.inputRect.h/2*n/2.4+o.inputOffsetY*n,c=this.data.width/this.textInput.components.text.data.wrapCount,l=0,u=i[this.textInput.components.text.data.font];void 0===u&&(u=20);for(var h=0;h<this.data.value.length;h++){var d=a(e.chars,this.data.value.charCodeAt(h));l+=d.width+d.xadvance*(32===d.id?2:1)}"center"===this.data.align?l=l*c*u*.0011/2+.02*n:"left"===this.data.align?(l=l*c*u*.0011+.02*n,l-=n/2):"right"===this.data.align&&(l=-l*c*u*.0011-.02*n,l+=n/2),this.cursor.object3D.position.set(l,s,.001),this.cursorUpdated=!0},updateTextInput:function(e){this.textInputObject.value=e||this.data.value,this.textInput.setAttribute("text",this.textInputObject)}}),window.AFRAME){const t=["super-keyboard"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){const r=new THREE.Color;if(AFRAME.registerComponent("supercurve-color",{init:function(){const e=this.el;e.sceneEl.addEventListener("curveevenstageeventcolor",e=>{e.detail&&"off"!==e.detail?this.setColor("color1",e.detail):this.setColor("color1","primary")}),e.sceneEl.addEventListener("curveoddstageeventcolor",e=>{e.detail&&"off"!==e.detail?this.setColor("color2",e.detail):this.setColor("color2","secondary")})},setColor:function(e,t){const n=this.el.components.material.material.uniforms[e].value,i=this.el.sceneEl.systems.materials.scheme[t];r.set(i),n.x=r.r,n.y=r.g,n.z=r.b}}),window.AFRAME){const t=["supercurve-color"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){"use strict";n.r(t);var r=n(0),i=n.n(r);if(AFRAME.registerShader("supercurve",{schema:{cameraPercent:{type:"number",is:"uniform"},color1:{type:"color",is:"uniform",default:i.a.initial.primary},color2:{type:"color",is:"uniform",default:i.a.initial.secondary},fogColor:{type:"color",is:"uniform",default:i.a.initial.primary},side:{default:"double"},transparent:{default:!0}},fragmentShader:n(168),vertexShader:n(169),update:function(e){this.updateVariables(e,"attribute"),this.updateVariables(e,"uniform"),this.el.sceneEl.systems.materials.registerCurve(this.material)}}),window.AFRAME){const t=[],n=["supercurve"],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t){e.exports="varying vec2 vUvs;\nvarying vec3 vWorldPos;\nuniform vec3 color1;\nuniform vec3 color2;\nuniform vec3 fogColor;\nuniform float opacity;\n\n#define BLACK vec3(0.0)\n#define YELLOW vec3(250.0 / 255.0, 244.0 / 255.0, 180.0 / 255.0)\n\nvoid main() {\n vec3 col;\n\n // Lines.\n float f1 = clamp(sin(vUvs.x * 12.9 + 1.4) - 0.99, 0.0, 1.0) * 80.0;\n float f2 = clamp(sin(3.1416 + vUvs.x * 12.9 + 1.45) - 0.99, 0.0, 1.0) * 80.0;\n\n // Gradients.\n f1 += sin(vWorldPos.y - vWorldPos.x - vWorldPos.z * 0.4 + 1.4) * 0.1 + 0.1;\n f2 += sin(vWorldPos.y - vWorldPos.x - vWorldPos.z * 0.3 + 5.5) * 0.1 + 0.1;\n float f3 = sin(vWorldPos.y - vWorldPos.x - vWorldPos.z * 0.1 + 10.3) * 0.1 + 0.1;\n\n // Build color.\n col = mix(BLACK, color1, f1);\n col = mix(col, color2, f2);\n col = mix(col, YELLOW, f3);\n\n // Fog.\n float far = 100.0;\n float fog = 1.0 - clamp(length(vWorldPos - cameraPosition) / 400.0, 0.0, 1.0);\n\n col = mix(fogColor, col, fog);\n\n // fade beginning and end\n float alpha = 0.0;\n alpha += smoothstep(0.0, 0.003, vUvs.y);\n alpha -= smoothstep(0.997, 1.0, vUvs.y);\n\n gl_FragColor = vec4(col, alpha * (fog * fog));\n}\n"},function(e,t){e.exports="varying vec2 vUvs;\nvarying vec3 vWorldPos;\n\nvoid main() {\n vWorldPos = (modelMatrix * vec4(position, 1.0)).xyz;\n vUvs = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n"},function(e,t,n){n(171),n(172);const r=new THREE.Vector3,i=new THREE.Vector3;if(AFRAME.registerComponent("supercurve",{schema:{debug:{default:!1}},init:function(){this.buffers={},this.curve=null,this.fullLength=null,this.indexes={},this.length=null,this.points=[]},play:function(){this.generateCurve(1500)},generateCurve:function(e){this.length=e,e+=200,this.fullLength=e,this.points.length=0,this.points.push(new THREE.Vector3(0,0,0)),this.points.push(new THREE.Vector3(0,0,-100));let t,n=100;for(let r=2;r<=Math.ceil(e/100)-1;r++)t=this.points[r-1],n+=100,this.points.push(new THREE.Vector3(t.x+(10*Math.random()*2-10),t.y+(10*Math.random()*2-10),-1*n));const r=new THREE.CatmullRomCurve3(this.points),i=e-r.getLength(),a=r.getTangent(1,new THREE.Vector3),o=this.points[this.points.length-1].clone().add(a.multiplyScalar(i));this.points.push(o),this.setCurve(this.points),this.el.emit("supercurvegenerate")},setCurve:function(e){const t=this.buffers,n=(this.data,this.el),a=this.indexes;this.points=e;const o=this.curve=new THREE.CatmullRomCurve3(e),s=o.getLength(),c=o.getSpacedPoints(350),l=s/350,u=new THREE.BufferGeometry;t.position=new Float32Array(2106),t.normal=new Float32Array(2106),t.uvs=new Float32Array(1404),a.position=0,a.normal=0,a.uvs=0;const h=new THREE.Vector3(-1.5,0,-1*l/2),d=new THREE.Vector3(1.5,0,-1*l/2);for(let e=0;e<c.length;e++){const o=e/(c.length-1),s=c[e];if(0===c[e].x&&0===c[e].y&&0===c[e].z?(c[e].set(.001,0,.001),i.y=-1*Math.abs(i.y)):(i.copy(r).cross(c[e]).normalize(),i.y=-1*i.y),this.getPositionRelativeToTangent(o,h,r),t.position[a.position++]=r.x,t.position[a.position++]=r.y,t.position[a.position++]=r.z,t.normal[a.normal++]=i.x,t.normal[a.normal++]=i.y,t.normal[a.normal++]=i.z,t.uvs[a.uvs++]=0,t.uvs[a.uvs++]=o,this.getPositionRelativeToTangent(o,d,r),t.position[a.position++]=r.x,t.position[a.position++]=r.y,t.position[a.position++]=r.z,t.normal[a.normal++]=i.x,t.normal[a.normal++]=i.y,t.normal[a.normal++]=i.z,t.uvs[a.uvs++]=1,t.uvs[a.uvs++]=o,this.data.debug){const e=document.createElement("a-box");e.setAttribute("geometry",{width:.1,height:.1,depth:.1}),e.setAttribute("material",{shader:"flat",color:"#333"}),e.object3D.position.copy(s),e.object3D.position.y+=.1,n.appendChild(e)}}if(u.setAttribute("normal",new THREE.BufferAttribute(t.normal,3)),u.setAttribute("position",new THREE.BufferAttribute(t.position,3)),u.setAttribute("uv",new THREE.BufferAttribute(t.uvs,2)),n.getObject3D("mesh"))n.getObject3D("mesh").geometry=THREE.BufferGeometryUtils.toTrianglesDrawMode(u,THREE.TriangleStripDrawMode);else{const e=new THREE.Mesh(THREE.BufferGeometryUtils.toTrianglesDrawMode(u,THREE.TriangleStripDrawMode));n.setObject3D("mesh",e)}},getPointAt:function(e,t){e=this.songProgressToCurveProgress(e),this.curve.getPointAt(e,t)},getTangentAt:function(e,t){e=this.songProgressToCurveProgress(e),this.curve.getTangentAt(e,t)},getPositionRelativeToTangent:function(){const e=new THREE.Object3D,t=new THREE.Vector3,n=new THREE.Vector3;return function(r,i,a,o){this.curve;return e.parent||this.el.sceneEl.object3D.add(e),r<0?(this.getPointAt(0,e.position),this.getTangentAt(0,n),e.position.addScaledVector(n,r)):r>1?(this.getPointAt(1,e.position),this.getTangentAt(1,n),e.position.addScaledVector(n,r)):(this.getPointAt(r,e.position),this.getTangentAt(r,n)),o?e.lookAt(t.copy(e.position).sub(n)):e.lookAt(t.copy(e.position).add(n)),e.updateMatrixWorld(),a.copy(i),e.localToWorld(a),a}}(),alignToCurve:function(){new THREE.Vector3,new THREE.Vector3;const e=new THREE.Vector3(0,0,-.01),t=new THREE.Vector3;return function(n,r){this.getPositionRelativeToTangent(n,e,t),r.lookAt(t),r.position.y+=.01}}(),songProgressToCurveProgress:function(e){return e*this.length/this.fullLength},curveProgressToSongProgress:function(e){return e*this.fullLength/this.length}}),AFRAME.registerComponent("supercurve-follow",{schema:{enabled:{default:!1},speed:{type:"number"},target:{type:"selector"}},init:function(){this.curveProgress=0,this.songProgress=0},update:function(){this.supercurve=this.data.target.components.supercurve},tick:function(){new THREE.Vector3(0,0,1),new THREE.Vector3;return function(e,t){const n=this.data;this.el;if(!n.enabled||!t)return;if(this.curveProgress>=1)return;const r=this.supercurve,i=r.curve;if(!i)return;this.curveProgress=this.curveProgress||0;const a=n.speed*(t/1e3);if(this.curveProgress+=a/this.supercurve.fullLength,this.data.target.components.material.material.uniforms.cameraPercent.value=this.curveProgress,this.curveProgress>=1)return this.curveProgress=1,void(this.data.target.components.material.material.uniforms.cameraPercent.value=this.curveProgress);i.getPointAt(this.curveProgress,this.el.object3D.position),this.songProgress=r.curveProgressToSongProgress(this.curveProgress),r.alignToCurve(this.songProgress,this.el.object3D)}}()}),window.AFRAME){const t=["supercurve","supercurve-follow"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t){const n=THREE.Math,r=THREE.Vector3,i=THREE.Matrix4;function a(){this.type="Curve",this.arcLengthDivisions=200}var o,s,c;Object.assign(a.prototype,{getPoint:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null},getPointAt:function(e,t){var n=this.getUtoTmapping(e);return this.getPoint(n,t)},getPoints:function(e,t){var n;void 0===e&&(e=5),t?(n=t).length=0:n=[];for(var r=0;r<=e;r++)n.push(this.getPoint(r/e));return n},getSpacedPoints:function(e,t){var n;void 0===e&&(e=5),t?(n=t).length=0:n=[];for(var r=0;r<=e;r++)n.push(this.getPointAt(r/e));return n},getLength:(c=[],function(){var e=this.getLengths(void 0,c);return e[e.length-1]}),getLengths:function(e,t){if(void 0===e&&(e=this.arcLengthDivisions),this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1,t&&(t.length=0);var n,r,i=t||[],a=this.getPoint(0),o=0;for(i.push(0),r=1;r<=e;r++)o+=(n=this.getPoint(r/e)).distanceTo(a),i.push(o),a=n;return this.cacheArcLengths=i,i},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(e,t){var n,r=this.getLengths(),i=0,a=r.length;n=t||e*r[a-1];for(var o,s=0,c=a-1;s<=c;)if((o=r[i=Math.floor(s+(c-s)/2)]-n)<0)s=i+1;else{if(!(o>0)){c=i;break}c=i-1}if(r[i=c]===n)return i/(a-1);var l=r[i];return(i+(n-l)/(r[i+1]-l))/(a-1)},getTangent:(o=new THREE.Vector3,s=new THREE.Vector3,function(e,t){var n,r=e-1e-4,i=e+1e-4;return r<0&&(r=0),i>1&&(i=1),this.getPoint(r,o),this.getPoint(i,s),t?(n=t).copy(s).sub(o):n=s.clone().sub(o),n.normalize()}),getTangentAt:function(e,t){var n=this.getUtoTmapping(e);return this.getTangent(n,t)},computeFrenetFrames:function(e,t){var a,o,s,c=new r,l=[],u=[],h=[],d=new r,p=new i;for(a=0;a<=e;a++)o=a/e,l[a]=this.getTangentAt(o),l[a].normalize();u[0]=new r,h[0]=new r;var f=Number.MAX_VALUE,m=Math.abs(l[0].x),g=Math.abs(l[0].y),y=Math.abs(l[0].z);for(m<=f&&(f=m,c.set(1,0,0)),g<=f&&(f=g,c.set(0,1,0)),y<=f&&c.set(0,0,1),d.crossVectors(l[0],c).normalize(),u[0].crossVectors(l[0],d),h[0].crossVectors(l[0],u[0]),a=1;a<=e;a++)u[a]=u[a-1].clone(),h[a]=h[a-1].clone(),d.crossVectors(l[a-1],l[a]),d.length()>Number.EPSILON&&(d.normalize(),s=Math.acos(n.clamp(l[a-1].dot(l[a]),-1,1)),u[a].applyMatrix4(p.makeRotationAxis(d,s))),h[a].crossVectors(l[a],u[a]);if(!0===t)for(s=Math.acos(n.clamp(u[0].dot(u[e]),-1,1)),s/=e,l[0].dot(d.crossVectors(u[0],u[e]))>0&&(s=-s),a=1;a<=e;a++)u[a].applyMatrix4(p.makeRotationAxis(l[a],s*a)),h[a].crossVectors(l[a],u[a]);return{tangents:l,normals:u,binormals:h}},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this},toJSON:function(){var e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e},fromJSON:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}),THREE.Curve=a},function(e,t){const n=THREE.Vector3,r=THREE.Curve;function i(){var e=0,t=0,n=0,r=0;function i(i,a,o,s){e=i,t=o,n=-3*i+3*a-2*o-s,r=2*i-2*a+o+s}return{initCatmullRom:function(e,t,n,r,a){i(t,n,a*(n-e),a*(r-t))},initNonuniformCatmullRom:function(e,t,n,r,a,o,s){var c=(t-e)/a-(n-e)/(a+o)+(n-t)/o,l=(n-t)/o-(r-t)/(o+s)+(r-n)/s;i(t,n,c*=o,l*=o)},calc:function(i){var a=i*i;return e+t*i+n*a+r*(a*i)}}}var a=new n,o=new i,s=new i,c=new i;function l(e,t,n,i){r.call(this),this.type="CatmullRomCurve3",this.points=e||[],this.closed=t||!1,this.curveType=n||"centripetal",this.tension=i||.5}l.prototype=Object.create(r.prototype),l.prototype.constructor=l,l.prototype.isCatmullRomCurve3=!0,l.prototype.getPoint=function(e,t){var r,i,l,u,h=t||new n,d=this.points,p=d.length,f=(p-(this.closed?0:1))*e,m=Math.floor(f),g=f-m;if(this.closed?m+=m>0?0:(Math.floor(Math.abs(m)/p)+1)*p:0===g&&m===p-1&&(m=p-2,g=1),this.closed||m>0?r=d[(m-1)%p]:(a.subVectors(d[0],d[1]).add(d[0]),r=a),i=d[m%p],l=d[(m+1)%p],this.closed||m+2<p?u=d[(m+2)%p]:(a.subVectors(d[p-1],d[p-2]).add(d[p-1]),u=a),"centripetal"===this.curveType||"chordal"===this.curveType){var y="chordal"===this.curveType?.5:.25,v=Math.pow(r.distanceToSquared(i),y),b=Math.pow(i.distanceToSquared(l),y),w=Math.pow(l.distanceToSquared(u),y);b<1e-4&&(b=1),v<1e-4&&(v=b),w<1e-4&&(w=b),o.initNonuniformCatmullRom(r.x,i.x,l.x,u.x,v,b,w),s.initNonuniformCatmullRom(r.y,i.y,l.y,u.y,v,b,w),c.initNonuniformCatmullRom(r.z,i.z,l.z,u.z,v,b,w)}else"catmullrom"===this.curveType&&(o.initCatmullRom(r.x,i.x,l.x,u.x,this.tension),s.initCatmullRom(r.y,i.y,l.y,u.y,this.tension),c.initCatmullRom(r.z,i.z,l.z,u.z,this.tension));return h.set(o.calc(g),s.calc(g),c.calc(g)),h},l.prototype.copy=function(e){r.prototype.copy.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var i=e.points[t];this.points.push(i.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this},l.prototype.toJSON=function(){var e=r.prototype.toJSON.call(this);e.points=[];for(var t=0,n=this.points.length;t<n;t++){var i=this.points[t];e.points.push(i.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e},l.prototype.fromJSON=function(e){r.prototype.fromJSON.call(this,e),this.points=[];for(var t=0,i=e.points.length;t<i;t++){var a=e.points[t];this.points.push((new n).fromArray(a))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this},THREE.CatmullRomCurve3=l},function(e,t,n){if(AFRAME.registerShader("superCutFxShader",{schema:{startTime:{type:"float",is:"uniform"},timeMs:{type:"time",is:"uniform"},color:{type:"color",is:"uniform"}},vertexShader:"\n varying vec2 uvs;\n varying vec3 worldPos;\n void main() {\n uvs.xy = uv.xy;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n }\n ",fragmentShader:"\n uniform float startTime;\n uniform float timeMs;\n uniform vec3 color;\n varying vec2 uvs;\n varying vec3 worldPos;\n\n void main() {\n float time = (timeMs - startTime) / 2000.0;\n vec2 p = uvs.xy - 0.5;\n float r = p.x * p.x + p.y * p.y;\n float alpha = 1.0 - smoothstep(time - 0.01, time, r);\n alpha *= smoothstep(time - 0.1, time, r);\n alpha *= 1.0 - time * 5.5;\n gl_FragColor = vec4(color, alpha);\n }\n "}),window.AFRAME){const t=[],n=["superCutFxShader"],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){const r=new THREE.Color;if(AFRAME.registerComponent("supercutfx",{schema:{colorPrimary:{type:"string"},colorSecondary:{type:"string"}},init:function(){this.rigEl=document.getElementById("curveFollowRig"),this.startTime=-1100},createSuperCut:function(e,t){const n=this.el,i=this.el.getObject3D("mesh");i.material.transparent=!0,this.rigEl.object3D.worldToLocal(n.object3D.position.copy(e.position)),n.object3D.position.z-=.25,n.object3D.visible=!0,this.startTime=n.sceneEl.time,r.set("red"===t?this.data.colorPrimary:this.data.colorSecondary);const a=i.material.uniforms.color.value;a.x=r.r,a.y=r.g,a.z=r.b,i.material.uniforms.startTime.value=this.startTime-50,n.play()},tick:function(e){e>this.startTime+1e3&&(this.el.object3D.visible=!1,this.el.pause())}}),window.AFRAME){const t=["supercutfx"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("tail",{schema:{height:{default:.1},segments:{default:10,type:"int"},target:{type:"selector"},width:{default:1}},init:function(){const e=this.data,t=this.geometry=new THREE.PlaneBufferGeometry(e.width,e.height,e.segments,1);t.deleteAttribute("normal"),t.translate(e.width/2,0,0);const n=this.el.sceneEl.systems.materials.handStarTrail,r=new THREE.Mesh(t,n);r.frustumCulled=!1,this.el.setObject3D("mesh",r),this.positions=t.attributes.position.array,this.numVerts=2*e.segments+2,this.geometry=t,this.target=e.target.object3D,this.targetPos=new THREE.Vector3},tick:function(e,t){const n=this.positions,r=this.targetPos;let i,a=this.numVerts/2*3,o=this.data.height/2;for(let e=this.numVerts/2-1;e>0;e--)i=3*e,n[i]=n[i-3],n[i+1]=n[i-2],n[i+2]=n[i-1],i+=a,n[i]=n[i-3],n[i+1]=n[i-2],n[i+2]=n[i-1];this.target.getWorldPosition(r),n[0]=r.x,n[1]=r.y+o,n[2]=r.z-.1,n[a+0]=r.x,n[a+1]=r.y-o,n[a+2]=r.z-.1,this.geometry.attributes.position.needsUpdate=!0}}),window.AFRAME){const t=["tail"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("text-counter",{dependencies:["text"],schema:{decimals:{default:0},dur:{default:2e3,type:"int"},enabled:{default:!1},emit:{default:!1},prefix:{default:""},suffix:{default:""},value:{default:0,type:"float"}},init:function(){this.currentValue=0,this.hasCompleted=!1,this.textValue={value:""}},update:function(e){this.currentValue=0,this.textValue.value=`${this.data.prefix}${this.decimals(0)}${this.data.suffix}`,this.el.setAttribute("text",this.textValue),this.hasCompleted=!1},tick:function(e,t){this.data.enabled&&!this.hasCompleted&&(this.currentValue+=this.data.value*(t/this.data.dur),this.currentValue>=this.data.value&&(this.currentValue=this.data.value,this.data.emit&&this.el.emit("textcounterdone",null,!1),this.hasCompleted=!0),this.textValue.value=`${this.data.prefix}${this.decimals(this.currentValue)}${this.data.suffix}`,this.el.setAttribute("text",this.textValue))},decimals:function(e){var t=Math.pow(10,this.data.decimals);return(parseInt(e*t)/t).toFixed(this.data.decimals)}}),window.AFRAME){const t=["text-counter"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("text-truncate",{schema:{value:{type:"string"},length:{type:"int",default:10}},update:function(){this.el.setAttribute("text","value",function(e,t){if(!e)return"";if(e.length>=t)return e.substring(0,t-3)+"...";return e}(this.data.value,this.data.length))}}),window.AFRAME){const t=["text-truncate"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("text-uppercase",{schema:{value:{type:"string"}},update:function(){this.el.setAttribute("text","value",this.data.value.toUpperCase())}}),window.AFRAME){const t=["text-uppercase"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("toggle-pause-play",{schema:{isPlaying:{default:!1}},update:function(){const e=this.data.isPlaying?"pause":"play";parent.postMessage(JSON.stringify({verify:"game-action",action:e}),"*")}}),window.AFRAME){const t=["toggle-pause-play"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){"use strict";n.r(t);var r=n(0),i=n.n(r);if(AFRAME.registerComponent("trail",{schema:{color:{default:"primary"},colorScheme:{default:"default"},enabled:{default:!1},hand:{type:"string"}},init:function(){const e=this.geometry=new THREE.BufferGeometry,t=this.maxPoints=12,n=this.vertices=new Float32Array(36*t),r=this.colors=new Float32Array(48*t);this.bladeColor={alpha:1},this.rigContainer=document.getElementById("rigContainer"),this.bladeEl=this.el.querySelector(".blade"),this.layers=0,this.bladeTrajectory=[{top:new THREE.Vector3(-.5,0,0),center:new THREE.Vector3(0,0,0),bottom:new THREE.Vector3(.5,0,0)},{top:new THREE.Vector3(-.5,.5,0),center:new THREE.Vector3(0,.5,0),bottom:new THREE.Vector3(.5,.5,0)},{top:new THREE.Vector3(-.5,1,0),center:new THREE.Vector3(0,1,0),bottom:new THREE.Vector3(.5,1,0)}],this.newSample=null,e.setAttribute("position",new THREE.BufferAttribute(n,3).setUsage(THREE.DynamicDrawUsage)),e.setAttribute("vertexColor",new THREE.BufferAttribute(r,4).setUsage(THREE.DynamicDrawUsage));const i=new THREE.ShaderMaterial({side:THREE.DoubleSide,vertexColors:THREE.VertexColors,transparent:!0,depthTest:!1,blending:THREE.AdditiveBlending,vertexShader:["varying vec4 vColor;","attribute vec4 vertexColor;","void main() {","vec4 modelViewPosition = modelViewMatrix * vec4(position, 1.0);","vColor = vertexColor;","gl_Position = projectionMatrix * modelViewPosition;","}"].join(""),fragmentShader:["varying vec4 vColor;","uniform float pulse;","void main() {","gl_FragColor = vec4(vColor.xyz, vColor.a + pulse);","}"].join(""),uniforms:{pulse:{value:0}}}),a=this.mesh=new THREE.Mesh(e,i);a.frustumCulled=!1,a.vertices=n,this.rigContainer.setObject3D("trail__"+this.data.hand,a)},update:function(e){if(this.mesh.visible=this.data.enabled,!e.enabled&&this.data.enabled&&(this.enabledTime=this.el.sceneEl.time),e.colorScheme!==this.data.colorScheme){this.bladeColor=new THREE.Color(i.a.schemes[this.data.colorScheme][this.data.color]);this.bladeColor.red=this.bladeColor.r,this.bladeColor.green=this.bladeColor.g,this.bladeColor.blue=this.bladeColor.b}},tock:function(e,t){this.data.enabled&&(!this.mesh.visible&&e>this.enabledTime+250&&(this.mesh.visible=!0),this.mesh.material.uniforms.pulse.value*=.9,this.sampleBladePosition())},pulse:function(){this.mesh.material.uniforms.pulse.value=1},addLayer:function(e){const t=this.bladeColor,n=this.colors,r=this.segments,i=this.vertices;let a=2/r;this.layers>=this.maxLayers&&(this.layers=0);const o=this.layers*e;e=o+e;const s=this.layers*r*18,c=this.layers*r*24;for(let l=0;l<r;++l)i[s+18*l]=l*a-1,i[s+18*l+1]=o,i[s+18*l+2]=0,n[c+24*l]=t.red,n[c+24*l+1]=t.green,n[c+24*l+2]=t.blue,n[c+24*l+3]=t.alpha,i[s+18*l+3]=l*a-1,i[s+18*l+4]=e,i[s+18*l+5]=0,n[c+24*l+4]=t.red,n[c+24*l+5]=t.green,n[c+24*l+6]=t.blue,n[c+24*l+7]=t.alpha,i[s+18*l+6]=l*a-1+a,i[s+18*l+7]=e,i[s+18*l+8]=0,n[c+24*l+8]=t.red,n[c+24*l+9]=t.green,n[c+24*l+10]=t.blue,n[c+24*l+11]=t.alpha,i[s+18*l+9]=l*a-1+a,i[s+18*l+10]=o,i[s+18*l+11]=0,n[c+24*l+12]=t.red,n[c+24*l+13]=t.green,n[c+24*l+14]=t.blue,n[c+24*l+15]=t.alpha,i[s+18*l+12]=l*a-1,i[s+18*l+13]=o,i[s+18*l+14]=0,n[c+24*l+16]=t.red,n[c+24*l+17]=t.green,n[c+24*l+18]=t.blue,n[c+24*l+19]=t.alpha,i[s+18*l+15]=l*a-1+a,i[s+18*l+16]=e,i[s+18*l+17]=0,n[c+24*l+20]=t.red,n[c+24*l+21]=t.green,n[c+24*l+22]=t.blue,n[c+24*l+23]=t.alpha;this.layers++,this.geometry.attributes.position.needsUpdate=!0,this.geometry.attributes.vertexColor.needsUpdate=!0,this.geometry.attributes.uv.needsUpdate=!0},initGeometry:function(){const e=this.bladeColor,t=this.geometry.attributes.vertexColor.array,n=this.geometry.attributes.position.array,r=this.bladeTrajectory;let i,a,o;for(let s=1;s<r.length;s++){1===s&&(a=i),i=1-(r.length-s)/r.length;const c=r[s];o=r[s-1],n[36*s]=o.center.x,n[36*s+1]=o.center.y,n[36*s+2]=o.center.z,t[48*s]=e.red,t[48*s+1]=e.green,t[48*s+2]=e.blue,t[48*s+3]=.2*a,n[36*s+3]=c.top.x,n[36*s+4]=c.top.y,n[36*s+5]=c.top.z,t[48*s+4]=e.red,t[48*s+5]=e.green,t[48*s+6]=e.blue,t[48*s+7]=i,n[36*s+6]=o.top.x,n[36*s+7]=o.top.y,n[36*s+8]=o.top.z,t[48*s+8]=e.red,t[48*s+9]=e.green,t[48*s+10]=e.blue,t[48*s+11]=a,n[36*s+9]=o.center.x,n[36*s+10]=o.center.y,n[36*s+11]=o.center.z,t[48*s+12]=e.red,t[48*s+13]=e.green,t[48*s+14]=e.blue,t[48*s+15]=.2*a,n[36*s+12]=c.center.x,n[36*s+13]=c.center.y,n[36*s+14]=c.center.z,t[48*s+16]=e.red,t[48*s+17]=e.green,t[48*s+18]=e.blue,t[48*s+19]=.2*i,n[36*s+15]=c.top.x,n[36*s+16]=c.top.y,n[36*s+17]=c.top.z,t[48*s+20]=e.red,t[48*s+21]=e.green,t[48*s+22]=e.blue,t[48*s+23]=i,n[36*s+18]=o.bottom.x,n[36*s+19]=o.bottom.y,n[36*s+20]=o.bottom.z,t[48*s+24]=e.red,t[48*s+25]=e.green,t[48*s+26]=e.blue,t[48*s+27]=0,n[36*s+21]=c.center.x,n[36*s+22]=c.center.y,n[36*s+23]=c.center.z,t[48*s+28]=e.red,t[48*s+29]=e.green,t[48*s+30]=e.blue,t[48*s+31]=.2*i,n[36*s+24]=o.center.x,n[36*s+25]=o.center.y,n[36*s+26]=o.center.z,t[48*s+32]=e.red,t[48*s+33]=e.green,t[48*s+34]=e.blue,t[48*s+35]=.2*a,n[36*s+27]=o.bottom.x,n[36*s+28]=o.bottom.y,n[36*s+29]=o.bottom.z,t[48*s+36]=e.red,t[48*s+37]=e.green,t[48*s+38]=e.blue,t[48*s+39]=0,n[36*s+30]=c.bottom.x,n[36*s+31]=c.bottom.y,n[36*s+32]=c.bottom.z,t[48*s+40]=e.red,t[48*s+41]=e.green,t[48*s+42]=e.blue,t[48*s+43]=0,n[36*s+33]=c.center.x,n[36*s+34]=c.center.y,n[36*s+35]=c.center.z,t[48*s+44]=e.red,t[48*s+45]=e.green,t[48*s+46]=e.blue,t[48*s+47]=.2*i,a=i}this.geometry.attributes.position.needsUpdate=!0,this.geometry.attributes.vertexColor.needsUpdate=!0},sampleBladePosition:function(){let e;this.bladeTrajectory.length===this.maxPoints?(e=this.newSample=this.bladeTrajectory.shift(),e.top.set(0,-.5,0),e.center.set(0,0,0),e.bottom.set(0,.5,0)):this.newSample?(this.newSample.top.set(0,-.5,0),this.newSample.center.set(0,0,0),this.newSample.bottom.set(0,.5,0),e=this.newSample):e={top:new THREE.Vector3(0,-.5,0),center:new THREE.Vector3(0,0,0),bottom:new THREE.Vector3(0,.5,0)};const t=this.bladeEl.object3D;t.localToWorld(e.top),t.localToWorld(e.center),t.localToWorld(e.bottom),this.rigContainer.object3D.worldToLocal(e.top),this.rigContainer.object3D.worldToLocal(e.center),this.rigContainer.object3D.worldToLocal(e.bottom),this.bladeTrajectory.push(e),this.initGeometry()}}),window.AFRAME){const t=["trail"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("tunnels",{dependencies:["pool_tunnels"],schema:{isPlaying:{default:!1},songDuration:{default:0}},init:function(){this.addTunnel=this.addTunnel.bind(this),this.clearTunnels=this.clearTunnels.bind(this),this.curveEl=document.getElementById("curve"),this.curveFollowRig=document.getElementById("curveFollowRig"),this.timeout=0,this.tunnels=[],this.tick=AFRAME.utils.throttleTick(this.tick.bind(this),1e3),this.el.addEventListener("cleargame",this.clearTunnels),this.el.addEventListener("gamemenuexit",this.clearTunnels),this.el.addEventListener("gamemenurestart",this.clearTunnels)},update:function(e){!e.isPlaying&&this.data.isPlaying&&this.requestTunnel(),e.isPlaying&&!this.data.isPlaying&&this.timeout&&(clearTimeout(this.timeout),this.timeout=null)},play:function(){this.pool=this.el.components.pool__tunnels},requestTunnel:function(){this.timeout=setTimeout(this.addTunnel,Math.floor(3e3+1e4*Math.random()))},addTunnel:function(){const e=this.pool.requestEntity();if(!e)return;e.setAttribute("render-order","tunnel"),e.object3D.visible=!0;const t=this.curveEl.components.supercurve;let n=(this.el.components.song.getCurrentTime()+20)/this.data.songDuration;n>1&&(n=1),t.getPointAt(n,e.object3D.position),t.alignToCurve(n,e.object3D),e.play(),this.tunnels.push(e),this.requestTunnel()},clearTunnels:function(){this.timeout&&(clearTimeout(this.timeout),this.timeout=null);for(let e=0;e<this.tunnels.length;e++)this.tunnels[e].object3D.visible=!1,this.pool.returnEntity(this.tunnels[e]);this.tunnels.length=0},tick:function(e,t){if(0!=this.tunnels.length)for(let e=0;e<this.tunnels.length;e++){if(!(this.tunnels[e].object3D.position.z>this.curveFollowRig.object3D.position.z+5))return;{const t=this.tunnels.splice(e,1)[0];t.object3D.visible=!1,this.pool.returnEntity(t)}}}}),window.AFRAME){const t=["tunnels"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){var r=new THREE.Color;if(AFRAME.registerComponent("vertex-colors-buffer",{schema:{baseColor:{type:"color"},itemSize:{default:3}},update:function(e){var t,n,i,a,o=this.data,s=this.el,c=this;if((a=this.el.getObject3D("mesh"))&&a.geometry)if((i=a.geometry).attributes.position){for(i.attributes.color||i.setAttribute("color",new THREE.BufferAttribute(new Float32Array(i.attributes.position.array.length),3)),t=i.attributes.color.array,r.set(o.baseColor),n=0;n<t.length;n+=o.itemSize)t[n]=r.r,t[n+1]=r.g,t[n+2]=r.b;i.attributes.color.needsUpdate=!0}else console.warn("Geometry has no vertices",s);else s.addEventListener("object3dset",(function t(n){"mesh"===n.detail.type&&(s.removeEventListener("object3dset",t),c.update(e))}))}}),window.AFRAME){const t=["vertex-colors-buffer"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("victory-accuracy-ring",{dependencies:["geometry","material"],schema:{accuracy:{default:0}},update:function(){this.el.getObject3D("mesh").material.uniforms.progress.value=0,this.el.setAttribute("animation","to",this.data.accuracy/100),this.el.components.animation.beginAnimation()}}),window.AFRAME){const t=["victory-accuracy-ring"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){const r={sphericalEnvMap:"",roughness:.8,metalness:.4},i={sphericalEnvMap:"#envmapImg",roughness:.2,metalness:.6};if(AFRAME.registerComponent("victory-rank",{schema:{isVictory:{default:!1},rank:{type:"string"}},update:function(e){const t=this.el,n=this.data.rank;if(e.isVictory&&!this.data.isVictory&&this.el.object3D.scale.set(.001,.001,.001),n)switch(t.setAttribute("text-geometry","value",n),n[0]){case"S":t.setAttribute("material",Object.assign({color:"#F0e077"},i));break;case"A":t.setAttribute("material",Object.assign({color:"#6FF9EA"},i));break;case"B":t.setAttribute("material",Object.assign({color:"#F8d"},i));break;case"C":t.setAttribute("material",Object.assign({color:"#F971C3"},r));break;case"D":t.setAttribute("material",Object.assign({color:"#1E6269"},r));break;case"F":t.setAttribute("material",Object.assign({color:"#e3170a"},r))}}}),window.AFRAME){const t=["victory-rank"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("visible-raycastable",{schema:{default:!0},update:function(){this.el.object3D.visible=this.data,this.data?this.el.setAttribute("raycastable",""):this.el.removeAttribute("raycastable","")}}),window.AFRAME){const t=["visible-raycastable"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){const r=n(0);if(AFRAME.registerShader("wallShader",{schema:{colorTertiary:{type:"color",is:"uniform",default:r.initial.tertiary},environment:{type:"map",is:"uniform",default:"#envmapImg"},hitLeft:{type:"vec3",is:"uniform",default:{x:0,y:9e3,z:0}},hitRight:{type:"vec3",is:"uniform",default:{x:0,y:9e3,z:0}},iTime:{type:"time",is:"uniform"},opacity:{type:"number",is:"uniform"}},vertexShader:n(187),fragmentShader:n(188)}),window.AFRAME){const t=[],n=["wallShader"],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t){e.exports="varying vec2 uvs;\nvarying vec3 nrml;\nvarying vec3 worldPos;\n\nvoid main() {\n uvs.xy = uv.xy;\n nrml.xyz = normal.xyz;\n vec4 p = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n worldPos = (modelMatrix * vec4( position, 1.0 )).xyz;\n gl_Position = p;\n}\n"},function(e,t){e.exports="uniform float iTime;\nuniform float opacity;\nuniform sampler2D environment;\nuniform vec3 colorTertiary;\nuniform vec3 hitLeft;\nuniform vec3 hitRight;\nvarying vec2 uvs;\nvarying vec3 nrml;\nvarying vec3 worldPos;\n\n#define SEED 19.1252\n#define time (3.0 + iTime) / 1000.0\n\nfloat noise(vec3 uv) {\n return fract(sin(uv.x*123243. + uv.y*424. + uv.z*642. + SEED) * 1524.);\n}\n\nvec4 drawHit(vec3 p, vec3 center, vec3 color) {\n center.z -= 0.1;\n float dist = 1.0 - smoothstep(0.0, 0.3, length(p - center));\n float glitch = noise(floor(p*3.0)) * 0.06 - 0.03;\n float alpha = 1.0 - smoothstep(0.0, 0.01, abs(p.z-center.z + glitch));\n alpha += 1.0 - smoothstep(0.0, 0.01, abs(p.y-center.y + glitch));\n return vec4(color * dist, alpha * dist + alpha);\n}\n\nvoid main() {\n vec2 uv1 = uvs.xy-0.5;\n float alpha = 0.0;\n // border\n alpha += smoothstep(0.44, 0.50, abs(uv1.x));\n alpha += smoothstep(0.44, 0.50, abs(uv1.y));\n alpha += smoothstep(0.486, 0.49, abs(uv1.x));\n alpha += smoothstep(0.486, 0.49, abs(uv1.y));\n alpha = min(1.0, alpha * 0.5);\n\n // weapon collision\n vec4 hit;\n hit = drawHit(worldPos, hitRight, colorTertiary);\n hit += drawHit(worldPos, hitLeft, colorTertiary);\n\n // reflection\n vec3 ray = reflect(normalize(cameraPosition - worldPos + sin(worldPos.z) * 0.1 + cos(worldPos.z * 0.3) * 0.3), nrml);\n float m = 2.0 * sqrt(pow(ray.x, 2.0) + pow(ray.y, 2.0) + pow(ray.z, 2.0));\n vec2 uv = ray.xy / m + 0.5;\n vec3 col = texture2D(environment, uv).rgb * 0.3;\n\n gl_FragColor = vec4(mix(col, colorTertiary, alpha) + hit.rgb, (alpha * 0.2 + 0.8) * opacity + hit.a);\n}\n"},function(e,t,n){"use strict";n.r(t);n(21);if(AFRAME.registerComponent("wall",{dependencies:["material"],init:function(){this.curveEl=document.getElementById("curve"),this.curveFollowRig=document.getElementById("curveFollowRig"),this.el.setObject3D("mesh",new THREE.Mesh),this.geometry=null,this.isCeiling=!1,this.isRaycastable=!1,this.localPosition=new THREE.Vector3,this.songPosition=void 0,this.tick=AFRAME.utils.throttleTick(this.tick.bind(this),1e3)},play:function(){this.el.object3D.visible=!0},tick:function(e,t){const n=this.curveFollowRig.components["supercurve-follow"].songProgress;!this.isRaycastable&&n+.01>=this.songPosition&&(this.isRaycastable=!0,this.el.setAttribute("data-wall-active",""),this.isCeiling||(this.el.setAttribute("data-weapon-particles",""),this.el.setAttribute("raycastable-game",""))),n>=this.backPosition+.01&&this.returnToPool()},onGenerate:function(e,t,n,r,i,a){const o=this.el;this.isCeiling=i,this.backPosition=a,this.songPosition=e,this.setWallGeometry(e,t,n,r,i),o.getObject3D("mesh").material.uniforms.opacity.value=0,o.object3D.position.y=-5,o.components.animation__fadein.beginAnimation(),o.components.animation__scalein.beginAnimation()},setWallGeometry:function(){const e=new THREE.Vector3,t=new THREE.Vector3,n=new THREE.Vector3;return function(r,i,a,o,s){const c=this.el.sceneEl.components["beat-system"],l=this.curveEl.components.supercurve,u=r,h=r+o/l.length,d=s?1.5:2.5,p=-1*c.horizontalPositions[i]-a/2+.25;t.x=p-a/2,n.x=p+a/2;const f=(this.geometry=new THREE.BoxBufferGeometry(a,d,1,1,1,30)).attributes.position.array;for(let r=0;r<f.length;r+=3){const i=f[r+2]+.5;l.getPositionRelativeToTangent(u+i*(h-u),f[r]<0?t:n,e),f[r]=e.x,f[r+1]+=e.y+d/2,f[r+2]=e.z}let m=c.verticalPositions.middle+c.size/2;"punch"===c.data.gameMode&&(m-=.1),this.el.getObject3D("mesh").geometry=this.geometry,this.el.getObject3D("mesh").position.y=s?m:.1}}(),returnToPool:function(){this.el.object3D.visible=!1,this.el.removeAttribute("data-weapon-particles"),this.el.removeAttribute("data-wall-active"),this.el.removeAttribute("raycastable-game"),this.isCeiling=!1,this.isRaycastable=!1,this.el.isPlaying&&this.el.sceneEl.components.pool__wall.returnEntity(this.el),this.geometry&&this.geometry.dispose()}}),window.AFRAME){const t=["wall"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){const r={direction:{x:0,y:-.25,z:-1}},i={direction:{x:0,y:1,z:-1}};if(AFRAME.registerComponent("weapon-particles",{schema:{enabled:{default:!1},gameMode:{default:""},hand:{type:"string"}},init:function(){this.hiddenIntersection={x:999,y:0,z:0},this.intersectedEl=null,this.weaponEnter=this.weaponEnter.bind(this),this.weaponLeave=this.weaponLeave.bind(this)},update:function(e){e.gameMode!==this.data.gameMode&&this.el.setAttribute("raycaster__game","punch"===this.data.gameMode?r:i)},pause:function(){this.el.removeEventListener("mouseenter",this.weaponEnter),this.el.removeEventListener("mouseleave",this.weaponLeave)},play:function(){this.el.addEventListener("mouseenter",this.weaponEnter),this.el.addEventListener("mouseleave",this.weaponLeave)},weaponEnter:function(e){this.data.enabled&&e.target===this.el&&e.detail.intersectedEl.hasAttribute("data-weapon-particles")&&(this.intersectedEl=e.detail.intersectedEl)},weaponLeave:function(e){if(e.detail.target===this.el){if(this.intersectedEl.components.wall||"floor"===this.intersectedEl.id){const e=this.data.hand===RIGHT?"hitRight":"hitLeft";this.intersectedEl.getObject3D("mesh").material.uniforms[e].value=this.hiddenIntersection}this.intersectedEl=null}},tick:function(e,t){if(!this.data.enabled||!this.intersectedEl)return;const n=this.el.components.raycaster__game.getIntersection(this.intersectedEl);if(n&&(this.intersectedEl.components.wall||"floor"===this.intersectedEl.id)){const e="right"===this.data.hand?"hitRight":"hitLeft";this.intersectedEl.getObject3D("mesh").material.uniforms[e].value=n.point}}}),window.AFRAME){const t=["weapon-particles"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){AFRAME.registerComponent("zip-loader",{schema:{difficulties:{type:"array"},isLoading:{default:"false"},version:{type:"string"},directDownload:{type:"string"},bpm:{type:"number"}},init:function(){this.loadingIndicator=document.getElementById("zipLoaderIndicator"),this.cachedZip=null,this.cachedVersion=null,this.message={},this.worker=new Worker("build/zip.js"),this.worker.onmessage=this.onMessage.bind(this),this.worker.onerror=console.error},update:function(e){const t=this.data;e.version&&e.version!==t.version&&this.cachedVersion!==t.version&&(this.message.abort=!0,this.message.difficulties=JSON.stringify(this.data.difficulties),this.message.version=e.version,this.message.directDownload=this.data.directDownload,this.message.bpm=this.data.bpm,this.message.hash=this.data.hash,this.worker.postMessage(this.message)),t.version&&e.version!==t.version&&(this.cachedVersion=null,this.cachedZip=null,this.fetchZip(t.version)),e.isLoading||!this.data.isLoading||this.cachedVersion!==this.data.version||this.cachedZip||this.el.emit("songloaderror")},fetchZip:function(e){this.el.emit("ziploaderstart",null,!1),this.message.abort=!1,this.message.difficulties=JSON.stringify(this.data.difficulties),this.message.version=e,this.message.directDownload=this.data.directDownload,this.message.bpm=this.data.bpm,this.message.hash=this.data.hash,this.worker.postMessage(this.message)},onMessage:function(e){switch(e.data.message){case"error":this.el.emit("songloaderror");break;case"progress":if(e.data.version!==this.data.version)return;this.loadingIndicator.setAttribute("material","progress",e.data.progress);break;case"load":{let t;this.cachedVersion=e.data.version,this.cachedZip=e.data.data;const n=e.data.data.beats;for(t in n)break;if(!t)return this.cachedZip=null,void(e.data.version===this.data.version&&this.el.emit("songloaderror"));e.data.version===this.data.version&&this.el.emit("ziploaderend",e.data.data,!1);break}}}});if(window.AFRAME){const t=["zip-loader"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){var r={"./index.js":193};function i(e){var t=a(e);return n(t)}function a(e){if(!n.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}i.keys=function(){return Object.keys(r)},i.resolve=a,e.exports=i,i.id=192},function(e,t,n){"use strict";n.r(t);var r=n(0),a=n.n(r);n(6);const o=n(28),s={};let c=!1;const l={Easy:"Easy",Expert:"Expert",ExpertPlus:"Expert+",Hard:"Hard",Normal:"Normal"},u={},h={author:"Juancho Pancho",difficulty:"Expert",id:"31",image:"assets/img/molerat.jpg",songDuration:100,songName:"Friday",songLength:100,songSubName:"Rebecca Black"},d="true"===AFRAME.utils.getUrlParameter("skipintro"),p=localStorage.getItem("colorScheme")||"blue";let f=localStorage.getItem("favorites-v2");if(f)try{f=JSON.parse(f)}catch(e){f=[]}else f=[];function m(e){let t=Math.ceil(e.search.results.length/6);e.search.hasPrev=e.search.page>0,e.search.hasNext=e.search.page<t-1,e.search.songNameTexts="",e.search.songSubNameTexts="",e.searchResultsPage.length=0,e.searchResultsPage.__dirty=!0;for(let t=6*e.search.page;t<6*e.search.page+6;t++){const n=e.search.results[t];if(!n)break;e.searchResultsPage.push(n),e.search.songNameTexts+=g(n.metadata.songName,22).toUpperCase()+"\n",e.search.songSubNameTexts+=g(n.metadata.songSubName||n.metadata.songAuthorName||"Unknown Artist",32)+"\n"}for(let t=0;t<e.searchResultsPage.length;t++)e.searchResultsPage[t].index=t;E(e)}function g(e,t){return e?e.length>=t?e.substring(0,t-3)+"...":e:""}AFRAME.registerState({nonBindedStateKeys:["genres"],initialState:{activeHand:localStorage.getItem("hand")||"right",challenge:{audio:"",author:"",difficulty:"",beatmapCharacteristic:"",id:AFRAME.utils.getUrlParameter("challenge"),image:"",isBeatsPreloaded:!1,numBeats:void 0,songDuration:0,songName:"",songNameShort:"",songSubName:"",metadata:{}},colorPrimary:a.a.schemes[p].primary,colorScheme:p,colorSecondary:a.a.schemes[p].secondary,colorSecondaryBright:a.a.schemes[p].secondarybright,colorTertiary:a.a.schemes[p].tertiary,controllerType:"",damage:0,difficultyFilter:"All",difficultyFilterMenuOpen:!1,favorites:f,gameMode:"ride",genre:"",genres:n(194),genreMenuOpen:!1,has3DOFVR:!1,has6DOFVR:!1,hasSongLoadError:!1,hasVR:AFRAME.utils.device.checkHeadsetConnected()||"true"===AFRAME.utils.getUrlParameter("debugvr"),introActive:!d,inVR:"true"===AFRAME.utils.getUrlParameter("debugvr"),isIOS:AFRAME.utils.device.isIOS(),isGameOver:!1,isLoading:!1,isMenuOpening:!d,isPaused:!1,isPlaying:!1,isSearching:!1,isSongProcessing:!1,isVictory:!1,isZipFetching:!1,leaderboard:[],leaderboardFetched:!1,leaderboardQualified:!1,leaderboardNames:"",leaderboardScores:"",mainMenuActive:!1,menuActive:d,menuDifficulties:[],menuDifficultiesIds:[],menuSelectedChallenge:{author:"",difficulty:"",beatmapCharacteristic:"",downloads:"",downloadsText:"",genre:"",id:"",index:-1,image:"",isFavorited:!1,numBeats:void 0,songDuration:0,songInfoText:"",songLength:void 0,numBeats:void 0,songName:"",songSubName:"",version:"",metadata:{}},optionsMenuOpen:!1,playlist:"",playlists:n(195),playlistMenuOpen:!1,playlistTitle:"",score:{accuracy:100,accuracyScore:0,accuracyInt:100,activePanel:!1,beatsHit:0,beatsMissed:0,beatsText:"",combo:0,finalAccuracy:100,maxCombo:0,rank:"",score:0},search:{activePanel:!0,page:0,hasError:!1,hasNext:!1,hasPrev:!1,query:"",queryText:"",results:[],songNameTexts:"",songSubNameTexts:"",url:"",urlPage:0},searchResultsPage:[],speed:10},handlers:{activehandswap:e=>{e.activeHand="right"===e.activeHand?"left":"right",localStorage.setItem("activeHand",e.activeHand)},beathit:(e,t)=>{e.damage>.25&&(e.damage-=.25),e.score.beatsHit++,e.score.combo++,e.score.combo>e.score.maxCombo&&(e.score.maxCombo=e.score.combo),t.score=isNaN(t.score)?100:t.score,e.score.accuracyScore+=t.percent,e.score.score+=Math.floor(t.score),M(e)},beatmiss:e=>{e.score.beatsMissed++,w(e),M(e)},beatwrong:e=>{e.score.beatsMissed++,w(e),M(e)},beatloaderpreloadfinish:e=>{e.menuActive||(e.challenge.isBeatsPreloaded=!0)},colorschemechange:(e,t)=>{e.colorScheme=t,e.colorPrimary=a.a.schemes[t].primary,e.colorSecondary=a.a.schemes[t].secondary,e.colorSecondaryBright=a.a.schemes[t].secondarybright,e.colorTertiary=a.a.schemes[t].tertiary,localStorage.setItem("colorScheme",t)},controllerconnected:(e,t)=>{e.controllerType=t.name,e.has6DOFVR=-1!==["oculus-quest-controls","oculus-touch-controls","vive-controls","windows-motion-controls","generic-tracked-controller-controls"].indexOf(e.controllerType),e.has3DOFVR=-1!==["oculus-go-controls","daydream-controls"].indexOf(e.controllerType)},debugbeatpositioning:e=>{e.gameMode="classic",e.introActive=!1,e.menuActive=!1},debuggameplay:e=>{A(e),Object.assign(e.challenge,e.menuSelectedChallenge),e.menuActive=!1,e.menuSelectedChallenge.id="",e.isSearching=!1,e.isLoading=!1},debuggameover:e=>{e.isGameOver=!0,e.menuActive=!1},debugloading:e=>{h.id="-1",Object.assign(e.menuSelectedChallenge,h),Object.assign(e.challenge,h),e.menuActive=!1,e.isSongProcessing=!0},debugvictory:e=>{Object.assign(e.menuSelectedChallenge,h),Object.assign(e.challenge,h),e.isVictory=!0,e.leaderboardQualified=!0,e.menuActive=!1,e.score.accuracy=74.99,e.score.beatsHit=125,e.score.beatsMissed=125,e.score.maxCombo=123,e.score.rank="A",e.score.score=9001,e.introActive=!1,x(e)},difficultyfilter:(e,t)=>{e.difficultyFilter=t,e.difficultyFilterMenuOpen=!1,e.menuSelectedChallenge.id=""},difficultyfiltermenuclose:e=>{e.difficultyFilterMenuOpen=!1},difficultyfiltermenuopen:e=>{e.difficultyFilterMenuOpen=!0},displayconnected:e=>{if(e.hasVR=!0,!c)try{"getVRDisplays"in navigator&&navigator.getVRDisplays().then(e=>{e.length&&(c=!0)})}catch(e){}},favoritetoggle:e=>{const t=e.menuSelectedChallenge.id,n=s[t];if(n)if(e.menuSelectedChallenge.isFavorited){e.menuSelectedChallenge.isFavorited=!1;for(let n=0;n<e.favorites.length;n++)if(e.favorites[n].id===t)return e.favorites.splice(n,1),void localStorage.setItem("favorites-v2",JSON.stringify(e.favorites))}else{if(e.menuSelectedChallenge.isFavorited=!0,e.favorites.filter(e=>e.id===t).length)return;e.favorites.push(n),localStorage.setItem("favorites-v2",JSON.stringify(e.favorites))}},gamemenuresume:e=>{e.isPaused=!1},gamemenurestart:e=>{A(e),e.challenge.isBeatsPreloaded=!1,e.isGameOver=!1,e.isPaused=!1,e.isLoading=!0,e.isVictory=!1,e.leaderboardQualified=!1},gamemenuexit:e=>{A(e),e.challenge.isBeatsPreloaded=!1,e.isGameOver=!1,e.isPaused=!1,e.isVictory=!1,e.menuActive=!0,e.menuSelectedChallenge.id=e.challenge.id,e.menuSelectedChallenge.difficulty=e.challenge.difficulty,e.menuSelectedChallenge.beatmapCharacteristic=e.challenge.beatmapCharacteristic,e.menuSelectedChallenge.difficultyId=e.challenge.difficultyId,e.challenge.id="",e.leaderboardQualified=!1},gamemode:(e,t)=>{e.gameMode=t},genreclear:e=>{e.genre="",e.menuSelectedChallenge.id=""},genreselect:(e,t)=>{e.genre=t,e.genreMenuOpen=!1,e.menuSelectedChallenge.id="",e.playlist="",e.search.query=""},genremenuclose:e=>{e.genreMenuOpen=!1},genremenuopen:e=>{e.genreMenuOpen=!0},keyboardclose:e=>{e.isSearching=!1},keyboardopen:e=>{e.isSearching=!0,e.menuSelectedChallenge.id=""},leaderboard:(e,t)=>{e.leaderboard.length=0,e.leaderboardFetched=!0,e.leaderboardNames="",e.leaderboardScores="";for(let n=0;n<t.scores.length;n++){let r=t.scores[n];e.leaderboard.push(r),e.leaderboardNames+=`#${n+1} ${g(r.username,18)} (${Math.round(r.accuracy||0)}%)\n`,e.leaderboardScores+=r.score+"\n"}e.leaderboardLoading=!1},leaderboardqualify:e=>{e.has6DOFVR&&(e.leaderboardQualified=!0)},leaderboardscoreadded:(e,t)=>{for(let n=0;n<e.leaderboard.length;n++)if(t.scoreData.score>=e.leaderboard[n].score||n>=e.leaderboard.length-1){e.leaderboard.splice(n,0,t.scoreData);break}e.leaderboardNames="",e.leaderboardScores="";for(let t=0;t<e.leaderboard.length;t++){let n=e.leaderboard[t];e.leaderboardNames+=`${n.username} (${n.accuracy||0}%)\n`,e.leaderboardScores+=n.score+"\n"}},leaderboardsubmit:e=>{e.leaderboardQualified=!1},menuback:e=>{e.difficultyFilterMenuOpen=!1,e.genreMenuOpen=!1,e.isSearching=!1,e.optionsMenuOpen=!1,e.playlistMenuOpen=!1},menuchallengeselect:(e,t)=>{let n=s[t];if(!n)return;Object.assign(e.menuSelectedChallenge,n),e.menuSelectedChallenge.songName=g(n.metadata.songName,24),e.menuDifficulties.length=0,e.menuDifficultiesIds.length=0;const r=JSON.parse(n.metadata.characteristics);for(const t of Object.keys(r))if(!["90Degree","360Degree"].includes(t))for(const n of Object.keys(r[t])){if(null===r[t][n])continue;let i=l[n],a=i;"Standard"!==t&&(a=t+"\n"+a),e.menuDifficulties.unshift({id:t+"-"+n,filename:n+t,difficultyName:i,renderName:a,beatmapCharacteristic:t,difficulty:n})}e.menuDifficulties.sort(b);for(const t of e.menuDifficulties)e.menuDifficultiesIds.push(t.id);const i=e.menuDifficulties[0];e.menuSelectedChallenge.difficulty=i.difficulty,e.menuSelectedChallenge.beatmapCharacteristic=i.beatmapCharacteristic,e.menuSelectedChallenge.difficultyId=i.id,e.menuSelectedChallenge.image=e.menuSelectedChallenge.coverURL,S(e,n),e.challenge.audio="",E(e),e.isSearching=!1;const a=!!e.favorites.filter(e=>e.id===t).length;e.menuSelectedChallenge.isFavorited=a,_(e),e.leaderboardLoading=!0,e.hasSongLoadError=!1,u[t]&&(e.hasSongLoadError=!0)},menuchallengeunselect:e=>{e.menuSelectedChallenge.id="",e.menuSelectedChallenge.difficultyId="",e.menuSelectedChallenge.difficulty="",e.menuSelectedChallenge.beatmapCharacteristic="",_(e)},menudifficultyselect:(e,t)=>{let n;for(const r of e.menuDifficulties)if(r.id===t){n=r;break}e.menuSelectedChallenge.difficultyId=t,e.menuSelectedChallenge.difficulty=n.difficulty,e.menuSelectedChallenge.beatmapCharacteristic=n.beatmapCharacteristic,S(e,e.menuSelectedChallenge),_(e),e.leaderboardLoading=!0},menuopeningend:e=>{e.isMenuOpening=!1},minehit:e=>{w(e)},optionsmenuopen:e=>{e.optionsMenuOpen=!0},pausegame:e=>{e.isPlaying&&(e.isPaused=!0)},playbuttonclick:e=>{if(""===e.menuSelectedChallenge.id)return;if(u[e.menuSelectedChallenge.id])return;let t="frontpage";e.playlist&&(t="playlist"),e.search.query&&(t="search"),e.genre&&(t="genre"),gtag("event","songsource",{event_label:t}),A(e),Object.assign(e.challenge,e.menuSelectedChallenge),gtag("event","difficulty",{event_label:e.challenge.difficulty}),e.menuActive=!1,e.menuSelectedChallenge.id="",e.menuSelectedChallenge.difficulty="",e.menuSelectedChallenge.beatmapCharacteristic="",e.isSearching=!1,e.isLoading=!0,e.loadingText="Loading...",gtag("event","colorscheme",{event_label:e.colorScheme})},playlistclear:(e,t)=>{e.menuSelectedChallenge.id="",e.playlist=""},playlistselect:(e,t)=>{e.genre="",e.menuSelectedChallenge.id="",e.playlist=t.id,e.playlistTitle=t.title,e.playlistMenuOpen=!1,e.search.query=""},playlistmenuclose:e=>{e.playlistMenuOpen=!1},playlistmenuopen:e=>{e.playlistMenuOpen=!0},searcherror:(e,t)=>{e.search.hasError=!0},searchprevpage:e=>{0!==e.search.page&&(e.search.page--,m(e))},searchnextpage:e=>{e.search.page>Math.floor(e.search.results.length/6)||(e.search.page++,m(e),void 0!==e.search.url&&e.search.page+3>Math.floor(e.search.results.length/6)&&(e.search.urlPage=e.search.urlPage+1,fetch(e.search.url.replaceAll("CURRENT_PAGE_INDEX",e.search.urlPage)).then(e=>e.json()).then(t=>{var n=(t.docs||t.maps).map(o);for(e.search.results.push(...n),i=0;i<n.length;i++){let e=n[i];s[e.id]=e}})))},searchresults:(e,t)=>{var n;for(e.search.hasError=!1,e.search.page=0,e.search.url=t.url,e.search.urlPage=t.urlPage,e.search.query=t.query,e.search.queryText=g(t.query,10),e.search.results=t.results||[],n=0;n<e.search.results.length;n++){let t=e.search.results[n];s[t.id]=t}m(e),e.menuSelectedChallenge.id="",e.isSearching&&(e.genre="",e.playlist="")},songcomplete:e=>{if(gtag("event","songcomplete",{event_label:e.gameMode}),"ride"===e.gameMode||!e.inVR)return e.challenge.isBeatsPreloaded=!1,e.isVictory=!1,e.menuActive=!0,void(e.challenge.id="");e.isVictory=!0,e.score.score=isNaN(e.score.score)?0:e.score.score,M(e),e.score.finalAccuracy=e.score.accuracy;const t=parseFloat(e.score.accuracy);e.score.rank=t>=97?"S":t>=90?"A":t>=80?"B":t>=70?"C":t>=60?"D":"F",x(e)},songloadcancel:e=>{e.challenge.isBeatsPreloaded=!1,e.challenge.audio="",e.challenge.id="",e.challenge.version="",e.isZipFetching=!1,e.isLoading=!1,e.isSongProcessing=!1,e.menuActive=!0},songloaderror:e=>{u[e.menuSelectedChallenge.id||e.challenge.id]=!0,e.hasSongLoadError=!0,e.loadingText="Sorry! There was an error loading this song.\nPlease select another song.",e.challenge.id="",e.challenge.isBeatsPreloaded=!1,e.isSongProcessing=!1,e.isZipFetching=!1},songprocessfinish:e=>{e.isSongProcessing=!1,e.isLoading=!1},songprocessstart:e=>{e.isSongProcessing=!0,e.loadingText="Wrapping up..."},"enter-vr":e=>{e.inVR=AFRAME.utils.device.checkHeadsetConnected(),AFRAME.utils.device.isMobile()||(gtag("event","entervr",{}),AFRAME.utils.device.isOculusBrowser()&&gtag("event","oculusbrowser",{}))},"exit-vr":e=>{e.inVR=!1,e.isPlaying&&(e.isPaused=!0)},startgame:e=>{e.introActive=!1,e.menuActive=!0},victoryfake:e=>{e.score.accuracy="74.99",e.score.rank="C"},wallhitstart:e=>{w(e)},ziploaderend:(e,t)=>{e.challenge.audio=t.audio,e.hasSongLoadError=!1,e.menuSelectedChallenge.version="",e.isZipFetching=!1},ziploaderstart:e=>{e.challenge.isBeatsPreloaded=!1,e.isZipFetching=!0}},computeState:e=>{e.isPlaying=!(e.menuActive||e.isLoading||e.isPaused||e.isVictory||e.isGameOver||e.isZipFetching||e.isSongProcessing||!e.challenge.id||e.introActive);const t=e.menuActive||e.isPaused||e.isVictory||e.isGameOver||e.isLoading||e.introActive;e.leftRaycasterActive=t&&"left"===e.activeHand&&e.inVR,e.rightRaycasterActive=t&&"right"===e.activeHand&&e.inVR,e.mainMenuActive=e.menuActive&&!e.genreMenuOpen&&!e.difficultyFilterMenuOpen&&!e.playlistMenuOpen&&!e.optionsMenuOpen&&!e.isSearching,e.score.active="ride"!==e.gameMode&&e.inVR&&(e.isPlaying||e.isPaused)}});const y=["easy","normal","hard","expert","expertPlus"],v=["Standard"];function b(e,t){const n=y.indexOf(e.difficulty),r=y.indexOf(t.difficulty);if(n<r)return-1;if(n>r)return 1;const i=v.indexOf(e.beatmapCharacteristic),a=v.indexOf(t.beatmapCharacteristic);return i>a?-1:i<a?1:0}function w(e){e.isPlaying&&e.inVR&&(e.score.combo=0)}function A(e){e.damage=0,e.score.accuracy=100,e.score.accuracyInt=100,e.score.accuracyScore=0,e.score.beatsHit=0,e.score.beatsMissed=0,e.score.finalAccuracy=100,e.score.combo=0,e.score.maxCombo=0,e.score.score=0}function E(e){e.menuSelectedChallenge.index=-1;for(let t=0;t<e.searchResultsPage.length;t++)if(e.searchResultsPage[t].id===e.menuSelectedChallenge.id){e.menuSelectedChallenge.index=t;break}}function x(e){e.score.beatsText=`${e.score.beatsHit} / ${e.score.beatsMissed+e.score.beatsHit} BEATS`}function _(e){e.leaderboard.length=0,e.leaderboard.__dirty=!0,e.leaderboardNames="",e.leaderboardScores="",e.leaderboardFetched=!1}function S(e,t){let n=JSON.parse(t.metadata.characteristics)[e.menuSelectedChallenge.beatmapCharacteristic][e.menuSelectedChallenge.difficulty];e.menuSelectedChallenge.songInfoText=`Mapped by ${g(t.metadata.levelAuthorName,55)}\n${t.genre&&"Uncategorized"!==t.genre?t.genre+"\n":""}${function(e){e/=60;const t=""+Math.floor(e);var n=Math.round(60*(e-t));return n<10&&(n="0"+n),`${t}:${n}`}(t.metadata.duration)} / ${n.notes} notes\n${n.bombs} bombs | ${n.obstacles} obstacles\nNJS: ${n.njs}`}function M(e){const t=e.score.beatsHit+e.score.beatsMissed;e.score.accuracy=e.score.accuracyScore/(100*t)*100,e.score.accuracy=isNaN(e.score.accuracy)?100:e.score.accuracy,e.score.accuracy=e.score.accuracy.toFixed(2),e.score.accuracyInt=parseInt(e.score.accuracy)}},function(e,t){e.exports=[{name:"Pop",row:1,column:1},{name:"R&B",row:1,column:2},{name:"Rap",row:1,column:3},{name:"Rock",row:1,column:4},{name:"Soundtrack",row:1,column:5},{name:"Video Games",row:1,column:6},{name:"Electronic",row:2,column:1},{name:"Hip Hop",row:2,column:2},{name:"House",row:2,column:3},{name:"J-Pop",row:2,column:4},{name:"K-Pop",row:2,column:5},{name:"Meme",row:2,column:6},{name:"Alternative",row:3,column:1},{name:"Anime",row:3,column:2},{name:"Comedy",row:3,column:3},{name:"Dubstep",row:3,column:5},{name:"Dance",row:3,column:6}]},function(e,t){e.exports=[{name:"favorites",author:"You!",title:"Your Saved Favorites"},{name:"3966",author:"BeastSaber",title:"Songs With Fantastic Flow Vol. 1"},{name:"3967",author:"BeastSaber",title:"Songs With Fantastic Flow Vol. 2"},{name:"3968",author:"BeastSaber",title:"Songs With Fantastic Flow Vol. 3"},{name:"4134",author:"BeastSaber",title:"Songs With Fantastic Flow Vol. 4"},{name:"4135",author:"BeastSaber",title:"Songs With Fantastic Flow Vol. 5"},{name:"7483",author:"BeastSaber",title:"Maps Of The Weeks"},{name:"4137",author:"BeastSaber",title:"Curator's Picks of 2020"},{name:"4139",author:"BeastSaber",title:"Curator's Picks of 2021"},{name:"11584",author:"BeastSaber",title:"Curator's Picks of 2022"},{name:"4405",author:"BeastSaber",title:"Intro to Dance"},{name:"4138",author:"BeastSaber",title:"Mom's Maps"}]},function(e,t,n){var r=n(18);"string"==typeof r&&(r=[[e.i,r,""]]);var i={hmr:!0,transform:void 0,insertInto:void 0},a=n(201)(r,i);r.locals&&(e.exports=r.locals),e.hot.accept(18,(function(){var t=n(18);if("string"==typeof t&&(t=[[e.i,t,""]]),!function(e,t){var n,r=0;for(n in e){if(!t||e[n]!==t[n])return!1;r++}for(n in t)r--;return 0===r}(r.locals,t.locals))throw new Error("Aborting CSS HMR due to changed css-modules locals.");a(t)})),e.hot.dispose((function(){a()}))},function(e,t){e.exports=function(e){return"string"!=typeof e?e:(/^['"].*['"]$/.test(e)&&(e=e.slice(1,-1)),/["'() \t\n]/.test(e)?'"'+e.replace(/"/g,'\\"').replace(/\n/g,"\\n")+'"':e)}},function(e,t){e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=function(e,t){var n=e[1]||"",r=e[3];if(!r)return n;if(t&&"function"==typeof btoa){var i=(o=r,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */"),a=r.sources.map((function(e){return"/*# sourceURL="+r.sourceRoot+e+" */"}));return[n].concat(a).concat([i]).join("\n")}var o;return[n].join("\n")}(t,e);return t[2]?"@media "+t[2]+"{"+n+"}":n})).join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var r={},i=0;i<this.length;i++){var a=this[i][0];"number"==typeof a&&(r[a]=!0)}for(i=0;i<e.length;i++){var o=e[i];"number"==typeof o[0]&&r[o[0]]||(n&&!o[2]?o[2]=n:n&&(o[2]="("+o[2]+") and ("+n+")"),t.push(o))}},t}},function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAU0AAAGDCAMAAACYzLIyAAACWFBMVEUAAAAAkP8AkP8AkP8AkP8AkP8AkP8AkP8AkP8AkP8AkP8BkP8AkP8AkP8AkP8AkP8Bkf8AkP8AkP8Dkf8BkP8BkP8Bkf8Vj/y44P8Rl///drb/drZx/+n/drZx/+n/drb/drZx/+n/drf/drZw/+pu/upx/+n/drdx/+lWtv//drb/drbL6f9w/+r+drdx/+n/drZw/+pu/utx/+ll9exMsv9x/+lx/+lw/+r/drb/drb/drb8drf+drdx/+nh8v9q+uzR7P9w/+phu//e8f8wpf9s++qJzP8Ek/9w/urZ7v9v/url9P9x/+n9drf/drb9drdDrv9x/+l2w/9uwf9u/eps++px/+mt3P//drY7qv//drZ7xv/2d7ml2P9x/+knov9x/+m+4//W7f+03/9I1/H8drf/drYru/iZ0/+AyP/B5P//drZx/+kXp/tpvv/t9/86yvX/draU0P8gnv/+drbp9v//drZ+g9xx/+mSgdZK2fHF5v9x/+nWe8Py+f8Xp/uQz///drYbnP/3/P+f1f9x/+kVpfsxwPZO3vD/drbfecArjPMwi/IktPncesBx/+lV5e9Wh+dx/+khjfY9iu5+g9ucgNMajvhx/+mDyf8Kmv6+fcmOgte4fcr/dra5fcpGiexOiOkpjPSwfs1J2PEVpfuIgtkpufcouPj/drb/drbteLzSe8MPoPyof89KiesPoPzreLxghuQ8y/Rx/+n/drZx/+kktPnGfMc9zfNLierleb64fctd7O3oeL1x/+n/drZb6vj/////drZx/+lv/exr+vEkKZq9AAAAw3RSTlMAeUKEWG9nmlCMKho2YJMVCkolDyEwOgbfoXqEZ5R3Zm6EN0xPI4xUk7iNROZEH1qcLjacCbRgbT8qYFoVP3zxFepKvO+rD8ygVu0p83EPdTCxOsPCHRng2uCuJcUK1+2poeHt3Q8Zox7Rx+LvmEC+9xazz6cG9cVD8g8i5Lkm+SvN6qX806lINy+sQGRXLzfASDW0XEwhFWf4yFIvLBrmIVRDQjYpYjYlUdjPbF5YThhsU0xJx7rOW1RBKUlCPGTZ+uxEzOy6AABDfElEQVR42uycz05iSRTGZ2zaK9oiyP9HuAlb1oQAoUPYEFkQQowBN8pCEw0rE2NsX6Jfhxeb+nu/W/dUUVywp3smfGaSnhm7+9SvvnOq6lThXwcddNBBBx100EEHHXTQ/1dVKfYL8XXQrhzzxQuiIlNeijP+jxGuCnPkDUUDqv6ykeQ5ybOzUulSqyR1FgmAdSx/INiqAKix6YjPrJJD+fQQFMnL09NyufxNqqx0GiliDLgg+1vQgmAE0MRXUu44NYQB8bF8LtFqUZP8VqkcWVThijOO2CbJ/mto4UAABD/g4+bQqiQkhsMHAqKfgPKCoWQkBcjCSUKFk4JUgm/E9jSG1qwIn12cYEAHQM0P8IygC1psUBgRGwmI7ssSKDnITOac6ZjpHMpEigE2nAuyFtcCraa7HV+sHrQAugEa9LQ3Mg6J0YDonjzzjGWEMsMxfhX6+++vho6FANlgywSyEVomghZ0FWGIAVO64F8GO1IACUAnPxkuj/vYKjEWEAXP3YzJWLI/SaJkFJm+GPob+sq/TLwgC7RGPTAKAuhiMaMqSV1KRb+tDH4OgOAHdCpcETuEEYmhRETBc0djMpYFFgdHyUFms9lcXFmIMJZsCVmgBVvDtsZiRlVWwuIBfFsANPCZ3sgmpIcSEd2DZ14Yk7EEylwQBL3mw9Ws359djR86YXM07U0DCIQB17CtURAIWs6WqgIdWSUWDvBzAxQy6eWEAof4aMQQROgxnvnUMIUxOUvlyiBo9petNdGP18dht92YT67v+vdXnXA01YAJWiSQja1WcsNwor/ELyOBHfh5AFJ+YdgZz/pvd9eT2/lLo90edFut1nA47C4aL/Pr/jj8HkREwbN0VkwFs8hgCmMKliyGYPrWXm+r4YDB/XibPYSjUcy2IGthaxR/LY4pjkyvG2AHfG6AhN99/25yu2wPho/+odz+7Eii4MntWaymgMlLpjImz/Bev7HeUY+tdqPGbHvVaY6QQVwGW7qUQQliICe+gM/lwGYzHN+/fUzmjUWL8vNr+PHQ+R7nWUG2bwXz8rRypIzJWALlfnplpl3eCrRhs0nQgi0IQxQb4AFfDOCMObD20u6uPiP04Rg8GU6S7X6Yyphg+bladdsvtclHfzYGWuAVhDlkUzmgM1aPUZNnMCuAt0s48FM1fNA8o2zfEmZZw2T18tfApAWB1/1btpS9sbVszLwLwoZGTE2ObvazLxYPRq+LAvgrNZT5/lVm+3Y48wZMsPwN+vHjx+vr4+NqOGQL7Wr1+Mr+w/p3ahh+z3Gc5wpnfput0R8C80/UkONkPAXO0kV1i32mhvm9vT4oifM9kNl+wmonct0HMxs8d9cHEa1Ytiuc5c2ls3pxBpi91fogm1oC53nGVzqLZ0jz6ev6oA04UTqd1iyVjwqqZrbWNrUn/auHsPNwxTYoT3yHUls2xBHt/yDWcli1uNarVw/OLErnZmueu1fzWg+ba7P1Uq8/T5v8BMwPcN3/Ro1gh94XdjITx4dp771eNwc07Uxart8aBqJ0FljpdJkzr6zpgFmb1gO2eyXCOYVLx9JrdmZ9djJZDNd/kIaLxu31089xOOpJeOgjUuXYOJpPbetEPMvSCXPSPNfWzFpgtkOGMiu6p0rOIzTYRrYNx/2732Ta4YB3XRjA6bMGCHwwh7UlIIi+12y5HjCcMKcrz4U1e9SYQU6ijPpl7BfiS+grRWwYN27aUXjF+xGNwWe7FhksHHjPAN5ogOBH6dF+1Vc5IEk0F9RrNpzZjeZUeQ5rmjC/SJQZ0qxFt5b0u0GWoIVr75+ub18Wrdfd6Q15/4QXwAfJzwswjo7bQinZSD0Wtw4Onh2rOZHol3oJCtemur1AHU8zJwV6k8CVQAy2IOtGq9m+30ybohn+9DFhu4X5fPnSYA3xxaDb7Q4W7XajsZzXbieT6+uPJ7Z2dFj1Y/A0PSQwADr4GfBOINyoF+RY2BgUT4KzazcnEr1yZF2CGu+ydSJRiiuwb5C+sqnYr7koWTda9Cm9QlsU+NwGpHfT9HJafknJwaiLb9XlfU4m7BjmtCY6r5o0zxeBPugLlOJ69hI3sNY7WMAFWQPtOWELup57RAjswM8LMIaPacMVaZmNhAMVPGFPak4ciMhe80s2uQRNoybUtzJ/QnIBmdfcArKMQs0sMgimpWhhW+D1Ceho/aP3zLjahCEZSAEw+dwPAxJjETyVPecmmCtpzool1bHX7CcXoKzKct6+vyjK+6UqF148crE3NppkQQGLl3f9CsXz8MLcLVCp/2l7uhOvfjCgiAZFJ/EkBgYpSmE88lkg56nsmavbzMmaH6WLPFmDsNckq7lq3pcuJEoqwZKhlCRF2IbdzFcoRj2AcSBjccWX+Hfr2gF8yGAzGi4Y2QimzHgWi/bHv5KntGc2meth7otahxKVM88TXVhzav6Outj08yzHPZ2dpQw+o98rJRMTr1AK3BRlvBcCWgEXKjDKkGIGgR593kSjcQdzBJ7WoTEyah+ewPkUSKN9wyYJK3pBrEEvNM/FysX+PjvMvGSp39jI90rJJUStGGIQaginqLVKxpuYCv8i4v9Vy3yNiwJIohHh2IMRQAVP1/iYPy/Leu9Yp6l+LMyZJ2VTJPqNeZ4Mcho/Si3521T0Inh9Isup7XlPtxP4bkYOQg5BjsB4ZqnpArBLtrfiF0IkGrYc63ACvTnNIRg1uzL3ig634FxjmrPJcep1iNJM7txDmefuw31eZILeSOjYg/ro6mPeja7EXhe1p3GvLonqIUSOqEaVH5sFn+KvEvHo3xVNr9OftFuizfa6arGuYgfBsGgUz1OnPc8uxZmbmPNHL1qHyCLEvz14MqtmlOf2mpmXVtDRf5Ek+8u1VbUZH4QaAhyRtzxz9anKREdti6Z3X9sQDAOqeSIYV6uSmnPG1yFdOOkiFMwTVXNjnhfNt188+CaJnbRIxRDgCEzUjkKapI2m1mRANU+9bdncq2yaW07QtC5Cg3VMPVE1keckfLz9QnPAp8aMDQGOwAj2EdIE0TxvE03tWfNkwSDbaa4rc9ZdNL2LUJtZU31z3hk+Tl5+lvA8HOEawY5PJNNHUxP+lME4s73IzUnP3eONNM1j5SRQ5/pS0Rm+sgKJ3uPPEI7ACPaGWUgbDXiqYFylpxiVwpqdprGkX6olvbOOqc8THVXTHj5aAqk0H0lHYAT7w6QNilTJgmxHMHRhud7oTZwrjxnNWaIhKtZ/kLeHnwuaL+vUqt0EOTKCPWAiTULc5aRJFpXtCMakWbFk+gMIEZpoeeAcit2UM3xYIS1PMoI9YaY3Jr1eIMF4aCLT6Xbzbh3TCDS94e8/grPi3jBFxVzuGMxSvCcETgfNtrtu4pWhrSpgp09rMsJ/N2Zrx3qF6rwnzNruwXSnQY7iTE8TNXayjulZ0yyS3dd+4UMvfDnFeeu3wUSuIFX2pmlGU5c0T0HTOBl4w18s5xP+/LfR9Y7gfLfSiTzxRzMctBvLRrs79OMkqeKnWTW/90h879JDE2Y43xh++7o/GsWfpc8WG0eA9PIrfZ50WZ8DD7/Dh/6kuxEnTZV8tLJ8OM5CvhXrVfabjmB6I7Pc4bf7U9314pItMUZ04RpBNs1KlDZPum8MpP5ETXTpHD61UqSKddfjpxkf8CrI4hbJkllZe/jtn7yvYd4oCqQM6NjqiRuSXims6cmTbshQmtGICeZAW06cmNu9aLbigUQ08/bMmtpYdkTw8rrgGFe9fBDcoQvb79lxJUI0gElYGtFwxZ7EdFr2VMHcUpo/vTTRQloZg7TQjD/xHNDor2T0+tpF61x/9JX5c+FML/ghVZ4786Q7FhswFY0Ox3gSc2VZk6aWucVp8Z72NylNFhSP6XUNNUCTtKaM62XwV9Hrz3QX8GRCfixbjGA0sOOEH3bI8zqlMjCikTfr7B/jSYzt1W/3O51bP01fQ24e6O5mPmFNZBbN2Ph7pYq6MFP3h1HnETgtt3nFnfKcnIBWTRKN1JG+zdSn+kdyKiJzSzsZoHm8Hc1b0CTWRGaRo8S5vuPFdaL+cRbRCAb29DpPZ87ihjwf1APVtMwkoynLaDKq4xQ8tzxzi/cGSZr3oOlrb16DJu3ov1uMibdfFf6EAi9R9I9aKWSiptPQ5ustzUmrTkhgKmNyluLFz2UpFgyPRvCUk0uzPUzOLWhe0Z4lpSm/dbSO6U7QROed3DYRGgKmjF7+oCsl9WOA9AhEvRpQP6Q0ZxFVp01hCmOqaEoyGgRzxniiU09xNsjcRjTHW9M05/gtwLcm61SPwMQHEEX0xTz5uUolNQKV7cmtZz0awIWPI606FKY0pj0aRpTzFMmicHrmFv30By9NtN4dRcFXp9po/FZE9FXXzwOqRIa4ed3PnKg6dQtMfPLZGk1V8FSTC5zuuQUiYriMSbMKGzu3pubr46bt013k7Zd1BNoQ2aDpHEBxL2sCZqW8KRoxucDpnlt3+t4RmnQzRS8yUDVlnXqhCzLCBwsLTxgCt81kAIjNraLLmsO6iMb/EyPyfHI5TqSKa279NPOpLjIQvy3Pszr8EsJ3vFrShrBslJ7J9T0VYnZZsxkAJoxpn1zgzAahe25BM5GWH5rmWd57kZEFTSP+uqVoKpg6fJ8hMvI41SUD2HYdQqI8J/M8C5i+WYnjTOb6O+bWSfMaNFNeZCD+0L7xrnj6k8j26Kg/TmTXtqnuTpQuphYwvThlxVg55jZOMztybMnTXWTQ+JHnpEngtZW9dM6kHSreVHcnyhifdgZMD06VKsHMPbc44BiNswloprrIcMc/Jf1AL4mS8AO1ecOwg1MImWwvBtHUAqYXZ9me66McUIFmb3uaczdNxD8m1tR5Xt22kSb9QM15k8WmzOfvii1RwhRTSz8R+WCmOrrlLpq3dpoVAcrsxChMKi4aPzZ3aRu9qnRSa/2EHfxlE4liWvM8Q6bWnyqZc2rOeqzUFX2NIc8l2w/Q3BD/fco+L/xgM+ectFR9ZbNHrCnzHFO71c8sUubsmJmCwpmOJj5CYNLMKJo4L4kyDPWwBPnMQH9KA+oGrS5bls2ZxZqY2rRz+31oHgbBykszzZUl4jd3+AuJHPGnHABSne5xqSwR18ixOd3UwunYcNPCuT/NR3zgwPieOdlwoU6lM+cJUt3RlHGXzVNb2WnmvqS3JrbSODeSTNmJZttO0x1/Ty3CjjrlX5TRfqW3J25hhaU0T1JYk7R9QlvhLO9Fk16n00UI2yNHZvp3SUh1euvspWnrjw2MSp9ubplXsKrTTsVONBdraAiaznPqJMDhJaVIqvuXIXebBvsr91T46zA+4UM7vLvQHNhp+u9FUsePVA+WjuYAke8o3BFlM23ZwR+I4dFj+EV6mkZPpxVPujzaTO4WqF/+l+QdJBeRZ9lE2Uwfjb1wNoAgBU3fwxmnG6apy2b6lz2QZ/qHqcum72Zs8Hk0B3aaNUdephWtHah9oOk7pf/D3pnsphEEYTi77Sw2MUmARxhprpwRYhAR8gUNB4SQZYEvhgOWQD5ZiiySl8jr5MXSK383RdMzwwx2lkoUJ5HiFF9X9VJdXXXhGv4cliG4Z96e7j8uZXeuPtmAJ6PJV7BbT96URzxLxx02iV6aaRIO/VvS7M7Vcty0pN28h7nQbG63lrM8T5b+ZT+nqQrLaGqaM/lP96QZbg+jeeKb3ogctn7/rG0aBpX8XghLzLWDZqHz5vxJzZuRY9703ACnuBf6v6aXMPa+IA3uLH9sR/Vn7DfvitxvejMOfXUo8DDwXz0L3YOmd+zT5Hr48xf/9nM6rMnzBhioHA+q/5AYUidzDKnsiyHRBA73K2lvjpwzvikXvceLbwY5xDcBwB3fJN5A5pY0+Zvu2PvzvyD2LllhdOiuBjTHPpr+3GLnvVD/9C+5F1JD23LcC5F1j1ySQ5Cy5Dg2Oe8sw7zvLE/3ubNcpLuzxHeDozvuLNOcBXGkd5zUCrxPnz/6fbpO9oBv0vt00Iw8cQpytqAngUPlesweI9eDJiLRXA9MLf41k9gxMZQD5SF1HiUPCUlyrjykVHEWegqnCZxwrri4HLn2vjlyrWw5cirXue/KkXNsIqp0B0IrA9D1/6D5m8ep8jd7OeVv0ncZQzgKDR/SgJzzUQbdcP4xucVx1txi+DmtolchgOh+zr3hpFukPybvvfE1W947/VgdPHGhzkuLpHi3SBNMHMnfZDw79JuMVUFvMmp6Dn9XJgsLOXk6JvXIsah53wvhiUvm90JXytGfzHshOYefkYCqJwToYD+E59lv2ULi6+T12KO9ZbtdmdqAJ1XGesvW/k7esmFo3dtNerCk8WJ6GNjZ5aVBXjb631m+PNA7S4wunXI87ywxtHhyTkI02G46o0h0x+V7A4xnq0nfAC9vD/EGWIxuaXuV4M/kDbCj+AANANN3gf5lCBPnGcwBHQscT6o/S56+9+ndQ7xPV2+qNVA8Txfvqd3v01tW8YQybl3cNVL8NHtY13y1E0i1gkPWTggdtRPUe/9zrU5Zl05Qb/1dtRPu7cIeWH+b7iXd39mhg8rFqOuBt6IEp7Oux6fNuh6NA9T10KP75b1WB2U9vqxLmW+r4lM3is6QvaGfJk5qcxK+VMbsqznTXR6d0Joz57rMi6fmTC+3mjPQRo4u1LFKzhzrgkJH7e01ZxAYw2am5VnSaYjL9WTcWw/p1qhA9HGjHhJTv9h6SONt2sjRNQoivTDKIemK0cF3oowZF3NvtH84lnRgQqiePCsmtbpmO2p1vdqo1XVccK2ubQXqump0jWJdZqkuVVuq4ShrB9Okjo7rX3cnMWenDDigXUcuoh/AqtxmNWh8U2QdOVTBsSTi2iigTJQqGiXqntnSNurI2YdYe4kOcEOe9MlMD4tDshqHgf4ETNDekqvvrHE42bPGobt8ZTQ/OjXV4T+Ngot9f41D4uj+aZNeqro3Lv76myOj/uZr8UOXvOzN4eTEGDLW3/SUVo1adQGUiVV+k/n43F9/c1ePjAWmzV3R7NB13ktcG/bnUHVnEqK7NxVTG9Zf9jcK1sVhURo2iBKVUYZpEl9sYdr0VCNwGGeKusU3U6tucS++nORVtzhDSeroIa7rwsVBEC+A0lu3uGQGq/zTJg1xNV0nvlK6mtrN8TXrMjuozrq51tTOWi69ETW/qZLaPpibMxvCAd5pk3a0dG5lc6/3Hq6IMaTHWVS9d3xW130eps3E3VZr5l6QfoDlAXoRoG+Yr3x+e5JZmWab9CKAH5Ibh8CaNqnGpBMwjBPWc7g+GRXV++7MENnSDmTz0wYjC5j2+WBO+6dj2tzVpTogxomZrdAeLgDJIKIv40a/RYYVTIk2+fVwgZ/TGp8BbQKcqnstDIj2FwrCDOq3SX8hxZGDZAjRM3SjFygnC6a5dDua1cnIOmp2wzTh6J5odstzPMje+wrqk95XFebXkuO5arjN5AWRL5wsmJbLlb20QZF6jCxgump2T+3m6Z62jSH1dUyd2fuyQX3Sl02SFBzRM5y32T+G8D+hYfd7wVT0zS5l1gYzpjmy3nNK4M8UrewwTkydsM78egYqknbvdbt9vRY07EbLbm6iWbVBjzv0DESzTscZuvF1vQZVnqU3Tkyd6JdI+1muqkns8ifpZwmSmqPu0v2aCvtbDVW37JYmSrprdprJlEGQG5+OfTgFE37uWoP8xhm4DtNfxOg5e60GHqDVIem1ii72du91dAnRov/GYGp1lbe1YeoMqwmUwQUMOpVKU9cwt5smkuOSGyei8BIn/k9XH+D6Q+hQfir7AEN95lgCJUgyjqRJ96kSNOwGU3SVF0AtbcTwLvuOPsD9JZThTg4vR9d0AyY1TWw2fcZJo6+hjpvBH2iPagWUER1dzoyAVzS+iYdbelTL+y70jTdB6ibd7V7Qn47iVlAftpeqeziYWl3l2TeENmp4OdFVwNSZRHffvn+7iyazy1F9ZSijeyrLT4WG8B8Bk5om1qBsxhliR4Zm4+7+6YLEqj0cXq1qte3905VVHptd7DXHWo8BaDaQwYDu4dcPrTa+o9VVnn9T9KIn/dO1nBJlVFIFPpCYMVwwYZqVpOn9FOdXtBsQ5lne2dv/xNPbn6PEP3oOu75qPVQjb4O/6o3qyC6+M4ByA/2sBmnD2qELVeYcLLV542hF/Rymmcg44euQ5gp7XO5UmmdZ8YTHYg0xVg44Jb+QtVFqnwxuwlTnqTkzUmVnJhsxgUAbqKN0sZVRXfElS0y9Moti/Gubn8M0ExknfN2QyRLeTnnaqwkTsqvRCwY+q5zddN/4cZaY3kNPmqjltwKotUtQComvHyxl3srPAZYvcPE/JKHZi6/kmJ3wpiV0xAawIsuMI60J2TNaW269mVHQYZUcZau6T1yyv1JAbQOFNsfq7lR+OYYy8iPwhA7JEk6OEyr1czz78Bqn8nUnTmO3qJUpVbh9npHzjBacXDBZAuWqE/7aV+7nzEKpgUKbF+Iynf+C4746mFYYSrDEcaqH3b9hmghZlNLetEwcBzHwVCc7EXfEWVvELJjK8oc6VZsosT3tz/ZGiaAUNVChDUIo/IsMm2i9Ncq3YImj/j5+TiPr7Z2nbJjAuY47lhEHYoIwmvY6oMTRKTe572810HOhDoRHn7QFlNYowdJycgrzNX2m6/d1rES087nJE14jI7oI8vIor0CqSWqUjnNfIQYqgdope2zUhYhAqkJps+zNXDDT+DkNRYWOuAsyjrC8KDuEVeqULqz0mCx/OmISec+gGO63wibXVD+JiDRQguUSw0xhws/T4MRKtJvnG+w2pCDGqziuSWIJjzH2BUh1CQOFcnK+hCCQivkHsTw3TLyMynLn377byRMpXAwbYyfXTv47xNY0SeyGCpZqoLVTymFjoQUbD4VSsryCcm6Y8PO0K9HJ0dWFZ46SRFVIF0FexNbWJFOuO41uOL6+XHTieNR5uLkcDMZ3UWKgnCeGWyDlTLVop7Hmn55Lu+8tEyb8PNVKJFOZV66PEI5ULEYiVYJDkB0TqtUTbCwRdUKyyymXdRZOMPox7ibb1CugONhaaZASpDn/ONW7aB+dZIVJrwHdFGbTtiaKeC6ivDqCUxv+JOdGT7fzUzQNh+iAUK8+TZKHMI7JcCMNEl6DzZrTy0+eZ4NJLiWB0yHVUa+mA10QZVC1dqszaCa2yVgltG0G2+1BEkx7wU0CovfTZQ0hUQicxjeVXygvzwgTOBF/7jV2K92t/pi2hiyWqYK8VyzK2+ovqvBJP8lOHcmWRj7tB+ai/Av/qS1KEmU2OkpiorNFa1Ujwy2dphZ0sMFwGKb08mww8fgMT+dYbCrhnPft7uIWifnJUc7ryibpLHcs5JUULG0qrbUXJ8s9Gj/M61eMqZbaVT1eSJv0GCbCuplg0haF8PYipBtroyQr8AtbPq7jU2aP+3pyD7i9aHSb4aRxgbC+1zC1l+P+O53gybG5FrUL4dnt1I3s9M3d4XtLsEtURPWJvx4DaH5yEWjDxAPnPaS8kZLSC3NnaaCUNklOLudacIIBUQEUBpovS2WY8HICM/taJHj2wzxRsq0QUHKSeHh2vg5UnCnRx2uOFXedxnVvfZQHUEyYOqFmLy+na9F7MwOhFeaEsi/MEihlgEJ3O8e714oU8XuRzyk7suPyxzDQICeeDckShgkv3xen8PZ8eXan8HDcd+lQKZIJiSC9kxFVQG0D7UT7swzWLGGYe8GE8nLytHgO9+I56ViTJVBqkkm04kQlUGKg825uLKlh5uTtNs92RgOd/Jj3juzJEiiFTaYYZwEUBprHDNqIN1nmaJjw9g2eWYBOLmNG0rRKaZZAmcFxXAZaj6P0KB8YSsTBOctcDRNK2zw10OG0mUzPcDDSJDVKeDhFmdlA1ftYCXQepUSJPC+whGbF8USCxnA4X4zdakezy2nAQIIkR2lNlvsqXCIGCqBBZxAlIDmIgbJQlpQnVNZEjxjTYLQYXI/vmxN2cptVB5c3i84oriuOJxZJGyUpUbO/gQKoeOHZ6lxHTpDjG0ESKItlSXkCKMLBViIaorwIfIIkUBIPz8tAARRIp4vBOOxG7Ij+7a4RTZqzwWLUCuA12PcWzBI8tQlAZyZ2dBgxXjO2BpL5o6QGCuWeG0iJiKgVnX8Eywwuk3kRtVKrEcm2BCldAiRI5oqSGqgGCt02BhtDDq8xUR6CJXhqlTdSuHhAV4v8g/WIAiSBshjtABTDTUcbXmOGCDjKQ7CkKmuiL9QNoCmKIh74mCQL1bVkAjWRatGXQ5wjAoBA6R/pQoBKoshDE1y50MdnRZOkQKVyQEpGm3jNwVHSo7IOkXGoTL5IeS8FsTWQPJAo5YAUg32M1EMBUpF8FJSUqFQbiWhGkJc82j2k6Cewargx2CrjA6MtSZaePQGpCKYCqhQEeR+JIw3fcaQYbQy4BPlUSFpMKyVLKkyePQWpcCvFaEOewGj/qfKbPTqmAQAAgRgoggH/TiEhePjhbure/tu1rkJuAwAAAAAAAMCwdwariQRBGL6EiLKQQNjVVxC8zlkGFZfQF1kPQWQPiZeNBz0sngSR1ZfI6/hiW2Pb801PMehMxtUFv44QkkvyUfZ4qPrrxo2zUbfIN3JuvRKf6odTPAlx39H/JrgenXT71D/oq3mkV9PCFhAHgt3fco1m0SfamNUGeDhP79zBJD2vwtcDqX5NBPtmL1OzFKAT6Otz+2FqCrabYLSsIQx63H3IEks6jt2mzaL2fG6pQC0Qf2QHEnKR4gubOMoyWtcN+Rb2gFhSfmO3tYRa/0Yo+3LCX7ZA/OkFMXEgmhwvQhajn3WphkWE/SwD3MU4w4JXuZhVVYvavC20deSpCzBboGfP1cYd6BEDjOKz+By1U+myvgU7ZgP3MUm/qMVsrFbQarFrDYMIczxEB3fqAlQCM/2xIMYmgN8r9v8LRvFZrDBrcQ59PKTqkZxjkpPSi1nUeveBdyFgl4cZoG0PITROH/4yBOLPyXLFYU/maJYzis+ChZkaUbbhcFAF5di6VWZRi1vK1sHDDNCGOoEozWMC8RfL8/L+fBi2dUbxWTB8QlyiMhr67AUzicKUSenhrNMMBqPeqAIJw9lmyenUly3AN1C/I3kcf0pglj+2w1QAGGk9BLEVjVIgBondMtWKhLmwlgU2q7nphq1XmUfvv8umlcHICUatbzbbLXrZGyYvd1grhjvtTwvM9teU4ECbkyqD9a0wlHHrdtsY031rLV9/9odubl3FfBSL6GLv0TrcnYp5Frnb9XjWHAwSZYtZ3KIWvK1h8kKZfME98AaWowQqf+/9Xy+Tafh8QpScmXx0xKiKoMkz1GqXBhHK3yu+LGDeDlsNKdsfnUDMWrh0lVoqFzAGPDyov6wKDAJZULTeyqT/Gxt2cmC2M6Km8gfKPRFtWGoW30qKdjrZq20GgVKLWwyD1oY89CUEjqUCG8uwu9iVgBnikxi0XDJtYeKyXBbdcNl42fbHQ9SiV6iKY7DSUCdUYBBE72C5ACdTKrBUzEx85gjiRGacYUoo15mZt6N7fyKPsrU8y4ZSuxj2GAhBpG780d8/PMRelwvwnJhO/pDYR08mLi/AZrNZrebzhTHyoF0s5iv5we5SEMcpqRWEvh//aHQlMq8RQ+wui0dOW0b+PdzdSGH+VKpqWcZxmdXK7+7uxl/2zsI3qiAI4wSHQFIguBxWipQCpRToXaEUKEEqSJEipViRKwR3De7ursHd3f8tZmZ339y92XePu5Ig4SuQd/Ag4cc3M7uzG0ZoBUa7GczGOH1m4eB4jP8iyQmMNEyMU6f/nKaSjZ//KwZOTp0+8wIpZw60TyGeOGzsoi6DF42FBcpSXKE0W5BKW7R/QdByWDEQ9XnFRh+cdfxTZyMx304ObaHFtWy9NG++rKQP7oBxAzfk78gRsOldBzsz2j6UDNVTFPgvVDJ4onaUVJdaep6890zLJPucVR7oTCN7hOoYMWKc3ttn8JRhsDOZOerzH6RRM1NhwM7pcV1GDyV43EcU0vOMlw6y/kMsE/NWRZzLGcCsQV14Wg/JewvNbB3bdhk3bN5vMu2oEdh1AYAlywzACHxeTQGe7WIfCj8QBycKc9rHgg6VxuRJUqYhRl/u/o6bLdu2Fo+cHov9iNQRv9q1HMHkwPkAcLoByPwkPdmvqsHDTcxoMYkz9pxq68hahmmmnIlmLckgVnwZsCYr0bJr5y+dNmvdzIEbE6c3CvsnmAAXKX6+ABmdmgyj5Wqk6klyHjwHW83Jgd5Qxbmc6z9kKMDkCXwuqUNo1lHQXvyOOrn3JKiGP1qaDz69pA81w5dumwirhRkzFqxLhYb4zBFDhgwZMXPQoNTUBTOazZo4cdq0bUuhdgyG7AfwgJ4IYAnwodF1R/eUzqD4OAVVm8eMeY63HGI3Jwd6k6rWEpTKo6lpOiSfcYH4yAa/X7ly5diVY6RLRvtACBa5ohkMVolW9imlZMeZ8UkDRhJ8oXXzxU2lHVoLWeZv08TMO+TRq8vcATuOzWkNdMyaMs5nOoOUCSUdz/IYENcZ7GGlVY4ea2muZFzmShKVzOcc0bOh7GrWX2eICO/JzSdar5R2OtqP2sSqy9NhI8YCN/MwJ2+IxFqzWh13CSoxTSjz37Kj5O0A/PH16+Pnzp27cePqqreg+45W3XfIomsZK5/vuCbj+UmWDqyJJv1RBJP/NMFDbr179y49fdc10FqjuREyo0MbR82ldw2WG6vM2cQS6rzWHOYuQHXMAPq6NI+6qXMllm88gtY8OH4cSF69Chxfou6y8CNC1boMwnygEy4XMi5l+GWX+UV5dae2lgpf40CC17Fjxx6sjqjc7t2JKOAcnwOarZSRAX+f2c5YWx6nDmSa28wJzQ89KlTWIAx0Wc1VlMOmVKGUWkMskeSeN28ePXr0HnQnQvARoBqkN27cOAyqd/kKiM/EWZG11fnS3ww6VtStMkh+9eph9O7alf4OQRLHzFaovih6yszM7DGciPZLT++VnDw+L896+ZdH/dNap5kYpa7rkCtzJmGgkzVLon9Hc1r0Y5TzOZ1keeL4xbNX3+7ZAyRTglmBQNu2bQtbRKiwsJCYKp++fXv16jnQ69fAlK8LOcmf1cAleXcBvyKuN0H6278f4hdRds8FkpmZSDG/DWoAip7ykSoSJaDMU6iROr7V63AXzqW19PRvXiRxRW9ANWidjHOqXJ6TN5quOXHx4tkDCiWQJJAtQV0jBB+RKSF99OjNnj1vr567eBz1+jVPtSKZxQJ+CdFP8/Ua9w0mSHlrQcASUA5HSwJIoNiuXbtOLPiEVPOBKAE1PDPsVwvgaAfjVsb6EIJD5kwSaZMCfXr0ftLEeT3PxuiaE+c3AMvsDoQSSSLH1qCePcvLy3fvhh964kdgSkQDgfcpCPTA2Q0Xz58APQC572vVjS3LXXGsjotBc4FlP2BJKJEkcuzcuaKid+/eZWVl8GNFRefOyBSJElDNszjHas8ksCfVFBnrfRCnqUOSpnvl3sXEuXlfGvP8xQ0HsrM7pABLQtkVUPYsX7Ly9qTwxy9aH8OTbq/cDVCJaGHbQCArpUO24rmmKYkqGS8W/BR5K5Ev/WfMXpw8klgOzySURLJ32faDzz+Urj516uvXr6dOrS798Hz99rLeRJSAZip/jmR7ilNc2nMLc24d6tQhUYTw9VpLo7OmE+f2nNkUjFnU3mHZUpG8feGLVZOIKPBEoEHgmX2gaMP5E029rrlKxb4zOzunOLlXej/Dsp0i+XTCV5smPFVE2xmeyp4ZMVqV0pxTsA6ZxCmLkF5TcdbkOLdGORqzWwfNklBOYnpWoruBJwBtG8gCnt2y229IC02t8iuUMXs8GdOwRJRHmKSV6BEEaniSPTna7b3KPq4lJ9O0FaGokVFDKWtynFuiHI0ZdFhKlFIXVoJBMd6JZ3b7/mmhgl8B0xizh2G5XaC0Ad1uePYge3K0i1gnczb3oulbhAaBNfXLSfYoPwAw0ZiCpY9BwZ+Kp8I5p2Bq5WGyMZUvmaUPT/KntqdXtDdCc8p997iYNKO3lRNxPUVZs5EFpolyMqZg6ePPZ4Yn4iyaTNFeeZhkTKg9gqU/T6hHYE8d7RmSppMKm9lpRpX0hrqkD458dxgGOmdNCROjXBtTsPSz5xLiiTi7UbRPrTxMNqZg6ceT7EnRbsfJhWVaTG/yvrIm0JziaohS/WfyAiZEORpziazi/jwpfVJxZ5yVg4kZE4y5vvRrvCpdD/Zsk4/RrnBKmk0skb6ICQma3PLgfSivpiRMHeXxG5PTJxV3xpkwzF4IMzFjsj0p2hFnL8bpS5MjXS4350W+O1rQFDA5yhPFScmTcBZUxpndCWasjPmN5ZE9VbRDLWJ3SpqDvPMm3zK0ZQWx0jdac55WRirKy+OMclncFc7JcwoqE+Y9FMwJ3hi/G3nwLIXFEiVPDvaEaHKOnRj57jJDs5Eb5mSGicZMXBcoeRLOIo71BHOmhKkoSnnZU+Gk3FmcVymasv43VzTrumg2DaUV/RTM8IVJt27dmjTpQtg3eWaldEswdeYVe8B0g/xkJGhaccIyPh6aTaPfrUrvLvCnOTWU1r99t5SsmDC33Lq9BNZASlDzl6wMx8JZGAh2SAxn3vhkAVOo9MPTg0d6Vyj1Xo89kK+xceb2i65ESU5l2ea7F7JXrI2q31SV95UMs0MwUOgJc8ttBEkNIxI8ENGwF86uLbgSxV/O++XGhFn6HEB2hiYciLqc8AxIn6+OgTMTKpHCKVc9cdCcGXnvE2jKU6QCgJndARftXe0wt6ykvobqD6Oo5UntJQ+HlreOuxJxnGM5z2SYciEJKLE/jM030gD80AmBrvbEibsiSJ2zK0lzoKu1rGgmRcCcwxVot40l7hkJJJxmBLTgEYmiQ8O23xN/JeI4p3LOMAVLRImNduy0k/rm5yNSXJkeXG3F2WlAPuDE1Dlb0jztS5NbSCtcTQ9BkyuQjUx4pWKJILOygsFgSkpKEJSVFVBAwZ/h2JWoIKE472SDWXoQWAJKAEnnakrwhEgBqAfP7ZbUybvF+bK/KWlChwSboZG3gVIlTbKmdwXaQstH3N5gsw3UjQQPwJSAgj+Zp6xEFOsJxXmZBaZmScdpeOabm9sdvsPTcDx8UzzLJM7SMpM6Odb9afo15GbUMt3NJLc1C71gEktASSCz22tlA1EECpYmnmHvSlTE5qxcnJ86QlvFfH2QBkeTY5T6wTMewRFP3NWf8kqdHOuyk8E0a/4czVlMU1jTUoHCSwCmZokgi4r6OyoCogAU/dnCniN261iPx5x5Os4HQJxLg1WAMYllLoBM7wUaicKHdECaSzzBnhXbV9tSp471KJr13TTnM02/9uY0QXMqWZMWR+W2KEeYimVR/8lpaWlztNLSJiNQaIYST5U9pa8LhTn9rGnifL2AqY1JLNN7jUxOTi4uHo8qLobnkb3Siaeyp4z29SbWjTmZ5ljZs5Q01aujI1+dRzSp886rI7amPcqDhmUoFCqYqlUQCiFQ9KdpiJaHZayzOeOwJsV5qYSpjNlRsSyGqzF5GUp5OTnjixXPjmhPjVPGepQ5HZrjfGnaz38313Je5TjX1twtYVKUA0xgmZYWcp1NLEeg4E/gGfSI9nLHnKH4rElxLmEqY44hlq6zHiCKPMegPb1wdmJzRvXTF/nRlK13e1IoUCWIrClgmihvTyyXV2FxmkCegFNFe/nHypkzx7FmmR2mMiazFDzJnh44yxxz5tgRseGqR9NsKmxsXZouDzmroyWuAqRh0qGEZMn+xHDX0d4V/xBpziBnzgStyTDJmIal5Dke7SlxSnN6h+88QVMspuRBhgl0QKFWRxcsBTlAUc7nuXaelD31xjTsZc7Q8p/Mmj0s1lxdxjD5ANLjzJhxbj/lZc6fopkU70FGgSroljhHDLoL5LM1LKDsiThV6pTmxA2RCHUbCi9rHqlgmMKYwp4GZ6eK9V7mzMlgmq7rCT/Yu5YVJ6IgGtSNj4XgIuILRHCh+MLxAT5Q0YiPAR1QUYni20Ui6qZJQBHRLGYhAReSjbocxvWMW/0zu27n9unOuZfqm86MmWh/QEOf1DlVt6rOzUeL5vqN6iBjLdDMEn3PM4do9sFklrN63kVDr0HBmVD9ZAGix8cgo5qdQZ7vzoCpvgVwDnK9Y4IzPhAJ1T1o3gOagYMMEH2ReF6o3Qu2mxgXOKOB4CSqq0RHaEI0dxCYOpyiGD0Kzm0HEqoDzbXXPSV5wCCDiM48L9IAQtXqls7I5CFQXSd6HFL5iOrGonns6CWAWQjOS0dj6Wwu9Jv2Vjl3n06pjgPOHdrfIDT1QYaf6LPguS53yZv6cG4ZDPNvKdVVNFOif2aem4gCmDqcx8H1DJqfU6pn0bxQHM2HfjTrKdEjCk3Lc/BT0c5EOhGcoPrWYlSv3Tg04yL6G7R6a0GNKMP1LtAE1WcO3XhCaHIrg8ZCq/NjoWSnSwYZlp99olOpSTxXHiudVLlGaVav67LJRJfQTHk+FdAkFa6b4EzRBNUT4dykNYaUIdsHoJnKJhM9Cuvz8oG/4cjq8cvqBWRTAOg4QhN93mJwCtcRnECzA+EMQZMtBBbNNQmakM2te2bzqokUBHIWkU4bnBFn9V2n8NNosrngCk3muc51BGc6Hu5COAPQVEeWftlsiGoiBQUH5yDVX4tw7tqrVZxTbtn82QwMTUR6EpzNn4ImC2d5NF/mDAd1t2zOG9VECgoLTqb6DxFOSkOqbCILTyM0Q4Nz27Q0SgVNFs6h0DzrQ1OCySWbszYJcwrSg9NB9dvm11HT0BmLZofQjIUuLDQhw4ImC6egWas8KYEmj9ORhLg8orNgsSrJRfUG0pCCZv/rSTYPxF9PoakHp431Vj6p2V+n8uS5gqaynHAVaCbjNXw8Ez18XZCoTmlIiyVJQrHO4VlIMvqMZA16FB2+IjoswjnwwultSVIfBs3LPjSraShFTpkDMcOpfjsvHQh2PaU3f1EoxbIZRnS8UIK9m33hr2aa1F8Ngeb57D0gGKdbNCWl/8h+++J2I5vX7gYSPVckzDveqKKZpPTmfbdsVkIfCGeu8dFMknoYmvriTNX97a+Hk02c+1Fy4TSAs6VeIGXRbGmyGS7EFs0bpdG8TGjKfI14WQpN1o4IJVKRU3qLv92Uh5WRpKGWLTgFzU8jZPrTfrm5PTvE+G1qd+SMoEdRYh1N2UroEZqhSQjRztrRk/67QbOmohmycAg03zOaQzkAUCUsutGsBxbvOprBStyDdhCaZU6W1f0WzQZVhyNFcx5dpFA0b5lz5b7yaOIx536gyf1NtSPH/c1/PDbPWTSVuRB1ix+70fyvm0BTmwDrc6EVktMPL2VOn9ugbM7wzPKje2a5MurN3pLWm3PKxqF2DwWMgf/PQoKm4iII2PWoqio3Buf07lKe0+dogYM8wLQ4695DGt8e0kKu9T50D6mm9ZCA5j3VJV1gR67t72+eWPn9TTPK8Pc3Bc13rkR9BGgG7W+2fb33LZPQezdEx6/DvXeg+VBHU98trrrnQtGkzIUM0QfRfJBFE8dF55AcD60s8bGp6p5Zfhv1zHL735hZ3hwgOs8sBU1ldOZ3uLD7qvrFztNfT9o83S57gOg8T596btE87x32sDPwqq8lV2mP4a7HsZK7HryIxLJpx0LvXtDtUuREpaGld62r/XSC95CwJOeWzQqhyexVVg7zC5zVr8uwIzdbdkeuG7wjh70ZhCbvyMkggxtym6khRzcDOPO/COdk72/uIF9GB7IpaFINSQ05NmX4z/Ttt5O9W2x5jh8Gsjn1igHiFhIXnP7OcvvrSth7bz0Ycu8dCR3HSrv3zuTlS1LUEukRCgBD9bdFPBmV5fZkPBixJwM5aOe0tV9tfPWOEgsf07lEOs9J3foI2t8VvxAsLiX9QvvHxC8Uv0UEmKa6rsSiJ/U7giaE8+tb1csm5t/68nnZXMHZ62S9bMCTsSzgZdsXd4rNnva6Vc5ykw+W3C9GFwnCCaq7fJawBhb1WW5dHp8lvIHsC9R8ljYHseUcl0ug3FS7SJshnJbqHg8wbKvj5gGGb5U9q34P8P2cQZ0bwOwL1NOQCCeEQajO/nS2VF9L8BwPf3riqe4DCo7fNH5qvz+9m7s8YRPuMlXuSCE0yWppb4cVOPnuBLb7nxI8tbsTDo7y7gQfnEet399enlCzVydYrz/dneC82AO3Fp/1p3T9nx0uZm8uFuV03usBOL33euz/S/d6mLsoZtKLPf4wd94tTkRRFMduxN6SAUUFEaIRbFFBsBDjig1j7IqR2HvFsvbeC/beRVEQUcQ/FFECfi7vfWXOJDeTlyZ6bBtBWX85572Zt+M9i/yxHgso5HrsTLkpPjcxdAZBxybkoonWkR2lt/VBM7dWmjmzYeBwOXNmhZ45M981c2Z3s2fOnN02zMxJGYqhM6MxcmaompESPnMGA5EQdN5V3Fu6xo/bemhvycR3DJ2ROH/trjAPacS/mIekZ/gEBiJNDIxD0vN7wuch4WAPQY+JTQhbumxrwlE9dnUbdTGr62mFWV2TSmZ1Ecu/OqsLY2egnJkvNQHDugKjuiaY2VLKmHI/19bknMug48u/FZrEwpoysA8Vz5HbEDJHjnhijhxJzZEjln9xjhz+07+cfWaAkswYOYtSzj2Tc+SK0HRfLZZNOXIcUZcHH/zAhzCnxbm70ozDwcUzDoll6IzDrQ3POJyLpVPM5TNA1ZBD/k4faZRVzTiUQXcvm3JeF6IOczYwf5MUPn/zYoPzN7F0luNJefcHcE72x29SxpmlHsb7O3z+ZnhHxh6xbIprJNnA6MGcrtmw4En7EUbDmvamUZVnw06qezasGGcqhnD6w2ExGtZM2GeaGLGN2bBmSjmsKUvWUmLZLHuNlAw1Zw1zi9/vL5lb/G5r0+cWu0ftYtru9Zs8uHjstrEE8vrXHCZFE8yKc4t7ov8vVsWyKVsDpwlzorGJcTpmagPpsmXvSI3M1G58DDR0MJe7n8vppRI0y8LEohnYg7yCa9l0N1rCnPznzE70H817FyPKqxNoVpr3jhYxWBNBF8umq20V5jRZx07U/C6C1lBi6A1zdRGczdUNU3YRoPUKexCCjmWzbNTRBCzNWZJ14GxaT0YpzKhpce0RkK60i4b0ZNRXOgJjip4MWIxvuWV/OpbNSi3VcWFOk3WBs5kdLtEgSIKoC4ZZJX2LhFUzlR0uk2tJ+2/6FtrhUtoWWLKbxGUJcG3ttVg6gbORfqGLol/IcGSQhBDl1yVdoEwWTIvKmuZy2m+6ecq+O9kvhJzLDX2KLKgO34dSBZl1LJ3AWX/31VPZfRWNUqwVx96mcJvUVqg/kwXTPuvGBYrEak87xsKj+wowdc5lo/JmUZ5eqbYxIbOOpRM46+1lOyl72VpbqXFVGZK9qCmqmv1gfzJ/62WZdlVM++7aRc3SpuSuzl42YmlSPlLCRAOw3IMQVqloBXNi6Qy4c8X8ZnUG3n1CjcC9u4Cjbaq2JeDBfm8F1vfp8bcbN+6aqme91tsZSCxFZ2AfCxM5R9Bn+nsQlm+3OeXSyTijGue89WTPmvssT8o+yyfP7jz+doNIgiMjJHWQot/VUA3Trl2vHn/LJeiLkXbN80vOnfEvfv8ipRzttdz+a2CKnIs9yG3OeCFk6ewfqP6ex2lvqGuVYR49+vgxNX+/VCQtx0DFfztf5jeCTBXQ/kSUWuVLulZVQai7GtTvBg12ra7btbF3Px9meWvKcmq3OXEKzzj9WnqkvfYeYDam/frR0aNHH715Q13/bTVJy5EZRoy6G5mXFqtiykCJKHXQn+ea/qIe4CG6UTmkB/j6WWVL9NYi5esIJj0qA5hlrYmLTbc504ViJdJqJyIz6LT3DKZ9hOWpgKqO6nfBu3PuqN5d1FFtWT569ebAixe3r3Q2JAGyeyeW56Uz8YWbV2ZT8eTy9F7P49/sDqYEVFv03PbtVOh/6JDfUT1gLjqqj3z5uSSXo5Lq+3SnvuTnl5voqJ47wHYq25SPI5Zv/UZ/wJTWRNBrNmdC7URkBlP0b+8y2Z6Kp+hP5/r03dyfThxtf7pZL9VWTihfHThAKK/cumxI+hy9zMpVW6ZN2Vko1bE1a0+k0p5hykSNRR8yUDIo96ebIoyi/vRtY7W2Ffen2z56YqlTziyvdt1OxuwWBhPWxB7kMKfEyX+LTTvbs4+1p89zUqDbf7jo9ieSbEuV8UvXFMoDn58TynsdtScVSG916kRsesGh6bFNC9MeE1UeNUCNQZnnyKG6kH6C6PanF5qkraJHFz23hu869Lbr9u3amBqmzLmwpsOcyDo07VT3iEk729Pn2dpqeGqgTJSRKjFE5kggmSShpFr/S9eIZTFK7UkvvilRqEGxHWRStqgBSjy1QS+M+WEMykS5oIk1mSCy5s5VJI0tFxBLDrlhycY891AbM9J9Zr5QLuewZlXmFFlnrdmLtJfwfHKUaukVUEuUmVoNYpBM8tN3YvmKFktGSSzv3WMDKFN66c35Qu1KnMiQRS1QGPQ1G5SAMlFGyppAEEnEUZE0tpzNLGcEWG6nkBtjLp9VKNEck3NY021OZL3Mdae2p+ZJ62dUF9M/eUZAr/lEuZ/J1yReKRXJa69evXnDtlQoO9p8e6lYoX7FFp5SQIVBxyzQRJkpazz/xByZJLuSbMkZn6H2Hs2SjalYRpDyMjnv36UvW9NpTmS9PM6IsSd49olGiacGaokyU4hBMsnHhJL2nedXrlwGylMtiUKjOryDHWoN+sE3qCJKSAkqaSj9IIwEUpFUtqTnkwglsVSbTyDknTI4NoI1Tc71eYdTODhhnGskTk/ZEzy7ENCPH1tb6USXgRJR0jXWJV/04tWjx4SSr4bMYmlduXBLoTmKpcsZ9NDrC/SwDDElTZw48QeJOSqSixZPXbfOojwOlirkHozpzrk769iJpD2DPAmoIkoiqJroM2L6CFIk9YWlj7Kd2nUaCbg06EJpUH1RT9ehsy9ovabXJLq359MSoOSN3LBEyCVMDqbIuTvr2IkEztXgae/smGjv3nSUS1TvBPSYRCRvMEmg1LZc7kDZsEGJpwH6mvkZ7SKtU6IP6LVB2TbIMrMlDKbMuTvrITsR4g6efGdnjsj0ce431o0b9F3pBcmQDKI89WCam03jK6gFev7q1atv3/o81S8M8vjxfoSyLaMEy72xggOmyLkbp9yJJE+2gCFq9JKwvrS6/fI2gbQkfZRedkvhLyq2FwZloJ2Z6Hb6vK72Ox6Qf5DaqzOj1Czlgilhcs5hzdp2ovS+UJ64s7PnjoSVxAe7Wu2JY7d7liSuhv6yYnEYVH1yD/0jUSscpBqUmuXqWMENEzmvdSeKdFo9x7FGaaLmSBeHvDhb80nWuO9MmZXIr121pyWbXdlyYtOqpUvz+6ZXDZR54u3WCSKmRvx+2wNArD+ZsM/udCoIEzmvdSdqE+l+KuyfkFjp6cMHjdSIAFq1CZ4JecnqLyyn5zdlk8lOWt1ZnYwy8ZVn8rOqu6jXQHF8x0x9ddMgg+tP6Kc3J90pUh9MLJ04RwmnsGVz2hLFea6FaDiyJ5c/yFcLcmlLKqkZ8l8L4a8jpsnNawpu5bPi7e5oxB8jNQhNSMojbeqECZw440tUNMHKjKf++ZGgjKG8dKpl6bSqPZlNKo54cwyG4jdJMc3EN1VB9PDmvR6ORCGExrWUzzEprxMmcOL8OTOlUFGzYmc2p5af8jxzyLuaTnlTC/fEkEk3yRbKtgGpEJrVmCOqP4CjNFHy6MpqLLplT+qUJ95uHRov3iIuMIQxVcoBsx6ctHb26084zdlUlWvesX1zdp4u1KzpO5LGk3KVM5cHWtjamChbNMtA3cqf2JFcTUytvNXJ7B7tSYcxcawLmPXg7N3F4ETa/4ZmZa0pxQ7ctli9/K9pWqIMNFl9AnbOmTJrWmLNlDk41nca06YcX/+uR1F6Die4F6X/Cs9ZLQal9qQCiavDrkXCVaImaoASzyyANk9z4sqYSDku2utRH+xF+v410XSWAZT4oi4ekCH1tlKv1B0MiCqgMGhzWRpjIuUCZv17keK5MNFMlHQpZFHiDrU/cbTPGbF6GPHH9jmlfpqoAWoNurIpQLFgRmBMkfL69yKVdsszlWgSyoXKlkDJJBklgcSDhaSolvpYPc/JTA1RBho0aLxJPKdoljAmUt4oTpX25vKctRkJNyg1yS5MEg8TCuHxTiJqgBYbtGV64yzjPksYEzAbUVQvnkU8l/9p345ZEwaiOIBLF1uoECzUfgXB1VnElIBbyRIkOCQu6pAh0KlQOvR7917uHv87H4LGS0wh/w4tnR6/9y6YZ3KTZx45F0tQsuQlVZGoBhUDWqy9WcrB9HTaXc/3mgOa/xYfQ/diCcpqJq/pM4FiQH1cQRfxqaXHwcRpP/GsA5pvY5K0plKPJShrHJxzAzqPw+spfxQl9uBk6XUwUbTryaCbw/KyOmdJypJMiRMuKWsP6IgHlECL8EpKOjTCEpU15okHNDaboszOlx0et4epgoQkUToXy1sLDsSAAnQaJeEFkkkMykYtpSdKZtGhMp2mZbLLvpa5unM7viXbfRml8dw4PjmSLiU94ID4GVCAquLmq2gXnoXM9pUkKBu2lJ4MqkWxd+Rgy4vFJyRBKU64rwEFKEgPZZLN1qG6Rf/+XIT58piU6WqKU4PPvQ1bwpNHADWruNth7Hid3Rok/VPKAX3EZgSkInprJa4/xlIemUY8xwyKb1YMKoJlN0NC0iulHFAGRW0nzUbLcWpsyjYs4cklu4/9j2ifyxlVP85LFJAEZTPVARTtlt3GqbFXBETZhqUsmUVp7ahREaOIF3xsyUZrDWxQm5RDghRyxAIQlDU67QO0EsXbUtqVIl8+a0cSoNxukIpui1PTOqW8VeYVGaGqvOo862C3BsmWwsWBlGK+SkfLCZIl70EpRXXZhGpnTBEv7bYZfgXWtBvNftC/0G0tGQw6kIk2pcLt0D/u5YjaiNRsRMnUzdhAdkXSMZ0ETiYqg24k4CPk5v7d/q9Bt19U9F+d6XafPn369Olza/4AHTMK9clhnYAAAAAASUVORK5CYII="},function(e,t){e.exports="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMDAwIDE3MSIgd2lkdGg9IjIwMDAiIGhlaWdodD0iMTcxIj4KICA8ZGVmcz4KICAgIDxsaW5lYXJHcmFkaWVudCBpZD0idGV4dEdyYWQiIHgxPSIwJSIgeTE9IjAlIiB4Mj0iMTAwJSIgeTI9IjAlIj4KICAgICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3R5bGU9InN0b3AtY29sb3I6I2ZhZjQ5OTtzdG9wLW9wYWNpdHk6MSIgLz4KICAgICAgPHN0b3Agb2Zmc2V0PSI0NSUiIHN0eWxlPSJzdG9wLWNvbG9yOiNmNjcyYzI7c3RvcC1vcGFjaXR5OjEiIC8+CiAgICAgIDxzdG9wIG9mZnNldD0iMTAwJSIgc3R5bGU9InN0b3AtY29sb3I6IzZmZjllYTtzdG9wLW9wYWNpdHk6MSIgLz4KICAgIDwvbGluZWFyR3JhZGllbnQ+CiAgICA8ZmlsdGVyIGlkPSJnbG93IiB4PSItMTAlIiB5PSItNTAlIiB3aWR0aD0iMTIwJSIgaGVpZ2h0PSIyMDAlIj4KICAgICAgPGZlR2F1c3NpYW5CbHVyIGluPSJTb3VyY2VHcmFwaGljIiBzdGREZXZpYXRpb249IjUiIHJlc3VsdD0iYmx1ciIgLz4KICAgICAgPGZlTWVyZ2U+CiAgICAgICAgPGZlTWVyZ2VOb2RlIGluPSJibHVyIiAvPgogICAgICAgIDxmZU1lcmdlTm9kZSBpbj0iU291cmNlR3JhcGhpYyIgLz4KICAgICAgPC9mZU1lcmdlPgogICAgPC9maWx0ZXI+CiAgPC9kZWZzPgogIDx0ZXh0CiAgICB4PSIxMDAwIgogICAgeT0iMTI1IgogICAgZm9udC1mYW1pbHk9IidUdyBDZW4gTVQnLCAnQ2VudHVyeSBHb3RoaWMnLCBGdXR1cmEsICdUcmVidWNoZXQgTVMnLCBzYW5zLXNlcmlmIgogICAgZm9udC1zaXplPSIxMTAiCiAgICBmb250LXdlaWdodD0iYm9sZCIKICAgIGxldHRlci1zcGFjaW5nPSIxMiIKICAgIHRleHQtYW5jaG9yPSJtaWRkbGUiCiAgICBmaWxsPSJ1cmwoI3RleHRHcmFkKSIKICAgIGZpbHRlcj0idXJsKCNnbG93KSI+dGhyZWUud3M8L3RleHQ+Cjwvc3ZnPgo="},function(e,t,n){var r,i,a={},o=(r=function(){return window&&document&&document.all&&!window.atob},function(){return void 0===i&&(i=r.apply(this,arguments)),i}),s=function(e,t){return t?t.querySelector(e):document.querySelector(e)},c=function(e){var t={};return function(e,n){if("function"==typeof e)return e();if(void 0===t[e]){var r=s.call(this,e,n);if(window.HTMLIFrameElement&&r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(e){r=null}t[e]=r}return t[e]}}(),l=null,u=0,h=[],d=n(202);function p(e,t){for(var n=0;n<e.length;n++){var r=e[n],i=a[r.id];if(i){i.refs++;for(var o=0;o<i.parts.length;o++)i.parts[o](r.parts[o]);for(;o<r.parts.length;o++)i.parts.push(b(r.parts[o],t))}else{var s=[];for(o=0;o<r.parts.length;o++)s.push(b(r.parts[o],t));a[r.id]={id:r.id,refs:1,parts:s}}}}function f(e,t){for(var n=[],r={},i=0;i<e.length;i++){var a=e[i],o=t.base?a[0]+t.base:a[0],s={css:a[1],media:a[2],sourceMap:a[3]};r[o]?r[o].parts.push(s):n.push(r[o]={id:o,parts:[s]})}return n}function m(e,t){var n=c(e.insertInto);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");var r=h[h.length-1];if("top"===e.insertAt)r?r.nextSibling?n.insertBefore(t,r.nextSibling):n.appendChild(t):n.insertBefore(t,n.firstChild),h.push(t);else if("bottom"===e.insertAt)n.appendChild(t);else{if("object"!=typeof e.insertAt||!e.insertAt.before)throw new Error("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n");var i=c(e.insertAt.before,n);n.insertBefore(t,i)}}function g(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e);var t=h.indexOf(e);t>=0&&h.splice(t,1)}function y(e){var t=document.createElement("style");if(void 0===e.attrs.type&&(e.attrs.type="text/css"),void 0===e.attrs.nonce){var r=function(){0;return n.nc}();r&&(e.attrs.nonce=r)}return v(t,e.attrs),m(e,t),t}function v(e,t){Object.keys(t).forEach((function(n){e.setAttribute(n,t[n])}))}function b(e,t){var n,r,i,a;if(t.transform&&e.css){if(!(a="function"==typeof t.transform?t.transform(e.css):t.transform.default(e.css)))return function(){};e.css=a}if(t.singleton){var o=u++;n=l||(l=y(t)),r=E.bind(null,n,o,!1),i=E.bind(null,n,o,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(e){var t=document.createElement("link");return void 0===e.attrs.type&&(e.attrs.type="text/css"),e.attrs.rel="stylesheet",v(t,e.attrs),m(e,t),t}(t),r=_.bind(null,n,t),i=function(){g(n),n.href&&URL.revokeObjectURL(n.href)}):(n=y(t),r=x.bind(null,n),i=function(){g(n)});return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else i()}}e.exports=function(e,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(t=t||{}).attrs="object"==typeof t.attrs?t.attrs:{},t.singleton||"boolean"==typeof t.singleton||(t.singleton=o()),t.insertInto||(t.insertInto="head"),t.insertAt||(t.insertAt="bottom");var n=f(e,t);return p(n,t),function(e){for(var r=[],i=0;i<n.length;i++){var o=n[i];(s=a[o.id]).refs--,r.push(s)}e&&p(f(e,t),t);for(i=0;i<r.length;i++){var s;if(0===(s=r[i]).refs){for(var c=0;c<s.parts.length;c++)s.parts[c]();delete a[s.id]}}}};var w,A=(w=[],function(e,t){return w[e]=t,w.filter(Boolean).join("\n")});function E(e,t,n,r){var i=n?"":r.css;if(e.styleSheet)e.styleSheet.cssText=A(t,i);else{var a=document.createTextNode(i),o=e.childNodes;o[t]&&e.removeChild(o[t]),o.length?e.insertBefore(a,o[t]):e.appendChild(a)}}function x(e,t){var n=t.css,r=t.media;if(r&&e.setAttribute("media",r),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}function _(e,t,n){var r=n.css,i=n.sourceMap,a=void 0===t.convertToAbsoluteUrls&&i;(t.convertToAbsoluteUrls||a)&&(r=d(r)),i&&(r+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(i))))+" */");var o=new Blob([r],{type:"text/css"}),s=e.href;e.href=URL.createObjectURL(o),s&&URL.revokeObjectURL(s)}},function(e,t){e.exports=function(e){var t="undefined"!=typeof window&&window.location;if(!t)throw new Error("fixUrls requires window.location");if(!e||"string"!=typeof e)return e;var n=t.protocol+"//"+t.host,r=n+t.pathname.replace(/\/[^\/]*$/,"/");return e.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,(function(e,t){var i,a=t.trim().replace(/^"(.*)"$/,(function(e,t){return t})).replace(/^'(.*)'$/,(function(e,t){return t}));return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(a)?e:(i=0===a.indexOf("//")?a:0===a.indexOf("/")?n+a:r+a.replace(/^\.\//,""),"url("+JSON.stringify(i)+")")}))}},function(e,t,n){const r='\x3c!-- https://freesound.org/people/deleted_user_2731495/sounds/183881/ --\x3e\n<audio id="introSong" src="assets/sounds/menu.ogg" loop></audio>\n\n\n\n\n<a-scene\n bind__beat-generator="challengeId: challenge.id; difficulty: challenge.difficulty; beatmapCharacteristic: challenge.beatmapCharacteristic; gameMode: gameMode; has3DOFVR: has3DOFVR; hasSongLoadError: hasSongLoadError; isPlaying: isPlaying; isZipFetching: isZipFetching; menuSelectedChallengeId: menuSelectedChallenge.id; songDuration: challenge.metadata.duration; speed: speed"\n bind__beat-system="gameMode: gameMode; hasVR: hasVR; isLoading: isLoading; isPlaying: isPlaying"\n bind__gameover="isGameOver: isGameOver"\n bind__intro-song="isPlaying: menuActive && !menuSelectedChallenge.id; isSearching: isSearching"\n bind__leaderboard="difficulty: menuSelectedChallenge.difficulty || challenge.difficulty; beatmapCharacteristic: menuSelectedChallenge.beatmapCharacteristic || challenge.beatmapCharacteristic; gameMode: gameMode; inVR: inVR; isVictory: isVictory; menuSelectedChallengeId: menuSelectedChallenge.id; challengeId: challenge.id"\n bind__search="difficultyFilter: difficultyFilter; genre: genre; playlist: playlist; query: search.query"\n bind__song="audio: challenge.audio; challengeId: challenge.id; isLoading: isLoading; isPlaying: isPlaying; isBeatsPreloaded: challenge.isBeatsPreloaded; isGameOver: isGameOver; isVictory: isVictory"\n bind__song-preview-system="selectedChallengeId: menuSelectedChallenge.id; selectedChallengeVersion: menuSelectedChallenge.version"\n bind__stage-colors="colorScheme: colorScheme"\n bind__tunnels="isPlaying: isPlaying; songDuration: challenge.metadata.duration"\n bind__zip-loader="difficulties: menuDifficulties; isLoading: isLoading; version: menuSelectedChallenge.version; directDownload: menuSelectedChallenge.directDownload; bpm: menuSelectedChallenge.metadata.bpm"\n animation__gameover="property: object3D.background; type: color; to: #750000; startEvents: gameover"\n agent-picker\n console-shortcuts\n debug-beat-generator\n debug-beat-positioning\n debug-controller\n debug-intro\n debug-song-time\n debug-state\n hack\n gpu-preloader\n \n leaderboard="apiKey: REDACTED_FIREBASE_KEY; authDomain: threews-prod.firebaseapp.com; databaseURL: https://threews-prod.firebaseio.com; projectId: threews-prod; storageBucket: threews-prod.appspot.com; messagingSenderId: 172125624222"\n loading-screen="backgroundColor: #000"\n pool__beat-arrow-blue="mixin: arrowBlueBeat; size: 30; container: #beatContainer; dynamic: true"\n pool__beat-arrow-red="mixin: arrowRedBeat; size: 30; container: #beatContainer; dynamic: true"\n pool__beat-dot-blue="mixin: dotBlueBeat; size: 30; container: #beatContainer; dynamic: true"\n pool__beat-dot-red="mixin: dotRedBeat; size: 30; container: #beatContainer; dynamic: true"\n pool__beat-mine="mixin: mine; size: 30; container: #beatContainer"\n pool__plume-arrow-blue="mixin: arrowBluePlume; size: 30; container: #beatContainer; dynamic: true"\n pool__plume-arrow-red="mixin: arrowRedPlume; size: 30; container: #beatContainer; dynamic: true"\n pool__plume-dot-blue="mixin: dotBluePlume; size: 30; container: #beatContainer; dynamic: true"\n pool__plume-dot-red="mixin: dotRedPlume; size: 30; container: #beatContainer; dynamic: true"\n pool__plume-mine="mixin: minePlume; size: 12; container: #beatContainer; dynamic: true"\n pool__beat-broken-blue="mixin: blueBeatBroken; size: 10; container: #rigContainer; dynamic: true"\n pool__beat-broken-red="mixin: redBeatBroken; size: 10; container: #rigContainer; dynamic: true"\n pool__beat-broken-blue-dot="mixin: blueDotBroken; size: 10; container: #rigContainer; dynamic: true"\n pool__beat-broken-red-dot="mixin: redDotBroken; size: 10; container: #rigContainer; dynamic: true"\n pool__punch-broken-blue-dot="mixin: blueDotPunchBroken; size: 10; container: #rigContainer; dynamic: true"\n pool__punch-broken-red-dot="mixin: redDotPunchBroken; size: 10; container: #rigContainer; dynamic: true"\n pool__beat-broken-mine="mixin: mineBroken; size: 10; container: #rigContainer; dynamic: true"\n pool__beat-fx-blue="mixin: blueBeatFX; size: 10; container: #rigContainer; dynamic: true"\n pool__beat-fx-red="mixin: redBeatFX; size: 10; container: #rigContainer; dynamic: true"\n pool__beat-fx-mine="mixin: mineFX; size: 12; container: #rigContainer; dynamic: true"\n pool__punch-fx-blue="mixin: bluePunchFX; size: 10; container: #rigContainer; dynamic: true"\n pool__punch-fx-red="mixin: redPunchFX; size: 10; container: #rigContainer; dynamic: true"\n pool__punch-fx-mine="mixin: yellowPunchFX; size: 12; container: #rigContainer; dynamic: true"\n pool__tunnels="mixin: tunnel; size: 10; container: #tunnelsContainer; dynamic: true"\n pool__wall="mixin: wall; size: 20; container: #wallContainer; dynamic: true"\n proxy-event__cleargame1="event: gamemenuexit; as: cleargame; to: a-scene"\n proxy-event__cleargame2="event: gamemenurestart; as: cleargame; to: a-scene"\n proxy-event__cleargame3="event: songcomplete; as: cleargame; to: a-scene"\n proxy-event__pausegame="event: pausegame; as: textglowoff; to: a-scene"\n proxy-event__resumegame="event: gamemenuresume; as: textglownormal; to: a-scene"\n play-sound__crescendo="sound: #crescendo; event: victory; volume: 0.75"\n render-order="stage, aurora, sideglow, tunnel, curve, curveshadow, beatShadow, score, beats, menu, menuitem, menubutton, menutext, menugenre, cursor, particles, weapon, victory, stepback"\n stats-param\n tunnels\n vr-mode-ui="enterVRButton: #vrButton">\n\n <a-assets timeout="3000">\n \x3c!-- <require path="/workspaces/3D-Agent/rider/src/assets.html"> --\x3e\n<a-asset-item id="VigaRegularThree" src="assets/fonts/Viga-Regular-Three.json"></a-asset-item>\n<a-asset-item id="agentGlb" src="https://raw.githubusercontent.com/overstepping/-/main/cz.glb"></a-asset-item>\n\n<a-asset-item id="arrowredObj" src="assets/models/arrowred.obj"></a-asset-item>\n<a-asset-item id="arrowblueObj" src="assets/models/arrowblue.obj"></a-asset-item>\n<a-asset-item id="beatObj" src="assets/models/beat.obj"></a-asset-item>\n<a-asset-item id="laserObj" src="assets/models/laser/laser.obj"></a-asset-item>\n\n<a-asset-item id="tunnelObj" src="assets/models/tunnel.obj"></a-asset-item>\n<a-asset-item id="redBeatObj" src="assets/models/redbeat.obj"></a-asset-item>\n<a-asset-item id="blueBeatObj" src="assets/models/bluebeat.obj"></a-asset-item>\n<a-asset-item id="dotRedObj" src="assets/models/dotred.obj"></a-asset-item>\n<a-asset-item id="dotBlueObj" src="assets/models/dotblue.obj"></a-asset-item>\n<a-asset-item id="backGlowObj" src="assets/models/backglow.obj"></a-asset-item>\n<a-asset-item id="aurorasObj" src="assets/models/auroras.obj"></a-asset-item>\n<a-asset-item id="merkabaObj" src="assets/models/merkaba.obj"></a-asset-item>\n<a-asset-item id="ringsObj" src="assets/models/rings.obj"></a-asset-item>\n<a-asset-item id="homeObj" src="assets/models/home.obj"></a-asset-item>\n<a-asset-item id="homeShadowObj" src="assets/models/homeshadow.obj"></a-asset-item>\n<a-asset-item id="weaponObj" src="assets/models/weapon.obj"></a-asset-item>\n<a-asset-item id="weaponHandleObj" src="assets/models/weaponhandle.obj"></a-asset-item>\n<a-asset-item id="weaponGlowObj" src="assets/models/weaponglow.obj"></a-asset-item>\n<a-asset-item id="beatBrokenObj" src="assets/models/beatbroken.obj"></a-asset-item>\n<a-asset-item id="dotBrokenObj" src="assets/models/dotbroken.obj"></a-asset-item>\n<a-asset-item id="dotPunchBrokenObj" src="assets/models/dotbroken.gltf"></a-asset-item>\n<a-asset-item id="cutfxObj" src="assets/models/cutfx.obj"></a-asset-item>\n<a-asset-item id="punchfxObj" src="assets/models/punchfx.obj"></a-asset-item>\n<a-asset-item id="leftFistObj" src="assets/models/leftfist.obj"></a-asset-item>\n<a-asset-item id="leftFistWeaponObj" src="assets/models/leftfistweapon.obj"></a-asset-item>\n<a-asset-item id="rightFistObj" src="assets/models/rightfist.obj"></a-asset-item>\n<a-asset-item id="rightFistWeaponObj" src="assets/models/rightfistweapon.obj"></a-asset-item>\n<a-asset-item id="plumeObj" src="assets/models/plume.obj"></a-asset-item>\n\n<a-asset-item id="mineObj" src="assets/models/mine.obj"></a-asset-item>\n<a-asset-item id="mineBrokenObj" src="assets/models/minebroken.gltf"></a-asset-item>\n\n\x3c!--\n https://freesound.org/people/juskiddink/sounds/70043/\n https://freesound.org/people/Robinhood76/sounds/337436/\n--\x3e\n<audio id="confirmSound" src="assets/sounds/beatHit.ogg"></audio>\n<audio id="clearSound" src="assets/sounds/clear.ogg"></audio>\n<audio id="hoverSound" src="assets/sounds/hover.ogg"></audio>\n<audio id="victorySound" src="assets/sounds/victory.ogg"></audio>\n<audio id="crescendo" src="assets/sounds/crescendo.ogg"></audio>\n\n\n<audio id="hitSound1" src="assets/sounds/hit1.ogg"></audio>\n<audio id="hitSound1left" src="assets/sounds/hit1left.ogg"></audio>\n<audio id="hitSound1right" src="assets/sounds/hit1right.ogg"></audio>\n\n<audio id="hitSound2" src="assets/sounds/hit2.ogg"></audio>\n<audio id="hitSound2left" src="assets/sounds/hit2left.ogg"></audio>\n<audio id="hitSound2right" src="assets/sounds/hit2right.ogg"></audio>\n\n<audio id="hitSound3" src="assets/sounds/hit3.ogg"></audio>\n<audio id="hitSound3left" src="assets/sounds/hit3left.ogg"></audio>\n<audio id="hitSound3right" src="assets/sounds/hit3right.ogg"></audio>\n\n<audio id="hitSound4" src="assets/sounds/hit4.ogg"></audio>\n<audio id="hitSound4left" src="assets/sounds/hit4left.ogg"></audio>\n<audio id="hitSound4right" src="assets/sounds/hit4right.ogg"></audio>\n\n<audio id="hitSound5" src="assets/sounds/hit5.ogg"></audio>\n<audio id="hitSound5left" src="assets/sounds/hit5left.ogg"></audio>\n<audio id="hitSound5right" src="assets/sounds/hit5right.ogg"></audio>\n\n<audio id="hitSound6" src="assets/sounds/hit6.ogg"></audio>\n<audio id="hitSound6left" src="assets/sounds/hit6left.ogg"></audio>\n<audio id="hitSound6right" src="assets/sounds/hit6right.ogg"></audio>\n\n<audio id="hitSound7" src="assets/sounds/hit7.ogg"></audio>\n<audio id="hitSound7left" src="assets/sounds/hit7left.ogg"></audio>\n<audio id="hitSound7right" src="assets/sounds/hit7right.ogg"></audio>\n\n<audio id="hitSound8" src="assets/sounds/hit8.ogg"></audio>\n<audio id="hitSound8left" src="assets/sounds/hit8left.ogg"></audio>\n<audio id="hitSound8right" src="assets/sounds/hit8right.ogg"></audio>\n\n<audio id="hitSound9" src="assets/sounds/hit9.ogg"></audio>\n<audio id="hitSound9left" src="assets/sounds/hit9left.ogg"></audio>\n<audio id="hitSound9right" src="assets/sounds/hit9right.ogg"></audio>\n\n<audio id="hitSound10" src="assets/sounds/hit10.ogg"></audio>\n<audio id="hitSound10left" src="assets/sounds/hit10left.ogg"></audio>\n<audio id="hitSound10right" src="assets/sounds/hit10right.ogg"></audio>\n\n\n<img id="cursorMeshImg" src="assets/models/laser/laser.png">\n<img id="downIconImg" src="assets/img/downIcon.png">\n<img id="envmapTemplateImg" src="assets/img/envmap.png">\n<img id="envmapImg">\n<img id="favoriteImg" src="assets/img/favorite.png">\n<img id="sliceImg" src="assets/img/slice.png">\n<img id="stepbackImg" src="assets/img/stepback.png">\n<img id="soundboxingImg" src="assets/img/soundboxing.jpg">\n<img id="genresImg" src="assets/img/genres.png">\n<img id="starImg" src="assets/img/star.png">\n<img id="merkabaBloomImg" src="assets/img/merkababloom.png">\n<img id="homeShadowImg" src="assets/img/homeshadow.jpg">\n<img id="backGlowImg" src="assets/img/backglow.png">\n<img id="weaponImg" src="assets/img/weapon.jpg">\n<img id="weapon2Img" src="assets/img/weapon2.jpg">\n<img id="weaponHandleImg" src="assets/img/weaponhandle.png">\n<img id="difficultyImg" src="assets/img/difficulty.png">\n<img id="selectedImg" src="assets/img/selected.png">\n<img id="cutfxImg" src="assets/img/cutfx.png">\n\x3c!--\n<img id="cutFxTemplateImg" src="assets/img/cutfx.png">\n<img id="cutFxImg">\n--\x3e\n<img id="minefxImg" src="assets/img/minefx.png">\n<img id="sideglowImg" src="assets/img/sideglow.png">\n<img id="logoImg" src="assets/img/logo.svg">\n<img id="moonImg" src="assets/img/moon.png">\n<img id="plumeImg" src="assets/img/plume.png">\n<img id="tubeImg" src="assets/img/tube.png">\n<img id="tubeColorImg" src="assets/img/tube.jpg">\n<img id="handStarTrailImg" src="assets/img/handstartrail.png">\n\n<img id="modeRideImg" src="assets/img/moderide.jpg">\n<img id="modeClassicImg" src="assets/img/modeclassic.jpg">\n<img id="modePunchImg" src="assets/img/modepunch.jpg">\n<img id="modeViewerImg" src="assets/img/modeviewer.jpg">\n\n<a-mixin id="slice" slice9="color: #050505; transparent: true; opacity: 0.9; src: #sliceImg; left: 50; right: 52; top: 50; bottom: 52; padding: 0.18"></a-mixin>\n<a-mixin id="font" text="font: assets/fonts/Viga-Regular.json; shader: msdf; letterSpacing: 1"></a-mixin>\n\n<a-mixin id="superKeyboardTextInput" mixin="font"></a-mixin>\n\n<a-mixin id="beat"></a-mixin>\n<a-mixin id="beatBlock"></a-mixin>\n<a-mixin id="beatSign"></a-mixin>\n\n<a-mixin id="arrowBlueBeat" mixin="beat" beat="color: blue; type: arrow"></a-mixin>\n<a-mixin id="arrowRedBeat" mixin="beat" beat="color: red; type: arrow"></a-mixin>\n<a-mixin id="dotBlueBeat" mixin="beat" beat="color: blue; type: dot"></a-mixin>\n<a-mixin id="dotRedBeat" mixin="beat" beat="color: red; type: dot"></a-mixin>\n<a-mixin id="mine" mixin="beat" beat="type: mine"></a-mixin>\n<a-mixin id="beatShadow" mixin="beat" geometry="primitive: plane; width: 0.7; height: 0.6" rotation="-90 0 0" material="src: #minefxImg; shader: flat; color: #000; transparent: true; opacity: 0.2" render-order="beatShadow"></a-mixin>\n\n<a-mixin id="plume" plume obj-model="obj: #plumeObj"></a-mixin>\n<a-mixin id="arrowBluePlume" mixin="plume" plume="type: arrow; color: blue" materials="name: arrowBluePlume"></a-mixin>\n<a-mixin id="arrowRedPlume" mixin="plume" plume="type: arrow; color: red" materials="name: arrowRedPlume"></a-mixin>\n<a-mixin id="dotBluePlume" mixin="plume" plume="type: dot; color: blue" materials="name: dotBluePlume"></a-mixin>\n<a-mixin id="dotRedPlume" mixin="plume" plume="type: dot; color: red" materials="name: dotRedPlume"></a-mixin>\n<a-mixin id="minePlume" mixin="plume" plume="type: mine" materials="name: minePlume"></a-mixin>\n\n<a-mixin\n id="superCut"\n bind__supercutfx="colorPrimary: colorPrimary; colorSecondary: colorSecondary"\n supercutfx\n geometry="primitive: plane; width: 3; height: 3"\n material="shader: superCutFxShader; transparent: true; depthWrite: false"></a-mixin>\n\n<a-mixin\n id="redBeatBroken"\n obj-model="obj: #beatBrokenObj"\n beat-cut-fx="color: red"\n render-order="beats"></a-mixin>\n<a-mixin\n id="blueBeatBroken"\n obj-model="obj: #beatBrokenObj"\n beat-cut-fx="color: blue"\n render-order="beats"></a-mixin>\n<a-mixin\n id="redDotBroken"\n obj-model="obj: #dotBrokenObj"\n beat-cut-fx="color: red; type: dot"\n render-order="beats"></a-mixin>\n<a-mixin\n id="blueDotBroken"\n obj-model="obj: #dotBrokenObj"\n beat-cut-fx="color: blue; type: dot"\n render-order="beats"></a-mixin>\n\n<a-mixin\n id="redDotPunchBroken"\n gltf-model="#dotPunchBrokenObj"\n beat-cut-fx="color: red; type: dot"\n render-order="beats"></a-mixin>\n<a-mixin\n id="blueDotPunchBroken"\n gltf-model="#dotPunchBrokenObj"\n beat-cut-fx="color: blue; type: dot"\n render-order="beats"></a-mixin>\n\n<a-mixin\n id="redBeatFX"\n bind__material="color: colorPrimary"\n obj-model="obj: #cutfxObj"\n material="shader: cutfxShader; progress: 1"\n render-order="menu"\n animation="property: components.material.material.uniforms.progress.value; from: 0; to: 1; dur: 400; loop: false; easing: linear; startEvents: explode"></a-mixin>\n\n<a-mixin\n id="blueBeatFX"\n bind__material="color: colorSecondary"\n obj-model="obj: #cutfxObj"\n material="shader: cutfxShader; progress: 1"\n render-order="menu"\n animation="property: components.material.material.uniforms.progress.value; from: 0; to: 1; dur: 400; loop: false; easing: linear; startEvents: explode"></a-mixin>\n\n<a-mixin\n id="mineBroken"\n gltf-model="#mineBrokenObj"\n beat-cut-fx="type: mine"\n render-order="beats"></a-mixin>\n\n<a-mixin\n id="mineFX"\n geometry="primitive: plane; width: 0.6; height: 0.6"\n material="shader: flat; transparent: true; src: #minefxImg; color: #fff568; depthWrite: false"\n render-order="menu"\n animation="property: components.material.material.opacity; from:1; to:0; dur: 400; loop: false; easing: linear; startEvents: explode"></a-mixin>\n\n<a-mixin\n id="redPunchFX"\n bind__material="color: colorPrimary"\n obj-model="obj: #punchfxObj"\n material="shader: cutfxShader; progress: 1"\n render-order="menu"\n animation="property: components.material.material.uniforms.progress.value; from: 0; to: 1; dur: 600; loop: false; easing: linear; startEvents: explode"></a-mixin>\n\n<a-mixin\n id="bluePunchFX"\n bind__material="color: colorSecondary"\n obj-model="obj: #punchfxObj"\n material="shader: cutfxShader; progress: 1"\n render-order="menu"\n animation="property: components.material.material.uniforms.progress.value; from: 0; to: 1; dur: 600; loop: false; easing: linear; startEvents: explode"></a-mixin>\n\n<a-mixin\n bind__material="color: colorTertiary"\n id="yellowPunchFX"\n obj-model="obj: #punchfxObj"\n material="shader: cutfxShader; progress: 1"\n render-order="menu"\n animation="property: components.material.material.uniforms.progress.value; from: 0; to: 1; dur: 600; loop: false; easing: linear; startEvents: explode"></a-mixin>\n\n<a-mixin\n id="wall"\n material="shader: wallShader; transparent: true; side: double; opacity: 0"\n animation__fadein="property: components.material.material.uniforms.opacity.value; from: 0; to: 1; easing: easeInCubic; autoplay: false; dur: 1500"\n animation__scalein="property: object3D.position.y; from: -5; to: 0; easing: easeInOutElastic; autoplay: false; dur: 1500"\n render-order\n wall></a-mixin>\n\n<a-mixin\n id="tunnel"\n obj-model="obj: #tunnelObj"\n materials="name: tunnel"></a-mixin>\n\n<a-mixin\n id="bigMenuButton"\n geometry="primitive: plane; width: 1.15; height: 0.23"\n material="shader: panelShader; brightness: 0.5; borderWidth: 0.05; ratio: 4; borderRadius: 0.6"\n animation__mouseenter1="property: components.material.material.uniforms.activePanel.value; from: 0; to: 1; startEvents: mouseenter; pauseEvents: mouseleave; dur: 100"\n animation__mouseleave1="property: components.material.material.uniforms.activePanel.value; from: 1; to: 0; startEvents: mouseleave; pauseEvents: mouseenter; dur: 100"\n animation__mouseenter2="property: scale; from: 1 1 1; to: 1.04 1.04 1.04; startEvents: mouseenter; pauseEvents: mouseleave; dur: 80"\n animation__mouseleave2="property: scale; to: 1 1 1; from: 1.04 1.04 1.04; startEvents: mouseleave; pauseEvents: mouseenter; dur: 80"\n render-order="menubutton"></a-mixin>\n\n<a-mixin id="cancelSoundUI" play-sound__cancel="event: click; sound: #clearSound; volume: 0.5"></a-mixin>\n<a-mixin id="clickSoundUI" play-sound__click="event: click; sound: #confirmSound; volume: 0.25"></a-mixin>\n<a-mixin id="hoverSoundUI" play-sound__hover="event: mouseenter; sound: #hoverSound; volume: 0.1"></a-mixin>\n\x3c!-- </require> --\x3e</require>\n </a-assets>\n\n <a-entity id="beatObjTemplate" obj-model="obj: #beatObj" visible="false"></a-entity>\n <a-entity id="redBeatObjTemplate" obj-model="obj: #redBeatObj" visible="false"></a-entity>\n <a-entity id="blueBeatObjTemplate" obj-model="obj: #blueBeatObj" visible="false"></a-entity>\n <a-entity id="dotRedObjTemplate" obj-model="obj: #dotRedObj" visible="false"></a-entity>\n <a-entity id="dotBlueObjTemplate" obj-model="obj: #dotBlueObj" visible="false"></a-entity>\n <a-entity id="mineObjTemplate" obj-model="obj: #mineObj" visible="false"></a-entity>\n <a-entity id="cursorLaser" obj-model="obj: #laserObj" visible="false"></a-entity>\n\n \x3c!-- <require path="/workspaces/3D-Agent/rider/src/templates/loading.html"> --\x3e\n<a-entity\n id="loadingSongInfoContainer"\n bind__animation__scale="enabled: isLoading"\n bind__visible="isLoading"\n animation__scale="property: scale; from: 1 1 1; to: 1.05 1.05 1.05; dir: alternate; loop: true; dur: 1200; easing: easeInOutCubic"\n position="0 1.5 -2">\n\n <a-entity\n id="loadingMenuBackground"\n bind-toggle__raycastable="isLoading"\n render-order="menu"\n geometry="primitive: plane; width: 1.15; height: 1.2"\n material="shader: panelShader; ratio: 1.15; borderRadius: 0.4"\n position="0 0 -0.03"></a-entity>\n\n <a-entity id="loadingSongImage"\n copy-texture="from: #menuSelectedChallengeImage"\n geometry="primitive: plane; buffer: false; skipCache: true; height: 0.3; width: 0.3"\n material="shader: flat; transparent: false"\n position="0 0.24 0"\n render-order="menu"></a-entity>\n\n <a-entity id="loadingSongInfo">\n <a-entity\n position="0 -0.05 0"\n mixin="font"\n bind__text="color: colorSecondary"\n bind__text-truncate="value: challenge.songSubName + \' - \' + challenge.author"\n text="wrapCount: 40; align: center"\n text-truncate="length: 35"\n render-order="menutext"></a-entity>\n\n <a-entity position="0 -0.13 0"\n mixin="font"\n text="align: center; color: #FFF; wrapCount: 21; baseline: top; lineHeight: 36; width: 0.81"\n bind__text="value: challenge.metadata.songName"\n render-order="menutext"></a-entity>\n\n <a-entity\n id="loadingText"\n mixin="font"\n bind__animation__color="enabled: isLoading"\n bind__text="color: colorPrimary; value: loadingText; wrapCount: hasSongLoadError && 24 || 18"\n bind__visible="isLoading"\n text="align: center; wrapCount: 18; width: 0.65"\n render-order="menutext"\n position="0 -0.32 0.001"></a-entity>\n\n <a-entity\n id="zipLoaderIndicator"\n bind__material="color: colorPrimary"\n bind__visible="isZipFetching"\n geometry="primitive: plane; height: 0.1; width: 0.1"\n material="shader: ring; radiusInner: 0.2; radiusOuter: 0.9; progress: 0; transparent: true"\n render-order="menuitem"\n position="0 -0.4 0.002">\n </a-entity>\n\n <a-entity\n id="songProcessingIndicator"\n bind__animation__spin="enabled: isSongProcessing"\n bind__material="color: colorPrimary"\n bind__visible="isSongProcessing"\n animation__spin="property: object3D.rotation.z; from: 0; to: -360; easing: linear; dur: 1000; loop: true"\n geometry="primitive: plane; height: 0.15; width: 0.15"\n material="shader: ring; radiusInner: 0.2; radiusOuter: 0.4; transparent: true; progress: 0.2"\n render-order="menutext"\n position="0 -0.4 0.004"\n visible="false">\n </a-entity>\n\n <a-entity\n id="loadingCancelButton"\n mixin="bigMenuButton"\n bind-toggle__raycastable="isLoading"\n position="0 -0.67 0.01"\n proxy-event="event: click; to: a-scene; as: songloadcancel">\n <a-entity mixin="font" text="align: center; color: #FAFAFA; wrapCount: 20; value: CANCEL" position="0 -0.065 0.001"></a-entity>\n </a-entity>\n </a-entity>\n</a-entity>\n\x3c!-- </require> --\x3e</require>\n \x3c!-- <require path="/workspaces/3D-Agent/rider/src/templates/stage.html"> --\x3e\n<a-entity\n id="audioAnalyser"\n audioanalyser="fftSize: 32; enableBeatDetection: false; enableLevels: false; enableWaveform: false; enableVolume: false"></a-entity>\n\n<a-entity id="stage" no-frustum-cull follow-z="target: #curveFollowRig">\n <a-entity\n id="backglow"\n obj-model="obj: #backGlowObj"\n materials="name: backglow"\n render-order="stage"></a-entity>\n\n <a-entity\n id="rings"\n obj-model="obj: #ringsObj"\n materials="name: rings"\n position="0 0 -1500"\n render-order="stage"></a-entity>\n\n <a-entity\n id="auroras"\n class="aurora"\n obj-model="obj: #aurorasObj"\n materials="name: aurora"\n render-order="aurora"></a-entity>\n\n <a-entity\n id="merkaba"\n obj-model="obj: #merkabaObj"\n bind__visible="!isVictory && !isGameOver"\n materials="name: merkaba"\n animation="property: rotation; from: 0 0 0; to: 360 360 360; dur: 50000; easing: linear; loop: true"\n position="0 46 -1500"></a-entity>\n\n <a-entity\n class="merkababloom"\n geometry="primitive: plane; width: 200; height: 200"\n material="shader: flat; src: #merkabaBloomImg; blending: additive; depthTest: false; color: #888"\n position="0 46 -1400"\n render-order="stage"></a-entity>\n\n <a-entity\n class="merkababloom"\n bind__material="color: colorTertiary"\n geometry="primitive: plane; width: 250; height: 250"\n animation="property: object3D.rotation.z; from: 0; to: 360; loop: true; easing: linear; dur: 30000"\n material="shader: flat; src: #merkabaBloomImg; blending: additive; depthTest: false"\n position="0 46 -1380"\n render-order="stage"></a-entity>\n\n <a-entity\n id="moon"\n geometry="primitive: plane; width: 1000; height: 500"\n position="0 1000 -1000"\n rotation="45 0 0"\n materials="name: moon"\n ></a-entity>\n\n <a-entity class="stars" stars render-order="particles"></a-entity>\n\n \x3c!-- <require path="/workspaces/3D-Agent/rider/src/templates/intro.html"> --\x3e\n<a-entity\n id="mainLogo"\n geometry="primitive: plane; width: 9; height: 1.125"\n material="shader: flat; src: #logoImg; transparent: true; depthTest: false; blending: additive; opacity: 0"\n position="0 3.3 -2.5"\n rotation="0 0 0"\n scale="0.8 0.8 0.8"\n bind__visible="introActive || menuActive"\n animation__opacity="property: components.material.material.opacity; from: 0; to: 1; dur: 2000; delay: 1000"\n animation__position="property: object3D.position.y; to: 3.4; dur: 2000; easing: easeInOutQuad; startEvents: startgame"></a-entity>\n\n<a-entity\n id="startButton"\n bind__visible-raycastable="introActive"\n geometry="primitive: plane; width: 1; height: 0.35"\n position="0 1.6 -2.2"\n render-order="menu"\n proxy-event="event: click; to: a-scene, #menu, #mainlogo, #menuTopButtons, #menuBackground; as: startgame"\n delayed-proxy-event="event: click; to: a-scene; as: menuopeningend; delay: 1800"\n mixin="bigMenuButton"\n play-sound__hover="event: mouseenter; sound: #hoverSound; volume: 0.1"\n play-sound__click="event: click; sound: #confirmSound; volume: 0.25"\n material="ratio: 3; opacity: 0"\n animation="property: components.material.material.uniforms.opacity.value; from: 0; to: 1; dur: 500; delay: 3000">\n <a-entity\n id="startButtonLabel"\n mixin="font"\n text="value: BEGIN; color: #f0f0f0; align: center; width: 1; wrapCount: 12; opacity: 0"\n position="0 -0.1 0.01"\n animation="property: components.text.material.uniforms.opacity.value; from: 0; to: 1; dur: 500; delay: 3500"\n ></a-entity>\n</a-entity>\n\x3c!-- </require> --\x3e</require>\n</a-entity>\n\x3c!-- </require> --\x3e</require>\n \x3c!-- <require path="/workspaces/3D-Agent/rider/src/templates/menu.html"> --\x3e\n\x3c!-- Macro is a templating function. It is rendered into the HTML below with searchResults(). --\x3e\n\n\n\n<template id="searchResultTemplate">\n <a-entity class="searchResult" bind-item__data-id="item.id" bind-item__data-index="item.index">\n <a-entity class="searchResultBackground" bind-item__active-item="active: menuSelectedChallenge.id === item.id"\n bind-item__animation__mouseenter="enabled: menuSelectedChallenge.id !== item.id"\n bind-item__animation__mouseleave="enabled: menuSelectedChallenge.id !== item.id"\n bind-toggle__raycastable="mainMenuActive || isSearching" bind__material="color: colorPrimary"\n animation__mouseenter="property: components.material.material.opacity; to: 0.4; startEvents: mouseenter; pauseEvents: mouseleave; dur: 75; delay: 1"\n animation__mouseleave="property: components.material.material.opacity; to: 0.0; startEvents: mouseleave; pauseEvents: mouseenter; dur: 75"\n geometry="primitive: plane; width: 1.1; height: 0.2"\n material="shader: flat; transparent: true; opacity: 0.0; src: #selectedImg" position="0 -0.13 -0.002"\n play-sound="event: mouseenter; sound: #hoverSound; volume: 0.03" render-order="menuitem"></a-entity>\n </a-entity>\n </a-entity>\n</template>\n\n\n\x3c!-- Menu container begins here. --\x3e\n<a-entity id="menu" bind__visible="menuActive" position="0 1.4 -2.3"\n animation__position="property: object3D.position.z; to: -2; dur: 1500; easing: easeInOutCubic; delay: 300; startEvents: startgame">\n\n <a-entity id="menuBackground"\n bind__menu-midsection="active: !!menuSelectedChallenge.id && (mainMenuActive || difficultyFilterMenuOpen) || difficultyFilterMenuOpen; selectedChallenge: menuSelectedChallenge.id"\n bind-toggle__raycastable="menuActive || genreMenuOpen || isSearching || difficultyFilterMenuOpen"\n geometry="primitive: plane; width: 3.4; height: 1.82" material="shader: panelShader; ratio: 1.86; opacity: 0"\n animation__opacity="property: components.material.material.uniforms.opacity.value; from: 0; to: 1; dur: 1000; delay: 300; startEvents: startgame"\n animation__midsectionshow="property: components.material.material.uniforms.midSection.value; from: 0; to: 1; dur: 160; startEvents: showdifficultysection; easing: easeOutCubic"\n animation__midsectionhide="property: components.material.material.uniforms.midSection.value; from: 1: to: 0; dur: 160; startEvents: hidedifficultysection; easing: easeOutCubic"\n render-order="menu" position="0 0 -0.005"></a-entity>\n\n <a-entity id="mainMenu" bind__visible="mainMenuActive && !isMenuOpening || isSearching">\n <a-entity id="searchResultsContainer" position="0 0 0.001" class="menuAnimation"\n bind__menu-slide-animation="isSearching: isSearching; menuSelectedChallengeId: menuSelectedChallenge.id"\n animation__menuleft="property: object3D.position.x; to: -0.79; dur: 200; easing: easeOutCubic; autoplay: false"\n animation__menuright="property: object3D.position.x; from: -0.79; to: 0; dur: 200; easing: easeOutCubic; autoplay: false">\n\n \n\x3c!-- TODO: Sort the layout based on the IDs. --\x3e\n<a-entity id="searchResultList"\n bind-for="for: item; in: searchResultsPage; key: id; template: #searchResultTemplate; updateInPlace: true; pool: 6; delay: 25"\n layout="type: box; columns: 1; marginRow: -0.2; orderAttribute: data-index" search-result-list position="0 0.644 0">\n</a-entity>\n\n\x3c!-- All search result text merged and spaced out. --\x3e\n<a-entity id="searchSongNameTexts" mixin="font" bind__text="value: search.songNameTexts" render-order="menutext"\n text="baseline: top; align: left; color: #FAFAFA; wrapCount: 28; lineHeight: 130" position="0.181 0.51943 0.001">\n</a-entity>\n<a-entity id="searchSongSubNameTexts" mixin="font"\n bind__text="color: colorSecondaryBright; value: search.songSubNameTexts" render-order="menutext"\n text="baseline: top; align: left; wrapCount: 42; lineHeight: 190" position="0.181 0.445 0.001">\n</a-entity>\n\n<a-entity id="searchThumbnailImages" bind__search-thumbnail-atlas="dummyUpdater: search.songSubNameTexts"\n bind__visible="searchResultsPage.length > 0" geometry="primitive: plane; buffer: false; width: 0.2; height: 1.2"\n dynamic-texture-atlas="canvasId: thumbnailAtlasMap; canvasWidth: 64; canvasHeight: 512; numColumns: 1; numRows: 6"\n material="shader: flat; transparent: true" render-order="menubutton" position="-0.45 0.0146 0.002"></a-entity>\n\n<a-mixin id="searchPageButton"\n animation__mouseenter="property: components.slice9.material.opacity; from: 0; to: 0.3; startEvents: mouseenter; pauseEvents: mouseleave; dur: 150"\n animation__mouseleave="property: components.slice9.material.opacity; from: 0.3; to: 0; startEvents: mouseleave; pauseEvents: mouseenter; dur: 150"\n mixin="slice" raycaster-target="width: 1; height: 0.32" render-order="menubutton"\n slice9="width: 0.8; color: #08bfa2; height: 0.130; padding: 0.03; opacity: 0"></a-mixin>\n\n<a-entity id="searchPrevPage" mixin="searchPageButton" bind__slice9="color: colorPrimary"\n bind__visible-raycastable="search.hasPrev && (mainMenuActive || isSearching)"\n raycaster-target="bindToggle: search.hasNext && menuActive; position: 0 0.08 0" position="-0 0.69 0.01"\n proxy-event="event: click; to: a-scene; as: searchprevpage; captureBubbles: true">\n <a-entity id="prevArrow" bind__material="color: colorPrimary" geometry="primitive: plane; width: 0.12; height: 0.12"\n material="shader: flat; src: #downIconImg; transparent: true" rotation="0 0 180" position="0 0 -0.001"></a-entity>\n</a-entity>\n\n<a-entity id="searchNextPage" mixin="searchPageButton" bind__slice9="color: colorSecondary"\n raycaster-target="bindToggle: search.hasNext && (mainMenuActive || isSearching); position: 0 -0.08 0"\n position="-0 -0.674 0.01" proxy-event="event: click; to: a-scene; as: searchnextpage; captureBubbles: true"\n bind__visible="search.hasNext">\n <a-entity id="nextArrow" bind__material="color: colorSecondary" geometry="primitive: plane; width: 0.12; height: 0.12"\n material="shader: flat; src: #downIconImg; transparent: true" position="0 0 -0.001"></a-entity>\n</a-entity>\n\n </a-entity>\n\n <a-entity id="menuDifficultiesGroup" position="0 0.18 0">\n\n \x3c!-- Top-aligned. --\x3e\n \x3c!-- Uses bind-for and bind-item to render difficulties. --\x3e\n <a-entity id="menuDifficulties" bind-for="for: item; in: menuDifficultiesIds; updateInPlace: true; pool: 10"\n bind__visible="!!menuSelectedChallenge.id"\n layout="type: box; columns: 1; marginRow: -0.2; orderAttribute: data-bind-for-key" position="0 0.34 0"\n menu-difficulty-select>\n \n <template>\n \x3c!-- Item is a string representing the difficulty. --\x3e\n <a-entity class="difficultyOption" bind-item__data-difficulty="item">\n <a-entity class="difficultyBackground"\n bind-item__active-item="active: (menuSelectedChallenge.difficultyId === item)"\n bind-item__animation__mouseenter="enabled: !(menuSelectedChallenge.difficultyId === item)"\n bind-item__animation__mouseleave="enabled: !(menuSelectedChallenge.difficultyId === item)"\n bind-item__difficulty-background="enabled: menuActive && !!menuSelectedChallenge.id && !(menuSelectedChallenge.difficultyId === item) && !difficultyFilterMenuOpen"\n bind__material="color: colorPrimary" geometry="primitive: plane; width: 0.4; height: 0.2"\n material="shader: flat; transparent: true; opacity: 0.0; src: #difficultyImg" position="0 -0.005 0"\n play-sound="event: mouseenter; sound: #hoverSound; volume: 0.03"\n animation__mouseenter="property: components.material.material.opacity; to: 0.3; startEvents: mouseenter; pauseEvents: mouseleave; dur: 75"\n event-set__mouseenter="visible: true"\n animation__mouseleave="property: components.material.material.opacity; to: 0.0; startEvents: mouseleave; pauseEvents: mouseenter; dur: 75"\n event-set__mouseleave="visible: true; _delay: 160" render-order="menuitem"></a-entity>\n <a-entity class="difficultyText" mixin="font"\n bind-item__active-text-color="active: (menuSelectedChallenge.difficultyId === item)"\n bind-item__difficulty-text="id: item" active-text-color="color: #fff"\n text="wrapCount: 30; align: center; color: #8d8d8d" position="0 -0.057 0.001" render-order="menutext">\n </a-entity>\n </a-entity>\n </template>\n \n </a-entity>\n </a-entity>\n\n \x3c!-- Selected challenge info. --\x3e\n <a-entity id="menuSelectedChallengePanel" bind__visible="!!menuSelectedChallenge.id"\n position="0.8394583182784089 0 0.001">\n <a-entity id="menuFavoriteButton" bind__animation__mouseenter="to: menuSelectedChallenge.isFavorited && 0.25 || 1"\n bind__animation__mouseleave="to: menuSelectedChallenge.isFavorited && 1 || 0.25"\n bind__material="color: colorTertiary; opacity: menuSelectedChallenge.isFavorited && 1 || 0.25"\n bind__raycastable="menuActive && !!menuSelectedChallenge.id"\n animation__mouseenter="property: components.material.material.opacity; startEvents: mouseenter; dur: 150; easing: easeInOutCubic"\n animation__mouseleave="property: components.material.material.opacity; startEvents: mouseleave; dur: 100; easing: easeInOutCubic"\n geometry="primitive: plane; width: 0.1; height: 0.1"\n material="src: #favoriteImg; shader: flat; transparent: true; opacity: 0.25"\n play-sound__hover="event: mouseenter; sound: #hoverSound; volume: 0.1" position="0.46 0.68 0.001"\n proxy-event="event: click; to: a-scene; as: favoritetoggle" render-order="menuitem"></a-entity>\n\n <a-entity id="menuSelectedChallengeImage"\n bind__menu-selected-challenge-image="coverURL: menuSelectedChallenge.coverURL"\n geometry="primitive: plane; height: 0.4; width: 0.4" material="shader: flat" position="0 0.42 0"></a-entity>\n\n <a-entity id="menuSelectedChallengeInfoContainer" position="0 0.058 0">\n <a-entity id="menuSelectedChallengeSongAuthor" mixin="font"\n bind__text="color: colorSecondaryBright; value: (menuSelectedChallenge.metadata.songSubName || menuSelectedChallenge.metadata.songAuthorName || \'Unknown Artist\')" position="0 0.042 0"\n render-order="menutext" text="wrapCount: 40; lineHeight: 40; width: 1.185; align: center; baseline: center">\n </a-entity>\n <a-entity id="menuSelectedChallengeSongName" mixin="font"\n bind__text="color: colorPrimary; value: menuSelectedChallenge.metadata.songName" position="0 -0.059 0"\n render-order="menutext" text="align: center; wrapCount: 31; baseline: top; lineHeight: 36; width: 1.4">\n </a-entity>\n <a-entity id="menuSelectedChallengeInfo" mixin="font" bind__text="value: menuSelectedChallenge.songInfoText"\n mixin="font" position="0 -0.18 0" render-order="menutext"\n text="align: center; color: #989898; wrapCount: 55; lineHeight: 72; width: 1.5; baseline: top"></a-entity>\n </a-entity>\n\n <a-entity id="playButton"\n bind__visible-raycastable="menuActive && !!menuSelectedChallenge.id && !genreMenuOpen && !difficultyFilterMenuOpen && !isIOS && !hasSongLoadError"\n geometry="primitive: plane; width: 0.7; height: 0.25"\n play-sound="event: mouseenter; sound: #hoverSound; volume: 0.03"\n play-sound__click="event: click; sound: #confirmSound; volume: 0.25" position="0 -0.561 0"\n proxy-event="event: click; to: a-scene; as: playbuttonclick"\n material="shader: panelShader; brightness: 0.7; transparent: true; midSection: 0; ratio: 2.8; borderRadius: 0.6; borderWidth: 0.08"\n render-order="menubutton"\n animation__mouseenter1="property: components.material.material.uniforms.activePanel.value; from: 0; to: 1; startEvents: mouseenter; pauseEvents: mouseleave; dur: 100"\n animation__mouseleave1="property: components.material.material.uniforms.activePanel.value; from: 1; to: 0; startEvents: mouseleave; pauseEvents: mouseenter; dur: 100"\n animation__mouseenter2="property: scale; from: 1 1 1; to: 1.1 1.1 1.1; startEvents: mouseenter; pauseEvents: mouseleave; dur: 100"\n animation__mouseleave2="property: scale; to: 1 1 1; from: 1.1 1.1 1.1; startEvents: mouseleave; pauseEvents: mouseenter; dur: 100">\n <a-entity mixin="font" text="align: center; color: #FFF; wrapCount: 15; value: PLAY" position="0 -0.085 0.01">\n </a-entity>\n </a-entity>\n\n <a-entity id="iOSNotice" bind__visible="mainMenuActive && isIOS" mixin="font" position="0 -0.5 0.01"\n text="align: center; baseline: top; color: #FFF; wrapCount: 32; value: Sorry, iOS is currently not playable but support is coming soon!">\n </a-entity>\n\n <a-entity id="menuLoadError" bind__visible="hasSongLoadError" mixin="font" position="0 -0.5 0.01"\n text="align: center; baseline: top; color: #FFF; wrapCount: 32; value: Sorry! There was an error loading this song.">\n </a-entity>\n </a-entity>\n\n <a-entity id="searchError" mixin="font" bind__visible="search.hasError" render-order="menuText"\n text="align: center; value: Sorry, there was an issue fetching search results. Please try again."\n position="0 0 0.01"></a-entity>\n\n <a-entity id="menuNoPlaylists" mixin="font"\n bind__visible="playlist === \'favorites\' && favorites.length === 0 && !menuSelectedChallenge.id"\n render-order="menuText" position="0 0.1 0.01"\n text="align: center; baseline: top; color: #FFF; wrapCount: 32; value: Add a song to your favorites by clicking the star in the top right of the menu after selected a song.">\n </a-entity>\n\n <a-entity id="searchNoResults" mixin="font"\n bind__visible="!isSearching && search.results.length === 0 && playlist !== \'favorites\'" render-order="menuText"\n text="align: center; value: No search results found. Please try again with another query." position="0 0 0.01">\n </a-entity>\n </a-entity>\n\n \x3c!-- <require path="/workspaces/3D-Agent/rider/src/templates/genreMenu.html"> --\x3e\n<a-entity\n id="genreMenu"\n bind-for="for: genre; in: genres; updateInPlace: true; key: name"\n bind__visible="genreMenuOpen"\n layout="type: box; columns: 6; marginRow: 0.4; marginColumn: 0.4; align: center"\n menu-genre\n position="0 0 0.05">\n <template>\n <a-entity class="genre" bind-item__data-genre="item">\n <a-entity\n mixin="slice"\n slice9="opacity: 0.9; width: 0.35; left: 70; top: 70; height: 0.35; padding: 0.07"\n animation__mouseenter2="property: scale; from: 1 1 1; to: 1.03 1.03 1.03; startEvents: mouseenter; pauseEvents: mouseleave; easing: easeOutCubic; dur: 150"\n animation__mouseleave2="property: scale; from: 1.03 1.03 1.03; to: 1 1 1; startEvents: mouseleave; pauseEvents: mouseenter; easing: easeOutCubic; dur: 150"\n proxy-event__enter="event: mouseenter; to: CHILDREN; captureBubbles: true"\n proxy-event__leave="event: mouseleave; to: CHILDREN; captureBubbles: true"\n play-sound__click="event: click; sound: #confirmSound; volume: 0.1"\n raycaster-target="bindToggle: genreMenuOpen; width: 0.35; height: 0.35"\n render-order__nonrecursive="menubutton">\n <a-entity\n mixin="font"\n bind-item__text="value: item.name"\n text="align: center; width: 1.1; color: #888"\n animation__mouseenter="property: components.text.material.uniforms.color.value; from: #888; to: #FFF; type: color; startEvents: mouseenter; pauseEvents: mouseleave; easing: easeOutCubic; dur: 150"\n animation__mouseleave="property: components.text.material.uniforms.color.value; from: #FFF; to: #888; type: color; startEvents: mouseleave; pauseEvents: mouseenter; easing: easeOutCubic; dur: 150"\n render-order="menutext"\n position="0 -0.16 0.001"></a-entity>\n <a-entity\n class="genreIcon"\n bind-item__atlas-uvs="totalColumns: 6; totalRows: 3; row: item.row; column: item.column"\n geometry="primitive: plane; width: 0.22; height: 0.22; buffer: false; skipCache: true"\n position="0 0.04 0.002"\n material="shader: flat; src: #genresImg; transparent: true; color: #888"\n render-order="menutext"\n animation__mouseenter="property: components.material.material.color; type: color; from: #888; to: #FFF; startEvents: mouseenter; pauseEvents: mouseleave; easing: easeOutCubic; dur: 150"\n animation__mouseleave="property: components.material.material.color; type: color; from: #FAFAFA; to: #888; startEvents: mouseleave; pauseEvents: mouseenter; easing: easeOutCubic; dur: 150"></a-entity>\n </a-entity>\n </a-entity>\n </template>\n</a-entity>\n\x3c!-- </require> --\x3e</require>\n \x3c!-- <require path="/workspaces/3D-Agent/rider/src/templates/difficultyMenu.html"> --\x3e\n\n\n\n\n<a-entity\n id="difficultyFilterMenu"\n bind__visible="difficultyFilterMenuOpen"\n layout="type: box; columns: 1; marginRow: -0.2"\n difficulty-filter\n position="0 0.5 0">\n \n \n <a-entity class="difficultyFilterOption" data-difficulty-filter="All">\n <a-entity class="difficultyFilterBackground"\n bind__active-item="active: difficultyFilter === \'All\'"\n bind__animation__mouseenter="enabled: difficultyFilter !== \'All\'"\n bind__animation__mouseleave="enabled: difficultyFilter !== \'All\'"\n bind__animation__mouseentervisible="enabled: difficultyFilter !== \'All\'"\n bind__animation__mouseleavevisible="enabled: difficultyFilter !== \'All\'"\n bind__difficulty-background="enabled: difficultyFilterMenuOpen && difficultyFilter !== \'All\'"\n bind__material="color: colorPrimary"\n animation__mouseenter="property: components.material.material.opacity; to: 0.3; startEvents: mouseenter; dur: 150"\n animation__mouseleave="property: components.material.material.opacity; to: 0.0; startEvents: mouseleave; dur: 75"\n event-set__mouseenter="visible: true"\n event-set__mouseleave="visible: true; _delay: 160"\n geometry="primitive: plane; width: 0.4; height: 0.2"\n material="shader: flat; transparent: true; opacity: 0; src: #difficultyImg"\n position="0 -0.005 0"\n play-sound="event: mouseenter; sound: #hoverSound; volume: 0.03"\n render-order="menuitem"></a-entity>\n <a-entity\n class="difficultyFilterText"\n mixin="font"\n bind__active-text-color="active: difficultyFilter === \'All\'"\n active-text-color="color: #fff"\n difficulty-text="id: All"\n text="wrapCount: 30; align: center; color: #8d8d8d"\n position="0 -0.057 0.001"\n render-order="menutext"></a-entity>\n </a-entity>\n\n \n \n <a-entity class="difficultyFilterOption" data-difficulty-filter="Easy">\n <a-entity class="difficultyFilterBackground"\n bind__active-item="active: difficultyFilter === \'Easy\'"\n bind__animation__mouseenter="enabled: difficultyFilter !== \'Easy\'"\n bind__animation__mouseleave="enabled: difficultyFilter !== \'Easy\'"\n bind__animation__mouseentervisible="enabled: difficultyFilter !== \'Easy\'"\n bind__animation__mouseleavevisible="enabled: difficultyFilter !== \'Easy\'"\n bind__difficulty-background="enabled: difficultyFilterMenuOpen && difficultyFilter !== \'Easy\'"\n bind__material="color: colorPrimary"\n animation__mouseenter="property: components.material.material.opacity; to: 0.3; startEvents: mouseenter; dur: 150"\n animation__mouseleave="property: components.material.material.opacity; to: 0.0; startEvents: mouseleave; dur: 75"\n event-set__mouseenter="visible: true"\n event-set__mouseleave="visible: true; _delay: 160"\n geometry="primitive: plane; width: 0.4; height: 0.2"\n material="shader: flat; transparent: true; opacity: 0; src: #difficultyImg"\n position="0 -0.005 0"\n play-sound="event: mouseenter; sound: #hoverSound; volume: 0.03"\n render-order="menuitem"></a-entity>\n <a-entity\n class="difficultyFilterText"\n mixin="font"\n bind__active-text-color="active: difficultyFilter === \'Easy\'"\n active-text-color="color: #fff"\n difficulty-text="id: Easy"\n text="wrapCount: 30; align: center; color: #8d8d8d"\n position="0 -0.057 0.001"\n render-order="menutext"></a-entity>\n </a-entity>\n\n \n \n <a-entity class="difficultyFilterOption" data-difficulty-filter="Normal">\n <a-entity class="difficultyFilterBackground"\n bind__active-item="active: difficultyFilter === \'Normal\'"\n bind__animation__mouseenter="enabled: difficultyFilter !== \'Normal\'"\n bind__animation__mouseleave="enabled: difficultyFilter !== \'Normal\'"\n bind__animation__mouseentervisible="enabled: difficultyFilter !== \'Normal\'"\n bind__animation__mouseleavevisible="enabled: difficultyFilter !== \'Normal\'"\n bind__difficulty-background="enabled: difficultyFilterMenuOpen && difficultyFilter !== \'Normal\'"\n bind__material="color: colorPrimary"\n animation__mouseenter="property: components.material.material.opacity; to: 0.3; startEvents: mouseenter; dur: 150"\n animation__mouseleave="property: components.material.material.opacity; to: 0.0; startEvents: mouseleave; dur: 75"\n event-set__mouseenter="visible: true"\n event-set__mouseleave="visible: true; _delay: 160"\n geometry="primitive: plane; width: 0.4; height: 0.2"\n material="shader: flat; transparent: true; opacity: 0; src: #difficultyImg"\n position="0 -0.005 0"\n play-sound="event: mouseenter; sound: #hoverSound; volume: 0.03"\n render-order="menuitem"></a-entity>\n <a-entity\n class="difficultyFilterText"\n mixin="font"\n bind__active-text-color="active: difficultyFilter === \'Normal\'"\n active-text-color="color: #fff"\n difficulty-text="id: Normal"\n text="wrapCount: 30; align: center; color: #8d8d8d"\n position="0 -0.057 0.001"\n render-order="menutext"></a-entity>\n </a-entity>\n\n \n \n <a-entity class="difficultyFilterOption" data-difficulty-filter="Hard">\n <a-entity class="difficultyFilterBackground"\n bind__active-item="active: difficultyFilter === \'Hard\'"\n bind__animation__mouseenter="enabled: difficultyFilter !== \'Hard\'"\n bind__animation__mouseleave="enabled: difficultyFilter !== \'Hard\'"\n bind__animation__mouseentervisible="enabled: difficultyFilter !== \'Hard\'"\n bind__animation__mouseleavevisible="enabled: difficultyFilter !== \'Hard\'"\n bind__difficulty-background="enabled: difficultyFilterMenuOpen && difficultyFilter !== \'Hard\'"\n bind__material="color: colorPrimary"\n animation__mouseenter="property: components.material.material.opacity; to: 0.3; startEvents: mouseenter; dur: 150"\n animation__mouseleave="property: components.material.material.opacity; to: 0.0; startEvents: mouseleave; dur: 75"\n event-set__mouseenter="visible: true"\n event-set__mouseleave="visible: true; _delay: 160"\n geometry="primitive: plane; width: 0.4; height: 0.2"\n material="shader: flat; transparent: true; opacity: 0; src: #difficultyImg"\n position="0 -0.005 0"\n play-sound="event: mouseenter; sound: #hoverSound; volume: 0.03"\n render-order="menuitem"></a-entity>\n <a-entity\n class="difficultyFilterText"\n mixin="font"\n bind__active-text-color="active: difficultyFilter === \'Hard\'"\n active-text-color="color: #fff"\n difficulty-text="id: Hard"\n text="wrapCount: 30; align: center; color: #8d8d8d"\n position="0 -0.057 0.001"\n render-order="menutext"></a-entity>\n </a-entity>\n\n \n \n <a-entity class="difficultyFilterOption" data-difficulty-filter="Expert">\n <a-entity class="difficultyFilterBackground"\n bind__active-item="active: difficultyFilter === \'Expert\'"\n bind__animation__mouseenter="enabled: difficultyFilter !== \'Expert\'"\n bind__animation__mouseleave="enabled: difficultyFilter !== \'Expert\'"\n bind__animation__mouseentervisible="enabled: difficultyFilter !== \'Expert\'"\n bind__animation__mouseleavevisible="enabled: difficultyFilter !== \'Expert\'"\n bind__difficulty-background="enabled: difficultyFilterMenuOpen && difficultyFilter !== \'Expert\'"\n bind__material="color: colorPrimary"\n animation__mouseenter="property: components.material.material.opacity; to: 0.3; startEvents: mouseenter; dur: 150"\n animation__mouseleave="property: components.material.material.opacity; to: 0.0; startEvents: mouseleave; dur: 75"\n event-set__mouseenter="visible: true"\n event-set__mouseleave="visible: true; _delay: 160"\n geometry="primitive: plane; width: 0.4; height: 0.2"\n material="shader: flat; transparent: true; opacity: 0; src: #difficultyImg"\n position="0 -0.005 0"\n play-sound="event: mouseenter; sound: #hoverSound; volume: 0.03"\n render-order="menuitem"></a-entity>\n <a-entity\n class="difficultyFilterText"\n mixin="font"\n bind__active-text-color="active: difficultyFilter === \'Expert\'"\n active-text-color="color: #fff"\n difficulty-text="id: Expert"\n text="wrapCount: 30; align: center; color: #8d8d8d"\n position="0 -0.057 0.001"\n render-order="menutext"></a-entity>\n </a-entity>\n\n \n \n <a-entity class="difficultyFilterOption" data-difficulty-filter="Expertplus">\n <a-entity class="difficultyFilterBackground"\n bind__active-item="active: difficultyFilter === \'Expertplus\'"\n bind__animation__mouseenter="enabled: difficultyFilter !== \'Expertplus\'"\n bind__animation__mouseleave="enabled: difficultyFilter !== \'Expertplus\'"\n bind__animation__mouseentervisible="enabled: difficultyFilter !== \'Expertplus\'"\n bind__animation__mouseleavevisible="enabled: difficultyFilter !== \'Expertplus\'"\n bind__difficulty-background="enabled: difficultyFilterMenuOpen && difficultyFilter !== \'Expertplus\'"\n bind__material="color: colorPrimary"\n animation__mouseenter="property: components.material.material.opacity; to: 0.3; startEvents: mouseenter; dur: 150"\n animation__mouseleave="property: components.material.material.opacity; to: 0.0; startEvents: mouseleave; dur: 75"\n event-set__mouseenter="visible: true"\n event-set__mouseleave="visible: true; _delay: 160"\n geometry="primitive: plane; width: 0.4; height: 0.2"\n material="shader: flat; transparent: true; opacity: 0; src: #difficultyImg"\n position="0 -0.005 0"\n play-sound="event: mouseenter; sound: #hoverSound; volume: 0.03"\n render-order="menuitem"></a-entity>\n <a-entity\n class="difficultyFilterText"\n mixin="font"\n bind__active-text-color="active: difficultyFilter === \'Expertplus\'"\n active-text-color="color: #fff"\n difficulty-text="id: Expertplus"\n text="wrapCount: 30; align: center; color: #8d8d8d"\n position="0 -0.057 0.001"\n render-order="menutext"></a-entity>\n </a-entity>\n\n \n</a-entity>\n\x3c!-- </require> --\x3e</require>\n \x3c!-- <require path="/workspaces/3D-Agent/rider/src/templates/optionsMenu.html"> --\x3e\n<a-entity\n id="optionsMenu"\n bind__visible="optionsMenuOpen"\n position="0 0.5 0.01"\n render-order="menutext">\n\n <a-entity id="optionsTitle" mixin="font" text="align: center; value: OPTIONS; width: 2.5"></a-entity>\n\n <a-entity id="colorOptionsContainer" position="0 -0.25 0">\n <a-entity id="colorTitle" mixin="font" text="align: center; value: THEMES; width: 2"></a-entity>\n\n <a-entity id="colorOptions" position="-0.79 -0.175 0.00" layout="type: box; columns: 10; margin: 0.2" materials-color-menu>\n \n <a-entity\n class="colorOption"\n data-color-name="Super Medium"\n data-color-scheme="default"\n mixin="clickSoundUI hoverSoundUI"\n animation__mouseenter="property: scale; to: 1.2 1.2 1.2; dur: 150; easing: easeInOutCubic; startEvents: mouseenter"\n animation__mouseleave="property: scale; to: 1 1 1; dur: 125; easing: easeInOutCubic; startEvents: mouseleave"\n geometry="primitive: plane; width: 0.15; height: 0.15"\n material="shader: gradientShader; color1: #f971c3; color2: #6ff9ea; transparent: true"\n render-order="menutext"\n bind-toggle__raycastable="optionsMenuOpen">\n </a-entity>\n \n <a-entity\n class="colorOption"\n data-color-name="Star Warrior"\n data-color-scheme="blue"\n mixin="clickSoundUI hoverSoundUI"\n animation__mouseenter="property: scale; to: 1.2 1.2 1.2; dur: 150; easing: easeInOutCubic; startEvents: mouseenter"\n animation__mouseleave="property: scale; to: 1 1 1; dur: 125; easing: easeInOutCubic; startEvents: mouseleave"\n geometry="primitive: plane; width: 0.15; height: 0.15"\n material="shader: gradientShader; color1: #1e4482; color2: #c27727; transparent: true"\n render-order="menutext"\n bind-toggle__raycastable="optionsMenuOpen">\n </a-entity>\n \n <a-entity\n class="colorOption"\n data-color-name="Galactic Royal"\n data-color-scheme="purple"\n mixin="clickSoundUI hoverSoundUI"\n animation__mouseenter="property: scale; to: 1.2 1.2 1.2; dur: 150; easing: easeInOutCubic; startEvents: mouseenter"\n animation__mouseleave="property: scale; to: 1 1 1; dur: 125; easing: easeInOutCubic; startEvents: mouseleave"\n geometry="primitive: plane; width: 0.15; height: 0.15"\n material="shader: gradientShader; color1: #6A39B3; color2: #FAF239; transparent: true"\n render-order="menutext"\n bind-toggle__raycastable="optionsMenuOpen">\n </a-entity>\n \n <a-entity\n class="colorOption"\n data-color-name="Space Joker"\n data-color-scheme="green"\n mixin="clickSoundUI hoverSoundUI"\n animation__mouseenter="property: scale; to: 1.2 1.2 1.2; dur: 150; easing: easeInOutCubic; startEvents: mouseenter"\n animation__mouseleave="property: scale; to: 1 1 1; dur: 125; easing: easeInOutCubic; startEvents: mouseleave"\n geometry="primitive: plane; width: 0.15; height: 0.15"\n material="shader: gradientShader; color1: #779E37; color2: #6A39B3; transparent: true"\n render-order="menutext"\n bind-toggle__raycastable="optionsMenuOpen">\n </a-entity>\n \n <a-entity\n class="colorOption"\n data-color-name="Solar Flare"\n data-color-scheme="yellow"\n mixin="clickSoundUI hoverSoundUI"\n animation__mouseenter="property: scale; to: 1.2 1.2 1.2; dur: 150; easing: easeInOutCubic; startEvents: mouseenter"\n animation__mouseleave="property: scale; to: 1 1 1; dur: 125; easing: easeInOutCubic; startEvents: mouseleave"\n geometry="primitive: plane; width: 0.15; height: 0.15"\n material="shader: gradientShader; color1: #C2C04C; color2: #E03A3E; transparent: true"\n render-order="menutext"\n bind-toggle__raycastable="optionsMenuOpen">\n </a-entity>\n \n <a-entity\n class="colorOption"\n data-color-name="Trail Blazer"\n data-color-scheme="red"\n mixin="clickSoundUI hoverSoundUI"\n animation__mouseenter="property: scale; to: 1.2 1.2 1.2; dur: 150; easing: easeInOutCubic; startEvents: mouseenter"\n animation__mouseleave="property: scale; to: 1 1 1; dur: 125; easing: easeInOutCubic; startEvents: mouseleave"\n geometry="primitive: plane; width: 0.15; height: 0.15"\n material="shader: gradientShader; color1: #E03A3E; color2: #DADADA; transparent: true"\n render-order="menutext"\n bind-toggle__raycastable="optionsMenuOpen">\n </a-entity>\n \n <a-entity\n class="colorOption"\n data-color-name="Mint Choco"\n data-color-scheme="rgb"\n mixin="clickSoundUI hoverSoundUI"\n animation__mouseenter="property: scale; to: 1.2 1.2 1.2; dur: 150; easing: easeInOutCubic; startEvents: mouseenter"\n animation__mouseleave="property: scale; to: 1 1 1; dur: 125; easing: easeInOutCubic; startEvents: mouseleave"\n geometry="primitive: plane; width: 0.15; height: 0.15"\n material="shader: gradientShader; color1: #34eb89; color2: #34ebd8; transparent: true"\n render-order="menutext"\n bind-toggle__raycastable="optionsMenuOpen">\n </a-entity>\n \n <a-entity\n class="colorOption"\n data-color-name="Cheetah SoL"\n data-color-scheme="cheetah"\n mixin="clickSoundUI hoverSoundUI"\n animation__mouseenter="property: scale; to: 1.2 1.2 1.2; dur: 150; easing: easeInOutCubic; startEvents: mouseenter"\n animation__mouseleave="property: scale; to: 1 1 1; dur: 125; easing: easeInOutCubic; startEvents: mouseleave"\n geometry="primitive: plane; width: 0.15; height: 0.15"\n material="shader: gradientShader; color1: #c27727; color2: #635c54; transparent: true"\n render-order="menutext"\n bind-toggle__raycastable="optionsMenuOpen">\n </a-entity>\n \n <a-entity\n class="colorOption"\n data-color-name="Ash Nova"\n data-color-scheme="black"\n mixin="clickSoundUI hoverSoundUI"\n animation__mouseenter="property: scale; to: 1.2 1.2 1.2; dur: 150; easing: easeInOutCubic; startEvents: mouseenter"\n animation__mouseleave="property: scale; to: 1 1 1; dur: 125; easing: easeInOutCubic; startEvents: mouseleave"\n geometry="primitive: plane; width: 0.15; height: 0.15"\n material="shader: gradientShader; color1: #555; color2: #FFF; transparent: true"\n render-order="menutext"\n bind-toggle__raycastable="optionsMenuOpen">\n </a-entity>\n \n </a-entity>\n\n <a-entity\n id="colorName"\n mixin="font"\n text="align: center; color: #CCC; width: 1"\n position="0 -0.35 0.1"\n render-order="menutext"></a-entity>\n </a-entity>\n</a-entity>\n\x3c!-- </require> --\x3e</require>\n \x3c!-- <require path="/workspaces/3D-Agent/rider/src/templates/playlistMenu.html"> --\x3e\n<a-entity\n id="playlistMenu"\n bind-for="for: playlist; in: playlists; updateInPlace: true; key: name"\n bind__visible="playlistMenuOpen"\n layout="type: box; columns: 2; marginRow: -0.23; marginColumn: 1.3; align: center"\n menu-playlist\n position="0 0 0.05">\n <template>\n \n <a-entity class="playlist" data-playlist="{{ item.name }}" data-title="{{ item.title }}">\n \n <a-entity\n mixin="slice"\n slice9="opacity: 0.9; width: 1.2; left: 70; top: 70; height: 0.19; padding: 0.07"\n animation__mouseenter="property: scale; from: 1 1 1; to: 1.03 1.03 1.03; startEvents: mouseenter; pauseEvents: mouseleave; easing: easeOutCubic; dur: 150"\n animation__mouseleave="property: scale; from: 1.03 1.03 1.03; to: 1 1 1; startEvents: mouseleave; pauseEvents: mouseenter; easing: easeOutCubic; dur: 150"\n proxy-event__enter="event: mouseenter; to: CHILDREN; captureBubbles: true"\n proxy-event__leave="event: mouseleave; to: CHILDREN; captureBubbles: true"\n play-sound__click="event: click; sound: #confirmSound; volume: 0.1"\n raycaster-target="bindToggle: playlistMenuOpen; width: 1.2; height: 0.19"\n render-order__nonrecursive="menubutton">\n <a-entity\n class="playlistTitle"\n mixin="font"\n bind-item__text-uppercase="value: item.title"\n text="align: left; width: 1.3; color: #CCC"\n animation__mouseenter="property: components.text.material.uniforms.color.value; from: #CCC; to: #FFF; type: color; startEvents: mouseenter; pauseEvents: mouseleave; easing: easeOutCubic; dur: 150"\n animation__mouseleave="property: components.text.material.uniforms.color.value; from: #FFF; to: #CCC; type: color; startEvents: mouseleave; pauseEvents: mouseenter; easing: easeOutCubic; dur: 150"\n render-order="menutext"\n position="0.11 -0.01 0.001"></a-entity>\n\n <a-entity\n class="playlistAuthor"\n mixin="font"\n bind-item__text="value: item.author"\n bind__text="color: colorPrimary"\n text="align: left; width: 1.1"\n render-order="menutext"\n position="0.01 -0.08 0.001"></a-entity>\n </a-entity>\n </a-entity>\n </template>\n</a-entity>\n\x3c!-- </require> --\x3e</require>\n</a-entity>\n\n\x3c!-- Search. --\x3e\n<a-entity id="keyboard"\n bind__super-keyboard="hand: activeHand === \'left\' && \'#leftHand\' || \'#rightHand\'; show: isSearching"\n super-keyboard="label: Search on beatsaver.com; inputColor: #fff; labelColor: #f0f0f0; width: 1.5; hand: #rightHand; imagePath: assets/img/keyboard; font: assets/fonts/Viga-Regular.json; align: center; model: superkeyboard; keyColor: #fff; injectToRaycasterObjects: false; filters: allupper; keyHoverColor: #fff"\n position="0.58 1.2 -1.95" keyboard-raycastable="condition: isSearching" search\n proxy-event__dismiss="event: superkeyboarddismiss; to: a-scene; as: keyboardclose"\n proxy-event__accept="event: superkeyboardinput; to: a-scene; as: keyboardclose" render-order="menubutton"\n render-order-recursive>\n</a-entity>\n\n<a-entity id="backButton" mixin="bigMenuTopButton"\n bind__visible-raycastable="genreMenuOpen || isSearching || difficultyFilterMenuOpen || playlistMenuOpen || optionsMenuOpen"\n position="0 2.32 -1.96" play-sound__hover="event: mouseenter; sound: #hoverSound; volume: 0.1"\n proxy-event="event: click; to: a-scene; as: menuback">\n <a-entity mixin="font" text="align: center; color: #FFF; wrapCount: 20; value: BACK" position="0 -0.07 0.01">\n </a-entity>\n</a-entity>\n\n\x3c!-- Top menu buttons. --\x3e\n<a-mixin id="bigMenuTopButton" mixin="bigMenuButton" geometry="height: 0.17; width: 0.7"></a-mixin>\n<a-mixin id="bigMenuTopButtonFont" mixin="font" text="width: 0.75" position="0 -0.05 0.01"></a-mixin>\n<a-entity id="menuTopButtons"\n animation__position="property: object3D.position.z; to: -1.98; dur: 1500; easing: easeInOutCubic; delay: 300; startEvents: startgame"\n layout="type: line; margin: 0.65" position="-0.95 2.30 -1.96"\n proxy-event="event: startgame; to: #searchButton, #difficultyButton, #genreButton, #playlistButton, #optionButton">\n\n \x3c!-- Playlist menu toggle. --\x3e\n <a-entity id="playlistButtons">\n <a-entity id="playlistButton"\n mixin="bigMenuTopButton"\n bind__menu-playlist-button="isFavorited: menuSelectedChallenge.isFavorited; selectedChallenge: menuSelectedChallenge.id"\n bind__visible-raycastable="mainMenuActive && !playlist"\n material="opacity: 0"\n animation__opacity="property: components.material.material.uniforms.opacity.value; from: 0; to: 1; dur: 1000; delay: 300; startEvents: startgame"\n play-sound__hover="event: mouseenter; sound: #hoverSound; volume: 0.1"\n proxy-event="event: click; to: a-scene; as: playlistmenuopen">\n <a-entity mixin="bigMenuTopButtonFont" text="align: center; color: #FFF; wrapCount: 20; value: PLAYLISTS" bind__visible="!isMenuOpening"></a-entity>\n </a-entity>\n\n <a-entity id="clearPlaylistButton"\n mixin="bigMenuTopButton"\n bind__visible-raycastable="menuActive && !!playlist"\n play-sound__hover="event: mouseenter; sound: #hoverSound; volume: 0.1"\n play-sound__click="event: click; sound: #clearSound"\n proxy-event="event: click; to: a-scene; as: playlistclear">\n <a-entity mixin="bigMenuTopButtonFont" text="align: center; color: #FFF; wrapCount: 20; value: CLEAR PLAYLIST"></a-entity>\n </a-entity>\n\n <a-entity\n id="playlistText"\n mixin="font"\n bind__text="color: colorPrimary"\n bind__text-uppercase="value: playlistTitle"\n bind__visible="mainMenuActive && !!playlist"\n text="align: center; baseline: bottom; wrapCount: 30; width: 0.7"\n position="0 0.1 0.035"\n render-order="menutext"></a-entity>\n </a-entity>\n\n \x3c!-- Search toggle. --\x3e\n <a-entity id="searchButtons">\n <a-entity\n id="searchButton"\n mixin="bigMenuTopButton"\n bind__visible-raycastable="mainMenuActive && !search.query"\n material="opacity: 0"\n animation__opacity="property: components.material.material.uniforms.opacity.value; from: 0; to: 1; dur: 1000; delay: 300; startEvents: startgame"\n play-sound__hover="event: mouseenter; sound: #hoverSound; volume: 0.1"\n proxy-event="event: click; to: a-scene; as: keyboardopen">\n <a-entity mixin="bigMenuTopButtonFont" text="align: center; color: #FFF; wrapCount: 20; value: SEARCH" bind__visible="!isMenuOpening"></a-entity>\n </a-entity>\n\n <a-entity id="searchClearButton"\n mixin="bigMenuTopButton"\n bind__visible-raycastable="mainMenuActive && !!search.query"\n play-sound__hover="event: mouseenter; sound: #hoverSound; volume: 0.1"\n play-sound__click="event: click; sound: #clearSound"\n proxy-event="event: click; to: a-scene; as: searchclear">\n <a-entity mixin="bigMenuTopButtonFont" text="align: center; color: #FFF; wrapCount: 20; value: CLEAR SEARCH"></a-entity>\n </a-entity>\n\n <a-entity\n id="searchText"\n mixin="font"\n bind__text="color: colorPrimary"\n bind__text-uppercase="value: search.queryText"\n bind__visible="mainMenuActive && !!search.query"\n text="align: center; wrapCount: 20"\n position="0 0.1 0.035"\n render-order="menutext"></a-entity>\n </a-entity>\n\n \x3c!-- Difficulty menu toggle. --\x3e\n \x3c!-- <a-entity id="difficultyFilter">\n <a-entity id="difficultyButton"\n mixin="bigMenuTopButton"\n material="opacity: 0"\n bind__visible-raycastable="mainMenuActive"\n animation__opacity="property: components.material.material.uniforms.opacity.value; from: 0; to: 1; dur: 1000; delay: 300; startEvents: startgame"\n play-sound__hover="event: mouseenter; sound: #hoverSound; volume: 0.1"\n proxy-event="event: click; to: a-scene; as: difficultyfiltermenuopen">\n <a-entity mixin="bigMenuTopButtonFont" text="align: center; color: #FFF; wrapCount: 20; value: DIFFICULTY" bind__visible="!isMenuOpening"></a-entity>\n </a-entity>\n\n <a-entity\n id="difficultyFilterText"\n mixin="font"\n bind__difficulty-text="difficulty: difficultyFilter"\n bind__text="color: colorPrimary"\n bind__visible="mainMenuActive && difficultyFilter !== \'All\'"\n text="align: center; wrapCount: 20"\n position="0 0.1 0.035"\n render-order="menutext"></a-entity>\n </a-entity> --\x3e\n\n \x3c!-- Genre menu toggle. --\x3e\n <a-entity id="genreButtons">\n <a-entity id="genreButton"\n mixin="bigMenuTopButton"\n bind__visible-raycastable="mainMenuActive && !genre"\n material="opacity: 0"\n animation__opacity="property: components.material.material.uniforms.opacity.value; from: 0; to: 1; dur: 1000; delay: 300; startEvents: startgame"\n play-sound__hover="event: mouseenter; sound: #hoverSound; volume: 0.1"\n proxy-event="event: click; to: a-scene; as: genremenuopen">\n <a-entity mixin="bigMenuTopButtonFont" text="align: center; color: #FFF; wrapCount: 20; value: GENRES" bind__visible="!isMenuOpening"></a-entity>\n </a-entity>\n\n <a-entity id="clearGenreButton"\n mixin="bigMenuTopButton"\n bind__visible-raycastable="mainMenuActive && !!genre"\n play-sound__hover="event: mouseenter; sound: #hoverSound; volume: 0.1"\n play-sound__click="event: click; sound: #clearSound"\n proxy-event="event: click; to: a-scene; as: genreclear">\n <a-entity mixin="bigMenuTopButtonFont" text="align: center; color: #FFF; wrapCount: 20; value: CLEAR GENRE"></a-entity>\n </a-entity>\n\n <a-entity\n id="genreText"\n mixin="font"\n bind__text="color: colorPrimary"\n bind__text-uppercase="value: genre"\n bind__visible="mainMenuActive && !!genre"\n text="align: center; wrapCount: 20"\n position="0 0.1 0.035"\n render-order="menutext"></a-entity>\n </a-entity>\n</a-entity>\n\n\x3c!-- Options menu toggle. --\x3e\n<a-entity id="optionsButtons" position="0 0.45 -1.96">\n <a-entity id="optionButton" mixin="bigMenuButton" bind__visible-raycastable="mainMenuActive" material="opacity: 0"\n animation__opacity="property: components.material.material.uniforms.opacity.value; from: 0; to: 1; dur: 1000; delay: 300; startEvents: startgame"\n play-sound__hover="event: mouseenter; sound: #hoverSound; volume: 0.1"\n proxy-event="event: click; to: a-scene; as: optionsmenuopen">\n <a-entity mixin="bigMenuTopButtonFont" text="align: center; color: #FFF; wrapCount: 20; value: THEMES"\n bind__visible="!isMenuOpening"></a-entity>\n </a-entity>\n</a-entity>\x3c!-- </require> --\x3e</require>\n \x3c!-- <require path="/workspaces/3D-Agent/rider/src/templates/modes.html"> --\x3e\n<a-mixin\n id="modeAnimations"\n animation__select="property: object3D.position.z; to: 0.06; dur: 200; easing: easeOutQuad; startEvents: select"\n animation__deselect="property: object3D.position.z; to: 0; dur: 200; easing: easeOutQuad; startEvents: deselect"></a-mixin>\n\n<a-mixin\n id="modeThumbAnimations"\n animation__select="property: components.material.material.color; type: color; to: #FFF; dur: 200; easing: easeOutQuad; startEvents: select"\n animation__deselect="property: components.material.material.color; type: color; to: #888; dur: 200; easing: easeOutQuad; startEvents: deselect"></a-mixin>\n\n<a-mixin\n id="modeBackgroundHover"\n animation__mouseenter="property: components.material.material.uniforms.borderWidth.value; from: 0.002; to: 0.01; startEvents: mouseenter; pauseEvents: mouseleave; easing: linear; dur: 150"\n animation__mouseleave="property: components.material.material.uniforms.borderWidth.value; from: 0.01; to: 0.002; startEvents: mouseleave; pauseEvents: mouseenter; easing: linear; dur: 150"\n play-sound__hover="event: mouseenter; sound: #hoverSound; volume: 0.3"\n play-sound__click="event: click; sound: #confirmSound; volume: 0.1"\n\n ></a-mixin>\n\n<a-mixin\n id="modeBackgroundSelect"\n animation__select="property: components.material.material.uniforms.brightness.value; to: 0.5; startEvents: select; easing: easeOutQuad; dur: 200"\n animation__deselect="property: components.material.material.uniforms.brightness.value; to: 0.1; startEvents: deselect; easing: easeOutQuad; dur: 200"\n animation__select2="property: components.material.material.uniforms.borderWidth.value; to: 0.015; startEvents: select; easing: linear; dur: 200"\n animation__deselect2="property: components.material.material.uniforms.borderWidth.value; to: 0.002; startEvents: deselect; easing: linear; dur: 200"></a-mixin>\n\n\n\n<a-entity\n id="modes"\n bind__menu-mode="colorScheme: colorScheme; hasVR: hasVR"\n bind__position="hasVR && \'-2.56 1.3 -0.7\' || \'-2.56 1 -0.7\'"\n bind__visible="menuActive && !isMenuOpening"\n rotation="0 60 0"\n render-order="menuitem">\n\n <a-entity id="modeIcon"\n geometry="primitive: cylinder; height: 0.01; segmentsHeight: 1; radius: 0.1; segmentsRadial: 3"\n rotation="0 90 90"\n position="-1.275 0.32 0.1"\n materials="name: merkaba"\n animation="property: object3D.position.x; from: -1.275; to: -1.3; dir: alternate; easing: easeOutQuad; loop: true; dur: 900"></a-entity>\n\n <a-entity id="mode2d" bind__visible="!hasVR">\n \n\n<a-entity\n id="moderide2d"\n class="modeItem"\n data-mode="ride"\n data-name="ride2d"\n position="0 0.75 0"\n mixin="modeAnimations">\n <a-entity\n class="modeBackground"\n bind-toggle__raycastable="menuActive && !hasVR"\n position="0 0 -0.01"\n geometry="primitive: plane; width: 3; height: 0.8"\n material="shader: panelShader; brightness: 0.1; ratio: 4; borderWidth: 0.002"\n mixin="modeBackgroundHover modeBackgroundSelect"></a-entity>\n <a-entity\n class="modeTitle"\n mixin="font"\n text="align: left; value: RIDE\nMODE; lineHeight: 45; width: 2.6"\n render-order="menutext"\n position="0.14 0.05 0"></a-entity>\n <a-entity\n class="modeThumb"\n mixin="modeThumbAnimations"\n geometry="primitive: plane; width: 0.7; height: 0.5"\n material="src: #modeRideImg; shader: flat"\n position="-0.20 0 0"></a-entity>\n <a-entity\n class="modeInstructions"\n mixin="font"\n render-order="menutext"\n bind__text="color: colorPrimary"\n text="value: Relax and enjoy the ride.; width: 1.6; lineHeight: 47"\n position="1.1 -0.05 0"></a-entity>\n</a-entity>\n\n \n\n<a-entity\n id="modeviewer2d"\n class="modeItem"\n data-mode="classic"\n data-name="viewer2d"\n position="0 0 0"\n mixin="modeAnimations">\n <a-entity\n class="modeBackground"\n bind-toggle__raycastable="menuActive && !hasVR"\n position="0 0 -0.01"\n geometry="primitive: plane; width: 3; height: 0.8"\n material="shader: panelShader; brightness: 0.1; ratio: 4; borderWidth: 0.002"\n mixin="modeBackgroundHover modeBackgroundSelect"></a-entity>\n <a-entity\n class="modeTitle"\n mixin="font"\n text="align: left; value: VIEWER\nMODE; lineHeight: 45; width: 2.6"\n render-order="menutext"\n position="0.14 0.05 0"></a-entity>\n <a-entity\n class="modeThumb"\n mixin="modeThumbAnimations"\n geometry="primitive: plane; width: 0.7; height: 0.5"\n material="src: #modeViewerImg; shader: flat"\n position="-0.20 0 0"></a-entity>\n <a-entity\n class="modeInstructions"\n mixin="font"\n render-order="menutext"\n bind__text="color: colorPrimary"\n text="value: View the beat map.\n\nConnect a VR headset\nwith controllers\nto experience\nmore modes!; width: 1.6; lineHeight: 47"\n position="1.1 -0.05 0"></a-entity>\n</a-entity>\n\n </a-entity>\n\n <a-entity id="modeVR" bind__visible="hasVR">\n \n\n<a-entity\n id="modepunchvr"\n class="modeItem"\n data-mode="punch"\n data-name="punchvr"\n position="0 0.75 0"\n mixin="modeAnimations">\n <a-entity\n class="modeBackground"\n bind-toggle__raycastable="menuActive && hasVR"\n position="0 0 -0.01"\n geometry="primitive: plane; width: 3; height: 0.8"\n material="shader: panelShader; brightness: 0.1; ratio: 4; borderWidth: 0.002"\n mixin="modeBackgroundHover modeBackgroundSelect"></a-entity>\n <a-entity\n class="modeTitle"\n mixin="font"\n text="align: left; value: PUNCH\nMODE; lineHeight: 45; width: 2.6"\n render-order="menutext"\n position="0.14 0.05 0"></a-entity>\n <a-entity\n class="modeThumb"\n mixin="modeThumbAnimations"\n geometry="primitive: plane; width: 0.7; height: 0.5"\n material="src: #modePunchImg; shader: flat"\n position="-0.20 0 0"></a-entity>\n <a-entity\n class="modeInstructions"\n mixin="font"\n render-order="menutext"\n bind__text="color: colorPrimary"\n text="value: Punch the beats, mind\ncolor.\n\nAvoid all things yellow.\n\nPunch harder\n for better score.; width: 1.6; lineHeight: 47"\n position="1.1 -0.05 0"></a-entity>\n</a-entity>\n\n \n\n<a-entity\n id="moderidevr"\n class="modeItem"\n data-mode="ride"\n data-name="ridevr"\n position="0 0 0"\n mixin="modeAnimations">\n <a-entity\n class="modeBackground"\n bind-toggle__raycastable="menuActive && hasVR"\n position="0 0 -0.01"\n geometry="primitive: plane; width: 3; height: 0.8"\n material="shader: panelShader; brightness: 0.1; ratio: 4; borderWidth: 0.002"\n mixin="modeBackgroundHover modeBackgroundSelect"></a-entity>\n <a-entity\n class="modeTitle"\n mixin="font"\n text="align: left; value: RIDE\nMODE; lineHeight: 45; width: 2.6"\n render-order="menutext"\n position="0.14 0.05 0"></a-entity>\n <a-entity\n class="modeThumb"\n mixin="modeThumbAnimations"\n geometry="primitive: plane; width: 0.7; height: 0.5"\n material="src: #modeRideImg; shader: flat"\n position="-0.20 0 0"></a-entity>\n <a-entity\n class="modeInstructions"\n mixin="font"\n render-order="menutext"\n bind__text="color: colorPrimary"\n text="value: Relax and enjoy the ride.\n\nTake a quick breather.\n\nNo score!; width: 1.6; lineHeight: 47"\n position="1.1 -0.05 0"></a-entity>\n</a-entity>\n\n \n\n<a-entity\n id="modeclassicvr"\n class="modeItem"\n data-mode="classic"\n data-name="classicvr"\n position="0 -0.75 0"\n mixin="modeAnimations">\n <a-entity\n class="modeBackground"\n bind-toggle__raycastable="menuActive && hasVR"\n position="0 0 -0.01"\n geometry="primitive: plane; width: 3; height: 0.8"\n material="shader: panelShader; brightness: 0.1; ratio: 4; borderWidth: 0.002"\n mixin="modeBackgroundHover modeBackgroundSelect"></a-entity>\n <a-entity\n class="modeTitle"\n mixin="font"\n text="align: left; value: CLASSIC\nMODE; lineHeight: 45; width: 2.6"\n render-order="menutext"\n position="0.14 0.05 0"></a-entity>\n <a-entity\n class="modeThumb"\n mixin="modeThumbAnimations"\n geometry="primitive: plane; width: 0.7; height: 0.5"\n material="src: #modeClassicImg; shader: flat"\n position="-0.20 0 0"></a-entity>\n <a-entity\n class="modeInstructions"\n mixin="font"\n render-order="menutext"\n bind__text="color: colorPrimary"\n text="value: Cut the beats, mind\ncolor and direction.\n\nAvoid all things yellow.\n\nSwing fast and accurate\nfor better score.; width: 1.6; lineHeight: 47"\n position="1.1 -0.05 0"></a-entity>\n</a-entity>\n\n </a-entity>\n\n <a-entity\n id="loadingTipsContainer"\n bind__visible="menuActive"\n position="0 -1.3 0.1"\n rotation="0 0 0">\n\n <a-entity\n id="loadingTipsBackground"\n bind-toggle__raycastable="menuActive"\n render-order="menu"\n geometry="primitive: plane; width: 1.5; height: 0.3"\n material="shader: panelShader; ratio: 1.15; borderRadius: 0.4"\n render-order="menubutton"\n position="0 0 -0.03"></a-entity>\n\n <a-entity\n id="loadingTipsText"\n mixin="font"\n bind__text="color: colorPrimary"\n text="align: center; wrapCount: 30; width: 1; value: Press down on thumbstick center to open menu while playing."\n render-order="menutext"\n position="0 -0.02 0.001"></a-entity>\n </a-entity>\n</a-entity>\n\x3c!-- </require> --\x3e</require>\n \x3c!-- <require path="/workspaces/3D-Agent/rider/src/templates/victory.html"> --\x3e\n\x3c!-- Victory. --\x3e\n<a-entity\n id="victoryInfoContainer"\n position="0 1.5 -2"\n bind__visible="isVictory">\n\n <a-entity\n id="victoryAccuracyRing"\n bind__material="color: colorPrimary"k\n bind__victory-accuracy-ring="accuracy: score.finalAccuracy"\n animation="property: components.material.material.uniforms.progress.value; from: 0; easing: easeOutQuad; delay: 500; dur: 2500; autoplay: false"\n geometry="primitive: plane; width: 0.7; height: 0.7"\n material="shader: ring; transparent: true; radiusInner: 0.8; blending: additive; depthWrite: false"\n position="0 0.18 0"\n render-order="victory"></a-entity>\n\n <a-entity\n id="victoryInfoRank"\n class="accuracyTextCounterSubscribe"\n bind__animation="enabled: isVictory"\n bind__victory-rank="isVictory: isVictory; rank: score.rank"\n bind-toggle__raycastable="isVictory"\n scale="0 0 0"\n position="0 -0.034 0"\n animation__rotation="property: object3D.rotation.y; from: 0; to: -360; loop: true; easing: linear; dur: 5000; startEvents: textcounterdone"\n animation__scale="property: scale; from: 0 0 0; to: 1 1 1; loop: false; easing: easeOutQuad; dur: 300; startEvents: textcounterdone"\n play-sound="sound: #victorySound; event: textcounterdone"\n render-order="menuitemtext"\n text-geometry="font: #VigaRegularThree; bevelEnabled: true; bevelSize: 0.01; bevelThickness: 0.01; curveSegments: 7; height: 0.15; size: 0.4"></a-entity>\n\n <a-entity\n id="victoryInfoAccuracy"\n class="accuracyTextCounterSubscribe"\n mixin="font"\n bind__text="color: colorSecondary; opacity: isVictory && 0 || 0; value: score.score + \' POINTS\'"\n animation="property: components.text.material.uniforms.opacity.value; from: 0; to: 1; startEvents: textcounterdone"\n text="align: left; wrapCount: 22; baseline: top; width: 0.81"\n position="0.85 0.2 0"\n render-order="menuitemtext"></a-entity>\n\n <a-entity\n id="victoryInfoBeatsHit"\n class="accuracyTextCounterSubscribe"\n mixin="font"\n bind__text="color: colorSecondary; opacity: isVictory && 0 || 0; value: score.beatsText"\n animation="property: components.text.material.uniforms.opacity.value; from: 0; to: 1; startEvents: textcounterdone"\n text="align: left; wrapCount: 22; baseline: top; width: 0.81"\n position="0.85 0.1 0"\n render-order="menuitemtext"></a-entity>\n\n <a-entity\n id="victoryInfoAccuracy"\n mixin="font"\n bind__text="color: colorTertiary"\n text="value: 0; align: center; wrapCount: 15; baseline: top; width: 2.25"\n bind__text-counter="enabled: isVictory; value: score.finalAccuracy"\n text-counter="suffix: %"\n position="0 -0.47 0"\n render-order="menuitemtext"></a-entity>\n\n <a-entity\n id="victoryInfoMaxCombo"\n mixin="font"\n bind__text="color: colorSecondary"\n bind__text-counter="enabled: isVictory; value: score.maxCombo"\n text="align: center; wrapCount: 22; baseline: top; width: 1"\n text-counter="prefix: MAX STREAK: ; emit: true"\n proxy-event="event: textcounterdone; to: .accuracyTextCounterSubscribe"\n position="0 -0.58 0"\n render-order="menuitemtext"></a-entity>\n\n <a-entity\n id="victoryButtons"\n play-sound="event: mouseenter; sound: #hoverSound; volume: 0.03"\n play-sound__click="event: click; sound: #confirmSound; volume: 0.25"\n render-order="menubutton">\n <a-entity\n id="victoryRestartButton"\n class="accuracyTextCounterSubscribe"\n mixin="gameMenuButton"\n bind-toggle__raycastable="isVictory"\n bind__material="opacity: isVictory && 0 || 0"\n animation="property: components.material.material.uniforms.opacity.value; from: 0; to: 1; startEvents: textcounterdone"\n position="-0.56 -0.79 0.05"\n proxy-event="event: click; to: a-scene; as: gamemenurestart">\n <a-entity\n class="accuracyTextCounterSubscribe"\n mixin="gameMenuButtonText"\n bind__text="opacity: isVictory && 0 || 0"\n animation="property: components.text.material.uniforms.opacity.value; from: 0; to: 1; startEvents: textcounterdone"\n render-order="menuitemtext"\n text="opacity: 0; value: PLAY AGAIN"></a-entity>\n </a-entity>\n\n <a-entity\n id="victoryExitButton"\n class="accuracyTextCounterSubscribe"\n mixin="gameMenuButton"\n bind-toggle__raycastable="isVictory"\n bind__material="opacity: isVictory && 0 || 0"\n animation="property: components.material.material.uniforms.opacity.value; from: 0; to: 1; startEvents: textcounterdone"\n position="0.56 -0.79 0.05"\n proxy-event="event: click; to: a-scene; as: gamemenuexit">\n <a-entity\n class="accuracyTextCounterSubscribe"\n mixin="gameMenuButtonText"\n bind__text="opacity: isVictory && 0 || 0"\n animation="property: components.text.material.uniforms.opacity.value; from: 0; to: 1; startEvents: textcounterdone"\n render-order="menuitemtext"\n text="opacity: 0; value: BACK TO MENU"></a-entity>\n </a-entity>\n </a-entity>\n</a-entity>\n\x3c!-- </require> --\x3e</require>\n \x3c!-- <require path="/workspaces/3D-Agent/rider/src/templates/leaderboard.html"> --\x3e\n<a-entity\n id="leaderboard"\n class="accuracyTextCounterSubscribe"\n bind__animation="enabled: isVictory"\n bind__scale="isVictory && \'0 0 0\' || \'1 1 1\'"\n bind__visible="(!!menuSelectedChallenge.id || !!challenge.id) && (menuActive || isPaused || isVictory || isLoading) && !genreMenuOpen && gameMode !== \'ride\'"\n position="2.36 1.5 -1.19"\n rotation="0 -60 0"\n animation="property: scale; from: 0 0 0; to: 1 1 1; easing: easeOutBack; startEvents: textcounterdone"\n render-order="menuitem">\n\n <a-entity\n bind-toggle__raycastable="leaderboardActive"\n id="leaderboardBackground" position="0 0 0"\n geometry="primitive: plane; width: 2; height: 2"\n material="shader: panelShader; ratio: 1.16; brightness: 0.2"></a-entity>\n\n <a-entity\n id="leaderboardChallengeImage"\n bind__menu-selected-challenge-image="coverURL: menuSelectedChallenge.coverURL"\n bind__visible="!isVictory"\n geometry="primitive: plane; height: 0.12; width: 0.12"\n material="shader: flat"\n position="-0.44 0.63 0.001"></a-entity>\n\n <a-entity\n id="leaderboardTitle"\n mixin="font"\n text="align: center; width: 2.5; value: LEADERBOARD"\n position="0.05 0.55 0.001"\n bind__visible="!leaderboardQualified"></a-entity>\n\n <a-entity\n id="leaderboardNames"\n mixin="font"\n bind__text="color: colorSecondary; value: leaderboardNames"\n bind__visible="!leaderboardQualified && !leaderboardEmpty"\n text="baseline: top; width: 1.2; anchor: left; wrapCount: 28; lineHeight: 53;"\n position="-0.7 0.3 0.001"></a-entity>\n\n <a-entity\n id="leaderboardScores"\n mixin="font"\n bind__text="value: leaderboardScores"\n bind__visible="!leaderboardQualified && !leaderboardEmpty"\n text="baseline: top; align: right; width: 1.2; anchor: right; color: #fff; wrapCount: 28; lineHeight: 53;"\n position="0.7 0.3 0.001"></a-entity>\n\n <a-entity\n id="leaderboardEmpty"\n mixin="font"\n bind__visible="leaderboard.length === 0 && !leaderboardQualified && !leaderboardLoading"\n text="align: center; color: #999; baseline: center; width: 2; value: No high scores. Be the first!"\n position="0 0 0.001"></a-entity>\n\n <a-entity\n id="leaderboardKeyboard"\n bind__super-keyboard="hand: activeHand === \'left\' && \'#leftHand\' || \'#rightHand\'; show: leaderboardQualified"\n super-keyboard="inputColor: #fff; hand: #rightHand; imagePath: assets/img/keyboard; font: assets/fonts/Viga-Regular.json; align: center; model: superkeyboard; keyColor: #fff; injectToRaycasterObjects: false; filters: allupper; keyHoverColor: #fff; maxLength: 15; width: 1.5; label: NEW HIGH SCORE!\nENTER THE LEADERBOARD; labelColor: #FAFAFA"\n position="0 -0.08 0.02"\n proxy-event__change="event: superkeyboardchange; to: a-scene; as: leaderboardusername"\n keyboard-raycastable="condition: leaderboardQualified"\n render-order="menutext"\n render-order-recursive>\n </a-entity>\n\n <a-entity id="leaderboardSubmit"\n position="0 -0.67 0.002"\n mixin="bigMenuButton"\n bind__visible-raycastable="leaderboardQualified"\n proxy-event="event: click; to: a-scene; as: leaderboardsubmit">\n <a-entity mixin="font" text="align: center; color: #FFF; wrapCount: 26; value: SUBMIT HIGH SCORE" position="0 -0.055 0.01"></a-entity>\n \x3c!--slice9="width: 1.5; height: 0.24"--\x3e\n </a-entity>\n</a-entity>\n\x3c!-- </require> --\x3e</require>\n \x3c!-- <require path="/workspaces/3D-Agent/rider/src/templates/news.html"> --\x3e\n\n\n\n\n\n<a-entity\n id="news"\n bind__visible="menuActive && !menuSelectedChallenge.id && !isMenuOpening"\n position="2.365374194652176 1.6 -1.1952715561051024"\n rotation="0 -60 0"\n render-order="menuitem">\n\n <a-entity\n id="newsBackground"\n bind-toggle__raycastable="menuActive && !menuSelectedChallenge.id && !isMenuOpening"\n geometry="primitive: plane; width: 2.1; height: 1.9"\n material="shader: panelShader; ratio: 1.14; brightness: 0.2"></a-entity>\n\n <a-entity\n id="newsText"\n mixin="font"\n text="align: left; color: #FAFAFA; baseline: center; width: 1.6; wrapCount: 50; value: three.ws\n\nGive your AI a body. three.ws is an open-source, browser-native 3D AI agent platform.\n\nDrop a GLB file, add an LLM brain, register on-chain, and embed anywhere — no plugins, no installs.\n\nVisit three.ws to build your agent."\n position="0 -0.04 0.001"></a-entity>\n</a-entity>\n\n<a-entity\n id="support"\n bind__visible="menuActive && !menuSelectedChallenge.id && !isMenuOpening && inVR"\n position="2.365374194652176 0.25 -1.1952715561051024"\n rotation="-15 -60 0"\n render-order="menuitem">\n\n <a-entity\n id="supportBackground"\n bind-toggle__raycastable="menuActive && !menuSelectedChallenge.id && !isMenuOpening"\n geometry="primitive: plane; width: 2.1; height: 0.9"\n material="shader: panelShader; ratio: 1.14; brightness: 0.2"></a-entity>\n\n <a-entity\n id="supportImage"\n geometry="primitive: plane; width: 0.6; height: 0.5"\n material="shader: flat; src: /assets/img/banner.jpg"\n position="-0.5 0 0.001"></a-entity>\n\n <a-entity\n id="supportText"\n mixin="font"\n text="align: left; color: #FAFAFA; baseline: center; width: 1; wrapCount: 30; value: Support three.ws development.\n\nVisit three.ws for more."\n position="0.35 -0.04 0.001"></a-entity>\n</a-entity>\n\x3c!-- </require> --\x3e</require>\n\n <a-mixin\n id="cursorMesh"\n material="shader: flat; transparent: true; src: #cursorMeshImg; depthTest: false"\n sub-object="from: #cursorLaser; name: glow"></a-mixin>\n\n <a-entity\n id="curve"\n material="shader: supercurve"\n supercurve\n supercurve-color\n render-order="curve"></a-entity>\n\n <a-entity\n id="tunnelsContainer"\n render-order="curve"\n bind__visible="isPlaying || isPaused"></a-entity>\n\n <a-entity\n id="beatContainer"\n beat-hit-sound\n bind__visible="isPlaying"></a-entity>\n\n <a-entity\n id="wallContainer"\n bind__visible="isPlaying"></a-entity>\n\n <a-entity id="curveFollowRig"\n bind__curve-follow-rig-reset="isVictory: isVictory"\n bind__supercurve-follow="enabled: isPlaying; speed: speed"\n supercurve-follow="target: #curve">\n\n \x3c!-- <require path="/workspaces/3D-Agent/rider/src/templates/stageFollow.html"> --\x3e\n<a-entity\n id="tube"\n bind__visible="isPlaying"\n rotation="90 180 0"\n position="0 0 -5"\n geometry="primitive: cylinder; radius: 3; openEnded: true; height: 20"\n materials="name: tube"\n animation="property: components.materials.material.uniforms.opacity.value; from: 1; to: 0; easing: easeInOutCubic; startEvents: pulse"></a-entity>\n\n<a-entity\n id="platformShadow"\n obj-model="obj: #homeShadowObj"\n position="0 0.02 0"\n material="src: #homeShadowImg; shader: flat; blending: multiply; transparent: true;"\n raycastable-game\n render-order="curveshadow"\n stepback></a-entity>\n\n<a-entity\n id="platform"\n obj-model="obj: #homeObj"\n materials="name: home"\n bind__materials="animate: isPlaying"></a-entity>\n\n<a-entity\n id="sideGlows"\n bind__visible="isPlaying || isPaused">\n <a-entity\n id="leftSideGlow"\n geometry="primitive: plane; width: 8; height: 2"\n materials="name: leftsideglow"\n position="-2.1 .5 -3"\n rotation="20 -90 0"\n render-order="sideglow">\n </a-entity>\n <a-entity\n id="rightSideGlow"\n geometry="primitive: plane; width: 8; height: 2"\n materials="name: rightsideglow"\n position="2.1 .5 -3"\n rotation="-20 -90 0"\n render-order="sideglow">\n </a-entity>\n</a-entity>\n\n<a-entity\n id="light"\n light="type: hemisphere; color: #666"\n position="0 10 20"></a-entity>\n\n\n\x3c!-- </require> --\x3e</require>\n \x3c!-- <require path="/workspaces/3D-Agent/rider/src/templates/score.html"> --\x3e\n<a-mixin\n id="scoreText"\n mixin="font"\n text="lineHeight: 40; color: #FAFAFA; letterSpacing: -2; align: center; opacity: 0.7"></a-mixin>\n\n<a-entity\n id="scoreContainer"\n bind__score-texts="isLoading: isLoading"\n bind__visible="score.active"\n render-order="score">\n\n <a-entity\n id="songProgressRing"\n bind__material="color: colorSecondary"\n bind__song-progress-info="enabled: isPlaying || isPaused && challenge.isBeatsPreloaded"\n geometry="primitive: plane; width: 0.57; height: 0.03"\n material="shader: flat"\n position="1.525 0.1 -3.94"\n rotation="-30 0 0">\n </a-entity>\n\n <a-entity id="scoreNumberContainer" position="1.5 0.13 -4">\n <a-entity\n id="combo"\n mixin="scoreText"\n bind__text="color: colorPrimary; value: \'STREAK \' + score.combo"\n text="width: 3.5; align: left; anchor: left"\n rotation="-20 0 0"\n position="-0.025 0.175 0"></a-entity>\n\n <a-entity\n id="accuracy"\n mixin="scoreText"\n bind__text="color: colorSecondary; value: score.accuracyInt + \'%\' + \' / \' + score.score"\n text="width: 3.5; align: left; anchor: left"\n rotation="-20 0 0"></a-entity>\n </a-entity>\n</a-entity>\n\x3c!-- </require> --\x3e</require>\n \x3c!-- <require path="/workspaces/3D-Agent/rider/src/templates/gameMenu.html"> --\x3e\n<a-mixin\n id="gameMenuButton"\n mixin="bigMenuButton"\n animation__mouseenter="property: components.material.material.uniforms.activePanel.value; from: 0; to: 1; startEvents: mouseenter; pauseEvents: mouseleave; dur: 70"\n animation__mouseleave="property: components.material.material.uniforms.activePanel.value; from: 1; to: 0; startEvents: mouseleave; pauseEvents: mouseenter; dur: 70"\n geometry="height: 0.28"></a-mixin>\n\n<a-mixin\n id="gameMenuButtonText"\n mixin="font"\n position="0 -0.08 0.01"\n render-order="menutext"\n text="align: center; wrapCount: 17"></a-mixin>\n\n\x3c!-- Titles. --\x3e\n<a-entity id="inGameMenuTitles" position="0 2.2 -2.3">\n <a-entity mixin="gameMenuButtonText" text="value: GAME OVER; color: #f01978; width: 3.5" bind__visible="isGameOver"></a-entity>\n <a-entity mixin="gameMenuButtonText" text="value: SONG CLEARED; color: #FFF; width: 3.5" bind__visible="isVictory" position="0 0.1 0"></a-entity>\n <a-entity mixin="gameMenuButtonText" bind__text="color: colorPrimary" text="value: PAUSED; width: 3.5" bind__visible="isPaused"></a-entity>\n</a-entity>\n\n<a-entity\n id="gameMenu"\n bind__visible="isPaused || isVictory"\n position="0 1.5 -2"\n play-sound="event: mouseenter; sound: #hoverSound; volume: 0.1"\n play-sound__click="event: click; sound: #confirmSound; volume: 0.25">\n\n \x3c!-- Actions. --\x3e\n <a-entity\n id="resumeButton"\n mixin="gameMenuButton"\n bind-toggle__raycastable="isPaused"\n bind__visible="isPaused"\n position="0 0.35 0"\n proxy-event="event: click; to: a-scene; as: gamemenuresume">\n <a-entity mixin="gameMenuButtonText" text="value: RESUME"></a-entity>\n </a-entity>\n\n <a-entity\n id="restartButton"\n mixin="gameMenuButton"\n bind__visible="!isVictory"\n bind-toggle__raycastable="isPaused || isGameOver"\n proxy-event="event: click; to: a-scene; as: gamemenurestart">\n <a-entity mixin="gameMenuButtonText" text="value: RESTART SONG"></a-entity>\n </a-entity>\n\n <a-entity\n id="exitButton"\n mixin="gameMenuButton"\n bind__visible="!isVictory"\n bind-toggle__raycastable="isPaused || isGameOver"\n position="0 -0.35 0"\n proxy-event="event: click; to: a-scene; as: gamemenuexit">\n <a-entity mixin="gameMenuButtonText" text="value: EXIT TO MENU"></a-entity>\n </a-entity>\n\n \x3c!-- Song info. --\x3e\n <a-entity id="gameMenuSongInfoContainer"\n position="0 -1 0.15473"\n rotation="-20 0 0"\n song-info-positioner\n bind__song-info-positioner="victory: isVictory">\n <a-entity id="gameMenuSongBackground"\n bind-toggle__raycastable="isPaused || isVictory"\n render-order="menu"\n geometry="primitive: plane; width: 2.5; height: 0.3"\n material="shader: panelShader; transparent: true; ratio: 4; borderRadius: 0.5; borderWidth: 0.02"\n position="0 0 -0.03"></a-entity>\n\n <a-entity id="gameMenuSongImage"\n copy-texture="from: #menuSelectedChallengeImage"\n geometry="primitive: plane; buffer: false; skipCache: true; height: 0.3; width: 0.3"\n material="shader: flat"\n position="-1 0 0"></a-entity>\n\n <a-entity id="gameMenuSongInfo">\n <a-entity\n id="gameMenuSongName"\n position="0 0.01 0"\n mixin="font" text="align: center; color: #fff; wrapCount: 30; baseline: top; lineHeight: 36; width: 1.2"\n bind__text="value: challenge.metadata.songName"></a-entity>\n <a-entity\n id="gameMenuSongSubName"\n mixin="font"\n position="0 -0.09 0"\n bind__text="color: colorSecondary"\n bind__text-truncate="value: challenge.metadata.songSubName + \' - \' + challenge.metadata.songAuthorName"\n text-truncate="length: 80"\n text="wrapCount: 80; align: center; width: 2.4" bind__text="value: menuSelectedChallenge.songSubName"></a-entity>\n </a-entity>\n </a-entity>\n</a-entity>\n\x3c!-- </require> --\x3e</require>\n\n \x3c!-- Beat pieces, explosions, fx, and weapon trail. --\x3e\n <a-entity id="rigContainer"></a-entity>\n\n \x3c!-- Supercut FX rings. --\x3e\n \n <a-entity class="superCutFx" mixin="superCut"></a-entity>\n \n <a-entity class="superCutFx" mixin="superCut"></a-entity>\n \n <a-entity class="superCutFx" mixin="superCut"></a-entity>\n \n <a-entity class="superCutFx" mixin="superCut"></a-entity>\n \n\n \x3c!-- Player. --\x3e\n <a-entity id="cameraRig">\n <a-entity\n id="camera"\n bind__wasd-controls="enabled: !inVr"\n position="0 1.6 0.5"\n camera="far: 10000"\n look-controls\n player-height\n wasd-controls="acceleration: 15"></a-entity>\n \x3c!-- Agent companion seated next to player. The GLB has its origin at\n the feet, so we drop it ~0.45m below camera height; rider has no\n visible floor at the player position, so the lower legs fade out\n and only the seated upper body is visible. --\x3e\n <a-entity\n id="agentCompanion"\n gltf-model="#agentGlb"\n agent-dance\n position="0.7 0.45 0.5"\n rotation="0 165 0"\n scale="0.9 0.9 0.9"></a-entity>\n <a-entity\n id="cameraWallCollider"\n bind__raycaster__wall="enabled: isPlaying && gameMode !== \'ride\'"\n proxy-event__wallhitstart="event: raycaster-intersection; to: a-scene; as: wallhitstart"\n proxy-event__wallhitend="event: raycaster-intersection-cleared; to: a-scene; as: wallhitend"\n follow-position="target: #camera"\n raycaster__wall="objects: [data-wall-active]; interval: 150; direction: 0 -1 0; far: 5"\n visible="false"></a-entity>\n </a-entity>\n\n <a-entity\n id="controllerRig"\n proxy-event="event: recentered; to: #cameraRig; captureBubbles: true; as: recenter">\n \n\n \n <a-entity id="leftHand"\n class="weapon"\n bind__hand-swapper="enabled: rightRaycasterActive"\n bind__haptics-wall="enabled: isPlaying && gameMode === \'classic\'"\n bind__headfist="isPlaying: isPlaying"\n bind__menu-controls="enabled: mainMenuActive"\n bind__pauser="enabled: isPlaying"\n bind__punch="enabled: isPlaying && gameMode === \'punch\'"\n bind__raycaster="enabled: leftRaycasterActive"\n bind__raycaster__game="enabled: isPlaying && (gameMode === \'classic\' || gameMode === \'punch\')"\n bind__blade="enabled: isPlaying && gameMode === \'classic\'"\n bind__weapon-particles="enabled: isPlaying; gameMode: gameMode"\n bind__trail="colorScheme: colorScheme; enabled: isPlaying && gameMode === \'classic\'"\n controller="hand: left"\n data-hand="left"\n haptics="events: mouseenter; dur: 35; force: 0.075"\n haptics__beat="events: beathaptic; dur: 90; force: 0.55"\n haptics__draw="events: drawblade; dur: 750; force: 0.025"\n haptics__plume="events: plumepulse; dur: 35; force: 0.1"\n headfist="hand: left"\n raycaster="objects: [raycastable]; far: 5; showLine: false"\n raycaster__game="objects: [raycastable-game]; far: 1; interval: 71; direction: 0 1 -1"\n weapon="hand: left"\n weapon-particles="hand: left"\n thumb-controls\n thumb-controls-debug="enabled: false; hand: left; controllerType: vive-controls"\n render-order="weapon"\n trail="color: primary; hand: left">\n <a-entity bind__position="has3DOFVR && \'0 0 -0.5\' || \'0 0 0\'">\n <a-entity\n id="leftLaser"\n class="laser"\n bind__material="color: colorPrimary"\n bind__cursor-laser="enabled: activeHand === \'left\' && !isPlaying"\n geometry="primitive: cylinder; height: 1; radius: 0.005"\n material="shader: flat; opacity: 0.25; transparent: true"\n rotation="-90 0 0"></a-entity>\n </a-entity>\n\n \x3c!-- Blade. --\x3e\n <a-entity bind__position="has3DOFVR && \'0 0 -0.5\' || \'0 0 0\'"\n bind__rotation="controllerType.indexOf(\'oculus\') !== -1 && \'135 0 0\' || \'90 0 0\'">\n <a-entity\n class="bladeContainer"\n bind__visible="isPlaying && gameMode === \'classic\'"\n animation="property: scale; from: 0 0 0; to: 1 1 1; dur: 750; easing: linear; startEvents: drawblade"\n scale="0.001 0.001 0.001">\n <a-entity\n class="blade bladeleft"\n obj-model="obj: #weaponObj"\n materials="name: leftWeapon"\n render-order="weapon"\n position="0 -0.43 0">\n <a-entity class="bladeTipHelper" position="0 -0.45 0"></a-entity>\n </a-entity>\n </a-entity>\n\n <a-entity\n class="bladeHandle"\n bind__visible="!isPlaying || gameMode === \'classic\'"\n obj-model="obj: #weaponHandleObj"\n materials="name: leftWeaponHandle">\n <a-entity class="bladeHandleHelper"></a-entity>\n </a-entity>\n </a-entity>\n\n \x3c!-- Punch. --\x3e\n <a-entity\n id="leftpunch"\n class="punch"\n render-order="weapon"\n bind__visible="isPlaying && gameMode === \'punch\'"\n bind__position="has3DOFVR && \'0 0 -0.75\' || \'0 0 0\'"\n rotation="0 0 0">\n <a-entity\n class="punchFist"\n obj-model="obj: #leftFistObj"\n materials="name: leftFist"></a-entity>\n <a-entity\n class="punchBbox"\n geometry="primitive: box; width: 0.2; height: 0.23; depth: 0.15"\n material="shader: flat; opacity: 0.5"\n position="0 0.05 0.1"\n rotation="30 0 0"\n visible="false"></a-entity>\n <a-entity\n obj-model="obj: #leftFistWeaponObj"\n materials="name: leftFistWeapon"></a-entity>\n </a-entity>\n\n \x3c!-- Ride. --\x3e\n <a-entity\n id="leftstar"\n class="handStar"\n render-order="weapon"\n bind__visible="isPlaying && gameMode === \'ride\'">\n <a-entity\n class="handStar"\n bind__material="colorPrimary: colorPrimary; colorSecondary: colorSecondary; colorTertiary: colorTertiary"\n geometry="primitive: sphere; radius: 0.1"\n material="shader: handStar"\n animation__pulse="property: components.material.material.uniforms.pulse.value; from: 2; to: 0; dur: 300; startEvents: plumepulse; easing: easeInOutQuad"\n animation__scale="property: scale; from: 2 2 2; to: 1 1 1; dur: 1200; startEvents: plumepulse; easing: easeInOutQuad"></a-entity>\n </a-entity>\n </a-entity>\n\n <a-entity\n id="leftCursorMesh"\n mixin="cursorMesh"\n bind__cursor-mesh="active: leftRaycasterActive && !isPlaying"\n bind__material="color: colorPrimary"\n cursor-mesh="cursorEl: #leftHand"\n material\n render-order="cursor"\n scale="1.3 1.3 1.3"></a-entity>\n \n \n <a-entity id="rightHand"\n class="weapon"\n bind__hand-swapper="enabled: leftRaycasterActive"\n bind__haptics-wall="enabled: isPlaying && gameMode === \'classic\'"\n bind__headfist="isPlaying: isPlaying"\n bind__menu-controls="enabled: mainMenuActive"\n bind__pauser="enabled: isPlaying"\n bind__punch="enabled: isPlaying && gameMode === \'punch\'"\n bind__raycaster="enabled: rightRaycasterActive"\n bind__raycaster__game="enabled: isPlaying && (gameMode === \'classic\' || gameMode === \'punch\')"\n bind__blade="enabled: isPlaying && gameMode === \'classic\'"\n bind__weapon-particles="enabled: isPlaying; gameMode: gameMode"\n bind__trail="colorScheme: colorScheme; enabled: isPlaying && gameMode === \'classic\'"\n controller="hand: right"\n data-hand="right"\n haptics="events: mouseenter; dur: 35; force: 0.075"\n haptics__beat="events: beathaptic; dur: 90; force: 0.55"\n haptics__draw="events: drawblade; dur: 750; force: 0.025"\n haptics__plume="events: plumepulse; dur: 35; force: 0.1"\n headfist="hand: right"\n raycaster="objects: [raycastable]; far: 5; showLine: false"\n raycaster__game="objects: [raycastable-game]; far: 1; interval: 70; direction: 0 1 -1"\n weapon="hand: right"\n weapon-particles="hand: right"\n thumb-controls\n thumb-controls-debug="enabled: false; hand: right; controllerType: vive-controls"\n render-order="weapon"\n trail="color: secondary; hand: right">\n <a-entity bind__position="has3DOFVR && \'0 0 -0.5\' || \'0 0 0\'">\n <a-entity\n id="rightLaser"\n class="laser"\n bind__material="color: colorSecondary"\n bind__cursor-laser="enabled: activeHand === \'right\' && !isPlaying"\n geometry="primitive: cylinder; height: 1; radius: 0.005"\n material="shader: flat; opacity: 0.25; transparent: true"\n rotation="-90 0 0"></a-entity>\n </a-entity>\n\n \x3c!-- Blade. --\x3e\n <a-entity bind__position="has3DOFVR && \'0 0 -0.5\' || \'0 0 0\'"\n bind__rotation="controllerType.indexOf(\'oculus\') !== -1 && \'135 0 0\' || \'90 0 0\'">\n <a-entity\n class="bladeContainer"\n bind__visible="isPlaying && gameMode === \'classic\'"\n animation="property: scale; from: 0 0 0; to: 1 1 1; dur: 750; easing: linear; startEvents: drawblade"\n scale="0.001 0.001 0.001">\n <a-entity\n class="blade bladeright"\n obj-model="obj: #weaponObj"\n materials="name: rightWeapon"\n render-order="weapon"\n position="0 -0.43 0">\n <a-entity class="bladeTipHelper" position="0 -0.45 0"></a-entity>\n </a-entity>\n </a-entity>\n\n <a-entity\n class="bladeHandle"\n bind__visible="!isPlaying || gameMode === \'classic\'"\n obj-model="obj: #weaponHandleObj"\n materials="name: rightWeaponHandle">\n <a-entity class="bladeHandleHelper"></a-entity>\n </a-entity>\n </a-entity>\n\n \x3c!-- Punch. --\x3e\n <a-entity\n id="rightpunch"\n class="punch"\n render-order="weapon"\n bind__visible="isPlaying && gameMode === \'punch\'"\n bind__position="has3DOFVR && \'0 0 -0.75\' || \'0 0 0\'"\n rotation="0 0 0">\n <a-entity\n class="punchFist"\n obj-model="obj: #rightFistObj"\n materials="name: rightFist"></a-entity>\n <a-entity\n class="punchBbox"\n geometry="primitive: box; width: 0.2; height: 0.23; depth: 0.15"\n material="shader: flat; opacity: 0.5"\n position="0 0.05 0.1"\n rotation="30 0 0"\n visible="false"></a-entity>\n <a-entity\n obj-model="obj: #rightFistWeaponObj"\n materials="name: rightFistWeapon"></a-entity>\n </a-entity>\n\n \x3c!-- Ride. --\x3e\n <a-entity\n id="rightstar"\n class="handStar"\n render-order="weapon"\n bind__visible="isPlaying && gameMode === \'ride\'">\n <a-entity\n class="handStar"\n bind__material="colorPrimary: colorPrimary; colorSecondary: colorSecondary; colorTertiary: colorTertiary"\n geometry="primitive: sphere; radius: 0.1"\n material="shader: handStar"\n animation__pulse="property: components.material.material.uniforms.pulse.value; from: 2; to: 0; dur: 300; startEvents: plumepulse; easing: easeInOutQuad"\n animation__scale="property: scale; from: 2 2 2; to: 1 1 1; dur: 1200; startEvents: plumepulse; easing: easeInOutQuad"></a-entity>\n </a-entity>\n </a-entity>\n\n <a-entity\n id="rightCursorMesh"\n mixin="cursorMesh"\n bind__cursor-mesh="active: rightRaycasterActive && !isPlaying"\n bind__material="color: colorSecondary"\n cursor-mesh="cursorEl: #rightHand"\n material\n render-order="cursor"\n scale="1.3 1.3 1.3"></a-entity>\n \n </a-entity>\n\n <a-entity\n id="stepback"\n position="0 1.6 -1.55"\n geometry="primitive: plane; width: 0.25; height: 0.25;"\n material="shader: flat; src: #stepbackImg; transparent: true; opacity: 0"\n render-order="stepback"></a-entity>\n </a-entity>\n\n <a-entity\n id="mouseCursor"\n bind__raycaster="enabled: !inVR"\n cursor="rayOrigin: mouse"\n raycaster="objects: [raycastable]"></a-entity>\n <a-entity\n id="mouseCursorMesh"\n mixin="cursorMesh"\n cursor-mesh="cursorEl: #mouseCursor"\n bind__cursor-mesh="active: menuActive"\n render-order="cursor"></a-entity>\n\n <a-entity\n tail="target: #leftstar"\n render-order="weapon"\n bind__visible="isPlaying && gameMode === \'ride\'"></a-entity>\n <a-entity\n tail="target: #rightstar"\n render-order="weapon"\n bind__visible="isPlaying && gameMode === \'ride\'"></a-entity>\n</a-scene>\n';document.addEventListener("DOMContentLoaded",(function(){let e=document.getElementById("app");e||(e=document.createElement("div"),e.id="app",document.body.appendChild(e));e.innerHTML=r}));{const t=n(235).DiffDOM;if(e.hot.accept(),e.hot.data&&e.hot.data.oldHtml){const n=e.hot.data.oldHtml,i=new t,a=document.createElement("div");a.innerHTML=n;const o=document.createElement("div");o.innerHTML=r;const s=i.diff(a.querySelector("a-scene"),o.querySelector("a-scene"));i.apply(document.querySelector("a-scene"),s)}e.hot.dispose(e=>{e.oldHtml=r})}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";function r(e,t,n){let i;return"#text"===e.nodeName?i=n.document.createTextNode(e.data):"#comment"===e.nodeName?i=n.document.createComment(e.data):("svg"===e.nodeName||t?(i=n.document.createElementNS("http://www.w3.org/2000/svg",e.nodeName),t=!0):i=n.document.createElement(e.nodeName),e.attributes&&Object.entries(e.attributes).forEach(([e,t])=>i.setAttribute(e,t)),e.childNodes&&e.childNodes.forEach(e=>i.appendChild(r(e,t,n))),n.valueDiffing&&(e.value&&(i.value=e.value),e.checked&&(i.checked=e.checked),e.selected&&(i.selected=e.selected))),i}function i(e,t){for(t=t.slice();t.length>0;){if(!e.childNodes)return!1;const n=t.splice(0,1)[0];e=e.childNodes[n]}return e}function a(e,t,n){let a,o,s,c,l,u=i(e,t[n._const.route]);const h={diff:t,node:u};if(n.preDiffApply(h))return!0;switch(t[n._const.action]){case n._const.addAttribute:if(!u||!u.setAttribute)return!1;u.setAttribute(t[n._const.name],t[n._const.value]);break;case n._const.modifyAttribute:if(!u||!u.setAttribute)return!1;u.setAttribute(t[n._const.name],t[n._const.newValue]),"INPUT"===u.nodeName&&"value"===t[n._const.name]&&(u.value=t[n._const.oldValue]);break;case n._const.removeAttribute:if(!u||!u.removeAttribute)return!1;u.removeAttribute(t[n._const.name]);break;case n._const.modifyTextElement:if(!u||3!==u.nodeType)return!1;n.textDiff(u,u.data,t[n._const.oldValue],t[n._const.newValue]);break;case n._const.modifyValue:if(!u||void 0===u.value)return!1;u.value=t[n._const.newValue];break;case n._const.modifyComment:if(!u||void 0===u.data)return!1;n.textDiff(u,u.data,t[n._const.oldValue],t[n._const.newValue]);break;case n._const.modifyChecked:if(!u||void 0===u.checked)return!1;u.checked=t[n._const.newValue];break;case n._const.modifySelected:if(!u||void 0===u.selected)return!1;u.selected=t[n._const.newValue];break;case n._const.replaceElement:u.parentNode.replaceChild(r(t[n._const.newValue],"http://www.w3.org/2000/svg"===u.namespaceURI,n),u);break;case n._const.relocateGroup:c=Array(...new Array(t.groupLength)).map(()=>u.removeChild(u.childNodes[t[n._const.from]])),c.forEach((e,r)=>{0===r&&(o=u.childNodes[t[n._const.to]]),u.insertBefore(e,o||null)});break;case n._const.removeElement:u.parentNode.removeChild(u);break;case n._const.addElement:s=t[n._const.route].slice(),l=s.splice(s.length-1,1)[0],u=i(e,s),u.insertBefore(r(t[n._const.element],"http://www.w3.org/2000/svg"===u.namespaceURI,n),u.childNodes[l]||null);break;case n._const.removeTextElement:if(!u||3!==u.nodeType)return!1;u.parentNode.removeChild(u);break;case n._const.addTextElement:if(s=t[n._const.route].slice(),l=s.splice(s.length-1,1)[0],a=n.document.createTextNode(t[n._const.value]),u=i(e,s),!u||!u.childNodes)return!1;u.insertBefore(a,u.childNodes[l]||null);break;default:console.log("unknown action")}return h.newNode=a,n.postDiffApply(h),!0}function o(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function s(e,t,n){t.length||(t=[t]),(t=t.slice()).reverse(),t.forEach(t=>{!function(e,t,n){switch(t[n._const.action]){case n._const.addAttribute:t[n._const.action]=n._const.removeAttribute,a(e,t,n);break;case n._const.modifyAttribute:o(t,n._const.oldValue,n._const.newValue),a(e,t,n);break;case n._const.removeAttribute:t[n._const.action]=n._const.addAttribute,a(e,t,n);break;case n._const.modifyTextElement:case n._const.modifyValue:case n._const.modifyComment:case n._const.modifyChecked:case n._const.modifySelected:case n._const.replaceElement:o(t,n._const.oldValue,n._const.newValue),a(e,t,n);break;case n._const.relocateGroup:o(t,n._const.from,n._const.to),a(e,t,n);break;case n._const.removeElement:t[n._const.action]=n._const.addElement,a(e,t,n);break;case n._const.addElement:t[n._const.action]=n._const.removeElement,a(e,t,n);break;case n._const.removeTextElement:t[n._const.action]=n._const.addTextElement,a(e,t,n);break;case n._const.addTextElement:t[n._const.action]=n._const.removeTextElement,a(e,t,n);break;default:console.log("unknown action")}}(e,t,n)})}n.r(t),n.d(t,"DiffDOM",(function(){return _})),n.d(t,"TraceLogger",(function(){return S}));class c{constructor(e={}){Object.entries(e).forEach(([e,t])=>this[e]=t)}toString(){return JSON.stringify(this)}setValue(e,t){return this[e]=t,this}}function l(e){const t=[];return"#text"!==e.nodeName&&"#comment"!==e.nodeName&&(t.push(e.nodeName),e.attributes&&(e.attributes.class&&t.push(`${e.nodeName}.${e.attributes.class.replace(/ /g,".")}`),e.attributes.id&&t.push(`${e.nodeName}#${e.attributes.id}`))),t}function u(e){const t={},n={};return e.forEach(e=>{l(e).forEach(e=>{const r=e in t;r||e in n?r&&(delete t[e],n[e]=!0):t[e]=!0})}),t}function h(e,t){const n=u(e),r=u(t),i={};return Object.keys(n).forEach(e=>{r[e]&&(i[e]=!0)}),i}function d(e){return delete e.outerDone,delete e.innerDone,delete e.valueDone,!e.childNodes||e.childNodes.every(d)}function p(e,t){if(!["nodeName","value","checked","selected","data"].every(n=>e[n]===t[n]))return!1;if(Boolean(e.attributes)!==Boolean(t.attributes))return!1;if(Boolean(e.childNodes)!==Boolean(t.childNodes))return!1;if(e.attributes){const n=Object.keys(e.attributes),r=Object.keys(t.attributes);if(n.length!==r.length)return!1;if(!n.every(n=>e.attributes[n]===t.attributes[n]))return!1}if(e.childNodes){if(e.childNodes.length!==t.childNodes.length)return!1;if(!e.childNodes.every((e,n)=>p(e,t.childNodes[n])))return!1}return!0}function f(e,t,n,r,i){if(!e||!t)return!1;if(e.nodeName!==t.nodeName)return!1;if("#text"===e.nodeName)return!!i||e.data===t.data;if(e.nodeName in n)return!0;if(e.attributes&&t.attributes){if(e.attributes.id){if(e.attributes.id!==t.attributes.id)return!1;if(`${e.nodeName}#${e.attributes.id}`in n)return!0}if(e.attributes.class&&e.attributes.class===t.attributes.class){if(`${e.nodeName}.${e.attributes.class.replace(/ /g,".")}`in n)return!0}}if(r)return!0;const a=e.childNodes?e.childNodes.slice().reverse():[],o=t.childNodes?t.childNodes.slice().reverse():[];if(a.length!==o.length)return!1;if(i)return a.every((e,t)=>e.nodeName===o[t].nodeName);{const e=h(a,o);return a.every((t,n)=>f(t,o[n],e,!0,!0))}}function m(e){return JSON.parse(JSON.stringify(e))}function g(e,t,n,r){let i=0,a=[];const o=e.length,s=t.length,c=Array(...new Array(o+1)).map(()=>[]),u=h(e,t);let d=o===s;d&&e.some((e,n)=>{const r=l(e),i=l(t[n]);return r.length!==i.length?(d=!1,!0):(r.some((e,t)=>{if(e!==i[t])return d=!1,!0}),!d||void 0)});for(let l=0;l<o;l++){const o=e[l];for(let e=0;e<s;e++){const s=t[e];n[l]||r[e]||!f(o,s,u,d)?c[l+1][e+1]=0:(c[l+1][e+1]=c[l][e]?c[l][e]+1:1,c[l+1][e+1]>=i&&(i=c[l+1][e+1],a=[l+1,e+1]))}}return 0!==i&&{oldValue:a[0]-i,newValue:a[1]-i,length:i}}function y(e,t){return Array(...new Array(e)).map(()=>t)}class v{constructor(){this.list=[]}add(e){this.list.push(...e)}forEach(e){this.list.forEach(t=>e(t))}}function b(e,t){let n,r,i=e;for(t=t.slice();t.length>0;){if(!i.childNodes)return!1;r=t.splice(0,1)[0],n=i,i=i.childNodes[r]}return{node:i,parentNode:n,nodeIndex:r}}function w(e,t,n){return t.forEach(t=>{!function(e,t,n){const r=b(e,t[n._const.route]);let i=r.node;const a=r.parentNode,o=r.nodeIndex,s=[],c={diff:t,node:i};if(n.preDiffApply(c))return!0;let l,u,h,d;switch(t[n._const.action]){case n._const.addAttribute:i.attributes||(i.attributes={}),i.attributes[t[n._const.name]]=t[n._const.value],"checked"===t[n._const.name]?i.checked=!0:"selected"===t[n._const.name]?i.selected=!0:"INPUT"===i.nodeName&&"value"===t[n._const.name]&&(i.value=t[n._const.value]);break;case n._const.modifyAttribute:i.attributes[t[n._const.name]]=t[n._const.newValue];break;case n._const.removeAttribute:delete i.attributes[t[n._const.name]],0===Object.keys(i.attributes).length&&delete i.attributes,"checked"===t[n._const.name]?i.checked=!1:"selected"===t[n._const.name]?delete i.selected:"INPUT"===i.nodeName&&"value"===t[n._const.name]&&delete i.value;break;case n._const.modifyTextElement:i.data=t[n._const.newValue];break;case n._const.modifyValue:i.value=t[n._const.newValue];break;case n._const.modifyComment:i.data=t[n._const.newValue];break;case n._const.modifyChecked:i.checked=t[n._const.newValue];break;case n._const.modifySelected:i.selected=t[n._const.newValue];break;case n._const.replaceElement:l=m(t[n._const.newValue]),l.outerDone=!0,l.innerDone=!0,l.valueDone=!0,a.childNodes[o]=l;break;case n._const.relocateGroup:u=i.childNodes.splice(t[n._const.from],t.groupLength).reverse(),u.forEach(e=>i.childNodes.splice(t[n._const.to],0,e)),i.subsets&&i.subsets.forEach(e=>{if(t[n._const.from]<t[n._const.to]&&e.oldValue<=t[n._const.to]&&e.oldValue>t[n._const.from]){e.oldValue-=t.groupLength;const r=e.oldValue+e.length-t[n._const.to];r>0&&(s.push({oldValue:t[n._const.to]+t.groupLength,newValue:e.newValue+e.length-r,length:r}),e.length-=r)}else if(t[n._const.from]>t[n._const.to]&&e.oldValue>t[n._const.to]&&e.oldValue<t[n._const.from]){e.oldValue+=t.groupLength;const r=e.oldValue+e.length-t[n._const.to];r>0&&(s.push({oldValue:t[n._const.to]+t.groupLength,newValue:e.newValue+e.length-r,length:r}),e.length-=r)}else e.oldValue===t[n._const.from]&&(e.oldValue=t[n._const.to])});break;case n._const.removeElement:a.childNodes.splice(o,1),a.subsets&&a.subsets.forEach(e=>{e.oldValue>o?e.oldValue-=1:e.oldValue===o?e.delete=!0:e.oldValue<o&&e.oldValue+e.length>o&&(e.oldValue+e.length-1===o?e.length--:(s.push({newValue:e.newValue+o-e.oldValue,oldValue:o,length:e.length-o+e.oldValue-1}),e.length=o-e.oldValue))}),i=a;break;case n._const.addElement:h=t[n._const.route].slice(),d=h.splice(h.length-1,1)[0],i=b(e,h).node,l=m(t[n._const.element]),l.outerDone=!0,l.innerDone=!0,l.valueDone=!0,i.childNodes||(i.childNodes=[]),d>=i.childNodes.length?i.childNodes.push(l):i.childNodes.splice(d,0,l),i.subsets&&i.subsets.forEach(e=>{if(e.oldValue>=d)e.oldValue+=1;else if(e.oldValue<d&&e.oldValue+e.length>d){const t=e.oldValue+e.length-d;s.push({newValue:e.newValue+e.length-t,oldValue:d+1,length:t}),e.length-=t}});break;case n._const.removeTextElement:a.childNodes.splice(o,1),"TEXTAREA"===a.nodeName&&delete a.value,a.subsets&&a.subsets.forEach(e=>{e.oldValue>o?e.oldValue-=1:e.oldValue===o?e.delete=!0:e.oldValue<o&&e.oldValue+e.length>o&&(e.oldValue+e.length-1===o?e.length--:(s.push({newValue:e.newValue+o-e.oldValue,oldValue:o,length:e.length-o+e.oldValue-1}),e.length=o-e.oldValue))}),i=a;break;case n._const.addTextElement:h=t[n._const.route].slice(),d=h.splice(h.length-1,1)[0],l={},l.nodeName="#text",l.data=t[n._const.value],i=b(e,h).node,i.childNodes||(i.childNodes=[]),d>=i.childNodes.length?i.childNodes.push(l):i.childNodes.splice(d,0,l),"TEXTAREA"===i.nodeName&&(i.value=t[n._const.newValue]),i.subsets&&i.subsets.forEach(e=>{if(e.oldValue>=d&&(e.oldValue+=1),e.oldValue<d&&e.oldValue+e.length>d){const t=e.oldValue+e.length-d;s.push({newValue:e.newValue+e.length-t,oldValue:d+1,length:t}),e.length-=t}});break;default:console.log("unknown action")}i.subsets&&(i.subsets=i.subsets.filter(e=>!e.delete&&e.oldValue!==e.newValue),s.length&&(i.subsets=i.subsets.concat(s))),c.newNode=l,n.postDiffApply(c)}(e,t,n)}),!0}function A(e,t){const n={};if(n.nodeName=e.nodeName,"#text"===n.nodeName||"#comment"===n.nodeName)n.data=e.data;else{if(e.attributes&&e.attributes.length>0){n.attributes={};Array.prototype.slice.call(e.attributes).forEach(e=>n.attributes[e.name]=e.value)}if("TEXTAREA"===n.nodeName)n.value=e.value;else if(e.childNodes&&e.childNodes.length>0){n.childNodes=[];Array.prototype.slice.call(e.childNodes).forEach(e=>n.childNodes.push(A(e,t)))}t.valueDiffing&&(void 0!==e.checked&&e.type&&["radio","checkbox"].includes(e.type.toLowerCase())?n.checked=e.checked:void 0!==e.value&&(n.value=e.value),void 0!==e.selected&&(n.selected=e.selected))}return n}class E{constructor(e,t,n){this.options=n,this.t1=A(e,this.options),this.t2=A(t,this.options),this.diffcount=0,this.foundAll=!1,this.debug&&(this.t1Orig=A(e,this.options),this.t2Orig=A(t,this.options)),this.tracker=new v}init(){return this.findDiffs(this.t1,this.t2)}findDiffs(e,t){let n;do{if(this.options.debug&&(this.diffcount+=1,this.diffcount>this.options.diffcap))throw window.diffError=[this.t1Orig,this.t2Orig],new Error(`surpassed diffcap:${JSON.stringify(this.t1Orig)} -> ${JSON.stringify(this.t2Orig)}`);n=this.findNextDiff(e,t,[]),0===n.length&&(p(e,t)||(this.foundAll?(console.error("Could not find remaining diffs!"),console.log({t1:e,t2:t})):(this.foundAll=!0,d(e),n=this.findNextDiff(e,t,[])))),n.length>0&&(this.foundAll=!1,this.tracker.add(n),w(e,n,this.options))}while(n.length>0);return this.tracker.list}findNextDiff(e,t,n){let r,i;if(this.options.maxDepth&&n.length>this.options.maxDepth)return[];if(!e.outerDone){if(r=this.findOuterDiff(e,t,n),this.filterOuterDiff&&(i=this.filterOuterDiff(e,t,r),i&&(r=i)),r.length>0)return e.outerDone=!0,r;e.outerDone=!0}if(!e.innerDone){if(r=this.findInnerDiff(e,t,n),r.length>0)return r;e.innerDone=!0}if(this.options.valueDiffing&&!e.valueDone){if(r=this.findValueDiff(e,t,n),r.length>0)return e.valueDone=!0,r;e.valueDone=!0}return[]}findOuterDiff(e,t,n){const r=[];let i,a,o,s,l,u;if(e.nodeName!==t.nodeName)return[(new c).setValue(this.options._const.action,this.options._const.replaceElement).setValue(this.options._const.oldValue,m(e)).setValue(this.options._const.newValue,m(t)).setValue(this.options._const.route,n)];if(n.length&&this.options.maxChildCount&&e.childNodes&&t.childNodes&&e.childNodes.length>this.options.maxChildCount&&t.childNodes.length>this.options.maxChildCount){const r=e.childNodes.length<t.childNodes.length?e.childNodes.length:t.childNodes.length;let i=0,a=0;for(;i<this.options.maxChildDiffCount&&a<r;)p(e.childNodes[a],t.childNodes[a])||i++,a++;if(i===this.options.maxChildDiffCount)return[(new c).setValue(this.options._const.action,this.options._const.replaceElement).setValue(this.options._const.oldValue,m(e)).setValue(this.options._const.newValue,m(t)).setValue(this.options._const.route,n)]}if(e.data!==t.data)return"#text"===e.nodeName?[(new c).setValue(this.options._const.action,this.options._const.modifyTextElement).setValue(this.options._const.route,n).setValue(this.options._const.oldValue,e.data).setValue(this.options._const.newValue,t.data)]:[(new c).setValue(this.options._const.action,this.options._const.modifyComment).setValue(this.options._const.route,n).setValue(this.options._const.oldValue,e.data).setValue(this.options._const.newValue,t.data)];for(a=e.attributes?Object.keys(e.attributes).sort():[],o=t.attributes?Object.keys(t.attributes).sort():[],s=a.length,u=0;u<s;u++)i=a[u],l=o.indexOf(i),-1===l?r.push((new c).setValue(this.options._const.action,this.options._const.removeAttribute).setValue(this.options._const.route,n).setValue(this.options._const.name,i).setValue(this.options._const.value,e.attributes[i])):(o.splice(l,1),e.attributes[i]!==t.attributes[i]&&r.push((new c).setValue(this.options._const.action,this.options._const.modifyAttribute).setValue(this.options._const.route,n).setValue(this.options._const.name,i).setValue(this.options._const.oldValue,e.attributes[i]).setValue(this.options._const.newValue,t.attributes[i])));for(s=o.length,u=0;u<s;u++)i=o[u],r.push((new c).setValue(this.options._const.action,this.options._const.addAttribute).setValue(this.options._const.route,n).setValue(this.options._const.name,i).setValue(this.options._const.value,t.attributes[i]));return r}findInnerDiff(e,t,n){const r=e.subsets&&e.subsetsAge--?e.subsets:e.childNodes&&t.childNodes?function(e,t){const n=e.childNodes?e.childNodes:[],r=t.childNodes?t.childNodes:[],i=y(n.length,!1),a=y(r.length,!1),o=[];let s=!0;const c=function(){return arguments[1]},l=e=>{i[s.oldValue+e]=!0,a[s.newValue+e]=!0};for(;s;)if(s=g(n,r,i,a),s){o.push(s);Array(...new Array(s.length)).map(c).forEach(e=>l(e))}return e.subsets=o,e.subsetsAge=100,o}(e,t):[],i=e.childNodes?e.childNodes:[],a=t.childNodes?t.childNodes:[];let o,s=[],l=0;if(r.length>0&&(s=this.attemptGroupRelocation(e,t,r,n),s.length>0))return s;const u=Math.max(i.length,a.length);i.length!==a.length&&(o=!0);for(let e=0;e<u;e+=1){const t=i[e],r=a[e];o&&(t&&!r?"#text"===t.nodeName?(s.push((new c).setValue(this.options._const.action,this.options._const.removeTextElement).setValue(this.options._const.route,n.concat(l)).setValue(this.options._const.value,t.data)),l-=1):(s.push((new c).setValue(this.options._const.action,this.options._const.removeElement).setValue(this.options._const.route,n.concat(l)).setValue(this.options._const.element,m(t))),l-=1):r&&!t&&("#text"===r.nodeName?s.push((new c).setValue(this.options._const.action,this.options._const.addTextElement).setValue(this.options._const.route,n.concat(l)).setValue(this.options._const.value,r.data)):s.push((new c).setValue(this.options._const.action,this.options._const.addElement).setValue(this.options._const.route,n.concat(l)).setValue(this.options._const.element,m(r))))),t&&r&&(s=s.concat(this.findNextDiff(t,r,n.concat(l)))),l+=1}return e.innerDone=!0,s}attemptGroupRelocation(e,t,n,r){const i=function(e,t,n){const r=e.childNodes?y(e.childNodes.length,!0):[],i=t.childNodes?y(t.childNodes.length,!0):[];let a=0;return n.forEach(e=>{const t=e.oldValue+e.length,n=e.newValue+e.length;for(let n=e.oldValue;n<t;n+=1)r[n]=a;for(let t=e.newValue;t<n;t+=1)i[t]=a;a+=1}),{gaps1:r,gaps2:i}}(e,t,n),a=i.gaps1,o=i.gaps2;let s,l,u,h,d,p,g=Math.min(a.length,o.length);const v=[];for(let i=0,y=0;i<g;y+=1,i+=1)if(!0===a[i])if(h=e.childNodes[y],"#text"===h.nodeName){if("#text"===t.childNodes[i].nodeName&&h.data!==t.childNodes[i].data){for(p=y;e.childNodes.length>p+1&&"#text"===e.childNodes[p+1].nodeName;)if(p+=1,t.childNodes[i].data===e.childNodes[p].data){d=!0;break}if(!d)return v.push((new c).setValue(this.options._const.action,this.options._const.modifyTextElement).setValue(this.options._const.route,r.concat(i)).setValue(this.options._const.oldValue,h.data).setValue(this.options._const.newValue,t.childNodes[i].data)),v}v.push((new c).setValue(this.options._const.action,this.options._const.removeTextElement).setValue(this.options._const.route,r.concat(i)).setValue(this.options._const.value,h.data)),a.splice(i,1),g=Math.min(a.length,o.length),i-=1}else v.push((new c).setValue(this.options._const.action,this.options._const.removeElement).setValue(this.options._const.route,r.concat(i)).setValue(this.options._const.element,m(h))),a.splice(i,1),g=Math.min(a.length,o.length),i-=1;else if(!0===o[i])h=t.childNodes[i],"#text"===h.nodeName?(v.push((new c).setValue(this.options._const.action,this.options._const.addTextElement).setValue(this.options._const.route,r.concat(i)).setValue(this.options._const.value,h.data)),a.splice(i,0,!0),g=Math.min(a.length,o.length),y-=1):(v.push((new c).setValue(this.options._const.action,this.options._const.addElement).setValue(this.options._const.route,r.concat(i)).setValue(this.options._const.element,m(h))),a.splice(i,0,!0),g=Math.min(a.length,o.length),y-=1);else if(a[i]!==o[i]){if(v.length>0)return v;if(u=n[a[i]],l=Math.min(u.newValue,e.childNodes.length-u.length),l!==u.oldValue){s=!1;for(let t=0;t<u.length;t+=1)f(e.childNodes[l+t],e.childNodes[u.oldValue+t],[],!1,!0)||(s=!0);if(s)return[(new c).setValue(this.options._const.action,this.options._const.relocateGroup).setValue("groupLength",u.length).setValue(this.options._const.from,u.oldValue).setValue(this.options._const.to,l).setValue(this.options._const.route,r)]}}return v}findValueDiff(e,t,n){const r=[];return e.selected!==t.selected&&r.push((new c).setValue(this.options._const.action,this.options._const.modifySelected).setValue(this.options._const.oldValue,e.selected).setValue(this.options._const.newValue,t.selected).setValue(this.options._const.route,n)),(e.value||t.value)&&e.value!==t.value&&"OPTION"!==e.nodeName&&r.push((new c).setValue(this.options._const.action,this.options._const.modifyValue).setValue(this.options._const.oldValue,e.value||"").setValue(this.options._const.newValue,t.value||"").setValue(this.options._const.route,n)),e.checked!==t.checked&&r.push((new c).setValue(this.options._const.action,this.options._const.modifyChecked).setValue(this.options._const.oldValue,e.checked).setValue(this.options._const.newValue,t.checked).setValue(this.options._const.route,n)),r}}const x={debug:!1,diffcap:10,maxDepth:!1,maxChildCount:50,maxChildDiffCount:3,valueDiffing:!0,textDiff(e,t,n,r){e.data=r},preVirtualDiffApply(){},postVirtualDiffApply(){},preDiffApply(){},postDiffApply(){},filterOuterDiff:null,compress:!1,_const:!1,document:!(!window||!window.document)&&window.document};class _{constructor(e={}){if(this.options=e,Object.entries(x).forEach(([e,t])=>{Object.prototype.hasOwnProperty.call(this.options,e)||(this.options[e]=t)}),!this.options._const){const e=["addAttribute","modifyAttribute","removeAttribute","modifyTextElement","relocateGroup","removeElement","addElement","removeTextElement","addTextElement","replaceElement","modifyValue","modifyChecked","modifySelected","modifyComment","action","route","oldValue","newValue","element","group","from","to","name","value","data","attributes","nodeName","childNodes","checked","selected"];this.options._const={},this.options.compress?e.forEach((e,t)=>this.options._const[e]=t):e.forEach(e=>this.options._const[e]=e)}this.DiffFinder=E}apply(e,t){return function(e,t,n){return t.every(t=>a(e,t,n))}(e,t,this.options)}undo(e,t){return s(e,t,this.options)}diff(e,t){return new this.DiffFinder(e,t,this.options).init()}}class S{constructor(e={}){this.pad="│ ",this.padding="",this.tick=1,this.messages=[];const t=(e,t)=>{const n=e[t];e[t]=(...r)=>{this.fin(t,Array.prototype.slice.call(r));const i=n.apply(e,r);return this.fout(t,i),i}};for(let n in e)"function"==typeof e[n]&&t(e,n);this.log("┌ TRACELOG START")}fin(e,t){this.padding+=this.pad,this.log("├─> entering "+e,t)}fout(e,t){this.log("│<──┘ generated return value",t),this.padding=this.padding.substring(0,this.padding.length-this.pad.length)}format(e,t){return`${function(e){for(e=""+e;e.length<4;)e="0"+e;return e}(t)}> ${this.padding}${e}`}log(){let e=Array.prototype.slice.call(arguments);const t=function(e){return e?"string"==typeof e?e:e instanceof HTMLElement?e.outerHTML||"<empty>":e instanceof Array?`[${e.map(t).join(",")}]`:e.toString()||e.valueOf()||"<unknown>":"<falsey>"};e=e.map(t).join(", "),this.messages.push(this.format(e,this.tick++))}toString(){let e="└───";for(;e.length<=this.padding.length+this.pad.length;)e+="× ";let t=this.padding;return this.padding="",e=this.format(e,this.tick),this.padding=t,`${this.messages.join("\n")}\n${e}`}}},function(e,t,n){"use strict";n.r(t);var r=THREE.ExtrudeGeometry;class i extends r{constructor(e,t={}){const n=t.font;if(void 0===n)super();else{const r=n.generateShapes(e,t.size);t.depth=void 0!==t.height?t.height:50,void 0===t.bevelThickness&&(t.bevelThickness=10),void 0===t.bevelSize&&(t.bevelSize=8),void 0===t.bevelEnabled&&(t.bevelEnabled=!1),super(r,t)}this.type="TextGeometry"}}function a(){}void 0===Number.EPSILON&&(Number.EPSILON=Math.pow(2,-52)),void 0===Number.isInteger&&(Number.isInteger=function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e}),void 0===Math.sign&&(Math.sign=function(e){return e<0?-1:e>0?1:+e}),"name"in Function.prototype==!1&&Object.defineProperty(Function.prototype,"name",{get:function(){return this.toString().match(/^\s*function\s*([^\(\s]*)/)[1]}}),void 0===Object.assign&&(Object.assign=function(e){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n<arguments.length;n++){var r=arguments[n];if(null!=r)for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t}),Object.assign(a.prototype,{addEventListener:function(e,t){void 0===this._listeners&&(this._listeners={});var n=this._listeners;void 0===n[e]&&(n[e]=[]),-1===n[e].indexOf(t)&&n[e].push(t)},hasEventListener:function(e,t){if(void 0===this._listeners)return!1;var n=this._listeners;return void 0!==n[e]&&-1!==n[e].indexOf(t)},removeEventListener:function(e,t){if(void 0!==this._listeners){var n=this._listeners[e];if(void 0!==n){var r=n.indexOf(t);-1!==r&&n.splice(r,1)}}},dispatchEvent:function(e){if(void 0!==this._listeners){var t=this._listeners[e.type];if(void 0!==t){e.target=this;for(var n=t.slice(0),r=0,i=n.length;r<i;r++)n[r].call(this,e)}}}});var o,s,c,l,u,h,d,p,f,m={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:function(){for(var e=[],t=0;t<256;t++)e[t]=(t<16?"0":"")+t.toString(16).toUpperCase();return function(){var t=4294967295*Math.random()|0,n=4294967295*Math.random()|0,r=4294967295*Math.random()|0,i=4294967295*Math.random()|0;return e[255&t]+e[t>>8&255]+e[t>>16&255]+e[t>>24&255]+"-"+e[255&n]+e[n>>8&255]+"-"+e[n>>16&15|64]+e[n>>24&255]+"-"+e[63&r|128]+e[r>>8&255]+"-"+e[r>>16&255]+e[r>>24&255]+e[255&i]+e[i>>8&255]+e[i>>16&255]+e[i>>24&255]}}(),clamp:function(e,t,n){return Math.max(t,Math.min(n,e))},euclideanModulo:function(e,t){return(e%t+t)%t},mapLinear:function(e,t,n,r,i){return r+(e-t)*(i-r)/(n-t)},lerp:function(e,t,n){return(1-n)*e+n*t},smoothstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*(3-2*e)},smootherstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*e*(e*(6*e-15)+10)},randInt:function(e,t){return e+Math.floor(Math.random()*(t-e+1))},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(.5-Math.random())},degToRad:function(e){return e*m.DEG2RAD},radToDeg:function(e){return e*m.RAD2DEG},isPowerOfTwo:function(e){return 0==(e&e-1)&&0!==e},ceilPowerOfTwo:function(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))},floorPowerOfTwo:function(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))}};function g(e,t){this.x=e||0,this.y=t||0}function y(){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.")}function v(e,t,n,r){this._x=e||0,this._y=t||0,this._z=n||0,this._w=void 0!==r?r:1}function b(e,t,n){this.x=e||0,this.y=t||0,this.z=n||0}function w(){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.")}Object.defineProperties(g.prototype,{width:{get:function(){return this.x},set:function(e){this.x=e}},height:{get:function(){return this.y},set:function(e){this.y=e}}}),Object.assign(g.prototype,{isVector2:!0,set:function(e,t){return this.x=e,this.y=t,this},setScalar:function(e){return this.x=e,this.y=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setComponent:function(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:function(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}},clone:function(){return new this.constructor(this.x,this.y)},copy:function(e){return this.x=e.x,this.y=e.y,this},add:function(e,t){return void 0!==t?(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:function(e){return this.x+=e,this.y+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this},addScaledVector:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this},sub:function(e,t){return void 0!==t?(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:function(e){return this.x-=e,this.y-=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this},multiply:function(e){return this.x*=e.x,this.y*=e.y,this},multiplyScalar:function(e){return this.x*=e,this.y*=e,this},divide:function(e){return this.x/=e.x,this.y/=e.y,this},divideScalar:function(e){return this.multiplyScalar(1/e)},applyMatrix3:function(e){var t=this.x,n=this.y,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6],this.y=r[1]*t+r[4]*n+r[7],this},min:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this},max:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this},clamp:function(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:(o=new g,s=new g,function(e,t){return o.set(e,e),s.set(t,t),this.clamp(o,s)}),clampLength:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},roundToZero:function(){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:function(){return this.x=-this.x,this.y=-this.y,this},dot:function(e){return this.x*e.x+this.y*e.y},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)},normalize:function(){return this.divideScalar(this.length()||1)},angle:function(){var e=Math.atan2(this.y,this.x);return e<0&&(e+=2*Math.PI),e},distanceTo:function(e){return Math.sqrt(this.distanceToSquared(e))},distanceToSquared:function(e){var t=this.x-e.x,n=this.y-e.y;return t*t+n*n},manhattanDistanceTo:function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)},setLength:function(e){return this.normalize().multiplyScalar(e)},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this},lerpVectors:function(e,t,n){return this.subVectors(t,e).multiplyScalar(n).add(e)},equals:function(e){return e.x===this.x&&e.y===this.y},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e},fromBufferAttribute:function(e,t,n){return void 0!==n&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this},rotateAround:function(e,t){var n=Math.cos(t),r=Math.sin(t),i=this.x-e.x,a=this.y-e.y;return this.x=i*n-a*r+e.x,this.y=i*r+a*n+e.y,this}}),Object.assign(y.prototype,{isMatrix4:!0,set:function(e,t,n,r,i,a,o,s,c,l,u,h,d,p,f,m){var g=this.elements;return g[0]=e,g[4]=t,g[8]=n,g[12]=r,g[1]=i,g[5]=a,g[9]=o,g[13]=s,g[2]=c,g[6]=l,g[10]=u,g[14]=h,g[3]=d,g[7]=p,g[11]=f,g[15]=m,this},identity:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this},clone:function(){return(new y).fromArray(this.elements)},copy:function(e){var 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:function(e){var t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this},extractBasis:function(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this},makeBasis:function(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:(p=new b,function(e){var t=this.elements,n=e.elements,r=1/p.setFromMatrixColumn(e,0).length(),i=1/p.setFromMatrixColumn(e,1).length(),a=1/p.setFromMatrixColumn(e,2).length();return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[4]=n[4]*i,t[5]=n[5]*i,t[6]=n[6]*i,t[8]=n[8]*a,t[9]=n[9]*a,t[10]=n[10]*a,this}),makeRotationFromEuler:function(e){e&&e.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var t=this.elements,n=e.x,r=e.y,i=e.z,a=Math.cos(n),o=Math.sin(n),s=Math.cos(r),c=Math.sin(r),l=Math.cos(i),u=Math.sin(i);if("XYZ"===e.order){var h=a*l,d=a*u,p=o*l,f=o*u;t[0]=s*l,t[4]=-s*u,t[8]=c,t[1]=d+p*c,t[5]=h-f*c,t[9]=-o*s,t[2]=f-h*c,t[6]=p+d*c,t[10]=a*s}else if("YXZ"===e.order){var m=s*l,g=s*u,y=c*l,v=c*u;t[0]=m+v*o,t[4]=y*o-g,t[8]=a*c,t[1]=a*u,t[5]=a*l,t[9]=-o,t[2]=g*o-y,t[6]=v+m*o,t[10]=a*s}else if("ZXY"===e.order){m=s*l,g=s*u,y=c*l,v=c*u;t[0]=m-v*o,t[4]=-a*u,t[8]=y+g*o,t[1]=g+y*o,t[5]=a*l,t[9]=v-m*o,t[2]=-a*c,t[6]=o,t[10]=a*s}else if("ZYX"===e.order){h=a*l,d=a*u,p=o*l,f=o*u;t[0]=s*l,t[4]=p*c-d,t[8]=h*c+f,t[1]=s*u,t[5]=f*c+h,t[9]=d*c-p,t[2]=-c,t[6]=o*s,t[10]=a*s}else if("YZX"===e.order){var b=a*s,w=a*c,A=o*s,E=o*c;t[0]=s*l,t[4]=E-b*u,t[8]=A*u+w,t[1]=u,t[5]=a*l,t[9]=-o*l,t[2]=-c*l,t[6]=w*u+A,t[10]=b-E*u}else if("XZY"===e.order){b=a*s,w=a*c,A=o*s,E=o*c;t[0]=s*l,t[4]=-u,t[8]=c*l,t[1]=b*u+E,t[5]=a*l,t[9]=w*u-A,t[2]=A*u-w,t[6]=o*l,t[10]=E*u+b}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},makeRotationFromQuaternion:function(e){var t=this.elements,n=e._x,r=e._y,i=e._z,a=e._w,o=n+n,s=r+r,c=i+i,l=n*o,u=n*s,h=n*c,d=r*s,p=r*c,f=i*c,m=a*o,g=a*s,y=a*c;return t[0]=1-(d+f),t[4]=u-y,t[8]=h+g,t[1]=u+y,t[5]=1-(l+f),t[9]=p-m,t[2]=h-g,t[6]=p+m,t[10]=1-(l+d),t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},lookAt:(u=new b,h=new b,d=new b,function(e,t,n){var r=this.elements;return d.subVectors(e,t),0===d.lengthSq()&&(d.z=1),d.normalize(),u.crossVectors(n,d),0===u.lengthSq()&&(1===Math.abs(n.z)?d.x+=1e-4:d.z+=1e-4,d.normalize(),u.crossVectors(n,d)),u.normalize(),h.crossVectors(d,u),r[0]=u.x,r[4]=h.x,r[8]=d.x,r[1]=u.y,r[5]=h.y,r[9]=d.y,r[2]=u.z,r[6]=h.z,r[10]=d.z,this}),multiply:function(e,t){return void 0!==t?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(e,t)):this.multiplyMatrices(this,e)},premultiply:function(e){return this.multiplyMatrices(e,this)},multiplyMatrices:function(e,t){var n=e.elements,r=t.elements,i=this.elements,a=n[0],o=n[4],s=n[8],c=n[12],l=n[1],u=n[5],h=n[9],d=n[13],p=n[2],f=n[6],m=n[10],g=n[14],y=n[3],v=n[7],b=n[11],w=n[15],A=r[0],E=r[4],x=r[8],_=r[12],S=r[1],M=r[5],T=r[9],R=r[13],k=r[2],C=r[6],O=r[10],P=r[14],I=r[3],N=r[7],L=r[11],D=r[15];return i[0]=a*A+o*S+s*k+c*I,i[4]=a*E+o*M+s*C+c*N,i[8]=a*x+o*T+s*O+c*L,i[12]=a*_+o*R+s*P+c*D,i[1]=l*A+u*S+h*k+d*I,i[5]=l*E+u*M+h*C+d*N,i[9]=l*x+u*T+h*O+d*L,i[13]=l*_+u*R+h*P+d*D,i[2]=p*A+f*S+m*k+g*I,i[6]=p*E+f*M+m*C+g*N,i[10]=p*x+f*T+m*O+g*L,i[14]=p*_+f*R+m*P+g*D,i[3]=y*A+v*S+b*k+w*I,i[7]=y*E+v*M+b*C+w*N,i[11]=y*x+v*T+b*O+w*L,i[15]=y*_+v*R+b*P+w*D,this},multiplyScalar:function(e){var 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},applyToBufferAttribute:function(){var e=new b;return function(t){for(var n=0,r=t.count;n<r;n++)e.x=t.getX(n),e.y=t.getY(n),e.z=t.getZ(n),e.applyMatrix4(this),t.setXYZ(n,e.x,e.y,e.z);return t}}(),determinant:function(){var e=this.elements,t=e[0],n=e[4],r=e[8],i=e[12],a=e[1],o=e[5],s=e[9],c=e[13],l=e[2],u=e[6],h=e[10],d=e[14];return e[3]*(+i*s*u-r*c*u-i*o*h+n*c*h+r*o*d-n*s*d)+e[7]*(+t*s*d-t*c*h+i*a*h-r*a*d+r*c*l-i*s*l)+e[11]*(+t*c*u-t*o*d-i*a*u+n*a*d+i*o*l-n*c*l)+e[15]*(-r*o*l-t*s*u+t*o*h+r*a*u-n*a*h+n*s*l)},transpose:function(){var e,t=this.elements;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this},setPosition:function(e){var t=this.elements;return t[12]=e.x,t[13]=e.y,t[14]=e.z,this},getInverse:function(e,t){var n=this.elements,r=e.elements,i=r[0],a=r[1],o=r[2],s=r[3],c=r[4],l=r[5],u=r[6],h=r[7],d=r[8],p=r[9],f=r[10],m=r[11],g=r[12],y=r[13],v=r[14],b=r[15],w=p*v*h-y*f*h+y*u*m-l*v*m-p*u*b+l*f*b,A=g*f*h-d*v*h-g*u*m+c*v*m+d*u*b-c*f*b,E=d*y*h-g*p*h+g*l*m-c*y*m-d*l*b+c*p*b,x=g*p*u-d*y*u-g*l*f+c*y*f+d*l*v-c*p*v,_=i*w+a*A+o*E+s*x;if(0===_){var S="THREE.Matrix4: .getInverse() can't invert matrix, determinant is 0";if(!0===t)throw new Error(S);return console.warn(S),this.identity()}var M=1/_;return n[0]=w*M,n[1]=(y*f*s-p*v*s-y*o*m+a*v*m+p*o*b-a*f*b)*M,n[2]=(l*v*s-y*u*s+y*o*h-a*v*h-l*o*b+a*u*b)*M,n[3]=(p*u*s-l*f*s-p*o*h+a*f*h+l*o*m-a*u*m)*M,n[4]=A*M,n[5]=(d*v*s-g*f*s+g*o*m-i*v*m-d*o*b+i*f*b)*M,n[6]=(g*u*s-c*v*s-g*o*h+i*v*h+c*o*b-i*u*b)*M,n[7]=(c*f*s-d*u*s+d*o*h-i*f*h-c*o*m+i*u*m)*M,n[8]=E*M,n[9]=(g*p*s-d*y*s-g*a*m+i*y*m+d*a*b-i*p*b)*M,n[10]=(c*y*s-g*l*s+g*a*h-i*y*h-c*a*b+i*l*b)*M,n[11]=(d*l*s-c*p*s-d*a*h+i*p*h+c*a*m-i*l*m)*M,n[12]=x*M,n[13]=(d*y*o-g*p*o+g*a*f-i*y*f-d*a*v+i*p*v)*M,n[14]=(g*l*o-c*y*o-g*a*u+i*y*u+c*a*v-i*l*v)*M,n[15]=(c*p*o-d*l*o+d*a*u-i*p*u-c*a*f+i*l*f)*M,this},scale:function(e){var t=this.elements,n=e.x,r=e.y,i=e.z;return t[0]*=n,t[4]*=r,t[8]*=i,t[1]*=n,t[5]*=r,t[9]*=i,t[2]*=n,t[6]*=r,t[10]*=i,t[3]*=n,t[7]*=r,t[11]*=i,this},getMaxScaleOnAxis:function(){var 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],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,r))},makeTranslation:function(e,t,n){return this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this},makeRotationX:function(e){var 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:function(e){var 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:function(e){var 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:function(e,t){var n=Math.cos(t),r=Math.sin(t),i=1-n,a=e.x,o=e.y,s=e.z,c=i*a,l=i*o;return this.set(c*a+n,c*o-r*s,c*s+r*o,0,c*o+r*s,l*o+n,l*s-r*a,0,c*s-r*o,l*s+r*a,i*s*s+n,0,0,0,0,1),this},makeScale:function(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this},makeShear:function(e,t,n){return this.set(1,t,n,0,e,1,n,0,e,t,1,0,0,0,0,1),this},compose:function(e,t,n){return this.makeRotationFromQuaternion(t),this.scale(n),this.setPosition(e),this},decompose:(c=new b,l=new y,function(e,t,n){var r=this.elements,i=c.set(r[0],r[1],r[2]).length(),a=c.set(r[4],r[5],r[6]).length(),o=c.set(r[8],r[9],r[10]).length();this.determinant()<0&&(i=-i),e.x=r[12],e.y=r[13],e.z=r[14],l.copy(this);var s=1/i,u=1/a,h=1/o;return l.elements[0]*=s,l.elements[1]*=s,l.elements[2]*=s,l.elements[4]*=u,l.elements[5]*=u,l.elements[6]*=u,l.elements[8]*=h,l.elements[9]*=h,l.elements[10]*=h,t.setFromRotationMatrix(l),n.x=i,n.y=a,n.z=o,this}),makePerspective:function(e,t,n,r,i,a){void 0===a&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");var o=this.elements,s=2*i/(t-e),c=2*i/(n-r),l=(t+e)/(t-e),u=(n+r)/(n-r),h=-(a+i)/(a-i),d=-2*a*i/(a-i);return o[0]=s,o[4]=0,o[8]=l,o[12]=0,o[1]=0,o[5]=c,o[9]=u,o[13]=0,o[2]=0,o[6]=0,o[10]=h,o[14]=d,o[3]=0,o[7]=0,o[11]=-1,o[15]=0,this},makeOrthographic:function(e,t,n,r,i,a){var o=this.elements,s=1/(t-e),c=1/(n-r),l=1/(a-i),u=(t+e)*s,h=(n+r)*c,d=(a+i)*l;return o[0]=2*s,o[4]=0,o[8]=0,o[12]=-u,o[1]=0,o[5]=2*c,o[9]=0,o[13]=-h,o[2]=0,o[6]=0,o[10]=-2*l,o[14]=-d,o[3]=0,o[7]=0,o[11]=0,o[15]=1,this},equals:function(e){for(var t=this.elements,n=e.elements,r=0;r<16;r++)if(t[r]!==n[r])return!1;return!0},fromArray:function(e,t){void 0===t&&(t=0);for(var n=0;n<16;n++)this.elements[n]=e[n+t];return this},toArray:function(e,t){void 0===e&&(e=[]),void 0===t&&(t=0);var 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}}),Object.assign(v,{slerp:function(e,t,n,r){return n.copy(e).slerp(t,r)},slerpFlat:function(e,t,n,r,i,a,o){var s=n[r+0],c=n[r+1],l=n[r+2],u=n[r+3],h=i[a+0],d=i[a+1],p=i[a+2],f=i[a+3];if(u!==f||s!==h||c!==d||l!==p){var m=1-o,g=s*h+c*d+l*p+u*f,y=g>=0?1:-1,v=1-g*g;if(v>Number.EPSILON){var b=Math.sqrt(v),w=Math.atan2(b,g*y);m=Math.sin(m*w)/b,o=Math.sin(o*w)/b}var A=o*y;if(s=s*m+h*A,c=c*m+d*A,l=l*m+p*A,u=u*m+f*A,m===1-o){var E=1/Math.sqrt(s*s+c*c+l*l+u*u);s*=E,c*=E,l*=E,u*=E}}e[t]=s,e[t+1]=c,e[t+2]=l,e[t+3]=u}}),Object.defineProperties(v.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this.onChangeCallback()}},y:{get:function(){return this._y},set:function(e){this._y=e,this.onChangeCallback()}},z:{get:function(){return this._z},set:function(e){this._z=e,this.onChangeCallback()}},w:{get:function(){return this._w},set:function(e){this._w=e,this.onChangeCallback()}}}),Object.assign(v.prototype,{set:function(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._w=r,this.onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._w)},copy:function(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this.onChangeCallback(),this},setFromEuler:function(e,t){if(!e||!e.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var n=e._x,r=e._y,i=e._z,a=e.order,o=Math.cos,s=Math.sin,c=o(n/2),l=o(r/2),u=o(i/2),h=s(n/2),d=s(r/2),p=s(i/2);return"XYZ"===a?(this._x=h*l*u+c*d*p,this._y=c*d*u-h*l*p,this._z=c*l*p+h*d*u,this._w=c*l*u-h*d*p):"YXZ"===a?(this._x=h*l*u+c*d*p,this._y=c*d*u-h*l*p,this._z=c*l*p-h*d*u,this._w=c*l*u+h*d*p):"ZXY"===a?(this._x=h*l*u-c*d*p,this._y=c*d*u+h*l*p,this._z=c*l*p+h*d*u,this._w=c*l*u-h*d*p):"ZYX"===a?(this._x=h*l*u-c*d*p,this._y=c*d*u+h*l*p,this._z=c*l*p-h*d*u,this._w=c*l*u+h*d*p):"YZX"===a?(this._x=h*l*u+c*d*p,this._y=c*d*u+h*l*p,this._z=c*l*p-h*d*u,this._w=c*l*u-h*d*p):"XZY"===a&&(this._x=h*l*u-c*d*p,this._y=c*d*u-h*l*p,this._z=c*l*p+h*d*u,this._w=c*l*u+h*d*p),!1!==t&&this.onChangeCallback(),this},setFromAxisAngle:function(e,t){var n=t/2,r=Math.sin(n);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(n),this.onChangeCallback(),this},setFromRotationMatrix:function(e){var t,n=e.elements,r=n[0],i=n[4],a=n[8],o=n[1],s=n[5],c=n[9],l=n[2],u=n[6],h=n[10],d=r+s+h;return d>0?(t=.5/Math.sqrt(d+1),this._w=.25/t,this._x=(u-c)*t,this._y=(a-l)*t,this._z=(o-i)*t):r>s&&r>h?(t=2*Math.sqrt(1+r-s-h),this._w=(u-c)/t,this._x=.25*t,this._y=(i+o)/t,this._z=(a+l)/t):s>h?(t=2*Math.sqrt(1+s-r-h),this._w=(a-l)/t,this._x=(i+o)/t,this._y=.25*t,this._z=(c+u)/t):(t=2*Math.sqrt(1+h-r-s),this._w=(o-i)/t,this._x=(a+l)/t,this._y=(c+u)/t,this._z=.25*t),this.onChangeCallback(),this},setFromUnitVectors:function(){var e,t=new b;return function(n,r){return void 0===t&&(t=new b),(e=n.dot(r)+1)<1e-6?(e=0,Math.abs(n.x)>Math.abs(n.z)?t.set(-n.y,n.x,0):t.set(0,-n.z,n.y)):t.crossVectors(n,r),this._x=t.x,this._y=t.y,this._z=t.z,this._w=e,this.normalize()}}(),inverse:function(){return this.conjugate()},conjugate:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this.onChangeCallback(),this},dot:function(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w},lengthSq:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},length:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},normalize:function(){var e=this.length();return 0===e?(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:function(e,t){return void 0!==t?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(e,t)):this.multiplyQuaternions(this,e)},premultiply:function(e){return this.multiplyQuaternions(e,this)},multiplyQuaternions:function(e,t){var n=e._x,r=e._y,i=e._z,a=e._w,o=t._x,s=t._y,c=t._z,l=t._w;return this._x=n*l+a*o+r*c-i*s,this._y=r*l+a*s+i*o-n*c,this._z=i*l+a*c+n*s-r*o,this._w=a*l-n*o-r*s-i*c,this.onChangeCallback(),this},slerp:function(e,t){if(0===t)return this;if(1===t)return this.copy(e);var n=this._x,r=this._y,i=this._z,a=this._w,o=a*e._w+n*e._x+r*e._y+i*e._z;if(o<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,o=-o):this.copy(e),o>=1)return this._w=a,this._x=n,this._y=r,this._z=i,this;var s=Math.sqrt(1-o*o);if(Math.abs(s)<.001)return this._w=.5*(a+this._w),this._x=.5*(n+this._x),this._y=.5*(r+this._y),this._z=.5*(i+this._z),this;var c=Math.atan2(s,o),l=Math.sin((1-t)*c)/s,u=Math.sin(t*c)/s;return this._w=a*l+this._w*u,this._x=n*l+this._x*u,this._y=r*l+this._y*u,this._z=i*l+this._z*u,this.onChangeCallback(),this},equals:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w},fromArray:function(e,t){return void 0===t&&(t=0),this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this.onChangeCallback(),this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e},onChange:function(e){return this.onChangeCallback=e,this},onChangeCallback:function(){}}),Object.assign(b.prototype,{isVector3:!0,set:function(e,t,n){return this.x=e,this.y=t,this.z=n,this},setScalar:function(e){return this.x=e,this.y=e,this.z=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setZ:function(e){return this.z=e,this},setComponent:function(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:function(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:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this},add:function(e,t){return void 0!==t?(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:function(e){return this.x+=e,this.y+=e,this.z+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this},addScaledVector:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this},sub:function(e,t){return void 0!==t?(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:function(e){return this.x-=e,this.y-=e,this.z-=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this},multiply:function(e,t){return void 0!==t?(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:function(e){return this.x*=e,this.y*=e,this.z*=e,this},multiplyVectors:function(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this},applyEuler:(f=new v,function(e){return e&&e.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(f.setFromEuler(e))}),applyAxisAngle:function(){var e=new v;return function(t,n){return this.applyQuaternion(e.setFromAxisAngle(t,n))}}(),applyMatrix3:function(e){var t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6]*r,this.y=i[1]*t+i[4]*n+i[7]*r,this.z=i[2]*t+i[5]*n+i[8]*r,this},applyMatrix4:function(e){var t=this.x,n=this.y,r=this.z,i=e.elements,a=1/(i[3]*t+i[7]*n+i[11]*r+i[15]);return this.x=(i[0]*t+i[4]*n+i[8]*r+i[12])*a,this.y=(i[1]*t+i[5]*n+i[9]*r+i[13])*a,this.z=(i[2]*t+i[6]*n+i[10]*r+i[14])*a,this},applyQuaternion:function(e){var t=this.x,n=this.y,r=this.z,i=e.x,a=e.y,o=e.z,s=e.w,c=s*t+a*r-o*n,l=s*n+o*t-i*r,u=s*r+i*n-a*t,h=-i*t-a*n-o*r;return this.x=c*s+h*-i+l*-o-u*-a,this.y=l*s+h*-a+u*-i-c*-o,this.z=u*s+h*-o+c*-a-l*-i,this},project:function(){var e=new y;return function(t){return e.multiplyMatrices(t.projectionMatrix,e.getInverse(t.matrixWorld)),this.applyMatrix4(e)}}(),unproject:function(){var e=new y;return function(t){return e.multiplyMatrices(t.matrixWorld,e.getInverse(t.projectionMatrix)),this.applyMatrix4(e)}}(),transformDirection:function(e){var t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[4]*n+i[8]*r,this.y=i[1]*t+i[5]*n+i[9]*r,this.z=i[2]*t+i[6]*n+i[10]*r,this.normalize()},divide:function(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this},divideScalar:function(e){return this.multiplyScalar(1/e)},min:function(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:function(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:function(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:function(){var e=new b,t=new b;return function(n,r){return e.set(n,n,n),t.set(r,r,r),this.clamp(e,t)}}(),clampLength:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},roundToZero:function(){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:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},dot:function(e){return this.x*e.x+this.y*e.y+this.z*e.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(e){return this.normalize().multiplyScalar(e)},lerp:function(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:function(e,t,n){return this.subVectors(t,e).multiplyScalar(n).add(e)},cross:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(e,t)):this.crossVectors(this,e)},crossVectors:function(e,t){var n=e.x,r=e.y,i=e.z,a=t.x,o=t.y,s=t.z;return this.x=r*s-i*o,this.y=i*a-n*s,this.z=n*o-r*a,this},projectOnVector:function(e){var t=e.dot(this)/e.lengthSq();return this.copy(e).multiplyScalar(t)},projectOnPlane:function(){var e=new b;return function(t){return e.copy(this).projectOnVector(t),this.sub(e)}}(),reflect:function(){var e=new b;return function(t){return this.sub(e.copy(t).multiplyScalar(2*this.dot(t)))}}(),angleTo:function(e){var t=this.dot(e)/Math.sqrt(this.lengthSq()*e.lengthSq());return Math.acos(m.clamp(t,-1,1))},distanceTo:function(e){return Math.sqrt(this.distanceToSquared(e))},distanceToSquared:function(e){var t=this.x-e.x,n=this.y-e.y,r=this.z-e.z;return t*t+n*n+r*r},manhattanDistanceTo:function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)},setFromSpherical:function(e){var t=Math.sin(e.phi)*e.radius;return this.x=t*Math.sin(e.theta),this.y=Math.cos(e.phi)*e.radius,this.z=t*Math.cos(e.theta),this},setFromCylindrical:function(e){return this.x=e.radius*Math.sin(e.theta),this.y=e.y,this.z=e.radius*Math.cos(e.theta),this},setFromMatrixPosition:function(e){var t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this},setFromMatrixScale:function(e){var t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=r,this},setFromMatrixColumn:function(e,t){return this.fromArray(e.elements,4*t)},equals:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this.z=e[t+2],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e},fromBufferAttribute:function(e,t,n){return void 0!==n&&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}}),Object.assign(w.prototype,{isMatrix3:!0,set:function(e,t,n,r,i,a,o,s,c){var l=this.elements;return l[0]=e,l[1]=r,l[2]=o,l[3]=t,l[4]=i,l[5]=s,l[6]=n,l[7]=a,l[8]=c,this},identity:function(){return this.set(1,0,0,0,1,0,0,0,1),this},clone:function(){return(new this.constructor).fromArray(this.elements)},copy:function(e){var 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},setFromMatrix4:function(e){var 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},applyToBufferAttribute:function(){var e=new b;return function(t){for(var n=0,r=t.count;n<r;n++)e.x=t.getX(n),e.y=t.getY(n),e.z=t.getZ(n),e.applyMatrix3(this),t.setXYZ(n,e.x,e.y,e.z);return t}}(),multiply:function(e){return this.multiplyMatrices(this,e)},premultiply:function(e){return this.multiplyMatrices(e,this)},multiplyMatrices:function(e,t){var n=e.elements,r=t.elements,i=this.elements,a=n[0],o=n[3],s=n[6],c=n[1],l=n[4],u=n[7],h=n[2],d=n[5],p=n[8],f=r[0],m=r[3],g=r[6],y=r[1],v=r[4],b=r[7],w=r[2],A=r[5],E=r[8];return i[0]=a*f+o*y+s*w,i[3]=a*m+o*v+s*A,i[6]=a*g+o*b+s*E,i[1]=c*f+l*y+u*w,i[4]=c*m+l*v+u*A,i[7]=c*g+l*b+u*E,i[2]=h*f+d*y+p*w,i[5]=h*m+d*v+p*A,i[8]=h*g+d*b+p*E,this},multiplyScalar:function(e){var 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:function(){var e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],c=e[7],l=e[8];return t*a*l-t*o*c-n*i*l+n*o*s+r*i*c-r*a*s},getInverse:function(e,t){e&&e.isMatrix4&&console.error("THREE.Matrix3: .getInverse() no longer takes a Matrix4 argument.");var n=e.elements,r=this.elements,i=n[0],a=n[1],o=n[2],s=n[3],c=n[4],l=n[5],u=n[6],h=n[7],d=n[8],p=d*c-l*h,f=l*u-d*s,m=h*s-c*u,g=i*p+a*f+o*m;if(0===g){var y="THREE.Matrix3: .getInverse() can't invert matrix, determinant is 0";if(!0===t)throw new Error(y);return console.warn(y),this.identity()}var v=1/g;return r[0]=p*v,r[1]=(o*h-d*a)*v,r[2]=(l*a-o*c)*v,r[3]=f*v,r[4]=(d*i-o*u)*v,r[5]=(o*s-l*i)*v,r[6]=m*v,r[7]=(a*u-h*i)*v,r[8]=(c*i-a*s)*v,this},transpose:function(){var 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:function(e){return this.setFromMatrix4(e).getInverse(this).transpose()},transposeIntoArray:function(e){var 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:function(e,t,n,r,i,a,o){var s=Math.cos(i),c=Math.sin(i);this.set(n*s,n*c,-n*(s*a+c*o)+a+e,-r*c,r*s,-r*(-c*a+s*o)+o+t,0,0,1)},scale:function(e,t){var n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=t,n[4]*=t,n[7]*=t,this},rotate:function(e){var t=Math.cos(e),n=Math.sin(e),r=this.elements,i=r[0],a=r[3],o=r[6],s=r[1],c=r[4],l=r[7];return r[0]=t*i+n*s,r[3]=t*a+n*c,r[6]=t*o+n*l,r[1]=-n*i+t*s,r[4]=-n*a+t*c,r[7]=-n*o+t*l,this},translate:function(e,t){var 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:function(e){for(var t=this.elements,n=e.elements,r=0;r<9;r++)if(t[r]!==n[r])return!1;return!0},fromArray:function(e,t){void 0===t&&(t=0);for(var n=0;n<9;n++)this.elements[n]=e[n+t];return this},toArray:function(e,t){void 0===e&&(e=[]),void 0===t&&(t=0);var 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}});var A=0;function E(e,t,n,r,i,a,o,s,c,l){Object.defineProperty(this,"id",{value:A++}),this.uuid=m.generateUUID(),this.name="",this.image=void 0!==e?e:E.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=void 0!==t?t:E.DEFAULT_MAPPING,this.wrapS=void 0!==n?n:1001,this.wrapT=void 0!==r?r:1001,this.magFilter=void 0!==i?i:1006,this.minFilter=void 0!==a?a:1008,this.anisotropy=void 0!==c?c:1,this.format=void 0!==o?o:1023,this.type=void 0!==s?s:1009,this.offset=new g(0,0),this.repeat=new g(1,1),this.center=new g(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new w,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=void 0!==l?l:3e3,this.version=0,this.onUpdate=null}function x(e,t,n,r){this.x=e||0,this.y=t||0,this.z=n||0,this.w=void 0!==r?r:1}function _(e,t,n){this.uuid=m.generateUUID(),this.width=e,this.height=t,this.scissor=new x(0,0,e,t),this.scissorTest=!1,this.viewport=new x(0,0,e,t),void 0===(n=n||{}).minFilter&&(n.minFilter=1006),this.texture=new E(void 0,void 0,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.encoding),this.depthBuffer=void 0===n.depthBuffer||n.depthBuffer,this.stencilBuffer=void 0===n.stencilBuffer||n.stencilBuffer,this.depthTexture=void 0!==n.depthTexture?n.depthTexture:null}function S(e,t,n){_.call(this,e,t,n),this.activeCubeFace=0,this.activeMipMapLevel=0}function M(e,t,n,r,i,a,o,s,c,l,u,h){E.call(this,null,a,o,s,c,l,r,i,u,h),this.image={data:e,width:t,height:n},this.magFilter=void 0!==c?c:1003,this.minFilter=void 0!==l?l:1003,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}function T(e,t,n,r,i,a,o,s,c,l){e=void 0!==e?e:[],t=void 0!==t?t:301,E.call(this,e,t,n,r,i,a,o,s,c,l),this.flipY=!1}E.DEFAULT_IMAGE=void 0,E.DEFAULT_MAPPING=300,E.prototype=Object.assign(Object.create(a.prototype),{constructor:E,isTexture:!0,clone:function(){return(new this.constructor).copy(this)},copy:function(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.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:function(e){var t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.textures[this.uuid])return e.textures[this.uuid];var 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],minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY};if(void 0!==this.image){var r=this.image;void 0===r.uuid&&(r.uuid=m.generateUUID()),t||void 0!==e.images[r.uuid]||(e.images[r.uuid]={uuid:r.uuid,url:function(e){var t;if(e instanceof HTMLCanvasElement)t=e;else{(t=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")).width=e.width,t.height=e.height;var n=t.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height)}return t.width>2048||t.height>2048?t.toDataURL("image/jpeg",.6):t.toDataURL("image/png")}(r)}),n.image=r.uuid}return t||(e.textures[this.uuid]=n),n},dispose:function(){this.dispatchEvent({type:"dispose"})},transformUv:function(e){if(300===this.mapping){if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case 1e3:e.x=e.x-Math.floor(e.x);break;case 1001:e.x=e.x<0?0:1;break;case 1002:1===Math.abs(Math.floor(e.x)%2)?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x)}if(e.y<0||e.y>1)switch(this.wrapT){case 1e3:e.y=e.y-Math.floor(e.y);break;case 1001:e.y=e.y<0?0:1;break;case 1002:1===Math.abs(Math.floor(e.y)%2)?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y)}this.flipY&&(e.y=1-e.y)}}}),Object.defineProperty(E.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),Object.assign(x.prototype,{isVector4:!0,set:function(e,t,n,r){return this.x=e,this.y=t,this.z=n,this.w=r,this},setScalar:function(e){return this.x=e,this.y=e,this.z=e,this.w=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setZ:function(e){return this.z=e,this},setW:function(e){return this.w=e,this},setComponent:function(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:function(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:function(){return new this.constructor(this.x,this.y,this.z,this.w)},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this},add:function(e,t){return void 0!==t?(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:function(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this},addVectors:function(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:function(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:function(e,t){return void 0!==t?(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:function(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this},subVectors:function(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},multiplyScalar:function(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this},applyMatrix4:function(e){var t=this.x,n=this.y,r=this.z,i=this.w,a=e.elements;return this.x=a[0]*t+a[4]*n+a[8]*r+a[12]*i,this.y=a[1]*t+a[5]*n+a[9]*r+a[13]*i,this.z=a[2]*t+a[6]*n+a[10]*r+a[14]*i,this.w=a[3]*t+a[7]*n+a[11]*r+a[15]*i,this},divideScalar:function(e){return this.multiplyScalar(1/e)},setAxisAngleFromQuaternion:function(e){this.w=2*Math.acos(e.w);var 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:function(e){var t,n,r,i,a=e.elements,o=a[0],s=a[4],c=a[8],l=a[1],u=a[5],h=a[9],d=a[2],p=a[6],f=a[10];if(Math.abs(s-l)<.01&&Math.abs(c-d)<.01&&Math.abs(h-p)<.01){if(Math.abs(s+l)<.1&&Math.abs(c+d)<.1&&Math.abs(h+p)<.1&&Math.abs(o+u+f-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;var m=(o+1)/2,g=(u+1)/2,y=(f+1)/2,v=(s+l)/4,b=(c+d)/4,w=(h+p)/4;return m>g&&m>y?m<.01?(n=0,r=.707106781,i=.707106781):(r=v/(n=Math.sqrt(m)),i=b/n):g>y?g<.01?(n=.707106781,r=0,i=.707106781):(n=v/(r=Math.sqrt(g)),i=w/r):y<.01?(n=.707106781,r=.707106781,i=0):(n=b/(i=Math.sqrt(y)),r=w/i),this.set(n,r,i,t),this}var A=Math.sqrt((p-h)*(p-h)+(c-d)*(c-d)+(l-s)*(l-s));return Math.abs(A)<.001&&(A=1),this.x=(p-h)/A,this.y=(c-d)/A,this.z=(l-s)/A,this.w=Math.acos((o+u+f-1)/2),this},min:function(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.w=Math.min(this.w,e.w),this},max:function(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.w=Math.max(this.w,e.w),this},clamp:function(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.w=Math.max(e.w,Math.min(t.w,this.w)),this},clampScalar:function(){var e,t;return function(n,r){return void 0===e&&(e=new x,t=new x),e.set(n,n,n,n),t.set(r,r,r,r),this.clamp(e,t)}}(),clampLength:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this},roundToZero:function(){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.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},dot:function(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(e){return this.normalize().multiplyScalar(e)},lerp:function(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.w+=(e.w-this.w)*t,this},lerpVectors:function(e,t,n){return this.subVectors(t,e).multiplyScalar(n).add(e)},equals:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e},fromBufferAttribute:function(e,t,n){return void 0!==n&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}}),_.prototype=Object.assign(Object.create(a.prototype),{constructor:_,isWebGLRenderTarget:!0,setSize:function(e,t){this.width===e&&this.height===t||(this.width=e,this.height=t,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.width=e.width,this.height=e.height,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.depthTexture=e.depthTexture,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),S.prototype=Object.create(_.prototype),S.prototype.constructor=S,S.prototype.isWebGLRenderTargetCube=!0,M.prototype=Object.create(E.prototype),M.prototype.constructor=M,M.prototype.isDataTexture=!0,T.prototype=Object.create(E.prototype),T.prototype.constructor=T,T.prototype.isCubeTexture=!0,Object.defineProperty(T.prototype,"images",{get:function(){return this.image},set:function(e){this.image=e}});var R=new E,k=new T;function C(){this.seq=[],this.map={}}var O=[],P=[],I=new Float32Array(16),N=new Float32Array(9);function L(e,t,n){var r=e[0];if(r<=0||r>0)return e;var i=t*n,a=O[i];if(void 0===a&&(a=new Float32Array(i),O[i]=a),0!==t){r.toArray(a,0);for(var o=1,s=0;o!==t;++o)s+=n,e[o].toArray(a,s)}return a}function D(e,t){var n=P[t];void 0===n&&(n=new Int32Array(t),P[t]=n);for(var r=0;r!==t;++r)n[r]=e.allocTextureUnit();return n}function F(e,t){e.uniform1f(this.addr,t)}function j(e,t){e.uniform1i(this.addr,t)}function U(e,t){void 0===t.x?e.uniform2fv(this.addr,t):e.uniform2f(this.addr,t.x,t.y)}function B(e,t){void 0!==t.x?e.uniform3f(this.addr,t.x,t.y,t.z):void 0!==t.r?e.uniform3f(this.addr,t.r,t.g,t.b):e.uniform3fv(this.addr,t)}function V(e,t){void 0===t.x?e.uniform4fv(this.addr,t):e.uniform4f(this.addr,t.x,t.y,t.z,t.w)}function z(e,t){e.uniformMatrix2fv(this.addr,!1,t.elements||t)}function H(e,t){void 0===t.elements?e.uniformMatrix3fv(this.addr,!1,t):(N.set(t.elements),e.uniformMatrix3fv(this.addr,!1,N))}function G(e,t){void 0===t.elements?e.uniformMatrix4fv(this.addr,!1,t):(I.set(t.elements),e.uniformMatrix4fv(this.addr,!1,I))}function q(e,t,n){var r=n.allocTextureUnit();e.uniform1i(this.addr,r),n.setTexture2D(t||R,r)}function W(e,t,n){var r=n.allocTextureUnit();e.uniform1i(this.addr,r),n.setTextureCube(t||k,r)}function J(e,t){e.uniform2iv(this.addr,t)}function Z(e,t){e.uniform3iv(this.addr,t)}function X(e,t){e.uniform4iv(this.addr,t)}function Y(e,t){e.uniform1fv(this.addr,t)}function K(e,t){e.uniform1iv(this.addr,t)}function Q(e,t){e.uniform2fv(this.addr,L(t,this.size,2))}function $(e,t){e.uniform3fv(this.addr,L(t,this.size,3))}function ee(e,t){e.uniform4fv(this.addr,L(t,this.size,4))}function te(e,t){e.uniformMatrix2fv(this.addr,!1,L(t,this.size,4))}function ne(e,t){e.uniformMatrix3fv(this.addr,!1,L(t,this.size,9))}function re(e,t){e.uniformMatrix4fv(this.addr,!1,L(t,this.size,16))}function ie(e,t,n){var r=t.length,i=D(n,r);e.uniform1iv(this.addr,i);for(var a=0;a!==r;++a)n.setTexture2D(t[a]||R,i[a])}function ae(e,t,n){var r=t.length,i=D(n,r);e.uniform1iv(this.addr,i);for(var a=0;a!==r;++a)n.setTextureCube(t[a]||k,i[a])}function oe(e,t,n){this.id=e,this.addr=n,this.setValue=function(e){switch(e){case 5126:return F;case 35664:return U;case 35665:return B;case 35666:return V;case 35674:return z;case 35675:return H;case 35676:return G;case 35678:case 36198:return q;case 35680:return W;case 5124:case 35670:return j;case 35667:case 35671:return J;case 35668:case 35672:return Z;case 35669:case 35673:return X}}(t.type)}function se(e,t,n){this.id=e,this.addr=n,this.size=t.size,this.setValue=function(e){switch(e){case 5126:return Y;case 35664:return Q;case 35665:return $;case 35666:return ee;case 35674:return te;case 35675:return ne;case 35676:return re;case 35678:return ie;case 35680:return ae;case 5124:case 35670:return K;case 35667:case 35671:return J;case 35668:case 35672:return Z;case 35669:case 35673:return X}}(t.type)}function ce(e){this.id=e,C.call(this)}ce.prototype.setValue=function(e,t){for(var n=this.seq,r=0,i=n.length;r!==i;++r){var a=n[r];a.setValue(e,t[a.id])}};var le=/([\w\d_]+)(\])?(\[|\.)?/g;function ue(e,t){e.seq.push(t),e.map[t.id]=t}function he(e,t,n){var r=e.name,i=r.length;for(le.lastIndex=0;;){var a=le.exec(r),o=le.lastIndex,s=a[1],c="]"===a[2],l=a[3];if(c&&(s|=0),void 0===l||"["===l&&o+2===i){ue(n,void 0===l?new oe(s,e,t):new se(s,e,t));break}var u=n.map[s];void 0===u&&ue(n,u=new ce(s)),n=u}}function de(e,t,n){C.call(this),this.renderer=n;for(var r=e.getProgramParameter(t,e.ACTIVE_UNIFORMS),i=0;i<r;++i){var a=e.getActiveUniform(t,i),o=a.name;he(a,e.getUniformLocation(t,o),this)}}de.prototype.setValue=function(e,t,n){var r=this.map[t];void 0!==r&&r.setValue(e,n,this.renderer)},de.prototype.setOptional=function(e,t,n){var r=t[n];void 0!==r&&this.setValue(e,n,r)},de.upload=function(e,t,n,r){for(var i=0,a=t.length;i!==a;++i){var o=t[i],s=n[o.id];!1!==s.needsUpdate&&o.setValue(e,s.value,r)}},de.seqWithValue=function(e,t){for(var n=[],r=0,i=e.length;r!==i;++r){var a=e[r];a.id in t&&n.push(a)}return n};var pe={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};function fe(e,t,n){return void 0===t&&void 0===n?this.set(e):this.setRGB(e,t,n)}Object.assign(fe.prototype,{isColor:!0,r:1,g:1,b:1,set:function(e){return e&&e.isColor?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e),this},setScalar:function(e){return this.r=e,this.g=e,this.b=e,this},setHex:function(e){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,this},setRGB:function(e,t,n){return this.r=e,this.g=t,this.b=n,this},setHSL:function(){function e(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+6*(t-e)*(2/3-n):e}return function(t,n,r){if(t=m.euclideanModulo(t,1),n=m.clamp(n,0,1),r=m.clamp(r,0,1),0===n)this.r=this.g=this.b=r;else{var i=r<=.5?r*(1+n):r+n-r*n,a=2*r-i;this.r=e(a,i,t+1/3),this.g=e(a,i,t),this.b=e(a,i,t-1/3)}return this}}(),setStyle:function(e){function t(t){void 0!==t&&parseFloat(t)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}var n;if(n=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(e)){var r,i=n[1],a=n[2];switch(i){case"rgb":case"rgba":if(r=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))return this.r=Math.min(255,parseInt(r[1],10))/255,this.g=Math.min(255,parseInt(r[2],10))/255,this.b=Math.min(255,parseInt(r[3],10))/255,t(r[5]),this;if(r=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))return this.r=Math.min(100,parseInt(r[1],10))/100,this.g=Math.min(100,parseInt(r[2],10))/100,this.b=Math.min(100,parseInt(r[3],10))/100,t(r[5]),this;break;case"hsl":case"hsla":if(r=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a)){var o=parseFloat(r[1])/360,s=parseInt(r[2],10)/100,c=parseInt(r[3],10)/100;return t(r[5]),this.setHSL(o,s,c)}}}else if(n=/^\#([A-Fa-f0-9]+)$/.exec(e)){var l,u=(l=n[1]).length;if(3===u)return this.r=parseInt(l.charAt(0)+l.charAt(0),16)/255,this.g=parseInt(l.charAt(1)+l.charAt(1),16)/255,this.b=parseInt(l.charAt(2)+l.charAt(2),16)/255,this;if(6===u)return this.r=parseInt(l.charAt(0)+l.charAt(1),16)/255,this.g=parseInt(l.charAt(2)+l.charAt(3),16)/255,this.b=parseInt(l.charAt(4)+l.charAt(5),16)/255,this}e&&e.length>0&&(void 0!==(l=pe[e])?this.setHex(l):console.warn("THREE.Color: Unknown color "+e));return this},clone:function(){return new this.constructor(this.r,this.g,this.b)},copy:function(e){return this.r=e.r,this.g=e.g,this.b=e.b,this},copyGammaToLinear:function(e,t){return void 0===t&&(t=2),this.r=Math.pow(e.r,t),this.g=Math.pow(e.g,t),this.b=Math.pow(e.b,t),this},copyLinearToGamma:function(e,t){void 0===t&&(t=2);var 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:function(){var e=this.r,t=this.g,n=this.b;return this.r=e*e,this.g=t*t,this.b=n*n,this},convertLinearToGamma:function(){return this.r=Math.sqrt(this.r),this.g=Math.sqrt(this.g),this.b=Math.sqrt(this.b),this},getHex:function(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0},getHexString:function(){return("000000"+this.getHex().toString(16)).slice(-6)},getHSL:function(e){var t,n,r=e||{h:0,s:0,l:0},i=this.r,a=this.g,o=this.b,s=Math.max(i,a,o),c=Math.min(i,a,o),l=(c+s)/2;if(c===s)t=0,n=0;else{var u=s-c;switch(n=l<=.5?u/(s+c):u/(2-s-c),s){case i:t=(a-o)/u+(a<o?6:0);break;case a:t=(o-i)/u+2;break;case o:t=(i-a)/u+4}t/=6}return r.h=t,r.s=n,r.l=l,r},getStyle:function(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"},offsetHSL:function(e,t,n){var r=this.getHSL();return r.h+=e,r.s+=t,r.l+=n,this.setHSL(r.h,r.s,r.l),this},add:function(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this},addColors:function(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this},addScalar:function(e){return this.r+=e,this.g+=e,this.b+=e,this},sub:function(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this},multiply:function(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this},multiplyScalar:function(e){return this.r*=e,this.g*=e,this.b*=e,this},lerp:function(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this},equals:function(e){return e.r===this.r&&e.g===this.g&&e.b===this.b},fromArray:function(e,t){return void 0===t&&(t=0),this.r=e[t],this.g=e[t+1],this.b=e[t+2],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e},toJSON:function(){return this.getHex()}});var me={common:{diffuse:{value:new fe(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new w},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98}},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 g(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:[]},directionalLights:{value:[],properties:{direction:{},color:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}}},points:{diffuse:{value:new fe(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},uvTransform:{value:new w}}},ge={merge:function(e){for(var t={},n=0;n<e.length;n++){var r=this.clone(e[n]);for(var i in r)t[i]=r[i]}return t},clone:function(e){var t={};for(var n in e)for(var r in t[n]={},e[n]){var i=e[n][r];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture)?t[n][r]=i.clone():Array.isArray(i)?t[n][r]=i.slice():t[n][r]=i}return t}},ye={alphamap_fragment:"#ifdef USE_ALPHAMAP\r\n\r\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\r\n\r\n#endif\r\n",alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\r\n\r\n\tuniform sampler2D alphaMap;\r\n\r\n#endif\r\n",alphatest_fragment:"#ifdef ALPHATEST\r\n\r\n\tif ( diffuseColor.a < ALPHATEST ) discard;\r\n\r\n#endif\r\n",aomap_fragment:"#ifdef USE_AOMAP\r\n\r\n\t// reads channel R, compatible with a combined OcclusionRoughnessMetallic (RGB) texture\r\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\r\n\r\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\r\n\r\n\t#if defined( USE_ENVMAP ) && defined( PHYSICAL )\r\n\r\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\r\n\r\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\r\n\r\n\t#endif\r\n\r\n#endif\r\n",aomap_pars_fragment:"#ifdef USE_AOMAP\r\n\r\n\tuniform sampler2D aoMap;\r\n\tuniform float aoMapIntensity;\r\n\r\n#endif",begin_vertex:"\r\nvec3 transformed = vec3( position );\r\n",beginnormal_vertex:"\r\nvec3 objectNormal = vec3( normal );\r\n",bsdfs:'float punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\r\n\r\n\tif( decayExponent > 0.0 ) {\r\n\r\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\r\n\r\n\t\t// based upon Frostbite 3 Moving to Physically-based Rendering\r\n\t\t// page 32, equation 26: E[window1]\r\n\t\t// https://seblagarde.files.wordpress.com/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf\r\n\t\t// this is intended to be used on spot and point lights who are represented as luminous intensity\r\n\t\t// but who must be converted to luminous irradiance for surface lighting calculation\r\n\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\r\n\t\tfloat maxDistanceCutoffFactor = pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\r\n\t\treturn distanceFalloff * maxDistanceCutoffFactor;\r\n\r\n#else\r\n\r\n\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\r\n\r\n#endif\r\n\r\n\t}\r\n\r\n\treturn 1.0;\r\n\r\n}\r\n\r\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\r\n\r\n\treturn RECIPROCAL_PI * diffuseColor;\r\n\r\n} // validated\r\n\r\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\r\n\r\n\t// Original approximation by Christophe Schlick \'94\r\n\t// float fresnel = pow( 1.0 - dotLH, 5.0 );\r\n\r\n\t// Optimized variant (presented by Epic at SIGGRAPH \'13)\r\n\t// https://cdn2.unrealengine.com/Resources/files/2013SiggraphPresentationsNotes-26915738.pdf\r\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\r\n\r\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\r\n\r\n} // validated\r\n\r\n// Microfacet Models for Refraction through Rough Surfaces - equation (34)\r\n// http://graphicrants.blogspot.com/2013/08/specular-brdf-reference.html\r\n// alpha is "roughness squared" in Disney’s reparameterization\r\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\r\n\r\n\t// geometry term (normalized) = G(l)⋅G(v) / 4(n⋅l)(n⋅v)\r\n\t// also see #12151\r\n\r\n\tfloat a2 = pow2( alpha );\r\n\r\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\r\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\r\n\r\n\treturn 1.0 / ( gl * gv );\r\n\r\n} // validated\r\n\r\n// Moving Frostbite to Physically Based Rendering 3.0 - page 12, listing 2\r\n// https://seblagarde.files.wordpress.com/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf\r\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\r\n\r\n\tfloat a2 = pow2( alpha );\r\n\r\n\t// dotNL and dotNV are explicitly swapped. This is not a mistake.\r\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\r\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\r\n\r\n\treturn 0.5 / max( gv + gl, EPSILON );\r\n\r\n}\r\n\r\n// Microfacet Models for Refraction through Rough Surfaces - equation (33)\r\n// http://graphicrants.blogspot.com/2013/08/specular-brdf-reference.html\r\n// alpha is "roughness squared" in Disney’s reparameterization\r\nfloat D_GGX( const in float alpha, const in float dotNH ) {\r\n\r\n\tfloat a2 = pow2( alpha );\r\n\r\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; // avoid alpha = 0 with dotNH = 1\r\n\r\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\r\n\r\n}\r\n\r\n// GGX Distribution, Schlick Fresnel, GGX-Smith Visibility\r\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\r\n\r\n\tfloat alpha = pow2( roughness ); // UE4\'s roughness\r\n\r\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\r\n\r\n\tfloat dotNL = saturate( dot( geometry.normal, incidentLight.direction ) );\r\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\r\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\r\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\r\n\r\n\tvec3 F = F_Schlick( specularColor, dotLH );\r\n\r\n\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\r\n\r\n\tfloat D = D_GGX( alpha, dotNH );\r\n\r\n\treturn F * ( G * D );\r\n\r\n} // validated\r\n\r\n// Rect Area Light\r\n\r\n// Real-Time Polygonal-Light Shading with Linearly Transformed Cosines\r\n// by Eric Heitz, Jonathan Dupuy, Stephen Hill and David Neubelt\r\n// code: https://github.com/selfshadow/ltc_code/\r\n\r\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\r\n\r\n\tconst float LUT_SIZE = 64.0;\r\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\r\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\r\n\r\n\tfloat dotNV = saturate( dot( N, V ) );\r\n\r\n\t// texture parameterized by sqrt( GGX alpha ) and sqrt( 1 - cos( theta ) )\r\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\r\n\r\n\tuv = uv * LUT_SCALE + LUT_BIAS;\r\n\r\n\treturn uv;\r\n\r\n}\r\n\r\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\r\n\r\n\t// Real-Time Area Lighting: a Journey from Research to Production (p.102)\r\n\t// An approximation of the form factor of a horizon-clipped rectangle.\r\n\r\n\tfloat l = length( f );\r\n\r\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\r\n\r\n}\r\n\r\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\r\n\r\n\tfloat x = dot( v1, v2 );\r\n\r\n\tfloat y = abs( x );\r\n\r\n\t// rational polynomial approximation to theta / sin( theta ) / 2PI\r\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\r\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\r\n\tfloat v = a / b;\r\n\r\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\r\n\r\n\treturn cross( v1, v2 ) * theta_sintheta;\r\n\r\n}\r\n\r\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\r\n\r\n\t// bail if point is on back side of plane of light\r\n\t// assumes ccw winding order of light vertices\r\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\r\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\r\n\tvec3 lightNormal = cross( v1, v2 );\r\n\r\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\r\n\r\n\t// construct orthonormal basis around N\r\n\tvec3 T1, T2;\r\n\tT1 = normalize( V - N * dot( V, N ) );\r\n\tT2 = - cross( N, T1 ); // negated from paper; possibly due to a different handedness of world coordinate system\r\n\r\n\t// compute transform\r\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\r\n\r\n\t// transform rect\r\n\tvec3 coords[ 4 ];\r\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\r\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\r\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\r\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\r\n\r\n\t// project rect onto sphere\r\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\r\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\r\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\r\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\r\n\r\n\t// calculate vector form factor\r\n\tvec3 vectorFormFactor = vec3( 0.0 );\r\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\r\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\r\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\r\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\r\n\r\n\t// adjust for horizon clipping\r\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\r\n\r\n\r\n\r\n\treturn vec3( result );\r\n\r\n}\r\n\r\n// End Rect Area Light\r\n\r\n// ref: https://www.unrealengine.com/blog/physically-based-shading-on-mobile - environmentBRDF for GGX on mobile\r\nvec3 BRDF_Specular_GGX_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\r\n\r\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\r\n\r\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\r\n\r\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\r\n\r\n\tvec4 r = roughness * c0 + c1;\r\n\r\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\r\n\r\n\tvec2 AB = vec2( -1.04, 1.04 ) * a004 + r.zw;\r\n\r\n\treturn specularColor * AB.x + AB.y;\r\n\r\n} // validated\r\n\r\n\r\nfloat G_BlinnPhong_Implicit( ) {\r\n\r\n\t// geometry term is (n dot l)(n dot v) / 4(n dot l)(n dot v)\r\n\treturn 0.25;\r\n\r\n}\r\n\r\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\r\n\r\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\r\n\r\n}\r\n\r\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\r\n\r\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\r\n\r\n\t//float dotNL = saturate( dot( geometry.normal, incidentLight.direction ) );\r\n\t//float dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\r\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\r\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\r\n\r\n\tvec3 F = F_Schlick( specularColor, dotLH );\r\n\r\n\tfloat G = G_BlinnPhong_Implicit( );\r\n\r\n\tfloat D = D_BlinnPhong( shininess, dotNH );\r\n\r\n\treturn F * ( G * D );\r\n\r\n} // validated\r\n\r\n// source: http://simonstechblog.blogspot.ca/2011/12/microfacet-brdf.html\r\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\r\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\r\n}\r\n\r\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\r\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\r\n}\r\n',bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\r\n\r\n\tuniform sampler2D bumpMap;\r\n\tuniform float bumpScale;\r\n\r\n\t// Derivative maps - bump mapping unparametrized surfaces by Morten Mikkelsen\r\n\t// http://mmikkelsen3d.blogspot.sk/2011/07/derivative-maps.html\r\n\r\n\t// Evaluate the derivative of the height w.r.t. screen-space using forward differencing (listing 2)\r\n\r\n\tvec2 dHdxy_fwd() {\r\n\r\n\t\tvec2 dSTdx = dFdx( vUv );\r\n\t\tvec2 dSTdy = dFdy( vUv );\r\n\r\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\r\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\r\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\r\n\r\n\t\treturn vec2( dBx, dBy );\r\n\r\n\t}\r\n\r\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\r\n\r\n\t\t// Workaround for Adreno 3XX dFd*( vec3 ) bug. See #9988\r\n\r\n\t\tvec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\r\n\t\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\r\n\t\tvec3 vN = surf_norm;\t\t// normalized\r\n\r\n\t\tvec3 R1 = cross( vSigmaY, vN );\r\n\t\tvec3 R2 = cross( vN, vSigmaX );\r\n\r\n\t\tfloat fDet = dot( vSigmaX, R1 );\r\n\r\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\r\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\r\n\r\n\t}\r\n\r\n#endif\r\n",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\r\n\r\n\tvec4 plane;\r\n\r\n\t#pragma unroll_loop\r\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\r\n\r\n\t\tplane = clippingPlanes[ i ];\r\n\t\tif ( dot( vViewPosition, plane.xyz ) > plane.w ) discard;\r\n\r\n\t}\r\n\r\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\r\n\r\n\t\tbool clipped = true;\r\n\r\n\t\t#pragma unroll_loop\r\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\r\n\r\n\t\t\tplane = clippingPlanes[ i ];\r\n\t\t\tclipped = ( dot( vViewPosition, plane.xyz ) > plane.w ) && clipped;\r\n\r\n\t\t}\r\n\r\n\t\tif ( clipped ) discard;\r\n\r\n\t#endif\r\n\r\n#endif\r\n",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\r\n\r\n\t#if ! defined( PHYSICAL ) && ! defined( PHONG )\r\n\t\tvarying vec3 vViewPosition;\r\n\t#endif\r\n\r\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\r\n\r\n#endif\r\n",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG )\r\n\tvarying vec3 vViewPosition;\r\n#endif\r\n",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG )\r\n\tvViewPosition = - mvPosition.xyz;\r\n#endif\r\n\r\n",color_fragment:"#ifdef USE_COLOR\r\n\r\n\tdiffuseColor.rgb *= vColor;\r\n\r\n#endif",color_pars_fragment:"#ifdef USE_COLOR\r\n\r\n\tvarying vec3 vColor;\r\n\r\n#endif\r\n",color_pars_vertex:"#ifdef USE_COLOR\r\n\r\n\tvarying vec3 vColor;\r\n\r\n#endif",color_vertex:"#ifdef USE_COLOR\r\n\r\n\tvColor.xyz = color.xyz;\r\n\r\n#endif",common:"#define PI 3.14159265359\r\n#define PI2 6.28318530718\r\n#define PI_HALF 1.5707963267949\r\n#define RECIPROCAL_PI 0.31830988618\r\n#define RECIPROCAL_PI2 0.15915494\r\n#define LOG2 1.442695\r\n#define EPSILON 1e-6\r\n\r\n#define saturate(a) clamp( a, 0.0, 1.0 )\r\n#define whiteCompliment(a) ( 1.0 - saturate( a ) )\r\n\r\nfloat pow2( const in float x ) { return x*x; }\r\nfloat pow3( const in float x ) { return x*x*x; }\r\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\r\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\r\n// expects values in the range of [0,1]x[0,1], returns values in the [0,1] range.\r\n// do not collapse into a single function per: http://byteblacksmith.com/improvements-to-the-canonical-one-liner-glsl-rand-for-opengl-es-2-0/\r\nhighp float rand( const in vec2 uv ) {\r\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\r\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\r\n\treturn fract(sin(sn) * c);\r\n}\r\n\r\nstruct IncidentLight {\r\n\tvec3 color;\r\n\tvec3 direction;\r\n\tbool visible;\r\n};\r\n\r\nstruct ReflectedLight {\r\n\tvec3 directDiffuse;\r\n\tvec3 directSpecular;\r\n\tvec3 indirectDiffuse;\r\n\tvec3 indirectSpecular;\r\n};\r\n\r\nstruct GeometricContext {\r\n\tvec3 position;\r\n\tvec3 normal;\r\n\tvec3 viewDir;\r\n};\r\n\r\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\r\n\r\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\r\n\r\n}\r\n\r\n// http://en.wikibooks.org/wiki/GLSL_Programming/Applying_Matrix_Transformations\r\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\r\n\r\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\r\n\r\n}\r\n\r\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\r\n\r\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\r\n\r\n\treturn - distance * planeNormal + point;\r\n\r\n}\r\n\r\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\r\n\r\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\r\n\r\n}\r\n\r\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\r\n\r\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\r\n\r\n}\r\n\r\nmat3 transposeMat3( const in mat3 m ) {\r\n\r\n\tmat3 tmp;\r\n\r\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\r\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\r\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\r\n\r\n\treturn tmp;\r\n\r\n}\r\n\r\n// https://en.wikipedia.org/wiki/Relative_luminance\r\nfloat linearToRelativeLuminance( const in vec3 color ) {\r\n\r\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\r\n\r\n\treturn dot( weights, color.rgb );\r\n\r\n}\r\n",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\r\n\r\n#define cubeUV_textureSize (1024.0)\r\n\r\nint getFaceFromDirection(vec3 direction) {\r\n\tvec3 absDirection = abs(direction);\r\n\tint face = -1;\r\n\tif( absDirection.x > absDirection.z ) {\r\n\t\tif(absDirection.x > absDirection.y )\r\n\t\t\tface = direction.x > 0.0 ? 0 : 3;\r\n\t\telse\r\n\t\t\tface = direction.y > 0.0 ? 1 : 4;\r\n\t}\r\n\telse {\r\n\t\tif(absDirection.z > absDirection.y )\r\n\t\t\tface = direction.z > 0.0 ? 2 : 5;\r\n\t\telse\r\n\t\t\tface = direction.y > 0.0 ? 1 : 4;\r\n\t}\r\n\treturn face;\r\n}\r\n#define cubeUV_maxLods1 (log2(cubeUV_textureSize*0.25) - 1.0)\r\n#define cubeUV_rangeClamp (exp2((6.0 - 1.0) * 2.0))\r\n\r\nvec2 MipLevelInfo( vec3 vec, float roughnessLevel, float roughness ) {\r\n\tfloat scale = exp2(cubeUV_maxLods1 - roughnessLevel);\r\n\tfloat dxRoughness = dFdx(roughness);\r\n\tfloat dyRoughness = dFdy(roughness);\r\n\tvec3 dx = dFdx( vec * scale * dxRoughness );\r\n\tvec3 dy = dFdy( vec * scale * dyRoughness );\r\n\tfloat d = max( dot( dx, dx ), dot( dy, dy ) );\r\n\t// Clamp the value to the max mip level counts. hard coded to 6 mips\r\n\td = clamp(d, 1.0, cubeUV_rangeClamp);\r\n\tfloat mipLevel = 0.5 * log2(d);\r\n\treturn vec2(floor(mipLevel), fract(mipLevel));\r\n}\r\n\r\n#define cubeUV_maxLods2 (log2(cubeUV_textureSize*0.25) - 2.0)\r\n#define cubeUV_rcpTextureSize (1.0 / cubeUV_textureSize)\r\n\r\nvec2 getCubeUV(vec3 direction, float roughnessLevel, float mipLevel) {\r\n\tmipLevel = roughnessLevel > cubeUV_maxLods2 - 3.0 ? 0.0 : mipLevel;\r\n\tfloat a = 16.0 * cubeUV_rcpTextureSize;\r\n\r\n\tvec2 exp2_packed = exp2( vec2( roughnessLevel, mipLevel ) );\r\n\tvec2 rcp_exp2_packed = vec2( 1.0 ) / exp2_packed;\r\n\t// float powScale = exp2(roughnessLevel + mipLevel);\r\n\tfloat powScale = exp2_packed.x * exp2_packed.y;\r\n\t// float scale = 1.0 / exp2(roughnessLevel + 2.0 + mipLevel);\r\n\tfloat scale = rcp_exp2_packed.x * rcp_exp2_packed.y * 0.25;\r\n\t// float mipOffset = 0.75*(1.0 - 1.0/exp2(mipLevel))/exp2(roughnessLevel);\r\n\tfloat mipOffset = 0.75*(1.0 - rcp_exp2_packed.y) * rcp_exp2_packed.x;\r\n\r\n\tbool bRes = mipLevel == 0.0;\r\n\tscale = bRes && (scale < a) ? a : scale;\r\n\r\n\tvec3 r;\r\n\tvec2 offset;\r\n\tint face = getFaceFromDirection(direction);\r\n\r\n\tfloat rcpPowScale = 1.0 / powScale;\r\n\r\n\tif( face == 0) {\r\n\t\tr = vec3(direction.x, -direction.z, direction.y);\r\n\t\toffset = vec2(0.0+mipOffset,0.75 * rcpPowScale);\r\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\r\n\t}\r\n\telse if( face == 1) {\r\n\t\tr = vec3(direction.y, direction.x, direction.z);\r\n\t\toffset = vec2(scale+mipOffset, 0.75 * rcpPowScale);\r\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\r\n\t}\r\n\telse if( face == 2) {\r\n\t\tr = vec3(direction.z, direction.x, direction.y);\r\n\t\toffset = vec2(2.0*scale+mipOffset, 0.75 * rcpPowScale);\r\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\r\n\t}\r\n\telse if( face == 3) {\r\n\t\tr = vec3(direction.x, direction.z, direction.y);\r\n\t\toffset = vec2(0.0+mipOffset,0.5 * rcpPowScale);\r\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\r\n\t}\r\n\telse if( face == 4) {\r\n\t\tr = vec3(direction.y, direction.x, -direction.z);\r\n\t\toffset = vec2(scale+mipOffset, 0.5 * rcpPowScale);\r\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\r\n\t}\r\n\telse {\r\n\t\tr = vec3(direction.z, -direction.x, direction.y);\r\n\t\toffset = vec2(2.0*scale+mipOffset, 0.5 * rcpPowScale);\r\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\r\n\t}\r\n\tr = normalize(r);\r\n\tfloat texelOffset = 0.5 * cubeUV_rcpTextureSize;\r\n\tvec2 s = ( r.yz / abs( r.x ) + vec2( 1.0 ) ) * 0.5;\r\n\tvec2 base = offset + vec2( texelOffset );\r\n\treturn base + s * ( scale - 2.0 * texelOffset );\r\n}\r\n\r\n#define cubeUV_maxLods3 (log2(cubeUV_textureSize*0.25) - 3.0)\r\n\r\nvec4 textureCubeUV(vec3 reflectedDirection, float roughness ) {\r\n\tfloat roughnessVal = roughness* cubeUV_maxLods3;\r\n\tfloat r1 = floor(roughnessVal);\r\n\tfloat r2 = r1 + 1.0;\r\n\tfloat t = fract(roughnessVal);\r\n\tvec2 mipInfo = MipLevelInfo(reflectedDirection, r1, roughness);\r\n\tfloat s = mipInfo.y;\r\n\tfloat level0 = mipInfo.x;\r\n\tfloat level1 = level0 + 1.0;\r\n\tlevel1 = level1 > 5.0 ? 5.0 : level1;\r\n\r\n\t// round to nearest mipmap if we are not interpolating.\r\n\tlevel0 += min( floor( s + 0.5 ), 5.0 );\r\n\r\n\t// Tri linear interpolation.\r\n\tvec2 uv_10 = getCubeUV(reflectedDirection, r1, level0);\r\n\tvec4 color10 = envMapTexelToLinear(texture2D(envMap, uv_10));\r\n\r\n\tvec2 uv_20 = getCubeUV(reflectedDirection, r2, level0);\r\n\tvec4 color20 = envMapTexelToLinear(texture2D(envMap, uv_20));\r\n\r\n\tvec4 result = mix(color10, color20, t);\r\n\r\n\treturn vec4(result.rgb, 1.0);\r\n}\r\n\r\n#endif\r\n",defaultnormal_vertex:"vec3 transformedNormal = normalMatrix * objectNormal;\r\n\r\n#ifdef FLIP_SIDED\r\n\r\n\ttransformedNormal = - transformedNormal;\r\n\r\n#endif\r\n",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\r\n\r\n\tuniform sampler2D displacementMap;\r\n\tuniform float displacementScale;\r\n\tuniform float displacementBias;\r\n\r\n#endif\r\n",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\r\n\r\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\r\n\r\n#endif\r\n",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\r\n\r\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\r\n\r\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\r\n\r\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\r\n\r\n#endif\r\n",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\r\n\r\n\tuniform sampler2D emissiveMap;\r\n\r\n#endif\r\n",encodings_fragment:" gl_FragColor = linearToOutputTexel( gl_FragColor );\r\n",encodings_pars_fragment:"// For a discussion of what this is, please read this: http://lousodrome.net/blog/light/2013/05/26/gamma-correct-and-hdr-rendering-in-a-32-bits-buffer/\r\n\r\nvec4 LinearToLinear( in vec4 value ) {\r\n\treturn value;\r\n}\r\n\r\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\r\n\treturn vec4( pow( value.xyz, vec3( gammaFactor ) ), value.w );\r\n}\r\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\r\n\treturn vec4( pow( value.xyz, vec3( 1.0 / gammaFactor ) ), value.w );\r\n}\r\n\r\nvec4 sRGBToLinear( in vec4 value ) {\r\n\treturn 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 );\r\n}\r\nvec4 LinearTosRGB( in vec4 value ) {\r\n\treturn 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 );\r\n}\r\n\r\nvec4 RGBEToLinear( in vec4 value ) {\r\n\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\r\n}\r\nvec4 LinearToRGBE( in vec4 value ) {\r\n\tfloat maxComponent = max( max( value.r, value.g ), value.b );\r\n\tfloat fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\r\n\treturn vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\r\n// return vec4( value.brg, ( 3.0 + 128.0 ) / 256.0 );\r\n}\r\n\r\n// reference: http://iwasbeingirony.blogspot.ca/2010/06/difference-between-rgbm-and-rgbd.html\r\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\r\n\treturn vec4( value.xyz * value.w * maxRange, 1.0 );\r\n}\r\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\r\n\tfloat maxRGB = max( value.x, max( value.g, value.b ) );\r\n\tfloat M = clamp( maxRGB / maxRange, 0.0, 1.0 );\r\n\tM = ceil( M * 255.0 ) / 255.0;\r\n\treturn vec4( value.rgb / ( M * maxRange ), M );\r\n}\r\n\r\n// reference: http://iwasbeingirony.blogspot.ca/2010/06/difference-between-rgbm-and-rgbd.html\r\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\r\n\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\r\n}\r\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\r\n\tfloat maxRGB = max( value.x, max( value.g, value.b ) );\r\n\tfloat D = max( maxRange / maxRGB, 1.0 );\r\n\tD = min( floor( D ) / 255.0, 1.0 );\r\n\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\r\n}\r\n\r\n// LogLuv reference: http://graphicrants.blogspot.ca/2009/04/rgbm-color-encoding.html\r\n\r\n// M matrix, for encoding\r\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\r\nvec4 LinearToLogLuv( in vec4 value ) {\r\n\tvec3 Xp_Y_XYZp = value.rgb * cLogLuvM;\r\n\tXp_Y_XYZp = max(Xp_Y_XYZp, vec3(1e-6, 1e-6, 1e-6));\r\n\tvec4 vResult;\r\n\tvResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\r\n\tfloat Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\r\n\tvResult.w = fract(Le);\r\n\tvResult.z = (Le - (floor(vResult.w*255.0))/255.0)/255.0;\r\n\treturn vResult;\r\n}\r\n\r\n// Inverse M matrix, for decoding\r\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\r\nvec4 LogLuvToLinear( in vec4 value ) {\r\n\tfloat Le = value.z * 255.0 + value.w;\r\n\tvec3 Xp_Y_XYZp;\r\n\tXp_Y_XYZp.y = exp2((Le - 127.0) / 2.0);\r\n\tXp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\r\n\tXp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\r\n\tvec3 vRGB = Xp_Y_XYZp.rgb * cLogLuvInverseM;\r\n\treturn vec4( max(vRGB, 0.0), 1.0 );\r\n}\r\n",envmap_fragment:"#ifdef USE_ENVMAP\r\n\r\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\r\n\r\n\t\tvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\r\n\r\n\t\t// Transforming Normal Vectors with the Inverse Transformation\r\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\r\n\r\n\t\t#ifdef ENVMAP_MODE_REFLECTION\r\n\r\n\t\t\tvec3 reflectVec = reflect( cameraToVertex, worldNormal );\r\n\r\n\t\t#else\r\n\r\n\t\t\tvec3 reflectVec = refract( cameraToVertex, worldNormal, refractionRatio );\r\n\r\n\t\t#endif\r\n\r\n\t#else\r\n\r\n\t\tvec3 reflectVec = vReflect;\r\n\r\n\t#endif\r\n\r\n\t#ifdef ENVMAP_TYPE_CUBE\r\n\r\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\r\n\r\n\t#elif defined( ENVMAP_TYPE_EQUIREC )\r\n\r\n\t\tvec2 sampleUV;\r\n\r\n\t\treflectVec = normalize( reflectVec );\r\n\r\n\t\tsampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\r\n\r\n\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\r\n\r\n\t\tvec4 envColor = texture2D( envMap, sampleUV );\r\n\r\n\t#elif defined( ENVMAP_TYPE_SPHERE )\r\n\r\n\t\treflectVec = normalize( reflectVec );\r\n\r\n\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0, 0.0, 1.0 ) );\r\n\r\n\t\tvec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\r\n\r\n\t#else\r\n\r\n\t\tvec4 envColor = vec4( 0.0 );\r\n\r\n\t#endif\r\n\r\n\tenvColor = envMapTexelToLinear( envColor );\r\n\r\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\r\n\r\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\r\n\r\n\t#elif defined( ENVMAP_BLENDING_MIX )\r\n\r\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\r\n\r\n\t#elif defined( ENVMAP_BLENDING_ADD )\r\n\r\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\r\n\r\n\t#endif\r\n\r\n#endif\r\n",envmap_pars_fragment:"#if defined( USE_ENVMAP ) || defined( PHYSICAL )\r\n\tuniform float reflectivity;\r\n\tuniform float envMapIntensity;\r\n#endif\r\n\r\n#ifdef USE_ENVMAP\r\n\r\n\t#if ! defined( PHYSICAL ) && ( defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) )\r\n\t\tvarying vec3 vWorldPosition;\r\n\t#endif\r\n\r\n\t#ifdef ENVMAP_TYPE_CUBE\r\n\t\tuniform samplerCube envMap;\r\n\t#else\r\n\t\tuniform sampler2D envMap;\r\n\t#endif\r\n\tuniform float flipEnvMap;\r\n\r\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( PHYSICAL )\r\n\t\tuniform float refractionRatio;\r\n\t#else\r\n\t\tvarying vec3 vReflect;\r\n\t#endif\r\n\r\n#endif\r\n",envmap_pars_vertex:"#ifdef USE_ENVMAP\r\n\r\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\r\n\t\tvarying vec3 vWorldPosition;\r\n\r\n\t#else\r\n\r\n\t\tvarying vec3 vReflect;\r\n\t\tuniform float refractionRatio;\r\n\r\n\t#endif\r\n\r\n#endif\r\n",envmap_vertex:"#ifdef USE_ENVMAP\r\n\r\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\r\n\r\n\t\tvWorldPosition = worldPosition.xyz;\r\n\r\n\t#else\r\n\r\n\t\tvec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\r\n\r\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\r\n\r\n\t\t#ifdef ENVMAP_MODE_REFLECTION\r\n\r\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\r\n\r\n\t\t#else\r\n\r\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\r\n\r\n\t\t#endif\r\n\r\n\t#endif\r\n\r\n#endif\r\n",fog_vertex:"\r\n#ifdef USE_FOG\r\nfogDepth = -mvPosition.z;\r\n#endif",fog_pars_vertex:"#ifdef USE_FOG\r\n\r\n varying float fogDepth;\r\n\r\n#endif\r\n",fog_fragment:"#ifdef USE_FOG\r\n\r\n\t#ifdef FOG_EXP2\r\n\r\n\t\tfloat fogFactor = whiteCompliment( exp2( - fogDensity * fogDensity * fogDepth * fogDepth * LOG2 ) );\r\n\r\n\t#else\r\n\r\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, fogDepth );\r\n\r\n\t#endif\r\n\r\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\r\n\r\n#endif\r\n",fog_pars_fragment:"#ifdef USE_FOG\r\n\r\n\tuniform vec3 fogColor;\r\n\tvarying float fogDepth;\r\n\r\n\t#ifdef FOG_EXP2\r\n\r\n\t\tuniform float fogDensity;\r\n\r\n\t#else\r\n\r\n\t\tuniform float fogNear;\r\n\t\tuniform float fogFar;\r\n\r\n\t#endif\r\n\r\n#endif\r\n",gradientmap_pars_fragment:"#ifdef TOON\r\n\r\n\tuniform sampler2D gradientMap;\r\n\r\n\tvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\r\n\r\n\t\t// dotNL will be from -1.0 to 1.0\r\n\t\tfloat dotNL = dot( normal, lightDirection );\r\n\t\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\r\n\r\n\t\t#ifdef USE_GRADIENTMAP\r\n\r\n\t\t\treturn texture2D( gradientMap, coord ).rgb;\r\n\r\n\t\t#else\r\n\r\n\t\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\r\n\r\n\t\t#endif\r\n\r\n\r\n\t}\r\n\r\n#endif\r\n",lightmap_fragment:"#ifdef USE_LIGHTMAP\r\n\r\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity; // factor of PI should not be present; included here to prevent breakage\r\n\r\n#endif\r\n",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\r\n\r\n\tuniform sampler2D lightMap;\r\n\tuniform float lightMapIntensity;\r\n\r\n#endif",lights_lambert_vertex:"vec3 diffuse = vec3( 1.0 );\r\n\r\nGeometricContext geometry;\r\ngeometry.position = mvPosition.xyz;\r\ngeometry.normal = normalize( transformedNormal );\r\ngeometry.viewDir = normalize( -mvPosition.xyz );\r\n\r\nGeometricContext backGeometry;\r\nbackGeometry.position = geometry.position;\r\nbackGeometry.normal = -geometry.normal;\r\nbackGeometry.viewDir = geometry.viewDir;\r\n\r\nvLightFront = vec3( 0.0 );\r\n\r\n#ifdef DOUBLE_SIDED\r\n\tvLightBack = vec3( 0.0 );\r\n#endif\r\n\r\nIncidentLight directLight;\r\nfloat dotNL;\r\nvec3 directLightColor_Diffuse;\r\n\r\n#if NUM_POINT_LIGHTS > 0\r\n\r\n\t#pragma unroll_loop\r\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\r\n\r\n\t\tgetPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\r\n\r\n\t\tdotNL = dot( geometry.normal, directLight.direction );\r\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\r\n\r\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\r\n\r\n\t\t#ifdef DOUBLE_SIDED\r\n\r\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\r\n\r\n\t\t#endif\r\n\r\n\t}\r\n\r\n#endif\r\n\r\n#if NUM_SPOT_LIGHTS > 0\r\n\r\n\t#pragma unroll_loop\r\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\r\n\r\n\t\tgetSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\r\n\r\n\t\tdotNL = dot( geometry.normal, directLight.direction );\r\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\r\n\r\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\r\n\r\n\t\t#ifdef DOUBLE_SIDED\r\n\r\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\r\n\r\n\t\t#endif\r\n\t}\r\n\r\n#endif\r\n\r\n\r\n\r\n#if NUM_DIR_LIGHTS > 0\r\n\r\n\t#pragma unroll_loop\r\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\r\n\r\n\t\tgetDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\r\n\r\n\t\tdotNL = dot( geometry.normal, directLight.direction );\r\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\r\n\r\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\r\n\r\n\t\t#ifdef DOUBLE_SIDED\r\n\r\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\r\n\r\n\t\t#endif\r\n\r\n\t}\r\n\r\n#endif\r\n\r\n#if NUM_HEMI_LIGHTS > 0\r\n\r\n\t#pragma unroll_loop\r\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\r\n\r\n\t\tvLightFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\r\n\r\n\t\t#ifdef DOUBLE_SIDED\r\n\r\n\t\t\tvLightBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\r\n\r\n\t\t#endif\r\n\r\n\t}\r\n\r\n#endif\r\n",lights_pars:"uniform vec3 ambientLightColor;\r\n\r\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\r\n\r\n\tvec3 irradiance = ambientLightColor;\r\n\r\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\r\n\r\n\t\tirradiance *= PI;\r\n\r\n\t#endif\r\n\r\n\treturn irradiance;\r\n\r\n}\r\n\r\n#if NUM_DIR_LIGHTS > 0\r\n\r\n\tstruct DirectionalLight {\r\n\t\tvec3 direction;\r\n\t\tvec3 color;\r\n\r\n\t\tint shadow;\r\n\t\tfloat shadowBias;\r\n\t\tfloat shadowRadius;\r\n\t\tvec2 shadowMapSize;\r\n\t};\r\n\r\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\r\n\r\n\tvoid getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\r\n\r\n\t\tdirectLight.color = directionalLight.color;\r\n\t\tdirectLight.direction = directionalLight.direction;\r\n\t\tdirectLight.visible = true;\r\n\r\n\t}\r\n\r\n#endif\r\n\r\n\r\n#if NUM_POINT_LIGHTS > 0\r\n\r\n\tstruct PointLight {\r\n\t\tvec3 position;\r\n\t\tvec3 color;\r\n\t\tfloat distance;\r\n\t\tfloat decay;\r\n\r\n\t\tint shadow;\r\n\t\tfloat shadowBias;\r\n\t\tfloat shadowRadius;\r\n\t\tvec2 shadowMapSize;\r\n\t\tfloat shadowCameraNear;\r\n\t\tfloat shadowCameraFar;\r\n\t};\r\n\r\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\r\n\r\n\t// directLight is an out parameter as having it as a return value caused compiler errors on some devices\r\n\tvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\r\n\r\n\t\tvec3 lVector = pointLight.position - geometry.position;\r\n\t\tdirectLight.direction = normalize( lVector );\r\n\r\n\t\tfloat lightDistance = length( lVector );\r\n\r\n\t\tdirectLight.color = pointLight.color;\r\n\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\r\n\t\tdirectLight.visible = ( directLight.color != vec3( 0.0 ) );\r\n\r\n\t}\r\n\r\n#endif\r\n\r\n\r\n#if NUM_SPOT_LIGHTS > 0\r\n\r\n\tstruct SpotLight {\r\n\t\tvec3 position;\r\n\t\tvec3 direction;\r\n\t\tvec3 color;\r\n\t\tfloat distance;\r\n\t\tfloat decay;\r\n\t\tfloat coneCos;\r\n\t\tfloat penumbraCos;\r\n\r\n\t\tint shadow;\r\n\t\tfloat shadowBias;\r\n\t\tfloat shadowRadius;\r\n\t\tvec2 shadowMapSize;\r\n\t};\r\n\r\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\r\n\r\n\t// directLight is an out parameter as having it as a return value caused compiler errors on some devices\r\n\tvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) {\r\n\r\n\t\tvec3 lVector = spotLight.position - geometry.position;\r\n\t\tdirectLight.direction = normalize( lVector );\r\n\r\n\t\tfloat lightDistance = length( lVector );\r\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\r\n\r\n\t\tif ( angleCos > spotLight.coneCos ) {\r\n\r\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\r\n\r\n\t\t\tdirectLight.color = spotLight.color;\r\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\r\n\t\t\tdirectLight.visible = true;\r\n\r\n\t\t} else {\r\n\r\n\t\t\tdirectLight.color = vec3( 0.0 );\r\n\t\t\tdirectLight.visible = false;\r\n\r\n\t\t}\r\n\t}\r\n\r\n#endif\r\n\r\n\r\n#if NUM_RECT_AREA_LIGHTS > 0\r\n\r\n\tstruct RectAreaLight {\r\n\t\tvec3 color;\r\n\t\tvec3 position;\r\n\t\tvec3 halfWidth;\r\n\t\tvec3 halfHeight;\r\n\t};\r\n\r\n\t// Pre-computed values of LinearTransformedCosine approximation of BRDF\r\n\t// BRDF approximation Texture is 64x64\r\n\tuniform sampler2D ltc_1; // RGBA Float\r\n\tuniform sampler2D ltc_2; // RGBA Float\r\n\r\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\r\n\r\n#endif\r\n\r\n\r\n#if NUM_HEMI_LIGHTS > 0\r\n\r\n\tstruct HemisphereLight {\r\n\t\tvec3 direction;\r\n\t\tvec3 skyColor;\r\n\t\tvec3 groundColor;\r\n\t};\r\n\r\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\r\n\r\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\r\n\r\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\r\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\r\n\r\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\r\n\r\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\r\n\r\n\t\t\tirradiance *= PI;\r\n\r\n\t\t#endif\r\n\r\n\t\treturn irradiance;\r\n\r\n\t}\r\n\r\n#endif\r\n\r\n\r\n#if defined( USE_ENVMAP ) && defined( PHYSICAL )\r\n\r\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\r\n\r\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\r\n\r\n\t\t#ifdef ENVMAP_TYPE_CUBE\r\n\r\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\r\n\r\n\t\t\t// TODO: replace with properly filtered cubemaps and access the irradiance LOD level, be it the last LOD level\r\n\t\t\t// of a specular cubemap, or just the default level of a specially created irradiance cubemap.\r\n\r\n\t\t\t#ifdef TEXTURE_LOD_EXT\r\n\r\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\r\n\r\n\t\t\t#else\r\n\r\n\t\t\t\t// force the bias high to get the last LOD level as it is the most blurred.\r\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\r\n\r\n\t\t\t#endif\r\n\r\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\r\n\r\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\r\n\r\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\r\n\t\t\tvec4 envMapColor = textureCubeUV( queryVec, 1.0 );\r\n\r\n\t\t#else\r\n\r\n\t\t\tvec4 envMapColor = vec4( 0.0 );\r\n\r\n\t\t#endif\r\n\r\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\r\n\r\n\t}\r\n\r\n\t// taken from here: http://casual-effects.blogspot.ca/2011/08/plausible-environment-lighting-in-two.html\r\n\tfloat getSpecularMIPLevel( const in float blinnShininessExponent, const in int maxMIPLevel ) {\r\n\r\n\t\t//float envMapWidth = pow( 2.0, maxMIPLevelScalar );\r\n\t\t//float desiredMIPLevel = log2( envMapWidth * sqrt( 3.0 ) ) - 0.5 * log2( pow2( blinnShininessExponent ) + 1.0 );\r\n\r\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\r\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar + 0.79248 - 0.5 * log2( pow2( blinnShininessExponent ) + 1.0 );\r\n\r\n\t\t// clamp to allowable LOD ranges.\r\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\r\n\r\n\t}\r\n\r\n\tvec3 getLightProbeIndirectRadiance( const in GeometricContext geometry, const in float blinnShininessExponent, const in int maxMIPLevel ) {\r\n\r\n\t\t#ifdef ENVMAP_MODE_REFLECTION\r\n\r\n\t\t\tvec3 reflectVec = reflect( -geometry.viewDir, geometry.normal );\r\n\r\n\t\t#else\r\n\r\n\t\t\tvec3 reflectVec = refract( -geometry.viewDir, geometry.normal, refractionRatio );\r\n\r\n\t\t#endif\r\n\r\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\r\n\r\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( blinnShininessExponent, maxMIPLevel );\r\n\r\n\t\t#ifdef ENVMAP_TYPE_CUBE\r\n\r\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\r\n\r\n\t\t\t#ifdef TEXTURE_LOD_EXT\r\n\r\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\r\n\r\n\t\t\t#else\r\n\r\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\r\n\r\n\t\t\t#endif\r\n\r\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\r\n\r\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\r\n\r\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\r\n\t\t\tvec4 envMapColor = textureCubeUV(queryReflectVec, BlinnExponentToGGXRoughness(blinnShininessExponent));\r\n\r\n\t\t#elif defined( ENVMAP_TYPE_EQUIREC )\r\n\r\n\t\t\tvec2 sampleUV;\r\n\t\t\tsampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\r\n\t\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\r\n\r\n\t\t\t#ifdef TEXTURE_LOD_EXT\r\n\r\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, sampleUV, specularMIPLevel );\r\n\r\n\t\t\t#else\r\n\r\n\t\t\t\tvec4 envMapColor = texture2D( envMap, sampleUV, specularMIPLevel );\r\n\r\n\t\t\t#endif\r\n\r\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\r\n\r\n\t\t#elif defined( ENVMAP_TYPE_SPHERE )\r\n\r\n\t\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0,0.0,1.0 ) );\r\n\r\n\t\t\t#ifdef TEXTURE_LOD_EXT\r\n\r\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\r\n\r\n\t\t\t#else\r\n\r\n\t\t\t\tvec4 envMapColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\r\n\r\n\t\t\t#endif\r\n\r\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\r\n\r\n\t\t#endif\r\n\r\n\t\treturn envMapColor.rgb * envMapIntensity;\r\n\r\n\t}\r\n\r\n#endif\r\n",lights_phong_fragment:"BlinnPhongMaterial material;\r\nmaterial.diffuseColor = diffuseColor.rgb;\r\nmaterial.specularColor = specular;\r\nmaterial.specularShininess = shininess;\r\nmaterial.specularStrength = specularStrength;\r\n",lights_phong_pars_fragment:"varying vec3 vViewPosition;\r\n\r\n#ifndef FLAT_SHADED\r\n\r\n\tvarying vec3 vNormal;\r\n\r\n#endif\r\n\r\n\r\nstruct BlinnPhongMaterial {\r\n\r\n\tvec3\tdiffuseColor;\r\n\tvec3\tspecularColor;\r\n\tfloat\tspecularShininess;\r\n\tfloat\tspecularStrength;\r\n\r\n};\r\n\r\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\r\n\r\n\t#ifdef TOON\r\n\r\n\t\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\r\n\r\n\t#else\r\n\r\n\t\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\r\n\t\tvec3 irradiance = dotNL * directLight.color;\r\n\r\n\t#endif\r\n\r\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\r\n\r\n\t\tirradiance *= PI; // punctual light\r\n\r\n\t#endif\r\n\r\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\r\n\r\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\r\n\r\n}\r\n\r\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\r\n\r\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\r\n\r\n}\r\n\r\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\r\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\r\n\r\n#define Material_LightProbeLOD( material )\t(0)\r\n",lights_physical_fragment:"PhysicalMaterial material;\r\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\r\nmaterial.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 );\r\n#ifdef STANDARD\r\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\r\n#else\r\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\r\n\tmaterial.clearCoat = saturate( clearCoat ); // Burley clearcoat model\r\n\tmaterial.clearCoatRoughness = clamp( clearCoatRoughness, 0.04, 1.0 );\r\n#endif\r\n",lights_physical_pars_fragment:"struct PhysicalMaterial {\r\n\r\n\tvec3\tdiffuseColor;\r\n\tfloat\tspecularRoughness;\r\n\tvec3\tspecularColor;\r\n\r\n\t#ifndef STANDARD\r\n\t\tfloat clearCoat;\r\n\t\tfloat clearCoatRoughness;\r\n\t#endif\r\n\r\n};\r\n\r\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\r\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\r\n\r\n// Clear coat directional hemishperical reflectance (this approximation should be improved)\r\nfloat clearCoatDHRApprox( const in float roughness, const in float dotNL ) {\r\n\r\n\treturn DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\r\n\r\n}\r\n\r\n#if NUM_RECT_AREA_LIGHTS > 0\r\n\r\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\r\n\r\n\t\tvec3 normal = geometry.normal;\r\n\t\tvec3 viewDir = geometry.viewDir;\r\n\t\tvec3 position = geometry.position;\r\n\t\tvec3 lightPos = rectAreaLight.position;\r\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\r\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\r\n\t\tvec3 lightColor = rectAreaLight.color;\r\n\t\tfloat roughness = material.specularRoughness;\r\n\r\n\t\tvec3 rectCoords[ 4 ];\r\n\t\trectCoords[ 0 ] = lightPos - halfWidth - halfHeight; // counterclockwise\r\n\t\trectCoords[ 1 ] = lightPos + halfWidth - halfHeight;\r\n\t\trectCoords[ 2 ] = lightPos + halfWidth + halfHeight;\r\n\t\trectCoords[ 3 ] = lightPos - halfWidth + halfHeight;\r\n\r\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\r\n\r\n\t\tvec4 t1 = texture2D( ltc_1, uv );\r\n\t\tvec4 t2 = texture2D( ltc_2, uv );\r\n\r\n\t\tmat3 mInv = mat3(\r\n\t\t\tvec3( t1.x, 0, t1.y ),\r\n\t\t\tvec3( 0, 1, 0 ),\r\n\t\t\tvec3( t1.z, 0, t1.w )\r\n\t\t);\r\n\r\n\t\t// LTC Fresnel Approximation by Stephen Hill\r\n\t\t// http://blog.selfshadow.com/publications/s2016-advances/s2016_ltc_fresnel.pdf\r\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\r\n\r\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\r\n\r\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\r\n\r\n\t}\r\n\r\n#endif\r\n\r\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\r\n\r\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\r\n\r\n\tvec3 irradiance = dotNL * directLight.color;\r\n\r\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\r\n\r\n\t\tirradiance *= PI; // punctual light\r\n\r\n\t#endif\r\n\r\n\t#ifndef STANDARD\r\n\t\tfloat clearCoatDHR = material.clearCoat * clearCoatDHRApprox( material.clearCoatRoughness, dotNL );\r\n\t#else\r\n\t\tfloat clearCoatDHR = 0.0;\r\n\t#endif\r\n\r\n\treflectedLight.directSpecular += ( 1.0 - clearCoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry, material.specularColor, material.specularRoughness );\r\n\r\n\treflectedLight.directDiffuse += ( 1.0 - clearCoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\r\n\r\n\t#ifndef STANDARD\r\n\r\n\t\treflectedLight.directSpecular += irradiance * material.clearCoat * BRDF_Specular_GGX( directLight, geometry, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );\r\n\r\n\t#endif\r\n\r\n}\r\n\r\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\r\n\r\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\r\n\r\n}\r\n\r\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 clearCoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\r\n\r\n\t#ifndef STANDARD\r\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\r\n\t\tfloat dotNL = dotNV;\r\n\t\tfloat clearCoatDHR = material.clearCoat * clearCoatDHRApprox( material.clearCoatRoughness, dotNL );\r\n\t#else\r\n\t\tfloat clearCoatDHR = 0.0;\r\n\t#endif\r\n\r\n\treflectedLight.indirectSpecular += ( 1.0 - clearCoatDHR ) * radiance * BRDF_Specular_GGX_Environment( geometry, material.specularColor, material.specularRoughness );\r\n\r\n\t#ifndef STANDARD\r\n\r\n\t\treflectedLight.indirectSpecular += clearCoatRadiance * material.clearCoat * BRDF_Specular_GGX_Environment( geometry, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );\r\n\r\n\t#endif\r\n\r\n}\r\n\r\n#define RE_Direct\t\t\t\tRE_Direct_Physical\r\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\r\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\r\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\r\n\r\n#define Material_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.specularRoughness )\r\n#define Material_ClearCoat_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.clearCoatRoughness )\r\n\r\n// ref: https://seblagarde.files.wordpress.com/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf\r\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\r\n\r\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\r\n\r\n}\r\n",lights_template:"\r\n\r\nGeometricContext geometry;\r\n\r\ngeometry.position = - vViewPosition;\r\ngeometry.normal = normal;\r\ngeometry.viewDir = normalize( vViewPosition );\r\n\r\nIncidentLight directLight;\r\n\r\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\r\n\r\n\tPointLight pointLight;\r\n\r\n\t#pragma unroll_loop\r\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\r\n\r\n\t\tpointLight = pointLights[ i ];\r\n\r\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\r\n\r\n\t\t#ifdef USE_SHADOWMAP\r\n\t\tdirectLight.color *= all( bvec2( pointLight.shadow, directLight.visible ) ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\r\n\t\t#endif\r\n\r\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\r\n\r\n\t}\r\n\r\n#endif\r\n\r\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\r\n\r\n\tSpotLight spotLight;\r\n\r\n\t#pragma unroll_loop\r\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\r\n\r\n\t\tspotLight = spotLights[ i ];\r\n\r\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\r\n\r\n\t\t#ifdef USE_SHADOWMAP\r\n\t\tdirectLight.color *= all( bvec2( spotLight.shadow, directLight.visible ) ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\r\n\t\t#endif\r\n\r\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\r\n\r\n\t}\r\n\r\n#endif\r\n\r\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\r\n\r\n\tDirectionalLight directionalLight;\r\n\r\n\t#pragma unroll_loop\r\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\r\n\r\n\t\tdirectionalLight = directionalLights[ i ];\r\n\r\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\r\n\r\n\t\t#ifdef USE_SHADOWMAP\r\n\t\tdirectLight.color *= all( bvec2( directionalLight.shadow, directLight.visible ) ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\r\n\t\t#endif\r\n\r\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\r\n\r\n\t}\r\n\r\n#endif\r\n\r\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\r\n\r\n\tRectAreaLight rectAreaLight;\r\n\r\n\t#pragma unroll_loop\r\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\r\n\r\n\t\trectAreaLight = rectAreaLights[ i ];\r\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\r\n\r\n\t}\r\n\r\n#endif\r\n\r\n#if defined( RE_IndirectDiffuse )\r\n\r\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\r\n\r\n\t#ifdef USE_LIGHTMAP\r\n\r\n\t\tvec3 lightMapIrradiance = texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\r\n\r\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\r\n\r\n\t\t\tlightMapIrradiance *= PI; // factor of PI should not be present; included here to prevent breakage\r\n\r\n\t\t#endif\r\n\r\n\t\tirradiance += lightMapIrradiance;\r\n\r\n\t#endif\r\n\r\n\t#if ( NUM_HEMI_LIGHTS > 0 )\r\n\r\n\t\t#pragma unroll_loop\r\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\r\n\r\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\r\n\r\n\t\t}\r\n\r\n\t#endif\r\n\r\n\t#if defined( USE_ENVMAP ) && defined( PHYSICAL ) && defined( ENVMAP_TYPE_CUBE_UV )\r\n\r\n\t\t// TODO, replace 8 with the real maxMIPLevel\r\n\t\tirradiance += getLightProbeIndirectIrradiance( geometry, 8 );\r\n\r\n\t#endif\r\n\r\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\r\n\r\n#endif\r\n\r\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\r\n\r\n\t// TODO, replace 8 with the real maxMIPLevel\r\n\tvec3 radiance = getLightProbeIndirectRadiance( geometry, Material_BlinnShininessExponent( material ), 8 );\r\n\r\n\t#ifndef STANDARD\r\n\t\tvec3 clearCoatRadiance = getLightProbeIndirectRadiance( geometry, Material_ClearCoat_BlinnShininessExponent( material ), 8 );\r\n\t#else\r\n\t\tvec3 clearCoatRadiance = vec3( 0.0 );\r\n\t#endif\r\n\r\n\tRE_IndirectSpecular( radiance, clearCoatRadiance, geometry, material, reflectedLight );\r\n\r\n#endif\r\n",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\r\n\r\n\tgl_FragDepthEXT = log2( vFragDepth ) * logDepthBufFC * 0.5;\r\n\r\n#endif",logdepthbuf_pars_fragment:"#ifdef USE_LOGDEPTHBUF\r\n\r\n\tuniform float logDepthBufFC;\r\n\r\n\t#ifdef USE_LOGDEPTHBUF_EXT\r\n\r\n\t\tvarying float vFragDepth;\r\n\r\n\t#endif\r\n\r\n#endif\r\n",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\r\n\r\n\t#ifdef USE_LOGDEPTHBUF_EXT\r\n\r\n\t\tvarying float vFragDepth;\r\n\r\n\t#endif\r\n\r\n\tuniform float logDepthBufFC;\r\n\r\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\r\n\r\n\t#ifdef USE_LOGDEPTHBUF_EXT\r\n\r\n\t\tvFragDepth = 1.0 + gl_Position.w;\r\n\r\n\t#else\r\n\r\n\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\r\n\r\n\t\tgl_Position.z *= gl_Position.w;\r\n\r\n\t#endif\r\n\r\n#endif\r\n",map_fragment:"#ifdef USE_MAP\r\n\r\n\tvec4 texelColor = texture2D( map, vUv );\r\n\r\n\ttexelColor = mapTexelToLinear( texelColor );\r\n\tdiffuseColor *= texelColor;\r\n\r\n#endif\r\n",map_pars_fragment:"#ifdef USE_MAP\r\n\r\n\tuniform sampler2D map;\r\n\r\n#endif\r\n",map_particle_fragment:"#ifdef USE_MAP\r\n\r\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\r\n\tvec4 mapTexel = texture2D( map, uv );\r\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\r\n\r\n#endif\r\n",map_particle_pars_fragment:"#ifdef USE_MAP\r\n\r\n\tuniform mat3 uvTransform;\r\n\tuniform sampler2D map;\r\n\r\n#endif\r\n",metalnessmap_fragment:"float metalnessFactor = metalness;\r\n\r\n#ifdef USE_METALNESSMAP\r\n\r\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\r\n\r\n\t// reads channel B, compatible with a combined OcclusionRoughnessMetallic (RGB) texture\r\n\tmetalnessFactor *= texelMetalness.b;\r\n\r\n#endif\r\n",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\r\n\r\n\tuniform sampler2D metalnessMap;\r\n\r\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\r\n\r\n\tobjectNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];\r\n\tobjectNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ];\r\n\tobjectNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ];\r\n\tobjectNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ];\r\n\r\n#endif\r\n",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\r\n\r\n\t#ifndef USE_MORPHNORMALS\r\n\r\n\tuniform float morphTargetInfluences[ 8 ];\r\n\r\n\t#else\r\n\r\n\tuniform float morphTargetInfluences[ 4 ];\r\n\r\n\t#endif\r\n\r\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\r\n\r\n\ttransformed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];\r\n\ttransformed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];\r\n\ttransformed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];\r\n\ttransformed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];\r\n\r\n\t#ifndef USE_MORPHNORMALS\r\n\r\n\ttransformed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];\r\n\ttransformed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];\r\n\ttransformed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];\r\n\ttransformed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];\r\n\r\n\t#endif\r\n\r\n#endif\r\n",normal_fragment:"#ifdef FLAT_SHADED\r\n\r\n\t// Workaround for Adreno/Nexus5 not able able to do dFdx( vViewPosition ) ...\r\n\r\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\r\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\r\n\tvec3 normal = normalize( cross( fdx, fdy ) );\r\n\r\n#else\r\n\r\n\tvec3 normal = normalize( vNormal );\r\n\r\n\t#ifdef DOUBLE_SIDED\r\n\r\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\r\n\r\n\t#endif\r\n\r\n#endif\r\n\r\n#ifdef USE_NORMALMAP\r\n\r\n\tnormal = perturbNormal2Arb( -vViewPosition, normal );\r\n\r\n#elif defined( USE_BUMPMAP )\r\n\r\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\r\n\r\n#endif\r\n",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\r\n\r\n\tuniform sampler2D normalMap;\r\n\tuniform vec2 normalScale;\r\n\r\n\t// Per-Pixel Tangent Space Normal Mapping\r\n\t// http://hacksoflife.blogspot.ch/2009/11/per-pixel-tangent-space-normal-mapping.html\r\n\r\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {\r\n\r\n\t\t// Workaround for Adreno 3XX dFd*( vec3 ) bug. See #9988\r\n\r\n\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\r\n\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\r\n\t\tvec2 st0 = dFdx( vUv.st );\r\n\t\tvec2 st1 = dFdy( vUv.st );\r\n\r\n\t\tvec3 S = normalize( q0 * st1.t - q1 * st0.t );\r\n\t\tvec3 T = normalize( -q0 * st1.s + q1 * st0.s );\r\n\t\tvec3 N = normalize( surf_norm );\r\n\r\n\t\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\r\n\t\tmapN.xy = normalScale * mapN.xy;\r\n\t\tmat3 tsn = mat3( S, T, N );\r\n\t\treturn normalize( tsn * mapN );\r\n\r\n\t}\r\n\r\n#endif\r\n",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\r\n\treturn normalize( normal ) * 0.5 + 0.5;\r\n}\r\n\r\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\r\n\treturn 2.0 * rgb.xyz - 1.0;\r\n}\r\n\r\nconst float PackUpscale = 256. / 255.; // fraction -> 0..1 (including 1)\r\nconst float UnpackDownscale = 255. / 256.; // 0..1 -> fraction (excluding 1)\r\n\r\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\r\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\r\n\r\nconst float ShiftRight8 = 1. / 256.;\r\n\r\nvec4 packDepthToRGBA( const in float v ) {\r\n\tvec4 r = vec4( fract( v * PackFactors ), v );\r\n\tr.yzw -= r.xyz * ShiftRight8; // tidy overflow\r\n\treturn r * PackUpscale;\r\n}\r\n\r\nfloat unpackRGBAToDepth( const in vec4 v ) {\r\n\treturn dot( v, UnpackFactors );\r\n}\r\n\r\n// NOTE: viewZ/eyeZ is < 0 when in front of the camera per OpenGL conventions\r\n\r\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\r\n\treturn ( viewZ + near ) / ( near - far );\r\n}\r\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\r\n\treturn linearClipZ * ( near - far ) - near;\r\n}\r\n\r\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\r\n\treturn (( near + viewZ ) * far ) / (( far - near ) * viewZ );\r\n}\r\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\r\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\r\n}\r\n",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\r\n\r\n\t// Get get normal blending with premultipled, use with CustomBlending, OneFactor, OneMinusSrcAlphaFactor, AddEquation.\r\n\tgl_FragColor.rgb *= gl_FragColor.a;\r\n\r\n#endif\r\n",project_vertex:"vec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );\r\n\r\ngl_Position = projectionMatrix * mvPosition;\r\n",dithering_fragment:"#if defined( DITHERING )\r\n\r\n gl_FragColor.rgb = dithering( gl_FragColor.rgb );\r\n\r\n#endif\r\n",dithering_pars_fragment:"#if defined( DITHERING )\r\n\r\n\t// based on https://www.shadertoy.com/view/MslGR8\r\n\tvec3 dithering( vec3 color ) {\r\n\t\t//Calculate grid position\r\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\r\n\r\n\t\t//Shift the individual colors differently, thus making it even harder to see the dithering pattern\r\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\r\n\r\n\t\t//modify shift acording to grid position.\r\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\r\n\r\n\t\t//shift the color by dither_shift\r\n\t\treturn color + dither_shift_RGB;\r\n\t}\r\n\r\n#endif\r\n",roughnessmap_fragment:"float roughnessFactor = roughness;\r\n\r\n#ifdef USE_ROUGHNESSMAP\r\n\r\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\r\n\r\n\t// reads channel G, compatible with a combined OcclusionRoughnessMetallic (RGB) texture\r\n\troughnessFactor *= texelRoughness.g;\r\n\r\n#endif\r\n",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\r\n\r\n\tuniform sampler2D roughnessMap;\r\n\r\n#endif",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\r\n\r\n\t#if NUM_DIR_LIGHTS > 0\r\n\r\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHTS ];\r\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\r\n\r\n\t#endif\r\n\r\n\t#if NUM_SPOT_LIGHTS > 0\r\n\r\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHTS ];\r\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\r\n\r\n\t#endif\r\n\r\n\t#if NUM_POINT_LIGHTS > 0\r\n\r\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHTS ];\r\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\r\n\r\n\t#endif\r\n\r\n\r\n\r\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\r\n\r\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\r\n\r\n\t}\r\n\r\n\tfloat texture2DShadowLerp( sampler2D depths, vec2 size, vec2 uv, float compare ) {\r\n\r\n\t\tconst vec2 offset = vec2( 0.0, 1.0 );\r\n\r\n\t\tvec2 texelSize = vec2( 1.0 ) / size;\r\n\t\tvec2 centroidUV = floor( uv * size + 0.5 ) / size;\r\n\r\n\t\tfloat lb = texture2DCompare( depths, centroidUV + texelSize * offset.xx, compare );\r\n\t\tfloat lt = texture2DCompare( depths, centroidUV + texelSize * offset.xy, compare );\r\n\t\tfloat rb = texture2DCompare( depths, centroidUV + texelSize * offset.yx, compare );\r\n\t\tfloat rt = texture2DCompare( depths, centroidUV + texelSize * offset.yy, compare );\r\n\r\n\t\tvec2 f = fract( uv * size + 0.5 );\r\n\r\n\t\tfloat a = mix( lb, lt, f.y );\r\n\t\tfloat b = mix( rb, rt, f.y );\r\n\t\tfloat c = mix( a, b, f.x );\r\n\r\n\t\treturn c;\r\n\r\n\t}\r\n\r\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\r\n\r\n\t\tfloat shadow = 1.0;\r\n\r\n\t\tshadowCoord.xyz /= shadowCoord.w;\r\n\t\tshadowCoord.z += shadowBias;\r\n\r\n\t\t// if ( something && something ) breaks ATI OpenGL shader compiler\r\n\t\t// if ( all( something, something ) ) using this instead\r\n\r\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\r\n\t\tbool inFrustum = all( inFrustumVec );\r\n\r\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\r\n\r\n\t\tbool frustumTest = all( frustumTestVec );\r\n\r\n\t\tif ( frustumTest ) {\r\n\r\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\r\n\r\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\r\n\r\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\r\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\r\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\r\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\r\n\r\n\t\t\tshadow = (\r\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\r\n\t\t\t) * ( 1.0 / 9.0 );\r\n\r\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\r\n\r\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\r\n\r\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\r\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\r\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\r\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\r\n\r\n\t\t\tshadow = (\r\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\r\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\r\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\r\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\r\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy, shadowCoord.z ) +\r\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\r\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\r\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\r\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\r\n\t\t\t) * ( 1.0 / 9.0 );\r\n\r\n\t\t#else // no percentage-closer filtering:\r\n\r\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\r\n\r\n\t\t#endif\r\n\r\n\t\t}\r\n\r\n\t\treturn shadow;\r\n\r\n\t}\r\n\r\n\t// cubeToUV() maps a 3D direction vector suitable for cube texture mapping to a 2D\r\n\t// vector suitable for 2D texture mapping. This code uses the following layout for the\r\n\t// 2D texture:\r\n\t//\r\n\t// xzXZ\r\n\t// y Y\r\n\t//\r\n\t// Y - Positive y direction\r\n\t// y - Negative y direction\r\n\t// X - Positive x direction\r\n\t// x - Negative x direction\r\n\t// Z - Positive z direction\r\n\t// z - Negative z direction\r\n\t//\r\n\t// Source and test bed:\r\n\t// https://gist.github.com/tschw/da10c43c467ce8afd0c4\r\n\r\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\r\n\r\n\t\t// Number of texels to avoid at the edge of each square\r\n\r\n\t\tvec3 absV = abs( v );\r\n\r\n\t\t// Intersect unit cube\r\n\r\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\r\n\t\tabsV *= scaleToCube;\r\n\r\n\t\t// Apply scale to avoid seams\r\n\r\n\t\t// two texels less per square (one texel will do for NEAREST)\r\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\r\n\r\n\t\t// Unwrap\r\n\r\n\t\t// space: -1 ... 1 range for each square\r\n\t\t//\r\n\t\t// #X##\t\tdim := ( 4 , 2 )\r\n\t\t// # #\t\tcenter := ( 1 , 1 )\r\n\r\n\t\tvec2 planar = v.xy;\r\n\r\n\t\tfloat almostATexel = 1.5 * texelSizeY;\r\n\t\tfloat almostOne = 1.0 - almostATexel;\r\n\r\n\t\tif ( absV.z >= almostOne ) {\r\n\r\n\t\t\tif ( v.z > 0.0 )\r\n\t\t\t\tplanar.x = 4.0 - v.x;\r\n\r\n\t\t} else if ( absV.x >= almostOne ) {\r\n\r\n\t\t\tfloat signX = sign( v.x );\r\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\r\n\r\n\t\t} else if ( absV.y >= almostOne ) {\r\n\r\n\t\t\tfloat signY = sign( v.y );\r\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\r\n\t\t\tplanar.y = v.z * signY - 2.0;\r\n\r\n\t\t}\r\n\r\n\t\t// Transform to UV space\r\n\r\n\t\t// scale := 0.5 / dim\r\n\t\t// translate := ( center + 0.5 ) / dim\r\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\r\n\r\n\t}\r\n\r\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\r\n\r\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\r\n\r\n\t\t// for point lights, the uniform @vShadowCoord is re-purposed to hold\r\n\t\t// the vector from the light to the world-space position of the fragment.\r\n\t\tvec3 lightToPosition = shadowCoord.xyz;\r\n\r\n\t\t// dp = normalized distance from light to fragment position\r\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); // need to clamp?\r\n\t\tdp += shadowBias;\r\n\r\n\t\t// bd3D = base direction 3D\r\n\t\tvec3 bd3D = normalize( lightToPosition );\r\n\r\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT )\r\n\r\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\r\n\r\n\t\t\treturn (\r\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\r\n\t\t\t) * ( 1.0 / 9.0 );\r\n\r\n\t\t#else // no percentage-closer filtering\r\n\r\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\r\n\r\n\t\t#endif\r\n\r\n\t}\r\n\r\n#endif\r\n",shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\r\n\r\n\t#if NUM_DIR_LIGHTS > 0\r\n\r\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHTS ];\r\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\r\n\r\n\t#endif\r\n\r\n\t#if NUM_SPOT_LIGHTS > 0\r\n\r\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHTS ];\r\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\r\n\r\n\t#endif\r\n\r\n\t#if NUM_POINT_LIGHTS > 0\r\n\r\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHTS ];\r\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\r\n\r\n\t#endif\r\n\r\n\r\n\r\n#endif\r\n",shadowmap_vertex:"#ifdef USE_SHADOWMAP\r\n\r\n\t#if NUM_DIR_LIGHTS > 0\r\n\r\n\t#pragma unroll_loop\r\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\r\n\r\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;\r\n\r\n\t}\r\n\r\n\t#endif\r\n\r\n\t#if NUM_SPOT_LIGHTS > 0\r\n\r\n\t#pragma unroll_loop\r\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\r\n\r\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;\r\n\r\n\t}\r\n\r\n\t#endif\r\n\r\n\t#if NUM_POINT_LIGHTS > 0\r\n\r\n\t#pragma unroll_loop\r\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\r\n\r\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\r\n\r\n\t}\r\n\r\n\t#endif\r\n\r\n\r\n\r\n#endif\r\n",shadowmask_pars_fragment:"float getShadowMask() {\r\n\r\n\tfloat shadow = 1.0;\r\n\r\n\t#ifdef USE_SHADOWMAP\r\n\r\n\t#if NUM_DIR_LIGHTS > 0\r\n\r\n\tDirectionalLight directionalLight;\r\n\r\n\t#pragma unroll_loop\r\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\r\n\r\n\t\tdirectionalLight = directionalLights[ i ];\r\n\t\tshadow *= bool( directionalLight.shadow ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\r\n\r\n\t}\r\n\r\n\t#endif\r\n\r\n\t#if NUM_SPOT_LIGHTS > 0\r\n\r\n\tSpotLight spotLight;\r\n\r\n\t#pragma unroll_loop\r\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\r\n\r\n\t\tspotLight = spotLights[ i ];\r\n\t\tshadow *= bool( spotLight.shadow ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\r\n\r\n\t}\r\n\r\n\t#endif\r\n\r\n\t#if NUM_POINT_LIGHTS > 0\r\n\r\n\tPointLight pointLight;\r\n\r\n\t#pragma unroll_loop\r\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\r\n\r\n\t\tpointLight = pointLights[ i ];\r\n\t\tshadow *= bool( pointLight.shadow ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\r\n\r\n\t}\r\n\r\n\t#endif\r\n\r\n\r\n\r\n\t#endif\r\n\r\n\treturn shadow;\r\n\r\n}\r\n",skinbase_vertex:"#ifdef USE_SKINNING\r\n\r\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\r\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\r\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\r\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\r\n\r\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\r\n\r\n\tuniform mat4 bindMatrix;\r\n\tuniform mat4 bindMatrixInverse;\r\n\r\n\t#ifdef BONE_TEXTURE\r\n\r\n\t\tuniform sampler2D boneTexture;\r\n\t\tuniform int boneTextureSize;\r\n\r\n\t\tmat4 getBoneMatrix( const in float i ) {\r\n\r\n\t\t\tfloat j = i * 4.0;\r\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\r\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\r\n\r\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\r\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\r\n\r\n\t\t\ty = dy * ( y + 0.5 );\r\n\r\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\r\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\r\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\r\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\r\n\r\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\r\n\r\n\t\t\treturn bone;\r\n\r\n\t\t}\r\n\r\n\t#else\r\n\r\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\r\n\r\n\t\tmat4 getBoneMatrix( const in float i ) {\r\n\r\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\r\n\t\t\treturn bone;\r\n\r\n\t\t}\r\n\r\n\t#endif\r\n\r\n#endif\r\n",skinning_vertex:"#ifdef USE_SKINNING\r\n\r\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\r\n\r\n\tvec4 skinned = vec4( 0.0 );\r\n\tskinned += boneMatX * skinVertex * skinWeight.x;\r\n\tskinned += boneMatY * skinVertex * skinWeight.y;\r\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\r\n\tskinned += boneMatW * skinVertex * skinWeight.w;\r\n\r\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\r\n\r\n#endif\r\n",skinnormal_vertex:"#ifdef USE_SKINNING\r\n\r\n\tmat4 skinMatrix = mat4( 0.0 );\r\n\tskinMatrix += skinWeight.x * boneMatX;\r\n\tskinMatrix += skinWeight.y * boneMatY;\r\n\tskinMatrix += skinWeight.z * boneMatZ;\r\n\tskinMatrix += skinWeight.w * boneMatW;\r\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\r\n\r\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\r\n\r\n#endif\r\n",specularmap_fragment:"float specularStrength;\r\n\r\n#ifdef USE_SPECULARMAP\r\n\r\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\r\n\tspecularStrength = texelSpecular.r;\r\n\r\n#else\r\n\r\n\tspecularStrength = 1.0;\r\n\r\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\r\n\r\n\tuniform sampler2D specularMap;\r\n\r\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\r\n\r\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\r\n\r\n#endif\r\n",tonemapping_pars_fragment:"#ifndef saturate\r\n\t#define saturate(a) clamp( a, 0.0, 1.0 )\r\n#endif\r\n\r\nuniform float toneMappingExposure;\r\nuniform float toneMappingWhitePoint;\r\n\r\n// exposure only\r\nvec3 LinearToneMapping( vec3 color ) {\r\n\r\n\treturn toneMappingExposure * color;\r\n\r\n}\r\n\r\n// source: https://www.cs.utah.edu/~reinhard/cdrom/\r\nvec3 ReinhardToneMapping( vec3 color ) {\r\n\r\n\tcolor *= toneMappingExposure;\r\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\r\n\r\n}\r\n\r\n// source: http://filmicgames.com/archives/75\r\n#define Uncharted2Helper( x ) max( ( ( x * ( 0.15 * x + 0.10 * 0.50 ) + 0.20 * 0.02 ) / ( x * ( 0.15 * x + 0.50 ) + 0.20 * 0.30 ) ) - 0.02 / 0.30, vec3( 0.0 ) )\r\nvec3 Uncharted2ToneMapping( vec3 color ) {\r\n\r\n\t// John Hable's filmic operator from Uncharted 2 video game\r\n\tcolor *= toneMappingExposure;\r\n\treturn saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );\r\n\r\n}\r\n\r\n// source: http://filmicgames.com/archives/75\r\nvec3 OptimizedCineonToneMapping( vec3 color ) {\r\n\r\n\t// optimized filmic operator by Jim Hejl and Richard Burgess-Dawson\r\n\tcolor *= toneMappingExposure;\r\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\r\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\r\n\r\n}\r\n",uv_pars_fragment:"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\r\n\r\n\tvarying vec2 vUv;\r\n\r\n#endif",uv_pars_vertex:"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\r\n\r\n\tvarying vec2 vUv;\r\n\tuniform mat3 uvTransform;\r\n\r\n#endif\r\n",uv_vertex:"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\r\n\r\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\r\n\r\n#endif",uv2_pars_fragment:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\r\n\r\n\tvarying vec2 vUv2;\r\n\r\n#endif",uv2_pars_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\r\n\r\n\tattribute vec2 uv2;\r\n\tvarying vec2 vUv2;\r\n\r\n#endif",uv2_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\r\n\r\n\tvUv2 = uv2;\r\n\r\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP )\r\n\r\n\tvec4 worldPosition = modelMatrix * vec4( transformed, 1.0 );\r\n\r\n#endif\r\n",cube_frag:"uniform samplerCube tCube;\r\nuniform float tFlip;\r\nuniform float opacity;\r\n\r\nvarying vec3 vWorldPosition;\r\n\r\nvoid main() {\r\n\r\n\tgl_FragColor = textureCube( tCube, vec3( tFlip * vWorldPosition.x, vWorldPosition.yz ) );\r\n\tgl_FragColor.a *= opacity;\r\n\r\n}\r\n",cube_vert:"varying vec3 vWorldPosition;\r\n\r\n#include <common>\r\n\r\nvoid main() {\r\n\r\n\tvWorldPosition = transformDirection( position, modelMatrix );\r\n\r\n\t#include <begin_vertex>\r\n\t#include <project_vertex>\r\n\r\n\tgl_Position.z = gl_Position.w; // set z to camera.far\r\n\r\n}\r\n",depth_frag:"#if DEPTH_PACKING == 3200\r\n\r\n\tuniform float opacity;\r\n\r\n#endif\r\n\r\n#include <common>\r\n#include <packing>\r\n#include <uv_pars_fragment>\r\n#include <map_pars_fragment>\r\n#include <alphamap_pars_fragment>\r\n#include <logdepthbuf_pars_fragment>\r\n#include <clipping_planes_pars_fragment>\r\n\r\nvoid main() {\r\n\r\n\t#include <clipping_planes_fragment>\r\n\r\n\tvec4 diffuseColor = vec4( 1.0 );\r\n\r\n\t#if DEPTH_PACKING == 3200\r\n\r\n\t\tdiffuseColor.a = opacity;\r\n\r\n\t#endif\r\n\r\n\t#include <map_fragment>\r\n\t#include <alphamap_fragment>\r\n\t#include <alphatest_fragment>\r\n\r\n\t#include <logdepthbuf_fragment>\r\n\r\n\t#if DEPTH_PACKING == 3200\r\n\r\n\t\tgl_FragColor = vec4( vec3( gl_FragCoord.z ), opacity );\r\n\r\n\t#elif DEPTH_PACKING == 3201\r\n\r\n\t\tgl_FragColor = packDepthToRGBA( gl_FragCoord.z );\r\n\r\n\t#endif\r\n\r\n}\r\n",depth_vert:"#include <common>\r\n#include <uv_pars_vertex>\r\n#include <displacementmap_pars_vertex>\r\n#include <morphtarget_pars_vertex>\r\n#include <skinning_pars_vertex>\r\n#include <logdepthbuf_pars_vertex>\r\n#include <clipping_planes_pars_vertex>\r\n\r\nvoid main() {\r\n\r\n\t#include <uv_vertex>\r\n\r\n\t#include <skinbase_vertex>\r\n\r\n\t#ifdef USE_DISPLACEMENTMAP\r\n\r\n\t\t#include <beginnormal_vertex>\r\n\t\t#include <morphnormal_vertex>\r\n\t\t#include <skinnormal_vertex>\r\n\r\n\t#endif\r\n\r\n\t#include <begin_vertex>\r\n\t#include <morphtarget_vertex>\r\n\t#include <skinning_vertex>\r\n\t#include <displacementmap_vertex>\r\n\t#include <project_vertex>\r\n\t#include <logdepthbuf_vertex>\r\n\t#include <clipping_planes_vertex>\r\n\r\n}\r\n",distanceRGBA_frag:"#define DISTANCE\r\n\r\nuniform vec3 referencePosition;\r\nuniform float nearDistance;\r\nuniform float farDistance;\r\nvarying vec3 vWorldPosition;\r\n\r\n#include <common>\r\n#include <packing>\r\n#include <uv_pars_fragment>\r\n#include <map_pars_fragment>\r\n#include <alphamap_pars_fragment>\r\n#include <clipping_planes_pars_fragment>\r\n\r\nvoid main () {\r\n\r\n\t#include <clipping_planes_fragment>\r\n\r\n\tvec4 diffuseColor = vec4( 1.0 );\r\n\r\n\t#include <map_fragment>\r\n\t#include <alphamap_fragment>\r\n\t#include <alphatest_fragment>\r\n\r\n\tfloat dist = length( vWorldPosition - referencePosition );\r\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\r\n\tdist = saturate( dist ); // clamp to [ 0, 1 ]\r\n\r\n\tgl_FragColor = packDepthToRGBA( dist );\r\n\r\n}\r\n",distanceRGBA_vert:"#define DISTANCE\r\n\r\nvarying vec3 vWorldPosition;\r\n\r\n#include <common>\r\n#include <uv_pars_vertex>\r\n#include <displacementmap_pars_vertex>\r\n#include <morphtarget_pars_vertex>\r\n#include <skinning_pars_vertex>\r\n#include <clipping_planes_pars_vertex>\r\n\r\nvoid main() {\r\n\r\n\t#include <uv_vertex>\r\n\r\n\t#include <skinbase_vertex>\r\n\r\n\t#ifdef USE_DISPLACEMENTMAP\r\n\r\n\t\t#include <beginnormal_vertex>\r\n\t\t#include <morphnormal_vertex>\r\n\t\t#include <skinnormal_vertex>\r\n\r\n\t#endif\r\n\r\n\t#include <begin_vertex>\r\n\t#include <morphtarget_vertex>\r\n\t#include <skinning_vertex>\r\n\t#include <displacementmap_vertex>\r\n\t#include <project_vertex>\r\n\t#include <worldpos_vertex>\r\n\t#include <clipping_planes_vertex>\r\n\r\n\tvWorldPosition = worldPosition.xyz;\r\n\r\n}\r\n",equirect_frag:"uniform sampler2D tEquirect;\r\n\r\nvarying vec3 vWorldPosition;\r\n\r\n#include <common>\r\n\r\nvoid main() {\r\n\r\n\tvec3 direction = normalize( vWorldPosition );\r\n\r\n\tvec2 sampleUV;\r\n\r\n\tsampleUV.y = asin( clamp( direction.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\r\n\r\n\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\r\n\r\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\r\n\r\n}\r\n",equirect_vert:"varying vec3 vWorldPosition;\r\n\r\n#include <common>\r\n\r\nvoid main() {\r\n\r\n\tvWorldPosition = transformDirection( position, modelMatrix );\r\n\r\n\t#include <begin_vertex>\r\n\t#include <project_vertex>\r\n\r\n}\r\n",linedashed_frag:"uniform vec3 diffuse;\r\nuniform float opacity;\r\n\r\nuniform float dashSize;\r\nuniform float totalSize;\r\n\r\nvarying float vLineDistance;\r\n\r\n#include <common>\r\n#include <color_pars_fragment>\r\n#include <fog_pars_fragment>\r\n#include <logdepthbuf_pars_fragment>\r\n#include <clipping_planes_pars_fragment>\r\n\r\nvoid main() {\r\n\r\n\t#include <clipping_planes_fragment>\r\n\r\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\r\n\r\n\t\tdiscard;\r\n\r\n\t}\r\n\r\n\tvec3 outgoingLight = vec3( 0.0 );\r\n\tvec4 diffuseColor = vec4( diffuse, opacity );\r\n\r\n\t#include <logdepthbuf_fragment>\r\n\t#include <color_fragment>\r\n\r\n\toutgoingLight = diffuseColor.rgb; // simple shader\r\n\r\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\r\n\r\n\t#include <premultiplied_alpha_fragment>\r\n\t#include <tonemapping_fragment>\r\n\t#include <encodings_fragment>\r\n\t#include <fog_fragment>\r\n\r\n}\r\n",linedashed_vert:"uniform float scale;\r\nattribute float lineDistance;\r\n\r\nvarying float vLineDistance;\r\n\r\n#include <common>\r\n#include <color_pars_vertex>\r\n#include <fog_pars_vertex>\r\n#include <logdepthbuf_pars_vertex>\r\n#include <clipping_planes_pars_vertex>\r\n\r\nvoid main() {\r\n\r\n\t#include <color_vertex>\r\n\r\n\tvLineDistance = scale * lineDistance;\r\n\r\n\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\r\n\tgl_Position = projectionMatrix * mvPosition;\r\n\r\n\t#include <logdepthbuf_vertex>\r\n\t#include <clipping_planes_vertex>\r\n\t#include <fog_vertex>\r\n\r\n}\r\n",meshbasic_frag:"uniform vec3 diffuse;\r\nuniform float opacity;\r\n\r\n#ifndef FLAT_SHADED\r\n\r\n\tvarying vec3 vNormal;\r\n\r\n#endif\r\n\r\n#include <common>\r\n#include <color_pars_fragment>\r\n#include <uv_pars_fragment>\r\n#include <uv2_pars_fragment>\r\n#include <map_pars_fragment>\r\n#include <alphamap_pars_fragment>\r\n#include <aomap_pars_fragment>\r\n#include <lightmap_pars_fragment>\r\n#include <envmap_pars_fragment>\r\n#include <fog_pars_fragment>\r\n#include <specularmap_pars_fragment>\r\n#include <logdepthbuf_pars_fragment>\r\n#include <clipping_planes_pars_fragment>\r\n\r\nvoid main() {\r\n\r\n\t#include <clipping_planes_fragment>\r\n\r\n\tvec4 diffuseColor = vec4( diffuse, opacity );\r\n\r\n\t#include <logdepthbuf_fragment>\r\n\t#include <map_fragment>\r\n\t#include <color_fragment>\r\n\t#include <alphamap_fragment>\r\n\t#include <alphatest_fragment>\r\n\t#include <specularmap_fragment>\r\n\r\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\r\n\r\n\t// accumulation (baked indirect lighting only)\r\n\t#ifdef USE_LIGHTMAP\r\n\r\n\t\treflectedLight.indirectDiffuse += texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\r\n\r\n\t#else\r\n\r\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\r\n\r\n\t#endif\r\n\r\n\t// modulation\r\n\t#include <aomap_fragment>\r\n\r\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\r\n\r\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\r\n\r\n\t#include <envmap_fragment>\r\n\r\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\r\n\r\n\t#include <premultiplied_alpha_fragment>\r\n\t#include <tonemapping_fragment>\r\n\t#include <encodings_fragment>\r\n\t#include <fog_fragment>\r\n\r\n}\r\n",meshbasic_vert:"#include <common>\r\n#include <uv_pars_vertex>\r\n#include <uv2_pars_vertex>\r\n#include <envmap_pars_vertex>\r\n#include <color_pars_vertex>\r\n#include <fog_pars_vertex>\r\n#include <morphtarget_pars_vertex>\r\n#include <skinning_pars_vertex>\r\n#include <logdepthbuf_pars_vertex>\r\n#include <clipping_planes_pars_vertex>\r\n\r\nvoid main() {\r\n\r\n\t#include <uv_vertex>\r\n\t#include <uv2_vertex>\r\n\t#include <color_vertex>\r\n\t#include <skinbase_vertex>\r\n\r\n\t#ifdef USE_ENVMAP\r\n\r\n\t#include <beginnormal_vertex>\r\n\t#include <morphnormal_vertex>\r\n\t#include <skinnormal_vertex>\r\n\t#include <defaultnormal_vertex>\r\n\r\n\t#endif\r\n\r\n\t#include <begin_vertex>\r\n\t#include <morphtarget_vertex>\r\n\t#include <skinning_vertex>\r\n\t#include <project_vertex>\r\n\t#include <logdepthbuf_vertex>\r\n\r\n\t#include <worldpos_vertex>\r\n\t#include <clipping_planes_vertex>\r\n\t#include <envmap_vertex>\r\n\t#include <fog_vertex>\r\n\r\n}\r\n",meshlambert_frag:"uniform vec3 diffuse;\r\nuniform vec3 emissive;\r\nuniform float opacity;\r\n\r\nvarying vec3 vLightFront;\r\n\r\n#ifdef DOUBLE_SIDED\r\n\r\n\tvarying vec3 vLightBack;\r\n\r\n#endif\r\n\r\n#include <common>\r\n#include <packing>\r\n#include <dithering_pars_fragment>\r\n#include <color_pars_fragment>\r\n#include <uv_pars_fragment>\r\n#include <uv2_pars_fragment>\r\n#include <map_pars_fragment>\r\n#include <alphamap_pars_fragment>\r\n#include <aomap_pars_fragment>\r\n#include <lightmap_pars_fragment>\r\n#include <emissivemap_pars_fragment>\r\n#include <envmap_pars_fragment>\r\n#include <bsdfs>\r\n#include <lights_pars>\r\n#include <fog_pars_fragment>\r\n#include <shadowmap_pars_fragment>\r\n#include <shadowmask_pars_fragment>\r\n#include <specularmap_pars_fragment>\r\n#include <logdepthbuf_pars_fragment>\r\n#include <clipping_planes_pars_fragment>\r\n\r\nvoid main() {\r\n\r\n\t#include <clipping_planes_fragment>\r\n\r\n\tvec4 diffuseColor = vec4( diffuse, opacity );\r\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\r\n\tvec3 totalEmissiveRadiance = emissive;\r\n\r\n\t#include <logdepthbuf_fragment>\r\n\t#include <map_fragment>\r\n\t#include <color_fragment>\r\n\t#include <alphamap_fragment>\r\n\t#include <alphatest_fragment>\r\n\t#include <specularmap_fragment>\r\n\t#include <emissivemap_fragment>\r\n\r\n\t// accumulation\r\n\treflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );\r\n\r\n\t#include <lightmap_fragment>\r\n\r\n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\r\n\r\n\t#ifdef DOUBLE_SIDED\r\n\r\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\r\n\r\n\t#else\r\n\r\n\t\treflectedLight.directDiffuse = vLightFront;\r\n\r\n\t#endif\r\n\r\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\r\n\r\n\t// modulation\r\n\t#include <aomap_fragment>\r\n\r\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\r\n\r\n\t#include <envmap_fragment>\r\n\r\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\r\n\r\n\t#include <tonemapping_fragment>\r\n\t#include <encodings_fragment>\r\n\t#include <fog_fragment>\r\n\t#include <premultiplied_alpha_fragment>\r\n\t#include <dithering_fragment>\r\n\r\n}\r\n",meshlambert_vert:"#define LAMBERT\r\n\r\nvarying vec3 vLightFront;\r\n\r\n#ifdef DOUBLE_SIDED\r\n\r\n\tvarying vec3 vLightBack;\r\n\r\n#endif\r\n\r\n#include <common>\r\n#include <uv_pars_vertex>\r\n#include <uv2_pars_vertex>\r\n#include <envmap_pars_vertex>\r\n#include <bsdfs>\r\n#include <lights_pars>\r\n#include <color_pars_vertex>\r\n#include <fog_pars_vertex>\r\n#include <morphtarget_pars_vertex>\r\n#include <skinning_pars_vertex>\r\n#include <shadowmap_pars_vertex>\r\n#include <logdepthbuf_pars_vertex>\r\n#include <clipping_planes_pars_vertex>\r\n\r\nvoid main() {\r\n\r\n\t#include <uv_vertex>\r\n\t#include <uv2_vertex>\r\n\t#include <color_vertex>\r\n\r\n\t#include <beginnormal_vertex>\r\n\t#include <morphnormal_vertex>\r\n\t#include <skinbase_vertex>\r\n\t#include <skinnormal_vertex>\r\n\t#include <defaultnormal_vertex>\r\n\r\n\t#include <begin_vertex>\r\n\t#include <morphtarget_vertex>\r\n\t#include <skinning_vertex>\r\n\t#include <project_vertex>\r\n\t#include <logdepthbuf_vertex>\r\n\t#include <clipping_planes_vertex>\r\n\r\n\t#include <worldpos_vertex>\r\n\t#include <envmap_vertex>\r\n\t#include <lights_lambert_vertex>\r\n\t#include <shadowmap_vertex>\r\n\t#include <fog_vertex>\r\n\r\n}\r\n",meshphong_frag:"#define PHONG\r\n\r\nuniform vec3 diffuse;\r\nuniform vec3 emissive;\r\nuniform vec3 specular;\r\nuniform float shininess;\r\nuniform float opacity;\r\n\r\n#include <common>\r\n#include <packing>\r\n#include <dithering_pars_fragment>\r\n#include <color_pars_fragment>\r\n#include <uv_pars_fragment>\r\n#include <uv2_pars_fragment>\r\n#include <map_pars_fragment>\r\n#include <alphamap_pars_fragment>\r\n#include <aomap_pars_fragment>\r\n#include <lightmap_pars_fragment>\r\n#include <emissivemap_pars_fragment>\r\n#include <envmap_pars_fragment>\r\n#include <gradientmap_pars_fragment>\r\n#include <fog_pars_fragment>\r\n#include <bsdfs>\r\n#include <lights_pars>\r\n#include <lights_phong_pars_fragment>\r\n#include <shadowmap_pars_fragment>\r\n#include <bumpmap_pars_fragment>\r\n#include <normalmap_pars_fragment>\r\n#include <specularmap_pars_fragment>\r\n#include <logdepthbuf_pars_fragment>\r\n#include <clipping_planes_pars_fragment>\r\n\r\nvoid main() {\r\n\r\n\t#include <clipping_planes_fragment>\r\n\r\n\tvec4 diffuseColor = vec4( diffuse, opacity );\r\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\r\n\tvec3 totalEmissiveRadiance = emissive;\r\n\r\n\t#include <logdepthbuf_fragment>\r\n\t#include <map_fragment>\r\n\t#include <color_fragment>\r\n\t#include <alphamap_fragment>\r\n\t#include <alphatest_fragment>\r\n\t#include <specularmap_fragment>\r\n\t#include <normal_fragment>\r\n\t#include <emissivemap_fragment>\r\n\r\n\t// accumulation\r\n\t#include <lights_phong_fragment>\r\n\t#include <lights_template>\r\n\r\n\t// modulation\r\n\t#include <aomap_fragment>\r\n\r\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\r\n\r\n\t#include <envmap_fragment>\r\n\r\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\r\n\r\n\t#include <tonemapping_fragment>\r\n\t#include <encodings_fragment>\r\n\t#include <fog_fragment>\r\n\t#include <premultiplied_alpha_fragment>\r\n\t#include <dithering_fragment>\r\n\r\n}\r\n",meshphong_vert:"#define PHONG\r\n\r\nvarying vec3 vViewPosition;\r\n\r\n#ifndef FLAT_SHADED\r\n\r\n\tvarying vec3 vNormal;\r\n\r\n#endif\r\n\r\n#include <common>\r\n#include <uv_pars_vertex>\r\n#include <uv2_pars_vertex>\r\n#include <displacementmap_pars_vertex>\r\n#include <envmap_pars_vertex>\r\n#include <color_pars_vertex>\r\n#include <fog_pars_vertex>\r\n#include <morphtarget_pars_vertex>\r\n#include <skinning_pars_vertex>\r\n#include <shadowmap_pars_vertex>\r\n#include <logdepthbuf_pars_vertex>\r\n#include <clipping_planes_pars_vertex>\r\n\r\nvoid main() {\r\n\r\n\t#include <uv_vertex>\r\n\t#include <uv2_vertex>\r\n\t#include <color_vertex>\r\n\r\n\t#include <beginnormal_vertex>\r\n\t#include <morphnormal_vertex>\r\n\t#include <skinbase_vertex>\r\n\t#include <skinnormal_vertex>\r\n\t#include <defaultnormal_vertex>\r\n\r\n#ifndef FLAT_SHADED // Normal computed with derivatives when FLAT_SHADED\r\n\r\n\tvNormal = normalize( transformedNormal );\r\n\r\n#endif\r\n\r\n\t#include <begin_vertex>\r\n\t#include <morphtarget_vertex>\r\n\t#include <skinning_vertex>\r\n\t#include <displacementmap_vertex>\r\n\t#include <project_vertex>\r\n\t#include <logdepthbuf_vertex>\r\n\t#include <clipping_planes_vertex>\r\n\r\n\tvViewPosition = - mvPosition.xyz;\r\n\r\n\t#include <worldpos_vertex>\r\n\t#include <envmap_vertex>\r\n\t#include <shadowmap_vertex>\r\n\t#include <fog_vertex>\r\n\r\n}\r\n",meshphysical_frag:"#define PHYSICAL\r\n\r\nuniform vec3 diffuse;\r\nuniform vec3 emissive;\r\nuniform float roughness;\r\nuniform float metalness;\r\nuniform float opacity;\r\n\r\n#ifndef STANDARD\r\n\tuniform float clearCoat;\r\n\tuniform float clearCoatRoughness;\r\n#endif\r\n\r\nvarying vec3 vViewPosition;\r\n\r\n#ifndef FLAT_SHADED\r\n\r\n\tvarying vec3 vNormal;\r\n\r\n#endif\r\n\r\n#include <common>\r\n#include <packing>\r\n#include <dithering_pars_fragment>\r\n#include <color_pars_fragment>\r\n#include <uv_pars_fragment>\r\n#include <uv2_pars_fragment>\r\n#include <map_pars_fragment>\r\n#include <alphamap_pars_fragment>\r\n#include <aomap_pars_fragment>\r\n#include <lightmap_pars_fragment>\r\n#include <emissivemap_pars_fragment>\r\n#include <envmap_pars_fragment>\r\n#include <fog_pars_fragment>\r\n#include <bsdfs>\r\n#include <cube_uv_reflection_fragment>\r\n#include <lights_pars>\r\n#include <lights_physical_pars_fragment>\r\n#include <shadowmap_pars_fragment>\r\n#include <bumpmap_pars_fragment>\r\n#include <normalmap_pars_fragment>\r\n#include <roughnessmap_pars_fragment>\r\n#include <metalnessmap_pars_fragment>\r\n#include <logdepthbuf_pars_fragment>\r\n#include <clipping_planes_pars_fragment>\r\n\r\nvoid main() {\r\n\r\n\t#include <clipping_planes_fragment>\r\n\r\n\tvec4 diffuseColor = vec4( diffuse, opacity );\r\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\r\n\tvec3 totalEmissiveRadiance = emissive;\r\n\r\n\t#include <logdepthbuf_fragment>\r\n\t#include <map_fragment>\r\n\t#include <color_fragment>\r\n\t#include <alphamap_fragment>\r\n\t#include <alphatest_fragment>\r\n\t#include <roughnessmap_fragment>\r\n\t#include <metalnessmap_fragment>\r\n\t#include <normal_fragment>\r\n\t#include <emissivemap_fragment>\r\n\r\n\t// accumulation\r\n\t#include <lights_physical_fragment>\r\n\t#include <lights_template>\r\n\r\n\t// modulation\r\n\t#include <aomap_fragment>\r\n\r\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\r\n\r\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\r\n\r\n\t#include <tonemapping_fragment>\r\n\t#include <encodings_fragment>\r\n\t#include <fog_fragment>\r\n\t#include <premultiplied_alpha_fragment>\r\n\t#include <dithering_fragment>\r\n\r\n}\r\n",meshphysical_vert:"#define PHYSICAL\r\n\r\nvarying vec3 vViewPosition;\r\n\r\n#ifndef FLAT_SHADED\r\n\r\n\tvarying vec3 vNormal;\r\n\r\n#endif\r\n\r\n#include <common>\r\n#include <uv_pars_vertex>\r\n#include <uv2_pars_vertex>\r\n#include <displacementmap_pars_vertex>\r\n#include <color_pars_vertex>\r\n#include <fog_pars_vertex>\r\n#include <morphtarget_pars_vertex>\r\n#include <skinning_pars_vertex>\r\n#include <shadowmap_pars_vertex>\r\n#include <logdepthbuf_pars_vertex>\r\n#include <clipping_planes_pars_vertex>\r\n\r\nvoid main() {\r\n\r\n\t#include <uv_vertex>\r\n\t#include <uv2_vertex>\r\n\t#include <color_vertex>\r\n\r\n\t#include <beginnormal_vertex>\r\n\t#include <morphnormal_vertex>\r\n\t#include <skinbase_vertex>\r\n\t#include <skinnormal_vertex>\r\n\t#include <defaultnormal_vertex>\r\n\r\n#ifndef FLAT_SHADED // Normal computed with derivatives when FLAT_SHADED\r\n\r\n\tvNormal = normalize( transformedNormal );\r\n\r\n#endif\r\n\r\n\t#include <begin_vertex>\r\n\t#include <morphtarget_vertex>\r\n\t#include <skinning_vertex>\r\n\t#include <displacementmap_vertex>\r\n\t#include <project_vertex>\r\n\t#include <logdepthbuf_vertex>\r\n\t#include <clipping_planes_vertex>\r\n\r\n\tvViewPosition = - mvPosition.xyz;\r\n\r\n\t#include <worldpos_vertex>\r\n\t#include <shadowmap_vertex>\r\n\t#include <fog_vertex>\r\n\r\n}\r\n",normal_frag:"#define NORMAL\r\n\r\nuniform float opacity;\r\n\r\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\r\n\r\n\tvarying vec3 vViewPosition;\r\n\r\n#endif\r\n\r\n#ifndef FLAT_SHADED\r\n\r\n\tvarying vec3 vNormal;\r\n\r\n#endif\r\n\r\n#include <packing>\r\n#include <uv_pars_fragment>\r\n#include <bumpmap_pars_fragment>\r\n#include <normalmap_pars_fragment>\r\n#include <logdepthbuf_pars_fragment>\r\n\r\nvoid main() {\r\n\r\n\t#include <logdepthbuf_fragment>\r\n\t#include <normal_fragment>\r\n\r\n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\r\n\r\n}\r\n",normal_vert:"#define NORMAL\r\n\r\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\r\n\r\n\tvarying vec3 vViewPosition;\r\n\r\n#endif\r\n\r\n#ifndef FLAT_SHADED\r\n\r\n\tvarying vec3 vNormal;\r\n\r\n#endif\r\n\r\n#include <uv_pars_vertex>\r\n#include <displacementmap_pars_vertex>\r\n#include <morphtarget_pars_vertex>\r\n#include <skinning_pars_vertex>\r\n#include <logdepthbuf_pars_vertex>\r\n\r\nvoid main() {\r\n\r\n\t#include <uv_vertex>\r\n\r\n\t#include <beginnormal_vertex>\r\n\t#include <morphnormal_vertex>\r\n\t#include <skinbase_vertex>\r\n\t#include <skinnormal_vertex>\r\n\t#include <defaultnormal_vertex>\r\n\r\n#ifndef FLAT_SHADED // Normal computed with derivatives when FLAT_SHADED\r\n\r\n\tvNormal = normalize( transformedNormal );\r\n\r\n#endif\r\n\r\n\t#include <begin_vertex>\r\n\t#include <morphtarget_vertex>\r\n\t#include <skinning_vertex>\r\n\t#include <displacementmap_vertex>\r\n\t#include <project_vertex>\r\n\t#include <logdepthbuf_vertex>\r\n\r\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\r\n\r\n\tvViewPosition = - mvPosition.xyz;\r\n\r\n#endif\r\n\r\n}\r\n",points_frag:"uniform vec3 diffuse;\r\nuniform float opacity;\r\n\r\n#include <common>\r\n#include <packing>\r\n#include <color_pars_fragment>\r\n#include <map_particle_pars_fragment>\r\n#include <fog_pars_fragment>\r\n#include <shadowmap_pars_fragment>\r\n#include <logdepthbuf_pars_fragment>\r\n#include <clipping_planes_pars_fragment>\r\n\r\nvoid main() {\r\n\r\n\t#include <clipping_planes_fragment>\r\n\r\n\tvec3 outgoingLight = vec3( 0.0 );\r\n\tvec4 diffuseColor = vec4( diffuse, opacity );\r\n\r\n\t#include <logdepthbuf_fragment>\r\n\t#include <map_particle_fragment>\r\n\t#include <color_fragment>\r\n\t#include <alphatest_fragment>\r\n\r\n\toutgoingLight = diffuseColor.rgb;\r\n\r\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\r\n\r\n\t#include <premultiplied_alpha_fragment>\r\n\t#include <tonemapping_fragment>\r\n\t#include <encodings_fragment>\r\n\t#include <fog_fragment>\r\n\r\n}\r\n",points_vert:"uniform float size;\r\nuniform float scale;\r\n\r\n#include <common>\r\n#include <color_pars_vertex>\r\n#include <fog_pars_vertex>\r\n#include <shadowmap_pars_vertex>\r\n#include <logdepthbuf_pars_vertex>\r\n#include <clipping_planes_pars_vertex>\r\n\r\nvoid main() {\r\n\r\n\t#include <color_vertex>\r\n\t#include <begin_vertex>\r\n\t#include <project_vertex>\r\n\r\n\t#ifdef USE_SIZEATTENUATION\r\n\t\tgl_PointSize = size * ( scale / - mvPosition.z );\r\n\t#else\r\n\t\tgl_PointSize = size;\r\n\t#endif\r\n\r\n\t#include <logdepthbuf_vertex>\r\n\t#include <clipping_planes_vertex>\r\n\t#include <worldpos_vertex>\r\n\t#include <shadowmap_vertex>\r\n\t#include <fog_vertex>\r\n\r\n}\r\n",shadow_frag:"uniform vec3 color;\r\nuniform float opacity;\r\n\r\n#include <common>\r\n#include <packing>\r\n#include <fog_pars_fragment>\r\n#include <bsdfs>\r\n#include <lights_pars>\r\n#include <shadowmap_pars_fragment>\r\n#include <shadowmask_pars_fragment>\r\n\r\nvoid main() {\r\n\r\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\r\n\r\n\t#include <fog_fragment>\r\n\r\n}\r\n",shadow_vert:"#include <fog_pars_vertex>\r\n#include <shadowmap_pars_vertex>\r\n\r\nvoid main() {\r\n\r\n\t#include <begin_vertex>\r\n\t#include <project_vertex>\r\n\t#include <worldpos_vertex>\r\n\t#include <shadowmap_vertex>\r\n\t#include <fog_vertex>\r\n\r\n}\r\n"},ve={basic:{uniforms:ge.merge([me.common,me.specularmap,me.envmap,me.aomap,me.lightmap,me.fog]),vertexShader:ye.meshbasic_vert,fragmentShader:ye.meshbasic_frag},lambert:{uniforms:ge.merge([me.common,me.specularmap,me.envmap,me.aomap,me.lightmap,me.emissivemap,me.fog,me.lights,{emissive:{value:new fe(0)}}]),vertexShader:ye.meshlambert_vert,fragmentShader:ye.meshlambert_frag},phong:{uniforms:ge.merge([me.common,me.specularmap,me.envmap,me.aomap,me.lightmap,me.emissivemap,me.bumpmap,me.normalmap,me.displacementmap,me.gradientmap,me.fog,me.lights,{emissive:{value:new fe(0)},specular:{value:new fe(1118481)},shininess:{value:30}}]),vertexShader:ye.meshphong_vert,fragmentShader:ye.meshphong_frag},standard:{uniforms:ge.merge([me.common,me.envmap,me.aomap,me.lightmap,me.emissivemap,me.bumpmap,me.normalmap,me.displacementmap,me.roughnessmap,me.metalnessmap,me.fog,me.lights,{emissive:{value:new fe(0)},roughness:{value:.5},metalness:{value:.5},envMapIntensity:{value:1}}]),vertexShader:ye.meshphysical_vert,fragmentShader:ye.meshphysical_frag},points:{uniforms:ge.merge([me.points,me.fog]),vertexShader:ye.points_vert,fragmentShader:ye.points_frag},dashed:{uniforms:ge.merge([me.common,me.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:ye.linedashed_vert,fragmentShader:ye.linedashed_frag},depth:{uniforms:ge.merge([me.common,me.displacementmap]),vertexShader:ye.depth_vert,fragmentShader:ye.depth_frag},normal:{uniforms:ge.merge([me.common,me.bumpmap,me.normalmap,me.displacementmap,{opacity:{value:1}}]),vertexShader:ye.normal_vert,fragmentShader:ye.normal_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:ye.cube_vert,fragmentShader:ye.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:ye.equirect_vert,fragmentShader:ye.equirect_frag},distanceRGBA:{uniforms:ge.merge([me.common,me.displacementmap,{referencePosition:{value:new b},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:ye.distanceRGBA_vert,fragmentShader:ye.distanceRGBA_frag},shadow:{uniforms:ge.merge([me.lights,me.fog,{color:{value:new fe(0)},opacity:{value:1}}]),vertexShader:ye.shadow_vert,fragmentShader:ye.shadow_frag}};function be(e,t,n,r,i,a,o,s,c){E.call(this,e,t,n,r,i,a,o,s,c),this.needsUpdate=!0}function we(e,t,n,r,i){var a,o,s,c,l,u,h=new b,d=new v,p=new b;function f(){var e=new Float32Array([-.5,-.5,0,0,.5,-.5,1,0,.5,.5,1,1,-.5,.5,0,1]),n=new Uint16Array([0,1,2,0,2,3]);a=t.createBuffer(),o=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,a),t.bufferData(t.ARRAY_BUFFER,e,t.STATIC_DRAW),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,o),t.bufferData(t.ELEMENT_ARRAY_BUFFER,n,t.STATIC_DRAW),s=function(){var e=t.createProgram(),n=t.createShader(t.VERTEX_SHADER),r=t.createShader(t.FRAGMENT_SHADER);return t.shaderSource(n,["precision "+i.precision+" float;","#define SHADER_NAME SpriteMaterial","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform float rotation;","uniform vec2 center;","uniform vec2 scale;","uniform vec2 uvOffset;","uniform vec2 uvScale;","attribute vec2 position;","attribute vec2 uv;","varying vec2 vUV;","varying float fogDepth;","void main() {","\tvUV = uvOffset + uv * uvScale;","\tvec2 alignedPosition = ( position - center ) * scale;","\tvec2 rotatedPosition;","\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;","\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;","\tvec4 mvPosition;","\tmvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );","\tmvPosition.xy += rotatedPosition;","\tgl_Position = projectionMatrix * mvPosition;","\tfogDepth = - mvPosition.z;","}"].join("\n")),t.shaderSource(r,["precision "+i.precision+" float;","#define SHADER_NAME SpriteMaterial","uniform vec3 color;","uniform sampler2D map;","uniform float opacity;","uniform int fogType;","uniform vec3 fogColor;","uniform float fogDensity;","uniform float fogNear;","uniform float fogFar;","uniform float alphaTest;","varying vec2 vUV;","varying float fogDepth;","void main() {","\tvec4 texture = texture2D( map, vUV );","\tgl_FragColor = vec4( color * texture.xyz, texture.a * opacity );","\tif ( gl_FragColor.a < alphaTest ) discard;","\tif ( fogType > 0 ) {","\t\tfloat fogFactor = 0.0;","\t\tif ( fogType == 1 ) {","\t\t\tfogFactor = smoothstep( fogNear, fogFar, fogDepth );","\t\t} else {","\t\t\tconst float LOG2 = 1.442695;","\t\t\tfogFactor = exp2( - fogDensity * fogDensity * fogDepth * fogDepth * LOG2 );","\t\t\tfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );","\t\t}","\t\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );","\t}","}"].join("\n")),t.compileShader(n),t.compileShader(r),t.attachShader(e,n),t.attachShader(e,r),t.linkProgram(e),e}(),c={position:t.getAttribLocation(s,"position"),uv:t.getAttribLocation(s,"uv")},l={uvOffset:t.getUniformLocation(s,"uvOffset"),uvScale:t.getUniformLocation(s,"uvScale"),rotation:t.getUniformLocation(s,"rotation"),center:t.getUniformLocation(s,"center"),scale:t.getUniformLocation(s,"scale"),color:t.getUniformLocation(s,"color"),map:t.getUniformLocation(s,"map"),opacity:t.getUniformLocation(s,"opacity"),modelViewMatrix:t.getUniformLocation(s,"modelViewMatrix"),projectionMatrix:t.getUniformLocation(s,"projectionMatrix"),fogType:t.getUniformLocation(s,"fogType"),fogDensity:t.getUniformLocation(s,"fogDensity"),fogNear:t.getUniformLocation(s,"fogNear"),fogFar:t.getUniformLocation(s,"fogFar"),fogColor:t.getUniformLocation(s,"fogColor"),fogDepth:t.getUniformLocation(s,"fogDepth"),alphaTest:t.getUniformLocation(s,"alphaTest")};var r=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");r.width=8,r.height=8;var h=r.getContext("2d");h.fillStyle="white",h.fillRect(0,0,8,8),u=new be(r)}function m(e,t){return e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.z!==t.z?t.z-e.z:t.id-e.id}this.render=function(i,g,y){if(0!==i.length){void 0===s&&f(),n.useProgram(s),n.initAttributes(),n.enableAttribute(c.position),n.enableAttribute(c.uv),n.disableUnusedAttributes(),n.disable(t.CULL_FACE),n.enable(t.BLEND),t.bindBuffer(t.ARRAY_BUFFER,a),t.vertexAttribPointer(c.position,2,t.FLOAT,!1,16,0),t.vertexAttribPointer(c.uv,2,t.FLOAT,!1,16,8),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,o),t.uniformMatrix4fv(l.projectionMatrix,!1,y.projectionMatrix.elements),n.activeTexture(t.TEXTURE0),t.uniform1i(l.map,0);var v=0,b=0,w=g.fog;w?(t.uniform3f(l.fogColor,w.color.r,w.color.g,w.color.b),w.isFog?(t.uniform1f(l.fogNear,w.near),t.uniform1f(l.fogFar,w.far),t.uniform1i(l.fogType,1),v=1,b=1):w.isFogExp2&&(t.uniform1f(l.fogDensity,w.density),t.uniform1i(l.fogType,2),v=2,b=2)):(t.uniform1i(l.fogType,0),v=0,b=0);for(var A=0,E=i.length;A<E;A++){(S=i[A]).modelViewMatrix.multiplyMatrices(y.matrixWorldInverse,S.matrixWorld),S.z=-S.modelViewMatrix.elements[14]}i.sort(m);var x=[],_=[];for(A=0,E=i.length;A<E;A++){var S,M=(S=i[A]).material;if(!1!==M.visible){S.onBeforeRender(e,g,y,void 0,M,void 0),t.uniform1f(l.alphaTest,M.alphaTest),t.uniformMatrix4fv(l.modelViewMatrix,!1,S.modelViewMatrix.elements),S.matrixWorld.decompose(h,d,p),x[0]=p.x,x[1]=p.y,_[0]=S.center.x-.5,_[1]=S.center.y-.5;var T=0;g.fog&&M.fog&&(T=b),v!==T&&(t.uniform1i(l.fogType,T),v=T),null!==M.map?(t.uniform2f(l.uvOffset,M.map.offset.x,M.map.offset.y),t.uniform2f(l.uvScale,M.map.repeat.x,M.map.repeat.y)):(t.uniform2f(l.uvOffset,0,0),t.uniform2f(l.uvScale,1,1)),t.uniform1f(l.opacity,M.opacity),t.uniform3f(l.color,M.color.r,M.color.g,M.color.b),t.uniform1f(l.rotation,M.rotation),t.uniform2fv(l.center,_),t.uniform2fv(l.scale,x),n.setBlending(M.blending,M.blendEquation,M.blendSrc,M.blendDst,M.blendEquationAlpha,M.blendSrcAlpha,M.blendDstAlpha,M.premultipliedAlpha),n.buffers.depth.setTest(M.depthTest),n.buffers.depth.setMask(M.depthWrite),n.buffers.color.setMask(M.colorWrite),r.setTexture2D(M.map||u,0),t.drawElements(t.TRIANGLES,6,t.UNSIGNED_SHORT,0),S.onAfterRender(e,g,y,void 0,M,void 0)}}n.enable(t.CULL_FACE),n.reset()}}}ve.physical={uniforms:ge.merge([ve.standard.uniforms,{clearCoat:{value:0},clearCoatRoughness:{value:0}}]),vertexShader:ye.meshphysical_vert,fragmentShader:ye.meshphysical_frag},be.prototype=Object.create(E.prototype),be.prototype.constructor=be;var Ae,Ee,xe,_e,Se,Me,Te,Re=0;function ke(){Object.defineProperty(this,"id",{value:Re++}),this.uuid=m.generateUUID(),this.name="",this.type="Material",this.fog=!0,this.lights=!0,this.blending=1,this.side=0,this.flatShading=!1,this.vertexColors=0,this.opacity=1,this.transparent=!1,this.blendSrc=204,this.blendDst=205,this.blendEquation=100,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=3,this.depthTest=!0,this.depthWrite=!0,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.premultipliedAlpha=!1,this.overdraw=0,this.visible=!0,this.userData={},this.needsUpdate=!0}function Ce(e){ke.call(this),this.type="MeshDepthMaterial",this.depthPacking=3200,this.skinning=!1,this.morphTargets=!1,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.lights=!1,this.setValues(e)}function Oe(e){ke.call(this),this.type="MeshDistanceMaterial",this.referencePosition=new b,this.nearDistance=1,this.farDistance=1e3,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.lights=!1,this.setValues(e)}function Pe(e,t){this.min=void 0!==e?e:new b(1/0,1/0,1/0),this.max=void 0!==t?t:new b(-1/0,-1/0,-1/0)}function Ie(e,t){this.center=void 0!==e?e:new b,this.radius=void 0!==t?t:0}function Ne(e,t){this.normal=void 0!==e?e:new b(1,0,0),this.constant=void 0!==t?t:0}function Le(e,t,n,r,i,a){this.planes=[void 0!==e?e:new Ne,void 0!==t?t:new Ne,void 0!==n?n:new Ne,void 0!==r?r:new Ne,void 0!==i?i:new Ne,void 0!==a?a:new Ne]}function De(e,t,n){for(var r=new Le,i=new y,a=new g,o=new g(n,n),s=new b,c=new b,l=new Array(4),u=new Array(4),h={},d={0:1,1:0,2:2},p=[new b(1,0,0),new b(-1,0,0),new b(0,0,1),new b(0,0,-1),new b(0,1,0),new b(0,-1,0)],f=[new b(0,1,0),new b(0,1,0),new b(0,1,0),new b(0,1,0),new b(0,0,1),new b(0,0,-1)],m=[new x,new x,new x,new x,new x,new x],v=0;4!==v;++v){var w=0!=(1&v),A=0!=(2&v),E=new Ce({depthPacking:3201,morphTargets:w,skinning:A});l[v]=E;var S=new Oe({morphTargets:w,skinning:A});u[v]=S}var M=this;function T(t,n,r,i,a,o){var s=t.geometry,c=null,p=l,f=t.customDepthMaterial;if(r&&(p=u,f=t.customDistanceMaterial),f)c=f;else{var m=!1;n.morphTargets&&(s&&s.isBufferGeometry?m=s.morphAttributes&&s.morphAttributes.position&&s.morphAttributes.position.length>0:s&&s.isGeometry&&(m=s.morphTargets&&s.morphTargets.length>0)),t.isSkinnedMesh&&!1===n.skinning&&console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",t);var g=0;m&&(g|=1),t.isSkinnedMesh&&n.skinning&&(g|=2),c=p[g]}if(e.localClippingEnabled&&!0===n.clipShadows&&0!==n.clippingPlanes.length){var y=c.uuid,v=n.uuid,b=h[y];void 0===b&&(b={},h[y]=b);var w=b[v];void 0===w&&(w=c.clone(),b[v]=w),c=w}return c.visible=n.visible,c.wireframe=n.wireframe,c.side=null!=n.shadowSide?n.shadowSide:d[n.side],c.clipShadows=n.clipShadows,c.clippingPlanes=n.clippingPlanes,c.clipIntersection=n.clipIntersection,c.wireframeLinewidth=n.wireframeLinewidth,c.linewidth=n.linewidth,r&&c.isMeshDistanceMaterial&&(c.referencePosition.copy(i),c.nearDistance=a,c.farDistance=o),c}function R(n,i,a,o){if(!1!==n.visible){if(n.layers.test(i.layers)&&(n.isMesh||n.isLine||n.isPoints)&&n.castShadow&&(!n.frustumCulled||r.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(a.matrixWorldInverse,n.matrixWorld);var s=t.update(n),l=n.material;if(Array.isArray(l))for(var u=s.groups,h=0,d=u.length;h<d;h++){var p=u[h],f=l[p.materialIndex];if(f&&f.visible){var m=T(n,f,o,c,a.near,a.far);e.renderBufferDirect(a,null,s,m,n,p)}}else if(l.visible){m=T(n,l,o,c,a.near,a.far);e.renderBufferDirect(a,null,s,m,n,null)}}for(var g=n.children,y=0,v=g.length;y<v;y++)R(g[y],i,a,o)}}this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=1,this.render=function(t,n,l){if(!1!==M.enabled&&(!1!==M.autoUpdate||!1!==M.needsUpdate)&&0!==t.length){var u,h=e.context,d=e.state;d.disable(h.BLEND),d.buffers.color.setClear(1,1,1,1),d.buffers.depth.setTest(!0),d.setScissorTest(!1);for(var g=0,y=t.length;g<y;g++){var v=t[g],b=v.shadow,w=v&&v.isPointLight;if(void 0!==b){var A=b.camera;if(a.copy(b.mapSize),a.min(o),w){var E=a.x,x=a.y;m[0].set(2*E,x,E,x),m[1].set(0,x,E,x),m[2].set(3*E,x,E,x),m[3].set(E,x,E,x),m[4].set(3*E,0,E,x),m[5].set(E,0,E,x),a.x*=4,a.y*=2}if(null===b.map){var S={minFilter:1003,magFilter:1003,format:1023};b.map=new _(a.x,a.y,S),b.map.texture.name=v.name+".shadowMap",A.updateProjectionMatrix()}b.isSpotLightShadow&&b.update(v);var T=b.map,k=b.matrix;c.setFromMatrixPosition(v.matrixWorld),A.position.copy(c),w?(u=6,k.makeTranslation(-c.x,-c.y,-c.z)):(u=1,s.setFromMatrixPosition(v.target.matrixWorld),A.lookAt(s),A.updateMatrixWorld(),k.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),k.multiply(A.projectionMatrix),k.multiply(A.matrixWorldInverse)),e.setRenderTarget(T),e.clear();for(var C=0;C<u;C++){if(w){s.copy(A.position),s.add(p[C]),A.up.copy(f[C]),A.lookAt(s),A.updateMatrixWorld();var O=m[C];d.viewport(O)}i.multiplyMatrices(A.projectionMatrix,A.matrixWorldInverse),r.setFromMatrix(i),R(n,l,A,w)}}else console.warn("THREE.WebGLShadowMap:",v,"has no shadow.")}M.needsUpdate=!1}}}function Fe(e){var t={};return{get:function(e){return e.isInterleavedBufferAttribute&&(e=e.data),t[e.uuid]},remove:function(n){n.isInterleavedBufferAttribute&&(n=n.data);var r=t[n.uuid];r&&(e.deleteBuffer(r.buffer),delete t[n.uuid])},update:function(n,r){n.isInterleavedBufferAttribute&&(n=n.data);var i=t[n.uuid];void 0===i?t[n.uuid]=function(t,n){var r=t.array,i=t.dynamic?e.DYNAMIC_DRAW:e.STATIC_DRAW,a=e.createBuffer();e.bindBuffer(n,a),e.bufferData(n,r,i),t.onUploadCallback();var o=e.FLOAT;return r instanceof Float32Array?o=e.FLOAT:r instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):r instanceof Uint16Array?o=e.UNSIGNED_SHORT:r instanceof Int16Array?o=e.SHORT:r instanceof Uint32Array?o=e.UNSIGNED_INT:r instanceof Int32Array?o=e.INT:r instanceof Int8Array?o=e.BYTE:r instanceof Uint8Array&&(o=e.UNSIGNED_BYTE),{buffer:a,type:o,bytesPerElement:r.BYTES_PER_ELEMENT,version:t.version}}(n,r):i.version<n.version&&(!function(t,n,r){var i=n.array,a=n.updateRange;e.bindBuffer(r,t),!1===n.dynamic?e.bufferData(r,i,e.STATIC_DRAW):-1===a.count?e.bufferSubData(r,0,i):0===a.count?console.error("THREE.WebGLObjects.updateBuffer: dynamic THREE.BufferAttribute marked as needsUpdate but updateRange.count is 0, ensure you are using set methods or updating manually."):(e.bufferSubData(r,a.offset*i.BYTES_PER_ELEMENT,i.subarray(a.offset,a.offset+a.count)),a.count=-1)}(i.buffer,n,r),i.version=n.version)}}}function je(e,t,n,r){this._x=e||0,this._y=t||0,this._z=n||0,this._order=r||je.DefaultOrder}function Ue(){this.mask=1}ke.prototype=Object.assign(Object.create(a.prototype),{constructor:ke,isMaterial:!0,onBeforeCompile:function(){},setValues:function(e){if(void 0!==e)for(var t in e){var n=e[t];if(void 0!==n)if("shading"!==t){var r=this[t];void 0!==r?r&&r.isColor?r.set(n):r&&r.isVector3&&n&&n.isVector3?r.copy(n):this[t]="overdraw"===t?Number(n):n:console.warn("THREE."+this.type+": '"+t+"' is not a property of this material.")}else console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===n;else console.warn("THREE.Material: '"+t+"' parameter is undefined.")}},toJSON:function(e){var t=void 0===e||"string"==typeof e;t&&(e={textures:{},images:{}});var n={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};function r(e){var t=[];for(var n in e){var r=e[n];delete r.metadata,t.push(r)}return t}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),void 0!==this.roughness&&(n.roughness=this.roughness),void 0!==this.metalness&&(n.metalness=this.metalness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),1!==this.emissiveIntensity&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),void 0!==this.shininess&&(n.shininess=this.shininess),void 0!==this.clearCoat&&(n.clearCoat=this.clearCoat),void 0!==this.clearCoatRoughness&&(n.clearCoatRoughness=this.clearCoatRoughness),this.map&&this.map.isTexture&&(n.map=this.map.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),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.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.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,n.reflectivity=this.reflectivity),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.size&&(n.size=this.size),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),1!==this.blending&&(n.blending=this.blending),!0===this.flatShading&&(n.flatShading=this.flatShading),0!==this.side&&(n.side=this.side),0!==this.vertexColors&&(n.vertexColors=this.vertexColors),this.opacity<1&&(n.opacity=this.opacity),!0===this.transparent&&(n.transparent=this.transparent),n.depthFunc=this.depthFunc,n.depthTest=this.depthTest,n.depthWrite=this.depthWrite,0!==this.rotation&&(n.rotation=this.rotation),1!==this.linewidth&&(n.linewidth=this.linewidth),void 0!==this.dashSize&&(n.dashSize=this.dashSize),void 0!==this.gapSize&&(n.gapSize=this.gapSize),void 0!==this.scale&&(n.scale=this.scale),!0===this.dithering&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(n.wireframe=this.wireframe),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.morphTargets&&(n.morphTargets=!0),!0===this.skinning&&(n.skinning=!0),!1===this.visible&&(n.visible=!1),"{}"!==JSON.stringify(this.userData)&&(n.userData=this.userData),t){var i=r(e.textures),a=r(e.images);i.length>0&&(n.textures=i),a.length>0&&(n.images=a)}return n},clone:function(){return(new this.constructor).copy(this)},copy:function(e){this.name=e.name,this.fog=e.fog,this.lights=e.lights,this.blending=e.blending,this.side=e.side,this.flatShading=e.flatShading,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.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.premultipliedAlpha=e.premultipliedAlpha,this.overdraw=e.overdraw,this.visible=e.visible,this.userData=JSON.parse(JSON.stringify(e.userData)),this.clipShadows=e.clipShadows,this.clipIntersection=e.clipIntersection;var t=e.clippingPlanes,n=null;if(null!==t){var r=t.length;n=new Array(r);for(var i=0;i!==r;++i)n[i]=t[i].clone()}return this.clippingPlanes=n,this.shadowSide=e.shadowSide,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Ce.prototype=Object.create(ke.prototype),Ce.prototype.constructor=Ce,Ce.prototype.isMeshDepthMaterial=!0,Ce.prototype.copy=function(e){return ke.prototype.copy.call(this,e),this.depthPacking=e.depthPacking,this.skinning=e.skinning,this.morphTargets=e.morphTargets,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},Oe.prototype=Object.create(ke.prototype),Oe.prototype.constructor=Oe,Oe.prototype.isMeshDistanceMaterial=!0,Oe.prototype.copy=function(e){return ke.prototype.copy.call(this,e),this.referencePosition.copy(e.referencePosition),this.nearDistance=e.nearDistance,this.farDistance=e.farDistance,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this},Object.assign(Pe.prototype,{isBox3:!0,set:function(e,t){return this.min.copy(e),this.max.copy(t),this},setFromArray:function(e){for(var t=1/0,n=1/0,r=1/0,i=-1/0,a=-1/0,o=-1/0,s=0,c=e.length;s<c;s+=3){var l=e[s],u=e[s+1],h=e[s+2];l<t&&(t=l),u<n&&(n=u),h<r&&(r=h),l>i&&(i=l),u>a&&(a=u),h>o&&(o=h)}return this.min.set(t,n,r),this.max.set(i,a,o),this},setFromBufferAttribute:function(e){for(var t=1/0,n=1/0,r=1/0,i=-1/0,a=-1/0,o=-1/0,s=0,c=e.count;s<c;s++){var l=e.getX(s),u=e.getY(s),h=e.getZ(s);l<t&&(t=l),u<n&&(n=u),h<r&&(r=h),l>i&&(i=l),u>a&&(a=u),h>o&&(o=h)}return this.min.set(t,n,r),this.max.set(i,a,o),this},setFromPoints:function(e){this.makeEmpty();for(var t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this},setFromCenterAndSize:function(){var e=new b;return function(t,n){var r=e.copy(n).multiplyScalar(.5);return this.min.copy(t).sub(r),this.max.copy(t).add(r),this}}(),setFromObject:function(e){return this.makeEmpty(),this.expandByObject(e)},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.min.copy(e.min),this.max.copy(e.max),this},makeEmpty:function(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z},getCenter:function(e){var t=e||new b;return this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(e){var t=e||new b;return this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)},expandByPoint:function(e){return this.min.min(e),this.max.max(e),this},expandByVector:function(e){return this.min.sub(e),this.max.add(e),this},expandByScalar:function(e){return this.min.addScalar(-e),this.max.addScalar(e),this},expandByObject:function(){var e,t,n,r=new b;function i(i){var a=i.geometry;if(void 0!==a)if(a.isGeometry){var o=a.vertices;for(t=0,n=o.length;t<n;t++)r.copy(o[t]),r.applyMatrix4(i.matrixWorld),e.expandByPoint(r)}else if(a.isBufferGeometry){var s=a.attributes.position;if(void 0!==s)for(t=0,n=s.count;t<n;t++)r.fromBufferAttribute(s,t).applyMatrix4(i.matrixWorld),e.expandByPoint(r)}}return function(t){return e=this,t.updateMatrixWorld(!0),t.traverse(i),this}}(),containsPoint:function(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y||e.z<this.min.z||e.z>this.max.z)},containsBox:function(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:function(e,t){return(t||new b).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:function(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y||e.max.z<this.min.z||e.min.z>this.max.z)},intersectsSphere:(Ee=new b,function(e){return this.clampPoint(e.center,Ee),Ee.distanceToSquared(e.center)<=e.radius*e.radius}),intersectsPlane:function(e){var 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:function(){var e=new b,t=new b,n=new b,r=new b,i=new b,a=new b,o=new b,s=new b,c=new b,l=new b;function u(r){var i,a;for(i=0,a=r.length-3;i<=a;i+=3){o.fromArray(r,i);var s=c.x*Math.abs(o.x)+c.y*Math.abs(o.y)+c.z*Math.abs(o.z),l=e.dot(o),u=t.dot(o),h=n.dot(o);if(Math.max(-Math.max(l,u,h),Math.min(l,u,h))>s)return!1}return!0}return function(o){if(this.isEmpty())return!1;this.getCenter(s),c.subVectors(this.max,s),e.subVectors(o.a,s),t.subVectors(o.b,s),n.subVectors(o.c,s),r.subVectors(t,e),i.subVectors(n,t),a.subVectors(e,n);var h=[0,-r.z,r.y,0,-i.z,i.y,0,-a.z,a.y,r.z,0,-r.x,i.z,0,-i.x,a.z,0,-a.x,-r.y,r.x,0,-i.y,i.x,0,-a.y,a.x,0];return!!u(h)&&(!!u(h=[1,0,0,0,1,0,0,0,1])&&(l.crossVectors(r,i),u(h=[l.x,l.y,l.z])))}}(),clampPoint:function(e,t){return(t||new b).copy(e).clamp(this.min,this.max)},distanceToPoint:function(){var e=new b;return function(t){return e.copy(t).clamp(this.min,this.max).sub(t).length()}}(),getBoundingSphere:function(){var e=new b;return function(t){var n=t||new Ie;return this.getCenter(n.center),n.radius=.5*this.getSize(e).length(),n}}(),intersect:function(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this},union:function(e){return this.min.min(e.min),this.max.max(e.max),this},applyMatrix4:(Ae=[new b,new b,new b,new b,new b,new b,new b,new b],function(e){return this.isEmpty()||(Ae[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Ae[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Ae[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Ae[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Ae[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Ae[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Ae[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Ae[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Ae)),this}),translate:function(e){return this.min.add(e),this.max.add(e),this},equals:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}),Object.assign(Ie.prototype,{set:function(e,t){return this.center.copy(e),this.radius=t,this},setFromPoints:(xe=new Pe,function(e,t){var n=this.center;void 0!==t?n.copy(t):xe.setFromPoints(e).getCenter(n);for(var r=0,i=0,a=e.length;i<a;i++)r=Math.max(r,n.distanceToSquared(e[i]));return this.radius=Math.sqrt(r),this}),clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.center.copy(e.center),this.radius=e.radius,this},empty:function(){return this.radius<=0},containsPoint:function(e){return e.distanceToSquared(this.center)<=this.radius*this.radius},distanceToPoint:function(e){return e.distanceTo(this.center)-this.radius},intersectsSphere:function(e){var t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t},intersectsBox:function(e){return e.intersectsSphere(this)},intersectsPlane:function(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius},clampPoint:function(e,t){var n=this.center.distanceToSquared(e),r=t||new b;return r.copy(e),n>this.radius*this.radius&&(r.sub(this.center).normalize(),r.multiplyScalar(this.radius).add(this.center)),r},getBoundingBox:function(e){var t=e||new Pe;return t.set(this.center,this.center),t.expandByScalar(this.radius),t},applyMatrix4:function(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this},translate:function(e){return this.center.add(e),this},equals:function(e){return e.center.equals(this.center)&&e.radius===this.radius}}),Object.assign(Ne.prototype,{set:function(e,t){return this.normal.copy(e),this.constant=t,this},setComponents:function(e,t,n,r){return this.normal.set(e,t,n),this.constant=r,this},setFromNormalAndCoplanarPoint:function(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this},setFromCoplanarPoints:function(){var e=new b,t=new b;return function(n,r,i){var a=e.subVectors(i,r).cross(t.subVectors(n,r)).normalize();return this.setFromNormalAndCoplanarPoint(a,n),this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.normal.copy(e.normal),this.constant=e.constant,this},normalize:function(){var e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this},negate:function(){return this.constant*=-1,this.normal.negate(),this},distanceToPoint:function(e){return this.normal.dot(e)+this.constant},distanceToSphere:function(e){return this.distanceToPoint(e.center)-e.radius},projectPoint:function(e,t){return(t||new b).copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)},intersectLine:function(){var e=new b;return function(t,n){var r=n||new b,i=t.delta(e),a=this.normal.dot(i);if(0===a)return 0===this.distanceToPoint(t.start)?r.copy(t.start):void 0;var o=-(t.start.dot(this.normal)+this.constant)/a;return o<0||o>1?void 0:r.copy(i).multiplyScalar(o).add(t.start)}}(),intersectsLine:function(e){var t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0},intersectsBox:function(e){return e.intersectsPlane(this)},intersectsSphere:function(e){return e.intersectsPlane(this)},coplanarPoint:function(e){return(e||new b).copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(){var e=new b,t=new w;return function(n,r){var i=r||t.getNormalMatrix(n),a=this.coplanarPoint(e).applyMatrix4(n),o=this.normal.applyMatrix3(i).normalize();return this.constant=-a.dot(o),this}}(),translate:function(e){return this.constant-=e.dot(this.normal),this},equals:function(e){return e.normal.equals(this.normal)&&e.constant===this.constant}}),Object.assign(Le.prototype,{set:function(e,t,n,r,i,a){var o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(n),o[3].copy(r),o[4].copy(i),o[5].copy(a),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){for(var t=this.planes,n=0;n<6;n++)t[n].copy(e.planes[n]);return this},setFromMatrix:function(e){var t=this.planes,n=e.elements,r=n[0],i=n[1],a=n[2],o=n[3],s=n[4],c=n[5],l=n[6],u=n[7],h=n[8],d=n[9],p=n[10],f=n[11],m=n[12],g=n[13],y=n[14],v=n[15];return t[0].setComponents(o-r,u-s,f-h,v-m).normalize(),t[1].setComponents(o+r,u+s,f+h,v+m).normalize(),t[2].setComponents(o+i,u+c,f+d,v+g).normalize(),t[3].setComponents(o-i,u-c,f-d,v-g).normalize(),t[4].setComponents(o-a,u-l,f-p,v-y).normalize(),t[5].setComponents(o+a,u+l,f+p,v+y).normalize(),this},intersectsObject:(Me=new Ie,function(e){var t=e.geometry;return null===t.boundingSphere&&t.computeBoundingSphere(),Me.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(Me)}),intersectsSprite:function(){var e=new Ie;return function(t){return e.center.set(0,0,0),e.radius=.7071067811865476,e.applyMatrix4(t.matrixWorld),this.intersectsSphere(e)}}(),intersectsSphere:function(e){for(var t=this.planes,n=e.center,r=-e.radius,i=0;i<6;i++){if(t[i].distanceToPoint(n)<r)return!1}return!0},intersectsBox:(_e=new b,Se=new b,function(e){for(var t=this.planes,n=0;n<6;n++){var r=t[n];_e.x=r.normal.x>0?e.min.x:e.max.x,Se.x=r.normal.x>0?e.max.x:e.min.x,_e.y=r.normal.y>0?e.min.y:e.max.y,Se.y=r.normal.y>0?e.max.y:e.min.y,_e.z=r.normal.z>0?e.min.z:e.max.z,Se.z=r.normal.z>0?e.max.z:e.min.z;var i=r.distanceToPoint(_e),a=r.distanceToPoint(Se);if(i<0&&a<0)return!1}return!0}),containsPoint:function(e){for(var t=this.planes,n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}}),je.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"],je.DefaultOrder="XYZ",Object.defineProperties(je.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this.onChangeCallback()}},y:{get:function(){return this._y},set:function(e){this._y=e,this.onChangeCallback()}},z:{get:function(){return this._z},set:function(e){this._z=e,this.onChangeCallback()}},order:{get:function(){return this._order},set:function(e){this._order=e,this.onChangeCallback()}}}),Object.assign(je.prototype,{isEuler:!0,set:function(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._order=r||this._order,this.onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._order)},copy:function(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this.onChangeCallback(),this},setFromRotationMatrix:function(e,t,n){var r=m.clamp,i=e.elements,a=i[0],o=i[4],s=i[8],c=i[1],l=i[5],u=i[9],h=i[2],d=i[6],p=i[10];return"XYZ"===(t=t||this._order)?(this._y=Math.asin(r(s,-1,1)),Math.abs(s)<.99999?(this._x=Math.atan2(-u,p),this._z=Math.atan2(-o,a)):(this._x=Math.atan2(d,l),this._z=0)):"YXZ"===t?(this._x=Math.asin(-r(u,-1,1)),Math.abs(u)<.99999?(this._y=Math.atan2(s,p),this._z=Math.atan2(c,l)):(this._y=Math.atan2(-h,a),this._z=0)):"ZXY"===t?(this._x=Math.asin(r(d,-1,1)),Math.abs(d)<.99999?(this._y=Math.atan2(-h,p),this._z=Math.atan2(-o,l)):(this._y=0,this._z=Math.atan2(c,a))):"ZYX"===t?(this._y=Math.asin(-r(h,-1,1)),Math.abs(h)<.99999?(this._x=Math.atan2(d,p),this._z=Math.atan2(c,a)):(this._x=0,this._z=Math.atan2(-o,l))):"YZX"===t?(this._z=Math.asin(r(c,-1,1)),Math.abs(c)<.99999?(this._x=Math.atan2(-u,l),this._y=Math.atan2(-h,a)):(this._x=0,this._y=Math.atan2(s,p))):"XZY"===t?(this._z=Math.asin(-r(o,-1,1)),Math.abs(o)<.99999?(this._x=Math.atan2(d,l),this._y=Math.atan2(s,a)):(this._x=Math.atan2(-u,p),this._y=0)):console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+t),this._order=t,!1!==n&&this.onChangeCallback(),this},setFromQuaternion:function(){var e=new y;return function(t,n,r){return e.makeRotationFromQuaternion(t),this.setFromRotationMatrix(e,n,r)}}(),setFromVector3:function(e,t){return this.set(e.x,e.y,e.z,t||this._order)},reorder:(Te=new v,function(e){return Te.setFromEuler(this),this.setFromQuaternion(Te,e)}),equals:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order},fromArray:function(e){return this._x=e[0],this._y=e[1],this._z=e[2],void 0!==e[3]&&(this._order=e[3]),this.onChangeCallback(),this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e},toVector3:function(e){return e?e.set(this._x,this._y,this._z):new b(this._x,this._y,this._z)},onChange:function(e){return this.onChangeCallback=e,this},onChangeCallback:function(){}}),Object.assign(Ue.prototype,{set:function(e){this.mask=1<<e|0},enable:function(e){this.mask|=1<<e|0},toggle:function(e){this.mask^=1<<e|0},disable:function(e){this.mask&=~(1<<e|0)},test:function(e){return 0!=(this.mask&e.mask)}});var Be,Ve,ze,He,Ge=0;function qe(){Object.defineProperty(this,"id",{value:Ge++}),this.uuid=m.generateUUID(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=qe.DefaultUp.clone();var e=new b,t=new je,n=new v,r=new b(1,1,1);t.onChange((function(){n.setFromEuler(t,!1)})),n.onChange((function(){t.setFromQuaternion(n,void 0,!1)})),Object.defineProperties(this,{position:{enumerable:!0,value:e},rotation:{enumerable:!0,value:t},quaternion:{enumerable:!0,value:n},scale:{enumerable:!0,value:r},modelViewMatrix:{value:new y},normalMatrix:{value:new w}}),this.matrix=new y,this.matrixWorld=new y,this.matrixAutoUpdate=qe.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new Ue,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.userData={}}function We(){qe.call(this),this.type="Camera",this.matrixWorldInverse=new y,this.projectionMatrix=new y}function Je(e,t,n,r,i,a){We.call(this),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=r,this.near=void 0!==i?i:.1,this.far=void 0!==a?a:2e3,this.updateProjectionMatrix()}function Ze(e,t,n,r,i,a){this.a=e,this.b=t,this.c=n,this.normal=r&&r.isVector3?r:new b,this.vertexNormals=Array.isArray(r)?r:[],this.color=i&&i.isColor?i:new fe,this.vertexColors=Array.isArray(i)?i:[],this.materialIndex=void 0!==a?a:0}qe.DefaultUp=new b(0,1,0),qe.DefaultMatrixAutoUpdate=!0,qe.prototype=Object.assign(Object.create(a.prototype),{constructor:qe,isObject3D:!0,onBeforeRender:function(){},onAfterRender:function(){},applyMatrix:function(e){this.matrix.multiplyMatrices(e,this.matrix),this.matrix.decompose(this.position,this.quaternion,this.scale)},applyQuaternion:function(e){return this.quaternion.premultiply(e),this},setRotationFromAxisAngle:function(e,t){this.quaternion.setFromAxisAngle(e,t)},setRotationFromEuler:function(e){this.quaternion.setFromEuler(e,!0)},setRotationFromMatrix:function(e){this.quaternion.setFromRotationMatrix(e)},setRotationFromQuaternion:function(e){this.quaternion.copy(e)},rotateOnAxis:(He=new v,function(e,t){return He.setFromAxisAngle(e,t),this.quaternion.multiply(He),this}),rotateOnWorldAxis:function(){var e=new v;return function(t,n){return e.setFromAxisAngle(t,n),this.quaternion.premultiply(e),this}}(),rotateX:function(){var e=new b(1,0,0);return function(t){return this.rotateOnAxis(e,t)}}(),rotateY:function(){var e=new b(0,1,0);return function(t){return this.rotateOnAxis(e,t)}}(),rotateZ:function(){var e=new b(0,0,1);return function(t){return this.rotateOnAxis(e,t)}}(),translateOnAxis:function(){var e=new b;return function(t,n){return e.copy(t).applyQuaternion(this.quaternion),this.position.add(e.multiplyScalar(n)),this}}(),translateX:function(){var e=new b(1,0,0);return function(t){return this.translateOnAxis(e,t)}}(),translateY:function(){var e=new b(0,1,0);return function(t){return this.translateOnAxis(e,t)}}(),translateZ:function(){var e=new b(0,0,1);return function(t){return this.translateOnAxis(e,t)}}(),localToWorld:function(e){return e.applyMatrix4(this.matrixWorld)},worldToLocal:(ze=new y,function(e){return e.applyMatrix4(ze.getInverse(this.matrixWorld))}),lookAt:function(){var e=new y,t=new b;return function(n,r,i){n.isVector3?t.copy(n):t.set(n,r,i),this.isCamera?e.lookAt(this.position,t,this.up):e.lookAt(t,this.position,this.up),this.quaternion.setFromRotationMatrix(e)}}(),add:function(e){if(arguments.length>1){for(var t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(null!==e.parent&&e.parent.remove(e),e.parent=this,e.dispatchEvent({type:"added"}),this.children.push(e)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)},remove:function(e){if(arguments.length>1){for(var t=0;t<arguments.length;t++)this.remove(arguments[t]);return this}var n=this.children.indexOf(e);return-1!==n&&(e.parent=null,e.dispatchEvent({type:"removed"}),this.children.splice(n,1)),this},getObjectById:function(e){return this.getObjectByProperty("id",e)},getObjectByName:function(e){return this.getObjectByProperty("name",e)},getObjectByProperty:function(e,t){if(this[e]===t)return this;for(var n=0,r=this.children.length;n<r;n++){var i=this.children[n].getObjectByProperty(e,t);if(void 0!==i)return i}},getWorldPosition:function(e){var t=e||new b;return this.updateMatrixWorld(!0),t.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:(Be=new b,Ve=new b,function(e){var t=e||new v;return this.updateMatrixWorld(!0),this.matrixWorld.decompose(Be,t,Ve),t}),getWorldRotation:function(){var e=new v;return function(t){var n=t||new je;return this.getWorldQuaternion(e),n.setFromQuaternion(e,this.rotation.order,!1)}}(),getWorldScale:function(){var e=new b,t=new v;return function(n){var r=n||new b;return this.updateMatrixWorld(!0),this.matrixWorld.decompose(e,t,r),r}}(),getWorldDirection:function(){var e=new v;return function(t){var n=t||new b;return this.getWorldQuaternion(e),n.set(0,0,1).applyQuaternion(e)}}(),raycast:function(){},traverse:function(e){e(this);for(var t=this.children,n=0,r=t.length;n<r;n++)t[n].traverse(e)},traverseVisible:function(e){if(!1!==this.visible){e(this);for(var t=this.children,n=0,r=t.length;n<r;n++)t[n].traverseVisible(e)}},traverseAncestors:function(e){var t=this.parent;null!==t&&(e(t),t.traverseAncestors(e))},updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,e=!0);for(var t=this.children,n=0,r=t.length;n<r;n++)t[n].updateMatrixWorld(e)},toJSON:function(e){var t=void 0===e||"string"==typeof e,n={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{}},n.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});var r={};function i(t,n){return void 0===t[n.uuid]&&(t[n.uuid]=n.toJSON(e)),n.uuid}if(r.uuid=this.uuid,r.type=this.type,""!==this.name&&(r.name=this.name),!0===this.castShadow&&(r.castShadow=!0),!0===this.receiveShadow&&(r.receiveShadow=!0),!1===this.visible&&(r.visible=!1),"{}"!==JSON.stringify(this.userData)&&(r.userData=this.userData),r.matrix=this.matrix.toArray(),void 0!==this.geometry){r.geometry=i(e.geometries,this.geometry);var a=this.geometry.parameters;if(void 0!==a&&void 0!==a.shapes){var o=a.shapes;if(Array.isArray(o))for(var s=0,c=o.length;s<c;s++){var l=o[s];i(e.shapes,l)}else i(e.shapes,o)}}if(void 0!==this.material)if(Array.isArray(this.material)){var u=[];for(s=0,c=this.material.length;s<c;s++)u.push(i(e.materials,this.material[s]));r.material=u}else r.material=i(e.materials,this.material);if(this.children.length>0){r.children=[];for(s=0;s<this.children.length;s++)r.children.push(this.children[s].toJSON(e).object)}if(t){var h=m(e.geometries),d=m(e.materials),p=m(e.textures),f=m(e.images);o=m(e.shapes);h.length>0&&(n.geometries=h),d.length>0&&(n.materials=d),p.length>0&&(n.textures=p),f.length>0&&(n.images=f),o.length>0&&(n.shapes=o)}return n.object=r,n;function m(e){var t=[];for(var n in e){var r=e[n];delete r.metadata,t.push(r)}return t}},clone:function(e){return(new this.constructor).copy(this,e)},copy:function(e,t){if(void 0===t&&(t=!0),this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),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)),!0===t)for(var n=0;n<e.children.length;n++){var r=e.children[n];this.add(r.clone())}return this}}),We.prototype=Object.assign(Object.create(qe.prototype),{constructor:We,isCamera:!0,copy:function(e,t){return qe.prototype.copy.call(this,e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this},getWorldDirection:function(){var e=new v;return function(t){var n=t||new b;return this.getWorldQuaternion(e),n.set(0,0,-1).applyQuaternion(e)}}(),updateMatrixWorld:function(e){qe.prototype.updateMatrixWorld.call(this,e),this.matrixWorldInverse.getInverse(this.matrixWorld)},clone:function(){return(new this.constructor).copy(this)}}),Je.prototype=Object.assign(Object.create(We.prototype),{constructor:Je,isOrthographicCamera:!0,copy:function(e,t){return We.prototype.copy.call(this,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=null===e.view?null:Object.assign({},e.view),this},setViewOffset:function(e,t,n,r,i,a){null===this.view&&(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=r,this.view.width=i,this.view.height=a,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,r=(this.top+this.bottom)/2,i=n-e,a=n+e,o=r+t,s=r-t;if(null!==this.view&&this.view.enabled){var c=this.zoom/(this.view.width/this.view.fullWidth),l=this.zoom/(this.view.height/this.view.fullHeight),u=(this.right-this.left)/this.view.width,h=(this.top-this.bottom)/this.view.height;a=(i+=u*(this.view.offsetX/c))+u*(this.view.width/c),s=(o-=h*(this.view.offsetY/l))-h*(this.view.height/l)}this.projectionMatrix.makeOrthographic(i,a,o,s,this.near,this.far)},toJSON:function(e){var t=qe.prototype.toJSON.call(this,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,null!==this.view&&(t.object.view=Object.assign({},this.view)),t}}),Object.assign(Ze.prototype,{clone:function(){return(new this.constructor).copy(this)},copy:function(e){this.a=e.a,this.b=e.b,this.c=e.c,this.normal.copy(e.normal),this.color.copy(e.color),this.materialIndex=e.materialIndex;for(var t=0,n=e.vertexNormals.length;t<n;t++)this.vertexNormals[t]=e.vertexNormals[t].clone();for(t=0,n=e.vertexColors.length;t<n;t++)this.vertexColors[t]=e.vertexColors[t].clone();return this}});var Xe,Ye=0;function Ke(){Object.defineProperty(this,"id",{value:Ye+=2}),this.uuid=m.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}function Qe(e,t,n){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.uuid=m.generateUUID(),this.name="",this.array=e,this.itemSize=t,this.count=void 0!==e?e.length/t:0,this.normalized=!0===n,this.dynamic=!1,this.updateRange={offset:0,count:-1},this.onUploadCallback=function(){},this.version=0}function $e(e,t,n){Qe.call(this,new Int8Array(e),t,n)}function et(e,t,n){Qe.call(this,new Uint8Array(e),t,n)}function tt(e,t,n){Qe.call(this,new Uint8ClampedArray(e),t,n)}function nt(e,t,n){Qe.call(this,new Int16Array(e),t,n)}function rt(e,t,n){Qe.call(this,new Uint16Array(e),t,n)}function it(e,t,n){Qe.call(this,new Int32Array(e),t,n)}function at(e,t,n){Qe.call(this,new Uint32Array(e),t,n)}function ot(e,t,n){Qe.call(this,new Float32Array(e),t,n)}function st(e,t,n){Qe.call(this,new Float64Array(e),t,n)}function ct(){this.indices=[],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}function lt(e){if(0===e.length)return-1/0;for(var t=e[0],n=1,r=e.length;n<r;++n)e[n]>t&&(t=e[n]);return t}Ke.prototype=Object.assign(Object.create(a.prototype),{constructor:Ke,isGeometry:!0,applyMatrix:function(e){for(var t=(new w).getNormalMatrix(e),n=0,r=this.vertices.length;n<r;n++){this.vertices[n].applyMatrix4(e)}for(n=0,r=this.faces.length;n<r;n++){var i=this.faces[n];i.normal.applyMatrix3(t).normalize();for(var a=0,o=i.vertexNormals.length;a<o;a++)i.vertexNormals[a].applyMatrix3(t).normalize()}return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this.verticesNeedUpdate=!0,this.normalsNeedUpdate=!0,this},rotateX:function(){var e=new y;return function(t){return e.makeRotationX(t),this.applyMatrix(e),this}}(),rotateY:function(){var e=new y;return function(t){return e.makeRotationY(t),this.applyMatrix(e),this}}(),rotateZ:function(){var e=new y;return function(t){return e.makeRotationZ(t),this.applyMatrix(e),this}}(),translate:function(){var e=new y;return function(t,n,r){return e.makeTranslation(t,n,r),this.applyMatrix(e),this}}(),scale:function(){var e=new y;return function(t,n,r){return e.makeScale(t,n,r),this.applyMatrix(e),this}}(),lookAt:(Xe=new qe,function(e){Xe.lookAt(e),Xe.updateMatrix(),this.applyMatrix(Xe.matrix)}),fromBufferGeometry:function(e){var t=this,n=null!==e.index?e.index.array:void 0,r=e.attributes,i=r.position.array,a=void 0!==r.normal?r.normal.array:void 0,o=void 0!==r.color?r.color.array:void 0,s=void 0!==r.uv?r.uv.array:void 0,c=void 0!==r.uv2?r.uv2.array:void 0;void 0!==c&&(this.faceVertexUvs[1]=[]);for(var l=[],u=[],h=[],d=0,p=0;d<i.length;d+=3,p+=2)t.vertices.push(new b(i[d],i[d+1],i[d+2])),void 0!==a&&l.push(new b(a[d],a[d+1],a[d+2])),void 0!==o&&t.colors.push(new fe(o[d],o[d+1],o[d+2])),void 0!==s&&u.push(new g(s[p],s[p+1])),void 0!==c&&h.push(new g(c[p],c[p+1]));function f(e,n,r,i){var d=new Ze(e,n,r,void 0!==a?[l[e].clone(),l[n].clone(),l[r].clone()]:[],void 0!==o?[t.colors[e].clone(),t.colors[n].clone(),t.colors[r].clone()]:[],i);t.faces.push(d),void 0!==s&&t.faceVertexUvs[0].push([u[e].clone(),u[n].clone(),u[r].clone()]),void 0!==c&&t.faceVertexUvs[1].push([h[e].clone(),h[n].clone(),h[r].clone()])}var m=e.groups;if(m.length>0)for(d=0;d<m.length;d++)for(var y=m[d],v=y.start,w=(p=v,v+y.count);p<w;p+=3)void 0!==n?f(n[p],n[p+1],n[p+2],y.materialIndex):f(p,p+1,p+2,y.materialIndex);else if(void 0!==n)for(d=0;d<n.length;d+=3)f(n[d],n[d+1],n[d+2]);else for(d=0;d<i.length/3;d+=3)f(d,d+1,d+2);return this.computeFaceNormals(),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),this},center:function(){this.computeBoundingBox();var e=this.boundingBox.getCenter().negate();return this.translate(e.x,e.y,e.z),e},normalize:function(){this.computeBoundingSphere();var e=this.boundingSphere.center,t=this.boundingSphere.radius,n=0===t?1:1/t,r=new y;return r.set(n,0,0,-n*e.x,0,n,0,-n*e.y,0,0,n,-n*e.z,0,0,0,1),this.applyMatrix(r),this},computeFaceNormals:function(){for(var e=new b,t=new b,n=0,r=this.faces.length;n<r;n++){var i=this.faces[n],a=this.vertices[i.a],o=this.vertices[i.b],s=this.vertices[i.c];e.subVectors(s,o),t.subVectors(a,o),e.cross(t),e.normalize(),i.normal.copy(e)}},computeVertexNormals:function(e){var t,n,r,i,a,o;for(void 0===e&&(e=!0),o=new Array(this.vertices.length),t=0,n=this.vertices.length;t<n;t++)o[t]=new b;if(e){var s,c,l,u=new b,h=new b;for(r=0,i=this.faces.length;r<i;r++)a=this.faces[r],s=this.vertices[a.a],c=this.vertices[a.b],l=this.vertices[a.c],u.subVectors(l,c),h.subVectors(s,c),u.cross(h),o[a.a].add(u),o[a.b].add(u),o[a.c].add(u)}else for(this.computeFaceNormals(),r=0,i=this.faces.length;r<i;r++)o[(a=this.faces[r]).a].add(a.normal),o[a.b].add(a.normal),o[a.c].add(a.normal);for(t=0,n=this.vertices.length;t<n;t++)o[t].normalize();for(r=0,i=this.faces.length;r<i;r++){var d=(a=this.faces[r]).vertexNormals;3===d.length?(d[0].copy(o[a.a]),d[1].copy(o[a.b]),d[2].copy(o[a.c])):(d[0]=o[a.a].clone(),d[1]=o[a.b].clone(),d[2]=o[a.c].clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)},computeFlatVertexNormals:function(){var e,t,n;for(this.computeFaceNormals(),e=0,t=this.faces.length;e<t;e++){var r=(n=this.faces[e]).vertexNormals;3===r.length?(r[0].copy(n.normal),r[1].copy(n.normal),r[2].copy(n.normal)):(r[0]=n.normal.clone(),r[1]=n.normal.clone(),r[2]=n.normal.clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){var e,t,n,r,i;for(n=0,r=this.faces.length;n<r;n++)for((i=this.faces[n]).__originalFaceNormal?i.__originalFaceNormal.copy(i.normal):i.__originalFaceNormal=i.normal.clone(),i.__originalVertexNormals||(i.__originalVertexNormals=[]),e=0,t=i.vertexNormals.length;e<t;e++)i.__originalVertexNormals[e]?i.__originalVertexNormals[e].copy(i.vertexNormals[e]):i.__originalVertexNormals[e]=i.vertexNormals[e].clone();var a=new Ke;for(a.faces=this.faces,e=0,t=this.morphTargets.length;e<t;e++){if(!this.morphNormals[e]){this.morphNormals[e]={},this.morphNormals[e].faceNormals=[],this.morphNormals[e].vertexNormals=[];var o=this.morphNormals[e].faceNormals,s=this.morphNormals[e].vertexNormals;for(n=0,r=this.faces.length;n<r;n++)c=new b,l={a:new b,b:new b,c:new b},o.push(c),s.push(l)}var c,l,u=this.morphNormals[e];for(a.vertices=this.morphTargets[e].vertices,a.computeFaceNormals(),a.computeVertexNormals(),n=0,r=this.faces.length;n<r;n++)i=this.faces[n],c=u.faceNormals[n],l=u.vertexNormals[n],c.copy(i.normal),l.a.copy(i.vertexNormals[0]),l.b.copy(i.vertexNormals[1]),l.c.copy(i.vertexNormals[2])}for(n=0,r=this.faces.length;n<r;n++)(i=this.faces[n]).normal=i.__originalFaceNormal,i.vertexNormals=i.__originalVertexNormals},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new Pe),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new Ie),this.boundingSphere.setFromPoints(this.vertices)},merge:function(e,t,n){if(e&&e.isGeometry){var r,i=this.vertices.length,a=this.vertices,o=e.vertices,s=this.faces,c=e.faces,l=this.faceVertexUvs[0],u=e.faceVertexUvs[0],h=this.colors,d=e.colors;void 0===n&&(n=0),void 0!==t&&(r=(new w).getNormalMatrix(t));for(var p=0,f=o.length;p<f;p++){var m=o[p].clone();void 0!==t&&m.applyMatrix4(t),a.push(m)}for(p=0,f=d.length;p<f;p++)h.push(d[p].clone());for(p=0,f=c.length;p<f;p++){var g,y,v,b=c[p],A=b.vertexNormals,E=b.vertexColors;(g=new Ze(b.a+i,b.b+i,b.c+i)).normal.copy(b.normal),void 0!==r&&g.normal.applyMatrix3(r).normalize();for(var x=0,_=A.length;x<_;x++)y=A[x].clone(),void 0!==r&&y.applyMatrix3(r).normalize(),g.vertexNormals.push(y);g.color.copy(b.color);for(x=0,_=E.length;x<_;x++)v=E[x],g.vertexColors.push(v.clone());g.materialIndex=b.materialIndex+n,s.push(g)}for(p=0,f=u.length;p<f;p++){var S=u[p],M=[];if(void 0!==S){for(x=0,_=S.length;x<_;x++)M.push(S[x].clone());l.push(M)}}}else console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",e)},mergeMesh:function(e){e&&e.isMesh?(e.matrixAutoUpdate&&e.updateMatrix(),this.merge(e.geometry,e.matrix)):console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",e)},mergeVertices:function(){var e,t,n,r,i,a,o,s,c={},l=[],u=[],h=Math.pow(10,4);for(n=0,r=this.vertices.length;n<r;n++)e=this.vertices[n],void 0===c[t=Math.round(e.x*h)+"_"+Math.round(e.y*h)+"_"+Math.round(e.z*h)]?(c[t]=n,l.push(this.vertices[n]),u[n]=l.length-1):u[n]=u[c[t]];var d=[];for(n=0,r=this.faces.length;n<r;n++){(i=this.faces[n]).a=u[i.a],i.b=u[i.b],i.c=u[i.c],a=[i.a,i.b,i.c];for(var p=0;p<3;p++)if(a[p]===a[(p+1)%3]){d.push(n);break}}for(n=d.length-1;n>=0;n--){var f=d[n];for(this.faces.splice(f,1),o=0,s=this.faceVertexUvs.length;o<s;o++)this.faceVertexUvs[o].splice(f,1)}var m=this.vertices.length-l.length;return this.vertices=l,m},setFromPoints:function(e){this.vertices=[];for(var t=0,n=e.length;t<n;t++){var r=e[t];this.vertices.push(new b(r.x,r.y,r.z||0))}return this},sortFacesByMaterialIndex:function(){for(var e=this.faces,t=e.length,n=0;n<t;n++)e[n]._id=n;e.sort((function(e,t){return e.materialIndex-t.materialIndex}));var r,i,a=this.faceVertexUvs[0],o=this.faceVertexUvs[1];a&&a.length===t&&(r=[]),o&&o.length===t&&(i=[]);for(n=0;n<t;n++){var s=e[n]._id;r&&r.push(a[s]),i&&i.push(o[s])}r&&(this.faceVertexUvs[0]=r),i&&(this.faceVertexUvs[1]=i)},toJSON:function(){var e={metadata:{version:4.5,type:"Geometry",generator:"Geometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,""!==this.name&&(e.name=this.name),void 0!==this.parameters){var t=this.parameters;for(var n in t)void 0!==t[n]&&(e[n]=t[n]);return e}for(var r=[],i=0;i<this.vertices.length;i++){var a=this.vertices[i];r.push(a.x,a.y,a.z)}var o=[],s=[],c={},l=[],u={},h=[],d={};for(i=0;i<this.faces.length;i++){var p=this.faces[i],f=void 0!==this.faceVertexUvs[0][i],m=p.normal.length()>0,g=p.vertexNormals.length>0,y=1!==p.color.r||1!==p.color.g||1!==p.color.b,v=p.vertexColors.length>0,b=0;if(b=x(b,0,0),b=x(b,1,!0),b=x(b,2,!1),b=x(b,3,f),b=x(b,4,m),b=x(b,5,g),b=x(b,6,y),b=x(b,7,v),o.push(b),o.push(p.a,p.b,p.c),o.push(p.materialIndex),f){var w=this.faceVertexUvs[0][i];o.push(M(w[0]),M(w[1]),M(w[2]))}if(m&&o.push(_(p.normal)),g){var A=p.vertexNormals;o.push(_(A[0]),_(A[1]),_(A[2]))}if(y&&o.push(S(p.color)),v){var E=p.vertexColors;o.push(S(E[0]),S(E[1]),S(E[2]))}}function x(e,t,n){return n?e|1<<t:e&~(1<<t)}function _(e){var t=e.x.toString()+e.y.toString()+e.z.toString();return void 0!==c[t]||(c[t]=s.length/3,s.push(e.x,e.y,e.z)),c[t]}function S(e){var t=e.r.toString()+e.g.toString()+e.b.toString();return void 0!==u[t]||(u[t]=l.length,l.push(e.getHex())),u[t]}function M(e){var t=e.x.toString()+e.y.toString();return void 0!==d[t]||(d[t]=h.length/2,h.push(e.x,e.y)),d[t]}return e.data={},e.data.vertices=r,e.data.normals=s,l.length>0&&(e.data.colors=l),h.length>0&&(e.data.uvs=[h]),e.data.faces=o,e},clone:function(){return(new Ke).copy(this)},copy:function(e){var t,n,r,i,a,o;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;var s=e.vertices;for(t=0,n=s.length;t<n;t++)this.vertices.push(s[t].clone());var c=e.colors;for(t=0,n=c.length;t<n;t++)this.colors.push(c[t].clone());var l=e.faces;for(t=0,n=l.length;t<n;t++)this.faces.push(l[t].clone());for(t=0,n=e.faceVertexUvs.length;t<n;t++){var u=e.faceVertexUvs[t];for(void 0===this.faceVertexUvs[t]&&(this.faceVertexUvs[t]=[]),r=0,i=u.length;r<i;r++){var h=u[r],d=[];for(a=0,o=h.length;a<o;a++){var p=h[a];d.push(p.clone())}this.faceVertexUvs[t].push(d)}}var f=e.morphTargets;for(t=0,n=f.length;t<n;t++){var m={};if(m.name=f[t].name,void 0!==f[t].vertices)for(m.vertices=[],r=0,i=f[t].vertices.length;r<i;r++)m.vertices.push(f[t].vertices[r].clone());if(void 0!==f[t].normals)for(m.normals=[],r=0,i=f[t].normals.length;r<i;r++)m.normals.push(f[t].normals[r].clone());this.morphTargets.push(m)}var g=e.morphNormals;for(t=0,n=g.length;t<n;t++){var y={};if(void 0!==g[t].vertexNormals)for(y.vertexNormals=[],r=0,i=g[t].vertexNormals.length;r<i;r++){var v=g[t].vertexNormals[r],b={};b.a=v.a.clone(),b.b=v.b.clone(),b.c=v.c.clone(),y.vertexNormals.push(b)}if(void 0!==g[t].faceNormals)for(y.faceNormals=[],r=0,i=g[t].faceNormals.length;r<i;r++)y.faceNormals.push(g[t].faceNormals[r].clone());this.morphNormals.push(y)}var w=e.skinWeights;for(t=0,n=w.length;t<n;t++)this.skinWeights.push(w[t].clone());var A=e.skinIndices;for(t=0,n=A.length;t<n;t++)this.skinIndices.push(A[t].clone());var E=e.lineDistances;for(t=0,n=E.length;t<n;t++)this.lineDistances.push(E[t]);var x=e.boundingBox;null!==x&&(this.boundingBox=x.clone());var _=e.boundingSphere;return null!==_&&(this.boundingSphere=_.clone()),this.elementsNeedUpdate=e.elementsNeedUpdate,this.verticesNeedUpdate=e.verticesNeedUpdate,this.uvsNeedUpdate=e.uvsNeedUpdate,this.normalsNeedUpdate=e.normalsNeedUpdate,this.colorsNeedUpdate=e.colorsNeedUpdate,this.lineDistancesNeedUpdate=e.lineDistancesNeedUpdate,this.groupsNeedUpdate=e.groupsNeedUpdate,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Object.defineProperty(Qe.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),Object.assign(Qe.prototype,{isBufferAttribute:!0,setArray:function(e){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.count=void 0!==e?e.length/this.itemSize:0,this.array=e},setDynamic:function(e){return this.dynamic=e,this},copy:function(e){return this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.dynamic=e.dynamic,this},copyAt:function(e,t,n){e*=this.itemSize,n*=t.itemSize;for(var r=0,i=this.itemSize;r<i;r++)this.array[e+r]=t.array[n+r];return this},copyArray:function(e){return this.array.set(e),this},copyColorsArray:function(e){for(var t=this.array,n=0,r=0,i=e.length;r<i;r++){var a=e[r];void 0===a&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",r),a=new fe),t[n++]=a.r,t[n++]=a.g,t[n++]=a.b}return this},copyIndicesArray:function(e){for(var t=this.array,n=0,r=0,i=e.length;r<i;r++){var a=e[r];t[n++]=a.a,t[n++]=a.b,t[n++]=a.c}return this},copyVector2sArray:function(e){for(var t=this.array,n=0,r=0,i=e.length;r<i;r++){var a=e[r];void 0===a&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",r),a=new g),t[n++]=a.x,t[n++]=a.y}return this},copyVector3sArray:function(e){for(var t=this.array,n=0,r=0,i=e.length;r<i;r++){var a=e[r];void 0===a&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",r),a=new b),t[n++]=a.x,t[n++]=a.y,t[n++]=a.z}return this},copyVector4sArray:function(e){for(var t=this.array,n=0,r=0,i=e.length;r<i;r++){var a=e[r];void 0===a&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",r),a=new x),t[n++]=a.x,t[n++]=a.y,t[n++]=a.z,t[n++]=a.w}return this},set:function(e,t){return void 0===t&&(t=0),this.array.set(e,t),this},getX:function(e){return this.array[e*this.itemSize]},setX:function(e,t){return this.array[e*this.itemSize]=t,this},getY:function(e){return this.array[e*this.itemSize+1]},setY:function(e,t){return this.array[e*this.itemSize+1]=t,this},getZ:function(e){return this.array[e*this.itemSize+2]},setZ:function(e,t){return this.array[e*this.itemSize+2]=t,this},getW:function(e){return this.array[e*this.itemSize+3]},setW:function(e,t){return this.array[e*this.itemSize+3]=t,this},setXY:function(e,t,n){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this},setXYZ:function(e,t,n,r){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this},setXYZW:function(e,t,n,r,i){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this.array[e+3]=i,this},onUpload:function(e){return this.onUploadCallback=e,this},clone:function(){return new this.constructor(this.array,this.itemSize).copy(this)}}),$e.prototype=Object.create(Qe.prototype),$e.prototype.constructor=$e,et.prototype=Object.create(Qe.prototype),et.prototype.constructor=et,tt.prototype=Object.create(Qe.prototype),tt.prototype.constructor=tt,nt.prototype=Object.create(Qe.prototype),nt.prototype.constructor=nt,rt.prototype=Object.create(Qe.prototype),rt.prototype.constructor=rt,it.prototype=Object.create(Qe.prototype),it.prototype.constructor=it,at.prototype=Object.create(Qe.prototype),at.prototype.constructor=at,ot.prototype=Object.create(Qe.prototype),ot.prototype.constructor=ot,st.prototype=Object.create(Qe.prototype),st.prototype.constructor=st,Object.assign(ct.prototype,{computeGroups:function(e){for(var t,n=[],r=void 0,i=e.faces,a=0;a<i.length;a++){var o=i[a];o.materialIndex!==r&&(r=o.materialIndex,void 0!==t&&(t.count=3*a-t.start,n.push(t)),t={start:3*a,materialIndex:r})}void 0!==t&&(t.count=3*a-t.start,n.push(t)),this.groups=n},fromGeometry:function(e){var t,n=e.faces,r=e.vertices,i=e.faceVertexUvs,a=i[0]&&i[0].length>0,o=i[1]&&i[1].length>0,s=e.morphTargets,c=s.length;if(c>0){t=[];for(var l=0;l<c;l++)t[l]=[];this.morphTargets.position=t}var u,h=e.morphNormals,d=h.length;if(d>0){u=[];for(l=0;l<d;l++)u[l]=[];this.morphTargets.normal=u}var p=e.skinIndices,f=e.skinWeights,m=p.length===r.length,y=f.length===r.length;for(l=0;l<n.length;l++){var v=n[l];this.vertices.push(r[v.a],r[v.b],r[v.c]);var b=v.vertexNormals;if(3===b.length)this.normals.push(b[0],b[1],b[2]);else{var w=v.normal;this.normals.push(w,w,w)}var A,E=v.vertexColors;if(3===E.length)this.colors.push(E[0],E[1],E[2]);else{var x=v.color;this.colors.push(x,x,x)}if(!0===a)void 0!==(A=i[0][l])?this.uvs.push(A[0],A[1],A[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",l),this.uvs.push(new g,new g,new g));if(!0===o)void 0!==(A=i[1][l])?this.uvs2.push(A[0],A[1],A[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",l),this.uvs2.push(new g,new g,new g));for(var _=0;_<c;_++){var S=s[_].vertices;t[_].push(S[v.a],S[v.b],S[v.c])}for(_=0;_<d;_++){var M=h[_].vertexNormals[l];u[_].push(M.a,M.b,M.c)}m&&this.skinIndices.push(p[v.a],p[v.b],p[v.c]),y&&this.skinWeights.push(f[v.a],f[v.b],f[v.c])}return this.computeGroups(e),this.verticesNeedUpdate=e.verticesNeedUpdate,this.normalsNeedUpdate=e.normalsNeedUpdate,this.colorsNeedUpdate=e.colorsNeedUpdate,this.uvsNeedUpdate=e.uvsNeedUpdate,this.groupsNeedUpdate=e.groupsNeedUpdate,this}});var ut,ht,dt,pt,ft,mt,gt,yt=1;function vt(){Object.defineProperty(this,"id",{value:yt+=2}),this.uuid=m.generateUUID(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0}}function bt(e,t,n,r,i,a){Ke.call(this),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:r,heightSegments:i,depthSegments:a},this.fromBufferGeometry(new wt(e,t,n,r,i,a)),this.mergeVertices()}function wt(e,t,n,r,i,a){vt.call(this),this.type="BoxBufferGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:r,heightSegments:i,depthSegments:a};var o=this;e=e||1,t=t||1,n=n||1,r=Math.floor(r)||1,i=Math.floor(i)||1,a=Math.floor(a)||1;var s=[],c=[],l=[],u=[],h=0,d=0;function p(e,t,n,r,i,a,p,f,m,g,y){var v,w,A=a/m,E=p/g,x=a/2,_=p/2,S=f/2,M=m+1,T=g+1,R=0,k=0,C=new b;for(w=0;w<T;w++){var O=w*E-_;for(v=0;v<M;v++){var P=v*A-x;C[e]=P*r,C[t]=O*i,C[n]=S,c.push(C.x,C.y,C.z),C[e]=0,C[t]=0,C[n]=f>0?1:-1,l.push(C.x,C.y,C.z),u.push(v/m),u.push(1-w/g),R+=1}}for(w=0;w<g;w++)for(v=0;v<m;v++){var I=h+v+M*w,N=h+v+M*(w+1),L=h+(v+1)+M*(w+1),D=h+(v+1)+M*w;s.push(I,N,D),s.push(N,L,D),k+=6}o.addGroup(d,k,y),d+=k,h+=R}p("z","y","x",-1,-1,n,t,e,a,i,0),p("z","y","x",1,-1,n,t,-e,a,i,1),p("x","z","y",1,1,e,n,t,r,a,2),p("x","z","y",1,-1,e,n,-t,r,a,3),p("x","y","z",1,-1,e,t,n,r,i,4),p("x","y","z",-1,-1,e,t,-n,r,i,5),this.setIndex(s),this.addAttribute("position",new ot(c,3)),this.addAttribute("normal",new ot(l,3)),this.addAttribute("uv",new ot(u,2))}function At(e,t,n,r){Ke.call(this),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:r},this.fromBufferGeometry(new Et(e,t,n,r)),this.mergeVertices()}function Et(e,t,n,r){vt.call(this),this.type="PlaneBufferGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:r};var i,a,o=(e=e||1)/2,s=(t=t||1)/2,c=Math.floor(n)||1,l=Math.floor(r)||1,u=c+1,h=l+1,d=e/c,p=t/l,f=[],m=[],g=[],y=[];for(a=0;a<h;a++){var v=a*p-s;for(i=0;i<u;i++){var b=i*d-o;m.push(b,-v,0),g.push(0,0,1),y.push(i/c),y.push(1-a/l)}}for(a=0;a<l;a++)for(i=0;i<c;i++){var w=i+u*a,A=i+u*(a+1),E=i+1+u*(a+1),x=i+1+u*a;f.push(w,A,x),f.push(A,E,x)}this.setIndex(f),this.addAttribute("position",new ot(m,3)),this.addAttribute("normal",new ot(g,3)),this.addAttribute("uv",new ot(y,2))}function xt(e){ke.call(this),this.type="MeshBasicMaterial",this.color=new fe(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.lights=!1,this.setValues(e)}function _t(e){ke.call(this),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,void 0!==e&&(void 0!==e.attributes&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(e))}function St(e,t){this.origin=void 0!==e?e:new b,this.direction=void 0!==t?t:new b}function Mt(e,t){this.start=void 0!==e?e:new b,this.end=void 0!==t?t:new b}function Tt(e,t,n){this.a=void 0!==e?e:new b,this.b=void 0!==t?t:new b,this.c=void 0!==n?n:new b}function Rt(e,t){qe.call(this),this.type="Mesh",this.geometry=void 0!==e?e:new vt,this.material=void 0!==t?t:new xt({color:16777215*Math.random()}),this.drawMode=0,this.updateMorphTargets()}function kt(e,t,n,r){var i,a,o,s=new fe(0),c=0;function l(e,n){t.buffers.color.setClear(e.r,e.g,e.b,n,r)}return{getClearColor:function(){return s},setClearColor:function(e,t){s.set(e),l(s,c=void 0!==t?t:1)},getClearAlpha:function(){return c},setClearAlpha:function(e){l(s,c=e)},render:function(t,r,u,h){var d=r.background;null===d?l(s,c):d&&d.isColor&&(l(d,1),h=!0),(e.autoClear||h)&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),d&&d.isCubeTexture?(void 0===o&&((o=new Rt(new wt(1,1,1),new _t({uniforms:ve.cube.uniforms,vertexShader:ve.cube.vertexShader,fragmentShader:ve.cube.fragmentShader,side:1,depthTest:!0,depthWrite:!1,fog:!1}))).geometry.removeAttribute("normal"),o.geometry.removeAttribute("uv"),o.onBeforeRender=function(e,t,n){this.matrixWorld.copyPosition(n.matrixWorld)},n.update(o.geometry)),o.material.uniforms.tCube.value=d,t.push(o,o.geometry,o.material,0,null)):d&&d.isTexture&&(void 0===i&&(i=new Je(-1,1,1,-1,0,1),a=new Rt(new Et(2,2),new xt({depthTest:!1,depthWrite:!1,fog:!1})),n.update(a.geometry)),a.material.map=d,e.renderBufferDirect(i,null,a.geometry,a.material,a,null))}}}function Ct(e,t){return e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.program&&t.program&&e.program!==t.program?e.program.id-t.program.id:e.material.id!==t.material.id?e.material.id-t.material.id:e.z!==t.z?e.z-t.z:e.id-t.id}function Ot(e,t){return e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.z!==t.z?t.z-e.z:e.id-t.id}function Pt(){var e=[],t=0,n=[],r=[];return{opaque:n,transparent:r,init:function(){t=0,n.length=0,r.length=0},push:function(i,a,o,s,c){var l=e[t];void 0===l?(l={id:i.id,object:i,geometry:a,material:o,program:o.program,renderOrder:i.renderOrder,z:s,group:c},e[t]=l):(l.id=i.id,l.object=i,l.geometry=a,l.material=o,l.program=o.program,l.renderOrder=i.renderOrder,l.z=s,l.group=c),(!0===o.transparent?r:n).push(l),t++},sort:function(){n.length>1&&n.sort(Ct),r.length>1&&r.sort(Ot)}}}function It(){var e={};return{get:function(t,n){var r=t.id+","+n.id,i=e[r];return void 0===i&&(i=new Pt,e[r]=i),i},dispose:function(){e={}}}}function Nt(e,t){return Math.abs(t[1])-Math.abs(e[1])}function Lt(e){var t={},n=new Float32Array(8);return{update:function(r,i,a,o){var s=r.morphTargetInfluences,c=s.length,l=t[i.id];if(void 0===l){l=[];for(var u=0;u<c;u++)l[u]=[u,0];t[i.id]=l}var h=a.morphTargets&&i.morphAttributes.position,d=a.morphNormals&&i.morphAttributes.normal;for(u=0;u<c;u++){0!==(p=l[u])[1]&&(h&&i.removeAttribute("morphTarget"+u),d&&i.removeAttribute("morphNormal"+u))}for(u=0;u<c;u++){(p=l[u])[0]=u,p[1]=s[u]}for(l.sort(Nt),u=0;u<8;u++){var p;if(p=l[u]){var f=p[0],m=p[1];if(m){h&&i.addAttribute("morphTarget"+u,h[f]),d&&i.addAttribute("morphNormal"+u,d[f]),n[u]=m;continue}}n[u]=0}o.getUniforms().setValue(e,"morphTargetInfluences",n)}}}function Dt(e,t,n){var r,i,a;this.setMode=function(e){r=e},this.setIndex=function(e){i=e.type,a=e.bytesPerElement},this.render=function(t,o){e.drawElements(r,o,i,t*a),n.calls++,n.vertices+=o,r===e.TRIANGLES?n.faces+=o/3:r===e.POINTS&&(n.points+=o)},this.renderInstances=function(o,s,c){var l=t.get("ANGLE_instanced_arrays");null!==l?(l.drawElementsInstancedANGLE(r,c,i,s*a,o.maxInstancedCount),n.calls++,n.vertices+=c*o.maxInstancedCount,r===e.TRIANGLES?n.faces+=o.maxInstancedCount*c/3:r===e.POINTS&&(n.points+=o.maxInstancedCount*c)):console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.")}}function Ft(e,t,n){var r;this.setMode=function(e){r=e},this.render=function(t,i){e.drawArrays(r,t,i),n.calls++,n.vertices+=i,r===e.TRIANGLES?n.faces+=i/3:r===e.POINTS&&(n.points+=i)},this.renderInstances=function(i,a,o){var s=t.get("ANGLE_instanced_arrays");if(null!==s){var c=i.attributes.position;c.isInterleavedBufferAttribute?(o=c.data.count,s.drawArraysInstancedANGLE(r,0,o,i.maxInstancedCount)):s.drawArraysInstancedANGLE(r,a,o,i.maxInstancedCount),n.calls++,n.vertices+=o*i.maxInstancedCount,r===e.TRIANGLES?n.faces+=i.maxInstancedCount*o/3:r===e.POINTS&&(n.points+=i.maxInstancedCount*o)}else console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.")}}function jt(e,t,n){var r={},i={};function a(e){var o=e.target,s=r[o.id];for(var c in null!==s.index&&t.remove(s.index),s.attributes)t.remove(s.attributes[c]);o.removeEventListener("dispose",a),delete r[o.id];var l=i[o.id];l&&(t.remove(l),delete i[o.id]),(l=i[s.id])&&(t.remove(l),delete i[s.id]),n.geometries--}return{get:function(e,t){var i=r[t.id];return i||(t.addEventListener("dispose",a),t.isBufferGeometry?i=t:t.isGeometry&&(void 0===t._bufferGeometry&&(t._bufferGeometry=(new vt).setFromObject(e)),i=t._bufferGeometry),r[t.id]=i,n.geometries++,i)},update:function(n){var r=n.index,i=n.attributes;for(var a in null!==r&&t.update(r,e.ELEMENT_ARRAY_BUFFER),i)t.update(i[a],e.ARRAY_BUFFER);var o=n.morphAttributes;for(var a in o)for(var s=o[a],c=0,l=s.length;c<l;c++)t.update(s[c],e.ARRAY_BUFFER)},getWireframeAttribute:function(n){var r=i[n.id];if(r)return r;var a,o=[],s=n.index,c=n.attributes;if(null!==s)for(var l=0,u=(a=s.array).length;l<u;l+=3){var h=a[l+0],d=a[l+1],p=a[l+2];o.push(h,d,d,p,p,h)}else for(l=0,u=(a=c.position.array).length/3-1;l<u;l+=3){h=l+0,d=l+1,p=l+2;o.push(h,d,d,p,p,h)}return r=new(lt(o)>65535?at:rt)(o,1),t.update(r,e.ELEMENT_ARRAY_BUFFER),i[n.id]=r,r}}}function Ut(e,t){var n={};return{update:function(r){var i=t.frame,a=r.geometry,o=e.get(r,a);return n[o.id]!==i&&(a.isGeometry&&o.updateFromObject(r),e.update(o),n[o.id]=i),o},dispose:function(){n={}}}}function Bt(e,t,n){var r=e.createShader(t);return e.shaderSource(r,n),e.compileShader(r),!1===e.getShaderParameter(r,e.COMPILE_STATUS)&&console.error("THREE.WebGLShader: Shader couldn't compile."),""!==e.getShaderInfoLog(r)&&console.warn("THREE.WebGLShader: gl.getShaderInfoLog()",t===e.VERTEX_SHADER?"vertex":"fragment",e.getShaderInfoLog(r),function(e){for(var t=e.split("\n"),n=0;n<t.length;n++)t[n]=n+1+": "+t[n];return t.join("\n")}(n)),r}vt.prototype=Object.assign(Object.create(a.prototype),{constructor:vt,isBufferGeometry:!0,getIndex:function(){return this.index},setIndex:function(e){Array.isArray(e)?this.index=new(lt(e)>65535?at:rt)(e,1):this.index=e},addAttribute:function(e,t){return t&&t.isBufferAttribute||t&&t.isInterleavedBufferAttribute?"index"===e?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),void this.setIndex(t)):(this.attributes[e]=t,this):(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),void this.addAttribute(e,new Qe(arguments[1],arguments[2])))},getAttribute:function(e){return this.attributes[e]},removeAttribute:function(e){return delete this.attributes[e],this},addGroup:function(e,t,n){this.groups.push({start:e,count:t,materialIndex:void 0!==n?n:0})},clearGroups:function(){this.groups=[]},setDrawRange:function(e,t){this.drawRange.start=e,this.drawRange.count=t},applyMatrix:function(e){var t=this.attributes.position;void 0!==t&&(e.applyToBufferAttribute(t),t.needsUpdate=!0);var n=this.attributes.normal;void 0!==n&&((new w).getNormalMatrix(e).applyToBufferAttribute(n),n.needsUpdate=!0);return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:function(){var e=new y;return function(t){return e.makeRotationX(t),this.applyMatrix(e),this}}(),rotateY:function(){var e=new y;return function(t){return e.makeRotationY(t),this.applyMatrix(e),this}}(),rotateZ:function(){var e=new y;return function(t){return e.makeRotationZ(t),this.applyMatrix(e),this}}(),translate:function(){var e=new y;return function(t,n,r){return e.makeTranslation(t,n,r),this.applyMatrix(e),this}}(),scale:function(){var e=new y;return function(t,n,r){return e.makeScale(t,n,r),this.applyMatrix(e),this}}(),lookAt:function(){var e=new qe;return function(t){e.lookAt(t),e.updateMatrix(),this.applyMatrix(e.matrix)}}(),center:function(){this.computeBoundingBox();var e=this.boundingBox.getCenter().negate();return this.translate(e.x,e.y,e.z),e},setFromObject:function(e){var t=e.geometry;if(e.isPoints||e.isLine){var n=new ot(3*t.vertices.length,3),r=new ot(3*t.colors.length,3);if(this.addAttribute("position",n.copyVector3sArray(t.vertices)),this.addAttribute("color",r.copyColorsArray(t.colors)),t.lineDistances&&t.lineDistances.length===t.vertices.length){var i=new ot(t.lineDistances.length,1);this.addAttribute("lineDistance",i.copyArray(t.lineDistances))}null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone())}else e.isMesh&&t&&t.isGeometry&&this.fromGeometry(t);return this},setFromPoints:function(e){for(var t=[],n=0,r=e.length;n<r;n++){var i=e[n];t.push(i.x,i.y,i.z||0)}return this.addAttribute("position",new ot(t,3)),this},updateFromObject:function(e){var t,n=e.geometry;if(e.isMesh){var r=n.__directGeometry;if(!0===n.elementsNeedUpdate&&(r=void 0,n.elementsNeedUpdate=!1),void 0===r)return this.fromGeometry(n);r.verticesNeedUpdate=n.verticesNeedUpdate,r.normalsNeedUpdate=n.normalsNeedUpdate,r.colorsNeedUpdate=n.colorsNeedUpdate,r.uvsNeedUpdate=n.uvsNeedUpdate,r.groupsNeedUpdate=n.groupsNeedUpdate,n.verticesNeedUpdate=!1,n.normalsNeedUpdate=!1,n.colorsNeedUpdate=!1,n.uvsNeedUpdate=!1,n.groupsNeedUpdate=!1,n=r}return!0===n.verticesNeedUpdate&&(void 0!==(t=this.attributes.position)&&(t.copyVector3sArray(n.vertices),t.needsUpdate=!0),n.verticesNeedUpdate=!1),!0===n.normalsNeedUpdate&&(void 0!==(t=this.attributes.normal)&&(t.copyVector3sArray(n.normals),t.needsUpdate=!0),n.normalsNeedUpdate=!1),!0===n.colorsNeedUpdate&&(void 0!==(t=this.attributes.color)&&(t.copyColorsArray(n.colors),t.needsUpdate=!0),n.colorsNeedUpdate=!1),n.uvsNeedUpdate&&(void 0!==(t=this.attributes.uv)&&(t.copyVector2sArray(n.uvs),t.needsUpdate=!0),n.uvsNeedUpdate=!1),n.lineDistancesNeedUpdate&&(void 0!==(t=this.attributes.lineDistance)&&(t.copyArray(n.lineDistances),t.needsUpdate=!0),n.lineDistancesNeedUpdate=!1),n.groupsNeedUpdate&&(n.computeGroups(e.geometry),this.groups=n.groups,n.groupsNeedUpdate=!1),this},fromGeometry:function(e){return e.__directGeometry=(new ct).fromGeometry(e),this.fromDirectGeometry(e.__directGeometry)},fromDirectGeometry:function(e){var t=new Float32Array(3*e.vertices.length);if(this.addAttribute("position",new Qe(t,3).copyVector3sArray(e.vertices)),e.normals.length>0){var n=new Float32Array(3*e.normals.length);this.addAttribute("normal",new Qe(n,3).copyVector3sArray(e.normals))}if(e.colors.length>0){var r=new Float32Array(3*e.colors.length);this.addAttribute("color",new Qe(r,3).copyColorsArray(e.colors))}if(e.uvs.length>0){var i=new Float32Array(2*e.uvs.length);this.addAttribute("uv",new Qe(i,2).copyVector2sArray(e.uvs))}if(e.uvs2.length>0){var a=new Float32Array(2*e.uvs2.length);this.addAttribute("uv2",new Qe(a,2).copyVector2sArray(e.uvs2))}if(e.indices.length>0){var o=new(lt(e.indices)>65535?Uint32Array:Uint16Array)(3*e.indices.length);this.setIndex(new Qe(o,1).copyIndicesArray(e.indices))}for(var s in this.groups=e.groups,e.morphTargets){for(var c=[],l=e.morphTargets[s],u=0,h=l.length;u<h;u++){var d=l[u],p=new ot(3*d.length,3);c.push(p.copyVector3sArray(d))}this.morphAttributes[s]=c}if(e.skinIndices.length>0){var f=new ot(4*e.skinIndices.length,4);this.addAttribute("skinIndex",f.copyVector4sArray(e.skinIndices))}if(e.skinWeights.length>0){var m=new ot(4*e.skinWeights.length,4);this.addAttribute("skinWeight",m.copyVector4sArray(e.skinWeights))}return null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),this},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new Pe);var e=this.attributes.position;void 0!==e?this.boundingBox.setFromBufferAttribute(e):this.boundingBox.makeEmpty(),(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)},computeBoundingSphere:function(){var e=new Pe,t=new b;return function(){null===this.boundingSphere&&(this.boundingSphere=new Ie);var n=this.attributes.position;if(n){var r=this.boundingSphere.center;e.setFromBufferAttribute(n),e.getCenter(r);for(var i=0,a=0,o=n.count;a<o;a++)t.x=n.getX(a),t.y=n.getY(a),t.z=n.getZ(a),i=Math.max(i,r.distanceToSquared(t));this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}}(),computeFaceNormals:function(){},computeVertexNormals:function(){var e=this.index,t=this.attributes,n=this.groups;if(t.position){var r=t.position.array;if(void 0===t.normal)this.addAttribute("normal",new Qe(new Float32Array(r.length),3));else for(var i=t.normal.array,a=0,o=i.length;a<o;a++)i[a]=0;var s,c,l,u=t.normal.array,h=new b,d=new b,p=new b,f=new b,m=new b;if(e){var g=e.array;0===n.length&&this.addGroup(0,g.length);for(var y=0,v=n.length;y<v;++y){var w=n[y],A=w.start;for(a=A,o=A+w.count;a<o;a+=3)s=3*g[a+0],c=3*g[a+1],l=3*g[a+2],h.fromArray(r,s),d.fromArray(r,c),p.fromArray(r,l),f.subVectors(p,d),m.subVectors(h,d),f.cross(m),u[s]+=f.x,u[s+1]+=f.y,u[s+2]+=f.z,u[c]+=f.x,u[c+1]+=f.y,u[c+2]+=f.z,u[l]+=f.x,u[l+1]+=f.y,u[l+2]+=f.z}}else for(a=0,o=r.length;a<o;a+=9)h.fromArray(r,a),d.fromArray(r,a+3),p.fromArray(r,a+6),f.subVectors(p,d),m.subVectors(h,d),f.cross(m),u[a]=f.x,u[a+1]=f.y,u[a+2]=f.z,u[a+3]=f.x,u[a+4]=f.y,u[a+5]=f.z,u[a+6]=f.x,u[a+7]=f.y,u[a+8]=f.z;this.normalizeNormals(),t.normal.needsUpdate=!0}},merge:function(e,t){if(e&&e.isBufferGeometry){void 0===t&&(t=0);var n=this.attributes;for(var r in n)if(void 0!==e.attributes[r])for(var i=n[r].array,a=e.attributes[r],o=a.array,s=0,c=a.itemSize*t;s<o.length;s++,c++)i[c]=o[s];return this}console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",e)},normalizeNormals:function(){var e=new b;return function(){for(var t=this.attributes.normal,n=0,r=t.count;n<r;n++)e.x=t.getX(n),e.y=t.getY(n),e.z=t.getZ(n),e.normalize(),t.setXYZ(n,e.x,e.y,e.z)}}(),toNonIndexed:function(){if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),this;var e=new vt,t=this.index.array,n=this.attributes;for(var r in n){for(var i=n[r],a=i.array,o=i.itemSize,s=new a.constructor(t.length*o),c=0,l=0,u=0,h=t.length;u<h;u++){c=t[u]*o;for(var d=0;d<o;d++)s[l++]=a[c++]}e.addAttribute(r,new Qe(s,o))}return e},toJSON:function(){var e={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,""!==this.name&&(e.name=this.name),void 0!==this.parameters){var t=this.parameters;for(var n in t)void 0!==t[n]&&(e[n]=t[n]);return e}e.data={attributes:{}};var r=this.index;if(null!==r){var i=Array.prototype.slice.call(r.array);e.data.index={type:r.array.constructor.name,array:i}}var a=this.attributes;for(var n in a){var o=a[n];i=Array.prototype.slice.call(o.array);e.data.attributes[n]={itemSize:o.itemSize,type:o.array.constructor.name,array:i,normalized:o.normalized}}var s=this.groups;s.length>0&&(e.data.groups=JSON.parse(JSON.stringify(s)));var c=this.boundingSphere;return null!==c&&(e.data.boundingSphere={center:c.center.toArray(),radius:c.radius}),e},clone:function(){return(new vt).copy(this)},copy:function(e){var t,n,r;this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.name=e.name;var i=e.index;null!==i&&this.setIndex(i.clone());var a=e.attributes;for(t in a){var o=a[t];this.addAttribute(t,o.clone())}var s=e.morphAttributes;for(t in s){var c=[],l=s[t];for(n=0,r=l.length;n<r;n++)c.push(l[n].clone());this.morphAttributes[t]=c}var u=e.groups;for(n=0,r=u.length;n<r;n++){var h=u[n];this.addGroup(h.start,h.count,h.materialIndex)}var d=e.boundingBox;null!==d&&(this.boundingBox=d.clone());var p=e.boundingSphere;return null!==p&&(this.boundingSphere=p.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),bt.prototype=Object.create(Ke.prototype),bt.prototype.constructor=bt,wt.prototype=Object.create(vt.prototype),wt.prototype.constructor=wt,At.prototype=Object.create(Ke.prototype),At.prototype.constructor=At,Et.prototype=Object.create(vt.prototype),Et.prototype.constructor=Et,xt.prototype=Object.create(ke.prototype),xt.prototype.constructor=xt,xt.prototype.isMeshBasicMaterial=!0,xt.prototype.copy=function(e){return ke.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this},_t.prototype=Object.create(ke.prototype),_t.prototype.constructor=_t,_t.prototype.isShaderMaterial=!0,_t.prototype.copy=function(e){return ke.prototype.copy.call(this,e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=ge.clone(e.uniforms),this.defines=e.defines,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.lights=e.lights,this.clipping=e.clipping,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this.extensions=e.extensions,this},_t.prototype.toJSON=function(e){var t=ke.prototype.toJSON.call(this,e);return t.uniforms=this.uniforms,t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t},Object.assign(St.prototype,{set:function(e,t){return this.origin.copy(e),this.direction.copy(t),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this},at:function(e,t){return(t||new b).copy(this.direction).multiplyScalar(e).add(this.origin)},lookAt:function(e){return this.direction.copy(e).sub(this.origin).normalize(),this},recast:function(){var e=new b;return function(t){return this.origin.copy(this.at(t,e)),this}}(),closestPointToPoint:function(e,t){var n=t||new b;n.subVectors(e,this.origin);var r=n.dot(this.direction);return r<0?n.copy(this.origin):n.copy(this.direction).multiplyScalar(r).add(this.origin)},distanceToPoint:function(e){return Math.sqrt(this.distanceSqToPoint(e))},distanceSqToPoint:function(){var e=new b;return function(t){var n=e.subVectors(t,this.origin).dot(this.direction);return n<0?this.origin.distanceToSquared(t):(e.copy(this.direction).multiplyScalar(n).add(this.origin),e.distanceToSquared(t))}}(),distanceSqToSegment:(ht=new b,dt=new b,pt=new b,function(e,t,n,r){ht.copy(e).add(t).multiplyScalar(.5),dt.copy(t).sub(e).normalize(),pt.copy(this.origin).sub(ht);var i,a,o,s,c=.5*e.distanceTo(t),l=-this.direction.dot(dt),u=pt.dot(this.direction),h=-pt.dot(dt),d=pt.lengthSq(),p=Math.abs(1-l*l);if(p>0)if(a=l*u-h,s=c*p,(i=l*h-u)>=0)if(a>=-s)if(a<=s){var f=1/p;o=(i*=f)*(i+l*(a*=f)+2*u)+a*(l*i+a+2*h)+d}else a=c,o=-(i=Math.max(0,-(l*a+u)))*i+a*(a+2*h)+d;else a=-c,o=-(i=Math.max(0,-(l*a+u)))*i+a*(a+2*h)+d;else a<=-s?o=-(i=Math.max(0,-(-l*c+u)))*i+(a=i>0?-c:Math.min(Math.max(-c,-h),c))*(a+2*h)+d:a<=s?(i=0,o=(a=Math.min(Math.max(-c,-h),c))*(a+2*h)+d):o=-(i=Math.max(0,-(l*c+u)))*i+(a=i>0?c:Math.min(Math.max(-c,-h),c))*(a+2*h)+d;else a=l>0?-c:c,o=-(i=Math.max(0,-(l*a+u)))*i+a*(a+2*h)+d;return n&&n.copy(this.direction).multiplyScalar(i).add(this.origin),r&&r.copy(dt).multiplyScalar(a).add(ht),o}),intersectSphere:function(){var e=new b;return function(t,n){e.subVectors(t.center,this.origin);var r=e.dot(this.direction),i=e.dot(e)-r*r,a=t.radius*t.radius;if(i>a)return null;var o=Math.sqrt(a-i),s=r-o,c=r+o;return s<0&&c<0?null:s<0?this.at(c,n):this.at(s,n)}}(),intersectsSphere:function(e){return this.distanceToPoint(e.center)<=e.radius},distanceToPlane:function(e){var t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?0:null;var n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null},intersectPlane:function(e,t){var n=this.distanceToPlane(e);return null===n?null:this.at(n,t)},intersectsPlane:function(e){var t=e.distanceToPoint(this.origin);return 0===t||e.normal.dot(this.direction)*t<0},intersectBox:function(e,t){var n,r,i,a,o,s,c=1/this.direction.x,l=1/this.direction.y,u=1/this.direction.z,h=this.origin;return c>=0?(n=(e.min.x-h.x)*c,r=(e.max.x-h.x)*c):(n=(e.max.x-h.x)*c,r=(e.min.x-h.x)*c),l>=0?(i=(e.min.y-h.y)*l,a=(e.max.y-h.y)*l):(i=(e.max.y-h.y)*l,a=(e.min.y-h.y)*l),n>a||i>r?null:((i>n||n!=n)&&(n=i),(a<r||r!=r)&&(r=a),u>=0?(o=(e.min.z-h.z)*u,s=(e.max.z-h.z)*u):(o=(e.max.z-h.z)*u,s=(e.min.z-h.z)*u),n>s||o>r?null:((o>n||n!=n)&&(n=o),(s<r||r!=r)&&(r=s),r<0?null:this.at(n>=0?n:r,t)))},intersectsBox:(ut=new b,function(e){return null!==this.intersectBox(e,ut)}),intersectTriangle:function(){var e=new b,t=new b,n=new b,r=new b;return function(i,a,o,s,c){t.subVectors(a,i),n.subVectors(o,i),r.crossVectors(t,n);var l,u=this.direction.dot(r);if(u>0){if(s)return null;l=1}else{if(!(u<0))return null;l=-1,u=-u}e.subVectors(this.origin,i);var h=l*this.direction.dot(n.crossVectors(e,n));if(h<0)return null;var d=l*this.direction.dot(t.cross(e));if(d<0)return null;if(h+d>u)return null;var p=-l*e.dot(r);return p<0?null:this.at(p/u,c)}}(),applyMatrix4:function(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this},equals:function(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}}),Object.assign(Mt.prototype,{set:function(e,t){return this.start.copy(e),this.end.copy(t),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.start.copy(e.start),this.end.copy(e.end),this},getCenter:function(e){return(e||new b).addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(e){return(e||new b).subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(e,t){var n=t||new b;return this.delta(n).multiplyScalar(e).add(this.start)},closestPointToPointParameter:(ft=new b,mt=new b,function(e,t){ft.subVectors(e,this.start),mt.subVectors(this.end,this.start);var n=mt.dot(mt),r=mt.dot(ft)/n;return t&&(r=m.clamp(r,0,1)),r}),closestPointToPoint:function(e,t,n){var r=this.closestPointToPointParameter(e,t),i=n||new b;return this.delta(i).multiplyScalar(r).add(this.start)},applyMatrix4:function(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this},equals:function(e){return e.start.equals(this.start)&&e.end.equals(this.end)}}),Object.assign(Tt,{normal:(gt=new b,function(e,t,n,r){var i=r||new b;i.subVectors(n,t),gt.subVectors(e,t),i.cross(gt);var a=i.lengthSq();return a>0?i.multiplyScalar(1/Math.sqrt(a)):i.set(0,0,0)}),barycoordFromPoint:function(){var e=new b,t=new b,n=new b;return function(r,i,a,o,s){e.subVectors(o,i),t.subVectors(a,i),n.subVectors(r,i);var c=e.dot(e),l=e.dot(t),u=e.dot(n),h=t.dot(t),d=t.dot(n),p=c*h-l*l,f=s||new b;if(0===p)return f.set(-2,-1,-1);var m=1/p,g=(h*u-l*d)*m,y=(c*d-l*u)*m;return f.set(1-g-y,y,g)}}(),containsPoint:function(){var e=new b;return function(t,n,r,i){var a=Tt.barycoordFromPoint(t,n,r,i,e);return a.x>=0&&a.y>=0&&a.x+a.y<=1}}()}),Object.assign(Tt.prototype,{set:function(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this},setFromPointsAndIndices:function(e,t,n,r){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[r]),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this},area:function(){var e=new b,t=new b;return function(){return e.subVectors(this.c,this.b),t.subVectors(this.a,this.b),.5*e.cross(t).length()}}(),midpoint:function(e){return(e||new b).addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},normal:function(e){return Tt.normal(this.a,this.b,this.c,e)},plane:function(e){return(e||new Ne).setFromCoplanarPoints(this.a,this.b,this.c)},barycoordFromPoint:function(e,t){return Tt.barycoordFromPoint(e,this.a,this.b,this.c,t)},containsPoint:function(e){return Tt.containsPoint(e,this.a,this.b,this.c)},intersectsBox:function(e){return e.intersectsTriangle(this)},closestPointToPoint:function(){var e=new Ne,t=[new Mt,new Mt,new Mt],n=new b,r=new b;return function(i,a){var o=a||new b,s=1/0;if(e.setFromCoplanarPoints(this.a,this.b,this.c),e.projectPoint(i,n),!0===this.containsPoint(n))o.copy(n);else{t[0].set(this.a,this.b),t[1].set(this.b,this.c),t[2].set(this.c,this.a);for(var c=0;c<t.length;c++){t[c].closestPointToPoint(n,!0,r);var l=n.distanceToSquared(r);l<s&&(s=l,o.copy(r))}}return o}}(),equals:function(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}),Rt.prototype=Object.assign(Object.create(qe.prototype),{constructor:Rt,isMesh:!0,setDrawMode:function(e){this.drawMode=e},copy:function(e){return qe.prototype.copy.call(this,e),this.drawMode=e.drawMode,void 0!==e.morphTargetInfluences&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),void 0!==e.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this},updateMorphTargets:function(){var e,t,n,r=this.geometry;if(r.isBufferGeometry){var i=r.morphAttributes,a=Object.keys(i);if(a.length>0){var o=i[a[0]];if(void 0!==o)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},e=0,t=o.length;e<t;e++)n=o[e].name||String(e),this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=e}}else{var s=r.morphTargets;if(void 0!==s&&s.length>0)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},e=0,t=s.length;e<t;e++)n=s[e].name||String(e),this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=e}},raycast:function(){var e=new y,t=new St,n=new Ie,r=new b,i=new b,a=new b,o=new b,s=new b,c=new b,l=new g,u=new g,h=new g,d=new b,p=new b,f=new b;function m(e,t,n,r,i,a,o){return Tt.barycoordFromPoint(e,t,n,r,d),i.multiplyScalar(d.x),a.multiplyScalar(d.y),o.multiplyScalar(d.z),i.add(a).add(o),i.clone()}function v(e,t,n,r,i,a,o,s){if(null===(1===t.side?r.intersectTriangle(o,a,i,!0,s):r.intersectTriangle(i,a,o,2!==t.side,s)))return null;f.copy(s),f.applyMatrix4(e.matrixWorld);var c=n.ray.origin.distanceTo(f);return c<n.near||c>n.far?null:{distance:c,point:f.clone(),object:e}}function w(e,t,n,o,s,c,d,f){r.fromBufferAttribute(o,c),i.fromBufferAttribute(o,d),a.fromBufferAttribute(o,f);var g=v(e,e.material,t,n,r,i,a,p);return g&&(s&&(l.fromBufferAttribute(s,c),u.fromBufferAttribute(s,d),h.fromBufferAttribute(s,f),g.uv=m(p,r,i,a,l,u,h)),g.face=new Ze(c,d,f,Tt.normal(r,i,a)),g.faceIndex=c),g}return function(d,f){var g,y=this.geometry,b=this.material,A=this.matrixWorld;if(void 0!==b&&(null===y.boundingSphere&&y.computeBoundingSphere(),n.copy(y.boundingSphere),n.applyMatrix4(A),!1!==d.ray.intersectsSphere(n)&&(e.getInverse(A),t.copy(d.ray).applyMatrix4(e),null===y.boundingBox||!1!==t.intersectsBox(y.boundingBox))))if(y.isBufferGeometry){var E,x,_,S,M,T=y.index,R=y.attributes.position,k=y.attributes.uv;if(null!==T)for(S=0,M=T.count;S<M;S+=3)E=T.getX(S),x=T.getX(S+1),_=T.getX(S+2),(g=w(this,d,t,R,k,E,x,_))&&(g.faceIndex=Math.floor(S/3),f.push(g));else if(void 0!==R)for(S=0,M=R.count;S<M;S+=3)(g=w(this,d,t,R,k,E=S,x=S+1,_=S+2))&&(g.index=E,f.push(g))}else if(y.isGeometry){var C,O,P,I,N=Array.isArray(b),L=y.vertices,D=y.faces,F=y.faceVertexUvs[0];F.length>0&&(I=F);for(var j=0,U=D.length;j<U;j++){var B=D[j],V=N?b[B.materialIndex]:b;if(void 0!==V){if(C=L[B.a],O=L[B.b],P=L[B.c],!0===V.morphTargets){var z=y.morphTargets,H=this.morphTargetInfluences;r.set(0,0,0),i.set(0,0,0),a.set(0,0,0);for(var G=0,q=z.length;G<q;G++){var W=H[G];if(0!==W){var J=z[G].vertices;r.addScaledVector(o.subVectors(J[B.a],C),W),i.addScaledVector(s.subVectors(J[B.b],O),W),a.addScaledVector(c.subVectors(J[B.c],P),W)}}r.add(C),i.add(O),a.add(P),C=r,O=i,P=a}if(g=v(this,V,d,t,C,O,P,p)){if(I&&I[j]){var Z=I[j];l.copy(Z[0]),u.copy(Z[1]),h.copy(Z[2]),g.uv=m(p,C,O,P,l,u,h)}g.face=B,g.faceIndex=j,f.push(g)}}}}}}(),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}});var Vt=0;function zt(e){switch(e){case 3e3:return["Linear","( value )"];case 3001:return["sRGB","( value )"];case 3002:return["RGBE","( value )"];case 3004:return["RGBM","( value, 7.0 )"];case 3005:return["RGBM","( value, 16.0 )"];case 3006:return["RGBD","( value, 256.0 )"];case 3007:return["Gamma","( value, float( GAMMA_FACTOR ) )"];default:throw new Error("unsupported encoding: "+e)}}function Ht(e,t){var n=zt(t);return"vec4 "+e+"( vec4 value ) { return "+n[0]+"ToLinear"+n[1]+"; }"}function Gt(e,t){var n;switch(t){case 1:n="Linear";break;case 2:n="Reinhard";break;case 3:n="Uncharted2";break;case 4:n="OptimizedCineon";break;default:throw new Error("unsupported toneMapping: "+t)}return"vec3 "+e+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}function qt(e){return""!==e}function Wt(e,t){return e.replace(/NUM_DIR_LIGHTS/g,t.numDirLights).replace(/NUM_SPOT_LIGHTS/g,t.numSpotLights).replace(/NUM_RECT_AREA_LIGHTS/g,t.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,t.numPointLights).replace(/NUM_HEMI_LIGHTS/g,t.numHemiLights)}function Jt(e,t){return e.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}function Zt(e){return e.replace(/^[ \t]*#include +<([\w\d.]+)>/gm,(function(e,t){var n=ye[t];if(void 0===n)throw new Error("Can not resolve #include <"+t+">");return Zt(n)}))}function Xt(e){return e.replace(/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,(function(e,t,n,r){for(var i="",a=parseInt(t);a<parseInt(n);a++)i+=r.replace(/\[ i \]/g,"[ "+a+" ]");return i}))}function Yt(e,t,n,r,i,a){var o=e.context,s=r.defines,c=i.vertexShader,l=i.fragmentShader,u="SHADOWMAP_TYPE_BASIC";1===a.shadowMapType?u="SHADOWMAP_TYPE_PCF":2===a.shadowMapType&&(u="SHADOWMAP_TYPE_PCF_SOFT");var h="ENVMAP_TYPE_CUBE",d="ENVMAP_MODE_REFLECTION",p="ENVMAP_BLENDING_MULTIPLY";if(a.envMap){switch(r.envMap.mapping){case 301:case 302:h="ENVMAP_TYPE_CUBE";break;case 306:case 307:h="ENVMAP_TYPE_CUBE_UV";break;case 303:case 304:h="ENVMAP_TYPE_EQUIREC";break;case 305:h="ENVMAP_TYPE_SPHERE"}switch(r.envMap.mapping){case 302:case 304:d="ENVMAP_MODE_REFRACTION"}switch(r.combine){case 0:p="ENVMAP_BLENDING_MULTIPLY";break;case 1:p="ENVMAP_BLENDING_MIX";break;case 2:p="ENVMAP_BLENDING_ADD"}}var f,m,g,y,v,b=e.gammaFactor>0?e.gammaFactor:1,w=function(e,t,n){return[(e=e||{}).derivatives||t.envMapCubeUV||t.bumpMap||t.normalMap||t.flatShading?"#extension GL_OES_standard_derivatives : enable":"",(e.fragDepth||t.logarithmicDepthBuffer)&&n.get("EXT_frag_depth")?"#extension GL_EXT_frag_depth : enable":"",e.drawBuffers&&n.get("WEBGL_draw_buffers")?"#extension GL_EXT_draw_buffers : require":"",(e.shaderTextureLOD||t.envMap)&&n.get("EXT_shader_texture_lod")?"#extension GL_EXT_shader_texture_lod : enable":""].filter(qt).join("\n")}(r.extensions,a,t),A=function(e){var t=[];for(var n in e){var r=e[n];!1!==r&&t.push("#define "+n+" "+r)}return t.join("\n")}(s),E=o.createProgram();r.isRawShaderMaterial?((f=[A].filter(qt).join("\n")).length>0&&(f+="\n"),(m=[w,A].filter(qt).join("\n")).length>0&&(m+="\n")):(f=["precision "+a.precision+" float;","precision "+a.precision+" int;","#define SHADER_NAME "+i.name,A,a.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+b,"#define MAX_BONES "+a.maxBones,a.useFog&&a.fog?"#define USE_FOG":"",a.useFog&&a.fogExp?"#define FOG_EXP2":"",a.map?"#define USE_MAP":"",a.envMap?"#define USE_ENVMAP":"",a.envMap?"#define "+d:"",a.lightMap?"#define USE_LIGHTMAP":"",a.aoMap?"#define USE_AOMAP":"",a.emissiveMap?"#define USE_EMISSIVEMAP":"",a.bumpMap?"#define USE_BUMPMAP":"",a.normalMap?"#define USE_NORMALMAP":"",a.displacementMap&&a.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",a.specularMap?"#define USE_SPECULARMAP":"",a.roughnessMap?"#define USE_ROUGHNESSMAP":"",a.metalnessMap?"#define USE_METALNESSMAP":"",a.alphaMap?"#define USE_ALPHAMAP":"",a.vertexColors?"#define USE_COLOR":"",a.flatShading?"#define FLAT_SHADED":"",a.skinning?"#define USE_SKINNING":"",a.useVertexTexture?"#define BONE_TEXTURE":"",a.morphTargets?"#define USE_MORPHTARGETS":"",a.morphNormals&&!1===a.flatShading?"#define USE_MORPHNORMALS":"",a.doubleSided?"#define DOUBLE_SIDED":"",a.flipSided?"#define FLIP_SIDED":"",a.shadowMapEnabled?"#define USE_SHADOWMAP":"",a.shadowMapEnabled?"#define "+u:"",a.sizeAttenuation?"#define USE_SIZEATTENUATION":"",a.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",a.logarithmicDepthBuffer&&t.get("EXT_frag_depth")?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_COLOR","\tattribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(qt).join("\n"),m=[w,"precision "+a.precision+" float;","precision "+a.precision+" int;","#define SHADER_NAME "+i.name,A,a.alphaTest?"#define ALPHATEST "+a.alphaTest:"","#define GAMMA_FACTOR "+b,a.useFog&&a.fog?"#define USE_FOG":"",a.useFog&&a.fogExp?"#define FOG_EXP2":"",a.map?"#define USE_MAP":"",a.envMap?"#define USE_ENVMAP":"",a.envMap?"#define "+h:"",a.envMap?"#define "+d:"",a.envMap?"#define "+p:"",a.lightMap?"#define USE_LIGHTMAP":"",a.aoMap?"#define USE_AOMAP":"",a.emissiveMap?"#define USE_EMISSIVEMAP":"",a.bumpMap?"#define USE_BUMPMAP":"",a.normalMap?"#define USE_NORMALMAP":"",a.specularMap?"#define USE_SPECULARMAP":"",a.roughnessMap?"#define USE_ROUGHNESSMAP":"",a.metalnessMap?"#define USE_METALNESSMAP":"",a.alphaMap?"#define USE_ALPHAMAP":"",a.vertexColors?"#define USE_COLOR":"",a.gradientMap?"#define USE_GRADIENTMAP":"",a.flatShading?"#define FLAT_SHADED":"",a.doubleSided?"#define DOUBLE_SIDED":"",a.flipSided?"#define FLIP_SIDED":"",a.shadowMapEnabled?"#define USE_SHADOWMAP":"",a.shadowMapEnabled?"#define "+u:"",a.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",a.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",a.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",a.logarithmicDepthBuffer&&t.get("EXT_frag_depth")?"#define USE_LOGDEPTHBUF_EXT":"",a.envMap&&t.get("EXT_shader_texture_lod")?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;",0!==a.toneMapping?"#define TONE_MAPPING":"",0!==a.toneMapping?ye.tonemapping_pars_fragment:"",0!==a.toneMapping?Gt("toneMapping",a.toneMapping):"",a.dithering?"#define DITHERING":"",a.outputEncoding||a.mapEncoding||a.envMapEncoding||a.emissiveMapEncoding?ye.encodings_pars_fragment:"",a.mapEncoding?Ht("mapTexelToLinear",a.mapEncoding):"",a.envMapEncoding?Ht("envMapTexelToLinear",a.envMapEncoding):"",a.emissiveMapEncoding?Ht("emissiveMapTexelToLinear",a.emissiveMapEncoding):"",a.outputEncoding?(g="linearToOutputTexel",y=a.outputEncoding,v=zt(y),"vec4 "+g+"( vec4 value ) { return LinearTo"+v[0]+v[1]+"; }"):"",a.depthPacking?"#define DEPTH_PACKING "+r.depthPacking:"","\n"].filter(qt).join("\n")),c=Jt(c=Wt(c=Zt(c),a),a),l=Jt(l=Wt(l=Zt(l),a),a);var x=f+(c=Xt(c)),_=m+(l=Xt(l)),S=Bt(o,o.VERTEX_SHADER,x),M=Bt(o,o.FRAGMENT_SHADER,_);o.attachShader(E,S),o.attachShader(E,M),void 0!==r.index0AttributeName?o.bindAttribLocation(E,0,r.index0AttributeName):!0===a.morphTargets&&o.bindAttribLocation(E,0,"position"),o.linkProgram(E);var T,R,k=o.getProgramInfoLog(E).trim(),C=o.getShaderInfoLog(S).trim(),O=o.getShaderInfoLog(M).trim(),P=!0,I=!0;return!1===o.getProgramParameter(E,o.LINK_STATUS)?(P=!1,console.error("THREE.WebGLProgram: shader error: ",o.getError(),"gl.VALIDATE_STATUS",o.getProgramParameter(E,o.VALIDATE_STATUS),"gl.getProgramInfoLog",k,C,O)):""!==k?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",k):""!==C&&""!==O||(I=!1),I&&(this.diagnostics={runnable:P,material:r,programLog:k,vertexShader:{log:C,prefix:f},fragmentShader:{log:O,prefix:m}}),o.deleteShader(S),o.deleteShader(M),this.getUniforms=function(){return void 0===T&&(T=new de(o,E,e)),T},this.getAttributes=function(){return void 0===R&&(R=function(e,t){for(var n={},r=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES),i=0;i<r;i++){var a=e.getActiveAttrib(t,i).name;n[a]=e.getAttribLocation(t,a)}return n}(o,E)),R},this.destroy=function(){o.deleteProgram(E),this.program=void 0},Object.defineProperties(this,{uniforms:{get:function(){return console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms()."),this.getUniforms()}},attributes:{get:function(){return console.warn("THREE.WebGLProgram: .attributes is now .getAttributes()."),this.getAttributes()}}}),this.id=Vt++,this.code=n,this.usedTimes=1,this.program=E,this.vertexShader=S,this.fragmentShader=M,this}function Kt(e,t,n){var r=[],i={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"phong",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow"},a=["precision","supportsVertexTextures","map","mapEncoding","envMap","envMapMode","envMapEncoding","lightMap","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","displacementMap","specularMap","roughnessMap","metalnessMap","gradientMap","alphaMap","combine","vertexColors","fog","useFog","fogExp","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","maxMorphTargets","maxMorphNormals","premultipliedAlpha","numDirLights","numPointLights","numSpotLights","numHemiLights","numRectAreaLights","shadowMapEnabled","shadowMapType","toneMapping","physicallyCorrectLights","alphaTest","doubleSided","flipSided","numClippingPlanes","numClipIntersection","depthPacking","dithering"];function o(e,t){var n;return e?e.isTexture?n=e.encoding:e.isWebGLRenderTarget&&(console.warn("THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."),n=e.texture.encoding):n=3e3,3e3===n&&t&&(n=3007),n}this.getParameters=function(t,r,a,s,c,l,u){var h=i[t.type],d=u.isSkinnedMesh?function(e){var t=e.skeleton.bones;if(n.floatVertexTextures)return 1024;var r=n.maxVertexUniforms,i=Math.floor((r-20)/4),a=Math.min(i,t.length);return a<t.length?(console.warn("THREE.WebGLRenderer: Skeleton has "+t.length+" bones. This GPU supports "+a+"."),0):a}(u):0,p=n.precision;null!==t.precision&&(p=n.getMaxPrecision(t.precision))!==t.precision&&console.warn("THREE.WebGLProgram.getParameters:",t.precision,"not supported, using",p,"instead.");var f=e.getRenderTarget();return{shaderID:h,precision:p,supportsVertexTextures:n.vertexTextures,outputEncoding:o(f?f.texture:null,e.gammaOutput),map:!!t.map,mapEncoding:o(t.map,e.gammaInput),envMap:!!t.envMap,envMapMode:t.envMap&&t.envMap.mapping,envMapEncoding:o(t.envMap,e.gammaInput),envMapCubeUV:!!t.envMap&&(306===t.envMap.mapping||307===t.envMap.mapping),lightMap:!!t.lightMap,aoMap:!!t.aoMap,emissiveMap:!!t.emissiveMap,emissiveMapEncoding:o(t.emissiveMap,e.gammaInput),bumpMap:!!t.bumpMap,normalMap:!!t.normalMap,displacementMap:!!t.displacementMap,roughnessMap:!!t.roughnessMap,metalnessMap:!!t.metalnessMap,specularMap:!!t.specularMap,alphaMap:!!t.alphaMap,gradientMap:!!t.gradientMap,combine:t.combine,vertexColors:t.vertexColors,fog:!!s,useFog:t.fog,fogExp:s&&s.isFogExp2,flatShading:t.flatShading,sizeAttenuation:t.sizeAttenuation,logarithmicDepthBuffer:n.logarithmicDepthBuffer,skinning:t.skinning&&d>0,maxBones:d,useVertexTexture:n.floatVertexTextures,morphTargets:t.morphTargets,morphNormals:t.morphNormals,maxMorphTargets:e.maxMorphTargets,maxMorphNormals:e.maxMorphNormals,numDirLights:r.directional.length,numPointLights:r.point.length,numSpotLights:r.spot.length,numRectAreaLights:r.rectArea.length,numHemiLights:r.hemi.length,numClippingPlanes:c,numClipIntersection:l,dithering:t.dithering,shadowMapEnabled:e.shadowMap.enabled&&u.receiveShadow&&a.length>0,shadowMapType:e.shadowMap.type,toneMapping:e.toneMapping,physicallyCorrectLights:e.physicallyCorrectLights,premultipliedAlpha:t.premultipliedAlpha,alphaTest:t.alphaTest,doubleSided:2===t.side,flipSided:1===t.side,depthPacking:void 0!==t.depthPacking&&t.depthPacking}},this.getProgramCode=function(t,n){var r=[];if(n.shaderID?r.push(n.shaderID):(r.push(t.fragmentShader),r.push(t.vertexShader)),void 0!==t.defines)for(var i in t.defines)r.push(i),r.push(t.defines[i]);for(var o=0;o<a.length;o++)r.push(n[a[o]]);return r.push(t.onBeforeCompile.toString()),r.push(e.gammaOutput),r.join()},this.acquireProgram=function(n,i,a,o){for(var s,c=0,l=r.length;c<l;c++){var u=r[c];if(u.code===o){++(s=u).usedTimes;break}}return void 0===s&&(s=new Yt(e,t,o,n,i,a),r.push(s)),s},this.releaseProgram=function(e){if(0==--e.usedTimes){var t=r.indexOf(e);r[t]=r[r.length-1],r.pop(),e.destroy()}},this.programs=r}function Qt(e,t,n,r,i,a,o,s){var c,l="undefined"!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext,u={};function h(e,t){if(e.width>t||e.height>t){var n=t/Math.max(e.width,e.height),r=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");return r.width=Math.floor(e.width*n),r.height=Math.floor(e.height*n),r.getContext("2d").drawImage(e,0,0,e.width,e.height,0,0,r.width,r.height),console.warn("THREE.WebGLRenderer: image is too big ("+e.width+"x"+e.height+"). Resized to "+r.width+"x"+r.height,e),r}return e}function d(e){return m.isPowerOfTwo(e.width)&&m.isPowerOfTwo(e.height)}function p(e,t){return e.generateMipmaps&&t&&1003!==e.minFilter&&1006!==e.minFilter}function f(t){return 1003===t||1004===t||1005===t?e.NEAREST:e.LINEAR}function g(t){var n=t.target;n.removeEventListener("dispose",g),function(t){var n=r.get(t);if(t.image&&n.__image__webglTextureCube)e.deleteTexture(n.__image__webglTextureCube);else{if(void 0===n.__webglInit)return;e.deleteTexture(n.__webglTexture)}r.remove(t)}(n),n.isVideoTexture&&delete u[n.id],o.textures--}function y(t){var n=t.target;n.removeEventListener("dispose",y),function(t){var n=r.get(t),i=r.get(t.texture);if(!t)return;void 0!==i.__webglTexture&&e.deleteTexture(i.__webglTexture);t.depthTexture&&t.depthTexture.dispose();if(t.isWebGLRenderTargetCube)for(var a=0;a<6;a++)e.deleteFramebuffer(n.__webglFramebuffer[a]),n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer[a]);else e.deleteFramebuffer(n.__webglFramebuffer),n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer);r.remove(t.texture),r.remove(t)}(n),o.textures--}function v(t,f){var y=r.get(t);if(t.isVideoTexture&&function(e){var t=e.id,n=s.frame;u[t]!==n&&(u[t]=n,e.update())}(t),t.version>0&&y.__version!==t.version){var v=t.image;if(void 0===v)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined",t);else{if(!1!==v.complete)return void function(t,r,s){void 0===t.__webglInit&&(t.__webglInit=!0,r.addEventListener("dispose",g),t.__webglTexture=e.createTexture(),o.textures++);n.activeTexture(e.TEXTURE0+s),n.bindTexture(e.TEXTURE_2D,t.__webglTexture),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,r.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r.premultiplyAlpha),e.pixelStorei(e.UNPACK_ALIGNMENT,r.unpackAlignment);var u=h(r.image,i.maxTextureSize);(function(e){return 1001!==e.wrapS||1001!==e.wrapT||1003!==e.minFilter&&1006!==e.minFilter})(r)&&!1===d(u)&&(u=function(e){return e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof ImageBitmap?(void 0===c&&(c=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),c.width=m.floorPowerOfTwo(e.width),c.height=m.floorPowerOfTwo(e.height),c.getContext("2d").drawImage(e,0,0,c.width,c.height),console.warn("THREE.WebGLRenderer: image is not power of two ("+e.width+"x"+e.height+"). Resized to "+c.width+"x"+c.height,e),c):e}(u));var f=d(u),y=a.convert(r.format),v=a.convert(r.type);b(e.TEXTURE_2D,r,f);var w,A=r.mipmaps;if(r.isDepthTexture){var E=e.DEPTH_COMPONENT;if(1015===r.type){if(!l)throw new Error("Float Depth Texture only supported in WebGL2.0");E=e.DEPTH_COMPONENT32F}else l&&(E=e.DEPTH_COMPONENT16);1026===r.format&&E===e.DEPTH_COMPONENT&&1012!==r.type&&1014!==r.type&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),r.type=1012,v=a.convert(r.type)),1027===r.format&&(E=e.DEPTH_STENCIL,1020!==r.type&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),r.type=1020,v=a.convert(r.type))),n.texImage2D(e.TEXTURE_2D,0,E,u.width,u.height,0,y,v,null)}else if(r.isDataTexture)if(A.length>0&&f){for(var x=0,_=A.length;x<_;x++)w=A[x],n.texImage2D(e.TEXTURE_2D,x,y,w.width,w.height,0,y,v,w.data);r.generateMipmaps=!1}else n.texImage2D(e.TEXTURE_2D,0,y,u.width,u.height,0,y,v,u.data);else if(r.isCompressedTexture)for(x=0,_=A.length;x<_;x++)w=A[x],1023!==r.format&&1022!==r.format?n.getCompressedTextureFormats().indexOf(y)>-1?n.compressedTexImage2D(e.TEXTURE_2D,x,y,w.width,w.height,0,w.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):n.texImage2D(e.TEXTURE_2D,x,y,w.width,w.height,0,y,v,w.data);else if(A.length>0&&f){for(x=0,_=A.length;x<_;x++)w=A[x],n.texImage2D(e.TEXTURE_2D,x,y,y,v,w);r.generateMipmaps=!1}else n.texImage2D(e.TEXTURE_2D,0,y,y,v,u);p(r,f)&&e.generateMipmap(e.TEXTURE_2D);t.__version=r.version,r.onUpdate&&r.onUpdate(r)}(y,t,f);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete",t)}}n.activeTexture(e.TEXTURE0+f),n.bindTexture(e.TEXTURE_2D,y.__webglTexture)}function b(n,o,s){var c;if(s?(e.texParameteri(n,e.TEXTURE_WRAP_S,a.convert(o.wrapS)),e.texParameteri(n,e.TEXTURE_WRAP_T,a.convert(o.wrapT)),e.texParameteri(n,e.TEXTURE_MAG_FILTER,a.convert(o.magFilter)),e.texParameteri(n,e.TEXTURE_MIN_FILTER,a.convert(o.minFilter))):(e.texParameteri(n,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(n,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),1001===o.wrapS&&1001===o.wrapT||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.",o),e.texParameteri(n,e.TEXTURE_MAG_FILTER,f(o.magFilter)),e.texParameteri(n,e.TEXTURE_MIN_FILTER,f(o.minFilter)),1003!==o.minFilter&&1006!==o.minFilter&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.",o)),c=t.get("EXT_texture_filter_anisotropic")){if(1015===o.type&&null===t.get("OES_texture_float_linear"))return;if(1016===o.type&&null===t.get("OES_texture_half_float_linear"))return;(o.anisotropy>1||r.get(o).__currentAnisotropy)&&(e.texParameterf(n,c.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(o.anisotropy,i.getMaxAnisotropy())),r.get(o).__currentAnisotropy=o.anisotropy)}}function w(t,i,o,s){var c=a.convert(i.texture.format),l=a.convert(i.texture.type);n.texImage2D(s,0,c,i.width,i.height,0,c,l,null),e.bindFramebuffer(e.FRAMEBUFFER,t),e.framebufferTexture2D(e.FRAMEBUFFER,o,s,r.get(i.texture).__webglTexture,0),e.bindFramebuffer(e.FRAMEBUFFER,null)}function A(t,n){e.bindRenderbuffer(e.RENDERBUFFER,t),n.depthBuffer&&!n.stencilBuffer?(e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_COMPONENT16,n.width,n.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,t)):n.depthBuffer&&n.stencilBuffer?(e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,n.width,n.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,t)):e.renderbufferStorage(e.RENDERBUFFER,e.RGBA4,n.width,n.height),e.bindRenderbuffer(e.RENDERBUFFER,null)}function E(t){var n=r.get(t),i=!0===t.isWebGLRenderTargetCube;if(t.depthTexture){if(i)throw new Error("target.depthTexture not supported in Cube render targets");!function(t,n){if(n&&n.isWebGLRenderTargetCube)throw new Error("Depth Texture with cube render targets is not supported");if(e.bindFramebuffer(e.FRAMEBUFFER,t),!n.depthTexture||!n.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");r.get(n.depthTexture).__webglTexture&&n.depthTexture.image.width===n.width&&n.depthTexture.image.height===n.height||(n.depthTexture.image.width=n.width,n.depthTexture.image.height=n.height,n.depthTexture.needsUpdate=!0),v(n.depthTexture,0);var i=r.get(n.depthTexture).__webglTexture;if(1026===n.depthTexture.format)e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.TEXTURE_2D,i,0);else{if(1027!==n.depthTexture.format)throw new Error("Unknown depthTexture format");e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.TEXTURE_2D,i,0)}}(n.__webglFramebuffer,t)}else if(i){n.__webglDepthbuffer=[];for(var a=0;a<6;a++)e.bindFramebuffer(e.FRAMEBUFFER,n.__webglFramebuffer[a]),n.__webglDepthbuffer[a]=e.createRenderbuffer(),A(n.__webglDepthbuffer[a],t)}else e.bindFramebuffer(e.FRAMEBUFFER,n.__webglFramebuffer),n.__webglDepthbuffer=e.createRenderbuffer(),A(n.__webglDepthbuffer,t);e.bindFramebuffer(e.FRAMEBUFFER,null)}this.setTexture2D=v,this.setTextureCube=function(t,s){var c=r.get(t);if(6===t.image.length)if(t.version>0&&c.__version!==t.version){c.__image__webglTextureCube||(t.addEventListener("dispose",g),c.__image__webglTextureCube=e.createTexture(),o.textures++),n.activeTexture(e.TEXTURE0+s),n.bindTexture(e.TEXTURE_CUBE_MAP,c.__image__webglTextureCube),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,t.flipY);for(var l=t&&t.isCompressedTexture,u=t.image[0]&&t.image[0].isDataTexture,f=[],m=0;m<6;m++)f[m]=l||u?u?t.image[m].image:t.image[m]:h(t.image[m],i.maxCubemapSize);var y=d(f[0]),v=a.convert(t.format),w=a.convert(t.type);b(e.TEXTURE_CUBE_MAP,t,y);for(m=0;m<6;m++)if(l)for(var A,E=f[m].mipmaps,x=0,_=E.length;x<_;x++)A=E[x],1023!==t.format&&1022!==t.format?n.getCompressedTextureFormats().indexOf(v)>-1?n.compressedTexImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+m,x,v,A.width,A.height,0,A.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+m,x,v,A.width,A.height,0,v,w,A.data);else u?n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+m,0,v,f[m].width,f[m].height,0,v,w,f[m].data):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+m,0,v,v,w,f[m]);p(t,y)&&e.generateMipmap(e.TEXTURE_CUBE_MAP),c.__version=t.version,t.onUpdate&&t.onUpdate(t)}else n.activeTexture(e.TEXTURE0+s),n.bindTexture(e.TEXTURE_CUBE_MAP,c.__image__webglTextureCube)},this.setTextureCubeDynamic=function(t,i){n.activeTexture(e.TEXTURE0+i),n.bindTexture(e.TEXTURE_CUBE_MAP,r.get(t).__webglTexture)},this.setupRenderTarget=function(t){var i=r.get(t),a=r.get(t.texture);t.addEventListener("dispose",y),a.__webglTexture=e.createTexture(),o.textures++;var s=!0===t.isWebGLRenderTargetCube,c=d(t);if(s){i.__webglFramebuffer=[];for(var l=0;l<6;l++)i.__webglFramebuffer[l]=e.createFramebuffer()}else i.__webglFramebuffer=e.createFramebuffer();if(s){n.bindTexture(e.TEXTURE_CUBE_MAP,a.__webglTexture),b(e.TEXTURE_CUBE_MAP,t.texture,c);for(l=0;l<6;l++)w(i.__webglFramebuffer[l],t,e.COLOR_ATTACHMENT0,e.TEXTURE_CUBE_MAP_POSITIVE_X+l);p(t.texture,c)&&e.generateMipmap(e.TEXTURE_CUBE_MAP),n.bindTexture(e.TEXTURE_CUBE_MAP,null)}else n.bindTexture(e.TEXTURE_2D,a.__webglTexture),b(e.TEXTURE_2D,t.texture,c),w(i.__webglFramebuffer,t,e.COLOR_ATTACHMENT0,e.TEXTURE_2D),p(t.texture,c)&&e.generateMipmap(e.TEXTURE_2D),n.bindTexture(e.TEXTURE_2D,null);t.depthBuffer&&E(t)},this.updateRenderTargetMipmap=function(t){var i=t.texture;if(p(i,d(t))){var a=t.isWebGLRenderTargetCube?e.TEXTURE_CUBE_MAP:e.TEXTURE_2D,o=r.get(i).__webglTexture;n.bindTexture(a,o),e.generateMipmap(a),n.bindTexture(a,null)}}}function $t(){var e={};return{get:function(t){var n=t.uuid,r=e[n];return void 0===r&&(r={},e[n]=r),r},remove:function(t){delete e[t.uuid]},update:function(t,n,r){var i=t.uuid;e[i][n]=r},dispose:function(){e={}}}}function en(e,t,n){var r=new function(){var t=!1,n=new x,r=null,i=new x(0,0,0,0);return{setMask:function(n){r===n||t||(e.colorMask(n,n,n,n),r=n)},setLocked:function(e){t=e},setClear:function(t,r,a,o,s){!0===s&&(t*=o,r*=o,a*=o),n.set(t,r,a,o),!1===i.equals(n)&&(e.clearColor(t,r,a,o),i.copy(n))},reset:function(){t=!1,r=null,i.set(-1,0,0,0)}}},i=new function(){var t=!1,n=null,r=null,i=null;return{setTest:function(t){t?F(e.DEPTH_TEST):j(e.DEPTH_TEST)},setMask:function(r){n===r||t||(e.depthMask(r),n=r)},setFunc:function(t){if(r!==t){if(t)switch(t){case 0:e.depthFunc(e.NEVER);break;case 1:e.depthFunc(e.ALWAYS);break;case 2:e.depthFunc(e.LESS);break;case 3:e.depthFunc(e.LEQUAL);break;case 4:e.depthFunc(e.EQUAL);break;case 5:e.depthFunc(e.GEQUAL);break;case 6:e.depthFunc(e.GREATER);break;case 7:e.depthFunc(e.NOTEQUAL);break;default:e.depthFunc(e.LEQUAL)}else e.depthFunc(e.LEQUAL);r=t}},setLocked:function(e){t=e},setClear:function(t){i!==t&&(e.clearDepth(t),i=t)},reset:function(){t=!1,n=null,r=null,i=null}}},a=new function(){var t=!1,n=null,r=null,i=null,a=null,o=null,s=null,c=null,l=null;return{setTest:function(t){t?F(e.STENCIL_TEST):j(e.STENCIL_TEST)},setMask:function(r){n===r||t||(e.stencilMask(r),n=r)},setFunc:function(t,n,o){r===t&&i===n&&a===o||(e.stencilFunc(t,n,o),r=t,i=n,a=o)},setOp:function(t,n,r){o===t&&s===n&&c===r||(e.stencilOp(t,n,r),o=t,s=n,c=r)},setLocked:function(e){t=e},setClear:function(t){l!==t&&(e.clearStencil(t),l=t)},reset:function(){t=!1,n=null,r=null,i=null,a=null,o=null,s=null,c=null,l=null}}},o=e.getParameter(e.MAX_VERTEX_ATTRIBS),s=new Uint8Array(o),c=new Uint8Array(o),l=new Uint8Array(o),u={},h=null,d=null,p=null,f=null,m=null,g=null,y=null,v=null,b=null,w=!1,A=null,E=null,_=null,S=null,M=null,T=e.getParameter(e.MAX_COMBINED_TEXTURE_IMAGE_UNITS),R=!1,k=0,C=e.getParameter(e.VERSION);-1!==C.indexOf("WebGL")?(k=parseFloat(/^WebGL\ ([0-9])/.exec(C)[1]),R=k>=1):-1!==C.indexOf("OpenGL ES")&&(k=parseFloat(/^OpenGL\ ES\ ([0-9])/.exec(C)[1]),R=k>=2);var O=null,P={},I=new x,N=new x;function L(t,n,r){var i=new Uint8Array(4),a=e.createTexture();e.bindTexture(t,a),e.texParameteri(t,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(t,e.TEXTURE_MAG_FILTER,e.NEAREST);for(var o=0;o<r;o++)e.texImage2D(n+o,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,i);return a}var D={};function F(t){!0!==u[t]&&(e.enable(t),u[t]=!0)}function j(t){!1!==u[t]&&(e.disable(t),u[t]=!1)}function U(t,r,i,a,o,s,c,l){if(0!==t?F(e.BLEND):j(e.BLEND),5!==t){if(t!==p||l!==w)switch(t){case 2:l?(e.blendEquationSeparate(e.FUNC_ADD,e.FUNC_ADD),e.blendFuncSeparate(e.ONE,e.ONE,e.ONE,e.ONE)):(e.blendEquation(e.FUNC_ADD),e.blendFunc(e.SRC_ALPHA,e.ONE));break;case 3:l?(e.blendEquationSeparate(e.FUNC_ADD,e.FUNC_ADD),e.blendFuncSeparate(e.ZERO,e.ZERO,e.ONE_MINUS_SRC_COLOR,e.ONE_MINUS_SRC_ALPHA)):(e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ZERO,e.ONE_MINUS_SRC_COLOR));break;case 4:l?(e.blendEquationSeparate(e.FUNC_ADD,e.FUNC_ADD),e.blendFuncSeparate(e.ZERO,e.SRC_COLOR,e.ZERO,e.SRC_ALPHA)):(e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ZERO,e.SRC_COLOR));break;default:l?(e.blendEquationSeparate(e.FUNC_ADD,e.FUNC_ADD),e.blendFuncSeparate(e.ONE,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA)):(e.blendEquationSeparate(e.FUNC_ADD,e.FUNC_ADD),e.blendFuncSeparate(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA))}f=null,m=null,g=null,y=null,v=null,b=null}else o=o||r,s=s||i,c=c||a,r===f&&o===y||(e.blendEquationSeparate(n.convert(r),n.convert(o)),f=r,y=o),i===m&&a===g&&s===v&&c===b||(e.blendFuncSeparate(n.convert(i),n.convert(a),n.convert(s),n.convert(c)),m=i,g=a,v=s,b=c);p=t,w=l}function B(t){A!==t&&(t?e.frontFace(e.CW):e.frontFace(e.CCW),A=t)}function V(t){0!==t?(F(e.CULL_FACE),t!==E&&(1===t?e.cullFace(e.BACK):2===t?e.cullFace(e.FRONT):e.cullFace(e.FRONT_AND_BACK))):j(e.CULL_FACE),E=t}function z(t,n,r){t?(F(e.POLYGON_OFFSET_FILL),S===n&&M===r||(e.polygonOffset(n,r),S=n,M=r)):j(e.POLYGON_OFFSET_FILL)}function H(t){void 0===t&&(t=e.TEXTURE0+T-1),O!==t&&(e.activeTexture(t),O=t)}return D[e.TEXTURE_2D]=L(e.TEXTURE_2D,e.TEXTURE_2D,1),D[e.TEXTURE_CUBE_MAP]=L(e.TEXTURE_CUBE_MAP,e.TEXTURE_CUBE_MAP_POSITIVE_X,6),r.setClear(0,0,0,1),i.setClear(1),a.setClear(0),F(e.DEPTH_TEST),i.setFunc(3),B(!1),V(1),F(e.CULL_FACE),F(e.BLEND),U(1),{buffers:{color:r,depth:i,stencil:a},initAttributes:function(){for(var e=0,t=s.length;e<t;e++)s[e]=0},enableAttribute:function(n){s[n]=1,0===c[n]&&(e.enableVertexAttribArray(n),c[n]=1),0!==l[n]&&(t.get("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(n,0),l[n]=0)},enableAttributeAndDivisor:function(n,r){s[n]=1,0===c[n]&&(e.enableVertexAttribArray(n),c[n]=1),l[n]!==r&&(t.get("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(n,r),l[n]=r)},disableUnusedAttributes:function(){for(var t=0,n=c.length;t!==n;++t)c[t]!==s[t]&&(e.disableVertexAttribArray(t),c[t]=0)},enable:F,disable:j,getCompressedTextureFormats:function(){if(null===h&&(h=[],t.get("WEBGL_compressed_texture_pvrtc")||t.get("WEBGL_compressed_texture_s3tc")||t.get("WEBGL_compressed_texture_etc1")||t.get("WEBGL_compressed_texture_astc")))for(var n=e.getParameter(e.COMPRESSED_TEXTURE_FORMATS),r=0;r<n.length;r++)h.push(n[r]);return h},useProgram:function(t){return d!==t&&(e.useProgram(t),d=t,!0)},setBlending:U,setMaterial:function(t,n){2===t.side?j(e.CULL_FACE):F(e.CULL_FACE);var a=1===t.side;n&&(a=!a),B(a),!0===t.transparent?U(t.blending,t.blendEquation,t.blendSrc,t.blendDst,t.blendEquationAlpha,t.blendSrcAlpha,t.blendDstAlpha,t.premultipliedAlpha):U(0),i.setFunc(t.depthFunc),i.setTest(t.depthTest),i.setMask(t.depthWrite),r.setMask(t.colorWrite),z(t.polygonOffset,t.polygonOffsetFactor,t.polygonOffsetUnits)},setFlipSided:B,setCullFace:V,setLineWidth:function(t){t!==_&&(R&&e.lineWidth(t),_=t)},setPolygonOffset:z,setScissorTest:function(t){t?F(e.SCISSOR_TEST):j(e.SCISSOR_TEST)},activeTexture:H,bindTexture:function(t,n){null===O&&H();var r=P[O];void 0===r&&(r={type:void 0,texture:void 0},P[O]=r),r.type===t&&r.texture===n||(e.bindTexture(t,n||D[t]),r.type=t,r.texture=n)},compressedTexImage2D:function(){try{e.compressedTexImage2D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texImage2D:function(){try{e.texImage2D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},scissor:function(t){!1===I.equals(t)&&(e.scissor(t.x,t.y,t.z,t.w),I.copy(t))},viewport:function(t){!1===N.equals(t)&&(e.viewport(t.x,t.y,t.z,t.w),N.copy(t))},reset:function(){for(var t=0;t<c.length;t++)1===c[t]&&(e.disableVertexAttribArray(t),c[t]=0);u={},h=null,O=null,P={},d=null,p=null,A=null,E=null,r.reset(),i.reset(),a.reset()}}}function tn(e,t,n){var r;function i(t){if("highp"===t){if(e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.HIGH_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).precision>0)return"highp";t="mediump"}return"mediump"===t&&e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}var a=void 0!==n.precision?n.precision:"highp",o=i(a);o!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",o,"instead."),a=o);var s=!0===n.logarithmicDepthBuffer,c=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),l=e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),u=e.getParameter(e.MAX_TEXTURE_SIZE),h=e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),d=e.getParameter(e.MAX_VERTEX_ATTRIBS),p=e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),f=e.getParameter(e.MAX_VARYING_VECTORS),m=e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),g=l>0,y=!!t.get("OES_texture_float");return{getMaxAnisotropy:function(){if(void 0!==r)return r;var n=t.get("EXT_texture_filter_anisotropic");return r=null!==n?e.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0},getMaxPrecision:i,precision:a,logarithmicDepthBuffer:s,maxTextures:c,maxVertexTextures:l,maxTextureSize:u,maxCubemapSize:h,maxAttributes:d,maxVertexUniforms:p,maxVaryings:f,maxFragmentUniforms:m,vertexTextures:g,floatFragmentTextures:y,floatVertexTextures:g&&y}}function nn(e,t,n,r){We.call(this),this.type="PerspectiveCamera",this.fov=void 0!==e?e:50,this.zoom=1,this.near=void 0!==n?n:.1,this.far=void 0!==r?r:2e3,this.focus=10,this.aspect=void 0!==t?t:1,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}function rn(e){nn.call(this),this.cameras=e||[]}function an(e){var t=this,n=null,r=null,i=null,a=new y,o=new y;"undefined"!=typeof window&&"VRFrameData"in window&&(r=new window.VRFrameData);var s=new y,c=new v,l=new b,u=new nn;u.bounds=new x(0,0,.5,1),u.layers.enable(1);var h=new nn;h.bounds=new x(.5,0,.5,1),h.layers.enable(2);var d,p,f=new rn([u,h]);function m(){if(null!==n&&n.isPresenting){var r=n.getEyeParameters("left"),i=r.renderWidth,a=r.renderHeight;p=e.getPixelRatio(),d=e.getSize(),e.setDrawingBufferSize(2*i,a,1)}else t.enabled&&e.setDrawingBufferSize(d.width,d.height,p)}f.layers.enable(1),f.layers.enable(2),"undefined"!=typeof window&&window.addEventListener("vrdisplaypresentchange",m,!1),this.enabled=!1,this.userHeight=1.6,this.getDevice=function(){return n},this.setDevice=function(e){void 0!==e&&(n=e)},this.setPoseTarget=function(e){void 0!==e&&(i=e)},this.getCamera=function(e){if(null===n)return e;n.depthNear=e.near,n.depthFar=e.far,n.getFrameData(r);var d=n.stageParameters;d?a.fromArray(d.sittingToStandingTransform):a.makeTranslation(0,t.userHeight,0);var p=r.pose,m=null!==i?i:e;if(m.matrix.copy(a),m.matrix.decompose(m.position,m.quaternion,m.scale),null!==p.orientation&&(c.fromArray(p.orientation),m.quaternion.multiply(c)),null!==p.position&&(c.setFromRotationMatrix(a),l.fromArray(p.position),l.applyQuaternion(c),m.position.add(l)),m.updateMatrixWorld(),!1===n.isPresenting)return e;u.near=e.near,h.near=e.near,u.far=e.far,h.far=e.far,f.matrixWorld.copy(e.matrixWorld),f.matrixWorldInverse.copy(e.matrixWorldInverse),u.matrixWorldInverse.fromArray(r.leftViewMatrix),h.matrixWorldInverse.fromArray(r.rightViewMatrix),o.getInverse(a),u.matrixWorldInverse.multiply(o),h.matrixWorldInverse.multiply(o);var g=m.parent;null!==g&&(s.getInverse(g.matrixWorld),u.matrixWorldInverse.multiply(s),h.matrixWorldInverse.multiply(s)),u.matrixWorld.getInverse(u.matrixWorldInverse),h.matrixWorld.getInverse(h.matrixWorldInverse),u.projectionMatrix.fromArray(r.leftProjectionMatrix),h.projectionMatrix.fromArray(r.rightProjectionMatrix),f.projectionMatrix.copy(u.projectionMatrix);var y=n.getLayers();if(y.length){var v=y[0];null!==v.leftBounds&&4===v.leftBounds.length&&u.bounds.fromArray(v.leftBounds),null!==v.rightBounds&&4===v.rightBounds.length&&h.bounds.fromArray(v.rightBounds)}return f},this.getStandingMatrix=function(){return a},this.submitFrame=function(){n&&n.isPresenting&&n.submitFrame()},this.dispose=function(){"undefined"!=typeof window&&window.removeEventListener("vrdisplaypresentchange",m)}}function on(e){var t={};return{get:function(n){if(void 0!==t[n])return t[n];var r;switch(n){case"WEBGL_depth_texture":r=e.getExtension("WEBGL_depth_texture")||e.getExtension("MOZ_WEBGL_depth_texture")||e.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":r=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":r=e.getExtension("WEBGL_compressed_texture_s3tc")||e.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":r=e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;case"WEBGL_compressed_texture_etc1":r=e.getExtension("WEBGL_compressed_texture_etc1");break;default:r=e.getExtension(n)}return null===r&&console.warn("THREE.WebGLRenderer: "+n+" extension not supported."),t[n]=r,r}}}function sn(){var e=this,t=null,n=0,r=!1,i=!1,a=new Ne,o=new w,s={value:null,needsUpdate:!1};function c(){s.value!==t&&(s.value=t,s.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function l(t,n,r,i){var c=null!==t?t.length:0,l=null;if(0!==c){if(l=s.value,!0!==i||null===l){var u=r+4*c,h=n.matrixWorldInverse;o.getNormalMatrix(h),(null===l||l.length<u)&&(l=new Float32Array(u));for(var d=0,p=r;d!==c;++d,p+=4)a.copy(t[d]).applyMatrix4(h,o),a.normal.toArray(l,p),l[p+3]=a.constant}s.value=l,s.needsUpdate=!0}return e.numPlanes=c,l}this.uniform=s,this.numPlanes=0,this.numIntersection=0,this.init=function(e,i,a){var o=0!==e.length||i||0!==n||r;return r=i,t=l(e,a,0),n=e.length,o},this.beginShadows=function(){i=!0,l(null)},this.endShadows=function(){i=!1,c()},this.setState=function(e,a,o,u,h,d){if(!r||null===e||0===e.length||i&&!o)i?l(null):c();else{var p=i?0:n,f=4*p,m=h.clippingState||null;s.value=m,m=l(e,u,f,d);for(var g=0;g!==f;++g)m[g]=t[g];h.clippingState=m,this.numIntersection=a?this.numPlanes:0,this.numPlanes+=p}}}function cn(e,t){return{convert:function(n){var r;if(1e3===n)return e.REPEAT;if(1001===n)return e.CLAMP_TO_EDGE;if(1002===n)return e.MIRRORED_REPEAT;if(1003===n)return e.NEAREST;if(1004===n)return e.NEAREST_MIPMAP_NEAREST;if(1005===n)return e.NEAREST_MIPMAP_LINEAR;if(1006===n)return e.LINEAR;if(1007===n)return e.LINEAR_MIPMAP_NEAREST;if(1008===n)return e.LINEAR_MIPMAP_LINEAR;if(1009===n)return e.UNSIGNED_BYTE;if(1017===n)return e.UNSIGNED_SHORT_4_4_4_4;if(1018===n)return e.UNSIGNED_SHORT_5_5_5_1;if(1019===n)return e.UNSIGNED_SHORT_5_6_5;if(1010===n)return e.BYTE;if(1011===n)return e.SHORT;if(1012===n)return e.UNSIGNED_SHORT;if(1013===n)return e.INT;if(1014===n)return e.UNSIGNED_INT;if(1015===n)return e.FLOAT;if(1016===n&&null!==(r=t.get("OES_texture_half_float")))return r.HALF_FLOAT_OES;if(1021===n)return e.ALPHA;if(1022===n)return e.RGB;if(1023===n)return e.RGBA;if(1024===n)return e.LUMINANCE;if(1025===n)return e.LUMINANCE_ALPHA;if(1026===n)return e.DEPTH_COMPONENT;if(1027===n)return e.DEPTH_STENCIL;if(100===n)return e.FUNC_ADD;if(101===n)return e.FUNC_SUBTRACT;if(102===n)return e.FUNC_REVERSE_SUBTRACT;if(200===n)return e.ZERO;if(201===n)return e.ONE;if(202===n)return e.SRC_COLOR;if(203===n)return e.ONE_MINUS_SRC_COLOR;if(204===n)return e.SRC_ALPHA;if(205===n)return e.ONE_MINUS_SRC_ALPHA;if(206===n)return e.DST_ALPHA;if(207===n)return e.ONE_MINUS_DST_ALPHA;if(208===n)return e.DST_COLOR;if(209===n)return e.ONE_MINUS_DST_COLOR;if(210===n)return e.SRC_ALPHA_SATURATE;if((33776===n||33777===n||33778===n||33779===n)&&null!==(r=t.get("WEBGL_compressed_texture_s3tc"))){if(33776===n)return r.COMPRESSED_RGB_S3TC_DXT1_EXT;if(33777===n)return r.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(33778===n)return r.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(33779===n)return r.COMPRESSED_RGBA_S3TC_DXT5_EXT}if((35840===n||35841===n||35842===n||35843===n)&&null!==(r=t.get("WEBGL_compressed_texture_pvrtc"))){if(35840===n)return r.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(35841===n)return r.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(35842===n)return r.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(35843===n)return r.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(36196===n&&null!==(r=t.get("WEBGL_compressed_texture_etc1")))return r.COMPRESSED_RGB_ETC1_WEBGL;if((37808===n||37809===n||37810===n||37811===n||37812===n||37813===n||37814===n||37815===n||37816===n||37817===n||37818===n||37819===n||37820===n||37821===n)&&null!==(r=t.get("WEBGL_compressed_texture_astc")))return n;if((103===n||104===n)&&null!==(r=t.get("EXT_blend_minmax"))){if(103===n)return r.MIN_EXT;if(104===n)return r.MAX_EXT}return 1020===n&&null!==(r=t.get("WEBGL_depth_texture"))?r.UNSIGNED_INT_24_8_WEBGL:0}}}function ln(){var e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];var n;switch(t.type){case"DirectionalLight":n={direction:new b,color:new fe,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new g};break;case"SpotLight":n={position:new b,direction:new b,color:new fe,distance:0,coneCos:0,penumbraCos:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new g};break;case"PointLight":n={position:new b,color:new fe,distance:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new g,shadowCameraNear:1,shadowCameraFar:1e3};break;case"HemisphereLight":n={direction:new b,skyColor:new fe,groundColor:new fe};break;case"RectAreaLight":n={color:new fe,position:new b,halfWidth:new b,halfHeight:new b}}return e[t.id]=n,n}}}nn.prototype=Object.assign(Object.create(We.prototype),{constructor:nn,isPerspectiveCamera:!0,copy:function(e,t){return We.prototype.copy.call(this,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=null===e.view?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this},setFocalLength:function(e){var t=.5*this.getFilmHeight()/e;this.fov=2*m.RAD2DEG*Math.atan(t),this.updateProjectionMatrix()},getFocalLength:function(){var e=Math.tan(.5*m.DEG2RAD*this.fov);return.5*this.getFilmHeight()/e},getEffectiveFOV:function(){return 2*m.RAD2DEG*Math.atan(Math.tan(.5*m.DEG2RAD*this.fov)/this.zoom)},getFilmWidth:function(){return this.filmGauge*Math.min(this.aspect,1)},getFilmHeight:function(){return this.filmGauge/Math.max(this.aspect,1)},setViewOffset:function(e,t,n,r,i,a){this.aspect=e/t,null===this.view&&(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=r,this.view.width=i,this.view.height=a,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var e=this.near,t=e*Math.tan(.5*m.DEG2RAD*this.fov)/this.zoom,n=2*t,r=this.aspect*n,i=-.5*r,a=this.view;if(null!==this.view&&this.view.enabled){var o=a.fullWidth,s=a.fullHeight;i+=a.offsetX*r/o,t-=a.offsetY*n/s,r*=a.width/o,n*=a.height/s}var c=this.filmOffset;0!==c&&(i+=e*c/this.getFilmWidth()),this.projectionMatrix.makePerspective(i,i+r,t,t-n,e,this.far)},toJSON:function(e){var t=qe.prototype.toJSON.call(this,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,null!==this.view&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}),rn.prototype=Object.assign(Object.create(nn.prototype),{constructor:rn,isArrayCamera:!0});var un,hn,dn,pn,fn,mn,gn,yn,vn=0;function bn(){var e=new ln,t={id:vn++,hash:"",ambient:[0,0,0],directional:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],point:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]},n=new b,r=new y,i=new y;return{setup:function(a,o,s){for(var c=0,l=0,u=0,h=0,d=0,p=0,f=0,m=0,g=s.matrixWorldInverse,y=0,v=a.length;y<v;y++){var b=a[y],w=b.color,A=b.intensity,E=b.distance,x=b.shadow&&b.shadow.map?b.shadow.map.texture:null;if(b.isAmbientLight)c+=w.r*A,l+=w.g*A,u+=w.b*A;else if(b.isDirectionalLight){if((S=e.get(b)).color.copy(b.color).multiplyScalar(b.intensity),S.direction.setFromMatrixPosition(b.matrixWorld),n.setFromMatrixPosition(b.target.matrixWorld),S.direction.sub(n),S.direction.transformDirection(g),S.shadow=b.castShadow,b.castShadow){var _=b.shadow;S.shadowBias=_.bias,S.shadowRadius=_.radius,S.shadowMapSize=_.mapSize}t.directionalShadowMap[h]=x,t.directionalShadowMatrix[h]=b.shadow.matrix,t.directional[h]=S,h++}else if(b.isSpotLight){if((S=e.get(b)).position.setFromMatrixPosition(b.matrixWorld),S.position.applyMatrix4(g),S.color.copy(w).multiplyScalar(A),S.distance=E,S.direction.setFromMatrixPosition(b.matrixWorld),n.setFromMatrixPosition(b.target.matrixWorld),S.direction.sub(n),S.direction.transformDirection(g),S.coneCos=Math.cos(b.angle),S.penumbraCos=Math.cos(b.angle*(1-b.penumbra)),S.decay=0===b.distance?0:b.decay,S.shadow=b.castShadow,b.castShadow){_=b.shadow;S.shadowBias=_.bias,S.shadowRadius=_.radius,S.shadowMapSize=_.mapSize}t.spotShadowMap[p]=x,t.spotShadowMatrix[p]=b.shadow.matrix,t.spot[p]=S,p++}else if(b.isRectAreaLight){(S=e.get(b)).color.copy(w).multiplyScalar(A),S.position.setFromMatrixPosition(b.matrixWorld),S.position.applyMatrix4(g),i.identity(),r.copy(b.matrixWorld),r.premultiply(g),i.extractRotation(r),S.halfWidth.set(.5*b.width,0,0),S.halfHeight.set(0,.5*b.height,0),S.halfWidth.applyMatrix4(i),S.halfHeight.applyMatrix4(i),t.rectArea[f]=S,f++}else if(b.isPointLight){if((S=e.get(b)).position.setFromMatrixPosition(b.matrixWorld),S.position.applyMatrix4(g),S.color.copy(b.color).multiplyScalar(b.intensity),S.distance=b.distance,S.decay=0===b.distance?0:b.decay,S.shadow=b.castShadow,b.castShadow){_=b.shadow;S.shadowBias=_.bias,S.shadowRadius=_.radius,S.shadowMapSize=_.mapSize,S.shadowCameraNear=_.camera.near,S.shadowCameraFar=_.camera.far}t.pointShadowMap[d]=x,t.pointShadowMatrix[d]=b.shadow.matrix,t.point[d]=S,d++}else if(b.isHemisphereLight){var S;(S=e.get(b)).direction.setFromMatrixPosition(b.matrixWorld),S.direction.transformDirection(g),S.direction.normalize(),S.skyColor.copy(b.color).multiplyScalar(A),S.groundColor.copy(b.groundColor).multiplyScalar(A),t.hemi[m]=S,m++}}t.ambient[0]=c,t.ambient[1]=l,t.ambient[2]=u,t.directional.length=h,t.spot.length=p,t.rectArea.length=f,t.point.length=d,t.hemi.length=m,t.hash=t.id+","+h+","+d+","+p+","+f+","+m+","+o.length},state:t}}function wn(){var e=new bn,t=[],n=[],r=[];return{init:function(){t.length=0,n.length=0,r.length=0},state:{lightsArray:t,shadowsArray:n,spritesArray:r,lights:e},setupLights:function(r){e.setup(t,n,r)},pushLight:function(e){t.push(e)},pushShadow:function(e){n.push(e)},pushSprite:function(e){r.push(e)}}}function An(){var e={};return{get:function(t,n){var r=t.id+","+n.id,i=e[r];return void 0===i&&(i=new wn,e[r]=i),i},dispose:function(){e={}}}}function En(e){console.log("THREE.WebGLRenderer","90");var t=void 0!==(e=e||{}).canvas?e.canvas:document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),n=void 0!==e.context?e.context:null,r=void 0!==e.alpha&&e.alpha,i=void 0===e.depth||e.depth,a=void 0===e.stencil||e.stencil,o=void 0!==e.antialias&&e.antialias,s=void 0===e.premultipliedAlpha||e.premultipliedAlpha,c=void 0!==e.preserveDrawingBuffer&&e.preserveDrawingBuffer,l=void 0!==e.powerPreference?e.powerPreference:"default",u=null,h=null;this.domElement=t,this.context=null,this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.gammaInput=!1,this.gammaOutput=!1,this.physicallyCorrectLights=!1,this.toneMapping=1,this.toneMappingExposure=1,this.toneMappingWhitePoint=1,this.maxMorphTargets=8,this.maxMorphNormals=4;var d,p,f,g,v,w,A,E,_,S,T,R,k,C,O,P,I,N,L=this,D=!1,F=null,j=null,U=-1,B="",V=null,z=null,H=new x,G=new x,q=null,W=0,J=t.width,Z=t.height,X=1,Y=new x(0,0,J,Z),K=new x(0,0,J,Z),Q=!1,$=new Le,ee=new sn,te=!1,ne=!1,re=new y,ie=new b,ae={geometries:0,textures:0},oe={frame:0,calls:0,vertices:0,faces:0,points:0};function se(){return null===F?X:1}this.info={render:oe,memory:ae,programs:null,autoReset:!0,reset:function(){oe.frame++,oe.calls=0,oe.vertices=0,oe.faces=0,oe.points=0}};try{var ce={alpha:r,depth:i,stencil:a,antialias:o,premultipliedAlpha:s,preserveDrawingBuffer:c,powerPreference:l};if(t.addEventListener("webglcontextlost",pe,!1),t.addEventListener("webglcontextrestored",fe,!1),null===(d=n||t.getContext("webgl",ce)||t.getContext("experimental-webgl",ce)))throw null!==t.getContext("webgl")?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.");void 0===d.getShaderPrecisionFormat&&(d.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(e){console.error("THREE.WebGLRenderer: "+e.message)}function le(){(p=new on(d)).get("WEBGL_depth_texture"),p.get("OES_texture_float"),p.get("OES_texture_float_linear"),p.get("OES_texture_half_float"),p.get("OES_texture_half_float_linear"),p.get("OES_standard_derivatives"),p.get("OES_element_index_uint"),p.get("ANGLE_instanced_arrays"),N=new cn(d,p),f=new tn(d,p,e),(g=new en(d,p,N)).scissor(G.copy(K).multiplyScalar(X)),g.viewport(H.copy(Y).multiplyScalar(X)),v=new $t,w=new Qt(d,p,g,v,f,N,ae,oe),A=new Fe(d),E=new jt(d,A,ae),_=new Ut(E,oe),C=new Lt(d),S=new Kt(L,p,f),T=new It,R=new An,k=new kt(L,g,E,s),O=new Ft(d,p,oe),P=new Dt(d,p,oe),I=new we(L,d,g,w,f),L.info.programs=S.programs,L.context=d,L.capabilities=f,L.extensions=p,L.properties=v,L.renderLists=T,L.state=g}le();var ue=new an(L);this.vr=ue;var he=new De(L,_,f.maxTextureSize);function pe(e){e.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),D=!0}function fe(){console.log("THREE.WebGLRenderer: Context Restored."),D=!1,le()}function ye(e){var t=e.target;t.removeEventListener("dispose",ye),function(e){be(e),v.remove(e)}(t)}function be(e){var t=v.get(e).program;e.program=void 0,void 0!==t&&S.releaseProgram(t)}this.shadowMap=he,this.getContext=function(){return d},this.getContextAttributes=function(){return d.getContextAttributes()},this.forceContextLoss=function(){var e=p.get("WEBGL_lose_context");e&&e.loseContext()},this.forceContextRestore=function(){var e=p.get("WEBGL_lose_context");e&&e.restoreContext()},this.getPixelRatio=function(){return X},this.setPixelRatio=function(e){void 0!==e&&(X=e,this.setSize(J,Z,!1))},this.getSize=function(){return{width:J,height:Z}},this.setSize=function(e,n,r){var i=ue.getDevice();i&&i.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(J=e,Z=n,t.width=e*X,t.height=n*X,!1!==r&&(t.style.width=e+"px",t.style.height=n+"px"),this.setViewport(0,0,e,n))},this.getDrawingBufferSize=function(){return{width:J*X,height:Z*X}},this.setDrawingBufferSize=function(e,n,r){J=e,Z=n,X=r,t.width=e*r,t.height=n*r,this.setViewport(0,0,e,n)},this.getCurrentViewport=function(){return H},this.setViewport=function(e,t,n,r){Y.set(e,Z-t-r,n,r),g.viewport(H.copy(Y).multiplyScalar(X))},this.setScissor=function(e,t,n,r){K.set(e,Z-t-r,n,r),g.scissor(G.copy(K).multiplyScalar(X))},this.setScissorTest=function(e){g.setScissorTest(Q=e)},this.getClearColor=function(){return k.getClearColor()},this.setClearColor=function(){k.setClearColor.apply(k,arguments)},this.getClearAlpha=function(){return k.getClearAlpha()},this.setClearAlpha=function(){k.setClearAlpha.apply(k,arguments)},this.clear=function(e,t,n){var r=0;(void 0===e||e)&&(r|=d.COLOR_BUFFER_BIT),(void 0===t||t)&&(r|=d.DEPTH_BUFFER_BIT),(void 0===n||n)&&(r|=d.STENCIL_BUFFER_BIT),d.clear(r)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.clearTarget=function(e,t,n,r){this.setRenderTarget(e),this.clear(t,n,r)},this.dispose=function(){t.removeEventListener("webglcontextlost",pe,!1),t.removeEventListener("webglcontextrestored",fe,!1),T.dispose(),R.dispose(),v.dispose(),_.dispose(),ue.dispose(),_e()},this.renderBufferImmediate=function(e,t,n){g.initAttributes();var r=v.get(e);e.hasPositions&&!r.position&&(r.position=d.createBuffer()),e.hasNormals&&!r.normal&&(r.normal=d.createBuffer()),e.hasUvs&&!r.uv&&(r.uv=d.createBuffer()),e.hasColors&&!r.color&&(r.color=d.createBuffer());var i=t.getAttributes();if(e.hasPositions&&(d.bindBuffer(d.ARRAY_BUFFER,r.position),d.bufferData(d.ARRAY_BUFFER,e.positionArray,d.DYNAMIC_DRAW),g.enableAttribute(i.position),d.vertexAttribPointer(i.position,3,d.FLOAT,!1,0,0)),e.hasNormals){if(d.bindBuffer(d.ARRAY_BUFFER,r.normal),!n.isMeshPhongMaterial&&!n.isMeshStandardMaterial&&!n.isMeshNormalMaterial&&!0===n.flatShading)for(var a=0,o=3*e.count;a<o;a+=9){var s=e.normalArray,c=(s[a+0]+s[a+3]+s[a+6])/3,l=(s[a+1]+s[a+4]+s[a+7])/3,u=(s[a+2]+s[a+5]+s[a+8])/3;s[a+0]=c,s[a+1]=l,s[a+2]=u,s[a+3]=c,s[a+4]=l,s[a+5]=u,s[a+6]=c,s[a+7]=l,s[a+8]=u}d.bufferData(d.ARRAY_BUFFER,e.normalArray,d.DYNAMIC_DRAW),g.enableAttribute(i.normal),d.vertexAttribPointer(i.normal,3,d.FLOAT,!1,0,0)}e.hasUvs&&n.map&&(d.bindBuffer(d.ARRAY_BUFFER,r.uv),d.bufferData(d.ARRAY_BUFFER,e.uvArray,d.DYNAMIC_DRAW),g.enableAttribute(i.uv),d.vertexAttribPointer(i.uv,2,d.FLOAT,!1,0,0)),e.hasColors&&0!==n.vertexColors&&(d.bindBuffer(d.ARRAY_BUFFER,r.color),d.bufferData(d.ARRAY_BUFFER,e.colorArray,d.DYNAMIC_DRAW),g.enableAttribute(i.color),d.vertexAttribPointer(i.color,3,d.FLOAT,!1,0,0)),g.disableUnusedAttributes(),d.drawArrays(d.TRIANGLES,0,e.count),e.count=0},this.renderBufferDirect=function(e,t,n,r,i,a){var o=i.isMesh&&i.matrixWorld.determinant()<0;g.setMaterial(r,o);var s=Ce(e,t,r,i),c=n.id+"_"+s.id+"_"+(!0===r.wireframe),l=!1;c!==B&&(B=c,l=!0),i.morphTargetInfluences&&(C.update(i,n,r,s),l=!0);var u,h=n.index,f=n.attributes.position,m=1;!0===r.wireframe&&(h=E.getWireframeAttribute(n),m=2);var y=O;null!==h&&(u=A.get(h),(y=P).setIndex(u)),l&&(!function(e,t,n,r){if(n&&n.isInstancedBufferGeometry&&null===p.get("ANGLE_instanced_arrays"))return void console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");void 0===r&&(r=0);g.initAttributes();var i=n.attributes,a=t.getAttributes(),o=e.defaultAttributeValues;for(var s in a){var c=a[s];if(c>=0){var l=i[s];if(void 0!==l){var u=l.normalized,h=l.itemSize,f=A.get(l);if(void 0===f)continue;var m=f.buffer,y=f.type,v=f.bytesPerElement;if(l.isInterleavedBufferAttribute){var b=l.data,w=b.stride,E=l.offset;b&&b.isInstancedInterleavedBuffer?(g.enableAttributeAndDivisor(c,b.meshPerAttribute),void 0===n.maxInstancedCount&&(n.maxInstancedCount=b.meshPerAttribute*b.count)):g.enableAttribute(c),d.bindBuffer(d.ARRAY_BUFFER,m),d.vertexAttribPointer(c,h,y,u,w*v,(r*w+E)*v)}else l.isInstancedBufferAttribute?(g.enableAttributeAndDivisor(c,l.meshPerAttribute),void 0===n.maxInstancedCount&&(n.maxInstancedCount=l.meshPerAttribute*l.count)):g.enableAttribute(c),d.bindBuffer(d.ARRAY_BUFFER,m),d.vertexAttribPointer(c,h,y,u,0,r*h*v)}else if(void 0!==o){var x=o[s];if(void 0!==x)switch(x.length){case 2:d.vertexAttrib2fv(c,x);break;case 3:d.vertexAttrib3fv(c,x);break;case 4:d.vertexAttrib4fv(c,x);break;default:d.vertexAttrib1fv(c,x)}}}}g.disableUnusedAttributes()}(r,s,n),null!==h&&d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,u.buffer));var v=1/0;null!==h?v=h.count:void 0!==f&&(v=f.count);var b=n.drawRange.start*m,w=n.drawRange.count*m,x=null!==a?a.start*m:0,_=null!==a?a.count*m:1/0,S=Math.max(b,x),M=Math.min(v,b+w,x+_)-1,T=Math.max(0,M-S+1);if(0!==T){if(i.isMesh)if(!0===r.wireframe)g.setLineWidth(r.wireframeLinewidth*se()),y.setMode(d.LINES);else switch(i.drawMode){case 0:y.setMode(d.TRIANGLES);break;case 1:y.setMode(d.TRIANGLE_STRIP);break;case 2:y.setMode(d.TRIANGLE_FAN)}else if(i.isLine){var R=r.linewidth;void 0===R&&(R=1),g.setLineWidth(R*se()),i.isLineSegments?y.setMode(d.LINES):i.isLineLoop?y.setMode(d.LINE_LOOP):y.setMode(d.LINE_STRIP)}else i.isPoints&&y.setMode(d.POINTS);n&&n.isInstancedBufferGeometry?n.maxInstancedCount>0&&y.renderInstances(n,S,T):y.render(S,T)}},this.compile=function(e,t){(h=R.get(e,t)).init(),e.traverse((function(e){e.isLight&&(h.pushLight(e),e.castShadow&&h.pushShadow(e))})),h.setupLights(t),e.traverse((function(t){if(t.material)if(Array.isArray(t.material))for(var n=0;n<t.material.length;n++)ke(t.material[n],e.fog,t);else ke(t.material,e.fog,t)}))};var Ae,Ee=!1,xe=null;function _e(){Ee=!1}function Se(){var e=ue.getDevice();e&&e.isPresenting?e.requestAnimationFrame(Me):window.requestAnimationFrame(Me)}function Me(e){!1!==Ee&&(xe(e),Se())}function Te(e,t,n,r){for(var i=0,a=e.length;i<a;i++){var o=e[i],s=o.object,c=o.geometry,l=void 0===r?o.material:r,u=o.group;if(n.isArrayCamera){z=n;for(var h=n.cameras,d=0,p=h.length;d<p;d++){var f=h[d];if(s.layers.test(f.layers)){var m=f.bounds,y=m.x*J,v=m.y*Z,b=m.z*J,w=m.w*Z;g.viewport(H.set(y,v,b,w).multiplyScalar(X)),Re(s,t,f,c,l,u)}}}else z=null,Re(s,t,n,c,l,u)}}function Re(e,t,n,r,i,a){if(e.onBeforeRender(L,t,n,r,i,a),h=R.get(t,z||n),e.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,e.matrixWorld),e.normalMatrix.getNormalMatrix(e.modelViewMatrix),e.isImmediateRenderObject){var o=e.isMesh&&e.matrixWorld.determinant()<0;g.setMaterial(i,o);var s=Ce(n,t.fog,i,e);B="",function(e,t,n){e.render((function(e){L.renderBufferImmediate(e,t,n)}))}(e,s,i)}else L.renderBufferDirect(n,t.fog,r,i,e,a);e.onAfterRender(L,t,n,r,i,a),h=R.get(t,z||n)}function ke(e,t,n){var r=v.get(e),i=h.state.lights,a=h.state.shadowsArray,o=S.getParameters(e,i.state,a,t,ee.numPlanes,ee.numIntersection,n),s=S.getProgramCode(e,o),c=r.program,l=!0;if(void 0===c)e.addEventListener("dispose",ye);else if(c.code!==s)be(e);else if(r.lightsHash!==i.state.hash)v.update(e,"lightsHash",i.state.hash),l=!1;else{if(void 0!==o.shaderID)return;l=!1}if(l){if(o.shaderID){var u=ve[o.shaderID];r.shader={name:e.type,uniforms:ge.clone(u.uniforms),vertexShader:u.vertexShader,fragmentShader:u.fragmentShader}}else r.shader={name:e.type,uniforms:e.uniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader};e.onBeforeCompile(r.shader),c=S.acquireProgram(e,r.shader,o,s),r.program=c,e.program=c}var d=c.getAttributes();if(e.morphTargets){e.numSupportedMorphTargets=0;for(var p=0;p<L.maxMorphTargets;p++)d["morphTarget"+p]>=0&&e.numSupportedMorphTargets++}if(e.morphNormals){e.numSupportedMorphNormals=0;for(p=0;p<L.maxMorphNormals;p++)d["morphNormal"+p]>=0&&e.numSupportedMorphNormals++}var f=r.shader.uniforms;(e.isShaderMaterial||e.isRawShaderMaterial)&&!0!==e.clipping||(r.numClippingPlanes=ee.numPlanes,r.numIntersection=ee.numIntersection,f.clippingPlanes=ee.uniform),r.fog=t,r.lightsHash=i.state.hash,e.lights&&(f.ambientLightColor.value=i.state.ambient,f.directionalLights.value=i.state.directional,f.spotLights.value=i.state.spot,f.rectAreaLights.value=i.state.rectArea,f.pointLights.value=i.state.point,f.hemisphereLights.value=i.state.hemi,f.directionalShadowMap.value=i.state.directionalShadowMap,f.directionalShadowMatrix.value=i.state.directionalShadowMatrix,f.spotShadowMap.value=i.state.spotShadowMap,f.spotShadowMatrix.value=i.state.spotShadowMatrix,f.pointShadowMap.value=i.state.pointShadowMap,f.pointShadowMatrix.value=i.state.pointShadowMatrix);var m=r.program.getUniforms(),g=de.seqWithValue(m.seq,f);r.uniformsList=g}function Ce(e,t,n,r){W=0;var i=v.get(n),a=h.state.lights;if(te&&(ne||e!==V)){var o=e===V&&n.id===U;ee.setState(n.clippingPlanes,n.clipIntersection,n.clipShadows,e,i,o)}!1===n.needsUpdate&&(void 0===i.program||n.fog&&i.fog!==t||n.lights&&i.lightsHash!==a.state.hash?n.needsUpdate=!0:void 0===i.numClippingPlanes||i.numClippingPlanes===ee.numPlanes&&i.numIntersection===ee.numIntersection||(n.needsUpdate=!0)),n.needsUpdate&&(ke(n,t,r),n.needsUpdate=!1);var s,c,l=!1,u=!1,p=!1,y=i.program,b=y.getUniforms(),w=i.shader.uniforms;if(g.useProgram(y.program)&&(l=!0,u=!0,p=!0),n.id!==U&&(U=n.id,u=!0),l||e!==V){if(b.setValue(d,"projectionMatrix",e.projectionMatrix),f.logarithmicDepthBuffer&&b.setValue(d,"logDepthBufFC",2/(Math.log(e.far+1)/Math.LN2)),V!==(z||e)&&(V=z||e,u=!0,p=!0),n.isShaderMaterial||n.isMeshPhongMaterial||n.isMeshStandardMaterial||n.envMap){var A=b.map.cameraPosition;void 0!==A&&A.setValue(d,ie.setFromMatrixPosition(e.matrixWorld))}(n.isMeshPhongMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial||n.skinning)&&b.setValue(d,"viewMatrix",e.matrixWorldInverse)}if(n.skinning){b.setOptional(d,r,"bindMatrix"),b.setOptional(d,r,"bindMatrixInverse");var E=r.skeleton;if(E){var x=E.bones;if(f.floatVertexTextures){if(void 0===E.boneTexture){var _=Math.sqrt(4*x.length);_=m.ceilPowerOfTwo(_),_=Math.max(_,4);var S=new Float32Array(_*_*4);S.set(E.boneMatrices);var T=new M(S,_,_,1023,1015);T.needsUpdate=!0,E.boneMatrices=S,E.boneTexture=T,E.boneTextureSize=_}b.setValue(d,"boneTexture",E.boneTexture),b.setValue(d,"boneTextureSize",E.boneTextureSize)}else b.setOptional(d,E,"boneMatrices")}}return u&&(b.setValue(d,"toneMappingExposure",L.toneMappingExposure),b.setValue(d,"toneMappingWhitePoint",L.toneMappingWhitePoint),n.lights&&(c=p,(s=w).ambientLightColor.needsUpdate=c,s.directionalLights.needsUpdate=c,s.pointLights.needsUpdate=c,s.spotLights.needsUpdate=c,s.rectAreaLights.needsUpdate=c,s.hemisphereLights.needsUpdate=c),t&&n.fog&&function(e,t){e.fogColor.value=t.color,t.isFog?(e.fogNear.value=t.near,e.fogFar.value=t.far):t.isFogExp2&&(e.fogDensity.value=t.density)}(w,t),n.isMeshBasicMaterial?Oe(w,n):n.isMeshLambertMaterial?(Oe(w,n),function(e,t){t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap)}(w,n)):n.isMeshPhongMaterial?(Oe(w,n),n.isMeshToonMaterial?function(e,t){Pe(e,t),t.gradientMap&&(e.gradientMap.value=t.gradientMap)}(w,n):Pe(w,n)):n.isMeshStandardMaterial?(Oe(w,n),n.isMeshPhysicalMaterial?function(e,t){e.clearCoat.value=t.clearCoat,e.clearCoatRoughness.value=t.clearCoatRoughness,Ie(e,t)}(w,n):Ie(w,n)):n.isMeshDepthMaterial?(Oe(w,n),function(e,t){t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(w,n)):n.isMeshDistanceMaterial?(Oe(w,n),function(e,t){t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias);e.referencePosition.value.copy(t.referencePosition),e.nearDistance.value=t.nearDistance,e.farDistance.value=t.farDistance}(w,n)):n.isMeshNormalMaterial?(Oe(w,n),function(e,t){t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale);t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale));t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(w,n)):n.isLineBasicMaterial?(function(e,t){e.diffuse.value=t.color,e.opacity.value=t.opacity}(w,n),n.isLineDashedMaterial&&function(e,t){e.dashSize.value=t.dashSize,e.totalSize.value=t.dashSize+t.gapSize,e.scale.value=t.scale}(w,n)):n.isPointsMaterial?function(e,t){if(e.diffuse.value=t.color,e.opacity.value=t.opacity,e.size.value=t.size*X,e.scale.value=.5*Z,e.map.value=t.map,null!==t.map){if(!0===t.map.matrixAutoUpdate){var n=t.map.offset,r=t.map.repeat,i=t.map.rotation,a=t.map.center;t.map.matrix.setUvTransform(n.x,n.y,r.x,r.y,i,a.x,a.y)}e.uvTransform.value.copy(t.map.matrix)}}(w,n):n.isShadowMaterial&&(w.color.value=n.color,w.opacity.value=n.opacity),void 0!==w.ltc_1&&(w.ltc_1.value=me.LTC_1),void 0!==w.ltc_2&&(w.ltc_2.value=me.LTC_2),de.upload(d,i.uniformsList,w,L)),n.isShaderMaterial&&!0===n.uniformsNeedUpdate&&(de.upload(d,i.uniformsList,w,L),n.uniformsNeedUpdate=!1),b.setValue(d,"modelViewMatrix",r.modelViewMatrix),b.setValue(d,"normalMatrix",r.normalMatrix),b.setValue(d,"modelMatrix",r.matrixWorld),y}function Oe(e,t){var n;if(e.opacity.value=t.opacity,t.color&&(e.diffuse.value=t.color),t.emissive&&e.emissive.value.copy(t.emissive).multiplyScalar(t.emissiveIntensity),t.map&&(e.map.value=t.map),t.alphaMap&&(e.alphaMap.value=t.alphaMap),t.specularMap&&(e.specularMap.value=t.specularMap),t.envMap&&(e.envMap.value=t.envMap,e.flipEnvMap.value=t.envMap&&t.envMap.isCubeTexture?-1:1,e.reflectivity.value=t.reflectivity,e.refractionRatio.value=t.refractionRatio),t.lightMap&&(e.lightMap.value=t.lightMap,e.lightMapIntensity.value=t.lightMapIntensity),t.aoMap&&(e.aoMap.value=t.aoMap,e.aoMapIntensity.value=t.aoMapIntensity),t.map?n=t.map:t.specularMap?n=t.specularMap:t.displacementMap?n=t.displacementMap:t.normalMap?n=t.normalMap:t.bumpMap?n=t.bumpMap:t.roughnessMap?n=t.roughnessMap:t.metalnessMap?n=t.metalnessMap:t.alphaMap?n=t.alphaMap:t.emissiveMap&&(n=t.emissiveMap),void 0!==n){if(n.isWebGLRenderTarget&&(n=n.texture),!0===n.matrixAutoUpdate){var r=n.offset,i=n.repeat,a=n.rotation,o=n.center;n.matrix.setUvTransform(r.x,r.y,i.x,i.y,a,o.x,o.y)}e.uvTransform.value.copy(n.matrix)}}function Pe(e,t){e.specular.value=t.specular,e.shininess.value=Math.max(t.shininess,1e-4),t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap),t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale)),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}function Ie(e,t){e.roughness.value=t.roughness,e.metalness.value=t.metalness,t.roughnessMap&&(e.roughnessMap.value=t.roughnessMap),t.metalnessMap&&(e.metalnessMap.value=t.metalnessMap),t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap),t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale)),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias),t.envMap&&(e.envMapIntensity.value=t.envMapIntensity)}this.animate=function(e){null!==(xe=e)?Ee||(Se(),Ee=!0):_e()},this.render=function(e,t,n,r){if(t&&t.isCamera){if(!D){B="",U=-1,V=null,!0===e.autoUpdate&&e.updateMatrixWorld(),null===t.parent&&t.updateMatrixWorld(),ue.enabled&&(t=ue.getCamera(t)),(h=R.get(e,t)).init(),e.onBeforeRender(L,e,t,n),re.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),$.setFromMatrix(re),ne=this.localClippingEnabled,te=ee.init(this.clippingPlanes,ne,t),(u=T.get(e,t)).init(),function e(t,n,r){if(!1===t.visible)return;if(t.layers.test(n.layers))if(t.isLight)h.pushLight(t),t.castShadow&&h.pushShadow(t);else if(t.isSprite)t.frustumCulled&&!$.intersectsSprite(t)||h.pushSprite(t);else if(t.isImmediateRenderObject)r&&ie.setFromMatrixPosition(t.matrixWorld).applyMatrix4(re),u.push(t,null,t.material,ie.z,null);else if((t.isMesh||t.isLine||t.isPoints)&&(t.isSkinnedMesh&&t.skeleton.update(),!t.frustumCulled||$.intersectsObject(t))){r&&ie.setFromMatrixPosition(t.matrixWorld).applyMatrix4(re);var i=_.update(t),a=t.material;if(Array.isArray(a))for(var o=i.groups,s=0,c=o.length;s<c;s++){var l=o[s],d=a[l.materialIndex];d&&d.visible&&u.push(t,i,d,ie.z,l)}else a.visible&&u.push(t,i,a,ie.z,null)}var p=t.children;for(s=0,c=p.length;s<c;s++)e(p[s],n,r)}(e,t,L.sortObjects),!0===L.sortObjects&&u.sort(),te&&ee.beginShadows();var i=h.state.shadowsArray;he.render(i,e,t),h.setupLights(t),te&&ee.endShadows(),this.info.autoReset&&this.info.reset(),void 0===n&&(n=null),this.setRenderTarget(n),k.render(u,e,t,r);var a=u.opaque,o=u.transparent;if(e.overrideMaterial){var s=e.overrideMaterial;a.length&&Te(a,e,t,s),o.length&&Te(o,e,t,s)}else a.length&&Te(a,e,t),o.length&&Te(o,e,t);var c=h.state.spritesArray;I.render(c,e,t),n&&w.updateRenderTargetMipmap(n),g.buffers.depth.setTest(!0),g.buffers.depth.setMask(!0),g.buffers.color.setMask(!0),g.setPolygonOffset(!1),e.onAfterRender(L,e,t),ue.enabled&&ue.submitFrame(),u=null,h=null}}else console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")},this.allocTextureUnit=function(){var e=W;return e>=f.maxTextures&&console.warn("THREE.WebGLRenderer: Trying to use "+e+" texture units while this GPU supports only "+f.maxTextures),W+=1,e},this.setTexture2D=(Ae=!1,function(e,t){e&&e.isWebGLRenderTarget&&(Ae||(console.warn("THREE.WebGLRenderer.setTexture2D: don't use render targets as textures. Use their .texture property instead."),Ae=!0),e=e.texture),w.setTexture2D(e,t)}),this.setTexture=function(){var e=!1;return function(t,n){e||(console.warn("THREE.WebGLRenderer: .setTexture is deprecated, use setTexture2D instead."),e=!0),w.setTexture2D(t,n)}}(),this.setTextureCube=function(){var e=!1;return function(t,n){t&&t.isWebGLRenderTargetCube&&(e||(console.warn("THREE.WebGLRenderer.setTextureCube: don't use cube render targets as textures. Use their .texture property instead."),e=!0),t=t.texture),t&&t.isCubeTexture||Array.isArray(t.image)&&6===t.image.length?w.setTextureCube(t,n):w.setTextureCubeDynamic(t,n)}}(),this.getRenderTarget=function(){return F},this.setRenderTarget=function(e){F=e,e&&void 0===v.get(e).__webglFramebuffer&&w.setupRenderTarget(e);var t=null,n=!1;if(e){var r=v.get(e).__webglFramebuffer;e.isWebGLRenderTargetCube?(t=r[e.activeCubeFace],n=!0):t=r,H.copy(e.viewport),G.copy(e.scissor),q=e.scissorTest}else H.copy(Y).multiplyScalar(X),G.copy(K).multiplyScalar(X),q=Q;if(j!==t&&(d.bindFramebuffer(d.FRAMEBUFFER,t),j=t),g.viewport(H),g.scissor(G),g.setScissorTest(q),n){var i=v.get(e.texture);d.framebufferTexture2D(d.FRAMEBUFFER,d.COLOR_ATTACHMENT0,d.TEXTURE_CUBE_MAP_POSITIVE_X+e.activeCubeFace,i.__webglTexture,e.activeMipMapLevel)}},this.readRenderTargetPixels=function(e,t,n,r,i,a){if(e&&e.isWebGLRenderTarget){var o=v.get(e).__webglFramebuffer;if(o){var s=!1;o!==j&&(d.bindFramebuffer(d.FRAMEBUFFER,o),s=!0);try{var c=e.texture,l=c.format,u=c.type;if(1023!==l&&N.convert(l)!==d.getParameter(d.IMPLEMENTATION_COLOR_READ_FORMAT))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(!(1009===u||N.convert(u)===d.getParameter(d.IMPLEMENTATION_COLOR_READ_TYPE)||1015===u&&(p.get("OES_texture_float")||p.get("WEBGL_color_buffer_float"))||1016===u&&p.get("EXT_color_buffer_half_float")))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");d.checkFramebufferStatus(d.FRAMEBUFFER)===d.FRAMEBUFFER_COMPLETE?t>=0&&t<=e.width-r&&n>=0&&n<=e.height-i&&d.readPixels(t,n,r,i,N.convert(l),N.convert(u),a):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{s&&d.bindFramebuffer(d.FRAMEBUFFER,j)}}}else console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")},this.copyFramebufferToTexture=function(e,t,n){var r=t.image.width,i=t.image.height,a=N.convert(t.format);this.setTexture2D(t,0),d.copyTexImage2D(d.TEXTURE_2D,n||0,a,e.x,e.y,r,i,0)}}function xn(e,t){this.name="",this.color=new fe(e),this.density=void 0!==t?t:25e-5}function _n(e,t,n){this.name="",this.color=new fe(e),this.near=void 0!==t?t:1,this.far=void 0!==n?n:1e3}function Sn(){qe.call(this),this.type="Scene",this.background=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0}function Mn(e){ke.call(this),this.type="SpriteMaterial",this.color=new fe(16777215),this.map=null,this.rotation=0,this.fog=!1,this.lights=!1,this.setValues(e)}function Tn(e){qe.call(this),this.type="Sprite",this.material=void 0!==e?e:new Mn,this.center=new g(.5,.5)}function Rn(){qe.call(this),this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}})}function kn(e,t){if(e=e||[],this.bones=e.slice(0),this.boneMatrices=new Float32Array(16*this.bones.length),void 0===t)this.calculateInverses();else if(this.bones.length===t.length)this.boneInverses=t.slice(0);else{console.warn("THREE.Skeleton boneInverses is the wrong length."),this.boneInverses=[];for(var n=0,r=this.bones.length;n<r;n++)this.boneInverses.push(new y)}}function Cn(){qe.call(this),this.type="Bone"}function On(e,t){Rt.call(this,e,t),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new y,this.bindMatrixInverse=new y;var n=new kn(this.initBones());this.bind(n,this.matrixWorld),this.normalizeSkinWeights()}function Pn(e){ke.call(this),this.type="LineBasicMaterial",this.color=new fe(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.lights=!1,this.setValues(e)}function In(e,t,n){if(1===n)return console.warn("THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead."),new Nn(e,t);qe.call(this),this.type="Line",this.geometry=void 0!==e?e:new vt,this.material=void 0!==t?t:new Pn({color:16777215*Math.random()})}function Nn(e,t){In.call(this,e,t),this.type="LineSegments"}function Ln(e,t){In.call(this,e,t),this.type="LineLoop"}function Dn(e){ke.call(this),this.type="PointsMaterial",this.color=new fe(16777215),this.map=null,this.size=1,this.sizeAttenuation=!0,this.lights=!1,this.setValues(e)}function Fn(e,t){qe.call(this),this.type="Points",this.geometry=void 0!==e?e:new vt,this.material=void 0!==t?t:new Dn({color:16777215*Math.random()})}function jn(){qe.call(this),this.type="Group"}function Un(e,t,n,r,i,a,o,s,c){E.call(this,e,t,n,r,i,a,o,s,c),this.generateMipmaps=!1}function Bn(e,t,n,r,i,a,o,s,c,l,u,h){E.call(this,null,a,o,s,c,l,r,i,u,h),this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}function Vn(e,t,n,r,i,a,o,s,c,l){if(1026!==(l=void 0!==l?l:1026)&&1027!==l)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&1026===l&&(n=1012),void 0===n&&1027===l&&(n=1020),E.call(this,null,r,i,a,o,s,l,n,c),this.image={width:e,height:t},this.magFilter=void 0!==o?o:1003,this.minFilter=void 0!==s?s:1003,this.flipY=!1,this.generateMipmaps=!1}function zn(e){vt.call(this),this.type="WireframeGeometry";var t,n,r,i,a,o,s,c,l,u,h=[],d=[0,0],p={},f=["a","b","c"];if(e&&e.isGeometry){var m=e.faces;for(t=0,r=m.length;t<r;t++){var g=m[t];for(n=0;n<3;n++)s=g[f[n]],c=g[f[(n+1)%3]],d[0]=Math.min(s,c),d[1]=Math.max(s,c),void 0===p[l=d[0]+","+d[1]]&&(p[l]={index1:d[0],index2:d[1]})}for(l in p)o=p[l],u=e.vertices[o.index1],h.push(u.x,u.y,u.z),u=e.vertices[o.index2],h.push(u.x,u.y,u.z)}else if(e&&e.isBufferGeometry){var y,v,w,A,E,x,_;if(u=new b,null!==e.index){for(y=e.attributes.position,v=e.index,0===(w=e.groups).length&&(w=[{start:0,count:v.count,materialIndex:0}]),i=0,a=w.length;i<a;++i)for(t=E=(A=w[i]).start,r=E+A.count;t<r;t+=3)for(n=0;n<3;n++)s=v.getX(t+n),c=v.getX(t+(n+1)%3),d[0]=Math.min(s,c),d[1]=Math.max(s,c),void 0===p[l=d[0]+","+d[1]]&&(p[l]={index1:d[0],index2:d[1]});for(l in p)o=p[l],u.fromBufferAttribute(y,o.index1),h.push(u.x,u.y,u.z),u.fromBufferAttribute(y,o.index2),h.push(u.x,u.y,u.z)}else for(t=0,r=(y=e.attributes.position).count/3;t<r;t++)for(n=0;n<3;n++)x=3*t+n,u.fromBufferAttribute(y,x),h.push(u.x,u.y,u.z),_=3*t+(n+1)%3,u.fromBufferAttribute(y,_),h.push(u.x,u.y,u.z)}this.addAttribute("position",new ot(h,3))}function Hn(e,t,n){Ke.call(this),this.type="ParametricGeometry",this.parameters={func:e,slices:t,stacks:n},this.fromBufferGeometry(new Gn(e,t,n)),this.mergeVertices()}function Gn(e,t,n){vt.call(this),this.type="ParametricBufferGeometry",this.parameters={func:e,slices:t,stacks:n};var r,i,a=[],o=[],s=[],c=[],l=1e-5,u=new b,h=new b,d=new b,p=new b,f=new b,m=t+1;for(r=0;r<=n;r++){var g=r/n;for(i=0;i<=t;i++){var y=i/t;h=e(y,g,h),o.push(h.x,h.y,h.z),y-l>=0?(d=e(y-l,g,d),p.subVectors(h,d)):(d=e(y+l,g,d),p.subVectors(d,h)),g-l>=0?(d=e(y,g-l,d),f.subVectors(h,d)):(d=e(y,g+l,d),f.subVectors(d,h)),u.crossVectors(p,f).normalize(),s.push(u.x,u.y,u.z),c.push(y,g)}}for(r=0;r<n;r++)for(i=0;i<t;i++){var v=r*m+i,w=r*m+i+1,A=(r+1)*m+i+1,E=(r+1)*m+i;a.push(v,w,E),a.push(w,A,E)}this.setIndex(a),this.addAttribute("position",new ot(o,3)),this.addAttribute("normal",new ot(s,3)),this.addAttribute("uv",new ot(c,2))}function qn(e,t,n,r){Ke.call(this),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:n,detail:r},this.fromBufferGeometry(new Wn(e,t,n,r)),this.mergeVertices()}function Wn(e,t,n,r){vt.call(this),this.type="PolyhedronBufferGeometry",this.parameters={vertices:e,indices:t,radius:n,detail:r},n=n||1;var i=[],a=[];function o(e,t,n,r){var i,a,o=Math.pow(2,r),c=[];for(i=0;i<=o;i++){c[i]=[];var l=e.clone().lerp(n,i/o),u=t.clone().lerp(n,i/o),h=o-i;for(a=0;a<=h;a++)c[i][a]=0===a&&i===o?l:l.clone().lerp(u,a/h)}for(i=0;i<o;i++)for(a=0;a<2*(o-i)-1;a++){var d=Math.floor(a/2);a%2==0?(s(c[i][d+1]),s(c[i+1][d]),s(c[i][d])):(s(c[i][d+1]),s(c[i+1][d+1]),s(c[i+1][d]))}}function s(e){i.push(e.x,e.y,e.z)}function c(t,n){var r=3*t;n.x=e[r+0],n.y=e[r+1],n.z=e[r+2]}function l(e,t,n,r){r<0&&1===e.x&&(a[t]=e.x-1),0===n.x&&0===n.z&&(a[t]=r/2/Math.PI+.5)}function u(e){return Math.atan2(e.z,-e.x)}function h(e){return Math.atan2(-e.y,Math.sqrt(e.x*e.x+e.z*e.z))}!function(e){for(var n=new b,r=new b,i=new b,a=0;a<t.length;a+=3)c(t[a+0],n),c(t[a+1],r),c(t[a+2],i),o(n,r,i,e)}(r=r||0),function(e){for(var t=new b,n=0;n<i.length;n+=3)t.x=i[n+0],t.y=i[n+1],t.z=i[n+2],t.normalize().multiplyScalar(e),i[n+0]=t.x,i[n+1]=t.y,i[n+2]=t.z}(n),function(){for(var e=new b,t=0;t<i.length;t+=3){e.x=i[t+0],e.y=i[t+1],e.z=i[t+2];var n=u(e)/2/Math.PI+.5,r=h(e)/Math.PI+.5;a.push(n,1-r)}(function(){for(var e=new b,t=new b,n=new b,r=new b,o=new g,s=new g,c=new g,h=0,d=0;h<i.length;h+=9,d+=6){e.set(i[h+0],i[h+1],i[h+2]),t.set(i[h+3],i[h+4],i[h+5]),n.set(i[h+6],i[h+7],i[h+8]),o.set(a[d+0],a[d+1]),s.set(a[d+2],a[d+3]),c.set(a[d+4],a[d+5]),r.copy(e).add(t).add(n).divideScalar(3);var p=u(r);l(o,d+0,e,p),l(s,d+2,t,p),l(c,d+4,n,p)}})(),function(){for(var e=0;e<a.length;e+=6){var t=a[e+0],n=a[e+2],r=a[e+4],i=Math.max(t,n,r),o=Math.min(t,n,r);i>.9&&o<.1&&(t<.2&&(a[e+0]+=1),n<.2&&(a[e+2]+=1),r<.2&&(a[e+4]+=1))}}()}(),this.addAttribute("position",new ot(i,3)),this.addAttribute("normal",new ot(i.slice(),3)),this.addAttribute("uv",new ot(a,2)),0===r?this.computeVertexNormals():this.normalizeNormals()}function Jn(e,t){Ke.call(this),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new Zn(e,t)),this.mergeVertices()}function Zn(e,t){Wn.call(this,[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],e,t),this.type="TetrahedronBufferGeometry",this.parameters={radius:e,detail:t}}function Xn(e,t){Ke.call(this),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new Yn(e,t)),this.mergeVertices()}function Yn(e,t){Wn.call(this,[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],e,t),this.type="OctahedronBufferGeometry",this.parameters={radius:e,detail:t}}function Kn(e,t){Ke.call(this),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new Qn(e,t)),this.mergeVertices()}function Qn(e,t){var n=(1+Math.sqrt(5))/2,r=[-1,n,0,1,n,0,-1,-n,0,1,-n,0,0,-1,n,0,1,n,0,-1,-n,0,1,-n,n,0,-1,n,0,1,-n,0,-1,-n,0,1];Wn.call(this,r,[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],e,t),this.type="IcosahedronBufferGeometry",this.parameters={radius:e,detail:t}}function $n(e,t){Ke.call(this),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new er(e,t)),this.mergeVertices()}function er(e,t){var n=(1+Math.sqrt(5))/2,r=1/n,i=[-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,-r,-n,0,-r,n,0,r,-n,0,r,n,-r,-n,0,-r,n,0,r,-n,0,r,n,0,-n,0,-r,n,0,-r,-n,0,r,n,0,r];Wn.call(this,i,[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],e,t),this.type="DodecahedronBufferGeometry",this.parameters={radius:e,detail:t}}function tr(e,t,n,r,i,a){Ke.call(this),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:n,radialSegments:r,closed:i},void 0!==a&&console.warn("THREE.TubeGeometry: taper has been removed.");var o=new nr(e,t,n,r,i);this.tangents=o.tangents,this.normals=o.normals,this.binormals=o.binormals,this.fromBufferGeometry(o),this.mergeVertices()}function nr(e,t,n,r,i){vt.call(this),this.type="TubeBufferGeometry",this.parameters={path:e,tubularSegments:t,radius:n,radialSegments:r,closed:i},t=t||64,n=n||1,r=r||8,i=i||!1;var a=e.computeFrenetFrames(t,i);this.tangents=a.tangents,this.normals=a.normals,this.binormals=a.binormals;var o,s,c=new b,l=new b,u=new g,h=new b,d=[],p=[],f=[],m=[];function y(i){h=e.getPointAt(i/t,h);var o=a.normals[i],u=a.binormals[i];for(s=0;s<=r;s++){var f=s/r*Math.PI*2,m=Math.sin(f),g=-Math.cos(f);l.x=g*o.x+m*u.x,l.y=g*o.y+m*u.y,l.z=g*o.z+m*u.z,l.normalize(),p.push(l.x,l.y,l.z),c.x=h.x+n*l.x,c.y=h.y+n*l.y,c.z=h.z+n*l.z,d.push(c.x,c.y,c.z)}}!function(){for(o=0;o<t;o++)y(o);y(!1===i?t:0),function(){for(o=0;o<=t;o++)for(s=0;s<=r;s++)u.x=o/t,u.y=s/r,f.push(u.x,u.y)}(),function(){for(s=1;s<=t;s++)for(o=1;o<=r;o++){var e=(r+1)*(s-1)+(o-1),n=(r+1)*s+(o-1),i=(r+1)*s+o,a=(r+1)*(s-1)+o;m.push(e,n,a),m.push(n,i,a)}}()}(),this.setIndex(m),this.addAttribute("position",new ot(d,3)),this.addAttribute("normal",new ot(p,3)),this.addAttribute("uv",new ot(f,2))}function rr(e,t,n,r,i,a,o){Ke.call(this),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:t,tubularSegments:n,radialSegments:r,p:i,q:a},void 0!==o&&console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),this.fromBufferGeometry(new ir(e,t,n,r,i,a)),this.mergeVertices()}function ir(e,t,n,r,i,a){vt.call(this),this.type="TorusKnotBufferGeometry",this.parameters={radius:e,tube:t,tubularSegments:n,radialSegments:r,p:i,q:a},e=e||1,t=t||.4,n=Math.floor(n)||64,r=Math.floor(r)||8,i=i||2,a=a||3;var o,s,c=[],l=[],u=[],h=[],d=new b,p=new b,f=new b,m=new b,g=new b,y=new b,v=new b;for(o=0;o<=n;++o){var w=o/n*i*Math.PI*2;for(R(w,i,a,e,f),R(w+.01,i,a,e,m),y.subVectors(m,f),v.addVectors(m,f),g.crossVectors(y,v),v.crossVectors(g,y),g.normalize(),v.normalize(),s=0;s<=r;++s){var A=s/r*Math.PI*2,E=-t*Math.cos(A),x=t*Math.sin(A);d.x=f.x+(E*v.x+x*g.x),d.y=f.y+(E*v.y+x*g.y),d.z=f.z+(E*v.z+x*g.z),l.push(d.x,d.y,d.z),p.subVectors(d,f).normalize(),u.push(p.x,p.y,p.z),h.push(o/n),h.push(s/r)}}for(s=1;s<=n;s++)for(o=1;o<=r;o++){var _=(r+1)*(s-1)+(o-1),S=(r+1)*s+(o-1),M=(r+1)*s+o,T=(r+1)*(s-1)+o;c.push(_,S,T),c.push(S,M,T)}function R(e,t,n,r,i){var a=Math.cos(e),o=Math.sin(e),s=n/t*e,c=Math.cos(s);i.x=r*(2+c)*.5*a,i.y=r*(2+c)*o*.5,i.z=r*Math.sin(s)*.5}this.setIndex(c),this.addAttribute("position",new ot(l,3)),this.addAttribute("normal",new ot(u,3)),this.addAttribute("uv",new ot(h,2))}function ar(e,t,n,r,i){Ke.call(this),this.type="TorusGeometry",this.parameters={radius:e,tube:t,radialSegments:n,tubularSegments:r,arc:i},this.fromBufferGeometry(new or(e,t,n,r,i)),this.mergeVertices()}function or(e,t,n,r,i){vt.call(this),this.type="TorusBufferGeometry",this.parameters={radius:e,tube:t,radialSegments:n,tubularSegments:r,arc:i},e=e||1,t=t||.4,n=Math.floor(n)||8,r=Math.floor(r)||6,i=i||2*Math.PI;var a,o,s=[],c=[],l=[],u=[],h=new b,d=new b,p=new b;for(a=0;a<=n;a++)for(o=0;o<=r;o++){var f=o/r*i,m=a/n*Math.PI*2;d.x=(e+t*Math.cos(m))*Math.cos(f),d.y=(e+t*Math.cos(m))*Math.sin(f),d.z=t*Math.sin(m),c.push(d.x,d.y,d.z),h.x=e*Math.cos(f),h.y=e*Math.sin(f),p.subVectors(d,h).normalize(),l.push(p.x,p.y,p.z),u.push(o/r),u.push(a/n)}for(a=1;a<=n;a++)for(o=1;o<=r;o++){var g=(r+1)*a+o-1,y=(r+1)*(a-1)+o-1,v=(r+1)*(a-1)+o,w=(r+1)*a+o;s.push(g,y,w),s.push(y,v,w)}this.setIndex(s),this.addAttribute("position",new ot(c,3)),this.addAttribute("normal",new ot(l,3)),this.addAttribute("uv",new ot(u,2))}xn.prototype.isFogExp2=!0,xn.prototype.clone=function(){return new xn(this.color.getHex(),this.density)},xn.prototype.toJSON=function(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}},_n.prototype.isFog=!0,_n.prototype.clone=function(){return new _n(this.color.getHex(),this.near,this.far)},_n.prototype.toJSON=function(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}},Sn.prototype=Object.assign(Object.create(qe.prototype),{constructor:Sn,copy:function(e,t){return qe.prototype.copy.call(this,e,t),null!==e.background&&(this.background=e.background.clone()),null!==e.fog&&(this.fog=e.fog.clone()),null!==e.overrideMaterial&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this},toJSON:function(e){var t=qe.prototype.toJSON.call(this,e);return null!==this.background&&(t.object.background=this.background.toJSON(e)),null!==this.fog&&(t.object.fog=this.fog.toJSON()),t}}),Mn.prototype=Object.create(ke.prototype),Mn.prototype.constructor=Mn,Mn.prototype.isSpriteMaterial=!0,Mn.prototype.copy=function(e){return ke.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.rotation=e.rotation,this},Tn.prototype=Object.assign(Object.create(qe.prototype),{constructor:Tn,isSprite:!0,raycast:(un=new b,hn=new b,dn=new b,function(e,t){hn.setFromMatrixPosition(this.matrixWorld),e.ray.closestPointToPoint(hn,un),dn.setFromMatrixScale(this.matrixWorld);var n=dn.x*dn.y/4;if(!(hn.distanceToSquared(un)>n)){var r=e.ray.origin.distanceTo(un);r<e.near||r>e.far||t.push({distance:r,point:un.clone(),face:null,object:this})}}),clone:function(){return new this.constructor(this.material).copy(this)},copy:function(e){return qe.prototype.copy.call(this,e),void 0!==e.center&&this.center.copy(e.center),this}}),Rn.prototype=Object.assign(Object.create(qe.prototype),{constructor:Rn,copy:function(e){qe.prototype.copy.call(this,e,!1);for(var t=e.levels,n=0,r=t.length;n<r;n++){var i=t[n];this.addLevel(i.object.clone(),i.distance)}return this},addLevel:function(e,t){void 0===t&&(t=0),t=Math.abs(t);for(var n=this.levels,r=0;r<n.length&&!(t<n[r].distance);r++);n.splice(r,0,{distance:t,object:e}),this.add(e)},getObjectForDistance:function(e){for(var t=this.levels,n=1,r=t.length;n<r&&!(e<t[n].distance);n++);return t[n-1].object},raycast:(pn=new b,function(e,t){pn.setFromMatrixPosition(this.matrixWorld);var n=e.ray.origin.distanceTo(pn);this.getObjectForDistance(n).raycast(e,t)}),update:function(){var e=new b,t=new b;return function(n){var r=this.levels;if(r.length>1){e.setFromMatrixPosition(n.matrixWorld),t.setFromMatrixPosition(this.matrixWorld);var i=e.distanceTo(t);r[0].object.visible=!0;for(var a=1,o=r.length;a<o&&i>=r[a].distance;a++)r[a-1].object.visible=!1,r[a].object.visible=!0;for(;a<o;a++)r[a].object.visible=!1}}}(),toJSON:function(e){var t=qe.prototype.toJSON.call(this,e);t.object.levels=[];for(var n=this.levels,r=0,i=n.length;r<i;r++){var a=n[r];t.object.levels.push({object:a.object.uuid,distance:a.distance})}return t}}),Object.assign(kn.prototype,{calculateInverses:function(){this.boneInverses=[];for(var e=0,t=this.bones.length;e<t;e++){var n=new y;this.bones[e]&&n.getInverse(this.bones[e].matrixWorld),this.boneInverses.push(n)}},pose:function(){var e,t,n;for(t=0,n=this.bones.length;t<n;t++)(e=this.bones[t])&&e.matrixWorld.getInverse(this.boneInverses[t]);for(t=0,n=this.bones.length;t<n;t++)(e=this.bones[t])&&(e.parent&&e.parent.isBone?(e.matrix.getInverse(e.parent.matrixWorld),e.matrix.multiply(e.matrixWorld)):e.matrix.copy(e.matrixWorld),e.matrix.decompose(e.position,e.quaternion,e.scale))},update:(fn=new y,mn=new y,function(){for(var e=this.bones,t=this.boneInverses,n=this.boneMatrices,r=this.boneTexture,i=0,a=e.length;i<a;i++){var o=e[i]?e[i].matrixWorld:mn;fn.multiplyMatrices(o,t[i]),fn.toArray(n,16*i)}void 0!==r&&(r.needsUpdate=!0)}),clone:function(){return new kn(this.bones,this.boneInverses)},getBoneByName:function(e){for(var t=0,n=this.bones.length;t<n;t++){var r=this.bones[t];if(r.name===e)return r}}}),Cn.prototype=Object.assign(Object.create(qe.prototype),{constructor:Cn,isBone:!0}),On.prototype=Object.assign(Object.create(Rt.prototype),{constructor:On,isSkinnedMesh:!0,initBones:function(){var e,t,n,r,i=[];if(this.geometry&&void 0!==this.geometry.bones){for(n=0,r=this.geometry.bones.length;n<r;n++)t=this.geometry.bones[n],e=new Cn,i.push(e),e.name=t.name,e.position.fromArray(t.pos),e.quaternion.fromArray(t.rotq),void 0!==t.scl&&e.scale.fromArray(t.scl);for(n=0,r=this.geometry.bones.length;n<r;n++)-1!==(t=this.geometry.bones[n]).parent&&null!==t.parent&&void 0!==i[t.parent]?i[t.parent].add(i[n]):this.add(i[n])}return this.updateMatrixWorld(!0),i},bind:function(e,t){this.skeleton=e,void 0===t&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.getInverse(t)},pose:function(){this.skeleton.pose()},normalizeSkinWeights:function(){var e,t;if(this.geometry&&this.geometry.isGeometry)for(t=0;t<this.geometry.skinWeights.length;t++){var n=this.geometry.skinWeights[t];(e=1/n.manhattanLength())!==1/0?n.multiplyScalar(e):n.set(1,0,0,0)}else if(this.geometry&&this.geometry.isBufferGeometry){var r=new x,i=this.geometry.attributes.skinWeight;for(t=0;t<i.count;t++)r.x=i.getX(t),r.y=i.getY(t),r.z=i.getZ(t),r.w=i.getW(t),(e=1/r.manhattanLength())!==1/0?r.multiplyScalar(e):r.set(1,0,0,0),i.setXYZW(t,r.x,r.y,r.z,r.w)}},updateMatrixWorld:function(e){Rt.prototype.updateMatrixWorld.call(this,e),"attached"===this.bindMode?this.bindMatrixInverse.getInverse(this.matrixWorld):"detached"===this.bindMode?this.bindMatrixInverse.getInverse(this.bindMatrix):console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),Pn.prototype=Object.create(ke.prototype),Pn.prototype.constructor=Pn,Pn.prototype.isLineBasicMaterial=!0,Pn.prototype.copy=function(e){return ke.prototype.copy.call(this,e),this.color.copy(e.color),this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this},In.prototype=Object.assign(Object.create(qe.prototype),{constructor:In,isLine:!0,computeLineDistances:(gn=new b,yn=new b,function(){var e=this.geometry;if(e.isBufferGeometry)if(null===e.index){for(var t=e.attributes.position,n=[0],r=1,i=t.count;r<i;r++)gn.fromBufferAttribute(t,r-1),yn.fromBufferAttribute(t,r),n[r]=n[r-1],n[r]+=gn.distanceTo(yn);e.addAttribute("lineDistance",new THREE.Float32BufferAttribute(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(e.isGeometry){var a=e.vertices;for((n=e.lineDistances)[0]=0,r=1,i=a.length;r<i;r++)n[r]=n[r-1],n[r]+=a[r-1].distanceTo(a[r])}return this}),raycast:function(){var e=new y,t=new St,n=new Ie;return function(r,i){var a=r.linePrecision,o=a*a,s=this.geometry,c=this.matrixWorld;if(null===s.boundingSphere&&s.computeBoundingSphere(),n.copy(s.boundingSphere),n.applyMatrix4(c),!1!==r.ray.intersectsSphere(n)){e.getInverse(c),t.copy(r.ray).applyMatrix4(e);var l=new b,u=new b,h=new b,d=new b,p=this&&this.isLineSegments?2:1;if(s.isBufferGeometry){var f=s.index,m=s.attributes.position.array;if(null!==f)for(var g=f.array,y=0,v=g.length-1;y<v;y+=p){var w=g[y],A=g[y+1];if(l.fromArray(m,3*w),u.fromArray(m,3*A),!(t.distanceSqToSegment(l,u,d,h)>o))d.applyMatrix4(this.matrixWorld),(_=r.ray.origin.distanceTo(d))<r.near||_>r.far||i.push({distance:_,point:h.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this})}else for(y=0,v=m.length/3-1;y<v;y+=p){if(l.fromArray(m,3*y),u.fromArray(m,3*y+3),!(t.distanceSqToSegment(l,u,d,h)>o))d.applyMatrix4(this.matrixWorld),(_=r.ray.origin.distanceTo(d))<r.near||_>r.far||i.push({distance:_,point:h.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this})}}else if(s.isGeometry){var E=s.vertices,x=E.length;for(y=0;y<x-1;y+=p){var _;if(!(t.distanceSqToSegment(E[y],E[y+1],d,h)>o))d.applyMatrix4(this.matrixWorld),(_=r.ray.origin.distanceTo(d))<r.near||_>r.far||i.push({distance:_,point:h.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this})}}}}}(),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),Nn.prototype=Object.assign(Object.create(In.prototype),{constructor:Nn,isLineSegments:!0,computeLineDistances:function(){var e=new b,t=new b;return function(){var n=this.geometry;if(n.isBufferGeometry)if(null===n.index){for(var r=n.attributes.position,i=[],a=0,o=r.count;a<o;a+=2)e.fromBufferAttribute(r,a),t.fromBufferAttribute(r,a+1),i[a]=0===a?0:i[a-1],i[a+1]=i[a]+e.distanceTo(t);n.addAttribute("lineDistance",new THREE.Float32BufferAttribute(i,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(n.isGeometry){var s=n.vertices;for(i=n.lineDistances,a=0,o=s.length;a<o;a+=2)e.copy(s[a]),t.copy(s[a+1]),i[a]=0===a?0:i[a-1],i[a+1]=i[a]+e.distanceTo(t)}return this}}()}),Ln.prototype=Object.assign(Object.create(In.prototype),{constructor:Ln,isLineLoop:!0}),Dn.prototype=Object.create(ke.prototype),Dn.prototype.constructor=Dn,Dn.prototype.isPointsMaterial=!0,Dn.prototype.copy=function(e){return ke.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this},Fn.prototype=Object.assign(Object.create(qe.prototype),{constructor:Fn,isPoints:!0,raycast:function(){var e=new y,t=new St,n=new Ie;return function(r,i){var a=this,o=this.geometry,s=this.matrixWorld,c=r.params.Points.threshold;if(null===o.boundingSphere&&o.computeBoundingSphere(),n.copy(o.boundingSphere),n.applyMatrix4(s),n.radius+=c,!1!==r.ray.intersectsSphere(n)){e.getInverse(s),t.copy(r.ray).applyMatrix4(e);var l=c/((this.scale.x+this.scale.y+this.scale.z)/3),u=l*l,h=new b;if(o.isBufferGeometry){var d=o.index,p=o.attributes.position.array;if(null!==d)for(var f=d.array,m=0,g=f.length;m<g;m++){var y=f[m];h.fromArray(p,3*y),A(h,y)}else{m=0;for(var v=p.length/3;m<v;m++)h.fromArray(p,3*m),A(h,m)}}else{var w=o.vertices;for(m=0,v=w.length;m<v;m++)A(w[m],m)}}function A(e,n){var o=t.distanceSqToPoint(e);if(o<u){var c=t.closestPointToPoint(e);c.applyMatrix4(s);var l=r.ray.origin.distanceTo(c);if(l<r.near||l>r.far)return;i.push({distance:l,distanceToRay:Math.sqrt(o),point:c.clone(),index:n,face:null,object:a})}}}}(),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),jn.prototype=Object.assign(Object.create(qe.prototype),{constructor:jn,isGroup:!0}),Un.prototype=Object.assign(Object.create(E.prototype),{constructor:Un,isVideoTexture:!0,update:function(){var e=this.image;e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}),Bn.prototype=Object.create(E.prototype),Bn.prototype.constructor=Bn,Bn.prototype.isCompressedTexture=!0,Vn.prototype=Object.create(E.prototype),Vn.prototype.constructor=Vn,Vn.prototype.isDepthTexture=!0,zn.prototype=Object.create(vt.prototype),zn.prototype.constructor=zn,Hn.prototype=Object.create(Ke.prototype),Hn.prototype.constructor=Hn,Gn.prototype=Object.create(vt.prototype),Gn.prototype.constructor=Gn,qn.prototype=Object.create(Ke.prototype),qn.prototype.constructor=qn,Wn.prototype=Object.create(vt.prototype),Wn.prototype.constructor=Wn,Jn.prototype=Object.create(Ke.prototype),Jn.prototype.constructor=Jn,Zn.prototype=Object.create(Wn.prototype),Zn.prototype.constructor=Zn,Xn.prototype=Object.create(Ke.prototype),Xn.prototype.constructor=Xn,Yn.prototype=Object.create(Wn.prototype),Yn.prototype.constructor=Yn,Kn.prototype=Object.create(Ke.prototype),Kn.prototype.constructor=Kn,Qn.prototype=Object.create(Wn.prototype),Qn.prototype.constructor=Qn,$n.prototype=Object.create(Ke.prototype),$n.prototype.constructor=$n,er.prototype=Object.create(Wn.prototype),er.prototype.constructor=er,tr.prototype=Object.create(Ke.prototype),tr.prototype.constructor=tr,nr.prototype=Object.create(vt.prototype),nr.prototype.constructor=nr,rr.prototype=Object.create(Ke.prototype),rr.prototype.constructor=rr,ir.prototype=Object.create(vt.prototype),ir.prototype.constructor=ir,ar.prototype=Object.create(Ke.prototype),ar.prototype.constructor=ar,or.prototype=Object.create(vt.prototype),or.prototype.constructor=or;var sr=function(e,t,n){n=n||2;var r,i,a,o,s,c,l,u=t&&t.length,h=u?t[0]*n:e.length,d=cr(e,0,h,n,!0),p=[];if(!d)return p;if(u&&(d=function(e,t,n,r){var i,a,o,s,c,l=[];for(i=0,a=t.length;i<a;i++)o=t[i]*r,s=i<a-1?t[i+1]*r:e.length,(c=cr(e,o,s,r,!1))===c.next&&(c.steiner=!0),l.push(vr(c));for(l.sort(mr),i=0;i<l.length;i++)gr(l[i],n),n=lr(n,n.next);return n}(e,t,d,n)),e.length>80*n){r=a=e[0],i=o=e[1];for(var f=n;f<h;f+=n)(s=e[f])<r&&(r=s),(c=e[f+1])<i&&(i=c),s>a&&(a=s),c>o&&(o=c);l=0!==(l=Math.max(a-r,o-i))?1/l:0}return ur(d,p,n,r,i,l),p};function cr(e,t,n,r,i){var a,o;if(i===function(e,t,n,r){for(var i=0,a=t,o=n-r;a<n;a+=r)i+=(e[o]-e[a])*(e[a+1]+e[o+1]),o=a;return i}(e,t,n,r)>0)for(a=t;a<n;a+=r)o=Mr(a,e[a],e[a+1],o);else for(a=n-r;a>=t;a-=r)o=Mr(a,e[a],e[a+1],o);return o&&Er(o,o.next)&&(Tr(o),o=o.next),o}function lr(e,t){if(!e)return e;t||(t=e);var n,r=e;do{if(n=!1,r.steiner||!Er(r,r.next)&&0!==Ar(r.prev,r,r.next))r=r.next;else{if(Tr(r),(r=t=r.prev)===r.next)break;n=!0}}while(n||r!==t);return t}function ur(e,t,n,r,i,a,o){if(e){!o&&a&&function(e,t,n,r){var i=e;do{null===i.z&&(i.z=yr(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,function(e){var t,n,r,i,a,o,s,c,l=1;do{for(n=e,e=null,a=null,o=0;n;){for(o++,r=n,s=0,t=0;t<l&&(s++,r=r.nextZ);t++);for(c=l;s>0||c>0&&r;)0!==s&&(0===c||!r||n.z<=r.z)?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,c--),a?a.nextZ=i:e=i,i.prevZ=a,a=i;n=r}a.nextZ=null,l*=2}while(o>1)}(i)}(e,r,i,a);for(var s,c,l=e;e.prev!==e.next;)if(s=e.prev,c=e.next,a?dr(e,r,i,a):hr(e))t.push(s.i/n),t.push(e.i/n),t.push(c.i/n),Tr(e),e=c.next,l=c.next;else if((e=c)===l){o?1===o?ur(e=pr(e,t,n),t,n,r,i,a,2):2===o&&fr(e,t,n,r,i,a):ur(lr(e),t,n,r,i,a,1);break}}}function hr(e){var t=e.prev,n=e,r=e.next;if(Ar(t,n,r)>=0)return!1;for(var i=e.next.next;i!==e.prev;){if(br(t.x,t.y,n.x,n.y,r.x,r.y,i.x,i.y)&&Ar(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function dr(e,t,n,r){var i=e.prev,a=e,o=e.next;if(Ar(i,a,o)>=0)return!1;for(var s=i.x<a.x?i.x<o.x?i.x:o.x:a.x<o.x?a.x:o.x,c=i.y<a.y?i.y<o.y?i.y:o.y:a.y<o.y?a.y:o.y,l=i.x>a.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,u=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,h=yr(s,c,t,n,r),d=yr(l,u,t,n,r),p=e.nextZ;p&&p.z<=d;){if(p!==e.prev&&p!==e.next&&br(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&Ar(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(p=e.prevZ;p&&p.z>=h;){if(p!==e.prev&&p!==e.next&&br(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&Ar(p.prev,p,p.next)>=0)return!1;p=p.prevZ}return!0}function pr(e,t,n){var r=e;do{var i=r.prev,a=r.next.next;!Er(i,a)&&xr(i,r,r.next,a)&&_r(i,a)&&_r(a,i)&&(t.push(i.i/n),t.push(r.i/n),t.push(a.i/n),Tr(r),Tr(r.next),r=e=a),r=r.next}while(r!==e);return r}function fr(e,t,n,r,i,a){var o=e;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&wr(o,s)){var c=Sr(o,s);return o=lr(o,o.next),c=lr(c,c.next),ur(o,t,n,r,i,a),void ur(c,t,n,r,i,a)}s=s.next}o=o.next}while(o!==e)}function mr(e,t){return e.x-t.x}function gr(e,t){if(t=function(e,t){var n,r=t,i=e.x,a=e.y,o=-1/0;do{if(a<=r.y&&a>=r.next.y&&r.next.y!==r.y){var s=r.x+(a-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=i&&s>o){if(o=s,s===i){if(a===r.y)return r;if(a===r.next.y)return r.next}n=r.x<r.next.x?r:r.next}}r=r.next}while(r!==t);if(!n)return null;if(i===o)return n.prev;var c,l=n,u=n.x,h=n.y,d=1/0;r=n.next;for(;r!==l;)i>=r.x&&r.x>=u&&i!==r.x&&br(a<h?i:o,a,u,h,a<h?o:i,a,r.x,r.y)&&((c=Math.abs(a-r.y)/(i-r.x))<d||c===d&&r.x>n.x)&&_r(r,e)&&(n=r,d=c),r=r.next;return n}(e,t)){var n=Sr(t,e);lr(n,n.next)}}function yr(e,t,n,r,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*i)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*i)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function vr(e){var t=e,n=e;do{t.x<n.x&&(n=t),t=t.next}while(t!==e);return n}function br(e,t,n,r,i,a,o,s){return(i-o)*(t-s)-(e-o)*(a-s)>=0&&(e-o)*(r-s)-(n-o)*(t-s)>=0&&(n-o)*(a-s)-(i-o)*(r-s)>=0}function wr(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&xr(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&_r(e,t)&&_r(t,e)&&function(e,t){var n=e,r=!1,i=(e.x+t.x)/2,a=(e.y+t.y)/2;do{n.y>a!=n.next.y>a&&n.next.y!==n.y&&i<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==e);return r}(e,t)}function Ar(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function Er(e,t){return e.x===t.x&&e.y===t.y}function xr(e,t,n,r){return!!(Er(e,t)&&Er(n,r)||Er(e,r)&&Er(n,t))||Ar(e,t,n)>0!=Ar(e,t,r)>0&&Ar(n,r,e)>0!=Ar(n,r,t)>0}function _r(e,t){return Ar(e.prev,e,e.next)<0?Ar(e,t,e.next)>=0&&Ar(e,e.prev,t)>=0:Ar(e,t,e.prev)<0||Ar(e,e.next,t)<0}function Sr(e,t){var n=new Rr(e.i,e.x,e.y),r=new Rr(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,a.next=r,r.prev=a,r}function Mr(e,t,n,r){var i=new Rr(e,t,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function Tr(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function Rr(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}var kr={area:function(e){for(var t=e.length,n=0,r=t-1,i=0;i<t;r=i++)n+=e[r].x*e[i].y-e[i].x*e[r].y;return.5*n},isClockWise:function(e){return kr.area(e)<0},triangulateShape:function(e,t){var n=[],r=[],i=[];Cr(e),Or(n,e);var a=e.length;t.forEach(Cr);for(var o=0;o<t.length;o++)r.push(a),a+=t[o].length,Or(n,t[o]);var s=sr(n,r);for(o=0;o<s.length;o+=3)i.push(s.slice(o,o+3));return i}};function Cr(e){var t=e.length;t>2&&e[t-1].equals(e[0])&&e.pop()}function Or(e,t){for(var n=0;n<t.length;n++)e.push(t[n].x),e.push(t[n].y)}function Pr(e,t){Ke.call(this),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},this.fromBufferGeometry(new Ir(e,t)),this.mergeVertices()}function Ir(e,t){void 0!==e&&(vt.call(this),this.type="ExtrudeBufferGeometry",e=Array.isArray(e)?e:[e],this.addShapeList(e,t),this.computeVertexNormals())}function Nr(e,t){Ke.call(this),this.type="TextGeometry",this.parameters={text:e,parameters:t},this.fromBufferGeometry(new Lr(e,t)),this.mergeVertices()}function Lr(e,t){var n=(t=t||{}).font;if(!n||!n.isFont)return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),new Ke;var r=n.generateShapes(e,t.size,t.curveSegments);t.amount=void 0!==t.height?t.height:50,void 0===t.bevelThickness&&(t.bevelThickness=10),void 0===t.bevelSize&&(t.bevelSize=8),void 0===t.bevelEnabled&&(t.bevelEnabled=!1),Ir.call(this,r,t),this.type="TextBufferGeometry"}function Dr(e,t,n,r,i,a,o){Ke.call(this),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:r,phiLength:i,thetaStart:a,thetaLength:o},this.fromBufferGeometry(new Fr(e,t,n,r,i,a,o)),this.mergeVertices()}function Fr(e,t,n,r,i,a,o){vt.call(this),this.type="SphereBufferGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:r,phiLength:i,thetaStart:a,thetaLength:o},e=e||1,t=Math.max(3,Math.floor(t)||8),n=Math.max(2,Math.floor(n)||6),r=void 0!==r?r:0,i=void 0!==i?i:2*Math.PI;var s,c,l=(a=void 0!==a?a:0)+(o=void 0!==o?o:Math.PI),u=0,h=[],d=new b,p=new b,f=[],m=[],g=[],y=[];for(c=0;c<=n;c++){var v=[],w=c/n;for(s=0;s<=t;s++){var A=s/t;d.x=-e*Math.cos(r+A*i)*Math.sin(a+w*o),d.y=e*Math.cos(a+w*o),d.z=e*Math.sin(r+A*i)*Math.sin(a+w*o),m.push(d.x,d.y,d.z),p.set(d.x,d.y,d.z).normalize(),g.push(p.x,p.y,p.z),y.push(A,1-w),v.push(u++)}h.push(v)}for(c=0;c<n;c++)for(s=0;s<t;s++){var E=h[c][s+1],x=h[c][s],_=h[c+1][s],S=h[c+1][s+1];(0!==c||a>0)&&f.push(E,x,S),(c!==n-1||l<Math.PI)&&f.push(x,_,S)}this.setIndex(f),this.addAttribute("position",new ot(m,3)),this.addAttribute("normal",new ot(g,3)),this.addAttribute("uv",new ot(y,2))}function jr(e,t,n,r,i,a){Ke.call(this),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:n,phiSegments:r,thetaStart:i,thetaLength:a},this.fromBufferGeometry(new Ur(e,t,n,r,i,a)),this.mergeVertices()}function Ur(e,t,n,r,i,a){vt.call(this),this.type="RingBufferGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:n,phiSegments:r,thetaStart:i,thetaLength:a},e=e||.5,t=t||1,i=void 0!==i?i:0,a=void 0!==a?a:2*Math.PI,n=void 0!==n?Math.max(3,n):8;var o,s,c,l=[],u=[],h=[],d=[],p=e,f=(t-e)/(r=void 0!==r?Math.max(1,r):1),m=new b,y=new g;for(s=0;s<=r;s++){for(c=0;c<=n;c++)o=i+c/n*a,m.x=p*Math.cos(o),m.y=p*Math.sin(o),u.push(m.x,m.y,m.z),h.push(0,0,1),y.x=(m.x/t+1)/2,y.y=(m.y/t+1)/2,d.push(y.x,y.y);p+=f}for(s=0;s<r;s++){var v=s*(n+1);for(c=0;c<n;c++){var w=o=c+v,A=o+n+1,E=o+n+2,x=o+1;l.push(w,A,x),l.push(A,E,x)}}this.setIndex(l),this.addAttribute("position",new ot(u,3)),this.addAttribute("normal",new ot(h,3)),this.addAttribute("uv",new ot(d,2))}function Br(e,t,n,r){Ke.call(this),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:n,phiLength:r},this.fromBufferGeometry(new Vr(e,t,n,r)),this.mergeVertices()}function Vr(e,t,n,r){vt.call(this),this.type="LatheBufferGeometry",this.parameters={points:e,segments:t,phiStart:n,phiLength:r},t=Math.floor(t)||12,n=n||0,r=r||2*Math.PI,r=m.clamp(r,0,2*Math.PI);var i,a,o,s=[],c=[],l=[],u=1/t,h=new b,d=new g;for(a=0;a<=t;a++){var p=n+a*u*r,f=Math.sin(p),y=Math.cos(p);for(o=0;o<=e.length-1;o++)h.x=e[o].x*f,h.y=e[o].y,h.z=e[o].x*y,c.push(h.x,h.y,h.z),d.x=a/t,d.y=o/(e.length-1),l.push(d.x,d.y)}for(a=0;a<t;a++)for(o=0;o<e.length-1;o++){var v=i=o+a*e.length,w=i+e.length,A=i+e.length+1,E=i+1;s.push(v,w,E),s.push(w,A,E)}if(this.setIndex(s),this.addAttribute("position",new ot(c,3)),this.addAttribute("uv",new ot(l,2)),this.computeVertexNormals(),r===2*Math.PI){var x=this.attributes.normal.array,_=new b,S=new b,M=new b;for(i=t*e.length*3,a=0,o=0;a<e.length;a++,o+=3)_.x=x[o+0],_.y=x[o+1],_.z=x[o+2],S.x=x[i+o+0],S.y=x[i+o+1],S.z=x[i+o+2],M.addVectors(_,S).normalize(),x[o+0]=x[i+o+0]=M.x,x[o+1]=x[i+o+1]=M.y,x[o+2]=x[i+o+2]=M.z}}function zr(e,t){Ke.call(this),this.type="ShapeGeometry","object"==typeof t&&(console.warn("THREE.ShapeGeometry: Options parameter has been removed."),t=t.curveSegments),this.parameters={shapes:e,curveSegments:t},this.fromBufferGeometry(new Hr(e,t)),this.mergeVertices()}function Hr(e,t){vt.call(this),this.type="ShapeBufferGeometry",this.parameters={shapes:e,curveSegments:t},t=t||12;var n=[],r=[],i=[],a=[],o=0,s=0;if(!1===Array.isArray(e))l(e);else for(var c=0;c<e.length;c++)l(e[c]),this.addGroup(o,s,c),o+=s,s=0;function l(e){var o,c,l,u=r.length/3,h=e.extractPoints(t),d=h.shape,p=h.holes;if(!1===kr.isClockWise(d))for(d=d.reverse(),o=0,c=p.length;o<c;o++)l=p[o],!0===kr.isClockWise(l)&&(p[o]=l.reverse());var f=kr.triangulateShape(d,p);for(o=0,c=p.length;o<c;o++)l=p[o],d=d.concat(l);for(o=0,c=d.length;o<c;o++){var m=d[o];r.push(m.x,m.y,0),i.push(0,0,1),a.push(m.x,m.y)}for(o=0,c=f.length;o<c;o++){var g=f[o],y=g[0]+u,v=g[1]+u,b=g[2]+u;n.push(y,v,b),s+=3}}this.setIndex(n),this.addAttribute("position",new ot(r,3)),this.addAttribute("normal",new ot(i,3)),this.addAttribute("uv",new ot(a,2))}function Gr(e,t){if(t.shapes=[],Array.isArray(e))for(var n=0,r=e.length;n<r;n++){var i=e[n];t.shapes.push(i.uuid)}else t.shapes.push(e.uuid);return t}function qr(e,t){vt.call(this),this.type="EdgesGeometry",this.parameters={thresholdAngle:t},t=void 0!==t?t:1;var n,r,i,a,o=[],s=Math.cos(m.DEG2RAD*t),c=[0,0],l={},u=["a","b","c"];e.isBufferGeometry?(a=new Ke).fromBufferGeometry(e):a=e.clone(),a.mergeVertices(),a.computeFaceNormals();for(var h=a.vertices,d=a.faces,p=0,f=d.length;p<f;p++)for(var g=d[p],y=0;y<3;y++)n=g[u[y]],r=g[u[(y+1)%3]],c[0]=Math.min(n,r),c[1]=Math.max(n,r),void 0===l[i=c[0]+","+c[1]]?l[i]={index1:c[0],index2:c[1],face1:p,face2:void 0}:l[i].face2=p;for(i in l){var v=l[i];if(void 0===v.face2||d[v.face1].normal.dot(d[v.face2].normal)<=s){var b=h[v.index1];o.push(b.x,b.y,b.z),b=h[v.index2],o.push(b.x,b.y,b.z)}}this.addAttribute("position",new ot(o,3))}function Wr(e,t,n,r,i,a,o,s){Ke.call(this),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:r,heightSegments:i,openEnded:a,thetaStart:o,thetaLength:s},this.fromBufferGeometry(new Jr(e,t,n,r,i,a,o,s)),this.mergeVertices()}function Jr(e,t,n,r,i,a,o,s){vt.call(this),this.type="CylinderBufferGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:r,heightSegments:i,openEnded:a,thetaStart:o,thetaLength:s};var c=this;e=void 0!==e?e:1,t=void 0!==t?t:1,n=n||1,r=Math.floor(r)||8,i=Math.floor(i)||1,a=void 0!==a&&a,o=void 0!==o?o:0,s=void 0!==s?s:2*Math.PI;var l=[],u=[],h=[],d=[],p=0,f=[],m=n/2,y=0;function v(n){var i,a,f,v=new g,w=new b,A=0,E=!0===n?e:t,x=!0===n?1:-1;for(a=p,i=1;i<=r;i++)u.push(0,m*x,0),h.push(0,x,0),d.push(.5,.5),p++;for(f=p,i=0;i<=r;i++){var _=i/r*s+o,S=Math.cos(_),M=Math.sin(_);w.x=E*M,w.y=m*x,w.z=E*S,u.push(w.x,w.y,w.z),h.push(0,x,0),v.x=.5*S+.5,v.y=.5*M*x+.5,d.push(v.x,v.y),p++}for(i=0;i<r;i++){var T=a+i,R=f+i;!0===n?l.push(R,R+1,T):l.push(R+1,R,T),A+=3}c.addGroup(y,A,!0===n?1:2),y+=A}!function(){var a,g,v=new b,w=new b,A=0,E=(t-e)/n;for(g=0;g<=i;g++){var x=[],_=g/i,S=_*(t-e)+e;for(a=0;a<=r;a++){var M=a/r,T=M*s+o,R=Math.sin(T),k=Math.cos(T);w.x=S*R,w.y=-_*n+m,w.z=S*k,u.push(w.x,w.y,w.z),v.set(R,E,k).normalize(),h.push(v.x,v.y,v.z),d.push(M,1-_),x.push(p++)}f.push(x)}for(a=0;a<r;a++)for(g=0;g<i;g++){var C=f[g][a],O=f[g+1][a],P=f[g+1][a+1],I=f[g][a+1];l.push(C,O,I),l.push(O,P,I),A+=6}c.addGroup(y,A,0),y+=A}(),!1===a&&(e>0&&v(!0),t>0&&v(!1)),this.setIndex(l),this.addAttribute("position",new ot(u,3)),this.addAttribute("normal",new ot(h,3)),this.addAttribute("uv",new ot(d,2))}function Zr(e,t,n,r,i,a,o){Wr.call(this,0,e,t,n,r,i,a,o),this.type="ConeGeometry",this.parameters={radius:e,height:t,radialSegments:n,heightSegments:r,openEnded:i,thetaStart:a,thetaLength:o}}function Xr(e,t,n,r,i,a,o){Jr.call(this,0,e,t,n,r,i,a,o),this.type="ConeBufferGeometry",this.parameters={radius:e,height:t,radialSegments:n,heightSegments:r,openEnded:i,thetaStart:a,thetaLength:o}}function Yr(e,t,n,r){Ke.call(this),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:r},this.fromBufferGeometry(new Kr(e,t,n,r)),this.mergeVertices()}function Kr(e,t,n,r){vt.call(this),this.type="CircleBufferGeometry",this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:r},e=e||1,t=void 0!==t?Math.max(3,t):8,n=void 0!==n?n:0,r=void 0!==r?r:2*Math.PI;var i,a,o=[],s=[],c=[],l=[],u=new b,h=new g;for(s.push(0,0,0),c.push(0,0,1),l.push(.5,.5),a=0,i=3;a<=t;a++,i+=3){var d=n+a/t*r;u.x=e*Math.cos(d),u.y=e*Math.sin(d),s.push(u.x,u.y,u.z),c.push(0,0,1),h.x=(s[i]/e+1)/2,h.y=(s[i+1]/e+1)/2,l.push(h.x,h.y)}for(i=1;i<=t;i++)o.push(i,i+1,0);this.setIndex(o),this.addAttribute("position",new ot(s,3)),this.addAttribute("normal",new ot(c,3)),this.addAttribute("uv",new ot(l,2))}Pr.prototype=Object.create(Ke.prototype),Pr.prototype.constructor=Pr,Ir.prototype=Object.create(vt.prototype),Ir.prototype.constructor=Ir,Ir.prototype.getArrays=function(){var e=this.getAttribute("position"),t=e?Array.prototype.slice.call(e.array):[],n=this.getAttribute("uv"),r=n?Array.prototype.slice.call(n.array):[],i=this.index;return{position:t,uv:r,index:i?Array.prototype.slice.call(i.array):[]}},Ir.prototype.addShapeList=function(e,t){var n=e.length;t.arrays=this.getArrays();for(var r=0;r<n;r++){var i=e[r];this.addShape(i,t)}this.setIndex(t.arrays.index),this.addAttribute("position",new ot(t.arrays.position,3)),this.addAttribute("uv",new ot(t.arrays.uv,2))},Ir.prototype.addShape=function(e,t){var n,r,i,a,o,s,c,l,u=t.arrays?t.arrays:this.getArrays(),h=u.position,d=u.index,p=u.uv,f=[],m=void 0!==t.amount?t.amount:100,y=void 0!==t.bevelThickness?t.bevelThickness:6,v=void 0!==t.bevelSize?t.bevelSize:y-2,w=void 0!==t.bevelSegments?t.bevelSegments:3,A=void 0===t.bevelEnabled||t.bevelEnabled,E=void 0!==t.curveSegments?t.curveSegments:12,x=void 0!==t.steps?t.steps:1,_=t.extrudePath,S=!1,M=void 0!==t.UVGenerator?t.UVGenerator:Pr.WorldUVGenerator;_&&(n=_.getSpacedPoints(x),S=!0,A=!1,r=void 0!==t.frames?t.frames:_.computeFrenetFrames(x,!1),i=new b,a=new b,o=new b),A||(w=0,y=0,v=0);var T=this,R=e.extractPoints(E),k=R.shape,C=R.holes;if(!kr.isClockWise(k))for(k=k.reverse(),c=0,l=C.length;c<l;c++)s=C[c],kr.isClockWise(s)&&(C[c]=s.reverse());var O=kr.triangulateShape(k,C),P=k;for(c=0,l=C.length;c<l;c++)s=C[c],k=k.concat(s);function I(e,t,n){return t||console.error("THREE.ExtrudeGeometry: vec does not exist"),t.clone().multiplyScalar(n).add(e)}var N,L,D,F,j,U,B=k.length,V=O.length;function z(e,t,n){var r,i,a,o=e.x-t.x,s=e.y-t.y,c=n.x-e.x,l=n.y-e.y,u=o*o+s*s,h=o*l-s*c;if(Math.abs(h)>Number.EPSILON){var d=Math.sqrt(u),p=Math.sqrt(c*c+l*l),f=t.x-s/d,m=t.y+o/d,y=((n.x-l/p-f)*l-(n.y+c/p-m)*c)/(o*l-s*c),v=(r=f+o*y-e.x)*r+(i=m+s*y-e.y)*i;if(v<=2)return new g(r,i);a=Math.sqrt(v/2)}else{var b=!1;o>Number.EPSILON?c>Number.EPSILON&&(b=!0):o<-Number.EPSILON?c<-Number.EPSILON&&(b=!0):Math.sign(s)===Math.sign(l)&&(b=!0),b?(r=-s,i=o,a=Math.sqrt(u)):(r=o,i=s,a=Math.sqrt(u/2))}return new g(r/a,i/a)}for(var H=[],G=0,q=P.length,W=q-1,J=G+1;G<q;G++,W++,J++)W===q&&(W=0),J===q&&(J=0),H[G]=z(P[G],P[W],P[J]);var Z,X,Y=[],K=H.concat();for(c=0,l=C.length;c<l;c++){for(s=C[c],Z=[],G=0,W=(q=s.length)-1,J=G+1;G<q;G++,W++,J++)W===q&&(W=0),J===q&&(J=0),Z[G]=z(s[G],s[W],s[J]);Y.push(Z),K=K.concat(Z)}for(N=0;N<w;N++){for(D=N/w,F=y*Math.cos(D*Math.PI/2),L=v*Math.sin(D*Math.PI/2),G=0,q=P.length;G<q;G++)$((j=I(P[G],H[G],L)).x,j.y,-F);for(c=0,l=C.length;c<l;c++)for(s=C[c],Z=Y[c],G=0,q=s.length;G<q;G++)$((j=I(s[G],Z[G],L)).x,j.y,-F)}for(L=v,G=0;G<B;G++)j=A?I(k[G],K[G],L):k[G],S?(a.copy(r.normals[0]).multiplyScalar(j.x),i.copy(r.binormals[0]).multiplyScalar(j.y),o.copy(n[0]).add(a).add(i),$(o.x,o.y,o.z)):$(j.x,j.y,0);for(X=1;X<=x;X++)for(G=0;G<B;G++)j=A?I(k[G],K[G],L):k[G],S?(a.copy(r.normals[X]).multiplyScalar(j.x),i.copy(r.binormals[X]).multiplyScalar(j.y),o.copy(n[X]).add(a).add(i),$(o.x,o.y,o.z)):$(j.x,j.y,m/x*X);for(N=w-1;N>=0;N--){for(D=N/w,F=y*Math.cos(D*Math.PI/2),L=v*Math.sin(D*Math.PI/2),G=0,q=P.length;G<q;G++)$((j=I(P[G],H[G],L)).x,j.y,m+F);for(c=0,l=C.length;c<l;c++)for(s=C[c],Z=Y[c],G=0,q=s.length;G<q;G++)j=I(s[G],Z[G],L),S?$(j.x,j.y+n[x-1].y,n[x-1].x+F):$(j.x,j.y,m+F)}function Q(e,t){var n,r;for(G=e.length;--G>=0;){n=G,(r=G-1)<0&&(r=e.length-1);var i=0,a=x+2*w;for(i=0;i<a;i++){var o=B*i,s=B*(i+1);te(t+n+o,t+r+o,t+r+s,t+n+s)}}}function $(e,t,n){f.push(e),f.push(t),f.push(n)}function ee(e,t,n){ne(e),ne(t),ne(n);var r=h.length/3,i=M.generateTopUV(T,h,r-3,r-2,r-1);re(i[0]),re(i[1]),re(i[2])}function te(e,t,n,r){ne(e),ne(t),ne(r),ne(t),ne(n),ne(r);var i=h.length/3,a=M.generateSideWallUV(T,h,i-6,i-3,i-2,i-1);re(a[0]),re(a[1]),re(a[3]),re(a[1]),re(a[2]),re(a[3])}function ne(e){d.push(h.length/3),h.push(f[3*e+0]),h.push(f[3*e+1]),h.push(f[3*e+2])}function re(e){p.push(e.x),p.push(e.y)}!function(){var e=h.length/3;if(A){var n=0,r=B*n;for(G=0;G<V;G++)ee((U=O[G])[2]+r,U[1]+r,U[0]+r);for(r=B*(n=x+2*w),G=0;G<V;G++)ee((U=O[G])[0]+r,U[1]+r,U[2]+r)}else{for(G=0;G<V;G++)ee((U=O[G])[2],U[1],U[0]);for(G=0;G<V;G++)ee((U=O[G])[0]+B*x,U[1]+B*x,U[2]+B*x)}T.addGroup(e,h.length/3-e,void 0!==t.material?t.material:0)}(),function(){var e=h.length/3,n=0;for(Q(P,n),n+=P.length,c=0,l=C.length;c<l;c++)Q(s=C[c],n),n+=s.length;T.addGroup(e,h.length/3-e,void 0!==t.extrudeMaterial?t.extrudeMaterial:1)}(),t.arrays||(this.setIndex(d),this.addAttribute("position",new ot(h,3)),this.addAttribute("uv",new ot(p,2)))},Pr.WorldUVGenerator={generateTopUV:function(e,t,n,r,i){var a=t[3*n],o=t[3*n+1],s=t[3*r],c=t[3*r+1],l=t[3*i],u=t[3*i+1];return[new g(a,o),new g(s,c),new g(l,u)]},generateSideWallUV:function(e,t,n,r,i,a){var o=t[3*n],s=t[3*n+1],c=t[3*n+2],l=t[3*r],u=t[3*r+1],h=t[3*r+2],d=t[3*i],p=t[3*i+1],f=t[3*i+2],m=t[3*a],y=t[3*a+1],v=t[3*a+2];return Math.abs(s-u)<.01?[new g(o,1-c),new g(l,1-h),new g(d,1-f),new g(m,1-v)]:[new g(s,1-c),new g(u,1-h),new g(p,1-f),new g(y,1-v)]}},Nr.prototype=Object.create(Ke.prototype),Nr.prototype.constructor=Nr,Lr.prototype=Object.create(Ir.prototype),Lr.prototype.constructor=Lr,Dr.prototype=Object.create(Ke.prototype),Dr.prototype.constructor=Dr,Fr.prototype=Object.create(vt.prototype),Fr.prototype.constructor=Fr,jr.prototype=Object.create(Ke.prototype),jr.prototype.constructor=jr,Ur.prototype=Object.create(vt.prototype),Ur.prototype.constructor=Ur,Br.prototype=Object.create(Ke.prototype),Br.prototype.constructor=Br,Vr.prototype=Object.create(vt.prototype),Vr.prototype.constructor=Vr,zr.prototype=Object.create(Ke.prototype),zr.prototype.constructor=zr,zr.prototype.toJSON=function(){var e=Ke.prototype.toJSON.call(this);return Gr(this.parameters.shapes,e)},Hr.prototype=Object.create(vt.prototype),Hr.prototype.constructor=Hr,Hr.prototype.toJSON=function(){var e=vt.prototype.toJSON.call(this);return Gr(this.parameters.shapes,e)},qr.prototype=Object.create(vt.prototype),qr.prototype.constructor=qr,Wr.prototype=Object.create(Ke.prototype),Wr.prototype.constructor=Wr,Jr.prototype=Object.create(vt.prototype),Jr.prototype.constructor=Jr,Zr.prototype=Object.create(Wr.prototype),Zr.prototype.constructor=Zr,Xr.prototype=Object.create(Jr.prototype),Xr.prototype.constructor=Xr,Yr.prototype=Object.create(Ke.prototype),Yr.prototype.constructor=Yr,Kr.prototype=Object.create(vt.prototype),Kr.prototype.constructor=Kr;var Qr=Object.freeze({WireframeGeometry:zn,ParametricGeometry:Hn,ParametricBufferGeometry:Gn,TetrahedronGeometry:Jn,TetrahedronBufferGeometry:Zn,OctahedronGeometry:Xn,OctahedronBufferGeometry:Yn,IcosahedronGeometry:Kn,IcosahedronBufferGeometry:Qn,DodecahedronGeometry:$n,DodecahedronBufferGeometry:er,PolyhedronGeometry:qn,PolyhedronBufferGeometry:Wn,TubeGeometry:tr,TubeBufferGeometry:nr,TorusKnotGeometry:rr,TorusKnotBufferGeometry:ir,TorusGeometry:ar,TorusBufferGeometry:or,TextGeometry:Nr,TextBufferGeometry:Lr,SphereGeometry:Dr,SphereBufferGeometry:Fr,RingGeometry:jr,RingBufferGeometry:Ur,PlaneGeometry:At,PlaneBufferGeometry:Et,LatheGeometry:Br,LatheBufferGeometry:Vr,ShapeGeometry:zr,ShapeBufferGeometry:Hr,ExtrudeGeometry:Pr,ExtrudeBufferGeometry:Ir,EdgesGeometry:qr,ConeGeometry:Zr,ConeBufferGeometry:Xr,CylinderGeometry:Wr,CylinderBufferGeometry:Jr,CircleGeometry:Yr,CircleBufferGeometry:Kr,BoxGeometry:bt,BoxBufferGeometry:wt});function $r(e){ke.call(this),this.type="ShadowMaterial",this.color=new fe(0),this.opacity=1,this.lights=!0,this.transparent=!0,this.setValues(e)}function ei(e){_t.call(this,e),this.type="RawShaderMaterial"}function ti(e){ke.call(this),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new fe(16777215),this.roughness=.5,this.metalness=.5,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new fe(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalScale=new g(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function ni(e){ti.call(this),this.defines={PHYSICAL:""},this.type="MeshPhysicalMaterial",this.reflectivity=.5,this.clearCoat=0,this.clearCoatRoughness=0,this.setValues(e)}function ri(e){ke.call(this),this.type="MeshPhongMaterial",this.color=new fe(16777215),this.specular=new fe(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new fe(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalScale=new g(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function ii(e){ri.call(this),this.defines={TOON:""},this.type="MeshToonMaterial",this.gradientMap=null,this.setValues(e)}function ai(e){ke.call(this),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalScale=new g(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function oi(e){ke.call(this),this.type="MeshLambertMaterial",this.color=new fe(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new fe(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function si(e){Pn.call(this),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}$r.prototype=Object.create(ke.prototype),$r.prototype.constructor=$r,$r.prototype.isShadowMaterial=!0,ei.prototype=Object.create(_t.prototype),ei.prototype.constructor=ei,ei.prototype.isRawShaderMaterial=!0,ti.prototype=Object.create(ke.prototype),ti.prototype.constructor=ti,ti.prototype.isMeshStandardMaterial=!0,ti.prototype.copy=function(e){return ke.prototype.copy.call(this,e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapIntensity=e.envMapIntensity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},ni.prototype=Object.create(ti.prototype),ni.prototype.constructor=ni,ni.prototype.isMeshPhysicalMaterial=!0,ni.prototype.copy=function(e){return ti.prototype.copy.call(this,e),this.defines={PHYSICAL:""},this.reflectivity=e.reflectivity,this.clearCoat=e.clearCoat,this.clearCoatRoughness=e.clearCoatRoughness,this},ri.prototype=Object.create(ke.prototype),ri.prototype.constructor=ri,ri.prototype.isMeshPhongMaterial=!0,ri.prototype.copy=function(e){return ke.prototype.copy.call(this,e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},ii.prototype=Object.create(ri.prototype),ii.prototype.constructor=ii,ii.prototype.isMeshToonMaterial=!0,ii.prototype.copy=function(e){return ri.prototype.copy.call(this,e),this.gradientMap=e.gradientMap,this},ai.prototype=Object.create(ke.prototype),ai.prototype.constructor=ai,ai.prototype.isMeshNormalMaterial=!0,ai.prototype.copy=function(e){return ke.prototype.copy.call(this,e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},oi.prototype=Object.create(ke.prototype),oi.prototype.constructor=oi,oi.prototype.isMeshLambertMaterial=!0,oi.prototype.copy=function(e){return ke.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},si.prototype=Object.create(Pn.prototype),si.prototype.constructor=si,si.prototype.isLineDashedMaterial=!0,si.prototype.copy=function(e){return Pn.prototype.copy.call(this,e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this};var ci=Object.freeze({ShadowMaterial:$r,SpriteMaterial:Mn,RawShaderMaterial:ei,ShaderMaterial:_t,PointsMaterial:Dn,MeshPhysicalMaterial:ni,MeshStandardMaterial:ti,MeshPhongMaterial:ri,MeshToonMaterial:ii,MeshNormalMaterial:ai,MeshLambertMaterial:oi,MeshDepthMaterial:Ce,MeshDistanceMaterial:Oe,MeshBasicMaterial:xt,LineDashedMaterial:si,LineBasicMaterial:Pn,Material:ke}),li={enabled:!1,files:{},add:function(e,t){!1!==this.enabled&&(this.files[e]=t)},get:function(e){if(!1!==this.enabled)return this.files[e]},remove:function(e){delete this.files[e]},clear:function(){this.files={}}};function ui(e,t,n){var r=this,i=!1,a=0,o=0,s=void 0;this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this.itemStart=function(e){o++,!1===i&&void 0!==r.onStart&&r.onStart(e,a,o),i=!0},this.itemEnd=function(e){a++,void 0!==r.onProgress&&r.onProgress(e,a,o),a===o&&(i=!1,void 0!==r.onLoad&&r.onLoad())},this.itemError=function(e){void 0!==r.onError&&r.onError(e)},this.resolveURL=function(e){return s?s(e):e},this.setURLModifier=function(e){return s=e,this}}var hi=new ui,di={};function pi(e){this.manager=void 0!==e?e:hi}function fi(e){this.manager=void 0!==e?e:hi,this._parser=null}function mi(e){this.manager=void 0!==e?e:hi}function gi(e){this.manager=void 0!==e?e:hi}function yi(e){this.manager=void 0!==e?e:hi}function vi(){this.type="Curve",this.arcLengthDivisions=200}function bi(e,t,n,r,i,a,o,s){vi.call(this),this.type="EllipseCurve",this.aX=e||0,this.aY=t||0,this.xRadius=n||1,this.yRadius=r||1,this.aStartAngle=i||0,this.aEndAngle=a||2*Math.PI,this.aClockwise=o||!1,this.aRotation=s||0}function wi(e,t,n,r,i,a){bi.call(this,e,t,n,n,r,i,a),this.type="ArcCurve"}function Ai(){var e=0,t=0,n=0,r=0;function i(i,a,o,s){e=i,t=o,n=-3*i+3*a-2*o-s,r=2*i-2*a+o+s}return{initCatmullRom:function(e,t,n,r,a){i(t,n,a*(n-e),a*(r-t))},initNonuniformCatmullRom:function(e,t,n,r,a,o,s){var c=(t-e)/a-(n-e)/(a+o)+(n-t)/o,l=(n-t)/o-(r-t)/(o+s)+(r-n)/s;i(t,n,c*=o,l*=o)},calc:function(i){var a=i*i;return e+t*i+n*a+r*(a*i)}}}Object.assign(pi.prototype,{load:function(e,t,n,r){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);var i=this,a=li.get(e);if(void 0!==a)return i.manager.itemStart(e),setTimeout((function(){t&&t(a),i.manager.itemEnd(e)}),0),a;if(void 0===di[e]){var o=e.match(/^data:(.*?)(;base64)?,(.*)$/);if(o){var s=o[1],c=!!o[2],l=o[3];l=window.decodeURIComponent(l),c&&(l=window.atob(l));try{var u,h=(this.responseType||"").toLowerCase();switch(h){case"arraybuffer":case"blob":for(var d=new Uint8Array(l.length),p=0;p<l.length;p++)d[p]=l.charCodeAt(p);u="blob"===h?new Blob([d.buffer],{type:s}):d.buffer;break;case"document":var f=new DOMParser;u=f.parseFromString(l,s);break;case"json":u=JSON.parse(l);break;default:u=l}window.setTimeout((function(){t&&t(u),i.manager.itemEnd(e)}),0)}catch(t){window.setTimeout((function(){r&&r(t),i.manager.itemEnd(e),i.manager.itemError(e)}),0)}}else{di[e]=[],di[e].push({onLoad:t,onProgress:n,onError:r});var m=new XMLHttpRequest;for(var g in m.open("GET",e,!0),m.addEventListener("load",(function(t){var n=this.response;li.add(e,n);var r=di[e];if(delete di[e],200===this.status){for(var a=0,o=r.length;a<o;a++){(s=r[a]).onLoad&&s.onLoad(n)}i.manager.itemEnd(e)}else if(0===this.status){console.warn("THREE.FileLoader: HTTP Status 0 received.");for(a=0,o=r.length;a<o;a++){(s=r[a]).onLoad&&s.onLoad(n)}i.manager.itemEnd(e)}else{for(a=0,o=r.length;a<o;a++){var s;(s=r[a]).onError&&s.onError(t)}i.manager.itemEnd(e),i.manager.itemError(e)}}),!1),m.addEventListener("progress",(function(t){for(var n=di[e],r=0,i=n.length;r<i;r++){var a=n[r];a.onProgress&&a.onProgress(t)}}),!1),m.addEventListener("error",(function(t){var n=di[e];delete di[e];for(var r=0,a=n.length;r<a;r++){var o=n[r];o.onError&&o.onError(t)}i.manager.itemEnd(e),i.manager.itemError(e)}),!1),void 0!==this.responseType&&(m.responseType=this.responseType),void 0!==this.withCredentials&&(m.withCredentials=this.withCredentials),m.overrideMimeType&&m.overrideMimeType(void 0!==this.mimeType?this.mimeType:"text/plain"),this.requestHeader)m.setRequestHeader(g,this.requestHeader[g]);m.send(null)}return i.manager.itemStart(e),m}di[e].push({onLoad:t,onProgress:n,onError:r})},setPath:function(e){return this.path=e,this},setResponseType:function(e){return this.responseType=e,this},setWithCredentials:function(e){return this.withCredentials=e,this},setMimeType:function(e){return this.mimeType=e,this},setRequestHeader:function(e){return this.requestHeader=e,this}}),Object.assign(function(e){this.manager=void 0!==e?e:hi,this._parser=null}.prototype,{load:function(e,t,n,r){var i=this,a=[],o=new Bn;o.image=a;var s=new pi(this.manager);function c(c){s.load(e[c],(function(e){var n=i._parser(e,!0);a[c]={width:n.width,height:n.height,format:n.format,mipmaps:n.mipmaps},6===(l+=1)&&(1===n.mipmapCount&&(o.minFilter=1006),o.format=n.format,o.needsUpdate=!0,t&&t(o))}),n,r)}if(s.setPath(this.path),s.setResponseType("arraybuffer"),Array.isArray(e))for(var l=0,u=0,h=e.length;u<h;++u)c(u);else s.load(e,(function(e){var n=i._parser(e,!0);if(n.isCubemap)for(var r=n.mipmaps.length/n.mipmapCount,s=0;s<r;s++){a[s]={mipmaps:[]};for(var c=0;c<n.mipmapCount;c++)a[s].mipmaps.push(n.mipmaps[s*n.mipmapCount+c]),a[s].format=n.format,a[s].width=n.width,a[s].height=n.height}else o.image.width=n.width,o.image.height=n.height,o.mipmaps=n.mipmaps;1===n.mipmapCount&&(o.minFilter=1006),o.format=n.format,o.needsUpdate=!0,t&&t(o)}),n,r);return o},setPath:function(e){return this.path=e,this}}),Object.assign(fi.prototype,{load:function(e,t,n,r){var i=this,a=new M,o=new pi(this.manager);return o.setResponseType("arraybuffer"),o.load(e,(function(e){var n=i._parser(e);n&&(void 0!==n.image?a.image=n.image:void 0!==n.data&&(a.image.width=n.width,a.image.height=n.height,a.image.data=n.data),a.wrapS=void 0!==n.wrapS?n.wrapS:1001,a.wrapT=void 0!==n.wrapT?n.wrapT:1001,a.magFilter=void 0!==n.magFilter?n.magFilter:1006,a.minFilter=void 0!==n.minFilter?n.minFilter:1008,a.anisotropy=void 0!==n.anisotropy?n.anisotropy:1,void 0!==n.format&&(a.format=n.format),void 0!==n.type&&(a.type=n.type),void 0!==n.mipmaps&&(a.mipmaps=n.mipmaps),1===n.mipmapCount&&(a.minFilter=1006),a.needsUpdate=!0,t&&t(a,n))}),n,r),a}}),Object.assign(mi.prototype,{crossOrigin:"Anonymous",load:function(e,t,n,r){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);var i=this,a=li.get(e);if(void 0!==a)return i.manager.itemStart(e),setTimeout((function(){t&&t(a),i.manager.itemEnd(e)}),0),a;var o=document.createElementNS("http://www.w3.org/1999/xhtml","img");return o.addEventListener("load",(function(){li.add(e,this),t&&t(this),i.manager.itemEnd(e)}),!1),o.addEventListener("error",(function(t){r&&r(t),i.manager.itemEnd(e),i.manager.itemError(e)}),!1),"data:"!==e.substr(0,5)&&void 0!==this.crossOrigin&&(o.crossOrigin=this.crossOrigin),i.manager.itemStart(e),o.src=e,o},setCrossOrigin:function(e){return this.crossOrigin=e,this},setPath:function(e){return this.path=e,this}}),Object.assign(gi.prototype,{crossOrigin:"Anonymous",load:function(e,t,n,r){var i=new T,a=new mi(this.manager);a.setCrossOrigin(this.crossOrigin),a.setPath(this.path);var o=0;function s(n){a.load(e[n],(function(e){i.images[n]=e,6===++o&&(i.needsUpdate=!0,t&&t(i))}),void 0,r)}for(var c=0;c<e.length;++c)s(c);return i},setCrossOrigin:function(e){return this.crossOrigin=e,this},setPath:function(e){return this.path=e,this}}),Object.assign(yi.prototype,{crossOrigin:"Anonymous",load:function(e,t,n,r){var i=new E,a=new mi(this.manager);return a.setCrossOrigin(this.crossOrigin),a.setPath(this.path),a.load(e,(function(n){i.image=n;var r=e.search(/\.(jpg|jpeg)$/)>0||0===e.search(/^data\:image\/jpeg/);i.format=r?1022:1023,i.needsUpdate=!0,void 0!==t&&t(i)}),n,r),i},setCrossOrigin:function(e){return this.crossOrigin=e,this},setPath:function(e){return this.path=e,this}}),Object.assign(vi.prototype,{getPoint:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null},getPointAt:function(e,t){var n=this.getUtoTmapping(e);return this.getPoint(n,t)},getPoints:function(e){void 0===e&&(e=5);for(var t=[],n=0;n<=e;n++)t.push(this.getPoint(n/e));return t},getSpacedPoints:function(e){void 0===e&&(e=5);for(var t=[],n=0;n<=e;n++)t.push(this.getPointAt(n/e));return t},getLength:function(){var e=this.getLengths();return e[e.length-1]},getLengths:function(e){if(void 0===e&&(e=this.arcLengthDivisions),this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var t,n,r=[],i=this.getPoint(0),a=0;for(r.push(0),n=1;n<=e;n++)a+=(t=this.getPoint(n/e)).distanceTo(i),r.push(a),i=t;return this.cacheArcLengths=r,r},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(e,t){var n,r=this.getLengths(),i=0,a=r.length;n=t||e*r[a-1];for(var o,s=0,c=a-1;s<=c;)if((o=r[i=Math.floor(s+(c-s)/2)]-n)<0)s=i+1;else{if(!(o>0)){c=i;break}c=i-1}if(r[i=c]===n)return i/(a-1);var l=r[i];return(i+(n-l)/(r[i+1]-l))/(a-1)},getTangent:function(e){var t=e-1e-4,n=e+1e-4;t<0&&(t=0),n>1&&(n=1);var r=this.getPoint(t);return this.getPoint(n).clone().sub(r).normalize()},getTangentAt:function(e){var t=this.getUtoTmapping(e);return this.getTangent(t)},computeFrenetFrames:function(e,t){var n,r,i,a=new b,o=[],s=[],c=[],l=new b,u=new y;for(n=0;n<=e;n++)r=n/e,o[n]=this.getTangentAt(r),o[n].normalize();s[0]=new b,c[0]=new b;var h=Number.MAX_VALUE,d=Math.abs(o[0].x),p=Math.abs(o[0].y),f=Math.abs(o[0].z);for(d<=h&&(h=d,a.set(1,0,0)),p<=h&&(h=p,a.set(0,1,0)),f<=h&&a.set(0,0,1),l.crossVectors(o[0],a).normalize(),s[0].crossVectors(o[0],l),c[0].crossVectors(o[0],s[0]),n=1;n<=e;n++)s[n]=s[n-1].clone(),c[n]=c[n-1].clone(),l.crossVectors(o[n-1],o[n]),l.length()>Number.EPSILON&&(l.normalize(),i=Math.acos(m.clamp(o[n-1].dot(o[n]),-1,1)),s[n].applyMatrix4(u.makeRotationAxis(l,i))),c[n].crossVectors(o[n],s[n]);if(!0===t)for(i=Math.acos(m.clamp(s[0].dot(s[e]),-1,1)),i/=e,o[0].dot(l.crossVectors(s[0],s[e]))>0&&(i=-i),n=1;n<=e;n++)s[n].applyMatrix4(u.makeRotationAxis(o[n],i*n)),c[n].crossVectors(o[n],s[n]);return{tangents:o,normals:s,binormals:c}},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this},toJSON:function(){var e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e},fromJSON:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}),bi.prototype=Object.create(vi.prototype),bi.prototype.constructor=bi,bi.prototype.isEllipseCurve=!0,bi.prototype.getPoint=function(e,t){for(var n=t||new g,r=2*Math.PI,i=this.aEndAngle-this.aStartAngle,a=Math.abs(i)<Number.EPSILON;i<0;)i+=r;for(;i>r;)i-=r;i<Number.EPSILON&&(i=a?0:r),!0!==this.aClockwise||a||(i===r?i=-r:i-=r);var o=this.aStartAngle+e*i,s=this.aX+this.xRadius*Math.cos(o),c=this.aY+this.yRadius*Math.sin(o);if(0!==this.aRotation){var l=Math.cos(this.aRotation),u=Math.sin(this.aRotation),h=s-this.aX,d=c-this.aY;s=h*l-d*u+this.aX,c=h*u+d*l+this.aY}return n.set(s,c)},bi.prototype.copy=function(e){return vi.prototype.copy.call(this,e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this},bi.prototype.toJSON=function(){var e=vi.prototype.toJSON.call(this);return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e},bi.prototype.fromJSON=function(e){return vi.prototype.fromJSON.call(this,e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this},wi.prototype=Object.create(bi.prototype),wi.prototype.constructor=wi,wi.prototype.isArcCurve=!0;var Ei=new b,xi=new Ai,_i=new Ai,Si=new Ai;function Mi(e,t,n,r){vi.call(this),this.type="CatmullRomCurve3",this.points=e||[],this.closed=t||!1,this.curveType=n||"centripetal",this.tension=r||.5}function Ti(e,t,n,r,i){var a=.5*(r-t),o=.5*(i-n),s=e*e;return(2*n-2*r+a+o)*(e*s)+(-3*n+3*r-2*a-o)*s+a*e+n}function Ri(e,t,n,r){return function(e,t){var n=1-e;return n*n*t}(e,t)+function(e,t){return 2*(1-e)*e*t}(e,n)+function(e,t){return e*e*t}(e,r)}function ki(e,t,n,r,i){return function(e,t){var n=1-e;return n*n*n*t}(e,t)+function(e,t){var n=1-e;return 3*n*n*e*t}(e,n)+function(e,t){return 3*(1-e)*e*e*t}(e,r)+function(e,t){return e*e*e*t}(e,i)}function Ci(e,t,n,r){vi.call(this),this.type="CubicBezierCurve",this.v0=e||new g,this.v1=t||new g,this.v2=n||new g,this.v3=r||new g}function Oi(e,t,n,r){vi.call(this),this.type="CubicBezierCurve3",this.v0=e||new b,this.v1=t||new b,this.v2=n||new b,this.v3=r||new b}function Pi(e,t){vi.call(this),this.type="LineCurve",this.v1=e||new g,this.v2=t||new g}function Ii(e,t){vi.call(this),this.type="LineCurve3",this.v1=e||new b,this.v2=t||new b}function Ni(e,t,n){vi.call(this),this.type="QuadraticBezierCurve",this.v0=e||new g,this.v1=t||new g,this.v2=n||new g}function Li(e,t,n){vi.call(this),this.type="QuadraticBezierCurve3",this.v0=e||new b,this.v1=t||new b,this.v2=n||new b}function Di(e){vi.call(this),this.type="SplineCurve",this.points=e||[]}Mi.prototype=Object.create(vi.prototype),Mi.prototype.constructor=Mi,Mi.prototype.isCatmullRomCurve3=!0,Mi.prototype.getPoint=function(e,t){var n,r,i,a,o=t||new b,s=this.points,c=s.length,l=(c-(this.closed?0:1))*e,u=Math.floor(l),h=l-u;if(this.closed?u+=u>0?0:(Math.floor(Math.abs(u)/s.length)+1)*s.length:0===h&&u===c-1&&(u=c-2,h=1),this.closed||u>0?n=s[(u-1)%c]:(Ei.subVectors(s[0],s[1]).add(s[0]),n=Ei),r=s[u%c],i=s[(u+1)%c],this.closed||u+2<c?a=s[(u+2)%c]:(Ei.subVectors(s[c-1],s[c-2]).add(s[c-1]),a=Ei),"centripetal"===this.curveType||"chordal"===this.curveType){var d="chordal"===this.curveType?.5:.25,p=Math.pow(n.distanceToSquared(r),d),f=Math.pow(r.distanceToSquared(i),d),m=Math.pow(i.distanceToSquared(a),d);f<1e-4&&(f=1),p<1e-4&&(p=f),m<1e-4&&(m=f),xi.initNonuniformCatmullRom(n.x,r.x,i.x,a.x,p,f,m),_i.initNonuniformCatmullRom(n.y,r.y,i.y,a.y,p,f,m),Si.initNonuniformCatmullRom(n.z,r.z,i.z,a.z,p,f,m)}else"catmullrom"===this.curveType&&(xi.initCatmullRom(n.x,r.x,i.x,a.x,this.tension),_i.initCatmullRom(n.y,r.y,i.y,a.y,this.tension),Si.initCatmullRom(n.z,r.z,i.z,a.z,this.tension));return o.set(xi.calc(h),_i.calc(h),Si.calc(h)),o},Mi.prototype.copy=function(e){vi.prototype.copy.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var r=e.points[t];this.points.push(r.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this},Mi.prototype.toJSON=function(){var e=vi.prototype.toJSON.call(this);e.points=[];for(var t=0,n=this.points.length;t<n;t++){var r=this.points[t];e.points.push(r.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e},Mi.prototype.fromJSON=function(e){vi.prototype.fromJSON.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var r=e.points[t];this.points.push((new b).fromArray(r))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this},Ci.prototype=Object.create(vi.prototype),Ci.prototype.constructor=Ci,Ci.prototype.isCubicBezierCurve=!0,Ci.prototype.getPoint=function(e,t){var n=t||new g,r=this.v0,i=this.v1,a=this.v2,o=this.v3;return n.set(ki(e,r.x,i.x,a.x,o.x),ki(e,r.y,i.y,a.y,o.y)),n},Ci.prototype.copy=function(e){return vi.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this},Ci.prototype.toJSON=function(){var e=vi.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e},Ci.prototype.fromJSON=function(e){return vi.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this},Oi.prototype=Object.create(vi.prototype),Oi.prototype.constructor=Oi,Oi.prototype.isCubicBezierCurve3=!0,Oi.prototype.getPoint=function(e,t){var n=t||new b,r=this.v0,i=this.v1,a=this.v2,o=this.v3;return n.set(ki(e,r.x,i.x,a.x,o.x),ki(e,r.y,i.y,a.y,o.y),ki(e,r.z,i.z,a.z,o.z)),n},Oi.prototype.copy=function(e){return vi.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this},Oi.prototype.toJSON=function(){var e=vi.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e},Oi.prototype.fromJSON=function(e){return vi.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this},Pi.prototype=Object.create(vi.prototype),Pi.prototype.constructor=Pi,Pi.prototype.isLineCurve=!0,Pi.prototype.getPoint=function(e,t){var n=t||new g;return 1===e?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n},Pi.prototype.getPointAt=function(e,t){return this.getPoint(e,t)},Pi.prototype.getTangent=function(){return this.v2.clone().sub(this.v1).normalize()},Pi.prototype.copy=function(e){return vi.prototype.copy.call(this,e),this.v1.copy(e.v1),this.v2.copy(e.v2),this},Pi.prototype.toJSON=function(){var e=vi.prototype.toJSON.call(this);return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},Pi.prototype.fromJSON=function(e){return vi.prototype.fromJSON.call(this,e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},Ii.prototype=Object.create(vi.prototype),Ii.prototype.constructor=Ii,Ii.prototype.isLineCurve3=!0,Ii.prototype.getPoint=function(e,t){var n=t||new b;return 1===e?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n},Ii.prototype.getPointAt=function(e,t){return this.getPoint(e,t)},Ii.prototype.copy=function(e){return vi.prototype.copy.call(this,e),this.v1.copy(e.v1),this.v2.copy(e.v2),this},Ii.prototype.toJSON=function(){var e=vi.prototype.toJSON.call(this);return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},Ii.prototype.fromJSON=function(e){return vi.prototype.fromJSON.call(this,e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},Ni.prototype=Object.create(vi.prototype),Ni.prototype.constructor=Ni,Ni.prototype.isQuadraticBezierCurve=!0,Ni.prototype.getPoint=function(e,t){var n=t||new g,r=this.v0,i=this.v1,a=this.v2;return n.set(Ri(e,r.x,i.x,a.x),Ri(e,r.y,i.y,a.y)),n},Ni.prototype.copy=function(e){return vi.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this},Ni.prototype.toJSON=function(){var e=vi.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},Ni.prototype.fromJSON=function(e){return vi.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},Li.prototype=Object.create(vi.prototype),Li.prototype.constructor=Li,Li.prototype.isQuadraticBezierCurve3=!0,Li.prototype.getPoint=function(e,t){var n=t||new b,r=this.v0,i=this.v1,a=this.v2;return n.set(Ri(e,r.x,i.x,a.x),Ri(e,r.y,i.y,a.y),Ri(e,r.z,i.z,a.z)),n},Li.prototype.copy=function(e){return vi.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this},Li.prototype.toJSON=function(){var e=vi.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},Li.prototype.fromJSON=function(e){return vi.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},Di.prototype=Object.create(vi.prototype),Di.prototype.constructor=Di,Di.prototype.isSplineCurve=!0,Di.prototype.getPoint=function(e,t){var n=t||new g,r=this.points,i=(r.length-1)*e,a=Math.floor(i),o=i-a,s=r[0===a?a:a-1],c=r[a],l=r[a>r.length-2?r.length-1:a+1],u=r[a>r.length-3?r.length-1:a+2];return n.set(Ti(o,s.x,c.x,l.x,u.x),Ti(o,s.y,c.y,l.y,u.y)),n},Di.prototype.copy=function(e){vi.prototype.copy.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var r=e.points[t];this.points.push(r.clone())}return this},Di.prototype.toJSON=function(){var e=vi.prototype.toJSON.call(this);e.points=[];for(var t=0,n=this.points.length;t<n;t++){var r=this.points[t];e.points.push(r.toArray())}return e},Di.prototype.fromJSON=function(e){vi.prototype.fromJSON.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var r=e.points[t];this.points.push((new g).fromArray(r))}return this};var Fi=Object.freeze({ArcCurve:wi,CatmullRomCurve3:Mi,CubicBezierCurve:Ci,CubicBezierCurve3:Oi,EllipseCurve:bi,LineCurve:Pi,LineCurve3:Ii,QuadraticBezierCurve:Ni,QuadraticBezierCurve3:Li,SplineCurve:Di});function ji(){vi.call(this),this.type="CurvePath",this.curves=[],this.autoClose=!1}function Ui(e){ji.call(this),this.type="Path",this.currentPoint=new g,e&&this.setFromPoints(e)}function Bi(e){Ui.call(this,e),this.uuid=m.generateUUID(),this.type="Shape",this.holes=[]}function Vi(e,t){qe.call(this),this.type="Light",this.color=new fe(e),this.intensity=void 0!==t?t:1,this.receiveShadow=void 0}function zi(e,t,n){Vi.call(this,e,n),this.type="HemisphereLight",this.castShadow=void 0,this.position.copy(qe.DefaultUp),this.updateMatrix(),this.groundColor=new fe(t)}function Hi(e){this.camera=e,this.bias=0,this.radius=1,this.mapSize=new g(512,512),this.map=null,this.matrix=new y}function Gi(){Hi.call(this,new nn(50,1,.5,500))}function qi(e,t,n,r,i,a){Vi.call(this,e,t),this.type="SpotLight",this.position.copy(qe.DefaultUp),this.updateMatrix(),this.target=new qe,Object.defineProperty(this,"power",{get:function(){return this.intensity*Math.PI},set:function(e){this.intensity=e/Math.PI}}),this.distance=void 0!==n?n:0,this.angle=void 0!==r?r:Math.PI/3,this.penumbra=void 0!==i?i:0,this.decay=void 0!==a?a:1,this.shadow=new Gi}function Wi(e,t,n,r){Vi.call(this,e,t),this.type="PointLight",Object.defineProperty(this,"power",{get:function(){return 4*this.intensity*Math.PI},set:function(e){this.intensity=e/(4*Math.PI)}}),this.distance=void 0!==n?n:0,this.decay=void 0!==r?r:1,this.shadow=new Hi(new nn(90,1,.5,500))}function Ji(){Hi.call(this,new Je(-5,5,5,-5,.5,500))}function Zi(e,t){Vi.call(this,e,t),this.type="DirectionalLight",this.position.copy(qe.DefaultUp),this.updateMatrix(),this.target=new qe,this.shadow=new Ji}function Xi(e,t){Vi.call(this,e,t),this.type="AmbientLight",this.castShadow=void 0}function Yi(e,t,n,r){Vi.call(this,e,t),this.type="RectAreaLight",this.width=void 0!==n?n:10,this.height=void 0!==r?r:10}function Ki(e,t,n,r){ca.call(this,e,t,n,r)}function Qi(e,t,n){ca.call(this,e,t,n)}function $i(e,t,n,r){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=void 0!==r?r:new t.constructor(n),this.sampleValues=t,this.valueSize=n}function ea(e,t,n,r){$i.call(this,e,t,n,r)}function ta(e,t,n,r){ca.call(this,e,t,n,r)}function na(e,t,n,r){ca.call(this,e,t,n,r)}function ra(e,t,n,r){ca.call(this,e,t,n,r)}function ia(e,t,n,r){$i.call(this,e,t,n,r),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0}function aa(e,t,n,r){$i.call(this,e,t,n,r)}function oa(e,t,n,r){$i.call(this,e,t,n,r)}ji.prototype=Object.assign(Object.create(vi.prototype),{constructor:ji,add:function(e){this.curves.push(e)},closePath:function(){var e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);e.equals(t)||this.curves.push(new Pi(t,e))},getPoint:function(e){for(var t=e*this.getLength(),n=this.getCurveLengths(),r=0;r<n.length;){if(n[r]>=t){var i=n[r]-t,a=this.curves[r],o=a.getLength(),s=0===o?0:1-i/o;return a.getPointAt(s)}r++}return null},getLength:function(){var e=this.getCurveLengths();return e[e.length-1]},updateArcLengths:function(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()},getCurveLengths:function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var e=[],t=0,n=0,r=this.curves.length;n<r;n++)t+=this.curves[n].getLength(),e.push(t);return this.cacheLengths=e,e},getSpacedPoints:function(e){void 0===e&&(e=40);for(var t=[],n=0;n<=e;n++)t.push(this.getPoint(n/e));return this.autoClose&&t.push(t[0]),t},getPoints:function(e){e=e||12;for(var t,n=[],r=0,i=this.curves;r<i.length;r++)for(var a=i[r],o=a&&a.isEllipseCurve?2*e:a&&a.isLineCurve?1:a&&a.isSplineCurve?e*a.points.length:e,s=a.getPoints(o),c=0;c<s.length;c++){var l=s[c];t&&t.equals(l)||(n.push(l),t=l)}return this.autoClose&&n.length>1&&!n[n.length-1].equals(n[0])&&n.push(n[0]),n},copy:function(e){vi.prototype.copy.call(this,e),this.curves=[];for(var t=0,n=e.curves.length;t<n;t++){var r=e.curves[t];this.curves.push(r.clone())}return this.autoClose=e.autoClose,this},toJSON:function(){var e=vi.prototype.toJSON.call(this);e.autoClose=this.autoClose,e.curves=[];for(var t=0,n=this.curves.length;t<n;t++){var r=this.curves[t];e.curves.push(r.toJSON())}return e},fromJSON:function(e){vi.prototype.fromJSON.call(this,e),this.autoClose=e.autoClose,this.curves=[];for(var t=0,n=e.curves.length;t<n;t++){var r=e.curves[t];this.curves.push((new Fi[r.type]).fromJSON(r))}return this}}),Ui.prototype=Object.assign(Object.create(ji.prototype),{constructor:Ui,setFromPoints:function(e){this.moveTo(e[0].x,e[0].y);for(var t=1,n=e.length;t<n;t++)this.lineTo(e[t].x,e[t].y)},moveTo:function(e,t){this.currentPoint.set(e,t)},lineTo:function(e,t){var n=new Pi(this.currentPoint.clone(),new g(e,t));this.curves.push(n),this.currentPoint.set(e,t)},quadraticCurveTo:function(e,t,n,r){var i=new Ni(this.currentPoint.clone(),new g(e,t),new g(n,r));this.curves.push(i),this.currentPoint.set(n,r)},bezierCurveTo:function(e,t,n,r,i,a){var o=new Ci(this.currentPoint.clone(),new g(e,t),new g(n,r),new g(i,a));this.curves.push(o),this.currentPoint.set(i,a)},splineThru:function(e){var t=new Di([this.currentPoint.clone()].concat(e));this.curves.push(t),this.currentPoint.copy(e[e.length-1])},arc:function(e,t,n,r,i,a){var o=this.currentPoint.x,s=this.currentPoint.y;this.absarc(e+o,t+s,n,r,i,a)},absarc:function(e,t,n,r,i,a){this.absellipse(e,t,n,n,r,i,a)},ellipse:function(e,t,n,r,i,a,o,s){var c=this.currentPoint.x,l=this.currentPoint.y;this.absellipse(e+c,t+l,n,r,i,a,o,s)},absellipse:function(e,t,n,r,i,a,o,s){var c=new bi(e,t,n,r,i,a,o,s);if(this.curves.length>0){var l=c.getPoint(0);l.equals(this.currentPoint)||this.lineTo(l.x,l.y)}this.curves.push(c);var u=c.getPoint(1);this.currentPoint.copy(u)},copy:function(e){return ji.prototype.copy.call(this,e),this.currentPoint.copy(e.currentPoint),this},toJSON:function(){var e=ji.prototype.toJSON.call(this);return e.currentPoint=this.currentPoint.toArray(),e},fromJSON:function(e){return ji.prototype.fromJSON.call(this,e),this.currentPoint.fromArray(e.currentPoint),this}}),Bi.prototype=Object.assign(Object.create(Ui.prototype),{constructor:Bi,getPointsHoles:function(e){for(var t=[],n=0,r=this.holes.length;n<r;n++)t[n]=this.holes[n].getPoints(e);return t},extractPoints:function(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}},copy:function(e){Ui.prototype.copy.call(this,e),this.holes=[];for(var t=0,n=e.holes.length;t<n;t++){var r=e.holes[t];this.holes.push(r.clone())}return this},toJSON:function(){var e=Ui.prototype.toJSON.call(this);e.uuid=this.uuid,e.holes=[];for(var t=0,n=this.holes.length;t<n;t++){var r=this.holes[t];e.holes.push(r.toJSON())}return e},fromJSON:function(e){Ui.prototype.fromJSON.call(this,e),this.uuid=e.uuid,this.holes=[];for(var t=0,n=e.holes.length;t<n;t++){var r=e.holes[t];this.holes.push((new Ui).fromJSON(r))}return this}}),Vi.prototype=Object.assign(Object.create(qe.prototype),{constructor:Vi,isLight:!0,copy:function(e){return qe.prototype.copy.call(this,e),this.color.copy(e.color),this.intensity=e.intensity,this},toJSON:function(e){var t=qe.prototype.toJSON.call(this,e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,void 0!==this.groundColor&&(t.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(t.object.distance=this.distance),void 0!==this.angle&&(t.object.angle=this.angle),void 0!==this.decay&&(t.object.decay=this.decay),void 0!==this.penumbra&&(t.object.penumbra=this.penumbra),void 0!==this.shadow&&(t.object.shadow=this.shadow.toJSON()),t}}),zi.prototype=Object.assign(Object.create(Vi.prototype),{constructor:zi,isHemisphereLight:!0,copy:function(e){return Vi.prototype.copy.call(this,e),this.groundColor.copy(e.groundColor),this}}),Object.assign(Hi.prototype,{copy:function(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){var e={};return 0!==this.bias&&(e.bias=this.bias),1!==this.radius&&(e.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}),Gi.prototype=Object.assign(Object.create(Hi.prototype),{constructor:Gi,isSpotLightShadow:!0,update:function(e){var t=this.camera,n=2*m.RAD2DEG*e.angle,r=this.mapSize.width/this.mapSize.height,i=e.distance||t.far;n===t.fov&&r===t.aspect&&i===t.far||(t.fov=n,t.aspect=r,t.far=i,t.updateProjectionMatrix())}}),qi.prototype=Object.assign(Object.create(Vi.prototype),{constructor:qi,isSpotLight:!0,copy:function(e){return Vi.prototype.copy.call(this,e),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}}),Wi.prototype=Object.assign(Object.create(Vi.prototype),{constructor:Wi,isPointLight:!0,copy:function(e){return Vi.prototype.copy.call(this,e),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}),Ji.prototype=Object.assign(Object.create(Hi.prototype),{constructor:Ji}),Zi.prototype=Object.assign(Object.create(Vi.prototype),{constructor:Zi,isDirectionalLight:!0,copy:function(e){return Vi.prototype.copy.call(this,e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}),Xi.prototype=Object.assign(Object.create(Vi.prototype),{constructor:Xi,isAmbientLight:!0}),Yi.prototype=Object.assign(Object.create(Vi.prototype),{constructor:Yi,isRectAreaLight:!0,copy:function(e){return Vi.prototype.copy.call(this,e),this.width=e.width,this.height=e.height,this},toJSON:function(e){var t=Vi.prototype.toJSON.call(this,e);return t.object.width=this.width,t.object.height=this.height,t}}),Ki.prototype=Object.assign(Object.create(ca.prototype),{constructor:Ki,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),Qi.prototype=Object.assign(Object.create(ca.prototype),{constructor:Qi,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),Object.assign($i.prototype,{evaluate:function(e){var t=this.parameterPositions,n=this._cachedIndex,r=t[n],i=t[n-1];e:{t:{var a;n:{r:if(!(e<r)){for(var o=n+2;;){if(void 0===r){if(e<i)break r;return n=t.length,this._cachedIndex=n,this.afterEnd_(n-1,e,i)}if(n===o)break;if(i=r,e<(r=t[++n]))break t}a=t.length;break n}if(e>=i)break e;var s=t[1];e<s&&(n=2,i=s);for(o=n-2;;){if(void 0===i)return this._cachedIndex=0,this.beforeStart_(0,e,r);if(n===o)break;if(r=i,e>=(i=t[--n-1]))break t}a=n,n=0}for(;n<a;){var c=n+a>>>1;e<t[c]?a=c:n=c+1}if(r=t[n],void 0===(i=t[n-1]))return this._cachedIndex=0,this.beforeStart_(0,e,r);if(void 0===r)return n=t.length,this._cachedIndex=n,this.afterEnd_(n-1,i,e)}this._cachedIndex=n,this.intervalChanged_(n,i,r)}return this.interpolate_(n,i,e,r)},settings:null,DefaultSettings_:{},getSettings_:function(){return this.settings||this.DefaultSettings_},copySampleValue_:function(e){for(var t=this.resultBuffer,n=this.sampleValues,r=this.valueSize,i=e*r,a=0;a!==r;++a)t[a]=n[i+a];return t},interpolate_:function(){throw new Error("call to abstract method")},intervalChanged_:function(){}}),
+var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function i(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}var a,o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:{},s=s||{},c=o||self;function l(){}function u(e){var t=typeof e;return"object"!=t?t:e?Array.isArray(e)?"array":t:"null"}function h(e){var t=u(e);return"array"==t||"object"==t&&"number"==typeof e.length}function d(e){var t=typeof e;return"object"==t&&null!=e||"function"==t}var p="closure_uid_"+(1e9*Math.random()>>>0),f=0;function m(e,t,n){return e.call.apply(e.bind,arguments)}function g(e,t,n){if(!e)throw Error();if(2<arguments.length){var r=Array.prototype.slice.call(arguments,2);return function(){var n=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(n,r),e.apply(t,n)}}return function(){return e.apply(t,arguments)}}function y(e,t,n){return(y=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?m:g).apply(null,arguments)}function v(e,t){var n=Array.prototype.slice.call(arguments,1);return function(){var t=n.slice();return t.push.apply(t,arguments),e.apply(this,t)}}var b=Date.now;function w(e,t){function n(){}n.prototype=t.prototype,e.S=t.prototype,e.prototype=new n,e.prototype.constructor=e}function A(){this.j=this.j,this.i=this.i}A.prototype.j=!1,A.prototype.ja=function(){if(!this.j&&(this.j=!0,this.G(),0))(function(e){Object.prototype.hasOwnProperty.call(e,p)&&e[p]||(e[p]=++f)})(this)},A.prototype.G=function(){if(this.i)for(;this.i.length;)this.i.shift()()};var E=Array.prototype.indexOf?function(e,t){return Array.prototype.indexOf.call(e,t,void 0)}:function(e,t){if("string"==typeof e)return"string"!=typeof t||1!=t.length?-1:e.indexOf(t,0);for(var n=0;n<e.length;n++)if(n in e&&e[n]===t)return n;return-1},x=Array.prototype.forEach?function(e,t,n){Array.prototype.forEach.call(e,t,n)}:function(e,t,n){for(var r=e.length,i="string"==typeof e?e.split(""):e,a=0;a<r;a++)a in i&&t.call(n,i[a],a,e)};function _(e){return Array.prototype.concat.apply([],arguments)}function S(e){var t=e.length;if(0<t){for(var n=Array(t),r=0;r<t;r++)n[r]=e[r];return n}return[]}function M(e){return/^[\s\xa0]*$/.test(e)}var T,R=String.prototype.trim?function(e){return e.trim()}:function(e){return/^[\s\xa0]*([\s\S]*?)[\s\xa0]*$/.exec(e)[1]};function k(e,t){return-1!=e.indexOf(t)}function C(e,t){return e<t?-1:e>t?1:0}e:{var O=c.navigator;if(O){var P=O.userAgent;if(P){T=P;break e}}T=""}function I(e,t,n){for(var r in e)t.call(n,e[r],r,e)}function N(e){var t={};for(var n in e)t[n]=e[n];return t}var L="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function D(e,t){for(var n,r,i=1;i<arguments.length;i++){for(n in r=arguments[i])e[n]=r[n];for(var a=0;a<L.length;a++)n=L[a],Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}}function F(e){return F[" "](e),e}F[" "]=l;var j,U,B=k(T,"Opera"),V=k(T,"Trident")||k(T,"MSIE"),z=k(T,"Edge"),H=z||V,G=k(T,"Gecko")&&!(k(T.toLowerCase(),"webkit")&&!k(T,"Edge"))&&!(k(T,"Trident")||k(T,"MSIE"))&&!k(T,"Edge"),q=k(T.toLowerCase(),"webkit")&&!k(T,"Edge");function W(){var e=c.document;return e?e.documentMode:void 0}e:{var J="",Z=(U=T,G?/rv:([^\);]+)(\)|;)/.exec(U):z?/Edge\/([\d\.]+)/.exec(U):V?/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(U):q?/WebKit\/(\S+)/.exec(U):B?/(?:Version)[ \/]?(\S+)/.exec(U):void 0);if(Z&&(J=Z?Z[1]:""),V){var X=W();if(null!=X&&X>parseFloat(J)){j=String(X);break e}}j=J}var Y,K={};function Q(e){return function(e,t){var n=K;return Object.prototype.hasOwnProperty.call(n,e)?n[e]:n[e]=t(e)}(e,(function(){for(var t=0,n=R(String(j)).split("."),r=R(String(e)).split("."),i=Math.max(n.length,r.length),a=0;0==t&&a<i;a++){var o=n[a]||"",s=r[a]||"";do{if(o=/(\d*)(\D*)(.*)/.exec(o)||["","","",""],s=/(\d*)(\D*)(.*)/.exec(s)||["","","",""],0==o[0].length&&0==s[0].length)break;t=C(0==o[1].length?0:parseInt(o[1],10),0==s[1].length?0:parseInt(s[1],10))||C(0==o[2].length,0==s[2].length)||C(o[2],s[2]),o=o[3],s=s[3]}while(0==t)}return 0<=t}))}if(c.document&&V){var $=W();Y=$||(parseInt(j,10)||void 0)}else Y=void 0;var ee=Y,te=!V||9<=Number(ee),ne=V&&!Q("9"),re=function(){if(!c.addEventListener||!Object.defineProperty)return!1;var e=!1,t=Object.defineProperty({},"passive",{get:function(){e=!0}});try{c.addEventListener("test",l,t),c.removeEventListener("test",l,t)}catch(e){}return e}();function ie(e,t){this.type=e,this.a=this.target=t,this.defaultPrevented=!1}function ae(e,t){if(ie.call(this,e?e.type:""),this.relatedTarget=this.a=this.target=null,this.button=this.screenY=this.screenX=this.clientY=this.clientX=0,this.key="",this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1,this.pointerId=0,this.pointerType="",this.c=null,e){var n=this.type=e.type,r=e.changedTouches&&e.changedTouches.length?e.changedTouches[0]:null;if(this.target=e.target||e.srcElement,this.a=t,t=e.relatedTarget){if(G){e:{try{F(t.nodeName);var i=!0;break e}catch(e){}i=!1}i||(t=null)}}else"mouseover"==n?t=e.fromElement:"mouseout"==n&&(t=e.toElement);this.relatedTarget=t,r?(this.clientX=void 0!==r.clientX?r.clientX:r.pageX,this.clientY=void 0!==r.clientY?r.clientY:r.pageY,this.screenX=r.screenX||0,this.screenY=r.screenY||0):(this.clientX=void 0!==e.clientX?e.clientX:e.pageX,this.clientY=void 0!==e.clientY?e.clientY:e.pageY,this.screenX=e.screenX||0,this.screenY=e.screenY||0),this.button=e.button,this.key=e.key||"",this.ctrlKey=e.ctrlKey,this.altKey=e.altKey,this.shiftKey=e.shiftKey,this.metaKey=e.metaKey,this.pointerId=e.pointerId||0,this.pointerType="string"==typeof e.pointerType?e.pointerType:oe[e.pointerType]||"",this.c=e,e.defaultPrevented&&this.b()}}ie.prototype.b=function(){this.defaultPrevented=!0},w(ae,ie);var oe={2:"touch",3:"pen",4:"mouse"};ae.prototype.b=function(){ae.S.b.call(this);var e=this.c;if(e.preventDefault)e.preventDefault();else if(e.returnValue=!1,ne)try{(e.ctrlKey||112<=e.keyCode&&123>=e.keyCode)&&(e.keyCode=-1)}catch(e){}};var se="closure_listenable_"+(1e6*Math.random()|0),ce=0;function le(e,t,n,r,i){this.listener=e,this.proxy=null,this.src=t,this.type=n,this.capture=!!r,this.ca=i,this.key=++ce,this.Y=this.Z=!1}function ue(e){e.Y=!0,e.listener=null,e.proxy=null,e.src=null,e.ca=null}function he(e){this.src=e,this.a={},this.b=0}function de(e,t){var n=t.type;if(n in e.a){var r,i=e.a[n],a=E(i,t);(r=0<=a)&&Array.prototype.splice.call(i,a,1),r&&(ue(t),0==e.a[n].length&&(delete e.a[n],e.b--))}}function pe(e,t,n,r){for(var i=0;i<e.length;++i){var a=e[i];if(!a.Y&&a.listener==t&&a.capture==!!n&&a.ca==r)return i}return-1}he.prototype.add=function(e,t,n,r,i){var a=e.toString();(e=this.a[a])||(e=this.a[a]=[],this.b++);var o=pe(e,t,r,i);return-1<o?(t=e[o],n||(t.Z=!1)):((t=new le(t,this.src,a,!!r,i)).Z=n,e.push(t)),t};var fe="closure_lm_"+(1e6*Math.random()|0),me={};function ge(e,t,n,r,i){if(r&&r.once)return function e(t,n,r,i,a){if(Array.isArray(n)){for(var o=0;o<n.length;o++)e(t,n[o],r,i,a);return null}return r=_e(r),t&&t[se]?t.wa(n,r,d(i)?!!i.capture:!!i,a):ye(t,n,r,!0,i,a)}(e,t,n,r,i);if(Array.isArray(t)){for(var a=0;a<t.length;a++)ge(e,t[a],n,r,i);return null}return n=_e(n),e&&e[se]?e.va(t,n,d(r)?!!r.capture:!!r,i):ye(e,t,n,!1,r,i)}function ye(e,t,n,r,i,a){if(!t)throw Error("Invalid event type");var o=d(i)?!!i.capture:!!i;if(o&&!te)return null;var s=Ee(e);if(s||(e[fe]=s=new he(e)),(n=s.add(t,n,r,o,a)).proxy)return n;if(r=function(){var e=Ae,t=te?function(n){return e.call(t.src,t.listener,n)}:function(n){if(!(n=e.call(t.src,t.listener,n)))return n};return t}(),n.proxy=r,r.src=e,r.listener=n,e.addEventListener)re||(i=o),void 0===i&&(i=!1),e.addEventListener(t.toString(),r,i);else if(e.attachEvent)e.attachEvent(be(t.toString()),r);else{if(!e.addListener||!e.removeListener)throw Error("addEventListener and attachEvent are unavailable.");e.addListener(r)}return n}function ve(e){if("number"!=typeof e&&e&&!e.Y){var t=e.src;if(t&&t[se])de(t.c,e);else{var n=e.type,r=e.proxy;t.removeEventListener?t.removeEventListener(n,r,e.capture):t.detachEvent?t.detachEvent(be(n),r):t.addListener&&t.removeListener&&t.removeListener(r),(n=Ee(t))?(de(n,e),0==n.b&&(n.src=null,t[fe]=null)):ue(e)}}}function be(e){return e in me?me[e]:me[e]="on"+e}function we(e,t){var n=e.listener,r=e.ca||e.src;return e.Z&&ve(e),n.call(r,t)}function Ae(e,t){if(e.Y)return!0;if(!te){if(!t)e:{t=["window","event"];for(var n=c,r=0;r<t.length;r++)if(null==(n=n[t[r]])){t=null;break e}t=n}return we(e,t=new ae(t,this))}return we(e,new ae(t,this))}function Ee(e){return(e=e[fe])instanceof he?e:null}var xe="__closure_events_fn_"+(1e9*Math.random()>>>0);function _e(e){return"function"==u(e)?e:(e[xe]||(e[xe]=function(t){return e.handleEvent(t)}),e[xe])}function Se(){A.call(this),this.c=new he(this),this.J=this,this.C=null}function Me(e,t,n,r){if(!(t=e.c.a[String(t)]))return!0;t=t.concat();for(var i=!0,a=0;a<t.length;++a){var o=t[a];if(o&&!o.Y&&o.capture==n){var s=o.listener,c=o.ca||o.src;o.Z&&de(e.c,o),i=!1!==s.call(c,r)&&i}}return i&&!r.defaultPrevented}w(Se,A),Se.prototype[se]=!0,(a=Se.prototype).addEventListener=function(e,t,n,r){ge(this,e,t,n,r)},a.removeEventListener=function(e,t,n,r){!function e(t,n,r,i,a){if(Array.isArray(n))for(var o=0;o<n.length;o++)e(t,n[o],r,i,a);else i=d(i)?!!i.capture:!!i,r=_e(r),t&&t[se]?(t=t.c,(n=String(n).toString())in t.a&&(-1<(r=pe(o=t.a[n],r,i,a))&&(ue(o[r]),Array.prototype.splice.call(o,r,1),0==o.length&&(delete t.a[n],t.b--)))):t&&(t=Ee(t))&&(n=t.a[n.toString()],t=-1,n&&(t=pe(n,r,i,a)),(r=-1<t?n[t]:null)&&ve(r))}(this,e,t,n,r)},a.dispatchEvent=function(e){var t,n=this.C;if(n)for(t=[];n;n=n.C)t.push(n);n=this.J;var r=e.type||e;if("string"==typeof e)e=new ie(e,n);else if(e instanceof ie)e.target=e.target||n;else{var i=e;D(e=new ie(r,n),i)}if(i=!0,t)for(var a=t.length-1;0<=a;a--){var o=e.a=t[a];i=Me(o,r,!0,e)&&i}if(i=Me(o=e.a=n,r,!0,e)&&i,i=Me(o,r,!1,e)&&i,t)for(a=0;a<t.length;a++)i=Me(o=e.a=t[a],r,!1,e)&&i;return i},a.G=function(){if(Se.S.G.call(this),this.c){var e,t=this.c;for(e in t.a){for(var n=t.a[e],r=0;r<n.length;r++)ue(n[r]);delete t.a[e],t.b--}}this.C=null},a.va=function(e,t,n,r){return this.c.add(String(e),t,!1,n,r)},a.wa=function(e,t,n,r){return this.c.add(String(e),t,!0,n,r)};var Te=c.JSON.stringify;function Re(){this.b=this.a=null}var ke,Ce=new(function(){function e(e,t,n){this.f=n,this.c=e,this.g=t,this.b=0,this.a=null}return e.prototype.get=function(){var e;return 0<this.b?(this.b--,e=this.a,this.a=e.next,e.next=null):e=this.c(),e},e}())((function(){return new Pe}),(function(e){e.reset()}),100);function Oe(){var e=De,t=null;return e.a&&(t=e.a,e.a=e.a.next,e.a||(e.b=null),t.next=null),t}function Pe(){this.next=this.b=this.a=null}function Ie(e){c.setTimeout((function(){throw e}),0)}function Ne(e,t){ke||function(){var e=c.Promise.resolve(void 0);ke=function(){e.then(Fe)}}(),Le||(ke(),Le=!0),De.add(e,t)}Re.prototype.add=function(e,t){var n=Ce.get();n.set(e,t),this.b?this.b.next=n:this.a=n,this.b=n},Pe.prototype.set=function(e,t){this.a=e,this.b=t,this.next=null},Pe.prototype.reset=function(){this.next=this.b=this.a=null};var Le=!1,De=new Re;function Fe(){for(var e;e=Oe();){try{e.a.call(e.b)}catch(e){Ie(e)}var t=Ce;t.g(e),t.b<t.f&&(t.b++,e.next=t.a,t.a=e)}Le=!1}function je(e,t){Se.call(this),this.b=e||1,this.a=t||c,this.f=y(this.Ya,this),this.g=b()}function Ue(e){e.aa=!1,e.M&&(e.a.clearTimeout(e.M),e.M=null)}function Be(e,t,n){if("function"==u(e))n&&(e=y(e,n));else{if(!e||"function"!=typeof e.handleEvent)throw Error("Invalid listener argument");e=y(e.handleEvent,e)}return 2147483647<Number(t)?-1:c.setTimeout(e,t||0)}function Ve(e){e.a=Be((function(){e.a=null,e.c&&(e.c=!1,Ve(e))}),e.h);var t=e.b;e.b=null,e.g.apply(null,t)}w(je,Se),(a=je.prototype).aa=!1,a.M=null,a.Ya=function(){if(this.aa){var e=b()-this.g;0<e&&e<.8*this.b?this.M=this.a.setTimeout(this.f,this.b-e):(this.M&&(this.a.clearTimeout(this.M),this.M=null),this.dispatchEvent("tick"),this.aa&&(Ue(this),this.start()))}},a.start=function(){this.aa=!0,this.M||(this.M=this.a.setTimeout(this.f,this.b),this.g=b())},a.G=function(){je.S.G.call(this),Ue(this),delete this.a};var ze=function(e){function t(t,n,r){var i=e.call(this)||this;return i.g=null!=r?t.bind(r):t,i.h=n,i.b=null,i.c=!1,i.a=null,i}return function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t.prototype.f=function(e){this.b=arguments,this.a?this.c=!0:Ve(this)},t.prototype.G=function(){e.prototype.G.call(this),this.a&&(c.clearTimeout(this.a),this.a=null,this.c=!1,this.b=null)},t}(A);function He(e){A.call(this),this.b=e,this.a={}}w(He,A);var Ge=[];function qe(e,t,n,r){Array.isArray(n)||(n&&(Ge[0]=n.toString()),n=Ge);for(var i=0;i<n.length;i++){var a=ge(t,n[i],r||e.handleEvent,!1,e.b||e);if(!a)break;e.a[a.key]=a}}function We(e){I(e.a,(function(e,t){this.a.hasOwnProperty(t)&&ve(e)}),e),e.a={}}function Je(){this.a=!0}function Ze(e,t,n,r){e.info((function(){return"XMLHTTP TEXT ("+t+"): "+function(e,t){if(!e.a)return t;if(!t)return null;try{var n=JSON.parse(t);if(n)for(e=0;e<n.length;e++)if(Array.isArray(n[e])){var r=n[e];if(!(2>r.length)){var i=r[1];if(Array.isArray(i)&&!(1>i.length)){var a=i[0];if("noop"!=a&&"stop"!=a&&"close"!=a)for(var o=1;o<i.length;o++)i[o]=""}}}return Te(n)}catch(e){return t}}(e,n)+(r?" "+r:"")}))}He.prototype.G=function(){He.S.G.call(this),We(this)},He.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented")},Je.prototype.info=function(){};var Xe=null;function Ye(){return Xe=Xe||new Se}function Ke(e){ie.call(this,"serverreachability",e)}function Qe(e){var t=Ye();t.dispatchEvent(new Ke(t,e))}function $e(e){ie.call(this,"statevent",e)}function et(e){var t=Ye();t.dispatchEvent(new $e(t,e))}function tt(e){ie.call(this,"timingevent",e)}function nt(e,t){if("function"!=u(e))throw Error("Fn must not be null and must be a function");return c.setTimeout((function(){e()}),t)}w(Ke,ie),w($e,ie),w(tt,ie);var rt={NO_ERROR:0,Za:1,gb:2,fb:3,bb:4,eb:5,hb:6,Da:7,TIMEOUT:8,kb:9},it={ab:"complete",ob:"success",Ea:"error",Da:"abort",mb:"ready",nb:"readystatechange",TIMEOUT:"timeout",ib:"incrementaldata",lb:"progress",cb:"downloadprogress",pb:"uploadprogress"};function at(){}function ot(e){var t;return(t=e.a)||(t=e.a={}),t}function st(){}at.prototype.a=null;var ct,lt={OPEN:"a",$a:"b",Ea:"c",jb:"d"};function ut(){ie.call(this,"d")}function ht(){ie.call(this,"c")}function dt(){}function pt(e,t,n,r){this.g=e,this.c=t,this.f=n,this.T=r||1,this.J=new He(this),this.P=ft,e=H?125:void 0,this.R=new je(e),this.B=null,this.b=!1,this.j=this.l=this.i=this.H=this.u=this.U=this.o=null,this.s=[],this.a=null,this.D=0,this.h=this.m=null,this.N=-1,this.A=!1,this.O=0,this.F=null,this.W=this.C=this.V=this.I=!1}w(ut,ie),w(ht,ie),w(dt,at),ct=new dt;var ft=45e3,mt={},gt={};function yt(e,t,n){e.H=1,e.i=Ut(It(t)),e.j=n,e.I=!0,vt(e,null)}function vt(e,t){e.u=b(),At(e),e.l=It(e.i);var n=e.l,r=e.T;Array.isArray(r)||(r=[String(r)]),Qt(n.b,"t",r),e.D=0,e.a=Jn(e.g,e.g.C?t:null),0<e.O&&(e.F=new ze(y(e.Ca,e,e.a),e.O)),qe(e.J,e.a,"readystatechange",e.Wa),t=e.B?N(e.B):{},e.j?(e.m||(e.m="POST"),t["Content-Type"]="application/x-www-form-urlencoded",e.a.ba(e.l,e.m,e.j,t)):(e.m="GET",e.a.ba(e.l,e.m,null,t)),Qe(1),function(e,t,n,r,i,a){e.info((function(){if(e.a)if(a)for(var o="",s=a.split("&"),c=0;c<s.length;c++){var l=s[c].split("=");if(1<l.length){var u=l[0];l=l[1];var h=u.split("_");o=2<=h.length&&"type"==h[1]?o+(u+"=")+l+"&":o+(u+"=redacted&")}}else o=null;else o=a;return"XMLHTTP REQ ("+r+") [attempt "+i+"]: "+t+"\n"+n+"\n"+o}))}(e.c,e.m,e.l,e.f,e.T,e.j)}function bt(e,t,n){for(var r=!0;!e.A&&e.D<n.length;){var i=wt(e,n);if(i==gt){4==t&&(e.h=4,et(14),r=!1),Ze(e.c,e.f,null,"[Incomplete Response]");break}if(i==mt){e.h=4,et(15),Ze(e.c,e.f,n,"[Invalid Chunk]"),r=!1;break}Ze(e.c,e.f,i,null),Mt(e,i)}4==t&&0==n.length&&(e.h=1,et(16),r=!1),e.b=e.b&&r,r?0<n.length&&!e.W&&(e.W=!0,(t=e.g).a==e&&t.V&&!t.F&&(t.c.info("Great, no buffering proxy detected. Bytes received: "+n.length),Un(t),t.F=!0)):(Ze(e.c,e.f,n,"[Invalid Chunked Response]"),St(e),_t(e))}function wt(e,t){var n=e.D,r=t.indexOf("\n",n);return-1==r?gt:(n=Number(t.substring(n,r)),isNaN(n)?mt:(r+=1)+n>t.length?gt:(t=t.substr(r,n),e.D=r+n,t))}function At(e){e.U=b()+e.P,Et(e,e.P)}function Et(e,t){if(null!=e.o)throw Error("WatchDog timer not null");e.o=nt(y(e.Ua,e),t)}function xt(e){e.o&&(c.clearTimeout(e.o),e.o=null)}function _t(e){0==e.g.v||e.A||zn(e.g,e)}function St(e){xt(e);var t=e.F;t&&"function"==typeof t.ja&&t.ja(),e.F=null,Ue(e.R),We(e.J),e.a&&(t=e.a,e.a=null,t.abort(),t.ja())}function Mt(e,t){try{var n=e.g;if(0!=n.v&&(n.a==e||on(n.b,e)))if(n.I=e.N,!e.C&&on(n.b,e)&&3==n.v){try{var r=n.ka.a.parse(t)}catch(e){r=null}if(Array.isArray(r)&&3==r.length){var i=r;if(0==i[0]){e:if(!n.j){if(n.a){if(!(n.a.u+3e3<e.u))break e;Vn(n),Cn(n)}jn(n),et(18)}}else n.oa=i[1],0<n.oa-n.P&&37500>i[2]&&n.H&&0==n.o&&!n.m&&(n.m=nt(y(n.Ra,n),6e3));if(1>=an(n.b)&&n.ea){try{n.ea()}catch(e){}n.ea=void 0}}else Gn(n,11)}else if((e.C||n.a==e)&&Vn(n),!M(t))for(t=r=n.ka.a.parse(t),r=0;r<t.length;r++)if(i=t[r],n.P=i[0],i=i[1],2==n.v)if("c"==i[0]){n.J=i[1],n.ga=i[2];var a=i[3];null!=a&&(n.ha=a,n.c.info("VER="+n.ha));var o=i[4];null!=o&&(n.pa=o,n.c.info("SVER="+n.pa));var s=i[5];if(null!=s&&"number"==typeof s&&0<s){var c=1.5*s;n.D=c,n.c.info("backChannelRequestTimeoutMs_="+c)}c=n;var l=e.a;if(l){var u=l.a?l.a.getResponseHeader("X-Client-Wire-Protocol"):null;if(u){var h=c.b;!h.a&&(k(u,"spdy")||k(u,"quic")||k(u,"h2"))&&(h.f=h.g,h.a=new Set,h.b&&(sn(h,h.b),h.b=null))}if(c.A){var d=l.a?l.a.getResponseHeader("X-HTTP-Session-Id"):null;d&&(c.na=d,jt(c.B,c.A,d))}}n.v=3,n.f&&n.f.ta(),n.V&&(n.N=b()-e.u,n.c.info("Handshake RTT: "+n.N+"ms"));var p=e;if((c=n).la=Wn(c,c.C?c.ga:null,c.fa),p.C){cn(c.b,p);var f=p,m=c.D;m&&f.setTimeout(m),f.o&&(xt(f),At(f)),c.a=p}else Fn(c);0<n.g.length&&In(n)}else"stop"!=i[0]&&"close"!=i[0]||Gn(n,7);else 3==n.v&&("stop"==i[0]||"close"==i[0]?"stop"==i[0]?Gn(n,7):kn(n):"noop"!=i[0]&&n.f&&n.f.sa(i),n.o=0);Qe(4)}catch(e){}}function Tt(e,t){if(e.forEach&&"function"==typeof e.forEach)e.forEach(t,void 0);else if(h(e)||"string"==typeof e)x(e,t,void 0);else{if(e.L&&"function"==typeof e.L)var n=e.L();else if(e.K&&"function"==typeof e.K)n=void 0;else if(h(e)||"string"==typeof e){n=[];for(var r=e.length,i=0;i<r;i++)n.push(i)}else for(i in n=[],r=0,e)n[r++]=i;i=(r=function(e){if(e.K&&"function"==typeof e.K)return e.K();if("string"==typeof e)return e.split("");if(h(e)){for(var t=[],n=e.length,r=0;r<n;r++)t.push(e[r]);return t}for(r in t=[],n=0,e)t[n++]=e[r];return t}(e)).length;for(var a=0;a<i;a++)t.call(void 0,r[a],n&&n[a],e)}}function Rt(e,t){this.b={},this.a=[],this.c=0;var n=arguments.length;if(1<n){if(n%2)throw Error("Uneven number of arguments");for(var r=0;r<n;r+=2)this.set(arguments[r],arguments[r+1])}else if(e)if(e instanceof Rt)for(n=e.L(),r=0;r<n.length;r++)this.set(n[r],e.get(n[r]));else for(r in e)this.set(r,e[r])}function kt(e){if(e.c!=e.a.length){for(var t=0,n=0;t<e.a.length;){var r=e.a[t];Ct(e.b,r)&&(e.a[n++]=r),t++}e.a.length=n}if(e.c!=e.a.length){var i={};for(n=t=0;t<e.a.length;)Ct(i,r=e.a[t])||(e.a[n++]=r,i[r]=1),t++;e.a.length=n}}function Ct(e,t){return Object.prototype.hasOwnProperty.call(e,t)}(a=pt.prototype).setTimeout=function(e){this.P=e},a.Wa=function(e){e=e.target;var t=this.F;t&&3==Sn(e)?t.f():this.Ca(e)},a.Ca=function(e){try{if(e==this.a)e:{var t=Sn(this.a),n=this.a.ua(),r=this.a.X();if(!(3>t||3==t&&!H&&!this.a.$())){this.A||4!=t||7==n||Qe(8==n||0>=r?3:2),xt(this);var i=this.a.X();this.N=i;var a=this.a.$();if(this.b=200==i,function(e,t,n,r,i,a,o){e.info((function(){return"XMLHTTP RESP ("+r+") [ attempt "+i+"]: "+t+"\n"+n+"\n"+a+" "+o}))}(this.c,this.m,this.l,this.f,this.T,t,i),this.b){if(this.V&&!this.C){t:{if(this.a){var o,s=this.a;if((o=s.a?s.a.getResponseHeader("X-HTTP-Initial-Response"):null)&&!M(o)){var c=o;break t}}c=null}if(!c){this.b=!1,this.h=3,et(12),St(this),_t(this);break e}Ze(this.c,this.f,c,"Initial handshake response via X-HTTP-Initial-Response"),this.C=!0,Mt(this,c)}this.I?(bt(this,t,a),H&&this.b&&3==t&&(qe(this.J,this.R,"tick",this.Va),this.R.start())):(Ze(this.c,this.f,a,null),Mt(this,a)),4==t&&St(this),this.b&&!this.A&&(4==t?zn(this.g,this):(this.b=!1,At(this)))}else 400==i&&0<a.indexOf("Unknown SID")?(this.h=3,et(12)):(this.h=0,et(13)),St(this),_t(this)}}}catch(e){}},a.Va=function(){if(this.a){var e=Sn(this.a),t=this.a.$();this.D<t.length&&(xt(this),bt(this,e,t),this.b&&4!=e&&At(this))}},a.cancel=function(){this.A=!0,St(this)},a.Ua=function(){this.o=null;var e=b();0<=e-this.U?(function(e,t){e.info((function(){return"TIMEOUT: "+t}))}(this.c,this.l),2!=this.H&&(Qe(3),et(17)),St(this),this.h=2,_t(this)):Et(this,this.U-e)},(a=Rt.prototype).K=function(){kt(this);for(var e=[],t=0;t<this.a.length;t++)e.push(this.b[this.a[t]]);return e},a.L=function(){return kt(this),this.a.concat()},a.get=function(e,t){return Ct(this.b,e)?this.b[e]:t},a.set=function(e,t){Ct(this.b,e)||(this.c++,this.a.push(e)),this.b[e]=t},a.forEach=function(e,t){for(var n=this.L(),r=0;r<n.length;r++){var i=n[r],a=this.get(i);e.call(t,a,i,this)}};var Ot=/^(?:([^:/?#.]+):)?(?:\/\/(?:([^\\/?#]*)@)?([^\\/?#]*?)(?::([0-9]+))?(?=[\\/?#]|$))?([^?#]+)?(?:\?([^#]*))?(?:#([\s\S]*))?$/;function Pt(e,t){if(this.c=this.j=this.f="",this.h=null,this.i=this.g="",this.a=!1,e instanceof Pt){this.a=void 0!==t?t:e.a,Nt(this,e.f),this.j=e.j,Lt(this,e.c),Dt(this,e.h),this.g=e.g,t=e.b;var n=new Zt;n.c=t.c,t.a&&(n.a=new Rt(t.a),n.b=t.b),Ft(this,n),this.i=e.i}else e&&(n=String(e).match(Ot))?(this.a=!!t,Nt(this,n[1]||"",!0),this.j=Bt(n[2]||""),Lt(this,n[3]||"",!0),Dt(this,n[4]),this.g=Bt(n[5]||"",!0),Ft(this,n[6]||"",!0),this.i=Bt(n[7]||"")):(this.a=!!t,this.b=new Zt(null,this.a))}function It(e){return new Pt(e)}function Nt(e,t,n){e.f=n?Bt(t,!0):t,e.f&&(e.f=e.f.replace(/:$/,""))}function Lt(e,t,n){e.c=n?Bt(t,!0):t}function Dt(e,t){if(t){if(t=Number(t),isNaN(t)||0>t)throw Error("Bad port number "+t);e.h=t}else e.h=null}function Ft(e,t,n){t instanceof Zt?(e.b=t,function(e,t){t&&!e.f&&(Xt(e),e.c=null,e.a.forEach((function(e,t){var n=t.toLowerCase();t!=n&&(Yt(this,t),Qt(this,n,e))}),e)),e.f=t}(e.b,e.a)):(n||(t=Vt(t,Wt)),e.b=new Zt(t,e.a))}function jt(e,t,n){e.b.set(t,n)}function Ut(e){return jt(e,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^b()).toString(36)),e}function Bt(e,t){return e?t?decodeURI(e.replace(/%25/g,"%2525")):decodeURIComponent(e):""}function Vt(e,t,n){return"string"==typeof e?(e=encodeURI(e).replace(t,zt),n&&(e=e.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),e):null}function zt(e){return"%"+((e=e.charCodeAt(0))>>4&15).toString(16)+(15&e).toString(16)}Pt.prototype.toString=function(){var e=[],t=this.f;t&&e.push(Vt(t,Ht,!0),":");var n=this.c;return(n||"file"==t)&&(e.push("//"),(t=this.j)&&e.push(Vt(t,Ht,!0),"@"),e.push(encodeURIComponent(String(n)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),null!=(n=this.h)&&e.push(":",String(n))),(n=this.g)&&(this.c&&"/"!=n.charAt(0)&&e.push("/"),e.push(Vt(n,"/"==n.charAt(0)?qt:Gt,!0))),(n=this.b.toString())&&e.push("?",n),(n=this.i)&&e.push("#",Vt(n,Jt)),e.join("")};var Ht=/[#\/\?@]/g,Gt=/[#\?:]/g,qt=/[#\?]/g,Wt=/[#\?@]/g,Jt=/#/g;function Zt(e,t){this.b=this.a=null,this.c=e||null,this.f=!!t}function Xt(e){e.a||(e.a=new Rt,e.b=0,e.c&&function(e,t){if(e){e=e.split("&");for(var n=0;n<e.length;n++){var r=e[n].indexOf("="),i=null;if(0<=r){var a=e[n].substring(0,r);i=e[n].substring(r+1)}else a=e[n];t(a,i?decodeURIComponent(i.replace(/\+/g," ")):"")}}}(e.c,(function(t,n){e.add(decodeURIComponent(t.replace(/\+/g," ")),n)})))}function Yt(e,t){Xt(e),t=$t(e,t),Ct(e.a.b,t)&&(e.c=null,e.b-=e.a.get(t).length,Ct((e=e.a).b,t)&&(delete e.b[t],e.c--,e.a.length>2*e.c&&kt(e)))}function Kt(e,t){return Xt(e),t=$t(e,t),Ct(e.a.b,t)}function Qt(e,t,n){Yt(e,t),0<n.length&&(e.c=null,e.a.set($t(e,t),S(n)),e.b+=n.length)}function $t(e,t){return t=String(t),e.f&&(t=t.toLowerCase()),t}function en(e,t){this.b=e,this.a=t}function tn(e){this.g=e||nn,c.PerformanceNavigationTiming?e=0<(e=c.performance.getEntriesByType("navigation")).length&&("hq"==e[0].nextHopProtocol||"h2"==e[0].nextHopProtocol):e=!!(c.ia&&c.ia.ya&&c.ia.ya()&&c.ia.ya().qb),this.f=e?this.g:1,this.a=null,1<this.f&&(this.a=new Set),this.b=null,this.c=[]}(a=Zt.prototype).add=function(e,t){Xt(this),this.c=null,e=$t(this,e);var n=this.a.get(e);return n||this.a.set(e,n=[]),n.push(t),this.b+=1,this},a.forEach=function(e,t){Xt(this),this.a.forEach((function(n,r){x(n,(function(n){e.call(t,n,r,this)}),this)}),this)},a.L=function(){Xt(this);for(var e=this.a.K(),t=this.a.L(),n=[],r=0;r<t.length;r++)for(var i=e[r],a=0;a<i.length;a++)n.push(t[r]);return n},a.K=function(e){Xt(this);var t=[];if("string"==typeof e)Kt(this,e)&&(t=_(t,this.a.get($t(this,e))));else{e=this.a.K();for(var n=0;n<e.length;n++)t=_(t,e[n])}return t},a.set=function(e,t){return Xt(this),this.c=null,Kt(this,e=$t(this,e))&&(this.b-=this.a.get(e).length),this.a.set(e,[t]),this.b+=1,this},a.get=function(e,t){return e&&0<(e=this.K(e)).length?String(e[0]):t},a.toString=function(){if(this.c)return this.c;if(!this.a)return"";for(var e=[],t=this.a.L(),n=0;n<t.length;n++){var r=t[n],i=encodeURIComponent(String(r));r=this.K(r);for(var a=0;a<r.length;a++){var o=i;""!==r[a]&&(o+="="+encodeURIComponent(String(r[a]))),e.push(o)}}return this.c=e.join("&")};var nn=10;function rn(e){return!!e.b||!!e.a&&e.a.size>=e.f}function an(e){return e.b?1:e.a?e.a.size:0}function on(e,t){return e.b?e.b==t:!!e.a&&e.a.has(t)}function sn(e,t){e.a?e.a.add(t):e.b=t}function cn(e,t){e.b&&e.b==t?e.b=null:e.a&&e.a.has(t)&&e.a.delete(t)}function ln(e){var t,n;if(null!=e.b)return e.c.concat(e.b.s);if(null!=e.a&&0!==e.a.size){var r=e.c;try{for(var a=i(e.a.values()),o=a.next();!o.done;o=a.next()){var s=o.value;r=r.concat(s.s)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return r}return S(e.c)}function un(){}function hn(){this.a=new un}function dn(e,t,n){var r=n||"";try{Tt(e,(function(e,n){var i=e;d(e)&&(i=Te(e)),t.push(r+n+"="+encodeURIComponent(i))}))}catch(e){throw t.push(r+"type="+encodeURIComponent("_badmap")),e}}function pn(e,t,n,r,i){try{t.onload=null,t.onerror=null,t.onabort=null,t.ontimeout=null,i(r)}catch(e){}}tn.prototype.cancel=function(){var e,t;if(this.c=ln(this),this.b)this.b.cancel(),this.b=null;else if(this.a&&0!==this.a.size){try{for(var n=i(this.a.values()),r=n.next();!r.done;r=n.next()){r.value.cancel()}}catch(t){e={error:t}}finally{try{r&&!r.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}this.a.clear()}},un.prototype.stringify=function(e){return c.JSON.stringify(e,void 0)},un.prototype.parse=function(e){return c.JSON.parse(e,void 0)};var fn=c.JSON.parse;function mn(e){Se.call(this),this.headers=new Rt,this.H=e||null,this.b=!1,this.s=this.a=null,this.B="",this.h=0,this.f="",this.g=this.A=this.l=this.u=!1,this.o=0,this.m=null,this.I=gn,this.D=this.F=!1}w(mn,Se);var gn="",yn=/^https?$/i,vn=["POST","PUT"];function bn(e){return"content-type"==e.toLowerCase()}function wn(e,t){e.b=!1,e.a&&(e.g=!0,e.a.abort(),e.g=!1),e.f=t,e.h=5,An(e),xn(e)}function An(e){e.u||(e.u=!0,e.dispatchEvent("complete"),e.dispatchEvent("error"))}function En(e){if(e.b&&void 0!==s&&(!e.s[1]||4!=Sn(e)||2!=e.X()))if(e.l&&4==Sn(e))Be(e.za,0,e);else if(e.dispatchEvent("readystatechange"),4==Sn(e)){e.b=!1;try{var t,n=e.X();e:switch(n){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var r=!0;break e;default:r=!1}if(!(t=r)){var i;if(i=0===n){var a=String(e.B).match(Ot)[1]||null;if(!a&&c.self&&c.self.location){var o=c.self.location.protocol;a=o.substr(0,o.length-1)}i=!yn.test(a?a.toLowerCase():"")}t=i}if(t)e.dispatchEvent("complete"),e.dispatchEvent("success");else{e.h=6;try{var l=2<Sn(e)?e.a.statusText:""}catch(e){l=""}e.f=l+" ["+e.X()+"]",An(e)}}finally{xn(e)}}}function xn(e,t){if(e.a){_n(e);var n=e.a,r=e.s[0]?l:null;e.a=null,e.s=null,t||e.dispatchEvent("ready");try{n.onreadystatechange=r}catch(e){}}}function _n(e){e.a&&e.D&&(e.a.ontimeout=null),e.m&&(c.clearTimeout(e.m),e.m=null)}function Sn(e){return e.a?e.a.readyState:0}function Mn(e,t,n){e:{for(r in n){var r=!1;break e}r=!0}r||(n=function(e){var t="";return I(e,(function(e,n){t+=n,t+=":",t+=e,t+="\r\n"})),t}(n),"string"==typeof e?null!=n&&encodeURIComponent(String(n)):jt(e,t,n))}function Tn(e,t,n){return n&&n.internalChannelParams&&n.internalChannelParams[e]||t}function Rn(e){this.pa=0,this.g=[],this.c=new Je,this.ga=this.la=this.B=this.fa=this.a=this.na=this.A=this.W=this.i=this.O=this.l=null,this.La=this.R=0,this.Ia=Tn("failFast",!1,e),this.H=this.m=this.j=this.h=this.f=null,this.T=!0,this.I=this.oa=this.P=-1,this.U=this.o=this.u=0,this.Fa=Tn("baseRetryDelayMs",5e3,e),this.Ma=Tn("retryDelaySeedMs",1e4,e),this.Ja=Tn("forwardChannelMaxRetries",2,e),this.ma=Tn("forwardChannelRequestTimeoutMs",2e4,e),this.Ka=e&&e.g||void 0,this.D=void 0,this.C=e&&e.supportsCrossDomainXhr||!1,this.J="",this.b=new tn(e&&e.concurrentRequestLimit),this.ka=new hn,this.da=e&&e.fastHandshake||!1,this.Ga=e&&e.b||!1,e&&e.f&&(this.c.a=!1),e&&e.forceLongPolling&&(this.T=!1),this.V=!this.da&&this.T&&e&&e.c||!1,this.ea=void 0,this.N=0,this.F=!1,this.s=null}function kn(e){if(On(e),3==e.v){var t=e.R++,n=It(e.B);jt(n,"SID",e.J),jt(n,"RID",t),jt(n,"TYPE","terminate"),Ln(e,n),(t=new pt(e,e.c,t,void 0)).H=2,t.i=Ut(It(n)),n=!1,c.navigator&&c.navigator.sendBeacon&&(n=c.navigator.sendBeacon(t.i.toString(),"")),!n&&c.Image&&((new Image).src=t.i,n=!0),n||(t.a=Jn(t.g,null),t.a.ba(t.i)),t.u=b(),At(t)}qn(e)}function Cn(e){e.a&&(Un(e),e.a.cancel(),e.a=null)}function On(e){Cn(e),e.j&&(c.clearTimeout(e.j),e.j=null),Vn(e),e.b.cancel(),e.h&&("number"==typeof e.h&&c.clearTimeout(e.h),e.h=null)}function Pn(e,t){e.g.push(new en(e.La++,t)),3==e.v&&In(e)}function In(e){rn(e.b)||e.h||(e.h=!0,Ne(e.Ba,e),e.u=0)}function Nn(e,t){var n;n=t?t.f:e.R++;var r=It(e.B);jt(r,"SID",e.J),jt(r,"RID",n),jt(r,"AID",e.P),Ln(e,r),e.i&&e.l&&Mn(r,e.i,e.l),n=new pt(e,e.c,n,e.u+1),null===e.i&&(n.B=e.l),t&&(e.g=t.s.concat(e.g)),t=Dn(e,n,1e3),n.setTimeout(Math.round(.5*e.ma)+Math.round(.5*e.ma*Math.random())),sn(e.b,n),yt(n,r,t)}function Ln(e,t){e.f&&Tt({},(function(e,n){jt(t,n,e)}))}function Dn(e,t,n){n=Math.min(e.g.length,n);var r=e.f?y(e.f.Ha,e.f,e):null;e:for(var i=e.g,a=-1;;){var o=["count="+n];-1==a?0<n?(a=i[0].b,o.push("ofs="+a)):a=0:o.push("ofs="+a);for(var s=!0,c=0;c<n;c++){var l=i[c].b,u=i[c].a;if(0>(l-=a))a=Math.max(0,i[c].b-100),s=!1;else try{dn(u,o,"req"+l+"_")}catch(e){r&&r(u)}}if(s){r=o.join("&");break e}}return e=e.g.splice(0,n),t.s=e,r}function Fn(e){e.a||e.j||(e.U=1,Ne(e.Aa,e),e.o=0)}function jn(e){return!(e.a||e.j||3<=e.o)&&(e.U++,e.j=nt(y(e.Aa,e),Hn(e,e.o)),e.o++,!0)}function Un(e){null!=e.s&&(c.clearTimeout(e.s),e.s=null)}function Bn(e){e.a=new pt(e,e.c,"rpc",e.U),null===e.i&&(e.a.B=e.l),e.a.O=0;var t=It(e.la);jt(t,"RID","rpc"),jt(t,"SID",e.J),jt(t,"CI",e.H?"0":"1"),jt(t,"AID",e.P),Ln(e,t),jt(t,"TYPE","xmlhttp"),e.i&&e.l&&Mn(t,e.i,e.l),e.D&&e.a.setTimeout(e.D);var n=e.a;e=e.ga,n.H=1,n.i=Ut(It(t)),n.j=null,n.I=!0,vt(n,e)}function Vn(e){null!=e.m&&(c.clearTimeout(e.m),e.m=null)}function zn(e,t){var n=null;if(e.a==t){Vn(e),Un(e),e.a=null;var r=2}else{if(!on(e.b,t))return;n=t.s,cn(e.b,t),r=1}if(e.I=t.N,0!=e.v)if(t.b)if(1==r){n=t.j?t.j.length:0,t=b()-t.u;var i=e.u;(r=Ye()).dispatchEvent(new tt(r,n,t,i)),In(e)}else Fn(e);else if(3==(i=t.h)||0==i&&0<e.I||!(1==r&&function(e,t){return!(an(e.b)>=e.b.f-(e.h?1:0))&&(e.h?(e.g=t.s.concat(e.g),!0):!(1==e.v||2==e.v||e.u>=(e.Ia?0:e.Ja))&&(e.h=nt(y(e.Ba,e,t),Hn(e,e.u)),e.u++,!0))}(e,t)||2==r&&jn(e)))switch(n&&0<n.length&&(t=e.b,t.c=t.c.concat(n)),i){case 1:Gn(e,5);break;case 4:Gn(e,10);break;case 3:Gn(e,6);break;default:Gn(e,2)}}function Hn(e,t){var n=e.Fa+Math.floor(Math.random()*e.Ma);return e.f||(n*=2),n*t}function Gn(e,t){if(e.c.info("Error code "+t),2==t){var n=null;e.f&&(n=null);var r=y(e.Xa,e);n||(n=new Pt("//www.google.com/images/cleardot.gif"),c.location&&"http"==c.location.protocol||Nt(n,"https"),Ut(n)),function(e,t){var n=new Je;if(c.Image){var r=new Image;r.onload=v(pn,n,r,"TestLoadImage: loaded",!0,t),r.onerror=v(pn,n,r,"TestLoadImage: error",!1,t),r.onabort=v(pn,n,r,"TestLoadImage: abort",!1,t),r.ontimeout=v(pn,n,r,"TestLoadImage: timeout",!1,t),c.setTimeout((function(){r.ontimeout&&r.ontimeout()}),1e4),r.src=e}else t(!1)}(n.toString(),r)}else et(2);e.v=0,e.f&&e.f.ra(t),qn(e),On(e)}function qn(e){e.v=0,e.I=-1,e.f&&(0==ln(e.b).length&&0==e.g.length||(e.b.c.length=0,S(e.g),e.g.length=0),e.f.qa())}function Wn(e,t,n){var r=function(e){return e instanceof Pt?It(e):new Pt(e,void 0)}(n);if(""!=r.c)t&&Lt(r,t+"."+r.c),Dt(r,r.h);else{var i=c.location;r=function(e,t,n,r){var i=new Pt(null,void 0);return e&&Nt(i,e),t&&Lt(i,t),n&&Dt(i,n),r&&(i.g=r),i}(i.protocol,t?t+"."+i.hostname:i.hostname,+i.port,n)}return e.W&&I(e.W,(function(e,t){jt(r,t,e)})),t=e.A,n=e.na,t&&n&&jt(r,t,n),jt(r,"VER",e.ha),Ln(e,r),r}function Jn(e,t){if(t&&!e.C)throw Error("Can't create secondary domain capable XhrIo object.");return(t=new mn(e.Ka)).F=e.C,t}function Zn(){}function Xn(){if(V&&!(10<=Number(ee)))throw Error("Environmental error: no available transport.")}function Yn(e,t){Se.call(this),this.a=new Rn(t),this.l=e,this.b=t&&t.messageUrlParams||null,e=t&&t.messageHeaders||null,t&&t.clientProtocolHeaderRequired&&(e?e["X-Client-Protocol"]="webchannel":e={"X-Client-Protocol":"webchannel"}),this.a.l=e,e=t&&t.initMessageHeaders||null,t&&t.messageContentType&&(e?e["X-WebChannel-Content-Type"]=t.messageContentType:e={"X-WebChannel-Content-Type":t.messageContentType}),t&&t.a&&(e?e["X-WebChannel-Client-Profile"]=t.a:e={"X-WebChannel-Client-Profile":t.a}),this.a.O=e,(e=t&&t.httpHeadersOverwriteParam)&&!M(e)&&(this.a.i=e),this.h=t&&t.supportsCrossDomainXhr||!1,this.g=t&&t.sendRawJson||!1,(t=t&&t.httpSessionIdParam)&&!M(t)&&(this.a.A=t,null!==(e=this.b)&&t in e&&(t in(e=this.b)&&delete e[t])),this.f=new $n(this)}function Kn(e){ut.call(this);var t=e.__sm__;if(t){e:{for(var n in t){e=n;break e}e=void 0}(this.c=e)?(e=this.c,this.data=null!==t&&e in t?t[e]:void 0):this.data=t}else this.data=e}function Qn(){ht.call(this),this.status=1}function $n(e){this.a=e}(a=mn.prototype).ba=function(e,t,n,r){if(this.a)throw Error("[goog.net.XhrIo] Object is active with another request="+this.B+"; newUri="+e);t=t?t.toUpperCase():"GET",this.B=e,this.f="",this.h=0,this.u=!1,this.b=!0,this.a=new XMLHttpRequest,this.s=this.H?ot(this.H):ot(ct),this.a.onreadystatechange=y(this.za,this);try{this.A=!0,this.a.open(t,String(e),!0),this.A=!1}catch(e){return void wn(this,e)}e=n||"";var i=new Rt(this.headers);r&&Tt(r,(function(e,t){i.set(t,e)})),r=function(e){e:{for(var t=bn,n=e.length,r="string"==typeof e?e.split(""):e,i=0;i<n;i++)if(i in r&&t.call(void 0,r[i],i,e)){t=i;break e}t=-1}return 0>t?null:"string"==typeof e?e.charAt(t):e[t]}(i.L()),n=c.FormData&&e instanceof c.FormData,!(0<=E(vn,t))||r||n||i.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8"),i.forEach((function(e,t){this.a.setRequestHeader(t,e)}),this),this.I&&(this.a.responseType=this.I),"withCredentials"in this.a&&this.a.withCredentials!==this.F&&(this.a.withCredentials=this.F);try{_n(this),0<this.o&&((this.D=function(e){return V&&Q(9)&&"number"==typeof e.timeout&&void 0!==e.ontimeout}(this.a))?(this.a.timeout=this.o,this.a.ontimeout=y(this.xa,this)):this.m=Be(this.xa,this.o,this)),this.l=!0,this.a.send(e),this.l=!1}catch(e){wn(this,e)}},a.xa=function(){void 0!==s&&this.a&&(this.f="Timed out after "+this.o+"ms, aborting",this.h=8,this.dispatchEvent("timeout"),this.abort(8))},a.abort=function(e){this.a&&this.b&&(this.b=!1,this.g=!0,this.a.abort(),this.g=!1,this.h=e||7,this.dispatchEvent("complete"),this.dispatchEvent("abort"),xn(this))},a.G=function(){this.a&&(this.b&&(this.b=!1,this.g=!0,this.a.abort(),this.g=!1),xn(this,!0)),mn.S.G.call(this)},a.za=function(){this.j||(this.A||this.l||this.g?En(this):this.Ta())},a.Ta=function(){En(this)},a.X=function(){try{return 2<Sn(this)?this.a.status:-1}catch(e){return-1}},a.$=function(){try{return this.a?this.a.responseText:""}catch(e){return""}},a.Na=function(e){if(this.a){var t=this.a.responseText;return e&&0==t.indexOf(e)&&(t=t.substring(e.length)),fn(t)}},a.ua=function(){return this.h},a.Qa=function(){return"string"==typeof this.f?this.f:String(this.f)},(a=Rn.prototype).ha=8,a.v=1,a.Ba=function(e){if(this.h)if(this.h=null,1==this.v){if(!e){this.R=Math.floor(1e5*Math.random()),e=this.R++;var t,n=new pt(this,this.c,e,void 0),r=this.l;if(this.O&&(r?D(r=N(r),this.O):r=this.O),null===this.i&&(n.B=r),this.da)e:{for(var i=t=0;i<this.g.length;i++){var a=this.g[i];if(void 0===(a="__data__"in a.a&&"string"==typeof(a=a.a.__data__)?a.length:void 0))break;if(4096<(t+=a)){t=i;break e}if(4096===t||i===this.g.length-1){t=i+1;break e}}t=1e3}else t=1e3;t=Dn(this,n,t),jt(i=It(this.B),"RID",e),jt(i,"CVER",22),this.A&&jt(i,"X-HTTP-Session-Id",this.A),Ln(this,i),this.i&&r&&Mn(i,this.i,r),sn(this.b,n),this.Ga&&jt(i,"TYPE","init"),this.da?(jt(i,"$req",t),jt(i,"SID","null"),n.V=!0,yt(n,i,null)):yt(n,i,t),this.v=2}}else 3==this.v&&(e?Nn(this,e):0==this.g.length||rn(this.b)||Nn(this))},a.Aa=function(){if(this.j=null,Bn(this),this.V&&!(this.F||null==this.a||0>=this.N)){var e=2*this.N;this.c.info("BP detection timer enabled: "+e),this.s=nt(y(this.Sa,this),e)}},a.Sa=function(){this.s&&(this.s=null,this.c.info("BP detection timeout reached."),this.c.info("Buffering proxy detected and switch to long-polling!"),this.H=!1,this.F=!0,Cn(this),Bn(this))},a.Ra=function(){null!=this.m&&(this.m=null,Cn(this),jn(this),et(19))},a.Xa=function(e){e?(this.c.info("Successfully pinged google.com"),et(2)):(this.c.info("Failed to ping google.com"),et(1))},(a=Zn.prototype).ta=function(){},a.sa=function(){},a.ra=function(){},a.qa=function(){},a.Ha=function(){},Xn.prototype.a=function(e,t){return new Yn(e,t)},w(Yn,Se),(a=Yn.prototype).addEventListener=function(e,t,n,r){Yn.S.addEventListener.call(this,e,t,n,r)},a.removeEventListener=function(e,t,n,r){Yn.S.removeEventListener.call(this,e,t,n,r)},a.Oa=function(){this.a.f=this.f,this.h&&(this.a.C=!0);var e=this.a,t=this.l,n=this.b||void 0;et(0),e.fa=t,e.W=n||{},e.H=e.T,e.B=Wn(e,null,e.fa),In(e)},a.close=function(){kn(this.a)},a.Pa=function(e){if("string"==typeof e){var t={};t.__data__=e,Pn(this.a,t)}else this.g?((t={}).__data__=Te(e),Pn(this.a,t)):Pn(this.a,e)},a.G=function(){this.a.f=null,delete this.f,kn(this.a),delete this.a,Yn.S.G.call(this)},w(Kn,ut),w(Qn,ht),w($n,Zn),$n.prototype.ta=function(){this.a.dispatchEvent("a")},$n.prototype.sa=function(e){this.a.dispatchEvent(new Kn(e))},$n.prototype.ra=function(e){this.a.dispatchEvent(new Qn(e))},$n.prototype.qa=function(){this.a.dispatchEvent("b")},Xn.prototype.createWebChannel=Xn.prototype.a,Yn.prototype.send=Yn.prototype.Pa,Yn.prototype.open=Yn.prototype.Oa,Yn.prototype.close=Yn.prototype.close,rt.NO_ERROR=0,rt.TIMEOUT=8,rt.HTTP_ERROR=6,it.COMPLETE="complete",st.EventType=lt,lt.OPEN="a",lt.CLOSE="b",lt.ERROR="c",lt.MESSAGE="d",Se.prototype.listen=Se.prototype.va,mn.prototype.listenOnce=mn.prototype.wa,mn.prototype.getLastError=mn.prototype.Qa,mn.prototype.getLastErrorCode=mn.prototype.ua,mn.prototype.getStatus=mn.prototype.X,mn.prototype.getResponseJson=mn.prototype.Na,mn.prototype.getResponseText=mn.prototype.$,mn.prototype.send=mn.prototype.ba;var er={createWebChannelTransport:function(){return new Xn},ErrorCode:rt,EventType:it,WebChannel:st,XhrIo:mn},tr=er.createWebChannelTransport,nr=er.ErrorCode,rr=er.EventType,ir=er.WebChannel,ar=er.XhrIo;t.default=er}.call(this,n(1))},function(e,t,n){const r=n(0),i=new THREE.Color;function a(e,t,n){i.set(n),e.uniforms?(e.uniforms[t].value.x=i.r,e.uniforms[t].value.y=i.g,e.uniforms[t].value.z=i.b):e[t].set(n)}function o(e,t,n,r,i,a){e.fillStyle=t,e.fillRect(n,r,i,a)}function s(e,t,n,r,i,a,o){let s;s=a>o?e.createLinearGradient(0,0,a,0):e.createLinearGradient(0,0,0,o),s.addColorStop(0,t),s.addColorStop(1,n),e.fillStyle=s,e.fillRect(r,i,a,o)}if(AFRAME.registerSystem("materials",{schema:{},init:function(){this.curve=null,this.panelMaterials=[];const e=localStorage.getItem("colorScheme")||"default";this.scheme=r.schemes[e],this.textureList=[],this.beatsCanvas=document.createElement("canvas"),this.beatsTexture=new THREE.CanvasTexture(this.beatsCanvas),this.generateBeatsTexture(),this.textureList.push(this.beatsTexture),this.envmapCanvas=document.createElement("canvas"),this.envmapTexture=new THREE.CanvasTexture(this.envmapCanvas),this.generateEnvmapTexture(),this.textureList.push(this.envmapTexture),this.fistsCanvas=document.createElement("canvas"),this.fistsTexture=new THREE.CanvasTexture(this.fistsCanvas),this.generateFistsTexture(),this.textureList.push(this.fistsTexture),"loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>{this.createMaterials()}):this.createMaterials()},play:function(){this.setColorScheme()},tick:function(e,t){this.aurora.uniforms.time.value=e,this.home.animate&&(this.home.uniforms.time.value=e),this.leftFistWeapon.uniforms.time.value=e,this.leftWeapon.uniforms.time.value=e,this.rightFistWeapon.uniforms.time.value=e,this.rightWeapon.uniforms.time.value=e,this.rings.uniforms.time.value=e,this.tube.uniforms.time.value=e},createMaterials:function(){const e=this.scheme;this.tunnel=new THREE.ShaderMaterial({vertexShader:n(110),fragmentShader:n(111),uniforms:{fogColor:{value:new THREE.Color(e.primary)},color1:{value:new THREE.Color(e.primary)},color2:{value:new THREE.Color(e.secondary)},color3:{value:new THREE.Color(e.tertiary)},scale:{value:1}},transparent:!0}),this.merkaba=new THREE.MeshBasicMaterial({color:new THREE.Color(e.primary)}),this.backglow=new THREE.MeshBasicMaterial({transparent:!0,map:(new THREE.TextureLoader).load(document.getElementById("backGlowImg").src),color:new THREE.Color(e.primary)}),this.textureList.push(this.backglow.map),this.aurora=new THREE.ShaderMaterial({vertexShader:n(112),fragmentShader:n(113),uniforms:{colorPrimary:{value:new THREE.Color(e.primary)},colorSecondary:{value:new THREE.Color(e.secondary)},time:{value:0}},transparent:!0}),this.rings=new THREE.ShaderMaterial({vertexShader:n(114),fragmentShader:n(115),uniforms:{colorPrimary:{value:new THREE.Color(e.primary)},colorSecondary:{value:new THREE.Color(e.secondary)},colorTertiary:{value:new THREE.Color(e.tertiary)},time:{value:0}},transparent:!0,depthWrite:!1}),this.moon=new THREE.ShaderMaterial({vertexShader:n(116),fragmentShader:n(117),uniforms:{map:{value:(new THREE.TextureLoader).load(document.getElementById("moonImg").src)},tint:{value:new THREE.Color(e.secondarybright)}},transparent:!0}),this.textureList.push(this.moon.uniforms.map.value),this.home=new THREE.ShaderMaterial({vertexShader:n(118),fragmentShader:n(119),uniforms:{color1:{value:new THREE.Color(e.primary)},color2:{value:new THREE.Color(e.secondary)},color3:{value:new THREE.Color(e.tertiary)},src:{value:(new THREE.TextureLoader).load(document.getElementById("homeShadowImg").src)},time:{value:0}},transparent:!0}),this.textureList.push(this.home.uniforms.src.value);const t=(new THREE.TextureLoader).load(document.getElementById("weaponImg").src);t.wrapS=THREE.RepeatWrapping,t.wrapT=THREE.RepeatWrapping,t.repeat.set(2,2),t.magFilter=THREE.NearestFilter,this.textureList.push(t),this.rightWeapon=new THREE.ShaderMaterial({vertexShader:n(25),fragmentShader:n(26),uniforms:{src:{value:t},color:{value:new THREE.Color(e.secondary)},thickness:{value:1.6},time:{value:0}},transparent:!0,blending:THREE.AdditiveBlending}),this.leftWeapon=new THREE.ShaderMaterial({vertexShader:n(25),fragmentShader:n(26),uniforms:{src:{value:t},color:{value:new THREE.Color(e.primary)},thickness:{value:1.6},time:{value:0}},transparent:!0,blending:THREE.AdditiveBlending}),this.leftFistWeapon=new THREE.ShaderMaterial({vertexShader:n(16),fragmentShader:n(27),uniforms:{src:{value:t},color:{value:new THREE.Color(e.primary)},time:{value:0}},side:THREE.DoubleSide,transparent:!0,blending:THREE.AdditiveBlending}),this.rightFistWeapon=new THREE.ShaderMaterial({vertexShader:n(16),fragmentShader:n(27),uniforms:{src:{value:t},color:{value:new THREE.Color(e.secondary)},time:{value:0}},side:THREE.DoubleSide,transparent:!0,blending:THREE.AdditiveBlending});const i=(new THREE.TextureLoader).load(document.getElementById("weaponImg").src),a=(new THREE.TextureLoader).load(document.getElementById("weaponHandleImg").src);i.mapping=THREE.SphericalReflectionMapping,this.textureList.push(i),this.textureList.push(a),this.leftWeaponHandle=new THREE.MeshStandardMaterial({roughness:.4,metalness:.5,color:new THREE.Color(e.primary),map:a,envMap:i}),this.rightWeaponHandle=new THREE.MeshStandardMaterial({roughness:.4,metalness:.5,color:new THREE.Color(e.secondary),map:a,envMap:i});const o=(new THREE.TextureLoader).load(document.getElementById("weapon2Img").src);o.mapping=THREE.SphericalReflectionMapping,this.leftFist=new THREE.MeshStandardMaterial({roughness:.3,metalness:.8,map:this.fistsTexture,envMap:o,transparent:!0}),this.rightFist=new THREE.MeshStandardMaterial({roughness:.3,metalness:.8,map:this.fistsTexture,envMap:o,transparent:!0}),this.beat=new THREE.MeshLambertMaterial({map:this.beatsTexture,transparent:!0}),this.blueBeatPieces=new THREE.MeshLambertMaterial({map:this.beatsTexture,color:e.secondary,emissive:e.secondary,emissiveIntensity:.2}),this.redBeatPieces=new THREE.MeshLambertMaterial({map:this.beatsTexture,color:e.primary,emissive:e.primary,emissiveIntensity:.2}),this.minePieces=new THREE.MeshLambertMaterial({color:e.tertiary,emissive:e.tertiary,emissiveIntensity:.2});const s=(new THREE.TextureLoader).load(document.getElementById("backGlowImg").src);this.redBeatGlow=new THREE.MeshBasicMaterial({color:e.primary,map:s,blending:THREE.AdditiveBlending,transparent:!0}),this.blueBeatGlow=new THREE.MeshBasicMaterial({color:e.secondary,map:s,blending:THREE.AdditiveBlending,transparent:!0}),this.textureList.push(s),this.stars=new THREE.PointsMaterial({size:1,map:(new THREE.TextureLoader).load(document.getElementById("starImg").src),blending:THREE.AdditiveBlending,transparent:!0,color:new THREE.Color(e.secondary)}),this.textureList.push(this.stars.map);const c=(new THREE.TextureLoader).load(document.getElementById("sideglowImg").src);this.textureList.push(c),this.leftsideglow=new THREE.MeshBasicMaterial({map:c,transparent:!0,blending:THREE.AdditiveBlending,depthTest:!1,side:THREE.BackSide,color:new THREE.Color(r.OFF)}),this.rightsideglow=new THREE.MeshBasicMaterial({map:c,transparent:!0,blending:THREE.AdditiveBlending,depthTest:!1,color:new THREE.Color(r.OFF)});const l=(new THREE.TextureLoader).load(document.getElementById("plumeImg").src);l.minFilter=THREE.LinearFilter,this.arrowBluePlume=new THREE.ShaderMaterial({vertexShader:n(7),fragmentShader:n(8),uniforms:{color:{value:new THREE.Color(e.secondary)},src:{value:l}},transparent:!0,depthTest:!1}),this.arrowRedPlume=new THREE.ShaderMaterial({vertexShader:n(7),fragmentShader:n(8),uniforms:{color:{value:new THREE.Color(e.primary)},src:{value:l}},transparent:!0,depthTest:!1}),this.dotBluePlume=new THREE.ShaderMaterial({vertexShader:n(7),fragmentShader:n(8),uniforms:{color:{value:new THREE.Color(e.secondary)},src:{value:l}},transparent:!0,depthTest:!1}),this.dotRedPlume=new THREE.ShaderMaterial({vertexShader:n(7),fragmentShader:n(8),uniforms:{color:{value:new THREE.Color(e.primary)},src:{value:l}},transparent:!0,depthTest:!1}),this.minePlume=new THREE.ShaderMaterial({vertexShader:n(7),fragmentShader:n(8),uniforms:{color:{value:new THREE.Color(e.tertiary)},src:{value:l}},transparent:!0,depthTest:!1});const u=(new THREE.TextureLoader).load(document.getElementById("tubeImg").src),h=(new THREE.TextureLoader).load(document.getElementById("tubeColorImg").src);u.generateMipmaps=!1,u.minFilter=THREE.LinearFilter,h.generateMipmaps=!1,h.minFilter=THREE.LinearFilter,this.tube=new THREE.ShaderMaterial({vertexShader:n(120),fragmentShader:n(121),uniforms:{time:{value:0},opacity:{value:0},src:{value:u},color:{value:h}},transparent:!0,depthTest:!1,side:THREE.BackSide});const d=(new THREE.TextureLoader).load(document.getElementById("handStarTrailImg").src);d.generateMipmaps=!1,d.minFilter=THREE.LinearFilter,this.handStarTrail=new THREE.ShaderMaterial({vertexShader:n(122),fragmentShader:n(123),uniforms:{colorPrimary:{value:new THREE.Color(e.primary)},colorSecondary:{value:new THREE.Color(e.secondary)},colorTertiary:{value:new THREE.Color(e.tertiary)},pulse:{value:0},src:{value:d}},transparent:!0,depthTest:!1,blending:THREE.AdditiveBlending,side:THREE.DoubleSide})},setColorScheme:function(e){this.el.sceneEl;const t=this.scheme=r.schemes[e]||r.schemes.default;a(this.arrowBluePlume,"color",t.secondary),a(this.arrowRedPlume,"color",t.primary),a(this.aurora,"colorPrimary",t.primary),a(this.aurora,"colorSecondary",t.secondary),a(this.backglow,"color",t.primary),a(this.blueBeatGlow,"color",t.secondary),a(this.blueBeatGlow,"color",t.secondary),a(this.blueBeatPieces,"color",t.secondary),a(this.blueBeatPieces,"emissive",t.secondary),a(this.dotBluePlume,"color",t.secondary),a(this.dotRedPlume,"color",t.primary),a(this.handStarTrail,"colorPrimary",t.primary),a(this.handStarTrail,"colorSecondary",t.secondary),a(this.handStarTrail,"colorTertiary",t.tertiary),a(this.home,"color1",t.primary),a(this.home,"color2",t.secondary),a(this.home,"color3",t.tertiary),a(this.leftFist,"color",t.primarybright),a(this.leftFistWeapon,"color",t.primary),a(this.leftWeapon,"color",t.primary),a(this.leftWeaponHandle,"color",t.primary),a(this.merkaba,"color",t.primary),a(this.minePieces,"color",t.tertiary),a(this.minePieces,"emissive",t.tertiary),a(this.minePlume,"color",t.tertiary),a(this.moon,"tint",t.secondarybright),a(this.redBeatGlow,"color",t.primary),a(this.redBeatGlow,"color",t.primary),a(this.redBeatPieces,"color",t.primary),a(this.redBeatPieces,"emissive",t.primary),a(this.rightFist,"color",t.secondarybright),a(this.rightWeapon,"color",t.secondary),a(this.rightFistWeapon,"color",t.secondary),a(this.rightWeaponHandle,"color",t.secondary),a(this.rings,"colorPrimary",t.primary),a(this.rings,"colorSecondary",t.secondary),a(this.rings,"colorTertiary",t.tertiary),a(this.stars,"color",t.secondary),a(this.tunnel,"fogColor",t.primary),a(this.tunnel,"color1",t.primary),a(this.tunnel,"color2",t.secondary),a(this.tunnel,"color3",t.tertiary),this.generateBeatsTexture(),this.generateEnvmapTexture(),this.generateFistsTexture(),document.querySelectorAll("a-entity[wall]").forEach(e=>{a(e.getObject3D("mesh").material,"colorTertiary",t.tertiary)}),this.panelMaterials.forEach(e=>{a(e,"colorPrimary",t.primary),a(e,"colorSecondary",t.secondary)}),a(this.curve,"fogColor",t.primary),a(this.curve,"color1",t.primary),a(this.curve,"color2",t.secondary)},generateBeatsTexture:function(){const e=this.scheme,t=new THREE.Color(e.primary),n=new THREE.Color(e.secondary),r=new THREE.Color(e.tertiary),i=this.beatsCanvas,a=i.getContext("2d");i.width=512,i.height=32,o(a,r.getStyle(),0,0,128,6),o(a,"#000",128,0,128,6),o(a,n.getStyle(),256,0,128,6),o(a,t.getStyle(),384,0,105,6),o(a,"#FFF",489,0,23,6),s(a,"#000000",n.getStyle(),0,6,512,4),s(a,"#000",t.getStyle(),0,10,512,5),s(a,"#000",r.getStyle(),0,15,512,4),s(a,`rgba(${n.r}, ${n.g}, ${n.b}, 0)`,n.getStyle(),0,19,512,5),s(a,`rgba(${t.r}, ${t.g}, ${t.b}, 0)`,t.getStyle(),0,24,512,4),s(a,`rgba(${r.r}, ${r.g}, ${r.b}, 0)`,r.getStyle(),0,28,512,4);const c=this.beatsTexture;return c.generateMipmaps=!1,c.magFilter=THREE.LinearFilter,c.minFilter=THREE.LinearFilter,c.needsUpdate=!0,c},generateFistsTexture:function(){const e=this.scheme,t=new THREE.Color(e.primarybright),n=new THREE.Color(e.secondarybright),r=this.fistsCanvas,i=r.getContext("2d");return r.width=8,r.height=128,s(i,t.getStyle(),`rgba(${t.r}, ${t.g}, ${t.b}, 0)`,0,0,4,128),s(i,n.getStyle(),`rgba(${n.r}, ${n.g}, ${n.b}, 0)`,4,0,4,128),this.fistsTexture.needsUpdate=!0,this.fistsTexture},generateEnvmapTexture:function(){const e=this.scheme,t=new THREE.Color(e.primary),n=new THREE.Color(e.secondary),r=document.getElementById("envmapTemplateImg");r.addEventListener("load",()=>{const e=r.width,i=r.height,a=this.envmapCanvas;a.width=e,a.height=i;const o=a.getContext("2d");o.drawImage(r,0,0);const s=o.getImageData(0,0,e,i),c=s.data;let l,u;for(let e=0;e<c.length;e+=4)l=c[e],u=c[e+1],l*=1-u/255,c[e+0]=Math.floor(t.r*l+n.r*u),c[e+1]=Math.floor(t.g*l+n.g*u),c[e+2]=Math.floor(t.b*l+n.b*u),c[e+3]=255;o.putImageData(s,0,0),document.getElementById("envmapImg").src=a.toDataURL("image/png")})},registerCurve:function(e){this.curve=e},registerPanel:function(e){this.panelMaterials.push(e)}}),AFRAME.registerComponent("materials",{schema:{animate:{default:!0},name:{default:""},recursive:{default:!0}},update:function(){if(""===this.data.name)return;if(this.material=this.system[this.data.name],!this.material)return void console.warn("[materials] Unknown material: "+this.data.name);let e=this.el.getObject3D("mesh");e?this.applyMaterial(e):this.el.addEventListener("object3dset",t=>{"mesh"===t.detail.type&&(e=this.el.getObject3D("mesh"),e&&this.applyMaterial(e))}),this.material.animate=this.data.animate},applyMaterial:function(e){e.detail&&(e=e.detail.model),this.data.recursive?e.traverse(e=>{"Mesh"===e.type&&(e.material=this.material)}):e.material=this.material}}),AFRAME.registerComponent("materials-color-menu",{play:function(){this.text=document.getElementById("colorName")},events:{mouseenter:function(e){this.text.setAttribute("text","value",e.target.dataset.colorName)},mouseleave:function(e){this.text.setAttribute("text","value","")},click:function(e){this.el.sceneEl.systems.materials.setColorScheme(e.target.dataset.colorScheme),this.el.sceneEl.emit("colorschemechange",e.target.dataset.colorScheme,!1)}}}),window.AFRAME){const t=["materials","materials-color-menu"],n=[],r=["materials"];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t){e.exports="varying vec3 vWorldPos;\nvarying vec3 vPos;\nvarying vec3 vNormal;\n\nvoid main() {\n vNormal = normal;\n vPos = position;\n vWorldPos = (modelMatrix * vec4( position, 1.0 )).xyz;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n"},function(e,t){e.exports="uniform sampler2D src;\nuniform float scale;\nvarying vec3 vPos;\nvarying vec3 vWorldPos;\nvarying vec3 vNormal;\nuniform vec3 color1;\nuniform vec3 color2;\nuniform vec3 color3;\nuniform vec3 fogColor;\n\nvoid main() {\n vec3 pw = vWorldPos - cameraPosition;\n vec3 p = pw / scale;\n float pz = p.z * 0.3;\n\n // build color weights\n float f = clamp( (sin(p.x * 0.6 + pz ) + sin(p.y * 0.3 - pz)) * 0.3 + 0.17, 0.0, 1.0);\n float g = clamp( (sin(p.x * 0.7 + pz) + cos(p.y * 0.6 - 15.0) + sin(pz * 0.1)) * 0.25 + 0.15, 0.0, 1.0);\n float h = clamp( (sin(p.x * 0.4 + pz + 3.0) + cos(p.y * 0.8 - 5.0) + sin(pz * 0.3)) * 0.16 + 0.08, 0.0, 1.0);\n\n\n // mix colors using weights\n vec3 col = vec3(0.3);\n col = mix(col, color1, f);\n col = mix(col, color2, g);\n col = mix(col, color3, h);\n\n float fog = 1.0 - clamp(length(pw) / 180.0 - 0.1, 0.0, 1.0);\n\n // mix color with fog\n col = mix(fogColor, col, smoothstep(0.2, 0.9, fog));\n\n // calc shadow (using normal and fixed light pos + fade to black in y)\n float shadow = 0.5 + dot(vec3(0.0, 1.0, 1.0), vNormal) * 0.5;\n float shadowGrad = clamp((vPos.y + 2.0) / 6.0, 0.1, 1.0);\n // fade in fog\n shadow = mix(1.0, shadow, fog);\n shadowGrad = mix(1.0, shadowGrad, smoothstep(0.3, 1.0, fog));\n\n gl_FragColor = vec4(col * shadow * shadowGrad, smoothstep(0.3, 0.6, fog));\n //gl_FragColor = vec4(vec3(fog), 1.0);\n}"},function(e,t){e.exports="uniform float time;\nvarying vec2 uvs;\nvoid main() {\n uvs.xy = uv.xy;\n float t = time * 0.0005;\n vec3 pos = position;\n pos.y += sin(t + uv.x * 3.0 + pos.x * 0.01) * 20.0;\n pos.y += sin(-t * 1.3 + uv.x * 7.0 + pos.x * 0.008) * 10.0;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( pos, 1.0 );\n}"},function(e,t){e.exports="uniform float time;\nuniform vec3 colorPrimary;\nuniform vec3 colorSecondary;\nvarying vec2 uvs;\n\nvoid main() {\n vec3 col = vec3(1.0);\n float t = time * 0.001;\n col *= 0.80 + sin(-t * 3.4 + 5.5 + uvs.x * 6.0) * 0.1;\n col *= 0.80 + sin(t * 1.4 + 0.5 + uvs.x * 12.0) * 0.2;\n col *= 0.80 + sin(t * 1.0 + 0.2 + uvs.x * 30.0) * 0.2;\n col *= 0.90 + sin(-t * 1.6 + 5.2 + uvs.x * 43.0) * 0.1;\n col *= 0.95 + sin(-t * 0.3 + 1.2 + uvs.x * 50.0) * 0.05;\n col *= 0.95 + sin(t * 0.8 + 1.2 + uvs.x * 80.0) * 0.05;\n col *= 0.94 + sin(-t + 0.1 + uvs.x * 180.0) * 0.01;\n col *= 0.90 + sin(t * 2.49 + 0.1 + uvs.x * 120.0) * 0.01;\n col *= 0.86 + sin(-t * 1.7 + 4.7 + uvs.x * 80.0) * 0.03;\n col *= 0.86 + sin(-t * 1.2 + 0.7 + uvs.x * 180.0) * 0.02;\n\n // border fades\n float alpha = 1.0;\n alpha *= 1.0 - smoothstep(0.0, 1.0, uvs.y);\n alpha *= smoothstep(0.0, 0.3, uvs.y);\n alpha *= sin(uvs.x * 3.141592);\n\n // colorize\n col = col * mix(colorPrimary, colorSecondary, uvs.y);\n gl_FragColor = vec4(col, alpha);\n}\n"},function(e,t){e.exports="varying vec2 uvs;\nvoid main() {\n uvs.xy = uv.xy;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}"},function(e,t){e.exports="uniform float time;\nuniform vec3 colorPrimary;\nuniform vec3 colorSecondary;\nuniform vec3 colorTertiary;\nvarying vec2 uvs;\n#define PI 3.14159265358979\n\nfloat pulse(float x, float t, float r){\n return 1.0 - smoothstep(0.0, r, abs((x - t)));\n}\n\nvoid main() {\n float t = time * 0.002;\n vec2 uv = uvs - 0.5;\n uv = vec2(-uv.y, uv.x);\n float d = length(uv);\n float f = pulse(d, 0.44, 0.012);\n float f2 = pulse(d, 0.44, 0.002);\n\n float g = pulse(d, 0.20, 0.01);\n float g1 = pulse(d, 0.20, 0.0018);\n\n float g2 = pulse(d, 0.21, 0.01);\n float g3 = pulse(d, 0.21, 0.0018);\n\n float ang = abs(atan(uv.y, uv.x)) / PI;\n float angalpha = sin(ang * 20.0 - t * 0.1) * 0.4 + 0.6;\n\n float sparks = pulse(angalpha, 0.4, 0.17) * (pulse(d, 0.435, 0.035) + pulse(d, 0.205, 0.026)) * 0.14;\n sparks += pulse(angalpha, 0.4, 0.2) * (pulse(d, 0.44, 0.002) + pulse(d, 0.2, 0.0018)) * 0.4;\n sparks *= sin(ang * 14.0 + t) * 0.5 + 0.5;\n vec3 col = mix(colorPrimary, colorSecondary, ang);\n col = mix (col, colorPrimary, g3);\n col = mix (col, colorSecondary, g1);\n col = mix (col, colorTertiary, sparks * 2.4);\n gl_FragColor = vec4(col, ((f + g + g2) * 0.1 + (f2 + g1 + g3) * 0.4) * angalpha + sparks);\n}\n"},function(e,t){e.exports="varying vec2 uvs;\nvoid main() {\n uvs.xy = uv.xy;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n"},function(e,t){e.exports="varying vec2 uvs;\nuniform sampler2D map;\nuniform vec3 tint;\n\nvoid main() {\n vec4 tex = texture2D(map, uvs);\n vec3 col = mix(tex.rgb * tint, tex.rgb, uvs.y);\n gl_FragColor = vec4(col, tex.a );\n}\n"},function(e,t){e.exports="uniform float time;\nvarying vec3 vWorldPos;\nvarying vec2 uvs;\nvoid main() {\n uvs.xy = uv.xy;\n vWorldPos = (modelMatrix * vec4( position, 1.0 )).xyz;\n vec3 pos = vec3(position.x, position.y + sin(time * 0.002 - position.z) * 0.05 + 0.04, position.z);\n gl_Position = projectionMatrix * modelViewMatrix * vec4(pos, 1.0);\n}\n"},function(e,t){e.exports="varying vec2 uvs;\nvarying vec3 vWorldPos;\nuniform sampler2D src;\nuniform vec3 color1;\nuniform vec3 color2;\nuniform vec3 color3;\n\nvoid main() {\n vec4 tex = texture2D(src, uvs);\n vec3 p = vWorldPos + cameraPosition;\n float pz = p.z * 0.36;\n float f = clamp( (sin(p.x + pz ) + sin(p.y - pz)) * 0.35 + 0.14, 0.0, 1.0);\n float g = clamp( (sin(p.x + pz + 2.0) + cos(p.y * 0.6 - 15.0) + sin(pz * 0.5)) * 0.3 + 0.1, 0.0, 1.0);\n float h = clamp( (sin(p.x * 0.7 + pz + 2.0) + cos(p.y * 0.8 - 5.0) + sin(pz * 0.8)) * 0.3 + 0.05, 0.0, 1.0);\n\n vec3 col = vec3(0.1);\n col = mix(col, color1, f);\n col = mix(col, color2, g);\n col = mix(col, color3, h);\n\n gl_FragColor = vec4((col * 1.5) * tex.r, 1.0);\n}"},function(e,t){e.exports="varying vec2 uvs;\nuniform float time;\nvoid main() {\n uvs.xy = uv.xy;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n"},function(e,t){e.exports="varying vec2 uvs;\nuniform sampler2D src;\nuniform sampler2D color;\nuniform float time;\nuniform float opacity;\n\nvoid main() {\n vec2 uvanim = vec2(\n mod(uvs.x + sin(time / 20000.0), 1.0),\n mod(uvs.y + time / 2000.0, 1.0));\n vec4 texAlpha = texture2D(src, uvanim);\n float alpha = texAlpha.a * smoothstep(0.0, 0.5, uvs.y) * (1.0 - smoothstep(0.5, 1.0, uvs.y));\n gl_FragColor = vec4(texture2D(color, uvs).rgb, alpha * 0.7 * opacity);\n}\n"},function(e,t){e.exports="varying vec3 vWorldPosition;\nvarying vec2 uvs;\n\nvoid main() {\n uvs = uv;\n vWorldPosition = (modelMatrix * vec4(position, 1.0)).xyz;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n"},function(e,t){e.exports="varying vec3 vWorldPosition;\nvarying vec2 uvs;\nuniform vec3 colorPrimary;\nuniform vec3 colorSecondary;\nuniform vec3 colorTertiary;\nuniform float pulse;\nuniform sampler2D src;\n\nvoid main() {\n vec3 colorize = vWorldPosition-cameraPosition;\n colorize = clamp(colorize + 0.5, vec3(0.0), vec3(1.0));\n vec3 col = mix(mix(colorPrimary, colorSecondary, colorize.x), colorTertiary, colorize.z);\n col += vec3(pulse) * 0.1;\n gl_FragColor = vec4 (col, texture2D(src, uvs).a);\n}\n"},function(e,t,n){if(AFRAME.registerComponent("menu-controls",{schema:{enabled:{default:!0}},events:{thumbdownstart:function(){this.data.enabled&&this.el.sceneEl.emit("searchnextpage",null,!1)},thumbleftstart:function(){this.data.enabled&&this.el.sceneEl.emit("menuchallengeunselect",null,!1)},thumbupstart:function(){this.data.enabled&&this.el.sceneEl.emit("searchprevpage",null,!1)}}}),window.AFRAME){const t=["menu-controls"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("menu-difficulty-select",{init:function(){this.el.sceneEl.addEventListener("menuchallengeselect",()=>{this.el.object3D.visible=!1,setTimeout(()=>{this.el.components.layout.update(),this.el.object3D.visible=!0},150)})},events:{click:function(e){this.el.sceneEl.emit("menudifficultyselect",e.target.closest(".difficultyOption").dataset.difficulty,!1)}}}),window.AFRAME){const t=["menu-difficulty-select"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("menu-genre",{init:function(){this.el.addEventListener("click",e=>{this.el.sceneEl.emit("genreselect",e.target.closest(".genre").dataset.bindForKey)})}}),window.AFRAME){const t=["menu-genre"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("menu-midsection",{schema:{active:{default:!1},selectedChallenge:{default:""}},update:function(e){e.active&&!this.data.active&&this.el.emit("hidedifficultysection",null,!1),(!e.active&&this.data.active||this.data.selectedChallenge&&e.selectedChallenge!==this.data.selectedChallenge)&&this.el.emit("showdifficultysection",null,!1)}}),window.AFRAME){const t=["menu-midsection"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){const r=n(0),i={classicvr:-.6,punchvr:.87,ride2d:.87,ridevr:.15,viewer2d:.15},a={classicvr:"classic",punchvr:"punch",ride2d:"ride",ridevr:"ride",viewer2d:"viewer"};if(AFRAME.registerComponent("menu-mode",{schema:{colorScheme:{default:"default"},hasVR:{default:!1}},init:function(){this.el.addEventListener("click",e=>{const t=e.target.closest("[data-mode]"),n=t.dataset.mode,r=t.dataset.name;this.el.sceneEl.emit("gamemode",n,!1),this.data.hasVR&&localStorage.setItem("gameMode",r),this.setModeOption(r)})},update:function(){this.data.hasVR?(this.setModeOption(localStorage.getItem("gameMode")||"punchvr"),this.el.sceneEl.emit("gamemode",a[localStorage.getItem("gameMode")||"punchvr"])):this.setModeOption("ride2d")},setModeOption:function(e){const t=this.el.querySelectorAll(".modeItem");document.getElementById("modeIcon").object3D.position.y=i[e];for(let n=0;n<t.length;n++){const i=t[n],a=i.dataset.name===e;i.emit(a?"select":"deselect",null,!1);const o=i.querySelector(".modeBackground");o.emit(a?"select":"deselect",null,!1),o.setAttribute("mixin","modeBackgroundSelect"+(a?"":" modeBackgroundHover"));i.querySelector(".modeThumb").emit(a?"select":"deselect",null,!1);i.querySelector(".modeTitle").setAttribute("text","color",a?r.WHITE:r.schemes[this.data.colorScheme].secondary);i.querySelector(".modeInstructions").setAttribute("text","color",a?r.WHITE:r.schemes[this.data.colorScheme].primary)}}}),window.AFRAME){const t=["menu-mode"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("menu-playlist-button",{schema:{isFavorited:{default:!1},selectedChallenge:{default:""}},init:function(){const e=this.el;e.setAttribute("animation__scaleup",{property:"scale",from:"1 1 1",to:"1.2 1.2 1.2",dur:800,autoplay:!1,easing:"easeInOutElastic"}),e.setAttribute("animation__scaledown",{property:"scale",from:"1.2 1.2 1.2",to:"1 1 1",dur:100,autoplay:!1,easing:"easeInOutCubic"})},update:function(e){!e.isFavorited&&this.data.isFavorited&&e.selectedChallenge===this.data.selectedChallenge&&(this.el.object3D.position.z=.01,this.el.components.animation__scaleup.beginAnimation(),setTimeout(()=>{this.el.components.animation__scaledown.beginAnimation(),this.el.object3D.position.z=0},800))}}),window.AFRAME){const t=["menu-playlist-button"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("menu-playlist",{init:function(){this.eventDetail={id:"",title:""},this.el.addEventListener("click",e=>{const t=e.target.closest(".playlist");this.eventDetail.id=t.dataset.playlist,this.eventDetail.title=t.dataset.title,this.el.sceneEl.emit("playlistselect",this.eventDetail)})}}),window.AFRAME){const t=["menu-playlist"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("menu-selected-challenge-image",{schema:{coverURL:{type:"string"}},update:function(){this.el.setAttribute("material","src",this.data.coverURL)}}),window.AFRAME){const t=["menu-selected-challenge-image"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("menu-slide-animation",{schema:{isSearching:{default:!1},menuSelectedChallengeId:{type:"string"}},init:function(){this.isLeft=!1},update:function(e){const t=this.data;if(this.isLeft)return!e.menuSelectedChallengeId||t.menuSelectedChallengeId||t.isSearching||this.rightMenu(),void(!e.isSearching||t.isSearching||t.menuSelectedChallengeId||this.rightMenu());this.isLeft||(!e.menuSelectedChallengeId&&t.menuSelectedChallengeId&&this.leftMenu(),!e.isSearching&&t.isSearching&&this.leftMenu())},rightMenu:function(){this.isLeft&&(this.el.components.animation__menuright.beginAnimation(),this.isLeft=!1)},leftMenu:function(){this.isLeft||(this.el.components.animation__menuleft.beginAnimation(),this.isLeft=!0)}}),window.AFRAME){const t=["menu-slide-animation"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){const r={0:0,1:.5,2:0,3:.25,4:.5,5:.75,6:0,7:.125,8:.25,9:.375,10:.5,11:.625,12:.75,13:.875};if(AFRAME.registerComponent("multiplier-ring",{dependencies:["geometry","material"],schema:{combo:{default:0},multiplier:{default:1}},init:function(){this.animationSet={from:void 0,to:void 0},this.progress=this.el.getObject3D("mesh").material.uniforms.progress,this.el.setAttribute("animation",{property:"components.material.material.uniforms.progress.value",dur:100,autoplay:!1})},update:function(){this.updateRing()},updateRing:function(){const e=this.data,t=this.el,n=this.progress;if(8===e.multiplier)return void(n.value=1);const i=this.animationSet;i.from=n.value,i.to=r[e.combo],t.setAttribute("animation",i),t.components.animation.beginAnimation()}}),window.AFRAME){const t=["multiplier-ring"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("no-frustum-cull",{init:function(){this.el.object3D.frustumCulled=!1}}),window.AFRAME){const t=["no-frustum-cull"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){"use strict";n.r(t);var r=n(0),i=n.n(r);if(AFRAME.registerShader("panelShader",{schema:{activePanel:{type:"number",is:"uniform",default:0},brightness:{type:"number",is:"uniform",default:.3},borderWidth:{type:"number",is:"uniform",default:.004},borderRadius:{type:"number",is:"uniform",default:.15},colorPrimary:{type:"color",is:"uniform",default:i.a.initial.primary},colorSecondary:{type:"color",is:"uniform",default:i.a.initial.secondary},midSection:{type:"number",is:"uniform",default:0},opacity:{type:"number",is:"uniform",default:1},ratio:{type:"number",is:"uniform",default:.5},transparent:{default:!0}},vertexShader:n(136),fragmentShader:n(137),update:function(e){this.updateVariables(e,"attribute"),this.updateVariables(e,"uniform"),this.el.sceneEl.systems.materials.registerPanel(this.material)}}),window.AFRAME){const t=[],n=["panelShader"],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t){e.exports="varying vec2 uvs;\nvoid main() {\n uvs.xy = uv.xy;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}"},function(e,t){e.exports="#if __VERSION__ == 100\n #extension GL_OES_standard_derivatives : enable\n#endif\n\nuniform vec3 colorPrimary;\nuniform vec3 colorSecondary;\n\n#define PI 3.141592\n#define DIFF_SECTION_WIDTH 0.06\n\nuniform float borderWidth;\nuniform float borderRadius;\nuniform float brightness;\nuniform float ratio;\nuniform float midSection;\nuniform float opacity;\nuniform float activePanel;\n\nvarying vec2 uvs;\n\nfloat sdBox( in vec2 p, in vec2 b )\n{\n vec2 d = abs(p)-b;\n return length(max(d,vec2(0.0))) + min(max(d.x,d.y), 0.0);\n}\n\nvoid main()\n{\n vec2 uv = uvs;\n vec2 uv2 = uv * 2.0 - 1.0; // from -1 to 1\n uv2.x *= ratio;\n\n vec3 col = mix(colorSecondary * uv.y, colorPrimary * uv.y, uv.x) * (brightness + activePanel * 0.4);\n vec3 borderCol = mix(colorSecondary, colorPrimary, uv.y);\n\n vec2 size = vec2(0.83 * ratio, 0.86) - borderRadius;\n float grad = sdBox(uv2, size) - borderRadius;\n grad = min(grad, sdBox(uv2 - size, vec2(borderRadius)));\n grad = min(grad, sdBox(uv2 + size, vec2(borderRadius)));\n grad = -grad;\n float aa = fwidth(grad);\n\n float isShape = smoothstep(-aa, 0.0, grad);\n float alpha = clamp(isShape + smoothstep(-0.15, 0.15, grad), 0.0, 1.0);\n float isBorder = smoothstep(-aa - borderWidth, aa - borderWidth, grad) - smoothstep(-aa + borderWidth, aa + borderWidth, grad);\n float mid = clamp(midSection, 0.0, 1.0);\n col *= 1.0 - mid * (step(0.5 - DIFF_SECTION_WIDTH * mid, uv.x) - step(0.5 + DIFF_SECTION_WIDTH * midSection, uv.x)) * 0.3;\n\n gl_FragColor = vec4(mix(col * isShape, borderCol, isBorder), alpha * opacity);\n}\n"},function(e,t,n){if(AFRAME.registerComponent("pause",{schema:{isPaused:{default:!1}},update:function(){this.data.isPaused&&this.el.isPlaying?this.el.pause():this.data.isPaused||this.el.isPlaying||!this.el.sceneEl.isPlaying||this.el.play()}}),window.AFRAME){const t=["pause"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("pauser",{schema:{enabled:{default:!0}},init:function(){this.pauseGame=this.pauseGame.bind(this),document.addEventListener("keydown",e=>{27===e.keyCode&&this.pauseGame()}),this.el.sceneEl.addEventListener("controllerconnected",e=>{"vive-controls"===e.detail.name?this.el.addEventListener("menudown",this.pauseGame):(this.el.addEventListener("thumbstickdown",this.pauseGame),this.el.addEventListener("trackpaddown",this.pauseGame))}),document.addEventListener("visibilitychange",()=>{"hidden"===document.visibilityState&&this.pauseGame()})},pauseGame:function(){this.data.enabled&&this.el.sceneEl.emit("pausegame",null,!1)}}),window.AFRAME){const t=["pauser"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){var r=n(141);if(AFRAME.registerSystem("play-sound",{init:function(){this.lastSoundPlayed="",this.lastSoundPlayedTime=0,this.pools={}},createPool:function(e,t){this.pools[e]||(this.pools[e]=new r(e,t))},playSound:function(e,t){this.pools[e]||this.createPool(e,t),this.pools[e].play(),this.lastSoundPlayed=e,this.lastSoundTime=this.el.time}}),AFRAME.registerComponent("play-sound",{schema:{enabled:{default:!0},event:{type:"string"},sound:{type:"string"},volume:{type:"number",default:1}},multiple:!0,init:function(){this.el.addEventListener(this.data.event,e=>{this.data.enabled&&this.system.playSound(this.src,this.data.volume)})},update:function(){this.src=this.data.sound,this.data.sound.startsWith("#")&&(this.src=document.querySelector(this.data.sound).getAttribute("src"))}}),window.AFRAME){const t=["play-sound"],n=[],r=["play-sound"];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t){e.exports=function(e,t){var n,r=0,i=[];return(n=new Audio(e)).volume=t,i.push(n),{play:function(){0===i[r].currentTime&&i[r].ended||((n=new Audio(e)).volume=t,i.push(n),r++),(0===i[r].currentTime||i[r].ended)&&i[r].play(),r=(r+1)%i.length}}}},function(e,t,n){function r(e,t){return e-t}if(AFRAME.registerComponent("player-height",{init:function(){this.beatOffset=0,this.heights=[],this.height=0,this.el.sceneEl.addEventListener("menuchallengeselect",this.updateHeight.bind(this)),this.el.sceneEl.addEventListener("playbuttonclick",this.updateHeight.bind(this))},pause:function(){this.heights.length=0},updateHeight:function(){const e=this.heights;e.length>3&&e.shift(),e.push(this.el.object3D.position.y),this.height=function(e){e.sort(r);const t=e.length/2;return t%1?e[t-.5]:(e[t-1]+e[t])/2}(e);const t=(n=this.height,i=1.6,a=2.2,Math.min(Math.max(n,i),a));var n,i,a,o,s;this.beatOffset=(s=0)+(.2-s)*(t-(o=1.6))/(2.2-o)}}),window.AFRAME){const t=["player-height"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("plume",{schema:{color:{default:""},cutDirection:{default:""},horizontalPosition:{default:"middleleft",oneOf:["left","middleleft","middleright","right"]},songPosition:{default:0},type:{default:"arrow",oneOf:["arrow","dot","mine"]},verticalPosition:{default:"middle",oneOf:["bottom","middle","top"]}},horizontalPositions:{left:-.95,middleleft:-.6,middleright:.6,right:.95},init:function(){this.curveEl=document.getElementById("curve"),this.curveFollowRig=document.getElementById("curveFollowRig"),this.handsEls=this.el.sceneEl.querySelectorAll(".handStar"),this.handPos=new THREE.Vector3,this.verticalPositions=this.el.sceneEl.components["beat-system"].verticalPositions,this.el.sceneEl.addEventListener("cleargame",this.returnToPool.bind(this))},update:function(){"mine"===this.data.type?this.poolName="pool__plume-mine":this.poolName=`pool__plume-${this.data.type}-${this.data.color}`},onGenerate:function(e,t,n,r){this.data;const i=this.el,a=this.curveEl.components.supercurve;a.getPointAt(e,i.object3D.position),a.alignToCurve(e,i.object3D),i.object3D.position.x+=this.horizontalPositions[t],i.object3D.position.y+=this.verticalPositions[n]+r,i.object3D.rotation.z=Math.random()*Math.PI*2,this.songPosition=e},tock:function(){if(this.el.object3D.position.z>this.curveFollowRig.object3D.position.z+10)this.returnToPool();else for(let e=0;e<this.handsEls.length;e++){const t=this.handsEls[e];t.object3D.getWorldPosition(this.handPos),this.handPos.distanceToSquared(this.el.object3D.position)<.2&&t.emit("plumepulse")}},returnToPool:function(){this.el.object3D.position.set(0,0,-9999),this.el.object3D.visible=!1,this.el.isPlaying&&this.el.sceneEl.components[this.poolName].returnEntity(this.el)}}),window.AFRAME){const t=["plume"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("punch",{schema:{enabled:{default:!1}},init:function(){this.currentPos=new THREE.Vector3,this.direction=0,this.lastSample=new THREE.Vector3,this.lastSampleTime=0,this.speed=0,this.bbox=new THREE.Box3,this.bboxEl=this.el.querySelector(".punchBbox")},play:function(){this.rig=this.el.closest("#curveFollowRig")},tick:function(e,t){this.data.enabled&&(this.direction=this.currentPos.copy(this.el.object3D.position).sub(this.lastSample),this.speed=this.direction.length()/((e-this.lastSampleTime)/1e3),this.lastSample.copy(this.el.object3D.position),this.lastSampleTime=e)},tickBeatSystem:function(){this.bbox.setFromObject(this.bboxEl.getObject3D("mesh"))},checkCollision:function(){const e=new THREE.Box3,t=new THREE.Vector3(0,0,.2);return function(n){return e.copy(n.bbox).translate(n.el.object3D.position).expandByScalar(.1).expandByVector(t),this.bbox.intersectsBox(e)}}()}),window.AFRAME){const t=["punch"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){var r,i;if(AFRAME.registerComponent("raycaster-target",{schema:{bindToggle:{default:""},depth:{type:"number"},height:{type:"number"},position:{type:"vec3",default:{x:0,y:0,z:0}},rotation:{type:"vec3",default:{x:0,y:0,z:0}},useBoxTarget:{default:!1},width:{type:"number"}},init:(r={primitive:"box"},i={primitive:"plane"},function(){var e,t,n=this.data,a=this.el;(t=document.createElement("a-entity")).classList.add("raycasterTarget"),n.bindToggle?t.setAttribute("bind-toggle__raycastable",n.bindToggle):t.setAttribute("data-raycastable",""),n.useBoxTarget?((e=r).depth=n.depth,e.height=n.height,e.width=n.width):((e=i).height=n.height,e.width=n.width),t.setAttribute("geometry",e),t.object3D.visible=!1,t.object3D.position.copy(n.position),t.object3D.rotation.x=THREE.Math.degToRad(n.rotation.x),t.object3D.rotation.y=THREE.Math.degToRad(n.rotation.y),t.object3D.rotation.z=THREE.Math.degToRad(n.rotation.z),a.appendChild(t)})}),window.AFRAME){const t=["raycaster-target"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){var r,i,a,o;if(AFRAME.registerComponent("recenter",{schema:{enabled:{default:!0}},init:function(){this.el.sceneEl;this.recenter=this.recenter.bind(this),document.querySelectorAll("[tracked-controls]").forEach(e=>{e.addEventListener("menudown",this.recenter),e.addEventListener("thumbstickdown",this.recenter)}),this.el.addEventListener("recenter",this.recenter)},recenter:(r=new THREE.Euler,i=new THREE.Matrix4,a=new THREE.Matrix4,o=new THREE.Matrix4,function(){const e=this.el;if(!this.data.enabled)return;const t=e.sceneEl.camera.el.object3D;i.identity(),r.set(0,-1*t.rotation.y,0),a.makeRotationFromEuler(r),o.makeTranslation(-1*t.position.x,0,-1*t.position.z),i.multiply(a).multiply(o),i.decompose(e.object3D.position,e.object3D.quaternion,e.object3D.scale),e.object3D.updateMatrixWorld(!0),e.emit("recentered",null,!1)})}),window.AFRAME){const t=["recenter"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerShader("ring",{schema:{blur:{default:.01,is:"uniform"},color:{type:"color",is:"uniform"},progress:{default:0,is:"uniform"},radiusInner:{default:.6,is:"uniform"},radiusOuter:{default:1,is:"uniform"}},vertexShader:n(148),fragmentShader:n(149)}),window.AFRAME){const t=[],n=["ring"],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t){e.exports="varying vec2 vUv;\n\nvoid main () {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n"},function(e,t){e.exports="#if __VERSION__ == 100\n #extension GL_OES_standard_derivatives : enable\n#endif\n#define PI 3.14159265358979\nuniform float blur;\nuniform float progress;\nuniform float radiusInner;\nuniform float radiusOuter;\nuniform vec3 color;\n\nvarying vec2 vUv;\n\nvoid main () {\n // make uvs go from -1 to 1\n vec2 uv = vec2(vUv.x * 2.0 - 1.0, vUv.y * 2.0 - 1.0);\n // calculate distance of fragment to center\n float r = uv.x * uv.x + uv.y * uv.y;\n // calculate antialias\n float aa = fwidth(r);\n // make full circle (radiusOuter - radiusInner)\n float col = (1.0 - smoothstep(radiusOuter - aa, radiusOuter + blur + aa, r)) * smoothstep(radiusInner - aa, radiusInner + blur + aa, r);\n // radial gradient\n float a = smoothstep(-PI-aa, PI+aa, atan(uv.y, uv.x));\n // progress angle\n float p = 1.0 - progress - blur;\n // apply progress to full circle (1 for done part, 0 for part to go)\n col *= smoothstep(p, p + blur, a);\n // multiply by user color\n gl_FragColor = vec4(color * col, col);\n}\n"},function(e,t,n){if(AFRAME.registerComponent("score-texts",{schema:{isLoading:{default:!1}},init:function(){this.textEls=this.el.querySelectorAll("[text]");for(let e=0;e<this.textEls.length;e++)this.textEls[e].setAttribute("animation__fadein",{autoplay:!1,property:"components.text.material.uniforms.opacity.value",delay:250,dur:750,easing:"easeInOutCubic",from:0,to:1})},update:function(e){if(e.isLoading&&!this.data.isLoading){for(let e=0;e<this.textEls.length;e++)this.textEls[e].components.animation__fadein.beginAnimation();this.el.sceneEl.emit("textglownormal",null,!1)}if(!e.isLoading&&this.data.isLoading){for(let e=0;e<this.textEls.length;e++)this.textEls[e].components.text.material.uniforms.opacity.value=0;this.el.sceneEl.emit("textglowoff",null,!1)}}}),window.AFRAME){const t=["score-texts"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){"use strict";n.r(t);n(6);if(AFRAME.registerComponent("search-thumbnail-atlas",{dependencies:["geometry","material"],schema:{dummyUpdater:{type:"string"}},init:function(){const e=this.canvas=document.createElement("canvas");e.setAttribute("id","thumbnailAtlasMap"),e.height=512,e.width=64,e.style.visibility="hidden",this.ctx=e.getContext("2d"),this.clearCanvas(),document.body.appendChild(e);const t=this.alphaCanvas=document.createElement("canvas");t.setAttribute("id","thumbnailAlphaMap"),t.height=512,t.width=64,t.style.visibility="hidden",this.alphaCtx=t.getContext("2d"),document.body.appendChild(t),this.el.components.material.material.alphaMap=new THREE.CanvasTexture(t),this.el.setAttribute("material","src",e),this.images=[],this.lastNumResults=6},update:function(){const e=this.el.sceneEl.systems.state.state.searchResultsPage;for(let t=0;t<e.length;t++){let n=this.images[t]=this.images[t]||document.createElement("img");n.crossOrigin="anonymous",n.src=e[t].coverURL,n.complete?this.draw(n,t):n.onload=()=>{this.draw(n,t)}}e.length!==this.lastNumResults&&this.updateAlphaMap(e.length),this.lastNumResults=e.length},draw:function(e,t){this.ctx.drawImage(e,0,t*(512/384*64),64,512/384*64),this.el.getObject3D("mesh").material.map.needsUpdate=!0},clearCanvas:function(){const e=this.canvas;this.ctx.fillStyle="#111",this.ctx.fillRect(0,0,e.width,e.height)},updateAlphaMap:function(e){const t=this.alphaCanvas,n=this.alphaCtx;n.fillStyle="#FFF",n.fillRect(0,0,t.width,t.height),n.fillStyle="#000",n.fillRect(0,e*(512/384*64),t.width,t.height-e*(512/384*64)),this.el.getObject3D("mesh").material.alphaMap.needsUpdate=!0,this.el.getObject3D("mesh").material.needsUpdate=!0}}),window.AFRAME){const t=["search-thumbnail-atlas"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){const r=n(153),i=n(28),a=n(154).map(i);if(AFRAME.registerComponent("search",{schema:{difficultyFilter:{default:"All"},genre:{default:""},playlist:{default:""},query:{default:""}},init:function(){this.eventDetail={query:"",results:a,url:"",page:0},this.keyboardEl=document.getElementById("keyboard"),this.popularHits=a,function(e){for(let t=e.length-1;t>0;t--){const n=Math.floor(Math.random()*(t+1));[e[t],e[n]]=[e[n],e[t]]}}(this.popularHits),this.queryObject={hitsPerPage:0,query:""},this.el.sceneEl.addEventListener("searchclear",()=>{this.search("")})},update:function(e){this.popularHits&&(e.query&&!this.data.query&&(this.keyboardEl.components["super-keyboard"].data.value="",this.keyboardEl.components["super-keyboard"].updateTextInput("")),this.debouncedSearch=r(this.search.bind(this),1e3),(this.data.genre||this.data.playlist||this.data.query)&&this.search(this.data.query))},play:function(){this.el.sceneEl.emit("searchresults",this.eventDetail),this.search("")},events:{superkeyboardchange:function(e){e.target===this.el&&this.debouncedSearch(e.detail.value)}},search:function(e){if(!e&&"All"===this.data.difficultyFilter&&!this.data.genre&&!this.data.playlist&&this.popularHits)return this.eventDetail.results=this.popularHits,this.eventDetail.query="",void this.el.sceneEl.emit("searchresults",this.eventDetail);if(this.eventDetail.query=e,this.queryObject.query=e,this.queryObject.hitsPerPage=e?30:150,"favorites"===this.data.playlist)return this.eventDetail.results=JSON.parse(localStorage.getItem("favorites-v2")),void this.el.sceneEl.emit("searchresults",this.eventDetail);let t="https://api.beatsaver.com/search/text/CURRENT_PAGE_INDEX?sortOrder=Rating&automapper=true&q="+encodeURIComponent(e);if(this.data.playlist)t=`https://api.beatsaver.com/playlists/id/${this.data.playlist}/CURRENT_PAGE_INDEX`;else if(this.data.genre){const e={Pop:"pop","R&B":"rb",Rap:"hip-hop-rap",Rock:"rock",Soundtrack:"tv-movie-soundtrack","Video Games":"video-game-soundtrack",Electronic:"electronic","Hip Hop":"hip-hop-rap",House:"house","J-Pop":"j-pop","K-Pop":"k-pop",Meme:"comedy-meme",Alternative:"alternative",Anime:"anime",Comedy:"comedy-meme",Dubstep:"dubstep",Dance:"dance"}[this.data.genre];t="https://api.beatsaver.com/search/text/CURRENT_PAGE_INDEX?sortOrder=Rating&automapper=true&tags="+encodeURIComponent(e)}else if(e&&e.length<3)return;fetch(t.replaceAll("CURRENT_PAGE_INDEX",0)).then(e=>e.json()).then(e=>{var n=(e.docs||e.maps).map(i);this.eventDetail.results=n,this.eventDetail.url=t,this.eventDetail.urlPage=0,this.el.sceneEl.emit("searchresults",this.eventDetail)})}}),AFRAME.registerComponent("search-result-list",{init:function(){new MutationObserver(e=>{for(let t=0;t<e.length;t++)"data-index"===e[t].attributeName&&this.refreshLayout()}).observe(this.el,{attributes:!0,childList:!1,subtree:!0})},events:{click:function(e){this.el.sceneEl.emit("menuchallengeselect",e.target.closest(".searchResult").dataset.id,!1)}},refreshLayout:function(){this.el.emit("layoutrefresh",null,!1)}}),window.AFRAME){const t=["search","search-result-list"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){(function(t){var n=/^\s+|\s+$/g,r=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,a=/^0o[0-7]+$/i,o=parseInt,s="object"==typeof t&&t&&t.Object===Object&&t,c="object"==typeof self&&self&&self.Object===Object&&self,l=s||c||Function("return this")(),u=Object.prototype.toString,h=Math.max,d=Math.min,p=function(){return l.Date.now()};function f(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function m(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==u.call(e)}(e))return NaN;if(f(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=f(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(n,"");var s=i.test(e);return s||a.test(e)?o(e.slice(2),s?2:8):r.test(e)?NaN:+e}e.exports=function(e,t,n){var r,i,a,o,s,c,l=0,u=!1,g=!1,y=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function v(t){var n=r,a=i;return r=i=void 0,l=t,o=e.apply(a,n)}function b(e){return l=e,s=setTimeout(A,t),u?v(e):o}function w(e){var n=e-c;return void 0===c||n>=t||n<0||g&&e-l>=a}function A(){var e=p();if(w(e))return E(e);s=setTimeout(A,function(e){var n=t-(e-c);return g?d(n,a-(e-l)):n}(e))}function E(e){return s=void 0,y&&r?v(e):(r=i=void 0,o)}function x(){var e=p(),n=w(e);if(r=arguments,i=this,c=e,n){if(void 0===s)return b(c);if(g)return s=setTimeout(A,t),v(c)}return void 0===s&&(s=setTimeout(A,t)),o}return t=m(t)||0,f(n)&&(u=!!n.leading,a=(g="maxWait"in n)?h(m(n.maxWait)||0,t):a,y="trailing"in n?!!n.trailing:y),x.cancel=function(){void 0!==s&&clearTimeout(s),l=0,r=c=i=s=void 0},x.flush=function(){return void 0===s?o:E(p())},x}}).call(this,n(1))},function(e,t){e.exports=[{id:"43a25",name:"[Extra Sensory II] Porter Robinson - Lifelike",description:"// MAP 3 OF EXTRA SENSORY II\n[ https://beatsaver.com/playlists/797071 ]\n\nthis is only the beginning...*\n\nVideo:\nhttps://www.youtube.com/watch?v=dlqYqNKcLII",uploader:{id:4340055,name:"nasafrasa",avatar:"https://cdn.beatsaver.com/avatar/16a6108559271b0c0a8d254ceb5ad43f896a0a28.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4340055/playlist"},metadata:{bpm:100.72,duration:96,songName:"Lifelike",songSubName:"",songAuthorName:"Porter Robinson",levelAuthorName:"nasafrasa"},stats:{plays:0,downloads:0,upvotes:3632,downvotes:14,score:.9918,reviews:6,sentiment:"VERY_POSITIVE"},uploaded:"2025-01-26T23:35:01.030128Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"cb5470be988e526c08e1c7e98f2ba9c26ec6fbd0",state:"Published",createdAt:"2025-01-26T05:53:34.451213Z",sageScore:5,diffs:[{njs:16,offset:0,notes:123,bombs:0,obstacles:0,nps:1.564,length:132,characteristic:"Standard",difficulty:"Easy",events:77,chroma:!0,me:!1,ne:!0,cinema:!1,vivify:!0,seconds:78.634,paritySummary:{errors:0,warns:0,resets:0},maxScore:106395,label:"Nurture",environment:"BillieEnvironment"},{njs:16,offset:0,notes:145,bombs:0,obstacles:0,nps:1.844,length:132,characteristic:"Standard",difficulty:"Normal",events:77,chroma:!0,me:!1,ne:!0,cinema:!1,vivify:!0,seconds:78.634,paritySummary:{errors:0,warns:0,resets:0},maxScore:128235,label:"Lifelike",environment:"BillieEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/cb5470be988e526c08e1c7e98f2ba9c26ec6fbd0.zip",coverURL:"https://eu.cdn.beatsaver.com/cb5470be988e526c08e1c7e98f2ba9c26ec6fbd0.jpg",previewURL:"https://eu.cdn.beatsaver.com/cb5470be988e526c08e1c7e98f2ba9c26ec6fbd0.mp3"}],curator:{id:4292041,name:"symphonic",avatar:"https://cdn.beatsaver.com/avatar/2dc906ee5b78c2cb723f0eae964c2c203babf3f4.png",type:"DISCORD",admin:!0,curator:!0,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4292041/playlist"},curatedAt:"2025-01-27T00:42:00.509882Z",createdAt:"2025-01-26T05:53:34.451213Z",updatedAt:"2025-11-07T23:01:19.839738Z",lastPublishedAt:"2025-01-26T23:35:01.030128Z",tags:["accuracy","balanced","ambient","classical-orchestral"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"43a1f",name:"[Extra Sensory II] Simplifi - you",description:"// MAP 4 OF EXTRA SENSORY II\n[ https://beatsaver.com/playlists/797071 ]\n\n====================================================\n\neverything you see in this map was created (from scratch!) by me\n\nlong time coming. this map represents the end of a chapter, and the start of a new one. I've been dreaming of releasing a map with Vivify almost as long as I've been a Beat Saber creative. I was stuck for so long, but I finally had a breakthrough!\n\nand it's yours to keep.\n\n====================================================\n\nproject source: https://github.com/Swifter1243/you_map\ngameplay video: https://youtu.be/2SgLtmqxu-k \nExtra Sensory II website: https://exsii.totalbs.dev/",uploader:{id:4284246,name:"Swifter",hash:"5dcf3af29eccad0006a0b45f",avatar:"https://cdn.beatsaver.com/avatar/9473c86aef59ee6780dce3b2f091ee167e75bbc3.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4284246/playlist"},metadata:{bpm:70,duration:157,songName:"you",songSubName:"",songAuthorName:"Simplifi",levelAuthorName:"Swifter"},stats:{plays:0,downloads:0,upvotes:5380,downvotes:28,score:.9914,reviews:35,sentiment:"VERY_POSITIVE"},uploaded:"2025-01-26T23:35:01.797228Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"d265d40935983502ad6f05ddeb5417f3e37c2290",state:"Published",createdAt:"2025-01-26T04:23:47.346441Z",sageScore:3,diffs:[{njs:8,offset:-.25,notes:160,bombs:0,obstacles:0,nps:1.106,length:168.75,characteristic:"Standard",difficulty:"Normal",events:0,chroma:!0,me:!1,ne:!0,cinema:!1,vivify:!0,seconds:144.643,paritySummary:{errors:0,warns:0,resets:0},maxScore:140835,environment:"BillieEnvironment"},{njs:8,offset:-.25,notes:160,bombs:0,obstacles:0,nps:1.106,length:168.75,characteristic:"Standard",difficulty:"Hard",events:0,chroma:!0,me:!1,ne:!0,cinema:!1,vivify:!0,seconds:144.643,paritySummary:{errors:0,warns:0,resets:0},maxScore:140675,environment:"BillieEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/d265d40935983502ad6f05ddeb5417f3e37c2290.zip",coverURL:"https://eu.cdn.beatsaver.com/d265d40935983502ad6f05ddeb5417f3e37c2290.jpg",previewURL:"https://eu.cdn.beatsaver.com/d265d40935983502ad6f05ddeb5417f3e37c2290.mp3"}],curator:{id:4331555,name:"TheBlackParrot",avatar:"https://cdn.beatsaver.com/avatar/213097af5fb746f71825aad761723951ce4807ab.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,playlistUrl:"https://api.beatsaver.com/users/id/4331555/playlist"},curatedAt:"2025-01-26T23:47:25.274685Z",createdAt:"2025-01-26T04:23:47.346441Z",updatedAt:"2025-02-09T02:00:19.217070Z",lastPublishedAt:"2025-01-26T23:35:01.797228Z",tags:["electronic","accuracy"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"1a0b6",name:"[Electro Swing Pack] The Electric Swing Circus - Empires",description:"Nixie Presents: Electro Swing Pack!\n\n10 electro swing songs with expert and expert+ diffs to make your booty swing!\n\nGet The Pack: \nhttps://bsaber.com/electro-swing-pack/\n\nMap Gameplay:\nhttps://youtu.be/WJy6_2cTPYg\n\nComplete Pack Playthrough:\nhttps://youtu.be/yj9rw4MEh7s\n\n\nHuge thanks in particular to:\nMonstor, Bearly, Noxn, Bullet, Vaser888, Tocxx, Jafdy, Storm Knight and Pixelguy!\n\n\nMore Maps: https://beatsaver.com/profile/4286374\nDiscord Tag: Nixie.Korten#6944\nJoin My Server: https://discord.gg/RjxPpZtH7w\nTwitter: https://twitter.com/Nixie_Korten\nInstagram: https://www.instagram.com/nixie.korten/",uploader:{id:4286374,name:"Nixie.Korten",hash:"6096752e12772e0006e2f7e6",avatar:"https://cdn.beatsaver.com/avatar/bb97db2b49d21f5cbc1a5ba50742fa0e5c86ed3c.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4286374/playlist"},metadata:{bpm:120,duration:173,songName:"Empires",songSubName:"",songAuthorName:"The Electric Swing Circus",levelAuthorName:"Nixie.Korten"},stats:{plays:0,downloads:0,upvotes:5096,downvotes:31,score:.9905,reviews:2},uploaded:"2021-07-08T15:24:55.769Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"cecc89118b3a75ea7d65ceff5949b3ef19fea716",key:"1a0b6",state:"Published",createdAt:"2021-07-08T15:24:55.769Z",sageScore:4,diffs:[{njs:16,offset:-.5,notes:522,bombs:0,obstacles:24,nps:3.173,length:329,characteristic:"Standard",difficulty:"Expert",events:2051,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:164.5,paritySummary:{errors:0,warns:0,resets:0},maxScore:472995,environment:"PanicEnvironment"},{njs:19,offset:.25,notes:823,bombs:0,obstacles:0,nps:5.003,length:329,characteristic:"Standard",difficulty:"ExpertPlus",events:2051,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:164.5,paritySummary:{errors:0,warns:0,resets:0},maxScore:749915,environment:"PanicEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/cecc89118b3a75ea7d65ceff5949b3ef19fea716.zip",coverURL:"https://eu.cdn.beatsaver.com/cecc89118b3a75ea7d65ceff5949b3ef19fea716.jpg",previewURL:"https://eu.cdn.beatsaver.com/cecc89118b3a75ea7d65ceff5949b3ef19fea716.mp3"}],curator:{id:57657,name:"Pixelguy",hash:"5cff0b7698cc5a672c8541a8",avatar:"https://cdn.beatsaver.com/avatar/57657.jpg",type:"SIMPLE",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/57657/playlist"},curatedAt:"2021-07-08T15:24:55.769Z",createdAt:"2021-07-08T15:24:55.769Z",updatedAt:"2024-11-02T11:17:18.878282Z",lastPublishedAt:"2021-07-08T15:24:55.769Z",tags:["swing","balanced","dance-style","electronic"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"1e6ff",name:"{Modchart} acloudyskye - Somewhere Out There",description:"MAP 10. https://beatsaver.com/playlists/8713\n\nWhat can I say about this map.\n\nI feel like this is the culmination of everything thats happened for modcharting this entire year. All of the advancements I've made with environments, mawntee has made with notemods, and reddek has made with walls come together into this piece that I can only describe as the next step. \n\nI really hope everyone enjoys this one. It's one of a kind.\n\nVideo: https://www.youtube.com/watch?v=rphHsDxJbpg",uploader:{id:4284246,name:"Swifter",hash:"5dcf3af29eccad0006a0b45f",avatar:"https://cdn.beatsaver.com/avatar/9473c86aef59ee6780dce3b2f091ee167e75bbc3.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4284246/playlist"},metadata:{bpm:160,duration:323,songName:"Somewhere Out There",songSubName:"",songAuthorName:"acloudyskye",levelAuthorName:"Swifter, Mawntee, Reddek"},stats:{plays:0,downloads:0,upvotes:20023,downvotes:170,score:.9901,reviews:34,sentiment:"VERY_POSITIVE"},uploaded:"2021-11-30T01:27:30.018531Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"448d219117992026eb23c98dc920ce73a912f289",state:"Published",createdAt:"2022-09-26T15:58:45.498795Z",sageScore:1,diffs:[{njs:19,offset:-.5,notes:892,bombs:8,obstacles:3746,nps:2.973,length:800,characteristic:"Standard",difficulty:"Expert",events:38114,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:300,paritySummary:{errors:0,warns:0,resets:0},maxScore:813395,label:"Experience Recommended",environment:"BTSEnvironment"},{njs:19,offset:-.5,notes:1134,bombs:8,obstacles:3530,nps:3.78,length:800,characteristic:"Lawless",difficulty:"ExpertPlus",events:38114,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:300,paritySummary:{errors:719,warns:26,resets:1},maxScore:1036035,label:"Busier Mapping",environment:"BTSEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/448d219117992026eb23c98dc920ce73a912f289.zip",coverURL:"https://eu.cdn.beatsaver.com/448d219117992026eb23c98dc920ce73a912f289.jpg",previewURL:"https://eu.cdn.beatsaver.com/448d219117992026eb23c98dc920ce73a912f289.mp3"}],curator:{id:4284942,name:"blackjack",hash:"5e96ca3a16c96800062400fe",avatar:"https://cdn.beatsaver.com/avatar/dcd6d334252b91670180855821886983a1818f4a.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4284942/playlist"},curatedAt:"2021-11-30T01:27:30.018531Z",createdAt:"2021-11-30T01:03:02.982731Z",updatedAt:"2023-08-26T19:08:38.528705Z",lastPublishedAt:"2022-09-26T16:01:29.467930Z",tags:["pop","balanced"],bookmarked:!1,collaborators:[{id:4233941,name:"reddek",hash:"5dbfb4426dea0b0006bd328d",avatar:"https://cdn.beatsaver.com/avatar/fc462a26fa97d9b2fdadbdf5d7a45ef75026f8e9.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4233941/playlist"},{id:4285959,name:"Mawntee",hash:"5cff0b7698cc5a672c854ca6",avatar:"https://cdn.beatsaver.com/avatar/e373d502d75ed37d9cc60d2aa58b08f8ab6ebc90.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4285959/playlist"}],declaredAi:"None",blRanked:!1,blQualified:!1},{id:"d7fa",name:"Geoxor - Gloom [Wallmap]",description:"REUPLOAD due to last minute mapping error\n\nSpecial thanks to:\nNyri0 - For providing scripts that were crucial to making this map possible, and for helping me along the way.\nLayanmeta - For giving me so much encouragement throughout the final stages and making a brilliant YouTube video on this map.\nBSMG discord - For the continued support throughout the development process\nAll you people/birds - For playing my map :D\n\nBRIAN HAS BECOME SENTIENT. ALL HAIL BRIAN",uploader:{id:18761,name:"minething",hash:"5e9b4ead16c9680006287387",avatar:"https://www.gravatar.com/avatar/f9bed76044f22e33e287d984993c59797049f1315d399c641b1ea7778975c926?d=retro",type:"SIMPLE",admin:!1,curator:!1,seniorCurator:!1,playlistUrl:"https://api.beatsaver.com/users/id/18761/playlist"},metadata:{bpm:93,duration:167,songName:"Gloom",songSubName:"",songAuthorName:"Geoxor",levelAuthorName:"Mine Thing"},stats:{plays:0,downloads:0,upvotes:9917,downvotes:81,score:.9896,reviews:8,sentiment:"VERY_POSITIVE"},uploaded:"2020-08-16T19:13:40.774Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"823b4e880baac024728ae96a7c20e28026c4585d",key:"d7fa",state:"Published",createdAt:"2020-08-16T19:13:40.774Z",sageScore:3,diffs:[{njs:12,offset:6,notes:0,bombs:0,obstacles:15605,nps:0,length:0,characteristic:"Standard",difficulty:"Easy",events:144,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:0,paritySummary:{errors:0,warns:0,resets:0},maxScore:0,label:"Lightshow",environment:"RocketEnvironment"},{njs:12,offset:6,notes:202,bombs:0,obstacles:15605,nps:1.309,length:239.125,characteristic:"Standard",difficulty:"Hard",events:144,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:154.274,paritySummary:{errors:48,warns:6,resets:0},maxScore:178595,environment:"RocketEnvironment"},{njs:12,offset:6,notes:411,bombs:4,obstacles:15605,nps:2.665,length:239,characteristic:"Standard",difficulty:"Expert",events:144,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:154.194,paritySummary:{errors:0,warns:0,resets:1},maxScore:370875,environment:"RocketEnvironment"},{njs:12,offset:3,notes:411,bombs:4,obstacles:12340,nps:2.665,length:239,characteristic:"Standard",difficulty:"ExpertPlus",events:144,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:154.194,paritySummary:{errors:0,warns:0,resets:1},maxScore:370875,label:"Less Lag",environment:"RocketEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/823b4e880baac024728ae96a7c20e28026c4585d.zip",coverURL:"https://eu.cdn.beatsaver.com/823b4e880baac024728ae96a7c20e28026c4585d.jpg",previewURL:"https://eu.cdn.beatsaver.com/823b4e880baac024728ae96a7c20e28026c4585d.mp3"}],curator:{id:4316945,name:"BeastSaber",avatar:"https://cdn.beatsaver.com/avatar/4316945.jpg",type:"SIMPLE",admin:!1,curator:!0,seniorCurator:!1,curatorTab:!0,playlistUrl:"https://api.beatsaver.com/users/id/4316945/playlist"},curatedAt:"2020-08-16T19:13:40.774Z",createdAt:"2020-08-16T19:13:40.774Z",updatedAt:"2020-08-16T19:13:40.774Z",lastPublishedAt:"2020-08-16T19:13:40.774Z",bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"43a24",name:"[Extra Sensory II] Andrew Prahlow - End Times",description:"// MAP 2 OF EXTRA SENSORY II\n[https://beatsaver.com/playlists/797071]\n\n=================================================\n\nFirst off, I just want to say thank you. Thank you to the entire TotalBS team (Especially Swifter and Aeroluna) for giving me a chance with this project. When I started on this map, I honestly never thought it would turn into anything like this. At first, it was just going to be something simple with the sun, stars, and you. But as I kept learning more about Unity and Vivify, the project just kept growing little by little, until it became what it is now.\n\nI’ve gotta give a special shoutout to Swifter for helping so much with the shaders, and to Aeroluna for making the custom UI possible. Without those two, this map would not have been able to become what it is now.\n\nOver the past year or so working on this, I feel like my goals and what I want in life have completely shifted. I’ve got more drive and motivation now than I’ve ever had before, and I’m so thankful for that.\n\nI'd like to also thank my closest friend, Azushii, for introducing me to Outer Wilds and encouraging me to start this map in the first place. Rest in peace buddy.. <3\n\n=================================================\nCustom Saber Model: [Coming Soon]\nCustom Note Model: [Coming Soon]\nProject Source: [Coming Soon]\nGameplay Video: https://youtu.be/YtETILVC4V4\nExtra Sensory II Website: https://exsii.totalbs.dev/",uploader:{id:70911,name:"Chaimzy",hash:"605ae0535ab13d000609b331",avatar:"https://cdn.beatsaver.com/avatar/70911.jpg",type:"SIMPLE",admin:!1,curator:!1,seniorCurator:!1,playlistUrl:"https://api.beatsaver.com/users/id/70911/playlist"},metadata:{bpm:128,duration:157,songName:"End Times",songSubName:"Outer Wilds",songAuthorName:"Andrew Prahlow",levelAuthorName:"Chaimzy"},stats:{plays:0,downloads:0,upvotes:3127,downvotes:20,score:.9889,reviews:8,sentiment:"VERY_POSITIVE"},uploaded:"2025-01-26T23:35:01.057933Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"b4acc042f6541c06e57a384fa9796a10c45ff558",state:"Published",createdAt:"2025-01-26T05:32:44.984680Z",sageScore:3,diffs:[{njs:16,offset:0,notes:32,bombs:8,obstacles:0,nps:.533,length:128,characteristic:"Standard",difficulty:"Hard",events:0,chroma:!0,me:!1,ne:!0,cinema:!1,vivify:!0,seconds:60,paritySummary:{errors:0,warns:0,resets:0},maxScore:22195,label:"There's more to explore here",environment:"DefaultEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/b4acc042f6541c06e57a384fa9796a10c45ff558.zip",coverURL:"https://eu.cdn.beatsaver.com/b4acc042f6541c06e57a384fa9796a10c45ff558.jpg",previewURL:"https://eu.cdn.beatsaver.com/b4acc042f6541c06e57a384fa9796a10c45ff558.mp3"}],curator:{id:4286182,name:"MadChase",avatar:"https://cdn.beatsaver.com/avatar/99feaf0fe97b6c67dde2ae7ba055fab744b0ac61.png",type:"DISCORD",admin:!1,curator:!0,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4286182/playlist"},curatedAt:"2025-01-27T00:06:25.521273Z",createdAt:"2025-01-26T05:32:44.984680Z",updatedAt:"2025-01-30T01:51:28.961316Z",lastPublishedAt:"2025-01-26T23:35:01.057934Z",tags:["accuracy","ambient","video-game-soundtrack"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"d4a5",name:"[FUTURE FUNK PACK] Shiawase No Monosashi (VANTAGE // Short Ver.)",description:'FUTURE FUNK MAP PACK\n2 songs uploaded everyday through August 10th - 14th!\n\n"Shiawase No Monosashi" is performed by Mariya Takeuchi. This version of the song is a short edit I made from VANTAGE //\'s edit. The original length of the song is 5 minutes long\n\nPlease look forward to the upcoming maps!\n\nDM any feedback on Discord\nETAN#8341',uploader:{id:4235140,name:"ETAN",hash:"5cff0b7798cc5a672c855775",avatar:"https://cdn.beatsaver.com/avatar/652a9b5d335007c8668b43aa727c75e84794dbe1.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4235140/playlist"},metadata:{bpm:128,duration:171,songName:"Shiawase No Monosashi",songSubName:"(VANTAGE // Short Ver.)",songAuthorName:"Mariya Takeuchi",levelAuthorName:"ETAN"},stats:{plays:0,downloads:0,upvotes:9325,downvotes:95,score:.9876,reviews:2},uploaded:"2020-08-12T18:17:44.285Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"d7cb32f23041dec272de3da0ac141dd8f91478ca",key:"d4a5",state:"Published",createdAt:"2020-08-12T18:17:44.285Z",sageScore:7,diffs:[{njs:10,offset:1,notes:168,bombs:16,obstacles:1,nps:1.029,length:348.25,characteristic:"Standard",difficulty:"Easy",events:7775,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:163.242,paritySummary:{errors:0,warns:0,resets:0},maxScore:147315,environment:"BigMirrorEnvironment"},{njs:11,offset:1,notes:255,bombs:16,obstacles:1,nps:1.562,length:348.25,characteristic:"Standard",difficulty:"Normal",events:7775,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:163.242,paritySummary:{errors:1,warns:1,resets:0},maxScore:227355,environment:"BigMirrorEnvironment"},{njs:12,offset:1,notes:358,bombs:16,obstacles:1,nps:2.193,length:348.25,characteristic:"Standard",difficulty:"Hard",events:7775,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:163.242,paritySummary:{errors:0,warns:0,resets:0},maxScore:322115,environment:"BigMirrorEnvironment"},{njs:15,offset:0,notes:557,bombs:16,obstacles:1,nps:3.335,length:356.25,characteristic:"Standard",difficulty:"Expert",events:7775,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:166.992,paritySummary:{errors:0,warns:0,resets:0},maxScore:505195,environment:"BigMirrorEnvironment"},{njs:19,offset:-.5,notes:778,bombs:16,obstacles:1,nps:4.659,length:356.25,characteristic:"Standard",difficulty:"ExpertPlus",events:7775,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:166.992,paritySummary:{errors:0,warns:0,resets:0},maxScore:708515,environment:"BigMirrorEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/d7cb32f23041dec272de3da0ac141dd8f91478ca.zip",coverURL:"https://eu.cdn.beatsaver.com/d7cb32f23041dec272de3da0ac141dd8f91478ca.jpg",previewURL:"https://eu.cdn.beatsaver.com/d7cb32f23041dec272de3da0ac141dd8f91478ca.mp3"}],curator:{id:4316945,name:"BeastSaber",avatar:"https://cdn.beatsaver.com/avatar/4316945.jpg",type:"SIMPLE",admin:!1,curator:!0,seniorCurator:!1,curatorTab:!0,playlistUrl:"https://api.beatsaver.com/users/id/4316945/playlist"},curatedAt:"2020-08-12T18:17:44.285Z",createdAt:"2020-08-12T18:17:44.285Z",updatedAt:"2020-08-12T18:17:44.285Z",lastPublishedAt:"2020-08-12T18:17:44.285Z",tags:["j-pop","house"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"4968d",name:"{Vivify} Jaron - 743⁺Aether*✧ ˳ ⁎ ¹¹¹} ⁺ . ˳",description:"**Originally, this map was going to be my Extra Sensory II map.**\n\nHowever, given the insane density of this song, it demanded rapidly changing visuals that kept up with how dynamic it felt to listen to. I did not have the technical or artistic skill to pull off this song. I tried and failed, for 3 years. Finally, after executing Extra Sensory II this year, I realized it was time to tackle this behemoth of a project. This project took over ~350 hours, and 1000 repository commits. The majority of it was put together over the last 3 months.\n\nI really think that I executed on this vision to a tee, landing every single visual cue that I imagined ever since I heard the song for the first time in 2022. I hope you can feel the electricity of this experience <3\n\n✧\n\n**Special Thanks:**\n- **Frautcres** - Doing extensive technical performance investigations in order to make the map run without a hitch, as well as assisting with technical difficulties\n- **Chaimzy, Astra, HAMCORE, Mawntee, TheBlackParrot, TinyPawb, Klondike, RidgeVR, UGEcko** - Doing loads of playtesting and giving feedback to make the map feel as polished as it does\n- **SKYZA.** - Beautiful ribbon & saber textures\n- **Jaron** - Creating this incredible song, and supporting me over the years as I tried to make visuals that shaped up\n\nvideo: https://youtu.be/qZ1prxep0Wc\nproject source: https://github.com/Swifter1243/aether_map",uploader:{id:4284246,name:"Swifter",hash:"5dcf3af29eccad0006a0b45f",avatar:"https://cdn.beatsaver.com/avatar/9473c86aef59ee6780dce3b2f091ee167e75bbc3.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4284246/playlist"},metadata:{bpm:145,duration:274,songName:"743+Aether*✧ . * 111} + , .",songSubName:"",songAuthorName:"Jaron",levelAuthorName:"Swifter"},stats:{plays:0,downloads:0,upvotes:2252,downvotes:15,score:.9876,reviews:34,sentiment:"VERY_POSITIVE"},uploaded:"2025-08-14T16:00:00.354832Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"cc66335f2b8bf50fe49591dd925860b2e596018e",state:"Published",createdAt:"2025-08-14T16:13:20.156249Z",sageScore:3,diffs:[{njs:12,offset:-.5,notes:444,bombs:0,obstacles:0,nps:1.698,length:632,characteristic:"Standard",difficulty:"Expert",events:0,chroma:!0,me:!1,ne:!0,cinema:!1,vivify:!0,seconds:261.517,paritySummary:{errors:0,warns:0,resets:0},maxScore:401235,label:"✧",environment:"BillieEnvironment"},{njs:16,offset:-.5,notes:703,bombs:0,obstacles:0,nps:2.688,length:632,characteristic:"Lawless",difficulty:"ExpertPlus",events:0,chroma:!0,me:!1,ne:!0,cinema:!1,vivify:!0,seconds:261.517,paritySummary:{errors:0,warns:0,resets:0},maxScore:639515,label:"\\___*",environment:"BillieEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/cc66335f2b8bf50fe49591dd925860b2e596018e.zip",coverURL:"https://eu.cdn.beatsaver.com/cc66335f2b8bf50fe49591dd925860b2e596018e.jpg",previewURL:"https://eu.cdn.beatsaver.com/cc66335f2b8bf50fe49591dd925860b2e596018e.mp3"}],curator:{id:4285538,name:"Darkrealm7",hash:"5ffa2803f2cdd000075e24ed",avatar:"https://cdn.beatsaver.com/avatar/7b66a32ba61dcfb938aa0d2207911eb08d28a06f.png",type:"DISCORD",admin:!1,curator:!0,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4285538/playlist"},curatedAt:"2025-08-14T21:11:11.210516Z",createdAt:"2025-08-14T04:02:49.366190Z",updatedAt:"2025-08-20T16:41:30.561039Z",lastPublishedAt:"2025-08-20T16:41:30.561039Z",bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"1362d",name:"Ghost Choir - Louie Zong (modchart)",description:"This is a relaxing modchart and a technical proof of concept. If you haven't played my modchart Dondante yet, please check it out: https://beatsaver.com/beatmap/123b5\r\n\r\nThe map requires the mods Noodle Extensions and Chroma. If Noodle Extensions is not available yet on ModAssistant, you can get the latest release at https://github.com/Aeroluna/NoodleExtensions/releases/tag/v1.3.5\r\n\r\nTips for a better experience:\r\n- Disable static lights; there are no lights anyway\r\n- Hide the HUD\r\n- Turn the SFX volume down (0 or low value like 0.2)\r\n- Enable bloom post-processing\r\n\r\nPreview: https://youtu.be/XC7RY9C_EHs\r\n\r\nI adapted this from Louie Zong's original animation: https://youtu.be/kXF3VYYa5TI\r\n\r\n",uploader:{id:4288814,name:"nyri0",hash:"5e792df416c9680006086a78",avatar:"https://cdn.beatsaver.com/avatar/233323d456510756fbbc0140c1a0698caf8b096c.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,playlistUrl:"https://api.beatsaver.com/users/id/4288814/playlist"},metadata:{bpm:67,duration:90,songName:"Ghost Choir",songSubName:"",songAuthorName:"Louie Zong",levelAuthorName:"nyri0"},stats:{plays:0,downloads:0,upvotes:4478,downvotes:42,score:.987,reviews:6,sentiment:"VERY_POSITIVE"},uploaded:"2021-01-30T12:31:29.825Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"1d373506c0b2b82867411f18696a1ad53d4ea01d",key:"1362d",state:"Published",createdAt:"2021-01-30T12:31:29.825Z",sageScore:2,diffs:[{njs:14,offset:0,notes:138,bombs:0,obstacles:1460,nps:1.684,length:91.5,characteristic:"Standard",difficulty:"Hard",events:5,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:81.94,paritySummary:{errors:4,warns:3,resets:0},maxScore:119715,label:"Oooo",environment:"BigMirrorEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/1d373506c0b2b82867411f18696a1ad53d4ea01d.zip",coverURL:"https://eu.cdn.beatsaver.com/1d373506c0b2b82867411f18696a1ad53d4ea01d.jpg",previewURL:"https://eu.cdn.beatsaver.com/1d373506c0b2b82867411f18696a1ad53d4ea01d.mp3"}],createdAt:"2021-01-30T12:31:29.825Z",updatedAt:"2021-01-30T12:31:29.825Z",lastPublishedAt:"2021-01-30T12:31:29.825Z",bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"198f3",name:"Spider Dance - Toby Fox (Undertale modchart)",description:"There are countless Undertale maps on Beat Saber, but what if you could actually experience a real boss fight? It's now possible thanks to Noodle Extensions, and I'm proud to present to you the first Undertale modchart: Spider Dance, where you will confront Muffet.\r\n\r\nTips for a better experience:\r\n- Don't use static lights; there shouldn't be any lights\r\n- Hide the HUD in player settings\r\n- Enable \"bloom post-processing\"\r\n- Enable \"screen distortion effects\"\r\n\r\nInstallation instructions:\r\n- You will need Noodle Extensions and Chroma and their dependencies. All are now available on ModAssistant.\r\n- If you read this in a future where the update broke the mods and they haven't been approved on ModAssistant yet, install the basic mods from ModAssistant and get the latest releases of Noodle Extensions, Heck, and Chroma from Aeroluna's GitHub: https://github.com/Aeroluna\r\n\r\nVideo: https://youtu.be/fy8KmUor6fI\r\n\r\nI started this a while ago before Ghost Choir and then abandoned the project. But I finally decided to finish the work, so I hope you'll enjoy it :)\r\nThanks to Reaxt and Cyansnow, who testplayed and made detailed suggestions that helped me improve the quality of this map. I really appreciate it.\r\n\r\nMy social media links (please follow/subscribe): https://linktr.ee/nyri0",uploader:{id:4288814,name:"nyri0",hash:"5e792df416c9680006086a78",avatar:"https://cdn.beatsaver.com/avatar/233323d456510756fbbc0140c1a0698caf8b096c.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,playlistUrl:"https://api.beatsaver.com/users/id/4288814/playlist"},metadata:{bpm:115,duration:114,songName:"Spider Dance",songSubName:"",songAuthorName:"Toby Fox",levelAuthorName:"nyri0"},stats:{plays:0,downloads:0,upvotes:10995,downvotes:123,score:.9868,reviews:6,sentiment:"VERY_POSITIVE"},uploaded:"2021-06-25T17:47:40.296Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"09246637fa63ac55aa518718fd1eb4b876960480",key:"198f3",state:"Published",createdAt:"2021-06-25T17:47:40.296Z",sageScore:2,diffs:[{njs:16,offset:0,notes:434,bombs:88,obstacles:1153,nps:4.377,length:190.063,characteristic:"Standard",difficulty:"ExpertPlus",events:5,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:99.163,paritySummary:{errors:13,warns:13,resets:0},maxScore:392035,label:"9999G",environment:"BigMirrorEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/09246637fa63ac55aa518718fd1eb4b876960480.zip",coverURL:"https://eu.cdn.beatsaver.com/09246637fa63ac55aa518718fd1eb4b876960480.jpg",previewURL:"https://eu.cdn.beatsaver.com/09246637fa63ac55aa518718fd1eb4b876960480.mp3"}],curator:{id:73032,name:"Bytrius",hash:"5de442271dc9e8000696cd15",avatar:"https://cdn.beatsaver.com/avatar/62ed9906317427e9b14435ca144c7189b83a711a.png",type:"DISCORD",admin:!0,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/73032/playlist"},curatedAt:"2021-06-25T17:47:40.296Z",createdAt:"2021-06-25T17:47:40.296Z",updatedAt:"2021-06-25T17:47:40.296Z",lastPublishedAt:"2021-06-25T17:47:40.296Z",tags:["electronic","video-game-soundtrack","balanced"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"23f6b",name:"acloudyskye & N33T - Nothing Else (Modchart)",description:"9 months ago I created my first chroma map. At this time I didn't think I could make a map that you are about to play\nIn these 9 months, I learned a lot about walls, notes, environment enhancement, etc... but mostly how to properly polish a map.\nI wanted to make something big, something even bigger than SOT(as in scale swifter silly u) and here I am today publishing this map.\nThis map contains 7 different unique environments that connect together with seamless transitions.\nThis map is a big step in the journey of modhcarts just like SOT.\nI hope more people will see this modhcart as a place they can start and learn Noodle Extensions, You can also check the script of the modhcart on my Github. https://github.com/TzurS11/NoodleScript/tree/main/Examples/Scripts\n\nLastly, I wanna thank all the people that helped. even if you are not on this list I appreciate What you've done a lot!\n@GojiCrafter, @tall_chilis_boi, @Swifter, @Mawntee, Stick, kiwii.\n\nShowcase: https://youtu.be/qkSe0gOctEU\n\nbtw HAHA get fucked swifter! I got more environments than in SOT",uploader:{id:4284455,name:"TzurS11",hash:"6040a8135ab13d0006093512",avatar:"https://cdn.beatsaver.com/avatar/87d26d1223ba8840e9dca8d433165f717e7584e1.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,playlistUrl:"https://api.beatsaver.com/users/id/4284455/playlist"},metadata:{bpm:125,duration:291,songName:"Nothing Else",songSubName:"",songAuthorName:"acloudyskye & N33T",levelAuthorName:"TzurS11"},stats:{plays:0,downloads:0,upvotes:2949,downvotes:25,score:.9867,reviews:3},uploaded:"2022-04-10T19:30:00.565807Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"e45b69a9428505e93f73f1bdc43909d43fc844e3",state:"Published",createdAt:"2022-04-10T20:32:24.193634Z",sageScore:3,diffs:[{njs:16,offset:0,notes:919,bombs:0,obstacles:0,nps:3.298,length:580.5,characteristic:"Standard",difficulty:"ExpertPlus",events:18391,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:278.64,paritySummary:{errors:25,warns:13,resets:0},maxScore:838235,label:"You can hide away the fears you face\n\nRead Warnings!",environment:"BTSEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/e45b69a9428505e93f73f1bdc43909d43fc844e3.zip",coverURL:"https://eu.cdn.beatsaver.com/e45b69a9428505e93f73f1bdc43909d43fc844e3.jpg",previewURL:"https://eu.cdn.beatsaver.com/e45b69a9428505e93f73f1bdc43909d43fc844e3.mp3"}],curator:{id:4284947,name:"Phoenix",hash:"5fa08b5281e1d70006f1b322",avatar:"https://cdn.beatsaver.com/avatar/4284947.jpg",type:"SIMPLE",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4284947/playlist"},curatedAt:"2022-04-10T20:55:22.272218Z",createdAt:"2022-04-05T14:25:21.240039Z",updatedAt:"2022-08-25T11:32:19.554653Z",lastPublishedAt:"2022-04-10T20:32:58.830331Z",tags:["balanced","electronic","dance"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"32693",name:"Fall Out Boy - The Phoenix",description:"Might be one of my most accessible mapsets yet as a custom-lit full spread of difficulties paired with both a lawless expert+ and one saber difficulties! Made this one for a friend of mine who's a big FoB fan. Enjoy!\n\nFeedback via reviews down below is always appreciated!\n\nPreview: https://youtu.be/2LFQLJd0pOQ\n\nSocials:\nhttps://twitter.com/bytrius\nhttps://www.youtube.com/c/bytrius\nhttps://bsaber.com/members/bytrius/\nhttps://www.twitch.tv/bytrius",uploader:{id:73032,name:"Bytrius",hash:"5de442271dc9e8000696cd15",avatar:"https://cdn.beatsaver.com/avatar/62ed9906317427e9b14435ca144c7189b83a711a.png",type:"DISCORD",admin:!0,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/73032/playlist"},metadata:{bpm:138,duration:246,songName:"The Phoenix",songSubName:"",songAuthorName:"Fall Out Boy",levelAuthorName:"Bytrius"},stats:{plays:0,downloads:0,upvotes:5122,downvotes:52,score:.9865,reviews:6,sentiment:"VERY_POSITIVE"},uploaded:"2023-05-31T23:01:59.709120Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"bf2c367d29b133b66dc27f6f8e20467d0ec3301f",state:"Published",createdAt:"2023-05-31T22:51:42.410637Z",sageScore:5,diffs:[{njs:10,offset:-.95,notes:494,bombs:0,obstacles:44,nps:2.055,length:553,characteristic:"Standard",difficulty:"Easy",events:4607,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:240.435,paritySummary:{errors:0,warns:0,resets:0},maxScore:447235,blStars:2.56,environment:"NiceEnvironment"},{njs:12,offset:.3,notes:545,bombs:0,obstacles:38,nps:2.267,length:553,characteristic:"Standard",difficulty:"Normal",events:4607,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:240.435,paritySummary:{errors:0,warns:0,resets:0},maxScore:494155,blStars:3.04,environment:"NiceEnvironment"},{njs:14,offset:-.2,notes:767,bombs:0,obstacles:6,nps:3.19,length:553,characteristic:"Standard",difficulty:"Hard",events:4607,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:240.435,paritySummary:{errors:0,warns:0,resets:0},maxScore:700075,blStars:4.07,environment:"NiceEnvironment"},{njs:15,offset:-.475,notes:851,bombs:0,obstacles:9,nps:3.539,length:553,characteristic:"Standard",difficulty:"Expert",events:4607,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:240.435,paritySummary:{errors:0,warns:0,resets:0},maxScore:779035,blStars:4.86,environment:"NiceEnvironment"},{njs:17,offset:-.75,notes:1384,bombs:0,obstacles:4,nps:5.756,length:553,characteristic:"Standard",difficulty:"ExpertPlus",events:4607,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:240.435,paritySummary:{errors:0,warns:0,resets:0},maxScore:1272275,blStars:6.51,environment:"NiceEnvironment"},{njs:16,offset:-.65,notes:816,bombs:0,obstacles:29,nps:3.394,length:553,characteristic:"OneSaber",difficulty:"ExpertPlus",events:4607,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:240.435,paritySummary:{errors:0,warns:0,resets:0},maxScore:743475,blStars:8.35,environment:"NiceEnvironment"},{njs:17,offset:-.75,notes:1388,bombs:0,obstacles:4,nps:5.773,length:553,characteristic:"Lawless",difficulty:"ExpertPlus",events:4607,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:240.435,paritySummary:{errors:0,warns:0,resets:0},maxScore:1275955,label:"Double Downs",environment:"NiceEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/bf2c367d29b133b66dc27f6f8e20467d0ec3301f.zip",coverURL:"https://eu.cdn.beatsaver.com/bf2c367d29b133b66dc27f6f8e20467d0ec3301f.jpg",previewURL:"https://eu.cdn.beatsaver.com/bf2c367d29b133b66dc27f6f8e20467d0ec3301f.mp3"}],curator:{id:4284947,name:"Phoenix",hash:"5fa08b5281e1d70006f1b322",avatar:"https://cdn.beatsaver.com/avatar/4284947.jpg",type:"SIMPLE",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4284947/playlist"},curatedAt:"2023-06-01T02:16:21.699148Z",createdAt:"2023-05-16T06:12:18.475582Z",updatedAt:"2024-08-27T09:34:28.073772Z",lastPublishedAt:"2023-05-31T23:01:59.709120Z",tags:["dance-style","pop","punk"],bookmarked:!1,declaredAi:"None",blRanked:!0,blQualified:!1},{id:"1dcf4",name:"DYES IWASAKI - Bad Hatter ft. Lily Mizusaki",description:'Part of my second custom map pack!\n\nGameplay preview:\nhttps://www.youtube.com/watch?v=ZE5enFMVsv8\n\nGet the pack here:\nhttps://bsaber.com/tokyo-neo-swing/\n\nThis time around I took the extra time and made full spreads and chroma lightshows for each of the 6 songs of the album "Tokyo Neo Swing" by DYES IWASAKI & Lily Mizusaki.\n\nHuge thanks to the lovely playtesters MaybeeMae, Cocci, Monstor, Vaser888, and Kansas!\n\nAlso here is my playthrough of the entire pack on Expert Plus:\nhttps://www.youtube.com/watch?v=lgXR4sBl_kk\n\n\nMore Maps: https://beatsaver.com/profile/4286374\nDiscord Tag: Nixie.Korten#6944\nJoin My Server: https://discord.gg/RjxPpZtH7w\nTwitter: https://twitter.com/Nixie_Korten\nInstagram: https://www.instagram.com/nixie.korten/',uploader:{id:4286374,name:"Nixie.Korten",hash:"6096752e12772e0006e2f7e6",avatar:"https://cdn.beatsaver.com/avatar/bb97db2b49d21f5cbc1a5ba50742fa0e5c86ed3c.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4286374/playlist"},metadata:{bpm:122,duration:176,songName:"Bad Hatter",songSubName:"(ft. Lily Mizusaki)",songAuthorName:"DYES IWASAKI",levelAuthorName:"Nixie.Korten"},stats:{plays:0,downloads:0,upvotes:4470,downvotes:44,score:.9865,reviews:3},uploaded:"2021-11-11T13:06:30.332180Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"ebcf0c8780551bfe0feb96fbc255accad548798b",state:"Published",createdAt:"2021-11-14T11:39:03.473167Z",sageScore:6,diffs:[{njs:12,offset:1,notes:212,bombs:0,obstacles:0,nps:1.249,length:345.167,characteristic:"Standard",difficulty:"Easy",events:4454,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:169.754,paritySummary:{errors:46,warns:12,resets:0},maxScore:187795,environment:"FitBeatEnvironment"},{njs:12,offset:.5,notes:320,bombs:0,obstacles:0,nps:1.885,length:345.167,characteristic:"Standard",difficulty:"Normal",events:4454,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:169.754,paritySummary:{errors:29,warns:14,resets:0},maxScore:287155,environment:"FitBeatEnvironment"},{njs:14,offset:0,notes:491,bombs:0,obstacles:2,nps:2.89,length:345.5,characteristic:"Standard",difficulty:"Hard",events:4454,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:169.918,paritySummary:{errors:4,warns:0,resets:0},maxScore:444475,environment:"FitBeatEnvironment"},{njs:16,offset:-.5,notes:697,bombs:0,obstacles:0,nps:4.102,length:345.5,characteristic:"Standard",difficulty:"Expert",events:4454,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:169.918,paritySummary:{errors:0,warns:9,resets:0},maxScore:633995,environment:"FitBeatEnvironment"},{njs:19,offset:.25,notes:924,bombs:0,obstacles:0,nps:5.438,length:345.5,characteristic:"Standard",difficulty:"ExpertPlus",events:4454,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:169.918,paritySummary:{errors:0,warns:0,resets:0},maxScore:842835,environment:"FitBeatEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/ebcf0c8780551bfe0feb96fbc255accad548798b.zip",coverURL:"https://eu.cdn.beatsaver.com/ebcf0c8780551bfe0feb96fbc255accad548798b.jpg",previewURL:"https://eu.cdn.beatsaver.com/ebcf0c8780551bfe0feb96fbc255accad548798b.mp3"}],curator:{id:4299228,name:"tan",avatar:"https://cdn.beatsaver.com/avatar/19d0c285757c0eea70e922961581953cfd96769b.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,playlistUrl:"https://api.beatsaver.com/users/id/4299228/playlist"},curatedAt:"2021-11-11T13:06:30.332180Z",createdAt:"2021-11-10T18:01:16.390803Z",updatedAt:"2024-11-02T11:19:03.182227Z",lastPublishedAt:"2021-11-14T11:39:08.754762Z",tags:["swing","dance-style","balanced","electronic"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"b7aa",name:"Powerwolf - Venom of Venus",description:"Back to my more regular style, Powerwolf is a power-metal band that perform around the themes of werewolves and religion, a strange but interesting mixture.\r\n\r\nEx+ has a no-colours mode for those who wish to play without the custom block colours, but unfortunately I can't fit such an option for all difficulties.\r\n\r\nNormal 1.85 NPS\r\nHard 3.15 NPS\r\nExpert 4.43 NPS\r\nExpert+ 5.11 NPS\r\n\r\nThere is no easy difficulty, as that I needed the slot for the no-colour mode.",uploader:{id:4285369,name:"Cyrix",hash:"5eb6eb9a7abb000006c85add",avatar:"https://cdn.beatsaver.com/avatar/4213c7b05b9778149ae4536dd10842c6ed307ec5.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4285369/playlist"},metadata:{bpm:164,duration:211,songName:"Venom of Venus",songSubName:"",songAuthorName:"Powerwolf",levelAuthorName:"Cyrix"},stats:{plays:0,downloads:0,upvotes:8e3,downvotes:91,score:.9862,reviews:14,sentiment:"VERY_POSITIVE"},uploaded:"2020-06-29T18:24:10.081Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"f88b43c770dcd85a4ba18368853fbf062d41a09c",key:"b7aa",state:"Published",createdAt:"2020-06-29T18:24:10.081Z",sageScore:7,diffs:[{njs:12,offset:.5,notes:392,bombs:0,obstacles:63,nps:1.948,length:549.938,characteristic:"Standard",difficulty:"Easy",events:4188,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:201.197,paritySummary:{errors:44,warns:15,resets:0},maxScore:353395,label:"Normal",environment:"PanicEnvironment"},{njs:13,offset:1,notes:666,bombs:8,obstacles:36,nps:3.31,length:549.938,characteristic:"Standard",difficulty:"Normal",events:4188,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:201.197,paritySummary:{errors:1,warns:0,resets:1},maxScore:605475,label:"Hard",environment:"PanicEnvironment"},{njs:17,offset:0,notes:934,bombs:9,obstacles:7,nps:4.642,length:549.938,characteristic:"Standard",difficulty:"Hard",events:4188,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:201.197,paritySummary:{errors:0,warns:0,resets:2},maxScore:852035,label:"Ex",environment:"PanicEnvironment"},{njs:20,offset:-.25,notes:1079,bombs:4,obstacles:7,nps:5.353,length:551,characteristic:"Standard",difficulty:"Expert",events:4192,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:201.585,paritySummary:{errors:1,warns:0,resets:2},maxScore:985435,label:"Ex+ No Colour",environment:"PanicEnvironment"},{njs:20,offset:-.25,notes:1079,bombs:4,obstacles:7,nps:5.353,length:551,characteristic:"Standard",difficulty:"ExpertPlus",events:4192,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:201.585,paritySummary:{errors:1,warns:0,resets:2},maxScore:985435,label:"Ex+",environment:"PanicEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/f88b43c770dcd85a4ba18368853fbf062d41a09c.zip",coverURL:"https://eu.cdn.beatsaver.com/f88b43c770dcd85a4ba18368853fbf062d41a09c.jpg",previewURL:"https://eu.cdn.beatsaver.com/f88b43c770dcd85a4ba18368853fbf062d41a09c.mp3"}],curator:{id:4316945,name:"BeastSaber",avatar:"https://cdn.beatsaver.com/avatar/4316945.jpg",type:"SIMPLE",admin:!1,curator:!0,seniorCurator:!1,curatorTab:!0,playlistUrl:"https://api.beatsaver.com/users/id/4316945/playlist"},curatedAt:"2020-06-29T18:24:10.081Z",createdAt:"2020-06-29T18:24:10.081Z",updatedAt:"2020-06-29T18:24:10.081Z",lastPublishedAt:"2020-06-29T18:24:10.081Z",tags:["metal","balanced"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"210e3",name:"[Modchart] Sarah Cothran - As The World Caves In",description:"This started out as just a simple environment animation test, and then quickly snowballed out into one of my favourite maps I've made so far!\n\nAlso big ups to Fatalution for doing the lighting on this!\nThis is our first collab together, and the first time I've collaborated on a map with someone who shared the same ideas/thought process as myself. \nThis definitely won't be our last collab :)\n\nCheck out their profile and lightshow preview here:\nhttps://beatsaver.com/profile/84945\nhttps://youtu.be/1Fh5jL_UJBc\n\n\nWARNING:\nThis map may cause mild motion sickness! \nIf you feel sick at any point, remember that you can pause and it will stop everything!\n\n(If you have frequent issues with motion sickness in VR, I recommend having a fan on, or keeping smaller carpet with a different texture in your playspace)",uploader:{id:4285959,name:"Mawntee",hash:"5cff0b7698cc5a672c854ca6",avatar:"https://cdn.beatsaver.com/avatar/e373d502d75ed37d9cc60d2aa58b08f8ab6ebc90.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4285959/playlist"},metadata:{bpm:124,duration:164,songName:"As The World Caves In",songSubName:"",songAuthorName:"Sarah Cothran",levelAuthorName:"Mawntee & Fatalution"},stats:{plays:0,downloads:0,upvotes:8562,downvotes:100,score:.986,reviews:22,sentiment:"VERY_POSITIVE"},uploaded:"2022-02-02T20:18:54.976546Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"d4d847465bff16bc936e8281b5e3c703a4ca1c93",state:"Published",createdAt:"2022-02-02T20:27:55.445283Z",sageScore:4,diffs:[{njs:18,offset:1.961111,notes:259,bombs:20,obstacles:0,nps:1.63,length:328.466,characteristic:"Standard",difficulty:"ExpertPlus",events:31028,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:158.935,paritySummary:{errors:403,warns:36,resets:11},maxScore:231035,label:"Our Final Night Alive",environment:"TimbalandEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/d4d847465bff16bc936e8281b5e3c703a4ca1c93.zip",coverURL:"https://eu.cdn.beatsaver.com/d4d847465bff16bc936e8281b5e3c703a4ca1c93.jpg",previewURL:"https://eu.cdn.beatsaver.com/d4d847465bff16bc936e8281b5e3c703a4ca1c93.mp3"}],curator:{id:4234800,name:"AllieeCute",avatar:"https://cdn.beatsaver.com/avatar/f3788635ba87f3e1144e26501fe02c26b29aaccc.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,playlistUrl:"https://api.beatsaver.com/users/id/4234800/playlist"},curatedAt:"2022-02-02T20:18:54.976546Z",createdAt:"2022-02-02T20:07:53.311141Z",updatedAt:"2023-10-16T18:16:00.863418Z",lastPublishedAt:"2023-06-06T14:03:19.315272Z",tags:["accuracy","dance-style"],bookmarked:!1,collaborators:[{id:84945,name:"fatalution",hash:"5cff0b7398cc5a672c84f30a",avatar:"https://cdn.beatsaver.com/avatar/7b7e7792dd5a8b250b5205c3a823d7d4006182f5.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/84945/playlist"}],declaredAi:"None",blRanked:!1,blQualified:!1},{id:"352d8",name:"Belle - Lend Me Your Voice [Noodle Extension, Chrom+] (Remastered!!!)",description:'If you are seasick in VR, do not play the "ALL EFFECTS" and "NO rotation (360 °)". For you, difficulty - "NO effects"\n\nIf there are performance problems disable "Mirror" in the graphics settings\n\nSong - https://music.youtube.com/watch?v=nSbhUCM5Z6s',uploader:{id:4284370,name:"hickeychan",hash:"6001ba1539ce5b000682a59f",avatar:"https://cdn.beatsaver.com/avatar/ecb540d442d3dbcd21881c32b050977d282a7438.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4284370/playlist"},metadata:{bpm:121,duration:304,songName:"Lend Me Your Voice",songSubName:"",songAuthorName:"Kaho Nakamura",levelAuthorName:"HickeyChan"},stats:{plays:0,downloads:0,upvotes:1156,downvotes:6,score:.9859,reviews:3},uploaded:"2023-08-24T10:14:50.865197Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"be0ab6e5f1b5581a9a053f4a4c144c785696d349",state:"Published",createdAt:"2023-08-24T10:12:42.966966Z",sageScore:1,diffs:[{njs:16,offset:-.7,notes:687,bombs:0,obstacles:2859,nps:2.34,length:592.155,characteristic:"Standard",difficulty:"Hard",events:25577,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:293.631,paritySummary:{errors:0,warns:0,resets:0},maxScore:624795,label:"NO effects",environment:"BTSEnvironment"},{njs:16,offset:-.7,notes:687,bombs:0,obstacles:2859,nps:2.34,length:592.155,characteristic:"Standard",difficulty:"Expert",events:25577,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:293.631,paritySummary:{errors:0,warns:0,resets:0},maxScore:624795,label:"NO rotation (360 °)",environment:"BTSEnvironment"},{njs:16,offset:-.7,notes:687,bombs:0,obstacles:2859,nps:2.34,length:592.155,characteristic:"Standard",difficulty:"ExpertPlus",events:25577,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:293.631,paritySummary:{errors:0,warns:0,resets:0},maxScore:624795,label:"ALL EFFECTS",environment:"BTSEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/be0ab6e5f1b5581a9a053f4a4c144c785696d349.zip",coverURL:"https://eu.cdn.beatsaver.com/be0ab6e5f1b5581a9a053f4a4c144c785696d349.jpg",previewURL:"https://eu.cdn.beatsaver.com/be0ab6e5f1b5581a9a053f4a4c144c785696d349.mp3"}],curator:{id:4292041,name:"symphonic",avatar:"https://cdn.beatsaver.com/avatar/2dc906ee5b78c2cb723f0eae964c2c203babf3f4.png",type:"DISCORD",admin:!0,curator:!0,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4292041/playlist"},curatedAt:"2023-08-25T06:09:54.756879Z",createdAt:"2023-08-24T10:12:42.966966Z",updatedAt:"2023-09-04T05:38:48.731043Z",lastPublishedAt:"2023-08-24T10:14:50.865197Z",tags:["accuracy","balanced","anime","classical-orchestral"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"1a0b8",name:"[Electro Swing Pack] Wolfgang Lohr & The Swinghoppers - Party Like It's 1920",description:"Nixie Presents: Electro Swing Pack!\n\n10 electro swing songs with expert and expert+ diffs to make your booty swing!\n\nGet The Pack: \nhttps://bsaber.com/electro-swing-pack/\n\nMap Gameplay:\nhttps://youtu.be/ye22W_xrXnk\n\nComplete Pack Playthrough:\nhttps://youtu.be/yj9rw4MEh7s\n\n\nHuge thanks in particular to:\nMonstor, Bearly, Noxn, Bullet, Vaser888, Tocxx, Jafdy, Storm Knight and Pixelguy!\n\n\nMore Maps: https://beatsaver.com/profile/4286374\nDiscord Tag: Nixie.Korten#6944\nJoin My Server: https://discord.gg/RjxPpZtH7w\nTwitter: https://twitter.com/Nixie_Korten\nInstagram: https://www.instagram.com/nixie.korten/",uploader:{id:4286374,name:"Nixie.Korten",hash:"6096752e12772e0006e2f7e6",avatar:"https://cdn.beatsaver.com/avatar/bb97db2b49d21f5cbc1a5ba50742fa0e5c86ed3c.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4286374/playlist"},metadata:{bpm:120,duration:187,songName:"Party Like It's 1920",songSubName:"",songAuthorName:"The Swinghoppers & Wolfgang Lohr",levelAuthorName:"Nixie.Korten"},stats:{plays:0,downloads:0,upvotes:4194,downvotes:45,score:.9855,reviews:1},uploaded:"2021-07-08T15:25:28.451Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"973bab980b568e41b0a17a772e61377b01ef85ec",key:"1a0b8",state:"Published",createdAt:"2021-07-08T15:25:28.451Z",sageScore:4,diffs:[{njs:16,offset:-.5,notes:556,bombs:0,obstacles:0,nps:3.063,length:363,characteristic:"Standard",difficulty:"Expert",events:2057,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:181.5,paritySummary:{errors:0,warns:0,resets:0},maxScore:504275,environment:"PanicEnvironment"},{njs:19,offset:.25,notes:850,bombs:0,obstacles:0,nps:4.683,length:363,characteristic:"Standard",difficulty:"ExpertPlus",events:2057,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:181.5,paritySummary:{errors:0,warns:0,resets:0},maxScore:774755,environment:"PanicEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/973bab980b568e41b0a17a772e61377b01ef85ec.zip",coverURL:"https://eu.cdn.beatsaver.com/973bab980b568e41b0a17a772e61377b01ef85ec.jpg",previewURL:"https://eu.cdn.beatsaver.com/973bab980b568e41b0a17a772e61377b01ef85ec.mp3"}],curator:{id:73032,name:"Bytrius",hash:"5de442271dc9e8000696cd15",avatar:"https://cdn.beatsaver.com/avatar/62ed9906317427e9b14435ca144c7189b83a711a.png",type:"DISCORD",admin:!0,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/73032/playlist"},curatedAt:"2021-07-08T15:25:28.451Z",createdAt:"2021-07-08T15:25:28.451Z",updatedAt:"2024-11-02T11:17:34.643709Z",lastPublishedAt:"2021-07-08T15:25:28.451Z",tags:["swing","balanced","dance-style","electronic"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"1181f",name:"Royal & the Serpent - Overwhelmed",description:"Feeling that finals crunch? Worried about the pandemic? General anxiety with the news, and just feeling overwhelmed? Don't forget to take a step back and take a breath. Maybe by dancing along to this song that perfectly captures all of those feelings! Complete with overwhelming Chroma 2.0 lights! And now the extra details:\n\nBPM: 87\nNPS: Ez - 1.71; N - 2.09; H - 2.75; Ex - 3.19; Ex+ - 4.11\nNotes: Ez - 277; N - 338; H - 444; Ex - 516; Ex+ - 664\nBombs: Ez - 0; N - 0; H - 4; Ex - 4; Ex+ - 4\nWalls: Ez - 136; N - 134; H - 144; Ex - 109; Ex+ - 109\n\nSpecial thanks to qwasyx, Smay, and Cyrix for playtesting!",uploader:{id:4285188,name:"fruhead",hash:"5cff0b7598cc5a672c852683",avatar:"https://cdn.beatsaver.com/avatar/bcfbb8e5ac8665ae28d37b76a402daf0b88a68d0.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4285188/playlist"},metadata:{bpm:87,duration:161,songName:"Overwhelmed",songSubName:"",songAuthorName:"Royal & the Serpent",levelAuthorName:"fruhead"},stats:{plays:0,downloads:0,upvotes:7135,downvotes:85,score:.9854,reviews:4},uploaded:"2020-11-29T23:09:47.309Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"b748894960a346f1568b9f4876643f1358cfa897",key:"1181f",state:"Published",createdAt:"2020-11-29T23:09:47.309Z",sageScore:6,diffs:[{njs:10,offset:0,notes:277,bombs:0,obstacles:136,nps:1.793,length:224,characteristic:"Standard",difficulty:"Easy",events:7200,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:154.483,paritySummary:{errors:43,warns:9,resets:0},maxScore:247595,environment:"PanicEnvironment"},{njs:12,offset:-.3,notes:338,bombs:0,obstacles:134,nps:2.188,length:224,characteristic:"Standard",difficulty:"Normal",events:7200,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:154.483,paritySummary:{errors:22,warns:11,resets:0},maxScore:303715,environment:"PanicEnvironment"},{njs:14,offset:.4,notes:444,bombs:4,obstacles:144,nps:2.874,length:224,characteristic:"Standard",difficulty:"Hard",events:7200,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:154.483,paritySummary:{errors:14,warns:4,resets:4},maxScore:401235,environment:"PanicEnvironment"},{njs:16,offset:.25,notes:516,bombs:4,obstacles:109,nps:3.34,length:224,characteristic:"Standard",difficulty:"Expert",events:7200,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:154.483,paritySummary:{errors:0,warns:0,resets:2},maxScore:467475,environment:"PanicEnvironment"},{njs:18,offset:.1,notes:664,bombs:4,obstacles:109,nps:4.298,length:224,characteristic:"Standard",difficulty:"ExpertPlus",events:7200,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:154.483,paritySummary:{errors:0,warns:0,resets:2},maxScore:603635,environment:"PanicEnvironment"},{njs:16,offset:0,notes:0,bombs:0,obstacles:0,nps:0,length:0,characteristic:"Lightshow",difficulty:"Expert",events:7200,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:0,paritySummary:{errors:0,warns:0,resets:0},maxScore:0,label:"Overwhelmed",environment:"PanicEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/b748894960a346f1568b9f4876643f1358cfa897.zip",coverURL:"https://eu.cdn.beatsaver.com/b748894960a346f1568b9f4876643f1358cfa897.jpg",previewURL:"https://eu.cdn.beatsaver.com/b748894960a346f1568b9f4876643f1358cfa897.mp3"}],curator:{id:76372,name:"brightknight",hash:"5f30421b8a13d900061fe595",avatar:"https://cdn.beatsaver.com/avatar/236b93ff0df8c0f0305e52b6d3d01fa3e588b7ec.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/76372/playlist"},curatedAt:"2020-11-29T23:09:47.309Z",createdAt:"2020-11-29T23:09:47.309Z",updatedAt:"2020-11-29T23:09:47.309Z",lastPublishedAt:"2020-11-29T23:09:47.309Z",tags:["balanced"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"4980",name:"(Old Version) Paradise - Coldplay",description:"\"Paradise\" is a song by the British rock band Coldplay. The song was released on 12 September 2011. I kinda like this song for relaxing on long car rides and I don't know how it will feel as a beat saber map but I'ma try mapping it anyways. So here it is :)\n\n2022 EDIT: Download the new map here: https://beatsaver.com/maps/28102",uploader:{id:58338,name:"Joetastic",hash:"5cff0b7498cc5a672c85050e",avatar:"https://cdn.beatsaver.com/avatar/91bb7b0510cea647179bc95e032f8a25608b09f1.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/58338/playlist"},metadata:{bpm:70,duration:278,songName:"Paradise",songSubName:"",songAuthorName:"Coldplay",levelAuthorName:"Joetastic"},stats:{plays:0,downloads:0,upvotes:6216,downvotes:74,score:.9852,reviews:1},uploaded:"2019-04-30T05:45:51Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"b14639af36673a43fe32bc7563619deff438d438",key:"4980",state:"Published",createdAt:"2019-04-30T05:45:51Z",sageScore:6,diffs:[{njs:13,offset:0,notes:1023,bombs:0,obstacles:35,nps:3.816,length:312.75,characteristic:"Standard",difficulty:"Expert",events:4651,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:268.071,paritySummary:{errors:28,warns:29,resets:0},maxScore:933915,environment:"TriangleEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/b14639af36673a43fe32bc7563619deff438d438.zip",coverURL:"https://eu.cdn.beatsaver.com/b14639af36673a43fe32bc7563619deff438d438.jpg",previewURL:"https://eu.cdn.beatsaver.com/b14639af36673a43fe32bc7563619deff438d438.mp3"}],curator:{id:4316945,name:"BeastSaber",avatar:"https://cdn.beatsaver.com/avatar/4316945.jpg",type:"SIMPLE",admin:!1,curator:!0,seniorCurator:!1,curatorTab:!0,playlistUrl:"https://api.beatsaver.com/users/id/4316945/playlist"},curatedAt:"2019-04-30T05:45:51Z",createdAt:"2019-04-30T05:45:51Z",updatedAt:"2022-07-22T08:36:01.092595Z",lastPublishedAt:"2019-04-30T05:45:51Z",tags:["alternative","indie"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"bdc7",name:"That's Life - Frank Sinatra",description:"Here is an honest-to-goodness human-mapped version of Frank Sinatra's 1966 hit, That's Life. This song is way too good to just have a crappy beat sage map.\n\nNormal and Hard Standard levels, and Expert Standard, 90, and 360 levels. Note that the expert levels are all essentially the same, just with varying degrees of wobbles.\n\nThanks to Maybeemae for the playtests!\n\nhttps://youtu.be/QXjj2-fgK8U",uploader:{id:78593,name:"techbutterfly",hash:"5cff0b7798cc5a672c8566f7",avatar:"https://cdn.beatsaver.com/avatar/99c0065fcfac5bfcf11adc69a58a8d3251bd748e.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/78593/playlist"},metadata:{bpm:77,duration:187,songName:"That's Life",songSubName:"",songAuthorName:"Frank Sinatra",levelAuthorName:"TechButterfly"},stats:{plays:0,downloads:0,upvotes:3713,downvotes:40,score:.9851,reviews:8,sentiment:"VERY_POSITIVE"},uploaded:"2020-07-11T22:35:42.033Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"7cca8c1afecd782cfd74f158c312201b780043d8",key:"bdc7",state:"Published",createdAt:"2020-07-11T22:35:42.033Z",sageScore:4,diffs:[{njs:10,offset:-.3,notes:321,bombs:0,obstacles:6,nps:1.768,length:233,characteristic:"Standard",difficulty:"Normal",events:1086,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:181.558,paritySummary:{errors:30,warns:41,resets:0},maxScore:288075,environment:"NiceEnvironment"},{njs:12,offset:.3,notes:418,bombs:0,obstacles:8,nps:2.302,length:233,characteristic:"Standard",difficulty:"Hard",events:1086,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:181.558,paritySummary:{errors:24,warns:38,resets:0},maxScore:377315,environment:"NiceEnvironment"},{njs:13,offset:.1,notes:492,bombs:0,obstacles:8,nps:2.71,length:233,characteristic:"Standard",difficulty:"Expert",events:1086,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:181.558,paritySummary:{errors:24,warns:26,resets:0},maxScore:445395,environment:"NiceEnvironment"},{njs:13,offset:.3,notes:489,bombs:0,obstacles:8,nps:2.693,length:233,characteristic:"90Degree",difficulty:"Expert",events:1192,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:181.558,paritySummary:{errors:25,warns:27,resets:0},maxScore:442635,label:"Expert 90",environment:"GlassDesertEnvironment"},{njs:13,offset:.3,notes:489,bombs:0,obstacles:8,nps:2.693,length:233,characteristic:"360Degree",difficulty:"Expert",events:1166,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:181.558,paritySummary:{errors:25,warns:26,resets:0},maxScore:442635,label:"Expert360",environment:"GlassDesertEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/7cca8c1afecd782cfd74f158c312201b780043d8.zip",coverURL:"https://eu.cdn.beatsaver.com/7cca8c1afecd782cfd74f158c312201b780043d8.jpg",previewURL:"https://eu.cdn.beatsaver.com/7cca8c1afecd782cfd74f158c312201b780043d8.mp3"}],curator:{id:32269,name:"maybeemae",hash:"5e1123516d774b0006a953ec",avatar:"https://cdn.beatsaver.com/avatar/d2119e1ff402b2cd380caf8b074d3f7c037f0ec2.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,playlistUrl:"https://api.beatsaver.com/users/id/32269/playlist"},curatedAt:"2020-07-11T22:35:42.033Z",createdAt:"2020-07-11T22:35:42.033Z",updatedAt:"2020-07-11T22:35:42.033Z",lastPublishedAt:"2020-07-11T22:35:42.033Z",tags:["pop","jazz","dance-style"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"3bbb0",name:"[Modchart] Leslie Wai - Paradigm",description:"MAP IS NOT WORKING ON QUEST 1.37+\nMAP IS NOT WORKING ON QUEST 1.37+\nMAP IS NOT WORKING ON QUEST 1.37+\n\nNOTE: If your sabers are in the wrong position after the intro try disabling any room offset/rotation\nNOTE 2: The map is broken on some versions including 1.34 and quest, I am gonna work on report all the issues\nNOTE 3: The map should be playable now on Quest native (just a few visual bugs)\n\nMy biggest project so far!\nenjoy it\n\nMap preview: https://youtu.be/gokZx0QjqZQ\n\nReupload: Thanks for the 429 people that played the map so far! i am reuploading to fix a few bugs:\n- Fix saber positions being wrong for some people\n- Disable left handed option\n- Disable Intro Skip\n\nReupload 2: Thanks for the another 170 plays I hope this is the final reupload:\n- Fix light id errors\n- Fix cinema suggestion not needed\n- Trying another fix for sabers wrong position\n\nReupload 3: And I hope this is the last one, thanks for the 124 new plays!\n- Fix player position bug on quest\n- Fix notes position bug on quest\n- Fix gimmik part on quest\n- Added suggested colors for notes\n- Changed NJS and JD\n- Fix sabers coming from the wrong direction in the intro",uploader:{id:4284535,name:"Elecast",hash:"6069279f5ab13d000609e874",avatar:"https://cdn.beatsaver.com/avatar/4dd111a1ec473c3559cfc73caaac650be56b65a1.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4284535/playlist"},metadata:{bpm:130,duration:441,songName:"Paradigm",songSubName:"",songAuthorName:"Leslie Wai",levelAuthorName:"Elecast"},stats:{plays:0,downloads:0,upvotes:2734,downvotes:27,score:.9851,reviews:35,sentiment:"VERY_POSITIVE"},uploaded:"2024-04-13T20:59:13.608905Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"a504aafe70cf723f46503568f65813ef616d030f",state:"Published",createdAt:"2024-04-24T23:51:45.788382Z",sageScore:3,diffs:[{njs:17,offset:-.75,notes:1051,bombs:360,obstacles:249,nps:3.038,length:749.5,characteristic:"Standard",difficulty:"ExpertPlus",events:12016,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:345.923,paritySummary:{errors:0,warns:0,resets:0},maxScore:959675,label:"You can't escape",environment:"BillieEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/a504aafe70cf723f46503568f65813ef616d030f.zip",coverURL:"https://eu.cdn.beatsaver.com/a504aafe70cf723f46503568f65813ef616d030f.jpg",previewURL:"https://eu.cdn.beatsaver.com/a504aafe70cf723f46503568f65813ef616d030f.mp3"}],curator:{id:4284445,name:"Emilia",hash:"5cff0b7898cc5a672c856ed3",avatar:"https://cdn.beatsaver.com/avatar/4284445.jpg",type:"SIMPLE",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4284445/playlist"},curatedAt:"2024-04-13T23:47:05.160104Z",createdAt:"2024-04-12T23:23:24.101391Z",updatedAt:"2024-08-18T18:18:25.185313Z",lastPublishedAt:"2024-04-24T23:51:50.910171Z",tags:["balanced","electronic"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"1a0ba",name:"[Electro Swing Pack] Wolfgang Lohr & Maskarade - Hit The Road Jack",description:"Nixie Presents: Electro Swing Pack!\n\n10 electro swing songs with expert and expert+ diffs to make your booty swing!\n\nGet The Pack: \nhttps://bsaber.com/electro-swing-pack/\n\nMap Gameplay:\nhttps://youtu.be/0ObNR9n_dDs\n\nComplete Pack Playthrough:\nhttps://youtu.be/yj9rw4MEh7s\n\n\nHuge thanks in particular to:\nMonstor, Bearly, Noxn, Bullet, Vaser888, Tocxx, Jafdy, Storm Knight and Pixelguy!\n\n\nMore Maps: https://beatsaver.com/profile/4286374\nDiscord Tag: Nixie.Korten#6944\nJoin My Server: https://discord.gg/RjxPpZtH7w\nTwitter: https://twitter.com/Nixie_Korten\nInstagram: https://www.instagram.com/nixie.korten/",uploader:{id:4286374,name:"Nixie.Korten",hash:"6096752e12772e0006e2f7e6",avatar:"https://cdn.beatsaver.com/avatar/bb97db2b49d21f5cbc1a5ba50742fa0e5c86ed3c.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4286374/playlist"},metadata:{bpm:124,duration:159,songName:"Hit The Road Jack",songSubName:"",songAuthorName:"Wolfgang Lohr & Maskarade",levelAuthorName:"Nixie.Korten"},stats:{plays:0,downloads:0,upvotes:3787,downvotes:42,score:.9849},uploaded:"2021-07-08T15:26:18.072Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"75f10751d58f6f1ab0bc36e94039a144256adccb",key:"1a0ba",state:"Published",createdAt:"2021-07-08T15:26:18.072Z",sageScore:4,diffs:[{njs:16,offset:-.25,notes:475,bombs:0,obstacles:0,nps:3.089,length:317.75,characteristic:"Standard",difficulty:"Expert",events:1846,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:153.75,paritySummary:{errors:0,warns:0,resets:0},maxScore:429755,environment:"PanicEnvironment"},{njs:19,offset:.25,notes:750,bombs:0,obstacles:0,nps:4.878,length:317.75,characteristic:"Standard",difficulty:"ExpertPlus",events:1846,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:153.75,paritySummary:{errors:0,warns:0,resets:0},maxScore:682755,environment:"PanicEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/75f10751d58f6f1ab0bc36e94039a144256adccb.zip",coverURL:"https://eu.cdn.beatsaver.com/75f10751d58f6f1ab0bc36e94039a144256adccb.jpg",previewURL:"https://eu.cdn.beatsaver.com/75f10751d58f6f1ab0bc36e94039a144256adccb.mp3"}],curator:{id:73032,name:"Bytrius",hash:"5de442271dc9e8000696cd15",avatar:"https://cdn.beatsaver.com/avatar/62ed9906317427e9b14435ca144c7189b83a711a.png",type:"DISCORD",admin:!0,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/73032/playlist"},curatedAt:"2021-07-08T15:26:18.072Z",createdAt:"2021-07-08T15:26:18.072Z",updatedAt:"2024-11-02T11:17:50.904586Z",lastPublishedAt:"2021-07-08T15:26:18.072Z",tags:["swing","balanced","dance-style","electronic"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"1a0b7",name:"[Electro Swing Pack] Jamie Berry - Lost In The Rhythm (ft. Octavia Rose)",description:"Nixie Presents: Electro Swing Pack!\n\n10 electro swing songs with expert and expert+ diffs to make your booty swing!\n\nGet The Pack: \nhttps://bsaber.com/electro-swing-pack/\n\nMap Gameplay:\nhttps://youtu.be/4O8l7rq4eHI\n\nComplete Pack Playthrough:\nhttps://youtu.be/yj9rw4MEh7s\n\n\nHuge thanks in particular to:\nMonstor, Bearly, Noxn, Bullet, Vaser888, Tocxx, Jafdy, Storm Knight and Pixelguy!\n\n\nMore Maps: https://beatsaver.com/profile/4286374\nDiscord Tag: Nixie.Korten#6944\nJoin My Server: https://discord.gg/RjxPpZtH7w\nTwitter: https://twitter.com/Nixie_Korten\nInstagram: https://www.instagram.com/nixie.korten/",uploader:{id:4286374,name:"Nixie.Korten",hash:"6096752e12772e0006e2f7e6",avatar:"https://cdn.beatsaver.com/avatar/bb97db2b49d21f5cbc1a5ba50742fa0e5c86ed3c.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4286374/playlist"},metadata:{bpm:121,duration:187,songName:"Lost In The Rhythm",songSubName:"(ft. Octavia Rose)",songAuthorName:"Jamie Berry",levelAuthorName:"Nixie.Korten"},stats:{plays:0,downloads:0,upvotes:3307,downvotes:36,score:.9847,reviews:1},uploaded:"2021-07-08T15:24:57.679Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"6d006d47880a45a134844f3787f3c184881d4673",key:"1a0b7",state:"Published",createdAt:"2021-07-08T15:24:57.679Z",sageScore:5,diffs:[{njs:16,offset:-.25,notes:591,bombs:0,obstacles:8,nps:3.274,length:364,characteristic:"Standard",difficulty:"Expert",events:3271,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:180.496,paritySummary:{errors:0,warns:0,resets:0},maxScore:536475,environment:"PanicEnvironment"},{njs:19,offset:.25,notes:821,bombs:0,obstacles:8,nps:4.549,length:364,characteristic:"Standard",difficulty:"ExpertPlus",events:3271,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:180.496,paritySummary:{errors:0,warns:0,resets:0},maxScore:748075,environment:"PanicEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/6d006d47880a45a134844f3787f3c184881d4673.zip",coverURL:"https://eu.cdn.beatsaver.com/6d006d47880a45a134844f3787f3c184881d4673.jpg",previewURL:"https://eu.cdn.beatsaver.com/6d006d47880a45a134844f3787f3c184881d4673.mp3"}],curator:{id:73032,name:"Bytrius",hash:"5de442271dc9e8000696cd15",avatar:"https://cdn.beatsaver.com/avatar/62ed9906317427e9b14435ca144c7189b83a711a.png",type:"DISCORD",admin:!0,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/73032/playlist"},curatedAt:"2021-07-08T15:24:57.679Z",createdAt:"2021-07-08T15:24:57.679Z",updatedAt:"2024-11-02T11:17:26.961219Z",lastPublishedAt:"2021-07-08T15:24:57.679Z",tags:["swing","balanced","dance-style","electronic"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"77e9",name:"Jingo Jungle [Saga of Tanya the Evil Opening] - AmaLee",description:'AmaLee\'s English cover of "Jingo Jungle", the opening from Saga of Tanya the Evil (Youjo Senki). Original song by MYTH & ROID.',uploader:{id:58338,name:"Joetastic",hash:"5cff0b7498cc5a672c85050e",avatar:"https://cdn.beatsaver.com/avatar/91bb7b0510cea647179bc95e032f8a25608b09f1.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/58338/playlist"},metadata:{bpm:130,duration:226,songName:"Jingo Jungle",songSubName:"",songAuthorName:"AmaLee",levelAuthorName:"Joetastic"},stats:{plays:0,downloads:0,upvotes:4125,downvotes:48,score:.9846,reviews:1},uploaded:"2019-12-21T02:44:34.295Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"f90a2e4f8ee7b1f33543cddccb8baea660253d4a",key:"77e9",state:"Published",createdAt:"2019-12-21T02:44:34.295Z",sageScore:5,diffs:[{njs:12,offset:0,notes:581,bombs:104,obstacles:28,nps:2.647,length:475.5,characteristic:"Standard",difficulty:"Hard",events:5987,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:219.462,paritySummary:{errors:35,warns:15,resets:10},maxScore:527275,environment:"DefaultEnvironment"},{njs:15,offset:0,notes:950,bombs:78,obstacles:14,nps:4.329,length:475.5,characteristic:"Standard",difficulty:"Expert",events:5987,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:219.462,paritySummary:{errors:42,warns:48,resets:8},maxScore:866755,environment:"DefaultEnvironment"},{njs:17,offset:0,notes:1184,bombs:105,obstacles:17,nps:5.395,length:475.5,characteristic:"Standard",difficulty:"ExpertPlus",events:5987,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:219.462,paritySummary:{errors:32,warns:43,resets:16},maxScore:1082035,environment:"DefaultEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/f90a2e4f8ee7b1f33543cddccb8baea660253d4a.zip",coverURL:"https://eu.cdn.beatsaver.com/f90a2e4f8ee7b1f33543cddccb8baea660253d4a.jpg",previewURL:"https://eu.cdn.beatsaver.com/f90a2e4f8ee7b1f33543cddccb8baea660253d4a.mp3"}],createdAt:"2019-12-21T02:44:34.295Z",updatedAt:"2019-12-21T02:44:34.295Z",lastPublishedAt:"2019-12-21T02:44:34.295Z",tags:["pop","anime"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"a438",name:"Wait - M83 (wall map)",description:"I wanted to do something special for this great song, and also see the potential of Noodle Extensions. A few tips for a better experience:\r\n- disable the mirror effect in the game settings\r\n- turn the SFX volume down in the player settings\r\n- hide the HUD in the player settings\r\n\r\nVideo: https://youtu.be/oe6ThhijPy0\r\n\r\nThe map has a lot of walls, so you might not be able to run it on the lower-end hardware. I've included a version with less walls in case it helps.",uploader:{id:4288814,name:"nyri0",hash:"5e792df416c9680006086a78",avatar:"https://cdn.beatsaver.com/avatar/233323d456510756fbbc0140c1a0698caf8b096c.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,playlistUrl:"https://api.beatsaver.com/users/id/4288814/playlist"},metadata:{bpm:148,duration:336,songName:"Wait",songSubName:"",songAuthorName:"M83",levelAuthorName:"nyri0"},stats:{plays:0,downloads:0,upvotes:4116,downvotes:48,score:.9845,reviews:9,sentiment:"VERY_POSITIVE"},uploaded:"2020-05-08T23:53:02.030Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"0d8921ef06a889cbd9db13afcc43f09a1619b173",key:"a438",state:"Published",createdAt:"2020-05-08T23:53:02.030Z",sageScore:6,diffs:[{njs:8,offset:6,notes:735,bombs:0,obstacles:6684,nps:2.225,length:815,characteristic:"Standard",difficulty:"Easy",events:5,chroma:!1,me:!1,ne:!0,cinema:!1,seconds:330.405,paritySummary:{errors:93,warns:27,resets:0},maxScore:668955,label:"Hard (less lag)",environment:"BigMirrorEnvironment"},{njs:8,offset:6,notes:735,bombs:0,obstacles:10499,nps:2.225,length:815,characteristic:"Standard",difficulty:"Hard",events:5,chroma:!1,me:!1,ne:!0,cinema:!1,seconds:330.405,paritySummary:{errors:93,warns:27,resets:0},maxScore:668955,label:"Hard (original)",environment:"BigMirrorEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/0d8921ef06a889cbd9db13afcc43f09a1619b173.zip",coverURL:"https://eu.cdn.beatsaver.com/0d8921ef06a889cbd9db13afcc43f09a1619b173.jpg",previewURL:"https://eu.cdn.beatsaver.com/0d8921ef06a889cbd9db13afcc43f09a1619b173.mp3"}],curator:{id:4316945,name:"BeastSaber",avatar:"https://cdn.beatsaver.com/avatar/4316945.jpg",type:"SIMPLE",admin:!1,curator:!0,seniorCurator:!1,curatorTab:!0,playlistUrl:"https://api.beatsaver.com/users/id/4316945/playlist"},curatedAt:"2020-05-08T23:53:02.030Z",createdAt:"2020-05-08T23:53:02.030Z",updatedAt:"2020-05-08T23:53:02.030Z",lastPublishedAt:"2020-05-08T23:53:02.030Z",tags:["rock","indie","techno"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"12ad1",name:"Minnesota - Colors (ft. Jackie Rain) | Chroma RGB",description:"Chroma 2.0 HIGHLY RECOMMENDED!\n\nHad this map sitting in my project folder for some months and finally got to finish it! \nIt features a Chroma RGB lightshow AND Rainbow notes, for the full COLOR experience :)\n\nPreview: https://www.youtube.com/watch?v=8Omzd7IdJt0",uploader:{id:4284201,name:"nitronik.exe",hash:"5cff0b7798cc5a672c855d84",avatar:"https://cdn.beatsaver.com/avatar/ab054640a94777ed7e92d91a505a85f8c5047be5.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4284201/playlist"},metadata:{bpm:140,duration:202,songName:"Colors",songSubName:"(ft. Jackie Rain)",songAuthorName:"Minnesota",levelAuthorName:"nitronik.exe"},stats:{plays:0,downloads:0,upvotes:4295,downvotes:51,score:.9844,reviews:7,sentiment:"VERY_POSITIVE"},uploaded:"2021-01-13T15:55:44.846Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"03fcb98091e50600d9d777251d765c53384c2735",key:"12ad1",state:"Published",createdAt:"2021-01-13T15:55:44.846Z",sageScore:4,diffs:[{njs:13,offset:.5,notes:395,bombs:0,obstacles:221,nps:2.057,length:448,characteristic:"Standard",difficulty:"Hard",events:16569,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:192,paritySummary:{errors:0,warns:0,resets:0},maxScore:356155,environment:"BigMirrorEnvironment"},{njs:16,offset:0,notes:601,bombs:0,obstacles:113,nps:3.13,length:448,characteristic:"Standard",difficulty:"Expert",events:16569,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:192,paritySummary:{errors:0,warns:0,resets:0},maxScore:545675,environment:"BigMirrorEnvironment"},{njs:19,offset:-.5,notes:911,bombs:0,obstacles:120,nps:4.745,length:448,characteristic:"Standard",difficulty:"ExpertPlus",events:16569,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:192,paritySummary:{errors:0,warns:0,resets:0},maxScore:830875,label:"Colors",environment:"BigMirrorEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/03fcb98091e50600d9d777251d765c53384c2735.zip",coverURL:"https://eu.cdn.beatsaver.com/03fcb98091e50600d9d777251d765c53384c2735.jpg",previewURL:"https://eu.cdn.beatsaver.com/03fcb98091e50600d9d777251d765c53384c2735.mp3"}],curator:{id:1096,name:"pyrowarfare",hash:"5e99c7df3f476a0006596cdf",avatar:"https://www.gravatar.com/avatar/28fcd25e8adfa72a17daa766767daf781bee89776333a3ed7a4cc84146e6a3e8?d=retro",type:"SIMPLE",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/1096/playlist"},curatedAt:"2021-01-13T15:55:44.846Z",createdAt:"2021-01-13T15:55:44.846Z",updatedAt:"2021-01-13T15:55:44.846Z",lastPublishedAt:"2021-01-13T15:55:44.846Z",tags:["dubstep","balanced"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"4a2b3",name:"[Vivify] Turret Orchestra (Cara Mia Addio) - Portal 2",description:"Portal •⩊•\n\nWork done:\nMadChase - Vivify and Standard Mapping\nRateGyro - OneSaber Mapping\nXentha - 3d Modeling \n\nAll Lawless: No Vivify difficulties \n\nThis took FAR too long to make too..... hope you enjoy this product of my sufferings as much as I do :)\n\nGo check out @rategyro, they did the mapping for all the Onesaber diffs and HUGE thanks to @Xentha for making a majority of the env used in this map, this would not have been possible without them. \n\nCredits: https://docs.google.com/document/d/1gR8x4iIk_n2i4ScYRPGEyD8OfZNsrDftmy6Z9cC5L_E/edit?usp=sharing",uploader:{id:4286182,name:"MadChase",avatar:"https://cdn.beatsaver.com/avatar/99feaf0fe97b6c67dde2ae7ba055fab744b0ac61.png",type:"DISCORD",admin:!1,curator:!0,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4286182/playlist"},metadata:{bpm:204,duration:120,songName:"Turret Orchestra",songSubName:"(Cara Mia Addio)",songAuthorName:"Portal 2",levelAuthorName:"MadChase, RateGyro, Xentha\r"},stats:{plays:0,downloads:0,upvotes:758,downvotes:3,score:.9844},uploaded:"2025-09-05T19:09:19.619055Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"3a2a0fead6eb8a8ab325aa54efdfb84bd4220375",state:"Published",createdAt:"2025-09-06T02:29:05.366Z",sageScore:4,diffs:[{njs:12,offset:0,notes:107,bombs:0,obstacles:0,nps:1.304,length:279,characteristic:"Standard",difficulty:"Hard",events:0,chroma:!0,me:!1,ne:!0,cinema:!1,vivify:!0,seconds:82.059,paritySummary:{errors:0,warns:0,resets:0},maxScore:91195,label:"Basic Bloqs",environment:"GagaEnvironment"},{njs:15,offset:-1.625,notes:149,bombs:0,obstacles:0,nps:1.816,length:279,characteristic:"Standard",difficulty:"Expert",events:0,chroma:!0,me:!1,ne:!0,cinema:!1,vivify:!0,seconds:82.059,paritySummary:{errors:0,warns:0,resets:0},maxScore:129835,label:"Bloqs",environment:"GagaEnvironment"},{njs:15,offset:-1.625,notes:714,bombs:0,obstacles:0,nps:8.701,length:279,characteristic:"Standard",difficulty:"ExpertPlus",events:0,chroma:!0,me:!1,ne:!0,cinema:!1,vivify:!0,seconds:82.059,paritySummary:{errors:0,warns:0,resets:0},maxScore:649635,label:"Poodles",environment:"GagaEnvironment"},{njs:15,offset:-1.625,notes:131,bombs:0,obstacles:0,nps:1.591,length:279.937,characteristic:"OneSaber",difficulty:"Expert",events:0,chroma:!0,me:!1,ne:!0,cinema:!1,vivify:!0,seconds:82.334,paritySummary:{errors:0,warns:0,resets:0},maxScore:113275,label:"Bloqs",environment:"GagaEnvironment"},{njs:15,offset:-1.625,notes:612,bombs:0,obstacles:0,nps:7.433,length:279.937,characteristic:"OneSaber",difficulty:"ExpertPlus",events:0,chroma:!0,me:!1,ne:!0,cinema:!1,vivify:!0,seconds:82.334,paritySummary:{errors:0,warns:0,resets:0},maxScore:555795,label:"Poodles",environment:"GagaEnvironment"},{njs:15,offset:-1.625,notes:0,bombs:0,obstacles:0,nps:0,length:0,characteristic:"Lightshow",difficulty:"ExpertPlus",events:0,chroma:!0,me:!1,ne:!0,cinema:!1,vivify:!0,seconds:0,paritySummary:{errors:0,warns:0,resets:0},maxScore:0,label:"Just Viv",environment:"GagaEnvironment"},{njs:12,offset:0,notes:111,bombs:0,obstacles:473,nps:1.343,length:281,characteristic:"Lawless",difficulty:"Easy",events:7,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:82.647,paritySummary:{errors:0,warns:0,resets:0},maxScore:94875,label:"Basic Bloqs",environment:"GagaEnvironment"},{njs:15,offset:-1.625,notes:130,bombs:0,obstacles:473,nps:1.584,length:279,characteristic:"Lawless",difficulty:"Normal",events:7,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:82.059,paritySummary:{errors:0,warns:0,resets:0},maxScore:112355,label:"One Saber Bloqs",environment:"GagaEnvironment"},{njs:15,offset:-1.625,notes:153,bombs:0,obstacles:473,nps:1.851,length:281,characteristic:"Lawless",difficulty:"Hard",events:7,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:82.647,paritySummary:{errors:0,warns:0,resets:0},maxScore:133515,label:"Bloqs",environment:"GagaEnvironment"},{njs:15,offset:-1.625,notes:611,bombs:0,obstacles:473,nps:7.446,length:279,characteristic:"Lawless",difficulty:"Expert",events:7,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:82.059,paritySummary:{errors:0,warns:0,resets:0},maxScore:554875,label:"One Saber Poodles",environment:"GagaEnvironment"},{njs:15,offset:-1.625,notes:734,bombs:0,obstacles:473,nps:8.859,length:281.688,characteristic:"Lawless",difficulty:"ExpertPlus",events:7,chroma:!1,me:!1,ne:!0,cinema:!1,seconds:82.849,paritySummary:{errors:0,warns:0,resets:0},maxScore:668035,label:"Poodles",environment:"GagaEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/3a2a0fead6eb8a8ab325aa54efdfb84bd4220375.zip",coverURL:"https://eu.cdn.beatsaver.com/3a2a0fead6eb8a8ab325aa54efdfb84bd4220375.jpg",previewURL:"https://eu.cdn.beatsaver.com/3a2a0fead6eb8a8ab325aa54efdfb84bd4220375.mp3"}],createdAt:"2025-09-05T18:27:26.937639Z",updatedAt:"2025-09-30T15:48:59.259473Z",lastPublishedAt:"2025-09-06T02:29:10.640787Z",tags:["video-game-soundtrack","balanced","poodle"],bookmarked:!1,collaborators:[{id:103109,name:"Xentha",avatar:"https://cdn.beatsaver.com/avatar/da02df6ec7f6d28e226510b3f8ecb786d24634ca.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,playlistUrl:"https://api.beatsaver.com/users/id/103109/playlist"},{id:4280701,name:"rategyro",hash:"605e50f0cd73ba00060a45e3",avatar:"https://cdn.beatsaver.com/avatar/06d29645455d6652940b240658617d968fc53d91.png",type:"DISCORD",admin:!0,curator:!0,seniorCurator:!0,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4280701/playlist"}],declaredAi:"None",blRanked:!1,blQualified:!1},{id:"14d64",name:"Try - MitiS Feat. RORY",description:"Twenty-Sixth Upload\n\nThis map means the whole world to me, so I hope everyone enjoys this map. My father passed away on Jan. 23, 2021, in the middle of making this map. I am dedicating this map for him because of how much this songs means to me now. \nPouring my heart and soul into this map took a lot out of me, making it as perfect to my little abilities I have for mapping.\n\nBig shout outs to Lonely and Jamman for lighting this beautiful song and for agreeing to light it, it means the world to me.\nBig shout outs to thelightdesigner for making such amazing and beautiful walls. Thank you for taking the time to make this, it means the world to me.\nBig shout outs to Mawntee for giving me advice on how to make this map feel and shout outs to thelitlewiseowl for modding it, showing me what I can improve in this map. \nBiggest shout outs to everyone that play tested it multiple times. I am sorry for bugging them for multiple play test. \n\nAnd Biggest shoutout to my favorite chillstep/melodic dubstep artist, MitiS and Rory for making this beautiful song. \nYou have no idea how much this song means to me, I thank you so much. Keep up the good work MitiS.\n\n**NOODLES AND CHROMA REQUIRED**\n\nI hope this map can show you the feeling in this song, as well as what it portrays. I tried my best, I hope it turns out great and everyone enjoys it. \nThank you everyone for taking the time to download and play this map. I appreciate it everyone.\n\nFeedback is always welcome!",uploader:{id:4285346,name:"remie",hash:"5f6efd989824150006d740ac",avatar:"https://cdn.beatsaver.com/avatar/736cde47222d5d00f4affea115772681d0e070eb.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,playlistUrl:"https://api.beatsaver.com/users/id/4285346/playlist"},metadata:{bpm:132,duration:273,songName:"Try",songSubName:"",songAuthorName:"MitiS Feat. RORY",levelAuthorName:"Remie & Lone"},stats:{plays:0,downloads:0,upvotes:7683,downvotes:102,score:.9843,reviews:36,sentiment:"VERY_POSITIVE"},uploaded:"2021-03-01T13:29:26.471Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"6db3d9da217b41607d250aa7a28c5dc26a082188",key:"14d64",state:"Published",createdAt:"2021-03-01T13:29:26.471Z",sageScore:3,diffs:[{njs:17,offset:-.7,notes:1447,bombs:21,obstacles:77,nps:6.217,length:512.083,characteristic:"Standard",difficulty:"ExpertPlus",events:36825,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:232.765,paritySummary:{errors:0,warns:0,resets:2},maxScore:1323995,label:"EXPERT+",environment:"OriginsEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/6db3d9da217b41607d250aa7a28c5dc26a082188.zip",coverURL:"https://eu.cdn.beatsaver.com/6db3d9da217b41607d250aa7a28c5dc26a082188.jpg",previewURL:"https://eu.cdn.beatsaver.com/6db3d9da217b41607d250aa7a28c5dc26a082188.mp3"}],curator:{id:2381,name:"bearly",hash:"5ea9efbf16c968000636dba4",avatar:"https://cdn.beatsaver.com/avatar/2381.jpg",type:"SIMPLE",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,playlistUrl:"https://api.beatsaver.com/users/id/2381/playlist"},curatedAt:"2021-03-01T13:29:26.471Z",createdAt:"2021-03-01T13:29:26.471Z",updatedAt:"2021-03-01T13:29:26.471Z",lastPublishedAt:"2021-03-01T13:29:26.471Z",tags:["balanced"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"27a13",name:"Jimmy Eat World - The Middle [Arcs][V3 Lights]",description:" - everything'll be alright, alright? \n\nYes, @Bytrius already has a great map of this song in the 2000's Rock Pack (check it out here https://beatsaver.com/maps/157fa) but I thought I'd try it with my own arc map style and provide some lower difficulties as well. \n\nGameplay video by @onespookyboi: https://youtu.be/SjiqMsMkFuU\nLIghtshow: https://streamable.com/zhomzm\n\nThank you testers!\n@maybeemae\n@swukpuff\n@onespookyboi\n@namaki_mono\nFlaemmchenFlame - https://www.twitch.tv/flaemmchenflame\n",uploader:{id:4321171,name:"tetsubeats",avatar:"https://cdn.beatsaver.com/avatar/532b0f3d23e1e795c5e1404c4a807c0dfbe1adf2.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4321171/playlist"},metadata:{bpm:162.2,duration:169,songName:"The Middle",songSubName:"",songAuthorName:"Jimmy Eat World",levelAuthorName:"TetsuBeats"},stats:{plays:0,downloads:0,upvotes:3397,downvotes:39,score:.9842,reviews:1},uploaded:"2022-07-10T05:30:32.964512Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"4b980371b6005cc176aed1b402bd104af56c31a3",state:"Published",createdAt:"2022-07-10T04:29:32.041843Z",sageScore:5,diffs:[{njs:10,offset:-1.1,notes:320,bombs:0,obstacles:0,nps:1.951,length:443.5,characteristic:"Standard",difficulty:"Easy",events:460,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:164.057,paritySummary:{errors:0,warns:0,resets:0},maxScore:287155,environment:"PyroEnvironment"},{njs:12,offset:-1.5,notes:528,bombs:0,obstacles:0,nps:3.218,length:443.5,characteristic:"Standard",difficulty:"Normal",events:460,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:164.057,paritySummary:{errors:0,warns:0,resets:0},maxScore:478515,environment:"PyroEnvironment"},{njs:14,offset:.1,notes:629,bombs:0,obstacles:0,nps:3.834,length:443.5,characteristic:"Standard",difficulty:"Hard",events:460,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:164.057,paritySummary:{errors:0,warns:0,resets:0},maxScore:571435,environment:"PyroEnvironment"},{njs:16.5,offset:-.1,notes:758,bombs:0,obstacles:0,nps:4.62,length:443.5,characteristic:"Standard",difficulty:"Expert",events:460,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:164.057,paritySummary:{errors:0,warns:0,resets:0},maxScore:690115,environment:"PyroEnvironment"},{njs:17.5,offset:-.3,notes:826,bombs:0,obstacles:0,nps:5.035,length:443.5,characteristic:"Standard",difficulty:"ExpertPlus",events:460,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:164.057,paritySummary:{errors:0,warns:0,resets:0},maxScore:752675,environment:"PyroEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/4b980371b6005cc176aed1b402bd104af56c31a3.zip",coverURL:"https://eu.cdn.beatsaver.com/4b980371b6005cc176aed1b402bd104af56c31a3.jpg",previewURL:"https://eu.cdn.beatsaver.com/4b980371b6005cc176aed1b402bd104af56c31a3.mp3"}],curator:{id:32269,name:"maybeemae",hash:"5e1123516d774b0006a953ec",avatar:"https://cdn.beatsaver.com/avatar/d2119e1ff402b2cd380caf8b074d3f7c037f0ec2.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,playlistUrl:"https://api.beatsaver.com/users/id/32269/playlist"},curatedAt:"2022-07-10T05:52:53.577094Z",createdAt:"2022-07-10T04:29:32.041843Z",updatedAt:"2022-07-10T14:14:52.319313Z",lastPublishedAt:"2022-07-10T05:30:32.964512Z",tags:["dance-style","balanced","rock","pop"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"271dc",name:"[Electro Swing Pack Vol. 2] Swingrowers - Butterfly (Wolfgang Lohr Remix)",description:"Electro Swing Pack Volume 2: Electric Boogaloo!\n\nFor the anniversary of my first pack, I am making a sequel.\n10 Electro Swing songs, 3 difficulties each + custom vanilla lights!\n\nGet the pack here:\nhttps://bsaber.com/electro-swing-pack-2/\nhttps://beatsaver.com/playlists/6572\n\nPreview this map:\nhttps://youtu.be/91zWh1dLLV4\n\nPack Preview Playlist:\nhttps://youtube.com/playlist?list=PLrVm0whzsGKL5NYTUIEzDyITjl6WuLSJ4\n\n\nThank you to all the Playtesters!\nAlice, MaybeeMae, Pixelguy, Raaknys, Namaki Mono, DeeDee, and WolfieBeat ❤️\n\n\nMore Maps: https://beatsaver.com/profile/4286374\nDiscord: Nixie.Korten#6944\nJoin My Server: https://discord.gg/RjxPpZtH7w\nTwitter: https://twitter.com/Nixie_Korten\nInstagram: https://www.instagram.com/nixie.korten/",uploader:{id:4286374,name:"Nixie.Korten",hash:"6096752e12772e0006e2f7e6",avatar:"https://cdn.beatsaver.com/avatar/bb97db2b49d21f5cbc1a5ba50742fa0e5c86ed3c.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4286374/playlist"},metadata:{bpm:126,duration:189,songName:"Butterfly",songSubName:"(Wolfgang Lohr Remix)",songAuthorName:"Swingrowers",levelAuthorName:"Nixie.Korten"},stats:{plays:0,downloads:0,upvotes:1900,downvotes:18,score:.9842},uploaded:"2022-07-08T13:00:00.564Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"8a1f9c4ddd15a7c1ab69769542c9409ce630aaa7",state:"Published",createdAt:"2022-06-25T18:10:24.485756Z",sageScore:5,diffs:[{njs:14,offset:0,notes:522,bombs:0,obstacles:9,nps:2.818,length:389,characteristic:"Standard",difficulty:"Hard",events:2570,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:185.238,paritySummary:{errors:0,warns:0,resets:0},maxScore:472995,environment:"PanicEnvironment"},{njs:16,offset:-.5,notes:752,bombs:0,obstacles:9,nps:4.06,length:389,characteristic:"Standard",difficulty:"Expert",events:2570,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:185.238,paritySummary:{errors:0,warns:0,resets:0},maxScore:684595,environment:"PanicEnvironment"},{njs:19,offset:.25,notes:903,bombs:0,obstacles:9,nps:4.875,length:389,characteristic:"Standard",difficulty:"ExpertPlus",events:2570,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:185.238,paritySummary:{errors:0,warns:0,resets:0},maxScore:823515,environment:"PanicEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/8a1f9c4ddd15a7c1ab69769542c9409ce630aaa7.zip",coverURL:"https://eu.cdn.beatsaver.com/8a1f9c4ddd15a7c1ab69769542c9409ce630aaa7.jpg",previewURL:"https://eu.cdn.beatsaver.com/8a1f9c4ddd15a7c1ab69769542c9409ce630aaa7.mp3"}],curator:{id:4284746,name:"Dee-Dee",avatar:"https://cdn.beatsaver.com/avatar/3853d99b74fe4eb9a3954df5946123f67a95da3d.png",type:"DISCORD",admin:!1,curator:!0,seniorCurator:!0,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4284746/playlist"},curatedAt:"2022-07-09T12:03:07.374428Z",createdAt:"2022-06-25T18:10:24.485756Z",updatedAt:"2024-11-09T20:31:57.830788Z",lastPublishedAt:"2022-07-08T13:00:00.559037Z",tags:["balanced","electronic","swing","dance-style"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"39624",name:"[Chroma] DNCE - Cake By The Ocean",description:"[Explicit Lyrics]\n[Flashing Lights Warning]\n\nMy first full spread map!\n\nJan 28th 2024: Reupload with fixed lighting\n-----------------------------------------------------\nSong: Cake By The Ocean by DNCE\nhttps://www.youtube.com/watch?v=vWaRiD5ym74\n\nMap Preview (Expert+):\nhttps://www.youtube.com/watch?v=UZyrFB9vKDo\n-----------------------------------------------------\nThank you to @Noveliniel for playtesting this map.\n-----------------------------------------------------\nMessage wunkoo on Discord for any feedback (must be in the BeastSaber discord).\nOr just leave a BeatSaver review",uploader:{id:4302396,name:"Koreami",avatar:"https://cdn.beatsaver.com/avatar/f5542fc9f09f21504d7e82a61b06d494389ba3d3.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,playlistUrl:"https://api.beatsaver.com/users/id/4302396/playlist"},metadata:{bpm:119,duration:221,songName:"Cake By The Ocean",songSubName:"",songAuthorName:"DNCE",levelAuthorName:"Koreami"},stats:{plays:0,downloads:0,upvotes:2819,downvotes:31,score:.9841,reviews:3},uploaded:"2024-01-27T19:00:00.269841Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"2cb2f496ef6e33a09a56d301923ade73b9a53c3d",state:"Published",createdAt:"2024-01-28T18:55:36.350370Z",sageScore:5,diffs:[{njs:12,offset:-.1,notes:431,bombs:6,obstacles:37,nps:2.021,length:423,characteristic:"Standard",difficulty:"Easy",events:2073,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:213.277,paritySummary:{errors:0,warns:0,resets:0},maxScore:389275,label:"Puddle",environment:"DragonsEnvironment"},{njs:12,offset:-.2,notes:554,bombs:0,obstacles:21,nps:2.598,length:423,characteristic:"Standard",difficulty:"Normal",events:2073,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:213.277,paritySummary:{errors:0,warns:0,resets:0},maxScore:502515,label:"Pond",environment:"DragonsEnvironment"},{njs:13,offset:-.25,notes:677,bombs:0,obstacles:31,nps:3.174,length:423,characteristic:"Standard",difficulty:"Hard",events:2073,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:213.277,paritySummary:{errors:0,warns:0,resets:0},maxScore:615595,label:"Lake",environment:"DragonsEnvironment"},{njs:16,offset:-.7,notes:800,bombs:0,obstacles:33,nps:3.751,length:423,characteristic:"Standard",difficulty:"Expert",events:2073,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:213.277,paritySummary:{errors:0,warns:0,resets:0},maxScore:728755,label:"Sea",environment:"DragonsEnvironment"},{njs:16,offset:-.7,notes:971,bombs:4,obstacles:41,nps:4.553,length:423,characteristic:"Standard",difficulty:"ExpertPlus",events:2073,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:213.277,paritySummary:{errors:0,warns:0,resets:0},maxScore:886075,label:"Ocean",environment:"DragonsEnvironment"},{njs:16,offset:0,notes:0,bombs:0,obstacles:0,nps:0,length:0,characteristic:"Lightshow",difficulty:"Normal",events:2073,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:0,paritySummary:{errors:0,warns:0,resets:0},maxScore:0,label:"Fluorescent Coral",environment:"DragonsEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/2cb2f496ef6e33a09a56d301923ade73b9a53c3d.zip",coverURL:"https://eu.cdn.beatsaver.com/2cb2f496ef6e33a09a56d301923ade73b9a53c3d.jpg",previewURL:"https://eu.cdn.beatsaver.com/2cb2f496ef6e33a09a56d301923ade73b9a53c3d.mp3"}],curator:{id:169636,name:"Duffelsalat",avatar:"https://cdn.beatsaver.com/avatar/42f17c520f53b67cf400a66f65e49038263042de.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,playlistUrl:"https://api.beatsaver.com/users/id/169636/playlist"},curatedAt:"2024-01-28T15:09:46.809093Z",createdAt:"2024-01-27T18:49:42.362618Z",updatedAt:"2025-05-27T05:59:37.010902Z",lastPublishedAt:"2024-01-28T18:55:43.801969Z",tags:["accuracy","balanced","pop","dance"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"9a0c",name:"Thnks fr th Mmrs - Fall Out Boy",description:"Thnks fr th Mmrs (or Thanks for the Memories) from Fall Out Boy.\nSo far the map that I have put the most work into (and which probably made me age by 3 years). Hope you enjoy it!\n\nThe map has Chroma lighting but can also be played without the Chroma mod.\nExpert+ contains single saber sections and polyrhythm parts. Just so you are warned ;)\n\nBig thanks to Sorukun for playtesting this map and especially to Timeweaver for pointing out all issues it had during its creation!",uploader:{id:21367,name:"hamsta",hash:"5de27451fffaa600066f2842",avatar:"https://www.gravatar.com/avatar/36e8d99105e1e9c1d2173853194691e2b2d5c0552b6e96bfd7a2fd8108310685?d=retro",type:"SIMPLE",admin:!1,curator:!1,seniorCurator:!1,playlistUrl:"https://api.beatsaver.com/users/id/21367/playlist"},metadata:{bpm:154.791,duration:198,songName:"Thnks fr th Mmrs",songSubName:"",songAuthorName:"Fall Out Boy",levelAuthorName:"Hamsta"},stats:{plays:0,downloads:0,upvotes:10577,downvotes:148,score:.984,reviews:2},uploaded:"2020-04-12T09:50:46.516Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"0e8ef3006db854c67f04fe72322bccea410f69ee",key:"9a0c",state:"Published",createdAt:"2020-04-12T09:50:46.516Z",sageScore:5,diffs:[{njs:14,offset:0,notes:580,bombs:0,obstacles:51,nps:3.092,length:484,characteristic:"Standard",difficulty:"Hard",events:2597,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:187.355,paritySummary:{errors:0,warns:0,resets:0},maxScore:526355,environment:"PanicEnvironment"},{njs:14,offset:0,notes:637,bombs:0,obstacles:51,nps:3.395,length:484,characteristic:"Standard",difficulty:"Expert",events:2597,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:187.355,paritySummary:{errors:0,warns:0,resets:0},maxScore:578795,environment:"PanicEnvironment"},{njs:16,offset:0,notes:844,bombs:0,obstacles:39,nps:4.499,length:484,characteristic:"Standard",difficulty:"ExpertPlus",events:2597,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:187.355,paritySummary:{errors:1,warns:2,resets:0},maxScore:769235,environment:"PanicEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/0e8ef3006db854c67f04fe72322bccea410f69ee.zip",coverURL:"https://eu.cdn.beatsaver.com/0e8ef3006db854c67f04fe72322bccea410f69ee.jpg",previewURL:"https://eu.cdn.beatsaver.com/0e8ef3006db854c67f04fe72322bccea410f69ee.mp3"}],curator:{id:4299228,name:"tan",avatar:"https://cdn.beatsaver.com/avatar/19d0c285757c0eea70e922961581953cfd96769b.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,playlistUrl:"https://api.beatsaver.com/users/id/4299228/playlist"},curatedAt:"2020-04-12T09:50:46.516Z",createdAt:"2020-04-12T09:50:46.516Z",updatedAt:"2020-04-12T09:50:46.516Z",lastPublishedAt:"2020-04-12T09:50:46.516Z",tags:["pop","dance-style"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"11b7a",name:"Still Alive - Portal",description:"I've wanted to map this song for a while now. And since this one's probably the last Portal song I'll map, I gave it my best. \r\n\r\nP.S. - I'm so glad to be back mapping this month. I had to take a break due to overwhelming stress, but now I'm feeling ready again.\r\nI hope you enjoy.\r\n\r\nPortal on Steam:\r\nhttps://store.steampowered.com/app/400/Portal/",uploader:{id:4284694,name:"Jokidum",hash:"5e15518d47f1600006e912cc",avatar:"https://cdn.beatsaver.com/avatar/da6133c71c7c84b75622f59dd2fce215f8c444f3.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,playlistUrl:"https://api.beatsaver.com/users/id/4284694/playlist"},metadata:{bpm:120,duration:176,songName:"Still Alive",songSubName:"- Portal",songAuthorName:"Jonathan Coulton",levelAuthorName:"Jokidum"},stats:{plays:0,downloads:0,upvotes:6908,downvotes:92,score:.984,reviews:2},uploaded:"2020-12-04T20:30:44.132Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"8c03b43484b0dd1fc7d8a3104a82f0992a001c6c",key:"11b7a",state:"Published",createdAt:"2020-12-04T20:30:44.132Z",sageScore:4,diffs:[{njs:12,offset:0,notes:490,bombs:0,obstacles:13,nps:2.853,length:343.5,characteristic:"Standard",difficulty:"Expert",events:1060,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:171.75,paritySummary:{errors:0,warns:0,resets:0},maxScore:443555,environment:"TriangleEnvironment"},{njs:16,offset:0,notes:0,bombs:0,obstacles:0,nps:0,length:0,characteristic:"Lightshow",difficulty:"Easy",events:1060,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:0,paritySummary:{errors:0,warns:0,resets:0},maxScore:0,label:"Lightshow",environment:"TriangleEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/8c03b43484b0dd1fc7d8a3104a82f0992a001c6c.zip",coverURL:"https://eu.cdn.beatsaver.com/8c03b43484b0dd1fc7d8a3104a82f0992a001c6c.jpg",previewURL:"https://eu.cdn.beatsaver.com/8c03b43484b0dd1fc7d8a3104a82f0992a001c6c.mp3"}],createdAt:"2020-12-04T20:30:44.132Z",updatedAt:"2020-12-04T20:30:44.132Z",lastPublishedAt:"2020-12-04T20:30:44.132Z",bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"24227",name:"DADDY! DADDY! DO! (TV Size) (2022 Remaster) [Kaguya-sama: Love Is War Season 2 Opening] - Masayuki Suzuki ft. Airi Suzuki ",description:"Just a small remaster of my old daddy daddy do map from 2020, fixed a few parity errors and updated the NJS. There's also 2 additional down maps now. \n\nThanks to https://twitter.com/WicKedBassline for the special request!\n\nDADDY! DADDY! DO! is opening theme for the second season of the Kaguya-sama: Love Is War anime adaptation.\n\nKeep up to date on my maps: https://twitter.com/Joetastic_\nMy mapper's profile: https://bsaber.com/members/joetastic/\nContact me on discord: @Joetastic#2501",uploader:{id:58338,name:"Joetastic",hash:"5cff0b7498cc5a672c85050e",avatar:"https://cdn.beatsaver.com/avatar/91bb7b0510cea647179bc95e032f8a25608b09f1.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/58338/playlist"},metadata:{bpm:138,duration:91,songName:"DADDY! DADDY! DO! (TV Size) (2022 Remaster)",songSubName:"ft. Airi Suzuki",songAuthorName:"Masayuki Suzuki",levelAuthorName:"Joetastic"},stats:{plays:0,downloads:0,upvotes:3282,downvotes:38,score:.984,reviews:1},uploaded:"2022-04-09T06:56:40.572610Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"9eb5c6cc6e55bc17ee7833a5e8b67f8793a3ed17",state:"Published",createdAt:"2022-04-09T06:56:26.910837Z",sageScore:4,diffs:[{njs:12,offset:0,notes:205,bombs:4,obstacles:23,nps:2.352,length:200.5,characteristic:"Standard",difficulty:"Hard",events:1053,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:87.174,paritySummary:{errors:0,warns:0,resets:0},maxScore:181355,environment:"PanicEnvironment"},{njs:15,offset:-.3,notes:306,bombs:4,obstacles:23,nps:3.51,length:200.5,characteristic:"Standard",difficulty:"Expert",events:1053,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:87.174,paritySummary:{errors:0,warns:0,resets:0},maxScore:274275,environment:"PanicEnvironment"},{njs:18,offset:-.6,notes:381,bombs:0,obstacles:23,nps:4.371,length:200.5,characteristic:"Standard",difficulty:"ExpertPlus",events:1053,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:87.174,paritySummary:{errors:0,warns:0,resets:0},maxScore:343275,environment:"PanicEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/9eb5c6cc6e55bc17ee7833a5e8b67f8793a3ed17.zip",coverURL:"https://eu.cdn.beatsaver.com/9eb5c6cc6e55bc17ee7833a5e8b67f8793a3ed17.jpg",previewURL:"https://eu.cdn.beatsaver.com/9eb5c6cc6e55bc17ee7833a5e8b67f8793a3ed17.mp3"}],curator:{id:4285122,name:"Lasso-Catsidy",avatar:"https://cdn.beatsaver.com/avatar/1daf0e4ecc153a86d14ec7913800a38fd0f0187d.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,playlistUrl:"https://api.beatsaver.com/users/id/4285122/playlist"},curatedAt:"2022-04-11T06:44:59.068414Z",createdAt:"2022-04-09T06:56:26.910837Z",updatedAt:"2022-04-11T06:44:59.068414Z",lastPublishedAt:"2022-04-09T06:56:40.572610Z",tags:["dance-style","anime","j-pop"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"291b9",name:"BLOODY STREAM (TV Size) (2022 Remaster) [JoJo's Bizarre Adventure 2nd Opening] - Coda",description:'---------Map uses the new 1.20 Note mechanics (eg: arc and chains) and won\'t work on any versions of Beat Saber below 1.20---------\n\nThanks to https://twitter.com/EuclaseW for the special request!\n\nThis map is a remap of my old Bloody Stream map. Changes include:\n- Parity fixes\n- Additional difficulties\n- Custom colors!\n- Addition of Arcs and Chains!\n\n"BLOODY STREAM" is the second opening of the JoJo\'s Bizarre Adventure by Japanese musician Kazuso Oda under the stage name "Coda".\n\nKeep up to date on my maps: https://twitter.com/Joetastic_\nMy mapper\'s profile: https://bsaber.com/members/joetastic/\nContact me on discord: @Joetastic#2501',uploader:{id:58338,name:"Joetastic",hash:"5cff0b7498cc5a672c85050e",avatar:"https://cdn.beatsaver.com/avatar/91bb7b0510cea647179bc95e032f8a25608b09f1.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/58338/playlist"},metadata:{bpm:132,duration:93,songName:"BLOODY STREAM (TV Size) (2022 Remaster)",songSubName:"",songAuthorName:"Coda",levelAuthorName:"Joetastic"},stats:{plays:0,downloads:0,upvotes:4309,downvotes:54,score:.9838},uploaded:"2022-08-21T14:25:59.776857Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"2c6a5186b7e3f4a3b453065ee8ad042d72947102",state:"Published",createdAt:"2022-08-21T14:25:52.329353Z",sageScore:2,diffs:[{njs:12,offset:0,notes:326,bombs:29,obstacles:16,nps:3.659,length:196,characteristic:"Standard",difficulty:"Hard",events:1780,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:89.091,paritySummary:{errors:0,warns:0,resets:0},maxScore:292915,environment:"BigMirrorEnvironment"},{njs:15,offset:-.3,notes:446,bombs:18,obstacles:13,nps:5.006,length:196,characteristic:"Standard",difficulty:"Expert",events:1780,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:89.091,paritySummary:{errors:0,warns:0,resets:0},maxScore:403315,environment:"BigMirrorEnvironment"},{njs:18,offset:-.6,notes:561,bombs:22,obstacles:15,nps:6.297,length:196,characteristic:"Standard",difficulty:"ExpertPlus",events:1780,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:89.091,paritySummary:{errors:0,warns:0,resets:0},maxScore:510715,environment:"BigMirrorEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/2c6a5186b7e3f4a3b453065ee8ad042d72947102.zip",coverURL:"https://eu.cdn.beatsaver.com/2c6a5186b7e3f4a3b453065ee8ad042d72947102.jpg",previewURL:"https://eu.cdn.beatsaver.com/2c6a5186b7e3f4a3b453065ee8ad042d72947102.mp3"}],curator:{id:4285122,name:"Lasso-Catsidy",avatar:"https://cdn.beatsaver.com/avatar/1daf0e4ecc153a86d14ec7913800a38fd0f0187d.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,playlistUrl:"https://api.beatsaver.com/users/id/4285122/playlist"},curatedAt:"2022-09-09T02:00:15.130726Z",createdAt:"2022-08-21T14:25:52.329353Z",updatedAt:"2022-09-09T02:00:15.130726Z",lastPublishedAt:"2022-08-21T14:25:59.776857Z",tags:["dance-style","anime","j-pop","balanced"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"2ab5b",name:"Handclap - fitz and the tantrums",description:"twitch : https://www.twitch.tv/emiru_milk\ntwitter : https://twitter.com/EmirTart\ndiscord : https://discord.gg/DHwuND8K7K\nEmiru#9999",uploader:{id:4284894,name:"emiru",hash:"5d3dac6586729100069260cc",avatar:"https://cdn.beatsaver.com/avatar/59d2538aa7b938cbd28629073dc6d9be2357bee9.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4284894/playlist"},metadata:{bpm:139.867,duration:196,songName:"Handclap",songSubName:"",songAuthorName:"Fitz and the Tantrums",levelAuthorName:"Emir"},stats:{plays:0,downloads:0,upvotes:5631,downvotes:75,score:.9836,reviews:3},uploaded:"2022-10-08T08:58:23.778044Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"3da135c11207f5f4f2dfe7b18a6416931f66936e",state:"Published",createdAt:"2022-10-08T09:11:55.226599Z",sageScore:3,diffs:[{njs:16,offset:0,notes:196,bombs:0,obstacles:58,nps:1.078,length:423.891,characteristic:"Standard",difficulty:"Easy",events:5218,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:181.841,paritySummary:{errors:0,warns:0,resets:0},maxScore:173075,environment:"FitBeatEnvironment"},{njs:13,offset:.152,notes:302,bombs:0,obstacles:66,nps:1.655,length:425.39,characteristic:"Standard",difficulty:"Normal",events:5218,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:182.483,paritySummary:{errors:0,warns:0,resets:0},maxScore:270595,environment:"FitBeatEnvironment"},{njs:14,offset:-.168,notes:546,bombs:0,obstacles:184,nps:2.992,length:425.39,characteristic:"Standard",difficulty:"Hard",events:5221,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:182.483,paritySummary:{errors:0,warns:0,resets:0},maxScore:495075,environment:"FitBeatEnvironment"},{njs:15,offset:-.368,notes:739,bombs:0,obstacles:130,nps:3.894,length:442.374,characteristic:"Standard",difficulty:"Expert",events:5218,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:189.769,paritySummary:{errors:0,warns:0,resets:0},maxScore:672635,environment:"FitBeatEnvironment"},{njs:16,offset:-.543,notes:925,bombs:8,obstacles:315,nps:5.057,length:426.389,characteristic:"Standard",difficulty:"ExpertPlus",events:4390,chroma:!0,me:!1,ne:!1,cinema:!1,seconds:182.912,paritySummary:{errors:0,warns:0,resets:8},maxScore:843755,environment:"FitBeatEnvironment"},{njs:12,offset:.526,notes:350,bombs:0,obstacles:34,nps:1.844,length:442.374,characteristic:"Lawless",difficulty:"Easy",events:5219,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:189.769,paritySummary:{errors:43,warns:22,resets:0},maxScore:314755,label:"Lawless Tutorial",environment:"FitBeatEnvironment"},{njs:13,offset:.152,notes:657,bombs:0,obstacles:2,nps:3.462,length:442.374,characteristic:"Lawless",difficulty:"Normal",events:5219,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:189.769,paritySummary:{errors:623,warns:0,resets:0},maxScore:597195,label:"Down Notes",environment:"FitBeatEnvironment"},{njs:14,offset:-.002,notes:670,bombs:0,obstacles:2,nps:3.531,length:442.374,characteristic:"Lawless",difficulty:"Hard",events:5219,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:189.769,paritySummary:{errors:635,warns:16,resets:0},maxScore:609155,label:"Up Notes",environment:"FitBeatEnvironment"},{njs:15,offset:-.29,notes:1050,bombs:0,obstacles:2,nps:5.533,length:442.374,characteristic:"Lawless",difficulty:"Expert",events:5218,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:189.769,paritySummary:{errors:0,warns:78,resets:0},maxScore:958755,label:"90°Directions",environment:"FitBeatEnvironment"},{njs:16,offset:-.543,notes:1260,bombs:0,obstacles:246,nps:6.625,length:443.373,characteristic:"Lawless",difficulty:"ExpertPlus",events:5218,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:190.198,paritySummary:{errors:0,warns:6,resets:0},maxScore:1151955,label:"Dodge Walls",environment:"FitBeatEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/3da135c11207f5f4f2dfe7b18a6416931f66936e.zip",coverURL:"https://eu.cdn.beatsaver.com/3da135c11207f5f4f2dfe7b18a6416931f66936e.jpg",previewURL:"https://eu.cdn.beatsaver.com/3da135c11207f5f4f2dfe7b18a6416931f66936e.mp3"}],curator:{id:58338,name:"Joetastic",hash:"5cff0b7498cc5a672c85050e",avatar:"https://cdn.beatsaver.com/avatar/91bb7b0510cea647179bc95e032f8a25608b09f1.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/58338/playlist"},curatedAt:"2022-10-08T09:19:15.538197Z",createdAt:"2022-10-08T08:57:08.316867Z",updatedAt:"2022-10-08T09:19:15.538197Z",lastPublishedAt:"2022-10-08T09:12:01.774147Z",tags:["dance-style","balanced","rock","pop"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"212cf",name:"Someone Else's Hat - David Maxim Micic (modchart)",description:"David Maxim Micic is a prog rock genius. I wish I had the courage to map the 8 minutes of Mbinguni Amina but a few minutes of Someone Else's Hat will have to do. I really encourage you to check his stuff, because it's so good: https://open.spotify.com/artist/0wQa1N4q3HmLwxqkpVcYhs?si=aB4m1yonTg2qk5ounpOEUw\n\nThis modchart was an opportunity for me to have fun with environment animations, and push animations to a new level. The first scene is based on the album cover that Yelka made for Who Bit the Moon, and the rest is random ideas that I thought would be cool with this music.\n\nHuge thanks to the playtesters and in particular Mawntee and Aggrogahu, who took time to give detailed feedback. I appreciate.\n\nPreview: https://youtu.be/RX-payaVsKU\n\nThe map should work on Quest too, though it won't look as good due to the difference in how walls look.\n\nIf you like what I create, tell me, I love to hear from you:\n- YouTube: https://youtube.com/c/nyri0\n- Twitter: https://twitter.com/nyri0z\n- Ko-Fi: https://ko-fi.com/nyri0",uploader:{id:4288814,name:"nyri0",hash:"5e792df416c9680006086a78",avatar:"https://cdn.beatsaver.com/avatar/233323d456510756fbbc0140c1a0698caf8b096c.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,playlistUrl:"https://api.beatsaver.com/users/id/4288814/playlist"},metadata:{bpm:130,duration:207,songName:"Someone Else's Hat",songSubName:"",songAuthorName:"David Maxim Micic",levelAuthorName:"nyri0"},stats:{plays:0,downloads:0,upvotes:3304,downvotes:40,score:.9835,reviews:3},uploaded:"2022-02-04T23:50:20.027446Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"3662e733501d7a77850c20f0fcea792ed2187943",state:"Published",createdAt:"2022-02-04T23:05:01.786046Z",sageScore:1,diffs:[{njs:16,offset:0,notes:465,bombs:12,obstacles:1460,nps:2.38,length:423.333,characteristic:"Standard",difficulty:"Expert",events:875,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:195.385,paritySummary:{errors:83,warns:0,resets:0},maxScore:420555,label:"haut-de-forme",environment:"BTSEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/3662e733501d7a77850c20f0fcea792ed2187943.zip",coverURL:"https://eu.cdn.beatsaver.com/3662e733501d7a77850c20f0fcea792ed2187943.jpg",previewURL:"https://eu.cdn.beatsaver.com/3662e733501d7a77850c20f0fcea792ed2187943.mp3"}],curator:{id:4284947,name:"Phoenix",hash:"5fa08b5281e1d70006f1b322",avatar:"https://cdn.beatsaver.com/avatar/4284947.jpg",type:"SIMPLE",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4284947/playlist"},curatedAt:"2022-02-04T23:50:20.027446Z",createdAt:"2022-02-04T23:05:01.786046Z",updatedAt:"2022-02-04T23:52:36.995020Z",lastPublishedAt:"2022-02-04T23:50:20.027446Z",tags:["balanced","rock"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"2c785",name:"[Arc/Chain] Let's Groove - Earth, Wind & Fire",description:"I've been wanting to do a lower tempo dance map for a while and I knew this would be the perfect song. \n\nThanks to @dolledupchaos for playtesting!",uploader:{id:4232648,name:"ramenator05",hash:"60ecf439686b9f0006a67a41",avatar:"https://cdn.beatsaver.com/avatar/4232648.jpg",type:"SIMPLE",admin:!1,curator:!1,seniorCurator:!1,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4232648/playlist"},metadata:{bpm:124,duration:236,songName:"[Arc/Chain] Let's Groove - Earth Wind & Fire",songSubName:"",songAuthorName:"Earth Wind & Fire",levelAuthorName:"ramenator05"},stats:{plays:0,downloads:0,upvotes:3479,downvotes:43,score:.9834,reviews:3},uploaded:"2022-11-28T23:00:29.688269Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"bf86263deda5f2e09867f3ddad625dfc269709be",state:"Published",createdAt:"2022-11-28T22:59:23.889170Z",sageScore:2,diffs:[{njs:15,offset:.2,notes:550,bombs:0,obstacles:0,nps:2.39,length:480,characteristic:"Standard",difficulty:"Hard",events:115,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:232.258,paritySummary:{errors:0,warns:0,resets:0},maxScore:500755,environment:"LizzoEnvironment"},{njs:17,offset:-.2,notes:708,bombs:0,obstacles:0,nps:3.076,length:480,characteristic:"Standard",difficulty:"Expert",events:115,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:232.258,paritySummary:{errors:0,warns:0,resets:0},maxScore:646195,environment:"LizzoEnvironment"},{njs:19,offset:.5,notes:715,bombs:0,obstacles:0,nps:3.107,length:480,characteristic:"Standard",difficulty:"ExpertPlus",events:115,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:232.258,paritySummary:{errors:0,warns:0,resets:0},maxScore:652635,environment:"LizzoEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/bf86263deda5f2e09867f3ddad625dfc269709be.zip",coverURL:"https://eu.cdn.beatsaver.com/bf86263deda5f2e09867f3ddad625dfc269709be.jpg",previewURL:"https://eu.cdn.beatsaver.com/bf86263deda5f2e09867f3ddad625dfc269709be.mp3"}],curator:{id:4292041,name:"symphonic",avatar:"https://cdn.beatsaver.com/avatar/2dc906ee5b78c2cb723f0eae964c2c203babf3f4.png",type:"DISCORD",admin:!0,curator:!0,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/4292041/playlist"},curatedAt:"2022-11-29T21:39:24.794532Z",createdAt:"2022-11-28T22:59:23.889170Z",updatedAt:"2022-11-29T21:39:24.794532Z",lastPublishedAt:"2022-11-28T23:00:29.688269Z",tags:["dance-style","soul","dance"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"21bf8",name:"Marina and the Diamonds - Are You Satisfied?",description:"Thanks, Cryston!\n\nSocials: \nhttps://twitter.com/bytrius\nhttps://www.youtube.com/c/bytrius\nhttps://bsaber.com/members/bytrius/\nhttps://www.twitch.tv/bytrius",uploader:{id:73032,name:"Bytrius",hash:"5de442271dc9e8000696cd15",avatar:"https://cdn.beatsaver.com/avatar/62ed9906317427e9b14435ca144c7189b83a711a.png",type:"DISCORD",admin:!0,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/73032/playlist"},metadata:{bpm:124,duration:200,songName:"Are You Satisfied?",songSubName:"",songAuthorName:"Marina and the Diamonds",levelAuthorName:"Bytrius"},stats:{plays:0,downloads:0,upvotes:604,downvotes:2,score:.9832,reviews:1},uploaded:"2022-02-15T21:07:43.593089Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"7fe7f6e0f0f1687b6821891b42f3ae080d6e1270",state:"Published",createdAt:"2022-02-15T20:59:06.806428Z",sageScore:4,diffs:[{njs:15,offset:-.55,notes:459,bombs:4,obstacles:124,nps:2.585,length:367,characteristic:"Standard",difficulty:"Hard",events:4532,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:177.581,paritySummary:{errors:0,warns:0,resets:2},maxScore:415035,environment:"DefaultEnvironment"},{njs:17,offset:-.725,notes:679,bombs:16,obstacles:122,nps:3.508,length:400,characteristic:"Standard",difficulty:"Expert",events:4532,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:193.548,paritySummary:{errors:0,warns:0,resets:4},maxScore:617435,environment:"DefaultEnvironment"},{njs:19,offset:.125,notes:944,bombs:24,obstacles:122,nps:4.877,length:400,characteristic:"Standard",difficulty:"ExpertPlus",events:4532,chroma:!1,me:!1,ne:!1,cinema:!1,seconds:193.548,paritySummary:{errors:0,warns:0,resets:4},maxScore:861235,environment:"DefaultEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/7fe7f6e0f0f1687b6821891b42f3ae080d6e1270.zip",coverURL:"https://eu.cdn.beatsaver.com/7fe7f6e0f0f1687b6821891b42f3ae080d6e1270.jpg",previewURL:"https://eu.cdn.beatsaver.com/7fe7f6e0f0f1687b6821891b42f3ae080d6e1270.mp3"}],curator:{id:32269,name:"maybeemae",hash:"5e1123516d774b0006a953ec",avatar:"https://cdn.beatsaver.com/avatar/d2119e1ff402b2cd380caf8b074d3f7c037f0ec2.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,playlistUrl:"https://api.beatsaver.com/users/id/32269/playlist"},curatedAt:"2022-02-15T21:07:43.593089Z",createdAt:"2022-02-15T20:59:06.806428Z",updatedAt:"2024-08-27T09:23:17.201003Z",lastPublishedAt:"2022-02-15T21:07:43.593089Z",tags:["dance-style","pop","electronic"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1},{id:"b514",name:"[[Wall Show + Chroma]] GAS GAS GAS | Manuel",description:"This wall map is a bit more intense than my others, you will need a very hefty pc to run and record this. Have Fun!\n\nHere's a playthrough: https://www.youtube.com/watch?v=hlS6r-Usnro\nHere's a playthrough by Nico (HQ Version): https://youtu.be/F_3qRxDdQc0\n\nREQUIREMENTS: \n -Noodle Extensions\n -Chroma/ChromaLite\n(fixed formatting + removed stupid metadata ;)",uploader:{id:73008,name:"thelightdesigner",hash:"5cff0b7798cc5a672c85627a",avatar:"https://cdn.beatsaver.com/avatar/fa1a30d2b4146dd93cb42537759669dcf961cf29.png",type:"DISCORD",admin:!1,curator:!1,seniorCurator:!1,playlistUrl:"https://api.beatsaver.com/users/id/73008/playlist"},metadata:{bpm:154,duration:108,songName:"GAS GAS GAS",songSubName:"(Short Ver.)",songAuthorName:"Manuel",levelAuthorName:"KyleT"},stats:{plays:0,downloads:0,upvotes:9158,downvotes:134,score:.9832,reviews:4},uploaded:"2020-06-22T20:02:06.271Z",automapper:!1,ranked:!1,qualified:!1,versions:[{hash:"95e11f39b2898a38e3b5e61d2156ef5f5835f40f",key:"b514",state:"Published",createdAt:"2020-06-22T20:02:06.271Z",sageScore:3,diffs:[{njs:16.5,offset:0,notes:390,bombs:13,obstacles:13898,nps:3.832,length:261.25,characteristic:"Standard",difficulty:"Expert",events:1462,chroma:!0,me:!1,ne:!0,cinema:!1,seconds:101.786,paritySummary:{errors:0,warns:0,resets:2},maxScore:351555,label:"GAS GAS GAS!!!!!",environment:"NiceEnvironment"}],downloadURL:"https://r2cdn.beatsaver.com/95e11f39b2898a38e3b5e61d2156ef5f5835f40f.zip",coverURL:"https://eu.cdn.beatsaver.com/95e11f39b2898a38e3b5e61d2156ef5f5835f40f.jpg",previewURL:"https://eu.cdn.beatsaver.com/95e11f39b2898a38e3b5e61d2156ef5f5835f40f.mp3"}],curator:{id:1096,name:"pyrowarfare",hash:"5e99c7df3f476a0006596cdf",avatar:"https://www.gravatar.com/avatar/28fcd25e8adfa72a17daa766767daf781bee89776333a3ed7a4cc84146e6a3e8?d=retro",type:"SIMPLE",admin:!1,curator:!1,seniorCurator:!1,curatorTab:!0,verifiedMapper:!0,playlistUrl:"https://api.beatsaver.com/users/id/1096/playlist"},curatedAt:"2020-06-22T20:02:06.271Z",createdAt:"2020-06-22T20:02:06.271Z",updatedAt:"2020-06-22T20:02:06.271Z",lastPublishedAt:"2020-06-22T20:02:06.271Z",tags:["anime","electronic","house"],bookmarked:!1,declaredAi:"None",blRanked:!1,blQualified:!1}]},function(e,t,n){if(AFRAME.registerComponent("song-info-positioner",{schema:{victory:{default:!1}},update:function(){this.data.victory?this.el.object3D.position.y=-1.2:this.el.object3D.position.y=-1}}),window.AFRAME){const t=["song-info-positioner"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){n(6);if(AFRAME.registerComponent("song-preview-system",{schema:{selectedChallengeId:{type:"string"},selectedChallengeVersion:{type:"string"}},init:function(){this.audio=document.createElement("audio"),this.audio.volume=.5},update:function(e){const t=this.data;console.log("update-song",e,t),t.selectedChallengeId&&e.selectedChallengeId!==t.selectedChallengeId?(this.audio.pause(),this.audio.setAttribute("src","https://cdn.beatsaver.com/"+t.selectedChallengeVersion+".mp3"),this.audio.currentTime=0,this.audio.play()):t.selectedChallengeId||this.audio.pause()}}),window.AFRAME){const t=["song-preview-system"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("song-progress-info",{dependencies:["geometry","material"],schema:{enabled:{default:!1}},init:function(){this.tick=AFRAME.utils.throttleTick(this.tick.bind(this),1e3),this.progress=this.el.getObject3D("mesh"),this.progress.geometry.translate(.285,0,0),this.el.sceneEl.addEventListener("cleargame",()=>{this.progress.scale.x=1e-4})},update:function(e){this.progress.scale.x=1e-4},updateInfo:function(){const e=this.el.sceneEl.components.song.source;if(!e||!e.buffer)return;const t=this.el.sceneEl.components.song.getCurrentTime()/e.buffer.duration;t&&(this.progress.scale.x=t)},tick:function(){this.data.enabled&&this.updateInfo()}}),window.AFRAME){const t=["song-progress-info"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){n(6);const r={once:!0};let i=AFRAME.utils.getUrlParameter("skip");if(i=i?parseInt(i)/1e3:0,AFRAME.registerComponent("song",{schema:{audio:{type:"string"},analyserEl:{type:"selector",default:"#audioAnalyser"},challengeId:{default:""},isBeatsPreloaded:{default:!1},isGameOver:{default:!1},isLoading:{default:!1},isPlaying:{default:!1},isVictory:{default:!1}},init:function(){this.analyserSetter={buffer:!0},this.audioAnalyser=this.data.analyserEl.components.audioanalyser,this.context=this.audioAnalyser.context,this.isAudioPlaying=!1,this.songStartTime=0,this.onSongComplete=this.onSongComplete.bind(this),this.audioAnalyser.gainNode.gain.value=.5,this.el.addEventListener("gamemenurestart",this.onRestart.bind(this)),this.el.addEventListener("wallhitstart",this.onWallHitStart.bind(this)),this.el.addEventListener("wallhitend",this.onWallHitEnd.bind(this))},update:function(e){const t=this.data;if(!e.isLoading&&t.isLoading&&t.audio)this.processAudio();else if(!e.audio&&t.audio&&t.isLoading)this.processAudio();else if(e.isGameOver||!t.isGameOver){if(e.isGameOver&&!t.isGameOver&&(this.audioAnalyser.gainNode.value=.5),!e.isVictory&&t.isVictory)return this.data.analyserEl.addEventListener("audioanalyserbuffersource",e=>{this.audioAnalyser.resumeContext();const t=this.audioAnalyser.gainNode.gain;t.cancelScheduledValues(0),t.setValueAtTime(.05,0),this.source=e.detail,this.source.start(),this.el.emit("victory")},r),void this.audioAnalyser.refreshSource();!e.isBeatsPreloaded&&this.data.isBeatsPreloaded&&this.source&&this.startAudio(),!e.challengeId||t.challengeId?(e.isPlaying&&!t.isPlaying&&(this.audioAnalyser.suspendContext(),this.isAudioPlaying=!1),!e.isPlaying&&t.isPlaying&&this.source&&(this.audioAnalyser.resumeContext(),this.isAudioPlaying=!0)):this.stopAudio()}else this.onGameOver()},processAudio:function(){this.el.sceneEl.emit("songprocessstart",null,!1),this.getAudio().then(e=>{this.el.sceneEl.emit("songprocessfinish",null,!1)}).catch(console.error)},getAudio:function(){const e=this.data;return this.source&&this.stopAudio(),this.isAudioPlaying=!1,new Promise(t=>{e.analyserEl.addEventListener("audioanalyserbuffersource",e=>{this.source=e.detail,t(this.source)},r),this.analyserSetter.src=this.data.audio,e.analyserEl.setAttribute("audioanalyser",this.analyserSetter)})},stopAudio:function(){this.source?(this.source.onended=null,this.isAudioPlaying&&this.source.stop(),this.source.disconnect(),this.source=null,this.isAudioPlaying=!1):console.warn("[song] Tried to stopAudio, but not playing.")},onSongComplete:function(){this.data.isPlaying&&this.el.emit("songcomplete")},onGameOver:function(){this.isAudioPlaying=!1;const e=this.source.playbackRate;e.setValueAtTime(e.value,this.context.currentTime),e.linearRampToValueAtTime(0,this.context.currentTime+3.5);const t=this.audioAnalyser.gainNode.gain;t.setValueAtTime(t.value,this.context.currentTime),t.linearRampToValueAtTime(0,this.context.currentTime+3.5),setTimeout(()=>{this.data.isGameOver&&this.stopAudio()},3500)},onRestart:function(){this.isAudioPlaying=!1,this.source&&this.source.disconnect();this.audioAnalyser.gainNode.gain.cancelScheduledValues(0),this.data.analyserEl.addEventListener("audioanalyserbuffersource",e=>{this.source=e.detail,this.el.sceneEl.emit("songloadfinish",null,!1)},r),this.audioAnalyser.refreshSource()},onWallHitStart:function(){this.audioAnalyser.gainNode.gain.linearRampToValueAtTime(.1,this.context.currentTime+.1)},onWallHitEnd:function(){this.audioAnalyser.gainNode.gain.linearRampToValueAtTime(.5,this.context.currentTime+.1)},startAudio:function(){this.audioAnalyser.gainNode.gain.setValueAtTime(.5,this.context.currentTime),this.songStartTime=this.context.currentTime,this.source.onended=this.onSongComplete,this.source.start(0,i||0),this.isAudioPlaying=!0},getCurrentTime:function(){return this.context.currentTime-this.songStartTime}}),window.AFRAME){const t=["song"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){"use strict";n.r(t);var r=n(0),i=n.n(r);const a=[{name:"bgcolor",property:"backglow.color"},{name:"leftglow",property:"leftsideglow.color"},{name:"rightglow",property:"rightsideglow.color"}],o=[{id:"off",dur:500,to:"off"},{id:"primary",dur:5,to:"primary"},{id:"primarybright",dur:500,from:"tertiary",to:"primarybright"},{id:"secondary",dur:5,to:"secondary"},{id:"secondarybright",dur:500,from:"tertiary",to:"secondarybright"}],s=["off","secondary","secondary","secondarybright","","primary","primary","primarybright","primarybright"];AFRAME.registerComponent("stage-colors",{schema:{colorScheme:{default:"default"}},init:function(){this.el.addEventListener("cleargame",this.resetColors.bind(this)),this.el.sceneEl.addEventListener("playbuttonclick",this.resetColors.bind(this)),function(e,t){for(let n=0;n<a.length;n++){const r=a[n];for(let n=0;n<o.length;n++){const a=o[n];e.setAttribute(`animation__${r.name}${a.id}`,{property:"systems.materials."+r.property,type:"color",isRawProperty:!0,easing:"linear",dur:a.dur,from:a.from?i.a.schemes[t][a.from]:"",startEvents:`${r.name}${a.id}`,to:i.a.schemes[t][a.to]})}}}(this.el.sceneEl,this.data.colorScheme)},update:function(e){e.colorScheme&&this.data.colorScheme!==e.colorScheme&&function(e,t){for(let n=0;n<a.length;n++){const r=a[n];for(let n=0;n<o.length;n++){const a=o[n],s=`animation__${r.name}${a.id}`;a.from&&e.setAttribute(s,"from",i.a.schemes[t][a.from]),e.setAttribute(s,"to",i.a.schemes[t][a.to])}}}(this.el.sceneEl,this.data.colorScheme)},play:function(){this.el.emit("bgcolorsecondary",null,!1)},setColor:function(e,t){s[t]||(t=5),e.startsWith("curve")?this.el.emit(e+"stageeventcolor",s[t].replace("bright",""),!1):this.el.emit(`${e}color${s[t]}`,null,!1)},setColorInstant:function(e,t){const n=this.el.sceneEl.systems.materials;if("stars"===e){let e;return e=0===t?i.a.schemes[this.data.colorScheme].secondarybright:i.a.schemes[this.data.colorScheme].secondary,void l(n.stars,"color",e)}const r=i.a.schemes[this.data.colorScheme][s[t]];"moon"===e&&l(n.moon,"tint",r)},resetColors:function(){this.el.emit("bgcolorsecondary",null,!1),this.el.emit("curveevenstageeventcolor","off",!1),this.el.emit("curveoddstageeventcolor","off",!1)}});const c=new THREE.Color;function l(e,t,n){c.set(n),e.uniforms?(e.uniforms[t].value.x=c.r,e.uniforms[t].value.y=c.g,e.uniforms[t].value.z=c.b):e[t].set(n)}if(window.AFRAME){const t=["stage-colors"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("stage-lasers",{schema:{enabled:{default:!0}},init:function(){this.speed=0,this.lasers=[this.el.children[0].object3D,this.el.children[1].object3D,this.el.children[2].object3D]},pulse:function(e){this.speed=e/8},tick:function(e,t){0!==this.speed&&(t/=1e3,!this.data.enabled&&(this.speed*=.97,Math.abs(this.speed)<.01)?this.speed=0:(this.lasers[0].rotation.z+=this.speed*t,this.lasers[1].rotation.z-=this.speed*t*1.01,this.lasers[2].rotation.z+=this.speed*t*1.02))}}),window.AFRAME){const t=["stage-lasers"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){const r=n(0);if(AFRAME.registerComponent("stars",{schema:{color:{type:"color",default:r.initial.secondary},count:{default:500},radius:{default:300}},init:function(){const e=()=>(Math.random()-.5)*this.data.radius*2,t=new THREE.BufferGeometry;this.material=this.el.sceneEl.systems.materials.stars;const n=[];for(let t=0;t<this.data.count;t++)n.push(e(),e(),4*e());t.setAttribute("position",new THREE.Float32BufferAttribute(n,3)),t.computeBoundingSphere();const r=new THREE.Points(t,this.material);this.el.setObject3D("stars",r)},update:function(){this.material.color.setStyle(this.data.color)}}),window.AFRAME){const t=["stars"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("stats-param",{init:function(){"true"===AFRAME.utils.getUrlParameter("stats")&&this.el.setAttribute("stats","")}}),window.AFRAME){const t=["stats-param"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("stepback",{init:function(){this.message=document.getElementById("stepback"),this.camera=document.getElementById("camera"),this.lastTime=0,this.limit=-.9,this.throttling=300},tick:function(e,t){if(!(e-this.lastTime<this.throttling)){var n=this.camera.object3D.position,r=this.message.object3D.position;n.z<this.limit?(this.throttling=10,this.message.object3D.visible=!0,this.message.getObject3D("mesh").material.opacity=1-Math.abs(n.z-r.z),r.x=n.x,r.y=n.y):(this.message.object3D.visible=!1,this.throttling=500),this.lastTime=e}}}),window.AFRAME){const t=["stepback"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("sub-object",{schema:{from:{type:"selector"},name:{type:"string"}},init:function(){var e=this.el,t=this.data;t.from.addEventListener("model-loaded",n=>{const r=n.detail.model.getObjectByName(t.name);e.setObject3D("mesh",r.clone()),e.setAttribute("material","shader","flat"),e.emit("subobjectloaded",null,!1)})}}),window.AFRAME){const t=["sub-object"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){var r={superkeyboard:{wrapCount:30,inputOffsetY:.008,inputOffsetX:.08,img:"keyboard.png",hoverImg:"keyboard-hover.png",layout:[{key:"1",x:.013,y:.03,w:.093,h:.176},{key:"2",x:.106,y:.03,w:.088,h:.176},{key:"3",x:.194,y:.03,w:.077,h:.176},{key:"4",x:.271,y:.03,w:.085,h:.176},{key:"5",x:.356,y:.03,w:.081,h:.176},{key:"6",x:.437,y:.03,w:.081,h:.176},{key:"8",x:.603,y:.03,w:.082,h:.176},{key:"7",x:.519,y:.03,w:.084,h:.176},{key:"9",x:.685,y:.03,w:.076,h:.176},{key:"0",x:.76,y:.03,w:.088,h:.176},{key:"Delete",x:.867,y:.03,w:.124,h:.176},{key:"q",x:.013,y:.213,w:.098,h:.186},{key:"w",x:.111,y:.213,w:.107,h:.186},{key:"e",x:.218,y:.213,w:.096,h:.186},{key:"r",x:.313,y:.213,w:.095,h:.186},{key:"t",x:.408,y:.213,w:.094,h:.186},{key:"y",x:.503,y:.213,w:.099,h:.186},{key:"u",x:.602,y:.213,w:.097,h:.186},{key:"i",x:.701,y:.213,w:.085,h:.186},{key:"o",x:.786,y:.213,w:.099,h:.186},{key:"p",x:.885,y:.213,w:.097,h:.186},{key:"a",x:.063,y:.408,w:.1,h:.182},{key:"s",x:.163,y:.408,w:.097,h:.182},{key:"d",x:.26,y:.408,w:.098,h:.182},{key:"f",x:.358,y:.408,w:.094,h:.182},{key:"g",x:.452,y:.408,w:.1,h:.182},{key:"h",x:.552,y:.408,w:.105,h:.182},{key:"j",x:.657,y:.408,w:.085,h:.182},{key:"k",x:.743,y:.408,w:.105,h:.182},{key:"l",x:.848,y:.408,w:.1,h:.182},{key:"z",x:.107,y:.596,w:.106,h:.197},{key:"x",x:.213,y:.596,w:.1,h:.197},{key:"c",x:.313,y:.596,w:.093,h:.197},{key:"v",x:.406,y:.596,w:.096,h:.197},{key:"b",x:.502,y:.596,w:.093,h:.197},{key:"n",x:.595,y:.596,w:.099,h:.197},{key:"m",x:.694,y:.596,w:.106,h:.197},{key:" ",x:.372,y:.798,w:.249,h:.169},{key:"Insert",x:.017,y:-.001,w:.038,h:.018}]}};if("undefined"==typeof AFRAME)throw new Error("Component attempted to register before AFRAME was available.");var i={roboto:17,aileronsemibold:20,dejavu:20.5,exo2bold:20,exo2semibold:20.3,kelsonsans:22.8,monoid:19.5,mozillavr:9.5,sourcecodepro:20.3};function a(e,t){for(var n=0;n<e.length;n++)if(e[n].id===t)return e[n];return null}if(AFRAME.registerComponent("super-keyboard",{schema:{align:{default:"left",oneOf:["left","center","right"]},blinkingSpeed:{type:"int",default:400},filters:{type:"array"},font:{default:"aileronsemibold"},hand:{type:"selector"},imagePath:{default:"."},injectToRaycasterObjects:{default:!0},inputColor:{type:"color",default:"#6699ff"},interval:{type:"int",default:50},keyBgColor:{type:"color",default:"#000"},keyColor:{type:"color",default:"#6699ff"},keyHoverColor:{type:"color",default:"#1A407F"},keyPressColor:{type:"color",default:"#5290F6"},label:{type:"string",default:""},labelColor:{type:"color",default:"#aaa"},maxLength:{type:"int",default:0},model:{default:"basic"},show:{default:!0},multipleInputs:{default:!1},value:{type:"string",default:""},width:{default:.8}},init:function(){this.el.addEventListener("click",this.click.bind(this)),this.changeEventDetail={},this.textInputObject={},this.keys=null,this.focused=!1,this.keyHover=null,this.prevCheckTime=null,this.shift=!1,this.rawValue=this.data.value,this.defaultValue=this.data.value,this.userFilterFunc=null,this.intervalId=0,this.kbImg=document.createElement("a-entity"),this.kbImg.classList.add("keyboardRaycastable"),this.kbImg.classList.add("superKeyboardImage"),this.kbImg.addEventListener("raycaster-intersected",this.hover.bind(this)),this.kbImg.addEventListener("raycaster-intersected-cleared",this.blur.bind(this)),this.el.appendChild(this.kbImg),this.label=document.createElement("a-entity"),this.label.setAttribute("text",{align:"center",font:this.data.font,baseline:"bottom",lineHeight:40,shader:"msdf",negate:!0,value:this.data.label,color:this.data.labelColor,width:this.data.width,wrapCount:30}),this.el.appendChild(this.label),this.textInput=document.createElement("a-entity"),this.textInput.setAttribute("mixin","superKeyboardTextInput"),this.textInput.setAttribute("text",{align:this.data.align,font:this.data.font,lineHeight:35,shader:"msdf",value:this.data.value,color:this.data.inputColor,width:this.data.width}),this.el.appendChild(this.textInput),this.cursor=document.createElement("a-entity"),this.cursor.object3D.position.set(0,0,.001),this.cursor.setAttribute("material",{shader:"flat",color:this.data.inputColor}),this.textInput.appendChild(this.cursor),this.cursorUpdated=!1,this.keyBgColor=new THREE.Color,this.keyHoverColor=new THREE.Color,this.keyPressColor=new THREE.Color;var e=this;document.addEventListener("keydown",(function(t){if("t"===t.key){for(var n="",r="abcdefghijklmopqrstuvQWIEUTGASDLIGKBXACQWETL102394676457",i=Math.floor(20*Math.random()),a=0;a<i;a++)n+=r[Math.floor(Math.random()*r.length)];e.el.setAttribute("super-keyboard",{value:n})}})),document.addEventListener("show",this.open.bind(this)),this.hand=null,this.handListenersSet=!1,this.raycaster=null},update:function(e){var t=r[this.data.model],n=this.data.width,i=this.data.width/2;if(void 0!==t){e&&this.defaultValue===e.defaultValue?this.updateTextInput(this.filter(this.rawValue)):(this.rawValue=this.data.value,this.defaultValue=this.data.value,this.updateTextInput(this.filter(this.data.value))),this.data.width===e.width&&this.data.height===e.height&&this.data.keyColor===e.keyColor||(this.kbImg.setAttribute("geometry",{primitive:"plane",width:n,height:i}),this.kbImg.setAttribute("material",{shader:"flat",src:this.data.imagePath+"/"+t.img,color:this.data.keyColor,transparent:!0})),this.data.label===e.label&&this.data.labelColor===e.labelColor&&this.data.width===e.width||(this.label.setAttribute("text",{value:this.data.label,color:this.data.labelColor,width:this.data.width}),this.label.object3D.position.set(0,.3*n,-.02)),this.data.width===e.width&&this.data.keyBgColor===e.keyBgColor||this.initKeyColorPlane();var a="center"!==this.data.align?t.inputOffsetX*n:0;"right"===this.data.align&&(a*=-1),this.data.font===e.font&&this.data.inputColor===e.inputColor&&this.data.width===e.width&&this.data.align===e.align||this.textInput.setAttribute("text",{font:this.data.font,color:this.data.inputColor,width:n,wrapCount:t.wrapCount,align:this.data.align});for(var o=0;o<t.layout.length;o++){var s=t.layout[o];"Insert"===s.key&&(this.inputRect=s)}this.textInput.object3D.position.set(a,n/4-(this.inputRect.y+this.inputRect.h/2)*n/2+t.inputOffsetY*n,.002),this.data.width!==e.width&&this.cursor.setAttribute("geometry",{primitive:"plane",width:.03*n,height:.01*n}),this.updateCursorPosition(),this.setupHand(),this.keyBgColor.set(this.data.keyBgColor),this.keyHoverColor.set(this.data.keyHoverColor),this.keyPressColor.set(this.data.keyPressColor),this.data.show?this.open():this.close()}else console.error('super-keyboard ERROR: model "'+this.data.model+'" undefined.')},tick:function(e){var t;if(!(this.prevCheckTime&&e-this.prevCheckTime<this.data.interval))if(this.prevCheckTime){if(this.raycaster&&this.focused&&(t=this.raycaster.getIntersection(this.kbImg)))for(var n=t.uv,i=r[this.data.model].layout,a=0;a<i.length;a++){var o=i[a];if(n.x>o.x&&n.x<o.x+o.w&&1-n.y>o.y&&1-n.y<o.y+o.h){this.keyHover!==o&&(this.keyHover=o,this.updateKeyColorPlane(this.keyHover.key,this.keyHoverColor));break}}}else this.prevCheckTime=e},play:function(){this.cursorUpdated&&this.startBlinking()},pause:function(){this.stopBlinking()},initKeyColorPlane:function(){var e=this.keyColorPlane=document.createElement("a-entity");e.classList.add("superKeyboardKeyColorPlane"),e.object3D.position.z=.001,e.object3D.visible=!1,e.setAttribute("geometry",{primitive:"plane"}),e.setAttribute("material",{shader:"flat",color:this.data.keyBgColor,transparent:!0}),e.addEventListener("componentinitialized",(function(e){"material"===e.detail.name&&(this.getObject3D("mesh").material.blending=THREE.AdditiveBlending)})),this.el.appendChild(e)},updateKeyColorPlane:function(e,t){var n=r[this.data.model],i=this.keyColorPlane;if(e){for(var a=0;a<n.layout.length;a++){var o=n.layout[a];if(o.key===e){var s=this.data.width,c=this.data.width/2,l=s/2,u=c/2,h=o.w*s,d=o.h*c;i.object3D.scale.x=h,i.object3D.scale.y=d,i.object3D.position.x=o.x*s-l+h/2,i.object3D.position.y=(1-o.y)*c-u-d/2,i.getObject3D("mesh").material.color.copy(t);break}}i.object3D.visible=!0}else i.object3D.visible=!1},setupHand:function(){if(this.hand&&this.hand.ownRaycaster&&this.hand.removeAttribute("raycaster"),this.data.hand?this.hand=this.data.hand:this.hand=document.querySelector(["[cursor]","[vive-controls]","[tracked-controls]","[gearvr-controls]","[oculus-go-controls]","[oculus-touch-controls]","[windows-motion-controls]","[hand-controls]","[daydream-controls] [cursor] > [raycaster]"].join(",")),this.hand){if(!this.hand.hasLoaded)return void this.hand.addEventListener("loaded",this.setupHand.bind(this));var e=this.hand.components.raycaster,t={};if(e){if(this.hand.ownRaycaster=!1,this.data.injectToRaycasterObjects){var n=e.data.objects.split(",");-1===n.indexOf(".keyboardRaycastable")&&n.push(".keyboardRaycastable"),t.objects=n.join(",").replace(/^,/,""),this.hand.setAttribute("raycaster",t)}}else this.hand.ownRaycaster=!0,t.showLine=this.data.show,t.enabled=this.data.show,this.data.injectToRaycasterObjects&&(t.objects=".keyboardRaycastable"),this.hand.setAttribute("raycaster",t);this.raycaster=this.hand.components.raycaster}else console.error('super-keyboard: no controller found. Add <a-entity> with controller or specify with super-keyboard="hand: #selectorToController".')},filter:function(e){if(""===e)return"";for(var t=0;t<this.data.filters.length;t++)switch(this.data.filters[t]){case"custom":this.userFilterFunc&&(e=this.userFilterFunc(e));break;case"allupper":e=e.toUpperCase();break;case"alllower":e=e.toLowerCase();break;case"title":e=e.split(" ").map((function(e){return e[0].toUpperCase()+e.substr(1)})).join(" ");break;case"numbers":e=e.split("").filter((function(e){return!isNaN(parseInt(e))||"."===e})).join("");break;case"first":e=e[0].toUpperCase()+e.substr(1);break;case"trim":e=e.trim()}return this.data.maxLength>0?e.substr(0,this.data.maxLength):e},click:function(e){if(this.keyHover){switch(this.keyHover.key){case"Enter":this.accept();break;case"Insert":return;case"Delete":this.rawValue=this.rawValue.substr(0,this.rawValue.length-1);var t=this.filter(this.rawValue);this.el.setAttribute("super-keyboard","value",t),this.updateTextInput(t),this.changeEventDetail.value=t,this.el.emit("superkeyboardchange",this.changeEventDetail);break;case"Shift":this.shift=!this.shift,this.keyHover.el.setAttribute("material","color",this.shift?this.data.keyHoverColor:this.data.keyBgColor);break;case"Escape":this.dismiss();break;default:if(this.data.maxLength>0&&this.rawValue.length>this.data.maxLength)break;this.rawValue+=this.shift?this.keyHover.key.toUpperCase():this.keyHover.key;t=this.filter(this.rawValue);this.el.setAttribute("super-keyboard","value",t),this.updateTextInput(t),this.changeEventDetail.value=t,this.el.emit("superkeyboardchange",this.changeEventDetail)}this.updateKeyColorPlane(this.keyHover.key,this.keyPressColor);var n=this;setTimeout((function(){n.updateKeyColorPlane(n.keyHover.key,n.keyHoverColor)}),100),this.updateCursorPosition()}},open:function(){this.el.object3D.visible=!0,this.hand&&this.hand.ownRaycaster&&this.hand.setAttribute("raycaster",{showLine:!0,enabled:!0})},close:function(){this.el.object3D.visible=!1,this.hand&&this.hand.ownRaycaster&&this.hand.setAttribute("raycaster",{showLine:!1,enabled:!1})},accept:function(){this.el.emit("superkeyboardinput",{value:this.data.value}),this.data.multipleInputs?(this.rawValue="",this.data.value="",this.updateTextInput("")):(this.el.object3D.visible=!1,this.hand&&this.hand.ownRaycaster&&this.hand.setAttribute("raycaster",{showLine:!1,enabled:!1}),this.data.show=!1)},dismiss:function(){this.data.value=this.defaultValue,this.updateTextInput(),this.el.object3D.visible=!1,this.hand&&this.hand.ownRaycaster&&this.hand.setAttribute("raycaster",{showLine:!1,enabled:!1}),this.el.emit("superkeyboarddismiss"),this.data.show=!1},blur:function(e){this.focused=!1,this.keyHover&&"Shift"!==this.keyHover.key&&this.updateKeyColorPlane(this.keyHover.key,this.keyBgColor),this.keyHover=null},hover:function(e){this.focused=!0},startBlinking:function(){this.stopBlinking(),this.intervalId=window.setInterval(this.blink.bind(this),this.data.blinkingSpeed)},stopBlinking:function(){window.clearInterval(this.intervalId),this.intervalId=0},blink:function(){this.cursor.object3D.visible=!this.cursor.object3D.visible},setCustomFilter:function(e){this.userFilterFunc=e},addCustomModel:function(e,t){e&&(r[e]=t)},updateCursorPosition:function(){var e=this.textInput.components.text.currentFont;if(!e){var t=this;return this.cursor.object3D.visible=!1,void window.setTimeout((function(){t.updateCursorPosition(),t.startBlinking()}),700)}var n=this.data.width,o=r[this.data.model],s=-this.inputRect.h/2*n/2.4+o.inputOffsetY*n,c=this.data.width/this.textInput.components.text.data.wrapCount,l=0,u=i[this.textInput.components.text.data.font];void 0===u&&(u=20);for(var h=0;h<this.data.value.length;h++){var d=a(e.chars,this.data.value.charCodeAt(h));l+=d.width+d.xadvance*(32===d.id?2:1)}"center"===this.data.align?l=l*c*u*.0011/2+.02*n:"left"===this.data.align?(l=l*c*u*.0011+.02*n,l-=n/2):"right"===this.data.align&&(l=-l*c*u*.0011-.02*n,l+=n/2),this.cursor.object3D.position.set(l,s,.001),this.cursorUpdated=!0},updateTextInput:function(e){this.textInputObject.value=e||this.data.value,this.textInput.setAttribute("text",this.textInputObject)}}),window.AFRAME){const t=["super-keyboard"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){const r=new THREE.Color;if(AFRAME.registerComponent("supercurve-color",{init:function(){const e=this.el;e.sceneEl.addEventListener("curveevenstageeventcolor",e=>{e.detail&&"off"!==e.detail?this.setColor("color1",e.detail):this.setColor("color1","primary")}),e.sceneEl.addEventListener("curveoddstageeventcolor",e=>{e.detail&&"off"!==e.detail?this.setColor("color2",e.detail):this.setColor("color2","secondary")})},setColor:function(e,t){const n=this.el.components.material.material.uniforms[e].value,i=this.el.sceneEl.systems.materials.scheme[t];r.set(i),n.x=r.r,n.y=r.g,n.z=r.b}}),window.AFRAME){const t=["supercurve-color"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){"use strict";n.r(t);var r=n(0),i=n.n(r);if(AFRAME.registerShader("supercurve",{schema:{cameraPercent:{type:"number",is:"uniform"},color1:{type:"color",is:"uniform",default:i.a.initial.primary},color2:{type:"color",is:"uniform",default:i.a.initial.secondary},fogColor:{type:"color",is:"uniform",default:i.a.initial.primary},side:{default:"double"},transparent:{default:!0}},fragmentShader:n(168),vertexShader:n(169),update:function(e){this.updateVariables(e,"attribute"),this.updateVariables(e,"uniform"),this.el.sceneEl.systems.materials.registerCurve(this.material)}}),window.AFRAME){const t=[],n=["supercurve"],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t){e.exports="varying vec2 vUvs;\nvarying vec3 vWorldPos;\nuniform vec3 color1;\nuniform vec3 color2;\nuniform vec3 fogColor;\nuniform float opacity;\n\n#define BLACK vec3(0.0)\n#define YELLOW vec3(250.0 / 255.0, 244.0 / 255.0, 180.0 / 255.0)\n\nvoid main() {\n vec3 col;\n\n // Lines.\n float f1 = clamp(sin(vUvs.x * 12.9 + 1.4) - 0.99, 0.0, 1.0) * 80.0;\n float f2 = clamp(sin(3.1416 + vUvs.x * 12.9 + 1.45) - 0.99, 0.0, 1.0) * 80.0;\n\n // Gradients.\n f1 += sin(vWorldPos.y - vWorldPos.x - vWorldPos.z * 0.4 + 1.4) * 0.1 + 0.1;\n f2 += sin(vWorldPos.y - vWorldPos.x - vWorldPos.z * 0.3 + 5.5) * 0.1 + 0.1;\n float f3 = sin(vWorldPos.y - vWorldPos.x - vWorldPos.z * 0.1 + 10.3) * 0.1 + 0.1;\n\n // Build color.\n col = mix(BLACK, color1, f1);\n col = mix(col, color2, f2);\n col = mix(col, YELLOW, f3);\n\n // Fog.\n float far = 100.0;\n float fog = 1.0 - clamp(length(vWorldPos - cameraPosition) / 400.0, 0.0, 1.0);\n\n col = mix(fogColor, col, fog);\n\n // fade beginning and end\n float alpha = 0.0;\n alpha += smoothstep(0.0, 0.003, vUvs.y);\n alpha -= smoothstep(0.997, 1.0, vUvs.y);\n\n gl_FragColor = vec4(col, alpha * (fog * fog));\n}\n"},function(e,t){e.exports="varying vec2 vUvs;\nvarying vec3 vWorldPos;\n\nvoid main() {\n vWorldPos = (modelMatrix * vec4(position, 1.0)).xyz;\n vUvs = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n"},function(e,t,n){n(171),n(172);const r=new THREE.Vector3,i=new THREE.Vector3;if(AFRAME.registerComponent("supercurve",{schema:{debug:{default:!1}},init:function(){this.buffers={},this.curve=null,this.fullLength=null,this.indexes={},this.length=null,this.points=[]},play:function(){this.generateCurve(1500)},generateCurve:function(e){this.length=e,e+=200,this.fullLength=e,this.points.length=0,this.points.push(new THREE.Vector3(0,0,0)),this.points.push(new THREE.Vector3(0,0,-100));let t,n=100;for(let r=2;r<=Math.ceil(e/100)-1;r++)t=this.points[r-1],n+=100,this.points.push(new THREE.Vector3(t.x+(10*Math.random()*2-10),t.y+(10*Math.random()*2-10),-1*n));const r=new THREE.CatmullRomCurve3(this.points),i=e-r.getLength(),a=r.getTangent(1,new THREE.Vector3),o=this.points[this.points.length-1].clone().add(a.multiplyScalar(i));this.points.push(o),this.setCurve(this.points),this.el.emit("supercurvegenerate")},setCurve:function(e){const t=this.buffers,n=(this.data,this.el),a=this.indexes;this.points=e;const o=this.curve=new THREE.CatmullRomCurve3(e),s=o.getLength(),c=o.getSpacedPoints(350),l=s/350,u=new THREE.BufferGeometry;t.position=new Float32Array(2106),t.normal=new Float32Array(2106),t.uvs=new Float32Array(1404),a.position=0,a.normal=0,a.uvs=0;const h=new THREE.Vector3(-1.5,0,-1*l/2),d=new THREE.Vector3(1.5,0,-1*l/2);for(let e=0;e<c.length;e++){const o=e/(c.length-1),s=c[e];if(0===c[e].x&&0===c[e].y&&0===c[e].z?(c[e].set(.001,0,.001),i.y=-1*Math.abs(i.y)):(i.copy(r).cross(c[e]).normalize(),i.y=-1*i.y),this.getPositionRelativeToTangent(o,h,r),t.position[a.position++]=r.x,t.position[a.position++]=r.y,t.position[a.position++]=r.z,t.normal[a.normal++]=i.x,t.normal[a.normal++]=i.y,t.normal[a.normal++]=i.z,t.uvs[a.uvs++]=0,t.uvs[a.uvs++]=o,this.getPositionRelativeToTangent(o,d,r),t.position[a.position++]=r.x,t.position[a.position++]=r.y,t.position[a.position++]=r.z,t.normal[a.normal++]=i.x,t.normal[a.normal++]=i.y,t.normal[a.normal++]=i.z,t.uvs[a.uvs++]=1,t.uvs[a.uvs++]=o,this.data.debug){const e=document.createElement("a-box");e.setAttribute("geometry",{width:.1,height:.1,depth:.1}),e.setAttribute("material",{shader:"flat",color:"#333"}),e.object3D.position.copy(s),e.object3D.position.y+=.1,n.appendChild(e)}}if(u.setAttribute("normal",new THREE.BufferAttribute(t.normal,3)),u.setAttribute("position",new THREE.BufferAttribute(t.position,3)),u.setAttribute("uv",new THREE.BufferAttribute(t.uvs,2)),n.getObject3D("mesh"))n.getObject3D("mesh").geometry=THREE.BufferGeometryUtils.toTrianglesDrawMode(u,THREE.TriangleStripDrawMode);else{const e=new THREE.Mesh(THREE.BufferGeometryUtils.toTrianglesDrawMode(u,THREE.TriangleStripDrawMode));n.setObject3D("mesh",e)}},getPointAt:function(e,t){e=this.songProgressToCurveProgress(e),this.curve.getPointAt(e,t)},getTangentAt:function(e,t){e=this.songProgressToCurveProgress(e),this.curve.getTangentAt(e,t)},getPositionRelativeToTangent:function(){const e=new THREE.Object3D,t=new THREE.Vector3,n=new THREE.Vector3;return function(r,i,a,o){this.curve;return e.parent||this.el.sceneEl.object3D.add(e),r<0?(this.getPointAt(0,e.position),this.getTangentAt(0,n),e.position.addScaledVector(n,r)):r>1?(this.getPointAt(1,e.position),this.getTangentAt(1,n),e.position.addScaledVector(n,r)):(this.getPointAt(r,e.position),this.getTangentAt(r,n)),o?e.lookAt(t.copy(e.position).sub(n)):e.lookAt(t.copy(e.position).add(n)),e.updateMatrixWorld(),a.copy(i),e.localToWorld(a),a}}(),alignToCurve:function(){new THREE.Vector3,new THREE.Vector3;const e=new THREE.Vector3(0,0,-.01),t=new THREE.Vector3;return function(n,r){this.getPositionRelativeToTangent(n,e,t),r.lookAt(t),r.position.y+=.01}}(),songProgressToCurveProgress:function(e){return e*this.length/this.fullLength},curveProgressToSongProgress:function(e){return e*this.fullLength/this.length}}),AFRAME.registerComponent("supercurve-follow",{schema:{enabled:{default:!1},speed:{type:"number"},target:{type:"selector"}},init:function(){this.curveProgress=0,this.songProgress=0},update:function(){this.supercurve=this.data.target.components.supercurve},tick:function(){new THREE.Vector3(0,0,1),new THREE.Vector3;return function(e,t){const n=this.data;this.el;if(!n.enabled||!t)return;if(this.curveProgress>=1)return;const r=this.supercurve,i=r.curve;if(!i)return;this.curveProgress=this.curveProgress||0;const a=n.speed*(t/1e3);if(this.curveProgress+=a/this.supercurve.fullLength,this.data.target.components.material.material.uniforms.cameraPercent.value=this.curveProgress,this.curveProgress>=1)return this.curveProgress=1,void(this.data.target.components.material.material.uniforms.cameraPercent.value=this.curveProgress);i.getPointAt(this.curveProgress,this.el.object3D.position),this.songProgress=r.curveProgressToSongProgress(this.curveProgress),r.alignToCurve(this.songProgress,this.el.object3D)}}()}),window.AFRAME){const t=["supercurve","supercurve-follow"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t){const n=THREE.Math,r=THREE.Vector3,i=THREE.Matrix4;function a(){this.type="Curve",this.arcLengthDivisions=200}var o,s,c;Object.assign(a.prototype,{getPoint:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null},getPointAt:function(e,t){var n=this.getUtoTmapping(e);return this.getPoint(n,t)},getPoints:function(e,t){var n;void 0===e&&(e=5),t?(n=t).length=0:n=[];for(var r=0;r<=e;r++)n.push(this.getPoint(r/e));return n},getSpacedPoints:function(e,t){var n;void 0===e&&(e=5),t?(n=t).length=0:n=[];for(var r=0;r<=e;r++)n.push(this.getPointAt(r/e));return n},getLength:(c=[],function(){var e=this.getLengths(void 0,c);return e[e.length-1]}),getLengths:function(e,t){if(void 0===e&&(e=this.arcLengthDivisions),this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1,t&&(t.length=0);var n,r,i=t||[],a=this.getPoint(0),o=0;for(i.push(0),r=1;r<=e;r++)o+=(n=this.getPoint(r/e)).distanceTo(a),i.push(o),a=n;return this.cacheArcLengths=i,i},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(e,t){var n,r=this.getLengths(),i=0,a=r.length;n=t||e*r[a-1];for(var o,s=0,c=a-1;s<=c;)if((o=r[i=Math.floor(s+(c-s)/2)]-n)<0)s=i+1;else{if(!(o>0)){c=i;break}c=i-1}if(r[i=c]===n)return i/(a-1);var l=r[i];return(i+(n-l)/(r[i+1]-l))/(a-1)},getTangent:(o=new THREE.Vector3,s=new THREE.Vector3,function(e,t){var n,r=e-1e-4,i=e+1e-4;return r<0&&(r=0),i>1&&(i=1),this.getPoint(r,o),this.getPoint(i,s),t?(n=t).copy(s).sub(o):n=s.clone().sub(o),n.normalize()}),getTangentAt:function(e,t){var n=this.getUtoTmapping(e);return this.getTangent(n,t)},computeFrenetFrames:function(e,t){var a,o,s,c=new r,l=[],u=[],h=[],d=new r,p=new i;for(a=0;a<=e;a++)o=a/e,l[a]=this.getTangentAt(o),l[a].normalize();u[0]=new r,h[0]=new r;var f=Number.MAX_VALUE,m=Math.abs(l[0].x),g=Math.abs(l[0].y),y=Math.abs(l[0].z);for(m<=f&&(f=m,c.set(1,0,0)),g<=f&&(f=g,c.set(0,1,0)),y<=f&&c.set(0,0,1),d.crossVectors(l[0],c).normalize(),u[0].crossVectors(l[0],d),h[0].crossVectors(l[0],u[0]),a=1;a<=e;a++)u[a]=u[a-1].clone(),h[a]=h[a-1].clone(),d.crossVectors(l[a-1],l[a]),d.length()>Number.EPSILON&&(d.normalize(),s=Math.acos(n.clamp(l[a-1].dot(l[a]),-1,1)),u[a].applyMatrix4(p.makeRotationAxis(d,s))),h[a].crossVectors(l[a],u[a]);if(!0===t)for(s=Math.acos(n.clamp(u[0].dot(u[e]),-1,1)),s/=e,l[0].dot(d.crossVectors(u[0],u[e]))>0&&(s=-s),a=1;a<=e;a++)u[a].applyMatrix4(p.makeRotationAxis(l[a],s*a)),h[a].crossVectors(l[a],u[a]);return{tangents:l,normals:u,binormals:h}},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this},toJSON:function(){var e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e},fromJSON:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}),THREE.Curve=a},function(e,t){const n=THREE.Vector3,r=THREE.Curve;function i(){var e=0,t=0,n=0,r=0;function i(i,a,o,s){e=i,t=o,n=-3*i+3*a-2*o-s,r=2*i-2*a+o+s}return{initCatmullRom:function(e,t,n,r,a){i(t,n,a*(n-e),a*(r-t))},initNonuniformCatmullRom:function(e,t,n,r,a,o,s){var c=(t-e)/a-(n-e)/(a+o)+(n-t)/o,l=(n-t)/o-(r-t)/(o+s)+(r-n)/s;i(t,n,c*=o,l*=o)},calc:function(i){var a=i*i;return e+t*i+n*a+r*(a*i)}}}var a=new n,o=new i,s=new i,c=new i;function l(e,t,n,i){r.call(this),this.type="CatmullRomCurve3",this.points=e||[],this.closed=t||!1,this.curveType=n||"centripetal",this.tension=i||.5}l.prototype=Object.create(r.prototype),l.prototype.constructor=l,l.prototype.isCatmullRomCurve3=!0,l.prototype.getPoint=function(e,t){var r,i,l,u,h=t||new n,d=this.points,p=d.length,f=(p-(this.closed?0:1))*e,m=Math.floor(f),g=f-m;if(this.closed?m+=m>0?0:(Math.floor(Math.abs(m)/p)+1)*p:0===g&&m===p-1&&(m=p-2,g=1),this.closed||m>0?r=d[(m-1)%p]:(a.subVectors(d[0],d[1]).add(d[0]),r=a),i=d[m%p],l=d[(m+1)%p],this.closed||m+2<p?u=d[(m+2)%p]:(a.subVectors(d[p-1],d[p-2]).add(d[p-1]),u=a),"centripetal"===this.curveType||"chordal"===this.curveType){var y="chordal"===this.curveType?.5:.25,v=Math.pow(r.distanceToSquared(i),y),b=Math.pow(i.distanceToSquared(l),y),w=Math.pow(l.distanceToSquared(u),y);b<1e-4&&(b=1),v<1e-4&&(v=b),w<1e-4&&(w=b),o.initNonuniformCatmullRom(r.x,i.x,l.x,u.x,v,b,w),s.initNonuniformCatmullRom(r.y,i.y,l.y,u.y,v,b,w),c.initNonuniformCatmullRom(r.z,i.z,l.z,u.z,v,b,w)}else"catmullrom"===this.curveType&&(o.initCatmullRom(r.x,i.x,l.x,u.x,this.tension),s.initCatmullRom(r.y,i.y,l.y,u.y,this.tension),c.initCatmullRom(r.z,i.z,l.z,u.z,this.tension));return h.set(o.calc(g),s.calc(g),c.calc(g)),h},l.prototype.copy=function(e){r.prototype.copy.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var i=e.points[t];this.points.push(i.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this},l.prototype.toJSON=function(){var e=r.prototype.toJSON.call(this);e.points=[];for(var t=0,n=this.points.length;t<n;t++){var i=this.points[t];e.points.push(i.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e},l.prototype.fromJSON=function(e){r.prototype.fromJSON.call(this,e),this.points=[];for(var t=0,i=e.points.length;t<i;t++){var a=e.points[t];this.points.push((new n).fromArray(a))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this},THREE.CatmullRomCurve3=l},function(e,t,n){if(AFRAME.registerShader("superCutFxShader",{schema:{startTime:{type:"float",is:"uniform"},timeMs:{type:"time",is:"uniform"},color:{type:"color",is:"uniform"}},vertexShader:"\n varying vec2 uvs;\n varying vec3 worldPos;\n void main() {\n uvs.xy = uv.xy;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n }\n ",fragmentShader:"\n uniform float startTime;\n uniform float timeMs;\n uniform vec3 color;\n varying vec2 uvs;\n varying vec3 worldPos;\n\n void main() {\n float time = (timeMs - startTime) / 2000.0;\n vec2 p = uvs.xy - 0.5;\n float r = p.x * p.x + p.y * p.y;\n float alpha = 1.0 - smoothstep(time - 0.01, time, r);\n alpha *= smoothstep(time - 0.1, time, r);\n alpha *= 1.0 - time * 5.5;\n gl_FragColor = vec4(color, alpha);\n }\n "}),window.AFRAME){const t=[],n=["superCutFxShader"],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){const r=new THREE.Color;if(AFRAME.registerComponent("supercutfx",{schema:{colorPrimary:{type:"string"},colorSecondary:{type:"string"}},init:function(){this.rigEl=document.getElementById("curveFollowRig"),this.startTime=-1100},createSuperCut:function(e,t){const n=this.el,i=this.el.getObject3D("mesh");i.material.transparent=!0,this.rigEl.object3D.worldToLocal(n.object3D.position.copy(e.position)),n.object3D.position.z-=.25,n.object3D.visible=!0,this.startTime=n.sceneEl.time,r.set("red"===t?this.data.colorPrimary:this.data.colorSecondary);const a=i.material.uniforms.color.value;a.x=r.r,a.y=r.g,a.z=r.b,i.material.uniforms.startTime.value=this.startTime-50,n.play()},tick:function(e){e>this.startTime+1e3&&(this.el.object3D.visible=!1,this.el.pause())}}),window.AFRAME){const t=["supercutfx"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("tail",{schema:{height:{default:.1},segments:{default:10,type:"int"},target:{type:"selector"},width:{default:1}},init:function(){const e=this.data,t=this.geometry=new THREE.PlaneBufferGeometry(e.width,e.height,e.segments,1);t.deleteAttribute("normal"),t.translate(e.width/2,0,0);const n=this.el.sceneEl.systems.materials.handStarTrail,r=new THREE.Mesh(t,n);r.frustumCulled=!1,this.el.setObject3D("mesh",r),this.positions=t.attributes.position.array,this.numVerts=2*e.segments+2,this.geometry=t,this.target=e.target.object3D,this.targetPos=new THREE.Vector3},tick:function(e,t){const n=this.positions,r=this.targetPos;let i,a=this.numVerts/2*3,o=this.data.height/2;for(let e=this.numVerts/2-1;e>0;e--)i=3*e,n[i]=n[i-3],n[i+1]=n[i-2],n[i+2]=n[i-1],i+=a,n[i]=n[i-3],n[i+1]=n[i-2],n[i+2]=n[i-1];this.target.getWorldPosition(r),n[0]=r.x,n[1]=r.y+o,n[2]=r.z-.1,n[a+0]=r.x,n[a+1]=r.y-o,n[a+2]=r.z-.1,this.geometry.attributes.position.needsUpdate=!0}}),window.AFRAME){const t=["tail"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("text-counter",{dependencies:["text"],schema:{decimals:{default:0},dur:{default:2e3,type:"int"},enabled:{default:!1},emit:{default:!1},prefix:{default:""},suffix:{default:""},value:{default:0,type:"float"}},init:function(){this.currentValue=0,this.hasCompleted=!1,this.textValue={value:""}},update:function(e){this.currentValue=0,this.textValue.value=`${this.data.prefix}${this.decimals(0)}${this.data.suffix}`,this.el.setAttribute("text",this.textValue),this.hasCompleted=!1},tick:function(e,t){this.data.enabled&&!this.hasCompleted&&(this.currentValue+=this.data.value*(t/this.data.dur),this.currentValue>=this.data.value&&(this.currentValue=this.data.value,this.data.emit&&this.el.emit("textcounterdone",null,!1),this.hasCompleted=!0),this.textValue.value=`${this.data.prefix}${this.decimals(this.currentValue)}${this.data.suffix}`,this.el.setAttribute("text",this.textValue))},decimals:function(e){var t=Math.pow(10,this.data.decimals);return(parseInt(e*t)/t).toFixed(this.data.decimals)}}),window.AFRAME){const t=["text-counter"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("text-truncate",{schema:{value:{type:"string"},length:{type:"int",default:10}},update:function(){this.el.setAttribute("text","value",function(e,t){if(!e)return"";if(e.length>=t)return e.substring(0,t-3)+"...";return e}(this.data.value,this.data.length))}}),window.AFRAME){const t=["text-truncate"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("text-uppercase",{schema:{value:{type:"string"}},update:function(){this.el.setAttribute("text","value",this.data.value.toUpperCase())}}),window.AFRAME){const t=["text-uppercase"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("toggle-pause-play",{schema:{isPlaying:{default:!1}},update:function(){const e=this.data.isPlaying?"pause":"play";parent.postMessage(JSON.stringify({verify:"game-action",action:e}),"*")}}),window.AFRAME){const t=["toggle-pause-play"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){"use strict";n.r(t);var r=n(0),i=n.n(r);if(AFRAME.registerComponent("trail",{schema:{color:{default:"primary"},colorScheme:{default:"default"},enabled:{default:!1},hand:{type:"string"}},init:function(){const e=this.geometry=new THREE.BufferGeometry,t=this.maxPoints=12,n=this.vertices=new Float32Array(36*t),r=this.colors=new Float32Array(48*t);this.bladeColor={alpha:1},this.rigContainer=document.getElementById("rigContainer"),this.bladeEl=this.el.querySelector(".blade"),this.layers=0,this.bladeTrajectory=[{top:new THREE.Vector3(-.5,0,0),center:new THREE.Vector3(0,0,0),bottom:new THREE.Vector3(.5,0,0)},{top:new THREE.Vector3(-.5,.5,0),center:new THREE.Vector3(0,.5,0),bottom:new THREE.Vector3(.5,.5,0)},{top:new THREE.Vector3(-.5,1,0),center:new THREE.Vector3(0,1,0),bottom:new THREE.Vector3(.5,1,0)}],this.newSample=null,e.setAttribute("position",new THREE.BufferAttribute(n,3).setUsage(THREE.DynamicDrawUsage)),e.setAttribute("vertexColor",new THREE.BufferAttribute(r,4).setUsage(THREE.DynamicDrawUsage));const i=new THREE.ShaderMaterial({side:THREE.DoubleSide,vertexColors:THREE.VertexColors,transparent:!0,depthTest:!1,blending:THREE.AdditiveBlending,vertexShader:["varying vec4 vColor;","attribute vec4 vertexColor;","void main() {","vec4 modelViewPosition = modelViewMatrix * vec4(position, 1.0);","vColor = vertexColor;","gl_Position = projectionMatrix * modelViewPosition;","}"].join(""),fragmentShader:["varying vec4 vColor;","uniform float pulse;","void main() {","gl_FragColor = vec4(vColor.xyz, vColor.a + pulse);","}"].join(""),uniforms:{pulse:{value:0}}}),a=this.mesh=new THREE.Mesh(e,i);a.frustumCulled=!1,a.vertices=n,this.rigContainer.setObject3D("trail__"+this.data.hand,a)},update:function(e){if(this.mesh.visible=this.data.enabled,!e.enabled&&this.data.enabled&&(this.enabledTime=this.el.sceneEl.time),e.colorScheme!==this.data.colorScheme){this.bladeColor=new THREE.Color(i.a.schemes[this.data.colorScheme][this.data.color]);this.bladeColor.red=this.bladeColor.r,this.bladeColor.green=this.bladeColor.g,this.bladeColor.blue=this.bladeColor.b}},tock:function(e,t){this.data.enabled&&(!this.mesh.visible&&e>this.enabledTime+250&&(this.mesh.visible=!0),this.mesh.material.uniforms.pulse.value*=.9,this.sampleBladePosition())},pulse:function(){this.mesh.material.uniforms.pulse.value=1},addLayer:function(e){const t=this.bladeColor,n=this.colors,r=this.segments,i=this.vertices;let a=2/r;this.layers>=this.maxLayers&&(this.layers=0);const o=this.layers*e;e=o+e;const s=this.layers*r*18,c=this.layers*r*24;for(let l=0;l<r;++l)i[s+18*l]=l*a-1,i[s+18*l+1]=o,i[s+18*l+2]=0,n[c+24*l]=t.red,n[c+24*l+1]=t.green,n[c+24*l+2]=t.blue,n[c+24*l+3]=t.alpha,i[s+18*l+3]=l*a-1,i[s+18*l+4]=e,i[s+18*l+5]=0,n[c+24*l+4]=t.red,n[c+24*l+5]=t.green,n[c+24*l+6]=t.blue,n[c+24*l+7]=t.alpha,i[s+18*l+6]=l*a-1+a,i[s+18*l+7]=e,i[s+18*l+8]=0,n[c+24*l+8]=t.red,n[c+24*l+9]=t.green,n[c+24*l+10]=t.blue,n[c+24*l+11]=t.alpha,i[s+18*l+9]=l*a-1+a,i[s+18*l+10]=o,i[s+18*l+11]=0,n[c+24*l+12]=t.red,n[c+24*l+13]=t.green,n[c+24*l+14]=t.blue,n[c+24*l+15]=t.alpha,i[s+18*l+12]=l*a-1,i[s+18*l+13]=o,i[s+18*l+14]=0,n[c+24*l+16]=t.red,n[c+24*l+17]=t.green,n[c+24*l+18]=t.blue,n[c+24*l+19]=t.alpha,i[s+18*l+15]=l*a-1+a,i[s+18*l+16]=e,i[s+18*l+17]=0,n[c+24*l+20]=t.red,n[c+24*l+21]=t.green,n[c+24*l+22]=t.blue,n[c+24*l+23]=t.alpha;this.layers++,this.geometry.attributes.position.needsUpdate=!0,this.geometry.attributes.vertexColor.needsUpdate=!0,this.geometry.attributes.uv.needsUpdate=!0},initGeometry:function(){const e=this.bladeColor,t=this.geometry.attributes.vertexColor.array,n=this.geometry.attributes.position.array,r=this.bladeTrajectory;let i,a,o;for(let s=1;s<r.length;s++){1===s&&(a=i),i=1-(r.length-s)/r.length;const c=r[s];o=r[s-1],n[36*s]=o.center.x,n[36*s+1]=o.center.y,n[36*s+2]=o.center.z,t[48*s]=e.red,t[48*s+1]=e.green,t[48*s+2]=e.blue,t[48*s+3]=.2*a,n[36*s+3]=c.top.x,n[36*s+4]=c.top.y,n[36*s+5]=c.top.z,t[48*s+4]=e.red,t[48*s+5]=e.green,t[48*s+6]=e.blue,t[48*s+7]=i,n[36*s+6]=o.top.x,n[36*s+7]=o.top.y,n[36*s+8]=o.top.z,t[48*s+8]=e.red,t[48*s+9]=e.green,t[48*s+10]=e.blue,t[48*s+11]=a,n[36*s+9]=o.center.x,n[36*s+10]=o.center.y,n[36*s+11]=o.center.z,t[48*s+12]=e.red,t[48*s+13]=e.green,t[48*s+14]=e.blue,t[48*s+15]=.2*a,n[36*s+12]=c.center.x,n[36*s+13]=c.center.y,n[36*s+14]=c.center.z,t[48*s+16]=e.red,t[48*s+17]=e.green,t[48*s+18]=e.blue,t[48*s+19]=.2*i,n[36*s+15]=c.top.x,n[36*s+16]=c.top.y,n[36*s+17]=c.top.z,t[48*s+20]=e.red,t[48*s+21]=e.green,t[48*s+22]=e.blue,t[48*s+23]=i,n[36*s+18]=o.bottom.x,n[36*s+19]=o.bottom.y,n[36*s+20]=o.bottom.z,t[48*s+24]=e.red,t[48*s+25]=e.green,t[48*s+26]=e.blue,t[48*s+27]=0,n[36*s+21]=c.center.x,n[36*s+22]=c.center.y,n[36*s+23]=c.center.z,t[48*s+28]=e.red,t[48*s+29]=e.green,t[48*s+30]=e.blue,t[48*s+31]=.2*i,n[36*s+24]=o.center.x,n[36*s+25]=o.center.y,n[36*s+26]=o.center.z,t[48*s+32]=e.red,t[48*s+33]=e.green,t[48*s+34]=e.blue,t[48*s+35]=.2*a,n[36*s+27]=o.bottom.x,n[36*s+28]=o.bottom.y,n[36*s+29]=o.bottom.z,t[48*s+36]=e.red,t[48*s+37]=e.green,t[48*s+38]=e.blue,t[48*s+39]=0,n[36*s+30]=c.bottom.x,n[36*s+31]=c.bottom.y,n[36*s+32]=c.bottom.z,t[48*s+40]=e.red,t[48*s+41]=e.green,t[48*s+42]=e.blue,t[48*s+43]=0,n[36*s+33]=c.center.x,n[36*s+34]=c.center.y,n[36*s+35]=c.center.z,t[48*s+44]=e.red,t[48*s+45]=e.green,t[48*s+46]=e.blue,t[48*s+47]=.2*i,a=i}this.geometry.attributes.position.needsUpdate=!0,this.geometry.attributes.vertexColor.needsUpdate=!0},sampleBladePosition:function(){let e;this.bladeTrajectory.length===this.maxPoints?(e=this.newSample=this.bladeTrajectory.shift(),e.top.set(0,-.5,0),e.center.set(0,0,0),e.bottom.set(0,.5,0)):this.newSample?(this.newSample.top.set(0,-.5,0),this.newSample.center.set(0,0,0),this.newSample.bottom.set(0,.5,0),e=this.newSample):e={top:new THREE.Vector3(0,-.5,0),center:new THREE.Vector3(0,0,0),bottom:new THREE.Vector3(0,.5,0)};const t=this.bladeEl.object3D;t.localToWorld(e.top),t.localToWorld(e.center),t.localToWorld(e.bottom),this.rigContainer.object3D.worldToLocal(e.top),this.rigContainer.object3D.worldToLocal(e.center),this.rigContainer.object3D.worldToLocal(e.bottom),this.bladeTrajectory.push(e),this.initGeometry()}}),window.AFRAME){const t=["trail"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("tunnels",{dependencies:["pool_tunnels"],schema:{isPlaying:{default:!1},songDuration:{default:0}},init:function(){this.addTunnel=this.addTunnel.bind(this),this.clearTunnels=this.clearTunnels.bind(this),this.curveEl=document.getElementById("curve"),this.curveFollowRig=document.getElementById("curveFollowRig"),this.timeout=0,this.tunnels=[],this.tick=AFRAME.utils.throttleTick(this.tick.bind(this),1e3),this.el.addEventListener("cleargame",this.clearTunnels),this.el.addEventListener("gamemenuexit",this.clearTunnels),this.el.addEventListener("gamemenurestart",this.clearTunnels)},update:function(e){!e.isPlaying&&this.data.isPlaying&&this.requestTunnel(),e.isPlaying&&!this.data.isPlaying&&this.timeout&&(clearTimeout(this.timeout),this.timeout=null)},play:function(){this.pool=this.el.components.pool__tunnels},requestTunnel:function(){this.timeout=setTimeout(this.addTunnel,Math.floor(3e3+1e4*Math.random()))},addTunnel:function(){const e=this.pool.requestEntity();if(!e)return;e.setAttribute("render-order","tunnel"),e.object3D.visible=!0;const t=this.curveEl.components.supercurve;let n=(this.el.components.song.getCurrentTime()+20)/this.data.songDuration;n>1&&(n=1),t.getPointAt(n,e.object3D.position),t.alignToCurve(n,e.object3D),e.play(),this.tunnels.push(e),this.requestTunnel()},clearTunnels:function(){this.timeout&&(clearTimeout(this.timeout),this.timeout=null);for(let e=0;e<this.tunnels.length;e++)this.tunnels[e].object3D.visible=!1,this.pool.returnEntity(this.tunnels[e]);this.tunnels.length=0},tick:function(e,t){if(0!=this.tunnels.length)for(let e=0;e<this.tunnels.length;e++){if(!(this.tunnels[e].object3D.position.z>this.curveFollowRig.object3D.position.z+5))return;{const t=this.tunnels.splice(e,1)[0];t.object3D.visible=!1,this.pool.returnEntity(t)}}}}),window.AFRAME){const t=["tunnels"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){var r=new THREE.Color;if(AFRAME.registerComponent("vertex-colors-buffer",{schema:{baseColor:{type:"color"},itemSize:{default:3}},update:function(e){var t,n,i,a,o=this.data,s=this.el,c=this;if((a=this.el.getObject3D("mesh"))&&a.geometry)if((i=a.geometry).attributes.position){for(i.attributes.color||i.setAttribute("color",new THREE.BufferAttribute(new Float32Array(i.attributes.position.array.length),3)),t=i.attributes.color.array,r.set(o.baseColor),n=0;n<t.length;n+=o.itemSize)t[n]=r.r,t[n+1]=r.g,t[n+2]=r.b;i.attributes.color.needsUpdate=!0}else console.warn("Geometry has no vertices",s);else s.addEventListener("object3dset",(function t(n){"mesh"===n.detail.type&&(s.removeEventListener("object3dset",t),c.update(e))}))}}),window.AFRAME){const t=["vertex-colors-buffer"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("victory-accuracy-ring",{dependencies:["geometry","material"],schema:{accuracy:{default:0}},update:function(){this.el.getObject3D("mesh").material.uniforms.progress.value=0,this.el.setAttribute("animation","to",this.data.accuracy/100),this.el.components.animation.beginAnimation()}}),window.AFRAME){const t=["victory-accuracy-ring"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){const r={sphericalEnvMap:"",roughness:.8,metalness:.4},i={sphericalEnvMap:"#envmapImg",roughness:.2,metalness:.6};if(AFRAME.registerComponent("victory-rank",{schema:{isVictory:{default:!1},rank:{type:"string"}},update:function(e){const t=this.el,n=this.data.rank;if(e.isVictory&&!this.data.isVictory&&this.el.object3D.scale.set(.001,.001,.001),n)switch(t.setAttribute("text-geometry","value",n),n[0]){case"S":t.setAttribute("material",Object.assign({color:"#F0e077"},i));break;case"A":t.setAttribute("material",Object.assign({color:"#6FF9EA"},i));break;case"B":t.setAttribute("material",Object.assign({color:"#F8d"},i));break;case"C":t.setAttribute("material",Object.assign({color:"#F971C3"},r));break;case"D":t.setAttribute("material",Object.assign({color:"#1E6269"},r));break;case"F":t.setAttribute("material",Object.assign({color:"#e3170a"},r))}}}),window.AFRAME){const t=["victory-rank"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){if(AFRAME.registerComponent("visible-raycastable",{schema:{default:!0},update:function(){this.el.object3D.visible=this.data,this.data?this.el.setAttribute("raycastable",""):this.el.removeAttribute("raycastable","")}}),window.AFRAME){const t=["visible-raycastable"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){const r=n(0);if(AFRAME.registerShader("wallShader",{schema:{colorTertiary:{type:"color",is:"uniform",default:r.initial.tertiary},environment:{type:"map",is:"uniform",default:"#envmapImg"},hitLeft:{type:"vec3",is:"uniform",default:{x:0,y:9e3,z:0}},hitRight:{type:"vec3",is:"uniform",default:{x:0,y:9e3,z:0}},iTime:{type:"time",is:"uniform"},opacity:{type:"number",is:"uniform"}},vertexShader:n(187),fragmentShader:n(188)}),window.AFRAME){const t=[],n=["wallShader"],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t){e.exports="varying vec2 uvs;\nvarying vec3 nrml;\nvarying vec3 worldPos;\n\nvoid main() {\n uvs.xy = uv.xy;\n nrml.xyz = normal.xyz;\n vec4 p = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n worldPos = (modelMatrix * vec4( position, 1.0 )).xyz;\n gl_Position = p;\n}\n"},function(e,t){e.exports="uniform float iTime;\nuniform float opacity;\nuniform sampler2D environment;\nuniform vec3 colorTertiary;\nuniform vec3 hitLeft;\nuniform vec3 hitRight;\nvarying vec2 uvs;\nvarying vec3 nrml;\nvarying vec3 worldPos;\n\n#define SEED 19.1252\n#define time (3.0 + iTime) / 1000.0\n\nfloat noise(vec3 uv) {\n return fract(sin(uv.x*123243. + uv.y*424. + uv.z*642. + SEED) * 1524.);\n}\n\nvec4 drawHit(vec3 p, vec3 center, vec3 color) {\n center.z -= 0.1;\n float dist = 1.0 - smoothstep(0.0, 0.3, length(p - center));\n float glitch = noise(floor(p*3.0)) * 0.06 - 0.03;\n float alpha = 1.0 - smoothstep(0.0, 0.01, abs(p.z-center.z + glitch));\n alpha += 1.0 - smoothstep(0.0, 0.01, abs(p.y-center.y + glitch));\n return vec4(color * dist, alpha * dist + alpha);\n}\n\nvoid main() {\n vec2 uv1 = uvs.xy-0.5;\n float alpha = 0.0;\n // border\n alpha += smoothstep(0.44, 0.50, abs(uv1.x));\n alpha += smoothstep(0.44, 0.50, abs(uv1.y));\n alpha += smoothstep(0.486, 0.49, abs(uv1.x));\n alpha += smoothstep(0.486, 0.49, abs(uv1.y));\n alpha = min(1.0, alpha * 0.5);\n\n // weapon collision\n vec4 hit;\n hit = drawHit(worldPos, hitRight, colorTertiary);\n hit += drawHit(worldPos, hitLeft, colorTertiary);\n\n // reflection\n vec3 ray = reflect(normalize(cameraPosition - worldPos + sin(worldPos.z) * 0.1 + cos(worldPos.z * 0.3) * 0.3), nrml);\n float m = 2.0 * sqrt(pow(ray.x, 2.0) + pow(ray.y, 2.0) + pow(ray.z, 2.0));\n vec2 uv = ray.xy / m + 0.5;\n vec3 col = texture2D(environment, uv).rgb * 0.3;\n\n gl_FragColor = vec4(mix(col, colorTertiary, alpha) + hit.rgb, (alpha * 0.2 + 0.8) * opacity + hit.a);\n}\n"},function(e,t,n){"use strict";n.r(t);n(21);if(AFRAME.registerComponent("wall",{dependencies:["material"],init:function(){this.curveEl=document.getElementById("curve"),this.curveFollowRig=document.getElementById("curveFollowRig"),this.el.setObject3D("mesh",new THREE.Mesh),this.geometry=null,this.isCeiling=!1,this.isRaycastable=!1,this.localPosition=new THREE.Vector3,this.songPosition=void 0,this.tick=AFRAME.utils.throttleTick(this.tick.bind(this),1e3)},play:function(){this.el.object3D.visible=!0},tick:function(e,t){const n=this.curveFollowRig.components["supercurve-follow"].songProgress;!this.isRaycastable&&n+.01>=this.songPosition&&(this.isRaycastable=!0,this.el.setAttribute("data-wall-active",""),this.isCeiling||(this.el.setAttribute("data-weapon-particles",""),this.el.setAttribute("raycastable-game",""))),n>=this.backPosition+.01&&this.returnToPool()},onGenerate:function(e,t,n,r,i,a){const o=this.el;this.isCeiling=i,this.backPosition=a,this.songPosition=e,this.setWallGeometry(e,t,n,r,i),o.getObject3D("mesh").material.uniforms.opacity.value=0,o.object3D.position.y=-5,o.components.animation__fadein.beginAnimation(),o.components.animation__scalein.beginAnimation()},setWallGeometry:function(){const e=new THREE.Vector3,t=new THREE.Vector3,n=new THREE.Vector3;return function(r,i,a,o,s){const c=this.el.sceneEl.components["beat-system"],l=this.curveEl.components.supercurve,u=r,h=r+o/l.length,d=s?1.5:2.5,p=-1*c.horizontalPositions[i]-a/2+.25;t.x=p-a/2,n.x=p+a/2;const f=(this.geometry=new THREE.BoxBufferGeometry(a,d,1,1,1,30)).attributes.position.array;for(let r=0;r<f.length;r+=3){const i=f[r+2]+.5;l.getPositionRelativeToTangent(u+i*(h-u),f[r]<0?t:n,e),f[r]=e.x,f[r+1]+=e.y+d/2,f[r+2]=e.z}let m=c.verticalPositions.middle+c.size/2;"punch"===c.data.gameMode&&(m-=.1),this.el.getObject3D("mesh").geometry=this.geometry,this.el.getObject3D("mesh").position.y=s?m:.1}}(),returnToPool:function(){this.el.object3D.visible=!1,this.el.removeAttribute("data-weapon-particles"),this.el.removeAttribute("data-wall-active"),this.el.removeAttribute("raycastable-game"),this.isCeiling=!1,this.isRaycastable=!1,this.el.isPlaying&&this.el.sceneEl.components.pool__wall.returnEntity(this.el),this.geometry&&this.geometry.dispose()}}),window.AFRAME){const t=["wall"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){const r={direction:{x:0,y:-.25,z:-1}},i={direction:{x:0,y:1,z:-1}};if(AFRAME.registerComponent("weapon-particles",{schema:{enabled:{default:!1},gameMode:{default:""},hand:{type:"string"}},init:function(){this.hiddenIntersection={x:999,y:0,z:0},this.intersectedEl=null,this.weaponEnter=this.weaponEnter.bind(this),this.weaponLeave=this.weaponLeave.bind(this)},update:function(e){e.gameMode!==this.data.gameMode&&this.el.setAttribute("raycaster__game","punch"===this.data.gameMode?r:i)},pause:function(){this.el.removeEventListener("mouseenter",this.weaponEnter),this.el.removeEventListener("mouseleave",this.weaponLeave)},play:function(){this.el.addEventListener("mouseenter",this.weaponEnter),this.el.addEventListener("mouseleave",this.weaponLeave)},weaponEnter:function(e){this.data.enabled&&e.target===this.el&&e.detail.intersectedEl.hasAttribute("data-weapon-particles")&&(this.intersectedEl=e.detail.intersectedEl)},weaponLeave:function(e){if(e.detail.target===this.el){if(this.intersectedEl.components.wall||"floor"===this.intersectedEl.id){const e=this.data.hand===RIGHT?"hitRight":"hitLeft";this.intersectedEl.getObject3D("mesh").material.uniforms[e].value=this.hiddenIntersection}this.intersectedEl=null}},tick:function(e,t){if(!this.data.enabled||!this.intersectedEl)return;const n=this.el.components.raycaster__game.getIntersection(this.intersectedEl);if(n&&(this.intersectedEl.components.wall||"floor"===this.intersectedEl.id)){const e="right"===this.data.hand?"hitRight":"hitLeft";this.intersectedEl.getObject3D("mesh").material.uniforms[e].value=n.point}}}),window.AFRAME){const t=["weapon-particles"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){AFRAME.registerComponent("zip-loader",{schema:{difficulties:{type:"array"},isLoading:{default:"false"},version:{type:"string"},directDownload:{type:"string"},bpm:{type:"number"}},init:function(){this.loadingIndicator=document.getElementById("zipLoaderIndicator"),this.cachedZip=null,this.cachedVersion=null,this.message={},this.worker=new Worker("build/zip.js"),this.worker.onmessage=this.onMessage.bind(this),this.worker.onerror=console.error},update:function(e){const t=this.data;e.version&&e.version!==t.version&&this.cachedVersion!==t.version&&(this.message.abort=!0,this.message.difficulties=JSON.stringify(this.data.difficulties),this.message.version=e.version,this.message.directDownload=this.data.directDownload,this.message.bpm=this.data.bpm,this.message.hash=this.data.hash,this.worker.postMessage(this.message)),t.version&&e.version!==t.version&&(this.cachedVersion=null,this.cachedZip=null,this.fetchZip(t.version)),e.isLoading||!this.data.isLoading||this.cachedVersion!==this.data.version||this.cachedZip||this.el.emit("songloaderror")},fetchZip:function(e){this.el.emit("ziploaderstart",null,!1),this.message.abort=!1,this.message.difficulties=JSON.stringify(this.data.difficulties),this.message.version=e,this.message.directDownload=this.data.directDownload,this.message.bpm=this.data.bpm,this.message.hash=this.data.hash,this.worker.postMessage(this.message)},onMessage:function(e){switch(e.data.message){case"error":this.el.emit("songloaderror");break;case"progress":if(e.data.version!==this.data.version)return;this.loadingIndicator.setAttribute("material","progress",e.data.progress);break;case"load":{let t;this.cachedVersion=e.data.version,this.cachedZip=e.data.data;const n=e.data.data.beats;for(t in n)break;if(!t)return this.cachedZip=null,void(e.data.version===this.data.version&&this.el.emit("songloaderror"));e.data.version===this.data.version&&this.el.emit("ziploaderend",e.data.data,!1);break}}}});if(window.AFRAME){const t=["zip-loader"],n=[],r=[];if(e.hot.dispose(e=>{e.needsReplace=!0,t.forEach(e=>{delete AFRAME.components[e];const t=AFRAME.scenes[0].querySelectorAll(`[${e}]`);for(let n=0;n<t.length;n++)t[n].isEntity&&(t[n].setAttribute("data-__hot-"+e,JSON.stringify(t[n].getDOMAttribute(e))),t[n].removeAttribute(e))}),n.forEach(e=>{delete AFRAME.shaders[e];const t=AFRAME.scenes[0].querySelectorAll("[material]");for(let n=0;n<t.length;n++)t[n].isEntity&&t[n].getAttribute("material").shader===e&&(t[n].setAttribute("data-__hot-material",JSON.stringify(t[n].getDOMAttribute("material"))),t[n].removeAttribute("material"))}),r.forEach(e=>{delete AFRAME.systems[e],delete AFRAME.scenes[0].systems[e]})}),e.hot.data&&e.hot.data.needsReplace){t.forEach(e=>{const t="data-__hot-"+e,n=document.querySelectorAll(`[${t}]`);for(let r=0;r<n.length;r++)n[r].setAttribute(e,JSON.parse(n[r].getAttribute(t)),!0),n[r].removeAttribute(t)});const e="data-__hot-material",n=document.querySelectorAll(`[${e}]`);for(let t=0;t<n.length;t++)n[t].setAttribute("material",JSON.parse(n[t].getAttribute(e)),!0),n[t].removeAttribute(e)}e.hot.accept()}},function(e,t,n){var r={"./index.js":193};function i(e){var t=a(e);return n(t)}function a(e){if(!n.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}i.keys=function(){return Object.keys(r)},i.resolve=a,e.exports=i,i.id=192},function(e,t,n){"use strict";n.r(t);var r=n(0),a=n.n(r);n(6);const o=n(28),s={};let c=!1;const l={Easy:"Easy",Expert:"Expert",ExpertPlus:"Expert+",Hard:"Hard",Normal:"Normal"},u={},h={author:"Juancho Pancho",difficulty:"Expert",id:"31",image:"assets/img/molerat.jpg",songDuration:100,songName:"Friday",songLength:100,songSubName:"Rebecca Black"},d="true"===AFRAME.utils.getUrlParameter("skipintro"),p=localStorage.getItem("colorScheme")||"blue";let f=localStorage.getItem("favorites-v2");if(f)try{f=JSON.parse(f)}catch(e){f=[]}else f=[];function m(e){let t=Math.ceil(e.search.results.length/6);e.search.hasPrev=e.search.page>0,e.search.hasNext=e.search.page<t-1,e.search.songNameTexts="",e.search.songSubNameTexts="",e.searchResultsPage.length=0,e.searchResultsPage.__dirty=!0;for(let t=6*e.search.page;t<6*e.search.page+6;t++){const n=e.search.results[t];if(!n)break;e.searchResultsPage.push(n),e.search.songNameTexts+=g(n.metadata.songName,22).toUpperCase()+"\n",e.search.songSubNameTexts+=g(n.metadata.songSubName||n.metadata.songAuthorName||"Unknown Artist",32)+"\n"}for(let t=0;t<e.searchResultsPage.length;t++)e.searchResultsPage[t].index=t;E(e)}function g(e,t){return e?e.length>=t?e.substring(0,t-3)+"...":e:""}AFRAME.registerState({nonBindedStateKeys:["genres"],initialState:{activeHand:localStorage.getItem("hand")||"right",challenge:{audio:"",author:"",difficulty:"",beatmapCharacteristic:"",id:AFRAME.utils.getUrlParameter("challenge"),image:"",isBeatsPreloaded:!1,numBeats:void 0,songDuration:0,songName:"",songNameShort:"",songSubName:"",metadata:{}},colorPrimary:a.a.schemes[p].primary,colorScheme:p,colorSecondary:a.a.schemes[p].secondary,colorSecondaryBright:a.a.schemes[p].secondarybright,colorTertiary:a.a.schemes[p].tertiary,controllerType:"",damage:0,difficultyFilter:"All",difficultyFilterMenuOpen:!1,favorites:f,gameMode:"ride",genre:"",genres:n(194),genreMenuOpen:!1,has3DOFVR:!1,has6DOFVR:!1,hasSongLoadError:!1,hasVR:AFRAME.utils.device.checkHeadsetConnected()||"true"===AFRAME.utils.getUrlParameter("debugvr"),introActive:!d,inVR:"true"===AFRAME.utils.getUrlParameter("debugvr"),isIOS:AFRAME.utils.device.isIOS(),isGameOver:!1,isLoading:!1,isMenuOpening:!d,isPaused:!1,isPlaying:!1,isSearching:!1,isSongProcessing:!1,isVictory:!1,isZipFetching:!1,leaderboard:[],leaderboardFetched:!1,leaderboardQualified:!1,leaderboardNames:"",leaderboardScores:"",mainMenuActive:!1,menuActive:d,menuDifficulties:[],menuDifficultiesIds:[],menuSelectedChallenge:{author:"",difficulty:"",beatmapCharacteristic:"",downloads:"",downloadsText:"",genre:"",id:"",index:-1,image:"",isFavorited:!1,numBeats:void 0,songDuration:0,songInfoText:"",songLength:void 0,numBeats:void 0,songName:"",songSubName:"",version:"",metadata:{}},optionsMenuOpen:!1,playlist:"",playlists:n(195),playlistMenuOpen:!1,playlistTitle:"",score:{accuracy:100,accuracyScore:0,accuracyInt:100,activePanel:!1,beatsHit:0,beatsMissed:0,beatsText:"",combo:0,finalAccuracy:100,maxCombo:0,rank:"",score:0},search:{activePanel:!0,page:0,hasError:!1,hasNext:!1,hasPrev:!1,query:"",queryText:"",results:[],songNameTexts:"",songSubNameTexts:"",url:"",urlPage:0},searchResultsPage:[],speed:10},handlers:{activehandswap:e=>{e.activeHand="right"===e.activeHand?"left":"right",localStorage.setItem("activeHand",e.activeHand)},beathit:(e,t)=>{e.damage>.25&&(e.damage-=.25),e.score.beatsHit++,e.score.combo++,e.score.combo>e.score.maxCombo&&(e.score.maxCombo=e.score.combo),t.score=isNaN(t.score)?100:t.score,e.score.accuracyScore+=t.percent,e.score.score+=Math.floor(t.score),M(e)},beatmiss:e=>{e.score.beatsMissed++,w(e),M(e)},beatwrong:e=>{e.score.beatsMissed++,w(e),M(e)},beatloaderpreloadfinish:e=>{e.menuActive||(e.challenge.isBeatsPreloaded=!0)},colorschemechange:(e,t)=>{e.colorScheme=t,e.colorPrimary=a.a.schemes[t].primary,e.colorSecondary=a.a.schemes[t].secondary,e.colorSecondaryBright=a.a.schemes[t].secondarybright,e.colorTertiary=a.a.schemes[t].tertiary,localStorage.setItem("colorScheme",t)},controllerconnected:(e,t)=>{e.controllerType=t.name,e.has6DOFVR=-1!==["oculus-quest-controls","oculus-touch-controls","vive-controls","windows-motion-controls","generic-tracked-controller-controls"].indexOf(e.controllerType),e.has3DOFVR=-1!==["oculus-go-controls","daydream-controls"].indexOf(e.controllerType)},debugbeatpositioning:e=>{e.gameMode="classic",e.introActive=!1,e.menuActive=!1},debuggameplay:e=>{A(e),Object.assign(e.challenge,e.menuSelectedChallenge),e.menuActive=!1,e.menuSelectedChallenge.id="",e.isSearching=!1,e.isLoading=!1},debuggameover:e=>{e.isGameOver=!0,e.menuActive=!1},debugloading:e=>{h.id="-1",Object.assign(e.menuSelectedChallenge,h),Object.assign(e.challenge,h),e.menuActive=!1,e.isSongProcessing=!0},debugvictory:e=>{Object.assign(e.menuSelectedChallenge,h),Object.assign(e.challenge,h),e.isVictory=!0,e.leaderboardQualified=!0,e.menuActive=!1,e.score.accuracy=74.99,e.score.beatsHit=125,e.score.beatsMissed=125,e.score.maxCombo=123,e.score.rank="A",e.score.score=9001,e.introActive=!1,x(e)},difficultyfilter:(e,t)=>{e.difficultyFilter=t,e.difficultyFilterMenuOpen=!1,e.menuSelectedChallenge.id=""},difficultyfiltermenuclose:e=>{e.difficultyFilterMenuOpen=!1},difficultyfiltermenuopen:e=>{e.difficultyFilterMenuOpen=!0},displayconnected:e=>{if(e.hasVR=!0,!c)try{"getVRDisplays"in navigator&&navigator.getVRDisplays().then(e=>{e.length&&(c=!0)})}catch(e){}},favoritetoggle:e=>{const t=e.menuSelectedChallenge.id,n=s[t];if(n)if(e.menuSelectedChallenge.isFavorited){e.menuSelectedChallenge.isFavorited=!1;for(let n=0;n<e.favorites.length;n++)if(e.favorites[n].id===t)return e.favorites.splice(n,1),void localStorage.setItem("favorites-v2",JSON.stringify(e.favorites))}else{if(e.menuSelectedChallenge.isFavorited=!0,e.favorites.filter(e=>e.id===t).length)return;e.favorites.push(n),localStorage.setItem("favorites-v2",JSON.stringify(e.favorites))}},gamemenuresume:e=>{e.isPaused=!1},gamemenurestart:e=>{A(e),e.challenge.isBeatsPreloaded=!1,e.isGameOver=!1,e.isPaused=!1,e.isLoading=!0,e.isVictory=!1,e.leaderboardQualified=!1},gamemenuexit:e=>{A(e),e.challenge.isBeatsPreloaded=!1,e.isGameOver=!1,e.isPaused=!1,e.isVictory=!1,e.menuActive=!0,e.menuSelectedChallenge.id=e.challenge.id,e.menuSelectedChallenge.difficulty=e.challenge.difficulty,e.menuSelectedChallenge.beatmapCharacteristic=e.challenge.beatmapCharacteristic,e.menuSelectedChallenge.difficultyId=e.challenge.difficultyId,e.challenge.id="",e.leaderboardQualified=!1},gamemode:(e,t)=>{e.gameMode=t},genreclear:e=>{e.genre="",e.menuSelectedChallenge.id=""},genreselect:(e,t)=>{e.genre=t,e.genreMenuOpen=!1,e.menuSelectedChallenge.id="",e.playlist="",e.search.query=""},genremenuclose:e=>{e.genreMenuOpen=!1},genremenuopen:e=>{e.genreMenuOpen=!0},keyboardclose:e=>{e.isSearching=!1},keyboardopen:e=>{e.isSearching=!0,e.menuSelectedChallenge.id=""},leaderboard:(e,t)=>{e.leaderboard.length=0,e.leaderboardFetched=!0,e.leaderboardNames="",e.leaderboardScores="";for(let n=0;n<t.scores.length;n++){let r=t.scores[n];e.leaderboard.push(r),e.leaderboardNames+=`#${n+1} ${g(r.username,18)} (${Math.round(r.accuracy||0)}%)\n`,e.leaderboardScores+=r.score+"\n"}e.leaderboardLoading=!1},leaderboardqualify:e=>{e.has6DOFVR&&(e.leaderboardQualified=!0)},leaderboardscoreadded:(e,t)=>{for(let n=0;n<e.leaderboard.length;n++)if(t.scoreData.score>=e.leaderboard[n].score||n>=e.leaderboard.length-1){e.leaderboard.splice(n,0,t.scoreData);break}e.leaderboardNames="",e.leaderboardScores="";for(let t=0;t<e.leaderboard.length;t++){let n=e.leaderboard[t];e.leaderboardNames+=`${n.username} (${n.accuracy||0}%)\n`,e.leaderboardScores+=n.score+"\n"}},leaderboardsubmit:e=>{e.leaderboardQualified=!1},menuback:e=>{e.difficultyFilterMenuOpen=!1,e.genreMenuOpen=!1,e.isSearching=!1,e.optionsMenuOpen=!1,e.playlistMenuOpen=!1},menuchallengeselect:(e,t)=>{let n=s[t];if(!n)return;Object.assign(e.menuSelectedChallenge,n),e.menuSelectedChallenge.songName=g(n.metadata.songName,24),e.menuDifficulties.length=0,e.menuDifficultiesIds.length=0;const r=JSON.parse(n.metadata.characteristics);for(const t of Object.keys(r))if(!["90Degree","360Degree"].includes(t))for(const n of Object.keys(r[t])){if(null===r[t][n])continue;let i=l[n],a=i;"Standard"!==t&&(a=t+"\n"+a),e.menuDifficulties.unshift({id:t+"-"+n,filename:n+t,difficultyName:i,renderName:a,beatmapCharacteristic:t,difficulty:n})}e.menuDifficulties.sort(b);for(const t of e.menuDifficulties)e.menuDifficultiesIds.push(t.id);const i=e.menuDifficulties[0];e.menuSelectedChallenge.difficulty=i.difficulty,e.menuSelectedChallenge.beatmapCharacteristic=i.beatmapCharacteristic,e.menuSelectedChallenge.difficultyId=i.id,e.menuSelectedChallenge.image=e.menuSelectedChallenge.coverURL,S(e,n),e.challenge.audio="",E(e),e.isSearching=!1;const a=!!e.favorites.filter(e=>e.id===t).length;e.menuSelectedChallenge.isFavorited=a,_(e),e.leaderboardLoading=!0,e.hasSongLoadError=!1,u[t]&&(e.hasSongLoadError=!0)},menuchallengeunselect:e=>{e.menuSelectedChallenge.id="",e.menuSelectedChallenge.difficultyId="",e.menuSelectedChallenge.difficulty="",e.menuSelectedChallenge.beatmapCharacteristic="",_(e)},menudifficultyselect:(e,t)=>{let n;for(const r of e.menuDifficulties)if(r.id===t){n=r;break}e.menuSelectedChallenge.difficultyId=t,e.menuSelectedChallenge.difficulty=n.difficulty,e.menuSelectedChallenge.beatmapCharacteristic=n.beatmapCharacteristic,S(e,e.menuSelectedChallenge),_(e),e.leaderboardLoading=!0},menuopeningend:e=>{e.isMenuOpening=!1},minehit:e=>{w(e)},optionsmenuopen:e=>{e.optionsMenuOpen=!0},pausegame:e=>{e.isPlaying&&(e.isPaused=!0)},playbuttonclick:e=>{if(""===e.menuSelectedChallenge.id)return;if(u[e.menuSelectedChallenge.id])return;let t="frontpage";e.playlist&&(t="playlist"),e.search.query&&(t="search"),e.genre&&(t="genre"),gtag("event","songsource",{event_label:t}),A(e),Object.assign(e.challenge,e.menuSelectedChallenge),gtag("event","difficulty",{event_label:e.challenge.difficulty}),e.menuActive=!1,e.menuSelectedChallenge.id="",e.menuSelectedChallenge.difficulty="",e.menuSelectedChallenge.beatmapCharacteristic="",e.isSearching=!1,e.isLoading=!0,e.loadingText="Loading...",gtag("event","colorscheme",{event_label:e.colorScheme})},playlistclear:(e,t)=>{e.menuSelectedChallenge.id="",e.playlist=""},playlistselect:(e,t)=>{e.genre="",e.menuSelectedChallenge.id="",e.playlist=t.id,e.playlistTitle=t.title,e.playlistMenuOpen=!1,e.search.query=""},playlistmenuclose:e=>{e.playlistMenuOpen=!1},playlistmenuopen:e=>{e.playlistMenuOpen=!0},searcherror:(e,t)=>{e.search.hasError=!0},searchprevpage:e=>{0!==e.search.page&&(e.search.page--,m(e))},searchnextpage:e=>{e.search.page>Math.floor(e.search.results.length/6)||(e.search.page++,m(e),void 0!==e.search.url&&e.search.page+3>Math.floor(e.search.results.length/6)&&(e.search.urlPage=e.search.urlPage+1,fetch(e.search.url.replaceAll("CURRENT_PAGE_INDEX",e.search.urlPage)).then(e=>e.json()).then(t=>{var n=(t.docs||t.maps).map(o);for(e.search.results.push(...n),i=0;i<n.length;i++){let e=n[i];s[e.id]=e}})))},searchresults:(e,t)=>{var n;for(e.search.hasError=!1,e.search.page=0,e.search.url=t.url,e.search.urlPage=t.urlPage,e.search.query=t.query,e.search.queryText=g(t.query,10),e.search.results=t.results||[],n=0;n<e.search.results.length;n++){let t=e.search.results[n];s[t.id]=t}m(e),e.menuSelectedChallenge.id="",e.isSearching&&(e.genre="",e.playlist="")},songcomplete:e=>{if(gtag("event","songcomplete",{event_label:e.gameMode}),"ride"===e.gameMode||!e.inVR)return e.challenge.isBeatsPreloaded=!1,e.isVictory=!1,e.menuActive=!0,void(e.challenge.id="");e.isVictory=!0,e.score.score=isNaN(e.score.score)?0:e.score.score,M(e),e.score.finalAccuracy=e.score.accuracy;const t=parseFloat(e.score.accuracy);e.score.rank=t>=97?"S":t>=90?"A":t>=80?"B":t>=70?"C":t>=60?"D":"F",x(e)},songloadcancel:e=>{e.challenge.isBeatsPreloaded=!1,e.challenge.audio="",e.challenge.id="",e.challenge.version="",e.isZipFetching=!1,e.isLoading=!1,e.isSongProcessing=!1,e.menuActive=!0},songloaderror:e=>{u[e.menuSelectedChallenge.id||e.challenge.id]=!0,e.hasSongLoadError=!0,e.loadingText="Sorry! There was an error loading this song.\nPlease select another song.",e.challenge.id="",e.challenge.isBeatsPreloaded=!1,e.isSongProcessing=!1,e.isZipFetching=!1},songprocessfinish:e=>{e.isSongProcessing=!1,e.isLoading=!1},songprocessstart:e=>{e.isSongProcessing=!0,e.loadingText="Wrapping up..."},"enter-vr":e=>{e.inVR=AFRAME.utils.device.checkHeadsetConnected(),AFRAME.utils.device.isMobile()||(gtag("event","entervr",{}),AFRAME.utils.device.isOculusBrowser()&&gtag("event","oculusbrowser",{}))},"exit-vr":e=>{e.inVR=!1,e.isPlaying&&(e.isPaused=!0)},startgame:e=>{e.introActive=!1,e.menuActive=!0},victoryfake:e=>{e.score.accuracy="74.99",e.score.rank="C"},wallhitstart:e=>{w(e)},ziploaderend:(e,t)=>{e.challenge.audio=t.audio,e.hasSongLoadError=!1,e.menuSelectedChallenge.version="",e.isZipFetching=!1},ziploaderstart:e=>{e.challenge.isBeatsPreloaded=!1,e.isZipFetching=!0}},computeState:e=>{e.isPlaying=!(e.menuActive||e.isLoading||e.isPaused||e.isVictory||e.isGameOver||e.isZipFetching||e.isSongProcessing||!e.challenge.id||e.introActive);const t=e.menuActive||e.isPaused||e.isVictory||e.isGameOver||e.isLoading||e.introActive;e.leftRaycasterActive=t&&"left"===e.activeHand&&e.inVR,e.rightRaycasterActive=t&&"right"===e.activeHand&&e.inVR,e.mainMenuActive=e.menuActive&&!e.genreMenuOpen&&!e.difficultyFilterMenuOpen&&!e.playlistMenuOpen&&!e.optionsMenuOpen&&!e.isSearching,e.score.active="ride"!==e.gameMode&&e.inVR&&(e.isPlaying||e.isPaused)}});const y=["easy","normal","hard","expert","expertPlus"],v=["Standard"];function b(e,t){const n=y.indexOf(e.difficulty),r=y.indexOf(t.difficulty);if(n<r)return-1;if(n>r)return 1;const i=v.indexOf(e.beatmapCharacteristic),a=v.indexOf(t.beatmapCharacteristic);return i>a?-1:i<a?1:0}function w(e){e.isPlaying&&e.inVR&&(e.score.combo=0)}function A(e){e.damage=0,e.score.accuracy=100,e.score.accuracyInt=100,e.score.accuracyScore=0,e.score.beatsHit=0,e.score.beatsMissed=0,e.score.finalAccuracy=100,e.score.combo=0,e.score.maxCombo=0,e.score.score=0}function E(e){e.menuSelectedChallenge.index=-1;for(let t=0;t<e.searchResultsPage.length;t++)if(e.searchResultsPage[t].id===e.menuSelectedChallenge.id){e.menuSelectedChallenge.index=t;break}}function x(e){e.score.beatsText=`${e.score.beatsHit} / ${e.score.beatsMissed+e.score.beatsHit} BEATS`}function _(e){e.leaderboard.length=0,e.leaderboard.__dirty=!0,e.leaderboardNames="",e.leaderboardScores="",e.leaderboardFetched=!1}function S(e,t){let n=JSON.parse(t.metadata.characteristics)[e.menuSelectedChallenge.beatmapCharacteristic][e.menuSelectedChallenge.difficulty];e.menuSelectedChallenge.songInfoText=`Mapped by ${g(t.metadata.levelAuthorName,55)}\n${t.genre&&"Uncategorized"!==t.genre?t.genre+"\n":""}${function(e){e/=60;const t=""+Math.floor(e);var n=Math.round(60*(e-t));return n<10&&(n="0"+n),`${t}:${n}`}(t.metadata.duration)} / ${n.notes} notes\n${n.bombs} bombs | ${n.obstacles} obstacles\nNJS: ${n.njs}`}function M(e){const t=e.score.beatsHit+e.score.beatsMissed;e.score.accuracy=e.score.accuracyScore/(100*t)*100,e.score.accuracy=isNaN(e.score.accuracy)?100:e.score.accuracy,e.score.accuracy=e.score.accuracy.toFixed(2),e.score.accuracyInt=parseInt(e.score.accuracy)}},function(e,t){e.exports=[{name:"Pop",row:1,column:1},{name:"R&B",row:1,column:2},{name:"Rap",row:1,column:3},{name:"Rock",row:1,column:4},{name:"Soundtrack",row:1,column:5},{name:"Video Games",row:1,column:6},{name:"Electronic",row:2,column:1},{name:"Hip Hop",row:2,column:2},{name:"House",row:2,column:3},{name:"J-Pop",row:2,column:4},{name:"K-Pop",row:2,column:5},{name:"Meme",row:2,column:6},{name:"Alternative",row:3,column:1},{name:"Anime",row:3,column:2},{name:"Comedy",row:3,column:3},{name:"Dubstep",row:3,column:5},{name:"Dance",row:3,column:6}]},function(e,t){e.exports=[{name:"favorites",author:"You!",title:"Your Saved Favorites"},{name:"3966",author:"BeastSaber",title:"Songs With Fantastic Flow Vol. 1"},{name:"3967",author:"BeastSaber",title:"Songs With Fantastic Flow Vol. 2"},{name:"3968",author:"BeastSaber",title:"Songs With Fantastic Flow Vol. 3"},{name:"4134",author:"BeastSaber",title:"Songs With Fantastic Flow Vol. 4"},{name:"4135",author:"BeastSaber",title:"Songs With Fantastic Flow Vol. 5"},{name:"7483",author:"BeastSaber",title:"Maps Of The Weeks"},{name:"4137",author:"BeastSaber",title:"Curator's Picks of 2020"},{name:"4139",author:"BeastSaber",title:"Curator's Picks of 2021"},{name:"11584",author:"BeastSaber",title:"Curator's Picks of 2022"},{name:"4405",author:"BeastSaber",title:"Intro to Dance"},{name:"4138",author:"BeastSaber",title:"Mom's Maps"}]},function(e,t,n){var r=n(18);"string"==typeof r&&(r=[[e.i,r,""]]);var i={hmr:!0,transform:void 0,insertInto:void 0},a=n(201)(r,i);r.locals&&(e.exports=r.locals),e.hot.accept(18,(function(){var t=n(18);if("string"==typeof t&&(t=[[e.i,t,""]]),!function(e,t){var n,r=0;for(n in e){if(!t||e[n]!==t[n])return!1;r++}for(n in t)r--;return 0===r}(r.locals,t.locals))throw new Error("Aborting CSS HMR due to changed css-modules locals.");a(t)})),e.hot.dispose((function(){a()}))},function(e,t){e.exports=function(e){return"string"!=typeof e?e:(/^['"].*['"]$/.test(e)&&(e=e.slice(1,-1)),/["'() \t\n]/.test(e)?'"'+e.replace(/"/g,'\\"').replace(/\n/g,"\\n")+'"':e)}},function(e,t){e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=function(e,t){var n=e[1]||"",r=e[3];if(!r)return n;if(t&&"function"==typeof btoa){var i=(o=r,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */"),a=r.sources.map((function(e){return"/*# sourceURL="+r.sourceRoot+e+" */"}));return[n].concat(a).concat([i]).join("\n")}var o;return[n].join("\n")}(t,e);return t[2]?"@media "+t[2]+"{"+n+"}":n})).join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var r={},i=0;i<this.length;i++){var a=this[i][0];"number"==typeof a&&(r[a]=!0)}for(i=0;i<e.length;i++){var o=e[i];"number"==typeof o[0]&&r[o[0]]||(n&&!o[2]?o[2]=n:n&&(o[2]="("+o[2]+") and ("+n+")"),t.push(o))}},t}},function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAU0AAAGDCAMAAACYzLIyAAACWFBMVEUAAAAAkP8AkP8AkP8AkP8AkP8AkP8AkP8AkP8AkP8AkP8BkP8AkP8AkP8AkP8AkP8Bkf8AkP8AkP8Dkf8BkP8BkP8Bkf8Vj/y44P8Rl///drb/drZx/+n/drZx/+n/drb/drZx/+n/drf/drZw/+pu/upx/+n/drdx/+lWtv//drb/drbL6f9w/+r+drdx/+n/drZw/+pu/utx/+ll9exMsv9x/+lx/+lw/+r/drb/drb/drb8drf+drdx/+nh8v9q+uzR7P9w/+phu//e8f8wpf9s++qJzP8Ek/9w/urZ7v9v/url9P9x/+n9drf/drb9drdDrv9x/+l2w/9uwf9u/eps++px/+mt3P//drY7qv//drZ7xv/2d7ml2P9x/+knov9x/+m+4//W7f+03/9I1/H8drf/drYru/iZ0/+AyP/B5P//drZx/+kXp/tpvv/t9/86yvX/draU0P8gnv/+drbp9v//drZ+g9xx/+mSgdZK2fHF5v9x/+nWe8Py+f8Xp/uQz///drYbnP/3/P+f1f9x/+kVpfsxwPZO3vD/drbfecArjPMwi/IktPncesBx/+lV5e9Wh+dx/+khjfY9iu5+g9ucgNMajvhx/+mDyf8Kmv6+fcmOgte4fcr/dra5fcpGiexOiOkpjPSwfs1J2PEVpfuIgtkpufcouPj/drb/drbteLzSe8MPoPyof89KiesPoPzreLxghuQ8y/Rx/+n/drZx/+kktPnGfMc9zfNLierleb64fctd7O3oeL1x/+n/drZb6vj/////drZx/+lv/exr+vEkKZq9AAAAw3RSTlMAeUKEWG9nmlCMKho2YJMVCkolDyEwOgbfoXqEZ5R3Zm6EN0xPI4xUk7iNROZEH1qcLjacCbRgbT8qYFoVP3zxFepKvO+rD8ygVu0p83EPdTCxOsPCHRng2uCuJcUK1+2poeHt3Q8Zox7Rx+LvmEC+9xazz6cG9cVD8g8i5Lkm+SvN6qX806lINy+sQGRXLzfASDW0XEwhFWf4yFIvLBrmIVRDQjYpYjYlUdjPbF5YThhsU0xJx7rOW1RBKUlCPGTZ+uxEzOy6AABDfElEQVR42uycz05iSRTGZ2zaK9oiyP9HuAlb1oQAoUPYEFkQQowBN8pCEw0rE2NsX6Jfhxeb+nu/W/dUUVywp3smfGaSnhm7+9SvvnOq6lThXwcddNBBBx100EEHHXTQ/1dVKfYL8XXQrhzzxQuiIlNeijP+jxGuCnPkDUUDqv6ykeQ5ybOzUulSqyR1FgmAdSx/INiqAKix6YjPrJJD+fQQFMnL09NyufxNqqx0GiliDLgg+1vQgmAE0MRXUu44NYQB8bF8LtFqUZP8VqkcWVThijOO2CbJ/mto4UAABD/g4+bQqiQkhsMHAqKfgPKCoWQkBcjCSUKFk4JUgm/E9jSG1qwIn12cYEAHQM0P8IygC1psUBgRGwmI7ssSKDnITOac6ZjpHMpEigE2nAuyFtcCraa7HV+sHrQAugEa9LQ3Mg6J0YDonjzzjGWEMsMxfhX6+++vho6FANlgywSyEVomghZ0FWGIAVO64F8GO1IACUAnPxkuj/vYKjEWEAXP3YzJWLI/SaJkFJm+GPob+sq/TLwgC7RGPTAKAuhiMaMqSV1KRb+tDH4OgOAHdCpcETuEEYmhRETBc0djMpYFFgdHyUFms9lcXFmIMJZsCVmgBVvDtsZiRlVWwuIBfFsANPCZ3sgmpIcSEd2DZ14Yk7EEylwQBL3mw9Ws359djR86YXM07U0DCIQB17CtURAIWs6WqgIdWSUWDvBzAxQy6eWEAof4aMQQROgxnvnUMIUxOUvlyiBo9petNdGP18dht92YT67v+vdXnXA01YAJWiSQja1WcsNwor/ELyOBHfh5AFJ+YdgZz/pvd9eT2/lLo90edFut1nA47C4aL/Pr/jj8HkREwbN0VkwFs8hgCmMKliyGYPrWXm+r4YDB/XibPYSjUcy2IGthaxR/LY4pjkyvG2AHfG6AhN99/25yu2wPho/+odz+7Eii4MntWaymgMlLpjImz/Bev7HeUY+tdqPGbHvVaY6QQVwGW7qUQQliICe+gM/lwGYzHN+/fUzmjUWL8vNr+PHQ+R7nWUG2bwXz8rRypIzJWALlfnplpl3eCrRhs0nQgi0IQxQb4AFfDOCMObD20u6uPiP04Rg8GU6S7X6Yyphg+bladdsvtclHfzYGWuAVhDlkUzmgM1aPUZNnMCuAt0s48FM1fNA8o2zfEmZZw2T18tfApAWB1/1btpS9sbVszLwLwoZGTE2ObvazLxYPRq+LAvgrNZT5/lVm+3Y48wZMsPwN+vHjx+vr4+NqOGQL7Wr1+Mr+w/p3ahh+z3Gc5wpnfput0R8C80/UkONkPAXO0kV1i32mhvm9vT4oifM9kNl+wmonct0HMxs8d9cHEa1Ytiuc5c2ls3pxBpi91fogm1oC53nGVzqLZ0jz6ev6oA04UTqd1iyVjwqqZrbWNrUn/auHsPNwxTYoT3yHUls2xBHt/yDWcli1uNarVw/OLErnZmueu1fzWg+ba7P1Uq8/T5v8BMwPcN3/Ro1gh94XdjITx4dp771eNwc07Uxart8aBqJ0FljpdJkzr6zpgFmb1gO2eyXCOYVLx9JrdmZ9djJZDNd/kIaLxu31089xOOpJeOgjUuXYOJpPbetEPMvSCXPSPNfWzFpgtkOGMiu6p0rOIzTYRrYNx/2732Ta4YB3XRjA6bMGCHwwh7UlIIi+12y5HjCcMKcrz4U1e9SYQU6ijPpl7BfiS+grRWwYN27aUXjF+xGNwWe7FhksHHjPAN5ogOBH6dF+1Vc5IEk0F9RrNpzZjeZUeQ5rmjC/SJQZ0qxFt5b0u0GWoIVr75+ub18Wrdfd6Q15/4QXwAfJzwswjo7bQinZSD0Wtw4Onh2rOZHol3oJCtemur1AHU8zJwV6k8CVQAy2IOtGq9m+30ybohn+9DFhu4X5fPnSYA3xxaDb7Q4W7XajsZzXbieT6+uPJ7Z2dFj1Y/A0PSQwADr4GfBOINyoF+RY2BgUT4KzazcnEr1yZF2CGu+ydSJRiiuwb5C+sqnYr7koWTda9Cm9QlsU+NwGpHfT9HJafknJwaiLb9XlfU4m7BjmtCY6r5o0zxeBPugLlOJ69hI3sNY7WMAFWQPtOWELup57RAjswM8LMIaPacMVaZmNhAMVPGFPak4ciMhe80s2uQRNoybUtzJ/QnIBmdfcArKMQs0sMgimpWhhW+D1Ceho/aP3zLjahCEZSAEw+dwPAxJjETyVPecmmCtpzool1bHX7CcXoKzKct6+vyjK+6UqF148crE3NppkQQGLl3f9CsXz8MLcLVCp/2l7uhOvfjCgiAZFJ/EkBgYpSmE88lkg56nsmavbzMmaH6WLPFmDsNckq7lq3pcuJEoqwZKhlCRF2IbdzFcoRj2AcSBjccWX+Hfr2gF8yGAzGi4Y2QimzHgWi/bHv5KntGc2meth7otahxKVM88TXVhzav6Outj08yzHPZ2dpQw+o98rJRMTr1AK3BRlvBcCWgEXKjDKkGIGgR593kSjcQdzBJ7WoTEyah+ewPkUSKN9wyYJK3pBrEEvNM/FysX+PjvMvGSp39jI90rJJUStGGIQaginqLVKxpuYCv8i4v9Vy3yNiwJIohHh2IMRQAVP1/iYPy/Leu9Yp6l+LMyZJ2VTJPqNeZ4Mcho/Si3521T0Inh9Isup7XlPtxP4bkYOQg5BjsB4ZqnpArBLtrfiF0IkGrYc63ACvTnNIRg1uzL3ig634FxjmrPJcep1iNJM7txDmefuw31eZILeSOjYg/ro6mPeja7EXhe1p3GvLonqIUSOqEaVH5sFn+KvEvHo3xVNr9OftFuizfa6arGuYgfBsGgUz1OnPc8uxZmbmPNHL1qHyCLEvz14MqtmlOf2mpmXVtDRf5Ek+8u1VbUZH4QaAhyRtzxz9anKREdti6Z3X9sQDAOqeSIYV6uSmnPG1yFdOOkiFMwTVXNjnhfNt188+CaJnbRIxRDgCEzUjkKapI2m1mRANU+9bdncq2yaW07QtC5Cg3VMPVE1keckfLz9QnPAp8aMDQGOwAj2EdIE0TxvE03tWfNkwSDbaa4rc9ZdNL2LUJtZU31z3hk+Tl5+lvA8HOEawY5PJNNHUxP+lME4s73IzUnP3eONNM1j5SRQ5/pS0Rm+sgKJ3uPPEI7ACPaGWUgbDXiqYFylpxiVwpqdprGkX6olvbOOqc8THVXTHj5aAqk0H0lHYAT7w6QNilTJgmxHMHRhud7oTZwrjxnNWaIhKtZ/kLeHnwuaL+vUqt0EOTKCPWAiTULc5aRJFpXtCMakWbFk+gMIEZpoeeAcit2UM3xYIS1PMoI9YaY3Jr1eIMF4aCLT6Xbzbh3TCDS94e8/grPi3jBFxVzuGMxSvCcETgfNtrtu4pWhrSpgp09rMsJ/N2Zrx3qF6rwnzNruwXSnQY7iTE8TNXayjulZ0yyS3dd+4UMvfDnFeeu3wUSuIFX2pmlGU5c0T0HTOBl4w18s5xP+/LfR9Y7gfLfSiTzxRzMctBvLRrs79OMkqeKnWTW/90h879JDE2Y43xh++7o/GsWfpc8WG0eA9PIrfZ50WZ8DD7/Dh/6kuxEnTZV8tLJ8OM5CvhXrVfabjmB6I7Pc4bf7U9314pItMUZ04RpBNs1KlDZPum8MpP5ETXTpHD61UqSKddfjpxkf8CrI4hbJkllZe/jtn7yvYd4oCqQM6NjqiRuSXims6cmTbshQmtGICeZAW06cmNu9aLbigUQ08/bMmtpYdkTw8rrgGFe9fBDcoQvb79lxJUI0gElYGtFwxZ7EdFr2VMHcUpo/vTTRQloZg7TQjD/xHNDor2T0+tpF61x/9JX5c+FML/ghVZ4786Q7FhswFY0Ox3gSc2VZk6aWucVp8Z72NylNFhSP6XUNNUCTtKaM62XwV9Hrz3QX8GRCfixbjGA0sOOEH3bI8zqlMjCikTfr7B/jSYzt1W/3O51bP01fQ24e6O5mPmFNZBbN2Ph7pYq6MFP3h1HnETgtt3nFnfKcnIBWTRKN1JG+zdSn+kdyKiJzSzsZoHm8Hc1b0CTWRGaRo8S5vuPFdaL+cRbRCAb29DpPZ87ihjwf1APVtMwkoynLaDKq4xQ8tzxzi/cGSZr3oOlrb16DJu3ov1uMibdfFf6EAi9R9I9aKWSiptPQ5ustzUmrTkhgKmNyluLFz2UpFgyPRvCUk0uzPUzOLWhe0Z4lpSm/dbSO6U7QROed3DYRGgKmjF7+oCsl9WOA9AhEvRpQP6Q0ZxFVp01hCmOqaEoyGgRzxniiU09xNsjcRjTHW9M05/gtwLcm61SPwMQHEEX0xTz5uUolNQKV7cmtZz0awIWPI606FKY0pj0aRpTzFMmicHrmFv30By9NtN4dRcFXp9po/FZE9FXXzwOqRIa4ed3PnKg6dQtMfPLZGk1V8FSTC5zuuQUiYriMSbMKGzu3pubr46bt013k7Zd1BNoQ2aDpHEBxL2sCZqW8KRoxucDpnlt3+t4RmnQzRS8yUDVlnXqhCzLCBwsLTxgCt81kAIjNraLLmsO6iMb/EyPyfHI5TqSKa279NPOpLjIQvy3Pszr8EsJ3vFrShrBslJ7J9T0VYnZZsxkAJoxpn1zgzAahe25BM5GWH5rmWd57kZEFTSP+uqVoKpg6fJ8hMvI41SUD2HYdQqI8J/M8C5i+WYnjTOb6O+bWSfMaNFNeZCD+0L7xrnj6k8j26Kg/TmTXtqnuTpQuphYwvThlxVg55jZOMztybMnTXWTQ+JHnpEngtZW9dM6kHSreVHcnyhifdgZMD06VKsHMPbc44BiNswloprrIcMc/Jf1AL4mS8AO1ecOwg1MImWwvBtHUAqYXZ9me66McUIFmb3uaczdNxD8m1tR5Xt22kSb9QM15k8WmzOfvii1RwhRTSz8R+WCmOrrlLpq3dpoVAcrsxChMKi4aPzZ3aRu9qnRSa/2EHfxlE4liWvM8Q6bWnyqZc2rOeqzUFX2NIc8l2w/Q3BD/fco+L/xgM+ectFR9ZbNHrCnzHFO71c8sUubsmJmCwpmOJj5CYNLMKJo4L4kyDPWwBPnMQH9KA+oGrS5bls2ZxZqY2rRz+31oHgbBykszzZUl4jd3+AuJHPGnHABSne5xqSwR18ixOd3UwunYcNPCuT/NR3zgwPieOdlwoU6lM+cJUt3RlHGXzVNb2WnmvqS3JrbSODeSTNmJZttO0x1/Ty3CjjrlX5TRfqW3J25hhaU0T1JYk7R9QlvhLO9Fk16n00UI2yNHZvp3SUh1euvspWnrjw2MSp9ubplXsKrTTsVONBdraAiaznPqJMDhJaVIqvuXIXebBvsr91T46zA+4UM7vLvQHNhp+u9FUsePVA+WjuYAke8o3BFlM23ZwR+I4dFj+EV6mkZPpxVPujzaTO4WqF/+l+QdJBeRZ9lE2Uwfjb1wNoAgBU3fwxmnG6apy2b6lz2QZ/qHqcum72Zs8Hk0B3aaNUdephWtHah9oOk7pf/D3pnsphEEYTi77Sw2MUmARxhprpwRYhAR8gUNB4SQZYEvhgOWQD5ZiiySl8jr5MXSK383RdMzwwx2lkoUJ5HiFF9X9VJdXXXhGv4cliG4Z96e7j8uZXeuPtmAJ6PJV7BbT96URzxLxx02iV6aaRIO/VvS7M7Vcty0pN28h7nQbG63lrM8T5b+ZT+nqQrLaGqaM/lP96QZbg+jeeKb3ogctn7/rG0aBpX8XghLzLWDZqHz5vxJzZuRY9703ACnuBf6v6aXMPa+IA3uLH9sR/Vn7DfvitxvejMOfXUo8DDwXz0L3YOmd+zT5Hr48xf/9nM6rMnzBhioHA+q/5AYUidzDKnsiyHRBA73K2lvjpwzvikXvceLbwY5xDcBwB3fJN5A5pY0+Zvu2PvzvyD2LllhdOiuBjTHPpr+3GLnvVD/9C+5F1JD23LcC5F1j1ySQ5Cy5Dg2Oe8sw7zvLE/3ubNcpLuzxHeDozvuLNOcBXGkd5zUCrxPnz/6fbpO9oBv0vt00Iw8cQpytqAngUPlesweI9eDJiLRXA9MLf41k9gxMZQD5SF1HiUPCUlyrjykVHEWegqnCZxwrri4HLn2vjlyrWw5cirXue/KkXNsIqp0B0IrA9D1/6D5m8ep8jd7OeVv0ncZQzgKDR/SgJzzUQbdcP4xucVx1txi+DmtolchgOh+zr3hpFukPybvvfE1W947/VgdPHGhzkuLpHi3SBNMHMnfZDw79JuMVUFvMmp6Dn9XJgsLOXk6JvXIsah53wvhiUvm90JXytGfzHshOYefkYCqJwToYD+E59lv2ULi6+T12KO9ZbtdmdqAJ1XGesvW/k7esmFo3dtNerCk8WJ6GNjZ5aVBXjb631m+PNA7S4wunXI87ywxtHhyTkI02G46o0h0x+V7A4xnq0nfAC9vD/EGWIxuaXuV4M/kDbCj+AANANN3gf5lCBPnGcwBHQscT6o/S56+9+ndQ7xPV2+qNVA8Txfvqd3v01tW8YQybl3cNVL8NHtY13y1E0i1gkPWTggdtRPUe/9zrU5Zl05Qb/1dtRPu7cIeWH+b7iXd39mhg8rFqOuBt6IEp7Oux6fNuh6NA9T10KP75b1WB2U9vqxLmW+r4lM3is6QvaGfJk5qcxK+VMbsqznTXR6d0Joz57rMi6fmTC+3mjPQRo4u1LFKzhzrgkJH7e01ZxAYw2am5VnSaYjL9WTcWw/p1qhA9HGjHhJTv9h6SONt2sjRNQoivTDKIemK0cF3oowZF3NvtH84lnRgQqiePCsmtbpmO2p1vdqo1XVccK2ubQXqump0jWJdZqkuVVuq4ShrB9Okjo7rX3cnMWenDDigXUcuoh/AqtxmNWh8U2QdOVTBsSTi2iigTJQqGiXqntnSNurI2YdYe4kOcEOe9MlMD4tDshqHgf4ETNDekqvvrHE42bPGobt8ZTQ/OjXV4T+Ngot9f41D4uj+aZNeqro3Lv76myOj/uZr8UOXvOzN4eTEGDLW3/SUVo1adQGUiVV+k/n43F9/c1ePjAWmzV3R7NB13ktcG/bnUHVnEqK7NxVTG9Zf9jcK1sVhURo2iBKVUYZpEl9sYdr0VCNwGGeKusU3U6tucS++nORVtzhDSeroIa7rwsVBEC+A0lu3uGQGq/zTJg1xNV0nvlK6mtrN8TXrMjuozrq51tTOWi69ETW/qZLaPpibMxvCAd5pk3a0dG5lc6/3Hq6IMaTHWVS9d3xW130eps3E3VZr5l6QfoDlAXoRoG+Yr3x+e5JZmWab9CKAH5Ibh8CaNqnGpBMwjBPWc7g+GRXV++7MENnSDmTz0wYjC5j2+WBO+6dj2tzVpTogxomZrdAeLgDJIKIv40a/RYYVTIk2+fVwgZ/TGp8BbQKcqnstDIj2FwrCDOq3SX8hxZGDZAjRM3SjFygnC6a5dDua1cnIOmp2wzTh6J5odstzPMje+wrqk95XFebXkuO5arjN5AWRL5wsmJbLlb20QZF6jCxgump2T+3m6Z62jSH1dUyd2fuyQX3Sl02SFBzRM5y32T+G8D+hYfd7wVT0zS5l1gYzpjmy3nNK4M8UrewwTkydsM78egYqknbvdbt9vRY07EbLbm6iWbVBjzv0DESzTscZuvF1vQZVnqU3Tkyd6JdI+1muqkns8ifpZwmSmqPu0v2aCvtbDVW37JYmSrprdprJlEGQG5+OfTgFE37uWoP8xhm4DtNfxOg5e60GHqDVIem1ii72du91dAnRov/GYGp1lbe1YeoMqwmUwQUMOpVKU9cwt5smkuOSGyei8BIn/k9XH+D6Q+hQfir7AEN95lgCJUgyjqRJ96kSNOwGU3SVF0AtbcTwLvuOPsD9JZThTg4vR9d0AyY1TWw2fcZJo6+hjpvBH2iPagWUER1dzoyAVzS+iYdbelTL+y70jTdB6ibd7V7Qn47iVlAftpeqeziYWl3l2TeENmp4OdFVwNSZRHffvn+7iyazy1F9ZSijeyrLT4WG8B8Bk5om1qBsxhliR4Zm4+7+6YLEqj0cXq1qte3905VVHptd7DXHWo8BaDaQwYDu4dcPrTa+o9VVnn9T9KIn/dO1nBJlVFIFPpCYMVwwYZqVpOn9FOdXtBsQ5lne2dv/xNPbn6PEP3oOu75qPVQjb4O/6o3qyC6+M4ByA/2sBmnD2qELVeYcLLV542hF/Rymmcg44euQ5gp7XO5UmmdZ8YTHYg0xVg44Jb+QtVFqnwxuwlTnqTkzUmVnJhsxgUAbqKN0sZVRXfElS0y9Moti/Gubn8M0ExknfN2QyRLeTnnaqwkTsqvRCwY+q5zddN/4cZaY3kNPmqjltwKotUtQComvHyxl3srPAZYvcPE/JKHZi6/kmJ3wpiV0xAawIsuMI60J2TNaW269mVHQYZUcZau6T1yyv1JAbQOFNsfq7lR+OYYy8iPwhA7JEk6OEyr1czz78Bqn8nUnTmO3qJUpVbh9npHzjBacXDBZAuWqE/7aV+7nzEKpgUKbF+Iynf+C4746mFYYSrDEcaqH3b9hmghZlNLetEwcBzHwVCc7EXfEWVvELJjK8oc6VZsosT3tz/ZGiaAUNVChDUIo/IsMm2i9Ncq3YImj/j5+TiPr7Z2nbJjAuY47lhEHYoIwmvY6oMTRKTe572810HOhDoRHn7QFlNYowdJycgrzNX2m6/d1rES087nJE14jI7oI8vIor0CqSWqUjnNfIQYqgdope2zUhYhAqkJps+zNXDDT+DkNRYWOuAsyjrC8KDuEVeqULqz0mCx/OmISec+gGO63wibXVD+JiDRQguUSw0xhws/T4MRKtJvnG+w2pCDGqziuSWIJjzH2BUh1CQOFcnK+hCCQivkHsTw3TLyMynLn377byRMpXAwbYyfXTv47xNY0SeyGCpZqoLVTymFjoQUbD4VSsryCcm6Y8PO0K9HJ0dWFZ46SRFVIF0FexNbWJFOuO41uOL6+XHTieNR5uLkcDMZ3UWKgnCeGWyDlTLVop7Hmn55Lu+8tEyb8PNVKJFOZV66PEI5ULEYiVYJDkB0TqtUTbCwRdUKyyymXdRZOMPox7ibb1CugONhaaZASpDn/ONW7aB+dZIVJrwHdFGbTtiaKeC6ivDqCUxv+JOdGT7fzUzQNh+iAUK8+TZKHMI7JcCMNEl6DzZrTy0+eZ4NJLiWB0yHVUa+mA10QZVC1dqszaCa2yVgltG0G2+1BEkx7wU0CovfTZQ0hUQicxjeVXygvzwgTOBF/7jV2K92t/pi2hiyWqYK8VyzK2+ovqvBJP8lOHcmWRj7tB+ai/Av/qS1KEmU2OkpiorNFa1Ujwy2dphZ0sMFwGKb08mww8fgMT+dYbCrhnPft7uIWifnJUc7ryibpLHcs5JUULG0qrbUXJ8s9Gj/M61eMqZbaVT1eSJv0GCbCuplg0haF8PYipBtroyQr8AtbPq7jU2aP+3pyD7i9aHSb4aRxgbC+1zC1l+P+O53gybG5FrUL4dnt1I3s9M3d4XtLsEtURPWJvx4DaH5yEWjDxAPnPaS8kZLSC3NnaaCUNklOLudacIIBUQEUBpovS2WY8HICM/taJHj2wzxRsq0QUHKSeHh2vg5UnCnRx2uOFXedxnVvfZQHUEyYOqFmLy+na9F7MwOhFeaEsi/MEihlgEJ3O8e714oU8XuRzyk7suPyxzDQICeeDckShgkv3xen8PZ8eXan8HDcd+lQKZIJiSC9kxFVQG0D7UT7swzWLGGYe8GE8nLytHgO9+I56ViTJVBqkkm04kQlUGKg825uLKlh5uTtNs92RgOd/Jj3juzJEiiFTaYYZwEUBprHDNqIN1nmaJjw9g2eWYBOLmNG0rRKaZZAmcFxXAZaj6P0KB8YSsTBOctcDRNK2zw10OG0mUzPcDDSJDVKeDhFmdlA1ftYCXQepUSJPC+whGbF8USCxnA4X4zdakezy2nAQIIkR2lNlvsqXCIGCqBBZxAlIDmIgbJQlpQnVNZEjxjTYLQYXI/vmxN2cptVB5c3i84oriuOJxZJGyUpUbO/gQKoeOHZ6lxHTpDjG0ESKItlSXkCKMLBViIaorwIfIIkUBIPz8tAARRIp4vBOOxG7Ij+7a4RTZqzwWLUCuA12PcWzBI8tQlAZyZ2dBgxXjO2BpL5o6QGCuWeG0iJiKgVnX8Eywwuk3kRtVKrEcm2BCldAiRI5oqSGqgGCt02BhtDDq8xUR6CJXhqlTdSuHhAV4v8g/WIAiSBshjtABTDTUcbXmOGCDjKQ7CkKmuiL9QNoCmKIh74mCQL1bVkAjWRatGXQ5wjAoBA6R/pQoBKoshDE1y50MdnRZOkQKVyQEpGm3jNwVHSo7IOkXGoTL5IeS8FsTWQPJAo5YAUg32M1EMBUpF8FJSUqFQbiWhGkJc82j2k6Cewargx2CrjA6MtSZaePQGpCKYCqhQEeR+JIw3fcaQYbQy4BPlUSFpMKyVLKkyePQWpcCvFaEOewGj/qfKbPTqmAQAAgRgoggH/TiEhePjhbure/tu1rkJuAwAAAAAAAMCwdwariQRBGL6EiLKQQNjVVxC8zlkGFZfQF1kPQWQPiZeNBz0sngSR1ZfI6/hiW2Pb801PMehMxtUFv44QkkvyUfZ4qPrrxo2zUbfIN3JuvRKf6odTPAlx39H/JrgenXT71D/oq3mkV9PCFhAHgt3fco1m0SfamNUGeDhP79zBJD2vwtcDqX5NBPtmL1OzFKAT6Otz+2FqCrabYLSsIQx63H3IEks6jt2mzaL2fG6pQC0Qf2QHEnKR4gubOMoyWtcN+Rb2gFhSfmO3tYRa/0Yo+3LCX7ZA/OkFMXEgmhwvQhajn3WphkWE/SwD3MU4w4JXuZhVVYvavC20deSpCzBboGfP1cYd6BEDjOKz+By1U+myvgU7ZgP3MUm/qMVsrFbQarFrDYMIczxEB3fqAlQCM/2xIMYmgN8r9v8LRvFZrDBrcQ59PKTqkZxjkpPSi1nUeveBdyFgl4cZoG0PITROH/4yBOLPyXLFYU/maJYzis+ChZkaUbbhcFAF5di6VWZRi1vK1sHDDNCGOoEozWMC8RfL8/L+fBi2dUbxWTB8QlyiMhr67AUzicKUSenhrNMMBqPeqAIJw9lmyenUly3AN1C/I3kcf0pglj+2w1QAGGk9BLEVjVIgBondMtWKhLmwlgU2q7nphq1XmUfvv8umlcHICUatbzbbLXrZGyYvd1grhjvtTwvM9teU4ECbkyqD9a0wlHHrdtsY031rLV9/9odubl3FfBSL6GLv0TrcnYp5Frnb9XjWHAwSZYtZ3KIWvK1h8kKZfME98AaWowQqf+/9Xy+Tafh8QpScmXx0xKiKoMkz1GqXBhHK3yu+LGDeDlsNKdsfnUDMWrh0lVoqFzAGPDyov6wKDAJZULTeyqT/Gxt2cmC2M6Km8gfKPRFtWGoW30qKdjrZq20GgVKLWwyD1oY89CUEjqUCG8uwu9iVgBnikxi0XDJtYeKyXBbdcNl42fbHQ9SiV6iKY7DSUCdUYBBE72C5ACdTKrBUzEx85gjiRGacYUoo15mZt6N7fyKPsrU8y4ZSuxj2GAhBpG780d8/PMRelwvwnJhO/pDYR08mLi/AZrNZrebzhTHyoF0s5iv5we5SEMcpqRWEvh//aHQlMq8RQ+wui0dOW0b+PdzdSGH+VKpqWcZxmdXK7+7uxl/2zsI3qiAI4wSHQFIguBxWipQCpRToXaEUKEEqSJEipViRKwR3De7ursHd3f8tZmZ339y92XePu5Ig4SuQd/Ag4cc3M7uzG0ZoBUa7GczGOH1m4eB4jP8iyQmMNEyMU6f/nKaSjZ//KwZOTp0+8wIpZw60TyGeOGzsoi6DF42FBcpSXKE0W5BKW7R/QdByWDEQ9XnFRh+cdfxTZyMx304ObaHFtWy9NG++rKQP7oBxAzfk78gRsOldBzsz2j6UDNVTFPgvVDJ4onaUVJdaep6890zLJPucVR7oTCN7hOoYMWKc3ttn8JRhsDOZOerzH6RRM1NhwM7pcV1GDyV43EcU0vOMlw6y/kMsE/NWRZzLGcCsQV14Wg/JewvNbB3bdhk3bN5vMu2oEdh1AYAlywzACHxeTQGe7WIfCj8QBycKc9rHgg6VxuRJUqYhRl/u/o6bLdu2Fo+cHov9iNQRv9q1HMHkwPkAcLoByPwkPdmvqsHDTcxoMYkz9pxq68hahmmmnIlmLckgVnwZsCYr0bJr5y+dNmvdzIEbE6c3CvsnmAAXKX6+ABmdmgyj5Wqk6klyHjwHW83Jgd5Qxbmc6z9kKMDkCXwuqUNo1lHQXvyOOrn3JKiGP1qaDz69pA81w5dumwirhRkzFqxLhYb4zBFDhgwZMXPQoNTUBTOazZo4cdq0bUuhdgyG7AfwgJ4IYAnwodF1R/eUzqD4OAVVm8eMeY63HGI3Jwd6k6rWEpTKo6lpOiSfcYH4yAa/X7ly5diVY6RLRvtACBa5ohkMVolW9imlZMeZ8UkDRhJ8oXXzxU2lHVoLWeZv08TMO+TRq8vcATuOzWkNdMyaMs5nOoOUCSUdz/IYENcZ7GGlVY4ea2muZFzmShKVzOcc0bOh7GrWX2eICO/JzSdar5R2OtqP2sSqy9NhI8YCN/MwJ2+IxFqzWh13CSoxTSjz37Kj5O0A/PH16+Pnzp27cePqqreg+45W3XfIomsZK5/vuCbj+UmWDqyJJv1RBJP/NMFDbr179y49fdc10FqjuREyo0MbR82ldw2WG6vM2cQS6rzWHOYuQHXMAPq6NI+6qXMllm88gtY8OH4cSF69Chxfou6y8CNC1boMwnygEy4XMi5l+GWX+UV5dae2lgpf40CC17Fjxx6sjqjc7t2JKOAcnwOarZSRAX+f2c5YWx6nDmSa28wJzQ89KlTWIAx0Wc1VlMOmVKGUWkMskeSeN28ePXr0HnQnQvARoBqkN27cOAyqd/kKiM/EWZG11fnS3ww6VtStMkh+9eph9O7alf4OQRLHzFaovih6yszM7DGciPZLT++VnDw+L896+ZdH/dNap5kYpa7rkCtzJmGgkzVLon9Hc1r0Y5TzOZ1keeL4xbNX3+7ZAyRTglmBQNu2bQtbRKiwsJCYKp++fXv16jnQ69fAlK8LOcmf1cAleXcBvyKuN0H6278f4hdRds8FkpmZSDG/DWoAip7ykSoSJaDMU6iROr7V63AXzqW19PRvXiRxRW9ANWidjHOqXJ6TN5quOXHx4tkDCiWQJJAtQV0jBB+RKSF99OjNnj1vr567eBz1+jVPtSKZxQJ+CdFP8/Ua9w0mSHlrQcASUA5HSwJIoNiuXbtOLPiEVPOBKAE1PDPsVwvgaAfjVsb6EIJD5kwSaZMCfXr0ftLEeT3PxuiaE+c3AMvsDoQSSSLH1qCePcvLy3fvhh964kdgSkQDgfcpCPTA2Q0Xz58APQC572vVjS3LXXGsjotBc4FlP2BJKJEkcuzcuaKid+/eZWVl8GNFRefOyBSJElDNszjHas8ksCfVFBnrfRCnqUOSpnvl3sXEuXlfGvP8xQ0HsrM7pABLQtkVUPYsX7Ly9qTwxy9aH8OTbq/cDVCJaGHbQCArpUO24rmmKYkqGS8W/BR5K5Ev/WfMXpw8klgOzySURLJ32faDzz+Urj516uvXr6dOrS798Hz99rLeRJSAZip/jmR7ilNc2nMLc24d6tQhUYTw9VpLo7OmE+f2nNkUjFnU3mHZUpG8feGLVZOIKPBEoEHgmX2gaMP5E029rrlKxb4zOzunOLlXej/Dsp0i+XTCV5smPFVE2xmeyp4ZMVqV0pxTsA6ZxCmLkF5TcdbkOLdGORqzWwfNklBOYnpWoruBJwBtG8gCnt2y229IC02t8iuUMXs8GdOwRJRHmKSV6BEEaniSPTna7b3KPq4lJ9O0FaGokVFDKWtynFuiHI0ZdFhKlFIXVoJBMd6JZ3b7/mmhgl8B0xizh2G5XaC0Ad1uePYge3K0i1gnczb3oulbhAaBNfXLSfYoPwAw0ZiCpY9BwZ+Kp8I5p2Bq5WGyMZUvmaUPT/KntqdXtDdCc8p997iYNKO3lRNxPUVZs5EFpolyMqZg6ePPZ4Yn4iyaTNFeeZhkTKg9gqU/T6hHYE8d7RmSppMKm9lpRpX0hrqkD458dxgGOmdNCROjXBtTsPSz5xLiiTi7UbRPrTxMNqZg6ceT7EnRbsfJhWVaTG/yvrIm0JziaohS/WfyAiZEORpziazi/jwpfVJxZ5yVg4kZE4y5vvRrvCpdD/Zsk4/RrnBKmk0skb6ICQma3PLgfSivpiRMHeXxG5PTJxV3xpkwzF4IMzFjsj0p2hFnL8bpS5MjXS4350W+O1rQFDA5yhPFScmTcBZUxpndCWasjPmN5ZE9VbRDLWJ3SpqDvPMm3zK0ZQWx0jdac55WRirKy+OMclncFc7JcwoqE+Y9FMwJ3hi/G3nwLIXFEiVPDvaEaHKOnRj57jJDs5Eb5mSGicZMXBcoeRLOIo71BHOmhKkoSnnZU+Gk3FmcVymasv43VzTrumg2DaUV/RTM8IVJt27dmjTpQtg3eWaldEswdeYVe8B0g/xkJGhaccIyPh6aTaPfrUrvLvCnOTWU1r99t5SsmDC33Lq9BNZASlDzl6wMx8JZGAh2SAxn3vhkAVOo9MPTg0d6Vyj1Xo89kK+xceb2i65ESU5l2ea7F7JXrI2q31SV95UMs0MwUOgJc8ttBEkNIxI8ENGwF86uLbgSxV/O++XGhFn6HEB2hiYciLqc8AxIn6+OgTMTKpHCKVc9cdCcGXnvE2jKU6QCgJndARftXe0wt6ykvobqD6Oo5UntJQ+HlreOuxJxnGM5z2SYciEJKLE/jM030gD80AmBrvbEibsiSJ2zK0lzoKu1rGgmRcCcwxVot40l7hkJJJxmBLTgEYmiQ8O23xN/JeI4p3LOMAVLRImNduy0k/rm5yNSXJkeXG3F2WlAPuDE1Dlb0jztS5NbSCtcTQ9BkyuQjUx4pWKJILOygsFgSkpKEJSVFVBAwZ/h2JWoIKE472SDWXoQWAJKAEnnakrwhEgBqAfP7ZbUybvF+bK/KWlChwSboZG3gVIlTbKmdwXaQstH3N5gsw3UjQQPwJSAgj+Zp6xEFOsJxXmZBaZmScdpeOabm9sdvsPTcDx8UzzLJM7SMpM6Odb9afo15GbUMt3NJLc1C71gEktASSCz22tlA1EECpYmnmHvSlTE5qxcnJ86QlvFfH2QBkeTY5T6wTMewRFP3NWf8kqdHOuyk8E0a/4czVlMU1jTUoHCSwCmZokgi4r6OyoCogAU/dnCniN261iPx5x5Os4HQJxLg1WAMYllLoBM7wUaicKHdECaSzzBnhXbV9tSp471KJr13TTnM02/9uY0QXMqWZMWR+W2KEeYimVR/8lpaWlztNLSJiNQaIYST5U9pa8LhTn9rGnifL2AqY1JLNN7jUxOTi4uHo8qLobnkb3Siaeyp4z29SbWjTmZ5ljZs5Q01aujI1+dRzSp886rI7amPcqDhmUoFCqYqlUQCiFQ9KdpiJaHZayzOeOwJsV5qYSpjNlRsSyGqzF5GUp5OTnjixXPjmhPjVPGepQ5HZrjfGnaz38313Je5TjX1twtYVKUA0xgmZYWcp1NLEeg4E/gGfSI9nLHnKH4rElxLmEqY44hlq6zHiCKPMegPb1wdmJzRvXTF/nRlK13e1IoUCWIrClgmihvTyyXV2FxmkCegFNFe/nHypkzx7FmmR2mMiazFDzJnh44yxxz5tgRseGqR9NsKmxsXZouDzmroyWuAqRh0qGEZMn+xHDX0d4V/xBpziBnzgStyTDJmIal5Dke7SlxSnN6h+88QVMspuRBhgl0QKFWRxcsBTlAUc7nuXaelD31xjTsZc7Q8p/Mmj0s1lxdxjD5ANLjzJhxbj/lZc6fopkU70FGgSroljhHDLoL5LM1LKDsiThV6pTmxA2RCHUbCi9rHqlgmMKYwp4GZ6eK9V7mzMlgmq7rCT/Yu5YVJ6IgGtSNj4XgIuILRHCh+MLxAT5Q0YiPAR1QUYni20Ui6qZJQBHRLGYhAReSjbocxvWMW/0zu27n9unOuZfqm86MmWh/QEOf1DlVt6rOzUeL5vqN6iBjLdDMEn3PM4do9sFklrN63kVDr0HBmVD9ZAGix8cgo5qdQZ7vzoCpvgVwDnK9Y4IzPhAJ1T1o3gOagYMMEH2ReF6o3Qu2mxgXOKOB4CSqq0RHaEI0dxCYOpyiGD0Kzm0HEqoDzbXXPSV5wCCDiM48L9IAQtXqls7I5CFQXSd6HFL5iOrGonns6CWAWQjOS0dj6Wwu9Jv2Vjl3n06pjgPOHdrfIDT1QYaf6LPguS53yZv6cG4ZDPNvKdVVNFOif2aem4gCmDqcx8H1DJqfU6pn0bxQHM2HfjTrKdEjCk3Lc/BT0c5EOhGcoPrWYlSv3Tg04yL6G7R6a0GNKMP1LtAE1WcO3XhCaHIrg8ZCq/NjoWSnSwYZlp99olOpSTxXHiudVLlGaVav67LJRJfQTHk+FdAkFa6b4EzRBNUT4dykNYaUIdsHoJnKJhM9Cuvz8oG/4cjq8cvqBWRTAOg4QhN93mJwCtcRnECzA+EMQZMtBBbNNQmakM2te2bzqokUBHIWkU4bnBFn9V2n8NNosrngCk3muc51BGc6Hu5COAPQVEeWftlsiGoiBQUH5yDVX4tw7tqrVZxTbtn82QwMTUR6EpzNn4ImC2d5NF/mDAd1t2zOG9VECgoLTqb6DxFOSkOqbCILTyM0Q4Nz27Q0SgVNFs6h0DzrQ1OCySWbszYJcwrSg9NB9dvm11HT0BmLZofQjIUuLDQhw4ImC6egWas8KYEmj9ORhLg8orNgsSrJRfUG0pCCZv/rSTYPxF9PoakHp431Vj6p2V+n8uS5gqaynHAVaCbjNXw8Ez18XZCoTmlIiyVJQrHO4VlIMvqMZA16FB2+IjoswjnwwultSVIfBs3LPjSraShFTpkDMcOpfjsvHQh2PaU3f1EoxbIZRnS8UIK9m33hr2aa1F8Ngeb57D0gGKdbNCWl/8h+++J2I5vX7gYSPVckzDveqKKZpPTmfbdsVkIfCGeu8dFMknoYmvriTNX97a+Hk02c+1Fy4TSAs6VeIGXRbGmyGS7EFs0bpdG8TGjKfI14WQpN1o4IJVKRU3qLv92Uh5WRpKGWLTgFzU8jZPrTfrm5PTvE+G1qd+SMoEdRYh1N2UroEZqhSQjRztrRk/67QbOmohmycAg03zOaQzkAUCUsutGsBxbvOprBStyDdhCaZU6W1f0WzQZVhyNFcx5dpFA0b5lz5b7yaOIx536gyf1NtSPH/c1/PDbPWTSVuRB1ix+70fyvm0BTmwDrc6EVktMPL2VOn9ugbM7wzPKje2a5MurN3pLWm3PKxqF2DwWMgf/PQoKm4iII2PWoqio3Buf07lKe0+dogYM8wLQ4695DGt8e0kKu9T50D6mm9ZCA5j3VJV1gR67t72+eWPn9TTPK8Pc3Bc13rkR9BGgG7W+2fb33LZPQezdEx6/DvXeg+VBHU98trrrnQtGkzIUM0QfRfJBFE8dF55AcD60s8bGp6p5Zfhv1zHL735hZ3hwgOs8sBU1ldOZ3uLD7qvrFztNfT9o83S57gOg8T596btE87x32sDPwqq8lV2mP4a7HsZK7HryIxLJpx0LvXtDtUuREpaGld62r/XSC95CwJOeWzQqhyexVVg7zC5zVr8uwIzdbdkeuG7wjh70ZhCbvyMkggxtym6khRzcDOPO/COdk72/uIF9GB7IpaFINSQ05NmX4z/Ttt5O9W2x5jh8Gsjn1igHiFhIXnP7OcvvrSth7bz0Ycu8dCR3HSrv3zuTlS1LUEukRCgBD9bdFPBmV5fZkPBixJwM5aOe0tV9tfPWOEgsf07lEOs9J3foI2t8VvxAsLiX9QvvHxC8Uv0UEmKa6rsSiJ/U7giaE8+tb1csm5t/68nnZXMHZ62S9bMCTsSzgZdsXd4rNnva6Vc5ykw+W3C9GFwnCCaq7fJawBhb1WW5dHp8lvIHsC9R8ljYHseUcl0ug3FS7SJshnJbqHg8wbKvj5gGGb5U9q34P8P2cQZ0bwOwL1NOQCCeEQajO/nS2VF9L8BwPf3riqe4DCo7fNH5qvz+9m7s8YRPuMlXuSCE0yWppb4cVOPnuBLb7nxI8tbsTDo7y7gQfnEet399enlCzVydYrz/dneC82AO3Fp/1p3T9nx0uZm8uFuV03usBOL33euz/S/d6mLsoZtKLPf4wd94tTkRRFMduxN6SAUUFEaIRbFFBsBDjig1j7IqR2HvFsvbeC/beRVEQUcQ/FFECfi7vfWXOJDeTlyZ6bBtBWX85572Zt+M9i/yxHgso5HrsTLkpPjcxdAZBxybkoonWkR2lt/VBM7dWmjmzYeBwOXNmhZ45M981c2Z3s2fOnN02zMxJGYqhM6MxcmaompESPnMGA5EQdN5V3Fu6xo/bemhvycR3DJ2ROH/trjAPacS/mIekZ/gEBiJNDIxD0vN7wuch4WAPQY+JTQhbumxrwlE9dnUbdTGr62mFWV2TSmZ1Ecu/OqsLY2egnJkvNQHDugKjuiaY2VLKmHI/19bknMug48u/FZrEwpoysA8Vz5HbEDJHjnhijhxJzZEjln9xjhz+07+cfWaAkswYOYtSzj2Tc+SK0HRfLZZNOXIcUZcHH/zAhzCnxbm70ozDwcUzDoll6IzDrQ3POJyLpVPM5TNA1ZBD/k4faZRVzTiUQXcvm3JeF6IOczYwf5MUPn/zYoPzN7F0luNJefcHcE72x29SxpmlHsb7O3z+ZnhHxh6xbIprJNnA6MGcrtmw4En7EUbDmvamUZVnw06qezasGGcqhnD6w2ExGtZM2GeaGLGN2bBmSjmsKUvWUmLZLHuNlAw1Zw1zi9/vL5lb/G5r0+cWu0ftYtru9Zs8uHjstrEE8vrXHCZFE8yKc4t7ov8vVsWyKVsDpwlzorGJcTpmagPpsmXvSI3M1G58DDR0MJe7n8vppRI0y8LEohnYg7yCa9l0N1rCnPznzE70H817FyPKqxNoVpr3jhYxWBNBF8umq20V5jRZx07U/C6C1lBi6A1zdRGczdUNU3YRoPUKexCCjmWzbNTRBCzNWZJ14GxaT0YpzKhpce0RkK60i4b0ZNRXOgJjip4MWIxvuWV/OpbNSi3VcWFOk3WBs5kdLtEgSIKoC4ZZJX2LhFUzlR0uk2tJ+2/6FtrhUtoWWLKbxGUJcG3ttVg6gbORfqGLol/IcGSQhBDl1yVdoEwWTIvKmuZy2m+6ecq+O9kvhJzLDX2KLKgO34dSBZl1LJ3AWX/31VPZfRWNUqwVx96mcJvUVqg/kwXTPuvGBYrEak87xsKj+wowdc5lo/JmUZ5eqbYxIbOOpRM46+1lOyl72VpbqXFVGZK9qCmqmv1gfzJ/62WZdlVM++7aRc3SpuSuzl42YmlSPlLCRAOw3IMQVqloBXNi6Qy4c8X8ZnUG3n1CjcC9u4Cjbaq2JeDBfm8F1vfp8bcbN+6aqme91tsZSCxFZ2AfCxM5R9Bn+nsQlm+3OeXSyTijGue89WTPmvssT8o+yyfP7jz+doNIgiMjJHWQot/VUA3Trl2vHn/LJeiLkXbN80vOnfEvfv8ipRzttdz+a2CKnIs9yG3OeCFk6ewfqP6ex2lvqGuVYR49+vgxNX+/VCQtx0DFfztf5jeCTBXQ/kSUWuVLulZVQai7GtTvBg12ra7btbF3Px9meWvKcmq3OXEKzzj9WnqkvfYeYDam/frR0aNHH715Q13/bTVJy5EZRoy6G5mXFqtiykCJKHXQn+ea/qIe4CG6UTmkB/j6WWVL9NYi5esIJj0qA5hlrYmLTbc504ViJdJqJyIz6LT3DKZ9hOWpgKqO6nfBu3PuqN5d1FFtWT569ebAixe3r3Q2JAGyeyeW56Uz8YWbV2ZT8eTy9F7P49/sDqYEVFv03PbtVOh/6JDfUT1gLjqqj3z5uSSXo5Lq+3SnvuTnl5voqJ47wHYq25SPI5Zv/UZ/wJTWRNBrNmdC7URkBlP0b+8y2Z6Kp+hP5/r03dyfThxtf7pZL9VWTihfHThAKK/cumxI+hy9zMpVW6ZN2Vko1bE1a0+k0p5hykSNRR8yUDIo96ebIoyi/vRtY7W2Ffen2z56YqlTziyvdt1OxuwWBhPWxB7kMKfEyX+LTTvbs4+1p89zUqDbf7jo9ieSbEuV8UvXFMoDn58TynsdtScVSG916kRsesGh6bFNC9MeE1UeNUCNQZnnyKG6kH6C6PanF5qkraJHFz23hu869Lbr9u3amBqmzLmwpsOcyDo07VT3iEk729Pn2dpqeGqgTJSRKjFE5kggmSShpFr/S9eIZTFK7UkvvilRqEGxHWRStqgBSjy1QS+M+WEMykS5oIk1mSCy5s5VJI0tFxBLDrlhycY891AbM9J9Zr5QLuewZlXmFFlnrdmLtJfwfHKUaukVUEuUmVoNYpBM8tN3YvmKFktGSSzv3WMDKFN66c35Qu1KnMiQRS1QGPQ1G5SAMlFGyppAEEnEUZE0tpzNLGcEWG6nkBtjLp9VKNEck3NY021OZL3Mdae2p+ZJ62dUF9M/eUZAr/lEuZ/J1yReKRXJa69evXnDtlQoO9p8e6lYoX7FFp5SQIVBxyzQRJkpazz/xByZJLuSbMkZn6H2Hs2SjalYRpDyMjnv36UvW9NpTmS9PM6IsSd49olGiacGaokyU4hBMsnHhJL2nedXrlwGylMtiUKjOryDHWoN+sE3qCJKSAkqaSj9IIwEUpFUtqTnkwglsVSbTyDknTI4NoI1Tc71eYdTODhhnGskTk/ZEzy7ENCPH1tb6USXgRJR0jXWJV/04tWjx4SSr4bMYmlduXBLoTmKpcsZ9NDrC/SwDDElTZw48QeJOSqSixZPXbfOojwOlirkHozpzrk769iJpD2DPAmoIkoiqJroM2L6CFIk9YWlj7Kd2nUaCbg06EJpUH1RT9ehsy9ovabXJLq359MSoOSN3LBEyCVMDqbIuTvr2IkEztXgae/smGjv3nSUS1TvBPSYRCRvMEmg1LZc7kDZsEGJpwH6mvkZ7SKtU6IP6LVB2TbIMrMlDKbMuTvrITsR4g6efGdnjsj0ce431o0b9F3pBcmQDKI89WCam03jK6gFev7q1atv3/o81S8M8vjxfoSyLaMEy72xggOmyLkbp9yJJE+2gCFq9JKwvrS6/fI2gbQkfZRedkvhLyq2FwZloJ2Z6Hb6vK72Ox6Qf5DaqzOj1Czlgilhcs5hzdp2ovS+UJ64s7PnjoSVxAe7Wu2JY7d7liSuhv6yYnEYVH1yD/0jUSscpBqUmuXqWMENEzmvdSeKdFo9x7FGaaLmSBeHvDhb80nWuO9MmZXIr121pyWbXdlyYtOqpUvz+6ZXDZR54u3WCSKmRvx+2wNArD+ZsM/udCoIEzmvdSdqE+l+KuyfkFjp6cMHjdSIAFq1CZ4JecnqLyyn5zdlk8lOWt1ZnYwy8ZVn8rOqu6jXQHF8x0x9ddMgg+tP6Kc3J90pUh9MLJ04RwmnsGVz2hLFea6FaDiyJ5c/yFcLcmlLKqkZ8l8L4a8jpsnNawpu5bPi7e5oxB8jNQhNSMojbeqECZw440tUNMHKjKf++ZGgjKG8dKpl6bSqPZlNKo54cwyG4jdJMc3EN1VB9PDmvR6ORCGExrWUzzEprxMmcOL8OTOlUFGzYmc2p5af8jxzyLuaTnlTC/fEkEk3yRbKtgGpEJrVmCOqP4CjNFHy6MpqLLplT+qUJ95uHRov3iIuMIQxVcoBsx6ctHb26084zdlUlWvesX1zdp4u1KzpO5LGk3KVM5cHWtjamChbNMtA3cqf2JFcTUytvNXJ7B7tSYcxcawLmPXg7N3F4ETa/4ZmZa0pxQ7ctli9/K9pWqIMNFl9AnbOmTJrWmLNlDk41nca06YcX/+uR1F6Die4F6X/Cs9ZLQal9qQCiavDrkXCVaImaoASzyyANk9z4sqYSDku2utRH+xF+v410XSWAZT4oi4ekCH1tlKv1B0MiCqgMGhzWRpjIuUCZv17keK5MNFMlHQpZFHiDrU/cbTPGbF6GPHH9jmlfpqoAWoNurIpQLFgRmBMkfL69yKVdsszlWgSyoXKlkDJJBklgcSDhaSolvpYPc/JTA1RBho0aLxJPKdoljAmUt4oTpX25vKctRkJNyg1yS5MEg8TCuHxTiJqgBYbtGV64yzjPksYEzAbUVQvnkU8l/9p345ZEwaiOIBLF1uoECzUfgXB1VnElIBbyRIkOCQu6pAh0KlQOvR7917uHv87H4LGS0wh/w4tnR6/9y6YZ3KTZx45F0tQsuQlVZGoBhUDWqy9WcrB9HTaXc/3mgOa/xYfQ/diCcpqJq/pM4FiQH1cQRfxqaXHwcRpP/GsA5pvY5K0plKPJShrHJxzAzqPw+spfxQl9uBk6XUwUbTryaCbw/KyOmdJypJMiRMuKWsP6IgHlECL8EpKOjTCEpU15okHNDaboszOlx0et4epgoQkUToXy1sLDsSAAnQaJeEFkkkMykYtpSdKZtGhMp2mZbLLvpa5unM7viXbfRml8dw4PjmSLiU94ID4GVCAquLmq2gXnoXM9pUkKBu2lJ4MqkWxd+Rgy4vFJyRBKU64rwEFKEgPZZLN1qG6Rf/+XIT58piU6WqKU4PPvQ1bwpNHADWruNth7Hid3Rok/VPKAX3EZgSkInprJa4/xlIemUY8xwyKb1YMKoJlN0NC0iulHFAGRW0nzUbLcWpsyjYs4cklu4/9j2ifyxlVP85LFJAEZTPVARTtlt3GqbFXBETZhqUsmUVp7ahREaOIF3xsyUZrDWxQm5RDghRyxAIQlDU67QO0EsXbUtqVIl8+a0cSoNxukIpui1PTOqW8VeYVGaGqvOo862C3BsmWwsWBlGK+SkfLCZIl70EpRXXZhGpnTBEv7bYZfgXWtBvNftC/0G0tGQw6kIk2pcLt0D/u5YjaiNRsRMnUzdhAdkXSMZ0ETiYqg24k4CPk5v7d/q9Bt19U9F+d6XafPn369Olza/4AHTMK9clhnYAAAAAASUVORK5CYII="},function(e,t){e.exports="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMDAwIDE3MSIgd2lkdGg9IjIwMDAiIGhlaWdodD0iMTcxIj4KICA8ZGVmcz4KICAgIDxsaW5lYXJHcmFkaWVudCBpZD0idGV4dEdyYWQiIHgxPSIwJSIgeTE9IjAlIiB4Mj0iMTAwJSIgeTI9IjAlIj4KICAgICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3R5bGU9InN0b3AtY29sb3I6I2ZhZjQ5OTtzdG9wLW9wYWNpdHk6MSIgLz4KICAgICAgPHN0b3Agb2Zmc2V0PSI0NSUiIHN0eWxlPSJzdG9wLWNvbG9yOiNmNjcyYzI7c3RvcC1vcGFjaXR5OjEiIC8+CiAgICAgIDxzdG9wIG9mZnNldD0iMTAwJSIgc3R5bGU9InN0b3AtY29sb3I6IzZmZjllYTtzdG9wLW9wYWNpdHk6MSIgLz4KICAgIDwvbGluZWFyR3JhZGllbnQ+CiAgICA8ZmlsdGVyIGlkPSJnbG93IiB4PSItMTAlIiB5PSItNTAlIiB3aWR0aD0iMTIwJSIgaGVpZ2h0PSIyMDAlIj4KICAgICAgPGZlR2F1c3NpYW5CbHVyIGluPSJTb3VyY2VHcmFwaGljIiBzdGREZXZpYXRpb249IjUiIHJlc3VsdD0iYmx1ciIgLz4KICAgICAgPGZlTWVyZ2U+CiAgICAgICAgPGZlTWVyZ2VOb2RlIGluPSJibHVyIiAvPgogICAgICAgIDxmZU1lcmdlTm9kZSBpbj0iU291cmNlR3JhcGhpYyIgLz4KICAgICAgPC9mZU1lcmdlPgogICAgPC9maWx0ZXI+CiAgPC9kZWZzPgogIDx0ZXh0CiAgICB4PSIxMDAwIgogICAgeT0iMTI1IgogICAgZm9udC1mYW1pbHk9IidUdyBDZW4gTVQnLCAnQ2VudHVyeSBHb3RoaWMnLCBGdXR1cmEsICdUcmVidWNoZXQgTVMnLCBzYW5zLXNlcmlmIgogICAgZm9udC1zaXplPSIxMTAiCiAgICBmb250LXdlaWdodD0iYm9sZCIKICAgIGxldHRlci1zcGFjaW5nPSIxMiIKICAgIHRleHQtYW5jaG9yPSJtaWRkbGUiCiAgICBmaWxsPSJ1cmwoI3RleHRHcmFkKSIKICAgIGZpbHRlcj0idXJsKCNnbG93KSI+dGhyZWUud3M8L3RleHQ+Cjwvc3ZnPgo="},function(e,t,n){var r,i,a={},o=(r=function(){return window&&document&&document.all&&!window.atob},function(){return void 0===i&&(i=r.apply(this,arguments)),i}),s=function(e,t){return t?t.querySelector(e):document.querySelector(e)},c=function(e){var t={};return function(e,n){if("function"==typeof e)return e();if(void 0===t[e]){var r=s.call(this,e,n);if(window.HTMLIFrameElement&&r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(e){r=null}t[e]=r}return t[e]}}(),l=null,u=0,h=[],d=n(202);function p(e,t){for(var n=0;n<e.length;n++){var r=e[n],i=a[r.id];if(i){i.refs++;for(var o=0;o<i.parts.length;o++)i.parts[o](r.parts[o]);for(;o<r.parts.length;o++)i.parts.push(b(r.parts[o],t))}else{var s=[];for(o=0;o<r.parts.length;o++)s.push(b(r.parts[o],t));a[r.id]={id:r.id,refs:1,parts:s}}}}function f(e,t){for(var n=[],r={},i=0;i<e.length;i++){var a=e[i],o=t.base?a[0]+t.base:a[0],s={css:a[1],media:a[2],sourceMap:a[3]};r[o]?r[o].parts.push(s):n.push(r[o]={id:o,parts:[s]})}return n}function m(e,t){var n=c(e.insertInto);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");var r=h[h.length-1];if("top"===e.insertAt)r?r.nextSibling?n.insertBefore(t,r.nextSibling):n.appendChild(t):n.insertBefore(t,n.firstChild),h.push(t);else if("bottom"===e.insertAt)n.appendChild(t);else{if("object"!=typeof e.insertAt||!e.insertAt.before)throw new Error("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n");var i=c(e.insertAt.before,n);n.insertBefore(t,i)}}function g(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e);var t=h.indexOf(e);t>=0&&h.splice(t,1)}function y(e){var t=document.createElement("style");if(void 0===e.attrs.type&&(e.attrs.type="text/css"),void 0===e.attrs.nonce){var r=function(){0;return n.nc}();r&&(e.attrs.nonce=r)}return v(t,e.attrs),m(e,t),t}function v(e,t){Object.keys(t).forEach((function(n){e.setAttribute(n,t[n])}))}function b(e,t){var n,r,i,a;if(t.transform&&e.css){if(!(a="function"==typeof t.transform?t.transform(e.css):t.transform.default(e.css)))return function(){};e.css=a}if(t.singleton){var o=u++;n=l||(l=y(t)),r=E.bind(null,n,o,!1),i=E.bind(null,n,o,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(e){var t=document.createElement("link");return void 0===e.attrs.type&&(e.attrs.type="text/css"),e.attrs.rel="stylesheet",v(t,e.attrs),m(e,t),t}(t),r=_.bind(null,n,t),i=function(){g(n),n.href&&URL.revokeObjectURL(n.href)}):(n=y(t),r=x.bind(null,n),i=function(){g(n)});return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else i()}}e.exports=function(e,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(t=t||{}).attrs="object"==typeof t.attrs?t.attrs:{},t.singleton||"boolean"==typeof t.singleton||(t.singleton=o()),t.insertInto||(t.insertInto="head"),t.insertAt||(t.insertAt="bottom");var n=f(e,t);return p(n,t),function(e){for(var r=[],i=0;i<n.length;i++){var o=n[i];(s=a[o.id]).refs--,r.push(s)}e&&p(f(e,t),t);for(i=0;i<r.length;i++){var s;if(0===(s=r[i]).refs){for(var c=0;c<s.parts.length;c++)s.parts[c]();delete a[s.id]}}}};var w,A=(w=[],function(e,t){return w[e]=t,w.filter(Boolean).join("\n")});function E(e,t,n,r){var i=n?"":r.css;if(e.styleSheet)e.styleSheet.cssText=A(t,i);else{var a=document.createTextNode(i),o=e.childNodes;o[t]&&e.removeChild(o[t]),o.length?e.insertBefore(a,o[t]):e.appendChild(a)}}function x(e,t){var n=t.css,r=t.media;if(r&&e.setAttribute("media",r),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}function _(e,t,n){var r=n.css,i=n.sourceMap,a=void 0===t.convertToAbsoluteUrls&&i;(t.convertToAbsoluteUrls||a)&&(r=d(r)),i&&(r+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(i))))+" */");var o=new Blob([r],{type:"text/css"}),s=e.href;e.href=URL.createObjectURL(o),s&&URL.revokeObjectURL(s)}},function(e,t){e.exports=function(e){var t="undefined"!=typeof window&&window.location;if(!t)throw new Error("fixUrls requires window.location");if(!e||"string"!=typeof e)return e;var n=t.protocol+"//"+t.host,r=n+t.pathname.replace(/\/[^\/]*$/,"/");return e.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,(function(e,t){var i,a=t.trim().replace(/^"(.*)"$/,(function(e,t){return t})).replace(/^'(.*)'$/,(function(e,t){return t}));return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(a)?e:(i=0===a.indexOf("//")?a:0===a.indexOf("/")?n+a:r+a.replace(/^\.\//,""),"url("+JSON.stringify(i)+")")}))}},function(e,t,n){const r='\x3c!-- https://freesound.org/people/deleted_user_2731495/sounds/183881/ --\x3e\n<audio id="introSong" src="assets/sounds/menu.ogg" loop></audio>\n\n\n\n\n<a-scene\n bind__beat-generator="challengeId: challenge.id; difficulty: challenge.difficulty; beatmapCharacteristic: challenge.beatmapCharacteristic; gameMode: gameMode; has3DOFVR: has3DOFVR; hasSongLoadError: hasSongLoadError; isPlaying: isPlaying; isZipFetching: isZipFetching; menuSelectedChallengeId: menuSelectedChallenge.id; songDuration: challenge.metadata.duration; speed: speed"\n bind__beat-system="gameMode: gameMode; hasVR: hasVR; isLoading: isLoading; isPlaying: isPlaying"\n bind__gameover="isGameOver: isGameOver"\n bind__intro-song="isPlaying: menuActive && !menuSelectedChallenge.id; isSearching: isSearching"\n bind__leaderboard="difficulty: menuSelectedChallenge.difficulty || challenge.difficulty; beatmapCharacteristic: menuSelectedChallenge.beatmapCharacteristic || challenge.beatmapCharacteristic; gameMode: gameMode; inVR: inVR; isVictory: isVictory; menuSelectedChallengeId: menuSelectedChallenge.id; challengeId: challenge.id"\n bind__search="difficultyFilter: difficultyFilter; genre: genre; playlist: playlist; query: search.query"\n bind__song="audio: challenge.audio; challengeId: challenge.id; isLoading: isLoading; isPlaying: isPlaying; isBeatsPreloaded: challenge.isBeatsPreloaded; isGameOver: isGameOver; isVictory: isVictory"\n bind__song-preview-system="selectedChallengeId: menuSelectedChallenge.id; selectedChallengeVersion: menuSelectedChallenge.version"\n bind__stage-colors="colorScheme: colorScheme"\n bind__tunnels="isPlaying: isPlaying; songDuration: challenge.metadata.duration"\n bind__zip-loader="difficulties: menuDifficulties; isLoading: isLoading; version: menuSelectedChallenge.version; directDownload: menuSelectedChallenge.directDownload; bpm: menuSelectedChallenge.metadata.bpm"\n animation__gameover="property: object3D.background; type: color; to: #750000; startEvents: gameover"\n agent-picker\n console-shortcuts\n debug-beat-generator\n debug-beat-positioning\n debug-controller\n debug-intro\n debug-song-time\n debug-state\n hack\n gpu-preloader\n \n leaderboard="apiKey: REDACTED_FIREBASE_KEY; authDomain: threews-prod.firebaseapp.com; databaseURL: https://threews-prod.firebaseio.com; projectId: threews-prod; storageBucket: threews-prod.appspot.com; messagingSenderId: 172125624222"\n loading-screen="backgroundColor: #000"\n pool__beat-arrow-blue="mixin: arrowBlueBeat; size: 30; container: #beatContainer; dynamic: true"\n pool__beat-arrow-red="mixin: arrowRedBeat; size: 30; container: #beatContainer; dynamic: true"\n pool__beat-dot-blue="mixin: dotBlueBeat; size: 30; container: #beatContainer; dynamic: true"\n pool__beat-dot-red="mixin: dotRedBeat; size: 30; container: #beatContainer; dynamic: true"\n pool__beat-mine="mixin: mine; size: 30; container: #beatContainer"\n pool__plume-arrow-blue="mixin: arrowBluePlume; size: 30; container: #beatContainer; dynamic: true"\n pool__plume-arrow-red="mixin: arrowRedPlume; size: 30; container: #beatContainer; dynamic: true"\n pool__plume-dot-blue="mixin: dotBluePlume; size: 30; container: #beatContainer; dynamic: true"\n pool__plume-dot-red="mixin: dotRedPlume; size: 30; container: #beatContainer; dynamic: true"\n pool__plume-mine="mixin: minePlume; size: 12; container: #beatContainer; dynamic: true"\n pool__beat-broken-blue="mixin: blueBeatBroken; size: 10; container: #rigContainer; dynamic: true"\n pool__beat-broken-red="mixin: redBeatBroken; size: 10; container: #rigContainer; dynamic: true"\n pool__beat-broken-blue-dot="mixin: blueDotBroken; size: 10; container: #rigContainer; dynamic: true"\n pool__beat-broken-red-dot="mixin: redDotBroken; size: 10; container: #rigContainer; dynamic: true"\n pool__punch-broken-blue-dot="mixin: blueDotPunchBroken; size: 10; container: #rigContainer; dynamic: true"\n pool__punch-broken-red-dot="mixin: redDotPunchBroken; size: 10; container: #rigContainer; dynamic: true"\n pool__beat-broken-mine="mixin: mineBroken; size: 10; container: #rigContainer; dynamic: true"\n pool__beat-fx-blue="mixin: blueBeatFX; size: 10; container: #rigContainer; dynamic: true"\n pool__beat-fx-red="mixin: redBeatFX; size: 10; container: #rigContainer; dynamic: true"\n pool__beat-fx-mine="mixin: mineFX; size: 12; container: #rigContainer; dynamic: true"\n pool__punch-fx-blue="mixin: bluePunchFX; size: 10; container: #rigContainer; dynamic: true"\n pool__punch-fx-red="mixin: redPunchFX; size: 10; container: #rigContainer; dynamic: true"\n pool__punch-fx-mine="mixin: yellowPunchFX; size: 12; container: #rigContainer; dynamic: true"\n pool__tunnels="mixin: tunnel; size: 10; container: #tunnelsContainer; dynamic: true"\n pool__wall="mixin: wall; size: 20; container: #wallContainer; dynamic: true"\n proxy-event__cleargame1="event: gamemenuexit; as: cleargame; to: a-scene"\n proxy-event__cleargame2="event: gamemenurestart; as: cleargame; to: a-scene"\n proxy-event__cleargame3="event: songcomplete; as: cleargame; to: a-scene"\n proxy-event__pausegame="event: pausegame; as: textglowoff; to: a-scene"\n proxy-event__resumegame="event: gamemenuresume; as: textglownormal; to: a-scene"\n play-sound__crescendo="sound: #crescendo; event: victory; volume: 0.75"\n render-order="stage, aurora, sideglow, tunnel, curve, curveshadow, beatShadow, score, beats, menu, menuitem, menubutton, menutext, menugenre, cursor, particles, weapon, victory, stepback"\n stats-param\n tunnels\n vr-mode-ui="enterVRButton: #vrButton">\n\n <a-assets timeout="3000">\n \x3c!-- <require path="/workspaces/3D-Agent/rider/src/assets.html"> --\x3e\n<a-asset-item id="VigaRegularThree" src="assets/fonts/Viga-Regular-Three.json"></a-asset-item>\n<a-asset-item id="agentGlb" src="assets/avatars/cz.glb"></a-asset-item>\n\n<a-asset-item id="arrowredObj" src="assets/models/arrowred.obj"></a-asset-item>\n<a-asset-item id="arrowblueObj" src="assets/models/arrowblue.obj"></a-asset-item>\n<a-asset-item id="beatObj" src="assets/models/beat.obj"></a-asset-item>\n<a-asset-item id="laserObj" src="assets/models/laser/laser.obj"></a-asset-item>\n\n<a-asset-item id="tunnelObj" src="assets/models/tunnel.obj"></a-asset-item>\n<a-asset-item id="redBeatObj" src="assets/models/redbeat.obj"></a-asset-item>\n<a-asset-item id="blueBeatObj" src="assets/models/bluebeat.obj"></a-asset-item>\n<a-asset-item id="dotRedObj" src="assets/models/dotred.obj"></a-asset-item>\n<a-asset-item id="dotBlueObj" src="assets/models/dotblue.obj"></a-asset-item>\n<a-asset-item id="backGlowObj" src="assets/models/backglow.obj"></a-asset-item>\n<a-asset-item id="aurorasObj" src="assets/models/auroras.obj"></a-asset-item>\n<a-asset-item id="merkabaObj" src="assets/models/merkaba.obj"></a-asset-item>\n<a-asset-item id="ringsObj" src="assets/models/rings.obj"></a-asset-item>\n<a-asset-item id="homeObj" src="assets/models/home.obj"></a-asset-item>\n<a-asset-item id="homeShadowObj" src="assets/models/homeshadow.obj"></a-asset-item>\n<a-asset-item id="weaponObj" src="assets/models/weapon.obj"></a-asset-item>\n<a-asset-item id="weaponHandleObj" src="assets/models/weaponhandle.obj"></a-asset-item>\n<a-asset-item id="weaponGlowObj" src="assets/models/weaponglow.obj"></a-asset-item>\n<a-asset-item id="beatBrokenObj" src="assets/models/beatbroken.obj"></a-asset-item>\n<a-asset-item id="dotBrokenObj" src="assets/models/dotbroken.obj"></a-asset-item>\n<a-asset-item id="dotPunchBrokenObj" src="assets/models/dotbroken.gltf"></a-asset-item>\n<a-asset-item id="cutfxObj" src="assets/models/cutfx.obj"></a-asset-item>\n<a-asset-item id="punchfxObj" src="assets/models/punchfx.obj"></a-asset-item>\n<a-asset-item id="leftFistObj" src="assets/models/leftfist.obj"></a-asset-item>\n<a-asset-item id="leftFistWeaponObj" src="assets/models/leftfistweapon.obj"></a-asset-item>\n<a-asset-item id="rightFistObj" src="assets/models/rightfist.obj"></a-asset-item>\n<a-asset-item id="rightFistWeaponObj" src="assets/models/rightfistweapon.obj"></a-asset-item>\n<a-asset-item id="plumeObj" src="assets/models/plume.obj"></a-asset-item>\n\n<a-asset-item id="mineObj" src="assets/models/mine.obj"></a-asset-item>\n<a-asset-item id="mineBrokenObj" src="assets/models/minebroken.gltf"></a-asset-item>\n\n\x3c!--\n https://freesound.org/people/juskiddink/sounds/70043/\n https://freesound.org/people/Robinhood76/sounds/337436/\n--\x3e\n<audio id="confirmSound" src="assets/sounds/beatHit.ogg"></audio>\n<audio id="clearSound" src="assets/sounds/clear.ogg"></audio>\n<audio id="hoverSound" src="assets/sounds/hover.ogg"></audio>\n<audio id="victorySound" src="assets/sounds/victory.ogg"></audio>\n<audio id="crescendo" src="assets/sounds/crescendo.ogg"></audio>\n\n\n<audio id="hitSound1" src="assets/sounds/hit1.ogg"></audio>\n<audio id="hitSound1left" src="assets/sounds/hit1left.ogg"></audio>\n<audio id="hitSound1right" src="assets/sounds/hit1right.ogg"></audio>\n\n<audio id="hitSound2" src="assets/sounds/hit2.ogg"></audio>\n<audio id="hitSound2left" src="assets/sounds/hit2left.ogg"></audio>\n<audio id="hitSound2right" src="assets/sounds/hit2right.ogg"></audio>\n\n<audio id="hitSound3" src="assets/sounds/hit3.ogg"></audio>\n<audio id="hitSound3left" src="assets/sounds/hit3left.ogg"></audio>\n<audio id="hitSound3right" src="assets/sounds/hit3right.ogg"></audio>\n\n<audio id="hitSound4" src="assets/sounds/hit4.ogg"></audio>\n<audio id="hitSound4left" src="assets/sounds/hit4left.ogg"></audio>\n<audio id="hitSound4right" src="assets/sounds/hit4right.ogg"></audio>\n\n<audio id="hitSound5" src="assets/sounds/hit5.ogg"></audio>\n<audio id="hitSound5left" src="assets/sounds/hit5left.ogg"></audio>\n<audio id="hitSound5right" src="assets/sounds/hit5right.ogg"></audio>\n\n<audio id="hitSound6" src="assets/sounds/hit6.ogg"></audio>\n<audio id="hitSound6left" src="assets/sounds/hit6left.ogg"></audio>\n<audio id="hitSound6right" src="assets/sounds/hit6right.ogg"></audio>\n\n<audio id="hitSound7" src="assets/sounds/hit7.ogg"></audio>\n<audio id="hitSound7left" src="assets/sounds/hit7left.ogg"></audio>\n<audio id="hitSound7right" src="assets/sounds/hit7right.ogg"></audio>\n\n<audio id="hitSound8" src="assets/sounds/hit8.ogg"></audio>\n<audio id="hitSound8left" src="assets/sounds/hit8left.ogg"></audio>\n<audio id="hitSound8right" src="assets/sounds/hit8right.ogg"></audio>\n\n<audio id="hitSound9" src="assets/sounds/hit9.ogg"></audio>\n<audio id="hitSound9left" src="assets/sounds/hit9left.ogg"></audio>\n<audio id="hitSound9right" src="assets/sounds/hit9right.ogg"></audio>\n\n<audio id="hitSound10" src="assets/sounds/hit10.ogg"></audio>\n<audio id="hitSound10left" src="assets/sounds/hit10left.ogg"></audio>\n<audio id="hitSound10right" src="assets/sounds/hit10right.ogg"></audio>\n\n\n<img id="cursorMeshImg" src="assets/models/laser/laser.png">\n<img id="downIconImg" src="assets/img/downIcon.png">\n<img id="envmapTemplateImg" src="assets/img/envmap.png">\n<img id="envmapImg">\n<img id="favoriteImg" src="assets/img/favorite.png">\n<img id="sliceImg" src="assets/img/slice.png">\n<img id="stepbackImg" src="assets/img/stepback.png">\n<img id="soundboxingImg" src="assets/img/soundboxing.jpg">\n<img id="genresImg" src="assets/img/genres.png">\n<img id="starImg" src="assets/img/star.png">\n<img id="merkabaBloomImg" src="assets/img/merkababloom.png">\n<img id="homeShadowImg" src="assets/img/homeshadow.jpg">\n<img id="backGlowImg" src="assets/img/backglow.png">\n<img id="weaponImg" src="assets/img/weapon.jpg">\n<img id="weapon2Img" src="assets/img/weapon2.jpg">\n<img id="weaponHandleImg" src="assets/img/weaponhandle.png">\n<img id="difficultyImg" src="assets/img/difficulty.png">\n<img id="selectedImg" src="assets/img/selected.png">\n<img id="cutfxImg" src="assets/img/cutfx.png">\n\x3c!--\n<img id="cutFxTemplateImg" src="assets/img/cutfx.png">\n<img id="cutFxImg">\n--\x3e\n<img id="minefxImg" src="assets/img/minefx.png">\n<img id="sideglowImg" src="assets/img/sideglow.png">\n<img id="logoImg" src="assets/img/logo.svg">\n<img id="moonImg" src="assets/img/moon.png">\n<img id="plumeImg" src="assets/img/plume.png">\n<img id="tubeImg" src="assets/img/tube.png">\n<img id="tubeColorImg" src="assets/img/tube.jpg">\n<img id="handStarTrailImg" src="assets/img/handstartrail.png">\n\n<img id="modeRideImg" src="assets/img/moderide.jpg">\n<img id="modeClassicImg" src="assets/img/modeclassic.jpg">\n<img id="modePunchImg" src="assets/img/modepunch.jpg">\n<img id="modeViewerImg" src="assets/img/modeviewer.jpg">\n\n<a-mixin id="slice" slice9="color: #050505; transparent: true; opacity: 0.9; src: #sliceImg; left: 50; right: 52; top: 50; bottom: 52; padding: 0.18"></a-mixin>\n<a-mixin id="font" text="font: assets/fonts/Viga-Regular.json; shader: msdf; letterSpacing: 1"></a-mixin>\n\n<a-mixin id="superKeyboardTextInput" mixin="font"></a-mixin>\n\n<a-mixin id="beat"></a-mixin>\n<a-mixin id="beatBlock"></a-mixin>\n<a-mixin id="beatSign"></a-mixin>\n\n<a-mixin id="arrowBlueBeat" mixin="beat" beat="color: blue; type: arrow"></a-mixin>\n<a-mixin id="arrowRedBeat" mixin="beat" beat="color: red; type: arrow"></a-mixin>\n<a-mixin id="dotBlueBeat" mixin="beat" beat="color: blue; type: dot"></a-mixin>\n<a-mixin id="dotRedBeat" mixin="beat" beat="color: red; type: dot"></a-mixin>\n<a-mixin id="mine" mixin="beat" beat="type: mine"></a-mixin>\n<a-mixin id="beatShadow" mixin="beat" geometry="primitive: plane; width: 0.7; height: 0.6" rotation="-90 0 0" material="src: #minefxImg; shader: flat; color: #000; transparent: true; opacity: 0.2" render-order="beatShadow"></a-mixin>\n\n<a-mixin id="plume" plume obj-model="obj: #plumeObj"></a-mixin>\n<a-mixin id="arrowBluePlume" mixin="plume" plume="type: arrow; color: blue" materials="name: arrowBluePlume"></a-mixin>\n<a-mixin id="arrowRedPlume" mixin="plume" plume="type: arrow; color: red" materials="name: arrowRedPlume"></a-mixin>\n<a-mixin id="dotBluePlume" mixin="plume" plume="type: dot; color: blue" materials="name: dotBluePlume"></a-mixin>\n<a-mixin id="dotRedPlume" mixin="plume" plume="type: dot; color: red" materials="name: dotRedPlume"></a-mixin>\n<a-mixin id="minePlume" mixin="plume" plume="type: mine" materials="name: minePlume"></a-mixin>\n\n<a-mixin\n id="superCut"\n bind__supercutfx="colorPrimary: colorPrimary; colorSecondary: colorSecondary"\n supercutfx\n geometry="primitive: plane; width: 3; height: 3"\n material="shader: superCutFxShader; transparent: true; depthWrite: false"></a-mixin>\n\n<a-mixin\n id="redBeatBroken"\n obj-model="obj: #beatBrokenObj"\n beat-cut-fx="color: red"\n render-order="beats"></a-mixin>\n<a-mixin\n id="blueBeatBroken"\n obj-model="obj: #beatBrokenObj"\n beat-cut-fx="color: blue"\n render-order="beats"></a-mixin>\n<a-mixin\n id="redDotBroken"\n obj-model="obj: #dotBrokenObj"\n beat-cut-fx="color: red; type: dot"\n render-order="beats"></a-mixin>\n<a-mixin\n id="blueDotBroken"\n obj-model="obj: #dotBrokenObj"\n beat-cut-fx="color: blue; type: dot"\n render-order="beats"></a-mixin>\n\n<a-mixin\n id="redDotPunchBroken"\n gltf-model="#dotPunchBrokenObj"\n beat-cut-fx="color: red; type: dot"\n render-order="beats"></a-mixin>\n<a-mixin\n id="blueDotPunchBroken"\n gltf-model="#dotPunchBrokenObj"\n beat-cut-fx="color: blue; type: dot"\n render-order="beats"></a-mixin>\n\n<a-mixin\n id="redBeatFX"\n bind__material="color: colorPrimary"\n obj-model="obj: #cutfxObj"\n material="shader: cutfxShader; progress: 1"\n render-order="menu"\n animation="property: components.material.material.uniforms.progress.value; from: 0; to: 1; dur: 400; loop: false; easing: linear; startEvents: explode"></a-mixin>\n\n<a-mixin\n id="blueBeatFX"\n bind__material="color: colorSecondary"\n obj-model="obj: #cutfxObj"\n material="shader: cutfxShader; progress: 1"\n render-order="menu"\n animation="property: components.material.material.uniforms.progress.value; from: 0; to: 1; dur: 400; loop: false; easing: linear; startEvents: explode"></a-mixin>\n\n<a-mixin\n id="mineBroken"\n gltf-model="#mineBrokenObj"\n beat-cut-fx="type: mine"\n render-order="beats"></a-mixin>\n\n<a-mixin\n id="mineFX"\n geometry="primitive: plane; width: 0.6; height: 0.6"\n material="shader: flat; transparent: true; src: #minefxImg; color: #fff568; depthWrite: false"\n render-order="menu"\n animation="property: components.material.material.opacity; from:1; to:0; dur: 400; loop: false; easing: linear; startEvents: explode"></a-mixin>\n\n<a-mixin\n id="redPunchFX"\n bind__material="color: colorPrimary"\n obj-model="obj: #punchfxObj"\n material="shader: cutfxShader; progress: 1"\n render-order="menu"\n animation="property: components.material.material.uniforms.progress.value; from: 0; to: 1; dur: 600; loop: false; easing: linear; startEvents: explode"></a-mixin>\n\n<a-mixin\n id="bluePunchFX"\n bind__material="color: colorSecondary"\n obj-model="obj: #punchfxObj"\n material="shader: cutfxShader; progress: 1"\n render-order="menu"\n animation="property: components.material.material.uniforms.progress.value; from: 0; to: 1; dur: 600; loop: false; easing: linear; startEvents: explode"></a-mixin>\n\n<a-mixin\n bind__material="color: colorTertiary"\n id="yellowPunchFX"\n obj-model="obj: #punchfxObj"\n material="shader: cutfxShader; progress: 1"\n render-order="menu"\n animation="property: components.material.material.uniforms.progress.value; from: 0; to: 1; dur: 600; loop: false; easing: linear; startEvents: explode"></a-mixin>\n\n<a-mixin\n id="wall"\n material="shader: wallShader; transparent: true; side: double; opacity: 0"\n animation__fadein="property: components.material.material.uniforms.opacity.value; from: 0; to: 1; easing: easeInCubic; autoplay: false; dur: 1500"\n animation__scalein="property: object3D.position.y; from: -5; to: 0; easing: easeInOutElastic; autoplay: false; dur: 1500"\n render-order\n wall></a-mixin>\n\n<a-mixin\n id="tunnel"\n obj-model="obj: #tunnelObj"\n materials="name: tunnel"></a-mixin>\n\n<a-mixin\n id="bigMenuButton"\n geometry="primitive: plane; width: 1.15; height: 0.23"\n material="shader: panelShader; brightness: 0.5; borderWidth: 0.05; ratio: 4; borderRadius: 0.6"\n animation__mouseenter1="property: components.material.material.uniforms.activePanel.value; from: 0; to: 1; startEvents: mouseenter; pauseEvents: mouseleave; dur: 100"\n animation__mouseleave1="property: components.material.material.uniforms.activePanel.value; from: 1; to: 0; startEvents: mouseleave; pauseEvents: mouseenter; dur: 100"\n animation__mouseenter2="property: scale; from: 1 1 1; to: 1.04 1.04 1.04; startEvents: mouseenter; pauseEvents: mouseleave; dur: 80"\n animation__mouseleave2="property: scale; to: 1 1 1; from: 1.04 1.04 1.04; startEvents: mouseleave; pauseEvents: mouseenter; dur: 80"\n render-order="menubutton"></a-mixin>\n\n<a-mixin id="cancelSoundUI" play-sound__cancel="event: click; sound: #clearSound; volume: 0.5"></a-mixin>\n<a-mixin id="clickSoundUI" play-sound__click="event: click; sound: #confirmSound; volume: 0.25"></a-mixin>\n<a-mixin id="hoverSoundUI" play-sound__hover="event: mouseenter; sound: #hoverSound; volume: 0.1"></a-mixin>\n\x3c!-- </require> --\x3e</require>\n </a-assets>\n\n <a-entity id="beatObjTemplate" obj-model="obj: #beatObj" visible="false"></a-entity>\n <a-entity id="redBeatObjTemplate" obj-model="obj: #redBeatObj" visible="false"></a-entity>\n <a-entity id="blueBeatObjTemplate" obj-model="obj: #blueBeatObj" visible="false"></a-entity>\n <a-entity id="dotRedObjTemplate" obj-model="obj: #dotRedObj" visible="false"></a-entity>\n <a-entity id="dotBlueObjTemplate" obj-model="obj: #dotBlueObj" visible="false"></a-entity>\n <a-entity id="mineObjTemplate" obj-model="obj: #mineObj" visible="false"></a-entity>\n <a-entity id="cursorLaser" obj-model="obj: #laserObj" visible="false"></a-entity>\n\n \x3c!-- <require path="/workspaces/3D-Agent/rider/src/templates/loading.html"> --\x3e\n<a-entity\n id="loadingSongInfoContainer"\n bind__animation__scale="enabled: isLoading"\n bind__visible="isLoading"\n animation__scale="property: scale; from: 1 1 1; to: 1.05 1.05 1.05; dir: alternate; loop: true; dur: 1200; easing: easeInOutCubic"\n position="0 1.5 -2">\n\n <a-entity\n id="loadingMenuBackground"\n bind-toggle__raycastable="isLoading"\n render-order="menu"\n geometry="primitive: plane; width: 1.15; height: 1.2"\n material="shader: panelShader; ratio: 1.15; borderRadius: 0.4"\n position="0 0 -0.03"></a-entity>\n\n <a-entity id="loadingSongImage"\n copy-texture="from: #menuSelectedChallengeImage"\n geometry="primitive: plane; buffer: false; skipCache: true; height: 0.3; width: 0.3"\n material="shader: flat; transparent: false"\n position="0 0.24 0"\n render-order="menu"></a-entity>\n\n <a-entity id="loadingSongInfo">\n <a-entity\n position="0 -0.05 0"\n mixin="font"\n bind__text="color: colorSecondary"\n bind__text-truncate="value: challenge.songSubName + \' - \' + challenge.author"\n text="wrapCount: 40; align: center"\n text-truncate="length: 35"\n render-order="menutext"></a-entity>\n\n <a-entity position="0 -0.13 0"\n mixin="font"\n text="align: center; color: #FFF; wrapCount: 21; baseline: top; lineHeight: 36; width: 0.81"\n bind__text="value: challenge.metadata.songName"\n render-order="menutext"></a-entity>\n\n <a-entity\n id="loadingText"\n mixin="font"\n bind__animation__color="enabled: isLoading"\n bind__text="color: colorPrimary; value: loadingText; wrapCount: hasSongLoadError && 24 || 18"\n bind__visible="isLoading"\n text="align: center; wrapCount: 18; width: 0.65"\n render-order="menutext"\n position="0 -0.32 0.001"></a-entity>\n\n <a-entity\n id="zipLoaderIndicator"\n bind__material="color: colorPrimary"\n bind__visible="isZipFetching"\n geometry="primitive: plane; height: 0.1; width: 0.1"\n material="shader: ring; radiusInner: 0.2; radiusOuter: 0.9; progress: 0; transparent: true"\n render-order="menuitem"\n position="0 -0.4 0.002">\n </a-entity>\n\n <a-entity\n id="songProcessingIndicator"\n bind__animation__spin="enabled: isSongProcessing"\n bind__material="color: colorPrimary"\n bind__visible="isSongProcessing"\n animation__spin="property: object3D.rotation.z; from: 0; to: -360; easing: linear; dur: 1000; loop: true"\n geometry="primitive: plane; height: 0.15; width: 0.15"\n material="shader: ring; radiusInner: 0.2; radiusOuter: 0.4; transparent: true; progress: 0.2"\n render-order="menutext"\n position="0 -0.4 0.004"\n visible="false">\n </a-entity>\n\n <a-entity\n id="loadingCancelButton"\n mixin="bigMenuButton"\n bind-toggle__raycastable="isLoading"\n position="0 -0.67 0.01"\n proxy-event="event: click; to: a-scene; as: songloadcancel">\n <a-entity mixin="font" text="align: center; color: #FAFAFA; wrapCount: 20; value: CANCEL" position="0 -0.065 0.001"></a-entity>\n </a-entity>\n </a-entity>\n</a-entity>\n\x3c!-- </require> --\x3e</require>\n \x3c!-- <require path="/workspaces/3D-Agent/rider/src/templates/stage.html"> --\x3e\n<a-entity\n id="audioAnalyser"\n audioanalyser="fftSize: 32; enableBeatDetection: false; enableLevels: false; enableWaveform: false; enableVolume: false"></a-entity>\n\n<a-entity id="stage" no-frustum-cull follow-z="target: #curveFollowRig">\n <a-entity\n id="backglow"\n obj-model="obj: #backGlowObj"\n materials="name: backglow"\n render-order="stage"></a-entity>\n\n <a-entity\n id="rings"\n obj-model="obj: #ringsObj"\n materials="name: rings"\n position="0 0 -1500"\n render-order="stage"></a-entity>\n\n <a-entity\n id="auroras"\n class="aurora"\n obj-model="obj: #aurorasObj"\n materials="name: aurora"\n render-order="aurora"></a-entity>\n\n <a-entity\n id="merkaba"\n obj-model="obj: #merkabaObj"\n bind__visible="!isVictory && !isGameOver"\n materials="name: merkaba"\n animation="property: rotation; from: 0 0 0; to: 360 360 360; dur: 50000; easing: linear; loop: true"\n position="0 46 -1500"></a-entity>\n\n <a-entity\n class="merkababloom"\n geometry="primitive: plane; width: 200; height: 200"\n material="shader: flat; src: #merkabaBloomImg; blending: additive; depthTest: false; color: #888"\n position="0 46 -1400"\n render-order="stage"></a-entity>\n\n <a-entity\n class="merkababloom"\n bind__material="color: colorTertiary"\n geometry="primitive: plane; width: 250; height: 250"\n animation="property: object3D.rotation.z; from: 0; to: 360; loop: true; easing: linear; dur: 30000"\n material="shader: flat; src: #merkabaBloomImg; blending: additive; depthTest: false"\n position="0 46 -1380"\n render-order="stage"></a-entity>\n\n <a-entity\n id="moon"\n geometry="primitive: plane; width: 1000; height: 500"\n position="0 1000 -1000"\n rotation="45 0 0"\n materials="name: moon"\n ></a-entity>\n\n <a-entity class="stars" stars render-order="particles"></a-entity>\n\n \x3c!-- <require path="/workspaces/3D-Agent/rider/src/templates/intro.html"> --\x3e\n<a-entity\n id="mainLogo"\n geometry="primitive: plane; width: 9; height: 1.125"\n material="shader: flat; src: #logoImg; transparent: true; depthTest: false; blending: additive; opacity: 0"\n position="0 3.3 -2.5"\n rotation="0 0 0"\n scale="0.8 0.8 0.8"\n bind__visible="introActive || menuActive"\n animation__opacity="property: components.material.material.opacity; from: 0; to: 1; dur: 2000; delay: 1000"\n animation__position="property: object3D.position.y; to: 3.4; dur: 2000; easing: easeInOutQuad; startEvents: startgame"></a-entity>\n\n<a-entity\n id="startButton"\n bind__visible-raycastable="introActive"\n geometry="primitive: plane; width: 1; height: 0.35"\n position="0 1.6 -2.2"\n render-order="menu"\n proxy-event="event: click; to: a-scene, #menu, #mainlogo, #menuTopButtons, #menuBackground; as: startgame"\n delayed-proxy-event="event: click; to: a-scene; as: menuopeningend; delay: 1800"\n mixin="bigMenuButton"\n play-sound__hover="event: mouseenter; sound: #hoverSound; volume: 0.1"\n play-sound__click="event: click; sound: #confirmSound; volume: 0.25"\n material="ratio: 3; opacity: 0"\n animation="property: components.material.material.uniforms.opacity.value; from: 0; to: 1; dur: 500; delay: 3000">\n <a-entity\n id="startButtonLabel"\n mixin="font"\n text="value: BEGIN; color: #f0f0f0; align: center; width: 1; wrapCount: 12; opacity: 0"\n position="0 -0.1 0.01"\n animation="property: components.text.material.uniforms.opacity.value; from: 0; to: 1; dur: 500; delay: 3500"\n ></a-entity>\n</a-entity>\n\x3c!-- </require> --\x3e</require>\n</a-entity>\n\x3c!-- </require> --\x3e</require>\n \x3c!-- <require path="/workspaces/3D-Agent/rider/src/templates/menu.html"> --\x3e\n\x3c!-- Macro is a templating function. It is rendered into the HTML below with searchResults(). --\x3e\n\n\n\n<template id="searchResultTemplate">\n <a-entity class="searchResult" bind-item__data-id="item.id" bind-item__data-index="item.index">\n <a-entity class="searchResultBackground" bind-item__active-item="active: menuSelectedChallenge.id === item.id"\n bind-item__animation__mouseenter="enabled: menuSelectedChallenge.id !== item.id"\n bind-item__animation__mouseleave="enabled: menuSelectedChallenge.id !== item.id"\n bind-toggle__raycastable="mainMenuActive || isSearching" bind__material="color: colorPrimary"\n animation__mouseenter="property: components.material.material.opacity; to: 0.4; startEvents: mouseenter; pauseEvents: mouseleave; dur: 75; delay: 1"\n animation__mouseleave="property: components.material.material.opacity; to: 0.0; startEvents: mouseleave; pauseEvents: mouseenter; dur: 75"\n geometry="primitive: plane; width: 1.1; height: 0.2"\n material="shader: flat; transparent: true; opacity: 0.0; src: #selectedImg" position="0 -0.13 -0.002"\n play-sound="event: mouseenter; sound: #hoverSound; volume: 0.03" render-order="menuitem"></a-entity>\n </a-entity>\n </a-entity>\n</template>\n\n\n\x3c!-- Menu container begins here. --\x3e\n<a-entity id="menu" bind__visible="menuActive" position="0 1.4 -2.3"\n animation__position="property: object3D.position.z; to: -2; dur: 1500; easing: easeInOutCubic; delay: 300; startEvents: startgame">\n\n <a-entity id="menuBackground"\n bind__menu-midsection="active: !!menuSelectedChallenge.id && (mainMenuActive || difficultyFilterMenuOpen) || difficultyFilterMenuOpen; selectedChallenge: menuSelectedChallenge.id"\n bind-toggle__raycastable="menuActive || genreMenuOpen || isSearching || difficultyFilterMenuOpen"\n geometry="primitive: plane; width: 3.4; height: 1.82" material="shader: panelShader; ratio: 1.86; opacity: 0"\n animation__opacity="property: components.material.material.uniforms.opacity.value; from: 0; to: 1; dur: 1000; delay: 300; startEvents: startgame"\n animation__midsectionshow="property: components.material.material.uniforms.midSection.value; from: 0; to: 1; dur: 160; startEvents: showdifficultysection; easing: easeOutCubic"\n animation__midsectionhide="property: components.material.material.uniforms.midSection.value; from: 1: to: 0; dur: 160; startEvents: hidedifficultysection; easing: easeOutCubic"\n render-order="menu" position="0 0 -0.005"></a-entity>\n\n <a-entity id="mainMenu" bind__visible="mainMenuActive && !isMenuOpening || isSearching">\n <a-entity id="searchResultsContainer" position="0 0 0.001" class="menuAnimation"\n bind__menu-slide-animation="isSearching: isSearching; menuSelectedChallengeId: menuSelectedChallenge.id"\n animation__menuleft="property: object3D.position.x; to: -0.79; dur: 200; easing: easeOutCubic; autoplay: false"\n animation__menuright="property: object3D.position.x; from: -0.79; to: 0; dur: 200; easing: easeOutCubic; autoplay: false">\n\n \n\x3c!-- TODO: Sort the layout based on the IDs. --\x3e\n<a-entity id="searchResultList"\n bind-for="for: item; in: searchResultsPage; key: id; template: #searchResultTemplate; updateInPlace: true; pool: 6; delay: 25"\n layout="type: box; columns: 1; marginRow: -0.2; orderAttribute: data-index" search-result-list position="0 0.644 0">\n</a-entity>\n\n\x3c!-- All search result text merged and spaced out. --\x3e\n<a-entity id="searchSongNameTexts" mixin="font" bind__text="value: search.songNameTexts" render-order="menutext"\n text="baseline: top; align: left; color: #FAFAFA; wrapCount: 28; lineHeight: 130" position="0.181 0.51943 0.001">\n</a-entity>\n<a-entity id="searchSongSubNameTexts" mixin="font"\n bind__text="color: colorSecondaryBright; value: search.songSubNameTexts" render-order="menutext"\n text="baseline: top; align: left; wrapCount: 42; lineHeight: 190" position="0.181 0.445 0.001">\n</a-entity>\n\n<a-entity id="searchThumbnailImages" bind__search-thumbnail-atlas="dummyUpdater: search.songSubNameTexts"\n bind__visible="searchResultsPage.length > 0" geometry="primitive: plane; buffer: false; width: 0.2; height: 1.2"\n dynamic-texture-atlas="canvasId: thumbnailAtlasMap; canvasWidth: 64; canvasHeight: 512; numColumns: 1; numRows: 6"\n material="shader: flat; transparent: true" render-order="menubutton" position="-0.45 0.0146 0.002"></a-entity>\n\n<a-mixin id="searchPageButton"\n animation__mouseenter="property: components.slice9.material.opacity; from: 0; to: 0.3; startEvents: mouseenter; pauseEvents: mouseleave; dur: 150"\n animation__mouseleave="property: components.slice9.material.opacity; from: 0.3; to: 0; startEvents: mouseleave; pauseEvents: mouseenter; dur: 150"\n mixin="slice" raycaster-target="width: 1; height: 0.32" render-order="menubutton"\n slice9="width: 0.8; color: #08bfa2; height: 0.130; padding: 0.03; opacity: 0"></a-mixin>\n\n<a-entity id="searchPrevPage" mixin="searchPageButton" bind__slice9="color: colorPrimary"\n bind__visible-raycastable="search.hasPrev && (mainMenuActive || isSearching)"\n raycaster-target="bindToggle: search.hasNext && menuActive; position: 0 0.08 0" position="-0 0.69 0.01"\n proxy-event="event: click; to: a-scene; as: searchprevpage; captureBubbles: true">\n <a-entity id="prevArrow" bind__material="color: colorPrimary" geometry="primitive: plane; width: 0.12; height: 0.12"\n material="shader: flat; src: #downIconImg; transparent: true" rotation="0 0 180" position="0 0 -0.001"></a-entity>\n</a-entity>\n\n<a-entity id="searchNextPage" mixin="searchPageButton" bind__slice9="color: colorSecondary"\n raycaster-target="bindToggle: search.hasNext && (mainMenuActive || isSearching); position: 0 -0.08 0"\n position="-0 -0.674 0.01" proxy-event="event: click; to: a-scene; as: searchnextpage; captureBubbles: true"\n bind__visible="search.hasNext">\n <a-entity id="nextArrow" bind__material="color: colorSecondary" geometry="primitive: plane; width: 0.12; height: 0.12"\n material="shader: flat; src: #downIconImg; transparent: true" position="0 0 -0.001"></a-entity>\n</a-entity>\n\n </a-entity>\n\n <a-entity id="menuDifficultiesGroup" position="0 0.18 0">\n\n \x3c!-- Top-aligned. --\x3e\n \x3c!-- Uses bind-for and bind-item to render difficulties. --\x3e\n <a-entity id="menuDifficulties" bind-for="for: item; in: menuDifficultiesIds; updateInPlace: true; pool: 10"\n bind__visible="!!menuSelectedChallenge.id"\n layout="type: box; columns: 1; marginRow: -0.2; orderAttribute: data-bind-for-key" position="0 0.34 0"\n menu-difficulty-select>\n \n <template>\n \x3c!-- Item is a string representing the difficulty. --\x3e\n <a-entity class="difficultyOption" bind-item__data-difficulty="item">\n <a-entity class="difficultyBackground"\n bind-item__active-item="active: (menuSelectedChallenge.difficultyId === item)"\n bind-item__animation__mouseenter="enabled: !(menuSelectedChallenge.difficultyId === item)"\n bind-item__animation__mouseleave="enabled: !(menuSelectedChallenge.difficultyId === item)"\n bind-item__difficulty-background="enabled: menuActive && !!menuSelectedChallenge.id && !(menuSelectedChallenge.difficultyId === item) && !difficultyFilterMenuOpen"\n bind__material="color: colorPrimary" geometry="primitive: plane; width: 0.4; height: 0.2"\n material="shader: flat; transparent: true; opacity: 0.0; src: #difficultyImg" position="0 -0.005 0"\n play-sound="event: mouseenter; sound: #hoverSound; volume: 0.03"\n animation__mouseenter="property: components.material.material.opacity; to: 0.3; startEvents: mouseenter; pauseEvents: mouseleave; dur: 75"\n event-set__mouseenter="visible: true"\n animation__mouseleave="property: components.material.material.opacity; to: 0.0; startEvents: mouseleave; pauseEvents: mouseenter; dur: 75"\n event-set__mouseleave="visible: true; _delay: 160" render-order="menuitem"></a-entity>\n <a-entity class="difficultyText" mixin="font"\n bind-item__active-text-color="active: (menuSelectedChallenge.difficultyId === item)"\n bind-item__difficulty-text="id: item" active-text-color="color: #fff"\n text="wrapCount: 30; align: center; color: #8d8d8d" position="0 -0.057 0.001" render-order="menutext">\n </a-entity>\n </a-entity>\n </template>\n \n </a-entity>\n </a-entity>\n\n \x3c!-- Selected challenge info. --\x3e\n <a-entity id="menuSelectedChallengePanel" bind__visible="!!menuSelectedChallenge.id"\n position="0.8394583182784089 0 0.001">\n <a-entity id="menuFavoriteButton" bind__animation__mouseenter="to: menuSelectedChallenge.isFavorited && 0.25 || 1"\n bind__animation__mouseleave="to: menuSelectedChallenge.isFavorited && 1 || 0.25"\n bind__material="color: colorTertiary; opacity: menuSelectedChallenge.isFavorited && 1 || 0.25"\n bind__raycastable="menuActive && !!menuSelectedChallenge.id"\n animation__mouseenter="property: components.material.material.opacity; startEvents: mouseenter; dur: 150; easing: easeInOutCubic"\n animation__mouseleave="property: components.material.material.opacity; startEvents: mouseleave; dur: 100; easing: easeInOutCubic"\n geometry="primitive: plane; width: 0.1; height: 0.1"\n material="src: #favoriteImg; shader: flat; transparent: true; opacity: 0.25"\n play-sound__hover="event: mouseenter; sound: #hoverSound; volume: 0.1" position="0.46 0.68 0.001"\n proxy-event="event: click; to: a-scene; as: favoritetoggle" render-order="menuitem"></a-entity>\n\n <a-entity id="menuSelectedChallengeImage"\n bind__menu-selected-challenge-image="coverURL: menuSelectedChallenge.coverURL"\n geometry="primitive: plane; height: 0.4; width: 0.4" material="shader: flat" position="0 0.42 0"></a-entity>\n\n <a-entity id="menuSelectedChallengeInfoContainer" position="0 0.058 0">\n <a-entity id="menuSelectedChallengeSongAuthor" mixin="font"\n bind__text="color: colorSecondaryBright; value: (menuSelectedChallenge.metadata.songSubName || menuSelectedChallenge.metadata.songAuthorName || \'Unknown Artist\')" position="0 0.042 0"\n render-order="menutext" text="wrapCount: 40; lineHeight: 40; width: 1.185; align: center; baseline: center">\n </a-entity>\n <a-entity id="menuSelectedChallengeSongName" mixin="font"\n bind__text="color: colorPrimary; value: menuSelectedChallenge.metadata.songName" position="0 -0.059 0"\n render-order="menutext" text="align: center; wrapCount: 31; baseline: top; lineHeight: 36; width: 1.4">\n </a-entity>\n <a-entity id="menuSelectedChallengeInfo" mixin="font" bind__text="value: menuSelectedChallenge.songInfoText"\n mixin="font" position="0 -0.18 0" render-order="menutext"\n text="align: center; color: #989898; wrapCount: 55; lineHeight: 72; width: 1.5; baseline: top"></a-entity>\n </a-entity>\n\n <a-entity id="playButton"\n bind__visible-raycastable="menuActive && !!menuSelectedChallenge.id && !genreMenuOpen && !difficultyFilterMenuOpen && !isIOS && !hasSongLoadError"\n geometry="primitive: plane; width: 0.7; height: 0.25"\n play-sound="event: mouseenter; sound: #hoverSound; volume: 0.03"\n play-sound__click="event: click; sound: #confirmSound; volume: 0.25" position="0 -0.561 0"\n proxy-event="event: click; to: a-scene; as: playbuttonclick"\n material="shader: panelShader; brightness: 0.7; transparent: true; midSection: 0; ratio: 2.8; borderRadius: 0.6; borderWidth: 0.08"\n render-order="menubutton"\n animation__mouseenter1="property: components.material.material.uniforms.activePanel.value; from: 0; to: 1; startEvents: mouseenter; pauseEvents: mouseleave; dur: 100"\n animation__mouseleave1="property: components.material.material.uniforms.activePanel.value; from: 1; to: 0; startEvents: mouseleave; pauseEvents: mouseenter; dur: 100"\n animation__mouseenter2="property: scale; from: 1 1 1; to: 1.1 1.1 1.1; startEvents: mouseenter; pauseEvents: mouseleave; dur: 100"\n animation__mouseleave2="property: scale; to: 1 1 1; from: 1.1 1.1 1.1; startEvents: mouseleave; pauseEvents: mouseenter; dur: 100">\n <a-entity mixin="font" text="align: center; color: #FFF; wrapCount: 15; value: PLAY" position="0 -0.085 0.01">\n </a-entity>\n </a-entity>\n\n <a-entity id="iOSNotice" bind__visible="mainMenuActive && isIOS" mixin="font" position="0 -0.5 0.01"\n text="align: center; baseline: top; color: #FFF; wrapCount: 32; value: Sorry, iOS is currently not playable but support is coming soon!">\n </a-entity>\n\n <a-entity id="menuLoadError" bind__visible="hasSongLoadError" mixin="font" position="0 -0.5 0.01"\n text="align: center; baseline: top; color: #FFF; wrapCount: 32; value: Sorry! There was an error loading this song.">\n </a-entity>\n </a-entity>\n\n <a-entity id="searchError" mixin="font" bind__visible="search.hasError" render-order="menuText"\n text="align: center; value: Sorry, there was an issue fetching search results. Please try again."\n position="0 0 0.01"></a-entity>\n\n <a-entity id="menuNoPlaylists" mixin="font"\n bind__visible="playlist === \'favorites\' && favorites.length === 0 && !menuSelectedChallenge.id"\n render-order="menuText" position="0 0.1 0.01"\n text="align: center; baseline: top; color: #FFF; wrapCount: 32; value: Add a song to your favorites by clicking the star in the top right of the menu after selected a song.">\n </a-entity>\n\n <a-entity id="searchNoResults" mixin="font"\n bind__visible="!isSearching && search.results.length === 0 && playlist !== \'favorites\'" render-order="menuText"\n text="align: center; value: No search results found. Please try again with another query." position="0 0 0.01">\n </a-entity>\n </a-entity>\n\n \x3c!-- <require path="/workspaces/3D-Agent/rider/src/templates/genreMenu.html"> --\x3e\n<a-entity\n id="genreMenu"\n bind-for="for: genre; in: genres; updateInPlace: true; key: name"\n bind__visible="genreMenuOpen"\n layout="type: box; columns: 6; marginRow: 0.4; marginColumn: 0.4; align: center"\n menu-genre\n position="0 0 0.05">\n <template>\n <a-entity class="genre" bind-item__data-genre="item">\n <a-entity\n mixin="slice"\n slice9="opacity: 0.9; width: 0.35; left: 70; top: 70; height: 0.35; padding: 0.07"\n animation__mouseenter2="property: scale; from: 1 1 1; to: 1.03 1.03 1.03; startEvents: mouseenter; pauseEvents: mouseleave; easing: easeOutCubic; dur: 150"\n animation__mouseleave2="property: scale; from: 1.03 1.03 1.03; to: 1 1 1; startEvents: mouseleave; pauseEvents: mouseenter; easing: easeOutCubic; dur: 150"\n proxy-event__enter="event: mouseenter; to: CHILDREN; captureBubbles: true"\n proxy-event__leave="event: mouseleave; to: CHILDREN; captureBubbles: true"\n play-sound__click="event: click; sound: #confirmSound; volume: 0.1"\n raycaster-target="bindToggle: genreMenuOpen; width: 0.35; height: 0.35"\n render-order__nonrecursive="menubutton">\n <a-entity\n mixin="font"\n bind-item__text="value: item.name"\n text="align: center; width: 1.1; color: #888"\n animation__mouseenter="property: components.text.material.uniforms.color.value; from: #888; to: #FFF; type: color; startEvents: mouseenter; pauseEvents: mouseleave; easing: easeOutCubic; dur: 150"\n animation__mouseleave="property: components.text.material.uniforms.color.value; from: #FFF; to: #888; type: color; startEvents: mouseleave; pauseEvents: mouseenter; easing: easeOutCubic; dur: 150"\n render-order="menutext"\n position="0 -0.16 0.001"></a-entity>\n <a-entity\n class="genreIcon"\n bind-item__atlas-uvs="totalColumns: 6; totalRows: 3; row: item.row; column: item.column"\n geometry="primitive: plane; width: 0.22; height: 0.22; buffer: false; skipCache: true"\n position="0 0.04 0.002"\n material="shader: flat; src: #genresImg; transparent: true; color: #888"\n render-order="menutext"\n animation__mouseenter="property: components.material.material.color; type: color; from: #888; to: #FFF; startEvents: mouseenter; pauseEvents: mouseleave; easing: easeOutCubic; dur: 150"\n animation__mouseleave="property: components.material.material.color; type: color; from: #FAFAFA; to: #888; startEvents: mouseleave; pauseEvents: mouseenter; easing: easeOutCubic; dur: 150"></a-entity>\n </a-entity>\n </a-entity>\n </template>\n</a-entity>\n\x3c!-- </require> --\x3e</require>\n \x3c!-- <require path="/workspaces/3D-Agent/rider/src/templates/difficultyMenu.html"> --\x3e\n\n\n\n\n<a-entity\n id="difficultyFilterMenu"\n bind__visible="difficultyFilterMenuOpen"\n layout="type: box; columns: 1; marginRow: -0.2"\n difficulty-filter\n position="0 0.5 0">\n \n \n <a-entity class="difficultyFilterOption" data-difficulty-filter="All">\n <a-entity class="difficultyFilterBackground"\n bind__active-item="active: difficultyFilter === \'All\'"\n bind__animation__mouseenter="enabled: difficultyFilter !== \'All\'"\n bind__animation__mouseleave="enabled: difficultyFilter !== \'All\'"\n bind__animation__mouseentervisible="enabled: difficultyFilter !== \'All\'"\n bind__animation__mouseleavevisible="enabled: difficultyFilter !== \'All\'"\n bind__difficulty-background="enabled: difficultyFilterMenuOpen && difficultyFilter !== \'All\'"\n bind__material="color: colorPrimary"\n animation__mouseenter="property: components.material.material.opacity; to: 0.3; startEvents: mouseenter; dur: 150"\n animation__mouseleave="property: components.material.material.opacity; to: 0.0; startEvents: mouseleave; dur: 75"\n event-set__mouseenter="visible: true"\n event-set__mouseleave="visible: true; _delay: 160"\n geometry="primitive: plane; width: 0.4; height: 0.2"\n material="shader: flat; transparent: true; opacity: 0; src: #difficultyImg"\n position="0 -0.005 0"\n play-sound="event: mouseenter; sound: #hoverSound; volume: 0.03"\n render-order="menuitem"></a-entity>\n <a-entity\n class="difficultyFilterText"\n mixin="font"\n bind__active-text-color="active: difficultyFilter === \'All\'"\n active-text-color="color: #fff"\n difficulty-text="id: All"\n text="wrapCount: 30; align: center; color: #8d8d8d"\n position="0 -0.057 0.001"\n render-order="menutext"></a-entity>\n </a-entity>\n\n \n \n <a-entity class="difficultyFilterOption" data-difficulty-filter="Easy">\n <a-entity class="difficultyFilterBackground"\n bind__active-item="active: difficultyFilter === \'Easy\'"\n bind__animation__mouseenter="enabled: difficultyFilter !== \'Easy\'"\n bind__animation__mouseleave="enabled: difficultyFilter !== \'Easy\'"\n bind__animation__mouseentervisible="enabled: difficultyFilter !== \'Easy\'"\n bind__animation__mouseleavevisible="enabled: difficultyFilter !== \'Easy\'"\n bind__difficulty-background="enabled: difficultyFilterMenuOpen && difficultyFilter !== \'Easy\'"\n bind__material="color: colorPrimary"\n animation__mouseenter="property: components.material.material.opacity; to: 0.3; startEvents: mouseenter; dur: 150"\n animation__mouseleave="property: components.material.material.opacity; to: 0.0; startEvents: mouseleave; dur: 75"\n event-set__mouseenter="visible: true"\n event-set__mouseleave="visible: true; _delay: 160"\n geometry="primitive: plane; width: 0.4; height: 0.2"\n material="shader: flat; transparent: true; opacity: 0; src: #difficultyImg"\n position="0 -0.005 0"\n play-sound="event: mouseenter; sound: #hoverSound; volume: 0.03"\n render-order="menuitem"></a-entity>\n <a-entity\n class="difficultyFilterText"\n mixin="font"\n bind__active-text-color="active: difficultyFilter === \'Easy\'"\n active-text-color="color: #fff"\n difficulty-text="id: Easy"\n text="wrapCount: 30; align: center; color: #8d8d8d"\n position="0 -0.057 0.001"\n render-order="menutext"></a-entity>\n </a-entity>\n\n \n \n <a-entity class="difficultyFilterOption" data-difficulty-filter="Normal">\n <a-entity class="difficultyFilterBackground"\n bind__active-item="active: difficultyFilter === \'Normal\'"\n bind__animation__mouseenter="enabled: difficultyFilter !== \'Normal\'"\n bind__animation__mouseleave="enabled: difficultyFilter !== \'Normal\'"\n bind__animation__mouseentervisible="enabled: difficultyFilter !== \'Normal\'"\n bind__animation__mouseleavevisible="enabled: difficultyFilter !== \'Normal\'"\n bind__difficulty-background="enabled: difficultyFilterMenuOpen && difficultyFilter !== \'Normal\'"\n bind__material="color: colorPrimary"\n animation__mouseenter="property: components.material.material.opacity; to: 0.3; startEvents: mouseenter; dur: 150"\n animation__mouseleave="property: components.material.material.opacity; to: 0.0; startEvents: mouseleave; dur: 75"\n event-set__mouseenter="visible: true"\n event-set__mouseleave="visible: true; _delay: 160"\n geometry="primitive: plane; width: 0.4; height: 0.2"\n material="shader: flat; transparent: true; opacity: 0; src: #difficultyImg"\n position="0 -0.005 0"\n play-sound="event: mouseenter; sound: #hoverSound; volume: 0.03"\n render-order="menuitem"></a-entity>\n <a-entity\n class="difficultyFilterText"\n mixin="font"\n bind__active-text-color="active: difficultyFilter === \'Normal\'"\n active-text-color="color: #fff"\n difficulty-text="id: Normal"\n text="wrapCount: 30; align: center; color: #8d8d8d"\n position="0 -0.057 0.001"\n render-order="menutext"></a-entity>\n </a-entity>\n\n \n \n <a-entity class="difficultyFilterOption" data-difficulty-filter="Hard">\n <a-entity class="difficultyFilterBackground"\n bind__active-item="active: difficultyFilter === \'Hard\'"\n bind__animation__mouseenter="enabled: difficultyFilter !== \'Hard\'"\n bind__animation__mouseleave="enabled: difficultyFilter !== \'Hard\'"\n bind__animation__mouseentervisible="enabled: difficultyFilter !== \'Hard\'"\n bind__animation__mouseleavevisible="enabled: difficultyFilter !== \'Hard\'"\n bind__difficulty-background="enabled: difficultyFilterMenuOpen && difficultyFilter !== \'Hard\'"\n bind__material="color: colorPrimary"\n animation__mouseenter="property: components.material.material.opacity; to: 0.3; startEvents: mouseenter; dur: 150"\n animation__mouseleave="property: components.material.material.opacity; to: 0.0; startEvents: mouseleave; dur: 75"\n event-set__mouseenter="visible: true"\n event-set__mouseleave="visible: true; _delay: 160"\n geometry="primitive: plane; width: 0.4; height: 0.2"\n material="shader: flat; transparent: true; opacity: 0; src: #difficultyImg"\n position="0 -0.005 0"\n play-sound="event: mouseenter; sound: #hoverSound; volume: 0.03"\n render-order="menuitem"></a-entity>\n <a-entity\n class="difficultyFilterText"\n mixin="font"\n bind__active-text-color="active: difficultyFilter === \'Hard\'"\n active-text-color="color: #fff"\n difficulty-text="id: Hard"\n text="wrapCount: 30; align: center; color: #8d8d8d"\n position="0 -0.057 0.001"\n render-order="menutext"></a-entity>\n </a-entity>\n\n \n \n <a-entity class="difficultyFilterOption" data-difficulty-filter="Expert">\n <a-entity class="difficultyFilterBackground"\n bind__active-item="active: difficultyFilter === \'Expert\'"\n bind__animation__mouseenter="enabled: difficultyFilter !== \'Expert\'"\n bind__animation__mouseleave="enabled: difficultyFilter !== \'Expert\'"\n bind__animation__mouseentervisible="enabled: difficultyFilter !== \'Expert\'"\n bind__animation__mouseleavevisible="enabled: difficultyFilter !== \'Expert\'"\n bind__difficulty-background="enabled: difficultyFilterMenuOpen && difficultyFilter !== \'Expert\'"\n bind__material="color: colorPrimary"\n animation__mouseenter="property: components.material.material.opacity; to: 0.3; startEvents: mouseenter; dur: 150"\n animation__mouseleave="property: components.material.material.opacity; to: 0.0; startEvents: mouseleave; dur: 75"\n event-set__mouseenter="visible: true"\n event-set__mouseleave="visible: true; _delay: 160"\n geometry="primitive: plane; width: 0.4; height: 0.2"\n material="shader: flat; transparent: true; opacity: 0; src: #difficultyImg"\n position="0 -0.005 0"\n play-sound="event: mouseenter; sound: #hoverSound; volume: 0.03"\n render-order="menuitem"></a-entity>\n <a-entity\n class="difficultyFilterText"\n mixin="font"\n bind__active-text-color="active: difficultyFilter === \'Expert\'"\n active-text-color="color: #fff"\n difficulty-text="id: Expert"\n text="wrapCount: 30; align: center; color: #8d8d8d"\n position="0 -0.057 0.001"\n render-order="menutext"></a-entity>\n </a-entity>\n\n \n \n <a-entity class="difficultyFilterOption" data-difficulty-filter="Expertplus">\n <a-entity class="difficultyFilterBackground"\n bind__active-item="active: difficultyFilter === \'Expertplus\'"\n bind__animation__mouseenter="enabled: difficultyFilter !== \'Expertplus\'"\n bind__animation__mouseleave="enabled: difficultyFilter !== \'Expertplus\'"\n bind__animation__mouseentervisible="enabled: difficultyFilter !== \'Expertplus\'"\n bind__animation__mouseleavevisible="enabled: difficultyFilter !== \'Expertplus\'"\n bind__difficulty-background="enabled: difficultyFilterMenuOpen && difficultyFilter !== \'Expertplus\'"\n bind__material="color: colorPrimary"\n animation__mouseenter="property: components.material.material.opacity; to: 0.3; startEvents: mouseenter; dur: 150"\n animation__mouseleave="property: components.material.material.opacity; to: 0.0; startEvents: mouseleave; dur: 75"\n event-set__mouseenter="visible: true"\n event-set__mouseleave="visible: true; _delay: 160"\n geometry="primitive: plane; width: 0.4; height: 0.2"\n material="shader: flat; transparent: true; opacity: 0; src: #difficultyImg"\n position="0 -0.005 0"\n play-sound="event: mouseenter; sound: #hoverSound; volume: 0.03"\n render-order="menuitem"></a-entity>\n <a-entity\n class="difficultyFilterText"\n mixin="font"\n bind__active-text-color="active: difficultyFilter === \'Expertplus\'"\n active-text-color="color: #fff"\n difficulty-text="id: Expertplus"\n text="wrapCount: 30; align: center; color: #8d8d8d"\n position="0 -0.057 0.001"\n render-order="menutext"></a-entity>\n </a-entity>\n\n \n</a-entity>\n\x3c!-- </require> --\x3e</require>\n \x3c!-- <require path="/workspaces/3D-Agent/rider/src/templates/optionsMenu.html"> --\x3e\n<a-entity\n id="optionsMenu"\n bind__visible="optionsMenuOpen"\n position="0 0.5 0.01"\n render-order="menutext">\n\n <a-entity id="optionsTitle" mixin="font" text="align: center; value: OPTIONS; width: 2.5"></a-entity>\n\n <a-entity id="colorOptionsContainer" position="0 -0.25 0">\n <a-entity id="colorTitle" mixin="font" text="align: center; value: THEMES; width: 2"></a-entity>\n\n <a-entity id="colorOptions" position="-0.79 -0.175 0.00" layout="type: box; columns: 10; margin: 0.2" materials-color-menu>\n \n <a-entity\n class="colorOption"\n data-color-name="Super Medium"\n data-color-scheme="default"\n mixin="clickSoundUI hoverSoundUI"\n animation__mouseenter="property: scale; to: 1.2 1.2 1.2; dur: 150; easing: easeInOutCubic; startEvents: mouseenter"\n animation__mouseleave="property: scale; to: 1 1 1; dur: 125; easing: easeInOutCubic; startEvents: mouseleave"\n geometry="primitive: plane; width: 0.15; height: 0.15"\n material="shader: gradientShader; color1: #f971c3; color2: #6ff9ea; transparent: true"\n render-order="menutext"\n bind-toggle__raycastable="optionsMenuOpen">\n </a-entity>\n \n <a-entity\n class="colorOption"\n data-color-name="Star Warrior"\n data-color-scheme="blue"\n mixin="clickSoundUI hoverSoundUI"\n animation__mouseenter="property: scale; to: 1.2 1.2 1.2; dur: 150; easing: easeInOutCubic; startEvents: mouseenter"\n animation__mouseleave="property: scale; to: 1 1 1; dur: 125; easing: easeInOutCubic; startEvents: mouseleave"\n geometry="primitive: plane; width: 0.15; height: 0.15"\n material="shader: gradientShader; color1: #1e4482; color2: #c27727; transparent: true"\n render-order="menutext"\n bind-toggle__raycastable="optionsMenuOpen">\n </a-entity>\n \n <a-entity\n class="colorOption"\n data-color-name="Galactic Royal"\n data-color-scheme="purple"\n mixin="clickSoundUI hoverSoundUI"\n animation__mouseenter="property: scale; to: 1.2 1.2 1.2; dur: 150; easing: easeInOutCubic; startEvents: mouseenter"\n animation__mouseleave="property: scale; to: 1 1 1; dur: 125; easing: easeInOutCubic; startEvents: mouseleave"\n geometry="primitive: plane; width: 0.15; height: 0.15"\n material="shader: gradientShader; color1: #6A39B3; color2: #FAF239; transparent: true"\n render-order="menutext"\n bind-toggle__raycastable="optionsMenuOpen">\n </a-entity>\n \n <a-entity\n class="colorOption"\n data-color-name="Space Joker"\n data-color-scheme="green"\n mixin="clickSoundUI hoverSoundUI"\n animation__mouseenter="property: scale; to: 1.2 1.2 1.2; dur: 150; easing: easeInOutCubic; startEvents: mouseenter"\n animation__mouseleave="property: scale; to: 1 1 1; dur: 125; easing: easeInOutCubic; startEvents: mouseleave"\n geometry="primitive: plane; width: 0.15; height: 0.15"\n material="shader: gradientShader; color1: #779E37; color2: #6A39B3; transparent: true"\n render-order="menutext"\n bind-toggle__raycastable="optionsMenuOpen">\n </a-entity>\n \n <a-entity\n class="colorOption"\n data-color-name="Solar Flare"\n data-color-scheme="yellow"\n mixin="clickSoundUI hoverSoundUI"\n animation__mouseenter="property: scale; to: 1.2 1.2 1.2; dur: 150; easing: easeInOutCubic; startEvents: mouseenter"\n animation__mouseleave="property: scale; to: 1 1 1; dur: 125; easing: easeInOutCubic; startEvents: mouseleave"\n geometry="primitive: plane; width: 0.15; height: 0.15"\n material="shader: gradientShader; color1: #C2C04C; color2: #E03A3E; transparent: true"\n render-order="menutext"\n bind-toggle__raycastable="optionsMenuOpen">\n </a-entity>\n \n <a-entity\n class="colorOption"\n data-color-name="Trail Blazer"\n data-color-scheme="red"\n mixin="clickSoundUI hoverSoundUI"\n animation__mouseenter="property: scale; to: 1.2 1.2 1.2; dur: 150; easing: easeInOutCubic; startEvents: mouseenter"\n animation__mouseleave="property: scale; to: 1 1 1; dur: 125; easing: easeInOutCubic; startEvents: mouseleave"\n geometry="primitive: plane; width: 0.15; height: 0.15"\n material="shader: gradientShader; color1: #E03A3E; color2: #DADADA; transparent: true"\n render-order="menutext"\n bind-toggle__raycastable="optionsMenuOpen">\n </a-entity>\n \n <a-entity\n class="colorOption"\n data-color-name="Mint Choco"\n data-color-scheme="rgb"\n mixin="clickSoundUI hoverSoundUI"\n animation__mouseenter="property: scale; to: 1.2 1.2 1.2; dur: 150; easing: easeInOutCubic; startEvents: mouseenter"\n animation__mouseleave="property: scale; to: 1 1 1; dur: 125; easing: easeInOutCubic; startEvents: mouseleave"\n geometry="primitive: plane; width: 0.15; height: 0.15"\n material="shader: gradientShader; color1: #34eb89; color2: #34ebd8; transparent: true"\n render-order="menutext"\n bind-toggle__raycastable="optionsMenuOpen">\n </a-entity>\n \n <a-entity\n class="colorOption"\n data-color-name="Cheetah SoL"\n data-color-scheme="cheetah"\n mixin="clickSoundUI hoverSoundUI"\n animation__mouseenter="property: scale; to: 1.2 1.2 1.2; dur: 150; easing: easeInOutCubic; startEvents: mouseenter"\n animation__mouseleave="property: scale; to: 1 1 1; dur: 125; easing: easeInOutCubic; startEvents: mouseleave"\n geometry="primitive: plane; width: 0.15; height: 0.15"\n material="shader: gradientShader; color1: #c27727; color2: #635c54; transparent: true"\n render-order="menutext"\n bind-toggle__raycastable="optionsMenuOpen">\n </a-entity>\n \n <a-entity\n class="colorOption"\n data-color-name="Ash Nova"\n data-color-scheme="black"\n mixin="clickSoundUI hoverSoundUI"\n animation__mouseenter="property: scale; to: 1.2 1.2 1.2; dur: 150; easing: easeInOutCubic; startEvents: mouseenter"\n animation__mouseleave="property: scale; to: 1 1 1; dur: 125; easing: easeInOutCubic; startEvents: mouseleave"\n geometry="primitive: plane; width: 0.15; height: 0.15"\n material="shader: gradientShader; color1: #555; color2: #FFF; transparent: true"\n render-order="menutext"\n bind-toggle__raycastable="optionsMenuOpen">\n </a-entity>\n \n </a-entity>\n\n <a-entity\n id="colorName"\n mixin="font"\n text="align: center; color: #CCC; width: 1"\n position="0 -0.35 0.1"\n render-order="menutext"></a-entity>\n </a-entity>\n</a-entity>\n\x3c!-- </require> --\x3e</require>\n \x3c!-- <require path="/workspaces/3D-Agent/rider/src/templates/playlistMenu.html"> --\x3e\n<a-entity\n id="playlistMenu"\n bind-for="for: playlist; in: playlists; updateInPlace: true; key: name"\n bind__visible="playlistMenuOpen"\n layout="type: box; columns: 2; marginRow: -0.23; marginColumn: 1.3; align: center"\n menu-playlist\n position="0 0 0.05">\n <template>\n \n <a-entity class="playlist" data-playlist="{{ item.name }}" data-title="{{ item.title }}">\n \n <a-entity\n mixin="slice"\n slice9="opacity: 0.9; width: 1.2; left: 70; top: 70; height: 0.19; padding: 0.07"\n animation__mouseenter="property: scale; from: 1 1 1; to: 1.03 1.03 1.03; startEvents: mouseenter; pauseEvents: mouseleave; easing: easeOutCubic; dur: 150"\n animation__mouseleave="property: scale; from: 1.03 1.03 1.03; to: 1 1 1; startEvents: mouseleave; pauseEvents: mouseenter; easing: easeOutCubic; dur: 150"\n proxy-event__enter="event: mouseenter; to: CHILDREN; captureBubbles: true"\n proxy-event__leave="event: mouseleave; to: CHILDREN; captureBubbles: true"\n play-sound__click="event: click; sound: #confirmSound; volume: 0.1"\n raycaster-target="bindToggle: playlistMenuOpen; width: 1.2; height: 0.19"\n render-order__nonrecursive="menubutton">\n <a-entity\n class="playlistTitle"\n mixin="font"\n bind-item__text-uppercase="value: item.title"\n text="align: left; width: 1.3; color: #CCC"\n animation__mouseenter="property: components.text.material.uniforms.color.value; from: #CCC; to: #FFF; type: color; startEvents: mouseenter; pauseEvents: mouseleave; easing: easeOutCubic; dur: 150"\n animation__mouseleave="property: components.text.material.uniforms.color.value; from: #FFF; to: #CCC; type: color; startEvents: mouseleave; pauseEvents: mouseenter; easing: easeOutCubic; dur: 150"\n render-order="menutext"\n position="0.11 -0.01 0.001"></a-entity>\n\n <a-entity\n class="playlistAuthor"\n mixin="font"\n bind-item__text="value: item.author"\n bind__text="color: colorPrimary"\n text="align: left; width: 1.1"\n render-order="menutext"\n position="0.01 -0.08 0.001"></a-entity>\n </a-entity>\n </a-entity>\n </template>\n</a-entity>\n\x3c!-- </require> --\x3e</require>\n</a-entity>\n\n\x3c!-- Search. --\x3e\n<a-entity id="keyboard"\n bind__super-keyboard="hand: activeHand === \'left\' && \'#leftHand\' || \'#rightHand\'; show: isSearching"\n super-keyboard="label: Search on beatsaver.com; inputColor: #fff; labelColor: #f0f0f0; width: 1.5; hand: #rightHand; imagePath: assets/img/keyboard; font: assets/fonts/Viga-Regular.json; align: center; model: superkeyboard; keyColor: #fff; injectToRaycasterObjects: false; filters: allupper; keyHoverColor: #fff"\n position="0.58 1.2 -1.95" keyboard-raycastable="condition: isSearching" search\n proxy-event__dismiss="event: superkeyboarddismiss; to: a-scene; as: keyboardclose"\n proxy-event__accept="event: superkeyboardinput; to: a-scene; as: keyboardclose" render-order="menubutton"\n render-order-recursive>\n</a-entity>\n\n<a-entity id="backButton" mixin="bigMenuTopButton"\n bind__visible-raycastable="genreMenuOpen || isSearching || difficultyFilterMenuOpen || playlistMenuOpen || optionsMenuOpen"\n position="0 2.32 -1.96" play-sound__hover="event: mouseenter; sound: #hoverSound; volume: 0.1"\n proxy-event="event: click; to: a-scene; as: menuback">\n <a-entity mixin="font" text="align: center; color: #FFF; wrapCount: 20; value: BACK" position="0 -0.07 0.01">\n </a-entity>\n</a-entity>\n\n\x3c!-- Top menu buttons. --\x3e\n<a-mixin id="bigMenuTopButton" mixin="bigMenuButton" geometry="height: 0.17; width: 0.7"></a-mixin>\n<a-mixin id="bigMenuTopButtonFont" mixin="font" text="width: 0.75" position="0 -0.05 0.01"></a-mixin>\n<a-entity id="menuTopButtons"\n animation__position="property: object3D.position.z; to: -1.98; dur: 1500; easing: easeInOutCubic; delay: 300; startEvents: startgame"\n layout="type: line; margin: 0.65" position="-0.95 2.30 -1.96"\n proxy-event="event: startgame; to: #searchButton, #difficultyButton, #genreButton, #playlistButton, #optionButton">\n\n \x3c!-- Playlist menu toggle. --\x3e\n <a-entity id="playlistButtons">\n <a-entity id="playlistButton"\n mixin="bigMenuTopButton"\n bind__menu-playlist-button="isFavorited: menuSelectedChallenge.isFavorited; selectedChallenge: menuSelectedChallenge.id"\n bind__visible-raycastable="mainMenuActive && !playlist"\n material="opacity: 0"\n animation__opacity="property: components.material.material.uniforms.opacity.value; from: 0; to: 1; dur: 1000; delay: 300; startEvents: startgame"\n play-sound__hover="event: mouseenter; sound: #hoverSound; volume: 0.1"\n proxy-event="event: click; to: a-scene; as: playlistmenuopen">\n <a-entity mixin="bigMenuTopButtonFont" text="align: center; color: #FFF; wrapCount: 20; value: PLAYLISTS" bind__visible="!isMenuOpening"></a-entity>\n </a-entity>\n\n <a-entity id="clearPlaylistButton"\n mixin="bigMenuTopButton"\n bind__visible-raycastable="menuActive && !!playlist"\n play-sound__hover="event: mouseenter; sound: #hoverSound; volume: 0.1"\n play-sound__click="event: click; sound: #clearSound"\n proxy-event="event: click; to: a-scene; as: playlistclear">\n <a-entity mixin="bigMenuTopButtonFont" text="align: center; color: #FFF; wrapCount: 20; value: CLEAR PLAYLIST"></a-entity>\n </a-entity>\n\n <a-entity\n id="playlistText"\n mixin="font"\n bind__text="color: colorPrimary"\n bind__text-uppercase="value: playlistTitle"\n bind__visible="mainMenuActive && !!playlist"\n text="align: center; baseline: bottom; wrapCount: 30; width: 0.7"\n position="0 0.1 0.035"\n render-order="menutext"></a-entity>\n </a-entity>\n\n \x3c!-- Search toggle. --\x3e\n <a-entity id="searchButtons">\n <a-entity\n id="searchButton"\n mixin="bigMenuTopButton"\n bind__visible-raycastable="mainMenuActive && !search.query"\n material="opacity: 0"\n animation__opacity="property: components.material.material.uniforms.opacity.value; from: 0; to: 1; dur: 1000; delay: 300; startEvents: startgame"\n play-sound__hover="event: mouseenter; sound: #hoverSound; volume: 0.1"\n proxy-event="event: click; to: a-scene; as: keyboardopen">\n <a-entity mixin="bigMenuTopButtonFont" text="align: center; color: #FFF; wrapCount: 20; value: SEARCH" bind__visible="!isMenuOpening"></a-entity>\n </a-entity>\n\n <a-entity id="searchClearButton"\n mixin="bigMenuTopButton"\n bind__visible-raycastable="mainMenuActive && !!search.query"\n play-sound__hover="event: mouseenter; sound: #hoverSound; volume: 0.1"\n play-sound__click="event: click; sound: #clearSound"\n proxy-event="event: click; to: a-scene; as: searchclear">\n <a-entity mixin="bigMenuTopButtonFont" text="align: center; color: #FFF; wrapCount: 20; value: CLEAR SEARCH"></a-entity>\n </a-entity>\n\n <a-entity\n id="searchText"\n mixin="font"\n bind__text="color: colorPrimary"\n bind__text-uppercase="value: search.queryText"\n bind__visible="mainMenuActive && !!search.query"\n text="align: center; wrapCount: 20"\n position="0 0.1 0.035"\n render-order="menutext"></a-entity>\n </a-entity>\n\n \x3c!-- Difficulty menu toggle. --\x3e\n \x3c!-- <a-entity id="difficultyFilter">\n <a-entity id="difficultyButton"\n mixin="bigMenuTopButton"\n material="opacity: 0"\n bind__visible-raycastable="mainMenuActive"\n animation__opacity="property: components.material.material.uniforms.opacity.value; from: 0; to: 1; dur: 1000; delay: 300; startEvents: startgame"\n play-sound__hover="event: mouseenter; sound: #hoverSound; volume: 0.1"\n proxy-event="event: click; to: a-scene; as: difficultyfiltermenuopen">\n <a-entity mixin="bigMenuTopButtonFont" text="align: center; color: #FFF; wrapCount: 20; value: DIFFICULTY" bind__visible="!isMenuOpening"></a-entity>\n </a-entity>\n\n <a-entity\n id="difficultyFilterText"\n mixin="font"\n bind__difficulty-text="difficulty: difficultyFilter"\n bind__text="color: colorPrimary"\n bind__visible="mainMenuActive && difficultyFilter !== \'All\'"\n text="align: center; wrapCount: 20"\n position="0 0.1 0.035"\n render-order="menutext"></a-entity>\n </a-entity> --\x3e\n\n \x3c!-- Genre menu toggle. --\x3e\n <a-entity id="genreButtons">\n <a-entity id="genreButton"\n mixin="bigMenuTopButton"\n bind__visible-raycastable="mainMenuActive && !genre"\n material="opacity: 0"\n animation__opacity="property: components.material.material.uniforms.opacity.value; from: 0; to: 1; dur: 1000; delay: 300; startEvents: startgame"\n play-sound__hover="event: mouseenter; sound: #hoverSound; volume: 0.1"\n proxy-event="event: click; to: a-scene; as: genremenuopen">\n <a-entity mixin="bigMenuTopButtonFont" text="align: center; color: #FFF; wrapCount: 20; value: GENRES" bind__visible="!isMenuOpening"></a-entity>\n </a-entity>\n\n <a-entity id="clearGenreButton"\n mixin="bigMenuTopButton"\n bind__visible-raycastable="mainMenuActive && !!genre"\n play-sound__hover="event: mouseenter; sound: #hoverSound; volume: 0.1"\n play-sound__click="event: click; sound: #clearSound"\n proxy-event="event: click; to: a-scene; as: genreclear">\n <a-entity mixin="bigMenuTopButtonFont" text="align: center; color: #FFF; wrapCount: 20; value: CLEAR GENRE"></a-entity>\n </a-entity>\n\n <a-entity\n id="genreText"\n mixin="font"\n bind__text="color: colorPrimary"\n bind__text-uppercase="value: genre"\n bind__visible="mainMenuActive && !!genre"\n text="align: center; wrapCount: 20"\n position="0 0.1 0.035"\n render-order="menutext"></a-entity>\n </a-entity>\n</a-entity>\n\n\x3c!-- Options menu toggle. --\x3e\n<a-entity id="optionsButtons" position="0 0.45 -1.96">\n <a-entity id="optionButton" mixin="bigMenuButton" bind__visible-raycastable="mainMenuActive" material="opacity: 0"\n animation__opacity="property: components.material.material.uniforms.opacity.value; from: 0; to: 1; dur: 1000; delay: 300; startEvents: startgame"\n play-sound__hover="event: mouseenter; sound: #hoverSound; volume: 0.1"\n proxy-event="event: click; to: a-scene; as: optionsmenuopen">\n <a-entity mixin="bigMenuTopButtonFont" text="align: center; color: #FFF; wrapCount: 20; value: THEMES"\n bind__visible="!isMenuOpening"></a-entity>\n </a-entity>\n</a-entity>\x3c!-- </require> --\x3e</require>\n \x3c!-- <require path="/workspaces/3D-Agent/rider/src/templates/modes.html"> --\x3e\n<a-mixin\n id="modeAnimations"\n animation__select="property: object3D.position.z; to: 0.06; dur: 200; easing: easeOutQuad; startEvents: select"\n animation__deselect="property: object3D.position.z; to: 0; dur: 200; easing: easeOutQuad; startEvents: deselect"></a-mixin>\n\n<a-mixin\n id="modeThumbAnimations"\n animation__select="property: components.material.material.color; type: color; to: #FFF; dur: 200; easing: easeOutQuad; startEvents: select"\n animation__deselect="property: components.material.material.color; type: color; to: #888; dur: 200; easing: easeOutQuad; startEvents: deselect"></a-mixin>\n\n<a-mixin\n id="modeBackgroundHover"\n animation__mouseenter="property: components.material.material.uniforms.borderWidth.value; from: 0.002; to: 0.01; startEvents: mouseenter; pauseEvents: mouseleave; easing: linear; dur: 150"\n animation__mouseleave="property: components.material.material.uniforms.borderWidth.value; from: 0.01; to: 0.002; startEvents: mouseleave; pauseEvents: mouseenter; easing: linear; dur: 150"\n play-sound__hover="event: mouseenter; sound: #hoverSound; volume: 0.3"\n play-sound__click="event: click; sound: #confirmSound; volume: 0.1"\n\n ></a-mixin>\n\n<a-mixin\n id="modeBackgroundSelect"\n animation__select="property: components.material.material.uniforms.brightness.value; to: 0.5; startEvents: select; easing: easeOutQuad; dur: 200"\n animation__deselect="property: components.material.material.uniforms.brightness.value; to: 0.1; startEvents: deselect; easing: easeOutQuad; dur: 200"\n animation__select2="property: components.material.material.uniforms.borderWidth.value; to: 0.015; startEvents: select; easing: linear; dur: 200"\n animation__deselect2="property: components.material.material.uniforms.borderWidth.value; to: 0.002; startEvents: deselect; easing: linear; dur: 200"></a-mixin>\n\n\n\n<a-entity\n id="modes"\n bind__menu-mode="colorScheme: colorScheme; hasVR: hasVR"\n bind__position="hasVR && \'-2.56 1.3 -0.7\' || \'-2.56 1 -0.7\'"\n bind__visible="menuActive && !isMenuOpening"\n rotation="0 60 0"\n render-order="menuitem">\n\n <a-entity id="modeIcon"\n geometry="primitive: cylinder; height: 0.01; segmentsHeight: 1; radius: 0.1; segmentsRadial: 3"\n rotation="0 90 90"\n position="-1.275 0.32 0.1"\n materials="name: merkaba"\n animation="property: object3D.position.x; from: -1.275; to: -1.3; dir: alternate; easing: easeOutQuad; loop: true; dur: 900"></a-entity>\n\n <a-entity id="mode2d" bind__visible="!hasVR">\n \n\n<a-entity\n id="moderide2d"\n class="modeItem"\n data-mode="ride"\n data-name="ride2d"\n position="0 0.75 0"\n mixin="modeAnimations">\n <a-entity\n class="modeBackground"\n bind-toggle__raycastable="menuActive && !hasVR"\n position="0 0 -0.01"\n geometry="primitive: plane; width: 3; height: 0.8"\n material="shader: panelShader; brightness: 0.1; ratio: 4; borderWidth: 0.002"\n mixin="modeBackgroundHover modeBackgroundSelect"></a-entity>\n <a-entity\n class="modeTitle"\n mixin="font"\n text="align: left; value: RIDE\nMODE; lineHeight: 45; width: 2.6"\n render-order="menutext"\n position="0.14 0.05 0"></a-entity>\n <a-entity\n class="modeThumb"\n mixin="modeThumbAnimations"\n geometry="primitive: plane; width: 0.7; height: 0.5"\n material="src: #modeRideImg; shader: flat"\n position="-0.20 0 0"></a-entity>\n <a-entity\n class="modeInstructions"\n mixin="font"\n render-order="menutext"\n bind__text="color: colorPrimary"\n text="value: Relax and enjoy the ride.; width: 1.6; lineHeight: 47"\n position="1.1 -0.05 0"></a-entity>\n</a-entity>\n\n \n\n<a-entity\n id="modeviewer2d"\n class="modeItem"\n data-mode="classic"\n data-name="viewer2d"\n position="0 0 0"\n mixin="modeAnimations">\n <a-entity\n class="modeBackground"\n bind-toggle__raycastable="menuActive && !hasVR"\n position="0 0 -0.01"\n geometry="primitive: plane; width: 3; height: 0.8"\n material="shader: panelShader; brightness: 0.1; ratio: 4; borderWidth: 0.002"\n mixin="modeBackgroundHover modeBackgroundSelect"></a-entity>\n <a-entity\n class="modeTitle"\n mixin="font"\n text="align: left; value: VIEWER\nMODE; lineHeight: 45; width: 2.6"\n render-order="menutext"\n position="0.14 0.05 0"></a-entity>\n <a-entity\n class="modeThumb"\n mixin="modeThumbAnimations"\n geometry="primitive: plane; width: 0.7; height: 0.5"\n material="src: #modeViewerImg; shader: flat"\n position="-0.20 0 0"></a-entity>\n <a-entity\n class="modeInstructions"\n mixin="font"\n render-order="menutext"\n bind__text="color: colorPrimary"\n text="value: View the beat map.\n\nConnect a VR headset\nwith controllers\nto experience\nmore modes!; width: 1.6; lineHeight: 47"\n position="1.1 -0.05 0"></a-entity>\n</a-entity>\n\n </a-entity>\n\n <a-entity id="modeVR" bind__visible="hasVR">\n \n\n<a-entity\n id="modepunchvr"\n class="modeItem"\n data-mode="punch"\n data-name="punchvr"\n position="0 0.75 0"\n mixin="modeAnimations">\n <a-entity\n class="modeBackground"\n bind-toggle__raycastable="menuActive && hasVR"\n position="0 0 -0.01"\n geometry="primitive: plane; width: 3; height: 0.8"\n material="shader: panelShader; brightness: 0.1; ratio: 4; borderWidth: 0.002"\n mixin="modeBackgroundHover modeBackgroundSelect"></a-entity>\n <a-entity\n class="modeTitle"\n mixin="font"\n text="align: left; value: PUNCH\nMODE; lineHeight: 45; width: 2.6"\n render-order="menutext"\n position="0.14 0.05 0"></a-entity>\n <a-entity\n class="modeThumb"\n mixin="modeThumbAnimations"\n geometry="primitive: plane; width: 0.7; height: 0.5"\n material="src: #modePunchImg; shader: flat"\n position="-0.20 0 0"></a-entity>\n <a-entity\n class="modeInstructions"\n mixin="font"\n render-order="menutext"\n bind__text="color: colorPrimary"\n text="value: Punch the beats, mind\ncolor.\n\nAvoid all things yellow.\n\nPunch harder\n for better score.; width: 1.6; lineHeight: 47"\n position="1.1 -0.05 0"></a-entity>\n</a-entity>\n\n \n\n<a-entity\n id="moderidevr"\n class="modeItem"\n data-mode="ride"\n data-name="ridevr"\n position="0 0 0"\n mixin="modeAnimations">\n <a-entity\n class="modeBackground"\n bind-toggle__raycastable="menuActive && hasVR"\n position="0 0 -0.01"\n geometry="primitive: plane; width: 3; height: 0.8"\n material="shader: panelShader; brightness: 0.1; ratio: 4; borderWidth: 0.002"\n mixin="modeBackgroundHover modeBackgroundSelect"></a-entity>\n <a-entity\n class="modeTitle"\n mixin="font"\n text="align: left; value: RIDE\nMODE; lineHeight: 45; width: 2.6"\n render-order="menutext"\n position="0.14 0.05 0"></a-entity>\n <a-entity\n class="modeThumb"\n mixin="modeThumbAnimations"\n geometry="primitive: plane; width: 0.7; height: 0.5"\n material="src: #modeRideImg; shader: flat"\n position="-0.20 0 0"></a-entity>\n <a-entity\n class="modeInstructions"\n mixin="font"\n render-order="menutext"\n bind__text="color: colorPrimary"\n text="value: Relax and enjoy the ride.\n\nTake a quick breather.\n\nNo score!; width: 1.6; lineHeight: 47"\n position="1.1 -0.05 0"></a-entity>\n</a-entity>\n\n \n\n<a-entity\n id="modeclassicvr"\n class="modeItem"\n data-mode="classic"\n data-name="classicvr"\n position="0 -0.75 0"\n mixin="modeAnimations">\n <a-entity\n class="modeBackground"\n bind-toggle__raycastable="menuActive && hasVR"\n position="0 0 -0.01"\n geometry="primitive: plane; width: 3; height: 0.8"\n material="shader: panelShader; brightness: 0.1; ratio: 4; borderWidth: 0.002"\n mixin="modeBackgroundHover modeBackgroundSelect"></a-entity>\n <a-entity\n class="modeTitle"\n mixin="font"\n text="align: left; value: CLASSIC\nMODE; lineHeight: 45; width: 2.6"\n render-order="menutext"\n position="0.14 0.05 0"></a-entity>\n <a-entity\n class="modeThumb"\n mixin="modeThumbAnimations"\n geometry="primitive: plane; width: 0.7; height: 0.5"\n material="src: #modeClassicImg; shader: flat"\n position="-0.20 0 0"></a-entity>\n <a-entity\n class="modeInstructions"\n mixin="font"\n render-order="menutext"\n bind__text="color: colorPrimary"\n text="value: Cut the beats, mind\ncolor and direction.\n\nAvoid all things yellow.\n\nSwing fast and accurate\nfor better score.; width: 1.6; lineHeight: 47"\n position="1.1 -0.05 0"></a-entity>\n</a-entity>\n\n </a-entity>\n\n <a-entity\n id="loadingTipsContainer"\n bind__visible="menuActive"\n position="0 -1.3 0.1"\n rotation="0 0 0">\n\n <a-entity\n id="loadingTipsBackground"\n bind-toggle__raycastable="menuActive"\n render-order="menu"\n geometry="primitive: plane; width: 1.5; height: 0.3"\n material="shader: panelShader; ratio: 1.15; borderRadius: 0.4"\n render-order="menubutton"\n position="0 0 -0.03"></a-entity>\n\n <a-entity\n id="loadingTipsText"\n mixin="font"\n bind__text="color: colorPrimary"\n text="align: center; wrapCount: 30; width: 1; value: Press down on thumbstick center to open menu while playing."\n render-order="menutext"\n position="0 -0.02 0.001"></a-entity>\n </a-entity>\n</a-entity>\n\x3c!-- </require> --\x3e</require>\n \x3c!-- <require path="/workspaces/3D-Agent/rider/src/templates/victory.html"> --\x3e\n\x3c!-- Victory. --\x3e\n<a-entity\n id="victoryInfoContainer"\n position="0 1.5 -2"\n bind__visible="isVictory">\n\n <a-entity\n id="victoryAccuracyRing"\n bind__material="color: colorPrimary"k\n bind__victory-accuracy-ring="accuracy: score.finalAccuracy"\n animation="property: components.material.material.uniforms.progress.value; from: 0; easing: easeOutQuad; delay: 500; dur: 2500; autoplay: false"\n geometry="primitive: plane; width: 0.7; height: 0.7"\n material="shader: ring; transparent: true; radiusInner: 0.8; blending: additive; depthWrite: false"\n position="0 0.18 0"\n render-order="victory"></a-entity>\n\n <a-entity\n id="victoryInfoRank"\n class="accuracyTextCounterSubscribe"\n bind__animation="enabled: isVictory"\n bind__victory-rank="isVictory: isVictory; rank: score.rank"\n bind-toggle__raycastable="isVictory"\n scale="0 0 0"\n position="0 -0.034 0"\n animation__rotation="property: object3D.rotation.y; from: 0; to: -360; loop: true; easing: linear; dur: 5000; startEvents: textcounterdone"\n animation__scale="property: scale; from: 0 0 0; to: 1 1 1; loop: false; easing: easeOutQuad; dur: 300; startEvents: textcounterdone"\n play-sound="sound: #victorySound; event: textcounterdone"\n render-order="menuitemtext"\n text-geometry="font: #VigaRegularThree; bevelEnabled: true; bevelSize: 0.01; bevelThickness: 0.01; curveSegments: 7; height: 0.15; size: 0.4"></a-entity>\n\n <a-entity\n id="victoryInfoAccuracy"\n class="accuracyTextCounterSubscribe"\n mixin="font"\n bind__text="color: colorSecondary; opacity: isVictory && 0 || 0; value: score.score + \' POINTS\'"\n animation="property: components.text.material.uniforms.opacity.value; from: 0; to: 1; startEvents: textcounterdone"\n text="align: left; wrapCount: 22; baseline: top; width: 0.81"\n position="0.85 0.2 0"\n render-order="menuitemtext"></a-entity>\n\n <a-entity\n id="victoryInfoBeatsHit"\n class="accuracyTextCounterSubscribe"\n mixin="font"\n bind__text="color: colorSecondary; opacity: isVictory && 0 || 0; value: score.beatsText"\n animation="property: components.text.material.uniforms.opacity.value; from: 0; to: 1; startEvents: textcounterdone"\n text="align: left; wrapCount: 22; baseline: top; width: 0.81"\n position="0.85 0.1 0"\n render-order="menuitemtext"></a-entity>\n\n <a-entity\n id="victoryInfoAccuracy"\n mixin="font"\n bind__text="color: colorTertiary"\n text="value: 0; align: center; wrapCount: 15; baseline: top; width: 2.25"\n bind__text-counter="enabled: isVictory; value: score.finalAccuracy"\n text-counter="suffix: %"\n position="0 -0.47 0"\n render-order="menuitemtext"></a-entity>\n\n <a-entity\n id="victoryInfoMaxCombo"\n mixin="font"\n bind__text="color: colorSecondary"\n bind__text-counter="enabled: isVictory; value: score.maxCombo"\n text="align: center; wrapCount: 22; baseline: top; width: 1"\n text-counter="prefix: MAX STREAK: ; emit: true"\n proxy-event="event: textcounterdone; to: .accuracyTextCounterSubscribe"\n position="0 -0.58 0"\n render-order="menuitemtext"></a-entity>\n\n <a-entity\n id="victoryButtons"\n play-sound="event: mouseenter; sound: #hoverSound; volume: 0.03"\n play-sound__click="event: click; sound: #confirmSound; volume: 0.25"\n render-order="menubutton">\n <a-entity\n id="victoryRestartButton"\n class="accuracyTextCounterSubscribe"\n mixin="gameMenuButton"\n bind-toggle__raycastable="isVictory"\n bind__material="opacity: isVictory && 0 || 0"\n animation="property: components.material.material.uniforms.opacity.value; from: 0; to: 1; startEvents: textcounterdone"\n position="-0.56 -0.79 0.05"\n proxy-event="event: click; to: a-scene; as: gamemenurestart">\n <a-entity\n class="accuracyTextCounterSubscribe"\n mixin="gameMenuButtonText"\n bind__text="opacity: isVictory && 0 || 0"\n animation="property: components.text.material.uniforms.opacity.value; from: 0; to: 1; startEvents: textcounterdone"\n render-order="menuitemtext"\n text="opacity: 0; value: PLAY AGAIN"></a-entity>\n </a-entity>\n\n <a-entity\n id="victoryExitButton"\n class="accuracyTextCounterSubscribe"\n mixin="gameMenuButton"\n bind-toggle__raycastable="isVictory"\n bind__material="opacity: isVictory && 0 || 0"\n animation="property: components.material.material.uniforms.opacity.value; from: 0; to: 1; startEvents: textcounterdone"\n position="0.56 -0.79 0.05"\n proxy-event="event: click; to: a-scene; as: gamemenuexit">\n <a-entity\n class="accuracyTextCounterSubscribe"\n mixin="gameMenuButtonText"\n bind__text="opacity: isVictory && 0 || 0"\n animation="property: components.text.material.uniforms.opacity.value; from: 0; to: 1; startEvents: textcounterdone"\n render-order="menuitemtext"\n text="opacity: 0; value: BACK TO MENU"></a-entity>\n </a-entity>\n </a-entity>\n</a-entity>\n\x3c!-- </require> --\x3e</require>\n \x3c!-- <require path="/workspaces/3D-Agent/rider/src/templates/leaderboard.html"> --\x3e\n<a-entity\n id="leaderboard"\n class="accuracyTextCounterSubscribe"\n bind__animation="enabled: isVictory"\n bind__scale="isVictory && \'0 0 0\' || \'1 1 1\'"\n bind__visible="(!!menuSelectedChallenge.id || !!challenge.id) && (menuActive || isPaused || isVictory || isLoading) && !genreMenuOpen && gameMode !== \'ride\'"\n position="2.36 1.5 -1.19"\n rotation="0 -60 0"\n animation="property: scale; from: 0 0 0; to: 1 1 1; easing: easeOutBack; startEvents: textcounterdone"\n render-order="menuitem">\n\n <a-entity\n bind-toggle__raycastable="leaderboardActive"\n id="leaderboardBackground" position="0 0 0"\n geometry="primitive: plane; width: 2; height: 2"\n material="shader: panelShader; ratio: 1.16; brightness: 0.2"></a-entity>\n\n <a-entity\n id="leaderboardChallengeImage"\n bind__menu-selected-challenge-image="coverURL: menuSelectedChallenge.coverURL"\n bind__visible="!isVictory"\n geometry="primitive: plane; height: 0.12; width: 0.12"\n material="shader: flat"\n position="-0.44 0.63 0.001"></a-entity>\n\n <a-entity\n id="leaderboardTitle"\n mixin="font"\n text="align: center; width: 2.5; value: LEADERBOARD"\n position="0.05 0.55 0.001"\n bind__visible="!leaderboardQualified"></a-entity>\n\n <a-entity\n id="leaderboardNames"\n mixin="font"\n bind__text="color: colorSecondary; value: leaderboardNames"\n bind__visible="!leaderboardQualified && !leaderboardEmpty"\n text="baseline: top; width: 1.2; anchor: left; wrapCount: 28; lineHeight: 53;"\n position="-0.7 0.3 0.001"></a-entity>\n\n <a-entity\n id="leaderboardScores"\n mixin="font"\n bind__text="value: leaderboardScores"\n bind__visible="!leaderboardQualified && !leaderboardEmpty"\n text="baseline: top; align: right; width: 1.2; anchor: right; color: #fff; wrapCount: 28; lineHeight: 53;"\n position="0.7 0.3 0.001"></a-entity>\n\n <a-entity\n id="leaderboardEmpty"\n mixin="font"\n bind__visible="leaderboard.length === 0 && !leaderboardQualified && !leaderboardLoading"\n text="align: center; color: #999; baseline: center; width: 2; value: No high scores. Be the first!"\n position="0 0 0.001"></a-entity>\n\n <a-entity\n id="leaderboardKeyboard"\n bind__super-keyboard="hand: activeHand === \'left\' && \'#leftHand\' || \'#rightHand\'; show: leaderboardQualified"\n super-keyboard="inputColor: #fff; hand: #rightHand; imagePath: assets/img/keyboard; font: assets/fonts/Viga-Regular.json; align: center; model: superkeyboard; keyColor: #fff; injectToRaycasterObjects: false; filters: allupper; keyHoverColor: #fff; maxLength: 15; width: 1.5; label: NEW HIGH SCORE!\nENTER THE LEADERBOARD; labelColor: #FAFAFA"\n position="0 -0.08 0.02"\n proxy-event__change="event: superkeyboardchange; to: a-scene; as: leaderboardusername"\n keyboard-raycastable="condition: leaderboardQualified"\n render-order="menutext"\n render-order-recursive>\n </a-entity>\n\n <a-entity id="leaderboardSubmit"\n position="0 -0.67 0.002"\n mixin="bigMenuButton"\n bind__visible-raycastable="leaderboardQualified"\n proxy-event="event: click; to: a-scene; as: leaderboardsubmit">\n <a-entity mixin="font" text="align: center; color: #FFF; wrapCount: 26; value: SUBMIT HIGH SCORE" position="0 -0.055 0.01"></a-entity>\n \x3c!--slice9="width: 1.5; height: 0.24"--\x3e\n </a-entity>\n</a-entity>\n\x3c!-- </require> --\x3e</require>\n \x3c!-- <require path="/workspaces/3D-Agent/rider/src/templates/news.html"> --\x3e\n\n\n\n\n\n<a-entity\n id="news"\n bind__visible="menuActive && !menuSelectedChallenge.id && !isMenuOpening"\n position="2.365374194652176 1.6 -1.1952715561051024"\n rotation="0 -60 0"\n render-order="menuitem">\n\n <a-entity\n id="newsBackground"\n bind-toggle__raycastable="menuActive && !menuSelectedChallenge.id && !isMenuOpening"\n geometry="primitive: plane; width: 2.1; height: 1.9"\n material="shader: panelShader; ratio: 1.14; brightness: 0.2"></a-entity>\n\n <a-entity\n id="newsText"\n mixin="font"\n text="align: left; color: #FAFAFA; baseline: center; width: 1.6; wrapCount: 50; value: three.ws\n\nGive your AI a body. three.ws is an open-source, browser-native 3D AI agent platform.\n\nDrop a GLB file, add an LLM brain, register on-chain, and embed anywhere — no plugins, no installs.\n\nVisit three.ws to build your agent."\n position="0 -0.04 0.001"></a-entity>\n</a-entity>\n\n<a-entity\n id="support"\n bind__visible="menuActive && !menuSelectedChallenge.id && !isMenuOpening && inVR"\n position="2.365374194652176 0.25 -1.1952715561051024"\n rotation="-15 -60 0"\n render-order="menuitem">\n\n <a-entity\n id="supportBackground"\n bind-toggle__raycastable="menuActive && !menuSelectedChallenge.id && !isMenuOpening"\n geometry="primitive: plane; width: 2.1; height: 0.9"\n material="shader: panelShader; ratio: 1.14; brightness: 0.2"></a-entity>\n\n <a-entity\n id="supportImage"\n geometry="primitive: plane; width: 0.6; height: 0.5"\n material="shader: flat; src: /assets/img/banner.jpg"\n position="-0.5 0 0.001"></a-entity>\n\n <a-entity\n id="supportText"\n mixin="font"\n text="align: left; color: #FAFAFA; baseline: center; width: 1; wrapCount: 30; value: Support three.ws development.\n\nVisit three.ws for more."\n position="0.35 -0.04 0.001"></a-entity>\n</a-entity>\n\x3c!-- </require> --\x3e</require>\n\n <a-mixin\n id="cursorMesh"\n material="shader: flat; transparent: true; src: #cursorMeshImg; depthTest: false"\n sub-object="from: #cursorLaser; name: glow"></a-mixin>\n\n <a-entity\n id="curve"\n material="shader: supercurve"\n supercurve\n supercurve-color\n render-order="curve"></a-entity>\n\n <a-entity\n id="tunnelsContainer"\n render-order="curve"\n bind__visible="isPlaying || isPaused"></a-entity>\n\n <a-entity\n id="beatContainer"\n beat-hit-sound\n bind__visible="isPlaying"></a-entity>\n\n <a-entity\n id="wallContainer"\n bind__visible="isPlaying"></a-entity>\n\n <a-entity id="curveFollowRig"\n bind__curve-follow-rig-reset="isVictory: isVictory"\n bind__supercurve-follow="enabled: isPlaying; speed: speed"\n supercurve-follow="target: #curve">\n\n \x3c!-- <require path="/workspaces/3D-Agent/rider/src/templates/stageFollow.html"> --\x3e\n<a-entity\n id="tube"\n bind__visible="isPlaying"\n rotation="90 180 0"\n position="0 0 -5"\n geometry="primitive: cylinder; radius: 3; openEnded: true; height: 20"\n materials="name: tube"\n animation="property: components.materials.material.uniforms.opacity.value; from: 1; to: 0; easing: easeInOutCubic; startEvents: pulse"></a-entity>\n\n<a-entity\n id="platformShadow"\n obj-model="obj: #homeShadowObj"\n position="0 0.02 0"\n material="src: #homeShadowImg; shader: flat; blending: multiply; transparent: true;"\n raycastable-game\n render-order="curveshadow"\n stepback></a-entity>\n\n<a-entity\n id="platform"\n obj-model="obj: #homeObj"\n materials="name: home"\n bind__materials="animate: isPlaying"></a-entity>\n\n<a-entity\n id="sideGlows"\n bind__visible="isPlaying || isPaused">\n <a-entity\n id="leftSideGlow"\n geometry="primitive: plane; width: 8; height: 2"\n materials="name: leftsideglow"\n position="-2.1 .5 -3"\n rotation="20 -90 0"\n render-order="sideglow">\n </a-entity>\n <a-entity\n id="rightSideGlow"\n geometry="primitive: plane; width: 8; height: 2"\n materials="name: rightsideglow"\n position="2.1 .5 -3"\n rotation="-20 -90 0"\n render-order="sideglow">\n </a-entity>\n</a-entity>\n\n<a-entity\n id="light"\n light="type: hemisphere; color: #666"\n position="0 10 20"></a-entity>\n\n\n\x3c!-- </require> --\x3e</require>\n \x3c!-- <require path="/workspaces/3D-Agent/rider/src/templates/score.html"> --\x3e\n<a-mixin\n id="scoreText"\n mixin="font"\n text="lineHeight: 40; color: #FAFAFA; letterSpacing: -2; align: center; opacity: 0.7"></a-mixin>\n\n<a-entity\n id="scoreContainer"\n bind__score-texts="isLoading: isLoading"\n bind__visible="score.active"\n render-order="score">\n\n <a-entity\n id="songProgressRing"\n bind__material="color: colorSecondary"\n bind__song-progress-info="enabled: isPlaying || isPaused && challenge.isBeatsPreloaded"\n geometry="primitive: plane; width: 0.57; height: 0.03"\n material="shader: flat"\n position="1.525 0.1 -3.94"\n rotation="-30 0 0">\n </a-entity>\n\n <a-entity id="scoreNumberContainer" position="1.5 0.13 -4">\n <a-entity\n id="combo"\n mixin="scoreText"\n bind__text="color: colorPrimary; value: \'STREAK \' + score.combo"\n text="width: 3.5; align: left; anchor: left"\n rotation="-20 0 0"\n position="-0.025 0.175 0"></a-entity>\n\n <a-entity\n id="accuracy"\n mixin="scoreText"\n bind__text="color: colorSecondary; value: score.accuracyInt + \'%\' + \' / \' + score.score"\n text="width: 3.5; align: left; anchor: left"\n rotation="-20 0 0"></a-entity>\n </a-entity>\n</a-entity>\n\x3c!-- </require> --\x3e</require>\n \x3c!-- <require path="/workspaces/3D-Agent/rider/src/templates/gameMenu.html"> --\x3e\n<a-mixin\n id="gameMenuButton"\n mixin="bigMenuButton"\n animation__mouseenter="property: components.material.material.uniforms.activePanel.value; from: 0; to: 1; startEvents: mouseenter; pauseEvents: mouseleave; dur: 70"\n animation__mouseleave="property: components.material.material.uniforms.activePanel.value; from: 1; to: 0; startEvents: mouseleave; pauseEvents: mouseenter; dur: 70"\n geometry="height: 0.28"></a-mixin>\n\n<a-mixin\n id="gameMenuButtonText"\n mixin="font"\n position="0 -0.08 0.01"\n render-order="menutext"\n text="align: center; wrapCount: 17"></a-mixin>\n\n\x3c!-- Titles. --\x3e\n<a-entity id="inGameMenuTitles" position="0 2.2 -2.3">\n <a-entity mixin="gameMenuButtonText" text="value: GAME OVER; color: #f01978; width: 3.5" bind__visible="isGameOver"></a-entity>\n <a-entity mixin="gameMenuButtonText" text="value: SONG CLEARED; color: #FFF; width: 3.5" bind__visible="isVictory" position="0 0.1 0"></a-entity>\n <a-entity mixin="gameMenuButtonText" bind__text="color: colorPrimary" text="value: PAUSED; width: 3.5" bind__visible="isPaused"></a-entity>\n</a-entity>\n\n<a-entity\n id="gameMenu"\n bind__visible="isPaused || isVictory"\n position="0 1.5 -2"\n play-sound="event: mouseenter; sound: #hoverSound; volume: 0.1"\n play-sound__click="event: click; sound: #confirmSound; volume: 0.25">\n\n \x3c!-- Actions. --\x3e\n <a-entity\n id="resumeButton"\n mixin="gameMenuButton"\n bind-toggle__raycastable="isPaused"\n bind__visible="isPaused"\n position="0 0.35 0"\n proxy-event="event: click; to: a-scene; as: gamemenuresume">\n <a-entity mixin="gameMenuButtonText" text="value: RESUME"></a-entity>\n </a-entity>\n\n <a-entity\n id="restartButton"\n mixin="gameMenuButton"\n bind__visible="!isVictory"\n bind-toggle__raycastable="isPaused || isGameOver"\n proxy-event="event: click; to: a-scene; as: gamemenurestart">\n <a-entity mixin="gameMenuButtonText" text="value: RESTART SONG"></a-entity>\n </a-entity>\n\n <a-entity\n id="exitButton"\n mixin="gameMenuButton"\n bind__visible="!isVictory"\n bind-toggle__raycastable="isPaused || isGameOver"\n position="0 -0.35 0"\n proxy-event="event: click; to: a-scene; as: gamemenuexit">\n <a-entity mixin="gameMenuButtonText" text="value: EXIT TO MENU"></a-entity>\n </a-entity>\n\n \x3c!-- Song info. --\x3e\n <a-entity id="gameMenuSongInfoContainer"\n position="0 -1 0.15473"\n rotation="-20 0 0"\n song-info-positioner\n bind__song-info-positioner="victory: isVictory">\n <a-entity id="gameMenuSongBackground"\n bind-toggle__raycastable="isPaused || isVictory"\n render-order="menu"\n geometry="primitive: plane; width: 2.5; height: 0.3"\n material="shader: panelShader; transparent: true; ratio: 4; borderRadius: 0.5; borderWidth: 0.02"\n position="0 0 -0.03"></a-entity>\n\n <a-entity id="gameMenuSongImage"\n copy-texture="from: #menuSelectedChallengeImage"\n geometry="primitive: plane; buffer: false; skipCache: true; height: 0.3; width: 0.3"\n material="shader: flat"\n position="-1 0 0"></a-entity>\n\n <a-entity id="gameMenuSongInfo">\n <a-entity\n id="gameMenuSongName"\n position="0 0.01 0"\n mixin="font" text="align: center; color: #fff; wrapCount: 30; baseline: top; lineHeight: 36; width: 1.2"\n bind__text="value: challenge.metadata.songName"></a-entity>\n <a-entity\n id="gameMenuSongSubName"\n mixin="font"\n position="0 -0.09 0"\n bind__text="color: colorSecondary"\n bind__text-truncate="value: challenge.metadata.songSubName + \' - \' + challenge.metadata.songAuthorName"\n text-truncate="length: 80"\n text="wrapCount: 80; align: center; width: 2.4" bind__text="value: menuSelectedChallenge.songSubName"></a-entity>\n </a-entity>\n </a-entity>\n</a-entity>\n\x3c!-- </require> --\x3e</require>\n\n \x3c!-- Beat pieces, explosions, fx, and weapon trail. --\x3e\n <a-entity id="rigContainer"></a-entity>\n\n \x3c!-- Supercut FX rings. --\x3e\n \n <a-entity class="superCutFx" mixin="superCut"></a-entity>\n \n <a-entity class="superCutFx" mixin="superCut"></a-entity>\n \n <a-entity class="superCutFx" mixin="superCut"></a-entity>\n \n <a-entity class="superCutFx" mixin="superCut"></a-entity>\n \n\n \x3c!-- Player. --\x3e\n <a-entity id="cameraRig">\n <a-entity\n id="camera"\n bind__wasd-controls="enabled: !inVr"\n position="0 1.6 0.5"\n camera="far: 10000"\n look-controls\n player-height\n wasd-controls="acceleration: 15"></a-entity>\n \x3c!-- Agent companion seated next to player. The GLB has its origin at\n the feet, so we drop it ~0.45m below camera height; rider has no\n visible floor at the player position, so the lower legs fade out\n and only the seated upper body is visible. --\x3e\n <a-entity\n id="agentCompanion"\n gltf-model="#agentGlb"\n agent-dance\n position="0.7 0.45 0.5"\n rotation="0 165 0"\n scale="0.9 0.9 0.9"></a-entity>\n <a-entity\n id="cameraWallCollider"\n bind__raycaster__wall="enabled: isPlaying && gameMode !== \'ride\'"\n proxy-event__wallhitstart="event: raycaster-intersection; to: a-scene; as: wallhitstart"\n proxy-event__wallhitend="event: raycaster-intersection-cleared; to: a-scene; as: wallhitend"\n follow-position="target: #camera"\n raycaster__wall="objects: [data-wall-active]; interval: 150; direction: 0 -1 0; far: 5"\n visible="false"></a-entity>\n </a-entity>\n\n <a-entity\n id="controllerRig"\n proxy-event="event: recentered; to: #cameraRig; captureBubbles: true; as: recenter">\n \n\n \n <a-entity id="leftHand"\n class="weapon"\n bind__hand-swapper="enabled: rightRaycasterActive"\n bind__haptics-wall="enabled: isPlaying && gameMode === \'classic\'"\n bind__headfist="isPlaying: isPlaying"\n bind__menu-controls="enabled: mainMenuActive"\n bind__pauser="enabled: isPlaying"\n bind__punch="enabled: isPlaying && gameMode === \'punch\'"\n bind__raycaster="enabled: leftRaycasterActive"\n bind__raycaster__game="enabled: isPlaying && (gameMode === \'classic\' || gameMode === \'punch\')"\n bind__blade="enabled: isPlaying && gameMode === \'classic\'"\n bind__weapon-particles="enabled: isPlaying; gameMode: gameMode"\n bind__trail="colorScheme: colorScheme; enabled: isPlaying && gameMode === \'classic\'"\n controller="hand: left"\n data-hand="left"\n haptics="events: mouseenter; dur: 35; force: 0.075"\n haptics__beat="events: beathaptic; dur: 90; force: 0.55"\n haptics__draw="events: drawblade; dur: 750; force: 0.025"\n haptics__plume="events: plumepulse; dur: 35; force: 0.1"\n headfist="hand: left"\n raycaster="objects: [raycastable]; far: 5; showLine: false"\n raycaster__game="objects: [raycastable-game]; far: 1; interval: 71; direction: 0 1 -1"\n weapon="hand: left"\n weapon-particles="hand: left"\n thumb-controls\n thumb-controls-debug="enabled: false; hand: left; controllerType: vive-controls"\n render-order="weapon"\n trail="color: primary; hand: left">\n <a-entity bind__position="has3DOFVR && \'0 0 -0.5\' || \'0 0 0\'">\n <a-entity\n id="leftLaser"\n class="laser"\n bind__material="color: colorPrimary"\n bind__cursor-laser="enabled: activeHand === \'left\' && !isPlaying"\n geometry="primitive: cylinder; height: 1; radius: 0.005"\n material="shader: flat; opacity: 0.25; transparent: true"\n rotation="-90 0 0"></a-entity>\n </a-entity>\n\n \x3c!-- Blade. --\x3e\n <a-entity bind__position="has3DOFVR && \'0 0 -0.5\' || \'0 0 0\'"\n bind__rotation="controllerType.indexOf(\'oculus\') !== -1 && \'135 0 0\' || \'90 0 0\'">\n <a-entity\n class="bladeContainer"\n bind__visible="isPlaying && gameMode === \'classic\'"\n animation="property: scale; from: 0 0 0; to: 1 1 1; dur: 750; easing: linear; startEvents: drawblade"\n scale="0.001 0.001 0.001">\n <a-entity\n class="blade bladeleft"\n obj-model="obj: #weaponObj"\n materials="name: leftWeapon"\n render-order="weapon"\n position="0 -0.43 0">\n <a-entity class="bladeTipHelper" position="0 -0.45 0"></a-entity>\n </a-entity>\n </a-entity>\n\n <a-entity\n class="bladeHandle"\n bind__visible="!isPlaying || gameMode === \'classic\'"\n obj-model="obj: #weaponHandleObj"\n materials="name: leftWeaponHandle">\n <a-entity class="bladeHandleHelper"></a-entity>\n </a-entity>\n </a-entity>\n\n \x3c!-- Punch. --\x3e\n <a-entity\n id="leftpunch"\n class="punch"\n render-order="weapon"\n bind__visible="isPlaying && gameMode === \'punch\'"\n bind__position="has3DOFVR && \'0 0 -0.75\' || \'0 0 0\'"\n rotation="0 0 0">\n <a-entity\n class="punchFist"\n obj-model="obj: #leftFistObj"\n materials="name: leftFist"></a-entity>\n <a-entity\n class="punchBbox"\n geometry="primitive: box; width: 0.2; height: 0.23; depth: 0.15"\n material="shader: flat; opacity: 0.5"\n position="0 0.05 0.1"\n rotation="30 0 0"\n visible="false"></a-entity>\n <a-entity\n obj-model="obj: #leftFistWeaponObj"\n materials="name: leftFistWeapon"></a-entity>\n </a-entity>\n\n \x3c!-- Ride. --\x3e\n <a-entity\n id="leftstar"\n class="handStar"\n render-order="weapon"\n bind__visible="isPlaying && gameMode === \'ride\'">\n <a-entity\n class="handStar"\n bind__material="colorPrimary: colorPrimary; colorSecondary: colorSecondary; colorTertiary: colorTertiary"\n geometry="primitive: sphere; radius: 0.1"\n material="shader: handStar"\n animation__pulse="property: components.material.material.uniforms.pulse.value; from: 2; to: 0; dur: 300; startEvents: plumepulse; easing: easeInOutQuad"\n animation__scale="property: scale; from: 2 2 2; to: 1 1 1; dur: 1200; startEvents: plumepulse; easing: easeInOutQuad"></a-entity>\n </a-entity>\n </a-entity>\n\n <a-entity\n id="leftCursorMesh"\n mixin="cursorMesh"\n bind__cursor-mesh="active: leftRaycasterActive && !isPlaying"\n bind__material="color: colorPrimary"\n cursor-mesh="cursorEl: #leftHand"\n material\n render-order="cursor"\n scale="1.3 1.3 1.3"></a-entity>\n \n \n <a-entity id="rightHand"\n class="weapon"\n bind__hand-swapper="enabled: leftRaycasterActive"\n bind__haptics-wall="enabled: isPlaying && gameMode === \'classic\'"\n bind__headfist="isPlaying: isPlaying"\n bind__menu-controls="enabled: mainMenuActive"\n bind__pauser="enabled: isPlaying"\n bind__punch="enabled: isPlaying && gameMode === \'punch\'"\n bind__raycaster="enabled: rightRaycasterActive"\n bind__raycaster__game="enabled: isPlaying && (gameMode === \'classic\' || gameMode === \'punch\')"\n bind__blade="enabled: isPlaying && gameMode === \'classic\'"\n bind__weapon-particles="enabled: isPlaying; gameMode: gameMode"\n bind__trail="colorScheme: colorScheme; enabled: isPlaying && gameMode === \'classic\'"\n controller="hand: right"\n data-hand="right"\n haptics="events: mouseenter; dur: 35; force: 0.075"\n haptics__beat="events: beathaptic; dur: 90; force: 0.55"\n haptics__draw="events: drawblade; dur: 750; force: 0.025"\n haptics__plume="events: plumepulse; dur: 35; force: 0.1"\n headfist="hand: right"\n raycaster="objects: [raycastable]; far: 5; showLine: false"\n raycaster__game="objects: [raycastable-game]; far: 1; interval: 70; direction: 0 1 -1"\n weapon="hand: right"\n weapon-particles="hand: right"\n thumb-controls\n thumb-controls-debug="enabled: false; hand: right; controllerType: vive-controls"\n render-order="weapon"\n trail="color: secondary; hand: right">\n <a-entity bind__position="has3DOFVR && \'0 0 -0.5\' || \'0 0 0\'">\n <a-entity\n id="rightLaser"\n class="laser"\n bind__material="color: colorSecondary"\n bind__cursor-laser="enabled: activeHand === \'right\' && !isPlaying"\n geometry="primitive: cylinder; height: 1; radius: 0.005"\n material="shader: flat; opacity: 0.25; transparent: true"\n rotation="-90 0 0"></a-entity>\n </a-entity>\n\n \x3c!-- Blade. --\x3e\n <a-entity bind__position="has3DOFVR && \'0 0 -0.5\' || \'0 0 0\'"\n bind__rotation="controllerType.indexOf(\'oculus\') !== -1 && \'135 0 0\' || \'90 0 0\'">\n <a-entity\n class="bladeContainer"\n bind__visible="isPlaying && gameMode === \'classic\'"\n animation="property: scale; from: 0 0 0; to: 1 1 1; dur: 750; easing: linear; startEvents: drawblade"\n scale="0.001 0.001 0.001">\n <a-entity\n class="blade bladeright"\n obj-model="obj: #weaponObj"\n materials="name: rightWeapon"\n render-order="weapon"\n position="0 -0.43 0">\n <a-entity class="bladeTipHelper" position="0 -0.45 0"></a-entity>\n </a-entity>\n </a-entity>\n\n <a-entity\n class="bladeHandle"\n bind__visible="!isPlaying || gameMode === \'classic\'"\n obj-model="obj: #weaponHandleObj"\n materials="name: rightWeaponHandle">\n <a-entity class="bladeHandleHelper"></a-entity>\n </a-entity>\n </a-entity>\n\n \x3c!-- Punch. --\x3e\n <a-entity\n id="rightpunch"\n class="punch"\n render-order="weapon"\n bind__visible="isPlaying && gameMode === \'punch\'"\n bind__position="has3DOFVR && \'0 0 -0.75\' || \'0 0 0\'"\n rotation="0 0 0">\n <a-entity\n class="punchFist"\n obj-model="obj: #rightFistObj"\n materials="name: rightFist"></a-entity>\n <a-entity\n class="punchBbox"\n geometry="primitive: box; width: 0.2; height: 0.23; depth: 0.15"\n material="shader: flat; opacity: 0.5"\n position="0 0.05 0.1"\n rotation="30 0 0"\n visible="false"></a-entity>\n <a-entity\n obj-model="obj: #rightFistWeaponObj"\n materials="name: rightFistWeapon"></a-entity>\n </a-entity>\n\n \x3c!-- Ride. --\x3e\n <a-entity\n id="rightstar"\n class="handStar"\n render-order="weapon"\n bind__visible="isPlaying && gameMode === \'ride\'">\n <a-entity\n class="handStar"\n bind__material="colorPrimary: colorPrimary; colorSecondary: colorSecondary; colorTertiary: colorTertiary"\n geometry="primitive: sphere; radius: 0.1"\n material="shader: handStar"\n animation__pulse="property: components.material.material.uniforms.pulse.value; from: 2; to: 0; dur: 300; startEvents: plumepulse; easing: easeInOutQuad"\n animation__scale="property: scale; from: 2 2 2; to: 1 1 1; dur: 1200; startEvents: plumepulse; easing: easeInOutQuad"></a-entity>\n </a-entity>\n </a-entity>\n\n <a-entity\n id="rightCursorMesh"\n mixin="cursorMesh"\n bind__cursor-mesh="active: rightRaycasterActive && !isPlaying"\n bind__material="color: colorSecondary"\n cursor-mesh="cursorEl: #rightHand"\n material\n render-order="cursor"\n scale="1.3 1.3 1.3"></a-entity>\n \n </a-entity>\n\n <a-entity\n id="stepback"\n position="0 1.6 -1.55"\n geometry="primitive: plane; width: 0.25; height: 0.25;"\n material="shader: flat; src: #stepbackImg; transparent: true; opacity: 0"\n render-order="stepback"></a-entity>\n </a-entity>\n\n <a-entity\n id="mouseCursor"\n bind__raycaster="enabled: !inVR"\n cursor="rayOrigin: mouse"\n raycaster="objects: [raycastable]"></a-entity>\n <a-entity\n id="mouseCursorMesh"\n mixin="cursorMesh"\n cursor-mesh="cursorEl: #mouseCursor"\n bind__cursor-mesh="active: menuActive"\n render-order="cursor"></a-entity>\n\n <a-entity\n tail="target: #leftstar"\n render-order="weapon"\n bind__visible="isPlaying && gameMode === \'ride\'"></a-entity>\n <a-entity\n tail="target: #rightstar"\n render-order="weapon"\n bind__visible="isPlaying && gameMode === \'ride\'"></a-entity>\n</a-scene>\n';document.addEventListener("DOMContentLoaded",(function(){let e=document.getElementById("app");e||(e=document.createElement("div"),e.id="app",document.body.appendChild(e));e.innerHTML=r}));{const t=n(235).DiffDOM;if(e.hot.accept(),e.hot.data&&e.hot.data.oldHtml){const n=e.hot.data.oldHtml,i=new t,a=document.createElement("div");a.innerHTML=n;const o=document.createElement("div");o.innerHTML=r;const s=i.diff(a.querySelector("a-scene"),o.querySelector("a-scene"));i.apply(document.querySelector("a-scene"),s)}e.hot.dispose(e=>{e.oldHtml=r})}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";function r(e,t,n){let i;return"#text"===e.nodeName?i=n.document.createTextNode(e.data):"#comment"===e.nodeName?i=n.document.createComment(e.data):("svg"===e.nodeName||t?(i=n.document.createElementNS("http://www.w3.org/2000/svg",e.nodeName),t=!0):i=n.document.createElement(e.nodeName),e.attributes&&Object.entries(e.attributes).forEach(([e,t])=>i.setAttribute(e,t)),e.childNodes&&e.childNodes.forEach(e=>i.appendChild(r(e,t,n))),n.valueDiffing&&(e.value&&(i.value=e.value),e.checked&&(i.checked=e.checked),e.selected&&(i.selected=e.selected))),i}function i(e,t){for(t=t.slice();t.length>0;){if(!e.childNodes)return!1;const n=t.splice(0,1)[0];e=e.childNodes[n]}return e}function a(e,t,n){let a,o,s,c,l,u=i(e,t[n._const.route]);const h={diff:t,node:u};if(n.preDiffApply(h))return!0;switch(t[n._const.action]){case n._const.addAttribute:if(!u||!u.setAttribute)return!1;u.setAttribute(t[n._const.name],t[n._const.value]);break;case n._const.modifyAttribute:if(!u||!u.setAttribute)return!1;u.setAttribute(t[n._const.name],t[n._const.newValue]),"INPUT"===u.nodeName&&"value"===t[n._const.name]&&(u.value=t[n._const.oldValue]);break;case n._const.removeAttribute:if(!u||!u.removeAttribute)return!1;u.removeAttribute(t[n._const.name]);break;case n._const.modifyTextElement:if(!u||3!==u.nodeType)return!1;n.textDiff(u,u.data,t[n._const.oldValue],t[n._const.newValue]);break;case n._const.modifyValue:if(!u||void 0===u.value)return!1;u.value=t[n._const.newValue];break;case n._const.modifyComment:if(!u||void 0===u.data)return!1;n.textDiff(u,u.data,t[n._const.oldValue],t[n._const.newValue]);break;case n._const.modifyChecked:if(!u||void 0===u.checked)return!1;u.checked=t[n._const.newValue];break;case n._const.modifySelected:if(!u||void 0===u.selected)return!1;u.selected=t[n._const.newValue];break;case n._const.replaceElement:u.parentNode.replaceChild(r(t[n._const.newValue],"http://www.w3.org/2000/svg"===u.namespaceURI,n),u);break;case n._const.relocateGroup:c=Array(...new Array(t.groupLength)).map(()=>u.removeChild(u.childNodes[t[n._const.from]])),c.forEach((e,r)=>{0===r&&(o=u.childNodes[t[n._const.to]]),u.insertBefore(e,o||null)});break;case n._const.removeElement:u.parentNode.removeChild(u);break;case n._const.addElement:s=t[n._const.route].slice(),l=s.splice(s.length-1,1)[0],u=i(e,s),u.insertBefore(r(t[n._const.element],"http://www.w3.org/2000/svg"===u.namespaceURI,n),u.childNodes[l]||null);break;case n._const.removeTextElement:if(!u||3!==u.nodeType)return!1;u.parentNode.removeChild(u);break;case n._const.addTextElement:if(s=t[n._const.route].slice(),l=s.splice(s.length-1,1)[0],a=n.document.createTextNode(t[n._const.value]),u=i(e,s),!u||!u.childNodes)return!1;u.insertBefore(a,u.childNodes[l]||null);break;default:console.log("unknown action")}return h.newNode=a,n.postDiffApply(h),!0}function o(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function s(e,t,n){t.length||(t=[t]),(t=t.slice()).reverse(),t.forEach(t=>{!function(e,t,n){switch(t[n._const.action]){case n._const.addAttribute:t[n._const.action]=n._const.removeAttribute,a(e,t,n);break;case n._const.modifyAttribute:o(t,n._const.oldValue,n._const.newValue),a(e,t,n);break;case n._const.removeAttribute:t[n._const.action]=n._const.addAttribute,a(e,t,n);break;case n._const.modifyTextElement:case n._const.modifyValue:case n._const.modifyComment:case n._const.modifyChecked:case n._const.modifySelected:case n._const.replaceElement:o(t,n._const.oldValue,n._const.newValue),a(e,t,n);break;case n._const.relocateGroup:o(t,n._const.from,n._const.to),a(e,t,n);break;case n._const.removeElement:t[n._const.action]=n._const.addElement,a(e,t,n);break;case n._const.addElement:t[n._const.action]=n._const.removeElement,a(e,t,n);break;case n._const.removeTextElement:t[n._const.action]=n._const.addTextElement,a(e,t,n);break;case n._const.addTextElement:t[n._const.action]=n._const.removeTextElement,a(e,t,n);break;default:console.log("unknown action")}}(e,t,n)})}n.r(t),n.d(t,"DiffDOM",(function(){return _})),n.d(t,"TraceLogger",(function(){return S}));class c{constructor(e={}){Object.entries(e).forEach(([e,t])=>this[e]=t)}toString(){return JSON.stringify(this)}setValue(e,t){return this[e]=t,this}}function l(e){const t=[];return"#text"!==e.nodeName&&"#comment"!==e.nodeName&&(t.push(e.nodeName),e.attributes&&(e.attributes.class&&t.push(`${e.nodeName}.${e.attributes.class.replace(/ /g,".")}`),e.attributes.id&&t.push(`${e.nodeName}#${e.attributes.id}`))),t}function u(e){const t={},n={};return e.forEach(e=>{l(e).forEach(e=>{const r=e in t;r||e in n?r&&(delete t[e],n[e]=!0):t[e]=!0})}),t}function h(e,t){const n=u(e),r=u(t),i={};return Object.keys(n).forEach(e=>{r[e]&&(i[e]=!0)}),i}function d(e){return delete e.outerDone,delete e.innerDone,delete e.valueDone,!e.childNodes||e.childNodes.every(d)}function p(e,t){if(!["nodeName","value","checked","selected","data"].every(n=>e[n]===t[n]))return!1;if(Boolean(e.attributes)!==Boolean(t.attributes))return!1;if(Boolean(e.childNodes)!==Boolean(t.childNodes))return!1;if(e.attributes){const n=Object.keys(e.attributes),r=Object.keys(t.attributes);if(n.length!==r.length)return!1;if(!n.every(n=>e.attributes[n]===t.attributes[n]))return!1}if(e.childNodes){if(e.childNodes.length!==t.childNodes.length)return!1;if(!e.childNodes.every((e,n)=>p(e,t.childNodes[n])))return!1}return!0}function f(e,t,n,r,i){if(!e||!t)return!1;if(e.nodeName!==t.nodeName)return!1;if("#text"===e.nodeName)return!!i||e.data===t.data;if(e.nodeName in n)return!0;if(e.attributes&&t.attributes){if(e.attributes.id){if(e.attributes.id!==t.attributes.id)return!1;if(`${e.nodeName}#${e.attributes.id}`in n)return!0}if(e.attributes.class&&e.attributes.class===t.attributes.class){if(`${e.nodeName}.${e.attributes.class.replace(/ /g,".")}`in n)return!0}}if(r)return!0;const a=e.childNodes?e.childNodes.slice().reverse():[],o=t.childNodes?t.childNodes.slice().reverse():[];if(a.length!==o.length)return!1;if(i)return a.every((e,t)=>e.nodeName===o[t].nodeName);{const e=h(a,o);return a.every((t,n)=>f(t,o[n],e,!0,!0))}}function m(e){return JSON.parse(JSON.stringify(e))}function g(e,t,n,r){let i=0,a=[];const o=e.length,s=t.length,c=Array(...new Array(o+1)).map(()=>[]),u=h(e,t);let d=o===s;d&&e.some((e,n)=>{const r=l(e),i=l(t[n]);return r.length!==i.length?(d=!1,!0):(r.some((e,t)=>{if(e!==i[t])return d=!1,!0}),!d||void 0)});for(let l=0;l<o;l++){const o=e[l];for(let e=0;e<s;e++){const s=t[e];n[l]||r[e]||!f(o,s,u,d)?c[l+1][e+1]=0:(c[l+1][e+1]=c[l][e]?c[l][e]+1:1,c[l+1][e+1]>=i&&(i=c[l+1][e+1],a=[l+1,e+1]))}}return 0!==i&&{oldValue:a[0]-i,newValue:a[1]-i,length:i}}function y(e,t){return Array(...new Array(e)).map(()=>t)}class v{constructor(){this.list=[]}add(e){this.list.push(...e)}forEach(e){this.list.forEach(t=>e(t))}}function b(e,t){let n,r,i=e;for(t=t.slice();t.length>0;){if(!i.childNodes)return!1;r=t.splice(0,1)[0],n=i,i=i.childNodes[r]}return{node:i,parentNode:n,nodeIndex:r}}function w(e,t,n){return t.forEach(t=>{!function(e,t,n){const r=b(e,t[n._const.route]);let i=r.node;const a=r.parentNode,o=r.nodeIndex,s=[],c={diff:t,node:i};if(n.preDiffApply(c))return!0;let l,u,h,d;switch(t[n._const.action]){case n._const.addAttribute:i.attributes||(i.attributes={}),i.attributes[t[n._const.name]]=t[n._const.value],"checked"===t[n._const.name]?i.checked=!0:"selected"===t[n._const.name]?i.selected=!0:"INPUT"===i.nodeName&&"value"===t[n._const.name]&&(i.value=t[n._const.value]);break;case n._const.modifyAttribute:i.attributes[t[n._const.name]]=t[n._const.newValue];break;case n._const.removeAttribute:delete i.attributes[t[n._const.name]],0===Object.keys(i.attributes).length&&delete i.attributes,"checked"===t[n._const.name]?i.checked=!1:"selected"===t[n._const.name]?delete i.selected:"INPUT"===i.nodeName&&"value"===t[n._const.name]&&delete i.value;break;case n._const.modifyTextElement:i.data=t[n._const.newValue];break;case n._const.modifyValue:i.value=t[n._const.newValue];break;case n._const.modifyComment:i.data=t[n._const.newValue];break;case n._const.modifyChecked:i.checked=t[n._const.newValue];break;case n._const.modifySelected:i.selected=t[n._const.newValue];break;case n._const.replaceElement:l=m(t[n._const.newValue]),l.outerDone=!0,l.innerDone=!0,l.valueDone=!0,a.childNodes[o]=l;break;case n._const.relocateGroup:u=i.childNodes.splice(t[n._const.from],t.groupLength).reverse(),u.forEach(e=>i.childNodes.splice(t[n._const.to],0,e)),i.subsets&&i.subsets.forEach(e=>{if(t[n._const.from]<t[n._const.to]&&e.oldValue<=t[n._const.to]&&e.oldValue>t[n._const.from]){e.oldValue-=t.groupLength;const r=e.oldValue+e.length-t[n._const.to];r>0&&(s.push({oldValue:t[n._const.to]+t.groupLength,newValue:e.newValue+e.length-r,length:r}),e.length-=r)}else if(t[n._const.from]>t[n._const.to]&&e.oldValue>t[n._const.to]&&e.oldValue<t[n._const.from]){e.oldValue+=t.groupLength;const r=e.oldValue+e.length-t[n._const.to];r>0&&(s.push({oldValue:t[n._const.to]+t.groupLength,newValue:e.newValue+e.length-r,length:r}),e.length-=r)}else e.oldValue===t[n._const.from]&&(e.oldValue=t[n._const.to])});break;case n._const.removeElement:a.childNodes.splice(o,1),a.subsets&&a.subsets.forEach(e=>{e.oldValue>o?e.oldValue-=1:e.oldValue===o?e.delete=!0:e.oldValue<o&&e.oldValue+e.length>o&&(e.oldValue+e.length-1===o?e.length--:(s.push({newValue:e.newValue+o-e.oldValue,oldValue:o,length:e.length-o+e.oldValue-1}),e.length=o-e.oldValue))}),i=a;break;case n._const.addElement:h=t[n._const.route].slice(),d=h.splice(h.length-1,1)[0],i=b(e,h).node,l=m(t[n._const.element]),l.outerDone=!0,l.innerDone=!0,l.valueDone=!0,i.childNodes||(i.childNodes=[]),d>=i.childNodes.length?i.childNodes.push(l):i.childNodes.splice(d,0,l),i.subsets&&i.subsets.forEach(e=>{if(e.oldValue>=d)e.oldValue+=1;else if(e.oldValue<d&&e.oldValue+e.length>d){const t=e.oldValue+e.length-d;s.push({newValue:e.newValue+e.length-t,oldValue:d+1,length:t}),e.length-=t}});break;case n._const.removeTextElement:a.childNodes.splice(o,1),"TEXTAREA"===a.nodeName&&delete a.value,a.subsets&&a.subsets.forEach(e=>{e.oldValue>o?e.oldValue-=1:e.oldValue===o?e.delete=!0:e.oldValue<o&&e.oldValue+e.length>o&&(e.oldValue+e.length-1===o?e.length--:(s.push({newValue:e.newValue+o-e.oldValue,oldValue:o,length:e.length-o+e.oldValue-1}),e.length=o-e.oldValue))}),i=a;break;case n._const.addTextElement:h=t[n._const.route].slice(),d=h.splice(h.length-1,1)[0],l={},l.nodeName="#text",l.data=t[n._const.value],i=b(e,h).node,i.childNodes||(i.childNodes=[]),d>=i.childNodes.length?i.childNodes.push(l):i.childNodes.splice(d,0,l),"TEXTAREA"===i.nodeName&&(i.value=t[n._const.newValue]),i.subsets&&i.subsets.forEach(e=>{if(e.oldValue>=d&&(e.oldValue+=1),e.oldValue<d&&e.oldValue+e.length>d){const t=e.oldValue+e.length-d;s.push({newValue:e.newValue+e.length-t,oldValue:d+1,length:t}),e.length-=t}});break;default:console.log("unknown action")}i.subsets&&(i.subsets=i.subsets.filter(e=>!e.delete&&e.oldValue!==e.newValue),s.length&&(i.subsets=i.subsets.concat(s))),c.newNode=l,n.postDiffApply(c)}(e,t,n)}),!0}function A(e,t){const n={};if(n.nodeName=e.nodeName,"#text"===n.nodeName||"#comment"===n.nodeName)n.data=e.data;else{if(e.attributes&&e.attributes.length>0){n.attributes={};Array.prototype.slice.call(e.attributes).forEach(e=>n.attributes[e.name]=e.value)}if("TEXTAREA"===n.nodeName)n.value=e.value;else if(e.childNodes&&e.childNodes.length>0){n.childNodes=[];Array.prototype.slice.call(e.childNodes).forEach(e=>n.childNodes.push(A(e,t)))}t.valueDiffing&&(void 0!==e.checked&&e.type&&["radio","checkbox"].includes(e.type.toLowerCase())?n.checked=e.checked:void 0!==e.value&&(n.value=e.value),void 0!==e.selected&&(n.selected=e.selected))}return n}class E{constructor(e,t,n){this.options=n,this.t1=A(e,this.options),this.t2=A(t,this.options),this.diffcount=0,this.foundAll=!1,this.debug&&(this.t1Orig=A(e,this.options),this.t2Orig=A(t,this.options)),this.tracker=new v}init(){return this.findDiffs(this.t1,this.t2)}findDiffs(e,t){let n;do{if(this.options.debug&&(this.diffcount+=1,this.diffcount>this.options.diffcap))throw window.diffError=[this.t1Orig,this.t2Orig],new Error(`surpassed diffcap:${JSON.stringify(this.t1Orig)} -> ${JSON.stringify(this.t2Orig)}`);n=this.findNextDiff(e,t,[]),0===n.length&&(p(e,t)||(this.foundAll?(console.error("Could not find remaining diffs!"),console.log({t1:e,t2:t})):(this.foundAll=!0,d(e),n=this.findNextDiff(e,t,[])))),n.length>0&&(this.foundAll=!1,this.tracker.add(n),w(e,n,this.options))}while(n.length>0);return this.tracker.list}findNextDiff(e,t,n){let r,i;if(this.options.maxDepth&&n.length>this.options.maxDepth)return[];if(!e.outerDone){if(r=this.findOuterDiff(e,t,n),this.filterOuterDiff&&(i=this.filterOuterDiff(e,t,r),i&&(r=i)),r.length>0)return e.outerDone=!0,r;e.outerDone=!0}if(!e.innerDone){if(r=this.findInnerDiff(e,t,n),r.length>0)return r;e.innerDone=!0}if(this.options.valueDiffing&&!e.valueDone){if(r=this.findValueDiff(e,t,n),r.length>0)return e.valueDone=!0,r;e.valueDone=!0}return[]}findOuterDiff(e,t,n){const r=[];let i,a,o,s,l,u;if(e.nodeName!==t.nodeName)return[(new c).setValue(this.options._const.action,this.options._const.replaceElement).setValue(this.options._const.oldValue,m(e)).setValue(this.options._const.newValue,m(t)).setValue(this.options._const.route,n)];if(n.length&&this.options.maxChildCount&&e.childNodes&&t.childNodes&&e.childNodes.length>this.options.maxChildCount&&t.childNodes.length>this.options.maxChildCount){const r=e.childNodes.length<t.childNodes.length?e.childNodes.length:t.childNodes.length;let i=0,a=0;for(;i<this.options.maxChildDiffCount&&a<r;)p(e.childNodes[a],t.childNodes[a])||i++,a++;if(i===this.options.maxChildDiffCount)return[(new c).setValue(this.options._const.action,this.options._const.replaceElement).setValue(this.options._const.oldValue,m(e)).setValue(this.options._const.newValue,m(t)).setValue(this.options._const.route,n)]}if(e.data!==t.data)return"#text"===e.nodeName?[(new c).setValue(this.options._const.action,this.options._const.modifyTextElement).setValue(this.options._const.route,n).setValue(this.options._const.oldValue,e.data).setValue(this.options._const.newValue,t.data)]:[(new c).setValue(this.options._const.action,this.options._const.modifyComment).setValue(this.options._const.route,n).setValue(this.options._const.oldValue,e.data).setValue(this.options._const.newValue,t.data)];for(a=e.attributes?Object.keys(e.attributes).sort():[],o=t.attributes?Object.keys(t.attributes).sort():[],s=a.length,u=0;u<s;u++)i=a[u],l=o.indexOf(i),-1===l?r.push((new c).setValue(this.options._const.action,this.options._const.removeAttribute).setValue(this.options._const.route,n).setValue(this.options._const.name,i).setValue(this.options._const.value,e.attributes[i])):(o.splice(l,1),e.attributes[i]!==t.attributes[i]&&r.push((new c).setValue(this.options._const.action,this.options._const.modifyAttribute).setValue(this.options._const.route,n).setValue(this.options._const.name,i).setValue(this.options._const.oldValue,e.attributes[i]).setValue(this.options._const.newValue,t.attributes[i])));for(s=o.length,u=0;u<s;u++)i=o[u],r.push((new c).setValue(this.options._const.action,this.options._const.addAttribute).setValue(this.options._const.route,n).setValue(this.options._const.name,i).setValue(this.options._const.value,t.attributes[i]));return r}findInnerDiff(e,t,n){const r=e.subsets&&e.subsetsAge--?e.subsets:e.childNodes&&t.childNodes?function(e,t){const n=e.childNodes?e.childNodes:[],r=t.childNodes?t.childNodes:[],i=y(n.length,!1),a=y(r.length,!1),o=[];let s=!0;const c=function(){return arguments[1]},l=e=>{i[s.oldValue+e]=!0,a[s.newValue+e]=!0};for(;s;)if(s=g(n,r,i,a),s){o.push(s);Array(...new Array(s.length)).map(c).forEach(e=>l(e))}return e.subsets=o,e.subsetsAge=100,o}(e,t):[],i=e.childNodes?e.childNodes:[],a=t.childNodes?t.childNodes:[];let o,s=[],l=0;if(r.length>0&&(s=this.attemptGroupRelocation(e,t,r,n),s.length>0))return s;const u=Math.max(i.length,a.length);i.length!==a.length&&(o=!0);for(let e=0;e<u;e+=1){const t=i[e],r=a[e];o&&(t&&!r?"#text"===t.nodeName?(s.push((new c).setValue(this.options._const.action,this.options._const.removeTextElement).setValue(this.options._const.route,n.concat(l)).setValue(this.options._const.value,t.data)),l-=1):(s.push((new c).setValue(this.options._const.action,this.options._const.removeElement).setValue(this.options._const.route,n.concat(l)).setValue(this.options._const.element,m(t))),l-=1):r&&!t&&("#text"===r.nodeName?s.push((new c).setValue(this.options._const.action,this.options._const.addTextElement).setValue(this.options._const.route,n.concat(l)).setValue(this.options._const.value,r.data)):s.push((new c).setValue(this.options._const.action,this.options._const.addElement).setValue(this.options._const.route,n.concat(l)).setValue(this.options._const.element,m(r))))),t&&r&&(s=s.concat(this.findNextDiff(t,r,n.concat(l)))),l+=1}return e.innerDone=!0,s}attemptGroupRelocation(e,t,n,r){const i=function(e,t,n){const r=e.childNodes?y(e.childNodes.length,!0):[],i=t.childNodes?y(t.childNodes.length,!0):[];let a=0;return n.forEach(e=>{const t=e.oldValue+e.length,n=e.newValue+e.length;for(let n=e.oldValue;n<t;n+=1)r[n]=a;for(let t=e.newValue;t<n;t+=1)i[t]=a;a+=1}),{gaps1:r,gaps2:i}}(e,t,n),a=i.gaps1,o=i.gaps2;let s,l,u,h,d,p,g=Math.min(a.length,o.length);const v=[];for(let i=0,y=0;i<g;y+=1,i+=1)if(!0===a[i])if(h=e.childNodes[y],"#text"===h.nodeName){if("#text"===t.childNodes[i].nodeName&&h.data!==t.childNodes[i].data){for(p=y;e.childNodes.length>p+1&&"#text"===e.childNodes[p+1].nodeName;)if(p+=1,t.childNodes[i].data===e.childNodes[p].data){d=!0;break}if(!d)return v.push((new c).setValue(this.options._const.action,this.options._const.modifyTextElement).setValue(this.options._const.route,r.concat(i)).setValue(this.options._const.oldValue,h.data).setValue(this.options._const.newValue,t.childNodes[i].data)),v}v.push((new c).setValue(this.options._const.action,this.options._const.removeTextElement).setValue(this.options._const.route,r.concat(i)).setValue(this.options._const.value,h.data)),a.splice(i,1),g=Math.min(a.length,o.length),i-=1}else v.push((new c).setValue(this.options._const.action,this.options._const.removeElement).setValue(this.options._const.route,r.concat(i)).setValue(this.options._const.element,m(h))),a.splice(i,1),g=Math.min(a.length,o.length),i-=1;else if(!0===o[i])h=t.childNodes[i],"#text"===h.nodeName?(v.push((new c).setValue(this.options._const.action,this.options._const.addTextElement).setValue(this.options._const.route,r.concat(i)).setValue(this.options._const.value,h.data)),a.splice(i,0,!0),g=Math.min(a.length,o.length),y-=1):(v.push((new c).setValue(this.options._const.action,this.options._const.addElement).setValue(this.options._const.route,r.concat(i)).setValue(this.options._const.element,m(h))),a.splice(i,0,!0),g=Math.min(a.length,o.length),y-=1);else if(a[i]!==o[i]){if(v.length>0)return v;if(u=n[a[i]],l=Math.min(u.newValue,e.childNodes.length-u.length),l!==u.oldValue){s=!1;for(let t=0;t<u.length;t+=1)f(e.childNodes[l+t],e.childNodes[u.oldValue+t],[],!1,!0)||(s=!0);if(s)return[(new c).setValue(this.options._const.action,this.options._const.relocateGroup).setValue("groupLength",u.length).setValue(this.options._const.from,u.oldValue).setValue(this.options._const.to,l).setValue(this.options._const.route,r)]}}return v}findValueDiff(e,t,n){const r=[];return e.selected!==t.selected&&r.push((new c).setValue(this.options._const.action,this.options._const.modifySelected).setValue(this.options._const.oldValue,e.selected).setValue(this.options._const.newValue,t.selected).setValue(this.options._const.route,n)),(e.value||t.value)&&e.value!==t.value&&"OPTION"!==e.nodeName&&r.push((new c).setValue(this.options._const.action,this.options._const.modifyValue).setValue(this.options._const.oldValue,e.value||"").setValue(this.options._const.newValue,t.value||"").setValue(this.options._const.route,n)),e.checked!==t.checked&&r.push((new c).setValue(this.options._const.action,this.options._const.modifyChecked).setValue(this.options._const.oldValue,e.checked).setValue(this.options._const.newValue,t.checked).setValue(this.options._const.route,n)),r}}const x={debug:!1,diffcap:10,maxDepth:!1,maxChildCount:50,maxChildDiffCount:3,valueDiffing:!0,textDiff(e,t,n,r){e.data=r},preVirtualDiffApply(){},postVirtualDiffApply(){},preDiffApply(){},postDiffApply(){},filterOuterDiff:null,compress:!1,_const:!1,document:!(!window||!window.document)&&window.document};class _{constructor(e={}){if(this.options=e,Object.entries(x).forEach(([e,t])=>{Object.prototype.hasOwnProperty.call(this.options,e)||(this.options[e]=t)}),!this.options._const){const e=["addAttribute","modifyAttribute","removeAttribute","modifyTextElement","relocateGroup","removeElement","addElement","removeTextElement","addTextElement","replaceElement","modifyValue","modifyChecked","modifySelected","modifyComment","action","route","oldValue","newValue","element","group","from","to","name","value","data","attributes","nodeName","childNodes","checked","selected"];this.options._const={},this.options.compress?e.forEach((e,t)=>this.options._const[e]=t):e.forEach(e=>this.options._const[e]=e)}this.DiffFinder=E}apply(e,t){return function(e,t,n){return t.every(t=>a(e,t,n))}(e,t,this.options)}undo(e,t){return s(e,t,this.options)}diff(e,t){return new this.DiffFinder(e,t,this.options).init()}}class S{constructor(e={}){this.pad="│ ",this.padding="",this.tick=1,this.messages=[];const t=(e,t)=>{const n=e[t];e[t]=(...r)=>{this.fin(t,Array.prototype.slice.call(r));const i=n.apply(e,r);return this.fout(t,i),i}};for(let n in e)"function"==typeof e[n]&&t(e,n);this.log("┌ TRACELOG START")}fin(e,t){this.padding+=this.pad,this.log("├─> entering "+e,t)}fout(e,t){this.log("│<──┘ generated return value",t),this.padding=this.padding.substring(0,this.padding.length-this.pad.length)}format(e,t){return`${function(e){for(e=""+e;e.length<4;)e="0"+e;return e}(t)}> ${this.padding}${e}`}log(){let e=Array.prototype.slice.call(arguments);const t=function(e){return e?"string"==typeof e?e:e instanceof HTMLElement?e.outerHTML||"<empty>":e instanceof Array?`[${e.map(t).join(",")}]`:e.toString()||e.valueOf()||"<unknown>":"<falsey>"};e=e.map(t).join(", "),this.messages.push(this.format(e,this.tick++))}toString(){let e="└───";for(;e.length<=this.padding.length+this.pad.length;)e+="× ";let t=this.padding;return this.padding="",e=this.format(e,this.tick),this.padding=t,`${this.messages.join("\n")}\n${e}`}}},function(e,t,n){"use strict";n.r(t);var r=THREE.ExtrudeGeometry;class i extends r{constructor(e,t={}){const n=t.font;if(void 0===n)super();else{const r=n.generateShapes(e,t.size);t.depth=void 0!==t.height?t.height:50,void 0===t.bevelThickness&&(t.bevelThickness=10),void 0===t.bevelSize&&(t.bevelSize=8),void 0===t.bevelEnabled&&(t.bevelEnabled=!1),super(r,t)}this.type="TextGeometry"}}function a(){}void 0===Number.EPSILON&&(Number.EPSILON=Math.pow(2,-52)),void 0===Number.isInteger&&(Number.isInteger=function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e}),void 0===Math.sign&&(Math.sign=function(e){return e<0?-1:e>0?1:+e}),"name"in Function.prototype==!1&&Object.defineProperty(Function.prototype,"name",{get:function(){return this.toString().match(/^\s*function\s*([^\(\s]*)/)[1]}}),void 0===Object.assign&&(Object.assign=function(e){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n<arguments.length;n++){var r=arguments[n];if(null!=r)for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t}),Object.assign(a.prototype,{addEventListener:function(e,t){void 0===this._listeners&&(this._listeners={});var n=this._listeners;void 0===n[e]&&(n[e]=[]),-1===n[e].indexOf(t)&&n[e].push(t)},hasEventListener:function(e,t){if(void 0===this._listeners)return!1;var n=this._listeners;return void 0!==n[e]&&-1!==n[e].indexOf(t)},removeEventListener:function(e,t){if(void 0!==this._listeners){var n=this._listeners[e];if(void 0!==n){var r=n.indexOf(t);-1!==r&&n.splice(r,1)}}},dispatchEvent:function(e){if(void 0!==this._listeners){var t=this._listeners[e.type];if(void 0!==t){e.target=this;for(var n=t.slice(0),r=0,i=n.length;r<i;r++)n[r].call(this,e)}}}});var o,s,c,l,u,h,d,p,f,m={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:function(){for(var e=[],t=0;t<256;t++)e[t]=(t<16?"0":"")+t.toString(16).toUpperCase();return function(){var t=4294967295*Math.random()|0,n=4294967295*Math.random()|0,r=4294967295*Math.random()|0,i=4294967295*Math.random()|0;return e[255&t]+e[t>>8&255]+e[t>>16&255]+e[t>>24&255]+"-"+e[255&n]+e[n>>8&255]+"-"+e[n>>16&15|64]+e[n>>24&255]+"-"+e[63&r|128]+e[r>>8&255]+"-"+e[r>>16&255]+e[r>>24&255]+e[255&i]+e[i>>8&255]+e[i>>16&255]+e[i>>24&255]}}(),clamp:function(e,t,n){return Math.max(t,Math.min(n,e))},euclideanModulo:function(e,t){return(e%t+t)%t},mapLinear:function(e,t,n,r,i){return r+(e-t)*(i-r)/(n-t)},lerp:function(e,t,n){return(1-n)*e+n*t},smoothstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*(3-2*e)},smootherstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*e*(e*(6*e-15)+10)},randInt:function(e,t){return e+Math.floor(Math.random()*(t-e+1))},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(.5-Math.random())},degToRad:function(e){return e*m.DEG2RAD},radToDeg:function(e){return e*m.RAD2DEG},isPowerOfTwo:function(e){return 0==(e&e-1)&&0!==e},ceilPowerOfTwo:function(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))},floorPowerOfTwo:function(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))}};function g(e,t){this.x=e||0,this.y=t||0}function y(){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.")}function v(e,t,n,r){this._x=e||0,this._y=t||0,this._z=n||0,this._w=void 0!==r?r:1}function b(e,t,n){this.x=e||0,this.y=t||0,this.z=n||0}function w(){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.")}Object.defineProperties(g.prototype,{width:{get:function(){return this.x},set:function(e){this.x=e}},height:{get:function(){return this.y},set:function(e){this.y=e}}}),Object.assign(g.prototype,{isVector2:!0,set:function(e,t){return this.x=e,this.y=t,this},setScalar:function(e){return this.x=e,this.y=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setComponent:function(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:function(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}},clone:function(){return new this.constructor(this.x,this.y)},copy:function(e){return this.x=e.x,this.y=e.y,this},add:function(e,t){return void 0!==t?(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:function(e){return this.x+=e,this.y+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this},addScaledVector:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this},sub:function(e,t){return void 0!==t?(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:function(e){return this.x-=e,this.y-=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this},multiply:function(e){return this.x*=e.x,this.y*=e.y,this},multiplyScalar:function(e){return this.x*=e,this.y*=e,this},divide:function(e){return this.x/=e.x,this.y/=e.y,this},divideScalar:function(e){return this.multiplyScalar(1/e)},applyMatrix3:function(e){var t=this.x,n=this.y,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6],this.y=r[1]*t+r[4]*n+r[7],this},min:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this},max:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this},clamp:function(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:(o=new g,s=new g,function(e,t){return o.set(e,e),s.set(t,t),this.clamp(o,s)}),clampLength:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},roundToZero:function(){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:function(){return this.x=-this.x,this.y=-this.y,this},dot:function(e){return this.x*e.x+this.y*e.y},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)},normalize:function(){return this.divideScalar(this.length()||1)},angle:function(){var e=Math.atan2(this.y,this.x);return e<0&&(e+=2*Math.PI),e},distanceTo:function(e){return Math.sqrt(this.distanceToSquared(e))},distanceToSquared:function(e){var t=this.x-e.x,n=this.y-e.y;return t*t+n*n},manhattanDistanceTo:function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)},setLength:function(e){return this.normalize().multiplyScalar(e)},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this},lerpVectors:function(e,t,n){return this.subVectors(t,e).multiplyScalar(n).add(e)},equals:function(e){return e.x===this.x&&e.y===this.y},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e},fromBufferAttribute:function(e,t,n){return void 0!==n&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this},rotateAround:function(e,t){var n=Math.cos(t),r=Math.sin(t),i=this.x-e.x,a=this.y-e.y;return this.x=i*n-a*r+e.x,this.y=i*r+a*n+e.y,this}}),Object.assign(y.prototype,{isMatrix4:!0,set:function(e,t,n,r,i,a,o,s,c,l,u,h,d,p,f,m){var g=this.elements;return g[0]=e,g[4]=t,g[8]=n,g[12]=r,g[1]=i,g[5]=a,g[9]=o,g[13]=s,g[2]=c,g[6]=l,g[10]=u,g[14]=h,g[3]=d,g[7]=p,g[11]=f,g[15]=m,this},identity:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this},clone:function(){return(new y).fromArray(this.elements)},copy:function(e){var 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:function(e){var t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this},extractBasis:function(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this},makeBasis:function(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:(p=new b,function(e){var t=this.elements,n=e.elements,r=1/p.setFromMatrixColumn(e,0).length(),i=1/p.setFromMatrixColumn(e,1).length(),a=1/p.setFromMatrixColumn(e,2).length();return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[4]=n[4]*i,t[5]=n[5]*i,t[6]=n[6]*i,t[8]=n[8]*a,t[9]=n[9]*a,t[10]=n[10]*a,this}),makeRotationFromEuler:function(e){e&&e.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var t=this.elements,n=e.x,r=e.y,i=e.z,a=Math.cos(n),o=Math.sin(n),s=Math.cos(r),c=Math.sin(r),l=Math.cos(i),u=Math.sin(i);if("XYZ"===e.order){var h=a*l,d=a*u,p=o*l,f=o*u;t[0]=s*l,t[4]=-s*u,t[8]=c,t[1]=d+p*c,t[5]=h-f*c,t[9]=-o*s,t[2]=f-h*c,t[6]=p+d*c,t[10]=a*s}else if("YXZ"===e.order){var m=s*l,g=s*u,y=c*l,v=c*u;t[0]=m+v*o,t[4]=y*o-g,t[8]=a*c,t[1]=a*u,t[5]=a*l,t[9]=-o,t[2]=g*o-y,t[6]=v+m*o,t[10]=a*s}else if("ZXY"===e.order){m=s*l,g=s*u,y=c*l,v=c*u;t[0]=m-v*o,t[4]=-a*u,t[8]=y+g*o,t[1]=g+y*o,t[5]=a*l,t[9]=v-m*o,t[2]=-a*c,t[6]=o,t[10]=a*s}else if("ZYX"===e.order){h=a*l,d=a*u,p=o*l,f=o*u;t[0]=s*l,t[4]=p*c-d,t[8]=h*c+f,t[1]=s*u,t[5]=f*c+h,t[9]=d*c-p,t[2]=-c,t[6]=o*s,t[10]=a*s}else if("YZX"===e.order){var b=a*s,w=a*c,A=o*s,E=o*c;t[0]=s*l,t[4]=E-b*u,t[8]=A*u+w,t[1]=u,t[5]=a*l,t[9]=-o*l,t[2]=-c*l,t[6]=w*u+A,t[10]=b-E*u}else if("XZY"===e.order){b=a*s,w=a*c,A=o*s,E=o*c;t[0]=s*l,t[4]=-u,t[8]=c*l,t[1]=b*u+E,t[5]=a*l,t[9]=w*u-A,t[2]=A*u-w,t[6]=o*l,t[10]=E*u+b}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},makeRotationFromQuaternion:function(e){var t=this.elements,n=e._x,r=e._y,i=e._z,a=e._w,o=n+n,s=r+r,c=i+i,l=n*o,u=n*s,h=n*c,d=r*s,p=r*c,f=i*c,m=a*o,g=a*s,y=a*c;return t[0]=1-(d+f),t[4]=u-y,t[8]=h+g,t[1]=u+y,t[5]=1-(l+f),t[9]=p-m,t[2]=h-g,t[6]=p+m,t[10]=1-(l+d),t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},lookAt:(u=new b,h=new b,d=new b,function(e,t,n){var r=this.elements;return d.subVectors(e,t),0===d.lengthSq()&&(d.z=1),d.normalize(),u.crossVectors(n,d),0===u.lengthSq()&&(1===Math.abs(n.z)?d.x+=1e-4:d.z+=1e-4,d.normalize(),u.crossVectors(n,d)),u.normalize(),h.crossVectors(d,u),r[0]=u.x,r[4]=h.x,r[8]=d.x,r[1]=u.y,r[5]=h.y,r[9]=d.y,r[2]=u.z,r[6]=h.z,r[10]=d.z,this}),multiply:function(e,t){return void 0!==t?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(e,t)):this.multiplyMatrices(this,e)},premultiply:function(e){return this.multiplyMatrices(e,this)},multiplyMatrices:function(e,t){var n=e.elements,r=t.elements,i=this.elements,a=n[0],o=n[4],s=n[8],c=n[12],l=n[1],u=n[5],h=n[9],d=n[13],p=n[2],f=n[6],m=n[10],g=n[14],y=n[3],v=n[7],b=n[11],w=n[15],A=r[0],E=r[4],x=r[8],_=r[12],S=r[1],M=r[5],T=r[9],R=r[13],k=r[2],C=r[6],O=r[10],P=r[14],I=r[3],N=r[7],L=r[11],D=r[15];return i[0]=a*A+o*S+s*k+c*I,i[4]=a*E+o*M+s*C+c*N,i[8]=a*x+o*T+s*O+c*L,i[12]=a*_+o*R+s*P+c*D,i[1]=l*A+u*S+h*k+d*I,i[5]=l*E+u*M+h*C+d*N,i[9]=l*x+u*T+h*O+d*L,i[13]=l*_+u*R+h*P+d*D,i[2]=p*A+f*S+m*k+g*I,i[6]=p*E+f*M+m*C+g*N,i[10]=p*x+f*T+m*O+g*L,i[14]=p*_+f*R+m*P+g*D,i[3]=y*A+v*S+b*k+w*I,i[7]=y*E+v*M+b*C+w*N,i[11]=y*x+v*T+b*O+w*L,i[15]=y*_+v*R+b*P+w*D,this},multiplyScalar:function(e){var 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},applyToBufferAttribute:function(){var e=new b;return function(t){for(var n=0,r=t.count;n<r;n++)e.x=t.getX(n),e.y=t.getY(n),e.z=t.getZ(n),e.applyMatrix4(this),t.setXYZ(n,e.x,e.y,e.z);return t}}(),determinant:function(){var e=this.elements,t=e[0],n=e[4],r=e[8],i=e[12],a=e[1],o=e[5],s=e[9],c=e[13],l=e[2],u=e[6],h=e[10],d=e[14];return e[3]*(+i*s*u-r*c*u-i*o*h+n*c*h+r*o*d-n*s*d)+e[7]*(+t*s*d-t*c*h+i*a*h-r*a*d+r*c*l-i*s*l)+e[11]*(+t*c*u-t*o*d-i*a*u+n*a*d+i*o*l-n*c*l)+e[15]*(-r*o*l-t*s*u+t*o*h+r*a*u-n*a*h+n*s*l)},transpose:function(){var e,t=this.elements;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this},setPosition:function(e){var t=this.elements;return t[12]=e.x,t[13]=e.y,t[14]=e.z,this},getInverse:function(e,t){var n=this.elements,r=e.elements,i=r[0],a=r[1],o=r[2],s=r[3],c=r[4],l=r[5],u=r[6],h=r[7],d=r[8],p=r[9],f=r[10],m=r[11],g=r[12],y=r[13],v=r[14],b=r[15],w=p*v*h-y*f*h+y*u*m-l*v*m-p*u*b+l*f*b,A=g*f*h-d*v*h-g*u*m+c*v*m+d*u*b-c*f*b,E=d*y*h-g*p*h+g*l*m-c*y*m-d*l*b+c*p*b,x=g*p*u-d*y*u-g*l*f+c*y*f+d*l*v-c*p*v,_=i*w+a*A+o*E+s*x;if(0===_){var S="THREE.Matrix4: .getInverse() can't invert matrix, determinant is 0";if(!0===t)throw new Error(S);return console.warn(S),this.identity()}var M=1/_;return n[0]=w*M,n[1]=(y*f*s-p*v*s-y*o*m+a*v*m+p*o*b-a*f*b)*M,n[2]=(l*v*s-y*u*s+y*o*h-a*v*h-l*o*b+a*u*b)*M,n[3]=(p*u*s-l*f*s-p*o*h+a*f*h+l*o*m-a*u*m)*M,n[4]=A*M,n[5]=(d*v*s-g*f*s+g*o*m-i*v*m-d*o*b+i*f*b)*M,n[6]=(g*u*s-c*v*s-g*o*h+i*v*h+c*o*b-i*u*b)*M,n[7]=(c*f*s-d*u*s+d*o*h-i*f*h-c*o*m+i*u*m)*M,n[8]=E*M,n[9]=(g*p*s-d*y*s-g*a*m+i*y*m+d*a*b-i*p*b)*M,n[10]=(c*y*s-g*l*s+g*a*h-i*y*h-c*a*b+i*l*b)*M,n[11]=(d*l*s-c*p*s-d*a*h+i*p*h+c*a*m-i*l*m)*M,n[12]=x*M,n[13]=(d*y*o-g*p*o+g*a*f-i*y*f-d*a*v+i*p*v)*M,n[14]=(g*l*o-c*y*o-g*a*u+i*y*u+c*a*v-i*l*v)*M,n[15]=(c*p*o-d*l*o+d*a*u-i*p*u-c*a*f+i*l*f)*M,this},scale:function(e){var t=this.elements,n=e.x,r=e.y,i=e.z;return t[0]*=n,t[4]*=r,t[8]*=i,t[1]*=n,t[5]*=r,t[9]*=i,t[2]*=n,t[6]*=r,t[10]*=i,t[3]*=n,t[7]*=r,t[11]*=i,this},getMaxScaleOnAxis:function(){var 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],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,r))},makeTranslation:function(e,t,n){return this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this},makeRotationX:function(e){var 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:function(e){var 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:function(e){var 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:function(e,t){var n=Math.cos(t),r=Math.sin(t),i=1-n,a=e.x,o=e.y,s=e.z,c=i*a,l=i*o;return this.set(c*a+n,c*o-r*s,c*s+r*o,0,c*o+r*s,l*o+n,l*s-r*a,0,c*s-r*o,l*s+r*a,i*s*s+n,0,0,0,0,1),this},makeScale:function(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this},makeShear:function(e,t,n){return this.set(1,t,n,0,e,1,n,0,e,t,1,0,0,0,0,1),this},compose:function(e,t,n){return this.makeRotationFromQuaternion(t),this.scale(n),this.setPosition(e),this},decompose:(c=new b,l=new y,function(e,t,n){var r=this.elements,i=c.set(r[0],r[1],r[2]).length(),a=c.set(r[4],r[5],r[6]).length(),o=c.set(r[8],r[9],r[10]).length();this.determinant()<0&&(i=-i),e.x=r[12],e.y=r[13],e.z=r[14],l.copy(this);var s=1/i,u=1/a,h=1/o;return l.elements[0]*=s,l.elements[1]*=s,l.elements[2]*=s,l.elements[4]*=u,l.elements[5]*=u,l.elements[6]*=u,l.elements[8]*=h,l.elements[9]*=h,l.elements[10]*=h,t.setFromRotationMatrix(l),n.x=i,n.y=a,n.z=o,this}),makePerspective:function(e,t,n,r,i,a){void 0===a&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");var o=this.elements,s=2*i/(t-e),c=2*i/(n-r),l=(t+e)/(t-e),u=(n+r)/(n-r),h=-(a+i)/(a-i),d=-2*a*i/(a-i);return o[0]=s,o[4]=0,o[8]=l,o[12]=0,o[1]=0,o[5]=c,o[9]=u,o[13]=0,o[2]=0,o[6]=0,o[10]=h,o[14]=d,o[3]=0,o[7]=0,o[11]=-1,o[15]=0,this},makeOrthographic:function(e,t,n,r,i,a){var o=this.elements,s=1/(t-e),c=1/(n-r),l=1/(a-i),u=(t+e)*s,h=(n+r)*c,d=(a+i)*l;return o[0]=2*s,o[4]=0,o[8]=0,o[12]=-u,o[1]=0,o[5]=2*c,o[9]=0,o[13]=-h,o[2]=0,o[6]=0,o[10]=-2*l,o[14]=-d,o[3]=0,o[7]=0,o[11]=0,o[15]=1,this},equals:function(e){for(var t=this.elements,n=e.elements,r=0;r<16;r++)if(t[r]!==n[r])return!1;return!0},fromArray:function(e,t){void 0===t&&(t=0);for(var n=0;n<16;n++)this.elements[n]=e[n+t];return this},toArray:function(e,t){void 0===e&&(e=[]),void 0===t&&(t=0);var 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}}),Object.assign(v,{slerp:function(e,t,n,r){return n.copy(e).slerp(t,r)},slerpFlat:function(e,t,n,r,i,a,o){var s=n[r+0],c=n[r+1],l=n[r+2],u=n[r+3],h=i[a+0],d=i[a+1],p=i[a+2],f=i[a+3];if(u!==f||s!==h||c!==d||l!==p){var m=1-o,g=s*h+c*d+l*p+u*f,y=g>=0?1:-1,v=1-g*g;if(v>Number.EPSILON){var b=Math.sqrt(v),w=Math.atan2(b,g*y);m=Math.sin(m*w)/b,o=Math.sin(o*w)/b}var A=o*y;if(s=s*m+h*A,c=c*m+d*A,l=l*m+p*A,u=u*m+f*A,m===1-o){var E=1/Math.sqrt(s*s+c*c+l*l+u*u);s*=E,c*=E,l*=E,u*=E}}e[t]=s,e[t+1]=c,e[t+2]=l,e[t+3]=u}}),Object.defineProperties(v.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this.onChangeCallback()}},y:{get:function(){return this._y},set:function(e){this._y=e,this.onChangeCallback()}},z:{get:function(){return this._z},set:function(e){this._z=e,this.onChangeCallback()}},w:{get:function(){return this._w},set:function(e){this._w=e,this.onChangeCallback()}}}),Object.assign(v.prototype,{set:function(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._w=r,this.onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._w)},copy:function(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this.onChangeCallback(),this},setFromEuler:function(e,t){if(!e||!e.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var n=e._x,r=e._y,i=e._z,a=e.order,o=Math.cos,s=Math.sin,c=o(n/2),l=o(r/2),u=o(i/2),h=s(n/2),d=s(r/2),p=s(i/2);return"XYZ"===a?(this._x=h*l*u+c*d*p,this._y=c*d*u-h*l*p,this._z=c*l*p+h*d*u,this._w=c*l*u-h*d*p):"YXZ"===a?(this._x=h*l*u+c*d*p,this._y=c*d*u-h*l*p,this._z=c*l*p-h*d*u,this._w=c*l*u+h*d*p):"ZXY"===a?(this._x=h*l*u-c*d*p,this._y=c*d*u+h*l*p,this._z=c*l*p+h*d*u,this._w=c*l*u-h*d*p):"ZYX"===a?(this._x=h*l*u-c*d*p,this._y=c*d*u+h*l*p,this._z=c*l*p-h*d*u,this._w=c*l*u+h*d*p):"YZX"===a?(this._x=h*l*u+c*d*p,this._y=c*d*u+h*l*p,this._z=c*l*p-h*d*u,this._w=c*l*u-h*d*p):"XZY"===a&&(this._x=h*l*u-c*d*p,this._y=c*d*u-h*l*p,this._z=c*l*p+h*d*u,this._w=c*l*u+h*d*p),!1!==t&&this.onChangeCallback(),this},setFromAxisAngle:function(e,t){var n=t/2,r=Math.sin(n);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(n),this.onChangeCallback(),this},setFromRotationMatrix:function(e){var t,n=e.elements,r=n[0],i=n[4],a=n[8],o=n[1],s=n[5],c=n[9],l=n[2],u=n[6],h=n[10],d=r+s+h;return d>0?(t=.5/Math.sqrt(d+1),this._w=.25/t,this._x=(u-c)*t,this._y=(a-l)*t,this._z=(o-i)*t):r>s&&r>h?(t=2*Math.sqrt(1+r-s-h),this._w=(u-c)/t,this._x=.25*t,this._y=(i+o)/t,this._z=(a+l)/t):s>h?(t=2*Math.sqrt(1+s-r-h),this._w=(a-l)/t,this._x=(i+o)/t,this._y=.25*t,this._z=(c+u)/t):(t=2*Math.sqrt(1+h-r-s),this._w=(o-i)/t,this._x=(a+l)/t,this._y=(c+u)/t,this._z=.25*t),this.onChangeCallback(),this},setFromUnitVectors:function(){var e,t=new b;return function(n,r){return void 0===t&&(t=new b),(e=n.dot(r)+1)<1e-6?(e=0,Math.abs(n.x)>Math.abs(n.z)?t.set(-n.y,n.x,0):t.set(0,-n.z,n.y)):t.crossVectors(n,r),this._x=t.x,this._y=t.y,this._z=t.z,this._w=e,this.normalize()}}(),inverse:function(){return this.conjugate()},conjugate:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this.onChangeCallback(),this},dot:function(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w},lengthSq:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},length:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},normalize:function(){var e=this.length();return 0===e?(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:function(e,t){return void 0!==t?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(e,t)):this.multiplyQuaternions(this,e)},premultiply:function(e){return this.multiplyQuaternions(e,this)},multiplyQuaternions:function(e,t){var n=e._x,r=e._y,i=e._z,a=e._w,o=t._x,s=t._y,c=t._z,l=t._w;return this._x=n*l+a*o+r*c-i*s,this._y=r*l+a*s+i*o-n*c,this._z=i*l+a*c+n*s-r*o,this._w=a*l-n*o-r*s-i*c,this.onChangeCallback(),this},slerp:function(e,t){if(0===t)return this;if(1===t)return this.copy(e);var n=this._x,r=this._y,i=this._z,a=this._w,o=a*e._w+n*e._x+r*e._y+i*e._z;if(o<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,o=-o):this.copy(e),o>=1)return this._w=a,this._x=n,this._y=r,this._z=i,this;var s=Math.sqrt(1-o*o);if(Math.abs(s)<.001)return this._w=.5*(a+this._w),this._x=.5*(n+this._x),this._y=.5*(r+this._y),this._z=.5*(i+this._z),this;var c=Math.atan2(s,o),l=Math.sin((1-t)*c)/s,u=Math.sin(t*c)/s;return this._w=a*l+this._w*u,this._x=n*l+this._x*u,this._y=r*l+this._y*u,this._z=i*l+this._z*u,this.onChangeCallback(),this},equals:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w},fromArray:function(e,t){return void 0===t&&(t=0),this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this.onChangeCallback(),this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e},onChange:function(e){return this.onChangeCallback=e,this},onChangeCallback:function(){}}),Object.assign(b.prototype,{isVector3:!0,set:function(e,t,n){return this.x=e,this.y=t,this.z=n,this},setScalar:function(e){return this.x=e,this.y=e,this.z=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setZ:function(e){return this.z=e,this},setComponent:function(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:function(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:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this},add:function(e,t){return void 0!==t?(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:function(e){return this.x+=e,this.y+=e,this.z+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this},addScaledVector:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this},sub:function(e,t){return void 0!==t?(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:function(e){return this.x-=e,this.y-=e,this.z-=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this},multiply:function(e,t){return void 0!==t?(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:function(e){return this.x*=e,this.y*=e,this.z*=e,this},multiplyVectors:function(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this},applyEuler:(f=new v,function(e){return e&&e.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(f.setFromEuler(e))}),applyAxisAngle:function(){var e=new v;return function(t,n){return this.applyQuaternion(e.setFromAxisAngle(t,n))}}(),applyMatrix3:function(e){var t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6]*r,this.y=i[1]*t+i[4]*n+i[7]*r,this.z=i[2]*t+i[5]*n+i[8]*r,this},applyMatrix4:function(e){var t=this.x,n=this.y,r=this.z,i=e.elements,a=1/(i[3]*t+i[7]*n+i[11]*r+i[15]);return this.x=(i[0]*t+i[4]*n+i[8]*r+i[12])*a,this.y=(i[1]*t+i[5]*n+i[9]*r+i[13])*a,this.z=(i[2]*t+i[6]*n+i[10]*r+i[14])*a,this},applyQuaternion:function(e){var t=this.x,n=this.y,r=this.z,i=e.x,a=e.y,o=e.z,s=e.w,c=s*t+a*r-o*n,l=s*n+o*t-i*r,u=s*r+i*n-a*t,h=-i*t-a*n-o*r;return this.x=c*s+h*-i+l*-o-u*-a,this.y=l*s+h*-a+u*-i-c*-o,this.z=u*s+h*-o+c*-a-l*-i,this},project:function(){var e=new y;return function(t){return e.multiplyMatrices(t.projectionMatrix,e.getInverse(t.matrixWorld)),this.applyMatrix4(e)}}(),unproject:function(){var e=new y;return function(t){return e.multiplyMatrices(t.matrixWorld,e.getInverse(t.projectionMatrix)),this.applyMatrix4(e)}}(),transformDirection:function(e){var t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[4]*n+i[8]*r,this.y=i[1]*t+i[5]*n+i[9]*r,this.z=i[2]*t+i[6]*n+i[10]*r,this.normalize()},divide:function(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this},divideScalar:function(e){return this.multiplyScalar(1/e)},min:function(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:function(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:function(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:function(){var e=new b,t=new b;return function(n,r){return e.set(n,n,n),t.set(r,r,r),this.clamp(e,t)}}(),clampLength:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},roundToZero:function(){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:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},dot:function(e){return this.x*e.x+this.y*e.y+this.z*e.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(e){return this.normalize().multiplyScalar(e)},lerp:function(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:function(e,t,n){return this.subVectors(t,e).multiplyScalar(n).add(e)},cross:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(e,t)):this.crossVectors(this,e)},crossVectors:function(e,t){var n=e.x,r=e.y,i=e.z,a=t.x,o=t.y,s=t.z;return this.x=r*s-i*o,this.y=i*a-n*s,this.z=n*o-r*a,this},projectOnVector:function(e){var t=e.dot(this)/e.lengthSq();return this.copy(e).multiplyScalar(t)},projectOnPlane:function(){var e=new b;return function(t){return e.copy(this).projectOnVector(t),this.sub(e)}}(),reflect:function(){var e=new b;return function(t){return this.sub(e.copy(t).multiplyScalar(2*this.dot(t)))}}(),angleTo:function(e){var t=this.dot(e)/Math.sqrt(this.lengthSq()*e.lengthSq());return Math.acos(m.clamp(t,-1,1))},distanceTo:function(e){return Math.sqrt(this.distanceToSquared(e))},distanceToSquared:function(e){var t=this.x-e.x,n=this.y-e.y,r=this.z-e.z;return t*t+n*n+r*r},manhattanDistanceTo:function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)},setFromSpherical:function(e){var t=Math.sin(e.phi)*e.radius;return this.x=t*Math.sin(e.theta),this.y=Math.cos(e.phi)*e.radius,this.z=t*Math.cos(e.theta),this},setFromCylindrical:function(e){return this.x=e.radius*Math.sin(e.theta),this.y=e.y,this.z=e.radius*Math.cos(e.theta),this},setFromMatrixPosition:function(e){var t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this},setFromMatrixScale:function(e){var t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=r,this},setFromMatrixColumn:function(e,t){return this.fromArray(e.elements,4*t)},equals:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this.z=e[t+2],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e},fromBufferAttribute:function(e,t,n){return void 0!==n&&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}}),Object.assign(w.prototype,{isMatrix3:!0,set:function(e,t,n,r,i,a,o,s,c){var l=this.elements;return l[0]=e,l[1]=r,l[2]=o,l[3]=t,l[4]=i,l[5]=s,l[6]=n,l[7]=a,l[8]=c,this},identity:function(){return this.set(1,0,0,0,1,0,0,0,1),this},clone:function(){return(new this.constructor).fromArray(this.elements)},copy:function(e){var 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},setFromMatrix4:function(e){var 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},applyToBufferAttribute:function(){var e=new b;return function(t){for(var n=0,r=t.count;n<r;n++)e.x=t.getX(n),e.y=t.getY(n),e.z=t.getZ(n),e.applyMatrix3(this),t.setXYZ(n,e.x,e.y,e.z);return t}}(),multiply:function(e){return this.multiplyMatrices(this,e)},premultiply:function(e){return this.multiplyMatrices(e,this)},multiplyMatrices:function(e,t){var n=e.elements,r=t.elements,i=this.elements,a=n[0],o=n[3],s=n[6],c=n[1],l=n[4],u=n[7],h=n[2],d=n[5],p=n[8],f=r[0],m=r[3],g=r[6],y=r[1],v=r[4],b=r[7],w=r[2],A=r[5],E=r[8];return i[0]=a*f+o*y+s*w,i[3]=a*m+o*v+s*A,i[6]=a*g+o*b+s*E,i[1]=c*f+l*y+u*w,i[4]=c*m+l*v+u*A,i[7]=c*g+l*b+u*E,i[2]=h*f+d*y+p*w,i[5]=h*m+d*v+p*A,i[8]=h*g+d*b+p*E,this},multiplyScalar:function(e){var 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:function(){var e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],c=e[7],l=e[8];return t*a*l-t*o*c-n*i*l+n*o*s+r*i*c-r*a*s},getInverse:function(e,t){e&&e.isMatrix4&&console.error("THREE.Matrix3: .getInverse() no longer takes a Matrix4 argument.");var n=e.elements,r=this.elements,i=n[0],a=n[1],o=n[2],s=n[3],c=n[4],l=n[5],u=n[6],h=n[7],d=n[8],p=d*c-l*h,f=l*u-d*s,m=h*s-c*u,g=i*p+a*f+o*m;if(0===g){var y="THREE.Matrix3: .getInverse() can't invert matrix, determinant is 0";if(!0===t)throw new Error(y);return console.warn(y),this.identity()}var v=1/g;return r[0]=p*v,r[1]=(o*h-d*a)*v,r[2]=(l*a-o*c)*v,r[3]=f*v,r[4]=(d*i-o*u)*v,r[5]=(o*s-l*i)*v,r[6]=m*v,r[7]=(a*u-h*i)*v,r[8]=(c*i-a*s)*v,this},transpose:function(){var 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:function(e){return this.setFromMatrix4(e).getInverse(this).transpose()},transposeIntoArray:function(e){var 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:function(e,t,n,r,i,a,o){var s=Math.cos(i),c=Math.sin(i);this.set(n*s,n*c,-n*(s*a+c*o)+a+e,-r*c,r*s,-r*(-c*a+s*o)+o+t,0,0,1)},scale:function(e,t){var n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=t,n[4]*=t,n[7]*=t,this},rotate:function(e){var t=Math.cos(e),n=Math.sin(e),r=this.elements,i=r[0],a=r[3],o=r[6],s=r[1],c=r[4],l=r[7];return r[0]=t*i+n*s,r[3]=t*a+n*c,r[6]=t*o+n*l,r[1]=-n*i+t*s,r[4]=-n*a+t*c,r[7]=-n*o+t*l,this},translate:function(e,t){var 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:function(e){for(var t=this.elements,n=e.elements,r=0;r<9;r++)if(t[r]!==n[r])return!1;return!0},fromArray:function(e,t){void 0===t&&(t=0);for(var n=0;n<9;n++)this.elements[n]=e[n+t];return this},toArray:function(e,t){void 0===e&&(e=[]),void 0===t&&(t=0);var 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}});var A=0;function E(e,t,n,r,i,a,o,s,c,l){Object.defineProperty(this,"id",{value:A++}),this.uuid=m.generateUUID(),this.name="",this.image=void 0!==e?e:E.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=void 0!==t?t:E.DEFAULT_MAPPING,this.wrapS=void 0!==n?n:1001,this.wrapT=void 0!==r?r:1001,this.magFilter=void 0!==i?i:1006,this.minFilter=void 0!==a?a:1008,this.anisotropy=void 0!==c?c:1,this.format=void 0!==o?o:1023,this.type=void 0!==s?s:1009,this.offset=new g(0,0),this.repeat=new g(1,1),this.center=new g(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new w,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=void 0!==l?l:3e3,this.version=0,this.onUpdate=null}function x(e,t,n,r){this.x=e||0,this.y=t||0,this.z=n||0,this.w=void 0!==r?r:1}function _(e,t,n){this.uuid=m.generateUUID(),this.width=e,this.height=t,this.scissor=new x(0,0,e,t),this.scissorTest=!1,this.viewport=new x(0,0,e,t),void 0===(n=n||{}).minFilter&&(n.minFilter=1006),this.texture=new E(void 0,void 0,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.encoding),this.depthBuffer=void 0===n.depthBuffer||n.depthBuffer,this.stencilBuffer=void 0===n.stencilBuffer||n.stencilBuffer,this.depthTexture=void 0!==n.depthTexture?n.depthTexture:null}function S(e,t,n){_.call(this,e,t,n),this.activeCubeFace=0,this.activeMipMapLevel=0}function M(e,t,n,r,i,a,o,s,c,l,u,h){E.call(this,null,a,o,s,c,l,r,i,u,h),this.image={data:e,width:t,height:n},this.magFilter=void 0!==c?c:1003,this.minFilter=void 0!==l?l:1003,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}function T(e,t,n,r,i,a,o,s,c,l){e=void 0!==e?e:[],t=void 0!==t?t:301,E.call(this,e,t,n,r,i,a,o,s,c,l),this.flipY=!1}E.DEFAULT_IMAGE=void 0,E.DEFAULT_MAPPING=300,E.prototype=Object.assign(Object.create(a.prototype),{constructor:E,isTexture:!0,clone:function(){return(new this.constructor).copy(this)},copy:function(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.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:function(e){var t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.textures[this.uuid])return e.textures[this.uuid];var 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],minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY};if(void 0!==this.image){var r=this.image;void 0===r.uuid&&(r.uuid=m.generateUUID()),t||void 0!==e.images[r.uuid]||(e.images[r.uuid]={uuid:r.uuid,url:function(e){var t;if(e instanceof HTMLCanvasElement)t=e;else{(t=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")).width=e.width,t.height=e.height;var n=t.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height)}return t.width>2048||t.height>2048?t.toDataURL("image/jpeg",.6):t.toDataURL("image/png")}(r)}),n.image=r.uuid}return t||(e.textures[this.uuid]=n),n},dispose:function(){this.dispatchEvent({type:"dispose"})},transformUv:function(e){if(300===this.mapping){if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case 1e3:e.x=e.x-Math.floor(e.x);break;case 1001:e.x=e.x<0?0:1;break;case 1002:1===Math.abs(Math.floor(e.x)%2)?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x)}if(e.y<0||e.y>1)switch(this.wrapT){case 1e3:e.y=e.y-Math.floor(e.y);break;case 1001:e.y=e.y<0?0:1;break;case 1002:1===Math.abs(Math.floor(e.y)%2)?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y)}this.flipY&&(e.y=1-e.y)}}}),Object.defineProperty(E.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),Object.assign(x.prototype,{isVector4:!0,set:function(e,t,n,r){return this.x=e,this.y=t,this.z=n,this.w=r,this},setScalar:function(e){return this.x=e,this.y=e,this.z=e,this.w=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setZ:function(e){return this.z=e,this},setW:function(e){return this.w=e,this},setComponent:function(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:function(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:function(){return new this.constructor(this.x,this.y,this.z,this.w)},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this},add:function(e,t){return void 0!==t?(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:function(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this},addVectors:function(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:function(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:function(e,t){return void 0!==t?(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:function(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this},subVectors:function(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},multiplyScalar:function(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this},applyMatrix4:function(e){var t=this.x,n=this.y,r=this.z,i=this.w,a=e.elements;return this.x=a[0]*t+a[4]*n+a[8]*r+a[12]*i,this.y=a[1]*t+a[5]*n+a[9]*r+a[13]*i,this.z=a[2]*t+a[6]*n+a[10]*r+a[14]*i,this.w=a[3]*t+a[7]*n+a[11]*r+a[15]*i,this},divideScalar:function(e){return this.multiplyScalar(1/e)},setAxisAngleFromQuaternion:function(e){this.w=2*Math.acos(e.w);var 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:function(e){var t,n,r,i,a=e.elements,o=a[0],s=a[4],c=a[8],l=a[1],u=a[5],h=a[9],d=a[2],p=a[6],f=a[10];if(Math.abs(s-l)<.01&&Math.abs(c-d)<.01&&Math.abs(h-p)<.01){if(Math.abs(s+l)<.1&&Math.abs(c+d)<.1&&Math.abs(h+p)<.1&&Math.abs(o+u+f-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;var m=(o+1)/2,g=(u+1)/2,y=(f+1)/2,v=(s+l)/4,b=(c+d)/4,w=(h+p)/4;return m>g&&m>y?m<.01?(n=0,r=.707106781,i=.707106781):(r=v/(n=Math.sqrt(m)),i=b/n):g>y?g<.01?(n=.707106781,r=0,i=.707106781):(n=v/(r=Math.sqrt(g)),i=w/r):y<.01?(n=.707106781,r=.707106781,i=0):(n=b/(i=Math.sqrt(y)),r=w/i),this.set(n,r,i,t),this}var A=Math.sqrt((p-h)*(p-h)+(c-d)*(c-d)+(l-s)*(l-s));return Math.abs(A)<.001&&(A=1),this.x=(p-h)/A,this.y=(c-d)/A,this.z=(l-s)/A,this.w=Math.acos((o+u+f-1)/2),this},min:function(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.w=Math.min(this.w,e.w),this},max:function(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.w=Math.max(this.w,e.w),this},clamp:function(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.w=Math.max(e.w,Math.min(t.w,this.w)),this},clampScalar:function(){var e,t;return function(n,r){return void 0===e&&(e=new x,t=new x),e.set(n,n,n,n),t.set(r,r,r,r),this.clamp(e,t)}}(),clampLength:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this},roundToZero:function(){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.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},dot:function(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(e){return this.normalize().multiplyScalar(e)},lerp:function(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.w+=(e.w-this.w)*t,this},lerpVectors:function(e,t,n){return this.subVectors(t,e).multiplyScalar(n).add(e)},equals:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e},fromBufferAttribute:function(e,t,n){return void 0!==n&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}}),_.prototype=Object.assign(Object.create(a.prototype),{constructor:_,isWebGLRenderTarget:!0,setSize:function(e,t){this.width===e&&this.height===t||(this.width=e,this.height=t,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.width=e.width,this.height=e.height,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.depthTexture=e.depthTexture,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),S.prototype=Object.create(_.prototype),S.prototype.constructor=S,S.prototype.isWebGLRenderTargetCube=!0,M.prototype=Object.create(E.prototype),M.prototype.constructor=M,M.prototype.isDataTexture=!0,T.prototype=Object.create(E.prototype),T.prototype.constructor=T,T.prototype.isCubeTexture=!0,Object.defineProperty(T.prototype,"images",{get:function(){return this.image},set:function(e){this.image=e}});var R=new E,k=new T;function C(){this.seq=[],this.map={}}var O=[],P=[],I=new Float32Array(16),N=new Float32Array(9);function L(e,t,n){var r=e[0];if(r<=0||r>0)return e;var i=t*n,a=O[i];if(void 0===a&&(a=new Float32Array(i),O[i]=a),0!==t){r.toArray(a,0);for(var o=1,s=0;o!==t;++o)s+=n,e[o].toArray(a,s)}return a}function D(e,t){var n=P[t];void 0===n&&(n=new Int32Array(t),P[t]=n);for(var r=0;r!==t;++r)n[r]=e.allocTextureUnit();return n}function F(e,t){e.uniform1f(this.addr,t)}function j(e,t){e.uniform1i(this.addr,t)}function U(e,t){void 0===t.x?e.uniform2fv(this.addr,t):e.uniform2f(this.addr,t.x,t.y)}function B(e,t){void 0!==t.x?e.uniform3f(this.addr,t.x,t.y,t.z):void 0!==t.r?e.uniform3f(this.addr,t.r,t.g,t.b):e.uniform3fv(this.addr,t)}function V(e,t){void 0===t.x?e.uniform4fv(this.addr,t):e.uniform4f(this.addr,t.x,t.y,t.z,t.w)}function z(e,t){e.uniformMatrix2fv(this.addr,!1,t.elements||t)}function H(e,t){void 0===t.elements?e.uniformMatrix3fv(this.addr,!1,t):(N.set(t.elements),e.uniformMatrix3fv(this.addr,!1,N))}function G(e,t){void 0===t.elements?e.uniformMatrix4fv(this.addr,!1,t):(I.set(t.elements),e.uniformMatrix4fv(this.addr,!1,I))}function q(e,t,n){var r=n.allocTextureUnit();e.uniform1i(this.addr,r),n.setTexture2D(t||R,r)}function W(e,t,n){var r=n.allocTextureUnit();e.uniform1i(this.addr,r),n.setTextureCube(t||k,r)}function J(e,t){e.uniform2iv(this.addr,t)}function Z(e,t){e.uniform3iv(this.addr,t)}function X(e,t){e.uniform4iv(this.addr,t)}function Y(e,t){e.uniform1fv(this.addr,t)}function K(e,t){e.uniform1iv(this.addr,t)}function Q(e,t){e.uniform2fv(this.addr,L(t,this.size,2))}function $(e,t){e.uniform3fv(this.addr,L(t,this.size,3))}function ee(e,t){e.uniform4fv(this.addr,L(t,this.size,4))}function te(e,t){e.uniformMatrix2fv(this.addr,!1,L(t,this.size,4))}function ne(e,t){e.uniformMatrix3fv(this.addr,!1,L(t,this.size,9))}function re(e,t){e.uniformMatrix4fv(this.addr,!1,L(t,this.size,16))}function ie(e,t,n){var r=t.length,i=D(n,r);e.uniform1iv(this.addr,i);for(var a=0;a!==r;++a)n.setTexture2D(t[a]||R,i[a])}function ae(e,t,n){var r=t.length,i=D(n,r);e.uniform1iv(this.addr,i);for(var a=0;a!==r;++a)n.setTextureCube(t[a]||k,i[a])}function oe(e,t,n){this.id=e,this.addr=n,this.setValue=function(e){switch(e){case 5126:return F;case 35664:return U;case 35665:return B;case 35666:return V;case 35674:return z;case 35675:return H;case 35676:return G;case 35678:case 36198:return q;case 35680:return W;case 5124:case 35670:return j;case 35667:case 35671:return J;case 35668:case 35672:return Z;case 35669:case 35673:return X}}(t.type)}function se(e,t,n){this.id=e,this.addr=n,this.size=t.size,this.setValue=function(e){switch(e){case 5126:return Y;case 35664:return Q;case 35665:return $;case 35666:return ee;case 35674:return te;case 35675:return ne;case 35676:return re;case 35678:return ie;case 35680:return ae;case 5124:case 35670:return K;case 35667:case 35671:return J;case 35668:case 35672:return Z;case 35669:case 35673:return X}}(t.type)}function ce(e){this.id=e,C.call(this)}ce.prototype.setValue=function(e,t){for(var n=this.seq,r=0,i=n.length;r!==i;++r){var a=n[r];a.setValue(e,t[a.id])}};var le=/([\w\d_]+)(\])?(\[|\.)?/g;function ue(e,t){e.seq.push(t),e.map[t.id]=t}function he(e,t,n){var r=e.name,i=r.length;for(le.lastIndex=0;;){var a=le.exec(r),o=le.lastIndex,s=a[1],c="]"===a[2],l=a[3];if(c&&(s|=0),void 0===l||"["===l&&o+2===i){ue(n,void 0===l?new oe(s,e,t):new se(s,e,t));break}var u=n.map[s];void 0===u&&ue(n,u=new ce(s)),n=u}}function de(e,t,n){C.call(this),this.renderer=n;for(var r=e.getProgramParameter(t,e.ACTIVE_UNIFORMS),i=0;i<r;++i){var a=e.getActiveUniform(t,i),o=a.name;he(a,e.getUniformLocation(t,o),this)}}de.prototype.setValue=function(e,t,n){var r=this.map[t];void 0!==r&&r.setValue(e,n,this.renderer)},de.prototype.setOptional=function(e,t,n){var r=t[n];void 0!==r&&this.setValue(e,n,r)},de.upload=function(e,t,n,r){for(var i=0,a=t.length;i!==a;++i){var o=t[i],s=n[o.id];!1!==s.needsUpdate&&o.setValue(e,s.value,r)}},de.seqWithValue=function(e,t){for(var n=[],r=0,i=e.length;r!==i;++r){var a=e[r];a.id in t&&n.push(a)}return n};var pe={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};function fe(e,t,n){return void 0===t&&void 0===n?this.set(e):this.setRGB(e,t,n)}Object.assign(fe.prototype,{isColor:!0,r:1,g:1,b:1,set:function(e){return e&&e.isColor?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e),this},setScalar:function(e){return this.r=e,this.g=e,this.b=e,this},setHex:function(e){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,this},setRGB:function(e,t,n){return this.r=e,this.g=t,this.b=n,this},setHSL:function(){function e(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+6*(t-e)*(2/3-n):e}return function(t,n,r){if(t=m.euclideanModulo(t,1),n=m.clamp(n,0,1),r=m.clamp(r,0,1),0===n)this.r=this.g=this.b=r;else{var i=r<=.5?r*(1+n):r+n-r*n,a=2*r-i;this.r=e(a,i,t+1/3),this.g=e(a,i,t),this.b=e(a,i,t-1/3)}return this}}(),setStyle:function(e){function t(t){void 0!==t&&parseFloat(t)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}var n;if(n=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(e)){var r,i=n[1],a=n[2];switch(i){case"rgb":case"rgba":if(r=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))return this.r=Math.min(255,parseInt(r[1],10))/255,this.g=Math.min(255,parseInt(r[2],10))/255,this.b=Math.min(255,parseInt(r[3],10))/255,t(r[5]),this;if(r=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))return this.r=Math.min(100,parseInt(r[1],10))/100,this.g=Math.min(100,parseInt(r[2],10))/100,this.b=Math.min(100,parseInt(r[3],10))/100,t(r[5]),this;break;case"hsl":case"hsla":if(r=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a)){var o=parseFloat(r[1])/360,s=parseInt(r[2],10)/100,c=parseInt(r[3],10)/100;return t(r[5]),this.setHSL(o,s,c)}}}else if(n=/^\#([A-Fa-f0-9]+)$/.exec(e)){var l,u=(l=n[1]).length;if(3===u)return this.r=parseInt(l.charAt(0)+l.charAt(0),16)/255,this.g=parseInt(l.charAt(1)+l.charAt(1),16)/255,this.b=parseInt(l.charAt(2)+l.charAt(2),16)/255,this;if(6===u)return this.r=parseInt(l.charAt(0)+l.charAt(1),16)/255,this.g=parseInt(l.charAt(2)+l.charAt(3),16)/255,this.b=parseInt(l.charAt(4)+l.charAt(5),16)/255,this}e&&e.length>0&&(void 0!==(l=pe[e])?this.setHex(l):console.warn("THREE.Color: Unknown color "+e));return this},clone:function(){return new this.constructor(this.r,this.g,this.b)},copy:function(e){return this.r=e.r,this.g=e.g,this.b=e.b,this},copyGammaToLinear:function(e,t){return void 0===t&&(t=2),this.r=Math.pow(e.r,t),this.g=Math.pow(e.g,t),this.b=Math.pow(e.b,t),this},copyLinearToGamma:function(e,t){void 0===t&&(t=2);var 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:function(){var e=this.r,t=this.g,n=this.b;return this.r=e*e,this.g=t*t,this.b=n*n,this},convertLinearToGamma:function(){return this.r=Math.sqrt(this.r),this.g=Math.sqrt(this.g),this.b=Math.sqrt(this.b),this},getHex:function(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0},getHexString:function(){return("000000"+this.getHex().toString(16)).slice(-6)},getHSL:function(e){var t,n,r=e||{h:0,s:0,l:0},i=this.r,a=this.g,o=this.b,s=Math.max(i,a,o),c=Math.min(i,a,o),l=(c+s)/2;if(c===s)t=0,n=0;else{var u=s-c;switch(n=l<=.5?u/(s+c):u/(2-s-c),s){case i:t=(a-o)/u+(a<o?6:0);break;case a:t=(o-i)/u+2;break;case o:t=(i-a)/u+4}t/=6}return r.h=t,r.s=n,r.l=l,r},getStyle:function(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"},offsetHSL:function(e,t,n){var r=this.getHSL();return r.h+=e,r.s+=t,r.l+=n,this.setHSL(r.h,r.s,r.l),this},add:function(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this},addColors:function(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this},addScalar:function(e){return this.r+=e,this.g+=e,this.b+=e,this},sub:function(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this},multiply:function(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this},multiplyScalar:function(e){return this.r*=e,this.g*=e,this.b*=e,this},lerp:function(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this},equals:function(e){return e.r===this.r&&e.g===this.g&&e.b===this.b},fromArray:function(e,t){return void 0===t&&(t=0),this.r=e[t],this.g=e[t+1],this.b=e[t+2],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e},toJSON:function(){return this.getHex()}});var me={common:{diffuse:{value:new fe(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new w},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98}},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 g(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:[]},directionalLights:{value:[],properties:{direction:{},color:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}}},points:{diffuse:{value:new fe(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},uvTransform:{value:new w}}},ge={merge:function(e){for(var t={},n=0;n<e.length;n++){var r=this.clone(e[n]);for(var i in r)t[i]=r[i]}return t},clone:function(e){var t={};for(var n in e)for(var r in t[n]={},e[n]){var i=e[n][r];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture)?t[n][r]=i.clone():Array.isArray(i)?t[n][r]=i.slice():t[n][r]=i}return t}},ye={alphamap_fragment:"#ifdef USE_ALPHAMAP\r\n\r\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\r\n\r\n#endif\r\n",alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\r\n\r\n\tuniform sampler2D alphaMap;\r\n\r\n#endif\r\n",alphatest_fragment:"#ifdef ALPHATEST\r\n\r\n\tif ( diffuseColor.a < ALPHATEST ) discard;\r\n\r\n#endif\r\n",aomap_fragment:"#ifdef USE_AOMAP\r\n\r\n\t// reads channel R, compatible with a combined OcclusionRoughnessMetallic (RGB) texture\r\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\r\n\r\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\r\n\r\n\t#if defined( USE_ENVMAP ) && defined( PHYSICAL )\r\n\r\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\r\n\r\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\r\n\r\n\t#endif\r\n\r\n#endif\r\n",aomap_pars_fragment:"#ifdef USE_AOMAP\r\n\r\n\tuniform sampler2D aoMap;\r\n\tuniform float aoMapIntensity;\r\n\r\n#endif",begin_vertex:"\r\nvec3 transformed = vec3( position );\r\n",beginnormal_vertex:"\r\nvec3 objectNormal = vec3( normal );\r\n",bsdfs:'float punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\r\n\r\n\tif( decayExponent > 0.0 ) {\r\n\r\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\r\n\r\n\t\t// based upon Frostbite 3 Moving to Physically-based Rendering\r\n\t\t// page 32, equation 26: E[window1]\r\n\t\t// https://seblagarde.files.wordpress.com/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf\r\n\t\t// this is intended to be used on spot and point lights who are represented as luminous intensity\r\n\t\t// but who must be converted to luminous irradiance for surface lighting calculation\r\n\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\r\n\t\tfloat maxDistanceCutoffFactor = pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\r\n\t\treturn distanceFalloff * maxDistanceCutoffFactor;\r\n\r\n#else\r\n\r\n\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\r\n\r\n#endif\r\n\r\n\t}\r\n\r\n\treturn 1.0;\r\n\r\n}\r\n\r\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\r\n\r\n\treturn RECIPROCAL_PI * diffuseColor;\r\n\r\n} // validated\r\n\r\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\r\n\r\n\t// Original approximation by Christophe Schlick \'94\r\n\t// float fresnel = pow( 1.0 - dotLH, 5.0 );\r\n\r\n\t// Optimized variant (presented by Epic at SIGGRAPH \'13)\r\n\t// https://cdn2.unrealengine.com/Resources/files/2013SiggraphPresentationsNotes-26915738.pdf\r\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\r\n\r\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\r\n\r\n} // validated\r\n\r\n// Microfacet Models for Refraction through Rough Surfaces - equation (34)\r\n// http://graphicrants.blogspot.com/2013/08/specular-brdf-reference.html\r\n// alpha is "roughness squared" in Disney’s reparameterization\r\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\r\n\r\n\t// geometry term (normalized) = G(l)⋅G(v) / 4(n⋅l)(n⋅v)\r\n\t// also see #12151\r\n\r\n\tfloat a2 = pow2( alpha );\r\n\r\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\r\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\r\n\r\n\treturn 1.0 / ( gl * gv );\r\n\r\n} // validated\r\n\r\n// Moving Frostbite to Physically Based Rendering 3.0 - page 12, listing 2\r\n// https://seblagarde.files.wordpress.com/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf\r\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\r\n\r\n\tfloat a2 = pow2( alpha );\r\n\r\n\t// dotNL and dotNV are explicitly swapped. This is not a mistake.\r\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\r\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\r\n\r\n\treturn 0.5 / max( gv + gl, EPSILON );\r\n\r\n}\r\n\r\n// Microfacet Models for Refraction through Rough Surfaces - equation (33)\r\n// http://graphicrants.blogspot.com/2013/08/specular-brdf-reference.html\r\n// alpha is "roughness squared" in Disney’s reparameterization\r\nfloat D_GGX( const in float alpha, const in float dotNH ) {\r\n\r\n\tfloat a2 = pow2( alpha );\r\n\r\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; // avoid alpha = 0 with dotNH = 1\r\n\r\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\r\n\r\n}\r\n\r\n// GGX Distribution, Schlick Fresnel, GGX-Smith Visibility\r\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\r\n\r\n\tfloat alpha = pow2( roughness ); // UE4\'s roughness\r\n\r\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\r\n\r\n\tfloat dotNL = saturate( dot( geometry.normal, incidentLight.direction ) );\r\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\r\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\r\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\r\n\r\n\tvec3 F = F_Schlick( specularColor, dotLH );\r\n\r\n\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\r\n\r\n\tfloat D = D_GGX( alpha, dotNH );\r\n\r\n\treturn F * ( G * D );\r\n\r\n} // validated\r\n\r\n// Rect Area Light\r\n\r\n// Real-Time Polygonal-Light Shading with Linearly Transformed Cosines\r\n// by Eric Heitz, Jonathan Dupuy, Stephen Hill and David Neubelt\r\n// code: https://github.com/selfshadow/ltc_code/\r\n\r\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\r\n\r\n\tconst float LUT_SIZE = 64.0;\r\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\r\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\r\n\r\n\tfloat dotNV = saturate( dot( N, V ) );\r\n\r\n\t// texture parameterized by sqrt( GGX alpha ) and sqrt( 1 - cos( theta ) )\r\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\r\n\r\n\tuv = uv * LUT_SCALE + LUT_BIAS;\r\n\r\n\treturn uv;\r\n\r\n}\r\n\r\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\r\n\r\n\t// Real-Time Area Lighting: a Journey from Research to Production (p.102)\r\n\t// An approximation of the form factor of a horizon-clipped rectangle.\r\n\r\n\tfloat l = length( f );\r\n\r\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\r\n\r\n}\r\n\r\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\r\n\r\n\tfloat x = dot( v1, v2 );\r\n\r\n\tfloat y = abs( x );\r\n\r\n\t// rational polynomial approximation to theta / sin( theta ) / 2PI\r\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\r\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\r\n\tfloat v = a / b;\r\n\r\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\r\n\r\n\treturn cross( v1, v2 ) * theta_sintheta;\r\n\r\n}\r\n\r\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\r\n\r\n\t// bail if point is on back side of plane of light\r\n\t// assumes ccw winding order of light vertices\r\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\r\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\r\n\tvec3 lightNormal = cross( v1, v2 );\r\n\r\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\r\n\r\n\t// construct orthonormal basis around N\r\n\tvec3 T1, T2;\r\n\tT1 = normalize( V - N * dot( V, N ) );\r\n\tT2 = - cross( N, T1 ); // negated from paper; possibly due to a different handedness of world coordinate system\r\n\r\n\t// compute transform\r\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\r\n\r\n\t// transform rect\r\n\tvec3 coords[ 4 ];\r\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\r\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\r\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\r\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\r\n\r\n\t// project rect onto sphere\r\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\r\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\r\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\r\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\r\n\r\n\t// calculate vector form factor\r\n\tvec3 vectorFormFactor = vec3( 0.0 );\r\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\r\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\r\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\r\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\r\n\r\n\t// adjust for horizon clipping\r\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\r\n\r\n\r\n\r\n\treturn vec3( result );\r\n\r\n}\r\n\r\n// End Rect Area Light\r\n\r\n// ref: https://www.unrealengine.com/blog/physically-based-shading-on-mobile - environmentBRDF for GGX on mobile\r\nvec3 BRDF_Specular_GGX_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\r\n\r\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\r\n\r\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\r\n\r\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\r\n\r\n\tvec4 r = roughness * c0 + c1;\r\n\r\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\r\n\r\n\tvec2 AB = vec2( -1.04, 1.04 ) * a004 + r.zw;\r\n\r\n\treturn specularColor * AB.x + AB.y;\r\n\r\n} // validated\r\n\r\n\r\nfloat G_BlinnPhong_Implicit( ) {\r\n\r\n\t// geometry term is (n dot l)(n dot v) / 4(n dot l)(n dot v)\r\n\treturn 0.25;\r\n\r\n}\r\n\r\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\r\n\r\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\r\n\r\n}\r\n\r\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\r\n\r\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\r\n\r\n\t//float dotNL = saturate( dot( geometry.normal, incidentLight.direction ) );\r\n\t//float dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\r\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\r\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\r\n\r\n\tvec3 F = F_Schlick( specularColor, dotLH );\r\n\r\n\tfloat G = G_BlinnPhong_Implicit( );\r\n\r\n\tfloat D = D_BlinnPhong( shininess, dotNH );\r\n\r\n\treturn F * ( G * D );\r\n\r\n} // validated\r\n\r\n// source: http://simonstechblog.blogspot.ca/2011/12/microfacet-brdf.html\r\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\r\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\r\n}\r\n\r\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\r\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\r\n}\r\n',bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\r\n\r\n\tuniform sampler2D bumpMap;\r\n\tuniform float bumpScale;\r\n\r\n\t// Derivative maps - bump mapping unparametrized surfaces by Morten Mikkelsen\r\n\t// http://mmikkelsen3d.blogspot.sk/2011/07/derivative-maps.html\r\n\r\n\t// Evaluate the derivative of the height w.r.t. screen-space using forward differencing (listing 2)\r\n\r\n\tvec2 dHdxy_fwd() {\r\n\r\n\t\tvec2 dSTdx = dFdx( vUv );\r\n\t\tvec2 dSTdy = dFdy( vUv );\r\n\r\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\r\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\r\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\r\n\r\n\t\treturn vec2( dBx, dBy );\r\n\r\n\t}\r\n\r\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\r\n\r\n\t\t// Workaround for Adreno 3XX dFd*( vec3 ) bug. See #9988\r\n\r\n\t\tvec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\r\n\t\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\r\n\t\tvec3 vN = surf_norm;\t\t// normalized\r\n\r\n\t\tvec3 R1 = cross( vSigmaY, vN );\r\n\t\tvec3 R2 = cross( vN, vSigmaX );\r\n\r\n\t\tfloat fDet = dot( vSigmaX, R1 );\r\n\r\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\r\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\r\n\r\n\t}\r\n\r\n#endif\r\n",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\r\n\r\n\tvec4 plane;\r\n\r\n\t#pragma unroll_loop\r\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\r\n\r\n\t\tplane = clippingPlanes[ i ];\r\n\t\tif ( dot( vViewPosition, plane.xyz ) > plane.w ) discard;\r\n\r\n\t}\r\n\r\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\r\n\r\n\t\tbool clipped = true;\r\n\r\n\t\t#pragma unroll_loop\r\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\r\n\r\n\t\t\tplane = clippingPlanes[ i ];\r\n\t\t\tclipped = ( dot( vViewPosition, plane.xyz ) > plane.w ) && clipped;\r\n\r\n\t\t}\r\n\r\n\t\tif ( clipped ) discard;\r\n\r\n\t#endif\r\n\r\n#endif\r\n",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\r\n\r\n\t#if ! defined( PHYSICAL ) && ! defined( PHONG )\r\n\t\tvarying vec3 vViewPosition;\r\n\t#endif\r\n\r\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\r\n\r\n#endif\r\n",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG )\r\n\tvarying vec3 vViewPosition;\r\n#endif\r\n",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG )\r\n\tvViewPosition = - mvPosition.xyz;\r\n#endif\r\n\r\n",color_fragment:"#ifdef USE_COLOR\r\n\r\n\tdiffuseColor.rgb *= vColor;\r\n\r\n#endif",color_pars_fragment:"#ifdef USE_COLOR\r\n\r\n\tvarying vec3 vColor;\r\n\r\n#endif\r\n",color_pars_vertex:"#ifdef USE_COLOR\r\n\r\n\tvarying vec3 vColor;\r\n\r\n#endif",color_vertex:"#ifdef USE_COLOR\r\n\r\n\tvColor.xyz = color.xyz;\r\n\r\n#endif",common:"#define PI 3.14159265359\r\n#define PI2 6.28318530718\r\n#define PI_HALF 1.5707963267949\r\n#define RECIPROCAL_PI 0.31830988618\r\n#define RECIPROCAL_PI2 0.15915494\r\n#define LOG2 1.442695\r\n#define EPSILON 1e-6\r\n\r\n#define saturate(a) clamp( a, 0.0, 1.0 )\r\n#define whiteCompliment(a) ( 1.0 - saturate( a ) )\r\n\r\nfloat pow2( const in float x ) { return x*x; }\r\nfloat pow3( const in float x ) { return x*x*x; }\r\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\r\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\r\n// expects values in the range of [0,1]x[0,1], returns values in the [0,1] range.\r\n// do not collapse into a single function per: http://byteblacksmith.com/improvements-to-the-canonical-one-liner-glsl-rand-for-opengl-es-2-0/\r\nhighp float rand( const in vec2 uv ) {\r\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\r\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\r\n\treturn fract(sin(sn) * c);\r\n}\r\n\r\nstruct IncidentLight {\r\n\tvec3 color;\r\n\tvec3 direction;\r\n\tbool visible;\r\n};\r\n\r\nstruct ReflectedLight {\r\n\tvec3 directDiffuse;\r\n\tvec3 directSpecular;\r\n\tvec3 indirectDiffuse;\r\n\tvec3 indirectSpecular;\r\n};\r\n\r\nstruct GeometricContext {\r\n\tvec3 position;\r\n\tvec3 normal;\r\n\tvec3 viewDir;\r\n};\r\n\r\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\r\n\r\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\r\n\r\n}\r\n\r\n// http://en.wikibooks.org/wiki/GLSL_Programming/Applying_Matrix_Transformations\r\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\r\n\r\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\r\n\r\n}\r\n\r\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\r\n\r\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\r\n\r\n\treturn - distance * planeNormal + point;\r\n\r\n}\r\n\r\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\r\n\r\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\r\n\r\n}\r\n\r\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\r\n\r\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\r\n\r\n}\r\n\r\nmat3 transposeMat3( const in mat3 m ) {\r\n\r\n\tmat3 tmp;\r\n\r\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\r\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\r\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\r\n\r\n\treturn tmp;\r\n\r\n}\r\n\r\n// https://en.wikipedia.org/wiki/Relative_luminance\r\nfloat linearToRelativeLuminance( const in vec3 color ) {\r\n\r\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\r\n\r\n\treturn dot( weights, color.rgb );\r\n\r\n}\r\n",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\r\n\r\n#define cubeUV_textureSize (1024.0)\r\n\r\nint getFaceFromDirection(vec3 direction) {\r\n\tvec3 absDirection = abs(direction);\r\n\tint face = -1;\r\n\tif( absDirection.x > absDirection.z ) {\r\n\t\tif(absDirection.x > absDirection.y )\r\n\t\t\tface = direction.x > 0.0 ? 0 : 3;\r\n\t\telse\r\n\t\t\tface = direction.y > 0.0 ? 1 : 4;\r\n\t}\r\n\telse {\r\n\t\tif(absDirection.z > absDirection.y )\r\n\t\t\tface = direction.z > 0.0 ? 2 : 5;\r\n\t\telse\r\n\t\t\tface = direction.y > 0.0 ? 1 : 4;\r\n\t}\r\n\treturn face;\r\n}\r\n#define cubeUV_maxLods1 (log2(cubeUV_textureSize*0.25) - 1.0)\r\n#define cubeUV_rangeClamp (exp2((6.0 - 1.0) * 2.0))\r\n\r\nvec2 MipLevelInfo( vec3 vec, float roughnessLevel, float roughness ) {\r\n\tfloat scale = exp2(cubeUV_maxLods1 - roughnessLevel);\r\n\tfloat dxRoughness = dFdx(roughness);\r\n\tfloat dyRoughness = dFdy(roughness);\r\n\tvec3 dx = dFdx( vec * scale * dxRoughness );\r\n\tvec3 dy = dFdy( vec * scale * dyRoughness );\r\n\tfloat d = max( dot( dx, dx ), dot( dy, dy ) );\r\n\t// Clamp the value to the max mip level counts. hard coded to 6 mips\r\n\td = clamp(d, 1.0, cubeUV_rangeClamp);\r\n\tfloat mipLevel = 0.5 * log2(d);\r\n\treturn vec2(floor(mipLevel), fract(mipLevel));\r\n}\r\n\r\n#define cubeUV_maxLods2 (log2(cubeUV_textureSize*0.25) - 2.0)\r\n#define cubeUV_rcpTextureSize (1.0 / cubeUV_textureSize)\r\n\r\nvec2 getCubeUV(vec3 direction, float roughnessLevel, float mipLevel) {\r\n\tmipLevel = roughnessLevel > cubeUV_maxLods2 - 3.0 ? 0.0 : mipLevel;\r\n\tfloat a = 16.0 * cubeUV_rcpTextureSize;\r\n\r\n\tvec2 exp2_packed = exp2( vec2( roughnessLevel, mipLevel ) );\r\n\tvec2 rcp_exp2_packed = vec2( 1.0 ) / exp2_packed;\r\n\t// float powScale = exp2(roughnessLevel + mipLevel);\r\n\tfloat powScale = exp2_packed.x * exp2_packed.y;\r\n\t// float scale = 1.0 / exp2(roughnessLevel + 2.0 + mipLevel);\r\n\tfloat scale = rcp_exp2_packed.x * rcp_exp2_packed.y * 0.25;\r\n\t// float mipOffset = 0.75*(1.0 - 1.0/exp2(mipLevel))/exp2(roughnessLevel);\r\n\tfloat mipOffset = 0.75*(1.0 - rcp_exp2_packed.y) * rcp_exp2_packed.x;\r\n\r\n\tbool bRes = mipLevel == 0.0;\r\n\tscale = bRes && (scale < a) ? a : scale;\r\n\r\n\tvec3 r;\r\n\tvec2 offset;\r\n\tint face = getFaceFromDirection(direction);\r\n\r\n\tfloat rcpPowScale = 1.0 / powScale;\r\n\r\n\tif( face == 0) {\r\n\t\tr = vec3(direction.x, -direction.z, direction.y);\r\n\t\toffset = vec2(0.0+mipOffset,0.75 * rcpPowScale);\r\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\r\n\t}\r\n\telse if( face == 1) {\r\n\t\tr = vec3(direction.y, direction.x, direction.z);\r\n\t\toffset = vec2(scale+mipOffset, 0.75 * rcpPowScale);\r\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\r\n\t}\r\n\telse if( face == 2) {\r\n\t\tr = vec3(direction.z, direction.x, direction.y);\r\n\t\toffset = vec2(2.0*scale+mipOffset, 0.75 * rcpPowScale);\r\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\r\n\t}\r\n\telse if( face == 3) {\r\n\t\tr = vec3(direction.x, direction.z, direction.y);\r\n\t\toffset = vec2(0.0+mipOffset,0.5 * rcpPowScale);\r\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\r\n\t}\r\n\telse if( face == 4) {\r\n\t\tr = vec3(direction.y, direction.x, -direction.z);\r\n\t\toffset = vec2(scale+mipOffset, 0.5 * rcpPowScale);\r\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\r\n\t}\r\n\telse {\r\n\t\tr = vec3(direction.z, -direction.x, direction.y);\r\n\t\toffset = vec2(2.0*scale+mipOffset, 0.5 * rcpPowScale);\r\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\r\n\t}\r\n\tr = normalize(r);\r\n\tfloat texelOffset = 0.5 * cubeUV_rcpTextureSize;\r\n\tvec2 s = ( r.yz / abs( r.x ) + vec2( 1.0 ) ) * 0.5;\r\n\tvec2 base = offset + vec2( texelOffset );\r\n\treturn base + s * ( scale - 2.0 * texelOffset );\r\n}\r\n\r\n#define cubeUV_maxLods3 (log2(cubeUV_textureSize*0.25) - 3.0)\r\n\r\nvec4 textureCubeUV(vec3 reflectedDirection, float roughness ) {\r\n\tfloat roughnessVal = roughness* cubeUV_maxLods3;\r\n\tfloat r1 = floor(roughnessVal);\r\n\tfloat r2 = r1 + 1.0;\r\n\tfloat t = fract(roughnessVal);\r\n\tvec2 mipInfo = MipLevelInfo(reflectedDirection, r1, roughness);\r\n\tfloat s = mipInfo.y;\r\n\tfloat level0 = mipInfo.x;\r\n\tfloat level1 = level0 + 1.0;\r\n\tlevel1 = level1 > 5.0 ? 5.0 : level1;\r\n\r\n\t// round to nearest mipmap if we are not interpolating.\r\n\tlevel0 += min( floor( s + 0.5 ), 5.0 );\r\n\r\n\t// Tri linear interpolation.\r\n\tvec2 uv_10 = getCubeUV(reflectedDirection, r1, level0);\r\n\tvec4 color10 = envMapTexelToLinear(texture2D(envMap, uv_10));\r\n\r\n\tvec2 uv_20 = getCubeUV(reflectedDirection, r2, level0);\r\n\tvec4 color20 = envMapTexelToLinear(texture2D(envMap, uv_20));\r\n\r\n\tvec4 result = mix(color10, color20, t);\r\n\r\n\treturn vec4(result.rgb, 1.0);\r\n}\r\n\r\n#endif\r\n",defaultnormal_vertex:"vec3 transformedNormal = normalMatrix * objectNormal;\r\n\r\n#ifdef FLIP_SIDED\r\n\r\n\ttransformedNormal = - transformedNormal;\r\n\r\n#endif\r\n",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\r\n\r\n\tuniform sampler2D displacementMap;\r\n\tuniform float displacementScale;\r\n\tuniform float displacementBias;\r\n\r\n#endif\r\n",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\r\n\r\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\r\n\r\n#endif\r\n",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\r\n\r\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\r\n\r\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\r\n\r\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\r\n\r\n#endif\r\n",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\r\n\r\n\tuniform sampler2D emissiveMap;\r\n\r\n#endif\r\n",encodings_fragment:" gl_FragColor = linearToOutputTexel( gl_FragColor );\r\n",encodings_pars_fragment:"// For a discussion of what this is, please read this: http://lousodrome.net/blog/light/2013/05/26/gamma-correct-and-hdr-rendering-in-a-32-bits-buffer/\r\n\r\nvec4 LinearToLinear( in vec4 value ) {\r\n\treturn value;\r\n}\r\n\r\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\r\n\treturn vec4( pow( value.xyz, vec3( gammaFactor ) ), value.w );\r\n}\r\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\r\n\treturn vec4( pow( value.xyz, vec3( 1.0 / gammaFactor ) ), value.w );\r\n}\r\n\r\nvec4 sRGBToLinear( in vec4 value ) {\r\n\treturn 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 );\r\n}\r\nvec4 LinearTosRGB( in vec4 value ) {\r\n\treturn 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 );\r\n}\r\n\r\nvec4 RGBEToLinear( in vec4 value ) {\r\n\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\r\n}\r\nvec4 LinearToRGBE( in vec4 value ) {\r\n\tfloat maxComponent = max( max( value.r, value.g ), value.b );\r\n\tfloat fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\r\n\treturn vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\r\n// return vec4( value.brg, ( 3.0 + 128.0 ) / 256.0 );\r\n}\r\n\r\n// reference: http://iwasbeingirony.blogspot.ca/2010/06/difference-between-rgbm-and-rgbd.html\r\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\r\n\treturn vec4( value.xyz * value.w * maxRange, 1.0 );\r\n}\r\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\r\n\tfloat maxRGB = max( value.x, max( value.g, value.b ) );\r\n\tfloat M = clamp( maxRGB / maxRange, 0.0, 1.0 );\r\n\tM = ceil( M * 255.0 ) / 255.0;\r\n\treturn vec4( value.rgb / ( M * maxRange ), M );\r\n}\r\n\r\n// reference: http://iwasbeingirony.blogspot.ca/2010/06/difference-between-rgbm-and-rgbd.html\r\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\r\n\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\r\n}\r\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\r\n\tfloat maxRGB = max( value.x, max( value.g, value.b ) );\r\n\tfloat D = max( maxRange / maxRGB, 1.0 );\r\n\tD = min( floor( D ) / 255.0, 1.0 );\r\n\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\r\n}\r\n\r\n// LogLuv reference: http://graphicrants.blogspot.ca/2009/04/rgbm-color-encoding.html\r\n\r\n// M matrix, for encoding\r\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\r\nvec4 LinearToLogLuv( in vec4 value ) {\r\n\tvec3 Xp_Y_XYZp = value.rgb * cLogLuvM;\r\n\tXp_Y_XYZp = max(Xp_Y_XYZp, vec3(1e-6, 1e-6, 1e-6));\r\n\tvec4 vResult;\r\n\tvResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\r\n\tfloat Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\r\n\tvResult.w = fract(Le);\r\n\tvResult.z = (Le - (floor(vResult.w*255.0))/255.0)/255.0;\r\n\treturn vResult;\r\n}\r\n\r\n// Inverse M matrix, for decoding\r\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\r\nvec4 LogLuvToLinear( in vec4 value ) {\r\n\tfloat Le = value.z * 255.0 + value.w;\r\n\tvec3 Xp_Y_XYZp;\r\n\tXp_Y_XYZp.y = exp2((Le - 127.0) / 2.0);\r\n\tXp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\r\n\tXp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\r\n\tvec3 vRGB = Xp_Y_XYZp.rgb * cLogLuvInverseM;\r\n\treturn vec4( max(vRGB, 0.0), 1.0 );\r\n}\r\n",envmap_fragment:"#ifdef USE_ENVMAP\r\n\r\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\r\n\r\n\t\tvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\r\n\r\n\t\t// Transforming Normal Vectors with the Inverse Transformation\r\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\r\n\r\n\t\t#ifdef ENVMAP_MODE_REFLECTION\r\n\r\n\t\t\tvec3 reflectVec = reflect( cameraToVertex, worldNormal );\r\n\r\n\t\t#else\r\n\r\n\t\t\tvec3 reflectVec = refract( cameraToVertex, worldNormal, refractionRatio );\r\n\r\n\t\t#endif\r\n\r\n\t#else\r\n\r\n\t\tvec3 reflectVec = vReflect;\r\n\r\n\t#endif\r\n\r\n\t#ifdef ENVMAP_TYPE_CUBE\r\n\r\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\r\n\r\n\t#elif defined( ENVMAP_TYPE_EQUIREC )\r\n\r\n\t\tvec2 sampleUV;\r\n\r\n\t\treflectVec = normalize( reflectVec );\r\n\r\n\t\tsampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\r\n\r\n\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\r\n\r\n\t\tvec4 envColor = texture2D( envMap, sampleUV );\r\n\r\n\t#elif defined( ENVMAP_TYPE_SPHERE )\r\n\r\n\t\treflectVec = normalize( reflectVec );\r\n\r\n\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0, 0.0, 1.0 ) );\r\n\r\n\t\tvec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\r\n\r\n\t#else\r\n\r\n\t\tvec4 envColor = vec4( 0.0 );\r\n\r\n\t#endif\r\n\r\n\tenvColor = envMapTexelToLinear( envColor );\r\n\r\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\r\n\r\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\r\n\r\n\t#elif defined( ENVMAP_BLENDING_MIX )\r\n\r\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\r\n\r\n\t#elif defined( ENVMAP_BLENDING_ADD )\r\n\r\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\r\n\r\n\t#endif\r\n\r\n#endif\r\n",envmap_pars_fragment:"#if defined( USE_ENVMAP ) || defined( PHYSICAL )\r\n\tuniform float reflectivity;\r\n\tuniform float envMapIntensity;\r\n#endif\r\n\r\n#ifdef USE_ENVMAP\r\n\r\n\t#if ! defined( PHYSICAL ) && ( defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) )\r\n\t\tvarying vec3 vWorldPosition;\r\n\t#endif\r\n\r\n\t#ifdef ENVMAP_TYPE_CUBE\r\n\t\tuniform samplerCube envMap;\r\n\t#else\r\n\t\tuniform sampler2D envMap;\r\n\t#endif\r\n\tuniform float flipEnvMap;\r\n\r\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( PHYSICAL )\r\n\t\tuniform float refractionRatio;\r\n\t#else\r\n\t\tvarying vec3 vReflect;\r\n\t#endif\r\n\r\n#endif\r\n",envmap_pars_vertex:"#ifdef USE_ENVMAP\r\n\r\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\r\n\t\tvarying vec3 vWorldPosition;\r\n\r\n\t#else\r\n\r\n\t\tvarying vec3 vReflect;\r\n\t\tuniform float refractionRatio;\r\n\r\n\t#endif\r\n\r\n#endif\r\n",envmap_vertex:"#ifdef USE_ENVMAP\r\n\r\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\r\n\r\n\t\tvWorldPosition = worldPosition.xyz;\r\n\r\n\t#else\r\n\r\n\t\tvec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\r\n\r\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\r\n\r\n\t\t#ifdef ENVMAP_MODE_REFLECTION\r\n\r\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\r\n\r\n\t\t#else\r\n\r\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\r\n\r\n\t\t#endif\r\n\r\n\t#endif\r\n\r\n#endif\r\n",fog_vertex:"\r\n#ifdef USE_FOG\r\nfogDepth = -mvPosition.z;\r\n#endif",fog_pars_vertex:"#ifdef USE_FOG\r\n\r\n varying float fogDepth;\r\n\r\n#endif\r\n",fog_fragment:"#ifdef USE_FOG\r\n\r\n\t#ifdef FOG_EXP2\r\n\r\n\t\tfloat fogFactor = whiteCompliment( exp2( - fogDensity * fogDensity * fogDepth * fogDepth * LOG2 ) );\r\n\r\n\t#else\r\n\r\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, fogDepth );\r\n\r\n\t#endif\r\n\r\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\r\n\r\n#endif\r\n",fog_pars_fragment:"#ifdef USE_FOG\r\n\r\n\tuniform vec3 fogColor;\r\n\tvarying float fogDepth;\r\n\r\n\t#ifdef FOG_EXP2\r\n\r\n\t\tuniform float fogDensity;\r\n\r\n\t#else\r\n\r\n\t\tuniform float fogNear;\r\n\t\tuniform float fogFar;\r\n\r\n\t#endif\r\n\r\n#endif\r\n",gradientmap_pars_fragment:"#ifdef TOON\r\n\r\n\tuniform sampler2D gradientMap;\r\n\r\n\tvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\r\n\r\n\t\t// dotNL will be from -1.0 to 1.0\r\n\t\tfloat dotNL = dot( normal, lightDirection );\r\n\t\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\r\n\r\n\t\t#ifdef USE_GRADIENTMAP\r\n\r\n\t\t\treturn texture2D( gradientMap, coord ).rgb;\r\n\r\n\t\t#else\r\n\r\n\t\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\r\n\r\n\t\t#endif\r\n\r\n\r\n\t}\r\n\r\n#endif\r\n",lightmap_fragment:"#ifdef USE_LIGHTMAP\r\n\r\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity; // factor of PI should not be present; included here to prevent breakage\r\n\r\n#endif\r\n",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\r\n\r\n\tuniform sampler2D lightMap;\r\n\tuniform float lightMapIntensity;\r\n\r\n#endif",lights_lambert_vertex:"vec3 diffuse = vec3( 1.0 );\r\n\r\nGeometricContext geometry;\r\ngeometry.position = mvPosition.xyz;\r\ngeometry.normal = normalize( transformedNormal );\r\ngeometry.viewDir = normalize( -mvPosition.xyz );\r\n\r\nGeometricContext backGeometry;\r\nbackGeometry.position = geometry.position;\r\nbackGeometry.normal = -geometry.normal;\r\nbackGeometry.viewDir = geometry.viewDir;\r\n\r\nvLightFront = vec3( 0.0 );\r\n\r\n#ifdef DOUBLE_SIDED\r\n\tvLightBack = vec3( 0.0 );\r\n#endif\r\n\r\nIncidentLight directLight;\r\nfloat dotNL;\r\nvec3 directLightColor_Diffuse;\r\n\r\n#if NUM_POINT_LIGHTS > 0\r\n\r\n\t#pragma unroll_loop\r\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\r\n\r\n\t\tgetPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\r\n\r\n\t\tdotNL = dot( geometry.normal, directLight.direction );\r\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\r\n\r\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\r\n\r\n\t\t#ifdef DOUBLE_SIDED\r\n\r\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\r\n\r\n\t\t#endif\r\n\r\n\t}\r\n\r\n#endif\r\n\r\n#if NUM_SPOT_LIGHTS > 0\r\n\r\n\t#pragma unroll_loop\r\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\r\n\r\n\t\tgetSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\r\n\r\n\t\tdotNL = dot( geometry.normal, directLight.direction );\r\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\r\n\r\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\r\n\r\n\t\t#ifdef DOUBLE_SIDED\r\n\r\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\r\n\r\n\t\t#endif\r\n\t}\r\n\r\n#endif\r\n\r\n\r\n\r\n#if NUM_DIR_LIGHTS > 0\r\n\r\n\t#pragma unroll_loop\r\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\r\n\r\n\t\tgetDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\r\n\r\n\t\tdotNL = dot( geometry.normal, directLight.direction );\r\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\r\n\r\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\r\n\r\n\t\t#ifdef DOUBLE_SIDED\r\n\r\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\r\n\r\n\t\t#endif\r\n\r\n\t}\r\n\r\n#endif\r\n\r\n#if NUM_HEMI_LIGHTS > 0\r\n\r\n\t#pragma unroll_loop\r\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\r\n\r\n\t\tvLightFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\r\n\r\n\t\t#ifdef DOUBLE_SIDED\r\n\r\n\t\t\tvLightBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\r\n\r\n\t\t#endif\r\n\r\n\t}\r\n\r\n#endif\r\n",lights_pars:"uniform vec3 ambientLightColor;\r\n\r\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\r\n\r\n\tvec3 irradiance = ambientLightColor;\r\n\r\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\r\n\r\n\t\tirradiance *= PI;\r\n\r\n\t#endif\r\n\r\n\treturn irradiance;\r\n\r\n}\r\n\r\n#if NUM_DIR_LIGHTS > 0\r\n\r\n\tstruct DirectionalLight {\r\n\t\tvec3 direction;\r\n\t\tvec3 color;\r\n\r\n\t\tint shadow;\r\n\t\tfloat shadowBias;\r\n\t\tfloat shadowRadius;\r\n\t\tvec2 shadowMapSize;\r\n\t};\r\n\r\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\r\n\r\n\tvoid getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\r\n\r\n\t\tdirectLight.color = directionalLight.color;\r\n\t\tdirectLight.direction = directionalLight.direction;\r\n\t\tdirectLight.visible = true;\r\n\r\n\t}\r\n\r\n#endif\r\n\r\n\r\n#if NUM_POINT_LIGHTS > 0\r\n\r\n\tstruct PointLight {\r\n\t\tvec3 position;\r\n\t\tvec3 color;\r\n\t\tfloat distance;\r\n\t\tfloat decay;\r\n\r\n\t\tint shadow;\r\n\t\tfloat shadowBias;\r\n\t\tfloat shadowRadius;\r\n\t\tvec2 shadowMapSize;\r\n\t\tfloat shadowCameraNear;\r\n\t\tfloat shadowCameraFar;\r\n\t};\r\n\r\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\r\n\r\n\t// directLight is an out parameter as having it as a return value caused compiler errors on some devices\r\n\tvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\r\n\r\n\t\tvec3 lVector = pointLight.position - geometry.position;\r\n\t\tdirectLight.direction = normalize( lVector );\r\n\r\n\t\tfloat lightDistance = length( lVector );\r\n\r\n\t\tdirectLight.color = pointLight.color;\r\n\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\r\n\t\tdirectLight.visible = ( directLight.color != vec3( 0.0 ) );\r\n\r\n\t}\r\n\r\n#endif\r\n\r\n\r\n#if NUM_SPOT_LIGHTS > 0\r\n\r\n\tstruct SpotLight {\r\n\t\tvec3 position;\r\n\t\tvec3 direction;\r\n\t\tvec3 color;\r\n\t\tfloat distance;\r\n\t\tfloat decay;\r\n\t\tfloat coneCos;\r\n\t\tfloat penumbraCos;\r\n\r\n\t\tint shadow;\r\n\t\tfloat shadowBias;\r\n\t\tfloat shadowRadius;\r\n\t\tvec2 shadowMapSize;\r\n\t};\r\n\r\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\r\n\r\n\t// directLight is an out parameter as having it as a return value caused compiler errors on some devices\r\n\tvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) {\r\n\r\n\t\tvec3 lVector = spotLight.position - geometry.position;\r\n\t\tdirectLight.direction = normalize( lVector );\r\n\r\n\t\tfloat lightDistance = length( lVector );\r\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\r\n\r\n\t\tif ( angleCos > spotLight.coneCos ) {\r\n\r\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\r\n\r\n\t\t\tdirectLight.color = spotLight.color;\r\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\r\n\t\t\tdirectLight.visible = true;\r\n\r\n\t\t} else {\r\n\r\n\t\t\tdirectLight.color = vec3( 0.0 );\r\n\t\t\tdirectLight.visible = false;\r\n\r\n\t\t}\r\n\t}\r\n\r\n#endif\r\n\r\n\r\n#if NUM_RECT_AREA_LIGHTS > 0\r\n\r\n\tstruct RectAreaLight {\r\n\t\tvec3 color;\r\n\t\tvec3 position;\r\n\t\tvec3 halfWidth;\r\n\t\tvec3 halfHeight;\r\n\t};\r\n\r\n\t// Pre-computed values of LinearTransformedCosine approximation of BRDF\r\n\t// BRDF approximation Texture is 64x64\r\n\tuniform sampler2D ltc_1; // RGBA Float\r\n\tuniform sampler2D ltc_2; // RGBA Float\r\n\r\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\r\n\r\n#endif\r\n\r\n\r\n#if NUM_HEMI_LIGHTS > 0\r\n\r\n\tstruct HemisphereLight {\r\n\t\tvec3 direction;\r\n\t\tvec3 skyColor;\r\n\t\tvec3 groundColor;\r\n\t};\r\n\r\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\r\n\r\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\r\n\r\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\r\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\r\n\r\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\r\n\r\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\r\n\r\n\t\t\tirradiance *= PI;\r\n\r\n\t\t#endif\r\n\r\n\t\treturn irradiance;\r\n\r\n\t}\r\n\r\n#endif\r\n\r\n\r\n#if defined( USE_ENVMAP ) && defined( PHYSICAL )\r\n\r\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\r\n\r\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\r\n\r\n\t\t#ifdef ENVMAP_TYPE_CUBE\r\n\r\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\r\n\r\n\t\t\t// TODO: replace with properly filtered cubemaps and access the irradiance LOD level, be it the last LOD level\r\n\t\t\t// of a specular cubemap, or just the default level of a specially created irradiance cubemap.\r\n\r\n\t\t\t#ifdef TEXTURE_LOD_EXT\r\n\r\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\r\n\r\n\t\t\t#else\r\n\r\n\t\t\t\t// force the bias high to get the last LOD level as it is the most blurred.\r\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\r\n\r\n\t\t\t#endif\r\n\r\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\r\n\r\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\r\n\r\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\r\n\t\t\tvec4 envMapColor = textureCubeUV( queryVec, 1.0 );\r\n\r\n\t\t#else\r\n\r\n\t\t\tvec4 envMapColor = vec4( 0.0 );\r\n\r\n\t\t#endif\r\n\r\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\r\n\r\n\t}\r\n\r\n\t// taken from here: http://casual-effects.blogspot.ca/2011/08/plausible-environment-lighting-in-two.html\r\n\tfloat getSpecularMIPLevel( const in float blinnShininessExponent, const in int maxMIPLevel ) {\r\n\r\n\t\t//float envMapWidth = pow( 2.0, maxMIPLevelScalar );\r\n\t\t//float desiredMIPLevel = log2( envMapWidth * sqrt( 3.0 ) ) - 0.5 * log2( pow2( blinnShininessExponent ) + 1.0 );\r\n\r\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\r\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar + 0.79248 - 0.5 * log2( pow2( blinnShininessExponent ) + 1.0 );\r\n\r\n\t\t// clamp to allowable LOD ranges.\r\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\r\n\r\n\t}\r\n\r\n\tvec3 getLightProbeIndirectRadiance( const in GeometricContext geometry, const in float blinnShininessExponent, const in int maxMIPLevel ) {\r\n\r\n\t\t#ifdef ENVMAP_MODE_REFLECTION\r\n\r\n\t\t\tvec3 reflectVec = reflect( -geometry.viewDir, geometry.normal );\r\n\r\n\t\t#else\r\n\r\n\t\t\tvec3 reflectVec = refract( -geometry.viewDir, geometry.normal, refractionRatio );\r\n\r\n\t\t#endif\r\n\r\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\r\n\r\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( blinnShininessExponent, maxMIPLevel );\r\n\r\n\t\t#ifdef ENVMAP_TYPE_CUBE\r\n\r\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\r\n\r\n\t\t\t#ifdef TEXTURE_LOD_EXT\r\n\r\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\r\n\r\n\t\t\t#else\r\n\r\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\r\n\r\n\t\t\t#endif\r\n\r\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\r\n\r\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\r\n\r\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\r\n\t\t\tvec4 envMapColor = textureCubeUV(queryReflectVec, BlinnExponentToGGXRoughness(blinnShininessExponent));\r\n\r\n\t\t#elif defined( ENVMAP_TYPE_EQUIREC )\r\n\r\n\t\t\tvec2 sampleUV;\r\n\t\t\tsampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\r\n\t\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\r\n\r\n\t\t\t#ifdef TEXTURE_LOD_EXT\r\n\r\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, sampleUV, specularMIPLevel );\r\n\r\n\t\t\t#else\r\n\r\n\t\t\t\tvec4 envMapColor = texture2D( envMap, sampleUV, specularMIPLevel );\r\n\r\n\t\t\t#endif\r\n\r\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\r\n\r\n\t\t#elif defined( ENVMAP_TYPE_SPHERE )\r\n\r\n\t\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0,0.0,1.0 ) );\r\n\r\n\t\t\t#ifdef TEXTURE_LOD_EXT\r\n\r\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\r\n\r\n\t\t\t#else\r\n\r\n\t\t\t\tvec4 envMapColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\r\n\r\n\t\t\t#endif\r\n\r\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\r\n\r\n\t\t#endif\r\n\r\n\t\treturn envMapColor.rgb * envMapIntensity;\r\n\r\n\t}\r\n\r\n#endif\r\n",lights_phong_fragment:"BlinnPhongMaterial material;\r\nmaterial.diffuseColor = diffuseColor.rgb;\r\nmaterial.specularColor = specular;\r\nmaterial.specularShininess = shininess;\r\nmaterial.specularStrength = specularStrength;\r\n",lights_phong_pars_fragment:"varying vec3 vViewPosition;\r\n\r\n#ifndef FLAT_SHADED\r\n\r\n\tvarying vec3 vNormal;\r\n\r\n#endif\r\n\r\n\r\nstruct BlinnPhongMaterial {\r\n\r\n\tvec3\tdiffuseColor;\r\n\tvec3\tspecularColor;\r\n\tfloat\tspecularShininess;\r\n\tfloat\tspecularStrength;\r\n\r\n};\r\n\r\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\r\n\r\n\t#ifdef TOON\r\n\r\n\t\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\r\n\r\n\t#else\r\n\r\n\t\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\r\n\t\tvec3 irradiance = dotNL * directLight.color;\r\n\r\n\t#endif\r\n\r\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\r\n\r\n\t\tirradiance *= PI; // punctual light\r\n\r\n\t#endif\r\n\r\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\r\n\r\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\r\n\r\n}\r\n\r\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\r\n\r\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\r\n\r\n}\r\n\r\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\r\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\r\n\r\n#define Material_LightProbeLOD( material )\t(0)\r\n",lights_physical_fragment:"PhysicalMaterial material;\r\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\r\nmaterial.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 );\r\n#ifdef STANDARD\r\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\r\n#else\r\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\r\n\tmaterial.clearCoat = saturate( clearCoat ); // Burley clearcoat model\r\n\tmaterial.clearCoatRoughness = clamp( clearCoatRoughness, 0.04, 1.0 );\r\n#endif\r\n",lights_physical_pars_fragment:"struct PhysicalMaterial {\r\n\r\n\tvec3\tdiffuseColor;\r\n\tfloat\tspecularRoughness;\r\n\tvec3\tspecularColor;\r\n\r\n\t#ifndef STANDARD\r\n\t\tfloat clearCoat;\r\n\t\tfloat clearCoatRoughness;\r\n\t#endif\r\n\r\n};\r\n\r\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\r\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\r\n\r\n// Clear coat directional hemishperical reflectance (this approximation should be improved)\r\nfloat clearCoatDHRApprox( const in float roughness, const in float dotNL ) {\r\n\r\n\treturn DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\r\n\r\n}\r\n\r\n#if NUM_RECT_AREA_LIGHTS > 0\r\n\r\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\r\n\r\n\t\tvec3 normal = geometry.normal;\r\n\t\tvec3 viewDir = geometry.viewDir;\r\n\t\tvec3 position = geometry.position;\r\n\t\tvec3 lightPos = rectAreaLight.position;\r\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\r\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\r\n\t\tvec3 lightColor = rectAreaLight.color;\r\n\t\tfloat roughness = material.specularRoughness;\r\n\r\n\t\tvec3 rectCoords[ 4 ];\r\n\t\trectCoords[ 0 ] = lightPos - halfWidth - halfHeight; // counterclockwise\r\n\t\trectCoords[ 1 ] = lightPos + halfWidth - halfHeight;\r\n\t\trectCoords[ 2 ] = lightPos + halfWidth + halfHeight;\r\n\t\trectCoords[ 3 ] = lightPos - halfWidth + halfHeight;\r\n\r\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\r\n\r\n\t\tvec4 t1 = texture2D( ltc_1, uv );\r\n\t\tvec4 t2 = texture2D( ltc_2, uv );\r\n\r\n\t\tmat3 mInv = mat3(\r\n\t\t\tvec3( t1.x, 0, t1.y ),\r\n\t\t\tvec3( 0, 1, 0 ),\r\n\t\t\tvec3( t1.z, 0, t1.w )\r\n\t\t);\r\n\r\n\t\t// LTC Fresnel Approximation by Stephen Hill\r\n\t\t// http://blog.selfshadow.com/publications/s2016-advances/s2016_ltc_fresnel.pdf\r\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\r\n\r\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\r\n\r\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\r\n\r\n\t}\r\n\r\n#endif\r\n\r\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\r\n\r\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\r\n\r\n\tvec3 irradiance = dotNL * directLight.color;\r\n\r\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\r\n\r\n\t\tirradiance *= PI; // punctual light\r\n\r\n\t#endif\r\n\r\n\t#ifndef STANDARD\r\n\t\tfloat clearCoatDHR = material.clearCoat * clearCoatDHRApprox( material.clearCoatRoughness, dotNL );\r\n\t#else\r\n\t\tfloat clearCoatDHR = 0.0;\r\n\t#endif\r\n\r\n\treflectedLight.directSpecular += ( 1.0 - clearCoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry, material.specularColor, material.specularRoughness );\r\n\r\n\treflectedLight.directDiffuse += ( 1.0 - clearCoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\r\n\r\n\t#ifndef STANDARD\r\n\r\n\t\treflectedLight.directSpecular += irradiance * material.clearCoat * BRDF_Specular_GGX( directLight, geometry, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );\r\n\r\n\t#endif\r\n\r\n}\r\n\r\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\r\n\r\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\r\n\r\n}\r\n\r\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 clearCoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\r\n\r\n\t#ifndef STANDARD\r\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\r\n\t\tfloat dotNL = dotNV;\r\n\t\tfloat clearCoatDHR = material.clearCoat * clearCoatDHRApprox( material.clearCoatRoughness, dotNL );\r\n\t#else\r\n\t\tfloat clearCoatDHR = 0.0;\r\n\t#endif\r\n\r\n\treflectedLight.indirectSpecular += ( 1.0 - clearCoatDHR ) * radiance * BRDF_Specular_GGX_Environment( geometry, material.specularColor, material.specularRoughness );\r\n\r\n\t#ifndef STANDARD\r\n\r\n\t\treflectedLight.indirectSpecular += clearCoatRadiance * material.clearCoat * BRDF_Specular_GGX_Environment( geometry, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );\r\n\r\n\t#endif\r\n\r\n}\r\n\r\n#define RE_Direct\t\t\t\tRE_Direct_Physical\r\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\r\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\r\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\r\n\r\n#define Material_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.specularRoughness )\r\n#define Material_ClearCoat_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.clearCoatRoughness )\r\n\r\n// ref: https://seblagarde.files.wordpress.com/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf\r\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\r\n\r\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\r\n\r\n}\r\n",lights_template:"\r\n\r\nGeometricContext geometry;\r\n\r\ngeometry.position = - vViewPosition;\r\ngeometry.normal = normal;\r\ngeometry.viewDir = normalize( vViewPosition );\r\n\r\nIncidentLight directLight;\r\n\r\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\r\n\r\n\tPointLight pointLight;\r\n\r\n\t#pragma unroll_loop\r\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\r\n\r\n\t\tpointLight = pointLights[ i ];\r\n\r\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\r\n\r\n\t\t#ifdef USE_SHADOWMAP\r\n\t\tdirectLight.color *= all( bvec2( pointLight.shadow, directLight.visible ) ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\r\n\t\t#endif\r\n\r\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\r\n\r\n\t}\r\n\r\n#endif\r\n\r\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\r\n\r\n\tSpotLight spotLight;\r\n\r\n\t#pragma unroll_loop\r\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\r\n\r\n\t\tspotLight = spotLights[ i ];\r\n\r\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\r\n\r\n\t\t#ifdef USE_SHADOWMAP\r\n\t\tdirectLight.color *= all( bvec2( spotLight.shadow, directLight.visible ) ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\r\n\t\t#endif\r\n\r\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\r\n\r\n\t}\r\n\r\n#endif\r\n\r\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\r\n\r\n\tDirectionalLight directionalLight;\r\n\r\n\t#pragma unroll_loop\r\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\r\n\r\n\t\tdirectionalLight = directionalLights[ i ];\r\n\r\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\r\n\r\n\t\t#ifdef USE_SHADOWMAP\r\n\t\tdirectLight.color *= all( bvec2( directionalLight.shadow, directLight.visible ) ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\r\n\t\t#endif\r\n\r\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\r\n\r\n\t}\r\n\r\n#endif\r\n\r\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\r\n\r\n\tRectAreaLight rectAreaLight;\r\n\r\n\t#pragma unroll_loop\r\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\r\n\r\n\t\trectAreaLight = rectAreaLights[ i ];\r\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\r\n\r\n\t}\r\n\r\n#endif\r\n\r\n#if defined( RE_IndirectDiffuse )\r\n\r\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\r\n\r\n\t#ifdef USE_LIGHTMAP\r\n\r\n\t\tvec3 lightMapIrradiance = texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\r\n\r\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\r\n\r\n\t\t\tlightMapIrradiance *= PI; // factor of PI should not be present; included here to prevent breakage\r\n\r\n\t\t#endif\r\n\r\n\t\tirradiance += lightMapIrradiance;\r\n\r\n\t#endif\r\n\r\n\t#if ( NUM_HEMI_LIGHTS > 0 )\r\n\r\n\t\t#pragma unroll_loop\r\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\r\n\r\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\r\n\r\n\t\t}\r\n\r\n\t#endif\r\n\r\n\t#if defined( USE_ENVMAP ) && defined( PHYSICAL ) && defined( ENVMAP_TYPE_CUBE_UV )\r\n\r\n\t\t// TODO, replace 8 with the real maxMIPLevel\r\n\t\tirradiance += getLightProbeIndirectIrradiance( geometry, 8 );\r\n\r\n\t#endif\r\n\r\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\r\n\r\n#endif\r\n\r\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\r\n\r\n\t// TODO, replace 8 with the real maxMIPLevel\r\n\tvec3 radiance = getLightProbeIndirectRadiance( geometry, Material_BlinnShininessExponent( material ), 8 );\r\n\r\n\t#ifndef STANDARD\r\n\t\tvec3 clearCoatRadiance = getLightProbeIndirectRadiance( geometry, Material_ClearCoat_BlinnShininessExponent( material ), 8 );\r\n\t#else\r\n\t\tvec3 clearCoatRadiance = vec3( 0.0 );\r\n\t#endif\r\n\r\n\tRE_IndirectSpecular( radiance, clearCoatRadiance, geometry, material, reflectedLight );\r\n\r\n#endif\r\n",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\r\n\r\n\tgl_FragDepthEXT = log2( vFragDepth ) * logDepthBufFC * 0.5;\r\n\r\n#endif",logdepthbuf_pars_fragment:"#ifdef USE_LOGDEPTHBUF\r\n\r\n\tuniform float logDepthBufFC;\r\n\r\n\t#ifdef USE_LOGDEPTHBUF_EXT\r\n\r\n\t\tvarying float vFragDepth;\r\n\r\n\t#endif\r\n\r\n#endif\r\n",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\r\n\r\n\t#ifdef USE_LOGDEPTHBUF_EXT\r\n\r\n\t\tvarying float vFragDepth;\r\n\r\n\t#endif\r\n\r\n\tuniform float logDepthBufFC;\r\n\r\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\r\n\r\n\t#ifdef USE_LOGDEPTHBUF_EXT\r\n\r\n\t\tvFragDepth = 1.0 + gl_Position.w;\r\n\r\n\t#else\r\n\r\n\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\r\n\r\n\t\tgl_Position.z *= gl_Position.w;\r\n\r\n\t#endif\r\n\r\n#endif\r\n",map_fragment:"#ifdef USE_MAP\r\n\r\n\tvec4 texelColor = texture2D( map, vUv );\r\n\r\n\ttexelColor = mapTexelToLinear( texelColor );\r\n\tdiffuseColor *= texelColor;\r\n\r\n#endif\r\n",map_pars_fragment:"#ifdef USE_MAP\r\n\r\n\tuniform sampler2D map;\r\n\r\n#endif\r\n",map_particle_fragment:"#ifdef USE_MAP\r\n\r\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\r\n\tvec4 mapTexel = texture2D( map, uv );\r\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\r\n\r\n#endif\r\n",map_particle_pars_fragment:"#ifdef USE_MAP\r\n\r\n\tuniform mat3 uvTransform;\r\n\tuniform sampler2D map;\r\n\r\n#endif\r\n",metalnessmap_fragment:"float metalnessFactor = metalness;\r\n\r\n#ifdef USE_METALNESSMAP\r\n\r\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\r\n\r\n\t// reads channel B, compatible with a combined OcclusionRoughnessMetallic (RGB) texture\r\n\tmetalnessFactor *= texelMetalness.b;\r\n\r\n#endif\r\n",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\r\n\r\n\tuniform sampler2D metalnessMap;\r\n\r\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\r\n\r\n\tobjectNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];\r\n\tobjectNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ];\r\n\tobjectNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ];\r\n\tobjectNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ];\r\n\r\n#endif\r\n",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\r\n\r\n\t#ifndef USE_MORPHNORMALS\r\n\r\n\tuniform float morphTargetInfluences[ 8 ];\r\n\r\n\t#else\r\n\r\n\tuniform float morphTargetInfluences[ 4 ];\r\n\r\n\t#endif\r\n\r\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\r\n\r\n\ttransformed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];\r\n\ttransformed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];\r\n\ttransformed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];\r\n\ttransformed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];\r\n\r\n\t#ifndef USE_MORPHNORMALS\r\n\r\n\ttransformed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];\r\n\ttransformed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];\r\n\ttransformed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];\r\n\ttransformed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];\r\n\r\n\t#endif\r\n\r\n#endif\r\n",normal_fragment:"#ifdef FLAT_SHADED\r\n\r\n\t// Workaround for Adreno/Nexus5 not able able to do dFdx( vViewPosition ) ...\r\n\r\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\r\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\r\n\tvec3 normal = normalize( cross( fdx, fdy ) );\r\n\r\n#else\r\n\r\n\tvec3 normal = normalize( vNormal );\r\n\r\n\t#ifdef DOUBLE_SIDED\r\n\r\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\r\n\r\n\t#endif\r\n\r\n#endif\r\n\r\n#ifdef USE_NORMALMAP\r\n\r\n\tnormal = perturbNormal2Arb( -vViewPosition, normal );\r\n\r\n#elif defined( USE_BUMPMAP )\r\n\r\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\r\n\r\n#endif\r\n",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\r\n\r\n\tuniform sampler2D normalMap;\r\n\tuniform vec2 normalScale;\r\n\r\n\t// Per-Pixel Tangent Space Normal Mapping\r\n\t// http://hacksoflife.blogspot.ch/2009/11/per-pixel-tangent-space-normal-mapping.html\r\n\r\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {\r\n\r\n\t\t// Workaround for Adreno 3XX dFd*( vec3 ) bug. See #9988\r\n\r\n\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\r\n\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\r\n\t\tvec2 st0 = dFdx( vUv.st );\r\n\t\tvec2 st1 = dFdy( vUv.st );\r\n\r\n\t\tvec3 S = normalize( q0 * st1.t - q1 * st0.t );\r\n\t\tvec3 T = normalize( -q0 * st1.s + q1 * st0.s );\r\n\t\tvec3 N = normalize( surf_norm );\r\n\r\n\t\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\r\n\t\tmapN.xy = normalScale * mapN.xy;\r\n\t\tmat3 tsn = mat3( S, T, N );\r\n\t\treturn normalize( tsn * mapN );\r\n\r\n\t}\r\n\r\n#endif\r\n",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\r\n\treturn normalize( normal ) * 0.5 + 0.5;\r\n}\r\n\r\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\r\n\treturn 2.0 * rgb.xyz - 1.0;\r\n}\r\n\r\nconst float PackUpscale = 256. / 255.; // fraction -> 0..1 (including 1)\r\nconst float UnpackDownscale = 255. / 256.; // 0..1 -> fraction (excluding 1)\r\n\r\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\r\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\r\n\r\nconst float ShiftRight8 = 1. / 256.;\r\n\r\nvec4 packDepthToRGBA( const in float v ) {\r\n\tvec4 r = vec4( fract( v * PackFactors ), v );\r\n\tr.yzw -= r.xyz * ShiftRight8; // tidy overflow\r\n\treturn r * PackUpscale;\r\n}\r\n\r\nfloat unpackRGBAToDepth( const in vec4 v ) {\r\n\treturn dot( v, UnpackFactors );\r\n}\r\n\r\n// NOTE: viewZ/eyeZ is < 0 when in front of the camera per OpenGL conventions\r\n\r\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\r\n\treturn ( viewZ + near ) / ( near - far );\r\n}\r\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\r\n\treturn linearClipZ * ( near - far ) - near;\r\n}\r\n\r\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\r\n\treturn (( near + viewZ ) * far ) / (( far - near ) * viewZ );\r\n}\r\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\r\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\r\n}\r\n",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\r\n\r\n\t// Get get normal blending with premultipled, use with CustomBlending, OneFactor, OneMinusSrcAlphaFactor, AddEquation.\r\n\tgl_FragColor.rgb *= gl_FragColor.a;\r\n\r\n#endif\r\n",project_vertex:"vec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );\r\n\r\ngl_Position = projectionMatrix * mvPosition;\r\n",dithering_fragment:"#if defined( DITHERING )\r\n\r\n gl_FragColor.rgb = dithering( gl_FragColor.rgb );\r\n\r\n#endif\r\n",dithering_pars_fragment:"#if defined( DITHERING )\r\n\r\n\t// based on https://www.shadertoy.com/view/MslGR8\r\n\tvec3 dithering( vec3 color ) {\r\n\t\t//Calculate grid position\r\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\r\n\r\n\t\t//Shift the individual colors differently, thus making it even harder to see the dithering pattern\r\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\r\n\r\n\t\t//modify shift acording to grid position.\r\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\r\n\r\n\t\t//shift the color by dither_shift\r\n\t\treturn color + dither_shift_RGB;\r\n\t}\r\n\r\n#endif\r\n",roughnessmap_fragment:"float roughnessFactor = roughness;\r\n\r\n#ifdef USE_ROUGHNESSMAP\r\n\r\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\r\n\r\n\t// reads channel G, compatible with a combined OcclusionRoughnessMetallic (RGB) texture\r\n\troughnessFactor *= texelRoughness.g;\r\n\r\n#endif\r\n",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\r\n\r\n\tuniform sampler2D roughnessMap;\r\n\r\n#endif",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\r\n\r\n\t#if NUM_DIR_LIGHTS > 0\r\n\r\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHTS ];\r\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\r\n\r\n\t#endif\r\n\r\n\t#if NUM_SPOT_LIGHTS > 0\r\n\r\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHTS ];\r\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\r\n\r\n\t#endif\r\n\r\n\t#if NUM_POINT_LIGHTS > 0\r\n\r\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHTS ];\r\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\r\n\r\n\t#endif\r\n\r\n\r\n\r\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\r\n\r\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\r\n\r\n\t}\r\n\r\n\tfloat texture2DShadowLerp( sampler2D depths, vec2 size, vec2 uv, float compare ) {\r\n\r\n\t\tconst vec2 offset = vec2( 0.0, 1.0 );\r\n\r\n\t\tvec2 texelSize = vec2( 1.0 ) / size;\r\n\t\tvec2 centroidUV = floor( uv * size + 0.5 ) / size;\r\n\r\n\t\tfloat lb = texture2DCompare( depths, centroidUV + texelSize * offset.xx, compare );\r\n\t\tfloat lt = texture2DCompare( depths, centroidUV + texelSize * offset.xy, compare );\r\n\t\tfloat rb = texture2DCompare( depths, centroidUV + texelSize * offset.yx, compare );\r\n\t\tfloat rt = texture2DCompare( depths, centroidUV + texelSize * offset.yy, compare );\r\n\r\n\t\tvec2 f = fract( uv * size + 0.5 );\r\n\r\n\t\tfloat a = mix( lb, lt, f.y );\r\n\t\tfloat b = mix( rb, rt, f.y );\r\n\t\tfloat c = mix( a, b, f.x );\r\n\r\n\t\treturn c;\r\n\r\n\t}\r\n\r\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\r\n\r\n\t\tfloat shadow = 1.0;\r\n\r\n\t\tshadowCoord.xyz /= shadowCoord.w;\r\n\t\tshadowCoord.z += shadowBias;\r\n\r\n\t\t// if ( something && something ) breaks ATI OpenGL shader compiler\r\n\t\t// if ( all( something, something ) ) using this instead\r\n\r\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\r\n\t\tbool inFrustum = all( inFrustumVec );\r\n\r\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\r\n\r\n\t\tbool frustumTest = all( frustumTestVec );\r\n\r\n\t\tif ( frustumTest ) {\r\n\r\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\r\n\r\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\r\n\r\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\r\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\r\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\r\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\r\n\r\n\t\t\tshadow = (\r\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\r\n\t\t\t) * ( 1.0 / 9.0 );\r\n\r\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\r\n\r\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\r\n\r\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\r\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\r\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\r\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\r\n\r\n\t\t\tshadow = (\r\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\r\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\r\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\r\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\r\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy, shadowCoord.z ) +\r\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\r\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\r\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\r\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\r\n\t\t\t) * ( 1.0 / 9.0 );\r\n\r\n\t\t#else // no percentage-closer filtering:\r\n\r\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\r\n\r\n\t\t#endif\r\n\r\n\t\t}\r\n\r\n\t\treturn shadow;\r\n\r\n\t}\r\n\r\n\t// cubeToUV() maps a 3D direction vector suitable for cube texture mapping to a 2D\r\n\t// vector suitable for 2D texture mapping. This code uses the following layout for the\r\n\t// 2D texture:\r\n\t//\r\n\t// xzXZ\r\n\t// y Y\r\n\t//\r\n\t// Y - Positive y direction\r\n\t// y - Negative y direction\r\n\t// X - Positive x direction\r\n\t// x - Negative x direction\r\n\t// Z - Positive z direction\r\n\t// z - Negative z direction\r\n\t//\r\n\t// Source and test bed:\r\n\t// https://gist.github.com/tschw/da10c43c467ce8afd0c4\r\n\r\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\r\n\r\n\t\t// Number of texels to avoid at the edge of each square\r\n\r\n\t\tvec3 absV = abs( v );\r\n\r\n\t\t// Intersect unit cube\r\n\r\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\r\n\t\tabsV *= scaleToCube;\r\n\r\n\t\t// Apply scale to avoid seams\r\n\r\n\t\t// two texels less per square (one texel will do for NEAREST)\r\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\r\n\r\n\t\t// Unwrap\r\n\r\n\t\t// space: -1 ... 1 range for each square\r\n\t\t//\r\n\t\t// #X##\t\tdim := ( 4 , 2 )\r\n\t\t// # #\t\tcenter := ( 1 , 1 )\r\n\r\n\t\tvec2 planar = v.xy;\r\n\r\n\t\tfloat almostATexel = 1.5 * texelSizeY;\r\n\t\tfloat almostOne = 1.0 - almostATexel;\r\n\r\n\t\tif ( absV.z >= almostOne ) {\r\n\r\n\t\t\tif ( v.z > 0.0 )\r\n\t\t\t\tplanar.x = 4.0 - v.x;\r\n\r\n\t\t} else if ( absV.x >= almostOne ) {\r\n\r\n\t\t\tfloat signX = sign( v.x );\r\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\r\n\r\n\t\t} else if ( absV.y >= almostOne ) {\r\n\r\n\t\t\tfloat signY = sign( v.y );\r\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\r\n\t\t\tplanar.y = v.z * signY - 2.0;\r\n\r\n\t\t}\r\n\r\n\t\t// Transform to UV space\r\n\r\n\t\t// scale := 0.5 / dim\r\n\t\t// translate := ( center + 0.5 ) / dim\r\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\r\n\r\n\t}\r\n\r\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\r\n\r\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\r\n\r\n\t\t// for point lights, the uniform @vShadowCoord is re-purposed to hold\r\n\t\t// the vector from the light to the world-space position of the fragment.\r\n\t\tvec3 lightToPosition = shadowCoord.xyz;\r\n\r\n\t\t// dp = normalized distance from light to fragment position\r\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); // need to clamp?\r\n\t\tdp += shadowBias;\r\n\r\n\t\t// bd3D = base direction 3D\r\n\t\tvec3 bd3D = normalize( lightToPosition );\r\n\r\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT )\r\n\r\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\r\n\r\n\t\t\treturn (\r\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\r\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\r\n\t\t\t) * ( 1.0 / 9.0 );\r\n\r\n\t\t#else // no percentage-closer filtering\r\n\r\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\r\n\r\n\t\t#endif\r\n\r\n\t}\r\n\r\n#endif\r\n",shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\r\n\r\n\t#if NUM_DIR_LIGHTS > 0\r\n\r\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHTS ];\r\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\r\n\r\n\t#endif\r\n\r\n\t#if NUM_SPOT_LIGHTS > 0\r\n\r\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHTS ];\r\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\r\n\r\n\t#endif\r\n\r\n\t#if NUM_POINT_LIGHTS > 0\r\n\r\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHTS ];\r\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\r\n\r\n\t#endif\r\n\r\n\r\n\r\n#endif\r\n",shadowmap_vertex:"#ifdef USE_SHADOWMAP\r\n\r\n\t#if NUM_DIR_LIGHTS > 0\r\n\r\n\t#pragma unroll_loop\r\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\r\n\r\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;\r\n\r\n\t}\r\n\r\n\t#endif\r\n\r\n\t#if NUM_SPOT_LIGHTS > 0\r\n\r\n\t#pragma unroll_loop\r\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\r\n\r\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;\r\n\r\n\t}\r\n\r\n\t#endif\r\n\r\n\t#if NUM_POINT_LIGHTS > 0\r\n\r\n\t#pragma unroll_loop\r\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\r\n\r\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\r\n\r\n\t}\r\n\r\n\t#endif\r\n\r\n\r\n\r\n#endif\r\n",shadowmask_pars_fragment:"float getShadowMask() {\r\n\r\n\tfloat shadow = 1.0;\r\n\r\n\t#ifdef USE_SHADOWMAP\r\n\r\n\t#if NUM_DIR_LIGHTS > 0\r\n\r\n\tDirectionalLight directionalLight;\r\n\r\n\t#pragma unroll_loop\r\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\r\n\r\n\t\tdirectionalLight = directionalLights[ i ];\r\n\t\tshadow *= bool( directionalLight.shadow ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\r\n\r\n\t}\r\n\r\n\t#endif\r\n\r\n\t#if NUM_SPOT_LIGHTS > 0\r\n\r\n\tSpotLight spotLight;\r\n\r\n\t#pragma unroll_loop\r\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\r\n\r\n\t\tspotLight = spotLights[ i ];\r\n\t\tshadow *= bool( spotLight.shadow ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\r\n\r\n\t}\r\n\r\n\t#endif\r\n\r\n\t#if NUM_POINT_LIGHTS > 0\r\n\r\n\tPointLight pointLight;\r\n\r\n\t#pragma unroll_loop\r\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\r\n\r\n\t\tpointLight = pointLights[ i ];\r\n\t\tshadow *= bool( pointLight.shadow ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\r\n\r\n\t}\r\n\r\n\t#endif\r\n\r\n\r\n\r\n\t#endif\r\n\r\n\treturn shadow;\r\n\r\n}\r\n",skinbase_vertex:"#ifdef USE_SKINNING\r\n\r\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\r\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\r\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\r\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\r\n\r\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\r\n\r\n\tuniform mat4 bindMatrix;\r\n\tuniform mat4 bindMatrixInverse;\r\n\r\n\t#ifdef BONE_TEXTURE\r\n\r\n\t\tuniform sampler2D boneTexture;\r\n\t\tuniform int boneTextureSize;\r\n\r\n\t\tmat4 getBoneMatrix( const in float i ) {\r\n\r\n\t\t\tfloat j = i * 4.0;\r\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\r\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\r\n\r\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\r\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\r\n\r\n\t\t\ty = dy * ( y + 0.5 );\r\n\r\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\r\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\r\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\r\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\r\n\r\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\r\n\r\n\t\t\treturn bone;\r\n\r\n\t\t}\r\n\r\n\t#else\r\n\r\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\r\n\r\n\t\tmat4 getBoneMatrix( const in float i ) {\r\n\r\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\r\n\t\t\treturn bone;\r\n\r\n\t\t}\r\n\r\n\t#endif\r\n\r\n#endif\r\n",skinning_vertex:"#ifdef USE_SKINNING\r\n\r\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\r\n\r\n\tvec4 skinned = vec4( 0.0 );\r\n\tskinned += boneMatX * skinVertex * skinWeight.x;\r\n\tskinned += boneMatY * skinVertex * skinWeight.y;\r\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\r\n\tskinned += boneMatW * skinVertex * skinWeight.w;\r\n\r\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\r\n\r\n#endif\r\n",skinnormal_vertex:"#ifdef USE_SKINNING\r\n\r\n\tmat4 skinMatrix = mat4( 0.0 );\r\n\tskinMatrix += skinWeight.x * boneMatX;\r\n\tskinMatrix += skinWeight.y * boneMatY;\r\n\tskinMatrix += skinWeight.z * boneMatZ;\r\n\tskinMatrix += skinWeight.w * boneMatW;\r\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\r\n\r\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\r\n\r\n#endif\r\n",specularmap_fragment:"float specularStrength;\r\n\r\n#ifdef USE_SPECULARMAP\r\n\r\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\r\n\tspecularStrength = texelSpecular.r;\r\n\r\n#else\r\n\r\n\tspecularStrength = 1.0;\r\n\r\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\r\n\r\n\tuniform sampler2D specularMap;\r\n\r\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\r\n\r\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\r\n\r\n#endif\r\n",tonemapping_pars_fragment:"#ifndef saturate\r\n\t#define saturate(a) clamp( a, 0.0, 1.0 )\r\n#endif\r\n\r\nuniform float toneMappingExposure;\r\nuniform float toneMappingWhitePoint;\r\n\r\n// exposure only\r\nvec3 LinearToneMapping( vec3 color ) {\r\n\r\n\treturn toneMappingExposure * color;\r\n\r\n}\r\n\r\n// source: https://www.cs.utah.edu/~reinhard/cdrom/\r\nvec3 ReinhardToneMapping( vec3 color ) {\r\n\r\n\tcolor *= toneMappingExposure;\r\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\r\n\r\n}\r\n\r\n// source: http://filmicgames.com/archives/75\r\n#define Uncharted2Helper( x ) max( ( ( x * ( 0.15 * x + 0.10 * 0.50 ) + 0.20 * 0.02 ) / ( x * ( 0.15 * x + 0.50 ) + 0.20 * 0.30 ) ) - 0.02 / 0.30, vec3( 0.0 ) )\r\nvec3 Uncharted2ToneMapping( vec3 color ) {\r\n\r\n\t// John Hable's filmic operator from Uncharted 2 video game\r\n\tcolor *= toneMappingExposure;\r\n\treturn saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );\r\n\r\n}\r\n\r\n// source: http://filmicgames.com/archives/75\r\nvec3 OptimizedCineonToneMapping( vec3 color ) {\r\n\r\n\t// optimized filmic operator by Jim Hejl and Richard Burgess-Dawson\r\n\tcolor *= toneMappingExposure;\r\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\r\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\r\n\r\n}\r\n",uv_pars_fragment:"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\r\n\r\n\tvarying vec2 vUv;\r\n\r\n#endif",uv_pars_vertex:"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\r\n\r\n\tvarying vec2 vUv;\r\n\tuniform mat3 uvTransform;\r\n\r\n#endif\r\n",uv_vertex:"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\r\n\r\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\r\n\r\n#endif",uv2_pars_fragment:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\r\n\r\n\tvarying vec2 vUv2;\r\n\r\n#endif",uv2_pars_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\r\n\r\n\tattribute vec2 uv2;\r\n\tvarying vec2 vUv2;\r\n\r\n#endif",uv2_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\r\n\r\n\tvUv2 = uv2;\r\n\r\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP )\r\n\r\n\tvec4 worldPosition = modelMatrix * vec4( transformed, 1.0 );\r\n\r\n#endif\r\n",cube_frag:"uniform samplerCube tCube;\r\nuniform float tFlip;\r\nuniform float opacity;\r\n\r\nvarying vec3 vWorldPosition;\r\n\r\nvoid main() {\r\n\r\n\tgl_FragColor = textureCube( tCube, vec3( tFlip * vWorldPosition.x, vWorldPosition.yz ) );\r\n\tgl_FragColor.a *= opacity;\r\n\r\n}\r\n",cube_vert:"varying vec3 vWorldPosition;\r\n\r\n#include <common>\r\n\r\nvoid main() {\r\n\r\n\tvWorldPosition = transformDirection( position, modelMatrix );\r\n\r\n\t#include <begin_vertex>\r\n\t#include <project_vertex>\r\n\r\n\tgl_Position.z = gl_Position.w; // set z to camera.far\r\n\r\n}\r\n",depth_frag:"#if DEPTH_PACKING == 3200\r\n\r\n\tuniform float opacity;\r\n\r\n#endif\r\n\r\n#include <common>\r\n#include <packing>\r\n#include <uv_pars_fragment>\r\n#include <map_pars_fragment>\r\n#include <alphamap_pars_fragment>\r\n#include <logdepthbuf_pars_fragment>\r\n#include <clipping_planes_pars_fragment>\r\n\r\nvoid main() {\r\n\r\n\t#include <clipping_planes_fragment>\r\n\r\n\tvec4 diffuseColor = vec4( 1.0 );\r\n\r\n\t#if DEPTH_PACKING == 3200\r\n\r\n\t\tdiffuseColor.a = opacity;\r\n\r\n\t#endif\r\n\r\n\t#include <map_fragment>\r\n\t#include <alphamap_fragment>\r\n\t#include <alphatest_fragment>\r\n\r\n\t#include <logdepthbuf_fragment>\r\n\r\n\t#if DEPTH_PACKING == 3200\r\n\r\n\t\tgl_FragColor = vec4( vec3( gl_FragCoord.z ), opacity );\r\n\r\n\t#elif DEPTH_PACKING == 3201\r\n\r\n\t\tgl_FragColor = packDepthToRGBA( gl_FragCoord.z );\r\n\r\n\t#endif\r\n\r\n}\r\n",depth_vert:"#include <common>\r\n#include <uv_pars_vertex>\r\n#include <displacementmap_pars_vertex>\r\n#include <morphtarget_pars_vertex>\r\n#include <skinning_pars_vertex>\r\n#include <logdepthbuf_pars_vertex>\r\n#include <clipping_planes_pars_vertex>\r\n\r\nvoid main() {\r\n\r\n\t#include <uv_vertex>\r\n\r\n\t#include <skinbase_vertex>\r\n\r\n\t#ifdef USE_DISPLACEMENTMAP\r\n\r\n\t\t#include <beginnormal_vertex>\r\n\t\t#include <morphnormal_vertex>\r\n\t\t#include <skinnormal_vertex>\r\n\r\n\t#endif\r\n\r\n\t#include <begin_vertex>\r\n\t#include <morphtarget_vertex>\r\n\t#include <skinning_vertex>\r\n\t#include <displacementmap_vertex>\r\n\t#include <project_vertex>\r\n\t#include <logdepthbuf_vertex>\r\n\t#include <clipping_planes_vertex>\r\n\r\n}\r\n",distanceRGBA_frag:"#define DISTANCE\r\n\r\nuniform vec3 referencePosition;\r\nuniform float nearDistance;\r\nuniform float farDistance;\r\nvarying vec3 vWorldPosition;\r\n\r\n#include <common>\r\n#include <packing>\r\n#include <uv_pars_fragment>\r\n#include <map_pars_fragment>\r\n#include <alphamap_pars_fragment>\r\n#include <clipping_planes_pars_fragment>\r\n\r\nvoid main () {\r\n\r\n\t#include <clipping_planes_fragment>\r\n\r\n\tvec4 diffuseColor = vec4( 1.0 );\r\n\r\n\t#include <map_fragment>\r\n\t#include <alphamap_fragment>\r\n\t#include <alphatest_fragment>\r\n\r\n\tfloat dist = length( vWorldPosition - referencePosition );\r\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\r\n\tdist = saturate( dist ); // clamp to [ 0, 1 ]\r\n\r\n\tgl_FragColor = packDepthToRGBA( dist );\r\n\r\n}\r\n",distanceRGBA_vert:"#define DISTANCE\r\n\r\nvarying vec3 vWorldPosition;\r\n\r\n#include <common>\r\n#include <uv_pars_vertex>\r\n#include <displacementmap_pars_vertex>\r\n#include <morphtarget_pars_vertex>\r\n#include <skinning_pars_vertex>\r\n#include <clipping_planes_pars_vertex>\r\n\r\nvoid main() {\r\n\r\n\t#include <uv_vertex>\r\n\r\n\t#include <skinbase_vertex>\r\n\r\n\t#ifdef USE_DISPLACEMENTMAP\r\n\r\n\t\t#include <beginnormal_vertex>\r\n\t\t#include <morphnormal_vertex>\r\n\t\t#include <skinnormal_vertex>\r\n\r\n\t#endif\r\n\r\n\t#include <begin_vertex>\r\n\t#include <morphtarget_vertex>\r\n\t#include <skinning_vertex>\r\n\t#include <displacementmap_vertex>\r\n\t#include <project_vertex>\r\n\t#include <worldpos_vertex>\r\n\t#include <clipping_planes_vertex>\r\n\r\n\tvWorldPosition = worldPosition.xyz;\r\n\r\n}\r\n",equirect_frag:"uniform sampler2D tEquirect;\r\n\r\nvarying vec3 vWorldPosition;\r\n\r\n#include <common>\r\n\r\nvoid main() {\r\n\r\n\tvec3 direction = normalize( vWorldPosition );\r\n\r\n\tvec2 sampleUV;\r\n\r\n\tsampleUV.y = asin( clamp( direction.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\r\n\r\n\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\r\n\r\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\r\n\r\n}\r\n",equirect_vert:"varying vec3 vWorldPosition;\r\n\r\n#include <common>\r\n\r\nvoid main() {\r\n\r\n\tvWorldPosition = transformDirection( position, modelMatrix );\r\n\r\n\t#include <begin_vertex>\r\n\t#include <project_vertex>\r\n\r\n}\r\n",linedashed_frag:"uniform vec3 diffuse;\r\nuniform float opacity;\r\n\r\nuniform float dashSize;\r\nuniform float totalSize;\r\n\r\nvarying float vLineDistance;\r\n\r\n#include <common>\r\n#include <color_pars_fragment>\r\n#include <fog_pars_fragment>\r\n#include <logdepthbuf_pars_fragment>\r\n#include <clipping_planes_pars_fragment>\r\n\r\nvoid main() {\r\n\r\n\t#include <clipping_planes_fragment>\r\n\r\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\r\n\r\n\t\tdiscard;\r\n\r\n\t}\r\n\r\n\tvec3 outgoingLight = vec3( 0.0 );\r\n\tvec4 diffuseColor = vec4( diffuse, opacity );\r\n\r\n\t#include <logdepthbuf_fragment>\r\n\t#include <color_fragment>\r\n\r\n\toutgoingLight = diffuseColor.rgb; // simple shader\r\n\r\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\r\n\r\n\t#include <premultiplied_alpha_fragment>\r\n\t#include <tonemapping_fragment>\r\n\t#include <encodings_fragment>\r\n\t#include <fog_fragment>\r\n\r\n}\r\n",linedashed_vert:"uniform float scale;\r\nattribute float lineDistance;\r\n\r\nvarying float vLineDistance;\r\n\r\n#include <common>\r\n#include <color_pars_vertex>\r\n#include <fog_pars_vertex>\r\n#include <logdepthbuf_pars_vertex>\r\n#include <clipping_planes_pars_vertex>\r\n\r\nvoid main() {\r\n\r\n\t#include <color_vertex>\r\n\r\n\tvLineDistance = scale * lineDistance;\r\n\r\n\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\r\n\tgl_Position = projectionMatrix * mvPosition;\r\n\r\n\t#include <logdepthbuf_vertex>\r\n\t#include <clipping_planes_vertex>\r\n\t#include <fog_vertex>\r\n\r\n}\r\n",meshbasic_frag:"uniform vec3 diffuse;\r\nuniform float opacity;\r\n\r\n#ifndef FLAT_SHADED\r\n\r\n\tvarying vec3 vNormal;\r\n\r\n#endif\r\n\r\n#include <common>\r\n#include <color_pars_fragment>\r\n#include <uv_pars_fragment>\r\n#include <uv2_pars_fragment>\r\n#include <map_pars_fragment>\r\n#include <alphamap_pars_fragment>\r\n#include <aomap_pars_fragment>\r\n#include <lightmap_pars_fragment>\r\n#include <envmap_pars_fragment>\r\n#include <fog_pars_fragment>\r\n#include <specularmap_pars_fragment>\r\n#include <logdepthbuf_pars_fragment>\r\n#include <clipping_planes_pars_fragment>\r\n\r\nvoid main() {\r\n\r\n\t#include <clipping_planes_fragment>\r\n\r\n\tvec4 diffuseColor = vec4( diffuse, opacity );\r\n\r\n\t#include <logdepthbuf_fragment>\r\n\t#include <map_fragment>\r\n\t#include <color_fragment>\r\n\t#include <alphamap_fragment>\r\n\t#include <alphatest_fragment>\r\n\t#include <specularmap_fragment>\r\n\r\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\r\n\r\n\t// accumulation (baked indirect lighting only)\r\n\t#ifdef USE_LIGHTMAP\r\n\r\n\t\treflectedLight.indirectDiffuse += texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\r\n\r\n\t#else\r\n\r\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\r\n\r\n\t#endif\r\n\r\n\t// modulation\r\n\t#include <aomap_fragment>\r\n\r\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\r\n\r\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\r\n\r\n\t#include <envmap_fragment>\r\n\r\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\r\n\r\n\t#include <premultiplied_alpha_fragment>\r\n\t#include <tonemapping_fragment>\r\n\t#include <encodings_fragment>\r\n\t#include <fog_fragment>\r\n\r\n}\r\n",meshbasic_vert:"#include <common>\r\n#include <uv_pars_vertex>\r\n#include <uv2_pars_vertex>\r\n#include <envmap_pars_vertex>\r\n#include <color_pars_vertex>\r\n#include <fog_pars_vertex>\r\n#include <morphtarget_pars_vertex>\r\n#include <skinning_pars_vertex>\r\n#include <logdepthbuf_pars_vertex>\r\n#include <clipping_planes_pars_vertex>\r\n\r\nvoid main() {\r\n\r\n\t#include <uv_vertex>\r\n\t#include <uv2_vertex>\r\n\t#include <color_vertex>\r\n\t#include <skinbase_vertex>\r\n\r\n\t#ifdef USE_ENVMAP\r\n\r\n\t#include <beginnormal_vertex>\r\n\t#include <morphnormal_vertex>\r\n\t#include <skinnormal_vertex>\r\n\t#include <defaultnormal_vertex>\r\n\r\n\t#endif\r\n\r\n\t#include <begin_vertex>\r\n\t#include <morphtarget_vertex>\r\n\t#include <skinning_vertex>\r\n\t#include <project_vertex>\r\n\t#include <logdepthbuf_vertex>\r\n\r\n\t#include <worldpos_vertex>\r\n\t#include <clipping_planes_vertex>\r\n\t#include <envmap_vertex>\r\n\t#include <fog_vertex>\r\n\r\n}\r\n",meshlambert_frag:"uniform vec3 diffuse;\r\nuniform vec3 emissive;\r\nuniform float opacity;\r\n\r\nvarying vec3 vLightFront;\r\n\r\n#ifdef DOUBLE_SIDED\r\n\r\n\tvarying vec3 vLightBack;\r\n\r\n#endif\r\n\r\n#include <common>\r\n#include <packing>\r\n#include <dithering_pars_fragment>\r\n#include <color_pars_fragment>\r\n#include <uv_pars_fragment>\r\n#include <uv2_pars_fragment>\r\n#include <map_pars_fragment>\r\n#include <alphamap_pars_fragment>\r\n#include <aomap_pars_fragment>\r\n#include <lightmap_pars_fragment>\r\n#include <emissivemap_pars_fragment>\r\n#include <envmap_pars_fragment>\r\n#include <bsdfs>\r\n#include <lights_pars>\r\n#include <fog_pars_fragment>\r\n#include <shadowmap_pars_fragment>\r\n#include <shadowmask_pars_fragment>\r\n#include <specularmap_pars_fragment>\r\n#include <logdepthbuf_pars_fragment>\r\n#include <clipping_planes_pars_fragment>\r\n\r\nvoid main() {\r\n\r\n\t#include <clipping_planes_fragment>\r\n\r\n\tvec4 diffuseColor = vec4( diffuse, opacity );\r\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\r\n\tvec3 totalEmissiveRadiance = emissive;\r\n\r\n\t#include <logdepthbuf_fragment>\r\n\t#include <map_fragment>\r\n\t#include <color_fragment>\r\n\t#include <alphamap_fragment>\r\n\t#include <alphatest_fragment>\r\n\t#include <specularmap_fragment>\r\n\t#include <emissivemap_fragment>\r\n\r\n\t// accumulation\r\n\treflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );\r\n\r\n\t#include <lightmap_fragment>\r\n\r\n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\r\n\r\n\t#ifdef DOUBLE_SIDED\r\n\r\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\r\n\r\n\t#else\r\n\r\n\t\treflectedLight.directDiffuse = vLightFront;\r\n\r\n\t#endif\r\n\r\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\r\n\r\n\t// modulation\r\n\t#include <aomap_fragment>\r\n\r\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\r\n\r\n\t#include <envmap_fragment>\r\n\r\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\r\n\r\n\t#include <tonemapping_fragment>\r\n\t#include <encodings_fragment>\r\n\t#include <fog_fragment>\r\n\t#include <premultiplied_alpha_fragment>\r\n\t#include <dithering_fragment>\r\n\r\n}\r\n",meshlambert_vert:"#define LAMBERT\r\n\r\nvarying vec3 vLightFront;\r\n\r\n#ifdef DOUBLE_SIDED\r\n\r\n\tvarying vec3 vLightBack;\r\n\r\n#endif\r\n\r\n#include <common>\r\n#include <uv_pars_vertex>\r\n#include <uv2_pars_vertex>\r\n#include <envmap_pars_vertex>\r\n#include <bsdfs>\r\n#include <lights_pars>\r\n#include <color_pars_vertex>\r\n#include <fog_pars_vertex>\r\n#include <morphtarget_pars_vertex>\r\n#include <skinning_pars_vertex>\r\n#include <shadowmap_pars_vertex>\r\n#include <logdepthbuf_pars_vertex>\r\n#include <clipping_planes_pars_vertex>\r\n\r\nvoid main() {\r\n\r\n\t#include <uv_vertex>\r\n\t#include <uv2_vertex>\r\n\t#include <color_vertex>\r\n\r\n\t#include <beginnormal_vertex>\r\n\t#include <morphnormal_vertex>\r\n\t#include <skinbase_vertex>\r\n\t#include <skinnormal_vertex>\r\n\t#include <defaultnormal_vertex>\r\n\r\n\t#include <begin_vertex>\r\n\t#include <morphtarget_vertex>\r\n\t#include <skinning_vertex>\r\n\t#include <project_vertex>\r\n\t#include <logdepthbuf_vertex>\r\n\t#include <clipping_planes_vertex>\r\n\r\n\t#include <worldpos_vertex>\r\n\t#include <envmap_vertex>\r\n\t#include <lights_lambert_vertex>\r\n\t#include <shadowmap_vertex>\r\n\t#include <fog_vertex>\r\n\r\n}\r\n",meshphong_frag:"#define PHONG\r\n\r\nuniform vec3 diffuse;\r\nuniform vec3 emissive;\r\nuniform vec3 specular;\r\nuniform float shininess;\r\nuniform float opacity;\r\n\r\n#include <common>\r\n#include <packing>\r\n#include <dithering_pars_fragment>\r\n#include <color_pars_fragment>\r\n#include <uv_pars_fragment>\r\n#include <uv2_pars_fragment>\r\n#include <map_pars_fragment>\r\n#include <alphamap_pars_fragment>\r\n#include <aomap_pars_fragment>\r\n#include <lightmap_pars_fragment>\r\n#include <emissivemap_pars_fragment>\r\n#include <envmap_pars_fragment>\r\n#include <gradientmap_pars_fragment>\r\n#include <fog_pars_fragment>\r\n#include <bsdfs>\r\n#include <lights_pars>\r\n#include <lights_phong_pars_fragment>\r\n#include <shadowmap_pars_fragment>\r\n#include <bumpmap_pars_fragment>\r\n#include <normalmap_pars_fragment>\r\n#include <specularmap_pars_fragment>\r\n#include <logdepthbuf_pars_fragment>\r\n#include <clipping_planes_pars_fragment>\r\n\r\nvoid main() {\r\n\r\n\t#include <clipping_planes_fragment>\r\n\r\n\tvec4 diffuseColor = vec4( diffuse, opacity );\r\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\r\n\tvec3 totalEmissiveRadiance = emissive;\r\n\r\n\t#include <logdepthbuf_fragment>\r\n\t#include <map_fragment>\r\n\t#include <color_fragment>\r\n\t#include <alphamap_fragment>\r\n\t#include <alphatest_fragment>\r\n\t#include <specularmap_fragment>\r\n\t#include <normal_fragment>\r\n\t#include <emissivemap_fragment>\r\n\r\n\t// accumulation\r\n\t#include <lights_phong_fragment>\r\n\t#include <lights_template>\r\n\r\n\t// modulation\r\n\t#include <aomap_fragment>\r\n\r\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\r\n\r\n\t#include <envmap_fragment>\r\n\r\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\r\n\r\n\t#include <tonemapping_fragment>\r\n\t#include <encodings_fragment>\r\n\t#include <fog_fragment>\r\n\t#include <premultiplied_alpha_fragment>\r\n\t#include <dithering_fragment>\r\n\r\n}\r\n",meshphong_vert:"#define PHONG\r\n\r\nvarying vec3 vViewPosition;\r\n\r\n#ifndef FLAT_SHADED\r\n\r\n\tvarying vec3 vNormal;\r\n\r\n#endif\r\n\r\n#include <common>\r\n#include <uv_pars_vertex>\r\n#include <uv2_pars_vertex>\r\n#include <displacementmap_pars_vertex>\r\n#include <envmap_pars_vertex>\r\n#include <color_pars_vertex>\r\n#include <fog_pars_vertex>\r\n#include <morphtarget_pars_vertex>\r\n#include <skinning_pars_vertex>\r\n#include <shadowmap_pars_vertex>\r\n#include <logdepthbuf_pars_vertex>\r\n#include <clipping_planes_pars_vertex>\r\n\r\nvoid main() {\r\n\r\n\t#include <uv_vertex>\r\n\t#include <uv2_vertex>\r\n\t#include <color_vertex>\r\n\r\n\t#include <beginnormal_vertex>\r\n\t#include <morphnormal_vertex>\r\n\t#include <skinbase_vertex>\r\n\t#include <skinnormal_vertex>\r\n\t#include <defaultnormal_vertex>\r\n\r\n#ifndef FLAT_SHADED // Normal computed with derivatives when FLAT_SHADED\r\n\r\n\tvNormal = normalize( transformedNormal );\r\n\r\n#endif\r\n\r\n\t#include <begin_vertex>\r\n\t#include <morphtarget_vertex>\r\n\t#include <skinning_vertex>\r\n\t#include <displacementmap_vertex>\r\n\t#include <project_vertex>\r\n\t#include <logdepthbuf_vertex>\r\n\t#include <clipping_planes_vertex>\r\n\r\n\tvViewPosition = - mvPosition.xyz;\r\n\r\n\t#include <worldpos_vertex>\r\n\t#include <envmap_vertex>\r\n\t#include <shadowmap_vertex>\r\n\t#include <fog_vertex>\r\n\r\n}\r\n",meshphysical_frag:"#define PHYSICAL\r\n\r\nuniform vec3 diffuse;\r\nuniform vec3 emissive;\r\nuniform float roughness;\r\nuniform float metalness;\r\nuniform float opacity;\r\n\r\n#ifndef STANDARD\r\n\tuniform float clearCoat;\r\n\tuniform float clearCoatRoughness;\r\n#endif\r\n\r\nvarying vec3 vViewPosition;\r\n\r\n#ifndef FLAT_SHADED\r\n\r\n\tvarying vec3 vNormal;\r\n\r\n#endif\r\n\r\n#include <common>\r\n#include <packing>\r\n#include <dithering_pars_fragment>\r\n#include <color_pars_fragment>\r\n#include <uv_pars_fragment>\r\n#include <uv2_pars_fragment>\r\n#include <map_pars_fragment>\r\n#include <alphamap_pars_fragment>\r\n#include <aomap_pars_fragment>\r\n#include <lightmap_pars_fragment>\r\n#include <emissivemap_pars_fragment>\r\n#include <envmap_pars_fragment>\r\n#include <fog_pars_fragment>\r\n#include <bsdfs>\r\n#include <cube_uv_reflection_fragment>\r\n#include <lights_pars>\r\n#include <lights_physical_pars_fragment>\r\n#include <shadowmap_pars_fragment>\r\n#include <bumpmap_pars_fragment>\r\n#include <normalmap_pars_fragment>\r\n#include <roughnessmap_pars_fragment>\r\n#include <metalnessmap_pars_fragment>\r\n#include <logdepthbuf_pars_fragment>\r\n#include <clipping_planes_pars_fragment>\r\n\r\nvoid main() {\r\n\r\n\t#include <clipping_planes_fragment>\r\n\r\n\tvec4 diffuseColor = vec4( diffuse, opacity );\r\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\r\n\tvec3 totalEmissiveRadiance = emissive;\r\n\r\n\t#include <logdepthbuf_fragment>\r\n\t#include <map_fragment>\r\n\t#include <color_fragment>\r\n\t#include <alphamap_fragment>\r\n\t#include <alphatest_fragment>\r\n\t#include <roughnessmap_fragment>\r\n\t#include <metalnessmap_fragment>\r\n\t#include <normal_fragment>\r\n\t#include <emissivemap_fragment>\r\n\r\n\t// accumulation\r\n\t#include <lights_physical_fragment>\r\n\t#include <lights_template>\r\n\r\n\t// modulation\r\n\t#include <aomap_fragment>\r\n\r\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\r\n\r\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\r\n\r\n\t#include <tonemapping_fragment>\r\n\t#include <encodings_fragment>\r\n\t#include <fog_fragment>\r\n\t#include <premultiplied_alpha_fragment>\r\n\t#include <dithering_fragment>\r\n\r\n}\r\n",meshphysical_vert:"#define PHYSICAL\r\n\r\nvarying vec3 vViewPosition;\r\n\r\n#ifndef FLAT_SHADED\r\n\r\n\tvarying vec3 vNormal;\r\n\r\n#endif\r\n\r\n#include <common>\r\n#include <uv_pars_vertex>\r\n#include <uv2_pars_vertex>\r\n#include <displacementmap_pars_vertex>\r\n#include <color_pars_vertex>\r\n#include <fog_pars_vertex>\r\n#include <morphtarget_pars_vertex>\r\n#include <skinning_pars_vertex>\r\n#include <shadowmap_pars_vertex>\r\n#include <logdepthbuf_pars_vertex>\r\n#include <clipping_planes_pars_vertex>\r\n\r\nvoid main() {\r\n\r\n\t#include <uv_vertex>\r\n\t#include <uv2_vertex>\r\n\t#include <color_vertex>\r\n\r\n\t#include <beginnormal_vertex>\r\n\t#include <morphnormal_vertex>\r\n\t#include <skinbase_vertex>\r\n\t#include <skinnormal_vertex>\r\n\t#include <defaultnormal_vertex>\r\n\r\n#ifndef FLAT_SHADED // Normal computed with derivatives when FLAT_SHADED\r\n\r\n\tvNormal = normalize( transformedNormal );\r\n\r\n#endif\r\n\r\n\t#include <begin_vertex>\r\n\t#include <morphtarget_vertex>\r\n\t#include <skinning_vertex>\r\n\t#include <displacementmap_vertex>\r\n\t#include <project_vertex>\r\n\t#include <logdepthbuf_vertex>\r\n\t#include <clipping_planes_vertex>\r\n\r\n\tvViewPosition = - mvPosition.xyz;\r\n\r\n\t#include <worldpos_vertex>\r\n\t#include <shadowmap_vertex>\r\n\t#include <fog_vertex>\r\n\r\n}\r\n",normal_frag:"#define NORMAL\r\n\r\nuniform float opacity;\r\n\r\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\r\n\r\n\tvarying vec3 vViewPosition;\r\n\r\n#endif\r\n\r\n#ifndef FLAT_SHADED\r\n\r\n\tvarying vec3 vNormal;\r\n\r\n#endif\r\n\r\n#include <packing>\r\n#include <uv_pars_fragment>\r\n#include <bumpmap_pars_fragment>\r\n#include <normalmap_pars_fragment>\r\n#include <logdepthbuf_pars_fragment>\r\n\r\nvoid main() {\r\n\r\n\t#include <logdepthbuf_fragment>\r\n\t#include <normal_fragment>\r\n\r\n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\r\n\r\n}\r\n",normal_vert:"#define NORMAL\r\n\r\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\r\n\r\n\tvarying vec3 vViewPosition;\r\n\r\n#endif\r\n\r\n#ifndef FLAT_SHADED\r\n\r\n\tvarying vec3 vNormal;\r\n\r\n#endif\r\n\r\n#include <uv_pars_vertex>\r\n#include <displacementmap_pars_vertex>\r\n#include <morphtarget_pars_vertex>\r\n#include <skinning_pars_vertex>\r\n#include <logdepthbuf_pars_vertex>\r\n\r\nvoid main() {\r\n\r\n\t#include <uv_vertex>\r\n\r\n\t#include <beginnormal_vertex>\r\n\t#include <morphnormal_vertex>\r\n\t#include <skinbase_vertex>\r\n\t#include <skinnormal_vertex>\r\n\t#include <defaultnormal_vertex>\r\n\r\n#ifndef FLAT_SHADED // Normal computed with derivatives when FLAT_SHADED\r\n\r\n\tvNormal = normalize( transformedNormal );\r\n\r\n#endif\r\n\r\n\t#include <begin_vertex>\r\n\t#include <morphtarget_vertex>\r\n\t#include <skinning_vertex>\r\n\t#include <displacementmap_vertex>\r\n\t#include <project_vertex>\r\n\t#include <logdepthbuf_vertex>\r\n\r\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\r\n\r\n\tvViewPosition = - mvPosition.xyz;\r\n\r\n#endif\r\n\r\n}\r\n",points_frag:"uniform vec3 diffuse;\r\nuniform float opacity;\r\n\r\n#include <common>\r\n#include <packing>\r\n#include <color_pars_fragment>\r\n#include <map_particle_pars_fragment>\r\n#include <fog_pars_fragment>\r\n#include <shadowmap_pars_fragment>\r\n#include <logdepthbuf_pars_fragment>\r\n#include <clipping_planes_pars_fragment>\r\n\r\nvoid main() {\r\n\r\n\t#include <clipping_planes_fragment>\r\n\r\n\tvec3 outgoingLight = vec3( 0.0 );\r\n\tvec4 diffuseColor = vec4( diffuse, opacity );\r\n\r\n\t#include <logdepthbuf_fragment>\r\n\t#include <map_particle_fragment>\r\n\t#include <color_fragment>\r\n\t#include <alphatest_fragment>\r\n\r\n\toutgoingLight = diffuseColor.rgb;\r\n\r\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\r\n\r\n\t#include <premultiplied_alpha_fragment>\r\n\t#include <tonemapping_fragment>\r\n\t#include <encodings_fragment>\r\n\t#include <fog_fragment>\r\n\r\n}\r\n",points_vert:"uniform float size;\r\nuniform float scale;\r\n\r\n#include <common>\r\n#include <color_pars_vertex>\r\n#include <fog_pars_vertex>\r\n#include <shadowmap_pars_vertex>\r\n#include <logdepthbuf_pars_vertex>\r\n#include <clipping_planes_pars_vertex>\r\n\r\nvoid main() {\r\n\r\n\t#include <color_vertex>\r\n\t#include <begin_vertex>\r\n\t#include <project_vertex>\r\n\r\n\t#ifdef USE_SIZEATTENUATION\r\n\t\tgl_PointSize = size * ( scale / - mvPosition.z );\r\n\t#else\r\n\t\tgl_PointSize = size;\r\n\t#endif\r\n\r\n\t#include <logdepthbuf_vertex>\r\n\t#include <clipping_planes_vertex>\r\n\t#include <worldpos_vertex>\r\n\t#include <shadowmap_vertex>\r\n\t#include <fog_vertex>\r\n\r\n}\r\n",shadow_frag:"uniform vec3 color;\r\nuniform float opacity;\r\n\r\n#include <common>\r\n#include <packing>\r\n#include <fog_pars_fragment>\r\n#include <bsdfs>\r\n#include <lights_pars>\r\n#include <shadowmap_pars_fragment>\r\n#include <shadowmask_pars_fragment>\r\n\r\nvoid main() {\r\n\r\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\r\n\r\n\t#include <fog_fragment>\r\n\r\n}\r\n",shadow_vert:"#include <fog_pars_vertex>\r\n#include <shadowmap_pars_vertex>\r\n\r\nvoid main() {\r\n\r\n\t#include <begin_vertex>\r\n\t#include <project_vertex>\r\n\t#include <worldpos_vertex>\r\n\t#include <shadowmap_vertex>\r\n\t#include <fog_vertex>\r\n\r\n}\r\n"},ve={basic:{uniforms:ge.merge([me.common,me.specularmap,me.envmap,me.aomap,me.lightmap,me.fog]),vertexShader:ye.meshbasic_vert,fragmentShader:ye.meshbasic_frag},lambert:{uniforms:ge.merge([me.common,me.specularmap,me.envmap,me.aomap,me.lightmap,me.emissivemap,me.fog,me.lights,{emissive:{value:new fe(0)}}]),vertexShader:ye.meshlambert_vert,fragmentShader:ye.meshlambert_frag},phong:{uniforms:ge.merge([me.common,me.specularmap,me.envmap,me.aomap,me.lightmap,me.emissivemap,me.bumpmap,me.normalmap,me.displacementmap,me.gradientmap,me.fog,me.lights,{emissive:{value:new fe(0)},specular:{value:new fe(1118481)},shininess:{value:30}}]),vertexShader:ye.meshphong_vert,fragmentShader:ye.meshphong_frag},standard:{uniforms:ge.merge([me.common,me.envmap,me.aomap,me.lightmap,me.emissivemap,me.bumpmap,me.normalmap,me.displacementmap,me.roughnessmap,me.metalnessmap,me.fog,me.lights,{emissive:{value:new fe(0)},roughness:{value:.5},metalness:{value:.5},envMapIntensity:{value:1}}]),vertexShader:ye.meshphysical_vert,fragmentShader:ye.meshphysical_frag},points:{uniforms:ge.merge([me.points,me.fog]),vertexShader:ye.points_vert,fragmentShader:ye.points_frag},dashed:{uniforms:ge.merge([me.common,me.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:ye.linedashed_vert,fragmentShader:ye.linedashed_frag},depth:{uniforms:ge.merge([me.common,me.displacementmap]),vertexShader:ye.depth_vert,fragmentShader:ye.depth_frag},normal:{uniforms:ge.merge([me.common,me.bumpmap,me.normalmap,me.displacementmap,{opacity:{value:1}}]),vertexShader:ye.normal_vert,fragmentShader:ye.normal_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:ye.cube_vert,fragmentShader:ye.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:ye.equirect_vert,fragmentShader:ye.equirect_frag},distanceRGBA:{uniforms:ge.merge([me.common,me.displacementmap,{referencePosition:{value:new b},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:ye.distanceRGBA_vert,fragmentShader:ye.distanceRGBA_frag},shadow:{uniforms:ge.merge([me.lights,me.fog,{color:{value:new fe(0)},opacity:{value:1}}]),vertexShader:ye.shadow_vert,fragmentShader:ye.shadow_frag}};function be(e,t,n,r,i,a,o,s,c){E.call(this,e,t,n,r,i,a,o,s,c),this.needsUpdate=!0}function we(e,t,n,r,i){var a,o,s,c,l,u,h=new b,d=new v,p=new b;function f(){var e=new Float32Array([-.5,-.5,0,0,.5,-.5,1,0,.5,.5,1,1,-.5,.5,0,1]),n=new Uint16Array([0,1,2,0,2,3]);a=t.createBuffer(),o=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,a),t.bufferData(t.ARRAY_BUFFER,e,t.STATIC_DRAW),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,o),t.bufferData(t.ELEMENT_ARRAY_BUFFER,n,t.STATIC_DRAW),s=function(){var e=t.createProgram(),n=t.createShader(t.VERTEX_SHADER),r=t.createShader(t.FRAGMENT_SHADER);return t.shaderSource(n,["precision "+i.precision+" float;","#define SHADER_NAME SpriteMaterial","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform float rotation;","uniform vec2 center;","uniform vec2 scale;","uniform vec2 uvOffset;","uniform vec2 uvScale;","attribute vec2 position;","attribute vec2 uv;","varying vec2 vUV;","varying float fogDepth;","void main() {","\tvUV = uvOffset + uv * uvScale;","\tvec2 alignedPosition = ( position - center ) * scale;","\tvec2 rotatedPosition;","\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;","\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;","\tvec4 mvPosition;","\tmvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );","\tmvPosition.xy += rotatedPosition;","\tgl_Position = projectionMatrix * mvPosition;","\tfogDepth = - mvPosition.z;","}"].join("\n")),t.shaderSource(r,["precision "+i.precision+" float;","#define SHADER_NAME SpriteMaterial","uniform vec3 color;","uniform sampler2D map;","uniform float opacity;","uniform int fogType;","uniform vec3 fogColor;","uniform float fogDensity;","uniform float fogNear;","uniform float fogFar;","uniform float alphaTest;","varying vec2 vUV;","varying float fogDepth;","void main() {","\tvec4 texture = texture2D( map, vUV );","\tgl_FragColor = vec4( color * texture.xyz, texture.a * opacity );","\tif ( gl_FragColor.a < alphaTest ) discard;","\tif ( fogType > 0 ) {","\t\tfloat fogFactor = 0.0;","\t\tif ( fogType == 1 ) {","\t\t\tfogFactor = smoothstep( fogNear, fogFar, fogDepth );","\t\t} else {","\t\t\tconst float LOG2 = 1.442695;","\t\t\tfogFactor = exp2( - fogDensity * fogDensity * fogDepth * fogDepth * LOG2 );","\t\t\tfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );","\t\t}","\t\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );","\t}","}"].join("\n")),t.compileShader(n),t.compileShader(r),t.attachShader(e,n),t.attachShader(e,r),t.linkProgram(e),e}(),c={position:t.getAttribLocation(s,"position"),uv:t.getAttribLocation(s,"uv")},l={uvOffset:t.getUniformLocation(s,"uvOffset"),uvScale:t.getUniformLocation(s,"uvScale"),rotation:t.getUniformLocation(s,"rotation"),center:t.getUniformLocation(s,"center"),scale:t.getUniformLocation(s,"scale"),color:t.getUniformLocation(s,"color"),map:t.getUniformLocation(s,"map"),opacity:t.getUniformLocation(s,"opacity"),modelViewMatrix:t.getUniformLocation(s,"modelViewMatrix"),projectionMatrix:t.getUniformLocation(s,"projectionMatrix"),fogType:t.getUniformLocation(s,"fogType"),fogDensity:t.getUniformLocation(s,"fogDensity"),fogNear:t.getUniformLocation(s,"fogNear"),fogFar:t.getUniformLocation(s,"fogFar"),fogColor:t.getUniformLocation(s,"fogColor"),fogDepth:t.getUniformLocation(s,"fogDepth"),alphaTest:t.getUniformLocation(s,"alphaTest")};var r=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");r.width=8,r.height=8;var h=r.getContext("2d");h.fillStyle="white",h.fillRect(0,0,8,8),u=new be(r)}function m(e,t){return e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.z!==t.z?t.z-e.z:t.id-e.id}this.render=function(i,g,y){if(0!==i.length){void 0===s&&f(),n.useProgram(s),n.initAttributes(),n.enableAttribute(c.position),n.enableAttribute(c.uv),n.disableUnusedAttributes(),n.disable(t.CULL_FACE),n.enable(t.BLEND),t.bindBuffer(t.ARRAY_BUFFER,a),t.vertexAttribPointer(c.position,2,t.FLOAT,!1,16,0),t.vertexAttribPointer(c.uv,2,t.FLOAT,!1,16,8),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,o),t.uniformMatrix4fv(l.projectionMatrix,!1,y.projectionMatrix.elements),n.activeTexture(t.TEXTURE0),t.uniform1i(l.map,0);var v=0,b=0,w=g.fog;w?(t.uniform3f(l.fogColor,w.color.r,w.color.g,w.color.b),w.isFog?(t.uniform1f(l.fogNear,w.near),t.uniform1f(l.fogFar,w.far),t.uniform1i(l.fogType,1),v=1,b=1):w.isFogExp2&&(t.uniform1f(l.fogDensity,w.density),t.uniform1i(l.fogType,2),v=2,b=2)):(t.uniform1i(l.fogType,0),v=0,b=0);for(var A=0,E=i.length;A<E;A++){(S=i[A]).modelViewMatrix.multiplyMatrices(y.matrixWorldInverse,S.matrixWorld),S.z=-S.modelViewMatrix.elements[14]}i.sort(m);var x=[],_=[];for(A=0,E=i.length;A<E;A++){var S,M=(S=i[A]).material;if(!1!==M.visible){S.onBeforeRender(e,g,y,void 0,M,void 0),t.uniform1f(l.alphaTest,M.alphaTest),t.uniformMatrix4fv(l.modelViewMatrix,!1,S.modelViewMatrix.elements),S.matrixWorld.decompose(h,d,p),x[0]=p.x,x[1]=p.y,_[0]=S.center.x-.5,_[1]=S.center.y-.5;var T=0;g.fog&&M.fog&&(T=b),v!==T&&(t.uniform1i(l.fogType,T),v=T),null!==M.map?(t.uniform2f(l.uvOffset,M.map.offset.x,M.map.offset.y),t.uniform2f(l.uvScale,M.map.repeat.x,M.map.repeat.y)):(t.uniform2f(l.uvOffset,0,0),t.uniform2f(l.uvScale,1,1)),t.uniform1f(l.opacity,M.opacity),t.uniform3f(l.color,M.color.r,M.color.g,M.color.b),t.uniform1f(l.rotation,M.rotation),t.uniform2fv(l.center,_),t.uniform2fv(l.scale,x),n.setBlending(M.blending,M.blendEquation,M.blendSrc,M.blendDst,M.blendEquationAlpha,M.blendSrcAlpha,M.blendDstAlpha,M.premultipliedAlpha),n.buffers.depth.setTest(M.depthTest),n.buffers.depth.setMask(M.depthWrite),n.buffers.color.setMask(M.colorWrite),r.setTexture2D(M.map||u,0),t.drawElements(t.TRIANGLES,6,t.UNSIGNED_SHORT,0),S.onAfterRender(e,g,y,void 0,M,void 0)}}n.enable(t.CULL_FACE),n.reset()}}}ve.physical={uniforms:ge.merge([ve.standard.uniforms,{clearCoat:{value:0},clearCoatRoughness:{value:0}}]),vertexShader:ye.meshphysical_vert,fragmentShader:ye.meshphysical_frag},be.prototype=Object.create(E.prototype),be.prototype.constructor=be;var Ae,Ee,xe,_e,Se,Me,Te,Re=0;function ke(){Object.defineProperty(this,"id",{value:Re++}),this.uuid=m.generateUUID(),this.name="",this.type="Material",this.fog=!0,this.lights=!0,this.blending=1,this.side=0,this.flatShading=!1,this.vertexColors=0,this.opacity=1,this.transparent=!1,this.blendSrc=204,this.blendDst=205,this.blendEquation=100,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=3,this.depthTest=!0,this.depthWrite=!0,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.premultipliedAlpha=!1,this.overdraw=0,this.visible=!0,this.userData={},this.needsUpdate=!0}function Ce(e){ke.call(this),this.type="MeshDepthMaterial",this.depthPacking=3200,this.skinning=!1,this.morphTargets=!1,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.lights=!1,this.setValues(e)}function Oe(e){ke.call(this),this.type="MeshDistanceMaterial",this.referencePosition=new b,this.nearDistance=1,this.farDistance=1e3,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.lights=!1,this.setValues(e)}function Pe(e,t){this.min=void 0!==e?e:new b(1/0,1/0,1/0),this.max=void 0!==t?t:new b(-1/0,-1/0,-1/0)}function Ie(e,t){this.center=void 0!==e?e:new b,this.radius=void 0!==t?t:0}function Ne(e,t){this.normal=void 0!==e?e:new b(1,0,0),this.constant=void 0!==t?t:0}function Le(e,t,n,r,i,a){this.planes=[void 0!==e?e:new Ne,void 0!==t?t:new Ne,void 0!==n?n:new Ne,void 0!==r?r:new Ne,void 0!==i?i:new Ne,void 0!==a?a:new Ne]}function De(e,t,n){for(var r=new Le,i=new y,a=new g,o=new g(n,n),s=new b,c=new b,l=new Array(4),u=new Array(4),h={},d={0:1,1:0,2:2},p=[new b(1,0,0),new b(-1,0,0),new b(0,0,1),new b(0,0,-1),new b(0,1,0),new b(0,-1,0)],f=[new b(0,1,0),new b(0,1,0),new b(0,1,0),new b(0,1,0),new b(0,0,1),new b(0,0,-1)],m=[new x,new x,new x,new x,new x,new x],v=0;4!==v;++v){var w=0!=(1&v),A=0!=(2&v),E=new Ce({depthPacking:3201,morphTargets:w,skinning:A});l[v]=E;var S=new Oe({morphTargets:w,skinning:A});u[v]=S}var M=this;function T(t,n,r,i,a,o){var s=t.geometry,c=null,p=l,f=t.customDepthMaterial;if(r&&(p=u,f=t.customDistanceMaterial),f)c=f;else{var m=!1;n.morphTargets&&(s&&s.isBufferGeometry?m=s.morphAttributes&&s.morphAttributes.position&&s.morphAttributes.position.length>0:s&&s.isGeometry&&(m=s.morphTargets&&s.morphTargets.length>0)),t.isSkinnedMesh&&!1===n.skinning&&console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",t);var g=0;m&&(g|=1),t.isSkinnedMesh&&n.skinning&&(g|=2),c=p[g]}if(e.localClippingEnabled&&!0===n.clipShadows&&0!==n.clippingPlanes.length){var y=c.uuid,v=n.uuid,b=h[y];void 0===b&&(b={},h[y]=b);var w=b[v];void 0===w&&(w=c.clone(),b[v]=w),c=w}return c.visible=n.visible,c.wireframe=n.wireframe,c.side=null!=n.shadowSide?n.shadowSide:d[n.side],c.clipShadows=n.clipShadows,c.clippingPlanes=n.clippingPlanes,c.clipIntersection=n.clipIntersection,c.wireframeLinewidth=n.wireframeLinewidth,c.linewidth=n.linewidth,r&&c.isMeshDistanceMaterial&&(c.referencePosition.copy(i),c.nearDistance=a,c.farDistance=o),c}function R(n,i,a,o){if(!1!==n.visible){if(n.layers.test(i.layers)&&(n.isMesh||n.isLine||n.isPoints)&&n.castShadow&&(!n.frustumCulled||r.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(a.matrixWorldInverse,n.matrixWorld);var s=t.update(n),l=n.material;if(Array.isArray(l))for(var u=s.groups,h=0,d=u.length;h<d;h++){var p=u[h],f=l[p.materialIndex];if(f&&f.visible){var m=T(n,f,o,c,a.near,a.far);e.renderBufferDirect(a,null,s,m,n,p)}}else if(l.visible){m=T(n,l,o,c,a.near,a.far);e.renderBufferDirect(a,null,s,m,n,null)}}for(var g=n.children,y=0,v=g.length;y<v;y++)R(g[y],i,a,o)}}this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=1,this.render=function(t,n,l){if(!1!==M.enabled&&(!1!==M.autoUpdate||!1!==M.needsUpdate)&&0!==t.length){var u,h=e.context,d=e.state;d.disable(h.BLEND),d.buffers.color.setClear(1,1,1,1),d.buffers.depth.setTest(!0),d.setScissorTest(!1);for(var g=0,y=t.length;g<y;g++){var v=t[g],b=v.shadow,w=v&&v.isPointLight;if(void 0!==b){var A=b.camera;if(a.copy(b.mapSize),a.min(o),w){var E=a.x,x=a.y;m[0].set(2*E,x,E,x),m[1].set(0,x,E,x),m[2].set(3*E,x,E,x),m[3].set(E,x,E,x),m[4].set(3*E,0,E,x),m[5].set(E,0,E,x),a.x*=4,a.y*=2}if(null===b.map){var S={minFilter:1003,magFilter:1003,format:1023};b.map=new _(a.x,a.y,S),b.map.texture.name=v.name+".shadowMap",A.updateProjectionMatrix()}b.isSpotLightShadow&&b.update(v);var T=b.map,k=b.matrix;c.setFromMatrixPosition(v.matrixWorld),A.position.copy(c),w?(u=6,k.makeTranslation(-c.x,-c.y,-c.z)):(u=1,s.setFromMatrixPosition(v.target.matrixWorld),A.lookAt(s),A.updateMatrixWorld(),k.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),k.multiply(A.projectionMatrix),k.multiply(A.matrixWorldInverse)),e.setRenderTarget(T),e.clear();for(var C=0;C<u;C++){if(w){s.copy(A.position),s.add(p[C]),A.up.copy(f[C]),A.lookAt(s),A.updateMatrixWorld();var O=m[C];d.viewport(O)}i.multiplyMatrices(A.projectionMatrix,A.matrixWorldInverse),r.setFromMatrix(i),R(n,l,A,w)}}else console.warn("THREE.WebGLShadowMap:",v,"has no shadow.")}M.needsUpdate=!1}}}function Fe(e){var t={};return{get:function(e){return e.isInterleavedBufferAttribute&&(e=e.data),t[e.uuid]},remove:function(n){n.isInterleavedBufferAttribute&&(n=n.data);var r=t[n.uuid];r&&(e.deleteBuffer(r.buffer),delete t[n.uuid])},update:function(n,r){n.isInterleavedBufferAttribute&&(n=n.data);var i=t[n.uuid];void 0===i?t[n.uuid]=function(t,n){var r=t.array,i=t.dynamic?e.DYNAMIC_DRAW:e.STATIC_DRAW,a=e.createBuffer();e.bindBuffer(n,a),e.bufferData(n,r,i),t.onUploadCallback();var o=e.FLOAT;return r instanceof Float32Array?o=e.FLOAT:r instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):r instanceof Uint16Array?o=e.UNSIGNED_SHORT:r instanceof Int16Array?o=e.SHORT:r instanceof Uint32Array?o=e.UNSIGNED_INT:r instanceof Int32Array?o=e.INT:r instanceof Int8Array?o=e.BYTE:r instanceof Uint8Array&&(o=e.UNSIGNED_BYTE),{buffer:a,type:o,bytesPerElement:r.BYTES_PER_ELEMENT,version:t.version}}(n,r):i.version<n.version&&(!function(t,n,r){var i=n.array,a=n.updateRange;e.bindBuffer(r,t),!1===n.dynamic?e.bufferData(r,i,e.STATIC_DRAW):-1===a.count?e.bufferSubData(r,0,i):0===a.count?console.error("THREE.WebGLObjects.updateBuffer: dynamic THREE.BufferAttribute marked as needsUpdate but updateRange.count is 0, ensure you are using set methods or updating manually."):(e.bufferSubData(r,a.offset*i.BYTES_PER_ELEMENT,i.subarray(a.offset,a.offset+a.count)),a.count=-1)}(i.buffer,n,r),i.version=n.version)}}}function je(e,t,n,r){this._x=e||0,this._y=t||0,this._z=n||0,this._order=r||je.DefaultOrder}function Ue(){this.mask=1}ke.prototype=Object.assign(Object.create(a.prototype),{constructor:ke,isMaterial:!0,onBeforeCompile:function(){},setValues:function(e){if(void 0!==e)for(var t in e){var n=e[t];if(void 0!==n)if("shading"!==t){var r=this[t];void 0!==r?r&&r.isColor?r.set(n):r&&r.isVector3&&n&&n.isVector3?r.copy(n):this[t]="overdraw"===t?Number(n):n:console.warn("THREE."+this.type+": '"+t+"' is not a property of this material.")}else console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===n;else console.warn("THREE.Material: '"+t+"' parameter is undefined.")}},toJSON:function(e){var t=void 0===e||"string"==typeof e;t&&(e={textures:{},images:{}});var n={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};function r(e){var t=[];for(var n in e){var r=e[n];delete r.metadata,t.push(r)}return t}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),void 0!==this.roughness&&(n.roughness=this.roughness),void 0!==this.metalness&&(n.metalness=this.metalness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),1!==this.emissiveIntensity&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),void 0!==this.shininess&&(n.shininess=this.shininess),void 0!==this.clearCoat&&(n.clearCoat=this.clearCoat),void 0!==this.clearCoatRoughness&&(n.clearCoatRoughness=this.clearCoatRoughness),this.map&&this.map.isTexture&&(n.map=this.map.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),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.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.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,n.reflectivity=this.reflectivity),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.size&&(n.size=this.size),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),1!==this.blending&&(n.blending=this.blending),!0===this.flatShading&&(n.flatShading=this.flatShading),0!==this.side&&(n.side=this.side),0!==this.vertexColors&&(n.vertexColors=this.vertexColors),this.opacity<1&&(n.opacity=this.opacity),!0===this.transparent&&(n.transparent=this.transparent),n.depthFunc=this.depthFunc,n.depthTest=this.depthTest,n.depthWrite=this.depthWrite,0!==this.rotation&&(n.rotation=this.rotation),1!==this.linewidth&&(n.linewidth=this.linewidth),void 0!==this.dashSize&&(n.dashSize=this.dashSize),void 0!==this.gapSize&&(n.gapSize=this.gapSize),void 0!==this.scale&&(n.scale=this.scale),!0===this.dithering&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(n.wireframe=this.wireframe),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.morphTargets&&(n.morphTargets=!0),!0===this.skinning&&(n.skinning=!0),!1===this.visible&&(n.visible=!1),"{}"!==JSON.stringify(this.userData)&&(n.userData=this.userData),t){var i=r(e.textures),a=r(e.images);i.length>0&&(n.textures=i),a.length>0&&(n.images=a)}return n},clone:function(){return(new this.constructor).copy(this)},copy:function(e){this.name=e.name,this.fog=e.fog,this.lights=e.lights,this.blending=e.blending,this.side=e.side,this.flatShading=e.flatShading,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.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.premultipliedAlpha=e.premultipliedAlpha,this.overdraw=e.overdraw,this.visible=e.visible,this.userData=JSON.parse(JSON.stringify(e.userData)),this.clipShadows=e.clipShadows,this.clipIntersection=e.clipIntersection;var t=e.clippingPlanes,n=null;if(null!==t){var r=t.length;n=new Array(r);for(var i=0;i!==r;++i)n[i]=t[i].clone()}return this.clippingPlanes=n,this.shadowSide=e.shadowSide,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Ce.prototype=Object.create(ke.prototype),Ce.prototype.constructor=Ce,Ce.prototype.isMeshDepthMaterial=!0,Ce.prototype.copy=function(e){return ke.prototype.copy.call(this,e),this.depthPacking=e.depthPacking,this.skinning=e.skinning,this.morphTargets=e.morphTargets,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},Oe.prototype=Object.create(ke.prototype),Oe.prototype.constructor=Oe,Oe.prototype.isMeshDistanceMaterial=!0,Oe.prototype.copy=function(e){return ke.prototype.copy.call(this,e),this.referencePosition.copy(e.referencePosition),this.nearDistance=e.nearDistance,this.farDistance=e.farDistance,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this},Object.assign(Pe.prototype,{isBox3:!0,set:function(e,t){return this.min.copy(e),this.max.copy(t),this},setFromArray:function(e){for(var t=1/0,n=1/0,r=1/0,i=-1/0,a=-1/0,o=-1/0,s=0,c=e.length;s<c;s+=3){var l=e[s],u=e[s+1],h=e[s+2];l<t&&(t=l),u<n&&(n=u),h<r&&(r=h),l>i&&(i=l),u>a&&(a=u),h>o&&(o=h)}return this.min.set(t,n,r),this.max.set(i,a,o),this},setFromBufferAttribute:function(e){for(var t=1/0,n=1/0,r=1/0,i=-1/0,a=-1/0,o=-1/0,s=0,c=e.count;s<c;s++){var l=e.getX(s),u=e.getY(s),h=e.getZ(s);l<t&&(t=l),u<n&&(n=u),h<r&&(r=h),l>i&&(i=l),u>a&&(a=u),h>o&&(o=h)}return this.min.set(t,n,r),this.max.set(i,a,o),this},setFromPoints:function(e){this.makeEmpty();for(var t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this},setFromCenterAndSize:function(){var e=new b;return function(t,n){var r=e.copy(n).multiplyScalar(.5);return this.min.copy(t).sub(r),this.max.copy(t).add(r),this}}(),setFromObject:function(e){return this.makeEmpty(),this.expandByObject(e)},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.min.copy(e.min),this.max.copy(e.max),this},makeEmpty:function(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z},getCenter:function(e){var t=e||new b;return this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(e){var t=e||new b;return this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)},expandByPoint:function(e){return this.min.min(e),this.max.max(e),this},expandByVector:function(e){return this.min.sub(e),this.max.add(e),this},expandByScalar:function(e){return this.min.addScalar(-e),this.max.addScalar(e),this},expandByObject:function(){var e,t,n,r=new b;function i(i){var a=i.geometry;if(void 0!==a)if(a.isGeometry){var o=a.vertices;for(t=0,n=o.length;t<n;t++)r.copy(o[t]),r.applyMatrix4(i.matrixWorld),e.expandByPoint(r)}else if(a.isBufferGeometry){var s=a.attributes.position;if(void 0!==s)for(t=0,n=s.count;t<n;t++)r.fromBufferAttribute(s,t).applyMatrix4(i.matrixWorld),e.expandByPoint(r)}}return function(t){return e=this,t.updateMatrixWorld(!0),t.traverse(i),this}}(),containsPoint:function(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y||e.z<this.min.z||e.z>this.max.z)},containsBox:function(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:function(e,t){return(t||new b).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:function(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y||e.max.z<this.min.z||e.min.z>this.max.z)},intersectsSphere:(Ee=new b,function(e){return this.clampPoint(e.center,Ee),Ee.distanceToSquared(e.center)<=e.radius*e.radius}),intersectsPlane:function(e){var 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:function(){var e=new b,t=new b,n=new b,r=new b,i=new b,a=new b,o=new b,s=new b,c=new b,l=new b;function u(r){var i,a;for(i=0,a=r.length-3;i<=a;i+=3){o.fromArray(r,i);var s=c.x*Math.abs(o.x)+c.y*Math.abs(o.y)+c.z*Math.abs(o.z),l=e.dot(o),u=t.dot(o),h=n.dot(o);if(Math.max(-Math.max(l,u,h),Math.min(l,u,h))>s)return!1}return!0}return function(o){if(this.isEmpty())return!1;this.getCenter(s),c.subVectors(this.max,s),e.subVectors(o.a,s),t.subVectors(o.b,s),n.subVectors(o.c,s),r.subVectors(t,e),i.subVectors(n,t),a.subVectors(e,n);var h=[0,-r.z,r.y,0,-i.z,i.y,0,-a.z,a.y,r.z,0,-r.x,i.z,0,-i.x,a.z,0,-a.x,-r.y,r.x,0,-i.y,i.x,0,-a.y,a.x,0];return!!u(h)&&(!!u(h=[1,0,0,0,1,0,0,0,1])&&(l.crossVectors(r,i),u(h=[l.x,l.y,l.z])))}}(),clampPoint:function(e,t){return(t||new b).copy(e).clamp(this.min,this.max)},distanceToPoint:function(){var e=new b;return function(t){return e.copy(t).clamp(this.min,this.max).sub(t).length()}}(),getBoundingSphere:function(){var e=new b;return function(t){var n=t||new Ie;return this.getCenter(n.center),n.radius=.5*this.getSize(e).length(),n}}(),intersect:function(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this},union:function(e){return this.min.min(e.min),this.max.max(e.max),this},applyMatrix4:(Ae=[new b,new b,new b,new b,new b,new b,new b,new b],function(e){return this.isEmpty()||(Ae[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Ae[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Ae[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Ae[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Ae[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Ae[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Ae[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Ae[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Ae)),this}),translate:function(e){return this.min.add(e),this.max.add(e),this},equals:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}),Object.assign(Ie.prototype,{set:function(e,t){return this.center.copy(e),this.radius=t,this},setFromPoints:(xe=new Pe,function(e,t){var n=this.center;void 0!==t?n.copy(t):xe.setFromPoints(e).getCenter(n);for(var r=0,i=0,a=e.length;i<a;i++)r=Math.max(r,n.distanceToSquared(e[i]));return this.radius=Math.sqrt(r),this}),clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.center.copy(e.center),this.radius=e.radius,this},empty:function(){return this.radius<=0},containsPoint:function(e){return e.distanceToSquared(this.center)<=this.radius*this.radius},distanceToPoint:function(e){return e.distanceTo(this.center)-this.radius},intersectsSphere:function(e){var t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t},intersectsBox:function(e){return e.intersectsSphere(this)},intersectsPlane:function(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius},clampPoint:function(e,t){var n=this.center.distanceToSquared(e),r=t||new b;return r.copy(e),n>this.radius*this.radius&&(r.sub(this.center).normalize(),r.multiplyScalar(this.radius).add(this.center)),r},getBoundingBox:function(e){var t=e||new Pe;return t.set(this.center,this.center),t.expandByScalar(this.radius),t},applyMatrix4:function(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this},translate:function(e){return this.center.add(e),this},equals:function(e){return e.center.equals(this.center)&&e.radius===this.radius}}),Object.assign(Ne.prototype,{set:function(e,t){return this.normal.copy(e),this.constant=t,this},setComponents:function(e,t,n,r){return this.normal.set(e,t,n),this.constant=r,this},setFromNormalAndCoplanarPoint:function(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this},setFromCoplanarPoints:function(){var e=new b,t=new b;return function(n,r,i){var a=e.subVectors(i,r).cross(t.subVectors(n,r)).normalize();return this.setFromNormalAndCoplanarPoint(a,n),this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.normal.copy(e.normal),this.constant=e.constant,this},normalize:function(){var e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this},negate:function(){return this.constant*=-1,this.normal.negate(),this},distanceToPoint:function(e){return this.normal.dot(e)+this.constant},distanceToSphere:function(e){return this.distanceToPoint(e.center)-e.radius},projectPoint:function(e,t){return(t||new b).copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)},intersectLine:function(){var e=new b;return function(t,n){var r=n||new b,i=t.delta(e),a=this.normal.dot(i);if(0===a)return 0===this.distanceToPoint(t.start)?r.copy(t.start):void 0;var o=-(t.start.dot(this.normal)+this.constant)/a;return o<0||o>1?void 0:r.copy(i).multiplyScalar(o).add(t.start)}}(),intersectsLine:function(e){var t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0},intersectsBox:function(e){return e.intersectsPlane(this)},intersectsSphere:function(e){return e.intersectsPlane(this)},coplanarPoint:function(e){return(e||new b).copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(){var e=new b,t=new w;return function(n,r){var i=r||t.getNormalMatrix(n),a=this.coplanarPoint(e).applyMatrix4(n),o=this.normal.applyMatrix3(i).normalize();return this.constant=-a.dot(o),this}}(),translate:function(e){return this.constant-=e.dot(this.normal),this},equals:function(e){return e.normal.equals(this.normal)&&e.constant===this.constant}}),Object.assign(Le.prototype,{set:function(e,t,n,r,i,a){var o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(n),o[3].copy(r),o[4].copy(i),o[5].copy(a),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){for(var t=this.planes,n=0;n<6;n++)t[n].copy(e.planes[n]);return this},setFromMatrix:function(e){var t=this.planes,n=e.elements,r=n[0],i=n[1],a=n[2],o=n[3],s=n[4],c=n[5],l=n[6],u=n[7],h=n[8],d=n[9],p=n[10],f=n[11],m=n[12],g=n[13],y=n[14],v=n[15];return t[0].setComponents(o-r,u-s,f-h,v-m).normalize(),t[1].setComponents(o+r,u+s,f+h,v+m).normalize(),t[2].setComponents(o+i,u+c,f+d,v+g).normalize(),t[3].setComponents(o-i,u-c,f-d,v-g).normalize(),t[4].setComponents(o-a,u-l,f-p,v-y).normalize(),t[5].setComponents(o+a,u+l,f+p,v+y).normalize(),this},intersectsObject:(Me=new Ie,function(e){var t=e.geometry;return null===t.boundingSphere&&t.computeBoundingSphere(),Me.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(Me)}),intersectsSprite:function(){var e=new Ie;return function(t){return e.center.set(0,0,0),e.radius=.7071067811865476,e.applyMatrix4(t.matrixWorld),this.intersectsSphere(e)}}(),intersectsSphere:function(e){for(var t=this.planes,n=e.center,r=-e.radius,i=0;i<6;i++){if(t[i].distanceToPoint(n)<r)return!1}return!0},intersectsBox:(_e=new b,Se=new b,function(e){for(var t=this.planes,n=0;n<6;n++){var r=t[n];_e.x=r.normal.x>0?e.min.x:e.max.x,Se.x=r.normal.x>0?e.max.x:e.min.x,_e.y=r.normal.y>0?e.min.y:e.max.y,Se.y=r.normal.y>0?e.max.y:e.min.y,_e.z=r.normal.z>0?e.min.z:e.max.z,Se.z=r.normal.z>0?e.max.z:e.min.z;var i=r.distanceToPoint(_e),a=r.distanceToPoint(Se);if(i<0&&a<0)return!1}return!0}),containsPoint:function(e){for(var t=this.planes,n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}}),je.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"],je.DefaultOrder="XYZ",Object.defineProperties(je.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this.onChangeCallback()}},y:{get:function(){return this._y},set:function(e){this._y=e,this.onChangeCallback()}},z:{get:function(){return this._z},set:function(e){this._z=e,this.onChangeCallback()}},order:{get:function(){return this._order},set:function(e){this._order=e,this.onChangeCallback()}}}),Object.assign(je.prototype,{isEuler:!0,set:function(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._order=r||this._order,this.onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._order)},copy:function(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this.onChangeCallback(),this},setFromRotationMatrix:function(e,t,n){var r=m.clamp,i=e.elements,a=i[0],o=i[4],s=i[8],c=i[1],l=i[5],u=i[9],h=i[2],d=i[6],p=i[10];return"XYZ"===(t=t||this._order)?(this._y=Math.asin(r(s,-1,1)),Math.abs(s)<.99999?(this._x=Math.atan2(-u,p),this._z=Math.atan2(-o,a)):(this._x=Math.atan2(d,l),this._z=0)):"YXZ"===t?(this._x=Math.asin(-r(u,-1,1)),Math.abs(u)<.99999?(this._y=Math.atan2(s,p),this._z=Math.atan2(c,l)):(this._y=Math.atan2(-h,a),this._z=0)):"ZXY"===t?(this._x=Math.asin(r(d,-1,1)),Math.abs(d)<.99999?(this._y=Math.atan2(-h,p),this._z=Math.atan2(-o,l)):(this._y=0,this._z=Math.atan2(c,a))):"ZYX"===t?(this._y=Math.asin(-r(h,-1,1)),Math.abs(h)<.99999?(this._x=Math.atan2(d,p),this._z=Math.atan2(c,a)):(this._x=0,this._z=Math.atan2(-o,l))):"YZX"===t?(this._z=Math.asin(r(c,-1,1)),Math.abs(c)<.99999?(this._x=Math.atan2(-u,l),this._y=Math.atan2(-h,a)):(this._x=0,this._y=Math.atan2(s,p))):"XZY"===t?(this._z=Math.asin(-r(o,-1,1)),Math.abs(o)<.99999?(this._x=Math.atan2(d,l),this._y=Math.atan2(s,a)):(this._x=Math.atan2(-u,p),this._y=0)):console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+t),this._order=t,!1!==n&&this.onChangeCallback(),this},setFromQuaternion:function(){var e=new y;return function(t,n,r){return e.makeRotationFromQuaternion(t),this.setFromRotationMatrix(e,n,r)}}(),setFromVector3:function(e,t){return this.set(e.x,e.y,e.z,t||this._order)},reorder:(Te=new v,function(e){return Te.setFromEuler(this),this.setFromQuaternion(Te,e)}),equals:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order},fromArray:function(e){return this._x=e[0],this._y=e[1],this._z=e[2],void 0!==e[3]&&(this._order=e[3]),this.onChangeCallback(),this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e},toVector3:function(e){return e?e.set(this._x,this._y,this._z):new b(this._x,this._y,this._z)},onChange:function(e){return this.onChangeCallback=e,this},onChangeCallback:function(){}}),Object.assign(Ue.prototype,{set:function(e){this.mask=1<<e|0},enable:function(e){this.mask|=1<<e|0},toggle:function(e){this.mask^=1<<e|0},disable:function(e){this.mask&=~(1<<e|0)},test:function(e){return 0!=(this.mask&e.mask)}});var Be,Ve,ze,He,Ge=0;function qe(){Object.defineProperty(this,"id",{value:Ge++}),this.uuid=m.generateUUID(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=qe.DefaultUp.clone();var e=new b,t=new je,n=new v,r=new b(1,1,1);t.onChange((function(){n.setFromEuler(t,!1)})),n.onChange((function(){t.setFromQuaternion(n,void 0,!1)})),Object.defineProperties(this,{position:{enumerable:!0,value:e},rotation:{enumerable:!0,value:t},quaternion:{enumerable:!0,value:n},scale:{enumerable:!0,value:r},modelViewMatrix:{value:new y},normalMatrix:{value:new w}}),this.matrix=new y,this.matrixWorld=new y,this.matrixAutoUpdate=qe.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new Ue,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.userData={}}function We(){qe.call(this),this.type="Camera",this.matrixWorldInverse=new y,this.projectionMatrix=new y}function Je(e,t,n,r,i,a){We.call(this),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=r,this.near=void 0!==i?i:.1,this.far=void 0!==a?a:2e3,this.updateProjectionMatrix()}function Ze(e,t,n,r,i,a){this.a=e,this.b=t,this.c=n,this.normal=r&&r.isVector3?r:new b,this.vertexNormals=Array.isArray(r)?r:[],this.color=i&&i.isColor?i:new fe,this.vertexColors=Array.isArray(i)?i:[],this.materialIndex=void 0!==a?a:0}qe.DefaultUp=new b(0,1,0),qe.DefaultMatrixAutoUpdate=!0,qe.prototype=Object.assign(Object.create(a.prototype),{constructor:qe,isObject3D:!0,onBeforeRender:function(){},onAfterRender:function(){},applyMatrix:function(e){this.matrix.multiplyMatrices(e,this.matrix),this.matrix.decompose(this.position,this.quaternion,this.scale)},applyQuaternion:function(e){return this.quaternion.premultiply(e),this},setRotationFromAxisAngle:function(e,t){this.quaternion.setFromAxisAngle(e,t)},setRotationFromEuler:function(e){this.quaternion.setFromEuler(e,!0)},setRotationFromMatrix:function(e){this.quaternion.setFromRotationMatrix(e)},setRotationFromQuaternion:function(e){this.quaternion.copy(e)},rotateOnAxis:(He=new v,function(e,t){return He.setFromAxisAngle(e,t),this.quaternion.multiply(He),this}),rotateOnWorldAxis:function(){var e=new v;return function(t,n){return e.setFromAxisAngle(t,n),this.quaternion.premultiply(e),this}}(),rotateX:function(){var e=new b(1,0,0);return function(t){return this.rotateOnAxis(e,t)}}(),rotateY:function(){var e=new b(0,1,0);return function(t){return this.rotateOnAxis(e,t)}}(),rotateZ:function(){var e=new b(0,0,1);return function(t){return this.rotateOnAxis(e,t)}}(),translateOnAxis:function(){var e=new b;return function(t,n){return e.copy(t).applyQuaternion(this.quaternion),this.position.add(e.multiplyScalar(n)),this}}(),translateX:function(){var e=new b(1,0,0);return function(t){return this.translateOnAxis(e,t)}}(),translateY:function(){var e=new b(0,1,0);return function(t){return this.translateOnAxis(e,t)}}(),translateZ:function(){var e=new b(0,0,1);return function(t){return this.translateOnAxis(e,t)}}(),localToWorld:function(e){return e.applyMatrix4(this.matrixWorld)},worldToLocal:(ze=new y,function(e){return e.applyMatrix4(ze.getInverse(this.matrixWorld))}),lookAt:function(){var e=new y,t=new b;return function(n,r,i){n.isVector3?t.copy(n):t.set(n,r,i),this.isCamera?e.lookAt(this.position,t,this.up):e.lookAt(t,this.position,this.up),this.quaternion.setFromRotationMatrix(e)}}(),add:function(e){if(arguments.length>1){for(var t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(null!==e.parent&&e.parent.remove(e),e.parent=this,e.dispatchEvent({type:"added"}),this.children.push(e)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)},remove:function(e){if(arguments.length>1){for(var t=0;t<arguments.length;t++)this.remove(arguments[t]);return this}var n=this.children.indexOf(e);return-1!==n&&(e.parent=null,e.dispatchEvent({type:"removed"}),this.children.splice(n,1)),this},getObjectById:function(e){return this.getObjectByProperty("id",e)},getObjectByName:function(e){return this.getObjectByProperty("name",e)},getObjectByProperty:function(e,t){if(this[e]===t)return this;for(var n=0,r=this.children.length;n<r;n++){var i=this.children[n].getObjectByProperty(e,t);if(void 0!==i)return i}},getWorldPosition:function(e){var t=e||new b;return this.updateMatrixWorld(!0),t.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:(Be=new b,Ve=new b,function(e){var t=e||new v;return this.updateMatrixWorld(!0),this.matrixWorld.decompose(Be,t,Ve),t}),getWorldRotation:function(){var e=new v;return function(t){var n=t||new je;return this.getWorldQuaternion(e),n.setFromQuaternion(e,this.rotation.order,!1)}}(),getWorldScale:function(){var e=new b,t=new v;return function(n){var r=n||new b;return this.updateMatrixWorld(!0),this.matrixWorld.decompose(e,t,r),r}}(),getWorldDirection:function(){var e=new v;return function(t){var n=t||new b;return this.getWorldQuaternion(e),n.set(0,0,1).applyQuaternion(e)}}(),raycast:function(){},traverse:function(e){e(this);for(var t=this.children,n=0,r=t.length;n<r;n++)t[n].traverse(e)},traverseVisible:function(e){if(!1!==this.visible){e(this);for(var t=this.children,n=0,r=t.length;n<r;n++)t[n].traverseVisible(e)}},traverseAncestors:function(e){var t=this.parent;null!==t&&(e(t),t.traverseAncestors(e))},updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,e=!0);for(var t=this.children,n=0,r=t.length;n<r;n++)t[n].updateMatrixWorld(e)},toJSON:function(e){var t=void 0===e||"string"==typeof e,n={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{}},n.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});var r={};function i(t,n){return void 0===t[n.uuid]&&(t[n.uuid]=n.toJSON(e)),n.uuid}if(r.uuid=this.uuid,r.type=this.type,""!==this.name&&(r.name=this.name),!0===this.castShadow&&(r.castShadow=!0),!0===this.receiveShadow&&(r.receiveShadow=!0),!1===this.visible&&(r.visible=!1),"{}"!==JSON.stringify(this.userData)&&(r.userData=this.userData),r.matrix=this.matrix.toArray(),void 0!==this.geometry){r.geometry=i(e.geometries,this.geometry);var a=this.geometry.parameters;if(void 0!==a&&void 0!==a.shapes){var o=a.shapes;if(Array.isArray(o))for(var s=0,c=o.length;s<c;s++){var l=o[s];i(e.shapes,l)}else i(e.shapes,o)}}if(void 0!==this.material)if(Array.isArray(this.material)){var u=[];for(s=0,c=this.material.length;s<c;s++)u.push(i(e.materials,this.material[s]));r.material=u}else r.material=i(e.materials,this.material);if(this.children.length>0){r.children=[];for(s=0;s<this.children.length;s++)r.children.push(this.children[s].toJSON(e).object)}if(t){var h=m(e.geometries),d=m(e.materials),p=m(e.textures),f=m(e.images);o=m(e.shapes);h.length>0&&(n.geometries=h),d.length>0&&(n.materials=d),p.length>0&&(n.textures=p),f.length>0&&(n.images=f),o.length>0&&(n.shapes=o)}return n.object=r,n;function m(e){var t=[];for(var n in e){var r=e[n];delete r.metadata,t.push(r)}return t}},clone:function(e){return(new this.constructor).copy(this,e)},copy:function(e,t){if(void 0===t&&(t=!0),this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),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)),!0===t)for(var n=0;n<e.children.length;n++){var r=e.children[n];this.add(r.clone())}return this}}),We.prototype=Object.assign(Object.create(qe.prototype),{constructor:We,isCamera:!0,copy:function(e,t){return qe.prototype.copy.call(this,e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this},getWorldDirection:function(){var e=new v;return function(t){var n=t||new b;return this.getWorldQuaternion(e),n.set(0,0,-1).applyQuaternion(e)}}(),updateMatrixWorld:function(e){qe.prototype.updateMatrixWorld.call(this,e),this.matrixWorldInverse.getInverse(this.matrixWorld)},clone:function(){return(new this.constructor).copy(this)}}),Je.prototype=Object.assign(Object.create(We.prototype),{constructor:Je,isOrthographicCamera:!0,copy:function(e,t){return We.prototype.copy.call(this,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=null===e.view?null:Object.assign({},e.view),this},setViewOffset:function(e,t,n,r,i,a){null===this.view&&(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=r,this.view.width=i,this.view.height=a,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,r=(this.top+this.bottom)/2,i=n-e,a=n+e,o=r+t,s=r-t;if(null!==this.view&&this.view.enabled){var c=this.zoom/(this.view.width/this.view.fullWidth),l=this.zoom/(this.view.height/this.view.fullHeight),u=(this.right-this.left)/this.view.width,h=(this.top-this.bottom)/this.view.height;a=(i+=u*(this.view.offsetX/c))+u*(this.view.width/c),s=(o-=h*(this.view.offsetY/l))-h*(this.view.height/l)}this.projectionMatrix.makeOrthographic(i,a,o,s,this.near,this.far)},toJSON:function(e){var t=qe.prototype.toJSON.call(this,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,null!==this.view&&(t.object.view=Object.assign({},this.view)),t}}),Object.assign(Ze.prototype,{clone:function(){return(new this.constructor).copy(this)},copy:function(e){this.a=e.a,this.b=e.b,this.c=e.c,this.normal.copy(e.normal),this.color.copy(e.color),this.materialIndex=e.materialIndex;for(var t=0,n=e.vertexNormals.length;t<n;t++)this.vertexNormals[t]=e.vertexNormals[t].clone();for(t=0,n=e.vertexColors.length;t<n;t++)this.vertexColors[t]=e.vertexColors[t].clone();return this}});var Xe,Ye=0;function Ke(){Object.defineProperty(this,"id",{value:Ye+=2}),this.uuid=m.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}function Qe(e,t,n){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.uuid=m.generateUUID(),this.name="",this.array=e,this.itemSize=t,this.count=void 0!==e?e.length/t:0,this.normalized=!0===n,this.dynamic=!1,this.updateRange={offset:0,count:-1},this.onUploadCallback=function(){},this.version=0}function $e(e,t,n){Qe.call(this,new Int8Array(e),t,n)}function et(e,t,n){Qe.call(this,new Uint8Array(e),t,n)}function tt(e,t,n){Qe.call(this,new Uint8ClampedArray(e),t,n)}function nt(e,t,n){Qe.call(this,new Int16Array(e),t,n)}function rt(e,t,n){Qe.call(this,new Uint16Array(e),t,n)}function it(e,t,n){Qe.call(this,new Int32Array(e),t,n)}function at(e,t,n){Qe.call(this,new Uint32Array(e),t,n)}function ot(e,t,n){Qe.call(this,new Float32Array(e),t,n)}function st(e,t,n){Qe.call(this,new Float64Array(e),t,n)}function ct(){this.indices=[],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}function lt(e){if(0===e.length)return-1/0;for(var t=e[0],n=1,r=e.length;n<r;++n)e[n]>t&&(t=e[n]);return t}Ke.prototype=Object.assign(Object.create(a.prototype),{constructor:Ke,isGeometry:!0,applyMatrix:function(e){for(var t=(new w).getNormalMatrix(e),n=0,r=this.vertices.length;n<r;n++){this.vertices[n].applyMatrix4(e)}for(n=0,r=this.faces.length;n<r;n++){var i=this.faces[n];i.normal.applyMatrix3(t).normalize();for(var a=0,o=i.vertexNormals.length;a<o;a++)i.vertexNormals[a].applyMatrix3(t).normalize()}return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this.verticesNeedUpdate=!0,this.normalsNeedUpdate=!0,this},rotateX:function(){var e=new y;return function(t){return e.makeRotationX(t),this.applyMatrix(e),this}}(),rotateY:function(){var e=new y;return function(t){return e.makeRotationY(t),this.applyMatrix(e),this}}(),rotateZ:function(){var e=new y;return function(t){return e.makeRotationZ(t),this.applyMatrix(e),this}}(),translate:function(){var e=new y;return function(t,n,r){return e.makeTranslation(t,n,r),this.applyMatrix(e),this}}(),scale:function(){var e=new y;return function(t,n,r){return e.makeScale(t,n,r),this.applyMatrix(e),this}}(),lookAt:(Xe=new qe,function(e){Xe.lookAt(e),Xe.updateMatrix(),this.applyMatrix(Xe.matrix)}),fromBufferGeometry:function(e){var t=this,n=null!==e.index?e.index.array:void 0,r=e.attributes,i=r.position.array,a=void 0!==r.normal?r.normal.array:void 0,o=void 0!==r.color?r.color.array:void 0,s=void 0!==r.uv?r.uv.array:void 0,c=void 0!==r.uv2?r.uv2.array:void 0;void 0!==c&&(this.faceVertexUvs[1]=[]);for(var l=[],u=[],h=[],d=0,p=0;d<i.length;d+=3,p+=2)t.vertices.push(new b(i[d],i[d+1],i[d+2])),void 0!==a&&l.push(new b(a[d],a[d+1],a[d+2])),void 0!==o&&t.colors.push(new fe(o[d],o[d+1],o[d+2])),void 0!==s&&u.push(new g(s[p],s[p+1])),void 0!==c&&h.push(new g(c[p],c[p+1]));function f(e,n,r,i){var d=new Ze(e,n,r,void 0!==a?[l[e].clone(),l[n].clone(),l[r].clone()]:[],void 0!==o?[t.colors[e].clone(),t.colors[n].clone(),t.colors[r].clone()]:[],i);t.faces.push(d),void 0!==s&&t.faceVertexUvs[0].push([u[e].clone(),u[n].clone(),u[r].clone()]),void 0!==c&&t.faceVertexUvs[1].push([h[e].clone(),h[n].clone(),h[r].clone()])}var m=e.groups;if(m.length>0)for(d=0;d<m.length;d++)for(var y=m[d],v=y.start,w=(p=v,v+y.count);p<w;p+=3)void 0!==n?f(n[p],n[p+1],n[p+2],y.materialIndex):f(p,p+1,p+2,y.materialIndex);else if(void 0!==n)for(d=0;d<n.length;d+=3)f(n[d],n[d+1],n[d+2]);else for(d=0;d<i.length/3;d+=3)f(d,d+1,d+2);return this.computeFaceNormals(),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),this},center:function(){this.computeBoundingBox();var e=this.boundingBox.getCenter().negate();return this.translate(e.x,e.y,e.z),e},normalize:function(){this.computeBoundingSphere();var e=this.boundingSphere.center,t=this.boundingSphere.radius,n=0===t?1:1/t,r=new y;return r.set(n,0,0,-n*e.x,0,n,0,-n*e.y,0,0,n,-n*e.z,0,0,0,1),this.applyMatrix(r),this},computeFaceNormals:function(){for(var e=new b,t=new b,n=0,r=this.faces.length;n<r;n++){var i=this.faces[n],a=this.vertices[i.a],o=this.vertices[i.b],s=this.vertices[i.c];e.subVectors(s,o),t.subVectors(a,o),e.cross(t),e.normalize(),i.normal.copy(e)}},computeVertexNormals:function(e){var t,n,r,i,a,o;for(void 0===e&&(e=!0),o=new Array(this.vertices.length),t=0,n=this.vertices.length;t<n;t++)o[t]=new b;if(e){var s,c,l,u=new b,h=new b;for(r=0,i=this.faces.length;r<i;r++)a=this.faces[r],s=this.vertices[a.a],c=this.vertices[a.b],l=this.vertices[a.c],u.subVectors(l,c),h.subVectors(s,c),u.cross(h),o[a.a].add(u),o[a.b].add(u),o[a.c].add(u)}else for(this.computeFaceNormals(),r=0,i=this.faces.length;r<i;r++)o[(a=this.faces[r]).a].add(a.normal),o[a.b].add(a.normal),o[a.c].add(a.normal);for(t=0,n=this.vertices.length;t<n;t++)o[t].normalize();for(r=0,i=this.faces.length;r<i;r++){var d=(a=this.faces[r]).vertexNormals;3===d.length?(d[0].copy(o[a.a]),d[1].copy(o[a.b]),d[2].copy(o[a.c])):(d[0]=o[a.a].clone(),d[1]=o[a.b].clone(),d[2]=o[a.c].clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)},computeFlatVertexNormals:function(){var e,t,n;for(this.computeFaceNormals(),e=0,t=this.faces.length;e<t;e++){var r=(n=this.faces[e]).vertexNormals;3===r.length?(r[0].copy(n.normal),r[1].copy(n.normal),r[2].copy(n.normal)):(r[0]=n.normal.clone(),r[1]=n.normal.clone(),r[2]=n.normal.clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){var e,t,n,r,i;for(n=0,r=this.faces.length;n<r;n++)for((i=this.faces[n]).__originalFaceNormal?i.__originalFaceNormal.copy(i.normal):i.__originalFaceNormal=i.normal.clone(),i.__originalVertexNormals||(i.__originalVertexNormals=[]),e=0,t=i.vertexNormals.length;e<t;e++)i.__originalVertexNormals[e]?i.__originalVertexNormals[e].copy(i.vertexNormals[e]):i.__originalVertexNormals[e]=i.vertexNormals[e].clone();var a=new Ke;for(a.faces=this.faces,e=0,t=this.morphTargets.length;e<t;e++){if(!this.morphNormals[e]){this.morphNormals[e]={},this.morphNormals[e].faceNormals=[],this.morphNormals[e].vertexNormals=[];var o=this.morphNormals[e].faceNormals,s=this.morphNormals[e].vertexNormals;for(n=0,r=this.faces.length;n<r;n++)c=new b,l={a:new b,b:new b,c:new b},o.push(c),s.push(l)}var c,l,u=this.morphNormals[e];for(a.vertices=this.morphTargets[e].vertices,a.computeFaceNormals(),a.computeVertexNormals(),n=0,r=this.faces.length;n<r;n++)i=this.faces[n],c=u.faceNormals[n],l=u.vertexNormals[n],c.copy(i.normal),l.a.copy(i.vertexNormals[0]),l.b.copy(i.vertexNormals[1]),l.c.copy(i.vertexNormals[2])}for(n=0,r=this.faces.length;n<r;n++)(i=this.faces[n]).normal=i.__originalFaceNormal,i.vertexNormals=i.__originalVertexNormals},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new Pe),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new Ie),this.boundingSphere.setFromPoints(this.vertices)},merge:function(e,t,n){if(e&&e.isGeometry){var r,i=this.vertices.length,a=this.vertices,o=e.vertices,s=this.faces,c=e.faces,l=this.faceVertexUvs[0],u=e.faceVertexUvs[0],h=this.colors,d=e.colors;void 0===n&&(n=0),void 0!==t&&(r=(new w).getNormalMatrix(t));for(var p=0,f=o.length;p<f;p++){var m=o[p].clone();void 0!==t&&m.applyMatrix4(t),a.push(m)}for(p=0,f=d.length;p<f;p++)h.push(d[p].clone());for(p=0,f=c.length;p<f;p++){var g,y,v,b=c[p],A=b.vertexNormals,E=b.vertexColors;(g=new Ze(b.a+i,b.b+i,b.c+i)).normal.copy(b.normal),void 0!==r&&g.normal.applyMatrix3(r).normalize();for(var x=0,_=A.length;x<_;x++)y=A[x].clone(),void 0!==r&&y.applyMatrix3(r).normalize(),g.vertexNormals.push(y);g.color.copy(b.color);for(x=0,_=E.length;x<_;x++)v=E[x],g.vertexColors.push(v.clone());g.materialIndex=b.materialIndex+n,s.push(g)}for(p=0,f=u.length;p<f;p++){var S=u[p],M=[];if(void 0!==S){for(x=0,_=S.length;x<_;x++)M.push(S[x].clone());l.push(M)}}}else console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",e)},mergeMesh:function(e){e&&e.isMesh?(e.matrixAutoUpdate&&e.updateMatrix(),this.merge(e.geometry,e.matrix)):console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",e)},mergeVertices:function(){var e,t,n,r,i,a,o,s,c={},l=[],u=[],h=Math.pow(10,4);for(n=0,r=this.vertices.length;n<r;n++)e=this.vertices[n],void 0===c[t=Math.round(e.x*h)+"_"+Math.round(e.y*h)+"_"+Math.round(e.z*h)]?(c[t]=n,l.push(this.vertices[n]),u[n]=l.length-1):u[n]=u[c[t]];var d=[];for(n=0,r=this.faces.length;n<r;n++){(i=this.faces[n]).a=u[i.a],i.b=u[i.b],i.c=u[i.c],a=[i.a,i.b,i.c];for(var p=0;p<3;p++)if(a[p]===a[(p+1)%3]){d.push(n);break}}for(n=d.length-1;n>=0;n--){var f=d[n];for(this.faces.splice(f,1),o=0,s=this.faceVertexUvs.length;o<s;o++)this.faceVertexUvs[o].splice(f,1)}var m=this.vertices.length-l.length;return this.vertices=l,m},setFromPoints:function(e){this.vertices=[];for(var t=0,n=e.length;t<n;t++){var r=e[t];this.vertices.push(new b(r.x,r.y,r.z||0))}return this},sortFacesByMaterialIndex:function(){for(var e=this.faces,t=e.length,n=0;n<t;n++)e[n]._id=n;e.sort((function(e,t){return e.materialIndex-t.materialIndex}));var r,i,a=this.faceVertexUvs[0],o=this.faceVertexUvs[1];a&&a.length===t&&(r=[]),o&&o.length===t&&(i=[]);for(n=0;n<t;n++){var s=e[n]._id;r&&r.push(a[s]),i&&i.push(o[s])}r&&(this.faceVertexUvs[0]=r),i&&(this.faceVertexUvs[1]=i)},toJSON:function(){var e={metadata:{version:4.5,type:"Geometry",generator:"Geometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,""!==this.name&&(e.name=this.name),void 0!==this.parameters){var t=this.parameters;for(var n in t)void 0!==t[n]&&(e[n]=t[n]);return e}for(var r=[],i=0;i<this.vertices.length;i++){var a=this.vertices[i];r.push(a.x,a.y,a.z)}var o=[],s=[],c={},l=[],u={},h=[],d={};for(i=0;i<this.faces.length;i++){var p=this.faces[i],f=void 0!==this.faceVertexUvs[0][i],m=p.normal.length()>0,g=p.vertexNormals.length>0,y=1!==p.color.r||1!==p.color.g||1!==p.color.b,v=p.vertexColors.length>0,b=0;if(b=x(b,0,0),b=x(b,1,!0),b=x(b,2,!1),b=x(b,3,f),b=x(b,4,m),b=x(b,5,g),b=x(b,6,y),b=x(b,7,v),o.push(b),o.push(p.a,p.b,p.c),o.push(p.materialIndex),f){var w=this.faceVertexUvs[0][i];o.push(M(w[0]),M(w[1]),M(w[2]))}if(m&&o.push(_(p.normal)),g){var A=p.vertexNormals;o.push(_(A[0]),_(A[1]),_(A[2]))}if(y&&o.push(S(p.color)),v){var E=p.vertexColors;o.push(S(E[0]),S(E[1]),S(E[2]))}}function x(e,t,n){return n?e|1<<t:e&~(1<<t)}function _(e){var t=e.x.toString()+e.y.toString()+e.z.toString();return void 0!==c[t]||(c[t]=s.length/3,s.push(e.x,e.y,e.z)),c[t]}function S(e){var t=e.r.toString()+e.g.toString()+e.b.toString();return void 0!==u[t]||(u[t]=l.length,l.push(e.getHex())),u[t]}function M(e){var t=e.x.toString()+e.y.toString();return void 0!==d[t]||(d[t]=h.length/2,h.push(e.x,e.y)),d[t]}return e.data={},e.data.vertices=r,e.data.normals=s,l.length>0&&(e.data.colors=l),h.length>0&&(e.data.uvs=[h]),e.data.faces=o,e},clone:function(){return(new Ke).copy(this)},copy:function(e){var t,n,r,i,a,o;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;var s=e.vertices;for(t=0,n=s.length;t<n;t++)this.vertices.push(s[t].clone());var c=e.colors;for(t=0,n=c.length;t<n;t++)this.colors.push(c[t].clone());var l=e.faces;for(t=0,n=l.length;t<n;t++)this.faces.push(l[t].clone());for(t=0,n=e.faceVertexUvs.length;t<n;t++){var u=e.faceVertexUvs[t];for(void 0===this.faceVertexUvs[t]&&(this.faceVertexUvs[t]=[]),r=0,i=u.length;r<i;r++){var h=u[r],d=[];for(a=0,o=h.length;a<o;a++){var p=h[a];d.push(p.clone())}this.faceVertexUvs[t].push(d)}}var f=e.morphTargets;for(t=0,n=f.length;t<n;t++){var m={};if(m.name=f[t].name,void 0!==f[t].vertices)for(m.vertices=[],r=0,i=f[t].vertices.length;r<i;r++)m.vertices.push(f[t].vertices[r].clone());if(void 0!==f[t].normals)for(m.normals=[],r=0,i=f[t].normals.length;r<i;r++)m.normals.push(f[t].normals[r].clone());this.morphTargets.push(m)}var g=e.morphNormals;for(t=0,n=g.length;t<n;t++){var y={};if(void 0!==g[t].vertexNormals)for(y.vertexNormals=[],r=0,i=g[t].vertexNormals.length;r<i;r++){var v=g[t].vertexNormals[r],b={};b.a=v.a.clone(),b.b=v.b.clone(),b.c=v.c.clone(),y.vertexNormals.push(b)}if(void 0!==g[t].faceNormals)for(y.faceNormals=[],r=0,i=g[t].faceNormals.length;r<i;r++)y.faceNormals.push(g[t].faceNormals[r].clone());this.morphNormals.push(y)}var w=e.skinWeights;for(t=0,n=w.length;t<n;t++)this.skinWeights.push(w[t].clone());var A=e.skinIndices;for(t=0,n=A.length;t<n;t++)this.skinIndices.push(A[t].clone());var E=e.lineDistances;for(t=0,n=E.length;t<n;t++)this.lineDistances.push(E[t]);var x=e.boundingBox;null!==x&&(this.boundingBox=x.clone());var _=e.boundingSphere;return null!==_&&(this.boundingSphere=_.clone()),this.elementsNeedUpdate=e.elementsNeedUpdate,this.verticesNeedUpdate=e.verticesNeedUpdate,this.uvsNeedUpdate=e.uvsNeedUpdate,this.normalsNeedUpdate=e.normalsNeedUpdate,this.colorsNeedUpdate=e.colorsNeedUpdate,this.lineDistancesNeedUpdate=e.lineDistancesNeedUpdate,this.groupsNeedUpdate=e.groupsNeedUpdate,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Object.defineProperty(Qe.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),Object.assign(Qe.prototype,{isBufferAttribute:!0,setArray:function(e){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.count=void 0!==e?e.length/this.itemSize:0,this.array=e},setDynamic:function(e){return this.dynamic=e,this},copy:function(e){return this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.dynamic=e.dynamic,this},copyAt:function(e,t,n){e*=this.itemSize,n*=t.itemSize;for(var r=0,i=this.itemSize;r<i;r++)this.array[e+r]=t.array[n+r];return this},copyArray:function(e){return this.array.set(e),this},copyColorsArray:function(e){for(var t=this.array,n=0,r=0,i=e.length;r<i;r++){var a=e[r];void 0===a&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",r),a=new fe),t[n++]=a.r,t[n++]=a.g,t[n++]=a.b}return this},copyIndicesArray:function(e){for(var t=this.array,n=0,r=0,i=e.length;r<i;r++){var a=e[r];t[n++]=a.a,t[n++]=a.b,t[n++]=a.c}return this},copyVector2sArray:function(e){for(var t=this.array,n=0,r=0,i=e.length;r<i;r++){var a=e[r];void 0===a&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",r),a=new g),t[n++]=a.x,t[n++]=a.y}return this},copyVector3sArray:function(e){for(var t=this.array,n=0,r=0,i=e.length;r<i;r++){var a=e[r];void 0===a&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",r),a=new b),t[n++]=a.x,t[n++]=a.y,t[n++]=a.z}return this},copyVector4sArray:function(e){for(var t=this.array,n=0,r=0,i=e.length;r<i;r++){var a=e[r];void 0===a&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",r),a=new x),t[n++]=a.x,t[n++]=a.y,t[n++]=a.z,t[n++]=a.w}return this},set:function(e,t){return void 0===t&&(t=0),this.array.set(e,t),this},getX:function(e){return this.array[e*this.itemSize]},setX:function(e,t){return this.array[e*this.itemSize]=t,this},getY:function(e){return this.array[e*this.itemSize+1]},setY:function(e,t){return this.array[e*this.itemSize+1]=t,this},getZ:function(e){return this.array[e*this.itemSize+2]},setZ:function(e,t){return this.array[e*this.itemSize+2]=t,this},getW:function(e){return this.array[e*this.itemSize+3]},setW:function(e,t){return this.array[e*this.itemSize+3]=t,this},setXY:function(e,t,n){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this},setXYZ:function(e,t,n,r){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this},setXYZW:function(e,t,n,r,i){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this.array[e+3]=i,this},onUpload:function(e){return this.onUploadCallback=e,this},clone:function(){return new this.constructor(this.array,this.itemSize).copy(this)}}),$e.prototype=Object.create(Qe.prototype),$e.prototype.constructor=$e,et.prototype=Object.create(Qe.prototype),et.prototype.constructor=et,tt.prototype=Object.create(Qe.prototype),tt.prototype.constructor=tt,nt.prototype=Object.create(Qe.prototype),nt.prototype.constructor=nt,rt.prototype=Object.create(Qe.prototype),rt.prototype.constructor=rt,it.prototype=Object.create(Qe.prototype),it.prototype.constructor=it,at.prototype=Object.create(Qe.prototype),at.prototype.constructor=at,ot.prototype=Object.create(Qe.prototype),ot.prototype.constructor=ot,st.prototype=Object.create(Qe.prototype),st.prototype.constructor=st,Object.assign(ct.prototype,{computeGroups:function(e){for(var t,n=[],r=void 0,i=e.faces,a=0;a<i.length;a++){var o=i[a];o.materialIndex!==r&&(r=o.materialIndex,void 0!==t&&(t.count=3*a-t.start,n.push(t)),t={start:3*a,materialIndex:r})}void 0!==t&&(t.count=3*a-t.start,n.push(t)),this.groups=n},fromGeometry:function(e){var t,n=e.faces,r=e.vertices,i=e.faceVertexUvs,a=i[0]&&i[0].length>0,o=i[1]&&i[1].length>0,s=e.morphTargets,c=s.length;if(c>0){t=[];for(var l=0;l<c;l++)t[l]=[];this.morphTargets.position=t}var u,h=e.morphNormals,d=h.length;if(d>0){u=[];for(l=0;l<d;l++)u[l]=[];this.morphTargets.normal=u}var p=e.skinIndices,f=e.skinWeights,m=p.length===r.length,y=f.length===r.length;for(l=0;l<n.length;l++){var v=n[l];this.vertices.push(r[v.a],r[v.b],r[v.c]);var b=v.vertexNormals;if(3===b.length)this.normals.push(b[0],b[1],b[2]);else{var w=v.normal;this.normals.push(w,w,w)}var A,E=v.vertexColors;if(3===E.length)this.colors.push(E[0],E[1],E[2]);else{var x=v.color;this.colors.push(x,x,x)}if(!0===a)void 0!==(A=i[0][l])?this.uvs.push(A[0],A[1],A[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",l),this.uvs.push(new g,new g,new g));if(!0===o)void 0!==(A=i[1][l])?this.uvs2.push(A[0],A[1],A[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",l),this.uvs2.push(new g,new g,new g));for(var _=0;_<c;_++){var S=s[_].vertices;t[_].push(S[v.a],S[v.b],S[v.c])}for(_=0;_<d;_++){var M=h[_].vertexNormals[l];u[_].push(M.a,M.b,M.c)}m&&this.skinIndices.push(p[v.a],p[v.b],p[v.c]),y&&this.skinWeights.push(f[v.a],f[v.b],f[v.c])}return this.computeGroups(e),this.verticesNeedUpdate=e.verticesNeedUpdate,this.normalsNeedUpdate=e.normalsNeedUpdate,this.colorsNeedUpdate=e.colorsNeedUpdate,this.uvsNeedUpdate=e.uvsNeedUpdate,this.groupsNeedUpdate=e.groupsNeedUpdate,this}});var ut,ht,dt,pt,ft,mt,gt,yt=1;function vt(){Object.defineProperty(this,"id",{value:yt+=2}),this.uuid=m.generateUUID(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0}}function bt(e,t,n,r,i,a){Ke.call(this),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:r,heightSegments:i,depthSegments:a},this.fromBufferGeometry(new wt(e,t,n,r,i,a)),this.mergeVertices()}function wt(e,t,n,r,i,a){vt.call(this),this.type="BoxBufferGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:r,heightSegments:i,depthSegments:a};var o=this;e=e||1,t=t||1,n=n||1,r=Math.floor(r)||1,i=Math.floor(i)||1,a=Math.floor(a)||1;var s=[],c=[],l=[],u=[],h=0,d=0;function p(e,t,n,r,i,a,p,f,m,g,y){var v,w,A=a/m,E=p/g,x=a/2,_=p/2,S=f/2,M=m+1,T=g+1,R=0,k=0,C=new b;for(w=0;w<T;w++){var O=w*E-_;for(v=0;v<M;v++){var P=v*A-x;C[e]=P*r,C[t]=O*i,C[n]=S,c.push(C.x,C.y,C.z),C[e]=0,C[t]=0,C[n]=f>0?1:-1,l.push(C.x,C.y,C.z),u.push(v/m),u.push(1-w/g),R+=1}}for(w=0;w<g;w++)for(v=0;v<m;v++){var I=h+v+M*w,N=h+v+M*(w+1),L=h+(v+1)+M*(w+1),D=h+(v+1)+M*w;s.push(I,N,D),s.push(N,L,D),k+=6}o.addGroup(d,k,y),d+=k,h+=R}p("z","y","x",-1,-1,n,t,e,a,i,0),p("z","y","x",1,-1,n,t,-e,a,i,1),p("x","z","y",1,1,e,n,t,r,a,2),p("x","z","y",1,-1,e,n,-t,r,a,3),p("x","y","z",1,-1,e,t,n,r,i,4),p("x","y","z",-1,-1,e,t,-n,r,i,5),this.setIndex(s),this.addAttribute("position",new ot(c,3)),this.addAttribute("normal",new ot(l,3)),this.addAttribute("uv",new ot(u,2))}function At(e,t,n,r){Ke.call(this),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:r},this.fromBufferGeometry(new Et(e,t,n,r)),this.mergeVertices()}function Et(e,t,n,r){vt.call(this),this.type="PlaneBufferGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:r};var i,a,o=(e=e||1)/2,s=(t=t||1)/2,c=Math.floor(n)||1,l=Math.floor(r)||1,u=c+1,h=l+1,d=e/c,p=t/l,f=[],m=[],g=[],y=[];for(a=0;a<h;a++){var v=a*p-s;for(i=0;i<u;i++){var b=i*d-o;m.push(b,-v,0),g.push(0,0,1),y.push(i/c),y.push(1-a/l)}}for(a=0;a<l;a++)for(i=0;i<c;i++){var w=i+u*a,A=i+u*(a+1),E=i+1+u*(a+1),x=i+1+u*a;f.push(w,A,x),f.push(A,E,x)}this.setIndex(f),this.addAttribute("position",new ot(m,3)),this.addAttribute("normal",new ot(g,3)),this.addAttribute("uv",new ot(y,2))}function xt(e){ke.call(this),this.type="MeshBasicMaterial",this.color=new fe(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.lights=!1,this.setValues(e)}function _t(e){ke.call(this),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,void 0!==e&&(void 0!==e.attributes&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(e))}function St(e,t){this.origin=void 0!==e?e:new b,this.direction=void 0!==t?t:new b}function Mt(e,t){this.start=void 0!==e?e:new b,this.end=void 0!==t?t:new b}function Tt(e,t,n){this.a=void 0!==e?e:new b,this.b=void 0!==t?t:new b,this.c=void 0!==n?n:new b}function Rt(e,t){qe.call(this),this.type="Mesh",this.geometry=void 0!==e?e:new vt,this.material=void 0!==t?t:new xt({color:16777215*Math.random()}),this.drawMode=0,this.updateMorphTargets()}function kt(e,t,n,r){var i,a,o,s=new fe(0),c=0;function l(e,n){t.buffers.color.setClear(e.r,e.g,e.b,n,r)}return{getClearColor:function(){return s},setClearColor:function(e,t){s.set(e),l(s,c=void 0!==t?t:1)},getClearAlpha:function(){return c},setClearAlpha:function(e){l(s,c=e)},render:function(t,r,u,h){var d=r.background;null===d?l(s,c):d&&d.isColor&&(l(d,1),h=!0),(e.autoClear||h)&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),d&&d.isCubeTexture?(void 0===o&&((o=new Rt(new wt(1,1,1),new _t({uniforms:ve.cube.uniforms,vertexShader:ve.cube.vertexShader,fragmentShader:ve.cube.fragmentShader,side:1,depthTest:!0,depthWrite:!1,fog:!1}))).geometry.removeAttribute("normal"),o.geometry.removeAttribute("uv"),o.onBeforeRender=function(e,t,n){this.matrixWorld.copyPosition(n.matrixWorld)},n.update(o.geometry)),o.material.uniforms.tCube.value=d,t.push(o,o.geometry,o.material,0,null)):d&&d.isTexture&&(void 0===i&&(i=new Je(-1,1,1,-1,0,1),a=new Rt(new Et(2,2),new xt({depthTest:!1,depthWrite:!1,fog:!1})),n.update(a.geometry)),a.material.map=d,e.renderBufferDirect(i,null,a.geometry,a.material,a,null))}}}function Ct(e,t){return e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.program&&t.program&&e.program!==t.program?e.program.id-t.program.id:e.material.id!==t.material.id?e.material.id-t.material.id:e.z!==t.z?e.z-t.z:e.id-t.id}function Ot(e,t){return e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.z!==t.z?t.z-e.z:e.id-t.id}function Pt(){var e=[],t=0,n=[],r=[];return{opaque:n,transparent:r,init:function(){t=0,n.length=0,r.length=0},push:function(i,a,o,s,c){var l=e[t];void 0===l?(l={id:i.id,object:i,geometry:a,material:o,program:o.program,renderOrder:i.renderOrder,z:s,group:c},e[t]=l):(l.id=i.id,l.object=i,l.geometry=a,l.material=o,l.program=o.program,l.renderOrder=i.renderOrder,l.z=s,l.group=c),(!0===o.transparent?r:n).push(l),t++},sort:function(){n.length>1&&n.sort(Ct),r.length>1&&r.sort(Ot)}}}function It(){var e={};return{get:function(t,n){var r=t.id+","+n.id,i=e[r];return void 0===i&&(i=new Pt,e[r]=i),i},dispose:function(){e={}}}}function Nt(e,t){return Math.abs(t[1])-Math.abs(e[1])}function Lt(e){var t={},n=new Float32Array(8);return{update:function(r,i,a,o){var s=r.morphTargetInfluences,c=s.length,l=t[i.id];if(void 0===l){l=[];for(var u=0;u<c;u++)l[u]=[u,0];t[i.id]=l}var h=a.morphTargets&&i.morphAttributes.position,d=a.morphNormals&&i.morphAttributes.normal;for(u=0;u<c;u++){0!==(p=l[u])[1]&&(h&&i.removeAttribute("morphTarget"+u),d&&i.removeAttribute("morphNormal"+u))}for(u=0;u<c;u++){(p=l[u])[0]=u,p[1]=s[u]}for(l.sort(Nt),u=0;u<8;u++){var p;if(p=l[u]){var f=p[0],m=p[1];if(m){h&&i.addAttribute("morphTarget"+u,h[f]),d&&i.addAttribute("morphNormal"+u,d[f]),n[u]=m;continue}}n[u]=0}o.getUniforms().setValue(e,"morphTargetInfluences",n)}}}function Dt(e,t,n){var r,i,a;this.setMode=function(e){r=e},this.setIndex=function(e){i=e.type,a=e.bytesPerElement},this.render=function(t,o){e.drawElements(r,o,i,t*a),n.calls++,n.vertices+=o,r===e.TRIANGLES?n.faces+=o/3:r===e.POINTS&&(n.points+=o)},this.renderInstances=function(o,s,c){var l=t.get("ANGLE_instanced_arrays");null!==l?(l.drawElementsInstancedANGLE(r,c,i,s*a,o.maxInstancedCount),n.calls++,n.vertices+=c*o.maxInstancedCount,r===e.TRIANGLES?n.faces+=o.maxInstancedCount*c/3:r===e.POINTS&&(n.points+=o.maxInstancedCount*c)):console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.")}}function Ft(e,t,n){var r;this.setMode=function(e){r=e},this.render=function(t,i){e.drawArrays(r,t,i),n.calls++,n.vertices+=i,r===e.TRIANGLES?n.faces+=i/3:r===e.POINTS&&(n.points+=i)},this.renderInstances=function(i,a,o){var s=t.get("ANGLE_instanced_arrays");if(null!==s){var c=i.attributes.position;c.isInterleavedBufferAttribute?(o=c.data.count,s.drawArraysInstancedANGLE(r,0,o,i.maxInstancedCount)):s.drawArraysInstancedANGLE(r,a,o,i.maxInstancedCount),n.calls++,n.vertices+=o*i.maxInstancedCount,r===e.TRIANGLES?n.faces+=i.maxInstancedCount*o/3:r===e.POINTS&&(n.points+=i.maxInstancedCount*o)}else console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.")}}function jt(e,t,n){var r={},i={};function a(e){var o=e.target,s=r[o.id];for(var c in null!==s.index&&t.remove(s.index),s.attributes)t.remove(s.attributes[c]);o.removeEventListener("dispose",a),delete r[o.id];var l=i[o.id];l&&(t.remove(l),delete i[o.id]),(l=i[s.id])&&(t.remove(l),delete i[s.id]),n.geometries--}return{get:function(e,t){var i=r[t.id];return i||(t.addEventListener("dispose",a),t.isBufferGeometry?i=t:t.isGeometry&&(void 0===t._bufferGeometry&&(t._bufferGeometry=(new vt).setFromObject(e)),i=t._bufferGeometry),r[t.id]=i,n.geometries++,i)},update:function(n){var r=n.index,i=n.attributes;for(var a in null!==r&&t.update(r,e.ELEMENT_ARRAY_BUFFER),i)t.update(i[a],e.ARRAY_BUFFER);var o=n.morphAttributes;for(var a in o)for(var s=o[a],c=0,l=s.length;c<l;c++)t.update(s[c],e.ARRAY_BUFFER)},getWireframeAttribute:function(n){var r=i[n.id];if(r)return r;var a,o=[],s=n.index,c=n.attributes;if(null!==s)for(var l=0,u=(a=s.array).length;l<u;l+=3){var h=a[l+0],d=a[l+1],p=a[l+2];o.push(h,d,d,p,p,h)}else for(l=0,u=(a=c.position.array).length/3-1;l<u;l+=3){h=l+0,d=l+1,p=l+2;o.push(h,d,d,p,p,h)}return r=new(lt(o)>65535?at:rt)(o,1),t.update(r,e.ELEMENT_ARRAY_BUFFER),i[n.id]=r,r}}}function Ut(e,t){var n={};return{update:function(r){var i=t.frame,a=r.geometry,o=e.get(r,a);return n[o.id]!==i&&(a.isGeometry&&o.updateFromObject(r),e.update(o),n[o.id]=i),o},dispose:function(){n={}}}}function Bt(e,t,n){var r=e.createShader(t);return e.shaderSource(r,n),e.compileShader(r),!1===e.getShaderParameter(r,e.COMPILE_STATUS)&&console.error("THREE.WebGLShader: Shader couldn't compile."),""!==e.getShaderInfoLog(r)&&console.warn("THREE.WebGLShader: gl.getShaderInfoLog()",t===e.VERTEX_SHADER?"vertex":"fragment",e.getShaderInfoLog(r),function(e){for(var t=e.split("\n"),n=0;n<t.length;n++)t[n]=n+1+": "+t[n];return t.join("\n")}(n)),r}vt.prototype=Object.assign(Object.create(a.prototype),{constructor:vt,isBufferGeometry:!0,getIndex:function(){return this.index},setIndex:function(e){Array.isArray(e)?this.index=new(lt(e)>65535?at:rt)(e,1):this.index=e},addAttribute:function(e,t){return t&&t.isBufferAttribute||t&&t.isInterleavedBufferAttribute?"index"===e?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),void this.setIndex(t)):(this.attributes[e]=t,this):(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),void this.addAttribute(e,new Qe(arguments[1],arguments[2])))},getAttribute:function(e){return this.attributes[e]},removeAttribute:function(e){return delete this.attributes[e],this},addGroup:function(e,t,n){this.groups.push({start:e,count:t,materialIndex:void 0!==n?n:0})},clearGroups:function(){this.groups=[]},setDrawRange:function(e,t){this.drawRange.start=e,this.drawRange.count=t},applyMatrix:function(e){var t=this.attributes.position;void 0!==t&&(e.applyToBufferAttribute(t),t.needsUpdate=!0);var n=this.attributes.normal;void 0!==n&&((new w).getNormalMatrix(e).applyToBufferAttribute(n),n.needsUpdate=!0);return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:function(){var e=new y;return function(t){return e.makeRotationX(t),this.applyMatrix(e),this}}(),rotateY:function(){var e=new y;return function(t){return e.makeRotationY(t),this.applyMatrix(e),this}}(),rotateZ:function(){var e=new y;return function(t){return e.makeRotationZ(t),this.applyMatrix(e),this}}(),translate:function(){var e=new y;return function(t,n,r){return e.makeTranslation(t,n,r),this.applyMatrix(e),this}}(),scale:function(){var e=new y;return function(t,n,r){return e.makeScale(t,n,r),this.applyMatrix(e),this}}(),lookAt:function(){var e=new qe;return function(t){e.lookAt(t),e.updateMatrix(),this.applyMatrix(e.matrix)}}(),center:function(){this.computeBoundingBox();var e=this.boundingBox.getCenter().negate();return this.translate(e.x,e.y,e.z),e},setFromObject:function(e){var t=e.geometry;if(e.isPoints||e.isLine){var n=new ot(3*t.vertices.length,3),r=new ot(3*t.colors.length,3);if(this.addAttribute("position",n.copyVector3sArray(t.vertices)),this.addAttribute("color",r.copyColorsArray(t.colors)),t.lineDistances&&t.lineDistances.length===t.vertices.length){var i=new ot(t.lineDistances.length,1);this.addAttribute("lineDistance",i.copyArray(t.lineDistances))}null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone())}else e.isMesh&&t&&t.isGeometry&&this.fromGeometry(t);return this},setFromPoints:function(e){for(var t=[],n=0,r=e.length;n<r;n++){var i=e[n];t.push(i.x,i.y,i.z||0)}return this.addAttribute("position",new ot(t,3)),this},updateFromObject:function(e){var t,n=e.geometry;if(e.isMesh){var r=n.__directGeometry;if(!0===n.elementsNeedUpdate&&(r=void 0,n.elementsNeedUpdate=!1),void 0===r)return this.fromGeometry(n);r.verticesNeedUpdate=n.verticesNeedUpdate,r.normalsNeedUpdate=n.normalsNeedUpdate,r.colorsNeedUpdate=n.colorsNeedUpdate,r.uvsNeedUpdate=n.uvsNeedUpdate,r.groupsNeedUpdate=n.groupsNeedUpdate,n.verticesNeedUpdate=!1,n.normalsNeedUpdate=!1,n.colorsNeedUpdate=!1,n.uvsNeedUpdate=!1,n.groupsNeedUpdate=!1,n=r}return!0===n.verticesNeedUpdate&&(void 0!==(t=this.attributes.position)&&(t.copyVector3sArray(n.vertices),t.needsUpdate=!0),n.verticesNeedUpdate=!1),!0===n.normalsNeedUpdate&&(void 0!==(t=this.attributes.normal)&&(t.copyVector3sArray(n.normals),t.needsUpdate=!0),n.normalsNeedUpdate=!1),!0===n.colorsNeedUpdate&&(void 0!==(t=this.attributes.color)&&(t.copyColorsArray(n.colors),t.needsUpdate=!0),n.colorsNeedUpdate=!1),n.uvsNeedUpdate&&(void 0!==(t=this.attributes.uv)&&(t.copyVector2sArray(n.uvs),t.needsUpdate=!0),n.uvsNeedUpdate=!1),n.lineDistancesNeedUpdate&&(void 0!==(t=this.attributes.lineDistance)&&(t.copyArray(n.lineDistances),t.needsUpdate=!0),n.lineDistancesNeedUpdate=!1),n.groupsNeedUpdate&&(n.computeGroups(e.geometry),this.groups=n.groups,n.groupsNeedUpdate=!1),this},fromGeometry:function(e){return e.__directGeometry=(new ct).fromGeometry(e),this.fromDirectGeometry(e.__directGeometry)},fromDirectGeometry:function(e){var t=new Float32Array(3*e.vertices.length);if(this.addAttribute("position",new Qe(t,3).copyVector3sArray(e.vertices)),e.normals.length>0){var n=new Float32Array(3*e.normals.length);this.addAttribute("normal",new Qe(n,3).copyVector3sArray(e.normals))}if(e.colors.length>0){var r=new Float32Array(3*e.colors.length);this.addAttribute("color",new Qe(r,3).copyColorsArray(e.colors))}if(e.uvs.length>0){var i=new Float32Array(2*e.uvs.length);this.addAttribute("uv",new Qe(i,2).copyVector2sArray(e.uvs))}if(e.uvs2.length>0){var a=new Float32Array(2*e.uvs2.length);this.addAttribute("uv2",new Qe(a,2).copyVector2sArray(e.uvs2))}if(e.indices.length>0){var o=new(lt(e.indices)>65535?Uint32Array:Uint16Array)(3*e.indices.length);this.setIndex(new Qe(o,1).copyIndicesArray(e.indices))}for(var s in this.groups=e.groups,e.morphTargets){for(var c=[],l=e.morphTargets[s],u=0,h=l.length;u<h;u++){var d=l[u],p=new ot(3*d.length,3);c.push(p.copyVector3sArray(d))}this.morphAttributes[s]=c}if(e.skinIndices.length>0){var f=new ot(4*e.skinIndices.length,4);this.addAttribute("skinIndex",f.copyVector4sArray(e.skinIndices))}if(e.skinWeights.length>0){var m=new ot(4*e.skinWeights.length,4);this.addAttribute("skinWeight",m.copyVector4sArray(e.skinWeights))}return null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),this},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new Pe);var e=this.attributes.position;void 0!==e?this.boundingBox.setFromBufferAttribute(e):this.boundingBox.makeEmpty(),(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)},computeBoundingSphere:function(){var e=new Pe,t=new b;return function(){null===this.boundingSphere&&(this.boundingSphere=new Ie);var n=this.attributes.position;if(n){var r=this.boundingSphere.center;e.setFromBufferAttribute(n),e.getCenter(r);for(var i=0,a=0,o=n.count;a<o;a++)t.x=n.getX(a),t.y=n.getY(a),t.z=n.getZ(a),i=Math.max(i,r.distanceToSquared(t));this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}}(),computeFaceNormals:function(){},computeVertexNormals:function(){var e=this.index,t=this.attributes,n=this.groups;if(t.position){var r=t.position.array;if(void 0===t.normal)this.addAttribute("normal",new Qe(new Float32Array(r.length),3));else for(var i=t.normal.array,a=0,o=i.length;a<o;a++)i[a]=0;var s,c,l,u=t.normal.array,h=new b,d=new b,p=new b,f=new b,m=new b;if(e){var g=e.array;0===n.length&&this.addGroup(0,g.length);for(var y=0,v=n.length;y<v;++y){var w=n[y],A=w.start;for(a=A,o=A+w.count;a<o;a+=3)s=3*g[a+0],c=3*g[a+1],l=3*g[a+2],h.fromArray(r,s),d.fromArray(r,c),p.fromArray(r,l),f.subVectors(p,d),m.subVectors(h,d),f.cross(m),u[s]+=f.x,u[s+1]+=f.y,u[s+2]+=f.z,u[c]+=f.x,u[c+1]+=f.y,u[c+2]+=f.z,u[l]+=f.x,u[l+1]+=f.y,u[l+2]+=f.z}}else for(a=0,o=r.length;a<o;a+=9)h.fromArray(r,a),d.fromArray(r,a+3),p.fromArray(r,a+6),f.subVectors(p,d),m.subVectors(h,d),f.cross(m),u[a]=f.x,u[a+1]=f.y,u[a+2]=f.z,u[a+3]=f.x,u[a+4]=f.y,u[a+5]=f.z,u[a+6]=f.x,u[a+7]=f.y,u[a+8]=f.z;this.normalizeNormals(),t.normal.needsUpdate=!0}},merge:function(e,t){if(e&&e.isBufferGeometry){void 0===t&&(t=0);var n=this.attributes;for(var r in n)if(void 0!==e.attributes[r])for(var i=n[r].array,a=e.attributes[r],o=a.array,s=0,c=a.itemSize*t;s<o.length;s++,c++)i[c]=o[s];return this}console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",e)},normalizeNormals:function(){var e=new b;return function(){for(var t=this.attributes.normal,n=0,r=t.count;n<r;n++)e.x=t.getX(n),e.y=t.getY(n),e.z=t.getZ(n),e.normalize(),t.setXYZ(n,e.x,e.y,e.z)}}(),toNonIndexed:function(){if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),this;var e=new vt,t=this.index.array,n=this.attributes;for(var r in n){for(var i=n[r],a=i.array,o=i.itemSize,s=new a.constructor(t.length*o),c=0,l=0,u=0,h=t.length;u<h;u++){c=t[u]*o;for(var d=0;d<o;d++)s[l++]=a[c++]}e.addAttribute(r,new Qe(s,o))}return e},toJSON:function(){var e={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,""!==this.name&&(e.name=this.name),void 0!==this.parameters){var t=this.parameters;for(var n in t)void 0!==t[n]&&(e[n]=t[n]);return e}e.data={attributes:{}};var r=this.index;if(null!==r){var i=Array.prototype.slice.call(r.array);e.data.index={type:r.array.constructor.name,array:i}}var a=this.attributes;for(var n in a){var o=a[n];i=Array.prototype.slice.call(o.array);e.data.attributes[n]={itemSize:o.itemSize,type:o.array.constructor.name,array:i,normalized:o.normalized}}var s=this.groups;s.length>0&&(e.data.groups=JSON.parse(JSON.stringify(s)));var c=this.boundingSphere;return null!==c&&(e.data.boundingSphere={center:c.center.toArray(),radius:c.radius}),e},clone:function(){return(new vt).copy(this)},copy:function(e){var t,n,r;this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.name=e.name;var i=e.index;null!==i&&this.setIndex(i.clone());var a=e.attributes;for(t in a){var o=a[t];this.addAttribute(t,o.clone())}var s=e.morphAttributes;for(t in s){var c=[],l=s[t];for(n=0,r=l.length;n<r;n++)c.push(l[n].clone());this.morphAttributes[t]=c}var u=e.groups;for(n=0,r=u.length;n<r;n++){var h=u[n];this.addGroup(h.start,h.count,h.materialIndex)}var d=e.boundingBox;null!==d&&(this.boundingBox=d.clone());var p=e.boundingSphere;return null!==p&&(this.boundingSphere=p.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),bt.prototype=Object.create(Ke.prototype),bt.prototype.constructor=bt,wt.prototype=Object.create(vt.prototype),wt.prototype.constructor=wt,At.prototype=Object.create(Ke.prototype),At.prototype.constructor=At,Et.prototype=Object.create(vt.prototype),Et.prototype.constructor=Et,xt.prototype=Object.create(ke.prototype),xt.prototype.constructor=xt,xt.prototype.isMeshBasicMaterial=!0,xt.prototype.copy=function(e){return ke.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this},_t.prototype=Object.create(ke.prototype),_t.prototype.constructor=_t,_t.prototype.isShaderMaterial=!0,_t.prototype.copy=function(e){return ke.prototype.copy.call(this,e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=ge.clone(e.uniforms),this.defines=e.defines,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.lights=e.lights,this.clipping=e.clipping,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this.extensions=e.extensions,this},_t.prototype.toJSON=function(e){var t=ke.prototype.toJSON.call(this,e);return t.uniforms=this.uniforms,t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t},Object.assign(St.prototype,{set:function(e,t){return this.origin.copy(e),this.direction.copy(t),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this},at:function(e,t){return(t||new b).copy(this.direction).multiplyScalar(e).add(this.origin)},lookAt:function(e){return this.direction.copy(e).sub(this.origin).normalize(),this},recast:function(){var e=new b;return function(t){return this.origin.copy(this.at(t,e)),this}}(),closestPointToPoint:function(e,t){var n=t||new b;n.subVectors(e,this.origin);var r=n.dot(this.direction);return r<0?n.copy(this.origin):n.copy(this.direction).multiplyScalar(r).add(this.origin)},distanceToPoint:function(e){return Math.sqrt(this.distanceSqToPoint(e))},distanceSqToPoint:function(){var e=new b;return function(t){var n=e.subVectors(t,this.origin).dot(this.direction);return n<0?this.origin.distanceToSquared(t):(e.copy(this.direction).multiplyScalar(n).add(this.origin),e.distanceToSquared(t))}}(),distanceSqToSegment:(ht=new b,dt=new b,pt=new b,function(e,t,n,r){ht.copy(e).add(t).multiplyScalar(.5),dt.copy(t).sub(e).normalize(),pt.copy(this.origin).sub(ht);var i,a,o,s,c=.5*e.distanceTo(t),l=-this.direction.dot(dt),u=pt.dot(this.direction),h=-pt.dot(dt),d=pt.lengthSq(),p=Math.abs(1-l*l);if(p>0)if(a=l*u-h,s=c*p,(i=l*h-u)>=0)if(a>=-s)if(a<=s){var f=1/p;o=(i*=f)*(i+l*(a*=f)+2*u)+a*(l*i+a+2*h)+d}else a=c,o=-(i=Math.max(0,-(l*a+u)))*i+a*(a+2*h)+d;else a=-c,o=-(i=Math.max(0,-(l*a+u)))*i+a*(a+2*h)+d;else a<=-s?o=-(i=Math.max(0,-(-l*c+u)))*i+(a=i>0?-c:Math.min(Math.max(-c,-h),c))*(a+2*h)+d:a<=s?(i=0,o=(a=Math.min(Math.max(-c,-h),c))*(a+2*h)+d):o=-(i=Math.max(0,-(l*c+u)))*i+(a=i>0?c:Math.min(Math.max(-c,-h),c))*(a+2*h)+d;else a=l>0?-c:c,o=-(i=Math.max(0,-(l*a+u)))*i+a*(a+2*h)+d;return n&&n.copy(this.direction).multiplyScalar(i).add(this.origin),r&&r.copy(dt).multiplyScalar(a).add(ht),o}),intersectSphere:function(){var e=new b;return function(t,n){e.subVectors(t.center,this.origin);var r=e.dot(this.direction),i=e.dot(e)-r*r,a=t.radius*t.radius;if(i>a)return null;var o=Math.sqrt(a-i),s=r-o,c=r+o;return s<0&&c<0?null:s<0?this.at(c,n):this.at(s,n)}}(),intersectsSphere:function(e){return this.distanceToPoint(e.center)<=e.radius},distanceToPlane:function(e){var t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?0:null;var n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null},intersectPlane:function(e,t){var n=this.distanceToPlane(e);return null===n?null:this.at(n,t)},intersectsPlane:function(e){var t=e.distanceToPoint(this.origin);return 0===t||e.normal.dot(this.direction)*t<0},intersectBox:function(e,t){var n,r,i,a,o,s,c=1/this.direction.x,l=1/this.direction.y,u=1/this.direction.z,h=this.origin;return c>=0?(n=(e.min.x-h.x)*c,r=(e.max.x-h.x)*c):(n=(e.max.x-h.x)*c,r=(e.min.x-h.x)*c),l>=0?(i=(e.min.y-h.y)*l,a=(e.max.y-h.y)*l):(i=(e.max.y-h.y)*l,a=(e.min.y-h.y)*l),n>a||i>r?null:((i>n||n!=n)&&(n=i),(a<r||r!=r)&&(r=a),u>=0?(o=(e.min.z-h.z)*u,s=(e.max.z-h.z)*u):(o=(e.max.z-h.z)*u,s=(e.min.z-h.z)*u),n>s||o>r?null:((o>n||n!=n)&&(n=o),(s<r||r!=r)&&(r=s),r<0?null:this.at(n>=0?n:r,t)))},intersectsBox:(ut=new b,function(e){return null!==this.intersectBox(e,ut)}),intersectTriangle:function(){var e=new b,t=new b,n=new b,r=new b;return function(i,a,o,s,c){t.subVectors(a,i),n.subVectors(o,i),r.crossVectors(t,n);var l,u=this.direction.dot(r);if(u>0){if(s)return null;l=1}else{if(!(u<0))return null;l=-1,u=-u}e.subVectors(this.origin,i);var h=l*this.direction.dot(n.crossVectors(e,n));if(h<0)return null;var d=l*this.direction.dot(t.cross(e));if(d<0)return null;if(h+d>u)return null;var p=-l*e.dot(r);return p<0?null:this.at(p/u,c)}}(),applyMatrix4:function(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this},equals:function(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}}),Object.assign(Mt.prototype,{set:function(e,t){return this.start.copy(e),this.end.copy(t),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.start.copy(e.start),this.end.copy(e.end),this},getCenter:function(e){return(e||new b).addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(e){return(e||new b).subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(e,t){var n=t||new b;return this.delta(n).multiplyScalar(e).add(this.start)},closestPointToPointParameter:(ft=new b,mt=new b,function(e,t){ft.subVectors(e,this.start),mt.subVectors(this.end,this.start);var n=mt.dot(mt),r=mt.dot(ft)/n;return t&&(r=m.clamp(r,0,1)),r}),closestPointToPoint:function(e,t,n){var r=this.closestPointToPointParameter(e,t),i=n||new b;return this.delta(i).multiplyScalar(r).add(this.start)},applyMatrix4:function(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this},equals:function(e){return e.start.equals(this.start)&&e.end.equals(this.end)}}),Object.assign(Tt,{normal:(gt=new b,function(e,t,n,r){var i=r||new b;i.subVectors(n,t),gt.subVectors(e,t),i.cross(gt);var a=i.lengthSq();return a>0?i.multiplyScalar(1/Math.sqrt(a)):i.set(0,0,0)}),barycoordFromPoint:function(){var e=new b,t=new b,n=new b;return function(r,i,a,o,s){e.subVectors(o,i),t.subVectors(a,i),n.subVectors(r,i);var c=e.dot(e),l=e.dot(t),u=e.dot(n),h=t.dot(t),d=t.dot(n),p=c*h-l*l,f=s||new b;if(0===p)return f.set(-2,-1,-1);var m=1/p,g=(h*u-l*d)*m,y=(c*d-l*u)*m;return f.set(1-g-y,y,g)}}(),containsPoint:function(){var e=new b;return function(t,n,r,i){var a=Tt.barycoordFromPoint(t,n,r,i,e);return a.x>=0&&a.y>=0&&a.x+a.y<=1}}()}),Object.assign(Tt.prototype,{set:function(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this},setFromPointsAndIndices:function(e,t,n,r){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[r]),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this},area:function(){var e=new b,t=new b;return function(){return e.subVectors(this.c,this.b),t.subVectors(this.a,this.b),.5*e.cross(t).length()}}(),midpoint:function(e){return(e||new b).addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},normal:function(e){return Tt.normal(this.a,this.b,this.c,e)},plane:function(e){return(e||new Ne).setFromCoplanarPoints(this.a,this.b,this.c)},barycoordFromPoint:function(e,t){return Tt.barycoordFromPoint(e,this.a,this.b,this.c,t)},containsPoint:function(e){return Tt.containsPoint(e,this.a,this.b,this.c)},intersectsBox:function(e){return e.intersectsTriangle(this)},closestPointToPoint:function(){var e=new Ne,t=[new Mt,new Mt,new Mt],n=new b,r=new b;return function(i,a){var o=a||new b,s=1/0;if(e.setFromCoplanarPoints(this.a,this.b,this.c),e.projectPoint(i,n),!0===this.containsPoint(n))o.copy(n);else{t[0].set(this.a,this.b),t[1].set(this.b,this.c),t[2].set(this.c,this.a);for(var c=0;c<t.length;c++){t[c].closestPointToPoint(n,!0,r);var l=n.distanceToSquared(r);l<s&&(s=l,o.copy(r))}}return o}}(),equals:function(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}),Rt.prototype=Object.assign(Object.create(qe.prototype),{constructor:Rt,isMesh:!0,setDrawMode:function(e){this.drawMode=e},copy:function(e){return qe.prototype.copy.call(this,e),this.drawMode=e.drawMode,void 0!==e.morphTargetInfluences&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),void 0!==e.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this},updateMorphTargets:function(){var e,t,n,r=this.geometry;if(r.isBufferGeometry){var i=r.morphAttributes,a=Object.keys(i);if(a.length>0){var o=i[a[0]];if(void 0!==o)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},e=0,t=o.length;e<t;e++)n=o[e].name||String(e),this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=e}}else{var s=r.morphTargets;if(void 0!==s&&s.length>0)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},e=0,t=s.length;e<t;e++)n=s[e].name||String(e),this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=e}},raycast:function(){var e=new y,t=new St,n=new Ie,r=new b,i=new b,a=new b,o=new b,s=new b,c=new b,l=new g,u=new g,h=new g,d=new b,p=new b,f=new b;function m(e,t,n,r,i,a,o){return Tt.barycoordFromPoint(e,t,n,r,d),i.multiplyScalar(d.x),a.multiplyScalar(d.y),o.multiplyScalar(d.z),i.add(a).add(o),i.clone()}function v(e,t,n,r,i,a,o,s){if(null===(1===t.side?r.intersectTriangle(o,a,i,!0,s):r.intersectTriangle(i,a,o,2!==t.side,s)))return null;f.copy(s),f.applyMatrix4(e.matrixWorld);var c=n.ray.origin.distanceTo(f);return c<n.near||c>n.far?null:{distance:c,point:f.clone(),object:e}}function w(e,t,n,o,s,c,d,f){r.fromBufferAttribute(o,c),i.fromBufferAttribute(o,d),a.fromBufferAttribute(o,f);var g=v(e,e.material,t,n,r,i,a,p);return g&&(s&&(l.fromBufferAttribute(s,c),u.fromBufferAttribute(s,d),h.fromBufferAttribute(s,f),g.uv=m(p,r,i,a,l,u,h)),g.face=new Ze(c,d,f,Tt.normal(r,i,a)),g.faceIndex=c),g}return function(d,f){var g,y=this.geometry,b=this.material,A=this.matrixWorld;if(void 0!==b&&(null===y.boundingSphere&&y.computeBoundingSphere(),n.copy(y.boundingSphere),n.applyMatrix4(A),!1!==d.ray.intersectsSphere(n)&&(e.getInverse(A),t.copy(d.ray).applyMatrix4(e),null===y.boundingBox||!1!==t.intersectsBox(y.boundingBox))))if(y.isBufferGeometry){var E,x,_,S,M,T=y.index,R=y.attributes.position,k=y.attributes.uv;if(null!==T)for(S=0,M=T.count;S<M;S+=3)E=T.getX(S),x=T.getX(S+1),_=T.getX(S+2),(g=w(this,d,t,R,k,E,x,_))&&(g.faceIndex=Math.floor(S/3),f.push(g));else if(void 0!==R)for(S=0,M=R.count;S<M;S+=3)(g=w(this,d,t,R,k,E=S,x=S+1,_=S+2))&&(g.index=E,f.push(g))}else if(y.isGeometry){var C,O,P,I,N=Array.isArray(b),L=y.vertices,D=y.faces,F=y.faceVertexUvs[0];F.length>0&&(I=F);for(var j=0,U=D.length;j<U;j++){var B=D[j],V=N?b[B.materialIndex]:b;if(void 0!==V){if(C=L[B.a],O=L[B.b],P=L[B.c],!0===V.morphTargets){var z=y.morphTargets,H=this.morphTargetInfluences;r.set(0,0,0),i.set(0,0,0),a.set(0,0,0);for(var G=0,q=z.length;G<q;G++){var W=H[G];if(0!==W){var J=z[G].vertices;r.addScaledVector(o.subVectors(J[B.a],C),W),i.addScaledVector(s.subVectors(J[B.b],O),W),a.addScaledVector(c.subVectors(J[B.c],P),W)}}r.add(C),i.add(O),a.add(P),C=r,O=i,P=a}if(g=v(this,V,d,t,C,O,P,p)){if(I&&I[j]){var Z=I[j];l.copy(Z[0]),u.copy(Z[1]),h.copy(Z[2]),g.uv=m(p,C,O,P,l,u,h)}g.face=B,g.faceIndex=j,f.push(g)}}}}}}(),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}});var Vt=0;function zt(e){switch(e){case 3e3:return["Linear","( value )"];case 3001:return["sRGB","( value )"];case 3002:return["RGBE","( value )"];case 3004:return["RGBM","( value, 7.0 )"];case 3005:return["RGBM","( value, 16.0 )"];case 3006:return["RGBD","( value, 256.0 )"];case 3007:return["Gamma","( value, float( GAMMA_FACTOR ) )"];default:throw new Error("unsupported encoding: "+e)}}function Ht(e,t){var n=zt(t);return"vec4 "+e+"( vec4 value ) { return "+n[0]+"ToLinear"+n[1]+"; }"}function Gt(e,t){var n;switch(t){case 1:n="Linear";break;case 2:n="Reinhard";break;case 3:n="Uncharted2";break;case 4:n="OptimizedCineon";break;default:throw new Error("unsupported toneMapping: "+t)}return"vec3 "+e+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}function qt(e){return""!==e}function Wt(e,t){return e.replace(/NUM_DIR_LIGHTS/g,t.numDirLights).replace(/NUM_SPOT_LIGHTS/g,t.numSpotLights).replace(/NUM_RECT_AREA_LIGHTS/g,t.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,t.numPointLights).replace(/NUM_HEMI_LIGHTS/g,t.numHemiLights)}function Jt(e,t){return e.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}function Zt(e){return e.replace(/^[ \t]*#include +<([\w\d.]+)>/gm,(function(e,t){var n=ye[t];if(void 0===n)throw new Error("Can not resolve #include <"+t+">");return Zt(n)}))}function Xt(e){return e.replace(/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,(function(e,t,n,r){for(var i="",a=parseInt(t);a<parseInt(n);a++)i+=r.replace(/\[ i \]/g,"[ "+a+" ]");return i}))}function Yt(e,t,n,r,i,a){var o=e.context,s=r.defines,c=i.vertexShader,l=i.fragmentShader,u="SHADOWMAP_TYPE_BASIC";1===a.shadowMapType?u="SHADOWMAP_TYPE_PCF":2===a.shadowMapType&&(u="SHADOWMAP_TYPE_PCF_SOFT");var h="ENVMAP_TYPE_CUBE",d="ENVMAP_MODE_REFLECTION",p="ENVMAP_BLENDING_MULTIPLY";if(a.envMap){switch(r.envMap.mapping){case 301:case 302:h="ENVMAP_TYPE_CUBE";break;case 306:case 307:h="ENVMAP_TYPE_CUBE_UV";break;case 303:case 304:h="ENVMAP_TYPE_EQUIREC";break;case 305:h="ENVMAP_TYPE_SPHERE"}switch(r.envMap.mapping){case 302:case 304:d="ENVMAP_MODE_REFRACTION"}switch(r.combine){case 0:p="ENVMAP_BLENDING_MULTIPLY";break;case 1:p="ENVMAP_BLENDING_MIX";break;case 2:p="ENVMAP_BLENDING_ADD"}}var f,m,g,y,v,b=e.gammaFactor>0?e.gammaFactor:1,w=function(e,t,n){return[(e=e||{}).derivatives||t.envMapCubeUV||t.bumpMap||t.normalMap||t.flatShading?"#extension GL_OES_standard_derivatives : enable":"",(e.fragDepth||t.logarithmicDepthBuffer)&&n.get("EXT_frag_depth")?"#extension GL_EXT_frag_depth : enable":"",e.drawBuffers&&n.get("WEBGL_draw_buffers")?"#extension GL_EXT_draw_buffers : require":"",(e.shaderTextureLOD||t.envMap)&&n.get("EXT_shader_texture_lod")?"#extension GL_EXT_shader_texture_lod : enable":""].filter(qt).join("\n")}(r.extensions,a,t),A=function(e){var t=[];for(var n in e){var r=e[n];!1!==r&&t.push("#define "+n+" "+r)}return t.join("\n")}(s),E=o.createProgram();r.isRawShaderMaterial?((f=[A].filter(qt).join("\n")).length>0&&(f+="\n"),(m=[w,A].filter(qt).join("\n")).length>0&&(m+="\n")):(f=["precision "+a.precision+" float;","precision "+a.precision+" int;","#define SHADER_NAME "+i.name,A,a.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+b,"#define MAX_BONES "+a.maxBones,a.useFog&&a.fog?"#define USE_FOG":"",a.useFog&&a.fogExp?"#define FOG_EXP2":"",a.map?"#define USE_MAP":"",a.envMap?"#define USE_ENVMAP":"",a.envMap?"#define "+d:"",a.lightMap?"#define USE_LIGHTMAP":"",a.aoMap?"#define USE_AOMAP":"",a.emissiveMap?"#define USE_EMISSIVEMAP":"",a.bumpMap?"#define USE_BUMPMAP":"",a.normalMap?"#define USE_NORMALMAP":"",a.displacementMap&&a.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",a.specularMap?"#define USE_SPECULARMAP":"",a.roughnessMap?"#define USE_ROUGHNESSMAP":"",a.metalnessMap?"#define USE_METALNESSMAP":"",a.alphaMap?"#define USE_ALPHAMAP":"",a.vertexColors?"#define USE_COLOR":"",a.flatShading?"#define FLAT_SHADED":"",a.skinning?"#define USE_SKINNING":"",a.useVertexTexture?"#define BONE_TEXTURE":"",a.morphTargets?"#define USE_MORPHTARGETS":"",a.morphNormals&&!1===a.flatShading?"#define USE_MORPHNORMALS":"",a.doubleSided?"#define DOUBLE_SIDED":"",a.flipSided?"#define FLIP_SIDED":"",a.shadowMapEnabled?"#define USE_SHADOWMAP":"",a.shadowMapEnabled?"#define "+u:"",a.sizeAttenuation?"#define USE_SIZEATTENUATION":"",a.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",a.logarithmicDepthBuffer&&t.get("EXT_frag_depth")?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_COLOR","\tattribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(qt).join("\n"),m=[w,"precision "+a.precision+" float;","precision "+a.precision+" int;","#define SHADER_NAME "+i.name,A,a.alphaTest?"#define ALPHATEST "+a.alphaTest:"","#define GAMMA_FACTOR "+b,a.useFog&&a.fog?"#define USE_FOG":"",a.useFog&&a.fogExp?"#define FOG_EXP2":"",a.map?"#define USE_MAP":"",a.envMap?"#define USE_ENVMAP":"",a.envMap?"#define "+h:"",a.envMap?"#define "+d:"",a.envMap?"#define "+p:"",a.lightMap?"#define USE_LIGHTMAP":"",a.aoMap?"#define USE_AOMAP":"",a.emissiveMap?"#define USE_EMISSIVEMAP":"",a.bumpMap?"#define USE_BUMPMAP":"",a.normalMap?"#define USE_NORMALMAP":"",a.specularMap?"#define USE_SPECULARMAP":"",a.roughnessMap?"#define USE_ROUGHNESSMAP":"",a.metalnessMap?"#define USE_METALNESSMAP":"",a.alphaMap?"#define USE_ALPHAMAP":"",a.vertexColors?"#define USE_COLOR":"",a.gradientMap?"#define USE_GRADIENTMAP":"",a.flatShading?"#define FLAT_SHADED":"",a.doubleSided?"#define DOUBLE_SIDED":"",a.flipSided?"#define FLIP_SIDED":"",a.shadowMapEnabled?"#define USE_SHADOWMAP":"",a.shadowMapEnabled?"#define "+u:"",a.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",a.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",a.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",a.logarithmicDepthBuffer&&t.get("EXT_frag_depth")?"#define USE_LOGDEPTHBUF_EXT":"",a.envMap&&t.get("EXT_shader_texture_lod")?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;",0!==a.toneMapping?"#define TONE_MAPPING":"",0!==a.toneMapping?ye.tonemapping_pars_fragment:"",0!==a.toneMapping?Gt("toneMapping",a.toneMapping):"",a.dithering?"#define DITHERING":"",a.outputEncoding||a.mapEncoding||a.envMapEncoding||a.emissiveMapEncoding?ye.encodings_pars_fragment:"",a.mapEncoding?Ht("mapTexelToLinear",a.mapEncoding):"",a.envMapEncoding?Ht("envMapTexelToLinear",a.envMapEncoding):"",a.emissiveMapEncoding?Ht("emissiveMapTexelToLinear",a.emissiveMapEncoding):"",a.outputEncoding?(g="linearToOutputTexel",y=a.outputEncoding,v=zt(y),"vec4 "+g+"( vec4 value ) { return LinearTo"+v[0]+v[1]+"; }"):"",a.depthPacking?"#define DEPTH_PACKING "+r.depthPacking:"","\n"].filter(qt).join("\n")),c=Jt(c=Wt(c=Zt(c),a),a),l=Jt(l=Wt(l=Zt(l),a),a);var x=f+(c=Xt(c)),_=m+(l=Xt(l)),S=Bt(o,o.VERTEX_SHADER,x),M=Bt(o,o.FRAGMENT_SHADER,_);o.attachShader(E,S),o.attachShader(E,M),void 0!==r.index0AttributeName?o.bindAttribLocation(E,0,r.index0AttributeName):!0===a.morphTargets&&o.bindAttribLocation(E,0,"position"),o.linkProgram(E);var T,R,k=o.getProgramInfoLog(E).trim(),C=o.getShaderInfoLog(S).trim(),O=o.getShaderInfoLog(M).trim(),P=!0,I=!0;return!1===o.getProgramParameter(E,o.LINK_STATUS)?(P=!1,console.error("THREE.WebGLProgram: shader error: ",o.getError(),"gl.VALIDATE_STATUS",o.getProgramParameter(E,o.VALIDATE_STATUS),"gl.getProgramInfoLog",k,C,O)):""!==k?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",k):""!==C&&""!==O||(I=!1),I&&(this.diagnostics={runnable:P,material:r,programLog:k,vertexShader:{log:C,prefix:f},fragmentShader:{log:O,prefix:m}}),o.deleteShader(S),o.deleteShader(M),this.getUniforms=function(){return void 0===T&&(T=new de(o,E,e)),T},this.getAttributes=function(){return void 0===R&&(R=function(e,t){for(var n={},r=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES),i=0;i<r;i++){var a=e.getActiveAttrib(t,i).name;n[a]=e.getAttribLocation(t,a)}return n}(o,E)),R},this.destroy=function(){o.deleteProgram(E),this.program=void 0},Object.defineProperties(this,{uniforms:{get:function(){return console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms()."),this.getUniforms()}},attributes:{get:function(){return console.warn("THREE.WebGLProgram: .attributes is now .getAttributes()."),this.getAttributes()}}}),this.id=Vt++,this.code=n,this.usedTimes=1,this.program=E,this.vertexShader=S,this.fragmentShader=M,this}function Kt(e,t,n){var r=[],i={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"phong",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow"},a=["precision","supportsVertexTextures","map","mapEncoding","envMap","envMapMode","envMapEncoding","lightMap","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","displacementMap","specularMap","roughnessMap","metalnessMap","gradientMap","alphaMap","combine","vertexColors","fog","useFog","fogExp","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","maxMorphTargets","maxMorphNormals","premultipliedAlpha","numDirLights","numPointLights","numSpotLights","numHemiLights","numRectAreaLights","shadowMapEnabled","shadowMapType","toneMapping","physicallyCorrectLights","alphaTest","doubleSided","flipSided","numClippingPlanes","numClipIntersection","depthPacking","dithering"];function o(e,t){var n;return e?e.isTexture?n=e.encoding:e.isWebGLRenderTarget&&(console.warn("THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."),n=e.texture.encoding):n=3e3,3e3===n&&t&&(n=3007),n}this.getParameters=function(t,r,a,s,c,l,u){var h=i[t.type],d=u.isSkinnedMesh?function(e){var t=e.skeleton.bones;if(n.floatVertexTextures)return 1024;var r=n.maxVertexUniforms,i=Math.floor((r-20)/4),a=Math.min(i,t.length);return a<t.length?(console.warn("THREE.WebGLRenderer: Skeleton has "+t.length+" bones. This GPU supports "+a+"."),0):a}(u):0,p=n.precision;null!==t.precision&&(p=n.getMaxPrecision(t.precision))!==t.precision&&console.warn("THREE.WebGLProgram.getParameters:",t.precision,"not supported, using",p,"instead.");var f=e.getRenderTarget();return{shaderID:h,precision:p,supportsVertexTextures:n.vertexTextures,outputEncoding:o(f?f.texture:null,e.gammaOutput),map:!!t.map,mapEncoding:o(t.map,e.gammaInput),envMap:!!t.envMap,envMapMode:t.envMap&&t.envMap.mapping,envMapEncoding:o(t.envMap,e.gammaInput),envMapCubeUV:!!t.envMap&&(306===t.envMap.mapping||307===t.envMap.mapping),lightMap:!!t.lightMap,aoMap:!!t.aoMap,emissiveMap:!!t.emissiveMap,emissiveMapEncoding:o(t.emissiveMap,e.gammaInput),bumpMap:!!t.bumpMap,normalMap:!!t.normalMap,displacementMap:!!t.displacementMap,roughnessMap:!!t.roughnessMap,metalnessMap:!!t.metalnessMap,specularMap:!!t.specularMap,alphaMap:!!t.alphaMap,gradientMap:!!t.gradientMap,combine:t.combine,vertexColors:t.vertexColors,fog:!!s,useFog:t.fog,fogExp:s&&s.isFogExp2,flatShading:t.flatShading,sizeAttenuation:t.sizeAttenuation,logarithmicDepthBuffer:n.logarithmicDepthBuffer,skinning:t.skinning&&d>0,maxBones:d,useVertexTexture:n.floatVertexTextures,morphTargets:t.morphTargets,morphNormals:t.morphNormals,maxMorphTargets:e.maxMorphTargets,maxMorphNormals:e.maxMorphNormals,numDirLights:r.directional.length,numPointLights:r.point.length,numSpotLights:r.spot.length,numRectAreaLights:r.rectArea.length,numHemiLights:r.hemi.length,numClippingPlanes:c,numClipIntersection:l,dithering:t.dithering,shadowMapEnabled:e.shadowMap.enabled&&u.receiveShadow&&a.length>0,shadowMapType:e.shadowMap.type,toneMapping:e.toneMapping,physicallyCorrectLights:e.physicallyCorrectLights,premultipliedAlpha:t.premultipliedAlpha,alphaTest:t.alphaTest,doubleSided:2===t.side,flipSided:1===t.side,depthPacking:void 0!==t.depthPacking&&t.depthPacking}},this.getProgramCode=function(t,n){var r=[];if(n.shaderID?r.push(n.shaderID):(r.push(t.fragmentShader),r.push(t.vertexShader)),void 0!==t.defines)for(var i in t.defines)r.push(i),r.push(t.defines[i]);for(var o=0;o<a.length;o++)r.push(n[a[o]]);return r.push(t.onBeforeCompile.toString()),r.push(e.gammaOutput),r.join()},this.acquireProgram=function(n,i,a,o){for(var s,c=0,l=r.length;c<l;c++){var u=r[c];if(u.code===o){++(s=u).usedTimes;break}}return void 0===s&&(s=new Yt(e,t,o,n,i,a),r.push(s)),s},this.releaseProgram=function(e){if(0==--e.usedTimes){var t=r.indexOf(e);r[t]=r[r.length-1],r.pop(),e.destroy()}},this.programs=r}function Qt(e,t,n,r,i,a,o,s){var c,l="undefined"!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext,u={};function h(e,t){if(e.width>t||e.height>t){var n=t/Math.max(e.width,e.height),r=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");return r.width=Math.floor(e.width*n),r.height=Math.floor(e.height*n),r.getContext("2d").drawImage(e,0,0,e.width,e.height,0,0,r.width,r.height),console.warn("THREE.WebGLRenderer: image is too big ("+e.width+"x"+e.height+"). Resized to "+r.width+"x"+r.height,e),r}return e}function d(e){return m.isPowerOfTwo(e.width)&&m.isPowerOfTwo(e.height)}function p(e,t){return e.generateMipmaps&&t&&1003!==e.minFilter&&1006!==e.minFilter}function f(t){return 1003===t||1004===t||1005===t?e.NEAREST:e.LINEAR}function g(t){var n=t.target;n.removeEventListener("dispose",g),function(t){var n=r.get(t);if(t.image&&n.__image__webglTextureCube)e.deleteTexture(n.__image__webglTextureCube);else{if(void 0===n.__webglInit)return;e.deleteTexture(n.__webglTexture)}r.remove(t)}(n),n.isVideoTexture&&delete u[n.id],o.textures--}function y(t){var n=t.target;n.removeEventListener("dispose",y),function(t){var n=r.get(t),i=r.get(t.texture);if(!t)return;void 0!==i.__webglTexture&&e.deleteTexture(i.__webglTexture);t.depthTexture&&t.depthTexture.dispose();if(t.isWebGLRenderTargetCube)for(var a=0;a<6;a++)e.deleteFramebuffer(n.__webglFramebuffer[a]),n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer[a]);else e.deleteFramebuffer(n.__webglFramebuffer),n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer);r.remove(t.texture),r.remove(t)}(n),o.textures--}function v(t,f){var y=r.get(t);if(t.isVideoTexture&&function(e){var t=e.id,n=s.frame;u[t]!==n&&(u[t]=n,e.update())}(t),t.version>0&&y.__version!==t.version){var v=t.image;if(void 0===v)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined",t);else{if(!1!==v.complete)return void function(t,r,s){void 0===t.__webglInit&&(t.__webglInit=!0,r.addEventListener("dispose",g),t.__webglTexture=e.createTexture(),o.textures++);n.activeTexture(e.TEXTURE0+s),n.bindTexture(e.TEXTURE_2D,t.__webglTexture),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,r.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r.premultiplyAlpha),e.pixelStorei(e.UNPACK_ALIGNMENT,r.unpackAlignment);var u=h(r.image,i.maxTextureSize);(function(e){return 1001!==e.wrapS||1001!==e.wrapT||1003!==e.minFilter&&1006!==e.minFilter})(r)&&!1===d(u)&&(u=function(e){return e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof ImageBitmap?(void 0===c&&(c=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),c.width=m.floorPowerOfTwo(e.width),c.height=m.floorPowerOfTwo(e.height),c.getContext("2d").drawImage(e,0,0,c.width,c.height),console.warn("THREE.WebGLRenderer: image is not power of two ("+e.width+"x"+e.height+"). Resized to "+c.width+"x"+c.height,e),c):e}(u));var f=d(u),y=a.convert(r.format),v=a.convert(r.type);b(e.TEXTURE_2D,r,f);var w,A=r.mipmaps;if(r.isDepthTexture){var E=e.DEPTH_COMPONENT;if(1015===r.type){if(!l)throw new Error("Float Depth Texture only supported in WebGL2.0");E=e.DEPTH_COMPONENT32F}else l&&(E=e.DEPTH_COMPONENT16);1026===r.format&&E===e.DEPTH_COMPONENT&&1012!==r.type&&1014!==r.type&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),r.type=1012,v=a.convert(r.type)),1027===r.format&&(E=e.DEPTH_STENCIL,1020!==r.type&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),r.type=1020,v=a.convert(r.type))),n.texImage2D(e.TEXTURE_2D,0,E,u.width,u.height,0,y,v,null)}else if(r.isDataTexture)if(A.length>0&&f){for(var x=0,_=A.length;x<_;x++)w=A[x],n.texImage2D(e.TEXTURE_2D,x,y,w.width,w.height,0,y,v,w.data);r.generateMipmaps=!1}else n.texImage2D(e.TEXTURE_2D,0,y,u.width,u.height,0,y,v,u.data);else if(r.isCompressedTexture)for(x=0,_=A.length;x<_;x++)w=A[x],1023!==r.format&&1022!==r.format?n.getCompressedTextureFormats().indexOf(y)>-1?n.compressedTexImage2D(e.TEXTURE_2D,x,y,w.width,w.height,0,w.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):n.texImage2D(e.TEXTURE_2D,x,y,w.width,w.height,0,y,v,w.data);else if(A.length>0&&f){for(x=0,_=A.length;x<_;x++)w=A[x],n.texImage2D(e.TEXTURE_2D,x,y,y,v,w);r.generateMipmaps=!1}else n.texImage2D(e.TEXTURE_2D,0,y,y,v,u);p(r,f)&&e.generateMipmap(e.TEXTURE_2D);t.__version=r.version,r.onUpdate&&r.onUpdate(r)}(y,t,f);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete",t)}}n.activeTexture(e.TEXTURE0+f),n.bindTexture(e.TEXTURE_2D,y.__webglTexture)}function b(n,o,s){var c;if(s?(e.texParameteri(n,e.TEXTURE_WRAP_S,a.convert(o.wrapS)),e.texParameteri(n,e.TEXTURE_WRAP_T,a.convert(o.wrapT)),e.texParameteri(n,e.TEXTURE_MAG_FILTER,a.convert(o.magFilter)),e.texParameteri(n,e.TEXTURE_MIN_FILTER,a.convert(o.minFilter))):(e.texParameteri(n,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(n,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),1001===o.wrapS&&1001===o.wrapT||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.",o),e.texParameteri(n,e.TEXTURE_MAG_FILTER,f(o.magFilter)),e.texParameteri(n,e.TEXTURE_MIN_FILTER,f(o.minFilter)),1003!==o.minFilter&&1006!==o.minFilter&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.",o)),c=t.get("EXT_texture_filter_anisotropic")){if(1015===o.type&&null===t.get("OES_texture_float_linear"))return;if(1016===o.type&&null===t.get("OES_texture_half_float_linear"))return;(o.anisotropy>1||r.get(o).__currentAnisotropy)&&(e.texParameterf(n,c.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(o.anisotropy,i.getMaxAnisotropy())),r.get(o).__currentAnisotropy=o.anisotropy)}}function w(t,i,o,s){var c=a.convert(i.texture.format),l=a.convert(i.texture.type);n.texImage2D(s,0,c,i.width,i.height,0,c,l,null),e.bindFramebuffer(e.FRAMEBUFFER,t),e.framebufferTexture2D(e.FRAMEBUFFER,o,s,r.get(i.texture).__webglTexture,0),e.bindFramebuffer(e.FRAMEBUFFER,null)}function A(t,n){e.bindRenderbuffer(e.RENDERBUFFER,t),n.depthBuffer&&!n.stencilBuffer?(e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_COMPONENT16,n.width,n.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,t)):n.depthBuffer&&n.stencilBuffer?(e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,n.width,n.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,t)):e.renderbufferStorage(e.RENDERBUFFER,e.RGBA4,n.width,n.height),e.bindRenderbuffer(e.RENDERBUFFER,null)}function E(t){var n=r.get(t),i=!0===t.isWebGLRenderTargetCube;if(t.depthTexture){if(i)throw new Error("target.depthTexture not supported in Cube render targets");!function(t,n){if(n&&n.isWebGLRenderTargetCube)throw new Error("Depth Texture with cube render targets is not supported");if(e.bindFramebuffer(e.FRAMEBUFFER,t),!n.depthTexture||!n.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");r.get(n.depthTexture).__webglTexture&&n.depthTexture.image.width===n.width&&n.depthTexture.image.height===n.height||(n.depthTexture.image.width=n.width,n.depthTexture.image.height=n.height,n.depthTexture.needsUpdate=!0),v(n.depthTexture,0);var i=r.get(n.depthTexture).__webglTexture;if(1026===n.depthTexture.format)e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.TEXTURE_2D,i,0);else{if(1027!==n.depthTexture.format)throw new Error("Unknown depthTexture format");e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.TEXTURE_2D,i,0)}}(n.__webglFramebuffer,t)}else if(i){n.__webglDepthbuffer=[];for(var a=0;a<6;a++)e.bindFramebuffer(e.FRAMEBUFFER,n.__webglFramebuffer[a]),n.__webglDepthbuffer[a]=e.createRenderbuffer(),A(n.__webglDepthbuffer[a],t)}else e.bindFramebuffer(e.FRAMEBUFFER,n.__webglFramebuffer),n.__webglDepthbuffer=e.createRenderbuffer(),A(n.__webglDepthbuffer,t);e.bindFramebuffer(e.FRAMEBUFFER,null)}this.setTexture2D=v,this.setTextureCube=function(t,s){var c=r.get(t);if(6===t.image.length)if(t.version>0&&c.__version!==t.version){c.__image__webglTextureCube||(t.addEventListener("dispose",g),c.__image__webglTextureCube=e.createTexture(),o.textures++),n.activeTexture(e.TEXTURE0+s),n.bindTexture(e.TEXTURE_CUBE_MAP,c.__image__webglTextureCube),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,t.flipY);for(var l=t&&t.isCompressedTexture,u=t.image[0]&&t.image[0].isDataTexture,f=[],m=0;m<6;m++)f[m]=l||u?u?t.image[m].image:t.image[m]:h(t.image[m],i.maxCubemapSize);var y=d(f[0]),v=a.convert(t.format),w=a.convert(t.type);b(e.TEXTURE_CUBE_MAP,t,y);for(m=0;m<6;m++)if(l)for(var A,E=f[m].mipmaps,x=0,_=E.length;x<_;x++)A=E[x],1023!==t.format&&1022!==t.format?n.getCompressedTextureFormats().indexOf(v)>-1?n.compressedTexImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+m,x,v,A.width,A.height,0,A.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+m,x,v,A.width,A.height,0,v,w,A.data);else u?n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+m,0,v,f[m].width,f[m].height,0,v,w,f[m].data):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+m,0,v,v,w,f[m]);p(t,y)&&e.generateMipmap(e.TEXTURE_CUBE_MAP),c.__version=t.version,t.onUpdate&&t.onUpdate(t)}else n.activeTexture(e.TEXTURE0+s),n.bindTexture(e.TEXTURE_CUBE_MAP,c.__image__webglTextureCube)},this.setTextureCubeDynamic=function(t,i){n.activeTexture(e.TEXTURE0+i),n.bindTexture(e.TEXTURE_CUBE_MAP,r.get(t).__webglTexture)},this.setupRenderTarget=function(t){var i=r.get(t),a=r.get(t.texture);t.addEventListener("dispose",y),a.__webglTexture=e.createTexture(),o.textures++;var s=!0===t.isWebGLRenderTargetCube,c=d(t);if(s){i.__webglFramebuffer=[];for(var l=0;l<6;l++)i.__webglFramebuffer[l]=e.createFramebuffer()}else i.__webglFramebuffer=e.createFramebuffer();if(s){n.bindTexture(e.TEXTURE_CUBE_MAP,a.__webglTexture),b(e.TEXTURE_CUBE_MAP,t.texture,c);for(l=0;l<6;l++)w(i.__webglFramebuffer[l],t,e.COLOR_ATTACHMENT0,e.TEXTURE_CUBE_MAP_POSITIVE_X+l);p(t.texture,c)&&e.generateMipmap(e.TEXTURE_CUBE_MAP),n.bindTexture(e.TEXTURE_CUBE_MAP,null)}else n.bindTexture(e.TEXTURE_2D,a.__webglTexture),b(e.TEXTURE_2D,t.texture,c),w(i.__webglFramebuffer,t,e.COLOR_ATTACHMENT0,e.TEXTURE_2D),p(t.texture,c)&&e.generateMipmap(e.TEXTURE_2D),n.bindTexture(e.TEXTURE_2D,null);t.depthBuffer&&E(t)},this.updateRenderTargetMipmap=function(t){var i=t.texture;if(p(i,d(t))){var a=t.isWebGLRenderTargetCube?e.TEXTURE_CUBE_MAP:e.TEXTURE_2D,o=r.get(i).__webglTexture;n.bindTexture(a,o),e.generateMipmap(a),n.bindTexture(a,null)}}}function $t(){var e={};return{get:function(t){var n=t.uuid,r=e[n];return void 0===r&&(r={},e[n]=r),r},remove:function(t){delete e[t.uuid]},update:function(t,n,r){var i=t.uuid;e[i][n]=r},dispose:function(){e={}}}}function en(e,t,n){var r=new function(){var t=!1,n=new x,r=null,i=new x(0,0,0,0);return{setMask:function(n){r===n||t||(e.colorMask(n,n,n,n),r=n)},setLocked:function(e){t=e},setClear:function(t,r,a,o,s){!0===s&&(t*=o,r*=o,a*=o),n.set(t,r,a,o),!1===i.equals(n)&&(e.clearColor(t,r,a,o),i.copy(n))},reset:function(){t=!1,r=null,i.set(-1,0,0,0)}}},i=new function(){var t=!1,n=null,r=null,i=null;return{setTest:function(t){t?F(e.DEPTH_TEST):j(e.DEPTH_TEST)},setMask:function(r){n===r||t||(e.depthMask(r),n=r)},setFunc:function(t){if(r!==t){if(t)switch(t){case 0:e.depthFunc(e.NEVER);break;case 1:e.depthFunc(e.ALWAYS);break;case 2:e.depthFunc(e.LESS);break;case 3:e.depthFunc(e.LEQUAL);break;case 4:e.depthFunc(e.EQUAL);break;case 5:e.depthFunc(e.GEQUAL);break;case 6:e.depthFunc(e.GREATER);break;case 7:e.depthFunc(e.NOTEQUAL);break;default:e.depthFunc(e.LEQUAL)}else e.depthFunc(e.LEQUAL);r=t}},setLocked:function(e){t=e},setClear:function(t){i!==t&&(e.clearDepth(t),i=t)},reset:function(){t=!1,n=null,r=null,i=null}}},a=new function(){var t=!1,n=null,r=null,i=null,a=null,o=null,s=null,c=null,l=null;return{setTest:function(t){t?F(e.STENCIL_TEST):j(e.STENCIL_TEST)},setMask:function(r){n===r||t||(e.stencilMask(r),n=r)},setFunc:function(t,n,o){r===t&&i===n&&a===o||(e.stencilFunc(t,n,o),r=t,i=n,a=o)},setOp:function(t,n,r){o===t&&s===n&&c===r||(e.stencilOp(t,n,r),o=t,s=n,c=r)},setLocked:function(e){t=e},setClear:function(t){l!==t&&(e.clearStencil(t),l=t)},reset:function(){t=!1,n=null,r=null,i=null,a=null,o=null,s=null,c=null,l=null}}},o=e.getParameter(e.MAX_VERTEX_ATTRIBS),s=new Uint8Array(o),c=new Uint8Array(o),l=new Uint8Array(o),u={},h=null,d=null,p=null,f=null,m=null,g=null,y=null,v=null,b=null,w=!1,A=null,E=null,_=null,S=null,M=null,T=e.getParameter(e.MAX_COMBINED_TEXTURE_IMAGE_UNITS),R=!1,k=0,C=e.getParameter(e.VERSION);-1!==C.indexOf("WebGL")?(k=parseFloat(/^WebGL\ ([0-9])/.exec(C)[1]),R=k>=1):-1!==C.indexOf("OpenGL ES")&&(k=parseFloat(/^OpenGL\ ES\ ([0-9])/.exec(C)[1]),R=k>=2);var O=null,P={},I=new x,N=new x;function L(t,n,r){var i=new Uint8Array(4),a=e.createTexture();e.bindTexture(t,a),e.texParameteri(t,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(t,e.TEXTURE_MAG_FILTER,e.NEAREST);for(var o=0;o<r;o++)e.texImage2D(n+o,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,i);return a}var D={};function F(t){!0!==u[t]&&(e.enable(t),u[t]=!0)}function j(t){!1!==u[t]&&(e.disable(t),u[t]=!1)}function U(t,r,i,a,o,s,c,l){if(0!==t?F(e.BLEND):j(e.BLEND),5!==t){if(t!==p||l!==w)switch(t){case 2:l?(e.blendEquationSeparate(e.FUNC_ADD,e.FUNC_ADD),e.blendFuncSeparate(e.ONE,e.ONE,e.ONE,e.ONE)):(e.blendEquation(e.FUNC_ADD),e.blendFunc(e.SRC_ALPHA,e.ONE));break;case 3:l?(e.blendEquationSeparate(e.FUNC_ADD,e.FUNC_ADD),e.blendFuncSeparate(e.ZERO,e.ZERO,e.ONE_MINUS_SRC_COLOR,e.ONE_MINUS_SRC_ALPHA)):(e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ZERO,e.ONE_MINUS_SRC_COLOR));break;case 4:l?(e.blendEquationSeparate(e.FUNC_ADD,e.FUNC_ADD),e.blendFuncSeparate(e.ZERO,e.SRC_COLOR,e.ZERO,e.SRC_ALPHA)):(e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ZERO,e.SRC_COLOR));break;default:l?(e.blendEquationSeparate(e.FUNC_ADD,e.FUNC_ADD),e.blendFuncSeparate(e.ONE,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA)):(e.blendEquationSeparate(e.FUNC_ADD,e.FUNC_ADD),e.blendFuncSeparate(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA))}f=null,m=null,g=null,y=null,v=null,b=null}else o=o||r,s=s||i,c=c||a,r===f&&o===y||(e.blendEquationSeparate(n.convert(r),n.convert(o)),f=r,y=o),i===m&&a===g&&s===v&&c===b||(e.blendFuncSeparate(n.convert(i),n.convert(a),n.convert(s),n.convert(c)),m=i,g=a,v=s,b=c);p=t,w=l}function B(t){A!==t&&(t?e.frontFace(e.CW):e.frontFace(e.CCW),A=t)}function V(t){0!==t?(F(e.CULL_FACE),t!==E&&(1===t?e.cullFace(e.BACK):2===t?e.cullFace(e.FRONT):e.cullFace(e.FRONT_AND_BACK))):j(e.CULL_FACE),E=t}function z(t,n,r){t?(F(e.POLYGON_OFFSET_FILL),S===n&&M===r||(e.polygonOffset(n,r),S=n,M=r)):j(e.POLYGON_OFFSET_FILL)}function H(t){void 0===t&&(t=e.TEXTURE0+T-1),O!==t&&(e.activeTexture(t),O=t)}return D[e.TEXTURE_2D]=L(e.TEXTURE_2D,e.TEXTURE_2D,1),D[e.TEXTURE_CUBE_MAP]=L(e.TEXTURE_CUBE_MAP,e.TEXTURE_CUBE_MAP_POSITIVE_X,6),r.setClear(0,0,0,1),i.setClear(1),a.setClear(0),F(e.DEPTH_TEST),i.setFunc(3),B(!1),V(1),F(e.CULL_FACE),F(e.BLEND),U(1),{buffers:{color:r,depth:i,stencil:a},initAttributes:function(){for(var e=0,t=s.length;e<t;e++)s[e]=0},enableAttribute:function(n){s[n]=1,0===c[n]&&(e.enableVertexAttribArray(n),c[n]=1),0!==l[n]&&(t.get("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(n,0),l[n]=0)},enableAttributeAndDivisor:function(n,r){s[n]=1,0===c[n]&&(e.enableVertexAttribArray(n),c[n]=1),l[n]!==r&&(t.get("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(n,r),l[n]=r)},disableUnusedAttributes:function(){for(var t=0,n=c.length;t!==n;++t)c[t]!==s[t]&&(e.disableVertexAttribArray(t),c[t]=0)},enable:F,disable:j,getCompressedTextureFormats:function(){if(null===h&&(h=[],t.get("WEBGL_compressed_texture_pvrtc")||t.get("WEBGL_compressed_texture_s3tc")||t.get("WEBGL_compressed_texture_etc1")||t.get("WEBGL_compressed_texture_astc")))for(var n=e.getParameter(e.COMPRESSED_TEXTURE_FORMATS),r=0;r<n.length;r++)h.push(n[r]);return h},useProgram:function(t){return d!==t&&(e.useProgram(t),d=t,!0)},setBlending:U,setMaterial:function(t,n){2===t.side?j(e.CULL_FACE):F(e.CULL_FACE);var a=1===t.side;n&&(a=!a),B(a),!0===t.transparent?U(t.blending,t.blendEquation,t.blendSrc,t.blendDst,t.blendEquationAlpha,t.blendSrcAlpha,t.blendDstAlpha,t.premultipliedAlpha):U(0),i.setFunc(t.depthFunc),i.setTest(t.depthTest),i.setMask(t.depthWrite),r.setMask(t.colorWrite),z(t.polygonOffset,t.polygonOffsetFactor,t.polygonOffsetUnits)},setFlipSided:B,setCullFace:V,setLineWidth:function(t){t!==_&&(R&&e.lineWidth(t),_=t)},setPolygonOffset:z,setScissorTest:function(t){t?F(e.SCISSOR_TEST):j(e.SCISSOR_TEST)},activeTexture:H,bindTexture:function(t,n){null===O&&H();var r=P[O];void 0===r&&(r={type:void 0,texture:void 0},P[O]=r),r.type===t&&r.texture===n||(e.bindTexture(t,n||D[t]),r.type=t,r.texture=n)},compressedTexImage2D:function(){try{e.compressedTexImage2D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texImage2D:function(){try{e.texImage2D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},scissor:function(t){!1===I.equals(t)&&(e.scissor(t.x,t.y,t.z,t.w),I.copy(t))},viewport:function(t){!1===N.equals(t)&&(e.viewport(t.x,t.y,t.z,t.w),N.copy(t))},reset:function(){for(var t=0;t<c.length;t++)1===c[t]&&(e.disableVertexAttribArray(t),c[t]=0);u={},h=null,O=null,P={},d=null,p=null,A=null,E=null,r.reset(),i.reset(),a.reset()}}}function tn(e,t,n){var r;function i(t){if("highp"===t){if(e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.HIGH_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).precision>0)return"highp";t="mediump"}return"mediump"===t&&e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}var a=void 0!==n.precision?n.precision:"highp",o=i(a);o!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",o,"instead."),a=o);var s=!0===n.logarithmicDepthBuffer,c=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),l=e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),u=e.getParameter(e.MAX_TEXTURE_SIZE),h=e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),d=e.getParameter(e.MAX_VERTEX_ATTRIBS),p=e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),f=e.getParameter(e.MAX_VARYING_VECTORS),m=e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),g=l>0,y=!!t.get("OES_texture_float");return{getMaxAnisotropy:function(){if(void 0!==r)return r;var n=t.get("EXT_texture_filter_anisotropic");return r=null!==n?e.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0},getMaxPrecision:i,precision:a,logarithmicDepthBuffer:s,maxTextures:c,maxVertexTextures:l,maxTextureSize:u,maxCubemapSize:h,maxAttributes:d,maxVertexUniforms:p,maxVaryings:f,maxFragmentUniforms:m,vertexTextures:g,floatFragmentTextures:y,floatVertexTextures:g&&y}}function nn(e,t,n,r){We.call(this),this.type="PerspectiveCamera",this.fov=void 0!==e?e:50,this.zoom=1,this.near=void 0!==n?n:.1,this.far=void 0!==r?r:2e3,this.focus=10,this.aspect=void 0!==t?t:1,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}function rn(e){nn.call(this),this.cameras=e||[]}function an(e){var t=this,n=null,r=null,i=null,a=new y,o=new y;"undefined"!=typeof window&&"VRFrameData"in window&&(r=new window.VRFrameData);var s=new y,c=new v,l=new b,u=new nn;u.bounds=new x(0,0,.5,1),u.layers.enable(1);var h=new nn;h.bounds=new x(.5,0,.5,1),h.layers.enable(2);var d,p,f=new rn([u,h]);function m(){if(null!==n&&n.isPresenting){var r=n.getEyeParameters("left"),i=r.renderWidth,a=r.renderHeight;p=e.getPixelRatio(),d=e.getSize(),e.setDrawingBufferSize(2*i,a,1)}else t.enabled&&e.setDrawingBufferSize(d.width,d.height,p)}f.layers.enable(1),f.layers.enable(2),"undefined"!=typeof window&&window.addEventListener("vrdisplaypresentchange",m,!1),this.enabled=!1,this.userHeight=1.6,this.getDevice=function(){return n},this.setDevice=function(e){void 0!==e&&(n=e)},this.setPoseTarget=function(e){void 0!==e&&(i=e)},this.getCamera=function(e){if(null===n)return e;n.depthNear=e.near,n.depthFar=e.far,n.getFrameData(r);var d=n.stageParameters;d?a.fromArray(d.sittingToStandingTransform):a.makeTranslation(0,t.userHeight,0);var p=r.pose,m=null!==i?i:e;if(m.matrix.copy(a),m.matrix.decompose(m.position,m.quaternion,m.scale),null!==p.orientation&&(c.fromArray(p.orientation),m.quaternion.multiply(c)),null!==p.position&&(c.setFromRotationMatrix(a),l.fromArray(p.position),l.applyQuaternion(c),m.position.add(l)),m.updateMatrixWorld(),!1===n.isPresenting)return e;u.near=e.near,h.near=e.near,u.far=e.far,h.far=e.far,f.matrixWorld.copy(e.matrixWorld),f.matrixWorldInverse.copy(e.matrixWorldInverse),u.matrixWorldInverse.fromArray(r.leftViewMatrix),h.matrixWorldInverse.fromArray(r.rightViewMatrix),o.getInverse(a),u.matrixWorldInverse.multiply(o),h.matrixWorldInverse.multiply(o);var g=m.parent;null!==g&&(s.getInverse(g.matrixWorld),u.matrixWorldInverse.multiply(s),h.matrixWorldInverse.multiply(s)),u.matrixWorld.getInverse(u.matrixWorldInverse),h.matrixWorld.getInverse(h.matrixWorldInverse),u.projectionMatrix.fromArray(r.leftProjectionMatrix),h.projectionMatrix.fromArray(r.rightProjectionMatrix),f.projectionMatrix.copy(u.projectionMatrix);var y=n.getLayers();if(y.length){var v=y[0];null!==v.leftBounds&&4===v.leftBounds.length&&u.bounds.fromArray(v.leftBounds),null!==v.rightBounds&&4===v.rightBounds.length&&h.bounds.fromArray(v.rightBounds)}return f},this.getStandingMatrix=function(){return a},this.submitFrame=function(){n&&n.isPresenting&&n.submitFrame()},this.dispose=function(){"undefined"!=typeof window&&window.removeEventListener("vrdisplaypresentchange",m)}}function on(e){var t={};return{get:function(n){if(void 0!==t[n])return t[n];var r;switch(n){case"WEBGL_depth_texture":r=e.getExtension("WEBGL_depth_texture")||e.getExtension("MOZ_WEBGL_depth_texture")||e.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":r=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":r=e.getExtension("WEBGL_compressed_texture_s3tc")||e.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":r=e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;case"WEBGL_compressed_texture_etc1":r=e.getExtension("WEBGL_compressed_texture_etc1");break;default:r=e.getExtension(n)}return null===r&&console.warn("THREE.WebGLRenderer: "+n+" extension not supported."),t[n]=r,r}}}function sn(){var e=this,t=null,n=0,r=!1,i=!1,a=new Ne,o=new w,s={value:null,needsUpdate:!1};function c(){s.value!==t&&(s.value=t,s.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function l(t,n,r,i){var c=null!==t?t.length:0,l=null;if(0!==c){if(l=s.value,!0!==i||null===l){var u=r+4*c,h=n.matrixWorldInverse;o.getNormalMatrix(h),(null===l||l.length<u)&&(l=new Float32Array(u));for(var d=0,p=r;d!==c;++d,p+=4)a.copy(t[d]).applyMatrix4(h,o),a.normal.toArray(l,p),l[p+3]=a.constant}s.value=l,s.needsUpdate=!0}return e.numPlanes=c,l}this.uniform=s,this.numPlanes=0,this.numIntersection=0,this.init=function(e,i,a){var o=0!==e.length||i||0!==n||r;return r=i,t=l(e,a,0),n=e.length,o},this.beginShadows=function(){i=!0,l(null)},this.endShadows=function(){i=!1,c()},this.setState=function(e,a,o,u,h,d){if(!r||null===e||0===e.length||i&&!o)i?l(null):c();else{var p=i?0:n,f=4*p,m=h.clippingState||null;s.value=m,m=l(e,u,f,d);for(var g=0;g!==f;++g)m[g]=t[g];h.clippingState=m,this.numIntersection=a?this.numPlanes:0,this.numPlanes+=p}}}function cn(e,t){return{convert:function(n){var r;if(1e3===n)return e.REPEAT;if(1001===n)return e.CLAMP_TO_EDGE;if(1002===n)return e.MIRRORED_REPEAT;if(1003===n)return e.NEAREST;if(1004===n)return e.NEAREST_MIPMAP_NEAREST;if(1005===n)return e.NEAREST_MIPMAP_LINEAR;if(1006===n)return e.LINEAR;if(1007===n)return e.LINEAR_MIPMAP_NEAREST;if(1008===n)return e.LINEAR_MIPMAP_LINEAR;if(1009===n)return e.UNSIGNED_BYTE;if(1017===n)return e.UNSIGNED_SHORT_4_4_4_4;if(1018===n)return e.UNSIGNED_SHORT_5_5_5_1;if(1019===n)return e.UNSIGNED_SHORT_5_6_5;if(1010===n)return e.BYTE;if(1011===n)return e.SHORT;if(1012===n)return e.UNSIGNED_SHORT;if(1013===n)return e.INT;if(1014===n)return e.UNSIGNED_INT;if(1015===n)return e.FLOAT;if(1016===n&&null!==(r=t.get("OES_texture_half_float")))return r.HALF_FLOAT_OES;if(1021===n)return e.ALPHA;if(1022===n)return e.RGB;if(1023===n)return e.RGBA;if(1024===n)return e.LUMINANCE;if(1025===n)return e.LUMINANCE_ALPHA;if(1026===n)return e.DEPTH_COMPONENT;if(1027===n)return e.DEPTH_STENCIL;if(100===n)return e.FUNC_ADD;if(101===n)return e.FUNC_SUBTRACT;if(102===n)return e.FUNC_REVERSE_SUBTRACT;if(200===n)return e.ZERO;if(201===n)return e.ONE;if(202===n)return e.SRC_COLOR;if(203===n)return e.ONE_MINUS_SRC_COLOR;if(204===n)return e.SRC_ALPHA;if(205===n)return e.ONE_MINUS_SRC_ALPHA;if(206===n)return e.DST_ALPHA;if(207===n)return e.ONE_MINUS_DST_ALPHA;if(208===n)return e.DST_COLOR;if(209===n)return e.ONE_MINUS_DST_COLOR;if(210===n)return e.SRC_ALPHA_SATURATE;if((33776===n||33777===n||33778===n||33779===n)&&null!==(r=t.get("WEBGL_compressed_texture_s3tc"))){if(33776===n)return r.COMPRESSED_RGB_S3TC_DXT1_EXT;if(33777===n)return r.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(33778===n)return r.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(33779===n)return r.COMPRESSED_RGBA_S3TC_DXT5_EXT}if((35840===n||35841===n||35842===n||35843===n)&&null!==(r=t.get("WEBGL_compressed_texture_pvrtc"))){if(35840===n)return r.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(35841===n)return r.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(35842===n)return r.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(35843===n)return r.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(36196===n&&null!==(r=t.get("WEBGL_compressed_texture_etc1")))return r.COMPRESSED_RGB_ETC1_WEBGL;if((37808===n||37809===n||37810===n||37811===n||37812===n||37813===n||37814===n||37815===n||37816===n||37817===n||37818===n||37819===n||37820===n||37821===n)&&null!==(r=t.get("WEBGL_compressed_texture_astc")))return n;if((103===n||104===n)&&null!==(r=t.get("EXT_blend_minmax"))){if(103===n)return r.MIN_EXT;if(104===n)return r.MAX_EXT}return 1020===n&&null!==(r=t.get("WEBGL_depth_texture"))?r.UNSIGNED_INT_24_8_WEBGL:0}}}function ln(){var e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];var n;switch(t.type){case"DirectionalLight":n={direction:new b,color:new fe,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new g};break;case"SpotLight":n={position:new b,direction:new b,color:new fe,distance:0,coneCos:0,penumbraCos:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new g};break;case"PointLight":n={position:new b,color:new fe,distance:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new g,shadowCameraNear:1,shadowCameraFar:1e3};break;case"HemisphereLight":n={direction:new b,skyColor:new fe,groundColor:new fe};break;case"RectAreaLight":n={color:new fe,position:new b,halfWidth:new b,halfHeight:new b}}return e[t.id]=n,n}}}nn.prototype=Object.assign(Object.create(We.prototype),{constructor:nn,isPerspectiveCamera:!0,copy:function(e,t){return We.prototype.copy.call(this,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=null===e.view?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this},setFocalLength:function(e){var t=.5*this.getFilmHeight()/e;this.fov=2*m.RAD2DEG*Math.atan(t),this.updateProjectionMatrix()},getFocalLength:function(){var e=Math.tan(.5*m.DEG2RAD*this.fov);return.5*this.getFilmHeight()/e},getEffectiveFOV:function(){return 2*m.RAD2DEG*Math.atan(Math.tan(.5*m.DEG2RAD*this.fov)/this.zoom)},getFilmWidth:function(){return this.filmGauge*Math.min(this.aspect,1)},getFilmHeight:function(){return this.filmGauge/Math.max(this.aspect,1)},setViewOffset:function(e,t,n,r,i,a){this.aspect=e/t,null===this.view&&(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=r,this.view.width=i,this.view.height=a,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var e=this.near,t=e*Math.tan(.5*m.DEG2RAD*this.fov)/this.zoom,n=2*t,r=this.aspect*n,i=-.5*r,a=this.view;if(null!==this.view&&this.view.enabled){var o=a.fullWidth,s=a.fullHeight;i+=a.offsetX*r/o,t-=a.offsetY*n/s,r*=a.width/o,n*=a.height/s}var c=this.filmOffset;0!==c&&(i+=e*c/this.getFilmWidth()),this.projectionMatrix.makePerspective(i,i+r,t,t-n,e,this.far)},toJSON:function(e){var t=qe.prototype.toJSON.call(this,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,null!==this.view&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}),rn.prototype=Object.assign(Object.create(nn.prototype),{constructor:rn,isArrayCamera:!0});var un,hn,dn,pn,fn,mn,gn,yn,vn=0;function bn(){var e=new ln,t={id:vn++,hash:"",ambient:[0,0,0],directional:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],point:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]},n=new b,r=new y,i=new y;return{setup:function(a,o,s){for(var c=0,l=0,u=0,h=0,d=0,p=0,f=0,m=0,g=s.matrixWorldInverse,y=0,v=a.length;y<v;y++){var b=a[y],w=b.color,A=b.intensity,E=b.distance,x=b.shadow&&b.shadow.map?b.shadow.map.texture:null;if(b.isAmbientLight)c+=w.r*A,l+=w.g*A,u+=w.b*A;else if(b.isDirectionalLight){if((S=e.get(b)).color.copy(b.color).multiplyScalar(b.intensity),S.direction.setFromMatrixPosition(b.matrixWorld),n.setFromMatrixPosition(b.target.matrixWorld),S.direction.sub(n),S.direction.transformDirection(g),S.shadow=b.castShadow,b.castShadow){var _=b.shadow;S.shadowBias=_.bias,S.shadowRadius=_.radius,S.shadowMapSize=_.mapSize}t.directionalShadowMap[h]=x,t.directionalShadowMatrix[h]=b.shadow.matrix,t.directional[h]=S,h++}else if(b.isSpotLight){if((S=e.get(b)).position.setFromMatrixPosition(b.matrixWorld),S.position.applyMatrix4(g),S.color.copy(w).multiplyScalar(A),S.distance=E,S.direction.setFromMatrixPosition(b.matrixWorld),n.setFromMatrixPosition(b.target.matrixWorld),S.direction.sub(n),S.direction.transformDirection(g),S.coneCos=Math.cos(b.angle),S.penumbraCos=Math.cos(b.angle*(1-b.penumbra)),S.decay=0===b.distance?0:b.decay,S.shadow=b.castShadow,b.castShadow){_=b.shadow;S.shadowBias=_.bias,S.shadowRadius=_.radius,S.shadowMapSize=_.mapSize}t.spotShadowMap[p]=x,t.spotShadowMatrix[p]=b.shadow.matrix,t.spot[p]=S,p++}else if(b.isRectAreaLight){(S=e.get(b)).color.copy(w).multiplyScalar(A),S.position.setFromMatrixPosition(b.matrixWorld),S.position.applyMatrix4(g),i.identity(),r.copy(b.matrixWorld),r.premultiply(g),i.extractRotation(r),S.halfWidth.set(.5*b.width,0,0),S.halfHeight.set(0,.5*b.height,0),S.halfWidth.applyMatrix4(i),S.halfHeight.applyMatrix4(i),t.rectArea[f]=S,f++}else if(b.isPointLight){if((S=e.get(b)).position.setFromMatrixPosition(b.matrixWorld),S.position.applyMatrix4(g),S.color.copy(b.color).multiplyScalar(b.intensity),S.distance=b.distance,S.decay=0===b.distance?0:b.decay,S.shadow=b.castShadow,b.castShadow){_=b.shadow;S.shadowBias=_.bias,S.shadowRadius=_.radius,S.shadowMapSize=_.mapSize,S.shadowCameraNear=_.camera.near,S.shadowCameraFar=_.camera.far}t.pointShadowMap[d]=x,t.pointShadowMatrix[d]=b.shadow.matrix,t.point[d]=S,d++}else if(b.isHemisphereLight){var S;(S=e.get(b)).direction.setFromMatrixPosition(b.matrixWorld),S.direction.transformDirection(g),S.direction.normalize(),S.skyColor.copy(b.color).multiplyScalar(A),S.groundColor.copy(b.groundColor).multiplyScalar(A),t.hemi[m]=S,m++}}t.ambient[0]=c,t.ambient[1]=l,t.ambient[2]=u,t.directional.length=h,t.spot.length=p,t.rectArea.length=f,t.point.length=d,t.hemi.length=m,t.hash=t.id+","+h+","+d+","+p+","+f+","+m+","+o.length},state:t}}function wn(){var e=new bn,t=[],n=[],r=[];return{init:function(){t.length=0,n.length=0,r.length=0},state:{lightsArray:t,shadowsArray:n,spritesArray:r,lights:e},setupLights:function(r){e.setup(t,n,r)},pushLight:function(e){t.push(e)},pushShadow:function(e){n.push(e)},pushSprite:function(e){r.push(e)}}}function An(){var e={};return{get:function(t,n){var r=t.id+","+n.id,i=e[r];return void 0===i&&(i=new wn,e[r]=i),i},dispose:function(){e={}}}}function En(e){console.log("THREE.WebGLRenderer","90");var t=void 0!==(e=e||{}).canvas?e.canvas:document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),n=void 0!==e.context?e.context:null,r=void 0!==e.alpha&&e.alpha,i=void 0===e.depth||e.depth,a=void 0===e.stencil||e.stencil,o=void 0!==e.antialias&&e.antialias,s=void 0===e.premultipliedAlpha||e.premultipliedAlpha,c=void 0!==e.preserveDrawingBuffer&&e.preserveDrawingBuffer,l=void 0!==e.powerPreference?e.powerPreference:"default",u=null,h=null;this.domElement=t,this.context=null,this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.gammaInput=!1,this.gammaOutput=!1,this.physicallyCorrectLights=!1,this.toneMapping=1,this.toneMappingExposure=1,this.toneMappingWhitePoint=1,this.maxMorphTargets=8,this.maxMorphNormals=4;var d,p,f,g,v,w,A,E,_,S,T,R,k,C,O,P,I,N,L=this,D=!1,F=null,j=null,U=-1,B="",V=null,z=null,H=new x,G=new x,q=null,W=0,J=t.width,Z=t.height,X=1,Y=new x(0,0,J,Z),K=new x(0,0,J,Z),Q=!1,$=new Le,ee=new sn,te=!1,ne=!1,re=new y,ie=new b,ae={geometries:0,textures:0},oe={frame:0,calls:0,vertices:0,faces:0,points:0};function se(){return null===F?X:1}this.info={render:oe,memory:ae,programs:null,autoReset:!0,reset:function(){oe.frame++,oe.calls=0,oe.vertices=0,oe.faces=0,oe.points=0}};try{var ce={alpha:r,depth:i,stencil:a,antialias:o,premultipliedAlpha:s,preserveDrawingBuffer:c,powerPreference:l};if(t.addEventListener("webglcontextlost",pe,!1),t.addEventListener("webglcontextrestored",fe,!1),null===(d=n||t.getContext("webgl",ce)||t.getContext("experimental-webgl",ce)))throw null!==t.getContext("webgl")?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.");void 0===d.getShaderPrecisionFormat&&(d.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(e){console.error("THREE.WebGLRenderer: "+e.message)}function le(){(p=new on(d)).get("WEBGL_depth_texture"),p.get("OES_texture_float"),p.get("OES_texture_float_linear"),p.get("OES_texture_half_float"),p.get("OES_texture_half_float_linear"),p.get("OES_standard_derivatives"),p.get("OES_element_index_uint"),p.get("ANGLE_instanced_arrays"),N=new cn(d,p),f=new tn(d,p,e),(g=new en(d,p,N)).scissor(G.copy(K).multiplyScalar(X)),g.viewport(H.copy(Y).multiplyScalar(X)),v=new $t,w=new Qt(d,p,g,v,f,N,ae,oe),A=new Fe(d),E=new jt(d,A,ae),_=new Ut(E,oe),C=new Lt(d),S=new Kt(L,p,f),T=new It,R=new An,k=new kt(L,g,E,s),O=new Ft(d,p,oe),P=new Dt(d,p,oe),I=new we(L,d,g,w,f),L.info.programs=S.programs,L.context=d,L.capabilities=f,L.extensions=p,L.properties=v,L.renderLists=T,L.state=g}le();var ue=new an(L);this.vr=ue;var he=new De(L,_,f.maxTextureSize);function pe(e){e.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),D=!0}function fe(){console.log("THREE.WebGLRenderer: Context Restored."),D=!1,le()}function ye(e){var t=e.target;t.removeEventListener("dispose",ye),function(e){be(e),v.remove(e)}(t)}function be(e){var t=v.get(e).program;e.program=void 0,void 0!==t&&S.releaseProgram(t)}this.shadowMap=he,this.getContext=function(){return d},this.getContextAttributes=function(){return d.getContextAttributes()},this.forceContextLoss=function(){var e=p.get("WEBGL_lose_context");e&&e.loseContext()},this.forceContextRestore=function(){var e=p.get("WEBGL_lose_context");e&&e.restoreContext()},this.getPixelRatio=function(){return X},this.setPixelRatio=function(e){void 0!==e&&(X=e,this.setSize(J,Z,!1))},this.getSize=function(){return{width:J,height:Z}},this.setSize=function(e,n,r){var i=ue.getDevice();i&&i.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(J=e,Z=n,t.width=e*X,t.height=n*X,!1!==r&&(t.style.width=e+"px",t.style.height=n+"px"),this.setViewport(0,0,e,n))},this.getDrawingBufferSize=function(){return{width:J*X,height:Z*X}},this.setDrawingBufferSize=function(e,n,r){J=e,Z=n,X=r,t.width=e*r,t.height=n*r,this.setViewport(0,0,e,n)},this.getCurrentViewport=function(){return H},this.setViewport=function(e,t,n,r){Y.set(e,Z-t-r,n,r),g.viewport(H.copy(Y).multiplyScalar(X))},this.setScissor=function(e,t,n,r){K.set(e,Z-t-r,n,r),g.scissor(G.copy(K).multiplyScalar(X))},this.setScissorTest=function(e){g.setScissorTest(Q=e)},this.getClearColor=function(){return k.getClearColor()},this.setClearColor=function(){k.setClearColor.apply(k,arguments)},this.getClearAlpha=function(){return k.getClearAlpha()},this.setClearAlpha=function(){k.setClearAlpha.apply(k,arguments)},this.clear=function(e,t,n){var r=0;(void 0===e||e)&&(r|=d.COLOR_BUFFER_BIT),(void 0===t||t)&&(r|=d.DEPTH_BUFFER_BIT),(void 0===n||n)&&(r|=d.STENCIL_BUFFER_BIT),d.clear(r)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.clearTarget=function(e,t,n,r){this.setRenderTarget(e),this.clear(t,n,r)},this.dispose=function(){t.removeEventListener("webglcontextlost",pe,!1),t.removeEventListener("webglcontextrestored",fe,!1),T.dispose(),R.dispose(),v.dispose(),_.dispose(),ue.dispose(),_e()},this.renderBufferImmediate=function(e,t,n){g.initAttributes();var r=v.get(e);e.hasPositions&&!r.position&&(r.position=d.createBuffer()),e.hasNormals&&!r.normal&&(r.normal=d.createBuffer()),e.hasUvs&&!r.uv&&(r.uv=d.createBuffer()),e.hasColors&&!r.color&&(r.color=d.createBuffer());var i=t.getAttributes();if(e.hasPositions&&(d.bindBuffer(d.ARRAY_BUFFER,r.position),d.bufferData(d.ARRAY_BUFFER,e.positionArray,d.DYNAMIC_DRAW),g.enableAttribute(i.position),d.vertexAttribPointer(i.position,3,d.FLOAT,!1,0,0)),e.hasNormals){if(d.bindBuffer(d.ARRAY_BUFFER,r.normal),!n.isMeshPhongMaterial&&!n.isMeshStandardMaterial&&!n.isMeshNormalMaterial&&!0===n.flatShading)for(var a=0,o=3*e.count;a<o;a+=9){var s=e.normalArray,c=(s[a+0]+s[a+3]+s[a+6])/3,l=(s[a+1]+s[a+4]+s[a+7])/3,u=(s[a+2]+s[a+5]+s[a+8])/3;s[a+0]=c,s[a+1]=l,s[a+2]=u,s[a+3]=c,s[a+4]=l,s[a+5]=u,s[a+6]=c,s[a+7]=l,s[a+8]=u}d.bufferData(d.ARRAY_BUFFER,e.normalArray,d.DYNAMIC_DRAW),g.enableAttribute(i.normal),d.vertexAttribPointer(i.normal,3,d.FLOAT,!1,0,0)}e.hasUvs&&n.map&&(d.bindBuffer(d.ARRAY_BUFFER,r.uv),d.bufferData(d.ARRAY_BUFFER,e.uvArray,d.DYNAMIC_DRAW),g.enableAttribute(i.uv),d.vertexAttribPointer(i.uv,2,d.FLOAT,!1,0,0)),e.hasColors&&0!==n.vertexColors&&(d.bindBuffer(d.ARRAY_BUFFER,r.color),d.bufferData(d.ARRAY_BUFFER,e.colorArray,d.DYNAMIC_DRAW),g.enableAttribute(i.color),d.vertexAttribPointer(i.color,3,d.FLOAT,!1,0,0)),g.disableUnusedAttributes(),d.drawArrays(d.TRIANGLES,0,e.count),e.count=0},this.renderBufferDirect=function(e,t,n,r,i,a){var o=i.isMesh&&i.matrixWorld.determinant()<0;g.setMaterial(r,o);var s=Ce(e,t,r,i),c=n.id+"_"+s.id+"_"+(!0===r.wireframe),l=!1;c!==B&&(B=c,l=!0),i.morphTargetInfluences&&(C.update(i,n,r,s),l=!0);var u,h=n.index,f=n.attributes.position,m=1;!0===r.wireframe&&(h=E.getWireframeAttribute(n),m=2);var y=O;null!==h&&(u=A.get(h),(y=P).setIndex(u)),l&&(!function(e,t,n,r){if(n&&n.isInstancedBufferGeometry&&null===p.get("ANGLE_instanced_arrays"))return void console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");void 0===r&&(r=0);g.initAttributes();var i=n.attributes,a=t.getAttributes(),o=e.defaultAttributeValues;for(var s in a){var c=a[s];if(c>=0){var l=i[s];if(void 0!==l){var u=l.normalized,h=l.itemSize,f=A.get(l);if(void 0===f)continue;var m=f.buffer,y=f.type,v=f.bytesPerElement;if(l.isInterleavedBufferAttribute){var b=l.data,w=b.stride,E=l.offset;b&&b.isInstancedInterleavedBuffer?(g.enableAttributeAndDivisor(c,b.meshPerAttribute),void 0===n.maxInstancedCount&&(n.maxInstancedCount=b.meshPerAttribute*b.count)):g.enableAttribute(c),d.bindBuffer(d.ARRAY_BUFFER,m),d.vertexAttribPointer(c,h,y,u,w*v,(r*w+E)*v)}else l.isInstancedBufferAttribute?(g.enableAttributeAndDivisor(c,l.meshPerAttribute),void 0===n.maxInstancedCount&&(n.maxInstancedCount=l.meshPerAttribute*l.count)):g.enableAttribute(c),d.bindBuffer(d.ARRAY_BUFFER,m),d.vertexAttribPointer(c,h,y,u,0,r*h*v)}else if(void 0!==o){var x=o[s];if(void 0!==x)switch(x.length){case 2:d.vertexAttrib2fv(c,x);break;case 3:d.vertexAttrib3fv(c,x);break;case 4:d.vertexAttrib4fv(c,x);break;default:d.vertexAttrib1fv(c,x)}}}}g.disableUnusedAttributes()}(r,s,n),null!==h&&d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,u.buffer));var v=1/0;null!==h?v=h.count:void 0!==f&&(v=f.count);var b=n.drawRange.start*m,w=n.drawRange.count*m,x=null!==a?a.start*m:0,_=null!==a?a.count*m:1/0,S=Math.max(b,x),M=Math.min(v,b+w,x+_)-1,T=Math.max(0,M-S+1);if(0!==T){if(i.isMesh)if(!0===r.wireframe)g.setLineWidth(r.wireframeLinewidth*se()),y.setMode(d.LINES);else switch(i.drawMode){case 0:y.setMode(d.TRIANGLES);break;case 1:y.setMode(d.TRIANGLE_STRIP);break;case 2:y.setMode(d.TRIANGLE_FAN)}else if(i.isLine){var R=r.linewidth;void 0===R&&(R=1),g.setLineWidth(R*se()),i.isLineSegments?y.setMode(d.LINES):i.isLineLoop?y.setMode(d.LINE_LOOP):y.setMode(d.LINE_STRIP)}else i.isPoints&&y.setMode(d.POINTS);n&&n.isInstancedBufferGeometry?n.maxInstancedCount>0&&y.renderInstances(n,S,T):y.render(S,T)}},this.compile=function(e,t){(h=R.get(e,t)).init(),e.traverse((function(e){e.isLight&&(h.pushLight(e),e.castShadow&&h.pushShadow(e))})),h.setupLights(t),e.traverse((function(t){if(t.material)if(Array.isArray(t.material))for(var n=0;n<t.material.length;n++)ke(t.material[n],e.fog,t);else ke(t.material,e.fog,t)}))};var Ae,Ee=!1,xe=null;function _e(){Ee=!1}function Se(){var e=ue.getDevice();e&&e.isPresenting?e.requestAnimationFrame(Me):window.requestAnimationFrame(Me)}function Me(e){!1!==Ee&&(xe(e),Se())}function Te(e,t,n,r){for(var i=0,a=e.length;i<a;i++){var o=e[i],s=o.object,c=o.geometry,l=void 0===r?o.material:r,u=o.group;if(n.isArrayCamera){z=n;for(var h=n.cameras,d=0,p=h.length;d<p;d++){var f=h[d];if(s.layers.test(f.layers)){var m=f.bounds,y=m.x*J,v=m.y*Z,b=m.z*J,w=m.w*Z;g.viewport(H.set(y,v,b,w).multiplyScalar(X)),Re(s,t,f,c,l,u)}}}else z=null,Re(s,t,n,c,l,u)}}function Re(e,t,n,r,i,a){if(e.onBeforeRender(L,t,n,r,i,a),h=R.get(t,z||n),e.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,e.matrixWorld),e.normalMatrix.getNormalMatrix(e.modelViewMatrix),e.isImmediateRenderObject){var o=e.isMesh&&e.matrixWorld.determinant()<0;g.setMaterial(i,o);var s=Ce(n,t.fog,i,e);B="",function(e,t,n){e.render((function(e){L.renderBufferImmediate(e,t,n)}))}(e,s,i)}else L.renderBufferDirect(n,t.fog,r,i,e,a);e.onAfterRender(L,t,n,r,i,a),h=R.get(t,z||n)}function ke(e,t,n){var r=v.get(e),i=h.state.lights,a=h.state.shadowsArray,o=S.getParameters(e,i.state,a,t,ee.numPlanes,ee.numIntersection,n),s=S.getProgramCode(e,o),c=r.program,l=!0;if(void 0===c)e.addEventListener("dispose",ye);else if(c.code!==s)be(e);else if(r.lightsHash!==i.state.hash)v.update(e,"lightsHash",i.state.hash),l=!1;else{if(void 0!==o.shaderID)return;l=!1}if(l){if(o.shaderID){var u=ve[o.shaderID];r.shader={name:e.type,uniforms:ge.clone(u.uniforms),vertexShader:u.vertexShader,fragmentShader:u.fragmentShader}}else r.shader={name:e.type,uniforms:e.uniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader};e.onBeforeCompile(r.shader),c=S.acquireProgram(e,r.shader,o,s),r.program=c,e.program=c}var d=c.getAttributes();if(e.morphTargets){e.numSupportedMorphTargets=0;for(var p=0;p<L.maxMorphTargets;p++)d["morphTarget"+p]>=0&&e.numSupportedMorphTargets++}if(e.morphNormals){e.numSupportedMorphNormals=0;for(p=0;p<L.maxMorphNormals;p++)d["morphNormal"+p]>=0&&e.numSupportedMorphNormals++}var f=r.shader.uniforms;(e.isShaderMaterial||e.isRawShaderMaterial)&&!0!==e.clipping||(r.numClippingPlanes=ee.numPlanes,r.numIntersection=ee.numIntersection,f.clippingPlanes=ee.uniform),r.fog=t,r.lightsHash=i.state.hash,e.lights&&(f.ambientLightColor.value=i.state.ambient,f.directionalLights.value=i.state.directional,f.spotLights.value=i.state.spot,f.rectAreaLights.value=i.state.rectArea,f.pointLights.value=i.state.point,f.hemisphereLights.value=i.state.hemi,f.directionalShadowMap.value=i.state.directionalShadowMap,f.directionalShadowMatrix.value=i.state.directionalShadowMatrix,f.spotShadowMap.value=i.state.spotShadowMap,f.spotShadowMatrix.value=i.state.spotShadowMatrix,f.pointShadowMap.value=i.state.pointShadowMap,f.pointShadowMatrix.value=i.state.pointShadowMatrix);var m=r.program.getUniforms(),g=de.seqWithValue(m.seq,f);r.uniformsList=g}function Ce(e,t,n,r){W=0;var i=v.get(n),a=h.state.lights;if(te&&(ne||e!==V)){var o=e===V&&n.id===U;ee.setState(n.clippingPlanes,n.clipIntersection,n.clipShadows,e,i,o)}!1===n.needsUpdate&&(void 0===i.program||n.fog&&i.fog!==t||n.lights&&i.lightsHash!==a.state.hash?n.needsUpdate=!0:void 0===i.numClippingPlanes||i.numClippingPlanes===ee.numPlanes&&i.numIntersection===ee.numIntersection||(n.needsUpdate=!0)),n.needsUpdate&&(ke(n,t,r),n.needsUpdate=!1);var s,c,l=!1,u=!1,p=!1,y=i.program,b=y.getUniforms(),w=i.shader.uniforms;if(g.useProgram(y.program)&&(l=!0,u=!0,p=!0),n.id!==U&&(U=n.id,u=!0),l||e!==V){if(b.setValue(d,"projectionMatrix",e.projectionMatrix),f.logarithmicDepthBuffer&&b.setValue(d,"logDepthBufFC",2/(Math.log(e.far+1)/Math.LN2)),V!==(z||e)&&(V=z||e,u=!0,p=!0),n.isShaderMaterial||n.isMeshPhongMaterial||n.isMeshStandardMaterial||n.envMap){var A=b.map.cameraPosition;void 0!==A&&A.setValue(d,ie.setFromMatrixPosition(e.matrixWorld))}(n.isMeshPhongMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial||n.skinning)&&b.setValue(d,"viewMatrix",e.matrixWorldInverse)}if(n.skinning){b.setOptional(d,r,"bindMatrix"),b.setOptional(d,r,"bindMatrixInverse");var E=r.skeleton;if(E){var x=E.bones;if(f.floatVertexTextures){if(void 0===E.boneTexture){var _=Math.sqrt(4*x.length);_=m.ceilPowerOfTwo(_),_=Math.max(_,4);var S=new Float32Array(_*_*4);S.set(E.boneMatrices);var T=new M(S,_,_,1023,1015);T.needsUpdate=!0,E.boneMatrices=S,E.boneTexture=T,E.boneTextureSize=_}b.setValue(d,"boneTexture",E.boneTexture),b.setValue(d,"boneTextureSize",E.boneTextureSize)}else b.setOptional(d,E,"boneMatrices")}}return u&&(b.setValue(d,"toneMappingExposure",L.toneMappingExposure),b.setValue(d,"toneMappingWhitePoint",L.toneMappingWhitePoint),n.lights&&(c=p,(s=w).ambientLightColor.needsUpdate=c,s.directionalLights.needsUpdate=c,s.pointLights.needsUpdate=c,s.spotLights.needsUpdate=c,s.rectAreaLights.needsUpdate=c,s.hemisphereLights.needsUpdate=c),t&&n.fog&&function(e,t){e.fogColor.value=t.color,t.isFog?(e.fogNear.value=t.near,e.fogFar.value=t.far):t.isFogExp2&&(e.fogDensity.value=t.density)}(w,t),n.isMeshBasicMaterial?Oe(w,n):n.isMeshLambertMaterial?(Oe(w,n),function(e,t){t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap)}(w,n)):n.isMeshPhongMaterial?(Oe(w,n),n.isMeshToonMaterial?function(e,t){Pe(e,t),t.gradientMap&&(e.gradientMap.value=t.gradientMap)}(w,n):Pe(w,n)):n.isMeshStandardMaterial?(Oe(w,n),n.isMeshPhysicalMaterial?function(e,t){e.clearCoat.value=t.clearCoat,e.clearCoatRoughness.value=t.clearCoatRoughness,Ie(e,t)}(w,n):Ie(w,n)):n.isMeshDepthMaterial?(Oe(w,n),function(e,t){t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(w,n)):n.isMeshDistanceMaterial?(Oe(w,n),function(e,t){t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias);e.referencePosition.value.copy(t.referencePosition),e.nearDistance.value=t.nearDistance,e.farDistance.value=t.farDistance}(w,n)):n.isMeshNormalMaterial?(Oe(w,n),function(e,t){t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale);t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale));t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(w,n)):n.isLineBasicMaterial?(function(e,t){e.diffuse.value=t.color,e.opacity.value=t.opacity}(w,n),n.isLineDashedMaterial&&function(e,t){e.dashSize.value=t.dashSize,e.totalSize.value=t.dashSize+t.gapSize,e.scale.value=t.scale}(w,n)):n.isPointsMaterial?function(e,t){if(e.diffuse.value=t.color,e.opacity.value=t.opacity,e.size.value=t.size*X,e.scale.value=.5*Z,e.map.value=t.map,null!==t.map){if(!0===t.map.matrixAutoUpdate){var n=t.map.offset,r=t.map.repeat,i=t.map.rotation,a=t.map.center;t.map.matrix.setUvTransform(n.x,n.y,r.x,r.y,i,a.x,a.y)}e.uvTransform.value.copy(t.map.matrix)}}(w,n):n.isShadowMaterial&&(w.color.value=n.color,w.opacity.value=n.opacity),void 0!==w.ltc_1&&(w.ltc_1.value=me.LTC_1),void 0!==w.ltc_2&&(w.ltc_2.value=me.LTC_2),de.upload(d,i.uniformsList,w,L)),n.isShaderMaterial&&!0===n.uniformsNeedUpdate&&(de.upload(d,i.uniformsList,w,L),n.uniformsNeedUpdate=!1),b.setValue(d,"modelViewMatrix",r.modelViewMatrix),b.setValue(d,"normalMatrix",r.normalMatrix),b.setValue(d,"modelMatrix",r.matrixWorld),y}function Oe(e,t){var n;if(e.opacity.value=t.opacity,t.color&&(e.diffuse.value=t.color),t.emissive&&e.emissive.value.copy(t.emissive).multiplyScalar(t.emissiveIntensity),t.map&&(e.map.value=t.map),t.alphaMap&&(e.alphaMap.value=t.alphaMap),t.specularMap&&(e.specularMap.value=t.specularMap),t.envMap&&(e.envMap.value=t.envMap,e.flipEnvMap.value=t.envMap&&t.envMap.isCubeTexture?-1:1,e.reflectivity.value=t.reflectivity,e.refractionRatio.value=t.refractionRatio),t.lightMap&&(e.lightMap.value=t.lightMap,e.lightMapIntensity.value=t.lightMapIntensity),t.aoMap&&(e.aoMap.value=t.aoMap,e.aoMapIntensity.value=t.aoMapIntensity),t.map?n=t.map:t.specularMap?n=t.specularMap:t.displacementMap?n=t.displacementMap:t.normalMap?n=t.normalMap:t.bumpMap?n=t.bumpMap:t.roughnessMap?n=t.roughnessMap:t.metalnessMap?n=t.metalnessMap:t.alphaMap?n=t.alphaMap:t.emissiveMap&&(n=t.emissiveMap),void 0!==n){if(n.isWebGLRenderTarget&&(n=n.texture),!0===n.matrixAutoUpdate){var r=n.offset,i=n.repeat,a=n.rotation,o=n.center;n.matrix.setUvTransform(r.x,r.y,i.x,i.y,a,o.x,o.y)}e.uvTransform.value.copy(n.matrix)}}function Pe(e,t){e.specular.value=t.specular,e.shininess.value=Math.max(t.shininess,1e-4),t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap),t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale)),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}function Ie(e,t){e.roughness.value=t.roughness,e.metalness.value=t.metalness,t.roughnessMap&&(e.roughnessMap.value=t.roughnessMap),t.metalnessMap&&(e.metalnessMap.value=t.metalnessMap),t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap),t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale)),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias),t.envMap&&(e.envMapIntensity.value=t.envMapIntensity)}this.animate=function(e){null!==(xe=e)?Ee||(Se(),Ee=!0):_e()},this.render=function(e,t,n,r){if(t&&t.isCamera){if(!D){B="",U=-1,V=null,!0===e.autoUpdate&&e.updateMatrixWorld(),null===t.parent&&t.updateMatrixWorld(),ue.enabled&&(t=ue.getCamera(t)),(h=R.get(e,t)).init(),e.onBeforeRender(L,e,t,n),re.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),$.setFromMatrix(re),ne=this.localClippingEnabled,te=ee.init(this.clippingPlanes,ne,t),(u=T.get(e,t)).init(),function e(t,n,r){if(!1===t.visible)return;if(t.layers.test(n.layers))if(t.isLight)h.pushLight(t),t.castShadow&&h.pushShadow(t);else if(t.isSprite)t.frustumCulled&&!$.intersectsSprite(t)||h.pushSprite(t);else if(t.isImmediateRenderObject)r&&ie.setFromMatrixPosition(t.matrixWorld).applyMatrix4(re),u.push(t,null,t.material,ie.z,null);else if((t.isMesh||t.isLine||t.isPoints)&&(t.isSkinnedMesh&&t.skeleton.update(),!t.frustumCulled||$.intersectsObject(t))){r&&ie.setFromMatrixPosition(t.matrixWorld).applyMatrix4(re);var i=_.update(t),a=t.material;if(Array.isArray(a))for(var o=i.groups,s=0,c=o.length;s<c;s++){var l=o[s],d=a[l.materialIndex];d&&d.visible&&u.push(t,i,d,ie.z,l)}else a.visible&&u.push(t,i,a,ie.z,null)}var p=t.children;for(s=0,c=p.length;s<c;s++)e(p[s],n,r)}(e,t,L.sortObjects),!0===L.sortObjects&&u.sort(),te&&ee.beginShadows();var i=h.state.shadowsArray;he.render(i,e,t),h.setupLights(t),te&&ee.endShadows(),this.info.autoReset&&this.info.reset(),void 0===n&&(n=null),this.setRenderTarget(n),k.render(u,e,t,r);var a=u.opaque,o=u.transparent;if(e.overrideMaterial){var s=e.overrideMaterial;a.length&&Te(a,e,t,s),o.length&&Te(o,e,t,s)}else a.length&&Te(a,e,t),o.length&&Te(o,e,t);var c=h.state.spritesArray;I.render(c,e,t),n&&w.updateRenderTargetMipmap(n),g.buffers.depth.setTest(!0),g.buffers.depth.setMask(!0),g.buffers.color.setMask(!0),g.setPolygonOffset(!1),e.onAfterRender(L,e,t),ue.enabled&&ue.submitFrame(),u=null,h=null}}else console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")},this.allocTextureUnit=function(){var e=W;return e>=f.maxTextures&&console.warn("THREE.WebGLRenderer: Trying to use "+e+" texture units while this GPU supports only "+f.maxTextures),W+=1,e},this.setTexture2D=(Ae=!1,function(e,t){e&&e.isWebGLRenderTarget&&(Ae||(console.warn("THREE.WebGLRenderer.setTexture2D: don't use render targets as textures. Use their .texture property instead."),Ae=!0),e=e.texture),w.setTexture2D(e,t)}),this.setTexture=function(){var e=!1;return function(t,n){e||(console.warn("THREE.WebGLRenderer: .setTexture is deprecated, use setTexture2D instead."),e=!0),w.setTexture2D(t,n)}}(),this.setTextureCube=function(){var e=!1;return function(t,n){t&&t.isWebGLRenderTargetCube&&(e||(console.warn("THREE.WebGLRenderer.setTextureCube: don't use cube render targets as textures. Use their .texture property instead."),e=!0),t=t.texture),t&&t.isCubeTexture||Array.isArray(t.image)&&6===t.image.length?w.setTextureCube(t,n):w.setTextureCubeDynamic(t,n)}}(),this.getRenderTarget=function(){return F},this.setRenderTarget=function(e){F=e,e&&void 0===v.get(e).__webglFramebuffer&&w.setupRenderTarget(e);var t=null,n=!1;if(e){var r=v.get(e).__webglFramebuffer;e.isWebGLRenderTargetCube?(t=r[e.activeCubeFace],n=!0):t=r,H.copy(e.viewport),G.copy(e.scissor),q=e.scissorTest}else H.copy(Y).multiplyScalar(X),G.copy(K).multiplyScalar(X),q=Q;if(j!==t&&(d.bindFramebuffer(d.FRAMEBUFFER,t),j=t),g.viewport(H),g.scissor(G),g.setScissorTest(q),n){var i=v.get(e.texture);d.framebufferTexture2D(d.FRAMEBUFFER,d.COLOR_ATTACHMENT0,d.TEXTURE_CUBE_MAP_POSITIVE_X+e.activeCubeFace,i.__webglTexture,e.activeMipMapLevel)}},this.readRenderTargetPixels=function(e,t,n,r,i,a){if(e&&e.isWebGLRenderTarget){var o=v.get(e).__webglFramebuffer;if(o){var s=!1;o!==j&&(d.bindFramebuffer(d.FRAMEBUFFER,o),s=!0);try{var c=e.texture,l=c.format,u=c.type;if(1023!==l&&N.convert(l)!==d.getParameter(d.IMPLEMENTATION_COLOR_READ_FORMAT))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(!(1009===u||N.convert(u)===d.getParameter(d.IMPLEMENTATION_COLOR_READ_TYPE)||1015===u&&(p.get("OES_texture_float")||p.get("WEBGL_color_buffer_float"))||1016===u&&p.get("EXT_color_buffer_half_float")))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");d.checkFramebufferStatus(d.FRAMEBUFFER)===d.FRAMEBUFFER_COMPLETE?t>=0&&t<=e.width-r&&n>=0&&n<=e.height-i&&d.readPixels(t,n,r,i,N.convert(l),N.convert(u),a):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{s&&d.bindFramebuffer(d.FRAMEBUFFER,j)}}}else console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")},this.copyFramebufferToTexture=function(e,t,n){var r=t.image.width,i=t.image.height,a=N.convert(t.format);this.setTexture2D(t,0),d.copyTexImage2D(d.TEXTURE_2D,n||0,a,e.x,e.y,r,i,0)}}function xn(e,t){this.name="",this.color=new fe(e),this.density=void 0!==t?t:25e-5}function _n(e,t,n){this.name="",this.color=new fe(e),this.near=void 0!==t?t:1,this.far=void 0!==n?n:1e3}function Sn(){qe.call(this),this.type="Scene",this.background=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0}function Mn(e){ke.call(this),this.type="SpriteMaterial",this.color=new fe(16777215),this.map=null,this.rotation=0,this.fog=!1,this.lights=!1,this.setValues(e)}function Tn(e){qe.call(this),this.type="Sprite",this.material=void 0!==e?e:new Mn,this.center=new g(.5,.5)}function Rn(){qe.call(this),this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}})}function kn(e,t){if(e=e||[],this.bones=e.slice(0),this.boneMatrices=new Float32Array(16*this.bones.length),void 0===t)this.calculateInverses();else if(this.bones.length===t.length)this.boneInverses=t.slice(0);else{console.warn("THREE.Skeleton boneInverses is the wrong length."),this.boneInverses=[];for(var n=0,r=this.bones.length;n<r;n++)this.boneInverses.push(new y)}}function Cn(){qe.call(this),this.type="Bone"}function On(e,t){Rt.call(this,e,t),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new y,this.bindMatrixInverse=new y;var n=new kn(this.initBones());this.bind(n,this.matrixWorld),this.normalizeSkinWeights()}function Pn(e){ke.call(this),this.type="LineBasicMaterial",this.color=new fe(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.lights=!1,this.setValues(e)}function In(e,t,n){if(1===n)return console.warn("THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead."),new Nn(e,t);qe.call(this),this.type="Line",this.geometry=void 0!==e?e:new vt,this.material=void 0!==t?t:new Pn({color:16777215*Math.random()})}function Nn(e,t){In.call(this,e,t),this.type="LineSegments"}function Ln(e,t){In.call(this,e,t),this.type="LineLoop"}function Dn(e){ke.call(this),this.type="PointsMaterial",this.color=new fe(16777215),this.map=null,this.size=1,this.sizeAttenuation=!0,this.lights=!1,this.setValues(e)}function Fn(e,t){qe.call(this),this.type="Points",this.geometry=void 0!==e?e:new vt,this.material=void 0!==t?t:new Dn({color:16777215*Math.random()})}function jn(){qe.call(this),this.type="Group"}function Un(e,t,n,r,i,a,o,s,c){E.call(this,e,t,n,r,i,a,o,s,c),this.generateMipmaps=!1}function Bn(e,t,n,r,i,a,o,s,c,l,u,h){E.call(this,null,a,o,s,c,l,r,i,u,h),this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}function Vn(e,t,n,r,i,a,o,s,c,l){if(1026!==(l=void 0!==l?l:1026)&&1027!==l)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&1026===l&&(n=1012),void 0===n&&1027===l&&(n=1020),E.call(this,null,r,i,a,o,s,l,n,c),this.image={width:e,height:t},this.magFilter=void 0!==o?o:1003,this.minFilter=void 0!==s?s:1003,this.flipY=!1,this.generateMipmaps=!1}function zn(e){vt.call(this),this.type="WireframeGeometry";var t,n,r,i,a,o,s,c,l,u,h=[],d=[0,0],p={},f=["a","b","c"];if(e&&e.isGeometry){var m=e.faces;for(t=0,r=m.length;t<r;t++){var g=m[t];for(n=0;n<3;n++)s=g[f[n]],c=g[f[(n+1)%3]],d[0]=Math.min(s,c),d[1]=Math.max(s,c),void 0===p[l=d[0]+","+d[1]]&&(p[l]={index1:d[0],index2:d[1]})}for(l in p)o=p[l],u=e.vertices[o.index1],h.push(u.x,u.y,u.z),u=e.vertices[o.index2],h.push(u.x,u.y,u.z)}else if(e&&e.isBufferGeometry){var y,v,w,A,E,x,_;if(u=new b,null!==e.index){for(y=e.attributes.position,v=e.index,0===(w=e.groups).length&&(w=[{start:0,count:v.count,materialIndex:0}]),i=0,a=w.length;i<a;++i)for(t=E=(A=w[i]).start,r=E+A.count;t<r;t+=3)for(n=0;n<3;n++)s=v.getX(t+n),c=v.getX(t+(n+1)%3),d[0]=Math.min(s,c),d[1]=Math.max(s,c),void 0===p[l=d[0]+","+d[1]]&&(p[l]={index1:d[0],index2:d[1]});for(l in p)o=p[l],u.fromBufferAttribute(y,o.index1),h.push(u.x,u.y,u.z),u.fromBufferAttribute(y,o.index2),h.push(u.x,u.y,u.z)}else for(t=0,r=(y=e.attributes.position).count/3;t<r;t++)for(n=0;n<3;n++)x=3*t+n,u.fromBufferAttribute(y,x),h.push(u.x,u.y,u.z),_=3*t+(n+1)%3,u.fromBufferAttribute(y,_),h.push(u.x,u.y,u.z)}this.addAttribute("position",new ot(h,3))}function Hn(e,t,n){Ke.call(this),this.type="ParametricGeometry",this.parameters={func:e,slices:t,stacks:n},this.fromBufferGeometry(new Gn(e,t,n)),this.mergeVertices()}function Gn(e,t,n){vt.call(this),this.type="ParametricBufferGeometry",this.parameters={func:e,slices:t,stacks:n};var r,i,a=[],o=[],s=[],c=[],l=1e-5,u=new b,h=new b,d=new b,p=new b,f=new b,m=t+1;for(r=0;r<=n;r++){var g=r/n;for(i=0;i<=t;i++){var y=i/t;h=e(y,g,h),o.push(h.x,h.y,h.z),y-l>=0?(d=e(y-l,g,d),p.subVectors(h,d)):(d=e(y+l,g,d),p.subVectors(d,h)),g-l>=0?(d=e(y,g-l,d),f.subVectors(h,d)):(d=e(y,g+l,d),f.subVectors(d,h)),u.crossVectors(p,f).normalize(),s.push(u.x,u.y,u.z),c.push(y,g)}}for(r=0;r<n;r++)for(i=0;i<t;i++){var v=r*m+i,w=r*m+i+1,A=(r+1)*m+i+1,E=(r+1)*m+i;a.push(v,w,E),a.push(w,A,E)}this.setIndex(a),this.addAttribute("position",new ot(o,3)),this.addAttribute("normal",new ot(s,3)),this.addAttribute("uv",new ot(c,2))}function qn(e,t,n,r){Ke.call(this),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:n,detail:r},this.fromBufferGeometry(new Wn(e,t,n,r)),this.mergeVertices()}function Wn(e,t,n,r){vt.call(this),this.type="PolyhedronBufferGeometry",this.parameters={vertices:e,indices:t,radius:n,detail:r},n=n||1;var i=[],a=[];function o(e,t,n,r){var i,a,o=Math.pow(2,r),c=[];for(i=0;i<=o;i++){c[i]=[];var l=e.clone().lerp(n,i/o),u=t.clone().lerp(n,i/o),h=o-i;for(a=0;a<=h;a++)c[i][a]=0===a&&i===o?l:l.clone().lerp(u,a/h)}for(i=0;i<o;i++)for(a=0;a<2*(o-i)-1;a++){var d=Math.floor(a/2);a%2==0?(s(c[i][d+1]),s(c[i+1][d]),s(c[i][d])):(s(c[i][d+1]),s(c[i+1][d+1]),s(c[i+1][d]))}}function s(e){i.push(e.x,e.y,e.z)}function c(t,n){var r=3*t;n.x=e[r+0],n.y=e[r+1],n.z=e[r+2]}function l(e,t,n,r){r<0&&1===e.x&&(a[t]=e.x-1),0===n.x&&0===n.z&&(a[t]=r/2/Math.PI+.5)}function u(e){return Math.atan2(e.z,-e.x)}function h(e){return Math.atan2(-e.y,Math.sqrt(e.x*e.x+e.z*e.z))}!function(e){for(var n=new b,r=new b,i=new b,a=0;a<t.length;a+=3)c(t[a+0],n),c(t[a+1],r),c(t[a+2],i),o(n,r,i,e)}(r=r||0),function(e){for(var t=new b,n=0;n<i.length;n+=3)t.x=i[n+0],t.y=i[n+1],t.z=i[n+2],t.normalize().multiplyScalar(e),i[n+0]=t.x,i[n+1]=t.y,i[n+2]=t.z}(n),function(){for(var e=new b,t=0;t<i.length;t+=3){e.x=i[t+0],e.y=i[t+1],e.z=i[t+2];var n=u(e)/2/Math.PI+.5,r=h(e)/Math.PI+.5;a.push(n,1-r)}(function(){for(var e=new b,t=new b,n=new b,r=new b,o=new g,s=new g,c=new g,h=0,d=0;h<i.length;h+=9,d+=6){e.set(i[h+0],i[h+1],i[h+2]),t.set(i[h+3],i[h+4],i[h+5]),n.set(i[h+6],i[h+7],i[h+8]),o.set(a[d+0],a[d+1]),s.set(a[d+2],a[d+3]),c.set(a[d+4],a[d+5]),r.copy(e).add(t).add(n).divideScalar(3);var p=u(r);l(o,d+0,e,p),l(s,d+2,t,p),l(c,d+4,n,p)}})(),function(){for(var e=0;e<a.length;e+=6){var t=a[e+0],n=a[e+2],r=a[e+4],i=Math.max(t,n,r),o=Math.min(t,n,r);i>.9&&o<.1&&(t<.2&&(a[e+0]+=1),n<.2&&(a[e+2]+=1),r<.2&&(a[e+4]+=1))}}()}(),this.addAttribute("position",new ot(i,3)),this.addAttribute("normal",new ot(i.slice(),3)),this.addAttribute("uv",new ot(a,2)),0===r?this.computeVertexNormals():this.normalizeNormals()}function Jn(e,t){Ke.call(this),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new Zn(e,t)),this.mergeVertices()}function Zn(e,t){Wn.call(this,[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],e,t),this.type="TetrahedronBufferGeometry",this.parameters={radius:e,detail:t}}function Xn(e,t){Ke.call(this),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new Yn(e,t)),this.mergeVertices()}function Yn(e,t){Wn.call(this,[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],e,t),this.type="OctahedronBufferGeometry",this.parameters={radius:e,detail:t}}function Kn(e,t){Ke.call(this),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new Qn(e,t)),this.mergeVertices()}function Qn(e,t){var n=(1+Math.sqrt(5))/2,r=[-1,n,0,1,n,0,-1,-n,0,1,-n,0,0,-1,n,0,1,n,0,-1,-n,0,1,-n,n,0,-1,n,0,1,-n,0,-1,-n,0,1];Wn.call(this,r,[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],e,t),this.type="IcosahedronBufferGeometry",this.parameters={radius:e,detail:t}}function $n(e,t){Ke.call(this),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new er(e,t)),this.mergeVertices()}function er(e,t){var n=(1+Math.sqrt(5))/2,r=1/n,i=[-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,-r,-n,0,-r,n,0,r,-n,0,r,n,-r,-n,0,-r,n,0,r,-n,0,r,n,0,-n,0,-r,n,0,-r,-n,0,r,n,0,r];Wn.call(this,i,[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],e,t),this.type="DodecahedronBufferGeometry",this.parameters={radius:e,detail:t}}function tr(e,t,n,r,i,a){Ke.call(this),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:n,radialSegments:r,closed:i},void 0!==a&&console.warn("THREE.TubeGeometry: taper has been removed.");var o=new nr(e,t,n,r,i);this.tangents=o.tangents,this.normals=o.normals,this.binormals=o.binormals,this.fromBufferGeometry(o),this.mergeVertices()}function nr(e,t,n,r,i){vt.call(this),this.type="TubeBufferGeometry",this.parameters={path:e,tubularSegments:t,radius:n,radialSegments:r,closed:i},t=t||64,n=n||1,r=r||8,i=i||!1;var a=e.computeFrenetFrames(t,i);this.tangents=a.tangents,this.normals=a.normals,this.binormals=a.binormals;var o,s,c=new b,l=new b,u=new g,h=new b,d=[],p=[],f=[],m=[];function y(i){h=e.getPointAt(i/t,h);var o=a.normals[i],u=a.binormals[i];for(s=0;s<=r;s++){var f=s/r*Math.PI*2,m=Math.sin(f),g=-Math.cos(f);l.x=g*o.x+m*u.x,l.y=g*o.y+m*u.y,l.z=g*o.z+m*u.z,l.normalize(),p.push(l.x,l.y,l.z),c.x=h.x+n*l.x,c.y=h.y+n*l.y,c.z=h.z+n*l.z,d.push(c.x,c.y,c.z)}}!function(){for(o=0;o<t;o++)y(o);y(!1===i?t:0),function(){for(o=0;o<=t;o++)for(s=0;s<=r;s++)u.x=o/t,u.y=s/r,f.push(u.x,u.y)}(),function(){for(s=1;s<=t;s++)for(o=1;o<=r;o++){var e=(r+1)*(s-1)+(o-1),n=(r+1)*s+(o-1),i=(r+1)*s+o,a=(r+1)*(s-1)+o;m.push(e,n,a),m.push(n,i,a)}}()}(),this.setIndex(m),this.addAttribute("position",new ot(d,3)),this.addAttribute("normal",new ot(p,3)),this.addAttribute("uv",new ot(f,2))}function rr(e,t,n,r,i,a,o){Ke.call(this),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:t,tubularSegments:n,radialSegments:r,p:i,q:a},void 0!==o&&console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),this.fromBufferGeometry(new ir(e,t,n,r,i,a)),this.mergeVertices()}function ir(e,t,n,r,i,a){vt.call(this),this.type="TorusKnotBufferGeometry",this.parameters={radius:e,tube:t,tubularSegments:n,radialSegments:r,p:i,q:a},e=e||1,t=t||.4,n=Math.floor(n)||64,r=Math.floor(r)||8,i=i||2,a=a||3;var o,s,c=[],l=[],u=[],h=[],d=new b,p=new b,f=new b,m=new b,g=new b,y=new b,v=new b;for(o=0;o<=n;++o){var w=o/n*i*Math.PI*2;for(R(w,i,a,e,f),R(w+.01,i,a,e,m),y.subVectors(m,f),v.addVectors(m,f),g.crossVectors(y,v),v.crossVectors(g,y),g.normalize(),v.normalize(),s=0;s<=r;++s){var A=s/r*Math.PI*2,E=-t*Math.cos(A),x=t*Math.sin(A);d.x=f.x+(E*v.x+x*g.x),d.y=f.y+(E*v.y+x*g.y),d.z=f.z+(E*v.z+x*g.z),l.push(d.x,d.y,d.z),p.subVectors(d,f).normalize(),u.push(p.x,p.y,p.z),h.push(o/n),h.push(s/r)}}for(s=1;s<=n;s++)for(o=1;o<=r;o++){var _=(r+1)*(s-1)+(o-1),S=(r+1)*s+(o-1),M=(r+1)*s+o,T=(r+1)*(s-1)+o;c.push(_,S,T),c.push(S,M,T)}function R(e,t,n,r,i){var a=Math.cos(e),o=Math.sin(e),s=n/t*e,c=Math.cos(s);i.x=r*(2+c)*.5*a,i.y=r*(2+c)*o*.5,i.z=r*Math.sin(s)*.5}this.setIndex(c),this.addAttribute("position",new ot(l,3)),this.addAttribute("normal",new ot(u,3)),this.addAttribute("uv",new ot(h,2))}function ar(e,t,n,r,i){Ke.call(this),this.type="TorusGeometry",this.parameters={radius:e,tube:t,radialSegments:n,tubularSegments:r,arc:i},this.fromBufferGeometry(new or(e,t,n,r,i)),this.mergeVertices()}function or(e,t,n,r,i){vt.call(this),this.type="TorusBufferGeometry",this.parameters={radius:e,tube:t,radialSegments:n,tubularSegments:r,arc:i},e=e||1,t=t||.4,n=Math.floor(n)||8,r=Math.floor(r)||6,i=i||2*Math.PI;var a,o,s=[],c=[],l=[],u=[],h=new b,d=new b,p=new b;for(a=0;a<=n;a++)for(o=0;o<=r;o++){var f=o/r*i,m=a/n*Math.PI*2;d.x=(e+t*Math.cos(m))*Math.cos(f),d.y=(e+t*Math.cos(m))*Math.sin(f),d.z=t*Math.sin(m),c.push(d.x,d.y,d.z),h.x=e*Math.cos(f),h.y=e*Math.sin(f),p.subVectors(d,h).normalize(),l.push(p.x,p.y,p.z),u.push(o/r),u.push(a/n)}for(a=1;a<=n;a++)for(o=1;o<=r;o++){var g=(r+1)*a+o-1,y=(r+1)*(a-1)+o-1,v=(r+1)*(a-1)+o,w=(r+1)*a+o;s.push(g,y,w),s.push(y,v,w)}this.setIndex(s),this.addAttribute("position",new ot(c,3)),this.addAttribute("normal",new ot(l,3)),this.addAttribute("uv",new ot(u,2))}xn.prototype.isFogExp2=!0,xn.prototype.clone=function(){return new xn(this.color.getHex(),this.density)},xn.prototype.toJSON=function(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}},_n.prototype.isFog=!0,_n.prototype.clone=function(){return new _n(this.color.getHex(),this.near,this.far)},_n.prototype.toJSON=function(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}},Sn.prototype=Object.assign(Object.create(qe.prototype),{constructor:Sn,copy:function(e,t){return qe.prototype.copy.call(this,e,t),null!==e.background&&(this.background=e.background.clone()),null!==e.fog&&(this.fog=e.fog.clone()),null!==e.overrideMaterial&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this},toJSON:function(e){var t=qe.prototype.toJSON.call(this,e);return null!==this.background&&(t.object.background=this.background.toJSON(e)),null!==this.fog&&(t.object.fog=this.fog.toJSON()),t}}),Mn.prototype=Object.create(ke.prototype),Mn.prototype.constructor=Mn,Mn.prototype.isSpriteMaterial=!0,Mn.prototype.copy=function(e){return ke.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.rotation=e.rotation,this},Tn.prototype=Object.assign(Object.create(qe.prototype),{constructor:Tn,isSprite:!0,raycast:(un=new b,hn=new b,dn=new b,function(e,t){hn.setFromMatrixPosition(this.matrixWorld),e.ray.closestPointToPoint(hn,un),dn.setFromMatrixScale(this.matrixWorld);var n=dn.x*dn.y/4;if(!(hn.distanceToSquared(un)>n)){var r=e.ray.origin.distanceTo(un);r<e.near||r>e.far||t.push({distance:r,point:un.clone(),face:null,object:this})}}),clone:function(){return new this.constructor(this.material).copy(this)},copy:function(e){return qe.prototype.copy.call(this,e),void 0!==e.center&&this.center.copy(e.center),this}}),Rn.prototype=Object.assign(Object.create(qe.prototype),{constructor:Rn,copy:function(e){qe.prototype.copy.call(this,e,!1);for(var t=e.levels,n=0,r=t.length;n<r;n++){var i=t[n];this.addLevel(i.object.clone(),i.distance)}return this},addLevel:function(e,t){void 0===t&&(t=0),t=Math.abs(t);for(var n=this.levels,r=0;r<n.length&&!(t<n[r].distance);r++);n.splice(r,0,{distance:t,object:e}),this.add(e)},getObjectForDistance:function(e){for(var t=this.levels,n=1,r=t.length;n<r&&!(e<t[n].distance);n++);return t[n-1].object},raycast:(pn=new b,function(e,t){pn.setFromMatrixPosition(this.matrixWorld);var n=e.ray.origin.distanceTo(pn);this.getObjectForDistance(n).raycast(e,t)}),update:function(){var e=new b,t=new b;return function(n){var r=this.levels;if(r.length>1){e.setFromMatrixPosition(n.matrixWorld),t.setFromMatrixPosition(this.matrixWorld);var i=e.distanceTo(t);r[0].object.visible=!0;for(var a=1,o=r.length;a<o&&i>=r[a].distance;a++)r[a-1].object.visible=!1,r[a].object.visible=!0;for(;a<o;a++)r[a].object.visible=!1}}}(),toJSON:function(e){var t=qe.prototype.toJSON.call(this,e);t.object.levels=[];for(var n=this.levels,r=0,i=n.length;r<i;r++){var a=n[r];t.object.levels.push({object:a.object.uuid,distance:a.distance})}return t}}),Object.assign(kn.prototype,{calculateInverses:function(){this.boneInverses=[];for(var e=0,t=this.bones.length;e<t;e++){var n=new y;this.bones[e]&&n.getInverse(this.bones[e].matrixWorld),this.boneInverses.push(n)}},pose:function(){var e,t,n;for(t=0,n=this.bones.length;t<n;t++)(e=this.bones[t])&&e.matrixWorld.getInverse(this.boneInverses[t]);for(t=0,n=this.bones.length;t<n;t++)(e=this.bones[t])&&(e.parent&&e.parent.isBone?(e.matrix.getInverse(e.parent.matrixWorld),e.matrix.multiply(e.matrixWorld)):e.matrix.copy(e.matrixWorld),e.matrix.decompose(e.position,e.quaternion,e.scale))},update:(fn=new y,mn=new y,function(){for(var e=this.bones,t=this.boneInverses,n=this.boneMatrices,r=this.boneTexture,i=0,a=e.length;i<a;i++){var o=e[i]?e[i].matrixWorld:mn;fn.multiplyMatrices(o,t[i]),fn.toArray(n,16*i)}void 0!==r&&(r.needsUpdate=!0)}),clone:function(){return new kn(this.bones,this.boneInverses)},getBoneByName:function(e){for(var t=0,n=this.bones.length;t<n;t++){var r=this.bones[t];if(r.name===e)return r}}}),Cn.prototype=Object.assign(Object.create(qe.prototype),{constructor:Cn,isBone:!0}),On.prototype=Object.assign(Object.create(Rt.prototype),{constructor:On,isSkinnedMesh:!0,initBones:function(){var e,t,n,r,i=[];if(this.geometry&&void 0!==this.geometry.bones){for(n=0,r=this.geometry.bones.length;n<r;n++)t=this.geometry.bones[n],e=new Cn,i.push(e),e.name=t.name,e.position.fromArray(t.pos),e.quaternion.fromArray(t.rotq),void 0!==t.scl&&e.scale.fromArray(t.scl);for(n=0,r=this.geometry.bones.length;n<r;n++)-1!==(t=this.geometry.bones[n]).parent&&null!==t.parent&&void 0!==i[t.parent]?i[t.parent].add(i[n]):this.add(i[n])}return this.updateMatrixWorld(!0),i},bind:function(e,t){this.skeleton=e,void 0===t&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.getInverse(t)},pose:function(){this.skeleton.pose()},normalizeSkinWeights:function(){var e,t;if(this.geometry&&this.geometry.isGeometry)for(t=0;t<this.geometry.skinWeights.length;t++){var n=this.geometry.skinWeights[t];(e=1/n.manhattanLength())!==1/0?n.multiplyScalar(e):n.set(1,0,0,0)}else if(this.geometry&&this.geometry.isBufferGeometry){var r=new x,i=this.geometry.attributes.skinWeight;for(t=0;t<i.count;t++)r.x=i.getX(t),r.y=i.getY(t),r.z=i.getZ(t),r.w=i.getW(t),(e=1/r.manhattanLength())!==1/0?r.multiplyScalar(e):r.set(1,0,0,0),i.setXYZW(t,r.x,r.y,r.z,r.w)}},updateMatrixWorld:function(e){Rt.prototype.updateMatrixWorld.call(this,e),"attached"===this.bindMode?this.bindMatrixInverse.getInverse(this.matrixWorld):"detached"===this.bindMode?this.bindMatrixInverse.getInverse(this.bindMatrix):console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),Pn.prototype=Object.create(ke.prototype),Pn.prototype.constructor=Pn,Pn.prototype.isLineBasicMaterial=!0,Pn.prototype.copy=function(e){return ke.prototype.copy.call(this,e),this.color.copy(e.color),this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this},In.prototype=Object.assign(Object.create(qe.prototype),{constructor:In,isLine:!0,computeLineDistances:(gn=new b,yn=new b,function(){var e=this.geometry;if(e.isBufferGeometry)if(null===e.index){for(var t=e.attributes.position,n=[0],r=1,i=t.count;r<i;r++)gn.fromBufferAttribute(t,r-1),yn.fromBufferAttribute(t,r),n[r]=n[r-1],n[r]+=gn.distanceTo(yn);e.addAttribute("lineDistance",new THREE.Float32BufferAttribute(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(e.isGeometry){var a=e.vertices;for((n=e.lineDistances)[0]=0,r=1,i=a.length;r<i;r++)n[r]=n[r-1],n[r]+=a[r-1].distanceTo(a[r])}return this}),raycast:function(){var e=new y,t=new St,n=new Ie;return function(r,i){var a=r.linePrecision,o=a*a,s=this.geometry,c=this.matrixWorld;if(null===s.boundingSphere&&s.computeBoundingSphere(),n.copy(s.boundingSphere),n.applyMatrix4(c),!1!==r.ray.intersectsSphere(n)){e.getInverse(c),t.copy(r.ray).applyMatrix4(e);var l=new b,u=new b,h=new b,d=new b,p=this&&this.isLineSegments?2:1;if(s.isBufferGeometry){var f=s.index,m=s.attributes.position.array;if(null!==f)for(var g=f.array,y=0,v=g.length-1;y<v;y+=p){var w=g[y],A=g[y+1];if(l.fromArray(m,3*w),u.fromArray(m,3*A),!(t.distanceSqToSegment(l,u,d,h)>o))d.applyMatrix4(this.matrixWorld),(_=r.ray.origin.distanceTo(d))<r.near||_>r.far||i.push({distance:_,point:h.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this})}else for(y=0,v=m.length/3-1;y<v;y+=p){if(l.fromArray(m,3*y),u.fromArray(m,3*y+3),!(t.distanceSqToSegment(l,u,d,h)>o))d.applyMatrix4(this.matrixWorld),(_=r.ray.origin.distanceTo(d))<r.near||_>r.far||i.push({distance:_,point:h.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this})}}else if(s.isGeometry){var E=s.vertices,x=E.length;for(y=0;y<x-1;y+=p){var _;if(!(t.distanceSqToSegment(E[y],E[y+1],d,h)>o))d.applyMatrix4(this.matrixWorld),(_=r.ray.origin.distanceTo(d))<r.near||_>r.far||i.push({distance:_,point:h.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this})}}}}}(),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),Nn.prototype=Object.assign(Object.create(In.prototype),{constructor:Nn,isLineSegments:!0,computeLineDistances:function(){var e=new b,t=new b;return function(){var n=this.geometry;if(n.isBufferGeometry)if(null===n.index){for(var r=n.attributes.position,i=[],a=0,o=r.count;a<o;a+=2)e.fromBufferAttribute(r,a),t.fromBufferAttribute(r,a+1),i[a]=0===a?0:i[a-1],i[a+1]=i[a]+e.distanceTo(t);n.addAttribute("lineDistance",new THREE.Float32BufferAttribute(i,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(n.isGeometry){var s=n.vertices;for(i=n.lineDistances,a=0,o=s.length;a<o;a+=2)e.copy(s[a]),t.copy(s[a+1]),i[a]=0===a?0:i[a-1],i[a+1]=i[a]+e.distanceTo(t)}return this}}()}),Ln.prototype=Object.assign(Object.create(In.prototype),{constructor:Ln,isLineLoop:!0}),Dn.prototype=Object.create(ke.prototype),Dn.prototype.constructor=Dn,Dn.prototype.isPointsMaterial=!0,Dn.prototype.copy=function(e){return ke.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this},Fn.prototype=Object.assign(Object.create(qe.prototype),{constructor:Fn,isPoints:!0,raycast:function(){var e=new y,t=new St,n=new Ie;return function(r,i){var a=this,o=this.geometry,s=this.matrixWorld,c=r.params.Points.threshold;if(null===o.boundingSphere&&o.computeBoundingSphere(),n.copy(o.boundingSphere),n.applyMatrix4(s),n.radius+=c,!1!==r.ray.intersectsSphere(n)){e.getInverse(s),t.copy(r.ray).applyMatrix4(e);var l=c/((this.scale.x+this.scale.y+this.scale.z)/3),u=l*l,h=new b;if(o.isBufferGeometry){var d=o.index,p=o.attributes.position.array;if(null!==d)for(var f=d.array,m=0,g=f.length;m<g;m++){var y=f[m];h.fromArray(p,3*y),A(h,y)}else{m=0;for(var v=p.length/3;m<v;m++)h.fromArray(p,3*m),A(h,m)}}else{var w=o.vertices;for(m=0,v=w.length;m<v;m++)A(w[m],m)}}function A(e,n){var o=t.distanceSqToPoint(e);if(o<u){var c=t.closestPointToPoint(e);c.applyMatrix4(s);var l=r.ray.origin.distanceTo(c);if(l<r.near||l>r.far)return;i.push({distance:l,distanceToRay:Math.sqrt(o),point:c.clone(),index:n,face:null,object:a})}}}}(),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),jn.prototype=Object.assign(Object.create(qe.prototype),{constructor:jn,isGroup:!0}),Un.prototype=Object.assign(Object.create(E.prototype),{constructor:Un,isVideoTexture:!0,update:function(){var e=this.image;e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}),Bn.prototype=Object.create(E.prototype),Bn.prototype.constructor=Bn,Bn.prototype.isCompressedTexture=!0,Vn.prototype=Object.create(E.prototype),Vn.prototype.constructor=Vn,Vn.prototype.isDepthTexture=!0,zn.prototype=Object.create(vt.prototype),zn.prototype.constructor=zn,Hn.prototype=Object.create(Ke.prototype),Hn.prototype.constructor=Hn,Gn.prototype=Object.create(vt.prototype),Gn.prototype.constructor=Gn,qn.prototype=Object.create(Ke.prototype),qn.prototype.constructor=qn,Wn.prototype=Object.create(vt.prototype),Wn.prototype.constructor=Wn,Jn.prototype=Object.create(Ke.prototype),Jn.prototype.constructor=Jn,Zn.prototype=Object.create(Wn.prototype),Zn.prototype.constructor=Zn,Xn.prototype=Object.create(Ke.prototype),Xn.prototype.constructor=Xn,Yn.prototype=Object.create(Wn.prototype),Yn.prototype.constructor=Yn,Kn.prototype=Object.create(Ke.prototype),Kn.prototype.constructor=Kn,Qn.prototype=Object.create(Wn.prototype),Qn.prototype.constructor=Qn,$n.prototype=Object.create(Ke.prototype),$n.prototype.constructor=$n,er.prototype=Object.create(Wn.prototype),er.prototype.constructor=er,tr.prototype=Object.create(Ke.prototype),tr.prototype.constructor=tr,nr.prototype=Object.create(vt.prototype),nr.prototype.constructor=nr,rr.prototype=Object.create(Ke.prototype),rr.prototype.constructor=rr,ir.prototype=Object.create(vt.prototype),ir.prototype.constructor=ir,ar.prototype=Object.create(Ke.prototype),ar.prototype.constructor=ar,or.prototype=Object.create(vt.prototype),or.prototype.constructor=or;var sr=function(e,t,n){n=n||2;var r,i,a,o,s,c,l,u=t&&t.length,h=u?t[0]*n:e.length,d=cr(e,0,h,n,!0),p=[];if(!d)return p;if(u&&(d=function(e,t,n,r){var i,a,o,s,c,l=[];for(i=0,a=t.length;i<a;i++)o=t[i]*r,s=i<a-1?t[i+1]*r:e.length,(c=cr(e,o,s,r,!1))===c.next&&(c.steiner=!0),l.push(vr(c));for(l.sort(mr),i=0;i<l.length;i++)gr(l[i],n),n=lr(n,n.next);return n}(e,t,d,n)),e.length>80*n){r=a=e[0],i=o=e[1];for(var f=n;f<h;f+=n)(s=e[f])<r&&(r=s),(c=e[f+1])<i&&(i=c),s>a&&(a=s),c>o&&(o=c);l=0!==(l=Math.max(a-r,o-i))?1/l:0}return ur(d,p,n,r,i,l),p};function cr(e,t,n,r,i){var a,o;if(i===function(e,t,n,r){for(var i=0,a=t,o=n-r;a<n;a+=r)i+=(e[o]-e[a])*(e[a+1]+e[o+1]),o=a;return i}(e,t,n,r)>0)for(a=t;a<n;a+=r)o=Mr(a,e[a],e[a+1],o);else for(a=n-r;a>=t;a-=r)o=Mr(a,e[a],e[a+1],o);return o&&Er(o,o.next)&&(Tr(o),o=o.next),o}function lr(e,t){if(!e)return e;t||(t=e);var n,r=e;do{if(n=!1,r.steiner||!Er(r,r.next)&&0!==Ar(r.prev,r,r.next))r=r.next;else{if(Tr(r),(r=t=r.prev)===r.next)break;n=!0}}while(n||r!==t);return t}function ur(e,t,n,r,i,a,o){if(e){!o&&a&&function(e,t,n,r){var i=e;do{null===i.z&&(i.z=yr(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,function(e){var t,n,r,i,a,o,s,c,l=1;do{for(n=e,e=null,a=null,o=0;n;){for(o++,r=n,s=0,t=0;t<l&&(s++,r=r.nextZ);t++);for(c=l;s>0||c>0&&r;)0!==s&&(0===c||!r||n.z<=r.z)?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,c--),a?a.nextZ=i:e=i,i.prevZ=a,a=i;n=r}a.nextZ=null,l*=2}while(o>1)}(i)}(e,r,i,a);for(var s,c,l=e;e.prev!==e.next;)if(s=e.prev,c=e.next,a?dr(e,r,i,a):hr(e))t.push(s.i/n),t.push(e.i/n),t.push(c.i/n),Tr(e),e=c.next,l=c.next;else if((e=c)===l){o?1===o?ur(e=pr(e,t,n),t,n,r,i,a,2):2===o&&fr(e,t,n,r,i,a):ur(lr(e),t,n,r,i,a,1);break}}}function hr(e){var t=e.prev,n=e,r=e.next;if(Ar(t,n,r)>=0)return!1;for(var i=e.next.next;i!==e.prev;){if(br(t.x,t.y,n.x,n.y,r.x,r.y,i.x,i.y)&&Ar(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function dr(e,t,n,r){var i=e.prev,a=e,o=e.next;if(Ar(i,a,o)>=0)return!1;for(var s=i.x<a.x?i.x<o.x?i.x:o.x:a.x<o.x?a.x:o.x,c=i.y<a.y?i.y<o.y?i.y:o.y:a.y<o.y?a.y:o.y,l=i.x>a.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,u=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,h=yr(s,c,t,n,r),d=yr(l,u,t,n,r),p=e.nextZ;p&&p.z<=d;){if(p!==e.prev&&p!==e.next&&br(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&Ar(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(p=e.prevZ;p&&p.z>=h;){if(p!==e.prev&&p!==e.next&&br(i.x,i.y,a.x,a.y,o.x,o.y,p.x,p.y)&&Ar(p.prev,p,p.next)>=0)return!1;p=p.prevZ}return!0}function pr(e,t,n){var r=e;do{var i=r.prev,a=r.next.next;!Er(i,a)&&xr(i,r,r.next,a)&&_r(i,a)&&_r(a,i)&&(t.push(i.i/n),t.push(r.i/n),t.push(a.i/n),Tr(r),Tr(r.next),r=e=a),r=r.next}while(r!==e);return r}function fr(e,t,n,r,i,a){var o=e;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&wr(o,s)){var c=Sr(o,s);return o=lr(o,o.next),c=lr(c,c.next),ur(o,t,n,r,i,a),void ur(c,t,n,r,i,a)}s=s.next}o=o.next}while(o!==e)}function mr(e,t){return e.x-t.x}function gr(e,t){if(t=function(e,t){var n,r=t,i=e.x,a=e.y,o=-1/0;do{if(a<=r.y&&a>=r.next.y&&r.next.y!==r.y){var s=r.x+(a-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=i&&s>o){if(o=s,s===i){if(a===r.y)return r;if(a===r.next.y)return r.next}n=r.x<r.next.x?r:r.next}}r=r.next}while(r!==t);if(!n)return null;if(i===o)return n.prev;var c,l=n,u=n.x,h=n.y,d=1/0;r=n.next;for(;r!==l;)i>=r.x&&r.x>=u&&i!==r.x&&br(a<h?i:o,a,u,h,a<h?o:i,a,r.x,r.y)&&((c=Math.abs(a-r.y)/(i-r.x))<d||c===d&&r.x>n.x)&&_r(r,e)&&(n=r,d=c),r=r.next;return n}(e,t)){var n=Sr(t,e);lr(n,n.next)}}function yr(e,t,n,r,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*i)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*i)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function vr(e){var t=e,n=e;do{t.x<n.x&&(n=t),t=t.next}while(t!==e);return n}function br(e,t,n,r,i,a,o,s){return(i-o)*(t-s)-(e-o)*(a-s)>=0&&(e-o)*(r-s)-(n-o)*(t-s)>=0&&(n-o)*(a-s)-(i-o)*(r-s)>=0}function wr(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&xr(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&_r(e,t)&&_r(t,e)&&function(e,t){var n=e,r=!1,i=(e.x+t.x)/2,a=(e.y+t.y)/2;do{n.y>a!=n.next.y>a&&n.next.y!==n.y&&i<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==e);return r}(e,t)}function Ar(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function Er(e,t){return e.x===t.x&&e.y===t.y}function xr(e,t,n,r){return!!(Er(e,t)&&Er(n,r)||Er(e,r)&&Er(n,t))||Ar(e,t,n)>0!=Ar(e,t,r)>0&&Ar(n,r,e)>0!=Ar(n,r,t)>0}function _r(e,t){return Ar(e.prev,e,e.next)<0?Ar(e,t,e.next)>=0&&Ar(e,e.prev,t)>=0:Ar(e,t,e.prev)<0||Ar(e,e.next,t)<0}function Sr(e,t){var n=new Rr(e.i,e.x,e.y),r=new Rr(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,a.next=r,r.prev=a,r}function Mr(e,t,n,r){var i=new Rr(e,t,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function Tr(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function Rr(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}var kr={area:function(e){for(var t=e.length,n=0,r=t-1,i=0;i<t;r=i++)n+=e[r].x*e[i].y-e[i].x*e[r].y;return.5*n},isClockWise:function(e){return kr.area(e)<0},triangulateShape:function(e,t){var n=[],r=[],i=[];Cr(e),Or(n,e);var a=e.length;t.forEach(Cr);for(var o=0;o<t.length;o++)r.push(a),a+=t[o].length,Or(n,t[o]);var s=sr(n,r);for(o=0;o<s.length;o+=3)i.push(s.slice(o,o+3));return i}};function Cr(e){var t=e.length;t>2&&e[t-1].equals(e[0])&&e.pop()}function Or(e,t){for(var n=0;n<t.length;n++)e.push(t[n].x),e.push(t[n].y)}function Pr(e,t){Ke.call(this),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},this.fromBufferGeometry(new Ir(e,t)),this.mergeVertices()}function Ir(e,t){void 0!==e&&(vt.call(this),this.type="ExtrudeBufferGeometry",e=Array.isArray(e)?e:[e],this.addShapeList(e,t),this.computeVertexNormals())}function Nr(e,t){Ke.call(this),this.type="TextGeometry",this.parameters={text:e,parameters:t},this.fromBufferGeometry(new Lr(e,t)),this.mergeVertices()}function Lr(e,t){var n=(t=t||{}).font;if(!n||!n.isFont)return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),new Ke;var r=n.generateShapes(e,t.size,t.curveSegments);t.amount=void 0!==t.height?t.height:50,void 0===t.bevelThickness&&(t.bevelThickness=10),void 0===t.bevelSize&&(t.bevelSize=8),void 0===t.bevelEnabled&&(t.bevelEnabled=!1),Ir.call(this,r,t),this.type="TextBufferGeometry"}function Dr(e,t,n,r,i,a,o){Ke.call(this),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:r,phiLength:i,thetaStart:a,thetaLength:o},this.fromBufferGeometry(new Fr(e,t,n,r,i,a,o)),this.mergeVertices()}function Fr(e,t,n,r,i,a,o){vt.call(this),this.type="SphereBufferGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:r,phiLength:i,thetaStart:a,thetaLength:o},e=e||1,t=Math.max(3,Math.floor(t)||8),n=Math.max(2,Math.floor(n)||6),r=void 0!==r?r:0,i=void 0!==i?i:2*Math.PI;var s,c,l=(a=void 0!==a?a:0)+(o=void 0!==o?o:Math.PI),u=0,h=[],d=new b,p=new b,f=[],m=[],g=[],y=[];for(c=0;c<=n;c++){var v=[],w=c/n;for(s=0;s<=t;s++){var A=s/t;d.x=-e*Math.cos(r+A*i)*Math.sin(a+w*o),d.y=e*Math.cos(a+w*o),d.z=e*Math.sin(r+A*i)*Math.sin(a+w*o),m.push(d.x,d.y,d.z),p.set(d.x,d.y,d.z).normalize(),g.push(p.x,p.y,p.z),y.push(A,1-w),v.push(u++)}h.push(v)}for(c=0;c<n;c++)for(s=0;s<t;s++){var E=h[c][s+1],x=h[c][s],_=h[c+1][s],S=h[c+1][s+1];(0!==c||a>0)&&f.push(E,x,S),(c!==n-1||l<Math.PI)&&f.push(x,_,S)}this.setIndex(f),this.addAttribute("position",new ot(m,3)),this.addAttribute("normal",new ot(g,3)),this.addAttribute("uv",new ot(y,2))}function jr(e,t,n,r,i,a){Ke.call(this),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:n,phiSegments:r,thetaStart:i,thetaLength:a},this.fromBufferGeometry(new Ur(e,t,n,r,i,a)),this.mergeVertices()}function Ur(e,t,n,r,i,a){vt.call(this),this.type="RingBufferGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:n,phiSegments:r,thetaStart:i,thetaLength:a},e=e||.5,t=t||1,i=void 0!==i?i:0,a=void 0!==a?a:2*Math.PI,n=void 0!==n?Math.max(3,n):8;var o,s,c,l=[],u=[],h=[],d=[],p=e,f=(t-e)/(r=void 0!==r?Math.max(1,r):1),m=new b,y=new g;for(s=0;s<=r;s++){for(c=0;c<=n;c++)o=i+c/n*a,m.x=p*Math.cos(o),m.y=p*Math.sin(o),u.push(m.x,m.y,m.z),h.push(0,0,1),y.x=(m.x/t+1)/2,y.y=(m.y/t+1)/2,d.push(y.x,y.y);p+=f}for(s=0;s<r;s++){var v=s*(n+1);for(c=0;c<n;c++){var w=o=c+v,A=o+n+1,E=o+n+2,x=o+1;l.push(w,A,x),l.push(A,E,x)}}this.setIndex(l),this.addAttribute("position",new ot(u,3)),this.addAttribute("normal",new ot(h,3)),this.addAttribute("uv",new ot(d,2))}function Br(e,t,n,r){Ke.call(this),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:n,phiLength:r},this.fromBufferGeometry(new Vr(e,t,n,r)),this.mergeVertices()}function Vr(e,t,n,r){vt.call(this),this.type="LatheBufferGeometry",this.parameters={points:e,segments:t,phiStart:n,phiLength:r},t=Math.floor(t)||12,n=n||0,r=r||2*Math.PI,r=m.clamp(r,0,2*Math.PI);var i,a,o,s=[],c=[],l=[],u=1/t,h=new b,d=new g;for(a=0;a<=t;a++){var p=n+a*u*r,f=Math.sin(p),y=Math.cos(p);for(o=0;o<=e.length-1;o++)h.x=e[o].x*f,h.y=e[o].y,h.z=e[o].x*y,c.push(h.x,h.y,h.z),d.x=a/t,d.y=o/(e.length-1),l.push(d.x,d.y)}for(a=0;a<t;a++)for(o=0;o<e.length-1;o++){var v=i=o+a*e.length,w=i+e.length,A=i+e.length+1,E=i+1;s.push(v,w,E),s.push(w,A,E)}if(this.setIndex(s),this.addAttribute("position",new ot(c,3)),this.addAttribute("uv",new ot(l,2)),this.computeVertexNormals(),r===2*Math.PI){var x=this.attributes.normal.array,_=new b,S=new b,M=new b;for(i=t*e.length*3,a=0,o=0;a<e.length;a++,o+=3)_.x=x[o+0],_.y=x[o+1],_.z=x[o+2],S.x=x[i+o+0],S.y=x[i+o+1],S.z=x[i+o+2],M.addVectors(_,S).normalize(),x[o+0]=x[i+o+0]=M.x,x[o+1]=x[i+o+1]=M.y,x[o+2]=x[i+o+2]=M.z}}function zr(e,t){Ke.call(this),this.type="ShapeGeometry","object"==typeof t&&(console.warn("THREE.ShapeGeometry: Options parameter has been removed."),t=t.curveSegments),this.parameters={shapes:e,curveSegments:t},this.fromBufferGeometry(new Hr(e,t)),this.mergeVertices()}function Hr(e,t){vt.call(this),this.type="ShapeBufferGeometry",this.parameters={shapes:e,curveSegments:t},t=t||12;var n=[],r=[],i=[],a=[],o=0,s=0;if(!1===Array.isArray(e))l(e);else for(var c=0;c<e.length;c++)l(e[c]),this.addGroup(o,s,c),o+=s,s=0;function l(e){var o,c,l,u=r.length/3,h=e.extractPoints(t),d=h.shape,p=h.holes;if(!1===kr.isClockWise(d))for(d=d.reverse(),o=0,c=p.length;o<c;o++)l=p[o],!0===kr.isClockWise(l)&&(p[o]=l.reverse());var f=kr.triangulateShape(d,p);for(o=0,c=p.length;o<c;o++)l=p[o],d=d.concat(l);for(o=0,c=d.length;o<c;o++){var m=d[o];r.push(m.x,m.y,0),i.push(0,0,1),a.push(m.x,m.y)}for(o=0,c=f.length;o<c;o++){var g=f[o],y=g[0]+u,v=g[1]+u,b=g[2]+u;n.push(y,v,b),s+=3}}this.setIndex(n),this.addAttribute("position",new ot(r,3)),this.addAttribute("normal",new ot(i,3)),this.addAttribute("uv",new ot(a,2))}function Gr(e,t){if(t.shapes=[],Array.isArray(e))for(var n=0,r=e.length;n<r;n++){var i=e[n];t.shapes.push(i.uuid)}else t.shapes.push(e.uuid);return t}function qr(e,t){vt.call(this),this.type="EdgesGeometry",this.parameters={thresholdAngle:t},t=void 0!==t?t:1;var n,r,i,a,o=[],s=Math.cos(m.DEG2RAD*t),c=[0,0],l={},u=["a","b","c"];e.isBufferGeometry?(a=new Ke).fromBufferGeometry(e):a=e.clone(),a.mergeVertices(),a.computeFaceNormals();for(var h=a.vertices,d=a.faces,p=0,f=d.length;p<f;p++)for(var g=d[p],y=0;y<3;y++)n=g[u[y]],r=g[u[(y+1)%3]],c[0]=Math.min(n,r),c[1]=Math.max(n,r),void 0===l[i=c[0]+","+c[1]]?l[i]={index1:c[0],index2:c[1],face1:p,face2:void 0}:l[i].face2=p;for(i in l){var v=l[i];if(void 0===v.face2||d[v.face1].normal.dot(d[v.face2].normal)<=s){var b=h[v.index1];o.push(b.x,b.y,b.z),b=h[v.index2],o.push(b.x,b.y,b.z)}}this.addAttribute("position",new ot(o,3))}function Wr(e,t,n,r,i,a,o,s){Ke.call(this),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:r,heightSegments:i,openEnded:a,thetaStart:o,thetaLength:s},this.fromBufferGeometry(new Jr(e,t,n,r,i,a,o,s)),this.mergeVertices()}function Jr(e,t,n,r,i,a,o,s){vt.call(this),this.type="CylinderBufferGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:r,heightSegments:i,openEnded:a,thetaStart:o,thetaLength:s};var c=this;e=void 0!==e?e:1,t=void 0!==t?t:1,n=n||1,r=Math.floor(r)||8,i=Math.floor(i)||1,a=void 0!==a&&a,o=void 0!==o?o:0,s=void 0!==s?s:2*Math.PI;var l=[],u=[],h=[],d=[],p=0,f=[],m=n/2,y=0;function v(n){var i,a,f,v=new g,w=new b,A=0,E=!0===n?e:t,x=!0===n?1:-1;for(a=p,i=1;i<=r;i++)u.push(0,m*x,0),h.push(0,x,0),d.push(.5,.5),p++;for(f=p,i=0;i<=r;i++){var _=i/r*s+o,S=Math.cos(_),M=Math.sin(_);w.x=E*M,w.y=m*x,w.z=E*S,u.push(w.x,w.y,w.z),h.push(0,x,0),v.x=.5*S+.5,v.y=.5*M*x+.5,d.push(v.x,v.y),p++}for(i=0;i<r;i++){var T=a+i,R=f+i;!0===n?l.push(R,R+1,T):l.push(R+1,R,T),A+=3}c.addGroup(y,A,!0===n?1:2),y+=A}!function(){var a,g,v=new b,w=new b,A=0,E=(t-e)/n;for(g=0;g<=i;g++){var x=[],_=g/i,S=_*(t-e)+e;for(a=0;a<=r;a++){var M=a/r,T=M*s+o,R=Math.sin(T),k=Math.cos(T);w.x=S*R,w.y=-_*n+m,w.z=S*k,u.push(w.x,w.y,w.z),v.set(R,E,k).normalize(),h.push(v.x,v.y,v.z),d.push(M,1-_),x.push(p++)}f.push(x)}for(a=0;a<r;a++)for(g=0;g<i;g++){var C=f[g][a],O=f[g+1][a],P=f[g+1][a+1],I=f[g][a+1];l.push(C,O,I),l.push(O,P,I),A+=6}c.addGroup(y,A,0),y+=A}(),!1===a&&(e>0&&v(!0),t>0&&v(!1)),this.setIndex(l),this.addAttribute("position",new ot(u,3)),this.addAttribute("normal",new ot(h,3)),this.addAttribute("uv",new ot(d,2))}function Zr(e,t,n,r,i,a,o){Wr.call(this,0,e,t,n,r,i,a,o),this.type="ConeGeometry",this.parameters={radius:e,height:t,radialSegments:n,heightSegments:r,openEnded:i,thetaStart:a,thetaLength:o}}function Xr(e,t,n,r,i,a,o){Jr.call(this,0,e,t,n,r,i,a,o),this.type="ConeBufferGeometry",this.parameters={radius:e,height:t,radialSegments:n,heightSegments:r,openEnded:i,thetaStart:a,thetaLength:o}}function Yr(e,t,n,r){Ke.call(this),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:r},this.fromBufferGeometry(new Kr(e,t,n,r)),this.mergeVertices()}function Kr(e,t,n,r){vt.call(this),this.type="CircleBufferGeometry",this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:r},e=e||1,t=void 0!==t?Math.max(3,t):8,n=void 0!==n?n:0,r=void 0!==r?r:2*Math.PI;var i,a,o=[],s=[],c=[],l=[],u=new b,h=new g;for(s.push(0,0,0),c.push(0,0,1),l.push(.5,.5),a=0,i=3;a<=t;a++,i+=3){var d=n+a/t*r;u.x=e*Math.cos(d),u.y=e*Math.sin(d),s.push(u.x,u.y,u.z),c.push(0,0,1),h.x=(s[i]/e+1)/2,h.y=(s[i+1]/e+1)/2,l.push(h.x,h.y)}for(i=1;i<=t;i++)o.push(i,i+1,0);this.setIndex(o),this.addAttribute("position",new ot(s,3)),this.addAttribute("normal",new ot(c,3)),this.addAttribute("uv",new ot(l,2))}Pr.prototype=Object.create(Ke.prototype),Pr.prototype.constructor=Pr,Ir.prototype=Object.create(vt.prototype),Ir.prototype.constructor=Ir,Ir.prototype.getArrays=function(){var e=this.getAttribute("position"),t=e?Array.prototype.slice.call(e.array):[],n=this.getAttribute("uv"),r=n?Array.prototype.slice.call(n.array):[],i=this.index;return{position:t,uv:r,index:i?Array.prototype.slice.call(i.array):[]}},Ir.prototype.addShapeList=function(e,t){var n=e.length;t.arrays=this.getArrays();for(var r=0;r<n;r++){var i=e[r];this.addShape(i,t)}this.setIndex(t.arrays.index),this.addAttribute("position",new ot(t.arrays.position,3)),this.addAttribute("uv",new ot(t.arrays.uv,2))},Ir.prototype.addShape=function(e,t){var n,r,i,a,o,s,c,l,u=t.arrays?t.arrays:this.getArrays(),h=u.position,d=u.index,p=u.uv,f=[],m=void 0!==t.amount?t.amount:100,y=void 0!==t.bevelThickness?t.bevelThickness:6,v=void 0!==t.bevelSize?t.bevelSize:y-2,w=void 0!==t.bevelSegments?t.bevelSegments:3,A=void 0===t.bevelEnabled||t.bevelEnabled,E=void 0!==t.curveSegments?t.curveSegments:12,x=void 0!==t.steps?t.steps:1,_=t.extrudePath,S=!1,M=void 0!==t.UVGenerator?t.UVGenerator:Pr.WorldUVGenerator;_&&(n=_.getSpacedPoints(x),S=!0,A=!1,r=void 0!==t.frames?t.frames:_.computeFrenetFrames(x,!1),i=new b,a=new b,o=new b),A||(w=0,y=0,v=0);var T=this,R=e.extractPoints(E),k=R.shape,C=R.holes;if(!kr.isClockWise(k))for(k=k.reverse(),c=0,l=C.length;c<l;c++)s=C[c],kr.isClockWise(s)&&(C[c]=s.reverse());var O=kr.triangulateShape(k,C),P=k;for(c=0,l=C.length;c<l;c++)s=C[c],k=k.concat(s);function I(e,t,n){return t||console.error("THREE.ExtrudeGeometry: vec does not exist"),t.clone().multiplyScalar(n).add(e)}var N,L,D,F,j,U,B=k.length,V=O.length;function z(e,t,n){var r,i,a,o=e.x-t.x,s=e.y-t.y,c=n.x-e.x,l=n.y-e.y,u=o*o+s*s,h=o*l-s*c;if(Math.abs(h)>Number.EPSILON){var d=Math.sqrt(u),p=Math.sqrt(c*c+l*l),f=t.x-s/d,m=t.y+o/d,y=((n.x-l/p-f)*l-(n.y+c/p-m)*c)/(o*l-s*c),v=(r=f+o*y-e.x)*r+(i=m+s*y-e.y)*i;if(v<=2)return new g(r,i);a=Math.sqrt(v/2)}else{var b=!1;o>Number.EPSILON?c>Number.EPSILON&&(b=!0):o<-Number.EPSILON?c<-Number.EPSILON&&(b=!0):Math.sign(s)===Math.sign(l)&&(b=!0),b?(r=-s,i=o,a=Math.sqrt(u)):(r=o,i=s,a=Math.sqrt(u/2))}return new g(r/a,i/a)}for(var H=[],G=0,q=P.length,W=q-1,J=G+1;G<q;G++,W++,J++)W===q&&(W=0),J===q&&(J=0),H[G]=z(P[G],P[W],P[J]);var Z,X,Y=[],K=H.concat();for(c=0,l=C.length;c<l;c++){for(s=C[c],Z=[],G=0,W=(q=s.length)-1,J=G+1;G<q;G++,W++,J++)W===q&&(W=0),J===q&&(J=0),Z[G]=z(s[G],s[W],s[J]);Y.push(Z),K=K.concat(Z)}for(N=0;N<w;N++){for(D=N/w,F=y*Math.cos(D*Math.PI/2),L=v*Math.sin(D*Math.PI/2),G=0,q=P.length;G<q;G++)$((j=I(P[G],H[G],L)).x,j.y,-F);for(c=0,l=C.length;c<l;c++)for(s=C[c],Z=Y[c],G=0,q=s.length;G<q;G++)$((j=I(s[G],Z[G],L)).x,j.y,-F)}for(L=v,G=0;G<B;G++)j=A?I(k[G],K[G],L):k[G],S?(a.copy(r.normals[0]).multiplyScalar(j.x),i.copy(r.binormals[0]).multiplyScalar(j.y),o.copy(n[0]).add(a).add(i),$(o.x,o.y,o.z)):$(j.x,j.y,0);for(X=1;X<=x;X++)for(G=0;G<B;G++)j=A?I(k[G],K[G],L):k[G],S?(a.copy(r.normals[X]).multiplyScalar(j.x),i.copy(r.binormals[X]).multiplyScalar(j.y),o.copy(n[X]).add(a).add(i),$(o.x,o.y,o.z)):$(j.x,j.y,m/x*X);for(N=w-1;N>=0;N--){for(D=N/w,F=y*Math.cos(D*Math.PI/2),L=v*Math.sin(D*Math.PI/2),G=0,q=P.length;G<q;G++)$((j=I(P[G],H[G],L)).x,j.y,m+F);for(c=0,l=C.length;c<l;c++)for(s=C[c],Z=Y[c],G=0,q=s.length;G<q;G++)j=I(s[G],Z[G],L),S?$(j.x,j.y+n[x-1].y,n[x-1].x+F):$(j.x,j.y,m+F)}function Q(e,t){var n,r;for(G=e.length;--G>=0;){n=G,(r=G-1)<0&&(r=e.length-1);var i=0,a=x+2*w;for(i=0;i<a;i++){var o=B*i,s=B*(i+1);te(t+n+o,t+r+o,t+r+s,t+n+s)}}}function $(e,t,n){f.push(e),f.push(t),f.push(n)}function ee(e,t,n){ne(e),ne(t),ne(n);var r=h.length/3,i=M.generateTopUV(T,h,r-3,r-2,r-1);re(i[0]),re(i[1]),re(i[2])}function te(e,t,n,r){ne(e),ne(t),ne(r),ne(t),ne(n),ne(r);var i=h.length/3,a=M.generateSideWallUV(T,h,i-6,i-3,i-2,i-1);re(a[0]),re(a[1]),re(a[3]),re(a[1]),re(a[2]),re(a[3])}function ne(e){d.push(h.length/3),h.push(f[3*e+0]),h.push(f[3*e+1]),h.push(f[3*e+2])}function re(e){p.push(e.x),p.push(e.y)}!function(){var e=h.length/3;if(A){var n=0,r=B*n;for(G=0;G<V;G++)ee((U=O[G])[2]+r,U[1]+r,U[0]+r);for(r=B*(n=x+2*w),G=0;G<V;G++)ee((U=O[G])[0]+r,U[1]+r,U[2]+r)}else{for(G=0;G<V;G++)ee((U=O[G])[2],U[1],U[0]);for(G=0;G<V;G++)ee((U=O[G])[0]+B*x,U[1]+B*x,U[2]+B*x)}T.addGroup(e,h.length/3-e,void 0!==t.material?t.material:0)}(),function(){var e=h.length/3,n=0;for(Q(P,n),n+=P.length,c=0,l=C.length;c<l;c++)Q(s=C[c],n),n+=s.length;T.addGroup(e,h.length/3-e,void 0!==t.extrudeMaterial?t.extrudeMaterial:1)}(),t.arrays||(this.setIndex(d),this.addAttribute("position",new ot(h,3)),this.addAttribute("uv",new ot(p,2)))},Pr.WorldUVGenerator={generateTopUV:function(e,t,n,r,i){var a=t[3*n],o=t[3*n+1],s=t[3*r],c=t[3*r+1],l=t[3*i],u=t[3*i+1];return[new g(a,o),new g(s,c),new g(l,u)]},generateSideWallUV:function(e,t,n,r,i,a){var o=t[3*n],s=t[3*n+1],c=t[3*n+2],l=t[3*r],u=t[3*r+1],h=t[3*r+2],d=t[3*i],p=t[3*i+1],f=t[3*i+2],m=t[3*a],y=t[3*a+1],v=t[3*a+2];return Math.abs(s-u)<.01?[new g(o,1-c),new g(l,1-h),new g(d,1-f),new g(m,1-v)]:[new g(s,1-c),new g(u,1-h),new g(p,1-f),new g(y,1-v)]}},Nr.prototype=Object.create(Ke.prototype),Nr.prototype.constructor=Nr,Lr.prototype=Object.create(Ir.prototype),Lr.prototype.constructor=Lr,Dr.prototype=Object.create(Ke.prototype),Dr.prototype.constructor=Dr,Fr.prototype=Object.create(vt.prototype),Fr.prototype.constructor=Fr,jr.prototype=Object.create(Ke.prototype),jr.prototype.constructor=jr,Ur.prototype=Object.create(vt.prototype),Ur.prototype.constructor=Ur,Br.prototype=Object.create(Ke.prototype),Br.prototype.constructor=Br,Vr.prototype=Object.create(vt.prototype),Vr.prototype.constructor=Vr,zr.prototype=Object.create(Ke.prototype),zr.prototype.constructor=zr,zr.prototype.toJSON=function(){var e=Ke.prototype.toJSON.call(this);return Gr(this.parameters.shapes,e)},Hr.prototype=Object.create(vt.prototype),Hr.prototype.constructor=Hr,Hr.prototype.toJSON=function(){var e=vt.prototype.toJSON.call(this);return Gr(this.parameters.shapes,e)},qr.prototype=Object.create(vt.prototype),qr.prototype.constructor=qr,Wr.prototype=Object.create(Ke.prototype),Wr.prototype.constructor=Wr,Jr.prototype=Object.create(vt.prototype),Jr.prototype.constructor=Jr,Zr.prototype=Object.create(Wr.prototype),Zr.prototype.constructor=Zr,Xr.prototype=Object.create(Jr.prototype),Xr.prototype.constructor=Xr,Yr.prototype=Object.create(Ke.prototype),Yr.prototype.constructor=Yr,Kr.prototype=Object.create(vt.prototype),Kr.prototype.constructor=Kr;var Qr=Object.freeze({WireframeGeometry:zn,ParametricGeometry:Hn,ParametricBufferGeometry:Gn,TetrahedronGeometry:Jn,TetrahedronBufferGeometry:Zn,OctahedronGeometry:Xn,OctahedronBufferGeometry:Yn,IcosahedronGeometry:Kn,IcosahedronBufferGeometry:Qn,DodecahedronGeometry:$n,DodecahedronBufferGeometry:er,PolyhedronGeometry:qn,PolyhedronBufferGeometry:Wn,TubeGeometry:tr,TubeBufferGeometry:nr,TorusKnotGeometry:rr,TorusKnotBufferGeometry:ir,TorusGeometry:ar,TorusBufferGeometry:or,TextGeometry:Nr,TextBufferGeometry:Lr,SphereGeometry:Dr,SphereBufferGeometry:Fr,RingGeometry:jr,RingBufferGeometry:Ur,PlaneGeometry:At,PlaneBufferGeometry:Et,LatheGeometry:Br,LatheBufferGeometry:Vr,ShapeGeometry:zr,ShapeBufferGeometry:Hr,ExtrudeGeometry:Pr,ExtrudeBufferGeometry:Ir,EdgesGeometry:qr,ConeGeometry:Zr,ConeBufferGeometry:Xr,CylinderGeometry:Wr,CylinderBufferGeometry:Jr,CircleGeometry:Yr,CircleBufferGeometry:Kr,BoxGeometry:bt,BoxBufferGeometry:wt});function $r(e){ke.call(this),this.type="ShadowMaterial",this.color=new fe(0),this.opacity=1,this.lights=!0,this.transparent=!0,this.setValues(e)}function ei(e){_t.call(this,e),this.type="RawShaderMaterial"}function ti(e){ke.call(this),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new fe(16777215),this.roughness=.5,this.metalness=.5,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new fe(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalScale=new g(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function ni(e){ti.call(this),this.defines={PHYSICAL:""},this.type="MeshPhysicalMaterial",this.reflectivity=.5,this.clearCoat=0,this.clearCoatRoughness=0,this.setValues(e)}function ri(e){ke.call(this),this.type="MeshPhongMaterial",this.color=new fe(16777215),this.specular=new fe(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new fe(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalScale=new g(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function ii(e){ri.call(this),this.defines={TOON:""},this.type="MeshToonMaterial",this.gradientMap=null,this.setValues(e)}function ai(e){ke.call(this),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalScale=new g(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function oi(e){ke.call(this),this.type="MeshLambertMaterial",this.color=new fe(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new fe(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function si(e){Pn.call(this),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}$r.prototype=Object.create(ke.prototype),$r.prototype.constructor=$r,$r.prototype.isShadowMaterial=!0,ei.prototype=Object.create(_t.prototype),ei.prototype.constructor=ei,ei.prototype.isRawShaderMaterial=!0,ti.prototype=Object.create(ke.prototype),ti.prototype.constructor=ti,ti.prototype.isMeshStandardMaterial=!0,ti.prototype.copy=function(e){return ke.prototype.copy.call(this,e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapIntensity=e.envMapIntensity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},ni.prototype=Object.create(ti.prototype),ni.prototype.constructor=ni,ni.prototype.isMeshPhysicalMaterial=!0,ni.prototype.copy=function(e){return ti.prototype.copy.call(this,e),this.defines={PHYSICAL:""},this.reflectivity=e.reflectivity,this.clearCoat=e.clearCoat,this.clearCoatRoughness=e.clearCoatRoughness,this},ri.prototype=Object.create(ke.prototype),ri.prototype.constructor=ri,ri.prototype.isMeshPhongMaterial=!0,ri.prototype.copy=function(e){return ke.prototype.copy.call(this,e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},ii.prototype=Object.create(ri.prototype),ii.prototype.constructor=ii,ii.prototype.isMeshToonMaterial=!0,ii.prototype.copy=function(e){return ri.prototype.copy.call(this,e),this.gradientMap=e.gradientMap,this},ai.prototype=Object.create(ke.prototype),ai.prototype.constructor=ai,ai.prototype.isMeshNormalMaterial=!0,ai.prototype.copy=function(e){return ke.prototype.copy.call(this,e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},oi.prototype=Object.create(ke.prototype),oi.prototype.constructor=oi,oi.prototype.isMeshLambertMaterial=!0,oi.prototype.copy=function(e){return ke.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},si.prototype=Object.create(Pn.prototype),si.prototype.constructor=si,si.prototype.isLineDashedMaterial=!0,si.prototype.copy=function(e){return Pn.prototype.copy.call(this,e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this};var ci=Object.freeze({ShadowMaterial:$r,SpriteMaterial:Mn,RawShaderMaterial:ei,ShaderMaterial:_t,PointsMaterial:Dn,MeshPhysicalMaterial:ni,MeshStandardMaterial:ti,MeshPhongMaterial:ri,MeshToonMaterial:ii,MeshNormalMaterial:ai,MeshLambertMaterial:oi,MeshDepthMaterial:Ce,MeshDistanceMaterial:Oe,MeshBasicMaterial:xt,LineDashedMaterial:si,LineBasicMaterial:Pn,Material:ke}),li={enabled:!1,files:{},add:function(e,t){!1!==this.enabled&&(this.files[e]=t)},get:function(e){if(!1!==this.enabled)return this.files[e]},remove:function(e){delete this.files[e]},clear:function(){this.files={}}};function ui(e,t,n){var r=this,i=!1,a=0,o=0,s=void 0;this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this.itemStart=function(e){o++,!1===i&&void 0!==r.onStart&&r.onStart(e,a,o),i=!0},this.itemEnd=function(e){a++,void 0!==r.onProgress&&r.onProgress(e,a,o),a===o&&(i=!1,void 0!==r.onLoad&&r.onLoad())},this.itemError=function(e){void 0!==r.onError&&r.onError(e)},this.resolveURL=function(e){return s?s(e):e},this.setURLModifier=function(e){return s=e,this}}var hi=new ui,di={};function pi(e){this.manager=void 0!==e?e:hi}function fi(e){this.manager=void 0!==e?e:hi,this._parser=null}function mi(e){this.manager=void 0!==e?e:hi}function gi(e){this.manager=void 0!==e?e:hi}function yi(e){this.manager=void 0!==e?e:hi}function vi(){this.type="Curve",this.arcLengthDivisions=200}function bi(e,t,n,r,i,a,o,s){vi.call(this),this.type="EllipseCurve",this.aX=e||0,this.aY=t||0,this.xRadius=n||1,this.yRadius=r||1,this.aStartAngle=i||0,this.aEndAngle=a||2*Math.PI,this.aClockwise=o||!1,this.aRotation=s||0}function wi(e,t,n,r,i,a){bi.call(this,e,t,n,n,r,i,a),this.type="ArcCurve"}function Ai(){var e=0,t=0,n=0,r=0;function i(i,a,o,s){e=i,t=o,n=-3*i+3*a-2*o-s,r=2*i-2*a+o+s}return{initCatmullRom:function(e,t,n,r,a){i(t,n,a*(n-e),a*(r-t))},initNonuniformCatmullRom:function(e,t,n,r,a,o,s){var c=(t-e)/a-(n-e)/(a+o)+(n-t)/o,l=(n-t)/o-(r-t)/(o+s)+(r-n)/s;i(t,n,c*=o,l*=o)},calc:function(i){var a=i*i;return e+t*i+n*a+r*(a*i)}}}Object.assign(pi.prototype,{load:function(e,t,n,r){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);var i=this,a=li.get(e);if(void 0!==a)return i.manager.itemStart(e),setTimeout((function(){t&&t(a),i.manager.itemEnd(e)}),0),a;if(void 0===di[e]){var o=e.match(/^data:(.*?)(;base64)?,(.*)$/);if(o){var s=o[1],c=!!o[2],l=o[3];l=window.decodeURIComponent(l),c&&(l=window.atob(l));try{var u,h=(this.responseType||"").toLowerCase();switch(h){case"arraybuffer":case"blob":for(var d=new Uint8Array(l.length),p=0;p<l.length;p++)d[p]=l.charCodeAt(p);u="blob"===h?new Blob([d.buffer],{type:s}):d.buffer;break;case"document":var f=new DOMParser;u=f.parseFromString(l,s);break;case"json":u=JSON.parse(l);break;default:u=l}window.setTimeout((function(){t&&t(u),i.manager.itemEnd(e)}),0)}catch(t){window.setTimeout((function(){r&&r(t),i.manager.itemEnd(e),i.manager.itemError(e)}),0)}}else{di[e]=[],di[e].push({onLoad:t,onProgress:n,onError:r});var m=new XMLHttpRequest;for(var g in m.open("GET",e,!0),m.addEventListener("load",(function(t){var n=this.response;li.add(e,n);var r=di[e];if(delete di[e],200===this.status){for(var a=0,o=r.length;a<o;a++){(s=r[a]).onLoad&&s.onLoad(n)}i.manager.itemEnd(e)}else if(0===this.status){console.warn("THREE.FileLoader: HTTP Status 0 received.");for(a=0,o=r.length;a<o;a++){(s=r[a]).onLoad&&s.onLoad(n)}i.manager.itemEnd(e)}else{for(a=0,o=r.length;a<o;a++){var s;(s=r[a]).onError&&s.onError(t)}i.manager.itemEnd(e),i.manager.itemError(e)}}),!1),m.addEventListener("progress",(function(t){for(var n=di[e],r=0,i=n.length;r<i;r++){var a=n[r];a.onProgress&&a.onProgress(t)}}),!1),m.addEventListener("error",(function(t){var n=di[e];delete di[e];for(var r=0,a=n.length;r<a;r++){var o=n[r];o.onError&&o.onError(t)}i.manager.itemEnd(e),i.manager.itemError(e)}),!1),void 0!==this.responseType&&(m.responseType=this.responseType),void 0!==this.withCredentials&&(m.withCredentials=this.withCredentials),m.overrideMimeType&&m.overrideMimeType(void 0!==this.mimeType?this.mimeType:"text/plain"),this.requestHeader)m.setRequestHeader(g,this.requestHeader[g]);m.send(null)}return i.manager.itemStart(e),m}di[e].push({onLoad:t,onProgress:n,onError:r})},setPath:function(e){return this.path=e,this},setResponseType:function(e){return this.responseType=e,this},setWithCredentials:function(e){return this.withCredentials=e,this},setMimeType:function(e){return this.mimeType=e,this},setRequestHeader:function(e){return this.requestHeader=e,this}}),Object.assign(function(e){this.manager=void 0!==e?e:hi,this._parser=null}.prototype,{load:function(e,t,n,r){var i=this,a=[],o=new Bn;o.image=a;var s=new pi(this.manager);function c(c){s.load(e[c],(function(e){var n=i._parser(e,!0);a[c]={width:n.width,height:n.height,format:n.format,mipmaps:n.mipmaps},6===(l+=1)&&(1===n.mipmapCount&&(o.minFilter=1006),o.format=n.format,o.needsUpdate=!0,t&&t(o))}),n,r)}if(s.setPath(this.path),s.setResponseType("arraybuffer"),Array.isArray(e))for(var l=0,u=0,h=e.length;u<h;++u)c(u);else s.load(e,(function(e){var n=i._parser(e,!0);if(n.isCubemap)for(var r=n.mipmaps.length/n.mipmapCount,s=0;s<r;s++){a[s]={mipmaps:[]};for(var c=0;c<n.mipmapCount;c++)a[s].mipmaps.push(n.mipmaps[s*n.mipmapCount+c]),a[s].format=n.format,a[s].width=n.width,a[s].height=n.height}else o.image.width=n.width,o.image.height=n.height,o.mipmaps=n.mipmaps;1===n.mipmapCount&&(o.minFilter=1006),o.format=n.format,o.needsUpdate=!0,t&&t(o)}),n,r);return o},setPath:function(e){return this.path=e,this}}),Object.assign(fi.prototype,{load:function(e,t,n,r){var i=this,a=new M,o=new pi(this.manager);return o.setResponseType("arraybuffer"),o.load(e,(function(e){var n=i._parser(e);n&&(void 0!==n.image?a.image=n.image:void 0!==n.data&&(a.image.width=n.width,a.image.height=n.height,a.image.data=n.data),a.wrapS=void 0!==n.wrapS?n.wrapS:1001,a.wrapT=void 0!==n.wrapT?n.wrapT:1001,a.magFilter=void 0!==n.magFilter?n.magFilter:1006,a.minFilter=void 0!==n.minFilter?n.minFilter:1008,a.anisotropy=void 0!==n.anisotropy?n.anisotropy:1,void 0!==n.format&&(a.format=n.format),void 0!==n.type&&(a.type=n.type),void 0!==n.mipmaps&&(a.mipmaps=n.mipmaps),1===n.mipmapCount&&(a.minFilter=1006),a.needsUpdate=!0,t&&t(a,n))}),n,r),a}}),Object.assign(mi.prototype,{crossOrigin:"Anonymous",load:function(e,t,n,r){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);var i=this,a=li.get(e);if(void 0!==a)return i.manager.itemStart(e),setTimeout((function(){t&&t(a),i.manager.itemEnd(e)}),0),a;var o=document.createElementNS("http://www.w3.org/1999/xhtml","img");return o.addEventListener("load",(function(){li.add(e,this),t&&t(this),i.manager.itemEnd(e)}),!1),o.addEventListener("error",(function(t){r&&r(t),i.manager.itemEnd(e),i.manager.itemError(e)}),!1),"data:"!==e.substr(0,5)&&void 0!==this.crossOrigin&&(o.crossOrigin=this.crossOrigin),i.manager.itemStart(e),o.src=e,o},setCrossOrigin:function(e){return this.crossOrigin=e,this},setPath:function(e){return this.path=e,this}}),Object.assign(gi.prototype,{crossOrigin:"Anonymous",load:function(e,t,n,r){var i=new T,a=new mi(this.manager);a.setCrossOrigin(this.crossOrigin),a.setPath(this.path);var o=0;function s(n){a.load(e[n],(function(e){i.images[n]=e,6===++o&&(i.needsUpdate=!0,t&&t(i))}),void 0,r)}for(var c=0;c<e.length;++c)s(c);return i},setCrossOrigin:function(e){return this.crossOrigin=e,this},setPath:function(e){return this.path=e,this}}),Object.assign(yi.prototype,{crossOrigin:"Anonymous",load:function(e,t,n,r){var i=new E,a=new mi(this.manager);return a.setCrossOrigin(this.crossOrigin),a.setPath(this.path),a.load(e,(function(n){i.image=n;var r=e.search(/\.(jpg|jpeg)$/)>0||0===e.search(/^data\:image\/jpeg/);i.format=r?1022:1023,i.needsUpdate=!0,void 0!==t&&t(i)}),n,r),i},setCrossOrigin:function(e){return this.crossOrigin=e,this},setPath:function(e){return this.path=e,this}}),Object.assign(vi.prototype,{getPoint:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null},getPointAt:function(e,t){var n=this.getUtoTmapping(e);return this.getPoint(n,t)},getPoints:function(e){void 0===e&&(e=5);for(var t=[],n=0;n<=e;n++)t.push(this.getPoint(n/e));return t},getSpacedPoints:function(e){void 0===e&&(e=5);for(var t=[],n=0;n<=e;n++)t.push(this.getPointAt(n/e));return t},getLength:function(){var e=this.getLengths();return e[e.length-1]},getLengths:function(e){if(void 0===e&&(e=this.arcLengthDivisions),this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var t,n,r=[],i=this.getPoint(0),a=0;for(r.push(0),n=1;n<=e;n++)a+=(t=this.getPoint(n/e)).distanceTo(i),r.push(a),i=t;return this.cacheArcLengths=r,r},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(e,t){var n,r=this.getLengths(),i=0,a=r.length;n=t||e*r[a-1];for(var o,s=0,c=a-1;s<=c;)if((o=r[i=Math.floor(s+(c-s)/2)]-n)<0)s=i+1;else{if(!(o>0)){c=i;break}c=i-1}if(r[i=c]===n)return i/(a-1);var l=r[i];return(i+(n-l)/(r[i+1]-l))/(a-1)},getTangent:function(e){var t=e-1e-4,n=e+1e-4;t<0&&(t=0),n>1&&(n=1);var r=this.getPoint(t);return this.getPoint(n).clone().sub(r).normalize()},getTangentAt:function(e){var t=this.getUtoTmapping(e);return this.getTangent(t)},computeFrenetFrames:function(e,t){var n,r,i,a=new b,o=[],s=[],c=[],l=new b,u=new y;for(n=0;n<=e;n++)r=n/e,o[n]=this.getTangentAt(r),o[n].normalize();s[0]=new b,c[0]=new b;var h=Number.MAX_VALUE,d=Math.abs(o[0].x),p=Math.abs(o[0].y),f=Math.abs(o[0].z);for(d<=h&&(h=d,a.set(1,0,0)),p<=h&&(h=p,a.set(0,1,0)),f<=h&&a.set(0,0,1),l.crossVectors(o[0],a).normalize(),s[0].crossVectors(o[0],l),c[0].crossVectors(o[0],s[0]),n=1;n<=e;n++)s[n]=s[n-1].clone(),c[n]=c[n-1].clone(),l.crossVectors(o[n-1],o[n]),l.length()>Number.EPSILON&&(l.normalize(),i=Math.acos(m.clamp(o[n-1].dot(o[n]),-1,1)),s[n].applyMatrix4(u.makeRotationAxis(l,i))),c[n].crossVectors(o[n],s[n]);if(!0===t)for(i=Math.acos(m.clamp(s[0].dot(s[e]),-1,1)),i/=e,o[0].dot(l.crossVectors(s[0],s[e]))>0&&(i=-i),n=1;n<=e;n++)s[n].applyMatrix4(u.makeRotationAxis(o[n],i*n)),c[n].crossVectors(o[n],s[n]);return{tangents:o,normals:s,binormals:c}},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this},toJSON:function(){var e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e},fromJSON:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}),bi.prototype=Object.create(vi.prototype),bi.prototype.constructor=bi,bi.prototype.isEllipseCurve=!0,bi.prototype.getPoint=function(e,t){for(var n=t||new g,r=2*Math.PI,i=this.aEndAngle-this.aStartAngle,a=Math.abs(i)<Number.EPSILON;i<0;)i+=r;for(;i>r;)i-=r;i<Number.EPSILON&&(i=a?0:r),!0!==this.aClockwise||a||(i===r?i=-r:i-=r);var o=this.aStartAngle+e*i,s=this.aX+this.xRadius*Math.cos(o),c=this.aY+this.yRadius*Math.sin(o);if(0!==this.aRotation){var l=Math.cos(this.aRotation),u=Math.sin(this.aRotation),h=s-this.aX,d=c-this.aY;s=h*l-d*u+this.aX,c=h*u+d*l+this.aY}return n.set(s,c)},bi.prototype.copy=function(e){return vi.prototype.copy.call(this,e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this},bi.prototype.toJSON=function(){var e=vi.prototype.toJSON.call(this);return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e},bi.prototype.fromJSON=function(e){return vi.prototype.fromJSON.call(this,e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this},wi.prototype=Object.create(bi.prototype),wi.prototype.constructor=wi,wi.prototype.isArcCurve=!0;var Ei=new b,xi=new Ai,_i=new Ai,Si=new Ai;function Mi(e,t,n,r){vi.call(this),this.type="CatmullRomCurve3",this.points=e||[],this.closed=t||!1,this.curveType=n||"centripetal",this.tension=r||.5}function Ti(e,t,n,r,i){var a=.5*(r-t),o=.5*(i-n),s=e*e;return(2*n-2*r+a+o)*(e*s)+(-3*n+3*r-2*a-o)*s+a*e+n}function Ri(e,t,n,r){return function(e,t){var n=1-e;return n*n*t}(e,t)+function(e,t){return 2*(1-e)*e*t}(e,n)+function(e,t){return e*e*t}(e,r)}function ki(e,t,n,r,i){return function(e,t){var n=1-e;return n*n*n*t}(e,t)+function(e,t){var n=1-e;return 3*n*n*e*t}(e,n)+function(e,t){return 3*(1-e)*e*e*t}(e,r)+function(e,t){return e*e*e*t}(e,i)}function Ci(e,t,n,r){vi.call(this),this.type="CubicBezierCurve",this.v0=e||new g,this.v1=t||new g,this.v2=n||new g,this.v3=r||new g}function Oi(e,t,n,r){vi.call(this),this.type="CubicBezierCurve3",this.v0=e||new b,this.v1=t||new b,this.v2=n||new b,this.v3=r||new b}function Pi(e,t){vi.call(this),this.type="LineCurve",this.v1=e||new g,this.v2=t||new g}function Ii(e,t){vi.call(this),this.type="LineCurve3",this.v1=e||new b,this.v2=t||new b}function Ni(e,t,n){vi.call(this),this.type="QuadraticBezierCurve",this.v0=e||new g,this.v1=t||new g,this.v2=n||new g}function Li(e,t,n){vi.call(this),this.type="QuadraticBezierCurve3",this.v0=e||new b,this.v1=t||new b,this.v2=n||new b}function Di(e){vi.call(this),this.type="SplineCurve",this.points=e||[]}Mi.prototype=Object.create(vi.prototype),Mi.prototype.constructor=Mi,Mi.prototype.isCatmullRomCurve3=!0,Mi.prototype.getPoint=function(e,t){var n,r,i,a,o=t||new b,s=this.points,c=s.length,l=(c-(this.closed?0:1))*e,u=Math.floor(l),h=l-u;if(this.closed?u+=u>0?0:(Math.floor(Math.abs(u)/s.length)+1)*s.length:0===h&&u===c-1&&(u=c-2,h=1),this.closed||u>0?n=s[(u-1)%c]:(Ei.subVectors(s[0],s[1]).add(s[0]),n=Ei),r=s[u%c],i=s[(u+1)%c],this.closed||u+2<c?a=s[(u+2)%c]:(Ei.subVectors(s[c-1],s[c-2]).add(s[c-1]),a=Ei),"centripetal"===this.curveType||"chordal"===this.curveType){var d="chordal"===this.curveType?.5:.25,p=Math.pow(n.distanceToSquared(r),d),f=Math.pow(r.distanceToSquared(i),d),m=Math.pow(i.distanceToSquared(a),d);f<1e-4&&(f=1),p<1e-4&&(p=f),m<1e-4&&(m=f),xi.initNonuniformCatmullRom(n.x,r.x,i.x,a.x,p,f,m),_i.initNonuniformCatmullRom(n.y,r.y,i.y,a.y,p,f,m),Si.initNonuniformCatmullRom(n.z,r.z,i.z,a.z,p,f,m)}else"catmullrom"===this.curveType&&(xi.initCatmullRom(n.x,r.x,i.x,a.x,this.tension),_i.initCatmullRom(n.y,r.y,i.y,a.y,this.tension),Si.initCatmullRom(n.z,r.z,i.z,a.z,this.tension));return o.set(xi.calc(h),_i.calc(h),Si.calc(h)),o},Mi.prototype.copy=function(e){vi.prototype.copy.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var r=e.points[t];this.points.push(r.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this},Mi.prototype.toJSON=function(){var e=vi.prototype.toJSON.call(this);e.points=[];for(var t=0,n=this.points.length;t<n;t++){var r=this.points[t];e.points.push(r.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e},Mi.prototype.fromJSON=function(e){vi.prototype.fromJSON.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var r=e.points[t];this.points.push((new b).fromArray(r))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this},Ci.prototype=Object.create(vi.prototype),Ci.prototype.constructor=Ci,Ci.prototype.isCubicBezierCurve=!0,Ci.prototype.getPoint=function(e,t){var n=t||new g,r=this.v0,i=this.v1,a=this.v2,o=this.v3;return n.set(ki(e,r.x,i.x,a.x,o.x),ki(e,r.y,i.y,a.y,o.y)),n},Ci.prototype.copy=function(e){return vi.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this},Ci.prototype.toJSON=function(){var e=vi.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e},Ci.prototype.fromJSON=function(e){return vi.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this},Oi.prototype=Object.create(vi.prototype),Oi.prototype.constructor=Oi,Oi.prototype.isCubicBezierCurve3=!0,Oi.prototype.getPoint=function(e,t){var n=t||new b,r=this.v0,i=this.v1,a=this.v2,o=this.v3;return n.set(ki(e,r.x,i.x,a.x,o.x),ki(e,r.y,i.y,a.y,o.y),ki(e,r.z,i.z,a.z,o.z)),n},Oi.prototype.copy=function(e){return vi.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this},Oi.prototype.toJSON=function(){var e=vi.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e},Oi.prototype.fromJSON=function(e){return vi.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this},Pi.prototype=Object.create(vi.prototype),Pi.prototype.constructor=Pi,Pi.prototype.isLineCurve=!0,Pi.prototype.getPoint=function(e,t){var n=t||new g;return 1===e?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n},Pi.prototype.getPointAt=function(e,t){return this.getPoint(e,t)},Pi.prototype.getTangent=function(){return this.v2.clone().sub(this.v1).normalize()},Pi.prototype.copy=function(e){return vi.prototype.copy.call(this,e),this.v1.copy(e.v1),this.v2.copy(e.v2),this},Pi.prototype.toJSON=function(){var e=vi.prototype.toJSON.call(this);return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},Pi.prototype.fromJSON=function(e){return vi.prototype.fromJSON.call(this,e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},Ii.prototype=Object.create(vi.prototype),Ii.prototype.constructor=Ii,Ii.prototype.isLineCurve3=!0,Ii.prototype.getPoint=function(e,t){var n=t||new b;return 1===e?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n},Ii.prototype.getPointAt=function(e,t){return this.getPoint(e,t)},Ii.prototype.copy=function(e){return vi.prototype.copy.call(this,e),this.v1.copy(e.v1),this.v2.copy(e.v2),this},Ii.prototype.toJSON=function(){var e=vi.prototype.toJSON.call(this);return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},Ii.prototype.fromJSON=function(e){return vi.prototype.fromJSON.call(this,e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},Ni.prototype=Object.create(vi.prototype),Ni.prototype.constructor=Ni,Ni.prototype.isQuadraticBezierCurve=!0,Ni.prototype.getPoint=function(e,t){var n=t||new g,r=this.v0,i=this.v1,a=this.v2;return n.set(Ri(e,r.x,i.x,a.x),Ri(e,r.y,i.y,a.y)),n},Ni.prototype.copy=function(e){return vi.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this},Ni.prototype.toJSON=function(){var e=vi.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},Ni.prototype.fromJSON=function(e){return vi.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},Li.prototype=Object.create(vi.prototype),Li.prototype.constructor=Li,Li.prototype.isQuadraticBezierCurve3=!0,Li.prototype.getPoint=function(e,t){var n=t||new b,r=this.v0,i=this.v1,a=this.v2;return n.set(Ri(e,r.x,i.x,a.x),Ri(e,r.y,i.y,a.y),Ri(e,r.z,i.z,a.z)),n},Li.prototype.copy=function(e){return vi.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this},Li.prototype.toJSON=function(){var e=vi.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},Li.prototype.fromJSON=function(e){return vi.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},Di.prototype=Object.create(vi.prototype),Di.prototype.constructor=Di,Di.prototype.isSplineCurve=!0,Di.prototype.getPoint=function(e,t){var n=t||new g,r=this.points,i=(r.length-1)*e,a=Math.floor(i),o=i-a,s=r[0===a?a:a-1],c=r[a],l=r[a>r.length-2?r.length-1:a+1],u=r[a>r.length-3?r.length-1:a+2];return n.set(Ti(o,s.x,c.x,l.x,u.x),Ti(o,s.y,c.y,l.y,u.y)),n},Di.prototype.copy=function(e){vi.prototype.copy.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var r=e.points[t];this.points.push(r.clone())}return this},Di.prototype.toJSON=function(){var e=vi.prototype.toJSON.call(this);e.points=[];for(var t=0,n=this.points.length;t<n;t++){var r=this.points[t];e.points.push(r.toArray())}return e},Di.prototype.fromJSON=function(e){vi.prototype.fromJSON.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var r=e.points[t];this.points.push((new g).fromArray(r))}return this};var Fi=Object.freeze({ArcCurve:wi,CatmullRomCurve3:Mi,CubicBezierCurve:Ci,CubicBezierCurve3:Oi,EllipseCurve:bi,LineCurve:Pi,LineCurve3:Ii,QuadraticBezierCurve:Ni,QuadraticBezierCurve3:Li,SplineCurve:Di});function ji(){vi.call(this),this.type="CurvePath",this.curves=[],this.autoClose=!1}function Ui(e){ji.call(this),this.type="Path",this.currentPoint=new g,e&&this.setFromPoints(e)}function Bi(e){Ui.call(this,e),this.uuid=m.generateUUID(),this.type="Shape",this.holes=[]}function Vi(e,t){qe.call(this),this.type="Light",this.color=new fe(e),this.intensity=void 0!==t?t:1,this.receiveShadow=void 0}function zi(e,t,n){Vi.call(this,e,n),this.type="HemisphereLight",this.castShadow=void 0,this.position.copy(qe.DefaultUp),this.updateMatrix(),this.groundColor=new fe(t)}function Hi(e){this.camera=e,this.bias=0,this.radius=1,this.mapSize=new g(512,512),this.map=null,this.matrix=new y}function Gi(){Hi.call(this,new nn(50,1,.5,500))}function qi(e,t,n,r,i,a){Vi.call(this,e,t),this.type="SpotLight",this.position.copy(qe.DefaultUp),this.updateMatrix(),this.target=new qe,Object.defineProperty(this,"power",{get:function(){return this.intensity*Math.PI},set:function(e){this.intensity=e/Math.PI}}),this.distance=void 0!==n?n:0,this.angle=void 0!==r?r:Math.PI/3,this.penumbra=void 0!==i?i:0,this.decay=void 0!==a?a:1,this.shadow=new Gi}function Wi(e,t,n,r){Vi.call(this,e,t),this.type="PointLight",Object.defineProperty(this,"power",{get:function(){return 4*this.intensity*Math.PI},set:function(e){this.intensity=e/(4*Math.PI)}}),this.distance=void 0!==n?n:0,this.decay=void 0!==r?r:1,this.shadow=new Hi(new nn(90,1,.5,500))}function Ji(){Hi.call(this,new Je(-5,5,5,-5,.5,500))}function Zi(e,t){Vi.call(this,e,t),this.type="DirectionalLight",this.position.copy(qe.DefaultUp),this.updateMatrix(),this.target=new qe,this.shadow=new Ji}function Xi(e,t){Vi.call(this,e,t),this.type="AmbientLight",this.castShadow=void 0}function Yi(e,t,n,r){Vi.call(this,e,t),this.type="RectAreaLight",this.width=void 0!==n?n:10,this.height=void 0!==r?r:10}function Ki(e,t,n,r){ca.call(this,e,t,n,r)}function Qi(e,t,n){ca.call(this,e,t,n)}function $i(e,t,n,r){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=void 0!==r?r:new t.constructor(n),this.sampleValues=t,this.valueSize=n}function ea(e,t,n,r){$i.call(this,e,t,n,r)}function ta(e,t,n,r){ca.call(this,e,t,n,r)}function na(e,t,n,r){ca.call(this,e,t,n,r)}function ra(e,t,n,r){ca.call(this,e,t,n,r)}function ia(e,t,n,r){$i.call(this,e,t,n,r),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0}function aa(e,t,n,r){$i.call(this,e,t,n,r)}function oa(e,t,n,r){$i.call(this,e,t,n,r)}ji.prototype=Object.assign(Object.create(vi.prototype),{constructor:ji,add:function(e){this.curves.push(e)},closePath:function(){var e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);e.equals(t)||this.curves.push(new Pi(t,e))},getPoint:function(e){for(var t=e*this.getLength(),n=this.getCurveLengths(),r=0;r<n.length;){if(n[r]>=t){var i=n[r]-t,a=this.curves[r],o=a.getLength(),s=0===o?0:1-i/o;return a.getPointAt(s)}r++}return null},getLength:function(){var e=this.getCurveLengths();return e[e.length-1]},updateArcLengths:function(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()},getCurveLengths:function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var e=[],t=0,n=0,r=this.curves.length;n<r;n++)t+=this.curves[n].getLength(),e.push(t);return this.cacheLengths=e,e},getSpacedPoints:function(e){void 0===e&&(e=40);for(var t=[],n=0;n<=e;n++)t.push(this.getPoint(n/e));return this.autoClose&&t.push(t[0]),t},getPoints:function(e){e=e||12;for(var t,n=[],r=0,i=this.curves;r<i.length;r++)for(var a=i[r],o=a&&a.isEllipseCurve?2*e:a&&a.isLineCurve?1:a&&a.isSplineCurve?e*a.points.length:e,s=a.getPoints(o),c=0;c<s.length;c++){var l=s[c];t&&t.equals(l)||(n.push(l),t=l)}return this.autoClose&&n.length>1&&!n[n.length-1].equals(n[0])&&n.push(n[0]),n},copy:function(e){vi.prototype.copy.call(this,e),this.curves=[];for(var t=0,n=e.curves.length;t<n;t++){var r=e.curves[t];this.curves.push(r.clone())}return this.autoClose=e.autoClose,this},toJSON:function(){var e=vi.prototype.toJSON.call(this);e.autoClose=this.autoClose,e.curves=[];for(var t=0,n=this.curves.length;t<n;t++){var r=this.curves[t];e.curves.push(r.toJSON())}return e},fromJSON:function(e){vi.prototype.fromJSON.call(this,e),this.autoClose=e.autoClose,this.curves=[];for(var t=0,n=e.curves.length;t<n;t++){var r=e.curves[t];this.curves.push((new Fi[r.type]).fromJSON(r))}return this}}),Ui.prototype=Object.assign(Object.create(ji.prototype),{constructor:Ui,setFromPoints:function(e){this.moveTo(e[0].x,e[0].y);for(var t=1,n=e.length;t<n;t++)this.lineTo(e[t].x,e[t].y)},moveTo:function(e,t){this.currentPoint.set(e,t)},lineTo:function(e,t){var n=new Pi(this.currentPoint.clone(),new g(e,t));this.curves.push(n),this.currentPoint.set(e,t)},quadraticCurveTo:function(e,t,n,r){var i=new Ni(this.currentPoint.clone(),new g(e,t),new g(n,r));this.curves.push(i),this.currentPoint.set(n,r)},bezierCurveTo:function(e,t,n,r,i,a){var o=new Ci(this.currentPoint.clone(),new g(e,t),new g(n,r),new g(i,a));this.curves.push(o),this.currentPoint.set(i,a)},splineThru:function(e){var t=new Di([this.currentPoint.clone()].concat(e));this.curves.push(t),this.currentPoint.copy(e[e.length-1])},arc:function(e,t,n,r,i,a){var o=this.currentPoint.x,s=this.currentPoint.y;this.absarc(e+o,t+s,n,r,i,a)},absarc:function(e,t,n,r,i,a){this.absellipse(e,t,n,n,r,i,a)},ellipse:function(e,t,n,r,i,a,o,s){var c=this.currentPoint.x,l=this.currentPoint.y;this.absellipse(e+c,t+l,n,r,i,a,o,s)},absellipse:function(e,t,n,r,i,a,o,s){var c=new bi(e,t,n,r,i,a,o,s);if(this.curves.length>0){var l=c.getPoint(0);l.equals(this.currentPoint)||this.lineTo(l.x,l.y)}this.curves.push(c);var u=c.getPoint(1);this.currentPoint.copy(u)},copy:function(e){return ji.prototype.copy.call(this,e),this.currentPoint.copy(e.currentPoint),this},toJSON:function(){var e=ji.prototype.toJSON.call(this);return e.currentPoint=this.currentPoint.toArray(),e},fromJSON:function(e){return ji.prototype.fromJSON.call(this,e),this.currentPoint.fromArray(e.currentPoint),this}}),Bi.prototype=Object.assign(Object.create(Ui.prototype),{constructor:Bi,getPointsHoles:function(e){for(var t=[],n=0,r=this.holes.length;n<r;n++)t[n]=this.holes[n].getPoints(e);return t},extractPoints:function(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}},copy:function(e){Ui.prototype.copy.call(this,e),this.holes=[];for(var t=0,n=e.holes.length;t<n;t++){var r=e.holes[t];this.holes.push(r.clone())}return this},toJSON:function(){var e=Ui.prototype.toJSON.call(this);e.uuid=this.uuid,e.holes=[];for(var t=0,n=this.holes.length;t<n;t++){var r=this.holes[t];e.holes.push(r.toJSON())}return e},fromJSON:function(e){Ui.prototype.fromJSON.call(this,e),this.uuid=e.uuid,this.holes=[];for(var t=0,n=e.holes.length;t<n;t++){var r=e.holes[t];this.holes.push((new Ui).fromJSON(r))}return this}}),Vi.prototype=Object.assign(Object.create(qe.prototype),{constructor:Vi,isLight:!0,copy:function(e){return qe.prototype.copy.call(this,e),this.color.copy(e.color),this.intensity=e.intensity,this},toJSON:function(e){var t=qe.prototype.toJSON.call(this,e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,void 0!==this.groundColor&&(t.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(t.object.distance=this.distance),void 0!==this.angle&&(t.object.angle=this.angle),void 0!==this.decay&&(t.object.decay=this.decay),void 0!==this.penumbra&&(t.object.penumbra=this.penumbra),void 0!==this.shadow&&(t.object.shadow=this.shadow.toJSON()),t}}),zi.prototype=Object.assign(Object.create(Vi.prototype),{constructor:zi,isHemisphereLight:!0,copy:function(e){return Vi.prototype.copy.call(this,e),this.groundColor.copy(e.groundColor),this}}),Object.assign(Hi.prototype,{copy:function(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){var e={};return 0!==this.bias&&(e.bias=this.bias),1!==this.radius&&(e.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}),Gi.prototype=Object.assign(Object.create(Hi.prototype),{constructor:Gi,isSpotLightShadow:!0,update:function(e){var t=this.camera,n=2*m.RAD2DEG*e.angle,r=this.mapSize.width/this.mapSize.height,i=e.distance||t.far;n===t.fov&&r===t.aspect&&i===t.far||(t.fov=n,t.aspect=r,t.far=i,t.updateProjectionMatrix())}}),qi.prototype=Object.assign(Object.create(Vi.prototype),{constructor:qi,isSpotLight:!0,copy:function(e){return Vi.prototype.copy.call(this,e),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}}),Wi.prototype=Object.assign(Object.create(Vi.prototype),{constructor:Wi,isPointLight:!0,copy:function(e){return Vi.prototype.copy.call(this,e),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}),Ji.prototype=Object.assign(Object.create(Hi.prototype),{constructor:Ji}),Zi.prototype=Object.assign(Object.create(Vi.prototype),{constructor:Zi,isDirectionalLight:!0,copy:function(e){return Vi.prototype.copy.call(this,e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}),Xi.prototype=Object.assign(Object.create(Vi.prototype),{constructor:Xi,isAmbientLight:!0}),Yi.prototype=Object.assign(Object.create(Vi.prototype),{constructor:Yi,isRectAreaLight:!0,copy:function(e){return Vi.prototype.copy.call(this,e),this.width=e.width,this.height=e.height,this},toJSON:function(e){var t=Vi.prototype.toJSON.call(this,e);return t.object.width=this.width,t.object.height=this.height,t}}),Ki.prototype=Object.assign(Object.create(ca.prototype),{constructor:Ki,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),Qi.prototype=Object.assign(Object.create(ca.prototype),{constructor:Qi,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),Object.assign($i.prototype,{evaluate:function(e){var t=this.parameterPositions,n=this._cachedIndex,r=t[n],i=t[n-1];e:{t:{var a;n:{r:if(!(e<r)){for(var o=n+2;;){if(void 0===r){if(e<i)break r;return n=t.length,this._cachedIndex=n,this.afterEnd_(n-1,e,i)}if(n===o)break;if(i=r,e<(r=t[++n]))break t}a=t.length;break n}if(e>=i)break e;var s=t[1];e<s&&(n=2,i=s);for(o=n-2;;){if(void 0===i)return this._cachedIndex=0,this.beforeStart_(0,e,r);if(n===o)break;if(r=i,e>=(i=t[--n-1]))break t}a=n,n=0}for(;n<a;){var c=n+a>>>1;e<t[c]?a=c:n=c+1}if(r=t[n],void 0===(i=t[n-1]))return this._cachedIndex=0,this.beforeStart_(0,e,r);if(void 0===r)return n=t.length,this._cachedIndex=n,this.afterEnd_(n-1,i,e)}this._cachedIndex=n,this.intervalChanged_(n,i,r)}return this.interpolate_(n,i,e,r)},settings:null,DefaultSettings_:{},getSettings_:function(){return this.settings||this.DefaultSettings_},copySampleValue_:function(e){for(var t=this.resultBuffer,n=this.sampleValues,r=this.valueSize,i=e*r,a=0;a!==r;++a)t[a]=n[i+a];return t},interpolate_:function(){throw new Error("call to abstract method")},intervalChanged_:function(){}}),
//!\ DECLARE ALIAS AFTER assign prototype !
Object.assign($i.prototype,{beforeStart_:$i.prototype.copySampleValue_,afterEnd_:$i.prototype.copySampleValue_}),ea.prototype=Object.assign(Object.create($i.prototype),{constructor:ea,interpolate_:function(e,t,n,r){for(var i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=e*o,c=(n-t)/(r-t),l=s+o;s!==l;s+=4)v.slerpFlat(i,0,a,s-o,a,s,c);return i}}),ta.prototype=Object.assign(Object.create(ca.prototype),{constructor:ta,ValueTypeName:"quaternion",DefaultInterpolation:2301,InterpolantFactoryMethodLinear:function(e){return new ea(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodSmooth:void 0}),na.prototype=Object.assign(Object.create(ca.prototype),{constructor:na,ValueTypeName:"color"}),ra.prototype=Object.assign(Object.create(ca.prototype),{constructor:ra,ValueTypeName:"number"}),ia.prototype=Object.assign(Object.create($i.prototype),{constructor:ia,DefaultSettings_:{endingStart:2400,endingEnd:2400},intervalChanged_:function(e,t,n){var r=this.parameterPositions,i=e-2,a=e+1,o=r[i],s=r[a];if(void 0===o)switch(this.getSettings_().endingStart){case 2401:i=e,o=2*t-n;break;case 2402:o=t+r[i=r.length-2]-r[i+1];break;default:i=e,o=n}if(void 0===s)switch(this.getSettings_().endingEnd){case 2401:a=e,s=2*n-t;break;case 2402:a=1,s=n+r[1]-r[0];break;default:a=e-1,s=t}var c=.5*(n-t),l=this.valueSize;this._weightPrev=c/(t-o),this._weightNext=c/(s-n),this._offsetPrev=i*l,this._offsetNext=a*l},interpolate_:function(e,t,n,r){for(var i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=e*o,c=s-o,l=this._offsetPrev,u=this._offsetNext,h=this._weightPrev,d=this._weightNext,p=(n-t)/(r-t),f=p*p,m=f*p,g=-h*m+2*h*f-h*p,y=(1+h)*m+(-1.5-2*h)*f+(-.5+h)*p+1,v=(-1-d)*m+(1.5+d)*f+.5*p,b=d*m-d*f,w=0;w!==o;++w)i[w]=g*a[l+w]+y*a[c+w]+v*a[s+w]+b*a[u+w];return i}}),aa.prototype=Object.assign(Object.create($i.prototype),{constructor:aa,interpolate_:function(e,t,n,r){for(var i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=e*o,c=s-o,l=(n-t)/(r-t),u=1-l,h=0;h!==o;++h)i[h]=a[c+h]*u+a[s+h]*l;return i}}),oa.prototype=Object.assign(Object.create($i.prototype),{constructor:oa,interpolate_:function(e){return this.copySampleValue_(e-1)}});var sa={arraySlice:function(e,t,n){return sa.isTypedArray(e)?new e.constructor(e.subarray(t,void 0!==n?n:e.length)):e.slice(t,n)},convertArray:function(e,t,n){return!e||!n&&e.constructor===t?e:"number"==typeof t.BYTES_PER_ELEMENT?new t(e):Array.prototype.slice.call(e)},isTypedArray:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)},getKeyframeOrder:function(e){for(var t=e.length,n=new Array(t),r=0;r!==t;++r)n[r]=r;return n.sort((function(t,n){return e[t]-e[n]})),n},sortedArray:function(e,t,n){for(var r=e.length,i=new e.constructor(r),a=0,o=0;o!==r;++a)for(var s=n[a]*t,c=0;c!==t;++c)i[o++]=e[s+c];return i},flattenJSON:function(e,t,n,r){for(var i=1,a=e[0];void 0!==a&&void 0===a[r];)a=e[i++];if(void 0!==a){var o=a[r];if(void 0!==o)if(Array.isArray(o))do{void 0!==(o=a[r])&&(t.push(a.time),n.push.apply(n,o)),a=e[i++]}while(void 0!==a);else if(void 0!==o.toArray)do{void 0!==(o=a[r])&&(t.push(a.time),o.toArray(n,n.length)),a=e[i++]}while(void 0!==a);else do{void 0!==(o=a[r])&&(t.push(a.time),n.push(o)),a=e[i++]}while(void 0!==a)}}};function ca(e,t,n,r){if(void 0===e)throw new Error("THREE.KeyframeTrack: track name is undefined");if(void 0===t||0===t.length)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=sa.convertArray(t,this.TimeBufferType),this.values=sa.convertArray(n,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation),this.validate(),this.optimize()}function la(e,t,n,r){ca.call(this,e,t,n,r)}function ua(e,t,n){this.name=e,this.tracks=n,this.duration=void 0!==t?t:-1,this.uuid=m.generateUUID(),this.duration<0&&this.resetDuration(),this.optimize()}function ha(e){this.manager=void 0!==e?e:hi,this.textures={}}function da(e){this.manager=void 0!==e?e:hi}Object.assign(ca,{parse:function(e){if(void 0===e.type)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");var t=ca._getTrackTypeForValueTypeName(e.type);if(void 0===e.times){var n=[],r=[];sa.flattenJSON(e.keys,n,r,"value"),e.times=n,e.values=r}return void 0!==t.parse?t.parse(e):new t(e.name,e.times,e.values,e.interpolation)},toJSON:function(e){var t,n=e.constructor;if(void 0!==n.toJSON)t=n.toJSON(e);else{t={name:e.name,times:sa.convertArray(e.times,Array),values:sa.convertArray(e.values,Array)};var r=e.getInterpolation();r!==e.DefaultInterpolation&&(t.interpolation=r)}return t.type=e.ValueTypeName,t},_getTrackTypeForValueTypeName:function(e){switch(e.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return ra;case"vector":case"vector2":case"vector3":case"vector4":return la;case"color":return na;case"quaternion":return ta;case"bool":case"boolean":return Qi;case"string":return Ki}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+e)}}),Object.assign(ca.prototype,{constructor:ca,TimeBufferType:Float32Array,ValueBufferType:Float32Array,DefaultInterpolation:2301,InterpolantFactoryMethodDiscrete:function(e){return new oa(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodLinear:function(e){return new aa(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodSmooth:function(e){return new ia(this.times,this.values,this.getValueSize(),e)},setInterpolation:function(e){var t;switch(e){case 2300:t=this.InterpolantFactoryMethodDiscrete;break;case 2301:t=this.InterpolantFactoryMethodLinear;break;case 2302:t=this.InterpolantFactoryMethodSmooth}if(void 0!==t)this.createInterpolant=t;else{var n="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(e===this.DefaultInterpolation)throw new Error(n);this.setInterpolation(this.DefaultInterpolation)}console.warn("THREE.KeyframeTrack:",n)}},getInterpolation:function(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return 2300;case this.InterpolantFactoryMethodLinear:return 2301;case this.InterpolantFactoryMethodSmooth:return 2302}},getValueSize:function(){return this.values.length/this.times.length},shift:function(e){if(0!==e)for(var t=this.times,n=0,r=t.length;n!==r;++n)t[n]+=e;return this},scale:function(e){if(1!==e)for(var t=this.times,n=0,r=t.length;n!==r;++n)t[n]*=e;return this},trim:function(e,t){for(var n=this.times,r=n.length,i=0,a=r-1;i!==r&&n[i]<e;)++i;for(;-1!==a&&n[a]>t;)--a;if(++a,0!==i||a!==r){i>=a&&(i=(a=Math.max(a,1))-1);var o=this.getValueSize();this.times=sa.arraySlice(n,i,a),this.values=sa.arraySlice(this.values,i*o,a*o)}return this},validate:function(){var e=!0,t=this.getValueSize();t-Math.floor(t)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);var n=this.times,r=this.values,i=n.length;0===i&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);for(var a=null,o=0;o!==i;o++){var s=n[o];if("number"==typeof s&&isNaN(s)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,o,s),e=!1;break}if(null!==a&&a>s){console.error("THREE.KeyframeTrack: Out of order keys.",this,o,s,a),e=!1;break}a=s}if(void 0!==r&&sa.isTypedArray(r)){o=0;for(var c=r.length;o!==c;++o){var l=r[o];if(isNaN(l)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,o,l),e=!1;break}}}return e},optimize:function(){for(var e=this.times,t=this.values,n=this.getValueSize(),r=2302===this.getInterpolation(),i=1,a=e.length-1,o=1;o<a;++o){var s=!1,c=e[o];if(c!==e[o+1]&&(1!==o||c!==c[0]))if(r)s=!0;else for(var l=o*n,u=l-n,h=l+n,d=0;d!==n;++d){var p=t[l+d];if(p!==t[u+d]||p!==t[h+d]){s=!0;break}}if(s){if(o!==i){e[i]=e[o];var f=o*n,m=i*n;for(d=0;d!==n;++d)t[m+d]=t[f+d]}++i}}if(a>0){e[i]=e[a];for(f=a*n,m=i*n,d=0;d!==n;++d)t[m+d]=t[f+d];++i}return i!==e.length&&(this.times=sa.arraySlice(e,0,i),this.values=sa.arraySlice(t,0,i*n)),this}}),la.prototype=Object.assign(Object.create(ca.prototype),{constructor:la,ValueTypeName:"vector"}),Object.assign(ua,{parse:function(e){for(var t=[],n=e.tracks,r=1/(e.fps||1),i=0,a=n.length;i!==a;++i)t.push(ca.parse(n[i]).scale(r));return new ua(e.name,e.duration,t)},toJSON:function(e){for(var t=[],n=e.tracks,r={name:e.name,duration:e.duration,tracks:t},i=0,a=n.length;i!==a;++i)t.push(ca.toJSON(n[i]));return r},CreateFromMorphTargetSequence:function(e,t,n,r){for(var i=t.length,a=[],o=0;o<i;o++){var s=[],c=[];s.push((o+i-1)%i,o,(o+1)%i),c.push(0,1,0);var l=sa.getKeyframeOrder(s);s=sa.sortedArray(s,1,l),c=sa.sortedArray(c,1,l),r||0!==s[0]||(s.push(i),c.push(c[0])),a.push(new ra(".morphTargetInfluences["+t[o].name+"]",s,c).scale(1/n))}return new ua(e,-1,a)},findByName:function(e,t){var n=e;if(!Array.isArray(e)){var r=e;n=r.geometry&&r.geometry.animations||r.animations}for(var i=0;i<n.length;i++)if(n[i].name===t)return n[i];return null},CreateClipsFromMorphTargetSequences:function(e,t,n){for(var r={},i=/^([\w-]*?)([\d]+)$/,a=0,o=e.length;a<o;a++){var s=e[a],c=s.name.match(i);if(c&&c.length>1){var l=r[h=c[1]];l||(r[h]=l=[]),l.push(s)}}var u=[];for(var h in r)u.push(ua.CreateFromMorphTargetSequence(h,r[h],t,n));return u},parseAnimation:function(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;for(var n=function(e,t,n,r,i){if(0!==n.length){var a=[],o=[];sa.flattenJSON(n,a,o,r),0!==a.length&&i.push(new e(t,a,o))}},r=[],i=e.name||"default",a=e.length||-1,o=e.fps||30,s=e.hierarchy||[],c=0;c<s.length;c++){var l=s[c].keys;if(l&&0!==l.length)if(l[0].morphTargets){for(var u={},h=0;h<l.length;h++)if(l[h].morphTargets)for(var d=0;d<l[h].morphTargets.length;d++)u[l[h].morphTargets[d]]=-1;for(var p in u){var f=[],m=[];for(d=0;d!==l[h].morphTargets.length;++d){var g=l[h];f.push(g.time),m.push(g.morphTarget===p?1:0)}r.push(new ra(".morphTargetInfluence["+p+"]",f,m))}a=u.length*(o||1)}else{var y=".bones["+t[c].name+"]";n(la,y+".position",l,"pos",r),n(ta,y+".quaternion",l,"rot",r),n(la,y+".scale",l,"scl",r)}}return 0===r.length?null:new ua(i,a,r)}}),Object.assign(ua.prototype,{resetDuration:function(){for(var e=0,t=0,n=this.tracks.length;t!==n;++t){var r=this.tracks[t];e=Math.max(e,r.times[r.times.length-1])}this.duration=e},trim:function(){for(var e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this},optimize:function(){for(var e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}}),Object.assign(ha.prototype,{load:function(e,t,n,r){var i=this;new pi(i.manager).load(e,(function(e){t(i.parse(JSON.parse(e)))}),n,r)},setTextures:function(e){this.textures=e},parse:function(e){var t=this.textures;function n(e){return void 0===t[e]&&console.warn("THREE.MaterialLoader: Undefined texture",e),t[e]}var r=new ci[e.type];if(void 0!==e.uuid&&(r.uuid=e.uuid),void 0!==e.name&&(r.name=e.name),void 0!==e.color&&r.color.setHex(e.color),void 0!==e.roughness&&(r.roughness=e.roughness),void 0!==e.metalness&&(r.metalness=e.metalness),void 0!==e.emissive&&r.emissive.setHex(e.emissive),void 0!==e.specular&&r.specular.setHex(e.specular),void 0!==e.shininess&&(r.shininess=e.shininess),void 0!==e.clearCoat&&(r.clearCoat=e.clearCoat),void 0!==e.clearCoatRoughness&&(r.clearCoatRoughness=e.clearCoatRoughness),void 0!==e.uniforms&&(r.uniforms=e.uniforms),void 0!==e.vertexShader&&(r.vertexShader=e.vertexShader),void 0!==e.fragmentShader&&(r.fragmentShader=e.fragmentShader),void 0!==e.vertexColors&&(r.vertexColors=e.vertexColors),void 0!==e.fog&&(r.fog=e.fog),void 0!==e.flatShading&&(r.flatShading=e.flatShading),void 0!==e.blending&&(r.blending=e.blending),void 0!==e.side&&(r.side=e.side),void 0!==e.opacity&&(r.opacity=e.opacity),void 0!==e.transparent&&(r.transparent=e.transparent),void 0!==e.alphaTest&&(r.alphaTest=e.alphaTest),void 0!==e.depthTest&&(r.depthTest=e.depthTest),void 0!==e.depthWrite&&(r.depthWrite=e.depthWrite),void 0!==e.colorWrite&&(r.colorWrite=e.colorWrite),void 0!==e.wireframe&&(r.wireframe=e.wireframe),void 0!==e.wireframeLinewidth&&(r.wireframeLinewidth=e.wireframeLinewidth),void 0!==e.wireframeLinecap&&(r.wireframeLinecap=e.wireframeLinecap),void 0!==e.wireframeLinejoin&&(r.wireframeLinejoin=e.wireframeLinejoin),void 0!==e.rotation&&(r.rotation=e.rotation),1!==e.linewidth&&(r.linewidth=e.linewidth),void 0!==e.dashSize&&(r.dashSize=e.dashSize),void 0!==e.gapSize&&(r.gapSize=e.gapSize),void 0!==e.scale&&(r.scale=e.scale),void 0!==e.skinning&&(r.skinning=e.skinning),void 0!==e.morphTargets&&(r.morphTargets=e.morphTargets),void 0!==e.dithering&&(r.dithering=e.dithering),void 0!==e.visible&&(r.visible=e.visible),void 0!==e.userData&&(r.userData=e.userData),void 0!==e.shading&&(r.flatShading=1===e.shading),void 0!==e.size&&(r.size=e.size),void 0!==e.sizeAttenuation&&(r.sizeAttenuation=e.sizeAttenuation),void 0!==e.map&&(r.map=n(e.map)),void 0!==e.alphaMap&&(r.alphaMap=n(e.alphaMap),r.transparent=!0),void 0!==e.bumpMap&&(r.bumpMap=n(e.bumpMap)),void 0!==e.bumpScale&&(r.bumpScale=e.bumpScale),void 0!==e.normalMap&&(r.normalMap=n(e.normalMap)),void 0!==e.normalScale){var i=e.normalScale;!1===Array.isArray(i)&&(i=[i,i]),r.normalScale=(new g).fromArray(i)}return void 0!==e.displacementMap&&(r.displacementMap=n(e.displacementMap)),void 0!==e.displacementScale&&(r.displacementScale=e.displacementScale),void 0!==e.displacementBias&&(r.displacementBias=e.displacementBias),void 0!==e.roughnessMap&&(r.roughnessMap=n(e.roughnessMap)),void 0!==e.metalnessMap&&(r.metalnessMap=n(e.metalnessMap)),void 0!==e.emissiveMap&&(r.emissiveMap=n(e.emissiveMap)),void 0!==e.emissiveIntensity&&(r.emissiveIntensity=e.emissiveIntensity),void 0!==e.specularMap&&(r.specularMap=n(e.specularMap)),void 0!==e.envMap&&(r.envMap=n(e.envMap)),void 0!==e.reflectivity&&(r.reflectivity=e.reflectivity),void 0!==e.lightMap&&(r.lightMap=n(e.lightMap)),void 0!==e.lightMapIntensity&&(r.lightMapIntensity=e.lightMapIntensity),void 0!==e.aoMap&&(r.aoMap=n(e.aoMap)),void 0!==e.aoMapIntensity&&(r.aoMapIntensity=e.aoMapIntensity),void 0!==e.gradientMap&&(r.gradientMap=n(e.gradientMap)),r}}),Object.assign(da.prototype,{load:function(e,t,n,r){var i=this;new pi(i.manager).load(e,(function(e){t(i.parse(JSON.parse(e)))}),n,r)},parse:function(e){var t=new vt,n=e.data.index;if(void 0!==n){var r=new ya[n.type](n.array);t.setIndex(new Qe(r,1))}var i=e.data.attributes;for(var a in i){var o=i[a];r=new ya[o.type](o.array);t.addAttribute(a,new Qe(r,o.itemSize,o.normalized))}var s=e.data.groups||e.data.drawcalls||e.data.offsets;if(void 0!==s)for(var c=0,l=s.length;c!==l;++c){var u=s[c];t.addGroup(u.start,u.count,u.materialIndex)}var h=e.data.boundingSphere;if(void 0!==h){var d=new b;void 0!==h.center&&d.fromArray(h.center),t.boundingSphere=new Ie(d,h.radius)}return t}});var pa,fa,ma,ga,ya={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:"undefined"!=typeof Uint8ClampedArray?Uint8ClampedArray:Uint8Array,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};function va(){this.onLoadStart=function(){},this.onLoadProgress=function(){},this.onLoadComplete=function(){}}va.Handlers={handlers:[],add:function(e,t){this.handlers.push(e,t)},get:function(e){for(var t=this.handlers,n=0,r=t.length;n<r;n+=2){var i=t[n],a=t[n+1];if(i.test(e))return a}return null}},Object.assign(va.prototype,{crossOrigin:void 0,initMaterials:function(e,t,n){for(var r=[],i=0;i<e.length;++i)r[i]=this.createMaterial(e[i],t,n);return r},createMaterial:(pa={NoBlending:0,NormalBlending:1,AdditiveBlending:2,SubtractiveBlending:3,MultiplyBlending:4,CustomBlending:5},fa=new fe,ma=new yi,ga=new ha,function(e,t,n){var r={};function i(e,i,a,o,s){var c,l=t+e,u=va.Handlers.get(l);null!==u?c=u.load(l):(ma.setCrossOrigin(n),c=ma.load(l)),void 0!==i&&(c.repeat.fromArray(i),1!==i[0]&&(c.wrapS=1e3),1!==i[1]&&(c.wrapT=1e3)),void 0!==a&&c.offset.fromArray(a),void 0!==o&&("repeat"===o[0]&&(c.wrapS=1e3),"mirror"===o[0]&&(c.wrapS=1002),"repeat"===o[1]&&(c.wrapT=1e3),"mirror"===o[1]&&(c.wrapT=1002)),void 0!==s&&(c.anisotropy=s);var h=m.generateUUID();return r[h]=c,h}var a={uuid:m.generateUUID(),type:"MeshLambertMaterial"};for(var o in e){var s=e[o];switch(o){case"DbgColor":case"DbgIndex":case"opticalDensity":case"illumination":break;case"DbgName":a.name=s;break;case"blending":a.blending=pa[s];break;case"colorAmbient":case"mapAmbient":console.warn("THREE.Loader.createMaterial:",o,"is no longer supported.");break;case"colorDiffuse":a.color=fa.fromArray(s).getHex();break;case"colorSpecular":a.specular=fa.fromArray(s).getHex();break;case"colorEmissive":a.emissive=fa.fromArray(s).getHex();break;case"specularCoef":a.shininess=s;break;case"shading":"basic"===s.toLowerCase()&&(a.type="MeshBasicMaterial"),"phong"===s.toLowerCase()&&(a.type="MeshPhongMaterial"),"standard"===s.toLowerCase()&&(a.type="MeshStandardMaterial");break;case"mapDiffuse":a.map=i(s,e.mapDiffuseRepeat,e.mapDiffuseOffset,e.mapDiffuseWrap,e.mapDiffuseAnisotropy);break;case"mapDiffuseRepeat":case"mapDiffuseOffset":case"mapDiffuseWrap":case"mapDiffuseAnisotropy":break;case"mapEmissive":a.emissiveMap=i(s,e.mapEmissiveRepeat,e.mapEmissiveOffset,e.mapEmissiveWrap,e.mapEmissiveAnisotropy);break;case"mapEmissiveRepeat":case"mapEmissiveOffset":case"mapEmissiveWrap":case"mapEmissiveAnisotropy":break;case"mapLight":a.lightMap=i(s,e.mapLightRepeat,e.mapLightOffset,e.mapLightWrap,e.mapLightAnisotropy);break;case"mapLightRepeat":case"mapLightOffset":case"mapLightWrap":case"mapLightAnisotropy":break;case"mapAO":a.aoMap=i(s,e.mapAORepeat,e.mapAOOffset,e.mapAOWrap,e.mapAOAnisotropy);break;case"mapAORepeat":case"mapAOOffset":case"mapAOWrap":case"mapAOAnisotropy":break;case"mapBump":a.bumpMap=i(s,e.mapBumpRepeat,e.mapBumpOffset,e.mapBumpWrap,e.mapBumpAnisotropy);break;case"mapBumpScale":a.bumpScale=s;break;case"mapBumpRepeat":case"mapBumpOffset":case"mapBumpWrap":case"mapBumpAnisotropy":break;case"mapNormal":a.normalMap=i(s,e.mapNormalRepeat,e.mapNormalOffset,e.mapNormalWrap,e.mapNormalAnisotropy);break;case"mapNormalFactor":a.normalScale=[s,s];break;case"mapNormalRepeat":case"mapNormalOffset":case"mapNormalWrap":case"mapNormalAnisotropy":break;case"mapSpecular":a.specularMap=i(s,e.mapSpecularRepeat,e.mapSpecularOffset,e.mapSpecularWrap,e.mapSpecularAnisotropy);break;case"mapSpecularRepeat":case"mapSpecularOffset":case"mapSpecularWrap":case"mapSpecularAnisotropy":break;case"mapMetalness":a.metalnessMap=i(s,e.mapMetalnessRepeat,e.mapMetalnessOffset,e.mapMetalnessWrap,e.mapMetalnessAnisotropy);break;case"mapMetalnessRepeat":case"mapMetalnessOffset":case"mapMetalnessWrap":case"mapMetalnessAnisotropy":break;case"mapRoughness":a.roughnessMap=i(s,e.mapRoughnessRepeat,e.mapRoughnessOffset,e.mapRoughnessWrap,e.mapRoughnessAnisotropy);break;case"mapRoughnessRepeat":case"mapRoughnessOffset":case"mapRoughnessWrap":case"mapRoughnessAnisotropy":break;case"mapAlpha":a.alphaMap=i(s,e.mapAlphaRepeat,e.mapAlphaOffset,e.mapAlphaWrap,e.mapAlphaAnisotropy);break;case"mapAlphaRepeat":case"mapAlphaOffset":case"mapAlphaWrap":case"mapAlphaAnisotropy":break;case"flipSided":a.side=1;break;case"doubleSided":a.side=2;break;case"transparency":console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),a.opacity=s;break;case"depthTest":case"depthWrite":case"colorWrite":case"opacity":case"reflectivity":case"transparent":case"visible":case"wireframe":a[o]=s;break;case"vertexColors":!0===s&&(a.vertexColors=2),"face"===s&&(a.vertexColors=1);break;default:console.error("THREE.Loader.createMaterial: Unsupported",o,s)}}return"MeshBasicMaterial"===a.type&&delete a.emissive,"MeshPhongMaterial"!==a.type&&delete a.specular,a.opacity<1&&(a.transparent=!0),ga.setTextures(r),ga.parse(a)})});var ba=function(e){var t=e.split("/");return 1===t.length?"./":(t.pop(),t.join("/")+"/")};function wa(e){"boolean"==typeof e&&(console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),e=void 0),this.manager=void 0!==e?e:hi,this.withCredentials=!1}Object.assign(wa.prototype,{load:function(e,t,n,r){var i=this,a=this.texturePath&&"string"==typeof this.texturePath?this.texturePath:ba(e),o=new pi(this.manager);o.setWithCredentials(this.withCredentials),o.load(e,(function(n){var r=JSON.parse(n),o=r.metadata;if(void 0!==o){var s=o.type;if(void 0!==s){if("object"===s.toLowerCase())return void console.error("THREE.JSONLoader: "+e+" should be loaded with THREE.ObjectLoader instead.");if("scene"===s.toLowerCase())return void console.error("THREE.JSONLoader: "+e+" should be loaded with THREE.SceneLoader instead.")}}var c=i.parse(r,a);t(c.geometry,c.materials)}),n,r)},setTexturePath:function(e){this.texturePath=e},parse:function(e,t){void 0!==e.data&&(e=e.data),void 0!==e.scale?e.scale=1/e.scale:e.scale=1;var n=new Ke;return function(e,t){function n(e,t){return e&1<<t}var r,i,a,o,s,c,l,u,h,d,p,f,m,y,v,w,A,E,x,_,S,M,T,R,k,C=e.faces,O=e.vertices,P=e.normals,I=e.colors,N=e.scale,L=0;if(void 0!==e.uvs){for(r=0;r<e.uvs.length;r++)e.uvs[r].length&&L++;for(r=0;r<L;r++)t.faceVertexUvs[r]=[]}for(o=0,s=O.length;o<s;)(E=new b).x=O[o++]*N,E.y=O[o++]*N,E.z=O[o++]*N,t.vertices.push(E);for(o=0,s=C.length;o<s;)if(p=n(d=C[o++],0),f=n(d,1),m=n(d,3),y=n(d,4),v=n(d,5),w=n(d,6),A=n(d,7),p){if((_=new Ze).a=C[o],_.b=C[o+1],_.c=C[o+3],(S=new Ze).a=C[o+1],S.b=C[o+2],S.c=C[o+3],o+=4,f&&(h=C[o++],_.materialIndex=h,S.materialIndex=h),a=t.faces.length,m)for(r=0;r<L;r++)for(R=e.uvs[r],t.faceVertexUvs[r][a]=[],t.faceVertexUvs[r][a+1]=[],i=0;i<4;i++)k=new g(R[2*(u=C[o++])],R[2*u+1]),2!==i&&t.faceVertexUvs[r][a].push(k),0!==i&&t.faceVertexUvs[r][a+1].push(k);if(y&&(l=3*C[o++],_.normal.set(P[l++],P[l++],P[l]),S.normal.copy(_.normal)),v)for(r=0;r<4;r++)l=3*C[o++],T=new b(P[l++],P[l++],P[l]),2!==r&&_.vertexNormals.push(T),0!==r&&S.vertexNormals.push(T);if(w&&(M=I[c=C[o++]],_.color.setHex(M),S.color.setHex(M)),A)for(r=0;r<4;r++)M=I[c=C[o++]],2!==r&&_.vertexColors.push(new fe(M)),0!==r&&S.vertexColors.push(new fe(M));t.faces.push(_),t.faces.push(S)}else{if((x=new Ze).a=C[o++],x.b=C[o++],x.c=C[o++],f&&(h=C[o++],x.materialIndex=h),a=t.faces.length,m)for(r=0;r<L;r++)for(R=e.uvs[r],t.faceVertexUvs[r][a]=[],i=0;i<3;i++)k=new g(R[2*(u=C[o++])],R[2*u+1]),t.faceVertexUvs[r][a].push(k);if(y&&(l=3*C[o++],x.normal.set(P[l++],P[l++],P[l])),v)for(r=0;r<3;r++)l=3*C[o++],T=new b(P[l++],P[l++],P[l]),x.vertexNormals.push(T);if(w&&(c=C[o++],x.color.setHex(I[c])),A)for(r=0;r<3;r++)c=C[o++],x.vertexColors.push(new fe(I[c]));t.faces.push(x)}}(e,n),function(e,t){var n=void 0!==e.influencesPerVertex?e.influencesPerVertex:2;if(e.skinWeights)for(var r=0,i=e.skinWeights.length;r<i;r+=n){var a=e.skinWeights[r],o=n>1?e.skinWeights[r+1]:0,s=n>2?e.skinWeights[r+2]:0,c=n>3?e.skinWeights[r+3]:0;t.skinWeights.push(new x(a,o,s,c))}if(e.skinIndices)for(r=0,i=e.skinIndices.length;r<i;r+=n){var l=e.skinIndices[r],u=n>1?e.skinIndices[r+1]:0,h=n>2?e.skinIndices[r+2]:0,d=n>3?e.skinIndices[r+3]:0;t.skinIndices.push(new x(l,u,h,d))}t.bones=e.bones,t.bones&&t.bones.length>0&&(t.skinWeights.length!==t.skinIndices.length||t.skinIndices.length!==t.vertices.length)&&console.warn("When skinning, number of vertices ("+t.vertices.length+"), skinIndices ("+t.skinIndices.length+"), and skinWeights ("+t.skinWeights.length+") should match.")}(e,n),function(e,t){var n=e.scale;if(void 0!==e.morphTargets)for(var r=0,i=e.morphTargets.length;r<i;r++){t.morphTargets[r]={},t.morphTargets[r].name=e.morphTargets[r].name,t.morphTargets[r].vertices=[];for(var a=t.morphTargets[r].vertices,o=e.morphTargets[r].vertices,s=0,c=o.length;s<c;s+=3){var l=new b;l.x=o[s]*n,l.y=o[s+1]*n,l.z=o[s+2]*n,a.push(l)}}if(void 0!==e.morphColors&&e.morphColors.length>0){console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.');var u=t.faces,h=e.morphColors[0].colors;for(r=0,i=u.length;r<i;r++)u[r].color.fromArray(h,3*r)}}(e,n),function(e,t){var n=[],r=[];void 0!==e.animation&&r.push(e.animation),void 0!==e.animations&&(e.animations.length?r=r.concat(e.animations):r.push(e.animations));for(var i=0;i<r.length;i++){var a=ua.parseAnimation(r[i],t.bones);a&&n.push(a)}if(t.morphTargets){var o=ua.CreateClipsFromMorphTargetSequences(t.morphTargets,10);n=n.concat(o)}n.length>0&&(t.animations=n)}(e,n),n.computeFaceNormals(),n.computeBoundingSphere(),void 0===e.materials||0===e.materials.length?{geometry:n}:{geometry:n,materials:va.prototype.initMaterials(e.materials,t,this.crossOrigin)}}}),Object.assign(function(e){this.manager=void 0!==e?e:hi,this.texturePath=""}.prototype,{load:function(e,t,n,r){""===this.texturePath&&(this.texturePath=e.substring(0,e.lastIndexOf("/")+1));var i=this;new pi(i.manager).load(e,(function(n){var a=null;try{a=JSON.parse(n)}catch(t){return void 0!==r&&r(t),void console.error("THREE:ObjectLoader: Can't parse "+e+".",t.message)}var o=a.metadata;void 0!==o&&void 0!==o.type&&"geometry"!==o.type.toLowerCase()?i.parse(a,t):console.error("THREE.ObjectLoader: Can't load "+e+". Use THREE.JSONLoader instead.")}),n,r)},setTexturePath:function(e){this.texturePath=e},setCrossOrigin:function(e){this.crossOrigin=e},parse:function(e,t){var n=this.parseShape(e.shapes),r=this.parseGeometries(e.geometries,n),i=this.parseImages(e.images,(function(){void 0!==t&&t(s)})),a=this.parseTextures(e.textures,i),o=this.parseMaterials(e.materials,a),s=this.parseObject(e.object,r,o);return e.animations&&(s.animations=this.parseAnimations(e.animations)),void 0!==e.images&&0!==e.images.length||void 0!==t&&t(s),s},parseShape:function(e){var t={};if(void 0!==e)for(var n=0,r=e.length;n<r;n++){var i=(new Bi).fromJSON(e[n]);t[i.uuid]=i}return t},parseGeometries:function(e,t){var n={};if(void 0!==e)for(var r=new wa,i=new da,a=0,o=e.length;a<o;a++){var s,c=e[a];switch(c.type){case"PlaneGeometry":case"PlaneBufferGeometry":s=new Qr[c.type](c.width,c.height,c.widthSegments,c.heightSegments);break;case"BoxGeometry":case"BoxBufferGeometry":case"CubeGeometry":s=new Qr[c.type](c.width,c.height,c.depth,c.widthSegments,c.heightSegments,c.depthSegments);break;case"CircleGeometry":case"CircleBufferGeometry":s=new Qr[c.type](c.radius,c.segments,c.thetaStart,c.thetaLength);break;case"CylinderGeometry":case"CylinderBufferGeometry":s=new Qr[c.type](c.radiusTop,c.radiusBottom,c.height,c.radialSegments,c.heightSegments,c.openEnded,c.thetaStart,c.thetaLength);break;case"ConeGeometry":case"ConeBufferGeometry":s=new Qr[c.type](c.radius,c.height,c.radialSegments,c.heightSegments,c.openEnded,c.thetaStart,c.thetaLength);break;case"SphereGeometry":case"SphereBufferGeometry":s=new Qr[c.type](c.radius,c.widthSegments,c.heightSegments,c.phiStart,c.phiLength,c.thetaStart,c.thetaLength);break;case"DodecahedronGeometry":case"DodecahedronBufferGeometry":case"IcosahedronGeometry":case"IcosahedronBufferGeometry":case"OctahedronGeometry":case"OctahedronBufferGeometry":case"TetrahedronGeometry":case"TetrahedronBufferGeometry":s=new Qr[c.type](c.radius,c.detail);break;case"RingGeometry":case"RingBufferGeometry":s=new Qr[c.type](c.innerRadius,c.outerRadius,c.thetaSegments,c.phiSegments,c.thetaStart,c.thetaLength);break;case"TorusGeometry":case"TorusBufferGeometry":s=new Qr[c.type](c.radius,c.tube,c.radialSegments,c.tubularSegments,c.arc);break;case"TorusKnotGeometry":case"TorusKnotBufferGeometry":s=new Qr[c.type](c.radius,c.tube,c.tubularSegments,c.radialSegments,c.p,c.q);break;case"LatheGeometry":case"LatheBufferGeometry":s=new Qr[c.type](c.points,c.segments,c.phiStart,c.phiLength);break;case"PolyhedronGeometry":case"PolyhedronBufferGeometry":s=new Qr[c.type](c.vertices,c.indices,c.radius,c.details);break;case"ShapeGeometry":case"ShapeBufferGeometry":var l=[];for(a=0,o=c.shapes.length;a<o;a++){var u=t[c.shapes[a]];l.push(u)}s=new Qr[c.type](l,c.curveSegments);break;case"BufferGeometry":s=i.parse(c);break;case"Geometry":s=r.parse(c,this.texturePath).geometry;break;default:console.warn('THREE.ObjectLoader: Unsupported geometry type "'+c.type+'"');continue}s.uuid=c.uuid,void 0!==c.name&&(s.name=c.name),n[c.uuid]=s}return n},parseMaterials:function(e,t){var n={};if(void 0!==e){var r=new ha;r.setTextures(t);for(var i=0,a=e.length;i<a;i++){var o=e[i];if("MultiMaterial"===o.type){for(var s=[],c=0;c<o.materials.length;c++)s.push(r.parse(o.materials[c]));n[o.uuid]=s}else n[o.uuid]=r.parse(o)}}return n},parseAnimations:function(e){for(var t=[],n=0;n<e.length;n++){var r=ua.parse(e[n]);t.push(r)}return t},parseImages:function(e,t){var n=this,r={};function i(e){return n.manager.itemStart(e),a.load(e,(function(){n.manager.itemEnd(e)}),void 0,(function(){n.manager.itemEnd(e),n.manager.itemError(e)}))}if(void 0!==e&&e.length>0){var a=new mi(new ui(t));a.setCrossOrigin(this.crossOrigin);for(var o=0,s=e.length;o<s;o++){var c=e[o],l=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(c.url)?c.url:n.texturePath+c.url;r[c.uuid]=i(l)}}return r},parseTextures:function(e,t){function n(e,t){return"number"==typeof e?e:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",e),t[e])}var r={};if(void 0!==e)for(var i=0,a=e.length;i<a;i++){var o=e[i];void 0===o.image&&console.warn('THREE.ObjectLoader: No "image" specified for',o.uuid),void 0===t[o.image]&&console.warn("THREE.ObjectLoader: Undefined image",o.image);var s=new E(t[o.image]);s.needsUpdate=!0,s.uuid=o.uuid,void 0!==o.name&&(s.name=o.name),void 0!==o.mapping&&(s.mapping=n(o.mapping,Ea)),void 0!==o.offset&&s.offset.fromArray(o.offset),void 0!==o.repeat&&s.repeat.fromArray(o.repeat),void 0!==o.center&&s.center.fromArray(o.center),void 0!==o.rotation&&(s.rotation=o.rotation),void 0!==o.wrap&&(s.wrapS=n(o.wrap[0],xa),s.wrapT=n(o.wrap[1],xa)),void 0!==o.minFilter&&(s.minFilter=n(o.minFilter,_a)),void 0!==o.magFilter&&(s.magFilter=n(o.magFilter,_a)),void 0!==o.anisotropy&&(s.anisotropy=o.anisotropy),void 0!==o.flipY&&(s.flipY=o.flipY),r[o.uuid]=s}return r},parseObject:function(e,t,n){var r;function i(e){return void 0===t[e]&&console.warn("THREE.ObjectLoader: Undefined geometry",e),t[e]}function a(e){if(void 0!==e){if(Array.isArray(e)){for(var t=[],r=0,i=e.length;r<i;r++){var a=e[r];void 0===n[a]&&console.warn("THREE.ObjectLoader: Undefined material",a),t.push(n[a])}return t}return void 0===n[e]&&console.warn("THREE.ObjectLoader: Undefined material",e),n[e]}}switch(e.type){case"Scene":r=new Sn,void 0!==e.background&&Number.isInteger(e.background)&&(r.background=new fe(e.background)),void 0!==e.fog&&("Fog"===e.fog.type?r.fog=new _n(e.fog.color,e.fog.near,e.fog.far):"FogExp2"===e.fog.type&&(r.fog=new xn(e.fog.color,e.fog.density)));break;case"PerspectiveCamera":r=new nn(e.fov,e.aspect,e.near,e.far),void 0!==e.focus&&(r.focus=e.focus),void 0!==e.zoom&&(r.zoom=e.zoom),void 0!==e.filmGauge&&(r.filmGauge=e.filmGauge),void 0!==e.filmOffset&&(r.filmOffset=e.filmOffset),void 0!==e.view&&(r.view=Object.assign({},e.view));break;case"OrthographicCamera":r=new Je(e.left,e.right,e.top,e.bottom,e.near,e.far);break;case"AmbientLight":r=new Xi(e.color,e.intensity);break;case"DirectionalLight":r=new Zi(e.color,e.intensity);break;case"PointLight":r=new Wi(e.color,e.intensity,e.distance,e.decay);break;case"RectAreaLight":r=new Yi(e.color,e.intensity,e.width,e.height);break;case"SpotLight":r=new qi(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);break;case"HemisphereLight":r=new zi(e.color,e.groundColor,e.intensity);break;case"SkinnedMesh":console.warn("THREE.ObjectLoader.parseObject() does not support SkinnedMesh yet.");case"Mesh":var o=i(e.geometry),s=a(e.material);r=o.bones&&o.bones.length>0?new On(o,s):new Rt(o,s);break;case"LOD":r=new Rn;break;case"Line":r=new In(i(e.geometry),a(e.material),e.mode);break;case"LineLoop":r=new Ln(i(e.geometry),a(e.material));break;case"LineSegments":r=new Nn(i(e.geometry),a(e.material));break;case"PointCloud":case"Points":r=new Fn(i(e.geometry),a(e.material));break;case"Sprite":r=new Tn(a(e.material));break;case"Group":r=new jn;break;default:r=new qe}if(r.uuid=e.uuid,void 0!==e.name&&(r.name=e.name),void 0!==e.matrix?(r.matrix.fromArray(e.matrix),r.matrix.decompose(r.position,r.quaternion,r.scale)):(void 0!==e.position&&r.position.fromArray(e.position),void 0!==e.rotation&&r.rotation.fromArray(e.rotation),void 0!==e.quaternion&&r.quaternion.fromArray(e.quaternion),void 0!==e.scale&&r.scale.fromArray(e.scale)),void 0!==e.castShadow&&(r.castShadow=e.castShadow),void 0!==e.receiveShadow&&(r.receiveShadow=e.receiveShadow),e.shadow&&(void 0!==e.shadow.bias&&(r.shadow.bias=e.shadow.bias),void 0!==e.shadow.radius&&(r.shadow.radius=e.shadow.radius),void 0!==e.shadow.mapSize&&r.shadow.mapSize.fromArray(e.shadow.mapSize),void 0!==e.shadow.camera&&(r.shadow.camera=this.parseObject(e.shadow.camera))),void 0!==e.visible&&(r.visible=e.visible),void 0!==e.userData&&(r.userData=e.userData),void 0!==e.children)for(var c=e.children,l=0;l<c.length;l++)r.add(this.parseObject(c[l],t,n));if("LOD"===e.type)for(var u=e.levels,h=0;h<u.length;h++){var d=u[h],p=r.getObjectByProperty("uuid",d.object);void 0!==p&&r.addLevel(p,d.distance)}return r}});var Aa,Ea={UVMapping:300,CubeReflectionMapping:301,CubeRefractionMapping:302,EquirectangularReflectionMapping:303,EquirectangularRefractionMapping:304,SphericalReflectionMapping:305,CubeUVReflectionMapping:306,CubeUVRefractionMapping:307},xa={RepeatWrapping:1e3,ClampToEdgeWrapping:1001,MirroredRepeatWrapping:1002},_a={NearestFilter:1003,NearestMipMapNearestFilter:1004,NearestMipMapLinearFilter:1005,LinearFilter:1006,LinearMipMapNearestFilter:1007,LinearMipMapLinearFilter:1008};function Sa(e){"undefined"==typeof createImageBitmap&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),"undefined"==typeof fetch&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.manager=void 0!==e?e:hi,this.options=void 0}function Ma(){this.type="ShapePath",this.subPaths=[],this.currentPath=null}function Ta(e){this.type="Font",this.data=e}function Ra(e,t,n,r,i,a){var o=a.glyphs[e]||a.glyphs["?"];if(o){var s,c,l,u,h,d,p,f,m=new Ma;if(o.o)for(var g=o._cachedOutline||(o._cachedOutline=o.o.split(" ")),y=0,v=g.length;y<v;){switch(g[y++]){case"m":s=g[y++]*n+r,c=g[y++]*n+i,m.moveTo(s,c);break;case"l":s=g[y++]*n+r,c=g[y++]*n+i,m.lineTo(s,c);break;case"q":l=g[y++]*n+r,u=g[y++]*n+i,h=g[y++]*n+r,d=g[y++]*n+i,m.quadraticCurveTo(h,d,l,u);break;case"b":l=g[y++]*n+r,u=g[y++]*n+i,h=g[y++]*n+r,d=g[y++]*n+i,p=g[y++]*n+r,f=g[y++]*n+i,m.bezierCurveTo(h,d,p,f,l,u)}}return{offsetX:o.ha*n,path:m}}}Sa.prototype={constructor:Sa,setOptions:function(e){return this.options=e,this},load:function(e,t,n,r){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e);var i=this,a=li.get(e);if(void 0!==a)return i.manager.itemStart(e),setTimeout((function(){t&&t(a),i.manager.itemEnd(e)}),0),a;fetch(e).then((function(e){return e.blob()})).then((function(e){return createImageBitmap(e,i.options)})).then((function(n){li.add(e,n),t&&t(n),i.manager.itemEnd(e)})).catch((function(t){r&&r(t),i.manager.itemEnd(e),i.manager.itemError(e)}))},setCrossOrigin:function(){return this},setPath:function(e){return this.path=e,this}},Object.assign(Ma.prototype,{moveTo:function(e,t){this.currentPath=new Ui,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t)},lineTo:function(e,t){this.currentPath.lineTo(e,t)},quadraticCurveTo:function(e,t,n,r){this.currentPath.quadraticCurveTo(e,t,n,r)},bezierCurveTo:function(e,t,n,r,i,a){this.currentPath.bezierCurveTo(e,t,n,r,i,a)},splineThru:function(e){this.currentPath.splineThru(e)},toShapes:function(e,t){function n(e){for(var t=[],n=0,r=e.length;n<r;n++){var i=e[n],a=new Bi;a.curves=i.curves,t.push(a)}return t}function r(e,t){for(var n=t.length,r=!1,i=n-1,a=0;a<n;i=a++){var o=t[i],s=t[a],c=s.x-o.x,l=s.y-o.y;if(Math.abs(l)>Number.EPSILON){if(l<0&&(o=t[a],c=-c,s=t[i],l=-l),e.y<o.y||e.y>s.y)continue;if(e.y===o.y){if(e.x===o.x)return!0}else{var u=l*(e.x-o.x)-c*(e.y-o.y);if(0===u)return!0;if(u<0)continue;r=!r}}else{if(e.y!==o.y)continue;if(s.x<=e.x&&e.x<=o.x||o.x<=e.x&&e.x<=s.x)return!0}}return r}var i=kr.isClockWise,a=this.subPaths;if(0===a.length)return[];if(!0===t)return n(a);var o,s,c,l=[];if(1===a.length)return s=a[0],(c=new Bi).curves=s.curves,l.push(c),l;var u=!i(a[0].getPoints());u=e?!u:u;var h,d,p=[],f=[],m=[],g=0;f[g]=void 0,m[g]=[];for(var y=0,v=a.length;y<v;y++)o=i(h=(s=a[y]).getPoints()),(o=e?!o:o)?(!u&&f[g]&&g++,f[g]={s:new Bi,p:h},f[g].s.curves=s.curves,u&&g++,m[g]=[]):m[g].push({h:s,p:h[0]});if(!f[0])return n(a);if(f.length>1){for(var b=!1,w=[],A=0,E=f.length;A<E;A++)p[A]=[];for(A=0,E=f.length;A<E;A++)for(var x=m[A],_=0;_<x.length;_++){for(var S=x[_],M=!0,T=0;T<f.length;T++)r(S.p,f[T].p)&&(A!==T&&w.push({froms:A,tos:T,hole:_}),M?(M=!1,p[T].push(S)):b=!0);M&&p[A].push(S)}w.length>0&&(b||(m=p))}y=0;for(var R=f.length;y<R;y++){c=f[y].s,l.push(c);for(var k=0,C=(d=m[y]).length;k<C;k++)c.holes.push(d[k].h)}return l}}),Object.assign(Ta.prototype,{isFont:!0,generateShapes:function(e,t,n){void 0===t&&(t=100),void 0===n&&(n=4);for(var r=[],i=function(e,t,n,r){for(var i=String(e).split(""),a=t/r.resolution,o=(r.boundingBox.yMax-r.boundingBox.yMin+r.underlineThickness)*a,s=[],c=0,l=0,u=0;u<i.length;u++){var h=i[u];if("\n"===h)c=0,l-=o;else{var d=Ra(h,n,a,c,l,r);c+=d.offsetX,s.push(d.path)}}return s}(e,t,n,this.data),a=0,o=i.length;a<o;a++)Array.prototype.push.apply(r,i[a].toShapes());return r}}),Object.assign(function(e){this.manager=void 0!==e?e:hi}.prototype,{load:function(e,t,n,r){var i=this,a=new pi(this.manager);a.setPath(this.path),a.load(e,(function(e){var n;try{n=JSON.parse(e)}catch(t){console.warn("THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead."),n=JSON.parse(e.substring(65,e.length-2))}var r=i.parse(n);t&&t(r)}),n,r)},parse:function(e){return new Ta(e)},setPath:function(e){return this.path=e,this}});var ka,Ca,Oa,Pa,Ia,Na,La,Da,Fa,ja,Ua=function(){return void 0===Aa&&(Aa=new(window.AudioContext||window.webkitAudioContext)),Aa};function Ba(e){this.manager=void 0!==e?e:hi}function Va(e,t,n){qe.call(this),this.type="CubeCamera";var r=new nn(90,1,e,t);r.up.set(0,-1,0),r.lookAt(new b(1,0,0)),this.add(r);var i=new nn(90,1,e,t);i.up.set(0,-1,0),i.lookAt(new b(-1,0,0)),this.add(i);var a=new nn(90,1,e,t);a.up.set(0,0,1),a.lookAt(new b(0,1,0)),this.add(a);var o=new nn(90,1,e,t);o.up.set(0,0,-1),o.lookAt(new b(0,-1,0)),this.add(o);var s=new nn(90,1,e,t);s.up.set(0,-1,0),s.lookAt(new b(0,0,1)),this.add(s);var c=new nn(90,1,e,t);c.up.set(0,-1,0),c.lookAt(new b(0,0,-1)),this.add(c);var l={format:1022,magFilter:1006,minFilter:1006};this.renderTarget=new S(n,n,l),this.renderTarget.texture.name="CubeCamera",this.update=function(e,t){null===this.parent&&this.updateMatrixWorld();var n=this.renderTarget,l=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,n.activeCubeFace=0,e.render(t,r,n),n.activeCubeFace=1,e.render(t,i,n),n.activeCubeFace=2,e.render(t,a,n),n.activeCubeFace=3,e.render(t,o,n),n.activeCubeFace=4,e.render(t,s,n),n.texture.generateMipmaps=l,n.activeCubeFace=5,e.render(t,c,n),e.setRenderTarget(null)},this.clear=function(e,t,n,r){for(var i=this.renderTarget,a=0;a<6;a++)i.activeCubeFace=a,e.setRenderTarget(i),e.clear(t,n,r);e.setRenderTarget(null)}}function za(){qe.call(this),this.type="AudioListener",this.context=Ua(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null}function Ha(e){qe.call(this),this.type="Audio",this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.loop=!1,this.startTime=0,this.offset=0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.sourceType="empty",this.filters=[]}function Ga(e){Ha.call(this,e),this.panner=this.context.createPanner(),this.panner.connect(this.gain)}function qa(e,t){this.analyser=e.context.createAnalyser(),this.analyser.fftSize=void 0!==t?t:2048,this.data=new Uint8Array(this.analyser.frequencyBinCount),e.getOutput().connect(this.analyser)}function Wa(e,t,n){this.binding=e,this.valueSize=n;var r,i=Float64Array;switch(t){case"quaternion":r=this._slerp;break;case"string":case"bool":i=Array,r=this._select;break;default:r=this._lerp}this.buffer=new i(4*n),this._mixBufferRegion=r,this.cumulativeWeight=0,this.useCount=0,this.referenceCount=0}Object.assign(Ba.prototype,{load:function(e,t,n,r){var i=new pi(this.manager);i.setResponseType("arraybuffer"),i.load(e,(function(e){Ua().decodeAudioData(e,(function(e){t(e)}))}),n,r)}}),Object.assign(function(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new nn,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new nn,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1}.prototype,{update:(Fa=new y,ja=new y,function(e){if(ka!==this||Ca!==e.focus||Oa!==e.fov||Pa!==e.aspect*this.aspect||Ia!==e.near||Na!==e.far||La!==e.zoom||Da!==this.eyeSep){ka=this,Ca=e.focus,Oa=e.fov,Pa=e.aspect*this.aspect,Ia=e.near,Na=e.far,La=e.zoom;var t,n,r=e.projectionMatrix.clone(),i=(Da=this.eyeSep/2)*Ia/Ca,a=Ia*Math.tan(m.DEG2RAD*Oa*.5)/La;ja.elements[12]=-Da,Fa.elements[12]=Da,t=-a*Pa+i,n=a*Pa+i,r.elements[0]=2*Ia/(n-t),r.elements[8]=(n+t)/(n-t),this.cameraL.projectionMatrix.copy(r),t=-a*Pa-i,n=a*Pa-i,r.elements[0]=2*Ia/(n-t),r.elements[8]=(n+t)/(n-t),this.cameraR.projectionMatrix.copy(r)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(ja),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(Fa)})}),Va.prototype=Object.create(qe.prototype),Va.prototype.constructor=Va,za.prototype=Object.assign(Object.create(qe.prototype),{constructor:za,getInput:function(){return this.gain},removeFilter:function(){null!==this.filter&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null)},getFilter:function(){return this.filter},setFilter:function(e){null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination)},getMasterVolume:function(){return this.gain.gain.value},setMasterVolume:function(e){this.gain.gain.value=e},updateMatrixWorld:function(){var e=new b,t=new v,n=new b,r=new b;return function(i){qe.prototype.updateMatrixWorld.call(this,i);var a=this.context.listener,o=this.up;this.matrixWorld.decompose(e,t,n),r.set(0,0,-1).applyQuaternion(t),a.positionX?(a.positionX.setValueAtTime(e.x,this.context.currentTime),a.positionY.setValueAtTime(e.y,this.context.currentTime),a.positionZ.setValueAtTime(e.z,this.context.currentTime),a.forwardX.setValueAtTime(r.x,this.context.currentTime),a.forwardY.setValueAtTime(r.y,this.context.currentTime),a.forwardZ.setValueAtTime(r.z,this.context.currentTime),a.upX.setValueAtTime(o.x,this.context.currentTime),a.upY.setValueAtTime(o.y,this.context.currentTime),a.upZ.setValueAtTime(o.z,this.context.currentTime)):(a.setPosition(e.x,e.y,e.z),a.setOrientation(r.x,r.y,r.z,o.x,o.y,o.z))}}()}),Ha.prototype=Object.assign(Object.create(qe.prototype),{constructor:Ha,getOutput:function(){return this.gain},setNodeSource:function(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this},setBuffer:function(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this},play:function(){if(!0!==this.isPlaying){if(!1!==this.hasPlaybackControl){var e=this.context.createBufferSource();return e.buffer=this.buffer,e.loop=this.loop,e.onended=this.onEnded.bind(this),e.playbackRate.setValueAtTime(this.playbackRate,this.startTime),this.startTime=this.context.currentTime,e.start(this.startTime,this.offset),this.isPlaying=!0,this.source=e,this.connect()}console.warn("THREE.Audio: this Audio has no playback control.")}else console.warn("THREE.Audio: Audio is already playing.")},pause:function(){if(!1!==this.hasPlaybackControl)return!0===this.isPlaying&&(this.source.stop(),this.offset+=(this.context.currentTime-this.startTime)*this.playbackRate,this.isPlaying=!1),this;console.warn("THREE.Audio: this Audio has no playback control.")},stop:function(){if(!1!==this.hasPlaybackControl)return this.source.stop(),this.offset=0,this.isPlaying=!1,this;console.warn("THREE.Audio: this Audio has no playback control.")},connect:function(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(var e=1,t=this.filters.length;e<t;e++)this.filters[e-1].connect(this.filters[e]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this},disconnect:function(){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(var e=1,t=this.filters.length;e<t;e++)this.filters[e-1].disconnect(this.filters[e]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this},getFilters:function(){return this.filters},setFilters:function(e){return e||(e=[]),!0===this.isPlaying?(this.disconnect(),this.filters=e,this.connect()):this.filters=e,this},getFilter:function(){return this.getFilters()[0]},setFilter:function(e){return this.setFilters(e?[e]:[])},setPlaybackRate:function(e){if(!1!==this.hasPlaybackControl)return this.playbackRate=e,!0===this.isPlaying&&this.source.playbackRate.setValueAtTime(this.playbackRate,this.context.currentTime),this;console.warn("THREE.Audio: this Audio has no playback control.")},getPlaybackRate:function(){return this.playbackRate},onEnded:function(){this.isPlaying=!1},getLoop:function(){return!1===this.hasPlaybackControl?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop},setLoop:function(e){if(!1!==this.hasPlaybackControl)return this.loop=e,!0===this.isPlaying&&(this.source.loop=this.loop),this;console.warn("THREE.Audio: this Audio has no playback control.")},getVolume:function(){return this.gain.gain.value},setVolume:function(e){return this.gain.gain.value=e,this}}),Ga.prototype=Object.assign(Object.create(Ha.prototype),{constructor:Ga,getOutput:function(){return this.panner},getRefDistance:function(){return this.panner.refDistance},setRefDistance:function(e){this.panner.refDistance=e},getRolloffFactor:function(){return this.panner.rolloffFactor},setRolloffFactor:function(e){this.panner.rolloffFactor=e},getDistanceModel:function(){return this.panner.distanceModel},setDistanceModel:function(e){this.panner.distanceModel=e},getMaxDistance:function(){return this.panner.maxDistance},setMaxDistance:function(e){this.panner.maxDistance=e},updateMatrixWorld:function(){var e=new b;return function(t){qe.prototype.updateMatrixWorld.call(this,t),e.setFromMatrixPosition(this.matrixWorld),this.panner.setPosition(e.x,e.y,e.z)}}()}),Object.assign(qa.prototype,{getFrequencyData:function(){return this.analyser.getByteFrequencyData(this.data),this.data},getAverageFrequency:function(){for(var e=0,t=this.getFrequencyData(),n=0;n<t.length;n++)e+=t[n];return e/t.length}}),Object.assign(Wa.prototype,{accumulate:function(e,t){var n=this.buffer,r=this.valueSize,i=e*r+r,a=this.cumulativeWeight;if(0===a){for(var o=0;o!==r;++o)n[i+o]=n[o];a=t}else{var s=t/(a+=t);this._mixBufferRegion(n,i,0,s,r)}this.cumulativeWeight=a},apply:function(e){var t=this.valueSize,n=this.buffer,r=e*t+t,i=this.cumulativeWeight,a=this.binding;if(this.cumulativeWeight=0,i<1){var o=3*t;this._mixBufferRegion(n,r,o,1-i,t)}for(var s=t,c=t+t;s!==c;++s)if(n[s]!==n[s+t]){a.setValue(n,r);break}},saveOriginalState:function(){var e=this.binding,t=this.buffer,n=this.valueSize,r=3*n;e.getValue(t,r);for(var i=n,a=r;i!==a;++i)t[i]=t[r+i%n];this.cumulativeWeight=0},restoreOriginalState:function(){var e=3*this.valueSize;this.binding.setValue(this.buffer,e)},_select:function(e,t,n,r,i){if(r>=.5)for(var a=0;a!==i;++a)e[t+a]=e[n+a]},_slerp:function(e,t,n,r){v.slerpFlat(e,t,e,t,e,n,r)},_lerp:function(e,t,n,r,i){for(var a=1-r,o=0;o!==i;++o){var s=t+o;e[s]=e[s]*a+e[n+o]*r}}});var Ja,Za,Xa,Ya,Ka,Qa,$a,eo,to,no,ro,io;function ao(e,t,n){var r=n||oo.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)}function oo(e,t,n){this.path=t,this.parsedPath=n||oo.parseTrackName(t),this.node=oo.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e}function so(e,t,n){this._mixer=e,this._clip=t,this._localRoot=n||null;for(var r=t.tracks,i=r.length,a=new Array(i),o={endingStart:2400,endingEnd:2400},s=0;s!==i;++s){var c=r[s].createInterpolant(null);a[s]=c,c.settings=o}this._interpolantSettings=o,this._interpolants=a,this._propertyBindings=new Array(i),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=2201,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}function co(e){this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}function lo(e){"string"==typeof e&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),e=arguments[1]),this.value=e}function uo(){vt.call(this),this.type="InstancedBufferGeometry",this.maxInstancedCount=void 0}function ho(e,t,n,r){this.uuid=m.generateUUID(),this.data=e,this.itemSize=t,this.offset=n,this.normalized=!0===r}function po(e,t){this.uuid=m.generateUUID(),this.array=e,this.stride=t,this.count=void 0!==e?e.length/t:0,this.dynamic=!1,this.updateRange={offset:0,count:-1},this.onUploadCallback=function(){},this.version=0}function fo(e,t,n){po.call(this,e,t),this.meshPerAttribute=n||1}function mo(e,t,n){Qe.call(this,e,t),this.meshPerAttribute=n||1}function go(e,t){return e.distance-t.distance}function yo(e,t,n,r){if(!1!==e.visible&&(e.raycast(t,n),!0===r))for(var i=e.children,a=0,o=i.length;a<o;a++)yo(i[a],t,n,!0)}function vo(e,t){this.min=void 0!==e?e:new g(1/0,1/0),this.max=void 0!==t?t:new g(-1/0,-1/0)}function bo(e){qe.call(this),this.material=e,this.render=function(){}}function wo(e,t,n,r){this.object=e,this.size=void 0!==t?t:1;var i=void 0!==n?n:16711680,a=void 0!==r?r:1,o=0,s=this.object.geometry;s&&s.isGeometry?o=3*s.faces.length:s&&s.isBufferGeometry&&(o=s.attributes.normal.count);var c=new vt,l=new ot(2*o*3,3);c.addAttribute("position",l),Nn.call(this,c,new Pn({color:i,linewidth:a})),this.matrixAutoUpdate=!1,this.update()}function Ao(e,t){qe.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t;for(var n=new vt,r=[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],i=0,a=1;i<32;i++,a++){var o=i/32*Math.PI*2,s=a/32*Math.PI*2;r.push(Math.cos(o),Math.sin(o),1,Math.cos(s),Math.sin(s),1)}n.addAttribute("position",new ot(r,3));var c=new Pn({fog:!1});this.cone=new Nn(n,c),this.add(this.cone),this.update()}function Eo(e){for(var t=function e(t){var n=[];t&&t.isBone&&n.push(t);for(var r=0;r<t.children.length;r++)n.push.apply(n,e(t.children[r]));return n}(e),n=new vt,r=[],i=[],a=new fe(0,0,1),o=new fe(0,1,0),s=0;s<t.length;s++){var c=t[s];c.parent&&c.parent.isBone&&(r.push(0,0,0),r.push(0,0,0),i.push(a.r,a.g,a.b),i.push(o.r,o.g,o.b))}n.addAttribute("position",new ot(r,3)),n.addAttribute("color",new ot(i,3));var l=new Pn({vertexColors:2,depthTest:!1,depthWrite:!1,transparent:!0});Nn.call(this,n,l),this.root=e,this.bones=t,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1}function xo(e,t,n){this.light=e,this.light.updateMatrixWorld(),this.color=n;var r=new Fr(t,4,2),i=new xt({wireframe:!0,fog:!1});Rt.call(this,r,i),this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}function _o(e,t){qe.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t;var n=new Pn({fog:!1}),r=new vt;r.addAttribute("position",new Qe(new Float32Array(15),3)),this.line=new In(r,n),this.add(this.line),this.update()}function So(e,t,n){qe.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n;var r=new Yn(t);r.rotateY(.5*Math.PI),this.material=new xt({wireframe:!0,fog:!1}),void 0===this.color&&(this.material.vertexColors=2);var i=r.getAttribute("position"),a=new Float32Array(3*i.count);r.addAttribute("color",new Qe(a,3)),this.add(new Rt(r,this.material)),this.update()}function Mo(e,t,n,r){e=e||10,t=t||10,n=new fe(void 0!==n?n:4473924),r=new fe(void 0!==r?r:8947848);for(var i=t/2,a=e/t,o=e/2,s=[],c=[],l=0,u=0,h=-o;l<=t;l++,h+=a){s.push(-o,0,h,o,0,h),s.push(h,0,-o,h,0,o);var d=l===i?n:r;d.toArray(c,u),u+=3,d.toArray(c,u),u+=3,d.toArray(c,u),u+=3,d.toArray(c,u),u+=3}var p=new vt;p.addAttribute("position",new ot(s,3)),p.addAttribute("color",new ot(c,3));var f=new Pn({vertexColors:2});Nn.call(this,p,f)}function To(e,t,n,r,i,a){e=e||10,t=t||16,n=n||8,r=r||64,i=new fe(void 0!==i?i:4473924),a=new fe(void 0!==a?a:8947848);var o,s,c,l,u,h,d,p=[],f=[];for(l=0;l<=t;l++)c=l/t*(2*Math.PI),o=Math.sin(c)*e,s=Math.cos(c)*e,p.push(0,0,0),p.push(o,0,s),d=1&l?i:a,f.push(d.r,d.g,d.b),f.push(d.r,d.g,d.b);for(l=0;l<=n;l++)for(d=1&l?i:a,h=e-e/n*l,u=0;u<r;u++)c=u/r*(2*Math.PI),o=Math.sin(c)*h,s=Math.cos(c)*h,p.push(o,0,s),f.push(d.r,d.g,d.b),c=(u+1)/r*(2*Math.PI),o=Math.sin(c)*h,s=Math.cos(c)*h,p.push(o,0,s),f.push(d.r,d.g,d.b);var m=new vt;m.addAttribute("position",new ot(p,3)),m.addAttribute("color",new ot(f,3));var g=new Pn({vertexColors:2});Nn.call(this,m,g)}function Ro(e,t,n,r){this.object=e,this.size=void 0!==t?t:1;var i=void 0!==n?n:16776960,a=void 0!==r?r:1,o=0,s=this.object.geometry;s&&s.isGeometry?o=s.faces.length:console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.");var c=new vt,l=new ot(2*o*3,3);c.addAttribute("position",l),Nn.call(this,c,new Pn({color:i,linewidth:a})),this.matrixAutoUpdate=!1,this.update()}function ko(e,t,n){qe.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,void 0===t&&(t=1);var r=new vt;r.addAttribute("position",new ot([-t,t,0,t,t,0,t,-t,0,-t,-t,0,-t,t,0],3));var i=new Pn({fog:!1});this.lightPlane=new In(r,i),this.add(this.lightPlane),(r=new vt).addAttribute("position",new ot([0,0,0,0,0,1],3)),this.targetLine=new In(r,i),this.add(this.targetLine),this.update()}function Co(e){var t=new vt,n=new Pn({color:16777215,vertexColors:1}),r=[],i=[],a={},o=new fe(16755200),s=new fe(16711680),c=new fe(43775),l=new fe(16777215),u=new fe(3355443);function h(e,t,n){d(e,n),d(t,n)}function d(e,t){r.push(0,0,0),i.push(t.r,t.g,t.b),void 0===a[e]&&(a[e]=[]),a[e].push(r.length/3-1)}h("n1","n2",o),h("n2","n4",o),h("n4","n3",o),h("n3","n1",o),h("f1","f2",o),h("f2","f4",o),h("f4","f3",o),h("f3","f1",o),h("n1","f1",o),h("n2","f2",o),h("n3","f3",o),h("n4","f4",o),h("p","n1",s),h("p","n2",s),h("p","n3",s),h("p","n4",s),h("u1","u2",c),h("u2","u3",c),h("u3","u1",c),h("c","t",l),h("p","c",u),h("cn1","cn2",u),h("cn3","cn4",u),h("cf1","cf2",u),h("cf3","cf4",u),t.addAttribute("position",new ot(r,3)),t.addAttribute("color",new ot(i,3)),Nn.call(this,t,n),this.camera=e,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=a,this.update()}function Oo(e,t){this.object=e,void 0===t&&(t=16776960);var n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=new Float32Array(24),i=new vt;i.setIndex(new Qe(n,1)),i.addAttribute("position",new Qe(r,3)),Nn.call(this,i,new Pn({color:t})),this.matrixAutoUpdate=!1,this.update()}function Po(e,t){this.type="Box3Helper",this.box=e;var n=void 0!==t?t:16776960,r=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),i=new vt;i.setIndex(new Qe(r,1)),i.addAttribute("position",new ot([1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],3)),Nn.call(this,i,new Pn({color:n})),this.geometry.computeBoundingSphere()}function Io(e,t,n){this.type="PlaneHelper",this.plane=e,this.size=void 0===t?1:t;var r=void 0!==n?n:16776960,i=new vt;i.addAttribute("position",new ot([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,0,1,0,0,0],3)),i.computeBoundingSphere(),In.call(this,i,new Pn({color:r}));var a=new vt;a.addAttribute("position",new ot([1,1,1,-1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,-1,1],3)),a.computeBoundingSphere(),this.add(new Rt(a,new xt({color:r,opacity:.2,transparent:!0,depthWrite:!1})))}function No(e,t,n,r,i,a){qe.call(this),void 0===r&&(r=16776960),void 0===n&&(n=1),void 0===i&&(i=.2*n),void 0===a&&(a=.2*i),void 0===to&&((to=new vt).addAttribute("position",new ot([0,0,0,0,1,0],3)),(no=new Jr(0,.5,1,5,1)).translate(0,-.5,0)),this.position.copy(t),this.line=new In(to,new Pn({color:r})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new Rt(no,new xt({color:r})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(e),this.setLength(n,i,a)}function Lo(e){var t=[0,0,0,e=e||1,0,0,0,0,0,0,e,0,0,0,0,0,0,e],n=new vt;n.addAttribute("position",new ot(t,3)),n.addAttribute("color",new ot([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3));var r=new Pn({vertexColors:2});Nn.call(this,n,r)}Object.assign(ao.prototype,{getValue:function(e,t){this.bind();var n=this._targetGroup.nCachedObjects_,r=this._bindings[n];void 0!==r&&r.getValue(e,t)},setValue:function(e,t){for(var n=this._bindings,r=this._targetGroup.nCachedObjects_,i=n.length;r!==i;++r)n[r].setValue(e,t)},bind:function(){for(var e=this._bindings,t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()},unbind:function(){for(var e=this._bindings,t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}}),Object.assign(oo,{Composite:ao,create:function(e,t,n){return e&&e.isAnimationObjectGroup?new oo.Composite(e,t,n):new oo(e,t,n)},sanitizeNodeName:(eo=new RegExp("[\\[\\]\\.:\\/]","g"),function(e){return e.replace(/\s/g,"_").replace(eo,"")}),parseTrackName:(Ja="[^"+"\\[\\]\\.:\\/".replace("\\.","")+"]",Za=/((?:WC+[\/:])*)/.source.replace("WC","[^\\[\\]\\.:\\/]"),Xa=/(WCOD+)?/.source.replace("WCOD",Ja),Ya=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC","[^\\[\\]\\.:\\/]"),Ka=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC","[^\\[\\]\\.:\\/]"),Qa=new RegExp("^"+Za+Xa+Ya+Ka+"$"),$a=["material","materials","bones"],function(e){var t=Qa.exec(e);if(!t)throw new Error("PropertyBinding: Cannot parse trackName: "+e);var n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},r=n.nodeName&&n.nodeName.lastIndexOf(".");if(void 0!==r&&-1!==r){var i=n.nodeName.substring(r+1);-1!==$a.indexOf(i)&&(n.nodeName=n.nodeName.substring(0,r),n.objectName=i)}if(null===n.propertyName||0===n.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n}),findNode:function(e,t){if(!t||""===t||"root"===t||"."===t||-1===t||t===e.name||t===e.uuid)return e;if(e.skeleton){var n=e.skeleton.getBoneByName(t);if(void 0!==n)return n}if(e.children){var r=function(e){for(var n=0;n<e.length;n++){var i=e[n];if(i.name===t||i.uuid===t)return i;var a=r(i.children);if(a)return a}return null},i=r(e.children);if(i)return i}return null}}),Object.assign(oo.prototype,{_getValue_unavailable:function(){},_setValue_unavailable:function(){},BindingType:{Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Versioning:{None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},GetterByBindingType:[function(e,t){e[t]=this.node[this.propertyName]},function(e,t){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)e[t++]=n[r]},function(e,t){e[t]=this.resolvedProperty[this.propertyIndex]},function(e,t){this.resolvedProperty.toArray(e,t)}],SetterByBindingTypeAndVersioning:[[function(e,t){this.targetObject[this.propertyName]=e[t]},function(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0},function(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(e,t){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)n[r]=e[t++]},function(e,t){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)n[r]=e[t++];this.targetObject.needsUpdate=!0},function(e,t){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)n[r]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}],[function(e,t){this.resolvedProperty[this.propertyIndex]=e[t]},function(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0},function(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(e,t){this.resolvedProperty.fromArray(e,t)},function(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0},function(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}]],getValue:function(e,t){this.bind(),this.getValue(e,t)},setValue:function(e,t){this.bind(),this.setValue(e,t)},bind:function(){var e=this.node,t=this.parsedPath,n=t.objectName,r=t.propertyName,i=t.propertyIndex;if(e||(e=oo.findNode(this.rootNode,t.nodeName)||this.rootNode,this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,e){if(n){var a=t.objectIndex;switch(n){case"materials":if(!e.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!e.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);e=e.material.materials;break;case"bones":if(!e.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);e=e.skeleton.bones;for(var o=0;o<e.length;o++)if(e[o].name===a){a=o;break}break;default:if(void 0===e[n])return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);e=e[n]}if(void 0!==a){if(void 0===e[a])return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);e=e[a]}}var s=e[r];if(void 0!==s){var c=this.Versioning.None;void 0!==e.needsUpdate?(c=this.Versioning.NeedsUpdate,this.targetObject=e):void 0!==e.matrixWorldNeedsUpdate&&(c=this.Versioning.MatrixWorldNeedsUpdate,this.targetObject=e);var l=this.BindingType.Direct;if(void 0!==i){if("morphTargetInfluences"===r){if(!e.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(e.geometry.isBufferGeometry){if(!e.geometry.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);for(o=0;o<this.node.geometry.morphAttributes.position.length;o++)if(e.geometry.morphAttributes.position[o].name===i){i=o;break}}else{if(!e.geometry.morphTargets)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphTargets.",this);for(o=0;o<this.node.geometry.morphTargets.length;o++)if(e.geometry.morphTargets[o].name===i){i=o;break}}}l=this.BindingType.ArrayElement,this.resolvedProperty=s,this.propertyIndex=i}else void 0!==s.fromArray&&void 0!==s.toArray?(l=this.BindingType.HasFromToArray,this.resolvedProperty=s):Array.isArray(s)?(l=this.BindingType.EntireArray,this.resolvedProperty=s):this.propertyName=r;this.getValue=this.GetterByBindingType[l],this.setValue=this.SetterByBindingTypeAndVersioning[l][c]}else{var u=t.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+u+"."+r+" but it wasn't found.",e)}}else console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.")},unbind:function(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}),
//!\ DECLARE ALIAS AFTER assign prototype !
diff --git a/rider/build/zip.js b/rider/build/zip.js
index 7a8441721..fce9786c6 100644
--- a/rider/build/zip.js
+++ b/rider/build/zip.js
@@ -1,4 +1,4 @@
-!function(e){var t=this.webpackHotUpdate;this.webpackHotUpdate=function(e,n){!function(e,t){if(!w[e]||!v[e])return;for(var n in v[e]=!1,t)Object.prototype.hasOwnProperty.call(t,n)&&(p[n]=t[n]);0==--b&&0===y&&x()}(e,n),t&&t(e,n)};var n,r=!0,i="0eb3afe3ce20db27d2ce",o={},a=[],s=[];function l(e){var t=R[e];if(!t)return O;var r=function(r){return t.hot.active?(R[r]?-1===R[r].parents.indexOf(e)&&R[r].parents.push(e):(a=[e],n=r),-1===t.children.indexOf(r)&&t.children.push(r)):(console.warn("[HMR] unexpected require("+r+") from disposed module "+e),a=[]),O(r)},i=function(e){return{configurable:!0,enumerable:!0,get:function(){return O[e]},set:function(t){O[e]=t}}};for(var o in O)Object.prototype.hasOwnProperty.call(O,o)&&"e"!==o&&"t"!==o&&Object.defineProperty(r,o,i(o));return r.e=function(e){return"ready"===h&&c("prepare"),y++,O.e(e).then(t,(function(e){throw t(),e}));function t(){y--,"prepare"===h&&(m[e]||S(e),0===y&&0===b&&x())}},r.t=function(e,t){return 1&t&&(e=r(e)),O.t(e,-2&t)},r}function u(t){var r={_acceptedDependencies:{},_declinedDependencies:{},_selfAccepted:!1,_selfDeclined:!1,_selfInvalidated:!1,_disposeHandlers:[],_main:n!==t,active:!0,accept:function(e,t){if(void 0===e)r._selfAccepted=!0;else if("function"==typeof e)r._selfAccepted=e;else if("object"==typeof e)for(var n=0;n<e.length;n++)r._acceptedDependencies[e[n]]=t||function(){};else r._acceptedDependencies[e]=t||function(){}},decline:function(e){if(void 0===e)r._selfDeclined=!0;else if("object"==typeof e)for(var t=0;t<e.length;t++)r._declinedDependencies[e[t]]=!0;else r._declinedDependencies[e]=!0},dispose:function(e){r._disposeHandlers.push(e)},addDisposeHandler:function(e){r._disposeHandlers.push(e)},removeDisposeHandler:function(e){var t=r._disposeHandlers.indexOf(e);t>=0&&r._disposeHandlers.splice(t,1)},invalidate:function(){switch(this._selfInvalidated=!0,h){case"idle":(p={})[t]=e[t],c("ready");break;case"ready":A(t);break;case"prepare":case"check":case"dispose":case"apply":(g=g||[]).push(t)}},check:k,apply:T,status:function(e){if(!e)return h;f.push(e)},addStatusHandler:function(e){f.push(e)},removeStatusHandler:function(e){var t=f.indexOf(e);t>=0&&f.splice(t,1)},data:o[t]};return n=void 0,r}var f=[],h="idle";function c(e){h=e;for(var t=0;t<f.length;t++)f[t].call(null,e)}var d,p,_,g,b=0,y=0,m={},v={},w={};function E(e){return+e+""===e?+e:e}function k(e){if("idle"!==h)throw new Error("check() is only allowed in idle status");return r=e,c("check"),(t=1e4,t=t||1e4,new Promise((function(e,n){if("undefined"==typeof XMLHttpRequest)return n(new Error("No browser support"));try{var r=new XMLHttpRequest,o=O.p+""+i+".hot-update.json";r.open("GET",o,!0),r.timeout=t,r.send(null)}catch(e){return n(e)}r.onreadystatechange=function(){if(4===r.readyState)if(0===r.status)n(new Error("Manifest request to "+o+" timed out."));else if(404===r.status)e();else if(200!==r.status&&304!==r.status)n(new Error("Manifest request to "+o+" failed."));else{try{var t=JSON.parse(r.responseText)}catch(e){return void n(e)}e(t)}}}))).then((function(e){if(!e)return c(L()?"ready":"idle"),null;v={},m={},w=e.c,_=e.h,c("prepare");var t=new Promise((function(e,t){d={resolve:e,reject:t}}));p={};return S(1),"prepare"===h&&0===y&&0===b&&x(),t}));var t}function S(e){w[e]?(v[e]=!0,b++,function(e){var t=document.createElement("script");t.charset="utf-8",t.src=O.p+""+e+"."+i+".hot-update.js",document.head.appendChild(t)}(e)):m[e]=!0}function x(){c("ready");var e=d;if(d=null,e)if(r)Promise.resolve().then((function(){return T(r)})).then((function(t){e.resolve(t)}),(function(t){e.reject(t)}));else{var t=[];for(var n in p)Object.prototype.hasOwnProperty.call(p,n)&&t.push(E(n));e.resolve(t)}}function T(t){if("ready"!==h)throw new Error("apply() is only allowed in ready status");return function t(r){var s,l,u,f,h;function d(e){for(var t=[e],n={},r=t.map((function(e){return{chain:[e],id:e}}));r.length>0;){var i=r.pop(),o=i.id,a=i.chain;if((f=R[o])&&(!f.hot._selfAccepted||f.hot._selfInvalidated)){if(f.hot._selfDeclined)return{type:"self-declined",chain:a,moduleId:o};if(f.hot._main)return{type:"unaccepted",chain:a,moduleId:o};for(var s=0;s<f.parents.length;s++){var l=f.parents[s],u=R[l];if(u){if(u.hot._declinedDependencies[o])return{type:"declined",chain:a.concat([l]),moduleId:o,parentId:l};-1===t.indexOf(l)&&(u.hot._acceptedDependencies[o]?(n[l]||(n[l]=[]),b(n[l],[o])):(delete n[l],t.push(l),r.push({chain:a.concat([l]),id:l})))}}}}return{type:"accepted",moduleId:e,outdatedModules:t,outdatedDependencies:n}}function b(e,t){for(var n=0;n<t.length;n++){var r=t[n];-1===e.indexOf(r)&&e.push(r)}}L();var y={},m=[],v={},k=function(){console.warn("[HMR] unexpected require("+x.moduleId+") to disposed module")};for(var S in p)if(Object.prototype.hasOwnProperty.call(p,S)){var x;h=E(S),x=p[S]?d(h):{type:"disposed",moduleId:S};var T=!1,A=!1,I=!1,U="";switch(x.chain&&(U="\nUpdate propagation: "+x.chain.join(" -> ")),x.type){case"self-declined":r.onDeclined&&r.onDeclined(x),r.ignoreDeclined||(T=new Error("Aborted because of self decline: "+x.moduleId+U));break;case"declined":r.onDeclined&&r.onDeclined(x),r.ignoreDeclined||(T=new Error("Aborted because of declined dependency: "+x.moduleId+" in "+x.parentId+U));break;case"unaccepted":r.onUnaccepted&&r.onUnaccepted(x),r.ignoreUnaccepted||(T=new Error("Aborted because "+h+" is not accepted"+U));break;case"accepted":r.onAccepted&&r.onAccepted(x),A=!0;break;case"disposed":r.onDisposed&&r.onDisposed(x),I=!0;break;default:throw new Error("Unexception type "+x.type)}if(T)return c("abort"),Promise.reject(T);if(A)for(h in v[h]=p[h],b(m,x.outdatedModules),x.outdatedDependencies)Object.prototype.hasOwnProperty.call(x.outdatedDependencies,h)&&(y[h]||(y[h]=[]),b(y[h],x.outdatedDependencies[h]));I&&(b(m,[x.moduleId]),v[h]=k)}var z,D=[];for(l=0;l<m.length;l++)h=m[l],R[h]&&R[h].hot._selfAccepted&&v[h]!==k&&!R[h].hot._selfInvalidated&&D.push({module:h,parents:R[h].parents.slice(),errorHandler:R[h].hot._selfAccepted});c("dispose"),Object.keys(w).forEach((function(e){!1===w[e]&&function(e){delete installedChunks[e]}(e)}));var M,N,B=m.slice();for(;B.length>0;)if(h=B.pop(),f=R[h]){var P={},F=f.hot._disposeHandlers;for(u=0;u<F.length;u++)(s=F[u])(P);for(o[h]=P,f.hot.active=!1,delete R[h],delete y[h],u=0;u<f.children.length;u++){var C=R[f.children[u]];C&&((z=C.parents.indexOf(h))>=0&&C.parents.splice(z,1))}}for(h in y)if(Object.prototype.hasOwnProperty.call(y,h)&&(f=R[h]))for(N=y[h],u=0;u<N.length;u++)M=N[u],(z=f.children.indexOf(M))>=0&&f.children.splice(z,1);c("apply"),void 0!==_&&(i=_,_=void 0);for(h in p=void 0,v)Object.prototype.hasOwnProperty.call(v,h)&&(e[h]=v[h]);var Z=null;for(h in y)if(Object.prototype.hasOwnProperty.call(y,h)&&(f=R[h])){N=y[h];var j=[];for(l=0;l<N.length;l++)if(M=N[l],s=f.hot._acceptedDependencies[M]){if(-1!==j.indexOf(s))continue;j.push(s)}for(l=0;l<j.length;l++){s=j[l];try{s(N)}catch(e){r.onErrored&&r.onErrored({type:"accept-errored",moduleId:h,dependencyId:N[l],error:e}),r.ignoreErrored||Z||(Z=e)}}}for(l=0;l<D.length;l++){var H=D[l];h=H.module,a=H.parents,n=h;try{O(h)}catch(e){if("function"==typeof H.errorHandler)try{H.errorHandler(e)}catch(t){r.onErrored&&r.onErrored({type:"self-accept-error-handler-errored",moduleId:h,error:t,originalError:e}),r.ignoreErrored||Z||(Z=t),Z||(Z=e)}else r.onErrored&&r.onErrored({type:"self-accept-errored",moduleId:h,error:e}),r.ignoreErrored||Z||(Z=e)}}if(Z)return c("fail"),Promise.reject(Z);if(g)return t(r).then((function(e){return m.forEach((function(t){e.indexOf(t)<0&&e.push(t)})),e}));return c("idle"),new Promise((function(e){e(m)}))}(t=t||{})}function L(){if(g)return p||(p={}),g.forEach(A),g=void 0,!0}function A(t){Object.prototype.hasOwnProperty.call(p,t)||(p[t]=e[t])}var R={};function O(t){if(R[t])return R[t].exports;var n=R[t]={i:t,l:!1,exports:{},hot:u(t),parents:(s=a,a=[],s),children:[]};return e[t].call(n.exports,n,n.exports,l(t)),n.l=!0,n.exports}O.m=e,O.c=R,O.d=function(e,t,n){O.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},O.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},O.t=function(e,t){if(1&t&&(e=O(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(O.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)O.d(n,r,function(t){return e[t]}.bind(null,r));return n},O.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return O.d(t,"a",t),t},O.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},O.p="",O.h=function(){return i},l(204)(O.s=204)}([,function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";(function(e){
+!function(e){var t=this.webpackHotUpdate;this.webpackHotUpdate=function(e,n){!function(e,t){if(!w[e]||!v[e])return;for(var n in v[e]=!1,t)Object.prototype.hasOwnProperty.call(t,n)&&(p[n]=t[n]);0==--b&&0===y&&x()}(e,n),t&&t(e,n)};var n,r=!0,i="1a8adbc0448dc70a9168",o={},a=[],s=[];function l(e){var t=R[e];if(!t)return O;var r=function(r){return t.hot.active?(R[r]?-1===R[r].parents.indexOf(e)&&R[r].parents.push(e):(a=[e],n=r),-1===t.children.indexOf(r)&&t.children.push(r)):(console.warn("[HMR] unexpected require("+r+") from disposed module "+e),a=[]),O(r)},i=function(e){return{configurable:!0,enumerable:!0,get:function(){return O[e]},set:function(t){O[e]=t}}};for(var o in O)Object.prototype.hasOwnProperty.call(O,o)&&"e"!==o&&"t"!==o&&Object.defineProperty(r,o,i(o));return r.e=function(e){return"ready"===h&&c("prepare"),y++,O.e(e).then(t,(function(e){throw t(),e}));function t(){y--,"prepare"===h&&(m[e]||S(e),0===y&&0===b&&x())}},r.t=function(e,t){return 1&t&&(e=r(e)),O.t(e,-2&t)},r}function u(t){var r={_acceptedDependencies:{},_declinedDependencies:{},_selfAccepted:!1,_selfDeclined:!1,_selfInvalidated:!1,_disposeHandlers:[],_main:n!==t,active:!0,accept:function(e,t){if(void 0===e)r._selfAccepted=!0;else if("function"==typeof e)r._selfAccepted=e;else if("object"==typeof e)for(var n=0;n<e.length;n++)r._acceptedDependencies[e[n]]=t||function(){};else r._acceptedDependencies[e]=t||function(){}},decline:function(e){if(void 0===e)r._selfDeclined=!0;else if("object"==typeof e)for(var t=0;t<e.length;t++)r._declinedDependencies[e[t]]=!0;else r._declinedDependencies[e]=!0},dispose:function(e){r._disposeHandlers.push(e)},addDisposeHandler:function(e){r._disposeHandlers.push(e)},removeDisposeHandler:function(e){var t=r._disposeHandlers.indexOf(e);t>=0&&r._disposeHandlers.splice(t,1)},invalidate:function(){switch(this._selfInvalidated=!0,h){case"idle":(p={})[t]=e[t],c("ready");break;case"ready":A(t);break;case"prepare":case"check":case"dispose":case"apply":(g=g||[]).push(t)}},check:k,apply:T,status:function(e){if(!e)return h;f.push(e)},addStatusHandler:function(e){f.push(e)},removeStatusHandler:function(e){var t=f.indexOf(e);t>=0&&f.splice(t,1)},data:o[t]};return n=void 0,r}var f=[],h="idle";function c(e){h=e;for(var t=0;t<f.length;t++)f[t].call(null,e)}var d,p,_,g,b=0,y=0,m={},v={},w={};function E(e){return+e+""===e?+e:e}function k(e){if("idle"!==h)throw new Error("check() is only allowed in idle status");return r=e,c("check"),(t=1e4,t=t||1e4,new Promise((function(e,n){if("undefined"==typeof XMLHttpRequest)return n(new Error("No browser support"));try{var r=new XMLHttpRequest,o=O.p+""+i+".hot-update.json";r.open("GET",o,!0),r.timeout=t,r.send(null)}catch(e){return n(e)}r.onreadystatechange=function(){if(4===r.readyState)if(0===r.status)n(new Error("Manifest request to "+o+" timed out."));else if(404===r.status)e();else if(200!==r.status&&304!==r.status)n(new Error("Manifest request to "+o+" failed."));else{try{var t=JSON.parse(r.responseText)}catch(e){return void n(e)}e(t)}}}))).then((function(e){if(!e)return c(L()?"ready":"idle"),null;v={},m={},w=e.c,_=e.h,c("prepare");var t=new Promise((function(e,t){d={resolve:e,reject:t}}));p={};return S(1),"prepare"===h&&0===y&&0===b&&x(),t}));var t}function S(e){w[e]?(v[e]=!0,b++,function(e){var t=document.createElement("script");t.charset="utf-8",t.src=O.p+""+e+"."+i+".hot-update.js",document.head.appendChild(t)}(e)):m[e]=!0}function x(){c("ready");var e=d;if(d=null,e)if(r)Promise.resolve().then((function(){return T(r)})).then((function(t){e.resolve(t)}),(function(t){e.reject(t)}));else{var t=[];for(var n in p)Object.prototype.hasOwnProperty.call(p,n)&&t.push(E(n));e.resolve(t)}}function T(t){if("ready"!==h)throw new Error("apply() is only allowed in ready status");return function t(r){var s,l,u,f,h;function d(e){for(var t=[e],n={},r=t.map((function(e){return{chain:[e],id:e}}));r.length>0;){var i=r.pop(),o=i.id,a=i.chain;if((f=R[o])&&(!f.hot._selfAccepted||f.hot._selfInvalidated)){if(f.hot._selfDeclined)return{type:"self-declined",chain:a,moduleId:o};if(f.hot._main)return{type:"unaccepted",chain:a,moduleId:o};for(var s=0;s<f.parents.length;s++){var l=f.parents[s],u=R[l];if(u){if(u.hot._declinedDependencies[o])return{type:"declined",chain:a.concat([l]),moduleId:o,parentId:l};-1===t.indexOf(l)&&(u.hot._acceptedDependencies[o]?(n[l]||(n[l]=[]),b(n[l],[o])):(delete n[l],t.push(l),r.push({chain:a.concat([l]),id:l})))}}}}return{type:"accepted",moduleId:e,outdatedModules:t,outdatedDependencies:n}}function b(e,t){for(var n=0;n<t.length;n++){var r=t[n];-1===e.indexOf(r)&&e.push(r)}}L();var y={},m=[],v={},k=function(){console.warn("[HMR] unexpected require("+x.moduleId+") to disposed module")};for(var S in p)if(Object.prototype.hasOwnProperty.call(p,S)){var x;h=E(S),x=p[S]?d(h):{type:"disposed",moduleId:S};var T=!1,A=!1,I=!1,U="";switch(x.chain&&(U="\nUpdate propagation: "+x.chain.join(" -> ")),x.type){case"self-declined":r.onDeclined&&r.onDeclined(x),r.ignoreDeclined||(T=new Error("Aborted because of self decline: "+x.moduleId+U));break;case"declined":r.onDeclined&&r.onDeclined(x),r.ignoreDeclined||(T=new Error("Aborted because of declined dependency: "+x.moduleId+" in "+x.parentId+U));break;case"unaccepted":r.onUnaccepted&&r.onUnaccepted(x),r.ignoreUnaccepted||(T=new Error("Aborted because "+h+" is not accepted"+U));break;case"accepted":r.onAccepted&&r.onAccepted(x),A=!0;break;case"disposed":r.onDisposed&&r.onDisposed(x),I=!0;break;default:throw new Error("Unexception type "+x.type)}if(T)return c("abort"),Promise.reject(T);if(A)for(h in v[h]=p[h],b(m,x.outdatedModules),x.outdatedDependencies)Object.prototype.hasOwnProperty.call(x.outdatedDependencies,h)&&(y[h]||(y[h]=[]),b(y[h],x.outdatedDependencies[h]));I&&(b(m,[x.moduleId]),v[h]=k)}var z,D=[];for(l=0;l<m.length;l++)h=m[l],R[h]&&R[h].hot._selfAccepted&&v[h]!==k&&!R[h].hot._selfInvalidated&&D.push({module:h,parents:R[h].parents.slice(),errorHandler:R[h].hot._selfAccepted});c("dispose"),Object.keys(w).forEach((function(e){!1===w[e]&&function(e){delete installedChunks[e]}(e)}));var M,N,B=m.slice();for(;B.length>0;)if(h=B.pop(),f=R[h]){var P={},F=f.hot._disposeHandlers;for(u=0;u<F.length;u++)(s=F[u])(P);for(o[h]=P,f.hot.active=!1,delete R[h],delete y[h],u=0;u<f.children.length;u++){var C=R[f.children[u]];C&&((z=C.parents.indexOf(h))>=0&&C.parents.splice(z,1))}}for(h in y)if(Object.prototype.hasOwnProperty.call(y,h)&&(f=R[h]))for(N=y[h],u=0;u<N.length;u++)M=N[u],(z=f.children.indexOf(M))>=0&&f.children.splice(z,1);c("apply"),void 0!==_&&(i=_,_=void 0);for(h in p=void 0,v)Object.prototype.hasOwnProperty.call(v,h)&&(e[h]=v[h]);var Z=null;for(h in y)if(Object.prototype.hasOwnProperty.call(y,h)&&(f=R[h])){N=y[h];var j=[];for(l=0;l<N.length;l++)if(M=N[l],s=f.hot._acceptedDependencies[M]){if(-1!==j.indexOf(s))continue;j.push(s)}for(l=0;l<j.length;l++){s=j[l];try{s(N)}catch(e){r.onErrored&&r.onErrored({type:"accept-errored",moduleId:h,dependencyId:N[l],error:e}),r.ignoreErrored||Z||(Z=e)}}}for(l=0;l<D.length;l++){var H=D[l];h=H.module,a=H.parents,n=h;try{O(h)}catch(e){if("function"==typeof H.errorHandler)try{H.errorHandler(e)}catch(t){r.onErrored&&r.onErrored({type:"self-accept-error-handler-errored",moduleId:h,error:t,originalError:e}),r.ignoreErrored||Z||(Z=t),Z||(Z=e)}else r.onErrored&&r.onErrored({type:"self-accept-errored",moduleId:h,error:e}),r.ignoreErrored||Z||(Z=e)}}if(Z)return c("fail"),Promise.reject(Z);if(g)return t(r).then((function(e){return m.forEach((function(t){e.indexOf(t)<0&&e.push(t)})),e}));return c("idle"),new Promise((function(e){e(m)}))}(t=t||{})}function L(){if(g)return p||(p={}),g.forEach(A),g=void 0,!0}function A(t){Object.prototype.hasOwnProperty.call(p,t)||(p[t]=e[t])}var R={};function O(t){if(R[t])return R[t].exports;var n=R[t]={i:t,l:!1,exports:{},hot:u(t),parents:(s=a,a=[],s),children:[]};return e[t].call(n.exports,n,n.exports,l(t)),n.l=!0,n.exports}O.m=e,O.c=R,O.d=function(e,t,n){O.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},O.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},O.t=function(e,t){if(1&t&&(e=O(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(O.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)O.d(n,r,function(t){return e[t]}.bind(null,r));return n},O.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return O.d(t,"a",t),t},O.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},O.p="",O.h=function(){return i},l(204)(O.s=204)}([,function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";(function(e){
/*!
* The buffer module from node.js, for the browser.
*
diff --git a/src/element.js b/src/element.js
index f46edbdd4..6690be18b 100644
--- a/src/element.js
+++ b/src/element.js
@@ -171,7 +171,10 @@ const BASE_STYLE = `
border-radius: 20px;
padding: 8px 14px;
font: 600 13px/1 var(--agent-chat-font);
- white-space: nowrap;
+ max-width: min(280px, 60%);
+ white-space: normal;
+ min-width: 80px;
+ min-height: 28px;
pointer-events: none;
opacity: 0;
transition: opacity 0.25s ease;
@@ -192,6 +195,13 @@ const BASE_STYLE = `
border-top: 8px solid rgba(255, 255, 255, 0.95);
}
.thought-bubble[data-active="true"] { opacity: 1; }
+ .thought-bubble .text {
+ font: 13px/1.4 var(--agent-chat-font);
+ color: #1a1a2e;
+ display: none;
+ }
+ .thought-bubble[data-streaming="true"] .text { display: block; }
+ .thought-bubble[data-streaming="true"] .dot { display: none; }
.thought-bubble .dot {
width: 6px;
height: 6px;
@@ -426,6 +436,8 @@ class Agent3DElement extends HTMLElement {
this._notifier = null;
this._thoughtBubbleEl = null;
this._walkReturnTimer = null;
+ this._isWalking = false;
+ this._walkStopDebounce = null;
}
connectedCallback() {
@@ -584,7 +596,9 @@ class Agent3DElement extends HTMLElement {
const thoughtBubble = document.createElement('div');
thoughtBubble.className = 'thought-bubble';
thoughtBubble.setAttribute('aria-live', 'polite');
- thoughtBubble.innerHTML = '<span class="dot"></span><span class="dot"></span><span class="dot"></span>';
+ thoughtBubble.innerHTML =
+ '<span class="text"></span>' +
+ '<span class="dot"></span><span class="dot"></span><span class="dot"></span>';
avatarAnchor.appendChild(thoughtBubble);
chrome.appendChild(chat);
@@ -595,6 +609,7 @@ class Agent3DElement extends HTMLElement {
this._inputEl = input;
this._micEl = micBtn;
this._thoughtBubbleEl = thoughtBubble;
+ this._thoughtTextEl = thoughtBubble.querySelector('.text');
// Voice state ring — wired by VoiceClient when voice-server attr is set
this.addEventListener('voiceStateChange', (e) => {
@@ -1142,6 +1157,7 @@ class Agent3DElement extends HTMLElement {
// Re-dispatch runtime events on the host
for (const ev of [
'brain:thinking',
+ 'brain:stream',
'brain:message',
'skill:tool-called',
'voice:speech-start',
@@ -1171,21 +1187,28 @@ class Agent3DElement extends HTMLElement {
type: ACTION_TYPES.SPEAK,
payload: { text: detail.content, sentiment: detail.sentiment ?? 0 },
});
- // Avatar walks while the response text is being delivered
- this._startWalkAnimation(detail.content);
}
if (this._chatEl) this._renderMessage(detail);
}
+ if (ev === 'brain:stream') {
+ if (this._thoughtBubbleEl && this.getAttribute('avatar-chat') !== 'off') {
+ this._streamToBubble(e.detail?.chunk ?? '');
+ }
+ }
if (ev === 'brain:thinking') {
if (this._toolIndicatorEl) {
if (e.detail?.thinking) this._setToolIndicator('thinking');
else this._clearToolIndicator();
}
+ if (!e.detail?.thinking) this._stopWalkAnimation();
protocol.emit({ type: ACTION_TYPES.THINK, payload: { thought: 'processing your message...' } });
protocol.emit({ type: ACTION_TYPES.EMOTE, payload: { trigger: 'patience', weight: 0.5 } });
- // Show/hide thought bubble above avatar (skipped when feature is off)
if (this._thoughtBubbleEl && this.getAttribute('avatar-chat') !== 'off') {
- this._thoughtBubbleEl.dataset.active = e.detail?.thinking ? 'true' : 'false';
+ if (e.detail?.thinking) {
+ this._thoughtBubbleEl.dataset.active = 'true';
+ } else {
+ this._clearThoughtBubble();
+ }
}
}
if (ev === 'skill:tool-called') {
@@ -1360,6 +1383,9 @@ class Agent3DElement extends HTMLElement {
msg.querySelector('.body').textContent = content;
this._chatEl.appendChild(msg);
this._chatEl.scrollTop = this._chatEl.scrollHeight;
+ if (!this._isWalking && this.getAttribute('avatar-chat') !== 'off') {
+ this._onStreamChunk();
+ }
}
_sentimentTone(s) {
@@ -1386,22 +1412,21 @@ class Agent3DElement extends HTMLElement {
}, 350);
}
- /**
- * Play the walk animation for a duration proportional to the response length,
- * then crossfade back to idle. Safe to call even when the scene isn't ready.
- * @param {string} text The response text being delivered
- */
- _startWalkAnimation(text) {
+ _onStreamChunk() {
if (!this._scene || this.getAttribute('avatar-chat') === 'off') return;
- clearTimeout(this._walkReturnTimer);
- // Roughly 60 wpm reading pace; min 2s, max 8s
- const words = text ? text.split(/\s+/).length : 0;
- // ~100ms per word (approx TTS delivery rate), clamped 2–8s
- const duration = Math.min(8000, Math.max(2000, words * 100));
- this._scene.playClipByName('walk', { loop: true, fade_ms: 300 });
- this._walkReturnTimer = setTimeout(() => {
- this._scene?.playClipByName('idle', { loop: true, fade_ms: 600 });
- }, duration);
+ if (!this._isWalking) {
+ this._isWalking = true;
+ this._scene.playClipByName('walk', { loop: true, fade_ms: 300 });
+ }
+ clearTimeout(this._walkStopDebounce);
+ this._walkStopDebounce = setTimeout(() => this._stopWalkAnimation(), 600);
+ }
+
+ _stopWalkAnimation() {
+ if (!this._isWalking) return;
+ this._isWalking = false;
+ clearTimeout(this._walkStopDebounce);
+ this._scene?.playClipByName('idle', { loop: true, fade_ms: 500 });
}
_toolIndicatorLabel(toolName) {
@@ -1696,6 +1721,9 @@ class Agent3DElement extends HTMLElement {
this._notifier = null;
clearTimeout(this._walkReturnTimer);
this._walkReturnTimer = null;
+ clearTimeout(this._walkStopDebounce);
+ this._walkStopDebounce = null;
+ this._isWalking = false;
try {
this._runtime?.destroy();
} catch {}
diff --git a/src/runtime/index.js b/src/runtime/index.js
index a739f91c7..77d0ce943 100644
--- a/src/runtime/index.js
+++ b/src/runtime/index.js
@@ -97,11 +97,16 @@ export class Runtime extends EventTarget {
let finalText = '';
while (iter++ < MAX_TOOL_ITERATIONS) {
+ this.dispatchEvent(new CustomEvent('brain:thinking', { detail: { thinking: true } }));
const response = await this.provider.complete({
system: this.systemPrompt,
messages: this.messages,
tools: this.tools,
+ onChunk: (chunk) => {
+ this.dispatchEvent(new CustomEvent('brain:stream', { detail: { chunk } }));
+ },
});
+ this.dispatchEvent(new CustomEvent('brain:thinking', { detail: { thinking: false } }));
if (response.thinking) {
this.dispatchEvent(
diff --git a/src/runtime/providers.js b/src/runtime/providers.js
index 7f74f3717..b916b07c3 100644
--- a/src/runtime/providers.js
+++ b/src/runtime/providers.js
@@ -28,13 +28,14 @@ export class AnthropicProvider {
}
}
- async complete({ system, messages, tools }) {
+ async complete({ system, messages, tools, onChunk }) {
const body = {
model: this.model,
max_tokens: this.maxTokens,
temperature: this.temperature,
system,
messages,
+ stream: true,
};
if (tools && tools.length) body.tools = tools;
if (this.thinking === 'always') {
@@ -54,8 +55,53 @@ export class AnthropicProvider {
const text = await res.text();
throw new Error(`Anthropic ${res.status}: ${text}`);
}
- const data = await res.json();
- return this._normalize(data);
+
+ const out = { text: '', toolCalls: [], thinking: '', stopReason: 'end_turn' };
+ let currentToolCall = null;
+ const reader = res.body.getReader();
+ const decoder = new TextDecoder();
+ let buf = '';
+
+ while (true) {
+ const { done, value } = await reader.read();
+ if (done) break;
+ buf += decoder.decode(value, { stream: true });
+ const lines = buf.split('\n');
+ buf = lines.pop();
+ for (const line of lines) {
+ if (!line.startsWith('data: ')) continue;
+ const payload = line.slice(6).trim();
+ if (payload === '[DONE]') break;
+ let evt;
+ try { evt = JSON.parse(payload); } catch { continue; }
+ if (evt.type === 'message_delta' && evt.delta?.stop_reason) {
+ out.stopReason = evt.delta.stop_reason;
+ } else if (evt.type === 'content_block_start') {
+ const block = evt.content_block;
+ if (block?.type === 'tool_use') {
+ currentToolCall = { id: block.id, name: block.name, input: '' };
+ }
+ } else if (evt.type === 'content_block_delta') {
+ const delta = evt.delta;
+ if (delta?.type === 'text_delta') {
+ out.text += delta.text;
+ onChunk?.(delta.text);
+ } else if (delta?.type === 'thinking_delta') {
+ out.thinking += delta.thinking;
+ } else if (delta?.type === 'input_json_delta' && currentToolCall) {
+ currentToolCall.input += delta.partial_json;
+ }
+ } else if (evt.type === 'content_block_stop') {
+ if (currentToolCall) {
+ try { currentToolCall.input = JSON.parse(currentToolCall.input); } catch { currentToolCall.input = {}; }
+ out.toolCalls.push(currentToolCall);
+ currentToolCall = null;
+ }
+ }
+ }
+ }
+
+ return out;
}
_normalize(data) {
diff --git a/vercel.json b/vercel.json
index b10fe87db..b6755ec0b 100644
--- a/vercel.json
+++ b/vercel.json
@@ -9,6 +9,9 @@
"functions": {
"api/**/*.js": {
"includeFiles": "node_modules/@zauthx402/sdk/dist/**"
+ },
+ "api/pump/[action].js": {
+ "includeFiles": "node_modules/@zauthx402/sdk/dist/**,examples/skills/pump-fun-strategy/**"
}
},
"routes": [