@cyberskill/cyber-editor 4.0.2 → 4.0.3

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.
@@ -697,11 +697,11 @@ html body {
697
697
 
698
698
  `);return!i||!a?!1:e.chain().command(({tr:s})=>(s.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;const{state:t}=e,{selection:n,doc:r}=t,{$from:o,empty:i}=n;if(!i||o.parent.type!==this.type||!(o.parentOffset===o.parent.nodeSize-2))return!1;const s=o.after();return s===void 0?!1:r.nodeAt(s)?e.commands.command(({tr:c})=>(c.setSelection(xt.near(r.resolve(s))),!0)):e.commands.exitCode()}}},addInputRules(){return[Bh({find:J7,type:this.type,getAttributes:e=>({language:e[1]})}),Bh({find:Q7,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new xn({key:new _n("codeBlockVSCodeHandler"),props:{handlePaste:(e,t)=>{if(!t.clipboardData||this.editor.isActive(this.type.name))return!1;const n=t.clipboardData.getData("text/plain"),r=t.clipboardData.getData("vscode-editor-data"),o=r?JSON.parse(r):void 0,i=o==null?void 0:o.mode;if(!n||!i)return!1;const{tr:a,schema:s}=e.state,l=s.text(n.replace(/\r\n?/g,`
699
699
  `));return a.replaceSelectionWith(this.type.create({language:i},l)),a.selection.$from.parent.type!==this.type&&a.setSelection(Ct.near(a.doc.resolve(Math.max(0,a.selection.from-2)))),a.setMeta("paste",!0),e.dispatch(a),!0}}})]}}),e9=En.create({name:"doc",topNode:!0,content:"block+"}),t9=dn.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[M$(this.options)]}}),n9=dn.create({name:"gapCursor",addProseMirrorPlugins(){return[R$()]},extendNodeSchema(e){var t;const n={name:e.name,options:e.options,storage:e.storage};return{allowGapCursor:(t=Dt(pt(e,"allowGapCursor",n)))!==null&&t!==void 0?t:null}}}),r9=En.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:e}){return["br",nn(this.options.HTMLAttributes,e)]},renderText(){return`
700
- `},addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command(()=>{const{selection:o,storedMarks:i}=n;if(o.$from.parent.type.spec.isolating)return!1;const{keepMarks:a}=this.options,{splittableMarks:s}=r.extensionManager,l=i||o.$to.parentOffset&&o.$from.marks();return t().insertContent({type:this.name}).command(({tr:c,dispatch:u})=>{if(u&&l&&a){const d=l.filter(f=>s.includes(f.type.name));c.ensureMarks(d)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),o9=En.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(e=>({tag:`h${e}`,attrs:{level:e}}))},renderHTML({node:e,HTMLAttributes:t}){return[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,nn(this.options.HTMLAttributes,t),0]},addCommands(){return{setHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.setNode(this.name,e):!1,toggleHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.toggleNode(this.name,"paragraph",e):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((e,t)=>({...e,[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})}),{})},addInputRules(){return this.options.levels.map(e=>Bh({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}}),i9=dn.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:e,dispatch:t})=>ev(e,t),redo:()=>({state:e,dispatch:t})=>tv(e,t)}},addProseMirrorPlugins(){return[T$(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()}}}),a9=En.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:e}){return["hr",nn(this.options.HTMLAttributes,e)]},addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{const{selection:n}=t,{$from:r,$to:o}=n,i=e();return r.parentOffset===0?i.insertContentAt({from:Math.max(r.pos-1,0),to:o.pos},{type:this.name}):Bx(n)?i.insertContentAt(o.pos,{type:this.name}):i.insertContent({type:this.name}),i.command(({tr:a,dispatch:s})=>{var l;if(s){const{$to:c}=a.selection,u=c.end();if(c.nodeAfter)c.nodeAfter.isTextblock?a.setSelection(Ct.create(a.doc,c.pos+1)):c.nodeAfter.isBlock?a.setSelection(yt.create(a.doc,c.pos)):a.setSelection(Ct.create(a.doc,c.pos));else{const d=(l=c.parent.type.contentMatch.defaultType)===null||l===void 0?void 0:l.create();d&&(a.insert(u,d),a.setSelection(Ct.create(a.doc,u+1)))}a.scrollIntoView()}return!0}).run()}}},addInputRules(){return[ZT({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),s9=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,l9=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,c9=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,u9=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,d9=ro.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:e=>e.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:e=>e.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:e}){return["em",nn(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Ji({find:s9,type:this.type}),Ji({find:c9,type:this.type})]},addPasteRules(){return[mi({find:l9,type:this.type}),mi({find:u9,type:this.type})]}}),f9="listItem",WC="textStyle",UC=/^(\d+)\.\s$/,h9=En.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:e=>e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1},type:{default:void 0,parseHTML:e=>e.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:e}){const{start:t,...n}=e;return t===1?["ol",nn(this.options.HTMLAttributes,n),0]:["ol",nn(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(f9,this.editor.getAttributes(WC)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let e=Ba({find:UC,type:this.type,getAttributes:t=>({start:+t[1]}),joinPredicate:(t,n)=>n.childCount+n.attrs.start===+t[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(e=Ba({find:UC,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:t=>({start:+t[1],...this.editor.getAttributes(WC)}),joinPredicate:(t,n)=>n.childCount+n.attrs.start===+t[1],editor:this.editor})),[e]}}),p9=En.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:e}){return["p",nn(this.options.HTMLAttributes,e),0]},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),m9=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,g9=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,v9=ro.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:e=>e.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:e}){return["s",nn(this.options.HTMLAttributes,e),0]},addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[Ji({find:m9,type:this.type})]},addPasteRules(){return[mi({find:g9,type:this.type})]}}),b9=En.create({name:"text",group:"inline"}),y9=dn.create({name:"starterKit",addExtensions(){var e,t,n,r,o,i,a,s,l,c,u,d,f,h,m,v,g,y;const b=[];return this.options.bold!==!1&&b.push(U7.configure((e=this.options)===null||e===void 0?void 0:e.bold)),this.options.blockquote!==!1&&b.push(z7.configure((t=this.options)===null||t===void 0?void 0:t.blockquote)),this.options.bulletList!==!1&&b.push(K7.configure((n=this.options)===null||n===void 0?void 0:n.bulletList)),this.options.code!==!1&&b.push(Y7.configure((r=this.options)===null||r===void 0?void 0:r.code)),this.options.codeBlock!==!1&&b.push(Z7.configure((o=this.options)===null||o===void 0?void 0:o.codeBlock)),this.options.document!==!1&&b.push(e9.configure((i=this.options)===null||i===void 0?void 0:i.document)),this.options.dropcursor!==!1&&b.push(t9.configure((a=this.options)===null||a===void 0?void 0:a.dropcursor)),this.options.gapcursor!==!1&&b.push(n9.configure((s=this.options)===null||s===void 0?void 0:s.gapcursor)),this.options.hardBreak!==!1&&b.push(r9.configure((l=this.options)===null||l===void 0?void 0:l.hardBreak)),this.options.heading!==!1&&b.push(o9.configure((c=this.options)===null||c===void 0?void 0:c.heading)),this.options.history!==!1&&b.push(i9.configure((u=this.options)===null||u===void 0?void 0:u.history)),this.options.horizontalRule!==!1&&b.push(a9.configure((d=this.options)===null||d===void 0?void 0:d.horizontalRule)),this.options.italic!==!1&&b.push(d9.configure((f=this.options)===null||f===void 0?void 0:f.italic)),this.options.listItem!==!1&&b.push(P$.configure((h=this.options)===null||h===void 0?void 0:h.listItem)),this.options.orderedList!==!1&&b.push(h9.configure((m=this.options)===null||m===void 0?void 0:m.orderedList)),this.options.paragraph!==!1&&b.push(p9.configure((v=this.options)===null||v===void 0?void 0:v.paragraph)),this.options.strike!==!1&&b.push(v9.configure((g=this.options)===null||g===void 0?void 0:g.strike)),this.options.text!==!1&&b.push(b9.configure((y=this.options)===null||y===void 0?void 0:y.text)),b}});function C9({title:e,childrenContent:t,editable:n,childrenEdit:r}){const[o,i]=O.useState(!1),a=n?j.jsx(bi,{children:j.jsx(bi.Item,{onClick:()=>i(!0),children:"Edit"},"edit")}):null;return j.jsxs("div",{children:[n&&a?j.jsx(Oi,{dropdownRender:()=>a,trigger:["contextMenu"],children:t}):t,j.jsx(Wr,{title:`Edit ${e}`,open:o,onOk:()=>i(!1),onCancel:()=>i(!1),children:r})]})}function S9({node:e,updateAttributes:t,editor:n}){const[r,o]=O.useState(!1),[i,a]=O.useState(e.attrs.bgColor||"#f3f4f6"),[s,l]=O.useState(e.attrs.titleColor||"#000000"),c=e.attrs.variant||"default",u=e.attrs.radius||"md",d=e.attrs.iconType||"chevron",f=C=>{C.preventDefault()},h=C=>{const x=typeof C=="string"?C:C.toHexString();a(x),t({bgColor:x})},m=C=>{const x=typeof C=="string"?C:C.toHexString();l(x),t({titleColor:x})},v=C=>{switch(C){case"sm":return"rounded-sm";case"lg":return"rounded-lg";case"xl":return"rounded-xl";case"none":return"rounded-none";default:return"rounded-md"}},g=()=>{const C={className:`transition-transform duration-300 ${r?"rotate-180":""}`,size:20,style:{color:s}};switch(d){case"plus":return j.jsx(Na,{...C,className:`transition-transform duration-300 ${r?"rotate-45":""}`});case"arrow":return j.jsx(i6,{...C,className:`transition-transform duration-300 ${r?"rotate-90":""}`});case"none":return null;default:return j.jsx(c6,{...C})}},y=()=>{const C=`transition-all duration-300 ${v(u)}`;switch(c){case"filled":return`${C} border-none shadow-sm overflow-hidden`;case"ghost":return`${C} border-none bg-transparent hover:bg-gray-50/50`;case"separate":return`${C} border shadow-sm my-2 overflow-hidden`;default:return`${C} border shadow-sm my-4 overflow-hidden`}},b=()=>{const C="flex items-center justify-between p-4 cursor-pointer select-none transition-colors";return c==="filled"?{className:`${C}`,style:{backgroundColor:i}}:c==="ghost"?{className:`${C} hover:bg-black/5`,style:{backgroundColor:"transparent"}}:{className:`${C} bg-gray-50 hover:bg-gray-100`,style:{backgroundColor:i}}};return j.jsx(Um,{className:"accordion-wrapper",children:j.jsx(C9,{title:"Accordion",childrenContent:j.jsxs("div",{className:y(),onContextMenu:f,style:c==="filled"?{backgroundColor:`${i}20`}:void 0,children:[j.jsxs("div",{...b(),onClick:()=>o(!r),children:[j.jsx("input",{className:"w-full text-lg font-medium bg-transparent border-none outline-none",style:{color:s},defaultValue:e.attrs.title||"Accordion Title",onChange:C=>t({title:C.target.value}),disabled:!n.isEditable,placeholder:"Accordion title"}),g()]}),j.jsx("div",{className:`overflow-hidden duration-300 ease-in-out ${r?"max-h-96 opacity-100":"max-h-0 opacity-0"} `,children:j.jsx("div",{className:"p-4 border-t",children:j.jsx(SA,{contentEditable:n.isEditable})})})]}),editable:n.isEditable,childrenEdit:j.jsxs("div",{className:"px-6 py-4 space-y-6 rounded-lg bg-gray-50",children:[j.jsxs("div",{className:"grid grid-cols-1 gap-6",children:[j.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[j.jsxs("div",{children:[j.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Variant"}),j.jsx(jo,{value:c,style:{width:"100%"},onChange:C=>t({variant:C}),options:[{value:"default",label:"Default (Bordered)"},{value:"filled",label:"Filled"},{value:"ghost",label:"Ghost"},{value:"separate",label:"Separated"}]})]}),j.jsxs("div",{children:[j.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Corner Radius"}),j.jsx(jo,{value:u,style:{width:"100%"},onChange:C=>t({radius:C}),options:[{value:"none",label:"Square"},{value:"sm",label:"Small"},{value:"md",label:"Medium"},{value:"lg",label:"Large"},{value:"xl",label:"Extra Large"}]})]})]}),j.jsxs("div",{children:[j.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Icon Style"}),j.jsxs(ti.Group,{value:d,onChange:C=>t({iconType:C.target.value}),className:"flex gap-4",children:[j.jsx(ti,{value:"chevron",children:"Chevron"}),j.jsx(ti,{value:"plus",children:"Plus"}),j.jsx(ti,{value:"arrow",children:"Arrow"}),j.jsx(ti,{value:"none",children:"None"})]})]}),j.jsxs("div",{className:"flex flex-col space-y-2",children:[j.jsx("label",{className:"font-medium text-gray-700",children:"Background Color"}),j.jsxs("div",{className:"flex items-center space-x-3",children:[j.jsx("div",{className:"w-8 h-8 border rounded shadow",style:{backgroundColor:i}}),j.jsx(Ya,{value:i,onChange:h})]})]}),j.jsxs("div",{className:"flex flex-col space-y-2",children:[j.jsx("label",{className:"font-medium text-gray-700",children:"Title Color"}),j.jsxs("div",{className:"flex items-center space-x-3",children:[j.jsx("div",{className:"w-8 h-8 border rounded shadow",style:{backgroundColor:s}}),j.jsx(Ya,{value:s,onChange:m})]})]})]}),j.jsx("div",{className:"pt-4 border-t border-gray-200",children:j.jsxs("div",{className:"p-3 bg-white border rounded-md",children:[j.jsx("div",{className:"text-sm text-gray-600",children:"Preview"}),j.jsx("div",{className:"p-2 mt-2 rounded",style:{backgroundColor:i},children:j.jsx("span",{style:{color:s,fontWeight:500},children:"Accordion Title"})})]})})]})})})}const x9=En.create({name:"accordion",group:"block",content:"block+",atom:!1,draggable:!0,selectable:!0,inline:!1,defining:!0,addAttributes(){return{title:{default:"Accordion Title"},bgColor:{default:"#f3f4f6"},titleColor:{default:"#000000"},iconType:{default:"chevron"},variant:{default:"default"},radius:{default:"md"}}},parseHTML(){return[{tag:"accordion"}]},renderHTML({HTMLAttributes:e}){return["accordion",nn(e)]},addNodeView(){return qm(S9)},addCommands(){return{setAccordion:e=>({chain:t})=>t().insertContent({type:"accordion",attrs:e,content:[{type:"paragraph",content:[{type:"text",text:"Accordion content"}]}]}).run()}}});function w9({node:e,updateAttributes:t,editor:n,selected:r,deleteNode:o}){const[i,a]=O.useState(!1),[s,l]=O.useState(!1),[c,u]=O.useState({width:e.attrs.width||"100%",height:e.attrs.height||"auto"}),[d,f]=O.useState(e.attrs.caption||""),[h,m]=O.useState(e.attrs.link||""),[v,g]=O.useState(!1),[y,b]=O.useState(!1),[C,x]=O.useState(e.attrs.src||""),S=O.useRef(null),w=O.useRef(null),E=O.useRef(null);O.useEffect(()=>{u({width:e.attrs.width||"100%",height:e.attrs.height||"auto"}),f(e.attrs.caption||""),m(e.attrs.link||""),x(e.attrs.src||"")},[e.attrs]);const N=O.useCallback((I,_)=>{if(I.preventDefault(),I.stopPropagation(),!S.current)return;const W=S.current.getBoundingClientRect();E.current={x:I.clientX,y:I.clientY,width:W.width,height:W.height},a(!0);const H=K=>{if(!E.current||!S.current)return;const Y=K.clientX-E.current.x,V=K.clientY-E.current.y;let G=E.current.width,Q=E.current.height;if(_.includes("e")&&(G=E.current.width+Y),_.includes("w")&&(G=E.current.width-Y),_.includes("s")&&(Q=E.current.height+V),_.includes("n")&&(Q=E.current.height-V),_.length===2&&S.current.naturalWidth&&S.current.naturalHeight){const ce=S.current.naturalWidth/S.current.naturalHeight;Q=G/ce}G=Math.max(50,G),Q=Math.max(50,Q),u({width:`${G}px`,height:`${Q}px`})},B=()=>{a(!1),E.current=null,t({width:c.width,height:c.height}),document.removeEventListener("mousemove",H),document.removeEventListener("mouseup",B)};document.addEventListener("mousemove",H),document.addEventListener("mouseup",B)},[c,t]),$=I=>{t({align:I,float:"none"})},M=I=>{t({float:I,align:I==="none"?"center":"left"})},R=()=>{d!==e.attrs.caption&&t({caption:d})},k=()=>{t({link:h}),g(!1)},D=()=>{t({src:C}),b(!1)},A=()=>{window.confirm("Are you sure you want to delete this image?")&&o()},L=()=>{const I={width:c.width,maxWidth:"100%",display:"block",zIndex:e.attrs.zIndex,position:"relative"};return e.attrs.float==="left"?{...I,float:"left",marginRight:"1rem",marginBottom:"0.5rem",display:"inline-block"}:e.attrs.float==="right"?{...I,float:"right",marginLeft:"1rem",marginBottom:"0.5rem",display:"inline-block"}:e.attrs.align==="center"?{...I,marginLeft:"auto",marginRight:"auto",display:"block"}:e.attrs.align==="right"?{...I,marginLeft:"auto",display:"block"}:I},T=n.isEditable;return O.useEffect(()=>{console.log("EnhancedImageView mounting:",{isEditable:n.isEditable,attrs:e.attrs})},[n.isEditable,e.attrs]),j.jsxs(Um,{className:"image-wrapper","data-drag-handle":!0,"data-float":e.attrs.float||"none",style:L(),children:[T&&j.jsx(_d,{content:j.jsxs("div",{className:"flex items-center gap-1 p-1.5 bg-gray-900 text-white rounded-lg shadow-xl",children:[j.jsx(Sn,{title:"Align Left",children:j.jsx("button",{type:"button",onClick:()=>$("left"),className:`p-1.5 rounded hover:bg-gray-700 transition-colors ${e.attrs.align==="left"&&e.attrs.float==="none"?"bg-gray-700":""}`,children:j.jsx(m$,{size:16})})}),j.jsx(Sn,{title:"Align Center",children:j.jsx("button",{type:"button",onClick:()=>$("center"),className:`p-1.5 rounded hover:bg-gray-700 transition-colors ${e.attrs.align==="center"&&e.attrs.float==="none"?"bg-gray-700":""}`,children:j.jsx(p$,{size:16})})}),j.jsx(Sn,{title:"Align Right",children:j.jsx("button",{type:"button",onClick:()=>$("right"),className:`p-1.5 rounded hover:bg-gray-700 transition-colors ${e.attrs.align==="right"&&e.attrs.float==="none"?"bg-gray-700":""}`,children:j.jsx(g$,{size:16})})}),j.jsx("div",{className:"h-4 w-px bg-gray-600 mx-1"}),j.jsx(Sn,{title:"Float Left",children:j.jsx("button",{type:"button",onClick:()=>M("left"),className:`p-1.5 rounded hover:bg-gray-700 transition-colors ${e.attrs.float==="left"?"bg-gray-700":""}`,children:j.jsx("span",{className:"text-xs font-semibold",children:"FL"})})}),j.jsx(Sn,{title:"Float Right",children:j.jsx("button",{type:"button",onClick:()=>M("right"),className:`p-1.5 rounded hover:bg-gray-700 transition-colors ${e.attrs.float==="right"?"bg-gray-700":""}`,children:j.jsx("span",{className:"text-xs font-semibold",children:"FR"})})}),j.jsx("div",{className:"h-4 w-px bg-gray-600 mx-1"}),j.jsx(Sn,{title:"Add/Edit Link",children:j.jsx("button",{type:"button",onClick:()=>g(!v),className:`p-1.5 rounded hover:bg-gray-700 transition-colors ${h?"bg-gray-700":""}`,children:j.jsx(b$,{size:16})})}),j.jsx(Sn,{title:"Edit Image URL",children:j.jsx("button",{type:"button",onClick:()=>b(!y),className:"p-1.5 rounded hover:bg-gray-700 transition-colors",children:j.jsx("span",{className:"text-xs font-semibold",children:"URL"})})}),j.jsx("div",{className:"h-4 w-px bg-gray-600 mx-1"}),j.jsx(Sn,{title:"Delete Image",children:j.jsx("button",{type:"button",onClick:A,className:"p-1.5 rounded hover:bg-red-600 transition-colors",children:j.jsx(Jg,{size:16})})})]}),open:T&&(r||s),placement:"top",arrow:!1,trigger:[],overlayInnerStyle:{padding:0,backgroundColor:"transparent",border:"none",boxShadow:"none"},children:j.jsxs("div",{ref:w,className:`relative inline-block max-w-full ${r?"ring-2 ring-blue-500 ring-offset-2 rounded":""}`,onMouseEnter:()=>T&&l(!0),onMouseLeave:()=>!i&&l(!1),children:[T&&s&&j.jsx("div",{className:"absolute -left-8 top-1/2 -translate-y-1/2 cursor-grab opacity-50 hover:opacity-100 transition-opacity","data-drag-handle":!0,children:j.jsx(v$,{size:20,className:"text-gray-600"})}),h&&!T?j.jsx("a",{href:h,target:"_blank",rel:"noopener noreferrer",children:j.jsx("img",{ref:S,src:e.attrs.src,alt:e.attrs.alt||"",title:e.attrs.title||"",style:{width:c.width,height:c.height,maxWidth:"100%",display:"block"},draggable:!1})}):j.jsx("img",{ref:S,src:e.attrs.src,alt:e.attrs.alt||"",title:e.attrs.title||"",style:{width:c.width,height:c.height,maxWidth:"100%",display:"block"},draggable:!1}),T&&(r||s)&&j.jsxs(j.Fragment,{children:[j.jsx("div",{className:"resize-handle resize-handle-nw",onMouseDown:I=>N(I,"nw")}),j.jsx("div",{className:"resize-handle resize-handle-ne",onMouseDown:I=>N(I,"ne")}),j.jsx("div",{className:"resize-handle resize-handle-sw",onMouseDown:I=>N(I,"sw")}),j.jsx("div",{className:"resize-handle resize-handle-se",onMouseDown:I=>N(I,"se")}),j.jsx("div",{className:"resize-handle resize-handle-n",onMouseDown:I=>N(I,"n")}),j.jsx("div",{className:"resize-handle resize-handle-s",onMouseDown:I=>N(I,"s")}),j.jsx("div",{className:"resize-handle resize-handle-e",onMouseDown:I=>N(I,"e")}),j.jsx("div",{className:"resize-handle resize-handle-w",onMouseDown:I=>N(I,"w")})]})]})}),!T&&j.jsx("div",{ref:w,className:"relative block max-w-full",style:L(),children:h?j.jsx("a",{href:h,target:"_blank",rel:"noopener noreferrer",children:j.jsx("img",{ref:S,src:e.attrs.src,alt:e.attrs.alt||"",title:e.attrs.title||"",style:{width:c.width,height:c.height,maxWidth:"100%",display:"block"},draggable:!1})}):j.jsx("img",{ref:S,src:e.attrs.src,alt:e.attrs.alt||"",title:e.attrs.title||"",style:{width:c.width,height:c.height,maxWidth:"100%",display:"block"},draggable:!1})}),T&&y&&jr.createPortal(j.jsx("div",{className:"fixed inset-0 bg-black/50 z-[99999] flex items-center justify-center p-4",children:j.jsxs("div",{className:"bg-white p-6 rounded-lg shadow-xl max-w-md w-full relative z-[100000]",children:[j.jsx("h3",{className:"text-lg font-semibold mb-4",children:"Edit Image URL"}),j.jsx(hi,{placeholder:"Enter image URL",value:C,onChange:I=>x(I.target.value),onPressEnter:D,size:"large",autoFocus:!0,className:"mb-4"}),j.jsxs("div",{className:"flex gap-2 justify-end",children:[j.jsx("button",{type:"button",onClick:()=>{b(!1),x(e.attrs.src||"")},className:"px-4 py-2 bg-gray-100 text-gray-700 rounded-md hover:bg-gray-200 transition-colors",children:"Cancel"}),j.jsx("button",{type:"button",onClick:D,className:"px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 transition-colors",children:"Save"})]})]})}),document.body),T&&v&&j.jsxs("div",{className:"absolute -top-24 left-1/2 -translate-x-1/2 flex items-center gap-2 p-2 bg-white border border-gray-200 rounded-lg shadow-lg z-[10000] min-w-[300px]",children:[j.jsx(hi,{placeholder:"Enter link URL",value:h,onChange:I=>m(I.target.value),onPressEnter:k,size:"small"}),j.jsx("button",{type:"button",onClick:k,className:"px-3 py-1 bg-blue-600 text-white rounded hover:bg-blue-700 text-sm",children:"Save"})]}),T?j.jsx(hi,{placeholder:"Add a caption...",value:d,onChange:I=>f(I.target.value),onBlur:R,className:"mt-2 text-sm text-center italic",bordered:!1,size:"small"}):d&&j.jsx("div",{className:"image-caption mt-2",children:d})]})}const E9=En.create({name:"image",addOptions(){return{inline:!1,allowBase64:!0,HTMLAttributes:{}}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,selectable:!0,atom:!0,addAttributes(){return{src:{default:null,parseHTML:e=>e.getAttribute("src"),renderHTML:e=>e.src?{src:e.src}:{}},alt:{default:null,parseHTML:e=>e.getAttribute("alt"),renderHTML:e=>e.alt?{alt:e.alt}:{}},title:{default:null,parseHTML:e=>e.getAttribute("title"),renderHTML:e=>e.title?{title:e.title}:{}},width:{default:"50%",parseHTML:e=>e.getAttribute("width")||"50%",renderHTML:e=>({width:e.width})},height:{default:"auto",parseHTML:e=>e.getAttribute("height")||"auto",renderHTML:e=>({height:e.height})},align:{default:"center",parseHTML:e=>e.getAttribute("data-align")||"center",renderHTML:e=>({"data-align":e.align})},float:{default:"none",parseHTML:e=>e.getAttribute("data-float")||"none",renderHTML:e=>({"data-float":e.float})},caption:{default:"",parseHTML:e=>e.getAttribute("data-caption")||"",renderHTML:e=>({"data-caption":e.caption})},link:{default:"",parseHTML:e=>e.getAttribute("data-link")||"",renderHTML:e=>({"data-link":e.link})},zIndex:{default:0,parseHTML:e=>parseInt(e.getAttribute("data-z-index")||"0",10),renderHTML:e=>({"data-z-index":e.zIndex})}}},parseHTML(){return[{tag:"img[src]",getAttrs:e=>{if(!(e instanceof HTMLElement))return null;const t=e.tagName==="IMG"?e:e.querySelector("img");return t?{src:t.getAttribute("src"),alt:t.getAttribute("alt"),title:t.getAttribute("title"),width:t.getAttribute("width")||"100%",height:t.getAttribute("height")||"auto",align:e.getAttribute("data-align")||"center",float:e.getAttribute("data-float")||"none",caption:e.getAttribute("data-caption")||"",link:e.getAttribute("data-link")||""}:null}}]},renderHTML({HTMLAttributes:e}){return["img",nn(this.options.HTMLAttributes,e)]},addNodeView(){return qm(w9)},addCommands(){return{setImage:e=>({commands:t})=>!e||!e.src?!1:t.insertContent({type:this.name,attrs:{src:e.src,alt:e.alt||"",title:e.title||"",width:e.width||"50%",height:e.height||"auto",align:e.align||"center",float:e.float||"none",caption:e.caption||"",link:e.link||"",zIndex:e.zIndex||0}}),updateImage:e=>({commands:t})=>t.updateAttributes(this.name,e),deleteImage:()=>({commands:e})=>e.deleteSelection()}}});function O9({node:e,updateAttributes:t,editor:n,selected:r,deleteNode:o}){const[i,a]=O.useState(!1),[s,l]=O.useState(!1),[c,u]=O.useState({width:e.attrs.width,height:e.attrs.height}),d=O.useRef(null),f=O.useRef(null),h=()=>{const{src:b,provider:C}=e.attrs;switch(C){case"youtube":return`https://www.youtube.com/embed/${b}`;case"vimeo":return`https://player.vimeo.com/video/${b}`;case"dailymotion":return`https://www.dailymotion.com/embed/video/${b}`;default:return b}},m=O.useCallback(b=>{if(b.preventDefault(),b.stopPropagation(),!d.current)return;const C=d.current.getBoundingClientRect();f.current={x:b.clientX,y:b.clientY,width:C.width,height:C.height},a(!0);const x=w=>{if(!f.current)return;const E=w.clientX-f.current.x,N=w.clientY-f.current.y,$=Math.max(200,f.current.width+E),M=Math.max(150,f.current.height+N);u({width:`${$}px`,height:`${M}px`})},S=()=>{a(!1),f.current=null,t({width:c.width,height:c.height}),document.removeEventListener("mousemove",x),document.removeEventListener("mouseup",S)};document.addEventListener("mousemove",x),document.addEventListener("mouseup",S)},[c,t]),v=()=>{window.confirm("Are you sure you want to delete this video?")&&o()},g=()=>{const b=prompt("Enter new video URL:","");if(b){let C="youtube",x="";if(b.includes("youtube.com")||b.includes("youtu.be")){C="youtube";const S=/(?:youtube\.com\/(?:[^\/]+\/.+\/|(?:v|e(?:mbed)?)\/|.*[?&]v=)|youtu\.be\/)([^"&?\/\s]{11})/,w=b.match(S);x=w?w[1]:""}else if(b.includes("vimeo.com")){C="vimeo";const S=/vimeo\.com\/(\d+)/,w=b.match(S);x=w?w[1]:""}else if(b.includes("dailymotion.com")){C="dailymotion";const S=/dailymotion\.com\/video\/([^_]+)/,w=b.match(S);x=w?w[1]:""}x?t({src:x,provider:C}):alert("Invalid video URL")}},y=n.isEditable;return j.jsx(Um,{className:"video-wrapper-container","data-drag-handle":!0,children:j.jsxs("div",{ref:d,className:`relative mx-auto ${r?"ring-2 ring-blue-500 ring-offset-2 rounded":""}`,style:{width:c.width,maxWidth:"100%"},onMouseEnter:()=>y&&l(!0),onMouseLeave:()=>!i&&l(!1),children:[y&&s&&j.jsx("div",{className:"absolute -left-8 top-1/2 -translate-y-1/2 cursor-grab opacity-50 hover:opacity-100 transition-opacity","data-drag-handle":!0,children:j.jsx(v$,{size:20,className:"text-gray-600"})}),j.jsx("div",{className:"relative w-full",style:{paddingBottom:"56.25%",height:0},children:j.jsx("iframe",{src:h(),className:"absolute top-0 left-0 w-full h-full rounded",frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0})}),y&&(r||s)&&j.jsx("div",{className:"absolute -bottom-2 -right-2 w-4 h-4 bg-blue-500 rounded-full cursor-se-resize opacity-75 hover:opacity-100 transition-opacity",onMouseDown:m}),y&&(r||s)&&j.jsxs("div",{className:"absolute -top-12 left-1/2 -translate-x-1/2 flex items-center gap-1 p-1.5 bg-gray-900 text-white rounded-lg shadow-xl z-10",children:[j.jsx(Sn,{title:"Edit URL",children:j.jsx("button",{type:"button",onClick:g,className:"p-1.5 rounded hover:bg-gray-700 transition-colors",children:j.jsx(F6,{size:16})})}),j.jsx("div",{className:"h-4 w-px bg-gray-600 mx-1"}),j.jsx(Sn,{title:"Delete Video",children:j.jsx("button",{type:"button",onClick:v,className:"p-1.5 rounded hover:bg-red-600 transition-colors",children:j.jsx(Jg,{size:16})})})]})]})})}const $9=En.create({name:"video",addOptions(){return{inline:!1,HTMLAttributes:{}}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,selectable:!0,atom:!0,addAttributes(){return{src:{default:null},width:{default:"100%"},height:{default:"400px"},provider:{default:"youtube"}}},parseHTML(){return[{tag:"div[data-video-embed]",getAttrs:e=>e instanceof HTMLElement?{src:e.getAttribute("data-src"),width:e.getAttribute("data-width")||"100%",height:e.getAttribute("data-height")||"400px",provider:e.getAttribute("data-provider")||"youtube"}:null}]},renderHTML({HTMLAttributes:e}){return["div",nn(this.options.HTMLAttributes,e,{"data-video-embed":""})]},addNodeView(){return qm(O9)},addCommands(){return{setVideo:e=>({commands:t})=>{let n="youtube",r="";if(e.src.includes("youtube.com")||e.src.includes("youtu.be")){n="youtube";const o=/(?:youtube\.com\/(?:[^\/]+\/.+\/|(?:v|e(?:mbed)?)\/|.*[?&]v=)|youtu\.be\/)([^"&?\/\s]{11})/,i=e.src.match(o);r=i?i[1]:""}else if(e.src.includes("vimeo.com")){n="vimeo";const o=/vimeo\.com\/(\d+)/,i=e.src.match(o);r=i?i[1]:""}else if(e.src.includes("dailymotion.com")){n="dailymotion";const o=/dailymotion\.com\/video\/([^_]+)/,i=e.src.match(o);r=i?i[1]:""}return t.insertContent({type:this.name,attrs:{src:r,width:e.width||"100%",height:e.height||"400px",provider:n}})}}}}),N9="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",M9="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",dm="numeric",fm="ascii",hm="alpha",zs="asciinumeric",Is="alphanumeric",pm="domain",k$="emoji",R9="scheme",I9="slashscheme",hh="whitespace";function T9(e,t){return e in t||(t[e]=[]),t[e]}function Bi(e,t,n){t[dm]&&(t[zs]=!0,t[Is]=!0),t[fm]&&(t[zs]=!0,t[hm]=!0),t[zs]&&(t[Is]=!0),t[hm]&&(t[Is]=!0),t[Is]&&(t[pm]=!0),t[k$]&&(t[pm]=!0);for(const r in t){const o=T9(r,n);o.indexOf(e)<0&&o.push(e)}}function A9(e,t){const n={};for(const r in t)t[r].indexOf(e)>=0&&(n[r]=!0);return n}function gr(e=null){this.j={},this.jr=[],this.jd=null,this.t=e}gr.groups={};gr.prototype={accepts(){return!!this.t},go(e){const t=this,n=t.j[e];if(n)return n;for(let r=0;r<t.jr.length;r++){const o=t.jr[r][0],i=t.jr[r][1];if(i&&o.test(e))return i}return t.jd},has(e,t=!1){return t?e in this.j:!!this.go(e)},ta(e,t,n,r){for(let o=0;o<e.length;o++)this.tt(e[o],t,n,r)},tr(e,t,n,r){r=r||gr.groups;let o;return t&&t.j?o=t:(o=new gr(t),n&&r&&Bi(t,n,r)),this.jr.push([e,o]),o},ts(e,t,n,r){let o=this;const i=e.length;if(!i)return o;for(let a=0;a<i-1;a++)o=o.tt(e[a]);return o.tt(e[i-1],t,n,r)},tt(e,t,n,r){r=r||gr.groups;const o=this;if(t&&t.j)return o.j[e]=t,t;const i=t;let a,s=o.go(e);if(s?(a=new gr,Object.assign(a.j,s.j),a.jr.push.apply(a.jr,s.jr),a.jd=s.jd,a.t=s.t):a=new gr,i){if(r)if(a.t&&typeof a.t=="string"){const l=Object.assign(A9(a.t,r),n);Bi(i,l,r)}else n&&Bi(i,n,r);a.t=i}return o.j[e]=a,a}};const Bt=(e,t,n,r,o)=>e.ta(t,n,r,o),Nn=(e,t,n,r,o)=>e.tr(t,n,r,o),qC=(e,t,n,r,o)=>e.ts(t,n,r,o),Fe=(e,t,n,r,o)=>e.tt(t,n,r,o),Ro="WORD",mm="UWORD",D$="ASCIINUMERICAL",_$="ALPHANUMERICAL",ml="LOCALHOST",gm="TLD",vm="UTLD",Uc="SCHEME",Sa="SLASH_SCHEME",nv="NUM",bm="WS",rv="NL",Fs="OPENBRACE",Hs="CLOSEBRACE",Ou="OPENBRACKET",$u="CLOSEBRACKET",Nu="OPENPAREN",Mu="CLOSEPAREN",Ru="OPENANGLEBRACKET",Iu="CLOSEANGLEBRACKET",Tu="FULLWIDTHLEFTPAREN",Au="FULLWIDTHRIGHTPAREN",Pu="LEFTCORNERBRACKET",ku="RIGHTCORNERBRACKET",Du="LEFTWHITECORNERBRACKET",_u="RIGHTWHITECORNERBRACKET",Lu="FULLWIDTHLESSTHAN",ju="FULLWIDTHGREATERTHAN",Bu="AMPERSAND",zu="APOSTROPHE",Fu="ASTERISK",Qo="AT",Hu="BACKSLASH",Vu="BACKTICK",Wu="CARET",ri="COLON",ov="COMMA",Uu="DOLLAR",uo="DOT",qu="EQUALS",iv="EXCLAMATION",kr="HYPHEN",Vs="PERCENT",Ku="PIPE",Gu="PLUS",Xu="POUND",Ws="QUERY",av="QUOTE",L$="FULLWIDTHMIDDLEDOT",sv="SEMI",fo="SLASH",Us="TILDE",Yu="UNDERSCORE",j$="EMOJI",Ju="SYM";var B$=Object.freeze({__proto__:null,ALPHANUMERICAL:_$,AMPERSAND:Bu,APOSTROPHE:zu,ASCIINUMERICAL:D$,ASTERISK:Fu,AT:Qo,BACKSLASH:Hu,BACKTICK:Vu,CARET:Wu,CLOSEANGLEBRACKET:Iu,CLOSEBRACE:Hs,CLOSEBRACKET:$u,CLOSEPAREN:Mu,COLON:ri,COMMA:ov,DOLLAR:Uu,DOT:uo,EMOJI:j$,EQUALS:qu,EXCLAMATION:iv,FULLWIDTHGREATERTHAN:ju,FULLWIDTHLEFTPAREN:Tu,FULLWIDTHLESSTHAN:Lu,FULLWIDTHMIDDLEDOT:L$,FULLWIDTHRIGHTPAREN:Au,HYPHEN:kr,LEFTCORNERBRACKET:Pu,LEFTWHITECORNERBRACKET:Du,LOCALHOST:ml,NL:rv,NUM:nv,OPENANGLEBRACKET:Ru,OPENBRACE:Fs,OPENBRACKET:Ou,OPENPAREN:Nu,PERCENT:Vs,PIPE:Ku,PLUS:Gu,POUND:Xu,QUERY:Ws,QUOTE:av,RIGHTCORNERBRACKET:ku,RIGHTWHITECORNERBRACKET:_u,SCHEME:Uc,SEMI:sv,SLASH:fo,SLASH_SCHEME:Sa,SYM:Ju,TILDE:Us,TLD:gm,UNDERSCORE:Yu,UTLD:vm,UWORD:mm,WORD:Ro,WS:bm});const Oo=/[a-z]/,xs=new RegExp("\\p{L}","u"),ph=new RegExp("\\p{Emoji}","u"),$o=/\d/,mh=/\s/,KC="\r",gh=`
700
+ `},addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command(()=>{const{selection:o,storedMarks:i}=n;if(o.$from.parent.type.spec.isolating)return!1;const{keepMarks:a}=this.options,{splittableMarks:s}=r.extensionManager,l=i||o.$to.parentOffset&&o.$from.marks();return t().insertContent({type:this.name}).command(({tr:c,dispatch:u})=>{if(u&&l&&a){const d=l.filter(f=>s.includes(f.type.name));c.ensureMarks(d)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),o9=En.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(e=>({tag:`h${e}`,attrs:{level:e}}))},renderHTML({node:e,HTMLAttributes:t}){return[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,nn(this.options.HTMLAttributes,t),0]},addCommands(){return{setHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.setNode(this.name,e):!1,toggleHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.toggleNode(this.name,"paragraph",e):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((e,t)=>({...e,[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})}),{})},addInputRules(){return this.options.levels.map(e=>Bh({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}}),i9=dn.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:e,dispatch:t})=>ev(e,t),redo:()=>({state:e,dispatch:t})=>tv(e,t)}},addProseMirrorPlugins(){return[T$(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()}}}),a9=En.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:e}){return["hr",nn(this.options.HTMLAttributes,e)]},addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{const{selection:n}=t,{$from:r,$to:o}=n,i=e();return r.parentOffset===0?i.insertContentAt({from:Math.max(r.pos-1,0),to:o.pos},{type:this.name}):Bx(n)?i.insertContentAt(o.pos,{type:this.name}):i.insertContent({type:this.name}),i.command(({tr:a,dispatch:s})=>{var l;if(s){const{$to:c}=a.selection,u=c.end();if(c.nodeAfter)c.nodeAfter.isTextblock?a.setSelection(Ct.create(a.doc,c.pos+1)):c.nodeAfter.isBlock?a.setSelection(yt.create(a.doc,c.pos)):a.setSelection(Ct.create(a.doc,c.pos));else{const d=(l=c.parent.type.contentMatch.defaultType)===null||l===void 0?void 0:l.create();d&&(a.insert(u,d),a.setSelection(Ct.create(a.doc,u+1)))}a.scrollIntoView()}return!0}).run()}}},addInputRules(){return[ZT({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),s9=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,l9=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,c9=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,u9=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,d9=ro.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:e=>e.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:e=>e.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:e}){return["em",nn(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Ji({find:s9,type:this.type}),Ji({find:c9,type:this.type})]},addPasteRules(){return[mi({find:l9,type:this.type}),mi({find:u9,type:this.type})]}}),f9="listItem",WC="textStyle",UC=/^(\d+)\.\s$/,h9=En.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:e=>e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1},type:{default:void 0,parseHTML:e=>e.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:e}){const{start:t,...n}=e;return t===1?["ol",nn(this.options.HTMLAttributes,n),0]:["ol",nn(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(f9,this.editor.getAttributes(WC)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let e=Ba({find:UC,type:this.type,getAttributes:t=>({start:+t[1]}),joinPredicate:(t,n)=>n.childCount+n.attrs.start===+t[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(e=Ba({find:UC,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:t=>({start:+t[1],...this.editor.getAttributes(WC)}),joinPredicate:(t,n)=>n.childCount+n.attrs.start===+t[1],editor:this.editor})),[e]}}),p9=En.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:e}){return["p",nn(this.options.HTMLAttributes,e),0]},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),m9=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,g9=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,v9=ro.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:e=>e.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:e}){return["s",nn(this.options.HTMLAttributes,e),0]},addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[Ji({find:m9,type:this.type})]},addPasteRules(){return[mi({find:g9,type:this.type})]}}),b9=En.create({name:"text",group:"inline"}),y9=dn.create({name:"starterKit",addExtensions(){var e,t,n,r,o,i,a,s,l,c,u,d,f,h,m,v,g,y;const b=[];return this.options.bold!==!1&&b.push(U7.configure((e=this.options)===null||e===void 0?void 0:e.bold)),this.options.blockquote!==!1&&b.push(z7.configure((t=this.options)===null||t===void 0?void 0:t.blockquote)),this.options.bulletList!==!1&&b.push(K7.configure((n=this.options)===null||n===void 0?void 0:n.bulletList)),this.options.code!==!1&&b.push(Y7.configure((r=this.options)===null||r===void 0?void 0:r.code)),this.options.codeBlock!==!1&&b.push(Z7.configure((o=this.options)===null||o===void 0?void 0:o.codeBlock)),this.options.document!==!1&&b.push(e9.configure((i=this.options)===null||i===void 0?void 0:i.document)),this.options.dropcursor!==!1&&b.push(t9.configure((a=this.options)===null||a===void 0?void 0:a.dropcursor)),this.options.gapcursor!==!1&&b.push(n9.configure((s=this.options)===null||s===void 0?void 0:s.gapcursor)),this.options.hardBreak!==!1&&b.push(r9.configure((l=this.options)===null||l===void 0?void 0:l.hardBreak)),this.options.heading!==!1&&b.push(o9.configure((c=this.options)===null||c===void 0?void 0:c.heading)),this.options.history!==!1&&b.push(i9.configure((u=this.options)===null||u===void 0?void 0:u.history)),this.options.horizontalRule!==!1&&b.push(a9.configure((d=this.options)===null||d===void 0?void 0:d.horizontalRule)),this.options.italic!==!1&&b.push(d9.configure((f=this.options)===null||f===void 0?void 0:f.italic)),this.options.listItem!==!1&&b.push(P$.configure((h=this.options)===null||h===void 0?void 0:h.listItem)),this.options.orderedList!==!1&&b.push(h9.configure((m=this.options)===null||m===void 0?void 0:m.orderedList)),this.options.paragraph!==!1&&b.push(p9.configure((v=this.options)===null||v===void 0?void 0:v.paragraph)),this.options.strike!==!1&&b.push(v9.configure((g=this.options)===null||g===void 0?void 0:g.strike)),this.options.text!==!1&&b.push(b9.configure((y=this.options)===null||y===void 0?void 0:y.text)),b}});function C9({title:e,childrenContent:t,editable:n,childrenEdit:r}){const[o,i]=O.useState(!1),a=n?j.jsx(bi,{children:j.jsx(bi.Item,{onClick:()=>i(!0),children:"Edit"},"edit")}):null;return j.jsxs("div",{children:[n&&a?j.jsx(Oi,{dropdownRender:()=>a,trigger:["contextMenu"],children:t}):t,j.jsx(Wr,{title:`Edit ${e}`,open:o,onOk:()=>i(!1),onCancel:()=>i(!1),children:r})]})}function S9({node:e,updateAttributes:t,editor:n}){const[r,o]=O.useState(!1),[i,a]=O.useState(e.attrs.bgColor||"#f3f4f6"),[s,l]=O.useState(e.attrs.titleColor||"#000000"),c=e.attrs.variant||"default",u=e.attrs.radius||"md",d=e.attrs.iconType||"chevron",f=C=>{C.preventDefault()},h=C=>{const x=typeof C=="string"?C:C.toHexString();a(x),t({bgColor:x})},m=C=>{const x=typeof C=="string"?C:C.toHexString();l(x),t({titleColor:x})},v=C=>{switch(C){case"sm":return"rounded-sm";case"lg":return"rounded-lg";case"xl":return"rounded-xl";case"none":return"rounded-none";default:return"rounded-md"}},g=()=>{const C={className:`transition-transform duration-300 ${r?"rotate-180":""}`,size:20,style:{color:s}};switch(d){case"plus":return j.jsx(Na,{...C,className:`transition-transform duration-300 ${r?"rotate-45":""}`});case"arrow":return j.jsx(i6,{...C,className:`transition-transform duration-300 ${r?"rotate-90":""}`});case"none":return null;default:return j.jsx(c6,{...C})}},y=()=>{const C=`transition-all duration-300 ${v(u)}`;switch(c){case"filled":return`${C} border-none shadow-sm overflow-hidden`;case"ghost":return`${C} border-none bg-transparent hover:bg-gray-50/50`;case"separate":return`${C} border shadow-sm my-2 overflow-hidden`;default:return`${C} border shadow-sm my-4 overflow-hidden`}},b=()=>{const C="flex items-center justify-between p-4 cursor-pointer select-none transition-colors";return c==="filled"?{className:`${C}`,style:{backgroundColor:i}}:c==="ghost"?{className:`${C} hover:bg-black/5`,style:{backgroundColor:"transparent"}}:{className:`${C} bg-gray-50 hover:bg-gray-100`,style:{backgroundColor:i}}};return j.jsx(Um,{className:"accordion-wrapper",children:j.jsx(C9,{title:"Accordion",childrenContent:j.jsxs("div",{className:y(),onContextMenu:f,style:c==="filled"?{backgroundColor:`${i}20`}:void 0,children:[j.jsxs("div",{...b(),onClick:()=>o(!r),children:[j.jsx("input",{className:"w-full text-lg font-medium bg-transparent border-none outline-none",style:{color:s},defaultValue:e.attrs.title||"Accordion Title",onChange:C=>t({title:C.target.value}),disabled:!n.isEditable,placeholder:"Accordion title"}),g()]}),j.jsx("div",{className:`overflow-hidden duration-300 ease-in-out ${r?"max-h-96 opacity-100":"max-h-0 opacity-0"} `,children:j.jsx("div",{className:"p-4 border-t",children:j.jsx(SA,{contentEditable:n.isEditable})})})]}),editable:n.isEditable,childrenEdit:j.jsxs("div",{className:"px-6 py-4 space-y-6 rounded-lg bg-gray-50",children:[j.jsxs("div",{className:"grid grid-cols-1 gap-6",children:[j.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[j.jsxs("div",{children:[j.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Variant"}),j.jsx(jo,{value:c,style:{width:"100%"},onChange:C=>t({variant:C}),options:[{value:"default",label:"Default (Bordered)"},{value:"filled",label:"Filled"},{value:"ghost",label:"Ghost"},{value:"separate",label:"Separated"}]})]}),j.jsxs("div",{children:[j.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Corner Radius"}),j.jsx(jo,{value:u,style:{width:"100%"},onChange:C=>t({radius:C}),options:[{value:"none",label:"Square"},{value:"sm",label:"Small"},{value:"md",label:"Medium"},{value:"lg",label:"Large"},{value:"xl",label:"Extra Large"}]})]})]}),j.jsxs("div",{children:[j.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Icon Style"}),j.jsxs(ti.Group,{value:d,onChange:C=>t({iconType:C.target.value}),className:"flex gap-4",children:[j.jsx(ti,{value:"chevron",children:"Chevron"}),j.jsx(ti,{value:"plus",children:"Plus"}),j.jsx(ti,{value:"arrow",children:"Arrow"}),j.jsx(ti,{value:"none",children:"None"})]})]}),j.jsxs("div",{className:"flex flex-col space-y-2",children:[j.jsx("label",{className:"font-medium text-gray-700",children:"Background Color"}),j.jsxs("div",{className:"flex items-center space-x-3",children:[j.jsx("div",{className:"w-8 h-8 border rounded shadow",style:{backgroundColor:i}}),j.jsx(Ya,{value:i,onChange:h})]})]}),j.jsxs("div",{className:"flex flex-col space-y-2",children:[j.jsx("label",{className:"font-medium text-gray-700",children:"Title Color"}),j.jsxs("div",{className:"flex items-center space-x-3",children:[j.jsx("div",{className:"w-8 h-8 border rounded shadow",style:{backgroundColor:s}}),j.jsx(Ya,{value:s,onChange:m})]})]})]}),j.jsx("div",{className:"pt-4 border-t border-gray-200",children:j.jsxs("div",{className:"p-3 bg-white border rounded-md",children:[j.jsx("div",{className:"text-sm text-gray-600",children:"Preview"}),j.jsx("div",{className:"p-2 mt-2 rounded",style:{backgroundColor:i},children:j.jsx("span",{style:{color:s,fontWeight:500},children:"Accordion Title"})})]})})]})})})}const x9=En.create({name:"accordion",group:"block",content:"block+",atom:!1,draggable:!0,selectable:!0,inline:!1,defining:!0,addAttributes(){return{title:{default:"Accordion Title"},bgColor:{default:"#f3f4f6"},titleColor:{default:"#000000"},iconType:{default:"chevron"},variant:{default:"default"},radius:{default:"md"}}},parseHTML(){return[{tag:"accordion"}]},renderHTML({HTMLAttributes:e}){return["accordion",nn(e)]},addNodeView(){return qm(S9)},addCommands(){return{setAccordion:e=>({chain:t})=>t().insertContent({type:"accordion",attrs:e,content:[{type:"paragraph",content:[{type:"text",text:"Accordion content"}]}]}).run()}}});function w9({node:e,updateAttributes:t,editor:n,selected:r,deleteNode:o}){const[i,a]=O.useState(!1),[s,l]=O.useState(!1),[c,u]=O.useState({width:e.attrs.width||"100%",height:e.attrs.height||"auto"}),[d,f]=O.useState(e.attrs.caption||""),[h,m]=O.useState(e.attrs.link||""),[v,g]=O.useState(!1),[y,b]=O.useState(!1),[C,x]=O.useState(e.attrs.src||""),S=O.useRef(null),w=O.useRef(null),E=O.useRef(null);O.useEffect(()=>{u({width:e.attrs.width||"100%",height:e.attrs.height||"auto"}),f(e.attrs.caption||""),m(e.attrs.link||""),x(e.attrs.src||"")},[e.attrs]);const N=O.useCallback((I,_)=>{if(I.preventDefault(),I.stopPropagation(),!S.current)return;const W=S.current.getBoundingClientRect();E.current={x:I.clientX,y:I.clientY,width:W.width,height:W.height},a(!0);const H=K=>{if(!E.current||!S.current)return;const Y=K.clientX-E.current.x,V=K.clientY-E.current.y;let G=E.current.width,Q=E.current.height;if(_.includes("e")&&(G=E.current.width+Y),_.includes("w")&&(G=E.current.width-Y),_.includes("s")&&(Q=E.current.height+V),_.includes("n")&&(Q=E.current.height-V),_.length===2&&S.current.naturalWidth&&S.current.naturalHeight){const ce=S.current.naturalWidth/S.current.naturalHeight;Q=G/ce}G=Math.max(50,G),Q=Math.max(50,Q),u({width:`${G}px`,height:`${Q}px`})},B=()=>{a(!1),E.current=null,t({width:c.width,height:c.height}),document.removeEventListener("mousemove",H),document.removeEventListener("mouseup",B)};document.addEventListener("mousemove",H),document.addEventListener("mouseup",B)},[c,t]),$=I=>{t({align:I,float:"none"})},M=I=>{t({float:I,align:I==="none"?"center":"left"})},R=()=>{d!==e.attrs.caption&&t({caption:d})},k=()=>{t({link:h}),g(!1)},D=()=>{t({src:C}),b(!1)},A=()=>{window.confirm("Are you sure you want to delete this image?")&&o()},L=()=>{const I={width:c.width,maxWidth:"100%",display:"block",zIndex:e.attrs.zIndex,position:"relative"};return e.attrs.float==="left"?{...I,float:"left",marginRight:"1rem",marginBottom:"0.5rem",display:"inline-block"}:e.attrs.float==="right"?{...I,float:"right",marginLeft:"1rem",marginBottom:"0.5rem",display:"inline-block"}:e.attrs.align==="center"?{...I,marginLeft:"auto",marginRight:"auto",display:"block"}:e.attrs.align==="right"?{...I,marginLeft:"auto",display:"block"}:I},T=n.isEditable;return O.useEffect(()=>{console.log("EnhancedImageView mounting:",{isEditable:n.isEditable,attrs:e.attrs})},[n.isEditable,e.attrs]),j.jsxs(Um,{className:"image-wrapper","data-drag-handle":!0,"data-float":e.attrs.float||"none",style:L(),children:[T&&j.jsx(_d,{content:j.jsxs("div",{className:"flex items-center gap-1 p-1.5 bg-gray-900 text-white rounded-lg shadow-xl",children:[j.jsx(Sn,{title:"Align Left",children:j.jsx("button",{type:"button",onClick:()=>$("left"),className:`p-1.5 rounded hover:bg-gray-700 transition-colors ${e.attrs.align==="left"&&e.attrs.float==="none"?"bg-gray-700":""}`,children:j.jsx(m$,{size:16})})}),j.jsx(Sn,{title:"Align Center",children:j.jsx("button",{type:"button",onClick:()=>$("center"),className:`p-1.5 rounded hover:bg-gray-700 transition-colors ${e.attrs.align==="center"&&e.attrs.float==="none"?"bg-gray-700":""}`,children:j.jsx(p$,{size:16})})}),j.jsx(Sn,{title:"Align Right",children:j.jsx("button",{type:"button",onClick:()=>$("right"),className:`p-1.5 rounded hover:bg-gray-700 transition-colors ${e.attrs.align==="right"&&e.attrs.float==="none"?"bg-gray-700":""}`,children:j.jsx(g$,{size:16})})}),j.jsx("div",{className:"h-4 w-px bg-gray-600 mx-1"}),j.jsx(Sn,{title:"Float Left",children:j.jsx("button",{type:"button",onClick:()=>M("left"),className:`p-1.5 rounded hover:bg-gray-700 transition-colors ${e.attrs.float==="left"?"bg-gray-700":""}`,children:j.jsx("span",{className:"text-xs font-semibold",children:"FL"})})}),j.jsx(Sn,{title:"Float Right",children:j.jsx("button",{type:"button",onClick:()=>M("right"),className:`p-1.5 rounded hover:bg-gray-700 transition-colors ${e.attrs.float==="right"?"bg-gray-700":""}`,children:j.jsx("span",{className:"text-xs font-semibold",children:"FR"})})}),j.jsx("div",{className:"h-4 w-px bg-gray-600 mx-1"}),j.jsx(Sn,{title:"Add/Edit Link",children:j.jsx("button",{type:"button",onClick:()=>g(!v),className:`p-1.5 rounded hover:bg-gray-700 transition-colors ${h?"bg-gray-700":""}`,children:j.jsx(b$,{size:16})})}),j.jsx(Sn,{title:"Edit Image URL",children:j.jsx("button",{type:"button",onClick:()=>b(!y),className:"p-1.5 rounded hover:bg-gray-700 transition-colors",children:j.jsx("span",{className:"text-xs font-semibold",children:"URL"})})}),j.jsx("div",{className:"h-4 w-px bg-gray-600 mx-1"}),j.jsx(Sn,{title:"Delete Image",children:j.jsx("button",{type:"button",onClick:A,className:"p-1.5 rounded hover:bg-red-600 transition-colors",children:j.jsx(Jg,{size:16})})})]}),open:T&&(r||s),placement:"top",arrow:!1,trigger:[],overlayInnerStyle:{padding:0,backgroundColor:"transparent",border:"none",boxShadow:"none"},children:j.jsxs("div",{ref:w,className:`relative inline-block max-w-full ${r?"ring-2 ring-blue-500 ring-offset-2 rounded":""}`,onMouseEnter:()=>T&&l(!0),onMouseLeave:()=>!i&&l(!1),children:[T&&s&&j.jsx("div",{className:"absolute -left-8 top-1/2 -translate-y-1/2 cursor-grab opacity-50 hover:opacity-100 transition-opacity","data-drag-handle":!0,children:j.jsx(v$,{size:20,className:"text-gray-600"})}),h&&!T?j.jsx("a",{href:h,target:"_blank",rel:"noopener noreferrer",children:j.jsx("img",{ref:S,src:e.attrs.src,alt:e.attrs.alt||"",title:e.attrs.title||"",style:{width:c.width,height:c.height,maxWidth:"100%",display:"block"},draggable:!1})}):j.jsx("img",{ref:S,src:e.attrs.src,alt:e.attrs.alt||"",title:e.attrs.title||"",style:{width:c.width,height:c.height,maxWidth:"100%",display:"block"},draggable:!1}),T&&(r||s)&&j.jsxs(j.Fragment,{children:[j.jsx("div",{className:"resize-handle resize-handle-nw",onMouseDown:I=>N(I,"nw")}),j.jsx("div",{className:"resize-handle resize-handle-ne",onMouseDown:I=>N(I,"ne")}),j.jsx("div",{className:"resize-handle resize-handle-sw",onMouseDown:I=>N(I,"sw")}),j.jsx("div",{className:"resize-handle resize-handle-se",onMouseDown:I=>N(I,"se")}),j.jsx("div",{className:"resize-handle resize-handle-n",onMouseDown:I=>N(I,"n")}),j.jsx("div",{className:"resize-handle resize-handle-s",onMouseDown:I=>N(I,"s")}),j.jsx("div",{className:"resize-handle resize-handle-e",onMouseDown:I=>N(I,"e")}),j.jsx("div",{className:"resize-handle resize-handle-w",onMouseDown:I=>N(I,"w")})]})]})}),!T&&j.jsx("div",{ref:w,className:"relative block max-w-full",style:L(),children:h?j.jsx("a",{href:h,target:"_blank",rel:"noopener noreferrer",children:j.jsx("img",{ref:S,src:e.attrs.src,alt:e.attrs.alt||"",title:e.attrs.title||"",style:{width:c.width,height:c.height,maxWidth:"100%",display:"block"},draggable:!1})}):j.jsx("img",{ref:S,src:e.attrs.src,alt:e.attrs.alt||"",title:e.attrs.title||"",style:{width:c.width,height:c.height,maxWidth:"100%",display:"block"},draggable:!1})}),T&&y&&jr.createPortal(j.jsx("div",{className:"fixed inset-0 bg-black/50 z-[99999] flex items-center justify-center p-4",children:j.jsxs("div",{className:"bg-white p-6 rounded-lg shadow-xl max-w-md w-full relative z-[100000]",children:[j.jsx("h3",{className:"text-lg font-semibold mb-4",children:"Edit Image URL"}),j.jsx(hi,{placeholder:"Enter image URL",value:C,onChange:I=>x(I.target.value),onPressEnter:D,size:"large",autoFocus:!0,className:"mb-4"}),j.jsxs("div",{className:"flex gap-2 justify-end",children:[j.jsx("button",{type:"button",onClick:()=>{b(!1),x(e.attrs.src||"")},className:"px-4 py-2 bg-gray-100 text-gray-700 rounded-md hover:bg-gray-200 transition-colors",children:"Cancel"}),j.jsx("button",{type:"button",onClick:D,className:"px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 transition-colors",children:"Save"})]})]})}),document.body),T&&v&&j.jsxs("div",{className:"absolute -top-24 left-1/2 -translate-x-1/2 flex items-center gap-2 p-2 bg-white border border-gray-200 rounded-lg shadow-lg z-[10000] min-w-[300px]",children:[j.jsx(hi,{placeholder:"Enter link URL",value:h,onChange:I=>m(I.target.value),onPressEnter:k,size:"small"}),j.jsx("button",{type:"button",onClick:k,className:"px-3 py-1 bg-blue-600 text-white rounded hover:bg-blue-700 text-sm",children:"Save"})]}),T?(r||d)&&j.jsx(hi,{placeholder:"Add a caption...",value:d,onChange:I=>f(I.target.value),onBlur:R,className:"mt-2 text-sm text-center italic",bordered:!1,size:"small"}):d&&j.jsx("div",{className:"image-caption mt-2",children:d})]})}const E9=En.create({name:"image",addOptions(){return{inline:!0,allowBase64:!0,HTMLAttributes:{}}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,selectable:!0,atom:!0,addAttributes(){return{src:{default:null,parseHTML:e=>e.getAttribute("src"),renderHTML:e=>e.src?{src:e.src}:{}},alt:{default:null,parseHTML:e=>e.getAttribute("alt"),renderHTML:e=>e.alt?{alt:e.alt}:{}},title:{default:null,parseHTML:e=>e.getAttribute("title"),renderHTML:e=>e.title?{title:e.title}:{}},width:{default:"50%",parseHTML:e=>e.getAttribute("width")||"50%",renderHTML:e=>({width:e.width})},height:{default:"auto",parseHTML:e=>e.getAttribute("height")||"auto",renderHTML:e=>({height:e.height})},align:{default:"center",parseHTML:e=>e.getAttribute("data-align")||"center",renderHTML:e=>({"data-align":e.align})},float:{default:"none",parseHTML:e=>e.getAttribute("data-float")||"none",renderHTML:e=>({"data-float":e.float})},caption:{default:"",parseHTML:e=>e.getAttribute("data-caption")||"",renderHTML:e=>({"data-caption":e.caption})},link:{default:"",parseHTML:e=>e.getAttribute("data-link")||"",renderHTML:e=>({"data-link":e.link})},zIndex:{default:0,parseHTML:e=>parseInt(e.getAttribute("data-z-index")||"0",10),renderHTML:e=>({"data-z-index":e.zIndex})}}},parseHTML(){return[{tag:"img[src]",getAttrs:e=>{if(!(e instanceof HTMLElement))return null;const t=e.tagName==="IMG"?e:e.querySelector("img");return t?{src:t.getAttribute("src"),alt:t.getAttribute("alt"),title:t.getAttribute("title"),width:t.getAttribute("width")||"100%",height:t.getAttribute("height")||"auto",align:e.getAttribute("data-align")||"center",float:e.getAttribute("data-float")||"none",caption:e.getAttribute("data-caption")||"",link:e.getAttribute("data-link")||""}:null}}]},renderHTML({HTMLAttributes:e}){return["img",nn(this.options.HTMLAttributes,e)]},addNodeView(){return qm(w9)},addCommands(){return{setImage:e=>({commands:t})=>!e||!e.src?!1:t.insertContent({type:this.name,attrs:{src:e.src,alt:e.alt||"",title:e.title||"",width:e.width||"50%",height:e.height||"auto",align:e.align||"center",float:e.float||"none",caption:e.caption||"",link:e.link||"",zIndex:e.zIndex||0}}),updateImage:e=>({commands:t})=>t.updateAttributes(this.name,e),deleteImage:()=>({commands:e})=>e.deleteSelection()}}});function O9({node:e,updateAttributes:t,editor:n,selected:r,deleteNode:o}){const[i,a]=O.useState(!1),[s,l]=O.useState(!1),[c,u]=O.useState({width:e.attrs.width,height:e.attrs.height}),d=O.useRef(null),f=O.useRef(null),h=()=>{const{src:b,provider:C}=e.attrs;switch(C){case"youtube":return`https://www.youtube.com/embed/${b}`;case"vimeo":return`https://player.vimeo.com/video/${b}`;case"dailymotion":return`https://www.dailymotion.com/embed/video/${b}`;default:return b}},m=O.useCallback(b=>{if(b.preventDefault(),b.stopPropagation(),!d.current)return;const C=d.current.getBoundingClientRect();f.current={x:b.clientX,y:b.clientY,width:C.width,height:C.height},a(!0);const x=w=>{if(!f.current)return;const E=w.clientX-f.current.x,N=w.clientY-f.current.y,$=Math.max(200,f.current.width+E),M=Math.max(150,f.current.height+N);u({width:`${$}px`,height:`${M}px`})},S=()=>{a(!1),f.current=null,t({width:c.width,height:c.height}),document.removeEventListener("mousemove",x),document.removeEventListener("mouseup",S)};document.addEventListener("mousemove",x),document.addEventListener("mouseup",S)},[c,t]),v=()=>{window.confirm("Are you sure you want to delete this video?")&&o()},g=()=>{const b=prompt("Enter new video URL:","");if(b){let C="youtube",x="";if(b.includes("youtube.com")||b.includes("youtu.be")){C="youtube";const S=/(?:youtube\.com\/(?:[^\/]+\/.+\/|(?:v|e(?:mbed)?)\/|.*[?&]v=)|youtu\.be\/)([^"&?\/\s]{11})/,w=b.match(S);x=w?w[1]:""}else if(b.includes("vimeo.com")){C="vimeo";const S=/vimeo\.com\/(\d+)/,w=b.match(S);x=w?w[1]:""}else if(b.includes("dailymotion.com")){C="dailymotion";const S=/dailymotion\.com\/video\/([^_]+)/,w=b.match(S);x=w?w[1]:""}x?t({src:x,provider:C}):alert("Invalid video URL")}},y=n.isEditable;return j.jsx(Um,{className:"video-wrapper-container","data-drag-handle":!0,children:j.jsxs("div",{ref:d,className:`relative mx-auto ${r?"ring-2 ring-blue-500 ring-offset-2 rounded":""}`,style:{width:c.width,maxWidth:"100%"},onMouseEnter:()=>y&&l(!0),onMouseLeave:()=>!i&&l(!1),children:[y&&s&&j.jsx("div",{className:"absolute -left-8 top-1/2 -translate-y-1/2 cursor-grab opacity-50 hover:opacity-100 transition-opacity","data-drag-handle":!0,children:j.jsx(v$,{size:20,className:"text-gray-600"})}),j.jsx("div",{className:"relative w-full",style:{paddingBottom:"56.25%",height:0},children:j.jsx("iframe",{src:h(),className:"absolute top-0 left-0 w-full h-full rounded",frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0})}),y&&(r||s)&&j.jsx("div",{className:"absolute -bottom-2 -right-2 w-4 h-4 bg-blue-500 rounded-full cursor-se-resize opacity-75 hover:opacity-100 transition-opacity",onMouseDown:m}),y&&(r||s)&&j.jsxs("div",{className:"absolute -top-12 left-1/2 -translate-x-1/2 flex items-center gap-1 p-1.5 bg-gray-900 text-white rounded-lg shadow-xl z-10",children:[j.jsx(Sn,{title:"Edit URL",children:j.jsx("button",{type:"button",onClick:g,className:"p-1.5 rounded hover:bg-gray-700 transition-colors",children:j.jsx(F6,{size:16})})}),j.jsx("div",{className:"h-4 w-px bg-gray-600 mx-1"}),j.jsx(Sn,{title:"Delete Video",children:j.jsx("button",{type:"button",onClick:v,className:"p-1.5 rounded hover:bg-red-600 transition-colors",children:j.jsx(Jg,{size:16})})})]})]})})}const $9=En.create({name:"video",addOptions(){return{inline:!1,HTMLAttributes:{}}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,selectable:!0,atom:!0,addAttributes(){return{src:{default:null},width:{default:"100%"},height:{default:"400px"},provider:{default:"youtube"}}},parseHTML(){return[{tag:"div[data-video-embed]",getAttrs:e=>e instanceof HTMLElement?{src:e.getAttribute("data-src"),width:e.getAttribute("data-width")||"100%",height:e.getAttribute("data-height")||"400px",provider:e.getAttribute("data-provider")||"youtube"}:null}]},renderHTML({HTMLAttributes:e}){return["div",nn(this.options.HTMLAttributes,e,{"data-video-embed":""})]},addNodeView(){return qm(O9)},addCommands(){return{setVideo:e=>({commands:t})=>{let n="youtube",r="";if(e.src.includes("youtube.com")||e.src.includes("youtu.be")){n="youtube";const o=/(?:youtube\.com\/(?:[^\/]+\/.+\/|(?:v|e(?:mbed)?)\/|.*[?&]v=)|youtu\.be\/)([^"&?\/\s]{11})/,i=e.src.match(o);r=i?i[1]:""}else if(e.src.includes("vimeo.com")){n="vimeo";const o=/vimeo\.com\/(\d+)/,i=e.src.match(o);r=i?i[1]:""}else if(e.src.includes("dailymotion.com")){n="dailymotion";const o=/dailymotion\.com\/video\/([^_]+)/,i=e.src.match(o);r=i?i[1]:""}return t.insertContent({type:this.name,attrs:{src:r,width:e.width||"100%",height:e.height||"400px",provider:n}})}}}}),N9="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",M9="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",dm="numeric",fm="ascii",hm="alpha",zs="asciinumeric",Is="alphanumeric",pm="domain",k$="emoji",R9="scheme",I9="slashscheme",hh="whitespace";function T9(e,t){return e in t||(t[e]=[]),t[e]}function Bi(e,t,n){t[dm]&&(t[zs]=!0,t[Is]=!0),t[fm]&&(t[zs]=!0,t[hm]=!0),t[zs]&&(t[Is]=!0),t[hm]&&(t[Is]=!0),t[Is]&&(t[pm]=!0),t[k$]&&(t[pm]=!0);for(const r in t){const o=T9(r,n);o.indexOf(e)<0&&o.push(e)}}function A9(e,t){const n={};for(const r in t)t[r].indexOf(e)>=0&&(n[r]=!0);return n}function gr(e=null){this.j={},this.jr=[],this.jd=null,this.t=e}gr.groups={};gr.prototype={accepts(){return!!this.t},go(e){const t=this,n=t.j[e];if(n)return n;for(let r=0;r<t.jr.length;r++){const o=t.jr[r][0],i=t.jr[r][1];if(i&&o.test(e))return i}return t.jd},has(e,t=!1){return t?e in this.j:!!this.go(e)},ta(e,t,n,r){for(let o=0;o<e.length;o++)this.tt(e[o],t,n,r)},tr(e,t,n,r){r=r||gr.groups;let o;return t&&t.j?o=t:(o=new gr(t),n&&r&&Bi(t,n,r)),this.jr.push([e,o]),o},ts(e,t,n,r){let o=this;const i=e.length;if(!i)return o;for(let a=0;a<i-1;a++)o=o.tt(e[a]);return o.tt(e[i-1],t,n,r)},tt(e,t,n,r){r=r||gr.groups;const o=this;if(t&&t.j)return o.j[e]=t,t;const i=t;let a,s=o.go(e);if(s?(a=new gr,Object.assign(a.j,s.j),a.jr.push.apply(a.jr,s.jr),a.jd=s.jd,a.t=s.t):a=new gr,i){if(r)if(a.t&&typeof a.t=="string"){const l=Object.assign(A9(a.t,r),n);Bi(i,l,r)}else n&&Bi(i,n,r);a.t=i}return o.j[e]=a,a}};const Bt=(e,t,n,r,o)=>e.ta(t,n,r,o),Nn=(e,t,n,r,o)=>e.tr(t,n,r,o),qC=(e,t,n,r,o)=>e.ts(t,n,r,o),Fe=(e,t,n,r,o)=>e.tt(t,n,r,o),Ro="WORD",mm="UWORD",D$="ASCIINUMERICAL",_$="ALPHANUMERICAL",ml="LOCALHOST",gm="TLD",vm="UTLD",Uc="SCHEME",Sa="SLASH_SCHEME",nv="NUM",bm="WS",rv="NL",Fs="OPENBRACE",Hs="CLOSEBRACE",Ou="OPENBRACKET",$u="CLOSEBRACKET",Nu="OPENPAREN",Mu="CLOSEPAREN",Ru="OPENANGLEBRACKET",Iu="CLOSEANGLEBRACKET",Tu="FULLWIDTHLEFTPAREN",Au="FULLWIDTHRIGHTPAREN",Pu="LEFTCORNERBRACKET",ku="RIGHTCORNERBRACKET",Du="LEFTWHITECORNERBRACKET",_u="RIGHTWHITECORNERBRACKET",Lu="FULLWIDTHLESSTHAN",ju="FULLWIDTHGREATERTHAN",Bu="AMPERSAND",zu="APOSTROPHE",Fu="ASTERISK",Qo="AT",Hu="BACKSLASH",Vu="BACKTICK",Wu="CARET",ri="COLON",ov="COMMA",Uu="DOLLAR",uo="DOT",qu="EQUALS",iv="EXCLAMATION",kr="HYPHEN",Vs="PERCENT",Ku="PIPE",Gu="PLUS",Xu="POUND",Ws="QUERY",av="QUOTE",L$="FULLWIDTHMIDDLEDOT",sv="SEMI",fo="SLASH",Us="TILDE",Yu="UNDERSCORE",j$="EMOJI",Ju="SYM";var B$=Object.freeze({__proto__:null,ALPHANUMERICAL:_$,AMPERSAND:Bu,APOSTROPHE:zu,ASCIINUMERICAL:D$,ASTERISK:Fu,AT:Qo,BACKSLASH:Hu,BACKTICK:Vu,CARET:Wu,CLOSEANGLEBRACKET:Iu,CLOSEBRACE:Hs,CLOSEBRACKET:$u,CLOSEPAREN:Mu,COLON:ri,COMMA:ov,DOLLAR:Uu,DOT:uo,EMOJI:j$,EQUALS:qu,EXCLAMATION:iv,FULLWIDTHGREATERTHAN:ju,FULLWIDTHLEFTPAREN:Tu,FULLWIDTHLESSTHAN:Lu,FULLWIDTHMIDDLEDOT:L$,FULLWIDTHRIGHTPAREN:Au,HYPHEN:kr,LEFTCORNERBRACKET:Pu,LEFTWHITECORNERBRACKET:Du,LOCALHOST:ml,NL:rv,NUM:nv,OPENANGLEBRACKET:Ru,OPENBRACE:Fs,OPENBRACKET:Ou,OPENPAREN:Nu,PERCENT:Vs,PIPE:Ku,PLUS:Gu,POUND:Xu,QUERY:Ws,QUOTE:av,RIGHTCORNERBRACKET:ku,RIGHTWHITECORNERBRACKET:_u,SCHEME:Uc,SEMI:sv,SLASH:fo,SLASH_SCHEME:Sa,SYM:Ju,TILDE:Us,TLD:gm,UNDERSCORE:Yu,UTLD:vm,UWORD:mm,WORD:Ro,WS:bm});const Oo=/[a-z]/,xs=new RegExp("\\p{L}","u"),ph=new RegExp("\\p{Emoji}","u"),$o=/\d/,mh=/\s/,KC="\r",gh=`
701
701
  `,P9="️",k9="‍",vh="";let yc=null,Cc=null;function D9(e=[]){const t={};gr.groups=t;const n=new gr;yc==null&&(yc=GC(N9)),Cc==null&&(Cc=GC(M9)),Fe(n,"'",zu),Fe(n,"{",Fs),Fe(n,"}",Hs),Fe(n,"[",Ou),Fe(n,"]",$u),Fe(n,"(",Nu),Fe(n,")",Mu),Fe(n,"<",Ru),Fe(n,">",Iu),Fe(n,"(",Tu),Fe(n,")",Au),Fe(n,"「",Pu),Fe(n,"」",ku),Fe(n,"『",Du),Fe(n,"』",_u),Fe(n,"<",Lu),Fe(n,">",ju),Fe(n,"&",Bu),Fe(n,"*",Fu),Fe(n,"@",Qo),Fe(n,"`",Vu),Fe(n,"^",Wu),Fe(n,":",ri),Fe(n,",",ov),Fe(n,"$",Uu),Fe(n,".",uo),Fe(n,"=",qu),Fe(n,"!",iv),Fe(n,"-",kr),Fe(n,"%",Vs),Fe(n,"|",Ku),Fe(n,"+",Gu),Fe(n,"#",Xu),Fe(n,"?",Ws),Fe(n,'"',av),Fe(n,"/",fo),Fe(n,";",sv),Fe(n,"~",Us),Fe(n,"_",Yu),Fe(n,"\\",Hu),Fe(n,"・",L$);const r=Nn(n,$o,nv,{[dm]:!0});Nn(r,$o,r);const o=Nn(r,Oo,D$,{[zs]:!0}),i=Nn(r,xs,_$,{[Is]:!0}),a=Nn(n,Oo,Ro,{[fm]:!0});Nn(a,$o,o),Nn(a,Oo,a),Nn(o,$o,o),Nn(o,Oo,o);const s=Nn(n,xs,mm,{[hm]:!0});Nn(s,Oo),Nn(s,$o,i),Nn(s,xs,s),Nn(i,$o,i),Nn(i,Oo),Nn(i,xs,i);const l=Fe(n,gh,rv,{[hh]:!0}),c=Fe(n,KC,bm,{[hh]:!0}),u=Nn(n,mh,bm,{[hh]:!0});Fe(n,vh,u),Fe(c,gh,l),Fe(c,vh,u),Nn(c,mh,u),Fe(u,KC),Fe(u,gh),Nn(u,mh,u),Fe(u,vh,u);const d=Nn(n,ph,j$,{[k$]:!0});Fe(d,"#"),Nn(d,ph,d),Fe(d,P9,d);const f=Fe(d,k9);Fe(f,"#"),Nn(f,ph,d);const h=[[Oo,a],[$o,o]],m=[[Oo,null],[xs,s],[$o,i]];for(let v=0;v<yc.length;v++)Ko(n,yc[v],gm,Ro,h);for(let v=0;v<Cc.length;v++)Ko(n,Cc[v],vm,mm,m);Bi(gm,{tld:!0,ascii:!0},t),Bi(vm,{utld:!0,alpha:!0},t),Ko(n,"file",Uc,Ro,h),Ko(n,"mailto",Uc,Ro,h),Ko(n,"http",Sa,Ro,h),Ko(n,"https",Sa,Ro,h),Ko(n,"ftp",Sa,Ro,h),Ko(n,"ftps",Sa,Ro,h),Bi(Uc,{scheme:!0,ascii:!0},t),Bi(Sa,{slashscheme:!0,ascii:!0},t),e=e.sort((v,g)=>v[0]>g[0]?1:-1);for(let v=0;v<e.length;v++){const g=e[v][0],b=e[v][1]?{[R9]:!0}:{[I9]:!0};g.indexOf("-")>=0?b[pm]=!0:Oo.test(g)?$o.test(g)?b[zs]=!0:b[fm]=!0:b[dm]=!0,qC(n,g,g,b)}return qC(n,"localhost",ml,{ascii:!0}),n.jd=new gr(Ju),{start:n,tokens:Object.assign({groups:t},B$)}}function z$(e,t){const n=_9(t.replace(/[A-Z]/g,s=>s.toLowerCase())),r=n.length,o=[];let i=0,a=0;for(;a<r;){let s=e,l=null,c=0,u=null,d=-1,f=-1;for(;a<r&&(l=s.go(n[a]));)s=l,s.accepts()?(d=0,f=0,u=s):d>=0&&(d+=n[a].length,f++),c+=n[a].length,i+=n[a].length,a++;i-=d,a-=f,c-=d,o.push({t:u.t,v:t.slice(i-c,i),s:i-c,e:i})}return o}function _9(e){const t=[],n=e.length;let r=0;for(;r<n;){let o=e.charCodeAt(r),i,a=o<55296||o>56319||r+1===n||(i=e.charCodeAt(r+1))<56320||i>57343?e[r]:e.slice(r,r+2);t.push(a),r+=a.length}return t}function Ko(e,t,n,r,o){let i;const a=t.length;for(let s=0;s<a-1;s++){const l=t[s];e.j[l]?i=e.j[l]:(i=new gr(r),i.jr=o.slice(),e.j[l]=i),e=i}return i=new gr(n),i.jr=o.slice(),e.j[t[a-1]]=i,i}function GC(e){const t=[],n=[];let r=0,o="0123456789";for(;r<e.length;){let i=0;for(;o.indexOf(e[r+i])>=0;)i++;if(i>0){t.push(n.join(""));for(let a=parseInt(e.substring(r,r+i),10);a>0;a--)n.pop();r+=i}else n.push(e[r]),r++}return t}const gl={defaultProtocol:"http",events:null,format:XC,formatHref:XC,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function lv(e,t=null){let n=Object.assign({},gl);e&&(n=Object.assign(n,e instanceof lv?e.o:e));const r=n.ignoreTags,o=[];for(let i=0;i<r.length;i++)o.push(r[i].toUpperCase());this.o=n,t&&(this.defaultRender=t),this.ignoreTags=o}lv.prototype={o:gl,ignoreTags:[],defaultRender(e){return e},check(e){return this.get("validate",e.toString(),e)},get(e,t,n){const r=t!=null;let o=this.o[e];return o&&(typeof o=="object"?(o=n.t in o?o[n.t]:gl[e],typeof o=="function"&&r&&(o=o(t,n))):typeof o=="function"&&r&&(o=o(t,n.t,n)),o)},getObj(e,t,n){let r=this.o[e];return typeof r=="function"&&t!=null&&(r=r(t,n.t,n)),r},render(e){const t=e.render(this);return(this.get("render",null,e)||this.defaultRender)(t,e.t,e)}};function XC(e){return e}function F$(e,t){this.t="token",this.v=e,this.tk=t}F$.prototype={isLink:!1,toString(){return this.v},toHref(e){return this.toString()},toFormattedString(e){const t=this.toString(),n=e.get("truncate",t,this),r=e.get("format",t,this);return n&&r.length>n?r.substring(0,n)+"…":r},toFormattedHref(e){return e.get("formatHref",this.toHref(e.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(e=gl.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(e){return{type:this.t,value:this.toFormattedString(e),isLink:this.isLink,href:this.toFormattedHref(e),start:this.startIndex(),end:this.endIndex()}},validate(e){return e.get("validate",this.toString(),this)},render(e){const t=this,n=this.toHref(e.get("defaultProtocol")),r=e.get("formatHref",n,this),o=e.get("tagName",n,t),i=this.toFormattedString(e),a={},s=e.get("className",n,t),l=e.get("target",n,t),c=e.get("rel",n,t),u=e.getObj("attributes",n,t),d=e.getObj("events",n,t);return a.href=r,s&&(a.class=s),l&&(a.target=l),c&&(a.rel=c),u&&Object.assign(a,u),{tagName:o,attributes:a,content:i,eventListeners:d}}};function Wd(e,t){class n extends F${constructor(o,i){super(o,i),this.t=e}}for(const r in t)n.prototype[r]=t[r];return n.t=e,n}const YC=Wd("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),JC=Wd("text"),L9=Wd("nl"),Sc=Wd("url",{isLink:!0,toHref(e=gl.defaultProtocol){return this.hasProtocol()?this.v:`${e}://${this.v}`},hasProtocol(){const e=this.tk;return e.length>=2&&e[0].t!==ml&&e[1].t===ri}}),Pr=e=>new gr(e);function j9({groups:e}){const t=e.domain.concat([Bu,Fu,Qo,Hu,Vu,Wu,Uu,qu,kr,nv,Vs,Ku,Gu,Xu,fo,Ju,Us,Yu]),n=[zu,ri,ov,uo,iv,Vs,Ws,av,sv,Ru,Iu,Fs,Hs,$u,Ou,Nu,Mu,Tu,Au,Pu,ku,Du,_u,Lu,ju],r=[Bu,zu,Fu,Hu,Vu,Wu,Uu,qu,kr,Fs,Hs,Vs,Ku,Gu,Xu,Ws,fo,Ju,Us,Yu],o=Pr(),i=Fe(o,Us);Bt(i,r,i),Bt(i,e.domain,i);const a=Pr(),s=Pr(),l=Pr();Bt(o,e.domain,a),Bt(o,e.scheme,s),Bt(o,e.slashscheme,l),Bt(a,r,i),Bt(a,e.domain,a);const c=Fe(a,Qo);Fe(i,Qo,c),Fe(s,Qo,c),Fe(l,Qo,c);const u=Fe(i,uo);Bt(u,r,i),Bt(u,e.domain,i);const d=Pr();Bt(c,e.domain,d),Bt(d,e.domain,d);const f=Fe(d,uo);Bt(f,e.domain,d);const h=Pr(YC);Bt(f,e.tld,h),Bt(f,e.utld,h),Fe(c,ml,h);const m=Fe(d,kr);Fe(m,kr,m),Bt(m,e.domain,d),Bt(h,e.domain,d),Fe(h,uo,f),Fe(h,kr,m);const v=Fe(h,ri);Bt(v,e.numeric,YC);const g=Fe(a,kr),y=Fe(a,uo);Fe(g,kr,g),Bt(g,e.domain,a),Bt(y,r,i),Bt(y,e.domain,a);const b=Pr(Sc);Bt(y,e.tld,b),Bt(y,e.utld,b),Bt(b,e.domain,a),Bt(b,r,i),Fe(b,uo,y),Fe(b,kr,g),Fe(b,Qo,c);const C=Fe(b,ri),x=Pr(Sc);Bt(C,e.numeric,x);const S=Pr(Sc),w=Pr();Bt(S,t,S),Bt(S,n,w),Bt(w,t,S),Bt(w,n,w),Fe(b,fo,S),Fe(x,fo,S);const E=Fe(s,ri),N=Fe(l,ri),$=Fe(N,fo),M=Fe($,fo);Bt(s,e.domain,a),Fe(s,uo,y),Fe(s,kr,g),Bt(l,e.domain,a),Fe(l,uo,y),Fe(l,kr,g),Bt(E,e.domain,S),Fe(E,fo,S),Fe(E,Ws,S),Bt(M,e.domain,S),Bt(M,t,S),Fe(M,fo,S);const R=[[Fs,Hs],[Ou,$u],[Nu,Mu],[Ru,Iu],[Tu,Au],[Pu,ku],[Du,_u],[Lu,ju]];for(let k=0;k<R.length;k++){const[D,A]=R[k],L=Fe(S,D);Fe(w,D,L),Fe(L,A,S);const T=Pr(Sc);Bt(L,t,T);const I=Pr();Bt(L,n),Bt(T,t,T),Bt(T,n,I),Bt(I,t,T),Bt(I,n,I),Fe(T,A,S),Fe(I,A,S)}return Fe(o,ml,b),Fe(o,rv,L9),{start:o,tokens:B$}}function B9(e,t,n){let r=n.length,o=0,i=[],a=[];for(;o<r;){let s=e,l=null,c=null,u=0,d=null,f=-1;for(;o<r&&!(l=s.go(n[o].t));)a.push(n[o++]);for(;o<r&&(c=l||s.go(n[o].t));)l=null,s=c,s.accepts()?(f=0,d=s):f>=0&&f++,o++,u++;if(f<0)o-=u,o<r&&(a.push(n[o]),o++);else{a.length>0&&(i.push(bh(JC,t,a)),a=[]),o-=f,u-=f;const h=d.t,m=n.slice(o-u,o);i.push(bh(h,t,m))}}return a.length>0&&i.push(bh(JC,t,a)),i}function bh(e,t,n){const r=n[0].s,o=n[n.length-1].e,i=t.slice(r,o);return new e(i,n)}const z9=typeof console<"u"&&console&&console.warn||(()=>{}),F9="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",vn={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function H9(){return gr.groups={},vn.scanner=null,vn.parser=null,vn.tokenQueue=[],vn.pluginQueue=[],vn.customSchemes=[],vn.initialized=!1,vn}function QC(e,t=!1){if(vn.initialized&&z9(`linkifyjs: already initialized - will not register custom scheme "${e}" ${F9}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(e))throw new Error(`linkifyjs: incorrect scheme format.
702
702
  1. Must only contain digits, lowercase ASCII letters or "-"
703
703
  2. Cannot start or end with "-"
704
- 3. "-" cannot repeat`);vn.customSchemes.push([e,t])}function V9(){vn.scanner=D9(vn.customSchemes);for(let e=0;e<vn.tokenQueue.length;e++)vn.tokenQueue[e][1]({scanner:vn.scanner});vn.parser=j9(vn.scanner.tokens);for(let e=0;e<vn.pluginQueue.length;e++)vn.pluginQueue[e][1]({scanner:vn.scanner,parser:vn.parser});return vn.initialized=!0,vn}function cv(e){return vn.initialized||V9(),B9(vn.parser.start,e,z$(vn.scanner.start,e))}cv.scan=z$;function H$(e,t=null,n=null){if(t&&typeof t=="object"){if(n)throw Error(`linkifyjs: Invalid link type ${t}; must be a string`);n=t,t=null}const r=new lv(n),o=cv(e),i=[];for(let a=0;a<o.length;a++){const s=o[a];s.isLink&&(!t||s.t===t)&&r.check(s)&&i.push(s.toFormattedObject(r))}return i}var uv="[\0-   ᠎ -\u2029  ]",W9=new RegExp(uv),U9=new RegExp(`${uv}$`),q9=new RegExp(uv,"g");function K9(e){return e.length===1?e[0].isLink:e.length===3&&e[1].isLink?["()","[]"].includes(e[0].value+e[2].value):!1}function G9(e){return new xn({key:new _n("autolink"),appendTransaction:(t,n,r)=>{const o=t.some(c=>c.docChanged)&&!n.doc.eq(r.doc),i=t.some(c=>c.getMeta("preventAutolink"));if(!o||i)return;const{tr:a}=r,s=pT(n.doc,[...t]);if(ST(s).forEach(({newRange:c})=>{const u=gT(r.doc,c,h=>h.isTextblock);let d,f;if(u.length>1)d=u[0],f=r.doc.textBetween(d.pos,d.pos+d.node.nodeSize,void 0," ");else if(u.length){const h=r.doc.textBetween(c.from,c.to," "," ");if(!U9.test(h))return;d=u[0],f=r.doc.textBetween(d.pos,c.to,void 0," ")}if(d&&f){const h=f.split(W9).filter(Boolean);if(h.length<=0)return!1;const m=h[h.length-1],v=d.pos+f.lastIndexOf(m);if(!m)return!1;const g=cv(m).map(y=>y.toObject(e.defaultProtocol));if(!K9(g))return!1;g.filter(y=>y.isLink).map(y=>({...y,from:v+y.start+1,to:v+y.end+1})).filter(y=>r.schema.marks.code?!r.doc.rangeHasMark(y.from,y.to,r.schema.marks.code):!0).filter(y=>e.validate(y.value)).filter(y=>e.shouldAutoLink(y.value)).forEach(y=>{Vm(y.from,y.to,r.doc).some(b=>b.mark.type===e.type)||a.addMark(y.from,y.to,e.type.create({href:y.href}))})}}),!!a.steps.length)return a}})}function X9(e){return new xn({key:new _n("handleClickLink"),props:{handleClick:(t,n,r)=>{var o,i;if(r.button!==0||!t.editable)return!1;let a=null;if(r.target instanceof HTMLAnchorElement)a=r.target;else{const l=r.target;if(!l)return!1;const c=e.editor.view.dom;a=l.closest("a"),a&&!c.contains(a)&&(a=null)}if(!a)return!1;let s=!1;if(e.enableClickSelection&&(s=e.editor.commands.extendMarkRange(e.type.name)),e.openOnClick){const l=jx(t.state,e.type.name),c=(o=a.href)!=null?o:l.href,u=(i=a.target)!=null?i:l.target;c&&(window.open(c,u),s=!0)}return s}}})}function Y9(e){return new xn({key:new _n("handlePasteLink"),props:{handlePaste:(t,n,r)=>{const{shouldAutoLink:o}=e,{state:i}=t,{selection:a}=i,{empty:s}=a;if(s)return!1;let l="";r.content.forEach(u=>{l+=u.textContent});const c=H$(l,{defaultProtocol:e.defaultProtocol}).find(u=>u.isLink&&u.value===l);return!l||!c||o!==void 0&&!o(c.value)?!1:e.editor.commands.setMark(e.type,{href:c.href})}}})}function Mi(e,t){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return t&&t.forEach(r=>{const o=typeof r=="string"?r:r.scheme;o&&n.push(o)}),!e||e.replace(q9,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}var J9=ro.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(e=>{if(typeof e=="string"){QC(e);return}QC(e.scheme,e.optionalSlashes)})},onDestroy(){H9()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(e,t)=>!!Mi(e,t.protocols),validate:e=>!!e,shouldAutoLink:e=>{const t=/^[a-z][a-z0-9+.-]*:\/\//i.test(e),n=/^[a-z][a-z0-9+.-]*:/i.test(e);if(t||n&&!e.includes("@"))return!0;const o=(e.includes("@")?e.split("@").pop():e).split(/[/?#:]/)[0];return!(/^\d{1,3}(\.\d{1,3}){3}$/.test(o)||!/\./.test(o))}}},addAttributes(){return{href:{default:null,parseHTML(e){return e.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:e=>{const t=e.getAttribute("href");return!t||!this.options.isAllowedUri(t,{defaultValidate:n=>!!Mi(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:e}){return this.options.isAllowedUri(e.href,{defaultValidate:t=>!!Mi(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",nn(this.options.HTMLAttributes,e),0]:["a",nn(this.options.HTMLAttributes,{...e,href:""}),0]},markdownTokenName:"link",parseMarkdown:(e,t)=>t.applyMark("link",t.parseInline(e.tokens||[]),{href:e.href,title:e.title||null}),renderMarkdown:(e,t)=>{var n;const r=((n=e.attrs)==null?void 0:n.href)||"";return`[${t.renderChildren(e)}](${r})`},addCommands(){return{setLink:e=>({chain:t})=>{const{href:n}=e;return this.options.isAllowedUri(n,{defaultValidate:r=>!!Mi(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?t().setMark(this.name,e).setMeta("preventAutolink",!0).run():!1},toggleLink:e=>({chain:t})=>{const{href:n}=e||{};return n&&!this.options.isAllowedUri(n,{defaultValidate:r=>!!Mi(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:t().toggleMark(this.name,e,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[mi({find:e=>{const t=[];if(e){const{protocols:n,defaultProtocol:r}=this.options,o=H$(e).filter(i=>i.isLink&&this.options.isAllowedUri(i.value,{defaultValidate:a=>!!Mi(a,n),protocols:n,defaultProtocol:r}));o.length&&o.forEach(i=>{this.options.shouldAutoLink(i.value)&&t.push({text:i.value,data:{href:i.href},index:i.start})})}return t},type:this.type,getAttributes:e=>{var t;return{href:(t=e.data)==null?void 0:t.href}}})]},addProseMirrorPlugins(){const e=[],{protocols:t,defaultProtocol:n}=this.options;return this.options.autolink&&e.push(G9({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:o=>!!Mi(o,t),protocols:t,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),e.push(X9({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick==="whenNotEditable"?!0:this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&e.push(Y9({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),e}}),Q9=J9;const Z9=dn.create({name:"fontSize",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontSize:{default:null,parseHTML:e=>{var t;return(t=e.style.fontSize)==null?void 0:t.replace(/['"]+/g,"")},renderHTML:e=>e.fontSize?{style:`font-size: ${e.fontSize}`}:{}}}}]},addCommands(){return{setFontSize:e=>({chain:t})=>t().setMark("textStyle",{fontSize:e}).run(),unsetFontSize:()=>({chain:e})=>e().setMark("textStyle",{fontSize:null}).removeEmptyTextStyle().run()}}}),eU=dn.create({name:"fontFamily",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontFamily:{default:null,parseHTML:e=>{var t;return(t=e.style.fontFamily)==null?void 0:t.replace(/['"]+/g,"")},renderHTML:e=>e.fontFamily?{style:`font-family: ${e.fontFamily}`}:{}}}}]},addCommands(){return{setFontFamily:e=>({chain:t})=>t().setMark("textStyle",{fontFamily:e}).run(),unsetFontFamily:()=>({chain:e})=>e().setMark("textStyle",{fontFamily:null}).removeEmptyTextStyle().run()}}}),tU=[y9.configure({bulletList:{keepMarks:!0,keepAttributes:!1},orderedList:{keepMarks:!0,keepAttributes:!1}}),t7.configure({color:"#3b82f6",width:2}),n7,L7,_8.configure({types:[LC.name,P$.name]}),LC,eU,Z9,i7.configure({multicolor:!0}),j7,a7,s7,h7.configure({types:["heading","paragraph","tableCell","tableHeader"]}),f7,d7.configure({nested:!0}),N8.configure({resizable:!0,lastColumnResizable:!0,allowTableNodeSelection:!0,HTMLAttributes:{class:"table-wrapper"}}),c7,l7,R8.configure({HTMLAttributes:{class:"table-cell"}}),E9.configure({inline:!1,allowBase64:!0}),$9.configure({inline:!1}),x9,Q9.extend({addAttributes(){var e;return{...(e=this.parent)==null?void 0:e.call(this),style:{default:null,parseHTML:t=>t.getAttribute("style"),renderHTML:t=>t.style?{style:t.style}:{}},class:{default:null,parseHTML:t=>t.getAttribute("class"),renderHTML:t=>t.class?{class:t.class}:{}}}}}).configure({openOnClick:!1,autolink:!0,defaultProtocol:"https"})],nU={"cyber-editor":"_cyber-editor_1isyx_1"};function dv({content:e="",slotBefore:t=!1,className:n="",editorClassName:r="",editable:o=!0,onChange:i}){const[a,s]=O.useState(""),[l,c]=O.useState(!1),[u,d]=O.useState(null),f=yA({extensions:tU,content:e,editable:o,onUpdate:({editor:g})=>{i==null||i(g.getHTML())}});if(O.useEffect(()=>{f&&e!==f.getHTML()&&f.commands.setContent(e,!1)},[f,e]),!f)return j.jsx(sN,{full:!0});O.useEffect(()=>{const g=f.getHTML();if(l){const y=h(a);if(y){d(y);return}let b=a||"";b.trim()||(b=m(g));const C=KA.sanitize(b);s(C),d(null)}else a||f.commands.setContent(g,!1)},[l]);const h=g=>{try{return new DOMParser().parseFromString(g,"text/html").querySelector("parsererror")?"Invalid HTML structure":null}catch{return"Invalid HTML format"}};function m(g){const y=document.createElement("textarea");return y.innerHTML=g,y.value.replace(/^<p>/i,"").replace(/<\/p>$/i,"").trim()}function v(){f&&(l?(f.commands.setContent(a,!1),d(null)):s(f.getHTML()),c(!l))}return j.jsx(j.Fragment,{children:j.jsxs("div",{className:te(nU["cyber-editor"],n),children:[t&&j.jsx(k8,{editor:f,htmlMode:l,toggleHTML:v}),l?j.jsx("textarea",{value:a,onChange:g=>s(g.target.value),className:"w-full min-h-[120px] resize-none overflow-hidden font-mono text-sm outline-none focus:outline-none focus:ring-0 "+r,spellCheck:!1}):a?j.jsx("iframe",{className:"w-full "+r,srcDoc:`
704
+ 3. "-" cannot repeat`);vn.customSchemes.push([e,t])}function V9(){vn.scanner=D9(vn.customSchemes);for(let e=0;e<vn.tokenQueue.length;e++)vn.tokenQueue[e][1]({scanner:vn.scanner});vn.parser=j9(vn.scanner.tokens);for(let e=0;e<vn.pluginQueue.length;e++)vn.pluginQueue[e][1]({scanner:vn.scanner,parser:vn.parser});return vn.initialized=!0,vn}function cv(e){return vn.initialized||V9(),B9(vn.parser.start,e,z$(vn.scanner.start,e))}cv.scan=z$;function H$(e,t=null,n=null){if(t&&typeof t=="object"){if(n)throw Error(`linkifyjs: Invalid link type ${t}; must be a string`);n=t,t=null}const r=new lv(n),o=cv(e),i=[];for(let a=0;a<o.length;a++){const s=o[a];s.isLink&&(!t||s.t===t)&&r.check(s)&&i.push(s.toFormattedObject(r))}return i}var uv="[\0-   ᠎ -\u2029  ]",W9=new RegExp(uv),U9=new RegExp(`${uv}$`),q9=new RegExp(uv,"g");function K9(e){return e.length===1?e[0].isLink:e.length===3&&e[1].isLink?["()","[]"].includes(e[0].value+e[2].value):!1}function G9(e){return new xn({key:new _n("autolink"),appendTransaction:(t,n,r)=>{const o=t.some(c=>c.docChanged)&&!n.doc.eq(r.doc),i=t.some(c=>c.getMeta("preventAutolink"));if(!o||i)return;const{tr:a}=r,s=pT(n.doc,[...t]);if(ST(s).forEach(({newRange:c})=>{const u=gT(r.doc,c,h=>h.isTextblock);let d,f;if(u.length>1)d=u[0],f=r.doc.textBetween(d.pos,d.pos+d.node.nodeSize,void 0," ");else if(u.length){const h=r.doc.textBetween(c.from,c.to," "," ");if(!U9.test(h))return;d=u[0],f=r.doc.textBetween(d.pos,c.to,void 0," ")}if(d&&f){const h=f.split(W9).filter(Boolean);if(h.length<=0)return!1;const m=h[h.length-1],v=d.pos+f.lastIndexOf(m);if(!m)return!1;const g=cv(m).map(y=>y.toObject(e.defaultProtocol));if(!K9(g))return!1;g.filter(y=>y.isLink).map(y=>({...y,from:v+y.start+1,to:v+y.end+1})).filter(y=>r.schema.marks.code?!r.doc.rangeHasMark(y.from,y.to,r.schema.marks.code):!0).filter(y=>e.validate(y.value)).filter(y=>e.shouldAutoLink(y.value)).forEach(y=>{Vm(y.from,y.to,r.doc).some(b=>b.mark.type===e.type)||a.addMark(y.from,y.to,e.type.create({href:y.href}))})}}),!!a.steps.length)return a}})}function X9(e){return new xn({key:new _n("handleClickLink"),props:{handleClick:(t,n,r)=>{var o,i;if(r.button!==0||!t.editable)return!1;let a=null;if(r.target instanceof HTMLAnchorElement)a=r.target;else{const l=r.target;if(!l)return!1;const c=e.editor.view.dom;a=l.closest("a"),a&&!c.contains(a)&&(a=null)}if(!a)return!1;let s=!1;if(e.enableClickSelection&&(s=e.editor.commands.extendMarkRange(e.type.name)),e.openOnClick){const l=jx(t.state,e.type.name),c=(o=a.href)!=null?o:l.href,u=(i=a.target)!=null?i:l.target;c&&(window.open(c,u),s=!0)}return s}}})}function Y9(e){return new xn({key:new _n("handlePasteLink"),props:{handlePaste:(t,n,r)=>{const{shouldAutoLink:o}=e,{state:i}=t,{selection:a}=i,{empty:s}=a;if(s)return!1;let l="";r.content.forEach(u=>{l+=u.textContent});const c=H$(l,{defaultProtocol:e.defaultProtocol}).find(u=>u.isLink&&u.value===l);return!l||!c||o!==void 0&&!o(c.value)?!1:e.editor.commands.setMark(e.type,{href:c.href})}}})}function Mi(e,t){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return t&&t.forEach(r=>{const o=typeof r=="string"?r:r.scheme;o&&n.push(o)}),!e||e.replace(q9,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}var J9=ro.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(e=>{if(typeof e=="string"){QC(e);return}QC(e.scheme,e.optionalSlashes)})},onDestroy(){H9()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(e,t)=>!!Mi(e,t.protocols),validate:e=>!!e,shouldAutoLink:e=>{const t=/^[a-z][a-z0-9+.-]*:\/\//i.test(e),n=/^[a-z][a-z0-9+.-]*:/i.test(e);if(t||n&&!e.includes("@"))return!0;const o=(e.includes("@")?e.split("@").pop():e).split(/[/?#:]/)[0];return!(/^\d{1,3}(\.\d{1,3}){3}$/.test(o)||!/\./.test(o))}}},addAttributes(){return{href:{default:null,parseHTML(e){return e.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:e=>{const t=e.getAttribute("href");return!t||!this.options.isAllowedUri(t,{defaultValidate:n=>!!Mi(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:e}){return this.options.isAllowedUri(e.href,{defaultValidate:t=>!!Mi(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",nn(this.options.HTMLAttributes,e),0]:["a",nn(this.options.HTMLAttributes,{...e,href:""}),0]},markdownTokenName:"link",parseMarkdown:(e,t)=>t.applyMark("link",t.parseInline(e.tokens||[]),{href:e.href,title:e.title||null}),renderMarkdown:(e,t)=>{var n;const r=((n=e.attrs)==null?void 0:n.href)||"";return`[${t.renderChildren(e)}](${r})`},addCommands(){return{setLink:e=>({chain:t})=>{const{href:n}=e;return this.options.isAllowedUri(n,{defaultValidate:r=>!!Mi(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?t().setMark(this.name,e).setMeta("preventAutolink",!0).run():!1},toggleLink:e=>({chain:t})=>{const{href:n}=e||{};return n&&!this.options.isAllowedUri(n,{defaultValidate:r=>!!Mi(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:t().toggleMark(this.name,e,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[mi({find:e=>{const t=[];if(e){const{protocols:n,defaultProtocol:r}=this.options,o=H$(e).filter(i=>i.isLink&&this.options.isAllowedUri(i.value,{defaultValidate:a=>!!Mi(a,n),protocols:n,defaultProtocol:r}));o.length&&o.forEach(i=>{this.options.shouldAutoLink(i.value)&&t.push({text:i.value,data:{href:i.href},index:i.start})})}return t},type:this.type,getAttributes:e=>{var t;return{href:(t=e.data)==null?void 0:t.href}}})]},addProseMirrorPlugins(){const e=[],{protocols:t,defaultProtocol:n}=this.options;return this.options.autolink&&e.push(G9({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:o=>!!Mi(o,t),protocols:t,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),e.push(X9({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick==="whenNotEditable"?!0:this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&e.push(Y9({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),e}}),Q9=J9;const Z9=dn.create({name:"fontSize",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontSize:{default:null,parseHTML:e=>{var t;return(t=e.style.fontSize)==null?void 0:t.replace(/['"]+/g,"")},renderHTML:e=>e.fontSize?{style:`font-size: ${e.fontSize}`}:{}}}}]},addCommands(){return{setFontSize:e=>({chain:t})=>t().setMark("textStyle",{fontSize:e}).run(),unsetFontSize:()=>({chain:e})=>e().setMark("textStyle",{fontSize:null}).removeEmptyTextStyle().run()}}}),eU=dn.create({name:"fontFamily",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontFamily:{default:null,parseHTML:e=>{var t;return(t=e.style.fontFamily)==null?void 0:t.replace(/['"]+/g,"")},renderHTML:e=>e.fontFamily?{style:`font-family: ${e.fontFamily}`}:{}}}}]},addCommands(){return{setFontFamily:e=>({chain:t})=>t().setMark("textStyle",{fontFamily:e}).run(),unsetFontFamily:()=>({chain:e})=>e().setMark("textStyle",{fontFamily:null}).removeEmptyTextStyle().run()}}}),tU=[y9.configure({bulletList:{keepMarks:!0,keepAttributes:!1},orderedList:{keepMarks:!0,keepAttributes:!1}}),t7.configure({color:"#3b82f6",width:2}),n7,L7,_8.configure({types:[LC.name,P$.name]}),LC,eU,Z9,i7.configure({multicolor:!0}),j7,a7,s7,h7.configure({types:["heading","paragraph","tableCell","tableHeader"]}),f7,d7.configure({nested:!0}),N8.configure({resizable:!0,lastColumnResizable:!0,allowTableNodeSelection:!0,HTMLAttributes:{class:"table-wrapper"}}),c7,l7,R8.configure({HTMLAttributes:{class:"table-cell"}}),E9.configure({inline:!1,allowBase64:!0}),$9.configure({inline:!1}),x9,Q9.extend({addAttributes(){var e;return{...(e=this.parent)==null?void 0:e.call(this),style:{default:null,parseHTML:t=>t.getAttribute("style"),renderHTML:t=>t.style?{style:t.style}:{}},class:{default:null,parseHTML:t=>t.getAttribute("class"),renderHTML:t=>t.class?{class:t.class}:{}}}}}).configure({openOnClick:!1,autolink:!0,defaultProtocol:"https"})],nU={"cyber-editor":"_cyber-editor_1isyx_1"};function dv({content:e="",slotBefore:t=!1,className:n="",editorClassName:r="",editable:o=!0,onChange:i}){const[a,s]=O.useState(""),[l,c]=O.useState(!1),[u,d]=O.useState(null),f=yA({extensions:tU,content:e,editable:o,onUpdate:({editor:g})=>{i==null||i(g.getHTML())}});if(O.useEffect(()=>{f&&e!==f.getHTML()&&f.commands.setContent(e,!1)},[f,e]),O.useEffect(()=>{if(!f)return;const g=f.getHTML();if(l){const y=h(a);if(y){d(y);return}let b=a||"";b.trim()||(b=m(g));const C=KA.sanitize(b);s(C),d(null)}else a||f.commands.setContent(g,!1)},[l,f]),!f)return j.jsx(sN,{full:!0});const h=g=>{try{return new DOMParser().parseFromString(g,"text/html").querySelector("parsererror")?"Invalid HTML structure":null}catch{return"Invalid HTML format"}};function m(g){const y=document.createElement("textarea");return y.innerHTML=g,y.value.replace(/^<p>/i,"").replace(/<\/p>$/i,"").trim()}function v(){f&&c(!l)}return j.jsx(j.Fragment,{children:j.jsxs("div",{className:te(nU["cyber-editor"],n),children:[t&&j.jsx(k8,{editor:f,htmlMode:l,toggleHTML:v}),l?j.jsx("textarea",{value:a,onChange:g=>s(g.target.value),className:"w-full min-h-[120px] resize-none overflow-hidden font-mono text-sm outline-none focus:outline-none focus:ring-0 "+r,spellCheck:!1}):a?j.jsx("iframe",{className:"w-full "+r,srcDoc:`
705
705
  <html>
706
706
  <head>
707
707
  <meta charset="utf-8" />
@@ -51287,7 +51287,7 @@ function F9({
51287
51287
  }
51288
51288
  )
51289
51289
  ] }),
