import{l as r}from"./index-D3wiQe9-.chunk.mjs";import{g as a}from"./index-DxwFe63_.chunk.mjs";import{l as s}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+"#")},l=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"),k=Symbol("hook:mention-insert"),u=Symbol("editor:open-link-handler"),C=Symbol("menubar:link-custom-action"),L={inject:{$isMobile:{from:d,default:!1}}},R={inject:{$file:{from:c,default:()=>({fileId:0,relativePath:null,document:null})}}},O={inject:{$attachmentResolver:{from:m,default:{resolve(o){return s.warn("No attachment resolver provided. Some attachment sources cannot be resolved."),[o]}}}}},U={inject:{$editorUpload:{from:f,default:!0}}},I={inject:{$openLinkHandler:{from:u,default:{openLink:l}}}},h=Symbol("state:uploading-state"),p=Symbol("editor:action:attachment-prompt"),w=Symbol("editor:action:upload-attachment"),b=Symbol("editor:action:create-attachment"),W={inject:{$uploadingState:{from:h,default:{isUploadingAttachments:!1}}}},x={inject:{$callAttachmentPrompt:{from:p,default:()=>{}}}},H={inject:{$callChooseLocalAttachment:{from:w,default:()=>{}}}},P={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,k as a,j as b,p as c,H as d,R as e,U as f,x as g,W as h,P as i,I as j,y as k,$ as l,O as m,b as n,l as o,A as p,w as q,L as u};
//# sourceMappingURL=MediaHandler.provider-RFEKrnRQ.chunk.mjs.map
