@clickcns/vmedic-react 0.0.6 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cjs/ui/index.js
CHANGED
|
@@ -150,5 +150,5 @@ ${p.slice(c+2)}`,u+=1;else break}e.push({indent:c,number:parseInt(a,10),content:
|
|
|
150
150
|
`):"",markdownTokenizer:{name:"orderedList",level:"block",start:n=>{const e=n.match(/^(\s*)(\d+)\.\s+/),t=e?.index;return t!==void 0?t:-1},tokenize:(n,e,t)=>{var r;const o=n.split(`
|
|
151
151
|
`),[s,i]=y1(o);if(s.length===0)return;const a=ph(s,0,t);return a.length===0?void 0:{type:"list",ordered:!0,start:((r=s[0])==null?void 0:r.number)||1,items:a,raw:o.slice(0,i).join(`
|
|
152
152
|
`)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:n,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(x1,this.editor.getAttributes(Xl)).run():n.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let n=Dn({find:Yl,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(n=Dn({find:Yl,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(Xl)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[n]}}),w1=/^\s*(\[([( |x])?\])\s$/,k1=ve.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:n=>{const e=n.getAttribute("data-checked");return e===""||e==="true"},renderHTML:n=>({"data-checked":n.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:n,HTMLAttributes:e}){return["li",re(this.options.HTMLAttributes,e,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:n.attrs.checked?"checked":null}],["span"]],["div",0]]},parseMarkdown:(n,e)=>{const t=[];if(n.tokens&&n.tokens.length>0?t.push(e.createNode("paragraph",{},e.parseInline(n.tokens))):n.text?t.push(e.createNode("paragraph",{},[e.createNode("text",{text:n.text})])):t.push(e.createNode("paragraph",{},[])),n.nestedTokens&&n.nestedTokens.length>0){const r=e.parseChildren(n.nestedTokens);t.push(...r)}return e.createNode("taskItem",{checked:n.checked||!1},t)},renderMarkdown:(n,e)=>{var t;const r=`- [${(t=n.attrs)!=null&&t.checked?"x":" "}] `;return Xi(n,e,r)},addKeyboardShortcuts(){const n={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...n,Tab:()=>this.editor.commands.sinkListItem(this.name)}:n},addNodeView(){return({node:n,HTMLAttributes:e,getPos:t,editor:r})=>{const o=document.createElement("li"),s=document.createElement("label"),i=document.createElement("span"),a=document.createElement("input"),l=document.createElement("div"),c=d=>{var u,h;a.ariaLabel=((h=(u=this.options.a11y)==null?void 0:u.checkboxLabel)==null?void 0:h.call(u,d,a.checked))||`Task item checkbox for ${d.textContent||"empty task item"}`};return c(n),s.contentEditable="false",a.type="checkbox",a.addEventListener("mousedown",d=>d.preventDefault()),a.addEventListener("change",d=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){a.checked=!a.checked;return}const{checked:u}=d.target;r.isEditable&&typeof t=="function"&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:h})=>{const p=t();if(typeof p!="number")return!1;const f=h.doc.nodeAt(p);return h.setNodeMarkup(p,void 0,{...f?.attrs,checked:u}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(n,u)||(a.checked=!a.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([d,u])=>{o.setAttribute(d,u)}),o.dataset.checked=n.attrs.checked,a.checked=n.attrs.checked,s.append(a,i),o.append(s,l),Object.entries(e).forEach(([d,u])=>{o.setAttribute(d,u)}),{dom:o,contentDOM:l,update:d=>d.type!==this.type?!1:(o.dataset.checked=d.attrs.checked,a.checked=d.attrs.checked,c(d),!0)}}},addInputRules(){return[Dn({find:w1,type:this.type,getAttributes:n=>({checked:n[n.length-1]==="x"})})]}}),v1=ve.create({name:"taskList",addOptions(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:n}){return["ul",re(this.options.HTMLAttributes,n,{"data-type":this.name}),0]},parseMarkdown:(n,e)=>e.createNode("taskList",{},e.parseChildren(n.items||[])),renderMarkdown:(n,e)=>n.content?e.renderChildren(n.content,`
|
|
153
|
-
`):"",markdownTokenizer:{name:"taskList",level:"block",start(n){var e;const t=(e=n.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))==null?void 0:e.index;return t!==void 0?t:-1},tokenize(n,e,t){const r=s=>{const i=ei(s,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:a=>({indentLevel:a[1].length,mainContent:a[4],checked:a[3].toLowerCase()==="x"}),createToken:(a,l)=>({type:"taskItem",raw:"",mainContent:a.mainContent,indentLevel:a.indentLevel,checked:a.checked,text:a.mainContent,tokens:t.inlineTokens(a.mainContent),nestedTokens:l}),customNestedParser:r},t);return i?[{type:"taskList",raw:i.raw,items:i.items}]:t.blockTokens(s)},o=ei(n,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:s=>({indentLevel:s[1].length,mainContent:s[4],checked:s[3].toLowerCase()==="x"}),createToken:(s,i)=>({type:"taskItem",raw:"",mainContent:s.mainContent,indentLevel:s.indentLevel,checked:s.checked,text:s.mainContent,tokens:t.inlineTokens(s.mainContent),nestedTokens:i}),customNestedParser:r},t);if(o)return{type:"taskList",raw:o.raw,items:o.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:n})=>n.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});te.create({name:"listKit",addExtensions(){const n=[];return this.options.bulletList!==!1&&n.push(sh.configure(this.options.bulletList)),this.options.listItem!==!1&&n.push(ih.configure(this.options.listItem)),this.options.listKeymap!==!1&&n.push(hh.configure(this.options.listKeymap)),this.options.orderedList!==!1&&n.push(fh.configure(this.options.orderedList)),this.options.taskItem!==!1&&n.push(k1.configure(this.options.taskItem)),this.options.taskList!==!1&&n.push(v1.configure(this.options.taskList)),n}});var S1=ve.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:n}){return["p",re(this.options.HTMLAttributes,n),0]},parseMarkdown:(n,e)=>{const t=n.tokens||[];return t.length===1&&t[0].type==="image"?e.parseChildren([t[0]]):e.createNode("paragraph",void 0,e.parseInline(t))},renderMarkdown:(n,e)=>!n||!Array.isArray(n.content)?"":e.renderChildren(n.content),addCommands(){return{setParagraph:()=>({commands:n})=>n.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),C1=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,M1=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,E1=wt.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:n=>n.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["s",re(this.options.HTMLAttributes,n),0]},markdownTokenName:"del",parseMarkdown:(n,e)=>e.applyMark("strike",e.parseInline(n.tokens||[])),renderMarkdown:(n,e)=>`~~${e.renderChildren(n)}~~`,addCommands(){return{setStrike:()=>({commands:n})=>n.setMark(this.name),toggleStrike:()=>({commands:n})=>n.toggleMark(this.name),unsetStrike:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[sn({find:C1,type:this.type})]},addPasteRules(){return[Ht({find:M1,type:this.type})]}}),T1=ve.create({name:"text",group:"inline",parseMarkdown:n=>({type:"text",text:n.text||""}),renderMarkdown:n=>n.text||""});function N1(n={}){return new le({view(e){return new A1(e,n)}})}class A1{constructor(e,t){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=t.width)!==null&&r!==void 0?r:1,this.color=t.color===!1?void 0:t.color||"black",this.class=t.class,this.handlers=["dragover","dragend","drop","dragleave"].map(o=>{let s=i=>{this[o](i)};return e.dom.addEventListener(o,s),{name:o,handler:s}})}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){this.cursorPos!=null&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),t=!e.parent.inlineContent,r,o=this.editorView.dom,s=o.getBoundingClientRect(),i=s.width/o.offsetWidth,a=s.height/o.offsetHeight;if(t){let u=e.nodeBefore,h=e.nodeAfter;if(u||h){let p=this.editorView.nodeDOM(this.cursorPos-(u?u.nodeSize:0));if(p){let f=p.getBoundingClientRect(),m=u?f.bottom:f.top;u&&h&&(m=(m+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let g=this.width/2*a;r={left:f.left,right:f.right,top:m-g,bottom:m+g}}}}if(!r){let u=this.editorView.coordsAtPos(this.cursorPos),h=this.width/2*i;r={left:u.left-h,right:u.left+h,top:u.top,bottom:u.bottom}}let l=this.editorView.dom.offsetParent;this.element||(this.element=l.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",t),this.element.classList.toggle("prosemirror-dropcursor-inline",!t);let c,d;if(!l||l==document.body&&getComputedStyle(l).position=="static")c=-pageXOffset,d=-pageYOffset;else{let u=l.getBoundingClientRect(),h=u.width/l.offsetWidth,p=u.height/l.offsetHeight;c=u.left-l.scrollLeft*h,d=u.top-l.scrollTop*p}this.element.style.left=(r.left-c)/i+"px",this.element.style.top=(r.top-d)/a+"px",this.element.style.width=(r.right-r.left)/i+"px",this.element.style.height=(r.bottom-r.top)/a+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),o=r&&r.type.spec.disableDropCursor,s=typeof o=="function"?o(this.editorView,t,e):o;if(t&&!s){let i=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let a=Zc(this.editorView.state.doc,i,this.editorView.dragging.slice);a!=null&&(i=a)}this.setCursor(i),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}class de extends W{constructor(e){super(e,e)}map(e,t){let r=e.resolve(t.map(this.head));return de.valid(r)?new de(r):W.near(r)}content(){return O.empty}eq(e){return e instanceof de&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new de(e.resolve(t.pos))}getBookmark(){return new la(this.anchor)}static valid(e){let t=e.parent;if(t.isTextblock||!O1(e)||!R1(e))return!1;let r=t.type.spec.allowGapCursor;if(r!=null)return r;let o=t.contentMatchAt(e.index()).defaultType;return o&&o.isTextblock}static findGapCursorFrom(e,t,r=!1){e:for(;;){if(!r&&de.valid(e))return e;let o=e.pos,s=null;for(let i=e.depth;;i--){let a=e.node(i);if(t>0?e.indexAfter(i)<a.childCount:e.index(i)>0){s=a.child(t>0?e.indexAfter(i):e.index(i)-1);break}else if(i==0)return null;o+=t;let l=e.doc.resolve(o);if(de.valid(l))return l}for(;;){let i=t>0?s.firstChild:s.lastChild;if(!i){if(s.isAtom&&!s.isText&&!I.isSelectable(s)){e=e.doc.resolve(o+s.nodeSize*t),r=!1;continue e}break}s=i,o+=t;let a=e.doc.resolve(o);if(de.valid(a))return a}return null}}}de.prototype.visible=!1;de.findFrom=de.findGapCursorFrom;W.jsonID("gapcursor",de);class la{constructor(e){this.pos=e}map(e){return new la(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return de.valid(t)?new de(t):W.near(t)}}function mh(n){return n.isAtom||n.spec.isolating||n.spec.createGapCursor}function O1(n){for(let e=n.depth;e>=0;e--){let t=n.index(e),r=n.node(e);if(t==0){if(r.type.spec.isolating)return!0;continue}for(let o=r.child(t-1);;o=o.lastChild){if(o.childCount==0&&!o.inlineContent||mh(o.type))return!0;if(o.inlineContent)return!1}}return!0}function R1(n){for(let e=n.depth;e>=0;e--){let t=n.indexAfter(e),r=n.node(e);if(t==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let o=r.child(t);;o=o.firstChild){if(o.childCount==0&&!o.inlineContent||mh(o.type))return!0;if(o.inlineContent)return!1}}return!0}function D1(){return new le({props:{decorations:$1,createSelectionBetween(n,e,t){return e.pos==t.pos&&de.valid(t)?new de(t):null},handleClick:L1,handleKeyDown:j1,handleDOMEvents:{beforeinput:z1}}})}const j1=Pi({ArrowLeft:jr("horiz",-1),ArrowRight:jr("horiz",1),ArrowUp:jr("vert",-1),ArrowDown:jr("vert",1)});function jr(n,e){const t=n=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,o,s){let i=r.selection,a=e>0?i.$to:i.$from,l=i.empty;if(i instanceof H){if(!s.endOfTextblock(t)||a.depth==0)return!1;l=!1,a=r.doc.resolve(e>0?a.after():a.before())}let c=de.findGapCursorFrom(a,e,l);return c?(o&&o(r.tr.setSelection(new de(c))),!0):!1}}function L1(n,e,t){if(!n||!n.editable)return!1;let r=n.state.doc.resolve(e);if(!de.valid(r))return!1;let o=n.posAtCoords({left:t.clientX,top:t.clientY});return o&&o.inside>-1&&I.isSelectable(n.state.doc.nodeAt(o.inside))?!1:(n.dispatch(n.state.tr.setSelection(new de(r))),!0)}function z1(n,e){if(e.inputType!="insertCompositionText"||!(n.state.selection instanceof de))return!1;let{$from:t}=n.state.selection,r=t.parent.contentMatchAt(t.index()).findWrapping(n.state.schema.nodes.text);if(!r)return!1;let o=M.empty;for(let i=r.length-1;i>=0;i--)o=M.from(r[i].createAndFill(null,o));let s=n.state.tr.replace(t.pos,t.pos,new O(o,0,0));return s.setSelection(H.near(s.doc.resolve(t.pos+1))),n.dispatch(s),!1}function $1(n){if(!(n.selection instanceof de))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",se.create(n.doc,[xe.widget(n.selection.head,e,{key:"gapcursor"})])}var Oo=200,ke=function(){};ke.prototype.append=function(n){return n.length?(n=ke.from(n),!this.length&&n||n.length<Oo&&this.leafAppend(n)||this.length<Oo&&n.leafPrepend(this)||this.appendInner(n)):this};ke.prototype.prepend=function(n){return n.length?ke.from(n).append(this):this};ke.prototype.appendInner=function(n){return new I1(this,n)};ke.prototype.slice=function(n,e){return n===void 0&&(n=0),e===void 0&&(e=this.length),n>=e?ke.empty:this.sliceInner(Math.max(0,n),Math.min(this.length,e))};ke.prototype.get=function(n){if(!(n<0||n>=this.length))return this.getInner(n)};ke.prototype.forEach=function(n,e,t){e===void 0&&(e=0),t===void 0&&(t=this.length),e<=t?this.forEachInner(n,e,t,0):this.forEachInvertedInner(n,e,t,0)};ke.prototype.map=function(n,e,t){e===void 0&&(e=0),t===void 0&&(t=this.length);var r=[];return this.forEach(function(o,s){return r.push(n(o,s))},e,t),r};ke.from=function(n){return n instanceof ke?n:n&&n.length?new gh(n):ke.empty};var gh=(function(n){function e(r){n.call(this),this.values=r}n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e;var t={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(r,o){return r==0&&o==this.length?this:new e(this.values.slice(r,o))},e.prototype.getInner=function(r){return this.values[r]},e.prototype.forEachInner=function(r,o,s,i){for(var a=o;a<s;a++)if(r(this.values[a],i+a)===!1)return!1},e.prototype.forEachInvertedInner=function(r,o,s,i){for(var a=o-1;a>=s;a--)if(r(this.values[a],i+a)===!1)return!1},e.prototype.leafAppend=function(r){if(this.length+r.length<=Oo)return new e(this.values.concat(r.flatten()))},e.prototype.leafPrepend=function(r){if(this.length+r.length<=Oo)return new e(r.flatten().concat(this.values))},t.length.get=function(){return this.values.length},t.depth.get=function(){return 0},Object.defineProperties(e.prototype,t),e})(ke);ke.empty=new gh([]);var I1=(function(n){function e(t,r){n.call(this),this.left=t,this.right=r,this.length=t.length+r.length,this.depth=Math.max(t.depth,r.depth)+1}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(t){return t<this.left.length?this.left.get(t):this.right.get(t-this.left.length)},e.prototype.forEachInner=function(t,r,o,s){var i=this.left.length;if(r<i&&this.left.forEachInner(t,r,Math.min(o,i),s)===!1||o>i&&this.right.forEachInner(t,Math.max(r-i,0),Math.min(this.length,o)-i,s+i)===!1)return!1},e.prototype.forEachInvertedInner=function(t,r,o,s){var i=this.left.length;if(r>i&&this.right.forEachInvertedInner(t,r-i,Math.max(o,i)-i,s+i)===!1||o<i&&this.left.forEachInvertedInner(t,Math.min(r,i),o,s)===!1)return!1},e.prototype.sliceInner=function(t,r){if(t==0&&r==this.length)return this;var o=this.left.length;return r<=o?this.left.slice(t,r):t>=o?this.right.slice(t-o,r-o):this.left.slice(t,o).append(this.right.slice(0,r-o))},e.prototype.leafAppend=function(t){var r=this.right.leafAppend(t);if(r)return new e(this.left,r)},e.prototype.leafPrepend=function(t){var r=this.left.leafPrepend(t);if(r)return new e(r,this.right)},e.prototype.appendInner=function(t){return this.left.depth>=Math.max(this.right.depth,t.depth)+1?new e(this.left,new e(this.right,t)):new e(this,t)},e})(ke);const P1=500;class Qe{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let o,s;t&&(o=this.remapping(r,this.items.length),s=o.maps.length);let i=e.tr,a,l,c=[],d=[];return this.items.forEach((u,h)=>{if(!u.step){o||(o=this.remapping(r,h+1),s=o.maps.length),s--,d.push(u);return}if(o){d.push(new st(u.map));let p=u.step.map(o.slice(s)),f;p&&i.maybeStep(p).doc&&(f=i.mapping.maps[i.mapping.maps.length-1],c.push(new st(f,void 0,void 0,c.length+d.length))),s--,f&&o.appendMap(f,s)}else i.maybeStep(u.step);if(u.selection)return a=o?u.selection.map(o.slice(s)):u.selection,l=new Qe(this.items.slice(0,r).append(d.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:i,selection:a}}addTransform(e,t,r,o){let s=[],i=this.eventCount,a=this.items,l=!o&&a.length?a.get(a.length-1):null;for(let d=0;d<e.steps.length;d++){let u=e.steps[d].invert(e.docs[d]),h=new st(e.mapping.maps[d],u,t),p;(p=l&&l.merge(h))&&(h=p,d?s.pop():a=a.slice(0,a.length-1)),s.push(h),t&&(i++,t=void 0),o||(l=h)}let c=i-r.depth;return c>B1&&(a=H1(a,c),i-=c),new Qe(a.append(s),i)}remapping(e,t){let r=new rr;return this.items.forEach((o,s)=>{let i=o.mirrorOffset!=null&&s-o.mirrorOffset>=e?r.maps.length-o.mirrorOffset:void 0;r.appendMap(o.map,i)},e,t),r}addMaps(e){return this.eventCount==0?this:new Qe(this.items.append(e.map(t=>new st(t))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let r=[],o=Math.max(0,this.items.length-t),s=e.mapping,i=e.steps.length,a=this.eventCount;this.items.forEach(h=>{h.selection&&a--},o);let l=t;this.items.forEach(h=>{let p=s.getMirror(--l);if(p==null)return;i=Math.min(i,p);let f=s.maps[p];if(h.step){let m=e.steps[p].invert(e.docs[p]),g=h.selection&&h.selection.map(s.slice(l+1,p));g&&a++,r.push(new st(f,m,g))}else r.push(new st(f))},o);let c=[];for(let h=t;h<i;h++)c.push(new st(s.maps[h]));let d=this.items.slice(0,o).append(c).append(r),u=new Qe(d,a);return u.emptyItemCount()>P1&&(u=u.compress(this.items.length-r.length)),u}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),r=t.maps.length,o=[],s=0;return this.items.forEach((i,a)=>{if(a>=e)o.push(i),i.selection&&s++;else if(i.step){let l=i.step.map(t.slice(r)),c=l&&l.getMap();if(r--,c&&t.appendMap(c,r),l){let d=i.selection&&i.selection.map(t.slice(r));d&&s++;let u=new st(c.invert(),l,d),h,p=o.length-1;(h=o.length&&o[p].merge(u))?o[p]=h:o.push(u)}}else i.map&&r--},this.items.length,0),new Qe(ke.from(o.reverse()),s)}}Qe.empty=new Qe(ke.empty,0);function H1(n,e){let t;return n.forEach((r,o)=>{if(r.selection&&e--==0)return t=o,!1}),n.slice(t)}class st{constructor(e,t,r,o){this.map=e,this.step=t,this.selection=r,this.mirrorOffset=o}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new st(t.getMap().invert(),t,this.selection)}}}class Et{constructor(e,t,r,o,s){this.done=e,this.undone=t,this.prevRanges=r,this.prevTime=o,this.prevComposition=s}}const B1=20;function V1(n,e,t,r){let o=t.getMeta(en),s;if(o)return o.historyState;t.getMeta(_1)&&(n=new Et(n.done,n.undone,null,0,-1));let i=t.getMeta("appendedTransaction");if(t.steps.length==0)return n;if(i&&i.getMeta(en))return i.getMeta(en).redo?new Et(n.done.addTransform(t,void 0,r,Fr(e)),n.undone,Ql(t.mapping.maps),n.prevTime,n.prevComposition):new Et(n.done,n.undone.addTransform(t,void 0,r,Fr(e)),null,n.prevTime,n.prevComposition);if(t.getMeta("addToHistory")!==!1&&!(i&&i.getMeta("addToHistory")===!1)){let a=t.getMeta("composition"),l=n.prevTime==0||!i&&n.prevComposition!=a&&(n.prevTime<(t.time||0)-r.newGroupDelay||!F1(t,n.prevRanges)),c=i?Ts(n.prevRanges,t.mapping):Ql(t.mapping.maps);return new Et(n.done.addTransform(t,l?e.selection.getBookmark():void 0,r,Fr(e)),Qe.empty,c,t.time,a??n.prevComposition)}else return(s=t.getMeta("rebased"))?new Et(n.done.rebased(t,s),n.undone.rebased(t,s),Ts(n.prevRanges,t.mapping),n.prevTime,n.prevComposition):new Et(n.done.addMaps(t.mapping.maps),n.undone.addMaps(t.mapping.maps),Ts(n.prevRanges,t.mapping),n.prevTime,n.prevComposition)}function F1(n,e){if(!e)return!1;if(!n.docChanged)return!0;let t=!1;return n.mapping.maps[0].forEach((r,o)=>{for(let s=0;s<e.length;s+=2)r<=e[s+1]&&o>=e[s]&&(t=!0)}),t}function Ql(n){let e=[];for(let t=n.length-1;t>=0&&e.length==0;t--)n[t].forEach((r,o,s,i)=>e.push(s,i));return e}function Ts(n,e){if(!n)return null;let t=[];for(let r=0;r<n.length;r+=2){let o=e.map(n[r],1),s=e.map(n[r+1],-1);o<=s&&t.push(o,s)}return t}function W1(n,e,t){let r=Fr(e),o=en.get(e).spec.config,s=(t?n.undone:n.done).popEvent(e,r);if(!s)return null;let i=s.selection.resolve(s.transform.doc),a=(t?n.done:n.undone).addTransform(s.transform,e.selection.getBookmark(),o,r),l=new Et(t?a:s.remaining,t?s.remaining:a,null,0,-1);return s.transform.setSelection(i).setMeta(en,{redo:t,historyState:l})}let Ns=!1,Zl=null;function Fr(n){let e=n.plugins;if(Zl!=e){Ns=!1,Zl=e;for(let t=0;t<e.length;t++)if(e[t].spec.historyPreserveItems){Ns=!0;break}}return Ns}const en=new he("history"),_1=new he("closeHistory");function U1(n={}){return n={depth:n.depth||100,newGroupDelay:n.newGroupDelay||500},new le({key:en,state:{init(){return new Et(Qe.empty,Qe.empty,null,0,-1)},apply(e,t,r){return V1(t,r,e,n)}},config:n,props:{handleDOMEvents:{beforeinput(e,t){let r=t.inputType,o=r=="historyUndo"?bh:r=="historyRedo"?xh:null;return!o||!e.editable?!1:(t.preventDefault(),o(e.state,e.dispatch))}}}})}function yh(n,e){return(t,r)=>{let o=en.getState(t);if(!o||(n?o.undone:o.done).eventCount==0)return!1;if(r){let s=W1(o,t,n);s&&r(s.scrollIntoView())}return!0}}const bh=yh(!1),xh=yh(!0);te.create({name:"characterCount",addOptions(){return{limit:null,mode:"textSize",textCounter:n=>n.length,wordCounter:n=>n.split(" ").filter(e=>e!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=n=>{const e=n?.node||this.editor.state.doc;if((n?.mode||this.options.mode)==="textSize"){const t=e.textBetween(0,e.content.size,void 0," ");return this.options.textCounter(t)}return e.nodeSize},this.storage.words=n=>{const e=n?.node||this.editor.state.doc,t=e.textBetween(0,e.content.size," "," ");return this.options.wordCounter(t)}},addProseMirrorPlugins(){let n=!1;return[new le({key:new he("characterCount"),appendTransaction:(e,t,r)=>{if(n)return;const o=this.options.limit;if(o==null||o===0){n=!0;return}const s=this.storage.characters({node:r.doc});if(s>o){const i=s-o,a=0,l=i;console.warn(`[CharacterCount] Initial content exceeded limit of ${o} characters. Content was automatically trimmed.`);const c=r.tr.deleteRange(a,l);return n=!0,c}n=!0},filterTransaction:(e,t)=>{const r=this.options.limit;if(!e.docChanged||r===0||r===null||r===void 0)return!0;const o=this.storage.characters({node:t.doc}),s=this.storage.characters({node:e.doc});if(s<=r||o>r&&s>r&&s<=o)return!0;if(o>r&&s>r&&s>o||!e.getMeta("paste"))return!1;const i=e.selection.$head.pos,a=s-r,l=i-a,c=i;return e.deleteRange(l,c),!(this.storage.characters({node:e.doc})>r)}})]}});var q1=te.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[N1(this.options)]}});te.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new le({key:new he("focus"),props:{decorations:({doc:n,selection:e})=>{const{isEditable:t,isFocused:r}=this.editor,{anchor:o}=e,s=[];if(!t||!r)return se.create(n,[]);let i=0;this.options.mode==="deepest"&&n.descendants((l,c)=>{if(!l.isText){if(!(o>=c&&o<=c+l.nodeSize-1))return!1;i+=1}});let a=0;return n.descendants((l,c)=>{if(l.isText||!(o>=c&&o<=c+l.nodeSize-1))return!1;if(a+=1,this.options.mode==="deepest"&&i-a>0||this.options.mode==="shallowest"&&a>1)return this.options.mode==="deepest";s.push(xe.node(c,c+l.nodeSize,{class:this.options.className}))}),se.create(n,s)}}})]}});var K1=te.create({name:"gapCursor",addProseMirrorPlugins(){return[D1()]},extendNodeSchema(n){var e;const t={name:n.name,options:n.options,storage:n.storage};return{allowGapCursor:(e=Q(P(n,"allowGapCursor",t)))!=null?e:null}}});te.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new le({key:new he("placeholder"),props:{decorations:({doc:n,selection:e})=>{const t=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=e,o=[];if(!t)return null;const s=this.editor.isEmpty;return n.descendants((i,a)=>{const l=r>=a&&r<=a+i.nodeSize,c=!i.isLeaf&&qo(i);if((l||!this.options.showOnlyCurrent)&&c){const d=[this.options.emptyNodeClass];s&&d.push(this.options.emptyEditorClass);const u=xe.node(a,a+i.nodeSize,{class:d.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:i,pos:a,hasAnchor:l}):this.options.placeholder});o.push(u)}return this.options.includeChildren}),se.create(n,o)}}})]}});te.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:n,options:e}=this;return[new le({key:new he("selection"),props:{decorations(t){return t.selection.empty||n.isFocused||!n.isEditable||gu(t.selection)||n.view.dragging?null:se.create(t.doc,[xe.inline(t.selection.from,t.selection.to,{class:e.className})])}}})]}});function ec({types:n,node:e}){return e&&Array.isArray(n)&&n.includes(e.type)||e?.type===n}var J1=te.create({name:"trailingNode",addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){var n;const e=new he(this.name),t=((n=this.editor.schema.topNodeType.contentMatch.defaultType)==null?void 0:n.name)||this.options.node||"paragraph",r=Object.entries(this.editor.schema.nodes).map(([,o])=>o).filter(o=>(this.options.notAfter||[]).concat(t).includes(o.name));return[new le({key:e,appendTransaction:(o,s,i)=>{const{doc:a,tr:l,schema:c}=i,d=e.getState(i),u=a.content.size,h=c.nodes[t];if(d)return l.insert(u,h.create())},state:{init:(o,s)=>{const i=s.tr.doc.lastChild;return!ec({node:i,types:r})},apply:(o,s)=>{if(!o.docChanged||o.getMeta("__uniqueIDTransaction"))return s;const i=o.doc.lastChild;return!ec({node:i,types:r})}}})]}}),G1=te.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:n,dispatch:e})=>bh(n,e),redo:()=>({state:n,dispatch:e})=>xh(n,e)}},addProseMirrorPlugins(){return[U1(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),X1=te.create({name:"starterKit",addExtensions(){var n,e,t,r;const o=[];return this.options.bold!==!1&&o.push(C0.configure(this.options.bold)),this.options.blockquote!==!1&&o.push(x0.configure(this.options.blockquote)),this.options.bulletList!==!1&&o.push(sh.configure(this.options.bulletList)),this.options.code!==!1&&o.push(T0.configure(this.options.code)),this.options.codeBlock!==!1&&o.push(O0.configure(this.options.codeBlock)),this.options.document!==!1&&o.push(R0.configure(this.options.document)),this.options.dropcursor!==!1&&o.push(q1.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&o.push(K1.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&o.push(D0.configure(this.options.hardBreak)),this.options.heading!==!1&&o.push(j0.configure(this.options.heading)),this.options.undoRedo!==!1&&o.push(G1.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&o.push(L0.configure(this.options.horizontalRule)),this.options.italic!==!1&&o.push(H0.configure(this.options.italic)),this.options.listItem!==!1&&o.push(ih.configure(this.options.listItem)),this.options.listKeymap!==!1&&o.push(hh.configure((n=this.options)==null?void 0:n.listKeymap)),this.options.link!==!1&&o.push(d1.configure((e=this.options)==null?void 0:e.link)),this.options.orderedList!==!1&&o.push(fh.configure(this.options.orderedList)),this.options.paragraph!==!1&&o.push(S1.configure(this.options.paragraph)),this.options.strike!==!1&&o.push(E1.configure(this.options.strike)),this.options.text!==!1&&o.push(T1.configure(this.options.text)),this.options.underline!==!1&&o.push(Gu.configure((t=this.options)==null?void 0:t.underline)),this.options.trailingNode!==!1&&o.push(J1.configure((r=this.options)==null?void 0:r.trailingNode)),o}}),Y1=X1,Q1=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,Z1=ve.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:n}){return["img",re(this.options.HTMLAttributes,n)]},parseMarkdown:(n,e)=>e.createNode("image",{src:n.href,title:n.title,alt:n.text}),renderMarkdown:n=>{var e,t,r,o,s,i;const a=(t=(e=n.attrs)==null?void 0:e.src)!=null?t:"",l=(o=(r=n.attrs)==null?void 0:r.alt)!=null?o:"",c=(i=(s=n.attrs)==null?void 0:s.title)!=null?i:"";return c?``:``},addNodeView(){if(!this.options.resize||!this.options.resize.enabled||typeof document>"u"||!this.editor.isEditable)return null;const{directions:n,minWidth:e,minHeight:t,alwaysPreserveAspectRatio:r}=this.options.resize;return({node:o,getPos:s,HTMLAttributes:i})=>{const a=document.createElement("img");Object.entries(i).forEach(([d,u])=>{if(u!=null)switch(d){case"width":case"height":break;default:a.setAttribute(d,u);break}}),a.src=i.src;const l=new Hy({element:a,node:o,getPos:s,onResize:(d,u)=>{a.style.width=`${d}px`,a.style.height=`${u}px`},onCommit:(d,u)=>{const h=s();h!==void 0&&this.editor.chain().setNodeSelection(h).updateAttributes(this.name,{width:d,height:u}).run()},onUpdate:(d,u,h)=>d.type===o.type,options:{directions:n,min:{width:e,height:t},preserveAspectRatio:r===!0}}),c=l.dom;return c.style.visibility="hidden",c.style.pointerEvents="none",a.onload=()=>{c.style.visibility="",c.style.pointerEvents=""},l}},addCommands(){return{setImage:n=>({commands:e})=>e.insertContent({type:this.name,attrs:n})}},addInputRules(){return[Ru({find:Q1,type:this.type,getAttributes:n=>{const[,,e,t,r]=n;return{src:t,alt:e,title:r}}})]}}),ex=Z1,As={exports:{}},Os={},tc;function tx(){if(tc)return Os;tc=1;var n=z;function e(u,h){return u===h&&(u!==0||1/u===1/h)||u!==u&&h!==h}var t=typeof Object.is=="function"?Object.is:e,r=n.useState,o=n.useEffect,s=n.useLayoutEffect,i=n.useDebugValue;function a(u,h){var p=h(),f=r({inst:{value:p,getSnapshot:h}}),m=f[0].inst,g=f[1];return s(function(){m.value=p,m.getSnapshot=h,l(m)&&g({inst:m})},[u,p,h]),o(function(){return l(m)&&g({inst:m}),u(function(){l(m)&&g({inst:m})})},[u]),i(p),p}function l(u){var h=u.getSnapshot;u=u.value;try{var p=h();return!t(u,p)}catch{return!0}}function c(u,h){return h()}var d=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:a;return Os.useSyncExternalStore=n.useSyncExternalStore!==void 0?n.useSyncExternalStore:d,Os}var nc={},rc;function nx(){return rc||(rc=1,process.env.NODE_ENV!=="production"&&(function(){function n(p,f){return p===f&&(p!==0||1/p===1/f)||p!==p&&f!==f}function e(p,f){d||o.startTransition===void 0||(d=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var m=f();if(!u){var g=f();s(m,g)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),u=!0)}g=i({inst:{value:m,getSnapshot:f}});var y=g[0].inst,w=g[1];return l(function(){y.value=m,y.getSnapshot=f,t(y)&&w({inst:y})},[p,m,f]),a(function(){return t(y)&&w({inst:y}),p(function(){t(y)&&w({inst:y})})},[p]),c(m),m}function t(p){var f=p.getSnapshot;p=p.value;try{var m=f();return!s(p,m)}catch{return!0}}function r(p,f){return f()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var o=z,s=typeof Object.is=="function"?Object.is:n,i=o.useState,a=o.useEffect,l=o.useLayoutEffect,c=o.useDebugValue,d=!1,u=!1,h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?r:e;nc.useSyncExternalStore=o.useSyncExternalStore!==void 0?o.useSyncExternalStore:h,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),nc}var oc;function ca(){return oc||(oc=1,process.env.NODE_ENV==="production"?As.exports=tx():As.exports=nx()),As.exports}var wh=ca(),sc,ic;function rx(){return ic||(ic=1,sc=function n(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var r,o,s;if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(o=r;o--!==0;)if(!n(e[o],t[o]))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(o of e.entries())if(!t.has(o[0]))return!1;for(o of e.entries())if(!n(o[1],t.get(o[0])))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(o of e.entries())if(!t.has(o[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(r=e.length,r!=t.length)return!1;for(o=r;o--!==0;)if(e[o]!==t[o])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if(s=Object.keys(e),r=s.length,r!==Object.keys(t).length)return!1;for(o=r;o--!==0;)if(!Object.prototype.hasOwnProperty.call(t,s[o]))return!1;for(o=r;o--!==0;){var i=s[o];if(!(i==="_owner"&&e.$$typeof)&&!n(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}),sc}var ox=rx();const sx=Kh(ox);var Rs={exports:{}},Ds={},ac;function ix(){if(ac)return Ds;ac=1;var n=z,e=ca();function t(c,d){return c===d&&(c!==0||1/c===1/d)||c!==c&&d!==d}var r=typeof Object.is=="function"?Object.is:t,o=e.useSyncExternalStore,s=n.useRef,i=n.useEffect,a=n.useMemo,l=n.useDebugValue;return Ds.useSyncExternalStoreWithSelector=function(c,d,u,h,p){var f=s(null);if(f.current===null){var m={hasValue:!1,value:null};f.current=m}else m=f.current;f=a(function(){function y(T){if(!w){if(w=!0,x=T,T=h(T),p!==void 0&&m.hasValue){var v=m.value;if(p(v,T))return E=v}return E=T}if(v=E,r(x,T))return v;var S=h(T);return p!==void 0&&p(v,S)?(x=T,v):(x=T,E=S)}var w=!1,x,E,b=u===void 0?null:u;return[function(){return y(d())},b===null?void 0:function(){return y(b())}]},[d,u,h,p]);var g=o(c,f[0],f[1]);return i(function(){m.hasValue=!0,m.value=g},[g]),l(g),g},Ds}var lc={},cc;function ax(){return cc||(cc=1,process.env.NODE_ENV!=="production"&&(function(){function n(c,d){return c===d&&(c!==0||1/c===1/d)||c!==c&&d!==d}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var e=z,t=ca(),r=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,s=e.useRef,i=e.useEffect,a=e.useMemo,l=e.useDebugValue;lc.useSyncExternalStoreWithSelector=function(c,d,u,h,p){var f=s(null);if(f.current===null){var m={hasValue:!1,value:null};f.current=m}else m=f.current;f=a(function(){function y(T){if(!w){if(w=!0,x=T,T=h(T),p!==void 0&&m.hasValue){var v=m.value;if(p(v,T))return E=v}return E=T}if(v=E,r(x,T))return v;var S=h(T);return p!==void 0&&p(v,S)?(x=T,v):(x=T,E=S)}var w=!1,x,E,b=u===void 0?null:u;return[function(){return y(d())},b===null?void 0:function(){return y(b())}]},[d,u,h,p]);var g=o(c,f[0],f[1]);return i(function(){m.hasValue=!0,m.value=g},[g]),l(g),g},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),lc}var dc;function lx(){return dc||(dc=1,process.env.NODE_ENV==="production"?Rs.exports=ix():Rs.exports=ax()),Rs.exports}var cx=lx(),dx=(...n)=>e=>{n.forEach(t=>{typeof t=="function"?t(e):t&&(t.current=e)})},ux=({contentComponent:n})=>{const e=wh.useSyncExternalStore(n.subscribe,n.getSnapshot,n.getServerSnapshot);return N.jsx(N.Fragment,{children:Object.values(e)})};function hx(){const n=new Set;let e={};return{subscribe(t){return n.add(t),()=>{n.delete(t)}},getSnapshot(){return e},getServerSnapshot(){return e},setRenderer(t,r){e={...e,[t]:Mc.createPortal(r.reactElement,r.element,t)},n.forEach(o=>o())},removeRenderer(t){const r={...e};delete r[t],e=r,n.forEach(o=>o())}}}var px=class extends z.Component{constructor(n){var e;super(n),this.editorContentRef=z.createRef(),this.initialized=!1,this.state={hasContentComponentInitialized:!!((e=n.editor)!=null&&e.contentComponent)}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){const n=this.props.editor;if(n&&!n.isDestroyed&&n.options.element){if(n.contentComponent)return;const e=this.editorContentRef.current;e.append(n.view.dom),n.setOptions({element:e}),n.contentComponent=hx(),this.state.hasContentComponentInitialized||(this.unsubscribeToContentComponent=n.contentComponent.subscribe(()=>{this.setState(t=>t.hasContentComponentInitialized?t:{hasContentComponentInitialized:!0}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent()})),n.createNodeViews(),this.initialized=!0}}componentWillUnmount(){var n;const e=this.props.editor;if(e){this.initialized=!1,e.isDestroyed||e.view.setProps({nodeViews:{}}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent(),e.contentComponent=null;try{if(!((n=e.view.dom)!=null&&n.firstChild))return;const t=document.createElement("div");t.append(e.view.dom),e.setOptions({element:t})}catch{}}}render(){const{editor:n,innerRef:e,...t}=this.props;return N.jsxs(N.Fragment,{children:[N.jsx("div",{ref:dx(e,this.editorContentRef),...t}),n?.contentComponent&&N.jsx(ux,{contentComponent:n.contentComponent})]})}},fx=z.forwardRef((n,e)=>{const t=z.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[n.editor]);return z.createElement(px,{key:t,innerRef:e,...n})}),mx=z.memo(fx),gx=typeof window<"u"?z.useLayoutEffect:z.useEffect,yx=class{constructor(n){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=n,this.lastSnapshot={editor:n,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(n){return this.subscribers.add(n),()=>{this.subscribers.delete(n)}}watch(n){if(this.editor=n,this.editor){const e=()=>{this.transactionNumber+=1,this.subscribers.forEach(r=>r())},t=this.editor;return t.on("transaction",e),()=>{t.off("transaction",e)}}}};function kh(n){var e;const[t]=z.useState(()=>new yx(n.editor)),r=cx.useSyncExternalStoreWithSelector(t.subscribe,t.getSnapshot,t.getServerSnapshot,n.selector,(e=n.equalityFn)!=null?e:sx);return gx(()=>t.watch(n.editor),[n.editor,t]),z.useDebugValue(r),r}var uc=process.env.NODE_ENV!=="production",yi=typeof window>"u",bx=yi||!!(typeof window<"u"&&window.next),xx=class vh{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(t=>t())}getInitialEditor(){if(this.options.current.immediatelyRender===void 0){if(yi||bx){if(uc)throw new Error("Tiptap Error: SSR has been detected, please set `immediatelyRender` explicitly to `false` to avoid hydration mismatches.");return null}return this.createEditor()}if(this.options.current.immediatelyRender&&yi&&uc)throw new Error("Tiptap Error: SSR has been detected, and `immediatelyRender` has been set to `true` this is an unsupported configuration that may result in errors, explicitly set `immediatelyRender` to `false` to avoid hydration mismatches.");return this.options.current.immediatelyRender?this.createEditor():null}createEditor(){const e={...this.options.current,onBeforeCreate:(...t)=>{var r,o;return(o=(r=this.options.current).onBeforeCreate)==null?void 0:o.call(r,...t)},onBlur:(...t)=>{var r,o;return(o=(r=this.options.current).onBlur)==null?void 0:o.call(r,...t)},onCreate:(...t)=>{var r,o;return(o=(r=this.options.current).onCreate)==null?void 0:o.call(r,...t)},onDestroy:(...t)=>{var r,o;return(o=(r=this.options.current).onDestroy)==null?void 0:o.call(r,...t)},onFocus:(...t)=>{var r,o;return(o=(r=this.options.current).onFocus)==null?void 0:o.call(r,...t)},onSelectionUpdate:(...t)=>{var r,o;return(o=(r=this.options.current).onSelectionUpdate)==null?void 0:o.call(r,...t)},onTransaction:(...t)=>{var r,o;return(o=(r=this.options.current).onTransaction)==null?void 0:o.call(r,...t)},onUpdate:(...t)=>{var r,o;return(o=(r=this.options.current).onUpdate)==null?void 0:o.call(r,...t)},onContentError:(...t)=>{var r,o;return(o=(r=this.options.current).onContentError)==null?void 0:o.call(r,...t)},onDrop:(...t)=>{var r,o;return(o=(r=this.options.current).onDrop)==null?void 0:o.call(r,...t)},onPaste:(...t)=>{var r,o;return(o=(r=this.options.current).onPaste)==null?void 0:o.call(r,...t)},onDelete:(...t)=>{var r,o;return(o=(r=this.options.current).onDelete)==null?void 0:o.call(r,...t)}};return new Iy(e)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}static compareOptions(e,t){return Object.keys(e).every(r=>["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(r)?!0:r==="extensions"&&e.extensions&&t.extensions?e.extensions.length!==t.extensions.length?!1:e.extensions.every((o,s)=>{var i;return o===((i=t.extensions)==null?void 0:i[s])}):e[r]===t[r])}onRender(e){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&e.length===0?vh.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(e),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=e;return}if(this.previousDeps.length===e.length&&this.previousDeps.every((t,r)=>t===e[r]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){const e=this.instanceId,t=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===e){t&&t.setOptions(this.options.current);return}t&&!t.isDestroyed&&(t.destroy(),this.instanceId===e&&this.setEditor(null))},1)}};function wx(n={},e=[]){const t=z.useRef(n);t.current=n;const[r]=z.useState(()=>new xx(t)),o=wh.useSyncExternalStore(r.subscribe,r.getEditor,r.getServerSnapshot);return z.useDebugValue(o),z.useEffect(r.onRender(e)),kh({editor:o,selector:({transactionNumber:s})=>n.shouldRerenderOnTransaction===!1||n.shouldRerenderOnTransaction===void 0?null:n.immediatelyRender&&s===0?0:s+1}),o}var kx=z.createContext({editor:null});kx.Consumer;var Sh=z.createContext({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),vx=()=>z.useContext(Sh),js=z.forwardRef((n,e)=>{const{onDragStart:t}=vx(),r=n.as||"div";return N.jsx(r,{...n,ref:e,"data-node-view-wrapper":"",onDragStart:t,style:{whiteSpace:"normal",...n.style}})});function hc(n){return!!(typeof n=="function"&&n.prototype&&n.prototype.isReactComponent)}function pc(n){return!!(typeof n=="object"&&n.$$typeof&&(n.$$typeof.toString()==="Symbol(react.forward_ref)"||n.$$typeof.description==="react.forward_ref"))}function Sx(n){return!!(typeof n=="object"&&n.$$typeof&&(n.$$typeof.toString()==="Symbol(react.memo)"||n.$$typeof.description==="react.memo"))}function Cx(n){if(hc(n)||pc(n))return!0;if(Sx(n)){const e=n.type;if(e)return hc(e)||pc(e)}return!1}function Mx(){try{if(z.version)return parseInt(z.version.split(".")[0],10)>=19}catch{}return!1}var Ex=class{constructor(n,{editor:e,props:t={},as:r="div",className:o=""}){this.ref=null,this.id=Math.floor(Math.random()*4294967295).toString(),this.component=n,this.editor=e,this.props=t,this.element=document.createElement(r),this.element.classList.add("react-renderer"),o&&this.element.classList.add(...o.split(" ")),this.editor.isInitialized?Mc.flushSync(()=>{this.render()}):queueMicrotask(()=>{this.render()})}render(){var n;const e=this.component,t=this.props,r=this.editor,o=Mx(),s=Cx(e),i={...t};i.ref&&!(o||s)&&delete i.ref,!i.ref&&(o||s)&&(i.ref=a=>{this.ref=a}),this.reactElement=N.jsx(e,{...i}),(n=r?.contentComponent)==null||n.setRenderer(this.id,this)}updateProps(n={}){this.props={...this.props,...n},this.render()}destroy(){var n;(n=this.editor?.contentComponent)==null||n.removeRenderer(this.id);try{this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)}catch{}}updateAttributes(n){Object.keys(n).forEach(e=>{this.element.setAttribute(e,n[e])})}};z.createContext({markViewContentRef:()=>{}});var Tx=class extends Jy{constructor(n,e,t){if(super(n,e,t),!this.node.isLeaf){this.options.contentDOMElementTag?this.contentDOMElement=document.createElement(this.options.contentDOMElementTag):this.contentDOMElement=document.createElement(this.node.isInline?"span":"div"),this.contentDOMElement.dataset.nodeViewContentReact="",this.contentDOMElement.dataset.nodeViewWrapper="",this.contentDOMElement.style.whiteSpace="inherit";const r=this.dom.querySelector("[data-node-view-content]");if(!r)return;r.appendChild(this.contentDOMElement)}}mount(){const n={editor:this.editor,node:this.node,decorations:this.decorations,innerDecorations:this.innerDecorations,view:this.view,selected:!1,extension:this.extension,HTMLAttributes:this.HTMLAttributes,getPos:()=>this.getPos(),updateAttributes:(i={})=>this.updateAttributes(i),deleteNode:()=>this.deleteNode(),ref:z.createRef()};if(!this.component.displayName){const i=a=>a.charAt(0).toUpperCase()+a.substring(1);this.component.displayName=i(this.extension.name)}const e={onDragStart:this.onDragStart.bind(this),nodeViewContentRef:i=>{i&&this.contentDOMElement&&i.firstChild!==this.contentDOMElement&&(i.hasAttribute("data-node-view-wrapper")&&i.removeAttribute("data-node-view-wrapper"),i.appendChild(this.contentDOMElement))}},t=this.component,r=z.memo(i=>N.jsx(Sh.Provider,{value:e,children:z.createElement(t,i)}));r.displayName="ReactNodeView";let o=this.node.isInline?"span":"div";this.options.as&&(o=this.options.as);const{className:s=""}=this.options;this.handleSelectionUpdate=this.handleSelectionUpdate.bind(this),this.renderer=new Ex(r,{editor:this.editor,props:n,as:o,className:`node-${this.node.type.name} ${s}`.trim()}),this.editor.on("selectionUpdate",this.handleSelectionUpdate),this.updateElementAttributes()}get dom(){var n;if(this.renderer.element.firstElementChild&&!((n=this.renderer.element.firstElementChild)!=null&&n.hasAttribute("data-node-view-wrapper")))throw Error("Please use the NodeViewWrapper component for your node view.");return this.renderer.element}get contentDOM(){return this.node.isLeaf?null:this.contentDOMElement}handleSelectionUpdate(){const{from:n,to:e}=this.editor.state.selection,t=this.getPos();if(typeof t=="number")if(n<=t&&e>=t+this.node.nodeSize){if(this.renderer.props.selected)return;this.selectNode()}else{if(!this.renderer.props.selected)return;this.deselectNode()}}update(n,e,t){const r=o=>{this.renderer.updateProps(o),typeof this.options.attrs=="function"&&this.updateElementAttributes()};if(n.type!==this.node.type)return!1;if(typeof this.options.update=="function"){const o=this.node,s=this.decorations,i=this.innerDecorations;return this.node=n,this.decorations=e,this.innerDecorations=t,this.options.update({oldNode:o,oldDecorations:s,newNode:n,newDecorations:e,oldInnerDecorations:i,innerDecorations:t,updateProps:()=>r({node:n,decorations:e,innerDecorations:t})})}return n===this.node&&this.decorations===e&&this.innerDecorations===t||(this.node=n,this.decorations=e,this.innerDecorations=t,r({node:n,decorations:e,innerDecorations:t})),!0}selectNode(){this.renderer.updateProps({selected:!0}),this.renderer.element.classList.add("ProseMirror-selectednode")}deselectNode(){this.renderer.updateProps({selected:!1}),this.renderer.element.classList.remove("ProseMirror-selectednode")}destroy(){this.renderer.destroy(),this.editor.off("selectionUpdate",this.handleSelectionUpdate),this.contentDOMElement=null}updateElementAttributes(){if(this.options.attrs){let n={};if(typeof this.options.attrs=="function"){const e=this.editor.extensionManager.attributes,t=cr(this.node,e);n=this.options.attrs({node:this.node,HTMLAttributes:t})}else n=this.options.attrs;this.renderer.updateAttributes(n)}}};function Nx(n,e){return t=>t.editor.contentComponent?new Tx(n,t,e):{}}function Ax(n){const e=jo.c(23),{node:t,updateAttributes:r}=n,o=z.useRef(null),s=z.useRef(null),[i,a]=z.useState(!1),[l,c]=z.useState(!1),[d,u]=z.useState(!1),h=t.attrs.src;if(!h){let $;return e[0]===Symbol.for("react.memo_cache_sentinel")?($=N.jsx(js,{as:"div",className:"resizable-image-error",children:"이미지 소스가 없습니다."}),e[0]=$):$=e[0],$}if(d){let $;e[1]!==h?($=h?.substring(0,50),e[1]=h,e[2]=$):$=e[2];let Y;return e[3]!==$?(Y=N.jsxs(js,{as:"div",className:"resizable-image-error",children:["이미지를 불러올 수 없습니다: ",$,"..."]}),e[3]=$,e[4]=Y):Y=e[4],Y}let p;e[5]!==r?(p=($,Y)=>{if($.button!==0)return;$.preventDefault(),a(!0);const pe=$.clientX,Z=$.clientY,q=o.current?.offsetWidth||0,X=o.current?.offsetHeight||0,ee=X/q,L=Ce=>{const C=Ce.clientX-pe,B=Ce.clientY-Z;let V=q;e:switch(Y){case"se":case"e":{V=Math.max(100,q+C);break e}case"sw":case"w":{V=Math.max(100,q-C);break e}case"ne":case"n":{V=Math.max(100,q+C);break e}case"nw":{V=Math.max(100,q-C);break e}case"s":V=Math.max(100*ee,X+B)/ee}o.current&&(o.current.style.width=`${V}px`,o.current.style.height=`${V*ee}px`)},Se=()=>{a(!1),o.current&&r({width:o.current.offsetWidth,height:o.current.offsetHeight}),document.removeEventListener("mousemove",L),document.removeEventListener("mouseup",Se)};document.addEventListener("mousemove",L),document.addEventListener("mouseup",Se)},e[5]=r,e[6]=p):p=e[6];const f=p;let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m=()=>{c(!0)},e[7]=m):m=e[7];const g=m;let y;e[8]===Symbol.for("react.memo_cache_sentinel")?(y=$=>{s.current&&!s.current.contains($.target)&&c(!1)},e[8]=y):y=e[8];const w=y;let x;e[9]===Symbol.for("react.memo_cache_sentinel")?(x=()=>u(!0),e[9]=x):x=e[9];const E=`resizable-image ${i?"resizing":""} ${l?"selected":""}`,b=t.attrs.width?`${t.attrs.width}px`:"auto",T=t.attrs.height?`${t.attrs.height}px`:"auto";let v;e[10]!==b||e[11]!==T?(v={width:b,height:T},e[10]=b,e[11]=T,e[12]=v):v=e[12];let S;e[13]!==h||e[14]!==E||e[15]!==v?(S=N.jsx("img",{ref:o,src:h,alt:"inserted image",onClick:g,onError:x,className:E,style:v,draggable:"false"}),e[13]=h,e[14]=E,e[15]=v,e[16]=S):S=e[16];let R;e[17]!==f||e[18]!==l?(R=l&&N.jsxs(N.Fragment,{children:[N.jsx("div",{className:"resizable-image-border"}),N.jsx("div",{onMouseDown:$=>f($,"nw"),className:"resize-handle tl"}),N.jsx("div",{onMouseDown:$=>f($,"n"),className:"resize-handle t"}),N.jsx("div",{onMouseDown:$=>f($,"ne"),className:"resize-handle tr"}),N.jsx("div",{onMouseDown:$=>f($,"w"),className:"resize-handle l"}),N.jsx("div",{onMouseDown:$=>f($,"e"),className:"resize-handle r"}),N.jsx("div",{onMouseDown:$=>f($,"sw"),className:"resize-handle bl"}),N.jsx("div",{onMouseDown:$=>f($,"s"),className:"resize-handle b"}),N.jsx("div",{onMouseDown:$=>f($,"se"),className:"resize-handle br"})]}),e[17]=f,e[18]=l,e[19]=R):R=e[19];let _;return e[20]!==R||e[21]!==S?(_=N.jsx(js,{as:"div",onClick:w,className:"resizable-image-wrapper",draggable:"true","data-drag-handle":!0,children:N.jsxs("div",{ref:s,className:"resizable-image-container",onClick:Ox,children:[S,R]})}),e[20]=R,e[21]=S,e[22]=_):_=e[22],_}function Ox(n){return n.stopPropagation()}const Rx=ex.extend({addAttributes(){return{src:{default:null,parseHTML:n=>{const e=n.getAttribute("src");return console.log("Parsing image src:",e),e},renderHTML:n=>({src:n.src})},alt:{default:null,parseHTML:n=>n.getAttribute("alt"),renderHTML:n=>({alt:n.alt||"image"})},title:{default:null,parseHTML:n=>n.getAttribute("title"),renderHTML:n=>({title:n.title})},width:{default:null,parseHTML:n=>{const e=n.getAttribute("width");return e?parseInt(e,10):null},renderHTML:n=>({width:n.width})},height:{default:null,parseHTML:n=>{const e=n.getAttribute("height");return e?parseInt(e,10):null},renderHTML:n=>({height:n.height})}}},addNodeView(){return Nx(Ax)},draggable:!0,addStorage(){return{clipboardTextSerializer:n=>n.attrs.src||""}},renderHTML({HTMLAttributes:n}){return["img",{...n,class:"resizable-image"}]}}),Ch=[Y1.configure({paragraph:{HTMLAttributes:{class:"tiptap-paragraph"}},heading:{levels:[1,2,3]},bulletList:{HTMLAttributes:{class:"tiptap-bullet-list"}},orderedList:{HTMLAttributes:{class:"tiptap-ordered-list"}},codeBlock:{HTMLAttributes:{class:"tiptap-code-block"}},code:{HTMLAttributes:{class:"tiptap-inline-code"}},blockquote:{HTMLAttributes:{class:"tiptap-blockquote"}}}),y0,Lu,tb,sb.configure({multicolor:!0}),g0.configure({types:["heading","paragraph"]}),Rx,Ju.configure({resizable:!0}),f0,p0,h0];function Mh(n){var e,t,r="";if(typeof n=="string"||typeof n=="number")r+=n;else if(typeof n=="object")if(Array.isArray(n)){var o=n.length;for(e=0;e<o;e++)n[e]&&(t=Mh(n[e]))&&(r&&(r+=" "),r+=t)}else for(t in n)n[t]&&(r&&(r+=" "),r+=t);return r}function Dx(){for(var n,e,t=0,r="",o=arguments.length;t<o;t++)(n=arguments[t])&&(e=Mh(n))&&(r&&(r+=" "),r+=e);return r}const jx=(n,e)=>{const t=new Array(n.length+e.length);for(let r=0;r<n.length;r++)t[r]=n[r];for(let r=0;r<e.length;r++)t[n.length+r]=e[r];return t},Lx=(n,e)=>({classGroupId:n,validator:e}),Eh=(n=new Map,e=null,t)=>({nextPart:n,validators:e,classGroupId:t}),Ro="-",fc=[],zx="arbitrary..",$x=n=>{const e=Px(n),{conflictingClassGroups:t,conflictingClassGroupModifiers:r}=n;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return Ix(o);const s=o.split(Ro),i=s[0]===""&&s.length>1?1:0;return Th(s,i,e)},getConflictingClassGroupIds:(o,s)=>{if(s){const i=r[o],a=t[o];return i?a?jx(a,i):i:a||fc}return t[o]||fc}}},Th=(n,e,t)=>{if(n.length-e===0)return t.classGroupId;const r=n[e],o=t.nextPart.get(r);if(o){const l=Th(n,e+1,o);if(l)return l}const s=t.validators;if(s===null)return;const i=e===0?n.join(Ro):n.slice(e).join(Ro),a=s.length;for(let l=0;l<a;l++){const c=s[l];if(c.validator(i))return c.classGroupId}},Ix=n=>n.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=n.slice(1,-1),t=e.indexOf(":"),r=e.slice(0,t);return r?zx+r:void 0})(),Px=n=>{const{theme:e,classGroups:t}=n;return Hx(t,e)},Hx=(n,e)=>{const t=Eh();for(const r in n){const o=n[r];da(o,t,r,e)}return t},da=(n,e,t,r)=>{const o=n.length;for(let s=0;s<o;s++){const i=n[s];Bx(i,e,t,r)}},Bx=(n,e,t,r)=>{if(typeof n=="string"){Vx(n,e,t);return}if(typeof n=="function"){Fx(n,e,t,r);return}Wx(n,e,t,r)},Vx=(n,e,t)=>{const r=n===""?e:Nh(e,n);r.classGroupId=t},Fx=(n,e,t,r)=>{if(_x(n)){da(n(r),e,t,r);return}e.validators===null&&(e.validators=[]),e.validators.push(Lx(t,n))},Wx=(n,e,t,r)=>{const o=Object.entries(n),s=o.length;for(let i=0;i<s;i++){const[a,l]=o[i];da(l,Nh(e,a),t,r)}},Nh=(n,e)=>{let t=n;const r=e.split(Ro),o=r.length;for(let s=0;s<o;s++){const i=r[s];let a=t.nextPart.get(i);a||(a=Eh(),t.nextPart.set(i,a)),t=a}return t},_x=n=>"isThemeGetter"in n&&n.isThemeGetter===!0,Ux=n=>{if(n<1)return{get:()=>{},set:()=>{}};let e=0,t=Object.create(null),r=Object.create(null);const o=(s,i)=>{t[s]=i,e++,e>n&&(e=0,r=t,t=Object.create(null))};return{get(s){let i=t[s];if(i!==void 0)return i;if((i=r[s])!==void 0)return o(s,i),i},set(s,i){s in t?t[s]=i:o(s,i)}}},bi="!",mc=":",qx=[],gc=(n,e,t,r,o)=>({modifiers:n,hasImportantModifier:e,baseClassName:t,maybePostfixModifierPosition:r,isExternal:o}),Kx=n=>{const{prefix:e,experimentalParseClassName:t}=n;let r=o=>{const s=[];let i=0,a=0,l=0,c;const d=o.length;for(let m=0;m<d;m++){const g=o[m];if(i===0&&a===0){if(g===mc){s.push(o.slice(l,m)),l=m+1;continue}if(g==="/"){c=m;continue}}g==="["?i++:g==="]"?i--:g==="("?a++:g===")"&&a--}const u=s.length===0?o:o.slice(l);let h=u,p=!1;u.endsWith(bi)?(h=u.slice(0,-1),p=!0):u.startsWith(bi)&&(h=u.slice(1),p=!0);const f=c&&c>l?c-l:void 0;return gc(s,p,h,f)};if(e){const o=e+mc,s=r;r=i=>i.startsWith(o)?s(i.slice(o.length)):gc(qx,!1,i,void 0,!0)}if(t){const o=r;r=s=>t({className:s,parseClassName:o})}return r},Jx=n=>{const e=new Map;return n.orderSensitiveModifiers.forEach((t,r)=>{e.set(t,1e6+r)}),t=>{const r=[];let o=[];for(let s=0;s<t.length;s++){const i=t[s],a=i[0]==="[",l=e.has(i);a||l?(o.length>0&&(o.sort(),r.push(...o),o=[]),r.push(i)):o.push(i)}return o.length>0&&(o.sort(),r.push(...o)),r}},Gx=n=>({cache:Ux(n.cacheSize),parseClassName:Kx(n),sortModifiers:Jx(n),...$x(n)}),Xx=/\s+/,Yx=(n,e)=>{const{parseClassName:t,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:s}=e,i=[],a=n.trim().split(Xx);let l="";for(let c=a.length-1;c>=0;c-=1){const d=a[c],{isExternal:u,modifiers:h,hasImportantModifier:p,baseClassName:f,maybePostfixModifierPosition:m}=t(d);if(u){l=d+(l.length>0?" "+l:l);continue}let g=!!m,y=r(g?f.substring(0,m):f);if(!y){if(!g){l=d+(l.length>0?" "+l:l);continue}if(y=r(f),!y){l=d+(l.length>0?" "+l:l);continue}g=!1}const w=h.length===0?"":h.length===1?h[0]:s(h).join(":"),x=p?w+bi:w,E=x+y;if(i.indexOf(E)>-1)continue;i.push(E);const b=o(y,g);for(let T=0;T<b.length;++T){const v=b[T];i.push(x+v)}l=d+(l.length>0?" "+l:l)}return l},Qx=(...n)=>{let e=0,t,r,o="";for(;e<n.length;)(t=n[e++])&&(r=Ah(t))&&(o&&(o+=" "),o+=r);return o},Ah=n=>{if(typeof n=="string")return n;let e,t="";for(let r=0;r<n.length;r++)n[r]&&(e=Ah(n[r]))&&(t&&(t+=" "),t+=e);return t},Zx=(n,...e)=>{let t,r,o,s;const i=l=>{const c=e.reduce((d,u)=>u(d),n());return t=Gx(c),r=t.cache.get,o=t.cache.set,s=a,a(l)},a=l=>{const c=r(l);if(c)return c;const d=Yx(l,t);return o(l,d),d};return s=i,(...l)=>s(Qx(...l))},ew=[],ye=n=>{const e=t=>t[n]||ew;return e.isThemeGetter=!0,e},Oh=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Rh=/^\((?:(\w[\w-]*):)?(.+)\)$/i,tw=/^\d+\/\d+$/,nw=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,rw=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,ow=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,sw=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,iw=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,bn=n=>tw.test(n),G=n=>!!n&&!Number.isNaN(Number(n)),vt=n=>!!n&&Number.isInteger(Number(n)),Ls=n=>n.endsWith("%")&&G(n.slice(0,-1)),ht=n=>nw.test(n),aw=()=>!0,lw=n=>rw.test(n)&&!ow.test(n),Dh=()=>!1,cw=n=>sw.test(n),dw=n=>iw.test(n),uw=n=>!D(n)&&!j(n),hw=n=>zn(n,zh,Dh),D=n=>Oh.test(n),_t=n=>zn(n,$h,lw),zs=n=>zn(n,yw,G),yc=n=>zn(n,jh,Dh),pw=n=>zn(n,Lh,dw),Lr=n=>zn(n,Ih,cw),j=n=>Rh.test(n),Bn=n=>$n(n,$h),fw=n=>$n(n,bw),bc=n=>$n(n,jh),mw=n=>$n(n,zh),gw=n=>$n(n,Lh),zr=n=>$n(n,Ih,!0),zn=(n,e,t)=>{const r=Oh.exec(n);return r?r[1]?e(r[1]):t(r[2]):!1},$n=(n,e,t=!1)=>{const r=Rh.exec(n);return r?r[1]?e(r[1]):t:!1},jh=n=>n==="position"||n==="percentage",Lh=n=>n==="image"||n==="url",zh=n=>n==="length"||n==="size"||n==="bg-size",$h=n=>n==="length",yw=n=>n==="number",bw=n=>n==="family-name",Ih=n=>n==="shadow",xw=()=>{const n=ye("color"),e=ye("font"),t=ye("text"),r=ye("font-weight"),o=ye("tracking"),s=ye("leading"),i=ye("breakpoint"),a=ye("container"),l=ye("spacing"),c=ye("radius"),d=ye("shadow"),u=ye("inset-shadow"),h=ye("text-shadow"),p=ye("drop-shadow"),f=ye("blur"),m=ye("perspective"),g=ye("aspect"),y=ye("ease"),w=ye("animate"),x=()=>["auto","avoid","all","avoid-page","page","left","right","column"],E=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],b=()=>[...E(),j,D],T=()=>["auto","hidden","clip","visible","scroll"],v=()=>["auto","contain","none"],S=()=>[j,D,l],R=()=>[bn,"full","auto",...S()],_=()=>[vt,"none","subgrid",j,D],$=()=>["auto",{span:["full",vt,j,D]},vt,j,D],Y=()=>[vt,"auto",j,D],pe=()=>["auto","min","max","fr",j,D],Z=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],q=()=>["start","end","center","stretch","center-safe","end-safe"],X=()=>["auto",...S()],ee=()=>[bn,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...S()],L=()=>[n,j,D],Se=()=>[...E(),bc,yc,{position:[j,D]}],Ce=()=>["no-repeat",{repeat:["","x","y","space","round"]}],C=()=>["auto","cover","contain",mw,hw,{size:[j,D]}],B=()=>[Ls,Bn,_t],V=()=>["","none","full",c,j,D],U=()=>["",G,Bn,_t],J=()=>["solid","dashed","dotted","double"],oe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],F=()=>[G,Ls,bc,yc],Ne=()=>["","none",f,j,D],je=()=>["none",G,j,D],Be=()=>["none",G,j,D],tt=()=>[G,j,D],Ye=()=>[bn,"full",...S()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ht],breakpoint:[ht],color:[aw],container:[ht],"drop-shadow":[ht],ease:["in","out","in-out"],font:[uw],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ht],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ht],shadow:[ht],spacing:["px",G],text:[ht],"text-shadow":[ht],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",bn,D,j,g]}],container:["container"],columns:[{columns:[G,D,j,a]}],"break-after":[{"break-after":x()}],"break-before":[{"break-before":x()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:b()}],overflow:[{overflow:T()}],"overflow-x":[{"overflow-x":T()}],"overflow-y":[{"overflow-y":T()}],overscroll:[{overscroll:v()}],"overscroll-x":[{"overscroll-x":v()}],"overscroll-y":[{"overscroll-y":v()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:R()}],"inset-x":[{"inset-x":R()}],"inset-y":[{"inset-y":R()}],start:[{start:R()}],end:[{end:R()}],top:[{top:R()}],right:[{right:R()}],bottom:[{bottom:R()}],left:[{left:R()}],visibility:["visible","invisible","collapse"],z:[{z:[vt,"auto",j,D]}],basis:[{basis:[bn,"full","auto",a,...S()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[G,bn,"auto","initial","none",D]}],grow:[{grow:["",G,j,D]}],shrink:[{shrink:["",G,j,D]}],order:[{order:[vt,"first","last","none",j,D]}],"grid-cols":[{"grid-cols":_()}],"col-start-end":[{col:$()}],"col-start":[{"col-start":Y()}],"col-end":[{"col-end":Y()}],"grid-rows":[{"grid-rows":_()}],"row-start-end":[{row:$()}],"row-start":[{"row-start":Y()}],"row-end":[{"row-end":Y()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":pe()}],"auto-rows":[{"auto-rows":pe()}],gap:[{gap:S()}],"gap-x":[{"gap-x":S()}],"gap-y":[{"gap-y":S()}],"justify-content":[{justify:[...Z(),"normal"]}],"justify-items":[{"justify-items":[...q(),"normal"]}],"justify-self":[{"justify-self":["auto",...q()]}],"align-content":[{content:["normal",...Z()]}],"align-items":[{items:[...q(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...q(),{baseline:["","last"]}]}],"place-content":[{"place-content":Z()}],"place-items":[{"place-items":[...q(),"baseline"]}],"place-self":[{"place-self":["auto",...q()]}],p:[{p:S()}],px:[{px:S()}],py:[{py:S()}],ps:[{ps:S()}],pe:[{pe:S()}],pt:[{pt:S()}],pr:[{pr:S()}],pb:[{pb:S()}],pl:[{pl:S()}],m:[{m:X()}],mx:[{mx:X()}],my:[{my:X()}],ms:[{ms:X()}],me:[{me:X()}],mt:[{mt:X()}],mr:[{mr:X()}],mb:[{mb:X()}],ml:[{ml:X()}],"space-x":[{"space-x":S()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":S()}],"space-y-reverse":["space-y-reverse"],size:[{size:ee()}],w:[{w:[a,"screen",...ee()]}],"min-w":[{"min-w":[a,"screen","none",...ee()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[i]},...ee()]}],h:[{h:["screen","lh",...ee()]}],"min-h":[{"min-h":["screen","lh","none",...ee()]}],"max-h":[{"max-h":["screen","lh",...ee()]}],"font-size":[{text:["base",t,Bn,_t]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,j,zs]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Ls,D]}],"font-family":[{font:[fw,D,e]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,j,D]}],"line-clamp":[{"line-clamp":[G,"none",j,zs]}],leading:[{leading:[s,...S()]}],"list-image":[{"list-image":["none",j,D]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",j,D]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:L()}],"text-color":[{text:L()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...J(),"wavy"]}],"text-decoration-thickness":[{decoration:[G,"from-font","auto",j,_t]}],"text-decoration-color":[{decoration:L()}],"underline-offset":[{"underline-offset":[G,"auto",j,D]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:S()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",j,D]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",j,D]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Se()}],"bg-repeat":[{bg:Ce()}],"bg-size":[{bg:C()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},vt,j,D],radial:["",j,D],conic:[vt,j,D]},gw,pw]}],"bg-color":[{bg:L()}],"gradient-from-pos":[{from:B()}],"gradient-via-pos":[{via:B()}],"gradient-to-pos":[{to:B()}],"gradient-from":[{from:L()}],"gradient-via":[{via:L()}],"gradient-to":[{to:L()}],rounded:[{rounded:V()}],"rounded-s":[{"rounded-s":V()}],"rounded-e":[{"rounded-e":V()}],"rounded-t":[{"rounded-t":V()}],"rounded-r":[{"rounded-r":V()}],"rounded-b":[{"rounded-b":V()}],"rounded-l":[{"rounded-l":V()}],"rounded-ss":[{"rounded-ss":V()}],"rounded-se":[{"rounded-se":V()}],"rounded-ee":[{"rounded-ee":V()}],"rounded-es":[{"rounded-es":V()}],"rounded-tl":[{"rounded-tl":V()}],"rounded-tr":[{"rounded-tr":V()}],"rounded-br":[{"rounded-br":V()}],"rounded-bl":[{"rounded-bl":V()}],"border-w":[{border:U()}],"border-w-x":[{"border-x":U()}],"border-w-y":[{"border-y":U()}],"border-w-s":[{"border-s":U()}],"border-w-e":[{"border-e":U()}],"border-w-t":[{"border-t":U()}],"border-w-r":[{"border-r":U()}],"border-w-b":[{"border-b":U()}],"border-w-l":[{"border-l":U()}],"divide-x":[{"divide-x":U()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":U()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...J(),"hidden","none"]}],"divide-style":[{divide:[...J(),"hidden","none"]}],"border-color":[{border:L()}],"border-color-x":[{"border-x":L()}],"border-color-y":[{"border-y":L()}],"border-color-s":[{"border-s":L()}],"border-color-e":[{"border-e":L()}],"border-color-t":[{"border-t":L()}],"border-color-r":[{"border-r":L()}],"border-color-b":[{"border-b":L()}],"border-color-l":[{"border-l":L()}],"divide-color":[{divide:L()}],"outline-style":[{outline:[...J(),"none","hidden"]}],"outline-offset":[{"outline-offset":[G,j,D]}],"outline-w":[{outline:["",G,Bn,_t]}],"outline-color":[{outline:L()}],shadow:[{shadow:["","none",d,zr,Lr]}],"shadow-color":[{shadow:L()}],"inset-shadow":[{"inset-shadow":["none",u,zr,Lr]}],"inset-shadow-color":[{"inset-shadow":L()}],"ring-w":[{ring:U()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:L()}],"ring-offset-w":[{"ring-offset":[G,_t]}],"ring-offset-color":[{"ring-offset":L()}],"inset-ring-w":[{"inset-ring":U()}],"inset-ring-color":[{"inset-ring":L()}],"text-shadow":[{"text-shadow":["none",h,zr,Lr]}],"text-shadow-color":[{"text-shadow":L()}],opacity:[{opacity:[G,j,D]}],"mix-blend":[{"mix-blend":[...oe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":oe()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[G]}],"mask-image-linear-from-pos":[{"mask-linear-from":F()}],"mask-image-linear-to-pos":[{"mask-linear-to":F()}],"mask-image-linear-from-color":[{"mask-linear-from":L()}],"mask-image-linear-to-color":[{"mask-linear-to":L()}],"mask-image-t-from-pos":[{"mask-t-from":F()}],"mask-image-t-to-pos":[{"mask-t-to":F()}],"mask-image-t-from-color":[{"mask-t-from":L()}],"mask-image-t-to-color":[{"mask-t-to":L()}],"mask-image-r-from-pos":[{"mask-r-from":F()}],"mask-image-r-to-pos":[{"mask-r-to":F()}],"mask-image-r-from-color":[{"mask-r-from":L()}],"mask-image-r-to-color":[{"mask-r-to":L()}],"mask-image-b-from-pos":[{"mask-b-from":F()}],"mask-image-b-to-pos":[{"mask-b-to":F()}],"mask-image-b-from-color":[{"mask-b-from":L()}],"mask-image-b-to-color":[{"mask-b-to":L()}],"mask-image-l-from-pos":[{"mask-l-from":F()}],"mask-image-l-to-pos":[{"mask-l-to":F()}],"mask-image-l-from-color":[{"mask-l-from":L()}],"mask-image-l-to-color":[{"mask-l-to":L()}],"mask-image-x-from-pos":[{"mask-x-from":F()}],"mask-image-x-to-pos":[{"mask-x-to":F()}],"mask-image-x-from-color":[{"mask-x-from":L()}],"mask-image-x-to-color":[{"mask-x-to":L()}],"mask-image-y-from-pos":[{"mask-y-from":F()}],"mask-image-y-to-pos":[{"mask-y-to":F()}],"mask-image-y-from-color":[{"mask-y-from":L()}],"mask-image-y-to-color":[{"mask-y-to":L()}],"mask-image-radial":[{"mask-radial":[j,D]}],"mask-image-radial-from-pos":[{"mask-radial-from":F()}],"mask-image-radial-to-pos":[{"mask-radial-to":F()}],"mask-image-radial-from-color":[{"mask-radial-from":L()}],"mask-image-radial-to-color":[{"mask-radial-to":L()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":E()}],"mask-image-conic-pos":[{"mask-conic":[G]}],"mask-image-conic-from-pos":[{"mask-conic-from":F()}],"mask-image-conic-to-pos":[{"mask-conic-to":F()}],"mask-image-conic-from-color":[{"mask-conic-from":L()}],"mask-image-conic-to-color":[{"mask-conic-to":L()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Se()}],"mask-repeat":[{mask:Ce()}],"mask-size":[{mask:C()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",j,D]}],filter:[{filter:["","none",j,D]}],blur:[{blur:Ne()}],brightness:[{brightness:[G,j,D]}],contrast:[{contrast:[G,j,D]}],"drop-shadow":[{"drop-shadow":["","none",p,zr,Lr]}],"drop-shadow-color":[{"drop-shadow":L()}],grayscale:[{grayscale:["",G,j,D]}],"hue-rotate":[{"hue-rotate":[G,j,D]}],invert:[{invert:["",G,j,D]}],saturate:[{saturate:[G,j,D]}],sepia:[{sepia:["",G,j,D]}],"backdrop-filter":[{"backdrop-filter":["","none",j,D]}],"backdrop-blur":[{"backdrop-blur":Ne()}],"backdrop-brightness":[{"backdrop-brightness":[G,j,D]}],"backdrop-contrast":[{"backdrop-contrast":[G,j,D]}],"backdrop-grayscale":[{"backdrop-grayscale":["",G,j,D]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[G,j,D]}],"backdrop-invert":[{"backdrop-invert":["",G,j,D]}],"backdrop-opacity":[{"backdrop-opacity":[G,j,D]}],"backdrop-saturate":[{"backdrop-saturate":[G,j,D]}],"backdrop-sepia":[{"backdrop-sepia":["",G,j,D]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":S()}],"border-spacing-x":[{"border-spacing-x":S()}],"border-spacing-y":[{"border-spacing-y":S()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",j,D]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[G,"initial",j,D]}],ease:[{ease:["linear","initial",y,j,D]}],delay:[{delay:[G,j,D]}],animate:[{animate:["none",w,j,D]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,j,D]}],"perspective-origin":[{"perspective-origin":b()}],rotate:[{rotate:je()}],"rotate-x":[{"rotate-x":je()}],"rotate-y":[{"rotate-y":je()}],"rotate-z":[{"rotate-z":je()}],scale:[{scale:Be()}],"scale-x":[{"scale-x":Be()}],"scale-y":[{"scale-y":Be()}],"scale-z":[{"scale-z":Be()}],"scale-3d":["scale-3d"],skew:[{skew:tt()}],"skew-x":[{"skew-x":tt()}],"skew-y":[{"skew-y":tt()}],transform:[{transform:[j,D,"","none","gpu","cpu"]}],"transform-origin":[{origin:b()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ye()}],"translate-x":[{"translate-x":Ye()}],"translate-y":[{"translate-y":Ye()}],"translate-z":[{"translate-z":Ye()}],"translate-none":["translate-none"],accent:[{accent:L()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:L()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",j,D]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":S()}],"scroll-mx":[{"scroll-mx":S()}],"scroll-my":[{"scroll-my":S()}],"scroll-ms":[{"scroll-ms":S()}],"scroll-me":[{"scroll-me":S()}],"scroll-mt":[{"scroll-mt":S()}],"scroll-mr":[{"scroll-mr":S()}],"scroll-mb":[{"scroll-mb":S()}],"scroll-ml":[{"scroll-ml":S()}],"scroll-p":[{"scroll-p":S()}],"scroll-px":[{"scroll-px":S()}],"scroll-py":[{"scroll-py":S()}],"scroll-ps":[{"scroll-ps":S()}],"scroll-pe":[{"scroll-pe":S()}],"scroll-pt":[{"scroll-pt":S()}],"scroll-pr":[{"scroll-pr":S()}],"scroll-pb":[{"scroll-pb":S()}],"scroll-pl":[{"scroll-pl":S()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",j,D]}],fill:[{fill:["none",...L()]}],"stroke-w":[{stroke:[G,Bn,_t,zs]}],stroke:[{stroke:["none",...L()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},ww=Zx(xw);function Cn(...n){return ww(Dx(n))}const kw=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),vw=n=>n.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,r)=>r?r.toUpperCase():t.toLowerCase()),xc=n=>{const e=vw(n);return e.charAt(0).toUpperCase()+e.slice(1)},Ph=(...n)=>n.filter((e,t,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===t).join(" ").trim(),Sw=n=>{for(const e in n)if(e.startsWith("aria-")||e==="role"||e==="title")return!0};var Cw={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const Mw=z.forwardRef(({color:n="currentColor",size:e=24,strokeWidth:t=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:i,...a},l)=>z.createElement("svg",{ref:l,...Cw,width:e,height:e,stroke:n,strokeWidth:r?Number(t)*24/Number(e):t,className:Ph("lucide",o),...!s&&!Sw(a)&&{"aria-hidden":"true"},...a},[...i.map(([c,d])=>z.createElement(c,d)),...Array.isArray(s)?s:[s]])),ge=(n,e)=>{const t=z.forwardRef(({className:r,...o},s)=>z.createElement(Mw,{ref:s,iconNode:e,className:Ph(`lucide-${kw(xc(n))}`,`lucide-${n}`,r),...o}));return t.displayName=xc(n),t},Ew=[["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"}]],Tw=ge("bold",Ew),Nw=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],wc=ge("code",Nw),Aw=[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"m17 12 3-2v8",key:"1hhhft"}]],Ow=ge("heading-1",Aw),Rw=[["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"}]],Dw=ge("heading-2",Rw),jw=[["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"}]],Lw=ge("heading-3",jw),zw=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],$w=ge("image",zw),Iw=[["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"}]],Pw=ge("italic",Iw),Hw=[["path",{d:"M11 5h10",key:"1cz7ny"}],["path",{d:"M11 12h10",key:"1438ji"}],["path",{d:"M11 19h10",key:"11t30w"}],["path",{d:"M4 4h1v5",key:"10yrso"}],["path",{d:"M4 9h2",key:"r1h2o0"}],["path",{d:"M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02",key:"xtkcd5"}]],Bw=ge("list-ordered",Hw),Vw=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],Fw=ge("list",Vw),Ww=[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]],_w=ge("palette",Ww),Uw=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],qw=ge("pen",Uw),Kw=[["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"}]],Jw=ge("quote",Kw),Gw=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],Xw=ge("rotate-ccw",Gw),Yw=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],Qw=ge("rotate-cw",Yw),Zw=[["path",{d:"M16 4H9a3 3 0 0 0-2.83 4",key:"43sutm"}],["path",{d:"M14 12a4 4 0 0 1 0 8H6",key:"nlfj13"}],["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}]],ek=ge("strikethrough",Zw),tk=[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M17 12H7",key:"16if0g"}],["path",{d:"M19 19H5",key:"vjpgq2"}]],nk=ge("text-align-center",tk),rk=[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M21 19H7",key:"4cu937"}]],ok=ge("text-align-end",rk),sk=[["path",{d:"M3 5h18",key:"1u36vt"}],["path",{d:"M3 12h18",key:"1i2n21"}],["path",{d:"M3 19h18",key:"awlh7x"}]],ik=ge("text-align-justify",sk),ak=[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M17 19H3",key:"z6ezky"}]],lk=ge("text-align-start",ak),ck=[["path",{d:"M6 4v6a6 6 0 0 0 12 0V4",key:"9kb039"}],["line",{x1:"4",x2:"20",y1:"20",y2:"20",key:"nun2al"}]],dk=ge("underline",ck),ua=[{id:"black",cssVar:"var(--editor-text-black)",label:"Black/White"},{id:"gray-600",cssVar:"var(--editor-text-gray-600)",label:"Gray"},{id:"red-500",cssVar:"var(--editor-text-red-500)",label:"Red"},{id:"orange-500",cssVar:"var(--editor-text-orange-500)",label:"Orange"},{id:"yellow-500",cssVar:"var(--editor-text-yellow-500)",label:"Yellow"},{id:"green-500",cssVar:"var(--editor-text-green-500)",label:"Green"},{id:"blue-500",cssVar:"var(--editor-text-blue-500)",label:"Blue"},{id:"purple-500",cssVar:"var(--editor-text-purple-500)",label:"Purple"},{id:"pink-500",cssVar:"var(--editor-text-pink-500)",label:"Pink"}];function kc(n){const e=ua.find(t=>t.id===n);return e?e.cssVar:n}function vc(n){const e=ua.find(t=>t.cssVar===n);return e?e.id:n}function Sc(n){const e=jo.c(15),{currentColor:t,onColorSelect:r,onReset:o,onClose:s,type:i}=n,a=i==="text"?"텍스트 색상":"배경 색상";let l;e[0]!==a?(l=N.jsx("div",{className:"color-picker-label",children:a}),e[0]=a,e[1]=l):l=e[1];let c;e[2]!==t||e[3]!==s||e[4]!==r?(c=ua.map(p=>{const f=t===p.id||t===p.cssVar;return N.jsx("button",{type:"button",onClick:()=>{r(p.id),s()},className:`color-grid-button ${f?"selected":""}`,style:{backgroundColor:p.cssVar},title:`${p.label}`},p.id)}),e[2]=t,e[3]=s,e[4]=r,e[5]=c):c=e[5];let d;e[6]!==c?(d=N.jsx("div",{className:"color-grid",children:c}),e[6]=c,e[7]=d):d=e[7];let u;e[8]!==s||e[9]!==o?(u=N.jsx("button",{type:"button",onClick:()=>{o(),s()},className:"color-picker-reset-button",children:"색상 제거"}),e[8]=s,e[9]=o,e[10]=u):u=e[10];let h;return e[11]!==l||e[12]!==d||e[13]!==u?(h=N.jsxs("div",{className:"color-picker",children:[l,d,u]}),e[11]=l,e[12]=d,e[13]=u,e[14]=h):h=e[14],h}function uk(n){const e=jo.c(179),{editor:t,onAddImage:r,hideMenuButtons:o,classNames:s}=n;let i;e[0]!==o?(i=o===void 0?[]:o,e[0]=o,e[1]=i):i=e[1];const a=i,[l,c]=z.useState(!1),[d,u]=z.useState(!1),h=z.useRef(null),p=z.useRef(null);let f,m;e[2]===Symbol.for("react.memo_cache_sentinel")?(f=()=>{const nt=mn=>{h.current&&!h.current.contains(mn.target)&&c(!1),p.current&&!p.current.contains(mn.target)&&u(!1)};return document.addEventListener("mousedown",nt),()=>{document.removeEventListener("mousedown",nt)}},m=[],e[2]=f,e[3]=m):(f=e[2],m=e[3]),z.useEffect(f,m);let g;e[4]!==t?(g={editor:t,selector:hk},e[4]=t,e[5]=g):g=e[5];const y=kh(g);let w;e[6]!==s?.button?(w=nt=>Cn("menubar-button",nt&&"active",s?.button),e[6]=s?.button,e[7]=w):w=e[7];const x=w;let E;e[8]!==a?(E=nt=>a.includes(nt),e[8]=a,e[9]=E):E=e[9];const b=E,T=s?.container;let v;e[10]!==T?(v=Cn("menubar-container",T),e[10]=T,e[11]=v):v=e[11];let S;e[12]!==x||e[13]!==t||e[14]!==y||e[15]!==b?(S=!b("bold")&&N.jsx("button",{type:"button",onClick:()=>t.chain().focus().toggleBold().run(),title:"Bold (Ctrl+B)",className:x(y.isBold),children:N.jsx(Tw,{size:14})}),e[12]=x,e[13]=t,e[14]=y,e[15]=b,e[16]=S):S=e[16];let R;e[17]!==x||e[18]!==t||e[19]!==y||e[20]!==b?(R=!b("italic")&&N.jsx("button",{type:"button",onClick:()=>t.chain().focus().toggleItalic().run(),title:"Italic (Ctrl+I)",className:x(y.isItalic),children:N.jsx(Pw,{size:14})}),e[17]=x,e[18]=t,e[19]=y,e[20]=b,e[21]=R):R=e[21];let _;e[22]!==x||e[23]!==t||e[24]!==y||e[25]!==b?(_=!b("strike")&&N.jsx("button",{type:"button",onClick:()=>t.chain().focus().toggleStrike().run(),title:"Strikethrough",className:x(y.isStrike),children:N.jsx(ek,{size:14})}),e[22]=x,e[23]=t,e[24]=y,e[25]=b,e[26]=_):_=e[26];let $;e[27]!==x||e[28]!==t||e[29]!==y||e[30]!==b?($=!b("underline")&&N.jsx("button",{type:"button",onClick:()=>t.chain().focus().toggleUnderline().run(),title:"Underline (Ctrl+U)",className:x(y.isUnderline),children:N.jsx(dk,{size:14})}),e[27]=x,e[28]=t,e[29]=y,e[30]=b,e[31]=$):$=e[31];let Y;e[32]!==b?(Y=(!b("bold")||!b("italic")||!b("strike")||!b("underline")||!b("textColor")||!b("bgColor"))&&N.jsx("div",{className:"menubar-separator"}),e[32]=b,e[33]=Y):Y=e[33];let pe;e[34]!==x||e[35]!==t||e[36]!==y||e[37]!==b||e[38]!==l?(pe=!b("textColor")&&N.jsxs("div",{className:"color-picker-container",ref:h,children:[N.jsx("button",{type:"button",onClick:()=>{c(!l),u(!1)},title:"Text Color",className:Cn(x(!1),"color-button"),children:N.jsxs("div",{className:"color-button",children:[N.jsx(qw,{size:14}),N.jsx("div",{className:"color-display-bar",style:{backgroundColor:y.displayColor}})]})}),l&&N.jsx(Sc,{currentColor:y.currentColor,onColorSelect:nt=>{const mn=kc(nt);t.chain().focus().setColor(mn).run()},onReset:()=>t.chain().focus().unsetColor().run(),onClose:()=>c(!1),type:"text"})]}),e[34]=x,e[35]=t,e[36]=y,e[37]=b,e[38]=l,e[39]=pe):pe=e[39];let Z;e[40]!==x||e[41]!==t||e[42]!==y||e[43]!==b||e[44]!==d?(Z=!b("bgColor")&&N.jsxs("div",{className:"color-picker-container",ref:p,children:[N.jsx("button",{type:"button",onClick:()=>{u(!d),c(!1)},title:"Background Color",className:Cn(x(!1),"color-button"),children:N.jsxs("div",{className:"color-button",children:[N.jsx(_w,{size:14}),N.jsx("div",{className:"color-display-bar",style:{backgroundColor:y.displayHighlight}})]})}),d&&N.jsx(Sc,{currentColor:y.currentHighlight,onColorSelect:nt=>{const mn=kc(nt);t.chain().focus().toggleHighlight({color:mn}).run()},onReset:()=>t.chain().focus().unsetHighlight().run(),onClose:()=>u(!1),type:"background"})]}),e[40]=x,e[41]=t,e[42]=y,e[43]=b,e[44]=d,e[45]=Z):Z=e[45];let q;e[46]!==b?(q=(!b("table")||!b("image"))&&N.jsx("div",{className:"menubar-separator"}),e[46]=b,e[47]=q):q=e[47];let X;e[48]!==x||e[49]!==t||e[50]!==y||e[51]!==b?(X=!b("table")&&N.jsx("button",{type:"button",onClick:()=>t.chain().focus().insertTable({rows:3,cols:3}).run(),title:"Insert Table",className:x(y.isTable),children:N.jsxs("svg",{className:"menubar-table-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[N.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),N.jsx("path",{d:"M3 9h18M3 15h18M9 21V3M15 21V3"})]})}),e[48]=x,e[49]=t,e[50]=y,e[51]=b,e[52]=X):X=e[52];let ee;e[53]!==x||e[54]!==b||e[55]!==r?(ee=!b("image")&&r&&N.jsx("button",{type:"button",onClick:r,title:"Insert Image",className:x(!1),children:N.jsx($w,{size:14})}),e[53]=x,e[54]=b,e[55]=r,e[56]=ee):ee=e[56];let L;e[57]!==b?(L=(!b("h1")||!b("h2")||!b("h3")||!b("paragraph"))&&N.jsx("div",{className:"menubar-separator"}),e[57]=b,e[58]=L):L=e[58];let Se;e[59]!==x||e[60]!==t||e[61]!==y||e[62]!==b?(Se=!b("h1")&&N.jsx("button",{type:"button",onClick:()=>t.chain().focus().toggleHeading({level:1}).run(),title:"Heading 1",className:x(y.isHeading1),children:N.jsx(Ow,{size:14})}),e[59]=x,e[60]=t,e[61]=y,e[62]=b,e[63]=Se):Se=e[63];let Ce;e[64]!==x||e[65]!==t||e[66]!==y||e[67]!==b?(Ce=!b("h2")&&N.jsx("button",{type:"button",onClick:()=>t.chain().focus().toggleHeading({level:2}).run(),title:"Heading 2",className:x(y.isHeading2),children:N.jsx(Dw,{size:14})}),e[64]=x,e[65]=t,e[66]=y,e[67]=b,e[68]=Ce):Ce=e[68];let C;e[69]!==x||e[70]!==t||e[71]!==y||e[72]!==b?(C=!b("h3")&&N.jsx("button",{type:"button",onClick:()=>t.chain().focus().toggleHeading({level:3}).run(),title:"Heading 3",className:x(y.isHeading3),children:N.jsx(Lw,{size:14})}),e[69]=x,e[70]=t,e[71]=y,e[72]=b,e[73]=C):C=e[73];let B;e[74]!==x||e[75]!==t||e[76]!==y||e[77]!==b?(B=!b("paragraph")&&N.jsx("button",{type:"button",onClick:()=>t.chain().focus().setParagraph().run(),title:"Paragraph",className:x(y.isParagraph),children:"¶"}),e[74]=x,e[75]=t,e[76]=y,e[77]=b,e[78]=B):B=e[78];let V;e[79]!==b?(V=(!b("bulletList")||!b("orderedList"))&&N.jsx("div",{className:"menubar-separator"}),e[79]=b,e[80]=V):V=e[80];let U;e[81]!==x||e[82]!==t||e[83]!==y||e[84]!==b?(U=!b("bulletList")&&N.jsx("button",{type:"button",onClick:()=>t.chain().focus().toggleBulletList().run(),title:"Bullet List",className:x(y.isBulletList),children:N.jsx(Fw,{size:14})}),e[81]=x,e[82]=t,e[83]=y,e[84]=b,e[85]=U):U=e[85];let J;e[86]!==x||e[87]!==t||e[88]!==y||e[89]!==b?(J=!b("orderedList")&&N.jsx("button",{type:"button",onClick:()=>t.chain().focus().toggleOrderedList().run(),title:"Ordered List",className:x(y.isOrderedList),children:N.jsx(Bw,{size:14})}),e[86]=x,e[87]=t,e[88]=y,e[89]=b,e[90]=J):J=e[90];let oe;e[91]!==b?(oe=(!b("code")||!b("codeBlock")||!b("blockquote")||!b("horizontalRule"))&&N.jsx("div",{className:"menubar-separator"}),e[91]=b,e[92]=oe):oe=e[92];let F;e[93]!==x||e[94]!==t||e[95]!==y||e[96]!==b?(F=!b("code")&&N.jsx("button",{type:"button",onClick:()=>t.chain().focus().toggleCode().run(),title:"Code (Ctrl+`)",className:x(y.isCode),children:N.jsx(wc,{size:14})}),e[93]=x,e[94]=t,e[95]=y,e[96]=b,e[97]=F):F=e[97];let Ne;e[98]!==x||e[99]!==t||e[100]!==y||e[101]!==b?(Ne=!b("codeBlock")&&N.jsx("button",{type:"button",onClick:()=>t.chain().focus().toggleCodeBlock().run(),title:"Code Block",className:x(y.isCodeBlock),children:N.jsx(wc,{size:14})}),e[98]=x,e[99]=t,e[100]=y,e[101]=b,e[102]=Ne):Ne=e[102];let je;e[103]!==x||e[104]!==t||e[105]!==y||e[106]!==b?(je=!b("blockquote")&&N.jsx("button",{type:"button",onClick:()=>t.chain().focus().toggleBlockquote().run(),title:"Blockquote",className:x(y.isBlockquote),children:N.jsx(Jw,{size:14})}),e[103]=x,e[104]=t,e[105]=y,e[106]=b,e[107]=je):je=e[107];let Be;e[108]!==x||e[109]!==t||e[110]!==b?(Be=!b("horizontalRule")&&N.jsx("button",{type:"button",onClick:()=>t.chain().focus().setHorizontalRule().run(),title:"Horizontal Rule",className:x(!1),children:"—"}),e[108]=x,e[109]=t,e[110]=b,e[111]=Be):Be=e[111];let tt;e[112]!==b?(tt=(!b("alignLeft")||!b("alignCenter")||!b("alignRight")||!b("alignJustify"))&&N.jsx("div",{className:"menubar-separator"}),e[112]=b,e[113]=tt):tt=e[113];let Ye;e[114]!==x||e[115]!==t||e[116]!==y||e[117]!==b?(Ye=!b("alignLeft")&&N.jsx("button",{type:"button",onClick:()=>t.chain().focus().setTextAlign("left").run(),title:"Align Left",className:x(y.alignLeft),children:N.jsx(lk,{size:14})}),e[114]=x,e[115]=t,e[116]=y,e[117]=b,e[118]=Ye):Ye=e[118];let cn;e[119]!==x||e[120]!==t||e[121]!==y||e[122]!==b?(cn=!b("alignCenter")&&N.jsx("button",{type:"button",onClick:()=>t.chain().focus().setTextAlign("center").run(),title:"Align Center",className:x(y.alignCenter),children:N.jsx(nk,{size:14})}),e[119]=x,e[120]=t,e[121]=y,e[122]=b,e[123]=cn):cn=e[123];let dn;e[124]!==x||e[125]!==t||e[126]!==y||e[127]!==b?(dn=!b("alignRight")&&N.jsx("button",{type:"button",onClick:()=>t.chain().focus().setTextAlign("right").run(),title:"Align Right",className:x(y.alignRight),children:N.jsx(ok,{size:14})}),e[124]=x,e[125]=t,e[126]=y,e[127]=b,e[128]=dn):dn=e[128];let un;e[129]!==x||e[130]!==t||e[131]!==y||e[132]!==b?(un=!b("alignJustify")&&N.jsx("button",{type:"button",onClick:()=>t.chain().focus().setTextAlign("justify").run(),title:"Justify",className:x(y.alignJustify),children:N.jsx(ik,{size:14})}),e[129]=x,e[130]=t,e[131]=y,e[132]=b,e[133]=un):un=e[133];let hn;e[134]!==b?(hn=(!b("undo")||!b("redo"))&&N.jsx("div",{className:"menubar-separator"}),e[134]=b,e[135]=hn):hn=e[135];let pn;e[136]!==x||e[137]!==t||e[138]!==y||e[139]!==b?(pn=!b("undo")&&N.jsx("button",{type:"button",onClick:()=>t.chain().focus().undo().run(),disabled:!y.canUndo,title:"Undo (Ctrl+Z)",className:x(!1),children:N.jsx(Xw,{size:14})}),e[136]=x,e[137]=t,e[138]=y,e[139]=b,e[140]=pn):pn=e[140];let fn;e[141]!==x||e[142]!==t||e[143]!==y||e[144]!==b?(fn=!b("redo")&&N.jsx("button",{type:"button",onClick:()=>t.chain().focus().redo().run(),disabled:!y.canRedo,title:"Redo (Ctrl+Y)",className:x(!1),children:N.jsx(Qw,{size:14})}),e[141]=x,e[142]=t,e[143]=y,e[144]=b,e[145]=fn):fn=e[145];let yr;return e[146]!==S||e[147]!==R||e[148]!==_||e[149]!==$||e[150]!==Y||e[151]!==pe||e[152]!==Z||e[153]!==q||e[154]!==X||e[155]!==ee||e[156]!==L||e[157]!==Se||e[158]!==Ce||e[159]!==C||e[160]!==B||e[161]!==V||e[162]!==U||e[163]!==J||e[164]!==oe||e[165]!==F||e[166]!==Ne||e[167]!==je||e[168]!==Be||e[169]!==tt||e[170]!==Ye||e[171]!==cn||e[172]!==dn||e[173]!==un||e[174]!==hn||e[175]!==pn||e[176]!==fn||e[177]!==v?(yr=N.jsxs("div",{className:v,children:[S,R,_,$,Y,pe,Z,q,X,ee,L,Se,Ce,C,B,V,U,J,oe,F,Ne,je,Be,tt,Ye,cn,dn,un,hn,pn,fn]}),e[146]=S,e[147]=R,e[148]=_,e[149]=$,e[150]=Y,e[151]=pe,e[152]=Z,e[153]=q,e[154]=X,e[155]=ee,e[156]=L,e[157]=Se,e[158]=Ce,e[159]=C,e[160]=B,e[161]=V,e[162]=U,e[163]=J,e[164]=oe,e[165]=F,e[166]=Ne,e[167]=je,e[168]=Be,e[169]=tt,e[170]=Ye,e[171]=cn,e[172]=dn,e[173]=un,e[174]=hn,e[175]=pn,e[176]=fn,e[177]=v,e[178]=yr):yr=e[178],yr}function hk(n){const e=n.editor.getAttributes("textStyle").color,t=n.editor.getAttributes("highlight").color;return{isBold:n.editor.isActive("bold")??!1,isItalic:n.editor.isActive("italic")??!1,isUnderline:n.editor.isActive("underline")??!1,isStrike:n.editor.isActive("strike")??!1,isCode:n.editor.isActive("code")??!1,canClearMarks:n.editor.can().chain().unsetAllMarks().run()??!1,isParagraph:n.editor.isActive("paragraph")??!1,isHeading1:n.editor.isActive("heading",{level:1})??!1,isHeading2:n.editor.isActive("heading",{level:2})??!1,isHeading3:n.editor.isActive("heading",{level:3})??!1,isBulletList:n.editor.isActive("bulletList")??!1,isOrderedList:n.editor.isActive("orderedList")??!1,isCodeBlock:n.editor.isActive("codeBlock")??!1,isBlockquote:n.editor.isActive("blockquote")??!1,canUndo:n.editor.can().chain().undo().run()??!1,canRedo:n.editor.can().chain().redo().run()??!1,isTable:n.editor.isActive("table")??!1,alignLeft:n.editor.isActive({textAlign:"left"})??!1,alignCenter:n.editor.isActive({textAlign:"center"})??!1,alignRight:n.editor.isActive({textAlign:"right"})??!1,alignJustify:n.editor.isActive({textAlign:"justify"})??!1,currentColor:e?vc(e):"black",currentHighlight:t?vc(t):"#ffffff",displayColor:e||"var(--editor-text-black)",displayHighlight:t||"transparent"}}function Cc(n){if(!n)return"<p></p>";try{return JSON.parse(n)}catch{return n}}function pk({ref:n,className:e,classNames:t,initialContent:r="",hideMenuButtons:o=[]}){const s=wx({extensions:Ch,content:Cc(r),editorProps:{attributes:{class:Cn("tiptap-editor-content",t?.editorContent)},handlePaste(a,l){const c=l.clipboardData?.items;if(!c)return!1;for(let d=0;d<c.length;d++)if(c[d].kind==="file"&&c[d].type.startsWith("image/")){l.preventDefault();const u=c[d].getAsFile();if(!u)continue;const h=new FileReader;return h.onload=p=>{const f=p.target?.result,{state:m}=a,{$from:g}=m.selection,y=m.schema.nodes.image.create({src:f}),w=m.tr.insert(g.pos,y);a.dispatch(w)},h.readAsDataURL(u),!0}return!1},handleDOMEvents:{copy:(a,l)=>{const{state:c}=a,{selection:d}=c,{$from:u,$to:h}=d;return c.doc.nodesBetween(u.pos,h.pos,p=>{if(p.type.name==="image"&&p.attrs.src){if(l.preventDefault(),l.clipboardData){if(p.attrs.src.startsWith("data:image/"))try{const f=p.attrs.src.split(",")[1],m=p.attrs.src.match(/data:([^;]+);/)?.[1]||"image/png",g=atob(f),y=new Array(g.length);for(let b=0;b<g.length;b++)y[b]=g.charCodeAt(b);const w=new Uint8Array(y),x=new Blob([w],{type:m}),E=new ClipboardItem({[m]:x});navigator.clipboard.write([E]).catch(b=>{console.error("Failed to copy image to clipboard:",b)})}catch(f){console.error("Failed to process image for clipboard:",f)}l.clipboardData.setData("text/html",`<img src="${p.attrs.src}" />`),l.clipboardData.setData("text/plain",p.attrs.src)}return!1}}),!1},cut:(a,l)=>{const{state:c}=a,{selection:d}=c,{$from:u,$to:h}=d;return c.doc.nodesBetween(u.pos,h.pos,(p,f)=>{if(p.type.name==="image"&&p.attrs.src){if(l.preventDefault(),l.clipboardData){if(p.attrs.src.startsWith("data:image/"))try{const g=p.attrs.src.split(",")[1],y=p.attrs.src.match(/data:([^;]+);/)?.[1]||"image/png",w=atob(g),x=new Array(w.length);for(let v=0;v<w.length;v++)x[v]=w.charCodeAt(v);const E=new Uint8Array(x),b=new Blob([E],{type:y}),T=new ClipboardItem({[y]:b});navigator.clipboard.write([T]).catch(v=>{console.error("Failed to copy image to clipboard:",v)})}catch(g){console.error("Failed to process image for clipboard:",g)}l.clipboardData.setData("text/html",`<img src="${p.attrs.src}" />`),l.clipboardData.setData("text/plain",p.attrs.src)}const m=c.tr.delete(f,f+p.nodeSize);return a.dispatch(m),!1}}),!1}}}}),i=z.useCallback(()=>{const a=document.createElement("input");a.type="file",a.accept="image/*",a.onchange=l=>{const c=l.target.files?.[0];if(!c||!s)return;const d=new FileReader;d.onload=u=>{const h=u.target?.result;s.chain().focus().insertContent({type:"image",attrs:{src:h}}).run()},d.readAsDataURL(c)},a.click()},[s]);return z.useEffect(()=>{if(s&&r&&r.trim()){const a=Cc(r);s.commands.setContent(a)}},[s,r]),z.useImperativeHandle(n,()=>({getJSON:()=>s?JSON.stringify(s.getJSON()):"{}"}),[s]),s?N.jsxs("div",{className:Cn("tiptap-editor-wrapper",e),children:[N.jsx(uk,{editor:s,onAddImage:i,hideMenuButtons:o,classNames:{container:t?.menubarContainer,button:t?.menubarButton}}),N.jsx(mx,{editor:s})]}):null}function fk(n,e,t){if(typeof window>"u")throw new Error("getHTMLFromFragment can only be used in a browser environment\nIf you want to use this in a Node environment, use the `@tiptap/html/server` import instead.");const r=Bt.fromSchema(e).serializeFragment(n.content,{document:window.document});return new XMLSerializer().serializeToString(r)}function mk(n,e){if(typeof window>"u")throw new Error("generateHTML can only be used in a browser environment\nIf you want to use this in a Node environment, use the `@tiptap/html/server` import instead.");const t=qg(e),r=Je.fromJSON(t,n);return fk(r,t)}function gk(n){if(!n)return"<p></p>";try{const e=JSON.parse(n);let t=mk(e,Ch);return t=t.replace(/<p[^>]*><\/p>/g,"<p><br></p>"),t}catch{return n}}const Hh=n=>{const e=jo.c(4),{content:t}=n;let r;e[0]!==t?(r=gk(t),e[0]=t,e[1]=r):r=e[1];let o;return e[2]!==r?(o=N.jsx("div",{className:"content-div",dangerouslySetInnerHTML:{__html:r}}),e[2]=r,e[3]=o):o=e[3],o},Do=n=>{const e=ln.compilerRuntimeExports.c(18),{ref:t,tiptapRef:r,initialContent:o,isSubmitting:s,onSubmit:i,onCancel:a,submitLabel:l,cancelLabel:c,showLabel:d,labelText:u,containerClassName:h}=n,p=o===void 0?"":o,f=s===void 0?!1:s,m=l===void 0?"작성":l,g=c===void 0?"취소":c,y=d===void 0?!0:d,w=u===void 0?"댓글 작성":u,E=`flex flex-col gap-2 rounded-lg bg-gray-50 p-3 dark:bg-gray-800/50 ${h===void 0?"":h}`;let b;e[0]!==g||e[1]!==f||e[2]!==w||e[3]!==a||e[4]!==i||e[5]!==y||e[6]!==m?(b=y&&k.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-between",children:[k.jsxRuntimeExports.jsx("label",{className:"text-xs font-medium text-gray-700 dark:text-gray-300",children:w}),k.jsxRuntimeExports.jsxs("div",{className:"flex gap-2",children:[k.jsxRuntimeExports.jsxs(k.Button,{size:"sm",onClick:i,disabled:f,children:[f?k.jsxRuntimeExports.jsx(Pe.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}):k.jsxRuntimeExports.jsx(Pe.Send,{className:"mr-2 h-4 w-4"}),m]}),k.jsxRuntimeExports.jsx(k.Button,{size:"sm",variant:"outline",onClick:a,disabled:f,children:g})]})]}),e[0]=g,e[1]=f,e[2]=w,e[3]=a,e[4]=i,e[5]=y,e[6]=m,e[7]=b):b=e[7];let T,v;e[8]===Symbol.for("react.memo_cache_sentinel")?(T={menubarContainer:"dark:bg-background!",editorContent:"dark:bg-card! min-h-[4rem]! max-h-[8rem]! overflow-y-auto"},v=["table","bgColor","undo","redo","alignLeft","alignCenter","alignRight","alignJustify","paragraph"],e[8]=T,e[9]=v):(T=e[8],v=e[9]);let S;e[10]!==p||e[11]!==r?(S=k.jsxRuntimeExports.jsx("div",{className:"overflow-hidden rounded-lg border border-gray-200 bg-white dark:border-gray-700 dark:bg-gray-900",children:k.jsxRuntimeExports.jsx(pk,{ref:r,initialContent:p,className:"rounded",classNames:T,hideMenuButtons:v})}),e[10]=p,e[11]=r,e[12]=S):S=e[12];let R;return e[13]!==t||e[14]!==S||e[15]!==E||e[16]!==b?(R=k.jsxRuntimeExports.jsxs("div",{ref:t,className:E,children:[b,S]}),e[13]=t,e[14]=S,e[15]=E,e[16]=b,e[17]=R):R=e[17],R},yk=n=>{const e=ln.compilerRuntimeExports.c(10),{onEdit:t,onDelete:r}=n;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=k.jsxRuntimeExports.jsx(k.PopoverTrigger,{asChild:!0,children:k.jsxRuntimeExports.jsx(k.Button,{size:"sm",variant:"ghost",className:"h-auto px-2 py-1 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200",children:k.jsxRuntimeExports.jsx(Pe.MoreHorizontal,{className:"h-5 w-5"})})}),e[0]=o):o=e[0];let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s=k.jsxRuntimeExports.jsx(Pe.Edit2,{className:"mr-2 h-3 w-3"}),e[1]=s):s=e[1];let i;e[2]!==t?(i=k.jsxRuntimeExports.jsxs(k.Button,{size:"sm",variant:"ghost",onClick:t,className:"justify-start text-xs text-gray-700 dark:text-gray-300",children:[s,"수정"]}),e[2]=t,e[3]=i):i=e[3];let a;e[4]===Symbol.for("react.memo_cache_sentinel")?(a=k.jsxRuntimeExports.jsx(Pe.Trash2,{className:"mr-2 h-3 w-3"}),e[4]=a):a=e[4];let l;e[5]!==r?(l=k.jsxRuntimeExports.jsxs(k.Button,{size:"sm",variant:"ghost",onClick:r,className:"justify-start text-xs text-red-600 hover:text-red-700 dark:text-red-400 dark:hover:text-red-300",children:[a,"삭제"]}),e[5]=r,e[6]=l):l=e[6];let c;return e[7]!==i||e[8]!==l?(c=k.jsxRuntimeExports.jsxs(k.Popover,{children:[o,k.jsxRuntimeExports.jsx(k.PopoverContent,{className:"w-auto p-1",children:k.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-1",children:[i,l]})})]}),e[7]=i,e[8]=l,e[9]=c):c=e[9],c},Bh=n=>{const e=ln.compilerRuntimeExports.c(49),{comment:t,level:r,currentUserId:o,onReplyOpen:s,replyingToId:i,replyEditorRef:a,onSubmitReply:l,isSubmitting:c,onEdit:d,editingId:u,editEditorRef:h,onSubmitEdit:p,onDelete:f,isEditing:m}=n,g=i===t.id,y=u===t.id,w=t.children&&t.children.length>0,x=`reply-editor-${t.id}`,E=r>0&&"ml-4 border-l border-gray-200 pl-4 dark:border-gray-700";let b;e[0]!==E?(b=k.cn("flex flex-col gap-2",E),e[0]=E,e[1]=b):b=e[1];let T;e[2]!==t.body||e[3]!==t.createdAt||e[4]!==t.id||e[5]!==t.isAdmin||e[6]!==t.userId||e[7]!==t.userName||e[8]!==o||e[9]!==h||e[10]!==m||e[11]!==y||e[12]!==g||e[13]!==r||e[14]!==f||e[15]!==d||e[16]!==s||e[17]!==p||e[18]!==x?(T=y?k.jsxRuntimeExports.jsx(Do,{tiptapRef:h,initialContent:t.body,isSubmitting:m,onSubmit:()=>p(t.id),onCancel:()=>d(""),submitLabel:"수정",labelText:"댓글 수정"}):k.jsxRuntimeExports.jsx("div",{className:"py-2",children:k.jsxRuntimeExports.jsxs("div",{className:"flex items-start justify-between gap-3",children:[k.jsxRuntimeExports.jsxs("div",{className:"flex-1",children:[k.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2",children:[k.jsxRuntimeExports.jsx("span",{className:"text-xs font-medium text-gray-900 dark:text-gray-100",children:t.userName}),t.isAdmin&&k.jsxRuntimeExports.jsx("span",{className:"inline-flex items-center rounded-full bg-blue-100 px-2 py-0.5 text-xs font-semibold text-blue-800 dark:bg-blue-900/30 dark:text-blue-400",children:"👨💼 관리자"}),k.jsxRuntimeExports.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:Ec.format(new Date(t.createdAt),"yyyy-MM-dd HH:mm")})]}),k.jsxRuntimeExports.jsx("div",{className:"mt-2 text-sm text-gray-700 dark:text-gray-300",children:k.jsxRuntimeExports.jsx(Hh,{content:t.body})}),!g&&k.jsxRuntimeExports.jsx("div",{className:"mt-2 flex items-center gap-3",children:r<2&&k.jsxRuntimeExports.jsx(k.Button,{size:"sm",variant:"ghost",onClick:()=>{s(t.id),setTimeout(()=>{const _=document.getElementById(x);_&&(_.scrollIntoView({behavior:"auto",block:"center"}),_.querySelector("[contenteditable]")?.focus())},50)},className:"h-auto px-2 py-1 text-sm font-medium text-gray-600 hover:text-gray-900 dark:text-gray-400 dark:hover:text-gray-200",children:"💬 답글"})})]}),o===t.userId&&k.jsxRuntimeExports.jsx(yk,{onEdit:()=>d(t.id),onDelete:()=>f(t.id)})]})}),e[2]=t.body,e[3]=t.createdAt,e[4]=t.id,e[5]=t.isAdmin,e[6]=t.userId,e[7]=t.userName,e[8]=o,e[9]=h,e[10]=m,e[11]=y,e[12]=g,e[13]=r,e[14]=f,e[15]=d,e[16]=s,e[17]=p,e[18]=x,e[19]=T):T=e[19];let v;e[20]!==t.id||e[21]!==g||e[22]!==c||e[23]!==s||e[24]!==l||e[25]!==x||e[26]!==a?(v=g&&k.jsxRuntimeExports.jsx(Do,{ref:_=>{_&&(_.id=x)},tiptapRef:a,isSubmitting:c,onSubmit:()=>l(t.id),onCancel:()=>s(""),submitLabel:"작성",labelText:"답글 작성"}),e[20]=t.id,e[21]=g,e[22]=c,e[23]=s,e[24]=l,e[25]=x,e[26]=a,e[27]=v):v=e[27];let S;e[28]!==t.children||e[29]!==o||e[30]!==h||e[31]!==u||e[32]!==w||e[33]!==m||e[34]!==c||e[35]!==r||e[36]!==f||e[37]!==d||e[38]!==s||e[39]!==p||e[40]!==l||e[41]!==a||e[42]!==i?(S=w&&k.jsxRuntimeExports.jsx("div",{className:"flex flex-col gap-2",children:t.children.map(_=>k.jsxRuntimeExports.jsx(Bh,{comment:_,level:r+1,currentUserId:o,onReplyOpen:s,replyingToId:i,replyEditorRef:a,onSubmitReply:l,isSubmitting:c,onEdit:d,editingId:u,editEditorRef:h,onSubmitEdit:p,onDelete:f,isEditing:m},_.id))}),e[28]=t.children,e[29]=o,e[30]=h,e[31]=u,e[32]=w,e[33]=m,e[34]=c,e[35]=r,e[36]=f,e[37]=d,e[38]=s,e[39]=p,e[40]=l,e[41]=a,e[42]=i,e[43]=S):S=e[43];let R;return e[44]!==b||e[45]!==T||e[46]!==v||e[47]!==S?(R=k.jsxRuntimeExports.jsxs("div",{className:b,children:[T,v,S]}),e[44]=b,e[45]=T,e[46]=v,e[47]=S,e[48]=R):R=e[48],R},bk=n=>{const e=ln.compilerRuntimeExports.c(33),{comments:t,isLoading:r,isCommentEditOpen:o,onCommentEditOpen:s,commentEditorRef:i,onSubmitComment:a,isSubmitting:l,replyingToId:c,onReplyOpen:d,replyEditorRef:u,onSubmitReply:h,editingId:p,onEdit:f,editEditorRef:m,onSubmitEdit:g,onDelete:y,isEditing:w,currentUserId:x}=n;let E;e[0]!==t.length?(E=k.jsxRuntimeExports.jsxs("h3",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:["댓글 (",t.length,")"]}),e[0]=t.length,e[1]=E):E=e[1];let b;e[2]!==o||e[3]!==s?(b=!o&&k.jsxRuntimeExports.jsxs(k.Button,{size:"sm",variant:"outline",onClick:()=>s(!0),children:[k.jsxRuntimeExports.jsx(Pe.Send,{className:"mr-2 h-4 w-4"}),"댓글 작성"]}),e[2]=o,e[3]=s,e[4]=b):b=e[4];let T;e[5]!==E||e[6]!==b?(T=k.jsxRuntimeExports.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[E,b]}),e[5]=E,e[6]=b,e[7]=T):T=e[7];let v;e[8]!==i||e[9]!==o||e[10]!==l||e[11]!==s||e[12]!==a?(v=o&&k.jsxRuntimeExports.jsx(Do,{tiptapRef:i,isSubmitting:l,onSubmit:a,onCancel:()=>s(!1),submitLabel:"작성",labelText:"댓글 작성"}),e[8]=i,e[9]=o,e[10]=l,e[11]=s,e[12]=a,e[13]=v):v=e[13];let S;e[14]!==t||e[15]!==x||e[16]!==m||e[17]!==p||e[18]!==w||e[19]!==r||e[20]!==l||e[21]!==y||e[22]!==f||e[23]!==d||e[24]!==g||e[25]!==h||e[26]!==u||e[27]!==c?(S=k.jsxRuntimeExports.jsx("div",{className:"mt-4",children:r?k.jsxRuntimeExports.jsx("div",{className:"flex justify-center py-4",children:k.jsxRuntimeExports.jsx(Pe.Loader2,{className:"h-4 w-4 animate-spin text-gray-400"})}):t.length===0?k.jsxRuntimeExports.jsx("div",{className:"text-center text-xs text-gray-500 dark:text-gray-400",children:"아직 댓글이 없습니다."}):k.jsxRuntimeExports.jsx("div",{className:"flex flex-col gap-0",children:t.map((_,$)=>k.jsxRuntimeExports.jsxs("div",{children:[k.jsxRuntimeExports.jsx(Bh,{comment:_,level:0,currentUserId:x,onReplyOpen:d,replyingToId:c,replyEditorRef:u,onSubmitReply:h,isSubmitting:l,onEdit:f,editingId:p,editEditorRef:m,onSubmitEdit:g,onDelete:y,isEditing:w}),$<t.length-1&&k.jsxRuntimeExports.jsx(k.Separator,{className:"my-3 bg-gray-200 dark:bg-gray-700"})]},_.id))})}),e[14]=t,e[15]=x,e[16]=m,e[17]=p,e[18]=w,e[19]=r,e[20]=l,e[21]=y,e[22]=f,e[23]=d,e[24]=g,e[25]=h,e[26]=u,e[27]=c,e[28]=S):S=e[28];let R;return e[29]!==T||e[30]!==v||e[31]!==S?(R=k.jsxRuntimeExports.jsxs("div",{children:[T,v,S]}),e[29]=T,e[30]=v,e[31]=S,e[32]=R):R=e[32],R},xk=n=>{const e=ln.compilerRuntimeExports.c(35),{feedback:t,currentUserId:r,onEditClick:o,onDeleteClick:s}=n;let i;e[0]!==t.feedbackDetail.title?(i=k.jsxRuntimeExports.jsx("h2",{className:"text-lg font-medium text-gray-900 dark:text-gray-100",children:t.feedbackDetail.title}),e[0]=t.feedbackDetail.title,e[1]=i):i=e[1];let a;e[2]!==t.userName?(a=k.jsxRuntimeExports.jsx("span",{className:"text-xs font-medium text-gray-700 dark:text-gray-300",children:t.userName}),e[2]=t.userName,e[3]=a):a=e[3];let l;e[4]!==t.institutionName?(l=t.institutionName&&k.jsxRuntimeExports.jsxs("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:["· ",t.institutionName]}),e[4]=t.institutionName,e[5]=l):l=e[5];let c;e[6]!==a||e[7]!==l?(c=k.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2",children:[a,l]}),e[6]=a,e[7]=l,e[8]=c):c=e[8];let d;e[9]!==t.createdAt?(d=Ec.format(new Date(t.createdAt),"yyyy-MM-dd HH:mm"),e[9]=t.createdAt,e[10]=d):d=e[10];let u;e[11]!==d?(u=k.jsxRuntimeExports.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:d}),e[11]=d,e[12]=u):u=e[12];const h=t.status==="pending"?"bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-400":"bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400";let p;e[13]!==h?(p=k.cn("inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium",h),e[13]=h,e[14]=p):p=e[14];const f=t.status==="pending"?"미해결":"해결됨";let m;e[15]!==p||e[16]!==f?(m=k.jsxRuntimeExports.jsx("span",{className:p,children:f}),e[15]=p,e[16]=f,e[17]=m):m=e[17];let g;e[18]!==m||e[19]!==u?(g=k.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2",children:[u,m]}),e[18]=m,e[19]=u,e[20]=g):g=e[20];let y;e[21]!==g||e[22]!==c?(y=k.jsxRuntimeExports.jsxs("div",{className:"mt-3 flex flex-col gap-2",children:[c,g]}),e[21]=g,e[22]=c,e[23]=y):y=e[23];let w;e[24]!==i||e[25]!==y?(w=k.jsxRuntimeExports.jsxs("div",{className:"flex-1",children:[i,y]}),e[24]=i,e[25]=y,e[26]=w):w=e[26];let x;e[27]!==r||e[28]!==t.userId||e[29]!==s||e[30]!==o?(x=r===t.userId&&k.jsxRuntimeExports.jsxs(k.Popover,{children:[k.jsxRuntimeExports.jsx(k.PopoverTrigger,{asChild:!0,children:k.jsxRuntimeExports.jsx(k.Button,{size:"sm",variant:"ghost",className:"h-auto px-2 py-1 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200",children:k.jsxRuntimeExports.jsx(Pe.MoreHorizontal,{className:"h-5 w-5"})})}),k.jsxRuntimeExports.jsx(k.PopoverContent,{className:"w-auto p-1",children:k.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-1",children:[k.jsxRuntimeExports.jsxs(k.Button,{size:"sm",variant:"ghost",onClick:o,className:"justify-start text-xs text-gray-700 dark:text-gray-300",children:[k.jsxRuntimeExports.jsx(Pe.Edit2,{className:"mr-2 h-3 w-3"}),"수정"]}),k.jsxRuntimeExports.jsxs(k.Button,{size:"sm",variant:"ghost",onClick:s,className:"justify-start text-xs text-red-600 hover:text-red-700 dark:text-red-400 dark:hover:text-red-300",children:[k.jsxRuntimeExports.jsx(Pe.Trash2,{className:"mr-2 h-3 w-3"}),"삭제"]})]})})]}),e[27]=r,e[28]=t.userId,e[29]=s,e[30]=o,e[31]=x):x=e[31];let E;return e[32]!==w||e[33]!==x?(E=k.jsxRuntimeExports.jsxs("div",{className:"mb-6 flex items-start justify-between",children:[w,x]}),e[32]=w,e[33]=x,e[34]=E):E=e[34],E},wk=n=>{const e=ln.compilerRuntimeExports.c(12),{feedback:t,isEditing:r,isUpdating:o,currentUserRole:s,feedbackEditorRef:i,titleInputRef:a,onEditCancel:l,onEditSave:c,onStatusChange:d}=n;let u;return e[0]!==s||e[1]!==t.feedbackDetail.body||e[2]!==t.feedbackDetail.title||e[3]!==t.status||e[4]!==i||e[5]!==r||e[6]!==o||e[7]!==l||e[8]!==c||e[9]!==d||e[10]!==a?(u=k.jsxRuntimeExports.jsx("div",{className:"mb-6",children:r?k.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-4",children:[k.jsxRuntimeExports.jsxs("div",{className:"rounded-lg bg-gray-50 p-3 dark:bg-gray-800/50",children:[k.jsxRuntimeExports.jsx("label",{className:"mb-2 block text-xs font-medium text-gray-700 dark:text-gray-300",children:"제목"}),k.jsxRuntimeExports.jsx("input",{ref:a,type:"text",defaultValue:t.feedbackDetail.title,className:"w-full rounded-lg border border-gray-200 bg-white px-3 py-2 text-sm text-gray-900 placeholder-gray-400 focus:border-blue-500 focus:outline-none focus:ring-1 focus:ring-blue-500 dark:border-gray-700 dark:bg-gray-900 dark:text-gray-100 dark:placeholder-gray-500",placeholder:"피드백 제목을 입력하세요"})]}),k.jsxRuntimeExports.jsx(Do,{tiptapRef:i,initialContent:t.feedbackDetail.body,isSubmitting:o,onSubmit:c,onCancel:l,submitLabel:"수정",labelText:"피드백 수정",showLabel:!0})]}):k.jsxRuntimeExports.jsxs(k.jsxRuntimeExports.Fragment,{children:[k.jsxRuntimeExports.jsx("div",{className:"prose prose-sm dark:prose-invert mb-6 max-w-none text-gray-900 dark:text-gray-100",children:k.jsxRuntimeExports.jsx(Hh,{content:t.feedbackDetail.body})}),k.jsxRuntimeExports.jsx("div",{className:"w-full",children:k.jsxRuntimeExports.jsxs("div",{className:k.cn("flex items-center justify-between rounded-lg px-4 py-4 font-medium",t.status==="pending"?"bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-400":"bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400"),children:[k.jsxRuntimeExports.jsxs("div",{children:[k.jsxRuntimeExports.jsxs("div",{className:"mb-1 text-sm font-semibold",children:[t.status==="pending"?"아직 미해결이에요":"해결되었어요"," ",t.status==="pending"?"⏳":"✓"]}),k.jsxRuntimeExports.jsx("div",{className:"text-xs opacity-90",children:t.status==="pending"?"담당자가 검토하고 있습니다. 조금 더 기다려주세요.":"소중한 피드백 감사합니다!"})]}),s==="admin"&&k.jsxRuntimeExports.jsxs(k.Button,{size:"sm",onClick:d,disabled:o,className:k.cn("shrink-0 gap-1",t.status==="pending"?"bg-yellow-700 hover:bg-yellow-800 dark:bg-yellow-600 dark:hover:bg-yellow-700":"bg-green-700 hover:bg-green-800 dark:bg-green-600 dark:hover:bg-green-700"),children:[o?k.jsxRuntimeExports.jsx(Pe.Loader2,{className:"h-4 w-4 animate-spin"}):k.jsxRuntimeExports.jsx(Pe.RefreshCw,{className:"h-4 w-4"}),t.status==="pending"?"해결":"미해결"]})]})})]})}),e[0]=s,e[1]=t.feedbackDetail.body,e[2]=t.feedbackDetail.title,e[3]=t.status,e[4]=i,e[5]=r,e[6]=o,e[7]=l,e[8]=c,e[9]=d,e[10]=a,e[11]=u):u=e[11],u},kk=()=>{const n=ln.compilerRuntimeExports.c(1),e=z.useRef(null),t=z.useRef(null),r=z.useRef(null),o=z.useRef(null),s=vk,i=Sk,a=Ck;let l;return n[0]===Symbol.for("react.memo_cache_sentinel")?(l={commentEditorRef:e,replyEditorRef:t,editEditorRef:r,feedbackEditorRef:o,clearEditor:s,getEditorContent:i,validateContent:a},n[0]=l):l=n[0],l};function vk(n){n.current?.editor?.commands?.clearContent?.()}function Sk(n){return n.current?.getJSON?.()??""}function Ck(n){return n?typeof n=="string"?n.trim().length>0:!0:!1}const Mk=({feedback:n,isFeedbackLoading:e,feedbackError:t,comments:r,isCommentsLoading:o,currentUser:s,onClose:i,callbacks:a,isDialog:l=!1})=>{const{commentEditorRef:c,replyEditorRef:d,editEditorRef:u,feedbackEditorRef:h,clearEditor:p,getEditorContent:f,validateContent:m}=kk(),[g,y]=z.useState(!1),[w,x]=z.useState(null),[E,b]=z.useState(null),[T,v]=z.useState(!1),S=z.useRef(null),[R,_]=z.useTransition(),[$,Y]=z.useTransition(),[pe,Z]=z.useTransition(),[q,X]=z.useTransition(),ee=r||[],L=async()=>{const J=f(c);if(!m(J))return a.onValidateError("empty");n?.id&&_(async()=>{try{await a.onCommentCreate(n.id,{body:J}),p(c),y(!1),a.onCommentChanged()}catch(oe){a.onError(oe)}})},Se=async J=>{const oe=f(d);if(!m(oe))return a.onValidateError("empty");n?.id&&_(async()=>{try{await a.onCommentCreate(n.id,{body:oe,refId:J}),p(d),x(null),a.onCommentChanged()}catch(F){a.onError(F)}})},Ce=async J=>{const oe=f(u);if(!m(oe))return a.onValidateError("empty");Y(async()=>{try{await a.onCommentUpdate(J,{body:oe}),b(null),p(u),a.onCommentChanged()}catch(F){a.onError(F)}})},C=async J=>{confirm("댓글을 삭제하시겠습니까?")&&Z(async()=>{try{await a.onCommentDelete(J),a.onCommentChanged()}catch(oe){a.onError(oe)}})},B=async()=>{const J=S.current?.value||"",oe=f(h);if(!m(J)){a.onValidateError("empty");return}if(!m(oe)){a.onValidateError("empty");return}n&&X(async()=>{try{await a.onFeedbackUpdate(n.id,{feedbackDetail:{title:J,body:oe}}),v(!1),p(h),a.onFeedbackChanged()}catch(F){a.onError(F)}})},V=async()=>{n&&X(async()=>{try{const J=n.status==="pending"?"resolved":"pending";await a.onFeedbackStatusUpdate?.(n.id,{status:J}),a.onFeedbackChanged()}catch(J){a.onError(J)}})},U=async()=>{if(confirm("피드백을 삭제하시겠습니까?")&&n?.id)try{await a.onDeleteFeedback(n.id),i?i():window.close()}catch(J){a.onError(J)}};if(e){const J=k.jsxRuntimeExports.jsx("div",{className:"flex items-center justify-center py-8",children:k.jsxRuntimeExports.jsx(Pe.Loader2,{className:"h-6 w-6 animate-spin text-gray-400"})});return l?J:k.jsxRuntimeExports.jsx("div",{className:"bg-background flex min-h-screen items-center justify-center",children:J})}if(t||!n){const J=k.jsxRuntimeExports.jsxs("div",{className:"flex flex-col items-center justify-center p-4",children:[k.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2 rounded-md bg-red-50 p-4 text-sm text-red-700 dark:bg-red-900/20 dark:text-red-400",children:[k.jsxRuntimeExports.jsx(Pe.AlertCircle,{className:"h-4 w-4 shrink-0"}),k.jsxRuntimeExports.jsx("span",{children:"피드백을 불러오는데 실패했습니다."})]}),!l&&k.jsxRuntimeExports.jsx(k.Button,{onClick:()=>window.close(),variant:"ghost",size:"sm",className:"mt-4 text-gray-600 hover:text-gray-900 dark:text-gray-400 dark:hover:text-gray-100",children:"닫기"})]});return l?k.jsxRuntimeExports.jsx("div",{className:"flex items-center justify-center py-8",children:J}):k.jsxRuntimeExports.jsx("div",{className:"bg-background flex min-h-screen flex-col items-center justify-center",children:J})}return k.jsxRuntimeExports.jsxs("div",{className:k.cn("bg-background flex flex-col",l?"h-auto":"min-h-screen"),children:[k.jsxRuntimeExports.jsx("div",{className:"shrink-0 border-b border-gray-200 py-4 dark:border-gray-700",children:k.jsxRuntimeExports.jsx("div",{className:"mx-auto max-w-4xl px-6",children:k.jsxRuntimeExports.jsx("div",{className:"flex items-center justify-between",children:k.jsxRuntimeExports.jsx("h1",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100",children:"피드백 상세"})})})}),k.jsxRuntimeExports.jsx("div",{className:"bg-background flex-1 overflow-y-auto",children:k.jsxRuntimeExports.jsxs("div",{className:"mx-auto max-w-4xl px-6 py-6",children:[k.jsxRuntimeExports.jsx(xk,{feedback:n,currentUserId:s?.id,onEditClick:()=>v(!0),onDeleteClick:U}),k.jsxRuntimeExports.jsx(wk,{feedback:n,isEditing:T,isUpdating:q,currentUserRole:s?.role,feedbackEditorRef:h,titleInputRef:S,onEditCancel:()=>v(!1),onEditSave:B,onStatusChange:V}),k.jsxRuntimeExports.jsx(k.Separator,{className:"mb-6 bg-gray-200 dark:bg-gray-700"}),k.jsxRuntimeExports.jsx(bk,{comments:ee,isLoading:o,isCommentEditOpen:g,onCommentEditOpen:y,commentEditorRef:c,onSubmitComment:L,isSubmitting:R,replyingToId:w,onReplyOpen:x,replyEditorRef:d,onSubmitReply:Se,editingId:E,onEdit:b,editEditorRef:u,onSubmitEdit:Ce,onDelete:C,isEditing:$||pe,currentUserId:s?.id})]})})]})};exports.FeedbackDetailPageContent=Mk;
|
|
153
|
+
`):"",markdownTokenizer:{name:"taskList",level:"block",start(n){var e;const t=(e=n.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))==null?void 0:e.index;return t!==void 0?t:-1},tokenize(n,e,t){const r=s=>{const i=ei(s,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:a=>({indentLevel:a[1].length,mainContent:a[4],checked:a[3].toLowerCase()==="x"}),createToken:(a,l)=>({type:"taskItem",raw:"",mainContent:a.mainContent,indentLevel:a.indentLevel,checked:a.checked,text:a.mainContent,tokens:t.inlineTokens(a.mainContent),nestedTokens:l}),customNestedParser:r},t);return i?[{type:"taskList",raw:i.raw,items:i.items}]:t.blockTokens(s)},o=ei(n,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:s=>({indentLevel:s[1].length,mainContent:s[4],checked:s[3].toLowerCase()==="x"}),createToken:(s,i)=>({type:"taskItem",raw:"",mainContent:s.mainContent,indentLevel:s.indentLevel,checked:s.checked,text:s.mainContent,tokens:t.inlineTokens(s.mainContent),nestedTokens:i}),customNestedParser:r},t);if(o)return{type:"taskList",raw:o.raw,items:o.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:n})=>n.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});te.create({name:"listKit",addExtensions(){const n=[];return this.options.bulletList!==!1&&n.push(sh.configure(this.options.bulletList)),this.options.listItem!==!1&&n.push(ih.configure(this.options.listItem)),this.options.listKeymap!==!1&&n.push(hh.configure(this.options.listKeymap)),this.options.orderedList!==!1&&n.push(fh.configure(this.options.orderedList)),this.options.taskItem!==!1&&n.push(k1.configure(this.options.taskItem)),this.options.taskList!==!1&&n.push(v1.configure(this.options.taskList)),n}});var S1=ve.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:n}){return["p",re(this.options.HTMLAttributes,n),0]},parseMarkdown:(n,e)=>{const t=n.tokens||[];return t.length===1&&t[0].type==="image"?e.parseChildren([t[0]]):e.createNode("paragraph",void 0,e.parseInline(t))},renderMarkdown:(n,e)=>!n||!Array.isArray(n.content)?"":e.renderChildren(n.content),addCommands(){return{setParagraph:()=>({commands:n})=>n.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),C1=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,M1=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,E1=wt.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:n=>n.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["s",re(this.options.HTMLAttributes,n),0]},markdownTokenName:"del",parseMarkdown:(n,e)=>e.applyMark("strike",e.parseInline(n.tokens||[])),renderMarkdown:(n,e)=>`~~${e.renderChildren(n)}~~`,addCommands(){return{setStrike:()=>({commands:n})=>n.setMark(this.name),toggleStrike:()=>({commands:n})=>n.toggleMark(this.name),unsetStrike:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[sn({find:C1,type:this.type})]},addPasteRules(){return[Ht({find:M1,type:this.type})]}}),T1=ve.create({name:"text",group:"inline",parseMarkdown:n=>({type:"text",text:n.text||""}),renderMarkdown:n=>n.text||""});function N1(n={}){return new le({view(e){return new A1(e,n)}})}class A1{constructor(e,t){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=t.width)!==null&&r!==void 0?r:1,this.color=t.color===!1?void 0:t.color||"black",this.class=t.class,this.handlers=["dragover","dragend","drop","dragleave"].map(o=>{let s=i=>{this[o](i)};return e.dom.addEventListener(o,s),{name:o,handler:s}})}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){this.cursorPos!=null&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),t=!e.parent.inlineContent,r,o=this.editorView.dom,s=o.getBoundingClientRect(),i=s.width/o.offsetWidth,a=s.height/o.offsetHeight;if(t){let u=e.nodeBefore,h=e.nodeAfter;if(u||h){let p=this.editorView.nodeDOM(this.cursorPos-(u?u.nodeSize:0));if(p){let f=p.getBoundingClientRect(),m=u?f.bottom:f.top;u&&h&&(m=(m+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let g=this.width/2*a;r={left:f.left,right:f.right,top:m-g,bottom:m+g}}}}if(!r){let u=this.editorView.coordsAtPos(this.cursorPos),h=this.width/2*i;r={left:u.left-h,right:u.left+h,top:u.top,bottom:u.bottom}}let l=this.editorView.dom.offsetParent;this.element||(this.element=l.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",t),this.element.classList.toggle("prosemirror-dropcursor-inline",!t);let c,d;if(!l||l==document.body&&getComputedStyle(l).position=="static")c=-pageXOffset,d=-pageYOffset;else{let u=l.getBoundingClientRect(),h=u.width/l.offsetWidth,p=u.height/l.offsetHeight;c=u.left-l.scrollLeft*h,d=u.top-l.scrollTop*p}this.element.style.left=(r.left-c)/i+"px",this.element.style.top=(r.top-d)/a+"px",this.element.style.width=(r.right-r.left)/i+"px",this.element.style.height=(r.bottom-r.top)/a+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),o=r&&r.type.spec.disableDropCursor,s=typeof o=="function"?o(this.editorView,t,e):o;if(t&&!s){let i=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let a=Zc(this.editorView.state.doc,i,this.editorView.dragging.slice);a!=null&&(i=a)}this.setCursor(i),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}class de extends W{constructor(e){super(e,e)}map(e,t){let r=e.resolve(t.map(this.head));return de.valid(r)?new de(r):W.near(r)}content(){return O.empty}eq(e){return e instanceof de&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new de(e.resolve(t.pos))}getBookmark(){return new la(this.anchor)}static valid(e){let t=e.parent;if(t.isTextblock||!O1(e)||!R1(e))return!1;let r=t.type.spec.allowGapCursor;if(r!=null)return r;let o=t.contentMatchAt(e.index()).defaultType;return o&&o.isTextblock}static findGapCursorFrom(e,t,r=!1){e:for(;;){if(!r&&de.valid(e))return e;let o=e.pos,s=null;for(let i=e.depth;;i--){let a=e.node(i);if(t>0?e.indexAfter(i)<a.childCount:e.index(i)>0){s=a.child(t>0?e.indexAfter(i):e.index(i)-1);break}else if(i==0)return null;o+=t;let l=e.doc.resolve(o);if(de.valid(l))return l}for(;;){let i=t>0?s.firstChild:s.lastChild;if(!i){if(s.isAtom&&!s.isText&&!I.isSelectable(s)){e=e.doc.resolve(o+s.nodeSize*t),r=!1;continue e}break}s=i,o+=t;let a=e.doc.resolve(o);if(de.valid(a))return a}return null}}}de.prototype.visible=!1;de.findFrom=de.findGapCursorFrom;W.jsonID("gapcursor",de);class la{constructor(e){this.pos=e}map(e){return new la(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return de.valid(t)?new de(t):W.near(t)}}function mh(n){return n.isAtom||n.spec.isolating||n.spec.createGapCursor}function O1(n){for(let e=n.depth;e>=0;e--){let t=n.index(e),r=n.node(e);if(t==0){if(r.type.spec.isolating)return!0;continue}for(let o=r.child(t-1);;o=o.lastChild){if(o.childCount==0&&!o.inlineContent||mh(o.type))return!0;if(o.inlineContent)return!1}}return!0}function R1(n){for(let e=n.depth;e>=0;e--){let t=n.indexAfter(e),r=n.node(e);if(t==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let o=r.child(t);;o=o.firstChild){if(o.childCount==0&&!o.inlineContent||mh(o.type))return!0;if(o.inlineContent)return!1}}return!0}function D1(){return new le({props:{decorations:$1,createSelectionBetween(n,e,t){return e.pos==t.pos&&de.valid(t)?new de(t):null},handleClick:L1,handleKeyDown:j1,handleDOMEvents:{beforeinput:z1}}})}const j1=Pi({ArrowLeft:jr("horiz",-1),ArrowRight:jr("horiz",1),ArrowUp:jr("vert",-1),ArrowDown:jr("vert",1)});function jr(n,e){const t=n=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,o,s){let i=r.selection,a=e>0?i.$to:i.$from,l=i.empty;if(i instanceof H){if(!s.endOfTextblock(t)||a.depth==0)return!1;l=!1,a=r.doc.resolve(e>0?a.after():a.before())}let c=de.findGapCursorFrom(a,e,l);return c?(o&&o(r.tr.setSelection(new de(c))),!0):!1}}function L1(n,e,t){if(!n||!n.editable)return!1;let r=n.state.doc.resolve(e);if(!de.valid(r))return!1;let o=n.posAtCoords({left:t.clientX,top:t.clientY});return o&&o.inside>-1&&I.isSelectable(n.state.doc.nodeAt(o.inside))?!1:(n.dispatch(n.state.tr.setSelection(new de(r))),!0)}function z1(n,e){if(e.inputType!="insertCompositionText"||!(n.state.selection instanceof de))return!1;let{$from:t}=n.state.selection,r=t.parent.contentMatchAt(t.index()).findWrapping(n.state.schema.nodes.text);if(!r)return!1;let o=M.empty;for(let i=r.length-1;i>=0;i--)o=M.from(r[i].createAndFill(null,o));let s=n.state.tr.replace(t.pos,t.pos,new O(o,0,0));return s.setSelection(H.near(s.doc.resolve(t.pos+1))),n.dispatch(s),!1}function $1(n){if(!(n.selection instanceof de))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",se.create(n.doc,[xe.widget(n.selection.head,e,{key:"gapcursor"})])}var Oo=200,ke=function(){};ke.prototype.append=function(n){return n.length?(n=ke.from(n),!this.length&&n||n.length<Oo&&this.leafAppend(n)||this.length<Oo&&n.leafPrepend(this)||this.appendInner(n)):this};ke.prototype.prepend=function(n){return n.length?ke.from(n).append(this):this};ke.prototype.appendInner=function(n){return new I1(this,n)};ke.prototype.slice=function(n,e){return n===void 0&&(n=0),e===void 0&&(e=this.length),n>=e?ke.empty:this.sliceInner(Math.max(0,n),Math.min(this.length,e))};ke.prototype.get=function(n){if(!(n<0||n>=this.length))return this.getInner(n)};ke.prototype.forEach=function(n,e,t){e===void 0&&(e=0),t===void 0&&(t=this.length),e<=t?this.forEachInner(n,e,t,0):this.forEachInvertedInner(n,e,t,0)};ke.prototype.map=function(n,e,t){e===void 0&&(e=0),t===void 0&&(t=this.length);var r=[];return this.forEach(function(o,s){return r.push(n(o,s))},e,t),r};ke.from=function(n){return n instanceof ke?n:n&&n.length?new gh(n):ke.empty};var gh=(function(n){function e(r){n.call(this),this.values=r}n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e;var t={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(r,o){return r==0&&o==this.length?this:new e(this.values.slice(r,o))},e.prototype.getInner=function(r){return this.values[r]},e.prototype.forEachInner=function(r,o,s,i){for(var a=o;a<s;a++)if(r(this.values[a],i+a)===!1)return!1},e.prototype.forEachInvertedInner=function(r,o,s,i){for(var a=o-1;a>=s;a--)if(r(this.values[a],i+a)===!1)return!1},e.prototype.leafAppend=function(r){if(this.length+r.length<=Oo)return new e(this.values.concat(r.flatten()))},e.prototype.leafPrepend=function(r){if(this.length+r.length<=Oo)return new e(r.flatten().concat(this.values))},t.length.get=function(){return this.values.length},t.depth.get=function(){return 0},Object.defineProperties(e.prototype,t),e})(ke);ke.empty=new gh([]);var I1=(function(n){function e(t,r){n.call(this),this.left=t,this.right=r,this.length=t.length+r.length,this.depth=Math.max(t.depth,r.depth)+1}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(t){return t<this.left.length?this.left.get(t):this.right.get(t-this.left.length)},e.prototype.forEachInner=function(t,r,o,s){var i=this.left.length;if(r<i&&this.left.forEachInner(t,r,Math.min(o,i),s)===!1||o>i&&this.right.forEachInner(t,Math.max(r-i,0),Math.min(this.length,o)-i,s+i)===!1)return!1},e.prototype.forEachInvertedInner=function(t,r,o,s){var i=this.left.length;if(r>i&&this.right.forEachInvertedInner(t,r-i,Math.max(o,i)-i,s+i)===!1||o<i&&this.left.forEachInvertedInner(t,Math.min(r,i),o,s)===!1)return!1},e.prototype.sliceInner=function(t,r){if(t==0&&r==this.length)return this;var o=this.left.length;return r<=o?this.left.slice(t,r):t>=o?this.right.slice(t-o,r-o):this.left.slice(t,o).append(this.right.slice(0,r-o))},e.prototype.leafAppend=function(t){var r=this.right.leafAppend(t);if(r)return new e(this.left,r)},e.prototype.leafPrepend=function(t){var r=this.left.leafPrepend(t);if(r)return new e(r,this.right)},e.prototype.appendInner=function(t){return this.left.depth>=Math.max(this.right.depth,t.depth)+1?new e(this.left,new e(this.right,t)):new e(this,t)},e})(ke);const P1=500;class Qe{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let o,s;t&&(o=this.remapping(r,this.items.length),s=o.maps.length);let i=e.tr,a,l,c=[],d=[];return this.items.forEach((u,h)=>{if(!u.step){o||(o=this.remapping(r,h+1),s=o.maps.length),s--,d.push(u);return}if(o){d.push(new st(u.map));let p=u.step.map(o.slice(s)),f;p&&i.maybeStep(p).doc&&(f=i.mapping.maps[i.mapping.maps.length-1],c.push(new st(f,void 0,void 0,c.length+d.length))),s--,f&&o.appendMap(f,s)}else i.maybeStep(u.step);if(u.selection)return a=o?u.selection.map(o.slice(s)):u.selection,l=new Qe(this.items.slice(0,r).append(d.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:i,selection:a}}addTransform(e,t,r,o){let s=[],i=this.eventCount,a=this.items,l=!o&&a.length?a.get(a.length-1):null;for(let d=0;d<e.steps.length;d++){let u=e.steps[d].invert(e.docs[d]),h=new st(e.mapping.maps[d],u,t),p;(p=l&&l.merge(h))&&(h=p,d?s.pop():a=a.slice(0,a.length-1)),s.push(h),t&&(i++,t=void 0),o||(l=h)}let c=i-r.depth;return c>B1&&(a=H1(a,c),i-=c),new Qe(a.append(s),i)}remapping(e,t){let r=new rr;return this.items.forEach((o,s)=>{let i=o.mirrorOffset!=null&&s-o.mirrorOffset>=e?r.maps.length-o.mirrorOffset:void 0;r.appendMap(o.map,i)},e,t),r}addMaps(e){return this.eventCount==0?this:new Qe(this.items.append(e.map(t=>new st(t))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let r=[],o=Math.max(0,this.items.length-t),s=e.mapping,i=e.steps.length,a=this.eventCount;this.items.forEach(h=>{h.selection&&a--},o);let l=t;this.items.forEach(h=>{let p=s.getMirror(--l);if(p==null)return;i=Math.min(i,p);let f=s.maps[p];if(h.step){let m=e.steps[p].invert(e.docs[p]),g=h.selection&&h.selection.map(s.slice(l+1,p));g&&a++,r.push(new st(f,m,g))}else r.push(new st(f))},o);let c=[];for(let h=t;h<i;h++)c.push(new st(s.maps[h]));let d=this.items.slice(0,o).append(c).append(r),u=new Qe(d,a);return u.emptyItemCount()>P1&&(u=u.compress(this.items.length-r.length)),u}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),r=t.maps.length,o=[],s=0;return this.items.forEach((i,a)=>{if(a>=e)o.push(i),i.selection&&s++;else if(i.step){let l=i.step.map(t.slice(r)),c=l&&l.getMap();if(r--,c&&t.appendMap(c,r),l){let d=i.selection&&i.selection.map(t.slice(r));d&&s++;let u=new st(c.invert(),l,d),h,p=o.length-1;(h=o.length&&o[p].merge(u))?o[p]=h:o.push(u)}}else i.map&&r--},this.items.length,0),new Qe(ke.from(o.reverse()),s)}}Qe.empty=new Qe(ke.empty,0);function H1(n,e){let t;return n.forEach((r,o)=>{if(r.selection&&e--==0)return t=o,!1}),n.slice(t)}class st{constructor(e,t,r,o){this.map=e,this.step=t,this.selection=r,this.mirrorOffset=o}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new st(t.getMap().invert(),t,this.selection)}}}class Et{constructor(e,t,r,o,s){this.done=e,this.undone=t,this.prevRanges=r,this.prevTime=o,this.prevComposition=s}}const B1=20;function V1(n,e,t,r){let o=t.getMeta(en),s;if(o)return o.historyState;t.getMeta(_1)&&(n=new Et(n.done,n.undone,null,0,-1));let i=t.getMeta("appendedTransaction");if(t.steps.length==0)return n;if(i&&i.getMeta(en))return i.getMeta(en).redo?new Et(n.done.addTransform(t,void 0,r,Fr(e)),n.undone,Ql(t.mapping.maps),n.prevTime,n.prevComposition):new Et(n.done,n.undone.addTransform(t,void 0,r,Fr(e)),null,n.prevTime,n.prevComposition);if(t.getMeta("addToHistory")!==!1&&!(i&&i.getMeta("addToHistory")===!1)){let a=t.getMeta("composition"),l=n.prevTime==0||!i&&n.prevComposition!=a&&(n.prevTime<(t.time||0)-r.newGroupDelay||!F1(t,n.prevRanges)),c=i?Ts(n.prevRanges,t.mapping):Ql(t.mapping.maps);return new Et(n.done.addTransform(t,l?e.selection.getBookmark():void 0,r,Fr(e)),Qe.empty,c,t.time,a??n.prevComposition)}else return(s=t.getMeta("rebased"))?new Et(n.done.rebased(t,s),n.undone.rebased(t,s),Ts(n.prevRanges,t.mapping),n.prevTime,n.prevComposition):new Et(n.done.addMaps(t.mapping.maps),n.undone.addMaps(t.mapping.maps),Ts(n.prevRanges,t.mapping),n.prevTime,n.prevComposition)}function F1(n,e){if(!e)return!1;if(!n.docChanged)return!0;let t=!1;return n.mapping.maps[0].forEach((r,o)=>{for(let s=0;s<e.length;s+=2)r<=e[s+1]&&o>=e[s]&&(t=!0)}),t}function Ql(n){let e=[];for(let t=n.length-1;t>=0&&e.length==0;t--)n[t].forEach((r,o,s,i)=>e.push(s,i));return e}function Ts(n,e){if(!n)return null;let t=[];for(let r=0;r<n.length;r+=2){let o=e.map(n[r],1),s=e.map(n[r+1],-1);o<=s&&t.push(o,s)}return t}function W1(n,e,t){let r=Fr(e),o=en.get(e).spec.config,s=(t?n.undone:n.done).popEvent(e,r);if(!s)return null;let i=s.selection.resolve(s.transform.doc),a=(t?n.done:n.undone).addTransform(s.transform,e.selection.getBookmark(),o,r),l=new Et(t?a:s.remaining,t?s.remaining:a,null,0,-1);return s.transform.setSelection(i).setMeta(en,{redo:t,historyState:l})}let Ns=!1,Zl=null;function Fr(n){let e=n.plugins;if(Zl!=e){Ns=!1,Zl=e;for(let t=0;t<e.length;t++)if(e[t].spec.historyPreserveItems){Ns=!0;break}}return Ns}const en=new he("history"),_1=new he("closeHistory");function U1(n={}){return n={depth:n.depth||100,newGroupDelay:n.newGroupDelay||500},new le({key:en,state:{init(){return new Et(Qe.empty,Qe.empty,null,0,-1)},apply(e,t,r){return V1(t,r,e,n)}},config:n,props:{handleDOMEvents:{beforeinput(e,t){let r=t.inputType,o=r=="historyUndo"?bh:r=="historyRedo"?xh:null;return!o||!e.editable?!1:(t.preventDefault(),o(e.state,e.dispatch))}}}})}function yh(n,e){return(t,r)=>{let o=en.getState(t);if(!o||(n?o.undone:o.done).eventCount==0)return!1;if(r){let s=W1(o,t,n);s&&r(s.scrollIntoView())}return!0}}const bh=yh(!1),xh=yh(!0);te.create({name:"characterCount",addOptions(){return{limit:null,mode:"textSize",textCounter:n=>n.length,wordCounter:n=>n.split(" ").filter(e=>e!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=n=>{const e=n?.node||this.editor.state.doc;if((n?.mode||this.options.mode)==="textSize"){const t=e.textBetween(0,e.content.size,void 0," ");return this.options.textCounter(t)}return e.nodeSize},this.storage.words=n=>{const e=n?.node||this.editor.state.doc,t=e.textBetween(0,e.content.size," "," ");return this.options.wordCounter(t)}},addProseMirrorPlugins(){let n=!1;return[new le({key:new he("characterCount"),appendTransaction:(e,t,r)=>{if(n)return;const o=this.options.limit;if(o==null||o===0){n=!0;return}const s=this.storage.characters({node:r.doc});if(s>o){const i=s-o,a=0,l=i;console.warn(`[CharacterCount] Initial content exceeded limit of ${o} characters. Content was automatically trimmed.`);const c=r.tr.deleteRange(a,l);return n=!0,c}n=!0},filterTransaction:(e,t)=>{const r=this.options.limit;if(!e.docChanged||r===0||r===null||r===void 0)return!0;const o=this.storage.characters({node:t.doc}),s=this.storage.characters({node:e.doc});if(s<=r||o>r&&s>r&&s<=o)return!0;if(o>r&&s>r&&s>o||!e.getMeta("paste"))return!1;const i=e.selection.$head.pos,a=s-r,l=i-a,c=i;return e.deleteRange(l,c),!(this.storage.characters({node:e.doc})>r)}})]}});var q1=te.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[N1(this.options)]}});te.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new le({key:new he("focus"),props:{decorations:({doc:n,selection:e})=>{const{isEditable:t,isFocused:r}=this.editor,{anchor:o}=e,s=[];if(!t||!r)return se.create(n,[]);let i=0;this.options.mode==="deepest"&&n.descendants((l,c)=>{if(!l.isText){if(!(o>=c&&o<=c+l.nodeSize-1))return!1;i+=1}});let a=0;return n.descendants((l,c)=>{if(l.isText||!(o>=c&&o<=c+l.nodeSize-1))return!1;if(a+=1,this.options.mode==="deepest"&&i-a>0||this.options.mode==="shallowest"&&a>1)return this.options.mode==="deepest";s.push(xe.node(c,c+l.nodeSize,{class:this.options.className}))}),se.create(n,s)}}})]}});var K1=te.create({name:"gapCursor",addProseMirrorPlugins(){return[D1()]},extendNodeSchema(n){var e;const t={name:n.name,options:n.options,storage:n.storage};return{allowGapCursor:(e=Q(P(n,"allowGapCursor",t)))!=null?e:null}}});te.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new le({key:new he("placeholder"),props:{decorations:({doc:n,selection:e})=>{const t=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=e,o=[];if(!t)return null;const s=this.editor.isEmpty;return n.descendants((i,a)=>{const l=r>=a&&r<=a+i.nodeSize,c=!i.isLeaf&&qo(i);if((l||!this.options.showOnlyCurrent)&&c){const d=[this.options.emptyNodeClass];s&&d.push(this.options.emptyEditorClass);const u=xe.node(a,a+i.nodeSize,{class:d.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:i,pos:a,hasAnchor:l}):this.options.placeholder});o.push(u)}return this.options.includeChildren}),se.create(n,o)}}})]}});te.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:n,options:e}=this;return[new le({key:new he("selection"),props:{decorations(t){return t.selection.empty||n.isFocused||!n.isEditable||gu(t.selection)||n.view.dragging?null:se.create(t.doc,[xe.inline(t.selection.from,t.selection.to,{class:e.className})])}}})]}});function ec({types:n,node:e}){return e&&Array.isArray(n)&&n.includes(e.type)||e?.type===n}var J1=te.create({name:"trailingNode",addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){var n;const e=new he(this.name),t=((n=this.editor.schema.topNodeType.contentMatch.defaultType)==null?void 0:n.name)||this.options.node||"paragraph",r=Object.entries(this.editor.schema.nodes).map(([,o])=>o).filter(o=>(this.options.notAfter||[]).concat(t).includes(o.name));return[new le({key:e,appendTransaction:(o,s,i)=>{const{doc:a,tr:l,schema:c}=i,d=e.getState(i),u=a.content.size,h=c.nodes[t];if(d)return l.insert(u,h.create())},state:{init:(o,s)=>{const i=s.tr.doc.lastChild;return!ec({node:i,types:r})},apply:(o,s)=>{if(!o.docChanged||o.getMeta("__uniqueIDTransaction"))return s;const i=o.doc.lastChild;return!ec({node:i,types:r})}}})]}}),G1=te.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:n,dispatch:e})=>bh(n,e),redo:()=>({state:n,dispatch:e})=>xh(n,e)}},addProseMirrorPlugins(){return[U1(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),X1=te.create({name:"starterKit",addExtensions(){var n,e,t,r;const o=[];return this.options.bold!==!1&&o.push(C0.configure(this.options.bold)),this.options.blockquote!==!1&&o.push(x0.configure(this.options.blockquote)),this.options.bulletList!==!1&&o.push(sh.configure(this.options.bulletList)),this.options.code!==!1&&o.push(T0.configure(this.options.code)),this.options.codeBlock!==!1&&o.push(O0.configure(this.options.codeBlock)),this.options.document!==!1&&o.push(R0.configure(this.options.document)),this.options.dropcursor!==!1&&o.push(q1.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&o.push(K1.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&o.push(D0.configure(this.options.hardBreak)),this.options.heading!==!1&&o.push(j0.configure(this.options.heading)),this.options.undoRedo!==!1&&o.push(G1.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&o.push(L0.configure(this.options.horizontalRule)),this.options.italic!==!1&&o.push(H0.configure(this.options.italic)),this.options.listItem!==!1&&o.push(ih.configure(this.options.listItem)),this.options.listKeymap!==!1&&o.push(hh.configure((n=this.options)==null?void 0:n.listKeymap)),this.options.link!==!1&&o.push(d1.configure((e=this.options)==null?void 0:e.link)),this.options.orderedList!==!1&&o.push(fh.configure(this.options.orderedList)),this.options.paragraph!==!1&&o.push(S1.configure(this.options.paragraph)),this.options.strike!==!1&&o.push(E1.configure(this.options.strike)),this.options.text!==!1&&o.push(T1.configure(this.options.text)),this.options.underline!==!1&&o.push(Gu.configure((t=this.options)==null?void 0:t.underline)),this.options.trailingNode!==!1&&o.push(J1.configure((r=this.options)==null?void 0:r.trailingNode)),o}}),Y1=X1,Q1=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,Z1=ve.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:n}){return["img",re(this.options.HTMLAttributes,n)]},parseMarkdown:(n,e)=>e.createNode("image",{src:n.href,title:n.title,alt:n.text}),renderMarkdown:n=>{var e,t,r,o,s,i;const a=(t=(e=n.attrs)==null?void 0:e.src)!=null?t:"",l=(o=(r=n.attrs)==null?void 0:r.alt)!=null?o:"",c=(i=(s=n.attrs)==null?void 0:s.title)!=null?i:"";return c?``:``},addNodeView(){if(!this.options.resize||!this.options.resize.enabled||typeof document>"u"||!this.editor.isEditable)return null;const{directions:n,minWidth:e,minHeight:t,alwaysPreserveAspectRatio:r}=this.options.resize;return({node:o,getPos:s,HTMLAttributes:i})=>{const a=document.createElement("img");Object.entries(i).forEach(([d,u])=>{if(u!=null)switch(d){case"width":case"height":break;default:a.setAttribute(d,u);break}}),a.src=i.src;const l=new Hy({element:a,node:o,getPos:s,onResize:(d,u)=>{a.style.width=`${d}px`,a.style.height=`${u}px`},onCommit:(d,u)=>{const h=s();h!==void 0&&this.editor.chain().setNodeSelection(h).updateAttributes(this.name,{width:d,height:u}).run()},onUpdate:(d,u,h)=>d.type===o.type,options:{directions:n,min:{width:e,height:t},preserveAspectRatio:r===!0}}),c=l.dom;return c.style.visibility="hidden",c.style.pointerEvents="none",a.onload=()=>{c.style.visibility="",c.style.pointerEvents=""},l}},addCommands(){return{setImage:n=>({commands:e})=>e.insertContent({type:this.name,attrs:n})}},addInputRules(){return[Ru({find:Q1,type:this.type,getAttributes:n=>{const[,,e,t,r]=n;return{src:t,alt:e,title:r}}})]}}),ex=Z1,As={exports:{}},Os={},tc;function tx(){if(tc)return Os;tc=1;var n=z;function e(u,h){return u===h&&(u!==0||1/u===1/h)||u!==u&&h!==h}var t=typeof Object.is=="function"?Object.is:e,r=n.useState,o=n.useEffect,s=n.useLayoutEffect,i=n.useDebugValue;function a(u,h){var p=h(),f=r({inst:{value:p,getSnapshot:h}}),m=f[0].inst,g=f[1];return s(function(){m.value=p,m.getSnapshot=h,l(m)&&g({inst:m})},[u,p,h]),o(function(){return l(m)&&g({inst:m}),u(function(){l(m)&&g({inst:m})})},[u]),i(p),p}function l(u){var h=u.getSnapshot;u=u.value;try{var p=h();return!t(u,p)}catch{return!0}}function c(u,h){return h()}var d=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:a;return Os.useSyncExternalStore=n.useSyncExternalStore!==void 0?n.useSyncExternalStore:d,Os}var nc={},rc;function nx(){return rc||(rc=1,process.env.NODE_ENV!=="production"&&(function(){function n(p,f){return p===f&&(p!==0||1/p===1/f)||p!==p&&f!==f}function e(p,f){d||o.startTransition===void 0||(d=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var m=f();if(!u){var g=f();s(m,g)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),u=!0)}g=i({inst:{value:m,getSnapshot:f}});var y=g[0].inst,w=g[1];return l(function(){y.value=m,y.getSnapshot=f,t(y)&&w({inst:y})},[p,m,f]),a(function(){return t(y)&&w({inst:y}),p(function(){t(y)&&w({inst:y})})},[p]),c(m),m}function t(p){var f=p.getSnapshot;p=p.value;try{var m=f();return!s(p,m)}catch{return!0}}function r(p,f){return f()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var o=z,s=typeof Object.is=="function"?Object.is:n,i=o.useState,a=o.useEffect,l=o.useLayoutEffect,c=o.useDebugValue,d=!1,u=!1,h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?r:e;nc.useSyncExternalStore=o.useSyncExternalStore!==void 0?o.useSyncExternalStore:h,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),nc}var oc;function ca(){return oc||(oc=1,process.env.NODE_ENV==="production"?As.exports=tx():As.exports=nx()),As.exports}var wh=ca(),sc,ic;function rx(){return ic||(ic=1,sc=function n(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var r,o,s;if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(o=r;o--!==0;)if(!n(e[o],t[o]))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(o of e.entries())if(!t.has(o[0]))return!1;for(o of e.entries())if(!n(o[1],t.get(o[0])))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(o of e.entries())if(!t.has(o[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(r=e.length,r!=t.length)return!1;for(o=r;o--!==0;)if(e[o]!==t[o])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if(s=Object.keys(e),r=s.length,r!==Object.keys(t).length)return!1;for(o=r;o--!==0;)if(!Object.prototype.hasOwnProperty.call(t,s[o]))return!1;for(o=r;o--!==0;){var i=s[o];if(!(i==="_owner"&&e.$$typeof)&&!n(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}),sc}var ox=rx();const sx=Kh(ox);var Rs={exports:{}},Ds={},ac;function ix(){if(ac)return Ds;ac=1;var n=z,e=ca();function t(c,d){return c===d&&(c!==0||1/c===1/d)||c!==c&&d!==d}var r=typeof Object.is=="function"?Object.is:t,o=e.useSyncExternalStore,s=n.useRef,i=n.useEffect,a=n.useMemo,l=n.useDebugValue;return Ds.useSyncExternalStoreWithSelector=function(c,d,u,h,p){var f=s(null);if(f.current===null){var m={hasValue:!1,value:null};f.current=m}else m=f.current;f=a(function(){function y(T){if(!w){if(w=!0,x=T,T=h(T),p!==void 0&&m.hasValue){var v=m.value;if(p(v,T))return E=v}return E=T}if(v=E,r(x,T))return v;var S=h(T);return p!==void 0&&p(v,S)?(x=T,v):(x=T,E=S)}var w=!1,x,E,b=u===void 0?null:u;return[function(){return y(d())},b===null?void 0:function(){return y(b())}]},[d,u,h,p]);var g=o(c,f[0],f[1]);return i(function(){m.hasValue=!0,m.value=g},[g]),l(g),g},Ds}var lc={},cc;function ax(){return cc||(cc=1,process.env.NODE_ENV!=="production"&&(function(){function n(c,d){return c===d&&(c!==0||1/c===1/d)||c!==c&&d!==d}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var e=z,t=ca(),r=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,s=e.useRef,i=e.useEffect,a=e.useMemo,l=e.useDebugValue;lc.useSyncExternalStoreWithSelector=function(c,d,u,h,p){var f=s(null);if(f.current===null){var m={hasValue:!1,value:null};f.current=m}else m=f.current;f=a(function(){function y(T){if(!w){if(w=!0,x=T,T=h(T),p!==void 0&&m.hasValue){var v=m.value;if(p(v,T))return E=v}return E=T}if(v=E,r(x,T))return v;var S=h(T);return p!==void 0&&p(v,S)?(x=T,v):(x=T,E=S)}var w=!1,x,E,b=u===void 0?null:u;return[function(){return y(d())},b===null?void 0:function(){return y(b())}]},[d,u,h,p]);var g=o(c,f[0],f[1]);return i(function(){m.hasValue=!0,m.value=g},[g]),l(g),g},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),lc}var dc;function lx(){return dc||(dc=1,process.env.NODE_ENV==="production"?Rs.exports=ix():Rs.exports=ax()),Rs.exports}var cx=lx(),dx=(...n)=>e=>{n.forEach(t=>{typeof t=="function"?t(e):t&&(t.current=e)})},ux=({contentComponent:n})=>{const e=wh.useSyncExternalStore(n.subscribe,n.getSnapshot,n.getServerSnapshot);return N.jsx(N.Fragment,{children:Object.values(e)})};function hx(){const n=new Set;let e={};return{subscribe(t){return n.add(t),()=>{n.delete(t)}},getSnapshot(){return e},getServerSnapshot(){return e},setRenderer(t,r){e={...e,[t]:Mc.createPortal(r.reactElement,r.element,t)},n.forEach(o=>o())},removeRenderer(t){const r={...e};delete r[t],e=r,n.forEach(o=>o())}}}var px=class extends z.Component{constructor(n){var e;super(n),this.editorContentRef=z.createRef(),this.initialized=!1,this.state={hasContentComponentInitialized:!!((e=n.editor)!=null&&e.contentComponent)}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){const n=this.props.editor;if(n&&!n.isDestroyed&&n.options.element){if(n.contentComponent)return;const e=this.editorContentRef.current;e.append(n.view.dom),n.setOptions({element:e}),n.contentComponent=hx(),this.state.hasContentComponentInitialized||(this.unsubscribeToContentComponent=n.contentComponent.subscribe(()=>{this.setState(t=>t.hasContentComponentInitialized?t:{hasContentComponentInitialized:!0}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent()})),n.createNodeViews(),this.initialized=!0}}componentWillUnmount(){var n;const e=this.props.editor;if(e){this.initialized=!1,e.isDestroyed||e.view.setProps({nodeViews:{}}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent(),e.contentComponent=null;try{if(!((n=e.view.dom)!=null&&n.firstChild))return;const t=document.createElement("div");t.append(e.view.dom),e.setOptions({element:t})}catch{}}}render(){const{editor:n,innerRef:e,...t}=this.props;return N.jsxs(N.Fragment,{children:[N.jsx("div",{ref:dx(e,this.editorContentRef),...t}),n?.contentComponent&&N.jsx(ux,{contentComponent:n.contentComponent})]})}},fx=z.forwardRef((n,e)=>{const t=z.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[n.editor]);return z.createElement(px,{key:t,innerRef:e,...n})}),mx=z.memo(fx),gx=typeof window<"u"?z.useLayoutEffect:z.useEffect,yx=class{constructor(n){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=n,this.lastSnapshot={editor:n,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(n){return this.subscribers.add(n),()=>{this.subscribers.delete(n)}}watch(n){if(this.editor=n,this.editor){const e=()=>{this.transactionNumber+=1,this.subscribers.forEach(r=>r())},t=this.editor;return t.on("transaction",e),()=>{t.off("transaction",e)}}}};function kh(n){var e;const[t]=z.useState(()=>new yx(n.editor)),r=cx.useSyncExternalStoreWithSelector(t.subscribe,t.getSnapshot,t.getServerSnapshot,n.selector,(e=n.equalityFn)!=null?e:sx);return gx(()=>t.watch(n.editor),[n.editor,t]),z.useDebugValue(r),r}var uc=process.env.NODE_ENV!=="production",yi=typeof window>"u",bx=yi||!!(typeof window<"u"&&window.next),xx=class vh{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(t=>t())}getInitialEditor(){if(this.options.current.immediatelyRender===void 0){if(yi||bx){if(uc)throw new Error("Tiptap Error: SSR has been detected, please set `immediatelyRender` explicitly to `false` to avoid hydration mismatches.");return null}return this.createEditor()}if(this.options.current.immediatelyRender&&yi&&uc)throw new Error("Tiptap Error: SSR has been detected, and `immediatelyRender` has been set to `true` this is an unsupported configuration that may result in errors, explicitly set `immediatelyRender` to `false` to avoid hydration mismatches.");return this.options.current.immediatelyRender?this.createEditor():null}createEditor(){const e={...this.options.current,onBeforeCreate:(...t)=>{var r,o;return(o=(r=this.options.current).onBeforeCreate)==null?void 0:o.call(r,...t)},onBlur:(...t)=>{var r,o;return(o=(r=this.options.current).onBlur)==null?void 0:o.call(r,...t)},onCreate:(...t)=>{var r,o;return(o=(r=this.options.current).onCreate)==null?void 0:o.call(r,...t)},onDestroy:(...t)=>{var r,o;return(o=(r=this.options.current).onDestroy)==null?void 0:o.call(r,...t)},onFocus:(...t)=>{var r,o;return(o=(r=this.options.current).onFocus)==null?void 0:o.call(r,...t)},onSelectionUpdate:(...t)=>{var r,o;return(o=(r=this.options.current).onSelectionUpdate)==null?void 0:o.call(r,...t)},onTransaction:(...t)=>{var r,o;return(o=(r=this.options.current).onTransaction)==null?void 0:o.call(r,...t)},onUpdate:(...t)=>{var r,o;return(o=(r=this.options.current).onUpdate)==null?void 0:o.call(r,...t)},onContentError:(...t)=>{var r,o;return(o=(r=this.options.current).onContentError)==null?void 0:o.call(r,...t)},onDrop:(...t)=>{var r,o;return(o=(r=this.options.current).onDrop)==null?void 0:o.call(r,...t)},onPaste:(...t)=>{var r,o;return(o=(r=this.options.current).onPaste)==null?void 0:o.call(r,...t)},onDelete:(...t)=>{var r,o;return(o=(r=this.options.current).onDelete)==null?void 0:o.call(r,...t)}};return new Iy(e)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}static compareOptions(e,t){return Object.keys(e).every(r=>["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(r)?!0:r==="extensions"&&e.extensions&&t.extensions?e.extensions.length!==t.extensions.length?!1:e.extensions.every((o,s)=>{var i;return o===((i=t.extensions)==null?void 0:i[s])}):e[r]===t[r])}onRender(e){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&e.length===0?vh.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(e),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=e;return}if(this.previousDeps.length===e.length&&this.previousDeps.every((t,r)=>t===e[r]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){const e=this.instanceId,t=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===e){t&&t.setOptions(this.options.current);return}t&&!t.isDestroyed&&(t.destroy(),this.instanceId===e&&this.setEditor(null))},1)}};function wx(n={},e=[]){const t=z.useRef(n);t.current=n;const[r]=z.useState(()=>new xx(t)),o=wh.useSyncExternalStore(r.subscribe,r.getEditor,r.getServerSnapshot);return z.useDebugValue(o),z.useEffect(r.onRender(e)),kh({editor:o,selector:({transactionNumber:s})=>n.shouldRerenderOnTransaction===!1||n.shouldRerenderOnTransaction===void 0?null:n.immediatelyRender&&s===0?0:s+1}),o}var kx=z.createContext({editor:null});kx.Consumer;var Sh=z.createContext({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),vx=()=>z.useContext(Sh),js=z.forwardRef((n,e)=>{const{onDragStart:t}=vx(),r=n.as||"div";return N.jsx(r,{...n,ref:e,"data-node-view-wrapper":"",onDragStart:t,style:{whiteSpace:"normal",...n.style}})});function hc(n){return!!(typeof n=="function"&&n.prototype&&n.prototype.isReactComponent)}function pc(n){return!!(typeof n=="object"&&n.$$typeof&&(n.$$typeof.toString()==="Symbol(react.forward_ref)"||n.$$typeof.description==="react.forward_ref"))}function Sx(n){return!!(typeof n=="object"&&n.$$typeof&&(n.$$typeof.toString()==="Symbol(react.memo)"||n.$$typeof.description==="react.memo"))}function Cx(n){if(hc(n)||pc(n))return!0;if(Sx(n)){const e=n.type;if(e)return hc(e)||pc(e)}return!1}function Mx(){try{if(z.version)return parseInt(z.version.split(".")[0],10)>=19}catch{}return!1}var Ex=class{constructor(n,{editor:e,props:t={},as:r="div",className:o=""}){this.ref=null,this.id=Math.floor(Math.random()*4294967295).toString(),this.component=n,this.editor=e,this.props=t,this.element=document.createElement(r),this.element.classList.add("react-renderer"),o&&this.element.classList.add(...o.split(" ")),this.editor.isInitialized?Mc.flushSync(()=>{this.render()}):queueMicrotask(()=>{this.render()})}render(){var n;const e=this.component,t=this.props,r=this.editor,o=Mx(),s=Cx(e),i={...t};i.ref&&!(o||s)&&delete i.ref,!i.ref&&(o||s)&&(i.ref=a=>{this.ref=a}),this.reactElement=N.jsx(e,{...i}),(n=r?.contentComponent)==null||n.setRenderer(this.id,this)}updateProps(n={}){this.props={...this.props,...n},this.render()}destroy(){var n;(n=this.editor?.contentComponent)==null||n.removeRenderer(this.id);try{this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)}catch{}}updateAttributes(n){Object.keys(n).forEach(e=>{this.element.setAttribute(e,n[e])})}};z.createContext({markViewContentRef:()=>{}});var Tx=class extends Jy{constructor(n,e,t){if(super(n,e,t),!this.node.isLeaf){this.options.contentDOMElementTag?this.contentDOMElement=document.createElement(this.options.contentDOMElementTag):this.contentDOMElement=document.createElement(this.node.isInline?"span":"div"),this.contentDOMElement.dataset.nodeViewContentReact="",this.contentDOMElement.dataset.nodeViewWrapper="",this.contentDOMElement.style.whiteSpace="inherit";const r=this.dom.querySelector("[data-node-view-content]");if(!r)return;r.appendChild(this.contentDOMElement)}}mount(){const n={editor:this.editor,node:this.node,decorations:this.decorations,innerDecorations:this.innerDecorations,view:this.view,selected:!1,extension:this.extension,HTMLAttributes:this.HTMLAttributes,getPos:()=>this.getPos(),updateAttributes:(i={})=>this.updateAttributes(i),deleteNode:()=>this.deleteNode(),ref:z.createRef()};if(!this.component.displayName){const i=a=>a.charAt(0).toUpperCase()+a.substring(1);this.component.displayName=i(this.extension.name)}const e={onDragStart:this.onDragStart.bind(this),nodeViewContentRef:i=>{i&&this.contentDOMElement&&i.firstChild!==this.contentDOMElement&&(i.hasAttribute("data-node-view-wrapper")&&i.removeAttribute("data-node-view-wrapper"),i.appendChild(this.contentDOMElement))}},t=this.component,r=z.memo(i=>N.jsx(Sh.Provider,{value:e,children:z.createElement(t,i)}));r.displayName="ReactNodeView";let o=this.node.isInline?"span":"div";this.options.as&&(o=this.options.as);const{className:s=""}=this.options;this.handleSelectionUpdate=this.handleSelectionUpdate.bind(this),this.renderer=new Ex(r,{editor:this.editor,props:n,as:o,className:`node-${this.node.type.name} ${s}`.trim()}),this.editor.on("selectionUpdate",this.handleSelectionUpdate),this.updateElementAttributes()}get dom(){var n;if(this.renderer.element.firstElementChild&&!((n=this.renderer.element.firstElementChild)!=null&&n.hasAttribute("data-node-view-wrapper")))throw Error("Please use the NodeViewWrapper component for your node view.");return this.renderer.element}get contentDOM(){return this.node.isLeaf?null:this.contentDOMElement}handleSelectionUpdate(){const{from:n,to:e}=this.editor.state.selection,t=this.getPos();if(typeof t=="number")if(n<=t&&e>=t+this.node.nodeSize){if(this.renderer.props.selected)return;this.selectNode()}else{if(!this.renderer.props.selected)return;this.deselectNode()}}update(n,e,t){const r=o=>{this.renderer.updateProps(o),typeof this.options.attrs=="function"&&this.updateElementAttributes()};if(n.type!==this.node.type)return!1;if(typeof this.options.update=="function"){const o=this.node,s=this.decorations,i=this.innerDecorations;return this.node=n,this.decorations=e,this.innerDecorations=t,this.options.update({oldNode:o,oldDecorations:s,newNode:n,newDecorations:e,oldInnerDecorations:i,innerDecorations:t,updateProps:()=>r({node:n,decorations:e,innerDecorations:t})})}return n===this.node&&this.decorations===e&&this.innerDecorations===t||(this.node=n,this.decorations=e,this.innerDecorations=t,r({node:n,decorations:e,innerDecorations:t})),!0}selectNode(){this.renderer.updateProps({selected:!0}),this.renderer.element.classList.add("ProseMirror-selectednode")}deselectNode(){this.renderer.updateProps({selected:!1}),this.renderer.element.classList.remove("ProseMirror-selectednode")}destroy(){this.renderer.destroy(),this.editor.off("selectionUpdate",this.handleSelectionUpdate),this.contentDOMElement=null}updateElementAttributes(){if(this.options.attrs){let n={};if(typeof this.options.attrs=="function"){const e=this.editor.extensionManager.attributes,t=cr(this.node,e);n=this.options.attrs({node:this.node,HTMLAttributes:t})}else n=this.options.attrs;this.renderer.updateAttributes(n)}}};function Nx(n,e){return t=>t.editor.contentComponent?new Tx(n,t,e):{}}function Ax(n){const e=jo.c(23),{node:t,updateAttributes:r}=n,o=z.useRef(null),s=z.useRef(null),[i,a]=z.useState(!1),[l,c]=z.useState(!1),[d,u]=z.useState(!1),h=t.attrs.src;if(!h){let $;return e[0]===Symbol.for("react.memo_cache_sentinel")?($=N.jsx(js,{as:"div",className:"resizable-image-error",children:"이미지 소스가 없습니다."}),e[0]=$):$=e[0],$}if(d){let $;e[1]!==h?($=h?.substring(0,50),e[1]=h,e[2]=$):$=e[2];let Y;return e[3]!==$?(Y=N.jsxs(js,{as:"div",className:"resizable-image-error",children:["이미지를 불러올 수 없습니다: ",$,"..."]}),e[3]=$,e[4]=Y):Y=e[4],Y}let p;e[5]!==r?(p=($,Y)=>{if($.button!==0)return;$.preventDefault(),a(!0);const pe=$.clientX,Z=$.clientY,q=o.current?.offsetWidth||0,X=o.current?.offsetHeight||0,ee=X/q,L=Ce=>{const C=Ce.clientX-pe,B=Ce.clientY-Z;let V=q;e:switch(Y){case"se":case"e":{V=Math.max(100,q+C);break e}case"sw":case"w":{V=Math.max(100,q-C);break e}case"ne":case"n":{V=Math.max(100,q+C);break e}case"nw":{V=Math.max(100,q-C);break e}case"s":V=Math.max(100*ee,X+B)/ee}o.current&&(o.current.style.width=`${V}px`,o.current.style.height=`${V*ee}px`)},Se=()=>{a(!1),o.current&&r({width:o.current.offsetWidth,height:o.current.offsetHeight}),document.removeEventListener("mousemove",L),document.removeEventListener("mouseup",Se)};document.addEventListener("mousemove",L),document.addEventListener("mouseup",Se)},e[5]=r,e[6]=p):p=e[6];const f=p;let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m=()=>{c(!0)},e[7]=m):m=e[7];const g=m;let y;e[8]===Symbol.for("react.memo_cache_sentinel")?(y=$=>{s.current&&!s.current.contains($.target)&&c(!1)},e[8]=y):y=e[8];const w=y;let x;e[9]===Symbol.for("react.memo_cache_sentinel")?(x=()=>u(!0),e[9]=x):x=e[9];const E=`resizable-image ${i?"resizing":""} ${l?"selected":""}`,b=t.attrs.width?`${t.attrs.width}px`:"auto",T=t.attrs.height?`${t.attrs.height}px`:"auto";let v;e[10]!==b||e[11]!==T?(v={width:b,height:T},e[10]=b,e[11]=T,e[12]=v):v=e[12];let S;e[13]!==h||e[14]!==E||e[15]!==v?(S=N.jsx("img",{ref:o,src:h,alt:"inserted image",onClick:g,onError:x,className:E,style:v,draggable:"false"}),e[13]=h,e[14]=E,e[15]=v,e[16]=S):S=e[16];let R;e[17]!==f||e[18]!==l?(R=l&&N.jsxs(N.Fragment,{children:[N.jsx("div",{className:"resizable-image-border"}),N.jsx("div",{onMouseDown:$=>f($,"nw"),className:"resize-handle tl"}),N.jsx("div",{onMouseDown:$=>f($,"n"),className:"resize-handle t"}),N.jsx("div",{onMouseDown:$=>f($,"ne"),className:"resize-handle tr"}),N.jsx("div",{onMouseDown:$=>f($,"w"),className:"resize-handle l"}),N.jsx("div",{onMouseDown:$=>f($,"e"),className:"resize-handle r"}),N.jsx("div",{onMouseDown:$=>f($,"sw"),className:"resize-handle bl"}),N.jsx("div",{onMouseDown:$=>f($,"s"),className:"resize-handle b"}),N.jsx("div",{onMouseDown:$=>f($,"se"),className:"resize-handle br"})]}),e[17]=f,e[18]=l,e[19]=R):R=e[19];let _;return e[20]!==R||e[21]!==S?(_=N.jsx(js,{as:"div",onClick:w,className:"resizable-image-wrapper",draggable:"true","data-drag-handle":!0,children:N.jsxs("div",{ref:s,className:"resizable-image-container",onClick:Ox,children:[S,R]})}),e[20]=R,e[21]=S,e[22]=_):_=e[22],_}function Ox(n){return n.stopPropagation()}const Rx=ex.extend({addAttributes(){return{src:{default:null,parseHTML:n=>{const e=n.getAttribute("src");return console.log("Parsing image src:",e),e},renderHTML:n=>({src:n.src})},alt:{default:null,parseHTML:n=>n.getAttribute("alt"),renderHTML:n=>({alt:n.alt||"image"})},title:{default:null,parseHTML:n=>n.getAttribute("title"),renderHTML:n=>({title:n.title})},width:{default:null,parseHTML:n=>{const e=n.getAttribute("width");return e?parseInt(e,10):null},renderHTML:n=>({width:n.width})},height:{default:null,parseHTML:n=>{const e=n.getAttribute("height");return e?parseInt(e,10):null},renderHTML:n=>({height:n.height})}}},addNodeView(){return Nx(Ax)},draggable:!0,addStorage(){return{clipboardTextSerializer:n=>n.attrs.src||""}},renderHTML({HTMLAttributes:n}){return["img",{...n,class:"resizable-image"}]}}),Ch=[Y1.configure({paragraph:{HTMLAttributes:{class:"tiptap-paragraph"}},heading:{levels:[1,2,3]},bulletList:{HTMLAttributes:{class:"tiptap-bullet-list"}},orderedList:{HTMLAttributes:{class:"tiptap-ordered-list"}},codeBlock:{HTMLAttributes:{class:"tiptap-code-block"}},code:{HTMLAttributes:{class:"tiptap-inline-code"}},blockquote:{HTMLAttributes:{class:"tiptap-blockquote"}}}),y0,Lu,tb,sb.configure({multicolor:!0}),g0.configure({types:["heading","paragraph"]}),Rx,Ju.configure({resizable:!0}),f0,p0,h0];function Mh(n){var e,t,r="";if(typeof n=="string"||typeof n=="number")r+=n;else if(typeof n=="object")if(Array.isArray(n)){var o=n.length;for(e=0;e<o;e++)n[e]&&(t=Mh(n[e]))&&(r&&(r+=" "),r+=t)}else for(t in n)n[t]&&(r&&(r+=" "),r+=t);return r}function Dx(){for(var n,e,t=0,r="",o=arguments.length;t<o;t++)(n=arguments[t])&&(e=Mh(n))&&(r&&(r+=" "),r+=e);return r}const jx=(n,e)=>{const t=new Array(n.length+e.length);for(let r=0;r<n.length;r++)t[r]=n[r];for(let r=0;r<e.length;r++)t[n.length+r]=e[r];return t},Lx=(n,e)=>({classGroupId:n,validator:e}),Eh=(n=new Map,e=null,t)=>({nextPart:n,validators:e,classGroupId:t}),Ro="-",fc=[],zx="arbitrary..",$x=n=>{const e=Px(n),{conflictingClassGroups:t,conflictingClassGroupModifiers:r}=n;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return Ix(o);const s=o.split(Ro),i=s[0]===""&&s.length>1?1:0;return Th(s,i,e)},getConflictingClassGroupIds:(o,s)=>{if(s){const i=r[o],a=t[o];return i?a?jx(a,i):i:a||fc}return t[o]||fc}}},Th=(n,e,t)=>{if(n.length-e===0)return t.classGroupId;const r=n[e],o=t.nextPart.get(r);if(o){const l=Th(n,e+1,o);if(l)return l}const s=t.validators;if(s===null)return;const i=e===0?n.join(Ro):n.slice(e).join(Ro),a=s.length;for(let l=0;l<a;l++){const c=s[l];if(c.validator(i))return c.classGroupId}},Ix=n=>n.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=n.slice(1,-1),t=e.indexOf(":"),r=e.slice(0,t);return r?zx+r:void 0})(),Px=n=>{const{theme:e,classGroups:t}=n;return Hx(t,e)},Hx=(n,e)=>{const t=Eh();for(const r in n){const o=n[r];da(o,t,r,e)}return t},da=(n,e,t,r)=>{const o=n.length;for(let s=0;s<o;s++){const i=n[s];Bx(i,e,t,r)}},Bx=(n,e,t,r)=>{if(typeof n=="string"){Vx(n,e,t);return}if(typeof n=="function"){Fx(n,e,t,r);return}Wx(n,e,t,r)},Vx=(n,e,t)=>{const r=n===""?e:Nh(e,n);r.classGroupId=t},Fx=(n,e,t,r)=>{if(_x(n)){da(n(r),e,t,r);return}e.validators===null&&(e.validators=[]),e.validators.push(Lx(t,n))},Wx=(n,e,t,r)=>{const o=Object.entries(n),s=o.length;for(let i=0;i<s;i++){const[a,l]=o[i];da(l,Nh(e,a),t,r)}},Nh=(n,e)=>{let t=n;const r=e.split(Ro),o=r.length;for(let s=0;s<o;s++){const i=r[s];let a=t.nextPart.get(i);a||(a=Eh(),t.nextPart.set(i,a)),t=a}return t},_x=n=>"isThemeGetter"in n&&n.isThemeGetter===!0,Ux=n=>{if(n<1)return{get:()=>{},set:()=>{}};let e=0,t=Object.create(null),r=Object.create(null);const o=(s,i)=>{t[s]=i,e++,e>n&&(e=0,r=t,t=Object.create(null))};return{get(s){let i=t[s];if(i!==void 0)return i;if((i=r[s])!==void 0)return o(s,i),i},set(s,i){s in t?t[s]=i:o(s,i)}}},bi="!",mc=":",qx=[],gc=(n,e,t,r,o)=>({modifiers:n,hasImportantModifier:e,baseClassName:t,maybePostfixModifierPosition:r,isExternal:o}),Kx=n=>{const{prefix:e,experimentalParseClassName:t}=n;let r=o=>{const s=[];let i=0,a=0,l=0,c;const d=o.length;for(let m=0;m<d;m++){const g=o[m];if(i===0&&a===0){if(g===mc){s.push(o.slice(l,m)),l=m+1;continue}if(g==="/"){c=m;continue}}g==="["?i++:g==="]"?i--:g==="("?a++:g===")"&&a--}const u=s.length===0?o:o.slice(l);let h=u,p=!1;u.endsWith(bi)?(h=u.slice(0,-1),p=!0):u.startsWith(bi)&&(h=u.slice(1),p=!0);const f=c&&c>l?c-l:void 0;return gc(s,p,h,f)};if(e){const o=e+mc,s=r;r=i=>i.startsWith(o)?s(i.slice(o.length)):gc(qx,!1,i,void 0,!0)}if(t){const o=r;r=s=>t({className:s,parseClassName:o})}return r},Jx=n=>{const e=new Map;return n.orderSensitiveModifiers.forEach((t,r)=>{e.set(t,1e6+r)}),t=>{const r=[];let o=[];for(let s=0;s<t.length;s++){const i=t[s],a=i[0]==="[",l=e.has(i);a||l?(o.length>0&&(o.sort(),r.push(...o),o=[]),r.push(i)):o.push(i)}return o.length>0&&(o.sort(),r.push(...o)),r}},Gx=n=>({cache:Ux(n.cacheSize),parseClassName:Kx(n),sortModifiers:Jx(n),...$x(n)}),Xx=/\s+/,Yx=(n,e)=>{const{parseClassName:t,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:s}=e,i=[],a=n.trim().split(Xx);let l="";for(let c=a.length-1;c>=0;c-=1){const d=a[c],{isExternal:u,modifiers:h,hasImportantModifier:p,baseClassName:f,maybePostfixModifierPosition:m}=t(d);if(u){l=d+(l.length>0?" "+l:l);continue}let g=!!m,y=r(g?f.substring(0,m):f);if(!y){if(!g){l=d+(l.length>0?" "+l:l);continue}if(y=r(f),!y){l=d+(l.length>0?" "+l:l);continue}g=!1}const w=h.length===0?"":h.length===1?h[0]:s(h).join(":"),x=p?w+bi:w,E=x+y;if(i.indexOf(E)>-1)continue;i.push(E);const b=o(y,g);for(let T=0;T<b.length;++T){const v=b[T];i.push(x+v)}l=d+(l.length>0?" "+l:l)}return l},Qx=(...n)=>{let e=0,t,r,o="";for(;e<n.length;)(t=n[e++])&&(r=Ah(t))&&(o&&(o+=" "),o+=r);return o},Ah=n=>{if(typeof n=="string")return n;let e,t="";for(let r=0;r<n.length;r++)n[r]&&(e=Ah(n[r]))&&(t&&(t+=" "),t+=e);return t},Zx=(n,...e)=>{let t,r,o,s;const i=l=>{const c=e.reduce((d,u)=>u(d),n());return t=Gx(c),r=t.cache.get,o=t.cache.set,s=a,a(l)},a=l=>{const c=r(l);if(c)return c;const d=Yx(l,t);return o(l,d),d};return s=i,(...l)=>s(Qx(...l))},ew=[],ye=n=>{const e=t=>t[n]||ew;return e.isThemeGetter=!0,e},Oh=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Rh=/^\((?:(\w[\w-]*):)?(.+)\)$/i,tw=/^\d+\/\d+$/,nw=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,rw=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,ow=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,sw=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,iw=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,bn=n=>tw.test(n),G=n=>!!n&&!Number.isNaN(Number(n)),vt=n=>!!n&&Number.isInteger(Number(n)),Ls=n=>n.endsWith("%")&&G(n.slice(0,-1)),ht=n=>nw.test(n),aw=()=>!0,lw=n=>rw.test(n)&&!ow.test(n),Dh=()=>!1,cw=n=>sw.test(n),dw=n=>iw.test(n),uw=n=>!D(n)&&!j(n),hw=n=>zn(n,zh,Dh),D=n=>Oh.test(n),_t=n=>zn(n,$h,lw),zs=n=>zn(n,yw,G),yc=n=>zn(n,jh,Dh),pw=n=>zn(n,Lh,dw),Lr=n=>zn(n,Ih,cw),j=n=>Rh.test(n),Bn=n=>$n(n,$h),fw=n=>$n(n,bw),bc=n=>$n(n,jh),mw=n=>$n(n,zh),gw=n=>$n(n,Lh),zr=n=>$n(n,Ih,!0),zn=(n,e,t)=>{const r=Oh.exec(n);return r?r[1]?e(r[1]):t(r[2]):!1},$n=(n,e,t=!1)=>{const r=Rh.exec(n);return r?r[1]?e(r[1]):t:!1},jh=n=>n==="position"||n==="percentage",Lh=n=>n==="image"||n==="url",zh=n=>n==="length"||n==="size"||n==="bg-size",$h=n=>n==="length",yw=n=>n==="number",bw=n=>n==="family-name",Ih=n=>n==="shadow",xw=()=>{const n=ye("color"),e=ye("font"),t=ye("text"),r=ye("font-weight"),o=ye("tracking"),s=ye("leading"),i=ye("breakpoint"),a=ye("container"),l=ye("spacing"),c=ye("radius"),d=ye("shadow"),u=ye("inset-shadow"),h=ye("text-shadow"),p=ye("drop-shadow"),f=ye("blur"),m=ye("perspective"),g=ye("aspect"),y=ye("ease"),w=ye("animate"),x=()=>["auto","avoid","all","avoid-page","page","left","right","column"],E=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],b=()=>[...E(),j,D],T=()=>["auto","hidden","clip","visible","scroll"],v=()=>["auto","contain","none"],S=()=>[j,D,l],R=()=>[bn,"full","auto",...S()],_=()=>[vt,"none","subgrid",j,D],$=()=>["auto",{span:["full",vt,j,D]},vt,j,D],Y=()=>[vt,"auto",j,D],pe=()=>["auto","min","max","fr",j,D],Z=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],q=()=>["start","end","center","stretch","center-safe","end-safe"],X=()=>["auto",...S()],ee=()=>[bn,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...S()],L=()=>[n,j,D],Se=()=>[...E(),bc,yc,{position:[j,D]}],Ce=()=>["no-repeat",{repeat:["","x","y","space","round"]}],C=()=>["auto","cover","contain",mw,hw,{size:[j,D]}],B=()=>[Ls,Bn,_t],V=()=>["","none","full",c,j,D],U=()=>["",G,Bn,_t],J=()=>["solid","dashed","dotted","double"],oe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],F=()=>[G,Ls,bc,yc],Ne=()=>["","none",f,j,D],je=()=>["none",G,j,D],Be=()=>["none",G,j,D],tt=()=>[G,j,D],Ye=()=>[bn,"full",...S()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ht],breakpoint:[ht],color:[aw],container:[ht],"drop-shadow":[ht],ease:["in","out","in-out"],font:[uw],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ht],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ht],shadow:[ht],spacing:["px",G],text:[ht],"text-shadow":[ht],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",bn,D,j,g]}],container:["container"],columns:[{columns:[G,D,j,a]}],"break-after":[{"break-after":x()}],"break-before":[{"break-before":x()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:b()}],overflow:[{overflow:T()}],"overflow-x":[{"overflow-x":T()}],"overflow-y":[{"overflow-y":T()}],overscroll:[{overscroll:v()}],"overscroll-x":[{"overscroll-x":v()}],"overscroll-y":[{"overscroll-y":v()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:R()}],"inset-x":[{"inset-x":R()}],"inset-y":[{"inset-y":R()}],start:[{start:R()}],end:[{end:R()}],top:[{top:R()}],right:[{right:R()}],bottom:[{bottom:R()}],left:[{left:R()}],visibility:["visible","invisible","collapse"],z:[{z:[vt,"auto",j,D]}],basis:[{basis:[bn,"full","auto",a,...S()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[G,bn,"auto","initial","none",D]}],grow:[{grow:["",G,j,D]}],shrink:[{shrink:["",G,j,D]}],order:[{order:[vt,"first","last","none",j,D]}],"grid-cols":[{"grid-cols":_()}],"col-start-end":[{col:$()}],"col-start":[{"col-start":Y()}],"col-end":[{"col-end":Y()}],"grid-rows":[{"grid-rows":_()}],"row-start-end":[{row:$()}],"row-start":[{"row-start":Y()}],"row-end":[{"row-end":Y()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":pe()}],"auto-rows":[{"auto-rows":pe()}],gap:[{gap:S()}],"gap-x":[{"gap-x":S()}],"gap-y":[{"gap-y":S()}],"justify-content":[{justify:[...Z(),"normal"]}],"justify-items":[{"justify-items":[...q(),"normal"]}],"justify-self":[{"justify-self":["auto",...q()]}],"align-content":[{content:["normal",...Z()]}],"align-items":[{items:[...q(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...q(),{baseline:["","last"]}]}],"place-content":[{"place-content":Z()}],"place-items":[{"place-items":[...q(),"baseline"]}],"place-self":[{"place-self":["auto",...q()]}],p:[{p:S()}],px:[{px:S()}],py:[{py:S()}],ps:[{ps:S()}],pe:[{pe:S()}],pt:[{pt:S()}],pr:[{pr:S()}],pb:[{pb:S()}],pl:[{pl:S()}],m:[{m:X()}],mx:[{mx:X()}],my:[{my:X()}],ms:[{ms:X()}],me:[{me:X()}],mt:[{mt:X()}],mr:[{mr:X()}],mb:[{mb:X()}],ml:[{ml:X()}],"space-x":[{"space-x":S()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":S()}],"space-y-reverse":["space-y-reverse"],size:[{size:ee()}],w:[{w:[a,"screen",...ee()]}],"min-w":[{"min-w":[a,"screen","none",...ee()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[i]},...ee()]}],h:[{h:["screen","lh",...ee()]}],"min-h":[{"min-h":["screen","lh","none",...ee()]}],"max-h":[{"max-h":["screen","lh",...ee()]}],"font-size":[{text:["base",t,Bn,_t]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,j,zs]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Ls,D]}],"font-family":[{font:[fw,D,e]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,j,D]}],"line-clamp":[{"line-clamp":[G,"none",j,zs]}],leading:[{leading:[s,...S()]}],"list-image":[{"list-image":["none",j,D]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",j,D]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:L()}],"text-color":[{text:L()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...J(),"wavy"]}],"text-decoration-thickness":[{decoration:[G,"from-font","auto",j,_t]}],"text-decoration-color":[{decoration:L()}],"underline-offset":[{"underline-offset":[G,"auto",j,D]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:S()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",j,D]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",j,D]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Se()}],"bg-repeat":[{bg:Ce()}],"bg-size":[{bg:C()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},vt,j,D],radial:["",j,D],conic:[vt,j,D]},gw,pw]}],"bg-color":[{bg:L()}],"gradient-from-pos":[{from:B()}],"gradient-via-pos":[{via:B()}],"gradient-to-pos":[{to:B()}],"gradient-from":[{from:L()}],"gradient-via":[{via:L()}],"gradient-to":[{to:L()}],rounded:[{rounded:V()}],"rounded-s":[{"rounded-s":V()}],"rounded-e":[{"rounded-e":V()}],"rounded-t":[{"rounded-t":V()}],"rounded-r":[{"rounded-r":V()}],"rounded-b":[{"rounded-b":V()}],"rounded-l":[{"rounded-l":V()}],"rounded-ss":[{"rounded-ss":V()}],"rounded-se":[{"rounded-se":V()}],"rounded-ee":[{"rounded-ee":V()}],"rounded-es":[{"rounded-es":V()}],"rounded-tl":[{"rounded-tl":V()}],"rounded-tr":[{"rounded-tr":V()}],"rounded-br":[{"rounded-br":V()}],"rounded-bl":[{"rounded-bl":V()}],"border-w":[{border:U()}],"border-w-x":[{"border-x":U()}],"border-w-y":[{"border-y":U()}],"border-w-s":[{"border-s":U()}],"border-w-e":[{"border-e":U()}],"border-w-t":[{"border-t":U()}],"border-w-r":[{"border-r":U()}],"border-w-b":[{"border-b":U()}],"border-w-l":[{"border-l":U()}],"divide-x":[{"divide-x":U()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":U()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...J(),"hidden","none"]}],"divide-style":[{divide:[...J(),"hidden","none"]}],"border-color":[{border:L()}],"border-color-x":[{"border-x":L()}],"border-color-y":[{"border-y":L()}],"border-color-s":[{"border-s":L()}],"border-color-e":[{"border-e":L()}],"border-color-t":[{"border-t":L()}],"border-color-r":[{"border-r":L()}],"border-color-b":[{"border-b":L()}],"border-color-l":[{"border-l":L()}],"divide-color":[{divide:L()}],"outline-style":[{outline:[...J(),"none","hidden"]}],"outline-offset":[{"outline-offset":[G,j,D]}],"outline-w":[{outline:["",G,Bn,_t]}],"outline-color":[{outline:L()}],shadow:[{shadow:["","none",d,zr,Lr]}],"shadow-color":[{shadow:L()}],"inset-shadow":[{"inset-shadow":["none",u,zr,Lr]}],"inset-shadow-color":[{"inset-shadow":L()}],"ring-w":[{ring:U()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:L()}],"ring-offset-w":[{"ring-offset":[G,_t]}],"ring-offset-color":[{"ring-offset":L()}],"inset-ring-w":[{"inset-ring":U()}],"inset-ring-color":[{"inset-ring":L()}],"text-shadow":[{"text-shadow":["none",h,zr,Lr]}],"text-shadow-color":[{"text-shadow":L()}],opacity:[{opacity:[G,j,D]}],"mix-blend":[{"mix-blend":[...oe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":oe()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[G]}],"mask-image-linear-from-pos":[{"mask-linear-from":F()}],"mask-image-linear-to-pos":[{"mask-linear-to":F()}],"mask-image-linear-from-color":[{"mask-linear-from":L()}],"mask-image-linear-to-color":[{"mask-linear-to":L()}],"mask-image-t-from-pos":[{"mask-t-from":F()}],"mask-image-t-to-pos":[{"mask-t-to":F()}],"mask-image-t-from-color":[{"mask-t-from":L()}],"mask-image-t-to-color":[{"mask-t-to":L()}],"mask-image-r-from-pos":[{"mask-r-from":F()}],"mask-image-r-to-pos":[{"mask-r-to":F()}],"mask-image-r-from-color":[{"mask-r-from":L()}],"mask-image-r-to-color":[{"mask-r-to":L()}],"mask-image-b-from-pos":[{"mask-b-from":F()}],"mask-image-b-to-pos":[{"mask-b-to":F()}],"mask-image-b-from-color":[{"mask-b-from":L()}],"mask-image-b-to-color":[{"mask-b-to":L()}],"mask-image-l-from-pos":[{"mask-l-from":F()}],"mask-image-l-to-pos":[{"mask-l-to":F()}],"mask-image-l-from-color":[{"mask-l-from":L()}],"mask-image-l-to-color":[{"mask-l-to":L()}],"mask-image-x-from-pos":[{"mask-x-from":F()}],"mask-image-x-to-pos":[{"mask-x-to":F()}],"mask-image-x-from-color":[{"mask-x-from":L()}],"mask-image-x-to-color":[{"mask-x-to":L()}],"mask-image-y-from-pos":[{"mask-y-from":F()}],"mask-image-y-to-pos":[{"mask-y-to":F()}],"mask-image-y-from-color":[{"mask-y-from":L()}],"mask-image-y-to-color":[{"mask-y-to":L()}],"mask-image-radial":[{"mask-radial":[j,D]}],"mask-image-radial-from-pos":[{"mask-radial-from":F()}],"mask-image-radial-to-pos":[{"mask-radial-to":F()}],"mask-image-radial-from-color":[{"mask-radial-from":L()}],"mask-image-radial-to-color":[{"mask-radial-to":L()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":E()}],"mask-image-conic-pos":[{"mask-conic":[G]}],"mask-image-conic-from-pos":[{"mask-conic-from":F()}],"mask-image-conic-to-pos":[{"mask-conic-to":F()}],"mask-image-conic-from-color":[{"mask-conic-from":L()}],"mask-image-conic-to-color":[{"mask-conic-to":L()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Se()}],"mask-repeat":[{mask:Ce()}],"mask-size":[{mask:C()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",j,D]}],filter:[{filter:["","none",j,D]}],blur:[{blur:Ne()}],brightness:[{brightness:[G,j,D]}],contrast:[{contrast:[G,j,D]}],"drop-shadow":[{"drop-shadow":["","none",p,zr,Lr]}],"drop-shadow-color":[{"drop-shadow":L()}],grayscale:[{grayscale:["",G,j,D]}],"hue-rotate":[{"hue-rotate":[G,j,D]}],invert:[{invert:["",G,j,D]}],saturate:[{saturate:[G,j,D]}],sepia:[{sepia:["",G,j,D]}],"backdrop-filter":[{"backdrop-filter":["","none",j,D]}],"backdrop-blur":[{"backdrop-blur":Ne()}],"backdrop-brightness":[{"backdrop-brightness":[G,j,D]}],"backdrop-contrast":[{"backdrop-contrast":[G,j,D]}],"backdrop-grayscale":[{"backdrop-grayscale":["",G,j,D]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[G,j,D]}],"backdrop-invert":[{"backdrop-invert":["",G,j,D]}],"backdrop-opacity":[{"backdrop-opacity":[G,j,D]}],"backdrop-saturate":[{"backdrop-saturate":[G,j,D]}],"backdrop-sepia":[{"backdrop-sepia":["",G,j,D]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":S()}],"border-spacing-x":[{"border-spacing-x":S()}],"border-spacing-y":[{"border-spacing-y":S()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",j,D]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[G,"initial",j,D]}],ease:[{ease:["linear","initial",y,j,D]}],delay:[{delay:[G,j,D]}],animate:[{animate:["none",w,j,D]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,j,D]}],"perspective-origin":[{"perspective-origin":b()}],rotate:[{rotate:je()}],"rotate-x":[{"rotate-x":je()}],"rotate-y":[{"rotate-y":je()}],"rotate-z":[{"rotate-z":je()}],scale:[{scale:Be()}],"scale-x":[{"scale-x":Be()}],"scale-y":[{"scale-y":Be()}],"scale-z":[{"scale-z":Be()}],"scale-3d":["scale-3d"],skew:[{skew:tt()}],"skew-x":[{"skew-x":tt()}],"skew-y":[{"skew-y":tt()}],transform:[{transform:[j,D,"","none","gpu","cpu"]}],"transform-origin":[{origin:b()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ye()}],"translate-x":[{"translate-x":Ye()}],"translate-y":[{"translate-y":Ye()}],"translate-z":[{"translate-z":Ye()}],"translate-none":["translate-none"],accent:[{accent:L()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:L()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",j,D]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":S()}],"scroll-mx":[{"scroll-mx":S()}],"scroll-my":[{"scroll-my":S()}],"scroll-ms":[{"scroll-ms":S()}],"scroll-me":[{"scroll-me":S()}],"scroll-mt":[{"scroll-mt":S()}],"scroll-mr":[{"scroll-mr":S()}],"scroll-mb":[{"scroll-mb":S()}],"scroll-ml":[{"scroll-ml":S()}],"scroll-p":[{"scroll-p":S()}],"scroll-px":[{"scroll-px":S()}],"scroll-py":[{"scroll-py":S()}],"scroll-ps":[{"scroll-ps":S()}],"scroll-pe":[{"scroll-pe":S()}],"scroll-pt":[{"scroll-pt":S()}],"scroll-pr":[{"scroll-pr":S()}],"scroll-pb":[{"scroll-pb":S()}],"scroll-pl":[{"scroll-pl":S()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",j,D]}],fill:[{fill:["none",...L()]}],"stroke-w":[{stroke:[G,Bn,_t,zs]}],stroke:[{stroke:["none",...L()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},ww=Zx(xw);function Cn(...n){return ww(Dx(n))}const kw=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),vw=n=>n.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,r)=>r?r.toUpperCase():t.toLowerCase()),xc=n=>{const e=vw(n);return e.charAt(0).toUpperCase()+e.slice(1)},Ph=(...n)=>n.filter((e,t,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===t).join(" ").trim(),Sw=n=>{for(const e in n)if(e.startsWith("aria-")||e==="role"||e==="title")return!0};var Cw={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const Mw=z.forwardRef(({color:n="currentColor",size:e=24,strokeWidth:t=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:i,...a},l)=>z.createElement("svg",{ref:l,...Cw,width:e,height:e,stroke:n,strokeWidth:r?Number(t)*24/Number(e):t,className:Ph("lucide",o),...!s&&!Sw(a)&&{"aria-hidden":"true"},...a},[...i.map(([c,d])=>z.createElement(c,d)),...Array.isArray(s)?s:[s]])),ge=(n,e)=>{const t=z.forwardRef(({className:r,...o},s)=>z.createElement(Mw,{ref:s,iconNode:e,className:Ph(`lucide-${kw(xc(n))}`,`lucide-${n}`,r),...o}));return t.displayName=xc(n),t},Ew=[["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"}]],Tw=ge("bold",Ew),Nw=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],wc=ge("code",Nw),Aw=[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"m17 12 3-2v8",key:"1hhhft"}]],Ow=ge("heading-1",Aw),Rw=[["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"}]],Dw=ge("heading-2",Rw),jw=[["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"}]],Lw=ge("heading-3",jw),zw=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],$w=ge("image",zw),Iw=[["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"}]],Pw=ge("italic",Iw),Hw=[["path",{d:"M11 5h10",key:"1cz7ny"}],["path",{d:"M11 12h10",key:"1438ji"}],["path",{d:"M11 19h10",key:"11t30w"}],["path",{d:"M4 4h1v5",key:"10yrso"}],["path",{d:"M4 9h2",key:"r1h2o0"}],["path",{d:"M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02",key:"xtkcd5"}]],Bw=ge("list-ordered",Hw),Vw=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],Fw=ge("list",Vw),Ww=[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]],_w=ge("palette",Ww),Uw=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],qw=ge("pen",Uw),Kw=[["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"}]],Jw=ge("quote",Kw),Gw=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],Xw=ge("rotate-ccw",Gw),Yw=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],Qw=ge("rotate-cw",Yw),Zw=[["path",{d:"M16 4H9a3 3 0 0 0-2.83 4",key:"43sutm"}],["path",{d:"M14 12a4 4 0 0 1 0 8H6",key:"nlfj13"}],["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}]],ek=ge("strikethrough",Zw),tk=[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M17 12H7",key:"16if0g"}],["path",{d:"M19 19H5",key:"vjpgq2"}]],nk=ge("text-align-center",tk),rk=[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M21 19H7",key:"4cu937"}]],ok=ge("text-align-end",rk),sk=[["path",{d:"M3 5h18",key:"1u36vt"}],["path",{d:"M3 12h18",key:"1i2n21"}],["path",{d:"M3 19h18",key:"awlh7x"}]],ik=ge("text-align-justify",sk),ak=[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M17 19H3",key:"z6ezky"}]],lk=ge("text-align-start",ak),ck=[["path",{d:"M6 4v6a6 6 0 0 0 12 0V4",key:"9kb039"}],["line",{x1:"4",x2:"20",y1:"20",y2:"20",key:"nun2al"}]],dk=ge("underline",ck),ua=[{id:"black",cssVar:"var(--editor-text-black)",label:"Black/White"},{id:"gray-600",cssVar:"var(--editor-text-gray-600)",label:"Gray"},{id:"red-500",cssVar:"var(--editor-text-red-500)",label:"Red"},{id:"orange-500",cssVar:"var(--editor-text-orange-500)",label:"Orange"},{id:"yellow-500",cssVar:"var(--editor-text-yellow-500)",label:"Yellow"},{id:"green-500",cssVar:"var(--editor-text-green-500)",label:"Green"},{id:"blue-500",cssVar:"var(--editor-text-blue-500)",label:"Blue"},{id:"purple-500",cssVar:"var(--editor-text-purple-500)",label:"Purple"},{id:"pink-500",cssVar:"var(--editor-text-pink-500)",label:"Pink"}];function kc(n){const e=ua.find(t=>t.id===n);return e?e.cssVar:n}function vc(n){const e=ua.find(t=>t.cssVar===n);return e?e.id:n}function Sc(n){const e=jo.c(15),{currentColor:t,onColorSelect:r,onReset:o,onClose:s,type:i}=n,a=i==="text"?"텍스트 색상":"배경 색상";let l;e[0]!==a?(l=N.jsx("div",{className:"color-picker-label",children:a}),e[0]=a,e[1]=l):l=e[1];let c;e[2]!==t||e[3]!==s||e[4]!==r?(c=ua.map(p=>{const f=t===p.id||t===p.cssVar;return N.jsx("button",{type:"button",onClick:()=>{r(p.id),s()},className:`color-grid-button ${f?"selected":""}`,style:{backgroundColor:p.cssVar},title:`${p.label}`},p.id)}),e[2]=t,e[3]=s,e[4]=r,e[5]=c):c=e[5];let d;e[6]!==c?(d=N.jsx("div",{className:"color-grid",children:c}),e[6]=c,e[7]=d):d=e[7];let u;e[8]!==s||e[9]!==o?(u=N.jsx("button",{type:"button",onClick:()=>{o(),s()},className:"color-picker-reset-button",children:"색상 제거"}),e[8]=s,e[9]=o,e[10]=u):u=e[10];let h;return e[11]!==l||e[12]!==d||e[13]!==u?(h=N.jsxs("div",{className:"color-picker",children:[l,d,u]}),e[11]=l,e[12]=d,e[13]=u,e[14]=h):h=e[14],h}function uk(n){const e=jo.c(179),{editor:t,onAddImage:r,hideMenuButtons:o,classNames:s}=n;let i;e[0]!==o?(i=o===void 0?[]:o,e[0]=o,e[1]=i):i=e[1];const a=i,[l,c]=z.useState(!1),[d,u]=z.useState(!1),h=z.useRef(null),p=z.useRef(null);let f,m;e[2]===Symbol.for("react.memo_cache_sentinel")?(f=()=>{const nt=mn=>{h.current&&!h.current.contains(mn.target)&&c(!1),p.current&&!p.current.contains(mn.target)&&u(!1)};return document.addEventListener("mousedown",nt),()=>{document.removeEventListener("mousedown",nt)}},m=[],e[2]=f,e[3]=m):(f=e[2],m=e[3]),z.useEffect(f,m);let g;e[4]!==t?(g={editor:t,selector:hk},e[4]=t,e[5]=g):g=e[5];const y=kh(g);let w;e[6]!==s?.button?(w=nt=>Cn("menubar-button",nt&&"active",s?.button),e[6]=s?.button,e[7]=w):w=e[7];const x=w;let E;e[8]!==a?(E=nt=>a.includes(nt),e[8]=a,e[9]=E):E=e[9];const b=E,T=s?.container;let v;e[10]!==T?(v=Cn("menubar-container",T),e[10]=T,e[11]=v):v=e[11];let S;e[12]!==x||e[13]!==t||e[14]!==y||e[15]!==b?(S=!b("bold")&&N.jsx("button",{type:"button",onClick:()=>t.chain().focus().toggleBold().run(),title:"Bold (Ctrl+B)",className:x(y.isBold),children:N.jsx(Tw,{size:14})}),e[12]=x,e[13]=t,e[14]=y,e[15]=b,e[16]=S):S=e[16];let R;e[17]!==x||e[18]!==t||e[19]!==y||e[20]!==b?(R=!b("italic")&&N.jsx("button",{type:"button",onClick:()=>t.chain().focus().toggleItalic().run(),title:"Italic (Ctrl+I)",className:x(y.isItalic),children:N.jsx(Pw,{size:14})}),e[17]=x,e[18]=t,e[19]=y,e[20]=b,e[21]=R):R=e[21];let _;e[22]!==x||e[23]!==t||e[24]!==y||e[25]!==b?(_=!b("strike")&&N.jsx("button",{type:"button",onClick:()=>t.chain().focus().toggleStrike().run(),title:"Strikethrough",className:x(y.isStrike),children:N.jsx(ek,{size:14})}),e[22]=x,e[23]=t,e[24]=y,e[25]=b,e[26]=_):_=e[26];let $;e[27]!==x||e[28]!==t||e[29]!==y||e[30]!==b?($=!b("underline")&&N.jsx("button",{type:"button",onClick:()=>t.chain().focus().toggleUnderline().run(),title:"Underline (Ctrl+U)",className:x(y.isUnderline),children:N.jsx(dk,{size:14})}),e[27]=x,e[28]=t,e[29]=y,e[30]=b,e[31]=$):$=e[31];let Y;e[32]!==b?(Y=(!b("bold")||!b("italic")||!b("strike")||!b("underline")||!b("textColor")||!b("bgColor"))&&N.jsx("div",{className:"menubar-separator"}),e[32]=b,e[33]=Y):Y=e[33];let pe;e[34]!==x||e[35]!==t||e[36]!==y||e[37]!==b||e[38]!==l?(pe=!b("textColor")&&N.jsxs("div",{className:"color-picker-container",ref:h,children:[N.jsx("button",{type:"button",onClick:()=>{c(!l),u(!1)},title:"Text Color",className:Cn(x(!1),"color-button"),children:N.jsxs("div",{className:"color-button",children:[N.jsx(qw,{size:14}),N.jsx("div",{className:"color-display-bar",style:{backgroundColor:y.displayColor}})]})}),l&&N.jsx(Sc,{currentColor:y.currentColor,onColorSelect:nt=>{const mn=kc(nt);t.chain().focus().setColor(mn).run()},onReset:()=>t.chain().focus().unsetColor().run(),onClose:()=>c(!1),type:"text"})]}),e[34]=x,e[35]=t,e[36]=y,e[37]=b,e[38]=l,e[39]=pe):pe=e[39];let Z;e[40]!==x||e[41]!==t||e[42]!==y||e[43]!==b||e[44]!==d?(Z=!b("bgColor")&&N.jsxs("div",{className:"color-picker-container",ref:p,children:[N.jsx("button",{type:"button",onClick:()=>{u(!d),c(!1)},title:"Background Color",className:Cn(x(!1),"color-button"),children:N.jsxs("div",{className:"color-button",children:[N.jsx(_w,{size:14}),N.jsx("div",{className:"color-display-bar",style:{backgroundColor:y.displayHighlight}})]})}),d&&N.jsx(Sc,{currentColor:y.currentHighlight,onColorSelect:nt=>{const mn=kc(nt);t.chain().focus().toggleHighlight({color:mn}).run()},onReset:()=>t.chain().focus().unsetHighlight().run(),onClose:()=>u(!1),type:"background"})]}),e[40]=x,e[41]=t,e[42]=y,e[43]=b,e[44]=d,e[45]=Z):Z=e[45];let q;e[46]!==b?(q=(!b("table")||!b("image"))&&N.jsx("div",{className:"menubar-separator"}),e[46]=b,e[47]=q):q=e[47];let X;e[48]!==x||e[49]!==t||e[50]!==y||e[51]!==b?(X=!b("table")&&N.jsx("button",{type:"button",onClick:()=>t.chain().focus().insertTable({rows:3,cols:3}).run(),title:"Insert Table",className:x(y.isTable),children:N.jsxs("svg",{className:"menubar-table-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[N.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),N.jsx("path",{d:"M3 9h18M3 15h18M9 21V3M15 21V3"})]})}),e[48]=x,e[49]=t,e[50]=y,e[51]=b,e[52]=X):X=e[52];let ee;e[53]!==x||e[54]!==b||e[55]!==r?(ee=!b("image")&&r&&N.jsx("button",{type:"button",onClick:r,title:"Insert Image",className:x(!1),children:N.jsx($w,{size:14})}),e[53]=x,e[54]=b,e[55]=r,e[56]=ee):ee=e[56];let L;e[57]!==b?(L=(!b("h1")||!b("h2")||!b("h3")||!b("paragraph"))&&N.jsx("div",{className:"menubar-separator"}),e[57]=b,e[58]=L):L=e[58];let Se;e[59]!==x||e[60]!==t||e[61]!==y||e[62]!==b?(Se=!b("h1")&&N.jsx("button",{type:"button",onClick:()=>t.chain().focus().toggleHeading({level:1}).run(),title:"Heading 1",className:x(y.isHeading1),children:N.jsx(Ow,{size:14})}),e[59]=x,e[60]=t,e[61]=y,e[62]=b,e[63]=Se):Se=e[63];let Ce;e[64]!==x||e[65]!==t||e[66]!==y||e[67]!==b?(Ce=!b("h2")&&N.jsx("button",{type:"button",onClick:()=>t.chain().focus().toggleHeading({level:2}).run(),title:"Heading 2",className:x(y.isHeading2),children:N.jsx(Dw,{size:14})}),e[64]=x,e[65]=t,e[66]=y,e[67]=b,e[68]=Ce):Ce=e[68];let C;e[69]!==x||e[70]!==t||e[71]!==y||e[72]!==b?(C=!b("h3")&&N.jsx("button",{type:"button",onClick:()=>t.chain().focus().toggleHeading({level:3}).run(),title:"Heading 3",className:x(y.isHeading3),children:N.jsx(Lw,{size:14})}),e[69]=x,e[70]=t,e[71]=y,e[72]=b,e[73]=C):C=e[73];let B;e[74]!==x||e[75]!==t||e[76]!==y||e[77]!==b?(B=!b("paragraph")&&N.jsx("button",{type:"button",onClick:()=>t.chain().focus().setParagraph().run(),title:"Paragraph",className:x(y.isParagraph),children:"¶"}),e[74]=x,e[75]=t,e[76]=y,e[77]=b,e[78]=B):B=e[78];let V;e[79]!==b?(V=(!b("bulletList")||!b("orderedList"))&&N.jsx("div",{className:"menubar-separator"}),e[79]=b,e[80]=V):V=e[80];let U;e[81]!==x||e[82]!==t||e[83]!==y||e[84]!==b?(U=!b("bulletList")&&N.jsx("button",{type:"button",onClick:()=>t.chain().focus().toggleBulletList().run(),title:"Bullet List",className:x(y.isBulletList),children:N.jsx(Fw,{size:14})}),e[81]=x,e[82]=t,e[83]=y,e[84]=b,e[85]=U):U=e[85];let J;e[86]!==x||e[87]!==t||e[88]!==y||e[89]!==b?(J=!b("orderedList")&&N.jsx("button",{type:"button",onClick:()=>t.chain().focus().toggleOrderedList().run(),title:"Ordered List",className:x(y.isOrderedList),children:N.jsx(Bw,{size:14})}),e[86]=x,e[87]=t,e[88]=y,e[89]=b,e[90]=J):J=e[90];let oe;e[91]!==b?(oe=(!b("code")||!b("codeBlock")||!b("blockquote")||!b("horizontalRule"))&&N.jsx("div",{className:"menubar-separator"}),e[91]=b,e[92]=oe):oe=e[92];let F;e[93]!==x||e[94]!==t||e[95]!==y||e[96]!==b?(F=!b("code")&&N.jsx("button",{type:"button",onClick:()=>t.chain().focus().toggleCode().run(),title:"Code (Ctrl+`)",className:x(y.isCode),children:N.jsx(wc,{size:14})}),e[93]=x,e[94]=t,e[95]=y,e[96]=b,e[97]=F):F=e[97];let Ne;e[98]!==x||e[99]!==t||e[100]!==y||e[101]!==b?(Ne=!b("codeBlock")&&N.jsx("button",{type:"button",onClick:()=>t.chain().focus().toggleCodeBlock().run(),title:"Code Block",className:x(y.isCodeBlock),children:N.jsx(wc,{size:14})}),e[98]=x,e[99]=t,e[100]=y,e[101]=b,e[102]=Ne):Ne=e[102];let je;e[103]!==x||e[104]!==t||e[105]!==y||e[106]!==b?(je=!b("blockquote")&&N.jsx("button",{type:"button",onClick:()=>t.chain().focus().toggleBlockquote().run(),title:"Blockquote",className:x(y.isBlockquote),children:N.jsx(Jw,{size:14})}),e[103]=x,e[104]=t,e[105]=y,e[106]=b,e[107]=je):je=e[107];let Be;e[108]!==x||e[109]!==t||e[110]!==b?(Be=!b("horizontalRule")&&N.jsx("button",{type:"button",onClick:()=>t.chain().focus().setHorizontalRule().run(),title:"Horizontal Rule",className:x(!1),children:"—"}),e[108]=x,e[109]=t,e[110]=b,e[111]=Be):Be=e[111];let tt;e[112]!==b?(tt=(!b("alignLeft")||!b("alignCenter")||!b("alignRight")||!b("alignJustify"))&&N.jsx("div",{className:"menubar-separator"}),e[112]=b,e[113]=tt):tt=e[113];let Ye;e[114]!==x||e[115]!==t||e[116]!==y||e[117]!==b?(Ye=!b("alignLeft")&&N.jsx("button",{type:"button",onClick:()=>t.chain().focus().setTextAlign("left").run(),title:"Align Left",className:x(y.alignLeft),children:N.jsx(lk,{size:14})}),e[114]=x,e[115]=t,e[116]=y,e[117]=b,e[118]=Ye):Ye=e[118];let cn;e[119]!==x||e[120]!==t||e[121]!==y||e[122]!==b?(cn=!b("alignCenter")&&N.jsx("button",{type:"button",onClick:()=>t.chain().focus().setTextAlign("center").run(),title:"Align Center",className:x(y.alignCenter),children:N.jsx(nk,{size:14})}),e[119]=x,e[120]=t,e[121]=y,e[122]=b,e[123]=cn):cn=e[123];let dn;e[124]!==x||e[125]!==t||e[126]!==y||e[127]!==b?(dn=!b("alignRight")&&N.jsx("button",{type:"button",onClick:()=>t.chain().focus().setTextAlign("right").run(),title:"Align Right",className:x(y.alignRight),children:N.jsx(ok,{size:14})}),e[124]=x,e[125]=t,e[126]=y,e[127]=b,e[128]=dn):dn=e[128];let un;e[129]!==x||e[130]!==t||e[131]!==y||e[132]!==b?(un=!b("alignJustify")&&N.jsx("button",{type:"button",onClick:()=>t.chain().focus().setTextAlign("justify").run(),title:"Justify",className:x(y.alignJustify),children:N.jsx(ik,{size:14})}),e[129]=x,e[130]=t,e[131]=y,e[132]=b,e[133]=un):un=e[133];let hn;e[134]!==b?(hn=(!b("undo")||!b("redo"))&&N.jsx("div",{className:"menubar-separator"}),e[134]=b,e[135]=hn):hn=e[135];let pn;e[136]!==x||e[137]!==t||e[138]!==y||e[139]!==b?(pn=!b("undo")&&N.jsx("button",{type:"button",onClick:()=>t.chain().focus().undo().run(),disabled:!y.canUndo,title:"Undo (Ctrl+Z)",className:x(!1),children:N.jsx(Xw,{size:14})}),e[136]=x,e[137]=t,e[138]=y,e[139]=b,e[140]=pn):pn=e[140];let fn;e[141]!==x||e[142]!==t||e[143]!==y||e[144]!==b?(fn=!b("redo")&&N.jsx("button",{type:"button",onClick:()=>t.chain().focus().redo().run(),disabled:!y.canRedo,title:"Redo (Ctrl+Y)",className:x(!1),children:N.jsx(Qw,{size:14})}),e[141]=x,e[142]=t,e[143]=y,e[144]=b,e[145]=fn):fn=e[145];let yr;return e[146]!==S||e[147]!==R||e[148]!==_||e[149]!==$||e[150]!==Y||e[151]!==pe||e[152]!==Z||e[153]!==q||e[154]!==X||e[155]!==ee||e[156]!==L||e[157]!==Se||e[158]!==Ce||e[159]!==C||e[160]!==B||e[161]!==V||e[162]!==U||e[163]!==J||e[164]!==oe||e[165]!==F||e[166]!==Ne||e[167]!==je||e[168]!==Be||e[169]!==tt||e[170]!==Ye||e[171]!==cn||e[172]!==dn||e[173]!==un||e[174]!==hn||e[175]!==pn||e[176]!==fn||e[177]!==v?(yr=N.jsxs("div",{className:v,children:[S,R,_,$,Y,pe,Z,q,X,ee,L,Se,Ce,C,B,V,U,J,oe,F,Ne,je,Be,tt,Ye,cn,dn,un,hn,pn,fn]}),e[146]=S,e[147]=R,e[148]=_,e[149]=$,e[150]=Y,e[151]=pe,e[152]=Z,e[153]=q,e[154]=X,e[155]=ee,e[156]=L,e[157]=Se,e[158]=Ce,e[159]=C,e[160]=B,e[161]=V,e[162]=U,e[163]=J,e[164]=oe,e[165]=F,e[166]=Ne,e[167]=je,e[168]=Be,e[169]=tt,e[170]=Ye,e[171]=cn,e[172]=dn,e[173]=un,e[174]=hn,e[175]=pn,e[176]=fn,e[177]=v,e[178]=yr):yr=e[178],yr}function hk(n){const e=n.editor.getAttributes("textStyle").color,t=n.editor.getAttributes("highlight").color;return{isBold:n.editor.isActive("bold")??!1,isItalic:n.editor.isActive("italic")??!1,isUnderline:n.editor.isActive("underline")??!1,isStrike:n.editor.isActive("strike")??!1,isCode:n.editor.isActive("code")??!1,canClearMarks:n.editor.can().chain().unsetAllMarks().run()??!1,isParagraph:n.editor.isActive("paragraph")??!1,isHeading1:n.editor.isActive("heading",{level:1})??!1,isHeading2:n.editor.isActive("heading",{level:2})??!1,isHeading3:n.editor.isActive("heading",{level:3})??!1,isBulletList:n.editor.isActive("bulletList")??!1,isOrderedList:n.editor.isActive("orderedList")??!1,isCodeBlock:n.editor.isActive("codeBlock")??!1,isBlockquote:n.editor.isActive("blockquote")??!1,canUndo:n.editor.can().chain().undo().run()??!1,canRedo:n.editor.can().chain().redo().run()??!1,isTable:n.editor.isActive("table")??!1,alignLeft:n.editor.isActive({textAlign:"left"})??!1,alignCenter:n.editor.isActive({textAlign:"center"})??!1,alignRight:n.editor.isActive({textAlign:"right"})??!1,alignJustify:n.editor.isActive({textAlign:"justify"})??!1,currentColor:e?vc(e):"black",currentHighlight:t?vc(t):"#ffffff",displayColor:e||"var(--editor-text-black)",displayHighlight:t||"transparent"}}function Cc(n){if(!n)return"<p></p>";try{return JSON.parse(n)}catch{return n}}function pk({ref:n,className:e,classNames:t,initialContent:r="",hideMenuButtons:o=[]}){const s=wx({extensions:Ch,content:Cc(r),editorProps:{attributes:{class:Cn("tiptap-editor-content",t?.editorContent)},handlePaste(a,l){const c=l.clipboardData?.items;if(!c)return!1;for(let d=0;d<c.length;d++)if(c[d].kind==="file"&&c[d].type.startsWith("image/")){l.preventDefault();const u=c[d].getAsFile();if(!u)continue;const h=new FileReader;return h.onload=p=>{const f=p.target?.result,{state:m}=a,{$from:g}=m.selection,y=m.schema.nodes.image.create({src:f}),w=m.tr.insert(g.pos,y);a.dispatch(w)},h.readAsDataURL(u),!0}return!1},handleDOMEvents:{copy:(a,l)=>{const{state:c}=a,{selection:d}=c,{$from:u,$to:h}=d;return c.doc.nodesBetween(u.pos,h.pos,p=>{if(p.type.name==="image"&&p.attrs.src){if(l.preventDefault(),l.clipboardData){if(p.attrs.src.startsWith("data:image/"))try{const f=p.attrs.src.split(",")[1],m=p.attrs.src.match(/data:([^;]+);/)?.[1]||"image/png",g=atob(f),y=new Array(g.length);for(let b=0;b<g.length;b++)y[b]=g.charCodeAt(b);const w=new Uint8Array(y),x=new Blob([w],{type:m}),E=new ClipboardItem({[m]:x});navigator.clipboard.write([E]).catch(b=>{console.error("Failed to copy image to clipboard:",b)})}catch(f){console.error("Failed to process image for clipboard:",f)}l.clipboardData.setData("text/html",`<img src="${p.attrs.src}" />`),l.clipboardData.setData("text/plain",p.attrs.src)}return!1}}),!1},cut:(a,l)=>{const{state:c}=a,{selection:d}=c,{$from:u,$to:h}=d;return c.doc.nodesBetween(u.pos,h.pos,(p,f)=>{if(p.type.name==="image"&&p.attrs.src){if(l.preventDefault(),l.clipboardData){if(p.attrs.src.startsWith("data:image/"))try{const g=p.attrs.src.split(",")[1],y=p.attrs.src.match(/data:([^;]+);/)?.[1]||"image/png",w=atob(g),x=new Array(w.length);for(let v=0;v<w.length;v++)x[v]=w.charCodeAt(v);const E=new Uint8Array(x),b=new Blob([E],{type:y}),T=new ClipboardItem({[y]:b});navigator.clipboard.write([T]).catch(v=>{console.error("Failed to copy image to clipboard:",v)})}catch(g){console.error("Failed to process image for clipboard:",g)}l.clipboardData.setData("text/html",`<img src="${p.attrs.src}" />`),l.clipboardData.setData("text/plain",p.attrs.src)}const m=c.tr.delete(f,f+p.nodeSize);return a.dispatch(m),!1}}),!1}}}}),i=z.useCallback(()=>{const a=document.createElement("input");a.type="file",a.accept="image/*",a.onchange=l=>{const c=l.target.files?.[0];if(!c||!s)return;const d=new FileReader;d.onload=u=>{const h=u.target?.result;s.chain().focus().insertContent({type:"image",attrs:{src:h}}).run()},d.readAsDataURL(c)},a.click()},[s]);return z.useEffect(()=>{if(s&&r&&r.trim()){const a=Cc(r);s.commands.setContent(a)}},[s,r]),z.useImperativeHandle(n,()=>({getJSON:()=>s?JSON.stringify(s.getJSON()):"{}"}),[s]),s?N.jsxs("div",{className:Cn("tiptap-editor-wrapper",e),children:[N.jsx(uk,{editor:s,onAddImage:i,hideMenuButtons:o,classNames:{container:t?.menubarContainer,button:t?.menubarButton}}),N.jsx(mx,{editor:s})]}):null}function fk(n,e,t){if(typeof window>"u")throw new Error("getHTMLFromFragment can only be used in a browser environment\nIf you want to use this in a Node environment, use the `@tiptap/html/server` import instead.");const r=Bt.fromSchema(e).serializeFragment(n.content,{document:window.document});return new XMLSerializer().serializeToString(r)}function mk(n,e){if(typeof window>"u")throw new Error("generateHTML can only be used in a browser environment\nIf you want to use this in a Node environment, use the `@tiptap/html/server` import instead.");const t=qg(e),r=Je.fromJSON(t,n);return fk(r,t)}function gk(n){if(!n)return"<p></p>";try{const e=JSON.parse(n);let t=mk(e,Ch);return t=t.replace(/<p[^>]*><\/p>/g,"<p><br></p>"),t}catch{return n}}const Hh=n=>{const e=jo.c(4),{content:t}=n;let r;e[0]!==t?(r=gk(t),e[0]=t,e[1]=r):r=e[1];let o;return e[2]!==r?(o=N.jsx("div",{className:"content-div",dangerouslySetInnerHTML:{__html:r}}),e[2]=r,e[3]=o):o=e[3],o},Do=n=>{const e=ln.compilerRuntimeExports.c(18),{ref:t,tiptapRef:r,initialContent:o,isSubmitting:s,onSubmit:i,onCancel:a,submitLabel:l,cancelLabel:c,showLabel:d,labelText:u,containerClassName:h}=n,p=o===void 0?"":o,f=s===void 0?!1:s,m=l===void 0?"작성":l,g=c===void 0?"취소":c,y=d===void 0?!0:d,w=u===void 0?"댓글 작성":u,E=`flex flex-col gap-2 rounded-lg bg-gray-50 p-3 dark:bg-gray-800/50 ${h===void 0?"":h}`;let b;e[0]!==g||e[1]!==f||e[2]!==w||e[3]!==a||e[4]!==i||e[5]!==y||e[6]!==m?(b=y&&k.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-between",children:[k.jsxRuntimeExports.jsx("label",{className:"text-xs font-medium text-gray-700 dark:text-gray-300",children:w}),k.jsxRuntimeExports.jsxs("div",{className:"flex gap-2",children:[k.jsxRuntimeExports.jsxs(k.Button,{size:"sm",onClick:i,disabled:f,children:[f?k.jsxRuntimeExports.jsx(Pe.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}):k.jsxRuntimeExports.jsx(Pe.Send,{className:"mr-2 h-4 w-4"}),m]}),k.jsxRuntimeExports.jsx(k.Button,{size:"sm",variant:"outline",onClick:a,disabled:f,children:g})]})]}),e[0]=g,e[1]=f,e[2]=w,e[3]=a,e[4]=i,e[5]=y,e[6]=m,e[7]=b):b=e[7];let T,v;e[8]===Symbol.for("react.memo_cache_sentinel")?(T={menubarContainer:"dark:bg-background!",editorContent:"dark:bg-card! min-h-[4rem]! max-h-[8rem]! overflow-y-auto"},v=["table","bgColor","undo","redo","alignLeft","alignCenter","alignRight","alignJustify","paragraph"],e[8]=T,e[9]=v):(T=e[8],v=e[9]);let S;e[10]!==p||e[11]!==r?(S=k.jsxRuntimeExports.jsx("div",{className:"overflow-hidden rounded-lg border border-gray-200 bg-white dark:border-gray-700 dark:bg-gray-900",children:k.jsxRuntimeExports.jsx(pk,{ref:r,initialContent:p,className:"rounded",classNames:T,hideMenuButtons:v})}),e[10]=p,e[11]=r,e[12]=S):S=e[12];let R;return e[13]!==t||e[14]!==S||e[15]!==E||e[16]!==b?(R=k.jsxRuntimeExports.jsxs("div",{ref:t,className:E,children:[b,S]}),e[13]=t,e[14]=S,e[15]=E,e[16]=b,e[17]=R):R=e[17],R},yk=n=>{const e=ln.compilerRuntimeExports.c(10),{onEdit:t,onDelete:r}=n;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=k.jsxRuntimeExports.jsx(k.PopoverTrigger,{asChild:!0,children:k.jsxRuntimeExports.jsx(k.Button,{size:"sm",variant:"ghost",className:"h-auto px-2 py-1 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200",children:k.jsxRuntimeExports.jsx(Pe.MoreHorizontal,{className:"h-5 w-5"})})}),e[0]=o):o=e[0];let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s=k.jsxRuntimeExports.jsx(Pe.Edit2,{className:"mr-2 h-3 w-3"}),e[1]=s):s=e[1];let i;e[2]!==t?(i=k.jsxRuntimeExports.jsxs(k.Button,{size:"sm",variant:"ghost",onClick:t,className:"justify-start text-xs text-gray-700 dark:text-gray-300",children:[s,"수정"]}),e[2]=t,e[3]=i):i=e[3];let a;e[4]===Symbol.for("react.memo_cache_sentinel")?(a=k.jsxRuntimeExports.jsx(Pe.Trash2,{className:"mr-2 h-3 w-3"}),e[4]=a):a=e[4];let l;e[5]!==r?(l=k.jsxRuntimeExports.jsxs(k.Button,{size:"sm",variant:"ghost",onClick:r,className:"justify-start text-xs text-red-600 hover:text-red-700 dark:text-red-400 dark:hover:text-red-300",children:[a,"삭제"]}),e[5]=r,e[6]=l):l=e[6];let c;return e[7]!==i||e[8]!==l?(c=k.jsxRuntimeExports.jsxs(k.Popover,{children:[o,k.jsxRuntimeExports.jsx(k.PopoverContent,{className:"w-auto p-1",children:k.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-1",children:[i,l]})})]}),e[7]=i,e[8]=l,e[9]=c):c=e[9],c},Bh=n=>{const e=ln.compilerRuntimeExports.c(49),{comment:t,level:r,currentUserId:o,onReplyOpen:s,replyingToId:i,replyEditorRef:a,onSubmitReply:l,isSubmitting:c,onEdit:d,editingId:u,editEditorRef:h,onSubmitEdit:p,onDelete:f,isEditing:m}=n,g=i===t.id,y=u===t.id,w=t.children&&t.children.length>0,x=`reply-editor-${t.id}`,E=r>0&&"ml-4 border-l border-gray-200 pl-4 dark:border-gray-700";let b;e[0]!==E?(b=k.cn("flex flex-col gap-2",E),e[0]=E,e[1]=b):b=e[1];let T;e[2]!==t.body||e[3]!==t.createdAt||e[4]!==t.id||e[5]!==t.isAdmin||e[6]!==t.userId||e[7]!==t.userName||e[8]!==o||e[9]!==h||e[10]!==m||e[11]!==y||e[12]!==g||e[13]!==r||e[14]!==f||e[15]!==d||e[16]!==s||e[17]!==p||e[18]!==x?(T=y?k.jsxRuntimeExports.jsx(Do,{tiptapRef:h,initialContent:t.body,isSubmitting:m,onSubmit:()=>p(t.id),onCancel:()=>d(""),submitLabel:"수정",labelText:"댓글 수정"}):k.jsxRuntimeExports.jsx("div",{className:"py-2",children:k.jsxRuntimeExports.jsxs("div",{className:"flex items-start justify-between gap-3",children:[k.jsxRuntimeExports.jsxs("div",{className:"flex-1",children:[k.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2",children:[k.jsxRuntimeExports.jsx("span",{className:"text-xs font-medium text-gray-900 dark:text-gray-100",children:t.userName}),t.isAdmin&&k.jsxRuntimeExports.jsx("span",{className:"inline-flex items-center rounded-full bg-blue-100 px-2 py-0.5 text-xs font-semibold text-blue-800 dark:bg-blue-900/30 dark:text-blue-400",children:"👨💼 관리자"}),k.jsxRuntimeExports.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:Ec.format(new Date(t.createdAt),"yyyy-MM-dd HH:mm")})]}),k.jsxRuntimeExports.jsx("div",{className:"mt-2 text-sm text-gray-700 dark:text-gray-300",children:k.jsxRuntimeExports.jsx(Hh,{content:t.body})}),!g&&k.jsxRuntimeExports.jsx("div",{className:"mt-2 flex items-center gap-3",children:r<2&&k.jsxRuntimeExports.jsx(k.Button,{size:"sm",variant:"ghost",onClick:()=>{s(t.id),setTimeout(()=>{const _=document.getElementById(x);_&&(_.scrollIntoView({behavior:"auto",block:"center"}),_.querySelector("[contenteditable]")?.focus())},50)},className:"h-auto px-2 py-1 text-sm font-medium text-gray-600 hover:text-gray-900 dark:text-gray-400 dark:hover:text-gray-200",children:"💬 답글"})})]}),o===t.userId&&k.jsxRuntimeExports.jsx(yk,{onEdit:()=>d(t.id),onDelete:()=>f(t.id)})]})}),e[2]=t.body,e[3]=t.createdAt,e[4]=t.id,e[5]=t.isAdmin,e[6]=t.userId,e[7]=t.userName,e[8]=o,e[9]=h,e[10]=m,e[11]=y,e[12]=g,e[13]=r,e[14]=f,e[15]=d,e[16]=s,e[17]=p,e[18]=x,e[19]=T):T=e[19];let v;e[20]!==t.id||e[21]!==g||e[22]!==c||e[23]!==s||e[24]!==l||e[25]!==x||e[26]!==a?(v=g&&k.jsxRuntimeExports.jsx(Do,{ref:_=>{_&&(_.id=x)},tiptapRef:a,isSubmitting:c,onSubmit:()=>l(t.id),onCancel:()=>s(""),submitLabel:"작성",labelText:"답글 작성"}),e[20]=t.id,e[21]=g,e[22]=c,e[23]=s,e[24]=l,e[25]=x,e[26]=a,e[27]=v):v=e[27];let S;e[28]!==t.children||e[29]!==o||e[30]!==h||e[31]!==u||e[32]!==w||e[33]!==m||e[34]!==c||e[35]!==r||e[36]!==f||e[37]!==d||e[38]!==s||e[39]!==p||e[40]!==l||e[41]!==a||e[42]!==i?(S=w&&k.jsxRuntimeExports.jsx("div",{className:"flex flex-col gap-2",children:t.children.map(_=>k.jsxRuntimeExports.jsx(Bh,{comment:_,level:r+1,currentUserId:o,onReplyOpen:s,replyingToId:i,replyEditorRef:a,onSubmitReply:l,isSubmitting:c,onEdit:d,editingId:u,editEditorRef:h,onSubmitEdit:p,onDelete:f,isEditing:m},_.id))}),e[28]=t.children,e[29]=o,e[30]=h,e[31]=u,e[32]=w,e[33]=m,e[34]=c,e[35]=r,e[36]=f,e[37]=d,e[38]=s,e[39]=p,e[40]=l,e[41]=a,e[42]=i,e[43]=S):S=e[43];let R;return e[44]!==b||e[45]!==T||e[46]!==v||e[47]!==S?(R=k.jsxRuntimeExports.jsxs("div",{className:b,children:[T,v,S]}),e[44]=b,e[45]=T,e[46]=v,e[47]=S,e[48]=R):R=e[48],R},bk=n=>{const e=ln.compilerRuntimeExports.c(33),{comments:t,isLoading:r,isCommentEditOpen:o,onCommentEditOpen:s,commentEditorRef:i,onSubmitComment:a,isSubmitting:l,replyingToId:c,onReplyOpen:d,replyEditorRef:u,onSubmitReply:h,editingId:p,onEdit:f,editEditorRef:m,onSubmitEdit:g,onDelete:y,isEditing:w,currentUserId:x}=n;let E;e[0]!==t.length?(E=k.jsxRuntimeExports.jsxs("h3",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:["댓글 (",t.length,")"]}),e[0]=t.length,e[1]=E):E=e[1];let b;e[2]!==o||e[3]!==s?(b=!o&&k.jsxRuntimeExports.jsxs(k.Button,{size:"sm",variant:"outline",onClick:()=>s(!0),children:[k.jsxRuntimeExports.jsx(Pe.Send,{className:"mr-2 h-4 w-4"}),"댓글 작성"]}),e[2]=o,e[3]=s,e[4]=b):b=e[4];let T;e[5]!==E||e[6]!==b?(T=k.jsxRuntimeExports.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[E,b]}),e[5]=E,e[6]=b,e[7]=T):T=e[7];let v;e[8]!==i||e[9]!==o||e[10]!==l||e[11]!==s||e[12]!==a?(v=o&&k.jsxRuntimeExports.jsx(Do,{tiptapRef:i,isSubmitting:l,onSubmit:a,onCancel:()=>s(!1),submitLabel:"작성",labelText:"댓글 작성"}),e[8]=i,e[9]=o,e[10]=l,e[11]=s,e[12]=a,e[13]=v):v=e[13];let S;e[14]!==t||e[15]!==x||e[16]!==m||e[17]!==p||e[18]!==w||e[19]!==r||e[20]!==l||e[21]!==y||e[22]!==f||e[23]!==d||e[24]!==g||e[25]!==h||e[26]!==u||e[27]!==c?(S=k.jsxRuntimeExports.jsx("div",{className:"mt-4",children:r?k.jsxRuntimeExports.jsx("div",{className:"flex justify-center py-4",children:k.jsxRuntimeExports.jsx(Pe.Loader2,{className:"h-4 w-4 animate-spin text-gray-400"})}):t.length===0?k.jsxRuntimeExports.jsx("div",{className:"text-center text-xs text-gray-500 dark:text-gray-400",children:"아직 댓글이 없습니다."}):k.jsxRuntimeExports.jsx("div",{className:"flex flex-col gap-0",children:t.map((_,$)=>k.jsxRuntimeExports.jsxs("div",{children:[k.jsxRuntimeExports.jsx(Bh,{comment:_,level:0,currentUserId:x,onReplyOpen:d,replyingToId:c,replyEditorRef:u,onSubmitReply:h,isSubmitting:l,onEdit:f,editingId:p,editEditorRef:m,onSubmitEdit:g,onDelete:y,isEditing:w}),$<t.length-1&&k.jsxRuntimeExports.jsx(k.Separator,{className:"my-3 bg-gray-200 dark:bg-gray-700"})]},_.id))})}),e[14]=t,e[15]=x,e[16]=m,e[17]=p,e[18]=w,e[19]=r,e[20]=l,e[21]=y,e[22]=f,e[23]=d,e[24]=g,e[25]=h,e[26]=u,e[27]=c,e[28]=S):S=e[28];let R;return e[29]!==T||e[30]!==v||e[31]!==S?(R=k.jsxRuntimeExports.jsxs("div",{children:[T,v,S]}),e[29]=T,e[30]=v,e[31]=S,e[32]=R):R=e[32],R},xk=n=>{const e=ln.compilerRuntimeExports.c(35),{feedback:t,currentUserId:r,onEditClick:o,onDeleteClick:s}=n;let i;e[0]!==t.feedbackDetail.title?(i=k.jsxRuntimeExports.jsx("h2",{className:"text-lg font-medium text-gray-900 dark:text-gray-100",children:t.feedbackDetail.title}),e[0]=t.feedbackDetail.title,e[1]=i):i=e[1];let a;e[2]!==t.userName?(a=k.jsxRuntimeExports.jsx("span",{className:"text-xs font-medium text-gray-700 dark:text-gray-300",children:t.userName}),e[2]=t.userName,e[3]=a):a=e[3];let l;e[4]!==t.institutionName?(l=t.institutionName&&k.jsxRuntimeExports.jsxs("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:["· ",t.institutionName]}),e[4]=t.institutionName,e[5]=l):l=e[5];let c;e[6]!==a||e[7]!==l?(c=k.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2",children:[a,l]}),e[6]=a,e[7]=l,e[8]=c):c=e[8];let d;e[9]!==t.createdAt?(d=Ec.format(new Date(t.createdAt),"yyyy-MM-dd HH:mm"),e[9]=t.createdAt,e[10]=d):d=e[10];let u;e[11]!==d?(u=k.jsxRuntimeExports.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:d}),e[11]=d,e[12]=u):u=e[12];const h=t.status==="pending"?"bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-400":"bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400";let p;e[13]!==h?(p=k.cn("inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium",h),e[13]=h,e[14]=p):p=e[14];const f=t.status==="pending"?"미해결":"해결됨";let m;e[15]!==p||e[16]!==f?(m=k.jsxRuntimeExports.jsx("span",{className:p,children:f}),e[15]=p,e[16]=f,e[17]=m):m=e[17];let g;e[18]!==m||e[19]!==u?(g=k.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2",children:[u,m]}),e[18]=m,e[19]=u,e[20]=g):g=e[20];let y;e[21]!==g||e[22]!==c?(y=k.jsxRuntimeExports.jsxs("div",{className:"mt-3 flex flex-col gap-2",children:[c,g]}),e[21]=g,e[22]=c,e[23]=y):y=e[23];let w;e[24]!==i||e[25]!==y?(w=k.jsxRuntimeExports.jsxs("div",{className:"flex-1",children:[i,y]}),e[24]=i,e[25]=y,e[26]=w):w=e[26];let x;e[27]!==r||e[28]!==t.userId||e[29]!==s||e[30]!==o?(x=r===t.userId&&k.jsxRuntimeExports.jsxs(k.Popover,{children:[k.jsxRuntimeExports.jsx(k.PopoverTrigger,{asChild:!0,children:k.jsxRuntimeExports.jsx(k.Button,{size:"sm",variant:"ghost",className:"h-auto px-2 py-1 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200",children:k.jsxRuntimeExports.jsx(Pe.MoreHorizontal,{className:"h-5 w-5"})})}),k.jsxRuntimeExports.jsx(k.PopoverContent,{className:"w-auto p-1",children:k.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-1",children:[k.jsxRuntimeExports.jsxs(k.Button,{size:"sm",variant:"ghost",onClick:o,className:"justify-start text-xs text-gray-700 dark:text-gray-300",children:[k.jsxRuntimeExports.jsx(Pe.Edit2,{className:"mr-2 h-3 w-3"}),"수정"]}),k.jsxRuntimeExports.jsxs(k.Button,{size:"sm",variant:"ghost",onClick:s,className:"justify-start text-xs text-red-600 hover:text-red-700 dark:text-red-400 dark:hover:text-red-300",children:[k.jsxRuntimeExports.jsx(Pe.Trash2,{className:"mr-2 h-3 w-3"}),"삭제"]})]})})]}),e[27]=r,e[28]=t.userId,e[29]=s,e[30]=o,e[31]=x):x=e[31];let E;return e[32]!==w||e[33]!==x?(E=k.jsxRuntimeExports.jsxs("div",{className:"mb-6 flex items-start justify-between",children:[w,x]}),e[32]=w,e[33]=x,e[34]=E):E=e[34],E},wk=n=>{const e=ln.compilerRuntimeExports.c(12),{feedback:t,isEditing:r,isUpdating:o,currentUserRole:s,feedbackEditorRef:i,titleInputRef:a,onEditCancel:l,onEditSave:c,onStatusChange:d}=n;let u;return e[0]!==s||e[1]!==t.feedbackDetail.body||e[2]!==t.feedbackDetail.title||e[3]!==t.status||e[4]!==i||e[5]!==r||e[6]!==o||e[7]!==l||e[8]!==c||e[9]!==d||e[10]!==a?(u=k.jsxRuntimeExports.jsx("div",{className:"mb-6",children:r?k.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-4",children:[k.jsxRuntimeExports.jsxs("div",{className:"rounded-lg bg-gray-50 p-3 dark:bg-gray-800/50",children:[k.jsxRuntimeExports.jsx("label",{className:"mb-2 block text-xs font-medium text-gray-700 dark:text-gray-300",children:"제목"}),k.jsxRuntimeExports.jsx("input",{ref:a,type:"text",defaultValue:t.feedbackDetail.title,className:"w-full rounded-lg border border-gray-200 bg-white px-3 py-2 text-sm text-gray-900 placeholder-gray-400 focus:border-blue-500 focus:outline-none focus:ring-1 focus:ring-blue-500 dark:border-gray-700 dark:bg-gray-900 dark:text-gray-100 dark:placeholder-gray-500",placeholder:"피드백 제목을 입력하세요"})]}),k.jsxRuntimeExports.jsx(Do,{tiptapRef:i,initialContent:t.feedbackDetail.body,isSubmitting:o,onSubmit:c,onCancel:l,submitLabel:"수정",labelText:"피드백 수정",showLabel:!0})]}):k.jsxRuntimeExports.jsxs(k.jsxRuntimeExports.Fragment,{children:[k.jsxRuntimeExports.jsx("div",{className:"prose prose-sm dark:prose-invert mb-6 max-w-none text-gray-900 dark:text-gray-100",children:k.jsxRuntimeExports.jsx(Hh,{content:t.feedbackDetail.body})}),k.jsxRuntimeExports.jsx("div",{className:"w-full",children:k.jsxRuntimeExports.jsxs("div",{className:k.cn("flex items-center justify-between rounded-lg px-4 py-4 font-medium",t.status==="pending"?"bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-400":"bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400"),children:[k.jsxRuntimeExports.jsxs("div",{children:[k.jsxRuntimeExports.jsxs("div",{className:"mb-1 text-sm font-semibold",children:[t.status==="pending"?"아직 미해결이에요":"해결되었어요"," ",t.status==="pending"?"⏳":"✓"]}),k.jsxRuntimeExports.jsx("div",{className:"text-xs opacity-90",children:t.status==="pending"?"담당자가 검토하고 있습니다. 조금 더 기다려주세요.":"소중한 피드백 감사합니다!"})]}),s==="admin"&&k.jsxRuntimeExports.jsxs(k.Button,{size:"sm",onClick:d,disabled:o,className:k.cn("shrink-0 gap-1",t.status==="pending"?"bg-yellow-700 hover:bg-yellow-800 dark:bg-yellow-600 dark:hover:bg-yellow-700":"bg-green-700 hover:bg-green-800 dark:bg-green-600 dark:hover:bg-green-700"),children:[o?k.jsxRuntimeExports.jsx(Pe.Loader2,{className:"h-4 w-4 animate-spin"}):k.jsxRuntimeExports.jsx(Pe.RefreshCw,{className:"h-4 w-4"}),t.status==="pending"?"해결":"미해결"]})]})})]})}),e[0]=s,e[1]=t.feedbackDetail.body,e[2]=t.feedbackDetail.title,e[3]=t.status,e[4]=i,e[5]=r,e[6]=o,e[7]=l,e[8]=c,e[9]=d,e[10]=a,e[11]=u):u=e[11],u},kk=()=>{const n=ln.compilerRuntimeExports.c(1),e=z.useRef(null),t=z.useRef(null),r=z.useRef(null),o=z.useRef(null),s=vk,i=Sk,a=Ck;let l;return n[0]===Symbol.for("react.memo_cache_sentinel")?(l={commentEditorRef:e,replyEditorRef:t,editEditorRef:r,feedbackEditorRef:o,clearEditor:s,getEditorContent:i,validateContent:a},n[0]=l):l=n[0],l};function vk(n){n.current?.editor?.commands?.clearContent?.()}function Sk(n){return n.current?.getJSON?.()??""}function Ck(n){return n?typeof n=="string"?n.trim().length>0:!0:!1}const Mk=({feedback:n,isFeedbackLoading:e,feedbackError:t,comments:r,isCommentsLoading:o,currentUser:s,onClose:i,callbacks:a,isDialog:l=!1})=>{const{commentEditorRef:c,replyEditorRef:d,editEditorRef:u,feedbackEditorRef:h,clearEditor:p,getEditorContent:f,validateContent:m}=kk(),[g,y]=z.useState(!1),[w,x]=z.useState(null),[E,b]=z.useState(null),[T,v]=z.useState(!1),S=z.useRef(null),[R,_]=z.useTransition(),[$,Y]=z.useTransition(),[pe,Z]=z.useTransition(),[q,X]=z.useTransition(),ee=r||[],L=async()=>{const J=f(c);if(!m(J))return a.onValidateError("empty");n?.id&&_(async()=>{try{await a.onCommentCreate(n.id,{body:J}),p(c),y(!1),a.onCommentChanged()}catch(oe){a.onError(oe)}})},Se=async J=>{const oe=f(d);if(!m(oe))return a.onValidateError("empty");n?.id&&_(async()=>{try{await a.onCommentCreate(n.id,{body:oe,refId:J}),p(d),x(null),a.onCommentChanged()}catch(F){a.onError(F)}})},Ce=async J=>{const oe=f(u);if(!m(oe))return a.onValidateError("empty");Y(async()=>{try{await a.onCommentUpdate(J,{body:oe}),b(null),p(u),a.onCommentChanged()}catch(F){a.onError(F)}})},C=async J=>{confirm("댓글을 삭제하시겠습니까?")&&Z(async()=>{try{await a.onCommentDelete(J),a.onCommentChanged()}catch(oe){a.onError(oe)}})},B=async()=>{const J=S.current?.value||"",oe=f(h);if(!m(J)){a.onValidateError("empty");return}if(!m(oe)){a.onValidateError("empty");return}n&&X(async()=>{try{await a.onFeedbackUpdate(n.id,{feedbackDetail:{title:J,body:oe}}),v(!1),p(h),a.onFeedbackChanged()}catch(F){a.onError(F)}})},V=async()=>{n&&X(async()=>{try{const J=n.status==="pending"?"resolved":"pending";await a.onFeedbackStatusUpdate?.(n.id,{status:J}),a.onFeedbackChanged()}catch(J){a.onError(J)}})},U=async()=>{if(confirm("피드백을 삭제하시겠습니까?")&&n?.id)try{await a.onDeleteFeedback(n.id),a.onFeedbackChanged(),i?i():window.close()}catch(J){a.onError(J)}};if(e){const J=k.jsxRuntimeExports.jsx("div",{className:"flex items-center justify-center py-8",children:k.jsxRuntimeExports.jsx(Pe.Loader2,{className:"h-6 w-6 animate-spin text-gray-400"})});return l?J:k.jsxRuntimeExports.jsx("div",{className:"bg-background flex min-h-screen items-center justify-center",children:J})}if(t||!n){const J=k.jsxRuntimeExports.jsxs("div",{className:"flex flex-col items-center justify-center p-4",children:[k.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2 rounded-md bg-red-50 p-4 text-sm text-red-700 dark:bg-red-900/20 dark:text-red-400",children:[k.jsxRuntimeExports.jsx(Pe.AlertCircle,{className:"h-4 w-4 shrink-0"}),k.jsxRuntimeExports.jsx("span",{children:"피드백을 불러오는데 실패했습니다."})]}),!l&&k.jsxRuntimeExports.jsx(k.Button,{onClick:()=>window.close(),variant:"ghost",size:"sm",className:"mt-4 text-gray-600 hover:text-gray-900 dark:text-gray-400 dark:hover:text-gray-100",children:"닫기"})]});return l?k.jsxRuntimeExports.jsx("div",{className:"flex items-center justify-center py-8",children:J}):k.jsxRuntimeExports.jsx("div",{className:"bg-background flex min-h-screen flex-col items-center justify-center",children:J})}return k.jsxRuntimeExports.jsxs("div",{className:k.cn("bg-background flex flex-col",l?"h-auto":"min-h-screen"),children:[k.jsxRuntimeExports.jsx("div",{className:"shrink-0 border-b border-gray-200 py-4 dark:border-gray-700",children:k.jsxRuntimeExports.jsx("div",{className:"mx-auto max-w-4xl px-6",children:k.jsxRuntimeExports.jsx("div",{className:"flex items-center justify-between",children:k.jsxRuntimeExports.jsx("h1",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100",children:"피드백 상세"})})})}),k.jsxRuntimeExports.jsx("div",{className:"bg-background flex-1 overflow-y-auto",children:k.jsxRuntimeExports.jsxs("div",{className:"mx-auto max-w-4xl px-6 py-6",children:[k.jsxRuntimeExports.jsx(xk,{feedback:n,currentUserId:s?.id,onEditClick:()=>v(!0),onDeleteClick:U}),k.jsxRuntimeExports.jsx(wk,{feedback:n,isEditing:T,isUpdating:q,currentUserRole:s?.role,feedbackEditorRef:h,titleInputRef:S,onEditCancel:()=>v(!1),onEditSave:B,onStatusChange:V}),k.jsxRuntimeExports.jsx(k.Separator,{className:"mb-6 bg-gray-200 dark:bg-gray-700"}),k.jsxRuntimeExports.jsx(bk,{comments:ee,isLoading:o,isCommentEditOpen:g,onCommentEditOpen:y,commentEditorRef:c,onSubmitComment:L,isSubmitting:R,replyingToId:w,onReplyOpen:x,replyEditorRef:d,onSubmitReply:Se,editingId:E,onEdit:b,editEditorRef:u,onSubmitEdit:Ce,onDelete:C,isEditing:$||pe,currentUserId:s?.id})]})})]})};exports.FeedbackDetailPageContent=Mk;
|
|
154
154
|
//# sourceMappingURL=index.js.map
|