51290
- T ? /* @__PURE__ */ L.jsx(
51290
+ T ? (r || d) && /* @__PURE__ */ L.jsx(
51291
51291
  Ci,
51292
51292
  {
51293
51293
  placeholder: "Add a caption...",
@@ -51307,7 +51307,7 @@ const H9 = Mn.create({
51307
51307
  name: "image",
51308
51308
  addOptions() {
51309
51309
  return {
51310
- inline: !1,
51310
+ inline: !0,
51311
51311
  allowBase64: !0,
51312
51312
  HTMLAttributes: {}
51313
51313
  };
@@ -52839,9 +52839,8 @@ function tN({
52839
52839
  });
52840
52840
  if (Gt(() => {
52841
52841
  f && e !== f.getHTML() && f.commands.setContent(e, !1);
52842
- }, [f, e]), !f)
52843
- return /* @__PURE__ */ L.jsx(ON, { full: !0 });
52844
- Gt(() => {
52842
+ }, [f, e]), Gt(() => {
52843
+ if (!f) return;
52845
52844
  const g = f.getHTML();
52846
52845
  if (l) {
52847
52846
  const y = h(a);
@@ -52855,7 +52854,8 @@ function tN({
52855
52854
  s(C), d(null);
52856
52855
  } else
52857
52856
  a || f.commands.setContent(g, !1);
52858
- }, [l]);
52857
+ }, [l, f]), !f)
52858
+ return /* @__PURE__ */ L.jsx(ON, { full: !0 });
52859
52859
  const h = (g) => {
52860
52860
  try {
52861
52861
  return new DOMParser().parseFromString(g, "text/html").querySelector("parsererror") ? "Invalid HTML structure" : null;
@@ -52868,7 +52868,7 @@ function tN({
52868
52868
  return y.innerHTML = g, y.value.replace(/^<p>/i, "").replace(/<\/p>$/i, "").trim();
52869
52869
  }
52870
52870
  function v() {
52871
- f && (l ? (f.commands.setContent(a, !1), d(null)) : s(f.getHTML()), c(!l));
52871
+ f && c(!l);
52872
52872
  }
52873
52873
  return /* @__PURE__ */ L.jsx(L.Fragment, { children: /* @__PURE__ */ L.jsxs("div", { className: te(CU["cyber-editor"], n), children: [
52874
52874
  t && /* @__PURE__ */ L.jsx(
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cyberskill/cyber-editor",
3
3
  "type": "module",
4
- "version": "4.0.2",
4
+ "version": "4.0.3",
5
5
  "description": "Update version tailwind v4 and plugin",
6
6
  "exports": {
7
7
  ".": {