import{_ as y}from"./DjBR_KiW.js";import{e as x,c as r,d as V,t as v,h as i,a as o,m as c,f as a,b as w,y as u,am as _,D as g,z as C,H as B,i as M,G as N,o as n,E as D,_ as E}from"./DpdQcRr7.js";const I={class:"markdown-editor"},T={key:0,class:"label"},q={key:0,class:"has-text-danger"},z={class:"editor-tabs"},S={class:"editor-area"},$=["placeholder","rows"],G={class:"preview-area"},H={key:1,class:"preview-empty"},R={key:1,class:"help is-danger"},U=x({__name:"MarkdownEditor",props:{modelValue:{},placeholder:{default:"Markdownで記述できます..."},rows:{default:10},label:{default:""},required:{type:Boolean,default:!1},error:{default:""}},emits:["update:modelValue"],setup(t,{emit:b}){const h=t,f=b,s=M("edit"),l=N({get:()=>h.modelValue,set:m=>f("update:modelValue",m)});return(m,e)=>{const p=D("Icon"),k=y;return n(),r("div",I,[t.label?(n(),r("label",T,[V(v(t.label)+" ",1),t.required?(n(),r("span",q,"*")):i("",!0)])):i("",!0),o("div",{class:c(["editor-container",{"has-error":t.error}])},[o("div",z,[o("button",{type:"button",class:c(["tab-btn",{active:a(s)==="edit"}]),onClick:e[0]||(e[0]=d=>s.value="edit")},[w(p,{icon:"mdi:pencil",width:14,height:14}),e[3]||(e[3]=o("span",null,"編集",-1))],2),o("button",{type:"button",class:c(["tab-btn",{active:a(s)==="preview"}]),onClick:e[1]||(e[1]=d=>s.value="preview")},[w(p,{icon:"mdi:eye",width:14,height:14}),e[4]||(e[4]=o("span",null,"プレビュー",-1))],2)]),u(o("div",S,[u(o("textarea",{"onUpdate:modelValue":e[2]||(e[2]=d=>g(l)?l.value=d:null),class:"editor-textarea",placeholder:t.placeholder,rows:t.rows},null,8,$),[[C,a(l)]])],512),[[_,a(s)==="edit"]]),u(o("div",G,[a(l)?(n(),B(k,{key:0,content:a(l)},null,8,["content"])):(n(),r("p",H,"プレビューする内容がありません"))],512),[[_,a(s)==="preview"]])],2),t.error?(n(),r("p",R,v(t.error),1)):i("",!0)])}}}),F=E(U,[["__scopeId","data-v-121c8847"]]);export{F as _};
