import{b as h}from"./chunk-NZQWX3GH.js";import{Ab as d,Ec as f,Fc as y,Na as p,Rb as u,Sb as l,ba as s,ra as c,sb as m}from"./chunk-OTZZLUAJ.js";import{i as r,j as a}from"./chunk-XYZYVFXE.js";var g=["contentWrapper"],W=(()=>{let t=class t{customMarkupService=s(h);contentWrapper=y("contentWrapper");content=f(void 0);displayed=!1;dynamicComponentRefs=[];ngOnChanges(){return a(this,null,function*(){yield this.rebuild()})}ngOnDestroy(){this.destroyDynamicComponents()}rebuild(){return a(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:o,componentsLoaded:v,componentRefs:C}=yield this.customMarkupService.buildElement(e);return this.dynamicComponentRefs=C,yield v,this.loadElement(o)})}destroyDynamicComponents(){for(let n of this.dynamicComponentRefs)n.destroy();this.dynamicComponentRefs=[]}loadElement(n){this.contentWrapper().nativeElement.appendChild(n),this.displayed=!0}};r(t,"\u0275fac",function(e){return new(e||t)}),r(t,"\u0275cmp",p({type:t,selectors:[["my-custom-markup-container"]],viewQuery:function(e,o){e&1&&u(o.contentWrapper,g,5),e&2&&l()},inputs:{content:[1,"content"]},features:[c],decls:2,vars:1,consts:[["contentWrapper",""],[1,"custom-markup-container",3,"hidden"]],template:function(e,o){e&1&&m(0,"div",1,0),e&2&&d("hidden",!o.displayed)},encapsulation:2}));let i=t;return i})();export{W as a};
/**i18n:4caeb8e7a09648a9cf35d6229af8a685b503a6e2123779e5b0c4fb7602981338*/
//# sourceMappingURL=chunk-BCCFQEB2.js.map
