var TcHmi;!function(TcHmi){let Controls;!function(Controls){let Beckhoff;!function(Beckhoff){class TcHmiIFrame extends TcHmi.Controls.System.TcHmiControl{constructor(element,pcElement,attrs){super(element,pcElement,attrs),this.__loadHandler=this.__onLoad()}__previnit(){if(this.__elementTemplateRoot=this.__element.find(".TcHmi_Controls_Beckhoff_TcHmiIFrame-template"),0===this.__elementTemplateRoot.length&&(this.__elementTemplateRoot=this.__element.find(".tchmi-iframe-template")),this.__elementFrame=this.__elementTemplateRoot.find(".TcHmi_Controls_Beckhoff_TcHmiIFrame-template-frame"),0===this.__elementFrame.length&&(this.__elementFrame=this.__elementTemplateRoot.find(".tchmi-iframe-template-frame")),0===this.__elementTemplateRoot.length||0===this.__elementFrame.length)throw new Error("Invalid Template.html");super.__previnit()}__init(){super.__init();this.__elementFrame[0].addEventListener("load",this.__loadHandler,!!TCHMI_EVENT_OPTION_OBJECT_SUPPORTED&&{passive:!0,capture:!1})}__attach(){super.__attach(),this.__processSrc()}__detach(){super.__detach()}destroy(){if(this.__keepAlive)return;super.destroy();this.__elementFrame[0].removeEventListener("load",this.__loadHandler,!!TCHMI_EVENT_OPTION_OBJECT_SUPPORTED&&{passive:!0,capture:!1})}setSrc(valueNew){let convertedValue=TcHmi.ValueConverter.toString(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("Src")),convertedValue!==this.__src&&(this.__src=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"Src"}),this.__processSrc())}getSrc(){return this.__src}__processSrc(){const iframeObj=this.__elementFrame[0];TCHMI_DESIGNER?this.__isAttached&&iframeObj.contentDocument&&(this.__src?iframeObj.contentDocument.body.innerHTML='<div style="font-style:italic;">'+this.__src+"</div>":iframeObj.contentDocument.body.innerHTML='<div style="font-style:italic;">TcHmiIframe not configured.<br>Please set the src attribute.<div>'):this.__src&&TcHmi.Access.checkAccess(this,"observe")&&this.getIsEnabled()?iframeObj.getAttribute("src")!==this.__src&&(iframeObj.src=this.__src):""!==iframeObj.getAttribute("src")&&(iframeObj.src="")}__processAccessConfig(){super.__processAccessConfig(),this.__processSrc()}__processIsEnabled(){super.__processIsEnabled(),this.__processSrc()}__onLoad(){return e=>{this.getIsEnabled()&&(this.__processWidth(),this.__processHeight(),TcHmi.EventProvider.raise(this.__id+".onLoad",e))}}}Beckhoff.TcHmiIFrame=TcHmiIFrame}(Beckhoff=Controls.Beckhoff||(Controls.Beckhoff={}))}(Controls=TcHmi.Controls||(TcHmi.Controls={}))}(TcHmi||(TcHmi={})),TcHmi.Controls.registerEx("TcHmiIFrame","TcHmi.Controls.Beckhoff",TcHmi.Controls.Beckhoff.TcHmiIFrame);