import{o as F}from"./chunk-C6uGsfWa.js";import{Ja as g,Jn as Nhe,Wi as _$,_s as ph,bc as wx,fa as bx,hi as Wx,s as $a,ya as ci}from"./chunk-b0nJCs5_.js";import{n as we}from"./chunk-DHglb9jS2.js";var v=[`contentWrapper`];var y=class a{customMarkupService=g(we);contentWrapper=Nhe(`contentWrapper`);content=ph(void 0);displayed=!1;dynamicComponentRefs=[];ngOnChanges(){return F(this,null,function*(){yield this.rebuild()})}ngOnDestroy(){this.destroyDynamicComponents()}rebuild(){return F(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:h}=yield this.customMarkupService.buildElement(e);return this.dynamicComponentRefs=h,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=!0}static ɵfac=function(e){return new(e||a)};static ɵcmp=$a({type:a,selectors:[[`my-custom-markup-container`]],viewQuery:function(e,t){e&1&&Wx(t.contentWrapper,v,5),e&2&&_$()},inputs:{content:[1,`content`]},features:[ci],decls:2,vars:1,consts:[[`contentWrapper`,``],[1,`custom-markup-container`,3,`hidden`]],template:function(e,t){e&1&&bx(0,`div`,1,0),e&2&&wx(`hidden`,!t.displayed)},encapsulation:2,changeDetection:1})};export{y as t};
//# debugId=4e998a4c-d8c3-513c-ab95-7b716d495312
//# sourceMappingURL=chunk-CXPBI-LG.js.map