import{isEmpty}from"../../base/helpers.mjs";import{Controller}from"../base.mjs";import{PromptsFormView}from"../../forms/enfugue/prompts.mjs";class PromptsController extends Controller{getState(t=!0){return{prompts:this.promptsForm.values}}getDefaultState(){return{prompts:{prompt:null,negativePrompt:null}}}setState(t){this.promptsForm.setValues(t.prompts).then((()=>this.promptsForm.submit()))}async initialize(){this.promptsForm=new PromptsFormView(this.config),this.promptsForm.onSubmit((async t=>{this.engine.prompt=t.prompt,this.engine.negativePrompt=t.negativePrompt})),this.promptsForm.onShortcutSubmit((()=>{this.application.publish("tryInvoke")})),this.application.sidebar.addChild(this.promptsForm)}}export{PromptsController as SidebarController};
