function _(e,t,r){const s=`#initial-state-${e}-${t}`;if(window._nc_initial_state?.has(s))return window._nc_initial_state.get(s);window._nc_initial_state||(window._nc_initial_state=new Map);const l=document.querySelector(s);if(l===null){if(r!==void 0)return r;throw new Error(`Could not find initial state ${t} of ${e}`)}try{const i=JSON.parse(atob(l.value));return window._nc_initial_state.set(s,i),i}catch(i){if(console.error("[@nextcloud/initial-state] Could not parse initial state",{key:t,app:e,error:i}),r!==void 0)return r;throw new Error(`Could not parse initial state ${t} of ${e}`,{cause:i})}}const v=(e,t)=>{const r=e.__vccOpts||e;for(const[s,l]of t)r[s]=l;return r},g="modulepreload",m=function(e,t){return new URL(e,t).href},w={},y=function(e,t,r){let s=Promise.resolve();if(t&&t.length>0){let i=function(n){return Promise.all(n.map(u=>Promise.resolve(u).then(f=>({status:"fulfilled",value:f}),f=>({status:"rejected",reason:f}))))};const o=document.getElementsByTagName("link"),d=document.querySelector("meta[property=csp-nonce]"),a=d?.nonce||d?.getAttribute("nonce");s=i(t.map(n=>{if(n=m(n,r),n in w)return;w[n]=!0;const u=n.endsWith(".css"),f=u?'[rel="stylesheet"]':"";if(r)for(let p=o.length-1;p>=0;p--){const h=o[p];if(h.href===n&&(!u||h.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${n}"]${f}`))return;const c=document.createElement("link");if(c.rel=u?"stylesheet":g,u||(c.as="script"),c.crossOrigin="",c.href=n,a&&c.setAttribute("nonce",a),document.head.appendChild(c),u)return new Promise((p,h)=>{c.addEventListener("load",p),c.addEventListener("error",()=>h(new Error(`Unable to preload CSS for ${n}`)))})}))}function l(i){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=i,window.dispatchEvent(o),!o.defaultPrevented)throw i}return s.then(i=>{for(const o of i||[])o.status==="rejected"&&l(o.reason);return e().catch(l)})};function E(){try{return _("core","capabilities")}catch{return console.debug("Could not find capabilities initial state fall back to _oc_capabilities"),"_oc_capabilities"in window?window._oc_capabilities:{}}}function $(e){return e&&e.split("/").map(encodeURIComponent).join("/")}function b(e,t){return e=e.replace(/\\/g,"/").replace(/\/+$/g,"").replace(/.*\//,""),e}function C(e){e=e.replaceAll(/\\/g,"/");const t=e.split("/");return t.length<=1?".":(t.pop(),t.length===1&&t[0]===""?"/":t.join("/"))}function S(e){const t=b(e),r=t.lastIndexOf(".");return r>0?t.substring(r):""}function j(...e){if(arguments.length<1)return"";const t=e.filter(a=>a.length>0);if(t.length<1)return"";const r=t[t.length-1],s=t[0].charAt(0)==="/",l=r.charAt(r.length-1)==="/",i=t.reduce((a,n)=>a.concat(n.split("/")),[]);let o=!s;const d=i.reduce((a,n)=>n===""?a:o?(o=!1,a+n):a+"/"+n,"");return l?d+"/":d}export{y as _,v as a,b,S as c,C as d,$ as e,E as g,j,_ as l}; //# sourceMappingURL=index-DCpg1aui.chunk.mjs.map