const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=[window.OC.filePath('text', '', 'js/MarkdownContentEditor-BIE3VNe9.chunk.mjs'),window.OC.filePath('text', '', 'js/Wrapper-CqIk4X_U.chunk.mjs'),window.OC.filePath('text', '', 'js/vue.runtime.esm-BrouV0Mr.chunk.mjs'),window.OC.filePath('text', '', 'js/RichText-B-Pa3JKG.chunk.mjs'),window.OC.filePath('text', '', 'js/_plugin-vue2_normalizer-Dv5JCS6y.chunk.mjs'),window.OC.filePath('text', '', 'js/public-C42pM6E9.chunk.mjs'),window.OC.filePath('text', '', 'js/emoji-picker-Coav-X6q.chunk.mjs'),window.OC.filePath('text', '', 'js/index-CJ7wDv5l.chunk.mjs'),window.OC.filePath('text', '', 'css/public-BffjDTy3.chunk.css'),window.OC.filePath('text', '', 'js/index-jVSJWteM.chunk.mjs'),window.OC.filePath('text', '', 'js/modulepreload-polyfill-DCUwxYMh.chunk.mjs'),window.OC.filePath('text', '', 'js/index-DtTpkYe5.chunk.mjs'),window.OC.filePath('text', '', 'css/_plugin-vue2_normalizer-hk4lAjcj.chunk.css'),window.OC.filePath('text', '', 'js/index-BlLlZtv2.chunk.mjs'),window.OC.filePath('text', '', 'js/MediaHandler.provider-i78Kd03y.chunk.mjs'),window.OC.filePath('text', '', 'js/logger-YW53u4Eu.chunk.mjs'),window.OC.filePath('text', '', 'js/_plugin-vue2_normalizer-CQ6iBklL-CXuhKXxu.chunk.mjs'),window.OC.filePath('text', '', 'css/RichText-Bm-LyHxA.chunk.css'),window.OC.filePath('text', '', 'js/index-Dn5gYZF5.chunk.mjs'),window.OC.filePath('text', '', 'css/Wrapper-BnqW3NBY.chunk.css'),window.OC.filePath('text', '', 'css/MarkdownContentEditor-DbRr9cV9.chunk.css'),window.OC.filePath('text', '', 'js/Editor-k2haaK4F.chunk.mjs'),window.OC.filePath('text', '', 'js/index-CUHCybQH.chunk.mjs'),window.OC.filePath('text', '', 'js/_commonjs-dynamic-modules-Cdb4quZm.chunk.mjs'),window.OC.filePath('text', '', 'css/Editor-CoC9cVO3.chunk.css')])))=>i.map(i=>d[i]);
var T=o=>{throw TypeError(o)};var v=(o,t,e)=>t.has(o)||T("Cannot "+e);var n=(o,t,e)=>(v(o,t,"read from private field"),e?e.call(o):t.get(o)),y=(o,t,e)=>t.has(o)?T("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(o):t.set(o,e),g=(o,t,e,i)=>(v(o,t,"write to private field"),i?i.call(o,e):t.set(o,e),e),a=(o,t,e)=>(v(o,t,"access private method"),e);import{_ as b,s as R}from"./modulepreload-polyfill-DCUwxYMh.chunk.mjs";import{V as m}from"./vue.runtime.esm-BrouV0Mr.chunk.mjs";import{s as V}from"./index-BlLlZtv2.chunk.mjs";import{A as D,E as H,H as N,a as U,b as Y}from"./MediaHandler.provider-i78Kd03y.chunk.mjs";import"./emoji-picker-Coav-X6q.chunk.mjs";import"./index-jVSJWteM.chunk.mjs";import"./logger-YW53u4Eu.chunk.mjs";import"./index-DtTpkYe5.chunk.mjs";const F="1.2";m.prototype.t=window.t,m.prototype.n=window.n,m.prototype.OCA=window.OCA,window.OCA.Text={...window.OCA.Text};var r,u,s,h,_;class Q{constructor(t,e){y(this,s);y(this,r);y(this,u);return g(this,r,t),g(this,u,e),a(this,s,_).call(this),this}onCreate(t=()=>{}){return n(this,r).$on("create:content",e=>{t(e)}),this}onLoaded(t=()=>{}){return n(this,r).$on("ready",()=>{t()}),this}onUpdate(t=()=>{}){return n(this,r).$on("update:content",e=>{t(e)}),this}onOutlineToggle(t=()=>{}){return n(this,r).$on("outline-toggled",e=>{t(e)}),this}onSearch(t=()=>{}){return R("text:editor:search-results",t),this}render(t){t.innerHTML="";const e=document.createElement("div");return t.appendChild(e),n(this,r).$mount(e),this}destroy(){n(this,r).$destroy(),n(this,r).$el.innerHTML=""}setContent(t){var e,i;return n(this,r).$set(n(this,u),"content",t),(i=(e=a(this,s,h).call(this))==null?void 0:e.setContent)==null||i.call(e,t),this}setSearchQuery(t,e){var i;((i=a(this,s,h).call(this))==null?void 0:i.$editor).commands.setSearchQuery(t,e)}searchNext(){var t;((t=a(this,s,h).call(this))==null?void 0:t.$editor).commands.nextMatch()}searchPrevious(){var t;((t=a(this,s,h).call(this))==null?void 0:t.$editor).commands.previousMatch()}async save(){var t,e;return(e=(t=a(this,s,h).call(this)).save)==null?void 0:e.call(t)}setShowOutline(t){return n(this,r).$set(n(this,u),"showOutlineOutside",t),this}setReadOnly(t){return n(this,r).$set(n(this,u),"readOnly",t),this}updateReadonlyBarProps(t){return n(this,r).$set(n(this,u),"readonlyBarProps",t),this}insertAtCursor(t){a(this,s,h).call(this).$editor.chain().insertContent(t).focus().run()}focus(){a(this,s,h).call(this).$editor.commands.focus()}debugYjs(){const t=a(this,s,h).call(this).debugYjsData();console.warn(JSON.stringify(t,null," ")),console.warn("%c%s\n%c%s\n%s","font-weight: bold;",'Editor Yjs debug data. Copy the object below that starts with "clientId".',"font-weight: normal; font-style: italic;",'- In Chrome, select "Copy" at the end of the line.','- In Firefox, right-click on the object and select "Copy object".')}}r=new WeakMap,u=new WeakMap,s=new WeakSet,h=function(){return n(this,r).$children[0]},_=function(){var t;window!=null&&window._oc_debug&&(this.vm=n(this,r),window.OCA.Text._debug=[...(t=window.OCA.Text._debug)!=null?t:[],this])};window.OCA.Text.apiVersion=F,window.OCA.Text.createEditor=async function({el:o,fileId:t=void 0,useSession:e=!0,filePath:i=void 0,shareToken:f=null,content:C="",readOnly:$=!1,autofocus:x=!0,readonlyBar:l={component:null,props:null},onCreate:A=({markdown:w})=>{},onLoaded:S=()=>{},onUpdate:I=({markdown:w})=>{},onOutlineToggle:P=w=>{},onFileInsert:E=void 0,onMentionSearch:k=void 0,onMentionInsert:L=void 0,onSearch:M=void 0}){const{default:w}=await b(async()=>{const{default:d}=await import("./MarkdownContentEditor-BIE3VNe9.chunk.mjs");return{default:d}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]),import.meta.url),{default:j}=await b(async()=>{const{default:d}=await import("./Editor-k2haaK4F.chunk.mjs").then(p=>p.b);return{default:d}},__vite__mapDeps([21,10,6,2,7,22,16,5,8,11,9,3,4,12,13,14,15,17,1,18,19,23,24]),import.meta.url),c=m.observable({showOutlineOutside:!1,readonlyBarProps:l.props,readOnly:$,content:C}),O=t&&e,B=new m({provide(){return{[D]:E,[H]:!!O,[N]:O?!0:k,[U]:O?!0:L,[Y]:{resolve(d,p){return[{type:"image",url:d}]}}}},data(){return c},render:d=>{const p=l!=null&&l.component?{readonlyBar:()=>d(l.component,{props:c.readonlyBarProps})}:{};return O?d(j,{props:{fileId:t,relativePath:i,shareToken:f,mime:"text/markdown",active:!0,autofocus:x,showOutlineOutside:c.showOutlineOutside},scopedSlots:p}):d(w,{props:{fileId:t,content:c.content,relativePath:i,shareToken:f,readOnly:c.readOnly,showOutlineOutside:c.showOutlineOutside},scopedSlots:p})},store:V});return new Q(B,c).onCreate(A).onLoaded(S).onUpdate(I).onOutlineToggle(P).onSearch(M).render(o)};
