diff --git a/build/trois.module.js b/build/trois.module.js index 64bad59..8f0a802 100644 --- a/build/trois.module.js +++ b/build/trois.module.js @@ -1,10 +1,15 @@ -import { h } from 'vue'; -import { Vector2, Vector3, Plane as Plane$1, Raycaster, WebGLRenderer, PerspectiveCamera as PerspectiveCamera$1, Scene as Scene$1, Color, BoxBufferGeometry, SphereBufferGeometry, AmbientLight as AmbientLight$1, PointLight as PointLight$1, SpotLight as SpotLight$1, FrontSide, MeshBasicMaterial, MeshLambertMaterial, MeshPhongMaterial, MeshPhysicalMaterial, MeshStandardMaterial, Mesh as Mesh$1, PlaneBufferGeometry, InstancedMesh as InstancedMesh$1 } from 'three'; +import { h, toRef, watch, resolveComponent, openBlock, createBlock, withCtx, createVNode, renderSlot } from 'vue'; +import { Vector2, Vector3, Plane as Plane$1, Raycaster, WebGLRenderer, PerspectiveCamera as PerspectiveCamera$1, Scene as Scene$1, Color, TextureLoader, CubeTextureLoader, BoxBufferGeometry, CircleBufferGeometry, ConeBufferGeometry, CylinderBufferGeometry, DodecahedronBufferGeometry, IcosahedronBufferGeometry, LatheBufferGeometry, OctahedronBufferGeometry, PolyhedronBufferGeometry, RingBufferGeometry, SphereBufferGeometry, TetrahedronBufferGeometry, TorusBufferGeometry, TorusKnotBufferGeometry, Curve, TubeBufferGeometry, AmbientLight as AmbientLight$1, DirectionalLight as DirectionalLight$1, PointLight as PointLight$1, SpotLight as SpotLight$1, FrontSide, MeshBasicMaterial, MeshLambertMaterial, MeshPhongMaterial, MeshStandardMaterial, MeshPhysicalMaterial, ShaderChunk, UniformsUtils, ShaderLib, ShaderMaterial as ShaderMaterial$1, MeshToonMaterial, Mesh as Mesh$1, PlaneBufferGeometry, FontLoader, TextBufferGeometry, WebGLCubeRenderTarget, RGBFormat, LinearMipmapLinearFilter, CubeCamera, BackSide, DoubleSide, InstancedMesh as InstancedMesh$1, CubeRefractionMapping, SpriteMaterial, Sprite as Sprite$1, Object3D, Geometry as Geometry$1, Face3, BufferGeometry, MathUtils, InstancedBufferAttribute } from 'three'; import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls.js'; import { EffectComposer as EffectComposer$1 } from 'three/examples/jsm/postprocessing/EffectComposer.js'; import { RenderPass as RenderPass$1 } from 'three/examples/jsm/postprocessing/RenderPass.js'; import { BokehPass as BokehPass$1 } from 'three/examples/jsm/postprocessing/BokehPass.js'; +import { FilmPass as FilmPass$1 } from 'three/examples/jsm/postprocessing/FilmPass.js'; +import { HalftonePass as HalftonePass$1 } from 'three/examples/jsm/postprocessing/HalftonePass.js'; +import { SAOPass as SAOPass$1 } from 'three/examples/jsm/postprocessing/SAOPass.js'; import { UnrealBloomPass as UnrealBloomPass$1 } from 'three/examples/jsm/postprocessing/UnrealBloomPass.js'; +import { gsap, Power4 } from 'gsap'; +import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader.js'; /** * Three.js helper @@ -15,6 +20,7 @@ function useThree() { canvas: null, antialias: true, alpha: false, + autoClear: true, orbit_ctrl: false, mouse_move: false, mouse_raycast: false, @@ -31,9 +37,9 @@ function useThree() { }; // handlers - var afterInitHandlers = []; - var afterResizeHandlers = []; - var beforeRenderHandlers = []; + var afterInitCallbacks = []; + var afterResizeCallbacks = []; + var beforeRenderCallbacks = []; // mouse tracking var mouse = new Vector2(); @@ -57,8 +63,8 @@ function useThree() { renderC: renderC, setSize: setSize, onAfterInit: onAfterInit, - onAfterResize: onAfterResize, - onBeforeRender: onBeforeRender, + onAfterResize: onAfterResize, offAfterResize: offAfterResize, + onBeforeRender: onBeforeRender, offBeforeRender: offBeforeRender, }; /** @@ -66,9 +72,12 @@ function useThree() { */ function init(params) { if (params) { - for (var [key, value] of Object.entries(params)) { + Object.entries(params).forEach(function (ref) { + var key = ref[0]; + var value = ref[1]; + conf[key] = value; - } + }); } if (!obj.scene) { @@ -82,13 +91,17 @@ function useThree() { } obj.renderer = new WebGLRenderer({ canvas: conf.canvas, antialias: conf.antialias, alpha: conf.alpha }); + obj.renderer.autoClear = conf.autoClear; if (conf.orbit_ctrl) { obj.orbitCtrl = new OrbitControls(obj.camera, obj.renderer.domElement); if (conf.orbit_ctrl instanceof Object) { - for (var [key$1, value$1] of Object.entries(conf.orbit_ctrl)) { - obj.orbitCtrl[key$1] = value$1; - } + Object.entries(conf.orbit_ctrl).forEach(function (ref) { + var key = ref[0]; + var value = ref[1]; + + obj.orbitCtrl[key] = value; + }); } } @@ -109,29 +122,43 @@ function useThree() { obj.mouse_move_element.addEventListener('mouseleave', onMouseleave); } - afterInitHandlers.forEach(function (c) { return c(); }); + afterInitCallbacks.forEach(function (c) { return c(); }); return true; } /** - * add after init handler + * add after init callback */ function onAfterInit(callback) { - afterInitHandlers.push(callback); + afterInitCallbacks.push(callback); } /** - * add after resize handler + * add after resize callback */ function onAfterResize(callback) { - afterResizeHandlers.push(callback); + afterResizeCallbacks.push(callback); } /** - * add before render handler + * remove after resize callback + */ + function offAfterResize(callback) { + afterResizeCallbacks = afterResizeCallbacks.filter(function (c) { return c !== callback; }); + } + + /** + * add before render callback */ function onBeforeRender(callback) { - beforeRenderHandlers.push(callback); + beforeRenderCallbacks.push(callback); + } + + /** + * remove before render callback + */ + function offBeforeRender(callback) { + beforeRenderCallbacks = beforeRenderCallbacks.filter(function (c) { return c !== callback; }); } /** @@ -139,7 +166,7 @@ function useThree() { */ function render() { if (obj.orbitCtrl) { obj.orbitCtrl.update(); } - beforeRenderHandlers.forEach(function (c) { return c(); }); + beforeRenderCallbacks.forEach(function (c) { return c(); }); obj.renderer.render(obj.scene, obj.camera); } @@ -148,7 +175,7 @@ function useThree() { */ function renderC() { if (obj.orbitCtrl) { obj.orbitCtrl.update(); } - beforeRenderHandlers.forEach(function (c) { return c(); }); + beforeRenderCallbacks.forEach(function (c) { return c(); }); obj.composer.render(); } @@ -156,11 +183,14 @@ function useThree() { * remove listeners */ function dispose() { + beforeRenderCallbacks = []; window.removeEventListener('resize', onResize); if (obj.mouse_move_element) { obj.mouse_move_element.removeEventListener('mousemove', onMousemove); - obj.mouse_move_element.removeEventListener('mouseleave', onMouseleave); + obj.mouse_move_element.removeEventListener('mouseleave', onMouseleave); } + if (obj.orbitCtrl) { obj.orbitCtrl.dispose(); } + this.renderer.dispose(); } /** @@ -202,7 +232,7 @@ function useThree() { } else { setSize(conf.resize.clientWidth, conf.resize.clientHeight); } - afterResizeHandlers.forEach(function (c) { return c(); }); + afterResizeCallbacks.forEach(function (c) { return c(); }); } /** @@ -248,6 +278,10 @@ var Renderer = { type: Boolean, default: false, }, + autoClear: { + type: Boolean, + default: true, + }, shadow: { type: Boolean, default: false, @@ -271,15 +305,18 @@ var Renderer = { width: String, height: String, }, - setup: function setup(props) { + setup: function setup() { return { three: useThree(), raf: true, + onMountedCallbacks: [], }; }, provide: function provide() { return { three: this.three, + // renderer: this.three.renderer, + rendererComponent: this, }; }, mounted: function mounted() { @@ -287,6 +324,7 @@ var Renderer = { canvas: this.$refs.canvas, antialias: this.antialias, alpha: this.alpha, + autoClear: this.autoClear, orbit_ctrl: this.orbitCtrl, mouse_move: this.mouseMove, mouse_raycast: this.mouseRaycast, @@ -299,12 +337,17 @@ var Renderer = { this.three.renderer.shadowMap.enabled = this.shadow; if (this.three.composer) { this.animateC(); } else { this.animate(); } - } }, + } + this.onMountedCallbacks.forEach(function (c) { return c(); }); + }, beforeUnmount: function beforeUnmount() { this.raf = false; this.three.dispose(); }, methods: { + onMounted: function onMounted(callback) { + this.onMountedCallbacks.push(callback); + }, onBeforeRender: function onBeforeRender(callback) { this.three.onBeforeRender(callback); }, @@ -331,11 +374,26 @@ var Renderer = { function setFromProp(o, prop) { if (prop instanceof Object) { - for (var [key, value] of Object.entries(prop)) { + Object.entries(prop).forEach(function (ref) { + var key = ref[0]; + var value = ref[1]; + o[key] = value; - } + }); } } +function propsValues(props, exclude) { + var values = {}; + Object.entries(props).forEach(function (ref) { + var key = ref[0]; + var value = ref[1]; + + if (!exclude || (exclude && !exclude.includes(key))) { + values[key] = value; + } + }); + return values; +} function lerp(value1, value2, amount) { amount = amount < 0 ? 0 : amount; amount = amount > 1 ? 1 : amount; @@ -346,24 +404,63 @@ function lerpv3(v1, v2, amount) { v1.y = lerp(v1.y, v2.y, amount); v1.z = lerp(v1.z, v2.z, amount); } +function limit(val, min, max) { + return val < min ? min : (val > max ? max : val); +} + +function useBindProp(comp, prop, object) { + if (comp[prop]) { + var ref = toRef(comp, prop); + setFromProp(object, ref.value); + watch(ref, function () { + setFromProp(object, ref.value); + }, { deep: true }); + } +} var PerspectiveCamera = { inject: ['three'], props: { + aspect: { + type: Number, + default: 1, + }, + far: { + type: Number, + default: 2000, + }, fov: { type: Number, default: 50, }, - position: Object, + near: { + type: Number, + default: 0.1, + }, + position: { + type: [Object, Vector3], + default: { x: 0, y: 0, z: 0 }, + }, }, created: function created() { - var camera = new PerspectiveCamera$1(this.fov); - setFromProp(camera.position, this.position); - this.three.camera = camera; + var this$1 = this; + + this.camera = new PerspectiveCamera$1(this.fov, this.aspect, this.near, this.far); + useBindProp(this, 'position', this.camera.position); + + ['aspect', 'far', 'fov', 'near'].forEach(function (p) { + watch(function () { return this$1[p]; }, function () { + this$1.camera[p] = this$1[p]; + this$1.camera.updateProjectionMatrix(); + }); + }); + + this.three.camera = this.camera; }, render: function render() { return []; }, + __hmrId: 'PerspectiveCamera', }; var Scene = { @@ -372,9 +469,10 @@ var Scene = { id: String, background: [String, Number], }, - setup: function setup (props) { + setup: function setup(props) { var scene = new Scene$1(); if (props.background) { scene.background = new Color(props.background); } + watch(function () { return props.background; }, function (value) { scene.background = new Color(value); }); return { scene: scene }; }, provide: function provide() { @@ -387,6 +485,14 @@ var Scene = { this.three.scene = this.scene; } }, + methods: { + // add(o) { + // this.scene.add(o); + // }, + // remove(o) { + // this.scene.remove(o); + // }, + }, render: function render() { if (this.$slots.default) { return this.$slots.default(); @@ -395,15 +501,133 @@ var Scene = { }, }; -var Geometry = { - inject: ['parent'], - beforeMount: function beforeMount() { - if (!this.parent) { - console.error('Missing parent Mesh'); - } +var Texture = { + inject: ['three'], + emits: ['loaded'], + props: { + src: String, + onLoad: Function, + onProgress: Function, + onError: Function, + }, + created: function created() { + var this$1 = this; + + this.createTexture(); + watch(function () { return this$1.src; }, this.refreshTexture); }, unmounted: function unmounted() { - this.parent.geometry.dispose(); + this.texture.dispose(); + }, + methods: { + createTexture: function createTexture() { + this.texture = new TextureLoader().load(this.src, this.onLoaded, this.onProgress, this.onError); + }, + refreshTexture: function refreshTexture() { + this.createTexture(); + }, + onLoaded: function onLoaded() { + if (this.onLoad) { this.onLoad(); } + this.$emit('loaded'); + }, + }, + render: function render() { + return []; + }, +}; + +var CubeTexture = { + inject: ['three'], + emits: ['loaded'], + props: { + path: String, + urls: { + type: Array, + default: ['px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg'], + }, + onLoad: Function, + onProgress: Function, + onError: Function, + }, + created: function created() { + var this$1 = this; + + this.createTexture(); + watch(function () { return this$1.path; }, this.refreshTexture); + watch(function () { return this$1.urls; }, this.refreshTexture); + }, + unmounted: function unmounted() { + this.texture.dispose(); + }, + methods: { + createTexture: function createTexture() { + this.texture = new CubeTextureLoader() + .setPath(this.path) + .load(this.urls, this.onLoaded, this.onProgress, this.onError); + }, + refreshTexture: function refreshTexture() { + this.createTexture(); + }, + onLoaded: function onLoaded() { + if (this.onLoad) { this.onLoad(); } + this.$emit('loaded'); + }, + }, + render: function render() { + return []; + }, +}; + +var Geometry = { + emits: ['ready'], + inject: ['mesh'], + props: { + rotateX: Number, + rotateY: Number, + rotateZ: Number, + }, + created: function created() { + var this$1 = this; + + if (!this.mesh) { + console.error('Missing parent Mesh'); + } + this.watchProps = []; + Object.entries(this.$props).forEach(function (e) { return this$1.watchProps.push(e[0]); }); + }, + beforeMount: function beforeMount() { + this.createGeometry(); + this.rotateGeometry(); + this.mesh.setGeometry(this.geometry); + }, + mounted: function mounted() { + this.addWatchers(); + }, + unmounted: function unmounted() { + this.geometry.dispose(); + }, + methods: { + rotateGeometry: function rotateGeometry() { + if (this.rotateX) { this.geometry.rotateX(this.rotateX); } + if (this.rotateY) { this.geometry.rotateY(this.rotateY); } + if (this.rotateZ) { this.geometry.rotateZ(this.rotateZ); } + }, + addWatchers: function addWatchers() { + var this$1 = this; + + this.watchProps.forEach(function (prop) { + watch(function () { return this$1[prop]; }, function () { + this$1.refreshGeometry(); + }); + }); + }, + refreshGeometry: function refreshGeometry() { + var oldGeo = this.geometry; + this.createGeometry(); + this.rotateGeometry(); + this.mesh.setGeometry(this.geometry); + oldGeo.dispose(); + }, }, render: function render() { return []; @@ -413,46 +637,236 @@ var Geometry = { var BoxGeometry = { extends: Geometry, props: { - size: { - type: Number, - }, - width: { - type: Number, - default: 1, - }, - height: { - type: Number, - default: 1, - }, - depth: { - type: Number, - default: 1, + size: Number, + width: { type: Number, default: 1 }, + height: { type: Number, default: 1 }, + depth: { type: Number, default: 1 }, + widthSegments: { type: Number, default: 1 }, + heightSegments: { type: Number, default: 1 }, + depthSegments: { type: Number, default: 1 }, + }, + methods: { + createGeometry: function createGeometry() { + var w = this.width, h = this.height, d = this.depth; + if (this.size) { + w = this.size; h = this.size; d = this.size; + } + this.geometry = new BoxBufferGeometry(w, h, d, this.widthSegments, this.heightSegments, this.depthSegments); }, }, - mounted: function mounted() { - if (this.size) { - this.parent.geometry = new BoxBufferGeometry(this.size, this.size, this.size); - } else { - this.parent.geometry = new BoxBufferGeometry(this.width, this.height, this.depth); - } +}; + +var CircleGeometry = { + extends: Geometry, + props: { + radius: { type: Number, default: 1 }, + segments: { type: Number, default: 8 }, + thetaStart: { type: Number, default: 0 }, + thetaLength: { type: Number, default: Math.PI * 2 }, + }, + methods: { + createGeometry: function createGeometry() { + this.geometry = new CircleBufferGeometry(this.radius, this.segments, this.thetaStart, this.thetaLength); + }, + }, +}; + +var ConeGeometry = { + extends: Geometry, + props: { + radius: { type: Number, default: 1 }, + height: { type: Number, default: 1 }, + radialSegments: { type: Number, default: 8 }, + heightSegments: { type: Number, default: 1 }, + openEnded: { type: Boolean, default: false }, + thetaStart: { type: Number, default: 0 }, + thetaLength: { type: Number, default: Math.PI * 2 }, + }, + methods: { + createGeometry: function createGeometry() { + this.geometry = new ConeBufferGeometry(this.radius, this.height, this.radialSegments, this.heightSegments, this.openEnded, this.thetaStart, this.thetaLength); + }, + }, +}; + +var CylinderGeometry = { + extends: Geometry, + props: { + radiusTop: { type: Number, default: 1 }, + radiusBottom: { type: Number, default: 1 }, + height: { type: Number, default: 1 }, + radialSegments: { type: Number, default: 8 }, + heightSegments: { type: Number, default: 1 }, + openEnded: { type: Boolean, default: false }, + thetaStart: { type: Number, default: 0 }, + thetaLength: { type: Number, default: Math.PI * 2 }, + }, + methods: { + createGeometry: function createGeometry() { + this.geometry = new CylinderBufferGeometry(this.radiusTop, this.radiusBottom, this.height, this.radialSegments, this.heightSegments, this.openEnded, this.thetaStart, this.thetaLength); + }, + }, +}; + +var DodecahedronGeometry = { + extends: Geometry, + props: { + radius: { type: Number, default: 1 }, + detail: { type: Number, default: 0 }, + }, + methods: { + createGeometry: function createGeometry() { + this.geometry = new DodecahedronBufferGeometry(this.radius, this.detail); + }, + }, +}; + +var IcosahedronGeometry = { + extends: Geometry, + props: { + radius: { type: Number, default: 1 }, + detail: { type: Number, default: 0 }, + }, + methods: { + createGeometry: function createGeometry() { + this.geometry = new IcosahedronBufferGeometry(this.radius, this.detail); + }, + }, +}; + +var LatheGeometry = { + extends: Geometry, + props: { + points: Array, + segments: { type: Number, default: 12 }, + phiStart: { type: Number, default: 0 }, + phiLength: { type: Number, default: Math.PI * 2 }, + }, + methods: { + createGeometry: function createGeometry() { + this.geometry = new LatheBufferGeometry(this.points, this.segments, this.phiStart, this.phiLength); + }, + }, +}; + +var OctahedronGeometry = { + extends: Geometry, + props: { + radius: { type: Number, default: 1 }, + detail: { type: Number, default: 0 }, + }, + methods: { + createGeometry: function createGeometry() { + this.geometry = new OctahedronBufferGeometry(this.radius, this.detail); + }, + }, +}; + +var PolyhedronGeometry = { + extends: Geometry, + props: { + vertices: Array, + indices: Array, + radius: { type: Number, default: 1 }, + detail: { type: Number, default: 0 }, + }, + methods: { + createGeometry: function createGeometry() { + this.geometry = new PolyhedronBufferGeometry(this.vertices, this.indices, this.radius, this.detail); + }, + }, +}; + +var RingGeometry = { + extends: Geometry, + props: { + innerRadius: { type: Number, default: 0.5 }, + outerRadius: { type: Number, default: 1 }, + thetaSegments: { type: Number, default: 8 }, + phiSegments: { type: Number, default: 1 }, + thetaStart: { type: Number, default: 0 }, + thetaLength: { type: Number, default: Math.PI * 2 }, + }, + methods: { + createGeometry: function createGeometry() { + this.geometry = new RingBufferGeometry(this.innerRadius, this.outerRadius, this.thetaSegments, this.phiSegments, this.thetaStart, this.thetaLength); + }, }, }; var SphereGeometry = { extends: Geometry, props: { - radius: Number, - widthSegments: { - type: Number, - default: 12, - }, - heightSegments: { - type: Number, - default: 12, + radius: { type: Number, default: 1 }, + widthSegments: { type: Number, default: 12 }, + heightSegments: { type: Number, default: 12 }, + }, + methods: { + createGeometry: function createGeometry() { + this.geometry = new SphereBufferGeometry(this.radius, this.widthSegments, this.heightSegments); }, }, - mounted: function mounted() { - this.parent.geometry = new SphereBufferGeometry(this.radius, this.widthSegments, this.heightSegments); +}; + +var TetrahedronGeometry = { + extends: Geometry, + props: { + radius: { type: Number, default: 1 }, + detail: { type: Number, default: 0 }, + }, + methods: { + createGeometry: function createGeometry() { + this.geometry = new TetrahedronBufferGeometry(this.radius, this.detail); + }, + }, +}; + +var TorusGeometry = { + extends: Geometry, + props: { + radius: { type: Number, default: 1 }, + tube: { type: Number, default: 0.4 }, + radialSegments: { type: Number, default: 8 }, + tubularSegments: { type: Number, default: 6 }, + arc: { type: Number, default: Math.PI * 2 }, + }, + methods: { + createGeometry: function createGeometry() { + this.geometry = new TorusBufferGeometry(this.radius, this.tube, this.radialSegments, this.tubularSegments, this.arc); + }, + }, +}; + +var TorusKnotGeometry = { + extends: Geometry, + props: { + radius: { type: Number, default: 1 }, + tube: { type: Number, default: 0.4 }, + radialSegments: { type: Number, default: 64 }, + tubularSegments: { type: Number, default: 8 }, + p: { type: Number, default: 2 }, + q: { type: Number, default: 3 }, + }, + methods: { + createGeometry: function createGeometry() { + this.geometry = new TorusKnotBufferGeometry(this.radius, this.tube, this.radialSegments, this.tubularSegments, this.p, this.q); + }, + }, +}; + +var TubeGeometry = { + extends: Geometry, + props: { + path: Curve, + tubularSegments: { type: Number, default: 64 }, + radius: { type: Number, default: 1 }, + radiusSegments: { type: Number, default: 8 }, + closed: { type: Boolean, default: false }, + }, + methods: { + createGeometry: function createGeometry() { + this.geometry = new TubeBufferGeometry(this.path, this.tubularSegments, this.radius, this.radiusSegments, this.closed); + }, }, }; @@ -475,19 +889,39 @@ var Light = { position: Object, }, mounted: function mounted() { - setFromProp(this.light.position, this.position); + var this$1 = this; + + useBindProp(this, 'position', this.light.position); + + if (this.light.target) { + useBindProp(this, 'target', this.light.target.position); + } if (this.light.shadow) { this.light.castShadow = this.castShadow; setFromProp(this.light.shadow.mapSize, this.shadowMapSize); } + ['color', 'intensity', 'castShadow'].forEach(function (p) { + watch(function () { return this$1[p]; }, function () { + if (p === 'color') { + this$1.light.color = new Color(this$1.color); + } else { + this$1.light[p] = this$1[p]; + } + }); + }); + this.scene.add(this.light); if (this.light.target) { this.scene.add(this.light.target); } }, + unmounted: function unmounted() { + this.scene.remove(this.light); + }, render: function render() { return []; }, + __hmrId: 'Light', }; var AmbientLight = { @@ -495,6 +929,18 @@ var AmbientLight = { created: function created() { this.light = new AmbientLight$1(this.color, this.intensity); }, + __hmrId: 'AmbientLight', +}; + +var DirectionalLight = { + extends: Light, + props: { + target: Object, + }, + created: function created() { + this.light = new DirectionalLight$1(this.color, this.intensity); + }, + __hmrId: 'DirectionalLight', }; var PointLight = { @@ -512,278 +958,1061 @@ var PointLight = { created: function created() { this.light = new PointLight$1(this.color, this.intensity, this.distance, this.decay); }, + __hmrId: 'PointLight', }; var SpotLight = { extends: Light, props: { - distance: { - type: Number, - default: 0, - }, angle: { type: Number, default: Math.PI / 3, }, - penumbra: { - type: Number, - default: 0, - }, decay: { type: Number, default: 1, }, + distance: { + type: Number, + default: 0, + }, + penumbra: { + type: Number, + default: 0, + }, + target: Object, }, created: function created() { + var this$1 = this; + this.light = new SpotLight$1(this.color, this.intensity, this.distance, this.angle, this.penumbra, this.decay); + ['angle', 'decay', 'distance', 'penumbra'].forEach(function (p) { + watch(function () { return this$1[p]; }, function () { + this$1.light[p] = this$1[p]; + }); + }); }, + __hmrId: 'SpotLight', }; var Material = { - inject: ['three'], + inject: ['three', 'mesh'], props: { id: String, - color: { - type: [String, Number], - default: '#ffffff', - }, - depthTest: { - type: Boolean, - default: true, - }, - depthWrite: { - type: Boolean, - default: true, - }, - fog: { - type: Boolean, - default: false, - }, - opacity: { - type: Number, - default: 1, - }, - side: { - type: Number, - default: FrontSide, - }, - transparent: { - type: Boolean, - default: false, - }, - vertexColors: { - type: Boolean, - default: false, - }, + color: { type: [String, Number], default: '#ffffff' }, + depthTest: { type: Boolean, default: true }, + depthWrite: { type: Boolean, default: true }, + flatShading: Boolean, + fog: { type: Boolean, default: true }, + opacity: { type: Number, default: 1 }, + side: { type: Number, default: FrontSide }, + transparent: Boolean, + vertexColors: Boolean, + }, + provide: function provide() { + return { + material: this, + }; + }, + beforeMount: function beforeMount() { + this.createMaterial(); + if (this.id) { this.three.materials[this.id] = this.material; } + this.mesh.setMaterial(this.material); }, mounted: function mounted() { - this.three.materials[this.id] = this.material; + this._addWatchers(); + if (this.addWatchers) { this.addWatchers(); } }, unmounted: function unmounted() { this.material.dispose(); + if (this.id) { delete this.three.materials[this.id]; } }, methods: { - propsValues: function propsValues() { - var props = {}; - for (var [key, value] of Object.entries(this.$props)) { - if (key !== 'id') { props[key] = value; } - } - return props; + setMap: function setMap(texture) { + this.material.map = texture; + this.material.needsUpdate = true; + }, + setEnvMap: function setEnvMap(texture) { + this.material.envMap = texture; + this.material.needsUpdate = true; + }, + _addWatchers: function _addWatchers() { + var this$1 = this; + + // don't work for flatShading + ['color', 'depthTest', 'depthWrite', 'fog', 'opacity', 'side', 'transparent'].forEach(function (p) { + watch(function () { return this$1[p]; }, function () { + if (p === 'color') { + this$1.material.color.set(this$1.color); + } else { + this$1.material[p] = this$1[p]; + } + }); + }); }, }, render: function render() { + if (this.$slots.default) { + return this.$slots.default(); + } return []; }, + __hmrId: 'Material', }; var BasicMaterial = { extends: Material, - created: function created() { - this.material = new MeshBasicMaterial({ - color: this.color, - }); + methods: { + createMaterial: function createMaterial() { + this.material = new MeshBasicMaterial(propsValues(this.$props, ['id'])); + }, }, + __hmrId: 'BasicMaterial', }; var LambertMaterial = { extends: Material, - created: function created() { - this.material = new MeshLambertMaterial({ - color: this.color, - }); + methods: { + createMaterial: function createMaterial() { + this.material = new MeshLambertMaterial(propsValues(this.$props, ['id'])); + }, }, + __hmrId: 'LambertMaterial', }; var PhongMaterial = { extends: Material, - created: function created() { - this.material = new MeshPhongMaterial({ - color: this.color, - }); - }, -}; - -var PhysicalMaterial = { - extends: Material, - created: function created() { - this.material = new MeshPhysicalMaterial({ - color: this.color, - }); + methods: { + createMaterial: function createMaterial() { + this.material = new MeshPhongMaterial(propsValues(this.$props, ['id'])); + }, }, + __hmrId: 'PhongMaterial', }; var StandardMaterial = { extends: Material, props: { - emissive: { - type: [Number, String], - default: 0, + emissive: { type: [Number, String], default: 0 }, + emissiveIntensity: { type: Number, default: 1 }, + metalness: { type: Number, default: 0 }, + roughness: { type: Number, default: 1 }, + }, + methods: { + createMaterial: function createMaterial() { + this.material = new MeshStandardMaterial(propsValues(this.$props, ['id'])); }, - emissiveIntensity: { - type: Number, - default: 1, - }, - metalness: { - type: Number, - default: 0, - }, - roughness: { - type: Number, - default: 1, + addWatchers: function addWatchers() { + var this$1 = this; + + ['emissive', 'emissiveIntensity', 'metalness', 'roughness'].forEach(function (p) { + watch(function () { return this$1[p]; }, function (value) { + if (p === 'emissive') { + this$1.material.emissive = new Color(value); + } else { + this$1.material[p] = value; + } + }); + }); }, }, - created: function created() { - this.material = new MeshStandardMaterial(this.propsValues()); - }, + __hmrId: 'StandardMaterial', }; -var Mesh = { - inject: ['three', 'scene'], +var PhysicalMaterial = { + extends: StandardMaterial, + methods: { + createMaterial: function createMaterial() { + this.material = new MeshPhysicalMaterial(propsValues(this.$props, ['id'])); + }, + }, + __hmrId: 'PhysicalMaterial', +}; + +/** + * ------------------------------------------------------------------------------------------ + * Subsurface Scattering shader + * Based on three/examples/jsm/shaders/SubsurfaceScatteringShader.js + * Based on GDC 2011 – Approximating Translucency for a Fast, Cheap and Convincing Subsurface Scattering Look + * https://colinbarrebrisebois.com/2011/03/07/gdc-2011-approximating-translucency-for-a-fast-cheap-and-convincing-subsurface-scattering-look/ + *------------------------------------------------------------------------------------------ + */ + +function replaceAll(string, find, replace) { + return string.split(find).join(replace); +} + +var meshphongFragHead = ShaderChunk.meshphong_frag.slice(0, ShaderChunk.meshphong_frag.indexOf('void main() {')); +var meshphongFragBody = ShaderChunk.meshphong_frag.slice(ShaderChunk.meshphong_frag.indexOf('void main() {')); + +var SubsurfaceScatteringShader = { + + uniforms: UniformsUtils.merge([ + ShaderLib.phong.uniforms, + { + thicknessColor: { value: new Color(0x668597) }, + thicknessDistortion: { value: 0.1 }, + thicknessAmbient: { value: 0.0 }, + thicknessAttenuation: { value: 0.1 }, + thicknessPower: { value: 2.0 }, + thicknessScale: { value: 10.0 }, + } ]), + + vertexShader: ("\n #define USE_UV\n " + (ShaderChunk.meshphong_vert) + "\n "), + + fragmentShader: "\n #define USE_UV\n #define SUBSURFACE\n\n " + meshphongFragHead + "\n\n uniform float thicknessPower;\n uniform float thicknessScale;\n uniform float thicknessDistortion;\n uniform float thicknessAmbient;\n uniform float thicknessAttenuation;\n uniform vec3 thicknessColor;\n\n void RE_Direct_Scattering(const in IncidentLight directLight, const in vec2 uv, const in GeometricContext geometry, inout ReflectedLight reflectedLight) {\n #ifdef USE_COLOR\n vec3 thickness = vColor * thicknessColor;\n #else\n vec3 thickness = thicknessColor;\n #endif\n vec3 scatteringHalf = normalize(directLight.direction + (geometry.normal * thicknessDistortion));\n float scatteringDot = pow(saturate(dot(geometry.viewDir, -scatteringHalf)), thicknessPower) * thicknessScale;\n vec3 scatteringIllu = (scatteringDot + thicknessAmbient) * thickness;\n reflectedLight.directDiffuse += scatteringIllu * thicknessAttenuation * directLight.color;\n }\n " + meshphongFragBody.replace( + '#include ', + replaceAll( + ShaderChunk.lights_fragment_begin, + 'RE_Direct( directLight, geometry, material, reflectedLight );', + "\n RE_Direct( directLight, geometry, material, reflectedLight );\n #if defined( SUBSURFACE ) && defined( USE_UV )\n RE_Direct_Scattering(directLight, vUv, geometry, reflectedLight);\n #endif\n " + ) + ), +}; + +var ShaderMaterial = { + inject: ['three', 'mesh'], props: { - material: String, - position: Object, - rotation: Object, - scale: Object, - castShadow: { - type: Boolean, - default: false, - }, - receiveShadow: { - type: Boolean, - default: false, - }, + id: String, + uniforms: Object, + vertexShader: String, + fragmentShader: String, + }, + beforeMount: function beforeMount() { + this.createMaterial(); + if (this.id) { this.three.materials[this.id] = this.material; } + this.mesh.setMaterial(this.material); }, mounted: function mounted() { - this.mesh = new Mesh$1(this.geometry, this.three.materials[this.material]); - setFromProp(this.mesh.position, this.position); - setFromProp(this.mesh.rotation, this.rotation); - setFromProp(this.mesh.scale, this.scale); - this.mesh.castShadow = this.castShadow; - this.mesh.receiveShadow = this.receiveShadow; - this.scene.add(this.mesh); + if (this.addWatchers) { this.addWatchers(); } }, unmounted: function unmounted() { - this.geometry.dispose(); + this.material.dispose(); + if (this.id) { delete this.three.materials[this.id]; } }, render: function render() { return []; }, + __hmrId: 'ShaderMaterial', +}; + +var SubSurfaceMaterial = { + extends: ShaderMaterial, + props: { + diffuse: { type: String, default: '#ffffff' }, + thicknessColor: { type: String, default: '#ffffff' }, + thicknessDistortion: { type: Number, default: 0.4 }, + thicknessAmbient: { type: Number, default: 0.01 }, + thicknessAttenuation: { type: Number, default: 0.7 }, + thicknessPower: { type: Number, default: 2 }, + thicknessScale: { type: Number, default: 4 }, + transparent: { type: Boolean, default: false }, + opacity: { type: Number, default: 1 }, + vertexColors: { type: Boolean, default: false }, + }, + methods: { + createMaterial: function createMaterial() { + var params = SubsurfaceScatteringShader; + var uniforms = UniformsUtils.clone(params.uniforms); + Object.entries(this.$props).forEach(function (ref) { + var key = ref[0]; + var value = ref[1]; + + if (key === 'diffuse' || key === 'thicknessColor') { + value = new Color(value); + } + if (key !== 'id' && key !== 'transparent' && key !== 'vertexColors') { + uniforms[key].value = value; + } + }); + + this.material = new ShaderMaterial$1(Object.assign({}, params, + {uniforms: uniforms, + lights: true, + transparent: this.transparent, + vertexColors: this.vertexColors})); + }, + }, + __hmrId: 'SubSurfaceMaterial', +}; + +var ToonMaterial = { + extends: Material, + methods: { + createMaterial: function createMaterial() { + this.material = new MeshToonMaterial(propsValues(this.$props, ['id'])); + }, + }, + __hmrId: 'ToonMaterial', +}; + +var _Map = { + extends: Texture, + inject: ['material'], + created: function created() { + this.material.setMap(this.texture); + }, + unmounted: function unmounted() { + this.material.setMap(null); + }, + methods: { + refreshTexture: function refreshTexture() { + this.createTexture(); + this.material.setMap(this.texture); + }, + }, + __hmrId: 'Map', +}; + +var EnvMap = { + extends: CubeTexture, + inject: ['material'], + created: function created() { + this.material.setEnvMap(this.texture); + }, + unmounted: function unmounted() { + this.material.setEnvMap(null); + }, + methods: { + refreshTexture: function refreshTexture() { + this.createTexture(); + this.material.setEnvMap(this.texture); + }, + }, + __hmrId: 'EnvMap', +}; + +var Mesh = { + inject: ['three', 'scene', 'rendererComponent'], + emits: ['ready'], + props: { + materialId: String, + position: Object, + rotation: Object, + scale: Object, + castShadow: Boolean, + receiveShadow: Boolean, + }, + provide: function provide() { + return { + mesh: this, + }; + }, + mounted: function mounted() { + // console.log('Mesh mounted'); + if (this.geometry && !this.mesh) { this.initMesh(); } + }, + unmounted: function unmounted() { + // console.log('Mesh unmounted'); + if (this.mesh) { this.scene.remove(this.mesh); } + if (this.geometry) { this.geometry.dispose(); } + if (this.material && !this.materialId) { this.material.dispose(); } + }, + methods: { + initMesh: function initMesh() { + if (!this.material && this.materialId) { + this.material = this.three.materials[this.materialId]; + } + this.mesh = new Mesh$1(this.geometry, this.material); + this.bindProps(); + this.scene.add(this.mesh); + this.$emit('ready'); + }, + bindProps: function bindProps() { + var this$1 = this; + + useBindProp(this, 'position', this.mesh.position); + useBindProp(this, 'rotation', this.mesh.rotation); + useBindProp(this, 'scale', this.mesh.scale); + + ['castShadow', 'receiveShadow'].forEach(function (p) { + this$1.mesh[p] = this$1[p]; + watch(function () { return this$1[p]; }, function () { this$1.mesh[p] = this$1[p]; }); + }); + + watch(function () { return this$1.materialId; }, function () { + this$1.mesh.material = this$1.three.materials[this$1.materialId]; + }); + }, + setGeometry: function setGeometry(geometry) { + this.geometry = geometry; + if (this.mesh) { this.mesh.geometry = geometry; } + }, + setMaterial: function setMaterial(material) { + this.material = material; + if (this.mesh) { this.mesh.material = material; } + }, + refreshGeometry: function refreshGeometry() { + var oldGeo = this.geometry; + this.createGeometry(); + this.mesh.geometry = this.geometry; + oldGeo.dispose(); + }, + }, + render: function render() { + if (this.$slots.default) { + return this.$slots.default(); + } + return []; + }, + __hmrId: 'Mesh', }; var Box = { extends: Mesh, props: { - size: { - type: Number, - }, - width: { - type: Number, - default: 1, - }, - height: { - type: Number, - default: 1, - }, - depth: { - type: Number, - default: 1, - }, + size: Number, + width: { type: Number, default: 1 }, + height: { type: Number, default: 1 }, + depth: { type: Number, default: 1 }, + widthSegments: { type: Number, default: 1 }, + heightSegments: { type: Number, default: 1 }, + depthSegments: { type: Number, default: 1 }, }, created: function created() { - if (this.size) { - this.geometry = new BoxBufferGeometry(this.size, this.size, this.size); - } else { - this.geometry = new BoxBufferGeometry(this.width, this.height, this.depth); - } + var this$1 = this; + + this.createGeometry(); + + ['size', 'width', 'height', 'depth', 'widthSegments', 'heightSegments', 'depthSegments'].forEach(function (prop) { + watch(function () { return this$1[prop]; }, function () { + this$1.refreshGeometry(); + }); + }); }, + methods: { + createGeometry: function createGeometry() { + if (this.size) { + this.geometry = new BoxBufferGeometry(this.size, this.size, this.size); + } else { + this.geometry = new BoxBufferGeometry(this.width, this.height, this.depth); + } + }, + }, + __hmrId: 'Box', +}; + +var Circle = { + extends: Mesh, + props: { + radius: { type: Number, default: 1 }, + segments: { type: Number, default: 8 }, + thetaStart: { type: Number, default: 0 }, + thetaLength: { type: Number, default: Math.PI * 2 }, + }, + created: function created() { + var this$1 = this; + + this.createGeometry(); + + var watchProps = ['radius', 'segments', 'thetaStart', 'thetaLength']; + watchProps.forEach(function (prop) { + watch(function () { return this$1[prop]; }, function () { + this$1.refreshGeometry(); + }); + }); + }, + methods: { + createGeometry: function createGeometry() { + this.geometry = new CircleBufferGeometry(this.radius, this.segments, this.thetaStart, this.thetaLength); + }, + }, + __hmrId: 'Circle', +}; + +var Cone = { + extends: Mesh, + props: { + radius: { type: Number, default: 1 }, + height: { type: Number, default: 1 }, + radialSegments: { type: Number, default: 8 }, + heightSegments: { type: Number, default: 1 }, + openEnded: { type: Boolean, default: false }, + thetaStart: { type: Number, default: 0 }, + thetaLength: { type: Number, default: Math.PI * 2 }, + }, + created: function created() { + var this$1 = this; + + this.createGeometry(); + + var watchProps = ['radius', 'height', 'radialSegments', 'heightSegments', 'openEnded', 'thetaStart', 'thetaLength']; + watchProps.forEach(function (prop) { + watch(function () { return this$1[prop]; }, function () { + this$1.refreshGeometry(); + }); + }); + }, + methods: { + createGeometry: function createGeometry() { + this.geometry = new ConeBufferGeometry(this.radius, this.height, this.radialSegments, this.heightSegments, this.openEnded, this.thetaStart, this.thetaLength); + }, + }, + __hmrId: 'Cone', +}; + +var Cylinder = { + extends: Mesh, + props: { + radiusTop: { type: Number, default: 1 }, + radiusBottom: { type: Number, default: 1 }, + height: { type: Number, default: 1 }, + radialSegments: { type: Number, default: 8 }, + heightSegments: { type: Number, default: 1 }, + openEnded: { type: Boolean, default: false }, + thetaStart: { type: Number, default: 0 }, + thetaLength: { type: Number, default: Math.PI * 2 }, + }, + created: function created() { + var this$1 = this; + + this.createGeometry(); + + var watchProps = ['radiusTop', 'radiusBottom', 'height', 'radialSegments', 'heightSegments', 'openEnded', 'thetaStart', 'thetaLength']; + watchProps.forEach(function (prop) { + watch(function () { return this$1[prop]; }, function () { + this$1.refreshGeometry(); + }); + }); + }, + methods: { + createGeometry: function createGeometry() { + this.geometry = new CylinderBufferGeometry(this.radiusTop, this.radiusBottom, this.height, this.radialSegments, this.heightSegments, this.openEnded, this.thetaStart, this.thetaLength); + }, + }, + __hmrId: 'Cylinder', +}; + +var Dodecahedron = { + extends: Mesh, + props: { + radius: { type: Number, default: 1 }, + detail: { type: Number, default: 0 }, + }, + created: function created() { + var this$1 = this; + + this.createGeometry(); + + var watchProps = ['radius', 'detail']; + watchProps.forEach(function (prop) { + watch(function () { return this$1[prop]; }, function () { + this$1.refreshGeometry(); + }); + }); + }, + methods: { + createGeometry: function createGeometry() { + this.geometry = new DodecahedronBufferGeometry(this.radius, this.detail); + }, + }, + __hmrId: 'Dodecahedron', +}; + +var Icosahedron = { + extends: Mesh, + props: { + radius: { type: Number, default: 1 }, + detail: { type: Number, default: 0 }, + }, + created: function created() { + var this$1 = this; + + this.createGeometry(); + + var watchProps = ['radius', 'detail']; + watchProps.forEach(function (prop) { + watch(function () { return this$1[prop]; }, function () { + this$1.refreshGeometry(); + }); + }); + }, + methods: { + createGeometry: function createGeometry() { + this.geometry = new IcosahedronBufferGeometry(this.radius, this.detail); + }, + }, + __hmrId: 'Icosahedron', +}; + +var Lathe = { + extends: Mesh, + props: { + points: Array, + segments: { type: Number, default: 12 }, + phiStart: { type: Number, default: 0 }, + phiLength: { type: Number, default: Math.PI * 2 }, + }, + created: function created() { + var this$1 = this; + + this.createGeometry(); + + var watchProps = ['points', 'segments', 'phiStart', 'phiLength']; + watchProps.forEach(function (prop) { + watch(function () { return this$1[prop]; }, function () { + this$1.refreshGeometry(); + }); + }); + }, + methods: { + createGeometry: function createGeometry() { + this.geometry = new LatheBufferGeometry(this.points, this.segments, this.phiStart, this.phiLength); + }, + }, + __hmrId: 'Lathe', +}; + +var Octahedron = { + extends: Mesh, + props: { + radius: { type: Number, default: 1 }, + detail: { type: Number, default: 0 }, + }, + created: function created() { + var this$1 = this; + + this.createGeometry(); + + var watchProps = ['radius', 'detail']; + watchProps.forEach(function (prop) { + watch(function () { return this$1[prop]; }, function () { + this$1.refreshGeometry(); + }); + }); + }, + methods: { + createGeometry: function createGeometry() { + this.geometry = new OctahedronBufferGeometry(this.radius, this.detail); + }, + }, + __hmrId: 'Octahedron', }; var Plane = { extends: Mesh, props: { - width: { - type: Number, - default: 1, - }, - height: { - type: Number, - default: 1, - }, - widthSegments: { - type: Number, - default: 1, - }, - heightSegments: { - type: Number, - default: 1, - }, + width: { type: Number, default: 1 }, + height: { type: Number, default: 1 }, + widthSegments: { type: Number, default: 1 }, + heightSegments: { type: Number, default: 1 }, }, created: function created() { - this.geometry = new PlaneBufferGeometry(this.width, this.height, this.widthSegments, this.heightSegments); + var this$1 = this; + + this.createGeometry(); + + var watchProps = ['width', 'height', 'widthSegments', 'heightSegments']; + watchProps.forEach(function (prop) { + watch(function () { return this$1[prop]; }, function () { + this$1.refreshGeometry(); + }); + }); }, + methods: { + createGeometry: function createGeometry() { + this.geometry = new PlaneBufferGeometry(this.width, this.height, this.widthSegments, this.heightSegments); + }, + }, + __hmrId: 'Plane', +}; + +var Polyhedron = { + extends: Mesh, + props: { + vertices: Array, + indices: Array, + radius: { type: Number, default: 1 }, + detail: { type: Number, default: 0 }, + }, + created: function created() { + var this$1 = this; + + this.createGeometry(); + + var watchProps = ['vertices', 'indices', 'radius', 'detail']; + watchProps.forEach(function (prop) { + watch(function () { return this$1[prop]; }, function () { + this$1.refreshGeometry(); + }); + }); + }, + methods: { + createGeometry: function createGeometry() { + this.geometry = new PolyhedronBufferGeometry(this.vertices, this.indices, this.radius, this.detail); + }, + }, + __hmrId: 'Polyhedron', +}; + +var Ring = { + extends: Mesh, + props: { + innerRadius: { type: Number, default: 0.5 }, + outerRadius: { type: Number, default: 1 }, + thetaSegments: { type: Number, default: 8 }, + phiSegments: { type: Number, default: 1 }, + thetaStart: { type: Number, default: 0 }, + thetaLength: { type: Number, default: Math.PI * 2 }, + }, + created: function created() { + var this$1 = this; + + this.createGeometry(); + + var watchProps = ['innerRadius', 'outerRadius', 'thetaSegments', 'phiSegments', 'thetaStart', 'thetaLength']; + watchProps.forEach(function (prop) { + watch(function () { return this$1[prop]; }, function () { + this$1.refreshGeometry(); + }); + }); + }, + methods: { + createGeometry: function createGeometry() { + this.geometry = new RingBufferGeometry(this.innerRadius, this.outerRadius, this.thetaSegments, this.phiSegments, this.thetaStart, this.thetaLength); + }, + }, + __hmrId: 'Ring', }; var Sphere = { extends: Mesh, props: { radius: Number, - widthSegments: { - type: Number, - default: 12, - }, - heightSegments: { - type: Number, - default: 12, - }, + widthSegments: { type: Number, default: 12 }, + heightSegments: { type: Number, default: 12 }, + }, + watch: { + radius: function radius() { this.refreshGeometry(); }, + widthSegments: function widthSegments() { this.refreshGeometry(); }, + heightSegments: function heightSegments() { this.refreshGeometry(); }, }, created: function created() { - this.geometry = new SphereBufferGeometry(this.radius, this.widthSegments, this.heightSegments); + this.createGeometry(); }, + methods: { + createGeometry: function createGeometry() { + this.geometry = new SphereBufferGeometry(this.radius, this.widthSegments, this.heightSegments); + }, + }, + __hmrId: 'Sphere', +}; + +var Tetrahedron = { + extends: Mesh, + props: { + radius: { type: Number, default: 1 }, + detail: { type: Number, default: 0 }, + }, + created: function created() { + var this$1 = this; + + this.createGeometry(); + + var watchProps = ['radius', 'detail']; + watchProps.forEach(function (prop) { + watch(function () { return this$1[prop]; }, function () { + this$1.refreshGeometry(); + }); + }); + }, + methods: { + createGeometry: function createGeometry() { + this.geometry = new TetrahedronBufferGeometry(this.radius, this.detail); + }, + }, + __hmrId: 'Tetrahedron', +}; + +var TextProps = { + text: String, + fontSrc: String, + size: { type: Number, default: 80 }, + height: { type: Number, default: 5 }, + depth: { type: Number, default: 1 }, + curveSegments: { type: Number, default: 12 }, + bevelEnabled: { type: Boolean, default: false }, + bevelThickness: { type: Number, default: 10 }, + bevelSize: { type: Number, default: 8 }, + bevelOffset: { type: Number, default: 0 }, + bevelSegments: { type: Number, default: 5 }, + align: { type: [Boolean, String], default: false }, +}; + +var Text = { + extends: Mesh, + props: Object.assign({}, TextProps), + created: function created() { + var this$1 = this; + + // add watchers + var watchProps = [ + 'text', 'size', 'height', 'curveSegments', + 'bevelEnabled', 'bevelThickness', 'bevelSize', 'bevelOffset', 'bevelSegments', + 'align' ]; + watchProps.forEach(function (p) { + watch(function () { return this$1[p]; }, function () { + if (this$1.font) { this$1.refreshGeometry(); } + }); + }); + + var loader = new FontLoader(); + loader.load(this.fontSrc, function (font) { + this$1.font = font; + this$1.createGeometry(); + this$1.initMesh(); + }); + }, + methods: { + createGeometry: function createGeometry() { + this.geometry = new TextBufferGeometry(this.text, { + font: this.font, + size: this.size, + height: this.height, + depth: this.depth, + curveSegments: this.curveSegments, + bevelEnabled: this.bevelEnabled, + bevelThickness: this.bevelThickness, + bevelSize: this.bevelSize, + bevelOffset: this.bevelOffset, + bevelSegments: this.bevelSegments, + }); + + if (this.align === 'center') { + this.geometry.center(); + } + }, + }, +}; + +var Torus = { + extends: Mesh, + props: { + radius: { type: Number, default: 0.5 }, + tube: { type: Number, default: 0.4 }, + radialSegments: { type: Number, default: 8 }, + tubularSegments: { type: Number, default: 6 }, + arc: { type: Number, default: Math.PI * 2 }, + }, + created: function created() { + var this$1 = this; + + this.createGeometry(); + + var watchProps = ['radius', 'tube', 'radialSegments', 'tubularSegments', 'arc']; + watchProps.forEach(function (prop) { + watch(function () { return this$1[prop]; }, function () { + this$1.refreshGeometry(); + }); + }); + }, + methods: { + createGeometry: function createGeometry() { + this.geometry = new TorusBufferGeometry(this.radius, this.tube, this.radialSegments, this.tubularSegments, this.arc); + }, + }, + __hmrId: 'Torus', +}; + +var TorusKnot = { + extends: Mesh, + props: { + radius: { type: Number, default: 0.5 }, + tube: { type: Number, default: 0.4 }, + radialSegments: { type: Number, default: 64 }, + tubularSegments: { type: Number, default: 8 }, + p: { type: Number, default: 2 }, + q: { type: Number, default: 3 }, + }, + created: function created() { + var this$1 = this; + + this.createGeometry(); + + var watchProps = ['radius', 'tube', 'radialSegments', 'tubularSegments', 'p', 'q']; + watchProps.forEach(function (prop) { + watch(function () { return this$1[prop]; }, function () { + this$1.refreshGeometry(); + }); + }); + }, + methods: { + createGeometry: function createGeometry() { + this.geometry = new TorusKnotBufferGeometry(this.radius, this.tube, this.radialSegments, this.tubularSegments, this.p, this.q); + }, + }, + __hmrId: 'TorusKnot', +}; + +var Tube = { + extends: Mesh, + props: { + path: Curve, + tubularSegments: { type: Number, default: 64 }, + radius: { type: Number, default: 1 }, + radialSegments: { type: Number, default: 8 }, + closed: { type: Boolean, default: false }, + }, + created: function created() { + var this$1 = this; + + this.createGeometry(); + + var watchProps = ['path', 'tubularSegments', 'radius', 'radialSegments', 'closed']; + watchProps.forEach(function (prop) { + watch(function () { return this$1[prop]; }, function () { + this$1.refreshGeometry(); + }); + }); + }, + methods: { + createGeometry: function createGeometry() { + this.geometry = new TubeBufferGeometry(this.path, this.tubularSegments, this.radius, this.radialSegments, this.closed); + }, + }, + __hmrId: 'Tube', +}; + +var Gem = { + extends: Mesh, + props: { + cubeRTSize: { type: Number, default: 512 }, + cubeCameraNear: { type: Number, default: 0.1 }, + cubeCameraFar: { type: Number, default: 2000 }, + autoUpdate: Boolean, + }, + mounted: function mounted() { + this.initGem(); + if (this.autoUpdate) { this.three.onBeforeRender(this.updateCubeRT); } + else { this.rendererComponent.onMounted(this.updateCubeRT); } + }, + unmounted: function unmounted() { + this.three.offBeforeRender(this.updateCubeRT); + if (this.meshBack) { this.scene.remove(this.meshBack); } + if (this.materialBack) { this.materialBack.dispose(); } + }, + methods: { + initGem: function initGem() { + var cubeRT = new WebGLCubeRenderTarget(this.cubeRTSize, { format: RGBFormat, generateMipmaps: true, minFilter: LinearMipmapLinearFilter }); + this.cubeCamera = new CubeCamera(this.cubeCameraNear, this.cubeCameraFar, cubeRT); + useBindProp(this, 'position', this.cubeCamera.position); + this.scene.add(this.cubeCamera); + + this.material.side = FrontSide; + this.material.envMap = cubeRT.texture; + this.material.envMapIntensity = 10; + this.material.metalness = 0; + this.material.roughness = 0; + this.material.opacity = 0.75; + this.material.transparent = true; + this.material.premultipliedAlpha = true; + this.material.needsUpdate = true; + + this.materialBack = this.material.clone(); + this.materialBack.side = BackSide; + this.materialBack.envMapIntensity = 5; + this.materialBack.metalness = 1; + this.materialBack.roughness = 0; + this.materialBack.opacity = 0.5; + + this.meshBack = new Mesh$1(this.geometry, this.materialBack); + + useBindProp(this, 'position', this.meshBack.position); + useBindProp(this, 'rotation', this.meshBack.rotation); + useBindProp(this, 'scale', this.meshBack.scale); + this.scene.add(this.meshBack); + }, + updateCubeRT: function updateCubeRT() { + this.mesh.visible = false; + this.meshBack.visible = false; + this.cubeCamera.update(this.three.renderer, this.scene); + this.mesh.visible = true; + this.meshBack.visible = true; + }, + }, + __hmrId: 'Gem', +}; + +var Image = { + emits: ['loaded'], + extends: Mesh, + props: { + src: String, + width: Number, + height: Number, + keepSize: Boolean, + }, + created: function created() { + var this$1 = this; + + this.createGeometry(); + this.createMaterial(); + this.initMesh(); + + watch(function () { return this$1.src; }, this.refreshTexture); + + ['width', 'height'].forEach(function (p) { + watch(function () { return this$1[p]; }, this$1.resize); + }); + + if (this.keepSize) { this.three.onAfterResize(this.resize); } + }, + methods: { + createGeometry: function createGeometry() { + this.geometry = new PlaneBufferGeometry(1, 1, 1, 1); + }, + createMaterial: function createMaterial() { + this.material = new MeshBasicMaterial({ side: DoubleSide, map: this.loadTexture() }); + }, + loadTexture: function loadTexture() { + return new TextureLoader().load(this.src, this.onLoaded); + }, + refreshTexture: function refreshTexture() { + if (this.texture) { this.texture.dispose(); } + this.material.map = this.loadTexture(); + this.material.needsUpdate = true; + }, + onLoaded: function onLoaded(texture) { + this.texture = texture; + this.resize(); + this.$emit('loaded'); + }, + resize: function resize() { + if (!this.texture) { return; } + var screen = this.three.size; + var iW = this.texture.image.width; + var iH = this.texture.image.height; + var iRatio = iW / iH; + var w, h; + if (this.width && this.height) { + w = this.width * screen.wWidth / screen.width; + h = this.height * screen.wHeight / screen.height; + } else if (this.width) { + w = this.width * screen.wWidth / screen.width; + h = w / iRatio; + } else if (this.height) { + h = this.height * screen.wHeight / screen.height; + w = h * iRatio; + } + this.mesh.scale.x = w; + this.mesh.scale.y = h; + }, + }, + __hmrId: 'Image', }; var InstancedMesh = { inject: ['three', 'scene'], props: { - material: String, + materialId: String, count: Number, position: Object, - castShadow: { - type: Boolean, - default: false, - }, - receiveShadow: { - type: Boolean, - default: false, - }, - }, - setup: function setup() { - return { - conf: {}, - }; + castShadow: Boolean, + receiveShadow: Boolean, }, provide: function provide() { return { - parent: this.conf, + mesh: this, }; }, beforeMount: function beforeMount() { @@ -792,15 +2021,181 @@ var InstancedMesh = { } }, mounted: function mounted() { - this.mesh = new InstancedMesh$1(this.conf.geometry, this.three.materials[this.material], this.count); - setFromProp(this.mesh.position, this.position); - this.mesh.castShadow = this.castShadow; - this.mesh.receiveShadow = this.receiveShadow; - this.scene.add(this.mesh); + this.initMesh(); + }, + unmounted: function unmounted() { + this.scene.remove(this.mesh); + }, + methods: { + initMesh: function initMesh() { + var this$1 = this; + + if (!this.material && this.materialId) { + this.material = this.three.materials[this.materialId]; + } + + this.mesh = new InstancedMesh$1(this.geometry, this.material, this.count); + + useBindProp(this, 'position', this.mesh.position); + useBindProp(this, 'rotation', this.mesh.rotation); + useBindProp(this, 'scale', this.mesh.scale); + + ['castShadow', 'receiveShadow'].forEach(function (p) { + this$1.mesh[p] = this$1[p]; + watch(function () { return this$1[p]; }, function () { this$1.mesh[p] = this$1[p]; }); + }); + + // watch(() => this.materialId, () => { + // this.mesh.material = this.three.materials[this.materialId]; + // }); + + this.scene.add(this.mesh); + }, + setGeometry: function setGeometry(geometry) { + this.geometry = geometry; + if (this.mesh) { this.mesh.geometry = geometry; } + }, + setMaterial: function setMaterial(material) { + this.material = material; + if (this.mesh) { this.mesh.material = material; } + }, }, render: function render() { return this.$slots.default(); }, + __hmrId: 'InstancedMesh', +}; + +var MirrorMesh = { + extends: Mesh, + props: { + cubeRTSize: { type: Number, default: 512 }, + cubeCameraNear: { type: Number, default: 0.1 }, + cubeCameraFar: { type: Number, default: 2000 }, + autoUpdate: Boolean, + }, + mounted: function mounted() { + this.initMirrorMesh(); + if (this.autoUpdate) { this.three.onBeforeRender(this.updateCubeRT); } + else { this.rendererComponent.onMounted(this.updateCubeRT); } + }, + unmounted: function unmounted() { + this.three.offBeforeRender(this.updateCubeRT); + }, + methods: { + initMirrorMesh: function initMirrorMesh() { + var cubeRT = new WebGLCubeRenderTarget(this.cubeRTSize, { format: RGBFormat, generateMipmaps: true, minFilter: LinearMipmapLinearFilter }); + this.cubeCamera = new CubeCamera(this.cubeCameraNear, this.cubeCameraFar, cubeRT); + useBindProp(this, 'position', this.cubeCamera.position); + this.scene.add(this.cubeCamera); + + this.material.envMap = cubeRT.texture; + this.material.needsUpdate = true; + }, + updateCubeRT: function updateCubeRT() { + this.mesh.visible = false; + this.cubeCamera.update(this.three.renderer, this.scene); + this.mesh.visible = true; + }, + }, + __hmrId: 'MirrorMesh', +}; + +var RefractionMesh = { + extends: Mesh, + props: { + cubeRTSize: { type: Number, default: 512 }, + cubeCameraNear: { type: Number, default: 0.1 }, + cubeCameraFar: { type: Number, default: 2000 }, + autoUpdate: Boolean, + }, + mounted: function mounted() { + this.initMirrorMesh(); + if (this.autoUpdate) { this.three.onBeforeRender(this.updateCubeRT); } + else { this.rendererComponent.onMounted(this.updateCubeRT); } + }, + unmounted: function unmounted() { + this.three.offBeforeRender(this.updateCubeRT); + }, + methods: { + initMirrorMesh: function initMirrorMesh() { + var cubeRT = new WebGLCubeRenderTarget(this.cubeRTSize, { mapping: CubeRefractionMapping, format: RGBFormat, generateMipmaps: true, minFilter: LinearMipmapLinearFilter }); + this.cubeCamera = new CubeCamera(this.cubeCameraNear, this.cubeCameraFar, cubeRT); + useBindProp(this, 'position', this.cubeCamera.position); + this.scene.add(this.cubeCamera); + + this.material.envMap = cubeRT.texture; + this.material.refractionRatio = 0.95; + this.material.needsUpdate = true; + }, + updateCubeRT: function updateCubeRT() { + this.mesh.visible = false; + this.cubeCamera.update(this.three.renderer, this.scene); + this.mesh.visible = true; + }, + }, + __hmrId: 'RefractionMesh', +}; + +var Sprite = { + emits: ['ready', 'loaded'], + inject: ['three', 'scene'], + props: { + src: String, + position: Object, + scale: Object, + }, + mounted: function mounted() { + this.texture = new TextureLoader().load(this.src, this.onLoaded); + this.material = new SpriteMaterial({ map: this.texture }); + this.sprite = new Sprite$1(this.material); + this.geometry = this.sprite.geometry; + + useBindProp(this, 'position', this.sprite.position); + useBindProp(this, 'scale', this.sprite.scale); + + // watch(() => this.src, () => { + // this.texture = new TextureLoader().load(this.src, this.onLoaded); + // this.material.map = this.texture; + // }); + + this.scene.add(this.sprite); + this.$emit('ready'); + }, + unmounted: function unmounted() { + this.texture.dispose(); + this.material.dispose(); + this.scene.remove(this.sprite); + }, + methods: { + onLoaded: function onLoaded() { + this.updateUV(); + this.$emit('loaded'); + }, + updateUV: function updateUV() { + this.iWidth = this.texture.image.width; + this.iHeight = this.texture.image.height; + this.iRatio = this.iWidth / this.iHeight; + + var x = 0.5, y = 0.5; + if (this.iRatio > 1) { + y = 0.5 / this.iRatio; + } else { + x = 0.5 / this.iRatio; + } + + var positions = this.geometry.attributes.position.array; + positions[0] = -x; positions[1] = -y; + positions[5] = x; positions[6] = -y; + positions[10] = x; positions[11] = y; + positions[15] = -x; positions[16] = y; + this.geometry.attributes.position.needsUpdate = true; + }, + }, + render: function render() { + return []; + }, + __hmrId: 'Sprite', }; var EffectComposer = { @@ -820,6 +2215,7 @@ var EffectComposer = { this.three.onAfterInit(function () { this$1.composer = new EffectComposer$1(this$1.three.renderer); + this$1.three.renderer.autoClear = false; this$1.passes.forEach(function (pass) { this$1.composer.addPass(pass); }); @@ -829,6 +2225,7 @@ var EffectComposer = { render: function render() { return this.$slots.default(); }, + __hmrId: 'EffectComposer', }; var EffectPass = { @@ -838,9 +2235,13 @@ var EffectPass = { console.error('Missing parent EffectComposer'); } }, + unmounted: function unmounted() { + if (this.pass.dispose) { this.pass.dispose(); } + }, render: function render() { return []; }, + __hmrId: 'EffectPass', }; var RenderPass = { @@ -856,6 +2257,7 @@ var RenderPass = { this.passes.push(pass); this.pass = pass; }, + __hmrId: 'RenderPass', }; var BokehPass = { @@ -874,17 +2276,11 @@ var BokehPass = { default: 0.01, }, }, - // watch: { - // focus() { - // this.pass.focus = this.focus; - // }, - // aperture() { - // this.pass.aperture = this.aperture; - // }, - // maxblur() { - // this.pass.maxblur = this.maxblur; - // }, - // }, + watch: { + focus: function focus() { this.pass.uniforms.focus.value = this.focus; }, + aperture: function aperture() { this.pass.uniforms.aperture.value = this.aperture; }, + maxblur: function maxblur() { this.pass.uniforms.maxblur.value = this.maxblur; }, + }, mounted: function mounted() { if (!this.three.scene) { console.error('Missing Scene'); @@ -903,42 +2299,898 @@ var BokehPass = { this.passes.push(pass); this.pass = pass; }, + __hmrId: 'BokehPass', +}; + +var FilmPass = { + extends: EffectPass, + props: { + noiseIntensity: { + type: Number, + default: 0.5, + }, + scanlinesIntensity: { + type: Number, + default: 0.05, + }, + scanlinesCount: { + type: Number, + default: 4096, + }, + grayscale: { + type: Number, + default: 0, + }, + }, + watch: { + noiseIntensity: function noiseIntensity() { this.pass.uniforms.nIntensity.value = this.noiseIntensity; }, + scanlinesIntensity: function scanlinesIntensity() { this.pass.uniforms.sIntensity.value = this.scanlinesIntensity; }, + scanlinesCount: function scanlinesCount() { this.pass.uniforms.sCount.value = this.scanlinesCount; }, + grayscale: function grayscale() { this.pass.uniforms.grayscale.value = this.grayscale; }, + }, + mounted: function mounted() { + var pass = new FilmPass$1(this.noiseIntensity, this.scanlinesIntensity, this.scanlinesCount, this.grayscale); + this.passes.push(pass); + this.pass = pass; + }, + __hmrId: 'FilmPass', +}; + +var HalftonePass = { + extends: EffectPass, + props: { + shape: { type: Number, default: 1 }, + radius: { type: Number, default: 4 }, + rotateR: { type: Number, default: Math.PI / 12 * 1 }, + rotateG: { type: Number, default: Math.PI / 12 * 2 }, + rotateB: { type: Number, default: Math.PI / 12 * 3 }, + scatter: { type: Number, default: 0 }, + }, + mounted: function mounted() { + var this$1 = this; + + var pass = new HalftonePass$1(this.three.size.width, this.three.size.height, {}); + + ['shape', 'radius', 'rotateR', 'rotateG', 'rotateB', 'scatter'].forEach(function (p) { + pass.uniforms[p].value = this$1[p]; + watch(function () { return this$1[p]; }, function () { + pass.uniforms[p].value = this$1[p]; + }); + }); + + this.passes.push(pass); + this.pass = pass; + }, + __hmrId: 'HalftonePass', +}; + +var SAOPass = { + extends: EffectPass, + props: { + depthTexture: { type: Boolean, default: false }, + useNormals: { type: Boolean, default: false }, + resolution: Object, + }, + mounted: function mounted() { + if (!this.three.scene) { + console.error('Missing Scene'); + } + if (!this.three.camera) { + console.error('Missing Camera'); + } + + var resolution = this.resolution ? new Vector2(this.resolution.x, this.resolution.y) : new Vector2(this.three.size.width, this.three.size.height); + var pass = new SAOPass$1(this.three.scene, this.three.camera, this.depthTexture, this.useNormals, resolution); + this.passes.push(pass); + this.pass = pass; + }, + __hmrId: 'SAOPass', }; var UnrealBloomPass = { extends: EffectPass, props: { - strength: { - type: Number, - default: 1.5, - }, - radius: { - type: Number, - default: 0, - }, - threshold: { - type: Number, - default: 0, - }, + strength: { type: Number, default: 1.5 }, + radius: { type: Number, default: 0 }, + threshold: { type: Number, default: 0 }, + }, + watch: { + strength: function strength() { this.pass.strength = this.strength; }, + radius: function radius() { this.pass.radius = this.radius; }, + threshold: function threshold() { this.pass.threshold = this.threshold; }, }, - // watch: { - // strength() { - // this.pass.strength = this.strength; - // }, - // radius() { - // this.pass.strength = this.radius; - // }, - // threshold() { - // this.pass.strength = this.threshold; - // }, - // }, mounted: function mounted() { var size = new Vector2(this.three.size.width, this.three.size.height); var pass = new UnrealBloomPass$1(size, this.strength, this.radius, this.threshold); this.passes.push(pass); this.pass = pass; }, + __hmrId: 'UnrealBloomPass', }; -export { AmbientLight, BasicMaterial, BokehPass, Box, BoxGeometry, PerspectiveCamera as Camera, EffectComposer, InstancedMesh, LambertMaterial, PerspectiveCamera, PhongMaterial, PhysicalMaterial, Plane, PointLight, RenderPass, Renderer, Scene, Sphere, SphereGeometry, SpotLight, StandardMaterial, UnrealBloomPass, lerp, lerpv3, setFromProp }; +var snoise2 = "\n//\n// Description : Array and textureless GLSL 2D simplex noise function.\n// Author : Ian McEwan, Ashima Arts.\n// Maintainer : ijm\n// Lastmod : 20110822 (ijm)\n// License : Copyright (C) 2011 Ashima Arts. All rights reserved.\n// Distributed under the MIT License. See LICENSE file.\n// https://github.com/ashima/webgl-noise\n//\n\nvec3 mod289(vec3 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec2 mod289(vec2 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec3 permute(vec3 x) {\n return mod289(((x*34.0)+1.0)*x);\n}\n\nfloat snoise(vec2 v)\n{\n const vec4 C = vec4(0.211324865405187, // (3.0-sqrt(3.0))/6.0\n 0.366025403784439, // 0.5*(sqrt(3.0)-1.0)\n -0.577350269189626, // -1.0 + 2.0 * C.x\n 0.024390243902439); // 1.0 / 41.0\n // First corner\n vec2 i = floor(v + dot(v, C.yy) );\n vec2 x0 = v - i + dot(i, C.xx);\n\n // Other corners\n vec2 i1;\n i1 = (x0.x > x0.y) ? vec2(1.0, 0.0) : vec2(0.0, 1.0);\n vec4 x12 = x0.xyxy + C.xxzz;\n x12.xy -= i1;\n\n // Permutations\n i = mod289(i); // Avoid truncation effects in permutation\n vec3 p = permute( permute( i.y + vec3(0.0, i1.y, 1.0 ))\n + i.x + vec3(0.0, i1.x, 1.0 ));\n\n vec3 m = max(0.5 - vec3(dot(x0,x0), dot(x12.xy,x12.xy), dot(x12.zw,x12.zw)), 0.0);\n m = m*m ;\n m = m*m ;\n\n // Gradients: 41 points uniformly over a line, mapped onto a diamond.\n // The ring size 17*17 = 289 is close to a multiple of 41 (41*7 = 287)\n\n vec3 x = 2.0 * fract(p * C.www) - 1.0;\n vec3 h = abs(x) - 0.5;\n vec3 ox = floor(x + 0.5);\n vec3 a0 = x - ox;\n\n // Normalise gradients implicitly by scaling m\n // Approximation of: m *= inversesqrt( a0*a0 + h*h );\n m *= 1.79284291400159 - 0.85373472095314 * ( a0*a0 + h*h );\n\n // Compute final noise value at P\n vec3 g;\n g.x = a0.x * x0.x + h.x * x0.y;\n g.yz = a0.yz * x12.xz + h.yz * x12.yw;\n return 130.0 * dot(m, g);\n}\n"; + +var NoisyImage = { + extends: Image, + props: { + widthSegments: { type: Number, default: 20 }, + heightSegments: { type: Number, default: 20 }, + timeCoef: { type: Number, default: 0.001 }, + noiseCoef: { type: Number, default: 1 }, + zCoef: { type: Number, default: 5 }, + dispCoef: { type: Number, default: 0.05 }, + }, + setup: function setup(props) { + // uniforms + var uTime = { value: 0 }; + var uNoiseCoef = { value: props.noiseCoef }; + watch(function () { return props.noiseCoef; }, function (value) { uNoiseCoef.value = value; }); + var uZCoef = { value: props.zCoef }; + watch(function () { return props.zCoef; }, function (value) { uZCoef.value = value; }); + var uDispCoef = { value: props.dispCoef }; + watch(function () { return props.dispCoef; }, function (value) { uDispCoef.value = value; }); + + return { + uTime: uTime, uNoiseCoef: uNoiseCoef, uZCoef: uZCoef, uDispCoef: uDispCoef, + }; + }, + mounted: function mounted() { + this.startTime = Date.now(); + this.three.onBeforeRender(this.updateTime); + }, + unmounted: function unmounted() { + this.three.offBeforeRender(this.updateTime); + }, + methods: { + createGeometry: function createGeometry() { + this.geometry = new PlaneBufferGeometry(1, 1, this.widthSegments, this.heightSegments); + }, + createMaterial: function createMaterial() { + var this$1 = this; + + this.material = new MeshBasicMaterial({ side: DoubleSide, map: this.loadTexture() }); + this.material.onBeforeCompile = function (shader) { + shader.uniforms.uTime = this$1.uTime; + shader.uniforms.uNoiseCoef = this$1.uNoiseCoef; + shader.uniforms.uZCoef = this$1.uZCoef; + shader.uniforms.uDispCoef = this$1.uDispCoef; + shader.vertexShader = "\n uniform float uTime;\n uniform float uNoiseCoef;\n uniform float uZCoef;\n varying float vNoise;\n " + snoise2 + "\n " + shader.vertexShader; + + shader.vertexShader = shader.vertexShader.replace( + '#include ', + " \n vec3 p = vec3(position * uNoiseCoef);\n p.x += uTime;\n vNoise = snoise(p.xy);\n vec3 transformed = vec3(position);\n transformed.z += vNoise * uZCoef;\n " + ); + + shader.fragmentShader = "\n uniform float uDispCoef;\n varying float vNoise;\n " + shader.fragmentShader; + + shader.fragmentShader = shader.fragmentShader.replace( + '#include ', + "\n vec4 texelColor = texture2D(map, vUv);\n vec4 dispTexel = texture2D(map, vUv + vec2(vNoise * uDispCoef, 0));\n texelColor.r = dispTexel.r;\n diffuseColor = texelColor;\n " + ); + this$1.materialShader = shader; + }; + }, + updateTime: function updateTime() { + this.uTime.value = (Date.now() - this.startTime) * this.timeCoef; + }, + }, + __hmrId: 'NoisyImage', +}; + +var snoise3 = "\n//\n// Description : Array and textureless GLSL 2D/3D/4D simplex\n// noise functions.\n// Author : Ian McEwan, Ashima Arts.\n// Maintainer : ijm\n// Lastmod : 20110822 (ijm)\n// License : Copyright (C) 2011 Ashima Arts. All rights reserved.\n// Distributed under the MIT License. See LICENSE file.\n// https://github.com/ashima/webgl-noise\n//\n\nvec3 mod289(vec3 x) { return x - floor(x * (1.0 / 289.0)) * 289.0; }\nvec4 mod289(vec4 x) { return x - floor(x * (1.0 / 289.0)) * 289.0; }\nvec4 permute(vec4 x) { return mod289(((x*34.0)+1.0)*x); }\nvec4 taylorInvSqrt(vec4 r) { return 1.79284291400159 - 0.85373472095314 * r; }\n\nfloat snoise(vec3 v)\n{\n const vec2 C = vec2(1.0/6.0, 1.0/3.0) ;\n const vec4 D = vec4(0.0, 0.5, 1.0, 2.0);\n\n // First corner\n vec3 i = floor(v + dot(v, C.yyy) );\n vec3 x0 = v - i + dot(i, C.xxx) ;\n\n // Other corners\n vec3 g = step(x0.yzx, x0.xyz);\n vec3 l = 1.0 - g;\n vec3 i1 = min( g.xyz, l.zxy );\n vec3 i2 = max( g.xyz, l.zxy );\n\n vec3 x1 = x0 - i1 + C.xxx;\n vec3 x2 = x0 - i2 + C.yyy; // 2.0*C.x = 1/3 = C.y\n vec3 x3 = x0 - D.yyy; // -1.0+3.0*C.x = -0.5 = -D.y\n\n // Permutations\n i = mod289(i);\n vec4 p = permute( permute( permute(\n i.z + vec4(0.0, i1.z, i2.z, 1.0 ))\n + i.y + vec4(0.0, i1.y, i2.y, 1.0 ))\n + i.x + vec4(0.0, i1.x, i2.x, 1.0 ));\n\n // Gradients: 7x7 points over a square, mapped onto an octahedron.\n // The ring size 17*17 = 289 is close to a multiple of 49 (49*6 = 294)\n float n_ = 0.142857142857; // 1.0/7.0\n vec3 ns = n_ * D.wyz - D.xzx;\n\n vec4 j = p - 49.0 * floor(p * ns.z * ns.z); // mod(p,7*7)\n\n vec4 x_ = floor(j * ns.z);\n vec4 y_ = floor(j - 7.0 * x_ ); // mod(j,N)\n\n vec4 x = x_ *ns.x + ns.yyyy;\n vec4 y = y_ *ns.x + ns.yyyy;\n vec4 h = 1.0 - abs(x) - abs(y);\n\n vec4 b0 = vec4( x.xy, y.xy );\n vec4 b1 = vec4( x.zw, y.zw );\n\n vec4 s0 = floor(b0)*2.0 + 1.0;\n vec4 s1 = floor(b1)*2.0 + 1.0;\n vec4 sh = -step(h, vec4(0.0));\n\n vec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy ;\n vec4 a1 = b1.xzyw + s1.xzyw*sh.zzww ;\n\n vec3 p0 = vec3(a0.xy,h.x);\n vec3 p1 = vec3(a0.zw,h.y);\n vec3 p2 = vec3(a1.xy,h.z);\n vec3 p3 = vec3(a1.zw,h.w);\n\n // Normalise gradients\n vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3)));\n p0 *= norm.x;\n p1 *= norm.y;\n p2 *= norm.z;\n p3 *= norm.w;\n\n // Mix final noise value\n vec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.0);\n m = m * m;\n return 42.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1),\n dot(p2,x2), dot(p3,x3) ) );\n}\n"; + +var NoisyPlane = { + extends: Plane, + props: { + timeCoef: { type: Number, default: 0.001 }, + noiseCoef: { type: Number, default: 1 }, + zCoef: { type: Number, default: 5 }, + }, + setup: function setup(props) { + // uniforms + var uTime = { value: 0 }; + var uNoiseCoef = { value: props.noiseCoef }; + watch(function () { return props.noiseCoef; }, function (value) { uNoiseCoef.value = value; }); + var uZCoef = { value: props.zCoef }; + watch(function () { return props.zCoef; }, function (value) { uZCoef.value = value; }); + + return { + uTime: uTime, uNoiseCoef: uNoiseCoef, uZCoef: uZCoef, + }; + }, + mounted: function mounted() { + this.updateMaterial(); + this.startTime = Date.now(); + this.three.onBeforeRender(this.updateTime); + }, + unmounted: function unmounted() { + this.three.offBeforeRender(this.updateTime); + }, + methods: { + updateMaterial: function updateMaterial() { + var this$1 = this; + + this.material.onBeforeCompile = function (shader) { + shader.uniforms.uTime = this$1.uTime; + shader.uniforms.uNoiseCoef = this$1.uNoiseCoef; + shader.uniforms.uZCoef = this$1.uZCoef; + shader.vertexShader = "\n uniform float uTime;\n uniform float uNoiseCoef;\n uniform float uZCoef;\n varying float vNoise;\n " + snoise3 + "\n " + shader.vertexShader; + + shader.vertexShader = shader.vertexShader.replace( + '#include ', + " \n vec3 p = vec3(position * uNoiseCoef);\n vNoise = snoise(vec3(p.x, p.y, uTime));\n vec3 transformed = vec3(position);\n transformed.z += vNoise * uZCoef;\n " + ); + this$1.materialShader = shader; + }; + this.material.needsupdate = true; + }, + updateTime: function updateTime() { + this.uTime.value = (Date.now() - this.startTime) * this.timeCoef; + }, + }, + __hmrId: 'NoisyPlane', +}; + +var snoise4 = "\n//\n// Description : Array and textureless GLSL 2D/3D/4D simplex\n// noise functions.\n// Author : Ian McEwan, Ashima Arts.\n// Maintainer : ijm\n// Lastmod : 20110822 (ijm)\n// License : Copyright (C) 2011 Ashima Arts. All rights reserved.\n// Distributed under the MIT License. See LICENSE file.\n// https://github.com/ashima/webgl-noise\n//\n\nvec4 mod289(vec4 x) { return x - floor(x * (1.0 / 289.0)) * 289.0; }\nfloat mod289(float x) { return x - floor(x * (1.0 / 289.0)) * 289.0; }\nvec4 permute(vec4 x) { return mod289(((x*34.0)+1.0)*x); }\nfloat permute(float x) { return mod289(((x*34.0)+1.0)*x); }\nvec4 taylorInvSqrt(vec4 r) { return 1.79284291400159 - 0.85373472095314 * r; }\nfloat taylorInvSqrt(float r) { return 1.79284291400159 - 0.85373472095314 * r; }\n\nvec4 grad4(float j, vec4 ip)\n{\n const vec4 ones = vec4(1.0, 1.0, 1.0, -1.0);\n vec4 p,s;\n\n p.xyz = floor( fract (vec3(j) * ip.xyz) * 7.0) * ip.z - 1.0;\n p.w = 1.5 - dot(abs(p.xyz), ones.xyz);\n s = vec4(lessThan(p, vec4(0.0)));\n p.xyz = p.xyz + (s.xyz*2.0 - 1.0) * s.www;\n\n return p;\n}\n\n// (sqrt(5) - 1)/4 = F4, used once below\n#define F4 0.309016994374947451\n\nfloat snoise(vec4 v)\n{\n const vec4 C = vec4( 0.138196601125011, // (5 - sqrt(5))/20 G4\n 0.276393202250021, // 2 * G4\n 0.414589803375032, // 3 * G4\n -0.447213595499958); // -1 + 4 * G4\n\n // First corner\n vec4 i = floor(v + dot(v, vec4(F4)) );\n vec4 x0 = v - i + dot(i, C.xxxx);\n\n // Other corners\n\n // Rank sorting originally contributed by Bill Licea-Kane, AMD (formerly ATI)\n vec4 i0;\n vec3 isX = step( x0.yzw, x0.xxx );\n vec3 isYZ = step( x0.zww, x0.yyz );\n // i0.x = dot( isX, vec3( 1.0 ) );\n i0.x = isX.x + isX.y + isX.z;\n i0.yzw = 1.0 - isX;\n // i0.y += dot( isYZ.xy, vec2( 1.0 ) );\n i0.y += isYZ.x + isYZ.y;\n i0.zw += 1.0 - isYZ.xy;\n i0.z += isYZ.z;\n i0.w += 1.0 - isYZ.z;\n\n // i0 now contains the unique values 0,1,2,3 in each channel\n vec4 i3 = clamp( i0, 0.0, 1.0 );\n vec4 i2 = clamp( i0-1.0, 0.0, 1.0 );\n vec4 i1 = clamp( i0-2.0, 0.0, 1.0 );\n\n vec4 x1 = x0 - i1 + C.xxxx;\n vec4 x2 = x0 - i2 + C.yyyy;\n vec4 x3 = x0 - i3 + C.zzzz;\n vec4 x4 = x0 + C.wwww;\n\n // Permutations\n i = mod289(i);\n float j0 = permute( permute( permute( permute(i.w) + i.z) + i.y) + i.x);\n vec4 j1 = permute( permute( permute( permute (\n i.w + vec4(i1.w, i2.w, i3.w, 1.0 ))\n + i.z + vec4(i1.z, i2.z, i3.z, 1.0 ))\n + i.y + vec4(i1.y, i2.y, i3.y, 1.0 ))\n + i.x + vec4(i1.x, i2.x, i3.x, 1.0 ));\n\n // Gradients: 7x7x6 points over a cube, mapped onto a 4-cross polytope\n // 7*7*6 = 294, which is close to the ring size 17*17 = 289.\n vec4 ip = vec4(1.0/294.0, 1.0/49.0, 1.0/7.0, 0.0) ;\n\n vec4 p0 = grad4(j0, ip);\n vec4 p1 = grad4(j1.x, ip);\n vec4 p2 = grad4(j1.y, ip);\n vec4 p3 = grad4(j1.z, ip);\n vec4 p4 = grad4(j1.w, ip);\n\n // Normalise gradients\n vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3)));\n p0 *= norm.x;\n p1 *= norm.y;\n p2 *= norm.z;\n p3 *= norm.w;\n p4 *= taylorInvSqrt(dot(p4,p4));\n\n // Mix contributions from the five corners\n vec3 m0 = max(0.6 - vec3(dot(x0,x0), dot(x1,x1), dot(x2,x2)), 0.0);\n vec2 m1 = max(0.6 - vec2(dot(x3,x3), dot(x4,x4) ), 0.0);\n m0 = m0 * m0;\n m1 = m1 * m1;\n return 49.0 * ( dot(m0*m0, vec3( dot( p0, x0 ), dot( p1, x1 ), dot( p2, x2 )))\n + dot(m1*m1, vec2( dot( p3, x3 ), dot( p4, x4 ) ) ) ) ;\n\n}\n"; + +var NoisySphere = { + extends: Sphere, + props: { + radius: { type: Number, default: 20 }, + widthSegments: { type: Number, default: 128 }, + heightSegments: { type: Number, default: 128 }, + timeCoef: { type: Number, default: 0.001 }, + noiseCoef: { type: Number, default: 0.05 }, + dispCoef: { type: Number, default: 5 }, + }, + setup: function setup(props) { + // uniforms + var uTime = { value: 0 }; + var uNoiseCoef = { value: props.noiseCoef }; + watch(function () { return props.noiseCoef; }, function (value) { uNoiseCoef.value = value; }); + var uDispCoef = { value: props.dispCoef }; + watch(function () { return props.dispCoef; }, function (value) { uDispCoef.value = value; }); + + return { + uTime: uTime, uNoiseCoef: uNoiseCoef, uDispCoef: uDispCoef, + }; + }, + mounted: function mounted() { + this.updateMaterial(); + + this.startTime = Date.now(); + this.three.onBeforeRender(this.updateTime); + }, + unmounted: function unmounted() { + this.three.offBeforeRender(this.updateTime); + }, + methods: { + updateMaterial: function updateMaterial() { + var this$1 = this; + + this.material.onBeforeCompile = function (shader) { + shader.uniforms.uTime = this$1.uTime; + shader.uniforms.uNoiseCoef = this$1.uNoiseCoef; + shader.uniforms.uDispCoef = this$1.uDispCoef; + shader.vertexShader = "\n uniform float uTime;\n uniform float uNoiseCoef;\n uniform float uDispCoef;\n varying float vNoise;\n " + snoise4 + "\n " + shader.vertexShader; + + shader.vertexShader = shader.vertexShader.replace( + '#include ', + "\n vec4 p = vec4(vec3(position * uNoiseCoef), uTime);\n vNoise = snoise(p);\n vec3 transformed = vec3(position);\n transformed += normalize(position) * vNoise * uDispCoef;\n " + ); + this$1.materialShader = shader; + }; + this.material.needsupdate = true; + }, + updateTime: function updateTime() { + this.uTime.value = (Date.now() - this.startTime) * this.timeCoef; + }, + }, + __hmrId: 'NoisySphere', +}; + +var NoisyText = { + extends: Text, + props: { + timeCoef: { type: Number, default: 0.001 }, + noiseCoef: { type: Number, default: 0.015 }, + zCoef: { type: Number, default: 10 }, + }, + setup: function setup(props) { + // uniforms + var uTime = { value: 0 }; + var uNoiseCoef = { value: props.noiseCoef }; + watch(function () { return props.noiseCoef; }, function (value) { uNoiseCoef.value = value; }); + var uZCoef = { value: props.zCoef }; + watch(function () { return props.zCoef; }, function (value) { uZCoef.value = value; }); + + return { + uTime: uTime, uNoiseCoef: uNoiseCoef, uZCoef: uZCoef, + }; + }, + mounted: function mounted() { + this.updateMaterial(); + + this.startTime = Date.now(); + this.three.onBeforeRender(this.updateTime); + }, + unmounted: function unmounted() { + this.three.offBeforeRender(this.updateTime); + }, + methods: { + updateMaterial: function updateMaterial() { + var this$1 = this; + + this.material.onBeforeCompile = function (shader) { + shader.uniforms.uTime = this$1.uTime; + shader.uniforms.uNoiseCoef = this$1.uNoiseCoef; + shader.uniforms.uZCoef = this$1.uZCoef; + shader.vertexShader = "\n uniform float uTime;\n uniform float uNoiseCoef;\n uniform float uZCoef;\n " + snoise2 + "\n " + shader.vertexShader; + + shader.vertexShader = shader.vertexShader.replace( + '#include ', + " \n vec3 p = vec3(position * uNoiseCoef);\n p.x += uTime;\n float noise = snoise(p.xy);\n vec3 transformed = vec3(position);\n transformed.z += noise * uZCoef;\n " + ); + this$1.materialShader = shader; + }; + this.material.needsupdate = true; + }, + updateTime: function updateTime() { + this.uTime.value = (Date.now() - this.startTime) * this.timeCoef; + }, + }, + __hmrId: 'NoisyText', +}; + +var AnimatedPlane = function AnimatedPlane(params) { + var this$1 = this; + + Object.entries(params).forEach(function (ref) { + var key = ref[0]; + var value = ref[1]; + + this$1[key] = value; + }); + + this.o3d = new Object3D(); + this.uProgress = { value: 0 }; + this.uvScale = new Vector2(); + + this.initMaterial(); + this.initPlane(); +}; + +AnimatedPlane.prototype.initMaterial = function initMaterial () { + var this$1 = this; + + this.material = new MeshBasicMaterial({ + side: DoubleSide, + transparent: true, + map: this.texture, + onBeforeCompile: function (shader) { + shader.uniforms.progress = this$1.uProgress; + shader.uniforms.uvScale = { value: this$1.uvScale }; + shader.vertexShader = "\n uniform float progress;\n uniform vec2 uvScale;\n\n attribute vec3 offset;\n attribute vec3 rotation;\n attribute vec2 uvOffset;\n\n mat3 rotationMatrixXYZ(vec3 r)\n {\n float cx = cos(r.x);\n float sx = sin(r.x);\n float cy = cos(r.y);\n float sy = sin(r.y);\n float cz = cos(r.z);\n float sz = sin(r.z);\n\n return mat3(\n cy * cz, cx * sz + sx * sy * cz, sx * sz - cx * sy * cz,\n -cy * sz, cx * cz - sx * sy * sz, sx * cz + cx * sy * sz,\n sy, -sx * cy, cx * cy\n );\n }\n " + shader.vertexShader; + + shader.vertexShader = shader.vertexShader.replace('#include ', "\n #include \n vUv = vUv * uvScale + uvOffset;\n "); + + shader.vertexShader = shader.vertexShader.replace('#include ', "\n mat3 rotMat = rotationMatrixXYZ(progress * rotation);\n transformed = rotMat * transformed;\n\n vec4 mvPosition = vec4(transformed, 1.0);\n #ifdef USE_INSTANCING\n mvPosition = instanceMatrix * mvPosition;\n #endif\n\n mvPosition.xyz += progress * offset;\n\n mvPosition = modelViewMatrix * mvPosition;\n gl_Position = projectionMatrix * mvPosition;\n "); + }, + }); +}; + +AnimatedPlane.prototype.initPlane = function initPlane () { + var ref = this.screen; + var width = ref.width; + var wWidth = ref.wWidth; + var wHeight = ref.wHeight; + this.wSize = this.size * wWidth / width; + this.nx = Math.ceil(wWidth / this.wSize) + 1; + this.ny = Math.ceil(wHeight / this.wSize) + 1; + this.icount = this.nx * this.ny; + + this.initGeometry(); + this.initUV(); + this.initAnimAttributes(); + + if (this.imesh) { + this.o3d.remove(this.imesh); + } + this.imesh = new InstancedMesh$1(this.bGeometry, this.material, this.icount); + this.o3d.add(this.imesh); + + var dummy = new Object3D(); + var index = 0; + var x = -(wWidth - (wWidth - this.nx * this.wSize)) / 2 + this.dx; + for (var i = 0; i < this.nx; i++) { + var y = -(wHeight - (wHeight - this.ny * this.wSize)) / 2 + this.dy; + for (var j = 0; j < this.ny; j++) { + dummy.position.set(x, y, 0); + dummy.updateMatrix(); + this.imesh.setMatrixAt(index++, dummy.matrix); + y += this.wSize; + } + x += this.wSize; + } +}; + +AnimatedPlane.prototype.initGeometry = function initGeometry () { + // square + var geometry = new Geometry$1(); + geometry.vertices.push(new Vector3(0, 0, 0)); + geometry.vertices.push(new Vector3(this.wSize, 0, 0)); + geometry.vertices.push(new Vector3(0, this.wSize, 0)); + geometry.vertices.push(new Vector3(this.wSize, this.wSize, 0)); + geometry.faces.push(new Face3(0, 2, 1)); + geometry.faces.push(new Face3(2, 3, 1)); + + geometry.faceVertexUvs[0].push([ + new Vector2(0, 0), + new Vector2(0, 1), + new Vector2(1, 0) ]); + geometry.faceVertexUvs[0].push([ + new Vector2(0, 1), + new Vector2(1, 1), + new Vector2(1, 0) ]); + + // geometry.computeFaceNormals(); + // geometry.computeVertexNormals(); + + // center + this.dx = this.wSize / 2; + this.dy = this.wSize / 2; + geometry.translate(-this.dx, -this.dy, 0); + + this.bGeometry = new BufferGeometry().fromGeometry(geometry); +}; + +AnimatedPlane.prototype.initAnimAttributes = function initAnimAttributes () { + var rnd = MathUtils.randFloat; + var rndFS = MathUtils.randFloatSpread; + var v3 = new Vector3(); + + var offsets = new Float32Array(this.icount * 3); + for (var i = 0; i < offsets.length; i += 3) { + if (this.anim === 1) { v3.set(rndFS(10), rnd(50, 100), rnd(20, 50)).toArray(offsets, i); } + else { v3.set(rndFS(20), rndFS(20), rnd(20, 200)).toArray(offsets, i); } + } + this.bGeometry.setAttribute('offset', new InstancedBufferAttribute(offsets, 3)); + + var rotations = new Float32Array(this.icount * 3); + var angle = Math.PI * 4; + for (var i$1 = 0; i$1 < rotations.length; i$1 += 3) { + rotations[i$1] = rndFS(angle); + rotations[i$1 + 1] = rndFS(angle); + rotations[i$1 + 2] = rndFS(angle); + } + this.bGeometry.setAttribute('rotation', new InstancedBufferAttribute(rotations, 3)); +}; + +AnimatedPlane.prototype.initUV = function initUV () { + var ratio = this.nx / this.ny; + var tRatio = this.texture.image.width / this.texture.image.height; + if (ratio > tRatio) { this.uvScale.set(1 / this.nx, (tRatio / ratio) / this.ny); } + else { this.uvScale.set((ratio / tRatio) / this.nx, 1 / this.ny); } + var nW = this.uvScale.x * this.nx; + var nH = this.uvScale.y * this.ny; + + var v2 = new Vector2(); + var uvOffsets = new Float32Array(this.icount * 2); + for (var i = 0; i < this.nx; i++) { + for (var j = 0; j < this.ny; j++) { + v2.set( + this.uvScale.x * i + (1 - nW) / 2, + this.uvScale.y * j + (1 - nH) / 2 + ).toArray(uvOffsets, (i * this.ny + j) * 2); + } + } + this.bGeometry.setAttribute('uvOffset', new InstancedBufferAttribute(uvOffsets, 2)); +}; + +AnimatedPlane.prototype.setTexture = function setTexture (texture) { + this.texture = texture; + this.material.map = texture; + this.initUV(); +}; + +AnimatedPlane.prototype.resize = function resize () { + this.initPlane(); +}; + +function useTextures() { + var loader = new TextureLoader(); + var textures = []; + + var loadTexture = function (img, index) { + return new Promise(function (resolve) { + loader.load( + img.src, + function (texture) { + textures[index] = texture; + resolve(texture); + } + ); + }); + }; + + var loadTextures = function (images, cb) { + textures.splice(0); + Promise.all(images.map(loadTexture)).then(cb); + }; + + return { + textures: textures, + loadTextures: loadTextures, + }; +} + +var script = { + props: { + images: Array, + events: { type: Object, default: function () { return { wheel: true, click: true, keyup: true }; } }, + }, + setup: function setup() { + var ref = useTextures(); + var textures = ref.textures; + var loadTextures = ref.loadTextures; + return { + textures: textures, + loadTextures: loadTextures, + progress: 0, + targetProgress: 0, + }; + }, + mounted: function mounted() { + this.three = this.$refs.renderer.three; + + if (this.images.length < 2) { + console.error('This slider needs at least 2 images.'); + } else { + this.loadTextures(this.images, this.init); + } + }, + unmounted: function unmounted() { + document.removeEventListener('click', this.onClick); + document.removeEventListener('keyup', this.onKeyup); + window.removeEventListener('wheel', this.onWheel); + }, + methods: { + init: function init() { + this.initScene(); + + gsap.fromTo(this.plane1.uProgress, + { + value: -2, + }, + { + value: 0, + duration: 2.5, + ease: Power4.easeOut, + } + ); + + if (this.events.click) { document.addEventListener('click', this.onClick); } + if (this.events.keyup) { document.addEventListener('keyup', this.onKeyup); } + if (this.events.wheel) { window.addEventListener('wheel', this.onWheel); } + this.three.onBeforeRender(this.updateProgress); + this.three.onAfterResize(this.onResize); + }, + initScene: function initScene() { + var renderer = this.three.renderer; + var scene = this.$refs.scene.scene; + + this.plane1 = new AnimatedPlane({ + renderer: renderer, screen: this.three.size, + size: 10, + anim: 1, + texture: this.textures[0], + }); + + this.plane2 = new AnimatedPlane({ + renderer: renderer, screen: this.three.size, + size: 10, + anim: 2, + texture: this.textures[1], + }); + + this.setPlanesProgress(0); + this.planes = new Object3D(); + this.planes.add(this.plane1.o3d); + this.planes.add(this.plane2.o3d); + scene.add(this.planes); + }, + onResize: function onResize() { + this.plane1.resize(); + this.plane2.resize(); + }, + onWheel: function onWheel(e) { + // e.preventDefault(); + if (e.deltaY > 0) { + this.targetProgress = limit(this.targetProgress + 1 / 20, 0, this.images.length - 1); + } else { + this.targetProgress = limit(this.targetProgress - 1 / 20, 0, this.images.length - 1); + } + }, + onClick: function onClick(e) { + if (e.clientY < this.three.size.height / 2) { + this.navPrevious(); + } else { + this.navNext(); + } + }, + onKeyup: function onKeyup(e) { + if (e.keyCode === 37 || e.keyCode === 38) { + this.navPrevious(); + } else if (e.keyCode === 39 || e.keyCode === 40) { + this.navNext(); + } + }, + navNext: function navNext() { + if (Number.isInteger(this.targetProgress)) { this.targetProgress += 1; } + else { this.targetProgress = Math.ceil(this.targetProgress); } + this.targetProgress = limit(this.targetProgress, 0, this.images.length - 1); + }, + navPrevious: function navPrevious() { + if (Number.isInteger(this.targetProgress)) { this.targetProgress -= 1; } + else { this.targetProgress = Math.floor(this.targetProgress); } + this.targetProgress = limit(this.targetProgress, 0, this.images.length - 1); + }, + updateProgress: function updateProgress() { + var progress1 = lerp(this.progress, this.targetProgress, 0.1); + var pdiff = progress1 - this.progress; + if (pdiff === 0) { return; } + + var p0 = this.progress % 1; + var p1 = progress1 % 1; + if ((pdiff > 0 && p1 < p0) || (pdiff < 0 && p0 < p1)) { + var i = Math.floor(progress1); + this.plane1.setTexture(this.textures[i]); + this.plane2.setTexture(this.textures[i + 1]); + } + + this.progress = progress1; + this.setPlanesProgress(this.progress % 1); + }, + setPlanesProgress: function setPlanesProgress(progress) { + this.plane1.uProgress.value = progress; + this.plane2.uProgress.value = -1 + progress; + this.plane1.material.opacity = 1 - progress; + this.plane2.material.opacity = progress; + this.plane1.o3d.position.z = progress; + this.plane2.o3d.position.z = progress - 1; + }, + }, +}; + +function render(_ctx, _cache, $props, $setup, $data, $options) { + var _component_Camera = resolveComponent("Camera"); + var _component_Scene = resolveComponent("Scene"); + var _component_Renderer = resolveComponent("Renderer"); + + return (openBlock(), createBlock(_component_Renderer, { ref: "renderer" }, { + default: withCtx(function () { return [ + createVNode(_component_Camera, { + ref: "camera", + position: { z: 150 } + }, null, 512 /* NEED_PATCH */), + createVNode(_component_Scene, { ref: "scene" }, null, 512 /* NEED_PATCH */) + ]; }), + _: 1 + }, 512 /* NEED_PATCH */)) +} + +script.render = render; +script.__file = "src/components/sliders/Slider1.vue"; + +var script$1 = { + props: { + src: String, + cameraPosition: Object, + }, + mounted: function mounted() { + var this$1 = this; + + this.renderer = this.$refs.renderer; + + var loader = new GLTFLoader(); + loader.load(this.src, function (gltf) { + this$1.renderer.three.scene.add(gltf.scene); + }); + }, +}; + +function render$1(_ctx, _cache, $props, $setup, $data, $options) { + var _component_Camera = resolveComponent("Camera"); + var _component_Scene = resolveComponent("Scene"); + var _component_Renderer = resolveComponent("Renderer"); + + return (openBlock(), createBlock(_component_Renderer, { + ref: "renderer", + "orbit-ctrl": { enableDamping: true, dampingFactor: 0.05 } + }, { + default: withCtx(function () { return [ + createVNode(_component_Camera, { + ref: "camera", + position: $props.cameraPosition + }, null, 8 /* PROPS */, ["position"]), + createVNode(_component_Scene, null, { + default: withCtx(function () { return [ + renderSlot(_ctx.$slots, "default") + ]; }), + _: 3 + }) + ]; }), + _: 1 + }, 512 /* NEED_PATCH */)) +} + +script$1.render = render$1; +script$1.__file = "src/components/viewers/GLTFViewer.vue"; + +var TROIS = /*#__PURE__*/Object.freeze({ + __proto__: null, + Renderer: Renderer, + PerspectiveCamera: PerspectiveCamera, + Camera: PerspectiveCamera, + Scene: Scene, + Texture: Texture, + CubeTexture: CubeTexture, + BoxGeometry: BoxGeometry, + CircleGeometry: CircleGeometry, + ConeGeometry: ConeGeometry, + CylinderGeometry: CylinderGeometry, + DodecahedronGeometry: DodecahedronGeometry, + IcosahedronGeometry: IcosahedronGeometry, + LatheGeometry: LatheGeometry, + OctahedronGeometry: OctahedronGeometry, + PolyhedronGeometry: PolyhedronGeometry, + RingGeometry: RingGeometry, + SphereGeometry: SphereGeometry, + TetrahedronGeometry: TetrahedronGeometry, + TorusGeometry: TorusGeometry, + TorusKnotGeometry: TorusKnotGeometry, + TubeGeometry: TubeGeometry, + AmbientLight: AmbientLight, + DirectionalLight: DirectionalLight, + PointLight: PointLight, + SpotLight: SpotLight, + BasicMaterial: BasicMaterial, + LambertMaterial: LambertMaterial, + PhongMaterial: PhongMaterial, + PhysicalMaterial: PhysicalMaterial, + StandardMaterial: StandardMaterial, + SubSurfaceMaterial: SubSurfaceMaterial, + ToonMaterial: ToonMaterial, + Map: _Map, + EnvMap: EnvMap, + Mesh: Mesh, + Box: Box, + Circle: Circle, + Cone: Cone, + Cylinder: Cylinder, + Dodecahedron: Dodecahedron, + Icosahedron: Icosahedron, + Lathe: Lathe, + Octahedron: Octahedron, + Plane: Plane, + Polyhedron: Polyhedron, + Ring: Ring, + Sphere: Sphere, + Tetrahedron: Tetrahedron, + Text: Text, + Torus: Torus, + TorusKnot: TorusKnot, + Tube: Tube, + Gem: Gem, + Image: Image, + InstancedMesh: InstancedMesh, + MirrorMesh: MirrorMesh, + RefractionMesh: RefractionMesh, + Sprite: Sprite, + EffectComposer: EffectComposer, + RenderPass: RenderPass, + BokehPass: BokehPass, + FilmPass: FilmPass, + HalftonePass: HalftonePass, + SAOPass: SAOPass, + UnrealBloomPass: UnrealBloomPass, + NoisyImage: NoisyImage, + NoisyPlane: NoisyPlane, + NoisySphere: NoisySphere, + NoisyText: NoisyText, + Slider1: script, + GLTFViewer: script$1, + setFromProp: setFromProp, + propsValues: propsValues, + lerp: lerp, + lerpv3: lerpv3, + limit: limit +}); + +var TroisJSVuePlugin = { + install: function (app) { + var comps = [ + 'Camera', + 'PerspectiveCamera', + 'Renderer', + 'Scene', + // 'Texture', + // 'CubeTexture', + + 'BoxGeometry', + 'CircleGeometry', + 'ConeGeometry', + 'CylinderGeometry', + 'DodecahedronGeometry', + 'IcosahedronGeometry', + 'LatheGeometry', + 'OctahedronGeometry', + 'PolyhedronGeometry', + 'RingGeometry', + 'SphereGeometry', + 'TetrahedronGeometry', + 'TorusGeometry', + 'TorusKnotGeometry', + 'TubeGeometry', + + 'AmbientLight', + 'DirectionalLight', + 'PointLight', + 'SpotLight', + + 'BasicMaterial', + 'LambertMaterial', + 'PhongMaterial', + 'PhysicalMaterial', + 'ShaderMaterial', + 'StandardMaterial', + 'SubSurfaceMaterial', + 'ToonMaterial', + + 'Map', + 'EnvMap', + + 'Box', + 'Circle', + 'Cone', + 'Cylinder', + 'Dodecahedron', + 'Icosahedron', + 'Mesh', + 'Lathe', + 'Octahedron', + 'Plane', + 'Polyhedron', + 'Ring', + 'Sphere', + 'Tetrahedron', + 'Text', + 'Torus', + 'TorusKnot', + 'Tube', + + 'Gem', + 'Image', + 'InstancedMesh', + 'MirrorMesh', + 'RefractionMesh', + 'Sprite', + + 'BokehPass', + 'EffectComposer', + 'FilmPass', + 'HalftonePass', + 'RenderPass', + 'SAOPass', + 'UnrealBloomPass', + + 'GLTFViewer' ]; + + comps.forEach(function (comp) { + app.component(comp, TROIS[comp]); + }); + }, +}; + +export { AmbientLight, BasicMaterial, BokehPass, Box, BoxGeometry, PerspectiveCamera as Camera, Circle, CircleGeometry, Cone, ConeGeometry, CubeTexture, Cylinder, CylinderGeometry, DirectionalLight, Dodecahedron, DodecahedronGeometry, EffectComposer, EnvMap, FilmPass, script$1 as GLTFViewer, Gem, HalftonePass, Icosahedron, IcosahedronGeometry, Image, InstancedMesh, LambertMaterial, Lathe, LatheGeometry, _Map as Map, Mesh, MirrorMesh, NoisyImage, NoisyPlane, NoisySphere, NoisyText, Octahedron, OctahedronGeometry, PerspectiveCamera, PhongMaterial, PhysicalMaterial, Plane, PointLight, Polyhedron, PolyhedronGeometry, RefractionMesh, RenderPass, Renderer, Ring, RingGeometry, SAOPass, Scene, script as Slider1, Sphere, SphereGeometry, SpotLight, Sprite, StandardMaterial, SubSurfaceMaterial, Tetrahedron, TetrahedronGeometry, Text, Texture, ToonMaterial, Torus, TorusGeometry, TorusKnot, TorusKnotGeometry, TroisJSVuePlugin, Tube, TubeGeometry, UnrealBloomPass, lerp, lerpv3, limit, propsValues, setFromProp }; //# sourceMappingURL=trois.module.js.map diff --git a/build/trois.module.js.map b/build/trois.module.js.map index 8dba39b..4d7256c 100644 --- a/build/trois.module.js.map +++ b/build/trois.module.js.map @@ -1 +1 @@ -{"version":3,"file":"trois.module.js","sources":["../src/core/useThree.js","../src/core/Renderer.js","../src/tools.js","../src/core/PerspectiveCamera.js","../src/core/Scene.js","../src/geometries/Geometry.js","../src/geometries/BoxGeometry.js","../src/geometries/SphereGeometry.js","../src/lights/Light.js","../src/lights/AmbientLight.js","../src/lights/PointLight.js","../src/lights/SpotLight.js","../src/materials/Material.js","../src/materials/BasicMaterial.js","../src/materials/LambertMaterial.js","../src/materials/PhongMaterial.js","../src/materials/PhysicalMaterial.js","../src/materials/StandardMaterial.js","../src/meshes/Mesh.js","../src/meshes/Box.js","../src/meshes/Plane.js","../src/meshes/Sphere.js","../src/meshes/InstancedMesh.js","../src/effects/EffectComposer.js","../src/effects/EffectPass.js","../src/effects/RenderPass.js","../src/effects/BokehPass.js","../src/effects/UnrealBloomPass.js"],"sourcesContent":["import {\r\n Plane,\r\n Raycaster,\r\n Vector2,\r\n Vector3,\r\n WebGLRenderer,\r\n} from 'three';\r\n\r\nimport { OrbitControls } from 'three/examples/jsm/controls/OrbitControls.js';\r\n\r\n/**\r\n * Three.js helper\r\n */\r\nexport default function useThree() {\r\n // default conf\r\n const conf = {\r\n canvas: null,\r\n antialias: true,\r\n alpha: false,\r\n orbit_ctrl: false,\r\n mouse_move: false,\r\n mouse_raycast: false,\r\n resize: 'window',\r\n width: 0,\r\n height: 0,\r\n };\r\n\r\n // size\r\n const size = {\r\n width: 0, height: 0,\r\n wWidth: 0, wHeight: 0,\r\n ratio: 0,\r\n };\r\n\r\n // handlers\r\n const afterInitHandlers = [];\r\n const afterResizeHandlers = [];\r\n const beforeRenderHandlers = [];\r\n\r\n // mouse tracking\r\n const mouse = new Vector2();\r\n const mouseV3 = new Vector3();\r\n const mousePlane = new Plane(new Vector3(0, 0, 1), 0);\r\n const raycaster = new Raycaster();\r\n\r\n // returned object\r\n const obj = {\r\n conf,\r\n renderer: null,\r\n camera: null,\r\n cameraCtrl: null,\r\n materials: {},\r\n scene: null,\r\n size,\r\n mouse, mouseV3,\r\n init,\r\n dispose,\r\n render,\r\n renderC,\r\n setSize,\r\n onAfterInit,\r\n onAfterResize,\r\n onBeforeRender,\r\n };\r\n\r\n /**\r\n * init three\r\n */\r\n function init(params) {\r\n if (params) {\r\n for (const [key, value] of Object.entries(params)) {\r\n conf[key] = value;\r\n }\r\n }\r\n\r\n if (!obj.scene) {\r\n console.error('Missing Scene');\r\n return;\r\n }\r\n\r\n if (!obj.camera) {\r\n console.error('Missing Camera');\r\n return;\r\n }\r\n\r\n obj.renderer = new WebGLRenderer({ canvas: conf.canvas, antialias: conf.antialias, alpha: conf.alpha });\r\n\r\n if (conf.orbit_ctrl) {\r\n obj.orbitCtrl = new OrbitControls(obj.camera, obj.renderer.domElement);\r\n if (conf.orbit_ctrl instanceof Object) {\r\n for (const [key, value] of Object.entries(conf.orbit_ctrl)) {\r\n obj.orbitCtrl[key] = value;\r\n }\r\n }\r\n }\r\n\r\n if (conf.width && conf.height) {\r\n setSize(conf.width, conf.height);\r\n } else if (conf.resize) {\r\n onResize();\r\n window.addEventListener('resize', onResize);\r\n }\r\n\r\n if (conf.mouse_move) {\r\n if (conf.mouse_move === 'body') {\r\n obj.mouse_move_element = document.body;\r\n } else {\r\n obj.mouse_move_element = obj.renderer.domElement;\r\n }\r\n obj.mouse_move_element.addEventListener('mousemove', onMousemove);\r\n obj.mouse_move_element.addEventListener('mouseleave', onMouseleave);\r\n }\r\n\r\n afterInitHandlers.forEach(c => c());\r\n\r\n return true;\r\n };\r\n\r\n /**\r\n * add after init handler\r\n */\r\n function onAfterInit(callback) {\r\n afterInitHandlers.push(callback);\r\n }\r\n\r\n /**\r\n * add after resize handler\r\n */\r\n function onAfterResize(callback) {\r\n afterResizeHandlers.push(callback);\r\n }\r\n\r\n /**\r\n * add before render handler\r\n */\r\n function onBeforeRender(callback) {\r\n beforeRenderHandlers.push(callback);\r\n }\r\n\r\n /**\r\n * default render\r\n */\r\n function render() {\r\n if (obj.orbitCtrl) obj.orbitCtrl.update();\r\n beforeRenderHandlers.forEach(c => c());\r\n obj.renderer.render(obj.scene, obj.camera);\r\n }\r\n\r\n /**\r\n * composer render\r\n */\r\n function renderC() {\r\n if (obj.orbitCtrl) obj.orbitCtrl.update();\r\n beforeRenderHandlers.forEach(c => c());\r\n obj.composer.render();\r\n }\r\n\r\n /**\r\n * remove listeners\r\n */\r\n function dispose() {\r\n window.removeEventListener('resize', onResize);\r\n if (obj.mouse_move_element) {\r\n obj.mouse_move_element.removeEventListener('mousemove', onMousemove);\r\n obj.mouse_move_element.removeEventListener('mouseleave', onMouseleave); \r\n }\r\n }\r\n\r\n /**\r\n * mousemove listener\r\n */\r\n function onMousemove(e) {\r\n mouse.x = (e.clientX / size.width) * 2 - 1;\r\n mouse.y = -(e.clientY / size.height) * 2 + 1;\r\n updateMouseV3();\r\n }\r\n\r\n /**\r\n * mouseleave listener\r\n */\r\n function onMouseleave(e) {\r\n mouse.x = 0;\r\n mouse.y = 0;\r\n updateMouseV3();\r\n }\r\n\r\n /**\r\n * get 3d mouse position\r\n */\r\n function updateMouseV3() {\r\n if (conf.mouse_raycast) {\r\n obj.camera.getWorldDirection(mousePlane.normal);\r\n mousePlane.normal.normalize();\r\n raycaster.setFromCamera(mouse, obj.camera);\r\n raycaster.ray.intersectPlane(mousePlane, mouseV3);\r\n }\r\n }\r\n\r\n /**\r\n * resize listener\r\n */\r\n function onResize() {\r\n if (conf.resize === 'window') {\r\n setSize(window.innerWidth, window.innerHeight);\r\n } else {\r\n setSize(conf.resize.clientWidth, conf.resize.clientHeight);\r\n }\r\n afterResizeHandlers.forEach(c => c());\r\n }\r\n\r\n /**\r\n * update renderer size and camera\r\n */\r\n function setSize(width, height) {\r\n size.width = width;\r\n size.height = height;\r\n size.ratio = width / height;\r\n\r\n obj.renderer.setSize(width, height, false);\r\n obj.camera.aspect = size.ratio;\r\n obj.camera.updateProjectionMatrix();\r\n\r\n if (obj.composer) {\r\n obj.composer.setSize(width, height);\r\n }\r\n\r\n const wsize = getCameraSize();\r\n size.wWidth = wsize[0]; size.wHeight = wsize[1];\r\n }\r\n\r\n /**\r\n * calculate camera visible area size\r\n */\r\n function getCameraSize() {\r\n const vFOV = (obj.camera.fov * Math.PI) / 180;\r\n const h = 2 * Math.tan(vFOV / 2) * Math.abs(obj.camera.position.z);\r\n const w = h * obj.camera.aspect;\r\n return [w, h];\r\n }\r\n\r\n return obj;\r\n}\r\n","import { h } from 'vue';\r\nimport useThree from './useThree';\r\n\r\nexport default {\r\n props: {\r\n antialias: {\r\n type: Boolean,\r\n default: true,\r\n },\r\n alpha: {\r\n type: Boolean,\r\n default: false,\r\n },\r\n shadow: {\r\n type: Boolean,\r\n default: false,\r\n },\r\n orbitCtrl: {\r\n type: [Boolean, Object],\r\n default: false,\r\n },\r\n mouseMove: {\r\n type: [Boolean, String],\r\n default: false,\r\n },\r\n mouseRaycast: {\r\n type: Boolean,\r\n default: false,\r\n },\r\n resize: {\r\n type: [Boolean, String, Element],\r\n default: 'window',\r\n },\r\n width: String,\r\n height: String,\r\n },\r\n setup(props) {\r\n return {\r\n three: useThree(),\r\n raf: true,\r\n };\r\n },\r\n provide() {\r\n return {\r\n three: this.three,\r\n };\r\n },\r\n mounted() {\r\n const params = {\r\n canvas: this.$refs.canvas,\r\n antialias: this.antialias,\r\n alpha: this.alpha,\r\n orbit_ctrl: this.orbitCtrl,\r\n mouse_move: this.mouseMove,\r\n mouse_raycast: this.mouseRaycast,\r\n resize: this.resize,\r\n width: this.width,\r\n height: this.height,\r\n };\r\n\r\n if (this.three.init(params)) {\r\n this.three.renderer.shadowMap.enabled = this.shadow;\r\n if (this.three.composer) this.animateC();\r\n else this.animate();\r\n };\r\n },\r\n beforeUnmount() {\r\n this.raf = false;\r\n this.three.dispose();\r\n },\r\n methods: {\r\n onBeforeRender(callback) {\r\n this.three.onBeforeRender(callback);\r\n },\r\n onAfterResize(callback) {\r\n this.three.onAfterResize(callback);\r\n },\r\n animate() {\r\n if (this.raf) requestAnimationFrame(this.animate);\r\n this.three.render();\r\n },\r\n animateC() {\r\n if (this.raf) requestAnimationFrame(this.animateC);\r\n this.three.renderC();\r\n },\r\n },\r\n render() {\r\n return h(\r\n 'canvas',\r\n { ref: 'canvas' },\r\n this.$slots.default()\r\n );\r\n },\r\n};\r\n","export function setFromProp(o, prop) {\r\n if (prop instanceof Object) {\r\n for (const [key, value] of Object.entries(prop)) {\r\n o[key] = value;\r\n }\r\n }\r\n};\r\n\r\nexport function lerp(value1, value2, amount) {\r\n amount = amount < 0 ? 0 : amount;\r\n amount = amount > 1 ? 1 : amount;\r\n return value1 + (value2 - value1) * amount;\r\n};\r\n\r\nexport function lerpv3(v1, v2, amount) {\r\n v1.x = lerp(v1.x, v2.x, amount);\r\n v1.y = lerp(v1.y, v2.y, amount);\r\n v1.z = lerp(v1.z, v2.z, amount);\r\n};\r\n","import { PerspectiveCamera } from 'three';\r\nimport { setFromProp } from '../tools.js';\r\n\r\nexport default {\r\n inject: ['three'],\r\n props: {\r\n fov: {\r\n type: Number,\r\n default: 50,\r\n },\r\n position: Object,\r\n },\r\n created() {\r\n const camera = new PerspectiveCamera(this.fov);\r\n setFromProp(camera.position, this.position);\r\n this.three.camera = camera;\r\n },\r\n render() {\r\n return [];\r\n },\r\n};\r\n","import { Scene, Color } from 'three';\r\n\r\nexport default {\r\n inject: ['three'],\r\n props: {\r\n id: String,\r\n background: [String, Number],\r\n },\r\n setup (props) {\r\n const scene = new Scene();\r\n if (props.background) scene.background = new Color(props.background);\r\n return { scene };\r\n },\r\n provide() {\r\n return {\r\n scene: this.scene,\r\n };\r\n },\r\n mounted() {\r\n if (!this.three.scene) {\r\n this.three.scene = this.scene;\r\n }\r\n },\r\n render() {\r\n if (this.$slots.default) {\r\n return this.$slots.default();\r\n }\r\n return [];\r\n },\r\n};\r\n","export default {\r\n inject: ['parent'],\r\n beforeMount() {\r\n if (!this.parent) {\r\n console.error('Missing parent Mesh');\r\n }\r\n },\r\n unmounted() {\r\n this.parent.geometry.dispose();\r\n },\r\n render() {\r\n return [];\r\n },\r\n};\r\n","import { BoxBufferGeometry } from 'three';\r\nimport Geometry from './Geometry.js';\r\n\r\nexport default {\r\n extends: Geometry,\r\n props: {\r\n size: {\r\n type: Number,\r\n },\r\n width: {\r\n type: Number,\r\n default: 1,\r\n },\r\n height: {\r\n type: Number,\r\n default: 1,\r\n },\r\n depth: {\r\n type: Number,\r\n default: 1,\r\n },\r\n },\r\n mounted() {\r\n if (this.size) {\r\n this.parent.geometry = new BoxBufferGeometry(this.size, this.size, this.size);\r\n } else {\r\n this.parent.geometry = new BoxBufferGeometry(this.width, this.height, this.depth);\r\n }\r\n },\r\n};\r\n","import { SphereBufferGeometry } from 'three';\r\nimport Geometry from './Geometry.js';\r\n\r\nexport default {\r\n extends: Geometry,\r\n props: {\r\n radius: Number,\r\n widthSegments: {\r\n type: Number,\r\n default: 12,\r\n },\r\n heightSegments: {\r\n type: Number,\r\n default: 12,\r\n },\r\n },\r\n mounted() {\r\n this.parent.geometry = new SphereBufferGeometry(this.radius, this.widthSegments, this.heightSegments);\r\n },\r\n};\r\n","import { setFromProp } from '../tools.js';\r\n\r\nexport default {\r\n inject: ['scene'],\r\n props: {\r\n color: {\r\n type: String,\r\n default: '#ffffff',\r\n },\r\n intensity: {\r\n type: Number,\r\n default: 1,\r\n },\r\n castShadow: {\r\n type: Boolean,\r\n default: false,\r\n },\r\n shadowMapSize: Object,\r\n position: Object,\r\n },\r\n mounted() {\r\n setFromProp(this.light.position, this.position);\r\n\r\n if (this.light.shadow) {\r\n this.light.castShadow = this.castShadow;\r\n setFromProp(this.light.shadow.mapSize, this.shadowMapSize);\r\n }\r\n\r\n this.scene.add(this.light);\r\n if (this.light.target) this.scene.add(this.light.target);\r\n },\r\n render() {\r\n return [];\r\n },\r\n};\r\n","import { AmbientLight } from 'three';\r\nimport Light from './Light.js';\r\n\r\nexport default {\r\n extends: Light,\r\n created() {\r\n this.light = new AmbientLight(this.color, this.intensity);\r\n },\r\n};\r\n","import { PointLight } from 'three';\r\nimport Light from './Light.js';\r\n\r\nexport default {\r\n extends: Light,\r\n props: {\r\n distance: {\r\n type: Number,\r\n default: 0,\r\n },\r\n decay: {\r\n type: Number,\r\n default: 1,\r\n },\r\n },\r\n created() {\r\n this.light = new PointLight(this.color, this.intensity, this.distance, this.decay);\r\n },\r\n};\r\n","import { SpotLight } from 'three';\r\nimport Light from './Light.js';\r\n\r\nexport default {\r\n extends: Light,\r\n props: {\r\n distance: {\r\n type: Number,\r\n default: 0,\r\n },\r\n angle: {\r\n type: Number,\r\n default: Math.PI / 3,\r\n },\r\n penumbra: {\r\n type: Number,\r\n default: 0,\r\n },\r\n decay: {\r\n type: Number,\r\n default: 1,\r\n },\r\n },\r\n created() {\r\n this.light = new SpotLight(this.color, this.intensity, this.distance, this.angle, this.penumbra, this.decay);\r\n },\r\n};\r\n","import { FrontSide } from 'three';\r\n\r\nexport default {\r\n inject: ['three'],\r\n props: {\r\n id: String,\r\n color: {\r\n type: [String, Number],\r\n default: '#ffffff',\r\n },\r\n depthTest: {\r\n type: Boolean,\r\n default: true,\r\n },\r\n depthWrite: {\r\n type: Boolean,\r\n default: true,\r\n },\r\n fog: {\r\n type: Boolean,\r\n default: false,\r\n },\r\n opacity: {\r\n type: Number,\r\n default: 1,\r\n },\r\n side: {\r\n type: Number,\r\n default: FrontSide,\r\n },\r\n transparent: {\r\n type: Boolean,\r\n default: false,\r\n },\r\n vertexColors: {\r\n type: Boolean,\r\n default: false,\r\n },\r\n },\r\n mounted() {\r\n this.three.materials[this.id] = this.material;\r\n },\r\n unmounted() {\r\n this.material.dispose();\r\n },\r\n methods: {\r\n propsValues() {\r\n const props = {};\r\n for (const [key, value] of Object.entries(this.$props)) {\r\n if (key !== 'id') props[key] = value;\r\n }\r\n return props;\r\n },\r\n },\r\n render() {\r\n return [];\r\n },\r\n};\r\n","import { MeshBasicMaterial } from 'three';\r\nimport Material from './Material';\r\n\r\nexport default {\r\n extends: Material,\r\n created() {\r\n this.material = new MeshBasicMaterial({\r\n color: this.color,\r\n });\r\n },\r\n};\r\n","import { MeshLambertMaterial } from 'three';\r\nimport Material from './Material';\r\n\r\nexport default {\r\n extends: Material,\r\n created() {\r\n this.material = new MeshLambertMaterial({\r\n color: this.color,\r\n });\r\n },\r\n};\r\n","import { MeshPhongMaterial } from 'three';\r\nimport Material from './Material';\r\n\r\nexport default {\r\n extends: Material,\r\n created() {\r\n this.material = new MeshPhongMaterial({\r\n color: this.color,\r\n });\r\n },\r\n};\r\n","import { MeshPhysicalMaterial } from 'three';\r\nimport Material from './Material';\r\n\r\nexport default {\r\n extends: Material,\r\n created() {\r\n this.material = new MeshPhysicalMaterial({\r\n color: this.color,\r\n });\r\n },\r\n};\r\n","import { MeshStandardMaterial } from 'three';\r\nimport Material from './Material';\r\n\r\nexport default {\r\n extends: Material,\r\n props: {\r\n emissive: {\r\n type: [Number, String],\r\n default: 0,\r\n },\r\n emissiveIntensity: {\r\n type: Number,\r\n default: 1,\r\n },\r\n metalness: {\r\n type: Number,\r\n default: 0,\r\n },\r\n roughness: {\r\n type: Number,\r\n default: 1,\r\n },\r\n },\r\n created() {\r\n this.material = new MeshStandardMaterial(this.propsValues());\r\n },\r\n};\r\n","import { Mesh } from 'three';\r\nimport { setFromProp } from '../tools.js';\r\n\r\nexport default {\r\n inject: ['three', 'scene'],\r\n props: {\r\n material: String,\r\n position: Object,\r\n rotation: Object,\r\n scale: Object,\r\n castShadow: {\r\n type: Boolean,\r\n default: false,\r\n },\r\n receiveShadow: {\r\n type: Boolean,\r\n default: false,\r\n },\r\n },\r\n mounted() {\r\n this.mesh = new Mesh(this.geometry, this.three.materials[this.material]);\r\n setFromProp(this.mesh.position, this.position);\r\n setFromProp(this.mesh.rotation, this.rotation);\r\n setFromProp(this.mesh.scale, this.scale);\r\n this.mesh.castShadow = this.castShadow;\r\n this.mesh.receiveShadow = this.receiveShadow;\r\n this.scene.add(this.mesh);\r\n },\r\n unmounted() {\r\n this.geometry.dispose();\r\n },\r\n render() {\r\n return [];\r\n },\r\n};\r\n","import { BoxBufferGeometry } from 'three';\r\nimport Mesh from './Mesh.js';\r\n\r\nexport default {\r\n extends: Mesh,\r\n props: {\r\n size: {\r\n type: Number,\r\n },\r\n width: {\r\n type: Number,\r\n default: 1,\r\n },\r\n height: {\r\n type: Number,\r\n default: 1,\r\n },\r\n depth: {\r\n type: Number,\r\n default: 1,\r\n },\r\n },\r\n created() {\r\n if (this.size) {\r\n this.geometry = new BoxBufferGeometry(this.size, this.size, this.size);\r\n } else {\r\n this.geometry = new BoxBufferGeometry(this.width, this.height, this.depth);\r\n }\r\n },\r\n};\r\n","import { PlaneBufferGeometry } from 'three';\r\nimport Mesh from './Mesh.js';\r\n\r\nexport default {\r\n extends: Mesh,\r\n props: {\r\n width: {\r\n type: Number,\r\n default: 1,\r\n },\r\n height: {\r\n type: Number,\r\n default: 1,\r\n },\r\n widthSegments: {\r\n type: Number,\r\n default: 1,\r\n },\r\n heightSegments: {\r\n type: Number,\r\n default: 1,\r\n },\r\n },\r\n created() {\r\n this.geometry = new PlaneBufferGeometry(this.width, this.height, this.widthSegments, this.heightSegments);\r\n },\r\n};\r\n","import { SphereBufferGeometry } from 'three';\r\nimport Mesh from './Mesh.js';\r\n\r\nexport default {\r\n extends: Mesh,\r\n props: {\r\n radius: Number,\r\n widthSegments: {\r\n type: Number,\r\n default: 12,\r\n },\r\n heightSegments: {\r\n type: Number,\r\n default: 12,\r\n },\r\n },\r\n created() {\r\n this.geometry = new SphereBufferGeometry(this.radius, this.widthSegments, this.heightSegments);\r\n },\r\n};\r\n","import { InstancedMesh } from 'three';\r\nimport { setFromProp } from '../tools.js';\r\n\r\nexport default {\r\n inject: ['three', 'scene'],\r\n props: {\r\n material: String,\r\n count: Number,\r\n position: Object,\r\n castShadow: {\r\n type: Boolean,\r\n default: false,\r\n },\r\n receiveShadow: {\r\n type: Boolean,\r\n default: false,\r\n },\r\n },\r\n setup() {\r\n return {\r\n conf: {},\r\n };\r\n },\r\n provide() {\r\n return {\r\n parent: this.conf,\r\n };\r\n },\r\n beforeMount() {\r\n if (!this.$slots.default) {\r\n console.error('Missing Geometry');\r\n }\r\n },\r\n mounted() {\r\n this.mesh = new InstancedMesh(this.conf.geometry, this.three.materials[this.material], this.count);\r\n setFromProp(this.mesh.position, this.position);\r\n this.mesh.castShadow = this.castShadow;\r\n this.mesh.receiveShadow = this.receiveShadow;\r\n this.scene.add(this.mesh);\r\n },\r\n render() {\r\n return this.$slots.default();\r\n },\r\n};\r\n","import { EffectComposer } from 'three/examples/jsm/postprocessing/EffectComposer.js';\r\n\r\nexport default {\r\n setup() {\r\n return {\r\n passes: [],\r\n };\r\n },\r\n inject: ['three'],\r\n provide() {\r\n return {\r\n passes: this.passes,\r\n };\r\n },\r\n mounted() {\r\n this.three.onAfterInit(() => {\r\n this.composer = new EffectComposer(this.three.renderer);\r\n this.passes.forEach(pass => {\r\n this.composer.addPass(pass);\r\n });\r\n this.three.composer = this.composer;\r\n });\r\n },\r\n render() {\r\n return this.$slots.default();\r\n },\r\n};\r\n","export default {\r\n inject: ['three', 'passes'],\r\n beforeMount() {\r\n if (!this.passes) {\r\n console.error('Missing parent EffectComposer');\r\n }\r\n },\r\n render() {\r\n return [];\r\n },\r\n};\r\n","import { RenderPass } from 'three/examples/jsm/postprocessing/RenderPass.js';\r\nimport EffectPass from './EffectPass.js';\r\n\r\nexport default {\r\n extends: EffectPass,\r\n mounted() {\r\n if (!this.three.scene) {\r\n console.error('Missing Scene');\r\n }\r\n if (!this.three.camera) {\r\n console.error('Missing Camera');\r\n }\r\n const pass = new RenderPass(this.three.scene, this.three.camera);\r\n this.passes.push(pass);\r\n this.pass = pass;\r\n },\r\n};\r\n","import { BokehPass } from 'three/examples/jsm/postprocessing/BokehPass.js';\r\nimport EffectPass from './EffectPass.js';\r\n\r\nexport default {\r\n extends: EffectPass,\r\n props: {\r\n focus: {\r\n type: Number,\r\n default: 1,\r\n },\r\n aperture: {\r\n type: Number,\r\n default: 0.025,\r\n },\r\n maxblur: {\r\n type: Number,\r\n default: 0.01,\r\n },\r\n },\r\n // watch: {\r\n // focus() {\r\n // this.pass.focus = this.focus;\r\n // },\r\n // aperture() {\r\n // this.pass.aperture = this.aperture;\r\n // },\r\n // maxblur() {\r\n // this.pass.maxblur = this.maxblur;\r\n // },\r\n // },\r\n mounted() {\r\n if (!this.three.scene) {\r\n console.error('Missing Scene');\r\n }\r\n if (!this.three.camera) {\r\n console.error('Missing Camera');\r\n }\r\n const params = {\r\n focus: this.focus,\r\n aperture: this.aperture,\r\n maxblur: this.maxblur,\r\n width: this.three.size.width,\r\n height: this.three.size.height,\r\n };\r\n const pass = new BokehPass(this.three.scene, this.three.camera, params);\r\n this.passes.push(pass);\r\n this.pass = pass;\r\n },\r\n};\r\n","import { Vector2 } from 'three';\r\nimport { UnrealBloomPass } from 'three/examples/jsm/postprocessing/UnrealBloomPass.js';\r\nimport EffectPass from './EffectPass.js';\r\n\r\nexport default {\r\n extends: EffectPass,\r\n props: {\r\n strength: {\r\n type: Number,\r\n default: 1.5,\r\n },\r\n radius: {\r\n type: Number,\r\n default: 0,\r\n },\r\n threshold: {\r\n type: Number,\r\n default: 0,\r\n },\r\n },\r\n // watch: {\r\n // strength() {\r\n // this.pass.strength = this.strength;\r\n // },\r\n // radius() {\r\n // this.pass.strength = this.radius;\r\n // },\r\n // threshold() {\r\n // this.pass.strength = this.threshold;\r\n // },\r\n // },\r\n mounted() {\r\n const size = new Vector2(this.three.size.width, this.three.size.height);\r\n const pass = new UnrealBloomPass(size, this.strength, this.radius, this.threshold);\r\n this.passes.push(pass);\r\n this.pass = pass;\r\n },\r\n};\r\n"],"names":["const","Plane","key","value","PerspectiveCamera","Scene","AmbientLight","PointLight","SpotLight","Mesh","InstancedMesh","this","EffectComposer","RenderPass","BokehPass","UnrealBloomPass"],"mappings":";;;;;;;;AAUA;AACA;AACA;AACe,SAAS,QAAQ,GAAG;AACnC;AACA,EAAEA,IAAM,IAAI,GAAG;AACf,IAAI,MAAM,EAAE,IAAI;AAChB,IAAI,SAAS,EAAE,IAAI;AACnB,IAAI,KAAK,EAAE,KAAK;AAChB,IAAI,UAAU,EAAE,KAAK;AACrB,IAAI,UAAU,EAAE,KAAK;AACrB,IAAI,aAAa,EAAE,KAAK;AACxB,IAAI,MAAM,EAAE,QAAQ;AACpB,IAAI,KAAK,EAAE,CAAC;AACZ,IAAI,MAAM,EAAE,CAAC;AACb,GAAG,CAAC;AACJ;AACA;AACA,EAAEA,IAAM,IAAI,GAAG;AACf,IAAI,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC;AACvB,IAAI,MAAM,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC;AACzB,IAAI,KAAK,EAAE,CAAC;AACZ,GAAG,CAAC;AACJ;AACA;AACA,E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,IAAI,CAAC;AACrB,GAAG;AACH,CAAC;;AC5CD,sBAAe;AACf,EAAE,OAAO,EAAE,UAAU;AACrB,EAAE,KAAK,EAAE;AACT,IAAI,QAAQ,EAAE;AACd,MAAM,IAAI,EAAE,MAAM;AAClB,MAAM,OAAO,EAAE,GAAG;AAClB,KAAK;AACL,IAAI,MAAM,EAAE;AACZ,MAAM,IAAI,EAAE,MAAM;AAClB,MAAM,OAAO,EAAE,CAAC;AAChB,KAAK;AACL,IAAI,SAAS,EAAE;AACf,MAAM,IAAI,EAAE,MAAM;AAClB,MAAM,OAAO,EAAE,CAAC;AAChB,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,yBAAO,GAAG;AACZ,IAAId,IAAM,IAAI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAC5E,IAAIA,IAAM,IAAI,GAAG,IAAIe,iBAAe,CAAC,IAAI,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;AACvF,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC3B,IAAI,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;AACrB,GAAG;AACH,CAAC;;;;"} \ No newline at end of file +{"version":3,"file":"trois.module.js","sources":["../src/core/useThree.js","../src/core/Renderer.js","../src/tools.js","../src/use/useBindProp.js","../src/core/PerspectiveCamera.js","../src/core/Scene.js","../src/core/Texture.js","../src/core/CubeTexture.js","../src/geometries/Geometry.js","../src/geometries/BoxGeometry.js","../src/geometries/CircleGeometry.js","../src/geometries/ConeGeometry.js","../src/geometries/CylinderGeometry.js","../src/geometries/DodecahedronGeometry.js","../src/geometries/IcosahedronGeometry.js","../src/geometries/LatheGeometry.js","../src/geometries/OctahedronGeometry.js","../src/geometries/PolyhedronGeometry.js","../src/geometries/RingGeometry.js","../src/geometries/SphereGeometry.js","../src/geometries/TetrahedronGeometry.js","../src/geometries/TorusGeometry.js","../src/geometries/TorusKnotGeometry.js","../src/geometries/TubeGeometry.js","../src/lights/Light.js","../src/lights/AmbientLight.js","../src/lights/DirectionalLight.js","../src/lights/PointLight.js","../src/lights/SpotLight.js","../src/materials/Material.js","../src/materials/BasicMaterial.js","../src/materials/LambertMaterial.js","../src/materials/PhongMaterial.js","../src/materials/StandardMaterial.js","../src/materials/PhysicalMaterial.js","../src/materials/SubsurfaceScatteringShader.js","../src/materials/ShaderMaterial.js","../src/materials/SubSurfaceMaterial.js","../src/materials/ToonMaterial.js","../src/materials/Map.js","../src/materials/EnvMap.js","../src/meshes/Mesh.js","../src/meshes/Box.js","../src/meshes/Circle.js","../src/meshes/Cone.js","../src/meshes/Cylinder.js","../src/meshes/Dodecahedron.js","../src/meshes/Icosahedron.js","../src/meshes/Lathe.js","../src/meshes/Octahedron.js","../src/meshes/Plane.js","../src/meshes/Polyhedron.js","../src/meshes/Ring.js","../src/meshes/Sphere.js","../src/meshes/Tetrahedron.js","../src/meshes/TextProps.js","../src/meshes/Text.js","../src/meshes/Torus.js","../src/meshes/TorusKnot.js","../src/meshes/Tube.js","../src/meshes/Gem.js","../src/meshes/Image.js","../src/meshes/InstancedMesh.js","../src/meshes/MirrorMesh.js","../src/meshes/RefractionMesh.js","../src/meshes/Sprite.js","../src/effects/EffectComposer.js","../src/effects/EffectPass.js","../src/effects/RenderPass.js","../src/effects/BokehPass.js","../src/effects/FilmPass.js","../src/effects/HalftonePass.js","../src/effects/SAOPass.js","../src/effects/UnrealBloomPass.js","../src/glsl/snoise2.glsl.js","../src/components/noisy/NoisyImage.js","../src/glsl/snoise3.glsl.js","../src/components/noisy/NoisyPlane.js","../src/glsl/snoise4.glsl.js","../src/components/noisy/NoisySphere.js","../src/components/noisy/NoisyText.js","../src/components/sliders/AnimatedPlane.js","../src/use/useTextures.js","../src/components/sliders/Slider1.vue","../src/components/viewers/GLTFViewer.vue","../src/plugin.js"],"sourcesContent":["import {\r\n Plane,\r\n Raycaster,\r\n Vector2,\r\n Vector3,\r\n WebGLRenderer,\r\n} from 'three';\r\n\r\nimport { OrbitControls } from 'three/examples/jsm/controls/OrbitControls.js';\r\n\r\n/**\r\n * Three.js helper\r\n */\r\nexport default function useThree() {\r\n // default conf\r\n const conf = {\r\n canvas: null,\r\n antialias: true,\r\n alpha: false,\r\n autoClear: true,\r\n orbit_ctrl: false,\r\n mouse_move: false,\r\n mouse_raycast: false,\r\n resize: 'window',\r\n width: 0,\r\n height: 0,\r\n };\r\n\r\n // size\r\n const size = {\r\n width: 0, height: 0,\r\n wWidth: 0, wHeight: 0,\r\n ratio: 0,\r\n };\r\n\r\n // handlers\r\n let afterInitCallbacks = [];\r\n let afterResizeCallbacks = [];\r\n let beforeRenderCallbacks = [];\r\n\r\n // mouse tracking\r\n const mouse = new Vector2();\r\n const mouseV3 = new Vector3();\r\n const mousePlane = new Plane(new Vector3(0, 0, 1), 0);\r\n const raycaster = new Raycaster();\r\n\r\n // returned object\r\n const obj = {\r\n conf,\r\n renderer: null,\r\n camera: null,\r\n cameraCtrl: null,\r\n materials: {},\r\n scene: null,\r\n size,\r\n mouse, mouseV3,\r\n init,\r\n dispose,\r\n render,\r\n renderC,\r\n setSize,\r\n onAfterInit,\r\n onAfterResize, offAfterResize,\r\n onBeforeRender, offBeforeRender,\r\n };\r\n\r\n /**\r\n * init three\r\n */\r\n function init(params) {\r\n if (params) {\r\n Object.entries(params).forEach(([key, value]) => {\r\n conf[key] = value;\r\n });\r\n }\r\n\r\n if (!obj.scene) {\r\n console.error('Missing Scene');\r\n return;\r\n }\r\n\r\n if (!obj.camera) {\r\n console.error('Missing Camera');\r\n return;\r\n }\r\n\r\n obj.renderer = new WebGLRenderer({ canvas: conf.canvas, antialias: conf.antialias, alpha: conf.alpha });\r\n obj.renderer.autoClear = conf.autoClear;\r\n\r\n if (conf.orbit_ctrl) {\r\n obj.orbitCtrl = new OrbitControls(obj.camera, obj.renderer.domElement);\r\n if (conf.orbit_ctrl instanceof Object) {\r\n Object.entries(conf.orbit_ctrl).forEach(([key, value]) => {\r\n obj.orbitCtrl[key] = value;\r\n });\r\n }\r\n }\r\n\r\n if (conf.width && conf.height) {\r\n setSize(conf.width, conf.height);\r\n } else if (conf.resize) {\r\n onResize();\r\n window.addEventListener('resize', onResize);\r\n }\r\n\r\n if (conf.mouse_move) {\r\n if (conf.mouse_move === 'body') {\r\n obj.mouse_move_element = document.body;\r\n } else {\r\n obj.mouse_move_element = obj.renderer.domElement;\r\n }\r\n obj.mouse_move_element.addEventListener('mousemove', onMousemove);\r\n obj.mouse_move_element.addEventListener('mouseleave', onMouseleave);\r\n }\r\n\r\n afterInitCallbacks.forEach(c => c());\r\n\r\n return true;\r\n };\r\n\r\n /**\r\n * add after init callback\r\n */\r\n function onAfterInit(callback) {\r\n afterInitCallbacks.push(callback);\r\n }\r\n\r\n /**\r\n * add after resize callback\r\n */\r\n function onAfterResize(callback) {\r\n afterResizeCallbacks.push(callback);\r\n }\r\n\r\n /**\r\n * remove after resize callback\r\n */\r\n function offAfterResize(callback) {\r\n afterResizeCallbacks = afterResizeCallbacks.filter(c => c !== callback);\r\n }\r\n\r\n /**\r\n * add before render callback\r\n */\r\n function onBeforeRender(callback) {\r\n beforeRenderCallbacks.push(callback);\r\n }\r\n\r\n /**\r\n * remove before render callback\r\n */\r\n function offBeforeRender(callback) {\r\n beforeRenderCallbacks = beforeRenderCallbacks.filter(c => c !== callback);\r\n }\r\n\r\n /**\r\n * default render\r\n */\r\n function render() {\r\n if (obj.orbitCtrl) obj.orbitCtrl.update();\r\n beforeRenderCallbacks.forEach(c => c());\r\n obj.renderer.render(obj.scene, obj.camera);\r\n }\r\n\r\n /**\r\n * composer render\r\n */\r\n function renderC() {\r\n if (obj.orbitCtrl) obj.orbitCtrl.update();\r\n beforeRenderCallbacks.forEach(c => c());\r\n obj.composer.render();\r\n }\r\n\r\n /**\r\n * remove listeners\r\n */\r\n function dispose() {\r\n beforeRenderCallbacks = [];\r\n window.removeEventListener('resize', onResize);\r\n if (obj.mouse_move_element) {\r\n obj.mouse_move_element.removeEventListener('mousemove', onMousemove);\r\n obj.mouse_move_element.removeEventListener('mouseleave', onMouseleave);\r\n }\r\n if (obj.orbitCtrl) obj.orbitCtrl.dispose();\r\n this.renderer.dispose();\r\n }\r\n\r\n /**\r\n * mousemove listener\r\n */\r\n function onMousemove(e) {\r\n mouse.x = (e.clientX / size.width) * 2 - 1;\r\n mouse.y = -(e.clientY / size.height) * 2 + 1;\r\n updateMouseV3();\r\n }\r\n\r\n /**\r\n * mouseleave listener\r\n */\r\n function onMouseleave(e) {\r\n mouse.x = 0;\r\n mouse.y = 0;\r\n updateMouseV3();\r\n }\r\n\r\n /**\r\n * get 3d mouse position\r\n */\r\n function updateMouseV3() {\r\n if (conf.mouse_raycast) {\r\n obj.camera.getWorldDirection(mousePlane.normal);\r\n mousePlane.normal.normalize();\r\n raycaster.setFromCamera(mouse, obj.camera);\r\n raycaster.ray.intersectPlane(mousePlane, mouseV3);\r\n }\r\n }\r\n\r\n /**\r\n * resize listener\r\n */\r\n function onResize() {\r\n if (conf.resize === 'window') {\r\n setSize(window.innerWidth, window.innerHeight);\r\n } else {\r\n setSize(conf.resize.clientWidth, conf.resize.clientHeight);\r\n }\r\n afterResizeCallbacks.forEach(c => c());\r\n }\r\n\r\n /**\r\n * update renderer size and camera\r\n */\r\n function setSize(width, height) {\r\n size.width = width;\r\n size.height = height;\r\n size.ratio = width / height;\r\n\r\n obj.renderer.setSize(width, height, false);\r\n obj.camera.aspect = size.ratio;\r\n obj.camera.updateProjectionMatrix();\r\n\r\n if (obj.composer) {\r\n obj.composer.setSize(width, height);\r\n }\r\n\r\n const wsize = getCameraSize();\r\n size.wWidth = wsize[0]; size.wHeight = wsize[1];\r\n }\r\n\r\n /**\r\n * calculate camera visible area size\r\n */\r\n function getCameraSize() {\r\n const vFOV = (obj.camera.fov * Math.PI) / 180;\r\n const h = 2 * Math.tan(vFOV / 2) * Math.abs(obj.camera.position.z);\r\n const w = h * obj.camera.aspect;\r\n return [w, h];\r\n }\r\n\r\n return obj;\r\n}\r\n","import { h } from 'vue';\r\nimport useThree from './useThree';\r\n\r\nexport default {\r\n props: {\r\n antialias: {\r\n type: Boolean,\r\n default: true,\r\n },\r\n alpha: {\r\n type: Boolean,\r\n default: false,\r\n },\r\n autoClear: {\r\n type: Boolean,\r\n default: true,\r\n },\r\n shadow: {\r\n type: Boolean,\r\n default: false,\r\n },\r\n orbitCtrl: {\r\n type: [Boolean, Object],\r\n default: false,\r\n },\r\n mouseMove: {\r\n type: [Boolean, String],\r\n default: false,\r\n },\r\n mouseRaycast: {\r\n type: Boolean,\r\n default: false,\r\n },\r\n resize: {\r\n type: [Boolean, String, Element],\r\n default: 'window',\r\n },\r\n width: String,\r\n height: String,\r\n },\r\n setup() {\r\n return {\r\n three: useThree(),\r\n raf: true,\r\n onMountedCallbacks: [],\r\n };\r\n },\r\n provide() {\r\n return {\r\n three: this.three,\r\n // renderer: this.three.renderer,\r\n rendererComponent: this,\r\n };\r\n },\r\n mounted() {\r\n const params = {\r\n canvas: this.$refs.canvas,\r\n antialias: this.antialias,\r\n alpha: this.alpha,\r\n autoClear: this.autoClear,\r\n orbit_ctrl: this.orbitCtrl,\r\n mouse_move: this.mouseMove,\r\n mouse_raycast: this.mouseRaycast,\r\n resize: this.resize,\r\n width: this.width,\r\n height: this.height,\r\n };\r\n\r\n if (this.three.init(params)) {\r\n this.three.renderer.shadowMap.enabled = this.shadow;\r\n if (this.three.composer) this.animateC();\r\n else this.animate();\r\n };\r\n\r\n this.onMountedCallbacks.forEach(c => c());\r\n },\r\n beforeUnmount() {\r\n this.raf = false;\r\n this.three.dispose();\r\n },\r\n methods: {\r\n onMounted(callback) {\r\n this.onMountedCallbacks.push(callback);\r\n },\r\n onBeforeRender(callback) {\r\n this.three.onBeforeRender(callback);\r\n },\r\n onAfterResize(callback) {\r\n this.three.onAfterResize(callback);\r\n },\r\n animate() {\r\n if (this.raf) requestAnimationFrame(this.animate);\r\n this.three.render();\r\n },\r\n animateC() {\r\n if (this.raf) requestAnimationFrame(this.animateC);\r\n this.three.renderC();\r\n },\r\n },\r\n render() {\r\n return h(\r\n 'canvas',\r\n { ref: 'canvas' },\r\n this.$slots.default()\r\n );\r\n },\r\n};\r\n","export function setFromProp(o, prop) {\r\n if (prop instanceof Object) {\r\n Object.entries(prop).forEach(([key, value]) => {\r\n o[key] = value;\r\n });\r\n }\r\n};\r\n\r\nexport function propsValues(props, exclude) {\r\n const values = {};\r\n Object.entries(props).forEach(([key, value]) => {\r\n if (!exclude || (exclude && !exclude.includes(key))) {\r\n values[key] = value;\r\n }\r\n });\r\n return values;\r\n};\r\n\r\nexport function lerp(value1, value2, amount) {\r\n amount = amount < 0 ? 0 : amount;\r\n amount = amount > 1 ? 1 : amount;\r\n return value1 + (value2 - value1) * amount;\r\n};\r\n\r\nexport function lerpv3(v1, v2, amount) {\r\n v1.x = lerp(v1.x, v2.x, amount);\r\n v1.y = lerp(v1.y, v2.y, amount);\r\n v1.z = lerp(v1.z, v2.z, amount);\r\n};\r\n\r\nexport function limit(val, min, max) {\r\n return val < min ? min : (val > max ? max : val);\r\n};\r\n","import { toRef, watch } from 'vue';\r\nimport { setFromProp } from '../tools.js';\r\n\r\nexport default function useBindProp(comp, prop, object) {\r\n if (comp[prop]) {\r\n const ref = toRef(comp, prop);\r\n setFromProp(object, ref.value);\r\n watch(ref, () => {\r\n setFromProp(object, ref.value);\r\n }, { deep: true });\r\n }\r\n};\r\n","import { PerspectiveCamera, Vector3 } from 'three';\r\nimport { watch } from 'vue';\r\nimport useBindProp from '../use/useBindProp.js';\r\n\r\nexport default {\r\n inject: ['three'],\r\n props: {\r\n aspect: {\r\n type: Number,\r\n default: 1,\r\n },\r\n far: {\r\n type: Number,\r\n default: 2000,\r\n },\r\n fov: {\r\n type: Number,\r\n default: 50,\r\n },\r\n near: {\r\n type: Number,\r\n default: 0.1,\r\n },\r\n position: {\r\n type: [Object, Vector3],\r\n default: { x: 0, y: 0, z: 0 },\r\n },\r\n },\r\n created() {\r\n this.camera = new PerspectiveCamera(this.fov, this.aspect, this.near, this.far);\r\n useBindProp(this, 'position', this.camera.position);\r\n\r\n ['aspect', 'far', 'fov', 'near'].forEach(p => {\r\n watch(() => this[p], () => {\r\n this.camera[p] = this[p];\r\n this.camera.updateProjectionMatrix();\r\n });\r\n });\r\n\r\n this.three.camera = this.camera;\r\n },\r\n render() {\r\n return [];\r\n },\r\n __hmrId: 'PerspectiveCamera',\r\n};\r\n","import { Scene, Color } from 'three';\r\nimport { watch } from 'vue';\r\n\r\nexport default {\r\n inject: ['three'],\r\n props: {\r\n id: String,\r\n background: [String, Number],\r\n },\r\n setup(props) {\r\n const scene = new Scene();\r\n if (props.background) scene.background = new Color(props.background);\r\n watch(() => props.background, (value) => { scene.background = new Color(value); });\r\n return { scene };\r\n },\r\n provide() {\r\n return {\r\n scene: this.scene,\r\n };\r\n },\r\n mounted() {\r\n if (!this.three.scene) {\r\n this.three.scene = this.scene;\r\n }\r\n },\r\n methods: {\r\n // add(o) {\r\n // this.scene.add(o);\r\n // },\r\n // remove(o) {\r\n // this.scene.remove(o);\r\n // },\r\n },\r\n render() {\r\n if (this.$slots.default) {\r\n return this.$slots.default();\r\n }\r\n return [];\r\n },\r\n};\r\n","import { TextureLoader } from 'three';\r\nimport { watch } from 'vue';\r\n\r\nexport default {\r\n inject: ['three'],\r\n emits: ['loaded'],\r\n props: {\r\n src: String,\r\n onLoad: Function,\r\n onProgress: Function,\r\n onError: Function,\r\n },\r\n created() {\r\n this.createTexture();\r\n watch(() => this.src, this.refreshTexture);\r\n },\r\n unmounted() {\r\n this.texture.dispose();\r\n },\r\n methods: {\r\n createTexture() {\r\n this.texture = new TextureLoader().load(this.src, this.onLoaded, this.onProgress, this.onError);\r\n },\r\n refreshTexture() {\r\n this.createTexture();\r\n },\r\n onLoaded() {\r\n if (this.onLoad) this.onLoad();\r\n this.$emit('loaded');\r\n },\r\n },\r\n render() {\r\n return [];\r\n },\r\n};\r\n","import { CubeTextureLoader } from 'three';\r\nimport { watch } from 'vue';\r\n\r\nexport default {\r\n inject: ['three'],\r\n emits: ['loaded'],\r\n props: {\r\n path: String,\r\n urls: {\r\n type: Array,\r\n default: ['px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg'],\r\n },\r\n onLoad: Function,\r\n onProgress: Function,\r\n onError: Function,\r\n },\r\n created() {\r\n this.createTexture();\r\n watch(() => this.path, this.refreshTexture);\r\n watch(() => this.urls, this.refreshTexture);\r\n },\r\n unmounted() {\r\n this.texture.dispose();\r\n },\r\n methods: {\r\n createTexture() {\r\n this.texture = new CubeTextureLoader()\r\n .setPath(this.path)\r\n .load(this.urls, this.onLoaded, this.onProgress, this.onError);\r\n },\r\n refreshTexture() {\r\n this.createTexture();\r\n },\r\n onLoaded() {\r\n if (this.onLoad) this.onLoad();\r\n this.$emit('loaded');\r\n },\r\n },\r\n render() {\r\n return [];\r\n },\r\n};\r\n","import { watch } from 'vue';\r\n\r\nexport default {\r\n emits: ['ready'],\r\n inject: ['mesh'],\r\n props: {\r\n rotateX: Number,\r\n rotateY: Number,\r\n rotateZ: Number,\r\n },\r\n created() {\r\n if (!this.mesh) {\r\n console.error('Missing parent Mesh');\r\n }\r\n this.watchProps = [];\r\n Object.entries(this.$props).forEach(e => this.watchProps.push(e[0]));\r\n },\r\n beforeMount() {\r\n this.createGeometry();\r\n this.rotateGeometry();\r\n this.mesh.setGeometry(this.geometry);\r\n },\r\n mounted() {\r\n this.addWatchers();\r\n },\r\n unmounted() {\r\n this.geometry.dispose();\r\n },\r\n methods: {\r\n rotateGeometry() {\r\n if (this.rotateX) this.geometry.rotateX(this.rotateX);\r\n if (this.rotateY) this.geometry.rotateY(this.rotateY);\r\n if (this.rotateZ) this.geometry.rotateZ(this.rotateZ);\r\n },\r\n addWatchers() {\r\n this.watchProps.forEach(prop => {\r\n watch(() => this[prop], () => {\r\n this.refreshGeometry();\r\n });\r\n });\r\n },\r\n refreshGeometry() {\r\n const oldGeo = this.geometry;\r\n this.createGeometry();\r\n this.rotateGeometry();\r\n this.mesh.setGeometry(this.geometry);\r\n oldGeo.dispose();\r\n },\r\n },\r\n render() {\r\n return [];\r\n },\r\n};\r\n","import { BoxBufferGeometry } from 'three';\r\nimport Geometry from './Geometry.js';\r\n\r\nexport default {\r\n extends: Geometry,\r\n props: {\r\n size: Number,\r\n width: { type: Number, default: 1 },\r\n height: { type: Number, default: 1 },\r\n depth: { type: Number, default: 1 },\r\n widthSegments: { type: Number, default: 1 },\r\n heightSegments: { type: Number, default: 1 },\r\n depthSegments: { type: Number, default: 1 },\r\n },\r\n methods: {\r\n createGeometry() {\r\n let w = this.width, h = this.height, d = this.depth;\r\n if (this.size) {\r\n w = this.size; h = this.size; d = this.size;\r\n }\r\n this.geometry = new BoxBufferGeometry(w, h, d, this.widthSegments, this.heightSegments, this.depthSegments);\r\n },\r\n },\r\n};\r\n","import { CircleBufferGeometry } from 'three';\nimport Geometry from './Geometry.js';\n\nexport default {\n extends: Geometry,\n props: {\n radius: { type: Number, default: 1 },\n segments: { type: Number, default: 8 },\n thetaStart: { type: Number, default: 0 },\n thetaLength: { type: Number, default: Math.PI * 2 },\n },\n methods: {\n createGeometry() {\n this.geometry = new CircleBufferGeometry(this.radius, this.segments, this.thetaStart, this.thetaLength);\n },\n },\n};\n","import { ConeBufferGeometry } from 'three';\nimport Geometry from './Geometry.js';\n\nexport default {\n extends: Geometry,\n props: {\n radius: { type: Number, default: 1 },\n height: { type: Number, default: 1 },\n radialSegments: { type: Number, default: 8 },\n heightSegments: { type: Number, default: 1 },\n openEnded: { type: Boolean, default: false },\n thetaStart: { type: Number, default: 0 },\n thetaLength: { type: Number, default: Math.PI * 2 },\n },\n methods: {\n createGeometry() {\n this.geometry = new ConeBufferGeometry(this.radius, this.height, this.radialSegments, this.heightSegments, this.openEnded, this.thetaStart, this.thetaLength);\n },\n },\n};\n","import { CylinderBufferGeometry } from 'three';\nimport Geometry from './Geometry.js';\n\nexport default {\n extends: Geometry,\n props: {\n radiusTop: { type: Number, default: 1 },\n radiusBottom: { type: Number, default: 1 },\n height: { type: Number, default: 1 },\n radialSegments: { type: Number, default: 8 },\n heightSegments: { type: Number, default: 1 },\n openEnded: { type: Boolean, default: false },\n thetaStart: { type: Number, default: 0 },\n thetaLength: { type: Number, default: Math.PI * 2 },\n },\n methods: {\n createGeometry() {\n this.geometry = new CylinderBufferGeometry(this.radiusTop, this.radiusBottom, this.height, this.radialSegments, this.heightSegments, this.openEnded, this.thetaStart, this.thetaLength);\n },\n },\n};\n","import { DodecahedronBufferGeometry } from 'three';\nimport Geometry from './Geometry.js';\n\nexport default {\n extends: Geometry,\n props: {\n radius: { type: Number, default: 1 },\n detail: { type: Number, default: 0 },\n },\n methods: {\n createGeometry() {\n this.geometry = new DodecahedronBufferGeometry(this.radius, this.detail);\n },\n },\n};\n","import { IcosahedronBufferGeometry } from 'three';\nimport Geometry from './Geometry.js';\n\nexport default {\n extends: Geometry,\n props: {\n radius: { type: Number, default: 1 },\n detail: { type: Number, default: 0 },\n },\n methods: {\n createGeometry() {\n this.geometry = new IcosahedronBufferGeometry(this.radius, this.detail);\n },\n },\n};\n","import { LatheBufferGeometry } from 'three';\nimport Geometry from './Geometry.js';\n\nexport default {\n extends: Geometry,\n props: {\n points: Array,\n segments: { type: Number, default: 12 },\n phiStart: { type: Number, default: 0 },\n phiLength: { type: Number, default: Math.PI * 2 },\n },\n methods: {\n createGeometry() {\n this.geometry = new LatheBufferGeometry(this.points, this.segments, this.phiStart, this.phiLength);\n },\n },\n};\n","import { OctahedronBufferGeometry } from 'three';\nimport Geometry from './Geometry.js';\n\nexport default {\n extends: Geometry,\n props: {\n radius: { type: Number, default: 1 },\n detail: { type: Number, default: 0 },\n },\n methods: {\n createGeometry() {\n this.geometry = new OctahedronBufferGeometry(this.radius, this.detail);\n },\n },\n};\n","import { PolyhedronBufferGeometry } from 'three';\nimport Geometry from './Geometry.js';\n\nexport default {\n extends: Geometry,\n props: {\n vertices: Array,\n indices: Array,\n radius: { type: Number, default: 1 },\n detail: { type: Number, default: 0 },\n },\n methods: {\n createGeometry() {\n this.geometry = new PolyhedronBufferGeometry(this.vertices, this.indices, this.radius, this.detail);\n },\n },\n};\n","import { RingBufferGeometry } from 'three';\nimport Geometry from './Geometry.js';\n\nexport default {\n extends: Geometry,\n props: {\n innerRadius: { type: Number, default: 0.5 },\n outerRadius: { type: Number, default: 1 },\n thetaSegments: { type: Number, default: 8 },\n phiSegments: { type: Number, default: 1 },\n thetaStart: { type: Number, default: 0 },\n thetaLength: { type: Number, default: Math.PI * 2 },\n },\n methods: {\n createGeometry() {\n this.geometry = new RingBufferGeometry(this.innerRadius, this.outerRadius, this.thetaSegments, this.phiSegments, this.thetaStart, this.thetaLength);\n },\n },\n};\n","import { SphereBufferGeometry } from 'three';\r\nimport Geometry from './Geometry.js';\r\n\r\nexport default {\r\n extends: Geometry,\r\n props: {\r\n radius: { type: Number, default: 1 },\r\n widthSegments: { type: Number, default: 12 },\r\n heightSegments: { type: Number, default: 12 },\r\n },\r\n methods: {\r\n createGeometry() {\r\n this.geometry = new SphereBufferGeometry(this.radius, this.widthSegments, this.heightSegments);\r\n },\r\n },\r\n};\r\n","import { TetrahedronBufferGeometry } from 'three';\nimport Geometry from './Geometry.js';\n\nexport default {\n extends: Geometry,\n props: {\n radius: { type: Number, default: 1 },\n detail: { type: Number, default: 0 },\n },\n methods: {\n createGeometry() {\n this.geometry = new TetrahedronBufferGeometry(this.radius, this.detail);\n },\n },\n};\n","import { TorusBufferGeometry } from 'three';\nimport Geometry from './Geometry.js';\n\nexport default {\n extends: Geometry,\n props: {\n radius: { type: Number, default: 1 },\n tube: { type: Number, default: 0.4 },\n radialSegments: { type: Number, default: 8 },\n tubularSegments: { type: Number, default: 6 },\n arc: { type: Number, default: Math.PI * 2 },\n },\n methods: {\n createGeometry() {\n this.geometry = new TorusBufferGeometry(this.radius, this.tube, this.radialSegments, this.tubularSegments, this.arc);\n },\n },\n};\n","import { TorusKnotBufferGeometry } from 'three';\nimport Geometry from './Geometry.js';\n\nexport default {\n extends: Geometry,\n props: {\n radius: { type: Number, default: 1 },\n tube: { type: Number, default: 0.4 },\n radialSegments: { type: Number, default: 64 },\n tubularSegments: { type: Number, default: 8 },\n p: { type: Number, default: 2 },\n q: { type: Number, default: 3 },\n },\n methods: {\n createGeometry() {\n this.geometry = new TorusKnotBufferGeometry(this.radius, this.tube, this.radialSegments, this.tubularSegments, this.p, this.q);\n },\n },\n};\n","import { Curve, TubeBufferGeometry } from 'three';\nimport Geometry from './Geometry.js';\n\nexport default {\n extends: Geometry,\n props: {\n path: Curve,\n tubularSegments: { type: Number, default: 64 },\n radius: { type: Number, default: 1 },\n radiusSegments: { type: Number, default: 8 },\n closed: { type: Boolean, default: false },\n },\n methods: {\n createGeometry() {\n this.geometry = new TubeBufferGeometry(this.path, this.tubularSegments, this.radius, this.radiusSegments, this.closed);\n },\n },\n};\n","import { Color } from 'three';\r\nimport { watch } from 'vue';\r\nimport { setFromProp } from '../tools.js';\r\nimport useBindProp from '../use/useBindProp.js';\r\n\r\nexport default {\r\n inject: ['scene'],\r\n props: {\r\n color: {\r\n type: String,\r\n default: '#ffffff',\r\n },\r\n intensity: {\r\n type: Number,\r\n default: 1,\r\n },\r\n castShadow: {\r\n type: Boolean,\r\n default: false,\r\n },\r\n shadowMapSize: Object,\r\n position: Object,\r\n },\r\n mounted() {\r\n useBindProp(this, 'position', this.light.position);\r\n\r\n if (this.light.target) {\r\n useBindProp(this, 'target', this.light.target.position);\r\n }\r\n\r\n if (this.light.shadow) {\r\n this.light.castShadow = this.castShadow;\r\n setFromProp(this.light.shadow.mapSize, this.shadowMapSize);\r\n }\r\n\r\n ['color', 'intensity', 'castShadow'].forEach(p => {\r\n watch(() => this[p], () => {\r\n if (p === 'color') {\r\n this.light.color = new Color(this.color);\r\n } else {\r\n this.light[p] = this[p];\r\n }\r\n });\r\n });\r\n\r\n this.scene.add(this.light);\r\n if (this.light.target) this.scene.add(this.light.target);\r\n },\r\n unmounted() {\r\n this.scene.remove(this.light);\r\n },\r\n render() {\r\n return [];\r\n },\r\n __hmrId: 'Light',\r\n};\r\n","import { AmbientLight } from 'three';\r\nimport Light from './Light.js';\r\n\r\nexport default {\r\n extends: Light,\r\n created() {\r\n this.light = new AmbientLight(this.color, this.intensity);\r\n },\r\n __hmrId: 'AmbientLight',\r\n};\r\n","import { DirectionalLight } from 'three';\r\nimport Light from './Light.js';\r\n\r\nexport default {\r\n extends: Light,\r\n props: {\r\n target: Object,\r\n },\r\n created() {\r\n this.light = new DirectionalLight(this.color, this.intensity);\r\n },\r\n __hmrId: 'DirectionalLight',\r\n};\r\n","import { PointLight } from 'three';\r\nimport Light from './Light.js';\r\n\r\nexport default {\r\n extends: Light,\r\n props: {\r\n distance: {\r\n type: Number,\r\n default: 0,\r\n },\r\n decay: {\r\n type: Number,\r\n default: 1,\r\n },\r\n },\r\n created() {\r\n this.light = new PointLight(this.color, this.intensity, this.distance, this.decay);\r\n },\r\n __hmrId: 'PointLight',\r\n};\r\n","import { SpotLight } from 'three';\r\nimport { watch } from 'vue';\r\nimport Light from './Light.js';\r\n\r\nexport default {\r\n extends: Light,\r\n props: {\r\n angle: {\r\n type: Number,\r\n default: Math.PI / 3,\r\n },\r\n decay: {\r\n type: Number,\r\n default: 1,\r\n },\r\n distance: {\r\n type: Number,\r\n default: 0,\r\n },\r\n penumbra: {\r\n type: Number,\r\n default: 0,\r\n },\r\n target: Object,\r\n },\r\n created() {\r\n this.light = new SpotLight(this.color, this.intensity, this.distance, this.angle, this.penumbra, this.decay);\r\n ['angle', 'decay', 'distance', 'penumbra'].forEach(p => {\r\n watch(() => this[p], () => {\r\n this.light[p] = this[p];\r\n });\r\n });\r\n },\r\n __hmrId: 'SpotLight',\r\n};\r\n","import { watch } from 'vue';\r\nimport { Color, FrontSide } from 'three';\r\n\r\nexport default {\r\n inject: ['three', 'mesh'],\r\n props: {\r\n id: String,\r\n color: { type: [String, Number], default: '#ffffff' },\r\n depthTest: { type: Boolean, default: true },\r\n depthWrite: { type: Boolean, default: true },\r\n flatShading: Boolean,\r\n fog: { type: Boolean, default: true },\r\n opacity: { type: Number, default: 1 },\r\n side: { type: Number, default: FrontSide },\r\n transparent: Boolean,\r\n vertexColors: Boolean,\r\n },\r\n provide() {\r\n return {\r\n material: this,\r\n };\r\n },\r\n beforeMount() {\r\n this.createMaterial();\r\n if (this.id) this.three.materials[this.id] = this.material;\r\n this.mesh.setMaterial(this.material);\r\n },\r\n mounted() {\r\n this._addWatchers();\r\n if (this.addWatchers) this.addWatchers();\r\n },\r\n unmounted() {\r\n this.material.dispose();\r\n if (this.id) delete this.three.materials[this.id];\r\n },\r\n methods: {\r\n setMap(texture) {\r\n this.material.map = texture;\r\n this.material.needsUpdate = true;\r\n },\r\n setEnvMap(texture) {\r\n this.material.envMap = texture;\r\n this.material.needsUpdate = true;\r\n },\r\n _addWatchers() {\r\n // don't work for flatShading\r\n ['color', 'depthTest', 'depthWrite', 'fog', 'opacity', 'side', 'transparent'].forEach(p => {\r\n watch(() => this[p], () => {\r\n if (p === 'color') {\r\n this.material.color.set(this.color);\r\n } else {\r\n this.material[p] = this[p];\r\n }\r\n });\r\n });\r\n },\r\n },\r\n render() {\r\n if (this.$slots.default) {\r\n return this.$slots.default();\r\n }\r\n return [];\r\n },\r\n __hmrId: 'Material',\r\n};\r\n","import { MeshBasicMaterial } from 'three';\r\nimport { propsValues } from '../tools.js';\r\nimport Material from './Material';\r\n\r\nexport default {\r\n extends: Material,\r\n methods: {\r\n createMaterial() {\r\n this.material = new MeshBasicMaterial(propsValues(this.$props, ['id']));\r\n },\r\n },\r\n __hmrId: 'BasicMaterial',\r\n};\r\n","import { MeshLambertMaterial } from 'three';\r\nimport { propsValues } from '../tools.js';\r\nimport Material from './Material';\r\n\r\nexport default {\r\n extends: Material,\r\n methods: {\r\n createMaterial() {\r\n this.material = new MeshLambertMaterial(propsValues(this.$props, ['id']));\r\n },\r\n },\r\n __hmrId: 'LambertMaterial',\r\n};\r\n","import { MeshPhongMaterial } from 'three';\r\nimport { propsValues } from '../tools.js';\r\nimport Material from './Material';\r\n\r\nexport default {\r\n extends: Material,\r\n methods: {\r\n createMaterial() {\r\n this.material = new MeshPhongMaterial(propsValues(this.$props, ['id']));\r\n },\r\n },\r\n __hmrId: 'PhongMaterial',\r\n};\r\n","import { Color, MeshStandardMaterial } from 'three';\r\nimport { watch } from 'vue';\r\nimport { propsValues } from '../tools.js';\r\nimport Material from './Material';\r\n\r\nexport default {\r\n extends: Material,\r\n props: {\r\n emissive: { type: [Number, String], default: 0 },\r\n emissiveIntensity: { type: Number, default: 1 },\r\n metalness: { type: Number, default: 0 },\r\n roughness: { type: Number, default: 1 },\r\n },\r\n methods: {\r\n createMaterial() {\r\n this.material = new MeshStandardMaterial(propsValues(this.$props, ['id']));\r\n },\r\n addWatchers() {\r\n ['emissive', 'emissiveIntensity', 'metalness', 'roughness'].forEach(p => {\r\n watch(() => this[p], (value) => {\r\n if (p === 'emissive') {\r\n this.material.emissive = new Color(value);\r\n } else {\r\n this.material[p] = value;\r\n }\r\n });\r\n });\r\n },\r\n },\r\n __hmrId: 'StandardMaterial',\r\n};\r\n","import { MeshPhysicalMaterial } from 'three';\r\nimport { propsValues } from '../tools.js';\r\nimport StandardMaterial from './StandardMaterial';\r\n\r\nexport default {\r\n extends: StandardMaterial,\r\n methods: {\r\n createMaterial() {\r\n this.material = new MeshPhysicalMaterial(propsValues(this.$props, ['id']));\r\n },\r\n },\r\n __hmrId: 'PhysicalMaterial',\r\n};\r\n","/**\n * ------------------------------------------------------------------------------------------\n * Subsurface Scattering shader\n * Based on three/examples/jsm/shaders/SubsurfaceScatteringShader.js\n * Based on GDC 2011 – Approximating Translucency for a Fast, Cheap and Convincing Subsurface Scattering Look\n * https://colinbarrebrisebois.com/2011/03/07/gdc-2011-approximating-translucency-for-a-fast-cheap-and-convincing-subsurface-scattering-look/\n *------------------------------------------------------------------------------------------\n */\nimport {\n Color,\n ShaderChunk,\n ShaderLib,\n UniformsUtils,\n} from 'three';\n\nfunction replaceAll(string, find, replace) {\n return string.split(find).join(replace);\n}\n\nconst meshphongFragHead = ShaderChunk.meshphong_frag.slice(0, ShaderChunk.meshphong_frag.indexOf('void main() {'));\nconst meshphongFragBody = ShaderChunk.meshphong_frag.slice(ShaderChunk.meshphong_frag.indexOf('void main() {'));\n\nconst SubsurfaceScatteringShader = {\n\n uniforms: UniformsUtils.merge([\n ShaderLib.phong.uniforms,\n {\n thicknessColor: { value: new Color(0x668597) },\n thicknessDistortion: { value: 0.1 },\n thicknessAmbient: { value: 0.0 },\n thicknessAttenuation: { value: 0.1 },\n thicknessPower: { value: 2.0 },\n thicknessScale: { value: 10.0 },\n },\n ]),\n\n vertexShader: `\n #define USE_UV\n ${ShaderChunk.meshphong_vert}\n `,\n\n fragmentShader: `\n #define USE_UV\n #define SUBSURFACE\n\n ${meshphongFragHead}\n\n uniform float thicknessPower;\n uniform float thicknessScale;\n uniform float thicknessDistortion;\n uniform float thicknessAmbient;\n uniform float thicknessAttenuation;\n uniform vec3 thicknessColor;\n\n void RE_Direct_Scattering(const in IncidentLight directLight, const in vec2 uv, const in GeometricContext geometry, inout ReflectedLight reflectedLight) {\n #ifdef USE_COLOR\n vec3 thickness = vColor * thicknessColor;\n #else\n vec3 thickness = thicknessColor;\n #endif\n vec3 scatteringHalf = normalize(directLight.direction + (geometry.normal * thicknessDistortion));\n float scatteringDot = pow(saturate(dot(geometry.viewDir, -scatteringHalf)), thicknessPower) * thicknessScale;\n vec3 scatteringIllu = (scatteringDot + thicknessAmbient) * thickness;\n reflectedLight.directDiffuse += scatteringIllu * thicknessAttenuation * directLight.color;\n }\n ` + meshphongFragBody.replace(\n '#include ',\n replaceAll(\n ShaderChunk.lights_fragment_begin,\n 'RE_Direct( directLight, geometry, material, reflectedLight );',\n `\n RE_Direct( directLight, geometry, material, reflectedLight );\n #if defined( SUBSURFACE ) && defined( USE_UV )\n RE_Direct_Scattering(directLight, vUv, geometry, reflectedLight);\n #endif\n `\n )\n ),\n};\n\nexport default SubsurfaceScatteringShader;\n","export default {\r\n inject: ['three', 'mesh'],\r\n props: {\r\n id: String,\r\n uniforms: Object,\r\n vertexShader: String,\r\n fragmentShader: String,\r\n },\r\n beforeMount() {\r\n this.createMaterial();\r\n if (this.id) this.three.materials[this.id] = this.material;\r\n this.mesh.setMaterial(this.material);\r\n },\r\n mounted() {\r\n if (this.addWatchers) this.addWatchers();\r\n },\r\n unmounted() {\r\n this.material.dispose();\r\n if (this.id) delete this.three.materials[this.id];\r\n },\r\n render() {\r\n return [];\r\n },\r\n __hmrId: 'ShaderMaterial',\r\n};\r\n","import { Color, ShaderMaterial as TShaderMaterial, UniformsUtils } from 'three';\r\nimport SubsurfaceScatteringShader from './SubsurfaceScatteringShader.js';\r\nimport ShaderMaterial from './ShaderMaterial';\r\n\r\nexport default {\r\n extends: ShaderMaterial,\r\n props: {\r\n diffuse: { type: String, default: '#ffffff' },\r\n thicknessColor: { type: String, default: '#ffffff' },\r\n thicknessDistortion: { type: Number, default: 0.4 },\r\n thicknessAmbient: { type: Number, default: 0.01 },\r\n thicknessAttenuation: { type: Number, default: 0.7 },\r\n thicknessPower: { type: Number, default: 2 },\r\n thicknessScale: { type: Number, default: 4 },\r\n transparent: { type: Boolean, default: false },\r\n opacity: { type: Number, default: 1 },\r\n vertexColors: { type: Boolean, default: false },\r\n },\r\n methods: {\r\n createMaterial() {\r\n const params = SubsurfaceScatteringShader;\r\n const uniforms = UniformsUtils.clone(params.uniforms);\r\n Object.entries(this.$props).forEach(([key, value]) => {\r\n if (key === 'diffuse' || key === 'thicknessColor') {\r\n value = new Color(value);\r\n }\r\n if (key !== 'id' && key !== 'transparent' && key !== 'vertexColors') {\r\n uniforms[key].value = value;\r\n }\r\n });\r\n\r\n this.material = new TShaderMaterial({\r\n ...params,\r\n uniforms,\r\n lights: true,\r\n transparent: this.transparent,\r\n vertexColors: this.vertexColors,\r\n });\r\n },\r\n },\r\n __hmrId: 'SubSurfaceMaterial',\r\n};\r\n","import { MeshToonMaterial } from 'three';\r\nimport { propsValues } from '../tools.js';\r\nimport Material from './Material';\r\n\r\nexport default {\r\n extends: Material,\r\n methods: {\r\n createMaterial() {\r\n this.material = new MeshToonMaterial(propsValues(this.$props, ['id']));\r\n },\r\n },\r\n __hmrId: 'ToonMaterial',\r\n};\r\n","import Texture from '../core/Texture';\r\n\r\nexport default {\r\n extends: Texture,\r\n inject: ['material'],\r\n created() {\r\n this.material.setMap(this.texture);\r\n },\r\n unmounted() {\r\n this.material.setMap(null);\r\n },\r\n methods: {\r\n refreshTexture() {\r\n this.createTexture();\r\n this.material.setMap(this.texture);\r\n },\r\n },\r\n __hmrId: 'Map',\r\n};\r\n","import CubeTexture from '../core/CubeTexture';\r\n\r\nexport default {\r\n extends: CubeTexture,\r\n inject: ['material'],\r\n created() {\r\n this.material.setEnvMap(this.texture);\r\n },\r\n unmounted() {\r\n this.material.setEnvMap(null);\r\n },\r\n methods: {\r\n refreshTexture() {\r\n this.createTexture();\r\n this.material.setEnvMap(this.texture);\r\n },\r\n },\r\n __hmrId: 'EnvMap',\r\n};\r\n","import { Mesh } from 'three';\nimport { watch } from 'vue';\nimport useBindProp from '../use/useBindProp.js';\n\nexport default {\n inject: ['three', 'scene', 'rendererComponent'],\n emits: ['ready'],\n props: {\n materialId: String,\n position: Object,\n rotation: Object,\n scale: Object,\n castShadow: Boolean,\n receiveShadow: Boolean,\n },\n provide() {\n return {\n mesh: this,\n };\n },\n mounted() {\n // console.log('Mesh mounted');\n if (this.geometry && !this.mesh) this.initMesh();\n },\n unmounted() {\n // console.log('Mesh unmounted');\n if (this.mesh) this.scene.remove(this.mesh);\n if (this.geometry) this.geometry.dispose();\n if (this.material && !this.materialId) this.material.dispose();\n },\n methods: {\n initMesh() {\n if (!this.material && this.materialId) {\n this.material = this.three.materials[this.materialId];\n }\n this.mesh = new Mesh(this.geometry, this.material);\n this.bindProps();\n this.scene.add(this.mesh);\n this.$emit('ready');\n },\n bindProps() {\n useBindProp(this, 'position', this.mesh.position);\n useBindProp(this, 'rotation', this.mesh.rotation);\n useBindProp(this, 'scale', this.mesh.scale);\n\n ['castShadow', 'receiveShadow'].forEach(p => {\n this.mesh[p] = this[p];\n watch(() => this[p], () => { this.mesh[p] = this[p]; });\n });\n\n watch(() => this.materialId, () => {\n this.mesh.material = this.three.materials[this.materialId];\n });\n },\n setGeometry(geometry) {\n this.geometry = geometry;\n if (this.mesh) this.mesh.geometry = geometry;\n },\n setMaterial(material) {\n this.material = material;\n if (this.mesh) this.mesh.material = material;\n },\n refreshGeometry() {\n const oldGeo = this.geometry;\n this.createGeometry();\n this.mesh.geometry = this.geometry;\n oldGeo.dispose();\n },\n },\n render() {\n if (this.$slots.default) {\n return this.$slots.default();\n }\n return [];\n },\n __hmrId: 'Mesh',\n};\n","import { BoxBufferGeometry } from 'three';\r\nimport { watch } from 'vue';\r\nimport Mesh from './Mesh.js';\r\n\r\nexport default {\r\n extends: Mesh,\r\n props: {\r\n size: Number,\r\n width: { type: Number, default: 1 },\r\n height: { type: Number, default: 1 },\r\n depth: { type: Number, default: 1 },\r\n widthSegments: { type: Number, default: 1 },\r\n heightSegments: { type: Number, default: 1 },\r\n depthSegments: { type: Number, default: 1 },\r\n },\r\n created() {\r\n this.createGeometry();\r\n\r\n ['size', 'width', 'height', 'depth', 'widthSegments', 'heightSegments', 'depthSegments'].forEach(prop => {\r\n watch(() => this[prop], () => {\r\n this.refreshGeometry();\r\n });\r\n });\r\n },\r\n methods: {\r\n createGeometry() {\r\n if (this.size) {\r\n this.geometry = new BoxBufferGeometry(this.size, this.size, this.size);\r\n } else {\r\n this.geometry = new BoxBufferGeometry(this.width, this.height, this.depth);\r\n }\r\n },\r\n },\r\n __hmrId: 'Box',\r\n};\r\n","import { CircleBufferGeometry } from 'three';\nimport { watch } from 'vue';\nimport Mesh from './Mesh.js';\n\nexport default {\n extends: Mesh,\n props: {\n radius: { type: Number, default: 1 },\n segments: { type: Number, default: 8 },\n thetaStart: { type: Number, default: 0 },\n thetaLength: { type: Number, default: Math.PI * 2 },\n },\n created() {\n this.createGeometry();\n\n const watchProps = ['radius', 'segments', 'thetaStart', 'thetaLength'];\n watchProps.forEach(prop => {\n watch(() => this[prop], () => {\n this.refreshGeometry();\n });\n });\n },\n methods: {\n createGeometry() {\n this.geometry = new CircleBufferGeometry(this.radius, this.segments, this.thetaStart, this.thetaLength);\n },\n },\n __hmrId: 'Circle',\n};\n","import { ConeBufferGeometry } from 'three';\nimport { watch } from 'vue';\nimport Mesh from './Mesh.js';\n\nexport default {\n extends: Mesh,\n props: {\n radius: { type: Number, default: 1 },\n height: { type: Number, default: 1 },\n radialSegments: { type: Number, default: 8 },\n heightSegments: { type: Number, default: 1 },\n openEnded: { type: Boolean, default: false },\n thetaStart: { type: Number, default: 0 },\n thetaLength: { type: Number, default: Math.PI * 2 },\n },\n created() {\n this.createGeometry();\n\n const watchProps = ['radius', 'height', 'radialSegments', 'heightSegments', 'openEnded', 'thetaStart', 'thetaLength'];\n watchProps.forEach(prop => {\n watch(() => this[prop], () => {\n this.refreshGeometry();\n });\n });\n },\n methods: {\n createGeometry() {\n this.geometry = new ConeBufferGeometry(this.radius, this.height, this.radialSegments, this.heightSegments, this.openEnded, this.thetaStart, this.thetaLength);\n },\n },\n __hmrId: 'Cone',\n};\n","import { CylinderBufferGeometry } from 'three';\nimport { watch } from 'vue';\nimport Mesh from './Mesh.js';\n\nexport default {\n extends: Mesh,\n props: {\n radiusTop: { type: Number, default: 1 },\n radiusBottom: { type: Number, default: 1 },\n height: { type: Number, default: 1 },\n radialSegments: { type: Number, default: 8 },\n heightSegments: { type: Number, default: 1 },\n openEnded: { type: Boolean, default: false },\n thetaStart: { type: Number, default: 0 },\n thetaLength: { type: Number, default: Math.PI * 2 },\n },\n created() {\n this.createGeometry();\n\n const watchProps = ['radiusTop', 'radiusBottom', 'height', 'radialSegments', 'heightSegments', 'openEnded', 'thetaStart', 'thetaLength'];\n watchProps.forEach(prop => {\n watch(() => this[prop], () => {\n this.refreshGeometry();\n });\n });\n },\n methods: {\n createGeometry() {\n this.geometry = new CylinderBufferGeometry(this.radiusTop, this.radiusBottom, this.height, this.radialSegments, this.heightSegments, this.openEnded, this.thetaStart, this.thetaLength);\n },\n },\n __hmrId: 'Cylinder',\n};\n","import { DodecahedronBufferGeometry } from 'three';\nimport { watch } from 'vue';\nimport Mesh from './Mesh.js';\n\nexport default {\n extends: Mesh,\n props: {\n radius: { type: Number, default: 1 },\n detail: { type: Number, default: 0 },\n },\n created() {\n this.createGeometry();\n\n const watchProps = ['radius', 'detail'];\n watchProps.forEach(prop => {\n watch(() => this[prop], () => {\n this.refreshGeometry();\n });\n });\n },\n methods: {\n createGeometry() {\n this.geometry = new DodecahedronBufferGeometry(this.radius, this.detail);\n },\n },\n __hmrId: 'Dodecahedron',\n};\n","import { IcosahedronBufferGeometry } from 'three';\nimport { watch } from 'vue';\nimport Mesh from './Mesh.js';\n\nexport default {\n extends: Mesh,\n props: {\n radius: { type: Number, default: 1 },\n detail: { type: Number, default: 0 },\n },\n created() {\n this.createGeometry();\n\n const watchProps = ['radius', 'detail'];\n watchProps.forEach(prop => {\n watch(() => this[prop], () => {\n this.refreshGeometry();\n });\n });\n },\n methods: {\n createGeometry() {\n this.geometry = new IcosahedronBufferGeometry(this.radius, this.detail);\n },\n },\n __hmrId: 'Icosahedron',\n};\n","import { LatheBufferGeometry } from 'three';\nimport { watch } from 'vue';\nimport Mesh from './Mesh.js';\n\nexport default {\n extends: Mesh,\n props: {\n points: Array,\n segments: { type: Number, default: 12 },\n phiStart: { type: Number, default: 0 },\n phiLength: { type: Number, default: Math.PI * 2 },\n },\n created() {\n this.createGeometry();\n\n const watchProps = ['points', 'segments', 'phiStart', 'phiLength'];\n watchProps.forEach(prop => {\n watch(() => this[prop], () => {\n this.refreshGeometry();\n });\n });\n },\n methods: {\n createGeometry() {\n this.geometry = new LatheBufferGeometry(this.points, this.segments, this.phiStart, this.phiLength);\n },\n },\n __hmrId: 'Lathe',\n};\n","import { OctahedronBufferGeometry } from 'three';\nimport { watch } from 'vue';\nimport Mesh from './Mesh.js';\n\nexport default {\n extends: Mesh,\n props: {\n radius: { type: Number, default: 1 },\n detail: { type: Number, default: 0 },\n },\n created() {\n this.createGeometry();\n\n const watchProps = ['radius', 'detail'];\n watchProps.forEach(prop => {\n watch(() => this[prop], () => {\n this.refreshGeometry();\n });\n });\n },\n methods: {\n createGeometry() {\n this.geometry = new OctahedronBufferGeometry(this.radius, this.detail);\n },\n },\n __hmrId: 'Octahedron',\n};\n","import { PlaneBufferGeometry } from 'three';\r\nimport { watch } from 'vue';\r\nimport Mesh from './Mesh.js';\r\n\r\nexport default {\r\n extends: Mesh,\r\n props: {\r\n width: { type: Number, default: 1 },\r\n height: { type: Number, default: 1 },\r\n widthSegments: { type: Number, default: 1 },\r\n heightSegments: { type: Number, default: 1 },\r\n },\r\n created() {\r\n this.createGeometry();\r\n\r\n const watchProps = ['width', 'height', 'widthSegments', 'heightSegments'];\r\n watchProps.forEach(prop => {\r\n watch(() => this[prop], () => {\r\n this.refreshGeometry();\r\n });\r\n });\r\n },\r\n methods: {\r\n createGeometry() {\r\n this.geometry = new PlaneBufferGeometry(this.width, this.height, this.widthSegments, this.heightSegments);\r\n },\r\n },\r\n __hmrId: 'Plane',\r\n};\r\n","import { PolyhedronBufferGeometry } from 'three';\nimport { watch } from 'vue';\nimport Mesh from './Mesh.js';\n\nexport default {\n extends: Mesh,\n props: {\n vertices: Array,\n indices: Array,\n radius: { type: Number, default: 1 },\n detail: { type: Number, default: 0 },\n },\n created() {\n this.createGeometry();\n\n const watchProps = ['vertices', 'indices', 'radius', 'detail'];\n watchProps.forEach(prop => {\n watch(() => this[prop], () => {\n this.refreshGeometry();\n });\n });\n },\n methods: {\n createGeometry() {\n this.geometry = new PolyhedronBufferGeometry(this.vertices, this.indices, this.radius, this.detail);\n },\n },\n __hmrId: 'Polyhedron',\n};\n","import { RingBufferGeometry } from 'three';\nimport { watch } from 'vue';\nimport Mesh from './Mesh.js';\n\nexport default {\n extends: Mesh,\n props: {\n innerRadius: { type: Number, default: 0.5 },\n outerRadius: { type: Number, default: 1 },\n thetaSegments: { type: Number, default: 8 },\n phiSegments: { type: Number, default: 1 },\n thetaStart: { type: Number, default: 0 },\n thetaLength: { type: Number, default: Math.PI * 2 },\n },\n created() {\n this.createGeometry();\n\n const watchProps = ['innerRadius', 'outerRadius', 'thetaSegments', 'phiSegments', 'thetaStart', 'thetaLength'];\n watchProps.forEach(prop => {\n watch(() => this[prop], () => {\n this.refreshGeometry();\n });\n });\n },\n methods: {\n createGeometry() {\n this.geometry = new RingBufferGeometry(this.innerRadius, this.outerRadius, this.thetaSegments, this.phiSegments, this.thetaStart, this.thetaLength);\n },\n },\n __hmrId: 'Ring',\n};\n","import { SphereBufferGeometry } from 'three';\r\nimport Mesh from './Mesh.js';\r\n\r\nexport default {\r\n extends: Mesh,\r\n props: {\r\n radius: Number,\r\n widthSegments: { type: Number, default: 12 },\r\n heightSegments: { type: Number, default: 12 },\r\n },\r\n watch: {\r\n radius() { this.refreshGeometry(); },\r\n widthSegments() { this.refreshGeometry(); },\r\n heightSegments() { this.refreshGeometry(); },\r\n },\r\n created() {\r\n this.createGeometry();\r\n },\r\n methods: {\r\n createGeometry() {\r\n this.geometry = new SphereBufferGeometry(this.radius, this.widthSegments, this.heightSegments);\r\n },\r\n },\r\n __hmrId: 'Sphere',\r\n};\r\n","import { TetrahedronBufferGeometry } from 'three';\nimport { watch } from 'vue';\nimport Mesh from './Mesh.js';\n\nexport default {\n extends: Mesh,\n props: {\n radius: { type: Number, default: 1 },\n detail: { type: Number, default: 0 },\n },\n created() {\n this.createGeometry();\n\n const watchProps = ['radius', 'detail'];\n watchProps.forEach(prop => {\n watch(() => this[prop], () => {\n this.refreshGeometry();\n });\n });\n },\n methods: {\n createGeometry() {\n this.geometry = new TetrahedronBufferGeometry(this.radius, this.detail);\n },\n },\n __hmrId: 'Tetrahedron',\n};\n","export default {\n text: String,\n fontSrc: String,\n size: { type: Number, default: 80 },\n height: { type: Number, default: 5 },\n depth: { type: Number, default: 1 },\n curveSegments: { type: Number, default: 12 },\n bevelEnabled: { type: Boolean, default: false },\n bevelThickness: { type: Number, default: 10 },\n bevelSize: { type: Number, default: 8 },\n bevelOffset: { type: Number, default: 0 },\n bevelSegments: { type: Number, default: 5 },\n align: { type: [Boolean, String], default: false },\n};\n","import { FontLoader, TextBufferGeometry } from 'three';\nimport { watch } from 'vue';\nimport Mesh from './Mesh.js';\nimport TextProps from './TextProps.js';\n\nexport default {\n extends: Mesh,\n props: {\n ...TextProps,\n },\n created() {\n // add watchers\n const watchProps = [\n 'text', 'size', 'height', 'curveSegments',\n 'bevelEnabled', 'bevelThickness', 'bevelSize', 'bevelOffset', 'bevelSegments',\n 'align',\n ];\n watchProps.forEach(p => {\n watch(() => this[p], () => {\n if (this.font) this.refreshGeometry();\n });\n });\n\n const loader = new FontLoader();\n loader.load(this.fontSrc, (font) => {\n this.font = font;\n this.createGeometry();\n this.initMesh();\n });\n },\n methods: {\n createGeometry() {\n this.geometry = new TextBufferGeometry(this.text, {\n font: this.font,\n size: this.size,\n height: this.height,\n depth: this.depth,\n curveSegments: this.curveSegments,\n bevelEnabled: this.bevelEnabled,\n bevelThickness: this.bevelThickness,\n bevelSize: this.bevelSize,\n bevelOffset: this.bevelOffset,\n bevelSegments: this.bevelSegments,\n });\n\n if (this.align === 'center') {\n this.geometry.center();\n }\n },\n },\n};\n","import { TorusBufferGeometry } from 'three';\nimport { watch } from 'vue';\nimport Mesh from './Mesh.js';\n\nexport default {\n extends: Mesh,\n props: {\n radius: { type: Number, default: 0.5 },\n tube: { type: Number, default: 0.4 },\n radialSegments: { type: Number, default: 8 },\n tubularSegments: { type: Number, default: 6 },\n arc: { type: Number, default: Math.PI * 2 },\n },\n created() {\n this.createGeometry();\n\n const watchProps = ['radius', 'tube', 'radialSegments', 'tubularSegments', 'arc'];\n watchProps.forEach(prop => {\n watch(() => this[prop], () => {\n this.refreshGeometry();\n });\n });\n },\n methods: {\n createGeometry() {\n this.geometry = new TorusBufferGeometry(this.radius, this.tube, this.radialSegments, this.tubularSegments, this.arc);\n },\n },\n __hmrId: 'Torus',\n};\n","import { TorusKnotBufferGeometry } from 'three';\nimport { watch } from 'vue';\nimport Mesh from './Mesh.js';\n\nexport default {\n extends: Mesh,\n props: {\n radius: { type: Number, default: 0.5 },\n tube: { type: Number, default: 0.4 },\n radialSegments: { type: Number, default: 64 },\n tubularSegments: { type: Number, default: 8 },\n p: { type: Number, default: 2 },\n q: { type: Number, default: 3 },\n },\n created() {\n this.createGeometry();\n\n const watchProps = ['radius', 'tube', 'radialSegments', 'tubularSegments', 'p', 'q'];\n watchProps.forEach(prop => {\n watch(() => this[prop], () => {\n this.refreshGeometry();\n });\n });\n },\n methods: {\n createGeometry() {\n this.geometry = new TorusKnotBufferGeometry(this.radius, this.tube, this.radialSegments, this.tubularSegments, this.p, this.q);\n },\n },\n __hmrId: 'TorusKnot',\n};\n","import { Curve, TubeBufferGeometry } from 'three';\nimport { watch } from 'vue';\nimport Mesh from './Mesh.js';\n\nexport default {\n extends: Mesh,\n props: {\n path: Curve,\n tubularSegments: { type: Number, default: 64 },\n radius: { type: Number, default: 1 },\n radialSegments: { type: Number, default: 8 },\n closed: { type: Boolean, default: false },\n },\n created() {\n this.createGeometry();\n\n const watchProps = ['path', 'tubularSegments', 'radius', 'radialSegments', 'closed'];\n watchProps.forEach(prop => {\n watch(() => this[prop], () => {\n this.refreshGeometry();\n });\n });\n },\n methods: {\n createGeometry() {\n this.geometry = new TubeBufferGeometry(this.path, this.tubularSegments, this.radius, this.radialSegments, this.closed);\n },\n },\n __hmrId: 'Tube',\n};\n","import {\r\n BackSide,\r\n CubeCamera,\r\n FrontSide,\r\n LinearMipmapLinearFilter,\r\n Mesh as TMesh,\r\n RGBFormat,\r\n WebGLCubeRenderTarget,\r\n} from 'three';\r\n// import { watch } from 'vue';\r\nimport Mesh from '../meshes/Mesh.js';\r\nimport useBindProp from '../use/useBindProp.js';\r\n\r\nexport default {\r\n extends: Mesh,\r\n props: {\r\n cubeRTSize: { type: Number, default: 512 },\r\n cubeCameraNear: { type: Number, default: 0.1 },\r\n cubeCameraFar: { type: Number, default: 2000 },\r\n autoUpdate: Boolean,\r\n },\r\n mounted() {\r\n this.initGem();\r\n if (this.autoUpdate) this.three.onBeforeRender(this.updateCubeRT);\r\n else this.rendererComponent.onMounted(this.updateCubeRT);\r\n },\r\n unmounted() {\r\n this.three.offBeforeRender(this.updateCubeRT);\r\n if (this.meshBack) this.scene.remove(this.meshBack);\r\n if (this.materialBack) this.materialBack.dispose();\r\n },\r\n methods: {\r\n initGem() {\r\n const cubeRT = new WebGLCubeRenderTarget(this.cubeRTSize, { format: RGBFormat, generateMipmaps: true, minFilter: LinearMipmapLinearFilter });\r\n this.cubeCamera = new CubeCamera(this.cubeCameraNear, this.cubeCameraFar, cubeRT);\r\n useBindProp(this, 'position', this.cubeCamera.position);\r\n this.scene.add(this.cubeCamera);\r\n\r\n this.material.side = FrontSide;\r\n this.material.envMap = cubeRT.texture;\r\n this.material.envMapIntensity = 10;\r\n this.material.metalness = 0;\r\n this.material.roughness = 0;\r\n this.material.opacity = 0.75;\r\n this.material.transparent = true;\r\n this.material.premultipliedAlpha = true;\r\n this.material.needsUpdate = true;\r\n\r\n this.materialBack = this.material.clone();\r\n this.materialBack.side = BackSide;\r\n this.materialBack.envMapIntensity = 5;\r\n this.materialBack.metalness = 1;\r\n this.materialBack.roughness = 0;\r\n this.materialBack.opacity = 0.5;\r\n\r\n this.meshBack = new TMesh(this.geometry, this.materialBack);\r\n\r\n useBindProp(this, 'position', this.meshBack.position);\r\n useBindProp(this, 'rotation', this.meshBack.rotation);\r\n useBindProp(this, 'scale', this.meshBack.scale);\r\n this.scene.add(this.meshBack);\r\n },\r\n updateCubeRT() {\r\n this.mesh.visible = false;\r\n this.meshBack.visible = false;\r\n this.cubeCamera.update(this.three.renderer, this.scene);\r\n this.mesh.visible = true;\r\n this.meshBack.visible = true;\r\n },\r\n },\r\n __hmrId: 'Gem',\r\n};\r\n","import { DoubleSide, MeshBasicMaterial, PlaneBufferGeometry, TextureLoader } from 'three';\r\nimport { watch } from 'vue';\r\nimport Mesh from './Mesh.js';\r\n\r\nexport default {\r\n emits: ['loaded'],\r\n extends: Mesh,\r\n props: {\r\n src: String,\r\n width: Number,\r\n height: Number,\r\n keepSize: Boolean,\r\n },\r\n created() {\r\n this.createGeometry();\r\n this.createMaterial();\r\n this.initMesh();\r\n\r\n watch(() => this.src, this.refreshTexture);\r\n\r\n ['width', 'height'].forEach(p => {\r\n watch(() => this[p], this.resize);\r\n });\r\n\r\n if (this.keepSize) this.three.onAfterResize(this.resize);\r\n },\r\n methods: {\r\n createGeometry() {\r\n this.geometry = new PlaneBufferGeometry(1, 1, 1, 1);\r\n },\r\n createMaterial() {\r\n this.material = new MeshBasicMaterial({ side: DoubleSide, map: this.loadTexture() });\r\n },\r\n loadTexture() {\r\n return new TextureLoader().load(this.src, this.onLoaded);\r\n },\r\n refreshTexture() {\r\n if (this.texture) this.texture.dispose();\r\n this.material.map = this.loadTexture();\r\n this.material.needsUpdate = true;\r\n },\r\n onLoaded(texture) {\r\n this.texture = texture;\r\n this.resize();\r\n this.$emit('loaded');\r\n },\r\n resize() {\r\n if (!this.texture) return;\r\n const screen = this.three.size;\r\n const iW = this.texture.image.width;\r\n const iH = this.texture.image.height;\r\n const iRatio = iW / iH;\r\n let w, h;\r\n if (this.width && this.height) {\r\n w = this.width * screen.wWidth / screen.width;\r\n h = this.height * screen.wHeight / screen.height;\r\n } else if (this.width) {\r\n w = this.width * screen.wWidth / screen.width;\r\n h = w / iRatio;\r\n } else if (this.height) {\r\n h = this.height * screen.wHeight / screen.height;\r\n w = h * iRatio;\r\n }\r\n this.mesh.scale.x = w;\r\n this.mesh.scale.y = h;\r\n },\r\n },\r\n __hmrId: 'Image',\r\n};\r\n","import { InstancedMesh } from 'three';\r\nimport { watch } from 'vue';\r\nimport useBindProp from '../use/useBindProp.js';\r\n\r\nexport default {\r\n inject: ['three', 'scene'],\r\n props: {\r\n materialId: String,\r\n count: Number,\r\n position: Object,\r\n castShadow: Boolean,\r\n receiveShadow: Boolean,\r\n },\r\n provide() {\r\n return {\r\n mesh: this,\r\n };\r\n },\r\n beforeMount() {\r\n if (!this.$slots.default) {\r\n console.error('Missing Geometry');\r\n }\r\n },\r\n mounted() {\r\n this.initMesh();\r\n },\r\n unmounted() {\r\n this.scene.remove(this.mesh);\r\n },\r\n methods: {\r\n initMesh() {\r\n if (!this.material && this.materialId) {\r\n this.material = this.three.materials[this.materialId];\r\n }\r\n\r\n this.mesh = new InstancedMesh(this.geometry, this.material, this.count);\r\n\r\n useBindProp(this, 'position', this.mesh.position);\r\n useBindProp(this, 'rotation', this.mesh.rotation);\r\n useBindProp(this, 'scale', this.mesh.scale);\r\n\r\n ['castShadow', 'receiveShadow'].forEach(p => {\r\n this.mesh[p] = this[p];\r\n watch(() => this[p], () => { this.mesh[p] = this[p]; });\r\n });\r\n\r\n // watch(() => this.materialId, () => {\r\n // this.mesh.material = this.three.materials[this.materialId];\r\n // });\r\n\r\n this.scene.add(this.mesh);\r\n },\r\n setGeometry(geometry) {\r\n this.geometry = geometry;\r\n if (this.mesh) this.mesh.geometry = geometry;\r\n },\r\n setMaterial(material) {\r\n this.material = material;\r\n if (this.mesh) this.mesh.material = material;\r\n },\r\n },\r\n render() {\r\n return this.$slots.default();\r\n },\r\n __hmrId: 'InstancedMesh',\r\n};\r\n","import {\r\n CubeCamera,\r\n LinearMipmapLinearFilter,\r\n RGBFormat,\r\n WebGLCubeRenderTarget,\r\n} from 'three';\r\n// import { watch } from 'vue';\r\nimport Mesh from './Mesh.js';\r\nimport useBindProp from '../use/useBindProp.js';\r\n\r\nexport default {\r\n extends: Mesh,\r\n props: {\r\n cubeRTSize: { type: Number, default: 512 },\r\n cubeCameraNear: { type: Number, default: 0.1 },\r\n cubeCameraFar: { type: Number, default: 2000 },\r\n autoUpdate: Boolean,\r\n },\r\n mounted() {\r\n this.initMirrorMesh();\r\n if (this.autoUpdate) this.three.onBeforeRender(this.updateCubeRT);\r\n else this.rendererComponent.onMounted(this.updateCubeRT);\r\n },\r\n unmounted() {\r\n this.three.offBeforeRender(this.updateCubeRT);\r\n },\r\n methods: {\r\n initMirrorMesh() {\r\n const cubeRT = new WebGLCubeRenderTarget(this.cubeRTSize, { format: RGBFormat, generateMipmaps: true, minFilter: LinearMipmapLinearFilter });\r\n this.cubeCamera = new CubeCamera(this.cubeCameraNear, this.cubeCameraFar, cubeRT);\r\n useBindProp(this, 'position', this.cubeCamera.position);\r\n this.scene.add(this.cubeCamera);\r\n\r\n this.material.envMap = cubeRT.texture;\r\n this.material.needsUpdate = true;\r\n },\r\n updateCubeRT() {\r\n this.mesh.visible = false;\r\n this.cubeCamera.update(this.three.renderer, this.scene);\r\n this.mesh.visible = true;\r\n },\r\n },\r\n __hmrId: 'MirrorMesh',\r\n};\r\n","import {\r\n CubeCamera,\r\n CubeRefractionMapping,\r\n LinearMipmapLinearFilter,\r\n RGBFormat,\r\n WebGLCubeRenderTarget,\r\n} from 'three';\r\n// import { watch } from 'vue';\r\nimport Mesh from './Mesh.js';\r\nimport useBindProp from '../use/useBindProp.js';\r\n\r\nexport default {\r\n extends: Mesh,\r\n props: {\r\n cubeRTSize: { type: Number, default: 512 },\r\n cubeCameraNear: { type: Number, default: 0.1 },\r\n cubeCameraFar: { type: Number, default: 2000 },\r\n autoUpdate: Boolean,\r\n },\r\n mounted() {\r\n this.initMirrorMesh();\r\n if (this.autoUpdate) this.three.onBeforeRender(this.updateCubeRT);\r\n else this.rendererComponent.onMounted(this.updateCubeRT);\r\n },\r\n unmounted() {\r\n this.three.offBeforeRender(this.updateCubeRT);\r\n },\r\n methods: {\r\n initMirrorMesh() {\r\n const cubeRT = new WebGLCubeRenderTarget(this.cubeRTSize, { mapping: CubeRefractionMapping, format: RGBFormat, generateMipmaps: true, minFilter: LinearMipmapLinearFilter });\r\n this.cubeCamera = new CubeCamera(this.cubeCameraNear, this.cubeCameraFar, cubeRT);\r\n useBindProp(this, 'position', this.cubeCamera.position);\r\n this.scene.add(this.cubeCamera);\r\n\r\n this.material.envMap = cubeRT.texture;\r\n this.material.refractionRatio = 0.95;\r\n this.material.needsUpdate = true;\r\n },\r\n updateCubeRT() {\r\n this.mesh.visible = false;\r\n this.cubeCamera.update(this.three.renderer, this.scene);\r\n this.mesh.visible = true;\r\n },\r\n },\r\n __hmrId: 'RefractionMesh',\r\n};\r\n","import { Sprite, SpriteMaterial, TextureLoader } from 'three';\r\nimport { watch } from 'vue';\r\nimport useBindProp from '../use/useBindProp.js';\r\n\r\nexport default {\r\n emits: ['ready', 'loaded'],\r\n inject: ['three', 'scene'],\r\n props: {\r\n src: String,\r\n position: Object,\r\n scale: Object,\r\n },\r\n mounted() {\r\n this.texture = new TextureLoader().load(this.src, this.onLoaded);\r\n this.material = new SpriteMaterial({ map: this.texture });\r\n this.sprite = new Sprite(this.material);\r\n this.geometry = this.sprite.geometry;\r\n\r\n useBindProp(this, 'position', this.sprite.position);\r\n useBindProp(this, 'scale', this.sprite.scale);\r\n\r\n // watch(() => this.src, () => {\r\n // this.texture = new TextureLoader().load(this.src, this.onLoaded);\r\n // this.material.map = this.texture;\r\n // });\r\n\r\n this.scene.add(this.sprite);\r\n this.$emit('ready');\r\n },\r\n unmounted() {\r\n this.texture.dispose();\r\n this.material.dispose();\r\n this.scene.remove(this.sprite);\r\n },\r\n methods: {\r\n onLoaded() {\r\n this.updateUV();\r\n this.$emit('loaded');\r\n },\r\n updateUV() {\r\n this.iWidth = this.texture.image.width;\r\n this.iHeight = this.texture.image.height;\r\n this.iRatio = this.iWidth / this.iHeight;\r\n\r\n let x = 0.5, y = 0.5;\r\n if (this.iRatio > 1) {\r\n y = 0.5 / this.iRatio;\r\n } else {\r\n x = 0.5 / this.iRatio;\r\n }\r\n\r\n const positions = this.geometry.attributes.position.array;\r\n positions[0] = -x; positions[1] = -y;\r\n positions[5] = x; positions[6] = -y;\r\n positions[10] = x; positions[11] = y;\r\n positions[15] = -x; positions[16] = y;\r\n this.geometry.attributes.position.needsUpdate = true;\r\n },\r\n },\r\n render() {\r\n return [];\r\n },\r\n __hmrId: 'Sprite',\r\n};\r\n","import { EffectComposer } from 'three/examples/jsm/postprocessing/EffectComposer.js';\r\n\r\nexport default {\r\n setup() {\r\n return {\r\n passes: [],\r\n };\r\n },\r\n inject: ['three'],\r\n provide() {\r\n return {\r\n passes: this.passes,\r\n };\r\n },\r\n mounted() {\r\n this.three.onAfterInit(() => {\r\n this.composer = new EffectComposer(this.three.renderer);\r\n this.three.renderer.autoClear = false;\r\n this.passes.forEach(pass => {\r\n this.composer.addPass(pass);\r\n });\r\n this.three.composer = this.composer;\r\n });\r\n },\r\n render() {\r\n return this.$slots.default();\r\n },\r\n __hmrId: 'EffectComposer',\r\n};\r\n","export default {\r\n inject: ['three', 'passes'],\r\n beforeMount() {\r\n if (!this.passes) {\r\n console.error('Missing parent EffectComposer');\r\n }\r\n },\r\n unmounted() {\r\n if (this.pass.dispose) this.pass.dispose();\r\n },\r\n render() {\r\n return [];\r\n },\r\n __hmrId: 'EffectPass',\r\n};\r\n","import { RenderPass } from 'three/examples/jsm/postprocessing/RenderPass.js';\r\nimport EffectPass from './EffectPass.js';\r\n\r\nexport default {\r\n extends: EffectPass,\r\n mounted() {\r\n if (!this.three.scene) {\r\n console.error('Missing Scene');\r\n }\r\n if (!this.three.camera) {\r\n console.error('Missing Camera');\r\n }\r\n const pass = new RenderPass(this.three.scene, this.three.camera);\r\n this.passes.push(pass);\r\n this.pass = pass;\r\n },\r\n __hmrId: 'RenderPass',\r\n};\r\n","import { BokehPass } from 'three/examples/jsm/postprocessing/BokehPass.js';\r\nimport EffectPass from './EffectPass.js';\r\n\r\nexport default {\r\n extends: EffectPass,\r\n props: {\r\n focus: {\r\n type: Number,\r\n default: 1,\r\n },\r\n aperture: {\r\n type: Number,\r\n default: 0.025,\r\n },\r\n maxblur: {\r\n type: Number,\r\n default: 0.01,\r\n },\r\n },\r\n watch: {\r\n focus() { this.pass.uniforms.focus.value = this.focus; },\r\n aperture() { this.pass.uniforms.aperture.value = this.aperture; },\r\n maxblur() { this.pass.uniforms.maxblur.value = this.maxblur; },\r\n },\r\n mounted() {\r\n if (!this.three.scene) {\r\n console.error('Missing Scene');\r\n }\r\n if (!this.three.camera) {\r\n console.error('Missing Camera');\r\n }\r\n const params = {\r\n focus: this.focus,\r\n aperture: this.aperture,\r\n maxblur: this.maxblur,\r\n width: this.three.size.width,\r\n height: this.three.size.height,\r\n };\r\n const pass = new BokehPass(this.three.scene, this.three.camera, params);\r\n this.passes.push(pass);\r\n this.pass = pass;\r\n },\r\n __hmrId: 'BokehPass',\r\n};\r\n","import { FilmPass } from 'three/examples/jsm/postprocessing/FilmPass.js';\r\nimport EffectPass from './EffectPass.js';\r\n\r\nexport default {\r\n extends: EffectPass,\r\n props: {\r\n noiseIntensity: {\r\n type: Number,\r\n default: 0.5,\r\n },\r\n scanlinesIntensity: {\r\n type: Number,\r\n default: 0.05,\r\n },\r\n scanlinesCount: {\r\n type: Number,\r\n default: 4096,\r\n },\r\n grayscale: {\r\n type: Number,\r\n default: 0,\r\n },\r\n },\r\n watch: {\r\n noiseIntensity() { this.pass.uniforms.nIntensity.value = this.noiseIntensity; },\r\n scanlinesIntensity() { this.pass.uniforms.sIntensity.value = this.scanlinesIntensity; },\r\n scanlinesCount() { this.pass.uniforms.sCount.value = this.scanlinesCount; },\r\n grayscale() { this.pass.uniforms.grayscale.value = this.grayscale; },\r\n },\r\n mounted() {\r\n const pass = new FilmPass(this.noiseIntensity, this.scanlinesIntensity, this.scanlinesCount, this.grayscale);\r\n this.passes.push(pass);\r\n this.pass = pass;\r\n },\r\n __hmrId: 'FilmPass',\r\n};\r\n","import { HalftonePass } from 'three/examples/jsm/postprocessing/HalftonePass.js';\r\nimport { watch } from 'vue';\r\nimport EffectPass from './EffectPass.js';\r\n\r\nexport default {\r\n extends: EffectPass,\r\n props: {\r\n shape: { type: Number, default: 1 },\r\n radius: { type: Number, default: 4 },\r\n rotateR: { type: Number, default: Math.PI / 12 * 1 },\r\n rotateG: { type: Number, default: Math.PI / 12 * 2 },\r\n rotateB: { type: Number, default: Math.PI / 12 * 3 },\r\n scatter: { type: Number, default: 0 },\r\n },\r\n mounted() {\r\n const pass = new HalftonePass(this.three.size.width, this.three.size.height, {});\r\n\r\n ['shape', 'radius', 'rotateR', 'rotateG', 'rotateB', 'scatter'].forEach(p => {\r\n pass.uniforms[p].value = this[p];\r\n watch(() => this[p], () => {\r\n pass.uniforms[p].value = this[p];\r\n });\r\n });\r\n\r\n this.passes.push(pass);\r\n this.pass = pass;\r\n },\r\n __hmrId: 'HalftonePass',\r\n};\r\n","import { Vector2 } from 'three';\r\nimport { SAOPass } from 'three/examples/jsm/postprocessing/SAOPass.js';\r\nimport { watch } from 'vue';\r\nimport EffectPass from './EffectPass.js';\r\n\r\nexport default {\r\n extends: EffectPass,\r\n props: {\r\n depthTexture: { type: Boolean, default: false },\r\n useNormals: { type: Boolean, default: false },\r\n resolution: Object,\r\n },\r\n mounted() {\r\n if (!this.three.scene) {\r\n console.error('Missing Scene');\r\n }\r\n if (!this.three.camera) {\r\n console.error('Missing Camera');\r\n }\r\n\r\n const resolution = this.resolution ? new Vector2(this.resolution.x, this.resolution.y) : new Vector2(this.three.size.width, this.three.size.height);\r\n const pass = new SAOPass(this.three.scene, this.three.camera, this.depthTexture, this.useNormals, resolution);\r\n this.passes.push(pass);\r\n this.pass = pass;\r\n },\r\n __hmrId: 'SAOPass',\r\n};\r\n","import { Vector2 } from 'three';\r\nimport { UnrealBloomPass } from 'three/examples/jsm/postprocessing/UnrealBloomPass.js';\r\nimport EffectPass from './EffectPass.js';\r\n\r\nexport default {\r\n extends: EffectPass,\r\n props: {\r\n strength: { type: Number, default: 1.5 },\r\n radius: { type: Number, default: 0 },\r\n threshold: { type: Number, default: 0 },\r\n },\r\n watch: {\r\n strength() { this.pass.strength = this.strength; },\r\n radius() { this.pass.radius = this.radius; },\r\n threshold() { this.pass.threshold = this.threshold; },\r\n },\r\n mounted() {\r\n const size = new Vector2(this.three.size.width, this.three.size.height);\r\n const pass = new UnrealBloomPass(size, this.strength, this.radius, this.threshold);\r\n this.passes.push(pass);\r\n this.pass = pass;\r\n },\r\n __hmrId: 'UnrealBloomPass',\r\n};\r\n","export default `\n//\n// Description : Array and textureless GLSL 2D simplex noise function.\n// Author : Ian McEwan, Ashima Arts.\n// Maintainer : ijm\n// Lastmod : 20110822 (ijm)\n// License : Copyright (C) 2011 Ashima Arts. All rights reserved.\n// Distributed under the MIT License. See LICENSE file.\n// https://github.com/ashima/webgl-noise\n//\n\nvec3 mod289(vec3 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec2 mod289(vec2 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec3 permute(vec3 x) {\n return mod289(((x*34.0)+1.0)*x);\n}\n\nfloat snoise(vec2 v)\n{\n const vec4 C = vec4(0.211324865405187, // (3.0-sqrt(3.0))/6.0\n 0.366025403784439, // 0.5*(sqrt(3.0)-1.0)\n -0.577350269189626, // -1.0 + 2.0 * C.x\n 0.024390243902439); // 1.0 / 41.0\n // First corner\n vec2 i = floor(v + dot(v, C.yy) );\n vec2 x0 = v - i + dot(i, C.xx);\n\n // Other corners\n vec2 i1;\n i1 = (x0.x > x0.y) ? vec2(1.0, 0.0) : vec2(0.0, 1.0);\n vec4 x12 = x0.xyxy + C.xxzz;\n x12.xy -= i1;\n\n // Permutations\n i = mod289(i); // Avoid truncation effects in permutation\n vec3 p = permute( permute( i.y + vec3(0.0, i1.y, 1.0 ))\n + i.x + vec3(0.0, i1.x, 1.0 ));\n\n vec3 m = max(0.5 - vec3(dot(x0,x0), dot(x12.xy,x12.xy), dot(x12.zw,x12.zw)), 0.0);\n m = m*m ;\n m = m*m ;\n\n // Gradients: 41 points uniformly over a line, mapped onto a diamond.\n // The ring size 17*17 = 289 is close to a multiple of 41 (41*7 = 287)\n\n vec3 x = 2.0 * fract(p * C.www) - 1.0;\n vec3 h = abs(x) - 0.5;\n vec3 ox = floor(x + 0.5);\n vec3 a0 = x - ox;\n\n // Normalise gradients implicitly by scaling m\n // Approximation of: m *= inversesqrt( a0*a0 + h*h );\n m *= 1.79284291400159 - 0.85373472095314 * ( a0*a0 + h*h );\n\n // Compute final noise value at P\n vec3 g;\n g.x = a0.x * x0.x + h.x * x0.y;\n g.yz = a0.yz * x12.xz + h.yz * x12.yw;\n return 130.0 * dot(m, g);\n}\n`;\n","import { DoubleSide, MeshBasicMaterial, PlaneBufferGeometry } from 'three';\r\nimport { watch } from 'vue';\r\nimport Image from '../../meshes/Image.js';\r\nimport snoise2 from '../../glsl/snoise2.glsl.js';\r\n\r\nexport default {\r\n extends: Image,\r\n props: {\r\n widthSegments: { type: Number, default: 20 },\r\n heightSegments: { type: Number, default: 20 },\r\n timeCoef: { type: Number, default: 0.001 },\r\n noiseCoef: { type: Number, default: 1 },\r\n zCoef: { type: Number, default: 5 },\r\n dispCoef: { type: Number, default: 0.05 },\r\n },\r\n setup(props) {\r\n // uniforms\r\n const uTime = { value: 0 };\r\n const uNoiseCoef = { value: props.noiseCoef };\r\n watch(() => props.noiseCoef, (value) => { uNoiseCoef.value = value; });\r\n const uZCoef = { value: props.zCoef };\r\n watch(() => props.zCoef, (value) => { uZCoef.value = value; });\r\n const uDispCoef = { value: props.dispCoef };\r\n watch(() => props.dispCoef, (value) => { uDispCoef.value = value; });\r\n\r\n return {\r\n uTime, uNoiseCoef, uZCoef, uDispCoef,\r\n };\r\n },\r\n mounted() {\r\n this.startTime = Date.now();\r\n this.three.onBeforeRender(this.updateTime);\r\n },\r\n unmounted() {\r\n this.three.offBeforeRender(this.updateTime);\r\n },\r\n methods: {\r\n createGeometry() {\r\n this.geometry = new PlaneBufferGeometry(1, 1, this.widthSegments, this.heightSegments);\r\n },\r\n createMaterial() {\r\n this.material = new MeshBasicMaterial({ side: DoubleSide, map: this.loadTexture() });\r\n this.material.onBeforeCompile = (shader) => {\r\n shader.uniforms.uTime = this.uTime;\r\n shader.uniforms.uNoiseCoef = this.uNoiseCoef;\r\n shader.uniforms.uZCoef = this.uZCoef;\r\n shader.uniforms.uDispCoef = this.uDispCoef;\r\n shader.vertexShader = `\r\n uniform float uTime;\r\n uniform float uNoiseCoef;\r\n uniform float uZCoef;\r\n varying float vNoise;\r\n ${snoise2}\r\n ` + shader.vertexShader;\r\n\r\n shader.vertexShader = shader.vertexShader.replace(\r\n '#include ',\r\n ` \r\n vec3 p = vec3(position * uNoiseCoef);\r\n p.x += uTime;\r\n vNoise = snoise(p.xy);\r\n vec3 transformed = vec3(position);\r\n transformed.z += vNoise * uZCoef;\r\n `\r\n );\r\n\r\n shader.fragmentShader = `\r\n uniform float uDispCoef;\r\n varying float vNoise;\r\n ` + shader.fragmentShader;\r\n\r\n shader.fragmentShader = shader.fragmentShader.replace(\r\n '#include ',\r\n `\r\n vec4 texelColor = texture2D(map, vUv);\r\n vec4 dispTexel = texture2D(map, vUv + vec2(vNoise * uDispCoef, 0));\r\n texelColor.r = dispTexel.r;\r\n diffuseColor = texelColor;\r\n `\r\n );\r\n this.materialShader = shader;\r\n };\r\n },\r\n updateTime() {\r\n this.uTime.value = (Date.now() - this.startTime) * this.timeCoef;\r\n },\r\n },\r\n __hmrId: 'NoisyImage',\r\n};\r\n","export default `\n//\n// Description : Array and textureless GLSL 2D/3D/4D simplex\n// noise functions.\n// Author : Ian McEwan, Ashima Arts.\n// Maintainer : ijm\n// Lastmod : 20110822 (ijm)\n// License : Copyright (C) 2011 Ashima Arts. All rights reserved.\n// Distributed under the MIT License. See LICENSE file.\n// https://github.com/ashima/webgl-noise\n//\n\nvec3 mod289(vec3 x) { return x - floor(x * (1.0 / 289.0)) * 289.0; }\nvec4 mod289(vec4 x) { return x - floor(x * (1.0 / 289.0)) * 289.0; }\nvec4 permute(vec4 x) { return mod289(((x*34.0)+1.0)*x); }\nvec4 taylorInvSqrt(vec4 r) { return 1.79284291400159 - 0.85373472095314 * r; }\n\nfloat snoise(vec3 v)\n{\n const vec2 C = vec2(1.0/6.0, 1.0/3.0) ;\n const vec4 D = vec4(0.0, 0.5, 1.0, 2.0);\n\n // First corner\n vec3 i = floor(v + dot(v, C.yyy) );\n vec3 x0 = v - i + dot(i, C.xxx) ;\n\n // Other corners\n vec3 g = step(x0.yzx, x0.xyz);\n vec3 l = 1.0 - g;\n vec3 i1 = min( g.xyz, l.zxy );\n vec3 i2 = max( g.xyz, l.zxy );\n\n vec3 x1 = x0 - i1 + C.xxx;\n vec3 x2 = x0 - i2 + C.yyy; // 2.0*C.x = 1/3 = C.y\n vec3 x3 = x0 - D.yyy; // -1.0+3.0*C.x = -0.5 = -D.y\n\n // Permutations\n i = mod289(i);\n vec4 p = permute( permute( permute(\n i.z + vec4(0.0, i1.z, i2.z, 1.0 ))\n + i.y + vec4(0.0, i1.y, i2.y, 1.0 ))\n + i.x + vec4(0.0, i1.x, i2.x, 1.0 ));\n\n // Gradients: 7x7 points over a square, mapped onto an octahedron.\n // The ring size 17*17 = 289 is close to a multiple of 49 (49*6 = 294)\n float n_ = 0.142857142857; // 1.0/7.0\n vec3 ns = n_ * D.wyz - D.xzx;\n\n vec4 j = p - 49.0 * floor(p * ns.z * ns.z); // mod(p,7*7)\n\n vec4 x_ = floor(j * ns.z);\n vec4 y_ = floor(j - 7.0 * x_ ); // mod(j,N)\n\n vec4 x = x_ *ns.x + ns.yyyy;\n vec4 y = y_ *ns.x + ns.yyyy;\n vec4 h = 1.0 - abs(x) - abs(y);\n\n vec4 b0 = vec4( x.xy, y.xy );\n vec4 b1 = vec4( x.zw, y.zw );\n\n vec4 s0 = floor(b0)*2.0 + 1.0;\n vec4 s1 = floor(b1)*2.0 + 1.0;\n vec4 sh = -step(h, vec4(0.0));\n\n vec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy ;\n vec4 a1 = b1.xzyw + s1.xzyw*sh.zzww ;\n\n vec3 p0 = vec3(a0.xy,h.x);\n vec3 p1 = vec3(a0.zw,h.y);\n vec3 p2 = vec3(a1.xy,h.z);\n vec3 p3 = vec3(a1.zw,h.w);\n\n // Normalise gradients\n vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3)));\n p0 *= norm.x;\n p1 *= norm.y;\n p2 *= norm.z;\n p3 *= norm.w;\n\n // Mix final noise value\n vec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.0);\n m = m * m;\n return 42.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1),\n dot(p2,x2), dot(p3,x3) ) );\n}\n`;\n","import { watch } from 'vue';\r\nimport Plane from '../../meshes/Plane.js';\r\nimport snoise3 from '../../glsl/snoise3.glsl.js';\r\n\r\nexport default {\r\n extends: Plane,\r\n props: {\r\n timeCoef: { type: Number, default: 0.001 },\r\n noiseCoef: { type: Number, default: 1 },\r\n zCoef: { type: Number, default: 5 },\r\n },\r\n setup(props) {\r\n // uniforms\r\n const uTime = { value: 0 };\r\n const uNoiseCoef = { value: props.noiseCoef };\r\n watch(() => props.noiseCoef, (value) => { uNoiseCoef.value = value; });\r\n const uZCoef = { value: props.zCoef };\r\n watch(() => props.zCoef, (value) => { uZCoef.value = value; });\r\n\r\n return {\r\n uTime, uNoiseCoef, uZCoef,\r\n };\r\n },\r\n mounted() {\r\n this.updateMaterial();\r\n this.startTime = Date.now();\r\n this.three.onBeforeRender(this.updateTime);\r\n },\r\n unmounted() {\r\n this.three.offBeforeRender(this.updateTime);\r\n },\r\n methods: {\r\n updateMaterial() {\r\n this.material.onBeforeCompile = (shader) => {\r\n shader.uniforms.uTime = this.uTime;\r\n shader.uniforms.uNoiseCoef = this.uNoiseCoef;\r\n shader.uniforms.uZCoef = this.uZCoef;\r\n shader.vertexShader = `\r\n uniform float uTime;\r\n uniform float uNoiseCoef;\r\n uniform float uZCoef;\r\n varying float vNoise;\r\n ${snoise3}\r\n ` + shader.vertexShader;\r\n\r\n shader.vertexShader = shader.vertexShader.replace(\r\n '#include ',\r\n ` \r\n vec3 p = vec3(position * uNoiseCoef);\r\n vNoise = snoise(vec3(p.x, p.y, uTime));\r\n vec3 transformed = vec3(position);\r\n transformed.z += vNoise * uZCoef;\r\n `\r\n );\r\n this.materialShader = shader;\r\n };\r\n this.material.needsupdate = true;\r\n },\r\n updateTime() {\r\n this.uTime.value = (Date.now() - this.startTime) * this.timeCoef;\r\n },\r\n },\r\n __hmrId: 'NoisyPlane',\r\n};\r\n","export default `\n//\n// Description : Array and textureless GLSL 2D/3D/4D simplex\n// noise functions.\n// Author : Ian McEwan, Ashima Arts.\n// Maintainer : ijm\n// Lastmod : 20110822 (ijm)\n// License : Copyright (C) 2011 Ashima Arts. All rights reserved.\n// Distributed under the MIT License. See LICENSE file.\n// https://github.com/ashima/webgl-noise\n//\n\nvec4 mod289(vec4 x) { return x - floor(x * (1.0 / 289.0)) * 289.0; }\nfloat mod289(float x) { return x - floor(x * (1.0 / 289.0)) * 289.0; }\nvec4 permute(vec4 x) { return mod289(((x*34.0)+1.0)*x); }\nfloat permute(float x) { return mod289(((x*34.0)+1.0)*x); }\nvec4 taylorInvSqrt(vec4 r) { return 1.79284291400159 - 0.85373472095314 * r; }\nfloat taylorInvSqrt(float r) { return 1.79284291400159 - 0.85373472095314 * r; }\n\nvec4 grad4(float j, vec4 ip)\n{\n const vec4 ones = vec4(1.0, 1.0, 1.0, -1.0);\n vec4 p,s;\n\n p.xyz = floor( fract (vec3(j) * ip.xyz) * 7.0) * ip.z - 1.0;\n p.w = 1.5 - dot(abs(p.xyz), ones.xyz);\n s = vec4(lessThan(p, vec4(0.0)));\n p.xyz = p.xyz + (s.xyz*2.0 - 1.0) * s.www;\n\n return p;\n}\n\n// (sqrt(5) - 1)/4 = F4, used once below\n#define F4 0.309016994374947451\n\nfloat snoise(vec4 v)\n{\n const vec4 C = vec4( 0.138196601125011, // (5 - sqrt(5))/20 G4\n 0.276393202250021, // 2 * G4\n 0.414589803375032, // 3 * G4\n -0.447213595499958); // -1 + 4 * G4\n\n // First corner\n vec4 i = floor(v + dot(v, vec4(F4)) );\n vec4 x0 = v - i + dot(i, C.xxxx);\n\n // Other corners\n\n // Rank sorting originally contributed by Bill Licea-Kane, AMD (formerly ATI)\n vec4 i0;\n vec3 isX = step( x0.yzw, x0.xxx );\n vec3 isYZ = step( x0.zww, x0.yyz );\n // i0.x = dot( isX, vec3( 1.0 ) );\n i0.x = isX.x + isX.y + isX.z;\n i0.yzw = 1.0 - isX;\n // i0.y += dot( isYZ.xy, vec2( 1.0 ) );\n i0.y += isYZ.x + isYZ.y;\n i0.zw += 1.0 - isYZ.xy;\n i0.z += isYZ.z;\n i0.w += 1.0 - isYZ.z;\n\n // i0 now contains the unique values 0,1,2,3 in each channel\n vec4 i3 = clamp( i0, 0.0, 1.0 );\n vec4 i2 = clamp( i0-1.0, 0.0, 1.0 );\n vec4 i1 = clamp( i0-2.0, 0.0, 1.0 );\n\n vec4 x1 = x0 - i1 + C.xxxx;\n vec4 x2 = x0 - i2 + C.yyyy;\n vec4 x3 = x0 - i3 + C.zzzz;\n vec4 x4 = x0 + C.wwww;\n\n // Permutations\n i = mod289(i);\n float j0 = permute( permute( permute( permute(i.w) + i.z) + i.y) + i.x);\n vec4 j1 = permute( permute( permute( permute (\n i.w + vec4(i1.w, i2.w, i3.w, 1.0 ))\n + i.z + vec4(i1.z, i2.z, i3.z, 1.0 ))\n + i.y + vec4(i1.y, i2.y, i3.y, 1.0 ))\n + i.x + vec4(i1.x, i2.x, i3.x, 1.0 ));\n\n // Gradients: 7x7x6 points over a cube, mapped onto a 4-cross polytope\n // 7*7*6 = 294, which is close to the ring size 17*17 = 289.\n vec4 ip = vec4(1.0/294.0, 1.0/49.0, 1.0/7.0, 0.0) ;\n\n vec4 p0 = grad4(j0, ip);\n vec4 p1 = grad4(j1.x, ip);\n vec4 p2 = grad4(j1.y, ip);\n vec4 p3 = grad4(j1.z, ip);\n vec4 p4 = grad4(j1.w, ip);\n\n // Normalise gradients\n vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3)));\n p0 *= norm.x;\n p1 *= norm.y;\n p2 *= norm.z;\n p3 *= norm.w;\n p4 *= taylorInvSqrt(dot(p4,p4));\n\n // Mix contributions from the five corners\n vec3 m0 = max(0.6 - vec3(dot(x0,x0), dot(x1,x1), dot(x2,x2)), 0.0);\n vec2 m1 = max(0.6 - vec2(dot(x3,x3), dot(x4,x4) ), 0.0);\n m0 = m0 * m0;\n m1 = m1 * m1;\n return 49.0 * ( dot(m0*m0, vec3( dot( p0, x0 ), dot( p1, x1 ), dot( p2, x2 )))\n + dot(m1*m1, vec2( dot( p3, x3 ), dot( p4, x4 ) ) ) ) ;\n\n}\n`;\n","import { watch } from 'vue';\r\nimport Sphere from '../../meshes/Sphere.js';\r\nimport snoise4 from '../../glsl/snoise4.glsl.js';\r\n\r\nexport default {\r\n extends: Sphere,\r\n props: {\r\n radius: { type: Number, default: 20 },\r\n widthSegments: { type: Number, default: 128 },\r\n heightSegments: { type: Number, default: 128 },\r\n timeCoef: { type: Number, default: 0.001 },\r\n noiseCoef: { type: Number, default: 0.05 },\r\n dispCoef: { type: Number, default: 5 },\r\n },\r\n setup(props) {\r\n // uniforms\r\n const uTime = { value: 0 };\r\n const uNoiseCoef = { value: props.noiseCoef };\r\n watch(() => props.noiseCoef, (value) => { uNoiseCoef.value = value; });\r\n const uDispCoef = { value: props.dispCoef };\r\n watch(() => props.dispCoef, (value) => { uDispCoef.value = value; });\r\n\r\n return {\r\n uTime, uNoiseCoef, uDispCoef,\r\n };\r\n },\r\n mounted() {\r\n this.updateMaterial();\r\n\r\n this.startTime = Date.now();\r\n this.three.onBeforeRender(this.updateTime);\r\n },\r\n unmounted() {\r\n this.three.offBeforeRender(this.updateTime);\r\n },\r\n methods: {\r\n updateMaterial() {\r\n this.material.onBeforeCompile = (shader) => {\r\n shader.uniforms.uTime = this.uTime;\r\n shader.uniforms.uNoiseCoef = this.uNoiseCoef;\r\n shader.uniforms.uDispCoef = this.uDispCoef;\r\n shader.vertexShader = `\r\n uniform float uTime;\r\n uniform float uNoiseCoef;\r\n uniform float uDispCoef;\r\n varying float vNoise;\r\n ${snoise4}\r\n ` + shader.vertexShader;\r\n\r\n shader.vertexShader = shader.vertexShader.replace(\r\n '#include ',\r\n `\r\n vec4 p = vec4(vec3(position * uNoiseCoef), uTime);\r\n vNoise = snoise(p);\r\n vec3 transformed = vec3(position);\r\n transformed += normalize(position) * vNoise * uDispCoef;\r\n `\r\n );\r\n this.materialShader = shader;\r\n };\r\n this.material.needsupdate = true;\r\n },\r\n updateTime() {\r\n this.uTime.value = (Date.now() - this.startTime) * this.timeCoef;\r\n },\r\n },\r\n __hmrId: 'NoisySphere',\r\n};\r\n","import { watch } from 'vue';\nimport Text from '../../meshes/Text.js';\nimport snoise2 from '../../glsl/snoise2.glsl.js';\n\nexport default {\n extends: Text,\n props: {\n timeCoef: { type: Number, default: 0.001 },\n noiseCoef: { type: Number, default: 0.015 },\n zCoef: { type: Number, default: 10 },\n },\n setup(props) {\n // uniforms\n const uTime = { value: 0 };\n const uNoiseCoef = { value: props.noiseCoef };\n watch(() => props.noiseCoef, (value) => { uNoiseCoef.value = value; });\n const uZCoef = { value: props.zCoef };\n watch(() => props.zCoef, (value) => { uZCoef.value = value; });\n\n return {\n uTime, uNoiseCoef, uZCoef,\n };\n },\n mounted() {\n this.updateMaterial();\n\n this.startTime = Date.now();\n this.three.onBeforeRender(this.updateTime);\n },\n unmounted() {\n this.three.offBeforeRender(this.updateTime);\n },\n methods: {\n updateMaterial() {\n this.material.onBeforeCompile = (shader) => {\n shader.uniforms.uTime = this.uTime;\n shader.uniforms.uNoiseCoef = this.uNoiseCoef;\n shader.uniforms.uZCoef = this.uZCoef;\n shader.vertexShader = `\n uniform float uTime;\n uniform float uNoiseCoef;\n uniform float uZCoef;\n ${snoise2}\n ` + shader.vertexShader;\n\n shader.vertexShader = shader.vertexShader.replace(\n '#include ',\n ` \n vec3 p = vec3(position * uNoiseCoef);\n p.x += uTime;\n float noise = snoise(p.xy);\n vec3 transformed = vec3(position);\n transformed.z += noise * uZCoef;\n `\n );\n this.materialShader = shader;\n };\n this.material.needsupdate = true;\n },\n updateTime() {\n this.uTime.value = (Date.now() - this.startTime) * this.timeCoef;\n },\n },\n __hmrId: 'NoisyText',\n};\n","\r\nimport {\r\n BufferGeometry,\r\n DoubleSide,\r\n Face3,\r\n Geometry,\r\n InstancedBufferAttribute,\r\n InstancedMesh,\r\n MathUtils,\r\n MeshBasicMaterial,\r\n Object3D,\r\n Vector2,\r\n Vector3,\r\n} from 'three';\r\n\r\nexport default class AnimatedPlane {\r\n constructor(params) {\r\n Object.entries(params).forEach(([key, value]) => {\r\n this[key] = value;\r\n });\r\n\r\n this.o3d = new Object3D();\r\n this.uProgress = { value: 0 };\r\n this.uvScale = new Vector2();\r\n\r\n this.initMaterial();\r\n this.initPlane();\r\n }\r\n\r\n initMaterial() {\r\n this.material = new MeshBasicMaterial({\r\n side: DoubleSide,\r\n transparent: true,\r\n map: this.texture,\r\n onBeforeCompile: shader => {\r\n shader.uniforms.progress = this.uProgress;\r\n shader.uniforms.uvScale = { value: this.uvScale };\r\n shader.vertexShader = `\r\n uniform float progress;\r\n uniform vec2 uvScale;\r\n\r\n attribute vec3 offset;\r\n attribute vec3 rotation;\r\n attribute vec2 uvOffset;\r\n\r\n mat3 rotationMatrixXYZ(vec3 r)\r\n {\r\n float cx = cos(r.x);\r\n float sx = sin(r.x);\r\n float cy = cos(r.y);\r\n float sy = sin(r.y);\r\n float cz = cos(r.z);\r\n float sz = sin(r.z);\r\n\r\n return mat3(\r\n cy * cz, cx * sz + sx * sy * cz, sx * sz - cx * sy * cz,\r\n -cy * sz, cx * cz - sx * sy * sz, sx * cz + cx * sy * sz,\r\n sy, -sx * cy, cx * cy\r\n );\r\n }\r\n ` + shader.vertexShader;\r\n\r\n shader.vertexShader = shader.vertexShader.replace('#include ', `\r\n #include \r\n vUv = vUv * uvScale + uvOffset;\r\n `);\r\n\r\n shader.vertexShader = shader.vertexShader.replace('#include ', `\r\n mat3 rotMat = rotationMatrixXYZ(progress * rotation);\r\n transformed = rotMat * transformed;\r\n\r\n vec4 mvPosition = vec4(transformed, 1.0);\r\n #ifdef USE_INSTANCING\r\n mvPosition = instanceMatrix * mvPosition;\r\n #endif\r\n\r\n mvPosition.xyz += progress * offset;\r\n\r\n mvPosition = modelViewMatrix * mvPosition;\r\n gl_Position = projectionMatrix * mvPosition;\r\n `);\r\n },\r\n });\r\n }\r\n\r\n initPlane() {\r\n const { width, wWidth, wHeight } = this.screen;\r\n this.wSize = this.size * wWidth / width;\r\n this.nx = Math.ceil(wWidth / this.wSize) + 1;\r\n this.ny = Math.ceil(wHeight / this.wSize) + 1;\r\n this.icount = this.nx * this.ny;\r\n\r\n this.initGeometry();\r\n this.initUV();\r\n this.initAnimAttributes();\r\n\r\n if (this.imesh) {\r\n this.o3d.remove(this.imesh);\r\n }\r\n this.imesh = new InstancedMesh(this.bGeometry, this.material, this.icount);\r\n this.o3d.add(this.imesh);\r\n\r\n const dummy = new Object3D();\r\n let index = 0;\r\n let x = -(wWidth - (wWidth - this.nx * this.wSize)) / 2 + this.dx;\r\n for (let i = 0; i < this.nx; i++) {\r\n let y = -(wHeight - (wHeight - this.ny * this.wSize)) / 2 + this.dy;\r\n for (let j = 0; j < this.ny; j++) {\r\n dummy.position.set(x, y, 0);\r\n dummy.updateMatrix();\r\n this.imesh.setMatrixAt(index++, dummy.matrix);\r\n y += this.wSize;\r\n }\r\n x += this.wSize;\r\n }\r\n }\r\n\r\n initGeometry() {\r\n // square\r\n const geometry = new Geometry();\r\n geometry.vertices.push(new Vector3(0, 0, 0));\r\n geometry.vertices.push(new Vector3(this.wSize, 0, 0));\r\n geometry.vertices.push(new Vector3(0, this.wSize, 0));\r\n geometry.vertices.push(new Vector3(this.wSize, this.wSize, 0));\r\n geometry.faces.push(new Face3(0, 2, 1));\r\n geometry.faces.push(new Face3(2, 3, 1));\r\n\r\n geometry.faceVertexUvs[0].push([\r\n new Vector2(0, 0),\r\n new Vector2(0, 1),\r\n new Vector2(1, 0),\r\n ]);\r\n geometry.faceVertexUvs[0].push([\r\n new Vector2(0, 1),\r\n new Vector2(1, 1),\r\n new Vector2(1, 0),\r\n ]);\r\n\r\n // geometry.computeFaceNormals();\r\n // geometry.computeVertexNormals();\r\n\r\n // center\r\n this.dx = this.wSize / 2;\r\n this.dy = this.wSize / 2;\r\n geometry.translate(-this.dx, -this.dy, 0);\r\n\r\n this.bGeometry = new BufferGeometry().fromGeometry(geometry);\r\n }\r\n\r\n initAnimAttributes() {\r\n const { randFloat: rnd, randFloatSpread: rndFS } = MathUtils;\r\n const v3 = new Vector3();\r\n\r\n const offsets = new Float32Array(this.icount * 3);\r\n for (let i = 0; i < offsets.length; i += 3) {\r\n if (this.anim === 1) v3.set(rndFS(10), rnd(50, 100), rnd(20, 50)).toArray(offsets, i);\r\n else v3.set(rndFS(20), rndFS(20), rnd(20, 200)).toArray(offsets, i);\r\n }\r\n this.bGeometry.setAttribute('offset', new InstancedBufferAttribute(offsets, 3));\r\n\r\n const rotations = new Float32Array(this.icount * 3);\r\n const angle = Math.PI * 4;\r\n for (let i = 0; i < rotations.length; i += 3) {\r\n rotations[i] = rndFS(angle);\r\n rotations[i + 1] = rndFS(angle);\r\n rotations[i + 2] = rndFS(angle);\r\n }\r\n this.bGeometry.setAttribute('rotation', new InstancedBufferAttribute(rotations, 3));\r\n }\r\n\r\n initUV() {\r\n const ratio = this.nx / this.ny;\r\n const tRatio = this.texture.image.width / this.texture.image.height;\r\n if (ratio > tRatio) this.uvScale.set(1 / this.nx, (tRatio / ratio) / this.ny);\r\n else this.uvScale.set((ratio / tRatio) / this.nx, 1 / this.ny);\r\n const nW = this.uvScale.x * this.nx;\r\n const nH = this.uvScale.y * this.ny;\r\n\r\n const v2 = new Vector2();\r\n const uvOffsets = new Float32Array(this.icount * 2);\r\n for (let i = 0; i < this.nx; i++) {\r\n for (let j = 0; j < this.ny; j++) {\r\n v2.set(\r\n this.uvScale.x * i + (1 - nW) / 2,\r\n this.uvScale.y * j + (1 - nH) / 2\r\n ).toArray(uvOffsets, (i * this.ny + j) * 2);\r\n }\r\n }\r\n this.bGeometry.setAttribute('uvOffset', new InstancedBufferAttribute(uvOffsets, 2));\r\n }\r\n\r\n setTexture(texture) {\r\n this.texture = texture;\r\n this.material.map = texture;\r\n this.initUV();\r\n }\r\n\r\n resize() {\r\n this.initPlane();\r\n }\r\n}\r\n","import { TextureLoader } from 'three';\r\n\r\nexport default function useTextures() {\r\n const loader = new TextureLoader();\r\n const textures = [];\r\n\r\n const loadTexture = (img, index) => {\r\n return new Promise(resolve => {\r\n loader.load(\r\n img.src,\r\n texture => {\r\n textures[index] = texture;\r\n resolve(texture);\r\n }\r\n );\r\n });\r\n };\r\n\r\n const loadTextures = (images, cb) => {\r\n textures.splice(0);\r\n Promise.all(images.map(loadTexture)).then(cb);\r\n };\r\n\r\n return {\r\n textures,\r\n loadTextures,\r\n };\r\n};\r\n","\r\n\r\n\r\n","\r\n\r\n\r\n","import * as TROIS from './index.js';\r\n\r\nexport const TroisJSVuePlugin = {\r\n install: (app) => {\r\n const comps = [\r\n 'Camera',\r\n 'PerspectiveCamera',\r\n 'Renderer',\r\n 'Scene',\r\n // 'Texture',\r\n // 'CubeTexture',\r\n\r\n 'BoxGeometry',\r\n 'CircleGeometry',\r\n 'ConeGeometry',\r\n 'CylinderGeometry',\r\n 'DodecahedronGeometry',\r\n 'IcosahedronGeometry',\r\n 'LatheGeometry',\r\n 'OctahedronGeometry',\r\n 'PolyhedronGeometry',\r\n 'RingGeometry',\r\n 'SphereGeometry',\r\n 'TetrahedronGeometry',\r\n 'TorusGeometry',\r\n 'TorusKnotGeometry',\r\n 'TubeGeometry',\r\n\r\n 'AmbientLight',\r\n 'DirectionalLight',\r\n 'PointLight',\r\n 'SpotLight',\r\n\r\n 'BasicMaterial',\r\n 'LambertMaterial',\r\n 'PhongMaterial',\r\n 'PhysicalMaterial',\r\n 'ShaderMaterial',\r\n 'StandardMaterial',\r\n 'SubSurfaceMaterial',\r\n 'ToonMaterial',\r\n\r\n 'Map',\r\n 'EnvMap',\r\n\r\n 'Box',\r\n 'Circle',\r\n 'Cone',\r\n 'Cylinder',\r\n 'Dodecahedron',\r\n 'Icosahedron',\r\n 'Mesh',\r\n 'Lathe',\r\n 'Octahedron',\r\n 'Plane',\r\n 'Polyhedron',\r\n 'Ring',\r\n 'Sphere',\r\n 'Tetrahedron',\r\n 'Text',\r\n 'Torus',\r\n 'TorusKnot',\r\n 'Tube',\r\n\r\n 'Gem',\r\n 'Image',\r\n 'InstancedMesh',\r\n 'MirrorMesh',\r\n 'RefractionMesh',\r\n 'Sprite',\r\n\r\n 'BokehPass',\r\n 'EffectComposer',\r\n 'FilmPass',\r\n 'HalftonePass',\r\n 'RenderPass',\r\n 'SAOPass',\r\n 'UnrealBloomPass',\r\n\r\n 'GLTFViewer',\r\n ];\r\n\r\n comps.forEach(comp => {\r\n app.component(comp, TROIS[comp]);\r\n });\r\n },\r\n};\r\n"],"names":["const","let","Plane","PerspectiveCamera","this","Scene","AmbientLight","DirectionalLight","PointLight","SpotLight","TShaderMaterial","Mesh","TMesh","InstancedMesh","Sprite","EffectComposer","RenderPass","BokehPass","FilmPass","HalftonePass","SAOPass","UnrealBloomPass","Geometry","i","_createBlock","_createVNode","_renderSlot"],"mappings":";;;;;;;;;;;;;AAUA;AACA;AACA;AACe,SAAS,QAAQ,GAAG;AACnC;AACA,EAAEA,IAAM,IAAI,GAAG;AACf,IAAI,MAAM,EAAE,IAAI;AAChB,IAAI,SAAS,EAAE,IAAI;AACnB,IAAI,KA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AAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;AACvC,KAAK,CAAC,CAAC;AACP,GAAG;AACH;;;;"} \ No newline at end of file diff --git a/build/trois.module.min.js b/build/trois.module.min.js index d60073f..986d9b1 100644 --- a/build/trois.module.min.js +++ b/build/trois.module.min.js @@ -1,2 +1,2 @@ -import{h as e}from"vue";import{Vector2 as t,Vector3 as s,Plane as i,Raycaster as r,WebGLRenderer as n,PerspectiveCamera as o,Scene as a,Color as h,BoxBufferGeometry as u,SphereBufferGeometry as c,AmbientLight as d,PointLight as m,SpotLight as l,FrontSide as f,MeshBasicMaterial as p,MeshLambertMaterial as g,MeshPhongMaterial as w,MeshPhysicalMaterial as y,MeshStandardMaterial as b,Mesh as v,PlaneBufferGeometry as S,InstancedMesh as N}from"three";import{OrbitControls as z}from"three/examples/jsm/controls/OrbitControls.js";import{EffectComposer as j}from"three/examples/jsm/postprocessing/EffectComposer.js";import{RenderPass as x}from"three/examples/jsm/postprocessing/RenderPass.js";import{BokehPass as _}from"three/examples/jsm/postprocessing/BokehPass.js";import{UnrealBloomPass as C}from"three/examples/jsm/postprocessing/UnrealBloomPass.js";function M(){var e={canvas:null,antialias:!0,alpha:!1,orbit_ctrl:!1,mouse_move:!1,mouse_raycast:!1,resize:"window",width:0,height:0},o={width:0,height:0,wWidth:0,wHeight:0,ratio:0},a=[],h=[],u=[],c=new t,d=new s,m=new i(new s(0,0,1),0),l=new r,f={conf:e,renderer:null,camera:null,cameraCtrl:null,materials:{},scene:null,size:o,mouse:c,mouseV3:d,init:function(t){if(t)for(var[s,i]of Object.entries(t))e[s]=i;if(!f.scene)return void console.error("Missing Scene");if(!f.camera)return void console.error("Missing Camera");if(f.renderer=new n({canvas:e.canvas,antialias:e.antialias,alpha:e.alpha}),e.orbit_ctrl&&(f.orbitCtrl=new z(f.camera,f.renderer.domElement),e.orbit_ctrl instanceof Object))for(var[r,o]of Object.entries(e.orbit_ctrl))f.orbitCtrl[r]=o;e.width&&e.height?b(e.width,e.height):e.resize&&(y(),window.addEventListener("resize",y));e.mouse_move&&("body"===e.mouse_move?f.mouse_move_element=document.body:f.mouse_move_element=f.renderer.domElement,f.mouse_move_element.addEventListener("mousemove",p),f.mouse_move_element.addEventListener("mouseleave",g));return a.forEach((function(e){return e()})),!0},dispose:function(){window.removeEventListener("resize",y),f.mouse_move_element&&(f.mouse_move_element.removeEventListener("mousemove",p),f.mouse_move_element.removeEventListener("mouseleave",g))},render:function(){f.orbitCtrl&&f.orbitCtrl.update();u.forEach((function(e){return e()})),f.renderer.render(f.scene,f.camera)},renderC:function(){f.orbitCtrl&&f.orbitCtrl.update();u.forEach((function(e){return e()})),f.composer.render()},setSize:b,onAfterInit:function(e){a.push(e)},onAfterResize:function(e){h.push(e)},onBeforeRender:function(e){u.push(e)}};function p(e){c.x=e.clientX/o.width*2-1,c.y=-e.clientY/o.height*2+1,w()}function g(e){c.x=0,c.y=0,w()}function w(){e.mouse_raycast&&(f.camera.getWorldDirection(m.normal),m.normal.normalize(),l.setFromCamera(c,f.camera),l.ray.intersectPlane(m,d))}function y(){"window"===e.resize?b(window.innerWidth,window.innerHeight):b(e.resize.clientWidth,e.resize.clientHeight),h.forEach((function(e){return e()}))}function b(e,t){o.width=e,o.height=t,o.ratio=e/t,f.renderer.setSize(e,t,!1),f.camera.aspect=o.ratio,f.camera.updateProjectionMatrix(),f.composer&&f.composer.setSize(e,t);var s=function(){var e=f.camera.fov*Math.PI/180,t=2*Math.tan(e/2)*Math.abs(f.camera.position.z);return[t*f.camera.aspect,t]}();o.wWidth=s[0],o.wHeight=s[1]}return f}var B={props:{antialias:{type:Boolean,default:!0},alpha:{type:Boolean,default:!1},shadow:{type:Boolean,default:!1},orbitCtrl:{type:[Boolean,Object],default:!1},mouseMove:{type:[Boolean,String],default:!1},mouseRaycast:{type:Boolean,default:!1},resize:{type:[Boolean,String,Element],default:"window"},width:String,height:String},setup:function(e){return{three:M(),raf:!0}},provide:function(){return{three:this.three}},mounted:function(){var e={canvas:this.$refs.canvas,antialias:this.antialias,alpha:this.alpha,orbit_ctrl:this.orbitCtrl,mouse_move:this.mouseMove,mouse_raycast:this.mouseRaycast,resize:this.resize,width:this.width,height:this.height};this.three.init(e)&&(this.three.renderer.shadowMap.enabled=this.shadow,this.three.composer?this.animateC():this.animate())},beforeUnmount:function(){this.raf=!1,this.three.dispose()},methods:{onBeforeRender:function(e){this.three.onBeforeRender(e)},onAfterResize:function(e){this.three.onAfterResize(e)},animate:function(){this.raf&&requestAnimationFrame(this.animate),this.three.render()},animateC:function(){this.raf&&requestAnimationFrame(this.animateC),this.three.renderC()}},render:function(){return e("canvas",{ref:"canvas"},this.$slots.default())}};function E(e,t){if(t instanceof Object)for(var[s,i]of Object.entries(t))e[s]=i}function O(e,t,s){return e+(t-e)*(s=(s=s<0?0:s)>1?1:s)}function P(e,t,s){e.x=O(e.x,t.x,s),e.y=O(e.y,t.y,s),e.z=O(e.z,t.z,s)}var R={inject:["three"],props:{fov:{type:Number,default:50},position:Object},created:function(){var e=new o(this.fov);E(e.position,this.position),this.three.camera=e},render:function(){return[]}},L={inject:["three"],props:{id:String,background:[String,Number]},setup:function(e){var t=new a;return e.background&&(t.background=new h(e.background)),{scene:t}},provide:function(){return{scene:this.scene}},mounted:function(){this.three.scene||(this.three.scene=this.scene)},render:function(){return this.$slots.default?this.$slots.default():[]}},A={inject:["parent"],beforeMount:function(){this.parent||console.error("Missing parent Mesh")},unmounted:function(){this.parent.geometry.dispose()},render:function(){return[]}},$={extends:A,props:{size:{type:Number},width:{type:Number,default:1},height:{type:Number,default:1},depth:{type:Number,default:1}},mounted:function(){this.size?this.parent.geometry=new u(this.size,this.size,this.size):this.parent.geometry=new u(this.width,this.height,this.depth)}},k={extends:A,props:{radius:Number,widthSegments:{type:Number,default:12},heightSegments:{type:Number,default:12}},mounted:function(){this.parent.geometry=new c(this.radius,this.widthSegments,this.heightSegments)}},I={inject:["scene"],props:{color:{type:String,default:"#ffffff"},intensity:{type:Number,default:1},castShadow:{type:Boolean,default:!1},shadowMapSize:Object,position:Object},mounted:function(){E(this.light.position,this.position),this.light.shadow&&(this.light.castShadow=this.castShadow,E(this.light.shadow.mapSize,this.shadowMapSize)),this.scene.add(this.light),this.light.target&&this.scene.add(this.light.target)},render:function(){return[]}},W={extends:I,created:function(){this.light=new d(this.color,this.intensity)}},H={extends:I,props:{distance:{type:Number,default:0},decay:{type:Number,default:1}},created:function(){this.light=new m(this.color,this.intensity,this.distance,this.decay)}},F={extends:I,props:{distance:{type:Number,default:0},angle:{type:Number,default:Math.PI/3},penumbra:{type:Number,default:0},decay:{type:Number,default:1}},created:function(){this.light=new l(this.color,this.intensity,this.distance,this.angle,this.penumbra,this.decay)}},U={inject:["three"],props:{id:String,color:{type:[String,Number],default:"#ffffff"},depthTest:{type:Boolean,default:!0},depthWrite:{type:Boolean,default:!0},fog:{type:Boolean,default:!1},opacity:{type:Number,default:1},side:{type:Number,default:f},transparent:{type:Boolean,default:!1},vertexColors:{type:Boolean,default:!1}},mounted:function(){this.three.materials[this.id]=this.material},unmounted:function(){this.material.dispose()},methods:{propsValues:function(){var e={};for(var[t,s]of Object.entries(this.$props))"id"!==t&&(e[t]=s);return e}},render:function(){return[]}},V={extends:U,created:function(){this.material=new p({color:this.color})}},q={extends:U,created:function(){this.material=new g({color:this.color})}},D={extends:U,created:function(){this.material=new w({color:this.color})}},G={extends:U,created:function(){this.material=new y({color:this.color})}},T={extends:U,props:{emissive:{type:[Number,String],default:0},emissiveIntensity:{type:Number,default:1},metalness:{type:Number,default:0},roughness:{type:Number,default:1}},created:function(){this.material=new b(this.propsValues())}},X={inject:["three","scene"],props:{material:String,position:Object,rotation:Object,scale:Object,castShadow:{type:Boolean,default:!1},receiveShadow:{type:Boolean,default:!1}},mounted:function(){this.mesh=new v(this.geometry,this.three.materials[this.material]),E(this.mesh.position,this.position),E(this.mesh.rotation,this.rotation),E(this.mesh.scale,this.scale),this.mesh.castShadow=this.castShadow,this.mesh.receiveShadow=this.receiveShadow,this.scene.add(this.mesh)},unmounted:function(){this.geometry.dispose()},render:function(){return[]}},Y={extends:X,props:{size:{type:Number},width:{type:Number,default:1},height:{type:Number,default:1},depth:{type:Number,default:1}},created:function(){this.size?this.geometry=new u(this.size,this.size,this.size):this.geometry=new u(this.width,this.height,this.depth)}},J={extends:X,props:{width:{type:Number,default:1},height:{type:Number,default:1},widthSegments:{type:Number,default:1},heightSegments:{type:Number,default:1}},created:function(){this.geometry=new S(this.width,this.height,this.widthSegments,this.heightSegments)}},K={extends:X,props:{radius:Number,widthSegments:{type:Number,default:12},heightSegments:{type:Number,default:12}},created:function(){this.geometry=new c(this.radius,this.widthSegments,this.heightSegments)}},Q={inject:["three","scene"],props:{material:String,count:Number,position:Object,castShadow:{type:Boolean,default:!1},receiveShadow:{type:Boolean,default:!1}},setup:function(){return{conf:{}}},provide:function(){return{parent:this.conf}},beforeMount:function(){this.$slots.default||console.error("Missing Geometry")},mounted:function(){this.mesh=new N(this.conf.geometry,this.three.materials[this.material],this.count),E(this.mesh.position,this.position),this.mesh.castShadow=this.castShadow,this.mesh.receiveShadow=this.receiveShadow,this.scene.add(this.mesh)},render:function(){return this.$slots.default()}},Z={setup:function(){return{passes:[]}},inject:["three"],provide:function(){return{passes:this.passes}},mounted:function(){var e=this;this.three.onAfterInit((function(){e.composer=new j(e.three.renderer),e.passes.forEach((function(t){e.composer.addPass(t)})),e.three.composer=e.composer}))},render:function(){return this.$slots.default()}},ee={inject:["three","passes"],beforeMount:function(){this.passes||console.error("Missing parent EffectComposer")},render:function(){return[]}},te={extends:ee,mounted:function(){this.three.scene||console.error("Missing Scene"),this.three.camera||console.error("Missing Camera");var e=new x(this.three.scene,this.three.camera);this.passes.push(e),this.pass=e}},se={extends:ee,props:{focus:{type:Number,default:1},aperture:{type:Number,default:.025},maxblur:{type:Number,default:.01}},mounted:function(){this.three.scene||console.error("Missing Scene"),this.three.camera||console.error("Missing Camera");var e={focus:this.focus,aperture:this.aperture,maxblur:this.maxblur,width:this.three.size.width,height:this.three.size.height},t=new _(this.three.scene,this.three.camera,e);this.passes.push(t),this.pass=t}},ie={extends:ee,props:{strength:{type:Number,default:1.5},radius:{type:Number,default:0},threshold:{type:Number,default:0}},mounted:function(){var e=new t(this.three.size.width,this.three.size.height),s=new C(e,this.strength,this.radius,this.threshold);this.passes.push(s),this.pass=s}};export{W as AmbientLight,V as BasicMaterial,se as BokehPass,Y as Box,$ as BoxGeometry,R as Camera,Z as EffectComposer,Q as InstancedMesh,q as LambertMaterial,R as PerspectiveCamera,D as PhongMaterial,G as PhysicalMaterial,J as Plane,H as PointLight,te as RenderPass,B as Renderer,L as Scene,K as Sphere,k as SphereGeometry,F as SpotLight,T as StandardMaterial,ie as UnrealBloomPass,O as lerp,P as lerpv3,E as setFromProp}; +import{h as e,toRef as t,watch as i,resolveComponent as r,openBlock as n,createBlock as s,withCtx as a,createVNode as o,renderSlot as h}from"vue";import{Vector2 as u,Vector3 as m,Plane as d,Raycaster as c,WebGLRenderer as f,PerspectiveCamera as l,Scene as p,Color as y,TextureLoader as g,CubeTextureLoader as v,BoxBufferGeometry as x,CircleBufferGeometry as b,ConeBufferGeometry as S,CylinderBufferGeometry as w,DodecahedronBufferGeometry as N,IcosahedronBufferGeometry as C,LatheBufferGeometry as z,OctahedronBufferGeometry as M,PolyhedronBufferGeometry as _,RingBufferGeometry as T,SphereBufferGeometry as G,TetrahedronBufferGeometry as P,TorusBufferGeometry as I,TorusKnotBufferGeometry as L,Curve as E,TubeBufferGeometry as B,AmbientLight as j,DirectionalLight as R,PointLight as k,SpotLight as A,FrontSide as D,MeshBasicMaterial as O,MeshLambertMaterial as F,MeshPhongMaterial as U,MeshStandardMaterial as $,MeshPhysicalMaterial as Z,ShaderChunk as W,UniformsUtils as q,ShaderLib as V,ShaderMaterial as H,MeshToonMaterial as Y,Mesh as X,PlaneBufferGeometry as K,FontLoader as J,TextBufferGeometry as Q,WebGLCubeRenderTarget as ee,RGBFormat as te,LinearMipmapLinearFilter as ie,CubeCamera as re,BackSide as ne,DoubleSide as se,InstancedMesh as ae,CubeRefractionMapping as oe,SpriteMaterial as he,Sprite as ue,Object3D as me,Geometry as de,Face3 as ce,BufferGeometry as fe,MathUtils as le,InstancedBufferAttribute as pe}from"three";import{OrbitControls as ye}from"three/examples/jsm/controls/OrbitControls.js";import{EffectComposer as ge}from"three/examples/jsm/postprocessing/EffectComposer.js";import{RenderPass as ve}from"three/examples/jsm/postprocessing/RenderPass.js";import{BokehPass as xe}from"three/examples/jsm/postprocessing/BokehPass.js";import{FilmPass as be}from"three/examples/jsm/postprocessing/FilmPass.js";import{HalftonePass as Se}from"three/examples/jsm/postprocessing/HalftonePass.js";import{SAOPass as we}from"three/examples/jsm/postprocessing/SAOPass.js";import{UnrealBloomPass as Ne}from"three/examples/jsm/postprocessing/UnrealBloomPass.js";import{gsap as Ce,Power4 as ze}from"gsap";import{GLTFLoader as Me}from"three/examples/jsm/loaders/GLTFLoader.js";function _e(){var e={canvas:null,antialias:!0,alpha:!1,autoClear:!0,orbit_ctrl:!1,mouse_move:!1,mouse_raycast:!1,resize:"window",width:0,height:0},t={width:0,height:0,wWidth:0,wHeight:0,ratio:0},i=[],r=[],n=[],s=new u,a=new m,o=new d(new m(0,0,1),0),h=new c,l={conf:e,renderer:null,camera:null,cameraCtrl:null,materials:{},scene:null,size:t,mouse:s,mouseV3:a,init:function(t){t&&Object.entries(t).forEach((function(t){var i=t[0],r=t[1];e[i]=r}));if(!l.scene)return void console.error("Missing Scene");if(!l.camera)return void console.error("Missing Camera");l.renderer=new f({canvas:e.canvas,antialias:e.antialias,alpha:e.alpha}),l.renderer.autoClear=e.autoClear,e.orbit_ctrl&&(l.orbitCtrl=new ye(l.camera,l.renderer.domElement),e.orbit_ctrl instanceof Object&&Object.entries(e.orbit_ctrl).forEach((function(e){var t=e[0],i=e[1];l.orbitCtrl[t]=i})));e.width&&e.height?x(e.width,e.height):e.resize&&(v(),window.addEventListener("resize",v));e.mouse_move&&("body"===e.mouse_move?l.mouse_move_element=document.body:l.mouse_move_element=l.renderer.domElement,l.mouse_move_element.addEventListener("mousemove",p),l.mouse_move_element.addEventListener("mouseleave",y));return i.forEach((function(e){return e()})),!0},dispose:function(){n=[],window.removeEventListener("resize",v),l.mouse_move_element&&(l.mouse_move_element.removeEventListener("mousemove",p),l.mouse_move_element.removeEventListener("mouseleave",y));l.orbitCtrl&&l.orbitCtrl.dispose();this.renderer.dispose()},render:function(){l.orbitCtrl&&l.orbitCtrl.update();n.forEach((function(e){return e()})),l.renderer.render(l.scene,l.camera)},renderC:function(){l.orbitCtrl&&l.orbitCtrl.update();n.forEach((function(e){return e()})),l.composer.render()},setSize:x,onAfterInit:function(e){i.push(e)},onAfterResize:function(e){r.push(e)},offAfterResize:function(e){r=r.filter((function(t){return t!==e}))},onBeforeRender:function(e){n.push(e)},offBeforeRender:function(e){n=n.filter((function(t){return t!==e}))}};function p(e){s.x=e.clientX/t.width*2-1,s.y=-e.clientY/t.height*2+1,g()}function y(e){s.x=0,s.y=0,g()}function g(){e.mouse_raycast&&(l.camera.getWorldDirection(o.normal),o.normal.normalize(),h.setFromCamera(s,l.camera),h.ray.intersectPlane(o,a))}function v(){"window"===e.resize?x(window.innerWidth,window.innerHeight):x(e.resize.clientWidth,e.resize.clientHeight),r.forEach((function(e){return e()}))}function x(e,i){t.width=e,t.height=i,t.ratio=e/i,l.renderer.setSize(e,i,!1),l.camera.aspect=t.ratio,l.camera.updateProjectionMatrix(),l.composer&&l.composer.setSize(e,i);var r=function(){var e=l.camera.fov*Math.PI/180,t=2*Math.tan(e/2)*Math.abs(l.camera.position.z);return[t*l.camera.aspect,t]}();t.wWidth=r[0],t.wHeight=r[1]}return l}var Te={props:{antialias:{type:Boolean,default:!0},alpha:{type:Boolean,default:!1},autoClear:{type:Boolean,default:!0},shadow:{type:Boolean,default:!1},orbitCtrl:{type:[Boolean,Object],default:!1},mouseMove:{type:[Boolean,String],default:!1},mouseRaycast:{type:Boolean,default:!1},resize:{type:[Boolean,String,Element],default:"window"},width:String,height:String},setup:function(){return{three:_e(),raf:!0,onMountedCallbacks:[]}},provide:function(){return{three:this.three,rendererComponent:this}},mounted:function(){var e={canvas:this.$refs.canvas,antialias:this.antialias,alpha:this.alpha,autoClear:this.autoClear,orbit_ctrl:this.orbitCtrl,mouse_move:this.mouseMove,mouse_raycast:this.mouseRaycast,resize:this.resize,width:this.width,height:this.height};this.three.init(e)&&(this.three.renderer.shadowMap.enabled=this.shadow,this.three.composer?this.animateC():this.animate()),this.onMountedCallbacks.forEach((function(e){return e()}))},beforeUnmount:function(){this.raf=!1,this.three.dispose()},methods:{onMounted:function(e){this.onMountedCallbacks.push(e)},onBeforeRender:function(e){this.three.onBeforeRender(e)},onAfterResize:function(e){this.three.onAfterResize(e)},animate:function(){this.raf&&requestAnimationFrame(this.animate),this.three.render()},animateC:function(){this.raf&&requestAnimationFrame(this.animateC),this.three.renderC()}},render:function(){return e("canvas",{ref:"canvas"},this.$slots.default())}};function Ge(e,t){t instanceof Object&&Object.entries(t).forEach((function(t){var i=t[0],r=t[1];e[i]=r}))}function Pe(e,t){var i={};return Object.entries(e).forEach((function(e){var r=e[0],n=e[1];(!t||t&&!t.includes(r))&&(i[r]=n)})),i}function Ie(e,t,i){return e+(t-e)*(i=(i=i<0?0:i)>1?1:i)}function Le(e,t,i){e.x=Ie(e.x,t.x,i),e.y=Ie(e.y,t.y,i),e.z=Ie(e.z,t.z,i)}function Ee(e,t,i){return ei?i:e}function Be(e,r,n){if(e[r]){var s=t(e,r);Ge(n,s.value),i(s,(function(){Ge(n,s.value)}),{deep:!0})}}var je={inject:["three"],props:{aspect:{type:Number,default:1},far:{type:Number,default:2e3},fov:{type:Number,default:50},near:{type:Number,default:.1},position:{type:[Object,m],default:{x:0,y:0,z:0}}},created:function(){var e=this;this.camera=new l(this.fov,this.aspect,this.near,this.far),Be(this,"position",this.camera.position),["aspect","far","fov","near"].forEach((function(t){i((function(){return e[t]}),(function(){e.camera[t]=e[t],e.camera.updateProjectionMatrix()}))})),this.three.camera=this.camera},render:function(){return[]},__hmrId:"PerspectiveCamera"},Re={inject:["three"],props:{id:String,background:[String,Number]},setup:function(e){var t=new p;return e.background&&(t.background=new y(e.background)),i((function(){return e.background}),(function(e){t.background=new y(e)})),{scene:t}},provide:function(){return{scene:this.scene}},mounted:function(){this.three.scene||(this.three.scene=this.scene)},methods:{},render:function(){return this.$slots.default?this.$slots.default():[]}},ke={inject:["three"],emits:["loaded"],props:{src:String,onLoad:Function,onProgress:Function,onError:Function},created:function(){var e=this;this.createTexture(),i((function(){return e.src}),this.refreshTexture)},unmounted:function(){this.texture.dispose()},methods:{createTexture:function(){this.texture=(new g).load(this.src,this.onLoaded,this.onProgress,this.onError)},refreshTexture:function(){this.createTexture()},onLoaded:function(){this.onLoad&&this.onLoad(),this.$emit("loaded")}},render:function(){return[]}},Ae={inject:["three"],emits:["loaded"],props:{path:String,urls:{type:Array,default:["px.jpg","nx.jpg","py.jpg","ny.jpg","pz.jpg","nz.jpg"]},onLoad:Function,onProgress:Function,onError:Function},created:function(){var e=this;this.createTexture(),i((function(){return e.path}),this.refreshTexture),i((function(){return e.urls}),this.refreshTexture)},unmounted:function(){this.texture.dispose()},methods:{createTexture:function(){this.texture=(new v).setPath(this.path).load(this.urls,this.onLoaded,this.onProgress,this.onError)},refreshTexture:function(){this.createTexture()},onLoaded:function(){this.onLoad&&this.onLoad(),this.$emit("loaded")}},render:function(){return[]}},De={emits:["ready"],inject:["mesh"],props:{rotateX:Number,rotateY:Number,rotateZ:Number},created:function(){var e=this;this.mesh||console.error("Missing parent Mesh"),this.watchProps=[],Object.entries(this.$props).forEach((function(t){return e.watchProps.push(t[0])}))},beforeMount:function(){this.createGeometry(),this.rotateGeometry(),this.mesh.setGeometry(this.geometry)},mounted:function(){this.addWatchers()},unmounted:function(){this.geometry.dispose()},methods:{rotateGeometry:function(){this.rotateX&&this.geometry.rotateX(this.rotateX),this.rotateY&&this.geometry.rotateY(this.rotateY),this.rotateZ&&this.geometry.rotateZ(this.rotateZ)},addWatchers:function(){var e=this;this.watchProps.forEach((function(t){i((function(){return e[t]}),(function(){e.refreshGeometry()}))}))},refreshGeometry:function(){var e=this.geometry;this.createGeometry(),this.rotateGeometry(),this.mesh.setGeometry(this.geometry),e.dispose()}},render:function(){return[]}},Oe={extends:De,props:{size:Number,width:{type:Number,default:1},height:{type:Number,default:1},depth:{type:Number,default:1},widthSegments:{type:Number,default:1},heightSegments:{type:Number,default:1},depthSegments:{type:Number,default:1}},methods:{createGeometry:function(){var e=this.width,t=this.height,i=this.depth;this.size&&(e=this.size,t=this.size,i=this.size),this.geometry=new x(e,t,i,this.widthSegments,this.heightSegments,this.depthSegments)}}},Fe={extends:De,props:{radius:{type:Number,default:1},segments:{type:Number,default:8},thetaStart:{type:Number,default:0},thetaLength:{type:Number,default:2*Math.PI}},methods:{createGeometry:function(){this.geometry=new b(this.radius,this.segments,this.thetaStart,this.thetaLength)}}},Ue={extends:De,props:{radius:{type:Number,default:1},height:{type:Number,default:1},radialSegments:{type:Number,default:8},heightSegments:{type:Number,default:1},openEnded:{type:Boolean,default:!1},thetaStart:{type:Number,default:0},thetaLength:{type:Number,default:2*Math.PI}},methods:{createGeometry:function(){this.geometry=new S(this.radius,this.height,this.radialSegments,this.heightSegments,this.openEnded,this.thetaStart,this.thetaLength)}}},$e={extends:De,props:{radiusTop:{type:Number,default:1},radiusBottom:{type:Number,default:1},height:{type:Number,default:1},radialSegments:{type:Number,default:8},heightSegments:{type:Number,default:1},openEnded:{type:Boolean,default:!1},thetaStart:{type:Number,default:0},thetaLength:{type:Number,default:2*Math.PI}},methods:{createGeometry:function(){this.geometry=new w(this.radiusTop,this.radiusBottom,this.height,this.radialSegments,this.heightSegments,this.openEnded,this.thetaStart,this.thetaLength)}}},Ze={extends:De,props:{radius:{type:Number,default:1},detail:{type:Number,default:0}},methods:{createGeometry:function(){this.geometry=new N(this.radius,this.detail)}}},We={extends:De,props:{radius:{type:Number,default:1},detail:{type:Number,default:0}},methods:{createGeometry:function(){this.geometry=new C(this.radius,this.detail)}}},qe={extends:De,props:{points:Array,segments:{type:Number,default:12},phiStart:{type:Number,default:0},phiLength:{type:Number,default:2*Math.PI}},methods:{createGeometry:function(){this.geometry=new z(this.points,this.segments,this.phiStart,this.phiLength)}}},Ve={extends:De,props:{radius:{type:Number,default:1},detail:{type:Number,default:0}},methods:{createGeometry:function(){this.geometry=new M(this.radius,this.detail)}}},He={extends:De,props:{vertices:Array,indices:Array,radius:{type:Number,default:1},detail:{type:Number,default:0}},methods:{createGeometry:function(){this.geometry=new _(this.vertices,this.indices,this.radius,this.detail)}}},Ye={extends:De,props:{innerRadius:{type:Number,default:.5},outerRadius:{type:Number,default:1},thetaSegments:{type:Number,default:8},phiSegments:{type:Number,default:1},thetaStart:{type:Number,default:0},thetaLength:{type:Number,default:2*Math.PI}},methods:{createGeometry:function(){this.geometry=new T(this.innerRadius,this.outerRadius,this.thetaSegments,this.phiSegments,this.thetaStart,this.thetaLength)}}},Xe={extends:De,props:{radius:{type:Number,default:1},widthSegments:{type:Number,default:12},heightSegments:{type:Number,default:12}},methods:{createGeometry:function(){this.geometry=new G(this.radius,this.widthSegments,this.heightSegments)}}},Ke={extends:De,props:{radius:{type:Number,default:1},detail:{type:Number,default:0}},methods:{createGeometry:function(){this.geometry=new P(this.radius,this.detail)}}},Je={extends:De,props:{radius:{type:Number,default:1},tube:{type:Number,default:.4},radialSegments:{type:Number,default:8},tubularSegments:{type:Number,default:6},arc:{type:Number,default:2*Math.PI}},methods:{createGeometry:function(){this.geometry=new I(this.radius,this.tube,this.radialSegments,this.tubularSegments,this.arc)}}},Qe={extends:De,props:{radius:{type:Number,default:1},tube:{type:Number,default:.4},radialSegments:{type:Number,default:64},tubularSegments:{type:Number,default:8},p:{type:Number,default:2},q:{type:Number,default:3}},methods:{createGeometry:function(){this.geometry=new L(this.radius,this.tube,this.radialSegments,this.tubularSegments,this.p,this.q)}}},et={extends:De,props:{path:E,tubularSegments:{type:Number,default:64},radius:{type:Number,default:1},radiusSegments:{type:Number,default:8},closed:{type:Boolean,default:!1}},methods:{createGeometry:function(){this.geometry=new B(this.path,this.tubularSegments,this.radius,this.radiusSegments,this.closed)}}},tt={inject:["scene"],props:{color:{type:String,default:"#ffffff"},intensity:{type:Number,default:1},castShadow:{type:Boolean,default:!1},shadowMapSize:Object,position:Object},mounted:function(){var e=this;Be(this,"position",this.light.position),this.light.target&&Be(this,"target",this.light.target.position),this.light.shadow&&(this.light.castShadow=this.castShadow,Ge(this.light.shadow.mapSize,this.shadowMapSize)),["color","intensity","castShadow"].forEach((function(t){i((function(){return e[t]}),(function(){"color"===t?e.light.color=new y(e.color):e.light[t]=e[t]}))})),this.scene.add(this.light),this.light.target&&this.scene.add(this.light.target)},unmounted:function(){this.scene.remove(this.light)},render:function(){return[]},__hmrId:"Light"},it={extends:tt,created:function(){this.light=new j(this.color,this.intensity)},__hmrId:"AmbientLight"},rt={extends:tt,props:{target:Object},created:function(){this.light=new R(this.color,this.intensity)},__hmrId:"DirectionalLight"},nt={extends:tt,props:{distance:{type:Number,default:0},decay:{type:Number,default:1}},created:function(){this.light=new k(this.color,this.intensity,this.distance,this.decay)},__hmrId:"PointLight"},st={extends:tt,props:{angle:{type:Number,default:Math.PI/3},decay:{type:Number,default:1},distance:{type:Number,default:0},penumbra:{type:Number,default:0},target:Object},created:function(){var e=this;this.light=new A(this.color,this.intensity,this.distance,this.angle,this.penumbra,this.decay),["angle","decay","distance","penumbra"].forEach((function(t){i((function(){return e[t]}),(function(){e.light[t]=e[t]}))}))},__hmrId:"SpotLight"},at={inject:["three","mesh"],props:{id:String,color:{type:[String,Number],default:"#ffffff"},depthTest:{type:Boolean,default:!0},depthWrite:{type:Boolean,default:!0},flatShading:Boolean,fog:{type:Boolean,default:!0},opacity:{type:Number,default:1},side:{type:Number,default:D},transparent:Boolean,vertexColors:Boolean},provide:function(){return{material:this}},beforeMount:function(){this.createMaterial(),this.id&&(this.three.materials[this.id]=this.material),this.mesh.setMaterial(this.material)},mounted:function(){this._addWatchers(),this.addWatchers&&this.addWatchers()},unmounted:function(){this.material.dispose(),this.id&&delete this.three.materials[this.id]},methods:{setMap:function(e){this.material.map=e,this.material.needsUpdate=!0},setEnvMap:function(e){this.material.envMap=e,this.material.needsUpdate=!0},_addWatchers:function(){var e=this;["color","depthTest","depthWrite","fog","opacity","side","transparent"].forEach((function(t){i((function(){return e[t]}),(function(){"color"===t?e.material.color.set(e.color):e.material[t]=e[t]}))}))}},render:function(){return this.$slots.default?this.$slots.default():[]},__hmrId:"Material"},ot={extends:at,methods:{createMaterial:function(){this.material=new O(Pe(this.$props,["id"]))}},__hmrId:"BasicMaterial"},ht={extends:at,methods:{createMaterial:function(){this.material=new F(Pe(this.$props,["id"]))}},__hmrId:"LambertMaterial"},ut={extends:at,methods:{createMaterial:function(){this.material=new U(Pe(this.$props,["id"]))}},__hmrId:"PhongMaterial"},mt={extends:at,props:{emissive:{type:[Number,String],default:0},emissiveIntensity:{type:Number,default:1},metalness:{type:Number,default:0},roughness:{type:Number,default:1}},methods:{createMaterial:function(){this.material=new $(Pe(this.$props,["id"]))},addWatchers:function(){var e=this;["emissive","emissiveIntensity","metalness","roughness"].forEach((function(t){i((function(){return e[t]}),(function(i){"emissive"===t?e.material.emissive=new y(i):e.material[t]=i}))}))}},__hmrId:"StandardMaterial"},dt={extends:mt,methods:{createMaterial:function(){this.material=new Z(Pe(this.$props,["id"]))}},__hmrId:"PhysicalMaterial"};var ct,ft,lt,pt=W.meshphong_frag.slice(0,W.meshphong_frag.indexOf("void main() {")),yt=W.meshphong_frag.slice(W.meshphong_frag.indexOf("void main() {")),gt={uniforms:q.merge([V.phong.uniforms,{thicknessColor:{value:new y(6718871)},thicknessDistortion:{value:.1},thicknessAmbient:{value:0},thicknessAttenuation:{value:.1},thicknessPower:{value:2},thicknessScale:{value:10}}]),vertexShader:"\n #define USE_UV\n "+W.meshphong_vert+"\n ",fragmentShader:"\n #define USE_UV\n #define SUBSURFACE\n\n "+pt+"\n\n uniform float thicknessPower;\n uniform float thicknessScale;\n uniform float thicknessDistortion;\n uniform float thicknessAmbient;\n uniform float thicknessAttenuation;\n uniform vec3 thicknessColor;\n\n void RE_Direct_Scattering(const in IncidentLight directLight, const in vec2 uv, const in GeometricContext geometry, inout ReflectedLight reflectedLight) {\n #ifdef USE_COLOR\n vec3 thickness = vColor * thicknessColor;\n #else\n vec3 thickness = thicknessColor;\n #endif\n vec3 scatteringHalf = normalize(directLight.direction + (geometry.normal * thicknessDistortion));\n float scatteringDot = pow(saturate(dot(geometry.viewDir, -scatteringHalf)), thicknessPower) * thicknessScale;\n vec3 scatteringIllu = (scatteringDot + thicknessAmbient) * thickness;\n reflectedLight.directDiffuse += scatteringIllu * thicknessAttenuation * directLight.color;\n }\n "+yt.replace("#include ",(ct=W.lights_fragment_begin,ft="RE_Direct( directLight, geometry, material, reflectedLight );",lt="\n RE_Direct( directLight, geometry, material, reflectedLight );\n #if defined( SUBSURFACE ) && defined( USE_UV )\n RE_Direct_Scattering(directLight, vUv, geometry, reflectedLight);\n #endif\n ",ct.split(ft).join(lt)))},vt={extends:{inject:["three","mesh"],props:{id:String,uniforms:Object,vertexShader:String,fragmentShader:String},beforeMount:function(){this.createMaterial(),this.id&&(this.three.materials[this.id]=this.material),this.mesh.setMaterial(this.material)},mounted:function(){this.addWatchers&&this.addWatchers()},unmounted:function(){this.material.dispose(),this.id&&delete this.three.materials[this.id]},render:function(){return[]},__hmrId:"ShaderMaterial"},props:{diffuse:{type:String,default:"#ffffff"},thicknessColor:{type:String,default:"#ffffff"},thicknessDistortion:{type:Number,default:.4},thicknessAmbient:{type:Number,default:.01},thicknessAttenuation:{type:Number,default:.7},thicknessPower:{type:Number,default:2},thicknessScale:{type:Number,default:4},transparent:{type:Boolean,default:!1},opacity:{type:Number,default:1},vertexColors:{type:Boolean,default:!1}},methods:{createMaterial:function(){var e=gt,t=q.clone(e.uniforms);Object.entries(this.$props).forEach((function(e){var i=e[0],r=e[1];"diffuse"!==i&&"thicknessColor"!==i||(r=new y(r)),"id"!==i&&"transparent"!==i&&"vertexColors"!==i&&(t[i].value=r)})),this.material=new H(Object.assign({},e,{uniforms:t,lights:!0,transparent:this.transparent,vertexColors:this.vertexColors}))}},__hmrId:"SubSurfaceMaterial"},xt={extends:at,methods:{createMaterial:function(){this.material=new Y(Pe(this.$props,["id"]))}},__hmrId:"ToonMaterial"},bt={extends:ke,inject:["material"],created:function(){this.material.setMap(this.texture)},unmounted:function(){this.material.setMap(null)},methods:{refreshTexture:function(){this.createTexture(),this.material.setMap(this.texture)}},__hmrId:"Map"},St={extends:Ae,inject:["material"],created:function(){this.material.setEnvMap(this.texture)},unmounted:function(){this.material.setEnvMap(null)},methods:{refreshTexture:function(){this.createTexture(),this.material.setEnvMap(this.texture)}},__hmrId:"EnvMap"},wt={inject:["three","scene","rendererComponent"],emits:["ready"],props:{materialId:String,position:Object,rotation:Object,scale:Object,castShadow:Boolean,receiveShadow:Boolean},provide:function(){return{mesh:this}},mounted:function(){this.geometry&&!this.mesh&&this.initMesh()},unmounted:function(){this.mesh&&this.scene.remove(this.mesh),this.geometry&&this.geometry.dispose(),this.material&&!this.materialId&&this.material.dispose()},methods:{initMesh:function(){!this.material&&this.materialId&&(this.material=this.three.materials[this.materialId]),this.mesh=new X(this.geometry,this.material),this.bindProps(),this.scene.add(this.mesh),this.$emit("ready")},bindProps:function(){var e=this;Be(this,"position",this.mesh.position),Be(this,"rotation",this.mesh.rotation),Be(this,"scale",this.mesh.scale),["castShadow","receiveShadow"].forEach((function(t){e.mesh[t]=e[t],i((function(){return e[t]}),(function(){e.mesh[t]=e[t]}))})),i((function(){return e.materialId}),(function(){e.mesh.material=e.three.materials[e.materialId]}))},setGeometry:function(e){this.geometry=e,this.mesh&&(this.mesh.geometry=e)},setMaterial:function(e){this.material=e,this.mesh&&(this.mesh.material=e)},refreshGeometry:function(){var e=this.geometry;this.createGeometry(),this.mesh.geometry=this.geometry,e.dispose()}},render:function(){return this.$slots.default?this.$slots.default():[]},__hmrId:"Mesh"},Nt={extends:wt,props:{size:Number,width:{type:Number,default:1},height:{type:Number,default:1},depth:{type:Number,default:1},widthSegments:{type:Number,default:1},heightSegments:{type:Number,default:1},depthSegments:{type:Number,default:1}},created:function(){var e=this;this.createGeometry(),["size","width","height","depth","widthSegments","heightSegments","depthSegments"].forEach((function(t){i((function(){return e[t]}),(function(){e.refreshGeometry()}))}))},methods:{createGeometry:function(){this.size?this.geometry=new x(this.size,this.size,this.size):this.geometry=new x(this.width,this.height,this.depth)}},__hmrId:"Box"},Ct={extends:wt,props:{radius:{type:Number,default:1},segments:{type:Number,default:8},thetaStart:{type:Number,default:0},thetaLength:{type:Number,default:2*Math.PI}},created:function(){var e=this;this.createGeometry();["radius","segments","thetaStart","thetaLength"].forEach((function(t){i((function(){return e[t]}),(function(){e.refreshGeometry()}))}))},methods:{createGeometry:function(){this.geometry=new b(this.radius,this.segments,this.thetaStart,this.thetaLength)}},__hmrId:"Circle"},zt={extends:wt,props:{radius:{type:Number,default:1},height:{type:Number,default:1},radialSegments:{type:Number,default:8},heightSegments:{type:Number,default:1},openEnded:{type:Boolean,default:!1},thetaStart:{type:Number,default:0},thetaLength:{type:Number,default:2*Math.PI}},created:function(){var e=this;this.createGeometry();["radius","height","radialSegments","heightSegments","openEnded","thetaStart","thetaLength"].forEach((function(t){i((function(){return e[t]}),(function(){e.refreshGeometry()}))}))},methods:{createGeometry:function(){this.geometry=new S(this.radius,this.height,this.radialSegments,this.heightSegments,this.openEnded,this.thetaStart,this.thetaLength)}},__hmrId:"Cone"},Mt={extends:wt,props:{radiusTop:{type:Number,default:1},radiusBottom:{type:Number,default:1},height:{type:Number,default:1},radialSegments:{type:Number,default:8},heightSegments:{type:Number,default:1},openEnded:{type:Boolean,default:!1},thetaStart:{type:Number,default:0},thetaLength:{type:Number,default:2*Math.PI}},created:function(){var e=this;this.createGeometry();["radiusTop","radiusBottom","height","radialSegments","heightSegments","openEnded","thetaStart","thetaLength"].forEach((function(t){i((function(){return e[t]}),(function(){e.refreshGeometry()}))}))},methods:{createGeometry:function(){this.geometry=new w(this.radiusTop,this.radiusBottom,this.height,this.radialSegments,this.heightSegments,this.openEnded,this.thetaStart,this.thetaLength)}},__hmrId:"Cylinder"},_t={extends:wt,props:{radius:{type:Number,default:1},detail:{type:Number,default:0}},created:function(){var e=this;this.createGeometry();["radius","detail"].forEach((function(t){i((function(){return e[t]}),(function(){e.refreshGeometry()}))}))},methods:{createGeometry:function(){this.geometry=new N(this.radius,this.detail)}},__hmrId:"Dodecahedron"},Tt={extends:wt,props:{radius:{type:Number,default:1},detail:{type:Number,default:0}},created:function(){var e=this;this.createGeometry();["radius","detail"].forEach((function(t){i((function(){return e[t]}),(function(){e.refreshGeometry()}))}))},methods:{createGeometry:function(){this.geometry=new C(this.radius,this.detail)}},__hmrId:"Icosahedron"},Gt={extends:wt,props:{points:Array,segments:{type:Number,default:12},phiStart:{type:Number,default:0},phiLength:{type:Number,default:2*Math.PI}},created:function(){var e=this;this.createGeometry();["points","segments","phiStart","phiLength"].forEach((function(t){i((function(){return e[t]}),(function(){e.refreshGeometry()}))}))},methods:{createGeometry:function(){this.geometry=new z(this.points,this.segments,this.phiStart,this.phiLength)}},__hmrId:"Lathe"},Pt={extends:wt,props:{radius:{type:Number,default:1},detail:{type:Number,default:0}},created:function(){var e=this;this.createGeometry();["radius","detail"].forEach((function(t){i((function(){return e[t]}),(function(){e.refreshGeometry()}))}))},methods:{createGeometry:function(){this.geometry=new M(this.radius,this.detail)}},__hmrId:"Octahedron"},It={extends:wt,props:{width:{type:Number,default:1},height:{type:Number,default:1},widthSegments:{type:Number,default:1},heightSegments:{type:Number,default:1}},created:function(){var e=this;this.createGeometry();["width","height","widthSegments","heightSegments"].forEach((function(t){i((function(){return e[t]}),(function(){e.refreshGeometry()}))}))},methods:{createGeometry:function(){this.geometry=new K(this.width,this.height,this.widthSegments,this.heightSegments)}},__hmrId:"Plane"},Lt={extends:wt,props:{vertices:Array,indices:Array,radius:{type:Number,default:1},detail:{type:Number,default:0}},created:function(){var e=this;this.createGeometry();["vertices","indices","radius","detail"].forEach((function(t){i((function(){return e[t]}),(function(){e.refreshGeometry()}))}))},methods:{createGeometry:function(){this.geometry=new _(this.vertices,this.indices,this.radius,this.detail)}},__hmrId:"Polyhedron"},Et={extends:wt,props:{innerRadius:{type:Number,default:.5},outerRadius:{type:Number,default:1},thetaSegments:{type:Number,default:8},phiSegments:{type:Number,default:1},thetaStart:{type:Number,default:0},thetaLength:{type:Number,default:2*Math.PI}},created:function(){var e=this;this.createGeometry();["innerRadius","outerRadius","thetaSegments","phiSegments","thetaStart","thetaLength"].forEach((function(t){i((function(){return e[t]}),(function(){e.refreshGeometry()}))}))},methods:{createGeometry:function(){this.geometry=new T(this.innerRadius,this.outerRadius,this.thetaSegments,this.phiSegments,this.thetaStart,this.thetaLength)}},__hmrId:"Ring"},Bt={extends:wt,props:{radius:Number,widthSegments:{type:Number,default:12},heightSegments:{type:Number,default:12}},watch:{radius:function(){this.refreshGeometry()},widthSegments:function(){this.refreshGeometry()},heightSegments:function(){this.refreshGeometry()}},created:function(){this.createGeometry()},methods:{createGeometry:function(){this.geometry=new G(this.radius,this.widthSegments,this.heightSegments)}},__hmrId:"Sphere"},jt={extends:wt,props:{radius:{type:Number,default:1},detail:{type:Number,default:0}},created:function(){var e=this;this.createGeometry();["radius","detail"].forEach((function(t){i((function(){return e[t]}),(function(){e.refreshGeometry()}))}))},methods:{createGeometry:function(){this.geometry=new P(this.radius,this.detail)}},__hmrId:"Tetrahedron"},Rt={text:String,fontSrc:String,size:{type:Number,default:80},height:{type:Number,default:5},depth:{type:Number,default:1},curveSegments:{type:Number,default:12},bevelEnabled:{type:Boolean,default:!1},bevelThickness:{type:Number,default:10},bevelSize:{type:Number,default:8},bevelOffset:{type:Number,default:0},bevelSegments:{type:Number,default:5},align:{type:[Boolean,String],default:!1}},kt={extends:wt,props:Object.assign({},Rt),created:function(){var e=this;["text","size","height","curveSegments","bevelEnabled","bevelThickness","bevelSize","bevelOffset","bevelSegments","align"].forEach((function(t){i((function(){return e[t]}),(function(){e.font&&e.refreshGeometry()}))})),(new J).load(this.fontSrc,(function(t){e.font=t,e.createGeometry(),e.initMesh()}))},methods:{createGeometry:function(){this.geometry=new Q(this.text,{font:this.font,size:this.size,height:this.height,depth:this.depth,curveSegments:this.curveSegments,bevelEnabled:this.bevelEnabled,bevelThickness:this.bevelThickness,bevelSize:this.bevelSize,bevelOffset:this.bevelOffset,bevelSegments:this.bevelSegments}),"center"===this.align&&this.geometry.center()}}},At={extends:wt,props:{radius:{type:Number,default:.5},tube:{type:Number,default:.4},radialSegments:{type:Number,default:8},tubularSegments:{type:Number,default:6},arc:{type:Number,default:2*Math.PI}},created:function(){var e=this;this.createGeometry();["radius","tube","radialSegments","tubularSegments","arc"].forEach((function(t){i((function(){return e[t]}),(function(){e.refreshGeometry()}))}))},methods:{createGeometry:function(){this.geometry=new I(this.radius,this.tube,this.radialSegments,this.tubularSegments,this.arc)}},__hmrId:"Torus"},Dt={extends:wt,props:{radius:{type:Number,default:.5},tube:{type:Number,default:.4},radialSegments:{type:Number,default:64},tubularSegments:{type:Number,default:8},p:{type:Number,default:2},q:{type:Number,default:3}},created:function(){var e=this;this.createGeometry();["radius","tube","radialSegments","tubularSegments","p","q"].forEach((function(t){i((function(){return e[t]}),(function(){e.refreshGeometry()}))}))},methods:{createGeometry:function(){this.geometry=new L(this.radius,this.tube,this.radialSegments,this.tubularSegments,this.p,this.q)}},__hmrId:"TorusKnot"},Ot={extends:wt,props:{path:E,tubularSegments:{type:Number,default:64},radius:{type:Number,default:1},radialSegments:{type:Number,default:8},closed:{type:Boolean,default:!1}},created:function(){var e=this;this.createGeometry();["path","tubularSegments","radius","radialSegments","closed"].forEach((function(t){i((function(){return e[t]}),(function(){e.refreshGeometry()}))}))},methods:{createGeometry:function(){this.geometry=new B(this.path,this.tubularSegments,this.radius,this.radialSegments,this.closed)}},__hmrId:"Tube"},Ft={extends:wt,props:{cubeRTSize:{type:Number,default:512},cubeCameraNear:{type:Number,default:.1},cubeCameraFar:{type:Number,default:2e3},autoUpdate:Boolean},mounted:function(){this.initGem(),this.autoUpdate?this.three.onBeforeRender(this.updateCubeRT):this.rendererComponent.onMounted(this.updateCubeRT)},unmounted:function(){this.three.offBeforeRender(this.updateCubeRT),this.meshBack&&this.scene.remove(this.meshBack),this.materialBack&&this.materialBack.dispose()},methods:{initGem:function(){var e=new ee(this.cubeRTSize,{format:te,generateMipmaps:!0,minFilter:ie});this.cubeCamera=new re(this.cubeCameraNear,this.cubeCameraFar,e),Be(this,"position",this.cubeCamera.position),this.scene.add(this.cubeCamera),this.material.side=D,this.material.envMap=e.texture,this.material.envMapIntensity=10,this.material.metalness=0,this.material.roughness=0,this.material.opacity=.75,this.material.transparent=!0,this.material.premultipliedAlpha=!0,this.material.needsUpdate=!0,this.materialBack=this.material.clone(),this.materialBack.side=ne,this.materialBack.envMapIntensity=5,this.materialBack.metalness=1,this.materialBack.roughness=0,this.materialBack.opacity=.5,this.meshBack=new X(this.geometry,this.materialBack),Be(this,"position",this.meshBack.position),Be(this,"rotation",this.meshBack.rotation),Be(this,"scale",this.meshBack.scale),this.scene.add(this.meshBack)},updateCubeRT:function(){this.mesh.visible=!1,this.meshBack.visible=!1,this.cubeCamera.update(this.three.renderer,this.scene),this.mesh.visible=!0,this.meshBack.visible=!0}},__hmrId:"Gem"},Ut={emits:["loaded"],extends:wt,props:{src:String,width:Number,height:Number,keepSize:Boolean},created:function(){var e=this;this.createGeometry(),this.createMaterial(),this.initMesh(),i((function(){return e.src}),this.refreshTexture),["width","height"].forEach((function(t){i((function(){return e[t]}),e.resize)})),this.keepSize&&this.three.onAfterResize(this.resize)},methods:{createGeometry:function(){this.geometry=new K(1,1,1,1)},createMaterial:function(){this.material=new O({side:se,map:this.loadTexture()})},loadTexture:function(){return(new g).load(this.src,this.onLoaded)},refreshTexture:function(){this.texture&&this.texture.dispose(),this.material.map=this.loadTexture(),this.material.needsUpdate=!0},onLoaded:function(e){this.texture=e,this.resize(),this.$emit("loaded")},resize:function(){if(this.texture){var e,t,i=this.three.size,r=this.texture.image.width/this.texture.image.height;this.width&&this.height?(e=this.width*i.wWidth/i.width,t=this.height*i.wHeight/i.height):this.width?t=(e=this.width*i.wWidth/i.width)/r:this.height&&(e=(t=this.height*i.wHeight/i.height)*r),this.mesh.scale.x=e,this.mesh.scale.y=t}}},__hmrId:"Image"},$t={inject:["three","scene"],props:{materialId:String,count:Number,position:Object,castShadow:Boolean,receiveShadow:Boolean},provide:function(){return{mesh:this}},beforeMount:function(){this.$slots.default||console.error("Missing Geometry")},mounted:function(){this.initMesh()},unmounted:function(){this.scene.remove(this.mesh)},methods:{initMesh:function(){var e=this;!this.material&&this.materialId&&(this.material=this.three.materials[this.materialId]),this.mesh=new ae(this.geometry,this.material,this.count),Be(this,"position",this.mesh.position),Be(this,"rotation",this.mesh.rotation),Be(this,"scale",this.mesh.scale),["castShadow","receiveShadow"].forEach((function(t){e.mesh[t]=e[t],i((function(){return e[t]}),(function(){e.mesh[t]=e[t]}))})),this.scene.add(this.mesh)},setGeometry:function(e){this.geometry=e,this.mesh&&(this.mesh.geometry=e)},setMaterial:function(e){this.material=e,this.mesh&&(this.mesh.material=e)}},render:function(){return this.$slots.default()},__hmrId:"InstancedMesh"},Zt={extends:wt,props:{cubeRTSize:{type:Number,default:512},cubeCameraNear:{type:Number,default:.1},cubeCameraFar:{type:Number,default:2e3},autoUpdate:Boolean},mounted:function(){this.initMirrorMesh(),this.autoUpdate?this.three.onBeforeRender(this.updateCubeRT):this.rendererComponent.onMounted(this.updateCubeRT)},unmounted:function(){this.three.offBeforeRender(this.updateCubeRT)},methods:{initMirrorMesh:function(){var e=new ee(this.cubeRTSize,{format:te,generateMipmaps:!0,minFilter:ie});this.cubeCamera=new re(this.cubeCameraNear,this.cubeCameraFar,e),Be(this,"position",this.cubeCamera.position),this.scene.add(this.cubeCamera),this.material.envMap=e.texture,this.material.needsUpdate=!0},updateCubeRT:function(){this.mesh.visible=!1,this.cubeCamera.update(this.three.renderer,this.scene),this.mesh.visible=!0}},__hmrId:"MirrorMesh"},Wt={extends:wt,props:{cubeRTSize:{type:Number,default:512},cubeCameraNear:{type:Number,default:.1},cubeCameraFar:{type:Number,default:2e3},autoUpdate:Boolean},mounted:function(){this.initMirrorMesh(),this.autoUpdate?this.three.onBeforeRender(this.updateCubeRT):this.rendererComponent.onMounted(this.updateCubeRT)},unmounted:function(){this.three.offBeforeRender(this.updateCubeRT)},methods:{initMirrorMesh:function(){var e=new ee(this.cubeRTSize,{mapping:oe,format:te,generateMipmaps:!0,minFilter:ie});this.cubeCamera=new re(this.cubeCameraNear,this.cubeCameraFar,e),Be(this,"position",this.cubeCamera.position),this.scene.add(this.cubeCamera),this.material.envMap=e.texture,this.material.refractionRatio=.95,this.material.needsUpdate=!0},updateCubeRT:function(){this.mesh.visible=!1,this.cubeCamera.update(this.three.renderer,this.scene),this.mesh.visible=!0}},__hmrId:"RefractionMesh"},qt={emits:["ready","loaded"],inject:["three","scene"],props:{src:String,position:Object,scale:Object},mounted:function(){this.texture=(new g).load(this.src,this.onLoaded),this.material=new he({map:this.texture}),this.sprite=new ue(this.material),this.geometry=this.sprite.geometry,Be(this,"position",this.sprite.position),Be(this,"scale",this.sprite.scale),this.scene.add(this.sprite),this.$emit("ready")},unmounted:function(){this.texture.dispose(),this.material.dispose(),this.scene.remove(this.sprite)},methods:{onLoaded:function(){this.updateUV(),this.$emit("loaded")},updateUV:function(){this.iWidth=this.texture.image.width,this.iHeight=this.texture.image.height,this.iRatio=this.iWidth/this.iHeight;var e=.5,t=.5;this.iRatio>1?t=.5/this.iRatio:e=.5/this.iRatio;var i=this.geometry.attributes.position.array;i[0]=-e,i[1]=-t,i[5]=e,i[6]=-t,i[10]=e,i[11]=t,i[15]=-e,i[16]=t,this.geometry.attributes.position.needsUpdate=!0}},render:function(){return[]},__hmrId:"Sprite"},Vt={setup:function(){return{passes:[]}},inject:["three"],provide:function(){return{passes:this.passes}},mounted:function(){var e=this;this.three.onAfterInit((function(){e.composer=new ge(e.three.renderer),e.three.renderer.autoClear=!1,e.passes.forEach((function(t){e.composer.addPass(t)})),e.three.composer=e.composer}))},render:function(){return this.$slots.default()},__hmrId:"EffectComposer"},Ht={inject:["three","passes"],beforeMount:function(){this.passes||console.error("Missing parent EffectComposer")},unmounted:function(){this.pass.dispose&&this.pass.dispose()},render:function(){return[]},__hmrId:"EffectPass"},Yt={extends:Ht,mounted:function(){this.three.scene||console.error("Missing Scene"),this.three.camera||console.error("Missing Camera");var e=new ve(this.three.scene,this.three.camera);this.passes.push(e),this.pass=e},__hmrId:"RenderPass"},Xt={extends:Ht,props:{focus:{type:Number,default:1},aperture:{type:Number,default:.025},maxblur:{type:Number,default:.01}},watch:{focus:function(){this.pass.uniforms.focus.value=this.focus},aperture:function(){this.pass.uniforms.aperture.value=this.aperture},maxblur:function(){this.pass.uniforms.maxblur.value=this.maxblur}},mounted:function(){this.three.scene||console.error("Missing Scene"),this.three.camera||console.error("Missing Camera");var e={focus:this.focus,aperture:this.aperture,maxblur:this.maxblur,width:this.three.size.width,height:this.three.size.height},t=new xe(this.three.scene,this.three.camera,e);this.passes.push(t),this.pass=t},__hmrId:"BokehPass"},Kt={extends:Ht,props:{noiseIntensity:{type:Number,default:.5},scanlinesIntensity:{type:Number,default:.05},scanlinesCount:{type:Number,default:4096},grayscale:{type:Number,default:0}},watch:{noiseIntensity:function(){this.pass.uniforms.nIntensity.value=this.noiseIntensity},scanlinesIntensity:function(){this.pass.uniforms.sIntensity.value=this.scanlinesIntensity},scanlinesCount:function(){this.pass.uniforms.sCount.value=this.scanlinesCount},grayscale:function(){this.pass.uniforms.grayscale.value=this.grayscale}},mounted:function(){var e=new be(this.noiseIntensity,this.scanlinesIntensity,this.scanlinesCount,this.grayscale);this.passes.push(e),this.pass=e},__hmrId:"FilmPass"},Jt={extends:Ht,props:{shape:{type:Number,default:1},radius:{type:Number,default:4},rotateR:{type:Number,default:Math.PI/12*1},rotateG:{type:Number,default:Math.PI/12*2},rotateB:{type:Number,default:Math.PI/12*3},scatter:{type:Number,default:0}},mounted:function(){var e=this,t=new Se(this.three.size.width,this.three.size.height,{});["shape","radius","rotateR","rotateG","rotateB","scatter"].forEach((function(r){t.uniforms[r].value=e[r],i((function(){return e[r]}),(function(){t.uniforms[r].value=e[r]}))})),this.passes.push(t),this.pass=t},__hmrId:"HalftonePass"},Qt={extends:Ht,props:{depthTexture:{type:Boolean,default:!1},useNormals:{type:Boolean,default:!1},resolution:Object},mounted:function(){this.three.scene||console.error("Missing Scene"),this.three.camera||console.error("Missing Camera");var e=this.resolution?new u(this.resolution.x,this.resolution.y):new u(this.three.size.width,this.three.size.height),t=new we(this.three.scene,this.three.camera,this.depthTexture,this.useNormals,e);this.passes.push(t),this.pass=t},__hmrId:"SAOPass"},ei={extends:Ht,props:{strength:{type:Number,default:1.5},radius:{type:Number,default:0},threshold:{type:Number,default:0}},watch:{strength:function(){this.pass.strength=this.strength},radius:function(){this.pass.radius=this.radius},threshold:function(){this.pass.threshold=this.threshold}},mounted:function(){var e=new u(this.three.size.width,this.three.size.height),t=new Ne(e,this.strength,this.radius,this.threshold);this.passes.push(t),this.pass=t},__hmrId:"UnrealBloomPass"},ti="\n//\n// Description : Array and textureless GLSL 2D simplex noise function.\n// Author : Ian McEwan, Ashima Arts.\n// Maintainer : ijm\n// Lastmod : 20110822 (ijm)\n// License : Copyright (C) 2011 Ashima Arts. All rights reserved.\n// Distributed under the MIT License. See LICENSE file.\n// https://github.com/ashima/webgl-noise\n//\n\nvec3 mod289(vec3 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec2 mod289(vec2 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec3 permute(vec3 x) {\n return mod289(((x*34.0)+1.0)*x);\n}\n\nfloat snoise(vec2 v)\n{\n const vec4 C = vec4(0.211324865405187, // (3.0-sqrt(3.0))/6.0\n 0.366025403784439, // 0.5*(sqrt(3.0)-1.0)\n -0.577350269189626, // -1.0 + 2.0 * C.x\n 0.024390243902439); // 1.0 / 41.0\n // First corner\n vec2 i = floor(v + dot(v, C.yy) );\n vec2 x0 = v - i + dot(i, C.xx);\n\n // Other corners\n vec2 i1;\n i1 = (x0.x > x0.y) ? vec2(1.0, 0.0) : vec2(0.0, 1.0);\n vec4 x12 = x0.xyxy + C.xxzz;\n x12.xy -= i1;\n\n // Permutations\n i = mod289(i); // Avoid truncation effects in permutation\n vec3 p = permute( permute( i.y + vec3(0.0, i1.y, 1.0 ))\n + i.x + vec3(0.0, i1.x, 1.0 ));\n\n vec3 m = max(0.5 - vec3(dot(x0,x0), dot(x12.xy,x12.xy), dot(x12.zw,x12.zw)), 0.0);\n m = m*m ;\n m = m*m ;\n\n // Gradients: 41 points uniformly over a line, mapped onto a diamond.\n // The ring size 17*17 = 289 is close to a multiple of 41 (41*7 = 287)\n\n vec3 x = 2.0 * fract(p * C.www) - 1.0;\n vec3 h = abs(x) - 0.5;\n vec3 ox = floor(x + 0.5);\n vec3 a0 = x - ox;\n\n // Normalise gradients implicitly by scaling m\n // Approximation of: m *= inversesqrt( a0*a0 + h*h );\n m *= 1.79284291400159 - 0.85373472095314 * ( a0*a0 + h*h );\n\n // Compute final noise value at P\n vec3 g;\n g.x = a0.x * x0.x + h.x * x0.y;\n g.yz = a0.yz * x12.xz + h.yz * x12.yw;\n return 130.0 * dot(m, g);\n}\n",ii={extends:Ut,props:{widthSegments:{type:Number,default:20},heightSegments:{type:Number,default:20},timeCoef:{type:Number,default:.001},noiseCoef:{type:Number,default:1},zCoef:{type:Number,default:5},dispCoef:{type:Number,default:.05}},setup:function(e){var t={value:e.noiseCoef};i((function(){return e.noiseCoef}),(function(e){t.value=e}));var r={value:e.zCoef};i((function(){return e.zCoef}),(function(e){r.value=e}));var n={value:e.dispCoef};return i((function(){return e.dispCoef}),(function(e){n.value=e})),{uTime:{value:0},uNoiseCoef:t,uZCoef:r,uDispCoef:n}},mounted:function(){this.startTime=Date.now(),this.three.onBeforeRender(this.updateTime)},unmounted:function(){this.three.offBeforeRender(this.updateTime)},methods:{createGeometry:function(){this.geometry=new K(1,1,this.widthSegments,this.heightSegments)},createMaterial:function(){var e=this;this.material=new O({side:se,map:this.loadTexture()}),this.material.onBeforeCompile=function(t){t.uniforms.uTime=e.uTime,t.uniforms.uNoiseCoef=e.uNoiseCoef,t.uniforms.uZCoef=e.uZCoef,t.uniforms.uDispCoef=e.uDispCoef,t.vertexShader="\n uniform float uTime;\n uniform float uNoiseCoef;\n uniform float uZCoef;\n varying float vNoise;\n "+ti+"\n "+t.vertexShader,t.vertexShader=t.vertexShader.replace("#include "," \n vec3 p = vec3(position * uNoiseCoef);\n p.x += uTime;\n vNoise = snoise(p.xy);\n vec3 transformed = vec3(position);\n transformed.z += vNoise * uZCoef;\n "),t.fragmentShader="\n uniform float uDispCoef;\n varying float vNoise;\n "+t.fragmentShader,t.fragmentShader=t.fragmentShader.replace("#include ","\n vec4 texelColor = texture2D(map, vUv);\n vec4 dispTexel = texture2D(map, vUv + vec2(vNoise * uDispCoef, 0));\n texelColor.r = dispTexel.r;\n diffuseColor = texelColor;\n "),e.materialShader=t}},updateTime:function(){this.uTime.value=(Date.now()-this.startTime)*this.timeCoef}},__hmrId:"NoisyImage"},ri={extends:It,props:{timeCoef:{type:Number,default:.001},noiseCoef:{type:Number,default:1},zCoef:{type:Number,default:5}},setup:function(e){var t={value:e.noiseCoef};i((function(){return e.noiseCoef}),(function(e){t.value=e}));var r={value:e.zCoef};return i((function(){return e.zCoef}),(function(e){r.value=e})),{uTime:{value:0},uNoiseCoef:t,uZCoef:r}},mounted:function(){this.updateMaterial(),this.startTime=Date.now(),this.three.onBeforeRender(this.updateTime)},unmounted:function(){this.three.offBeforeRender(this.updateTime)},methods:{updateMaterial:function(){var e=this;this.material.onBeforeCompile=function(t){t.uniforms.uTime=e.uTime,t.uniforms.uNoiseCoef=e.uNoiseCoef,t.uniforms.uZCoef=e.uZCoef,t.vertexShader="\n uniform float uTime;\n uniform float uNoiseCoef;\n uniform float uZCoef;\n varying float vNoise;\n \n//\n// Description : Array and textureless GLSL 2D/3D/4D simplex\n// noise functions.\n// Author : Ian McEwan, Ashima Arts.\n// Maintainer : ijm\n// Lastmod : 20110822 (ijm)\n// License : Copyright (C) 2011 Ashima Arts. All rights reserved.\n// Distributed under the MIT License. See LICENSE file.\n// https://github.com/ashima/webgl-noise\n//\n\nvec3 mod289(vec3 x) { return x - floor(x * (1.0 / 289.0)) * 289.0; }\nvec4 mod289(vec4 x) { return x - floor(x * (1.0 / 289.0)) * 289.0; }\nvec4 permute(vec4 x) { return mod289(((x*34.0)+1.0)*x); }\nvec4 taylorInvSqrt(vec4 r) { return 1.79284291400159 - 0.85373472095314 * r; }\n\nfloat snoise(vec3 v)\n{\n const vec2 C = vec2(1.0/6.0, 1.0/3.0) ;\n const vec4 D = vec4(0.0, 0.5, 1.0, 2.0);\n\n // First corner\n vec3 i = floor(v + dot(v, C.yyy) );\n vec3 x0 = v - i + dot(i, C.xxx) ;\n\n // Other corners\n vec3 g = step(x0.yzx, x0.xyz);\n vec3 l = 1.0 - g;\n vec3 i1 = min( g.xyz, l.zxy );\n vec3 i2 = max( g.xyz, l.zxy );\n\n vec3 x1 = x0 - i1 + C.xxx;\n vec3 x2 = x0 - i2 + C.yyy; // 2.0*C.x = 1/3 = C.y\n vec3 x3 = x0 - D.yyy; // -1.0+3.0*C.x = -0.5 = -D.y\n\n // Permutations\n i = mod289(i);\n vec4 p = permute( permute( permute(\n i.z + vec4(0.0, i1.z, i2.z, 1.0 ))\n + i.y + vec4(0.0, i1.y, i2.y, 1.0 ))\n + i.x + vec4(0.0, i1.x, i2.x, 1.0 ));\n\n // Gradients: 7x7 points over a square, mapped onto an octahedron.\n // The ring size 17*17 = 289 is close to a multiple of 49 (49*6 = 294)\n float n_ = 0.142857142857; // 1.0/7.0\n vec3 ns = n_ * D.wyz - D.xzx;\n\n vec4 j = p - 49.0 * floor(p * ns.z * ns.z); // mod(p,7*7)\n\n vec4 x_ = floor(j * ns.z);\n vec4 y_ = floor(j - 7.0 * x_ ); // mod(j,N)\n\n vec4 x = x_ *ns.x + ns.yyyy;\n vec4 y = y_ *ns.x + ns.yyyy;\n vec4 h = 1.0 - abs(x) - abs(y);\n\n vec4 b0 = vec4( x.xy, y.xy );\n vec4 b1 = vec4( x.zw, y.zw );\n\n vec4 s0 = floor(b0)*2.0 + 1.0;\n vec4 s1 = floor(b1)*2.0 + 1.0;\n vec4 sh = -step(h, vec4(0.0));\n\n vec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy ;\n vec4 a1 = b1.xzyw + s1.xzyw*sh.zzww ;\n\n vec3 p0 = vec3(a0.xy,h.x);\n vec3 p1 = vec3(a0.zw,h.y);\n vec3 p2 = vec3(a1.xy,h.z);\n vec3 p3 = vec3(a1.zw,h.w);\n\n // Normalise gradients\n vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3)));\n p0 *= norm.x;\n p1 *= norm.y;\n p2 *= norm.z;\n p3 *= norm.w;\n\n // Mix final noise value\n vec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.0);\n m = m * m;\n return 42.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1),\n dot(p2,x2), dot(p3,x3) ) );\n}\n\n "+t.vertexShader,t.vertexShader=t.vertexShader.replace("#include "," \n vec3 p = vec3(position * uNoiseCoef);\n vNoise = snoise(vec3(p.x, p.y, uTime));\n vec3 transformed = vec3(position);\n transformed.z += vNoise * uZCoef;\n "),e.materialShader=t},this.material.needsupdate=!0},updateTime:function(){this.uTime.value=(Date.now()-this.startTime)*this.timeCoef}},__hmrId:"NoisyPlane"},ni={extends:Bt,props:{radius:{type:Number,default:20},widthSegments:{type:Number,default:128},heightSegments:{type:Number,default:128},timeCoef:{type:Number,default:.001},noiseCoef:{type:Number,default:.05},dispCoef:{type:Number,default:5}},setup:function(e){var t={value:e.noiseCoef};i((function(){return e.noiseCoef}),(function(e){t.value=e}));var r={value:e.dispCoef};return i((function(){return e.dispCoef}),(function(e){r.value=e})),{uTime:{value:0},uNoiseCoef:t,uDispCoef:r}},mounted:function(){this.updateMaterial(),this.startTime=Date.now(),this.three.onBeforeRender(this.updateTime)},unmounted:function(){this.three.offBeforeRender(this.updateTime)},methods:{updateMaterial:function(){var e=this;this.material.onBeforeCompile=function(t){t.uniforms.uTime=e.uTime,t.uniforms.uNoiseCoef=e.uNoiseCoef,t.uniforms.uDispCoef=e.uDispCoef,t.vertexShader="\n uniform float uTime;\n uniform float uNoiseCoef;\n uniform float uDispCoef;\n varying float vNoise;\n \n//\n// Description : Array and textureless GLSL 2D/3D/4D simplex\n// noise functions.\n// Author : Ian McEwan, Ashima Arts.\n// Maintainer : ijm\n// Lastmod : 20110822 (ijm)\n// License : Copyright (C) 2011 Ashima Arts. All rights reserved.\n// Distributed under the MIT License. See LICENSE file.\n// https://github.com/ashima/webgl-noise\n//\n\nvec4 mod289(vec4 x) { return x - floor(x * (1.0 / 289.0)) * 289.0; }\nfloat mod289(float x) { return x - floor(x * (1.0 / 289.0)) * 289.0; }\nvec4 permute(vec4 x) { return mod289(((x*34.0)+1.0)*x); }\nfloat permute(float x) { return mod289(((x*34.0)+1.0)*x); }\nvec4 taylorInvSqrt(vec4 r) { return 1.79284291400159 - 0.85373472095314 * r; }\nfloat taylorInvSqrt(float r) { return 1.79284291400159 - 0.85373472095314 * r; }\n\nvec4 grad4(float j, vec4 ip)\n{\n const vec4 ones = vec4(1.0, 1.0, 1.0, -1.0);\n vec4 p,s;\n\n p.xyz = floor( fract (vec3(j) * ip.xyz) * 7.0) * ip.z - 1.0;\n p.w = 1.5 - dot(abs(p.xyz), ones.xyz);\n s = vec4(lessThan(p, vec4(0.0)));\n p.xyz = p.xyz + (s.xyz*2.0 - 1.0) * s.www;\n\n return p;\n}\n\n// (sqrt(5) - 1)/4 = F4, used once below\n#define F4 0.309016994374947451\n\nfloat snoise(vec4 v)\n{\n const vec4 C = vec4( 0.138196601125011, // (5 - sqrt(5))/20 G4\n 0.276393202250021, // 2 * G4\n 0.414589803375032, // 3 * G4\n -0.447213595499958); // -1 + 4 * G4\n\n // First corner\n vec4 i = floor(v + dot(v, vec4(F4)) );\n vec4 x0 = v - i + dot(i, C.xxxx);\n\n // Other corners\n\n // Rank sorting originally contributed by Bill Licea-Kane, AMD (formerly ATI)\n vec4 i0;\n vec3 isX = step( x0.yzw, x0.xxx );\n vec3 isYZ = step( x0.zww, x0.yyz );\n // i0.x = dot( isX, vec3( 1.0 ) );\n i0.x = isX.x + isX.y + isX.z;\n i0.yzw = 1.0 - isX;\n // i0.y += dot( isYZ.xy, vec2( 1.0 ) );\n i0.y += isYZ.x + isYZ.y;\n i0.zw += 1.0 - isYZ.xy;\n i0.z += isYZ.z;\n i0.w += 1.0 - isYZ.z;\n\n // i0 now contains the unique values 0,1,2,3 in each channel\n vec4 i3 = clamp( i0, 0.0, 1.0 );\n vec4 i2 = clamp( i0-1.0, 0.0, 1.0 );\n vec4 i1 = clamp( i0-2.0, 0.0, 1.0 );\n\n vec4 x1 = x0 - i1 + C.xxxx;\n vec4 x2 = x0 - i2 + C.yyyy;\n vec4 x3 = x0 - i3 + C.zzzz;\n vec4 x4 = x0 + C.wwww;\n\n // Permutations\n i = mod289(i);\n float j0 = permute( permute( permute( permute(i.w) + i.z) + i.y) + i.x);\n vec4 j1 = permute( permute( permute( permute (\n i.w + vec4(i1.w, i2.w, i3.w, 1.0 ))\n + i.z + vec4(i1.z, i2.z, i3.z, 1.0 ))\n + i.y + vec4(i1.y, i2.y, i3.y, 1.0 ))\n + i.x + vec4(i1.x, i2.x, i3.x, 1.0 ));\n\n // Gradients: 7x7x6 points over a cube, mapped onto a 4-cross polytope\n // 7*7*6 = 294, which is close to the ring size 17*17 = 289.\n vec4 ip = vec4(1.0/294.0, 1.0/49.0, 1.0/7.0, 0.0) ;\n\n vec4 p0 = grad4(j0, ip);\n vec4 p1 = grad4(j1.x, ip);\n vec4 p2 = grad4(j1.y, ip);\n vec4 p3 = grad4(j1.z, ip);\n vec4 p4 = grad4(j1.w, ip);\n\n // Normalise gradients\n vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3)));\n p0 *= norm.x;\n p1 *= norm.y;\n p2 *= norm.z;\n p3 *= norm.w;\n p4 *= taylorInvSqrt(dot(p4,p4));\n\n // Mix contributions from the five corners\n vec3 m0 = max(0.6 - vec3(dot(x0,x0), dot(x1,x1), dot(x2,x2)), 0.0);\n vec2 m1 = max(0.6 - vec2(dot(x3,x3), dot(x4,x4) ), 0.0);\n m0 = m0 * m0;\n m1 = m1 * m1;\n return 49.0 * ( dot(m0*m0, vec3( dot( p0, x0 ), dot( p1, x1 ), dot( p2, x2 )))\n + dot(m1*m1, vec2( dot( p3, x3 ), dot( p4, x4 ) ) ) ) ;\n\n}\n\n "+t.vertexShader,t.vertexShader=t.vertexShader.replace("#include ","\n vec4 p = vec4(vec3(position * uNoiseCoef), uTime);\n vNoise = snoise(p);\n vec3 transformed = vec3(position);\n transformed += normalize(position) * vNoise * uDispCoef;\n "),e.materialShader=t},this.material.needsupdate=!0},updateTime:function(){this.uTime.value=(Date.now()-this.startTime)*this.timeCoef}},__hmrId:"NoisySphere"},si={extends:kt,props:{timeCoef:{type:Number,default:.001},noiseCoef:{type:Number,default:.015},zCoef:{type:Number,default:10}},setup:function(e){var t={value:e.noiseCoef};i((function(){return e.noiseCoef}),(function(e){t.value=e}));var r={value:e.zCoef};return i((function(){return e.zCoef}),(function(e){r.value=e})),{uTime:{value:0},uNoiseCoef:t,uZCoef:r}},mounted:function(){this.updateMaterial(),this.startTime=Date.now(),this.three.onBeforeRender(this.updateTime)},unmounted:function(){this.three.offBeforeRender(this.updateTime)},methods:{updateMaterial:function(){var e=this;this.material.onBeforeCompile=function(t){t.uniforms.uTime=e.uTime,t.uniforms.uNoiseCoef=e.uNoiseCoef,t.uniforms.uZCoef=e.uZCoef,t.vertexShader="\n uniform float uTime;\n uniform float uNoiseCoef;\n uniform float uZCoef;\n "+ti+"\n "+t.vertexShader,t.vertexShader=t.vertexShader.replace("#include "," \n vec3 p = vec3(position * uNoiseCoef);\n p.x += uTime;\n float noise = snoise(p.xy);\n vec3 transformed = vec3(position);\n transformed.z += noise * uZCoef;\n "),e.materialShader=t},this.material.needsupdate=!0},updateTime:function(){this.uTime.value=(Date.now()-this.startTime)*this.timeCoef}},__hmrId:"NoisyText"},ai=function(e){var t=this;Object.entries(e).forEach((function(e){var i=e[0],r=e[1];t[i]=r})),this.o3d=new me,this.uProgress={value:0},this.uvScale=new u,this.initMaterial(),this.initPlane()};ai.prototype.initMaterial=function(){var e=this;this.material=new O({side:se,transparent:!0,map:this.texture,onBeforeCompile:function(t){t.uniforms.progress=e.uProgress,t.uniforms.uvScale={value:e.uvScale},t.vertexShader="\n uniform float progress;\n uniform vec2 uvScale;\n\n attribute vec3 offset;\n attribute vec3 rotation;\n attribute vec2 uvOffset;\n\n mat3 rotationMatrixXYZ(vec3 r)\n {\n float cx = cos(r.x);\n float sx = sin(r.x);\n float cy = cos(r.y);\n float sy = sin(r.y);\n float cz = cos(r.z);\n float sz = sin(r.z);\n\n return mat3(\n cy * cz, cx * sz + sx * sy * cz, sx * sz - cx * sy * cz,\n -cy * sz, cx * cz - sx * sy * sz, sx * cz + cx * sy * sz,\n sy, -sx * cy, cx * cy\n );\n }\n "+t.vertexShader,t.vertexShader=t.vertexShader.replace("#include ","\n #include \n vUv = vUv * uvScale + uvOffset;\n "),t.vertexShader=t.vertexShader.replace("#include ","\n mat3 rotMat = rotationMatrixXYZ(progress * rotation);\n transformed = rotMat * transformed;\n\n vec4 mvPosition = vec4(transformed, 1.0);\n #ifdef USE_INSTANCING\n mvPosition = instanceMatrix * mvPosition;\n #endif\n\n mvPosition.xyz += progress * offset;\n\n mvPosition = modelViewMatrix * mvPosition;\n gl_Position = projectionMatrix * mvPosition;\n ")}})},ai.prototype.initPlane=function(){var e=this.screen,t=e.width,i=e.wWidth,r=e.wHeight;this.wSize=this.size*i/t,this.nx=Math.ceil(i/this.wSize)+1,this.ny=Math.ceil(r/this.wSize)+1,this.icount=this.nx*this.ny,this.initGeometry(),this.initUV(),this.initAnimAttributes(),this.imesh&&this.o3d.remove(this.imesh),this.imesh=new ae(this.bGeometry,this.material,this.icount),this.o3d.add(this.imesh);for(var n=new me,s=0,a=-(i-(i-this.nx*this.wSize))/2+this.dx,o=0;ot?this.uvScale.set(1/this.nx,t/e/this.ny):this.uvScale.set(e/t/this.nx,1/this.ny);for(var i=this.uvScale.x*this.nx,r=this.uvScale.y*this.ny,n=new u,s=new Float32Array(2*this.icount),a=0;a0?this.targetProgress=Ee(this.targetProgress+.05,0,this.images.length-1):this.targetProgress=Ee(this.targetProgress-.05,0,this.images.length-1)},onClick:function(e){e.clientY0&&r c());\r\n\r\n return true;\r\n };\r\n\r\n /**\r\n * add after init handler\r\n */\r\n function onAfterInit(callback) {\r\n afterInitHandlers.push(callback);\r\n }\r\n\r\n /**\r\n * add after resize handler\r\n */\r\n function onAfterResize(callback) {\r\n afterResizeHandlers.push(callback);\r\n }\r\n\r\n /**\r\n * add before render handler\r\n */\r\n function onBeforeRender(callback) {\r\n beforeRenderHandlers.push(callback);\r\n }\r\n\r\n /**\r\n * default render\r\n */\r\n function render() {\r\n if (obj.orbitCtrl) obj.orbitCtrl.update();\r\n beforeRenderHandlers.forEach(c => c());\r\n obj.renderer.render(obj.scene, obj.camera);\r\n }\r\n\r\n /**\r\n * composer render\r\n */\r\n function renderC() {\r\n if (obj.orbitCtrl) obj.orbitCtrl.update();\r\n beforeRenderHandlers.forEach(c => c());\r\n obj.composer.render();\r\n }\r\n\r\n /**\r\n * remove listeners\r\n */\r\n function dispose() {\r\n window.removeEventListener('resize', onResize);\r\n if (obj.mouse_move_element) {\r\n obj.mouse_move_element.removeEventListener('mousemove', onMousemove);\r\n obj.mouse_move_element.removeEventListener('mouseleave', onMouseleave); \r\n }\r\n }\r\n\r\n /**\r\n * mousemove listener\r\n */\r\n function onMousemove(e) {\r\n mouse.x = (e.clientX / size.width) * 2 - 1;\r\n mouse.y = -(e.clientY / size.height) * 2 + 1;\r\n updateMouseV3();\r\n }\r\n\r\n /**\r\n * mouseleave listener\r\n */\r\n function onMouseleave(e) {\r\n mouse.x = 0;\r\n mouse.y = 0;\r\n updateMouseV3();\r\n }\r\n\r\n /**\r\n * get 3d mouse position\r\n */\r\n function updateMouseV3() {\r\n if (conf.mouse_raycast) {\r\n obj.camera.getWorldDirection(mousePlane.normal);\r\n mousePlane.normal.normalize();\r\n raycaster.setFromCamera(mouse, obj.camera);\r\n raycaster.ray.intersectPlane(mousePlane, mouseV3);\r\n }\r\n }\r\n\r\n /**\r\n * resize listener\r\n */\r\n function onResize() {\r\n if (conf.resize === 'window') {\r\n setSize(window.innerWidth, window.innerHeight);\r\n } else {\r\n setSize(conf.resize.clientWidth, conf.resize.clientHeight);\r\n }\r\n afterResizeHandlers.forEach(c => c());\r\n }\r\n\r\n /**\r\n * update renderer size and camera\r\n */\r\n function setSize(width, height) {\r\n size.width = width;\r\n size.height = height;\r\n size.ratio = width / height;\r\n\r\n obj.renderer.setSize(width, height, false);\r\n obj.camera.aspect = size.ratio;\r\n obj.camera.updateProjectionMatrix();\r\n\r\n if (obj.composer) {\r\n obj.composer.setSize(width, height);\r\n }\r\n\r\n const wsize = getCameraSize();\r\n size.wWidth = wsize[0]; size.wHeight = wsize[1];\r\n }\r\n\r\n /**\r\n * calculate camera visible area size\r\n */\r\n function getCameraSize() {\r\n const vFOV = (obj.camera.fov * Math.PI) / 180;\r\n const h = 2 * Math.tan(vFOV / 2) * Math.abs(obj.camera.position.z);\r\n const w = h * obj.camera.aspect;\r\n return [w, h];\r\n }\r\n\r\n return obj;\r\n}\r\n","import { h } from 'vue';\r\nimport useThree from './useThree';\r\n\r\nexport default {\r\n props: {\r\n antialias: {\r\n type: Boolean,\r\n default: true,\r\n },\r\n alpha: {\r\n type: Boolean,\r\n default: false,\r\n },\r\n shadow: {\r\n type: Boolean,\r\n default: false,\r\n },\r\n orbitCtrl: {\r\n type: [Boolean, Object],\r\n default: false,\r\n },\r\n mouseMove: {\r\n type: [Boolean, String],\r\n default: false,\r\n },\r\n mouseRaycast: {\r\n type: Boolean,\r\n default: false,\r\n },\r\n resize: {\r\n type: [Boolean, String, Element],\r\n default: 'window',\r\n },\r\n width: String,\r\n height: String,\r\n },\r\n setup(props) {\r\n return {\r\n three: useThree(),\r\n raf: true,\r\n };\r\n },\r\n provide() {\r\n return {\r\n three: this.three,\r\n };\r\n },\r\n mounted() {\r\n const params = {\r\n canvas: this.$refs.canvas,\r\n antialias: this.antialias,\r\n alpha: this.alpha,\r\n orbit_ctrl: this.orbitCtrl,\r\n mouse_move: this.mouseMove,\r\n mouse_raycast: this.mouseRaycast,\r\n resize: this.resize,\r\n width: this.width,\r\n height: this.height,\r\n };\r\n\r\n if (this.three.init(params)) {\r\n this.three.renderer.shadowMap.enabled = this.shadow;\r\n if (this.three.composer) this.animateC();\r\n else this.animate();\r\n };\r\n },\r\n beforeUnmount() {\r\n this.raf = false;\r\n this.three.dispose();\r\n },\r\n methods: {\r\n onBeforeRender(callback) {\r\n this.three.onBeforeRender(callback);\r\n },\r\n onAfterResize(callback) {\r\n this.three.onAfterResize(callback);\r\n },\r\n animate() {\r\n if (this.raf) requestAnimationFrame(this.animate);\r\n this.three.render();\r\n },\r\n animateC() {\r\n if (this.raf) requestAnimationFrame(this.animateC);\r\n this.three.renderC();\r\n },\r\n },\r\n render() {\r\n return h(\r\n 'canvas',\r\n { ref: 'canvas' },\r\n this.$slots.default()\r\n );\r\n },\r\n};\r\n","export function setFromProp(o, prop) {\r\n if (prop instanceof Object) {\r\n for (const [key, value] of Object.entries(prop)) {\r\n o[key] = value;\r\n }\r\n }\r\n};\r\n\r\nexport function lerp(value1, value2, amount) {\r\n amount = amount < 0 ? 0 : amount;\r\n amount = amount > 1 ? 1 : amount;\r\n return value1 + (value2 - value1) * amount;\r\n};\r\n\r\nexport function lerpv3(v1, v2, amount) {\r\n v1.x = lerp(v1.x, v2.x, amount);\r\n v1.y = lerp(v1.y, v2.y, amount);\r\n v1.z = lerp(v1.z, v2.z, amount);\r\n};\r\n","import { PerspectiveCamera } from 'three';\r\nimport { setFromProp } from '../tools.js';\r\n\r\nexport default {\r\n inject: ['three'],\r\n props: {\r\n fov: {\r\n type: Number,\r\n default: 50,\r\n },\r\n position: Object,\r\n },\r\n created() {\r\n const camera = new PerspectiveCamera(this.fov);\r\n setFromProp(camera.position, this.position);\r\n this.three.camera = camera;\r\n },\r\n render() {\r\n return [];\r\n },\r\n};\r\n","import { Scene, Color } from 'three';\r\n\r\nexport default {\r\n inject: ['three'],\r\n props: {\r\n id: String,\r\n background: [String, Number],\r\n },\r\n setup (props) {\r\n const scene = new Scene();\r\n if (props.background) scene.background = new Color(props.background);\r\n return { scene };\r\n },\r\n provide() {\r\n return {\r\n scene: this.scene,\r\n };\r\n },\r\n mounted() {\r\n if (!this.three.scene) {\r\n this.three.scene = this.scene;\r\n }\r\n },\r\n render() {\r\n if (this.$slots.default) {\r\n return this.$slots.default();\r\n }\r\n return [];\r\n },\r\n};\r\n","export default {\r\n inject: ['parent'],\r\n beforeMount() {\r\n if (!this.parent) {\r\n console.error('Missing parent Mesh');\r\n }\r\n },\r\n unmounted() {\r\n this.parent.geometry.dispose();\r\n },\r\n render() {\r\n return [];\r\n },\r\n};\r\n","import { BoxBufferGeometry } from 'three';\r\nimport Geometry from './Geometry.js';\r\n\r\nexport default {\r\n extends: Geometry,\r\n props: {\r\n size: {\r\n type: Number,\r\n },\r\n width: {\r\n type: Number,\r\n default: 1,\r\n },\r\n height: {\r\n type: Number,\r\n default: 1,\r\n },\r\n depth: {\r\n type: Number,\r\n default: 1,\r\n },\r\n },\r\n mounted() {\r\n if (this.size) {\r\n this.parent.geometry = new BoxBufferGeometry(this.size, this.size, this.size);\r\n } else {\r\n this.parent.geometry = new BoxBufferGeometry(this.width, this.height, this.depth);\r\n }\r\n },\r\n};\r\n","import { SphereBufferGeometry } from 'three';\r\nimport Geometry from './Geometry.js';\r\n\r\nexport default {\r\n extends: Geometry,\r\n props: {\r\n radius: Number,\r\n widthSegments: {\r\n type: Number,\r\n default: 12,\r\n },\r\n heightSegments: {\r\n type: Number,\r\n default: 12,\r\n },\r\n },\r\n mounted() {\r\n this.parent.geometry = new SphereBufferGeometry(this.radius, this.widthSegments, this.heightSegments);\r\n },\r\n};\r\n","import { setFromProp } from '../tools.js';\r\n\r\nexport default {\r\n inject: ['scene'],\r\n props: {\r\n color: {\r\n type: String,\r\n default: '#ffffff',\r\n },\r\n intensity: {\r\n type: Number,\r\n default: 1,\r\n },\r\n castShadow: {\r\n type: Boolean,\r\n default: false,\r\n },\r\n shadowMapSize: Object,\r\n position: Object,\r\n },\r\n mounted() {\r\n setFromProp(this.light.position, this.position);\r\n\r\n if (this.light.shadow) {\r\n this.light.castShadow = this.castShadow;\r\n setFromProp(this.light.shadow.mapSize, this.shadowMapSize);\r\n }\r\n\r\n this.scene.add(this.light);\r\n if (this.light.target) this.scene.add(this.light.target);\r\n },\r\n render() {\r\n return [];\r\n },\r\n};\r\n","import { AmbientLight } from 'three';\r\nimport Light from './Light.js';\r\n\r\nexport default {\r\n extends: Light,\r\n created() {\r\n this.light = new AmbientLight(this.color, this.intensity);\r\n },\r\n};\r\n","import { PointLight } from 'three';\r\nimport Light from './Light.js';\r\n\r\nexport default {\r\n extends: Light,\r\n props: {\r\n distance: {\r\n type: Number,\r\n default: 0,\r\n },\r\n decay: {\r\n type: Number,\r\n default: 1,\r\n },\r\n },\r\n created() {\r\n this.light = new PointLight(this.color, this.intensity, this.distance, this.decay);\r\n },\r\n};\r\n","import { SpotLight } from 'three';\r\nimport Light from './Light.js';\r\n\r\nexport default {\r\n extends: Light,\r\n props: {\r\n distance: {\r\n type: Number,\r\n default: 0,\r\n },\r\n angle: {\r\n type: Number,\r\n default: Math.PI / 3,\r\n },\r\n penumbra: {\r\n type: Number,\r\n default: 0,\r\n },\r\n decay: {\r\n type: Number,\r\n default: 1,\r\n },\r\n },\r\n created() {\r\n this.light = new SpotLight(this.color, this.intensity, this.distance, this.angle, this.penumbra, this.decay);\r\n },\r\n};\r\n","import { FrontSide } from 'three';\r\n\r\nexport default {\r\n inject: ['three'],\r\n props: {\r\n id: String,\r\n color: {\r\n type: [String, Number],\r\n default: '#ffffff',\r\n },\r\n depthTest: {\r\n type: Boolean,\r\n default: true,\r\n },\r\n depthWrite: {\r\n type: Boolean,\r\n default: true,\r\n },\r\n fog: {\r\n type: Boolean,\r\n default: false,\r\n },\r\n opacity: {\r\n type: Number,\r\n default: 1,\r\n },\r\n side: {\r\n type: Number,\r\n default: FrontSide,\r\n },\r\n transparent: {\r\n type: Boolean,\r\n default: false,\r\n },\r\n vertexColors: {\r\n type: Boolean,\r\n default: false,\r\n },\r\n },\r\n mounted() {\r\n this.three.materials[this.id] = this.material;\r\n },\r\n unmounted() {\r\n this.material.dispose();\r\n },\r\n methods: {\r\n propsValues() {\r\n const props = {};\r\n for (const [key, value] of Object.entries(this.$props)) {\r\n if (key !== 'id') props[key] = value;\r\n }\r\n return props;\r\n },\r\n },\r\n render() {\r\n return [];\r\n },\r\n};\r\n","import { MeshBasicMaterial } from 'three';\r\nimport Material from './Material';\r\n\r\nexport default {\r\n extends: Material,\r\n created() {\r\n this.material = new MeshBasicMaterial({\r\n color: this.color,\r\n });\r\n },\r\n};\r\n","import { MeshLambertMaterial } from 'three';\r\nimport Material from './Material';\r\n\r\nexport default {\r\n extends: Material,\r\n created() {\r\n this.material = new MeshLambertMaterial({\r\n color: this.color,\r\n });\r\n },\r\n};\r\n","import { MeshPhongMaterial } from 'three';\r\nimport Material from './Material';\r\n\r\nexport default {\r\n extends: Material,\r\n created() {\r\n this.material = new MeshPhongMaterial({\r\n color: this.color,\r\n });\r\n },\r\n};\r\n","import { MeshPhysicalMaterial } from 'three';\r\nimport Material from './Material';\r\n\r\nexport default {\r\n extends: Material,\r\n created() {\r\n this.material = new MeshPhysicalMaterial({\r\n color: this.color,\r\n });\r\n },\r\n};\r\n","import { MeshStandardMaterial } from 'three';\r\nimport Material from './Material';\r\n\r\nexport default {\r\n extends: Material,\r\n props: {\r\n emissive: {\r\n type: [Number, String],\r\n default: 0,\r\n },\r\n emissiveIntensity: {\r\n type: Number,\r\n default: 1,\r\n },\r\n metalness: {\r\n type: Number,\r\n default: 0,\r\n },\r\n roughness: {\r\n type: Number,\r\n default: 1,\r\n },\r\n },\r\n created() {\r\n this.material = new MeshStandardMaterial(this.propsValues());\r\n },\r\n};\r\n","import { Mesh } from 'three';\r\nimport { setFromProp } from '../tools.js';\r\n\r\nexport default {\r\n inject: ['three', 'scene'],\r\n props: {\r\n material: String,\r\n position: Object,\r\n rotation: Object,\r\n scale: Object,\r\n castShadow: {\r\n type: Boolean,\r\n default: false,\r\n },\r\n receiveShadow: {\r\n type: Boolean,\r\n default: false,\r\n },\r\n },\r\n mounted() {\r\n this.mesh = new Mesh(this.geometry, this.three.materials[this.material]);\r\n setFromProp(this.mesh.position, this.position);\r\n setFromProp(this.mesh.rotation, this.rotation);\r\n setFromProp(this.mesh.scale, this.scale);\r\n this.mesh.castShadow = this.castShadow;\r\n this.mesh.receiveShadow = this.receiveShadow;\r\n this.scene.add(this.mesh);\r\n },\r\n unmounted() {\r\n this.geometry.dispose();\r\n },\r\n render() {\r\n return [];\r\n },\r\n};\r\n","import { BoxBufferGeometry } from 'three';\r\nimport Mesh from './Mesh.js';\r\n\r\nexport default {\r\n extends: Mesh,\r\n props: {\r\n size: {\r\n type: Number,\r\n },\r\n width: {\r\n type: Number,\r\n default: 1,\r\n },\r\n height: {\r\n type: Number,\r\n default: 1,\r\n },\r\n depth: {\r\n type: Number,\r\n default: 1,\r\n },\r\n },\r\n created() {\r\n if (this.size) {\r\n this.geometry = new BoxBufferGeometry(this.size, this.size, this.size);\r\n } else {\r\n this.geometry = new BoxBufferGeometry(this.width, this.height, this.depth);\r\n }\r\n },\r\n};\r\n","import { PlaneBufferGeometry } from 'three';\r\nimport Mesh from './Mesh.js';\r\n\r\nexport default {\r\n extends: Mesh,\r\n props: {\r\n width: {\r\n type: Number,\r\n default: 1,\r\n },\r\n height: {\r\n type: Number,\r\n default: 1,\r\n },\r\n widthSegments: {\r\n type: Number,\r\n default: 1,\r\n },\r\n heightSegments: {\r\n type: Number,\r\n default: 1,\r\n },\r\n },\r\n created() {\r\n this.geometry = new PlaneBufferGeometry(this.width, this.height, this.widthSegments, this.heightSegments);\r\n },\r\n};\r\n","import { SphereBufferGeometry } from 'three';\r\nimport Mesh from './Mesh.js';\r\n\r\nexport default {\r\n extends: Mesh,\r\n props: {\r\n radius: Number,\r\n widthSegments: {\r\n type: Number,\r\n default: 12,\r\n },\r\n heightSegments: {\r\n type: Number,\r\n default: 12,\r\n },\r\n },\r\n created() {\r\n this.geometry = new SphereBufferGeometry(this.radius, this.widthSegments, this.heightSegments);\r\n },\r\n};\r\n","import { InstancedMesh } from 'three';\r\nimport { setFromProp } from '../tools.js';\r\n\r\nexport default {\r\n inject: ['three', 'scene'],\r\n props: {\r\n material: String,\r\n count: Number,\r\n position: Object,\r\n castShadow: {\r\n type: Boolean,\r\n default: false,\r\n },\r\n receiveShadow: {\r\n type: Boolean,\r\n default: false,\r\n },\r\n },\r\n setup() {\r\n return {\r\n conf: {},\r\n };\r\n },\r\n provide() {\r\n return {\r\n parent: this.conf,\r\n };\r\n },\r\n beforeMount() {\r\n if (!this.$slots.default) {\r\n console.error('Missing Geometry');\r\n }\r\n },\r\n mounted() {\r\n this.mesh = new InstancedMesh(this.conf.geometry, this.three.materials[this.material], this.count);\r\n setFromProp(this.mesh.position, this.position);\r\n this.mesh.castShadow = this.castShadow;\r\n this.mesh.receiveShadow = this.receiveShadow;\r\n this.scene.add(this.mesh);\r\n },\r\n render() {\r\n return this.$slots.default();\r\n },\r\n};\r\n","import { EffectComposer } from 'three/examples/jsm/postprocessing/EffectComposer.js';\r\n\r\nexport default {\r\n setup() {\r\n return {\r\n passes: [],\r\n };\r\n },\r\n inject: ['three'],\r\n provide() {\r\n return {\r\n passes: this.passes,\r\n };\r\n },\r\n mounted() {\r\n this.three.onAfterInit(() => {\r\n this.composer = new EffectComposer(this.three.renderer);\r\n this.passes.forEach(pass => {\r\n this.composer.addPass(pass);\r\n });\r\n this.three.composer = this.composer;\r\n });\r\n },\r\n render() {\r\n return this.$slots.default();\r\n },\r\n};\r\n","export default {\r\n inject: ['three', 'passes'],\r\n beforeMount() {\r\n if (!this.passes) {\r\n console.error('Missing parent EffectComposer');\r\n }\r\n },\r\n render() {\r\n return [];\r\n },\r\n};\r\n","import { RenderPass } from 'three/examples/jsm/postprocessing/RenderPass.js';\r\nimport EffectPass from './EffectPass.js';\r\n\r\nexport default {\r\n extends: EffectPass,\r\n mounted() {\r\n if (!this.three.scene) {\r\n console.error('Missing Scene');\r\n }\r\n if (!this.three.camera) {\r\n console.error('Missing Camera');\r\n }\r\n const pass = new RenderPass(this.three.scene, this.three.camera);\r\n this.passes.push(pass);\r\n this.pass = pass;\r\n },\r\n};\r\n","import { BokehPass } from 'three/examples/jsm/postprocessing/BokehPass.js';\r\nimport EffectPass from './EffectPass.js';\r\n\r\nexport default {\r\n extends: EffectPass,\r\n props: {\r\n focus: {\r\n type: Number,\r\n default: 1,\r\n },\r\n aperture: {\r\n type: Number,\r\n default: 0.025,\r\n },\r\n maxblur: {\r\n type: Number,\r\n default: 0.01,\r\n },\r\n },\r\n // watch: {\r\n // focus() {\r\n // this.pass.focus = this.focus;\r\n // },\r\n // aperture() {\r\n // this.pass.aperture = this.aperture;\r\n // },\r\n // maxblur() {\r\n // this.pass.maxblur = this.maxblur;\r\n // },\r\n // },\r\n mounted() {\r\n if (!this.three.scene) {\r\n console.error('Missing Scene');\r\n }\r\n if (!this.three.camera) {\r\n console.error('Missing Camera');\r\n }\r\n const params = {\r\n focus: this.focus,\r\n aperture: this.aperture,\r\n maxblur: this.maxblur,\r\n width: this.three.size.width,\r\n height: this.three.size.height,\r\n };\r\n const pass = new BokehPass(this.three.scene, this.three.camera, params);\r\n this.passes.push(pass);\r\n this.pass = pass;\r\n },\r\n};\r\n","import { Vector2 } from 'three';\r\nimport { UnrealBloomPass } from 'three/examples/jsm/postprocessing/UnrealBloomPass.js';\r\nimport EffectPass from './EffectPass.js';\r\n\r\nexport default {\r\n extends: EffectPass,\r\n props: {\r\n strength: {\r\n type: Number,\r\n default: 1.5,\r\n },\r\n radius: {\r\n type: Number,\r\n default: 0,\r\n },\r\n threshold: {\r\n type: Number,\r\n default: 0,\r\n },\r\n },\r\n // watch: {\r\n // strength() {\r\n // this.pass.strength = this.strength;\r\n // },\r\n // radius() {\r\n // this.pass.strength = this.radius;\r\n // },\r\n // threshold() {\r\n // this.pass.strength = this.threshold;\r\n // },\r\n // },\r\n mounted() {\r\n const size = new Vector2(this.three.size.width, this.three.size.height);\r\n const pass = new UnrealBloomPass(size, this.strength, this.radius, this.threshold);\r\n this.passes.push(pass);\r\n this.pass = pass;\r\n },\r\n};\r\n"],"names":["useThree","const","conf","canvas","antialias","alpha","orbit_ctrl","mouse_move","mouse_raycast","resize","width","height","size","wWidth","wHeight","ratio","afterInitHandlers","afterResizeHandlers","beforeRenderHandlers","mouse","Vector2","mouseV3","Vector3","mousePlane","Plane","raycaster","Raycaster","obj","renderer","camera","cameraCtrl","materials","scene","params","key","value","Object","entries","console","error","WebGLRenderer","orbitCtrl","OrbitControls","domElement","setSize","onResize","window","addEventListener","mouse_move_element","document","body","onMousemove","onMouseleave","forEach","c","removeEventListener","update","render","composer","callback","push","e","x","clientX","y","clientY","updateMouseV3","getWorldDirection","normal","normalize","setFromCamera","ray","intersectPlane","innerWidth","innerHeight","clientWidth","clientHeight","aspect","updateProjectionMatrix","wsize","vFOV","fov","Math","PI","h","tan","abs","position","z","getCameraSize","props","type","Boolean","default","shadow","mouseMove","String","mouseRaycast","Element","setup","three","raf","provide","this","mounted","$refs","init","shadowMap","enabled","animateC","animate","beforeUnmount","dispose","methods","onBeforeRender","onAfterResize","requestAnimationFrame","renderC","ref","$slots","setFromProp","o","prop","lerp","value1","value2","amount","lerpv3","v1","v2","inject","Number","created","PerspectiveCamera","id","background","Scene","Color","beforeMount","parent","unmounted","geometry","extends","Geometry","depth","BoxBufferGeometry","radius","widthSegments","heightSegments","SphereBufferGeometry","color","intensity","castShadow","shadowMapSize","light","mapSize","add","target","Light","AmbientLight","distance","decay","PointLight","angle","penumbra","SpotLight","depthTest","depthWrite","fog","opacity","side","FrontSide","transparent","vertexColors","material","propsValues","$props","Material","MeshBasicMaterial","MeshLambertMaterial","MeshPhongMaterial","MeshPhysicalMaterial","emissive","emissiveIntensity","metalness","roughness","MeshStandardMaterial","rotation","scale","receiveShadow","mesh","Mesh","PlaneBufferGeometry","count","InstancedMesh","passes","onAfterInit","EffectComposer","pass","addPass","EffectPass","RenderPass","focus","aperture","maxblur","BokehPass","strength","threshold","UnrealBloomPass"],"mappings":"k1BAae,SAASA,IAEtBC,IAAMC,EAAO,CACXC,OAAQ,KACRC,WAAW,EACXC,OAAO,EACPC,YAAY,EACZC,YAAY,EACZC,eAAe,EACfC,OAAQ,SACRC,MAAO,EACPC,OAAQ,GAIJC,EAAO,CACXF,MAAO,EAAGC,OAAQ,EAClBE,OAAQ,EAAGC,QAAS,EACpBC,MAAO,GAIHC,EAAoB,GACpBC,EAAsB,GACtBC,EAAuB,GAGvBC,EAAQ,IAAIC,EACZC,EAAU,IAAIC,EACdC,EAAa,IAAIC,EAAM,IAAIF,EAAQ,EAAG,EAAG,GAAI,GAC7CG,EAAY,IAAIC,EAGhBC,EAAM,MACVzB,EACA0B,SAAU,KACVC,OAAQ,KACRC,WAAY,KACZC,UAAW,GACXC,MAAO,UACPpB,QACAO,UAAOE,OAcT,SAAcY,GACZ,GAAIA,EACF,IAAKhC,IAAOiC,EAAKC,KAAUC,OAAOC,QAAQJ,GACxC/B,EAAKgC,GAAOC,EAIhB,IAAKR,EAAIK,MAEP,Y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QAAQC,MAAM,iBAEXgE,KAAKH,MAAMvE,QACdS,QAAQC,MAAM,kBAEhBtC,IAAMgC,EAAS,CACbyK,MAAOnG,KAAKmG,MACZC,SAAUpG,KAAKoG,SACfC,QAASrG,KAAKqG,QACdlM,MAAO6F,KAAKH,MAAMxF,KAAKF,MACvBC,OAAQ4F,KAAKH,MAAMxF,KAAKD,QAEpB2L,EAAO,IAAIO,EAAUtG,KAAKH,MAAMpE,MAAOuE,KAAKH,MAAMvE,OAAQI,GAChEsE,KAAK4F,OAAOvI,KAAK0I,GACjB/F,KAAK+F,KAAOA,OC1CD,CACbxD,QAAS0D,GACT9G,MAAO,CACLoH,SAAU,CACRnH,KAAMwC,OACNtC,QAAS,KAEXqD,OAAQ,CACNvD,KAAMwC,OACNtC,QAAS,GAEXkH,UAAW,CACTpH,KAAMwC,OACNtC,QAAS,IAcbW,mBACEvG,IAAMW,EAAO,IAAIQ,EAAQmF,KAAKH,MAAMxF,KAAKF,MAAO6F,KAAKH,MAAMxF,KAAKD,QAC1D2L,EAAO,IAAIU,EAAgBpM,EAAM2F,KAAKuG,SAAUvG,KAAK2C,OAAQ3C,KAAKwG,WACxExG,KAAK4F,OAAOvI,KAAK0I,GACjB/F,KAAK+F,KAAOA"} \ No newline at end of file +{"version":3,"file":"trois.module.min.js","sources":["../src/core/useThree.js","../src/core/Renderer.js","../src/tools.js","../src/use/useBindProp.js","../src/core/PerspectiveCamera.js","../src/core/Scene.js","../src/core/Texture.js","../src/core/CubeTexture.js","../src/geometries/Geometry.js","../src/geometries/BoxGeometry.js","../src/geometries/CircleGeometry.js","../src/geometries/ConeGeometry.js","../src/geometries/CylinderGeometry.js","../src/geometries/DodecahedronGeometry.js","../src/geometries/IcosahedronGeometry.js","../src/geometries/LatheGeometry.js","../src/geometries/OctahedronGeometry.js","../src/geometries/PolyhedronGeometry.js","../src/geometries/RingGeometry.js","../src/geometries/SphereGeometry.js","../src/geometries/TetrahedronGeometry.js","../src/geometries/TorusGeometry.js","../src/geometries/TorusKnotGeometry.js","../src/geometries/TubeGeometry.js","../src/lights/Light.js","../src/lights/AmbientLight.js","../src/lights/DirectionalLight.js","../src/lights/PointLight.js","../src/lights/SpotLight.js","../src/materials/Material.js","../src/materials/BasicMaterial.js","../src/materials/LambertMaterial.js","../src/materials/PhongMaterial.js","../src/materials/StandardMaterial.js","../src/materials/PhysicalMaterial.js","../src/materials/SubsurfaceScatteringShader.js","../src/materials/SubSurfaceMaterial.js","../src/materials/ShaderMaterial.js","../src/materials/ToonMaterial.js","../src/materials/Map.js","../src/materials/EnvMap.js","../src/meshes/Mesh.js","../src/meshes/Box.js","../src/meshes/Circle.js","../src/meshes/Cone.js","../src/meshes/Cylinder.js","../src/meshes/Dodecahedron.js","../src/meshes/Icosahedron.js","../src/meshes/Lathe.js","../src/meshes/Octahedron.js","../src/meshes/Plane.js","../src/meshes/Polyhedron.js","../src/meshes/Ring.js","../src/meshes/Sphere.js","../src/meshes/Tetrahedron.js","../src/meshes/TextProps.js","../src/meshes/Text.js","../src/meshes/Torus.js","../src/meshes/TorusKnot.js","../src/meshes/Tube.js","../src/meshes/Gem.js","../src/meshes/Image.js","../src/meshes/InstancedMesh.js","../src/meshes/MirrorMesh.js","../src/meshes/RefractionMesh.js","../src/meshes/Sprite.js","../src/effects/EffectComposer.js","../src/effects/EffectPass.js","../src/effects/RenderPass.js","../src/effects/BokehPass.js","../src/effects/FilmPass.js","../src/effects/HalftonePass.js","../src/effects/SAOPass.js","../src/effects/UnrealBloomPass.js","../src/glsl/snoise2.glsl.js","../src/components/noisy/NoisyImage.js","../src/components/noisy/NoisyPlane.js","../src/components/noisy/NoisySphere.js","../src/components/noisy/NoisyText.js","../src/components/sliders/AnimatedPlane.js","../src/components/sliders/Slider1.vue","../src/use/useTextures.js","../src/components/viewers/GLTFViewer.vue","../src/plugin.js"],"sourcesContent":["import {\r\n Plane,\r\n Raycaster,\r\n Vector2,\r\n Vector3,\r\n WebGLRenderer,\r\n} from 'three';\r\n\r\nimport { OrbitControls } from 'three/examples/jsm/controls/OrbitControls.js';\r\n\r\n/**\r\n * Three.js helper\r\n */\r\nexport default function useThree() {\r\n // default conf\r\n const conf = {\r\n canvas: null,\r\n antialias: true,\r\n alpha: false,\r\n autoClear: true,\r\n orbit_ctrl: false,\r\n mouse_move: false,\r\n mouse_raycast: false,\r\n resize: 'window',\r\n width: 0,\r\n height: 0,\r\n };\r\n\r\n // size\r\n const size = {\r\n width: 0, height: 0,\r\n wWidth: 0, wHeight: 0,\r\n ratio: 0,\r\n };\r\n\r\n // handlers\r\n let afterInitCallbacks = [];\r\n let afterResizeCallbacks = [];\r\n let beforeRenderCallbacks = [];\r\n\r\n // mouse tracking\r\n const mouse = new Vector2();\r\n const mouseV3 = new Vector3();\r\n const mousePlane = new Plane(new Vector3(0, 0, 1), 0);\r\n const raycaster = new Raycaster();\r\n\r\n // returned object\r\n const obj = {\r\n conf,\r\n renderer: null,\r\n camera: null,\r\n cameraCtrl: null,\r\n materials: {},\r\n scene: null,\r\n size,\r\n mouse, mouseV3,\r\n init,\r\n dispose,\r\n render,\r\n renderC,\r\n setSize,\r\n onAfterInit,\r\n onAfterResize, offAfterResize,\r\n onBeforeRender, offBeforeRender,\r\n };\r\n\r\n /**\r\n * init three\r\n */\r\n function init(params) {\r\n if (params) {\r\n Object.entries(params).forEach(([key, value]) => {\r\n conf[key] = value;\r\n });\r\n }\r\n\r\n if (!obj.scene) {\r\n console.error('Missing Scene');\r\n return;\r\n }\r\n\r\n if (!obj.camera) {\r\n console.error('Missing Camera');\r\n return;\r\n }\r\n\r\n obj.renderer = new WebGLRenderer({ canvas: conf.canvas, antialias: conf.antialias, alpha: conf.alpha });\r\n obj.renderer.autoClear = conf.autoClear;\r\n\r\n if (conf.orbit_ctrl) {\r\n obj.orbitCtrl = new OrbitControls(obj.camera, obj.renderer.domElement);\r\n if (conf.orbit_ctrl instanceof Object) {\r\n Object.entries(conf.orbit_ctrl).forEach(([key, value]) => {\r\n obj.orbitCtrl[key] = value;\r\n });\r\n }\r\n }\r\n\r\n if (conf.width && conf.height) {\r\n setSize(conf.width, conf.height);\r\n } else if (conf.resize) {\r\n onResize();\r\n window.addEventListener('resize', onResize);\r\n }\r\n\r\n if (conf.mouse_move) {\r\n if (conf.mouse_move === 'body') {\r\n obj.mouse_move_element = document.body;\r\n } else {\r\n obj.mouse_move_element = obj.renderer.domElement;\r\n }\r\n obj.mouse_move_element.addEventListener('mousemove', onMousemove);\r\n obj.mouse_move_element.addEventListener('mouseleave', onMouseleave);\r\n }\r\n\r\n afterInitCallbacks.forEach(c => c());\r\n\r\n return true;\r\n };\r\n\r\n /**\r\n * add after init callback\r\n */\r\n function onAfterInit(callback) {\r\n afterInitCallbacks.push(callback);\r\n }\r\n\r\n /**\r\n * add after resize callback\r\n */\r\n function onAfterResize(callback) {\r\n afterResizeCallbacks.push(callback);\r\n }\r\n\r\n /**\r\n * remove after resize callback\r\n */\r\n function offAfterResize(callback) {\r\n afterResizeCallbacks = afterResizeCallbacks.filter(c => c !== callback);\r\n }\r\n\r\n /**\r\n * add before render callback\r\n */\r\n function onBeforeRender(callback) {\r\n beforeRenderCallbacks.push(callback);\r\n }\r\n\r\n /**\r\n * remove before render callback\r\n */\r\n function offBeforeRender(callback) {\r\n beforeRenderCallbacks = beforeRenderCallbacks.filter(c => c !== callback);\r\n }\r\n\r\n /**\r\n * default render\r\n */\r\n function render() {\r\n if (obj.orbitCtrl) obj.orbitCtrl.update();\r\n beforeRenderCallbacks.forEach(c => c());\r\n obj.renderer.render(obj.scene, obj.camera);\r\n }\r\n\r\n /**\r\n * composer render\r\n */\r\n function renderC() {\r\n if (obj.orbitCtrl) obj.orbitCtrl.update();\r\n beforeRenderCallbacks.forEach(c => c());\r\n obj.composer.render();\r\n }\r\n\r\n /**\r\n * remove listeners\r\n */\r\n function dispose() {\r\n beforeRenderCallbacks = [];\r\n window.removeEventListener('resize', onResize);\r\n if (obj.mouse_move_element) {\r\n obj.mouse_move_element.removeEventListener('mousemove', onMousemove);\r\n obj.mouse_move_element.removeEventListener('mouseleave', onMouseleave);\r\n }\r\n if (obj.orbitCtrl) obj.orbitCtrl.dispose();\r\n this.renderer.dispose();\r\n }\r\n\r\n /**\r\n * mousemove listener\r\n */\r\n function onMousemove(e) {\r\n mouse.x = (e.clientX / size.width) * 2 - 1;\r\n mouse.y = -(e.clientY / size.height) * 2 + 1;\r\n updateMouseV3();\r\n }\r\n\r\n /**\r\n * mouseleave listener\r\n */\r\n function onMouseleave(e) {\r\n mouse.x = 0;\r\n mouse.y = 0;\r\n updateMouseV3();\r\n }\r\n\r\n /**\r\n * get 3d mouse position\r\n */\r\n function updateMouseV3() {\r\n if (conf.mouse_raycast) {\r\n obj.camera.getWorldDirection(mousePlane.normal);\r\n mousePlane.normal.normalize();\r\n raycaster.setFromCamera(mouse, obj.camera);\r\n raycaster.ray.intersectPlane(mousePlane, mouseV3);\r\n }\r\n }\r\n\r\n /**\r\n * resize listener\r\n */\r\n function onResize() {\r\n if (conf.resize === 'window') {\r\n setSize(window.innerWidth, window.innerHeight);\r\n } else {\r\n setSize(conf.resize.clientWidth, conf.resize.clientHeight);\r\n }\r\n afterResizeCallbacks.forEach(c => c());\r\n }\r\n\r\n /**\r\n * update renderer size and camera\r\n */\r\n function setSize(width, height) {\r\n size.width = width;\r\n size.height = height;\r\n size.ratio = width / height;\r\n\r\n obj.renderer.setSize(width, height, false);\r\n obj.camera.aspect = size.ratio;\r\n obj.camera.updateProjectionMatrix();\r\n\r\n if (obj.composer) {\r\n obj.composer.setSize(width, height);\r\n }\r\n\r\n const wsize = getCameraSize();\r\n size.wWidth = wsize[0]; size.wHeight = wsize[1];\r\n }\r\n\r\n /**\r\n * calculate camera visible area size\r\n */\r\n function getCameraSize() {\r\n const vFOV = (obj.camera.fov * Math.PI) / 180;\r\n const h = 2 * Math.tan(vFOV / 2) * Math.abs(obj.camera.position.z);\r\n const w = h * obj.camera.aspect;\r\n return [w, h];\r\n }\r\n\r\n return obj;\r\n}\r\n","import { h } from 'vue';\r\nimport useThree from './useThree';\r\n\r\nexport default {\r\n props: {\r\n antialias: {\r\n type: Boolean,\r\n default: true,\r\n },\r\n alpha: {\r\n type: Boolean,\r\n default: false,\r\n },\r\n autoClear: {\r\n type: Boolean,\r\n default: true,\r\n },\r\n shadow: {\r\n type: Boolean,\r\n default: false,\r\n },\r\n orbitCtrl: {\r\n type: [Boolean, Object],\r\n default: false,\r\n },\r\n mouseMove: {\r\n type: [Boolean, String],\r\n default: false,\r\n },\r\n mouseRaycast: {\r\n type: Boolean,\r\n default: false,\r\n },\r\n resize: {\r\n type: [Boolean, String, Element],\r\n default: 'window',\r\n },\r\n width: String,\r\n height: String,\r\n },\r\n setup() {\r\n return {\r\n three: useThree(),\r\n raf: true,\r\n onMountedCallbacks: [],\r\n };\r\n },\r\n provide() {\r\n return {\r\n three: this.three,\r\n // renderer: this.three.renderer,\r\n rendererComponent: this,\r\n };\r\n },\r\n mounted() {\r\n const params = {\r\n canvas: this.$refs.canvas,\r\n antialias: this.antialias,\r\n alpha: this.alpha,\r\n autoClear: this.autoClear,\r\n orbit_ctrl: this.orbitCtrl,\r\n mouse_move: this.mouseMove,\r\n mouse_raycast: this.mouseRaycast,\r\n resize: this.resize,\r\n width: this.width,\r\n height: this.height,\r\n };\r\n\r\n if (this.three.init(params)) {\r\n this.three.renderer.shadowMap.enabled = this.shadow;\r\n if (this.three.composer) this.animateC();\r\n else this.animate();\r\n };\r\n\r\n this.onMountedCallbacks.forEach(c => c());\r\n },\r\n beforeUnmount() {\r\n this.raf = false;\r\n this.three.dispose();\r\n },\r\n methods: {\r\n onMounted(callback) {\r\n this.onMountedCallbacks.push(callback);\r\n },\r\n onBeforeRender(callback) {\r\n this.three.onBeforeRender(callback);\r\n },\r\n onAfterResize(callback) {\r\n this.three.onAfterResize(callback);\r\n },\r\n animate() {\r\n if (this.raf) requestAnimationFrame(this.animate);\r\n this.three.render();\r\n },\r\n animateC() {\r\n if (this.raf) requestAnimationFrame(this.animateC);\r\n this.three.renderC();\r\n },\r\n },\r\n render() {\r\n return h(\r\n 'canvas',\r\n { ref: 'canvas' },\r\n this.$slots.default()\r\n );\r\n },\r\n};\r\n","export function setFromProp(o, prop) {\r\n if (prop instanceof Object) {\r\n Object.entries(prop).forEach(([key, value]) => {\r\n o[key] = value;\r\n });\r\n }\r\n};\r\n\r\nexport function propsValues(props, exclude) {\r\n const values = {};\r\n Object.entries(props).forEach(([key, value]) => {\r\n if (!exclude || (exclude && !exclude.includes(key))) {\r\n values[key] = value;\r\n }\r\n });\r\n return values;\r\n};\r\n\r\nexport function lerp(value1, value2, amount) {\r\n amount = amount < 0 ? 0 : amount;\r\n amount = amount > 1 ? 1 : amount;\r\n return value1 + (value2 - value1) * amount;\r\n};\r\n\r\nexport function lerpv3(v1, v2, amount) {\r\n v1.x = lerp(v1.x, v2.x, amount);\r\n v1.y = lerp(v1.y, v2.y, amount);\r\n v1.z = lerp(v1.z, v2.z, amount);\r\n};\r\n\r\nexport function limit(val, min, max) {\r\n return val < min ? min : (val > max ? max : val);\r\n};\r\n","import { toRef, watch } from 'vue';\r\nimport { setFromProp } from '../tools.js';\r\n\r\nexport default function useBindProp(comp, prop, object) {\r\n if (comp[prop]) {\r\n const ref = toRef(comp, prop);\r\n setFromProp(object, ref.value);\r\n watch(ref, () => {\r\n setFromProp(object, ref.value);\r\n }, { deep: true });\r\n }\r\n};\r\n","import { PerspectiveCamera, Vector3 } from 'three';\r\nimport { watch } from 'vue';\r\nimport useBindProp from '../use/useBindProp.js';\r\n\r\nexport default {\r\n inject: ['three'],\r\n props: {\r\n aspect: {\r\n type: Number,\r\n default: 1,\r\n },\r\n far: {\r\n type: Number,\r\n default: 2000,\r\n },\r\n fov: {\r\n type: Number,\r\n default: 50,\r\n },\r\n near: {\r\n type: Number,\r\n default: 0.1,\r\n },\r\n position: {\r\n type: [Object, Vector3],\r\n default: { x: 0, y: 0, z: 0 },\r\n },\r\n },\r\n created() {\r\n this.camera = new PerspectiveCamera(this.fov, this.aspect, this.near, this.far);\r\n useBindProp(this, 'position', this.camera.position);\r\n\r\n ['aspect', 'far', 'fov', 'near'].forEach(p => {\r\n watch(() => this[p], () => {\r\n this.camera[p] = this[p];\r\n this.camera.updateProjectionMatrix();\r\n });\r\n });\r\n\r\n this.three.camera = this.camera;\r\n },\r\n render() {\r\n return [];\r\n },\r\n __hmrId: 'PerspectiveCamera',\r\n};\r\n","import { Scene, Color } from 'three';\r\nimport { watch } from 'vue';\r\n\r\nexport default {\r\n inject: ['three'],\r\n props: {\r\n id: String,\r\n background: [String, Number],\r\n },\r\n setup(props) {\r\n const scene = new Scene();\r\n if (props.background) scene.background = new Color(props.background);\r\n watch(() => props.background, (value) => { scene.background = new Color(value); });\r\n return { scene };\r\n },\r\n provide() {\r\n return {\r\n scene: this.scene,\r\n };\r\n },\r\n mounted() {\r\n if (!this.three.scene) {\r\n this.three.scene = this.scene;\r\n }\r\n },\r\n methods: {\r\n // add(o) {\r\n // this.scene.add(o);\r\n // },\r\n // remove(o) {\r\n // this.scene.remove(o);\r\n // },\r\n },\r\n render() {\r\n if (this.$slots.default) {\r\n return this.$slots.default();\r\n }\r\n return [];\r\n },\r\n};\r\n","import { TextureLoader } from 'three';\r\nimport { watch } from 'vue';\r\n\r\nexport default {\r\n inject: ['three'],\r\n emits: ['loaded'],\r\n props: {\r\n src: String,\r\n onLoad: Function,\r\n onProgress: Function,\r\n onError: Function,\r\n },\r\n created() {\r\n this.createTexture();\r\n watch(() => this.src, this.refreshTexture);\r\n },\r\n unmounted() {\r\n this.texture.dispose();\r\n },\r\n methods: {\r\n createTexture() {\r\n this.texture = new TextureLoader().load(this.src, this.onLoaded, this.onProgress, this.onError);\r\n },\r\n refreshTexture() {\r\n this.createTexture();\r\n },\r\n onLoaded() {\r\n if (this.onLoad) this.onLoad();\r\n this.$emit('loaded');\r\n },\r\n },\r\n render() {\r\n return [];\r\n },\r\n};\r\n","import { CubeTextureLoader } from 'three';\r\nimport { watch } from 'vue';\r\n\r\nexport default {\r\n inject: ['three'],\r\n emits: ['loaded'],\r\n props: {\r\n path: String,\r\n urls: {\r\n type: Array,\r\n default: ['px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg'],\r\n },\r\n onLoad: Function,\r\n onProgress: Function,\r\n onError: Function,\r\n },\r\n created() {\r\n this.createTexture();\r\n watch(() => this.path, this.refreshTexture);\r\n watch(() => this.urls, this.refreshTexture);\r\n },\r\n unmounted() {\r\n this.texture.dispose();\r\n },\r\n methods: {\r\n createTexture() {\r\n this.texture = new CubeTextureLoader()\r\n .setPath(this.path)\r\n .load(this.urls, this.onLoaded, this.onProgress, this.onError);\r\n },\r\n refreshTexture() {\r\n this.createTexture();\r\n },\r\n onLoaded() {\r\n if (this.onLoad) this.onLoad();\r\n this.$emit('loaded');\r\n },\r\n },\r\n render() {\r\n return [];\r\n },\r\n};\r\n","import { watch } from 'vue';\r\n\r\nexport default {\r\n emits: ['ready'],\r\n inject: ['mesh'],\r\n props: {\r\n rotateX: Number,\r\n rotateY: Number,\r\n rotateZ: Number,\r\n },\r\n created() {\r\n if (!this.mesh) {\r\n console.error('Missing parent Mesh');\r\n }\r\n this.watchProps = [];\r\n Object.entries(this.$props).forEach(e => this.watchProps.push(e[0]));\r\n },\r\n beforeMount() {\r\n this.createGeometry();\r\n this.rotateGeometry();\r\n this.mesh.setGeometry(this.geometry);\r\n },\r\n mounted() {\r\n this.addWatchers();\r\n },\r\n unmounted() {\r\n this.geometry.dispose();\r\n },\r\n methods: {\r\n rotateGeometry() {\r\n if (this.rotateX) this.geometry.rotateX(this.rotateX);\r\n if (this.rotateY) this.geometry.rotateY(this.rotateY);\r\n if (this.rotateZ) this.geometry.rotateZ(this.rotateZ);\r\n },\r\n addWatchers() {\r\n this.watchProps.forEach(prop => {\r\n watch(() => this[prop], () => {\r\n this.refreshGeometry();\r\n });\r\n });\r\n },\r\n refreshGeometry() {\r\n const oldGeo = this.geometry;\r\n this.createGeometry();\r\n this.rotateGeometry();\r\n this.mesh.setGeometry(this.geometry);\r\n oldGeo.dispose();\r\n },\r\n },\r\n render() {\r\n return [];\r\n },\r\n};\r\n","import { BoxBufferGeometry } from 'three';\r\nimport Geometry from './Geometry.js';\r\n\r\nexport default {\r\n extends: Geometry,\r\n props: {\r\n size: Number,\r\n width: { type: Number, default: 1 },\r\n height: { type: Number, default: 1 },\r\n depth: { type: Number, default: 1 },\r\n widthSegments: { type: Number, default: 1 },\r\n heightSegments: { type: Number, default: 1 },\r\n depthSegments: { type: Number, default: 1 },\r\n },\r\n methods: {\r\n createGeometry() {\r\n let w = this.width, h = this.height, d = this.depth;\r\n if (this.size) {\r\n w = this.size; h = this.size; d = this.size;\r\n }\r\n this.geometry = new BoxBufferGeometry(w, h, d, this.widthSegments, this.heightSegments, this.depthSegments);\r\n },\r\n },\r\n};\r\n","import { CircleBufferGeometry } from 'three';\nimport Geometry from './Geometry.js';\n\nexport default {\n extends: Geometry,\n props: {\n radius: { type: Number, default: 1 },\n segments: { type: Number, default: 8 },\n thetaStart: { type: Number, default: 0 },\n thetaLength: { type: Number, default: Math.PI * 2 },\n },\n methods: {\n createGeometry() {\n this.geometry = new CircleBufferGeometry(this.radius, this.segments, this.thetaStart, this.thetaLength);\n },\n },\n};\n","import { ConeBufferGeometry } from 'three';\nimport Geometry from './Geometry.js';\n\nexport default {\n extends: Geometry,\n props: {\n radius: { type: Number, default: 1 },\n height: { type: Number, default: 1 },\n radialSegments: { type: Number, default: 8 },\n heightSegments: { type: Number, default: 1 },\n openEnded: { type: Boolean, default: false },\n thetaStart: { type: Number, default: 0 },\n thetaLength: { type: Number, default: Math.PI * 2 },\n },\n methods: {\n createGeometry() {\n this.geometry = new ConeBufferGeometry(this.radius, this.height, this.radialSegments, this.heightSegments, this.openEnded, this.thetaStart, this.thetaLength);\n },\n },\n};\n","import { CylinderBufferGeometry } from 'three';\nimport Geometry from './Geometry.js';\n\nexport default {\n extends: Geometry,\n props: {\n radiusTop: { type: Number, default: 1 },\n radiusBottom: { type: Number, default: 1 },\n height: { type: Number, default: 1 },\n radialSegments: { type: Number, default: 8 },\n heightSegments: { type: Number, default: 1 },\n openEnded: { type: Boolean, default: false },\n thetaStart: { type: Number, default: 0 },\n thetaLength: { type: Number, default: Math.PI * 2 },\n },\n methods: {\n createGeometry() {\n this.geometry = new CylinderBufferGeometry(this.radiusTop, this.radiusBottom, this.height, this.radialSegments, this.heightSegments, this.openEnded, this.thetaStart, this.thetaLength);\n },\n },\n};\n","import { DodecahedronBufferGeometry } from 'three';\nimport Geometry from './Geometry.js';\n\nexport default {\n extends: Geometry,\n props: {\n radius: { type: Number, default: 1 },\n detail: { type: Number, default: 0 },\n },\n methods: {\n createGeometry() {\n this.geometry = new DodecahedronBufferGeometry(this.radius, this.detail);\n },\n },\n};\n","import { IcosahedronBufferGeometry } from 'three';\nimport Geometry from './Geometry.js';\n\nexport default {\n extends: Geometry,\n props: {\n radius: { type: Number, default: 1 },\n detail: { type: Number, default: 0 },\n },\n methods: {\n createGeometry() {\n this.geometry = new IcosahedronBufferGeometry(this.radius, this.detail);\n },\n },\n};\n","import { LatheBufferGeometry } from 'three';\nimport Geometry from './Geometry.js';\n\nexport default {\n extends: Geometry,\n props: {\n points: Array,\n segments: { type: Number, default: 12 },\n phiStart: { type: Number, default: 0 },\n phiLength: { type: Number, default: Math.PI * 2 },\n },\n methods: {\n createGeometry() {\n this.geometry = new LatheBufferGeometry(this.points, this.segments, this.phiStart, this.phiLength);\n },\n },\n};\n","import { OctahedronBufferGeometry } from 'three';\nimport Geometry from './Geometry.js';\n\nexport default {\n extends: Geometry,\n props: {\n radius: { type: Number, default: 1 },\n detail: { type: Number, default: 0 },\n },\n methods: {\n createGeometry() {\n this.geometry = new OctahedronBufferGeometry(this.radius, this.detail);\n },\n },\n};\n","import { PolyhedronBufferGeometry } from 'three';\nimport Geometry from './Geometry.js';\n\nexport default {\n extends: Geometry,\n props: {\n vertices: Array,\n indices: Array,\n radius: { type: Number, default: 1 },\n detail: { type: Number, default: 0 },\n },\n methods: {\n createGeometry() {\n this.geometry = new PolyhedronBufferGeometry(this.vertices, this.indices, this.radius, this.detail);\n },\n },\n};\n","import { RingBufferGeometry } from 'three';\nimport Geometry from './Geometry.js';\n\nexport default {\n extends: Geometry,\n props: {\n innerRadius: { type: Number, default: 0.5 },\n outerRadius: { type: Number, default: 1 },\n thetaSegments: { type: Number, default: 8 },\n phiSegments: { type: Number, default: 1 },\n thetaStart: { type: Number, default: 0 },\n thetaLength: { type: Number, default: Math.PI * 2 },\n },\n methods: {\n createGeometry() {\n this.geometry = new RingBufferGeometry(this.innerRadius, this.outerRadius, this.thetaSegments, this.phiSegments, this.thetaStart, this.thetaLength);\n },\n },\n};\n","import { SphereBufferGeometry } from 'three';\r\nimport Geometry from './Geometry.js';\r\n\r\nexport default {\r\n extends: Geometry,\r\n props: {\r\n radius: { type: Number, default: 1 },\r\n widthSegments: { type: Number, default: 12 },\r\n heightSegments: { type: Number, default: 12 },\r\n },\r\n methods: {\r\n createGeometry() {\r\n this.geometry = new SphereBufferGeometry(this.radius, this.widthSegments, this.heightSegments);\r\n },\r\n },\r\n};\r\n","import { TetrahedronBufferGeometry } from 'three';\nimport Geometry from './Geometry.js';\n\nexport default {\n extends: Geometry,\n props: {\n radius: { type: Number, default: 1 },\n detail: { type: Number, default: 0 },\n },\n methods: {\n createGeometry() {\n this.geometry = new TetrahedronBufferGeometry(this.radius, this.detail);\n },\n },\n};\n","import { TorusBufferGeometry } from 'three';\nimport Geometry from './Geometry.js';\n\nexport default {\n extends: Geometry,\n props: {\n radius: { type: Number, default: 1 },\n tube: { type: Number, default: 0.4 },\n radialSegments: { type: Number, default: 8 },\n tubularSegments: { type: Number, default: 6 },\n arc: { type: Number, default: Math.PI * 2 },\n },\n methods: {\n createGeometry() {\n this.geometry = new TorusBufferGeometry(this.radius, this.tube, this.radialSegments, this.tubularSegments, this.arc);\n },\n },\n};\n","import { TorusKnotBufferGeometry } from 'three';\nimport Geometry from './Geometry.js';\n\nexport default {\n extends: Geometry,\n props: {\n radius: { type: Number, default: 1 },\n tube: { type: Number, default: 0.4 },\n radialSegments: { type: Number, default: 64 },\n tubularSegments: { type: Number, default: 8 },\n p: { type: Number, default: 2 },\n q: { type: Number, default: 3 },\n },\n methods: {\n createGeometry() {\n this.geometry = new TorusKnotBufferGeometry(this.radius, this.tube, this.radialSegments, this.tubularSegments, this.p, this.q);\n },\n },\n};\n","import { Curve, TubeBufferGeometry } from 'three';\nimport Geometry from './Geometry.js';\n\nexport default {\n extends: Geometry,\n props: {\n path: Curve,\n tubularSegments: { type: Number, default: 64 },\n radius: { type: Number, default: 1 },\n radiusSegments: { type: Number, default: 8 },\n closed: { type: Boolean, default: false },\n },\n methods: {\n createGeometry() {\n this.geometry = new TubeBufferGeometry(this.path, this.tubularSegments, this.radius, this.radiusSegments, this.closed);\n },\n },\n};\n","import { Color } from 'three';\r\nimport { watch } from 'vue';\r\nimport { setFromProp } from '../tools.js';\r\nimport useBindProp from '../use/useBindProp.js';\r\n\r\nexport default {\r\n inject: ['scene'],\r\n props: {\r\n color: {\r\n type: String,\r\n default: '#ffffff',\r\n },\r\n intensity: {\r\n type: Number,\r\n default: 1,\r\n },\r\n castShadow: {\r\n type: Boolean,\r\n default: false,\r\n },\r\n shadowMapSize: Object,\r\n position: Object,\r\n },\r\n mounted() {\r\n useBindProp(this, 'position', this.light.position);\r\n\r\n if (this.light.target) {\r\n useBindProp(this, 'target', this.light.target.position);\r\n }\r\n\r\n if (this.light.shadow) {\r\n this.light.castShadow = this.castShadow;\r\n setFromProp(this.light.shadow.mapSize, this.shadowMapSize);\r\n }\r\n\r\n ['color', 'intensity', 'castShadow'].forEach(p => {\r\n watch(() => this[p], () => {\r\n if (p === 'color') {\r\n this.light.color = new Color(this.color);\r\n } else {\r\n this.light[p] = this[p];\r\n }\r\n });\r\n });\r\n\r\n this.scene.add(this.light);\r\n if (this.light.target) this.scene.add(this.light.target);\r\n },\r\n unmounted() {\r\n this.scene.remove(this.light);\r\n },\r\n render() {\r\n return [];\r\n },\r\n __hmrId: 'Light',\r\n};\r\n","import { AmbientLight } from 'three';\r\nimport Light from './Light.js';\r\n\r\nexport default {\r\n extends: Light,\r\n created() {\r\n this.light = new AmbientLight(this.color, this.intensity);\r\n },\r\n __hmrId: 'AmbientLight',\r\n};\r\n","import { DirectionalLight } from 'three';\r\nimport Light from './Light.js';\r\n\r\nexport default {\r\n extends: Light,\r\n props: {\r\n target: Object,\r\n },\r\n created() {\r\n this.light = new DirectionalLight(this.color, this.intensity);\r\n },\r\n __hmrId: 'DirectionalLight',\r\n};\r\n","import { PointLight } from 'three';\r\nimport Light from './Light.js';\r\n\r\nexport default {\r\n extends: Light,\r\n props: {\r\n distance: {\r\n type: Number,\r\n default: 0,\r\n },\r\n decay: {\r\n type: Number,\r\n default: 1,\r\n },\r\n },\r\n created() {\r\n this.light = new PointLight(this.color, this.intensity, this.distance, this.decay);\r\n },\r\n __hmrId: 'PointLight',\r\n};\r\n","import { SpotLight } from 'three';\r\nimport { watch } from 'vue';\r\nimport Light from './Light.js';\r\n\r\nexport default {\r\n extends: Light,\r\n props: {\r\n angle: {\r\n type: Number,\r\n default: Math.PI / 3,\r\n },\r\n decay: {\r\n type: Number,\r\n default: 1,\r\n },\r\n distance: {\r\n type: Number,\r\n default: 0,\r\n },\r\n penumbra: {\r\n type: Number,\r\n default: 0,\r\n },\r\n target: Object,\r\n },\r\n created() {\r\n this.light = new SpotLight(this.color, this.intensity, this.distance, this.angle, this.penumbra, this.decay);\r\n ['angle', 'decay', 'distance', 'penumbra'].forEach(p => {\r\n watch(() => this[p], () => {\r\n this.light[p] = this[p];\r\n });\r\n });\r\n },\r\n __hmrId: 'SpotLight',\r\n};\r\n","import { watch } from 'vue';\r\nimport { Color, FrontSide } from 'three';\r\n\r\nexport default {\r\n inject: ['three', 'mesh'],\r\n props: {\r\n id: String,\r\n color: { type: [String, Number], default: '#ffffff' },\r\n depthTest: { type: Boolean, default: true },\r\n depthWrite: { type: Boolean, default: true },\r\n flatShading: Boolean,\r\n fog: { type: Boolean, default: true },\r\n opacity: { type: Number, default: 1 },\r\n side: { type: Number, default: FrontSide },\r\n transparent: Boolean,\r\n vertexColors: Boolean,\r\n },\r\n provide() {\r\n return {\r\n material: this,\r\n };\r\n },\r\n beforeMount() {\r\n this.createMaterial();\r\n if (this.id) this.three.materials[this.id] = this.material;\r\n this.mesh.setMaterial(this.material);\r\n },\r\n mounted() {\r\n this._addWatchers();\r\n if (this.addWatchers) this.addWatchers();\r\n },\r\n unmounted() {\r\n this.material.dispose();\r\n if (this.id) delete this.three.materials[this.id];\r\n },\r\n methods: {\r\n setMap(texture) {\r\n this.material.map = texture;\r\n this.material.needsUpdate = true;\r\n },\r\n setEnvMap(texture) {\r\n this.material.envMap = texture;\r\n this.material.needsUpdate = true;\r\n },\r\n _addWatchers() {\r\n // don't work for flatShading\r\n ['color', 'depthTest', 'depthWrite', 'fog', 'opacity', 'side', 'transparent'].forEach(p => {\r\n watch(() => this[p], () => {\r\n if (p === 'color') {\r\n this.material.color.set(this.color);\r\n } else {\r\n this.material[p] = this[p];\r\n }\r\n });\r\n });\r\n },\r\n },\r\n render() {\r\n if (this.$slots.default) {\r\n return this.$slots.default();\r\n }\r\n return [];\r\n },\r\n __hmrId: 'Material',\r\n};\r\n","import { MeshBasicMaterial } from 'three';\r\nimport { propsValues } from '../tools.js';\r\nimport Material from './Material';\r\n\r\nexport default {\r\n extends: Material,\r\n methods: {\r\n createMaterial() {\r\n this.material = new MeshBasicMaterial(propsValues(this.$props, ['id']));\r\n },\r\n },\r\n __hmrId: 'BasicMaterial',\r\n};\r\n","import { MeshLambertMaterial } from 'three';\r\nimport { propsValues } from '../tools.js';\r\nimport Material from './Material';\r\n\r\nexport default {\r\n extends: Material,\r\n methods: {\r\n createMaterial() {\r\n this.material = new MeshLambertMaterial(propsValues(this.$props, ['id']));\r\n },\r\n },\r\n __hmrId: 'LambertMaterial',\r\n};\r\n","import { MeshPhongMaterial } from 'three';\r\nimport { propsValues } from '../tools.js';\r\nimport Material from './Material';\r\n\r\nexport default {\r\n extends: Material,\r\n methods: {\r\n createMaterial() {\r\n this.material = new MeshPhongMaterial(propsValues(this.$props, ['id']));\r\n },\r\n },\r\n __hmrId: 'PhongMaterial',\r\n};\r\n","import { Color, MeshStandardMaterial } from 'three';\r\nimport { watch } from 'vue';\r\nimport { propsValues } from '../tools.js';\r\nimport Material from './Material';\r\n\r\nexport default {\r\n extends: Material,\r\n props: {\r\n emissive: { type: [Number, String], default: 0 },\r\n emissiveIntensity: { type: Number, default: 1 },\r\n metalness: { type: Number, default: 0 },\r\n roughness: { type: Number, default: 1 },\r\n },\r\n methods: {\r\n createMaterial() {\r\n this.material = new MeshStandardMaterial(propsValues(this.$props, ['id']));\r\n },\r\n addWatchers() {\r\n ['emissive', 'emissiveIntensity', 'metalness', 'roughness'].forEach(p => {\r\n watch(() => this[p], (value) => {\r\n if (p === 'emissive') {\r\n this.material.emissive = new Color(value);\r\n } else {\r\n this.material[p] = value;\r\n }\r\n });\r\n });\r\n },\r\n },\r\n __hmrId: 'StandardMaterial',\r\n};\r\n","import { MeshPhysicalMaterial } from 'three';\r\nimport { propsValues } from '../tools.js';\r\nimport StandardMaterial from './StandardMaterial';\r\n\r\nexport default {\r\n extends: StandardMaterial,\r\n methods: {\r\n createMaterial() {\r\n this.material = new MeshPhysicalMaterial(propsValues(this.$props, ['id']));\r\n },\r\n },\r\n __hmrId: 'PhysicalMaterial',\r\n};\r\n","/**\n * ------------------------------------------------------------------------------------------\n * Subsurface Scattering shader\n * Based on three/examples/jsm/shaders/SubsurfaceScatteringShader.js\n * Based on GDC 2011 – Approximating Translucency for a Fast, Cheap and Convincing Subsurface Scattering Look\n * https://colinbarrebrisebois.com/2011/03/07/gdc-2011-approximating-translucency-for-a-fast-cheap-and-convincing-subsurface-scattering-look/\n *------------------------------------------------------------------------------------------\n */\nimport {\n Color,\n ShaderChunk,\n ShaderLib,\n UniformsUtils,\n} from 'three';\n\nfunction replaceAll(string, find, replace) {\n return string.split(find).join(replace);\n}\n\nconst meshphongFragHead = ShaderChunk.meshphong_frag.slice(0, ShaderChunk.meshphong_frag.indexOf('void main() {'));\nconst meshphongFragBody = ShaderChunk.meshphong_frag.slice(ShaderChunk.meshphong_frag.indexOf('void main() {'));\n\nconst SubsurfaceScatteringShader = {\n\n uniforms: UniformsUtils.merge([\n ShaderLib.phong.uniforms,\n {\n thicknessColor: { value: new Color(0x668597) },\n thicknessDistortion: { value: 0.1 },\n thicknessAmbient: { value: 0.0 },\n thicknessAttenuation: { value: 0.1 },\n thicknessPower: { value: 2.0 },\n thicknessScale: { value: 10.0 },\n },\n ]),\n\n vertexShader: `\n #define USE_UV\n ${ShaderChunk.meshphong_vert}\n `,\n\n fragmentShader: `\n #define USE_UV\n #define SUBSURFACE\n\n ${meshphongFragHead}\n\n uniform float thicknessPower;\n uniform float thicknessScale;\n uniform float thicknessDistortion;\n uniform float thicknessAmbient;\n uniform float thicknessAttenuation;\n uniform vec3 thicknessColor;\n\n void RE_Direct_Scattering(const in IncidentLight directLight, const in vec2 uv, const in GeometricContext geometry, inout ReflectedLight reflectedLight) {\n #ifdef USE_COLOR\n vec3 thickness = vColor * thicknessColor;\n #else\n vec3 thickness = thicknessColor;\n #endif\n vec3 scatteringHalf = normalize(directLight.direction + (geometry.normal * thicknessDistortion));\n float scatteringDot = pow(saturate(dot(geometry.viewDir, -scatteringHalf)), thicknessPower) * thicknessScale;\n vec3 scatteringIllu = (scatteringDot + thicknessAmbient) * thickness;\n reflectedLight.directDiffuse += scatteringIllu * thicknessAttenuation * directLight.color;\n }\n ` + meshphongFragBody.replace(\n '#include ',\n replaceAll(\n ShaderChunk.lights_fragment_begin,\n 'RE_Direct( directLight, geometry, material, reflectedLight );',\n `\n RE_Direct( directLight, geometry, material, reflectedLight );\n #if defined( SUBSURFACE ) && defined( USE_UV )\n RE_Direct_Scattering(directLight, vUv, geometry, reflectedLight);\n #endif\n `\n )\n ),\n};\n\nexport default SubsurfaceScatteringShader;\n","import { Color, ShaderMaterial as TShaderMaterial, UniformsUtils } from 'three';\r\nimport SubsurfaceScatteringShader from './SubsurfaceScatteringShader.js';\r\nimport ShaderMaterial from './ShaderMaterial';\r\n\r\nexport default {\r\n extends: ShaderMaterial,\r\n props: {\r\n diffuse: { type: String, default: '#ffffff' },\r\n thicknessColor: { type: String, default: '#ffffff' },\r\n thicknessDistortion: { type: Number, default: 0.4 },\r\n thicknessAmbient: { type: Number, default: 0.01 },\r\n thicknessAttenuation: { type: Number, default: 0.7 },\r\n thicknessPower: { type: Number, default: 2 },\r\n thicknessScale: { type: Number, default: 4 },\r\n transparent: { type: Boolean, default: false },\r\n opacity: { type: Number, default: 1 },\r\n vertexColors: { type: Boolean, default: false },\r\n },\r\n methods: {\r\n createMaterial() {\r\n const params = SubsurfaceScatteringShader;\r\n const uniforms = UniformsUtils.clone(params.uniforms);\r\n Object.entries(this.$props).forEach(([key, value]) => {\r\n if (key === 'diffuse' || key === 'thicknessColor') {\r\n value = new Color(value);\r\n }\r\n if (key !== 'id' && key !== 'transparent' && key !== 'vertexColors') {\r\n uniforms[key].value = value;\r\n }\r\n });\r\n\r\n this.material = new TShaderMaterial({\r\n ...params,\r\n uniforms,\r\n lights: true,\r\n transparent: this.transparent,\r\n vertexColors: this.vertexColors,\r\n });\r\n },\r\n },\r\n __hmrId: 'SubSurfaceMaterial',\r\n};\r\n","export default {\r\n inject: ['three', 'mesh'],\r\n props: {\r\n id: String,\r\n uniforms: Object,\r\n vertexShader: String,\r\n fragmentShader: String,\r\n },\r\n beforeMount() {\r\n this.createMaterial();\r\n if (this.id) this.three.materials[this.id] = this.material;\r\n this.mesh.setMaterial(this.material);\r\n },\r\n mounted() {\r\n if (this.addWatchers) this.addWatchers();\r\n },\r\n unmounted() {\r\n this.material.dispose();\r\n if (this.id) delete this.three.materials[this.id];\r\n },\r\n render() {\r\n return [];\r\n },\r\n __hmrId: 'ShaderMaterial',\r\n};\r\n","import { MeshToonMaterial } from 'three';\r\nimport { propsValues } from '../tools.js';\r\nimport Material from './Material';\r\n\r\nexport default {\r\n extends: Material,\r\n methods: {\r\n createMaterial() {\r\n this.material = new MeshToonMaterial(propsValues(this.$props, ['id']));\r\n },\r\n },\r\n __hmrId: 'ToonMaterial',\r\n};\r\n","import Texture from '../core/Texture';\r\n\r\nexport default {\r\n extends: Texture,\r\n inject: ['material'],\r\n created() {\r\n this.material.setMap(this.texture);\r\n },\r\n unmounted() {\r\n this.material.setMap(null);\r\n },\r\n methods: {\r\n refreshTexture() {\r\n this.createTexture();\r\n this.material.setMap(this.texture);\r\n },\r\n },\r\n __hmrId: 'Map',\r\n};\r\n","import CubeTexture from '../core/CubeTexture';\r\n\r\nexport default {\r\n extends: CubeTexture,\r\n inject: ['material'],\r\n created() {\r\n this.material.setEnvMap(this.texture);\r\n },\r\n unmounted() {\r\n this.material.setEnvMap(null);\r\n },\r\n methods: {\r\n refreshTexture() {\r\n this.createTexture();\r\n this.material.setEnvMap(this.texture);\r\n },\r\n },\r\n __hmrId: 'EnvMap',\r\n};\r\n","import { Mesh } from 'three';\nimport { watch } from 'vue';\nimport useBindProp from '../use/useBindProp.js';\n\nexport default {\n inject: ['three', 'scene', 'rendererComponent'],\n emits: ['ready'],\n props: {\n materialId: String,\n position: Object,\n rotation: Object,\n scale: Object,\n castShadow: Boolean,\n receiveShadow: Boolean,\n },\n provide() {\n return {\n mesh: this,\n };\n },\n mounted() {\n // console.log('Mesh mounted');\n if (this.geometry && !this.mesh) this.initMesh();\n },\n unmounted() {\n // console.log('Mesh unmounted');\n if (this.mesh) this.scene.remove(this.mesh);\n if (this.geometry) this.geometry.dispose();\n if (this.material && !this.materialId) this.material.dispose();\n },\n methods: {\n initMesh() {\n if (!this.material && this.materialId) {\n this.material = this.three.materials[this.materialId];\n }\n this.mesh = new Mesh(this.geometry, this.material);\n this.bindProps();\n this.scene.add(this.mesh);\n this.$emit('ready');\n },\n bindProps() {\n useBindProp(this, 'position', this.mesh.position);\n useBindProp(this, 'rotation', this.mesh.rotation);\n useBindProp(this, 'scale', this.mesh.scale);\n\n ['castShadow', 'receiveShadow'].forEach(p => {\n this.mesh[p] = this[p];\n watch(() => this[p], () => { this.mesh[p] = this[p]; });\n });\n\n watch(() => this.materialId, () => {\n this.mesh.material = this.three.materials[this.materialId];\n });\n },\n setGeometry(geometry) {\n this.geometry = geometry;\n if (this.mesh) this.mesh.geometry = geometry;\n },\n setMaterial(material) {\n this.material = material;\n if (this.mesh) this.mesh.material = material;\n },\n refreshGeometry() {\n const oldGeo = this.geometry;\n this.createGeometry();\n this.mesh.geometry = this.geometry;\n oldGeo.dispose();\n },\n },\n render() {\n if (this.$slots.default) {\n return this.$slots.default();\n }\n return [];\n },\n __hmrId: 'Mesh',\n};\n","import { BoxBufferGeometry } from 'three';\r\nimport { watch } from 'vue';\r\nimport Mesh from './Mesh.js';\r\n\r\nexport default {\r\n extends: Mesh,\r\n props: {\r\n size: Number,\r\n width: { type: Number, default: 1 },\r\n height: { type: Number, default: 1 },\r\n depth: { type: Number, default: 1 },\r\n widthSegments: { type: Number, default: 1 },\r\n heightSegments: { type: Number, default: 1 },\r\n depthSegments: { type: Number, default: 1 },\r\n },\r\n created() {\r\n this.createGeometry();\r\n\r\n ['size', 'width', 'height', 'depth', 'widthSegments', 'heightSegments', 'depthSegments'].forEach(prop => {\r\n watch(() => this[prop], () => {\r\n this.refreshGeometry();\r\n });\r\n });\r\n },\r\n methods: {\r\n createGeometry() {\r\n if (this.size) {\r\n this.geometry = new BoxBufferGeometry(this.size, this.size, this.size);\r\n } else {\r\n this.geometry = new BoxBufferGeometry(this.width, this.height, this.depth);\r\n }\r\n },\r\n },\r\n __hmrId: 'Box',\r\n};\r\n","import { CircleBufferGeometry } from 'three';\nimport { watch } from 'vue';\nimport Mesh from './Mesh.js';\n\nexport default {\n extends: Mesh,\n props: {\n radius: { type: Number, default: 1 },\n segments: { type: Number, default: 8 },\n thetaStart: { type: Number, default: 0 },\n thetaLength: { type: Number, default: Math.PI * 2 },\n },\n created() {\n this.createGeometry();\n\n const watchProps = ['radius', 'segments', 'thetaStart', 'thetaLength'];\n watchProps.forEach(prop => {\n watch(() => this[prop], () => {\n this.refreshGeometry();\n });\n });\n },\n methods: {\n createGeometry() {\n this.geometry = new CircleBufferGeometry(this.radius, this.segments, this.thetaStart, this.thetaLength);\n },\n },\n __hmrId: 'Circle',\n};\n","import { ConeBufferGeometry } from 'three';\nimport { watch } from 'vue';\nimport Mesh from './Mesh.js';\n\nexport default {\n extends: Mesh,\n props: {\n radius: { type: Number, default: 1 },\n height: { type: Number, default: 1 },\n radialSegments: { type: Number, default: 8 },\n heightSegments: { type: Number, default: 1 },\n openEnded: { type: Boolean, default: false },\n thetaStart: { type: Number, default: 0 },\n thetaLength: { type: Number, default: Math.PI * 2 },\n },\n created() {\n this.createGeometry();\n\n const watchProps = ['radius', 'height', 'radialSegments', 'heightSegments', 'openEnded', 'thetaStart', 'thetaLength'];\n watchProps.forEach(prop => {\n watch(() => this[prop], () => {\n this.refreshGeometry();\n });\n });\n },\n methods: {\n createGeometry() {\n this.geometry = new ConeBufferGeometry(this.radius, this.height, this.radialSegments, this.heightSegments, this.openEnded, this.thetaStart, this.thetaLength);\n },\n },\n __hmrId: 'Cone',\n};\n","import { CylinderBufferGeometry } from 'three';\nimport { watch } from 'vue';\nimport Mesh from './Mesh.js';\n\nexport default {\n extends: Mesh,\n props: {\n radiusTop: { type: Number, default: 1 },\n radiusBottom: { type: Number, default: 1 },\n height: { type: Number, default: 1 },\n radialSegments: { type: Number, default: 8 },\n heightSegments: { type: Number, default: 1 },\n openEnded: { type: Boolean, default: false },\n thetaStart: { type: Number, default: 0 },\n thetaLength: { type: Number, default: Math.PI * 2 },\n },\n created() {\n this.createGeometry();\n\n const watchProps = ['radiusTop', 'radiusBottom', 'height', 'radialSegments', 'heightSegments', 'openEnded', 'thetaStart', 'thetaLength'];\n watchProps.forEach(prop => {\n watch(() => this[prop], () => {\n this.refreshGeometry();\n });\n });\n },\n methods: {\n createGeometry() {\n this.geometry = new CylinderBufferGeometry(this.radiusTop, this.radiusBottom, this.height, this.radialSegments, this.heightSegments, this.openEnded, this.thetaStart, this.thetaLength);\n },\n },\n __hmrId: 'Cylinder',\n};\n","import { DodecahedronBufferGeometry } from 'three';\nimport { watch } from 'vue';\nimport Mesh from './Mesh.js';\n\nexport default {\n extends: Mesh,\n props: {\n radius: { type: Number, default: 1 },\n detail: { type: Number, default: 0 },\n },\n created() {\n this.createGeometry();\n\n const watchProps = ['radius', 'detail'];\n watchProps.forEach(prop => {\n watch(() => this[prop], () => {\n this.refreshGeometry();\n });\n });\n },\n methods: {\n createGeometry() {\n this.geometry = new DodecahedronBufferGeometry(this.radius, this.detail);\n },\n },\n __hmrId: 'Dodecahedron',\n};\n","import { IcosahedronBufferGeometry } from 'three';\nimport { watch } from 'vue';\nimport Mesh from './Mesh.js';\n\nexport default {\n extends: Mesh,\n props: {\n radius: { type: Number, default: 1 },\n detail: { type: Number, default: 0 },\n },\n created() {\n this.createGeometry();\n\n const watchProps = ['radius', 'detail'];\n watchProps.forEach(prop => {\n watch(() => this[prop], () => {\n this.refreshGeometry();\n });\n });\n },\n methods: {\n createGeometry() {\n this.geometry = new IcosahedronBufferGeometry(this.radius, this.detail);\n },\n },\n __hmrId: 'Icosahedron',\n};\n","import { LatheBufferGeometry } from 'three';\nimport { watch } from 'vue';\nimport Mesh from './Mesh.js';\n\nexport default {\n extends: Mesh,\n props: {\n points: Array,\n segments: { type: Number, default: 12 },\n phiStart: { type: Number, default: 0 },\n phiLength: { type: Number, default: Math.PI * 2 },\n },\n created() {\n this.createGeometry();\n\n const watchProps = ['points', 'segments', 'phiStart', 'phiLength'];\n watchProps.forEach(prop => {\n watch(() => this[prop], () => {\n this.refreshGeometry();\n });\n });\n },\n methods: {\n createGeometry() {\n this.geometry = new LatheBufferGeometry(this.points, this.segments, this.phiStart, this.phiLength);\n },\n },\n __hmrId: 'Lathe',\n};\n","import { OctahedronBufferGeometry } from 'three';\nimport { watch } from 'vue';\nimport Mesh from './Mesh.js';\n\nexport default {\n extends: Mesh,\n props: {\n radius: { type: Number, default: 1 },\n detail: { type: Number, default: 0 },\n },\n created() {\n this.createGeometry();\n\n const watchProps = ['radius', 'detail'];\n watchProps.forEach(prop => {\n watch(() => this[prop], () => {\n this.refreshGeometry();\n });\n });\n },\n methods: {\n createGeometry() {\n this.geometry = new OctahedronBufferGeometry(this.radius, this.detail);\n },\n },\n __hmrId: 'Octahedron',\n};\n","import { PlaneBufferGeometry } from 'three';\r\nimport { watch } from 'vue';\r\nimport Mesh from './Mesh.js';\r\n\r\nexport default {\r\n extends: Mesh,\r\n props: {\r\n width: { type: Number, default: 1 },\r\n height: { type: Number, default: 1 },\r\n widthSegments: { type: Number, default: 1 },\r\n heightSegments: { type: Number, default: 1 },\r\n },\r\n created() {\r\n this.createGeometry();\r\n\r\n const watchProps = ['width', 'height', 'widthSegments', 'heightSegments'];\r\n watchProps.forEach(prop => {\r\n watch(() => this[prop], () => {\r\n this.refreshGeometry();\r\n });\r\n });\r\n },\r\n methods: {\r\n createGeometry() {\r\n this.geometry = new PlaneBufferGeometry(this.width, this.height, this.widthSegments, this.heightSegments);\r\n },\r\n },\r\n __hmrId: 'Plane',\r\n};\r\n","import { PolyhedronBufferGeometry } from 'three';\nimport { watch } from 'vue';\nimport Mesh from './Mesh.js';\n\nexport default {\n extends: Mesh,\n props: {\n vertices: Array,\n indices: Array,\n radius: { type: Number, default: 1 },\n detail: { type: Number, default: 0 },\n },\n created() {\n this.createGeometry();\n\n const watchProps = ['vertices', 'indices', 'radius', 'detail'];\n watchProps.forEach(prop => {\n watch(() => this[prop], () => {\n this.refreshGeometry();\n });\n });\n },\n methods: {\n createGeometry() {\n this.geometry = new PolyhedronBufferGeometry(this.vertices, this.indices, this.radius, this.detail);\n },\n },\n __hmrId: 'Polyhedron',\n};\n","import { RingBufferGeometry } from 'three';\nimport { watch } from 'vue';\nimport Mesh from './Mesh.js';\n\nexport default {\n extends: Mesh,\n props: {\n innerRadius: { type: Number, default: 0.5 },\n outerRadius: { type: Number, default: 1 },\n thetaSegments: { type: Number, default: 8 },\n phiSegments: { type: Number, default: 1 },\n thetaStart: { type: Number, default: 0 },\n thetaLength: { type: Number, default: Math.PI * 2 },\n },\n created() {\n this.createGeometry();\n\n const watchProps = ['innerRadius', 'outerRadius', 'thetaSegments', 'phiSegments', 'thetaStart', 'thetaLength'];\n watchProps.forEach(prop => {\n watch(() => this[prop], () => {\n this.refreshGeometry();\n });\n });\n },\n methods: {\n createGeometry() {\n this.geometry = new RingBufferGeometry(this.innerRadius, this.outerRadius, this.thetaSegments, this.phiSegments, this.thetaStart, this.thetaLength);\n },\n },\n __hmrId: 'Ring',\n};\n","import { SphereBufferGeometry } from 'three';\r\nimport Mesh from './Mesh.js';\r\n\r\nexport default {\r\n extends: Mesh,\r\n props: {\r\n radius: Number,\r\n widthSegments: { type: Number, default: 12 },\r\n heightSegments: { type: Number, default: 12 },\r\n },\r\n watch: {\r\n radius() { this.refreshGeometry(); },\r\n widthSegments() { this.refreshGeometry(); },\r\n heightSegments() { this.refreshGeometry(); },\r\n },\r\n created() {\r\n this.createGeometry();\r\n },\r\n methods: {\r\n createGeometry() {\r\n this.geometry = new SphereBufferGeometry(this.radius, this.widthSegments, this.heightSegments);\r\n },\r\n },\r\n __hmrId: 'Sphere',\r\n};\r\n","import { TetrahedronBufferGeometry } from 'three';\nimport { watch } from 'vue';\nimport Mesh from './Mesh.js';\n\nexport default {\n extends: Mesh,\n props: {\n radius: { type: Number, default: 1 },\n detail: { type: Number, default: 0 },\n },\n created() {\n this.createGeometry();\n\n const watchProps = ['radius', 'detail'];\n watchProps.forEach(prop => {\n watch(() => this[prop], () => {\n this.refreshGeometry();\n });\n });\n },\n methods: {\n createGeometry() {\n this.geometry = new TetrahedronBufferGeometry(this.radius, this.detail);\n },\n },\n __hmrId: 'Tetrahedron',\n};\n","export default {\n text: String,\n fontSrc: String,\n size: { type: Number, default: 80 },\n height: { type: Number, default: 5 },\n depth: { type: Number, default: 1 },\n curveSegments: { type: Number, default: 12 },\n bevelEnabled: { type: Boolean, default: false },\n bevelThickness: { type: Number, default: 10 },\n bevelSize: { type: Number, default: 8 },\n bevelOffset: { type: Number, default: 0 },\n bevelSegments: { type: Number, default: 5 },\n align: { type: [Boolean, String], default: false },\n};\n","import { FontLoader, TextBufferGeometry } from 'three';\nimport { watch } from 'vue';\nimport Mesh from './Mesh.js';\nimport TextProps from './TextProps.js';\n\nexport default {\n extends: Mesh,\n props: {\n ...TextProps,\n },\n created() {\n // add watchers\n const watchProps = [\n 'text', 'size', 'height', 'curveSegments',\n 'bevelEnabled', 'bevelThickness', 'bevelSize', 'bevelOffset', 'bevelSegments',\n 'align',\n ];\n watchProps.forEach(p => {\n watch(() => this[p], () => {\n if (this.font) this.refreshGeometry();\n });\n });\n\n const loader = new FontLoader();\n loader.load(this.fontSrc, (font) => {\n this.font = font;\n this.createGeometry();\n this.initMesh();\n });\n },\n methods: {\n createGeometry() {\n this.geometry = new TextBufferGeometry(this.text, {\n font: this.font,\n size: this.size,\n height: this.height,\n depth: this.depth,\n curveSegments: this.curveSegments,\n bevelEnabled: this.bevelEnabled,\n bevelThickness: this.bevelThickness,\n bevelSize: this.bevelSize,\n bevelOffset: this.bevelOffset,\n bevelSegments: this.bevelSegments,\n });\n\n if (this.align === 'center') {\n this.geometry.center();\n }\n },\n },\n};\n","import { TorusBufferGeometry } from 'three';\nimport { watch } from 'vue';\nimport Mesh from './Mesh.js';\n\nexport default {\n extends: Mesh,\n props: {\n radius: { type: Number, default: 0.5 },\n tube: { type: Number, default: 0.4 },\n radialSegments: { type: Number, default: 8 },\n tubularSegments: { type: Number, default: 6 },\n arc: { type: Number, default: Math.PI * 2 },\n },\n created() {\n this.createGeometry();\n\n const watchProps = ['radius', 'tube', 'radialSegments', 'tubularSegments', 'arc'];\n watchProps.forEach(prop => {\n watch(() => this[prop], () => {\n this.refreshGeometry();\n });\n });\n },\n methods: {\n createGeometry() {\n this.geometry = new TorusBufferGeometry(this.radius, this.tube, this.radialSegments, this.tubularSegments, this.arc);\n },\n },\n __hmrId: 'Torus',\n};\n","import { TorusKnotBufferGeometry } from 'three';\nimport { watch } from 'vue';\nimport Mesh from './Mesh.js';\n\nexport default {\n extends: Mesh,\n props: {\n radius: { type: Number, default: 0.5 },\n tube: { type: Number, default: 0.4 },\n radialSegments: { type: Number, default: 64 },\n tubularSegments: { type: Number, default: 8 },\n p: { type: Number, default: 2 },\n q: { type: Number, default: 3 },\n },\n created() {\n this.createGeometry();\n\n const watchProps = ['radius', 'tube', 'radialSegments', 'tubularSegments', 'p', 'q'];\n watchProps.forEach(prop => {\n watch(() => this[prop], () => {\n this.refreshGeometry();\n });\n });\n },\n methods: {\n createGeometry() {\n this.geometry = new TorusKnotBufferGeometry(this.radius, this.tube, this.radialSegments, this.tubularSegments, this.p, this.q);\n },\n },\n __hmrId: 'TorusKnot',\n};\n","import { Curve, TubeBufferGeometry } from 'three';\nimport { watch } from 'vue';\nimport Mesh from './Mesh.js';\n\nexport default {\n extends: Mesh,\n props: {\n path: Curve,\n tubularSegments: { type: Number, default: 64 },\n radius: { type: Number, default: 1 },\n radialSegments: { type: Number, default: 8 },\n closed: { type: Boolean, default: false },\n },\n created() {\n this.createGeometry();\n\n const watchProps = ['path', 'tubularSegments', 'radius', 'radialSegments', 'closed'];\n watchProps.forEach(prop => {\n watch(() => this[prop], () => {\n this.refreshGeometry();\n });\n });\n },\n methods: {\n createGeometry() {\n this.geometry = new TubeBufferGeometry(this.path, this.tubularSegments, this.radius, this.radialSegments, this.closed);\n },\n },\n __hmrId: 'Tube',\n};\n","import {\r\n BackSide,\r\n CubeCamera,\r\n FrontSide,\r\n LinearMipmapLinearFilter,\r\n Mesh as TMesh,\r\n RGBFormat,\r\n WebGLCubeRenderTarget,\r\n} from 'three';\r\n// import { watch } from 'vue';\r\nimport Mesh from '../meshes/Mesh.js';\r\nimport useBindProp from '../use/useBindProp.js';\r\n\r\nexport default {\r\n extends: Mesh,\r\n props: {\r\n cubeRTSize: { type: Number, default: 512 },\r\n cubeCameraNear: { type: Number, default: 0.1 },\r\n cubeCameraFar: { type: Number, default: 2000 },\r\n autoUpdate: Boolean,\r\n },\r\n mounted() {\r\n this.initGem();\r\n if (this.autoUpdate) this.three.onBeforeRender(this.updateCubeRT);\r\n else this.rendererComponent.onMounted(this.updateCubeRT);\r\n },\r\n unmounted() {\r\n this.three.offBeforeRender(this.updateCubeRT);\r\n if (this.meshBack) this.scene.remove(this.meshBack);\r\n if (this.materialBack) this.materialBack.dispose();\r\n },\r\n methods: {\r\n initGem() {\r\n const cubeRT = new WebGLCubeRenderTarget(this.cubeRTSize, { format: RGBFormat, generateMipmaps: true, minFilter: LinearMipmapLinearFilter });\r\n this.cubeCamera = new CubeCamera(this.cubeCameraNear, this.cubeCameraFar, cubeRT);\r\n useBindProp(this, 'position', this.cubeCamera.position);\r\n this.scene.add(this.cubeCamera);\r\n\r\n this.material.side = FrontSide;\r\n this.material.envMap = cubeRT.texture;\r\n this.material.envMapIntensity = 10;\r\n this.material.metalness = 0;\r\n this.material.roughness = 0;\r\n this.material.opacity = 0.75;\r\n this.material.transparent = true;\r\n this.material.premultipliedAlpha = true;\r\n this.material.needsUpdate = true;\r\n\r\n this.materialBack = this.material.clone();\r\n this.materialBack.side = BackSide;\r\n this.materialBack.envMapIntensity = 5;\r\n this.materialBack.metalness = 1;\r\n this.materialBack.roughness = 0;\r\n this.materialBack.opacity = 0.5;\r\n\r\n this.meshBack = new TMesh(this.geometry, this.materialBack);\r\n\r\n useBindProp(this, 'position', this.meshBack.position);\r\n useBindProp(this, 'rotation', this.meshBack.rotation);\r\n useBindProp(this, 'scale', this.meshBack.scale);\r\n this.scene.add(this.meshBack);\r\n },\r\n updateCubeRT() {\r\n this.mesh.visible = false;\r\n this.meshBack.visible = false;\r\n this.cubeCamera.update(this.three.renderer, this.scene);\r\n this.mesh.visible = true;\r\n this.meshBack.visible = true;\r\n },\r\n },\r\n __hmrId: 'Gem',\r\n};\r\n","import { DoubleSide, MeshBasicMaterial, PlaneBufferGeometry, TextureLoader } from 'three';\r\nimport { watch } from 'vue';\r\nimport Mesh from './Mesh.js';\r\n\r\nexport default {\r\n emits: ['loaded'],\r\n extends: Mesh,\r\n props: {\r\n src: String,\r\n width: Number,\r\n height: Number,\r\n keepSize: Boolean,\r\n },\r\n created() {\r\n this.createGeometry();\r\n this.createMaterial();\r\n this.initMesh();\r\n\r\n watch(() => this.src, this.refreshTexture);\r\n\r\n ['width', 'height'].forEach(p => {\r\n watch(() => this[p], this.resize);\r\n });\r\n\r\n if (this.keepSize) this.three.onAfterResize(this.resize);\r\n },\r\n methods: {\r\n createGeometry() {\r\n this.geometry = new PlaneBufferGeometry(1, 1, 1, 1);\r\n },\r\n createMaterial() {\r\n this.material = new MeshBasicMaterial({ side: DoubleSide, map: this.loadTexture() });\r\n },\r\n loadTexture() {\r\n return new TextureLoader().load(this.src, this.onLoaded);\r\n },\r\n refreshTexture() {\r\n if (this.texture) this.texture.dispose();\r\n this.material.map = this.loadTexture();\r\n this.material.needsUpdate = true;\r\n },\r\n onLoaded(texture) {\r\n this.texture = texture;\r\n this.resize();\r\n this.$emit('loaded');\r\n },\r\n resize() {\r\n if (!this.texture) return;\r\n const screen = this.three.size;\r\n const iW = this.texture.image.width;\r\n const iH = this.texture.image.height;\r\n const iRatio = iW / iH;\r\n let w, h;\r\n if (this.width && this.height) {\r\n w = this.width * screen.wWidth / screen.width;\r\n h = this.height * screen.wHeight / screen.height;\r\n } else if (this.width) {\r\n w = this.width * screen.wWidth / screen.width;\r\n h = w / iRatio;\r\n } else if (this.height) {\r\n h = this.height * screen.wHeight / screen.height;\r\n w = h * iRatio;\r\n }\r\n this.mesh.scale.x = w;\r\n this.mesh.scale.y = h;\r\n },\r\n },\r\n __hmrId: 'Image',\r\n};\r\n","import { InstancedMesh } from 'three';\r\nimport { watch } from 'vue';\r\nimport useBindProp from '../use/useBindProp.js';\r\n\r\nexport default {\r\n inject: ['three', 'scene'],\r\n props: {\r\n materialId: String,\r\n count: Number,\r\n position: Object,\r\n castShadow: Boolean,\r\n receiveShadow: Boolean,\r\n },\r\n provide() {\r\n return {\r\n mesh: this,\r\n };\r\n },\r\n beforeMount() {\r\n if (!this.$slots.default) {\r\n console.error('Missing Geometry');\r\n }\r\n },\r\n mounted() {\r\n this.initMesh();\r\n },\r\n unmounted() {\r\n this.scene.remove(this.mesh);\r\n },\r\n methods: {\r\n initMesh() {\r\n if (!this.material && this.materialId) {\r\n this.material = this.three.materials[this.materialId];\r\n }\r\n\r\n this.mesh = new InstancedMesh(this.geometry, this.material, this.count);\r\n\r\n useBindProp(this, 'position', this.mesh.position);\r\n useBindProp(this, 'rotation', this.mesh.rotation);\r\n useBindProp(this, 'scale', this.mesh.scale);\r\n\r\n ['castShadow', 'receiveShadow'].forEach(p => {\r\n this.mesh[p] = this[p];\r\n watch(() => this[p], () => { this.mesh[p] = this[p]; });\r\n });\r\n\r\n // watch(() => this.materialId, () => {\r\n // this.mesh.material = this.three.materials[this.materialId];\r\n // });\r\n\r\n this.scene.add(this.mesh);\r\n },\r\n setGeometry(geometry) {\r\n this.geometry = geometry;\r\n if (this.mesh) this.mesh.geometry = geometry;\r\n },\r\n setMaterial(material) {\r\n this.material = material;\r\n if (this.mesh) this.mesh.material = material;\r\n },\r\n },\r\n render() {\r\n return this.$slots.default();\r\n },\r\n __hmrId: 'InstancedMesh',\r\n};\r\n","import {\r\n CubeCamera,\r\n LinearMipmapLinearFilter,\r\n RGBFormat,\r\n WebGLCubeRenderTarget,\r\n} from 'three';\r\n// import { watch } from 'vue';\r\nimport Mesh from './Mesh.js';\r\nimport useBindProp from '../use/useBindProp.js';\r\n\r\nexport default {\r\n extends: Mesh,\r\n props: {\r\n cubeRTSize: { type: Number, default: 512 },\r\n cubeCameraNear: { type: Number, default: 0.1 },\r\n cubeCameraFar: { type: Number, default: 2000 },\r\n autoUpdate: Boolean,\r\n },\r\n mounted() {\r\n this.initMirrorMesh();\r\n if (this.autoUpdate) this.three.onBeforeRender(this.updateCubeRT);\r\n else this.rendererComponent.onMounted(this.updateCubeRT);\r\n },\r\n unmounted() {\r\n this.three.offBeforeRender(this.updateCubeRT);\r\n },\r\n methods: {\r\n initMirrorMesh() {\r\n const cubeRT = new WebGLCubeRenderTarget(this.cubeRTSize, { format: RGBFormat, generateMipmaps: true, minFilter: LinearMipmapLinearFilter });\r\n this.cubeCamera = new CubeCamera(this.cubeCameraNear, this.cubeCameraFar, cubeRT);\r\n useBindProp(this, 'position', this.cubeCamera.position);\r\n this.scene.add(this.cubeCamera);\r\n\r\n this.material.envMap = cubeRT.texture;\r\n this.material.needsUpdate = true;\r\n },\r\n updateCubeRT() {\r\n this.mesh.visible = false;\r\n this.cubeCamera.update(this.three.renderer, this.scene);\r\n this.mesh.visible = true;\r\n },\r\n },\r\n __hmrId: 'MirrorMesh',\r\n};\r\n","import {\r\n CubeCamera,\r\n CubeRefractionMapping,\r\n LinearMipmapLinearFilter,\r\n RGBFormat,\r\n WebGLCubeRenderTarget,\r\n} from 'three';\r\n// import { watch } from 'vue';\r\nimport Mesh from './Mesh.js';\r\nimport useBindProp from '../use/useBindProp.js';\r\n\r\nexport default {\r\n extends: Mesh,\r\n props: {\r\n cubeRTSize: { type: Number, default: 512 },\r\n cubeCameraNear: { type: Number, default: 0.1 },\r\n cubeCameraFar: { type: Number, default: 2000 },\r\n autoUpdate: Boolean,\r\n },\r\n mounted() {\r\n this.initMirrorMesh();\r\n if (this.autoUpdate) this.three.onBeforeRender(this.updateCubeRT);\r\n else this.rendererComponent.onMounted(this.updateCubeRT);\r\n },\r\n unmounted() {\r\n this.three.offBeforeRender(this.updateCubeRT);\r\n },\r\n methods: {\r\n initMirrorMesh() {\r\n const cubeRT = new WebGLCubeRenderTarget(this.cubeRTSize, { mapping: CubeRefractionMapping, format: RGBFormat, generateMipmaps: true, minFilter: LinearMipmapLinearFilter });\r\n this.cubeCamera = new CubeCamera(this.cubeCameraNear, this.cubeCameraFar, cubeRT);\r\n useBindProp(this, 'position', this.cubeCamera.position);\r\n this.scene.add(this.cubeCamera);\r\n\r\n this.material.envMap = cubeRT.texture;\r\n this.material.refractionRatio = 0.95;\r\n this.material.needsUpdate = true;\r\n },\r\n updateCubeRT() {\r\n this.mesh.visible = false;\r\n this.cubeCamera.update(this.three.renderer, this.scene);\r\n this.mesh.visible = true;\r\n },\r\n },\r\n __hmrId: 'RefractionMesh',\r\n};\r\n","import { Sprite, SpriteMaterial, TextureLoader } from 'three';\r\nimport { watch } from 'vue';\r\nimport useBindProp from '../use/useBindProp.js';\r\n\r\nexport default {\r\n emits: ['ready', 'loaded'],\r\n inject: ['three', 'scene'],\r\n props: {\r\n src: String,\r\n position: Object,\r\n scale: Object,\r\n },\r\n mounted() {\r\n this.texture = new TextureLoader().load(this.src, this.onLoaded);\r\n this.material = new SpriteMaterial({ map: this.texture });\r\n this.sprite = new Sprite(this.material);\r\n this.geometry = this.sprite.geometry;\r\n\r\n useBindProp(this, 'position', this.sprite.position);\r\n useBindProp(this, 'scale', this.sprite.scale);\r\n\r\n // watch(() => this.src, () => {\r\n // this.texture = new TextureLoader().load(this.src, this.onLoaded);\r\n // this.material.map = this.texture;\r\n // });\r\n\r\n this.scene.add(this.sprite);\r\n this.$emit('ready');\r\n },\r\n unmounted() {\r\n this.texture.dispose();\r\n this.material.dispose();\r\n this.scene.remove(this.sprite);\r\n },\r\n methods: {\r\n onLoaded() {\r\n this.updateUV();\r\n this.$emit('loaded');\r\n },\r\n updateUV() {\r\n this.iWidth = this.texture.image.width;\r\n this.iHeight = this.texture.image.height;\r\n this.iRatio = this.iWidth / this.iHeight;\r\n\r\n let x = 0.5, y = 0.5;\r\n if (this.iRatio > 1) {\r\n y = 0.5 / this.iRatio;\r\n } else {\r\n x = 0.5 / this.iRatio;\r\n }\r\n\r\n const positions = this.geometry.attributes.position.array;\r\n positions[0] = -x; positions[1] = -y;\r\n positions[5] = x; positions[6] = -y;\r\n positions[10] = x; positions[11] = y;\r\n positions[15] = -x; positions[16] = y;\r\n this.geometry.attributes.position.needsUpdate = true;\r\n },\r\n },\r\n render() {\r\n return [];\r\n },\r\n __hmrId: 'Sprite',\r\n};\r\n","import { EffectComposer } from 'three/examples/jsm/postprocessing/EffectComposer.js';\r\n\r\nexport default {\r\n setup() {\r\n return {\r\n passes: [],\r\n };\r\n },\r\n inject: ['three'],\r\n provide() {\r\n return {\r\n passes: this.passes,\r\n };\r\n },\r\n mounted() {\r\n this.three.onAfterInit(() => {\r\n this.composer = new EffectComposer(this.three.renderer);\r\n this.three.renderer.autoClear = false;\r\n this.passes.forEach(pass => {\r\n this.composer.addPass(pass);\r\n });\r\n this.three.composer = this.composer;\r\n });\r\n },\r\n render() {\r\n return this.$slots.default();\r\n },\r\n __hmrId: 'EffectComposer',\r\n};\r\n","export default {\r\n inject: ['three', 'passes'],\r\n beforeMount() {\r\n if (!this.passes) {\r\n console.error('Missing parent EffectComposer');\r\n }\r\n },\r\n unmounted() {\r\n if (this.pass.dispose) this.pass.dispose();\r\n },\r\n render() {\r\n return [];\r\n },\r\n __hmrId: 'EffectPass',\r\n};\r\n","import { RenderPass } from 'three/examples/jsm/postprocessing/RenderPass.js';\r\nimport EffectPass from './EffectPass.js';\r\n\r\nexport default {\r\n extends: EffectPass,\r\n mounted() {\r\n if (!this.three.scene) {\r\n console.error('Missing Scene');\r\n }\r\n if (!this.three.camera) {\r\n console.error('Missing Camera');\r\n }\r\n const pass = new RenderPass(this.three.scene, this.three.camera);\r\n this.passes.push(pass);\r\n this.pass = pass;\r\n },\r\n __hmrId: 'RenderPass',\r\n};\r\n","import { BokehPass } from 'three/examples/jsm/postprocessing/BokehPass.js';\r\nimport EffectPass from './EffectPass.js';\r\n\r\nexport default {\r\n extends: EffectPass,\r\n props: {\r\n focus: {\r\n type: Number,\r\n default: 1,\r\n },\r\n aperture: {\r\n type: Number,\r\n default: 0.025,\r\n },\r\n maxblur: {\r\n type: Number,\r\n default: 0.01,\r\n },\r\n },\r\n watch: {\r\n focus() { this.pass.uniforms.focus.value = this.focus; },\r\n aperture() { this.pass.uniforms.aperture.value = this.aperture; },\r\n maxblur() { this.pass.uniforms.maxblur.value = this.maxblur; },\r\n },\r\n mounted() {\r\n if (!this.three.scene) {\r\n console.error('Missing Scene');\r\n }\r\n if (!this.three.camera) {\r\n console.error('Missing Camera');\r\n }\r\n const params = {\r\n focus: this.focus,\r\n aperture: this.aperture,\r\n maxblur: this.maxblur,\r\n width: this.three.size.width,\r\n height: this.three.size.height,\r\n };\r\n const pass = new BokehPass(this.three.scene, this.three.camera, params);\r\n this.passes.push(pass);\r\n this.pass = pass;\r\n },\r\n __hmrId: 'BokehPass',\r\n};\r\n","import { FilmPass } from 'three/examples/jsm/postprocessing/FilmPass.js';\r\nimport EffectPass from './EffectPass.js';\r\n\r\nexport default {\r\n extends: EffectPass,\r\n props: {\r\n noiseIntensity: {\r\n type: Number,\r\n default: 0.5,\r\n },\r\n scanlinesIntensity: {\r\n type: Number,\r\n default: 0.05,\r\n },\r\n scanlinesCount: {\r\n type: Number,\r\n default: 4096,\r\n },\r\n grayscale: {\r\n type: Number,\r\n default: 0,\r\n },\r\n },\r\n watch: {\r\n noiseIntensity() { this.pass.uniforms.nIntensity.value = this.noiseIntensity; },\r\n scanlinesIntensity() { this.pass.uniforms.sIntensity.value = this.scanlinesIntensity; },\r\n scanlinesCount() { this.pass.uniforms.sCount.value = this.scanlinesCount; },\r\n grayscale() { this.pass.uniforms.grayscale.value = this.grayscale; },\r\n },\r\n mounted() {\r\n const pass = new FilmPass(this.noiseIntensity, this.scanlinesIntensity, this.scanlinesCount, this.grayscale);\r\n this.passes.push(pass);\r\n this.pass = pass;\r\n },\r\n __hmrId: 'FilmPass',\r\n};\r\n","import { HalftonePass } from 'three/examples/jsm/postprocessing/HalftonePass.js';\r\nimport { watch } from 'vue';\r\nimport EffectPass from './EffectPass.js';\r\n\r\nexport default {\r\n extends: EffectPass,\r\n props: {\r\n shape: { type: Number, default: 1 },\r\n radius: { type: Number, default: 4 },\r\n rotateR: { type: Number, default: Math.PI / 12 * 1 },\r\n rotateG: { type: Number, default: Math.PI / 12 * 2 },\r\n rotateB: { type: Number, default: Math.PI / 12 * 3 },\r\n scatter: { type: Number, default: 0 },\r\n },\r\n mounted() {\r\n const pass = new HalftonePass(this.three.size.width, this.three.size.height, {});\r\n\r\n ['shape', 'radius', 'rotateR', 'rotateG', 'rotateB', 'scatter'].forEach(p => {\r\n pass.uniforms[p].value = this[p];\r\n watch(() => this[p], () => {\r\n pass.uniforms[p].value = this[p];\r\n });\r\n });\r\n\r\n this.passes.push(pass);\r\n this.pass = pass;\r\n },\r\n __hmrId: 'HalftonePass',\r\n};\r\n","import { Vector2 } from 'three';\r\nimport { SAOPass } from 'three/examples/jsm/postprocessing/SAOPass.js';\r\nimport { watch } from 'vue';\r\nimport EffectPass from './EffectPass.js';\r\n\r\nexport default {\r\n extends: EffectPass,\r\n props: {\r\n depthTexture: { type: Boolean, default: false },\r\n useNormals: { type: Boolean, default: false },\r\n resolution: Object,\r\n },\r\n mounted() {\r\n if (!this.three.scene) {\r\n console.error('Missing Scene');\r\n }\r\n if (!this.three.camera) {\r\n console.error('Missing Camera');\r\n }\r\n\r\n const resolution = this.resolution ? new Vector2(this.resolution.x, this.resolution.y) : new Vector2(this.three.size.width, this.three.size.height);\r\n const pass = new SAOPass(this.three.scene, this.three.camera, this.depthTexture, this.useNormals, resolution);\r\n this.passes.push(pass);\r\n this.pass = pass;\r\n },\r\n __hmrId: 'SAOPass',\r\n};\r\n","import { Vector2 } from 'three';\r\nimport { UnrealBloomPass } from 'three/examples/jsm/postprocessing/UnrealBloomPass.js';\r\nimport EffectPass from './EffectPass.js';\r\n\r\nexport default {\r\n extends: EffectPass,\r\n props: {\r\n strength: { type: Number, default: 1.5 },\r\n radius: { type: Number, default: 0 },\r\n threshold: { type: Number, default: 0 },\r\n },\r\n watch: {\r\n strength() { this.pass.strength = this.strength; },\r\n radius() { this.pass.radius = this.radius; },\r\n threshold() { this.pass.threshold = this.threshold; },\r\n },\r\n mounted() {\r\n const size = new Vector2(this.three.size.width, this.three.size.height);\r\n const pass = new UnrealBloomPass(size, this.strength, this.radius, this.threshold);\r\n this.passes.push(pass);\r\n this.pass = pass;\r\n },\r\n __hmrId: 'UnrealBloomPass',\r\n};\r\n","export default `\n//\n// Description : Array and textureless GLSL 2D simplex noise function.\n// Author : Ian McEwan, Ashima Arts.\n// Maintainer : ijm\n// Lastmod : 20110822 (ijm)\n// License : Copyright (C) 2011 Ashima Arts. All rights reserved.\n// Distributed under the MIT License. See LICENSE file.\n// https://github.com/ashima/webgl-noise\n//\n\nvec3 mod289(vec3 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec2 mod289(vec2 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec3 permute(vec3 x) {\n return mod289(((x*34.0)+1.0)*x);\n}\n\nfloat snoise(vec2 v)\n{\n const vec4 C = vec4(0.211324865405187, // (3.0-sqrt(3.0))/6.0\n 0.366025403784439, // 0.5*(sqrt(3.0)-1.0)\n -0.577350269189626, // -1.0 + 2.0 * C.x\n 0.024390243902439); // 1.0 / 41.0\n // First corner\n vec2 i = floor(v + dot(v, C.yy) );\n vec2 x0 = v - i + dot(i, C.xx);\n\n // Other corners\n vec2 i1;\n i1 = (x0.x > x0.y) ? vec2(1.0, 0.0) : vec2(0.0, 1.0);\n vec4 x12 = x0.xyxy + C.xxzz;\n x12.xy -= i1;\n\n // Permutations\n i = mod289(i); // Avoid truncation effects in permutation\n vec3 p = permute( permute( i.y + vec3(0.0, i1.y, 1.0 ))\n + i.x + vec3(0.0, i1.x, 1.0 ));\n\n vec3 m = max(0.5 - vec3(dot(x0,x0), dot(x12.xy,x12.xy), dot(x12.zw,x12.zw)), 0.0);\n m = m*m ;\n m = m*m ;\n\n // Gradients: 41 points uniformly over a line, mapped onto a diamond.\n // The ring size 17*17 = 289 is close to a multiple of 41 (41*7 = 287)\n\n vec3 x = 2.0 * fract(p * C.www) - 1.0;\n vec3 h = abs(x) - 0.5;\n vec3 ox = floor(x + 0.5);\n vec3 a0 = x - ox;\n\n // Normalise gradients implicitly by scaling m\n // Approximation of: m *= inversesqrt( a0*a0 + h*h );\n m *= 1.79284291400159 - 0.85373472095314 * ( a0*a0 + h*h );\n\n // Compute final noise value at P\n vec3 g;\n g.x = a0.x * x0.x + h.x * x0.y;\n g.yz = a0.yz * x12.xz + h.yz * x12.yw;\n return 130.0 * dot(m, g);\n}\n`;\n","import { DoubleSide, MeshBasicMaterial, PlaneBufferGeometry } from 'three';\r\nimport { watch } from 'vue';\r\nimport Image from '../../meshes/Image.js';\r\nimport snoise2 from '../../glsl/snoise2.glsl.js';\r\n\r\nexport default {\r\n extends: Image,\r\n props: {\r\n widthSegments: { type: Number, default: 20 },\r\n heightSegments: { type: Number, default: 20 },\r\n timeCoef: { type: Number, default: 0.001 },\r\n noiseCoef: { type: Number, default: 1 },\r\n zCoef: { type: Number, default: 5 },\r\n dispCoef: { type: Number, default: 0.05 },\r\n },\r\n setup(props) {\r\n // uniforms\r\n const uTime = { value: 0 };\r\n const uNoiseCoef = { value: props.noiseCoef };\r\n watch(() => props.noiseCoef, (value) => { uNoiseCoef.value = value; });\r\n const uZCoef = { value: props.zCoef };\r\n watch(() => props.zCoef, (value) => { uZCoef.value = value; });\r\n const uDispCoef = { value: props.dispCoef };\r\n watch(() => props.dispCoef, (value) => { uDispCoef.value = value; });\r\n\r\n return {\r\n uTime, uNoiseCoef, uZCoef, uDispCoef,\r\n };\r\n },\r\n mounted() {\r\n this.startTime = Date.now();\r\n this.three.onBeforeRender(this.updateTime);\r\n },\r\n unmounted() {\r\n this.three.offBeforeRender(this.updateTime);\r\n },\r\n methods: {\r\n createGeometry() {\r\n this.geometry = new PlaneBufferGeometry(1, 1, this.widthSegments, this.heightSegments);\r\n },\r\n createMaterial() {\r\n this.material = new MeshBasicMaterial({ side: DoubleSide, map: this.loadTexture() });\r\n this.material.onBeforeCompile = (shader) => {\r\n shader.uniforms.uTime = this.uTime;\r\n shader.uniforms.uNoiseCoef = this.uNoiseCoef;\r\n shader.uniforms.uZCoef = this.uZCoef;\r\n shader.uniforms.uDispCoef = this.uDispCoef;\r\n shader.vertexShader = `\r\n uniform float uTime;\r\n uniform float uNoiseCoef;\r\n uniform float uZCoef;\r\n varying float vNoise;\r\n ${snoise2}\r\n ` + shader.vertexShader;\r\n\r\n shader.vertexShader = shader.vertexShader.replace(\r\n '#include ',\r\n ` \r\n vec3 p = vec3(position * uNoiseCoef);\r\n p.x += uTime;\r\n vNoise = snoise(p.xy);\r\n vec3 transformed = vec3(position);\r\n transformed.z += vNoise * uZCoef;\r\n `\r\n );\r\n\r\n shader.fragmentShader = `\r\n uniform float uDispCoef;\r\n varying float vNoise;\r\n ` + shader.fragmentShader;\r\n\r\n shader.fragmentShader = shader.fragmentShader.replace(\r\n '#include ',\r\n `\r\n vec4 texelColor = texture2D(map, vUv);\r\n vec4 dispTexel = texture2D(map, vUv + vec2(vNoise * uDispCoef, 0));\r\n texelColor.r = dispTexel.r;\r\n diffuseColor = texelColor;\r\n `\r\n );\r\n this.materialShader = shader;\r\n };\r\n },\r\n updateTime() {\r\n this.uTime.value = (Date.now() - this.startTime) * this.timeCoef;\r\n },\r\n },\r\n __hmrId: 'NoisyImage',\r\n};\r\n","import { watch } from 'vue';\r\nimport Plane from '../../meshes/Plane.js';\r\nimport snoise3 from '../../glsl/snoise3.glsl.js';\r\n\r\nexport default {\r\n extends: Plane,\r\n props: {\r\n timeCoef: { type: Number, default: 0.001 },\r\n noiseCoef: { type: Number, default: 1 },\r\n zCoef: { type: Number, default: 5 },\r\n },\r\n setup(props) {\r\n // uniforms\r\n const uTime = { value: 0 };\r\n const uNoiseCoef = { value: props.noiseCoef };\r\n watch(() => props.noiseCoef, (value) => { uNoiseCoef.value = value; });\r\n const uZCoef = { value: props.zCoef };\r\n watch(() => props.zCoef, (value) => { uZCoef.value = value; });\r\n\r\n return {\r\n uTime, uNoiseCoef, uZCoef,\r\n };\r\n },\r\n mounted() {\r\n this.updateMaterial();\r\n this.startTime = Date.now();\r\n this.three.onBeforeRender(this.updateTime);\r\n },\r\n unmounted() {\r\n this.three.offBeforeRender(this.updateTime);\r\n },\r\n methods: {\r\n updateMaterial() {\r\n this.material.onBeforeCompile = (shader) => {\r\n shader.uniforms.uTime = this.uTime;\r\n shader.uniforms.uNoiseCoef = this.uNoiseCoef;\r\n shader.uniforms.uZCoef = this.uZCoef;\r\n shader.vertexShader = `\r\n uniform float uTime;\r\n uniform float uNoiseCoef;\r\n uniform float uZCoef;\r\n varying float vNoise;\r\n ${snoise3}\r\n ` + shader.vertexShader;\r\n\r\n shader.vertexShader = shader.vertexShader.replace(\r\n '#include ',\r\n ` \r\n vec3 p = vec3(position * uNoiseCoef);\r\n vNoise = snoise(vec3(p.x, p.y, uTime));\r\n vec3 transformed = vec3(position);\r\n transformed.z += vNoise * uZCoef;\r\n `\r\n );\r\n this.materialShader = shader;\r\n };\r\n this.material.needsupdate = true;\r\n },\r\n updateTime() {\r\n this.uTime.value = (Date.now() - this.startTime) * this.timeCoef;\r\n },\r\n },\r\n __hmrId: 'NoisyPlane',\r\n};\r\n","import { watch } from 'vue';\r\nimport Sphere from '../../meshes/Sphere.js';\r\nimport snoise4 from '../../glsl/snoise4.glsl.js';\r\n\r\nexport default {\r\n extends: Sphere,\r\n props: {\r\n radius: { type: Number, default: 20 },\r\n widthSegments: { type: Number, default: 128 },\r\n heightSegments: { type: Number, default: 128 },\r\n timeCoef: { type: Number, default: 0.001 },\r\n noiseCoef: { type: Number, default: 0.05 },\r\n dispCoef: { type: Number, default: 5 },\r\n },\r\n setup(props) {\r\n // uniforms\r\n const uTime = { value: 0 };\r\n const uNoiseCoef = { value: props.noiseCoef };\r\n watch(() => props.noiseCoef, (value) => { uNoiseCoef.value = value; });\r\n const uDispCoef = { value: props.dispCoef };\r\n watch(() => props.dispCoef, (value) => { uDispCoef.value = value; });\r\n\r\n return {\r\n uTime, uNoiseCoef, uDispCoef,\r\n };\r\n },\r\n mounted() {\r\n this.updateMaterial();\r\n\r\n this.startTime = Date.now();\r\n this.three.onBeforeRender(this.updateTime);\r\n },\r\n unmounted() {\r\n this.three.offBeforeRender(this.updateTime);\r\n },\r\n methods: {\r\n updateMaterial() {\r\n this.material.onBeforeCompile = (shader) => {\r\n shader.uniforms.uTime = this.uTime;\r\n shader.uniforms.uNoiseCoef = this.uNoiseCoef;\r\n shader.uniforms.uDispCoef = this.uDispCoef;\r\n shader.vertexShader = `\r\n uniform float uTime;\r\n uniform float uNoiseCoef;\r\n uniform float uDispCoef;\r\n varying float vNoise;\r\n ${snoise4}\r\n ` + shader.vertexShader;\r\n\r\n shader.vertexShader = shader.vertexShader.replace(\r\n '#include ',\r\n `\r\n vec4 p = vec4(vec3(position * uNoiseCoef), uTime);\r\n vNoise = snoise(p);\r\n vec3 transformed = vec3(position);\r\n transformed += normalize(position) * vNoise * uDispCoef;\r\n `\r\n );\r\n this.materialShader = shader;\r\n };\r\n this.material.needsupdate = true;\r\n },\r\n updateTime() {\r\n this.uTime.value = (Date.now() - this.startTime) * this.timeCoef;\r\n },\r\n },\r\n __hmrId: 'NoisySphere',\r\n};\r\n","import { watch } from 'vue';\nimport Text from '../../meshes/Text.js';\nimport snoise2 from '../../glsl/snoise2.glsl.js';\n\nexport default {\n extends: Text,\n props: {\n timeCoef: { type: Number, default: 0.001 },\n noiseCoef: { type: Number, default: 0.015 },\n zCoef: { type: Number, default: 10 },\n },\n setup(props) {\n // uniforms\n const uTime = { value: 0 };\n const uNoiseCoef = { value: props.noiseCoef };\n watch(() => props.noiseCoef, (value) => { uNoiseCoef.value = value; });\n const uZCoef = { value: props.zCoef };\n watch(() => props.zCoef, (value) => { uZCoef.value = value; });\n\n return {\n uTime, uNoiseCoef, uZCoef,\n };\n },\n mounted() {\n this.updateMaterial();\n\n this.startTime = Date.now();\n this.three.onBeforeRender(this.updateTime);\n },\n unmounted() {\n this.three.offBeforeRender(this.updateTime);\n },\n methods: {\n updateMaterial() {\n this.material.onBeforeCompile = (shader) => {\n shader.uniforms.uTime = this.uTime;\n shader.uniforms.uNoiseCoef = this.uNoiseCoef;\n shader.uniforms.uZCoef = this.uZCoef;\n shader.vertexShader = `\n uniform float uTime;\n uniform float uNoiseCoef;\n uniform float uZCoef;\n ${snoise2}\n ` + shader.vertexShader;\n\n shader.vertexShader = shader.vertexShader.replace(\n '#include ',\n ` \n vec3 p = vec3(position * uNoiseCoef);\n p.x += uTime;\n float noise = snoise(p.xy);\n vec3 transformed = vec3(position);\n transformed.z += noise * uZCoef;\n `\n );\n this.materialShader = shader;\n };\n this.material.needsupdate = true;\n },\n updateTime() {\n this.uTime.value = (Date.now() - this.startTime) * this.timeCoef;\n },\n },\n __hmrId: 'NoisyText',\n};\n","\r\nimport {\r\n BufferGeometry,\r\n DoubleSide,\r\n Face3,\r\n Geometry,\r\n InstancedBufferAttribute,\r\n InstancedMesh,\r\n MathUtils,\r\n MeshBasicMaterial,\r\n Object3D,\r\n Vector2,\r\n Vector3,\r\n} from 'three';\r\n\r\nexport default class AnimatedPlane {\r\n constructor(params) {\r\n Object.entries(params).forEach(([key, value]) => {\r\n this[key] = value;\r\n });\r\n\r\n this.o3d = new Object3D();\r\n this.uProgress = { value: 0 };\r\n this.uvScale = new Vector2();\r\n\r\n this.initMaterial();\r\n this.initPlane();\r\n }\r\n\r\n initMaterial() {\r\n this.material = new MeshBasicMaterial({\r\n side: DoubleSide,\r\n transparent: true,\r\n map: this.texture,\r\n onBeforeCompile: shader => {\r\n shader.uniforms.progress = this.uProgress;\r\n shader.uniforms.uvScale = { value: this.uvScale };\r\n shader.vertexShader = `\r\n uniform float progress;\r\n uniform vec2 uvScale;\r\n\r\n attribute vec3 offset;\r\n attribute vec3 rotation;\r\n attribute vec2 uvOffset;\r\n\r\n mat3 rotationMatrixXYZ(vec3 r)\r\n {\r\n float cx = cos(r.x);\r\n float sx = sin(r.x);\r\n float cy = cos(r.y);\r\n float sy = sin(r.y);\r\n float cz = cos(r.z);\r\n float sz = sin(r.z);\r\n\r\n return mat3(\r\n cy * cz, cx * sz + sx * sy * cz, sx * sz - cx * sy * cz,\r\n -cy * sz, cx * cz - sx * sy * sz, sx * cz + cx * sy * sz,\r\n sy, -sx * cy, cx * cy\r\n );\r\n }\r\n ` + shader.vertexShader;\r\n\r\n shader.vertexShader = shader.vertexShader.replace('#include ', `\r\n #include \r\n vUv = vUv * uvScale + uvOffset;\r\n `);\r\n\r\n shader.vertexShader = shader.vertexShader.replace('#include ', `\r\n mat3 rotMat = rotationMatrixXYZ(progress * rotation);\r\n transformed = rotMat * transformed;\r\n\r\n vec4 mvPosition = vec4(transformed, 1.0);\r\n #ifdef USE_INSTANCING\r\n mvPosition = instanceMatrix * mvPosition;\r\n #endif\r\n\r\n mvPosition.xyz += progress * offset;\r\n\r\n mvPosition = modelViewMatrix * mvPosition;\r\n gl_Position = projectionMatrix * mvPosition;\r\n `);\r\n },\r\n });\r\n }\r\n\r\n initPlane() {\r\n const { width, wWidth, wHeight } = this.screen;\r\n this.wSize = this.size * wWidth / width;\r\n this.nx = Math.ceil(wWidth / this.wSize) + 1;\r\n this.ny = Math.ceil(wHeight / this.wSize) + 1;\r\n this.icount = this.nx * this.ny;\r\n\r\n this.initGeometry();\r\n this.initUV();\r\n this.initAnimAttributes();\r\n\r\n if (this.imesh) {\r\n this.o3d.remove(this.imesh);\r\n }\r\n this.imesh = new InstancedMesh(this.bGeometry, this.material, this.icount);\r\n this.o3d.add(this.imesh);\r\n\r\n const dummy = new Object3D();\r\n let index = 0;\r\n let x = -(wWidth - (wWidth - this.nx * this.wSize)) / 2 + this.dx;\r\n for (let i = 0; i < this.nx; i++) {\r\n let y = -(wHeight - (wHeight - this.ny * this.wSize)) / 2 + this.dy;\r\n for (let j = 0; j < this.ny; j++) {\r\n dummy.position.set(x, y, 0);\r\n dummy.updateMatrix();\r\n this.imesh.setMatrixAt(index++, dummy.matrix);\r\n y += this.wSize;\r\n }\r\n x += this.wSize;\r\n }\r\n }\r\n\r\n initGeometry() {\r\n // square\r\n const geometry = new Geometry();\r\n geometry.vertices.push(new Vector3(0, 0, 0));\r\n geometry.vertices.push(new Vector3(this.wSize, 0, 0));\r\n geometry.vertices.push(new Vector3(0, this.wSize, 0));\r\n geometry.vertices.push(new Vector3(this.wSize, this.wSize, 0));\r\n geometry.faces.push(new Face3(0, 2, 1));\r\n geometry.faces.push(new Face3(2, 3, 1));\r\n\r\n geometry.faceVertexUvs[0].push([\r\n new Vector2(0, 0),\r\n new Vector2(0, 1),\r\n new Vector2(1, 0),\r\n ]);\r\n geometry.faceVertexUvs[0].push([\r\n new Vector2(0, 1),\r\n new Vector2(1, 1),\r\n new Vector2(1, 0),\r\n ]);\r\n\r\n // geometry.computeFaceNormals();\r\n // geometry.computeVertexNormals();\r\n\r\n // center\r\n this.dx = this.wSize / 2;\r\n this.dy = this.wSize / 2;\r\n geometry.translate(-this.dx, -this.dy, 0);\r\n\r\n this.bGeometry = new BufferGeometry().fromGeometry(geometry);\r\n }\r\n\r\n initAnimAttributes() {\r\n const { randFloat: rnd, randFloatSpread: rndFS } = MathUtils;\r\n const v3 = new Vector3();\r\n\r\n const offsets = new Float32Array(this.icount * 3);\r\n for (let i = 0; i < offsets.length; i += 3) {\r\n if (this.anim === 1) v3.set(rndFS(10), rnd(50, 100), rnd(20, 50)).toArray(offsets, i);\r\n else v3.set(rndFS(20), rndFS(20), rnd(20, 200)).toArray(offsets, i);\r\n }\r\n this.bGeometry.setAttribute('offset', new InstancedBufferAttribute(offsets, 3));\r\n\r\n const rotations = new Float32Array(this.icount * 3);\r\n const angle = Math.PI * 4;\r\n for (let i = 0; i < rotations.length; i += 3) {\r\n rotations[i] = rndFS(angle);\r\n rotations[i + 1] = rndFS(angle);\r\n rotations[i + 2] = rndFS(angle);\r\n }\r\n this.bGeometry.setAttribute('rotation', new InstancedBufferAttribute(rotations, 3));\r\n }\r\n\r\n initUV() {\r\n const ratio = this.nx / this.ny;\r\n const tRatio = this.texture.image.width / this.texture.image.height;\r\n if (ratio > tRatio) this.uvScale.set(1 / this.nx, (tRatio / ratio) / this.ny);\r\n else this.uvScale.set((ratio / tRatio) / this.nx, 1 / this.ny);\r\n const nW = this.uvScale.x * this.nx;\r\n const nH = this.uvScale.y * this.ny;\r\n\r\n const v2 = new Vector2();\r\n const uvOffsets = new Float32Array(this.icount * 2);\r\n for (let i = 0; i < this.nx; i++) {\r\n for (let j = 0; j < this.ny; j++) {\r\n v2.set(\r\n this.uvScale.x * i + (1 - nW) / 2,\r\n this.uvScale.y * j + (1 - nH) / 2\r\n ).toArray(uvOffsets, (i * this.ny + j) * 2);\r\n }\r\n }\r\n this.bGeometry.setAttribute('uvOffset', new InstancedBufferAttribute(uvOffsets, 2));\r\n }\r\n\r\n setTexture(texture) {\r\n this.texture = texture;\r\n this.material.map = texture;\r\n this.initUV();\r\n }\r\n\r\n resize() {\r\n this.initPlane();\r\n }\r\n}\r\n","\r\n\r\n\r\n","import { TextureLoader } from 'three';\r\n\r\nexport default function useTextures() {\r\n const loader = new TextureLoader();\r\n const textures = [];\r\n\r\n const loadTexture = (img, index) => {\r\n return new Promise(resolve => {\r\n loader.load(\r\n img.src,\r\n texture => {\r\n textures[index] = texture;\r\n resolve(texture);\r\n }\r\n );\r\n });\r\n };\r\n\r\n const loadTextures = (images, cb) => {\r\n textures.splice(0);\r\n Promise.all(images.map(loadTexture)).then(cb);\r\n };\r\n\r\n return {\r\n textures,\r\n loadTextures,\r\n };\r\n};\r\n","\r\n\r\n\r\n","import * as TROIS from './index.js';\r\n\r\nexport const TroisJSVuePlugin = {\r\n install: (app) => {\r\n const comps = [\r\n 'Camera',\r\n 'PerspectiveCamera',\r\n 'Renderer',\r\n 'Scene',\r\n // 'Texture',\r\n // 'CubeTexture',\r\n\r\n 'BoxGeometry',\r\n 'CircleGeometry',\r\n 'ConeGeometry',\r\n 'CylinderGeometry',\r\n 'DodecahedronGeometry',\r\n 'IcosahedronGeometry',\r\n 'LatheGeometry',\r\n 'OctahedronGeometry',\r\n 'PolyhedronGeometry',\r\n 'RingGeometry',\r\n 'SphereGeometry',\r\n 'TetrahedronGeometry',\r\n 'TorusGeometry',\r\n 'TorusKnotGeometry',\r\n 'TubeGeometry',\r\n\r\n 'AmbientLight',\r\n 'DirectionalLight',\r\n 'PointLight',\r\n 'SpotLight',\r\n\r\n 'BasicMaterial',\r\n 'LambertMaterial',\r\n 'PhongMaterial',\r\n 'PhysicalMaterial',\r\n 'ShaderMaterial',\r\n 'StandardMaterial',\r\n 'SubSurfaceMaterial',\r\n 'ToonMaterial',\r\n\r\n 'Map',\r\n 'EnvMap',\r\n\r\n 'Box',\r\n 'Circle',\r\n 'Cone',\r\n 'Cylinder',\r\n 'Dodecahedron',\r\n 'Icosahedron',\r\n 'Mesh',\r\n 'Lathe',\r\n 'Octahedron',\r\n 'Plane',\r\n 'Polyhedron',\r\n 'Ring',\r\n 'Sphere',\r\n 'Tetrahedron',\r\n 'Text',\r\n 'Torus',\r\n 'TorusKnot',\r\n 'Tube',\r\n\r\n 'Gem',\r\n 'Image',\r\n 'InstancedMesh',\r\n 'MirrorMesh',\r\n 'RefractionMesh',\r\n 'Sprite',\r\n\r\n 'BokehPass',\r\n 'EffectComposer',\r\n 'FilmPass',\r\n 'HalftonePass',\r\n 'RenderPass',\r\n 'SAOPass',\r\n 'UnrealBloomPass',\r\n\r\n 'GLTFViewer',\r\n ];\r\n\r\n comps.forEach(comp => {\r\n app.component(comp, TROIS[comp]);\r\n });\r\n },\r\n};\r\n"],"names":["useThree","const","conf","canvas","antialias","alpha","autoClear","orbit_ctrl","mouse_move","mouse_raycast","resize","width","height","size","wWidth","wHeight","ratio","afterInitCallbacks","afterResizeCallbacks","beforeRenderCallbacks","mouse","Vector2","mouseV3","Vector3","mousePlane","Plane","raycaster","Raycaster","obj","renderer","camera","cameraCtrl","materials","scene","params","Object","entries","forEach","key","value","console","error","WebGLRenderer","orbitCtrl","OrbitControls","domElement","setSize","onResize","window","addEventListener","mouse_move_element","document","body","onMousemove","onMouseleave","c","removeEventListener","dispose","this","update","render","composer","callback","push","filter","e","x","clientX","y","clientY","updateMouseV3","getWorldDirection","normal","normalize","setFromCamera","ray","intersectPlane","innerWidth","innerHeight","clientWidth","clientHeight","aspect","updateProjectionMatrix","wsize","vFOV","fov","Math","PI","h","tan","abs","position","z","getCameraSize","props","type","Boolean","default","shadow","mouseMove","String","mouseRaycast","Element","setup","three","raf","onMountedCallbacks","provide","rendererComponent","mounted","$refs","init","shadowMap","enabled","animateC","animate","beforeUnmount","methods","onMounted","onBeforeRender","onAfterResize","requestAnimationFrame","renderC","ref","$slots","setFromProp","o","prop","propsValues","exclude","values","includes","lerp","value1","value2","amount","lerpv3","v1","v2","limit","val","min","max","useBindProp","comp","object","toRef","watch","deep","inject","Number","far","near","created","PerspectiveCamera","p","__hmrId","id","background","Scene","Color","emits","src","onLoad","Function","onProgress","onError","createTexture","refreshTexture","unmounted","texture","TextureLoader","load","onLoaded","$emit","path","urls","Array","CubeTextureLoader","setPath","rotateX","rotateY","rotateZ","mesh","watchProps","$props","beforeMount","createGeometry","rotateGeometry","setGeometry","geometry","addWatchers","refreshGeometry","oldGeo","extends","Geometry","depth","widthSegments","heightSegments","depthSegments","let","w","d","BoxBufferGeometry","radius","segments","thetaStart","thetaLength","CircleBufferGeometry","radialSegments","openEnded","ConeBufferGeometry","radiusTop","radiusBottom","CylinderBufferGeometry","detail","DodecahedronBufferGeometry","IcosahedronBufferGeometry","points","phiStart","phiLength","LatheBufferGeometry","OctahedronBufferGeometry","vertices","indices","PolyhedronBufferGeometry","innerRadius","outerRadius","thetaSegments","phiSegments","RingBufferGeometry","SphereBufferGeometry","TetrahedronBufferGeometry","tube","tubularSegments","arc","TorusBufferGeometry","q","TorusKnotBufferGeometry","Curve","radiusSegments","closed","TubeBufferGeometry","color","intensity","castShadow","shadowMapSize","light","target","mapSize","add","remove","Light","AmbientLight","DirectionalLight","distance","decay","PointLight","angle","penumbra","SpotLight","depthTest","depthWrite","flatShading","fog","opacity","side","FrontSide","transparent","vertexColors","material","createMaterial","setMaterial","_addWatchers","setMap","map","needsUpdate","setEnvMap","envMap","set","Material","MeshBasicMaterial","MeshLambertMaterial","MeshPhongMaterial","emissive","emissiveIntensity","metalness","roughness","MeshStandardMaterial","StandardMaterial","MeshPhysicalMaterial","string","find","replace","meshphongFragHead","ShaderChunk","meshphong_frag","slice","indexOf","meshphongFragBody","SubsurfaceScatteringShader","uniforms","UniformsUtils","merge","ShaderLib","phong","thicknessColor","thicknessDistortion","thicknessAmbient","thicknessAttenuation","thicknessPower","thicknessScale","vertexShader","fragmentShader","lights_fragment_begin","split","join","diffuse","clone","TShaderMaterial","lights","MeshToonMaterial","Texture","CubeTexture","materialId","rotation","scale","receiveShadow","initMesh","Mesh","bindProps","PlaneBufferGeometry","text","fontSrc","curveSegments","bevelEnabled","bevelThickness","bevelSize","bevelOffset","bevelSegments","align","TextProps","font","FontLoader","TextBufferGeometry","center","cubeRTSize","cubeCameraNear","cubeCameraFar","autoUpdate","initGem","updateCubeRT","offBeforeRender","meshBack","materialBack","cubeRT","WebGLCubeRenderTarget","format","RGBFormat","generateMipmaps","minFilter","LinearMipmapLinearFilter","cubeCamera","CubeCamera","envMapIntensity","premultipliedAlpha","BackSide","TMesh","visible","keepSize","DoubleSide","loadTexture","screen","iRatio","image","count","InstancedMesh","initMirrorMesh","mapping","CubeRefractionMapping","refractionRatio","SpriteMaterial","sprite","Sprite","updateUV","iWidth","iHeight","positions","attributes","array","passes","onAfterInit","EffectComposer","pass","addPass","EffectPass","RenderPass","focus","aperture","maxblur","BokehPass","noiseIntensity","scanlinesIntensity","scanlinesCount","grayscale","nIntensity","sIntensity","sCount","FilmPass","shape","rotateR","rotateG","rotateB","scatter","HalftonePass","depthTexture","useNormals","resolution","SAOPass","strength","threshold","UnrealBloomPass","Image","timeCoef","noiseCoef","zCoef","dispCoef","uNoiseCoef","uZCoef","uDispCoef","startTime","Date","now","updateTime","onBeforeCompile","shader","uTime","snoise2","materialShader","updateMaterial","needsupdate","Sphere","Text","AnimatedPlane","o3d","Object3D","uProgress","uvScale","initMaterial","initPlane","progress","wSize","nx","ceil","ny","icount","initGeometry","initUV","initAnimAttributes","imesh","bGeometry","dummy","index","dx","i","dy","j","updateMatrix","setMatrixAt","matrix","faces","Face3","faceVertexUvs","translate","BufferGeometry","fromGeometry","v3","offsets","Float32Array","length","anim","rndFS","rnd","toArray","setAttribute","InstancedBufferAttribute","rotations","tRatio","nW","nH","uvOffsets","setTexture","images","events","wheel","click","keyup","loader","textures","img","Promise","resolve","cb","splice","all","then","useTextures","targetProgress","loadTextures","onClick","onKeyup","onWheel","initScene","gsap","fromTo","plane1","duration","ease","Power4","easeOut","updateProgress","plane2","setPlanesProgress","planes","deltaY","navPrevious","navNext","keyCode","isInteger","floor","progress1","pdiff","p0","p1","_createBlock","_createVNode","cameraPosition","GLTFLoader","gltf","orbit-ctrl","_renderSlot","TroisJSVuePlugin","install","app","component","TROIS"],"mappings":"soEAae,SAASA,KAEtBC,IAAMC,EAAO,CACXC,OAAQ,KACRC,WAAW,EACXC,OAAO,EACPC,WAAW,EACXC,YAAY,EACZC,YAAY,EACZC,eAAe,EACfC,OAAQ,SACRC,MAAO,EACPC,OAAQ,GAIJC,EAAO,CACXF,MAAO,EAAGC,OAAQ,EAClBE,OAAQ,EAAGC,QAAS,EACpBC,MAAO,GAILC,EAAqB,GACrBC,EAAuB,GACvBC,EAAwB,GAGtBC,EAAQ,IAAIC,EACZC,EAAU,IAAIC,EACdC,EAAa,IAAIC,EAAM,IAAIF,EAAQ,EAAG,EAAG,GAAI,GAC7CG,EAAY,IAAIC,EAGhBC,EAAM,MACV1B,EACA2B,SAAU,KACVC,OAAQ,KACRC,WAAY,KACZC,UAAW,GACXC,MAAO,UACPpB,QACAO,UAAOE,OAcT,SAAcY,GACRA,GACFC,OAAOC,QAAQF,GAAQG,uCACrBnC,EAAKoC,GAAOC,KAIhB,IAAKX,EAAIK,MAEP,YADAO,QA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Bhe,EAAK7B,SAAS2E,MAAMvE,MAAMyN,IAAIgS,EAAKzf,sGArBvCqf,KAAU3Z,IAAI,WAAYga,aAAY,oEACpCJ,KAAQ5Z,IAAI,SAAUhC,SAAU8F,uCAChC8V,uCACEK,ssCCFOC,GAAmB,CAC9BC,iBAAUC,GACM,CACZ,SACA,oBACA,WACA,QAIA,cACA,iBACA,eACA,mBACA,uBACA,sBACA,gBACA,qBACA,qBACA,eACA,iBACA,sBACA,gBACA,oBACA,eAEA,eACA,mBACA,aACA,YAEA,gBACA,kBACA,gBACA,mBACA,iBACA,mBACA,qBACA,eAEA,MACA,SAEA,MACA,SACA,OACA,WACA,eACA,cACA,OACA,QACA,aACA,QACA,aACA,OACA,SACA,cACA,OACA,QACA,YACA,OAEA,MACA,QACA,gBACA,aACA,iBACA,SAEA,YACA,iBACA,WACA,eACA,aACA,UACA,kBAEA,cAGI1f,kBAAQ2G,GACZ+Y,EAAIC,UAAUhZ,EAAMiZ,GAAMjZ"} \ No newline at end of file diff --git a/docs/index.891a7ba5.js b/docs/index.10d78495.js similarity index 80% rename from docs/index.891a7ba5.js rename to docs/index.10d78495.js index f4fde8e..7162223 100644 --- a/docs/index.891a7ba5.js +++ b/docs/index.10d78495.js @@ -1,4 +1,4 @@ -function e(e,t){const n=Object.create(null),i=e.split(",");for(let e=0;e!!n[e.toLowerCase()]:e=>!!n[e]}const t=e("Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl"),n=e("itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly");function i(e){if(_(e)){const t={};for(let n=0;n{if(e){const n=e.split(s);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function a(e){let t="";if(w(e))t=e;else if(_(e))for(let n=0;nt instanceof Map?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[t,n])=>(e[t+" =>"]=n,e),{})}:t instanceof Set?{[`Set(${t.size})`]:[...t.values()]}:!S(t)||_(t)||C(t)?t:String(t),c={},h=[],u=()=>{},d=()=>!1,p=/^on[^a-z]/,f=e=>p.test(e),m=e=>e.startsWith("onUpdate:"),g=Object.assign,v=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},y=Object.prototype.hasOwnProperty,x=(e,t)=>y.call(e,t),_=Array.isArray,b=e=>"function"==typeof e,w=e=>"string"==typeof e,M=e=>"symbol"==typeof e,S=e=>null!==e&&"object"==typeof e,T=e=>S(e)&&b(e.then)&&b(e.catch),E=Object.prototype.toString,A=e=>E.call(e),C=e=>"[object Object]"===A(e),L=e("key,ref,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),R=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},P=/-(\w)/g,N=R(e=>e.replace(P,(e,t)=>t?t.toUpperCase():"")),D=/\B([A-Z])/g,I=R(e=>e.replace(D,"-$1").toLowerCase()),O=R(e=>e.charAt(0).toUpperCase()+e.slice(1)),z=(e,t)=>e!==t&&(e==e||t==t),U=(e,t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value:n})},F=new WeakMap,G=[];let k;const H=Symbol(""),V=Symbol("");function j(e,t=c){(function(e){return e&&!0===e._isEffect})(e)&&(e=e.raw);const n=function(e,t){const n=function(){if(!n.active)return t.scheduler?void 0:e();if(!G.includes(n)){X(n);try{return Z.push(Y),Y=!0,G.push(n),k=n,e()}finally{G.pop(),K(),k=G[G.length-1]}}};return n.id=q++,n._isEffect=!0,n.active=!0,n.raw=e,n.deps=[],n.options=t,n}(e,t);return t.lazy||n(),n}function W(e){e.active&&(X(e),e.options.onStop&&e.options.onStop(),e.active=!1)}let q=0;function X(e){const{deps:t}=e;if(t.length){for(let n=0;n{e&&e.forEach(e=>{e!==k&&a.add(e)})};if("clear"===t)o.forEach(l);else if("length"===n&&_(e))o.forEach((e,t)=>{("length"===t||t>=i)&&l(e)});else{void 0!==n&&l(o.get(n));const i="add"===t||"delete"===t&&!_(e);(i||"set"===t&&e instanceof Map)&&l(o.get(_(e)?"length":H)),i&&e instanceof Map&&l(o.get(V))}a.forEach(e=>{e.options.scheduler?e.options.scheduler(e):e()})}const ee=new Set(Object.getOwnPropertyNames(Symbol).map(e=>Symbol[e]).filter(M)),te=oe(),ne=oe(!1,!0),ie=oe(!0),re=oe(!0,!0),se={};function oe(e=!1,t=!1){return function(n,i,r){if("__v_isReactive"===i)return!e;if("__v_isReadonly"===i)return e;if("__v_raw"===i&&r===(e?Oe:Ie).get(n))return n;const s=_(n);if(s&&x(se,i))return Reflect.get(se,i,r);const o=Reflect.get(n,i,r),a=M(i);if(a?ee.has(i):"__proto__"===i||"__v_isRef"===i)return o;if(e||Q(n,0,i),t)return o;if(je(o)){return!s||a||""+parseInt(i,10)!==i?o.value:o}return S(o)?e?Be(o):Ue(o):o}}["includes","indexOf","lastIndexOf"].forEach(e=>{se[e]=function(...t){const n=Ve(this);for(let e=0,t=this.length;e!0,deleteProperty:(e,t)=>!0},de=g({},he,{get:ne,set:ae(!0)}),pe=(g({},ue,{get:re}),e=>S(e)?Ue(e):e),fe=e=>S(e)?Be(e):e,me=e=>e,ge=e=>Reflect.getPrototypeOf(e);function ve(e,t,n=!1,i=!1){const r=Ve(e=e.__v_raw),s=Ve(t);t!==s&&!n&&Q(r,0,t),!n&&Q(r,0,s);const{has:o}=ge(r),a=n?fe:i?me:pe;return o.call(r,t)?a(e.get(t)):o.call(r,s)?a(e.get(s)):void 0}function ye(e,t=!1){const n=this.__v_raw,i=Ve(n),r=Ve(e);return e!==r&&!t&&Q(i,0,e),!t&&Q(i,0,r),n.has(e)||n.has(r)}function xe(e,t=!1){return e=e.__v_raw,!t&&Q(Ve(e),0,H),Reflect.get(e,"size",e)}function _e(e){e=Ve(e);const t=Ve(this),n=ge(t),i=n.has.call(t,e),r=n.add.call(t,e);return i||$(t,"add",e,e),r}function be(e,t){t=Ve(t);const n=Ve(this),{has:i,get:r,set:s}=ge(n);let o=i.call(n,e);o||(e=Ve(e),o=i.call(n,e));const a=r.call(n,e),l=s.call(n,e,t);return o?z(t,a)&&$(n,"set",e,t):$(n,"add",e,t),l}function we(e){const t=Ve(this),{has:n,get:i,delete:r}=ge(t);let s=n.call(t,e);s||(e=Ve(e),s=n.call(t,e));i&&i.call(t,e);const o=r.call(t,e);return s&&$(t,"delete",e,void 0),o}function Me(){const e=Ve(this),t=0!==e.size,n=ge(e).clear.call(e);return t&&$(e,"clear",void 0,void 0),n}function Se(e,t){return function(n,i){const r=this,s=r.__v_raw,o=Ve(s),a=e?fe:t?me:pe;return!e&&Q(o,0,H),s.forEach((e,t)=>n.call(i,a(e),a(t),r))}}function Te(e,t,n){return function(...i){const r=this.__v_raw,s=Ve(r),o=s instanceof Map,a="entries"===e||e===Symbol.iterator&&o,l="keys"===e&&o,c=r[e](...i),h=t?fe:n?me:pe;return!t&&Q(s,0,l?V:H),{next(){const{value:e,done:t}=c.next();return t?{value:e,done:t}:{value:a?[h(e[0]),h(e[1])]:h(e),done:t}},[Symbol.iterator](){return this}}}}function Ee(e){return function(...t){return"delete"!==e&&this}}const Ae={get(e){return ve(this,e)},get size(){return xe(this)},has:ye,add:_e,set:be,delete:we,clear:Me,forEach:Se(!1,!1)},Ce={get(e){return ve(this,e,!1,!0)},get size(){return xe(this)},has:ye,add:_e,set:be,delete:we,clear:Me,forEach:Se(!1,!0)},Le={get(e){return ve(this,e,!0)},get size(){return xe(this,!0)},has(e){return ye.call(this,e,!0)},add:Ee("add"),set:Ee("set"),delete:Ee("delete"),clear:Ee("clear"),forEach:Se(!0,!1)};function Re(e,t){const n=t?Ce:e?Le:Ae;return(t,i,r)=>"__v_isReactive"===i?!e:"__v_isReadonly"===i?e:"__v_raw"===i?t:Reflect.get(x(n,i)&&i in t?n:t,i,r)}["keys","values","entries",Symbol.iterator].forEach(e=>{Ae[e]=Te(e,!1,!1),Le[e]=Te(e,!0,!1),Ce[e]=Te(e,!1,!0)});const Pe={get:Re(!1,!1)},Ne={get:Re(!1,!0)},De={get:Re(!0,!1)},Ie=new WeakMap,Oe=new WeakMap;function ze(e){return e.__v_skip||!Object.isExtensible(e)?0:function(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}((e=>A(e).slice(8,-1))(e))}function Ue(e){return e&&e.__v_isReadonly?e:Fe(e,!1,he,Pe)}function Be(e){return Fe(e,!0,ue,De)}function Fe(e,t,n,i){if(!S(e))return e;if(e.__v_raw&&(!t||!e.__v_isReactive))return e;const r=t?Oe:Ie,s=r.get(e);if(s)return s;const o=ze(e);if(0===o)return e;const a=new Proxy(e,2===o?i:n);return r.set(e,a),a}function Ge(e){return ke(e)?Ge(e.__v_raw):!(!e||!e.__v_isReactive)}function ke(e){return!(!e||!e.__v_isReadonly)}function He(e){return Ge(e)||ke(e)}function Ve(e){return e&&Ve(e.__v_raw)||e}function je(e){return Boolean(e&&!0===e.__v_isRef)}const We={get:(e,t,n)=>{return je(i=Reflect.get(e,t,n))?i.value:i;var i},set:(e,t,n,i)=>{const r=e[t];return je(r)&&!je(n)?(r.value=n,!0):Reflect.set(e,t,n,i)}};class qe{constructor(e,t){this._object=e,this._key=t,this.__v_isRef=!0}get value(){return this._object[this._key]}set value(e){this._object[this._key]=e}}class Xe{constructor(e,t,n){this._setter=t,this._dirty=!0,this.__v_isRef=!0,this.effect=j(e,{lazy:!0,scheduler:()=>{this._dirty||(this._dirty=!0,$(Ve(this),"set","value"))}}),this.__v_isReadonly=n}get value(){return this._dirty&&(this._value=this.effect(),this._dirty=!1),Q(Ve(this),0,"value"),this._value}set value(e){this._setter(e)}}function Ye(e,t,n,i){let r;try{r=i?e(...i):e()}catch(e){Je(e,t,n)}return r}function Ze(e,t,n,i){if(b(e)){const r=Ye(e,t,n,i);return r&&T(r)&&r.catch(e=>{Je(e,t,n)}),r}const r=[];for(let s=0;sgt(e)-gt(t)),ot=0;otnull==e.id?1/0:e.id;function vt(e){Qe=!1,Ke=!0,ft(e),$e.sort((e,t)=>gt(e)-gt(t));try{for(et=0;et<$e.length;et++){const e=$e[et];e&&Ye(e,null,14)}}finally{et=0,$e.length=0,mt(),Ke=!1,lt=null,($e.length||rt.length)&&vt(e)}}let yt=null;function xt(e){yt=e}function _t(e){const{type:t,parent:n,vnode:i,proxy:r,withProxy:s,props:o,slots:a,attrs:l,emit:c,render:h,renderCache:u,data:d,setupState:p,ctx:f}=e;let g;yt=e;try{let e;if(4&i.shapeFlag){const t=s||r;g=Yt(h.call(t,t,u,o,p,d,f)),e=l}else{const n=t;0,g=Yt(n.length>1?n(o,{attrs:l,slots:a,emit:c}):n(o,null)),e=t.props?l:bt(l)}let v=g;if(!1!==t.inheritAttrs&&e){const t=Object.keys(e),{shapeFlag:n}=v;t.length&&(1&n||6&n)&&(1&n&&t.some(m)&&(e=wt(e)),v=Wt(v,e))}const y=i.scopeId,x=y&&v.scopeId!==y,_=n&&n.type.__scopeId,b=_&&_!==y?_+"-s":null;if(x||b){const e={};x&&(e[y]=""),b&&(e[b]=""),v=Wt(v,e)}i.dirs&&(v.dirs=i.dirs),i.transition&&(v.transition=i.transition),g=v}catch(t){Je(t,e,1),g=jt(Dt)}return yt=null,g}const bt=e=>{let t;for(const n in e)("class"===n||"style"===n||f(n))&&((t||(t={}))[n]=e[n]);return t},wt=e=>{const t={};for(const n in e)m(n)||(t[n]=e[n]);return t};function Mt(e,t){const n=Object.keys(t);if(n.length!==Object.keys(e).length)return!0;for(let i=0;inull!=e?e:null,Vt=({ref:e})=>null!=e?_(e)?e:[yt,e]:null,jt=function(e,t=null,n=null,r=0,s=null,o=!1){e&&e!==Ct||(e=Dt);if(Gt(e)){const i=Wt(e,t);return n&&Jt(i,n),i}b(e)&&"__vccOpts"in e&&(e=e.__vccOpts);if(t){(He(t)||"__vInternal"in t)&&(t=g({},t));let{class:e,style:n}=t;e&&!w(e)&&(t.class=a(e)),S(n)&&(He(n)&&!_(n)&&(n=g({},n)),t.style=i(n))}const l=w(e)?1:(e=>e.__isSuspense)(e)?128:(e=>e.__isTeleport)(e)?64:S(e)?4:b(e)?2:0,c={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Ht(t),ref:t&&Vt(t),scopeId:null,children:null,component:null,suspense:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:l,patchFlag:r,dynamicProps:s,dynamicChildren:null,appContext:null};Jt(c,n),!o&&zt&&(r>0||6&l)&&32!==r&&zt.push(c);return c};function Wt(e,t){const{props:n,patchFlag:r}=e,s=t?n?function(...e){const t=g({},e[0]);for(let n=1;ng(i,e(t))))),n||r?(_(n)?n.forEach(e=>i[e]=null):g(i,n),t.__emits=i):t.__emits=void 0}(e)))&&(t=t.replace(/Once$/,""),x(n,t[2].toLowerCase()+t.slice(3))||x(n,t.slice(2)))}function $t(e,t,n,i=!1){const r={},s={};B(s,"__vInternal",1),en(e,t,r,s),n?e.props=i?r:Fe(r,!1,de,Ne):e.type.props?e.props=r:e.props=s,e.attrs=s}function en(e,t,n,i){const[r,s]=nn(e.type);if(t)for(const s in t){const o=t[s];if(L(s))continue;let a;r&&x(r,a=N(s))?n[a]=o:Qt(e.type,s)||(i[s]=o)}if(s){const e=Ve(n);for(let t=0;t{const[t,r]=nn(e);g(n,t),r&&i.push(...r)};e.extends&&(r=!0,t(e.extends)),e.mixins&&(r=!0,e.mixins.forEach(t))}if(!t&&!r)return e.__props=h;if(_(t))for(let e=0;e-1,o[1]=t<0||e-1||x(o,"default"))&&i.push(r)}}}const s=[n,i];return e.__props=s,s}function rn(e){const t=e&&e.toString().match(/^\s*function (\w+)/);return t?t[1]:""}function sn(e,t){return rn(e)===rn(t)}function on(e,t){if(_(t)){for(let n=0,i=t.length;n{if(n.isUnmounted)return;J(),ti(n);const r=Ze(t,n,e,i);return ti(null),K(),r});return i?r.unshift(s):r.push(s),s}}const cn=e=>(t,n=ei)=>!ni&&ln(e,t,n),hn=cn("bm"),un=cn("m"),dn=cn("bu"),pn=cn("u"),fn=cn("bum"),mn=cn("um"),gn=cn("rtg"),vn=cn("rtc"),yn=e=>e.type.__isKeepAlive;function xn(e,t,n=ei){const i=e.__wdc||(e.__wdc=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}e()});if(ln(t,i,n),n){let e=n.parent;for(;e&&e.parent;)yn(e.parent.vnode)&&_n(i,t,n,e),e=e.parent}}function _n(e,t,n,i){const r=ln(t,e,i,!0);mn(()=>{v(i[t],r)},n)}const bn=e=>"_"===e[0]||"$stable"===e,wn=e=>_(e)?e.map(Yt):[Yt(e)],Mn=(e,t,n)=>Et(e=>wn(t(e)),n),Sn=(e,t)=>{const n=e._ctx;for(const i in e){if(bn(i))continue;const r=e[i];if(b(r))t[i]=Mn(0,r,n);else if(null!=r){const e=wn(r);t[i]=()=>e}}},Tn=(e,t)=>{const n=wn(t);e.slots.default=()=>n};function En(e,t,n,i){const r=e.dirs,s=t&&t.dirs;for(let o=0;o(s.has(e)||(e&&b(e.install)?(s.add(e),e.install(a,...t)):b(e)&&(s.add(e),e(a,...t))),a),mixin:e=>(r.mixins.includes(e)||r.mixins.push(e),a),component:(e,t)=>t?(r.components[e]=t,a):r.components[e],directive:(e,t)=>t?(r.directives[e]=t,a):r.directives[e],mount(s,l){if(!o){const c=jt(n,i);return c.appContext=r,l&&t?t(c,s):e(c,s),o=!0,a._container=s,s.__vue_app__=a,c.component.proxy}},unmount(){o&&e(null,a._container)},provide:(e,t)=>(r.provides[e]=t,a)};return a}}const Ln={scheduler:ut},Rn=function(e,t){t&&!t.isResolved?_(e)?t.effects.push(...e):t.effects.push(e):pt(e,st,rt,ot)},Pn=(e,t,n,i,r)=>{let s;s=r?4&r.shapeFlag?r.component.proxy:r.el:null;const[o,a]=e,l=t&&t[1],h=o.refs===c?o.refs={}:o.refs,u=o.setupState;if(null!=l&&l!==a&&(w(l)?(h[l]=null,x(u,l)&&(u[l]=null)):je(l)&&(l.value=null)),w(a)){const e=()=>{h[a]=s,x(u,a)&&(u[a]=s)};s?(e.id=-1,Rn(e,i)):e()}else if(je(a)){const e=()=>{a.value=s};s?(e.id=-1,Rn(e,i)):e()}else b(a)&&Ye(a,n,12,[s,h])};function Nn(e){return function(e,t){const{insert:n,remove:i,patchProp:r,forcePatchProp:s,createElement:o,createText:a,createComment:l,setText:d,setElementText:p,parentNode:f,nextSibling:m,setScopeId:v=u,cloneNode:y,insertStaticContent:_}=e,b=(e,t,n,i=null,r=null,s=null,o=!1,a=!1)=>{e&&!kt(e,t)&&(i=ie(e),Z(e,r,s,!0),e=null),-2===t.patchFlag&&(a=!1,t.dynamicChildren=null);const{type:l,ref:c,shapeFlag:h}=t;switch(l){case Nt:w(e,t,n,i);break;case Dt:M(e,t,n,i);break;case It:null==e&&S(t,n,i,o);break;case Pt:O(e,t,n,i,r,s,o,a);break;default:1&h?E(e,t,n,i,r,s,o,a):6&h?z(e,t,n,i,r,s,o,a):(64&h||128&h)&&l.process(e,t,n,i,r,s,o,a,se)}null!=c&&r&&Pn(c,e&&e.ref,r,s,t)},w=(e,t,i,r)=>{if(null==e)n(t.el=a(t.children),i,r);else{const n=t.el=e.el;t.children!==e.children&&d(n,t.children)}},M=(e,t,i,r)=>{null==e?n(t.el=l(t.children||""),i,r):t.el=e.el},S=(e,t,n,i)=>{[e.el,e.anchor]=_(e.children,t,n,i)},E=(e,t,n,i,r,s,o,a)=>{o=o||"svg"===t.type,null==e?A(t,n,i,r,s,o,a):R(e,t,r,s,o,a)},A=(e,t,i,s,a,l,c)=>{let h,u;const{type:d,props:f,shapeFlag:m,transition:g,scopeId:x,patchFlag:_,dirs:b}=e;if(e.el&&void 0!==y&&-1===_)h=e.el=y(e.el);else{if(h=e.el=o(e.type,l,f&&f.is),8&m?p(h,e.children):16&m&&C(e.children,h,null,s,a,l&&"foreignObject"!==d,c||!!e.dynamicChildren),b&&En(e,null,s,"created"),f){for(const t in f)L(t)||r(h,t,null,f[t],l,e.children,s,a,ne);(u=f.onVnodeBeforeMount)&&Dn(u,s,e)}x&&v(h,x);const t=s&&s.type.__scopeId;t&&t!==x&&v(h,t+"-s")}b&&En(e,null,s,"beforeMount");const w=(!a||a&&a.isResolved)&&g&&!g.persisted;w&&g.beforeEnter(h),n(h,t,i),((u=f&&f.onVnodeMounted)||w||b)&&Rn(()=>{u&&Dn(u,s,e),w&&g.enter(h),b&&En(e,null,s,"mounted")},a)},C=(e,t,n,i,r,s,o,a=0)=>{for(let l=a;l{const l=t.el=e.el;let{patchFlag:h,dynamicChildren:u,dirs:d}=t;h|=16&e.patchFlag;const f=e.props||c,m=t.props||c;let g;if((g=m.onVnodeBeforeUpdate)&&Dn(g,n,t,e),d&&En(t,e,n,"beforeUpdate"),h>0){if(16&h)D(l,t,f,m,n,i,o);else if(2&h&&f.class!==m.class&&r(l,"class",null,m.class,o),4&h&&r(l,"style",f.style,m.style,o),8&h){const a=t.dynamicProps;for(let t=0;t{g&&Dn(g,n,t,e),d&&En(t,e,n,"updated")},i)},P=(e,t,n,i,r,s)=>{for(let o=0;o{if(n!==i){for(const c in i){if(L(c))continue;const h=i[c],u=n[c];(h!==u||s&&s(e,c))&&r(e,c,u,h,l,t.children,o,a,ne)}if(n!==c)for(const s in n)L(s)||s in i||r(e,s,n[s],null,l,t.children,o,a,ne)}},O=(e,t,i,r,s,o,l,c)=>{const h=t.el=e?e.el:a(""),u=t.anchor=e?e.anchor:a("");let{patchFlag:d,dynamicChildren:p}=t;d>0&&(c=!0),null==e?(n(h,i,r),n(u,i,r),C(t.children,i,u,s,o,l,c)):d>0&&64&d&&p?P(e.dynamicChildren,p,i,s,o,l):V(e,t,i,u,s,o,l,c)},z=(e,t,n,i,r,s,o,a)=>{null==e?512&t.shapeFlag?r.ctx.activate(t,n,i,o,a):F(t,n,i,r,s,o,a):G(e,t,a)},F=(e,t,n,i,r,s,o)=>{const a=e.component=function(e,t,n){const i=e.type,r=(t?t.appContext:e.appContext)||Qn,s={uid:$n++,vnode:e,type:i,parent:t,appContext:r,root:null,next:null,subTree:null,update:null,render:null,proxy:null,withProxy:null,effects:null,provides:t?t.provides:Object.create(r.provides),accessCache:null,renderCache:[],ctx:c,data:c,props:c,attrs:c,slots:c,refs:c,setupState:c,setupContext:null,suspense:n,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,emit:null,emitted:null};return s.ctx={_:s},s.root=t?t.root:s,s.emit=Kt.bind(null,s),s}(e,i,r);if(yn(e)&&(a.ctx.renderer=se),function(e,t=!1){ni=t;const{props:n,children:i,shapeFlag:r}=e.vnode,s=4&r;$t(e,n,s,t),((e,t)=>{if(32&e.vnode.shapeFlag){const n=t._;n?(e.slots=t,B(t,"_",n)):Sn(t,e.slots={})}else e.slots={},t&&Tn(e,t);B(e.slots,"__vInternal",1)})(e,i);const o=s?function(e,t){const n=e.type;e.accessCache={},e.proxy=new Proxy(e.ctx,Jn);const{setup:i}=n;if(i){const n=e.setupContext=i.length>1?function(e){return{attrs:e.attrs,slots:e.slots,emit:e.emit}}(e):null;ei=e,J();const r=Ye(i,e,0,[e.props,n]);if(K(),ei=null,T(r)){if(t)return r.then(t=>{ii(e,t)});e.asyncDep=r}else ii(e,r)}else ri(e)}(e,t):void 0;ni=!1}(a),a.asyncDep){if(!r)return;if(r.registerDep(a,k),!e.el){const e=a.subTree=jt(Dt);M(null,e,t,n)}}else k(a,e,t,n,r,s,o)},G=(e,t,n)=>{const i=t.component=e.component;if(function(e,t,n){const{props:i,children:r}=e,{props:s,children:o,patchFlag:a}=t;if(t.dirs||t.transition)return!0;if(!(n&&a>0))return!(!r&&!o||o&&o.$stable)||i!==s&&(i?!s||Mt(i,s):!!s);if(1024&a)return!0;if(16&a)return i?Mt(i,s):!!s;if(8&a){const e=t.dynamicProps;for(let t=0;t-1&&($e[t]=null)}(i.update),i.update()}else t.component=e.component,t.el=e.el,i.vnode=t},k=(e,t,n,i,r,s,o)=>{e.update=j((function(){if(e.isMounted){let t,{next:n,bu:i,u:a,parent:l,vnode:h}=e,u=n;n?H(e,n,o):n=h,n.el=h.el,i&&U(i),(t=n.props&&n.props.onVnodeBeforeUpdate)&&Dn(t,l,n,h);const d=_t(e),p=e.subTree;e.subTree=d,e.refs!==c&&(e.refs={}),b(p,d,f(p.el),ie(p),e,r,s),n.el=d.el,null===u&&function({vnode:e,parent:t},n){for(;t&&t.subTree===e;)(e=t.vnode).el=n,t=t.parent}(e,d.el),a&&Rn(a,r),(t=n.props&&n.props.onVnodeUpdated)&&Rn(()=>{Dn(t,l,n,h)},r)}else{let o;const{el:a,props:l}=t,{bm:c,m:h,parent:u}=e;c&&U(c),(o=l&&l.onVnodeBeforeMount)&&Dn(o,u,t);const d=e.subTree=_t(e);a&&ae?ae(t.el,d,e,r):(b(null,d,n,i,e,r,s),t.el=d.el),h&&Rn(h,r),(o=l&&l.onVnodeMounted)&&Rn(()=>{Dn(o,u,t)},r);const{a:p}=e;p&&256&t.shapeFlag&&Rn(p,r),e.isMounted=!0}}),Ln),e.update.allowRecurse=!0},H=(e,t,n)=>{t.component=e;const i=e.vnode.props;e.vnode=t,e.next=null,function(e,t,n,i){const{props:r,attrs:s,vnode:{patchFlag:o}}=e,a=Ve(r),[l]=nn(e.type);if(!(i||o>0)||16&o){let i;en(e,t,r,s);for(const e in a)t&&(x(t,e)||(i=I(e))!==e&&x(t,i))||(l?!n||void 0===n[e]&&void 0===n[i]||(r[e]=tn(l,t||c,e,void 0)):delete r[e]);if(s!==a)for(const e in s)t&&x(t,e)||delete s[e]}else if(8&o){const n=e.vnode.dynamicProps;for(let e=0;e{const{vnode:n,slots:i}=e;let r=!0,s=c;if(32&n.shapeFlag){const e=t._;e?1===e?r=!1:g(i,t):(r=!t.$stable,Sn(t,i)),s=t}else t&&(Tn(e,t),s={default:1});if(r)for(const e in i)bn(e)||e in s||delete i[e]})(e,t.children),ft(void 0,e.update)},V=(e,t,n,i,r,s,o,a=!1)=>{const l=e&&e.children,c=e?e.shapeFlag:0,h=t.children,{patchFlag:u,shapeFlag:d}=t;if(u>0){if(128&u)return void X(l,h,n,i,r,s,o,a);if(256&u)return void q(l,h,n,i,r,s,o,a)}8&d?(16&c&&ne(l,r,s),h!==l&&p(n,h)):16&c?16&d?X(l,h,n,i,r,s,o,a):ne(l,r,s,!0):(8&c&&p(n,""),16&d&&C(h,n,i,r,s,o,a))},q=(e,t,n,i,r,s,o,a)=>{t=t||h;const l=(e=e||h).length,c=t.length,u=Math.min(l,c);let d;for(d=0;dc?ne(e,r,s,!0,u):C(t,n,i,r,s,o,a,u)},X=(e,t,n,i,r,s,o,a)=>{let l=0;const c=t.length;let u=e.length-1,d=c-1;for(;l<=u&&l<=d;){const i=e[l],c=t[l]=a?Zt(t[l]):Yt(t[l]);if(!kt(i,c))break;b(i,c,n,null,r,s,o,a),l++}for(;l<=u&&l<=d;){const i=e[u],l=t[d]=a?Zt(t[d]):Yt(t[d]);if(!kt(i,l))break;b(i,l,n,null,r,s,o,a),u--,d--}if(l>u){if(l<=d){const e=d+1,h=ed)for(;l<=u;)Z(e[l],r,s,!0),l++;else{const p=l,f=l,m=new Map;for(l=f;l<=d;l++){const e=t[l]=a?Zt(t[l]):Yt(t[l]);null!=e.key&&m.set(e.key,l)}let g,v=0;const y=d-f+1;let x=!1,_=0;const w=new Array(y);for(l=0;l=y){Z(i,r,s,!0);continue}let c;if(null!=i.key)c=m.get(i.key);else for(g=f;g<=d;g++)if(0===w[g-f]&&kt(i,t[g])){c=g;break}void 0===c?Z(i,r,s,!0):(w[c-f]=l+1,c>=_?_=c:x=!0,b(i,t[c],n,null,r,s,o,a),v++)}const M=x?function(e){const t=e.slice(),n=[0];let i,r,s,o,a;const l=e.length;for(i=0;i0&&(t[i]=n[s-1]),n[s]=i)}}s=n.length,o=n[s-1];for(;s-- >0;)n[s]=o,o=t[o];return n}(w):h;for(g=M.length-1,l=y-1;l>=0;l--){const e=f+l,a=t[e],h=e+1{const{el:o,type:a,transition:l,children:c,shapeFlag:h}=e;if(6&h)return void Y(e.component.subTree,t,i,r);if(128&h)return void e.suspense.move(t,i,r);if(64&h)return void a.move(e,t,i,se);if(a===Pt){n(o,t,i);for(let e=0;el.enter(o),s);else{const{leave:e,delayLeave:r,afterLeave:s}=l,a=()=>n(o,t,i),c=()=>{e(o,()=>{a(),s&&s()})};r?r(o,a,c):c()}else n(o,t,i)},Z=(e,t,n,i=!1)=>{const{type:r,props:s,ref:o,children:a,dynamicChildren:l,shapeFlag:c,patchFlag:h,dirs:u}=e;if(null!=o&&t&&Pn(o,null,t,n,null),256&c)return void t.ctx.deactivate(e);const d=1&c&&u;let p;if((p=s&&s.onVnodeBeforeUnmount)&&Dn(p,t,e),6&c)te(e.component,n,i);else{if(128&c)return void e.suspense.unmount(n,i);d&&En(e,null,t,"beforeUnmount"),l&&(r!==Pt||h>0&&64&h)?ne(l,t,n):16&c&&ne(a,t,n),64&c&&e.type.remove(e,se),i&&Q(e)}((p=s&&s.onVnodeUnmounted)||d)&&Rn(()=>{p&&Dn(p,t,e),d&&En(e,null,t,"unmounted")},n)},Q=e=>{const{type:t,el:n,anchor:r,transition:s}=e;if(t===Pt)return void ee(n,r);const o=()=>{i(n),s&&!s.persisted&&s.afterLeave&&s.afterLeave()};if(1&e.shapeFlag&&s&&!s.persisted){const{leave:t,delayLeave:i}=s,r=()=>t(n,o);i?i(e.el,o,r):r()}else o()},ee=(e,t)=>{let n;for(;e!==t;)n=m(e),i(e),e=n;i(t)},te=(e,t,n)=>{const{bum:i,effects:r,update:s,subTree:o,um:a,da:l,isDeactivated:c}=e;if(i&&U(i),r)for(let e=0;e{e.isUnmounted=!0},t),!t||t.isResolved||t.isUnmounted||!e.asyncDep||e.asyncResolved||(t.deps--,0===t.deps&&t.resolve())},ne=(e,t,n,i=!1,r=0)=>{for(let s=r;s6&e.shapeFlag?ie(e.component.subTree):128&e.shapeFlag?e.suspense.next():m(e.anchor||e.el),re=(e,t)=>{null==e?t._vnode&&Z(t._vnode,null,null,!0):b(t._vnode||null,e,t),mt(),t._vnode=e},se={p:b,um:Z,m:Y,r:Q,mt:F,mc:C,pc:V,pbc:P,n:ie,o:e};let oe,ae;t&&([oe,ae]=t(se));return{render:re,hydrate:oe,createApp:Cn(re,oe)}}(e)}function Dn(e,t,n,i=null){Ze(e,t,7,[n,i])}const In={};function On(e,t,n){return zn(e,t,n)}function zn(e,t,{immediate:n,deep:i,flush:r,onTrack:s,onTrigger:o}=c,a=ei){let l;const h=je(e);if(h?l=()=>e.value:Ge(e)?(l=()=>e,i=!0):l=_(e)?()=>e.map(e=>je(e)?e.value:Ge(e)?Bn(e):b(e)?Ye(e,a,2):void 0):b(e)?t?()=>Ye(e,a,2):()=>{if(!a||!a.isUnmounted)return d&&d(),Ye(e,a,3,[p])}:u,t&&i){const e=l;l=()=>Bn(e())}let d;const p=e=>{d=y.options.onStop=()=>{Ye(e,a,4)}};let f=_(e)?[]:In;const m=()=>{if(y.active)if(t){const e=y();(i||h||z(e,f))&&(d&&d(),Ze(t,a,3,[e,f===In?void 0:f,p]),f=e)}else y()};let g;m.allowRecurse=!!t,"sync"===r?g=m:"pre"===r?(m.id=-1,g=()=>{!a||a.isMounted?function(e){pt(e,nt,tt,it)}(m):m()}):g=()=>Rn(m,a&&a.suspense);const y=j(l,{lazy:!0,onTrack:s,onTrigger:o,scheduler:g});return si(y),t?n?m():f=y():y(),()=>{W(y),a&&v(a.effects,y)}}function Un(e,t,n){const i=this.proxy;return zn(w(e)?()=>i[e]:e.bind(i),t.bind(i),n,this)}function Bn(e,t=new Set){if(!S(e)||t.has(e))return e;if(t.add(e),je(e))Bn(e.value,t);else if(_(e))for(let n=0;n{Bn(e.get(i),t)});else if(e instanceof Set)e.forEach(e=>{Bn(e,t)});else for(const n in e)Bn(e[n],t);return e}function Fn(e,t){if(ei){let n=ei.provides;const i=ei.parent&&ei.parent.provides;i===n&&(n=ei.provides=Object.create(i)),n[e]=t}else;}function Gn(e,t){const n=ei||yt;if(n){const i=n.provides;if(e in i)return i[e];if(arguments.length>1)return t}}let kn=!1;function Hn(e,t,n=[],i=[],r=!1){const{mixins:s,extends:o,data:a,computed:l,methods:c,watch:h,provide:d,inject:p,beforeMount:f,mounted:m,beforeUpdate:g,updated:v,activated:y,deactivated:x,beforeUnmount:w,unmounted:M,render:T,renderTracked:E,renderTriggered:A,errorCaptured:C}=t,L=e.proxy,R=e.ctx,P=e.appContext.mixins;if(r&&T&&e.render===u&&(e.render=T),r||(kn=!0,Vn("beforeCreate",t,L,P),kn=!1,Wn(e,P,n,i)),o&&Hn(e,o,n,i,!0),s&&Wn(e,s,n,i),p)if(_(p))for(let e=0;eqn(e,t,L)),a&&qn(e,a,L)),l)for(const e in l){const t=l[e],n=oi({get:b(t)?t.bind(L,L):b(t.get)?t.get.bind(L,L):u,set:!b(t)&&b(t.set)?t.set.bind(L):u});Object.defineProperty(R,e,{enumerable:!0,configurable:!0,get:()=>n.value,set:e=>n.value=e})}if(h&&i.push(h),!r&&i.length&&i.forEach(e=>{for(const t in e)Xn(e[t],R,L,t)}),d){const e=b(d)?d.call(L):d;for(const t in e)Fn(t,e[t])}var N;r||Vn("created",t,L,P),f&&hn(f.bind(L)),m&&un(m.bind(L)),g&&dn(g.bind(L)),v&&pn(v.bind(L)),y&&xn(y.bind(L),"a",N),x&&function(e,t){xn(e,"da",t)}(x.bind(L)),C&&((e,t=ei)=>{ln("ec",e,t)})(C.bind(L)),E&&vn(E.bind(L)),A&&gn(A.bind(L)),w&&fn(w.bind(L)),M&&mn(M.bind(L))}function Vn(e,t,n,i){jn(e,i,n);const r=t.extends&&t.extends[e];r&&r.call(n);const s=t.mixins;s&&jn(e,s,n);const o=t[e];o&&o.call(n)}function jn(e,t,n){for(let i=0;in[i];if(w(e)){const n=t[e];b(n)&&On(r,n)}else if(b(e))On(r,e.bind(n));else if(S(e))if(_(e))e.forEach(e=>Xn(e,t,n,i));else{const i=b(e.handler)?e.handler.bind(n):t[e.handler];b(i)&&On(r,i,e)}}function Yn(e,t,n){const i=n.appContext.config.optionMergeStrategies;for(const r in t)i&&x(i,r)?e[r]=i[r](e[r],t[r],n.proxy,r):x(e,r)||(e[r]=t[r])}const Zn=g(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>e.parent&&e.parent.proxy,$root:e=>e.root&&e.root.proxy,$emit:e=>e.emit,$options:e=>function(e){const t=e.type,{__merged:n,mixins:i,extends:r}=t;if(n)return n;const s=e.appContext.mixins;if(!s.length&&!i&&!r)return t;const o={};return s.forEach(t=>Yn(o,t,e)),r&&Yn(o,r,e),i&&i.forEach(t=>Yn(o,t,e)),Yn(o,t,e),t.__merged=o}(e),$forceUpdate:e=>()=>ut(e.update),$nextTick:()=>ht,$watch:e=>Un.bind(e)}),Jn={get({_:e},t){const{ctx:n,setupState:i,data:r,props:s,accessCache:o,type:a,appContext:l}=e;if("__v_skip"===t)return!0;let h;if("$"!==t[0]){const e=o[t];if(void 0!==e)switch(e){case 0:return i[t];case 1:return r[t];case 3:return n[t];case 2:return s[t]}else{if(i!==c&&x(i,t))return o[t]=0,i[t];if(r!==c&&x(r,t))return o[t]=1,r[t];if((h=nn(a)[0])&&x(h,t))return o[t]=2,s[t];if(n!==c&&x(n,t))return o[t]=3,n[t];kn||(o[t]=4)}}const u=Zn[t];let d,p;return u?("$attrs"===t&&Q(e,0,t),u(e)):(d=a.__cssModules)&&(d=d[t])?d:n!==c&&x(n,t)?(o[t]=3,n[t]):(p=l.config.globalProperties,x(p,t)?p[t]:void 0)},set({_:e},t,n){const{data:i,setupState:r,ctx:s}=e;if(r!==c&&x(r,t))r[t]=n;else if(i!==c&&x(i,t))i[t]=n;else if(t in e.props)return!1;return("$"!==t[0]||!(t.slice(1)in e))&&(s[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:i,type:r,appContext:s}},o){let a;return void 0!==n[o]||e!==c&&x(e,o)||t!==c&&x(t,o)||(a=nn(r)[0])&&x(a,o)||x(i,o)||x(Zn,o)||x(s.config.globalProperties,o)}},Kn=g({},Jn,{get(e,t){if(t!==Symbol.unscopables)return Jn.get(e,t,e)},has:(e,n)=>"_"!==n[0]&&!t(n)}),Qn=An();let $n=0;let ei=null;const ti=e=>{ei=e};let ni=!1;function ii(e,t,n){var i;b(t)?e.render=t:S(t)&&(e.setupState=Ge(i=t)?i:new Proxy(i,We)),ri(e)}function ri(e,t){const n=e.type;e.render||(e.render=n.render||u,e.render._rc&&(e.withProxy=new Proxy(e.ctx,Kn))),ei=e,Hn(e,n),ei=null}function si(e){ei&&(ei.effects||(ei.effects=[])).push(e)}function oi(e){const t=function(e){let t,n;return b(e)?(t=e,n=u):(t=e.get,n=e.set),new Xe(t,n,b(e)||!e.set)}(e);return si(t.effect),t}function ai(e,t){let n;if(_(e)||w(e)){n=new Array(e.length);for(let i=0,r=e.length;i{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n)=>t?hi.createElementNS(ci,e):hi.createElement(e,n?{is:n}:void 0),createText:e=>hi.createTextNode(e),createComment:e=>hi.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>hi.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},cloneNode:e=>e.cloneNode(!0),insertStaticContent(e,t,n,i){const r=i?di||(di=hi.createElementNS(ci,"svg")):ui||(ui=hi.createElement("div"));r.innerHTML=e;const s=r.firstChild;let o=s,a=o;for(;o;)a=o,pi.insert(o,t,n),o=r.firstChild;return[s,a]}};const fi=/\s*!important$/;function mi(e,t,n){if(_(n))n.forEach(n=>mi(e,t,n));else if(t.startsWith("--"))e.setProperty(t,n);else{const i=function(e,t){const n=vi[t];if(n)return n;let i=N(t);if("filter"!==i&&i in e)return vi[t]=i;i=O(i);for(let n=0;ndocument.createEvent("Event").timeStamp&&(xi=()=>performance.now());let _i=0;const bi=Promise.resolve(),wi=()=>{_i=0};function Mi(e,t,n,i,r=null){const s=e._vei||(e._vei={}),o=s[t];if(i&&o)o.value=i;else{const[n,a]=function(e){let t;if(Si.test(e)){let n;for(t={};n=e.match(Si);)e=e.slice(0,e.length-n[0].length),t[n[0].toLowerCase()]=!0}return[e.slice(2).toLowerCase(),t]}(t);if(i){!function(e,t,n,i){e.addEventListener(t,n,i)}(e,n,s[t]=function(e,t){const n=e=>{(e.timeStamp||xi())>=n.attached-1&&Ze(function(e,t){if(_(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(e=>t=>!t._stopped&&e(t))}return t}(e,n.value),t,5,[e])};return n.value=e,n.attached=(()=>_i||(bi.then(wi),_i=xi()))(),n}(i,r),a)}else o&&(!function(e,t,n,i){e.removeEventListener(t,n,i)}(e,n,o,a),s[t]=void 0)}}const Si=/(?:Once|Passive|Capture)$/;const Ti=/^on[a-z]/;const Ei=g({patchProp:(e,t,i,r,s=!1,o,a,l,c)=>{switch(t){case"class":!function(e,t,n){if(null==t&&(t=""),n)e.setAttribute("class",t);else{const n=e._vtc;n&&(t=(t?[t,...n]:[...n]).join(" ")),e.className=t}}(e,r,s);break;case"style":!function(e,t,n){const i=e.style;if(n)if(w(n))t!==n&&(i.cssText=n);else{for(const e in n)mi(i,e,n[e]);if(t&&!w(t))for(const e in t)null==n[e]&&mi(i,e,"")}else e.removeAttribute("style")}(e,i,r);break;default:f(t)?m(t)||Mi(e,t,0,r,a):function(e,t,n,i){if(i)return"innerHTML"===t||!!(t in e&&Ti.test(t)&&b(n));if("spellcheck"===t||"draggable"===t)return!1;if("form"===t&&"string"==typeof n)return!1;if("list"===t&&"INPUT"===e.tagName)return!1;if(Ti.test(t)&&w(n))return!1;return t in e}(e,t,r,s)?function(e,t,n,i,r,s,o){if("innerHTML"===t||"textContent"===t)return i&&o(i,r,s),void(e[t]=null==n?"":n);if("value"!==t||"PROGRESS"===e.tagName)if(""===n&&"boolean"==typeof e[t])e[t]=!0;else if(null==n&&"string"==typeof e[t])e[t]="",e.removeAttribute(t);else try{e[t]=n}catch(e){}else{e._value=n;const t=null==n?"":n;e.value!==t&&(e.value=t)}}(e,t,r,o,a,l,c):("true-value"===t?e._trueValue=r:"false-value"===t&&(e._falseValue=r),function(e,t,i,r){if(r&&t.startsWith("xlink:"))null==i?e.removeAttributeNS(yi,t.slice(6,t.length)):e.setAttributeNS(yi,t,i);else{const r=n(t);null==i||r&&!1===i?e.removeAttribute(t):e.setAttribute(t,r?"":i)}}(e,t,r,s))}},forcePatchProp:(e,t)=>"value"===t},pi);let Ai;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");const t=Object(e);for(let e=1;e>8&255]+zi[e>>16&255]+zi[e>>24&255]+"-"+zi[255&t]+zi[t>>8&255]+"-"+zi[t>>16&15|64]+zi[t>>24&255]+"-"+zi[63&n|128]+zi[n>>8&255]+"-"+zi[n>>16&255]+zi[n>>24&255]+zi[255&i]+zi[i>>8&255]+zi[i>>16&255]+zi[i>>24&255]).toUpperCase()},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,i,r){return i+(e-t)*(r-i)/(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())},seededRandom:function(e){return void 0!==e&&(Ui=e%2147483647),Ui=16807*Ui%2147483647,(Ui-1)/2147483646},degToRad:function(e){return e*Bi.DEG2RAD},radToDeg:function(e){return e*Bi.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))},setQuaternionFromProperEuler:function(e,t,n,i,r){const s=Math.cos,o=Math.sin,a=s(n/2),l=o(n/2),c=s((t+i)/2),h=o((t+i)/2),u=s((t-i)/2),d=o((t-i)/2),p=s((i-t)/2),f=o((i-t)/2);switch(r){case"XYX":e.set(a*h,l*u,l*d,a*c);break;case"YZY":e.set(l*d,a*h,l*u,a*c);break;case"ZXZ":e.set(l*u,l*d,a*h,a*c);break;case"XZX":e.set(a*h,l*f,l*p,a*c);break;case"YXY":e.set(l*p,a*h,l*f,a*c);break;case"ZYZ":e.set(l*f,l*p,a*h,a*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}};class Fi{constructor(e=0,t=0){Object.defineProperty(this,"isVector2",{value:!0}),this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e,t){return 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(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e,t){return 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(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,n=this.y,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6],this.y=i[1]*t+i[4]*n+i[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this}toArray(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(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(e,t){const n=Math.cos(t),i=Math.sin(t),r=this.x-e.x,s=this.y-e.y;return this.x=r*n-s*i+e.x,this.y=r*i+s*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}}class Gi{constructor(){Object.defineProperty(this,"isMatrix3",{value:!0}),this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}set(e,t,n,i,r,s,o,a,l){const c=this.elements;return c[0]=e,c[1]=i,c[2]=o,c[3]=t,c[4]=r,c[5]=a,c[6]=n,c[7]=s,c[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}clone(){return(new this.constructor).fromArray(this.elements)}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,i=t.elements,r=this.elements,s=n[0],o=n[3],a=n[6],l=n[1],c=n[4],h=n[7],u=n[2],d=n[5],p=n[8],f=i[0],m=i[3],g=i[6],v=i[1],y=i[4],x=i[7],_=i[2],b=i[5],w=i[8];return r[0]=s*f+o*v+a*_,r[3]=s*m+o*y+a*b,r[6]=s*g+o*x+a*w,r[1]=l*f+c*v+h*_,r[4]=l*m+c*y+h*b,r[7]=l*g+c*x+h*w,r[2]=u*f+d*v+p*_,r[5]=u*m+d*y+p*b,r[8]=u*g+d*x+p*w,this}multiplyScalar(e){const 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(){const e=this.elements,t=e[0],n=e[1],i=e[2],r=e[3],s=e[4],o=e[5],a=e[6],l=e[7],c=e[8];return t*s*c-t*o*l-n*r*c+n*o*a+i*r*l-i*s*a}getInverse(e,t){void 0!==t&&console.warn("THREE.Matrix3: .getInverse() can no longer be configured to throw on degenerate.");const n=e.elements,i=this.elements,r=n[0],s=n[1],o=n[2],a=n[3],l=n[4],c=n[5],h=n[6],u=n[7],d=n[8],p=d*l-c*u,f=c*h-d*a,m=u*a-l*h,g=r*p+s*f+o*m;if(0===g)return this.set(0,0,0,0,0,0,0,0,0);const v=1/g;return i[0]=p*v,i[1]=(o*u-d*s)*v,i[2]=(c*s-o*l)*v,i[3]=f*v,i[4]=(d*r-o*h)*v,i[5]=(o*a-c*r)*v,i[6]=m*v,i[7]=(s*h-u*r)*v,i[8]=(l*r-s*a)*v,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).getInverse(this).transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,i,r,s,o){const a=Math.cos(r),l=Math.sin(r);this.set(n*a,n*l,-n*(a*s+l*o)+s+e,-i*l,i*a,-i*(-l*s+a*o)+o+t,0,0,1)}scale(e,t){const n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=t,n[4]*=t,n[7]*=t,this}rotate(e){const t=Math.cos(e),n=Math.sin(e),i=this.elements,r=i[0],s=i[3],o=i[6],a=i[1],l=i[4],c=i[7];return i[0]=t*r+n*a,i[3]=t*s+n*l,i[6]=t*o+n*c,i[1]=-n*r+t*a,i[4]=-n*s+t*l,i[7]=-n*o+t*c,this}translate(e,t){const n=this.elements;return n[0]+=e*n[2],n[3]+=e*n[5],n[6]+=e*n[8],n[1]+=t*n[2],n[4]+=t*n[5],n[7]+=t*n[8],this}equals(e){const t=this.elements,n=e.elements;for(let e=0;e<9;e++)if(t[e]!==n[e])return!1;return!0}fromArray(e,t){void 0===t&&(t=0);for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e,t){void 0===e&&(e=[]),void 0===t&&(t=0);const 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}}let ki;const Hi={getDataURL:function(e){if(/^data:/i.test(e.src))return e.src;if("undefined"==typeof HTMLCanvasElement)return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{void 0===ki&&(ki=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),ki.width=e.width,ki.height=e.height;const n=ki.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=ki}return t.width>2048||t.height>2048?t.toDataURL("image/jpeg",.6):t.toDataURL("image/png")}};let Vi=0;function ji(e,t,n,i,r,s,o,a,l,c){Object.defineProperty(this,"id",{value:Vi++}),this.uuid=Bi.generateUUID(),this.name="",this.image=void 0!==e?e:ji.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=void 0!==t?t:ji.DEFAULT_MAPPING,this.wrapS=void 0!==n?n:1001,this.wrapT=void 0!==i?i:1001,this.magFilter=void 0!==r?r:1006,this.minFilter=void 0!==s?s:1008,this.anisotropy=void 0!==l?l:1,this.format=void 0!==o?o:1023,this.internalFormat=null,this.type=void 0!==a?a:1009,this.offset=new Fi(0,0),this.repeat=new Fi(1,1),this.center=new Fi(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Gi,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=void 0!==c?c:3e3,this.version=0,this.onUpdate=null}ji.DEFAULT_IMAGE=void 0,ji.DEFAULT_MAPPING=300,ji.prototype=Object.assign(Object.create(Oi.prototype),{constructor:ji,isTexture:!0,updateMatrix:function(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)},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.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.encoding=e.encoding,this},toJSON:function(e){const t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.textures[this.uuid])return e.textures[this.uuid];const n={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(void 0!==this.image){const i=this.image;if(void 0===i.uuid&&(i.uuid=Bi.generateUUID()),!t&&void 0===e.images[i.uuid]){let t;if(Array.isArray(i)){t=[];for(let e=0,n=i.length;e1)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)}return this.flipY&&(e.y=1-e.y),e}}),Object.defineProperty(ji.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}});class Wi{constructor(e=0,t=0,n=0,i=1){Object.defineProperty(this,"isVector4",{value:!0}),this.x=e,this.y=t,this.z=n,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,i){return this.x=e,this.y=t,this.z=n,this.w=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this}add(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(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e,t){return 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(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,n=this.y,i=this.z,r=this.w,s=e.elements;return this.x=s[0]*t+s[4]*n+s[8]*i+s[12]*r,this.y=s[1]*t+s[5]*n+s[9]*i+s[13]*r,this.z=s[2]*t+s[6]*n+s[10]*i+s[14]*r,this.w=s[3]*t+s[7]*n+s[11]*i+s[15]*r,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,i,r;const s=e.elements,o=s[0],a=s[4],l=s[8],c=s[1],h=s[5],u=s[9],d=s[2],p=s[6],f=s[10];if(Math.abs(a-c)<.01&&Math.abs(l-d)<.01&&Math.abs(u-p)<.01){if(Math.abs(a+c)<.1&&Math.abs(l+d)<.1&&Math.abs(u+p)<.1&&Math.abs(o+h+f-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const e=(o+1)/2,s=(h+1)/2,m=(f+1)/2,g=(a+c)/4,v=(l+d)/4,y=(u+p)/4;return e>s&&e>m?e<.01?(n=0,i=.707106781,r=.707106781):(n=Math.sqrt(e),i=g/n,r=v/n):s>m?s<.01?(n=.707106781,i=0,r=.707106781):(i=Math.sqrt(s),n=g/i,r=y/i):m<.01?(n=.707106781,i=.707106781,r=0):(r=Math.sqrt(m),n=v/r,i=y/r),this.set(n,i,r,t),this}let m=Math.sqrt((p-u)*(p-u)+(l-d)*(l-d)+(c-a)*(c-a));return Math.abs(m)<.001&&(m=1),this.x=(p-u)/m,this.y=(l-d)/m,this.z=(c-a)/m,this.w=Math.acos((o+h+f-1)/2),this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){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(){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(){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(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(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(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(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}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}}function qi(e,t,n){this.width=e,this.height=t,this.scissor=new Wi(0,0,e,t),this.scissorTest=!1,this.viewport=new Wi(0,0,e,t),n=n||{},this.texture=new ji(void 0,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.encoding),this.texture.image={},this.texture.image.width=e,this.texture.image.height=t,this.texture.generateMipmaps=void 0!==n.generateMipmaps&&n.generateMipmaps,this.texture.minFilter=void 0!==n.minFilter?n.minFilter:1006,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 Xi(e,t,n){qi.call(this,e,t,n),this.samples=4}qi.prototype=Object.assign(Object.create(Oi.prototype),{constructor:qi,isWebGLRenderTarget:!0,setSize:function(e,t){this.width===e&&this.height===t||(this.width=e,this.height=t,this.texture.image.width=e,this.texture.image.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"})}}),Xi.prototype=Object.assign(Object.create(qi.prototype),{constructor:Xi,isWebGLMultisampleRenderTarget:!0,copy:function(e){return qi.prototype.copy.call(this,e),this.samples=e.samples,this}});class Yi{constructor(e=0,t=0,n=0,i=1){Object.defineProperty(this,"isQuaternion",{value:!0}),this._x=e,this._y=t,this._z=n,this._w=i}static slerp(e,t,n,i){return n.copy(e).slerp(t,i)}static slerpFlat(e,t,n,i,r,s,o){let a=n[i+0],l=n[i+1],c=n[i+2],h=n[i+3];const u=r[s+0],d=r[s+1],p=r[s+2],f=r[s+3];if(h!==f||a!==u||l!==d||c!==p){let e=1-o;const t=a*u+l*d+c*p+h*f,n=t>=0?1:-1,i=1-t*t;if(i>Number.EPSILON){const r=Math.sqrt(i),s=Math.atan2(r,t*n);e=Math.sin(e*s)/r,o=Math.sin(o*s)/r}const r=o*n;if(a=a*e+u*r,l=l*e+d*r,c=c*e+p*r,h=h*e+f*r,e===1-o){const e=1/Math.sqrt(a*a+l*l+c*c+h*h);a*=e,l*=e,c*=e,h*=e}}e[t]=a,e[t+1]=l,e[t+2]=c,e[t+3]=h}static multiplyQuaternionsFlat(e,t,n,i,r,s){const o=n[i],a=n[i+1],l=n[i+2],c=n[i+3],h=r[s],u=r[s+1],d=r[s+2],p=r[s+3];return e[t]=o*p+c*h+a*d-l*u,e[t+1]=a*p+c*u+l*h-o*d,e[t+2]=l*p+c*d+o*u-a*h,e[t+3]=c*p-o*h-a*u-l*d,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,i){return this._x=e,this._y=t,this._z=n,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t){if(!e||!e.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");const n=e._x,i=e._y,r=e._z,s=e._order,o=Math.cos,a=Math.sin,l=o(n/2),c=o(i/2),h=o(r/2),u=a(n/2),d=a(i/2),p=a(r/2);switch(s){case"XYZ":this._x=u*c*h+l*d*p,this._y=l*d*h-u*c*p,this._z=l*c*p+u*d*h,this._w=l*c*h-u*d*p;break;case"YXZ":this._x=u*c*h+l*d*p,this._y=l*d*h-u*c*p,this._z=l*c*p-u*d*h,this._w=l*c*h+u*d*p;break;case"ZXY":this._x=u*c*h-l*d*p,this._y=l*d*h+u*c*p,this._z=l*c*p+u*d*h,this._w=l*c*h-u*d*p;break;case"ZYX":this._x=u*c*h-l*d*p,this._y=l*d*h+u*c*p,this._z=l*c*p-u*d*h,this._w=l*c*h+u*d*p;break;case"YZX":this._x=u*c*h+l*d*p,this._y=l*d*h+u*c*p,this._z=l*c*p-u*d*h,this._w=l*c*h-u*d*p;break;case"XZY":this._x=u*c*h-l*d*p,this._y=l*d*h-u*c*p,this._z=l*c*p+u*d*h,this._w=l*c*h+u*d*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+s)}return!1!==t&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const n=t/2,i=Math.sin(n);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,n=t[0],i=t[4],r=t[8],s=t[1],o=t[5],a=t[9],l=t[2],c=t[6],h=t[10],u=n+o+h;if(u>0){const e=.5/Math.sqrt(u+1);this._w=.25/e,this._x=(c-a)*e,this._y=(r-l)*e,this._z=(s-i)*e}else if(n>o&&n>h){const e=2*Math.sqrt(1+n-o-h);this._w=(c-a)/e,this._x=.25*e,this._y=(i+s)/e,this._z=(r+l)/e}else if(o>h){const e=2*Math.sqrt(1+o-n-h);this._w=(r-l)/e,this._x=(i+s)/e,this._y=.25*e,this._z=(a+c)/e}else{const e=2*Math.sqrt(1+h-n-o);this._w=(s-i)/e,this._x=(r+l)/e,this._y=(a+c)/e,this._z=.25*e}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<1e-6?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Bi.clamp(this.dot(e),-1,1)))}rotateTowards(e,t){const n=this.angleTo(e);if(0===n)return this;const i=Math.min(1,t/n);return this.slerp(e,i),this}identity(){return this.set(0,0,0,1)}inverse(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return 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(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(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const n=e._x,i=e._y,r=e._z,s=e._w,o=t._x,a=t._y,l=t._z,c=t._w;return this._x=n*c+s*o+i*l-r*a,this._y=i*c+s*a+r*o-n*l,this._z=r*c+s*l+n*a-i*o,this._w=s*c-n*o-i*a-r*l,this._onChangeCallback(),this}slerp(e,t){if(0===t)return this;if(1===t)return this.copy(e);const n=this._x,i=this._y,r=this._z,s=this._w;let o=s*e._w+n*e._x+i*e._y+r*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=s,this._x=n,this._y=i,this._z=r,this;const a=1-o*o;if(a<=Number.EPSILON){const e=1-t;return this._w=e*s+t*this._w,this._x=e*n+t*this._x,this._y=e*i+t*this._y,this._z=e*r+t*this._z,this.normalize(),this._onChangeCallback(),this}const l=Math.sqrt(a),c=Math.atan2(l,o),h=Math.sin((1-t)*c)/l,u=Math.sin(t*c)/l;return this._w=s*h+this._w*u,this._x=n*h+this._x*u,this._y=i*h+this._y*u,this._z=r*h+this._z*u,this._onChangeCallback(),this}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(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(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(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}}class Zi{constructor(e=0,t=0,n=0){Object.defineProperty(this,"isVector3",{value:!0}),this.x=e,this.y=t,this.z=n}set(e,t,n){return void 0===n&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e,t){return 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(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e,t){return 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(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e,t){return 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(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return e&&e.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(Ki.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(Ki.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,n=this.y,i=this.z,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6]*i,this.y=r[1]*t+r[4]*n+r[7]*i,this.z=r[2]*t+r[5]*n+r[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,n=this.y,i=this.z,r=e.elements,s=1/(r[3]*t+r[7]*n+r[11]*i+r[15]);return this.x=(r[0]*t+r[4]*n+r[8]*i+r[12])*s,this.y=(r[1]*t+r[5]*n+r[9]*i+r[13])*s,this.z=(r[2]*t+r[6]*n+r[10]*i+r[14])*s,this}applyQuaternion(e){const t=this.x,n=this.y,i=this.z,r=e.x,s=e.y,o=e.z,a=e.w,l=a*t+s*i-o*n,c=a*n+o*t-r*i,h=a*i+r*n-s*t,u=-r*t-s*n-o*i;return this.x=l*a+u*-r+c*-o-h*-s,this.y=c*a+u*-s+h*-r-l*-o,this.z=h*a+u*-o+l*-s-c*-r,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,n=this.y,i=this.z,r=e.elements;return this.x=r[0]*t+r[4]*n+r[8]*i,this.y=r[1]*t+r[5]*n+r[9]*i,this.z=r[2]*t+r[6]*n+r[10]*i,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e,t){return 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(e,t){const n=e.x,i=e.y,r=e.z,s=t.x,o=t.y,a=t.z;return this.x=i*a-r*o,this.y=r*s-n*a,this.z=n*o-i*s,this}projectOnVector(e){const t=e.lengthSq();if(0===t)return this.set(0,0,0);const n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return Ji.copy(this).projectOnVector(e),this.sub(Ji)}reflect(e){return this.sub(Ji.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(Bi.clamp(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y,i=this.z-e.z;return t*t+n*n+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){const i=Math.sin(t)*e;return this.x=i*Math.sin(n),this.y=Math.cos(t)*e,this.z=i*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=i,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,4*t)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,3*t)}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(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(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}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}}const Ji=new Zi,Ki=new Yi;class Qi{constructor(e,t){Object.defineProperty(this,"isBox3",{value:!0}),this.min=void 0!==e?e:new Zi(1/0,1/0,1/0),this.max=void 0!==t?t:new Zi(-1/0,-1/0,-1/0)}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){let t=1/0,n=1/0,i=1/0,r=-1/0,s=-1/0,o=-1/0;for(let a=0,l=e.length;ar&&(r=l),c>s&&(s=c),h>o&&(o=h)}return this.min.set(t,n,i),this.max.set(r,s,o),this}setFromBufferAttribute(e){let t=1/0,n=1/0,i=1/0,r=-1/0,s=-1/0,o=-1/0;for(let a=0,l=e.count;ar&&(r=l),c>s&&(s=c),h>o&&(o=h)}return this.min.set(t,n,i),this.max.set(r,s,o),this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;tthis.max.x||e.ythis.max.y||e.zthis.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return void 0===t&&(console.warn("THREE.Box3: .getParameter() target is now required"),t=new Zi),t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)}intersectsSphere(e){return this.clampPoint(e.center,tr),tr.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(cr),hr.subVectors(this.max,cr),ir.subVectors(e.a,cr),rr.subVectors(e.b,cr),sr.subVectors(e.c,cr),or.subVectors(rr,ir),ar.subVectors(sr,rr),lr.subVectors(ir,sr);let t=[0,-or.z,or.y,0,-ar.z,ar.y,0,-lr.z,lr.y,or.z,0,-or.x,ar.z,0,-ar.x,lr.z,0,-lr.x,-or.y,or.x,0,-ar.y,ar.x,0,-lr.y,lr.x,0];return!!$i(t,ir,rr,sr,hr)&&(t=[1,0,0,0,1,0,0,0,1],!!$i(t,ir,rr,sr,hr)&&(ur.crossVectors(or,ar),t=[ur.x,ur.y,ur.z],$i(t,ir,rr,sr,hr)))}clampPoint(e,t){return void 0===t&&(console.warn("THREE.Box3: .clampPoint() target is now required"),t=new Zi),t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return tr.copy(e).clamp(this.min,this.max).sub(e).length()}getBoundingSphere(e){return void 0===e&&console.error("THREE.Box3: .getBoundingSphere() target is now required"),this.getCenter(e.center),e.radius=.5*this.getSize(tr).length(),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()||(er[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),er[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),er[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),er[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),er[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),er[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),er[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),er[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(er)),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}function $i(e,t,n,i,r){for(let s=0,o=e.length-3;s<=o;s+=3){dr.fromArray(e,s);const o=r.x*Math.abs(dr.x)+r.y*Math.abs(dr.y)+r.z*Math.abs(dr.z),a=t.dot(dr),l=n.dot(dr),c=i.dot(dr);if(Math.max(-Math.max(a,l,c),Math.min(a,l,c))>o)return!1}return!0}const er=[new Zi,new Zi,new Zi,new Zi,new Zi,new Zi,new Zi,new Zi],tr=new Zi,nr=new Qi,ir=new Zi,rr=new Zi,sr=new Zi,or=new Zi,ar=new Zi,lr=new Zi,cr=new Zi,hr=new Zi,ur=new Zi,dr=new Zi,pr=new Qi;class fr{constructor(e,t){this.center=void 0!==e?e:new Zi,this.radius=void 0!==t?t:-1}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const n=this.center;void 0!==t?n.copy(t):pr.setFromPoints(e).getCenter(n);let i=0;for(let t=0,r=e.length;tthis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return void 0===e&&(console.warn("THREE.Sphere: .getBoundingBox() target is now required"),e=new Qi),this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}}const mr=new Zi,gr=new Zi,vr=new Zi,yr=new Zi,xr=new Zi,_r=new Zi,br=new Zi;class wr{constructor(e,t){this.origin=void 0!==e?e:new Zi,this.direction=void 0!==t?t:new Zi(0,0,-1)}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}clone(){return(new this.constructor).copy(this)}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return void 0===t&&(console.warn("THREE.Ray: .at() target is now required"),t=new Zi),t.copy(this.direction).multiplyScalar(e).add(this.origin)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,mr)),this}closestPointToPoint(e,t){void 0===t&&(console.warn("THREE.Ray: .closestPointToPoint() target is now required"),t=new Zi),t.subVectors(e,this.origin);const n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.direction).multiplyScalar(n).add(this.origin)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=mr.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(mr.copy(this.direction).multiplyScalar(t).add(this.origin),mr.distanceToSquared(e))}distanceSqToSegment(e,t,n,i){gr.copy(e).add(t).multiplyScalar(.5),vr.copy(t).sub(e).normalize(),yr.copy(this.origin).sub(gr);const r=.5*e.distanceTo(t),s=-this.direction.dot(vr),o=yr.dot(this.direction),a=-yr.dot(vr),l=yr.lengthSq(),c=Math.abs(1-s*s);let h,u,d,p;if(c>0)if(h=s*a-o,u=s*o-a,p=r*c,h>=0)if(u>=-p)if(u<=p){const e=1/c;h*=e,u*=e,d=h*(h+s*u+2*o)+u*(s*h+u+2*a)+l}else u=r,h=Math.max(0,-(s*u+o)),d=-h*h+u*(u+2*a)+l;else u=-r,h=Math.max(0,-(s*u+o)),d=-h*h+u*(u+2*a)+l;else u<=-p?(h=Math.max(0,-(-s*r+o)),u=h>0?-r:Math.min(Math.max(-r,-a),r),d=-h*h+u*(u+2*a)+l):u<=p?(h=0,u=Math.min(Math.max(-r,-a),r),d=u*(u+2*a)+l):(h=Math.max(0,-(s*r+o)),u=h>0?r:Math.min(Math.max(-r,-a),r),d=-h*h+u*(u+2*a)+l);else u=s>0?-r:r,h=Math.max(0,-(s*u+o)),d=-h*h+u*(u+2*a)+l;return n&&n.copy(this.direction).multiplyScalar(h).add(this.origin),i&&i.copy(vr).multiplyScalar(u).add(gr),d}intersectSphere(e,t){mr.subVectors(e.center,this.origin);const n=mr.dot(this.direction),i=mr.dot(mr)-n*n,r=e.radius*e.radius;if(i>r)return null;const s=Math.sqrt(r-i),o=n-s,a=n+s;return o<0&&a<0?null:o<0?this.at(a,t):this.at(o,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?0:null;const n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){const n=this.distanceToPlane(e);return null===n?null:this.at(n,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);if(0===t)return!0;return e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,i,r,s,o,a;const l=1/this.direction.x,c=1/this.direction.y,h=1/this.direction.z,u=this.origin;return l>=0?(n=(e.min.x-u.x)*l,i=(e.max.x-u.x)*l):(n=(e.max.x-u.x)*l,i=(e.min.x-u.x)*l),c>=0?(r=(e.min.y-u.y)*c,s=(e.max.y-u.y)*c):(r=(e.max.y-u.y)*c,s=(e.min.y-u.y)*c),n>s||r>i?null:((r>n||n!=n)&&(n=r),(s=0?(o=(e.min.z-u.z)*h,a=(e.max.z-u.z)*h):(o=(e.max.z-u.z)*h,a=(e.min.z-u.z)*h),n>a||o>i?null:((o>n||n!=n)&&(n=o),(a=0?n:i,t)))}intersectsBox(e){return null!==this.intersectBox(e,mr)}intersectTriangle(e,t,n,i,r){xr.subVectors(t,e),_r.subVectors(n,e),br.crossVectors(xr,_r);let s,o=this.direction.dot(br);if(o>0){if(i)return null;s=1}else{if(!(o<0))return null;s=-1,o=-o}yr.subVectors(this.origin,e);const a=s*this.direction.dot(_r.crossVectors(yr,_r));if(a<0)return null;const l=s*this.direction.dot(xr.cross(yr));if(l<0)return null;if(a+l>o)return null;const c=-s*yr.dot(br);return c<0?null:this.at(c/o,r)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}}class Mr{constructor(){Object.defineProperty(this,"isMatrix4",{value:!0}),this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}set(e,t,n,i,r,s,o,a,l,c,h,u,d,p,f,m){const g=this.elements;return g[0]=e,g[4]=t,g[8]=n,g[12]=i,g[1]=r,g[5]=s,g[9]=o,g[13]=a,g[2]=l,g[6]=c,g[10]=h,g[14]=u,g[3]=d,g[7]=p,g[11]=f,g[15]=m,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return(new Mr).fromArray(this.elements)}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){const t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}extractBasis(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,n=e.elements,i=1/Sr.setFromMatrixColumn(e,0).length(),r=1/Sr.setFromMatrixColumn(e,1).length(),s=1/Sr.setFromMatrixColumn(e,2).length();return t[0]=n[0]*i,t[1]=n[1]*i,t[2]=n[2]*i,t[3]=0,t[4]=n[4]*r,t[5]=n[5]*r,t[6]=n[6]*r,t[7]=0,t[8]=n[8]*s,t[9]=n[9]*s,t[10]=n[10]*s,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){e&&e.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");const t=this.elements,n=e.x,i=e.y,r=e.z,s=Math.cos(n),o=Math.sin(n),a=Math.cos(i),l=Math.sin(i),c=Math.cos(r),h=Math.sin(r);if("XYZ"===e.order){const e=s*c,n=s*h,i=o*c,r=o*h;t[0]=a*c,t[4]=-a*h,t[8]=l,t[1]=n+i*l,t[5]=e-r*l,t[9]=-o*a,t[2]=r-e*l,t[6]=i+n*l,t[10]=s*a}else if("YXZ"===e.order){const e=a*c,n=a*h,i=l*c,r=l*h;t[0]=e+r*o,t[4]=i*o-n,t[8]=s*l,t[1]=s*h,t[5]=s*c,t[9]=-o,t[2]=n*o-i,t[6]=r+e*o,t[10]=s*a}else if("ZXY"===e.order){const e=a*c,n=a*h,i=l*c,r=l*h;t[0]=e-r*o,t[4]=-s*h,t[8]=i+n*o,t[1]=n+i*o,t[5]=s*c,t[9]=r-e*o,t[2]=-s*l,t[6]=o,t[10]=s*a}else if("ZYX"===e.order){const e=s*c,n=s*h,i=o*c,r=o*h;t[0]=a*c,t[4]=i*l-n,t[8]=e*l+r,t[1]=a*h,t[5]=r*l+e,t[9]=n*l-i,t[2]=-l,t[6]=o*a,t[10]=s*a}else if("YZX"===e.order){const e=s*a,n=s*l,i=o*a,r=o*l;t[0]=a*c,t[4]=r-e*h,t[8]=i*h+n,t[1]=h,t[5]=s*c,t[9]=-o*c,t[2]=-l*c,t[6]=n*h+i,t[10]=e-r*h}else if("XZY"===e.order){const e=s*a,n=s*l,i=o*a,r=o*l;t[0]=a*c,t[4]=-h,t[8]=l*c,t[1]=e*h+r,t[5]=s*c,t[9]=n*h-i,t[2]=i*h-n,t[6]=o*c,t[10]=r*h+e}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(Er,e,Ar)}lookAt(e,t,n){const i=this.elements;return Rr.subVectors(e,t),0===Rr.lengthSq()&&(Rr.z=1),Rr.normalize(),Cr.crossVectors(n,Rr),0===Cr.lengthSq()&&(1===Math.abs(n.z)?Rr.x+=1e-4:Rr.z+=1e-4,Rr.normalize(),Cr.crossVectors(n,Rr)),Cr.normalize(),Lr.crossVectors(Rr,Cr),i[0]=Cr.x,i[4]=Lr.x,i[8]=Rr.x,i[1]=Cr.y,i[5]=Lr.y,i[9]=Rr.y,i[2]=Cr.z,i[6]=Lr.z,i[10]=Rr.z,this}multiply(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(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,i=t.elements,r=this.elements,s=n[0],o=n[4],a=n[8],l=n[12],c=n[1],h=n[5],u=n[9],d=n[13],p=n[2],f=n[6],m=n[10],g=n[14],v=n[3],y=n[7],x=n[11],_=n[15],b=i[0],w=i[4],M=i[8],S=i[12],T=i[1],E=i[5],A=i[9],C=i[13],L=i[2],R=i[6],P=i[10],N=i[14],D=i[3],I=i[7],O=i[11],z=i[15];return r[0]=s*b+o*T+a*L+l*D,r[4]=s*w+o*E+a*R+l*I,r[8]=s*M+o*A+a*P+l*O,r[12]=s*S+o*C+a*N+l*z,r[1]=c*b+h*T+u*L+d*D,r[5]=c*w+h*E+u*R+d*I,r[9]=c*M+h*A+u*P+d*O,r[13]=c*S+h*C+u*N+d*z,r[2]=p*b+f*T+m*L+g*D,r[6]=p*w+f*E+m*R+g*I,r[10]=p*M+f*A+m*P+g*O,r[14]=p*S+f*C+m*N+g*z,r[3]=v*b+y*T+x*L+_*D,r[7]=v*w+y*E+x*R+_*I,r[11]=v*M+y*A+x*P+_*O,r[15]=v*S+y*C+x*N+_*z,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[4],i=e[8],r=e[12],s=e[1],o=e[5],a=e[9],l=e[13],c=e[2],h=e[6],u=e[10],d=e[14];return e[3]*(+r*a*h-i*l*h-r*o*u+n*l*u+i*o*d-n*a*d)+e[7]*(+t*a*d-t*l*u+r*s*u-i*s*d+i*l*c-r*a*c)+e[11]*(+t*l*h-t*o*d-r*s*h+n*s*d+r*o*c-n*l*c)+e[15]*(-i*o*c-t*a*h+t*o*u+i*s*h-n*s*u+n*a*c)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){const i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=t,i[14]=n),this}getInverse(e,t){void 0!==t&&console.warn("THREE.Matrix4: .getInverse() can no longer be configured to throw on degenerate.");const n=this.elements,i=e.elements,r=i[0],s=i[1],o=i[2],a=i[3],l=i[4],c=i[5],h=i[6],u=i[7],d=i[8],p=i[9],f=i[10],m=i[11],g=i[12],v=i[13],y=i[14],x=i[15],_=p*y*u-v*f*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[10]*e[10];return Math.sqrt(Math.max(t,n,i))}makeTranslation(e,t,n){return this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const n=Math.cos(t),i=Math.sin(t),r=1-n,s=e.x,o=e.y,a=e.z,l=r*s,c=r*o;return this.set(l*s+n,l*o-i*a,l*a+i*o,0,l*o+i*a,c*o+n,c*a-i*s,0,l*a-i*o,c*a+i*s,r*a*a+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n){return this.set(1,t,n,0,e,1,n,0,e,t,1,0,0,0,0,1),this}compose(e,t,n){const i=this.elements,r=t._x,s=t._y,o=t._z,a=t._w,l=r+r,c=s+s,h=o+o,u=r*l,d=r*c,p=r*h,f=s*c,m=s*h,g=o*h,v=a*l,y=a*c,x=a*h,_=n.x,b=n.y,w=n.z;return i[0]=(1-(f+g))*_,i[1]=(d+x)*_,i[2]=(p-y)*_,i[3]=0,i[4]=(d-x)*b,i[5]=(1-(u+g))*b,i[6]=(m+v)*b,i[7]=0,i[8]=(p+y)*w,i[9]=(m-v)*w,i[10]=(1-(u+f))*w,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,t,n){const i=this.elements;let r=Sr.set(i[0],i[1],i[2]).length();const s=Sr.set(i[4],i[5],i[6]).length(),o=Sr.set(i[8],i[9],i[10]).length();this.determinant()<0&&(r=-r),e.x=i[12],e.y=i[13],e.z=i[14],Tr.copy(this);const a=1/r,l=1/s,c=1/o;return Tr.elements[0]*=a,Tr.elements[1]*=a,Tr.elements[2]*=a,Tr.elements[4]*=l,Tr.elements[5]*=l,Tr.elements[6]*=l,Tr.elements[8]*=c,Tr.elements[9]*=c,Tr.elements[10]*=c,t.setFromRotationMatrix(Tr),n.x=r,n.y=s,n.z=o,this}makePerspective(e,t,n,i,r,s){void 0===s&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");const o=this.elements,a=2*r/(t-e),l=2*r/(n-i),c=(t+e)/(t-e),h=(n+i)/(n-i),u=-(s+r)/(s-r),d=-2*s*r/(s-r);return o[0]=a,o[4]=0,o[8]=c,o[12]=0,o[1]=0,o[5]=l,o[9]=h,o[13]=0,o[2]=0,o[6]=0,o[10]=u,o[14]=d,o[3]=0,o[7]=0,o[11]=-1,o[15]=0,this}makeOrthographic(e,t,n,i,r,s){const o=this.elements,a=1/(t-e),l=1/(n-i),c=1/(s-r),h=(t+e)*a,u=(n+i)*l,d=(s+r)*c;return o[0]=2*a,o[4]=0,o[8]=0,o[12]=-h,o[1]=0,o[5]=2*l,o[9]=0,o[13]=-u,o[2]=0,o[6]=0,o[10]=-2*c,o[14]=-d,o[3]=0,o[7]=0,o[11]=0,o[15]=1,this}equals(e){const t=this.elements,n=e.elements;for(let e=0;e<16;e++)if(t[e]!==n[e])return!1;return!0}fromArray(e,t){void 0===t&&(t=0);for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e,t){void 0===e&&(e=[]),void 0===t&&(t=0);const 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}}const Sr=new Zi,Tr=new Mr,Er=new Zi(0,0,0),Ar=new Zi(1,1,1),Cr=new Zi,Lr=new Zi,Rr=new Zi;class Pr{constructor(e=0,t=0,n=0,i=Pr.DefaultOrder){Object.defineProperty(this,"isEuler",{value:!0}),this._x=e,this._y=t,this._z=n,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,i){return this._x=e,this._y=t,this._z=n,this._order=i||this._order,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t,n){const i=Bi.clamp,r=e.elements,s=r[0],o=r[4],a=r[8],l=r[1],c=r[5],h=r[9],u=r[2],d=r[6],p=r[10];switch(t=t||this._order){case"XYZ":this._y=Math.asin(i(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-h,p),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(d,c),this._z=0);break;case"YXZ":this._x=Math.asin(-i(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(a,p),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-u,s),this._z=0);break;case"ZXY":this._x=Math.asin(i(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-u,p),this._z=Math.atan2(-o,c)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-i(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(d,p),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-o,c));break;case"YZX":this._z=Math.asin(i(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-h,c),this._y=Math.atan2(-u,s)):(this._x=0,this._y=Math.atan2(a,p));break;case"XZY":this._z=Math.asin(-i(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(d,c),this._y=Math.atan2(a,s)):(this._x=Math.atan2(-h,p),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,!1!==n&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return Nr.makeRotationFromQuaternion(e),this.setFromRotationMatrix(Nr,t,n)}setFromVector3(e,t){return this.set(e.x,e.y,e.z,t||this._order)}reorder(e){return Dr.setFromEuler(this),this.setFromQuaternion(Dr,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],void 0!==e[3]&&(this._order=e[3]),this._onChangeCallback(),this}toArray(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(e){return e?e.set(this._x,this._y,this._z):new Zi(this._x,this._y,this._z)}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}}Pr.DefaultOrder="XYZ",Pr.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];const Nr=new Mr,Dr=new Yi;class Ir{constructor(){this.mask=1}set(e){this.mask=1<1){for(let e=0;e1){for(let e=0;e0){i.children=[];for(let t=0;t0&&(n.geometries=t),i.length>0&&(n.materials=i),r.length>0&&(n.textures=r),o.length>0&&(n.images=o),a.length>0&&(n.shapes=a)}return n.object=i,n;function s(e){const t=[];for(const n in e){const i=e[n];delete i.metadata,t.push(i)}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.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse(JSON.stringify(e.userData)),!0===t)for(let t=0;t1?void 0:t.copy(n).multiplyScalar(r).add(e.start)}intersectsLine(e){const t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return void 0===e&&(console.warn("THREE.Plane: .coplanarPoint() target is now required"),e=new Zi),e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const n=t||Kr.getNormalMatrix(e),i=this.coplanarPoint(Zr).applyMatrix4(e),r=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(r),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}}const $r=new Zi,es=new Zi,ts=new Zi,ns=new Zi,is=new Zi,rs=new Zi,ss=new Zi,os=new Zi,as=new Zi,ls=new Zi;class cs{constructor(e,t,n){this.a=void 0!==e?e:new Zi,this.b=void 0!==t?t:new Zi,this.c=void 0!==n?n:new Zi}static getNormal(e,t,n,i){void 0===i&&(console.warn("THREE.Triangle: .getNormal() target is now required"),i=new Zi),i.subVectors(n,t),$r.subVectors(e,t),i.cross($r);const r=i.lengthSq();return r>0?i.multiplyScalar(1/Math.sqrt(r)):i.set(0,0,0)}static getBarycoord(e,t,n,i,r){$r.subVectors(i,t),es.subVectors(n,t),ts.subVectors(e,t);const s=$r.dot($r),o=$r.dot(es),a=$r.dot(ts),l=es.dot(es),c=es.dot(ts),h=s*l-o*o;if(void 0===r&&(console.warn("THREE.Triangle: .getBarycoord() target is now required"),r=new Zi),0===h)return r.set(-2,-1,-1);const u=1/h,d=(l*a-o*c)*u,p=(s*c-o*a)*u;return r.set(1-d-p,p,d)}static containsPoint(e,t,n,i){return this.getBarycoord(e,t,n,i,ns),ns.x>=0&&ns.y>=0&&ns.x+ns.y<=1}static getUV(e,t,n,i,r,s,o,a){return this.getBarycoord(e,t,n,i,ns),a.set(0,0),a.addScaledVector(r,ns.x),a.addScaledVector(s,ns.y),a.addScaledVector(o,ns.z),a}static isFrontFacing(e,t,n,i){return $r.subVectors(n,t),es.subVectors(e,t),$r.cross(es).dot(i)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,i){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[i]),this}clone(){return(new this.constructor).copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return $r.subVectors(this.c,this.b),es.subVectors(this.a,this.b),.5*$r.cross(es).length()}getMidpoint(e){return void 0===e&&(console.warn("THREE.Triangle: .getMidpoint() target is now required"),e=new Zi),e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return cs.getNormal(this.a,this.b,this.c,e)}getPlane(e){return void 0===e&&(console.warn("THREE.Triangle: .getPlane() target is now required"),e=new Qr),e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return cs.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,n,i,r){return cs.getUV(e,this.a,this.b,this.c,t,n,i,r)}containsPoint(e){return cs.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return cs.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){void 0===t&&(console.warn("THREE.Triangle: .closestPointToPoint() target is now required"),t=new Zi);const n=this.a,i=this.b,r=this.c;let s,o;is.subVectors(i,n),rs.subVectors(r,n),os.subVectors(e,n);const a=is.dot(os),l=rs.dot(os);if(a<=0&&l<=0)return t.copy(n);as.subVectors(e,i);const c=is.dot(as),h=rs.dot(as);if(c>=0&&h<=c)return t.copy(i);const u=a*h-c*l;if(u<=0&&a>=0&&c<=0)return s=a/(a-c),t.copy(n).addScaledVector(is,s);ls.subVectors(e,r);const d=is.dot(ls),p=rs.dot(ls);if(p>=0&&d<=p)return t.copy(r);const f=d*l-a*p;if(f<=0&&l>=0&&p<=0)return o=l/(l-p),t.copy(n).addScaledVector(rs,o);const m=c*p-d*h;if(m<=0&&h-c>=0&&d-p>=0)return ss.subVectors(r,i),o=(h-c)/(h-c+(d-p)),t.copy(i).addScaledVector(ss,o);const g=1/(m+f+u);return s=f*g,o=u*g,t.copy(n).addScaledVector(is,s).addScaledVector(rs,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const hs={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},us={h:0,s:0,l:0},ds={h:0,s:0,l:0};function ps(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}function fs(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}function ms(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}class gs{constructor(e,t,n){return Object.defineProperty(this,"isColor",{value:!0}),void 0===t&&void 0===n?this.set(e):this.setRGB(e,t,n)}set(e){return e&&e.isColor?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e),this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,this}setRGB(e,t,n){return this.r=e,this.g=t,this.b=n,this}setHSL(e,t,n){if(e=Bi.euclideanModulo(e,1),t=Bi.clamp(t,0,1),n=Bi.clamp(n,0,1),0===t)this.r=this.g=this.b=n;else{const i=n<=.5?n*(1+t):n+t-n*t,r=2*n-i;this.r=ps(r,i,e+1/3),this.g=ps(r,i,e),this.b=ps(r,i,e-1/3)}return this}setStyle(e){function t(t){void 0!==t&&parseFloat(t)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let n;if(n=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(e)){let e;const i=n[1],r=n[2];switch(i){case"rgb":case"rgba":if(e=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(r))return this.r=Math.min(255,parseInt(e[1],10))/255,this.g=Math.min(255,parseInt(e[2],10))/255,this.b=Math.min(255,parseInt(e[3],10))/255,t(e[5]),this;if(e=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(r))return this.r=Math.min(100,parseInt(e[1],10))/100,this.g=Math.min(100,parseInt(e[2],10))/100,this.b=Math.min(100,parseInt(e[3],10))/100,t(e[5]),this;break;case"hsl":case"hsla":if(e=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(r)){const n=parseFloat(e[1])/360,i=parseInt(e[2],10)/100,r=parseInt(e[3],10)/100;return t(e[5]),this.setHSL(n,i,r)}}}else if(n=/^\#([A-Fa-f0-9]+)$/.exec(e)){const e=n[1],t=e.length;if(3===t)return this.r=parseInt(e.charAt(0)+e.charAt(0),16)/255,this.g=parseInt(e.charAt(1)+e.charAt(1),16)/255,this.b=parseInt(e.charAt(2)+e.charAt(2),16)/255,this;if(6===t)return this.r=parseInt(e.charAt(0)+e.charAt(1),16)/255,this.g=parseInt(e.charAt(2)+e.charAt(3),16)/255,this.b=parseInt(e.charAt(4)+e.charAt(5),16)/255,this}return e&&e.length>0?this.setColorName(e):this}setColorName(e){const t=hs[e];return void 0!==t?this.setHex(t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copyGammaToLinear(e,t){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(e,t){void 0===t&&(t=2);const n=t>0?1/t:1;return this.r=Math.pow(e.r,n),this.g=Math.pow(e.g,n),this.b=Math.pow(e.b,n),this}convertGammaToLinear(e){return this.copyGammaToLinear(this,e),this}convertLinearToGamma(e){return this.copyLinearToGamma(this,e),this}copySRGBToLinear(e){return this.r=fs(e.r),this.g=fs(e.g),this.b=fs(e.b),this}copyLinearToSRGB(e){return this.r=ms(e.r),this.g=ms(e.g),this.b=ms(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0}getHexString(){return("000000"+this.getHex().toString(16)).slice(-6)}getHSL(e){void 0===e&&(console.warn("THREE.Color: .getHSL() target is now required"),e={h:0,s:0,l:0});const t=this.r,n=this.g,i=this.b,r=Math.max(t,n,i),s=Math.min(t,n,i);let o,a;const l=(s+r)/2;if(s===r)o=0,a=0;else{const e=r-s;switch(a=l<=.5?e/(r+s):e/(2-r-s),r){case t:o=(n-i)/e+(n0&&(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.morphNormals&&(n.morphNormals=!0),!0===this.skinning&&(n.skinning=!0),!1===this.visible&&(n.visible=!1),!1===this.toneMapped&&(n.toneMapped=!1),"{}"!==JSON.stringify(this.userData)&&(n.userData=this.userData),t){const t=i(e.textures),r=i(e.images);t.length>0&&(n.textures=t),r.length>0&&(n.images=r)}return n},clone:function(){return(new this.constructor).copy(this)},copy:function(e){this.name=e.name,this.fog=e.fog,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.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let n=null;if(null!==t){const e=t.length;n=new Array(e);for(let i=0;i!==e;++i)n[i]=t[i].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.premultipliedAlpha=e.premultipliedAlpha,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Object.defineProperty(xs.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),_s.prototype=Object.create(xs.prototype),_s.prototype.constructor=_s,_s.prototype.isMeshBasicMaterial=!0,_s.prototype.copy=function(e){return xs.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};const bs=new Zi,ws=new Fi;function Ms(e,t,n){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=e,this.itemSize=t,this.count=void 0!==e?e.length/t:0,this.normalized=!0===n,this.usage=35044,this.updateRange={offset:0,count:-1},this.version=0}function Ss(e,t,n){Ms.call(this,new Int8Array(e),t,n)}function Ts(e,t,n){Ms.call(this,new Uint8Array(e),t,n)}function Es(e,t,n){Ms.call(this,new Uint8ClampedArray(e),t,n)}function As(e,t,n){Ms.call(this,new Int16Array(e),t,n)}function Cs(e,t,n){Ms.call(this,new Uint16Array(e),t,n)}function Ls(e,t,n){Ms.call(this,new Int32Array(e),t,n)}function Rs(e,t,n){Ms.call(this,new Uint32Array(e),t,n)}function Ps(e,t,n){Ms.call(this,new Float32Array(e),t,n)}function Ns(e,t,n){Ms.call(this,new Float64Array(e),t,n)}Object.defineProperty(Ms.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),Object.assign(Ms.prototype,{isBufferAttribute:!0,onUploadCallback:function(){},setUsage:function(e){return this.usage=e,this},copy:function(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this},copyAt:function(e,t,n){e*=this.itemSize,n*=t.itemSize;for(let i=0,r=this.itemSize;i0,s=i[1]&&i[1].length>0,o=e.morphTargets,a=o.length;let l;if(a>0){l=[];for(let e=0;e0){u=[];for(let e=0;e0&&0===t.length&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(let e=0;et&&(t=e[n]);return t}let Os=1;const zs=new Mr,Us=new Yr,Bs=new Zi,Fs=new Qi,Gs=new Qi,ks=new Zi;function Hs(){Object.defineProperty(this,"id",{value:Os+=2}),this.uuid=Bi.generateUUID(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}Hs.prototype=Object.assign(Object.create(Oi.prototype),{constructor:Hs,isBufferGeometry:!0,getIndex:function(){return this.index},setIndex:function(e){Array.isArray(e)?this.index=new(Is(e)>65535?Rs:Cs)(e,1):this.index=e},getAttribute:function(e){return this.attributes[e]},setAttribute:function(e,t){return this.attributes[e]=t,this},deleteAttribute: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},applyMatrix4:function(e){const t=this.attributes.position;void 0!==t&&(t.applyMatrix4(e),t.needsUpdate=!0);const n=this.attributes.normal;if(void 0!==n){const t=(new Gi).getNormalMatrix(e);n.applyNormalMatrix(t),n.needsUpdate=!0}const i=this.attributes.tangent;return void 0!==i&&(i.transformDirection(e),i.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:function(e){return zs.makeRotationX(e),this.applyMatrix4(zs),this},rotateY:function(e){return zs.makeRotationY(e),this.applyMatrix4(zs),this},rotateZ:function(e){return zs.makeRotationZ(e),this.applyMatrix4(zs),this},translate:function(e,t,n){return zs.makeTranslation(e,t,n),this.applyMatrix4(zs),this},scale:function(e,t,n){return zs.makeScale(e,t,n),this.applyMatrix4(zs),this},lookAt:function(e){return Us.lookAt(e),Us.updateMatrix(),this.applyMatrix4(Us.matrix),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(Bs).negate(),this.translate(Bs.x,Bs.y,Bs.z),this},setFromObject:function(e){const t=e.geometry;if(e.isPoints||e.isLine){const e=new Ps(3*t.vertices.length,3),n=new Ps(3*t.colors.length,3);if(this.setAttribute("position",e.copyVector3sArray(t.vertices)),this.setAttribute("color",n.copyColorsArray(t.colors)),t.lineDistances&&t.lineDistances.length===t.vertices.length){const e=new Ps(t.lineDistances.length,1);this.setAttribute("lineDistance",e.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){const t=[];for(let n=0,i=e.length;n0){const t=new Float32Array(3*e.normals.length);this.setAttribute("normal",new Ms(t,3).copyVector3sArray(e.normals))}if(e.colors.length>0){const t=new Float32Array(3*e.colors.length);this.setAttribute("color",new Ms(t,3).copyColorsArray(e.colors))}if(e.uvs.length>0){const t=new Float32Array(2*e.uvs.length);this.setAttribute("uv",new Ms(t,2).copyVector2sArray(e.uvs))}if(e.uvs2.length>0){const t=new Float32Array(2*e.uvs2.length);this.setAttribute("uv2",new Ms(t,2).copyVector2sArray(e.uvs2))}this.groups=e.groups;for(const t in e.morphTargets){const n=[],i=e.morphTargets[t];for(let e=0,t=i.length;e0){const t=new Ps(4*e.skinIndices.length,4);this.setAttribute("skinIndex",t.copyVector4sArray(e.skinIndices))}if(e.skinWeights.length>0){const t=new Ps(4*e.skinWeights.length,4);this.setAttribute("skinWeight",t.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 Qi);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute)return console.error('THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box. Alternatively set "mesh.frustumCulled" to "false".',this),void this.boundingBox.set(new Zi(-1/0,-1/0,-1/0),new Zi(1/0,1/0,1/0));if(void 0!==e){if(this.boundingBox.setFromBufferAttribute(e),t)for(let e=0,n=t.length;e0&&(e.userData=this.userData),void 0!==this.parameters){const t=this.parameters;for(const n in t)void 0!==t[n]&&(e[n]=t[n]);return e}e.data={attributes:{}};const t=this.index;null!==t&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const n=this.attributes;for(const t in n){const i=n[t],r=i.toJSON(e.data);""!==i.name&&(r.name=i.name),e.data.attributes[t]=r}const i={};let r=!1;for(const t in this.morphAttributes){const n=this.morphAttributes[t],s=[];for(let t=0,i=n.length;t0&&(i[t]=s,r=!0)}r&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);const s=this.groups;s.length>0&&(e.data.groups=JSON.parse(JSON.stringify(s)));const o=this.boundingSphere;return null!==o&&(e.data.boundingSphere={center:o.center.toArray(),radius:o.radius}),e},clone:function(){return(new Hs).copy(this)},copy:function(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const n=e.index;null!==n&&this.setIndex(n.clone(t));const i=e.attributes;for(const e in i){const n=i[e];this.setAttribute(e,n.clone(t))}const r=e.morphAttributes;for(const e in r){const n=[],i=r[e];for(let e=0,r=i.length;en.far?null:{distance:c,point:so.clone(),object:e}}function lo(e,t,n,i,r,s,o,a,l,c,h,u){qs.fromBufferAttribute(r,c),Xs.fromBufferAttribute(r,h),Ys.fromBufferAttribute(r,u);const d=e.morphTargetInfluences;if(t.morphTargets&&s&&d){Qs.set(0,0,0),$s.set(0,0,0),eo.set(0,0,0);for(let e=0,t=s.length;e0){const e=t[n[0]];if(void 0!==e){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,n=e.length;t0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}},raycast:function(e,t){const n=this.geometry,i=this.material,r=this.matrixWorld;if(void 0===i)return;if(null===n.boundingSphere&&n.computeBoundingSphere(),Ws.copy(n.boundingSphere),Ws.applyMatrix4(r),!1===e.ray.intersectsSphere(Ws))return;if(Vs.getInverse(r),js.copy(e.ray).applyMatrix4(Vs),null!==n.boundingBox&&!1===js.intersectsBox(n.boundingBox))return;let s;if(n.isBufferGeometry){const r=n.index,o=n.attributes.position,a=n.morphAttributes.position,l=n.morphTargetsRelative,c=n.attributes.uv,h=n.attributes.uv2,u=n.groups,d=n.drawRange;if(null!==r)if(Array.isArray(i))for(let n=0,p=u.length;n0&&(l=c);for(let n=0,c=a.length;n0)for(let e=0;e0&&(this.normalsNeedUpdate=!0)},computeFlatVertexNormals:function(){this.computeFaceNormals();for(let e=0,t=this.faces.length;e0&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){for(let e=0,t=this.faces.length;e=0;e--){const t=r[e];this.faces.splice(t,1);for(let e=0,n=this.faceVertexUvs.length;e0,a=t.vertexNormals.length>0,l=1!==t.color.r||1!==t.color.g||1!==t.color.b,p=t.vertexColors.length>0;let f=0;if(f=c(f,0,0),f=c(f,1,i),f=c(f,2,r),f=c(f,3,s),f=c(f,4,o),f=c(f,5,a),f=c(f,6,l),f=c(f,7,p),n.push(f),n.push(t.a,t.b,t.c),n.push(t.materialIndex),s){const t=this.faceVertexUvs[0][e];n.push(d(t[0]),d(t[1]),d(t[2]))}if(o&&n.push(h(t.normal)),a){const e=t.vertexNormals;n.push(h(e[0]),h(e[1]),h(e[2]))}if(l&&n.push(u(t.color)),p){const e=t.vertexColors;n.push(u(e[0]),u(e[1]),u(e[2]))}}function c(e,t,n){return n?e|1<0&&(e.data.colors=s),a.length>0&&(e.data.uvs=[a]),e.data.faces=n,e},clone:function(){return(new fo).copy(this)},copy:function(e){this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.name=e.name;const t=e.vertices;for(let e=0,n=t.length;e0?1:-1,c.push(A.x,A.y,A.z),h.push(a/m),h.push(1-s/g),T+=1}}for(let e=0;e0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader;const n={};for(const e in this.extensions)!0===this.extensions[e]&&(n[e]=!0);return Object.keys(n).length>0&&(t.extensions=n),t},_o.prototype=Object.assign(Object.create(Yr.prototype),{constructor:_o,isCamera:!0,copy:function(e,t){return Yr.prototype.copy.call(this,e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this},getWorldDirection:function(e){void 0===e&&(console.warn("THREE.Camera: .getWorldDirection() target is now required"),e=new Zi),this.updateMatrixWorld(!0);const t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()},updateMatrixWorld:function(e){Yr.prototype.updateMatrixWorld.call(this,e),this.matrixWorldInverse.getInverse(this.matrixWorld)},updateWorldMatrix:function(e,t){Yr.prototype.updateWorldMatrix.call(this,e,t),this.matrixWorldInverse.getInverse(this.matrixWorld)},clone:function(){return(new this.constructor).copy(this)}}),bo.prototype=Object.assign(Object.create(_o.prototype),{constructor:bo,isPerspectiveCamera:!0,copy:function(e,t){return _o.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){const t=.5*this.getFilmHeight()/e;this.fov=2*Bi.RAD2DEG*Math.atan(t),this.updateProjectionMatrix()},getFocalLength:function(){const e=Math.tan(.5*Bi.DEG2RAD*this.fov);return.5*this.getFilmHeight()/e},getEffectiveFOV:function(){return 2*Bi.RAD2DEG*Math.atan(Math.tan(.5*Bi.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,i,r,s){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=i,this.view.width=r,this.view.height=s,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){const e=this.near;let t=e*Math.tan(.5*Bi.DEG2RAD*this.fov)/this.zoom,n=2*t,i=this.aspect*n,r=-.5*i;const s=this.view;if(null!==this.view&&this.view.enabled){const e=s.fullWidth,o=s.fullHeight;r+=s.offsetX*i/e,t-=s.offsetY*n/o,i*=s.width/e,n*=s.height/o}const o=this.filmOffset;0!==o&&(r+=e*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+i,t,t-n,e,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(e){const t=Yr.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}});function wo(e,t,n){if(Yr.call(this),this.type="CubeCamera",!0!==n.isWebGLCubeRenderTarget)return void console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.");this.renderTarget=n;const i=new bo(90,1,e,t);i.layers=this.layers,i.up.set(0,-1,0),i.lookAt(new Zi(1,0,0)),this.add(i);const r=new bo(90,1,e,t);r.layers=this.layers,r.up.set(0,-1,0),r.lookAt(new Zi(-1,0,0)),this.add(r);const s=new bo(90,1,e,t);s.layers=this.layers,s.up.set(0,0,1),s.lookAt(new Zi(0,1,0)),this.add(s);const o=new bo(90,1,e,t);o.layers=this.layers,o.up.set(0,0,-1),o.lookAt(new Zi(0,-1,0)),this.add(o);const a=new bo(90,1,e,t);a.layers=this.layers,a.up.set(0,-1,0),a.lookAt(new Zi(0,0,1)),this.add(a);const l=new bo(90,1,e,t);l.layers=this.layers,l.up.set(0,-1,0),l.lookAt(new Zi(0,0,-1)),this.add(l),this.update=function(e,t){null===this.parent&&this.updateMatrixWorld();const c=e.xr.enabled,h=e.getRenderTarget();e.xr.enabled=!1;const u=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0),e.render(t,i),e.setRenderTarget(n,1),e.render(t,r),e.setRenderTarget(n,2),e.render(t,s),e.setRenderTarget(n,3),e.render(t,o),e.setRenderTarget(n,4),e.render(t,a),n.texture.generateMipmaps=u,e.setRenderTarget(n,5),e.render(t,l),e.setRenderTarget(h),e.xr.enabled=c},this.clear=function(e,t,i,r){const s=e.getRenderTarget();for(let s=0;s<6;s++)e.setRenderTarget(n,s),e.clear(t,i,r);e.setRenderTarget(s)}}function Mo(e,t,n){Number.isInteger(t)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),t=n),qi.call(this,e,e,t),this.texture.isWebGLCubeRenderTargetTexture=!0}function So(e,t,n,i,r,s,o,a,l,c,h,u){ji.call(this,null,s,o,a,l,c,i,r,h,u),this.image={data:e||null,width:t||1,height:n||1},this.magFilter=void 0!==l?l:1003,this.minFilter=void 0!==c?c:1003,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}wo.prototype=Object.create(Yr.prototype),wo.prototype.constructor=wo,Mo.prototype=Object.create(qi.prototype),Mo.prototype.constructor=Mo,Mo.prototype.isWebGLCubeRenderTarget=!0,Mo.prototype.fromEquirectangularTexture=function(e,t){this.texture.type=t.type,this.texture.format=1023,this.texture.encoding=t.encoding,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const n={uniforms:{tEquirect:{value:null}},vertexShader:"\n\n\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t}\n\n\t\t\tvoid main() {\n\n\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t#include \n\t\t\t\t#include \n\n\t\t\t}\n\t\t",fragmentShader:"\n\n\t\t\tuniform sampler2D tEquirect;\n\n\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t#include \n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t}\n\t\t"},i=new mo(5,5,5),r=new xo({name:"CubemapFromEquirect",uniforms:go(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:1,blending:0});r.uniforms.tEquirect.value=t;const s=new oo(i,r),o=t.minFilter;1008===t.minFilter&&(t.minFilter=1006);return new wo(1,10,this).update(e,s),t.minFilter=o,s.geometry.dispose(),s.material.dispose(),this},So.prototype=Object.create(ji.prototype),So.prototype.constructor=So,So.prototype.isDataTexture=!0;const To=new fr,Eo=new Zi;class Ao{constructor(e,t,n,i,r,s){this.planes=[void 0!==e?e:new Qr,void 0!==t?t:new Qr,void 0!==n?n:new Qr,void 0!==i?i:new Qr,void 0!==r?r:new Qr,void 0!==s?s:new Qr]}set(e,t,n,i,r,s){const o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(n),o[3].copy(i),o[4].copy(r),o[5].copy(s),this}clone(){return(new this.constructor).copy(this)}copy(e){const t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e){const t=this.planes,n=e.elements,i=n[0],r=n[1],s=n[2],o=n[3],a=n[4],l=n[5],c=n[6],h=n[7],u=n[8],d=n[9],p=n[10],f=n[11],m=n[12],g=n[13],v=n[14],y=n[15];return t[0].setComponents(o-i,h-a,f-u,y-m).normalize(),t[1].setComponents(o+i,h+a,f+u,y+m).normalize(),t[2].setComponents(o+r,h+l,f+d,y+g).normalize(),t[3].setComponents(o-r,h-l,f-d,y-g).normalize(),t[4].setComponents(o-s,h-c,f-p,y-v).normalize(),t[5].setComponents(o+s,h+c,f+p,y+v).normalize(),this}intersectsObject(e){const t=e.geometry;return null===t.boundingSphere&&t.computeBoundingSphere(),To.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(To)}intersectsSprite(e){return To.center.set(0,0,0),To.radius=.7071067811865476,To.applyMatrix4(e.matrixWorld),this.intersectsSphere(To)}intersectsSphere(e){const t=this.planes,n=e.center,i=-e.radius;for(let e=0;e<6;e++){if(t[e].distanceToPoint(n)0?e.max.x:e.min.x,Eo.y=i.normal.y>0?e.max.y:e.min.y,Eo.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(Eo)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}}function Co(){let e=null,t=!1,n=null,i=null;function r(t,s){n(t,s),i=e.requestAnimationFrame(r)}return{start:function(){!0!==t&&null!==n&&(i=e.requestAnimationFrame(r),t=!0)},stop:function(){e.cancelAnimationFrame(i),t=!1},setAnimationLoop:function(e){n=e},setContext:function(t){e=t}}}function Lo(e,t){const n=t.isWebGL2,i=new WeakMap;return{get:function(e){return e.isInterleavedBufferAttribute&&(e=e.data),i.get(e)},remove:function(t){t.isInterleavedBufferAttribute&&(t=t.data);const n=i.get(t);n&&(e.deleteBuffer(n.buffer),i.delete(t))},update:function(t,r){if(t.isGLBufferAttribute){var s=i.get(t);return void((!s||s.version 0.0 ) {\n\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t}\n\treturn distanceFalloff;\n#else\n\tif( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t}\n\treturn 1.0;\n#endif\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nvec3 F_Schlick_RoughnessDependent( const in vec3 F0, const in float dotNV, const in float roughness ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotNV - 6.98316 ) * dotNV );\n\tvec3 Fr = max( vec3( 1.0 - roughness ), F0 ) - F0;\n\treturn Fr * fresnel + F0;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\treturn 1.0 / ( gl * gv );\n}\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + viewDir );\n\tfloat dotNL = saturate( dot( normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\nvec3 BRDF_Specular_GGX_Environment( const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\treturn specularColor * brdf.x + brdf.y;\n}\nvoid BRDF_Specular_Multiscattering_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tvec3 F = F_Schlick_RoughnessDependent( specularColor, dotNV, roughness );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\tvec3 FssEss = F * brdf.x + brdf.y;\n\tfloat Ess = brdf.x + brdf.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie(float roughness, float NoH) {\n\tfloat invAlpha = 1.0 / roughness;\n\tfloat cos2h = NoH * NoH;\n\tfloat sin2h = max(1.0 - cos2h, 0.0078125);\treturn (2.0 + invAlpha) * pow(sin2h, invAlpha * 0.5) / (2.0 * PI);\n}\nfloat V_Neubelt(float NoV, float NoL) {\n\treturn saturate(1.0 / (4.0 * (NoL + NoV - NoL * NoV)));\n}\nvec3 BRDF_Specular_Sheen( const in float roughness, const in vec3 L, const in GeometricContext geometry, vec3 specularColor ) {\n\tvec3 N = geometry.normal;\n\tvec3 V = geometry.viewDir;\n\tvec3 H = normalize( V + L );\n\tfloat dotNH = saturate( dot( N, H ) );\n\treturn specularColor * D_Charlie( roughness, dotNH ) * V_Neubelt( dot(N, V), dot(N, L) );\n}\n#endif",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\t\tvec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n\t\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\t\tfDet *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#pragma unroll_loop_end\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif",color_fragment:"#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvarying vec3 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor.xyz *= color.xyz;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif",common:"#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract(sin(sn) * c);\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat max3( vec3 v ) { return max( max( v.x, v.y ), v.z ); }\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\treturn - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat linearToRelativeLuminance( const in vec3 color ) {\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n\treturn dot( weights, color.rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_maxMipLevel 8.0\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_maxTileSize 256.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\tfloat texelSize = 1.0 / ( 3.0 * cubeUV_maxTileSize );\n\t\tvec2 uv = getUV( direction, face ) * ( faceSize - 1.0 );\n\t\tvec2 f = fract( uv );\n\t\tuv += 0.5 - f;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tif ( mipInt < cubeUV_maxMipLevel ) {\n\t\t\tuv.y += 2.0 * cubeUV_maxTileSize;\n\t\t}\n\t\tuv.y += filterInt * 2.0 * cubeUV_minTileSize;\n\t\tuv.x += 3.0 * max( 0.0, cubeUV_maxTileSize - 2.0 * faceSize );\n\t\tuv *= texelSize;\n\t\tvec3 tl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.x += texelSize;\n\t\tvec3 tr = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.y += texelSize;\n\t\tvec3 br = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.x -= texelSize;\n\t\tvec3 bl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tvec3 tm = mix( tl, tr, f.x );\n\t\tvec3 bm = mix( bl, br, f.x );\n\t\treturn mix( tm, bm, f.y );\n\t}\n\t#define r0 1.0\n\t#define v0 0.339\n\t#define m0 - 2.0\n\t#define r1 0.8\n\t#define v1 0.276\n\t#define m1 - 1.0\n\t#define r4 0.4\n\t#define v4 0.046\n\t#define m4 2.0\n\t#define r5 0.305\n\t#define v5 0.016\n\t#define m5 3.0\n\t#define r6 0.21\n\t#define v6 0.0038\n\t#define m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= r1 ) {\n\t\t\tmip = ( r0 - roughness ) * ( m1 - m0 ) / ( r0 - r1 ) + m0;\n\t\t} else if ( roughness >= r4 ) {\n\t\t\tmip = ( r1 - roughness ) * ( m4 - m1 ) / ( r1 - r4 ) + m1;\n\t\t} else if ( roughness >= r5 ) {\n\t\t\tmip = ( r4 - roughness ) * ( m5 - m4 ) / ( r4 - r5 ) + m4;\n\t\t} else if ( roughness >= r6 ) {\n\t\t\tmip = ( r5 - roughness ) * ( m6 - m5 ) / ( r5 - r6 ) + m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), m0, cubeUV_maxMipLevel );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_INSTANCING\n\tmat3 m = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n\ttransformedNormal = m * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",encodings_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",encodings_pars_fragment:"\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a );\n}\nvec4 sRGBToLinear( in vec4 value ) {\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.a );\n}\nvec4 LinearTosRGB( in vec4 value ) {\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.a );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n\tfloat maxComponent = max( max( value.r, value.g ), value.b );\n\tfloat fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n\treturn vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * value.a * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n\tM = ceil( M * 255.0 ) / 255.0;\n\treturn vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat D = max( maxRange / maxRGB, 1.0 );\n\tD = clamp( floor( D ) / 255.0, 0.0, 1.0 );\n\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n\tvec3 Xp_Y_XYZp = cLogLuvM * value.rgb;\n\tXp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) );\n\tvec4 vResult;\n\tvResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n\tfloat Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n\tvResult.w = fract( Le );\n\tvResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0;\n\treturn vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n\tfloat Le = value.z * 255.0 + value.w;\n\tvec3 Xp_Y_XYZp;\n\tXp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 );\n\tXp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n\tXp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n\tvec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb;\n\treturn vec4( max( vRGB, 0.0 ), 1.0 );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifndef ENVMAP_TYPE_CUBE_UV\n\t\tenvColor = envMapTexelToLinear( envColor );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform int maxMipLevel;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#if defined( USE_ENVMAP )\n\t#ifdef ENVMAP_MODE_REFRACTION\n\t\tuniform float refractionRatio;\n\t#endif\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float roughness, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat sigma = PI * roughness * roughness / ( 1.0 + roughness );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar + log2( sigma );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( -viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( -viewDir, normal, refractionRatio );\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( roughness, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\t#endif\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n\tfogDepth = - mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float fogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * fogDepth * fogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, fogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float fogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn texture2D( gradientMap, coord ).rgb;\n\t#else\n\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t#endif\n}",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\treflectedLight.indirectDiffuse += PI * lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n#endif",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_vertex:"vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\nvIndirectFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n\tvIndirectBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\nvIndirectFront += getAmbientLightIrradiance( ambientLightColor );\nvIndirectFront += getLightProbeIrradiance( lightProbe, geometry );\n#ifdef DOUBLE_SIDED\n\tvIndirectBack += getAmbientLightIrradiance( ambientLightColor );\n\tvIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry );\n#endif\n#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tgetPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tgetSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tgetDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in GeometricContext geometry ) {\n\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treturn irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tdirectLight.color = pointLight.color;\n\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\tdirectLight.visible = ( directLight.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\t\tif ( angleCos > spotLight.coneCos ) {\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tirradiance *= PI;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon\n#define Material_LightProbeLOD( material )\t(0)",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.specularRoughness = max( roughnessFactor, 0.0525 );material.specularRoughness += geometryRoughness;\nmaterial.specularRoughness = min( material.specularRoughness, 1.0 );\n#ifdef REFLECTIVITY\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\n#endif\n#ifdef CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheen;\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat specularRoughness;\n\tvec3 specularColor;\n#ifdef CLEARCOAT\n\tfloat clearcoat;\n\tfloat clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tvec3 sheenColor;\n#endif\n};\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\nfloat clearcoatDHRApprox( const in float roughness, const in float dotNL ) {\n\treturn DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.specularRoughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\t#ifdef CLEARCOAT\n\t\tfloat ccDotNL = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = ccDotNL * directLight.color;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tccIrradiance *= PI;\n\t\t#endif\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t\treflectedLight.directSpecular += ccIrradiance * material.clearcoat * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_Sheen(\n\t\t\tmaterial.specularRoughness,\n\t\t\tdirectLight.direction,\n\t\t\tgeometry,\n\t\t\tmaterial.sheenColor\n\t\t);\n\t#else\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.normal, material.specularColor, material.specularRoughness);\n\t#endif\n\treflectedLight.directDiffuse += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef CLEARCOAT\n\t\tfloat ccDotNV = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular += clearcoatRadiance * material.clearcoat * BRDF_Specular_GGX_Environment( geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t\tfloat ccDotNL = ccDotNV;\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\tfloat clearcoatInv = 1.0 - clearcoatDHR;\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\tBRDF_Specular_Multiscattering_Environment( geometry, material.specularColor, material.specularRoughness, singleScattering, multiScattering );\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );\n\treflectedLight.indirectSpecular += clearcoatInv * radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\tvec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getLightProbeIndirectIrradiance( geometry, maxMipLevel );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.normal, material.specularRoughness, maxMipLevel );\n\t#ifdef CLEARCOAT\n\t\tclearcoatRadiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness, maxMipLevel );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n#endif\n#ifdef USE_MAP\n\tvec4 mapTexel = texture2D( map, uv );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tuniform mat3 uvTransform;\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifndef USE_MORPHNORMALS\n\t\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\t\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t#endif\n#endif",normal_fragment_begin:"#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\n\t#ifdef USE_TANGENT\n\t\tvec3 tangent = normalize( vTangent );\n\t\tvec3 bitangent = normalize( vBitangent );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\ttangent = tangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t\tbitangent = bitangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#endif\n\t\t#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tmat3 vTBN = mat3( tangent, bitangent, normal );\n\t\t#endif\n\t#endif\n#endif\nvec3 geometryNormal = normal;",normal_fragment_maps:"#ifdef OBJECTSPACE_NORMALMAP\n\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( TANGENTSPACE_NORMALMAP )\n\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\t#ifdef USE_TANGENT\n\t\tnormal = normalize( vTBN * mapN );\n\t#else\n\t\tnormal = perturbNormal2Arb( -vViewPosition, normal, mapN );\n\t#endif\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN ) {\n\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tfloat scale = sign( st1.t * st0.s - st0.t * st1.s );\n\t\tvec3 S = normalize( ( q0 * st1.t - q1 * st0.t ) * scale );\n\t\tvec3 T = normalize( ( - q0 * st1.s + q1 * st0.s ) * scale );\n\t\tvec3 N = normalize( surf_norm );\n\t\tmat3 tsn = mat3( S, T, N );\n\t\tmapN.xy *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\treturn normalize( tsn * mapN );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\t#ifdef USE_TANGENT\n\t\tclearcoatNormal = normalize( vTBN * clearcoatMapN );\n\t#else\n\t\tclearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN );\n\t#endif\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ));\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w);\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn (( near + viewZ ) * far ) / (( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif",shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0\n\t\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\tvec4 shadowWorldPosition;\n\t#endif\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform highp sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3( 1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108, 1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605, 1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",transmissionmap_fragment:"#ifdef USE_TRANSMISSIONMAP\n\ttotalTransmission *= texture2D( transmissionMap, vUv ).r;\n#endif",transmissionmap_pars_fragment:"#ifdef USE_TRANSMISSIONMAP\n\tuniform sampler2D transmissionMap;\n#endif",uv_pars_fragment:"#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )\n\tvarying vec2 vUv;\n#endif",uv_pars_vertex:"#ifdef USE_UV\n\t#ifdef UVS_VERTEX_ONLY\n\t\tvec2 vUv;\n\t#else\n\t\tvarying vec2 vUv;\n\t#endif\n\tuniform mat3 uvTransform;\n#endif",uv_vertex:"#ifdef USE_UV\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif",uv2_pars_fragment:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",uv2_pars_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n\tuniform mat3 uv2Transform;\n#endif",uv2_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP )\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",background_frag:"uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include \n\t#include \n}",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",cube_frag:"#include \nuniform float opacity;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 vReflect = vWorldDirection;\n\t#include \n\tgl_FragColor = envColor;\n\tgl_FragColor.a *= opacity;\n\t#include \n\t#include \n}",cube_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}",depth_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvHighPrecisionZW = gl_Position.zw;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main () {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include \n\t#include \n\t#include \n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvWorldPosition = worldPosition.xyz;\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tvec4 texColor = texture2D( tEquirect, sampleUV );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include \n\t#include \n}",equirect_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\treflectedLight.indirectDiffuse += lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifdef USE_ENVMAP\n\t#include \n\t#include \n\t#include \n\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_frag:"uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;\n\t#else\n\t\treflectedLight.indirectDiffuse += vIndirectFront;\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t\tmatcapColor = matcapTexelToLinear( matcapColor );\n\t#else\n\t\tvec4 matcapColor = vec4( 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifndef FLAT_SHADED\n\t\tvNormal = normalize( transformedNormal );\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n\t#define REFLECTIVITY\n\t#define CLEARCOAT\n\t#define TRANSMISSION\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef TRANSMISSION\n\tuniform float transmission;\n#endif\n#ifdef REFLECTIVITY\n\tuniform float reflectivity;\n#endif\n#ifdef CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheen;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#ifdef TRANSMISSION\n\t\tfloat totalTransmission = transmission;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#ifdef TRANSMISSION\n\t\tdiffuseColor.a *= saturate( 1. - totalTransmission + linearToRelativeLuminance( reflectedLight.directSpecular + reflectedLight.indirectSpecular ) );\n\t#endif\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n}",normal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n}",normal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}",points_vert:"uniform float size;\nuniform float scale;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include \n\t#include \n\t#include \n}",shadow_vert:"#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include \n\t#include \n\t#include \n}"},No={common:{diffuse:{value:new gs(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new Gi},uv2Transform:{value:new Gi},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new Fi(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 gs(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new gs(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new Gi}},sprite:{diffuse:{value:new gs(15658734)},opacity:{value:1},center:{value:new Fi(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new Gi}}},Do={basic:{uniforms:vo([No.common,No.specularmap,No.envmap,No.aomap,No.lightmap,No.fog]),vertexShader:Po.meshbasic_vert,fragmentShader:Po.meshbasic_frag},lambert:{uniforms:vo([No.common,No.specularmap,No.envmap,No.aomap,No.lightmap,No.emissivemap,No.fog,No.lights,{emissive:{value:new gs(0)}}]),vertexShader:Po.meshlambert_vert,fragmentShader:Po.meshlambert_frag},phong:{uniforms:vo([No.common,No.specularmap,No.envmap,No.aomap,No.lightmap,No.emissivemap,No.bumpmap,No.normalmap,No.displacementmap,No.fog,No.lights,{emissive:{value:new gs(0)},specular:{value:new gs(1118481)},shininess:{value:30}}]),vertexShader:Po.meshphong_vert,fragmentShader:Po.meshphong_frag},standard:{uniforms:vo([No.common,No.envmap,No.aomap,No.lightmap,No.emissivemap,No.bumpmap,No.normalmap,No.displacementmap,No.roughnessmap,No.metalnessmap,No.fog,No.lights,{emissive:{value:new gs(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Po.meshphysical_vert,fragmentShader:Po.meshphysical_frag},toon:{uniforms:vo([No.common,No.aomap,No.lightmap,No.emissivemap,No.bumpmap,No.normalmap,No.displacementmap,No.gradientmap,No.fog,No.lights,{emissive:{value:new gs(0)}}]),vertexShader:Po.meshtoon_vert,fragmentShader:Po.meshtoon_frag},matcap:{uniforms:vo([No.common,No.bumpmap,No.normalmap,No.displacementmap,No.fog,{matcap:{value:null}}]),vertexShader:Po.meshmatcap_vert,fragmentShader:Po.meshmatcap_frag},points:{uniforms:vo([No.points,No.fog]),vertexShader:Po.points_vert,fragmentShader:Po.points_frag},dashed:{uniforms:vo([No.common,No.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Po.linedashed_vert,fragmentShader:Po.linedashed_frag},depth:{uniforms:vo([No.common,No.displacementmap]),vertexShader:Po.depth_vert,fragmentShader:Po.depth_frag},normal:{uniforms:vo([No.common,No.bumpmap,No.normalmap,No.displacementmap,{opacity:{value:1}}]),vertexShader:Po.normal_vert,fragmentShader:Po.normal_frag},sprite:{uniforms:vo([No.sprite,No.fog]),vertexShader:Po.sprite_vert,fragmentShader:Po.sprite_frag},background:{uniforms:{uvTransform:{value:new Gi},t2D:{value:null}},vertexShader:Po.background_vert,fragmentShader:Po.background_frag},cube:{uniforms:vo([No.envmap,{opacity:{value:1}}]),vertexShader:Po.cube_vert,fragmentShader:Po.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Po.equirect_vert,fragmentShader:Po.equirect_frag},distanceRGBA:{uniforms:vo([No.common,No.displacementmap,{referencePosition:{value:new Zi},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Po.distanceRGBA_vert,fragmentShader:Po.distanceRGBA_frag},shadow:{uniforms:vo([No.lights,No.fog,{color:{value:new gs(0)},opacity:{value:1}}]),vertexShader:Po.shadow_vert,fragmentShader:Po.shadow_frag}};function Io(e,t,n,i,r){const s=new gs(0);let o,a,l=0,c=null,h=0,u=null;function d(e,t){n.buffers.color.setClear(e.r,e.g,e.b,t,r)}return{getClearColor:function(){return s},setClearColor:function(e,t){s.set(e),l=void 0!==t?t:1,d(s,l)},getClearAlpha:function(){return l},setClearAlpha:function(e){l=e,d(s,l)},render:function(n,r,p,f){let m=!0===r.isScene?r.background:null;m&&m.isTexture&&(m=t.get(m));const g=e.xr,v=g.getSession&&g.getSession();v&&"additive"===v.environmentBlendMode&&(m=null),null===m?d(s,l):m&&m.isColor&&(d(m,1),f=!0),(e.autoClear||f)&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),m&&(m.isCubeTexture||m.isWebGLCubeRenderTarget||m.isWebGLCubeRenderTargetTexture||306===m.mapping)?(void 0===a&&(a=new oo(new mo(1,1,1),new xo({name:"BackgroundCubeMaterial",uniforms:go(Do.cube.uniforms),vertexShader:Do.cube.vertexShader,fragmentShader:Do.cube.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1})),a.geometry.deleteAttribute("normal"),a.geometry.deleteAttribute("uv"),a.onBeforeRender=function(e,t,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(a.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(a)),m.isWebGLCubeRenderTarget&&(m=m.texture),a.material.uniforms.envMap.value=m,a.material.uniforms.flipEnvMap.value=m.isCubeTexture?-1:1,c===m&&h===m.version&&u===e.toneMapping||(a.material.needsUpdate=!0,c=m,h=m.version,u=e.toneMapping),n.unshift(a,a.geometry,a.material,0,0,null)):m&&m.isTexture&&(void 0===o&&(o=new oo(new Ro(2,2),new xo({name:"BackgroundMaterial",uniforms:go(Do.background.uniforms),vertexShader:Do.background.vertexShader,fragmentShader:Do.background.fragmentShader,side:0,depthTest:!1,depthWrite:!1,fog:!1})),o.geometry.deleteAttribute("normal"),Object.defineProperty(o.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(o)),o.material.uniforms.t2D.value=m,!0===m.matrixAutoUpdate&&m.updateMatrix(),o.material.uniforms.uvTransform.value.copy(m.matrix),c===m&&h===m.version&&u===e.toneMapping||(o.material.needsUpdate=!0,c=m,h=m.version,u=e.toneMapping),n.unshift(o,o.geometry,o.material,0,0,null))}}}function Oo(e,t,n,i){const r=e.getParameter(34921),s=i.isWebGL2?null:t.get("OES_vertex_array_object"),o=i.isWebGL2||null!==s,a={},l=d(null);let c=l;function h(t){return i.isWebGL2?e.bindVertexArray(t):s.bindVertexArrayOES(t)}function u(t){return i.isWebGL2?e.deleteVertexArray(t):s.deleteVertexArrayOES(t)}function d(e){const t=[],n=[],i=[];for(let e=0;e=0){const s=l[t];if(void 0!==s){const t=s.normalized,r=s.itemSize,o=n.get(s);if(void 0===o)continue;const l=o.buffer,c=o.type,h=o.bytesPerElement;if(s.isInterleavedBufferAttribute){const n=s.data,o=n.stride,u=s.offset;n&&n.isInstancedInterleavedBuffer?(m(i,n.meshPerAttribute),void 0===a._maxInstanceCount&&(a._maxInstanceCount=n.meshPerAttribute*n.count)):f(i),e.bindBuffer(34962,l),v(i,r,c,t,o*h,u*h)}else s.isInstancedBufferAttribute?(m(i,s.meshPerAttribute),void 0===a._maxInstanceCount&&(a._maxInstanceCount=s.meshPerAttribute*s.count)):f(i),e.bindBuffer(34962,l),v(i,r,c,t,0,0)}else if("instanceMatrix"===t){const t=n.get(r.instanceMatrix);if(void 0===t)continue;const s=t.buffer,o=t.type;m(i+0,1),m(i+1,1),m(i+2,1),m(i+3,1),e.bindBuffer(34962,s),e.vertexAttribPointer(i+0,4,o,!1,64,0),e.vertexAttribPointer(i+1,4,o,!1,64,16),e.vertexAttribPointer(i+2,4,o,!1,64,32),e.vertexAttribPointer(i+3,4,o,!1,64,48)}else if("instanceColor"===t){const t=n.get(r.instanceColor);if(void 0===t)continue;const s=t.buffer,o=t.type;m(i,1),e.bindBuffer(34962,s),e.vertexAttribPointer(i,3,o,!1,12,0)}else if(void 0!==h){const n=h[t];if(void 0!==n)switch(n.length){case 2:e.vertexAttrib2fv(i,n);break;case 3:e.vertexAttrib3fv(i,n);break;case 4:e.vertexAttrib4fv(i,n);break;default:e.vertexAttrib1fv(i,n)}}}}g()}(r,l,u,y),null!==x&&e.bindBuffer(34963,n.get(x).buffer))},reset:y,resetDefaultState:x,dispose:function(){y();for(const e in a){const t=a[e];for(const e in t){const n=t[e];for(const e in n)u(n[e].object),delete n[e];delete t[e]}delete a[e]}},releaseStatesOfGeometry:function(e){if(void 0===a[e.id])return;const t=a[e.id];for(const e in t){const n=t[e];for(const e in n)u(n[e].object),delete n[e];delete t[e]}delete a[e.id]},releaseStatesOfProgram:function(e){for(const t in a){const n=a[t];if(void 0===n[e.id])continue;const i=n[e.id];for(const e in i)u(i[e].object),delete i[e];delete n[e.id]}},initAttributes:p,enableAttribute:f,disableUnusedAttributes:g}}function zo(e,t,n,i){const r=i.isWebGL2;let s;this.setMode=function(e){s=e},this.render=function(t,i){e.drawArrays(s,t,i),n.update(i,s,1)},this.renderInstances=function(i,o,a){if(0===a)return;let l,c;if(r)l=e,c="drawArraysInstanced";else if(l=t.get("ANGLE_instanced_arrays"),c="drawArraysInstancedANGLE",null===l)return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");l[c](s,i,o,a),n.update(o,s,a)}}function Uo(e,t,n){let i;function r(t){if("highp"===t){if(e.getShaderPrecisionFormat(35633,36338).precision>0&&e.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";t="mediump"}return"mediump"===t&&e.getShaderPrecisionFormat(35633,36337).precision>0&&e.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}const s="undefined"!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext||"undefined"!=typeof WebGL2ComputeRenderingContext&&e instanceof WebGL2ComputeRenderingContext;let o=void 0!==n.precision?n.precision:"highp";const a=r(o);a!==o&&(console.warn("THREE.WebGLRenderer:",o,"not supported, using",a,"instead."),o=a);const l=!0===n.logarithmicDepthBuffer,c=e.getParameter(34930),h=e.getParameter(35660),u=e.getParameter(3379),d=e.getParameter(34076),p=e.getParameter(34921),f=e.getParameter(36347),m=e.getParameter(36348),g=e.getParameter(36349),v=h>0,y=s||!!t.get("OES_texture_float");return{isWebGL2:s,getMaxAnisotropy:function(){if(void 0!==i)return i;const n=t.get("EXT_texture_filter_anisotropic");return i=null!==n?e.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0,i},getMaxPrecision:r,precision:o,logarithmicDepthBuffer:l,maxTextures:c,maxVertexTextures:h,maxTextureSize:u,maxCubemapSize:d,maxAttributes:p,maxVertexUniforms:f,maxVaryings:m,maxFragmentUniforms:g,vertexTextures:v,floatFragmentTextures:y,floatVertexTextures:v&&y,maxSamples:s?e.getParameter(36183):0}}function Bo(e){const t=this;let n=null,i=0,r=!1,s=!1;const o=new Qr,a=new Gi,l={value:null,needsUpdate:!1};function c(){l.value!==n&&(l.value=n,l.needsUpdate=i>0),t.numPlanes=i,t.numIntersection=0}function h(e,n,i,r){const s=null!==e?e.length:0;let c=null;if(0!==s){if(c=l.value,!0!==r||null===c){const t=i+4*s,r=n.matrixWorldInverse;a.getNormalMatrix(r),(null===c||c.length0){const s=e.getRenderList(),o=e.getRenderTarget(),a=e.getRenderState(),l=new Mo(r.height/2);return l.fromEquirectangularTexture(e,i),t.set(i,l),e.setRenderTarget(o),e.setRenderList(s),e.setRenderState(a),n(l.texture,i.mapping)}return null}}}return i},dispose:function(){t=new WeakMap}}}function Go(e){const t={};return{has:function(n){if(void 0!==t[n])return null!==t[n];let i;switch(n){case"WEBGL_depth_texture":i=e.getExtension("WEBGL_depth_texture")||e.getExtension("MOZ_WEBGL_depth_texture")||e.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":i=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":i=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":i=e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:i=e.getExtension(n)}return t[n]=i,null!==i},get:function(e){return this.has(e)||console.warn("THREE.WebGLRenderer: "+e+" extension not supported."),t[e]}}}function ko(e,t,n,i){const r=new WeakMap,s=new WeakMap;function o(e){const a=e.target,l=r.get(a);null!==l.index&&t.remove(l.index);for(const e in l.attributes)t.remove(l.attributes[e]);a.removeEventListener("dispose",o),r.delete(a);const c=s.get(l);c&&(t.remove(c),s.delete(l)),i.releaseStatesOfGeometry(a),!0===a.isInstancedBufferGeometry&&delete a._maxInstanceCount,n.memory.geometries--}function a(e){const n=[],i=e.index,r=e.attributes.position;let o=0;if(null!==i){const e=i.array;o=i.version;for(let t=0,i=e.length;t65535?Rs:Cs)(n,1);a.version=o;const l=s.get(e);l&&t.remove(l),s.set(e,a)}return{get:function(e,t){let i=r.get(t);return i||(t.addEventListener("dispose",o),t.isBufferGeometry?i=t:t.isGeometry&&(void 0===t._bufferGeometry&&(t._bufferGeometry=(new Hs).setFromObject(e)),i=t._bufferGeometry),r.set(t,i),n.memory.geometries++,i)},update:function(e){const n=e.attributes;for(const e in n)t.update(n[e],34962);const i=e.morphAttributes;for(const e in i){const n=i[e];for(let e=0,i=n.length;e0)return e;const r=t*n;let s=ta[r];if(void 0===s&&(s=new Float32Array(r),ta[r]=s),0!==t){i.toArray(s,0);for(let i=1,r=0;i!==t;++i)r+=n,e[i].toArray(s,r)}return s}function aa(e,t){if(e.length!==t.length)return!1;for(let n=0,i=e.length;n/gm;function il(e){return e.replace(nl,rl)}function rl(e,t){const n=Po[t];if(void 0===n)throw new Error("Can not resolve #include <"+t+">");return il(n)}const sl=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,ol=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function al(e){return e.replace(ol,cl).replace(sl,ll)}function ll(e,t,n,i){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),cl(e,t,n,i)}function cl(e,t,n,i){let r="";for(let e=parseInt(t);e0?e.gammaFactor:1,p=n.isWebGL2?"":function(e){return[e.extensionDerivatives||e.envMapCubeUV||e.bumpMap||e.tangentSpaceNormalMap||e.clearcoatNormalMap||e.flatShading||"physical"===e.shaderID?"#extension GL_OES_standard_derivatives : enable":"",(e.extensionFragDepth||e.logarithmicDepthBuffer)&&e.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",e.extensionDrawBuffers&&e.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(e.extensionShaderTextureLOD||e.envMap)&&e.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter($a).join("\n")}(n),f=function(e){const t=[];for(const n in e){const i=e[n];!1!==i&&t.push("#define "+n+" "+i)}return t.join("\n")}(s),m=r.createProgram();let g,v,y=n.glslVersion?"#version "+n.glslVersion+"\n":"";n.isRawShaderMaterial?(g=[f].filter($a).join("\n"),g.length>0&&(g+="\n"),v=[p,f].filter($a).join("\n"),v.length>0&&(v+="\n")):(g=[hl(n),"#define SHADER_NAME "+n.shaderName,f,n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+d,"#define MAX_BONES "+n.maxBones,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+h:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.displacementMap&&n.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.useVertexTexture?"#define BONE_TEXTURE":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&!1===n.flatShading?"#define USE_MORPHNORMALS":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","\tattribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","\tattribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#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($a).join("\n"),v=[p,hl(n),"#define SHADER_NAME "+n.shaderName,f,n.alphaTest?"#define ALPHATEST "+n.alphaTest+(n.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+d,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+c:"",n.envMap?"#define "+h:"",n.envMap?"#define "+u:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.sheen?"#define USE_SHEEN":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor?"#define USE_COLOR":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(n.extensionShaderTextureLOD||n.envMap)&&n.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",0!==n.toneMapping?"#define TONE_MAPPING":"",0!==n.toneMapping?Po.tonemapping_pars_fragment:"",0!==n.toneMapping?Qa("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",Po.encodings_pars_fragment,n.map?Ja("mapTexelToLinear",n.mapEncoding):"",n.matcap?Ja("matcapTexelToLinear",n.matcapEncoding):"",n.envMap?Ja("envMapTexelToLinear",n.envMapEncoding):"",n.emissiveMap?Ja("emissiveMapTexelToLinear",n.emissiveMapEncoding):"",n.lightMap?Ja("lightMapTexelToLinear",n.lightMapEncoding):"",Ka("linearToOutputTexel",n.outputEncoding),n.depthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter($a).join("\n")),o=il(o),o=el(o,n),o=tl(o,n),a=il(a),a=el(a,n),a=tl(a,n),o=al(o),a=al(a),n.isWebGL2&&!0!==n.isRawShaderMaterial&&(y="#version 300 es\n",g=["#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+g,v=["#define varying in","300 es"===n.glslVersion?"":"out highp vec4 pc_fragColor;","300 es"===n.glslVersion?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+v);const x=y+v+a,_=qa(r,35633,y+g+o),b=qa(r,35632,x);if(r.attachShader(m,_),r.attachShader(m,b),void 0!==n.index0AttributeName?r.bindAttribLocation(m,0,n.index0AttributeName):!0===n.morphTargets&&r.bindAttribLocation(m,0,"position"),r.linkProgram(m),e.debug.checkShaderErrors){const e=r.getProgramInfoLog(m).trim(),t=r.getShaderInfoLog(_).trim(),n=r.getShaderInfoLog(b).trim();let i=!0,s=!0;if(!1===r.getProgramParameter(m,35714)){i=!1;const t=Za(r,_,"vertex"),n=Za(r,b,"fragment");console.error("THREE.WebGLProgram: shader error: ",r.getError(),"35715",r.getProgramParameter(m,35715),"gl.getProgramInfoLog",e,t,n)}else""!==e?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",e):""!==t&&""!==n||(s=!1);s&&(this.diagnostics={runnable:i,programLog:e,vertexShader:{log:t,prefix:g},fragmentShader:{log:n,prefix:v}})}let w,M;return r.deleteShader(_),r.deleteShader(b),this.getUniforms=function(){return void 0===w&&(w=new Wa(r,m)),w},this.getAttributes=function(){return void 0===M&&(M=function(e,t){const n={},i=e.getProgramParameter(t,35721);for(let r=0;r0,maxBones:w,useVertexTexture:c,morphTargets:r.morphTargets,morphNormals:r.morphNormals,maxMorphTargets:e.maxMorphTargets,maxMorphNormals:e.maxMorphNormals,numDirLights:o.directional.length,numPointLights:o.point.length,numSpotLights:o.spot.length,numRectAreaLights:o.rectArea.length,numHemiLights:o.hemi.length,numDirLightShadows:o.directionalShadowMap.length,numPointLightShadows:o.pointShadowMap.length,numSpotLightShadows:o.spotShadowMap.length,numClippingPlanes:s.numPlanes,numClipIntersection:s.numIntersection,dithering:r.dithering,shadowMapEnabled:e.shadowMap.enabled&&f.length>0,shadowMapType:e.shadowMap.type,toneMapping:r.toneMapped?e.toneMapping:0,physicallyCorrectLights:e.physicallyCorrectLights,premultipliedAlpha:r.premultipliedAlpha,alphaTest:r.alphaTest,doubleSided:2===r.side,flipSided:1===r.side,depthPacking:void 0!==r.depthPacking&&r.depthPacking,index0AttributeName:r.index0AttributeName,extensionDerivatives:r.extensions&&r.extensions.derivatives,extensionFragDepth:r.extensions&&r.extensions.fragDepth,extensionDrawBuffers:r.extensions&&r.extensions.drawBuffers,extensionShaderTextureLOD:r.extensions&&r.extensions.shaderTextureLOD,rendererExtensionFragDepth:a||n.has("EXT_frag_depth"),rendererExtensionDrawBuffers:a||n.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:a||n.has("EXT_shader_texture_lod"),customProgramCacheKey:r.customProgramCacheKey()}},getProgramCacheKey:function(t){const n=[];if(t.shaderID?n.push(t.shaderID):(n.push(t.fragmentShader),n.push(t.vertexShader)),void 0!==t.defines)for(const e in t.defines)n.push(e),n.push(t.defines[e]);if(!1===t.isRawShaderMaterial){for(let e=0;e1&&i.sort(e||fl),r.length>1&&r.sort(t||ml)}}}function vl(e){let t=new WeakMap;return{get:function(n,i){const r=t.get(n);let s;return void 0===r?(s=new gl(e),t.set(n,new WeakMap),t.get(n).set(i,s)):(s=r.get(i),void 0===s&&(s=new gl(e),r.set(i,s))),s},dispose:function(){t=new WeakMap}}}function yl(){const e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];let n;switch(t.type){case"DirectionalLight":n={direction:new Zi,color:new gs};break;case"SpotLight":n={position:new Zi,direction:new Zi,color:new gs,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new Zi,color:new gs,distance:0,decay:0};break;case"HemisphereLight":n={direction:new Zi,skyColor:new gs,groundColor:new gs};break;case"RectAreaLight":n={color:new gs,position:new Zi,halfWidth:new Zi,halfHeight:new Zi}}return e[t.id]=n,n}}}let xl=0;function _l(e,t){return(t.castShadow?1:0)-(e.castShadow?1:0)}function bl(){const e=new yl,t=function(){const e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];let n;switch(t.type){case"DirectionalLight":case"SpotLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Fi};break;case"PointLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Fi,shadowCameraNear:1,shadowCameraFar:1e3}}return e[t.id]=n,n}}}(),n={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadow:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]};for(let e=0;e<9;e++)n.probe.push(new Zi);const i=new Zi,r=new Mr,s=new Mr;return{setup:function(o,a,l){let c=0,h=0,u=0;for(let e=0;e<9;e++)n.probe[e].set(0,0,0);let d=0,p=0,f=0,m=0,g=0,v=0,y=0,x=0;const _=l.matrixWorldInverse;o.sort(_l);for(let a=0,l=o.length;a0&&(n.rectAreaLTC1=No.LTC_1,n.rectAreaLTC2=No.LTC_2),n.ambient[0]=c,n.ambient[1]=h,n.ambient[2]=u;const b=n.hash;b.directionalLength===d&&b.pointLength===p&&b.spotLength===f&&b.rectAreaLength===m&&b.hemiLength===g&&b.numDirectionalShadows===v&&b.numPointShadows===y&&b.numSpotShadows===x||(n.directional.length=d,n.spot.length=f,n.rectArea.length=m,n.point.length=p,n.hemi.length=g,n.directionalShadow.length=v,n.directionalShadowMap.length=v,n.pointShadow.length=y,n.pointShadowMap.length=y,n.spotShadow.length=x,n.spotShadowMap.length=x,n.directionalShadowMatrix.length=v,n.pointShadowMatrix.length=y,n.spotShadowMatrix.length=x,b.directionalLength=d,b.pointLength=p,b.spotLength=f,b.rectAreaLength=m,b.hemiLength=g,b.numDirectionalShadows=v,b.numPointShadows=y,b.numSpotShadows=x,n.version=xl++)},state:n}}function wl(){const e=new bl,t=[],n=[];return{init:function(){t.length=0,n.length=0},state:{lightsArray:t,shadowsArray:n,lights:e},setupLights:function(i){e.setup(t,n,i)},pushLight:function(e){t.push(e)},pushShadow:function(e){n.push(e)}}}function Ml(){let e=new WeakMap;return{get:function(t,n){let i;return!1===e.has(t)?(i=new wl,e.set(t,new WeakMap),e.get(t).set(n,i)):!1===e.get(t).has(n)?(i=new wl,e.get(t).set(n,i)):i=e.get(t).get(n),i},dispose:function(){e=new WeakMap}}}function Sl(e){xs.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.setValues(e)}function Tl(e){xs.call(this),this.type="MeshDistanceMaterial",this.referencePosition=new Zi,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.setValues(e)}Sl.prototype=Object.create(xs.prototype),Sl.prototype.constructor=Sl,Sl.prototype.isMeshDepthMaterial=!0,Sl.prototype.copy=function(e){return xs.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},Tl.prototype=Object.create(xs.prototype),Tl.prototype.constructor=Tl,Tl.prototype.isMeshDistanceMaterial=!0,Tl.prototype.copy=function(e){return xs.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};function El(e,t,n){let i=new Ao;const r=new Fi,s=new Fi,o=new Wi,a=[],l=[],c={},h={0:1,1:0,2:2},u=new xo({defines:{SAMPLE_RATE:2/8,HALF_SAMPLE_RATE:1/8},uniforms:{shadow_pass:{value:null},resolution:{value:new Fi},radius:{value:4}},vertexShader:"void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include \nvoid main() {\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy ) / resolution ) );\n\tfor ( float i = -1.0; i < 1.0 ; i += SAMPLE_RATE) {\n\t\t#ifdef HORIZONAL_PASS\n\t\t\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( i, 0.0 ) * radius ) / resolution ) );\n\t\t\tmean += distribution.x;\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\t\t#else\n\t\t\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, i ) * radius ) / resolution ) );\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\t\t#endif\n\t}\n\tmean = mean * HALF_SAMPLE_RATE;\n\tsquared_mean = squared_mean * HALF_SAMPLE_RATE;\n\tfloat std_dev = sqrt( squared_mean - mean * mean );\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}"}),d=u.clone();d.defines.HORIZONAL_PASS=1;const p=new Hs;p.setAttribute("position",new Ms(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const f=new oo(p,u),m=this;function g(n,i){const r=t.update(f);u.uniforms.shadow_pass.value=n.map.texture,u.uniforms.resolution.value=n.mapSize,u.uniforms.radius.value=n.radius,e.setRenderTarget(n.mapPass),e.clear(),e.renderBufferDirect(i,null,r,u,f,null),d.uniforms.shadow_pass.value=n.mapPass.texture,d.uniforms.resolution.value=n.mapSize,d.uniforms.radius.value=n.radius,e.setRenderTarget(n.map),e.clear(),e.renderBufferDirect(i,null,r,d,f,null)}function v(e,t,n){const i=e<<0|t<<1|n<<2;let r=a[i];return void 0===r&&(r=new Sl({depthPacking:3201,morphTargets:e,skinning:t}),a[i]=r),r}function y(e,t,n){const i=e<<0|t<<1|n<<2;let r=l[i];return void 0===r&&(r=new Tl({morphTargets:e,skinning:t}),l[i]=r),r}function x(t,n,i,r,s,o,a){let l=null,u=v,d=t.customDepthMaterial;if(!0===r.isPointLight&&(u=y,d=t.customDistanceMaterial),void 0===d){let e=!1;!0===i.morphTargets&&(e=n.morphAttributes&&n.morphAttributes.position&&n.morphAttributes.position.length>0);let r=!1;!0===t.isSkinnedMesh&&(!0===i.skinning?r=!0:console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",t));l=u(e,r,!0===t.isInstancedMesh)}else l=d;if(e.localClippingEnabled&&!0===i.clipShadows&&0!==i.clippingPlanes.length){const e=l.uuid,t=i.uuid;let n=c[e];void 0===n&&(n={},c[e]=n);let r=n[t];void 0===r&&(r=l.clone(),n[t]=r),l=r}return l.visible=i.visible,l.wireframe=i.wireframe,l.side=3===a?null!==i.shadowSide?i.shadowSide:i.side:null!==i.shadowSide?i.shadowSide:h[i.side],l.clipShadows=i.clipShadows,l.clippingPlanes=i.clippingPlanes,l.clipIntersection=i.clipIntersection,l.wireframeLinewidth=i.wireframeLinewidth,l.linewidth=i.linewidth,!0===r.isPointLight&&!0===l.isMeshDistanceMaterial&&(l.referencePosition.setFromMatrixPosition(r.matrixWorld),l.nearDistance=s,l.farDistance=o),l}function _(n,r,s,o,a){if(!1===n.visible)return;if(n.layers.test(r.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&3===a)&&(!n.frustumCulled||i.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(s.matrixWorldInverse,n.matrixWorld);const i=t.update(n),r=n.material;if(Array.isArray(r)){const t=i.groups;for(let l=0,c=t.length;ln||r.y>n)&&(r.x>n&&(s.x=Math.floor(n/p.x),r.x=s.x*p.x,u.mapSize.x=s.x),r.y>n&&(s.y=Math.floor(n/p.y),r.y=s.y*p.y,u.mapSize.y=s.y)),null===u.map&&!u.isPointLightShadow&&3===this.type){const e={minFilter:1006,magFilter:1006,format:1023};u.map=new qi(r.x,r.y,e),u.map.texture.name=h.name+".shadowMap",u.mapPass=new qi(r.x,r.y,e),u.camera.updateProjectionMatrix()}if(null===u.map){const e={minFilter:1003,magFilter:1003,format:1023};u.map=new qi(r.x,r.y,e),u.map.texture.name=h.name+".shadowMap",u.camera.updateProjectionMatrix()}e.setRenderTarget(u.map),e.clear();const f=u.getViewportCount();for(let e=0;e=1):-1!==E.indexOf("OpenGL ES")&&(T=parseFloat(/^OpenGL\ ES\ ([0-9])/.exec(E)[1]),S=T>=2);let A=null,C={};const L=new Wi,R=new Wi;function P(t,n,i){const r=new Uint8Array(4),s=e.createTexture();e.bindTexture(t,s),e.texParameteri(t,10241,9728),e.texParameteri(t,10240,9728);for(let t=0;ti||e.height>i)&&(r=i/Math.max(e.width,e.height)),r<1||!0===t){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap){const i=t?Bi.floorPowerOfTwo:Math.floor,s=i(r*e.width),o=i(r*e.height);void 0===p&&(p=m(s,o));const a=n?m(s,o):p;a.width=s,a.height=o;return a.getContext("2d").drawImage(e,0,0,s,o),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+e.width+"x"+e.height+") to ("+s+"x"+o+")."),a}return"data"in e&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+e.width+"x"+e.height+")."),e}return e}function v(e){return Bi.isPowerOfTwo(e.width)&&Bi.isPowerOfTwo(e.height)}function y(e,t){return e.generateMipmaps&&t&&1003!==e.minFilter&&1006!==e.minFilter}function x(t,n,r,s){e.generateMipmap(t);i.get(n).__maxMipLevel=Math.log(Math.max(r,s))*Math.LOG2E}function _(n,i,r){if(!1===a)return i;if(null!==n){if(void 0!==e[n])return e[n];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+n+"'")}let s=i;return 6403===i&&(5126===r&&(s=33326),5131===r&&(s=33325),5121===r&&(s=33321)),6407===i&&(5126===r&&(s=34837),5131===r&&(s=34843),5121===r&&(s=32849)),6408===i&&(5126===r&&(s=34836),5131===r&&(s=34842),5121===r&&(s=32856)),33325!==s&&33326!==s&&34842!==s&&34836!==s||t.get("EXT_color_buffer_float"),s}function b(e){return 1003===e||1004===e||1005===e?9728:9729}function w(t){const n=t.target;n.removeEventListener("dispose",w),function(t){const n=i.get(t);if(void 0===n.__webglInit)return;e.deleteTexture(n.__webglTexture),i.remove(t)}(n),n.isVideoTexture&&d.delete(n),o.memory.textures--}function M(t){const n=t.target;n.removeEventListener("dispose",M),function(t){const n=i.get(t),r=i.get(t.texture);if(!t)return;void 0!==r.__webglTexture&&e.deleteTexture(r.__webglTexture);t.depthTexture&&t.depthTexture.dispose();if(t.isWebGLCubeRenderTarget)for(let t=0;t<6;t++)e.deleteFramebuffer(n.__webglFramebuffer[t]),n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer[t]);else e.deleteFramebuffer(n.__webglFramebuffer),n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer),n.__webglMultisampledFramebuffer&&e.deleteFramebuffer(n.__webglMultisampledFramebuffer),n.__webglColorRenderbuffer&&e.deleteRenderbuffer(n.__webglColorRenderbuffer),n.__webglDepthRenderbuffer&&e.deleteRenderbuffer(n.__webglDepthRenderbuffer);i.remove(t.texture),i.remove(t)}(n),o.memory.textures--}let S=0;function T(e,t){const r=i.get(e);if(e.isVideoTexture&&function(e){const t=o.render.frame;d.get(e)!==t&&(d.set(e,t),e.update())}(e),e.version>0&&r.__version!==e.version){const n=e.image;if(void 0===n)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(!1!==n.complete)return void N(r,e,t);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}n.activeTexture(33984+t),n.bindTexture(3553,r.__webglTexture)}function E(t,r){if(6!==t.image.length)return;const o=i.get(t);if(t.version>0&&o.__version!==t.version){P(o,t),n.activeTexture(33984+r),n.bindTexture(34067,o.__webglTexture),e.pixelStorei(37440,t.flipY);const i=t&&(t.isCompressedTexture||t.image[0].isCompressedTexture),l=t.image[0]&&t.image[0].isDataTexture,h=[];for(let e=0;e<6;e++)h[e]=i||l?l?t.image[e].image:t.image[e]:g(t.image[e],!1,!0,c);const u=h[0],d=v(u)||a,p=s.convert(t.format),f=s.convert(t.type),m=_(t.internalFormat,p,f);let b;if(R(34067,t,d),i){for(let e=0;e<6;e++){b=h[e].mipmaps;for(let i=0;i1||i.get(s).__currentAnisotropy)&&(e.texParameterf(n,l.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(s.anisotropy,r.getMaxAnisotropy())),i.get(s).__currentAnisotropy=s.anisotropy)}}function P(t,n){void 0===t.__webglInit&&(t.__webglInit=!0,n.addEventListener("dispose",w),t.__webglTexture=e.createTexture(),o.memory.textures++)}function N(t,i,r){let o=3553;i.isDataTexture2DArray&&(o=35866),i.isDataTexture3D&&(o=32879),P(t,i),n.activeTexture(33984+r),n.bindTexture(o,t.__webglTexture),e.pixelStorei(37440,i.flipY),e.pixelStorei(37441,i.premultiplyAlpha),e.pixelStorei(3317,i.unpackAlignment);const l=function(e){return!a&&(1001!==e.wrapS||1001!==e.wrapT||1003!==e.minFilter&&1006!==e.minFilter)}(i)&&!1===v(i.image),c=g(i.image,l,!1,h),u=v(c)||a,d=s.convert(i.format);let p,f=s.convert(i.type),m=_(i.internalFormat,d,f);R(o,i,u);const b=i.mipmaps;if(i.isDepthTexture)m=6402,a?m=1015===i.type?36012:1014===i.type?33190:1020===i.type?35056:33189:1015===i.type&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),1026===i.format&&6402===m&&1012!==i.type&&1014!==i.type&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),i.type=1012,f=s.convert(i.type)),1027===i.format&&6402===m&&(m=34041,1020!==i.type&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),i.type=1020,f=s.convert(i.type))),n.texImage2D(3553,0,m,c.width,c.height,0,d,f,null);else if(i.isDataTexture)if(b.length>0&&u){for(let e=0,t=b.length;e0&&u){for(let e=0,t=b.length;e=l&&console.warn("THREE.WebGLTextures: Trying to use "+e+" texture units while this GPU supports only "+l),S+=1,e},this.resetTextureUnits=function(){S=0},this.setTexture2D=T,this.setTexture2DArray=function(e,t){const r=i.get(e);e.version>0&&r.__version!==e.version?N(r,e,t):(n.activeTexture(33984+t),n.bindTexture(35866,r.__webglTexture))},this.setTexture3D=function(e,t){const r=i.get(e);e.version>0&&r.__version!==e.version?N(r,e,t):(n.activeTexture(33984+t),n.bindTexture(32879,r.__webglTexture))},this.setTextureCube=E,this.setTextureCubeDynamic=A,this.setupRenderTarget=function(t){const r=i.get(t),l=i.get(t.texture);t.addEventListener("dispose",M),l.__webglTexture=e.createTexture(),o.memory.textures++;const c=!0===t.isWebGLCubeRenderTarget,h=!0===t.isWebGLMultisampleRenderTarget,u=v(t)||a;if(!a||1022!==t.texture.format||1015!==t.texture.type&&1016!==t.texture.type||(t.texture.format=1023,console.warn("THREE.WebGLRenderer: Rendering to textures with RGB format is not supported. Using RGBA format instead.")),c){r.__webglFramebuffer=[];for(let t=0;t<6;t++)r.__webglFramebuffer[t]=e.createFramebuffer()}else if(r.__webglFramebuffer=e.createFramebuffer(),h)if(a){r.__webglMultisampledFramebuffer=e.createFramebuffer(),r.__webglColorRenderbuffer=e.createRenderbuffer(),e.bindRenderbuffer(36161,r.__webglColorRenderbuffer);const n=s.convert(t.texture.format),i=s.convert(t.texture.type),o=_(t.texture.internalFormat,n,i),a=z(t);e.renderbufferStorageMultisample(36161,a,o,t.width,t.height),e.bindFramebuffer(36160,r.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(36160,36064,36161,r.__webglColorRenderbuffer),e.bindRenderbuffer(36161,null),t.depthBuffer&&(r.__webglDepthRenderbuffer=e.createRenderbuffer(),I(r.__webglDepthRenderbuffer,t,!0)),e.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");if(c){n.bindTexture(34067,l.__webglTexture),R(34067,t.texture,u);for(let e=0;e<6;e++)D(r.__webglFramebuffer[e],t,36064,34069+e);y(t.texture,u)&&x(34067,t.texture,t.width,t.height),n.bindTexture(34067,null)}else n.bindTexture(3553,l.__webglTexture),R(3553,t.texture,u),D(r.__webglFramebuffer,t,36064,3553),y(t.texture,u)&&x(3553,t.texture,t.width,t.height),n.bindTexture(3553,null);t.depthBuffer&&O(t)},this.updateRenderTargetMipmap=function(e){const t=e.texture;if(y(t,v(e)||a)){const r=e.isWebGLCubeRenderTarget?34067:3553,s=i.get(t).__webglTexture;n.bindTexture(r,s),x(r,t,e.width,e.height),n.bindTexture(r,null)}},this.updateMultisampleRenderTarget=function(t){if(t.isWebGLMultisampleRenderTarget)if(a){const n=i.get(t);e.bindFramebuffer(36008,n.__webglMultisampledFramebuffer),e.bindFramebuffer(36009,n.__webglFramebuffer);const r=t.width,s=t.height;let o=16384;t.depthBuffer&&(o|=256),t.stencilBuffer&&(o|=1024),e.blitFramebuffer(0,0,r,s,0,0,r,s,o,9728),e.bindFramebuffer(36160,n.__webglMultisampledFramebuffer)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")},this.safeSetTexture2D=function(e,t){e&&e.isWebGLRenderTarget&&(!1===U&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),U=!0),e=e.texture),T(e,t)},this.safeSetTextureCube=function(e,t){e&&e.isWebGLCubeRenderTarget&&(!1===B&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),B=!0),e=e.texture),e&&e.isCubeTexture||Array.isArray(e.image)&&6===e.image.length?E(e,t):A(e,t)}}function Ll(e,t,n){const i=n.isWebGL2;return{convert:function(e){let n;if(1009===e)return 5121;if(1017===e)return 32819;if(1018===e)return 32820;if(1019===e)return 33635;if(1010===e)return 5120;if(1011===e)return 5122;if(1012===e)return 5123;if(1013===e)return 5124;if(1014===e)return 5125;if(1015===e)return 5126;if(1016===e)return i?5131:(n=t.get("OES_texture_half_float"),null!==n?n.HALF_FLOAT_OES:null);if(1021===e)return 6406;if(1022===e)return 6407;if(1023===e)return 6408;if(1024===e)return 6409;if(1025===e)return 6410;if(1026===e)return 6402;if(1027===e)return 34041;if(1028===e)return 6403;if(1029===e)return 36244;if(1030===e)return 33319;if(1031===e)return 33320;if(1032===e)return 36248;if(1033===e)return 36249;if(33776===e||33777===e||33778===e||33779===e){if(n=t.get("WEBGL_compressed_texture_s3tc"),null===n)return null;if(33776===e)return n.COMPRESSED_RGB_S3TC_DXT1_EXT;if(33777===e)return n.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(33778===e)return n.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(33779===e)return n.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(35840===e||35841===e||35842===e||35843===e){if(n=t.get("WEBGL_compressed_texture_pvrtc"),null===n)return null;if(35840===e)return n.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(35841===e)return n.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(35842===e)return n.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(35843===e)return n.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(36196===e)return n=t.get("WEBGL_compressed_texture_etc1"),null!==n?n.COMPRESSED_RGB_ETC1_WEBGL:null;if((37492===e||37496===e)&&(n=t.get("WEBGL_compressed_texture_etc"),null!==n)){if(37492===e)return n.COMPRESSED_RGB8_ETC2;if(37496===e)return n.COMPRESSED_RGBA8_ETC2_EAC}return 37808===e||37809===e||37810===e||37811===e||37812===e||37813===e||37814===e||37815===e||37816===e||37817===e||37818===e||37819===e||37820===e||37821===e||37840===e||37841===e||37842===e||37843===e||37844===e||37845===e||37846===e||37847===e||37848===e||37849===e||37850===e||37851===e||37852===e||37853===e?(n=t.get("WEBGL_compressed_texture_astc"),null!==n?e:null):36492===e?(n=t.get("EXT_texture_compression_bptc"),null!==n?e:null):1020===e?i?34042:(n=t.get("WEBGL_depth_texture"),null!==n?n.UNSIGNED_INT_24_8_WEBGL:null):void 0}}}function Rl(e){bo.call(this),this.cameras=e||[]}function Pl(){Yr.call(this),this.type="Group"}function Nl(){this._targetRay=null,this._grip=null,this._hand=null}function Dl(e,t){const n=this;let i=null,r=1,s=null,o="local-floor",a=null;const l=[],c=new Map,h=new bo;h.layers.enable(1),h.viewport=new Wi;const u=new bo;u.layers.enable(2),u.viewport=new Wi;const d=[h,u],p=new Rl;p.layers.enable(1),p.layers.enable(2);let f=null,m=null;function g(e){const t=c.get(e.inputSource);t&&t.dispatchEvent({type:e.type})}function v(){c.forEach((function(e,t){e.disconnect(t)})),c.clear(),e.setFramebuffer(null),e.setRenderTarget(e.getRenderTarget()),S.stop(),n.isPresenting=!1,n.dispatchEvent({type:"sessionend"})}function y(e){s=e,S.setContext(i),S.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}function x(e){const t=i.inputSources;for(let e=0;e0&&_e(s,e,t),o.length>0&&_e(o,e,t),!0===e.isScene&&e.onAfterRender(p,e,t),null!==y&&(q.updateRenderTargetMipmap(y),q.updateMultisampleRenderTarget(y)),V.buffers.depth.setTest(!0),V.buffers.depth.setMask(!0),V.buffers.color.setMask(!0),V.setPolygonOffset(!1),u=null,d=null},this.setFramebuffer=function(e){m!==e&&null===y&&le.bindFramebuffer(36160,e),m=e},this.getActiveCubeFace=function(){return g},this.getActiveMipmapLevel=function(){return v},this.getRenderList=function(){return u},this.setRenderList=function(e){u=e},this.getRenderState=function(){return d},this.setRenderState=function(e){d=e},this.getRenderTarget=function(){return y},this.setRenderTarget=function(e,t=0,n=0){y=e,g=t,v=n,e&&void 0===W.get(e).__webglFramebuffer&&q.setupRenderTarget(e);let i=m,r=!1;if(e){const n=W.get(e).__webglFramebuffer;e.isWebGLCubeRenderTarget?(i=n[t],r=!0):i=e.isWebGLMultisampleRenderTarget?W.get(e).__webglMultisampledFramebuffer:n,M.copy(e.viewport),S.copy(e.scissor),T=e.scissorTest}else M.copy(P).multiplyScalar(C).floor(),S.copy(N).multiplyScalar(C).floor(),T=D;if(x!==i&&(le.bindFramebuffer(36160,i),x=i),V.viewport(M),V.scissor(S),V.setScissorTest(T),r){const i=W.get(e.texture);le.framebufferTexture2D(36160,36064,34069+t,i.__webglTexture,n)}},this.readRenderTargetPixels=function(e,t,n,i,r,s,o){if(!e||!e.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let a=W.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&void 0!==o&&(a=a[o]),a){let o=!1;a!==x&&(le.bindFramebuffer(36160,a),o=!0);try{const a=e.texture,l=a.format,c=a.type;if(1023!==l&&oe.convert(l)!==le.getParameter(35739))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(!(1009===c||oe.convert(c)===le.getParameter(35738)||1015===c&&(H.isWebGL2||k.get("OES_texture_float")||k.get("WEBGL_color_buffer_float"))||1016===c&&(H.isWebGL2?k.get("EXT_color_buffer_float"):k.get("EXT_color_buffer_half_float"))))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");36053===le.checkFramebufferStatus(36160)?t>=0&&t<=e.width-i&&n>=0&&n<=e.height-r&&le.readPixels(t,n,i,r,oe.convert(l),oe.convert(c),s):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{o&&le.bindFramebuffer(36160,x)}}},this.copyFramebufferToTexture=function(e,t,n){void 0===n&&(n=0);const i=Math.pow(2,-n),r=Math.floor(t.image.width*i),s=Math.floor(t.image.height*i),o=oe.convert(t.format);q.setTexture2D(t,0),le.copyTexImage2D(3553,n,o,e.x,e.y,r,s,0),V.unbindTexture()},this.copyTextureToTexture=function(e,t,n,i){void 0===i&&(i=0);const r=t.image.width,s=t.image.height,o=oe.convert(n.format),a=oe.convert(n.type);q.setTexture2D(n,0),le.pixelStorei(37440,n.flipY),le.pixelStorei(37441,n.premultiplyAlpha),le.pixelStorei(3317,n.unpackAlignment),t.isDataTexture?le.texSubImage2D(3553,i,e.x,e.y,r,s,o,a,t.image.data):t.isCompressedTexture?le.compressedTexSubImage2D(3553,i,e.x,e.y,t.mipmaps[0].width,t.mipmaps[0].height,o,t.mipmaps[0].data):le.texSubImage2D(3553,i,e.x,e.y,o,a,t.image),0===i&&n.generateMipmaps&&le.generateMipmap(3553),V.unbindTexture()},this.initTexture=function(e){q.setTexture2D(e,0),V.unbindTexture()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}function zl(e){Ol.call(this,e)}Rl.prototype=Object.assign(Object.create(bo.prototype),{constructor:Rl,isArrayCamera:!0}),Pl.prototype=Object.assign(Object.create(Yr.prototype),{constructor:Pl,isGroup:!0}),Object.assign(Nl.prototype,{constructor:Nl,getHandSpace:function(){if(null===this._hand&&(this._hand=new Pl,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints=[],this._hand.inputState={pinching:!1},window.XRHand))for(let e=0;e<=window.XRHand.LITTLE_PHALANX_TIP;e++){const e=new Pl;e.matrixAutoUpdate=!1,e.visible=!1,this._hand.joints.push(e),this._hand.add(e)}return this._hand},getTargetRaySpace:function(){return null===this._targetRay&&(this._targetRay=new Pl,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1),this._targetRay},getGripSpace:function(){return null===this._grip&&(this._grip=new Pl,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1),this._grip},dispatchEvent:function(e){return null!==this._targetRay&&this._targetRay.dispatchEvent(e),null!==this._grip&&this._grip.dispatchEvent(e),null!==this._hand&&this._hand.dispatchEvent(e),this},disconnect:function(e){return this.dispatchEvent({type:"disconnected",data:e}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this},update:function(e,t,n){let i=null,r=null,s=null;const o=this._targetRay,a=this._grip,l=this._hand;if(e)if(l&&e.hand){s=!0;for(let i=0;i<=window.XRHand.LITTLE_PHALANX_TIP;i++)if(e.hand[i]){const r=t.getJointPose(e.hand[i],n),s=l.joints[i];null!==r&&(s.matrix.fromArray(r.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),s.jointRadius=r.radius),s.visible=null!==r;const o=l.joints[window.XRHand.INDEX_PHALANX_TIP],a=l.joints[window.XRHand.THUMB_PHALANX_TIP],c=o.position.distanceTo(a.position),h=.02,u=.005;l.inputState.pinching&&c>h+u?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!l.inputState.pinching&&c<=h-u&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}}else null!==o&&(i=t.getPose(e.targetRaySpace,n),null!==i&&(o.matrix.fromArray(i.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale))),null!==a&&e.gripSpace&&(r=t.getPose(e.gripSpace,n),null!==r&&(a.matrix.fromArray(r.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale)));return null!==o&&(o.visible=null!==i),null!==a&&(a.visible=null!==r),null!==l&&(l.visible=null!==s),this}}),Object.assign(Dl.prototype,Oi.prototype),zl.prototype=Object.assign(Object.create(Ol.prototype),{constructor:zl,isWebGL1Renderer:!0});class Ul{constructor(e,t){Object.defineProperty(this,"isFogExp2",{value:!0}),this.name="",this.color=new gs(e),this.density=void 0!==t?t:25e-5}clone(){return new Ul(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}class Bl{constructor(e,t,n){Object.defineProperty(this,"isFog",{value:!0}),this.name="",this.color=new gs(e),this.near=void 0!==t?t:1,this.far=void 0!==n?n:1e3}clone(){return new Bl(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}class Fl extends Yr{constructor(){super(),Object.defineProperty(this,"isScene",{value:!0}),this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),null!==e.background&&(this.background=e.background.clone()),null!==e.environment&&(this.environment=e.environment.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(e){const t=super.toJSON(e);return null!==this.background&&(t.object.background=this.background.toJSON(e)),null!==this.environment&&(t.object.environment=this.environment.toJSON(e)),null!==this.fog&&(t.object.fog=this.fog.toJSON()),t}}function Gl(e,t){this.array=e,this.stride=t,this.count=void 0!==e?e.length/t:0,this.usage=35044,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=Bi.generateUUID()}Object.defineProperty(Gl.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),Object.assign(Gl.prototype,{isInterleavedBuffer:!0,onUploadCallback:function(){},setUsage:function(e){return this.usage=e,this},copy:function(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this},copyAt:function(e,t,n){e*=this.stride,n*=t.stride;for(let i=0,r=this.stride;ie.far||t.push({distance:a,point:Wl.clone(),uv:cs.getUV(Wl,Kl,Ql,$l,ec,tc,nc,new Fi),face:null,object:this})},copy:function(e){return Yr.prototype.copy.call(this,e),void 0!==e.center&&this.center.copy(e.center),this.material=e.material,this}});const sc=new Zi,oc=new Zi;function ac(){Yr.call(this),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}function lc(e,t){e&&e.isGeometry&&console.error("THREE.SkinnedMesh no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."),oo.call(this,e,t),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new Mr,this.bindMatrixInverse=new Mr}ac.prototype=Object.assign(Object.create(Yr.prototype),{constructor:ac,isLOD:!0,copy:function(e){Yr.prototype.copy.call(this,e,!1);const t=e.levels;for(let e=0,n=t.length;e0){let n,i;for(n=1,i=t.length;n0){sc.setFromMatrixPosition(this.matrixWorld);const n=e.ray.origin.distanceTo(sc);this.getObjectForDistance(n).raycast(e,t)}},update:function(e){const t=this.levels;if(t.length>1){sc.setFromMatrixPosition(e.matrixWorld),oc.setFromMatrixPosition(this.matrixWorld);const n=sc.distanceTo(oc)/e.zoom;let i,r;for(t[0].object.visible=!0,i=1,r=t.length;i=t[i].distance;i++)t[i-1].object.visible=!1,t[i].object.visible=!0;for(this._currentLevel=i-1;io)continue;h.applyMatrix4(this.matrixWorld);const d=e.ray.origin.distanceTo(h);de.far||t.push({distance:d,point:c.clone().applyMatrix4(this.matrixWorld),index:i,face:null,faceIndex:null,object:this})}}else for(let n=0,i=r.length/3-1;no)continue;h.applyMatrix4(this.matrixWorld);const i=e.ray.origin.distanceTo(h);ie.far||t.push({distance:i,point:c.clone().applyMatrix4(this.matrixWorld),index:n,face:null,faceIndex:null,object:this})}}else if(n.isGeometry){const i=n.vertices,r=i.length;for(let n=0;no)continue;h.applyMatrix4(this.matrixWorld);const r=e.ray.origin.distanceTo(h);re.far||t.push({distance:r,point:c.clone().applyMatrix4(this.matrixWorld),index:n,face:null,faceIndex:null,object:this})}}},updateMorphTargets:function(){const e=this.geometry;if(e.isBufferGeometry){const t=e.morphAttributes,n=Object.keys(t);if(n.length>0){const e=t[n[0]];if(void 0!==e){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,n=e.length;t0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}});const Tc=new Zi,Ec=new Zi;function Ac(e,t){Sc.call(this,e,t),this.type="LineSegments"}function Cc(e,t){Sc.call(this,e,t),this.type="LineLoop"}function Lc(e){xs.call(this),this.type="PointsMaterial",this.color=new gs(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.morphTargets=!1,this.setValues(e)}Ac.prototype=Object.assign(Object.create(Sc.prototype),{constructor:Ac,isLineSegments:!0,computeLineDistances:function(){const e=this.geometry;if(e.isBufferGeometry)if(null===e.index){const t=e.attributes.position,n=[];for(let e=0,i=t.count;er.far)return;s.push({distance:l,distanceToRay:Math.sqrt(a),point:n,index:t,face:null,object:o})}}function zc(e,t,n,i,r,s,o,a,l){ji.call(this,e,t,n,i,r,s,o,a,l),this.format=void 0!==o?o:1022,this.minFilter=void 0!==s?s:1006,this.magFilter=void 0!==r?r:1006,this.generateMipmaps=!1;const c=this;"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback((function t(){c.needsUpdate=!0,e.requestVideoFrameCallback(t)}))}function Uc(e,t,n,i,r,s,o,a,l,c,h,u){ji.call(this,null,s,o,a,l,c,i,r,h,u),this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}function Bc(e,t,n,i,r,s,o,a,l){ji.call(this,e,t,n,i,r,s,o,a,l),this.needsUpdate=!0}function Fc(e,t,n,i,r,s,o,a,l,c){if(1026!==(c=void 0!==c?c:1026)&&1027!==c)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&1026===c&&(n=1012),void 0===n&&1027===c&&(n=1020),ji.call(this,null,i,r,s,o,a,c,n,l),this.image={width:e,height:t},this.magFilter=void 0!==o?o:1003,this.minFilter=void 0!==a?a:1003,this.flipY=!1,this.generateMipmaps=!1}Ic.prototype=Object.assign(Object.create(Yr.prototype),{constructor:Ic,isPoints:!0,copy:function(e){return Yr.prototype.copy.call(this,e),this.material=e.material,this.geometry=e.geometry,this},raycast:function(e,t){const n=this.geometry,i=this.matrixWorld,r=e.params.Points.threshold;if(null===n.boundingSphere&&n.computeBoundingSphere(),Nc.copy(n.boundingSphere),Nc.applyMatrix4(i),Nc.radius+=r,!1===e.ray.intersectsSphere(Nc))return;Rc.getInverse(i),Pc.copy(e.ray).applyMatrix4(Rc);const s=r/((this.scale.x+this.scale.y+this.scale.z)/3),o=s*s;if(n.isBufferGeometry){const r=n.index,s=n.attributes.position.array;if(null!==r){const n=r.array;for(let r=0,a=n.length;r0){const e=t[n[0]];if(void 0!==e){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,n=e.length;t0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}),zc.prototype=Object.assign(Object.create(ji.prototype),{constructor:zc,isVideoTexture:!0,update:function(){const e=this.image;!1==="requestVideoFrameCallback"in e&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}),Uc.prototype=Object.create(ji.prototype),Uc.prototype.constructor=Uc,Uc.prototype.isCompressedTexture=!0,Bc.prototype=Object.create(ji.prototype),Bc.prototype.constructor=Bc,Bc.prototype.isCanvasTexture=!0,Fc.prototype=Object.create(ji.prototype),Fc.prototype.constructor=Fc,Fc.prototype.isDepthTexture=!0;function Gc(e,t,n){fo.call(this),this.type="ParametricGeometry",this.parameters={func:e,slices:t,stacks:n},this.fromBufferGeometry(new kc(e,t,n)),this.mergeVertices()}function kc(e,t,n){Hs.call(this),this.type="ParametricBufferGeometry",this.parameters={func:e,slices:t,stacks:n};const i=[],r=[],s=[],o=[],a=1e-5,l=new Zi,c=new Zi,h=new Zi,u=new Zi,d=new Zi;e.length<3&&console.error("THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter.");const p=t+1;for(let i=0;i<=n;i++){const p=i/n;for(let n=0;n<=t;n++){const i=n/t;e(i,p,c),r.push(c.x,c.y,c.z),i-a>=0?(e(i-a,p,h),u.subVectors(c,h)):(e(i+a,p,h),u.subVectors(h,c)),p-a>=0?(e(i,p-a,h),d.subVectors(c,h)):(e(i,p+a,h),d.subVectors(h,c)),l.crossVectors(u,d).normalize(),s.push(l.x,l.y,l.z),o.push(i,p)}}for(let e=0;e.9&&o<.1&&(t<.2&&(s[e+0]+=1),n<.2&&(s[e+2]+=1),i<.2&&(s[e+4]+=1))}}()}(),this.setAttribute("position",new Ps(r,3)),this.setAttribute("normal",new Ps(r.slice(),3)),this.setAttribute("uv",new Ps(s,2)),0===i?this.computeVertexNormals():this.normalizeNormals()}}class Vc extends Hc{constructor(e,t){super([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}}}class jc extends Hc{constructor(e,t){super([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}}}class Wc extends Hc{constructor(e,t){const n=(1+Math.sqrt(5))/2;super([-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],[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}}}class qc extends Hc{constructor(e,t){const n=(1+Math.sqrt(5))/2,i=1/n;super([-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,-i,-n,0,-i,n,0,i,-n,0,i,n,-i,-n,0,-i,n,0,i,-n,0,i,n,0,-n,0,-i,n,0,-i,-n,0,i,n,0,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}}}class Xc extends Hs{constructor(e,t,n,i,r){super(),this.type="TubeBufferGeometry",this.parameters={path:e,tubularSegments:t,radius:n,radialSegments:i,closed:r},t=t||64,n=n||1,i=i||8,r=r||!1;const s=e.computeFrenetFrames(t,r);this.tangents=s.tangents,this.normals=s.normals,this.binormals=s.binormals;const o=new Zi,a=new Zi,l=new Fi;let c=new Zi;const h=[],u=[],d=[],p=[];function f(r){c=e.getPointAt(r/t,c);const l=s.normals[r],d=s.binormals[r];for(let e=0;e<=i;e++){const t=e/i*Math.PI*2,r=Math.sin(t),s=-Math.cos(t);a.x=s*l.x+r*d.x,a.y=s*l.y+r*d.y,a.z=s*l.z+r*d.z,a.normalize(),u.push(a.x,a.y,a.z),o.x=c.x+n*a.x,o.y=c.y+n*a.y,o.z=c.z+n*a.z,h.push(o.x,o.y,o.z)}}!function(){for(let e=0;e80*n){a=c=e[0],l=h=e[1];for(let t=n;tc&&(c=u),d>h&&(h=d);p=Math.max(c-a,h-l),p=0!==p?1/p:0}return $c(s,o,n,a,l,p),o};function Kc(e,t,n,i,r){let s,o;if(r===function(e,t,n,i){let r=0;for(let s=t,o=n-i;s0)for(s=t;s=t;s-=i)o=yh(s,e[s],e[s+1],o);return o&&dh(o,o.next)&&(xh(o),o=o.next),o}function Qc(e,t){if(!e)return e;t||(t=e);let n,i=e;do{if(n=!1,i.steiner||!dh(i,i.next)&&0!==uh(i.prev,i,i.next))i=i.next;else{if(xh(i),i=t=i.prev,i===i.next)break;n=!0}}while(n||i!==t);return t}function $c(e,t,n,i,r,s,o){if(!e)return;!o&&s&&function(e,t,n,i){let r=e;do{null===r.z&&(r.z=ah(r.x,r.y,t,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==e);r.prevZ.nextZ=null,r.prevZ=null,function(e){let t,n,i,r,s,o,a,l,c=1;do{for(n=e,e=null,s=null,o=0;n;){for(o++,i=n,a=0,t=0;t0||l>0&&i;)0!==a&&(0===l||!i||n.z<=i.z)?(r=n,n=n.nextZ,a--):(r=i,i=i.nextZ,l--),s?s.nextZ=r:e=r,r.prevZ=s,s=r;n=i}s.nextZ=null,c*=2}while(o>1)}(r)}(e,i,r,s);let a,l,c=e;for(;e.prev!==e.next;)if(a=e.prev,l=e.next,s?th(e,i,r,s):eh(e))t.push(a.i/n),t.push(e.i/n),t.push(l.i/n),xh(e),e=l.next,c=l.next;else if((e=l)===c){o?1===o?$c(e=nh(Qc(e),t,n),t,n,i,r,s,2):2===o&&ih(e,t,n,i,r,s):$c(Qc(e),t,n,i,r,s,1);break}}function eh(e){const t=e.prev,n=e,i=e.next;if(uh(t,n,i)>=0)return!1;let r=e.next.next;for(;r!==e.prev;){if(ch(t.x,t.y,n.x,n.y,i.x,i.y,r.x,r.y)&&uh(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function th(e,t,n,i){const r=e.prev,s=e,o=e.next;if(uh(r,s,o)>=0)return!1;const a=r.xs.x?r.x>o.x?r.x:o.x:s.x>o.x?s.x:o.x,h=r.y>s.y?r.y>o.y?r.y:o.y:s.y>o.y?s.y:o.y,u=ah(a,l,t,n,i),d=ah(c,h,t,n,i);let p=e.prevZ,f=e.nextZ;for(;p&&p.z>=u&&f&&f.z<=d;){if(p!==e.prev&&p!==e.next&&ch(r.x,r.y,s.x,s.y,o.x,o.y,p.x,p.y)&&uh(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,f!==e.prev&&f!==e.next&&ch(r.x,r.y,s.x,s.y,o.x,o.y,f.x,f.y)&&uh(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(;p&&p.z>=u;){if(p!==e.prev&&p!==e.next&&ch(r.x,r.y,s.x,s.y,o.x,o.y,p.x,p.y)&&uh(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;f&&f.z<=d;){if(f!==e.prev&&f!==e.next&&ch(r.x,r.y,s.x,s.y,o.x,o.y,f.x,f.y)&&uh(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function nh(e,t,n){let i=e;do{const r=i.prev,s=i.next.next;!dh(r,s)&&ph(r,i,i.next,s)&&gh(r,s)&&gh(s,r)&&(t.push(r.i/n),t.push(i.i/n),t.push(s.i/n),xh(i),xh(i.next),i=e=s),i=i.next}while(i!==e);return Qc(i)}function ih(e,t,n,i,r,s){let o=e;do{let e=o.next.next;for(;e!==o.prev;){if(o.i!==e.i&&hh(o,e)){let a=vh(o,e);return o=Qc(o,o.next),a=Qc(a,a.next),$c(o,t,n,i,r,s),void $c(a,t,n,i,r,s)}e=e.next}o=o.next}while(o!==e)}function rh(e,t){return e.x-t.x}function sh(e,t){if(t=function(e,t){let n=t;const i=e.x,r=e.y;let s,o=-1/0;do{if(r<=n.y&&r>=n.next.y&&n.next.y!==n.y){const e=n.x+(r-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(e<=i&&e>o){if(o=e,e===i){if(r===n.y)return n;if(r===n.next.y)return n.next}s=n.x=n.x&&n.x>=l&&i!==n.x&&ch(rs.x||n.x===s.x&&oh(s,n)))&&(s=n,u=h)),n=n.next}while(n!==a);return s}(e,t)){const n=vh(t,e);Qc(t,t.next),Qc(n,n.next)}}function oh(e,t){return uh(e.prev,e,t.prev)<0&&uh(t.next,e,e.next)<0}function ah(e,t,n,i,r){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*r)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*r)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function lh(e){let t=e,n=e;do{(t.x=0&&(e-o)*(i-a)-(n-o)*(t-a)>=0&&(n-o)*(s-a)-(r-o)*(i-a)>=0}function hh(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){let n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&ph(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&(gh(e,t)&&gh(t,e)&&function(e,t){let n=e,i=!1;const r=(e.x+t.x)/2,s=(e.y+t.y)/2;do{n.y>s!=n.next.y>s&&n.next.y!==n.y&&r<(n.next.x-n.x)*(s-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next}while(n!==e);return i}(e,t)&&(uh(e.prev,e,t.prev)||uh(e,t.prev,t))||dh(e,t)&&uh(e.prev,e,e.next)>0&&uh(t.prev,t,t.next)>0)}function uh(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function dh(e,t){return e.x===t.x&&e.y===t.y}function ph(e,t,n,i){const r=mh(uh(e,t,n)),s=mh(uh(e,t,i)),o=mh(uh(n,i,e)),a=mh(uh(n,i,t));return r!==s&&o!==a||(!(0!==r||!fh(e,n,t))||(!(0!==s||!fh(e,i,t))||(!(0!==o||!fh(n,e,i))||!(0!==a||!fh(n,t,i)))))}function fh(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function mh(e){return e>0?1:e<0?-1:0}function gh(e,t){return uh(e.prev,e,e.next)<0?uh(e,t,e.next)>=0&&uh(e,e.prev,t)>=0:uh(e,t,e.prev)<0||uh(e,e.next,t)<0}function vh(e,t){const n=new _h(e.i,e.x,e.y),i=new _h(t.i,t.x,t.y),r=e.next,s=t.prev;return e.next=t,t.prev=e,n.next=r,r.prev=n,i.next=n,n.prev=i,s.next=i,i.prev=s,i}function yh(e,t,n,i){const r=new _h(e,t,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function xh(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 _h(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}const bh={area:function(e){const t=e.length;let n=0;for(let i=t-1,r=0;r2&&e[t-1].equals(e[0])&&e.pop()}function Mh(e,t){for(let n=0;nNumber.EPSILON){const u=Math.sqrt(h),d=Math.sqrt(l*l+c*c),p=t.x-a/u,f=t.y+o/u,m=((n.x-c/d-p)*c-(n.y+l/d-f)*l)/(o*c-a*l);i=p+o*m-e.x,r=f+a*m-e.y;const g=i*i+r*r;if(g<=2)return new Fi(i,r);s=Math.sqrt(g/2)}else{let e=!1;o>Number.EPSILON?l>Number.EPSILON&&(e=!0):o<-Number.EPSILON?l<-Number.EPSILON&&(e=!0):Math.sign(a)===Math.sign(c)&&(e=!0),e?(i=-a,r=o,s=Math.sqrt(h)):(i=o,r=a,s=Math.sqrt(h/2))}return new Fi(i/s,r/s)}const P=[];for(let e=0,t=E.length,n=t-1,i=e+1;e=0;e--){const t=e/p,n=h*Math.cos(t*Math.PI/2),i=u*Math.sin(t*Math.PI/2)+d;for(let e=0,t=E.length;e=0;){const i=n;let r=n-1;r<0&&(r=e.length-1);for(let e=0,n=a+2*p;e0)&&d.push(t,r,l),(e!==n-1||a0&&v(!0),t>0&&v(!1)),this.setIndex(c),this.setAttribute("position",new Ps(h,3)),this.setAttribute("normal",new Ps(u,3)),this.setAttribute("uv",new Ps(d,2))}}class Uh extends zh{constructor(e,t,n,i,r,s,o){super(0,e,t,n,i,r,s,o),this.type="ConeBufferGeometry",this.parameters={radius:e,height:t,radialSegments:n,heightSegments:i,openEnded:r,thetaStart:s,thetaLength:o}}}class Bh extends Hs{constructor(e,t,n,i){super(),this.type="CircleBufferGeometry",this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:i},e=e||1,t=void 0!==t?Math.max(3,t):8,n=void 0!==n?n:0,i=void 0!==i?i:2*Math.PI;const r=[],s=[],o=[],a=[],l=new Zi,c=new Fi;s.push(0,0,0),o.push(0,0,1),a.push(.5,.5);for(let r=0,h=3;r<=t;r++,h+=3){const u=n+r/t*i;l.x=e*Math.cos(u),l.y=e*Math.sin(u),s.push(l.x,l.y,l.z),o.push(0,0,1),c.x=(s[h]/e+1)/2,c.y=(s[h+1]/e+1)/2,a.push(c.x,c.y)}for(let e=1;e<=t;e++)r.push(e,e+1,0);this.setIndex(r),this.setAttribute("position",new Ps(s,3)),this.setAttribute("normal",new Ps(o,3)),this.setAttribute("uv",new Ps(a,2))}}var Fh=Object.freeze({__proto__:null,WireframeGeometry:class extends Hs{constructor(e){super(),this.type="WireframeGeometry";const t=[],n=[0,0],i={},r=["a","b","c"];if(e&&e.isGeometry){const s=e.faces;for(let e=0,t=s.length;e=i)){l.push(t.times[e]);for(let n=0;ns.tracks[e].times[0]&&(a=s.tracks[e].times[0]);for(let e=0;e=i.times[u]){const e=u*l+a,t=e+l-a;d=Kh.arraySlice(i.values,e,t)}else{const e=i.createInterpolant(),t=a,n=l-a;e.evaluate(s),d=Kh.arraySlice(e.resultBuffer,t,n)}if("quaternion"===r){(new Yi).fromArray(d).normalize().conjugate().toArray(d)}const p=o.times.length;for(let e=0;e=r)break e;{const o=t[1];e=r)break t}s=n,n=0}}for(;n>>1;et;)--s;if(++s,0!==r||s!==i){r>=s&&(s=Math.max(s,1),r=s-1);const e=this.getValueSize();this.times=Kh.arraySlice(n,r,s),this.values=Kh.arraySlice(this.values,r*e,s*e)}return this},validate:function(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const n=this.times,i=this.values,r=n.length;0===r&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let s=null;for(let t=0;t!==r;t++){const i=n[t];if("number"==typeof i&&isNaN(i)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,t,i),e=!1;break}if(null!==s&&s>i){console.error("THREE.KeyframeTrack: Out of order keys.",this,t,i,s),e=!1;break}s=i}if(void 0!==i&&Kh.isTypedArray(i))for(let t=0,n=i.length;t!==n;++t){const n=i[t];if(isNaN(n)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,t,n),e=!1;break}}return e},optimize:function(){const e=Kh.arraySlice(this.times),t=Kh.arraySlice(this.values),n=this.getValueSize(),i=2302===this.getInterpolation(),r=e.length-1;let s=1;for(let o=1;o0){e[s]=e[r];for(let e=r*n,i=s*n,o=0;o!==n;++o)t[i+o]=t[e+o];++s}return s!==e.length?(this.times=Kh.arraySlice(e,0,s),this.values=Kh.arraySlice(t,0,s*n)):(this.times=e,this.values=t),this},clone:function(){const e=Kh.arraySlice(this.times,0),t=Kh.arraySlice(this.values,0),n=new(0,this.constructor)(this.name,e,t);return n.createInterpolant=this.createInterpolant,n}}),iu.prototype=Object.assign(Object.create(nu.prototype),{constructor:iu,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),ru.prototype=Object.assign(Object.create(nu.prototype),{constructor:ru,ValueTypeName:"color"}),su.prototype=Object.assign(Object.create(nu.prototype),{constructor:su,ValueTypeName:"number"}),ou.prototype=Object.assign(Object.create(Qh.prototype),{constructor:ou,interpolate_:function(e,t,n,i){const r=this.resultBuffer,s=this.sampleValues,o=this.valueSize,a=(n-t)/(i-t);let l=e*o;for(let e=l+o;l!==e;l+=4)Yi.slerpFlat(r,0,s,l-o,s,l,a);return r}}),au.prototype=Object.assign(Object.create(nu.prototype),{constructor:au,ValueTypeName:"quaternion",DefaultInterpolation:2301,InterpolantFactoryMethodLinear:function(e){return new ou(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodSmooth:void 0}),lu.prototype=Object.assign(Object.create(nu.prototype),{constructor:lu,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),cu.prototype=Object.assign(Object.create(nu.prototype),{constructor:cu,ValueTypeName:"vector"}),Object.assign(hu,{parse:function(e){const t=[],n=e.tracks,i=1/(e.fps||1);for(let e=0,r=n.length;e!==r;++e)t.push(uu(n[e]).scale(i));return new hu(e.name,e.duration,t,e.blendMode)},toJSON:function(e){const t=[],n=e.tracks,i={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let e=0,i=n.length;e!==i;++e)t.push(nu.toJSON(n[e]));return i},CreateFromMorphTargetSequence:function(e,t,n,i){const r=t.length,s=[];for(let e=0;e1){const e=s[1];let t=i[e];t||(i[e]=t=[]),t.push(n)}}const s=[];for(const e in i)s.push(hu.CreateFromMorphTargetSequence(e,i[e],t,n));return s},parseAnimation:function(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const n=function(e,t,n,i,r){if(0!==n.length){const s=[],o=[];Kh.flattenJSON(n,s,o,i),0!==s.length&&r.push(new e(t,s,o))}},i=[],r=e.name||"default",s=e.fps||30,o=e.blendMode;let a=e.length||-1;const l=e.hierarchy||[];for(let e=0;e0||0===e.search(/^data\:image\/jpeg/);r.format=i?1022:1023,r.needsUpdate=!0,void 0!==t&&t(r)}),n,i),r}}),Object.assign(Su.prototype,{getPoint:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null},getPointAt:function(e,t){const n=this.getUtoTmapping(e);return this.getPoint(n,t)},getPoints:function(e){void 0===e&&(e=5);const t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return t},getSpacedPoints:function(e){void 0===e&&(e=5);const t=[];for(let n=0;n<=e;n++)t.push(this.getPointAt(n/e));return t},getLength:function(){const 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;const t=[];let n,i=this.getPoint(0),r=0;t.push(0);for(let s=1;s<=e;s++)n=this.getPoint(s/e),r+=n.distanceTo(i),t.push(r),i=n;return this.cacheArcLengths=t,t},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(e,t){const n=this.getLengths();let i=0;const r=n.length;let s;s=t||e*n[r-1];let o,a=0,l=r-1;for(;a<=l;)if(i=Math.floor(a+(l-a)/2),o=n[i]-s,o<0)a=i+1;else{if(!(o>0)){l=i;break}l=i-1}if(i=l,n[i]===s)return i/(r-1);const c=n[i];return(i+(s-c)/(n[i+1]-c))/(r-1)},getTangent:function(e,t){let n=e-1e-4,i=e+1e-4;n<0&&(n=0),i>1&&(i=1);const r=this.getPoint(n),s=this.getPoint(i),o=t||(r.isVector2?new Fi:new Zi);return o.copy(s).sub(r).normalize(),o},getTangentAt:function(e,t){const n=this.getUtoTmapping(e);return this.getTangent(n,t)},computeFrenetFrames:function(e,t){const n=new Zi,i=[],r=[],s=[],o=new Zi,a=new Mr;for(let t=0;t<=e;t++){const n=t/e;i[t]=this.getTangentAt(n,new Zi),i[t].normalize()}r[0]=new Zi,s[0]=new Zi;let l=Number.MAX_VALUE;const c=Math.abs(i[0].x),h=Math.abs(i[0].y),u=Math.abs(i[0].z);c<=l&&(l=c,n.set(1,0,0)),h<=l&&(l=h,n.set(0,1,0)),u<=l&&n.set(0,0,1),o.crossVectors(i[0],n).normalize(),r[0].crossVectors(i[0],o),s[0].crossVectors(i[0],r[0]);for(let t=1;t<=e;t++){if(r[t]=r[t-1].clone(),s[t]=s[t-1].clone(),o.crossVectors(i[t-1],i[t]),o.length()>Number.EPSILON){o.normalize();const e=Math.acos(Bi.clamp(i[t-1].dot(i[t]),-1,1));r[t].applyMatrix4(a.makeRotationAxis(o,e))}s[t].crossVectors(i[t],r[t])}if(!0===t){let t=Math.acos(Bi.clamp(r[0].dot(r[e]),-1,1));t/=e,i[0].dot(o.crossVectors(r[0],r[e]))>0&&(t=-t);for(let n=1;n<=e;n++)r[n].applyMatrix4(a.makeRotationAxis(i[n],t*n)),s[n].crossVectors(i[n],r[n])}return{tangents:i,normals:r,binormals:s}},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this},toJSON:function(){const 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}}),Tu.prototype=Object.create(Su.prototype),Tu.prototype.constructor=Tu,Tu.prototype.isEllipseCurve=!0,Tu.prototype.getPoint=function(e,t){const n=t||new Fi,i=2*Math.PI;let r=this.aEndAngle-this.aStartAngle;const s=Math.abs(r)i;)r-=i;r0?0:(Math.floor(Math.abs(l)/r)+1)*r:0===c&&l===r-1&&(l=r-2,c=1),this.closed||l>0?o=i[(l-1)%r]:(Cu.subVectors(i[0],i[1]).add(i[0]),o=Cu);const h=i[l%r],u=i[(l+1)%r];if(this.closed||l+2i.length-2?i.length-1:s+1],h=i[s>i.length-3?i.length-1:s+2];return n.set(Du(o,a.x,l.x,c.x,h.x),Du(o,a.y,l.y,c.y,h.y)),n},Hu.prototype.copy=function(e){Su.prototype.copy.call(this,e),this.points=[];for(let t=0,n=e.points.length;t=t){const e=n[i]-t,r=this.curves[i],s=r.getLength(),o=0===s?0:1-e/s;return r.getPointAt(o)}i++}return null},getLength:function(){const 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;const e=[];let t=0;for(let n=0,i=this.curves.length;n1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t},copy:function(e){Su.prototype.copy.call(this,e),this.curves=[];for(let t=0,n=e.curves.length;t0){const e=l.getPoint(0);e.equals(this.currentPoint)||this.lineTo(e.x,e.y)}this.curves.push(l);const c=l.getPoint(1);return this.currentPoint.copy(c),this},copy:function(e){return ju.prototype.copy.call(this,e),this.currentPoint.copy(e.currentPoint),this},toJSON:function(){const e=ju.prototype.toJSON.call(this);return e.currentPoint=this.currentPoint.toArray(),e},fromJSON:function(e){return ju.prototype.fromJSON.call(this,e),this.currentPoint.fromArray(e.currentPoint),this}}),qu.prototype=Object.assign(Object.create(Wu.prototype),{constructor:qu,getPointsHoles:function(e){const t=[];for(let n=0,i=this.holes.length;n0:i.vertexColors=e.vertexColors),void 0!==e.uniforms)for(const t in e.uniforms){const r=e.uniforms[t];switch(i.uniforms[t]={},r.type){case"t":i.uniforms[t].value=n(r.value);break;case"c":i.uniforms[t].value=(new gs).setHex(r.value);break;case"v2":i.uniforms[t].value=(new Fi).fromArray(r.value);break;case"v3":i.uniforms[t].value=(new Zi).fromArray(r.value);break;case"v4":i.uniforms[t].value=(new Wi).fromArray(r.value);break;case"m3":i.uniforms[t].value=(new Gi).fromArray(r.value);break;case"m4":i.uniforms[t].value=(new Mr).fromArray(r.value);break;default:i.uniforms[t].value=r.value}}if(void 0!==e.defines&&(i.defines=e.defines),void 0!==e.vertexShader&&(i.vertexShader=e.vertexShader),void 0!==e.fragmentShader&&(i.fragmentShader=e.fragmentShader),void 0!==e.extensions)for(const t in e.extensions)i.extensions[t]=e.extensions[t];if(void 0!==e.shading&&(i.flatShading=1===e.shading),void 0!==e.size&&(i.size=e.size),void 0!==e.sizeAttenuation&&(i.sizeAttenuation=e.sizeAttenuation),void 0!==e.map&&(i.map=n(e.map)),void 0!==e.matcap&&(i.matcap=n(e.matcap)),void 0!==e.alphaMap&&(i.alphaMap=n(e.alphaMap)),void 0!==e.bumpMap&&(i.bumpMap=n(e.bumpMap)),void 0!==e.bumpScale&&(i.bumpScale=e.bumpScale),void 0!==e.normalMap&&(i.normalMap=n(e.normalMap)),void 0!==e.normalMapType&&(i.normalMapType=e.normalMapType),void 0!==e.normalScale){let t=e.normalScale;!1===Array.isArray(t)&&(t=[t,t]),i.normalScale=(new Fi).fromArray(t)}return void 0!==e.displacementMap&&(i.displacementMap=n(e.displacementMap)),void 0!==e.displacementScale&&(i.displacementScale=e.displacementScale),void 0!==e.displacementBias&&(i.displacementBias=e.displacementBias),void 0!==e.roughnessMap&&(i.roughnessMap=n(e.roughnessMap)),void 0!==e.metalnessMap&&(i.metalnessMap=n(e.metalnessMap)),void 0!==e.emissiveMap&&(i.emissiveMap=n(e.emissiveMap)),void 0!==e.emissiveIntensity&&(i.emissiveIntensity=e.emissiveIntensity),void 0!==e.specularMap&&(i.specularMap=n(e.specularMap)),void 0!==e.envMap&&(i.envMap=n(e.envMap)),void 0!==e.envMapIntensity&&(i.envMapIntensity=e.envMapIntensity),void 0!==e.reflectivity&&(i.reflectivity=e.reflectivity),void 0!==e.refractionRatio&&(i.refractionRatio=e.refractionRatio),void 0!==e.lightMap&&(i.lightMap=n(e.lightMap)),void 0!==e.lightMapIntensity&&(i.lightMapIntensity=e.lightMapIntensity),void 0!==e.aoMap&&(i.aoMap=n(e.aoMap)),void 0!==e.aoMapIntensity&&(i.aoMapIntensity=e.aoMapIntensity),void 0!==e.gradientMap&&(i.gradientMap=n(e.gradientMap)),void 0!==e.clearcoatMap&&(i.clearcoatMap=n(e.clearcoatMap)),void 0!==e.clearcoatRoughnessMap&&(i.clearcoatRoughnessMap=n(e.clearcoatRoughnessMap)),void 0!==e.clearcoatNormalMap&&(i.clearcoatNormalMap=n(e.clearcoatNormalMap)),void 0!==e.clearcoatNormalScale&&(i.clearcoatNormalScale=(new Fi).fromArray(e.clearcoatNormalScale)),void 0!==e.transmission&&(i.transmission=e.transmission),void 0!==e.transmissionMap&&(i.transmissionMap=n(e.transmissionMap)),i},setTextures:function(e){return this.textures=e,this}});const ld=function(e){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);let t="";for(let n=0,i=e.length;n0){const o=new pu(t);r=new _u(o),r.setCrossOrigin(this.crossOrigin);for(let t=0,r=e.length;tNumber.EPSILON){if(l<0&&(n=t[s],a=-a,o=t[r],l=-l),e.yo.y)continue;if(e.y===n.y){if(e.x===n.x)return!0}else{const t=l*(e.x-n.x)-a*(e.y-n.y);if(0===t)return!0;if(t<0)continue;i=!i}}else{if(e.y!==n.y)continue;if(o.x<=e.x&&e.x<=n.x||n.x<=e.x&&e.x<=o.x)return!0}}return i}const r=bh.isClockWise,s=this.subPaths;if(0===s.length)return[];if(!0===t)return n(s);let o,a,l;const c=[];if(1===s.length)return a=s[0],l=new qu,l.curves=a.curves,c.push(l),c;let h=!r(s[0].getPoints());h=e?!h:h;const u=[],d=[];let p,f,m=[],g=0;d[g]=void 0,m[g]=[];for(let t=0,n=s.length;t1){let e=!1;const t=[];for(let e=0,t=d.length;e0&&(e||(m=u))}for(let e=0,t=d.length;e0&&this._mixBufferRegionAdditive(n,i,this._addIndex*t,1,t);for(let e=t,r=t+t;e!==r;++e)if(n[e]!==n[e+t]){o.setValue(n,i);break}},saveOriginalState:function(){const e=this.binding,t=this.buffer,n=this.valueSize,i=n*this._origIndex;e.getValue(t,i);for(let e=n,r=i;e!==r;++e)t[e]=t[i+e%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0},restoreOriginalState:function(){const e=3*this.valueSize;this.binding.setValue(this.buffer,e)},_setAdditiveIdentityNumeric:function(){const e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let n=e;n=.5)for(let i=0;i!==r;++i)e[t+i]=e[n+i]},_slerp:function(e,t,n,i){Yi.slerpFlat(e,t,e,t,e,n,i)},_slerpAdditive:function(e,t,n,i,r){const s=this._workIndex*r;Yi.multiplyQuaternionsFlat(e,s,e,t,e,n),Yi.slerpFlat(e,t,e,t,e,s,i)},_lerp:function(e,t,n,i,r){const s=1-i;for(let o=0;o!==r;++o){const r=t+o;e[r]=e[r]*s+e[n+o]*i}},_lerpAdditive:function(e,t,n,i,r){for(let s=0;s!==r;++s){const r=t+s;e[r]=e[r]+e[n+s]*i}}});const Nd=new RegExp("[\\[\\]\\.:\\/]","g"),Dd="[^"+"\\[\\]\\.:\\/".replace("\\.","")+"]",Id=/((?:WC+[\/:])*)/.source.replace("WC","[^\\[\\]\\.:\\/]"),Od=/(WCOD+)?/.source.replace("WCOD",Dd),zd=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC","[^\\[\\]\\.:\\/]"),Ud=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC","[^\\[\\]\\.:\\/]"),Bd=new RegExp("^"+Id+Od+zd+Ud+"$"),Fd=["material","materials","bones"];function Gd(e,t,n){const i=n||kd.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,i)}function kd(e,t,n){this.path=t,this.parsedPath=n||kd.parseTrackName(t),this.node=kd.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e}Object.assign(Gd.prototype,{getValue:function(e,t){this.bind();const n=this._targetGroup.nCachedObjects_,i=this._bindings[n];void 0!==i&&i.getValue(e,t)},setValue:function(e,t){const n=this._bindings;for(let i=this._targetGroup.nCachedObjects_,r=n.length;i!==r;++i)n[i].setValue(e,t)},bind:function(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()},unbind:function(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}}),Object.assign(kd,{Composite:Gd,create:function(e,t,n){return e&&e.isAnimationObjectGroup?new kd.Composite(e,t,n):new kd(e,t,n)},sanitizeNodeName:function(e){return e.replace(/\s/g,"_").replace(Nd,"")},parseTrackName:function(e){const t=Bd.exec(e);if(!t)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(void 0!==i&&-1!==i){const e=n.nodeName.substring(i+1);-1!==Fd.indexOf(e)&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=e)}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||"."===t||-1===t||t===e.name||t===e.uuid)return e;if(e.skeleton){const n=e.skeleton.getBoneByName(t);if(void 0!==n)return n}if(e.children){const n=function(e){for(let i=0;i=r){const s=r++,c=e[s];t[c.uuid]=l,e[l]=c,t[a]=s,e[s]=o;for(let e=0,t=i;e!==t;++e){const t=n[e],i=t[s],r=t[l];t[l]=i,t[s]=r}}}this.nCachedObjects_=r},uncache:function(){const e=this._objects,t=this._indicesByUUID,n=this._bindings,i=n.length;let r=this.nCachedObjects_,s=e.length;for(let o=0,a=arguments.length;o!==a;++o){const a=arguments[o].uuid,l=t[a];if(void 0!==l)if(delete t[a],l0){const e=this._interpolants,t=this._propertyBindings;switch(this.blendMode){case 2501:for(let n=0,i=e.length;n!==i;++n)e[n].evaluate(s),t[n].accumulateAdditive(o);break;case 2500:default:for(let n=0,r=e.length;n!==r;++n)e[n].evaluate(s),t[n].accumulate(i,o)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const n=this._weightInterpolant;if(null!==n){const i=n.evaluate(e)[0];t*=i,e>n.parameterPositions[1]&&(this.stopFading(),0===i&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const n=this._timeScaleInterpolant;if(null!==n){t*=n.evaluate(e)[0],e>n.parameterPositions[1]&&(this.stopWarping(),0===t?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,n=this.loop;let i=this.time+e,r=this._loopCount;const s=2202===n;if(0===e)return-1===r?i:s&&1==(1&r)?t-i:i;if(2200===n){-1===r&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(i>=t)i=t;else{if(!(i<0)){this.time=i;break e}i=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(-1===r&&(e>=0?(r=0,this._setEndings(!0,0===this.repetitions,s)):this._setEndings(0===this.repetitions,!0,s)),i>=t||i<0){const n=Math.floor(i/t);i-=t*n,r+=Math.abs(n);const o=this.repetitions-r;if(o<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,i=e>0?t:0,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(1===o){const t=e<0;this._setEndings(t,!t,s)}else this._setEndings(!1,!1,s);this._loopCount=r,this.time=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:n})}}else this.time=i;if(s&&1==(1&r))return t-i}return i}_setEndings(e,t,n){const i=this._interpolantSettings;n?(i.endingStart=2401,i.endingEnd=2401):(i.endingStart=e?this.zeroSlopeAtStart?2401:2400:2402,i.endingEnd=t?this.zeroSlopeAtEnd?2401:2400:2402)}_scheduleFading(e,t,n){const i=this._mixer,r=i.time;let s=this._weightInterpolant;null===s&&(s=i._lendControlInterpolant(),this._weightInterpolant=s);const o=s.parameterPositions,a=s.sampleValues;return o[0]=r,a[0]=t,o[1]=r+e,a[1]=n,this}}function Vd(e){this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}Vd.prototype=Object.assign(Object.create(Oi.prototype),{constructor:Vd,_bindAction:function(e,t){const n=e._localRoot||this._root,i=e._clip.tracks,r=i.length,s=e._propertyBindings,o=e._interpolants,a=n.uuid,l=this._bindingsByRootAndName;let c=l[a];void 0===c&&(c={},l[a]=c);for(let e=0;e!==r;++e){const r=i[e],l=r.name;let h=c[l];if(void 0!==h)s[e]=h;else{if(h=s[e],void 0!==h){null===h._cacheIndex&&(++h.referenceCount,this._addInactiveBinding(h,a,l));continue}const i=t&&t._propertyBindings[e].binding.parsedPath;h=new Pd(kd.create(n,l,i),r.ValueTypeName,r.getValueSize()),++h.referenceCount,this._addInactiveBinding(h,a,l),s[e]=h}o[e].resultBuffer=h.buffer}},_activateAction:function(e){if(!this._isActiveAction(e)){if(null===e._cacheIndex){const t=(e._localRoot||this._root).uuid,n=e._clip.uuid,i=this._actionsByClip[n];this._bindAction(e,i&&i.knownActions[0]),this._addInactiveAction(e,n,t)}const t=e._propertyBindings;for(let e=0,n=t.length;e!==n;++e){const n=t[e];0==n.useCount++&&(this._lendBinding(n),n.saveOriginalState())}this._lendAction(e)}},_deactivateAction:function(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let e=0,n=t.length;e!==n;++e){const n=t[e];0==--n.useCount&&(n.restoreOriginalState(),this._takeBackBinding(n))}this._takeBackAction(e)}},_initMemoryManager:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}},_isActiveAction:function(e){const t=e._cacheIndex;return null!==t&&t=0;--t)e[t].stop();return this},update:function(e){e*=this.timeScale;const t=this._actions,n=this._nActiveActions,i=this.time+=e,r=Math.sign(e),s=this._accuIndex^=1;for(let o=0;o!==n;++o){t[o]._update(i,e,r,s)}const o=this._bindings,a=this._nActiveBindings;for(let e=0;e!==a;++e)o[e].apply(s);return this},setTime:function(e){this.time=0;for(let e=0;e4?o=$d[r-8+4-1]:0==r&&(o=0),n.push(o);const a=1/(s-1),l=-a/2,c=1+a/2,h=[l,l,c,l,c,c,l,l,c,c,l,c],u=6,d=6,p=3,f=2,m=1,g=new Float32Array(p*d*u),v=new Float32Array(f*d*u),y=new Float32Array(m*d*u);for(let e=0;e2?0:-1,i=[t,n,0,t+2/3,n,0,t+2/3,n+1,0,t,n,0,t+2/3,n+1,0,t,n+1,0];g.set(i,p*d*e),v.set(h,f*d*e);const r=[e,e,e,e,e,e];y.set(r,m*d*e)}const x=new Hs;x.setAttribute("position",new Ms(g,p)),x.setAttribute("uv",new Ms(v,f)),x.setAttribute("faceIndex",new Ms(y,m)),e.push(x),i>4&&i--}return{_lodPlanes:e,_sizeLods:t,_sigmas:n}}()),rp=(1+Math.sqrt(5))/2,sp=1/rp;new Zi(1,1,1),new Zi(-1,1,1),new Zi(1,1,-1),new Zi(-1,1,-1),new Zi(0,rp,sp),new Zi(0,rp,-sp),new Zi(sp,0,rp),new Zi(-sp,0,rp),new Zi(rp,sp,0),new Zi(-rp,sp,0);function op(e){console.warn("THREE.Spline has been removed. Use THREE.CatmullRomCurve3 instead."),Nu.call(this,e),this.type="catmullrom"}Su.create=function(e,t){return console.log("THREE.Curve.create() has been deprecated"),e.prototype=Object.create(Su.prototype),e.prototype.constructor=e,e.prototype.getPoint=t,e},Object.assign(ju.prototype,{createPointsGeometry:function(e){console.warn("THREE.CurvePath: .createPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");const t=this.getPoints(e);return this.createGeometry(t)},createSpacedPointsGeometry:function(e){console.warn("THREE.CurvePath: .createSpacedPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");const t=this.getSpacedPoints(e);return this.createGeometry(t)},createGeometry:function(e){console.warn("THREE.CurvePath: .createGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");const t=new fo;for(let n=0,i=e.length;nthis.max.x||e.ythis.max.y)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return void 0===t&&(console.warn("THREE.Box2: .getParameter() target is now required"),t=new Fi),t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y)}clampPoint(e,t){return void 0===t&&(console.warn("THREE.Box2: .clampPoint() target is now required"),t=new Fi),t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return Kd.copy(e).clamp(this.min,this.max).sub(e).length()}intersect(e){return this.min.max(e.min),this.max.min(e.max),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}.prototype,{center:function(e){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(e)},empty:function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(e){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},size:function(e){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.getSize(e)}}),Object.assign(Qi.prototype,{center:function(e){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(e)},empty:function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(e){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},isIntersectionSphere:function(e){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(e)},size:function(e){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(e)}}),Object.assign(fr.prototype,{empty:function(){return console.warn("THREE.Sphere: .empty() has been renamed to .isEmpty()."),this.isEmpty()}}),Ao.prototype.setFromMatrix=function(e){return console.warn("THREE.Frustum: .setFromMatrix() has been renamed to .setFromProjectionMatrix()."),this.setFromProjectionMatrix(e)},Object.assign(Bi,{random16:function(){return console.warn("THREE.Math: .random16() has been deprecated. Use Math.random() instead."),Math.random()},nearestPowerOfTwo:function(e){return console.warn("THREE.Math: .nearestPowerOfTwo() has been renamed to .floorPowerOfTwo()."),Bi.floorPowerOfTwo(e)},nextPowerOfTwo:function(e){return console.warn("THREE.Math: .nextPowerOfTwo() has been renamed to .ceilPowerOfTwo()."),Bi.ceilPowerOfTwo(e)}}),Object.assign(Gi.prototype,{flattenToArrayOffset:function(e,t){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(e,t)},multiplyVector3:function(e){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),e.applyMatrix3(this)},multiplyVector3Array:function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")},applyToBufferAttribute:function(e){return console.warn("THREE.Matrix3: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix3( matrix ) instead."),e.applyMatrix3(this)},applyToVector3Array:function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")}}),Object.assign(Mr.prototype,{extractPosition:function(e){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(e)},flattenToArrayOffset:function(e,t){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(e,t)},getPosition:function(){return console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),(new Zi).setFromMatrixColumn(this,3)},setRotationFromQuaternion:function(e){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(e)},multiplyToArray:function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")},multiplyVector3:function(e){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},multiplyVector4:function(e){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},multiplyVector3Array:function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")},rotateAxis:function(e){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),e.transformDirection(this)},crossVector:function(e){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},translate:function(){console.error("THREE.Matrix4: .translate() has been removed.")},rotateX:function(){console.error("THREE.Matrix4: .rotateX() has been removed.")},rotateY:function(){console.error("THREE.Matrix4: .rotateY() has been removed.")},rotateZ:function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")},rotateByAxis:function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},applyToBufferAttribute:function(e){return console.warn("THREE.Matrix4: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},applyToVector3Array:function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},makeFrustum:function(e,t,n,i,r,s){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(e,t,i,n,r,s)}}),Qr.prototype.isIntersectionLine=function(e){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(e)},Yi.prototype.multiplyVector3=function(e){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),e.applyQuaternion(this)},Object.assign(wr.prototype,{isIntersectionBox:function(e){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},isIntersectionPlane:function(e){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(e)},isIntersectionSphere:function(e){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(e)}}),Object.assign(cs.prototype,{area:function(){return console.warn("THREE.Triangle: .area() has been renamed to .getArea()."),this.getArea()},barycoordFromPoint:function(e,t){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),this.getBarycoord(e,t)},midpoint:function(e){return console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint()."),this.getMidpoint(e)},normal:function(e){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),this.getNormal(e)},plane:function(e){return console.warn("THREE.Triangle: .plane() has been renamed to .getPlane()."),this.getPlane(e)}}),Object.assign(cs,{barycoordFromPoint:function(e,t,n,i,r){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),cs.getBarycoord(e,t,n,i,r)},normal:function(e,t,n,i){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),cs.getNormal(e,t,n,i)}}),Object.assign(qu.prototype,{extractAllPoints:function(e){return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(e)},extrude:function(e){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new Sh(this,e)},makeGeometry:function(e){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new Nh(this,e)}}),Object.assign(Fi.prototype,{fromAttribute:function(e,t,n){return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},distanceToManhattan:function(e){return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(e)},lengthManhattan:function(){return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(Zi.prototype,{setEulerFromRotationMatrix:function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},setEulerFromQuaternion:function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},getPositionFromMatrix:function(e){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(e)},getScaleFromMatrix:function(e){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(e)},getColumnFromMatrix:function(e,t){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(t,e)},applyProjection:function(e){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(e)},fromAttribute:function(e,t,n){return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},distanceToManhattan:function(e){return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(e)},lengthManhattan:function(){return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(Wi.prototype,{fromAttribute:function(e,t,n){return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},lengthManhattan:function(){return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(fo.prototype,{computeTangents:function(){console.error("THREE.Geometry: .computeTangents() has been removed.")},computeLineDistances:function(){console.error("THREE.Geometry: .computeLineDistances() has been removed. Use THREE.Line.computeLineDistances() instead.")},applyMatrix:function(e){return console.warn("THREE.Geometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)}}),Object.assign(Yr.prototype,{getChildByName:function(e){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(e)},renderDepth:function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},translate:function(e,t){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(t,e)},getWorldRotation:function(){console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.")},applyMatrix:function(e){return console.warn("THREE.Object3D: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)}}),Object.defineProperties(Yr.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(e){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=e}},useQuaternion:{get:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")}}}),Object.assign(oo.prototype,{setDrawMode:function(){console.error("THREE.Mesh: .setDrawMode() has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}),Object.defineProperties(oo.prototype,{drawMode:{get:function(){return console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode."),0},set:function(){console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}}),Object.defineProperties(ac.prototype,{objects:{get:function(){return console.warn("THREE.LOD: .objects has been renamed to .levels."),this.levels}}}),Object.defineProperty(uc.prototype,"useVertexTexture",{get:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")},set:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")}}),lc.prototype.initBones=function(){console.error("THREE.SkinnedMesh: initBones() has been removed.")},Object.defineProperty(Su.prototype,"__arcLengthDivisions",{get:function(){return console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions},set:function(e){console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions=e}}),bo.prototype.setLens=function(e,t){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),void 0!==t&&(this.filmGauge=t),this.setFocalLength(e)},Object.defineProperties(Xu.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(e){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=e}},shadowCameraLeft:{set:function(e){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=e}},shadowCameraRight:{set:function(e){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=e}},shadowCameraTop:{set:function(e){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=e}},shadowCameraBottom:{set:function(e){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=e}},shadowCameraNear:{set:function(e){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=e}},shadowCameraFar:{set:function(e){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=e}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(e){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=e}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(e){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=e}},shadowMapHeight:{set:function(e){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=e}}}),Object.defineProperties(Ms.prototype,{length:{get:function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead."),this.array.length}},dynamic:{get:function(){return console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),35048===this.usage},set:function(){console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.setUsage(35048)}}}),Object.assign(Ms.prototype,{setDynamic:function(e){return console.warn("THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===e?35048:35044),this},copyIndicesArray:function(){console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed.")},setArray:function(){console.error("THREE.BufferAttribute: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")}}),Object.assign(Hs.prototype,{addIndex:function(e){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(e)},addAttribute:function(e,t){return console.warn("THREE.BufferGeometry: .addAttribute() has been renamed to .setAttribute()."),t&&t.isBufferAttribute||t&&t.isInterleavedBufferAttribute?"index"===e?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(t),this):this.setAttribute(e,t):(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.setAttribute(e,new Ms(arguments[1],arguments[2])))},addDrawCall:function(e,t,n){void 0!==n&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(e,t)},clearDrawCalls:function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()},computeTangents:function(){console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")},computeOffsets:function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")},removeAttribute:function(e){return console.warn("THREE.BufferGeometry: .removeAttribute() has been renamed to .deleteAttribute()."),this.deleteAttribute(e)},applyMatrix:function(e){return console.warn("THREE.BufferGeometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)}}),Object.defineProperties(Hs.prototype,{drawcalls:{get:function(){return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),this.groups}},offsets:{get:function(){return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),this.groups}}}),Object.defineProperties(hd.prototype,{maxInstancedCount:{get:function(){return console.warn("THREE.InstancedBufferGeometry: .maxInstancedCount has been renamed to .instanceCount."),this.instanceCount},set:function(e){console.warn("THREE.InstancedBufferGeometry: .maxInstancedCount has been renamed to .instanceCount."),this.instanceCount=e}}}),Object.defineProperties(Xd.prototype,{linePrecision:{get:function(){return console.warn("THREE.Raycaster: .linePrecision has been deprecated. Use .params.Line.threshold instead."),this.params.Line.threshold},set:function(e){console.warn("THREE.Raycaster: .linePrecision has been deprecated. Use .params.Line.threshold instead."),this.params.Line.threshold=e}}}),Object.defineProperties(Gl.prototype,{dynamic:{get:function(){return console.warn("THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead."),35048===this.usage},set:function(e){console.warn("THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead."),this.setUsage(e)}}}),Object.assign(Gl.prototype,{setDynamic:function(e){return console.warn("THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===e?35048:35044),this},setArray:function(){console.error("THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")}}),Object.assign(Th.prototype,{getArrays:function(){console.error("THREE.ExtrudeBufferGeometry: .getArrays() has been removed.")},addShapeList:function(){console.error("THREE.ExtrudeBufferGeometry: .addShapeList() has been removed.")},addShape:function(){console.error("THREE.ExtrudeBufferGeometry: .addShape() has been removed.")}}),Object.assign(Fl.prototype,{dispose:function(){console.error("THREE.Scene: .dispose() has been removed.")}}),Object.defineProperties(jd.prototype,{dynamic:{set:function(){console.warn("THREE.Uniform: .dynamic has been removed. Use object.onBeforeRender() instead.")}},onUpdate:{value:function(){return console.warn("THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead."),this}}}),Object.defineProperties(xs.prototype,{wrapAround:{get:function(){console.warn("THREE.Material: .wrapAround has been removed.")},set:function(){console.warn("THREE.Material: .wrapAround has been removed.")}},overdraw:{get:function(){console.warn("THREE.Material: .overdraw has been removed.")},set:function(){console.warn("THREE.Material: .overdraw has been removed.")}},wrapRGB:{get:function(){return console.warn("THREE.Material: .wrapRGB has been removed."),new gs}},shading:{get:function(){console.error("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.")},set:function(e){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===e}},stencilMask:{get:function(){return console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask},set:function(e){console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask=e}}}),Object.defineProperties(jh.prototype,{metal:{get:function(){return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),!1},set:function(){console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")}}}),Object.defineProperties(Vh.prototype,{transparency:{get:function(){return console.warn("THREE.MeshPhysicalMaterial: .transparency has been renamed to .transmission."),this.transmission},set:function(e){console.warn("THREE.MeshPhysicalMaterial: .transparency has been renamed to .transmission."),this.transmission=e}}}),Object.defineProperties(xo.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(e){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=e}}}),Object.assign(Ol.prototype,{clearTarget:function(e,t,n,i){console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."),this.setRenderTarget(e),this.clear(t,n,i)},animate:function(e){console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop()."),this.setAnimationLoop(e)},getCurrentRenderTarget:function(){return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."),this.getRenderTarget()},getMaxAnisotropy:function(){return console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."),this.capabilities.getMaxAnisotropy()},getPrecision:function(){return console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision."),this.capabilities.precision},resetGLState:function(){return console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset()."),this.state.reset()},supportsFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")},supportsHalfFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")},supportsStandardDerivatives:function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")},supportsCompressedTextureS3TC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")},supportsCompressedTexturePVRTC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")},supportsBlendMinMax:function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")},supportsVertexTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."),this.capabilities.vertexTextures},supportsInstancedArrays:function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")},enableScissorTest:function(e){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(e)},initMaterial:function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},addPrePlugin:function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},addPostPlugin:function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},updateShadowMap:function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")},setFaceCulling:function(){console.warn("THREE.WebGLRenderer: .setFaceCulling() has been removed.")},allocTextureUnit:function(){console.warn("THREE.WebGLRenderer: .allocTextureUnit() has been removed.")},setTexture:function(){console.warn("THREE.WebGLRenderer: .setTexture() has been removed.")},setTexture2D:function(){console.warn("THREE.WebGLRenderer: .setTexture2D() has been removed.")},setTextureCube:function(){console.warn("THREE.WebGLRenderer: .setTextureCube() has been removed.")},getActiveMipMapLevel:function(){return console.warn("THREE.WebGLRenderer: .getActiveMipMapLevel() is now .getActiveMipmapLevel()."),this.getActiveMipmapLevel()}}),Object.defineProperties(Ol.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=e}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=e}},shadowMapCullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")}},context:{get:function(){return console.warn("THREE.WebGLRenderer: .context has been removed. Use .getContext() instead."),this.getContext()}},vr:{get:function(){return console.warn("THREE.WebGLRenderer: .vr has been renamed to .xr"),this.xr}},gammaInput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead."),!1},set:function(){console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead.")}},gammaOutput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),!1},set:function(e){console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),this.outputEncoding=!0===e?3001:3e3}},toneMappingWhitePoint:{get:function(){return console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed."),1},set:function(){console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed.")}}}),Object.defineProperties(El.prototype,{cullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")}},renderReverseSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")}},renderSingleSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")}}}),Object.defineProperties(qi.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(e){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=e}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(e){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=e}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(e){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=e}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(e){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=e}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(e){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=e}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(e){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=e}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(e){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=e}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(e){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=e}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(e){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=e}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(e){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=e}}}),Object.defineProperties(class extends Yr{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(e){if(void 0===e&&(e=0),!0===this.isPlaying)return void console.warn("THREE.Audio: Audio is already playing.");if(!1===this.hasPlaybackControl)return void console.warn("THREE.Audio: this Audio has no playback control.");this._startedAt=this.context.currentTime+e;const t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(!1!==this.hasPlaybackControl)return!0===this.isPlaying&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,!0===this.loop&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this;console.warn("THREE.Audio: this Audio has no playback control.")}stop(){if(!1!==this.hasPlaybackControl)return this._progress=0,this.source.stop(),this.source.onended=null,this.isPlaying=!1,this;console.warn("THREE.Audio: this Audio has no playback control.")}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;eMath.PI&&(t-=a),h<-Math.PI?h+=a:h>Math.PI&&(h-=a),m.theta=t(t+h)/2?Math.max(t,m.theta):Math.min(h,m.theta)),m.phi=Math.max(l.minPolarAngle,Math.min(l.maxPolarAngle,m.phi)),m.makeSafe(),m.radius*=v,m.radius=Math.max(l.minDistance,Math.min(l.maxDistance,m.radius)),!0===l.enableDamping?l.target.addScaledVector(y,l.dampingFactor):l.target.add(y),n.setFromSpherical(m),n.applyQuaternion(r),e.copy(l.target).add(n),l.object.lookAt(l.target),!0===l.enableDamping?(g.theta*=1-l.dampingFactor,g.phi*=1-l.dampingFactor,y.multiplyScalar(1-l.dampingFactor)):(g.set(0,0,0),y.set(0,0,0)),v=1,!!(x||s.distanceToSquared(l.object.position)>f||8*(1-o.dot(l.object.quaternion))>f)&&(l.dispatchEvent(c),s.copy(l.object.position),o.copy(l.object.quaternion),x=!1,!0)}),this.dispose=function(){l.domElement.removeEventListener("contextmenu",ee,!1),l.domElement.removeEventListener("pointerdown",q,!1),l.domElement.removeEventListener("wheel",Z,!1),l.domElement.removeEventListener("touchstart",K,!1),l.domElement.removeEventListener("touchend",$,!1),l.domElement.removeEventListener("touchmove",Q,!1),l.domElement.ownerDocument.removeEventListener("pointermove",X,!1),l.domElement.ownerDocument.removeEventListener("pointerup",Y,!1),l.domElement.removeEventListener("keydown",J,!1)};var l=this,c={type:"change"},h={type:"start"},u={type:"end"},d={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},p=d.NONE,f=1e-6,m=new Jd,g=new Jd,v=1,y=new Zi,x=!1,_=new Fi,b=new Fi,w=new Fi,M=new Fi,S=new Fi,T=new Fi,E=new Fi,A=new Fi,C=new Fi;function L(){return Math.pow(.95,l.zoomSpeed)}function R(e){g.theta-=e}function P(e){g.phi-=e}var N,D=(N=new Zi,function(e,t){N.setFromMatrixColumn(t,0),N.multiplyScalar(-e),y.add(N)}),I=function(){var e=new Zi;return function(t,n){!0===l.screenSpacePanning?e.setFromMatrixColumn(n,1):(e.setFromMatrixColumn(n,0),e.crossVectors(l.object.up,e)),e.multiplyScalar(t),y.add(e)}}(),O=function(){var e=new Zi;return function(t,n){var i=l.domElement;if(l.object.isPerspectiveCamera){var r=l.object.position;e.copy(r).sub(l.target);var s=e.length();s*=Math.tan(l.object.fov/2*Math.PI/180),D(2*t*s/i.clientHeight,l.object.matrix),I(2*n*s/i.clientHeight,l.object.matrix)}else l.object.isOrthographicCamera?(D(t*(l.object.right-l.object.left)/l.object.zoom/i.clientWidth,l.object.matrix),I(n*(l.object.top-l.object.bottom)/l.object.zoom/i.clientHeight,l.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),l.enablePan=!1)}}();function z(e){l.object.isPerspectiveCamera?v/=e:l.object.isOrthographicCamera?(l.object.zoom=Math.max(l.minZoom,Math.min(l.maxZoom,l.object.zoom*e)),l.object.updateProjectionMatrix(),x=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1)}function U(e){l.object.isPerspectiveCamera?v*=e:l.object.isOrthographicCamera?(l.object.zoom=Math.max(l.minZoom,Math.min(l.maxZoom,l.object.zoom/e)),l.object.updateProjectionMatrix(),x=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1)}function B(e){_.set(e.clientX,e.clientY)}function F(e){M.set(e.clientX,e.clientY)}function G(e){if(1==e.touches.length)_.set(e.touches[0].pageX,e.touches[0].pageY);else{var t=.5*(e.touches[0].pageX+e.touches[1].pageX),n=.5*(e.touches[0].pageY+e.touches[1].pageY);_.set(t,n)}}function k(e){if(1==e.touches.length)M.set(e.touches[0].pageX,e.touches[0].pageY);else{var t=.5*(e.touches[0].pageX+e.touches[1].pageX),n=.5*(e.touches[0].pageY+e.touches[1].pageY);M.set(t,n)}}function H(e){var t=e.touches[0].pageX-e.touches[1].pageX,n=e.touches[0].pageY-e.touches[1].pageY,i=Math.sqrt(t*t+n*n);E.set(0,i)}function V(e){if(1==e.touches.length)b.set(e.touches[0].pageX,e.touches[0].pageY);else{var t=.5*(e.touches[0].pageX+e.touches[1].pageX),n=.5*(e.touches[0].pageY+e.touches[1].pageY);b.set(t,n)}w.subVectors(b,_).multiplyScalar(l.rotateSpeed);var i=l.domElement;R(2*Math.PI*w.x/i.clientHeight),P(2*Math.PI*w.y/i.clientHeight),_.copy(b)}function j(e){if(1==e.touches.length)S.set(e.touches[0].pageX,e.touches[0].pageY);else{var t=.5*(e.touches[0].pageX+e.touches[1].pageX),n=.5*(e.touches[0].pageY+e.touches[1].pageY);S.set(t,n)}T.subVectors(S,M).multiplyScalar(l.panSpeed),O(T.x,T.y),M.copy(S)}function W(e){var t=e.touches[0].pageX-e.touches[1].pageX,n=e.touches[0].pageY-e.touches[1].pageY,i=Math.sqrt(t*t+n*n);A.set(0,i),C.set(0,Math.pow(A.y/E.y,l.zoomSpeed)),z(C.y),E.copy(A)}function q(e){if(!1!==l.enabled)switch(e.pointerType){case"mouse":!function(e){var t;switch(e.preventDefault(),l.domElement.focus?l.domElement.focus():window.focus(),e.button){case 0:t=l.mouseButtons.LEFT;break;case 1:t=l.mouseButtons.MIDDLE;break;case 2:t=l.mouseButtons.RIGHT;break;default:t=-1}switch(t){case Li:if(!1===l.enableZoom)return;!function(e){E.set(e.clientX,e.clientY)}(e),p=d.DOLLY;break;case Ci:if(e.ctrlKey||e.metaKey||e.shiftKey){if(!1===l.enablePan)return;F(e),p=d.PAN}else{if(!1===l.enableRotate)return;B(e),p=d.ROTATE}break;case Ri:if(e.ctrlKey||e.metaKey||e.shiftKey){if(!1===l.enableRotate)return;B(e),p=d.ROTATE}else{if(!1===l.enablePan)return;F(e),p=d.PAN}break;default:p=d.NONE}p!==d.NONE&&(l.domElement.ownerDocument.addEventListener("pointermove",X,!1),l.domElement.ownerDocument.addEventListener("pointerup",Y,!1),l.dispatchEvent(h))}(e)}}function X(e){if(!1!==l.enabled)switch(e.pointerType){case"mouse":!function(e){if(!1===l.enabled)return;switch(e.preventDefault(),p){case d.ROTATE:if(!1===l.enableRotate)return;!function(e){b.set(e.clientX,e.clientY),w.subVectors(b,_).multiplyScalar(l.rotateSpeed);var t=l.domElement;R(2*Math.PI*w.x/t.clientHeight),P(2*Math.PI*w.y/t.clientHeight),_.copy(b),l.update()}(e);break;case d.DOLLY:if(!1===l.enableZoom)return;!function(e){A.set(e.clientX,e.clientY),C.subVectors(A,E),C.y>0?z(L()):C.y<0&&U(L()),E.copy(A),l.update()}(e);break;case d.PAN:if(!1===l.enablePan)return;!function(e){S.set(e.clientX,e.clientY),T.subVectors(S,M).multiplyScalar(l.panSpeed),O(T.x,T.y),M.copy(S),l.update()}(e)}}(e)}}function Y(e){if(!1!==l.enabled)switch(e.pointerType){case"mouse":!function(e){if(!1===l.enabled)return;l.domElement.ownerDocument.removeEventListener("pointermove",X,!1),l.domElement.ownerDocument.removeEventListener("pointerup",Y,!1),l.dispatchEvent(u),p=d.NONE}()}}function Z(e){!1===l.enabled||!1===l.enableZoom||p!==d.NONE&&p!==d.ROTATE||(e.preventDefault(),e.stopPropagation(),l.dispatchEvent(h),function(e){e.deltaY<0?U(L()):e.deltaY>0&&z(L()),l.update()}(e),l.dispatchEvent(u))}function J(e){!1!==l.enabled&&!1!==l.enableKeys&&!1!==l.enablePan&&function(e){var t=!1;switch(e.keyCode){case l.keys.UP:O(0,l.keyPanSpeed),t=!0;break;case l.keys.BOTTOM:O(0,-l.keyPanSpeed),t=!0;break;case l.keys.LEFT:O(l.keyPanSpeed,0),t=!0;break;case l.keys.RIGHT:O(-l.keyPanSpeed,0),t=!0}t&&(e.preventDefault(),l.update())}(e)}function K(e){if(!1!==l.enabled){switch(e.preventDefault(),e.touches.length){case 1:switch(l.touches.ONE){case Pi:if(!1===l.enableRotate)return;G(e),p=d.TOUCH_ROTATE;break;case Ni:if(!1===l.enablePan)return;k(e),p=d.TOUCH_PAN;break;default:p=d.NONE}break;case 2:switch(l.touches.TWO){case Di:if(!1===l.enableZoom&&!1===l.enablePan)return;!function(e){l.enableZoom&&H(e),l.enablePan&&k(e)}(e),p=d.TOUCH_DOLLY_PAN;break;case Ii:if(!1===l.enableZoom&&!1===l.enableRotate)return;!function(e){l.enableZoom&&H(e),l.enableRotate&&G(e)}(e),p=d.TOUCH_DOLLY_ROTATE;break;default:p=d.NONE}break;default:p=d.NONE}p!==d.NONE&&l.dispatchEvent(h)}}function Q(e){if(!1!==l.enabled)switch(e.preventDefault(),e.stopPropagation(),p){case d.TOUCH_ROTATE:if(!1===l.enableRotate)return;V(e),l.update();break;case d.TOUCH_PAN:if(!1===l.enablePan)return;j(e),l.update();break;case d.TOUCH_DOLLY_PAN:if(!1===l.enableZoom&&!1===l.enablePan)return;!function(e){l.enableZoom&&W(e),l.enablePan&&j(e)}(e),l.update();break;case d.TOUCH_DOLLY_ROTATE:if(!1===l.enableZoom&&!1===l.enableRotate)return;!function(e){l.enableZoom&&W(e),l.enableRotate&&V(e)}(e),l.update();break;default:p=d.NONE}}function $(e){!1!==l.enabled&&(l.dispatchEvent(u),p=d.NONE)}function ee(e){!1!==l.enabled&&e.preventDefault()}l.domElement.addEventListener("contextmenu",ee,!1),l.domElement.addEventListener("pointerdown",q,!1),l.domElement.addEventListener("wheel",Z,!1),l.domElement.addEventListener("touchstart",K,!1),l.domElement.addEventListener("touchend",$,!1),l.domElement.addEventListener("touchmove",Q,!1),l.domElement.addEventListener("keydown",J,!1),-1===l.domElement.tabIndex&&(l.domElement.tabIndex=0),this.update()};(ap.prototype=Object.create(Oi.prototype)).constructor=ap;var lp=function(e,t){ap.call(this,e,t),this.screenSpacePanning=!1,this.mouseButtons.LEFT=Ri,this.mouseButtons.RIGHT=Ci,this.touches.ONE=Ni,this.touches.TWO=Ii};function cp(){const e={canvas:null,antialias:!0,alpha:!1,autoClear:!0,orbit_ctrl:!1,mouse_move:!1,mouse_raycast:!1,resize:"window",width:0,height:0},t={width:0,height:0,wWidth:0,wHeight:0,ratio:0};let n=[],i=[],r=[];const s=new Fi,o=new Zi,a=new Qr(new Zi(0,0,1),0),l=new Xd,c={conf:e,renderer:null,camera:null,cameraCtrl:null,materials:{},scene:null,size:t,mouse:s,mouseV3:o,init:function(t){t&&Object.entries(t).forEach(([t,n])=>{e[t]=n});if(!c.scene)return void console.error("Missing Scene");if(!c.camera)return void console.error("Missing Camera");c.renderer=new Ol({canvas:e.canvas,antialias:e.antialias,alpha:e.alpha}),c.renderer.autoClear=e.autoClear,e.orbit_ctrl&&(c.orbitCtrl=new ap(c.camera,c.renderer.domElement),e.orbit_ctrl instanceof Object&&Object.entries(e.orbit_ctrl).forEach(([e,t])=>{c.orbitCtrl[e]=t}));e.width&&e.height?f(e.width,e.height):e.resize&&(p(),window.addEventListener("resize",p));e.mouse_move&&("body"===e.mouse_move?c.mouse_move_element=document.body:c.mouse_move_element=c.renderer.domElement,c.mouse_move_element.addEventListener("mousemove",h),c.mouse_move_element.addEventListener("mouseleave",u));return n.forEach(e=>e()),!0},dispose:function(){r=[],window.removeEventListener("resize",p),c.mouse_move_element&&(c.mouse_move_element.removeEventListener("mousemove",h),c.mouse_move_element.removeEventListener("mouseleave",u));c.orbitCtrl&&c.orbitCtrl.dispose();this.renderer.dispose()},render:function(){c.orbitCtrl&&c.orbitCtrl.update();r.forEach(e=>e()),c.renderer.render(c.scene,c.camera)},renderC:function(){c.orbitCtrl&&c.orbitCtrl.update();r.forEach(e=>e()),c.composer.render()},setSize:f,onAfterInit:function(e){n.push(e)},onAfterResize:function(e){i.push(e)},offAfterResize:function(e){i=i.filter(t=>t!==e)},onBeforeRender:function(e){r.push(e)},offBeforeRender:function(e){r=r.filter(t=>t!==e)}};function h(e){s.x=e.clientX/t.width*2-1,s.y=-e.clientY/t.height*2+1,d()}function u(e){s.x=0,s.y=0,d()}function d(){e.mouse_raycast&&(c.camera.getWorldDirection(a.normal),a.normal.normalize(),l.setFromCamera(s,c.camera),l.ray.intersectPlane(a,o))}function p(){"window"===e.resize?f(window.innerWidth,window.innerHeight):f(e.resize.clientWidth,e.resize.clientHeight),i.forEach(e=>e())}function f(e,n){t.width=e,t.height=n,t.ratio=e/n,c.renderer.setSize(e,n,!1),c.camera.aspect=t.ratio,c.camera.updateProjectionMatrix(),c.composer&&c.composer.setSize(e,n);const i=function(){const e=c.camera.fov*Math.PI/180,t=2*Math.tan(e/2)*Math.abs(c.camera.position.z);return[t*c.camera.aspect,t]}();t.wWidth=i[0],t.wHeight=i[1]}return c}(lp.prototype=Object.create(Oi.prototype)).constructor=lp;var hp={props:{antialias:{type:Boolean,default:!0},alpha:{type:Boolean,default:!1},autoClear:{type:Boolean,default:!0},shadow:{type:Boolean,default:!1},orbitCtrl:{type:[Boolean,Object],default:!1},mouseMove:{type:[Boolean,String],default:!1},mouseRaycast:{type:Boolean,default:!1},resize:{type:[Boolean,String,Element],default:"window"},width:String,height:String},setup:()=>({three:cp(),raf:!0,onMountedCallbacks:[]}),provide(){return{three:this.three,rendererComponent:this}},mounted(){const e={canvas:this.$refs.canvas,antialias:this.antialias,alpha:this.alpha,autoClear:this.autoClear,orbit_ctrl:this.orbitCtrl,mouse_move:this.mouseMove,mouse_raycast:this.mouseRaycast,resize:this.resize,width:this.width,height:this.height};this.three.init(e)&&(this.three.renderer.shadowMap.enabled=this.shadow,this.three.composer?this.animateC():this.animate()),this.onMountedCallbacks.forEach(e=>e())},beforeUnmount(){this.raf=!1,this.three.dispose()},methods:{onMounted(e){this.onMountedCallbacks.push(e)},onBeforeRender(e){this.three.onBeforeRender(e)},onAfterResize(e){this.three.onAfterResize(e)},animate(){this.raf&&requestAnimationFrame(this.animate),this.three.render()},animateC(){this.raf&&requestAnimationFrame(this.animateC),this.three.renderC()}},render(){return function(e,t,n){const i=arguments.length;return 2===i?S(t)&&!_(t)?Gt(t)?jt(e,null,[t]):jt(e,t):jt(e,null,t):(i>3?n=Array.prototype.slice.call(arguments,2):3===i&&Gt(n)&&(n=[n]),jt(e,t,n))}("canvas",{ref:"canvas"},this.$slots.default())}};function up(e,t){t instanceof Object&&Object.entries(t).forEach(([t,n])=>{e[t]=n})}function dp(e,t){const n={};return Object.entries(e).forEach(([e,i])=>{(!t||t&&!t.includes(e))&&(n[e]=i)}),n}function pp(e,t,n){return e+(t-e)*(n=(n=n<0?0:n)>1?1:n)}function fp(e,t,n){return en?n:e}function mp(e,t,n){if(e[t]){const i=function(e,t){return new qe(e,t)}(e,t);up(n,i.value),On(i,()=>{up(n,i.value)},{deep:!0})}}var gp={inject:["three"],props:{aspect:{type:Number,default:1},far:{type:Number,default:2e3},fov:{type:Number,default:50},near:{type:Number,default:.1},position:{type:[Object,Zi],default:{x:0,y:0,z:0}}},created(){this.camera=new bo(this.fov,this.aspect,this.near,this.far),mp(this,"position",this.camera.position),["aspect","far","fov","near"].forEach(e=>{On(()=>this[e],()=>{this.camera[e]=this[e],this.camera.updateProjectionMatrix()})}),this.three.camera=this.camera},render:()=>[],__hmrId:"PerspectiveCamera"},vp={inject:["three"],props:{id:String,background:[String,Number]},setup(e){const t=new Fl;return e.background&&(t.background=new gs(e.background)),On(()=>e.background,e=>{t.background=new gs(e)}),{scene:t}},provide(){return{scene:this.scene}},mounted(){this.three.scene||(this.three.scene=this.scene)},methods:{},render(){return this.$slots.default?this.$slots.default():[]}},yp={emits:["ready"],inject:["mesh"],created(){this.mesh||console.error("Missing parent Mesh"),this.watchProps=[],Object.entries(this.$props).forEach(e=>this.watchProps.push(e[0]))},beforeMount(){this.createGeometry(),this.mesh.setGeometry(this.geometry)},mounted(){this.addWatchers()},unmounted(){this.geometry.dispose()},methods:{addWatchers(){this.watchProps.forEach(e=>{On(()=>this[e],()=>{this.refreshGeometry()})})},refreshGeometry(){const e=this.geometry;this.createGeometry(),this.mesh.setGeometry(this.geometry),e.dispose()}},render:()=>[]},xp={extends:yp,props:{size:Number,width:{type:Number,default:1},height:{type:Number,default:1},depth:{type:Number,default:1},widthSegments:{type:Number,default:1},heightSegments:{type:Number,default:1},depthSegments:{type:Number,default:1}},methods:{createGeometry(){let e=this.width,t=this.height,n=this.depth;this.size&&(e=this.size,t=this.size,n=this.size),this.geometry=new mo(e,t,n,this.widthSegments,this.heightSegments,this.depthSegments)}}},_p={extends:yp,props:{radius:{type:Number,default:1},segments:{type:Number,default:8},thetaStart:{type:Number,default:0},thetaLength:{type:Number,default:2*Math.PI}},methods:{createGeometry(){this.geometry=new Bh(this.radius,this.segments,this.thetaStart,this.thetaLength)}}},bp={extends:yp,props:{radius:{type:Number,default:1},height:{type:Number,default:1},radialSegments:{type:Number,default:8},heightSegments:{type:Number,default:1},openEnded:{type:Boolean,default:!1},thetaStart:{type:Number,default:0},thetaLength:{type:Number,default:2*Math.PI}},methods:{createGeometry(){this.geometry=new Uh(this.radius,this.height,this.radialSegments,this.heightSegments,this.openEnded,this.thetaStart,this.thetaLength)}}},wp={extends:yp,props:{radiusTop:{type:Number,default:1},radiusBottom:{type:Number,default:1},height:{type:Number,default:1},radialSegments:{type:Number,default:8},heightSegments:{type:Number,default:1},openEnded:{type:Boolean,default:!1},thetaStart:{type:Number,default:0},thetaLength:{type:Number,default:2*Math.PI}},methods:{createGeometry(){this.geometry=new zh(this.radiusTop,this.radiusBottom,this.height,this.radialSegments,this.heightSegments,this.openEnded,this.thetaStart,this.thetaLength)}}},Mp={extends:yp,props:{radius:{type:Number,default:1},detail:{type:Number,default:0}},methods:{createGeometry(){this.geometry=new qc(this.radius,this.detail)}}},Sp={extends:yp,props:{radius:{type:Number,default:1},detail:{type:Number,default:0}},methods:{createGeometry(){this.geometry=new Wc(this.radius,this.detail)}}},Tp={extends:yp,props:{points:Array,segments:{type:Number,default:12},phiStart:{type:Number,default:0},phiLength:{type:Number,default:2*Math.PI}},methods:{createGeometry(){this.geometry=new Ph(this.points,this.segments,this.phiStart,this.phiLength)}}},Ep={extends:yp,props:{radius:{type:Number,default:1},detail:{type:Number,default:0}},methods:{createGeometry(){this.geometry=new jc(this.radius,this.detail)}}},Ap={extends:yp,props:{vertices:Array,indices:Array,radius:{type:Number,default:1},detail:{type:Number,default:0}},methods:{createGeometry(){this.geometry=new Hc(this.vertices,this.indices,this.radius,this.detail)}}},Cp={extends:yp,props:{innerRadius:{type:Number,default:.5},outerRadius:{type:Number,default:1},thetaSegments:{type:Number,default:8},phiSegments:{type:Number,default:1},thetaStart:{type:Number,default:0},thetaLength:{type:Number,default:2*Math.PI}},methods:{createGeometry(){this.geometry=new Rh(this.innerRadius,this.outerRadius,this.thetaSegments,this.phiSegments,this.thetaStart,this.thetaLength)}}},Lp={extends:yp,props:{radius:{type:Number,default:1},widthSegments:{type:Number,default:12},heightSegments:{type:Number,default:12}},methods:{createGeometry(){this.geometry=new Lh(this.radius,this.widthSegments,this.heightSegments)}}},Rp={extends:yp,props:{radius:{type:Number,default:1},detail:{type:Number,default:0}},methods:{createGeometry(){this.geometry=new Vc(this.radius,this.detail)}}},Pp={extends:yp,props:{radius:{type:Number,default:1},tube:{type:Number,default:.4},radialSegments:{type:Number,default:8},tubularSegments:{type:Number,default:6},arc:{type:Number,default:2*Math.PI}},methods:{createGeometry(){this.geometry=new Zc(this.radius,this.tube,this.radialSegments,this.tubularSegments,this.arc)}}},Np={extends:yp,props:{radius:{type:Number,default:1},tube:{type:Number,default:.4},radialSegments:{type:Number,default:64},tubularSegments:{type:Number,default:8},p:{type:Number,default:2},q:{type:Number,default:3}},methods:{createGeometry(){this.geometry=new Yc(this.radius,this.tube,this.radialSegments,this.tubularSegments,this.p,this.q)}}},Dp={extends:yp,props:{path:Su,tubularSegments:{type:Number,default:64},radius:{type:Number,default:1},radiusSegments:{type:Number,default:8},closed:{type:Boolean,default:!1}},methods:{createGeometry(){this.geometry=new Xc(this.path,this.tubularSegments,this.radius,this.radiusSegments,this.closed)}}},Ip={inject:["scene"],props:{color:{type:String,default:"#ffffff"},intensity:{type:Number,default:1},castShadow:{type:Boolean,default:!1},shadowMapSize:Object,position:Object},mounted(){mp(this,"position",this.light.position),this.light.target&&mp(this,"target",this.light.target.position),this.light.shadow&&(this.light.castShadow=this.castShadow,up(this.light.shadow.mapSize,this.shadowMapSize)),["color","intensity","castShadow"].forEach(e=>{On(()=>this[e],()=>{"color"===e?this.light.color=new gs(this.color):this.light[e]=this[e]})}),this.scene.add(this.light),this.light.target&&this.scene.add(this.light.target)},unmounted(){this.scene.remove(this.light)},render:()=>[],__hmrId:"Light"},Op={extends:Ip,created(){this.light=new id(this.color,this.intensity)},__hmrId:"AmbientLight"},zp={extends:Ip,props:{target:Object},created(){this.light=new nd(this.color,this.intensity)},__hmrId:"DirectionalLight"},Up={extends:Ip,props:{distance:{type:Number,default:0},decay:{type:Number,default:1}},created(){this.light=new $u(this.color,this.intensity,this.distance,this.decay)},__hmrId:"PointLight"},Bp={extends:Ip,props:{angle:{type:Number,default:Math.PI/3},decay:{type:Number,default:1},distance:{type:Number,default:0},penumbra:{type:Number,default:0},target:Object},created(){this.light=new Ku(this.color,this.intensity,this.distance,this.angle,this.penumbra,this.decay),["angle","decay","distance","penumbra"].forEach(e=>{On(()=>this[e],()=>{this.light[e]=this[e]})})},__hmrId:"SpotLight"},Fp={inject:["three","mesh"],props:{id:String,color:{type:[String,Number],default:"#ffffff"},depthTest:{type:Boolean,default:!0},depthWrite:{type:Boolean,default:!0},flatShading:Boolean,fog:{type:Boolean,default:!0},opacity:{type:Number,default:1},side:{type:Number,default:0},transparent:Boolean,vertexColors:Boolean},beforeMount(){this.createMaterial(),this.id&&(this.three.materials[this.id]=this.material),this.mesh.setMaterial(this.material)},mounted(){this._addWatchers(),this.addWatchers&&this.addWatchers()},unmounted(){this.material.dispose(),this.id&&delete this.three.materials[this.id]},methods:{_addWatchers(){["color","depthTest","depthWrite","fog","opacity","side","transparent"].forEach(e=>{On(()=>this[e],()=>{"color"===e?this.material.color.set(this.color):this.material[e]=this[e]})})}},render:()=>[],__hmrId:"Material"},Gp={extends:Fp,methods:{createMaterial(){this.material=new _s(dp(this.$props,["id"]))}},__hmrId:"BasicMaterial"},kp={extends:Fp,methods:{createMaterial(){this.material=new Xh(dp(this.$props,["id"]))}},__hmrId:"LambertMaterial"},Hp={extends:Fp,methods:{createMaterial(){this.material=new jh(dp(this.$props,["id"]))}},__hmrId:"PhongMaterial"},Vp={extends:Fp,props:{emissive:{type:[Number,String],default:0},emissiveIntensity:{type:Number,default:1},metalness:{type:Number,default:0},roughness:{type:Number,default:1}},methods:{createMaterial(){this.material=new Hh(dp(this.$props,["id"]))},addWatchers(){["emissive","emissiveIntensity","metalness","roughness"].forEach(e=>{On(()=>this[e],t=>{"emissive"===e?this.material.emissive=new gs(t):this.material[e]=t})})}},__hmrId:"StandardMaterial"},jp={extends:Vp,methods:{createMaterial(){this.material=new Vh(dp(this.$props,["id"]))}},__hmrId:"PhysicalMaterial"};const Wp=Po.meshphong_frag.slice(0,Po.meshphong_frag.indexOf("void main() {")),qp=Po.meshphong_frag.slice(Po.meshphong_frag.indexOf("void main() {")),Xp={uniforms:yo.merge([Do.phong.uniforms,{thicknessColor:{value:new gs(6718871)},thicknessDistortion:{value:.1},thicknessAmbient:{value:0},thicknessAttenuation:{value:.1},thicknessPower:{value:2},thicknessScale:{value:10}}]),vertexShader:`\n #define USE_UV\n ${Po.meshphong_vert}\n `,fragmentShader:`\n #define USE_UV\n #define SUBSURFACE\n\n ${Wp}\n\n uniform float thicknessPower;\n uniform float thicknessScale;\n uniform float thicknessDistortion;\n uniform float thicknessAmbient;\n uniform float thicknessAttenuation;\n uniform vec3 thicknessColor;\n\n void RE_Direct_Scattering(const in IncidentLight directLight, const in vec2 uv, const in GeometricContext geometry, inout ReflectedLight reflectedLight) {\n #ifdef USE_COLOR\n vec3 thickness = vColor * thicknessColor;\n #else\n vec3 thickness = thicknessColor;\n #endif\n vec3 scatteringHalf = normalize(directLight.direction + (geometry.normal * thicknessDistortion));\n float scatteringDot = pow(saturate(dot(geometry.viewDir, -scatteringHalf)), thicknessPower) * thicknessScale;\n vec3 scatteringIllu = (scatteringDot + thicknessAmbient) * thickness;\n reflectedLight.directDiffuse += scatteringIllu * thicknessAttenuation * directLight.color;\n }\n `+qp.replace("#include ",(Yp=Po.lights_fragment_begin,Zp="RE_Direct( directLight, geometry, material, reflectedLight );",Jp="\n RE_Direct( directLight, geometry, material, reflectedLight );\n #if defined( SUBSURFACE ) && defined( USE_UV )\n RE_Direct_Scattering(directLight, vUv, geometry, reflectedLight);\n #endif\n ",Yp.split(Zp).join(Jp)))};var Yp,Zp,Jp,Kp,Qp,$p,ef={extends:{inject:["three","mesh"],props:{id:String,uniforms:Object,vertexShader:String,fragmentShader:String},beforeMount(){this.createMaterial(),this.id&&(this.three.materials[this.id]=this.material),this.mesh.setMaterial(this.material)},mounted(){this.addWatchers&&this.addWatchers()},unmounted(){this.material.dispose(),this.id&&delete this.three.materials[this.id]},render:()=>[],__hmrId:"ShaderMaterial"},props:{diffuse:{type:String,default:"#ffffff"},thicknessColor:{type:String,default:"#ffffff"},thicknessDistortion:{type:Number,default:.4},thicknessAmbient:{type:Number,default:.01},thicknessAttenuation:{type:Number,default:.7},thicknessPower:{type:Number,default:2},thicknessScale:{type:Number,default:4},transparent:{type:Boolean,default:!1},opacity:{type:Number,default:1},vertexColors:{type:Boolean,default:!1}},methods:{createMaterial(){const e=Xp,t=yo.clone(e.uniforms);Object.entries(this.$props).forEach(([e,n])=>{"diffuse"!==e&&"thicknessColor"!==e||(n=new gs(n)),"id"!==e&&"transparent"!==e&&"vertexColors"!==e&&(t[e].value=n)}),this.material=new xo({...e,uniforms:t,lights:!0,transparent:this.transparent,vertexColors:this.vertexColors})}},__hmrId:"SubSurfaceMaterial"},tf={inject:["three","scene","rendererComponent"],emits:["ready"],props:{materialId:String,position:Object,rotation:Object,scale:Object,castShadow:Boolean,receiveShadow:Boolean},provide(){return{mesh:this}},mounted(){this.geometry&&!this.mesh&&this.initMesh()},unmounted(){this.mesh&&this.scene.remove(this.mesh),this.geometry&&this.geometry.dispose(),this.material&&!this.materialId&&this.material.dispose()},methods:{initMesh(){!this.material&&this.materialId&&(this.material=this.three.materials[this.materialId]),this.mesh=new oo(this.geometry,this.material),this.bindProps(),this.scene.add(this.mesh),this.$emit("ready")},bindProps(){mp(this,"position",this.mesh.position),mp(this,"rotation",this.mesh.rotation),mp(this,"scale",this.mesh.scale),["castShadow","receiveShadow"].forEach(e=>{this.mesh[e]=this[e],On(()=>this[e],()=>{this.mesh[e]=this[e]})}),On(()=>this.materialId,()=>{this.mesh.material=this.three.materials[this.materialId]})},setGeometry(e){this.geometry=e,this.mesh&&(this.mesh.geometry=e)},setMaterial(e){this.material=e,this.mesh&&(this.mesh.material=e)},refreshGeometry(){const e=this.geometry;this.createGeometry(),this.mesh.geometry=this.geometry,e.dispose()}},render(){return this.$slots.default?this.$slots.default():[]},__hmrId:"Mesh"},nf={extends:tf,props:{size:Number,width:{type:Number,default:1},height:{type:Number,default:1},depth:{type:Number,default:1},widthSegments:{type:Number,default:1},heightSegments:{type:Number,default:1},depthSegments:{type:Number,default:1}},created(){this.createGeometry(),["size","width","height","depth","widthSegments","heightSegments","depthSegments"].forEach(e=>{On(()=>this[e],()=>{this.refreshGeometry()})})},methods:{createGeometry(){this.size?this.geometry=new mo(this.size,this.size,this.size):this.geometry=new mo(this.width,this.height,this.depth)}},__hmrId:"Box"},rf={extends:tf,props:{radius:{type:Number,default:1},segments:{type:Number,default:8},thetaStart:{type:Number,default:0},thetaLength:{type:Number,default:2*Math.PI}},created(){this.createGeometry();["radius","segments","thetaStart","thetaLength"].forEach(e=>{On(()=>this[e],()=>{this.refreshGeometry()})})},methods:{createGeometry(){this.geometry=new Bh(this.radius,this.segments,this.thetaStart,this.thetaLength)}},__hmrId:"Circle"},sf={extends:tf,props:{radius:{type:Number,default:1},height:{type:Number,default:1},radialSegments:{type:Number,default:8},heightSegments:{type:Number,default:1},openEnded:{type:Boolean,default:!1},thetaStart:{type:Number,default:0},thetaLength:{type:Number,default:2*Math.PI}},created(){this.createGeometry();["radius","height","radialSegments","heightSegments","openEnded","thetaStart","thetaLength"].forEach(e=>{On(()=>this[e],()=>{this.refreshGeometry()})})},methods:{createGeometry(){this.geometry=new Uh(this.radius,this.height,this.radialSegments,this.heightSegments,this.openEnded,this.thetaStart,this.thetaLength)}},__hmrId:"Cone"},of={extends:tf,props:{radiusTop:{type:Number,default:1},radiusBottom:{type:Number,default:1},height:{type:Number,default:1},radialSegments:{type:Number,default:8},heightSegments:{type:Number,default:1},openEnded:{type:Boolean,default:!1},thetaStart:{type:Number,default:0},thetaLength:{type:Number,default:2*Math.PI}},created(){this.createGeometry();["radiusTop","radiusBottom","height","radialSegments","heightSegments","openEnded","thetaStart","thetaLength"].forEach(e=>{On(()=>this[e],()=>{this.refreshGeometry()})})},methods:{createGeometry(){this.geometry=new zh(this.radiusTop,this.radiusBottom,this.height,this.radialSegments,this.heightSegments,this.openEnded,this.thetaStart,this.thetaLength)}},__hmrId:"Cylinder"},af={extends:tf,props:{radius:{type:Number,default:1},detail:{type:Number,default:0}},created(){this.createGeometry();["radius","detail"].forEach(e=>{On(()=>this[e],()=>{this.refreshGeometry()})})},methods:{createGeometry(){this.geometry=new qc(this.radius,this.detail)}},__hmrId:"Dodecahedron"},lf={extends:tf,props:{radius:{type:Number,default:1},detail:{type:Number,default:0}},created(){this.createGeometry();["radius","detail"].forEach(e=>{On(()=>this[e],()=>{this.refreshGeometry()})})},methods:{createGeometry(){this.geometry=new Wc(this.radius,this.detail)}},__hmrId:"Icosahedron"},cf={extends:tf,props:{points:Array,segments:{type:Number,default:12},phiStart:{type:Number,default:0},phiLength:{type:Number,default:2*Math.PI}},created(){this.createGeometry();["points","segments","phiStart","phiLength"].forEach(e=>{On(()=>this[e],()=>{this.refreshGeometry()})})},methods:{createGeometry(){this.geometry=new Ph(this.points,this.segments,this.phiStart,this.phiLength)}},__hmrId:"Lathe"},hf={extends:tf,props:{radius:{type:Number,default:1},detail:{type:Number,default:0}},created(){this.createGeometry();["radius","detail"].forEach(e=>{On(()=>this[e],()=>{this.refreshGeometry()})})},methods:{createGeometry(){this.geometry=new jc(this.radius,this.detail)}},__hmrId:"Octahedron"},uf={extends:tf,props:{width:{type:Number,default:1},height:{type:Number,default:1},widthSegments:{type:Number,default:1},heightSegments:{type:Number,default:1}},created(){this.createGeometry();["width","height","widthSegments","heightSegments"].forEach(e=>{On(()=>this[e],()=>{this.refreshGeometry()})})},methods:{createGeometry(){this.geometry=new Ro(this.width,this.height,this.widthSegments,this.heightSegments)}},__hmrId:"Plane"},df={extends:tf,props:{vertices:Array,indices:Array,radius:{type:Number,default:1},detail:{type:Number,default:0}},created(){this.createGeometry();["vertices","indices","radius","detail"].forEach(e=>{On(()=>this[e],()=>{this.refreshGeometry()})})},methods:{createGeometry(){this.geometry=new Hc(this.vertices,this.indices,this.radius,this.detail)}},__hmrId:"Polyhedron"},pf={extends:tf,props:{innerRadius:{type:Number,default:.5},outerRadius:{type:Number,default:1},thetaSegments:{type:Number,default:8},phiSegments:{type:Number,default:1},thetaStart:{type:Number,default:0},thetaLength:{type:Number,default:2*Math.PI}},created(){this.createGeometry();["innerRadius","outerRadius","thetaSegments","phiSegments","thetaStart","thetaLength"].forEach(e=>{On(()=>this[e],()=>{this.refreshGeometry()})})},methods:{createGeometry(){this.geometry=new Rh(this.innerRadius,this.outerRadius,this.thetaSegments,this.phiSegments,this.thetaStart,this.thetaLength)}},__hmrId:"Ring"},ff={extends:tf,props:{radius:Number,widthSegments:{type:Number,default:12},heightSegments:{type:Number,default:12}},watch:{radius(){this.refreshGeometry()},widthSegments(){this.refreshGeometry()},heightSegments(){this.refreshGeometry()}},created(){this.createGeometry()},methods:{createGeometry(){this.geometry=new Lh(this.radius,this.widthSegments,this.heightSegments)}},__hmrId:"Sphere"},mf={extends:tf,props:{radius:{type:Number,default:1},detail:{type:Number,default:0}},created(){this.createGeometry();["radius","detail"].forEach(e=>{On(()=>this[e],()=>{this.refreshGeometry()})})},methods:{createGeometry(){this.geometry=new Vc(this.radius,this.detail)}},__hmrId:"Tetrahedron"},gf={extends:tf,props:{...{text:String,fontSrc:String,size:{type:Number,default:80},height:{type:Number,default:5},depth:{type:Number,default:1},curveSegments:{type:Number,default:12},bevelEnabled:{type:Boolean,default:!1},bevelThickness:{type:Number,default:10},bevelSize:{type:Number,default:8},bevelOffset:{type:Number,default:0},bevelSegments:{type:Number,default:5},align:{type:[Boolean,String],default:!1}}},created(){["text","size","height","curveSegments","bevelEnabled","bevelThickness","bevelSize","bevelOffset","bevelSegments","align"].forEach(e=>{On(()=>this[e],()=>{this.font&&this.refreshGeometry()})});(new wd).load(this.fontSrc,e=>{this.font=e,this.createGeometry(),this.initMesh()})},methods:{createGeometry(){this.geometry=new Ch(this.text,{font:this.font,size:this.size,height:this.height,depth:this.depth,curveSegments:this.curveSegments,bevelEnabled:this.bevelEnabled,bevelThickness:this.bevelThickness,bevelSize:this.bevelSize,bevelOffset:this.bevelOffset,bevelSegments:this.bevelSegments}),"center"===this.align&&this.geometry.center()}}},vf={extends:tf,props:{radius:{type:Number,default:.5},tube:{type:Number,default:.4},radialSegments:{type:Number,default:8},tubularSegments:{type:Number,default:6},arc:{type:Number,default:2*Math.PI}},created(){this.createGeometry();["radius","tube","radialSegments","tubularSegments","arc"].forEach(e=>{On(()=>this[e],()=>{this.refreshGeometry()})})},methods:{createGeometry(){this.geometry=new Zc(this.radius,this.tube,this.radialSegments,this.tubularSegments,this.arc)}},__hmrId:"Torus"},yf={extends:tf,props:{radius:{type:Number,default:.5},tube:{type:Number,default:.4},radialSegments:{type:Number,default:64},tubularSegments:{type:Number,default:8},p:{type:Number,default:2},q:{type:Number,default:3}},created(){this.createGeometry();["radius","tube","radialSegments","tubularSegments","p","q"].forEach(e=>{On(()=>this[e],()=>{this.refreshGeometry()})})},methods:{createGeometry(){this.geometry=new Yc(this.radius,this.tube,this.radialSegments,this.tubularSegments,this.p,this.q)}},__hmrId:"TorusKnot"},xf={extends:tf,props:{path:Su,tubularSegments:{type:Number,default:64},radius:{type:Number,default:1},radialSegments:{type:Number,default:8},closed:{type:Boolean,default:!1}},created(){this.createGeometry();["path","tubularSegments","radius","radialSegments","closed"].forEach(e=>{On(()=>this[e],()=>{this.refreshGeometry()})})},methods:{createGeometry(){this.geometry=new Xc(this.path,this.tubularSegments,this.radius,this.radialSegments,this.closed)}},__hmrId:"Tube"},_f={extends:tf,props:{cubeRTSize:{type:Number,default:512},cubeCameraNear:{type:Number,default:.1},cubeCameraFar:{type:Number,default:2e3},autoUpdate:Boolean},mounted(){this.initGem(),this.autoUpdate?this.three.onBeforeRender(this.updateCubeRT):this.rendererComponent.onMounted(this.updateCubeRT)},unmounted(){this.three.offBeforeRender(this.updateCubeRT)},methods:{initGem(){const e=new Mo(this.cubeRTSize,{format:1022,generateMipmaps:!0,minFilter:1008});this.cubeCamera=new wo(this.cubeCameraNear,this.cubeCameraFar,e),mp(this,"position",this.cubeCamera.position),this.scene.add(this.cubeCamera),this.material.side=0,this.material.envMap=e.texture,this.material.envMapIntensity=10,this.material.metalness=0,this.material.roughness=0,this.material.opacity=.75,this.material.transparent=!0,this.material.premultipliedAlpha=!0,this.material.needsUpdate=!0,this.backMaterial=this.material.clone(),this.backMaterial.envMapIntensity=5,this.material.metalness=1,this.material.roughness=0,this.backMaterial.opacity=.5,this.backMaterial.side=1,this.meshBack=new oo(this.geometry,this.backMaterial),mp(this,"position",this.meshBack.position),mp(this,"rotation",this.meshBack.rotation),mp(this,"scale",this.meshBack.scale),this.scene.add(this.meshBack)},updateCubeRT(){this.mesh.visible=!1,this.meshBack.visible=!1,this.cubeCamera.update(this.three.renderer,this.scene),this.mesh.visible=!0,this.meshBack.visible=!0}},__hmrId:"Gem"},bf={emits:["loaded"],extends:tf,props:{src:String,width:Number,height:Number,keepSize:Boolean},created(){this.createGeometry(),this.createMaterial(),this.initMesh(),On(()=>this.src,this.refreshTexture),["width","height"].forEach(e=>{On(()=>this[e],this.resize)}),this.keepSize&&this.three.onAfterResize(this.resize)},methods:{createGeometry(){this.geometry=new Ro(1,1,1,1)},createMaterial(){this.material=new _s({side:2,map:this.loadTexture()})},loadTexture(){return(new Mu).load(this.src,this.onLoaded)},refreshTexture(){this.texture&&this.texture.dispose(),this.material.map=this.loadTexture(),this.material.needsUpdate=!0},onLoaded(e){this.texture=e,this.resize(),this.$emit("loaded")},resize(){if(!this.texture)return;const e=this.three.size,t=this.texture.image.width/this.texture.image.height;let n,i;this.width&&this.height?(n=this.width*e.wWidth/e.width,i=this.height*e.wHeight/e.height):this.width?(n=this.width*e.wWidth/e.width,i=n/t):this.height&&(i=this.height*e.wHeight/e.height,n=i*t),this.mesh.scale.x=n,this.mesh.scale.y=i}},__hmrId:"Image"},wf={inject:["three","scene"],props:{materialId:String,count:Number,position:Object,castShadow:Boolean,receiveShadow:Boolean},provide(){return{mesh:this}},beforeMount(){this.$slots.default||console.error("Missing Geometry")},mounted(){this.initMesh()},unmounted(){this.scene.remove(this.mesh)},methods:{initMesh(){!this.material&&this.materialId&&(this.material=this.three.materials[this.materialId]),this.mesh=new vc(this.geometry,this.material,this.count),mp(this,"position",this.mesh.position),mp(this,"rotation",this.mesh.rotation),mp(this,"scale",this.mesh.scale),["castShadow","receiveShadow"].forEach(e=>{this.mesh[e]=this[e],On(()=>this[e],()=>{this.mesh[e]=this[e]})}),this.scene.add(this.mesh)},setGeometry(e){this.geometry=e,this.mesh&&(this.mesh.geometry=e)},setMaterial(e){this.material=e,this.mesh&&(this.mesh.material=e)}},render(){return this.$slots.default()},__hmrId:"InstancedMesh"},Mf={extends:tf,props:{cubeRTSize:{type:Number,default:512},cubeCameraNear:{type:Number,default:.1},cubeCameraFar:{type:Number,default:2e3},autoUpdate:Boolean},mounted(){this.initMirrorMesh(),this.autoUpdate?this.three.onBeforeRender(this.updateCubeRT):this.rendererComponent.onMounted(this.updateCubeRT)},unmounted(){this.three.offBeforeRender(this.updateCubeRT)},methods:{initMirrorMesh(){const e=new Mo(this.cubeRTSize,{format:1022,generateMipmaps:!0,minFilter:1008});this.cubeCamera=new wo(this.cubeCameraNear,this.cubeCameraFar,e),mp(this,"position",this.cubeCamera.position),this.scene.add(this.cubeCamera),this.material.envMap=e.texture,this.material.needsUpdate=!0},updateCubeRT(){this.mesh.visible=!1,this.cubeCamera.update(this.three.renderer,this.scene),this.mesh.visible=!0}},__hmrId:"MirrorMesh"},Sf={extends:tf,props:{cubeRTSize:{type:Number,default:512},cubeCameraNear:{type:Number,default:.1},cubeCameraFar:{type:Number,default:2e3},autoUpdate:Boolean},mounted(){this.initMirrorMesh(),this.autoUpdate?this.three.onBeforeRender(this.updateCubeRT):this.rendererComponent.onMounted(this.updateCubeRT)},unmounted(){this.three.offBeforeRender(this.updateCubeRT)},methods:{initMirrorMesh(){const e=new Mo(this.cubeRTSize,{mapping:302,format:1022,generateMipmaps:!0,minFilter:1008});this.cubeCamera=new wo(this.cubeCameraNear,this.cubeCameraFar,e),mp(this,"position",this.cubeCamera.position),this.scene.add(this.cubeCamera),this.material.envMap=e.texture,this.material.refractionRatio=.95,this.material.needsUpdate=!0},updateCubeRT(){this.mesh.visible=!1,this.cubeCamera.update(this.three.renderer,this.scene),this.mesh.visible=!0}},__hmrId:"RefractionMesh"},Tf={emits:["ready","loaded"],inject:["three","scene"],props:{src:String,position:Object,scale:Object},mounted(){this.texture=(new Mu).load(this.src,this.onLoaded),this.material=new Vl({map:this.texture}),this.sprite=new ic(this.material),this.geometry=this.sprite.geometry,mp(this,"position",this.sprite.position),mp(this,"scale",this.sprite.scale),this.scene.add(this.sprite),this.$emit("ready")},unmounted(){this.texture.dispose(),this.material.dispose(),this.scene.remove(this.sprite)},methods:{onLoaded(){this.updateUV(),this.$emit("loaded")},updateUV(){this.iWidth=this.texture.image.width,this.iHeight=this.texture.image.height,this.iRatio=this.iWidth/this.iHeight;let e=.5,t=.5;this.iRatio>1?t=.5/this.iRatio:e=.5/this.iRatio;const n=this.geometry.attributes.position.array;n[0]=-e,n[1]=-t,n[5]=e,n[6]=-t,n[10]=e,n[11]=t,n[15]=-e,n[16]=t,this.geometry.attributes.position.needsUpdate=!0}},render:()=>[],__hmrId:"Sprite"},Ef={uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float opacity;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","\tvec4 texel = texture2D( tDiffuse, vUv );","\tgl_FragColor = opacity * texel;","}"].join("\n")};function Af(){this.enabled=!0,this.needsSwap=!0,this.clear=!1,this.renderToScreen=!1}Object.assign(Af.prototype,{setSize:function(){},render:function(){console.error("THREE.Pass: .render() must be implemented in derived pass.")}}),Af.FullScreenQuad=(Kp=new ed(-1,1,1,-1,0,1),Qp=new Ro(2,2),$p=function(e){this._mesh=new oo(Qp,e)},Object.defineProperty($p.prototype,"material",{get:function(){return this._mesh.material},set:function(e){this._mesh.material=e}}),Object.assign($p.prototype,{dispose:function(){this._mesh.geometry.dispose()},render:function(e){e.render(this._mesh,Kp)}}),$p);var Cf=function(e,t){Af.call(this),this.textureID=void 0!==t?t:"tDiffuse",e instanceof xo?(this.uniforms=e.uniforms,this.material=e):e&&(this.uniforms=yo.clone(e.uniforms),this.material=new xo({defines:Object.assign({},e.defines),uniforms:this.uniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader})),this.fsQuad=new Af.FullScreenQuad(this.material)};Cf.prototype=Object.assign(Object.create(Af.prototype),{constructor:Cf,render:function(e,t,n){this.uniforms[this.textureID]&&(this.uniforms[this.textureID].value=n.texture),this.fsQuad.material=this.material,this.renderToScreen?(e.setRenderTarget(null),this.fsQuad.render(e)):(e.setRenderTarget(t),this.clear&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),this.fsQuad.render(e))}});var Lf=function(e,t){Af.call(this),this.scene=e,this.camera=t,this.clear=!0,this.needsSwap=!1,this.inverse=!1};Lf.prototype=Object.assign(Object.create(Af.prototype),{constructor:Lf,render:function(e,t,n){var i,r,s=e.getContext(),o=e.state;o.buffers.color.setMask(!1),o.buffers.depth.setMask(!1),o.buffers.color.setLocked(!0),o.buffers.depth.setLocked(!0),this.inverse?(i=0,r=1):(i=1,r=0),o.buffers.stencil.setTest(!0),o.buffers.stencil.setOp(s.REPLACE,s.REPLACE,s.REPLACE),o.buffers.stencil.setFunc(s.ALWAYS,i,4294967295),o.buffers.stencil.setClear(r),o.buffers.stencil.setLocked(!0),e.setRenderTarget(n),this.clear&&e.clear(),e.render(this.scene,this.camera),e.setRenderTarget(t),this.clear&&e.clear(),e.render(this.scene,this.camera),o.buffers.color.setLocked(!1),o.buffers.depth.setLocked(!1),o.buffers.stencil.setLocked(!1),o.buffers.stencil.setFunc(s.EQUAL,1,4294967295),o.buffers.stencil.setOp(s.KEEP,s.KEEP,s.KEEP),o.buffers.stencil.setLocked(!0)}});var Rf=function(){Af.call(this),this.needsSwap=!1};Rf.prototype=Object.create(Af.prototype),Object.assign(Rf.prototype,{render:function(e){e.state.buffers.stencil.setLocked(!1),e.state.buffers.stencil.setTest(!1)}});var Pf=function(e,t){if(this.renderer=e,void 0===t){var n={minFilter:1006,magFilter:1006,format:1023},i=e.getSize(new Fi);this._pixelRatio=e.getPixelRatio(),this._width=i.width,this._height=i.height,(t=new qi(this._width*this._pixelRatio,this._height*this._pixelRatio,n)).texture.name="EffectComposer.rt1"}else this._pixelRatio=1,this._width=t.width,this._height=t.height;this.renderTarget1=t,this.renderTarget2=t.clone(),this.renderTarget2.texture.name="EffectComposer.rt2",this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2,this.renderToScreen=!0,this.passes=[],void 0===Ef&&console.error("THREE.EffectComposer relies on CopyShader"),void 0===Cf&&console.error("THREE.EffectComposer relies on ShaderPass"),this.copyPass=new Cf(Ef),this.clock=new Rd};Object.assign(Pf.prototype,{swapBuffers:function(){var e=this.readBuffer;this.readBuffer=this.writeBuffer,this.writeBuffer=e},addPass:function(e){this.passes.push(e),e.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)},insertPass:function(e,t){this.passes.splice(t,0,e),e.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)},isLastEnabledPass:function(e){for(var t=e+1;t({passes:[]}),inject:["three"],provide(){return{passes:this.passes}},mounted(){this.three.onAfterInit(()=>{this.composer=new Pf(this.three.renderer),this.three.renderer.autoClear=!1,this.passes.forEach(e=>{this.composer.addPass(e)}),this.three.composer=this.composer})},render(){return this.$slots.default()},__hmrId:"EffectComposer"},If=function(e,t,n,i,r){Af.call(this),this.scene=e,this.camera=t,this.overrideMaterial=n,this.clearColor=i,this.clearAlpha=void 0!==r?r:0,this.clear=!0,this.clearDepth=!1,this.needsSwap=!1};If.prototype=Object.assign(Object.create(Af.prototype),{constructor:If,render:function(e,t,n){var i,r,s,o=e.autoClear;e.autoClear=!1,void 0!==this.overrideMaterial&&(s=this.scene.overrideMaterial,this.scene.overrideMaterial=this.overrideMaterial),this.clearColor&&(i=e.getClearColor().getHex(),r=e.getClearAlpha(),e.setClearColor(this.clearColor,this.clearAlpha)),this.clearDepth&&e.clearDepth(),e.setRenderTarget(this.renderToScreen?null:n),this.clear&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),e.render(this.scene,this.camera),this.clearColor&&e.setClearColor(i,r),void 0!==this.overrideMaterial&&(this.scene.overrideMaterial=s),e.autoClear=o}});var Of={inject:["three","passes"],beforeMount(){this.passes||console.error("Missing parent EffectComposer")},unmounted(){this.pass.dispose&&this.pass.dispose()},render:()=>[],__hmrId:"EffectPass"},zf={extends:Of,mounted(){this.three.scene||console.error("Missing Scene"),this.three.camera||console.error("Missing Camera");const e=new If(this.three.scene,this.three.camera);this.passes.push(e),this.pass=e},__hmrId:"RenderPass"},Uf={defines:{DEPTH_PACKING:1,PERSPECTIVE_CAMERA:1},uniforms:{tColor:{value:null},tDepth:{value:null},focus:{value:1},aspect:{value:1},aperture:{value:.025},maxblur:{value:.01},nearClip:{value:1},farClip:{value:1e3}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","varying vec2 vUv;","uniform sampler2D tColor;","uniform sampler2D tDepth;","uniform float maxblur;","uniform float aperture;","uniform float nearClip;","uniform float farClip;","uniform float focus;","uniform float aspect;","#include ","float getDepth( const in vec2 screenPosition ) {","\t#if DEPTH_PACKING == 1","\treturn unpackRGBAToDepth( texture2D( tDepth, screenPosition ) );","\t#else","\treturn texture2D( tDepth, screenPosition ).x;","\t#endif","}","float getViewZ( const in float depth ) {","\t#if PERSPECTIVE_CAMERA == 1","\treturn perspectiveDepthToViewZ( depth, nearClip, farClip );","\t#else","\treturn orthographicDepthToViewZ( depth, nearClip, farClip );","\t#endif","}","void main() {","\tvec2 aspectcorrect = vec2( 1.0, aspect );","\tfloat viewZ = getViewZ( getDepth( vUv ) );","\tfloat factor = ( focus + viewZ );","\tvec2 dofblur = vec2 ( clamp( factor * aperture, -maxblur, maxblur ) );","\tvec2 dofblur9 = dofblur * 0.9;","\tvec2 dofblur7 = dofblur * 0.7;","\tvec2 dofblur4 = dofblur * 0.4;","\tvec4 col = vec4( 0.0 );","\tcol += texture2D( tColor, vUv.xy );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.0, 0.4 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.15, 0.37 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.29, 0.29 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.37, 0.15 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.40, 0.0 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.37, -0.15 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.29, -0.29 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.15, -0.37 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.0, -0.4 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.15, 0.37 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.29, 0.29 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.37, 0.15 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.4, 0.0 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.37, -0.15 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.15, -0.37 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.15, 0.37 ) * aspectcorrect ) * dofblur9 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.37, 0.15 ) * aspectcorrect ) * dofblur9 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.37, -0.15 ) * aspectcorrect ) * dofblur9 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.15, -0.37 ) * aspectcorrect ) * dofblur9 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.15, 0.37 ) * aspectcorrect ) * dofblur9 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.37, 0.15 ) * aspectcorrect ) * dofblur9 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.37, -0.15 ) * aspectcorrect ) * dofblur9 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.15, -0.37 ) * aspectcorrect ) * dofblur9 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.29, 0.29 ) * aspectcorrect ) * dofblur7 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.40, 0.0 ) * aspectcorrect ) * dofblur7 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.29, -0.29 ) * aspectcorrect ) * dofblur7 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.0, -0.4 ) * aspectcorrect ) * dofblur7 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.29, 0.29 ) * aspectcorrect ) * dofblur7 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.4, 0.0 ) * aspectcorrect ) * dofblur7 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur7 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.0, 0.4 ) * aspectcorrect ) * dofblur7 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.29, 0.29 ) * aspectcorrect ) * dofblur4 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.4, 0.0 ) * aspectcorrect ) * dofblur4 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.29, -0.29 ) * aspectcorrect ) * dofblur4 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.0, -0.4 ) * aspectcorrect ) * dofblur4 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.29, 0.29 ) * aspectcorrect ) * dofblur4 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.4, 0.0 ) * aspectcorrect ) * dofblur4 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur4 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.0, 0.4 ) * aspectcorrect ) * dofblur4 );","\tgl_FragColor = col / 41.0;","\tgl_FragColor.a = 1.0;","}"].join("\n")},Bf=function(e,t,n){Af.call(this),this.scene=e,this.camera=t;var i=void 0!==n.focus?n.focus:1,r=void 0!==n.aspect?n.aspect:t.aspect,s=void 0!==n.aperture?n.aperture:.025,o=void 0!==n.maxblur?n.maxblur:1,a=n.width||window.innerWidth||1,l=n.height||window.innerHeight||1;this.renderTargetDepth=new qi(a,l,{minFilter:1003,magFilter:1003}),this.renderTargetDepth.texture.name="BokehPass.depth",this.materialDepth=new Sl,this.materialDepth.depthPacking=3201,this.materialDepth.blending=0,void 0===Uf&&console.error("BokehPass relies on BokehShader");var c=Uf,h=yo.clone(c.uniforms);h.tDepth.value=this.renderTargetDepth.texture,h.focus.value=i,h.aspect.value=r,h.aperture.value=s,h.maxblur.value=o,h.nearClip.value=t.near,h.farClip.value=t.far,this.materialBokeh=new xo({defines:Object.assign({},c.defines),uniforms:h,vertexShader:c.vertexShader,fragmentShader:c.fragmentShader}),this.uniforms=h,this.needsSwap=!1,this.fsQuad=new Af.FullScreenQuad(this.materialBokeh),this.oldClearColor=new gs};Bf.prototype=Object.assign(Object.create(Af.prototype),{constructor:Bf,render:function(e,t,n){this.scene.overrideMaterial=this.materialDepth,this.oldClearColor.copy(e.getClearColor());var i=e.getClearAlpha(),r=e.autoClear;e.autoClear=!1,e.setClearColor(16777215),e.setClearAlpha(1),e.setRenderTarget(this.renderTargetDepth),e.clear(),e.render(this.scene,this.camera),this.uniforms.tColor.value=n.texture,this.uniforms.nearClip.value=this.camera.near,this.uniforms.farClip.value=this.camera.far,this.renderToScreen?(e.setRenderTarget(null),this.fsQuad.render(e)):(e.setRenderTarget(t),e.clear(),this.fsQuad.render(e)),this.scene.overrideMaterial=null,e.setClearColor(this.oldClearColor),e.setClearAlpha(i),e.autoClear=r}});var Ff={extends:Of,props:{focus:{type:Number,default:1},aperture:{type:Number,default:.025},maxblur:{type:Number,default:.01}},watch:{focus(){this.pass.uniforms.focus.value=this.focus},aperture(){this.pass.uniforms.aperture.value=this.aperture},maxblur(){this.pass.uniforms.maxblur.value=this.maxblur}},mounted(){this.three.scene||console.error("Missing Scene"),this.three.camera||console.error("Missing Camera");const e={focus:this.focus,aperture:this.aperture,maxblur:this.maxblur,width:this.three.size.width,height:this.three.size.height},t=new Bf(this.three.scene,this.three.camera,e);this.passes.push(t),this.pass=t},__hmrId:"BokehPass"},Gf={uniforms:{tDiffuse:{value:null},time:{value:0},nIntensity:{value:.5},sIntensity:{value:.05},sCount:{value:4096},grayscale:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","uniform float time;","uniform bool grayscale;","uniform float nIntensity;","uniform float sIntensity;","uniform float sCount;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","\tvec4 cTextureScreen = texture2D( tDiffuse, vUv );","\tfloat dx = rand( vUv + time );","\tvec3 cResult = cTextureScreen.rgb + cTextureScreen.rgb * clamp( 0.1 + dx, 0.0, 1.0 );","\tvec2 sc = vec2( sin( vUv.y * sCount ), cos( vUv.y * sCount ) );","\tcResult += cTextureScreen.rgb * vec3( sc.x, sc.y, sc.x ) * sIntensity;","\tcResult = cTextureScreen.rgb + clamp( nIntensity, 0.0,1.0 ) * ( cResult - cTextureScreen.rgb );","\tif( grayscale ) {","\t\tcResult = vec3( cResult.r * 0.3 + cResult.g * 0.59 + cResult.b * 0.11 );","\t}","\tgl_FragColor = vec4( cResult, cTextureScreen.a );","}"].join("\n")},kf=function(e,t,n,i){Af.call(this),void 0===Gf&&console.error("FilmPass relies on FilmShader");var r=Gf;this.uniforms=yo.clone(r.uniforms),this.material=new xo({uniforms:this.uniforms,vertexShader:r.vertexShader,fragmentShader:r.fragmentShader}),void 0!==i&&(this.uniforms.grayscale.value=i),void 0!==e&&(this.uniforms.nIntensity.value=e),void 0!==t&&(this.uniforms.sIntensity.value=t),void 0!==n&&(this.uniforms.sCount.value=n),this.fsQuad=new Af.FullScreenQuad(this.material)};kf.prototype=Object.assign(Object.create(Af.prototype),{constructor:kf,render:function(e,t,n,i){this.uniforms.tDiffuse.value=n.texture,this.uniforms.time.value+=i,this.renderToScreen?(e.setRenderTarget(null),this.fsQuad.render(e)):(e.setRenderTarget(t),this.clear&&e.clear(),this.fsQuad.render(e))}});var Hf={extends:Of,props:{noiseIntensity:{type:Number,default:.5},scanlinesIntensity:{type:Number,default:.05},scanlinesCount:{type:Number,default:4096},grayscale:{type:Number,default:0}},watch:{noiseIntensity(){this.pass.uniforms.nIntensity.value=this.noiseIntensity},scanlinesIntensity(){this.pass.uniforms.sIntensity.value=this.scanlinesIntensity},scanlinesCount(){this.pass.uniforms.sCount.value=this.scanlinesCount},grayscale(){this.pass.uniforms.grayscale.value=this.grayscale}},mounted(){const e=new kf(this.noiseIntensity,this.scanlinesIntensity,this.scanlinesCount,this.grayscale);this.passes.push(e),this.pass=e},__hmrId:"FilmPass"},Vf={uniforms:{tDiffuse:{value:null},shape:{value:1},radius:{value:4},rotateR:{value:Math.PI/12*1},rotateG:{value:Math.PI/12*2},rotateB:{value:Math.PI/12*3},scatter:{value:0},width:{value:1},height:{value:1},blending:{value:1},blendingMode:{value:1},greyscale:{value:!1},disable:{value:!1}},vertexShader:["varying vec2 vUV;","void main() {","\tvUV = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);","}"].join("\n"),fragmentShader:["#define SQRT2_MINUS_ONE 0.41421356","#define SQRT2_HALF_MINUS_ONE 0.20710678","#define PI2 6.28318531","#define SHAPE_DOT 1","#define SHAPE_ELLIPSE 2","#define SHAPE_LINE 3","#define SHAPE_SQUARE 4","#define BLENDING_LINEAR 1","#define BLENDING_MULTIPLY 2","#define BLENDING_ADD 3","#define BLENDING_LIGHTER 4","#define BLENDING_DARKER 5","uniform sampler2D tDiffuse;","uniform float radius;","uniform float rotateR;","uniform float rotateG;","uniform float rotateB;","uniform float scatter;","uniform float width;","uniform float height;","uniform int shape;","uniform bool disable;","uniform float blending;","uniform int blendingMode;","varying vec2 vUV;","uniform bool greyscale;","const int samples = 8;","float blend( float a, float b, float t ) {","\treturn a * ( 1.0 - t ) + b * t;","}","float hypot( float x, float y ) {","\treturn sqrt( x * x + y * y );","}","float rand( vec2 seed ){","return fract( sin( dot( seed.xy, vec2( 12.9898, 78.233 ) ) ) * 43758.5453 );","}","float distanceToDotRadius( float channel, vec2 coord, vec2 normal, vec2 p, float angle, float rad_max ) {","\tfloat dist = hypot( coord.x - p.x, coord.y - p.y );","\tfloat rad = channel;","\tif ( shape == SHAPE_DOT ) {","\t\trad = pow( abs( rad ), 1.125 ) * rad_max;","\t} else if ( shape == SHAPE_ELLIPSE ) {","\t\trad = pow( abs( rad ), 1.125 ) * rad_max;","\t\tif ( dist != 0.0 ) {","\t\t\tfloat dot_p = abs( ( p.x - coord.x ) / dist * normal.x + ( p.y - coord.y ) / dist * normal.y );","\t\t\tdist = ( dist * ( 1.0 - SQRT2_HALF_MINUS_ONE ) ) + dot_p * dist * SQRT2_MINUS_ONE;","\t\t}","\t} else if ( shape == SHAPE_LINE ) {","\t\trad = pow( abs( rad ), 1.5) * rad_max;","\t\tfloat dot_p = ( p.x - coord.x ) * normal.x + ( p.y - coord.y ) * normal.y;","\t\tdist = hypot( normal.x * dot_p, normal.y * dot_p );","\t} else if ( shape == SHAPE_SQUARE ) {","\t\tfloat theta = atan( p.y - coord.y, p.x - coord.x ) - angle;","\t\tfloat sin_t = abs( sin( theta ) );","\t\tfloat cos_t = abs( cos( theta ) );","\t\trad = pow( abs( rad ), 1.4 );","\t\trad = rad_max * ( rad + ( ( sin_t > cos_t ) ? rad - sin_t * rad : rad - cos_t * rad ) );","\t}","\treturn rad - dist;","}","struct Cell {","\tvec2 normal;","\tvec2 p1;","\tvec2 p2;","\tvec2 p3;","\tvec2 p4;","\tfloat samp2;","\tfloat samp1;","\tfloat samp3;","\tfloat samp4;","};","vec4 getSample( vec2 point ) {","\tvec4 tex = texture2D( tDiffuse, vec2( point.x / width, point.y / height ) );","\tfloat base = rand( vec2( floor( point.x ), floor( point.y ) ) ) * PI2;","\tfloat step = PI2 / float( samples );","\tfloat dist = radius * 0.66;","\tfor ( int i = 0; i < samples; ++i ) {","\t\tfloat r = base + step * float( i );","\t\tvec2 coord = point + vec2( cos( r ) * dist, sin( r ) * dist );","\t\ttex += texture2D( tDiffuse, vec2( coord.x / width, coord.y / height ) );","\t}","\ttex /= float( samples ) + 1.0;","\treturn tex;","}","float getDotColour( Cell c, vec2 p, int channel, float angle, float aa ) {","\tfloat dist_c_1, dist_c_2, dist_c_3, dist_c_4, res;","\tif ( channel == 0 ) {","\t\tc.samp1 = getSample( c.p1 ).r;","\t\tc.samp2 = getSample( c.p2 ).r;","\t\tc.samp3 = getSample( c.p3 ).r;","\t\tc.samp4 = getSample( c.p4 ).r;","\t} else if (channel == 1) {","\t\tc.samp1 = getSample( c.p1 ).g;","\t\tc.samp2 = getSample( c.p2 ).g;","\t\tc.samp3 = getSample( c.p3 ).g;","\t\tc.samp4 = getSample( c.p4 ).g;","\t} else {","\t\tc.samp1 = getSample( c.p1 ).b;","\t\tc.samp3 = getSample( c.p3 ).b;","\t\tc.samp2 = getSample( c.p2 ).b;","\t\tc.samp4 = getSample( c.p4 ).b;","\t}","\tdist_c_1 = distanceToDotRadius( c.samp1, c.p1, c.normal, p, angle, radius );","\tdist_c_2 = distanceToDotRadius( c.samp2, c.p2, c.normal, p, angle, radius );","\tdist_c_3 = distanceToDotRadius( c.samp3, c.p3, c.normal, p, angle, radius );","\tdist_c_4 = distanceToDotRadius( c.samp4, c.p4, c.normal, p, angle, radius );","\tres = ( dist_c_1 > 0.0 ) ? clamp( dist_c_1 / aa, 0.0, 1.0 ) : 0.0;","\tres += ( dist_c_2 > 0.0 ) ? clamp( dist_c_2 / aa, 0.0, 1.0 ) : 0.0;","\tres += ( dist_c_3 > 0.0 ) ? clamp( dist_c_3 / aa, 0.0, 1.0 ) : 0.0;","\tres += ( dist_c_4 > 0.0 ) ? clamp( dist_c_4 / aa, 0.0, 1.0 ) : 0.0;","\tres = clamp( res, 0.0, 1.0 );","\treturn res;","}","Cell getReferenceCell( vec2 p, vec2 origin, float grid_angle, float step ) {","\tCell c;","\tvec2 n = vec2( cos( grid_angle ), sin( grid_angle ) );","\tfloat threshold = step * 0.5;","\tfloat dot_normal = n.x * ( p.x - origin.x ) + n.y * ( p.y - origin.y );","\tfloat dot_line = -n.y * ( p.x - origin.x ) + n.x * ( p.y - origin.y );","\tvec2 offset = vec2( n.x * dot_normal, n.y * dot_normal );","\tfloat offset_normal = mod( hypot( offset.x, offset.y ), step );","\tfloat normal_dir = ( dot_normal < 0.0 ) ? 1.0 : -1.0;","\tfloat normal_scale = ( ( offset_normal < threshold ) ? -offset_normal : step - offset_normal ) * normal_dir;","\tfloat offset_line = mod( hypot( ( p.x - offset.x ) - origin.x, ( p.y - offset.y ) - origin.y ), step );","\tfloat line_dir = ( dot_line < 0.0 ) ? 1.0 : -1.0;","\tfloat line_scale = ( ( offset_line < threshold ) ? -offset_line : step - offset_line ) * line_dir;","\tc.normal = n;","\tc.p1.x = p.x - n.x * normal_scale + n.y * line_scale;","\tc.p1.y = p.y - n.y * normal_scale - n.x * line_scale;","\tif ( scatter != 0.0 ) {","\t\tfloat off_mag = scatter * threshold * 0.5;","\t\tfloat off_angle = rand( vec2( floor( c.p1.x ), floor( c.p1.y ) ) ) * PI2;","\t\tc.p1.x += cos( off_angle ) * off_mag;","\t\tc.p1.y += sin( off_angle ) * off_mag;","\t}","\tfloat normal_step = normal_dir * ( ( offset_normal < threshold ) ? step : -step );","\tfloat line_step = line_dir * ( ( offset_line < threshold ) ? step : -step );","\tc.p2.x = c.p1.x - n.x * normal_step;","\tc.p2.y = c.p1.y - n.y * normal_step;","\tc.p3.x = c.p1.x + n.y * line_step;","\tc.p3.y = c.p1.y - n.x * line_step;","\tc.p4.x = c.p1.x - n.x * normal_step + n.y * line_step;","\tc.p4.y = c.p1.y - n.y * normal_step - n.x * line_step;","\treturn c;","}","float blendColour( float a, float b, float t ) {","\tif ( blendingMode == BLENDING_LINEAR ) {","\t\treturn blend( a, b, 1.0 - t );","\t} else if ( blendingMode == BLENDING_ADD ) {","\t\treturn blend( a, min( 1.0, a + b ), t );","\t} else if ( blendingMode == BLENDING_MULTIPLY ) {","\t\treturn blend( a, max( 0.0, a * b ), t );","\t} else if ( blendingMode == BLENDING_LIGHTER ) {","\t\treturn blend( a, max( a, b ), t );","\t} else if ( blendingMode == BLENDING_DARKER ) {","\t\treturn blend( a, min( a, b ), t );","\t} else {","\t\treturn blend( a, b, 1.0 - t );","\t}","}","void main() {","\tif ( ! disable ) {","\t\tvec2 p = vec2( vUV.x * width, vUV.y * height );","\t\tvec2 origin = vec2( 0, 0 );","\t\tfloat aa = ( radius < 2.5 ) ? radius * 0.5 : 1.25;","\t\tCell cell_r = getReferenceCell( p, origin, rotateR, radius );","\t\tCell cell_g = getReferenceCell( p, origin, rotateG, radius );","\t\tCell cell_b = getReferenceCell( p, origin, rotateB, radius );","\t\tfloat r = getDotColour( cell_r, p, 0, rotateR, aa );","\t\tfloat g = getDotColour( cell_g, p, 1, rotateG, aa );","\t\tfloat b = getDotColour( cell_b, p, 2, rotateB, aa );","\t\tvec4 colour = texture2D( tDiffuse, vUV );","\t\tr = blendColour( r, colour.r, blending );","\t\tg = blendColour( g, colour.g, blending );","\t\tb = blendColour( b, colour.b, blending );","\t\tif ( greyscale ) {","\t\t\tr = g = b = (r + b + g) / 3.0;","\t\t}","\t\tgl_FragColor = vec4( r, g, b, 1.0 );","\t} else {","\t\tgl_FragColor = texture2D( tDiffuse, vUV );","\t}","}"].join("\n")},jf=function(e,t,n){for(var i in Af.call(this),void 0===Vf&&console.error("THREE.HalftonePass requires HalftoneShader"),this.uniforms=yo.clone(Vf.uniforms),this.material=new xo({uniforms:this.uniforms,fragmentShader:Vf.fragmentShader,vertexShader:Vf.vertexShader}),this.uniforms.width.value=e,this.uniforms.height.value=t,n)n.hasOwnProperty(i)&&this.uniforms.hasOwnProperty(i)&&(this.uniforms[i].value=n[i]);this.fsQuad=new Af.FullScreenQuad(this.material)};jf.prototype=Object.assign(Object.create(Af.prototype),{constructor:jf,render:function(e,t,n){this.material.uniforms.tDiffuse.value=n.texture,this.renderToScreen?(e.setRenderTarget(null),this.fsQuad.render(e)):(e.setRenderTarget(t),this.clear&&e.clear(),this.fsQuad.render(e))},setSize:function(e,t){this.uniforms.width.value=e,this.uniforms.height.value=t}});var Wf={extends:Of,props:{shape:{type:Number,default:1},radius:{type:Number,default:4},rotateR:{type:Number,default:Math.PI/12*1},rotateG:{type:Number,default:Math.PI/12*2},rotateB:{type:Number,default:Math.PI/12*3},scatter:{type:Number,default:0}},mounted(){const e=new jf(this.three.size.width,this.three.size.height,{});["shape","radius","rotateR","rotateG","rotateB","scatter"].forEach(t=>{e.uniforms[t].value=this[t],On(()=>this[t],()=>{e.uniforms[t].value=this[t]})}),this.passes.push(e),this.pass=e},__hmrId:"HalftonePass"},qf={defines:{NUM_SAMPLES:7,NUM_RINGS:4,NORMAL_TEXTURE:0,DIFFUSE_TEXTURE:0,DEPTH_PACKING:1,PERSPECTIVE_CAMERA:1},uniforms:{tDepth:{value:null},tDiffuse:{value:null},tNormal:{value:null},size:{value:new Fi(512,512)},cameraNear:{value:1},cameraFar:{value:100},cameraProjectionMatrix:{value:new Mr},cameraInverseProjectionMatrix:{value:new Mr},scale:{value:1},intensity:{value:.1},bias:{value:.5},minResolution:{value:0},kernelRadius:{value:100},randomSeed:{value:0}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","varying vec2 vUv;","#if DIFFUSE_TEXTURE == 1","uniform sampler2D tDiffuse;","#endif","uniform sampler2D tDepth;","#if NORMAL_TEXTURE == 1","uniform sampler2D tNormal;","#endif","uniform float cameraNear;","uniform float cameraFar;","uniform mat4 cameraProjectionMatrix;","uniform mat4 cameraInverseProjectionMatrix;","uniform float scale;","uniform float intensity;","uniform float bias;","uniform float kernelRadius;","uniform float minResolution;","uniform vec2 size;","uniform float randomSeed;","// RGBA depth","#include ","vec4 getDefaultColor( const in vec2 screenPosition ) {","\t#if DIFFUSE_TEXTURE == 1","\treturn texture2D( tDiffuse, vUv );","\t#else","\treturn vec4( 1.0 );","\t#endif","}","float getDepth( const in vec2 screenPosition ) {","\t#if DEPTH_PACKING == 1","\treturn unpackRGBAToDepth( texture2D( tDepth, screenPosition ) );","\t#else","\treturn texture2D( tDepth, screenPosition ).x;","\t#endif","}","float getViewZ( const in float depth ) {","\t#if PERSPECTIVE_CAMERA == 1","\treturn perspectiveDepthToViewZ( depth, cameraNear, cameraFar );","\t#else","\treturn orthographicDepthToViewZ( depth, cameraNear, cameraFar );","\t#endif","}","vec3 getViewPosition( const in vec2 screenPosition, const in float depth, const in float viewZ ) {","\tfloat clipW = cameraProjectionMatrix[2][3] * viewZ + cameraProjectionMatrix[3][3];","\tvec4 clipPosition = vec4( ( vec3( screenPosition, depth ) - 0.5 ) * 2.0, 1.0 );","\tclipPosition *= clipW; // unprojection.","\treturn ( cameraInverseProjectionMatrix * clipPosition ).xyz;","}","vec3 getViewNormal( const in vec3 viewPosition, const in vec2 screenPosition ) {","\t#if NORMAL_TEXTURE == 1","\treturn unpackRGBToNormal( texture2D( tNormal, screenPosition ).xyz );","\t#else","\treturn normalize( cross( dFdx( viewPosition ), dFdy( viewPosition ) ) );","\t#endif","}","float scaleDividedByCameraFar;","float minResolutionMultipliedByCameraFar;","float getOcclusion( const in vec3 centerViewPosition, const in vec3 centerViewNormal, const in vec3 sampleViewPosition ) {","\tvec3 viewDelta = sampleViewPosition - centerViewPosition;","\tfloat viewDistance = length( viewDelta );","\tfloat scaledScreenDistance = scaleDividedByCameraFar * viewDistance;","\treturn max(0.0, (dot(centerViewNormal, viewDelta) - minResolutionMultipliedByCameraFar) / scaledScreenDistance - bias) / (1.0 + pow2( scaledScreenDistance ) );","}","// moving costly divides into consts","const float ANGLE_STEP = PI2 * float( NUM_RINGS ) / float( NUM_SAMPLES );","const float INV_NUM_SAMPLES = 1.0 / float( NUM_SAMPLES );","float getAmbientOcclusion( const in vec3 centerViewPosition ) {","\t// precompute some variables require in getOcclusion.","\tscaleDividedByCameraFar = scale / cameraFar;","\tminResolutionMultipliedByCameraFar = minResolution * cameraFar;","\tvec3 centerViewNormal = getViewNormal( centerViewPosition, vUv );","\t// jsfiddle that shows sample pattern: https://jsfiddle.net/a16ff1p7/","\tfloat angle = rand( vUv + randomSeed ) * PI2;","\tvec2 radius = vec2( kernelRadius * INV_NUM_SAMPLES ) / size;","\tvec2 radiusStep = radius;","\tfloat occlusionSum = 0.0;","\tfloat weightSum = 0.0;","\tfor( int i = 0; i < NUM_SAMPLES; i ++ ) {","\t\tvec2 sampleUv = vUv + vec2( cos( angle ), sin( angle ) ) * radius;","\t\tradius += radiusStep;","\t\tangle += ANGLE_STEP;","\t\tfloat sampleDepth = getDepth( sampleUv );","\t\tif( sampleDepth >= ( 1.0 - EPSILON ) ) {","\t\t\tcontinue;","\t\t}","\t\tfloat sampleViewZ = getViewZ( sampleDepth );","\t\tvec3 sampleViewPosition = getViewPosition( sampleUv, sampleDepth, sampleViewZ );","\t\tocclusionSum += getOcclusion( centerViewPosition, centerViewNormal, sampleViewPosition );","\t\tweightSum += 1.0;","\t}","\tif( weightSum == 0.0 ) discard;","\treturn occlusionSum * ( intensity / weightSum );","}","void main() {","\tfloat centerDepth = getDepth( vUv );","\tif( centerDepth >= ( 1.0 - EPSILON ) ) {","\t\tdiscard;","\t}","\tfloat centerViewZ = getViewZ( centerDepth );","\tvec3 viewPosition = getViewPosition( vUv, centerDepth, centerViewZ );","\tfloat ambientOcclusion = getAmbientOcclusion( viewPosition );","\tgl_FragColor = getDefaultColor( vUv );","\tgl_FragColor.xyz *= 1.0 - ambientOcclusion;","}"].join("\n")},Xf={defines:{KERNEL_RADIUS:4,DEPTH_PACKING:1,PERSPECTIVE_CAMERA:1},uniforms:{tDiffuse:{value:null},size:{value:new Fi(512,512)},sampleUvOffsets:{value:[new Fi(0,0)]},sampleWeights:{value:[1]},tDepth:{value:null},cameraNear:{value:10},cameraFar:{value:1e3},depthCutoff:{value:10}},vertexShader:["#include ","uniform vec2 size;","varying vec2 vUv;","varying vec2 vInvSize;","void main() {","\tvUv = uv;","\tvInvSize = 1.0 / size;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","#include ","uniform sampler2D tDiffuse;","uniform sampler2D tDepth;","uniform float cameraNear;","uniform float cameraFar;","uniform float depthCutoff;","uniform vec2 sampleUvOffsets[ KERNEL_RADIUS + 1 ];","uniform float sampleWeights[ KERNEL_RADIUS + 1 ];","varying vec2 vUv;","varying vec2 vInvSize;","float getDepth( const in vec2 screenPosition ) {","\t#if DEPTH_PACKING == 1","\treturn unpackRGBAToDepth( texture2D( tDepth, screenPosition ) );","\t#else","\treturn texture2D( tDepth, screenPosition ).x;","\t#endif","}","float getViewZ( const in float depth ) {","\t#if PERSPECTIVE_CAMERA == 1","\treturn perspectiveDepthToViewZ( depth, cameraNear, cameraFar );","\t#else","\treturn orthographicDepthToViewZ( depth, cameraNear, cameraFar );","\t#endif","}","void main() {","\tfloat depth = getDepth( vUv );","\tif( depth >= ( 1.0 - EPSILON ) ) {","\t\tdiscard;","\t}","\tfloat centerViewZ = -getViewZ( depth );","\tbool rBreak = false, lBreak = false;","\tfloat weightSum = sampleWeights[0];","\tvec4 diffuseSum = texture2D( tDiffuse, vUv ) * weightSum;","\tfor( int i = 1; i <= KERNEL_RADIUS; i ++ ) {","\t\tfloat sampleWeight = sampleWeights[i];","\t\tvec2 sampleUvOffset = sampleUvOffsets[i] * vInvSize;","\t\tvec2 sampleUv = vUv + sampleUvOffset;","\t\tfloat viewZ = -getViewZ( getDepth( sampleUv ) );","\t\tif( abs( viewZ - centerViewZ ) > depthCutoff ) rBreak = true;","\t\tif( ! rBreak ) {","\t\t\tdiffuseSum += texture2D( tDiffuse, sampleUv ) * sampleWeight;","\t\t\tweightSum += sampleWeight;","\t\t}","\t\tsampleUv = vUv - sampleUvOffset;","\t\tviewZ = -getViewZ( getDepth( sampleUv ) );","\t\tif( abs( viewZ - centerViewZ ) > depthCutoff ) lBreak = true;","\t\tif( ! lBreak ) {","\t\t\tdiffuseSum += texture2D( tDiffuse, sampleUv ) * sampleWeight;","\t\t\tweightSum += sampleWeight;","\t\t}","\t}","\tgl_FragColor = diffuseSum / weightSum;","}"].join("\n")},Yf={createSampleWeights:function(e,t){for(var n,i,r=[],s=0;s<=e;s++)r.push((n=s,i=t,Math.exp(-n*n/(i*i*2))/(Math.sqrt(2*Math.PI)*i)));return r},createSampleOffsets:function(e,t){for(var n=[],i=0;i<=e;i++)n.push(t.clone().multiplyScalar(i));return n},configure:function(e,t,n,i){e.defines.KERNEL_RADIUS=t,e.uniforms.sampleUvOffsets.value=Yf.createSampleOffsets(t,i),e.uniforms.sampleWeights.value=Yf.createSampleWeights(t,n),e.needsUpdate=!0}},Zf={uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float opacity;","uniform sampler2D tDiffuse;","varying vec2 vUv;","#include ","void main() {","\tfloat depth = 1.0 - unpackRGBAToDepth( texture2D( tDiffuse, vUv ) );","\tgl_FragColor = vec4( vec3( depth ), opacity );","}"].join("\n")},Jf=function(e,t,n,i,r){(Af.call(this),this.scene=e,this.camera=t,this.clear=!0,this.needsSwap=!1,this.supportsDepthTextureExtension=void 0!==n&&n,this.supportsNormalTexture=void 0!==i&&i,this.originalClearColor=new gs,this.oldClearColor=new gs,this.oldClearAlpha=1,this.params={output:0,saoBias:.5,saoIntensity:.18,saoScale:1,saoKernelRadius:100,saoMinResolution:0,saoBlur:!0,saoBlurRadius:8,saoBlurStdDev:4,saoBlurDepthCutoff:.01},this.resolution=void 0!==r?new Fi(r.x,r.y):new Fi(256,256),this.saoRenderTarget=new qi(this.resolution.x,this.resolution.y,{minFilter:1006,magFilter:1006,format:1023}),this.blurIntermediateRenderTarget=this.saoRenderTarget.clone(),this.beautyRenderTarget=this.saoRenderTarget.clone(),this.normalRenderTarget=new qi(this.resolution.x,this.resolution.y,{minFilter:1003,magFilter:1003,format:1023}),this.depthRenderTarget=this.normalRenderTarget.clone(),this.supportsDepthTextureExtension)&&((n=new Fc).type=1012,n.minFilter=1003,n.maxFilter=1003,this.beautyRenderTarget.depthTexture=n,this.beautyRenderTarget.depthBuffer=!0);this.depthMaterial=new Sl,this.depthMaterial.depthPacking=3201,this.depthMaterial.blending=0,this.normalMaterial=new qh,this.normalMaterial.blending=0,void 0===qf&&console.error("THREE.SAOPass relies on SAOShader"),this.saoMaterial=new xo({defines:Object.assign({},qf.defines),fragmentShader:qf.fragmentShader,vertexShader:qf.vertexShader,uniforms:yo.clone(qf.uniforms)}),this.saoMaterial.extensions.derivatives=!0,this.saoMaterial.defines.DEPTH_PACKING=this.supportsDepthTextureExtension?0:1,this.saoMaterial.defines.NORMAL_TEXTURE=this.supportsNormalTexture?1:0,this.saoMaterial.defines.PERSPECTIVE_CAMERA=this.camera.isPerspectiveCamera?1:0,this.saoMaterial.uniforms.tDepth.value=this.supportsDepthTextureExtension?n:this.depthRenderTarget.texture,this.saoMaterial.uniforms.tNormal.value=this.normalRenderTarget.texture,this.saoMaterial.uniforms.size.value.set(this.resolution.x,this.resolution.y),this.saoMaterial.uniforms.cameraInverseProjectionMatrix.value.getInverse(this.camera.projectionMatrix),this.saoMaterial.uniforms.cameraProjectionMatrix.value=this.camera.projectionMatrix,this.saoMaterial.blending=0,void 0===Xf&&console.error("THREE.SAOPass relies on DepthLimitedBlurShader"),this.vBlurMaterial=new xo({uniforms:yo.clone(Xf.uniforms),defines:Object.assign({},Xf.defines),vertexShader:Xf.vertexShader,fragmentShader:Xf.fragmentShader}),this.vBlurMaterial.defines.DEPTH_PACKING=this.supportsDepthTextureExtension?0:1,this.vBlurMaterial.defines.PERSPECTIVE_CAMERA=this.camera.isPerspectiveCamera?1:0,this.vBlurMaterial.uniforms.tDiffuse.value=this.saoRenderTarget.texture,this.vBlurMaterial.uniforms.tDepth.value=this.supportsDepthTextureExtension?n:this.depthRenderTarget.texture,this.vBlurMaterial.uniforms.size.value.set(this.resolution.x,this.resolution.y),this.vBlurMaterial.blending=0,this.hBlurMaterial=new xo({uniforms:yo.clone(Xf.uniforms),defines:Object.assign({},Xf.defines),vertexShader:Xf.vertexShader,fragmentShader:Xf.fragmentShader}),this.hBlurMaterial.defines.DEPTH_PACKING=this.supportsDepthTextureExtension?0:1,this.hBlurMaterial.defines.PERSPECTIVE_CAMERA=this.camera.isPerspectiveCamera?1:0,this.hBlurMaterial.uniforms.tDiffuse.value=this.blurIntermediateRenderTarget.texture,this.hBlurMaterial.uniforms.tDepth.value=this.supportsDepthTextureExtension?n:this.depthRenderTarget.texture,this.hBlurMaterial.uniforms.size.value.set(this.resolution.x,this.resolution.y),this.hBlurMaterial.blending=0,void 0===Ef&&console.error("THREE.SAOPass relies on CopyShader"),this.materialCopy=new xo({uniforms:yo.clone(Ef.uniforms),vertexShader:Ef.vertexShader,fragmentShader:Ef.fragmentShader,blending:0}),this.materialCopy.transparent=!0,this.materialCopy.depthTest=!1,this.materialCopy.depthWrite=!1,this.materialCopy.blending=5,this.materialCopy.blendSrc=208,this.materialCopy.blendDst=200,this.materialCopy.blendEquation=100,this.materialCopy.blendSrcAlpha=206,this.materialCopy.blendDstAlpha=200,this.materialCopy.blendEquationAlpha=100,void 0===Zf&&console.error("THREE.SAOPass relies on UnpackDepthRGBAShader"),this.depthCopy=new xo({uniforms:yo.clone(Zf.uniforms),vertexShader:Zf.vertexShader,fragmentShader:Zf.fragmentShader,blending:0}),this.fsQuad=new Af.FullScreenQuad(null)};Jf.OUTPUT={Beauty:1,Default:0,SAO:2,Depth:3,Normal:4},Jf.prototype=Object.assign(Object.create(Af.prototype),{constructor:Jf,render:function(e,t,n){if(this.renderToScreen&&(this.materialCopy.blending=0,this.materialCopy.uniforms.tDiffuse.value=n.texture,this.materialCopy.needsUpdate=!0,this.renderPass(e,this.materialCopy,null)),1!==this.params.output){this.oldClearColor.copy(e.getClearColor()),this.oldClearAlpha=e.getClearAlpha();var i=e.autoClear;e.autoClear=!1,e.setRenderTarget(this.depthRenderTarget),e.clear(),this.saoMaterial.uniforms.bias.value=this.params.saoBias,this.saoMaterial.uniforms.intensity.value=this.params.saoIntensity,this.saoMaterial.uniforms.scale.value=this.params.saoScale,this.saoMaterial.uniforms.kernelRadius.value=this.params.saoKernelRadius,this.saoMaterial.uniforms.minResolution.value=this.params.saoMinResolution,this.saoMaterial.uniforms.cameraNear.value=this.camera.near,this.saoMaterial.uniforms.cameraFar.value=this.camera.far;var r=this.params.saoBlurDepthCutoff*(this.camera.far-this.camera.near);this.vBlurMaterial.uniforms.depthCutoff.value=r,this.hBlurMaterial.uniforms.depthCutoff.value=r,this.vBlurMaterial.uniforms.cameraNear.value=this.camera.near,this.vBlurMaterial.uniforms.cameraFar.value=this.camera.far,this.hBlurMaterial.uniforms.cameraNear.value=this.camera.near,this.hBlurMaterial.uniforms.cameraFar.value=this.camera.far,this.params.saoBlurRadius=Math.floor(this.params.saoBlurRadius),this.prevStdDev===this.params.saoBlurStdDev&&this.prevNumSamples===this.params.saoBlurRadius||(Yf.configure(this.vBlurMaterial,this.params.saoBlurRadius,this.params.saoBlurStdDev,new Fi(0,1)),Yf.configure(this.hBlurMaterial,this.params.saoBlurRadius,this.params.saoBlurStdDev,new Fi(1,0)),this.prevStdDev=this.params.saoBlurStdDev,this.prevNumSamples=this.params.saoBlurRadius),e.setClearColor(0),e.setRenderTarget(this.beautyRenderTarget),e.clear(),e.render(this.scene,this.camera),this.supportsDepthTextureExtension||this.renderOverride(e,this.depthMaterial,this.depthRenderTarget,0,1),this.supportsNormalTexture&&this.renderOverride(e,this.normalMaterial,this.normalRenderTarget,7829503,1),this.renderPass(e,this.saoMaterial,this.saoRenderTarget,16777215,1),this.params.saoBlur&&(this.renderPass(e,this.vBlurMaterial,this.blurIntermediateRenderTarget,16777215,1),this.renderPass(e,this.hBlurMaterial,this.saoRenderTarget,16777215,1));var s=this.materialCopy;3===this.params.output?this.supportsDepthTextureExtension?(this.materialCopy.uniforms.tDiffuse.value=this.beautyRenderTarget.depthTexture,this.materialCopy.needsUpdate=!0):(this.depthCopy.uniforms.tDiffuse.value=this.depthRenderTarget.texture,this.depthCopy.needsUpdate=!0,s=this.depthCopy):4===this.params.output?(this.materialCopy.uniforms.tDiffuse.value=this.normalRenderTarget.texture,this.materialCopy.needsUpdate=!0):(this.materialCopy.uniforms.tDiffuse.value=this.saoRenderTarget.texture,this.materialCopy.needsUpdate=!0),0===this.params.output?s.blending=5:s.blending=0,this.renderPass(e,s,this.renderToScreen?null:n),e.setClearColor(this.oldClearColor,this.oldClearAlpha),e.autoClear=i}},renderPass:function(e,t,n,i,r){this.originalClearColor.copy(e.getClearColor());var s=e.getClearAlpha(),o=e.autoClear;e.setRenderTarget(n),e.autoClear=!1,null!=i&&(e.setClearColor(i),e.setClearAlpha(r||0),e.clear()),this.fsQuad.material=t,this.fsQuad.render(e),e.autoClear=o,e.setClearColor(this.originalClearColor),e.setClearAlpha(s)},renderOverride:function(e,t,n,i,r){this.originalClearColor.copy(e.getClearColor());var s=e.getClearAlpha(),o=e.autoClear;e.setRenderTarget(n),e.autoClear=!1,i=t.clearColor||i,r=t.clearAlpha||r,null!=i&&(e.setClearColor(i),e.setClearAlpha(r||0),e.clear()),this.scene.overrideMaterial=t,e.render(this.scene,this.camera),this.scene.overrideMaterial=null,e.autoClear=o,e.setClearColor(this.originalClearColor),e.setClearAlpha(s)},setSize:function(e,t){this.beautyRenderTarget.setSize(e,t),this.saoRenderTarget.setSize(e,t),this.blurIntermediateRenderTarget.setSize(e,t),this.normalRenderTarget.setSize(e,t),this.depthRenderTarget.setSize(e,t),this.saoMaterial.uniforms.size.value.set(e,t),this.saoMaterial.uniforms.cameraInverseProjectionMatrix.value.getInverse(this.camera.projectionMatrix),this.saoMaterial.uniforms.cameraProjectionMatrix.value=this.camera.projectionMatrix,this.saoMaterial.needsUpdate=!0,this.vBlurMaterial.uniforms.size.value.set(e,t),this.vBlurMaterial.needsUpdate=!0,this.hBlurMaterial.uniforms.size.value.set(e,t),this.hBlurMaterial.needsUpdate=!0}});var Kf={extends:Of,props:{depthTexture:{type:Boolean,default:!1},useNormals:{type:Boolean,default:!1},resolution:Object},mounted(){this.three.scene||console.error("Missing Scene"),this.three.camera||console.error("Missing Camera");const e=this.resolution?new Fi(this.resolution.x,this.resolution.y):new Fi(this.three.size.width,this.three.size.height),t=new Jf(this.three.scene,this.three.camera,this.depthTexture,this.useNormals,e);this.passes.push(t),this.pass=t},__hmrId:"SAOPass"},Qf={shaderID:"luminosityHighPass",uniforms:{tDiffuse:{value:null},luminosityThreshold:{value:1},smoothWidth:{value:1},defaultColor:{value:new gs(0)},defaultOpacity:{value:0}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform vec3 defaultColor;","uniform float defaultOpacity;","uniform float luminosityThreshold;","uniform float smoothWidth;","varying vec2 vUv;","void main() {","\tvec4 texel = texture2D( tDiffuse, vUv );","\tvec3 luma = vec3( 0.299, 0.587, 0.114 );","\tfloat v = dot( texel.xyz, luma );","\tvec4 outputColor = vec4( defaultColor.rgb, defaultOpacity );","\tfloat alpha = smoothstep( luminosityThreshold, luminosityThreshold + smoothWidth, v );","\tgl_FragColor = mix( outputColor, texel, alpha );","}"].join("\n")},$f=function(e,t,n,i){Af.call(this),this.strength=void 0!==t?t:1,this.radius=n,this.threshold=i,this.resolution=void 0!==e?new Fi(e.x,e.y):new Fi(256,256),this.clearColor=new gs(0,0,0);var r={minFilter:1006,magFilter:1006,format:1023};this.renderTargetsHorizontal=[],this.renderTargetsVertical=[],this.nMips=5;var s=Math.round(this.resolution.x/2),o=Math.round(this.resolution.y/2);this.renderTargetBright=new qi(s,o,r),this.renderTargetBright.texture.name="UnrealBloomPass.bright",this.renderTargetBright.texture.generateMipmaps=!1;for(var a=0;a\t\t\t\tvarying vec2 vUv;\n\t\t\t\tuniform sampler2D colorTexture;\n\t\t\t\tuniform vec2 texSize;\t\t\t\tuniform vec2 direction;\t\t\t\t\t\t\t\tfloat gaussianPdf(in float x, in float sigma) {\t\t\t\t\treturn 0.39894 * exp( -0.5 * x * x/( sigma * sigma))/sigma;\t\t\t\t}\t\t\t\tvoid main() {\n\t\t\t\t\tvec2 invSize = 1.0 / texSize;\t\t\t\t\tfloat fSigma = float(SIGMA);\t\t\t\t\tfloat weightSum = gaussianPdf(0.0, fSigma);\t\t\t\t\tvec3 diffuseSum = texture2D( colorTexture, vUv).rgb * weightSum;\t\t\t\t\tfor( int i = 1; i < KERNEL_RADIUS; i ++ ) {\t\t\t\t\t\tfloat x = float(i);\t\t\t\t\t\tfloat w = gaussianPdf(x, fSigma);\t\t\t\t\t\tvec2 uvOffset = direction * invSize * x;\t\t\t\t\t\tvec3 sample1 = texture2D( colorTexture, vUv + uvOffset).rgb;\t\t\t\t\t\tvec3 sample2 = texture2D( colorTexture, vUv - uvOffset).rgb;\t\t\t\t\t\tdiffuseSum += (sample1 + sample2) * w;\t\t\t\t\t\tweightSum += 2.0 * w;\t\t\t\t\t}\t\t\t\t\tgl_FragColor = vec4(diffuseSum/weightSum, 1.0);\n\t\t\t\t}"})},getCompositeMaterial:function(e){return new xo({defines:{NUM_MIPS:e},uniforms:{blurTexture1:{value:null},blurTexture2:{value:null},blurTexture3:{value:null},blurTexture4:{value:null},blurTexture5:{value:null},dirtTexture:{value:null},bloomStrength:{value:1},bloomFactors:{value:null},bloomTintColors:{value:null},bloomRadius:{value:0}},vertexShader:"varying vec2 vUv;\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"varying vec2 vUv;\t\t\t\tuniform sampler2D blurTexture1;\t\t\t\tuniform sampler2D blurTexture2;\t\t\t\tuniform sampler2D blurTexture3;\t\t\t\tuniform sampler2D blurTexture4;\t\t\t\tuniform sampler2D blurTexture5;\t\t\t\tuniform sampler2D dirtTexture;\t\t\t\tuniform float bloomStrength;\t\t\t\tuniform float bloomRadius;\t\t\t\tuniform float bloomFactors[NUM_MIPS];\t\t\t\tuniform vec3 bloomTintColors[NUM_MIPS];\t\t\t\t\t\t\t\tfloat lerpBloomFactor(const in float factor) { \t\t\t\t\tfloat mirrorFactor = 1.2 - factor;\t\t\t\t\treturn mix(factor, mirrorFactor, bloomRadius);\t\t\t\t}\t\t\t\t\t\t\t\tvoid main() {\t\t\t\t\tgl_FragColor = bloomStrength * ( lerpBloomFactor(bloomFactors[0]) * vec4(bloomTintColors[0], 1.0) * texture2D(blurTexture1, vUv) + \t\t\t\t\t\t\t\t\t\t\t\t\t lerpBloomFactor(bloomFactors[1]) * vec4(bloomTintColors[1], 1.0) * texture2D(blurTexture2, vUv) + \t\t\t\t\t\t\t\t\t\t\t\t\t lerpBloomFactor(bloomFactors[2]) * vec4(bloomTintColors[2], 1.0) * texture2D(blurTexture3, vUv) + \t\t\t\t\t\t\t\t\t\t\t\t\t lerpBloomFactor(bloomFactors[3]) * vec4(bloomTintColors[3], 1.0) * texture2D(blurTexture4, vUv) + \t\t\t\t\t\t\t\t\t\t\t\t\t lerpBloomFactor(bloomFactors[4]) * vec4(bloomTintColors[4], 1.0) * texture2D(blurTexture5, vUv) );\t\t\t\t}"})}}),$f.BlurDirectionX=new Fi(1,0),$f.BlurDirectionY=new Fi(0,1);var em={extends:Of,props:{strength:{type:Number,default:1.5},radius:{type:Number,default:0},threshold:{type:Number,default:0}},watch:{strength(){this.pass.strength=this.strength},radius(){this.pass.radius=this.radius},threshold(){this.pass.threshold=this.threshold}},mounted(){const e=new Fi(this.three.size.width,this.three.size.height),t=new $f(e,this.strength,this.radius,this.threshold);this.passes.push(t),this.pass=t},__hmrId:"UnrealBloomPass"},tm="\n//\n// Description : Array and textureless GLSL 2D simplex noise function.\n// Author : Ian McEwan, Ashima Arts.\n// Maintainer : ijm\n// Lastmod : 20110822 (ijm)\n// License : Copyright (C) 2011 Ashima Arts. All rights reserved.\n// Distributed under the MIT License. See LICENSE file.\n// https://github.com/ashima/webgl-noise\n//\n\nvec3 mod289(vec3 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec2 mod289(vec2 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec3 permute(vec3 x) {\n return mod289(((x*34.0)+1.0)*x);\n}\n\nfloat snoise(vec2 v)\n{\n const vec4 C = vec4(0.211324865405187, // (3.0-sqrt(3.0))/6.0\n 0.366025403784439, // 0.5*(sqrt(3.0)-1.0)\n -0.577350269189626, // -1.0 + 2.0 * C.x\n 0.024390243902439); // 1.0 / 41.0\n // First corner\n vec2 i = floor(v + dot(v, C.yy) );\n vec2 x0 = v - i + dot(i, C.xx);\n\n // Other corners\n vec2 i1;\n i1 = (x0.x > x0.y) ? vec2(1.0, 0.0) : vec2(0.0, 1.0);\n vec4 x12 = x0.xyxy + C.xxzz;\n x12.xy -= i1;\n\n // Permutations\n i = mod289(i); // Avoid truncation effects in permutation\n vec3 p = permute( permute( i.y + vec3(0.0, i1.y, 1.0 ))\n + i.x + vec3(0.0, i1.x, 1.0 ));\n\n vec3 m = max(0.5 - vec3(dot(x0,x0), dot(x12.xy,x12.xy), dot(x12.zw,x12.zw)), 0.0);\n m = m*m ;\n m = m*m ;\n\n // Gradients: 41 points uniformly over a line, mapped onto a diamond.\n // The ring size 17*17 = 289 is close to a multiple of 41 (41*7 = 287)\n\n vec3 x = 2.0 * fract(p * C.www) - 1.0;\n vec3 h = abs(x) - 0.5;\n vec3 ox = floor(x + 0.5);\n vec3 a0 = x - ox;\n\n // Normalise gradients implicitly by scaling m\n // Approximation of: m *= inversesqrt( a0*a0 + h*h );\n m *= 1.79284291400159 - 0.85373472095314 * ( a0*a0 + h*h );\n\n // Compute final noise value at P\n vec3 g;\n g.x = a0.x * x0.x + h.x * x0.y;\n g.yz = a0.yz * x12.xz + h.yz * x12.yw;\n return 130.0 * dot(m, g);\n}\n",nm={extends:bf,props:{widthSegments:{type:Number,default:20},heightSegments:{type:Number,default:20},timeCoef:{type:Number,default:.001},noiseCoef:{type:Number,default:1},zCoef:{type:Number,default:5},dispCoef:{type:Number,default:.05}},setup(e){const t={value:e.noiseCoef};On(()=>e.noiseCoef,e=>{t.value=e});const n={value:e.zCoef};On(()=>e.zCoef,e=>{n.value=e});const i={value:e.dispCoef};return On(()=>e.dispCoef,e=>{i.value=e}),{uTime:{value:0},uNoiseCoef:t,uZCoef:n,uDispCoef:i}},mounted(){this.startTime=Date.now(),this.three.onBeforeRender(this.updateTime)},unmounted(){this.three.offBeforeRender(this.updateTime)},methods:{createGeometry(){this.geometry=new Ro(1,1,this.widthSegments,this.heightSegments)},createMaterial(){this.material=new _s({side:2,map:this.loadTexture()}),this.material.onBeforeCompile=e=>{e.uniforms.uTime=this.uTime,e.uniforms.uNoiseCoef=this.uNoiseCoef,e.uniforms.uZCoef=this.uZCoef,e.uniforms.uDispCoef=this.uDispCoef,e.vertexShader=`\n uniform float uTime;\n uniform float uNoiseCoef;\n uniform float uZCoef;\n varying float vNoise;\n ${tm}\n `+e.vertexShader,e.vertexShader=e.vertexShader.replace("#include "," \n vec3 p = vec3(position * uNoiseCoef);\n p.x += uTime;\n vNoise = snoise(p.xy);\n vec3 transformed = vec3(position);\n transformed.z += vNoise * uZCoef;\n "),e.fragmentShader="\n uniform float uDispCoef;\n varying float vNoise;\n "+e.fragmentShader,e.fragmentShader=e.fragmentShader.replace("#include ","\n vec4 texelColor = texture2D(map, vUv);\n vec4 dispTexel = texture2D(map, vUv + vec2(vNoise * uDispCoef, 0));\n texelColor.r = dispTexel.r;\n diffuseColor = texelColor;\n "),this.materialShader=e}},updateTime(){this.uTime.value=(Date.now()-this.startTime)*this.timeCoef}},__hmrId:"NoisyImage"},im={extends:uf,props:{timeCoef:{type:Number,default:.001},noiseCoef:{type:Number,default:1},zCoef:{type:Number,default:5}},setup(e){const t={value:e.noiseCoef};On(()=>e.noiseCoef,e=>{t.value=e});const n={value:e.zCoef};return On(()=>e.zCoef,e=>{n.value=e}),{uTime:{value:0},uNoiseCoef:t,uZCoef:n}},mounted(){this.updateMaterial(),this.startTime=Date.now(),this.three.onBeforeRender(this.updateTime)},unmounted(){this.three.offBeforeRender(this.updateTime)},methods:{updateMaterial(){this.material.onBeforeCompile=e=>{e.uniforms.uTime=this.uTime,e.uniforms.uNoiseCoef=this.uNoiseCoef,e.uniforms.uZCoef=this.uZCoef,e.vertexShader="\n uniform float uTime;\n uniform float uNoiseCoef;\n uniform float uZCoef;\n varying float vNoise;\n \n//\n// Description : Array and textureless GLSL 2D/3D/4D simplex\n// noise functions.\n// Author : Ian McEwan, Ashima Arts.\n// Maintainer : ijm\n// Lastmod : 20110822 (ijm)\n// License : Copyright (C) 2011 Ashima Arts. All rights reserved.\n// Distributed under the MIT License. See LICENSE file.\n// https://github.com/ashima/webgl-noise\n//\n\nvec3 mod289(vec3 x) { return x - floor(x * (1.0 / 289.0)) * 289.0; }\nvec4 mod289(vec4 x) { return x - floor(x * (1.0 / 289.0)) * 289.0; }\nvec4 permute(vec4 x) { return mod289(((x*34.0)+1.0)*x); }\nvec4 taylorInvSqrt(vec4 r) { return 1.79284291400159 - 0.85373472095314 * r; }\n\nfloat snoise(vec3 v)\n{\n const vec2 C = vec2(1.0/6.0, 1.0/3.0) ;\n const vec4 D = vec4(0.0, 0.5, 1.0, 2.0);\n\n // First corner\n vec3 i = floor(v + dot(v, C.yyy) );\n vec3 x0 = v - i + dot(i, C.xxx) ;\n\n // Other corners\n vec3 g = step(x0.yzx, x0.xyz);\n vec3 l = 1.0 - g;\n vec3 i1 = min( g.xyz, l.zxy );\n vec3 i2 = max( g.xyz, l.zxy );\n\n vec3 x1 = x0 - i1 + C.xxx;\n vec3 x2 = x0 - i2 + C.yyy; // 2.0*C.x = 1/3 = C.y\n vec3 x3 = x0 - D.yyy; // -1.0+3.0*C.x = -0.5 = -D.y\n\n // Permutations\n i = mod289(i);\n vec4 p = permute( permute( permute(\n i.z + vec4(0.0, i1.z, i2.z, 1.0 ))\n + i.y + vec4(0.0, i1.y, i2.y, 1.0 ))\n + i.x + vec4(0.0, i1.x, i2.x, 1.0 ));\n\n // Gradients: 7x7 points over a square, mapped onto an octahedron.\n // The ring size 17*17 = 289 is close to a multiple of 49 (49*6 = 294)\n float n_ = 0.142857142857; // 1.0/7.0\n vec3 ns = n_ * D.wyz - D.xzx;\n\n vec4 j = p - 49.0 * floor(p * ns.z * ns.z); // mod(p,7*7)\n\n vec4 x_ = floor(j * ns.z);\n vec4 y_ = floor(j - 7.0 * x_ ); // mod(j,N)\n\n vec4 x = x_ *ns.x + ns.yyyy;\n vec4 y = y_ *ns.x + ns.yyyy;\n vec4 h = 1.0 - abs(x) - abs(y);\n\n vec4 b0 = vec4( x.xy, y.xy );\n vec4 b1 = vec4( x.zw, y.zw );\n\n vec4 s0 = floor(b0)*2.0 + 1.0;\n vec4 s1 = floor(b1)*2.0 + 1.0;\n vec4 sh = -step(h, vec4(0.0));\n\n vec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy ;\n vec4 a1 = b1.xzyw + s1.xzyw*sh.zzww ;\n\n vec3 p0 = vec3(a0.xy,h.x);\n vec3 p1 = vec3(a0.zw,h.y);\n vec3 p2 = vec3(a1.xy,h.z);\n vec3 p3 = vec3(a1.zw,h.w);\n\n // Normalise gradients\n vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3)));\n p0 *= norm.x;\n p1 *= norm.y;\n p2 *= norm.z;\n p3 *= norm.w;\n\n // Mix final noise value\n vec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.0);\n m = m * m;\n return 42.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1),\n dot(p2,x2), dot(p3,x3) ) );\n}\n\n "+e.vertexShader,e.vertexShader=e.vertexShader.replace("#include "," \n vec3 p = vec3(position * uNoiseCoef);\n vNoise = snoise(vec3(p.x, p.y, uTime));\n vec3 transformed = vec3(position);\n transformed.z += vNoise * uZCoef;\n "),this.materialShader=e},this.material.needsupdate=!0},updateTime(){this.uTime.value=(Date.now()-this.startTime)*this.timeCoef}},__hmrId:"NoisyPlane"},rm={extends:ff,props:{radius:{type:Number,default:20},widthSegments:{type:Number,default:128},heightSegments:{type:Number,default:128},timeCoef:{type:Number,default:.001},noiseCoef:{type:Number,default:.05},dispCoef:{type:Number,default:5}},setup(e){const t={value:e.noiseCoef};On(()=>e.noiseCoef,e=>{t.value=e});const n={value:e.dispCoef};return On(()=>e.dispCoef,e=>{n.value=e}),{uTime:{value:0},uNoiseCoef:t,uDispCoef:n}},mounted(){this.updateMaterial(),this.startTime=Date.now(),this.three.onBeforeRender(this.updateTime)},unmounted(){this.three.offBeforeRender(this.updateTime)},methods:{updateMaterial(){this.material.onBeforeCompile=e=>{e.uniforms.uTime=this.uTime,e.uniforms.uNoiseCoef=this.uNoiseCoef,e.uniforms.uDispCoef=this.uDispCoef,e.vertexShader="\n uniform float uTime;\n uniform float uNoiseCoef;\n uniform float uDispCoef;\n varying float vNoise;\n \n//\n// Description : Array and textureless GLSL 2D/3D/4D simplex\n// noise functions.\n// Author : Ian McEwan, Ashima Arts.\n// Maintainer : ijm\n// Lastmod : 20110822 (ijm)\n// License : Copyright (C) 2011 Ashima Arts. All rights reserved.\n// Distributed under the MIT License. See LICENSE file.\n// https://github.com/ashima/webgl-noise\n//\n\nvec4 mod289(vec4 x) { return x - floor(x * (1.0 / 289.0)) * 289.0; }\nfloat mod289(float x) { return x - floor(x * (1.0 / 289.0)) * 289.0; }\nvec4 permute(vec4 x) { return mod289(((x*34.0)+1.0)*x); }\nfloat permute(float x) { return mod289(((x*34.0)+1.0)*x); }\nvec4 taylorInvSqrt(vec4 r) { return 1.79284291400159 - 0.85373472095314 * r; }\nfloat taylorInvSqrt(float r) { return 1.79284291400159 - 0.85373472095314 * r; }\n\nvec4 grad4(float j, vec4 ip)\n{\n const vec4 ones = vec4(1.0, 1.0, 1.0, -1.0);\n vec4 p,s;\n\n p.xyz = floor( fract (vec3(j) * ip.xyz) * 7.0) * ip.z - 1.0;\n p.w = 1.5 - dot(abs(p.xyz), ones.xyz);\n s = vec4(lessThan(p, vec4(0.0)));\n p.xyz = p.xyz + (s.xyz*2.0 - 1.0) * s.www;\n\n return p;\n}\n\n// (sqrt(5) - 1)/4 = F4, used once below\n#define F4 0.309016994374947451\n\nfloat snoise(vec4 v)\n{\n const vec4 C = vec4( 0.138196601125011, // (5 - sqrt(5))/20 G4\n 0.276393202250021, // 2 * G4\n 0.414589803375032, // 3 * G4\n -0.447213595499958); // -1 + 4 * G4\n\n // First corner\n vec4 i = floor(v + dot(v, vec4(F4)) );\n vec4 x0 = v - i + dot(i, C.xxxx);\n\n // Other corners\n\n // Rank sorting originally contributed by Bill Licea-Kane, AMD (formerly ATI)\n vec4 i0;\n vec3 isX = step( x0.yzw, x0.xxx );\n vec3 isYZ = step( x0.zww, x0.yyz );\n // i0.x = dot( isX, vec3( 1.0 ) );\n i0.x = isX.x + isX.y + isX.z;\n i0.yzw = 1.0 - isX;\n // i0.y += dot( isYZ.xy, vec2( 1.0 ) );\n i0.y += isYZ.x + isYZ.y;\n i0.zw += 1.0 - isYZ.xy;\n i0.z += isYZ.z;\n i0.w += 1.0 - isYZ.z;\n\n // i0 now contains the unique values 0,1,2,3 in each channel\n vec4 i3 = clamp( i0, 0.0, 1.0 );\n vec4 i2 = clamp( i0-1.0, 0.0, 1.0 );\n vec4 i1 = clamp( i0-2.0, 0.0, 1.0 );\n\n vec4 x1 = x0 - i1 + C.xxxx;\n vec4 x2 = x0 - i2 + C.yyyy;\n vec4 x3 = x0 - i3 + C.zzzz;\n vec4 x4 = x0 + C.wwww;\n\n // Permutations\n i = mod289(i);\n float j0 = permute( permute( permute( permute(i.w) + i.z) + i.y) + i.x);\n vec4 j1 = permute( permute( permute( permute (\n i.w + vec4(i1.w, i2.w, i3.w, 1.0 ))\n + i.z + vec4(i1.z, i2.z, i3.z, 1.0 ))\n + i.y + vec4(i1.y, i2.y, i3.y, 1.0 ))\n + i.x + vec4(i1.x, i2.x, i3.x, 1.0 ));\n\n // Gradients: 7x7x6 points over a cube, mapped onto a 4-cross polytope\n // 7*7*6 = 294, which is close to the ring size 17*17 = 289.\n vec4 ip = vec4(1.0/294.0, 1.0/49.0, 1.0/7.0, 0.0) ;\n\n vec4 p0 = grad4(j0, ip);\n vec4 p1 = grad4(j1.x, ip);\n vec4 p2 = grad4(j1.y, ip);\n vec4 p3 = grad4(j1.z, ip);\n vec4 p4 = grad4(j1.w, ip);\n\n // Normalise gradients\n vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3)));\n p0 *= norm.x;\n p1 *= norm.y;\n p2 *= norm.z;\n p3 *= norm.w;\n p4 *= taylorInvSqrt(dot(p4,p4));\n\n // Mix contributions from the five corners\n vec3 m0 = max(0.6 - vec3(dot(x0,x0), dot(x1,x1), dot(x2,x2)), 0.0);\n vec2 m1 = max(0.6 - vec2(dot(x3,x3), dot(x4,x4) ), 0.0);\n m0 = m0 * m0;\n m1 = m1 * m1;\n return 49.0 * ( dot(m0*m0, vec3( dot( p0, x0 ), dot( p1, x1 ), dot( p2, x2 )))\n + dot(m1*m1, vec2( dot( p3, x3 ), dot( p4, x4 ) ) ) ) ;\n\n}\n\n "+e.vertexShader,e.vertexShader=e.vertexShader.replace("#include ","\n vec4 p = vec4(vec3(position * uNoiseCoef), uTime);\n vNoise = snoise(p);\n vec3 transformed = vec3(position);\n transformed += normalize(position) * vNoise * uDispCoef;\n "),this.materialShader=e},this.material.needsupdate=!0},updateTime(){this.uTime.value=(Date.now()-this.startTime)*this.timeCoef}},__hmrId:"NoisySphere"},sm={extends:gf,props:{timeCoef:{type:Number,default:.001},noiseCoef:{type:Number,default:.015},zCoef:{type:Number,default:10}},setup(e){const t={value:e.noiseCoef};On(()=>e.noiseCoef,e=>{t.value=e});const n={value:e.zCoef};return On(()=>e.zCoef,e=>{n.value=e}),{uTime:{value:0},uNoiseCoef:t,uZCoef:n}},mounted(){this.updateMaterial(),this.startTime=Date.now(),this.three.onBeforeRender(this.updateTime)},unmounted(){this.three.offBeforeRender(this.updateTime)},methods:{updateMaterial(){this.material.onBeforeCompile=e=>{e.uniforms.uTime=this.uTime,e.uniforms.uNoiseCoef=this.uNoiseCoef,e.uniforms.uZCoef=this.uZCoef,e.vertexShader=`\n uniform float uTime;\n uniform float uNoiseCoef;\n uniform float uZCoef;\n ${tm}\n `+e.vertexShader,e.vertexShader=e.vertexShader.replace("#include "," \n vec3 p = vec3(position * uNoiseCoef);\n p.x += uTime;\n float noise = snoise(p.xy);\n vec3 transformed = vec3(position);\n transformed.z += noise * uZCoef;\n "),this.materialShader=e},this.material.needsupdate=!0},updateTime(){this.uTime.value=(Date.now()-this.startTime)*this.timeCoef}},__hmrId:"NoisyText"};function om(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function am(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t} +function e(e,t){const n=Object.create(null),i=e.split(",");for(let e=0;e!!n[e.toLowerCase()]:e=>!!n[e]}const t=e("Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl"),n=e("itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly");function i(e){if(_(e)){const t={};for(let n=0;n{if(e){const n=e.split(s);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function a(e){let t="";if(w(e))t=e;else if(_(e))for(let n=0;nt instanceof Map?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[t,n])=>(e[t+" =>"]=n,e),{})}:t instanceof Set?{[`Set(${t.size})`]:[...t.values()]}:!S(t)||_(t)||C(t)?t:String(t),c={},h=[],u=()=>{},d=()=>!1,p=/^on[^a-z]/,f=e=>p.test(e),m=e=>e.startsWith("onUpdate:"),g=Object.assign,v=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},y=Object.prototype.hasOwnProperty,x=(e,t)=>y.call(e,t),_=Array.isArray,b=e=>"function"==typeof e,w=e=>"string"==typeof e,M=e=>"symbol"==typeof e,S=e=>null!==e&&"object"==typeof e,T=e=>S(e)&&b(e.then)&&b(e.catch),E=Object.prototype.toString,A=e=>E.call(e),C=e=>"[object Object]"===A(e),L=e("key,ref,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),R=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},P=/-(\w)/g,N=R(e=>e.replace(P,(e,t)=>t?t.toUpperCase():"")),D=/\B([A-Z])/g,I=R(e=>e.replace(D,"-$1").toLowerCase()),O=R(e=>e.charAt(0).toUpperCase()+e.slice(1)),z=(e,t)=>e!==t&&(e==e||t==t),U=(e,t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value:n})},F=new WeakMap,G=[];let k;const H=Symbol(""),j=Symbol("");function V(e,t=c){(function(e){return e&&!0===e._isEffect})(e)&&(e=e.raw);const n=function(e,t){const n=function(){if(!n.active)return t.scheduler?void 0:e();if(!G.includes(n)){q(n);try{return Z.push(Y),Y=!0,G.push(n),k=n,e()}finally{G.pop(),K(),k=G[G.length-1]}}};return n.id=X++,n._isEffect=!0,n.active=!0,n.raw=e,n.deps=[],n.options=t,n}(e,t);return t.lazy||n(),n}function W(e){e.active&&(q(e),e.options.onStop&&e.options.onStop(),e.active=!1)}let X=0;function q(e){const{deps:t}=e;if(t.length){for(let n=0;n{e&&e.forEach(e=>{e!==k&&a.add(e)})};if("clear"===t)o.forEach(l);else if("length"===n&&_(e))o.forEach((e,t)=>{("length"===t||t>=i)&&l(e)});else{void 0!==n&&l(o.get(n));const i="add"===t||"delete"===t&&!_(e);(i||"set"===t&&e instanceof Map)&&l(o.get(_(e)?"length":H)),i&&e instanceof Map&&l(o.get(j))}a.forEach(e=>{e.options.scheduler?e.options.scheduler(e):e()})}const ee=new Set(Object.getOwnPropertyNames(Symbol).map(e=>Symbol[e]).filter(M)),te=oe(),ne=oe(!1,!0),ie=oe(!0),re=oe(!0,!0),se={};function oe(e=!1,t=!1){return function(n,i,r){if("__v_isReactive"===i)return!e;if("__v_isReadonly"===i)return e;if("__v_raw"===i&&r===(e?Oe:Ie).get(n))return n;const s=_(n);if(s&&x(se,i))return Reflect.get(se,i,r);const o=Reflect.get(n,i,r),a=M(i);if(a?ee.has(i):"__proto__"===i||"__v_isRef"===i)return o;if(e||Q(n,0,i),t)return o;if(Ve(o)){return!s||a||""+parseInt(i,10)!==i?o.value:o}return S(o)?e?Be(o):Ue(o):o}}["includes","indexOf","lastIndexOf"].forEach(e=>{se[e]=function(...t){const n=je(this);for(let e=0,t=this.length;e!0,deleteProperty:(e,t)=>!0},de=g({},he,{get:ne,set:ae(!0)}),pe=(g({},ue,{get:re}),e=>S(e)?Ue(e):e),fe=e=>S(e)?Be(e):e,me=e=>e,ge=e=>Reflect.getPrototypeOf(e);function ve(e,t,n=!1,i=!1){const r=je(e=e.__v_raw),s=je(t);t!==s&&!n&&Q(r,0,t),!n&&Q(r,0,s);const{has:o}=ge(r),a=n?fe:i?me:pe;return o.call(r,t)?a(e.get(t)):o.call(r,s)?a(e.get(s)):void 0}function ye(e,t=!1){const n=this.__v_raw,i=je(n),r=je(e);return e!==r&&!t&&Q(i,0,e),!t&&Q(i,0,r),n.has(e)||n.has(r)}function xe(e,t=!1){return e=e.__v_raw,!t&&Q(je(e),0,H),Reflect.get(e,"size",e)}function _e(e){e=je(e);const t=je(this),n=ge(t),i=n.has.call(t,e),r=n.add.call(t,e);return i||$(t,"add",e,e),r}function be(e,t){t=je(t);const n=je(this),{has:i,get:r,set:s}=ge(n);let o=i.call(n,e);o||(e=je(e),o=i.call(n,e));const a=r.call(n,e),l=s.call(n,e,t);return o?z(t,a)&&$(n,"set",e,t):$(n,"add",e,t),l}function we(e){const t=je(this),{has:n,get:i,delete:r}=ge(t);let s=n.call(t,e);s||(e=je(e),s=n.call(t,e));i&&i.call(t,e);const o=r.call(t,e);return s&&$(t,"delete",e,void 0),o}function Me(){const e=je(this),t=0!==e.size,n=ge(e).clear.call(e);return t&&$(e,"clear",void 0,void 0),n}function Se(e,t){return function(n,i){const r=this,s=r.__v_raw,o=je(s),a=e?fe:t?me:pe;return!e&&Q(o,0,H),s.forEach((e,t)=>n.call(i,a(e),a(t),r))}}function Te(e,t,n){return function(...i){const r=this.__v_raw,s=je(r),o=s instanceof Map,a="entries"===e||e===Symbol.iterator&&o,l="keys"===e&&o,c=r[e](...i),h=t?fe:n?me:pe;return!t&&Q(s,0,l?j:H),{next(){const{value:e,done:t}=c.next();return t?{value:e,done:t}:{value:a?[h(e[0]),h(e[1])]:h(e),done:t}},[Symbol.iterator](){return this}}}}function Ee(e){return function(...t){return"delete"!==e&&this}}const Ae={get(e){return ve(this,e)},get size(){return xe(this)},has:ye,add:_e,set:be,delete:we,clear:Me,forEach:Se(!1,!1)},Ce={get(e){return ve(this,e,!1,!0)},get size(){return xe(this)},has:ye,add:_e,set:be,delete:we,clear:Me,forEach:Se(!1,!0)},Le={get(e){return ve(this,e,!0)},get size(){return xe(this,!0)},has(e){return ye.call(this,e,!0)},add:Ee("add"),set:Ee("set"),delete:Ee("delete"),clear:Ee("clear"),forEach:Se(!0,!1)};function Re(e,t){const n=t?Ce:e?Le:Ae;return(t,i,r)=>"__v_isReactive"===i?!e:"__v_isReadonly"===i?e:"__v_raw"===i?t:Reflect.get(x(n,i)&&i in t?n:t,i,r)}["keys","values","entries",Symbol.iterator].forEach(e=>{Ae[e]=Te(e,!1,!1),Le[e]=Te(e,!0,!1),Ce[e]=Te(e,!1,!0)});const Pe={get:Re(!1,!1)},Ne={get:Re(!1,!0)},De={get:Re(!0,!1)},Ie=new WeakMap,Oe=new WeakMap;function ze(e){return e.__v_skip||!Object.isExtensible(e)?0:function(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}((e=>A(e).slice(8,-1))(e))}function Ue(e){return e&&e.__v_isReadonly?e:Fe(e,!1,he,Pe)}function Be(e){return Fe(e,!0,ue,De)}function Fe(e,t,n,i){if(!S(e))return e;if(e.__v_raw&&(!t||!e.__v_isReactive))return e;const r=t?Oe:Ie,s=r.get(e);if(s)return s;const o=ze(e);if(0===o)return e;const a=new Proxy(e,2===o?i:n);return r.set(e,a),a}function Ge(e){return ke(e)?Ge(e.__v_raw):!(!e||!e.__v_isReactive)}function ke(e){return!(!e||!e.__v_isReadonly)}function He(e){return Ge(e)||ke(e)}function je(e){return e&&je(e.__v_raw)||e}function Ve(e){return Boolean(e&&!0===e.__v_isRef)}const We={get:(e,t,n)=>{return Ve(i=Reflect.get(e,t,n))?i.value:i;var i},set:(e,t,n,i)=>{const r=e[t];return Ve(r)&&!Ve(n)?(r.value=n,!0):Reflect.set(e,t,n,i)}};class Xe{constructor(e,t){this._object=e,this._key=t,this.__v_isRef=!0}get value(){return this._object[this._key]}set value(e){this._object[this._key]=e}}class qe{constructor(e,t,n){this._setter=t,this._dirty=!0,this.__v_isRef=!0,this.effect=V(e,{lazy:!0,scheduler:()=>{this._dirty||(this._dirty=!0,$(je(this),"set","value"))}}),this.__v_isReadonly=n}get value(){return this._dirty&&(this._value=this.effect(),this._dirty=!1),Q(je(this),0,"value"),this._value}set value(e){this._setter(e)}}function Ye(e,t,n,i){let r;try{r=i?e(...i):e()}catch(e){Je(e,t,n)}return r}function Ze(e,t,n,i){if(b(e)){const r=Ye(e,t,n,i);return r&&T(r)&&r.catch(e=>{Je(e,t,n)}),r}const r=[];for(let s=0;sgt(e)-gt(t)),ot=0;otnull==e.id?1/0:e.id;function vt(e){Qe=!1,Ke=!0,ft(e),$e.sort((e,t)=>gt(e)-gt(t));try{for(et=0;et<$e.length;et++){const e=$e[et];e&&Ye(e,null,14)}}finally{et=0,$e.length=0,mt(),Ke=!1,lt=null,($e.length||rt.length)&&vt(e)}}let yt=null;function xt(e){yt=e}function _t(e){const{type:t,parent:n,vnode:i,proxy:r,withProxy:s,props:o,slots:a,attrs:l,emit:c,render:h,renderCache:u,data:d,setupState:p,ctx:f}=e;let g;yt=e;try{let e;if(4&i.shapeFlag){const t=s||r;g=Yt(h.call(t,t,u,o,p,d,f)),e=l}else{const n=t;0,g=Yt(n.length>1?n(o,{attrs:l,slots:a,emit:c}):n(o,null)),e=t.props?l:bt(l)}let v=g;if(!1!==t.inheritAttrs&&e){const t=Object.keys(e),{shapeFlag:n}=v;t.length&&(1&n||6&n)&&(1&n&&t.some(m)&&(e=wt(e)),v=Wt(v,e))}const y=i.scopeId,x=y&&v.scopeId!==y,_=n&&n.type.__scopeId,b=_&&_!==y?_+"-s":null;if(x||b){const e={};x&&(e[y]=""),b&&(e[b]=""),v=Wt(v,e)}i.dirs&&(v.dirs=i.dirs),i.transition&&(v.transition=i.transition),g=v}catch(t){Je(t,e,1),g=Vt(Dt)}return yt=null,g}const bt=e=>{let t;for(const n in e)("class"===n||"style"===n||f(n))&&((t||(t={}))[n]=e[n]);return t},wt=e=>{const t={};for(const n in e)m(n)||(t[n]=e[n]);return t};function Mt(e,t){const n=Object.keys(t);if(n.length!==Object.keys(e).length)return!0;for(let i=0;inull!=e?e:null,jt=({ref:e})=>null!=e?_(e)?e:[yt,e]:null,Vt=function(e,t=null,n=null,r=0,s=null,o=!1){e&&e!==Ct||(e=Dt);if(Gt(e)){const i=Wt(e,t);return n&&Jt(i,n),i}b(e)&&"__vccOpts"in e&&(e=e.__vccOpts);if(t){(He(t)||"__vInternal"in t)&&(t=g({},t));let{class:e,style:n}=t;e&&!w(e)&&(t.class=a(e)),S(n)&&(He(n)&&!_(n)&&(n=g({},n)),t.style=i(n))}const l=w(e)?1:(e=>e.__isSuspense)(e)?128:(e=>e.__isTeleport)(e)?64:S(e)?4:b(e)?2:0,c={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Ht(t),ref:t&&jt(t),scopeId:null,children:null,component:null,suspense:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:l,patchFlag:r,dynamicProps:s,dynamicChildren:null,appContext:null};Jt(c,n),!o&&zt&&(r>0||6&l)&&32!==r&&zt.push(c);return c};function Wt(e,t){const{props:n,patchFlag:r}=e,s=t?n?function(...e){const t=g({},e[0]);for(let n=1;ng(i,e(t))))),n||r?(_(n)?n.forEach(e=>i[e]=null):g(i,n),t.__emits=i):t.__emits=void 0}(e)))&&(t=t.replace(/Once$/,""),x(n,t[2].toLowerCase()+t.slice(3))||x(n,t.slice(2)))}function $t(e,t,n,i=!1){const r={},s={};B(s,"__vInternal",1),en(e,t,r,s),n?e.props=i?r:Fe(r,!1,de,Ne):e.type.props?e.props=r:e.props=s,e.attrs=s}function en(e,t,n,i){const[r,s]=nn(e.type);if(t)for(const s in t){const o=t[s];if(L(s))continue;let a;r&&x(r,a=N(s))?n[a]=o:Qt(e.type,s)||(i[s]=o)}if(s){const e=je(n);for(let t=0;t{const[t,r]=nn(e);g(n,t),r&&i.push(...r)};e.extends&&(r=!0,t(e.extends)),e.mixins&&(r=!0,e.mixins.forEach(t))}if(!t&&!r)return e.__props=h;if(_(t))for(let e=0;e-1,o[1]=t<0||e-1||x(o,"default"))&&i.push(r)}}}const s=[n,i];return e.__props=s,s}function rn(e){const t=e&&e.toString().match(/^\s*function (\w+)/);return t?t[1]:""}function sn(e,t){return rn(e)===rn(t)}function on(e,t){if(_(t)){for(let n=0,i=t.length;n{if(n.isUnmounted)return;J(),ti(n);const r=Ze(t,n,e,i);return ti(null),K(),r});return i?r.unshift(s):r.push(s),s}}const cn=e=>(t,n=ei)=>!ni&&ln(e,t,n),hn=cn("bm"),un=cn("m"),dn=cn("bu"),pn=cn("u"),fn=cn("bum"),mn=cn("um"),gn=cn("rtg"),vn=cn("rtc"),yn=e=>e.type.__isKeepAlive;function xn(e,t,n=ei){const i=e.__wdc||(e.__wdc=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}e()});if(ln(t,i,n),n){let e=n.parent;for(;e&&e.parent;)yn(e.parent.vnode)&&_n(i,t,n,e),e=e.parent}}function _n(e,t,n,i){const r=ln(t,e,i,!0);mn(()=>{v(i[t],r)},n)}const bn=e=>"_"===e[0]||"$stable"===e,wn=e=>_(e)?e.map(Yt):[Yt(e)],Mn=(e,t,n)=>Et(e=>wn(t(e)),n),Sn=(e,t)=>{const n=e._ctx;for(const i in e){if(bn(i))continue;const r=e[i];if(b(r))t[i]=Mn(0,r,n);else if(null!=r){const e=wn(r);t[i]=()=>e}}},Tn=(e,t)=>{const n=wn(t);e.slots.default=()=>n};function En(e,t,n,i){const r=e.dirs,s=t&&t.dirs;for(let o=0;o(s.has(e)||(e&&b(e.install)?(s.add(e),e.install(a,...t)):b(e)&&(s.add(e),e(a,...t))),a),mixin:e=>(r.mixins.includes(e)||r.mixins.push(e),a),component:(e,t)=>t?(r.components[e]=t,a):r.components[e],directive:(e,t)=>t?(r.directives[e]=t,a):r.directives[e],mount(s,l){if(!o){const c=Vt(n,i);return c.appContext=r,l&&t?t(c,s):e(c,s),o=!0,a._container=s,s.__vue_app__=a,c.component.proxy}},unmount(){o&&e(null,a._container)},provide:(e,t)=>(r.provides[e]=t,a)};return a}}const Ln={scheduler:ut},Rn=function(e,t){t&&!t.isResolved?_(e)?t.effects.push(...e):t.effects.push(e):pt(e,st,rt,ot)},Pn=(e,t,n,i,r)=>{let s;s=r?4&r.shapeFlag?r.component.proxy:r.el:null;const[o,a]=e,l=t&&t[1],h=o.refs===c?o.refs={}:o.refs,u=o.setupState;if(null!=l&&l!==a&&(w(l)?(h[l]=null,x(u,l)&&(u[l]=null)):Ve(l)&&(l.value=null)),w(a)){const e=()=>{h[a]=s,x(u,a)&&(u[a]=s)};s?(e.id=-1,Rn(e,i)):e()}else if(Ve(a)){const e=()=>{a.value=s};s?(e.id=-1,Rn(e,i)):e()}else b(a)&&Ye(a,n,12,[s,h])};function Nn(e){return function(e,t){const{insert:n,remove:i,patchProp:r,forcePatchProp:s,createElement:o,createText:a,createComment:l,setText:d,setElementText:p,parentNode:f,nextSibling:m,setScopeId:v=u,cloneNode:y,insertStaticContent:_}=e,b=(e,t,n,i=null,r=null,s=null,o=!1,a=!1)=>{e&&!kt(e,t)&&(i=ie(e),Z(e,r,s,!0),e=null),-2===t.patchFlag&&(a=!1,t.dynamicChildren=null);const{type:l,ref:c,shapeFlag:h}=t;switch(l){case Nt:w(e,t,n,i);break;case Dt:M(e,t,n,i);break;case It:null==e&&S(t,n,i,o);break;case Pt:O(e,t,n,i,r,s,o,a);break;default:1&h?E(e,t,n,i,r,s,o,a):6&h?z(e,t,n,i,r,s,o,a):(64&h||128&h)&&l.process(e,t,n,i,r,s,o,a,se)}null!=c&&r&&Pn(c,e&&e.ref,r,s,t)},w=(e,t,i,r)=>{if(null==e)n(t.el=a(t.children),i,r);else{const n=t.el=e.el;t.children!==e.children&&d(n,t.children)}},M=(e,t,i,r)=>{null==e?n(t.el=l(t.children||""),i,r):t.el=e.el},S=(e,t,n,i)=>{[e.el,e.anchor]=_(e.children,t,n,i)},E=(e,t,n,i,r,s,o,a)=>{o=o||"svg"===t.type,null==e?A(t,n,i,r,s,o,a):R(e,t,r,s,o,a)},A=(e,t,i,s,a,l,c)=>{let h,u;const{type:d,props:f,shapeFlag:m,transition:g,scopeId:x,patchFlag:_,dirs:b}=e;if(e.el&&void 0!==y&&-1===_)h=e.el=y(e.el);else{if(h=e.el=o(e.type,l,f&&f.is),8&m?p(h,e.children):16&m&&C(e.children,h,null,s,a,l&&"foreignObject"!==d,c||!!e.dynamicChildren),b&&En(e,null,s,"created"),f){for(const t in f)L(t)||r(h,t,null,f[t],l,e.children,s,a,ne);(u=f.onVnodeBeforeMount)&&Dn(u,s,e)}x&&v(h,x);const t=s&&s.type.__scopeId;t&&t!==x&&v(h,t+"-s")}b&&En(e,null,s,"beforeMount");const w=(!a||a&&a.isResolved)&&g&&!g.persisted;w&&g.beforeEnter(h),n(h,t,i),((u=f&&f.onVnodeMounted)||w||b)&&Rn(()=>{u&&Dn(u,s,e),w&&g.enter(h),b&&En(e,null,s,"mounted")},a)},C=(e,t,n,i,r,s,o,a=0)=>{for(let l=a;l{const l=t.el=e.el;let{patchFlag:h,dynamicChildren:u,dirs:d}=t;h|=16&e.patchFlag;const f=e.props||c,m=t.props||c;let g;if((g=m.onVnodeBeforeUpdate)&&Dn(g,n,t,e),d&&En(t,e,n,"beforeUpdate"),h>0){if(16&h)D(l,t,f,m,n,i,o);else if(2&h&&f.class!==m.class&&r(l,"class",null,m.class,o),4&h&&r(l,"style",f.style,m.style,o),8&h){const a=t.dynamicProps;for(let t=0;t{g&&Dn(g,n,t,e),d&&En(t,e,n,"updated")},i)},P=(e,t,n,i,r,s)=>{for(let o=0;o{if(n!==i){for(const c in i){if(L(c))continue;const h=i[c],u=n[c];(h!==u||s&&s(e,c))&&r(e,c,u,h,l,t.children,o,a,ne)}if(n!==c)for(const s in n)L(s)||s in i||r(e,s,n[s],null,l,t.children,o,a,ne)}},O=(e,t,i,r,s,o,l,c)=>{const h=t.el=e?e.el:a(""),u=t.anchor=e?e.anchor:a("");let{patchFlag:d,dynamicChildren:p}=t;d>0&&(c=!0),null==e?(n(h,i,r),n(u,i,r),C(t.children,i,u,s,o,l,c)):d>0&&64&d&&p?P(e.dynamicChildren,p,i,s,o,l):j(e,t,i,u,s,o,l,c)},z=(e,t,n,i,r,s,o,a)=>{null==e?512&t.shapeFlag?r.ctx.activate(t,n,i,o,a):F(t,n,i,r,s,o,a):G(e,t,a)},F=(e,t,n,i,r,s,o)=>{const a=e.component=function(e,t,n){const i=e.type,r=(t?t.appContext:e.appContext)||Qn,s={uid:$n++,vnode:e,type:i,parent:t,appContext:r,root:null,next:null,subTree:null,update:null,render:null,proxy:null,withProxy:null,effects:null,provides:t?t.provides:Object.create(r.provides),accessCache:null,renderCache:[],ctx:c,data:c,props:c,attrs:c,slots:c,refs:c,setupState:c,setupContext:null,suspense:n,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,emit:null,emitted:null};return s.ctx={_:s},s.root=t?t.root:s,s.emit=Kt.bind(null,s),s}(e,i,r);if(yn(e)&&(a.ctx.renderer=se),function(e,t=!1){ni=t;const{props:n,children:i,shapeFlag:r}=e.vnode,s=4&r;$t(e,n,s,t),((e,t)=>{if(32&e.vnode.shapeFlag){const n=t._;n?(e.slots=t,B(t,"_",n)):Sn(t,e.slots={})}else e.slots={},t&&Tn(e,t);B(e.slots,"__vInternal",1)})(e,i);const o=s?function(e,t){const n=e.type;e.accessCache={},e.proxy=new Proxy(e.ctx,Jn);const{setup:i}=n;if(i){const n=e.setupContext=i.length>1?function(e){return{attrs:e.attrs,slots:e.slots,emit:e.emit}}(e):null;ei=e,J();const r=Ye(i,e,0,[e.props,n]);if(K(),ei=null,T(r)){if(t)return r.then(t=>{ii(e,t)});e.asyncDep=r}else ii(e,r)}else ri(e)}(e,t):void 0;ni=!1}(a),a.asyncDep){if(!r)return;if(r.registerDep(a,k),!e.el){const e=a.subTree=Vt(Dt);M(null,e,t,n)}}else k(a,e,t,n,r,s,o)},G=(e,t,n)=>{const i=t.component=e.component;if(function(e,t,n){const{props:i,children:r}=e,{props:s,children:o,patchFlag:a}=t;if(t.dirs||t.transition)return!0;if(!(n&&a>0))return!(!r&&!o||o&&o.$stable)||i!==s&&(i?!s||Mt(i,s):!!s);if(1024&a)return!0;if(16&a)return i?Mt(i,s):!!s;if(8&a){const e=t.dynamicProps;for(let t=0;t-1&&($e[t]=null)}(i.update),i.update()}else t.component=e.component,t.el=e.el,i.vnode=t},k=(e,t,n,i,r,s,o)=>{e.update=V((function(){if(e.isMounted){let t,{next:n,bu:i,u:a,parent:l,vnode:h}=e,u=n;n?H(e,n,o):n=h,n.el=h.el,i&&U(i),(t=n.props&&n.props.onVnodeBeforeUpdate)&&Dn(t,l,n,h);const d=_t(e),p=e.subTree;e.subTree=d,e.refs!==c&&(e.refs={}),b(p,d,f(p.el),ie(p),e,r,s),n.el=d.el,null===u&&function({vnode:e,parent:t},n){for(;t&&t.subTree===e;)(e=t.vnode).el=n,t=t.parent}(e,d.el),a&&Rn(a,r),(t=n.props&&n.props.onVnodeUpdated)&&Rn(()=>{Dn(t,l,n,h)},r)}else{let o;const{el:a,props:l}=t,{bm:c,m:h,parent:u}=e;c&&U(c),(o=l&&l.onVnodeBeforeMount)&&Dn(o,u,t);const d=e.subTree=_t(e);a&&ae?ae(t.el,d,e,r):(b(null,d,n,i,e,r,s),t.el=d.el),h&&Rn(h,r),(o=l&&l.onVnodeMounted)&&Rn(()=>{Dn(o,u,t)},r);const{a:p}=e;p&&256&t.shapeFlag&&Rn(p,r),e.isMounted=!0}}),Ln),e.update.allowRecurse=!0},H=(e,t,n)=>{t.component=e;const i=e.vnode.props;e.vnode=t,e.next=null,function(e,t,n,i){const{props:r,attrs:s,vnode:{patchFlag:o}}=e,a=je(r),[l]=nn(e.type);if(!(i||o>0)||16&o){let i;en(e,t,r,s);for(const e in a)t&&(x(t,e)||(i=I(e))!==e&&x(t,i))||(l?!n||void 0===n[e]&&void 0===n[i]||(r[e]=tn(l,t||c,e,void 0)):delete r[e]);if(s!==a)for(const e in s)t&&x(t,e)||delete s[e]}else if(8&o){const n=e.vnode.dynamicProps;for(let e=0;e{const{vnode:n,slots:i}=e;let r=!0,s=c;if(32&n.shapeFlag){const e=t._;e?1===e?r=!1:g(i,t):(r=!t.$stable,Sn(t,i)),s=t}else t&&(Tn(e,t),s={default:1});if(r)for(const e in i)bn(e)||e in s||delete i[e]})(e,t.children),ft(void 0,e.update)},j=(e,t,n,i,r,s,o,a=!1)=>{const l=e&&e.children,c=e?e.shapeFlag:0,h=t.children,{patchFlag:u,shapeFlag:d}=t;if(u>0){if(128&u)return void q(l,h,n,i,r,s,o,a);if(256&u)return void X(l,h,n,i,r,s,o,a)}8&d?(16&c&&ne(l,r,s),h!==l&&p(n,h)):16&c?16&d?q(l,h,n,i,r,s,o,a):ne(l,r,s,!0):(8&c&&p(n,""),16&d&&C(h,n,i,r,s,o,a))},X=(e,t,n,i,r,s,o,a)=>{t=t||h;const l=(e=e||h).length,c=t.length,u=Math.min(l,c);let d;for(d=0;dc?ne(e,r,s,!0,u):C(t,n,i,r,s,o,a,u)},q=(e,t,n,i,r,s,o,a)=>{let l=0;const c=t.length;let u=e.length-1,d=c-1;for(;l<=u&&l<=d;){const i=e[l],c=t[l]=a?Zt(t[l]):Yt(t[l]);if(!kt(i,c))break;b(i,c,n,null,r,s,o,a),l++}for(;l<=u&&l<=d;){const i=e[u],l=t[d]=a?Zt(t[d]):Yt(t[d]);if(!kt(i,l))break;b(i,l,n,null,r,s,o,a),u--,d--}if(l>u){if(l<=d){const e=d+1,h=ed)for(;l<=u;)Z(e[l],r,s,!0),l++;else{const p=l,f=l,m=new Map;for(l=f;l<=d;l++){const e=t[l]=a?Zt(t[l]):Yt(t[l]);null!=e.key&&m.set(e.key,l)}let g,v=0;const y=d-f+1;let x=!1,_=0;const w=new Array(y);for(l=0;l=y){Z(i,r,s,!0);continue}let c;if(null!=i.key)c=m.get(i.key);else for(g=f;g<=d;g++)if(0===w[g-f]&&kt(i,t[g])){c=g;break}void 0===c?Z(i,r,s,!0):(w[c-f]=l+1,c>=_?_=c:x=!0,b(i,t[c],n,null,r,s,o,a),v++)}const M=x?function(e){const t=e.slice(),n=[0];let i,r,s,o,a;const l=e.length;for(i=0;i0&&(t[i]=n[s-1]),n[s]=i)}}s=n.length,o=n[s-1];for(;s-- >0;)n[s]=o,o=t[o];return n}(w):h;for(g=M.length-1,l=y-1;l>=0;l--){const e=f+l,a=t[e],h=e+1{const{el:o,type:a,transition:l,children:c,shapeFlag:h}=e;if(6&h)return void Y(e.component.subTree,t,i,r);if(128&h)return void e.suspense.move(t,i,r);if(64&h)return void a.move(e,t,i,se);if(a===Pt){n(o,t,i);for(let e=0;el.enter(o),s);else{const{leave:e,delayLeave:r,afterLeave:s}=l,a=()=>n(o,t,i),c=()=>{e(o,()=>{a(),s&&s()})};r?r(o,a,c):c()}else n(o,t,i)},Z=(e,t,n,i=!1)=>{const{type:r,props:s,ref:o,children:a,dynamicChildren:l,shapeFlag:c,patchFlag:h,dirs:u}=e;if(null!=o&&t&&Pn(o,null,t,n,null),256&c)return void t.ctx.deactivate(e);const d=1&c&&u;let p;if((p=s&&s.onVnodeBeforeUnmount)&&Dn(p,t,e),6&c)te(e.component,n,i);else{if(128&c)return void e.suspense.unmount(n,i);d&&En(e,null,t,"beforeUnmount"),l&&(r!==Pt||h>0&&64&h)?ne(l,t,n):16&c&&ne(a,t,n),64&c&&e.type.remove(e,se),i&&Q(e)}((p=s&&s.onVnodeUnmounted)||d)&&Rn(()=>{p&&Dn(p,t,e),d&&En(e,null,t,"unmounted")},n)},Q=e=>{const{type:t,el:n,anchor:r,transition:s}=e;if(t===Pt)return void ee(n,r);const o=()=>{i(n),s&&!s.persisted&&s.afterLeave&&s.afterLeave()};if(1&e.shapeFlag&&s&&!s.persisted){const{leave:t,delayLeave:i}=s,r=()=>t(n,o);i?i(e.el,o,r):r()}else o()},ee=(e,t)=>{let n;for(;e!==t;)n=m(e),i(e),e=n;i(t)},te=(e,t,n)=>{const{bum:i,effects:r,update:s,subTree:o,um:a,da:l,isDeactivated:c}=e;if(i&&U(i),r)for(let e=0;e{e.isUnmounted=!0},t),!t||t.isResolved||t.isUnmounted||!e.asyncDep||e.asyncResolved||(t.deps--,0===t.deps&&t.resolve())},ne=(e,t,n,i=!1,r=0)=>{for(let s=r;s6&e.shapeFlag?ie(e.component.subTree):128&e.shapeFlag?e.suspense.next():m(e.anchor||e.el),re=(e,t)=>{null==e?t._vnode&&Z(t._vnode,null,null,!0):b(t._vnode||null,e,t),mt(),t._vnode=e},se={p:b,um:Z,m:Y,r:Q,mt:F,mc:C,pc:j,pbc:P,n:ie,o:e};let oe,ae;t&&([oe,ae]=t(se));return{render:re,hydrate:oe,createApp:Cn(re,oe)}}(e)}function Dn(e,t,n,i=null){Ze(e,t,7,[n,i])}const In={};function On(e,t,n){return zn(e,t,n)}function zn(e,t,{immediate:n,deep:i,flush:r,onTrack:s,onTrigger:o}=c,a=ei){let l;const h=Ve(e);if(h?l=()=>e.value:Ge(e)?(l=()=>e,i=!0):l=_(e)?()=>e.map(e=>Ve(e)?e.value:Ge(e)?Bn(e):b(e)?Ye(e,a,2):void 0):b(e)?t?()=>Ye(e,a,2):()=>{if(!a||!a.isUnmounted)return d&&d(),Ye(e,a,3,[p])}:u,t&&i){const e=l;l=()=>Bn(e())}let d;const p=e=>{d=y.options.onStop=()=>{Ye(e,a,4)}};let f=_(e)?[]:In;const m=()=>{if(y.active)if(t){const e=y();(i||h||z(e,f))&&(d&&d(),Ze(t,a,3,[e,f===In?void 0:f,p]),f=e)}else y()};let g;m.allowRecurse=!!t,"sync"===r?g=m:"pre"===r?(m.id=-1,g=()=>{!a||a.isMounted?function(e){pt(e,nt,tt,it)}(m):m()}):g=()=>Rn(m,a&&a.suspense);const y=V(l,{lazy:!0,onTrack:s,onTrigger:o,scheduler:g});return si(y),t?n?m():f=y():y(),()=>{W(y),a&&v(a.effects,y)}}function Un(e,t,n){const i=this.proxy;return zn(w(e)?()=>i[e]:e.bind(i),t.bind(i),n,this)}function Bn(e,t=new Set){if(!S(e)||t.has(e))return e;if(t.add(e),Ve(e))Bn(e.value,t);else if(_(e))for(let n=0;n{Bn(e.get(i),t)});else if(e instanceof Set)e.forEach(e=>{Bn(e,t)});else for(const n in e)Bn(e[n],t);return e}function Fn(e,t){if(ei){let n=ei.provides;const i=ei.parent&&ei.parent.provides;i===n&&(n=ei.provides=Object.create(i)),n[e]=t}else;}function Gn(e,t){const n=ei||yt;if(n){const i=n.provides;if(e in i)return i[e];if(arguments.length>1)return t}}let kn=!1;function Hn(e,t,n=[],i=[],r=!1){const{mixins:s,extends:o,data:a,computed:l,methods:c,watch:h,provide:d,inject:p,beforeMount:f,mounted:m,beforeUpdate:g,updated:v,activated:y,deactivated:x,beforeUnmount:w,unmounted:M,render:T,renderTracked:E,renderTriggered:A,errorCaptured:C}=t,L=e.proxy,R=e.ctx,P=e.appContext.mixins;if(r&&T&&e.render===u&&(e.render=T),r||(kn=!0,jn("beforeCreate",t,L,P),kn=!1,Wn(e,P,n,i)),o&&Hn(e,o,n,i,!0),s&&Wn(e,s,n,i),p)if(_(p))for(let e=0;eXn(e,t,L)),a&&Xn(e,a,L)),l)for(const e in l){const t=l[e],n=oi({get:b(t)?t.bind(L,L):b(t.get)?t.get.bind(L,L):u,set:!b(t)&&b(t.set)?t.set.bind(L):u});Object.defineProperty(R,e,{enumerable:!0,configurable:!0,get:()=>n.value,set:e=>n.value=e})}if(h&&i.push(h),!r&&i.length&&i.forEach(e=>{for(const t in e)qn(e[t],R,L,t)}),d){const e=b(d)?d.call(L):d;for(const t in e)Fn(t,e[t])}var N;r||jn("created",t,L,P),f&&hn(f.bind(L)),m&&un(m.bind(L)),g&&dn(g.bind(L)),v&&pn(v.bind(L)),y&&xn(y.bind(L),"a",N),x&&function(e,t){xn(e,"da",t)}(x.bind(L)),C&&((e,t=ei)=>{ln("ec",e,t)})(C.bind(L)),E&&vn(E.bind(L)),A&&gn(A.bind(L)),w&&fn(w.bind(L)),M&&mn(M.bind(L))}function jn(e,t,n,i){Vn(e,i,n);const r=t.extends&&t.extends[e];r&&r.call(n);const s=t.mixins;s&&Vn(e,s,n);const o=t[e];o&&o.call(n)}function Vn(e,t,n){for(let i=0;in[i];if(w(e)){const n=t[e];b(n)&&On(r,n)}else if(b(e))On(r,e.bind(n));else if(S(e))if(_(e))e.forEach(e=>qn(e,t,n,i));else{const i=b(e.handler)?e.handler.bind(n):t[e.handler];b(i)&&On(r,i,e)}}function Yn(e,t,n){const i=n.appContext.config.optionMergeStrategies;for(const r in t)i&&x(i,r)?e[r]=i[r](e[r],t[r],n.proxy,r):x(e,r)||(e[r]=t[r])}const Zn=g(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>e.parent&&e.parent.proxy,$root:e=>e.root&&e.root.proxy,$emit:e=>e.emit,$options:e=>function(e){const t=e.type,{__merged:n,mixins:i,extends:r}=t;if(n)return n;const s=e.appContext.mixins;if(!s.length&&!i&&!r)return t;const o={};return s.forEach(t=>Yn(o,t,e)),r&&Yn(o,r,e),i&&i.forEach(t=>Yn(o,t,e)),Yn(o,t,e),t.__merged=o}(e),$forceUpdate:e=>()=>ut(e.update),$nextTick:()=>ht,$watch:e=>Un.bind(e)}),Jn={get({_:e},t){const{ctx:n,setupState:i,data:r,props:s,accessCache:o,type:a,appContext:l}=e;if("__v_skip"===t)return!0;let h;if("$"!==t[0]){const e=o[t];if(void 0!==e)switch(e){case 0:return i[t];case 1:return r[t];case 3:return n[t];case 2:return s[t]}else{if(i!==c&&x(i,t))return o[t]=0,i[t];if(r!==c&&x(r,t))return o[t]=1,r[t];if((h=nn(a)[0])&&x(h,t))return o[t]=2,s[t];if(n!==c&&x(n,t))return o[t]=3,n[t];kn||(o[t]=4)}}const u=Zn[t];let d,p;return u?("$attrs"===t&&Q(e,0,t),u(e)):(d=a.__cssModules)&&(d=d[t])?d:n!==c&&x(n,t)?(o[t]=3,n[t]):(p=l.config.globalProperties,x(p,t)?p[t]:void 0)},set({_:e},t,n){const{data:i,setupState:r,ctx:s}=e;if(r!==c&&x(r,t))r[t]=n;else if(i!==c&&x(i,t))i[t]=n;else if(t in e.props)return!1;return("$"!==t[0]||!(t.slice(1)in e))&&(s[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:i,type:r,appContext:s}},o){let a;return void 0!==n[o]||e!==c&&x(e,o)||t!==c&&x(t,o)||(a=nn(r)[0])&&x(a,o)||x(i,o)||x(Zn,o)||x(s.config.globalProperties,o)}},Kn=g({},Jn,{get(e,t){if(t!==Symbol.unscopables)return Jn.get(e,t,e)},has:(e,n)=>"_"!==n[0]&&!t(n)}),Qn=An();let $n=0;let ei=null;const ti=e=>{ei=e};let ni=!1;function ii(e,t,n){var i;b(t)?e.render=t:S(t)&&(e.setupState=Ge(i=t)?i:new Proxy(i,We)),ri(e)}function ri(e,t){const n=e.type;e.render||(e.render=n.render||u,e.render._rc&&(e.withProxy=new Proxy(e.ctx,Kn))),ei=e,Hn(e,n),ei=null}function si(e){ei&&(ei.effects||(ei.effects=[])).push(e)}function oi(e){const t=function(e){let t,n;return b(e)?(t=e,n=u):(t=e.get,n=e.set),new qe(t,n,b(e)||!e.set)}(e);return si(t.effect),t}function ai(e,t){let n;if(_(e)||w(e)){n=new Array(e.length);for(let i=0,r=e.length;i{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n)=>t?hi.createElementNS(ci,e):hi.createElement(e,n?{is:n}:void 0),createText:e=>hi.createTextNode(e),createComment:e=>hi.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>hi.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},cloneNode:e=>e.cloneNode(!0),insertStaticContent(e,t,n,i){const r=i?di||(di=hi.createElementNS(ci,"svg")):ui||(ui=hi.createElement("div"));r.innerHTML=e;const s=r.firstChild;let o=s,a=o;for(;o;)a=o,pi.insert(o,t,n),o=r.firstChild;return[s,a]}};const fi=/\s*!important$/;function mi(e,t,n){if(_(n))n.forEach(n=>mi(e,t,n));else if(t.startsWith("--"))e.setProperty(t,n);else{const i=function(e,t){const n=vi[t];if(n)return n;let i=N(t);if("filter"!==i&&i in e)return vi[t]=i;i=O(i);for(let n=0;ndocument.createEvent("Event").timeStamp&&(xi=()=>performance.now());let _i=0;const bi=Promise.resolve(),wi=()=>{_i=0};function Mi(e,t,n,i,r=null){const s=e._vei||(e._vei={}),o=s[t];if(i&&o)o.value=i;else{const[n,a]=function(e){let t;if(Si.test(e)){let n;for(t={};n=e.match(Si);)e=e.slice(0,e.length-n[0].length),t[n[0].toLowerCase()]=!0}return[e.slice(2).toLowerCase(),t]}(t);if(i){!function(e,t,n,i){e.addEventListener(t,n,i)}(e,n,s[t]=function(e,t){const n=e=>{(e.timeStamp||xi())>=n.attached-1&&Ze(function(e,t){if(_(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(e=>t=>!t._stopped&&e(t))}return t}(e,n.value),t,5,[e])};return n.value=e,n.attached=(()=>_i||(bi.then(wi),_i=xi()))(),n}(i,r),a)}else o&&(!function(e,t,n,i){e.removeEventListener(t,n,i)}(e,n,o,a),s[t]=void 0)}}const Si=/(?:Once|Passive|Capture)$/;const Ti=/^on[a-z]/;const Ei=g({patchProp:(e,t,i,r,s=!1,o,a,l,c)=>{switch(t){case"class":!function(e,t,n){if(null==t&&(t=""),n)e.setAttribute("class",t);else{const n=e._vtc;n&&(t=(t?[t,...n]:[...n]).join(" ")),e.className=t}}(e,r,s);break;case"style":!function(e,t,n){const i=e.style;if(n)if(w(n))t!==n&&(i.cssText=n);else{for(const e in n)mi(i,e,n[e]);if(t&&!w(t))for(const e in t)null==n[e]&&mi(i,e,"")}else e.removeAttribute("style")}(e,i,r);break;default:f(t)?m(t)||Mi(e,t,0,r,a):function(e,t,n,i){if(i)return"innerHTML"===t||!!(t in e&&Ti.test(t)&&b(n));if("spellcheck"===t||"draggable"===t)return!1;if("form"===t&&"string"==typeof n)return!1;if("list"===t&&"INPUT"===e.tagName)return!1;if(Ti.test(t)&&w(n))return!1;return t in e}(e,t,r,s)?function(e,t,n,i,r,s,o){if("innerHTML"===t||"textContent"===t)return i&&o(i,r,s),void(e[t]=null==n?"":n);if("value"!==t||"PROGRESS"===e.tagName)if(""===n&&"boolean"==typeof e[t])e[t]=!0;else if(null==n&&"string"==typeof e[t])e[t]="",e.removeAttribute(t);else try{e[t]=n}catch(e){}else{e._value=n;const t=null==n?"":n;e.value!==t&&(e.value=t)}}(e,t,r,o,a,l,c):("true-value"===t?e._trueValue=r:"false-value"===t&&(e._falseValue=r),function(e,t,i,r){if(r&&t.startsWith("xlink:"))null==i?e.removeAttributeNS(yi,t.slice(6,t.length)):e.setAttributeNS(yi,t,i);else{const r=n(t);null==i||r&&!1===i?e.removeAttribute(t):e.setAttribute(t,r?"":i)}}(e,t,r,s))}},forcePatchProp:(e,t)=>"value"===t},pi);let Ai;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");const t=Object(e);for(let e=1;e>8&255]+zi[e>>16&255]+zi[e>>24&255]+"-"+zi[255&t]+zi[t>>8&255]+"-"+zi[t>>16&15|64]+zi[t>>24&255]+"-"+zi[63&n|128]+zi[n>>8&255]+"-"+zi[n>>16&255]+zi[n>>24&255]+zi[255&i]+zi[i>>8&255]+zi[i>>16&255]+zi[i>>24&255]).toUpperCase()},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,i,r){return i+(e-t)*(r-i)/(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())},seededRandom:function(e){return void 0!==e&&(Ui=e%2147483647),Ui=16807*Ui%2147483647,(Ui-1)/2147483646},degToRad:function(e){return e*Bi.DEG2RAD},radToDeg:function(e){return e*Bi.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))},setQuaternionFromProperEuler:function(e,t,n,i,r){const s=Math.cos,o=Math.sin,a=s(n/2),l=o(n/2),c=s((t+i)/2),h=o((t+i)/2),u=s((t-i)/2),d=o((t-i)/2),p=s((i-t)/2),f=o((i-t)/2);switch(r){case"XYX":e.set(a*h,l*u,l*d,a*c);break;case"YZY":e.set(l*d,a*h,l*u,a*c);break;case"ZXZ":e.set(l*u,l*d,a*h,a*c);break;case"XZX":e.set(a*h,l*f,l*p,a*c);break;case"YXY":e.set(l*p,a*h,l*f,a*c);break;case"ZYZ":e.set(l*f,l*p,a*h,a*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}};class Fi{constructor(e=0,t=0){Object.defineProperty(this,"isVector2",{value:!0}),this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e,t){return 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(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e,t){return 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(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,n=this.y,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6],this.y=i[1]*t+i[4]*n+i[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this}toArray(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(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(e,t){const n=Math.cos(t),i=Math.sin(t),r=this.x-e.x,s=this.y-e.y;return this.x=r*n-s*i+e.x,this.y=r*i+s*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}}class Gi{constructor(){Object.defineProperty(this,"isMatrix3",{value:!0}),this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}set(e,t,n,i,r,s,o,a,l){const c=this.elements;return c[0]=e,c[1]=i,c[2]=o,c[3]=t,c[4]=r,c[5]=a,c[6]=n,c[7]=s,c[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}clone(){return(new this.constructor).fromArray(this.elements)}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,i=t.elements,r=this.elements,s=n[0],o=n[3],a=n[6],l=n[1],c=n[4],h=n[7],u=n[2],d=n[5],p=n[8],f=i[0],m=i[3],g=i[6],v=i[1],y=i[4],x=i[7],_=i[2],b=i[5],w=i[8];return r[0]=s*f+o*v+a*_,r[3]=s*m+o*y+a*b,r[6]=s*g+o*x+a*w,r[1]=l*f+c*v+h*_,r[4]=l*m+c*y+h*b,r[7]=l*g+c*x+h*w,r[2]=u*f+d*v+p*_,r[5]=u*m+d*y+p*b,r[8]=u*g+d*x+p*w,this}multiplyScalar(e){const 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(){const e=this.elements,t=e[0],n=e[1],i=e[2],r=e[3],s=e[4],o=e[5],a=e[6],l=e[7],c=e[8];return t*s*c-t*o*l-n*r*c+n*o*a+i*r*l-i*s*a}getInverse(e,t){void 0!==t&&console.warn("THREE.Matrix3: .getInverse() can no longer be configured to throw on degenerate.");const n=e.elements,i=this.elements,r=n[0],s=n[1],o=n[2],a=n[3],l=n[4],c=n[5],h=n[6],u=n[7],d=n[8],p=d*l-c*u,f=c*h-d*a,m=u*a-l*h,g=r*p+s*f+o*m;if(0===g)return this.set(0,0,0,0,0,0,0,0,0);const v=1/g;return i[0]=p*v,i[1]=(o*u-d*s)*v,i[2]=(c*s-o*l)*v,i[3]=f*v,i[4]=(d*r-o*h)*v,i[5]=(o*a-c*r)*v,i[6]=m*v,i[7]=(s*h-u*r)*v,i[8]=(l*r-s*a)*v,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).getInverse(this).transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,i,r,s,o){const a=Math.cos(r),l=Math.sin(r);this.set(n*a,n*l,-n*(a*s+l*o)+s+e,-i*l,i*a,-i*(-l*s+a*o)+o+t,0,0,1)}scale(e,t){const n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=t,n[4]*=t,n[7]*=t,this}rotate(e){const t=Math.cos(e),n=Math.sin(e),i=this.elements,r=i[0],s=i[3],o=i[6],a=i[1],l=i[4],c=i[7];return i[0]=t*r+n*a,i[3]=t*s+n*l,i[6]=t*o+n*c,i[1]=-n*r+t*a,i[4]=-n*s+t*l,i[7]=-n*o+t*c,this}translate(e,t){const n=this.elements;return n[0]+=e*n[2],n[3]+=e*n[5],n[6]+=e*n[8],n[1]+=t*n[2],n[4]+=t*n[5],n[7]+=t*n[8],this}equals(e){const t=this.elements,n=e.elements;for(let e=0;e<9;e++)if(t[e]!==n[e])return!1;return!0}fromArray(e,t){void 0===t&&(t=0);for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e,t){void 0===e&&(e=[]),void 0===t&&(t=0);const 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}}let ki;const Hi={getDataURL:function(e){if(/^data:/i.test(e.src))return e.src;if("undefined"==typeof HTMLCanvasElement)return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{void 0===ki&&(ki=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),ki.width=e.width,ki.height=e.height;const n=ki.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=ki}return t.width>2048||t.height>2048?t.toDataURL("image/jpeg",.6):t.toDataURL("image/png")}};let ji=0;function Vi(e,t,n,i,r,s,o,a,l,c){Object.defineProperty(this,"id",{value:ji++}),this.uuid=Bi.generateUUID(),this.name="",this.image=void 0!==e?e:Vi.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=void 0!==t?t:Vi.DEFAULT_MAPPING,this.wrapS=void 0!==n?n:1001,this.wrapT=void 0!==i?i:1001,this.magFilter=void 0!==r?r:1006,this.minFilter=void 0!==s?s:1008,this.anisotropy=void 0!==l?l:1,this.format=void 0!==o?o:1023,this.internalFormat=null,this.type=void 0!==a?a:1009,this.offset=new Fi(0,0),this.repeat=new Fi(1,1),this.center=new Fi(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Gi,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=void 0!==c?c:3e3,this.version=0,this.onUpdate=null}Vi.DEFAULT_IMAGE=void 0,Vi.DEFAULT_MAPPING=300,Vi.prototype=Object.assign(Object.create(Oi.prototype),{constructor:Vi,isTexture:!0,updateMatrix:function(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)},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.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.encoding=e.encoding,this},toJSON:function(e){const t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.textures[this.uuid])return e.textures[this.uuid];const n={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(void 0!==this.image){const i=this.image;if(void 0===i.uuid&&(i.uuid=Bi.generateUUID()),!t&&void 0===e.images[i.uuid]){let t;if(Array.isArray(i)){t=[];for(let e=0,n=i.length;e1)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)}return this.flipY&&(e.y=1-e.y),e}}),Object.defineProperty(Vi.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}});class Wi{constructor(e=0,t=0,n=0,i=1){Object.defineProperty(this,"isVector4",{value:!0}),this.x=e,this.y=t,this.z=n,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,i){return this.x=e,this.y=t,this.z=n,this.w=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this}add(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(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e,t){return 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(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,n=this.y,i=this.z,r=this.w,s=e.elements;return this.x=s[0]*t+s[4]*n+s[8]*i+s[12]*r,this.y=s[1]*t+s[5]*n+s[9]*i+s[13]*r,this.z=s[2]*t+s[6]*n+s[10]*i+s[14]*r,this.w=s[3]*t+s[7]*n+s[11]*i+s[15]*r,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,i,r;const s=e.elements,o=s[0],a=s[4],l=s[8],c=s[1],h=s[5],u=s[9],d=s[2],p=s[6],f=s[10];if(Math.abs(a-c)<.01&&Math.abs(l-d)<.01&&Math.abs(u-p)<.01){if(Math.abs(a+c)<.1&&Math.abs(l+d)<.1&&Math.abs(u+p)<.1&&Math.abs(o+h+f-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const e=(o+1)/2,s=(h+1)/2,m=(f+1)/2,g=(a+c)/4,v=(l+d)/4,y=(u+p)/4;return e>s&&e>m?e<.01?(n=0,i=.707106781,r=.707106781):(n=Math.sqrt(e),i=g/n,r=v/n):s>m?s<.01?(n=.707106781,i=0,r=.707106781):(i=Math.sqrt(s),n=g/i,r=y/i):m<.01?(n=.707106781,i=.707106781,r=0):(r=Math.sqrt(m),n=v/r,i=y/r),this.set(n,i,r,t),this}let m=Math.sqrt((p-u)*(p-u)+(l-d)*(l-d)+(c-a)*(c-a));return Math.abs(m)<.001&&(m=1),this.x=(p-u)/m,this.y=(l-d)/m,this.z=(c-a)/m,this.w=Math.acos((o+h+f-1)/2),this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){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(){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(){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(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(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(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(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}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}}function Xi(e,t,n){this.width=e,this.height=t,this.scissor=new Wi(0,0,e,t),this.scissorTest=!1,this.viewport=new Wi(0,0,e,t),n=n||{},this.texture=new Vi(void 0,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.encoding),this.texture.image={},this.texture.image.width=e,this.texture.image.height=t,this.texture.generateMipmaps=void 0!==n.generateMipmaps&&n.generateMipmaps,this.texture.minFilter=void 0!==n.minFilter?n.minFilter:1006,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 qi(e,t,n){Xi.call(this,e,t,n),this.samples=4}Xi.prototype=Object.assign(Object.create(Oi.prototype),{constructor:Xi,isWebGLRenderTarget:!0,setSize:function(e,t){this.width===e&&this.height===t||(this.width=e,this.height=t,this.texture.image.width=e,this.texture.image.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"})}}),qi.prototype=Object.assign(Object.create(Xi.prototype),{constructor:qi,isWebGLMultisampleRenderTarget:!0,copy:function(e){return Xi.prototype.copy.call(this,e),this.samples=e.samples,this}});class Yi{constructor(e=0,t=0,n=0,i=1){Object.defineProperty(this,"isQuaternion",{value:!0}),this._x=e,this._y=t,this._z=n,this._w=i}static slerp(e,t,n,i){return n.copy(e).slerp(t,i)}static slerpFlat(e,t,n,i,r,s,o){let a=n[i+0],l=n[i+1],c=n[i+2],h=n[i+3];const u=r[s+0],d=r[s+1],p=r[s+2],f=r[s+3];if(h!==f||a!==u||l!==d||c!==p){let e=1-o;const t=a*u+l*d+c*p+h*f,n=t>=0?1:-1,i=1-t*t;if(i>Number.EPSILON){const r=Math.sqrt(i),s=Math.atan2(r,t*n);e=Math.sin(e*s)/r,o=Math.sin(o*s)/r}const r=o*n;if(a=a*e+u*r,l=l*e+d*r,c=c*e+p*r,h=h*e+f*r,e===1-o){const e=1/Math.sqrt(a*a+l*l+c*c+h*h);a*=e,l*=e,c*=e,h*=e}}e[t]=a,e[t+1]=l,e[t+2]=c,e[t+3]=h}static multiplyQuaternionsFlat(e,t,n,i,r,s){const o=n[i],a=n[i+1],l=n[i+2],c=n[i+3],h=r[s],u=r[s+1],d=r[s+2],p=r[s+3];return e[t]=o*p+c*h+a*d-l*u,e[t+1]=a*p+c*u+l*h-o*d,e[t+2]=l*p+c*d+o*u-a*h,e[t+3]=c*p-o*h-a*u-l*d,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,i){return this._x=e,this._y=t,this._z=n,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t){if(!e||!e.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");const n=e._x,i=e._y,r=e._z,s=e._order,o=Math.cos,a=Math.sin,l=o(n/2),c=o(i/2),h=o(r/2),u=a(n/2),d=a(i/2),p=a(r/2);switch(s){case"XYZ":this._x=u*c*h+l*d*p,this._y=l*d*h-u*c*p,this._z=l*c*p+u*d*h,this._w=l*c*h-u*d*p;break;case"YXZ":this._x=u*c*h+l*d*p,this._y=l*d*h-u*c*p,this._z=l*c*p-u*d*h,this._w=l*c*h+u*d*p;break;case"ZXY":this._x=u*c*h-l*d*p,this._y=l*d*h+u*c*p,this._z=l*c*p+u*d*h,this._w=l*c*h-u*d*p;break;case"ZYX":this._x=u*c*h-l*d*p,this._y=l*d*h+u*c*p,this._z=l*c*p-u*d*h,this._w=l*c*h+u*d*p;break;case"YZX":this._x=u*c*h+l*d*p,this._y=l*d*h+u*c*p,this._z=l*c*p-u*d*h,this._w=l*c*h-u*d*p;break;case"XZY":this._x=u*c*h-l*d*p,this._y=l*d*h-u*c*p,this._z=l*c*p+u*d*h,this._w=l*c*h+u*d*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+s)}return!1!==t&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const n=t/2,i=Math.sin(n);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,n=t[0],i=t[4],r=t[8],s=t[1],o=t[5],a=t[9],l=t[2],c=t[6],h=t[10],u=n+o+h;if(u>0){const e=.5/Math.sqrt(u+1);this._w=.25/e,this._x=(c-a)*e,this._y=(r-l)*e,this._z=(s-i)*e}else if(n>o&&n>h){const e=2*Math.sqrt(1+n-o-h);this._w=(c-a)/e,this._x=.25*e,this._y=(i+s)/e,this._z=(r+l)/e}else if(o>h){const e=2*Math.sqrt(1+o-n-h);this._w=(r-l)/e,this._x=(i+s)/e,this._y=.25*e,this._z=(a+c)/e}else{const e=2*Math.sqrt(1+h-n-o);this._w=(s-i)/e,this._x=(r+l)/e,this._y=(a+c)/e,this._z=.25*e}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<1e-6?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Bi.clamp(this.dot(e),-1,1)))}rotateTowards(e,t){const n=this.angleTo(e);if(0===n)return this;const i=Math.min(1,t/n);return this.slerp(e,i),this}identity(){return this.set(0,0,0,1)}inverse(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return 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(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(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const n=e._x,i=e._y,r=e._z,s=e._w,o=t._x,a=t._y,l=t._z,c=t._w;return this._x=n*c+s*o+i*l-r*a,this._y=i*c+s*a+r*o-n*l,this._z=r*c+s*l+n*a-i*o,this._w=s*c-n*o-i*a-r*l,this._onChangeCallback(),this}slerp(e,t){if(0===t)return this;if(1===t)return this.copy(e);const n=this._x,i=this._y,r=this._z,s=this._w;let o=s*e._w+n*e._x+i*e._y+r*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=s,this._x=n,this._y=i,this._z=r,this;const a=1-o*o;if(a<=Number.EPSILON){const e=1-t;return this._w=e*s+t*this._w,this._x=e*n+t*this._x,this._y=e*i+t*this._y,this._z=e*r+t*this._z,this.normalize(),this._onChangeCallback(),this}const l=Math.sqrt(a),c=Math.atan2(l,o),h=Math.sin((1-t)*c)/l,u=Math.sin(t*c)/l;return this._w=s*h+this._w*u,this._x=n*h+this._x*u,this._y=i*h+this._y*u,this._z=r*h+this._z*u,this._onChangeCallback(),this}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(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(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(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}}class Zi{constructor(e=0,t=0,n=0){Object.defineProperty(this,"isVector3",{value:!0}),this.x=e,this.y=t,this.z=n}set(e,t,n){return void 0===n&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e,t){return 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(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e,t){return 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(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e,t){return 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(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return e&&e.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(Ki.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(Ki.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,n=this.y,i=this.z,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6]*i,this.y=r[1]*t+r[4]*n+r[7]*i,this.z=r[2]*t+r[5]*n+r[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,n=this.y,i=this.z,r=e.elements,s=1/(r[3]*t+r[7]*n+r[11]*i+r[15]);return this.x=(r[0]*t+r[4]*n+r[8]*i+r[12])*s,this.y=(r[1]*t+r[5]*n+r[9]*i+r[13])*s,this.z=(r[2]*t+r[6]*n+r[10]*i+r[14])*s,this}applyQuaternion(e){const t=this.x,n=this.y,i=this.z,r=e.x,s=e.y,o=e.z,a=e.w,l=a*t+s*i-o*n,c=a*n+o*t-r*i,h=a*i+r*n-s*t,u=-r*t-s*n-o*i;return this.x=l*a+u*-r+c*-o-h*-s,this.y=c*a+u*-s+h*-r-l*-o,this.z=h*a+u*-o+l*-s-c*-r,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,n=this.y,i=this.z,r=e.elements;return this.x=r[0]*t+r[4]*n+r[8]*i,this.y=r[1]*t+r[5]*n+r[9]*i,this.z=r[2]*t+r[6]*n+r[10]*i,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e,t){return 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(e,t){const n=e.x,i=e.y,r=e.z,s=t.x,o=t.y,a=t.z;return this.x=i*a-r*o,this.y=r*s-n*a,this.z=n*o-i*s,this}projectOnVector(e){const t=e.lengthSq();if(0===t)return this.set(0,0,0);const n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return Ji.copy(this).projectOnVector(e),this.sub(Ji)}reflect(e){return this.sub(Ji.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(Bi.clamp(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y,i=this.z-e.z;return t*t+n*n+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){const i=Math.sin(t)*e;return this.x=i*Math.sin(n),this.y=Math.cos(t)*e,this.z=i*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=i,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,4*t)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,3*t)}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(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(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}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}}const Ji=new Zi,Ki=new Yi;class Qi{constructor(e,t){Object.defineProperty(this,"isBox3",{value:!0}),this.min=void 0!==e?e:new Zi(1/0,1/0,1/0),this.max=void 0!==t?t:new Zi(-1/0,-1/0,-1/0)}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){let t=1/0,n=1/0,i=1/0,r=-1/0,s=-1/0,o=-1/0;for(let a=0,l=e.length;ar&&(r=l),c>s&&(s=c),h>o&&(o=h)}return this.min.set(t,n,i),this.max.set(r,s,o),this}setFromBufferAttribute(e){let t=1/0,n=1/0,i=1/0,r=-1/0,s=-1/0,o=-1/0;for(let a=0,l=e.count;ar&&(r=l),c>s&&(s=c),h>o&&(o=h)}return this.min.set(t,n,i),this.max.set(r,s,o),this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;tthis.max.x||e.ythis.max.y||e.zthis.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return void 0===t&&(console.warn("THREE.Box3: .getParameter() target is now required"),t=new Zi),t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)}intersectsSphere(e){return this.clampPoint(e.center,tr),tr.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(cr),hr.subVectors(this.max,cr),ir.subVectors(e.a,cr),rr.subVectors(e.b,cr),sr.subVectors(e.c,cr),or.subVectors(rr,ir),ar.subVectors(sr,rr),lr.subVectors(ir,sr);let t=[0,-or.z,or.y,0,-ar.z,ar.y,0,-lr.z,lr.y,or.z,0,-or.x,ar.z,0,-ar.x,lr.z,0,-lr.x,-or.y,or.x,0,-ar.y,ar.x,0,-lr.y,lr.x,0];return!!$i(t,ir,rr,sr,hr)&&(t=[1,0,0,0,1,0,0,0,1],!!$i(t,ir,rr,sr,hr)&&(ur.crossVectors(or,ar),t=[ur.x,ur.y,ur.z],$i(t,ir,rr,sr,hr)))}clampPoint(e,t){return void 0===t&&(console.warn("THREE.Box3: .clampPoint() target is now required"),t=new Zi),t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return tr.copy(e).clamp(this.min,this.max).sub(e).length()}getBoundingSphere(e){return void 0===e&&console.error("THREE.Box3: .getBoundingSphere() target is now required"),this.getCenter(e.center),e.radius=.5*this.getSize(tr).length(),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()||(er[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),er[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),er[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),er[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),er[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),er[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),er[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),er[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(er)),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}function $i(e,t,n,i,r){for(let s=0,o=e.length-3;s<=o;s+=3){dr.fromArray(e,s);const o=r.x*Math.abs(dr.x)+r.y*Math.abs(dr.y)+r.z*Math.abs(dr.z),a=t.dot(dr),l=n.dot(dr),c=i.dot(dr);if(Math.max(-Math.max(a,l,c),Math.min(a,l,c))>o)return!1}return!0}const er=[new Zi,new Zi,new Zi,new Zi,new Zi,new Zi,new Zi,new Zi],tr=new Zi,nr=new Qi,ir=new Zi,rr=new Zi,sr=new Zi,or=new Zi,ar=new Zi,lr=new Zi,cr=new Zi,hr=new Zi,ur=new Zi,dr=new Zi,pr=new Qi;class fr{constructor(e,t){this.center=void 0!==e?e:new Zi,this.radius=void 0!==t?t:-1}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const n=this.center;void 0!==t?n.copy(t):pr.setFromPoints(e).getCenter(n);let i=0;for(let t=0,r=e.length;tthis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return void 0===e&&(console.warn("THREE.Sphere: .getBoundingBox() target is now required"),e=new Qi),this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}}const mr=new Zi,gr=new Zi,vr=new Zi,yr=new Zi,xr=new Zi,_r=new Zi,br=new Zi;class wr{constructor(e,t){this.origin=void 0!==e?e:new Zi,this.direction=void 0!==t?t:new Zi(0,0,-1)}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}clone(){return(new this.constructor).copy(this)}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return void 0===t&&(console.warn("THREE.Ray: .at() target is now required"),t=new Zi),t.copy(this.direction).multiplyScalar(e).add(this.origin)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,mr)),this}closestPointToPoint(e,t){void 0===t&&(console.warn("THREE.Ray: .closestPointToPoint() target is now required"),t=new Zi),t.subVectors(e,this.origin);const n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.direction).multiplyScalar(n).add(this.origin)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=mr.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(mr.copy(this.direction).multiplyScalar(t).add(this.origin),mr.distanceToSquared(e))}distanceSqToSegment(e,t,n,i){gr.copy(e).add(t).multiplyScalar(.5),vr.copy(t).sub(e).normalize(),yr.copy(this.origin).sub(gr);const r=.5*e.distanceTo(t),s=-this.direction.dot(vr),o=yr.dot(this.direction),a=-yr.dot(vr),l=yr.lengthSq(),c=Math.abs(1-s*s);let h,u,d,p;if(c>0)if(h=s*a-o,u=s*o-a,p=r*c,h>=0)if(u>=-p)if(u<=p){const e=1/c;h*=e,u*=e,d=h*(h+s*u+2*o)+u*(s*h+u+2*a)+l}else u=r,h=Math.max(0,-(s*u+o)),d=-h*h+u*(u+2*a)+l;else u=-r,h=Math.max(0,-(s*u+o)),d=-h*h+u*(u+2*a)+l;else u<=-p?(h=Math.max(0,-(-s*r+o)),u=h>0?-r:Math.min(Math.max(-r,-a),r),d=-h*h+u*(u+2*a)+l):u<=p?(h=0,u=Math.min(Math.max(-r,-a),r),d=u*(u+2*a)+l):(h=Math.max(0,-(s*r+o)),u=h>0?r:Math.min(Math.max(-r,-a),r),d=-h*h+u*(u+2*a)+l);else u=s>0?-r:r,h=Math.max(0,-(s*u+o)),d=-h*h+u*(u+2*a)+l;return n&&n.copy(this.direction).multiplyScalar(h).add(this.origin),i&&i.copy(vr).multiplyScalar(u).add(gr),d}intersectSphere(e,t){mr.subVectors(e.center,this.origin);const n=mr.dot(this.direction),i=mr.dot(mr)-n*n,r=e.radius*e.radius;if(i>r)return null;const s=Math.sqrt(r-i),o=n-s,a=n+s;return o<0&&a<0?null:o<0?this.at(a,t):this.at(o,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?0:null;const n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){const n=this.distanceToPlane(e);return null===n?null:this.at(n,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);if(0===t)return!0;return e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,i,r,s,o,a;const l=1/this.direction.x,c=1/this.direction.y,h=1/this.direction.z,u=this.origin;return l>=0?(n=(e.min.x-u.x)*l,i=(e.max.x-u.x)*l):(n=(e.max.x-u.x)*l,i=(e.min.x-u.x)*l),c>=0?(r=(e.min.y-u.y)*c,s=(e.max.y-u.y)*c):(r=(e.max.y-u.y)*c,s=(e.min.y-u.y)*c),n>s||r>i?null:((r>n||n!=n)&&(n=r),(s=0?(o=(e.min.z-u.z)*h,a=(e.max.z-u.z)*h):(o=(e.max.z-u.z)*h,a=(e.min.z-u.z)*h),n>a||o>i?null:((o>n||n!=n)&&(n=o),(a=0?n:i,t)))}intersectsBox(e){return null!==this.intersectBox(e,mr)}intersectTriangle(e,t,n,i,r){xr.subVectors(t,e),_r.subVectors(n,e),br.crossVectors(xr,_r);let s,o=this.direction.dot(br);if(o>0){if(i)return null;s=1}else{if(!(o<0))return null;s=-1,o=-o}yr.subVectors(this.origin,e);const a=s*this.direction.dot(_r.crossVectors(yr,_r));if(a<0)return null;const l=s*this.direction.dot(xr.cross(yr));if(l<0)return null;if(a+l>o)return null;const c=-s*yr.dot(br);return c<0?null:this.at(c/o,r)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}}class Mr{constructor(){Object.defineProperty(this,"isMatrix4",{value:!0}),this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}set(e,t,n,i,r,s,o,a,l,c,h,u,d,p,f,m){const g=this.elements;return g[0]=e,g[4]=t,g[8]=n,g[12]=i,g[1]=r,g[5]=s,g[9]=o,g[13]=a,g[2]=l,g[6]=c,g[10]=h,g[14]=u,g[3]=d,g[7]=p,g[11]=f,g[15]=m,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return(new Mr).fromArray(this.elements)}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){const t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}extractBasis(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,n=e.elements,i=1/Sr.setFromMatrixColumn(e,0).length(),r=1/Sr.setFromMatrixColumn(e,1).length(),s=1/Sr.setFromMatrixColumn(e,2).length();return t[0]=n[0]*i,t[1]=n[1]*i,t[2]=n[2]*i,t[3]=0,t[4]=n[4]*r,t[5]=n[5]*r,t[6]=n[6]*r,t[7]=0,t[8]=n[8]*s,t[9]=n[9]*s,t[10]=n[10]*s,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){e&&e.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");const t=this.elements,n=e.x,i=e.y,r=e.z,s=Math.cos(n),o=Math.sin(n),a=Math.cos(i),l=Math.sin(i),c=Math.cos(r),h=Math.sin(r);if("XYZ"===e.order){const e=s*c,n=s*h,i=o*c,r=o*h;t[0]=a*c,t[4]=-a*h,t[8]=l,t[1]=n+i*l,t[5]=e-r*l,t[9]=-o*a,t[2]=r-e*l,t[6]=i+n*l,t[10]=s*a}else if("YXZ"===e.order){const e=a*c,n=a*h,i=l*c,r=l*h;t[0]=e+r*o,t[4]=i*o-n,t[8]=s*l,t[1]=s*h,t[5]=s*c,t[9]=-o,t[2]=n*o-i,t[6]=r+e*o,t[10]=s*a}else if("ZXY"===e.order){const e=a*c,n=a*h,i=l*c,r=l*h;t[0]=e-r*o,t[4]=-s*h,t[8]=i+n*o,t[1]=n+i*o,t[5]=s*c,t[9]=r-e*o,t[2]=-s*l,t[6]=o,t[10]=s*a}else if("ZYX"===e.order){const e=s*c,n=s*h,i=o*c,r=o*h;t[0]=a*c,t[4]=i*l-n,t[8]=e*l+r,t[1]=a*h,t[5]=r*l+e,t[9]=n*l-i,t[2]=-l,t[6]=o*a,t[10]=s*a}else if("YZX"===e.order){const e=s*a,n=s*l,i=o*a,r=o*l;t[0]=a*c,t[4]=r-e*h,t[8]=i*h+n,t[1]=h,t[5]=s*c,t[9]=-o*c,t[2]=-l*c,t[6]=n*h+i,t[10]=e-r*h}else if("XZY"===e.order){const e=s*a,n=s*l,i=o*a,r=o*l;t[0]=a*c,t[4]=-h,t[8]=l*c,t[1]=e*h+r,t[5]=s*c,t[9]=n*h-i,t[2]=i*h-n,t[6]=o*c,t[10]=r*h+e}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(Er,e,Ar)}lookAt(e,t,n){const i=this.elements;return Rr.subVectors(e,t),0===Rr.lengthSq()&&(Rr.z=1),Rr.normalize(),Cr.crossVectors(n,Rr),0===Cr.lengthSq()&&(1===Math.abs(n.z)?Rr.x+=1e-4:Rr.z+=1e-4,Rr.normalize(),Cr.crossVectors(n,Rr)),Cr.normalize(),Lr.crossVectors(Rr,Cr),i[0]=Cr.x,i[4]=Lr.x,i[8]=Rr.x,i[1]=Cr.y,i[5]=Lr.y,i[9]=Rr.y,i[2]=Cr.z,i[6]=Lr.z,i[10]=Rr.z,this}multiply(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(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,i=t.elements,r=this.elements,s=n[0],o=n[4],a=n[8],l=n[12],c=n[1],h=n[5],u=n[9],d=n[13],p=n[2],f=n[6],m=n[10],g=n[14],v=n[3],y=n[7],x=n[11],_=n[15],b=i[0],w=i[4],M=i[8],S=i[12],T=i[1],E=i[5],A=i[9],C=i[13],L=i[2],R=i[6],P=i[10],N=i[14],D=i[3],I=i[7],O=i[11],z=i[15];return r[0]=s*b+o*T+a*L+l*D,r[4]=s*w+o*E+a*R+l*I,r[8]=s*M+o*A+a*P+l*O,r[12]=s*S+o*C+a*N+l*z,r[1]=c*b+h*T+u*L+d*D,r[5]=c*w+h*E+u*R+d*I,r[9]=c*M+h*A+u*P+d*O,r[13]=c*S+h*C+u*N+d*z,r[2]=p*b+f*T+m*L+g*D,r[6]=p*w+f*E+m*R+g*I,r[10]=p*M+f*A+m*P+g*O,r[14]=p*S+f*C+m*N+g*z,r[3]=v*b+y*T+x*L+_*D,r[7]=v*w+y*E+x*R+_*I,r[11]=v*M+y*A+x*P+_*O,r[15]=v*S+y*C+x*N+_*z,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[4],i=e[8],r=e[12],s=e[1],o=e[5],a=e[9],l=e[13],c=e[2],h=e[6],u=e[10],d=e[14];return e[3]*(+r*a*h-i*l*h-r*o*u+n*l*u+i*o*d-n*a*d)+e[7]*(+t*a*d-t*l*u+r*s*u-i*s*d+i*l*c-r*a*c)+e[11]*(+t*l*h-t*o*d-r*s*h+n*s*d+r*o*c-n*l*c)+e[15]*(-i*o*c-t*a*h+t*o*u+i*s*h-n*s*u+n*a*c)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){const i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=t,i[14]=n),this}getInverse(e,t){void 0!==t&&console.warn("THREE.Matrix4: .getInverse() can no longer be configured to throw on degenerate.");const n=this.elements,i=e.elements,r=i[0],s=i[1],o=i[2],a=i[3],l=i[4],c=i[5],h=i[6],u=i[7],d=i[8],p=i[9],f=i[10],m=i[11],g=i[12],v=i[13],y=i[14],x=i[15],_=p*y*u-v*f*u+v*h*m-c*y*m-p*h*x+c*f*x,b=g*f*u-d*y*u-g*h*m+l*y*m+d*h*x-l*f*x,w=d*v*u-g*p*u+g*c*m-l*v*m-d*c*x+l*p*x,M=g*p*h-d*v*h-g*c*f+l*v*f+d*c*y-l*p*y,S=r*_+s*b+o*w+a*M;if(0===S)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const T=1/S;return n[0]=_*T,n[1]=(v*f*a-p*y*a-v*o*m+s*y*m+p*o*x-s*f*x)*T,n[2]=(c*y*a-v*h*a+v*o*u-s*y*u-c*o*x+s*h*x)*T,n[3]=(p*h*a-c*f*a-p*o*u+s*f*u+c*o*m-s*h*m)*T,n[4]=b*T,n[5]=(d*y*a-g*f*a+g*o*m-r*y*m-d*o*x+r*f*x)*T,n[6]=(g*h*a-l*y*a-g*o*u+r*y*u+l*o*x-r*h*x)*T,n[7]=(l*f*a-d*h*a+d*o*u-r*f*u-l*o*m+r*h*m)*T,n[8]=w*T,n[9]=(g*p*a-d*v*a-g*s*m+r*v*m+d*s*x-r*p*x)*T,n[10]=(l*v*a-g*c*a+g*s*u-r*v*u-l*s*x+r*c*x)*T,n[11]=(d*c*a-l*p*a-d*s*u+r*p*u+l*s*m-r*c*m)*T,n[12]=M*T,n[13]=(d*v*o-g*p*o+g*s*f-r*v*f-d*s*y+r*p*y)*T,n[14]=(g*c*o-l*v*o-g*s*h+r*v*h+l*s*y-r*c*y)*T,n[15]=(l*p*o-d*c*o+d*s*h-r*p*h-l*s*f+r*c*f)*T,this}scale(e){const t=this.elements,n=e.x,i=e.y,r=e.z;return t[0]*=n,t[4]*=i,t[8]*=r,t[1]*=n,t[5]*=i,t[9]*=r,t[2]*=n,t[6]*=i,t[10]*=r,t[3]*=n,t[7]*=i,t[11]*=r,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,i))}makeTranslation(e,t,n){return this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const n=Math.cos(t),i=Math.sin(t),r=1-n,s=e.x,o=e.y,a=e.z,l=r*s,c=r*o;return this.set(l*s+n,l*o-i*a,l*a+i*o,0,l*o+i*a,c*o+n,c*a-i*s,0,l*a-i*o,c*a+i*s,r*a*a+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n){return this.set(1,t,n,0,e,1,n,0,e,t,1,0,0,0,0,1),this}compose(e,t,n){const i=this.elements,r=t._x,s=t._y,o=t._z,a=t._w,l=r+r,c=s+s,h=o+o,u=r*l,d=r*c,p=r*h,f=s*c,m=s*h,g=o*h,v=a*l,y=a*c,x=a*h,_=n.x,b=n.y,w=n.z;return i[0]=(1-(f+g))*_,i[1]=(d+x)*_,i[2]=(p-y)*_,i[3]=0,i[4]=(d-x)*b,i[5]=(1-(u+g))*b,i[6]=(m+v)*b,i[7]=0,i[8]=(p+y)*w,i[9]=(m-v)*w,i[10]=(1-(u+f))*w,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,t,n){const i=this.elements;let r=Sr.set(i[0],i[1],i[2]).length();const s=Sr.set(i[4],i[5],i[6]).length(),o=Sr.set(i[8],i[9],i[10]).length();this.determinant()<0&&(r=-r),e.x=i[12],e.y=i[13],e.z=i[14],Tr.copy(this);const a=1/r,l=1/s,c=1/o;return Tr.elements[0]*=a,Tr.elements[1]*=a,Tr.elements[2]*=a,Tr.elements[4]*=l,Tr.elements[5]*=l,Tr.elements[6]*=l,Tr.elements[8]*=c,Tr.elements[9]*=c,Tr.elements[10]*=c,t.setFromRotationMatrix(Tr),n.x=r,n.y=s,n.z=o,this}makePerspective(e,t,n,i,r,s){void 0===s&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");const o=this.elements,a=2*r/(t-e),l=2*r/(n-i),c=(t+e)/(t-e),h=(n+i)/(n-i),u=-(s+r)/(s-r),d=-2*s*r/(s-r);return o[0]=a,o[4]=0,o[8]=c,o[12]=0,o[1]=0,o[5]=l,o[9]=h,o[13]=0,o[2]=0,o[6]=0,o[10]=u,o[14]=d,o[3]=0,o[7]=0,o[11]=-1,o[15]=0,this}makeOrthographic(e,t,n,i,r,s){const o=this.elements,a=1/(t-e),l=1/(n-i),c=1/(s-r),h=(t+e)*a,u=(n+i)*l,d=(s+r)*c;return o[0]=2*a,o[4]=0,o[8]=0,o[12]=-h,o[1]=0,o[5]=2*l,o[9]=0,o[13]=-u,o[2]=0,o[6]=0,o[10]=-2*c,o[14]=-d,o[3]=0,o[7]=0,o[11]=0,o[15]=1,this}equals(e){const t=this.elements,n=e.elements;for(let e=0;e<16;e++)if(t[e]!==n[e])return!1;return!0}fromArray(e,t){void 0===t&&(t=0);for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e,t){void 0===e&&(e=[]),void 0===t&&(t=0);const 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}}const Sr=new Zi,Tr=new Mr,Er=new Zi(0,0,0),Ar=new Zi(1,1,1),Cr=new Zi,Lr=new Zi,Rr=new Zi;class Pr{constructor(e=0,t=0,n=0,i=Pr.DefaultOrder){Object.defineProperty(this,"isEuler",{value:!0}),this._x=e,this._y=t,this._z=n,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,i){return this._x=e,this._y=t,this._z=n,this._order=i||this._order,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t,n){const i=Bi.clamp,r=e.elements,s=r[0],o=r[4],a=r[8],l=r[1],c=r[5],h=r[9],u=r[2],d=r[6],p=r[10];switch(t=t||this._order){case"XYZ":this._y=Math.asin(i(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-h,p),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(d,c),this._z=0);break;case"YXZ":this._x=Math.asin(-i(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(a,p),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-u,s),this._z=0);break;case"ZXY":this._x=Math.asin(i(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-u,p),this._z=Math.atan2(-o,c)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-i(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(d,p),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-o,c));break;case"YZX":this._z=Math.asin(i(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-h,c),this._y=Math.atan2(-u,s)):(this._x=0,this._y=Math.atan2(a,p));break;case"XZY":this._z=Math.asin(-i(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(d,c),this._y=Math.atan2(a,s)):(this._x=Math.atan2(-h,p),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,!1!==n&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return Nr.makeRotationFromQuaternion(e),this.setFromRotationMatrix(Nr,t,n)}setFromVector3(e,t){return this.set(e.x,e.y,e.z,t||this._order)}reorder(e){return Dr.setFromEuler(this),this.setFromQuaternion(Dr,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],void 0!==e[3]&&(this._order=e[3]),this._onChangeCallback(),this}toArray(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(e){return e?e.set(this._x,this._y,this._z):new Zi(this._x,this._y,this._z)}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}}Pr.DefaultOrder="XYZ",Pr.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];const Nr=new Mr,Dr=new Yi;class Ir{constructor(){this.mask=1}set(e){this.mask=1<1){for(let e=0;e1){for(let e=0;e0){i.children=[];for(let t=0;t0&&(n.geometries=t),i.length>0&&(n.materials=i),r.length>0&&(n.textures=r),o.length>0&&(n.images=o),a.length>0&&(n.shapes=a)}return n.object=i,n;function s(e){const t=[];for(const n in e){const i=e[n];delete i.metadata,t.push(i)}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.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse(JSON.stringify(e.userData)),!0===t)for(let t=0;t1?void 0:t.copy(n).multiplyScalar(r).add(e.start)}intersectsLine(e){const t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return void 0===e&&(console.warn("THREE.Plane: .coplanarPoint() target is now required"),e=new Zi),e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const n=t||Kr.getNormalMatrix(e),i=this.coplanarPoint(Zr).applyMatrix4(e),r=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(r),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}}const $r=new Zi,es=new Zi,ts=new Zi,ns=new Zi,is=new Zi,rs=new Zi,ss=new Zi,os=new Zi,as=new Zi,ls=new Zi;class cs{constructor(e,t,n){this.a=void 0!==e?e:new Zi,this.b=void 0!==t?t:new Zi,this.c=void 0!==n?n:new Zi}static getNormal(e,t,n,i){void 0===i&&(console.warn("THREE.Triangle: .getNormal() target is now required"),i=new Zi),i.subVectors(n,t),$r.subVectors(e,t),i.cross($r);const r=i.lengthSq();return r>0?i.multiplyScalar(1/Math.sqrt(r)):i.set(0,0,0)}static getBarycoord(e,t,n,i,r){$r.subVectors(i,t),es.subVectors(n,t),ts.subVectors(e,t);const s=$r.dot($r),o=$r.dot(es),a=$r.dot(ts),l=es.dot(es),c=es.dot(ts),h=s*l-o*o;if(void 0===r&&(console.warn("THREE.Triangle: .getBarycoord() target is now required"),r=new Zi),0===h)return r.set(-2,-1,-1);const u=1/h,d=(l*a-o*c)*u,p=(s*c-o*a)*u;return r.set(1-d-p,p,d)}static containsPoint(e,t,n,i){return this.getBarycoord(e,t,n,i,ns),ns.x>=0&&ns.y>=0&&ns.x+ns.y<=1}static getUV(e,t,n,i,r,s,o,a){return this.getBarycoord(e,t,n,i,ns),a.set(0,0),a.addScaledVector(r,ns.x),a.addScaledVector(s,ns.y),a.addScaledVector(o,ns.z),a}static isFrontFacing(e,t,n,i){return $r.subVectors(n,t),es.subVectors(e,t),$r.cross(es).dot(i)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,i){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[i]),this}clone(){return(new this.constructor).copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return $r.subVectors(this.c,this.b),es.subVectors(this.a,this.b),.5*$r.cross(es).length()}getMidpoint(e){return void 0===e&&(console.warn("THREE.Triangle: .getMidpoint() target is now required"),e=new Zi),e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return cs.getNormal(this.a,this.b,this.c,e)}getPlane(e){return void 0===e&&(console.warn("THREE.Triangle: .getPlane() target is now required"),e=new Qr),e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return cs.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,n,i,r){return cs.getUV(e,this.a,this.b,this.c,t,n,i,r)}containsPoint(e){return cs.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return cs.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){void 0===t&&(console.warn("THREE.Triangle: .closestPointToPoint() target is now required"),t=new Zi);const n=this.a,i=this.b,r=this.c;let s,o;is.subVectors(i,n),rs.subVectors(r,n),os.subVectors(e,n);const a=is.dot(os),l=rs.dot(os);if(a<=0&&l<=0)return t.copy(n);as.subVectors(e,i);const c=is.dot(as),h=rs.dot(as);if(c>=0&&h<=c)return t.copy(i);const u=a*h-c*l;if(u<=0&&a>=0&&c<=0)return s=a/(a-c),t.copy(n).addScaledVector(is,s);ls.subVectors(e,r);const d=is.dot(ls),p=rs.dot(ls);if(p>=0&&d<=p)return t.copy(r);const f=d*l-a*p;if(f<=0&&l>=0&&p<=0)return o=l/(l-p),t.copy(n).addScaledVector(rs,o);const m=c*p-d*h;if(m<=0&&h-c>=0&&d-p>=0)return ss.subVectors(r,i),o=(h-c)/(h-c+(d-p)),t.copy(i).addScaledVector(ss,o);const g=1/(m+f+u);return s=f*g,o=u*g,t.copy(n).addScaledVector(is,s).addScaledVector(rs,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const hs={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},us={h:0,s:0,l:0},ds={h:0,s:0,l:0};function ps(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}function fs(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}function ms(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}class gs{constructor(e,t,n){return Object.defineProperty(this,"isColor",{value:!0}),void 0===t&&void 0===n?this.set(e):this.setRGB(e,t,n)}set(e){return e&&e.isColor?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e),this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,this}setRGB(e,t,n){return this.r=e,this.g=t,this.b=n,this}setHSL(e,t,n){if(e=Bi.euclideanModulo(e,1),t=Bi.clamp(t,0,1),n=Bi.clamp(n,0,1),0===t)this.r=this.g=this.b=n;else{const i=n<=.5?n*(1+t):n+t-n*t,r=2*n-i;this.r=ps(r,i,e+1/3),this.g=ps(r,i,e),this.b=ps(r,i,e-1/3)}return this}setStyle(e){function t(t){void 0!==t&&parseFloat(t)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let n;if(n=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(e)){let e;const i=n[1],r=n[2];switch(i){case"rgb":case"rgba":if(e=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(r))return this.r=Math.min(255,parseInt(e[1],10))/255,this.g=Math.min(255,parseInt(e[2],10))/255,this.b=Math.min(255,parseInt(e[3],10))/255,t(e[5]),this;if(e=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(r))return this.r=Math.min(100,parseInt(e[1],10))/100,this.g=Math.min(100,parseInt(e[2],10))/100,this.b=Math.min(100,parseInt(e[3],10))/100,t(e[5]),this;break;case"hsl":case"hsla":if(e=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(r)){const n=parseFloat(e[1])/360,i=parseInt(e[2],10)/100,r=parseInt(e[3],10)/100;return t(e[5]),this.setHSL(n,i,r)}}}else if(n=/^\#([A-Fa-f0-9]+)$/.exec(e)){const e=n[1],t=e.length;if(3===t)return this.r=parseInt(e.charAt(0)+e.charAt(0),16)/255,this.g=parseInt(e.charAt(1)+e.charAt(1),16)/255,this.b=parseInt(e.charAt(2)+e.charAt(2),16)/255,this;if(6===t)return this.r=parseInt(e.charAt(0)+e.charAt(1),16)/255,this.g=parseInt(e.charAt(2)+e.charAt(3),16)/255,this.b=parseInt(e.charAt(4)+e.charAt(5),16)/255,this}return e&&e.length>0?this.setColorName(e):this}setColorName(e){const t=hs[e];return void 0!==t?this.setHex(t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copyGammaToLinear(e,t){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(e,t){void 0===t&&(t=2);const n=t>0?1/t:1;return this.r=Math.pow(e.r,n),this.g=Math.pow(e.g,n),this.b=Math.pow(e.b,n),this}convertGammaToLinear(e){return this.copyGammaToLinear(this,e),this}convertLinearToGamma(e){return this.copyLinearToGamma(this,e),this}copySRGBToLinear(e){return this.r=fs(e.r),this.g=fs(e.g),this.b=fs(e.b),this}copyLinearToSRGB(e){return this.r=ms(e.r),this.g=ms(e.g),this.b=ms(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0}getHexString(){return("000000"+this.getHex().toString(16)).slice(-6)}getHSL(e){void 0===e&&(console.warn("THREE.Color: .getHSL() target is now required"),e={h:0,s:0,l:0});const t=this.r,n=this.g,i=this.b,r=Math.max(t,n,i),s=Math.min(t,n,i);let o,a;const l=(s+r)/2;if(s===r)o=0,a=0;else{const e=r-s;switch(a=l<=.5?e/(r+s):e/(2-r-s),r){case t:o=(n-i)/e+(n0&&(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.morphNormals&&(n.morphNormals=!0),!0===this.skinning&&(n.skinning=!0),!1===this.visible&&(n.visible=!1),!1===this.toneMapped&&(n.toneMapped=!1),"{}"!==JSON.stringify(this.userData)&&(n.userData=this.userData),t){const t=i(e.textures),r=i(e.images);t.length>0&&(n.textures=t),r.length>0&&(n.images=r)}return n},clone:function(){return(new this.constructor).copy(this)},copy:function(e){this.name=e.name,this.fog=e.fog,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.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let n=null;if(null!==t){const e=t.length;n=new Array(e);for(let i=0;i!==e;++i)n[i]=t[i].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.premultipliedAlpha=e.premultipliedAlpha,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Object.defineProperty(xs.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),_s.prototype=Object.create(xs.prototype),_s.prototype.constructor=_s,_s.prototype.isMeshBasicMaterial=!0,_s.prototype.copy=function(e){return xs.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};const bs=new Zi,ws=new Fi;function Ms(e,t,n){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=e,this.itemSize=t,this.count=void 0!==e?e.length/t:0,this.normalized=!0===n,this.usage=35044,this.updateRange={offset:0,count:-1},this.version=0}function Ss(e,t,n){Ms.call(this,new Int8Array(e),t,n)}function Ts(e,t,n){Ms.call(this,new Uint8Array(e),t,n)}function Es(e,t,n){Ms.call(this,new Uint8ClampedArray(e),t,n)}function As(e,t,n){Ms.call(this,new Int16Array(e),t,n)}function Cs(e,t,n){Ms.call(this,new Uint16Array(e),t,n)}function Ls(e,t,n){Ms.call(this,new Int32Array(e),t,n)}function Rs(e,t,n){Ms.call(this,new Uint32Array(e),t,n)}function Ps(e,t,n){Ms.call(this,new Float32Array(e),t,n)}function Ns(e,t,n){Ms.call(this,new Float64Array(e),t,n)}Object.defineProperty(Ms.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),Object.assign(Ms.prototype,{isBufferAttribute:!0,onUploadCallback:function(){},setUsage:function(e){return this.usage=e,this},copy:function(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this},copyAt:function(e,t,n){e*=this.itemSize,n*=t.itemSize;for(let i=0,r=this.itemSize;i0,s=i[1]&&i[1].length>0,o=e.morphTargets,a=o.length;let l;if(a>0){l=[];for(let e=0;e0){u=[];for(let e=0;e0&&0===t.length&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(let e=0;et&&(t=e[n]);return t}let Os=1;const zs=new Mr,Us=new Yr,Bs=new Zi,Fs=new Qi,Gs=new Qi,ks=new Zi;function Hs(){Object.defineProperty(this,"id",{value:Os+=2}),this.uuid=Bi.generateUUID(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}Hs.prototype=Object.assign(Object.create(Oi.prototype),{constructor:Hs,isBufferGeometry:!0,getIndex:function(){return this.index},setIndex:function(e){Array.isArray(e)?this.index=new(Is(e)>65535?Rs:Cs)(e,1):this.index=e},getAttribute:function(e){return this.attributes[e]},setAttribute:function(e,t){return this.attributes[e]=t,this},deleteAttribute: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},applyMatrix4:function(e){const t=this.attributes.position;void 0!==t&&(t.applyMatrix4(e),t.needsUpdate=!0);const n=this.attributes.normal;if(void 0!==n){const t=(new Gi).getNormalMatrix(e);n.applyNormalMatrix(t),n.needsUpdate=!0}const i=this.attributes.tangent;return void 0!==i&&(i.transformDirection(e),i.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:function(e){return zs.makeRotationX(e),this.applyMatrix4(zs),this},rotateY:function(e){return zs.makeRotationY(e),this.applyMatrix4(zs),this},rotateZ:function(e){return zs.makeRotationZ(e),this.applyMatrix4(zs),this},translate:function(e,t,n){return zs.makeTranslation(e,t,n),this.applyMatrix4(zs),this},scale:function(e,t,n){return zs.makeScale(e,t,n),this.applyMatrix4(zs),this},lookAt:function(e){return Us.lookAt(e),Us.updateMatrix(),this.applyMatrix4(Us.matrix),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(Bs).negate(),this.translate(Bs.x,Bs.y,Bs.z),this},setFromObject:function(e){const t=e.geometry;if(e.isPoints||e.isLine){const e=new Ps(3*t.vertices.length,3),n=new Ps(3*t.colors.length,3);if(this.setAttribute("position",e.copyVector3sArray(t.vertices)),this.setAttribute("color",n.copyColorsArray(t.colors)),t.lineDistances&&t.lineDistances.length===t.vertices.length){const e=new Ps(t.lineDistances.length,1);this.setAttribute("lineDistance",e.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){const t=[];for(let n=0,i=e.length;n0){const t=new Float32Array(3*e.normals.length);this.setAttribute("normal",new Ms(t,3).copyVector3sArray(e.normals))}if(e.colors.length>0){const t=new Float32Array(3*e.colors.length);this.setAttribute("color",new Ms(t,3).copyColorsArray(e.colors))}if(e.uvs.length>0){const t=new Float32Array(2*e.uvs.length);this.setAttribute("uv",new Ms(t,2).copyVector2sArray(e.uvs))}if(e.uvs2.length>0){const t=new Float32Array(2*e.uvs2.length);this.setAttribute("uv2",new Ms(t,2).copyVector2sArray(e.uvs2))}this.groups=e.groups;for(const t in e.morphTargets){const n=[],i=e.morphTargets[t];for(let e=0,t=i.length;e0){const t=new Ps(4*e.skinIndices.length,4);this.setAttribute("skinIndex",t.copyVector4sArray(e.skinIndices))}if(e.skinWeights.length>0){const t=new Ps(4*e.skinWeights.length,4);this.setAttribute("skinWeight",t.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 Qi);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute)return console.error('THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box. Alternatively set "mesh.frustumCulled" to "false".',this),void this.boundingBox.set(new Zi(-1/0,-1/0,-1/0),new Zi(1/0,1/0,1/0));if(void 0!==e){if(this.boundingBox.setFromBufferAttribute(e),t)for(let e=0,n=t.length;e0&&(e.userData=this.userData),void 0!==this.parameters){const t=this.parameters;for(const n in t)void 0!==t[n]&&(e[n]=t[n]);return e}e.data={attributes:{}};const t=this.index;null!==t&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const n=this.attributes;for(const t in n){const i=n[t],r=i.toJSON(e.data);""!==i.name&&(r.name=i.name),e.data.attributes[t]=r}const i={};let r=!1;for(const t in this.morphAttributes){const n=this.morphAttributes[t],s=[];for(let t=0,i=n.length;t0&&(i[t]=s,r=!0)}r&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);const s=this.groups;s.length>0&&(e.data.groups=JSON.parse(JSON.stringify(s)));const o=this.boundingSphere;return null!==o&&(e.data.boundingSphere={center:o.center.toArray(),radius:o.radius}),e},clone:function(){return(new Hs).copy(this)},copy:function(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const n=e.index;null!==n&&this.setIndex(n.clone(t));const i=e.attributes;for(const e in i){const n=i[e];this.setAttribute(e,n.clone(t))}const r=e.morphAttributes;for(const e in r){const n=[],i=r[e];for(let e=0,r=i.length;en.far?null:{distance:c,point:so.clone(),object:e}}function lo(e,t,n,i,r,s,o,a,l,c,h,u){Xs.fromBufferAttribute(r,c),qs.fromBufferAttribute(r,h),Ys.fromBufferAttribute(r,u);const d=e.morphTargetInfluences;if(t.morphTargets&&s&&d){Qs.set(0,0,0),$s.set(0,0,0),eo.set(0,0,0);for(let e=0,t=s.length;e0){const e=t[n[0]];if(void 0!==e){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,n=e.length;t0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}},raycast:function(e,t){const n=this.geometry,i=this.material,r=this.matrixWorld;if(void 0===i)return;if(null===n.boundingSphere&&n.computeBoundingSphere(),Ws.copy(n.boundingSphere),Ws.applyMatrix4(r),!1===e.ray.intersectsSphere(Ws))return;if(js.getInverse(r),Vs.copy(e.ray).applyMatrix4(js),null!==n.boundingBox&&!1===Vs.intersectsBox(n.boundingBox))return;let s;if(n.isBufferGeometry){const r=n.index,o=n.attributes.position,a=n.morphAttributes.position,l=n.morphTargetsRelative,c=n.attributes.uv,h=n.attributes.uv2,u=n.groups,d=n.drawRange;if(null!==r)if(Array.isArray(i))for(let n=0,p=u.length;n0&&(l=c);for(let n=0,c=a.length;n0)for(let e=0;e0&&(this.normalsNeedUpdate=!0)},computeFlatVertexNormals:function(){this.computeFaceNormals();for(let e=0,t=this.faces.length;e0&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){for(let e=0,t=this.faces.length;e=0;e--){const t=r[e];this.faces.splice(t,1);for(let e=0,n=this.faceVertexUvs.length;e0,a=t.vertexNormals.length>0,l=1!==t.color.r||1!==t.color.g||1!==t.color.b,p=t.vertexColors.length>0;let f=0;if(f=c(f,0,0),f=c(f,1,i),f=c(f,2,r),f=c(f,3,s),f=c(f,4,o),f=c(f,5,a),f=c(f,6,l),f=c(f,7,p),n.push(f),n.push(t.a,t.b,t.c),n.push(t.materialIndex),s){const t=this.faceVertexUvs[0][e];n.push(d(t[0]),d(t[1]),d(t[2]))}if(o&&n.push(h(t.normal)),a){const e=t.vertexNormals;n.push(h(e[0]),h(e[1]),h(e[2]))}if(l&&n.push(u(t.color)),p){const e=t.vertexColors;n.push(u(e[0]),u(e[1]),u(e[2]))}}function c(e,t,n){return n?e|1<0&&(e.data.colors=s),a.length>0&&(e.data.uvs=[a]),e.data.faces=n,e},clone:function(){return(new fo).copy(this)},copy:function(e){this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.name=e.name;const t=e.vertices;for(let e=0,n=t.length;e0?1:-1,c.push(A.x,A.y,A.z),h.push(a/m),h.push(1-s/g),T+=1}}for(let e=0;e0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader;const n={};for(const e in this.extensions)!0===this.extensions[e]&&(n[e]=!0);return Object.keys(n).length>0&&(t.extensions=n),t},_o.prototype=Object.assign(Object.create(Yr.prototype),{constructor:_o,isCamera:!0,copy:function(e,t){return Yr.prototype.copy.call(this,e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this},getWorldDirection:function(e){void 0===e&&(console.warn("THREE.Camera: .getWorldDirection() target is now required"),e=new Zi),this.updateMatrixWorld(!0);const t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()},updateMatrixWorld:function(e){Yr.prototype.updateMatrixWorld.call(this,e),this.matrixWorldInverse.getInverse(this.matrixWorld)},updateWorldMatrix:function(e,t){Yr.prototype.updateWorldMatrix.call(this,e,t),this.matrixWorldInverse.getInverse(this.matrixWorld)},clone:function(){return(new this.constructor).copy(this)}}),bo.prototype=Object.assign(Object.create(_o.prototype),{constructor:bo,isPerspectiveCamera:!0,copy:function(e,t){return _o.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){const t=.5*this.getFilmHeight()/e;this.fov=2*Bi.RAD2DEG*Math.atan(t),this.updateProjectionMatrix()},getFocalLength:function(){const e=Math.tan(.5*Bi.DEG2RAD*this.fov);return.5*this.getFilmHeight()/e},getEffectiveFOV:function(){return 2*Bi.RAD2DEG*Math.atan(Math.tan(.5*Bi.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,i,r,s){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=i,this.view.width=r,this.view.height=s,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){const e=this.near;let t=e*Math.tan(.5*Bi.DEG2RAD*this.fov)/this.zoom,n=2*t,i=this.aspect*n,r=-.5*i;const s=this.view;if(null!==this.view&&this.view.enabled){const e=s.fullWidth,o=s.fullHeight;r+=s.offsetX*i/e,t-=s.offsetY*n/o,i*=s.width/e,n*=s.height/o}const o=this.filmOffset;0!==o&&(r+=e*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+i,t,t-n,e,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(e){const t=Yr.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}});function wo(e,t,n){if(Yr.call(this),this.type="CubeCamera",!0!==n.isWebGLCubeRenderTarget)return void console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.");this.renderTarget=n;const i=new bo(90,1,e,t);i.layers=this.layers,i.up.set(0,-1,0),i.lookAt(new Zi(1,0,0)),this.add(i);const r=new bo(90,1,e,t);r.layers=this.layers,r.up.set(0,-1,0),r.lookAt(new Zi(-1,0,0)),this.add(r);const s=new bo(90,1,e,t);s.layers=this.layers,s.up.set(0,0,1),s.lookAt(new Zi(0,1,0)),this.add(s);const o=new bo(90,1,e,t);o.layers=this.layers,o.up.set(0,0,-1),o.lookAt(new Zi(0,-1,0)),this.add(o);const a=new bo(90,1,e,t);a.layers=this.layers,a.up.set(0,-1,0),a.lookAt(new Zi(0,0,1)),this.add(a);const l=new bo(90,1,e,t);l.layers=this.layers,l.up.set(0,-1,0),l.lookAt(new Zi(0,0,-1)),this.add(l),this.update=function(e,t){null===this.parent&&this.updateMatrixWorld();const c=e.xr.enabled,h=e.getRenderTarget();e.xr.enabled=!1;const u=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0),e.render(t,i),e.setRenderTarget(n,1),e.render(t,r),e.setRenderTarget(n,2),e.render(t,s),e.setRenderTarget(n,3),e.render(t,o),e.setRenderTarget(n,4),e.render(t,a),n.texture.generateMipmaps=u,e.setRenderTarget(n,5),e.render(t,l),e.setRenderTarget(h),e.xr.enabled=c},this.clear=function(e,t,i,r){const s=e.getRenderTarget();for(let s=0;s<6;s++)e.setRenderTarget(n,s),e.clear(t,i,r);e.setRenderTarget(s)}}function Mo(e,t,n){Number.isInteger(t)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),t=n),Xi.call(this,e,e,t),this.texture.isWebGLCubeRenderTargetTexture=!0}function So(e,t,n,i,r,s,o,a,l,c,h,u){Vi.call(this,null,s,o,a,l,c,i,r,h,u),this.image={data:e||null,width:t||1,height:n||1},this.magFilter=void 0!==l?l:1003,this.minFilter=void 0!==c?c:1003,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}wo.prototype=Object.create(Yr.prototype),wo.prototype.constructor=wo,Mo.prototype=Object.create(Xi.prototype),Mo.prototype.constructor=Mo,Mo.prototype.isWebGLCubeRenderTarget=!0,Mo.prototype.fromEquirectangularTexture=function(e,t){this.texture.type=t.type,this.texture.format=1023,this.texture.encoding=t.encoding,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const n={uniforms:{tEquirect:{value:null}},vertexShader:"\n\n\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t}\n\n\t\t\tvoid main() {\n\n\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t#include \n\t\t\t\t#include \n\n\t\t\t}\n\t\t",fragmentShader:"\n\n\t\t\tuniform sampler2D tEquirect;\n\n\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t#include \n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t}\n\t\t"},i=new mo(5,5,5),r=new xo({name:"CubemapFromEquirect",uniforms:go(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:1,blending:0});r.uniforms.tEquirect.value=t;const s=new oo(i,r),o=t.minFilter;1008===t.minFilter&&(t.minFilter=1006);return new wo(1,10,this).update(e,s),t.minFilter=o,s.geometry.dispose(),s.material.dispose(),this},So.prototype=Object.create(Vi.prototype),So.prototype.constructor=So,So.prototype.isDataTexture=!0;const To=new fr,Eo=new Zi;class Ao{constructor(e,t,n,i,r,s){this.planes=[void 0!==e?e:new Qr,void 0!==t?t:new Qr,void 0!==n?n:new Qr,void 0!==i?i:new Qr,void 0!==r?r:new Qr,void 0!==s?s:new Qr]}set(e,t,n,i,r,s){const o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(n),o[3].copy(i),o[4].copy(r),o[5].copy(s),this}clone(){return(new this.constructor).copy(this)}copy(e){const t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e){const t=this.planes,n=e.elements,i=n[0],r=n[1],s=n[2],o=n[3],a=n[4],l=n[5],c=n[6],h=n[7],u=n[8],d=n[9],p=n[10],f=n[11],m=n[12],g=n[13],v=n[14],y=n[15];return t[0].setComponents(o-i,h-a,f-u,y-m).normalize(),t[1].setComponents(o+i,h+a,f+u,y+m).normalize(),t[2].setComponents(o+r,h+l,f+d,y+g).normalize(),t[3].setComponents(o-r,h-l,f-d,y-g).normalize(),t[4].setComponents(o-s,h-c,f-p,y-v).normalize(),t[5].setComponents(o+s,h+c,f+p,y+v).normalize(),this}intersectsObject(e){const t=e.geometry;return null===t.boundingSphere&&t.computeBoundingSphere(),To.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(To)}intersectsSprite(e){return To.center.set(0,0,0),To.radius=.7071067811865476,To.applyMatrix4(e.matrixWorld),this.intersectsSphere(To)}intersectsSphere(e){const t=this.planes,n=e.center,i=-e.radius;for(let e=0;e<6;e++){if(t[e].distanceToPoint(n)0?e.max.x:e.min.x,Eo.y=i.normal.y>0?e.max.y:e.min.y,Eo.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(Eo)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}}function Co(){let e=null,t=!1,n=null,i=null;function r(t,s){n(t,s),i=e.requestAnimationFrame(r)}return{start:function(){!0!==t&&null!==n&&(i=e.requestAnimationFrame(r),t=!0)},stop:function(){e.cancelAnimationFrame(i),t=!1},setAnimationLoop:function(e){n=e},setContext:function(t){e=t}}}function Lo(e,t){const n=t.isWebGL2,i=new WeakMap;return{get:function(e){return e.isInterleavedBufferAttribute&&(e=e.data),i.get(e)},remove:function(t){t.isInterleavedBufferAttribute&&(t=t.data);const n=i.get(t);n&&(e.deleteBuffer(n.buffer),i.delete(t))},update:function(t,r){if(t.isGLBufferAttribute){var s=i.get(t);return void((!s||s.version 0.0 ) {\n\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t}\n\treturn distanceFalloff;\n#else\n\tif( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t}\n\treturn 1.0;\n#endif\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nvec3 F_Schlick_RoughnessDependent( const in vec3 F0, const in float dotNV, const in float roughness ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotNV - 6.98316 ) * dotNV );\n\tvec3 Fr = max( vec3( 1.0 - roughness ), F0 ) - F0;\n\treturn Fr * fresnel + F0;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\treturn 1.0 / ( gl * gv );\n}\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + viewDir );\n\tfloat dotNL = saturate( dot( normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\nvec3 BRDF_Specular_GGX_Environment( const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\treturn specularColor * brdf.x + brdf.y;\n}\nvoid BRDF_Specular_Multiscattering_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tvec3 F = F_Schlick_RoughnessDependent( specularColor, dotNV, roughness );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\tvec3 FssEss = F * brdf.x + brdf.y;\n\tfloat Ess = brdf.x + brdf.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie(float roughness, float NoH) {\n\tfloat invAlpha = 1.0 / roughness;\n\tfloat cos2h = NoH * NoH;\n\tfloat sin2h = max(1.0 - cos2h, 0.0078125);\treturn (2.0 + invAlpha) * pow(sin2h, invAlpha * 0.5) / (2.0 * PI);\n}\nfloat V_Neubelt(float NoV, float NoL) {\n\treturn saturate(1.0 / (4.0 * (NoL + NoV - NoL * NoV)));\n}\nvec3 BRDF_Specular_Sheen( const in float roughness, const in vec3 L, const in GeometricContext geometry, vec3 specularColor ) {\n\tvec3 N = geometry.normal;\n\tvec3 V = geometry.viewDir;\n\tvec3 H = normalize( V + L );\n\tfloat dotNH = saturate( dot( N, H ) );\n\treturn specularColor * D_Charlie( roughness, dotNH ) * V_Neubelt( dot(N, V), dot(N, L) );\n}\n#endif",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\t\tvec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n\t\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\t\tfDet *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#pragma unroll_loop_end\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif",color_fragment:"#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvarying vec3 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor.xyz *= color.xyz;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif",common:"#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract(sin(sn) * c);\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat max3( vec3 v ) { return max( max( v.x, v.y ), v.z ); }\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\treturn - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat linearToRelativeLuminance( const in vec3 color ) {\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n\treturn dot( weights, color.rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_maxMipLevel 8.0\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_maxTileSize 256.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\tfloat texelSize = 1.0 / ( 3.0 * cubeUV_maxTileSize );\n\t\tvec2 uv = getUV( direction, face ) * ( faceSize - 1.0 );\n\t\tvec2 f = fract( uv );\n\t\tuv += 0.5 - f;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tif ( mipInt < cubeUV_maxMipLevel ) {\n\t\t\tuv.y += 2.0 * cubeUV_maxTileSize;\n\t\t}\n\t\tuv.y += filterInt * 2.0 * cubeUV_minTileSize;\n\t\tuv.x += 3.0 * max( 0.0, cubeUV_maxTileSize - 2.0 * faceSize );\n\t\tuv *= texelSize;\n\t\tvec3 tl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.x += texelSize;\n\t\tvec3 tr = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.y += texelSize;\n\t\tvec3 br = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.x -= texelSize;\n\t\tvec3 bl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tvec3 tm = mix( tl, tr, f.x );\n\t\tvec3 bm = mix( bl, br, f.x );\n\t\treturn mix( tm, bm, f.y );\n\t}\n\t#define r0 1.0\n\t#define v0 0.339\n\t#define m0 - 2.0\n\t#define r1 0.8\n\t#define v1 0.276\n\t#define m1 - 1.0\n\t#define r4 0.4\n\t#define v4 0.046\n\t#define m4 2.0\n\t#define r5 0.305\n\t#define v5 0.016\n\t#define m5 3.0\n\t#define r6 0.21\n\t#define v6 0.0038\n\t#define m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= r1 ) {\n\t\t\tmip = ( r0 - roughness ) * ( m1 - m0 ) / ( r0 - r1 ) + m0;\n\t\t} else if ( roughness >= r4 ) {\n\t\t\tmip = ( r1 - roughness ) * ( m4 - m1 ) / ( r1 - r4 ) + m1;\n\t\t} else if ( roughness >= r5 ) {\n\t\t\tmip = ( r4 - roughness ) * ( m5 - m4 ) / ( r4 - r5 ) + m4;\n\t\t} else if ( roughness >= r6 ) {\n\t\t\tmip = ( r5 - roughness ) * ( m6 - m5 ) / ( r5 - r6 ) + m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), m0, cubeUV_maxMipLevel );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_INSTANCING\n\tmat3 m = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n\ttransformedNormal = m * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",encodings_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",encodings_pars_fragment:"\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a );\n}\nvec4 sRGBToLinear( in vec4 value ) {\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.a );\n}\nvec4 LinearTosRGB( in vec4 value ) {\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.a );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n\tfloat maxComponent = max( max( value.r, value.g ), value.b );\n\tfloat fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n\treturn vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * value.a * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n\tM = ceil( M * 255.0 ) / 255.0;\n\treturn vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat D = max( maxRange / maxRGB, 1.0 );\n\tD = clamp( floor( D ) / 255.0, 0.0, 1.0 );\n\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n\tvec3 Xp_Y_XYZp = cLogLuvM * value.rgb;\n\tXp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) );\n\tvec4 vResult;\n\tvResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n\tfloat Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n\tvResult.w = fract( Le );\n\tvResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0;\n\treturn vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n\tfloat Le = value.z * 255.0 + value.w;\n\tvec3 Xp_Y_XYZp;\n\tXp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 );\n\tXp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n\tXp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n\tvec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb;\n\treturn vec4( max( vRGB, 0.0 ), 1.0 );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifndef ENVMAP_TYPE_CUBE_UV\n\t\tenvColor = envMapTexelToLinear( envColor );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform int maxMipLevel;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#if defined( USE_ENVMAP )\n\t#ifdef ENVMAP_MODE_REFRACTION\n\t\tuniform float refractionRatio;\n\t#endif\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float roughness, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat sigma = PI * roughness * roughness / ( 1.0 + roughness );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar + log2( sigma );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( -viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( -viewDir, normal, refractionRatio );\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( roughness, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\t#endif\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n\tfogDepth = - mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float fogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * fogDepth * fogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, fogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float fogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn texture2D( gradientMap, coord ).rgb;\n\t#else\n\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t#endif\n}",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\treflectedLight.indirectDiffuse += PI * lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n#endif",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_vertex:"vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\nvIndirectFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n\tvIndirectBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\nvIndirectFront += getAmbientLightIrradiance( ambientLightColor );\nvIndirectFront += getLightProbeIrradiance( lightProbe, geometry );\n#ifdef DOUBLE_SIDED\n\tvIndirectBack += getAmbientLightIrradiance( ambientLightColor );\n\tvIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry );\n#endif\n#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tgetPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tgetSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tgetDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in GeometricContext geometry ) {\n\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treturn irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tdirectLight.color = pointLight.color;\n\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\tdirectLight.visible = ( directLight.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\t\tif ( angleCos > spotLight.coneCos ) {\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tirradiance *= PI;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon\n#define Material_LightProbeLOD( material )\t(0)",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.specularRoughness = max( roughnessFactor, 0.0525 );material.specularRoughness += geometryRoughness;\nmaterial.specularRoughness = min( material.specularRoughness, 1.0 );\n#ifdef REFLECTIVITY\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\n#endif\n#ifdef CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheen;\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat specularRoughness;\n\tvec3 specularColor;\n#ifdef CLEARCOAT\n\tfloat clearcoat;\n\tfloat clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tvec3 sheenColor;\n#endif\n};\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\nfloat clearcoatDHRApprox( const in float roughness, const in float dotNL ) {\n\treturn DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.specularRoughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\t#ifdef CLEARCOAT\n\t\tfloat ccDotNL = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = ccDotNL * directLight.color;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tccIrradiance *= PI;\n\t\t#endif\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t\treflectedLight.directSpecular += ccIrradiance * material.clearcoat * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_Sheen(\n\t\t\tmaterial.specularRoughness,\n\t\t\tdirectLight.direction,\n\t\t\tgeometry,\n\t\t\tmaterial.sheenColor\n\t\t);\n\t#else\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.normal, material.specularColor, material.specularRoughness);\n\t#endif\n\treflectedLight.directDiffuse += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef CLEARCOAT\n\t\tfloat ccDotNV = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular += clearcoatRadiance * material.clearcoat * BRDF_Specular_GGX_Environment( geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t\tfloat ccDotNL = ccDotNV;\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\tfloat clearcoatInv = 1.0 - clearcoatDHR;\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\tBRDF_Specular_Multiscattering_Environment( geometry, material.specularColor, material.specularRoughness, singleScattering, multiScattering );\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );\n\treflectedLight.indirectSpecular += clearcoatInv * radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\tvec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getLightProbeIndirectIrradiance( geometry, maxMipLevel );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.normal, material.specularRoughness, maxMipLevel );\n\t#ifdef CLEARCOAT\n\t\tclearcoatRadiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness, maxMipLevel );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n#endif\n#ifdef USE_MAP\n\tvec4 mapTexel = texture2D( map, uv );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tuniform mat3 uvTransform;\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifndef USE_MORPHNORMALS\n\t\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\t\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t#endif\n#endif",normal_fragment_begin:"#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\n\t#ifdef USE_TANGENT\n\t\tvec3 tangent = normalize( vTangent );\n\t\tvec3 bitangent = normalize( vBitangent );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\ttangent = tangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t\tbitangent = bitangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#endif\n\t\t#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tmat3 vTBN = mat3( tangent, bitangent, normal );\n\t\t#endif\n\t#endif\n#endif\nvec3 geometryNormal = normal;",normal_fragment_maps:"#ifdef OBJECTSPACE_NORMALMAP\n\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( TANGENTSPACE_NORMALMAP )\n\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\t#ifdef USE_TANGENT\n\t\tnormal = normalize( vTBN * mapN );\n\t#else\n\t\tnormal = perturbNormal2Arb( -vViewPosition, normal, mapN );\n\t#endif\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN ) {\n\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tfloat scale = sign( st1.t * st0.s - st0.t * st1.s );\n\t\tvec3 S = normalize( ( q0 * st1.t - q1 * st0.t ) * scale );\n\t\tvec3 T = normalize( ( - q0 * st1.s + q1 * st0.s ) * scale );\n\t\tvec3 N = normalize( surf_norm );\n\t\tmat3 tsn = mat3( S, T, N );\n\t\tmapN.xy *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\treturn normalize( tsn * mapN );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\t#ifdef USE_TANGENT\n\t\tclearcoatNormal = normalize( vTBN * clearcoatMapN );\n\t#else\n\t\tclearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN );\n\t#endif\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ));\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w);\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn (( near + viewZ ) * far ) / (( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif",shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0\n\t\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\tvec4 shadowWorldPosition;\n\t#endif\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform highp sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3( 1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108, 1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605, 1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",transmissionmap_fragment:"#ifdef USE_TRANSMISSIONMAP\n\ttotalTransmission *= texture2D( transmissionMap, vUv ).r;\n#endif",transmissionmap_pars_fragment:"#ifdef USE_TRANSMISSIONMAP\n\tuniform sampler2D transmissionMap;\n#endif",uv_pars_fragment:"#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )\n\tvarying vec2 vUv;\n#endif",uv_pars_vertex:"#ifdef USE_UV\n\t#ifdef UVS_VERTEX_ONLY\n\t\tvec2 vUv;\n\t#else\n\t\tvarying vec2 vUv;\n\t#endif\n\tuniform mat3 uvTransform;\n#endif",uv_vertex:"#ifdef USE_UV\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif",uv2_pars_fragment:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",uv2_pars_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n\tuniform mat3 uv2Transform;\n#endif",uv2_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP )\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",background_frag:"uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include \n\t#include \n}",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",cube_frag:"#include \nuniform float opacity;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 vReflect = vWorldDirection;\n\t#include \n\tgl_FragColor = envColor;\n\tgl_FragColor.a *= opacity;\n\t#include \n\t#include \n}",cube_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}",depth_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvHighPrecisionZW = gl_Position.zw;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main () {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include \n\t#include \n\t#include \n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvWorldPosition = worldPosition.xyz;\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tvec4 texColor = texture2D( tEquirect, sampleUV );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include \n\t#include \n}",equirect_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\treflectedLight.indirectDiffuse += lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifdef USE_ENVMAP\n\t#include \n\t#include \n\t#include \n\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_frag:"uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;\n\t#else\n\t\treflectedLight.indirectDiffuse += vIndirectFront;\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t\tmatcapColor = matcapTexelToLinear( matcapColor );\n\t#else\n\t\tvec4 matcapColor = vec4( 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifndef FLAT_SHADED\n\t\tvNormal = normalize( transformedNormal );\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n\t#define REFLECTIVITY\n\t#define CLEARCOAT\n\t#define TRANSMISSION\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef TRANSMISSION\n\tuniform float transmission;\n#endif\n#ifdef REFLECTIVITY\n\tuniform float reflectivity;\n#endif\n#ifdef CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheen;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#ifdef TRANSMISSION\n\t\tfloat totalTransmission = transmission;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#ifdef TRANSMISSION\n\t\tdiffuseColor.a *= saturate( 1. - totalTransmission + linearToRelativeLuminance( reflectedLight.directSpecular + reflectedLight.indirectSpecular ) );\n\t#endif\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n}",normal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n}",normal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}",points_vert:"uniform float size;\nuniform float scale;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include \n\t#include \n\t#include \n}",shadow_vert:"#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include \n\t#include \n\t#include \n}"},No={common:{diffuse:{value:new gs(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new Gi},uv2Transform:{value:new Gi},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new Fi(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 gs(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new gs(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new Gi}},sprite:{diffuse:{value:new gs(15658734)},opacity:{value:1},center:{value:new Fi(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new Gi}}},Do={basic:{uniforms:vo([No.common,No.specularmap,No.envmap,No.aomap,No.lightmap,No.fog]),vertexShader:Po.meshbasic_vert,fragmentShader:Po.meshbasic_frag},lambert:{uniforms:vo([No.common,No.specularmap,No.envmap,No.aomap,No.lightmap,No.emissivemap,No.fog,No.lights,{emissive:{value:new gs(0)}}]),vertexShader:Po.meshlambert_vert,fragmentShader:Po.meshlambert_frag},phong:{uniforms:vo([No.common,No.specularmap,No.envmap,No.aomap,No.lightmap,No.emissivemap,No.bumpmap,No.normalmap,No.displacementmap,No.fog,No.lights,{emissive:{value:new gs(0)},specular:{value:new gs(1118481)},shininess:{value:30}}]),vertexShader:Po.meshphong_vert,fragmentShader:Po.meshphong_frag},standard:{uniforms:vo([No.common,No.envmap,No.aomap,No.lightmap,No.emissivemap,No.bumpmap,No.normalmap,No.displacementmap,No.roughnessmap,No.metalnessmap,No.fog,No.lights,{emissive:{value:new gs(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Po.meshphysical_vert,fragmentShader:Po.meshphysical_frag},toon:{uniforms:vo([No.common,No.aomap,No.lightmap,No.emissivemap,No.bumpmap,No.normalmap,No.displacementmap,No.gradientmap,No.fog,No.lights,{emissive:{value:new gs(0)}}]),vertexShader:Po.meshtoon_vert,fragmentShader:Po.meshtoon_frag},matcap:{uniforms:vo([No.common,No.bumpmap,No.normalmap,No.displacementmap,No.fog,{matcap:{value:null}}]),vertexShader:Po.meshmatcap_vert,fragmentShader:Po.meshmatcap_frag},points:{uniforms:vo([No.points,No.fog]),vertexShader:Po.points_vert,fragmentShader:Po.points_frag},dashed:{uniforms:vo([No.common,No.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Po.linedashed_vert,fragmentShader:Po.linedashed_frag},depth:{uniforms:vo([No.common,No.displacementmap]),vertexShader:Po.depth_vert,fragmentShader:Po.depth_frag},normal:{uniforms:vo([No.common,No.bumpmap,No.normalmap,No.displacementmap,{opacity:{value:1}}]),vertexShader:Po.normal_vert,fragmentShader:Po.normal_frag},sprite:{uniforms:vo([No.sprite,No.fog]),vertexShader:Po.sprite_vert,fragmentShader:Po.sprite_frag},background:{uniforms:{uvTransform:{value:new Gi},t2D:{value:null}},vertexShader:Po.background_vert,fragmentShader:Po.background_frag},cube:{uniforms:vo([No.envmap,{opacity:{value:1}}]),vertexShader:Po.cube_vert,fragmentShader:Po.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Po.equirect_vert,fragmentShader:Po.equirect_frag},distanceRGBA:{uniforms:vo([No.common,No.displacementmap,{referencePosition:{value:new Zi},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Po.distanceRGBA_vert,fragmentShader:Po.distanceRGBA_frag},shadow:{uniforms:vo([No.lights,No.fog,{color:{value:new gs(0)},opacity:{value:1}}]),vertexShader:Po.shadow_vert,fragmentShader:Po.shadow_frag}};function Io(e,t,n,i,r){const s=new gs(0);let o,a,l=0,c=null,h=0,u=null;function d(e,t){n.buffers.color.setClear(e.r,e.g,e.b,t,r)}return{getClearColor:function(){return s},setClearColor:function(e,t){s.set(e),l=void 0!==t?t:1,d(s,l)},getClearAlpha:function(){return l},setClearAlpha:function(e){l=e,d(s,l)},render:function(n,r,p,f){let m=!0===r.isScene?r.background:null;m&&m.isTexture&&(m=t.get(m));const g=e.xr,v=g.getSession&&g.getSession();v&&"additive"===v.environmentBlendMode&&(m=null),null===m?d(s,l):m&&m.isColor&&(d(m,1),f=!0),(e.autoClear||f)&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),m&&(m.isCubeTexture||m.isWebGLCubeRenderTarget||m.isWebGLCubeRenderTargetTexture||306===m.mapping)?(void 0===a&&(a=new oo(new mo(1,1,1),new xo({name:"BackgroundCubeMaterial",uniforms:go(Do.cube.uniforms),vertexShader:Do.cube.vertexShader,fragmentShader:Do.cube.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1})),a.geometry.deleteAttribute("normal"),a.geometry.deleteAttribute("uv"),a.onBeforeRender=function(e,t,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(a.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(a)),m.isWebGLCubeRenderTarget&&(m=m.texture),a.material.uniforms.envMap.value=m,a.material.uniforms.flipEnvMap.value=m.isCubeTexture?-1:1,c===m&&h===m.version&&u===e.toneMapping||(a.material.needsUpdate=!0,c=m,h=m.version,u=e.toneMapping),n.unshift(a,a.geometry,a.material,0,0,null)):m&&m.isTexture&&(void 0===o&&(o=new oo(new Ro(2,2),new xo({name:"BackgroundMaterial",uniforms:go(Do.background.uniforms),vertexShader:Do.background.vertexShader,fragmentShader:Do.background.fragmentShader,side:0,depthTest:!1,depthWrite:!1,fog:!1})),o.geometry.deleteAttribute("normal"),Object.defineProperty(o.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(o)),o.material.uniforms.t2D.value=m,!0===m.matrixAutoUpdate&&m.updateMatrix(),o.material.uniforms.uvTransform.value.copy(m.matrix),c===m&&h===m.version&&u===e.toneMapping||(o.material.needsUpdate=!0,c=m,h=m.version,u=e.toneMapping),n.unshift(o,o.geometry,o.material,0,0,null))}}}function Oo(e,t,n,i){const r=e.getParameter(34921),s=i.isWebGL2?null:t.get("OES_vertex_array_object"),o=i.isWebGL2||null!==s,a={},l=d(null);let c=l;function h(t){return i.isWebGL2?e.bindVertexArray(t):s.bindVertexArrayOES(t)}function u(t){return i.isWebGL2?e.deleteVertexArray(t):s.deleteVertexArrayOES(t)}function d(e){const t=[],n=[],i=[];for(let e=0;e=0){const s=l[t];if(void 0!==s){const t=s.normalized,r=s.itemSize,o=n.get(s);if(void 0===o)continue;const l=o.buffer,c=o.type,h=o.bytesPerElement;if(s.isInterleavedBufferAttribute){const n=s.data,o=n.stride,u=s.offset;n&&n.isInstancedInterleavedBuffer?(m(i,n.meshPerAttribute),void 0===a._maxInstanceCount&&(a._maxInstanceCount=n.meshPerAttribute*n.count)):f(i),e.bindBuffer(34962,l),v(i,r,c,t,o*h,u*h)}else s.isInstancedBufferAttribute?(m(i,s.meshPerAttribute),void 0===a._maxInstanceCount&&(a._maxInstanceCount=s.meshPerAttribute*s.count)):f(i),e.bindBuffer(34962,l),v(i,r,c,t,0,0)}else if("instanceMatrix"===t){const t=n.get(r.instanceMatrix);if(void 0===t)continue;const s=t.buffer,o=t.type;m(i+0,1),m(i+1,1),m(i+2,1),m(i+3,1),e.bindBuffer(34962,s),e.vertexAttribPointer(i+0,4,o,!1,64,0),e.vertexAttribPointer(i+1,4,o,!1,64,16),e.vertexAttribPointer(i+2,4,o,!1,64,32),e.vertexAttribPointer(i+3,4,o,!1,64,48)}else if("instanceColor"===t){const t=n.get(r.instanceColor);if(void 0===t)continue;const s=t.buffer,o=t.type;m(i,1),e.bindBuffer(34962,s),e.vertexAttribPointer(i,3,o,!1,12,0)}else if(void 0!==h){const n=h[t];if(void 0!==n)switch(n.length){case 2:e.vertexAttrib2fv(i,n);break;case 3:e.vertexAttrib3fv(i,n);break;case 4:e.vertexAttrib4fv(i,n);break;default:e.vertexAttrib1fv(i,n)}}}}g()}(r,l,u,y),null!==x&&e.bindBuffer(34963,n.get(x).buffer))},reset:y,resetDefaultState:x,dispose:function(){y();for(const e in a){const t=a[e];for(const e in t){const n=t[e];for(const e in n)u(n[e].object),delete n[e];delete t[e]}delete a[e]}},releaseStatesOfGeometry:function(e){if(void 0===a[e.id])return;const t=a[e.id];for(const e in t){const n=t[e];for(const e in n)u(n[e].object),delete n[e];delete t[e]}delete a[e.id]},releaseStatesOfProgram:function(e){for(const t in a){const n=a[t];if(void 0===n[e.id])continue;const i=n[e.id];for(const e in i)u(i[e].object),delete i[e];delete n[e.id]}},initAttributes:p,enableAttribute:f,disableUnusedAttributes:g}}function zo(e,t,n,i){const r=i.isWebGL2;let s;this.setMode=function(e){s=e},this.render=function(t,i){e.drawArrays(s,t,i),n.update(i,s,1)},this.renderInstances=function(i,o,a){if(0===a)return;let l,c;if(r)l=e,c="drawArraysInstanced";else if(l=t.get("ANGLE_instanced_arrays"),c="drawArraysInstancedANGLE",null===l)return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");l[c](s,i,o,a),n.update(o,s,a)}}function Uo(e,t,n){let i;function r(t){if("highp"===t){if(e.getShaderPrecisionFormat(35633,36338).precision>0&&e.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";t="mediump"}return"mediump"===t&&e.getShaderPrecisionFormat(35633,36337).precision>0&&e.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}const s="undefined"!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext||"undefined"!=typeof WebGL2ComputeRenderingContext&&e instanceof WebGL2ComputeRenderingContext;let o=void 0!==n.precision?n.precision:"highp";const a=r(o);a!==o&&(console.warn("THREE.WebGLRenderer:",o,"not supported, using",a,"instead."),o=a);const l=!0===n.logarithmicDepthBuffer,c=e.getParameter(34930),h=e.getParameter(35660),u=e.getParameter(3379),d=e.getParameter(34076),p=e.getParameter(34921),f=e.getParameter(36347),m=e.getParameter(36348),g=e.getParameter(36349),v=h>0,y=s||!!t.get("OES_texture_float");return{isWebGL2:s,getMaxAnisotropy:function(){if(void 0!==i)return i;const n=t.get("EXT_texture_filter_anisotropic");return i=null!==n?e.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0,i},getMaxPrecision:r,precision:o,logarithmicDepthBuffer:l,maxTextures:c,maxVertexTextures:h,maxTextureSize:u,maxCubemapSize:d,maxAttributes:p,maxVertexUniforms:f,maxVaryings:m,maxFragmentUniforms:g,vertexTextures:v,floatFragmentTextures:y,floatVertexTextures:v&&y,maxSamples:s?e.getParameter(36183):0}}function Bo(e){const t=this;let n=null,i=0,r=!1,s=!1;const o=new Qr,a=new Gi,l={value:null,needsUpdate:!1};function c(){l.value!==n&&(l.value=n,l.needsUpdate=i>0),t.numPlanes=i,t.numIntersection=0}function h(e,n,i,r){const s=null!==e?e.length:0;let c=null;if(0!==s){if(c=l.value,!0!==r||null===c){const t=i+4*s,r=n.matrixWorldInverse;a.getNormalMatrix(r),(null===c||c.length0){const s=e.getRenderList(),o=e.getRenderTarget(),a=e.getRenderState(),l=new Mo(r.height/2);return l.fromEquirectangularTexture(e,i),t.set(i,l),e.setRenderTarget(o),e.setRenderList(s),e.setRenderState(a),n(l.texture,i.mapping)}return null}}}return i},dispose:function(){t=new WeakMap}}}function Go(e){const t={};return{has:function(n){if(void 0!==t[n])return null!==t[n];let i;switch(n){case"WEBGL_depth_texture":i=e.getExtension("WEBGL_depth_texture")||e.getExtension("MOZ_WEBGL_depth_texture")||e.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":i=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":i=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":i=e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:i=e.getExtension(n)}return t[n]=i,null!==i},get:function(e){return this.has(e)||console.warn("THREE.WebGLRenderer: "+e+" extension not supported."),t[e]}}}function ko(e,t,n,i){const r=new WeakMap,s=new WeakMap;function o(e){const a=e.target,l=r.get(a);null!==l.index&&t.remove(l.index);for(const e in l.attributes)t.remove(l.attributes[e]);a.removeEventListener("dispose",o),r.delete(a);const c=s.get(l);c&&(t.remove(c),s.delete(l)),i.releaseStatesOfGeometry(a),!0===a.isInstancedBufferGeometry&&delete a._maxInstanceCount,n.memory.geometries--}function a(e){const n=[],i=e.index,r=e.attributes.position;let o=0;if(null!==i){const e=i.array;o=i.version;for(let t=0,i=e.length;t65535?Rs:Cs)(n,1);a.version=o;const l=s.get(e);l&&t.remove(l),s.set(e,a)}return{get:function(e,t){let i=r.get(t);return i||(t.addEventListener("dispose",o),t.isBufferGeometry?i=t:t.isGeometry&&(void 0===t._bufferGeometry&&(t._bufferGeometry=(new Hs).setFromObject(e)),i=t._bufferGeometry),r.set(t,i),n.memory.geometries++,i)},update:function(e){const n=e.attributes;for(const e in n)t.update(n[e],34962);const i=e.morphAttributes;for(const e in i){const n=i[e];for(let e=0,i=n.length;e0)return e;const r=t*n;let s=ta[r];if(void 0===s&&(s=new Float32Array(r),ta[r]=s),0!==t){i.toArray(s,0);for(let i=1,r=0;i!==t;++i)r+=n,e[i].toArray(s,r)}return s}function aa(e,t){if(e.length!==t.length)return!1;for(let n=0,i=e.length;n/gm;function il(e){return e.replace(nl,rl)}function rl(e,t){const n=Po[t];if(void 0===n)throw new Error("Can not resolve #include <"+t+">");return il(n)}const sl=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,ol=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function al(e){return e.replace(ol,cl).replace(sl,ll)}function ll(e,t,n,i){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),cl(e,t,n,i)}function cl(e,t,n,i){let r="";for(let e=parseInt(t);e0?e.gammaFactor:1,p=n.isWebGL2?"":function(e){return[e.extensionDerivatives||e.envMapCubeUV||e.bumpMap||e.tangentSpaceNormalMap||e.clearcoatNormalMap||e.flatShading||"physical"===e.shaderID?"#extension GL_OES_standard_derivatives : enable":"",(e.extensionFragDepth||e.logarithmicDepthBuffer)&&e.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",e.extensionDrawBuffers&&e.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(e.extensionShaderTextureLOD||e.envMap)&&e.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter($a).join("\n")}(n),f=function(e){const t=[];for(const n in e){const i=e[n];!1!==i&&t.push("#define "+n+" "+i)}return t.join("\n")}(s),m=r.createProgram();let g,v,y=n.glslVersion?"#version "+n.glslVersion+"\n":"";n.isRawShaderMaterial?(g=[f].filter($a).join("\n"),g.length>0&&(g+="\n"),v=[p,f].filter($a).join("\n"),v.length>0&&(v+="\n")):(g=[hl(n),"#define SHADER_NAME "+n.shaderName,f,n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+d,"#define MAX_BONES "+n.maxBones,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+h:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.displacementMap&&n.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.useVertexTexture?"#define BONE_TEXTURE":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&!1===n.flatShading?"#define USE_MORPHNORMALS":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","\tattribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","\tattribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#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($a).join("\n"),v=[p,hl(n),"#define SHADER_NAME "+n.shaderName,f,n.alphaTest?"#define ALPHATEST "+n.alphaTest+(n.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+d,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+c:"",n.envMap?"#define "+h:"",n.envMap?"#define "+u:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.sheen?"#define USE_SHEEN":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor?"#define USE_COLOR":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(n.extensionShaderTextureLOD||n.envMap)&&n.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",0!==n.toneMapping?"#define TONE_MAPPING":"",0!==n.toneMapping?Po.tonemapping_pars_fragment:"",0!==n.toneMapping?Qa("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",Po.encodings_pars_fragment,n.map?Ja("mapTexelToLinear",n.mapEncoding):"",n.matcap?Ja("matcapTexelToLinear",n.matcapEncoding):"",n.envMap?Ja("envMapTexelToLinear",n.envMapEncoding):"",n.emissiveMap?Ja("emissiveMapTexelToLinear",n.emissiveMapEncoding):"",n.lightMap?Ja("lightMapTexelToLinear",n.lightMapEncoding):"",Ka("linearToOutputTexel",n.outputEncoding),n.depthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter($a).join("\n")),o=il(o),o=el(o,n),o=tl(o,n),a=il(a),a=el(a,n),a=tl(a,n),o=al(o),a=al(a),n.isWebGL2&&!0!==n.isRawShaderMaterial&&(y="#version 300 es\n",g=["#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+g,v=["#define varying in","300 es"===n.glslVersion?"":"out highp vec4 pc_fragColor;","300 es"===n.glslVersion?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+v);const x=y+v+a,_=Xa(r,35633,y+g+o),b=Xa(r,35632,x);if(r.attachShader(m,_),r.attachShader(m,b),void 0!==n.index0AttributeName?r.bindAttribLocation(m,0,n.index0AttributeName):!0===n.morphTargets&&r.bindAttribLocation(m,0,"position"),r.linkProgram(m),e.debug.checkShaderErrors){const e=r.getProgramInfoLog(m).trim(),t=r.getShaderInfoLog(_).trim(),n=r.getShaderInfoLog(b).trim();let i=!0,s=!0;if(!1===r.getProgramParameter(m,35714)){i=!1;const t=Za(r,_,"vertex"),n=Za(r,b,"fragment");console.error("THREE.WebGLProgram: shader error: ",r.getError(),"35715",r.getProgramParameter(m,35715),"gl.getProgramInfoLog",e,t,n)}else""!==e?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",e):""!==t&&""!==n||(s=!1);s&&(this.diagnostics={runnable:i,programLog:e,vertexShader:{log:t,prefix:g},fragmentShader:{log:n,prefix:v}})}let w,M;return r.deleteShader(_),r.deleteShader(b),this.getUniforms=function(){return void 0===w&&(w=new Wa(r,m)),w},this.getAttributes=function(){return void 0===M&&(M=function(e,t){const n={},i=e.getProgramParameter(t,35721);for(let r=0;r0,maxBones:w,useVertexTexture:c,morphTargets:r.morphTargets,morphNormals:r.morphNormals,maxMorphTargets:e.maxMorphTargets,maxMorphNormals:e.maxMorphNormals,numDirLights:o.directional.length,numPointLights:o.point.length,numSpotLights:o.spot.length,numRectAreaLights:o.rectArea.length,numHemiLights:o.hemi.length,numDirLightShadows:o.directionalShadowMap.length,numPointLightShadows:o.pointShadowMap.length,numSpotLightShadows:o.spotShadowMap.length,numClippingPlanes:s.numPlanes,numClipIntersection:s.numIntersection,dithering:r.dithering,shadowMapEnabled:e.shadowMap.enabled&&f.length>0,shadowMapType:e.shadowMap.type,toneMapping:r.toneMapped?e.toneMapping:0,physicallyCorrectLights:e.physicallyCorrectLights,premultipliedAlpha:r.premultipliedAlpha,alphaTest:r.alphaTest,doubleSided:2===r.side,flipSided:1===r.side,depthPacking:void 0!==r.depthPacking&&r.depthPacking,index0AttributeName:r.index0AttributeName,extensionDerivatives:r.extensions&&r.extensions.derivatives,extensionFragDepth:r.extensions&&r.extensions.fragDepth,extensionDrawBuffers:r.extensions&&r.extensions.drawBuffers,extensionShaderTextureLOD:r.extensions&&r.extensions.shaderTextureLOD,rendererExtensionFragDepth:a||n.has("EXT_frag_depth"),rendererExtensionDrawBuffers:a||n.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:a||n.has("EXT_shader_texture_lod"),customProgramCacheKey:r.customProgramCacheKey()}},getProgramCacheKey:function(t){const n=[];if(t.shaderID?n.push(t.shaderID):(n.push(t.fragmentShader),n.push(t.vertexShader)),void 0!==t.defines)for(const e in t.defines)n.push(e),n.push(t.defines[e]);if(!1===t.isRawShaderMaterial){for(let e=0;e1&&i.sort(e||fl),r.length>1&&r.sort(t||ml)}}}function vl(e){let t=new WeakMap;return{get:function(n,i){const r=t.get(n);let s;return void 0===r?(s=new gl(e),t.set(n,new WeakMap),t.get(n).set(i,s)):(s=r.get(i),void 0===s&&(s=new gl(e),r.set(i,s))),s},dispose:function(){t=new WeakMap}}}function yl(){const e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];let n;switch(t.type){case"DirectionalLight":n={direction:new Zi,color:new gs};break;case"SpotLight":n={position:new Zi,direction:new Zi,color:new gs,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new Zi,color:new gs,distance:0,decay:0};break;case"HemisphereLight":n={direction:new Zi,skyColor:new gs,groundColor:new gs};break;case"RectAreaLight":n={color:new gs,position:new Zi,halfWidth:new Zi,halfHeight:new Zi}}return e[t.id]=n,n}}}let xl=0;function _l(e,t){return(t.castShadow?1:0)-(e.castShadow?1:0)}function bl(){const e=new yl,t=function(){const e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];let n;switch(t.type){case"DirectionalLight":case"SpotLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Fi};break;case"PointLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Fi,shadowCameraNear:1,shadowCameraFar:1e3}}return e[t.id]=n,n}}}(),n={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadow:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]};for(let e=0;e<9;e++)n.probe.push(new Zi);const i=new Zi,r=new Mr,s=new Mr;return{setup:function(o,a,l){let c=0,h=0,u=0;for(let e=0;e<9;e++)n.probe[e].set(0,0,0);let d=0,p=0,f=0,m=0,g=0,v=0,y=0,x=0;const _=l.matrixWorldInverse;o.sort(_l);for(let a=0,l=o.length;a0&&(n.rectAreaLTC1=No.LTC_1,n.rectAreaLTC2=No.LTC_2),n.ambient[0]=c,n.ambient[1]=h,n.ambient[2]=u;const b=n.hash;b.directionalLength===d&&b.pointLength===p&&b.spotLength===f&&b.rectAreaLength===m&&b.hemiLength===g&&b.numDirectionalShadows===v&&b.numPointShadows===y&&b.numSpotShadows===x||(n.directional.length=d,n.spot.length=f,n.rectArea.length=m,n.point.length=p,n.hemi.length=g,n.directionalShadow.length=v,n.directionalShadowMap.length=v,n.pointShadow.length=y,n.pointShadowMap.length=y,n.spotShadow.length=x,n.spotShadowMap.length=x,n.directionalShadowMatrix.length=v,n.pointShadowMatrix.length=y,n.spotShadowMatrix.length=x,b.directionalLength=d,b.pointLength=p,b.spotLength=f,b.rectAreaLength=m,b.hemiLength=g,b.numDirectionalShadows=v,b.numPointShadows=y,b.numSpotShadows=x,n.version=xl++)},state:n}}function wl(){const e=new bl,t=[],n=[];return{init:function(){t.length=0,n.length=0},state:{lightsArray:t,shadowsArray:n,lights:e},setupLights:function(i){e.setup(t,n,i)},pushLight:function(e){t.push(e)},pushShadow:function(e){n.push(e)}}}function Ml(){let e=new WeakMap;return{get:function(t,n){let i;return!1===e.has(t)?(i=new wl,e.set(t,new WeakMap),e.get(t).set(n,i)):!1===e.get(t).has(n)?(i=new wl,e.get(t).set(n,i)):i=e.get(t).get(n),i},dispose:function(){e=new WeakMap}}}function Sl(e){xs.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.setValues(e)}function Tl(e){xs.call(this),this.type="MeshDistanceMaterial",this.referencePosition=new Zi,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.setValues(e)}Sl.prototype=Object.create(xs.prototype),Sl.prototype.constructor=Sl,Sl.prototype.isMeshDepthMaterial=!0,Sl.prototype.copy=function(e){return xs.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},Tl.prototype=Object.create(xs.prototype),Tl.prototype.constructor=Tl,Tl.prototype.isMeshDistanceMaterial=!0,Tl.prototype.copy=function(e){return xs.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};function El(e,t,n){let i=new Ao;const r=new Fi,s=new Fi,o=new Wi,a=[],l=[],c={},h={0:1,1:0,2:2},u=new xo({defines:{SAMPLE_RATE:2/8,HALF_SAMPLE_RATE:1/8},uniforms:{shadow_pass:{value:null},resolution:{value:new Fi},radius:{value:4}},vertexShader:"void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include \nvoid main() {\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy ) / resolution ) );\n\tfor ( float i = -1.0; i < 1.0 ; i += SAMPLE_RATE) {\n\t\t#ifdef HORIZONAL_PASS\n\t\t\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( i, 0.0 ) * radius ) / resolution ) );\n\t\t\tmean += distribution.x;\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\t\t#else\n\t\t\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, i ) * radius ) / resolution ) );\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\t\t#endif\n\t}\n\tmean = mean * HALF_SAMPLE_RATE;\n\tsquared_mean = squared_mean * HALF_SAMPLE_RATE;\n\tfloat std_dev = sqrt( squared_mean - mean * mean );\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}"}),d=u.clone();d.defines.HORIZONAL_PASS=1;const p=new Hs;p.setAttribute("position",new Ms(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const f=new oo(p,u),m=this;function g(n,i){const r=t.update(f);u.uniforms.shadow_pass.value=n.map.texture,u.uniforms.resolution.value=n.mapSize,u.uniforms.radius.value=n.radius,e.setRenderTarget(n.mapPass),e.clear(),e.renderBufferDirect(i,null,r,u,f,null),d.uniforms.shadow_pass.value=n.mapPass.texture,d.uniforms.resolution.value=n.mapSize,d.uniforms.radius.value=n.radius,e.setRenderTarget(n.map),e.clear(),e.renderBufferDirect(i,null,r,d,f,null)}function v(e,t,n){const i=e<<0|t<<1|n<<2;let r=a[i];return void 0===r&&(r=new Sl({depthPacking:3201,morphTargets:e,skinning:t}),a[i]=r),r}function y(e,t,n){const i=e<<0|t<<1|n<<2;let r=l[i];return void 0===r&&(r=new Tl({morphTargets:e,skinning:t}),l[i]=r),r}function x(t,n,i,r,s,o,a){let l=null,u=v,d=t.customDepthMaterial;if(!0===r.isPointLight&&(u=y,d=t.customDistanceMaterial),void 0===d){let e=!1;!0===i.morphTargets&&(e=n.morphAttributes&&n.morphAttributes.position&&n.morphAttributes.position.length>0);let r=!1;!0===t.isSkinnedMesh&&(!0===i.skinning?r=!0:console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",t));l=u(e,r,!0===t.isInstancedMesh)}else l=d;if(e.localClippingEnabled&&!0===i.clipShadows&&0!==i.clippingPlanes.length){const e=l.uuid,t=i.uuid;let n=c[e];void 0===n&&(n={},c[e]=n);let r=n[t];void 0===r&&(r=l.clone(),n[t]=r),l=r}return l.visible=i.visible,l.wireframe=i.wireframe,l.side=3===a?null!==i.shadowSide?i.shadowSide:i.side:null!==i.shadowSide?i.shadowSide:h[i.side],l.clipShadows=i.clipShadows,l.clippingPlanes=i.clippingPlanes,l.clipIntersection=i.clipIntersection,l.wireframeLinewidth=i.wireframeLinewidth,l.linewidth=i.linewidth,!0===r.isPointLight&&!0===l.isMeshDistanceMaterial&&(l.referencePosition.setFromMatrixPosition(r.matrixWorld),l.nearDistance=s,l.farDistance=o),l}function _(n,r,s,o,a){if(!1===n.visible)return;if(n.layers.test(r.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&3===a)&&(!n.frustumCulled||i.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(s.matrixWorldInverse,n.matrixWorld);const i=t.update(n),r=n.material;if(Array.isArray(r)){const t=i.groups;for(let l=0,c=t.length;ln||r.y>n)&&(r.x>n&&(s.x=Math.floor(n/p.x),r.x=s.x*p.x,u.mapSize.x=s.x),r.y>n&&(s.y=Math.floor(n/p.y),r.y=s.y*p.y,u.mapSize.y=s.y)),null===u.map&&!u.isPointLightShadow&&3===this.type){const e={minFilter:1006,magFilter:1006,format:1023};u.map=new Xi(r.x,r.y,e),u.map.texture.name=h.name+".shadowMap",u.mapPass=new Xi(r.x,r.y,e),u.camera.updateProjectionMatrix()}if(null===u.map){const e={minFilter:1003,magFilter:1003,format:1023};u.map=new Xi(r.x,r.y,e),u.map.texture.name=h.name+".shadowMap",u.camera.updateProjectionMatrix()}e.setRenderTarget(u.map),e.clear();const f=u.getViewportCount();for(let e=0;e=1):-1!==E.indexOf("OpenGL ES")&&(T=parseFloat(/^OpenGL\ ES\ ([0-9])/.exec(E)[1]),S=T>=2);let A=null,C={};const L=new Wi,R=new Wi;function P(t,n,i){const r=new Uint8Array(4),s=e.createTexture();e.bindTexture(t,s),e.texParameteri(t,10241,9728),e.texParameteri(t,10240,9728);for(let t=0;ti||e.height>i)&&(r=i/Math.max(e.width,e.height)),r<1||!0===t){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap){const i=t?Bi.floorPowerOfTwo:Math.floor,s=i(r*e.width),o=i(r*e.height);void 0===p&&(p=m(s,o));const a=n?m(s,o):p;a.width=s,a.height=o;return a.getContext("2d").drawImage(e,0,0,s,o),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+e.width+"x"+e.height+") to ("+s+"x"+o+")."),a}return"data"in e&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+e.width+"x"+e.height+")."),e}return e}function v(e){return Bi.isPowerOfTwo(e.width)&&Bi.isPowerOfTwo(e.height)}function y(e,t){return e.generateMipmaps&&t&&1003!==e.minFilter&&1006!==e.minFilter}function x(t,n,r,s){e.generateMipmap(t);i.get(n).__maxMipLevel=Math.log(Math.max(r,s))*Math.LOG2E}function _(n,i,r){if(!1===a)return i;if(null!==n){if(void 0!==e[n])return e[n];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+n+"'")}let s=i;return 6403===i&&(5126===r&&(s=33326),5131===r&&(s=33325),5121===r&&(s=33321)),6407===i&&(5126===r&&(s=34837),5131===r&&(s=34843),5121===r&&(s=32849)),6408===i&&(5126===r&&(s=34836),5131===r&&(s=34842),5121===r&&(s=32856)),33325!==s&&33326!==s&&34842!==s&&34836!==s||t.get("EXT_color_buffer_float"),s}function b(e){return 1003===e||1004===e||1005===e?9728:9729}function w(t){const n=t.target;n.removeEventListener("dispose",w),function(t){const n=i.get(t);if(void 0===n.__webglInit)return;e.deleteTexture(n.__webglTexture),i.remove(t)}(n),n.isVideoTexture&&d.delete(n),o.memory.textures--}function M(t){const n=t.target;n.removeEventListener("dispose",M),function(t){const n=i.get(t),r=i.get(t.texture);if(!t)return;void 0!==r.__webglTexture&&e.deleteTexture(r.__webglTexture);t.depthTexture&&t.depthTexture.dispose();if(t.isWebGLCubeRenderTarget)for(let t=0;t<6;t++)e.deleteFramebuffer(n.__webglFramebuffer[t]),n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer[t]);else e.deleteFramebuffer(n.__webglFramebuffer),n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer),n.__webglMultisampledFramebuffer&&e.deleteFramebuffer(n.__webglMultisampledFramebuffer),n.__webglColorRenderbuffer&&e.deleteRenderbuffer(n.__webglColorRenderbuffer),n.__webglDepthRenderbuffer&&e.deleteRenderbuffer(n.__webglDepthRenderbuffer);i.remove(t.texture),i.remove(t)}(n),o.memory.textures--}let S=0;function T(e,t){const r=i.get(e);if(e.isVideoTexture&&function(e){const t=o.render.frame;d.get(e)!==t&&(d.set(e,t),e.update())}(e),e.version>0&&r.__version!==e.version){const n=e.image;if(void 0===n)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(!1!==n.complete)return void N(r,e,t);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}n.activeTexture(33984+t),n.bindTexture(3553,r.__webglTexture)}function E(t,r){if(6!==t.image.length)return;const o=i.get(t);if(t.version>0&&o.__version!==t.version){P(o,t),n.activeTexture(33984+r),n.bindTexture(34067,o.__webglTexture),e.pixelStorei(37440,t.flipY);const i=t&&(t.isCompressedTexture||t.image[0].isCompressedTexture),l=t.image[0]&&t.image[0].isDataTexture,h=[];for(let e=0;e<6;e++)h[e]=i||l?l?t.image[e].image:t.image[e]:g(t.image[e],!1,!0,c);const u=h[0],d=v(u)||a,p=s.convert(t.format),f=s.convert(t.type),m=_(t.internalFormat,p,f);let b;if(R(34067,t,d),i){for(let e=0;e<6;e++){b=h[e].mipmaps;for(let i=0;i1||i.get(s).__currentAnisotropy)&&(e.texParameterf(n,l.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(s.anisotropy,r.getMaxAnisotropy())),i.get(s).__currentAnisotropy=s.anisotropy)}}function P(t,n){void 0===t.__webglInit&&(t.__webglInit=!0,n.addEventListener("dispose",w),t.__webglTexture=e.createTexture(),o.memory.textures++)}function N(t,i,r){let o=3553;i.isDataTexture2DArray&&(o=35866),i.isDataTexture3D&&(o=32879),P(t,i),n.activeTexture(33984+r),n.bindTexture(o,t.__webglTexture),e.pixelStorei(37440,i.flipY),e.pixelStorei(37441,i.premultiplyAlpha),e.pixelStorei(3317,i.unpackAlignment);const l=function(e){return!a&&(1001!==e.wrapS||1001!==e.wrapT||1003!==e.minFilter&&1006!==e.minFilter)}(i)&&!1===v(i.image),c=g(i.image,l,!1,h),u=v(c)||a,d=s.convert(i.format);let p,f=s.convert(i.type),m=_(i.internalFormat,d,f);R(o,i,u);const b=i.mipmaps;if(i.isDepthTexture)m=6402,a?m=1015===i.type?36012:1014===i.type?33190:1020===i.type?35056:33189:1015===i.type&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),1026===i.format&&6402===m&&1012!==i.type&&1014!==i.type&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),i.type=1012,f=s.convert(i.type)),1027===i.format&&6402===m&&(m=34041,1020!==i.type&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),i.type=1020,f=s.convert(i.type))),n.texImage2D(3553,0,m,c.width,c.height,0,d,f,null);else if(i.isDataTexture)if(b.length>0&&u){for(let e=0,t=b.length;e0&&u){for(let e=0,t=b.length;e=l&&console.warn("THREE.WebGLTextures: Trying to use "+e+" texture units while this GPU supports only "+l),S+=1,e},this.resetTextureUnits=function(){S=0},this.setTexture2D=T,this.setTexture2DArray=function(e,t){const r=i.get(e);e.version>0&&r.__version!==e.version?N(r,e,t):(n.activeTexture(33984+t),n.bindTexture(35866,r.__webglTexture))},this.setTexture3D=function(e,t){const r=i.get(e);e.version>0&&r.__version!==e.version?N(r,e,t):(n.activeTexture(33984+t),n.bindTexture(32879,r.__webglTexture))},this.setTextureCube=E,this.setTextureCubeDynamic=A,this.setupRenderTarget=function(t){const r=i.get(t),l=i.get(t.texture);t.addEventListener("dispose",M),l.__webglTexture=e.createTexture(),o.memory.textures++;const c=!0===t.isWebGLCubeRenderTarget,h=!0===t.isWebGLMultisampleRenderTarget,u=v(t)||a;if(!a||1022!==t.texture.format||1015!==t.texture.type&&1016!==t.texture.type||(t.texture.format=1023,console.warn("THREE.WebGLRenderer: Rendering to textures with RGB format is not supported. Using RGBA format instead.")),c){r.__webglFramebuffer=[];for(let t=0;t<6;t++)r.__webglFramebuffer[t]=e.createFramebuffer()}else if(r.__webglFramebuffer=e.createFramebuffer(),h)if(a){r.__webglMultisampledFramebuffer=e.createFramebuffer(),r.__webglColorRenderbuffer=e.createRenderbuffer(),e.bindRenderbuffer(36161,r.__webglColorRenderbuffer);const n=s.convert(t.texture.format),i=s.convert(t.texture.type),o=_(t.texture.internalFormat,n,i),a=z(t);e.renderbufferStorageMultisample(36161,a,o,t.width,t.height),e.bindFramebuffer(36160,r.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(36160,36064,36161,r.__webglColorRenderbuffer),e.bindRenderbuffer(36161,null),t.depthBuffer&&(r.__webglDepthRenderbuffer=e.createRenderbuffer(),I(r.__webglDepthRenderbuffer,t,!0)),e.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");if(c){n.bindTexture(34067,l.__webglTexture),R(34067,t.texture,u);for(let e=0;e<6;e++)D(r.__webglFramebuffer[e],t,36064,34069+e);y(t.texture,u)&&x(34067,t.texture,t.width,t.height),n.bindTexture(34067,null)}else n.bindTexture(3553,l.__webglTexture),R(3553,t.texture,u),D(r.__webglFramebuffer,t,36064,3553),y(t.texture,u)&&x(3553,t.texture,t.width,t.height),n.bindTexture(3553,null);t.depthBuffer&&O(t)},this.updateRenderTargetMipmap=function(e){const t=e.texture;if(y(t,v(e)||a)){const r=e.isWebGLCubeRenderTarget?34067:3553,s=i.get(t).__webglTexture;n.bindTexture(r,s),x(r,t,e.width,e.height),n.bindTexture(r,null)}},this.updateMultisampleRenderTarget=function(t){if(t.isWebGLMultisampleRenderTarget)if(a){const n=i.get(t);e.bindFramebuffer(36008,n.__webglMultisampledFramebuffer),e.bindFramebuffer(36009,n.__webglFramebuffer);const r=t.width,s=t.height;let o=16384;t.depthBuffer&&(o|=256),t.stencilBuffer&&(o|=1024),e.blitFramebuffer(0,0,r,s,0,0,r,s,o,9728),e.bindFramebuffer(36160,n.__webglMultisampledFramebuffer)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")},this.safeSetTexture2D=function(e,t){e&&e.isWebGLRenderTarget&&(!1===U&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),U=!0),e=e.texture),T(e,t)},this.safeSetTextureCube=function(e,t){e&&e.isWebGLCubeRenderTarget&&(!1===B&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),B=!0),e=e.texture),e&&e.isCubeTexture||Array.isArray(e.image)&&6===e.image.length?E(e,t):A(e,t)}}function Ll(e,t,n){const i=n.isWebGL2;return{convert:function(e){let n;if(1009===e)return 5121;if(1017===e)return 32819;if(1018===e)return 32820;if(1019===e)return 33635;if(1010===e)return 5120;if(1011===e)return 5122;if(1012===e)return 5123;if(1013===e)return 5124;if(1014===e)return 5125;if(1015===e)return 5126;if(1016===e)return i?5131:(n=t.get("OES_texture_half_float"),null!==n?n.HALF_FLOAT_OES:null);if(1021===e)return 6406;if(1022===e)return 6407;if(1023===e)return 6408;if(1024===e)return 6409;if(1025===e)return 6410;if(1026===e)return 6402;if(1027===e)return 34041;if(1028===e)return 6403;if(1029===e)return 36244;if(1030===e)return 33319;if(1031===e)return 33320;if(1032===e)return 36248;if(1033===e)return 36249;if(33776===e||33777===e||33778===e||33779===e){if(n=t.get("WEBGL_compressed_texture_s3tc"),null===n)return null;if(33776===e)return n.COMPRESSED_RGB_S3TC_DXT1_EXT;if(33777===e)return n.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(33778===e)return n.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(33779===e)return n.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(35840===e||35841===e||35842===e||35843===e){if(n=t.get("WEBGL_compressed_texture_pvrtc"),null===n)return null;if(35840===e)return n.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(35841===e)return n.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(35842===e)return n.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(35843===e)return n.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(36196===e)return n=t.get("WEBGL_compressed_texture_etc1"),null!==n?n.COMPRESSED_RGB_ETC1_WEBGL:null;if((37492===e||37496===e)&&(n=t.get("WEBGL_compressed_texture_etc"),null!==n)){if(37492===e)return n.COMPRESSED_RGB8_ETC2;if(37496===e)return n.COMPRESSED_RGBA8_ETC2_EAC}return 37808===e||37809===e||37810===e||37811===e||37812===e||37813===e||37814===e||37815===e||37816===e||37817===e||37818===e||37819===e||37820===e||37821===e||37840===e||37841===e||37842===e||37843===e||37844===e||37845===e||37846===e||37847===e||37848===e||37849===e||37850===e||37851===e||37852===e||37853===e?(n=t.get("WEBGL_compressed_texture_astc"),null!==n?e:null):36492===e?(n=t.get("EXT_texture_compression_bptc"),null!==n?e:null):1020===e?i?34042:(n=t.get("WEBGL_depth_texture"),null!==n?n.UNSIGNED_INT_24_8_WEBGL:null):void 0}}}function Rl(e){bo.call(this),this.cameras=e||[]}function Pl(){Yr.call(this),this.type="Group"}function Nl(){this._targetRay=null,this._grip=null,this._hand=null}function Dl(e,t){const n=this;let i=null,r=1,s=null,o="local-floor",a=null;const l=[],c=new Map,h=new bo;h.layers.enable(1),h.viewport=new Wi;const u=new bo;u.layers.enable(2),u.viewport=new Wi;const d=[h,u],p=new Rl;p.layers.enable(1),p.layers.enable(2);let f=null,m=null;function g(e){const t=c.get(e.inputSource);t&&t.dispatchEvent({type:e.type})}function v(){c.forEach((function(e,t){e.disconnect(t)})),c.clear(),e.setFramebuffer(null),e.setRenderTarget(e.getRenderTarget()),S.stop(),n.isPresenting=!1,n.dispatchEvent({type:"sessionend"})}function y(e){s=e,S.setContext(i),S.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}function x(e){const t=i.inputSources;for(let e=0;e0&&_e(s,e,t),o.length>0&&_e(o,e,t),!0===e.isScene&&e.onAfterRender(p,e,t),null!==y&&(X.updateRenderTargetMipmap(y),X.updateMultisampleRenderTarget(y)),j.buffers.depth.setTest(!0),j.buffers.depth.setMask(!0),j.buffers.color.setMask(!0),j.setPolygonOffset(!1),u=null,d=null},this.setFramebuffer=function(e){m!==e&&null===y&&le.bindFramebuffer(36160,e),m=e},this.getActiveCubeFace=function(){return g},this.getActiveMipmapLevel=function(){return v},this.getRenderList=function(){return u},this.setRenderList=function(e){u=e},this.getRenderState=function(){return d},this.setRenderState=function(e){d=e},this.getRenderTarget=function(){return y},this.setRenderTarget=function(e,t=0,n=0){y=e,g=t,v=n,e&&void 0===W.get(e).__webglFramebuffer&&X.setupRenderTarget(e);let i=m,r=!1;if(e){const n=W.get(e).__webglFramebuffer;e.isWebGLCubeRenderTarget?(i=n[t],r=!0):i=e.isWebGLMultisampleRenderTarget?W.get(e).__webglMultisampledFramebuffer:n,M.copy(e.viewport),S.copy(e.scissor),T=e.scissorTest}else M.copy(P).multiplyScalar(C).floor(),S.copy(N).multiplyScalar(C).floor(),T=D;if(x!==i&&(le.bindFramebuffer(36160,i),x=i),j.viewport(M),j.scissor(S),j.setScissorTest(T),r){const i=W.get(e.texture);le.framebufferTexture2D(36160,36064,34069+t,i.__webglTexture,n)}},this.readRenderTargetPixels=function(e,t,n,i,r,s,o){if(!e||!e.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let a=W.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&void 0!==o&&(a=a[o]),a){let o=!1;a!==x&&(le.bindFramebuffer(36160,a),o=!0);try{const a=e.texture,l=a.format,c=a.type;if(1023!==l&&oe.convert(l)!==le.getParameter(35739))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(!(1009===c||oe.convert(c)===le.getParameter(35738)||1015===c&&(H.isWebGL2||k.get("OES_texture_float")||k.get("WEBGL_color_buffer_float"))||1016===c&&(H.isWebGL2?k.get("EXT_color_buffer_float"):k.get("EXT_color_buffer_half_float"))))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");36053===le.checkFramebufferStatus(36160)?t>=0&&t<=e.width-i&&n>=0&&n<=e.height-r&&le.readPixels(t,n,i,r,oe.convert(l),oe.convert(c),s):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{o&&le.bindFramebuffer(36160,x)}}},this.copyFramebufferToTexture=function(e,t,n){void 0===n&&(n=0);const i=Math.pow(2,-n),r=Math.floor(t.image.width*i),s=Math.floor(t.image.height*i),o=oe.convert(t.format);X.setTexture2D(t,0),le.copyTexImage2D(3553,n,o,e.x,e.y,r,s,0),j.unbindTexture()},this.copyTextureToTexture=function(e,t,n,i){void 0===i&&(i=0);const r=t.image.width,s=t.image.height,o=oe.convert(n.format),a=oe.convert(n.type);X.setTexture2D(n,0),le.pixelStorei(37440,n.flipY),le.pixelStorei(37441,n.premultiplyAlpha),le.pixelStorei(3317,n.unpackAlignment),t.isDataTexture?le.texSubImage2D(3553,i,e.x,e.y,r,s,o,a,t.image.data):t.isCompressedTexture?le.compressedTexSubImage2D(3553,i,e.x,e.y,t.mipmaps[0].width,t.mipmaps[0].height,o,t.mipmaps[0].data):le.texSubImage2D(3553,i,e.x,e.y,o,a,t.image),0===i&&n.generateMipmaps&&le.generateMipmap(3553),j.unbindTexture()},this.initTexture=function(e){X.setTexture2D(e,0),j.unbindTexture()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}function zl(e){Ol.call(this,e)}Rl.prototype=Object.assign(Object.create(bo.prototype),{constructor:Rl,isArrayCamera:!0}),Pl.prototype=Object.assign(Object.create(Yr.prototype),{constructor:Pl,isGroup:!0}),Object.assign(Nl.prototype,{constructor:Nl,getHandSpace:function(){if(null===this._hand&&(this._hand=new Pl,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints=[],this._hand.inputState={pinching:!1},window.XRHand))for(let e=0;e<=window.XRHand.LITTLE_PHALANX_TIP;e++){const e=new Pl;e.matrixAutoUpdate=!1,e.visible=!1,this._hand.joints.push(e),this._hand.add(e)}return this._hand},getTargetRaySpace:function(){return null===this._targetRay&&(this._targetRay=new Pl,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1),this._targetRay},getGripSpace:function(){return null===this._grip&&(this._grip=new Pl,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1),this._grip},dispatchEvent:function(e){return null!==this._targetRay&&this._targetRay.dispatchEvent(e),null!==this._grip&&this._grip.dispatchEvent(e),null!==this._hand&&this._hand.dispatchEvent(e),this},disconnect:function(e){return this.dispatchEvent({type:"disconnected",data:e}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this},update:function(e,t,n){let i=null,r=null,s=null;const o=this._targetRay,a=this._grip,l=this._hand;if(e)if(l&&e.hand){s=!0;for(let i=0;i<=window.XRHand.LITTLE_PHALANX_TIP;i++)if(e.hand[i]){const r=t.getJointPose(e.hand[i],n),s=l.joints[i];null!==r&&(s.matrix.fromArray(r.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),s.jointRadius=r.radius),s.visible=null!==r;const o=l.joints[window.XRHand.INDEX_PHALANX_TIP],a=l.joints[window.XRHand.THUMB_PHALANX_TIP],c=o.position.distanceTo(a.position),h=.02,u=.005;l.inputState.pinching&&c>h+u?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!l.inputState.pinching&&c<=h-u&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}}else null!==o&&(i=t.getPose(e.targetRaySpace,n),null!==i&&(o.matrix.fromArray(i.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale))),null!==a&&e.gripSpace&&(r=t.getPose(e.gripSpace,n),null!==r&&(a.matrix.fromArray(r.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale)));return null!==o&&(o.visible=null!==i),null!==a&&(a.visible=null!==r),null!==l&&(l.visible=null!==s),this}}),Object.assign(Dl.prototype,Oi.prototype),zl.prototype=Object.assign(Object.create(Ol.prototype),{constructor:zl,isWebGL1Renderer:!0});class Ul{constructor(e,t){Object.defineProperty(this,"isFogExp2",{value:!0}),this.name="",this.color=new gs(e),this.density=void 0!==t?t:25e-5}clone(){return new Ul(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}class Bl{constructor(e,t,n){Object.defineProperty(this,"isFog",{value:!0}),this.name="",this.color=new gs(e),this.near=void 0!==t?t:1,this.far=void 0!==n?n:1e3}clone(){return new Bl(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}class Fl extends Yr{constructor(){super(),Object.defineProperty(this,"isScene",{value:!0}),this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),null!==e.background&&(this.background=e.background.clone()),null!==e.environment&&(this.environment=e.environment.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(e){const t=super.toJSON(e);return null!==this.background&&(t.object.background=this.background.toJSON(e)),null!==this.environment&&(t.object.environment=this.environment.toJSON(e)),null!==this.fog&&(t.object.fog=this.fog.toJSON()),t}}function Gl(e,t){this.array=e,this.stride=t,this.count=void 0!==e?e.length/t:0,this.usage=35044,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=Bi.generateUUID()}Object.defineProperty(Gl.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),Object.assign(Gl.prototype,{isInterleavedBuffer:!0,onUploadCallback:function(){},setUsage:function(e){return this.usage=e,this},copy:function(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this},copyAt:function(e,t,n){e*=this.stride,n*=t.stride;for(let i=0,r=this.stride;ie.far||t.push({distance:a,point:Wl.clone(),uv:cs.getUV(Wl,Kl,Ql,$l,ec,tc,nc,new Fi),face:null,object:this})},copy:function(e){return Yr.prototype.copy.call(this,e),void 0!==e.center&&this.center.copy(e.center),this.material=e.material,this}});const sc=new Zi,oc=new Zi;function ac(){Yr.call(this),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}function lc(e,t){e&&e.isGeometry&&console.error("THREE.SkinnedMesh no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."),oo.call(this,e,t),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new Mr,this.bindMatrixInverse=new Mr}ac.prototype=Object.assign(Object.create(Yr.prototype),{constructor:ac,isLOD:!0,copy:function(e){Yr.prototype.copy.call(this,e,!1);const t=e.levels;for(let e=0,n=t.length;e0){let n,i;for(n=1,i=t.length;n0){sc.setFromMatrixPosition(this.matrixWorld);const n=e.ray.origin.distanceTo(sc);this.getObjectForDistance(n).raycast(e,t)}},update:function(e){const t=this.levels;if(t.length>1){sc.setFromMatrixPosition(e.matrixWorld),oc.setFromMatrixPosition(this.matrixWorld);const n=sc.distanceTo(oc)/e.zoom;let i,r;for(t[0].object.visible=!0,i=1,r=t.length;i=t[i].distance;i++)t[i-1].object.visible=!1,t[i].object.visible=!0;for(this._currentLevel=i-1;io)continue;h.applyMatrix4(this.matrixWorld);const d=e.ray.origin.distanceTo(h);de.far||t.push({distance:d,point:c.clone().applyMatrix4(this.matrixWorld),index:i,face:null,faceIndex:null,object:this})}}else for(let n=0,i=r.length/3-1;no)continue;h.applyMatrix4(this.matrixWorld);const i=e.ray.origin.distanceTo(h);ie.far||t.push({distance:i,point:c.clone().applyMatrix4(this.matrixWorld),index:n,face:null,faceIndex:null,object:this})}}else if(n.isGeometry){const i=n.vertices,r=i.length;for(let n=0;no)continue;h.applyMatrix4(this.matrixWorld);const r=e.ray.origin.distanceTo(h);re.far||t.push({distance:r,point:c.clone().applyMatrix4(this.matrixWorld),index:n,face:null,faceIndex:null,object:this})}}},updateMorphTargets:function(){const e=this.geometry;if(e.isBufferGeometry){const t=e.morphAttributes,n=Object.keys(t);if(n.length>0){const e=t[n[0]];if(void 0!==e){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,n=e.length;t0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}});const Tc=new Zi,Ec=new Zi;function Ac(e,t){Sc.call(this,e,t),this.type="LineSegments"}function Cc(e,t){Sc.call(this,e,t),this.type="LineLoop"}function Lc(e){xs.call(this),this.type="PointsMaterial",this.color=new gs(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.morphTargets=!1,this.setValues(e)}Ac.prototype=Object.assign(Object.create(Sc.prototype),{constructor:Ac,isLineSegments:!0,computeLineDistances:function(){const e=this.geometry;if(e.isBufferGeometry)if(null===e.index){const t=e.attributes.position,n=[];for(let e=0,i=t.count;er.far)return;s.push({distance:l,distanceToRay:Math.sqrt(a),point:n,index:t,face:null,object:o})}}function zc(e,t,n,i,r,s,o,a,l){Vi.call(this,e,t,n,i,r,s,o,a,l),this.format=void 0!==o?o:1022,this.minFilter=void 0!==s?s:1006,this.magFilter=void 0!==r?r:1006,this.generateMipmaps=!1;const c=this;"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback((function t(){c.needsUpdate=!0,e.requestVideoFrameCallback(t)}))}function Uc(e,t,n,i,r,s,o,a,l,c,h,u){Vi.call(this,null,s,o,a,l,c,i,r,h,u),this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}function Bc(e,t,n,i,r,s,o,a,l){Vi.call(this,e,t,n,i,r,s,o,a,l),this.needsUpdate=!0}function Fc(e,t,n,i,r,s,o,a,l,c){if(1026!==(c=void 0!==c?c:1026)&&1027!==c)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&1026===c&&(n=1012),void 0===n&&1027===c&&(n=1020),Vi.call(this,null,i,r,s,o,a,c,n,l),this.image={width:e,height:t},this.magFilter=void 0!==o?o:1003,this.minFilter=void 0!==a?a:1003,this.flipY=!1,this.generateMipmaps=!1}Ic.prototype=Object.assign(Object.create(Yr.prototype),{constructor:Ic,isPoints:!0,copy:function(e){return Yr.prototype.copy.call(this,e),this.material=e.material,this.geometry=e.geometry,this},raycast:function(e,t){const n=this.geometry,i=this.matrixWorld,r=e.params.Points.threshold;if(null===n.boundingSphere&&n.computeBoundingSphere(),Nc.copy(n.boundingSphere),Nc.applyMatrix4(i),Nc.radius+=r,!1===e.ray.intersectsSphere(Nc))return;Rc.getInverse(i),Pc.copy(e.ray).applyMatrix4(Rc);const s=r/((this.scale.x+this.scale.y+this.scale.z)/3),o=s*s;if(n.isBufferGeometry){const r=n.index,s=n.attributes.position.array;if(null!==r){const n=r.array;for(let r=0,a=n.length;r0){const e=t[n[0]];if(void 0!==e){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,n=e.length;t0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}),zc.prototype=Object.assign(Object.create(Vi.prototype),{constructor:zc,isVideoTexture:!0,update:function(){const e=this.image;!1==="requestVideoFrameCallback"in e&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}),Uc.prototype=Object.create(Vi.prototype),Uc.prototype.constructor=Uc,Uc.prototype.isCompressedTexture=!0,Bc.prototype=Object.create(Vi.prototype),Bc.prototype.constructor=Bc,Bc.prototype.isCanvasTexture=!0,Fc.prototype=Object.create(Vi.prototype),Fc.prototype.constructor=Fc,Fc.prototype.isDepthTexture=!0;function Gc(e,t,n){fo.call(this),this.type="ParametricGeometry",this.parameters={func:e,slices:t,stacks:n},this.fromBufferGeometry(new kc(e,t,n)),this.mergeVertices()}function kc(e,t,n){Hs.call(this),this.type="ParametricBufferGeometry",this.parameters={func:e,slices:t,stacks:n};const i=[],r=[],s=[],o=[],a=1e-5,l=new Zi,c=new Zi,h=new Zi,u=new Zi,d=new Zi;e.length<3&&console.error("THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter.");const p=t+1;for(let i=0;i<=n;i++){const p=i/n;for(let n=0;n<=t;n++){const i=n/t;e(i,p,c),r.push(c.x,c.y,c.z),i-a>=0?(e(i-a,p,h),u.subVectors(c,h)):(e(i+a,p,h),u.subVectors(h,c)),p-a>=0?(e(i,p-a,h),d.subVectors(c,h)):(e(i,p+a,h),d.subVectors(h,c)),l.crossVectors(u,d).normalize(),s.push(l.x,l.y,l.z),o.push(i,p)}}for(let e=0;e.9&&o<.1&&(t<.2&&(s[e+0]+=1),n<.2&&(s[e+2]+=1),i<.2&&(s[e+4]+=1))}}()}(),this.setAttribute("position",new Ps(r,3)),this.setAttribute("normal",new Ps(r.slice(),3)),this.setAttribute("uv",new Ps(s,2)),0===i?this.computeVertexNormals():this.normalizeNormals()}}class jc extends Hc{constructor(e,t){super([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}}}class Vc extends Hc{constructor(e,t){super([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}}}class Wc extends Hc{constructor(e,t){const n=(1+Math.sqrt(5))/2;super([-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],[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}}}class Xc extends Hc{constructor(e,t){const n=(1+Math.sqrt(5))/2,i=1/n;super([-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,-i,-n,0,-i,n,0,i,-n,0,i,n,-i,-n,0,-i,n,0,i,-n,0,i,n,0,-n,0,-i,n,0,-i,-n,0,i,n,0,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}}}class qc extends Hs{constructor(e,t,n,i,r){super(),this.type="TubeBufferGeometry",this.parameters={path:e,tubularSegments:t,radius:n,radialSegments:i,closed:r},t=t||64,n=n||1,i=i||8,r=r||!1;const s=e.computeFrenetFrames(t,r);this.tangents=s.tangents,this.normals=s.normals,this.binormals=s.binormals;const o=new Zi,a=new Zi,l=new Fi;let c=new Zi;const h=[],u=[],d=[],p=[];function f(r){c=e.getPointAt(r/t,c);const l=s.normals[r],d=s.binormals[r];for(let e=0;e<=i;e++){const t=e/i*Math.PI*2,r=Math.sin(t),s=-Math.cos(t);a.x=s*l.x+r*d.x,a.y=s*l.y+r*d.y,a.z=s*l.z+r*d.z,a.normalize(),u.push(a.x,a.y,a.z),o.x=c.x+n*a.x,o.y=c.y+n*a.y,o.z=c.z+n*a.z,h.push(o.x,o.y,o.z)}}!function(){for(let e=0;e80*n){a=c=e[0],l=h=e[1];for(let t=n;tc&&(c=u),d>h&&(h=d);p=Math.max(c-a,h-l),p=0!==p?1/p:0}return $c(s,o,n,a,l,p),o};function Kc(e,t,n,i,r){let s,o;if(r===function(e,t,n,i){let r=0;for(let s=t,o=n-i;s0)for(s=t;s=t;s-=i)o=yh(s,e[s],e[s+1],o);return o&&dh(o,o.next)&&(xh(o),o=o.next),o}function Qc(e,t){if(!e)return e;t||(t=e);let n,i=e;do{if(n=!1,i.steiner||!dh(i,i.next)&&0!==uh(i.prev,i,i.next))i=i.next;else{if(xh(i),i=t=i.prev,i===i.next)break;n=!0}}while(n||i!==t);return t}function $c(e,t,n,i,r,s,o){if(!e)return;!o&&s&&function(e,t,n,i){let r=e;do{null===r.z&&(r.z=ah(r.x,r.y,t,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==e);r.prevZ.nextZ=null,r.prevZ=null,function(e){let t,n,i,r,s,o,a,l,c=1;do{for(n=e,e=null,s=null,o=0;n;){for(o++,i=n,a=0,t=0;t0||l>0&&i;)0!==a&&(0===l||!i||n.z<=i.z)?(r=n,n=n.nextZ,a--):(r=i,i=i.nextZ,l--),s?s.nextZ=r:e=r,r.prevZ=s,s=r;n=i}s.nextZ=null,c*=2}while(o>1)}(r)}(e,i,r,s);let a,l,c=e;for(;e.prev!==e.next;)if(a=e.prev,l=e.next,s?th(e,i,r,s):eh(e))t.push(a.i/n),t.push(e.i/n),t.push(l.i/n),xh(e),e=l.next,c=l.next;else if((e=l)===c){o?1===o?$c(e=nh(Qc(e),t,n),t,n,i,r,s,2):2===o&&ih(e,t,n,i,r,s):$c(Qc(e),t,n,i,r,s,1);break}}function eh(e){const t=e.prev,n=e,i=e.next;if(uh(t,n,i)>=0)return!1;let r=e.next.next;for(;r!==e.prev;){if(ch(t.x,t.y,n.x,n.y,i.x,i.y,r.x,r.y)&&uh(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function th(e,t,n,i){const r=e.prev,s=e,o=e.next;if(uh(r,s,o)>=0)return!1;const a=r.xs.x?r.x>o.x?r.x:o.x:s.x>o.x?s.x:o.x,h=r.y>s.y?r.y>o.y?r.y:o.y:s.y>o.y?s.y:o.y,u=ah(a,l,t,n,i),d=ah(c,h,t,n,i);let p=e.prevZ,f=e.nextZ;for(;p&&p.z>=u&&f&&f.z<=d;){if(p!==e.prev&&p!==e.next&&ch(r.x,r.y,s.x,s.y,o.x,o.y,p.x,p.y)&&uh(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,f!==e.prev&&f!==e.next&&ch(r.x,r.y,s.x,s.y,o.x,o.y,f.x,f.y)&&uh(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(;p&&p.z>=u;){if(p!==e.prev&&p!==e.next&&ch(r.x,r.y,s.x,s.y,o.x,o.y,p.x,p.y)&&uh(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;f&&f.z<=d;){if(f!==e.prev&&f!==e.next&&ch(r.x,r.y,s.x,s.y,o.x,o.y,f.x,f.y)&&uh(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function nh(e,t,n){let i=e;do{const r=i.prev,s=i.next.next;!dh(r,s)&&ph(r,i,i.next,s)&&gh(r,s)&&gh(s,r)&&(t.push(r.i/n),t.push(i.i/n),t.push(s.i/n),xh(i),xh(i.next),i=e=s),i=i.next}while(i!==e);return Qc(i)}function ih(e,t,n,i,r,s){let o=e;do{let e=o.next.next;for(;e!==o.prev;){if(o.i!==e.i&&hh(o,e)){let a=vh(o,e);return o=Qc(o,o.next),a=Qc(a,a.next),$c(o,t,n,i,r,s),void $c(a,t,n,i,r,s)}e=e.next}o=o.next}while(o!==e)}function rh(e,t){return e.x-t.x}function sh(e,t){if(t=function(e,t){let n=t;const i=e.x,r=e.y;let s,o=-1/0;do{if(r<=n.y&&r>=n.next.y&&n.next.y!==n.y){const e=n.x+(r-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(e<=i&&e>o){if(o=e,e===i){if(r===n.y)return n;if(r===n.next.y)return n.next}s=n.x=n.x&&n.x>=l&&i!==n.x&&ch(rs.x||n.x===s.x&&oh(s,n)))&&(s=n,u=h)),n=n.next}while(n!==a);return s}(e,t)){const n=vh(t,e);Qc(t,t.next),Qc(n,n.next)}}function oh(e,t){return uh(e.prev,e,t.prev)<0&&uh(t.next,e,e.next)<0}function ah(e,t,n,i,r){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*r)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*r)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function lh(e){let t=e,n=e;do{(t.x=0&&(e-o)*(i-a)-(n-o)*(t-a)>=0&&(n-o)*(s-a)-(r-o)*(i-a)>=0}function hh(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){let n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&ph(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&(gh(e,t)&&gh(t,e)&&function(e,t){let n=e,i=!1;const r=(e.x+t.x)/2,s=(e.y+t.y)/2;do{n.y>s!=n.next.y>s&&n.next.y!==n.y&&r<(n.next.x-n.x)*(s-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next}while(n!==e);return i}(e,t)&&(uh(e.prev,e,t.prev)||uh(e,t.prev,t))||dh(e,t)&&uh(e.prev,e,e.next)>0&&uh(t.prev,t,t.next)>0)}function uh(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function dh(e,t){return e.x===t.x&&e.y===t.y}function ph(e,t,n,i){const r=mh(uh(e,t,n)),s=mh(uh(e,t,i)),o=mh(uh(n,i,e)),a=mh(uh(n,i,t));return r!==s&&o!==a||(!(0!==r||!fh(e,n,t))||(!(0!==s||!fh(e,i,t))||(!(0!==o||!fh(n,e,i))||!(0!==a||!fh(n,t,i)))))}function fh(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function mh(e){return e>0?1:e<0?-1:0}function gh(e,t){return uh(e.prev,e,e.next)<0?uh(e,t,e.next)>=0&&uh(e,e.prev,t)>=0:uh(e,t,e.prev)<0||uh(e,e.next,t)<0}function vh(e,t){const n=new _h(e.i,e.x,e.y),i=new _h(t.i,t.x,t.y),r=e.next,s=t.prev;return e.next=t,t.prev=e,n.next=r,r.prev=n,i.next=n,n.prev=i,s.next=i,i.prev=s,i}function yh(e,t,n,i){const r=new _h(e,t,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function xh(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 _h(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}const bh={area:function(e){const t=e.length;let n=0;for(let i=t-1,r=0;r2&&e[t-1].equals(e[0])&&e.pop()}function Mh(e,t){for(let n=0;nNumber.EPSILON){const u=Math.sqrt(h),d=Math.sqrt(l*l+c*c),p=t.x-a/u,f=t.y+o/u,m=((n.x-c/d-p)*c-(n.y+l/d-f)*l)/(o*c-a*l);i=p+o*m-e.x,r=f+a*m-e.y;const g=i*i+r*r;if(g<=2)return new Fi(i,r);s=Math.sqrt(g/2)}else{let e=!1;o>Number.EPSILON?l>Number.EPSILON&&(e=!0):o<-Number.EPSILON?l<-Number.EPSILON&&(e=!0):Math.sign(a)===Math.sign(c)&&(e=!0),e?(i=-a,r=o,s=Math.sqrt(h)):(i=o,r=a,s=Math.sqrt(h/2))}return new Fi(i/s,r/s)}const P=[];for(let e=0,t=E.length,n=t-1,i=e+1;e=0;e--){const t=e/p,n=h*Math.cos(t*Math.PI/2),i=u*Math.sin(t*Math.PI/2)+d;for(let e=0,t=E.length;e=0;){const i=n;let r=n-1;r<0&&(r=e.length-1);for(let e=0,n=a+2*p;e0)&&d.push(t,r,l),(e!==n-1||a0&&v(!0),t>0&&v(!1)),this.setIndex(c),this.setAttribute("position",new Ps(h,3)),this.setAttribute("normal",new Ps(u,3)),this.setAttribute("uv",new Ps(d,2))}}class Uh extends zh{constructor(e,t,n,i,r,s,o){super(0,e,t,n,i,r,s,o),this.type="ConeBufferGeometry",this.parameters={radius:e,height:t,radialSegments:n,heightSegments:i,openEnded:r,thetaStart:s,thetaLength:o}}}class Bh extends Hs{constructor(e,t,n,i){super(),this.type="CircleBufferGeometry",this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:i},e=e||1,t=void 0!==t?Math.max(3,t):8,n=void 0!==n?n:0,i=void 0!==i?i:2*Math.PI;const r=[],s=[],o=[],a=[],l=new Zi,c=new Fi;s.push(0,0,0),o.push(0,0,1),a.push(.5,.5);for(let r=0,h=3;r<=t;r++,h+=3){const u=n+r/t*i;l.x=e*Math.cos(u),l.y=e*Math.sin(u),s.push(l.x,l.y,l.z),o.push(0,0,1),c.x=(s[h]/e+1)/2,c.y=(s[h+1]/e+1)/2,a.push(c.x,c.y)}for(let e=1;e<=t;e++)r.push(e,e+1,0);this.setIndex(r),this.setAttribute("position",new Ps(s,3)),this.setAttribute("normal",new Ps(o,3)),this.setAttribute("uv",new Ps(a,2))}}var Fh=Object.freeze({__proto__:null,WireframeGeometry:class extends Hs{constructor(e){super(),this.type="WireframeGeometry";const t=[],n=[0,0],i={},r=["a","b","c"];if(e&&e.isGeometry){const s=e.faces;for(let e=0,t=s.length;e=i)){l.push(t.times[e]);for(let n=0;ns.tracks[e].times[0]&&(a=s.tracks[e].times[0]);for(let e=0;e=i.times[u]){const e=u*l+a,t=e+l-a;d=Kh.arraySlice(i.values,e,t)}else{const e=i.createInterpolant(),t=a,n=l-a;e.evaluate(s),d=Kh.arraySlice(e.resultBuffer,t,n)}if("quaternion"===r){(new Yi).fromArray(d).normalize().conjugate().toArray(d)}const p=o.times.length;for(let e=0;e=r)break e;{const o=t[1];e=r)break t}s=n,n=0}}for(;n>>1;et;)--s;if(++s,0!==r||s!==i){r>=s&&(s=Math.max(s,1),r=s-1);const e=this.getValueSize();this.times=Kh.arraySlice(n,r,s),this.values=Kh.arraySlice(this.values,r*e,s*e)}return this},validate:function(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const n=this.times,i=this.values,r=n.length;0===r&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let s=null;for(let t=0;t!==r;t++){const i=n[t];if("number"==typeof i&&isNaN(i)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,t,i),e=!1;break}if(null!==s&&s>i){console.error("THREE.KeyframeTrack: Out of order keys.",this,t,i,s),e=!1;break}s=i}if(void 0!==i&&Kh.isTypedArray(i))for(let t=0,n=i.length;t!==n;++t){const n=i[t];if(isNaN(n)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,t,n),e=!1;break}}return e},optimize:function(){const e=Kh.arraySlice(this.times),t=Kh.arraySlice(this.values),n=this.getValueSize(),i=2302===this.getInterpolation(),r=e.length-1;let s=1;for(let o=1;o0){e[s]=e[r];for(let e=r*n,i=s*n,o=0;o!==n;++o)t[i+o]=t[e+o];++s}return s!==e.length?(this.times=Kh.arraySlice(e,0,s),this.values=Kh.arraySlice(t,0,s*n)):(this.times=e,this.values=t),this},clone:function(){const e=Kh.arraySlice(this.times,0),t=Kh.arraySlice(this.values,0),n=new(0,this.constructor)(this.name,e,t);return n.createInterpolant=this.createInterpolant,n}}),iu.prototype=Object.assign(Object.create(nu.prototype),{constructor:iu,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),ru.prototype=Object.assign(Object.create(nu.prototype),{constructor:ru,ValueTypeName:"color"}),su.prototype=Object.assign(Object.create(nu.prototype),{constructor:su,ValueTypeName:"number"}),ou.prototype=Object.assign(Object.create(Qh.prototype),{constructor:ou,interpolate_:function(e,t,n,i){const r=this.resultBuffer,s=this.sampleValues,o=this.valueSize,a=(n-t)/(i-t);let l=e*o;for(let e=l+o;l!==e;l+=4)Yi.slerpFlat(r,0,s,l-o,s,l,a);return r}}),au.prototype=Object.assign(Object.create(nu.prototype),{constructor:au,ValueTypeName:"quaternion",DefaultInterpolation:2301,InterpolantFactoryMethodLinear:function(e){return new ou(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodSmooth:void 0}),lu.prototype=Object.assign(Object.create(nu.prototype),{constructor:lu,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),cu.prototype=Object.assign(Object.create(nu.prototype),{constructor:cu,ValueTypeName:"vector"}),Object.assign(hu,{parse:function(e){const t=[],n=e.tracks,i=1/(e.fps||1);for(let e=0,r=n.length;e!==r;++e)t.push(uu(n[e]).scale(i));return new hu(e.name,e.duration,t,e.blendMode)},toJSON:function(e){const t=[],n=e.tracks,i={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let e=0,i=n.length;e!==i;++e)t.push(nu.toJSON(n[e]));return i},CreateFromMorphTargetSequence:function(e,t,n,i){const r=t.length,s=[];for(let e=0;e1){const e=s[1];let t=i[e];t||(i[e]=t=[]),t.push(n)}}const s=[];for(const e in i)s.push(hu.CreateFromMorphTargetSequence(e,i[e],t,n));return s},parseAnimation:function(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const n=function(e,t,n,i,r){if(0!==n.length){const s=[],o=[];Kh.flattenJSON(n,s,o,i),0!==s.length&&r.push(new e(t,s,o))}},i=[],r=e.name||"default",s=e.fps||30,o=e.blendMode;let a=e.length||-1;const l=e.hierarchy||[];for(let e=0;e0||0===e.search(/^data\:image\/jpeg/);r.format=i?1022:1023,r.needsUpdate=!0,void 0!==t&&t(r)}),n,i),r}}),Object.assign(Su.prototype,{getPoint:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null},getPointAt:function(e,t){const n=this.getUtoTmapping(e);return this.getPoint(n,t)},getPoints:function(e){void 0===e&&(e=5);const t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return t},getSpacedPoints:function(e){void 0===e&&(e=5);const t=[];for(let n=0;n<=e;n++)t.push(this.getPointAt(n/e));return t},getLength:function(){const 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;const t=[];let n,i=this.getPoint(0),r=0;t.push(0);for(let s=1;s<=e;s++)n=this.getPoint(s/e),r+=n.distanceTo(i),t.push(r),i=n;return this.cacheArcLengths=t,t},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(e,t){const n=this.getLengths();let i=0;const r=n.length;let s;s=t||e*n[r-1];let o,a=0,l=r-1;for(;a<=l;)if(i=Math.floor(a+(l-a)/2),o=n[i]-s,o<0)a=i+1;else{if(!(o>0)){l=i;break}l=i-1}if(i=l,n[i]===s)return i/(r-1);const c=n[i];return(i+(s-c)/(n[i+1]-c))/(r-1)},getTangent:function(e,t){let n=e-1e-4,i=e+1e-4;n<0&&(n=0),i>1&&(i=1);const r=this.getPoint(n),s=this.getPoint(i),o=t||(r.isVector2?new Fi:new Zi);return o.copy(s).sub(r).normalize(),o},getTangentAt:function(e,t){const n=this.getUtoTmapping(e);return this.getTangent(n,t)},computeFrenetFrames:function(e,t){const n=new Zi,i=[],r=[],s=[],o=new Zi,a=new Mr;for(let t=0;t<=e;t++){const n=t/e;i[t]=this.getTangentAt(n,new Zi),i[t].normalize()}r[0]=new Zi,s[0]=new Zi;let l=Number.MAX_VALUE;const c=Math.abs(i[0].x),h=Math.abs(i[0].y),u=Math.abs(i[0].z);c<=l&&(l=c,n.set(1,0,0)),h<=l&&(l=h,n.set(0,1,0)),u<=l&&n.set(0,0,1),o.crossVectors(i[0],n).normalize(),r[0].crossVectors(i[0],o),s[0].crossVectors(i[0],r[0]);for(let t=1;t<=e;t++){if(r[t]=r[t-1].clone(),s[t]=s[t-1].clone(),o.crossVectors(i[t-1],i[t]),o.length()>Number.EPSILON){o.normalize();const e=Math.acos(Bi.clamp(i[t-1].dot(i[t]),-1,1));r[t].applyMatrix4(a.makeRotationAxis(o,e))}s[t].crossVectors(i[t],r[t])}if(!0===t){let t=Math.acos(Bi.clamp(r[0].dot(r[e]),-1,1));t/=e,i[0].dot(o.crossVectors(r[0],r[e]))>0&&(t=-t);for(let n=1;n<=e;n++)r[n].applyMatrix4(a.makeRotationAxis(i[n],t*n)),s[n].crossVectors(i[n],r[n])}return{tangents:i,normals:r,binormals:s}},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this},toJSON:function(){const 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}}),Tu.prototype=Object.create(Su.prototype),Tu.prototype.constructor=Tu,Tu.prototype.isEllipseCurve=!0,Tu.prototype.getPoint=function(e,t){const n=t||new Fi,i=2*Math.PI;let r=this.aEndAngle-this.aStartAngle;const s=Math.abs(r)i;)r-=i;r0?0:(Math.floor(Math.abs(l)/r)+1)*r:0===c&&l===r-1&&(l=r-2,c=1),this.closed||l>0?o=i[(l-1)%r]:(Cu.subVectors(i[0],i[1]).add(i[0]),o=Cu);const h=i[l%r],u=i[(l+1)%r];if(this.closed||l+2i.length-2?i.length-1:s+1],h=i[s>i.length-3?i.length-1:s+2];return n.set(Du(o,a.x,l.x,c.x,h.x),Du(o,a.y,l.y,c.y,h.y)),n},Hu.prototype.copy=function(e){Su.prototype.copy.call(this,e),this.points=[];for(let t=0,n=e.points.length;t=t){const e=n[i]-t,r=this.curves[i],s=r.getLength(),o=0===s?0:1-e/s;return r.getPointAt(o)}i++}return null},getLength:function(){const 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;const e=[];let t=0;for(let n=0,i=this.curves.length;n1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t},copy:function(e){Su.prototype.copy.call(this,e),this.curves=[];for(let t=0,n=e.curves.length;t0){const e=l.getPoint(0);e.equals(this.currentPoint)||this.lineTo(e.x,e.y)}this.curves.push(l);const c=l.getPoint(1);return this.currentPoint.copy(c),this},copy:function(e){return Vu.prototype.copy.call(this,e),this.currentPoint.copy(e.currentPoint),this},toJSON:function(){const e=Vu.prototype.toJSON.call(this);return e.currentPoint=this.currentPoint.toArray(),e},fromJSON:function(e){return Vu.prototype.fromJSON.call(this,e),this.currentPoint.fromArray(e.currentPoint),this}}),Xu.prototype=Object.assign(Object.create(Wu.prototype),{constructor:Xu,getPointsHoles:function(e){const t=[];for(let n=0,i=this.holes.length;n0:i.vertexColors=e.vertexColors),void 0!==e.uniforms)for(const t in e.uniforms){const r=e.uniforms[t];switch(i.uniforms[t]={},r.type){case"t":i.uniforms[t].value=n(r.value);break;case"c":i.uniforms[t].value=(new gs).setHex(r.value);break;case"v2":i.uniforms[t].value=(new Fi).fromArray(r.value);break;case"v3":i.uniforms[t].value=(new Zi).fromArray(r.value);break;case"v4":i.uniforms[t].value=(new Wi).fromArray(r.value);break;case"m3":i.uniforms[t].value=(new Gi).fromArray(r.value);break;case"m4":i.uniforms[t].value=(new Mr).fromArray(r.value);break;default:i.uniforms[t].value=r.value}}if(void 0!==e.defines&&(i.defines=e.defines),void 0!==e.vertexShader&&(i.vertexShader=e.vertexShader),void 0!==e.fragmentShader&&(i.fragmentShader=e.fragmentShader),void 0!==e.extensions)for(const t in e.extensions)i.extensions[t]=e.extensions[t];if(void 0!==e.shading&&(i.flatShading=1===e.shading),void 0!==e.size&&(i.size=e.size),void 0!==e.sizeAttenuation&&(i.sizeAttenuation=e.sizeAttenuation),void 0!==e.map&&(i.map=n(e.map)),void 0!==e.matcap&&(i.matcap=n(e.matcap)),void 0!==e.alphaMap&&(i.alphaMap=n(e.alphaMap)),void 0!==e.bumpMap&&(i.bumpMap=n(e.bumpMap)),void 0!==e.bumpScale&&(i.bumpScale=e.bumpScale),void 0!==e.normalMap&&(i.normalMap=n(e.normalMap)),void 0!==e.normalMapType&&(i.normalMapType=e.normalMapType),void 0!==e.normalScale){let t=e.normalScale;!1===Array.isArray(t)&&(t=[t,t]),i.normalScale=(new Fi).fromArray(t)}return void 0!==e.displacementMap&&(i.displacementMap=n(e.displacementMap)),void 0!==e.displacementScale&&(i.displacementScale=e.displacementScale),void 0!==e.displacementBias&&(i.displacementBias=e.displacementBias),void 0!==e.roughnessMap&&(i.roughnessMap=n(e.roughnessMap)),void 0!==e.metalnessMap&&(i.metalnessMap=n(e.metalnessMap)),void 0!==e.emissiveMap&&(i.emissiveMap=n(e.emissiveMap)),void 0!==e.emissiveIntensity&&(i.emissiveIntensity=e.emissiveIntensity),void 0!==e.specularMap&&(i.specularMap=n(e.specularMap)),void 0!==e.envMap&&(i.envMap=n(e.envMap)),void 0!==e.envMapIntensity&&(i.envMapIntensity=e.envMapIntensity),void 0!==e.reflectivity&&(i.reflectivity=e.reflectivity),void 0!==e.refractionRatio&&(i.refractionRatio=e.refractionRatio),void 0!==e.lightMap&&(i.lightMap=n(e.lightMap)),void 0!==e.lightMapIntensity&&(i.lightMapIntensity=e.lightMapIntensity),void 0!==e.aoMap&&(i.aoMap=n(e.aoMap)),void 0!==e.aoMapIntensity&&(i.aoMapIntensity=e.aoMapIntensity),void 0!==e.gradientMap&&(i.gradientMap=n(e.gradientMap)),void 0!==e.clearcoatMap&&(i.clearcoatMap=n(e.clearcoatMap)),void 0!==e.clearcoatRoughnessMap&&(i.clearcoatRoughnessMap=n(e.clearcoatRoughnessMap)),void 0!==e.clearcoatNormalMap&&(i.clearcoatNormalMap=n(e.clearcoatNormalMap)),void 0!==e.clearcoatNormalScale&&(i.clearcoatNormalScale=(new Fi).fromArray(e.clearcoatNormalScale)),void 0!==e.transmission&&(i.transmission=e.transmission),void 0!==e.transmissionMap&&(i.transmissionMap=n(e.transmissionMap)),i},setTextures:function(e){return this.textures=e,this}});const ld=function(e){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);let t="";for(let n=0,i=e.length;n0){const o=new pu(t);r=new _u(o),r.setCrossOrigin(this.crossOrigin);for(let t=0,r=e.length;tNumber.EPSILON){if(l<0&&(n=t[s],a=-a,o=t[r],l=-l),e.yo.y)continue;if(e.y===n.y){if(e.x===n.x)return!0}else{const t=l*(e.x-n.x)-a*(e.y-n.y);if(0===t)return!0;if(t<0)continue;i=!i}}else{if(e.y!==n.y)continue;if(o.x<=e.x&&e.x<=n.x||n.x<=e.x&&e.x<=o.x)return!0}}return i}const r=bh.isClockWise,s=this.subPaths;if(0===s.length)return[];if(!0===t)return n(s);let o,a,l;const c=[];if(1===s.length)return a=s[0],l=new Xu,l.curves=a.curves,c.push(l),c;let h=!r(s[0].getPoints());h=e?!h:h;const u=[],d=[];let p,f,m=[],g=0;d[g]=void 0,m[g]=[];for(let t=0,n=s.length;t1){let e=!1;const t=[];for(let e=0,t=d.length;e0&&(e||(m=u))}for(let e=0,t=d.length;e0&&this._mixBufferRegionAdditive(n,i,this._addIndex*t,1,t);for(let e=t,r=t+t;e!==r;++e)if(n[e]!==n[e+t]){o.setValue(n,i);break}},saveOriginalState:function(){const e=this.binding,t=this.buffer,n=this.valueSize,i=n*this._origIndex;e.getValue(t,i);for(let e=n,r=i;e!==r;++e)t[e]=t[i+e%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0},restoreOriginalState:function(){const e=3*this.valueSize;this.binding.setValue(this.buffer,e)},_setAdditiveIdentityNumeric:function(){const e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let n=e;n=.5)for(let i=0;i!==r;++i)e[t+i]=e[n+i]},_slerp:function(e,t,n,i){Yi.slerpFlat(e,t,e,t,e,n,i)},_slerpAdditive:function(e,t,n,i,r){const s=this._workIndex*r;Yi.multiplyQuaternionsFlat(e,s,e,t,e,n),Yi.slerpFlat(e,t,e,t,e,s,i)},_lerp:function(e,t,n,i,r){const s=1-i;for(let o=0;o!==r;++o){const r=t+o;e[r]=e[r]*s+e[n+o]*i}},_lerpAdditive:function(e,t,n,i,r){for(let s=0;s!==r;++s){const r=t+s;e[r]=e[r]+e[n+s]*i}}});const Nd=new RegExp("[\\[\\]\\.:\\/]","g"),Dd="[^"+"\\[\\]\\.:\\/".replace("\\.","")+"]",Id=/((?:WC+[\/:])*)/.source.replace("WC","[^\\[\\]\\.:\\/]"),Od=/(WCOD+)?/.source.replace("WCOD",Dd),zd=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC","[^\\[\\]\\.:\\/]"),Ud=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC","[^\\[\\]\\.:\\/]"),Bd=new RegExp("^"+Id+Od+zd+Ud+"$"),Fd=["material","materials","bones"];function Gd(e,t,n){const i=n||kd.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,i)}function kd(e,t,n){this.path=t,this.parsedPath=n||kd.parseTrackName(t),this.node=kd.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e}Object.assign(Gd.prototype,{getValue:function(e,t){this.bind();const n=this._targetGroup.nCachedObjects_,i=this._bindings[n];void 0!==i&&i.getValue(e,t)},setValue:function(e,t){const n=this._bindings;for(let i=this._targetGroup.nCachedObjects_,r=n.length;i!==r;++i)n[i].setValue(e,t)},bind:function(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()},unbind:function(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}}),Object.assign(kd,{Composite:Gd,create:function(e,t,n){return e&&e.isAnimationObjectGroup?new kd.Composite(e,t,n):new kd(e,t,n)},sanitizeNodeName:function(e){return e.replace(/\s/g,"_").replace(Nd,"")},parseTrackName:function(e){const t=Bd.exec(e);if(!t)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(void 0!==i&&-1!==i){const e=n.nodeName.substring(i+1);-1!==Fd.indexOf(e)&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=e)}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||"."===t||-1===t||t===e.name||t===e.uuid)return e;if(e.skeleton){const n=e.skeleton.getBoneByName(t);if(void 0!==n)return n}if(e.children){const n=function(e){for(let i=0;i=r){const s=r++,c=e[s];t[c.uuid]=l,e[l]=c,t[a]=s,e[s]=o;for(let e=0,t=i;e!==t;++e){const t=n[e],i=t[s],r=t[l];t[l]=i,t[s]=r}}}this.nCachedObjects_=r},uncache:function(){const e=this._objects,t=this._indicesByUUID,n=this._bindings,i=n.length;let r=this.nCachedObjects_,s=e.length;for(let o=0,a=arguments.length;o!==a;++o){const a=arguments[o].uuid,l=t[a];if(void 0!==l)if(delete t[a],l0){const e=this._interpolants,t=this._propertyBindings;switch(this.blendMode){case 2501:for(let n=0,i=e.length;n!==i;++n)e[n].evaluate(s),t[n].accumulateAdditive(o);break;case 2500:default:for(let n=0,r=e.length;n!==r;++n)e[n].evaluate(s),t[n].accumulate(i,o)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const n=this._weightInterpolant;if(null!==n){const i=n.evaluate(e)[0];t*=i,e>n.parameterPositions[1]&&(this.stopFading(),0===i&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const n=this._timeScaleInterpolant;if(null!==n){t*=n.evaluate(e)[0],e>n.parameterPositions[1]&&(this.stopWarping(),0===t?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,n=this.loop;let i=this.time+e,r=this._loopCount;const s=2202===n;if(0===e)return-1===r?i:s&&1==(1&r)?t-i:i;if(2200===n){-1===r&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(i>=t)i=t;else{if(!(i<0)){this.time=i;break e}i=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(-1===r&&(e>=0?(r=0,this._setEndings(!0,0===this.repetitions,s)):this._setEndings(0===this.repetitions,!0,s)),i>=t||i<0){const n=Math.floor(i/t);i-=t*n,r+=Math.abs(n);const o=this.repetitions-r;if(o<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,i=e>0?t:0,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(1===o){const t=e<0;this._setEndings(t,!t,s)}else this._setEndings(!1,!1,s);this._loopCount=r,this.time=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:n})}}else this.time=i;if(s&&1==(1&r))return t-i}return i}_setEndings(e,t,n){const i=this._interpolantSettings;n?(i.endingStart=2401,i.endingEnd=2401):(i.endingStart=e?this.zeroSlopeAtStart?2401:2400:2402,i.endingEnd=t?this.zeroSlopeAtEnd?2401:2400:2402)}_scheduleFading(e,t,n){const i=this._mixer,r=i.time;let s=this._weightInterpolant;null===s&&(s=i._lendControlInterpolant(),this._weightInterpolant=s);const o=s.parameterPositions,a=s.sampleValues;return o[0]=r,a[0]=t,o[1]=r+e,a[1]=n,this}}function jd(e){this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}jd.prototype=Object.assign(Object.create(Oi.prototype),{constructor:jd,_bindAction:function(e,t){const n=e._localRoot||this._root,i=e._clip.tracks,r=i.length,s=e._propertyBindings,o=e._interpolants,a=n.uuid,l=this._bindingsByRootAndName;let c=l[a];void 0===c&&(c={},l[a]=c);for(let e=0;e!==r;++e){const r=i[e],l=r.name;let h=c[l];if(void 0!==h)s[e]=h;else{if(h=s[e],void 0!==h){null===h._cacheIndex&&(++h.referenceCount,this._addInactiveBinding(h,a,l));continue}const i=t&&t._propertyBindings[e].binding.parsedPath;h=new Pd(kd.create(n,l,i),r.ValueTypeName,r.getValueSize()),++h.referenceCount,this._addInactiveBinding(h,a,l),s[e]=h}o[e].resultBuffer=h.buffer}},_activateAction:function(e){if(!this._isActiveAction(e)){if(null===e._cacheIndex){const t=(e._localRoot||this._root).uuid,n=e._clip.uuid,i=this._actionsByClip[n];this._bindAction(e,i&&i.knownActions[0]),this._addInactiveAction(e,n,t)}const t=e._propertyBindings;for(let e=0,n=t.length;e!==n;++e){const n=t[e];0==n.useCount++&&(this._lendBinding(n),n.saveOriginalState())}this._lendAction(e)}},_deactivateAction:function(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let e=0,n=t.length;e!==n;++e){const n=t[e];0==--n.useCount&&(n.restoreOriginalState(),this._takeBackBinding(n))}this._takeBackAction(e)}},_initMemoryManager:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}},_isActiveAction:function(e){const t=e._cacheIndex;return null!==t&&t=0;--t)e[t].stop();return this},update:function(e){e*=this.timeScale;const t=this._actions,n=this._nActiveActions,i=this.time+=e,r=Math.sign(e),s=this._accuIndex^=1;for(let o=0;o!==n;++o){t[o]._update(i,e,r,s)}const o=this._bindings,a=this._nActiveBindings;for(let e=0;e!==a;++e)o[e].apply(s);return this},setTime:function(e){this.time=0;for(let e=0;e4?o=$d[r-8+4-1]:0==r&&(o=0),n.push(o);const a=1/(s-1),l=-a/2,c=1+a/2,h=[l,l,c,l,c,c,l,l,c,c,l,c],u=6,d=6,p=3,f=2,m=1,g=new Float32Array(p*d*u),v=new Float32Array(f*d*u),y=new Float32Array(m*d*u);for(let e=0;e2?0:-1,i=[t,n,0,t+2/3,n,0,t+2/3,n+1,0,t,n,0,t+2/3,n+1,0,t,n+1,0];g.set(i,p*d*e),v.set(h,f*d*e);const r=[e,e,e,e,e,e];y.set(r,m*d*e)}const x=new Hs;x.setAttribute("position",new Ms(g,p)),x.setAttribute("uv",new Ms(v,f)),x.setAttribute("faceIndex",new Ms(y,m)),e.push(x),i>4&&i--}return{_lodPlanes:e,_sizeLods:t,_sigmas:n}}()),rp=(1+Math.sqrt(5))/2,sp=1/rp;new Zi(1,1,1),new Zi(-1,1,1),new Zi(1,1,-1),new Zi(-1,1,-1),new Zi(0,rp,sp),new Zi(0,rp,-sp),new Zi(sp,0,rp),new Zi(-sp,0,rp),new Zi(rp,sp,0),new Zi(-rp,sp,0);function op(e){console.warn("THREE.Spline has been removed. Use THREE.CatmullRomCurve3 instead."),Nu.call(this,e),this.type="catmullrom"}Su.create=function(e,t){return console.log("THREE.Curve.create() has been deprecated"),e.prototype=Object.create(Su.prototype),e.prototype.constructor=e,e.prototype.getPoint=t,e},Object.assign(Vu.prototype,{createPointsGeometry:function(e){console.warn("THREE.CurvePath: .createPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");const t=this.getPoints(e);return this.createGeometry(t)},createSpacedPointsGeometry:function(e){console.warn("THREE.CurvePath: .createSpacedPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");const t=this.getSpacedPoints(e);return this.createGeometry(t)},createGeometry:function(e){console.warn("THREE.CurvePath: .createGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");const t=new fo;for(let n=0,i=e.length;nthis.max.x||e.ythis.max.y)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return void 0===t&&(console.warn("THREE.Box2: .getParameter() target is now required"),t=new Fi),t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y)}clampPoint(e,t){return void 0===t&&(console.warn("THREE.Box2: .clampPoint() target is now required"),t=new Fi),t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return Kd.copy(e).clamp(this.min,this.max).sub(e).length()}intersect(e){return this.min.max(e.min),this.max.min(e.max),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}.prototype,{center:function(e){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(e)},empty:function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(e){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},size:function(e){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.getSize(e)}}),Object.assign(Qi.prototype,{center:function(e){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(e)},empty:function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(e){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},isIntersectionSphere:function(e){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(e)},size:function(e){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(e)}}),Object.assign(fr.prototype,{empty:function(){return console.warn("THREE.Sphere: .empty() has been renamed to .isEmpty()."),this.isEmpty()}}),Ao.prototype.setFromMatrix=function(e){return console.warn("THREE.Frustum: .setFromMatrix() has been renamed to .setFromProjectionMatrix()."),this.setFromProjectionMatrix(e)},Object.assign(Bi,{random16:function(){return console.warn("THREE.Math: .random16() has been deprecated. Use Math.random() instead."),Math.random()},nearestPowerOfTwo:function(e){return console.warn("THREE.Math: .nearestPowerOfTwo() has been renamed to .floorPowerOfTwo()."),Bi.floorPowerOfTwo(e)},nextPowerOfTwo:function(e){return console.warn("THREE.Math: .nextPowerOfTwo() has been renamed to .ceilPowerOfTwo()."),Bi.ceilPowerOfTwo(e)}}),Object.assign(Gi.prototype,{flattenToArrayOffset:function(e,t){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(e,t)},multiplyVector3:function(e){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),e.applyMatrix3(this)},multiplyVector3Array:function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")},applyToBufferAttribute:function(e){return console.warn("THREE.Matrix3: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix3( matrix ) instead."),e.applyMatrix3(this)},applyToVector3Array:function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")}}),Object.assign(Mr.prototype,{extractPosition:function(e){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(e)},flattenToArrayOffset:function(e,t){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(e,t)},getPosition:function(){return console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),(new Zi).setFromMatrixColumn(this,3)},setRotationFromQuaternion:function(e){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(e)},multiplyToArray:function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")},multiplyVector3:function(e){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},multiplyVector4:function(e){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},multiplyVector3Array:function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")},rotateAxis:function(e){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),e.transformDirection(this)},crossVector:function(e){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},translate:function(){console.error("THREE.Matrix4: .translate() has been removed.")},rotateX:function(){console.error("THREE.Matrix4: .rotateX() has been removed.")},rotateY:function(){console.error("THREE.Matrix4: .rotateY() has been removed.")},rotateZ:function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")},rotateByAxis:function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},applyToBufferAttribute:function(e){return console.warn("THREE.Matrix4: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},applyToVector3Array:function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},makeFrustum:function(e,t,n,i,r,s){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(e,t,i,n,r,s)}}),Qr.prototype.isIntersectionLine=function(e){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(e)},Yi.prototype.multiplyVector3=function(e){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),e.applyQuaternion(this)},Object.assign(wr.prototype,{isIntersectionBox:function(e){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},isIntersectionPlane:function(e){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(e)},isIntersectionSphere:function(e){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(e)}}),Object.assign(cs.prototype,{area:function(){return console.warn("THREE.Triangle: .area() has been renamed to .getArea()."),this.getArea()},barycoordFromPoint:function(e,t){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),this.getBarycoord(e,t)},midpoint:function(e){return console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint()."),this.getMidpoint(e)},normal:function(e){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),this.getNormal(e)},plane:function(e){return console.warn("THREE.Triangle: .plane() has been renamed to .getPlane()."),this.getPlane(e)}}),Object.assign(cs,{barycoordFromPoint:function(e,t,n,i,r){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),cs.getBarycoord(e,t,n,i,r)},normal:function(e,t,n,i){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),cs.getNormal(e,t,n,i)}}),Object.assign(Xu.prototype,{extractAllPoints:function(e){return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(e)},extrude:function(e){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new Sh(this,e)},makeGeometry:function(e){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new Nh(this,e)}}),Object.assign(Fi.prototype,{fromAttribute:function(e,t,n){return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},distanceToManhattan:function(e){return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(e)},lengthManhattan:function(){return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(Zi.prototype,{setEulerFromRotationMatrix:function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},setEulerFromQuaternion:function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},getPositionFromMatrix:function(e){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(e)},getScaleFromMatrix:function(e){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(e)},getColumnFromMatrix:function(e,t){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(t,e)},applyProjection:function(e){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(e)},fromAttribute:function(e,t,n){return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},distanceToManhattan:function(e){return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(e)},lengthManhattan:function(){return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(Wi.prototype,{fromAttribute:function(e,t,n){return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},lengthManhattan:function(){return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(fo.prototype,{computeTangents:function(){console.error("THREE.Geometry: .computeTangents() has been removed.")},computeLineDistances:function(){console.error("THREE.Geometry: .computeLineDistances() has been removed. Use THREE.Line.computeLineDistances() instead.")},applyMatrix:function(e){return console.warn("THREE.Geometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)}}),Object.assign(Yr.prototype,{getChildByName:function(e){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(e)},renderDepth:function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},translate:function(e,t){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(t,e)},getWorldRotation:function(){console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.")},applyMatrix:function(e){return console.warn("THREE.Object3D: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)}}),Object.defineProperties(Yr.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(e){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=e}},useQuaternion:{get:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")}}}),Object.assign(oo.prototype,{setDrawMode:function(){console.error("THREE.Mesh: .setDrawMode() has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}),Object.defineProperties(oo.prototype,{drawMode:{get:function(){return console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode."),0},set:function(){console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}}),Object.defineProperties(ac.prototype,{objects:{get:function(){return console.warn("THREE.LOD: .objects has been renamed to .levels."),this.levels}}}),Object.defineProperty(uc.prototype,"useVertexTexture",{get:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")},set:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")}}),lc.prototype.initBones=function(){console.error("THREE.SkinnedMesh: initBones() has been removed.")},Object.defineProperty(Su.prototype,"__arcLengthDivisions",{get:function(){return console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions},set:function(e){console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions=e}}),bo.prototype.setLens=function(e,t){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),void 0!==t&&(this.filmGauge=t),this.setFocalLength(e)},Object.defineProperties(qu.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(e){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=e}},shadowCameraLeft:{set:function(e){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=e}},shadowCameraRight:{set:function(e){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=e}},shadowCameraTop:{set:function(e){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=e}},shadowCameraBottom:{set:function(e){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=e}},shadowCameraNear:{set:function(e){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=e}},shadowCameraFar:{set:function(e){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=e}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(e){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=e}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(e){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=e}},shadowMapHeight:{set:function(e){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=e}}}),Object.defineProperties(Ms.prototype,{length:{get:function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead."),this.array.length}},dynamic:{get:function(){return console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),35048===this.usage},set:function(){console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.setUsage(35048)}}}),Object.assign(Ms.prototype,{setDynamic:function(e){return console.warn("THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===e?35048:35044),this},copyIndicesArray:function(){console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed.")},setArray:function(){console.error("THREE.BufferAttribute: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")}}),Object.assign(Hs.prototype,{addIndex:function(e){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(e)},addAttribute:function(e,t){return console.warn("THREE.BufferGeometry: .addAttribute() has been renamed to .setAttribute()."),t&&t.isBufferAttribute||t&&t.isInterleavedBufferAttribute?"index"===e?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(t),this):this.setAttribute(e,t):(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.setAttribute(e,new Ms(arguments[1],arguments[2])))},addDrawCall:function(e,t,n){void 0!==n&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(e,t)},clearDrawCalls:function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()},computeTangents:function(){console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")},computeOffsets:function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")},removeAttribute:function(e){return console.warn("THREE.BufferGeometry: .removeAttribute() has been renamed to .deleteAttribute()."),this.deleteAttribute(e)},applyMatrix:function(e){return console.warn("THREE.BufferGeometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)}}),Object.defineProperties(Hs.prototype,{drawcalls:{get:function(){return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),this.groups}},offsets:{get:function(){return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),this.groups}}}),Object.defineProperties(hd.prototype,{maxInstancedCount:{get:function(){return console.warn("THREE.InstancedBufferGeometry: .maxInstancedCount has been renamed to .instanceCount."),this.instanceCount},set:function(e){console.warn("THREE.InstancedBufferGeometry: .maxInstancedCount has been renamed to .instanceCount."),this.instanceCount=e}}}),Object.defineProperties(qd.prototype,{linePrecision:{get:function(){return console.warn("THREE.Raycaster: .linePrecision has been deprecated. Use .params.Line.threshold instead."),this.params.Line.threshold},set:function(e){console.warn("THREE.Raycaster: .linePrecision has been deprecated. Use .params.Line.threshold instead."),this.params.Line.threshold=e}}}),Object.defineProperties(Gl.prototype,{dynamic:{get:function(){return console.warn("THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead."),35048===this.usage},set:function(e){console.warn("THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead."),this.setUsage(e)}}}),Object.assign(Gl.prototype,{setDynamic:function(e){return console.warn("THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===e?35048:35044),this},setArray:function(){console.error("THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")}}),Object.assign(Th.prototype,{getArrays:function(){console.error("THREE.ExtrudeBufferGeometry: .getArrays() has been removed.")},addShapeList:function(){console.error("THREE.ExtrudeBufferGeometry: .addShapeList() has been removed.")},addShape:function(){console.error("THREE.ExtrudeBufferGeometry: .addShape() has been removed.")}}),Object.assign(Fl.prototype,{dispose:function(){console.error("THREE.Scene: .dispose() has been removed.")}}),Object.defineProperties(Vd.prototype,{dynamic:{set:function(){console.warn("THREE.Uniform: .dynamic has been removed. Use object.onBeforeRender() instead.")}},onUpdate:{value:function(){return console.warn("THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead."),this}}}),Object.defineProperties(xs.prototype,{wrapAround:{get:function(){console.warn("THREE.Material: .wrapAround has been removed.")},set:function(){console.warn("THREE.Material: .wrapAround has been removed.")}},overdraw:{get:function(){console.warn("THREE.Material: .overdraw has been removed.")},set:function(){console.warn("THREE.Material: .overdraw has been removed.")}},wrapRGB:{get:function(){return console.warn("THREE.Material: .wrapRGB has been removed."),new gs}},shading:{get:function(){console.error("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.")},set:function(e){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===e}},stencilMask:{get:function(){return console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask},set:function(e){console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask=e}}}),Object.defineProperties(Vh.prototype,{metal:{get:function(){return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),!1},set:function(){console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")}}}),Object.defineProperties(jh.prototype,{transparency:{get:function(){return console.warn("THREE.MeshPhysicalMaterial: .transparency has been renamed to .transmission."),this.transmission},set:function(e){console.warn("THREE.MeshPhysicalMaterial: .transparency has been renamed to .transmission."),this.transmission=e}}}),Object.defineProperties(xo.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(e){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=e}}}),Object.assign(Ol.prototype,{clearTarget:function(e,t,n,i){console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."),this.setRenderTarget(e),this.clear(t,n,i)},animate:function(e){console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop()."),this.setAnimationLoop(e)},getCurrentRenderTarget:function(){return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."),this.getRenderTarget()},getMaxAnisotropy:function(){return console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."),this.capabilities.getMaxAnisotropy()},getPrecision:function(){return console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision."),this.capabilities.precision},resetGLState:function(){return console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset()."),this.state.reset()},supportsFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")},supportsHalfFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")},supportsStandardDerivatives:function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")},supportsCompressedTextureS3TC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")},supportsCompressedTexturePVRTC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")},supportsBlendMinMax:function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")},supportsVertexTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."),this.capabilities.vertexTextures},supportsInstancedArrays:function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")},enableScissorTest:function(e){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(e)},initMaterial:function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},addPrePlugin:function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},addPostPlugin:function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},updateShadowMap:function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")},setFaceCulling:function(){console.warn("THREE.WebGLRenderer: .setFaceCulling() has been removed.")},allocTextureUnit:function(){console.warn("THREE.WebGLRenderer: .allocTextureUnit() has been removed.")},setTexture:function(){console.warn("THREE.WebGLRenderer: .setTexture() has been removed.")},setTexture2D:function(){console.warn("THREE.WebGLRenderer: .setTexture2D() has been removed.")},setTextureCube:function(){console.warn("THREE.WebGLRenderer: .setTextureCube() has been removed.")},getActiveMipMapLevel:function(){return console.warn("THREE.WebGLRenderer: .getActiveMipMapLevel() is now .getActiveMipmapLevel()."),this.getActiveMipmapLevel()}}),Object.defineProperties(Ol.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=e}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=e}},shadowMapCullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")}},context:{get:function(){return console.warn("THREE.WebGLRenderer: .context has been removed. Use .getContext() instead."),this.getContext()}},vr:{get:function(){return console.warn("THREE.WebGLRenderer: .vr has been renamed to .xr"),this.xr}},gammaInput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead."),!1},set:function(){console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead.")}},gammaOutput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),!1},set:function(e){console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),this.outputEncoding=!0===e?3001:3e3}},toneMappingWhitePoint:{get:function(){return console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed."),1},set:function(){console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed.")}}}),Object.defineProperties(El.prototype,{cullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")}},renderReverseSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")}},renderSingleSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")}}}),Object.defineProperties(Xi.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(e){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=e}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(e){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=e}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(e){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=e}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(e){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=e}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(e){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=e}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(e){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=e}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(e){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=e}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(e){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=e}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(e){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=e}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(e){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=e}}}),Object.defineProperties(class extends Yr{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(e){if(void 0===e&&(e=0),!0===this.isPlaying)return void console.warn("THREE.Audio: Audio is already playing.");if(!1===this.hasPlaybackControl)return void console.warn("THREE.Audio: this Audio has no playback control.");this._startedAt=this.context.currentTime+e;const t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(!1!==this.hasPlaybackControl)return!0===this.isPlaying&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,!0===this.loop&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this;console.warn("THREE.Audio: this Audio has no playback control.")}stop(){if(!1!==this.hasPlaybackControl)return this._progress=0,this.source.stop(),this.source.onended=null,this.isPlaying=!1,this;console.warn("THREE.Audio: this Audio has no playback control.")}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;eMath.PI&&(t-=a),h<-Math.PI?h+=a:h>Math.PI&&(h-=a),m.theta=t(t+h)/2?Math.max(t,m.theta):Math.min(h,m.theta)),m.phi=Math.max(l.minPolarAngle,Math.min(l.maxPolarAngle,m.phi)),m.makeSafe(),m.radius*=v,m.radius=Math.max(l.minDistance,Math.min(l.maxDistance,m.radius)),!0===l.enableDamping?l.target.addScaledVector(y,l.dampingFactor):l.target.add(y),n.setFromSpherical(m),n.applyQuaternion(r),e.copy(l.target).add(n),l.object.lookAt(l.target),!0===l.enableDamping?(g.theta*=1-l.dampingFactor,g.phi*=1-l.dampingFactor,y.multiplyScalar(1-l.dampingFactor)):(g.set(0,0,0),y.set(0,0,0)),v=1,!!(x||s.distanceToSquared(l.object.position)>f||8*(1-o.dot(l.object.quaternion))>f)&&(l.dispatchEvent(c),s.copy(l.object.position),o.copy(l.object.quaternion),x=!1,!0)}),this.dispose=function(){l.domElement.removeEventListener("contextmenu",ee,!1),l.domElement.removeEventListener("pointerdown",X,!1),l.domElement.removeEventListener("wheel",Z,!1),l.domElement.removeEventListener("touchstart",K,!1),l.domElement.removeEventListener("touchend",$,!1),l.domElement.removeEventListener("touchmove",Q,!1),l.domElement.ownerDocument.removeEventListener("pointermove",q,!1),l.domElement.ownerDocument.removeEventListener("pointerup",Y,!1),l.domElement.removeEventListener("keydown",J,!1)};var l=this,c={type:"change"},h={type:"start"},u={type:"end"},d={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},p=d.NONE,f=1e-6,m=new Jd,g=new Jd,v=1,y=new Zi,x=!1,_=new Fi,b=new Fi,w=new Fi,M=new Fi,S=new Fi,T=new Fi,E=new Fi,A=new Fi,C=new Fi;function L(){return Math.pow(.95,l.zoomSpeed)}function R(e){g.theta-=e}function P(e){g.phi-=e}var N,D=(N=new Zi,function(e,t){N.setFromMatrixColumn(t,0),N.multiplyScalar(-e),y.add(N)}),I=function(){var e=new Zi;return function(t,n){!0===l.screenSpacePanning?e.setFromMatrixColumn(n,1):(e.setFromMatrixColumn(n,0),e.crossVectors(l.object.up,e)),e.multiplyScalar(t),y.add(e)}}(),O=function(){var e=new Zi;return function(t,n){var i=l.domElement;if(l.object.isPerspectiveCamera){var r=l.object.position;e.copy(r).sub(l.target);var s=e.length();s*=Math.tan(l.object.fov/2*Math.PI/180),D(2*t*s/i.clientHeight,l.object.matrix),I(2*n*s/i.clientHeight,l.object.matrix)}else l.object.isOrthographicCamera?(D(t*(l.object.right-l.object.left)/l.object.zoom/i.clientWidth,l.object.matrix),I(n*(l.object.top-l.object.bottom)/l.object.zoom/i.clientHeight,l.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),l.enablePan=!1)}}();function z(e){l.object.isPerspectiveCamera?v/=e:l.object.isOrthographicCamera?(l.object.zoom=Math.max(l.minZoom,Math.min(l.maxZoom,l.object.zoom*e)),l.object.updateProjectionMatrix(),x=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1)}function U(e){l.object.isPerspectiveCamera?v*=e:l.object.isOrthographicCamera?(l.object.zoom=Math.max(l.minZoom,Math.min(l.maxZoom,l.object.zoom/e)),l.object.updateProjectionMatrix(),x=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1)}function B(e){_.set(e.clientX,e.clientY)}function F(e){M.set(e.clientX,e.clientY)}function G(e){if(1==e.touches.length)_.set(e.touches[0].pageX,e.touches[0].pageY);else{var t=.5*(e.touches[0].pageX+e.touches[1].pageX),n=.5*(e.touches[0].pageY+e.touches[1].pageY);_.set(t,n)}}function k(e){if(1==e.touches.length)M.set(e.touches[0].pageX,e.touches[0].pageY);else{var t=.5*(e.touches[0].pageX+e.touches[1].pageX),n=.5*(e.touches[0].pageY+e.touches[1].pageY);M.set(t,n)}}function H(e){var t=e.touches[0].pageX-e.touches[1].pageX,n=e.touches[0].pageY-e.touches[1].pageY,i=Math.sqrt(t*t+n*n);E.set(0,i)}function j(e){if(1==e.touches.length)b.set(e.touches[0].pageX,e.touches[0].pageY);else{var t=.5*(e.touches[0].pageX+e.touches[1].pageX),n=.5*(e.touches[0].pageY+e.touches[1].pageY);b.set(t,n)}w.subVectors(b,_).multiplyScalar(l.rotateSpeed);var i=l.domElement;R(2*Math.PI*w.x/i.clientHeight),P(2*Math.PI*w.y/i.clientHeight),_.copy(b)}function V(e){if(1==e.touches.length)S.set(e.touches[0].pageX,e.touches[0].pageY);else{var t=.5*(e.touches[0].pageX+e.touches[1].pageX),n=.5*(e.touches[0].pageY+e.touches[1].pageY);S.set(t,n)}T.subVectors(S,M).multiplyScalar(l.panSpeed),O(T.x,T.y),M.copy(S)}function W(e){var t=e.touches[0].pageX-e.touches[1].pageX,n=e.touches[0].pageY-e.touches[1].pageY,i=Math.sqrt(t*t+n*n);A.set(0,i),C.set(0,Math.pow(A.y/E.y,l.zoomSpeed)),z(C.y),E.copy(A)}function X(e){if(!1!==l.enabled)switch(e.pointerType){case"mouse":!function(e){var t;switch(e.preventDefault(),l.domElement.focus?l.domElement.focus():window.focus(),e.button){case 0:t=l.mouseButtons.LEFT;break;case 1:t=l.mouseButtons.MIDDLE;break;case 2:t=l.mouseButtons.RIGHT;break;default:t=-1}switch(t){case Li:if(!1===l.enableZoom)return;!function(e){E.set(e.clientX,e.clientY)}(e),p=d.DOLLY;break;case Ci:if(e.ctrlKey||e.metaKey||e.shiftKey){if(!1===l.enablePan)return;F(e),p=d.PAN}else{if(!1===l.enableRotate)return;B(e),p=d.ROTATE}break;case Ri:if(e.ctrlKey||e.metaKey||e.shiftKey){if(!1===l.enableRotate)return;B(e),p=d.ROTATE}else{if(!1===l.enablePan)return;F(e),p=d.PAN}break;default:p=d.NONE}p!==d.NONE&&(l.domElement.ownerDocument.addEventListener("pointermove",q,!1),l.domElement.ownerDocument.addEventListener("pointerup",Y,!1),l.dispatchEvent(h))}(e)}}function q(e){if(!1!==l.enabled)switch(e.pointerType){case"mouse":!function(e){if(!1===l.enabled)return;switch(e.preventDefault(),p){case d.ROTATE:if(!1===l.enableRotate)return;!function(e){b.set(e.clientX,e.clientY),w.subVectors(b,_).multiplyScalar(l.rotateSpeed);var t=l.domElement;R(2*Math.PI*w.x/t.clientHeight),P(2*Math.PI*w.y/t.clientHeight),_.copy(b),l.update()}(e);break;case d.DOLLY:if(!1===l.enableZoom)return;!function(e){A.set(e.clientX,e.clientY),C.subVectors(A,E),C.y>0?z(L()):C.y<0&&U(L()),E.copy(A),l.update()}(e);break;case d.PAN:if(!1===l.enablePan)return;!function(e){S.set(e.clientX,e.clientY),T.subVectors(S,M).multiplyScalar(l.panSpeed),O(T.x,T.y),M.copy(S),l.update()}(e)}}(e)}}function Y(e){if(!1!==l.enabled)switch(e.pointerType){case"mouse":!function(e){if(!1===l.enabled)return;l.domElement.ownerDocument.removeEventListener("pointermove",q,!1),l.domElement.ownerDocument.removeEventListener("pointerup",Y,!1),l.dispatchEvent(u),p=d.NONE}()}}function Z(e){!1===l.enabled||!1===l.enableZoom||p!==d.NONE&&p!==d.ROTATE||(e.preventDefault(),e.stopPropagation(),l.dispatchEvent(h),function(e){e.deltaY<0?U(L()):e.deltaY>0&&z(L()),l.update()}(e),l.dispatchEvent(u))}function J(e){!1!==l.enabled&&!1!==l.enableKeys&&!1!==l.enablePan&&function(e){var t=!1;switch(e.keyCode){case l.keys.UP:O(0,l.keyPanSpeed),t=!0;break;case l.keys.BOTTOM:O(0,-l.keyPanSpeed),t=!0;break;case l.keys.LEFT:O(l.keyPanSpeed,0),t=!0;break;case l.keys.RIGHT:O(-l.keyPanSpeed,0),t=!0}t&&(e.preventDefault(),l.update())}(e)}function K(e){if(!1!==l.enabled){switch(e.preventDefault(),e.touches.length){case 1:switch(l.touches.ONE){case Pi:if(!1===l.enableRotate)return;G(e),p=d.TOUCH_ROTATE;break;case Ni:if(!1===l.enablePan)return;k(e),p=d.TOUCH_PAN;break;default:p=d.NONE}break;case 2:switch(l.touches.TWO){case Di:if(!1===l.enableZoom&&!1===l.enablePan)return;!function(e){l.enableZoom&&H(e),l.enablePan&&k(e)}(e),p=d.TOUCH_DOLLY_PAN;break;case Ii:if(!1===l.enableZoom&&!1===l.enableRotate)return;!function(e){l.enableZoom&&H(e),l.enableRotate&&G(e)}(e),p=d.TOUCH_DOLLY_ROTATE;break;default:p=d.NONE}break;default:p=d.NONE}p!==d.NONE&&l.dispatchEvent(h)}}function Q(e){if(!1!==l.enabled)switch(e.preventDefault(),e.stopPropagation(),p){case d.TOUCH_ROTATE:if(!1===l.enableRotate)return;j(e),l.update();break;case d.TOUCH_PAN:if(!1===l.enablePan)return;V(e),l.update();break;case d.TOUCH_DOLLY_PAN:if(!1===l.enableZoom&&!1===l.enablePan)return;!function(e){l.enableZoom&&W(e),l.enablePan&&V(e)}(e),l.update();break;case d.TOUCH_DOLLY_ROTATE:if(!1===l.enableZoom&&!1===l.enableRotate)return;!function(e){l.enableZoom&&W(e),l.enableRotate&&j(e)}(e),l.update();break;default:p=d.NONE}}function $(e){!1!==l.enabled&&(l.dispatchEvent(u),p=d.NONE)}function ee(e){!1!==l.enabled&&e.preventDefault()}l.domElement.addEventListener("contextmenu",ee,!1),l.domElement.addEventListener("pointerdown",X,!1),l.domElement.addEventListener("wheel",Z,!1),l.domElement.addEventListener("touchstart",K,!1),l.domElement.addEventListener("touchend",$,!1),l.domElement.addEventListener("touchmove",Q,!1),l.domElement.addEventListener("keydown",J,!1),-1===l.domElement.tabIndex&&(l.domElement.tabIndex=0),this.update()};(ap.prototype=Object.create(Oi.prototype)).constructor=ap;var lp=function(e,t){ap.call(this,e,t),this.screenSpacePanning=!1,this.mouseButtons.LEFT=Ri,this.mouseButtons.RIGHT=Ci,this.touches.ONE=Ni,this.touches.TWO=Ii};function cp(){const e={canvas:null,antialias:!0,alpha:!1,autoClear:!0,orbit_ctrl:!1,mouse_move:!1,mouse_raycast:!1,resize:"window",width:0,height:0},t={width:0,height:0,wWidth:0,wHeight:0,ratio:0};let n=[],i=[],r=[];const s=new Fi,o=new Zi,a=new Qr(new Zi(0,0,1),0),l=new qd,c={conf:e,renderer:null,camera:null,cameraCtrl:null,materials:{},scene:null,size:t,mouse:s,mouseV3:o,init:function(t){t&&Object.entries(t).forEach(([t,n])=>{e[t]=n});if(!c.scene)return void console.error("Missing Scene");if(!c.camera)return void console.error("Missing Camera");c.renderer=new Ol({canvas:e.canvas,antialias:e.antialias,alpha:e.alpha}),c.renderer.autoClear=e.autoClear,e.orbit_ctrl&&(c.orbitCtrl=new ap(c.camera,c.renderer.domElement),e.orbit_ctrl instanceof Object&&Object.entries(e.orbit_ctrl).forEach(([e,t])=>{c.orbitCtrl[e]=t}));e.width&&e.height?f(e.width,e.height):e.resize&&(p(),window.addEventListener("resize",p));e.mouse_move&&("body"===e.mouse_move?c.mouse_move_element=document.body:c.mouse_move_element=c.renderer.domElement,c.mouse_move_element.addEventListener("mousemove",h),c.mouse_move_element.addEventListener("mouseleave",u));return n.forEach(e=>e()),!0},dispose:function(){r=[],window.removeEventListener("resize",p),c.mouse_move_element&&(c.mouse_move_element.removeEventListener("mousemove",h),c.mouse_move_element.removeEventListener("mouseleave",u));c.orbitCtrl&&c.orbitCtrl.dispose();this.renderer.dispose()},render:function(){c.orbitCtrl&&c.orbitCtrl.update();r.forEach(e=>e()),c.renderer.render(c.scene,c.camera)},renderC:function(){c.orbitCtrl&&c.orbitCtrl.update();r.forEach(e=>e()),c.composer.render()},setSize:f,onAfterInit:function(e){n.push(e)},onAfterResize:function(e){i.push(e)},offAfterResize:function(e){i=i.filter(t=>t!==e)},onBeforeRender:function(e){r.push(e)},offBeforeRender:function(e){r=r.filter(t=>t!==e)}};function h(e){s.x=e.clientX/t.width*2-1,s.y=-e.clientY/t.height*2+1,d()}function u(e){s.x=0,s.y=0,d()}function d(){e.mouse_raycast&&(c.camera.getWorldDirection(a.normal),a.normal.normalize(),l.setFromCamera(s,c.camera),l.ray.intersectPlane(a,o))}function p(){"window"===e.resize?f(window.innerWidth,window.innerHeight):f(e.resize.clientWidth,e.resize.clientHeight),i.forEach(e=>e())}function f(e,n){t.width=e,t.height=n,t.ratio=e/n,c.renderer.setSize(e,n,!1),c.camera.aspect=t.ratio,c.camera.updateProjectionMatrix(),c.composer&&c.composer.setSize(e,n);const i=function(){const e=c.camera.fov*Math.PI/180,t=2*Math.tan(e/2)*Math.abs(c.camera.position.z);return[t*c.camera.aspect,t]}();t.wWidth=i[0],t.wHeight=i[1]}return c}(lp.prototype=Object.create(Oi.prototype)).constructor=lp;var hp={props:{antialias:{type:Boolean,default:!0},alpha:{type:Boolean,default:!1},autoClear:{type:Boolean,default:!0},shadow:{type:Boolean,default:!1},orbitCtrl:{type:[Boolean,Object],default:!1},mouseMove:{type:[Boolean,String],default:!1},mouseRaycast:{type:Boolean,default:!1},resize:{type:[Boolean,String,Element],default:"window"},width:String,height:String},setup:()=>({three:cp(),raf:!0,onMountedCallbacks:[]}),provide(){return{three:this.three,rendererComponent:this}},mounted(){const e={canvas:this.$refs.canvas,antialias:this.antialias,alpha:this.alpha,autoClear:this.autoClear,orbit_ctrl:this.orbitCtrl,mouse_move:this.mouseMove,mouse_raycast:this.mouseRaycast,resize:this.resize,width:this.width,height:this.height};this.three.init(e)&&(this.three.renderer.shadowMap.enabled=this.shadow,this.three.composer?this.animateC():this.animate()),this.onMountedCallbacks.forEach(e=>e())},beforeUnmount(){this.raf=!1,this.three.dispose()},methods:{onMounted(e){this.onMountedCallbacks.push(e)},onBeforeRender(e){this.three.onBeforeRender(e)},onAfterResize(e){this.three.onAfterResize(e)},animate(){this.raf&&requestAnimationFrame(this.animate),this.three.render()},animateC(){this.raf&&requestAnimationFrame(this.animateC),this.three.renderC()}},render(){return function(e,t,n){const i=arguments.length;return 2===i?S(t)&&!_(t)?Gt(t)?Vt(e,null,[t]):Vt(e,t):Vt(e,null,t):(i>3?n=Array.prototype.slice.call(arguments,2):3===i&&Gt(n)&&(n=[n]),Vt(e,t,n))}("canvas",{ref:"canvas"},this.$slots.default())}};function up(e,t){t instanceof Object&&Object.entries(t).forEach(([t,n])=>{e[t]=n})}function dp(e,t){const n={};return Object.entries(e).forEach(([e,i])=>{(!t||t&&!t.includes(e))&&(n[e]=i)}),n}function pp(e,t,n){return e+(t-e)*(n=(n=n<0?0:n)>1?1:n)}function fp(e,t,n){return en?n:e}function mp(e,t,n){if(e[t]){const i=function(e,t){return new Xe(e,t)}(e,t);up(n,i.value),On(i,()=>{up(n,i.value)},{deep:!0})}}var gp={inject:["three"],props:{aspect:{type:Number,default:1},far:{type:Number,default:2e3},fov:{type:Number,default:50},near:{type:Number,default:.1},position:{type:[Object,Zi],default:{x:0,y:0,z:0}}},created(){this.camera=new bo(this.fov,this.aspect,this.near,this.far),mp(this,"position",this.camera.position),["aspect","far","fov","near"].forEach(e=>{On(()=>this[e],()=>{this.camera[e]=this[e],this.camera.updateProjectionMatrix()})}),this.three.camera=this.camera},render:()=>[],__hmrId:"PerspectiveCamera"},vp={inject:["three"],props:{id:String,background:[String,Number]},setup(e){const t=new Fl;return e.background&&(t.background=new gs(e.background)),On(()=>e.background,e=>{t.background=new gs(e)}),{scene:t}},provide(){return{scene:this.scene}},mounted(){this.three.scene||(this.three.scene=this.scene)},methods:{},render(){return this.$slots.default?this.$slots.default():[]}},yp={inject:["three"],emits:["loaded"],props:{src:String,onLoad:Function,onProgress:Function,onError:Function},created(){this.createTexture(),On(()=>this.src,this.refreshTexture)},unmounted(){this.texture.dispose()},methods:{createTexture(){this.texture=(new Mu).load(this.src,this.onLoaded,this.onProgress,this.onError)},refreshTexture(){this.createTexture()},onLoaded(){this.onLoad&&this.onLoad(),this.$emit("loaded")}},render:()=>[]},xp={inject:["three"],emits:["loaded"],props:{path:String,urls:{type:Array,default:["px.jpg","nx.jpg","py.jpg","ny.jpg","pz.jpg","nz.jpg"]},onLoad:Function,onProgress:Function,onError:Function},created(){this.createTexture(),On(()=>this.path,this.refreshTexture),On(()=>this.urls,this.refreshTexture)},unmounted(){this.texture.dispose()},methods:{createTexture(){this.texture=(new bu).setPath(this.path).load(this.urls,this.onLoaded,this.onProgress,this.onError)},refreshTexture(){this.createTexture()},onLoaded(){this.onLoad&&this.onLoad(),this.$emit("loaded")}},render:()=>[]},_p={emits:["ready"],inject:["mesh"],props:{rotateX:Number,rotateY:Number,rotateZ:Number},created(){this.mesh||console.error("Missing parent Mesh"),this.watchProps=[],Object.entries(this.$props).forEach(e=>this.watchProps.push(e[0]))},beforeMount(){this.createGeometry(),this.rotateGeometry(),this.mesh.setGeometry(this.geometry)},mounted(){this.addWatchers()},unmounted(){this.geometry.dispose()},methods:{rotateGeometry(){this.rotateX&&this.geometry.rotateX(this.rotateX),this.rotateY&&this.geometry.rotateY(this.rotateY),this.rotateZ&&this.geometry.rotateZ(this.rotateZ)},addWatchers(){this.watchProps.forEach(e=>{On(()=>this[e],()=>{this.refreshGeometry()})})},refreshGeometry(){const e=this.geometry;this.createGeometry(),this.rotateGeometry(),this.mesh.setGeometry(this.geometry),e.dispose()}},render:()=>[]},bp={extends:_p,props:{size:Number,width:{type:Number,default:1},height:{type:Number,default:1},depth:{type:Number,default:1},widthSegments:{type:Number,default:1},heightSegments:{type:Number,default:1},depthSegments:{type:Number,default:1}},methods:{createGeometry(){let e=this.width,t=this.height,n=this.depth;this.size&&(e=this.size,t=this.size,n=this.size),this.geometry=new mo(e,t,n,this.widthSegments,this.heightSegments,this.depthSegments)}}},wp={extends:_p,props:{radius:{type:Number,default:1},segments:{type:Number,default:8},thetaStart:{type:Number,default:0},thetaLength:{type:Number,default:2*Math.PI}},methods:{createGeometry(){this.geometry=new Bh(this.radius,this.segments,this.thetaStart,this.thetaLength)}}},Mp={extends:_p,props:{radius:{type:Number,default:1},height:{type:Number,default:1},radialSegments:{type:Number,default:8},heightSegments:{type:Number,default:1},openEnded:{type:Boolean,default:!1},thetaStart:{type:Number,default:0},thetaLength:{type:Number,default:2*Math.PI}},methods:{createGeometry(){this.geometry=new Uh(this.radius,this.height,this.radialSegments,this.heightSegments,this.openEnded,this.thetaStart,this.thetaLength)}}},Sp={extends:_p,props:{radiusTop:{type:Number,default:1},radiusBottom:{type:Number,default:1},height:{type:Number,default:1},radialSegments:{type:Number,default:8},heightSegments:{type:Number,default:1},openEnded:{type:Boolean,default:!1},thetaStart:{type:Number,default:0},thetaLength:{type:Number,default:2*Math.PI}},methods:{createGeometry(){this.geometry=new zh(this.radiusTop,this.radiusBottom,this.height,this.radialSegments,this.heightSegments,this.openEnded,this.thetaStart,this.thetaLength)}}},Tp={extends:_p,props:{radius:{type:Number,default:1},detail:{type:Number,default:0}},methods:{createGeometry(){this.geometry=new Xc(this.radius,this.detail)}}},Ep={extends:_p,props:{radius:{type:Number,default:1},detail:{type:Number,default:0}},methods:{createGeometry(){this.geometry=new Wc(this.radius,this.detail)}}},Ap={extends:_p,props:{points:Array,segments:{type:Number,default:12},phiStart:{type:Number,default:0},phiLength:{type:Number,default:2*Math.PI}},methods:{createGeometry(){this.geometry=new Ph(this.points,this.segments,this.phiStart,this.phiLength)}}},Cp={extends:_p,props:{radius:{type:Number,default:1},detail:{type:Number,default:0}},methods:{createGeometry(){this.geometry=new Vc(this.radius,this.detail)}}},Lp={extends:_p,props:{vertices:Array,indices:Array,radius:{type:Number,default:1},detail:{type:Number,default:0}},methods:{createGeometry(){this.geometry=new Hc(this.vertices,this.indices,this.radius,this.detail)}}},Rp={extends:_p,props:{innerRadius:{type:Number,default:.5},outerRadius:{type:Number,default:1},thetaSegments:{type:Number,default:8},phiSegments:{type:Number,default:1},thetaStart:{type:Number,default:0},thetaLength:{type:Number,default:2*Math.PI}},methods:{createGeometry(){this.geometry=new Rh(this.innerRadius,this.outerRadius,this.thetaSegments,this.phiSegments,this.thetaStart,this.thetaLength)}}},Pp={extends:_p,props:{radius:{type:Number,default:1},widthSegments:{type:Number,default:12},heightSegments:{type:Number,default:12}},methods:{createGeometry(){this.geometry=new Lh(this.radius,this.widthSegments,this.heightSegments)}}},Np={extends:_p,props:{radius:{type:Number,default:1},detail:{type:Number,default:0}},methods:{createGeometry(){this.geometry=new jc(this.radius,this.detail)}}},Dp={extends:_p,props:{radius:{type:Number,default:1},tube:{type:Number,default:.4},radialSegments:{type:Number,default:8},tubularSegments:{type:Number,default:6},arc:{type:Number,default:2*Math.PI}},methods:{createGeometry(){this.geometry=new Zc(this.radius,this.tube,this.radialSegments,this.tubularSegments,this.arc)}}},Ip={extends:_p,props:{radius:{type:Number,default:1},tube:{type:Number,default:.4},radialSegments:{type:Number,default:64},tubularSegments:{type:Number,default:8},p:{type:Number,default:2},q:{type:Number,default:3}},methods:{createGeometry(){this.geometry=new Yc(this.radius,this.tube,this.radialSegments,this.tubularSegments,this.p,this.q)}}},Op={extends:_p,props:{path:Su,tubularSegments:{type:Number,default:64},radius:{type:Number,default:1},radiusSegments:{type:Number,default:8},closed:{type:Boolean,default:!1}},methods:{createGeometry(){this.geometry=new qc(this.path,this.tubularSegments,this.radius,this.radiusSegments,this.closed)}}},zp={inject:["scene"],props:{color:{type:String,default:"#ffffff"},intensity:{type:Number,default:1},castShadow:{type:Boolean,default:!1},shadowMapSize:Object,position:Object},mounted(){mp(this,"position",this.light.position),this.light.target&&mp(this,"target",this.light.target.position),this.light.shadow&&(this.light.castShadow=this.castShadow,up(this.light.shadow.mapSize,this.shadowMapSize)),["color","intensity","castShadow"].forEach(e=>{On(()=>this[e],()=>{"color"===e?this.light.color=new gs(this.color):this.light[e]=this[e]})}),this.scene.add(this.light),this.light.target&&this.scene.add(this.light.target)},unmounted(){this.scene.remove(this.light)},render:()=>[],__hmrId:"Light"},Up={extends:zp,created(){this.light=new id(this.color,this.intensity)},__hmrId:"AmbientLight"},Bp={extends:zp,props:{target:Object},created(){this.light=new nd(this.color,this.intensity)},__hmrId:"DirectionalLight"},Fp={extends:zp,props:{distance:{type:Number,default:0},decay:{type:Number,default:1}},created(){this.light=new $u(this.color,this.intensity,this.distance,this.decay)},__hmrId:"PointLight"},Gp={extends:zp,props:{angle:{type:Number,default:Math.PI/3},decay:{type:Number,default:1},distance:{type:Number,default:0},penumbra:{type:Number,default:0},target:Object},created(){this.light=new Ku(this.color,this.intensity,this.distance,this.angle,this.penumbra,this.decay),["angle","decay","distance","penumbra"].forEach(e=>{On(()=>this[e],()=>{this.light[e]=this[e]})})},__hmrId:"SpotLight"},kp={inject:["three","mesh"],props:{id:String,color:{type:[String,Number],default:"#ffffff"},depthTest:{type:Boolean,default:!0},depthWrite:{type:Boolean,default:!0},flatShading:Boolean,fog:{type:Boolean,default:!0},opacity:{type:Number,default:1},side:{type:Number,default:0},transparent:Boolean,vertexColors:Boolean},provide(){return{material:this}},beforeMount(){this.createMaterial(),this.id&&(this.three.materials[this.id]=this.material),this.mesh.setMaterial(this.material)},mounted(){this._addWatchers(),this.addWatchers&&this.addWatchers()},unmounted(){this.material.dispose(),this.id&&delete this.three.materials[this.id]},methods:{setMap(e){this.material.map=e,this.material.needsUpdate=!0},setEnvMap(e){this.material.envMap=e,this.material.needsUpdate=!0},_addWatchers(){["color","depthTest","depthWrite","fog","opacity","side","transparent"].forEach(e=>{On(()=>this[e],()=>{"color"===e?this.material.color.set(this.color):this.material[e]=this[e]})})}},render(){return this.$slots.default?this.$slots.default():[]},__hmrId:"Material"},Hp={extends:kp,methods:{createMaterial(){this.material=new _s(dp(this.$props,["id"]))}},__hmrId:"BasicMaterial"},jp={extends:kp,methods:{createMaterial(){this.material=new qh(dp(this.$props,["id"]))}},__hmrId:"LambertMaterial"},Vp={extends:kp,methods:{createMaterial(){this.material=new Vh(dp(this.$props,["id"]))}},__hmrId:"PhongMaterial"},Wp={extends:kp,props:{emissive:{type:[Number,String],default:0},emissiveIntensity:{type:Number,default:1},metalness:{type:Number,default:0},roughness:{type:Number,default:1}},methods:{createMaterial(){this.material=new Hh(dp(this.$props,["id"]))},addWatchers(){["emissive","emissiveIntensity","metalness","roughness"].forEach(e=>{On(()=>this[e],t=>{"emissive"===e?this.material.emissive=new gs(t):this.material[e]=t})})}},__hmrId:"StandardMaterial"},Xp={extends:Wp,methods:{createMaterial(){this.material=new jh(dp(this.$props,["id"]))}},__hmrId:"PhysicalMaterial"};const qp=Po.meshphong_frag.slice(0,Po.meshphong_frag.indexOf("void main() {")),Yp=Po.meshphong_frag.slice(Po.meshphong_frag.indexOf("void main() {")),Zp={uniforms:yo.merge([Do.phong.uniforms,{thicknessColor:{value:new gs(6718871)},thicknessDistortion:{value:.1},thicknessAmbient:{value:0},thicknessAttenuation:{value:.1},thicknessPower:{value:2},thicknessScale:{value:10}}]),vertexShader:`\n #define USE_UV\n ${Po.meshphong_vert}\n `,fragmentShader:`\n #define USE_UV\n #define SUBSURFACE\n\n ${qp}\n\n uniform float thicknessPower;\n uniform float thicknessScale;\n uniform float thicknessDistortion;\n uniform float thicknessAmbient;\n uniform float thicknessAttenuation;\n uniform vec3 thicknessColor;\n\n void RE_Direct_Scattering(const in IncidentLight directLight, const in vec2 uv, const in GeometricContext geometry, inout ReflectedLight reflectedLight) {\n #ifdef USE_COLOR\n vec3 thickness = vColor * thicknessColor;\n #else\n vec3 thickness = thicknessColor;\n #endif\n vec3 scatteringHalf = normalize(directLight.direction + (geometry.normal * thicknessDistortion));\n float scatteringDot = pow(saturate(dot(geometry.viewDir, -scatteringHalf)), thicknessPower) * thicknessScale;\n vec3 scatteringIllu = (scatteringDot + thicknessAmbient) * thickness;\n reflectedLight.directDiffuse += scatteringIllu * thicknessAttenuation * directLight.color;\n }\n `+Yp.replace("#include ",(Jp=Po.lights_fragment_begin,Kp="RE_Direct( directLight, geometry, material, reflectedLight );",Qp="\n RE_Direct( directLight, geometry, material, reflectedLight );\n #if defined( SUBSURFACE ) && defined( USE_UV )\n RE_Direct_Scattering(directLight, vUv, geometry, reflectedLight);\n #endif\n ",Jp.split(Kp).join(Qp)))};var Jp,Kp,Qp,$p,ef,tf,nf={extends:{inject:["three","mesh"],props:{id:String,uniforms:Object,vertexShader:String,fragmentShader:String},beforeMount(){this.createMaterial(),this.id&&(this.three.materials[this.id]=this.material),this.mesh.setMaterial(this.material)},mounted(){this.addWatchers&&this.addWatchers()},unmounted(){this.material.dispose(),this.id&&delete this.three.materials[this.id]},render:()=>[],__hmrId:"ShaderMaterial"},props:{diffuse:{type:String,default:"#ffffff"},thicknessColor:{type:String,default:"#ffffff"},thicknessDistortion:{type:Number,default:.4},thicknessAmbient:{type:Number,default:.01},thicknessAttenuation:{type:Number,default:.7},thicknessPower:{type:Number,default:2},thicknessScale:{type:Number,default:4},transparent:{type:Boolean,default:!1},opacity:{type:Number,default:1},vertexColors:{type:Boolean,default:!1}},methods:{createMaterial(){const e=Zp,t=yo.clone(e.uniforms);Object.entries(this.$props).forEach(([e,n])=>{"diffuse"!==e&&"thicknessColor"!==e||(n=new gs(n)),"id"!==e&&"transparent"!==e&&"vertexColors"!==e&&(t[e].value=n)}),this.material=new xo({...e,uniforms:t,lights:!0,transparent:this.transparent,vertexColors:this.vertexColors})}},__hmrId:"SubSurfaceMaterial"},rf={extends:kp,methods:{createMaterial(){this.material=new Wh(dp(this.$props,["id"]))}},__hmrId:"ToonMaterial"},sf={extends:yp,inject:["material"],created(){this.material.setMap(this.texture)},unmounted(){this.material.setMap(null)},methods:{refreshTexture(){this.createTexture(),this.material.setMap(this.texture)}},__hmrId:"Map"},of={extends:xp,inject:["material"],created(){this.material.setEnvMap(this.texture)},unmounted(){this.material.setEnvMap(null)},methods:{refreshTexture(){this.createTexture(),this.material.setEnvMap(this.texture)}},__hmrId:"EnvMap"},af={inject:["three","scene","rendererComponent"],emits:["ready"],props:{materialId:String,position:Object,rotation:Object,scale:Object,castShadow:Boolean,receiveShadow:Boolean},provide(){return{mesh:this}},mounted(){this.geometry&&!this.mesh&&this.initMesh()},unmounted(){this.mesh&&this.scene.remove(this.mesh),this.geometry&&this.geometry.dispose(),this.material&&!this.materialId&&this.material.dispose()},methods:{initMesh(){!this.material&&this.materialId&&(this.material=this.three.materials[this.materialId]),this.mesh=new oo(this.geometry,this.material),this.bindProps(),this.scene.add(this.mesh),this.$emit("ready")},bindProps(){mp(this,"position",this.mesh.position),mp(this,"rotation",this.mesh.rotation),mp(this,"scale",this.mesh.scale),["castShadow","receiveShadow"].forEach(e=>{this.mesh[e]=this[e],On(()=>this[e],()=>{this.mesh[e]=this[e]})}),On(()=>this.materialId,()=>{this.mesh.material=this.three.materials[this.materialId]})},setGeometry(e){this.geometry=e,this.mesh&&(this.mesh.geometry=e)},setMaterial(e){this.material=e,this.mesh&&(this.mesh.material=e)},refreshGeometry(){const e=this.geometry;this.createGeometry(),this.mesh.geometry=this.geometry,e.dispose()}},render(){return this.$slots.default?this.$slots.default():[]},__hmrId:"Mesh"},lf={extends:af,props:{size:Number,width:{type:Number,default:1},height:{type:Number,default:1},depth:{type:Number,default:1},widthSegments:{type:Number,default:1},heightSegments:{type:Number,default:1},depthSegments:{type:Number,default:1}},created(){this.createGeometry(),["size","width","height","depth","widthSegments","heightSegments","depthSegments"].forEach(e=>{On(()=>this[e],()=>{this.refreshGeometry()})})},methods:{createGeometry(){this.size?this.geometry=new mo(this.size,this.size,this.size):this.geometry=new mo(this.width,this.height,this.depth)}},__hmrId:"Box"},cf={extends:af,props:{radius:{type:Number,default:1},segments:{type:Number,default:8},thetaStart:{type:Number,default:0},thetaLength:{type:Number,default:2*Math.PI}},created(){this.createGeometry();["radius","segments","thetaStart","thetaLength"].forEach(e=>{On(()=>this[e],()=>{this.refreshGeometry()})})},methods:{createGeometry(){this.geometry=new Bh(this.radius,this.segments,this.thetaStart,this.thetaLength)}},__hmrId:"Circle"},hf={extends:af,props:{radius:{type:Number,default:1},height:{type:Number,default:1},radialSegments:{type:Number,default:8},heightSegments:{type:Number,default:1},openEnded:{type:Boolean,default:!1},thetaStart:{type:Number,default:0},thetaLength:{type:Number,default:2*Math.PI}},created(){this.createGeometry();["radius","height","radialSegments","heightSegments","openEnded","thetaStart","thetaLength"].forEach(e=>{On(()=>this[e],()=>{this.refreshGeometry()})})},methods:{createGeometry(){this.geometry=new Uh(this.radius,this.height,this.radialSegments,this.heightSegments,this.openEnded,this.thetaStart,this.thetaLength)}},__hmrId:"Cone"},uf={extends:af,props:{radiusTop:{type:Number,default:1},radiusBottom:{type:Number,default:1},height:{type:Number,default:1},radialSegments:{type:Number,default:8},heightSegments:{type:Number,default:1},openEnded:{type:Boolean,default:!1},thetaStart:{type:Number,default:0},thetaLength:{type:Number,default:2*Math.PI}},created(){this.createGeometry();["radiusTop","radiusBottom","height","radialSegments","heightSegments","openEnded","thetaStart","thetaLength"].forEach(e=>{On(()=>this[e],()=>{this.refreshGeometry()})})},methods:{createGeometry(){this.geometry=new zh(this.radiusTop,this.radiusBottom,this.height,this.radialSegments,this.heightSegments,this.openEnded,this.thetaStart,this.thetaLength)}},__hmrId:"Cylinder"},df={extends:af,props:{radius:{type:Number,default:1},detail:{type:Number,default:0}},created(){this.createGeometry();["radius","detail"].forEach(e=>{On(()=>this[e],()=>{this.refreshGeometry()})})},methods:{createGeometry(){this.geometry=new Xc(this.radius,this.detail)}},__hmrId:"Dodecahedron"},pf={extends:af,props:{radius:{type:Number,default:1},detail:{type:Number,default:0}},created(){this.createGeometry();["radius","detail"].forEach(e=>{On(()=>this[e],()=>{this.refreshGeometry()})})},methods:{createGeometry(){this.geometry=new Wc(this.radius,this.detail)}},__hmrId:"Icosahedron"},ff={extends:af,props:{points:Array,segments:{type:Number,default:12},phiStart:{type:Number,default:0},phiLength:{type:Number,default:2*Math.PI}},created(){this.createGeometry();["points","segments","phiStart","phiLength"].forEach(e=>{On(()=>this[e],()=>{this.refreshGeometry()})})},methods:{createGeometry(){this.geometry=new Ph(this.points,this.segments,this.phiStart,this.phiLength)}},__hmrId:"Lathe"},mf={extends:af,props:{radius:{type:Number,default:1},detail:{type:Number,default:0}},created(){this.createGeometry();["radius","detail"].forEach(e=>{On(()=>this[e],()=>{this.refreshGeometry()})})},methods:{createGeometry(){this.geometry=new Vc(this.radius,this.detail)}},__hmrId:"Octahedron"},gf={extends:af,props:{width:{type:Number,default:1},height:{type:Number,default:1},widthSegments:{type:Number,default:1},heightSegments:{type:Number,default:1}},created(){this.createGeometry();["width","height","widthSegments","heightSegments"].forEach(e=>{On(()=>this[e],()=>{this.refreshGeometry()})})},methods:{createGeometry(){this.geometry=new Ro(this.width,this.height,this.widthSegments,this.heightSegments)}},__hmrId:"Plane"},vf={extends:af,props:{vertices:Array,indices:Array,radius:{type:Number,default:1},detail:{type:Number,default:0}},created(){this.createGeometry();["vertices","indices","radius","detail"].forEach(e=>{On(()=>this[e],()=>{this.refreshGeometry()})})},methods:{createGeometry(){this.geometry=new Hc(this.vertices,this.indices,this.radius,this.detail)}},__hmrId:"Polyhedron"},yf={extends:af,props:{innerRadius:{type:Number,default:.5},outerRadius:{type:Number,default:1},thetaSegments:{type:Number,default:8},phiSegments:{type:Number,default:1},thetaStart:{type:Number,default:0},thetaLength:{type:Number,default:2*Math.PI}},created(){this.createGeometry();["innerRadius","outerRadius","thetaSegments","phiSegments","thetaStart","thetaLength"].forEach(e=>{On(()=>this[e],()=>{this.refreshGeometry()})})},methods:{createGeometry(){this.geometry=new Rh(this.innerRadius,this.outerRadius,this.thetaSegments,this.phiSegments,this.thetaStart,this.thetaLength)}},__hmrId:"Ring"},xf={extends:af,props:{radius:Number,widthSegments:{type:Number,default:12},heightSegments:{type:Number,default:12}},watch:{radius(){this.refreshGeometry()},widthSegments(){this.refreshGeometry()},heightSegments(){this.refreshGeometry()}},created(){this.createGeometry()},methods:{createGeometry(){this.geometry=new Lh(this.radius,this.widthSegments,this.heightSegments)}},__hmrId:"Sphere"},_f={extends:af,props:{radius:{type:Number,default:1},detail:{type:Number,default:0}},created(){this.createGeometry();["radius","detail"].forEach(e=>{On(()=>this[e],()=>{this.refreshGeometry()})})},methods:{createGeometry(){this.geometry=new jc(this.radius,this.detail)}},__hmrId:"Tetrahedron"},bf={extends:af,props:{...{text:String,fontSrc:String,size:{type:Number,default:80},height:{type:Number,default:5},depth:{type:Number,default:1},curveSegments:{type:Number,default:12},bevelEnabled:{type:Boolean,default:!1},bevelThickness:{type:Number,default:10},bevelSize:{type:Number,default:8},bevelOffset:{type:Number,default:0},bevelSegments:{type:Number,default:5},align:{type:[Boolean,String],default:!1}}},created(){["text","size","height","curveSegments","bevelEnabled","bevelThickness","bevelSize","bevelOffset","bevelSegments","align"].forEach(e=>{On(()=>this[e],()=>{this.font&&this.refreshGeometry()})});(new wd).load(this.fontSrc,e=>{this.font=e,this.createGeometry(),this.initMesh()})},methods:{createGeometry(){this.geometry=new Ch(this.text,{font:this.font,size:this.size,height:this.height,depth:this.depth,curveSegments:this.curveSegments,bevelEnabled:this.bevelEnabled,bevelThickness:this.bevelThickness,bevelSize:this.bevelSize,bevelOffset:this.bevelOffset,bevelSegments:this.bevelSegments}),"center"===this.align&&this.geometry.center()}}},wf={extends:af,props:{radius:{type:Number,default:.5},tube:{type:Number,default:.4},radialSegments:{type:Number,default:8},tubularSegments:{type:Number,default:6},arc:{type:Number,default:2*Math.PI}},created(){this.createGeometry();["radius","tube","radialSegments","tubularSegments","arc"].forEach(e=>{On(()=>this[e],()=>{this.refreshGeometry()})})},methods:{createGeometry(){this.geometry=new Zc(this.radius,this.tube,this.radialSegments,this.tubularSegments,this.arc)}},__hmrId:"Torus"},Mf={extends:af,props:{radius:{type:Number,default:.5},tube:{type:Number,default:.4},radialSegments:{type:Number,default:64},tubularSegments:{type:Number,default:8},p:{type:Number,default:2},q:{type:Number,default:3}},created(){this.createGeometry();["radius","tube","radialSegments","tubularSegments","p","q"].forEach(e=>{On(()=>this[e],()=>{this.refreshGeometry()})})},methods:{createGeometry(){this.geometry=new Yc(this.radius,this.tube,this.radialSegments,this.tubularSegments,this.p,this.q)}},__hmrId:"TorusKnot"},Sf={extends:af,props:{path:Su,tubularSegments:{type:Number,default:64},radius:{type:Number,default:1},radialSegments:{type:Number,default:8},closed:{type:Boolean,default:!1}},created(){this.createGeometry();["path","tubularSegments","radius","radialSegments","closed"].forEach(e=>{On(()=>this[e],()=>{this.refreshGeometry()})})},methods:{createGeometry(){this.geometry=new qc(this.path,this.tubularSegments,this.radius,this.radialSegments,this.closed)}},__hmrId:"Tube"},Tf={extends:af,props:{cubeRTSize:{type:Number,default:512},cubeCameraNear:{type:Number,default:.1},cubeCameraFar:{type:Number,default:2e3},autoUpdate:Boolean},mounted(){this.initGem(),this.autoUpdate?this.three.onBeforeRender(this.updateCubeRT):this.rendererComponent.onMounted(this.updateCubeRT)},unmounted(){this.three.offBeforeRender(this.updateCubeRT),this.meshBack&&this.scene.remove(this.meshBack),this.materialBack&&this.materialBack.dispose()},methods:{initGem(){const e=new Mo(this.cubeRTSize,{format:1022,generateMipmaps:!0,minFilter:1008});this.cubeCamera=new wo(this.cubeCameraNear,this.cubeCameraFar,e),mp(this,"position",this.cubeCamera.position),this.scene.add(this.cubeCamera),this.material.side=0,this.material.envMap=e.texture,this.material.envMapIntensity=10,this.material.metalness=0,this.material.roughness=0,this.material.opacity=.75,this.material.transparent=!0,this.material.premultipliedAlpha=!0,this.material.needsUpdate=!0,this.materialBack=this.material.clone(),this.materialBack.side=1,this.materialBack.envMapIntensity=5,this.materialBack.metalness=1,this.materialBack.roughness=0,this.materialBack.opacity=.5,this.meshBack=new oo(this.geometry,this.materialBack),mp(this,"position",this.meshBack.position),mp(this,"rotation",this.meshBack.rotation),mp(this,"scale",this.meshBack.scale),this.scene.add(this.meshBack)},updateCubeRT(){this.mesh.visible=!1,this.meshBack.visible=!1,this.cubeCamera.update(this.three.renderer,this.scene),this.mesh.visible=!0,this.meshBack.visible=!0}},__hmrId:"Gem"},Ef={emits:["loaded"],extends:af,props:{src:String,width:Number,height:Number,keepSize:Boolean},created(){this.createGeometry(),this.createMaterial(),this.initMesh(),On(()=>this.src,this.refreshTexture),["width","height"].forEach(e=>{On(()=>this[e],this.resize)}),this.keepSize&&this.three.onAfterResize(this.resize)},methods:{createGeometry(){this.geometry=new Ro(1,1,1,1)},createMaterial(){this.material=new _s({side:2,map:this.loadTexture()})},loadTexture(){return(new Mu).load(this.src,this.onLoaded)},refreshTexture(){this.texture&&this.texture.dispose(),this.material.map=this.loadTexture(),this.material.needsUpdate=!0},onLoaded(e){this.texture=e,this.resize(),this.$emit("loaded")},resize(){if(!this.texture)return;const e=this.three.size,t=this.texture.image.width/this.texture.image.height;let n,i;this.width&&this.height?(n=this.width*e.wWidth/e.width,i=this.height*e.wHeight/e.height):this.width?(n=this.width*e.wWidth/e.width,i=n/t):this.height&&(i=this.height*e.wHeight/e.height,n=i*t),this.mesh.scale.x=n,this.mesh.scale.y=i}},__hmrId:"Image"},Af={inject:["three","scene"],props:{materialId:String,count:Number,position:Object,castShadow:Boolean,receiveShadow:Boolean},provide(){return{mesh:this}},beforeMount(){this.$slots.default||console.error("Missing Geometry")},mounted(){this.initMesh()},unmounted(){this.scene.remove(this.mesh)},methods:{initMesh(){!this.material&&this.materialId&&(this.material=this.three.materials[this.materialId]),this.mesh=new vc(this.geometry,this.material,this.count),mp(this,"position",this.mesh.position),mp(this,"rotation",this.mesh.rotation),mp(this,"scale",this.mesh.scale),["castShadow","receiveShadow"].forEach(e=>{this.mesh[e]=this[e],On(()=>this[e],()=>{this.mesh[e]=this[e]})}),this.scene.add(this.mesh)},setGeometry(e){this.geometry=e,this.mesh&&(this.mesh.geometry=e)},setMaterial(e){this.material=e,this.mesh&&(this.mesh.material=e)}},render(){return this.$slots.default()},__hmrId:"InstancedMesh"},Cf={extends:af,props:{cubeRTSize:{type:Number,default:512},cubeCameraNear:{type:Number,default:.1},cubeCameraFar:{type:Number,default:2e3},autoUpdate:Boolean},mounted(){this.initMirrorMesh(),this.autoUpdate?this.three.onBeforeRender(this.updateCubeRT):this.rendererComponent.onMounted(this.updateCubeRT)},unmounted(){this.three.offBeforeRender(this.updateCubeRT)},methods:{initMirrorMesh(){const e=new Mo(this.cubeRTSize,{format:1022,generateMipmaps:!0,minFilter:1008});this.cubeCamera=new wo(this.cubeCameraNear,this.cubeCameraFar,e),mp(this,"position",this.cubeCamera.position),this.scene.add(this.cubeCamera),this.material.envMap=e.texture,this.material.needsUpdate=!0},updateCubeRT(){this.mesh.visible=!1,this.cubeCamera.update(this.three.renderer,this.scene),this.mesh.visible=!0}},__hmrId:"MirrorMesh"},Lf={extends:af,props:{cubeRTSize:{type:Number,default:512},cubeCameraNear:{type:Number,default:.1},cubeCameraFar:{type:Number,default:2e3},autoUpdate:Boolean},mounted(){this.initMirrorMesh(),this.autoUpdate?this.three.onBeforeRender(this.updateCubeRT):this.rendererComponent.onMounted(this.updateCubeRT)},unmounted(){this.three.offBeforeRender(this.updateCubeRT)},methods:{initMirrorMesh(){const e=new Mo(this.cubeRTSize,{mapping:302,format:1022,generateMipmaps:!0,minFilter:1008});this.cubeCamera=new wo(this.cubeCameraNear,this.cubeCameraFar,e),mp(this,"position",this.cubeCamera.position),this.scene.add(this.cubeCamera),this.material.envMap=e.texture,this.material.refractionRatio=.95,this.material.needsUpdate=!0},updateCubeRT(){this.mesh.visible=!1,this.cubeCamera.update(this.three.renderer,this.scene),this.mesh.visible=!0}},__hmrId:"RefractionMesh"},Rf={emits:["ready","loaded"],inject:["three","scene"],props:{src:String,position:Object,scale:Object},mounted(){this.texture=(new Mu).load(this.src,this.onLoaded),this.material=new jl({map:this.texture}),this.sprite=new ic(this.material),this.geometry=this.sprite.geometry,mp(this,"position",this.sprite.position),mp(this,"scale",this.sprite.scale),this.scene.add(this.sprite),this.$emit("ready")},unmounted(){this.texture.dispose(),this.material.dispose(),this.scene.remove(this.sprite)},methods:{onLoaded(){this.updateUV(),this.$emit("loaded")},updateUV(){this.iWidth=this.texture.image.width,this.iHeight=this.texture.image.height,this.iRatio=this.iWidth/this.iHeight;let e=.5,t=.5;this.iRatio>1?t=.5/this.iRatio:e=.5/this.iRatio;const n=this.geometry.attributes.position.array;n[0]=-e,n[1]=-t,n[5]=e,n[6]=-t,n[10]=e,n[11]=t,n[15]=-e,n[16]=t,this.geometry.attributes.position.needsUpdate=!0}},render:()=>[],__hmrId:"Sprite"},Pf={uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float opacity;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","\tvec4 texel = texture2D( tDiffuse, vUv );","\tgl_FragColor = opacity * texel;","}"].join("\n")};function Nf(){this.enabled=!0,this.needsSwap=!0,this.clear=!1,this.renderToScreen=!1}Object.assign(Nf.prototype,{setSize:function(){},render:function(){console.error("THREE.Pass: .render() must be implemented in derived pass.")}}),Nf.FullScreenQuad=($p=new ed(-1,1,1,-1,0,1),ef=new Ro(2,2),tf=function(e){this._mesh=new oo(ef,e)},Object.defineProperty(tf.prototype,"material",{get:function(){return this._mesh.material},set:function(e){this._mesh.material=e}}),Object.assign(tf.prototype,{dispose:function(){this._mesh.geometry.dispose()},render:function(e){e.render(this._mesh,$p)}}),tf);var Df=function(e,t){Nf.call(this),this.textureID=void 0!==t?t:"tDiffuse",e instanceof xo?(this.uniforms=e.uniforms,this.material=e):e&&(this.uniforms=yo.clone(e.uniforms),this.material=new xo({defines:Object.assign({},e.defines),uniforms:this.uniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader})),this.fsQuad=new Nf.FullScreenQuad(this.material)};Df.prototype=Object.assign(Object.create(Nf.prototype),{constructor:Df,render:function(e,t,n){this.uniforms[this.textureID]&&(this.uniforms[this.textureID].value=n.texture),this.fsQuad.material=this.material,this.renderToScreen?(e.setRenderTarget(null),this.fsQuad.render(e)):(e.setRenderTarget(t),this.clear&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),this.fsQuad.render(e))}});var If=function(e,t){Nf.call(this),this.scene=e,this.camera=t,this.clear=!0,this.needsSwap=!1,this.inverse=!1};If.prototype=Object.assign(Object.create(Nf.prototype),{constructor:If,render:function(e,t,n){var i,r,s=e.getContext(),o=e.state;o.buffers.color.setMask(!1),o.buffers.depth.setMask(!1),o.buffers.color.setLocked(!0),o.buffers.depth.setLocked(!0),this.inverse?(i=0,r=1):(i=1,r=0),o.buffers.stencil.setTest(!0),o.buffers.stencil.setOp(s.REPLACE,s.REPLACE,s.REPLACE),o.buffers.stencil.setFunc(s.ALWAYS,i,4294967295),o.buffers.stencil.setClear(r),o.buffers.stencil.setLocked(!0),e.setRenderTarget(n),this.clear&&e.clear(),e.render(this.scene,this.camera),e.setRenderTarget(t),this.clear&&e.clear(),e.render(this.scene,this.camera),o.buffers.color.setLocked(!1),o.buffers.depth.setLocked(!1),o.buffers.stencil.setLocked(!1),o.buffers.stencil.setFunc(s.EQUAL,1,4294967295),o.buffers.stencil.setOp(s.KEEP,s.KEEP,s.KEEP),o.buffers.stencil.setLocked(!0)}});var Of=function(){Nf.call(this),this.needsSwap=!1};Of.prototype=Object.create(Nf.prototype),Object.assign(Of.prototype,{render:function(e){e.state.buffers.stencil.setLocked(!1),e.state.buffers.stencil.setTest(!1)}});var zf=function(e,t){if(this.renderer=e,void 0===t){var n={minFilter:1006,magFilter:1006,format:1023},i=e.getSize(new Fi);this._pixelRatio=e.getPixelRatio(),this._width=i.width,this._height=i.height,(t=new Xi(this._width*this._pixelRatio,this._height*this._pixelRatio,n)).texture.name="EffectComposer.rt1"}else this._pixelRatio=1,this._width=t.width,this._height=t.height;this.renderTarget1=t,this.renderTarget2=t.clone(),this.renderTarget2.texture.name="EffectComposer.rt2",this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2,this.renderToScreen=!0,this.passes=[],void 0===Pf&&console.error("THREE.EffectComposer relies on CopyShader"),void 0===Df&&console.error("THREE.EffectComposer relies on ShaderPass"),this.copyPass=new Df(Pf),this.clock=new Rd};Object.assign(zf.prototype,{swapBuffers:function(){var e=this.readBuffer;this.readBuffer=this.writeBuffer,this.writeBuffer=e},addPass:function(e){this.passes.push(e),e.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)},insertPass:function(e,t){this.passes.splice(t,0,e),e.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)},isLastEnabledPass:function(e){for(var t=e+1;t({passes:[]}),inject:["three"],provide(){return{passes:this.passes}},mounted(){this.three.onAfterInit(()=>{this.composer=new zf(this.three.renderer),this.three.renderer.autoClear=!1,this.passes.forEach(e=>{this.composer.addPass(e)}),this.three.composer=this.composer})},render(){return this.$slots.default()},__hmrId:"EffectComposer"},Ff=function(e,t,n,i,r){Nf.call(this),this.scene=e,this.camera=t,this.overrideMaterial=n,this.clearColor=i,this.clearAlpha=void 0!==r?r:0,this.clear=!0,this.clearDepth=!1,this.needsSwap=!1};Ff.prototype=Object.assign(Object.create(Nf.prototype),{constructor:Ff,render:function(e,t,n){var i,r,s,o=e.autoClear;e.autoClear=!1,void 0!==this.overrideMaterial&&(s=this.scene.overrideMaterial,this.scene.overrideMaterial=this.overrideMaterial),this.clearColor&&(i=e.getClearColor().getHex(),r=e.getClearAlpha(),e.setClearColor(this.clearColor,this.clearAlpha)),this.clearDepth&&e.clearDepth(),e.setRenderTarget(this.renderToScreen?null:n),this.clear&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),e.render(this.scene,this.camera),this.clearColor&&e.setClearColor(i,r),void 0!==this.overrideMaterial&&(this.scene.overrideMaterial=s),e.autoClear=o}});var Gf={inject:["three","passes"],beforeMount(){this.passes||console.error("Missing parent EffectComposer")},unmounted(){this.pass.dispose&&this.pass.dispose()},render:()=>[],__hmrId:"EffectPass"},kf={extends:Gf,mounted(){this.three.scene||console.error("Missing Scene"),this.three.camera||console.error("Missing Camera");const e=new Ff(this.three.scene,this.three.camera);this.passes.push(e),this.pass=e},__hmrId:"RenderPass"},Hf={defines:{DEPTH_PACKING:1,PERSPECTIVE_CAMERA:1},uniforms:{tColor:{value:null},tDepth:{value:null},focus:{value:1},aspect:{value:1},aperture:{value:.025},maxblur:{value:.01},nearClip:{value:1},farClip:{value:1e3}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","varying vec2 vUv;","uniform sampler2D tColor;","uniform sampler2D tDepth;","uniform float maxblur;","uniform float aperture;","uniform float nearClip;","uniform float farClip;","uniform float focus;","uniform float aspect;","#include ","float getDepth( const in vec2 screenPosition ) {","\t#if DEPTH_PACKING == 1","\treturn unpackRGBAToDepth( texture2D( tDepth, screenPosition ) );","\t#else","\treturn texture2D( tDepth, screenPosition ).x;","\t#endif","}","float getViewZ( const in float depth ) {","\t#if PERSPECTIVE_CAMERA == 1","\treturn perspectiveDepthToViewZ( depth, nearClip, farClip );","\t#else","\treturn orthographicDepthToViewZ( depth, nearClip, farClip );","\t#endif","}","void main() {","\tvec2 aspectcorrect = vec2( 1.0, aspect );","\tfloat viewZ = getViewZ( getDepth( vUv ) );","\tfloat factor = ( focus + viewZ );","\tvec2 dofblur = vec2 ( clamp( factor * aperture, -maxblur, maxblur ) );","\tvec2 dofblur9 = dofblur * 0.9;","\tvec2 dofblur7 = dofblur * 0.7;","\tvec2 dofblur4 = dofblur * 0.4;","\tvec4 col = vec4( 0.0 );","\tcol += texture2D( tColor, vUv.xy );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.0, 0.4 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.15, 0.37 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.29, 0.29 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.37, 0.15 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.40, 0.0 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.37, -0.15 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.29, -0.29 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.15, -0.37 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.0, -0.4 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.15, 0.37 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.29, 0.29 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.37, 0.15 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.4, 0.0 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.37, -0.15 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.15, -0.37 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.15, 0.37 ) * aspectcorrect ) * dofblur9 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.37, 0.15 ) * aspectcorrect ) * dofblur9 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.37, -0.15 ) * aspectcorrect ) * dofblur9 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.15, -0.37 ) * aspectcorrect ) * dofblur9 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.15, 0.37 ) * aspectcorrect ) * dofblur9 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.37, 0.15 ) * aspectcorrect ) * dofblur9 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.37, -0.15 ) * aspectcorrect ) * dofblur9 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.15, -0.37 ) * aspectcorrect ) * dofblur9 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.29, 0.29 ) * aspectcorrect ) * dofblur7 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.40, 0.0 ) * aspectcorrect ) * dofblur7 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.29, -0.29 ) * aspectcorrect ) * dofblur7 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.0, -0.4 ) * aspectcorrect ) * dofblur7 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.29, 0.29 ) * aspectcorrect ) * dofblur7 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.4, 0.0 ) * aspectcorrect ) * dofblur7 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur7 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.0, 0.4 ) * aspectcorrect ) * dofblur7 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.29, 0.29 ) * aspectcorrect ) * dofblur4 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.4, 0.0 ) * aspectcorrect ) * dofblur4 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.29, -0.29 ) * aspectcorrect ) * dofblur4 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.0, -0.4 ) * aspectcorrect ) * dofblur4 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.29, 0.29 ) * aspectcorrect ) * dofblur4 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.4, 0.0 ) * aspectcorrect ) * dofblur4 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur4 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.0, 0.4 ) * aspectcorrect ) * dofblur4 );","\tgl_FragColor = col / 41.0;","\tgl_FragColor.a = 1.0;","}"].join("\n")},jf=function(e,t,n){Nf.call(this),this.scene=e,this.camera=t;var i=void 0!==n.focus?n.focus:1,r=void 0!==n.aspect?n.aspect:t.aspect,s=void 0!==n.aperture?n.aperture:.025,o=void 0!==n.maxblur?n.maxblur:1,a=n.width||window.innerWidth||1,l=n.height||window.innerHeight||1;this.renderTargetDepth=new Xi(a,l,{minFilter:1003,magFilter:1003}),this.renderTargetDepth.texture.name="BokehPass.depth",this.materialDepth=new Sl,this.materialDepth.depthPacking=3201,this.materialDepth.blending=0,void 0===Hf&&console.error("BokehPass relies on BokehShader");var c=Hf,h=yo.clone(c.uniforms);h.tDepth.value=this.renderTargetDepth.texture,h.focus.value=i,h.aspect.value=r,h.aperture.value=s,h.maxblur.value=o,h.nearClip.value=t.near,h.farClip.value=t.far,this.materialBokeh=new xo({defines:Object.assign({},c.defines),uniforms:h,vertexShader:c.vertexShader,fragmentShader:c.fragmentShader}),this.uniforms=h,this.needsSwap=!1,this.fsQuad=new Nf.FullScreenQuad(this.materialBokeh),this.oldClearColor=new gs};jf.prototype=Object.assign(Object.create(Nf.prototype),{constructor:jf,render:function(e,t,n){this.scene.overrideMaterial=this.materialDepth,this.oldClearColor.copy(e.getClearColor());var i=e.getClearAlpha(),r=e.autoClear;e.autoClear=!1,e.setClearColor(16777215),e.setClearAlpha(1),e.setRenderTarget(this.renderTargetDepth),e.clear(),e.render(this.scene,this.camera),this.uniforms.tColor.value=n.texture,this.uniforms.nearClip.value=this.camera.near,this.uniforms.farClip.value=this.camera.far,this.renderToScreen?(e.setRenderTarget(null),this.fsQuad.render(e)):(e.setRenderTarget(t),e.clear(),this.fsQuad.render(e)),this.scene.overrideMaterial=null,e.setClearColor(this.oldClearColor),e.setClearAlpha(i),e.autoClear=r}});var Vf={extends:Gf,props:{focus:{type:Number,default:1},aperture:{type:Number,default:.025},maxblur:{type:Number,default:.01}},watch:{focus(){this.pass.uniforms.focus.value=this.focus},aperture(){this.pass.uniforms.aperture.value=this.aperture},maxblur(){this.pass.uniforms.maxblur.value=this.maxblur}},mounted(){this.three.scene||console.error("Missing Scene"),this.three.camera||console.error("Missing Camera");const e={focus:this.focus,aperture:this.aperture,maxblur:this.maxblur,width:this.three.size.width,height:this.three.size.height},t=new jf(this.three.scene,this.three.camera,e);this.passes.push(t),this.pass=t},__hmrId:"BokehPass"},Wf={uniforms:{tDiffuse:{value:null},time:{value:0},nIntensity:{value:.5},sIntensity:{value:.05},sCount:{value:4096},grayscale:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","uniform float time;","uniform bool grayscale;","uniform float nIntensity;","uniform float sIntensity;","uniform float sCount;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","\tvec4 cTextureScreen = texture2D( tDiffuse, vUv );","\tfloat dx = rand( vUv + time );","\tvec3 cResult = cTextureScreen.rgb + cTextureScreen.rgb * clamp( 0.1 + dx, 0.0, 1.0 );","\tvec2 sc = vec2( sin( vUv.y * sCount ), cos( vUv.y * sCount ) );","\tcResult += cTextureScreen.rgb * vec3( sc.x, sc.y, sc.x ) * sIntensity;","\tcResult = cTextureScreen.rgb + clamp( nIntensity, 0.0,1.0 ) * ( cResult - cTextureScreen.rgb );","\tif( grayscale ) {","\t\tcResult = vec3( cResult.r * 0.3 + cResult.g * 0.59 + cResult.b * 0.11 );","\t}","\tgl_FragColor = vec4( cResult, cTextureScreen.a );","}"].join("\n")},Xf=function(e,t,n,i){Nf.call(this),void 0===Wf&&console.error("FilmPass relies on FilmShader");var r=Wf;this.uniforms=yo.clone(r.uniforms),this.material=new xo({uniforms:this.uniforms,vertexShader:r.vertexShader,fragmentShader:r.fragmentShader}),void 0!==i&&(this.uniforms.grayscale.value=i),void 0!==e&&(this.uniforms.nIntensity.value=e),void 0!==t&&(this.uniforms.sIntensity.value=t),void 0!==n&&(this.uniforms.sCount.value=n),this.fsQuad=new Nf.FullScreenQuad(this.material)};Xf.prototype=Object.assign(Object.create(Nf.prototype),{constructor:Xf,render:function(e,t,n,i){this.uniforms.tDiffuse.value=n.texture,this.uniforms.time.value+=i,this.renderToScreen?(e.setRenderTarget(null),this.fsQuad.render(e)):(e.setRenderTarget(t),this.clear&&e.clear(),this.fsQuad.render(e))}});var qf={extends:Gf,props:{noiseIntensity:{type:Number,default:.5},scanlinesIntensity:{type:Number,default:.05},scanlinesCount:{type:Number,default:4096},grayscale:{type:Number,default:0}},watch:{noiseIntensity(){this.pass.uniforms.nIntensity.value=this.noiseIntensity},scanlinesIntensity(){this.pass.uniforms.sIntensity.value=this.scanlinesIntensity},scanlinesCount(){this.pass.uniforms.sCount.value=this.scanlinesCount},grayscale(){this.pass.uniforms.grayscale.value=this.grayscale}},mounted(){const e=new Xf(this.noiseIntensity,this.scanlinesIntensity,this.scanlinesCount,this.grayscale);this.passes.push(e),this.pass=e},__hmrId:"FilmPass"},Yf={uniforms:{tDiffuse:{value:null},shape:{value:1},radius:{value:4},rotateR:{value:Math.PI/12*1},rotateG:{value:Math.PI/12*2},rotateB:{value:Math.PI/12*3},scatter:{value:0},width:{value:1},height:{value:1},blending:{value:1},blendingMode:{value:1},greyscale:{value:!1},disable:{value:!1}},vertexShader:["varying vec2 vUV;","void main() {","\tvUV = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);","}"].join("\n"),fragmentShader:["#define SQRT2_MINUS_ONE 0.41421356","#define SQRT2_HALF_MINUS_ONE 0.20710678","#define PI2 6.28318531","#define SHAPE_DOT 1","#define SHAPE_ELLIPSE 2","#define SHAPE_LINE 3","#define SHAPE_SQUARE 4","#define BLENDING_LINEAR 1","#define BLENDING_MULTIPLY 2","#define BLENDING_ADD 3","#define BLENDING_LIGHTER 4","#define BLENDING_DARKER 5","uniform sampler2D tDiffuse;","uniform float radius;","uniform float rotateR;","uniform float rotateG;","uniform float rotateB;","uniform float scatter;","uniform float width;","uniform float height;","uniform int shape;","uniform bool disable;","uniform float blending;","uniform int blendingMode;","varying vec2 vUV;","uniform bool greyscale;","const int samples = 8;","float blend( float a, float b, float t ) {","\treturn a * ( 1.0 - t ) + b * t;","}","float hypot( float x, float y ) {","\treturn sqrt( x * x + y * y );","}","float rand( vec2 seed ){","return fract( sin( dot( seed.xy, vec2( 12.9898, 78.233 ) ) ) * 43758.5453 );","}","float distanceToDotRadius( float channel, vec2 coord, vec2 normal, vec2 p, float angle, float rad_max ) {","\tfloat dist = hypot( coord.x - p.x, coord.y - p.y );","\tfloat rad = channel;","\tif ( shape == SHAPE_DOT ) {","\t\trad = pow( abs( rad ), 1.125 ) * rad_max;","\t} else if ( shape == SHAPE_ELLIPSE ) {","\t\trad = pow( abs( rad ), 1.125 ) * rad_max;","\t\tif ( dist != 0.0 ) {","\t\t\tfloat dot_p = abs( ( p.x - coord.x ) / dist * normal.x + ( p.y - coord.y ) / dist * normal.y );","\t\t\tdist = ( dist * ( 1.0 - SQRT2_HALF_MINUS_ONE ) ) + dot_p * dist * SQRT2_MINUS_ONE;","\t\t}","\t} else if ( shape == SHAPE_LINE ) {","\t\trad = pow( abs( rad ), 1.5) * rad_max;","\t\tfloat dot_p = ( p.x - coord.x ) * normal.x + ( p.y - coord.y ) * normal.y;","\t\tdist = hypot( normal.x * dot_p, normal.y * dot_p );","\t} else if ( shape == SHAPE_SQUARE ) {","\t\tfloat theta = atan( p.y - coord.y, p.x - coord.x ) - angle;","\t\tfloat sin_t = abs( sin( theta ) );","\t\tfloat cos_t = abs( cos( theta ) );","\t\trad = pow( abs( rad ), 1.4 );","\t\trad = rad_max * ( rad + ( ( sin_t > cos_t ) ? rad - sin_t * rad : rad - cos_t * rad ) );","\t}","\treturn rad - dist;","}","struct Cell {","\tvec2 normal;","\tvec2 p1;","\tvec2 p2;","\tvec2 p3;","\tvec2 p4;","\tfloat samp2;","\tfloat samp1;","\tfloat samp3;","\tfloat samp4;","};","vec4 getSample( vec2 point ) {","\tvec4 tex = texture2D( tDiffuse, vec2( point.x / width, point.y / height ) );","\tfloat base = rand( vec2( floor( point.x ), floor( point.y ) ) ) * PI2;","\tfloat step = PI2 / float( samples );","\tfloat dist = radius * 0.66;","\tfor ( int i = 0; i < samples; ++i ) {","\t\tfloat r = base + step * float( i );","\t\tvec2 coord = point + vec2( cos( r ) * dist, sin( r ) * dist );","\t\ttex += texture2D( tDiffuse, vec2( coord.x / width, coord.y / height ) );","\t}","\ttex /= float( samples ) + 1.0;","\treturn tex;","}","float getDotColour( Cell c, vec2 p, int channel, float angle, float aa ) {","\tfloat dist_c_1, dist_c_2, dist_c_3, dist_c_4, res;","\tif ( channel == 0 ) {","\t\tc.samp1 = getSample( c.p1 ).r;","\t\tc.samp2 = getSample( c.p2 ).r;","\t\tc.samp3 = getSample( c.p3 ).r;","\t\tc.samp4 = getSample( c.p4 ).r;","\t} else if (channel == 1) {","\t\tc.samp1 = getSample( c.p1 ).g;","\t\tc.samp2 = getSample( c.p2 ).g;","\t\tc.samp3 = getSample( c.p3 ).g;","\t\tc.samp4 = getSample( c.p4 ).g;","\t} else {","\t\tc.samp1 = getSample( c.p1 ).b;","\t\tc.samp3 = getSample( c.p3 ).b;","\t\tc.samp2 = getSample( c.p2 ).b;","\t\tc.samp4 = getSample( c.p4 ).b;","\t}","\tdist_c_1 = distanceToDotRadius( c.samp1, c.p1, c.normal, p, angle, radius );","\tdist_c_2 = distanceToDotRadius( c.samp2, c.p2, c.normal, p, angle, radius );","\tdist_c_3 = distanceToDotRadius( c.samp3, c.p3, c.normal, p, angle, radius );","\tdist_c_4 = distanceToDotRadius( c.samp4, c.p4, c.normal, p, angle, radius );","\tres = ( dist_c_1 > 0.0 ) ? clamp( dist_c_1 / aa, 0.0, 1.0 ) : 0.0;","\tres += ( dist_c_2 > 0.0 ) ? clamp( dist_c_2 / aa, 0.0, 1.0 ) : 0.0;","\tres += ( dist_c_3 > 0.0 ) ? clamp( dist_c_3 / aa, 0.0, 1.0 ) : 0.0;","\tres += ( dist_c_4 > 0.0 ) ? clamp( dist_c_4 / aa, 0.0, 1.0 ) : 0.0;","\tres = clamp( res, 0.0, 1.0 );","\treturn res;","}","Cell getReferenceCell( vec2 p, vec2 origin, float grid_angle, float step ) {","\tCell c;","\tvec2 n = vec2( cos( grid_angle ), sin( grid_angle ) );","\tfloat threshold = step * 0.5;","\tfloat dot_normal = n.x * ( p.x - origin.x ) + n.y * ( p.y - origin.y );","\tfloat dot_line = -n.y * ( p.x - origin.x ) + n.x * ( p.y - origin.y );","\tvec2 offset = vec2( n.x * dot_normal, n.y * dot_normal );","\tfloat offset_normal = mod( hypot( offset.x, offset.y ), step );","\tfloat normal_dir = ( dot_normal < 0.0 ) ? 1.0 : -1.0;","\tfloat normal_scale = ( ( offset_normal < threshold ) ? -offset_normal : step - offset_normal ) * normal_dir;","\tfloat offset_line = mod( hypot( ( p.x - offset.x ) - origin.x, ( p.y - offset.y ) - origin.y ), step );","\tfloat line_dir = ( dot_line < 0.0 ) ? 1.0 : -1.0;","\tfloat line_scale = ( ( offset_line < threshold ) ? -offset_line : step - offset_line ) * line_dir;","\tc.normal = n;","\tc.p1.x = p.x - n.x * normal_scale + n.y * line_scale;","\tc.p1.y = p.y - n.y * normal_scale - n.x * line_scale;","\tif ( scatter != 0.0 ) {","\t\tfloat off_mag = scatter * threshold * 0.5;","\t\tfloat off_angle = rand( vec2( floor( c.p1.x ), floor( c.p1.y ) ) ) * PI2;","\t\tc.p1.x += cos( off_angle ) * off_mag;","\t\tc.p1.y += sin( off_angle ) * off_mag;","\t}","\tfloat normal_step = normal_dir * ( ( offset_normal < threshold ) ? step : -step );","\tfloat line_step = line_dir * ( ( offset_line < threshold ) ? step : -step );","\tc.p2.x = c.p1.x - n.x * normal_step;","\tc.p2.y = c.p1.y - n.y * normal_step;","\tc.p3.x = c.p1.x + n.y * line_step;","\tc.p3.y = c.p1.y - n.x * line_step;","\tc.p4.x = c.p1.x - n.x * normal_step + n.y * line_step;","\tc.p4.y = c.p1.y - n.y * normal_step - n.x * line_step;","\treturn c;","}","float blendColour( float a, float b, float t ) {","\tif ( blendingMode == BLENDING_LINEAR ) {","\t\treturn blend( a, b, 1.0 - t );","\t} else if ( blendingMode == BLENDING_ADD ) {","\t\treturn blend( a, min( 1.0, a + b ), t );","\t} else if ( blendingMode == BLENDING_MULTIPLY ) {","\t\treturn blend( a, max( 0.0, a * b ), t );","\t} else if ( blendingMode == BLENDING_LIGHTER ) {","\t\treturn blend( a, max( a, b ), t );","\t} else if ( blendingMode == BLENDING_DARKER ) {","\t\treturn blend( a, min( a, b ), t );","\t} else {","\t\treturn blend( a, b, 1.0 - t );","\t}","}","void main() {","\tif ( ! disable ) {","\t\tvec2 p = vec2( vUV.x * width, vUV.y * height );","\t\tvec2 origin = vec2( 0, 0 );","\t\tfloat aa = ( radius < 2.5 ) ? radius * 0.5 : 1.25;","\t\tCell cell_r = getReferenceCell( p, origin, rotateR, radius );","\t\tCell cell_g = getReferenceCell( p, origin, rotateG, radius );","\t\tCell cell_b = getReferenceCell( p, origin, rotateB, radius );","\t\tfloat r = getDotColour( cell_r, p, 0, rotateR, aa );","\t\tfloat g = getDotColour( cell_g, p, 1, rotateG, aa );","\t\tfloat b = getDotColour( cell_b, p, 2, rotateB, aa );","\t\tvec4 colour = texture2D( tDiffuse, vUV );","\t\tr = blendColour( r, colour.r, blending );","\t\tg = blendColour( g, colour.g, blending );","\t\tb = blendColour( b, colour.b, blending );","\t\tif ( greyscale ) {","\t\t\tr = g = b = (r + b + g) / 3.0;","\t\t}","\t\tgl_FragColor = vec4( r, g, b, 1.0 );","\t} else {","\t\tgl_FragColor = texture2D( tDiffuse, vUV );","\t}","}"].join("\n")},Zf=function(e,t,n){for(var i in Nf.call(this),void 0===Yf&&console.error("THREE.HalftonePass requires HalftoneShader"),this.uniforms=yo.clone(Yf.uniforms),this.material=new xo({uniforms:this.uniforms,fragmentShader:Yf.fragmentShader,vertexShader:Yf.vertexShader}),this.uniforms.width.value=e,this.uniforms.height.value=t,n)n.hasOwnProperty(i)&&this.uniforms.hasOwnProperty(i)&&(this.uniforms[i].value=n[i]);this.fsQuad=new Nf.FullScreenQuad(this.material)};Zf.prototype=Object.assign(Object.create(Nf.prototype),{constructor:Zf,render:function(e,t,n){this.material.uniforms.tDiffuse.value=n.texture,this.renderToScreen?(e.setRenderTarget(null),this.fsQuad.render(e)):(e.setRenderTarget(t),this.clear&&e.clear(),this.fsQuad.render(e))},setSize:function(e,t){this.uniforms.width.value=e,this.uniforms.height.value=t}});var Jf={extends:Gf,props:{shape:{type:Number,default:1},radius:{type:Number,default:4},rotateR:{type:Number,default:Math.PI/12*1},rotateG:{type:Number,default:Math.PI/12*2},rotateB:{type:Number,default:Math.PI/12*3},scatter:{type:Number,default:0}},mounted(){const e=new Zf(this.three.size.width,this.three.size.height,{});["shape","radius","rotateR","rotateG","rotateB","scatter"].forEach(t=>{e.uniforms[t].value=this[t],On(()=>this[t],()=>{e.uniforms[t].value=this[t]})}),this.passes.push(e),this.pass=e},__hmrId:"HalftonePass"},Kf={defines:{NUM_SAMPLES:7,NUM_RINGS:4,NORMAL_TEXTURE:0,DIFFUSE_TEXTURE:0,DEPTH_PACKING:1,PERSPECTIVE_CAMERA:1},uniforms:{tDepth:{value:null},tDiffuse:{value:null},tNormal:{value:null},size:{value:new Fi(512,512)},cameraNear:{value:1},cameraFar:{value:100},cameraProjectionMatrix:{value:new Mr},cameraInverseProjectionMatrix:{value:new Mr},scale:{value:1},intensity:{value:.1},bias:{value:.5},minResolution:{value:0},kernelRadius:{value:100},randomSeed:{value:0}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","varying vec2 vUv;","#if DIFFUSE_TEXTURE == 1","uniform sampler2D tDiffuse;","#endif","uniform sampler2D tDepth;","#if NORMAL_TEXTURE == 1","uniform sampler2D tNormal;","#endif","uniform float cameraNear;","uniform float cameraFar;","uniform mat4 cameraProjectionMatrix;","uniform mat4 cameraInverseProjectionMatrix;","uniform float scale;","uniform float intensity;","uniform float bias;","uniform float kernelRadius;","uniform float minResolution;","uniform vec2 size;","uniform float randomSeed;","// RGBA depth","#include ","vec4 getDefaultColor( const in vec2 screenPosition ) {","\t#if DIFFUSE_TEXTURE == 1","\treturn texture2D( tDiffuse, vUv );","\t#else","\treturn vec4( 1.0 );","\t#endif","}","float getDepth( const in vec2 screenPosition ) {","\t#if DEPTH_PACKING == 1","\treturn unpackRGBAToDepth( texture2D( tDepth, screenPosition ) );","\t#else","\treturn texture2D( tDepth, screenPosition ).x;","\t#endif","}","float getViewZ( const in float depth ) {","\t#if PERSPECTIVE_CAMERA == 1","\treturn perspectiveDepthToViewZ( depth, cameraNear, cameraFar );","\t#else","\treturn orthographicDepthToViewZ( depth, cameraNear, cameraFar );","\t#endif","}","vec3 getViewPosition( const in vec2 screenPosition, const in float depth, const in float viewZ ) {","\tfloat clipW = cameraProjectionMatrix[2][3] * viewZ + cameraProjectionMatrix[3][3];","\tvec4 clipPosition = vec4( ( vec3( screenPosition, depth ) - 0.5 ) * 2.0, 1.0 );","\tclipPosition *= clipW; // unprojection.","\treturn ( cameraInverseProjectionMatrix * clipPosition ).xyz;","}","vec3 getViewNormal( const in vec3 viewPosition, const in vec2 screenPosition ) {","\t#if NORMAL_TEXTURE == 1","\treturn unpackRGBToNormal( texture2D( tNormal, screenPosition ).xyz );","\t#else","\treturn normalize( cross( dFdx( viewPosition ), dFdy( viewPosition ) ) );","\t#endif","}","float scaleDividedByCameraFar;","float minResolutionMultipliedByCameraFar;","float getOcclusion( const in vec3 centerViewPosition, const in vec3 centerViewNormal, const in vec3 sampleViewPosition ) {","\tvec3 viewDelta = sampleViewPosition - centerViewPosition;","\tfloat viewDistance = length( viewDelta );","\tfloat scaledScreenDistance = scaleDividedByCameraFar * viewDistance;","\treturn max(0.0, (dot(centerViewNormal, viewDelta) - minResolutionMultipliedByCameraFar) / scaledScreenDistance - bias) / (1.0 + pow2( scaledScreenDistance ) );","}","// moving costly divides into consts","const float ANGLE_STEP = PI2 * float( NUM_RINGS ) / float( NUM_SAMPLES );","const float INV_NUM_SAMPLES = 1.0 / float( NUM_SAMPLES );","float getAmbientOcclusion( const in vec3 centerViewPosition ) {","\t// precompute some variables require in getOcclusion.","\tscaleDividedByCameraFar = scale / cameraFar;","\tminResolutionMultipliedByCameraFar = minResolution * cameraFar;","\tvec3 centerViewNormal = getViewNormal( centerViewPosition, vUv );","\t// jsfiddle that shows sample pattern: https://jsfiddle.net/a16ff1p7/","\tfloat angle = rand( vUv + randomSeed ) * PI2;","\tvec2 radius = vec2( kernelRadius * INV_NUM_SAMPLES ) / size;","\tvec2 radiusStep = radius;","\tfloat occlusionSum = 0.0;","\tfloat weightSum = 0.0;","\tfor( int i = 0; i < NUM_SAMPLES; i ++ ) {","\t\tvec2 sampleUv = vUv + vec2( cos( angle ), sin( angle ) ) * radius;","\t\tradius += radiusStep;","\t\tangle += ANGLE_STEP;","\t\tfloat sampleDepth = getDepth( sampleUv );","\t\tif( sampleDepth >= ( 1.0 - EPSILON ) ) {","\t\t\tcontinue;","\t\t}","\t\tfloat sampleViewZ = getViewZ( sampleDepth );","\t\tvec3 sampleViewPosition = getViewPosition( sampleUv, sampleDepth, sampleViewZ );","\t\tocclusionSum += getOcclusion( centerViewPosition, centerViewNormal, sampleViewPosition );","\t\tweightSum += 1.0;","\t}","\tif( weightSum == 0.0 ) discard;","\treturn occlusionSum * ( intensity / weightSum );","}","void main() {","\tfloat centerDepth = getDepth( vUv );","\tif( centerDepth >= ( 1.0 - EPSILON ) ) {","\t\tdiscard;","\t}","\tfloat centerViewZ = getViewZ( centerDepth );","\tvec3 viewPosition = getViewPosition( vUv, centerDepth, centerViewZ );","\tfloat ambientOcclusion = getAmbientOcclusion( viewPosition );","\tgl_FragColor = getDefaultColor( vUv );","\tgl_FragColor.xyz *= 1.0 - ambientOcclusion;","}"].join("\n")},Qf={defines:{KERNEL_RADIUS:4,DEPTH_PACKING:1,PERSPECTIVE_CAMERA:1},uniforms:{tDiffuse:{value:null},size:{value:new Fi(512,512)},sampleUvOffsets:{value:[new Fi(0,0)]},sampleWeights:{value:[1]},tDepth:{value:null},cameraNear:{value:10},cameraFar:{value:1e3},depthCutoff:{value:10}},vertexShader:["#include ","uniform vec2 size;","varying vec2 vUv;","varying vec2 vInvSize;","void main() {","\tvUv = uv;","\tvInvSize = 1.0 / size;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","#include ","uniform sampler2D tDiffuse;","uniform sampler2D tDepth;","uniform float cameraNear;","uniform float cameraFar;","uniform float depthCutoff;","uniform vec2 sampleUvOffsets[ KERNEL_RADIUS + 1 ];","uniform float sampleWeights[ KERNEL_RADIUS + 1 ];","varying vec2 vUv;","varying vec2 vInvSize;","float getDepth( const in vec2 screenPosition ) {","\t#if DEPTH_PACKING == 1","\treturn unpackRGBAToDepth( texture2D( tDepth, screenPosition ) );","\t#else","\treturn texture2D( tDepth, screenPosition ).x;","\t#endif","}","float getViewZ( const in float depth ) {","\t#if PERSPECTIVE_CAMERA == 1","\treturn perspectiveDepthToViewZ( depth, cameraNear, cameraFar );","\t#else","\treturn orthographicDepthToViewZ( depth, cameraNear, cameraFar );","\t#endif","}","void main() {","\tfloat depth = getDepth( vUv );","\tif( depth >= ( 1.0 - EPSILON ) ) {","\t\tdiscard;","\t}","\tfloat centerViewZ = -getViewZ( depth );","\tbool rBreak = false, lBreak = false;","\tfloat weightSum = sampleWeights[0];","\tvec4 diffuseSum = texture2D( tDiffuse, vUv ) * weightSum;","\tfor( int i = 1; i <= KERNEL_RADIUS; i ++ ) {","\t\tfloat sampleWeight = sampleWeights[i];","\t\tvec2 sampleUvOffset = sampleUvOffsets[i] * vInvSize;","\t\tvec2 sampleUv = vUv + sampleUvOffset;","\t\tfloat viewZ = -getViewZ( getDepth( sampleUv ) );","\t\tif( abs( viewZ - centerViewZ ) > depthCutoff ) rBreak = true;","\t\tif( ! rBreak ) {","\t\t\tdiffuseSum += texture2D( tDiffuse, sampleUv ) * sampleWeight;","\t\t\tweightSum += sampleWeight;","\t\t}","\t\tsampleUv = vUv - sampleUvOffset;","\t\tviewZ = -getViewZ( getDepth( sampleUv ) );","\t\tif( abs( viewZ - centerViewZ ) > depthCutoff ) lBreak = true;","\t\tif( ! lBreak ) {","\t\t\tdiffuseSum += texture2D( tDiffuse, sampleUv ) * sampleWeight;","\t\t\tweightSum += sampleWeight;","\t\t}","\t}","\tgl_FragColor = diffuseSum / weightSum;","}"].join("\n")},$f={createSampleWeights:function(e,t){for(var n,i,r=[],s=0;s<=e;s++)r.push((n=s,i=t,Math.exp(-n*n/(i*i*2))/(Math.sqrt(2*Math.PI)*i)));return r},createSampleOffsets:function(e,t){for(var n=[],i=0;i<=e;i++)n.push(t.clone().multiplyScalar(i));return n},configure:function(e,t,n,i){e.defines.KERNEL_RADIUS=t,e.uniforms.sampleUvOffsets.value=$f.createSampleOffsets(t,i),e.uniforms.sampleWeights.value=$f.createSampleWeights(t,n),e.needsUpdate=!0}},em={uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float opacity;","uniform sampler2D tDiffuse;","varying vec2 vUv;","#include ","void main() {","\tfloat depth = 1.0 - unpackRGBAToDepth( texture2D( tDiffuse, vUv ) );","\tgl_FragColor = vec4( vec3( depth ), opacity );","}"].join("\n")},tm=function(e,t,n,i,r){(Nf.call(this),this.scene=e,this.camera=t,this.clear=!0,this.needsSwap=!1,this.supportsDepthTextureExtension=void 0!==n&&n,this.supportsNormalTexture=void 0!==i&&i,this.originalClearColor=new gs,this.oldClearColor=new gs,this.oldClearAlpha=1,this.params={output:0,saoBias:.5,saoIntensity:.18,saoScale:1,saoKernelRadius:100,saoMinResolution:0,saoBlur:!0,saoBlurRadius:8,saoBlurStdDev:4,saoBlurDepthCutoff:.01},this.resolution=void 0!==r?new Fi(r.x,r.y):new Fi(256,256),this.saoRenderTarget=new Xi(this.resolution.x,this.resolution.y,{minFilter:1006,magFilter:1006,format:1023}),this.blurIntermediateRenderTarget=this.saoRenderTarget.clone(),this.beautyRenderTarget=this.saoRenderTarget.clone(),this.normalRenderTarget=new Xi(this.resolution.x,this.resolution.y,{minFilter:1003,magFilter:1003,format:1023}),this.depthRenderTarget=this.normalRenderTarget.clone(),this.supportsDepthTextureExtension)&&((n=new Fc).type=1012,n.minFilter=1003,n.maxFilter=1003,this.beautyRenderTarget.depthTexture=n,this.beautyRenderTarget.depthBuffer=!0);this.depthMaterial=new Sl,this.depthMaterial.depthPacking=3201,this.depthMaterial.blending=0,this.normalMaterial=new Xh,this.normalMaterial.blending=0,void 0===Kf&&console.error("THREE.SAOPass relies on SAOShader"),this.saoMaterial=new xo({defines:Object.assign({},Kf.defines),fragmentShader:Kf.fragmentShader,vertexShader:Kf.vertexShader,uniforms:yo.clone(Kf.uniforms)}),this.saoMaterial.extensions.derivatives=!0,this.saoMaterial.defines.DEPTH_PACKING=this.supportsDepthTextureExtension?0:1,this.saoMaterial.defines.NORMAL_TEXTURE=this.supportsNormalTexture?1:0,this.saoMaterial.defines.PERSPECTIVE_CAMERA=this.camera.isPerspectiveCamera?1:0,this.saoMaterial.uniforms.tDepth.value=this.supportsDepthTextureExtension?n:this.depthRenderTarget.texture,this.saoMaterial.uniforms.tNormal.value=this.normalRenderTarget.texture,this.saoMaterial.uniforms.size.value.set(this.resolution.x,this.resolution.y),this.saoMaterial.uniforms.cameraInverseProjectionMatrix.value.getInverse(this.camera.projectionMatrix),this.saoMaterial.uniforms.cameraProjectionMatrix.value=this.camera.projectionMatrix,this.saoMaterial.blending=0,void 0===Qf&&console.error("THREE.SAOPass relies on DepthLimitedBlurShader"),this.vBlurMaterial=new xo({uniforms:yo.clone(Qf.uniforms),defines:Object.assign({},Qf.defines),vertexShader:Qf.vertexShader,fragmentShader:Qf.fragmentShader}),this.vBlurMaterial.defines.DEPTH_PACKING=this.supportsDepthTextureExtension?0:1,this.vBlurMaterial.defines.PERSPECTIVE_CAMERA=this.camera.isPerspectiveCamera?1:0,this.vBlurMaterial.uniforms.tDiffuse.value=this.saoRenderTarget.texture,this.vBlurMaterial.uniforms.tDepth.value=this.supportsDepthTextureExtension?n:this.depthRenderTarget.texture,this.vBlurMaterial.uniforms.size.value.set(this.resolution.x,this.resolution.y),this.vBlurMaterial.blending=0,this.hBlurMaterial=new xo({uniforms:yo.clone(Qf.uniforms),defines:Object.assign({},Qf.defines),vertexShader:Qf.vertexShader,fragmentShader:Qf.fragmentShader}),this.hBlurMaterial.defines.DEPTH_PACKING=this.supportsDepthTextureExtension?0:1,this.hBlurMaterial.defines.PERSPECTIVE_CAMERA=this.camera.isPerspectiveCamera?1:0,this.hBlurMaterial.uniforms.tDiffuse.value=this.blurIntermediateRenderTarget.texture,this.hBlurMaterial.uniforms.tDepth.value=this.supportsDepthTextureExtension?n:this.depthRenderTarget.texture,this.hBlurMaterial.uniforms.size.value.set(this.resolution.x,this.resolution.y),this.hBlurMaterial.blending=0,void 0===Pf&&console.error("THREE.SAOPass relies on CopyShader"),this.materialCopy=new xo({uniforms:yo.clone(Pf.uniforms),vertexShader:Pf.vertexShader,fragmentShader:Pf.fragmentShader,blending:0}),this.materialCopy.transparent=!0,this.materialCopy.depthTest=!1,this.materialCopy.depthWrite=!1,this.materialCopy.blending=5,this.materialCopy.blendSrc=208,this.materialCopy.blendDst=200,this.materialCopy.blendEquation=100,this.materialCopy.blendSrcAlpha=206,this.materialCopy.blendDstAlpha=200,this.materialCopy.blendEquationAlpha=100,void 0===em&&console.error("THREE.SAOPass relies on UnpackDepthRGBAShader"),this.depthCopy=new xo({uniforms:yo.clone(em.uniforms),vertexShader:em.vertexShader,fragmentShader:em.fragmentShader,blending:0}),this.fsQuad=new Nf.FullScreenQuad(null)};tm.OUTPUT={Beauty:1,Default:0,SAO:2,Depth:3,Normal:4},tm.prototype=Object.assign(Object.create(Nf.prototype),{constructor:tm,render:function(e,t,n){if(this.renderToScreen&&(this.materialCopy.blending=0,this.materialCopy.uniforms.tDiffuse.value=n.texture,this.materialCopy.needsUpdate=!0,this.renderPass(e,this.materialCopy,null)),1!==this.params.output){this.oldClearColor.copy(e.getClearColor()),this.oldClearAlpha=e.getClearAlpha();var i=e.autoClear;e.autoClear=!1,e.setRenderTarget(this.depthRenderTarget),e.clear(),this.saoMaterial.uniforms.bias.value=this.params.saoBias,this.saoMaterial.uniforms.intensity.value=this.params.saoIntensity,this.saoMaterial.uniforms.scale.value=this.params.saoScale,this.saoMaterial.uniforms.kernelRadius.value=this.params.saoKernelRadius,this.saoMaterial.uniforms.minResolution.value=this.params.saoMinResolution,this.saoMaterial.uniforms.cameraNear.value=this.camera.near,this.saoMaterial.uniforms.cameraFar.value=this.camera.far;var r=this.params.saoBlurDepthCutoff*(this.camera.far-this.camera.near);this.vBlurMaterial.uniforms.depthCutoff.value=r,this.hBlurMaterial.uniforms.depthCutoff.value=r,this.vBlurMaterial.uniforms.cameraNear.value=this.camera.near,this.vBlurMaterial.uniforms.cameraFar.value=this.camera.far,this.hBlurMaterial.uniforms.cameraNear.value=this.camera.near,this.hBlurMaterial.uniforms.cameraFar.value=this.camera.far,this.params.saoBlurRadius=Math.floor(this.params.saoBlurRadius),this.prevStdDev===this.params.saoBlurStdDev&&this.prevNumSamples===this.params.saoBlurRadius||($f.configure(this.vBlurMaterial,this.params.saoBlurRadius,this.params.saoBlurStdDev,new Fi(0,1)),$f.configure(this.hBlurMaterial,this.params.saoBlurRadius,this.params.saoBlurStdDev,new Fi(1,0)),this.prevStdDev=this.params.saoBlurStdDev,this.prevNumSamples=this.params.saoBlurRadius),e.setClearColor(0),e.setRenderTarget(this.beautyRenderTarget),e.clear(),e.render(this.scene,this.camera),this.supportsDepthTextureExtension||this.renderOverride(e,this.depthMaterial,this.depthRenderTarget,0,1),this.supportsNormalTexture&&this.renderOverride(e,this.normalMaterial,this.normalRenderTarget,7829503,1),this.renderPass(e,this.saoMaterial,this.saoRenderTarget,16777215,1),this.params.saoBlur&&(this.renderPass(e,this.vBlurMaterial,this.blurIntermediateRenderTarget,16777215,1),this.renderPass(e,this.hBlurMaterial,this.saoRenderTarget,16777215,1));var s=this.materialCopy;3===this.params.output?this.supportsDepthTextureExtension?(this.materialCopy.uniforms.tDiffuse.value=this.beautyRenderTarget.depthTexture,this.materialCopy.needsUpdate=!0):(this.depthCopy.uniforms.tDiffuse.value=this.depthRenderTarget.texture,this.depthCopy.needsUpdate=!0,s=this.depthCopy):4===this.params.output?(this.materialCopy.uniforms.tDiffuse.value=this.normalRenderTarget.texture,this.materialCopy.needsUpdate=!0):(this.materialCopy.uniforms.tDiffuse.value=this.saoRenderTarget.texture,this.materialCopy.needsUpdate=!0),0===this.params.output?s.blending=5:s.blending=0,this.renderPass(e,s,this.renderToScreen?null:n),e.setClearColor(this.oldClearColor,this.oldClearAlpha),e.autoClear=i}},renderPass:function(e,t,n,i,r){this.originalClearColor.copy(e.getClearColor());var s=e.getClearAlpha(),o=e.autoClear;e.setRenderTarget(n),e.autoClear=!1,null!=i&&(e.setClearColor(i),e.setClearAlpha(r||0),e.clear()),this.fsQuad.material=t,this.fsQuad.render(e),e.autoClear=o,e.setClearColor(this.originalClearColor),e.setClearAlpha(s)},renderOverride:function(e,t,n,i,r){this.originalClearColor.copy(e.getClearColor());var s=e.getClearAlpha(),o=e.autoClear;e.setRenderTarget(n),e.autoClear=!1,i=t.clearColor||i,r=t.clearAlpha||r,null!=i&&(e.setClearColor(i),e.setClearAlpha(r||0),e.clear()),this.scene.overrideMaterial=t,e.render(this.scene,this.camera),this.scene.overrideMaterial=null,e.autoClear=o,e.setClearColor(this.originalClearColor),e.setClearAlpha(s)},setSize:function(e,t){this.beautyRenderTarget.setSize(e,t),this.saoRenderTarget.setSize(e,t),this.blurIntermediateRenderTarget.setSize(e,t),this.normalRenderTarget.setSize(e,t),this.depthRenderTarget.setSize(e,t),this.saoMaterial.uniforms.size.value.set(e,t),this.saoMaterial.uniforms.cameraInverseProjectionMatrix.value.getInverse(this.camera.projectionMatrix),this.saoMaterial.uniforms.cameraProjectionMatrix.value=this.camera.projectionMatrix,this.saoMaterial.needsUpdate=!0,this.vBlurMaterial.uniforms.size.value.set(e,t),this.vBlurMaterial.needsUpdate=!0,this.hBlurMaterial.uniforms.size.value.set(e,t),this.hBlurMaterial.needsUpdate=!0}});var nm={extends:Gf,props:{depthTexture:{type:Boolean,default:!1},useNormals:{type:Boolean,default:!1},resolution:Object},mounted(){this.three.scene||console.error("Missing Scene"),this.three.camera||console.error("Missing Camera");const e=this.resolution?new Fi(this.resolution.x,this.resolution.y):new Fi(this.three.size.width,this.three.size.height),t=new tm(this.three.scene,this.three.camera,this.depthTexture,this.useNormals,e);this.passes.push(t),this.pass=t},__hmrId:"SAOPass"},im={shaderID:"luminosityHighPass",uniforms:{tDiffuse:{value:null},luminosityThreshold:{value:1},smoothWidth:{value:1},defaultColor:{value:new gs(0)},defaultOpacity:{value:0}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform vec3 defaultColor;","uniform float defaultOpacity;","uniform float luminosityThreshold;","uniform float smoothWidth;","varying vec2 vUv;","void main() {","\tvec4 texel = texture2D( tDiffuse, vUv );","\tvec3 luma = vec3( 0.299, 0.587, 0.114 );","\tfloat v = dot( texel.xyz, luma );","\tvec4 outputColor = vec4( defaultColor.rgb, defaultOpacity );","\tfloat alpha = smoothstep( luminosityThreshold, luminosityThreshold + smoothWidth, v );","\tgl_FragColor = mix( outputColor, texel, alpha );","}"].join("\n")},rm=function(e,t,n,i){Nf.call(this),this.strength=void 0!==t?t:1,this.radius=n,this.threshold=i,this.resolution=void 0!==e?new Fi(e.x,e.y):new Fi(256,256),this.clearColor=new gs(0,0,0);var r={minFilter:1006,magFilter:1006,format:1023};this.renderTargetsHorizontal=[],this.renderTargetsVertical=[],this.nMips=5;var s=Math.round(this.resolution.x/2),o=Math.round(this.resolution.y/2);this.renderTargetBright=new Xi(s,o,r),this.renderTargetBright.texture.name="UnrealBloomPass.bright",this.renderTargetBright.texture.generateMipmaps=!1;for(var a=0;a\t\t\t\tvarying vec2 vUv;\n\t\t\t\tuniform sampler2D colorTexture;\n\t\t\t\tuniform vec2 texSize;\t\t\t\tuniform vec2 direction;\t\t\t\t\t\t\t\tfloat gaussianPdf(in float x, in float sigma) {\t\t\t\t\treturn 0.39894 * exp( -0.5 * x * x/( sigma * sigma))/sigma;\t\t\t\t}\t\t\t\tvoid main() {\n\t\t\t\t\tvec2 invSize = 1.0 / texSize;\t\t\t\t\tfloat fSigma = float(SIGMA);\t\t\t\t\tfloat weightSum = gaussianPdf(0.0, fSigma);\t\t\t\t\tvec3 diffuseSum = texture2D( colorTexture, vUv).rgb * weightSum;\t\t\t\t\tfor( int i = 1; i < KERNEL_RADIUS; i ++ ) {\t\t\t\t\t\tfloat x = float(i);\t\t\t\t\t\tfloat w = gaussianPdf(x, fSigma);\t\t\t\t\t\tvec2 uvOffset = direction * invSize * x;\t\t\t\t\t\tvec3 sample1 = texture2D( colorTexture, vUv + uvOffset).rgb;\t\t\t\t\t\tvec3 sample2 = texture2D( colorTexture, vUv - uvOffset).rgb;\t\t\t\t\t\tdiffuseSum += (sample1 + sample2) * w;\t\t\t\t\t\tweightSum += 2.0 * w;\t\t\t\t\t}\t\t\t\t\tgl_FragColor = vec4(diffuseSum/weightSum, 1.0);\n\t\t\t\t}"})},getCompositeMaterial:function(e){return new xo({defines:{NUM_MIPS:e},uniforms:{blurTexture1:{value:null},blurTexture2:{value:null},blurTexture3:{value:null},blurTexture4:{value:null},blurTexture5:{value:null},dirtTexture:{value:null},bloomStrength:{value:1},bloomFactors:{value:null},bloomTintColors:{value:null},bloomRadius:{value:0}},vertexShader:"varying vec2 vUv;\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"varying vec2 vUv;\t\t\t\tuniform sampler2D blurTexture1;\t\t\t\tuniform sampler2D blurTexture2;\t\t\t\tuniform sampler2D blurTexture3;\t\t\t\tuniform sampler2D blurTexture4;\t\t\t\tuniform sampler2D blurTexture5;\t\t\t\tuniform sampler2D dirtTexture;\t\t\t\tuniform float bloomStrength;\t\t\t\tuniform float bloomRadius;\t\t\t\tuniform float bloomFactors[NUM_MIPS];\t\t\t\tuniform vec3 bloomTintColors[NUM_MIPS];\t\t\t\t\t\t\t\tfloat lerpBloomFactor(const in float factor) { \t\t\t\t\tfloat mirrorFactor = 1.2 - factor;\t\t\t\t\treturn mix(factor, mirrorFactor, bloomRadius);\t\t\t\t}\t\t\t\t\t\t\t\tvoid main() {\t\t\t\t\tgl_FragColor = bloomStrength * ( lerpBloomFactor(bloomFactors[0]) * vec4(bloomTintColors[0], 1.0) * texture2D(blurTexture1, vUv) + \t\t\t\t\t\t\t\t\t\t\t\t\t lerpBloomFactor(bloomFactors[1]) * vec4(bloomTintColors[1], 1.0) * texture2D(blurTexture2, vUv) + \t\t\t\t\t\t\t\t\t\t\t\t\t lerpBloomFactor(bloomFactors[2]) * vec4(bloomTintColors[2], 1.0) * texture2D(blurTexture3, vUv) + \t\t\t\t\t\t\t\t\t\t\t\t\t lerpBloomFactor(bloomFactors[3]) * vec4(bloomTintColors[3], 1.0) * texture2D(blurTexture4, vUv) + \t\t\t\t\t\t\t\t\t\t\t\t\t lerpBloomFactor(bloomFactors[4]) * vec4(bloomTintColors[4], 1.0) * texture2D(blurTexture5, vUv) );\t\t\t\t}"})}}),rm.BlurDirectionX=new Fi(1,0),rm.BlurDirectionY=new Fi(0,1);var sm={extends:Gf,props:{strength:{type:Number,default:1.5},radius:{type:Number,default:0},threshold:{type:Number,default:0}},watch:{strength(){this.pass.strength=this.strength},radius(){this.pass.radius=this.radius},threshold(){this.pass.threshold=this.threshold}},mounted(){const e=new Fi(this.three.size.width,this.three.size.height),t=new rm(e,this.strength,this.radius,this.threshold);this.passes.push(t),this.pass=t},__hmrId:"UnrealBloomPass"},om="\n//\n// Description : Array and textureless GLSL 2D simplex noise function.\n// Author : Ian McEwan, Ashima Arts.\n// Maintainer : ijm\n// Lastmod : 20110822 (ijm)\n// License : Copyright (C) 2011 Ashima Arts. All rights reserved.\n// Distributed under the MIT License. See LICENSE file.\n// https://github.com/ashima/webgl-noise\n//\n\nvec3 mod289(vec3 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec2 mod289(vec2 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec3 permute(vec3 x) {\n return mod289(((x*34.0)+1.0)*x);\n}\n\nfloat snoise(vec2 v)\n{\n const vec4 C = vec4(0.211324865405187, // (3.0-sqrt(3.0))/6.0\n 0.366025403784439, // 0.5*(sqrt(3.0)-1.0)\n -0.577350269189626, // -1.0 + 2.0 * C.x\n 0.024390243902439); // 1.0 / 41.0\n // First corner\n vec2 i = floor(v + dot(v, C.yy) );\n vec2 x0 = v - i + dot(i, C.xx);\n\n // Other corners\n vec2 i1;\n i1 = (x0.x > x0.y) ? vec2(1.0, 0.0) : vec2(0.0, 1.0);\n vec4 x12 = x0.xyxy + C.xxzz;\n x12.xy -= i1;\n\n // Permutations\n i = mod289(i); // Avoid truncation effects in permutation\n vec3 p = permute( permute( i.y + vec3(0.0, i1.y, 1.0 ))\n + i.x + vec3(0.0, i1.x, 1.0 ));\n\n vec3 m = max(0.5 - vec3(dot(x0,x0), dot(x12.xy,x12.xy), dot(x12.zw,x12.zw)), 0.0);\n m = m*m ;\n m = m*m ;\n\n // Gradients: 41 points uniformly over a line, mapped onto a diamond.\n // The ring size 17*17 = 289 is close to a multiple of 41 (41*7 = 287)\n\n vec3 x = 2.0 * fract(p * C.www) - 1.0;\n vec3 h = abs(x) - 0.5;\n vec3 ox = floor(x + 0.5);\n vec3 a0 = x - ox;\n\n // Normalise gradients implicitly by scaling m\n // Approximation of: m *= inversesqrt( a0*a0 + h*h );\n m *= 1.79284291400159 - 0.85373472095314 * ( a0*a0 + h*h );\n\n // Compute final noise value at P\n vec3 g;\n g.x = a0.x * x0.x + h.x * x0.y;\n g.yz = a0.yz * x12.xz + h.yz * x12.yw;\n return 130.0 * dot(m, g);\n}\n",am={extends:Ef,props:{widthSegments:{type:Number,default:20},heightSegments:{type:Number,default:20},timeCoef:{type:Number,default:.001},noiseCoef:{type:Number,default:1},zCoef:{type:Number,default:5},dispCoef:{type:Number,default:.05}},setup(e){const t={value:e.noiseCoef};On(()=>e.noiseCoef,e=>{t.value=e});const n={value:e.zCoef};On(()=>e.zCoef,e=>{n.value=e});const i={value:e.dispCoef};return On(()=>e.dispCoef,e=>{i.value=e}),{uTime:{value:0},uNoiseCoef:t,uZCoef:n,uDispCoef:i}},mounted(){this.startTime=Date.now(),this.three.onBeforeRender(this.updateTime)},unmounted(){this.three.offBeforeRender(this.updateTime)},methods:{createGeometry(){this.geometry=new Ro(1,1,this.widthSegments,this.heightSegments)},createMaterial(){this.material=new _s({side:2,map:this.loadTexture()}),this.material.onBeforeCompile=e=>{e.uniforms.uTime=this.uTime,e.uniforms.uNoiseCoef=this.uNoiseCoef,e.uniforms.uZCoef=this.uZCoef,e.uniforms.uDispCoef=this.uDispCoef,e.vertexShader=`\n uniform float uTime;\n uniform float uNoiseCoef;\n uniform float uZCoef;\n varying float vNoise;\n ${om}\n `+e.vertexShader,e.vertexShader=e.vertexShader.replace("#include "," \n vec3 p = vec3(position * uNoiseCoef);\n p.x += uTime;\n vNoise = snoise(p.xy);\n vec3 transformed = vec3(position);\n transformed.z += vNoise * uZCoef;\n "),e.fragmentShader="\n uniform float uDispCoef;\n varying float vNoise;\n "+e.fragmentShader,e.fragmentShader=e.fragmentShader.replace("#include ","\n vec4 texelColor = texture2D(map, vUv);\n vec4 dispTexel = texture2D(map, vUv + vec2(vNoise * uDispCoef, 0));\n texelColor.r = dispTexel.r;\n diffuseColor = texelColor;\n "),this.materialShader=e}},updateTime(){this.uTime.value=(Date.now()-this.startTime)*this.timeCoef}},__hmrId:"NoisyImage"},lm={extends:gf,props:{timeCoef:{type:Number,default:.001},noiseCoef:{type:Number,default:1},zCoef:{type:Number,default:5}},setup(e){const t={value:e.noiseCoef};On(()=>e.noiseCoef,e=>{t.value=e});const n={value:e.zCoef};return On(()=>e.zCoef,e=>{n.value=e}),{uTime:{value:0},uNoiseCoef:t,uZCoef:n}},mounted(){this.updateMaterial(),this.startTime=Date.now(),this.three.onBeforeRender(this.updateTime)},unmounted(){this.three.offBeforeRender(this.updateTime)},methods:{updateMaterial(){this.material.onBeforeCompile=e=>{e.uniforms.uTime=this.uTime,e.uniforms.uNoiseCoef=this.uNoiseCoef,e.uniforms.uZCoef=this.uZCoef,e.vertexShader="\n uniform float uTime;\n uniform float uNoiseCoef;\n uniform float uZCoef;\n varying float vNoise;\n \n//\n// Description : Array and textureless GLSL 2D/3D/4D simplex\n// noise functions.\n// Author : Ian McEwan, Ashima Arts.\n// Maintainer : ijm\n// Lastmod : 20110822 (ijm)\n// License : Copyright (C) 2011 Ashima Arts. All rights reserved.\n// Distributed under the MIT License. See LICENSE file.\n// https://github.com/ashima/webgl-noise\n//\n\nvec3 mod289(vec3 x) { return x - floor(x * (1.0 / 289.0)) * 289.0; }\nvec4 mod289(vec4 x) { return x - floor(x * (1.0 / 289.0)) * 289.0; }\nvec4 permute(vec4 x) { return mod289(((x*34.0)+1.0)*x); }\nvec4 taylorInvSqrt(vec4 r) { return 1.79284291400159 - 0.85373472095314 * r; }\n\nfloat snoise(vec3 v)\n{\n const vec2 C = vec2(1.0/6.0, 1.0/3.0) ;\n const vec4 D = vec4(0.0, 0.5, 1.0, 2.0);\n\n // First corner\n vec3 i = floor(v + dot(v, C.yyy) );\n vec3 x0 = v - i + dot(i, C.xxx) ;\n\n // Other corners\n vec3 g = step(x0.yzx, x0.xyz);\n vec3 l = 1.0 - g;\n vec3 i1 = min( g.xyz, l.zxy );\n vec3 i2 = max( g.xyz, l.zxy );\n\n vec3 x1 = x0 - i1 + C.xxx;\n vec3 x2 = x0 - i2 + C.yyy; // 2.0*C.x = 1/3 = C.y\n vec3 x3 = x0 - D.yyy; // -1.0+3.0*C.x = -0.5 = -D.y\n\n // Permutations\n i = mod289(i);\n vec4 p = permute( permute( permute(\n i.z + vec4(0.0, i1.z, i2.z, 1.0 ))\n + i.y + vec4(0.0, i1.y, i2.y, 1.0 ))\n + i.x + vec4(0.0, i1.x, i2.x, 1.0 ));\n\n // Gradients: 7x7 points over a square, mapped onto an octahedron.\n // The ring size 17*17 = 289 is close to a multiple of 49 (49*6 = 294)\n float n_ = 0.142857142857; // 1.0/7.0\n vec3 ns = n_ * D.wyz - D.xzx;\n\n vec4 j = p - 49.0 * floor(p * ns.z * ns.z); // mod(p,7*7)\n\n vec4 x_ = floor(j * ns.z);\n vec4 y_ = floor(j - 7.0 * x_ ); // mod(j,N)\n\n vec4 x = x_ *ns.x + ns.yyyy;\n vec4 y = y_ *ns.x + ns.yyyy;\n vec4 h = 1.0 - abs(x) - abs(y);\n\n vec4 b0 = vec4( x.xy, y.xy );\n vec4 b1 = vec4( x.zw, y.zw );\n\n vec4 s0 = floor(b0)*2.0 + 1.0;\n vec4 s1 = floor(b1)*2.0 + 1.0;\n vec4 sh = -step(h, vec4(0.0));\n\n vec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy ;\n vec4 a1 = b1.xzyw + s1.xzyw*sh.zzww ;\n\n vec3 p0 = vec3(a0.xy,h.x);\n vec3 p1 = vec3(a0.zw,h.y);\n vec3 p2 = vec3(a1.xy,h.z);\n vec3 p3 = vec3(a1.zw,h.w);\n\n // Normalise gradients\n vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3)));\n p0 *= norm.x;\n p1 *= norm.y;\n p2 *= norm.z;\n p3 *= norm.w;\n\n // Mix final noise value\n vec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.0);\n m = m * m;\n return 42.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1),\n dot(p2,x2), dot(p3,x3) ) );\n}\n\n "+e.vertexShader,e.vertexShader=e.vertexShader.replace("#include "," \n vec3 p = vec3(position * uNoiseCoef);\n vNoise = snoise(vec3(p.x, p.y, uTime));\n vec3 transformed = vec3(position);\n transformed.z += vNoise * uZCoef;\n "),this.materialShader=e},this.material.needsupdate=!0},updateTime(){this.uTime.value=(Date.now()-this.startTime)*this.timeCoef}},__hmrId:"NoisyPlane"},cm={extends:xf,props:{radius:{type:Number,default:20},widthSegments:{type:Number,default:128},heightSegments:{type:Number,default:128},timeCoef:{type:Number,default:.001},noiseCoef:{type:Number,default:.05},dispCoef:{type:Number,default:5}},setup(e){const t={value:e.noiseCoef};On(()=>e.noiseCoef,e=>{t.value=e});const n={value:e.dispCoef};return On(()=>e.dispCoef,e=>{n.value=e}),{uTime:{value:0},uNoiseCoef:t,uDispCoef:n}},mounted(){this.updateMaterial(),this.startTime=Date.now(),this.three.onBeforeRender(this.updateTime)},unmounted(){this.three.offBeforeRender(this.updateTime)},methods:{updateMaterial(){this.material.onBeforeCompile=e=>{e.uniforms.uTime=this.uTime,e.uniforms.uNoiseCoef=this.uNoiseCoef,e.uniforms.uDispCoef=this.uDispCoef,e.vertexShader="\n uniform float uTime;\n uniform float uNoiseCoef;\n uniform float uDispCoef;\n varying float vNoise;\n \n//\n// Description : Array and textureless GLSL 2D/3D/4D simplex\n// noise functions.\n// Author : Ian McEwan, Ashima Arts.\n// Maintainer : ijm\n// Lastmod : 20110822 (ijm)\n// License : Copyright (C) 2011 Ashima Arts. All rights reserved.\n// Distributed under the MIT License. See LICENSE file.\n// https://github.com/ashima/webgl-noise\n//\n\nvec4 mod289(vec4 x) { return x - floor(x * (1.0 / 289.0)) * 289.0; }\nfloat mod289(float x) { return x - floor(x * (1.0 / 289.0)) * 289.0; }\nvec4 permute(vec4 x) { return mod289(((x*34.0)+1.0)*x); }\nfloat permute(float x) { return mod289(((x*34.0)+1.0)*x); }\nvec4 taylorInvSqrt(vec4 r) { return 1.79284291400159 - 0.85373472095314 * r; }\nfloat taylorInvSqrt(float r) { return 1.79284291400159 - 0.85373472095314 * r; }\n\nvec4 grad4(float j, vec4 ip)\n{\n const vec4 ones = vec4(1.0, 1.0, 1.0, -1.0);\n vec4 p,s;\n\n p.xyz = floor( fract (vec3(j) * ip.xyz) * 7.0) * ip.z - 1.0;\n p.w = 1.5 - dot(abs(p.xyz), ones.xyz);\n s = vec4(lessThan(p, vec4(0.0)));\n p.xyz = p.xyz + (s.xyz*2.0 - 1.0) * s.www;\n\n return p;\n}\n\n// (sqrt(5) - 1)/4 = F4, used once below\n#define F4 0.309016994374947451\n\nfloat snoise(vec4 v)\n{\n const vec4 C = vec4( 0.138196601125011, // (5 - sqrt(5))/20 G4\n 0.276393202250021, // 2 * G4\n 0.414589803375032, // 3 * G4\n -0.447213595499958); // -1 + 4 * G4\n\n // First corner\n vec4 i = floor(v + dot(v, vec4(F4)) );\n vec4 x0 = v - i + dot(i, C.xxxx);\n\n // Other corners\n\n // Rank sorting originally contributed by Bill Licea-Kane, AMD (formerly ATI)\n vec4 i0;\n vec3 isX = step( x0.yzw, x0.xxx );\n vec3 isYZ = step( x0.zww, x0.yyz );\n // i0.x = dot( isX, vec3( 1.0 ) );\n i0.x = isX.x + isX.y + isX.z;\n i0.yzw = 1.0 - isX;\n // i0.y += dot( isYZ.xy, vec2( 1.0 ) );\n i0.y += isYZ.x + isYZ.y;\n i0.zw += 1.0 - isYZ.xy;\n i0.z += isYZ.z;\n i0.w += 1.0 - isYZ.z;\n\n // i0 now contains the unique values 0,1,2,3 in each channel\n vec4 i3 = clamp( i0, 0.0, 1.0 );\n vec4 i2 = clamp( i0-1.0, 0.0, 1.0 );\n vec4 i1 = clamp( i0-2.0, 0.0, 1.0 );\n\n vec4 x1 = x0 - i1 + C.xxxx;\n vec4 x2 = x0 - i2 + C.yyyy;\n vec4 x3 = x0 - i3 + C.zzzz;\n vec4 x4 = x0 + C.wwww;\n\n // Permutations\n i = mod289(i);\n float j0 = permute( permute( permute( permute(i.w) + i.z) + i.y) + i.x);\n vec4 j1 = permute( permute( permute( permute (\n i.w + vec4(i1.w, i2.w, i3.w, 1.0 ))\n + i.z + vec4(i1.z, i2.z, i3.z, 1.0 ))\n + i.y + vec4(i1.y, i2.y, i3.y, 1.0 ))\n + i.x + vec4(i1.x, i2.x, i3.x, 1.0 ));\n\n // Gradients: 7x7x6 points over a cube, mapped onto a 4-cross polytope\n // 7*7*6 = 294, which is close to the ring size 17*17 = 289.\n vec4 ip = vec4(1.0/294.0, 1.0/49.0, 1.0/7.0, 0.0) ;\n\n vec4 p0 = grad4(j0, ip);\n vec4 p1 = grad4(j1.x, ip);\n vec4 p2 = grad4(j1.y, ip);\n vec4 p3 = grad4(j1.z, ip);\n vec4 p4 = grad4(j1.w, ip);\n\n // Normalise gradients\n vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3)));\n p0 *= norm.x;\n p1 *= norm.y;\n p2 *= norm.z;\n p3 *= norm.w;\n p4 *= taylorInvSqrt(dot(p4,p4));\n\n // Mix contributions from the five corners\n vec3 m0 = max(0.6 - vec3(dot(x0,x0), dot(x1,x1), dot(x2,x2)), 0.0);\n vec2 m1 = max(0.6 - vec2(dot(x3,x3), dot(x4,x4) ), 0.0);\n m0 = m0 * m0;\n m1 = m1 * m1;\n return 49.0 * ( dot(m0*m0, vec3( dot( p0, x0 ), dot( p1, x1 ), dot( p2, x2 )))\n + dot(m1*m1, vec2( dot( p3, x3 ), dot( p4, x4 ) ) ) ) ;\n\n}\n\n "+e.vertexShader,e.vertexShader=e.vertexShader.replace("#include ","\n vec4 p = vec4(vec3(position * uNoiseCoef), uTime);\n vNoise = snoise(p);\n vec3 transformed = vec3(position);\n transformed += normalize(position) * vNoise * uDispCoef;\n "),this.materialShader=e},this.material.needsupdate=!0},updateTime(){this.uTime.value=(Date.now()-this.startTime)*this.timeCoef}},__hmrId:"NoisySphere"},hm={extends:bf,props:{timeCoef:{type:Number,default:.001},noiseCoef:{type:Number,default:.015},zCoef:{type:Number,default:10}},setup(e){const t={value:e.noiseCoef};On(()=>e.noiseCoef,e=>{t.value=e});const n={value:e.zCoef};return On(()=>e.zCoef,e=>{n.value=e}),{uTime:{value:0},uNoiseCoef:t,uZCoef:n}},mounted(){this.updateMaterial(),this.startTime=Date.now(),this.three.onBeforeRender(this.updateTime)},unmounted(){this.three.offBeforeRender(this.updateTime)},methods:{updateMaterial(){this.material.onBeforeCompile=e=>{e.uniforms.uTime=this.uTime,e.uniforms.uNoiseCoef=this.uNoiseCoef,e.uniforms.uZCoef=this.uZCoef,e.vertexShader=`\n uniform float uTime;\n uniform float uNoiseCoef;\n uniform float uZCoef;\n ${om}\n `+e.vertexShader,e.vertexShader=e.vertexShader.replace("#include "," \n vec3 p = vec3(position * uNoiseCoef);\n p.x += uTime;\n float noise = snoise(p.xy);\n vec3 transformed = vec3(position);\n transformed.z += noise * uZCoef;\n "),this.materialShader=e},this.material.needsupdate=!0},updateTime(){this.uTime.value=(Date.now()-this.startTime)*this.timeCoef}},__hmrId:"NoisyText"};function um(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function dm(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t} /*! * GSAP 3.5.1 * https://greensock.com @@ -7,7 +7,7 @@ function e(e,t){const n=Object.create(null),i=e.split(",");for(let e=0;ee._dur||t._start<0))for(var n=e;n;)n._dirty=1,n=n.parent;return e},kg=function(e){for(var t=e.parent;t&&t.parent;)t._dirty=1,t.totalDuration(),t=t.parent;return e},Hg=function(e){return e._repeat?Vg(e._tTime,e=e.duration()+e._rDelay)*e:0},Vg=function(e,t){return(e/=t)&&~~e===e?~~e-1:~~e},jg=function(e,t){return(e-t._start)*t._ts+(t._ts>=0?0:t._dirty?t.totalDuration():t._tDur)},Wg=function(e){return e._end=Tg(e._start+(e._tDur/Math.abs(e._ts||e._rts||1e-8)||0))},qg=function(e,t){var n=e._dp;return n&&n.smoothChildTiming&&e._ts&&(e._start=Tg(e._dp._time-(e._ts>0?t/e._ts:((e._dirty?e.totalDuration():e._tDur)-t)/-e._ts)),Wg(e),n._dirty||Gg(n,e)),e},Xg=function(e,t){var n;if((t._time||t._initted&&!t._dur)&&(n=jg(e.rawTime(),t),(!t._dur||nv(0,t.totalDuration(),n)-t._tTime>1e-8)&&t.render(n,!0)),Gg(e,t)._dp&&e._initted&&e._time>=e._dur&&e._ts){if(e._dur=0&&n.totalTime(n._tTime),n=n._dp;e._zTime=-1e-8}},Yg=function(e,t,n,i){return t.parent&&Fg(t),t._start=Tg(n+t._delay),t._end=Tg(t._start+(t.totalDuration()/Math.abs(t.timeScale())||0)),function(e,t,n,i,r){void 0===n&&(n="_first"),void 0===i&&(i="_last");var s,o=e[i];if(r)for(s=t[r];o&&o[r]>s;)o=o._prev;o?(t._next=o._next,o._next=t):(t._next=e[n],e[n]=t),t._next?t._next._prev=t:e[i]=t,t._prev=o,t.parent=t._dp=e}(e,t,"_first","_last",e._sort?"_start":0),e._recent=t,i||Xg(e,t),e},Zg=function(e,t){return(og.ScrollTrigger||cg("scrollTrigger",t))&&og.ScrollTrigger.create(t,e)},Jg=function(e,t,n,i){return Xv(e,t),e._initted?!n&&e._pt&&(e._dur&&!1!==e.vars.lazy||!e._dur&&e.vars.lazy)&&pm!==Av.frame?(fg.push(e),e._lazy=[t,i],1):void 0:1},Kg=function(e,t,n,i){var r=e._repeat,s=Tg(t)||0,o=e._tTime/e._tDur;return o&&!i&&(e._time*=s/e._dur),e._dur=s,e._tDur=r?r<0?1e10:Tg(s*(r+1)+e._rDelay*r):s,o&&!i?qg(e,e._tTime=e._tDur*o):e.parent&&Wg(e),n||Gg(e.parent,e),e},Qg=function(e){return e instanceof Hv?Gg(e):Kg(e,e._dur)},$g={_start:0,endTime:dg},ev=function e(t,n){var i,r,s=t.labels,o=t._recent||$g,a=t.duration()>=Um?o.endTime(!1):t._dur;return jm(n)&&(isNaN(n)||n in s)?"<"===(i=n.charAt(0))||">"===i?("<"===i?o._start:o.endTime(o._repeat>=0))+(parseFloat(n.substr(1))||0):(i=n.indexOf("="))<0?(n in s||(s[n]=a),s[n]):(r=+(n.charAt(i-1)+n.substr(i+1)),i>1?e(t,n.substr(0,i-1))+r:a+r):null==n?a:+n},tv=function(e,t){return e||0===e?t(e):t},nv=function(e,t,n){return nt?t:n},iv=function(e){return(e=(e+"").substr((parseFloat(e)+"").length))&&isNaN(e)?e:""},rv=[].slice,sv=function(e,t){return e&&Ym(e)&&"length"in e&&(!t&&!e.length||e.length-1 in e&&Ym(e[0]))&&!e.nodeType&&e!==cm},ov=function(e,t){return!jm(e)||t||!hm&&Cv()?$m(e)?function(e,t,n){return void 0===n&&(n=[]),e.forEach((function(e){var i;return jm(e)&&!t||sv(e,1)?(i=n).push.apply(i,ov(e)):n.push(e)}))||n}(e,t):sv(e)?rv.call(e,0):e?[e]:[]:rv.call(um.querySelectorAll(e),0)},av=function(e){return e.sort((function(){return.5-Math.random()}))},lv=function(e){if(Wm(e))return e;var t=Ym(e)?e:{each:e},n=Ov(t.ease),i=t.from||0,r=parseFloat(t.base)||0,s={},o=i>0&&i<1,a=isNaN(i)||o,l=t.axis,c=i,h=i;return jm(i)?c=h={center:.5,edges:.5,end:1}[i]||0:!o&&a&&(c=i[0],h=i[1]),function(e,o,u){var d,p,f,m,g,v,y,x,_,b=(u||t).length,w=s[b];if(!w){if(!(_="auto"===t.grid?0:(t.grid||[1,Um])[1])){for(y=-Um;y<(y=u[_++].getBoundingClientRect().left)&&_y&&(y=g),gb?b-1:l?"y"===l?b/_:_:Math.max(_,b/_))||0)*("edges"===i?-1:1),w.b=b<0?r-b:r,w.u=iv(t.amount||t.each)||0,n=n&&b<0?Dv(n):n}return b=(w[e]-w.min)/w.max||0,Tg(w.b+(n?n(b):b)*w.v)+w.u}},cv=function(e){var t=e<1?Math.pow(10,(e+"").length-2):1;return function(n){return Math.floor(Math.round(parseFloat(n)/e)*e*t)/t+(qm(n)?0:iv(n))}},hv=function(e,t){var n,i,r=$m(e);return!r&&Ym(e)&&(n=r=e.radius||Um,e.values?(e=ov(e.values),(i=!qm(e[0]))&&(n*=n)):e=cv(e.increment)),tv(t,r?Wm(e)?function(t){return i=e(t),Math.abs(i-t)<=n?i:t}:function(t){for(var r,s,o=parseFloat(i?t.x:t),a=parseFloat(i?t.y:0),l=Um,c=0,h=e.length;h--;)(r=i?(r=e[h].x-o)*r+(s=e[h].y-a)*s:Math.abs(e[h]-o))(r=Math.abs(r))&&(s=i,a=r);return s},gv=function(e,t,n){var i,r,s=e.vars,o=s[t];if(o)return i=s[t+"Params"],r=s.callbackScope||e,n&&fg.length&&Cg(),i?o.apply(r,i):o.call(r)},vv=function(e){return Fg(e),e.progress()<1&&gv(e,"onInterrupt"),e},yv=function(e){var t=(e=!e.name&&e.default||e).name,n=Wm(e),i=t&&!n&&e.init?function(){this._props=[]}:e,r={init:dg,render:oy,add:Wv,kill:ly,modifier:ay,rawVars:0},s={targetTest:0,get:0,getSetter:ny,aliases:{},register:0};if(Cv(),e!==i){if(gg[t])return;Ng(i,Ng(zg(e,r),s)),Ig(i.prototype,Ig(r,zg(e,s))),gg[i.prop=t]=i,e.targetTest&&(xg.push(i),pg[t]=1),t=("css"===t?"CSS":t.charAt(0).toUpperCase()+t.substr(1))+"Plugin"}ug(t,i),e.register&&e.register(my,i,uy)},xv={aqua:[0,255,255],lime:[0,255,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,255],navy:[0,0,128],white:[255,255,255],olive:[128,128,0],yellow:[255,255,0],orange:[255,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[255,0,0],pink:[255,192,203],cyan:[0,255,255],transparent:[255,255,255,0]},_v=function(e,t,n){return 255*(6*(e=e<0?e+1:e>1?e-1:e)<1?t+(n-t)*e*6:e<.5?n:3*e<2?t+(n-t)*(2/3-e)*6:t)+.5|0},bv=function(e,t,n){var i,r,s,o,a,l,c,h,u,d,p=e?qm(e)?[e>>16,e>>8&255,255&e]:0:xv.black;if(!p){if(","===e.substr(-1)&&(e=e.substr(0,e.length-1)),xv[e])p=xv[e];else if("#"===e.charAt(0))4===e.length&&(i=e.charAt(1),r=e.charAt(2),s=e.charAt(3),e="#"+i+i+r+r+s+s),p=[(e=parseInt(e.substr(1),16))>>16,e>>8&255,255&e];else if("hsl"===e.substr(0,3))if(p=d=e.match(eg),t){if(~e.indexOf("="))return p=e.match(tg),n&&p.length<4&&(p[3]=1),p}else o=+p[0]%360/360,a=+p[1]/100,i=2*(l=+p[2]/100)-(r=l<=.5?l*(a+1):l+a-l*a),p.length>3&&(p[3]*=1),p[0]=_v(o+1/3,i,r),p[1]=_v(o,i,r),p[2]=_v(o-1/3,i,r);else p=e.match(eg)||xv.transparent;p=p.map(Number)}return t&&!d&&(i=p[0]/255,r=p[1]/255,s=p[2]/255,l=((c=Math.max(i,r,s))+(h=Math.min(i,r,s)))/2,c===h?o=a=0:(u=c-h,a=l>.5?u/(2-c-h):u/(c+h),o=c===i?(r-s)/u+(rMm&&(Tm+=o-Sm),((n=(r=(Em+=o)-Tm)-Cm)>0||a)&&(s=++xm.frame,_m=r-1e3*xm.time,xm.time=r/=1e3,Cm+=n+(n>=Am?4:Am-n),i=1),a||(gm=vm(e)),i)for(bm=0;bm=t&&bm--},_listeners:Lm=[]}),Cv=function(){return!mm&&Av.wake()},Lv={},Rv=/^[\d.\-M][\d.\-,\s]/,Pv=/["']/g,Nv=function(e){for(var t,n,i,r={},s=e.substr(1,e.length-3).split(":"),o=s[0],a=1,l=s.length;a1&&o.config?o.config.apply(null,~e.indexOf("{")?[Nv(s[1])]:(t=e,n=t.indexOf("(")+1,i=t.indexOf(")"),r=t.indexOf("(",n),t.substring(n,~r&&r=1?n:1,s=(i||(t?.3:.45))/(n<1?n:1),o=s/Bm*(Math.asin(1/r)||0),a=function(e){return 1===e?1:r*Math.pow(2,-10*e)*Vm((e-o)*s)+1},l="out"===t?a:"in"===t?function(e){return 1-a(1-e)}:Uv(a);return s=Bm/s,l.config=function(n,i){return e(t,n,i)},l},Fv=function e(t,n){void 0===n&&(n=1.70158);var i=function(e){return e?--e*e*((n+1)*e+n)+1:0},r="out"===t?i:"in"===t?function(e){return 1-i(1-e)}:Uv(i);return r.config=function(n){return e(t,n)},r};Sg("Linear,Quad,Cubic,Quart,Quint,Strong",(function(e,t){var n=t<5?t+1:t;zv(e+",Power"+(n-1),t?function(e){return Math.pow(e,n)}:function(e){return e},(function(e){return 1-Math.pow(1-e,n)}),(function(e){return e<.5?Math.pow(2*e,n)/2:1-Math.pow(2*(1-e),n)/2}))})),Lv.Linear.easeNone=Lv.none=Lv.Linear.easeIn,zv("Elastic",Bv("in"),Bv("out"),Bv()),Pm=7.5625,Dm=1/(Nm=2.75),zv("Bounce",(function(e){return 1-Im(1-e)}),Im=function(e){return e0?e+(e+this._rDelay)*this._repeat:e):this.totalDuration()&&this._dur},t.totalDuration=function(e){return arguments.length?(this._dirty=0,Kg(this,this._repeat<0?e:(e-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},t.totalTime=function(e,t){if(Cv(),!arguments.length)return this._tTime;var n=this._dp;if(n&&n.smoothChildTiming&&this._ts){for(qg(this,e);n.parent;)n.parent._time!==n._start+(n._ts>=0?n._tTime/n._ts:(n.totalDuration()-n._tTime)/-n._ts)&&n.totalTime(n._tTime,!0),n=n.parent;!this.parent&&this._dp.autoRemoveChildren&&(this._ts>0&&e0||!this._tDur&&!e)&&Yg(this._dp,this,this._start-this._delay)}return(this._tTime!==e||!this._dur&&!t||this._initted&&1e-8===Math.abs(this._zTime)||!e&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=e),Lg(this,e,t)),this},t.time=function(e,t){return arguments.length?this.totalTime(Math.min(this.totalDuration(),e+Hg(this))%this._dur||(e?this._dur:0),t):this._time},t.totalProgress=function(e,t){return arguments.length?this.totalTime(this.totalDuration()*e,t):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.ratio},t.progress=function(e,t){return arguments.length?this.totalTime(this.duration()*(!this._yoyo||1&this.iteration()?e:1-e)+Hg(this),t):this.duration()?Math.min(1,this._time/this._dur):this.ratio},t.iteration=function(e,t){var n=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(e-1)*n,t):this._repeat?Vg(this._tTime,n)+1:1},t.timeScale=function(e){if(!arguments.length)return-1e-8===this._rts?0:this._rts;if(this._rts===e)return this;var t=this.parent&&this._ts?jg(this.parent._time,this):this._tTime;return this._rts=+e||0,this._ts=this._ps||-1e-8===e?0:this._rts,kg(this.totalTime(nv(-this._delay,this._tDur,t),!0))},t.paused=function(e){return arguments.length?(this._ps!==e&&(this._ps=e,e?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(Cv(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,1===this.progress()&&(this._tTime-=1e-8)&&1e-8!==Math.abs(this._zTime)))),this):this._ps},t.startTime=function(e){if(arguments.length){this._start=e;var t=this.parent||this._dp;return t&&(t._sort||!this.parent)&&Yg(t,this,e-this._delay),this}return this._start},t.endTime=function(e){return this._start+(Zm(e)?this.totalDuration():this.duration())/Math.abs(this._ts)},t.rawTime=function(e){var t=this.parent||this._dp;return t?e&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?jg(t.rawTime(e),this):this._tTime:this._tTime},t.globalTime=function(e){for(var t=this,n=arguments.length?e:t.rawTime();t;)n=t._start+n/(t._ts||1),t=t._dp;return n},t.repeat=function(e){return arguments.length?(this._repeat=e,Qg(this)):this._repeat},t.repeatDelay=function(e){return arguments.length?(this._rDelay=e,Qg(this)):this._rDelay},t.yoyo=function(e){return arguments.length?(this._yoyo=e,this):this._yoyo},t.seek=function(e,t){return this.totalTime(ev(this,e),Zm(t))},t.restart=function(e,t){return this.play().totalTime(e?-this._delay:0,Zm(t))},t.play=function(e,t){return null!=e&&this.seek(e,t),this.reversed(!1).paused(!1)},t.reverse=function(e,t){return null!=e&&this.seek(e||this.totalDuration(),t),this.reversed(!0).paused(!1)},t.pause=function(e,t){return null!=e&&this.seek(e,t),this.paused(!0)},t.resume=function(){return this.paused(!1)},t.reversed=function(e){return arguments.length?(!!e!==this.reversed()&&this.timeScale(-this._rts||(e?-1e-8:0)),this):this._rts<0},t.invalidate=function(){return this._initted=0,this._zTime=-1e-8,this},t.isActive=function(){var e,t=this.parent||this._dp,n=this._start;return!(t&&!(this._ts&&this._initted&&t.isActive()&&(e=t.rawTime(!0))>=n&&e1?(t?(i[e]=t,n&&(i[e+"Params"]=n),"onUpdate"===e&&(this._onUpdate=t)):delete i[e],this):i[e]},t.then=function(e){var t=this;return new Promise((function(n){var i=Wm(e)?e:Pg,r=function(){var e=t.then;t.then=null,Wm(i)&&(i=i(t))&&(i.then||i===t)&&(t.then=e),n(i),t.then=e};t._initted&&1===t.totalProgress()&&t._ts>=0||!t._tTime&&t._ts<0?r():t._prom=r}))},t.kill=function(){vv(this)},e}();Ng(kv.prototype,{_time:0,_start:0,_end:0,_tTime:0,_tDur:0,_dirty:0,_repeat:0,_yoyo:!1,parent:null,_initted:!1,_rDelay:0,_ts:1,_dp:0,ratio:0,_zTime:-1e-8,_prom:0,_ps:!1,_rts:1});var Hv=function(e){function t(t,n){var i;return void 0===t&&(t={}),(i=e.call(this,t,n)||this).labels={},i.smoothChildTiming=!!t.smoothChildTiming,i.autoRemoveChildren=!!t.autoRemoveChildren,i._sort=Zm(t.sortChildren),i.parent&&Xg(i.parent,om(i)),t.scrollTrigger&&Zg(om(i),t.scrollTrigger),i}am(t,e);var n=t.prototype;return n.to=function(e,t,n){return new Kv(e,Ag(arguments,0,this),ev(this,qm(t)?arguments[3]:n)),this},n.from=function(e,t,n){return new Kv(e,Ag(arguments,1,this),ev(this,qm(t)?arguments[3]:n)),this},n.fromTo=function(e,t,n,i){return new Kv(e,Ag(arguments,2,this),ev(this,qm(t)?arguments[4]:i)),this},n.set=function(e,t,n){return t.duration=0,t.parent=this,Ug(t).repeatDelay||(t.repeat=0),t.immediateRender=!!t.immediateRender,new Kv(e,t,ev(this,n),1),this},n.call=function(e,t,n){return Yg(this,Kv.delayedCall(0,e,t),ev(this,n))},n.staggerTo=function(e,t,n,i,r,s,o){return n.duration=t,n.stagger=n.stagger||i,n.onComplete=s,n.onCompleteParams=o,n.parent=this,new Kv(e,n,ev(this,r)),this},n.staggerFrom=function(e,t,n,i,r,s,o){return n.runBackwards=1,Ug(n).immediateRender=Zm(n.immediateRender),this.staggerTo(e,t,n,i,r,s,o)},n.staggerFromTo=function(e,t,n,i,r,s,o,a){return i.startAt=n,Ug(i).immediateRender=Zm(i.immediateRender),this.staggerTo(e,t,i,r,s,o,a)},n.render=function(e,t,n){var i,r,s,o,a,l,c,h,u,d,p,f,m=this._time,g=this._dirty?this.totalDuration():this._tDur,v=this._dur,y=this!==lm&&e>g-1e-8&&e>=0?g:e<1e-8?0:e,x=this._zTime<0!=e<0&&(this._initted||!v);if(y!==this._tTime||n||x){if(m!==this._time&&v&&(y+=this._time-m,e+=this._time-m),i=y,u=this._start,l=!(h=this._ts),x&&(v||(m=this._zTime),(e||!t)&&(this._zTime=e)),this._repeat&&(p=this._yoyo,a=v+this._rDelay,i=Tg(y%a),y===g?(o=this._repeat,i=v):((o=~~(y/a))&&o===y/a&&(i=v,o--),i>v&&(i=v)),d=Vg(this._tTime,a),!m&&this._tTime&&d!==o&&(d=o),p&&1&o&&(i=v-i,f=1),o!==d&&!this._lock)){var _=p&&1&d,b=_===(p&&1&o);if(ot)for(i=e._first;i&&i._start<=n;){if(!i._dur&&"isPause"===i.data&&i._start>t)return i;i=i._next}else for(i=e._last;i&&i._start>=n;){if(!i._dur&&"isPause"===i.data&&i._start=m&&e>=0)for(r=this._first;r;){if(s=r._next,(r._act||i>=r._start)&&r._ts&&c!==r){if(r.parent!==this)return this.render(e,t,n);if(r.render(r._ts>0?(i-r._start)*r._ts:(r._dirty?r.totalDuration():r._tDur)+(i-r._start)*r._ts,t,n),i!==this._time||!this._ts&&!l){c=0,s&&(y+=this._zTime=-1e-8);break}}r=s}else{r=this._last;for(var w=e<0?e:i;r;){if(s=r._prev,(r._act||w<=r._end)&&r._ts&&c!==r){if(r.parent!==this)return this.render(e,t,n);if(r.render(r._ts>0?(w-r._start)*r._ts:(r._dirty?r.totalDuration():r._tDur)+(w-r._start)*r._ts,t,n),i!==this._time||!this._ts&&!l){c=0,s&&(y+=this._zTime=w?-1e-8:1e-8);break}}r=s}}if(c&&!t&&(this.pause(),c.render(i>=m?0:-1e-8)._zTime=i>=m?1:-1,this._ts))return this._start=u,Wg(this),this.render(e,t,n);this._onUpdate&&!t&&gv(this,"onUpdate",!0),(y===g&&g>=this.totalDuration()||!y&&m)&&(u!==this._start&&Math.abs(h)===Math.abs(this._ts)||this._lock||((e||!v)&&(y===g&&this._ts>0||!y&&this._ts<0)&&Fg(this,1),t||e<0&&!m||!y&&!m||(gv(this,y===g?"onComplete":"onReverseComplete",!0),this._prom&&!(y0)&&this._prom())))}return this},n.add=function(e,t){var n=this;if(qm(t)||(t=ev(this,t)),!(e instanceof kv)){if($m(e))return e.forEach((function(e){return n.add(e,t)})),this;if(jm(e))return this.addLabel(e,t);if(!Wm(e))return this;e=Kv.delayedCall(0,e)}return this!==e?Yg(this,e,t):this},n.getChildren=function(e,t,n,i){void 0===e&&(e=!0),void 0===t&&(t=!0),void 0===n&&(n=!0),void 0===i&&(i=-Um);for(var r=[],s=this._first;s;)s._start>=i&&(s instanceof Kv?t&&r.push(s):(n&&r.push(s),e&&r.push.apply(r,s.getChildren(!0,t,n)))),s=s._next;return r},n.getById=function(e){for(var t=this.getChildren(1,1,1),n=t.length;n--;)if(t[n].vars.id===e)return t[n]},n.remove=function(e){return jm(e)?this.removeLabel(e):Wm(e)?this.killTweensOf(e):(Bg(this,e),e===this._recent&&(this._recent=this._last),Gg(this))},n.totalTime=function(t,n){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=Tg(Av.time-(this._ts>0?t/this._ts:(this.totalDuration()-t)/-this._ts))),e.prototype.totalTime.call(this,t,n),this._forcing=0,this):this._tTime},n.addLabel=function(e,t){return this.labels[e]=ev(this,t),this},n.removeLabel=function(e){return delete this.labels[e],this},n.addPause=function(e,t,n){var i=Kv.delayedCall(0,t||dg,n);return i.data="isPause",this._hasPause=1,Yg(this,i,ev(this,e))},n.removePause=function(e){var t=this._first;for(e=ev(this,e);t;)t._start===e&&"isPause"===t.data&&Fg(t),t=t._next},n.killTweensOf=function(e,t,n){for(var i=this.getTweensOf(e,n),r=i.length;r--;)Vv!==i[r]&&i[r].kill(e,t);return this},n.getTweensOf=function(e,t){for(var n,i=[],r=ov(e),s=this._first,o=qm(t);s;)s instanceof Kv?Eg(s._targets,r)&&(o?(!Vv||s._initted&&s._ts)&&s.globalTime(0)<=t&&s.globalTime(s.totalDuration())>t:!t||s.isActive())&&i.push(s):(n=s.getTweensOf(r,t)).length&&i.push.apply(i,n),s=s._next;return i},n.tweenTo=function(e,t){t=t||{};var n=this,i=ev(n,e),r=t,s=r.startAt,o=r.onStart,a=r.onStartParams,l=Kv.to(n,Ng(t,{ease:"none",lazy:!1,time:i,overwrite:"auto",duration:t.duration||Math.abs((i-(s&&"time"in s?s.time:n._time))/n.timeScale())||1e-8,onStart:function(){n.pause();var e=t.duration||Math.abs((i-n._time)/n.timeScale());l._dur!==e&&Kg(l,e,0,1).render(l._time,!0,!0),o&&o.apply(l,a||[])}}));return l},n.tweenFromTo=function(e,t,n){return this.tweenTo(t,Ng({startAt:{time:ev(this,e)}},n))},n.recent=function(){return this._recent},n.nextLabel=function(e){return void 0===e&&(e=this._time),mv(this,ev(this,e))},n.previousLabel=function(e){return void 0===e&&(e=this._time),mv(this,ev(this,e),1)},n.currentLabel=function(e){return arguments.length?this.seek(e,!0):this.previousLabel(this._time+1e-8)},n.shiftChildren=function(e,t,n){void 0===n&&(n=0);for(var i,r=this._first,s=this.labels;r;)r._start>=n&&(r._start+=e,r._end+=e),r=r._next;if(t)for(i in s)s[i]>=n&&(s[i]+=e);return Gg(this)},n.invalidate=function(){var t=this._first;for(this._lock=0;t;)t.invalidate(),t=t._next;return e.prototype.invalidate.call(this)},n.clear=function(e){void 0===e&&(e=!0);for(var t,n=this._first;n;)t=n._next,this.remove(n),n=t;return this._time=this._tTime=this._pTime=0,e&&(this.labels={}),Gg(this)},n.totalDuration=function(e){var t,n,i,r=0,s=this,o=s._last,a=Um;if(arguments.length)return s.timeScale((s._repeat<0?s.duration():s.totalDuration())/(s.reversed()?-e:e));if(s._dirty){for(i=s.parent;o;)t=o._prev,o._dirty&&o.totalDuration(),(n=o._start)>a&&s._sort&&o._ts&&!s._lock?(s._lock=1,Yg(s,o,n-o._delay,1)._lock=0):a=n,n<0&&o._ts&&(r-=n,(!i&&!s._dp||i&&i.smoothChildTiming)&&(s._start+=n/s._ts,s._time-=n,s._tTime-=n),s.shiftChildren(-n,!1,-1/0),a=0),o._end>r&&o._ts&&(r=o._end),o=t;Kg(s,s===lm&&s._time>r?s._time:r,1,1),s._dirty=0}return s._tDur},t.updateRoot=function(e){if(lm._ts&&(Lg(lm,jg(e,lm)),pm=Av.frame),Av.frame>=yg){yg+=Om.autoSleep||120;var t=lm._first;if((!t||!t._ts)&&Om.autoSleep&&Av._listeners.length<2){for(;t&&!t._ts;)t=t._next;t||Av.sleep()}}},t}(kv);Ng(Hv.prototype,{_lock:0,_hasPause:0,_forcing:0});var Vv,jv=function(e,t,n,i,r,s,o){var a,l,c,h,u,d,p,f,m=new uy(this._pt,e,t,0,1,sy,null,r),g=0,v=0;for(m.b=n,m.e=i,n+="",(p=~(i+="").indexOf("random("))&&(i=pv(i)),s&&(s(f=[n,i],e,t),n=f[0],i=f[1]),l=n.match(ig)||[];a=ig.exec(i);)h=a[0],u=i.substring(g,a.index),c?c=(c+1)%5:"rgba("===u.substr(-5)&&(c=1),h!==l[v++]&&(d=parseFloat(l[v-1])||0,m._pt={_next:m._pt,p:u||1===v?u:",",s:d,c:"="===h.charAt(1)?parseFloat(h.substr(2))*("-"===h.charAt(0)?-1:1):parseFloat(h)-d,m:c&&c<4?Math.round:0},g=ig.lastIndex);return m.c=g0)A||(t._startAt=0);else if(C&&!(n<0&&L))return void(n&&(t._zTime=n))}else if(S&&C)if(L)!A&&(t._startAt=0);else if(n&&(x=!1),s=Ng({overwrite:!1,data:"isFromStart",lazy:x&&Zm(_),immediateRender:x,stagger:0,parent:P},i),f&&(s[h.prop]=f),Fg(t._startAt=Kv.set(R,s)),x){if(!n)return}else e(t._startAt,1e-8);for(t._pt=0,_=C&&Zm(_)||_&&!C,r=0;r")}));else{if(c=T.length,d=y?lv(y):dg,Ym(y))for(h in y)~Zv.indexOf(h)&&(p||(p={}),p[h]=y[h]);for(a=0;ap-1e-8&&e>=0?p:e<1e-8?0:e;if(f){if(m!==this._tTime||!e||n||this._startAt&&this._zTime<0!=e<0){if(i=m,h=this.timeline,this._repeat){if(o=f+this._rDelay,i=Tg(m%o),m===p?(s=this._repeat,i=f):((s=~~(m/o))&&s===m/o&&(i=f,s--),i>f&&(i=f)),(l=this._yoyo&&1&s)&&(u=this._yEase,i=f-i),a=Vg(this._tTime,o),i===d&&!n&&this._initted)return this;s!==a&&(h&&this._yEase&&Iv(h,l),!this.vars.repeatRefresh||l||this._lock||(this._lock=n=1,this.render(Tg(o*s),!0).invalidate()._lock=0))}if(!this._initted){if(Jg(this,e<0?e:i,n,t))return this._tTime=0,this;if(f!==this._dur)return this.render(e,t,n)}for(this._tTime=m,this._time=i,!this._act&&this._ts&&(this._act=1,this._lazy=0),this.ratio=c=(u||this._ease)(i/f),this._from&&(this.ratio=c=1-c),i&&!d&&!t&&gv(this,"onStart"),r=this._pt;r;)r.r(c,r.d),r=r._next;h&&h.render(e<0?e:!i&&l?-1e-8:h._dur*c,t,n)||this._startAt&&(this._zTime=e),this._onUpdate&&!t&&(e<0&&this._startAt&&this._startAt.render(e,!0,n),gv(this,"onUpdate")),this._repeat&&s!==a&&this.vars.onRepeat&&!t&&this.parent&&gv(this,"onRepeat"),m!==this._tDur&&m||this._tTime!==m||(e<0&&this._startAt&&!this._onUpdate&&this._startAt.render(e,!0,!0),(e||!f)&&(m===this._tDur&&this._ts>0||!m&&this._ts<0)&&Fg(this,1),t||e<0&&!d||!m&&!d||(gv(this,m===p?"onComplete":"onReverseComplete",!0),this._prom&&!(m0)&&this._prom()))}}else!function(e,t,n,i){var r,s,o=e.ratio,a=t<0||!t&&o&&!e._start&&e._zTime>1e-8&&!e._dp._lock||(e._ts<0||e._dp._ts<0)&&"isFromStart"!==e.data&&"isStart"!==e.data?0:1,l=e._rDelay,c=0;if(l&&e._repeat&&(c=nv(0,e._tDur,t),Vg(c,l)!==(s=Vg(e._tTime,l))&&(o=1-a,e.vars.repeatRefresh&&e._initted&&e.invalidate())),a!==o||i||1e-8===e._zTime||!t&&e._zTime){if(!e._initted&&Jg(e,t,i,n))return;for(s=e._zTime,e._zTime=t||(n?1e-8:0),n||(n=t&&!s),e.ratio=a,e._from&&(a=1-a),e._time=0,e._tTime=c,n||gv(e,"onStart"),r=e._pt;r;)r.r(a,r.d),r=r._next;e._startAt&&t<0&&e._startAt.render(t,!0,!0),e._onUpdate&&!n&&gv(e,"onUpdate"),c&&e._repeat&&!n&&e.parent&&gv(e,"onRepeat"),(t>=e._tDur||t<0)&&e.ratio===a&&(a&&Fg(e,1),n||(gv(e,a?"onComplete":"onReverseComplete",!0),e._prom&&e._prom()))}else e._zTime||(e._zTime=t)}(this,e,t,n);return this},n.targets=function(){return this._targets},n.invalidate=function(){return this._pt=this._op=this._startAt=this._onUpdate=this._act=this._lazy=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(),e.prototype.invalidate.call(this)},n.kill=function(e,t){if(void 0===t&&(t="all"),!(e||t&&"all"!==t)&&(this._lazy=0,this.parent))return vv(this);if(this.timeline){var n=this.timeline.totalDuration();return this.timeline.killTweensOf(e,t,Vv&&!0!==Vv.vars.overwrite)._first||vv(this),this.parent&&n!==this.timeline.totalDuration()&&Kg(this,this._dur*this.timeline._tDur/n,0,1),this}var i,r,s,o,a,l,c,h=this._targets,u=e?ov(e):h,d=this._ptLookup,p=this._pt;if((!t||"all"===t)&&function(e,t){for(var n=e.length,i=n===t.length;i&&n--&&e[n]===t[n];);return n<0}(h,u))return"all"===t&&(this._pt=0),vv(this);for(i=this._op=this._op||[],"all"!==t&&(jm(t)&&(a={},Sg(t,(function(e){return a[e]=1})),t=a),t=function(e,t){var n,i,r,s,o=e[0]?wg(e[0]).harness:0,a=o&&o.aliases;if(!a)return t;for(i in n=Ig({},t),a)if(i in n)for(r=(s=a[i].split(",")).length;r--;)n[s[r]]=n[i];return n}(h,t)),c=h.length;c--;)if(~u.indexOf(h[c]))for(a in r=d[c],"all"===t?(i[c]=t,o=r,s={}):(s=i[c]=i[c]||{},o=t),o)(l=r&&r[a])&&("kill"in l.d&&!0!==l.d.kill(a)||Bg(this,l,"_pt"),delete r[a]),"all"!==s&&(s[a]=1);return this._initted&&!this._pt&&p&&vv(this),this},t.to=function(e,n){return new t(e,n,arguments[2])},t.from=function(e,n){return new t(e,Ag(arguments,1))},t.delayedCall=function(e,n,i,r){return new t(n,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:e,onComplete:n,onReverseComplete:n,onCompleteParams:i,onReverseCompleteParams:i,callbackScope:r})},t.fromTo=function(e,n,i){return new t(e,Ag(arguments,2))},t.set=function(e,n){return n.duration=0,n.repeatDelay||(n.repeat=0),new t(e,n)},t.killTweensOf=function(e,t,n){return lm.killTweensOf(e,t,n)},t}(kv);Ng(Kv.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0}),Sg("staggerTo,staggerFrom,staggerFromTo",(function(e){Kv[e]=function(){var t=new Hv,n=rv.call(arguments,0);return n.splice("staggerFromTo"===e?5:4,0,0),t[e].apply(t,n)}}));var Qv=function(e,t,n){return e[t]=n},$v=function(e,t,n){return e[t](n)},ey=function(e,t,n,i){return e[t](i.fp,n)},ty=function(e,t,n){return e.setAttribute(t,n)},ny=function(e,t){return Wm(e[t])?$v:Xm(e[t])&&e.setAttribute?ty:Qv},iy=function(e,t){return t.set(t.t,t.p,Math.round(1e4*(t.s+t.c*e))/1e4,t)},ry=function(e,t){return t.set(t.t,t.p,!!(t.s+t.c*e),t)},sy=function(e,t){var n=t._pt,i="";if(!e&&t.b)i=t.b;else if(1===e&&t.e)i=t.e;else{for(;n;)i=n.p+(n.m?n.m(n.s+n.c*e):Math.round(1e4*(n.s+n.c*e))/1e4)+i,n=n._next;i+=t.c}t.set(t.t,t.p,i,t)},oy=function(e,t){for(var n=t._pt;n;)n.r(e,n.d),n=n._next},ay=function(e,t,n,i){for(var r,s=this._pt;s;)r=s._next,s.p===i&&s.modifier(e,t,n),s=r},ly=function(e){for(var t,n,i=this._pt;i;)n=i._next,i.p===e&&!i.op||i.op===e?Bg(this,i,"_pt"):i.dep||(t=1),i=n;return!t},cy=function(e,t,n,i){i.mSet(e,t,i.m.call(i.tween,n,i.mt),i)},hy=function(e){for(var t,n,i,r,s=e._pt;s;){for(t=s._next,n=i;n&&n.pr>s.pr;)n=n._next;(s._prev=n?n._prev:r)?s._prev._next=s:i=s,(s._next=n)?n._prev=s:r=s,s=t}e._pt=i},uy=function(){function e(e,t,n,i,r,s,o,a,l){this.t=t,this.s=i,this.c=r,this.p=n,this.r=s||iy,this.d=o||this,this.set=a||Qv,this.pr=l||0,this._next=e,e&&(e._prev=this)}return e.prototype.modifier=function(e,t,n){this.mSet=this.mSet||this.set,this.set=cy,this.m=e,this.mt=n,this.tween=t},e}();Sg(_g+"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger",(function(e){return pg[e]=1})),og.TweenMax=og.TweenLite=Kv,og.TimelineLite=og.TimelineMax=Hv,lm=new Hv({sortChildren:!1,defaults:zm,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0}),Om.stringFilter=Ev;var dy={registerPlugin:function(){for(var e=arguments.length,t=new Array(e),n=0;n1){var i=e.map((function(e){return my.quickSetter(e,t,n)})),r=i.length;return function(e){for(var t=r;t--;)i[t](e)}}e=e[0]||{};var s=gg[t],o=wg(e),a=o.harness&&(o.harness.aliases||{})[t]||t,l=s?function(t){var i=new s;fm._pt=0,i.init(e,n?t+n:t,fm,0,[e]),i.render(1,i),fm._pt&&oy(1,fm)}:o.set(e,a);return s?l:function(t){return l(e,a,n?t+n:t,o,1)}},isTweening:function(e){return lm.getTweensOf(e,!0).length>0},defaults:function(e){return e&&e.ease&&(e.ease=Ov(e.ease,zm.ease)),Og(zm,e||{})},config:function(e){return Og(Om,e||{})},registerEffect:function(e){var t=e.name,n=e.effect,i=e.plugins,r=e.defaults,s=e.extendTimeline;(i||"").split(",").forEach((function(e){return e&&!gg[e]&&!og[e]&&hg(t+" effect requires "+e+" plugin.")})),vg[t]=function(e,t,i){return n(ov(e),Ng(t||{},r),i)},s&&(Hv.prototype[t]=function(e,n,i){return this.add(vg[t](e,Ym(n)?n:(i=n)&&{},this),i)})},registerEase:function(e,t){Lv[e]=Ov(t)},parseEase:function(e,t){return arguments.length?Ov(e,t):Lv},getById:function(e){return lm.getById(e)},exportRoot:function(e,t){void 0===e&&(e={});var n,i,r=new Hv(e);for(r.smoothChildTiming=Zm(e.smoothChildTiming),lm.remove(r),r._dp=0,r._time=r._tTime=lm._time,n=lm._first;n;)i=n._next,!t&&!n._dur&&n instanceof Kv&&n.vars.onComplete===n._targets[0]||Yg(r,n,n._start-n._delay),n=i;return Yg(lm,r,0),r},utils:{wrap:function e(t,n,i){var r=n-t;return $m(t)?dv(t,e(0,t.length),n):tv(i,(function(e){return(r+(e-t)%r)%r+t}))},wrapYoyo:function e(t,n,i){var r=n-t,s=2*r;return $m(t)?dv(t,e(0,t.length-1),n):tv(i,(function(e){return t+((e=(s+(e-t)%s)%s||0)>r?s-e:e)}))},distribute:lv,random:uv,snap:hv,normalize:function(e,t,n){return fv(e,t,0,1,n)},getUnit:iv,clamp:function(e,t,n){return tv(n,(function(n){return nv(e,t,n)}))},splitColor:bv,toArray:ov,mapRange:fv,pipe:function(){for(var e=arguments.length,t=new Array(e),n=0;n=0?Zy[r]:"")+e},Ky=function(){"undefined"!=typeof window&&window.document&&(gy=window,vy=gy.document,yy=vy.documentElement,_y=Xy("div")||{style:{}},by=Xy("div"),Wy=Jy(Wy),qy=Wy+"Origin",_y.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",My=!!Jy("perspective"),xy=1)},Qy=function e(t){var n,i=Xy("svg",this.ownerSVGElement&&this.ownerSVGElement.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),r=this.parentNode,s=this.nextSibling,o=this.style.cssText;if(yy.appendChild(i),i.appendChild(this),this.style.display="block",t)try{n=this.getBBox(),this._gsapBBox=this.getBBox,this.getBBox=e}catch(e){}else this._gsapBBox&&(n=this._gsapBBox());return r&&(s?r.insertBefore(this,s):r.appendChild(this)),yy.removeChild(i),this.style.cssText=o,n},$y=function(e,t){for(var n=t.length;n--;)if(e.hasAttribute(t[n]))return e.getAttribute(t[n])},ex=function(e){var t;try{t=e.getBBox()}catch(n){t=Qy.call(e,!0)}return t&&(t.width||t.height)||e.getBBox===Qy||(t=Qy.call(e,!0)),!t||t.width||t.x||t.y?t:{x:+$y(e,["x","cx","x1"])||0,y:+$y(e,["y","cy","y1"])||0,width:0,height:0}},tx=function(e){return!(!e.getCTM||e.parentNode&&!e.ownerSVGElement||!ex(e))},nx=function(e,t){if(t){var n=e.style;t in Ty&&t!==qy&&(t=Wy),n.removeProperty?("ms"!==t.substr(0,2)&&"webkit"!==t.substr(0,6)||(t="-"+t),n.removeProperty(t.replace(Ly,"-$1").toLowerCase())):n.removeAttribute(t)}},ix=function(e,t,n,i,r,s){var o=new uy(e._pt,t,n,0,1,s?By:Uy);return e._pt=o,o.b=i,o.e=r,e._props.push(n),o},rx={deg:1,rad:1,turn:1},sx=function e(t,n,i,r){var s,o,a,l,c=parseFloat(i)||0,h=(i+"").trim().substr((c+"").length)||"px",u=_y.style,d=Ry.test(n),p="svg"===t.tagName.toLowerCase(),f=(p?"client":"offset")+(d?"Width":"Height"),m="px"===r,g="%"===r;return r===h||!c||rx[r]||rx[h]?c:("px"!==h&&!m&&(c=e(t,n,i,"px")),l=t.getCTM&&tx(t),g&&(Ty[n]||~n.indexOf("adius"))?Tg(c/(l?t.getBBox()[d?"width":"height"]:t[f])*100):(u[d?"width":"height"]=100+(m?h:r),o=~n.indexOf("adius")||"em"===r&&t.appendChild&&!p?t:t.parentNode,l&&(o=(t.ownerSVGElement||{}).parentNode),o&&o!==vy&&o.appendChild||(o=vy.body),(a=o._gsap)&&g&&a.width&&d&&a.time===Av.time?Tg(c/a.width*100):((g||"%"===h)&&(u.position=Yy(t,"position")),o===t&&(u.position="static"),o.appendChild(_y),s=_y[f],o.removeChild(_y),u.position="absolute",d&&g&&((a=wg(o)).time=Av.time,a.width=o[f]),Tg(m?s*c/100:s&&c?100/s*c:0))))},ox=function(e,t,n,i){var r;return xy||Ky(),t in Ny&&"transform"!==t&&~(t=Ny[t]).indexOf(",")&&(t=t.split(",")[0]),Ty[t]&&"transform"!==t?(r=vx(e,i),r="transformOrigin"!==t?r[t]:yx(Yy(e,qy))+" "+r.zOrigin+"px"):(!(r=e.style[t])||"auto"===r||i||~(r+"").indexOf("calc("))&&(r=hx[t]&&hx[t](e,t,n)||Yy(e,t)||Mg(e,t)||("opacity"===t?1:0)),n&&!~(r+"").indexOf(" ")?sx(e,t,r,n)+n:r},ax=function(e,t,n,i){if(!n||"none"===n){var r=Jy(t,e,1),s=r&&Yy(e,r,1);s&&s!==n?(t=r,n=s):"borderColor"===t&&(n=Yy(e,"borderTopColor"))}var o,a,l,c,h,u,d,p,f,m,g,v,y=new uy(this._pt,e.style,t,0,1,sy),x=0,_=0;if(y.b=n,y.e=i,n+="","auto"===(i+="")&&(e.style[t]=i,i=Yy(e,t)||i,e.style[t]=n),Ev(o=[n,i]),i=o[1],l=(n=o[0]).match(ng)||[],(i.match(ng)||[]).length){for(;a=ng.exec(i);)d=a[0],f=i.substring(x,a.index),h?h=(h+1)%5:"rgba("!==f.substr(-5)&&"hsla("!==f.substr(-5)||(h=1),d!==(u=l[_++]||"")&&(c=parseFloat(u)||0,g=u.substr((c+"").length),(v="="===d.charAt(1)?+(d.charAt(0)+"1"):0)&&(d=d.substr(2)),p=parseFloat(d),m=d.substr((p+"").length),x=ng.lastIndex-m.length,m||(m=m||Om.units[t]||g,x===i.length&&(i+=m,y.e+=m)),g!==m&&(c=sx(e,t,u,m)||0),y._pt={_next:y._pt,p:f||1===_?f:",",s:c,c:v?v*p:p-c,m:h&&h<4?Math.round:0});y.c=x-1;)n=a[r],Ty[n]&&(i=1,n="transformOrigin"===n?qy:Wy),nx(s,n);i&&(nx(s,Wy),l&&(l.svg&&s.removeAttribute("transform"),vx(s,1),l.uncache=1))}},hx={clearProps:function(e,t,n,i,r){if("isFromStart"!==r.data){var s=e._pt=new uy(e._pt,t,n,0,0,cx);return s.u=i,s.pr=-10,s.tween=r,e._props.push(n),1}}},ux=[1,0,0,1,0,0],dx={},px=function(e){return"matrix(1, 0, 0, 1, 0, 0)"===e||"none"===e||!e},fx=function(e){var t=Yy(e,Wy);return px(t)?ux:t.substr(7).match(tg).map(Tg)},mx=function(e,t){var n,i,r,s,o=e._gsap||wg(e),a=e.style,l=fx(e);return o.svg&&e.getAttribute("transform")?"1,0,0,1,0,0"===(l=[(r=e.transform.baseVal.consolidate().matrix).a,r.b,r.c,r.d,r.e,r.f]).join(",")?ux:l:(l!==ux||e.offsetParent||e===yy||o.svg||(r=a.display,a.display="block",(n=e.parentNode)&&e.offsetParent||(s=1,i=e.nextSibling,yy.appendChild(e)),l=fx(e),r?a.display=r:nx(e,"display"),s&&(i?n.insertBefore(e,i):n?n.appendChild(e):yy.removeChild(e))),t&&l.length>6?[l[0],l[1],l[4],l[5],l[12],l[13]]:l)},gx=function(e,t,n,i,r,s){var o,a,l,c=e._gsap,h=r||mx(e,!0),u=c.xOrigin||0,d=c.yOrigin||0,p=c.xOffset||0,f=c.yOffset||0,m=h[0],g=h[1],v=h[2],y=h[3],x=h[4],_=h[5],b=t.split(" "),w=parseFloat(b[0])||0,M=parseFloat(b[1])||0;n?h!==ux&&(a=m*y-g*v)&&(l=w*(-g/a)+M*(m/a)-(m*_-g*x)/a,w=w*(y/a)+M*(-v/a)+(v*_-y*x)/a,M=l):(w=(o=ex(e)).x+(~b[0].indexOf("%")?w/100*o.width:w),M=o.y+(~(b[1]||b[0]).indexOf("%")?M/100*o.height:M)),i||!1!==i&&c.smooth?(x=w-u,_=M-d,c.xOffset=p+(x*m+_*v)-x,c.yOffset=f+(x*g+_*y)-_):c.xOffset=c.yOffset=0,c.xOrigin=w,c.yOrigin=M,c.smooth=!!i,c.origin=t,c.originIsAbsolute=!!n,e.style[qy]="0px 0px",s&&(ix(s,c,"xOrigin",u,w),ix(s,c,"yOrigin",d,M),ix(s,c,"xOffset",p,c.xOffset),ix(s,c,"yOffset",f,c.yOffset)),e.setAttribute("data-svg-origin",w+" "+M)},vx=function(e,t){var n=e._gsap||new Gv(e);if("x"in n&&!t&&!n.uncache)return n;var i,r,s,o,a,l,c,h,u,d,p,f,m,g,v,y,x,_,b,w,M,S,T,E,A,C,L,R,P,N,D,I,O=e.style,z=n.scaleX<0,U=Yy(e,qy)||"0";return i=r=s=l=c=h=u=d=p=0,o=a=1,n.svg=!(!e.getCTM||!tx(e)),g=mx(e,n.svg),n.svg&&(E=!n.uncache&&e.getAttribute("data-svg-origin"),gx(e,E||U,!!E||n.originIsAbsolute,!1!==n.smooth,g)),f=n.xOrigin||0,m=n.yOrigin||0,g!==ux&&(_=g[0],b=g[1],w=g[2],M=g[3],i=S=g[4],r=T=g[5],6===g.length?(o=Math.sqrt(_*_+b*b),a=Math.sqrt(M*M+w*w),l=_||b?Cy(b,_)*Ey:0,(u=w||M?Cy(w,M)*Ey+l:0)&&(a*=Math.cos(u*Ay)),n.svg&&(i-=f-(f*_+m*w),r-=m-(f*b+m*M))):(I=g[6],N=g[7],L=g[8],R=g[9],P=g[10],D=g[11],i=g[12],r=g[13],s=g[14],c=(v=Cy(I,P))*Ey,v&&(E=S*(y=Math.cos(-v))+L*(x=Math.sin(-v)),A=T*y+R*x,C=I*y+P*x,L=S*-x+L*y,R=T*-x+R*y,P=I*-x+P*y,D=N*-x+D*y,S=E,T=A,I=C),h=(v=Cy(-w,P))*Ey,v&&(y=Math.cos(-v),D=M*(x=Math.sin(-v))+D*y,_=E=_*y-L*x,b=A=b*y-R*x,w=C=w*y-P*x),l=(v=Cy(b,_))*Ey,v&&(E=_*(y=Math.cos(v))+b*(x=Math.sin(v)),A=S*y+T*x,b=b*y-_*x,T=T*y-S*x,_=E,S=A),c&&Math.abs(c)+Math.abs(l)>359.9&&(c=l=0,h=180-h),o=Tg(Math.sqrt(_*_+b*b+w*w)),a=Tg(Math.sqrt(T*T+I*I)),v=Cy(S,T),u=Math.abs(v)>2e-4?v*Ey:0,p=D?1/(D<0?-D:D):0),n.svg&&(E=e.getAttribute("transform"),n.forceCSS=e.setAttribute("transform","")||!px(Yy(e,Wy)),E&&e.setAttribute("transform",E))),Math.abs(u)>90&&Math.abs(u)<270&&(z?(o*=-1,u+=l<=0?180:-180,l+=l<=0?180:-180):(a*=-1,u+=u<=0?180:-180)),n.x=((n.xPercent=i&&Math.round(e.offsetWidth/2)===Math.round(-i)?-50:0)?0:i)+"px",n.y=((n.yPercent=r&&Math.round(e.offsetHeight/2)===Math.round(-r)?-50:0)?0:r)+"px",n.z=s+"px",n.scaleX=Tg(o),n.scaleY=Tg(a),n.rotation=Tg(l)+"deg",n.rotationX=Tg(c)+"deg",n.rotationY=Tg(h)+"deg",n.skewX=u+"deg",n.skewY=d+"deg",n.transformPerspective=p+"px",(n.zOrigin=parseFloat(U.split(" ")[2])||0)&&(O[qy]=yx(U)),n.xOffset=n.yOffset=0,n.force3D=Om.force3D,n.renderTransform=n.svg?wx:My?bx:_x,n.uncache=0,n},yx=function(e){return(e=e.split(" "))[0]+" "+e[1]},xx=function(e,t,n){var i=iv(t);return Tg(parseFloat(t)+parseFloat(sx(e,"x",n+"px",i)))+i},_x=function(e,t){t.z="0px",t.rotationY=t.rotationX="0deg",t.force3D=0,bx(e,t)},bx=function(e,t){var n=t||this,i=n.xPercent,r=n.yPercent,s=n.x,o=n.y,a=n.z,l=n.rotation,c=n.rotationY,h=n.rotationX,u=n.skewX,d=n.skewY,p=n.scaleX,f=n.scaleY,m=n.transformPerspective,g=n.force3D,v=n.target,y=n.zOrigin,x="",_="auto"===g&&e&&1!==e||!0===g;if(y&&("0deg"!==h||"0deg"!==c)){var b,w=parseFloat(c)*Ay,M=Math.sin(w),S=Math.cos(w);w=parseFloat(h)*Ay,b=Math.cos(w),s=xx(v,s,M*b*-y),o=xx(v,o,-Math.sin(w)*-y),a=xx(v,a,S*b*-y+y)}"0px"!==m&&(x+="perspective("+m+") "),(i||r)&&(x+="translate("+i+"%, "+r+"%) "),(_||"0px"!==s||"0px"!==o||"0px"!==a)&&(x+="0px"!==a||_?"translate3d("+s+", "+o+", "+a+") ":"translate("+s+", "+o+") "),"0deg"!==l&&(x+="rotate("+l+") "),"0deg"!==c&&(x+="rotateY("+c+") "),"0deg"!==h&&(x+="rotateX("+h+") "),"0deg"===u&&"0deg"===d||(x+="skew("+u+", "+d+") "),1===p&&1===f||(x+="scale("+p+", "+f+") "),v.style[Wy]=x||"translate(0, 0)"},wx=function(e,t){var n,i,r,s,o,a=t||this,l=a.xPercent,c=a.yPercent,h=a.x,u=a.y,d=a.rotation,p=a.skewX,f=a.skewY,m=a.scaleX,g=a.scaleY,v=a.target,y=a.xOrigin,x=a.yOrigin,_=a.xOffset,b=a.yOffset,w=a.forceCSS,M=parseFloat(h),S=parseFloat(u);d=parseFloat(d),p=parseFloat(p),(f=parseFloat(f))&&(p+=f=parseFloat(f),d+=f),d||p?(d*=Ay,p*=Ay,n=Math.cos(d)*m,i=Math.sin(d)*m,r=Math.sin(d-p)*-g,s=Math.cos(d-p)*g,p&&(f*=Ay,o=Math.tan(p-f),r*=o=Math.sqrt(1+o*o),s*=o,f&&(o=Math.tan(f),n*=o=Math.sqrt(1+o*o),i*=o)),n=Tg(n),i=Tg(i),r=Tg(r),s=Tg(s)):(n=m,s=g,i=r=0),(M&&!~(h+"").indexOf("px")||S&&!~(u+"").indexOf("px"))&&(M=sx(v,"x",h,"px"),S=sx(v,"y",u,"px")),(y||x||_||b)&&(M=Tg(M+y-(y*n+x*r)+_),S=Tg(S+x-(y*i+x*s)+b)),(l||c)&&(o=v.getBBox(),M=Tg(M+l/100*o.width),S=Tg(S+c/100*o.height)),o="matrix("+n+","+i+","+r+","+s+","+M+","+S+")",v.setAttribute("transform",o),w&&(v.style[Wy]=o)},Mx=function(e,t,n,i,r,s){var o,a,l=jm(r),c=parseFloat(r)*(l&&~r.indexOf("rad")?Ey:1),h=s?c*s:c-i,u=i+h+"deg";return l&&("short"===(o=r.split("_")[1])&&(h%=360)!==h%180&&(h+=h<0?360:-360),"cw"===o&&h<0?h=(h+36e9)%360-360*~~(h/360):"ccw"===o&&h>0&&(h=(h-36e9)%360-360*~~(h/360))),e._pt=a=new uy(e._pt,t,n,i,h,Iy),a.e=u,a.u="deg",e._props.push(n),a},Sx=function(e,t,n){var i,r,s,o,a,l,c,h=by.style,u=n._gsap;for(r in h.cssText=getComputedStyle(n).cssText+";position:absolute;display:block;",h[Wy]=t,vy.body.appendChild(by),i=vx(by,1),Ty)(s=u[r])!==(o=i[r])&&"perspective,force3D,transformOrigin,svgOrigin".indexOf(r)<0&&(a=iv(s)!==(c=iv(o))?sx(n,r,s,c):parseFloat(s),l=parseFloat(o),e._pt=new uy(e._pt,u,r,a,l-a,Dy),e._pt.u=c||0,e._props.push(r));vy.body.removeChild(by)}; +*/var pm,fm,mm,gm,vm,ym,xm,_m,bm,wm,Mm,Sm,Tm,Em,Am,Cm,Lm,Rm,Pm,Nm,Dm,Im,Om,zm,Um,Bm,Fm,Gm={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},km={duration:.5,overwrite:!1,delay:0},Hm=1e8,jm=2*Math.PI,Vm=jm/4,Wm=0,Xm=Math.sqrt,qm=Math.cos,Ym=Math.sin,Zm=function(e){return"string"==typeof e},Jm=function(e){return"function"==typeof e},Km=function(e){return"number"==typeof e},Qm=function(e){return void 0===e},$m=function(e){return"object"==typeof e},eg=function(e){return!1!==e},tg=function(){return"undefined"!=typeof window},ng=function(e){return Jm(e)||Zm(e)},ig="function"==typeof ArrayBuffer&&ArrayBuffer.isView||function(){},rg=Array.isArray,sg=/(?:-?\.?\d|\.)+/gi,og=/[-+=.]*\d+[.e\-+]*\d*[e\-\+]*\d*/g,ag=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,lg=/[-+=.]*\d+(?:\.|e-|e)*\d*/gi,cg=/[+-]=-?[\.\d]+/,hg=/[#\-+.]*\b[a-z\d-=+%.]+/gi,ug={},dg={},pg=function(e){return(dg=Fg(e,ug))&&_y},fg=function(e,t){return console.warn("Invalid property",e,"set to",t,"Missing plugin? gsap.registerPlugin()")},mg=function(e,t){return!t&&console.warn(e)},gg=function(e,t){return e&&(ug[e]=t)&&dg&&(dg[e]=t)||ug},vg=function(){return 0},yg={},xg=[],_g={},bg={},wg={},Mg=30,Sg=[],Tg="",Eg=function(e){var t,n,i=e[0];if($m(i)||Jm(i)||(e=[e]),!(t=(i._gsap||{}).harness)){for(n=Sg.length;n--&&!Sg[n].targetTest(i););t=Sg[n]}for(n=e.length;n--;)e[n]&&(e[n]._gsap||(e[n]._gsap=new Wv(e[n],t)))||e.splice(n,1);return e},Ag=function(e){return e._gsap||Eg(uv(e))[0]._gsap},Cg=function(e,t,n){return(n=e[t])&&Jm(n)?e[t]():Qm(n)&&e.getAttribute&&e.getAttribute(t)||n},Lg=function(e,t){return(e=e.split(",")).forEach(t)||e},Rg=function(e){return Math.round(1e5*e)/1e5||0},Pg=function(e,t){for(var n=t.length,i=0;e.indexOf(t[i])<0&&++ie._dur||t._start<0))for(var n=e;n;)n._dirty=1,n=n.parent;return e},Xg=function(e){for(var t=e.parent;t&&t.parent;)t._dirty=1,t.totalDuration(),t=t.parent;return e},qg=function(e){return e._repeat?Yg(e._tTime,e=e.duration()+e._rDelay)*e:0},Yg=function(e,t){return(e/=t)&&~~e===e?~~e-1:~~e},Zg=function(e,t){return(e-t._start)*t._ts+(t._ts>=0?0:t._dirty?t.totalDuration():t._tDur)},Jg=function(e){return e._end=Rg(e._start+(e._tDur/Math.abs(e._ts||e._rts||1e-8)||0))},Kg=function(e,t){var n=e._dp;return n&&n.smoothChildTiming&&e._ts&&(e._start=Rg(e._dp._time-(e._ts>0?t/e._ts:((e._dirty?e.totalDuration():e._tDur)-t)/-e._ts)),Jg(e),n._dirty||Wg(n,e)),e},Qg=function(e,t){var n;if((t._time||t._initted&&!t._dur)&&(n=Zg(e.rawTime(),t),(!t._dur||av(0,t.totalDuration(),n)-t._tTime>1e-8)&&t.render(n,!0)),Wg(e,t)._dp&&e._initted&&e._time>=e._dur&&e._ts){if(e._dur=0&&n.totalTime(n._tTime),n=n._dp;e._zTime=-1e-8}},$g=function(e,t,n,i){return t.parent&&Vg(t),t._start=Rg(n+t._delay),t._end=Rg(t._start+(t.totalDuration()/Math.abs(t.timeScale())||0)),function(e,t,n,i,r){void 0===n&&(n="_first"),void 0===i&&(i="_last");var s,o=e[i];if(r)for(s=t[r];o&&o[r]>s;)o=o._prev;o?(t._next=o._next,o._next=t):(t._next=e[n],e[n]=t),t._next?t._next._prev=t:e[i]=t,t._prev=o,t.parent=t._dp=e}(e,t,"_first","_last",e._sort?"_start":0),e._recent=t,i||Qg(e,t),e},ev=function(e,t){return(ug.ScrollTrigger||fg("scrollTrigger",t))&&ug.ScrollTrigger.create(t,e)},tv=function(e,t,n,i){return Qv(e,t),e._initted?!n&&e._pt&&(e._dur&&!1!==e.vars.lazy||!e._dur&&e.vars.lazy)&&ym!==Nv.frame?(xg.push(e),e._lazy=[t,i],1):void 0:1},nv=function(e,t,n,i){var r=e._repeat,s=Rg(t)||0,o=e._tTime/e._tDur;return o&&!i&&(e._time*=s/e._dur),e._dur=s,e._tDur=r?r<0?1e10:Rg(s*(r+1)+e._rDelay*r):s,o&&!i?Kg(e,e._tTime=e._tDur*o):e.parent&&Jg(e),n||Wg(e.parent,e),e},iv=function(e){return e instanceof qv?Wg(e):nv(e,e._dur)},rv={_start:0,endTime:vg},sv=function e(t,n){var i,r,s=t.labels,o=t._recent||rv,a=t.duration()>=Hm?o.endTime(!1):t._dur;return Zm(n)&&(isNaN(n)||n in s)?"<"===(i=n.charAt(0))||">"===i?("<"===i?o._start:o.endTime(o._repeat>=0))+(parseFloat(n.substr(1))||0):(i=n.indexOf("="))<0?(n in s||(s[n]=a),s[n]):(r=+(n.charAt(i-1)+n.substr(i+1)),i>1?e(t,n.substr(0,i-1))+r:a+r):null==n?a:+n},ov=function(e,t){return e||0===e?t(e):t},av=function(e,t,n){return nt?t:n},lv=function(e){return(e=(e+"").substr((parseFloat(e)+"").length))&&isNaN(e)?e:""},cv=[].slice,hv=function(e,t){return e&&$m(e)&&"length"in e&&(!t&&!e.length||e.length-1 in e&&$m(e[0]))&&!e.nodeType&&e!==fm},uv=function(e,t){return!Zm(e)||t||!mm&&Dv()?rg(e)?function(e,t,n){return void 0===n&&(n=[]),e.forEach((function(e){var i;return Zm(e)&&!t||hv(e,1)?(i=n).push.apply(i,uv(e)):n.push(e)}))||n}(e,t):hv(e)?cv.call(e,0):e?[e]:[]:cv.call(gm.querySelectorAll(e),0)},dv=function(e){return e.sort((function(){return.5-Math.random()}))},pv=function(e){if(Jm(e))return e;var t=$m(e)?e:{each:e},n=Gv(t.ease),i=t.from||0,r=parseFloat(t.base)||0,s={},o=i>0&&i<1,a=isNaN(i)||o,l=t.axis,c=i,h=i;return Zm(i)?c=h={center:.5,edges:.5,end:1}[i]||0:!o&&a&&(c=i[0],h=i[1]),function(e,o,u){var d,p,f,m,g,v,y,x,_,b=(u||t).length,w=s[b];if(!w){if(!(_="auto"===t.grid?0:(t.grid||[1,Hm])[1])){for(y=-Hm;y<(y=u[_++].getBoundingClientRect().left)&&_y&&(y=g),gb?b-1:l?"y"===l?b/_:_:Math.max(_,b/_))||0)*("edges"===i?-1:1),w.b=b<0?r-b:r,w.u=lv(t.amount||t.each)||0,n=n&&b<0?Bv(n):n}return b=(w[e]-w.min)/w.max||0,Rg(w.b+(n?n(b):b)*w.v)+w.u}},fv=function(e){var t=e<1?Math.pow(10,(e+"").length-2):1;return function(n){return Math.floor(Math.round(parseFloat(n)/e)*e*t)/t+(Km(n)?0:lv(n))}},mv=function(e,t){var n,i,r=rg(e);return!r&&$m(e)&&(n=r=e.radius||Hm,e.values?(e=uv(e.values),(i=!Km(e[0]))&&(n*=n)):e=fv(e.increment)),ov(t,r?Jm(e)?function(t){return i=e(t),Math.abs(i-t)<=n?i:t}:function(t){for(var r,s,o=parseFloat(i?t.x:t),a=parseFloat(i?t.y:0),l=Hm,c=0,h=e.length;h--;)(r=i?(r=e[h].x-o)*r+(s=e[h].y-a)*s:Math.abs(e[h]-o))(r=Math.abs(r))&&(s=i,a=r);return s},bv=function(e,t,n){var i,r,s=e.vars,o=s[t];if(o)return i=s[t+"Params"],r=s.callbackScope||e,n&&xg.length&&Dg(),i?o.apply(r,i):o.call(r)},wv=function(e){return Vg(e),e.progress()<1&&bv(e,"onInterrupt"),e},Mv=function(e){var t=(e=!e.name&&e.default||e).name,n=Jm(e),i=t&&!n&&e.init?function(){this._props=[]}:e,r={init:vg,render:uy,add:Jv,kill:py,modifier:dy,rawVars:0},s={targetTest:0,get:0,getSetter:ay,aliases:{},register:0};if(Dv(),e!==i){if(bg[t])return;Ug(i,Ug(kg(e,r),s)),Fg(i.prototype,Fg(r,kg(e,s))),bg[i.prop=t]=i,e.targetTest&&(Sg.push(i),yg[t]=1),t=("css"===t?"CSS":t.charAt(0).toUpperCase()+t.substr(1))+"Plugin"}gg(t,i),e.register&&e.register(_y,i,gy)},Sv={aqua:[0,255,255],lime:[0,255,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,255],navy:[0,0,128],white:[255,255,255],olive:[128,128,0],yellow:[255,255,0],orange:[255,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[255,0,0],pink:[255,192,203],cyan:[0,255,255],transparent:[255,255,255,0]},Tv=function(e,t,n){return 255*(6*(e=e<0?e+1:e>1?e-1:e)<1?t+(n-t)*e*6:e<.5?n:3*e<2?t+(n-t)*(2/3-e)*6:t)+.5|0},Ev=function(e,t,n){var i,r,s,o,a,l,c,h,u,d,p=e?Km(e)?[e>>16,e>>8&255,255&e]:0:Sv.black;if(!p){if(","===e.substr(-1)&&(e=e.substr(0,e.length-1)),Sv[e])p=Sv[e];else if("#"===e.charAt(0))4===e.length&&(i=e.charAt(1),r=e.charAt(2),s=e.charAt(3),e="#"+i+i+r+r+s+s),p=[(e=parseInt(e.substr(1),16))>>16,e>>8&255,255&e];else if("hsl"===e.substr(0,3))if(p=d=e.match(sg),t){if(~e.indexOf("="))return p=e.match(og),n&&p.length<4&&(p[3]=1),p}else o=+p[0]%360/360,a=+p[1]/100,i=2*(l=+p[2]/100)-(r=l<=.5?l*(a+1):l+a-l*a),p.length>3&&(p[3]*=1),p[0]=Tv(o+1/3,i,r),p[1]=Tv(o,i,r),p[2]=Tv(o-1/3,i,r);else p=e.match(sg)||Sv.transparent;p=p.map(Number)}return t&&!d&&(i=p[0]/255,r=p[1]/255,s=p[2]/255,l=((c=Math.max(i,r,s))+(h=Math.min(i,r,s)))/2,c===h?o=a=0:(u=c-h,a=l>.5?u/(2-c-h):u/(c+h),o=c===i?(r-s)/u+(rCm&&(Rm+=o-Lm),((n=(r=(Pm+=o)-Rm)-Dm)>0||a)&&(s=++Sm.frame,Tm=r-1e3*Sm.time,Sm.time=r/=1e3,Dm+=n+(n>=Nm?4:Nm-n),i=1),a||(bm=wm(e)),i)for(Em=0;Em=t&&Em--},_listeners:Im=[]}),Dv=function(){return!_m&&Nv.wake()},Iv={},Ov=/^[\d.\-M][\d.\-,\s]/,zv=/["']/g,Uv=function(e){for(var t,n,i,r={},s=e.substr(1,e.length-3).split(":"),o=s[0],a=1,l=s.length;a1&&o.config?o.config.apply(null,~e.indexOf("{")?[Uv(s[1])]:(t=e,n=t.indexOf("(")+1,i=t.indexOf(")"),r=t.indexOf("(",n),t.substring(n,~r&&r=1?n:1,s=(i||(t?.3:.45))/(n<1?n:1),o=s/jm*(Math.asin(1/r)||0),a=function(e){return 1===e?1:r*Math.pow(2,-10*e)*Ym((e-o)*s)+1},l="out"===t?a:"in"===t?function(e){return 1-a(1-e)}:Hv(a);return s=jm/s,l.config=function(n,i){return e(t,n,i)},l},Vv=function e(t,n){void 0===n&&(n=1.70158);var i=function(e){return e?--e*e*((n+1)*e+n)+1:0},r="out"===t?i:"in"===t?function(e){return 1-i(1-e)}:Hv(i);return r.config=function(n){return e(t,n)},r};Lg("Linear,Quad,Cubic,Quart,Quint,Strong",(function(e,t){var n=t<5?t+1:t;kv(e+",Power"+(n-1),t?function(e){return Math.pow(e,n)}:function(e){return e},(function(e){return 1-Math.pow(1-e,n)}),(function(e){return e<.5?Math.pow(2*e,n)/2:1-Math.pow(2*(1-e),n)/2}))})),Iv.Linear.easeNone=Iv.none=Iv.Linear.easeIn,kv("Elastic",jv("in"),jv("out"),jv()),zm=7.5625,Bm=1/(Um=2.75),kv("Bounce",(function(e){return 1-Fm(1-e)}),Fm=function(e){return e0?e+(e+this._rDelay)*this._repeat:e):this.totalDuration()&&this._dur},t.totalDuration=function(e){return arguments.length?(this._dirty=0,nv(this,this._repeat<0?e:(e-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},t.totalTime=function(e,t){if(Dv(),!arguments.length)return this._tTime;var n=this._dp;if(n&&n.smoothChildTiming&&this._ts){for(Kg(this,e);n.parent;)n.parent._time!==n._start+(n._ts>=0?n._tTime/n._ts:(n.totalDuration()-n._tTime)/-n._ts)&&n.totalTime(n._tTime,!0),n=n.parent;!this.parent&&this._dp.autoRemoveChildren&&(this._ts>0&&e0||!this._tDur&&!e)&&$g(this._dp,this,this._start-this._delay)}return(this._tTime!==e||!this._dur&&!t||this._initted&&1e-8===Math.abs(this._zTime)||!e&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=e),Ig(this,e,t)),this},t.time=function(e,t){return arguments.length?this.totalTime(Math.min(this.totalDuration(),e+qg(this))%this._dur||(e?this._dur:0),t):this._time},t.totalProgress=function(e,t){return arguments.length?this.totalTime(this.totalDuration()*e,t):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.ratio},t.progress=function(e,t){return arguments.length?this.totalTime(this.duration()*(!this._yoyo||1&this.iteration()?e:1-e)+qg(this),t):this.duration()?Math.min(1,this._time/this._dur):this.ratio},t.iteration=function(e,t){var n=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(e-1)*n,t):this._repeat?Yg(this._tTime,n)+1:1},t.timeScale=function(e){if(!arguments.length)return-1e-8===this._rts?0:this._rts;if(this._rts===e)return this;var t=this.parent&&this._ts?Zg(this.parent._time,this):this._tTime;return this._rts=+e||0,this._ts=this._ps||-1e-8===e?0:this._rts,Xg(this.totalTime(av(-this._delay,this._tDur,t),!0))},t.paused=function(e){return arguments.length?(this._ps!==e&&(this._ps=e,e?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(Dv(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,1===this.progress()&&(this._tTime-=1e-8)&&1e-8!==Math.abs(this._zTime)))),this):this._ps},t.startTime=function(e){if(arguments.length){this._start=e;var t=this.parent||this._dp;return t&&(t._sort||!this.parent)&&$g(t,this,e-this._delay),this}return this._start},t.endTime=function(e){return this._start+(eg(e)?this.totalDuration():this.duration())/Math.abs(this._ts)},t.rawTime=function(e){var t=this.parent||this._dp;return t?e&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?Zg(t.rawTime(e),this):this._tTime:this._tTime},t.globalTime=function(e){for(var t=this,n=arguments.length?e:t.rawTime();t;)n=t._start+n/(t._ts||1),t=t._dp;return n},t.repeat=function(e){return arguments.length?(this._repeat=e,iv(this)):this._repeat},t.repeatDelay=function(e){return arguments.length?(this._rDelay=e,iv(this)):this._rDelay},t.yoyo=function(e){return arguments.length?(this._yoyo=e,this):this._yoyo},t.seek=function(e,t){return this.totalTime(sv(this,e),eg(t))},t.restart=function(e,t){return this.play().totalTime(e?-this._delay:0,eg(t))},t.play=function(e,t){return null!=e&&this.seek(e,t),this.reversed(!1).paused(!1)},t.reverse=function(e,t){return null!=e&&this.seek(e||this.totalDuration(),t),this.reversed(!0).paused(!1)},t.pause=function(e,t){return null!=e&&this.seek(e,t),this.paused(!0)},t.resume=function(){return this.paused(!1)},t.reversed=function(e){return arguments.length?(!!e!==this.reversed()&&this.timeScale(-this._rts||(e?-1e-8:0)),this):this._rts<0},t.invalidate=function(){return this._initted=0,this._zTime=-1e-8,this},t.isActive=function(){var e,t=this.parent||this._dp,n=this._start;return!(t&&!(this._ts&&this._initted&&t.isActive()&&(e=t.rawTime(!0))>=n&&e1?(t?(i[e]=t,n&&(i[e+"Params"]=n),"onUpdate"===e&&(this._onUpdate=t)):delete i[e],this):i[e]},t.then=function(e){var t=this;return new Promise((function(n){var i=Jm(e)?e:zg,r=function(){var e=t.then;t.then=null,Jm(i)&&(i=i(t))&&(i.then||i===t)&&(t.then=e),n(i),t.then=e};t._initted&&1===t.totalProgress()&&t._ts>=0||!t._tTime&&t._ts<0?r():t._prom=r}))},t.kill=function(){wv(this)},e}();Ug(Xv.prototype,{_time:0,_start:0,_end:0,_tTime:0,_tDur:0,_dirty:0,_repeat:0,_yoyo:!1,parent:null,_initted:!1,_rDelay:0,_ts:1,_dp:0,ratio:0,_zTime:-1e-8,_prom:0,_ps:!1,_rts:1});var qv=function(e){function t(t,n){var i;return void 0===t&&(t={}),(i=e.call(this,t,n)||this).labels={},i.smoothChildTiming=!!t.smoothChildTiming,i.autoRemoveChildren=!!t.autoRemoveChildren,i._sort=eg(t.sortChildren),i.parent&&Qg(i.parent,um(i)),t.scrollTrigger&&ev(um(i),t.scrollTrigger),i}dm(t,e);var n=t.prototype;return n.to=function(e,t,n){return new ny(e,Ng(arguments,0,this),sv(this,Km(t)?arguments[3]:n)),this},n.from=function(e,t,n){return new ny(e,Ng(arguments,1,this),sv(this,Km(t)?arguments[3]:n)),this},n.fromTo=function(e,t,n,i){return new ny(e,Ng(arguments,2,this),sv(this,Km(t)?arguments[4]:i)),this},n.set=function(e,t,n){return t.duration=0,t.parent=this,Hg(t).repeatDelay||(t.repeat=0),t.immediateRender=!!t.immediateRender,new ny(e,t,sv(this,n),1),this},n.call=function(e,t,n){return $g(this,ny.delayedCall(0,e,t),sv(this,n))},n.staggerTo=function(e,t,n,i,r,s,o){return n.duration=t,n.stagger=n.stagger||i,n.onComplete=s,n.onCompleteParams=o,n.parent=this,new ny(e,n,sv(this,r)),this},n.staggerFrom=function(e,t,n,i,r,s,o){return n.runBackwards=1,Hg(n).immediateRender=eg(n.immediateRender),this.staggerTo(e,t,n,i,r,s,o)},n.staggerFromTo=function(e,t,n,i,r,s,o,a){return i.startAt=n,Hg(i).immediateRender=eg(i.immediateRender),this.staggerTo(e,t,i,r,s,o,a)},n.render=function(e,t,n){var i,r,s,o,a,l,c,h,u,d,p,f,m=this._time,g=this._dirty?this.totalDuration():this._tDur,v=this._dur,y=this!==pm&&e>g-1e-8&&e>=0?g:e<1e-8?0:e,x=this._zTime<0!=e<0&&(this._initted||!v);if(y!==this._tTime||n||x){if(m!==this._time&&v&&(y+=this._time-m,e+=this._time-m),i=y,u=this._start,l=!(h=this._ts),x&&(v||(m=this._zTime),(e||!t)&&(this._zTime=e)),this._repeat&&(p=this._yoyo,a=v+this._rDelay,i=Rg(y%a),y===g?(o=this._repeat,i=v):((o=~~(y/a))&&o===y/a&&(i=v,o--),i>v&&(i=v)),d=Yg(this._tTime,a),!m&&this._tTime&&d!==o&&(d=o),p&&1&o&&(i=v-i,f=1),o!==d&&!this._lock)){var _=p&&1&d,b=_===(p&&1&o);if(ot)for(i=e._first;i&&i._start<=n;){if(!i._dur&&"isPause"===i.data&&i._start>t)return i;i=i._next}else for(i=e._last;i&&i._start>=n;){if(!i._dur&&"isPause"===i.data&&i._start=m&&e>=0)for(r=this._first;r;){if(s=r._next,(r._act||i>=r._start)&&r._ts&&c!==r){if(r.parent!==this)return this.render(e,t,n);if(r.render(r._ts>0?(i-r._start)*r._ts:(r._dirty?r.totalDuration():r._tDur)+(i-r._start)*r._ts,t,n),i!==this._time||!this._ts&&!l){c=0,s&&(y+=this._zTime=-1e-8);break}}r=s}else{r=this._last;for(var w=e<0?e:i;r;){if(s=r._prev,(r._act||w<=r._end)&&r._ts&&c!==r){if(r.parent!==this)return this.render(e,t,n);if(r.render(r._ts>0?(w-r._start)*r._ts:(r._dirty?r.totalDuration():r._tDur)+(w-r._start)*r._ts,t,n),i!==this._time||!this._ts&&!l){c=0,s&&(y+=this._zTime=w?-1e-8:1e-8);break}}r=s}}if(c&&!t&&(this.pause(),c.render(i>=m?0:-1e-8)._zTime=i>=m?1:-1,this._ts))return this._start=u,Jg(this),this.render(e,t,n);this._onUpdate&&!t&&bv(this,"onUpdate",!0),(y===g&&g>=this.totalDuration()||!y&&m)&&(u!==this._start&&Math.abs(h)===Math.abs(this._ts)||this._lock||((e||!v)&&(y===g&&this._ts>0||!y&&this._ts<0)&&Vg(this,1),t||e<0&&!m||!y&&!m||(bv(this,y===g?"onComplete":"onReverseComplete",!0),this._prom&&!(y0)&&this._prom())))}return this},n.add=function(e,t){var n=this;if(Km(t)||(t=sv(this,t)),!(e instanceof Xv)){if(rg(e))return e.forEach((function(e){return n.add(e,t)})),this;if(Zm(e))return this.addLabel(e,t);if(!Jm(e))return this;e=ny.delayedCall(0,e)}return this!==e?$g(this,e,t):this},n.getChildren=function(e,t,n,i){void 0===e&&(e=!0),void 0===t&&(t=!0),void 0===n&&(n=!0),void 0===i&&(i=-Hm);for(var r=[],s=this._first;s;)s._start>=i&&(s instanceof ny?t&&r.push(s):(n&&r.push(s),e&&r.push.apply(r,s.getChildren(!0,t,n)))),s=s._next;return r},n.getById=function(e){for(var t=this.getChildren(1,1,1),n=t.length;n--;)if(t[n].vars.id===e)return t[n]},n.remove=function(e){return Zm(e)?this.removeLabel(e):Jm(e)?this.killTweensOf(e):(jg(this,e),e===this._recent&&(this._recent=this._last),Wg(this))},n.totalTime=function(t,n){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=Rg(Nv.time-(this._ts>0?t/this._ts:(this.totalDuration()-t)/-this._ts))),e.prototype.totalTime.call(this,t,n),this._forcing=0,this):this._tTime},n.addLabel=function(e,t){return this.labels[e]=sv(this,t),this},n.removeLabel=function(e){return delete this.labels[e],this},n.addPause=function(e,t,n){var i=ny.delayedCall(0,t||vg,n);return i.data="isPause",this._hasPause=1,$g(this,i,sv(this,e))},n.removePause=function(e){var t=this._first;for(e=sv(this,e);t;)t._start===e&&"isPause"===t.data&&Vg(t),t=t._next},n.killTweensOf=function(e,t,n){for(var i=this.getTweensOf(e,n),r=i.length;r--;)Yv!==i[r]&&i[r].kill(e,t);return this},n.getTweensOf=function(e,t){for(var n,i=[],r=uv(e),s=this._first,o=Km(t);s;)s instanceof ny?Pg(s._targets,r)&&(o?(!Yv||s._initted&&s._ts)&&s.globalTime(0)<=t&&s.globalTime(s.totalDuration())>t:!t||s.isActive())&&i.push(s):(n=s.getTweensOf(r,t)).length&&i.push.apply(i,n),s=s._next;return i},n.tweenTo=function(e,t){t=t||{};var n=this,i=sv(n,e),r=t,s=r.startAt,o=r.onStart,a=r.onStartParams,l=ny.to(n,Ug(t,{ease:"none",lazy:!1,time:i,overwrite:"auto",duration:t.duration||Math.abs((i-(s&&"time"in s?s.time:n._time))/n.timeScale())||1e-8,onStart:function(){n.pause();var e=t.duration||Math.abs((i-n._time)/n.timeScale());l._dur!==e&&nv(l,e,0,1).render(l._time,!0,!0),o&&o.apply(l,a||[])}}));return l},n.tweenFromTo=function(e,t,n){return this.tweenTo(t,Ug({startAt:{time:sv(this,e)}},n))},n.recent=function(){return this._recent},n.nextLabel=function(e){return void 0===e&&(e=this._time),_v(this,sv(this,e))},n.previousLabel=function(e){return void 0===e&&(e=this._time),_v(this,sv(this,e),1)},n.currentLabel=function(e){return arguments.length?this.seek(e,!0):this.previousLabel(this._time+1e-8)},n.shiftChildren=function(e,t,n){void 0===n&&(n=0);for(var i,r=this._first,s=this.labels;r;)r._start>=n&&(r._start+=e,r._end+=e),r=r._next;if(t)for(i in s)s[i]>=n&&(s[i]+=e);return Wg(this)},n.invalidate=function(){var t=this._first;for(this._lock=0;t;)t.invalidate(),t=t._next;return e.prototype.invalidate.call(this)},n.clear=function(e){void 0===e&&(e=!0);for(var t,n=this._first;n;)t=n._next,this.remove(n),n=t;return this._time=this._tTime=this._pTime=0,e&&(this.labels={}),Wg(this)},n.totalDuration=function(e){var t,n,i,r=0,s=this,o=s._last,a=Hm;if(arguments.length)return s.timeScale((s._repeat<0?s.duration():s.totalDuration())/(s.reversed()?-e:e));if(s._dirty){for(i=s.parent;o;)t=o._prev,o._dirty&&o.totalDuration(),(n=o._start)>a&&s._sort&&o._ts&&!s._lock?(s._lock=1,$g(s,o,n-o._delay,1)._lock=0):a=n,n<0&&o._ts&&(r-=n,(!i&&!s._dp||i&&i.smoothChildTiming)&&(s._start+=n/s._ts,s._time-=n,s._tTime-=n),s.shiftChildren(-n,!1,-1/0),a=0),o._end>r&&o._ts&&(r=o._end),o=t;nv(s,s===pm&&s._time>r?s._time:r,1,1),s._dirty=0}return s._tDur},t.updateRoot=function(e){if(pm._ts&&(Ig(pm,Zg(e,pm)),ym=Nv.frame),Nv.frame>=Mg){Mg+=Gm.autoSleep||120;var t=pm._first;if((!t||!t._ts)&&Gm.autoSleep&&Nv._listeners.length<2){for(;t&&!t._ts;)t=t._next;t||Nv.sleep()}}},t}(Xv);Ug(qv.prototype,{_lock:0,_hasPause:0,_forcing:0});var Yv,Zv=function(e,t,n,i,r,s,o){var a,l,c,h,u,d,p,f,m=new gy(this._pt,e,t,0,1,hy,null,r),g=0,v=0;for(m.b=n,m.e=i,n+="",(p=~(i+="").indexOf("random("))&&(i=yv(i)),s&&(s(f=[n,i],e,t),n=f[0],i=f[1]),l=n.match(lg)||[];a=lg.exec(i);)h=a[0],u=i.substring(g,a.index),c?c=(c+1)%5:"rgba("===u.substr(-5)&&(c=1),h!==l[v++]&&(d=parseFloat(l[v-1])||0,m._pt={_next:m._pt,p:u||1===v?u:",",s:d,c:"="===h.charAt(1)?parseFloat(h.substr(2))*("-"===h.charAt(0)?-1:1):parseFloat(h)-d,m:c&&c<4?Math.round:0},g=lg.lastIndex);return m.c=g0)A||(t._startAt=0);else if(C&&!(n<0&&L))return void(n&&(t._zTime=n))}else if(S&&C)if(L)!A&&(t._startAt=0);else if(n&&(x=!1),s=Ug({overwrite:!1,data:"isFromStart",lazy:x&&eg(_),immediateRender:x,stagger:0,parent:P},i),f&&(s[h.prop]=f),Vg(t._startAt=ny.set(R,s)),x){if(!n)return}else e(t._startAt,1e-8);for(t._pt=0,_=C&&eg(_)||_&&!C,r=0;r")}));else{if(c=T.length,d=y?pv(y):vg,$m(y))for(h in y)~ey.indexOf(h)&&(p||(p={}),p[h]=y[h]);for(a=0;ap-1e-8&&e>=0?p:e<1e-8?0:e;if(f){if(m!==this._tTime||!e||n||this._startAt&&this._zTime<0!=e<0){if(i=m,h=this.timeline,this._repeat){if(o=f+this._rDelay,i=Rg(m%o),m===p?(s=this._repeat,i=f):((s=~~(m/o))&&s===m/o&&(i=f,s--),i>f&&(i=f)),(l=this._yoyo&&1&s)&&(u=this._yEase,i=f-i),a=Yg(this._tTime,o),i===d&&!n&&this._initted)return this;s!==a&&(h&&this._yEase&&Fv(h,l),!this.vars.repeatRefresh||l||this._lock||(this._lock=n=1,this.render(Rg(o*s),!0).invalidate()._lock=0))}if(!this._initted){if(tv(this,e<0?e:i,n,t))return this._tTime=0,this;if(f!==this._dur)return this.render(e,t,n)}for(this._tTime=m,this._time=i,!this._act&&this._ts&&(this._act=1,this._lazy=0),this.ratio=c=(u||this._ease)(i/f),this._from&&(this.ratio=c=1-c),i&&!d&&!t&&bv(this,"onStart"),r=this._pt;r;)r.r(c,r.d),r=r._next;h&&h.render(e<0?e:!i&&l?-1e-8:h._dur*c,t,n)||this._startAt&&(this._zTime=e),this._onUpdate&&!t&&(e<0&&this._startAt&&this._startAt.render(e,!0,n),bv(this,"onUpdate")),this._repeat&&s!==a&&this.vars.onRepeat&&!t&&this.parent&&bv(this,"onRepeat"),m!==this._tDur&&m||this._tTime!==m||(e<0&&this._startAt&&!this._onUpdate&&this._startAt.render(e,!0,!0),(e||!f)&&(m===this._tDur&&this._ts>0||!m&&this._ts<0)&&Vg(this,1),t||e<0&&!d||!m&&!d||(bv(this,m===p?"onComplete":"onReverseComplete",!0),this._prom&&!(m0)&&this._prom()))}}else!function(e,t,n,i){var r,s,o=e.ratio,a=t<0||!t&&o&&!e._start&&e._zTime>1e-8&&!e._dp._lock||(e._ts<0||e._dp._ts<0)&&"isFromStart"!==e.data&&"isStart"!==e.data?0:1,l=e._rDelay,c=0;if(l&&e._repeat&&(c=av(0,e._tDur,t),Yg(c,l)!==(s=Yg(e._tTime,l))&&(o=1-a,e.vars.repeatRefresh&&e._initted&&e.invalidate())),a!==o||i||1e-8===e._zTime||!t&&e._zTime){if(!e._initted&&tv(e,t,i,n))return;for(s=e._zTime,e._zTime=t||(n?1e-8:0),n||(n=t&&!s),e.ratio=a,e._from&&(a=1-a),e._time=0,e._tTime=c,n||bv(e,"onStart"),r=e._pt;r;)r.r(a,r.d),r=r._next;e._startAt&&t<0&&e._startAt.render(t,!0,!0),e._onUpdate&&!n&&bv(e,"onUpdate"),c&&e._repeat&&!n&&e.parent&&bv(e,"onRepeat"),(t>=e._tDur||t<0)&&e.ratio===a&&(a&&Vg(e,1),n||(bv(e,a?"onComplete":"onReverseComplete",!0),e._prom&&e._prom()))}else e._zTime||(e._zTime=t)}(this,e,t,n);return this},n.targets=function(){return this._targets},n.invalidate=function(){return this._pt=this._op=this._startAt=this._onUpdate=this._act=this._lazy=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(),e.prototype.invalidate.call(this)},n.kill=function(e,t){if(void 0===t&&(t="all"),!(e||t&&"all"!==t)&&(this._lazy=0,this.parent))return wv(this);if(this.timeline){var n=this.timeline.totalDuration();return this.timeline.killTweensOf(e,t,Yv&&!0!==Yv.vars.overwrite)._first||wv(this),this.parent&&n!==this.timeline.totalDuration()&&nv(this,this._dur*this.timeline._tDur/n,0,1),this}var i,r,s,o,a,l,c,h=this._targets,u=e?uv(e):h,d=this._ptLookup,p=this._pt;if((!t||"all"===t)&&function(e,t){for(var n=e.length,i=n===t.length;i&&n--&&e[n]===t[n];);return n<0}(h,u))return"all"===t&&(this._pt=0),wv(this);for(i=this._op=this._op||[],"all"!==t&&(Zm(t)&&(a={},Lg(t,(function(e){return a[e]=1})),t=a),t=function(e,t){var n,i,r,s,o=e[0]?Ag(e[0]).harness:0,a=o&&o.aliases;if(!a)return t;for(i in n=Fg({},t),a)if(i in n)for(r=(s=a[i].split(",")).length;r--;)n[s[r]]=n[i];return n}(h,t)),c=h.length;c--;)if(~u.indexOf(h[c]))for(a in r=d[c],"all"===t?(i[c]=t,o=r,s={}):(s=i[c]=i[c]||{},o=t),o)(l=r&&r[a])&&("kill"in l.d&&!0!==l.d.kill(a)||jg(this,l,"_pt"),delete r[a]),"all"!==s&&(s[a]=1);return this._initted&&!this._pt&&p&&wv(this),this},t.to=function(e,n){return new t(e,n,arguments[2])},t.from=function(e,n){return new t(e,Ng(arguments,1))},t.delayedCall=function(e,n,i,r){return new t(n,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:e,onComplete:n,onReverseComplete:n,onCompleteParams:i,onReverseCompleteParams:i,callbackScope:r})},t.fromTo=function(e,n,i){return new t(e,Ng(arguments,2))},t.set=function(e,n){return n.duration=0,n.repeatDelay||(n.repeat=0),new t(e,n)},t.killTweensOf=function(e,t,n){return pm.killTweensOf(e,t,n)},t}(Xv);Ug(ny.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0}),Lg("staggerTo,staggerFrom,staggerFromTo",(function(e){ny[e]=function(){var t=new qv,n=cv.call(arguments,0);return n.splice("staggerFromTo"===e?5:4,0,0),t[e].apply(t,n)}}));var iy=function(e,t,n){return e[t]=n},ry=function(e,t,n){return e[t](n)},sy=function(e,t,n,i){return e[t](i.fp,n)},oy=function(e,t,n){return e.setAttribute(t,n)},ay=function(e,t){return Jm(e[t])?ry:Qm(e[t])&&e.setAttribute?oy:iy},ly=function(e,t){return t.set(t.t,t.p,Math.round(1e4*(t.s+t.c*e))/1e4,t)},cy=function(e,t){return t.set(t.t,t.p,!!(t.s+t.c*e),t)},hy=function(e,t){var n=t._pt,i="";if(!e&&t.b)i=t.b;else if(1===e&&t.e)i=t.e;else{for(;n;)i=n.p+(n.m?n.m(n.s+n.c*e):Math.round(1e4*(n.s+n.c*e))/1e4)+i,n=n._next;i+=t.c}t.set(t.t,t.p,i,t)},uy=function(e,t){for(var n=t._pt;n;)n.r(e,n.d),n=n._next},dy=function(e,t,n,i){for(var r,s=this._pt;s;)r=s._next,s.p===i&&s.modifier(e,t,n),s=r},py=function(e){for(var t,n,i=this._pt;i;)n=i._next,i.p===e&&!i.op||i.op===e?jg(this,i,"_pt"):i.dep||(t=1),i=n;return!t},fy=function(e,t,n,i){i.mSet(e,t,i.m.call(i.tween,n,i.mt),i)},my=function(e){for(var t,n,i,r,s=e._pt;s;){for(t=s._next,n=i;n&&n.pr>s.pr;)n=n._next;(s._prev=n?n._prev:r)?s._prev._next=s:i=s,(s._next=n)?n._prev=s:r=s,s=t}e._pt=i},gy=function(){function e(e,t,n,i,r,s,o,a,l){this.t=t,this.s=i,this.c=r,this.p=n,this.r=s||ly,this.d=o||this,this.set=a||iy,this.pr=l||0,this._next=e,e&&(e._prev=this)}return e.prototype.modifier=function(e,t,n){this.mSet=this.mSet||this.set,this.set=fy,this.m=e,this.mt=n,this.tween=t},e}();Lg(Tg+"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger",(function(e){return yg[e]=1})),ug.TweenMax=ug.TweenLite=ny,ug.TimelineLite=ug.TimelineMax=qv,pm=new qv({sortChildren:!1,defaults:km,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0}),Gm.stringFilter=Pv;var vy={registerPlugin:function(){for(var e=arguments.length,t=new Array(e),n=0;n1){var i=e.map((function(e){return _y.quickSetter(e,t,n)})),r=i.length;return function(e){for(var t=r;t--;)i[t](e)}}e=e[0]||{};var s=bg[t],o=Ag(e),a=o.harness&&(o.harness.aliases||{})[t]||t,l=s?function(t){var i=new s;xm._pt=0,i.init(e,n?t+n:t,xm,0,[e]),i.render(1,i),xm._pt&&uy(1,xm)}:o.set(e,a);return s?l:function(t){return l(e,a,n?t+n:t,o,1)}},isTweening:function(e){return pm.getTweensOf(e,!0).length>0},defaults:function(e){return e&&e.ease&&(e.ease=Gv(e.ease,km.ease)),Gg(km,e||{})},config:function(e){return Gg(Gm,e||{})},registerEffect:function(e){var t=e.name,n=e.effect,i=e.plugins,r=e.defaults,s=e.extendTimeline;(i||"").split(",").forEach((function(e){return e&&!bg[e]&&!ug[e]&&mg(t+" effect requires "+e+" plugin.")})),wg[t]=function(e,t,i){return n(uv(e),Ug(t||{},r),i)},s&&(qv.prototype[t]=function(e,n,i){return this.add(wg[t](e,$m(n)?n:(i=n)&&{},this),i)})},registerEase:function(e,t){Iv[e]=Gv(t)},parseEase:function(e,t){return arguments.length?Gv(e,t):Iv},getById:function(e){return pm.getById(e)},exportRoot:function(e,t){void 0===e&&(e={});var n,i,r=new qv(e);for(r.smoothChildTiming=eg(e.smoothChildTiming),pm.remove(r),r._dp=0,r._time=r._tTime=pm._time,n=pm._first;n;)i=n._next,!t&&!n._dur&&n instanceof ny&&n.vars.onComplete===n._targets[0]||$g(r,n,n._start-n._delay),n=i;return $g(pm,r,0),r},utils:{wrap:function e(t,n,i){var r=n-t;return rg(t)?vv(t,e(0,t.length),n):ov(i,(function(e){return(r+(e-t)%r)%r+t}))},wrapYoyo:function e(t,n,i){var r=n-t,s=2*r;return rg(t)?vv(t,e(0,t.length-1),n):ov(i,(function(e){return t+((e=(s+(e-t)%s)%s||0)>r?s-e:e)}))},distribute:pv,random:gv,snap:mv,normalize:function(e,t,n){return xv(e,t,0,1,n)},getUnit:lv,clamp:function(e,t,n){return ov(n,(function(n){return av(e,t,n)}))},splitColor:Ev,toArray:uv,mapRange:xv,pipe:function(){for(var e=arguments.length,t=new Array(e),n=0;n=0?ex[r]:"")+e},nx=function(){"undefined"!=typeof window&&window.document&&(by=window,wy=by.document,My=wy.documentElement,Ty=Qy("div")||{style:{}},Ey=Qy("div"),Jy=tx(Jy),Ky=Jy+"Origin",Ty.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",Cy=!!tx("perspective"),Sy=1)},ix=function e(t){var n,i=Qy("svg",this.ownerSVGElement&&this.ownerSVGElement.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),r=this.parentNode,s=this.nextSibling,o=this.style.cssText;if(My.appendChild(i),i.appendChild(this),this.style.display="block",t)try{n=this.getBBox(),this._gsapBBox=this.getBBox,this.getBBox=e}catch(e){}else this._gsapBBox&&(n=this._gsapBBox());return r&&(s?r.insertBefore(this,s):r.appendChild(this)),My.removeChild(i),this.style.cssText=o,n},rx=function(e,t){for(var n=t.length;n--;)if(e.hasAttribute(t[n]))return e.getAttribute(t[n])},sx=function(e){var t;try{t=e.getBBox()}catch(n){t=ix.call(e,!0)}return t&&(t.width||t.height)||e.getBBox===ix||(t=ix.call(e,!0)),!t||t.width||t.x||t.y?t:{x:+rx(e,["x","cx","x1"])||0,y:+rx(e,["y","cy","y1"])||0,width:0,height:0}},ox=function(e){return!(!e.getCTM||e.parentNode&&!e.ownerSVGElement||!sx(e))},ax=function(e,t){if(t){var n=e.style;t in Ry&&t!==Ky&&(t=Jy),n.removeProperty?("ms"!==t.substr(0,2)&&"webkit"!==t.substr(0,6)||(t="-"+t),n.removeProperty(t.replace(Iy,"-$1").toLowerCase())):n.removeAttribute(t)}},lx=function(e,t,n,i,r,s){var o=new gy(e._pt,t,n,0,1,s?jy:Hy);return e._pt=o,o.b=i,o.e=r,e._props.push(n),o},cx={deg:1,rad:1,turn:1},hx=function e(t,n,i,r){var s,o,a,l,c=parseFloat(i)||0,h=(i+"").trim().substr((c+"").length)||"px",u=Ty.style,d=Oy.test(n),p="svg"===t.tagName.toLowerCase(),f=(p?"client":"offset")+(d?"Width":"Height"),m="px"===r,g="%"===r;return r===h||!c||cx[r]||cx[h]?c:("px"!==h&&!m&&(c=e(t,n,i,"px")),l=t.getCTM&&ox(t),g&&(Ry[n]||~n.indexOf("adius"))?Rg(c/(l?t.getBBox()[d?"width":"height"]:t[f])*100):(u[d?"width":"height"]=100+(m?h:r),o=~n.indexOf("adius")||"em"===r&&t.appendChild&&!p?t:t.parentNode,l&&(o=(t.ownerSVGElement||{}).parentNode),o&&o!==wy&&o.appendChild||(o=wy.body),(a=o._gsap)&&g&&a.width&&d&&a.time===Nv.time?Rg(c/a.width*100):((g||"%"===h)&&(u.position=$y(t,"position")),o===t&&(u.position="static"),o.appendChild(Ty),s=Ty[f],o.removeChild(Ty),u.position="absolute",d&&g&&((a=Ag(o)).time=Nv.time,a.width=o[f]),Rg(m?s*c/100:s&&c?100/s*c:0))))},ux=function(e,t,n,i){var r;return Sy||nx(),t in Uy&&"transform"!==t&&~(t=Uy[t]).indexOf(",")&&(t=t.split(",")[0]),Ry[t]&&"transform"!==t?(r=wx(e,i),r="transformOrigin"!==t?r[t]:Mx($y(e,Ky))+" "+r.zOrigin+"px"):(!(r=e.style[t])||"auto"===r||i||~(r+"").indexOf("calc("))&&(r=mx[t]&&mx[t](e,t,n)||$y(e,t)||Cg(e,t)||("opacity"===t?1:0)),n&&!~(r+"").indexOf(" ")?hx(e,t,r,n)+n:r},dx=function(e,t,n,i){if(!n||"none"===n){var r=tx(t,e,1),s=r&&$y(e,r,1);s&&s!==n?(t=r,n=s):"borderColor"===t&&(n=$y(e,"borderTopColor"))}var o,a,l,c,h,u,d,p,f,m,g,v,y=new gy(this._pt,e.style,t,0,1,hy),x=0,_=0;if(y.b=n,y.e=i,n+="","auto"===(i+="")&&(e.style[t]=i,i=$y(e,t)||i,e.style[t]=n),Pv(o=[n,i]),i=o[1],l=(n=o[0]).match(ag)||[],(i.match(ag)||[]).length){for(;a=ag.exec(i);)d=a[0],f=i.substring(x,a.index),h?h=(h+1)%5:"rgba("!==f.substr(-5)&&"hsla("!==f.substr(-5)||(h=1),d!==(u=l[_++]||"")&&(c=parseFloat(u)||0,g=u.substr((c+"").length),(v="="===d.charAt(1)?+(d.charAt(0)+"1"):0)&&(d=d.substr(2)),p=parseFloat(d),m=d.substr((p+"").length),x=ag.lastIndex-m.length,m||(m=m||Gm.units[t]||g,x===i.length&&(i+=m,y.e+=m)),g!==m&&(c=hx(e,t,u,m)||0),y._pt={_next:y._pt,p:f||1===_?f:",",s:c,c:v?v*p:p-c,m:h&&h<4?Math.round:0});y.c=x-1;)n=a[r],Ry[n]&&(i=1,n="transformOrigin"===n?Ky:Jy),ax(s,n);i&&(ax(s,Jy),l&&(l.svg&&s.removeAttribute("transform"),wx(s,1),l.uncache=1))}},mx={clearProps:function(e,t,n,i,r){if("isFromStart"!==r.data){var s=e._pt=new gy(e._pt,t,n,0,0,fx);return s.u=i,s.pr=-10,s.tween=r,e._props.push(n),1}}},gx=[1,0,0,1,0,0],vx={},yx=function(e){return"matrix(1, 0, 0, 1, 0, 0)"===e||"none"===e||!e},xx=function(e){var t=$y(e,Jy);return yx(t)?gx:t.substr(7).match(og).map(Rg)},_x=function(e,t){var n,i,r,s,o=e._gsap||Ag(e),a=e.style,l=xx(e);return o.svg&&e.getAttribute("transform")?"1,0,0,1,0,0"===(l=[(r=e.transform.baseVal.consolidate().matrix).a,r.b,r.c,r.d,r.e,r.f]).join(",")?gx:l:(l!==gx||e.offsetParent||e===My||o.svg||(r=a.display,a.display="block",(n=e.parentNode)&&e.offsetParent||(s=1,i=e.nextSibling,My.appendChild(e)),l=xx(e),r?a.display=r:ax(e,"display"),s&&(i?n.insertBefore(e,i):n?n.appendChild(e):My.removeChild(e))),t&&l.length>6?[l[0],l[1],l[4],l[5],l[12],l[13]]:l)},bx=function(e,t,n,i,r,s){var o,a,l,c=e._gsap,h=r||_x(e,!0),u=c.xOrigin||0,d=c.yOrigin||0,p=c.xOffset||0,f=c.yOffset||0,m=h[0],g=h[1],v=h[2],y=h[3],x=h[4],_=h[5],b=t.split(" "),w=parseFloat(b[0])||0,M=parseFloat(b[1])||0;n?h!==gx&&(a=m*y-g*v)&&(l=w*(-g/a)+M*(m/a)-(m*_-g*x)/a,w=w*(y/a)+M*(-v/a)+(v*_-y*x)/a,M=l):(w=(o=sx(e)).x+(~b[0].indexOf("%")?w/100*o.width:w),M=o.y+(~(b[1]||b[0]).indexOf("%")?M/100*o.height:M)),i||!1!==i&&c.smooth?(x=w-u,_=M-d,c.xOffset=p+(x*m+_*v)-x,c.yOffset=f+(x*g+_*y)-_):c.xOffset=c.yOffset=0,c.xOrigin=w,c.yOrigin=M,c.smooth=!!i,c.origin=t,c.originIsAbsolute=!!n,e.style[Ky]="0px 0px",s&&(lx(s,c,"xOrigin",u,w),lx(s,c,"yOrigin",d,M),lx(s,c,"xOffset",p,c.xOffset),lx(s,c,"yOffset",f,c.yOffset)),e.setAttribute("data-svg-origin",w+" "+M)},wx=function(e,t){var n=e._gsap||new Wv(e);if("x"in n&&!t&&!n.uncache)return n;var i,r,s,o,a,l,c,h,u,d,p,f,m,g,v,y,x,_,b,w,M,S,T,E,A,C,L,R,P,N,D,I,O=e.style,z=n.scaleX<0,U=$y(e,Ky)||"0";return i=r=s=l=c=h=u=d=p=0,o=a=1,n.svg=!(!e.getCTM||!ox(e)),g=_x(e,n.svg),n.svg&&(E=!n.uncache&&e.getAttribute("data-svg-origin"),bx(e,E||U,!!E||n.originIsAbsolute,!1!==n.smooth,g)),f=n.xOrigin||0,m=n.yOrigin||0,g!==gx&&(_=g[0],b=g[1],w=g[2],M=g[3],i=S=g[4],r=T=g[5],6===g.length?(o=Math.sqrt(_*_+b*b),a=Math.sqrt(M*M+w*w),l=_||b?Dy(b,_)*Py:0,(u=w||M?Dy(w,M)*Py+l:0)&&(a*=Math.cos(u*Ny)),n.svg&&(i-=f-(f*_+m*w),r-=m-(f*b+m*M))):(I=g[6],N=g[7],L=g[8],R=g[9],P=g[10],D=g[11],i=g[12],r=g[13],s=g[14],c=(v=Dy(I,P))*Py,v&&(E=S*(y=Math.cos(-v))+L*(x=Math.sin(-v)),A=T*y+R*x,C=I*y+P*x,L=S*-x+L*y,R=T*-x+R*y,P=I*-x+P*y,D=N*-x+D*y,S=E,T=A,I=C),h=(v=Dy(-w,P))*Py,v&&(y=Math.cos(-v),D=M*(x=Math.sin(-v))+D*y,_=E=_*y-L*x,b=A=b*y-R*x,w=C=w*y-P*x),l=(v=Dy(b,_))*Py,v&&(E=_*(y=Math.cos(v))+b*(x=Math.sin(v)),A=S*y+T*x,b=b*y-_*x,T=T*y-S*x,_=E,S=A),c&&Math.abs(c)+Math.abs(l)>359.9&&(c=l=0,h=180-h),o=Rg(Math.sqrt(_*_+b*b+w*w)),a=Rg(Math.sqrt(T*T+I*I)),v=Dy(S,T),u=Math.abs(v)>2e-4?v*Py:0,p=D?1/(D<0?-D:D):0),n.svg&&(E=e.getAttribute("transform"),n.forceCSS=e.setAttribute("transform","")||!yx($y(e,Jy)),E&&e.setAttribute("transform",E))),Math.abs(u)>90&&Math.abs(u)<270&&(z?(o*=-1,u+=l<=0?180:-180,l+=l<=0?180:-180):(a*=-1,u+=u<=0?180:-180)),n.x=((n.xPercent=i&&Math.round(e.offsetWidth/2)===Math.round(-i)?-50:0)?0:i)+"px",n.y=((n.yPercent=r&&Math.round(e.offsetHeight/2)===Math.round(-r)?-50:0)?0:r)+"px",n.z=s+"px",n.scaleX=Rg(o),n.scaleY=Rg(a),n.rotation=Rg(l)+"deg",n.rotationX=Rg(c)+"deg",n.rotationY=Rg(h)+"deg",n.skewX=u+"deg",n.skewY=d+"deg",n.transformPerspective=p+"px",(n.zOrigin=parseFloat(U.split(" ")[2])||0)&&(O[Ky]=Mx(U)),n.xOffset=n.yOffset=0,n.force3D=Gm.force3D,n.renderTransform=n.svg?Ax:Cy?Ex:Tx,n.uncache=0,n},Mx=function(e){return(e=e.split(" "))[0]+" "+e[1]},Sx=function(e,t,n){var i=lv(t);return Rg(parseFloat(t)+parseFloat(hx(e,"x",n+"px",i)))+i},Tx=function(e,t){t.z="0px",t.rotationY=t.rotationX="0deg",t.force3D=0,Ex(e,t)},Ex=function(e,t){var n=t||this,i=n.xPercent,r=n.yPercent,s=n.x,o=n.y,a=n.z,l=n.rotation,c=n.rotationY,h=n.rotationX,u=n.skewX,d=n.skewY,p=n.scaleX,f=n.scaleY,m=n.transformPerspective,g=n.force3D,v=n.target,y=n.zOrigin,x="",_="auto"===g&&e&&1!==e||!0===g;if(y&&("0deg"!==h||"0deg"!==c)){var b,w=parseFloat(c)*Ny,M=Math.sin(w),S=Math.cos(w);w=parseFloat(h)*Ny,b=Math.cos(w),s=Sx(v,s,M*b*-y),o=Sx(v,o,-Math.sin(w)*-y),a=Sx(v,a,S*b*-y+y)}"0px"!==m&&(x+="perspective("+m+") "),(i||r)&&(x+="translate("+i+"%, "+r+"%) "),(_||"0px"!==s||"0px"!==o||"0px"!==a)&&(x+="0px"!==a||_?"translate3d("+s+", "+o+", "+a+") ":"translate("+s+", "+o+") "),"0deg"!==l&&(x+="rotate("+l+") "),"0deg"!==c&&(x+="rotateY("+c+") "),"0deg"!==h&&(x+="rotateX("+h+") "),"0deg"===u&&"0deg"===d||(x+="skew("+u+", "+d+") "),1===p&&1===f||(x+="scale("+p+", "+f+") "),v.style[Jy]=x||"translate(0, 0)"},Ax=function(e,t){var n,i,r,s,o,a=t||this,l=a.xPercent,c=a.yPercent,h=a.x,u=a.y,d=a.rotation,p=a.skewX,f=a.skewY,m=a.scaleX,g=a.scaleY,v=a.target,y=a.xOrigin,x=a.yOrigin,_=a.xOffset,b=a.yOffset,w=a.forceCSS,M=parseFloat(h),S=parseFloat(u);d=parseFloat(d),p=parseFloat(p),(f=parseFloat(f))&&(p+=f=parseFloat(f),d+=f),d||p?(d*=Ny,p*=Ny,n=Math.cos(d)*m,i=Math.sin(d)*m,r=Math.sin(d-p)*-g,s=Math.cos(d-p)*g,p&&(f*=Ny,o=Math.tan(p-f),r*=o=Math.sqrt(1+o*o),s*=o,f&&(o=Math.tan(f),n*=o=Math.sqrt(1+o*o),i*=o)),n=Rg(n),i=Rg(i),r=Rg(r),s=Rg(s)):(n=m,s=g,i=r=0),(M&&!~(h+"").indexOf("px")||S&&!~(u+"").indexOf("px"))&&(M=hx(v,"x",h,"px"),S=hx(v,"y",u,"px")),(y||x||_||b)&&(M=Rg(M+y-(y*n+x*r)+_),S=Rg(S+x-(y*i+x*s)+b)),(l||c)&&(o=v.getBBox(),M=Rg(M+l/100*o.width),S=Rg(S+c/100*o.height)),o="matrix("+n+","+i+","+r+","+s+","+M+","+S+")",v.setAttribute("transform",o),w&&(v.style[Jy]=o)},Cx=function(e,t,n,i,r,s){var o,a,l=Zm(r),c=parseFloat(r)*(l&&~r.indexOf("rad")?Py:1),h=s?c*s:c-i,u=i+h+"deg";return l&&("short"===(o=r.split("_")[1])&&(h%=360)!==h%180&&(h+=h<0?360:-360),"cw"===o&&h<0?h=(h+36e9)%360-360*~~(h/360):"ccw"===o&&h>0&&(h=(h-36e9)%360-360*~~(h/360))),e._pt=a=new gy(e._pt,t,n,i,h,Fy),a.e=u,a.u="deg",e._props.push(n),a},Lx=function(e,t,n){var i,r,s,o,a,l,c,h=Ey.style,u=n._gsap;for(r in h.cssText=getComputedStyle(n).cssText+";position:absolute;display:block;",h[Jy]=t,wy.body.appendChild(Ey),i=wx(Ey,1),Ry)(s=u[r])!==(o=i[r])&&"perspective,force3D,transformOrigin,svgOrigin".indexOf(r)<0&&(a=lv(s)!==(c=lv(o))?hx(n,r,s,c):parseFloat(s),l=parseFloat(o),e._pt=new gy(e._pt,u,r,a,l-a,By),e._pt.u=c||0,e._props.push(r));wy.body.removeChild(Ey)}; /*! * CSSPlugin 3.5.1 * https://greensock.com @@ -16,4 +16,4 @@ function e(e,t){const n=Object.create(null),i=e.split(",");for(let e=0;e1?"border"+e:e]=function(e,t,n,i,r){var s,a;if(arguments.length<4)return s=o.map((function(t){return ox(e,t,n)})),5===(a=s.join(" ")).split(s[0]).length?s[0]:a;s=(i+"").split(" "),a={},o.forEach((function(e,t){return a[e]=s[t]=s[t]||s[(t-1)/2|0]})),e.init(t,a,r)}}));var Tx,Ex,Ax={name:"css",register:Ky,targetTest:function(e){return e.style&&e.nodeType},init:function(e,t,n,i,r){var s,o,a,l,c,h,u,d,p,f,m,g,v,y,x,_,b,w,M,S=this._props,T=e.style;for(u in xy||Ky(),t)if("autoRound"!==u&&(o=t[u],!gg[u]||!qv(u,t,n,i,e,r)))if(c=typeof o,h=hx[u],"function"===c&&(c=typeof(o=o.call(n,i,e,r))),"string"===c&&~o.indexOf("random(")&&(o=pv(o)),h)h(this,e,u,o,n)&&(x=1);else if("--"===u.substr(0,2))this.add(T,"setProperty",getComputedStyle(e).getPropertyValue(u)+"",o+"",i,r,0,0,u);else if("undefined"!==c){if(s=ox(e,u),l=parseFloat(s),(f="string"===c&&"="===o.charAt(1)?+(o.charAt(0)+"1"):0)&&(o=o.substr(2)),a=parseFloat(o),u in Ny&&("autoAlpha"===u&&(1===l&&"hidden"===ox(e,"visibility")&&a&&(l=0),ix(this,T,"visibility",l?"inherit":"hidden",a?"inherit":"hidden",!a)),"scale"!==u&&"transform"!==u&&~(u=Ny[u]).indexOf(",")&&(u=u.split(",")[0])),m=u in Ty)if(g||((v=e._gsap).renderTransform||vx(e),y=!1!==t.smoothOrigin&&v.smooth,(g=this._pt=new uy(this._pt,T,Wy,0,1,v.renderTransform,v,0,-1)).dep=1),"scale"===u)this._pt=new uy(this._pt,v,"scaleY",v.scaleY,f?f*a:a-v.scaleY),S.push("scaleY",u),u+="X";else{if("transformOrigin"===u){b=void 0,w=void 0,M=void 0,b=(_=o).split(" "),w=b[0],M=b[1]||"50%","top"!==w&&"bottom"!==w&&"left"!==M&&"right"!==M||(_=w,w=M,M=_),b[0]=lx[w]||w,b[1]=lx[M]||M,o=b.join(" "),v.svg?gx(e,o,0,y,0,this):((p=parseFloat(o.split(" ")[2])||0)!==v.zOrigin&&ix(this,v,"zOrigin",v.zOrigin,p),ix(this,T,u,yx(s),yx(o)));continue}if("svgOrigin"===u){gx(e,o,1,y,0,this);continue}if(u in dx){Mx(this,v,u,l,o,f);continue}if("smoothOrigin"===u){ix(this,v,"smooth",v.smooth,o);continue}if("force3D"===u){v[u]=o;continue}if("transform"===u){Sx(this,o,e);continue}}else u in T||(u=Jy(u)||u);if(m||(a||0===a)&&(l||0===l)&&!Py.test(o)&&u in T)a||(a=0),(d=(s+"").substr((l+"").length))!==(p=iv(o)||(u in Om.units?Om.units[u]:d))&&(l=sx(e,u,s,p)),this._pt=new uy(this._pt,m?v:T,u,l,f?f*a:a-l,"px"!==p||!1===t.autoRound||m?Dy:zy),this._pt.u=p||0,d!==p&&(this._pt.b=s,this._pt.r=Oy);else if(u in T)ax.call(this,e,u,s,o);else{if(!(u in e)){cg(u,o);continue}this.add(e,u,e[u],o,i,r)}S.push(u)}x&&hy(this)},get:ox,aliases:Ny,getSetter:function(e,t,n){var i=Ny[t];return i&&i.indexOf(",")<0&&(t=i),t in Ty&&t!==qy&&(e._gsap.x||ox(e,"x"))?n&&wy===n?"scale"===t?Hy:ky:(wy=n||{})&&("scale"===t?Vy:jy):e.style&&!Xm(e.style[t])?Fy:~t.indexOf("-")?Gy:ny(e,t)},core:{_removeProperty:nx,_getMatrix:mx}};my.utils.checkPrefix=Jy,Ex=Sg("x,y,z,scale,scaleX,scaleY,xPercent,yPercent,"+(Tx="rotation,rotationX,rotationY,skewX,skewY")+",transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective",(function(e){Ty[e]=1})),Sg(Tx,(function(e){Om.units[e]="deg",dx[e]=1})),Ny[Ex[13]]="x,y,z,scale,scaleX,scaleY,xPercent,yPercent,"+Tx,Sg("0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY",(function(e){var t=e.split(":");Ny[t[1]]=Ex[t[0]]})),Sg("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",(function(e){Om.units[e]="px"})),my.registerPlugin(Ax);var Cx=my.registerPlugin(Ax)||my;Cx.core.Tween;class Lx{constructor(e){Object.entries(e).forEach(([e,t])=>{this[e]=t}),this.o3d=new Yr,this.uProgress={value:0},this.uvScale=new Fi,this.initMaterial(),this.initPlane()}initMaterial(){this.material=new _s({side:2,transparent:!0,map:this.texture,onBeforeCompile:e=>{e.uniforms.progress=this.uProgress,e.uniforms.uvScale={value:this.uvScale},e.vertexShader="\n uniform float progress;\n uniform vec2 uvScale;\n\n attribute vec3 offset;\n attribute vec3 rotation;\n attribute vec2 uvOffset;\n\n mat3 rotationMatrixXYZ(vec3 r)\n {\n float cx = cos(r.x);\n float sx = sin(r.x);\n float cy = cos(r.y);\n float sy = sin(r.y);\n float cz = cos(r.z);\n float sz = sin(r.z);\n\n return mat3(\n cy * cz, cx * sz + sx * sy * cz, sx * sz - cx * sy * cz,\n -cy * sz, cx * cz - sx * sy * sz, sx * cz + cx * sy * sz,\n sy, -sx * cy, cx * cy\n );\n }\n "+e.vertexShader,e.vertexShader=e.vertexShader.replace("#include ","\n #include \n vUv = vUv * uvScale + uvOffset;\n "),e.vertexShader=e.vertexShader.replace("#include ","\n mat3 rotMat = rotationMatrixXYZ(progress * rotation);\n transformed = rotMat * transformed;\n\n vec4 mvPosition = vec4(transformed, 1.0);\n #ifdef USE_INSTANCING\n mvPosition = instanceMatrix * mvPosition;\n #endif\n\n mvPosition.xyz += progress * offset;\n\n mvPosition = modelViewMatrix * mvPosition;\n gl_Position = projectionMatrix * mvPosition;\n ")}})}initPlane(){const{width:e,wWidth:t,wHeight:n}=this.screen;this.wSize=this.size*t/e,this.nx=Math.ceil(t/this.wSize)+1,this.ny=Math.ceil(n/this.wSize)+1,this.icount=this.nx*this.ny,this.initGeometry(),this.initUV(),this.initAnimAttributes(),this.imesh&&this.o3d.remove(this.imesh),this.imesh=new vc(this.bGeometry,this.material,this.icount),this.o3d.add(this.imesh);const i=new Yr;let r=0,s=-(t-(t-this.nx*this.wSize))/2+this.dx;for(let e=0;et?this.uvScale.set(1/this.nx,t/e/this.ny):this.uvScale.set(e/t/this.nx,1/this.ny);const n=this.uvScale.x*this.nx,i=this.uvScale.y*this.ny,r=new Fi,s=new Float32Array(2*this.icount);for(let e=0;e({wheel:!0,click:!0,keyup:!0})}},setup(){const{textures:e,loadTextures:t}=function(){const e=new Mu,t=[],n=(n,i)=>new Promise(r=>{e.load(n.src,e=>{t[i]=e,r(e)})});return{textures:t,loadTextures:(e,i)=>{t.splice(0),Promise.all(e.map(n)).then(i)}}}();return{textures:e,loadTextures:t,progress:0,targetProgress:0}},mounted(){this.three=this.$refs.renderer.three,this.images.length<2?console.error("This slider needs at least 2 images."):this.loadTextures(this.images,this.init)},unmounted(){document.removeEventListener("click",this.onClick),document.removeEventListener("keyup",this.onKeyup),window.removeEventListener("wheel",this.onWheel)},methods:{init(){this.initScene(),Cx.fromTo(this.plane1.uProgress,{value:-2},{value:0,duration:2.5,ease:Sy.easeOut}),this.events.click&&document.addEventListener("click",this.onClick),this.events.keyup&&document.addEventListener("keyup",this.onKeyup),this.events.wheel&&window.addEventListener("wheel",this.onWheel),this.three.onBeforeRender(this.updateProgress),this.three.onAfterResize(this.onResize)},initScene(){const e=this.three.renderer,t=this.$refs.scene.scene;this.plane1=new Lx({renderer:e,screen:this.three.size,size:10,anim:1,texture:this.textures[0]}),this.plane2=new Lx({renderer:e,screen:this.three.size,size:10,anim:2,texture:this.textures[1]}),this.setPlanesProgress(0),this.planes=new Yr,this.planes.add(this.plane1.o3d),this.planes.add(this.plane2.o3d),t.add(this.planes)},onResize(){this.plane1.resize(),this.plane2.resize()},onWheel(e){e.deltaY>0?this.targetProgress=fp(this.targetProgress+.05,0,this.images.length-1):this.targetProgress=fp(this.targetProgress-.05,0,this.images.length-1)},onClick(e){e.clientY0&&i[jt(o,{ref:"camera",position:{z:150}},null,512),jt(a,{ref:"scene"},null,512)]),_:1},512)},Rx.__file="src/components/sliders/Slider1.vue";var Px=function(){function e(e){mu.call(this,e),this.dracoLoader=null,this.ddsLoader=null,this.ktx2Loader=null,this.pluginCallbacks=[],this.register((function(e){return new o(e)})),this.register((function(e){return new l(e)})),this.register((function(e){return new a(e)}))}function t(){var e={};return{get:function(t){return e[t]},add:function(t,n){e[t]=n},remove:function(t){delete e[t]},removeAll:function(){e={}}}}e.prototype=Object.assign(Object.create(mu.prototype),{constructor:e,load:function(e,t,n,i){var r,s=this;r=""!==this.resourcePath?this.resourcePath:""!==this.path?this.path:cd(e),s.manager.itemStart(e);var o=function(t){i?i(t):console.error(t),s.manager.itemError(e),s.manager.itemEnd(e)},a=new vu(s.manager);a.setPath(this.path),a.setResponseType("arraybuffer"),a.setRequestHeader(this.requestHeader),"use-credentials"===s.crossOrigin&&a.setWithCredentials(!0),a.load(e,(function(n){try{s.parse(n,r,(function(n){t(n),s.manager.itemEnd(e)}),o)}catch(e){o(e)}}),n,o)},setDRACOLoader:function(e){return this.dracoLoader=e,this},setDDSLoader:function(e){return this.ddsLoader=e,this},setKTX2Loader:function(e){return this.ktx2Loader=e,this},register:function(e){return-1===this.pluginCallbacks.indexOf(e)&&this.pluginCallbacks.push(e),this},unregister:function(e){return-1!==this.pluginCallbacks.indexOf(e)&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this},parse:function(e,t,o,a){var l,h={},u={};if("string"==typeof e)l=e;else if(ld(new Uint8Array(e,0,4))===c){try{h[n.KHR_BINARY_GLTF]=new d(e)}catch(e){return void(a&&a(e))}l=h[n.KHR_BINARY_GLTF].content}else l=ld(new Uint8Array(e));var m=JSON.parse(l);if(void 0===m.asset||m.asset.version[0]<2)a&&a(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));else{var y=new k(m,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,manager:this.manager,ktx2Loader:this.ktx2Loader});y.fileLoader.setRequestHeader(this.requestHeader);for(var x=0;x=0&&void 0===u[b]&&console.warn('THREE.GLTFLoader: Unknown extension "'+b+'".')}}y.setExtensions(h),y.setPlugins(u),y.parse(o,a)}}});var n={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:"KHR_materials_pbrSpecularGlossiness",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",MSFT_TEXTURE_DDS:"MSFT_texture_dds"};function i(e){if(!e)throw new Error("THREE.GLTFLoader: Attempting to load .dds texture without importing DDSLoader");this.name=n.MSFT_TEXTURE_DDS,this.ddsLoader=e}function r(e){this.name=n.KHR_LIGHTS_PUNCTUAL;var t=e.extensions&&e.extensions[n.KHR_LIGHTS_PUNCTUAL]||{};this.lightDefs=t.lights||[]}function s(){this.name=n.KHR_MATERIALS_UNLIT}function o(e){this.parser=e,this.name=n.KHR_MATERIALS_CLEARCOAT}function a(e){this.parser=e,this.name=n.KHR_MATERIALS_TRANSMISSION}function l(e){this.parser=e,this.name=n.KHR_TEXTURE_BASISU}r.prototype.loadLight=function(e){var t,n=this.lightDefs[e],i=new gs(16777215);void 0!==n.color&&i.fromArray(n.color);var r=void 0!==n.range?n.range:0;switch(n.type){case"directional":(t=new nd(i)).target.position.set(0,0,-1),t.add(t.target);break;case"point":(t=new $u(i)).distance=r;break;case"spot":(t=new Ku(i)).distance=r,n.spot=n.spot||{},n.spot.innerConeAngle=void 0!==n.spot.innerConeAngle?n.spot.innerConeAngle:0,n.spot.outerConeAngle=void 0!==n.spot.outerConeAngle?n.spot.outerConeAngle:Math.PI/4,t.angle=n.spot.outerConeAngle,t.penumbra=1-n.spot.innerConeAngle/n.spot.outerConeAngle,t.target.position.set(0,0,-1),t.add(t.target);break;default:throw new Error('THREE.GLTFLoader: Unexpected light type, "'+n.type+'".')}return t.position.set(0,0,0),t.decay=2,void 0!==n.intensity&&(t.intensity=n.intensity),t.name=n.name||"light_"+e,Promise.resolve(t)},s.prototype.getMaterialType=function(){return _s},s.prototype.extendParams=function(e,t,n){var i=[];e.color=new gs(1,1,1),e.opacity=1;var r=t.pbrMetallicRoughness;if(r){if(Array.isArray(r.baseColorFactor)){var s=r.baseColorFactor;e.color.fromArray(s),e.opacity=s[3]}void 0!==r.baseColorTexture&&i.push(n.assignTexture(e,"map",r.baseColorTexture))}return Promise.all(i)},o.prototype.getMaterialType=function(e){var t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?Vh:null},o.prototype.extendMaterialParams=function(e,t){var n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();var r=[],s=i.extensions[this.name];if(void 0!==s.clearcoatFactor&&(t.clearcoat=s.clearcoatFactor),void 0!==s.clearcoatTexture&&r.push(n.assignTexture(t,"clearcoatMap",s.clearcoatTexture)),void 0!==s.clearcoatRoughnessFactor&&(t.clearcoatRoughness=s.clearcoatRoughnessFactor),void 0!==s.clearcoatRoughnessTexture&&r.push(n.assignTexture(t,"clearcoatRoughnessMap",s.clearcoatRoughnessTexture)),void 0!==s.clearcoatNormalTexture&&(r.push(n.assignTexture(t,"clearcoatNormalMap",s.clearcoatNormalTexture)),void 0!==s.clearcoatNormalTexture.scale)){var o=s.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new Fi(o,o)}return Promise.all(r)},a.prototype.getMaterialType=function(e){var t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?Vh:null},a.prototype.extendMaterialParams=function(e,t){var n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();var r=[],s=i.extensions[this.name];return void 0!==s.transmissionFactor&&(t.transmission=s.transmissionFactor),void 0!==s.transmissionTexture&&r.push(n.assignTexture(t,"transmissionMap",s.transmissionTexture)),Promise.all(r)},l.prototype.loadTexture=function(e){var t=this.parser,n=t.json,i=n.textures[e];if(!i.extensions||!i.extensions[this.name])return null;var r=i.extensions[this.name],s=n.images[r.source],o=t.options.ktx2Loader;if(!o)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return t.loadTextureImage(e,s,o)};var c="glTF",h=1313821514,u=5130562;function d(e){this.name=n.KHR_BINARY_GLTF,this.content=null,this.body=null;var t=new DataView(e,0,12);if(this.header={magic:ld(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==c)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");for(var i=new DataView(e,12),r=0;r",t),e.fragmentShader=e.fragmentShader.replace("#include ",n),e.fragmentShader=e.fragmentShader.replace("#include ",i),e.fragmentShader=e.fragmentShader.replace("#include ",r),e.fragmentShader=e.fragmentShader.replace("#include ",s)},Object.defineProperties(this,{specular:{get:function(){return o.specular.value},set:function(e){o.specular.value=e}},specularMap:{get:function(){return o.specularMap.value},set:function(e){o.specularMap.value=e}},glossiness:{get:function(){return o.glossiness.value},set:function(e){o.glossiness.value=e}},glossinessMap:{get:function(){return o.glossinessMap.value},set:function(e){o.glossinessMap.value=e,e?(this.defines.USE_GLOSSINESSMAP="",this.defines.USE_ROUGHNESSMAP=""):(delete this.defines.USE_ROUGHNESSMAP,delete this.defines.USE_GLOSSINESSMAP)}}}),delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this.setValues(e)}function g(){return{name:n.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS,specularGlossinessParams:["color","map","lightMap","lightMapIntensity","aoMap","aoMapIntensity","emissive","emissiveIntensity","emissiveMap","bumpMap","bumpScale","normalMap","normalMapType","displacementMap","displacementScale","displacementBias","specularMap","specular","glossinessMap","glossiness","alphaMap","envMap","envMapIntensity","refractionRatio"],getMaterialType:function(){return m},extendParams:function(e,t,n){var i=t.extensions[this.name];e.color=new gs(1,1,1),e.opacity=1;var r=[];if(Array.isArray(i.diffuseFactor)){var s=i.diffuseFactor;e.color.fromArray(s),e.opacity=s[3]}if(void 0!==i.diffuseTexture&&r.push(n.assignTexture(e,"map",i.diffuseTexture)),e.emissive=new gs(0,0,0),e.glossiness=void 0!==i.glossinessFactor?i.glossinessFactor:1,e.specular=new gs(1,1,1),Array.isArray(i.specularFactor)&&e.specular.fromArray(i.specularFactor),void 0!==i.specularGlossinessTexture){var o=i.specularGlossinessTexture;r.push(n.assignTexture(e,"glossinessMap",o)),r.push(n.assignTexture(e,"specularMap",o))}return Promise.all(r)},createMaterial:function(e){var t=new m(e);return t.fog=!0,t.color=e.color,t.map=void 0===e.map?null:e.map,t.lightMap=null,t.lightMapIntensity=1,t.aoMap=void 0===e.aoMap?null:e.aoMap,t.aoMapIntensity=1,t.emissive=e.emissive,t.emissiveIntensity=1,t.emissiveMap=void 0===e.emissiveMap?null:e.emissiveMap,t.bumpMap=void 0===e.bumpMap?null:e.bumpMap,t.bumpScale=1,t.normalMap=void 0===e.normalMap?null:e.normalMap,t.normalMapType=0,e.normalScale&&(t.normalScale=e.normalScale),t.displacementMap=null,t.displacementScale=1,t.displacementBias=0,t.specularMap=void 0===e.specularMap?null:e.specularMap,t.specular=e.specular,t.glossinessMap=void 0===e.glossinessMap?null:e.glossinessMap,t.glossiness=e.glossiness,t.alphaMap=null,t.envMap=void 0===e.envMap?null:e.envMap,t.envMapIntensity=1,t.refractionRatio=.98,t}}}function v(){this.name=n.KHR_MESH_QUANTIZATION}function y(e,t,n,i){Qh.call(this,e,t,n,i)}p.prototype.decodePrimitive=function(e,t){var n=this.json,i=this.dracoLoader,r=e.extensions[this.name].bufferView,s=e.extensions[this.name].attributes,o={},a={},l={};for(var c in s){var h=R[c]||c.toLowerCase();o[h]=s[c]}for(c in e.attributes){h=R[c]||c.toLowerCase();if(void 0!==s[c]){var u=n.accessors[e.attributes[c]],d=E[u.componentType];l[h]=d,a[h]=!0===u.normalized}}return t.getDependency("bufferView",r).then((function(e){return new Promise((function(t){i.decodeDracoFile(e,(function(e){for(var n in e.attributes){var i=e.attributes[n],r=a[n];void 0!==r&&(i.normalized=r)}t(e)}),o,l)}))}))},f.prototype.extendTexture=function(e,t){return e=e.clone(),void 0!==t.offset&&e.offset.fromArray(t.offset),void 0!==t.rotation&&(e.rotation=t.rotation),void 0!==t.scale&&e.repeat.fromArray(t.scale),void 0!==t.texCoord&&console.warn('THREE.GLTFLoader: Custom UV sets in "'+this.name+'" extension not yet supported.'),e.needsUpdate=!0,e},m.prototype=Object.create(Hh.prototype),m.prototype.constructor=m,m.prototype.copy=function(e){return Hh.prototype.copy.call(this,e),this.specularMap=e.specularMap,this.specular.copy(e.specular),this.glossinessMap=e.glossinessMap,this.glossiness=e.glossiness,delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this},y.prototype=Object.create(Qh.prototype),y.prototype.constructor=y,y.prototype.copySampleValue_=function(e){for(var t=this.resultBuffer,n=this.sampleValues,i=this.valueSize,r=e*i*3+i,s=0;s!==i;s++)t[s]=n[r+s];return t},y.prototype.beforeStart_=y.prototype.copySampleValue_,y.prototype.afterEnd_=y.prototype.copySampleValue_,y.prototype.interpolate_=function(e,t,n,i){for(var r=this.resultBuffer,s=this.sampleValues,o=this.valueSize,a=2*o,l=3*o,c=i-t,h=(n-t)/c,u=h*h,d=u*h,p=e*l,f=p-l,m=-2*d+3*u,g=d-u,v=1-m,y=g-u+h,x=0;x!==o;x++){var _=s[f+x+o],b=s[f+x+a]*c,w=s[p+x+o],M=s[p+x]*c;r[x]=v*_+y*b+m*w+g*M}return r};var x=0,_=1,b=2,w=3,M=4,S=5,T=6,E={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},A={9728:1003,9729:1006,9984:1004,9985:1007,9986:1005,9987:1008},C={33071:1001,33648:1002,10497:1e3},L={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},R={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},P={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},N={CUBICSPLINE:void 0,LINEAR:2301,STEP:2300},D="OPAQUE",I="MASK",O="BLEND";function z(e,t){return"string"!=typeof e||""===e?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}function U(e,t,n){for(var i in n.extensions)void 0===e[i]&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[i]=n.extensions[i])}function B(e,t){void 0!==t.extras&&("object"==typeof t.extras?Object.assign(e.userData,t.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+t.extras))}function F(e,t){if(e.updateMorphTargets(),void 0!==t.weights)for(var n=0,i=t.weights.length;n=2&&r.setY(S,b[w*o+1]),o>=3&&r.setZ(S,b[w*o+2]),o>=4&&r.setW(S,b[w*o+3]),o>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return r}))},k.prototype.loadTexture=function(e){var t,i,r=this.json,s=this.options,o=r.textures[e],a=o.extensions||{};return(t=a[n.MSFT_TEXTURE_DDS]?r.images[a[n.MSFT_TEXTURE_DDS].source]:r.images[o.source]).uri&&(i=s.manager.getHandler(t.uri)),i||(i=a[n.MSFT_TEXTURE_DDS]?this.extensions[n.MSFT_TEXTURE_DDS].ddsLoader:this.textureLoader),this.loadTextureImage(e,t,i)},k.prototype.loadTextureImage=function(e,t,n){var i=this,r=this.json,s=this.options,o=r.textures[e],a=self.URL||self.webkitURL,l=t.uri,c=!1,h=!0;return"image/jpeg"===t.mimeType&&(h=!1),void 0!==t.bufferView&&(l=i.getDependency("bufferView",t.bufferView).then((function(e){"image/png"===t.mimeType&&(h=6===new DataView(e,25,1).getUint8(0,!1)),c=!0;var n=new Blob([e],{type:t.mimeType});return l=a.createObjectURL(n)}))),Promise.resolve(l).then((function(e){return new Promise((function(t,i){var r=t;!0===n.isImageBitmapLoader&&(r=function(e){t(new Bc(e))}),n.load(z(e,s.path),r,void 0,i)}))})).then((function(t){!0===c&&a.revokeObjectURL(l),t.flipY=!1,o.name&&(t.name=o.name),h||(t.format=1022);var n=(r.samplers||{})[o.sampler]||{};return t.magFilter=A[n.magFilter]||1006,t.minFilter=A[n.minFilter]||1008,t.wrapS=C[n.wrapS]||1e3,t.wrapT=C[n.wrapT]||1e3,i.associations.set(t,{type:"textures",index:e}),t}))},k.prototype.assignTexture=function(e,t,i){var r=this;return this.getDependency("texture",i.index).then((function(s){if(void 0===i.texCoord||0==i.texCoord||"aoMap"===t&&1==i.texCoord||console.warn("THREE.GLTFLoader: Custom UV set "+i.texCoord+" for texture "+t+" not yet supported."),r.extensions[n.KHR_TEXTURE_TRANSFORM]){var o=void 0!==i.extensions?i.extensions[n.KHR_TEXTURE_TRANSFORM]:void 0;if(o){var a=r.associations.get(s);s=r.extensions[n.KHR_TEXTURE_TRANSFORM].extendTexture(s,o),r.associations.set(s,a)}}e[t]=s}))},k.prototype.assignFinalMaterial=function(e){var t=e.geometry,n=e.material,i=void 0!==t.attributes.tangent,r=void 0!==t.attributes.color,s=void 0===t.attributes.normal,o=!0===e.isSkinnedMesh,a=Object.keys(t.morphAttributes).length>0,l=a&&void 0!==t.morphAttributes.normal;if(e.isPoints){var c="PointsMaterial:"+n.uuid,h=this.cache.get(c);h||(h=new Lc,xs.prototype.copy.call(h,n),h.color.copy(n.color),h.map=n.map,h.sizeAttenuation=!1,this.cache.add(c,h)),n=h}else if(e.isLine){c="LineBasicMaterial:"+n.uuid;var u=this.cache.get(c);u||(u=new yc,xs.prototype.copy.call(u,n),u.color.copy(n.color),this.cache.add(c,u)),n=u}if(i||r||s||o||a){c="ClonedMaterial:"+n.uuid+":";n.isGLTFSpecularGlossinessMaterial&&(c+="specular-glossiness:"),o&&(c+="skinning:"),i&&(c+="vertex-tangents:"),r&&(c+="vertex-colors:"),s&&(c+="flat-shading:"),a&&(c+="morph-targets:"),l&&(c+="morph-normals:");var d=this.cache.get(c);d||(d=n.clone(),o&&(d.skinning=!0),i&&(d.vertexTangents=!0),r&&(d.vertexColors=!0),s&&(d.flatShading=!0),a&&(d.morphTargets=!0),l&&(d.morphNormals=!0),this.cache.add(c,d),this.associations.set(d,this.associations.get(n))),n=d}n.aoMap&&void 0===t.attributes.uv2&&void 0!==t.attributes.uv&&t.setAttribute("uv2",t.attributes.uv),n.normalScale&&!i&&(n.normalScale.y=-n.normalScale.y),n.clearcoatNormalScale&&!i&&(n.clearcoatNormalScale.y=-n.clearcoatNormalScale.y),e.material=n},k.prototype.getMaterialType=function(){return Hh},k.prototype.loadMaterial=function(e){var t,i=this,r=this.json,s=this.extensions,o=r.materials[e],a={},l=o.extensions||{},c=[];if(l[n.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){var h=s[n.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];t=h.getMaterialType(),c.push(h.extendParams(a,o,i))}else if(l[n.KHR_MATERIALS_UNLIT]){var u=s[n.KHR_MATERIALS_UNLIT];t=u.getMaterialType(),c.push(u.extendParams(a,o,i))}else{var d=o.pbrMetallicRoughness||{};if(a.color=new gs(1,1,1),a.opacity=1,Array.isArray(d.baseColorFactor)){var p=d.baseColorFactor;a.color.fromArray(p),a.opacity=p[3]}void 0!==d.baseColorTexture&&c.push(i.assignTexture(a,"map",d.baseColorTexture)),a.metalness=void 0!==d.metallicFactor?d.metallicFactor:1,a.roughness=void 0!==d.roughnessFactor?d.roughnessFactor:1,void 0!==d.metallicRoughnessTexture&&(c.push(i.assignTexture(a,"metalnessMap",d.metallicRoughnessTexture)),c.push(i.assignTexture(a,"roughnessMap",d.metallicRoughnessTexture))),t=this._invokeOne((function(t){return t.getMaterialType&&t.getMaterialType(e)})),c.push(this._invokeAll((function(t){return t.extendMaterialParams&&t.extendMaterialParams(e,a)})))}!0===o.doubleSided&&(a.side=2);var f=o.alphaMode||D;return f===O?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,f===I&&(a.alphaTest=void 0!==o.alphaCutoff?o.alphaCutoff:.5)),void 0!==o.normalTexture&&t!==_s&&(c.push(i.assignTexture(a,"normalMap",o.normalTexture)),a.normalScale=new Fi(1,1),void 0!==o.normalTexture.scale&&a.normalScale.set(o.normalTexture.scale,o.normalTexture.scale)),void 0!==o.occlusionTexture&&t!==_s&&(c.push(i.assignTexture(a,"aoMap",o.occlusionTexture)),void 0!==o.occlusionTexture.strength&&(a.aoMapIntensity=o.occlusionTexture.strength)),void 0!==o.emissiveFactor&&t!==_s&&(a.emissive=(new gs).fromArray(o.emissiveFactor)),void 0!==o.emissiveTexture&&t!==_s&&c.push(i.assignTexture(a,"emissiveMap",o.emissiveTexture)),Promise.all(c).then((function(){var r;return r=t===m?s[n.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(a):new t(a),o.name&&(r.name=o.name),r.map&&(r.map.encoding=3001),r.emissiveMap&&(r.emissiveMap.encoding=3001),B(r,o),i.associations.set(r,{type:"materials",index:e}),o.extensions&&U(s,r,o),r}))},k.prototype.loadGeometries=function(e){var t=this,i=this.extensions,r=this.primitiveCache;function s(e){return i[n.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(e,t).then((function(n){return H(n,e,t)}))}for(var o,a,l=[],c=0,h=e.length;c0&&F(h,i),h.name=i.name||"mesh_"+e,o.length>1&&(h.name+="_"+l),B(h,i),n.assignFinalMaterial(h),a.push(h)}if(1===a.length)return a[0];var f=new Pl;for(l=0,c=a.length;l1?new Pl:1===t.length?t[0]:new Yr)!==t[0])for(var o=0,a=t.length;o{this.renderer.three.scene.add(e.scene)})}};Nx.render=function(e,t,n,i,r,s){const o=At("Camera"),a=At("Scene"),l=At("Renderer");return Ut(),Ft(l,{ref:"renderer","orbit-ctrl":{enableDamping:!0,dampingFactor:.05}},{default:Et(()=>[jt(o,{ref:"camera",position:n.cameraPosition},null,8,["position"]),jt(a,null,{default:Et(()=>[Tt(e.$slots,"default")]),_:3})]),_:1},512)},Nx.__file="src/components/viewers/GLTFViewer.vue";var Dx=Object.freeze({__proto__:null,Renderer:hp,PerspectiveCamera:gp,Camera:gp,Scene:vp,BoxGeometry:xp,CircleGeometry:_p,ConeGeometry:bp,CylinderGeometry:wp,DodecahedronGeometry:Mp,IcosahedronGeometry:Sp,LatheGeometry:Tp,OctahedronGeometry:Ep,PolyhedronGeometry:Ap,RingGeometry:Cp,SphereGeometry:Lp,TetrahedronGeometry:Rp,TorusGeometry:Pp,TorusKnotGeometry:Np,TubeGeometry:Dp,AmbientLight:Op,DirectionalLight:zp,PointLight:Up,SpotLight:Bp,BasicMaterial:Gp,LambertMaterial:kp,PhongMaterial:Hp,PhysicalMaterial:jp,StandardMaterial:Vp,SubSurfaceMaterial:ef,Mesh:tf,Box:nf,Circle:rf,Cone:sf,Cylinder:of,Dodecahedron:af,Icosahedron:lf,Lathe:cf,Octahedron:hf,Plane:uf,Polyhedron:df,Ring:pf,Sphere:ff,Tetrahedron:mf,Text:gf,Torus:vf,TorusKnot:yf,Tube:xf,Gem:_f,Image:bf,InstancedMesh:wf,MirrorMesh:Mf,RefractionMesh:Sf,Sprite:Tf,EffectComposer:Df,RenderPass:zf,BokehPass:Ff,FilmPass:Hf,HalftonePass:Wf,SAOPass:Kf,UnrealBloomPass:em,NoisyImage:nm,NoisyPlane:im,NoisySphere:rm,NoisyText:sm,Slider1:Rx,GLTFViewer:Nx,setFromProp:up,propsValues:dp,lerp:pp,lerpv3:function(e,t,n){e.x=pp(e.x,t.x,n),e.y=pp(e.y,t.y,n),e.z=pp(e.z,t.z,n)},limit:fp});const Ix={install:e=>{["Camera","PerspectiveCamera","Renderer","Scene","BoxGeometry","CircleGeometry","ConeGeometry","CylinderGeometry","DodecahedronGeometry","IcosahedronGeometry","LatheGeometry","OctahedronGeometry","PolyhedronGeometry","RingGeometry","SphereGeometry","TetrahedronGeometry","TorusGeometry","TorusKnotGeometry","TubeGeometry","AmbientLight","DirectionalLight","PointLight","SpotLight","BasicMaterial","LambertMaterial","PhongMaterial","PhysicalMaterial","ShaderMaterial","StandardMaterial","SubSurfaceMaterial","Box","Circle","Cone","Cylinder","Dodecahedron","Icosahedron","Mesh","Lathe","Octahedron","Plane","Polyhedron","Ring","Sphere","Tetrahedron","Text","Torus","TorusKnot","Tube","Gem","Image","InstancedMesh","MirrorMesh","RefractionMesh","Sprite","BokehPass","EffectComposer","FilmPass","HalftonePass","RenderPass","SAOPass","UnrealBloomPass","GLTFViewer"].forEach(t=>{e.component(t,Dx[t])})}};var Ox={components:{NoisyPlane:im,NoisySphere:rm,NoisyText:sm},mounted(){const e=this.$refs.renderer,t=this.$refs.light1.light,n=this.$refs.light2.light,i=this.$refs.light3.light,r=this.$refs.light4.light,s=this.$refs.mesh1.mesh,o=this.$refs.mesh2.mesh,a=this.$refs.mesh3.mesh,l=this.$refs.mesh3.meshBack;e.onBeforeRender(()=>{const e=.001*Date.now(),c=100;t.position.x=Math.sin(.1*e)*c,t.position.y=Math.cos(.2*e)*c,n.position.x=Math.cos(.3*e)*c,n.position.y=Math.sin(.4*e)*c,i.position.x=Math.sin(.5*e)*c,i.position.y=Math.sin(.6*e)*c,r.position.x=Math.sin(.7*e)*c,r.position.y=Math.cos(.8*e)*c,s.rotation.x+=.015,s.rotation.y+=.008,o.rotation.x+=.02,o.rotation.y+=.01,a.rotation.x+=.007,a.rotation.y+=.013,l.rotation.x=a.rotation.x,l.rotation.y=a.rotation.y})}};Ox.render=function(e,t,n,i,r,s){const o=At("Camera"),a=At("PointLight"),l=At("PhysicalMaterial"),c=At("NoisyPlane"),h=At("DodecahedronGeometry"),u=At("StandardMaterial"),d=At("MirrorMesh"),p=At("TorusGeometry"),f=At("RefractionMesh"),m=At("Gem"),g=At("Scene"),v=At("Renderer");return Ut(),Ft(v,{ref:"renderer","orbit-ctrl":{enableDamping:!0,dampingFactor:.05}},{default:Et(()=>[jt(o,{position:{x:-0,y:-120,z:30}}),jt(g,{background:"#ffffff"},{default:Et(()=>[jt(a,{ref:"light1",color:"#0E09DC",intensity:.85,position:{x:0,y:0,z:50}},null,512),jt(a,{ref:"light2",color:"#1CD1E1",intensity:.85,position:{x:0,y:0,z:50}},null,512),jt(a,{ref:"light3",color:"#18C02C",intensity:.85,position:{x:0,y:0,z:50}},null,512),jt(a,{ref:"light4",color:"#ee3bcf",intensity:.85,position:{x:0,y:0,z:50}},null,512),Xt(' \r\n \r\n '),jt(c,{width:200,"width-segments":200,height:200,"height-segments":200,"time-coef":3e-4,"noise-coef":.03,"z-coef":7,position:{x:0,y:0,z:0}},{default:Et(()=>[jt(l,{"flat-shading":""})]),_:1}),Xt(' \r\n \r\n '),jt(d,{ref:"mesh1",position:{x:-30,y:-15,z:20},"auto-update":""},{default:Et(()=>[jt(h,{radius:8}),jt(u,{color:"#ffffff",metalness:1,roughness:0})]),_:1},512),jt(f,{ref:"mesh2",position:{x:0,y:-15,z:20},"auto-update":""},{default:Et(()=>[jt(p,{radius:8,tube:3}),jt(u,{color:"#ffffff",metalness:1,roughness:0})]),_:1},512),jt(m,{ref:"mesh3",position:{x:30,y:-15,z:20},"auto-update":""},{default:Et(()=>[jt(h,{radius:8}),jt(u,{color:"#0000ff",metalness:1,roughness:0})]),_:1},512)]),_:1})]),_:1},512)},Ox.__file="src/components/demos/Demo1.vue";var zx={components:{NoisyImage:nm}};zx.render=function(e,t,n,i,r,s){const o=At("Camera"),a=At("NoisyImage"),l=At("Scene"),c=At("Renderer");return Ut(),Ft(c,{ref:"renderer","orbit-ctrl":{enableDamping:!0,dampingFactor:.05}},{default:Et(()=>[jt(o,{position:{x:0,y:0,z:100}}),jt(l,{background:"#000000"},{default:Et(()=>[jt(a,{src:"https://assets.codepen.io/33787/img2.jpg",width:800,"time-coef":.001,"noise-coef":2,"z-coef":5,"disp-coef":.015,rotation:{x:-Math.PI/6}})]),_:1})]),_:1},512)},zx.__file="src/components/demos/Demo2.vue";const{randFloat:Ux,randFloatSpread:Bx}=Bi;var Fx={setup(){const e=[],t=new Zi,n=new Yr,i=new Zi;for(let t=0;t<2e3;t++)e.push({position:new Zi(Bx(200),Bx(200),Bx(200)),scale:Ux(.2,1),scaleZ:Ux(.1,1),velocity:new Zi(Bx(2),Bx(2),Bx(2)),attraction:.03+Ux(-.01,.01),vlimit:1.2+Ux(-.1,.1)});return{NUM_INSTANCES:2e3,instances:e,target:t,dummyO:n,dummyV:i}},mounted(){this.renderer=this.$refs.renderer,this.imesh=this.$refs.imesh.mesh,this.light=this.$refs.light.light,this.init()},methods:{init(){for(let e=0;e[jt(o,{position:{z:200}}),jt(f,null,{default:Et(()=>[jt(a,{color:"#808080"}),jt(l,{color:"#ff6000"}),jt(l,{ref:"light",color:"#0060ff",intensity:.5},null,512),jt(u,{ref:"imesh","material-id":"material",count:i.NUM_INSTANCES},{default:Et(()=>[jt(c,{width:2,height:2,depth:10}),jt(h,{transparent:!0,opacity:.9,metalness:.8,roughness:.5})]),_:1},8,["count"]),jt(p,{text:"TroisJS","font-src":"helvetiker_regular.typeface.json","material-id":"material1",align:"center",size:30,height:5,position:{x:0,y:0,z:0},"cast-shadow":!0},{default:Et(()=>[jt(d)]),_:1})]),_:1}),jt(y,null,{default:Et(()=>[jt(m),jt(g,{strength:1}),jt(v,{radius:1,scatter:0})]),_:1})]),_:1},512)},Fx.__file="src/components/demos/Demo3.vue";var Gx={setup:()=>({NUM_INSTANCES:2e3}),mounted(){const e=this.$refs.imesh.mesh,t=new Yr,{randFloat:n,randFloatSpread:i}=Bi;for(let r=0;r[jt(o,{position:{z:100}}),jt(u,null,{default:Et(()=>[jt(a,{color:"#ffffff",intensity:.5,position:{y:150,z:0},"cast-shadow":!0,"shadow-map-size":{width:1024,height:1024}}),jt(a,{color:"#ff0000",intensity:.5,position:{y:-150,z:0},"cast-shadow":!0,"shadow-map-size":{width:1024,height:1024}}),jt(h,{ref:"imesh","material-id":"material",count:i.NUM_INSTANCES,"cast-shadow":!0,"receive-shadow":!0},{default:Et(()=>[jt(l,{radius:5}),jt(c)]),_:1},8,["count"])]),_:1}),jt(f,null,{default:Et(()=>[jt(d),jt(p,{strength:2})]),_:1})]),_:1},512)},Gx.__file="src/components/demos/Demo4.vue";var kx={components:{Slider1:Rx},data:()=>({images:[{src:"https://assets.codepen.io/33787/img1.jpg"},{src:"https://assets.codepen.io/33787/img2.jpg"},{src:"https://assets.codepen.io/33787/img3.jpg"},{src:"https://assets.codepen.io/33787/img4.jpg"}]}),mounted(){}};kx.render=function(e,t,n,i,r,s){const o=At("Slider1");return Ut(),Ft(o,{images:r.images},null,8,["images"])},kx.__file="src/components/demos/Slider1.vue";var Hx={};Hx.render=function(e,t,n,i,r,s){const o=At("AmbientLight"),a=At("GLTFViewer");return Ut(),Ft(a,{src:"test.glb","camera-position":{z:1}},{default:Et(()=>[jt(o)]),_:1})},Hx.__file="src/components/demos/DemoGLTF.vue";var Vx={name:"App",components:{Demo1:Ox,Demo2:zx,Demo3:Fx,Demo4:Gx,Slider1:kx,DemoGLTF:Hx},data:()=>({tests:["Demo1","Demo2","Demo3","Demo4","Slider1","DemoGLTF"],test:"Demo1"})};const jx={class:"app"},Wx={class:"navbar"};Vx.render=function(e,t,n,i,r,s){return Ut(),Ft("div",jx,[jt("ul",Wx,[(Ut(!0),Ft(Pt,null,ai(r.tests,e=>{return Ut(),Ft("li",{key:e,onClick:t=>r.test=e},null==(t=e)?"":S(t)?JSON.stringify(t,l,2):String(t),9,["onClick"]);var t}),128))]),(Ut(),Ft((o=r.test,w(o)?Lt("components",o,!1)||o:o||Ct)))]);var o},Vx.__file="src/App.vue";const qx=((...e)=>{const t=(Ai||(Ai=Nn(Ei))).createApp(...e),{mount:n}=t;return t.mount=e=>{const i=function(e){if(w(e)){return document.querySelector(e)}return e}(e);if(!i)return;const r=t._component;b(r)||r.render||r.template||(r.template=i.innerHTML),i.innerHTML="";const s=n(i);return i.removeAttribute("v-cloak"),i.setAttribute("data-v-app",""),s},t})(Vx);qx.use(Ix),qx.mount("#app"); +*/Lg("padding,margin,Width,Radius",(function(e,t){var n="Top",i="Right",r="Bottom",s="Left",o=(t<3?[n,i,r,s]:[n+s,n+i,r+i,r+s]).map((function(n){return t<2?e+n:"border"+n+e}));mx[t>1?"border"+e:e]=function(e,t,n,i,r){var s,a;if(arguments.length<4)return s=o.map((function(t){return ux(e,t,n)})),5===(a=s.join(" ")).split(s[0]).length?s[0]:a;s=(i+"").split(" "),a={},o.forEach((function(e,t){return a[e]=s[t]=s[t]||s[(t-1)/2|0]})),e.init(t,a,r)}}));var Rx,Px,Nx={name:"css",register:nx,targetTest:function(e){return e.style&&e.nodeType},init:function(e,t,n,i,r){var s,o,a,l,c,h,u,d,p,f,m,g,v,y,x,_,b,w,M,S=this._props,T=e.style;for(u in Sy||nx(),t)if("autoRound"!==u&&(o=t[u],!bg[u]||!Kv(u,t,n,i,e,r)))if(c=typeof o,h=mx[u],"function"===c&&(c=typeof(o=o.call(n,i,e,r))),"string"===c&&~o.indexOf("random(")&&(o=yv(o)),h)h(this,e,u,o,n)&&(x=1);else if("--"===u.substr(0,2))this.add(T,"setProperty",getComputedStyle(e).getPropertyValue(u)+"",o+"",i,r,0,0,u);else if("undefined"!==c){if(s=ux(e,u),l=parseFloat(s),(f="string"===c&&"="===o.charAt(1)?+(o.charAt(0)+"1"):0)&&(o=o.substr(2)),a=parseFloat(o),u in Uy&&("autoAlpha"===u&&(1===l&&"hidden"===ux(e,"visibility")&&a&&(l=0),lx(this,T,"visibility",l?"inherit":"hidden",a?"inherit":"hidden",!a)),"scale"!==u&&"transform"!==u&&~(u=Uy[u]).indexOf(",")&&(u=u.split(",")[0])),m=u in Ry)if(g||((v=e._gsap).renderTransform||wx(e),y=!1!==t.smoothOrigin&&v.smooth,(g=this._pt=new gy(this._pt,T,Jy,0,1,v.renderTransform,v,0,-1)).dep=1),"scale"===u)this._pt=new gy(this._pt,v,"scaleY",v.scaleY,f?f*a:a-v.scaleY),S.push("scaleY",u),u+="X";else{if("transformOrigin"===u){b=void 0,w=void 0,M=void 0,b=(_=o).split(" "),w=b[0],M=b[1]||"50%","top"!==w&&"bottom"!==w&&"left"!==M&&"right"!==M||(_=w,w=M,M=_),b[0]=px[w]||w,b[1]=px[M]||M,o=b.join(" "),v.svg?bx(e,o,0,y,0,this):((p=parseFloat(o.split(" ")[2])||0)!==v.zOrigin&&lx(this,v,"zOrigin",v.zOrigin,p),lx(this,T,u,Mx(s),Mx(o)));continue}if("svgOrigin"===u){bx(e,o,1,y,0,this);continue}if(u in vx){Cx(this,v,u,l,o,f);continue}if("smoothOrigin"===u){lx(this,v,"smooth",v.smooth,o);continue}if("force3D"===u){v[u]=o;continue}if("transform"===u){Lx(this,o,e);continue}}else u in T||(u=tx(u)||u);if(m||(a||0===a)&&(l||0===l)&&!zy.test(o)&&u in T)a||(a=0),(d=(s+"").substr((l+"").length))!==(p=lv(o)||(u in Gm.units?Gm.units[u]:d))&&(l=hx(e,u,s,p)),this._pt=new gy(this._pt,m?v:T,u,l,f?f*a:a-l,"px"!==p||!1===t.autoRound||m?By:ky),this._pt.u=p||0,d!==p&&(this._pt.b=s,this._pt.r=Gy);else if(u in T)dx.call(this,e,u,s,o);else{if(!(u in e)){fg(u,o);continue}this.add(e,u,e[u],o,i,r)}S.push(u)}x&&my(this)},get:ux,aliases:Uy,getSetter:function(e,t,n){var i=Uy[t];return i&&i.indexOf(",")<0&&(t=i),t in Ry&&t!==Ky&&(e._gsap.x||ux(e,"x"))?n&&Ay===n?"scale"===t?qy:Xy:(Ay=n||{})&&("scale"===t?Yy:Zy):e.style&&!Qm(e.style[t])?Vy:~t.indexOf("-")?Wy:ay(e,t)},core:{_removeProperty:ax,_getMatrix:_x}};_y.utils.checkPrefix=tx,Px=Lg("x,y,z,scale,scaleX,scaleY,xPercent,yPercent,"+(Rx="rotation,rotationX,rotationY,skewX,skewY")+",transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective",(function(e){Ry[e]=1})),Lg(Rx,(function(e){Gm.units[e]="deg",vx[e]=1})),Uy[Px[13]]="x,y,z,scale,scaleX,scaleY,xPercent,yPercent,"+Rx,Lg("0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY",(function(e){var t=e.split(":");Uy[t[1]]=Px[t[0]]})),Lg("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",(function(e){Gm.units[e]="px"})),_y.registerPlugin(Nx);var Dx=_y.registerPlugin(Nx)||_y;Dx.core.Tween;class Ix{constructor(e){Object.entries(e).forEach(([e,t])=>{this[e]=t}),this.o3d=new Yr,this.uProgress={value:0},this.uvScale=new Fi,this.initMaterial(),this.initPlane()}initMaterial(){this.material=new _s({side:2,transparent:!0,map:this.texture,onBeforeCompile:e=>{e.uniforms.progress=this.uProgress,e.uniforms.uvScale={value:this.uvScale},e.vertexShader="\n uniform float progress;\n uniform vec2 uvScale;\n\n attribute vec3 offset;\n attribute vec3 rotation;\n attribute vec2 uvOffset;\n\n mat3 rotationMatrixXYZ(vec3 r)\n {\n float cx = cos(r.x);\n float sx = sin(r.x);\n float cy = cos(r.y);\n float sy = sin(r.y);\n float cz = cos(r.z);\n float sz = sin(r.z);\n\n return mat3(\n cy * cz, cx * sz + sx * sy * cz, sx * sz - cx * sy * cz,\n -cy * sz, cx * cz - sx * sy * sz, sx * cz + cx * sy * sz,\n sy, -sx * cy, cx * cy\n );\n }\n "+e.vertexShader,e.vertexShader=e.vertexShader.replace("#include ","\n #include \n vUv = vUv * uvScale + uvOffset;\n "),e.vertexShader=e.vertexShader.replace("#include ","\n mat3 rotMat = rotationMatrixXYZ(progress * rotation);\n transformed = rotMat * transformed;\n\n vec4 mvPosition = vec4(transformed, 1.0);\n #ifdef USE_INSTANCING\n mvPosition = instanceMatrix * mvPosition;\n #endif\n\n mvPosition.xyz += progress * offset;\n\n mvPosition = modelViewMatrix * mvPosition;\n gl_Position = projectionMatrix * mvPosition;\n ")}})}initPlane(){const{width:e,wWidth:t,wHeight:n}=this.screen;this.wSize=this.size*t/e,this.nx=Math.ceil(t/this.wSize)+1,this.ny=Math.ceil(n/this.wSize)+1,this.icount=this.nx*this.ny,this.initGeometry(),this.initUV(),this.initAnimAttributes(),this.imesh&&this.o3d.remove(this.imesh),this.imesh=new vc(this.bGeometry,this.material,this.icount),this.o3d.add(this.imesh);const i=new Yr;let r=0,s=-(t-(t-this.nx*this.wSize))/2+this.dx;for(let e=0;et?this.uvScale.set(1/this.nx,t/e/this.ny):this.uvScale.set(e/t/this.nx,1/this.ny);const n=this.uvScale.x*this.nx,i=this.uvScale.y*this.ny,r=new Fi,s=new Float32Array(2*this.icount);for(let e=0;e({wheel:!0,click:!0,keyup:!0})}},setup(){const{textures:e,loadTextures:t}=function(){const e=new Mu,t=[],n=(n,i)=>new Promise(r=>{e.load(n.src,e=>{t[i]=e,r(e)})});return{textures:t,loadTextures:(e,i)=>{t.splice(0),Promise.all(e.map(n)).then(i)}}}();return{textures:e,loadTextures:t,progress:0,targetProgress:0}},mounted(){this.three=this.$refs.renderer.three,this.images.length<2?console.error("This slider needs at least 2 images."):this.loadTextures(this.images,this.init)},unmounted(){document.removeEventListener("click",this.onClick),document.removeEventListener("keyup",this.onKeyup),window.removeEventListener("wheel",this.onWheel)},methods:{init(){this.initScene(),Dx.fromTo(this.plane1.uProgress,{value:-2},{value:0,duration:2.5,ease:Ly.easeOut}),this.events.click&&document.addEventListener("click",this.onClick),this.events.keyup&&document.addEventListener("keyup",this.onKeyup),this.events.wheel&&window.addEventListener("wheel",this.onWheel),this.three.onBeforeRender(this.updateProgress),this.three.onAfterResize(this.onResize)},initScene(){const e=this.three.renderer,t=this.$refs.scene.scene;this.plane1=new Ix({renderer:e,screen:this.three.size,size:10,anim:1,texture:this.textures[0]}),this.plane2=new Ix({renderer:e,screen:this.three.size,size:10,anim:2,texture:this.textures[1]}),this.setPlanesProgress(0),this.planes=new Yr,this.planes.add(this.plane1.o3d),this.planes.add(this.plane2.o3d),t.add(this.planes)},onResize(){this.plane1.resize(),this.plane2.resize()},onWheel(e){e.deltaY>0?this.targetProgress=fp(this.targetProgress+.05,0,this.images.length-1):this.targetProgress=fp(this.targetProgress-.05,0,this.images.length-1)},onClick(e){e.clientY0&&i[Vt(o,{ref:"camera",position:{z:150}},null,512),Vt(a,{ref:"scene"},null,512)]),_:1},512)},Ox.__file="src/components/sliders/Slider1.vue";var zx=function(){function e(e){mu.call(this,e),this.dracoLoader=null,this.ddsLoader=null,this.ktx2Loader=null,this.pluginCallbacks=[],this.register((function(e){return new o(e)})),this.register((function(e){return new l(e)})),this.register((function(e){return new a(e)}))}function t(){var e={};return{get:function(t){return e[t]},add:function(t,n){e[t]=n},remove:function(t){delete e[t]},removeAll:function(){e={}}}}e.prototype=Object.assign(Object.create(mu.prototype),{constructor:e,load:function(e,t,n,i){var r,s=this;r=""!==this.resourcePath?this.resourcePath:""!==this.path?this.path:cd(e),s.manager.itemStart(e);var o=function(t){i?i(t):console.error(t),s.manager.itemError(e),s.manager.itemEnd(e)},a=new vu(s.manager);a.setPath(this.path),a.setResponseType("arraybuffer"),a.setRequestHeader(this.requestHeader),"use-credentials"===s.crossOrigin&&a.setWithCredentials(!0),a.load(e,(function(n){try{s.parse(n,r,(function(n){t(n),s.manager.itemEnd(e)}),o)}catch(e){o(e)}}),n,o)},setDRACOLoader:function(e){return this.dracoLoader=e,this},setDDSLoader:function(e){return this.ddsLoader=e,this},setKTX2Loader:function(e){return this.ktx2Loader=e,this},register:function(e){return-1===this.pluginCallbacks.indexOf(e)&&this.pluginCallbacks.push(e),this},unregister:function(e){return-1!==this.pluginCallbacks.indexOf(e)&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this},parse:function(e,t,o,a){var l,h={},u={};if("string"==typeof e)l=e;else if(ld(new Uint8Array(e,0,4))===c){try{h[n.KHR_BINARY_GLTF]=new d(e)}catch(e){return void(a&&a(e))}l=h[n.KHR_BINARY_GLTF].content}else l=ld(new Uint8Array(e));var m=JSON.parse(l);if(void 0===m.asset||m.asset.version[0]<2)a&&a(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));else{var y=new k(m,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,manager:this.manager,ktx2Loader:this.ktx2Loader});y.fileLoader.setRequestHeader(this.requestHeader);for(var x=0;x=0&&void 0===u[b]&&console.warn('THREE.GLTFLoader: Unknown extension "'+b+'".')}}y.setExtensions(h),y.setPlugins(u),y.parse(o,a)}}});var n={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:"KHR_materials_pbrSpecularGlossiness",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",MSFT_TEXTURE_DDS:"MSFT_texture_dds"};function i(e){if(!e)throw new Error("THREE.GLTFLoader: Attempting to load .dds texture without importing DDSLoader");this.name=n.MSFT_TEXTURE_DDS,this.ddsLoader=e}function r(e){this.name=n.KHR_LIGHTS_PUNCTUAL;var t=e.extensions&&e.extensions[n.KHR_LIGHTS_PUNCTUAL]||{};this.lightDefs=t.lights||[]}function s(){this.name=n.KHR_MATERIALS_UNLIT}function o(e){this.parser=e,this.name=n.KHR_MATERIALS_CLEARCOAT}function a(e){this.parser=e,this.name=n.KHR_MATERIALS_TRANSMISSION}function l(e){this.parser=e,this.name=n.KHR_TEXTURE_BASISU}r.prototype.loadLight=function(e){var t,n=this.lightDefs[e],i=new gs(16777215);void 0!==n.color&&i.fromArray(n.color);var r=void 0!==n.range?n.range:0;switch(n.type){case"directional":(t=new nd(i)).target.position.set(0,0,-1),t.add(t.target);break;case"point":(t=new $u(i)).distance=r;break;case"spot":(t=new Ku(i)).distance=r,n.spot=n.spot||{},n.spot.innerConeAngle=void 0!==n.spot.innerConeAngle?n.spot.innerConeAngle:0,n.spot.outerConeAngle=void 0!==n.spot.outerConeAngle?n.spot.outerConeAngle:Math.PI/4,t.angle=n.spot.outerConeAngle,t.penumbra=1-n.spot.innerConeAngle/n.spot.outerConeAngle,t.target.position.set(0,0,-1),t.add(t.target);break;default:throw new Error('THREE.GLTFLoader: Unexpected light type, "'+n.type+'".')}return t.position.set(0,0,0),t.decay=2,void 0!==n.intensity&&(t.intensity=n.intensity),t.name=n.name||"light_"+e,Promise.resolve(t)},s.prototype.getMaterialType=function(){return _s},s.prototype.extendParams=function(e,t,n){var i=[];e.color=new gs(1,1,1),e.opacity=1;var r=t.pbrMetallicRoughness;if(r){if(Array.isArray(r.baseColorFactor)){var s=r.baseColorFactor;e.color.fromArray(s),e.opacity=s[3]}void 0!==r.baseColorTexture&&i.push(n.assignTexture(e,"map",r.baseColorTexture))}return Promise.all(i)},o.prototype.getMaterialType=function(e){var t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?jh:null},o.prototype.extendMaterialParams=function(e,t){var n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();var r=[],s=i.extensions[this.name];if(void 0!==s.clearcoatFactor&&(t.clearcoat=s.clearcoatFactor),void 0!==s.clearcoatTexture&&r.push(n.assignTexture(t,"clearcoatMap",s.clearcoatTexture)),void 0!==s.clearcoatRoughnessFactor&&(t.clearcoatRoughness=s.clearcoatRoughnessFactor),void 0!==s.clearcoatRoughnessTexture&&r.push(n.assignTexture(t,"clearcoatRoughnessMap",s.clearcoatRoughnessTexture)),void 0!==s.clearcoatNormalTexture&&(r.push(n.assignTexture(t,"clearcoatNormalMap",s.clearcoatNormalTexture)),void 0!==s.clearcoatNormalTexture.scale)){var o=s.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new Fi(o,o)}return Promise.all(r)},a.prototype.getMaterialType=function(e){var t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?jh:null},a.prototype.extendMaterialParams=function(e,t){var n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();var r=[],s=i.extensions[this.name];return void 0!==s.transmissionFactor&&(t.transmission=s.transmissionFactor),void 0!==s.transmissionTexture&&r.push(n.assignTexture(t,"transmissionMap",s.transmissionTexture)),Promise.all(r)},l.prototype.loadTexture=function(e){var t=this.parser,n=t.json,i=n.textures[e];if(!i.extensions||!i.extensions[this.name])return null;var r=i.extensions[this.name],s=n.images[r.source],o=t.options.ktx2Loader;if(!o)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return t.loadTextureImage(e,s,o)};var c="glTF",h=1313821514,u=5130562;function d(e){this.name=n.KHR_BINARY_GLTF,this.content=null,this.body=null;var t=new DataView(e,0,12);if(this.header={magic:ld(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==c)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");for(var i=new DataView(e,12),r=0;r",t),e.fragmentShader=e.fragmentShader.replace("#include ",n),e.fragmentShader=e.fragmentShader.replace("#include ",i),e.fragmentShader=e.fragmentShader.replace("#include ",r),e.fragmentShader=e.fragmentShader.replace("#include ",s)},Object.defineProperties(this,{specular:{get:function(){return o.specular.value},set:function(e){o.specular.value=e}},specularMap:{get:function(){return o.specularMap.value},set:function(e){o.specularMap.value=e}},glossiness:{get:function(){return o.glossiness.value},set:function(e){o.glossiness.value=e}},glossinessMap:{get:function(){return o.glossinessMap.value},set:function(e){o.glossinessMap.value=e,e?(this.defines.USE_GLOSSINESSMAP="",this.defines.USE_ROUGHNESSMAP=""):(delete this.defines.USE_ROUGHNESSMAP,delete this.defines.USE_GLOSSINESSMAP)}}}),delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this.setValues(e)}function g(){return{name:n.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS,specularGlossinessParams:["color","map","lightMap","lightMapIntensity","aoMap","aoMapIntensity","emissive","emissiveIntensity","emissiveMap","bumpMap","bumpScale","normalMap","normalMapType","displacementMap","displacementScale","displacementBias","specularMap","specular","glossinessMap","glossiness","alphaMap","envMap","envMapIntensity","refractionRatio"],getMaterialType:function(){return m},extendParams:function(e,t,n){var i=t.extensions[this.name];e.color=new gs(1,1,1),e.opacity=1;var r=[];if(Array.isArray(i.diffuseFactor)){var s=i.diffuseFactor;e.color.fromArray(s),e.opacity=s[3]}if(void 0!==i.diffuseTexture&&r.push(n.assignTexture(e,"map",i.diffuseTexture)),e.emissive=new gs(0,0,0),e.glossiness=void 0!==i.glossinessFactor?i.glossinessFactor:1,e.specular=new gs(1,1,1),Array.isArray(i.specularFactor)&&e.specular.fromArray(i.specularFactor),void 0!==i.specularGlossinessTexture){var o=i.specularGlossinessTexture;r.push(n.assignTexture(e,"glossinessMap",o)),r.push(n.assignTexture(e,"specularMap",o))}return Promise.all(r)},createMaterial:function(e){var t=new m(e);return t.fog=!0,t.color=e.color,t.map=void 0===e.map?null:e.map,t.lightMap=null,t.lightMapIntensity=1,t.aoMap=void 0===e.aoMap?null:e.aoMap,t.aoMapIntensity=1,t.emissive=e.emissive,t.emissiveIntensity=1,t.emissiveMap=void 0===e.emissiveMap?null:e.emissiveMap,t.bumpMap=void 0===e.bumpMap?null:e.bumpMap,t.bumpScale=1,t.normalMap=void 0===e.normalMap?null:e.normalMap,t.normalMapType=0,e.normalScale&&(t.normalScale=e.normalScale),t.displacementMap=null,t.displacementScale=1,t.displacementBias=0,t.specularMap=void 0===e.specularMap?null:e.specularMap,t.specular=e.specular,t.glossinessMap=void 0===e.glossinessMap?null:e.glossinessMap,t.glossiness=e.glossiness,t.alphaMap=null,t.envMap=void 0===e.envMap?null:e.envMap,t.envMapIntensity=1,t.refractionRatio=.98,t}}}function v(){this.name=n.KHR_MESH_QUANTIZATION}function y(e,t,n,i){Qh.call(this,e,t,n,i)}p.prototype.decodePrimitive=function(e,t){var n=this.json,i=this.dracoLoader,r=e.extensions[this.name].bufferView,s=e.extensions[this.name].attributes,o={},a={},l={};for(var c in s){var h=R[c]||c.toLowerCase();o[h]=s[c]}for(c in e.attributes){h=R[c]||c.toLowerCase();if(void 0!==s[c]){var u=n.accessors[e.attributes[c]],d=E[u.componentType];l[h]=d,a[h]=!0===u.normalized}}return t.getDependency("bufferView",r).then((function(e){return new Promise((function(t){i.decodeDracoFile(e,(function(e){for(var n in e.attributes){var i=e.attributes[n],r=a[n];void 0!==r&&(i.normalized=r)}t(e)}),o,l)}))}))},f.prototype.extendTexture=function(e,t){return e=e.clone(),void 0!==t.offset&&e.offset.fromArray(t.offset),void 0!==t.rotation&&(e.rotation=t.rotation),void 0!==t.scale&&e.repeat.fromArray(t.scale),void 0!==t.texCoord&&console.warn('THREE.GLTFLoader: Custom UV sets in "'+this.name+'" extension not yet supported.'),e.needsUpdate=!0,e},m.prototype=Object.create(Hh.prototype),m.prototype.constructor=m,m.prototype.copy=function(e){return Hh.prototype.copy.call(this,e),this.specularMap=e.specularMap,this.specular.copy(e.specular),this.glossinessMap=e.glossinessMap,this.glossiness=e.glossiness,delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this},y.prototype=Object.create(Qh.prototype),y.prototype.constructor=y,y.prototype.copySampleValue_=function(e){for(var t=this.resultBuffer,n=this.sampleValues,i=this.valueSize,r=e*i*3+i,s=0;s!==i;s++)t[s]=n[r+s];return t},y.prototype.beforeStart_=y.prototype.copySampleValue_,y.prototype.afterEnd_=y.prototype.copySampleValue_,y.prototype.interpolate_=function(e,t,n,i){for(var r=this.resultBuffer,s=this.sampleValues,o=this.valueSize,a=2*o,l=3*o,c=i-t,h=(n-t)/c,u=h*h,d=u*h,p=e*l,f=p-l,m=-2*d+3*u,g=d-u,v=1-m,y=g-u+h,x=0;x!==o;x++){var _=s[f+x+o],b=s[f+x+a]*c,w=s[p+x+o],M=s[p+x]*c;r[x]=v*_+y*b+m*w+g*M}return r};var x=0,_=1,b=2,w=3,M=4,S=5,T=6,E={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},A={9728:1003,9729:1006,9984:1004,9985:1007,9986:1005,9987:1008},C={33071:1001,33648:1002,10497:1e3},L={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},R={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},P={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},N={CUBICSPLINE:void 0,LINEAR:2301,STEP:2300},D="OPAQUE",I="MASK",O="BLEND";function z(e,t){return"string"!=typeof e||""===e?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}function U(e,t,n){for(var i in n.extensions)void 0===e[i]&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[i]=n.extensions[i])}function B(e,t){void 0!==t.extras&&("object"==typeof t.extras?Object.assign(e.userData,t.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+t.extras))}function F(e,t){if(e.updateMorphTargets(),void 0!==t.weights)for(var n=0,i=t.weights.length;n=2&&r.setY(S,b[w*o+1]),o>=3&&r.setZ(S,b[w*o+2]),o>=4&&r.setW(S,b[w*o+3]),o>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return r}))},k.prototype.loadTexture=function(e){var t,i,r=this.json,s=this.options,o=r.textures[e],a=o.extensions||{};return(t=a[n.MSFT_TEXTURE_DDS]?r.images[a[n.MSFT_TEXTURE_DDS].source]:r.images[o.source]).uri&&(i=s.manager.getHandler(t.uri)),i||(i=a[n.MSFT_TEXTURE_DDS]?this.extensions[n.MSFT_TEXTURE_DDS].ddsLoader:this.textureLoader),this.loadTextureImage(e,t,i)},k.prototype.loadTextureImage=function(e,t,n){var i=this,r=this.json,s=this.options,o=r.textures[e],a=self.URL||self.webkitURL,l=t.uri,c=!1,h=!0;return"image/jpeg"===t.mimeType&&(h=!1),void 0!==t.bufferView&&(l=i.getDependency("bufferView",t.bufferView).then((function(e){"image/png"===t.mimeType&&(h=6===new DataView(e,25,1).getUint8(0,!1)),c=!0;var n=new Blob([e],{type:t.mimeType});return l=a.createObjectURL(n)}))),Promise.resolve(l).then((function(e){return new Promise((function(t,i){var r=t;!0===n.isImageBitmapLoader&&(r=function(e){t(new Bc(e))}),n.load(z(e,s.path),r,void 0,i)}))})).then((function(t){!0===c&&a.revokeObjectURL(l),t.flipY=!1,o.name&&(t.name=o.name),h||(t.format=1022);var n=(r.samplers||{})[o.sampler]||{};return t.magFilter=A[n.magFilter]||1006,t.minFilter=A[n.minFilter]||1008,t.wrapS=C[n.wrapS]||1e3,t.wrapT=C[n.wrapT]||1e3,i.associations.set(t,{type:"textures",index:e}),t}))},k.prototype.assignTexture=function(e,t,i){var r=this;return this.getDependency("texture",i.index).then((function(s){if(void 0===i.texCoord||0==i.texCoord||"aoMap"===t&&1==i.texCoord||console.warn("THREE.GLTFLoader: Custom UV set "+i.texCoord+" for texture "+t+" not yet supported."),r.extensions[n.KHR_TEXTURE_TRANSFORM]){var o=void 0!==i.extensions?i.extensions[n.KHR_TEXTURE_TRANSFORM]:void 0;if(o){var a=r.associations.get(s);s=r.extensions[n.KHR_TEXTURE_TRANSFORM].extendTexture(s,o),r.associations.set(s,a)}}e[t]=s}))},k.prototype.assignFinalMaterial=function(e){var t=e.geometry,n=e.material,i=void 0!==t.attributes.tangent,r=void 0!==t.attributes.color,s=void 0===t.attributes.normal,o=!0===e.isSkinnedMesh,a=Object.keys(t.morphAttributes).length>0,l=a&&void 0!==t.morphAttributes.normal;if(e.isPoints){var c="PointsMaterial:"+n.uuid,h=this.cache.get(c);h||(h=new Lc,xs.prototype.copy.call(h,n),h.color.copy(n.color),h.map=n.map,h.sizeAttenuation=!1,this.cache.add(c,h)),n=h}else if(e.isLine){c="LineBasicMaterial:"+n.uuid;var u=this.cache.get(c);u||(u=new yc,xs.prototype.copy.call(u,n),u.color.copy(n.color),this.cache.add(c,u)),n=u}if(i||r||s||o||a){c="ClonedMaterial:"+n.uuid+":";n.isGLTFSpecularGlossinessMaterial&&(c+="specular-glossiness:"),o&&(c+="skinning:"),i&&(c+="vertex-tangents:"),r&&(c+="vertex-colors:"),s&&(c+="flat-shading:"),a&&(c+="morph-targets:"),l&&(c+="morph-normals:");var d=this.cache.get(c);d||(d=n.clone(),o&&(d.skinning=!0),i&&(d.vertexTangents=!0),r&&(d.vertexColors=!0),s&&(d.flatShading=!0),a&&(d.morphTargets=!0),l&&(d.morphNormals=!0),this.cache.add(c,d),this.associations.set(d,this.associations.get(n))),n=d}n.aoMap&&void 0===t.attributes.uv2&&void 0!==t.attributes.uv&&t.setAttribute("uv2",t.attributes.uv),n.normalScale&&!i&&(n.normalScale.y=-n.normalScale.y),n.clearcoatNormalScale&&!i&&(n.clearcoatNormalScale.y=-n.clearcoatNormalScale.y),e.material=n},k.prototype.getMaterialType=function(){return Hh},k.prototype.loadMaterial=function(e){var t,i=this,r=this.json,s=this.extensions,o=r.materials[e],a={},l=o.extensions||{},c=[];if(l[n.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){var h=s[n.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];t=h.getMaterialType(),c.push(h.extendParams(a,o,i))}else if(l[n.KHR_MATERIALS_UNLIT]){var u=s[n.KHR_MATERIALS_UNLIT];t=u.getMaterialType(),c.push(u.extendParams(a,o,i))}else{var d=o.pbrMetallicRoughness||{};if(a.color=new gs(1,1,1),a.opacity=1,Array.isArray(d.baseColorFactor)){var p=d.baseColorFactor;a.color.fromArray(p),a.opacity=p[3]}void 0!==d.baseColorTexture&&c.push(i.assignTexture(a,"map",d.baseColorTexture)),a.metalness=void 0!==d.metallicFactor?d.metallicFactor:1,a.roughness=void 0!==d.roughnessFactor?d.roughnessFactor:1,void 0!==d.metallicRoughnessTexture&&(c.push(i.assignTexture(a,"metalnessMap",d.metallicRoughnessTexture)),c.push(i.assignTexture(a,"roughnessMap",d.metallicRoughnessTexture))),t=this._invokeOne((function(t){return t.getMaterialType&&t.getMaterialType(e)})),c.push(this._invokeAll((function(t){return t.extendMaterialParams&&t.extendMaterialParams(e,a)})))}!0===o.doubleSided&&(a.side=2);var f=o.alphaMode||D;return f===O?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,f===I&&(a.alphaTest=void 0!==o.alphaCutoff?o.alphaCutoff:.5)),void 0!==o.normalTexture&&t!==_s&&(c.push(i.assignTexture(a,"normalMap",o.normalTexture)),a.normalScale=new Fi(1,1),void 0!==o.normalTexture.scale&&a.normalScale.set(o.normalTexture.scale,o.normalTexture.scale)),void 0!==o.occlusionTexture&&t!==_s&&(c.push(i.assignTexture(a,"aoMap",o.occlusionTexture)),void 0!==o.occlusionTexture.strength&&(a.aoMapIntensity=o.occlusionTexture.strength)),void 0!==o.emissiveFactor&&t!==_s&&(a.emissive=(new gs).fromArray(o.emissiveFactor)),void 0!==o.emissiveTexture&&t!==_s&&c.push(i.assignTexture(a,"emissiveMap",o.emissiveTexture)),Promise.all(c).then((function(){var r;return r=t===m?s[n.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(a):new t(a),o.name&&(r.name=o.name),r.map&&(r.map.encoding=3001),r.emissiveMap&&(r.emissiveMap.encoding=3001),B(r,o),i.associations.set(r,{type:"materials",index:e}),o.extensions&&U(s,r,o),r}))},k.prototype.loadGeometries=function(e){var t=this,i=this.extensions,r=this.primitiveCache;function s(e){return i[n.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(e,t).then((function(n){return H(n,e,t)}))}for(var o,a,l=[],c=0,h=e.length;c0&&F(h,i),h.name=i.name||"mesh_"+e,o.length>1&&(h.name+="_"+l),B(h,i),n.assignFinalMaterial(h),a.push(h)}if(1===a.length)return a[0];var f=new Pl;for(l=0,c=a.length;l1?new Pl:1===t.length?t[0]:new Yr)!==t[0])for(var o=0,a=t.length;o{this.renderer.three.scene.add(e.scene)})}};Ux.render=function(e,t,n,i,r,s){const o=At("Camera"),a=At("Scene"),l=At("Renderer");return Ut(),Ft(l,{ref:"renderer","orbit-ctrl":{enableDamping:!0,dampingFactor:.05}},{default:Et(()=>[Vt(o,{ref:"camera",position:n.cameraPosition},null,8,["position"]),Vt(a,null,{default:Et(()=>[Tt(e.$slots,"default")]),_:3})]),_:1},512)},Ux.__file="src/components/viewers/GLTFViewer.vue";var Bx=Object.freeze({__proto__:null,Renderer:hp,PerspectiveCamera:gp,Camera:gp,Scene:vp,Texture:yp,CubeTexture:xp,BoxGeometry:bp,CircleGeometry:wp,ConeGeometry:Mp,CylinderGeometry:Sp,DodecahedronGeometry:Tp,IcosahedronGeometry:Ep,LatheGeometry:Ap,OctahedronGeometry:Cp,PolyhedronGeometry:Lp,RingGeometry:Rp,SphereGeometry:Pp,TetrahedronGeometry:Np,TorusGeometry:Dp,TorusKnotGeometry:Ip,TubeGeometry:Op,AmbientLight:Up,DirectionalLight:Bp,PointLight:Fp,SpotLight:Gp,BasicMaterial:Hp,LambertMaterial:jp,PhongMaterial:Vp,PhysicalMaterial:Xp,StandardMaterial:Wp,SubSurfaceMaterial:nf,ToonMaterial:rf,Map:sf,EnvMap:of,Mesh:af,Box:lf,Circle:cf,Cone:hf,Cylinder:uf,Dodecahedron:df,Icosahedron:pf,Lathe:ff,Octahedron:mf,Plane:gf,Polyhedron:vf,Ring:yf,Sphere:xf,Tetrahedron:_f,Text:bf,Torus:wf,TorusKnot:Mf,Tube:Sf,Gem:Tf,Image:Ef,InstancedMesh:Af,MirrorMesh:Cf,RefractionMesh:Lf,Sprite:Rf,EffectComposer:Bf,RenderPass:kf,BokehPass:Vf,FilmPass:qf,HalftonePass:Jf,SAOPass:nm,UnrealBloomPass:sm,NoisyImage:am,NoisyPlane:lm,NoisySphere:cm,NoisyText:hm,Slider1:Ox,GLTFViewer:Ux,setFromProp:up,propsValues:dp,lerp:pp,lerpv3:function(e,t,n){e.x=pp(e.x,t.x,n),e.y=pp(e.y,t.y,n),e.z=pp(e.z,t.z,n)},limit:fp});const Fx={install:e=>{["Camera","PerspectiveCamera","Renderer","Scene","BoxGeometry","CircleGeometry","ConeGeometry","CylinderGeometry","DodecahedronGeometry","IcosahedronGeometry","LatheGeometry","OctahedronGeometry","PolyhedronGeometry","RingGeometry","SphereGeometry","TetrahedronGeometry","TorusGeometry","TorusKnotGeometry","TubeGeometry","AmbientLight","DirectionalLight","PointLight","SpotLight","BasicMaterial","LambertMaterial","PhongMaterial","PhysicalMaterial","ShaderMaterial","StandardMaterial","SubSurfaceMaterial","ToonMaterial","Map","EnvMap","Box","Circle","Cone","Cylinder","Dodecahedron","Icosahedron","Mesh","Lathe","Octahedron","Plane","Polyhedron","Ring","Sphere","Tetrahedron","Text","Torus","TorusKnot","Tube","Gem","Image","InstancedMesh","MirrorMesh","RefractionMesh","Sprite","BokehPass","EffectComposer","FilmPass","HalftonePass","RenderPass","SAOPass","UnrealBloomPass","GLTFViewer"].forEach(t=>{e.component(t,Bx[t])})}};var Gx={components:{NoisyPlane:lm,NoisySphere:cm,NoisyText:hm},mounted(){const e=this.$refs.renderer,t=this.$refs.light1.light,n=this.$refs.light2.light,i=this.$refs.light3.light,r=this.$refs.light4.light,s=this.$refs.mesh1.mesh,o=this.$refs.mesh2.mesh,a=this.$refs.mesh3.mesh,l=this.$refs.mesh3.meshBack;e.onBeforeRender(()=>{const e=.001*Date.now(),c=100;t.position.x=Math.sin(.1*e)*c,t.position.y=Math.cos(.2*e)*c,n.position.x=Math.cos(.3*e)*c,n.position.y=Math.sin(.4*e)*c,i.position.x=Math.sin(.5*e)*c,i.position.y=Math.sin(.6*e)*c,r.position.x=Math.sin(.7*e)*c,r.position.y=Math.cos(.8*e)*c,s.rotation.x+=.015,s.rotation.y+=.008,o.rotation.x+=.02,o.rotation.y+=.01,a.rotation.x+=.007,a.rotation.y+=.013,l.rotation.x=a.rotation.x,l.rotation.y=a.rotation.y})}};Gx.render=function(e,t,n,i,r,s){const o=At("Camera"),a=At("PointLight"),l=At("PhysicalMaterial"),c=At("NoisyPlane"),h=At("DodecahedronGeometry"),u=At("StandardMaterial"),d=At("MirrorMesh"),p=At("TorusGeometry"),f=At("RefractionMesh"),m=At("Gem"),g=At("Scene"),v=At("Renderer");return Ut(),Ft(v,{ref:"renderer","orbit-ctrl":{enableDamping:!0,dampingFactor:.05}},{default:Et(()=>[Vt(o,{position:{x:-0,y:-120,z:30}}),Vt(g,{background:"#ffffff"},{default:Et(()=>[Vt(a,{ref:"light1",color:"#0E09DC",intensity:.85,position:{x:0,y:0,z:50}},null,512),Vt(a,{ref:"light2",color:"#1CD1E1",intensity:.85,position:{x:0,y:0,z:50}},null,512),Vt(a,{ref:"light3",color:"#18C02C",intensity:.85,position:{x:0,y:0,z:50}},null,512),Vt(a,{ref:"light4",color:"#ee3bcf",intensity:.85,position:{x:0,y:0,z:50}},null,512),qt(' \r\n \r\n '),Vt(c,{width:200,"width-segments":200,height:200,"height-segments":200,"time-coef":3e-4,"noise-coef":.03,"z-coef":7,position:{x:0,y:0,z:0}},{default:Et(()=>[Vt(l,{"flat-shading":""})]),_:1}),qt(' \r\n \r\n '),Vt(d,{ref:"mesh1",position:{x:-30,y:-20,z:15},"auto-update":""},{default:Et(()=>[Vt(h,{radius:8}),Vt(u,{color:"#ffffff",metalness:1,roughness:0})]),_:1},512),Vt(f,{ref:"mesh2",position:{x:0,y:-20,z:15},"auto-update":""},{default:Et(()=>[Vt(p,{radius:8,tube:3}),Vt(u,{color:"#ffffff",metalness:1,roughness:0})]),_:1},512),Vt(m,{ref:"mesh3",position:{x:30,y:-20,z:15},"auto-update":""},{default:Et(()=>[Vt(h,{radius:8}),Vt(u,{color:"#0000ff",metalness:1,roughness:0})]),_:1},512)]),_:1})]),_:1},512)},Gx.__file="src/components/demos/Demo1.vue";var kx={components:{NoisyImage:am}};kx.render=function(e,t,n,i,r,s){const o=At("Camera"),a=At("NoisyImage"),l=At("Scene"),c=At("Renderer");return Ut(),Ft(c,{ref:"renderer","orbit-ctrl":{enableDamping:!0,dampingFactor:.05}},{default:Et(()=>[Vt(o,{position:{x:0,y:0,z:100}}),Vt(l,{background:"#000000"},{default:Et(()=>[Vt(a,{src:"https://assets.codepen.io/33787/img2.jpg",width:800,"time-coef":.001,"noise-coef":2,"z-coef":5,"disp-coef":.015,rotation:{x:-Math.PI/6}})]),_:1})]),_:1},512)},kx.__file="src/components/demos/Demo2.vue";const{randFloat:Hx,randFloatSpread:jx}=Bi;var Vx={setup(){const e=[],t=new Zi,n=new Yr,i=new Zi;for(let t=0;t<2e3;t++)e.push({position:new Zi(jx(200),jx(200),jx(200)),scale:Hx(.2,1),scaleZ:Hx(.1,1),velocity:new Zi(jx(2),jx(2),jx(2)),attraction:.03+Hx(-.01,.01),vlimit:1.2+Hx(-.1,.1)});return{NUM_INSTANCES:2e3,instances:e,target:t,dummyO:n,dummyV:i}},mounted(){this.renderer=this.$refs.renderer,this.imesh=this.$refs.imesh.mesh,this.light=this.$refs.light.light,this.init()},methods:{init(){for(let e=0;e[Vt(o,{position:{z:200}}),Vt(f,null,{default:Et(()=>[Vt(a,{color:"#808080"}),Vt(l,{color:"#ff6000"}),Vt(l,{ref:"light",color:"#0060ff",intensity:.5},null,512),Vt(u,{ref:"imesh","material-id":"material",count:i.NUM_INSTANCES},{default:Et(()=>[Vt(c,{width:2,height:2,depth:10}),qt(' '),qt(' '),qt(' '),Vt(h,{transparent:!0,opacity:.9,metalness:.8,roughness:.5})]),_:1},8,["count"]),Vt(p,{text:"TroisJS","font-src":"helvetiker_regular.typeface.json","material-id":"material1",align:"center",size:30,height:5,position:{x:0,y:0,z:0},"cast-shadow":!0},{default:Et(()=>[Vt(d)]),_:1})]),_:1}),Vt(y,null,{default:Et(()=>[Vt(m),Vt(g,{strength:1}),Vt(v,{radius:1,scatter:0})]),_:1})]),_:1},512)},Vx.__file="src/components/demos/Demo3.vue";var Wx={setup:()=>({NUM_INSTANCES:2e3}),mounted(){const e=this.$refs.imesh.mesh,t=new Yr,{randFloat:n,randFloatSpread:i}=Bi;for(let r=0;r[Vt(o,{position:{z:100}}),Vt(u,null,{default:Et(()=>[Vt(a,{color:"#ffffff",intensity:.5,position:{y:150,z:0},"cast-shadow":!0,"shadow-map-size":{width:1024,height:1024}}),Vt(a,{color:"#ff0000",intensity:.5,position:{y:-150,z:0},"cast-shadow":!0,"shadow-map-size":{width:1024,height:1024}}),Vt(h,{ref:"imesh","material-id":"material",count:i.NUM_INSTANCES,"cast-shadow":!0,"receive-shadow":!0},{default:Et(()=>[Vt(l,{radius:5}),Vt(c)]),_:1},8,["count"])]),_:1}),Vt(f,null,{default:Et(()=>[Vt(d),Vt(p,{strength:2})]),_:1})]),_:1},512)},Wx.__file="src/components/demos/Demo4.vue";var Xx={components:{Slider1:Ox},data:()=>({images:[{src:"https://assets.codepen.io/33787/img1.jpg"},{src:"https://assets.codepen.io/33787/img2.jpg"},{src:"https://assets.codepen.io/33787/img3.jpg"},{src:"https://assets.codepen.io/33787/img4.jpg"}]}),mounted(){}};Xx.render=function(e,t,n,i,r,s){const o=At("Slider1");return Ut(),Ft(o,{images:r.images},null,8,["images"])},Xx.__file="src/components/demos/Slider1.vue";var qx={};qx.render=function(e,t,n,i,r,s){const o=At("AmbientLight"),a=At("GLTFViewer");return Ut(),Ft(a,{src:"test.glb","camera-position":{z:1}},{default:Et(()=>[Vt(o)]),_:1})},qx.__file="src/components/demos/DemoGLTF.vue";var Yx={name:"App",components:{Demo1:Gx,Demo2:kx,Demo3:Vx,Demo4:Wx,Slider1:Xx,DemoGLTF:qx},data:()=>({tests:["Demo1","Demo2","Demo3","Demo4","Slider1","DemoGLTF"],test:"Demo1"})};const Zx={class:"app"},Jx={class:"navbar"};Yx.render=function(e,t,n,i,r,s){return Ut(),Ft("div",Zx,[Vt("ul",Jx,[(Ut(!0),Ft(Pt,null,ai(r.tests,e=>{return Ut(),Ft("li",{key:e,onClick:t=>r.test=e},null==(t=e)?"":S(t)?JSON.stringify(t,l,2):String(t),9,["onClick"]);var t}),128))]),(Ut(),Ft((o=r.test,w(o)?Lt("components",o,!1)||o:o||Ct)))]);var o},Yx.__file="src/App.vue";const Kx=((...e)=>{const t=(Ai||(Ai=Nn(Ei))).createApp(...e),{mount:n}=t;return t.mount=e=>{const i=function(e){if(w(e)){return document.querySelector(e)}return e}(e);if(!i)return;const r=t._component;b(r)||r.render||r.template||(r.template=i.innerHTML),i.innerHTML="";const s=n(i);return i.removeAttribute("v-cloak"),i.setAttribute("data-v-app",""),s},t})(Yx);Kx.use(Fx),Kx.mount("#app"); diff --git a/docs/index.html b/docs/index.html index 0a5038d..cac7862 100644 --- a/docs/index.html +++ b/docs/index.html @@ -9,7 +9,7 @@
- + diff --git a/package.json b/package.json index a73b4e9..a9bfe81 100644 --- a/package.json +++ b/package.json @@ -1,13 +1,12 @@ { "name": "troisjs", - "version": "0.0.9", + "version": "0.1.0", "scripts": { "dev": "vite", "build": "vite build", "rollup": "rollup -c" }, "dependencies": { - "chroma-js": "^2.1.0", "gsap": "^3.5.1", "three": "^0.120" }, diff --git a/rollup.config.js b/rollup.config.js index 2db192a..d11f799 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -2,17 +2,24 @@ import commonjs from '@rollup/plugin-commonjs'; import vue from 'rollup-plugin-vue'; import buble from '@rollup/plugin-buble'; import { terser } from "rollup-plugin-terser"; +// import replace from '@rollup/plugin-replace'; -const input = 'src/index.js'; +const input = 'src/export.js'; const external = [ 'three', 'three/examples/jsm/controls/OrbitControls.js', - 'three/examples/jsm/postprocessing/EffectComposer.js', + 'three/examples/jsm/loaders/GLTFLoader.js', 'three/examples/jsm/postprocessing/BokehPass.js', + 'three/examples/jsm/postprocessing/EffectComposer.js', + 'three/examples/jsm/postprocessing/FilmPass.js', + 'three/examples/jsm/postprocessing/HalftonePass.js', 'three/examples/jsm/postprocessing/RenderPass.js', + 'three/examples/jsm/postprocessing/SAOPass.js', 'three/examples/jsm/postprocessing/UnrealBloomPass.js', + 'gsap', 'vue', ]; + const plugins = [ commonjs(), vue(), @@ -23,6 +30,74 @@ const plugins = [ ]; export default [ + // { + // input, + // external, + // output: { + // format: 'umd', + // name: 'TroisJS', + // file: 'build/trois.umd.js', + // sourcemap: true, + // globals: { + // 'three': 'THREE', + // 'vue': 'Vue', + // }, + // }, + // plugins, + // }, + // { + // input, + // external, + // output: { + // format: 'umd', + // name: 'TroisJS', + // file: 'build/trois.umd.min.js', + // sourcemap: true, + // }, + // plugins: [ + // ...plugins, + // terser(), + // ], + // }, + // { + // input, + // external, + // output: { + // format: 'es', + // exports: 'named', + // file: 'build/trois.module.cdn.js', + // sourcemap: true, + // }, + // plugins: [ + // replace({ + // 'from \'three\'': 'from \'https://unpkg.com/three@0.120.1/build/three.module.js\'', + // 'from \'three/examples': 'from \'https://unpkg.com/three@0.120.1/examples', + // 'from \'gsap\'': 'from \'https://unpkg.com/gsap@3.5.1/index.js\'', + // delimiters: ['', ''], + // }), + // ...plugins, + // ], + // }, + // { + // input, + // external, + // output: { + // format: 'es', + // exports: 'named', + // file: 'build/trois.module.cdn.min.js', + // sourcemap: true, + // }, + // plugins: [ + // replace({ + // 'from \'three\'': 'from \'https://unpkg.com/three@0.120.1/build/three.module.js\'', + // 'from \'three/examples': 'from \'https://unpkg.com/three@0.120.1/examples', + // 'from \'gsap\'': 'from \'https://unpkg.com/gsap@3.5.1/index.js\'', + // delimiters: ['', ''], + // }), + // ...plugins, + // terser(), + // ], + // }, { input, external, @@ -53,7 +128,7 @@ export default [ external, output: { format: 'cjs', - file: 'dist/trois.js', + file: 'build/trois.js', sourcemap: true, }, plugins, @@ -63,7 +138,7 @@ export default [ external, output: { format: 'cjs', - file: 'dist/trois.min.js', + file: 'build/trois.min.js', sourcemap: true, }, plugins: [ diff --git a/src/components/demos/Demo1.vue b/src/components/demos/Demo1.vue index 72be138..ebe4b84 100644 --- a/src/components/demos/Demo1.vue +++ b/src/components/demos/Demo1.vue @@ -42,17 +42,17 @@ --> - + - + - +