import {C as Cn}from'./chunk-CUM9Q6LE.js';import {g,w as wpe,L as qp,aE as L,b as Pa,ad as ti,c6 as H0,ck as W0,f as fx,c as DV}from'./main-BiUBeaMj.js';var h=["contentWrapper"],k=(()=>{class o{customMarkupService=g(Cn);contentWrapper=wpe("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&&fx(t.contentWrapper,h,5),e&2&&DV();},inputs:{content:[1,"content"]},features:[ti],decls:2,vars:1,consts:[["contentWrapper",""],[1,"custom-markup-container",3,"hidden"]],template:function(e,t){e&1&&H0(0,"div",1,0),e&2&&W0("hidden",!t.displayed);},encapsulation:2,changeDetection:1})}return o})();/**i18n:fad79908930cbb4c308e7550a5fe49bb3841dbb330066a6429aebaa006173605*/export{k};//# sourceMappingURL=chunk-CLPKPp55.js.map
