var e=Object.defineProperty,t=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable,r=(t,a,o)=>a in t?e(t,a,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[a]=o;import{u as s,d as n,c as i,e as c}from"./index.fbca08c6.js";import{a4 as l,d as p,q as d,r as u,o as f,c as m,w as h,a as y,ag as b,y as g,u as x,k as v,ah as M,O as j}from"./vendor.6afcf1a6.js";import{_ as C}from"./OrbitControlsWrapper.8e39b8e4.js";const O=new l;var $=p({components:{OrbitControlsWrapper:C},data:()=>({count:1e3,objects:[],rotation:[0,0,0]}),mounted(){const e=this.$refs.mesh.$el.instance;for(let t=0;t<this.count;t++){const a=20*Math.random()-10,o=20*Math.random()-10,r=20*Math.random()-10,s={position:[a,o,r],rotation:new d,rotationSpeed:{x:.1*Math.random()-.05,y:.1*Math.random()-.05},scale:.5*Math.random()};this.objects.push(s),O.position.set(a,o,r),O.updateMatrix(),e.setMatrixAt(t,O.matrix)}e.instanceMatrix.needsUpdate=!0,this.update()},methods:{log({element:e}){},update(){requestAnimationFrame(this.update);const e=this.$refs.mesh.$el.instance;for(let t=0;t<this.objects.length;t++){const a=this.objects[t];O.position.set.apply(O.position,a.position),O.rotation.x=a.rotation.x=a.rotation.x+a.rotationSpeed.x,O.rotation.y=a.rotation.y=a.rotation.y+a.rotationSpeed.y,O.scale.setScalar(a.scale),O.updateMatrix(),e.setMatrixAt(t,O.matrix)}e.instanceMatrix.needsUpdate=!0}}});$.render=function(e,t,a,o,r,s){const n=u("OrbitControlsWrapper"),i=u("spotLight"),c=u("sphereGeometry"),l=u("meshPhongMaterial"),p=u("instancedMesh"),d=u("bloomEffect"),b=u("pixelationEffect"),g=u("effectComposer"),x=u("TroisCanvas");return f(),m(x,{cameraPosition:[0,0,5]},{default:h((()=>[y(n),y(i,{color:"white",intensity:.5,position:[0,150,0]},null,8,["intensity"]),y(i,{color:"red",intensity:.5,position:[0,-150,0]},null,8,["intensity"]),y(p,{args:[null,null,e.count],scale:.3,ref:"mesh"},{default:h((()=>[y(c),y(l)])),_:1},8,["args","scale"]),y(g,null,{default:h((()=>[y(d,{args:[{luminanceThreshold:.1,intensity:2,resolutionScale:.3}]},null,8,["args"]),y(b,{args:[5]})])),_:1})])),_:1})};const E=s(),w=new b;var A=p({props:{manualConfig:{type:Boolean,default:!1}},computed:{renderer:()=>E.renderer.value},methods:{ready({element:e}){e.attachedArray.pass.forEach((t=>{var a;null==(a=e.instance)||a.addPass(t)})),n((t=>{var a;null==(a=null==e?void 0:e.instance)||a.render(w.getDelta())}))}}});A.render=function(e,t,a,o,r,s){const n=u("renderPass"),i=u("effectPass"),c=u("vanruescEffectComposer");return e.renderer?(f(),m(c,{key:0,args:["$renderer"],onReady:e.ready},{default:h((()=>[e.manualConfig?x(e.$slots,"default",{key:1}):(f(),m(g,{key:0},[y(n,{args:["$scene","$camera"]}),y(i,{args:["$camera","$attachedArray.effect"]},{default:h((()=>[x(e.$slots,"default")])),_:3},8,["args"])],64))])),_:3},8,["onReady"])):v("",!0)};const P=i($);c({app:P,OrbitControls:j}),(({app:e,extend:s,trois:n})=>{const i={};Object.keys(M).forEach((e=>{"EffectComposer"===e?i.VanruescEffectComposer=M[e]:i[e]=M[e]})),s(((e,s)=>{for(var n in s||(s={}))a.call(s,n)&&r(e,n,s[n]);if(t)for(var n of t(s))o.call(s,n)&&r(e,n,s[n]);return e})({app:e},i)),e.component("EffectComposer",A),n.autoAttach.value.push("composer"),n.autoAttachArray.value.push("effect","pass"),n.runDefaultRenderFunction.value=!1})({app:P,extend:c,trois:s()}),P.mount("#app");
