import {C as Cn}from'./chunk-Dm0vWTVF.js';import {g,x as xpe,K as qp,aE as L,b as Pa,ad as ti,c6 as j0,ck as q0,p as px,c as IV}from'./main-DEZ5cZzu.js';var h=["contentWrapper"],k=(()=>{class o{customMarkupService=g(Cn);contentWrapper=xpe("contentWrapper");content=qp(void 0);displayed=false;dynamicComponentRefs=[];ngOnChanges(){return L(this,null,function*(){yield this.rebuild();})}ngOnDestroy(){this.destroyDynamicComponents();}rebuild(){return L(this,null,function*(){this.destroyDynamicComponents();let n=this.contentWrapper();n&&(n.nativeElement.innerHTML="");let e=this.content();if(e instanceof HTMLDivElement)return this.loadElement(e);let{rootElement:t,componentsLoaded:f,componentRefs:C}=yield this.customMarkupService.buildElement(e);return this.dynamicComponentRefs=C,yield f,this.loadElement(t)})}destroyDynamicComponents(){for(let n of this.dynamicComponentRefs)n.destroy();this.dynamicComponentRefs=[];}loadElement(n){this.contentWrapper().nativeElement.appendChild(n),this.displayed=true;}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=Pa({type:o,selectors:[["my-custom-markup-container"]],viewQuery:function(e,t){e&1&&px(t.contentWrapper,h,5),e&2&&IV();},inputs:{content:[1,"content"]},features:[ti],decls:2,vars:1,consts:[["contentWrapper",""],[1,"custom-markup-container",3,"hidden"]],template:function(e,t){e&1&&j0(0,"div",1,0),e&2&&q0("hidden",!t.displayed);},encapsulation:2,changeDetection:1})}return o})();/**i18n:c8855ca17fb20171aa9dd43d012e42547cb1f0cfd9c21d4dc05679bbbdf5ccb8*/export{k};//# sourceMappingURL=chunk-D96J2PBK.js.map
