export default class TargetDetachedDialog extends SDK.SDKModel{constructor(target){super(target);if(target.parentTarget()){return;}
target.registerInspectorDispatcher(this);target.inspectorAgent().enable();this._hideCrashedDialog=null;TargetDetachedDialog._disconnectedScreenWithReasonWasShown=false;}
detached(reason){TargetDetachedDialog._disconnectedScreenWithReasonWasShown=true;UI.RemoteDebuggingTerminatedScreen.show(reason);}
static webSocketConnectionLost(){UI.RemoteDebuggingTerminatedScreen.show(ls`WebSocket disconnected`);}
targetCrashed(){const dialog=new UI.Dialog();dialog.setSizeBehavior(UI.GlassPane.SizeBehavior.MeasureContent);dialog.addCloseButton();dialog.setDimmed(true);this._hideCrashedDialog=dialog.hide.bind(dialog);new UI.TargetCrashedScreen(()=>this._hideCrashedDialog=null).show(dialog.contentElement);dialog.show();}
targetReloadedAfterCrash(){this.target().runtimeAgent().runIfWaitingForDebugger();if(this._hideCrashedDialog){this._hideCrashedDialog.call(null);this._hideCrashedDialog=null;}}}
self.Components=self.Components||{};Components=Components||{};Components.TargetDetachedDialog=TargetDetachedDialog;SDK.SDKModel.register(TargetDetachedDialog,SDK.Target.Capability.Inspector,true);