import{j as e}from"./ui-vendor-Cn57k9R1.js";import{u as l,i as r,a as h,E as x}from"./editor-vendor-BA3QzDsK.js";import{d as i,e as p}from"./index-DT-X9ySe.js";import{L as u}from"./list-CTIwL6TD.js";/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const k=i("Bold",[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",key:"mg9rjx"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const m=i("Heading2",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1",key:"9jr5yi"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const v=i("Heading3",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2",key:"68ncm8"}],["path",{d:"M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2",key:"1ejuhz"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const y=i("Italic",[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const g=i("Link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const j=i("ListOrdered",[["path",{d:"M10 12h11",key:"6m4ad9"}],["path",{d:"M10 18h11",key:"11hvi2"}],["path",{d:"M10 6h11",key:"c7qv1k"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const b=i("Quote",[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const f=i("Redo",[["path",{d:"M21 7v6h-6",key:"3ptur4"}],["path",{d:"M3 17a9 9 0 0 1 9-9 9 9 0 0 1 6 2.3l3 2.7",key:"1kgawr"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const M=i("Undo",[["path",{d:"M3 7v6h6",key:"1v2h90"}],["path",{d:"M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13",key:"1r6uu6"}]]),a=({onClick:c,active:n,children:s,title:t})=>e.jsx("button",{type:"button",onClick:c,title:t,className:p("p-1.5 rounded hover:bg-primary/10 transition-colors",n&&"bg-primary/20 text-primary"),children:s}),q=({content:c,onChange:n,placeholder:s})=>{const t=l({extensions:[r,h.configure({openOnClick:!1})],content:c,onUpdate:({editor:o})=>n(o.getHTML()),editorProps:{attributes:{class:"prose prose-sm max-w-none p-4 min-h-[200px] focus:outline-none font-body",...s?{"data-placeholder":s}:{}}}});if(!t)return null;const d=()=>{const o=window.prompt("Enter URL:");o&&t.chain().focus().setLink({href:o}).run()};return e.jsxs("div",{className:"border border-input rounded-lg overflow-hidden",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-0.5 p-2 border-b border-border bg-muted/30",children:[e.jsx(a,{onClick:()=>t.chain().focus().toggleBold().run(),active:t.isActive("bold"),title:"Bold",children:e.jsx(k,{className:"w-4 h-4"})}),e.jsx(a,{onClick:()=>t.chain().focus().toggleItalic().run(),active:t.isActive("italic"),title:"Italic",children:e.jsx(y,{className:"w-4 h-4"})}),e.jsx("div",{className:"w-px h-5 bg-border mx-1"}),e.jsx(a,{onClick:()=>t.chain().focus().toggleHeading({level:2}).run(),active:t.isActive("heading",{level:2}),title:"Heading 2",children:e.jsx(m,{className:"w-4 h-4"})}),e.jsx(a,{onClick:()=>t.chain().focus().toggleHeading({level:3}).run(),active:t.isActive("heading",{level:3}),title:"Heading 3",children:e.jsx(v,{className:"w-4 h-4"})}),e.jsx("div",{className:"w-px h-5 bg-border mx-1"}),e.jsx(a,{onClick:()=>t.chain().focus().toggleBulletList().run(),active:t.isActive("bulletList"),title:"Bullet List",children:e.jsx(u,{className:"w-4 h-4"})}),e.jsx(a,{onClick:()=>t.chain().focus().toggleOrderedList().run(),active:t.isActive("orderedList"),title:"Numbered List",children:e.jsx(j,{className:"w-4 h-4"})}),e.jsx("div",{className:"w-px h-5 bg-border mx-1"}),e.jsx(a,{onClick:d,active:t.isActive("link"),title:"Link",children:e.jsx(g,{className:"w-4 h-4"})}),e.jsx(a,{onClick:()=>t.chain().focus().toggleBlockquote().run(),active:t.isActive("blockquote"),title:"Quote",children:e.jsx(b,{className:"w-4 h-4"})}),e.jsx("div",{className:"w-px h-5 bg-border mx-1"}),e.jsx(a,{onClick:()=>t.chain().focus().undo().run(),title:"Undo",children:e.jsx(M,{className:"w-4 h-4"})}),e.jsx(a,{onClick:()=>t.chain().focus().redo().run(),title:"Redo",children:e.jsx(f,{className:"w-4 h-4"})})]}),e.jsx(x,{editor:t})]})};export{q as T};
