const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=[window.OC.filePath('text', '', 'js/Editor-CT2H8SzY.chunk.mjs'),window.OC.filePath('text', '', 'js/modulepreload-polyfill-DCUwxYMh.chunk.mjs'),window.OC.filePath('text', '', 'js/emoji-picker-Coav-X6q.chunk.mjs'),window.OC.filePath('text', '', 'js/vue.runtime.esm-BrouV0Mr.chunk.mjs'),window.OC.filePath('text', '', 'js/index-CJ7wDv5l.chunk.mjs'),window.OC.filePath('text', '', 'js/RichText-C3pQieVL.chunk.mjs'),window.OC.filePath('text', '', 'js/_plugin-vue2_normalizer-DLE8eHQU.chunk.mjs'),window.OC.filePath('text', '', 'js/public-CX3DIv4G.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/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-DG30ZWXQ.chunk.mjs'),window.OC.filePath('text', '', 'css/RichText-Bm-LyHxA.chunk.css'),window.OC.filePath('text', '', 'js/Wrapper-sgJnoJTT.chunk.mjs'),window.OC.filePath('text', '', 'js/index-CGAoxidy.chunk.mjs'),window.OC.filePath('text', '', 'css/Wrapper-BnqW3NBY.chunk.css'),window.OC.filePath('text', '', 'js/_commonjs-dynamic-modules-Cdb4quZm.chunk.mjs'),window.OC.filePath('text', '', 'css/Editor-CsDvpUUI.chunk.css')])))=>i.map(i=>d[i]);
import{_ as d,s as c,e as u}from"./modulepreload-polyfill-DCUwxYMh.chunk.mjs";import{l as s}from"./index-CJ7wDv5l.chunk.mjs";import{registerFileActionFallback as f,registerFileCreate as h}from"./files-BvzqRH5l.chunk.mjs";import{l as g}from"./logger-YW53u4Eu.chunk.mjs";import{o as w}from"./mime-L6mwwXGo.chunk.mjs";import{s as p}from"./index-BlLlZtv2.chunk.mjs";import y from"./RichWorkspace-Brye2NUu.chunk.mjs";import"./emoji-picker-Coav-X6q.chunk.mjs";import"./_plugin-vue2_normalizer-CQ6iBklL-DG30ZWXQ.chunk.mjs";import"./public-CX3DIv4G.chunk.mjs";import"./vue.runtime.esm-BrouV0Mr.chunk.mjs";import"./index-DFzk44L7.chunk.mjs";import"./index-DtTpkYe5.chunk.mjs";import"./index-jVSJWteM.chunk.mjs";import"./token-DsHNcSTq.chunk.mjs";import"./Editor.singleton-CQQiu10J.chunk.mjs";import"./RichTextReader-CyfCN_3r.chunk.mjs";import"./BaseReader-CryzRCih.chunk.mjs";import"./RichText-C3pQieVL.chunk.mjs";import"./_plugin-vue2_normalizer-DLE8eHQU.chunk.mjs";import"./MediaHandler.provider-i78Kd03y.chunk.mjs";const _=function(e){const i=()=>setTimeout(e,0);(document.attachEvent?document.readyState==="complete":document.readyState!=="loading")?i():document.addEventListener("DOMContentLoaded",e)},E={attach(e){const i=e.fileList,r=t("text","Readme")+"."+s("text","default_file_extension");i.id!=="files"&&i.id!=="files.public"||e.addMenuEntry({id:"rich-workspace-init",displayName:t("text","Add folder description"),templateName:r,iconClass:"icon-add-folder-description",fileType:"file",useInput:!1,actionHandler(){return window.FileList.createFile(r,{scrollTo:!1,animate:!1}).then(()=>u("Text::showRichWorkspace",{autofocus:!0}))},shouldShow(){return!i.findFile(r)}})}},v={el:null,attach(e){e.id!=="files"&&e.id!=="files.public"||(this.el=document.createElement("div"),e.registerHeader({id:"workspace",el:this.el,render:this.render.bind(this),priority:10}))},render(e){e.id!=="files"&&e.id!=="files.public"||(OC.Plugins.register("OCA.Files.NewFileMenu",E),d(()=>import("./vue.runtime.esm-BrouV0Mr.chunk.mjs").then(i=>i.v),[],import.meta.url).then(i=>{const r=i.default;this.el.id="files-workspace-wrapper",r.prototype.t=window.t,r.prototype.n=window.n,r.prototype.OCA=window.OCA;const a=r.extend(y),n=new a({propsData:{path:e.getCurrentDirectory(),hasRichWorkspace:!0},store:p}).$mount(this.el);c("files:navigation:changed",()=>{n.active=OCA.Files.App.getCurrentFileList()===e}),e.$el.on("urlChanged",o=>{n.path=o.dir.toString()}),e.$el.on("changeDirectory",o=>{n.path=o.dir.toString()})}))}},C=({sharingToken:e,mimetype:i,fileId:r,$el:a})=>{const n=document.createElement("div");n.id="texteditor",document.getElementById("app-content").appendChild(n),Promise.all([d(()=>import("./vue.runtime.esm-BrouV0Mr.chunk.mjs").then(o=>o.v),[],import.meta.url),d(()=>import("./Editor-CT2H8SzY.chunk.mjs").then(o=>o.b),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21]),import.meta.url)]).then(([o,l])=>({Vue:o.default,Editor:l.default})).then(({Vue:o,Editor:l})=>{o.prototype.t=window.t,o.prototype.OCA=window.OCA,new o({render:m=>m(l,{props:{active:!0,shareToken:e,mime:i,fileId:r}}),store:p}).$mount(a)}).catch(o=>g.error("Failed to attach editor",{error:o}))};_(()=>{var r;const e=document.getElementById("sharingToken")?document.getElementById("sharingToken").value:null;if(!e)return;if(document.querySelector("#preview table.files-filestable")){OC.Plugins.register("OCA.Files.FileList",v),f(),h();return}const i=(r=document.getElementById("mimetype"))==null?void 0:r.value;if(i&&w.indexOf(i)!==-1){const a=document.getElementById("preview"),n=s("text","file_id");C({mimetype:i,sharingToken:e,fileId:n,$el:a})}}),OCA.Text={RichWorkspaceEnabled:s("text","workspace_available")};
