import{s as b,T as f,c as g,a as n,b as s,t as l,w as h,d,v as c,u as t,f as m,g as v,o as y,h as P}from"./app-f0fa1d4d.js";import{_ as x}from"./SpinnerBtn-17822d7e.js";import{_ as p}from"./InputFieldError-0e4ea242.js";import{_ as w}from"./AdminLayout-196336a1.js";import{_ as U}from"./PageHeader-1622a4ec.js";const V={class:"container flex-grow p-4 sm:p-6"},j={class:"mx-auto lg:w-9/12"},k={class:"card-title mb-2"},E={class:"card card-body"},T={class:"mb-2"},$={class:"label mb-1"},B={class:"mb-2"},C={class:"label mb-1"},D={class:"card card-body"},M={class:"mb-2"},N={class:"label mb-1"},S={class:"text-yellow-400"},O=s("code",null,"[]",-1),q={class:"flex items-end justify-between"},z={class:"w-80"},A={for:"toggle-featured",class:"toggle toggle-sm"},F=s("div",{class:"toggle-body"},null,-1),G={class:"label label-md capitalize"},H={class:"flex flex-col justify-end"},R=Object.assign({layout:w},{__name:"Edit",props:{promptPreset:{type:Object,required:!0}},setup(u){const r=u;b();const e=f({title:r.promptPreset.title||"",description:r.promptPreset.description||"",icon:r.promptPreset.icon||"",status:r.promptPreset.status||"",prompt:r.promptPreset.prompt||"",meta:r.promptPreset.meta||{},_method:"PUT"}),_=()=>{e.post(route("admin.videoai.prompt-preset.update",r.promptPreset.id),{onSuccess:()=>{P.success(trans("Prompt Preset updated successfully"))}})};return(o,a)=>(y(),g("main",V,[n(U),s("div",j,[s("h3",k,l(o.trans("Edit Prompt Preset")),1),s("form",{onSubmit:h(_,["prevent"]),class:"space-y-6"},[s("div",E,[s("div",T,[s("label",$,l(o.trans("Title")),1),d(s("input",{type:"text","onUpdate:modelValue":a[0]||(a[0]=i=>t(e).title=i),class:"input"},null,512),[[c,t(e).title]]),n(p,{message:t(e).errors.title},null,8,["message"])]),s("div",B,[s("label",C,l(o.trans("Description")),1),d(s("textarea",{"onUpdate:modelValue":a[1]||(a[1]=i=>t(e).description=i),class:"textarea"},null,512),[[c,t(e).description]]),n(p,{message:t(e).errors.description},null,8,["message"])])]),s("div",D,[s("div",M,[s("label",N,l(o.trans("Custom Prompt")),1),d(s("textarea",{"onUpdate:modelValue":a[2]||(a[2]=i=>t(e).prompt=i),ref:"bodyEl",class:"textarea"},null,512),[[c,t(e).prompt]]),n(p,{message:t(e).errors.prompt},null,8,["message"]),s("small",S,[m(" * "+l(o.trans("Use"))+" ",1),O,m(" "+l(o.trans("for subject or action replacement. Example:"))+" ",1),s("code",null,l(o.trans("A [subject] walking in the [action]")),1)])]),s("div",q,[s("div",z,[s("label",A,[d(s("input",{"onUpdate:modelValue":a[3]||(a[3]=i=>t(e).status=i),"true-value":"active","false-value":"inactive",class:"toggle-input peer sr-only",id:"toggle-featured",type:"checkbox"},null,512),[[v,t(e).status]]),F,s("span",G,l(t(e).status),1)]),n(p,{message:t(e).errors.status},null,8,["message"])]),s("div",H,[n(x,{processing:t(e).processing,"btn-text":o.trans("Update")},null,8,["processing","btn-text"])])])])],32)])]))}});export{R as default};
