import{isEmpty}from"../../base/helpers.mjs";import{FormView}from"../../view/forms/base.mjs";import{TextInputView}from"../../view/forms/input.mjs";import{Controller}from"../base.mjs";class PromptsForm extends FormView{static autoSubmit=!0;static fieldSets={Prompts:{prompt:{label:"Prompt",class:TextInputView},negativePrompt:{label:"Negative Prompt",class:TextInputView}}}}class PromptsController extends Controller{getState(){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 PromptsForm(this.config),this.promptsForm.onSubmit((async t=>{this.engine.prompt=t.prompt,this.engine.negativePrompt=t.negativePrompt})),this.application.sidebar.addChild(this.promptsForm)}}export{PromptsController as SidebarController};
