import{l as r}from"./index-D3wiQe9-.chunk.mjs";import{g as a}from"./index-DCzdQJ7L.chunk.mjs";import{l}from"./logger-DS8A9d_w.chunk.mjs";const y=function(o,e){const t=o.attrs.href;if(!t||!window.OCA?.Viewer||t.match(/^[a-zA-Z]*:/)||t.startsWith("#")||r("core","active-app","")==="collectives"||t.includes("/apps/collectives/"))return t;const n=t.match(/^([^?]*)\?fileId=(\d+)/);if(n){const[,,i]=n;return new URL(a(`/f/${i}`),window.origin).href}return t},A=function(o){const e=o.getAttribute("href");if(!e)return e;const t=e.match(/\?dir=([^&]*)&openfile=([^&]*)#relPath=([^&]*)/);if(t){const[,,n]=t;return new URL(a(`/f/${n}`),window.origin).href}return e},$=function(o){const e=window.location.origin+window.location.pathname+window.location.search;return o?.startsWith("#")||o?.startsWith(e+"#")},s=function(o){const e=new URL(o,window.location.href),t="/apps/collectives";if(window.OCA.Collectives?.vueRouter&&e.pathname.toString().startsWith(a(t))){const n=e.href.substring(e.href.indexOf(t)+t.length);window.OCA.Collectives.vueRouter.push(n);return}window.open(e,"_blank")},c=Symbol("editor:file"),m=Symbol("attachment:resolver"),d=Symbol("editor:is-mobile"),f=Symbol("editor:upload"),j=Symbol("hook:mention-search"),C=Symbol("hook:mention-insert"),u=Symbol("editor:open-link-handler"),k={inject:{$isMobile:{from:d,default:!1}}},L={inject:{$file:{from:c,default:()=>({fileId:0,relativePath:null,document:null})}}},R={inject:{$attachmentResolver:{from:m,default:{resolve(o){return l.warn("No attachment resolver provided. Some attachment sources cannot be resolved."),[o]}}}}},O={inject:{$editorUpload:{from:f,default:!0}}},U={inject:{$openLinkHandler:{from:u,default:{openLink:s}}}},h=Symbol("state:uploading-state"),p=Symbol("editor:action:attachment-prompt"),w=Symbol("editor:action:upload-attachment"),b=Symbol("editor:action:create-attachment"),I={inject:{$uploadingState:{from:h,default:{isUploadingAttachments:!1}}}},W={inject:{$callAttachmentPrompt:{from:p,default:()=>{}}}},x={inject:{$callChooseLocalAttachment:{from:w,default:()=>{}}}},H={inject:{$callCreateAttachment:{from:b,default:()=>o=>{}}}};export{m as A,f as E,c as F,C as H,d as I,u as O,h as S,j as a,p as b,x as c,L as d,O as e,W as f,I as g,H as h,U as i,y as j,$ as k,R as l,b as m,w as n,s as o,A as p,k as u}; //# sourceMappingURL=MediaHandler.provider-BoQN9QHH.chunk.mjs.map