import{d as h,aa as x,w,i as _,j as e,aC as b,t as s,C,c as u,g as P,J as l,_ as N,P as B,B as k,am as y,Q as D}from"./index-DOFLUERq.js";import{_ as S}from"./_plugin-vue_export-helper-DlAUqK2U.js";const M={class:"dialog-content"},V={class:"form-field"},A={class:"field-label"},E=h({__name:"ParagraphDialog",props:{show:{type:Boolean},values:{}},emits:["update:show","submit"],setup(c,{emit:m}){const o=c,p=m,v=x(),i=u({get:()=>o.show,set:t=>p("update:show",t)}),n=u(()=>!!o.values?.name),a=D({text:"",name:""});w(()=>o.show,t=>{t&&(o.values?(a.text=o.values.text||"",a.name=o.values.name||""):(a.text="",a.name=""))},{immediate:!0});function f(){if(!a.text.trim())return v.error(s("Please enter paragraph text")),!1;const t={...a};return!n.value&&!t.name&&(t.name=`paragraph-${Math.random().toString(36).substring(2,12)}`),p("submit",t),i.value=!1,!0}function g(){i.value=!1}return(t,r)=>(P(),_(e(b),{show:i.value,"onUpdate:show":r[1]||(r[1]=d=>i.value=d),preset:"dialog",title:n.value?e(s)("Edit Paragraph"):e(s)("Add Paragraph"),"positive-text":n.value?e(s)("Save"):e(s)("Add"),"negative-text":e(s)("Cancel"),onPositiveClick:f,onNegativeClick:g,style:{width:"500px"}},{default:C(()=>[l("div",M,[l("div",V,[l("label",A,[N(B(e(s)("Paragraph Text"))+" ",1),r[2]||(r[2]=l("span",{class:"required"},"*",-1))]),k(e(y),{value:a.text,"onUpdate:value":r[0]||(r[0]=d=>a.text=d),type:"textarea",rows:4,placeholder:e(s)("Enter paragraph text")},null,8,["value","placeholder"])])])]),_:1},8,["show","title","positive-text","negative-text"]))}}),U=S(E,[["__scopeId","data-v-9fb688fc"]]);export{U as default};
