import{O as p,b as t,c as o}from"./index-6jOCfdig.js";import"./index-Ds2meNS5.js";import"./svelte/svelte_svelte.js";import"./svelte/svelte_animate.js";import"./svelte/svelte_attachments.js";import"./svelte/svelte_easing.js";import"./svelte/svelte_internal_client.js";import"./svelte/svelte_internal_flags_async.js";import"./svelte/svelte_internal_flags_legacy.js";import"./svelte/svelte_internal_flags_tracing.js";import"./svelte/svelte_internal_server.js";import"./svelte/svelte_legacy.js";import"./svelte/svelte_motion.js";import"./svelte/svelte_reactivity.js";import"./svelte/svelte_reactivity_window.js";import"./svelte/svelte_server.js";import"./svelte/svelte_store.js";import"./svelte/svelte_transition.js";import"./svelte/svelte_events.js";class l{constructor(){this._renderPipelines={},this._onNewPipelineAddedObservable=new p,this._onPipelineRemovedObservable=new p}get onNewPipelineAddedObservable(){return this._onNewPipelineAddedObservable}get onPipelineRemovedObservable(){return this._onPipelineRemovedObservable}get supportedPipelines(){const e=[];for(const i in this._renderPipelines)if(Object.prototype.hasOwnProperty.call(this._renderPipelines,i)){const n=this._renderPipelines[i];n.isSupported&&e.push(n)}return e}addPipeline(e){this.removePipeline(e._name),this._renderPipelines[e._name]=e,this._onNewPipelineAddedObservable.notifyObservers(e)}removePipeline(e){const i=this._renderPipelines[e];i&&(this._onPipelineRemovedObservable.notifyObservers(i),delete this._renderPipelines[e])}attachCamerasToRenderPipeline(e,i,n=!1){const r=this._renderPipelines[e];r&&r._attachCameras(i,n)}detachCamerasFromRenderPipeline(e,i){const n=this._renderPipelines[e];n&&n._detachCameras(i)}enableEffectInPipeline(e,i,n){const r=this._renderPipelines[e];r&&r._enableEffect(i,n)}disableEffectInPipeline(e,i,n){const r=this._renderPipelines[e];r&&r._disableEffect(i,n)}update(){for(const e in this._renderPipelines)if(Object.prototype.hasOwnProperty.call(this._renderPipelines,e)){const i=this._renderPipelines[e];i.isSupported?i._update():(i.dispose(),delete this._renderPipelines[e])}}_rebuild(){for(const e in this._renderPipelines)Object.prototype.hasOwnProperty.call(this._renderPipelines,e)&&this._renderPipelines[e]._rebuild()}dispose(){for(const e in this._renderPipelines)Object.prototype.hasOwnProperty.call(this._renderPipelines,e)&&this._renderPipelines[e].dispose()}}Object.defineProperty(o.prototype,"postProcessRenderPipelineManager",{get:function(){if(!this._postProcessRenderPipelineManager){let s=this._getComponent(t.NAME_POSTPROCESSRENDERPIPELINEMANAGER);s||(s=new a(this),this._addComponent(s)),this._postProcessRenderPipelineManager=new l}return this._postProcessRenderPipelineManager},enumerable:!0,configurable:!0});class a{constructor(e){this.name=t.NAME_POSTPROCESSRENDERPIPELINEMANAGER,this.scene=e}register(){this.scene._gatherRenderTargetsStage.registerStep(t.STEP_GATHERRENDERTARGETS_POSTPROCESSRENDERPIPELINEMANAGER,this,this._gatherRenderTargets)}rebuild(){this.scene._postProcessRenderPipelineManager&&this.scene._postProcessRenderPipelineManager._rebuild()}dispose(){this.scene._postProcessRenderPipelineManager&&this.scene._postProcessRenderPipelineManager.dispose()}_gatherRenderTargets(){this.scene._postProcessRenderPipelineManager&&this.scene._postProcessRenderPipelineManager.update()}}export{a as PostProcessRenderPipelineManagerSceneComponent};
