@opencloud-eu/web-client 4.0.0 → 4.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- "use strict";const mr=require("./index-DAa_DzDf.cjs"),R=require("./functions-DP8s29Wg.cjs"),V=require("./toString-CgHWCW2N.cjs"),br=require("./web-client/ocs.cjs"),re=require("./index-D_NPkUGY.cjs"),fe=r=>encodeURIComponent(r).split("%2F").join("/");class et extends Error{response;statusCode;constructor(e,t,n=null){super(e),this.response=t,this.statusCode=n}}class Jt extends et{errorCode;constructor(e,t,n,o=null){super(e,n,o),this.errorCode=t}}const se=(r,{fileId:e,path:t,name:n})=>{if(t!==void 0)return V.urlJoin(r.webDavPath,t);if(e!==void 0){if(R.isPublicSpaceResource(r))throw new Error("public spaces need a path provided");return V.urlJoin("spaces",e,n||"")}return r.webDavPath},yr=(r,e)=>({copyFiles(t,{path:n,fileId:o},u,{path:c,parentFolderId:i,name:h},{overwrite:a,...s}={}){const f=se(t,{fileId:o,path:n}),l=se(u,{fileId:i,path:c,name:h});return r.copy(f,l,{overwrite:a||!1,...s})}}),vr=(r,e,t)=>({async createFolder(n,{path:o,parentFolderId:u,folderName:c,fetchFolder:i=!0,...h}){const a=se(n,{fileId:u,path:o,name:c});if(await r.mkcol(a),i)return e.getFileInfo(n,{path:o},h)}}),wr=(r,{axiosClient:e})=>({async getFileContents(t,{fileId:n,path:o},{responseType:u="text",noCache:c=!0,headers:i,...h}={}){try{const a=se(t,{fileId:n,path:o}),s=await e.get(r.getFileUrl(a),{responseType:u,headers:{...c&&{"Cache-Control":"no-cache"},...i||{}},...h});return{response:s,body:s.data,headers:{ETag:s.headers.etag,"OC-ETag":s.headers["oc-etag"],"OC-FileId":s.headers["oc-fileid"]}}}catch(a){const{message:s,response:f}=a;throw new et(s,f,f.status)}}}),Nr=(r,e)=>({async getFileInfo(t,n,o){return(await r.listFiles(t,n,{depth:0,...o})).resource}}),xr=(r,e,{axiosClient:t,baseUrl:n})=>({async getFileUrl(o,u,{disposition:c="attachment",isUrlSigningEnabled:i=!1,signUrlTimeout:h=86400,version:a=null,doHeadRequest:s=!1,username:f="",...l}){const g=c==="inline";let{downloadURL:d}=u,m=!0;if(!d&&!g&&(d=a?r.getFileUrl(V.urlJoin("meta",u.fileId,"v",a)):r.getFileUrl(u.webDavPath),f&&s&&await t.head(d),i&&f?d=await br.ocs(n,t).signUrl(d,f):m=!1),!m||g){const w=await e.getFileContents(o,u,{responseType:"blob",...l});d=URL.createObjectURL(w.body)}return d},revokeUrl:o=>{o&&o.startsWith("blob:")&&URL.revokeObjectURL(o)}}),Pr=(r,e)=>({getPublicFileUrl(t,n){return r.getFileUrl(V.urlJoin("public-files",n))}}),Er=(r,e,t)=>({async listFiles(n,{path:o,fileId:u}={},{depth:c=1,davProperties:i,isTrash:h=!1,...a}={}){let s;if(R.isPublicSpaceResource(n)){s=await r.propfind(V.urlJoin(n.webDavPath,o),{depth:c,properties:i||R.DavProperties.PublicLink,...a}),s.forEach(d=>{d.filename=d.filename.split("/").slice(1).join("/")}),s.length===1&&(s[0].filename=V.urlJoin(n.id,o,{leadingSlash:!0})),s.forEach(d=>{d.filename=d.filename.split("/").slice(2).join("/")});const l=n.driveAlias.startsWith("ocm/")?"ocm":"public-link";if((!o||o==="/")&&c>0&&l==="ocm"&&s[0].props[R.DavProperty.PublicLinkItemType]==="file"&&(s=[{basename:n.fileId,type:"directory",filename:"",props:{}},...s]),!o){const[d,...m]=s;return{resource:R.buildPublicSpaceResource({...d,id:n.id,driveAlias:n.driveAlias,webDavPath:n.webDavPath,publicLinkType:l}),children:m.map(w=>R.buildResource(w,r.extraProps))}}const g=s.map(d=>R.buildResource(d,r.extraProps));return{resource:g[0],children:g.slice(1)}}const f=async()=>{const l=await e.getPathForFileId(u);return this.listFiles(n,{path:l},{depth:c,davProperties:i})};try{let l="";if(h?l=R.buildWebDavSpacesTrashPath(n.id):l=se(n,{fileId:u,path:o}),s=await r.propfind(l,{depth:c,properties:i||R.DavProperties.Default,...a}),h)return{resource:R.buildResource(s[0],r.extraProps),children:s.slice(1).map(R.buildDeletedResource)};const g=s.map(m=>R.buildResource(m,r.extraProps)),d=u===n.id;return u&&!d&&u!==g[0].fileId?f():{resource:g[0],children:g.slice(1)}}catch(l){if(l.statusCode===404&&u)return f();throw l}}}),Ar=(r,e)=>({moveFiles(t,{path:n,fileId:o},u,{path:c,parentFolderId:i,name:h},{overwrite:a,...s}={}){const f=se(t,{fileId:o,path:n}),l=se(u,{fileId:i,path:c,name:h});return r.move(f,l,{overwrite:a||!1,...s})}}),Tr=(r,e,t)=>({async putFileContents(n,{fileName:o,path:u,parentFolderId:c,content:i="",previousEntityTag:h="",overwrite:a,onUploadProgress:s=null,...f}){const l=se(n,{fileId:c,name:o,path:u}),{result:g}=await r.put(l,i,{previousEntityTag:h,overwrite:a,onUploadProgress:s,...f});return e.getFileInfo(n,{fileId:g.headers.get("Oc-Fileid"),path:u})}}),Or=(r,e)=>({deleteFile(t,{path:n,...o}){return r.delete(V.urlJoin(t.webDavPath,n),o)}}),Cr=(r,e)=>({restoreFile(t,{id:n},{path:o},{overwrite:u,...c}={}){if(R.isPublicSpaceResource(t))return;const i=V.urlJoin(t.webDavPath,o);return r.move(V.urlJoin(t.webDavTrashPath,n),i,{overwrite:u,...c})}}),Ir=(r,e)=>({restoreFileVersion(t,{parentFolderId:n,name:o,path:u},c,i={}){const h=se(t,{path:u,fileId:n,name:o}),a=V.urlJoin("meta",n,"v",c,{leadingSlash:!0}),s=V.urlJoin("files",h,{leadingSlash:!0});return r.copy(a,s,i)}}),Sr=(r,e)=>({clearTrashBin(t,{id:n,...o}={}){let u=R.buildWebDavSpacesTrashPath(t.id);return n&&(u=V.urlJoin(u,n)),r.delete(u,o)}}),Fr=(r,e)=>({async search(t,{davProperties:n=R.DavProperties.Default,searchLimit:o,...u}){const c="/spaces/",{range:i,results:h}=await r.report(c,{pattern:t,limit:o,properties:n,...u});return{resources:h.map(a=>({...R.buildResource(a,r.extraProps),highlights:a.props[R.DavProperty.Highlights]||""})),totalResults:i?parseInt(i?.split("/")[1]):null}}}),$r=(r,e)=>({async getPathForFileId(t,n={}){return(await r.propfind(V.urlJoin("meta",t,{leadingSlash:!0}),{properties:[R.DavProperty.MetaPathForUser],...n}))[0].props[R.DavProperty.MetaPathForUser]}});/*! For license information please see index.js.LICENSE.txt */var jr={2:r=>{function e(o,u,c){o instanceof RegExp&&(o=t(o,c)),u instanceof RegExp&&(u=t(u,c));var i=n(o,u,c);return i&&{start:i[0],end:i[1],pre:c.slice(0,i[0]),body:c.slice(i[0]+o.length,i[1]),post:c.slice(i[1]+u.length)}}function t(o,u){var c=u.match(o);return c?c[0]:null}function n(o,u,c){var i,h,a,s,f,l=c.indexOf(o),g=c.indexOf(u,l+1),d=l;if(l>=0&&g>0){for(i=[],a=c.length;d>=0&&!f;)d==l?(i.push(d),l=c.indexOf(o,d+1)):i.length==1?f=[i.pop(),g]:((h=i.pop())<a&&(a=h,s=g),g=c.indexOf(u,d+1)),d=l<g&&l>=0?l:g;i.length&&(f=[a,s])}return f}r.exports=e,e.range=n},101:function(r,e,t){var n;r=t.nmd(r),(function(o){var u=(r&&r.exports,typeof re.global=="object"&&re.global);u.global!==u&&u.window;var c=function(f){this.message=f};(c.prototype=new Error).name="InvalidCharacterError";var i=function(f){throw new c(f)},h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=/[\t\n\f\r ]/g,s={encode:function(f){f=String(f),/[^\0-\xFF]/.test(f)&&i("The string to be encoded contains characters outside of the Latin1 range.");for(var l,g,d,m,w=f.length%3,v="",p=-1,y=f.length-w;++p<y;)l=f.charCodeAt(p)<<16,g=f.charCodeAt(++p)<<8,d=f.charCodeAt(++p),v+=h.charAt((m=l+g+d)>>18&63)+h.charAt(m>>12&63)+h.charAt(m>>6&63)+h.charAt(63&m);return w==2?(l=f.charCodeAt(p)<<8,g=f.charCodeAt(++p),v+=h.charAt((m=l+g)>>10)+h.charAt(m>>4&63)+h.charAt(m<<2&63)+"="):w==1&&(m=f.charCodeAt(p),v+=h.charAt(m>>2)+h.charAt(m<<4&63)+"=="),v},decode:function(f){var l=(f=String(f).replace(a,"")).length;l%4==0&&(l=(f=f.replace(/==?$/,"")).length),(l%4==1||/[^+a-zA-Z0-9/]/.test(f))&&i("Invalid character: the string to be decoded is not correctly encoded.");for(var g,d,m=0,w="",v=-1;++v<l;)d=h.indexOf(f.charAt(v)),g=m%4?64*g+d:d,m++%4&&(w+=String.fromCharCode(255&g>>(-2*m&6)));return w},version:"1.0.0"};(n=(function(){return s}).call(e,t,e,r))===void 0||(r.exports=n)})()},172:(r,e)=>{e.d=function(t){if(!t)return 0;for(var n=(t=t.toString()).length,o=t.length;o--;){var u=t.charCodeAt(o);56320<=u&&u<=57343&&o--,127<u&&u<=2047?n++:2047<u&&u<=65535&&(n+=2)}return n}},526:r=>{var e={utf8:{stringToBytes:function(t){return e.bin.stringToBytes(unescape(encodeURIComponent(t)))},bytesToString:function(t){return decodeURIComponent(escape(e.bin.bytesToString(t)))}},bin:{stringToBytes:function(t){for(var n=[],o=0;o<t.length;o++)n.push(255&t.charCodeAt(o));return n},bytesToString:function(t){for(var n=[],o=0;o<t.length;o++)n.push(String.fromCharCode(t[o]));return n.join("")}}};r.exports=e},298:r=>{var e,t;e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t={rotl:function(n,o){return n<<o|n>>>32-o},rotr:function(n,o){return n<<32-o|n>>>o},endian:function(n){if(n.constructor==Number)return 16711935&t.rotl(n,8)|4278255360&t.rotl(n,24);for(var o=0;o<n.length;o++)n[o]=t.endian(n[o]);return n},randomBytes:function(n){for(var o=[];n>0;n--)o.push(Math.floor(256*Math.random()));return o},bytesToWords:function(n){for(var o=[],u=0,c=0;u<n.length;u++,c+=8)o[c>>>5]|=n[u]<<24-c%32;return o},wordsToBytes:function(n){for(var o=[],u=0;u<32*n.length;u+=8)o.push(n[u>>>5]>>>24-u%32&255);return o},bytesToHex:function(n){for(var o=[],u=0;u<n.length;u++)o.push((n[u]>>>4).toString(16)),o.push((15&n[u]).toString(16));return o.join("")},hexToBytes:function(n){for(var o=[],u=0;u<n.length;u+=2)o.push(parseInt(n.substr(u,2),16));return o},bytesToBase64:function(n){for(var o=[],u=0;u<n.length;u+=3)for(var c=n[u]<<16|n[u+1]<<8|n[u+2],i=0;i<4;i++)8*u+6*i<=8*n.length?o.push(e.charAt(c>>>6*(3-i)&63)):o.push("=");return o.join("")},base64ToBytes:function(n){n=n.replace(/[^A-Z0-9+\/]/gi,"");for(var o=[],u=0,c=0;u<n.length;c=++u%4)c!=0&&o.push((e.indexOf(n.charAt(u-1))&Math.pow(2,-2*c+8)-1)<<2*c|e.indexOf(n.charAt(u))>>>6-2*c);return o}},r.exports=t},635:(r,e,t)=>{const n=t(31),o=t(338),u=t(221);r.exports={XMLParser:o,XMLValidator:n,XMLBuilder:u}},118:r=>{r.exports=function(e){return typeof e=="function"?e:Array.isArray(e)?t=>{for(const n of e)if(typeof n=="string"&&t===n||n instanceof RegExp&&n.test(t))return!0}:()=>!1}},705:(r,e)=>{const t=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",n="["+t+"]["+t+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*",o=new RegExp("^"+n+"$");e.isExist=function(u){return u!==void 0},e.isEmptyObject=function(u){return Object.keys(u).length===0},e.merge=function(u,c,i){if(c){const h=Object.keys(c),a=h.length;for(let s=0;s<a;s++)u[h[s]]=i==="strict"?[c[h[s]]]:c[h[s]]}},e.getValue=function(u){return e.isExist(u)?u:""},e.isName=function(u){return o.exec(u)!=null},e.getAllMatches=function(u,c){const i=[];let h=c.exec(u);for(;h;){const a=[];a.startIndex=c.lastIndex-h[0].length;const s=h.length;for(let f=0;f<s;f++)a.push(h[f]);i.push(a),h=c.exec(u)}return i},e.nameRegexp=n},31:(r,e,t)=>{const n=t(705),o={allowBooleanAttributes:!1,unpairedTags:[]};function u(p){return p===" "||p===" "||p===`
1
+ "use strict";const mr=require("./index-DAa_DzDf.cjs"),R=require("./functions-CKtvRiMa.cjs"),V=require("./toString-CgHWCW2N.cjs"),br=require("./web-client/ocs.cjs"),re=require("./index-D_NPkUGY.cjs"),fe=r=>encodeURIComponent(r).split("%2F").join("/");class et extends Error{response;statusCode;constructor(e,t,n=null){super(e),this.response=t,this.statusCode=n}}class Jt extends et{errorCode;constructor(e,t,n,o=null){super(e,n,o),this.errorCode=t}}const se=(r,{fileId:e,path:t,name:n})=>{if(t!==void 0)return V.urlJoin(r.webDavPath,t);if(e!==void 0){if(R.isPublicSpaceResource(r))throw new Error("public spaces need a path provided");return V.urlJoin("spaces",e,n||"")}return r.webDavPath},yr=(r,e)=>({copyFiles(t,{path:n,fileId:o},u,{path:c,parentFolderId:i,name:h},{overwrite:a,...s}={}){const f=se(t,{fileId:o,path:n}),l=se(u,{fileId:i,path:c,name:h});return r.copy(f,l,{overwrite:a||!1,...s})}}),vr=(r,e,t)=>({async createFolder(n,{path:o,parentFolderId:u,folderName:c,fetchFolder:i=!0,...h}){const a=se(n,{fileId:u,path:o,name:c});if(await r.mkcol(a),i)return e.getFileInfo(n,{path:o},h)}}),wr=(r,{axiosClient:e})=>({async getFileContents(t,{fileId:n,path:o},{responseType:u="text",noCache:c=!0,headers:i,...h}={}){try{const a=se(t,{fileId:n,path:o}),s=await e.get(r.getFileUrl(a),{responseType:u,headers:{...c&&{"Cache-Control":"no-cache"},...i||{}},...h});return{response:s,body:s.data,headers:{ETag:s.headers.etag,"OC-ETag":s.headers["oc-etag"],"OC-FileId":s.headers["oc-fileid"]}}}catch(a){const{message:s,response:f}=a;throw new et(s,f,f.status)}}}),Nr=(r,e)=>({async getFileInfo(t,n,o){return(await r.listFiles(t,n,{depth:0,...o})).resource}}),xr=(r,e,{axiosClient:t,baseUrl:n})=>({async getFileUrl(o,u,{disposition:c="attachment",isUrlSigningEnabled:i=!1,signUrlTimeout:h=86400,version:a=null,doHeadRequest:s=!1,username:f="",...l}){const g=c==="inline";let{downloadURL:d}=u,m=!0;if(!d&&!g&&(d=a?r.getFileUrl(V.urlJoin("meta",u.fileId,"v",a)):r.getFileUrl(u.webDavPath),f&&s&&await t.head(d),i&&f?d=await br.ocs(n,t).signUrl(d,f):m=!1),!m||g){const w=await e.getFileContents(o,u,{responseType:"blob",...l});d=URL.createObjectURL(w.body)}return d},revokeUrl:o=>{o&&o.startsWith("blob:")&&URL.revokeObjectURL(o)}}),Pr=(r,e)=>({getPublicFileUrl(t,n){return r.getFileUrl(V.urlJoin("public-files",n))}}),Er=(r,e,t)=>({async listFiles(n,{path:o,fileId:u}={},{depth:c=1,davProperties:i,isTrash:h=!1,...a}={}){let s;if(R.isPublicSpaceResource(n)){s=await r.propfind(V.urlJoin(n.webDavPath,o),{depth:c,properties:i||R.DavProperties.PublicLink,...a}),s.forEach(d=>{d.filename=d.filename.split("/").slice(1).join("/")}),s.length===1&&(s[0].filename=V.urlJoin(n.id,o,{leadingSlash:!0})),s.forEach(d=>{d.filename=d.filename.split("/").slice(2).join("/")});const l=n.driveAlias.startsWith("ocm/")?"ocm":"public-link";if((!o||o==="/")&&c>0&&l==="ocm"&&s[0].props[R.DavProperty.PublicLinkItemType]==="file"&&(s=[{basename:n.fileId,type:"directory",filename:"",props:{}},...s]),!o){const[d,...m]=s;return{resource:R.buildPublicSpaceResource({...d,id:n.id,driveAlias:n.driveAlias,webDavPath:n.webDavPath,publicLinkType:l}),children:m.map(w=>R.buildResource(w,r.extraProps))}}const g=s.map(d=>R.buildResource(d,r.extraProps));return{resource:g[0],children:g.slice(1)}}const f=async()=>{const l=await e.getPathForFileId(u);return this.listFiles(n,{path:l},{depth:c,davProperties:i})};try{let l="";if(h?l=R.buildWebDavSpacesTrashPath(n.id):l=se(n,{fileId:u,path:o}),s=await r.propfind(l,{depth:c,properties:i||R.DavProperties.Default,...a}),h)return{resource:R.buildResource(s[0],r.extraProps),children:s.slice(1).map(R.buildDeletedResource)};const g=s.map(m=>R.buildResource(m,r.extraProps)),d=u===n.id;return u&&!d&&u!==g[0].fileId?f():{resource:g[0],children:g.slice(1)}}catch(l){if(l.statusCode===404&&u)return f();throw l}}}),Ar=(r,e)=>({moveFiles(t,{path:n,fileId:o},u,{path:c,parentFolderId:i,name:h},{overwrite:a,...s}={}){const f=se(t,{fileId:o,path:n}),l=se(u,{fileId:i,path:c,name:h});return r.move(f,l,{overwrite:a||!1,...s})}}),Tr=(r,e,t)=>({async putFileContents(n,{fileName:o,path:u,parentFolderId:c,content:i="",previousEntityTag:h="",overwrite:a,onUploadProgress:s=null,...f}){const l=se(n,{fileId:c,name:o,path:u}),{result:g}=await r.put(l,i,{previousEntityTag:h,overwrite:a,onUploadProgress:s,...f});return e.getFileInfo(n,{fileId:g.headers.get("Oc-Fileid"),path:u})}}),Or=(r,e)=>({deleteFile(t,{path:n,...o}){return r.delete(V.urlJoin(t.webDavPath,n),o)}}),Cr=(r,e)=>({restoreFile(t,{id:n},{path:o},{overwrite:u,...c}={}){if(R.isPublicSpaceResource(t))return;const i=V.urlJoin(t.webDavPath,o);return r.move(V.urlJoin(t.webDavTrashPath,n),i,{overwrite:u,...c})}}),Ir=(r,e)=>({restoreFileVersion(t,{parentFolderId:n,name:o,path:u},c,i={}){const h=se(t,{path:u,fileId:n,name:o}),a=V.urlJoin("meta",n,"v",c,{leadingSlash:!0}),s=V.urlJoin("files",h,{leadingSlash:!0});return r.copy(a,s,i)}}),Sr=(r,e)=>({clearTrashBin(t,{id:n,...o}={}){let u=R.buildWebDavSpacesTrashPath(t.id);return n&&(u=V.urlJoin(u,n)),r.delete(u,o)}}),Fr=(r,e)=>({async search(t,{davProperties:n=R.DavProperties.Default,searchLimit:o,...u}){const c="/spaces/",{range:i,results:h}=await r.report(c,{pattern:t,limit:o,properties:n,...u});return{resources:h.map(a=>({...R.buildResource(a,r.extraProps),highlights:a.props[R.DavProperty.Highlights]||""})),totalResults:i?parseInt(i?.split("/")[1]):null}}}),$r=(r,e)=>({async getPathForFileId(t,n={}){return(await r.propfind(V.urlJoin("meta",t,{leadingSlash:!0}),{properties:[R.DavProperty.MetaPathForUser],...n}))[0].props[R.DavProperty.MetaPathForUser]}});/*! For license information please see index.js.LICENSE.txt */var jr={2:r=>{function e(o,u,c){o instanceof RegExp&&(o=t(o,c)),u instanceof RegExp&&(u=t(u,c));var i=n(o,u,c);return i&&{start:i[0],end:i[1],pre:c.slice(0,i[0]),body:c.slice(i[0]+o.length,i[1]),post:c.slice(i[1]+u.length)}}function t(o,u){var c=u.match(o);return c?c[0]:null}function n(o,u,c){var i,h,a,s,f,l=c.indexOf(o),g=c.indexOf(u,l+1),d=l;if(l>=0&&g>0){for(i=[],a=c.length;d>=0&&!f;)d==l?(i.push(d),l=c.indexOf(o,d+1)):i.length==1?f=[i.pop(),g]:((h=i.pop())<a&&(a=h,s=g),g=c.indexOf(u,d+1)),d=l<g&&l>=0?l:g;i.length&&(f=[a,s])}return f}r.exports=e,e.range=n},101:function(r,e,t){var n;r=t.nmd(r),(function(o){var u=(r&&r.exports,typeof re.global=="object"&&re.global);u.global!==u&&u.window;var c=function(f){this.message=f};(c.prototype=new Error).name="InvalidCharacterError";var i=function(f){throw new c(f)},h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=/[\t\n\f\r ]/g,s={encode:function(f){f=String(f),/[^\0-\xFF]/.test(f)&&i("The string to be encoded contains characters outside of the Latin1 range.");for(var l,g,d,m,w=f.length%3,v="",p=-1,y=f.length-w;++p<y;)l=f.charCodeAt(p)<<16,g=f.charCodeAt(++p)<<8,d=f.charCodeAt(++p),v+=h.charAt((m=l+g+d)>>18&63)+h.charAt(m>>12&63)+h.charAt(m>>6&63)+h.charAt(63&m);return w==2?(l=f.charCodeAt(p)<<8,g=f.charCodeAt(++p),v+=h.charAt((m=l+g)>>10)+h.charAt(m>>4&63)+h.charAt(m<<2&63)+"="):w==1&&(m=f.charCodeAt(p),v+=h.charAt(m>>2)+h.charAt(m<<4&63)+"=="),v},decode:function(f){var l=(f=String(f).replace(a,"")).length;l%4==0&&(l=(f=f.replace(/==?$/,"")).length),(l%4==1||/[^+a-zA-Z0-9/]/.test(f))&&i("Invalid character: the string to be decoded is not correctly encoded.");for(var g,d,m=0,w="",v=-1;++v<l;)d=h.indexOf(f.charAt(v)),g=m%4?64*g+d:d,m++%4&&(w+=String.fromCharCode(255&g>>(-2*m&6)));return w},version:"1.0.0"};(n=(function(){return s}).call(e,t,e,r))===void 0||(r.exports=n)})()},172:(r,e)=>{e.d=function(t){if(!t)return 0;for(var n=(t=t.toString()).length,o=t.length;o--;){var u=t.charCodeAt(o);56320<=u&&u<=57343&&o--,127<u&&u<=2047?n++:2047<u&&u<=65535&&(n+=2)}return n}},526:r=>{var e={utf8:{stringToBytes:function(t){return e.bin.stringToBytes(unescape(encodeURIComponent(t)))},bytesToString:function(t){return decodeURIComponent(escape(e.bin.bytesToString(t)))}},bin:{stringToBytes:function(t){for(var n=[],o=0;o<t.length;o++)n.push(255&t.charCodeAt(o));return n},bytesToString:function(t){for(var n=[],o=0;o<t.length;o++)n.push(String.fromCharCode(t[o]));return n.join("")}}};r.exports=e},298:r=>{var e,t;e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t={rotl:function(n,o){return n<<o|n>>>32-o},rotr:function(n,o){return n<<32-o|n>>>o},endian:function(n){if(n.constructor==Number)return 16711935&t.rotl(n,8)|4278255360&t.rotl(n,24);for(var o=0;o<n.length;o++)n[o]=t.endian(n[o]);return n},randomBytes:function(n){for(var o=[];n>0;n--)o.push(Math.floor(256*Math.random()));return o},bytesToWords:function(n){for(var o=[],u=0,c=0;u<n.length;u++,c+=8)o[c>>>5]|=n[u]<<24-c%32;return o},wordsToBytes:function(n){for(var o=[],u=0;u<32*n.length;u+=8)o.push(n[u>>>5]>>>24-u%32&255);return o},bytesToHex:function(n){for(var o=[],u=0;u<n.length;u++)o.push((n[u]>>>4).toString(16)),o.push((15&n[u]).toString(16));return o.join("")},hexToBytes:function(n){for(var o=[],u=0;u<n.length;u+=2)o.push(parseInt(n.substr(u,2),16));return o},bytesToBase64:function(n){for(var o=[],u=0;u<n.length;u+=3)for(var c=n[u]<<16|n[u+1]<<8|n[u+2],i=0;i<4;i++)8*u+6*i<=8*n.length?o.push(e.charAt(c>>>6*(3-i)&63)):o.push("=");return o.join("")},base64ToBytes:function(n){n=n.replace(/[^A-Z0-9+\/]/gi,"");for(var o=[],u=0,c=0;u<n.length;c=++u%4)c!=0&&o.push((e.indexOf(n.charAt(u-1))&Math.pow(2,-2*c+8)-1)<<2*c|e.indexOf(n.charAt(u))>>>6-2*c);return o}},r.exports=t},635:(r,e,t)=>{const n=t(31),o=t(338),u=t(221);r.exports={XMLParser:o,XMLValidator:n,XMLBuilder:u}},118:r=>{r.exports=function(e){return typeof e=="function"?e:Array.isArray(e)?t=>{for(const n of e)if(typeof n=="string"&&t===n||n instanceof RegExp&&n.test(t))return!0}:()=>!1}},705:(r,e)=>{const t=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",n="["+t+"]["+t+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*",o=new RegExp("^"+n+"$");e.isExist=function(u){return u!==void 0},e.isEmptyObject=function(u){return Object.keys(u).length===0},e.merge=function(u,c,i){if(c){const h=Object.keys(c),a=h.length;for(let s=0;s<a;s++)u[h[s]]=i==="strict"?[c[h[s]]]:c[h[s]]}},e.getValue=function(u){return e.isExist(u)?u:""},e.isName=function(u){return o.exec(u)!=null},e.getAllMatches=function(u,c){const i=[];let h=c.exec(u);for(;h;){const a=[];a.startIndex=c.lastIndex-h[0].length;const s=h.length;for(let f=0;f<s;f++)a.push(h[f]);i.push(a),h=c.exec(u)}return i},e.nameRegexp=n},31:(r,e,t)=>{const n=t(705),o={allowBooleanAttributes:!1,unpairedTags:[]};function u(p){return p===" "||p===" "||p===`
2
2
  `||p==="\r"}function c(p,y){const A=y;for(;y<p.length;y++)if(!(p[y]!="?"&&p[y]!=" ")){const N=p.substr(A,y-A);if(y>5&&N==="xml")return d("InvalidXml","XML declaration allowed only at the start of the document.",w(p,y));if(p[y]=="?"&&p[y+1]==">"){y++;break}}return y}function i(p,y){if(p.length>y+5&&p[y+1]==="-"&&p[y+2]==="-"){for(y+=3;y<p.length;y++)if(p[y]==="-"&&p[y+1]==="-"&&p[y+2]===">"){y+=2;break}}else if(p.length>y+8&&p[y+1]==="D"&&p[y+2]==="O"&&p[y+3]==="C"&&p[y+4]==="T"&&p[y+5]==="Y"&&p[y+6]==="P"&&p[y+7]==="E"){let A=1;for(y+=8;y<p.length;y++)if(p[y]==="<")A++;else if(p[y]===">"&&(A--,A===0))break}else if(p.length>y+9&&p[y+1]==="["&&p[y+2]==="C"&&p[y+3]==="D"&&p[y+4]==="A"&&p[y+5]==="T"&&p[y+6]==="A"&&p[y+7]==="["){for(y+=8;y<p.length;y++)if(p[y]==="]"&&p[y+1]==="]"&&p[y+2]===">"){y+=2;break}}return y}e.validate=function(p,y){y=Object.assign({},o,y);const A=[];let N=!1,b=!1;p[0]==="\uFEFF"&&(p=p.substr(1));for(let x=0;x<p.length;x++)if(p[x]==="<"&&p[x+1]==="?"){if(x+=2,x=c(p,x),x.err)return x}else{if(p[x]!=="<"){if(u(p[x]))continue;return d("InvalidChar","char '"+p[x]+"' is not expected.",w(p,x))}{let T=x;if(x++,p[x]==="!"){x=i(p,x);continue}{let O=!1;p[x]==="/"&&(O=!0,x++);let I="";for(;x<p.length&&p[x]!==">"&&p[x]!==" "&&p[x]!==" "&&p[x]!==`
3
3
  `&&p[x]!=="\r";x++)I+=p[x];if(I=I.trim(),I[I.length-1]==="/"&&(I=I.substring(0,I.length-1),x--),E=I,!n.isName(E)){let F;return F=I.trim().length===0?"Invalid space after '<'.":"Tag '"+I+"' is an invalid name.",d("InvalidTag",F,w(p,x))}const C=s(p,x);if(C===!1)return d("InvalidAttr","Attributes for '"+I+"' have open quote.",w(p,x));let P=C.value;if(x=C.index,P[P.length-1]==="/"){const F=x-P.length;P=P.substring(0,P.length-1);const S=l(P,y);if(S!==!0)return d(S.err.code,S.err.msg,w(p,F+S.err.line));N=!0}else if(O){if(!C.tagClosed)return d("InvalidTag","Closing tag '"+I+"' doesn't have proper closing.",w(p,x));if(P.trim().length>0)return d("InvalidTag","Closing tag '"+I+"' can't have attributes or invalid starting.",w(p,T));if(A.length===0)return d("InvalidTag","Closing tag '"+I+"' has not been opened.",w(p,T));{const F=A.pop();if(I!==F.tagName){let S=w(p,F.tagStartPos);return d("InvalidTag","Expected closing tag '"+F.tagName+"' (opened in line "+S.line+", col "+S.col+") instead of closing tag '"+I+"'.",w(p,T))}A.length==0&&(b=!0)}}else{const F=l(P,y);if(F!==!0)return d(F.err.code,F.err.msg,w(p,x-P.length+F.err.line));if(b===!0)return d("InvalidXml","Multiple possible root nodes found.",w(p,x));y.unpairedTags.indexOf(I)!==-1||A.push({tagName:I,tagStartPos:T}),N=!0}for(x++;x<p.length;x++)if(p[x]==="<"){if(p[x+1]==="!"){x++,x=i(p,x);continue}if(p[x+1]!=="?")break;if(x=c(p,++x),x.err)return x}else if(p[x]==="&"){const F=g(p,x);if(F==-1)return d("InvalidChar","char '&' is not expected.",w(p,x));x=F}else if(b===!0&&!u(p[x]))return d("InvalidXml","Extra text at the end",w(p,x));p[x]==="<"&&x--}}}var E;return N?A.length==1?d("InvalidTag","Unclosed tag '"+A[0].tagName+"'.",w(p,A[0].tagStartPos)):!(A.length>0)||d("InvalidXml","Invalid '"+JSON.stringify(A.map((x=>x.tagName)),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):d("InvalidXml","Start tag expected.",1)};const h='"',a="'";function s(p,y){let A="",N="",b=!1;for(;y<p.length;y++){if(p[y]===h||p[y]===a)N===""?N=p[y]:N!==p[y]||(N="");else if(p[y]===">"&&N===""){b=!0;break}A+=p[y]}return N===""&&{value:A,index:y,tagClosed:b}}const f=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function l(p,y){const A=n.getAllMatches(p,f),N={};for(let b=0;b<A.length;b++){if(A[b][1].length===0)return d("InvalidAttr","Attribute '"+A[b][2]+"' has no space in starting.",v(A[b]));if(A[b][3]!==void 0&&A[b][4]===void 0)return d("InvalidAttr","Attribute '"+A[b][2]+"' is without value.",v(A[b]));if(A[b][3]===void 0&&!y.allowBooleanAttributes)return d("InvalidAttr","boolean attribute '"+A[b][2]+"' is not allowed.",v(A[b]));const E=A[b][2];if(!m(E))return d("InvalidAttr","Attribute '"+E+"' is an invalid name.",v(A[b]));if(N.hasOwnProperty(E))return d("InvalidAttr","Attribute '"+E+"' is repeated.",v(A[b]));N[E]=1}return!0}function g(p,y){if(p[++y]===";")return-1;if(p[y]==="#")return(function(N,b){let E=/\d/;for(N[b]==="x"&&(b++,E=/[\da-fA-F]/);b<N.length;b++){if(N[b]===";")return b;if(!N[b].match(E))break}return-1})(p,++y);let A=0;for(;y<p.length;y++,A++)if(!(p[y].match(/\w/)&&A<20)){if(p[y]===";")break;return-1}return y}function d(p,y,A){return{err:{code:p,msg:y,line:A.line||A,col:A.col}}}function m(p){return n.isName(p)}function w(p,y){const A=p.substring(0,y).split(/\r?\n/);return{line:A.length,col:A[A.length-1].length+1}}function v(p){return p.startIndex+p[1].length}},221:(r,e,t)=>{const n=t(87),o=t(118),u={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(s,f){return f},attributeValueProcessor:function(s,f){return f},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&amp;"},{regex:new RegExp(">","g"),val:"&gt;"},{regex:new RegExp("<","g"),val:"&lt;"},{regex:new RegExp("'","g"),val:"&apos;"},{regex:new RegExp('"',"g"),val:"&quot;"}],processEntities:!0,stopNodes:[],oneListGroup:!1};function c(s){this.options=Object.assign({},u,s),this.options.ignoreAttributes===!0||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=o(this.options.ignoreAttributes),this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=a),this.processTextOrObjNode=i,this.options.format?(this.indentate=h,this.tagEndChar=`>
4
4
  `,this.newLine=`
@@ -0,0 +1 @@
1
+ "use strict";const h=require("./web-client/graph/generated.cjs"),g=require("./toString-CgHWCW2N.cjs"),d=require("./functions-CKtvRiMa.cjs"),k=({axiosClient:e,config:s})=>{const o=h.UserApiFactory(s,s.basePath,e),c=h.UsersApiFactory(s,s.basePath,e),i=h.MeUserApiFactory(s,s.basePath,e),a=h.MeChangepasswordApiFactory(s,s.basePath,e),t=h.UserAppRoleAssignmentApiFactory(s,s.basePath,e);return{async getUser(r,n,u){const{data:l}=await o.getUser(r,n?.select?new Set([...n.select]):null,n?.expand?new Set([...n.expand]):new Set(["drive","memberOf","appRoleAssignments"]),u);return l},async createUser(r,n){const{data:u}=await c.createUser(r,n);return u},async editUser(r,n,u){const{data:l}=await o.updateUser(r,n,u);return l},async deleteUser(r,n,u){await o.deleteUser(r,n,u)},async listUsers(r,n){const{data:{value:u}}=await c.listUsers(r?.search,r?.filter,r?.orderBy?new Set([...r.orderBy]):null,r?.select?new Set([...r.select]):null,r?.expand?new Set([...r.expand]):null,n);return u},async getMe(r,n){const{data:u}=await i.getOwnUser(r?.expand?new Set([...r.expand]):new Set(["memberOf"]),n);return u},async editMe(r,n){const{data:u}=await i.updateOwnUser(r,n);return u},async changeOwnPassword(r,n){await a.changeOwnPassword(r,n)},async exportPersonalData(r,n,u){await o.exportPersonalData(r,n,u)},async createUserAppRoleAssignment(r,n,u){const{data:l}=await t.userCreateAppRoleAssignments(r,n,u);return l}}},B=({axiosClient:e,config:s})=>{const o=h.GroupApiFactory(s,s.basePath,e),c=h.GroupsApiFactory(s,s.basePath,e);return{async getGroup(i,a,t){const{data:r}=await o.getGroup(i,a?.select?new Set([...a.select]):null,a?.expand?new Set([...a.expand]):new Set(["members"]),t);return r},async createGroup(i,a){const{data:t}=await c.createGroup(i,a);return t},async editGroup(i,a,t){const{data:r}=await o.updateGroup(i,a,t);return r},async deleteGroup(i,a,t){await o.deleteGroup(i,a,t)},async listGroups(i,a){const{data:{value:t}}=await c.listGroups(i?.search,i?.orderBy?new Set([...i.orderBy]):null,i?.select?new Set([...i.select]):null,i?.expand?new Set([...i.expand]):null,a);return t},async addMember(i,a,t){await o.addMember(i,{"@odata.id":g.urlJoin(s.basePath,"v1.0","users",a)},t)},async deleteMember(i,a,t,r){await o.deleteMember(i,a,t,r)}}},M=({axiosClient:e,config:s})=>{const o=h.ApplicationsApiFactory(s,s.basePath,e);return{async getApplication(c,i){const{data:a}=await o.getApplication(c,i);return a},async listApplications(c){const{data:{value:i}}=await o.listApplications(c);return i||[]}}};function G(){}var F=g.getNative(g.root,"Set");function T(e){var s=-1,o=Array(e.size);return e.forEach(function(c){o[++s]=c}),o}var N=1/0,x=F&&1/T(new F([,-0]))[1]==N?function(e){return new F(e)}:G,L=200;function E(e,s,o){var c=-1,i=d.arrayIncludes,a=e.length,t=!0,r=[],n=r;if(a>=L){var u=x(e);if(u)return T(u);t=!1,i=d.cacheHas,n=new d.SetCache}else n=r;e:for(;++c<a;){var l=e[c],p=l;if(l=l!==0?l:0,t&&p===p){for(var y=n.length;y--;)if(n[y]===p)continue e;r.push(l)}else i(n,p,o)||(n!==r&&n.push(p),r.push(l))}return r}function O(e){return e&&e.length?E(e):[]}const v=e=>Object.hasOwn(e,"sharedWith"),W=e=>v(e)&&e.outgoing,z=e=>v(e)&&!e.outgoing,V=e=>Object.hasOwn(e,"role"),j=e=>!Object.hasOwn(e,"role"),f=({driveItem:e,graphRoles:s})=>e.remoteItem?.permissions.reduce((o,c)=>(c.roles?.forEach(i=>{const a=s[i];a&&!o.some(({id:t})=>t===a.id)&&o.push(a)}),o),[]),U=({driveItem:e,shareRoles:s})=>{if(!s.length){const c=e.remoteItem?.permissions.reduce((i,a)=>{const t=a["@libre.graph.permissions.actions"];return t&&i.push(...t),i},[]);return[...new Set(c)]}const o=s.reduce((c,i)=>(i.rolePermissions.forEach(a=>{c.push(...a.allowedResourceActions)}),c),[]);return[...new Set(o)]};function J({driveItem:e,graphRoles:s,serverUrl:o}){const c=e.name||e.remoteItem.name,i=d.extractStorageId(e.remoteItem.id),a=e.remoteItem.permissions.map(y=>{const{grantedToV2:m}=y;return{...m.group||m.user,shareType:D(y)}}),t=e.remoteItem.permissions.reduce((y,m)=>{const b=m.invitation.invitedBy.user;return y.some(({id:R})=>R===b.id)||y.push(b),y},[]);let r=O(e.remoteItem.permissions.map(D));t.some(y=>y["@libre.graph.userType"]==="Federated")&&(r=[d.ShareTypes.remote.value]);const u=f({driveItem:e,graphRoles:s}),l=U({driveItem:e,shareRoles:u}),p={id:e.id,remoteItemId:e.remoteItem.id,driveId:e.parentReference?.driveId,path:"/",name:c,fileId:e.remoteItem.id,size:e.size,storageId:i,parentFolderId:e.parentReference?.id,sdate:e.remoteItem.permissions[0].createdDateTime,tags:[],webDavPath:d.buildWebDavSpacesPath(e.remoteItem.id,"/"),sharedBy:t,owner:e.remoteItem.createdBy?.user,sharedWith:a,shareTypes:r,isFolder:!!e.folder,type:e.folder?"folder":"file",mimeType:e.file?.mimeType||"httpd/unix-directory",mdate:e.lastModifiedDateTime?new Date(e.lastModifiedDateTime).toUTCString():void 0,syncEnabled:e["@client.synchronize"],hidden:e["@UI.Hidden"],shareRoles:u,sharePermissions:l,outgoing:!1,privateLink:g.urlJoin(o,"f",e.remoteItem.id),hasPreview:()=>!!e.thumbnails,canRename:()=>e["@client.synchronize"],canDownload:()=>l.includes(d.GraphSharePermission.readContent),canUpload:()=>l.includes(d.GraphSharePermission.createUpload),canCreate:()=>l.includes(d.GraphSharePermission.createChildren),canBeDeleted:()=>l.includes(d.GraphSharePermission.deleteStandard),canEditTags:()=>l.includes(d.GraphSharePermission.createChildren),isMounted:()=>!1,isReceivedShare:()=>!0,canShare:()=>!1,getDomSelector:()=>d.extractDomSelector(e.id)};return p.extension=d.extractExtensionFromFile(p),p}function _({driveItem:e,user:s,serverUrl:o}){const c=d.extractStorageId(e.id),i=g.urlJoin(e.parentReference.path,e.name),a={id:e.id,driveId:e.parentReference?.driveId,path:i,name:e.name,fileId:e.id,size:e.size,storageId:c,parentFolderId:e.parentReference?.id,sdate:e.permissions[0].createdDateTime,tags:[],webDavPath:d.buildWebDavSpacesPath(c,i),sharedBy:[{id:s.id,displayName:s.displayName}],owner:{id:s.id,displayName:s.displayName},sharedWith:e.permissions.map(t=>{if(t.link)return{id:t.id,displayName:t.link["@libre.graph.displayName"],shareType:d.ShareTypes.link.value};const r=D(t);return{...t.grantedToV2.user||t.grantedToV2.group,shareType:r}}),shareTypes:e.permissions.map(D),isFolder:!!e.folder,type:e.folder?"folder":"file",mimeType:e.file?.mimeType||"httpd/unix-directory",outgoing:!0,privateLink:g.urlJoin(o,"f",e.id),hasPreview:()=>!!e.thumbnails,canRename:()=>!0,canDownload:()=>!0,canUpload:()=>!0,canCreate:()=>!0,canBeDeleted:()=>!0,canEditTags:()=>!0,isMounted:()=>!1,isReceivedShare:()=>!0,canShare:()=>!0,getDomSelector:()=>d.extractDomSelector(e.id)};return a.extension=d.extractExtensionFromFile(a),a}function A({graphPermission:e,graphRoles:s,resourceId:o,indirect:c=!1}){const i=s[e.roles?.[0]],a=e.invitation?.invitedBy?.user;return{id:e.id,resourceId:o,indirect:c,shareType:D(e),role:i,sharedBy:{id:a?.id,displayName:a?.displayName},sharedWith:e.grantedToV2.user||e.grantedToV2.group,permissions:e["@libre.graph.permissions.actions"]?e["@libre.graph.permissions.actions"]:i.rolePermissions.flatMap(t=>t.allowedResourceActions),createdDateTime:e.createdDateTime,expirationDateTime:e.expirationDateTime}}function S({graphPermission:e,resourceId:s,indirect:o=!1}){const c=e.invitation?.invitedBy?.user;return{id:e.id,resourceId:s,indirect:o,shareType:d.ShareTypes.link.value,sharedBy:{id:c?.id,displayName:c?.displayName},hasPassword:e.hasPassword,createdDateTime:e.createdDateTime,expirationDateTime:e.expirationDateTime,displayName:e.link["@libre.graph.displayName"],isQuickLink:e.link["@libre.graph.quickLink"],type:e.link.type,webUrl:e.link.webUrl,preventsDownload:e.link.preventsDownload}}function D({link:e,grantedToV2:s}){return e?d.ShareTypes.link.value:s?.group?d.ShareTypes.group.value:s?.user?.["@libre.graph.userType"]==="Federated"?d.ShareTypes.remote.value:d.ShareTypes.user.value}const P=e=>new URL(e.webUrl).origin,H=({axiosClient:e,config:s})=>{const o=h.DrivesApiFactory(s,s.basePath,e),c=new h.MeDrivesApi(s,s.basePath,e),i=new h.DrivesGetDrivesApi(s,s.basePath,e);return{async getDrive(a,t,r){const{data:n}=await o.getDrive(a,t?.select?new Set([...t.select]):null,r);return d.buildSpace({...n,serverUrl:P(n)})},async createDrive(a,t){const{data:r}=await o.createDrive(a,t);return d.buildSpace({...r,serverUrl:P(r)})},async updateDrive(a,t,r){const{data:n}=await o.updateDrive(a,t,r);return d.buildSpace({...n,serverUrl:P(n)})},async disableDrive(a,t,r){await o.deleteDrive(a,t,r)},async deleteDrive(a,t,r){await o.deleteDrive(a,t,{headers:{...r?.headers&&r.headers||{},Purge:"T"},...r&&{requestOptions:r}||{}})},async listMyDrives(a,t){const{data:{value:r}}=await c.listMyDrivesBeta(a?.orderBy,a?.filter,a?.expand,a?.select?new Set([...a.select]):null,t);return r.map(n=>d.buildSpace({...n,serverUrl:P(n)}))},async listAllDrives(a,t){const{data:{value:r}}=await i.listAllDrivesBeta(a?.orderBy,a?.filter,a?.expand,a?.select?new Set([...a.select]):null,t);return r.map(n=>d.buildSpace({...n,serverUrl:P(n)}))}}},Y=({axiosClient:e,config:s})=>{const o=h.DriveItemApiFactory(s,s.basePath,e),c=h.DrivesRootApiFactory(s,s.basePath,e),i=h.MeDriveApiFactory(s,s.basePath,e);return{async getDriveItem(a,t,r){const{data:n}=await o.getDriveItem(a,t,r);return n},async createDriveItem(a,t,r){const{data:n}=await c.createDriveItem(a,t,r);return n},async updateDriveItem(a,t,r,n){const{data:u}=await o.updateDriveItem(a,t,r,n);return u},async deleteDriveItem(a,t,r){await o.deleteDriveItem(a,t,r)},async listSharedByMe(a,t){const{data:r}=await i.listSharedByMe(a?.expand,t);return r?.value||[]},async listSharedWithMe(a,t){const{data:r}=await i.listSharedWithMe(a?.expand,t);return r?.value||[]}}},Q=({axiosClient:e,config:s})=>{const o=h.TagsApiFactory(s,s.basePath,e);return{async listTags(c){const{data:{value:i}}=await o.getTags(c);return i||[]},async assignTags(c,i){await o.assignTags(c,i)},async unassignTags(c,i){await o.unassignTags(c,i)}}},Z=({axiosClient:e,config:s})=>{const o=h.ActivitiesApiFactory(s,s.basePath,e);return{async listActivities(c,i){const{data:{value:a}}=await o.getActivities(c,i);return a||[]}}},$=({axiosClient:e,config:s})=>{const o=h.DrivesRootApiFactory(s,s.basePath,e),c=h.RoleManagementApiFactory(s,s.basePath,e),i=h.DrivesPermissionsApiFactory(s,s.basePath,e);return{async getPermission(a,t,r,n,u){const{data:l}=await i.getPermission(a,t,r,u);return l.link?S({graphPermission:l,resourceId:t}):A({graphPermission:l,resourceId:t,graphRoles:n||{}})},async listPermissions(a,t,r,n,u){let l;if(a===t){const{data:w}=await o.listPermissionsSpaceRoot(a,n?.filter,n?.select?new Set([...n.select]):null,n?.count,n?.top||0,u);l=w}else{const{data:w}=await i.listPermissions(a,t,n?.filter,n?.select?new Set([...n.select]):null,n?.count,n?.top||0,u);l=w}const p=l.value||[],y=l["@libre.graph.permissions.actions.allowedValues"],m=l["@libre.graph.permissions.roles.allowedValues"],b=l["@odata.count"];return{shares:p.map(w=>w.link?S({graphPermission:w,resourceId:t}):A({graphPermission:w,resourceId:t,graphRoles:r||{}})),allowedActions:y,allowedRoles:m,count:b}},async updatePermission(a,t,r,n,u,l){let p;if(a===t){const{data:y}=await o.updatePermissionSpaceRoot(a,r,n,l);p=y}else{const{data:y}=await i.updatePermission(a,t,r,n,l);p=y}return p.link?S({graphPermission:p,resourceId:t}):A({graphPermission:p,resourceId:t,graphRoles:u||{}})},async deletePermission(a,t,r,n){if(a===t){await o.deletePermissionSpaceRoot(a,r,n);return}await i.deletePermission(a,t,r,n)},async createInvite(a,t,r,n,u){let l;if(a===t){const{data:p}=await o.inviteSpaceRoot(a,r,u);l=p.value?.[0]}else{const{data:p}=await i.invite(a,t,r,u);l=p.value?.[0]}if(!l)throw new Error("no permission returned");return A({graphPermission:l,resourceId:t,graphRoles:n||{}})},async createLink(a,t,r,n){let u;if(a===t){const{data:l}=await o.createLinkSpaceRoot(a,r,n);u=l}else{const{data:l}=await i.createLink(a,t,r,n);u=l}return S({graphPermission:u,resourceId:t})},async setPermissionPassword(a,t,r,n,u){let l;if(a===t){const{data:p}=await o.setPermissionPasswordSpaceRoot(a,r,n,u);l=p}else{const{data:p}=await i.setPermissionPassword(a,t,r,n,u);l=p}return S({graphPermission:l,resourceId:t})},async listRoleDefinitions(a){const{data:t}=await c.listPermissionRoleDefinitions(a);return t}}},K=({axiosClient:e,config:s})=>{const o=h.MePhotoApiFactory(s,s.basePath,e),c=h.UserPhotoApiFactory(s,s.basePath,e);return{async getOwnUserPhoto(i){const{data:a}=await o.getOwnUserPhoto(i);return a},async deleteOwnUserPhoto(i){const{data:a}=await o.deleteOwnUserPhoto(i);return a},async updateOwnUserPhotoPatch(i,a){const{data:t}=await o.updateOwnUserPhotoPatch(i,a);return t},async getUserPhoto(i,a){const{data:t}=await c.getUserPhoto(i,a);return t}}},X=(e,s)=>{const o=new URL(e);o.pathname=[...o.pathname.split("/"),"graph"].filter(Boolean).join("/");const c=new h.Configuration({basePath:o.href});return{activities:Z({axiosClient:s,config:c}),applications:M({axiosClient:s,config:c}),tags:Q({axiosClient:s,config:c}),drives:H({axiosClient:s,config:c}),driveItems:Y({axiosClient:s,config:c}),users:k({axiosClient:s,config:c}),groups:B({axiosClient:s,config:c}),permissions:$({axiosClient:s,config:c}),photos:K({axiosClient:s,config:c})}};exports.buildCollaboratorShare=A;exports.buildIncomingShareResource=J;exports.buildLinkShare=S;exports.buildOutgoingShareResource=_;exports.getShareResourcePermissions=U;exports.getShareResourceRoles=f;exports.graph=X;exports.isCollaboratorShare=V;exports.isIncomingShareResource=z;exports.isLinkShare=j;exports.isOutgoingShareResource=W;exports.isShareResource=v;
@@ -1,6 +1,6 @@
1
1
  import { UserApiFactory as N, UsersApiFactory as E, MeUserApiFactory as x, MeChangepasswordApiFactory as L, UserAppRoleAssignmentApiFactory as O, GroupApiFactory as z, GroupsApiFactory as W, ApplicationsApiFactory as V, DrivesApiFactory as j, MeDrivesApi as H, DrivesGetDrivesApi as Y, DriveItemApiFactory as _, DrivesRootApiFactory as R, MeDriveApiFactory as J, TagsApiFactory as Q, ActivitiesApiFactory as Z, RoleManagementApiFactory as $, DrivesPermissionsApiFactory as K, MePhotoApiFactory as X, UserPhotoApiFactory as q, Configuration as C } from "./web-client/graph/generated.js";
2
- import { u as F, g as I, r as ee } from "./toString-XlfBosfh.js";
3
- import { D as ae, E as te, F as re, d as T, n as h, o as U, h as k, e as B, G as g, u as A } from "./functions-DnZZKUk0.js";
2
+ import { u as v, g as I, r as ee } from "./toString-XlfBosfh.js";
3
+ import { E as ae, F as te, H as re, d as T, n as h, o as U, h as k, e as B, G as g, v as A } from "./functions-aGu-ugzD.js";
4
4
  const se = ({ axiosClient: e, config: s }) => {
5
5
  const o = N(s, s.basePath, e), c = E(s, s.basePath, e), i = x(s, s.basePath, e), a = L(
6
6
  s,
@@ -109,7 +109,7 @@ const se = ({ axiosClient: e, config: s }) => {
109
109
  async addMember(i, a, t) {
110
110
  await o.addMember(
111
111
  i,
112
- { "@odata.id": F(s.basePath, "v1.0", "users", a) },
112
+ { "@odata.id": v(s.basePath, "v1.0", "users", a) },
113
113
  t
114
114
  );
115
115
  },
@@ -137,15 +137,15 @@ const se = ({ axiosClient: e, config: s }) => {
137
137
  };
138
138
  function oe() {
139
139
  }
140
- var v = I(ee, "Set");
140
+ var F = I(ee, "Set");
141
141
  function M(e) {
142
142
  var s = -1, o = Array(e.size);
143
143
  return e.forEach(function(c) {
144
144
  o[++s] = c;
145
145
  }), o;
146
146
  }
147
- var ce = 1 / 0, le = v && 1 / M(new v([, -0]))[1] == ce ? function(e) {
148
- return new v(e);
147
+ var ce = 1 / 0, le = F && 1 / M(new F([, -0]))[1] == ce ? function(e) {
148
+ return new F(e);
149
149
  } : oe, ue = 200;
150
150
  function de(e, s, o) {
151
151
  var c = -1, i = te, a = e.length, t = !0, r = [], n = r;
@@ -171,7 +171,7 @@ function de(e, s, o) {
171
171
  function pe(e) {
172
172
  return e && e.length ? de(e) : [];
173
173
  }
174
- const G = (e) => Object.hasOwn(e, "sharedWith"), ve = (e) => G(e) && e.outgoing, fe = (e) => G(e) && !e.outgoing, Re = (e) => Object.hasOwn(e, "role"), Te = (e) => !Object.hasOwn(e, "role"), ye = ({
174
+ const G = (e) => Object.hasOwn(e, "sharedWith"), Fe = (e) => G(e) && e.outgoing, fe = (e) => G(e) && !e.outgoing, Re = (e) => Object.hasOwn(e, "role"), Te = (e) => !Object.hasOwn(e, "role"), ye = ({
175
175
  driveItem: e,
176
176
  graphRoles: s
177
177
  }) => e.remoteItem?.permissions.reduce((o, c) => (c.roles?.forEach((i) => {
@@ -239,7 +239,7 @@ function Ue({
239
239
  shareRoles: u,
240
240
  sharePermissions: l,
241
241
  outgoing: !1,
242
- privateLink: F(o, "f", e.remoteItem.id),
242
+ privateLink: v(o, "f", e.remoteItem.id),
243
243
  hasPreview: () => !!e.thumbnails,
244
244
  canRename: () => e["@client.synchronize"],
245
245
  canDownload: () => l.includes(g.readContent),
@@ -250,7 +250,6 @@ function Ue({
250
250
  isMounted: () => !1,
251
251
  isReceivedShare: () => !0,
252
252
  canShare: () => !1,
253
- canDeny: () => !1,
254
253
  getDomSelector: () => B(e.id)
255
254
  };
256
255
  return d.extension = k(d), d;
@@ -260,7 +259,7 @@ function ke({
260
259
  user: s,
261
260
  serverUrl: o
262
261
  }) {
263
- const c = T(e.id), i = F(e.parentReference.path, e.name), a = {
262
+ const c = T(e.id), i = v(e.parentReference.path, e.name), a = {
264
263
  id: e.id,
265
264
  driveId: e.parentReference?.driveId,
266
265
  path: i,
@@ -289,7 +288,7 @@ function ke({
289
288
  type: e.folder ? "folder" : "file",
290
289
  mimeType: e.file?.mimeType || "httpd/unix-directory",
291
290
  outgoing: !0,
292
- privateLink: F(o, "f", e.id),
291
+ privateLink: v(o, "f", e.id),
293
292
  hasPreview: () => !!e.thumbnails,
294
293
  canRename: () => !0,
295
294
  canDownload: () => !0,
@@ -300,7 +299,6 @@ function ke({
300
299
  isMounted: () => !1,
301
300
  isReceivedShare: () => !0,
302
301
  canShare: () => !0,
303
- canDeny: () => !0,
304
302
  getDomSelector: () => B(e.id)
305
303
  };
306
304
  return a.extension = k(a), a;
@@ -325,7 +323,7 @@ function S({
325
323
  expirationDateTime: e.expirationDateTime
326
324
  };
327
325
  }
328
- function D({
326
+ function P({
329
327
  graphPermission: e,
330
328
  resourceId: s,
331
329
  indirect: o = !1
@@ -350,7 +348,7 @@ function D({
350
348
  function b({ link: e, grantedToV2: s }) {
351
349
  return e ? h.link.value : s?.group ? h.group.value : s?.user?.["@libre.graph.userType"] === "Federated" ? h.remote.value : h.user.value;
352
350
  }
353
- const P = (e) => new URL(e.webUrl).origin, we = ({ axiosClient: e, config: s }) => {
351
+ const D = (e) => new URL(e.webUrl).origin, we = ({ axiosClient: e, config: s }) => {
354
352
  const o = j(s, s.basePath, e), c = new H(s, s.basePath, e), i = new Y(s, s.basePath, e);
355
353
  return {
356
354
  async getDrive(a, t, r) {
@@ -359,15 +357,15 @@ const P = (e) => new URL(e.webUrl).origin, we = ({ axiosClient: e, config: s })
359
357
  t?.select ? /* @__PURE__ */ new Set([...t.select]) : null,
360
358
  r
361
359
  );
362
- return A({ ...n, serverUrl: P(n) });
360
+ return A({ ...n, serverUrl: D(n) });
363
361
  },
364
362
  async createDrive(a, t) {
365
363
  const { data: r } = await o.createDrive(a, t);
366
- return A({ ...r, serverUrl: P(r) });
364
+ return A({ ...r, serverUrl: D(r) });
367
365
  },
368
366
  async updateDrive(a, t, r) {
369
367
  const { data: n } = await o.updateDrive(a, t, r);
370
- return A({ ...n, serverUrl: P(n) });
368
+ return A({ ...n, serverUrl: D(n) });
371
369
  },
372
370
  async disableDrive(a, t, r) {
373
371
  await o.deleteDrive(a, t, r);
@@ -391,7 +389,7 @@ const P = (e) => new URL(e.webUrl).origin, we = ({ axiosClient: e, config: s })
391
389
  a?.select ? /* @__PURE__ */ new Set([...a.select]) : null,
392
390
  t
393
391
  );
394
- return r.map((n) => A({ ...n, serverUrl: P(n) }));
392
+ return r.map((n) => A({ ...n, serverUrl: D(n) }));
395
393
  },
396
394
  async listAllDrives(a, t) {
397
395
  const {
@@ -403,7 +401,7 @@ const P = (e) => new URL(e.webUrl).origin, we = ({ axiosClient: e, config: s })
403
401
  a?.select ? /* @__PURE__ */ new Set([...a.select]) : null,
404
402
  t
405
403
  );
406
- return r.map((n) => A({ ...n, serverUrl: P(n) }));
404
+ return r.map((n) => A({ ...n, serverUrl: D(n) }));
407
405
  }
408
406
  };
409
407
  }, me = ({
@@ -474,7 +472,7 @@ const P = (e) => new URL(e.webUrl).origin, we = ({ axiosClient: e, config: s })
474
472
  return a || [];
475
473
  }
476
474
  };
477
- }, De = ({
475
+ }, Pe = ({
478
476
  axiosClient: e,
479
477
  config: s
480
478
  }) => {
@@ -491,7 +489,7 @@ const P = (e) => new URL(e.webUrl).origin, we = ({ axiosClient: e, config: s })
491
489
  r,
492
490
  u
493
491
  );
494
- return l.link ? D({ graphPermission: l, resourceId: t }) : S({
492
+ return l.link ? P({ graphPermission: l, resourceId: t }) : S({
495
493
  graphPermission: l,
496
494
  resourceId: t,
497
495
  graphRoles: n || {}
@@ -522,7 +520,7 @@ const P = (e) => new URL(e.webUrl).origin, we = ({ axiosClient: e, config: s })
522
520
  l = y;
523
521
  }
524
522
  const d = l.value || [], p = l["@libre.graph.permissions.actions.allowedValues"], w = l["@libre.graph.permissions.roles.allowedValues"], m = l["@odata.count"];
525
- return { shares: d.map((y) => y.link ? D({ graphPermission: y, resourceId: t }) : S({
523
+ return { shares: d.map((y) => y.link ? P({ graphPermission: y, resourceId: t }) : S({
526
524
  graphPermission: y,
527
525
  resourceId: t,
528
526
  graphRoles: r || {}
@@ -548,7 +546,7 @@ const P = (e) => new URL(e.webUrl).origin, we = ({ axiosClient: e, config: s })
548
546
  );
549
547
  d = p;
550
548
  }
551
- return d.link ? D({ graphPermission: d, resourceId: t }) : S({
549
+ return d.link ? P({ graphPermission: d, resourceId: t }) : S({
552
550
  graphPermission: d,
553
551
  resourceId: t,
554
552
  graphRoles: u || {}
@@ -605,7 +603,7 @@ const P = (e) => new URL(e.webUrl).origin, we = ({ axiosClient: e, config: s })
605
603
  );
606
604
  u = l;
607
605
  }
608
- return D({ graphPermission: u, resourceId: t });
606
+ return P({ graphPermission: u, resourceId: t });
609
607
  },
610
608
  async setPermissionPassword(a, t, r, n, u) {
611
609
  let l;
@@ -627,14 +625,14 @@ const P = (e) => new URL(e.webUrl).origin, we = ({ axiosClient: e, config: s })
627
625
  );
628
626
  l = d;
629
627
  }
630
- return D({ graphPermission: l, resourceId: t });
628
+ return P({ graphPermission: l, resourceId: t });
631
629
  },
632
630
  async listRoleDefinitions(a) {
633
631
  const { data: t } = await c.listPermissionRoleDefinitions(a);
634
632
  return t;
635
633
  }
636
634
  };
637
- }, Pe = ({ axiosClient: e, config: s }) => {
635
+ }, De = ({ axiosClient: e, config: s }) => {
638
636
  const o = X(s, s.basePath, e), c = q(s, s.basePath, e);
639
637
  return {
640
638
  async getOwnUserPhoto(i) {
@@ -668,12 +666,12 @@ const P = (e) => new URL(e.webUrl).origin, we = ({ axiosClient: e, config: s })
668
666
  driveItems: me({ axiosClient: s, config: c }),
669
667
  users: se({ axiosClient: s, config: c }),
670
668
  groups: ne({ axiosClient: s, config: c }),
671
- permissions: De({ axiosClient: s, config: c }),
672
- photos: Pe({ axiosClient: s, config: c })
669
+ permissions: Pe({ axiosClient: s, config: c }),
670
+ photos: De({ axiosClient: s, config: c })
673
671
  };
674
672
  };
675
673
  export {
676
- ve as a,
674
+ Fe as a,
677
675
  fe as b,
678
676
  Re as c,
679
677
  Te as d,
@@ -684,5 +682,5 @@ export {
684
682
  G as i,
685
683
  ke as j,
686
684
  S as k,
687
- D as l
685
+ P as l
688
686
  };
@@ -1,5 +1,5 @@
1
1
  import { a as Nr } from "./index-BIL0cW_q.js";
2
- import { C as st, H as de, I as me, s as xr, l as ue, p as Kt, m as Pr, J as se } from "./functions-DnZZKUk0.js";
2
+ import { D as st, I as de, J as me, t as xr, l as ue, p as Kt, m as Pr, K as se } from "./functions-aGu-ugzD.js";
3
3
  import { u as M } from "./toString-XlfBosfh.js";
4
4
  import { ocs as Er } from "./web-client/ocs.js";
5
5
  import { p as oe, g as ve } from "./index-JHVTaNRI.js";
@@ -4428,7 +4428,10 @@ const nt = (r, e) => Object.fromEntries(
4428
4428
  return u.props.name && (u.props.name = u.props.name.toString()), u;
4429
4429
  });
4430
4430
  }, Os = (r) => {
4431
- const e = new pt.XMLParser(), t = { message: "Unknown error", errorCode: void 0 };
4431
+ const e = new pt.XMLParser(), t = {
4432
+ message: "Unknown error",
4433
+ errorCode: void 0
4434
+ };
4432
4435
  try {
4433
4436
  const n = e.parse(r);
4434
4437
  if (!n["d:error"])
@@ -3,9 +3,6 @@ import { Drive, DriveUpdate, ListMyDrivesBetaSelectEnum } from '../generated';
3
3
  import { GraphRequestOptions } from '../types';
4
4
  export interface GraphDrives {
5
5
  getDrive: (id: string, options?: {
6
- orderBy?: string;
7
- filter?: string;
8
- expand?: string;
9
6
  select?: Array<ListMyDrivesBetaSelectEnum>;
10
7
  }, requestOptions?: GraphRequestOptions) => Promise<SpaceResource>;
11
8
  createDrive: (data: Drive, requestOptions?: GraphRequestOptions) => Promise<SpaceResource>;
@@ -59,7 +59,6 @@ export interface Resource {
59
59
  user?: User;
60
60
  ability?: Ability;
61
61
  }): boolean;
62
- canDeny?(): boolean;
63
62
  canEditTags?(): boolean;
64
63
  getDomSelector?(): string;
65
64
  isReceivedShare?(): boolean;
@@ -34,7 +34,7 @@ export interface OutgoingShareResource extends ShareResource {
34
34
  export interface IncomingShareResource extends ShareResource {
35
35
  hidden: boolean;
36
36
  syncEnabled: boolean;
37
- shareRoles: UnifiedRoleDefinition[];
37
+ shareRoles: ShareRole[];
38
38
  sharePermissions: GraphSharePermission[];
39
39
  }
40
40
  export interface ShareRole extends UnifiedRoleDefinition {
@@ -1,11 +1,12 @@
1
1
  import { Resource } from '../resource';
2
2
  import { PublicSpaceResource, ShareSpaceResource, SpaceResource } from './types';
3
3
  import { Drive } from '@opencloud-eu/web-client/graph/generated';
4
- import { CollaboratorShare } from '../share';
4
+ import { CollaboratorShare, ShareRole } from '../share';
5
5
  export declare function buildWebDavSpacesPath(storageId: string, path?: string): string;
6
6
  export declare function buildWebDavSpacesTrashPath(storageId: string, path?: string): string;
7
7
  export declare function getRelativeSpecialFolderSpacePath(space: SpaceResource, type: 'image' | 'readme'): string;
8
8
  export declare function isManager(share: CollaboratorShare): boolean;
9
+ export declare const getSpaceManagers: (space: SpaceResource, graphRoles: Record<string, ShareRole>) => import('../../graph/generated').Permission[];
9
10
  export type PublicLinkType = 'ocm' | 'public-link';
10
11
  export declare function buildPublicSpaceResource(data: any & {
11
12
  publicLinkType: PublicLinkType;
@@ -78,6 +78,7 @@ export interface Capabilities {
78
78
  version?: string;
79
79
  versionstring?: string;
80
80
  };
81
+ 'check-for-updates'?: boolean;
81
82
  'support-sse'?: boolean;
82
83
  'support-url-signing'?: boolean;
83
84
  'webdav-root'?: string;
@@ -43,5 +43,5 @@ export interface WebDAV {
43
43
  search: ReturnType<typeof SearchFactory>['search'];
44
44
  listFavoriteFiles: ReturnType<typeof ListFavoriteFilesFactory>['listFavoriteFiles'];
45
45
  setFavorite: ReturnType<typeof SetFavoriteFactory>['setFavorite'];
46
- registerExtraProp(name: string): any;
46
+ registerExtraProp(name: string): void;
47
47
  }
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./graph/generated.cjs");const e=require("../index-CcmRJ1qB.cjs");exports.graph=e.graph;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./graph/generated.cjs");const e=require("../index-BtN57j2H.cjs");exports.graph=e.graph;
@@ -1,5 +1,5 @@
1
1
  import "./graph/generated.js";
2
- import { g as a } from "../index-CiqYiARd.js";
2
+ import { g as a } from "../index-DRZfsp9q.js";
3
3
  export {
4
4
  a as graph
5
5
  };
@@ -22,4 +22,4 @@ Actual: `+i.attribValue);else{var h=i.tag,p=i.tags[i.tags.length-1]||i;h.ns===p.
22
22
  `?(r.line++,r.column=0):r.column++),r.state){case d.BEGIN:if(r.state=d.BEGIN_WHITESPACE,w==="\uFEFF")continue;$(r,w);continue;case d.BEGIN_WHITESPACE:$(r,w);continue;case d.TEXT:if(r.sawRoot&&!r.closedRoot){for(var h=R-1;w&&w!=="<"&&w!=="&";)w=J(i,R++),w&&r.trackPosition&&(r.position++,w===`
23
23
  `?(r.line++,r.column=0):r.column++);r.textNode+=i.substring(h,R-1)}w==="<"&&!(r.sawRoot&&r.closedRoot&&!r.strict)?(r.state=d.OPEN_WAKA,r.startTagPosition=r.position):(!a(w)&&(!r.sawRoot||r.closedRoot)&&Z(r,"Text data outside of root node."),w==="&"?r.state=d.TEXT_ENTITY:r.textNode+=w);continue;case d.SCRIPT:w==="<"?r.state=d.SCRIPT_ENDING:r.script+=w;continue;case d.SCRIPT_ENDING:w==="/"?r.state=d.CLOSE_TAG:(r.script+="<"+w,r.state=d.SCRIPT);continue;case d.OPEN_WAKA:if(w==="!")r.state=d.SGML_DECL,r.sgmlDecl="";else if(!a(w))if(S(L,w))r.state=d.OPEN_TAG,r.tagName=w;else if(w==="/")r.state=d.CLOSE_TAG,r.tagName="";else if(w==="?")r.state=d.PROC_INST,r.procInstName=r.procInstBody="";else{if(Z(r,"Unencoded <"),r.startTagPosition+1<r.position){var p=r.position-r.startTagPosition;w=new Array(p).join(" ")+w}r.textNode+="<"+w,r.state=d.TEXT}continue;case d.SGML_DECL:if(r.sgmlDecl+w==="--"){r.state=d.COMMENT,r.comment="",r.sgmlDecl="";continue}r.doctype&&r.doctype!==!0&&r.sgmlDecl?(r.state=d.DOCTYPE_DTD,r.doctype+="<!"+r.sgmlDecl+w,r.sgmlDecl=""):(r.sgmlDecl+w).toUpperCase()===N?(x(r,"onopencdata"),r.state=d.CDATA,r.sgmlDecl="",r.cdata=""):(r.sgmlDecl+w).toUpperCase()===P?(r.state=d.DOCTYPE,(r.doctype||r.sawRoot)&&Z(r,"Inappropriately located doctype declaration"),r.doctype="",r.sgmlDecl=""):w===">"?(x(r,"onsgmldeclaration",r.sgmlDecl),r.sgmlDecl="",r.state=d.TEXT):(g(w)&&(r.state=d.SGML_DECL_QUOTED),r.sgmlDecl+=w);continue;case d.SGML_DECL_QUOTED:w===r.q&&(r.state=d.SGML_DECL,r.q=""),r.sgmlDecl+=w;continue;case d.DOCTYPE:w===">"?(r.state=d.TEXT,x(r,"ondoctype",r.doctype),r.doctype=!0):(r.doctype+=w,w==="["?r.state=d.DOCTYPE_DTD:g(w)&&(r.state=d.DOCTYPE_QUOTED,r.q=w));continue;case d.DOCTYPE_QUOTED:r.doctype+=w,w===r.q&&(r.q="",r.state=d.DOCTYPE);continue;case d.DOCTYPE_DTD:w==="]"?(r.doctype+=w,r.state=d.DOCTYPE):w==="<"?(r.state=d.OPEN_WAKA,r.startTagPosition=r.position):g(w)?(r.doctype+=w,r.state=d.DOCTYPE_DTD_QUOTED,r.q=w):r.doctype+=w;continue;case d.DOCTYPE_DTD_QUOTED:r.doctype+=w,w===r.q&&(r.state=d.DOCTYPE_DTD,r.q="");continue;case d.COMMENT:w==="-"?r.state=d.COMMENT_ENDING:r.comment+=w;continue;case d.COMMENT_ENDING:w==="-"?(r.state=d.COMMENT_ENDED,r.comment=re(r.opt,r.comment),r.comment&&x(r,"oncomment",r.comment),r.comment=""):(r.comment+="-"+w,r.state=d.COMMENT);continue;case d.COMMENT_ENDED:w!==">"?(Z(r,"Malformed comment"),r.comment+="--"+w,r.state=d.COMMENT):r.doctype&&r.doctype!==!0?r.state=d.DOCTYPE_DTD:r.state=d.TEXT;continue;case d.CDATA:w==="]"?r.state=d.CDATA_ENDING:r.cdata+=w;continue;case d.CDATA_ENDING:w==="]"?r.state=d.CDATA_ENDING_2:(r.cdata+="]"+w,r.state=d.CDATA);continue;case d.CDATA_ENDING_2:w===">"?(r.cdata&&x(r,"oncdata",r.cdata),x(r,"onclosecdata"),r.cdata="",r.state=d.TEXT):w==="]"?r.cdata+="]":(r.cdata+="]]"+w,r.state=d.CDATA);continue;case d.PROC_INST:w==="?"?r.state=d.PROC_INST_ENDING:a(w)?r.state=d.PROC_INST_BODY:r.procInstName+=w;continue;case d.PROC_INST_BODY:if(!r.procInstBody&&a(w))continue;w==="?"?r.state=d.PROC_INST_ENDING:r.procInstBody+=w;continue;case d.PROC_INST_ENDING:w===">"?(x(r,"onprocessinginstruction",{name:r.procInstName,body:r.procInstBody}),r.procInstName=r.procInstBody="",r.state=d.TEXT):(r.procInstBody+="?"+w,r.state=d.PROC_INST_BODY);continue;case d.OPEN_TAG:S(c,w)?r.tagName+=w:(ce(r),w===">"?ge(r):w==="/"?r.state=d.OPEN_TAG_SLASH:(a(w)||Z(r,"Invalid character in tag name"),r.state=d.ATTRIB));continue;case d.OPEN_TAG_SLASH:w===">"?(ge(r,!0),D(r)):(Z(r,"Forward-slash in opening tag not followed by >"),r.state=d.ATTRIB);continue;case d.ATTRIB:if(a(w))continue;w===">"?ge(r):w==="/"?r.state=d.OPEN_TAG_SLASH:S(L,w)?(r.attribName=w,r.attribValue="",r.state=d.ATTRIB_NAME):Z(r,"Invalid attribute name");continue;case d.ATTRIB_NAME:w==="="?r.state=d.ATTRIB_VALUE:w===">"?(Z(r,"Attribute without value"),r.attribValue=r.attribName,ye(r),ge(r)):a(w)?r.state=d.ATTRIB_NAME_SAW_WHITE:S(c,w)?r.attribName+=w:Z(r,"Invalid attribute name");continue;case d.ATTRIB_NAME_SAW_WHITE:if(w==="=")r.state=d.ATTRIB_VALUE;else{if(a(w))continue;Z(r,"Attribute without value"),r.tag.attributes[r.attribName]="",r.attribValue="",x(r,"onattribute",{name:r.attribName,value:""}),r.attribName="",w===">"?ge(r):S(L,w)?(r.attribName=w,r.state=d.ATTRIB_NAME):(Z(r,"Invalid attribute name"),r.state=d.ATTRIB)}continue;case d.ATTRIB_VALUE:if(a(w))continue;g(w)?(r.q=w,r.state=d.ATTRIB_VALUE_QUOTED):(r.opt.unquotedAttributeValues||ie(r,"Unquoted attribute value"),r.state=d.ATTRIB_VALUE_UNQUOTED,r.attribValue=w);continue;case d.ATTRIB_VALUE_QUOTED:if(w!==r.q){w==="&"?r.state=d.ATTRIB_VALUE_ENTITY_Q:r.attribValue+=w;continue}ye(r),r.q="",r.state=d.ATTRIB_VALUE_CLOSED;continue;case d.ATTRIB_VALUE_CLOSED:a(w)?r.state=d.ATTRIB:w===">"?ge(r):w==="/"?r.state=d.OPEN_TAG_SLASH:S(L,w)?(Z(r,"No whitespace between attributes"),r.attribName=w,r.attribValue="",r.state=d.ATTRIB_NAME):Z(r,"Invalid attribute name");continue;case d.ATTRIB_VALUE_UNQUOTED:if(!T(w)){w==="&"?r.state=d.ATTRIB_VALUE_ENTITY_U:r.attribValue+=w;continue}ye(r),w===">"?ge(r):r.state=d.ATTRIB;continue;case d.CLOSE_TAG:if(r.tagName)w===">"?D(r):S(c,w)?r.tagName+=w:r.script?(r.script+="</"+r.tagName,r.tagName="",r.state=d.SCRIPT):(a(w)||Z(r,"Invalid tagname in closing tag"),r.state=d.CLOSE_TAG_SAW_WHITE);else{if(a(w))continue;F(L,w)?r.script?(r.script+="</"+w,r.state=d.SCRIPT):Z(r,"Invalid tagname in closing tag."):r.tagName=w}continue;case d.CLOSE_TAG_SAW_WHITE:if(a(w))continue;w===">"?D(r):Z(r,"Invalid characters in closing tag");continue;case d.TEXT_ENTITY:case d.ATTRIB_VALUE_ENTITY_Q:case d.ATTRIB_VALUE_ENTITY_U:var U,W;switch(r.state){case d.TEXT_ENTITY:U=d.TEXT,W="textNode";break;case d.ATTRIB_VALUE_ENTITY_Q:U=d.ATTRIB_VALUE_QUOTED,W="attribValue";break;case d.ATTRIB_VALUE_ENTITY_U:U=d.ATTRIB_VALUE_UNQUOTED,W="attribValue";break}if(w===";"){var Q=j(r);r.opt.unparsedEntities&&!Object.values(o.XML_ENTITIES).includes(Q)?(r.entity="",r.state=U,r.write(Q)):(r[W]+=Q,r.entity="",r.state=U)}else S(r.entity.length?s:E,w)?r.entity+=w:(Z(r,"Invalid character in entity name"),r[W]+="&"+r.entity+w,r.entity="",r.state=U);continue;default:throw new Error(r,"Unknown state: "+r.state)}return r.position>=r.bufferCheckPosition&&m(r),r}/*! http://mths.be/fromcodepoint v0.1.0 by @mathias */String.fromCodePoint||(function(){var i=String.fromCharCode,r=Math.floor,R=function(){var w=16384,h=[],p,U,W=-1,Q=arguments.length;if(!Q)return"";for(var Y="";++W<Q;){var z=Number(arguments[W]);if(!isFinite(z)||z<0||z>1114111||r(z)!==z)throw RangeError("Invalid code point: "+z);z<=65535?h.push(z):(z-=65536,p=(z>>10)+55296,U=z%1024+56320,h.push(p,U)),(W+1===Q||h.length>w)&&(Y+=i.apply(null,h),h.length=0)}return Y};Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:R,configurable:!0,writable:!0}):String.fromCodePoint=R})()})(n)})(ut)),ut}var Rr,yi;function kr(){return yi||(yi=1,Rr={isArray:function(n){return Array.isArray?Array.isArray(n):Object.prototype.toString.call(n)==="[object Array]"}}),Rr}var xr,gi;function Hr(){if(gi)return xr;gi=1;var n=kr().isArray;return xr={copyOptions:function(o){var l,u={};for(l in o)o.hasOwnProperty(l)&&(u[l]=o[l]);return u},ensureFlagExists:function(o,l){(!(o in l)||typeof l[o]!="boolean")&&(l[o]=!1)},ensureSpacesExists:function(o){(!("spaces"in o)||typeof o.spaces!="number"&&typeof o.spaces!="string")&&(o.spaces=0)},ensureAlwaysArrayExists:function(o){(!("alwaysArray"in o)||typeof o.alwaysArray!="boolean"&&!n(o.alwaysArray))&&(o.alwaysArray=!1)},ensureKeyExists:function(o,l){(!(o+"Key"in l)||typeof l[o+"Key"]!="string")&&(l[o+"Key"]=l.compact?"_"+o:o)},checkFnExists:function(o,l){return o+"Fn"in l}},xr}var Ir,bi;function Gi(){if(bi)return Ir;bi=1;var n=no(),o=Hr(),l=kr().isArray,u,m;function y(c){return u=o.copyOptions(c),o.ensureFlagExists("ignoreDeclaration",u),o.ensureFlagExists("ignoreInstruction",u),o.ensureFlagExists("ignoreAttributes",u),o.ensureFlagExists("ignoreText",u),o.ensureFlagExists("ignoreComment",u),o.ensureFlagExists("ignoreCdata",u),o.ensureFlagExists("ignoreDoctype",u),o.ensureFlagExists("compact",u),o.ensureFlagExists("alwaysChildren",u),o.ensureFlagExists("addParent",u),o.ensureFlagExists("trim",u),o.ensureFlagExists("nativeType",u),o.ensureFlagExists("nativeTypeAttributes",u),o.ensureFlagExists("sanitize",u),o.ensureFlagExists("instructionHasAttributes",u),o.ensureFlagExists("captureSpacesBetweenElements",u),o.ensureAlwaysArrayExists(u),o.ensureKeyExists("declaration",u),o.ensureKeyExists("instruction",u),o.ensureKeyExists("attributes",u),o.ensureKeyExists("text",u),o.ensureKeyExists("comment",u),o.ensureKeyExists("cdata",u),o.ensureKeyExists("doctype",u),o.ensureKeyExists("type",u),o.ensureKeyExists("name",u),o.ensureKeyExists("elements",u),o.ensureKeyExists("parent",u),o.checkFnExists("doctype",u),o.checkFnExists("instruction",u),o.checkFnExists("cdata",u),o.checkFnExists("comment",u),o.checkFnExists("text",u),o.checkFnExists("instructionName",u),o.checkFnExists("elementName",u),o.checkFnExists("attributeName",u),o.checkFnExists("attributeValue",u),o.checkFnExists("attributes",u),u}function A(c){var E=Number(c);if(!isNaN(E))return E;var s=c.toLowerCase();return s==="true"?!0:s==="false"?!1:c}function v(c,E){var s;if(u.compact){if(!m[u[c+"Key"]]&&(l(u.alwaysArray)?u.alwaysArray.indexOf(u[c+"Key"])!==-1:u.alwaysArray)&&(m[u[c+"Key"]]=[]),m[u[c+"Key"]]&&!l(m[u[c+"Key"]])&&(m[u[c+"Key"]]=[m[u[c+"Key"]]]),c+"Fn"in u&&typeof E=="string"&&(E=u[c+"Fn"](E,m)),c==="instruction"&&("instructionFn"in u||"instructionNameFn"in u)){for(s in E)if(E.hasOwnProperty(s))if("instructionFn"in u)E[s]=u.instructionFn(E[s],s,m);else{var a=E[s];delete E[s],E[u.instructionNameFn(s,a,m)]=a}}l(m[u[c+"Key"]])?m[u[c+"Key"]].push(E):m[u[c+"Key"]]=E}else{m[u.elementsKey]||(m[u.elementsKey]=[]);var g={};if(g[u.typeKey]=c,c==="instruction"){for(s in E)if(E.hasOwnProperty(s))break;g[u.nameKey]="instructionNameFn"in u?u.instructionNameFn(s,E,m):s,u.instructionHasAttributes?(g[u.attributesKey]=E[s][u.attributesKey],"instructionFn"in u&&(g[u.attributesKey]=u.instructionFn(g[u.attributesKey],s,m))):("instructionFn"in u&&(E[s]=u.instructionFn(E[s],s,m)),g[u.instructionKey]=E[s])}else c+"Fn"in u&&(E=u[c+"Fn"](E,m)),g[u[c+"Key"]]=E;u.addParent&&(g[u.parentKey]=m),m[u.elementsKey].push(g)}}function _(c){if("attributesFn"in u&&c&&(c=u.attributesFn(c,m)),(u.trim||"attributeValueFn"in u||"attributeNameFn"in u||u.nativeTypeAttributes)&&c){var E;for(E in c)if(c.hasOwnProperty(E)&&(u.trim&&(c[E]=c[E].trim()),u.nativeTypeAttributes&&(c[E]=A(c[E])),"attributeValueFn"in u&&(c[E]=u.attributeValueFn(c[E],E,m)),"attributeNameFn"in u)){var s=c[E];delete c[E],c[u.attributeNameFn(E,c[E],m)]=s}}return c}function B(c){var E={};if(c.body&&(c.name.toLowerCase()==="xml"||u.instructionHasAttributes)){for(var s=/([\w:-]+)\s*=\s*(?:"([^"]*)"|'([^']*)'|(\w+))\s*/g,a;(a=s.exec(c.body))!==null;)E[a[1]]=a[2]||a[3]||a[4];E=_(E)}if(c.name.toLowerCase()==="xml"){if(u.ignoreDeclaration)return;m[u.declarationKey]={},Object.keys(E).length&&(m[u.declarationKey][u.attributesKey]=E),u.addParent&&(m[u.declarationKey][u.parentKey]=m)}else{if(u.ignoreInstruction)return;u.trim&&(c.body=c.body.trim());var g={};u.instructionHasAttributes&&Object.keys(E).length?(g[c.name]={},g[c.name][u.attributesKey]=E):g[c.name]=c.body,v("instruction",g)}}function C(c,E){var s;if(typeof c=="object"&&(E=c.attributes,c=c.name),E=_(E),"elementNameFn"in u&&(c=u.elementNameFn(c,m)),u.compact){if(s={},!u.ignoreAttributes&&E&&Object.keys(E).length){s[u.attributesKey]={};var a;for(a in E)E.hasOwnProperty(a)&&(s[u.attributesKey][a]=E[a])}!(c in m)&&(l(u.alwaysArray)?u.alwaysArray.indexOf(c)!==-1:u.alwaysArray)&&(m[c]=[]),m[c]&&!l(m[c])&&(m[c]=[m[c]]),l(m[c])?m[c].push(s):m[c]=s}else m[u.elementsKey]||(m[u.elementsKey]=[]),s={},s[u.typeKey]="element",s[u.nameKey]=c,!u.ignoreAttributes&&E&&Object.keys(E).length&&(s[u.attributesKey]=E),u.alwaysChildren&&(s[u.elementsKey]=[]),m[u.elementsKey].push(s);s[u.parentKey]=m,m=s}function N(c){u.ignoreText||!c.trim()&&!u.captureSpacesBetweenElements||(u.trim&&(c=c.trim()),u.nativeType&&(c=A(c)),u.sanitize&&(c=c.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")),v("text",c))}function P(c){u.ignoreComment||(u.trim&&(c=c.trim()),v("comment",c))}function V(c){var E=m[u.parentKey];u.addParent||delete m[u.parentKey],m=E}function q(c){u.ignoreCdata||(u.trim&&(c=c.trim()),v("cdata",c))}function H(c){u.ignoreDoctype||(c=c.replace(/^ /,""),u.trim&&(c=c.trim()),v("doctype",c))}function L(c){c.note=c}return Ir=function(c,E){var s=n.parser(!0,{}),a={};if(m=a,u=y(E),s.opt={strictEntities:!0},s.onopentag=C,s.ontext=N,s.oncomment=P,s.onclosetag=V,s.onerror=L,s.oncdata=q,s.ondoctype=H,s.onprocessinginstruction=B,s.write(c).close(),a[u.elementsKey]){var g=a[u.elementsKey];delete a[u.elementsKey],a[u.elementsKey]=g,delete a.text}return a},Ir}var Fr,mi;function io(){if(mi)return Fr;mi=1;var n=Hr(),o=Gi();function l(u){var m=n.copyOptions(u);return n.ensureSpacesExists(m),m}return Fr=function(u,m){var y,A,v,_;return y=l(m),A=o(u,y),_="compact"in y&&y.compact?"_parent":"parent","addParent"in y&&y.addParent?v=JSON.stringify(A,function(B,C){return B===_?"_":C},y.spaces):v=JSON.stringify(A,null,y.spaces),v.replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")},Fr}var Or,Ei;function Ki(){if(Ei)return Or;Ei=1;var n=Hr(),o=kr().isArray,l,u;function m(s){var a=n.copyOptions(s);return n.ensureFlagExists("ignoreDeclaration",a),n.ensureFlagExists("ignoreInstruction",a),n.ensureFlagExists("ignoreAttributes",a),n.ensureFlagExists("ignoreText",a),n.ensureFlagExists("ignoreComment",a),n.ensureFlagExists("ignoreCdata",a),n.ensureFlagExists("ignoreDoctype",a),n.ensureFlagExists("compact",a),n.ensureFlagExists("indentText",a),n.ensureFlagExists("indentCdata",a),n.ensureFlagExists("indentAttributes",a),n.ensureFlagExists("indentInstruction",a),n.ensureFlagExists("fullTagEmptyElement",a),n.ensureFlagExists("noQuotesForNativeAttributes",a),n.ensureSpacesExists(a),typeof a.spaces=="number"&&(a.spaces=Array(a.spaces+1).join(" ")),n.ensureKeyExists("declaration",a),n.ensureKeyExists("instruction",a),n.ensureKeyExists("attributes",a),n.ensureKeyExists("text",a),n.ensureKeyExists("comment",a),n.ensureKeyExists("cdata",a),n.ensureKeyExists("doctype",a),n.ensureKeyExists("type",a),n.ensureKeyExists("name",a),n.ensureKeyExists("elements",a),n.checkFnExists("doctype",a),n.checkFnExists("instruction",a),n.checkFnExists("cdata",a),n.checkFnExists("comment",a),n.checkFnExists("text",a),n.checkFnExists("instructionName",a),n.checkFnExists("elementName",a),n.checkFnExists("attributeName",a),n.checkFnExists("attributeValue",a),n.checkFnExists("attributes",a),n.checkFnExists("fullTagEmptyElement",a),a}function y(s,a,g){return(!g&&s.spaces?`
24
24
  `:"")+Array(a+1).join(s.spaces)}function A(s,a,g){if(a.ignoreAttributes)return"";"attributesFn"in a&&(s=a.attributesFn(s,u,l));var T,S,F,d,K=[];for(T in s)s.hasOwnProperty(T)&&s[T]!==null&&s[T]!==void 0&&(d=a.noQuotesForNativeAttributes&&typeof s[T]!="string"?"":'"',S=""+s[T],S=S.replace(/"/g,"&quot;"),F="attributeNameFn"in a?a.attributeNameFn(T,S,u,l):T,K.push(a.spaces&&a.indentAttributes?y(a,g+1,!1):" "),K.push(F+"="+d+("attributeValueFn"in a?a.attributeValueFn(S,T,u,l):S)+d));return s&&Object.keys(s).length&&a.spaces&&a.indentAttributes&&K.push(y(a,g,!1)),K.join("")}function v(s,a,g){return l=s,u="xml",a.ignoreDeclaration?"":"<?xml"+A(s[a.attributesKey],a,g)+"?>"}function _(s,a,g){if(a.ignoreInstruction)return"";var T;for(T in s)if(s.hasOwnProperty(T))break;var S="instructionNameFn"in a?a.instructionNameFn(T,s[T],u,l):T;if(typeof s[T]=="object")return l=s,u=S,"<?"+S+A(s[T][a.attributesKey],a,g)+"?>";var F=s[T]?s[T]:"";return"instructionFn"in a&&(F=a.instructionFn(F,T,u,l)),"<?"+S+(F?" "+F:"")+"?>"}function B(s,a){return a.ignoreComment?"":"<!--"+("commentFn"in a?a.commentFn(s,u,l):s)+"-->"}function C(s,a){return a.ignoreCdata?"":"<![CDATA["+("cdataFn"in a?a.cdataFn(s,u,l):s.replace("]]>","]]]]><![CDATA[>"))+"]]>"}function N(s,a){return a.ignoreDoctype?"":"<!DOCTYPE "+("doctypeFn"in a?a.doctypeFn(s,u,l):s)+">"}function P(s,a){return a.ignoreText?"":(s=""+s,s=s.replace(/&amp;/g,"&"),s=s.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),"textFn"in a?a.textFn(s,u,l):s)}function V(s,a){var g;if(s.elements&&s.elements.length)for(g=0;g<s.elements.length;++g)switch(s.elements[g][a.typeKey]){case"text":if(a.indentText)return!0;break;case"cdata":if(a.indentCdata)return!0;break;case"instruction":if(a.indentInstruction)return!0;break;case"doctype":case"comment":case"element":return!0;default:return!0}return!1}function q(s,a,g){l=s,u=s.name;var T=[],S="elementNameFn"in a?a.elementNameFn(s.name,s):s.name;T.push("<"+S),s[a.attributesKey]&&T.push(A(s[a.attributesKey],a,g));var F=s[a.elementsKey]&&s[a.elementsKey].length||s[a.attributesKey]&&s[a.attributesKey]["xml:space"]==="preserve";return F||("fullTagEmptyElementFn"in a?F=a.fullTagEmptyElementFn(s.name,s):F=a.fullTagEmptyElement),F?(T.push(">"),s[a.elementsKey]&&s[a.elementsKey].length&&(T.push(H(s[a.elementsKey],a,g+1)),l=s,u=s.name),T.push(a.spaces&&V(s,a)?`
25
- `+Array(g+1).join(a.spaces):""),T.push("</"+S+">")):T.push("/>"),T.join("")}function H(s,a,g,T){return s.reduce(function(S,F){var d=y(a,g,T&&!S);switch(F.type){case"element":return S+d+q(F,a,g);case"comment":return S+d+B(F[a.commentKey],a);case"doctype":return S+d+N(F[a.doctypeKey],a);case"cdata":return S+(a.indentCdata?d:"")+C(F[a.cdataKey],a);case"text":return S+(a.indentText?d:"")+P(F[a.textKey],a);case"instruction":var K={};return K[F[a.nameKey]]=F[a.attributesKey]?F:F[a.instructionKey],S+(a.indentInstruction?d:"")+_(K,a,g)}},"")}function L(s,a,g){var T;for(T in s)if(s.hasOwnProperty(T))switch(T){case a.parentKey:case a.attributesKey:break;case a.textKey:if(a.indentText||g)return!0;break;case a.cdataKey:if(a.indentCdata||g)return!0;break;case a.instructionKey:if(a.indentInstruction||g)return!0;break;case a.doctypeKey:case a.commentKey:return!0;default:return!0}return!1}function c(s,a,g,T,S){l=s,u=a;var F="elementNameFn"in g?g.elementNameFn(a,s):a;if(typeof s>"u"||s===null||s==="")return"fullTagEmptyElementFn"in g&&g.fullTagEmptyElementFn(a,s)||g.fullTagEmptyElement?"<"+F+"></"+F+">":"<"+F+"/>";var d=[];if(a){if(d.push("<"+F),typeof s!="object")return d.push(">"+P(s,g)+"</"+F+">"),d.join("");s[g.attributesKey]&&d.push(A(s[g.attributesKey],g,T));var K=L(s,g,!0)||s[g.attributesKey]&&s[g.attributesKey]["xml:space"]==="preserve";if(K||("fullTagEmptyElementFn"in g?K=g.fullTagEmptyElementFn(a,s):K=g.fullTagEmptyElement),K)d.push(">");else return d.push("/>"),d.join("")}return d.push(E(s,g,T+1,!1)),l=s,u=a,a&&d.push((S?y(g,T,!1):"")+"</"+F+">"),d.join("")}function E(s,a,g,T){var S,F,d,K=[];for(F in s)if(s.hasOwnProperty(F))for(d=o(s[F])?s[F]:[s[F]],S=0;S<d.length;++S){switch(F){case a.declarationKey:K.push(v(d[S],a,g));break;case a.instructionKey:K.push((a.indentInstruction?y(a,g,T):"")+_(d[S],a,g));break;case a.attributesKey:case a.parentKey:break;case a.textKey:K.push((a.indentText?y(a,g,T):"")+P(d[S],a));break;case a.cdataKey:K.push((a.indentCdata?y(a,g,T):"")+C(d[S],a));break;case a.doctypeKey:K.push(y(a,g,T)+N(d[S],a));break;case a.commentKey:K.push(y(a,g,T)+B(d[S],a));break;default:K.push(y(a,g,T)+c(d[S],F,a,g,L(d[S],a)))}T=T&&!K.length}return K.join("")}return Or=function(s,a){a=m(a);var g=[];return l=s,u="_root_",a.compact?g.push(E(s,a,0,!0)):(s[a.declarationKey]&&g.push(v(s[a.declarationKey],a,0)),s[a.elementsKey]&&s[a.elementsKey].length&&g.push(H(s[a.elementsKey],a,0,!g.length))),g.join("")},Or}var Br,vi;function ao(){if(vi)return Br;vi=1;var n=Ki();return Br=function(o,l){o instanceof te.Buffer&&(o=o.toString());var u=null;if(typeof o=="string")try{u=JSON.parse(o)}catch{throw new Error("The JSON structure is invalid")}else u=o;return n(u,l)},Br}var Nr,wi;function oo(){if(wi)return Nr;wi=1;var n=Gi(),o=io(),l=Ki(),u=ao();return Nr={xml2js:n,xml2json:o,js2xml:l,json2xml:u},Nr}var uo=oo();const so=me.getDefaultExportFromCjs(uo);/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function fo(n){return n instanceof Uint8Array||ArrayBuffer.isView(n)&&n.constructor.name==="Uint8Array"}function qe(n,o=""){if(!Number.isSafeInteger(n)||n<0){const l=o&&`"${o}" `;throw new Error(`${l}expected integer >0, got ${n}`)}}function ke(n,o,l=""){const u=fo(n),m=n?.length,y=o!==void 0;if(!u||y&&m!==o){const A=l&&`"${l}" `,v=y?` of length ${o}`:"",_=u?`length=${m}`:`type=${typeof n}`;throw new Error(A+"expected Uint8Array"+v+", got "+_)}return n}function $i(n){if(typeof n!="function"||typeof n.create!="function")throw new Error("Hash must wrapped by utils.createHasher");qe(n.outputLen),qe(n.blockLen)}function et(n,o=!0){if(n.destroyed)throw new Error("Hash instance has been destroyed");if(o&&n.finished)throw new Error("Hash#digest() has already been called")}function lo(n,o){ke(n,void 0,"digestInto() output");const l=o.outputLen;if(n.length<l)throw new Error('"digestInto() output" expected to be of length >='+l)}function He(...n){for(let o=0;o<n.length;o++)n[o].fill(0)}function Ze(n){return new DataView(n.buffer,n.byteOffset,n.byteLength)}function co(n){if(typeof n!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(n))}function _i(n,o=""){return typeof n=="string"?co(n):ke(n,void 0,o)}function ho(n,o){if(o!==void 0&&{}.toString.call(o)!=="[object Object]")throw new Error("options must be object or undefined");return Object.assign(n,o)}function po(n,o={}){const l=(m,y)=>n(y).update(m).digest(),u=n(void 0);return l.outputLen=u.outputLen,l.blockLen=u.blockLen,l.create=m=>n(m),Object.assign(l,o),Object.freeze(l)}const yo=n=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,n])});class Wi{oHash;iHash;blockLen;outputLen;finished=!1;destroyed=!1;constructor(o,l){if($i(o),ke(l,void 0,"key"),this.iHash=o.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const u=this.blockLen,m=new Uint8Array(u);m.set(l.length>u?o.create().update(l).digest():l);for(let y=0;y<m.length;y++)m[y]^=54;this.iHash.update(m),this.oHash=o.create();for(let y=0;y<m.length;y++)m[y]^=106;this.oHash.update(m),He(m)}update(o){return et(this),this.iHash.update(o),this}digestInto(o){et(this),ke(o,this.outputLen,"output"),this.finished=!0,this.iHash.digestInto(o),this.oHash.update(o),this.oHash.digestInto(o),this.destroy()}digest(){const o=new Uint8Array(this.oHash.outputLen);return this.digestInto(o),o}_cloneInto(o){o||=Object.create(Object.getPrototypeOf(this),{});const{oHash:l,iHash:u,finished:m,destroyed:y,blockLen:A,outputLen:v}=this;return o=o,o.finished=m,o.destroyed=y,o.blockLen=A,o.outputLen=v,o.oHash=l._cloneInto(o.oHash),o.iHash=u._cloneInto(o.iHash),o}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const Vi=(n,o,l)=>new Wi(n,o).update(l).digest();Vi.create=(n,o)=>new Wi(n,o);function go(n,o,l,u){$i(n);const m=ho({dkLen:32,asyncTick:10},u),{c:y,dkLen:A,asyncTick:v}=m;if(qe(y,"c"),qe(A,"dkLen"),qe(v,"asyncTick"),y<1)throw new Error("iterations (c) must be >= 1");const _=_i(o,"password"),B=_i(l,"salt"),C=new Uint8Array(A),N=Vi.create(n,_),P=N._cloneInto().update(B);return{c:y,dkLen:A,asyncTick:v,DK:C,PRF:N,PRFSalt:P}}function bo(n,o,l,u,m){return n.destroy(),o.destroy(),u&&u.destroy(),He(m),l}function mo(n,o,l,u){const{c:m,dkLen:y,DK:A,PRF:v,PRFSalt:_}=go(n,o,l,u);let B;const C=new Uint8Array(4),N=Ze(C),P=new Uint8Array(v.outputLen);for(let V=1,q=0;q<y;V++,q+=v.outputLen){const H=A.subarray(q,q+v.outputLen);N.setInt32(0,V,!1),(B=_._cloneInto(B)).update(C).digestInto(P),H.set(P.subarray(0,H.length));for(let L=1;L<m;L++){v._cloneInto(B).update(P).digestInto(P);for(let c=0;c<H.length;c++)H[c]^=P[c]}}return bo(v,_,A,B,P)}class Eo{blockLen;outputLen;padOffset;isLE;buffer;view;finished=!1;length=0;pos=0;destroyed=!1;constructor(o,l,u,m){this.blockLen=o,this.outputLen=l,this.padOffset=u,this.isLE=m,this.buffer=new Uint8Array(o),this.view=Ze(this.buffer)}update(o){et(this),ke(o);const{view:l,buffer:u,blockLen:m}=this,y=o.length;for(let A=0;A<y;){const v=Math.min(m-this.pos,y-A);if(v===m){const _=Ze(o);for(;m<=y-A;A+=m)this.process(_,A);continue}u.set(o.subarray(A,A+v),this.pos),this.pos+=v,A+=v,this.pos===m&&(this.process(l,0),this.pos=0)}return this.length+=o.length,this.roundClean(),this}digestInto(o){et(this),lo(o,this),this.finished=!0;const{buffer:l,view:u,blockLen:m,isLE:y}=this;let{pos:A}=this;l[A++]=128,He(this.buffer.subarray(A)),this.padOffset>m-A&&(this.process(u,0),A=0);for(let N=A;N<m;N++)l[N]=0;u.setBigUint64(m-8,BigInt(this.length*8),y),this.process(u,0);const v=Ze(o),_=this.outputLen;if(_%4)throw new Error("_sha2: outputLen must be aligned to 32bit");const B=_/4,C=this.get();if(B>C.length)throw new Error("_sha2: outputLen bigger than state");for(let N=0;N<B;N++)v.setUint32(4*N,C[N],y)}digest(){const{buffer:o,outputLen:l}=this;this.digestInto(o);const u=o.slice(0,l);return this.destroy(),u}_cloneInto(o){o||=new this.constructor,o.set(...this.get());const{blockLen:l,buffer:u,length:m,finished:y,destroyed:A,pos:v}=this;return o.destroyed=A,o.finished=y,o.length=m,o.pos=v,m%l&&o.buffer.set(u),o}clone(){return this._cloneInto()}}const Ee=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),ze=BigInt(2**32-1),Ai=BigInt(32);function vo(n,o=!1){return o?{h:Number(n&ze),l:Number(n>>Ai&ze)}:{h:Number(n>>Ai&ze)|0,l:Number(n&ze)|0}}function wo(n,o=!1){const l=n.length;let u=new Uint32Array(l),m=new Uint32Array(l);for(let y=0;y<l;y++){const{h:A,l:v}=vo(n[y],o);[u[y],m[y]]=[A,v]}return[u,m]}const Ti=(n,o,l)=>n>>>l,Si=(n,o,l)=>n<<32-l|o>>>l,Ce=(n,o,l)=>n>>>l|o<<32-l,De=(n,o,l)=>n<<32-l|o>>>l,Je=(n,o,l)=>n<<64-l|o>>>l-32,Qe=(n,o,l)=>n>>>l-32|o<<64-l;function Se(n,o,l,u){const m=(o>>>0)+(u>>>0);return{h:n+l+(m/2**32|0)|0,l:m|0}}const _o=(n,o,l)=>(n>>>0)+(o>>>0)+(l>>>0),Ao=(n,o,l,u)=>o+l+u+(n/2**32|0)|0,To=(n,o,l,u)=>(n>>>0)+(o>>>0)+(l>>>0)+(u>>>0),So=(n,o,l,u,m)=>o+l+u+m+(n/2**32|0)|0,Ro=(n,o,l,u,m)=>(n>>>0)+(o>>>0)+(l>>>0)+(u>>>0)+(m>>>0),xo=(n,o,l,u,m,y)=>o+l+u+m+y+(n/2**32|0)|0,Yi=wo(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(n=>BigInt(n))),Io=Yi[0],Fo=Yi[1],Ie=new Uint32Array(80),Fe=new Uint32Array(80);class Oo extends Eo{constructor(o){super(128,o,16,!1)}get(){const{Ah:o,Al:l,Bh:u,Bl:m,Ch:y,Cl:A,Dh:v,Dl:_,Eh:B,El:C,Fh:N,Fl:P,Gh:V,Gl:q,Hh:H,Hl:L}=this;return[o,l,u,m,y,A,v,_,B,C,N,P,V,q,H,L]}set(o,l,u,m,y,A,v,_,B,C,N,P,V,q,H,L){this.Ah=o|0,this.Al=l|0,this.Bh=u|0,this.Bl=m|0,this.Ch=y|0,this.Cl=A|0,this.Dh=v|0,this.Dl=_|0,this.Eh=B|0,this.El=C|0,this.Fh=N|0,this.Fl=P|0,this.Gh=V|0,this.Gl=q|0,this.Hh=H|0,this.Hl=L|0}process(o,l){for(let s=0;s<16;s++,l+=4)Ie[s]=o.getUint32(l),Fe[s]=o.getUint32(l+=4);for(let s=16;s<80;s++){const a=Ie[s-15]|0,g=Fe[s-15]|0,T=Ce(a,g,1)^Ce(a,g,8)^Ti(a,g,7),S=De(a,g,1)^De(a,g,8)^Si(a,g,7),F=Ie[s-2]|0,d=Fe[s-2]|0,K=Ce(F,d,19)^Je(F,d,61)^Ti(F,d,6),X=De(F,d,19)^Qe(F,d,61)^Si(F,d,6),x=To(S,X,Fe[s-7],Fe[s-16]),ee=So(x,T,K,Ie[s-7],Ie[s-16]);Ie[s]=ee|0,Fe[s]=x|0}let{Ah:u,Al:m,Bh:y,Bl:A,Ch:v,Cl:_,Dh:B,Dl:C,Eh:N,El:P,Fh:V,Fl:q,Gh:H,Gl:L,Hh:c,Hl:E}=this;for(let s=0;s<80;s++){const a=Ce(N,P,14)^Ce(N,P,18)^Je(N,P,41),g=De(N,P,14)^De(N,P,18)^Qe(N,P,41),T=N&V^~N&H,S=P&q^~P&L,F=Ro(E,g,S,Fo[s],Fe[s]),d=xo(F,c,a,T,Io[s],Ie[s]),K=F|0,X=Ce(u,m,28)^Je(u,m,34)^Je(u,m,39),x=De(u,m,28)^Qe(u,m,34)^Qe(u,m,39),ee=u&y^u&v^y&v,re=m&A^m&_^A&_;c=H|0,E=L|0,H=V|0,L=q|0,V=N|0,q=P|0,{h:N,l:P}=Se(B|0,C|0,d|0,K|0),B=v|0,C=_|0,v=y|0,_=A|0,y=u|0,A=m|0;const ie=_o(K,x,re);u=Ao(ie,d,X,ee),m=ie|0}({h:u,l:m}=Se(this.Ah|0,this.Al|0,u|0,m|0)),{h:y,l:A}=Se(this.Bh|0,this.Bl|0,y|0,A|0),{h:v,l:_}=Se(this.Ch|0,this.Cl|0,v|0,_|0),{h:B,l:C}=Se(this.Dh|0,this.Dl|0,B|0,C|0),{h:N,l:P}=Se(this.Eh|0,this.El|0,N|0,P|0),{h:V,l:q}=Se(this.Fh|0,this.Fl|0,V|0,q|0),{h:H,l:L}=Se(this.Gh|0,this.Gl|0,H|0,L|0),{h:c,l:E}=Se(this.Hh|0,this.Hl|0,c|0,E|0),this.set(u,m,y,A,v,_,B,C,N,P,V,q,H,L,c,E)}roundClean(){He(Ie,Fe)}destroy(){He(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}class Bo extends Oo{Ah=Ee[0]|0;Al=Ee[1]|0;Bh=Ee[2]|0;Bl=Ee[3]|0;Ch=Ee[4]|0;Cl=Ee[5]|0;Dh=Ee[6]|0;Dl=Ee[7]|0;Eh=Ee[8]|0;El=Ee[9]|0;Fh=Ee[10]|0;Fl=Ee[11]|0;Gh=Ee[12]|0;Gl=Ee[13]|0;Hh=Ee[14]|0;Hl=Ee[15]|0;constructor(){super(64)}}const No=po(()=>new Bo,yo(3)),Po=(n,o,l,u)=>te.Buffer.from(mo(No,n,o,{c:l,dkLen:u}));class Co{axiosClient;baseURI;signingKey;ALGORITHM="sha512";TTL=1200;HASH_LENGTH=32;ITERATION_COUNT=1e4;constructor({axiosClient:o,baseURI:l}){this.axiosClient=o,this.baseURI=l}async signUrl(o,l){const u=new URL(o);u.searchParams.set("OC-Credential",l),u.searchParams.set("OC-Date",new Date().toISOString()),u.searchParams.set("OC-Expires",this.TTL.toString()),u.searchParams.set("OC-Verb","GET");const m=await this.createHashedKey(u.toString());return u.searchParams.set("OC-Algo",`PBKDF2/${this.ITERATION_COUNT}-SHA512`),u.searchParams.set("OC-Signature",m),u.toString()}async getSignKey(){if(this.signingKey)return this.signingKey;const o=await this.axiosClient.get(me.urlJoin(this.baseURI,"ocs/v1.php/cloud/user/signing-key"),{headers:{"Content-Type":"application/x-www-form-urlencoded"}}),l=so.xml2js(o.data,{compact:!0});return this.signingKey=l.ocs.data["signing-key"]._text,this.signingKey}async createHashedKey(o){const l=await this.getSignKey();return Po(o,l,this.ITERATION_COUNT,this.HASH_LENGTH,this.ALGORITHM).toString("hex")}}const Do=(n,o)=>{const l=new URL(n);l.pathname=[...l.pathname.split("/"),"ocs","v1.php"].filter(Boolean).join("/");const u=l.href,m=Ri(u,o),y=new Co({baseURI:n,axiosClient:o});return{getCapabilities:()=>m.getCapabilities(),signUrl:(A,v)=>y.signUrl(A,v)}};exports.GetCapabilitiesFactory=Ri;exports.ocs=Do;
25
+ `+Array(g+1).join(a.spaces):""),T.push("</"+S+">")):T.push("/>"),T.join("")}function H(s,a,g,T){return s.reduce(function(S,F){var d=y(a,g,T&&!S);switch(F.type){case"element":return S+d+q(F,a,g);case"comment":return S+d+B(F[a.commentKey],a);case"doctype":return S+d+N(F[a.doctypeKey],a);case"cdata":return S+(a.indentCdata?d:"")+C(F[a.cdataKey],a);case"text":return S+(a.indentText?d:"")+P(F[a.textKey],a);case"instruction":var K={};return K[F[a.nameKey]]=F[a.attributesKey]?F:F[a.instructionKey],S+(a.indentInstruction?d:"")+_(K,a,g)}},"")}function L(s,a,g){var T;for(T in s)if(s.hasOwnProperty(T))switch(T){case a.parentKey:case a.attributesKey:break;case a.textKey:if(a.indentText||g)return!0;break;case a.cdataKey:if(a.indentCdata||g)return!0;break;case a.instructionKey:if(a.indentInstruction||g)return!0;break;case a.doctypeKey:case a.commentKey:return!0;default:return!0}return!1}function c(s,a,g,T,S){l=s,u=a;var F="elementNameFn"in g?g.elementNameFn(a,s):a;if(typeof s>"u"||s===null||s==="")return"fullTagEmptyElementFn"in g&&g.fullTagEmptyElementFn(a,s)||g.fullTagEmptyElement?"<"+F+"></"+F+">":"<"+F+"/>";var d=[];if(a){if(d.push("<"+F),typeof s!="object")return d.push(">"+P(s,g)+"</"+F+">"),d.join("");s[g.attributesKey]&&d.push(A(s[g.attributesKey],g,T));var K=L(s,g,!0)||s[g.attributesKey]&&s[g.attributesKey]["xml:space"]==="preserve";if(K||("fullTagEmptyElementFn"in g?K=g.fullTagEmptyElementFn(a,s):K=g.fullTagEmptyElement),K)d.push(">");else return d.push("/>"),d.join("")}return d.push(E(s,g,T+1,!1)),l=s,u=a,a&&d.push((S?y(g,T,!1):"")+"</"+F+">"),d.join("")}function E(s,a,g,T){var S,F,d,K=[];for(F in s)if(s.hasOwnProperty(F))for(d=o(s[F])?s[F]:[s[F]],S=0;S<d.length;++S){switch(F){case a.declarationKey:K.push(v(d[S],a,g));break;case a.instructionKey:K.push((a.indentInstruction?y(a,g,T):"")+_(d[S],a,g));break;case a.attributesKey:case a.parentKey:break;case a.textKey:K.push((a.indentText?y(a,g,T):"")+P(d[S],a));break;case a.cdataKey:K.push((a.indentCdata?y(a,g,T):"")+C(d[S],a));break;case a.doctypeKey:K.push(y(a,g,T)+N(d[S],a));break;case a.commentKey:K.push(y(a,g,T)+B(d[S],a));break;default:K.push(y(a,g,T)+c(d[S],F,a,g,L(d[S],a)))}T=T&&!K.length}return K.join("")}return Or=function(s,a){a=m(a);var g=[];return l=s,u="_root_",a.compact?g.push(E(s,a,0,!0)):(s[a.declarationKey]&&g.push(v(s[a.declarationKey],a,0)),s[a.elementsKey]&&s[a.elementsKey].length&&g.push(H(s[a.elementsKey],a,0,!g.length))),g.join("")},Or}var Br,vi;function ao(){if(vi)return Br;vi=1;var n=Ki();return Br=function(o,l){o instanceof te.Buffer&&(o=o.toString());var u=null;if(typeof o=="string")try{u=JSON.parse(o)}catch{throw new Error("The JSON structure is invalid")}else u=o;return n(u,l)},Br}var Nr,wi;function oo(){if(wi)return Nr;wi=1;var n=Gi(),o=io(),l=Ki(),u=ao();return Nr={xml2js:n,xml2json:o,js2xml:l,json2xml:u},Nr}var uo=oo();const so=me.getDefaultExportFromCjs(uo);/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function fo(n){return n instanceof Uint8Array||ArrayBuffer.isView(n)&&n.constructor.name==="Uint8Array"}function qe(n,o=""){if(!Number.isSafeInteger(n)||n<0){const l=o&&`"${o}" `;throw new Error(`${l}expected integer >= 0, got ${n}`)}}function ke(n,o,l=""){const u=fo(n),m=n?.length,y=o!==void 0;if(!u||y&&m!==o){const A=l&&`"${l}" `,v=y?` of length ${o}`:"",_=u?`length=${m}`:`type=${typeof n}`;throw new Error(A+"expected Uint8Array"+v+", got "+_)}return n}function $i(n){if(typeof n!="function"||typeof n.create!="function")throw new Error("Hash must wrapped by utils.createHasher");qe(n.outputLen),qe(n.blockLen)}function et(n,o=!0){if(n.destroyed)throw new Error("Hash instance has been destroyed");if(o&&n.finished)throw new Error("Hash#digest() has already been called")}function lo(n,o){ke(n,void 0,"digestInto() output");const l=o.outputLen;if(n.length<l)throw new Error('"digestInto() output" expected to be of length >='+l)}function He(...n){for(let o=0;o<n.length;o++)n[o].fill(0)}function Ze(n){return new DataView(n.buffer,n.byteOffset,n.byteLength)}function co(n){if(typeof n!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(n))}function _i(n,o=""){return typeof n=="string"?co(n):ke(n,void 0,o)}function ho(n,o){if(o!==void 0&&{}.toString.call(o)!=="[object Object]")throw new Error("options must be object or undefined");return Object.assign(n,o)}function po(n,o={}){const l=(m,y)=>n(y).update(m).digest(),u=n(void 0);return l.outputLen=u.outputLen,l.blockLen=u.blockLen,l.create=m=>n(m),Object.assign(l,o),Object.freeze(l)}const yo=n=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,n])});class Wi{oHash;iHash;blockLen;outputLen;finished=!1;destroyed=!1;constructor(o,l){if($i(o),ke(l,void 0,"key"),this.iHash=o.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const u=this.blockLen,m=new Uint8Array(u);m.set(l.length>u?o.create().update(l).digest():l);for(let y=0;y<m.length;y++)m[y]^=54;this.iHash.update(m),this.oHash=o.create();for(let y=0;y<m.length;y++)m[y]^=106;this.oHash.update(m),He(m)}update(o){return et(this),this.iHash.update(o),this}digestInto(o){et(this),ke(o,this.outputLen,"output"),this.finished=!0,this.iHash.digestInto(o),this.oHash.update(o),this.oHash.digestInto(o),this.destroy()}digest(){const o=new Uint8Array(this.oHash.outputLen);return this.digestInto(o),o}_cloneInto(o){o||=Object.create(Object.getPrototypeOf(this),{});const{oHash:l,iHash:u,finished:m,destroyed:y,blockLen:A,outputLen:v}=this;return o=o,o.finished=m,o.destroyed=y,o.blockLen=A,o.outputLen=v,o.oHash=l._cloneInto(o.oHash),o.iHash=u._cloneInto(o.iHash),o}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const Vi=(n,o,l)=>new Wi(n,o).update(l).digest();Vi.create=(n,o)=>new Wi(n,o);function go(n,o,l,u){$i(n);const m=ho({dkLen:32,asyncTick:10},u),{c:y,dkLen:A,asyncTick:v}=m;if(qe(y,"c"),qe(A,"dkLen"),qe(v,"asyncTick"),y<1)throw new Error("iterations (c) must be >= 1");const _=_i(o,"password"),B=_i(l,"salt"),C=new Uint8Array(A),N=Vi.create(n,_),P=N._cloneInto().update(B);return{c:y,dkLen:A,asyncTick:v,DK:C,PRF:N,PRFSalt:P}}function bo(n,o,l,u,m){return n.destroy(),o.destroy(),u&&u.destroy(),He(m),l}function mo(n,o,l,u){const{c:m,dkLen:y,DK:A,PRF:v,PRFSalt:_}=go(n,o,l,u);let B;const C=new Uint8Array(4),N=Ze(C),P=new Uint8Array(v.outputLen);for(let V=1,q=0;q<y;V++,q+=v.outputLen){const H=A.subarray(q,q+v.outputLen);N.setInt32(0,V,!1),(B=_._cloneInto(B)).update(C).digestInto(P),H.set(P.subarray(0,H.length));for(let L=1;L<m;L++){v._cloneInto(B).update(P).digestInto(P);for(let c=0;c<H.length;c++)H[c]^=P[c]}}return bo(v,_,A,B,P)}class Eo{blockLen;outputLen;padOffset;isLE;buffer;view;finished=!1;length=0;pos=0;destroyed=!1;constructor(o,l,u,m){this.blockLen=o,this.outputLen=l,this.padOffset=u,this.isLE=m,this.buffer=new Uint8Array(o),this.view=Ze(this.buffer)}update(o){et(this),ke(o);const{view:l,buffer:u,blockLen:m}=this,y=o.length;for(let A=0;A<y;){const v=Math.min(m-this.pos,y-A);if(v===m){const _=Ze(o);for(;m<=y-A;A+=m)this.process(_,A);continue}u.set(o.subarray(A,A+v),this.pos),this.pos+=v,A+=v,this.pos===m&&(this.process(l,0),this.pos=0)}return this.length+=o.length,this.roundClean(),this}digestInto(o){et(this),lo(o,this),this.finished=!0;const{buffer:l,view:u,blockLen:m,isLE:y}=this;let{pos:A}=this;l[A++]=128,He(this.buffer.subarray(A)),this.padOffset>m-A&&(this.process(u,0),A=0);for(let N=A;N<m;N++)l[N]=0;u.setBigUint64(m-8,BigInt(this.length*8),y),this.process(u,0);const v=Ze(o),_=this.outputLen;if(_%4)throw new Error("_sha2: outputLen must be aligned to 32bit");const B=_/4,C=this.get();if(B>C.length)throw new Error("_sha2: outputLen bigger than state");for(let N=0;N<B;N++)v.setUint32(4*N,C[N],y)}digest(){const{buffer:o,outputLen:l}=this;this.digestInto(o);const u=o.slice(0,l);return this.destroy(),u}_cloneInto(o){o||=new this.constructor,o.set(...this.get());const{blockLen:l,buffer:u,length:m,finished:y,destroyed:A,pos:v}=this;return o.destroyed=A,o.finished=y,o.length=m,o.pos=v,m%l&&o.buffer.set(u),o}clone(){return this._cloneInto()}}const Ee=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),ze=BigInt(2**32-1),Ai=BigInt(32);function vo(n,o=!1){return o?{h:Number(n&ze),l:Number(n>>Ai&ze)}:{h:Number(n>>Ai&ze)|0,l:Number(n&ze)|0}}function wo(n,o=!1){const l=n.length;let u=new Uint32Array(l),m=new Uint32Array(l);for(let y=0;y<l;y++){const{h:A,l:v}=vo(n[y],o);[u[y],m[y]]=[A,v]}return[u,m]}const Ti=(n,o,l)=>n>>>l,Si=(n,o,l)=>n<<32-l|o>>>l,Ce=(n,o,l)=>n>>>l|o<<32-l,De=(n,o,l)=>n<<32-l|o>>>l,Je=(n,o,l)=>n<<64-l|o>>>l-32,Qe=(n,o,l)=>n>>>l-32|o<<64-l;function Se(n,o,l,u){const m=(o>>>0)+(u>>>0);return{h:n+l+(m/2**32|0)|0,l:m|0}}const _o=(n,o,l)=>(n>>>0)+(o>>>0)+(l>>>0),Ao=(n,o,l,u)=>o+l+u+(n/2**32|0)|0,To=(n,o,l,u)=>(n>>>0)+(o>>>0)+(l>>>0)+(u>>>0),So=(n,o,l,u,m)=>o+l+u+m+(n/2**32|0)|0,Ro=(n,o,l,u,m)=>(n>>>0)+(o>>>0)+(l>>>0)+(u>>>0)+(m>>>0),xo=(n,o,l,u,m,y)=>o+l+u+m+y+(n/2**32|0)|0,Yi=wo(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(n=>BigInt(n))),Io=Yi[0],Fo=Yi[1],Ie=new Uint32Array(80),Fe=new Uint32Array(80);class Oo extends Eo{constructor(o){super(128,o,16,!1)}get(){const{Ah:o,Al:l,Bh:u,Bl:m,Ch:y,Cl:A,Dh:v,Dl:_,Eh:B,El:C,Fh:N,Fl:P,Gh:V,Gl:q,Hh:H,Hl:L}=this;return[o,l,u,m,y,A,v,_,B,C,N,P,V,q,H,L]}set(o,l,u,m,y,A,v,_,B,C,N,P,V,q,H,L){this.Ah=o|0,this.Al=l|0,this.Bh=u|0,this.Bl=m|0,this.Ch=y|0,this.Cl=A|0,this.Dh=v|0,this.Dl=_|0,this.Eh=B|0,this.El=C|0,this.Fh=N|0,this.Fl=P|0,this.Gh=V|0,this.Gl=q|0,this.Hh=H|0,this.Hl=L|0}process(o,l){for(let s=0;s<16;s++,l+=4)Ie[s]=o.getUint32(l),Fe[s]=o.getUint32(l+=4);for(let s=16;s<80;s++){const a=Ie[s-15]|0,g=Fe[s-15]|0,T=Ce(a,g,1)^Ce(a,g,8)^Ti(a,g,7),S=De(a,g,1)^De(a,g,8)^Si(a,g,7),F=Ie[s-2]|0,d=Fe[s-2]|0,K=Ce(F,d,19)^Je(F,d,61)^Ti(F,d,6),X=De(F,d,19)^Qe(F,d,61)^Si(F,d,6),x=To(S,X,Fe[s-7],Fe[s-16]),ee=So(x,T,K,Ie[s-7],Ie[s-16]);Ie[s]=ee|0,Fe[s]=x|0}let{Ah:u,Al:m,Bh:y,Bl:A,Ch:v,Cl:_,Dh:B,Dl:C,Eh:N,El:P,Fh:V,Fl:q,Gh:H,Gl:L,Hh:c,Hl:E}=this;for(let s=0;s<80;s++){const a=Ce(N,P,14)^Ce(N,P,18)^Je(N,P,41),g=De(N,P,14)^De(N,P,18)^Qe(N,P,41),T=N&V^~N&H,S=P&q^~P&L,F=Ro(E,g,S,Fo[s],Fe[s]),d=xo(F,c,a,T,Io[s],Ie[s]),K=F|0,X=Ce(u,m,28)^Je(u,m,34)^Je(u,m,39),x=De(u,m,28)^Qe(u,m,34)^Qe(u,m,39),ee=u&y^u&v^y&v,re=m&A^m&_^A&_;c=H|0,E=L|0,H=V|0,L=q|0,V=N|0,q=P|0,{h:N,l:P}=Se(B|0,C|0,d|0,K|0),B=v|0,C=_|0,v=y|0,_=A|0,y=u|0,A=m|0;const ie=_o(K,x,re);u=Ao(ie,d,X,ee),m=ie|0}({h:u,l:m}=Se(this.Ah|0,this.Al|0,u|0,m|0)),{h:y,l:A}=Se(this.Bh|0,this.Bl|0,y|0,A|0),{h:v,l:_}=Se(this.Ch|0,this.Cl|0,v|0,_|0),{h:B,l:C}=Se(this.Dh|0,this.Dl|0,B|0,C|0),{h:N,l:P}=Se(this.Eh|0,this.El|0,N|0,P|0),{h:V,l:q}=Se(this.Fh|0,this.Fl|0,V|0,q|0),{h:H,l:L}=Se(this.Gh|0,this.Gl|0,H|0,L|0),{h:c,l:E}=Se(this.Hh|0,this.Hl|0,c|0,E|0),this.set(u,m,y,A,v,_,B,C,N,P,V,q,H,L,c,E)}roundClean(){He(Ie,Fe)}destroy(){He(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}class Bo extends Oo{Ah=Ee[0]|0;Al=Ee[1]|0;Bh=Ee[2]|0;Bl=Ee[3]|0;Ch=Ee[4]|0;Cl=Ee[5]|0;Dh=Ee[6]|0;Dl=Ee[7]|0;Eh=Ee[8]|0;El=Ee[9]|0;Fh=Ee[10]|0;Fl=Ee[11]|0;Gh=Ee[12]|0;Gl=Ee[13]|0;Hh=Ee[14]|0;Hl=Ee[15]|0;constructor(){super(64)}}const No=po(()=>new Bo,yo(3)),Po=(n,o,l,u)=>te.Buffer.from(mo(No,n,o,{c:l,dkLen:u}));class Co{axiosClient;baseURI;signingKey;ALGORITHM="sha512";TTL=1200;HASH_LENGTH=32;ITERATION_COUNT=1e4;constructor({axiosClient:o,baseURI:l}){this.axiosClient=o,this.baseURI=l}async signUrl(o,l){const u=new URL(o);u.searchParams.set("OC-Credential",l),u.searchParams.set("OC-Date",new Date().toISOString()),u.searchParams.set("OC-Expires",this.TTL.toString()),u.searchParams.set("OC-Verb","GET");const m=await this.createHashedKey(u.toString());return u.searchParams.set("OC-Algo",`PBKDF2/${this.ITERATION_COUNT}-SHA512`),u.searchParams.set("OC-Signature",m),u.toString()}async getSignKey(){if(this.signingKey)return this.signingKey;const o=await this.axiosClient.get(me.urlJoin(this.baseURI,"ocs/v1.php/cloud/user/signing-key"),{headers:{"Content-Type":"application/x-www-form-urlencoded"}}),l=so.xml2js(o.data,{compact:!0});return this.signingKey=l.ocs.data["signing-key"]._text,this.signingKey}async createHashedKey(o){const l=await this.getSignKey();return Po(o,l,this.ITERATION_COUNT,this.HASH_LENGTH,this.ALGORITHM).toString("hex")}}const Do=(n,o)=>{const l=new URL(n);l.pathname=[...l.pathname.split("/"),"ocs","v1.php"].filter(Boolean).join("/");const u=l.href,m=Ri(u,o),y=new Co({baseURI:n,axiosClient:o});return{getCapabilities:()=>m.getCapabilities(),signUrl:(A,v)=>y.signUrl(A,v)}};exports.GetCapabilitiesFactory=Ri;exports.ocs=Do;
@@ -5636,7 +5636,7 @@ function bo(n) {
5636
5636
  function ke(n, o = "") {
5637
5637
  if (!Number.isSafeInteger(n) || n < 0) {
5638
5638
  const l = o && `"${o}" `;
5639
- throw new Error(`${l}expected integer >0, got ${n}`);
5639
+ throw new Error(`${l}expected integer >= 0, got ${n}`);
5640
5640
  }
5641
5641
  }
5642
5642
  function He(n, o, l = "") {
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../index-DAa_DzDf.cjs");const r=require("../index-YVg9jNP5.cjs"),e=require("../functions-DP8s29Wg.cjs");exports.webdav=r.webdav;exports.DavMethod=e.DavMethod;exports.DavPermission=e.DavPermission;exports.DavProperties=e.DavProperties;exports.DavProperty=e.DavProperty;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../index-DAa_DzDf.cjs");const r=require("../index-Bc1xE_gW.cjs"),e=require("../functions-CKtvRiMa.cjs");exports.webdav=r.webdav;exports.DavMethod=e.DavMethod;exports.DavPermission=e.DavPermission;exports.DavProperties=e.DavProperties;exports.DavProperty=e.DavProperty;
@@ -1,6 +1,6 @@
1
1
  import "../index-BIL0cW_q.js";
2
- import { w as e } from "../index-bmR3iLuG.js";
3
- import { J as t, K as p, H as v, I as i } from "../functions-DnZZKUk0.js";
2
+ import { w as e } from "../index-DZvghmpY.js";
3
+ import { K as t, L as p, I as v, J as i } from "../functions-aGu-ugzD.js";
4
4
  export {
5
5
  t as DavMethod,
6
6
  p as DavPermission,
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-CcmRJ1qB.cjs"),n=require("./web-client/ocs.cjs"),o=require("./index-YVg9jNP5.cjs"),e=require("./functions-DP8s29Wg.cjs"),S=require("./toString-CgHWCW2N.cjs"),l=function*(a){return yield a},h=({message:a,statusCode:t,xReqId:s})=>{const c=new Response(void 0,{headers:{"x-request-id":s},status:t});return new o.HttpError(a,c,t)};class d{static Read=1;static Update=2;static Create=4;static Delete=8;static Share=16}const b=({axiosClient:a,baseURI:t})=>{const s=()=>{const c=a.defaults?.headers?.Authorization,i=a.defaults?.headers?.["Accept-Language"],u=a.defaults?.headers?.["Initiator-ID"];return{...c&&{Authorization:c.toString()},...i&&{"Accept-Language":i.toString()},...u&&{"Initiator-ID":u.toString()}}};return{graph:r.graph(t,a),ocs:n.ocs(t,a),webdav:o.webdav(t,s)}};exports.buildCollaboratorShare=r.buildCollaboratorShare;exports.buildIncomingShareResource=r.buildIncomingShareResource;exports.buildLinkShare=r.buildLinkShare;exports.buildOutgoingShareResource=r.buildOutgoingShareResource;exports.getShareResourcePermissions=r.getShareResourcePermissions;exports.getShareResourceRoles=r.getShareResourceRoles;exports.graph=r.graph;exports.isCollaboratorShare=r.isCollaboratorShare;exports.isIncomingShareResource=r.isIncomingShareResource;exports.isLinkShare=r.isLinkShare;exports.isOutgoingShareResource=r.isOutgoingShareResource;exports.isShareResource=r.isShareResource;exports.ocs=n.ocs;exports.DavHttpError=o.DavHttpError;exports.HttpError=o.HttpError;exports.encodePath=o.encodePath;exports.webdav=o.webdav;exports.GraphSharePermission=e.GraphSharePermission;exports.OCM_PROVIDER_ID=e.OCM_PROVIDER_ID;exports.SHARE_JAIL_ID=e.SHARE_JAIL_ID;exports.ShareType=e.ShareType;exports.ShareTypes=e.ShareTypes;exports.buildDeletedResource=e.buildDeletedResource;exports.buildPublicSpaceResource=e.buildPublicSpaceResource;exports.buildResource=e.buildResource;exports.buildShareSpaceResource=e.buildShareSpaceResource;exports.buildSpace=e.buildSpace;exports.buildSpaceImageResource=e.buildSpaceImageResource;exports.buildWebDavOcmPath=e.buildWebDavOcmPath;exports.buildWebDavPublicPath=e.buildWebDavPublicPath;exports.buildWebDavSpacesPath=e.buildWebDavSpacesPath;exports.buildWebDavSpacesTrashPath=e.buildWebDavSpacesTrashPath;exports.extractDomSelector=e.extractDomSelector;exports.extractExtensionFromFile=e.extractExtensionFromFile;exports.extractNameWithoutExtension=e.extractNameWithoutExtension;exports.extractNodeId=e.extractNodeId;exports.extractParentFolderName=e.extractParentFolderName;exports.extractStorageId=e.extractStorageId;exports.getRelativeSpecialFolderSpacePath=e.getRelativeSpecialFolderSpacePath;exports.isManager=e.isManager;exports.isMountPointSpaceResource=e.isMountPointSpaceResource;exports.isPersonalSpaceResource=e.isPersonalSpaceResource;exports.isProjectSpaceResource=e.isProjectSpaceResource;exports.isPublicSpaceResource=e.isPublicSpaceResource;exports.isSearchResource=e.isSearchResource;exports.isShareRoot=e.isShareRoot;exports.isShareSpaceResource=e.isShareSpaceResource;exports.isSpaceResource=e.isSpaceResource;exports.isTrashResource=e.isTrashResource;exports.urlJoin=S.urlJoin;exports.SharePermissionBit=d;exports.call=l;exports.client=b;exports.createHttpError=h;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-BtN57j2H.cjs"),n=require("./web-client/ocs.cjs"),o=require("./index-Bc1xE_gW.cjs"),e=require("./functions-CKtvRiMa.cjs"),S=require("./toString-CgHWCW2N.cjs"),l=function*(a){return yield a},h=({message:a,statusCode:t,xReqId:s})=>{const c=new Response(void 0,{headers:{"x-request-id":s},status:t});return new o.HttpError(a,c,t)};class d{static Read=1;static Update=2;static Create=4;static Delete=8;static Share=16}const b=({axiosClient:a,baseURI:t})=>{const s=()=>{const c=a.defaults?.headers?.Authorization,i=a.defaults?.headers?.["Accept-Language"],u=a.defaults?.headers?.["Initiator-ID"];return{...c&&{Authorization:c.toString()},...i&&{"Accept-Language":i.toString()},...u&&{"Initiator-ID":u.toString()}}};return{graph:r.graph(t,a),ocs:n.ocs(t,a),webdav:o.webdav(t,s)}};exports.buildCollaboratorShare=r.buildCollaboratorShare;exports.buildIncomingShareResource=r.buildIncomingShareResource;exports.buildLinkShare=r.buildLinkShare;exports.buildOutgoingShareResource=r.buildOutgoingShareResource;exports.getShareResourcePermissions=r.getShareResourcePermissions;exports.getShareResourceRoles=r.getShareResourceRoles;exports.graph=r.graph;exports.isCollaboratorShare=r.isCollaboratorShare;exports.isIncomingShareResource=r.isIncomingShareResource;exports.isLinkShare=r.isLinkShare;exports.isOutgoingShareResource=r.isOutgoingShareResource;exports.isShareResource=r.isShareResource;exports.ocs=n.ocs;exports.DavHttpError=o.DavHttpError;exports.HttpError=o.HttpError;exports.encodePath=o.encodePath;exports.webdav=o.webdav;exports.GraphSharePermission=e.GraphSharePermission;exports.OCM_PROVIDER_ID=e.OCM_PROVIDER_ID;exports.SHARE_JAIL_ID=e.SHARE_JAIL_ID;exports.ShareType=e.ShareType;exports.ShareTypes=e.ShareTypes;exports.buildDeletedResource=e.buildDeletedResource;exports.buildPublicSpaceResource=e.buildPublicSpaceResource;exports.buildResource=e.buildResource;exports.buildShareSpaceResource=e.buildShareSpaceResource;exports.buildSpace=e.buildSpace;exports.buildSpaceImageResource=e.buildSpaceImageResource;exports.buildWebDavOcmPath=e.buildWebDavOcmPath;exports.buildWebDavPublicPath=e.buildWebDavPublicPath;exports.buildWebDavSpacesPath=e.buildWebDavSpacesPath;exports.buildWebDavSpacesTrashPath=e.buildWebDavSpacesTrashPath;exports.extractDomSelector=e.extractDomSelector;exports.extractExtensionFromFile=e.extractExtensionFromFile;exports.extractNameWithoutExtension=e.extractNameWithoutExtension;exports.extractNodeId=e.extractNodeId;exports.extractParentFolderName=e.extractParentFolderName;exports.extractStorageId=e.extractStorageId;exports.getRelativeSpecialFolderSpacePath=e.getRelativeSpecialFolderSpacePath;exports.getSpaceManagers=e.getSpaceManagers;exports.isManager=e.isManager;exports.isMountPointSpaceResource=e.isMountPointSpaceResource;exports.isPersonalSpaceResource=e.isPersonalSpaceResource;exports.isProjectSpaceResource=e.isProjectSpaceResource;exports.isPublicSpaceResource=e.isPublicSpaceResource;exports.isSearchResource=e.isSearchResource;exports.isShareRoot=e.isShareRoot;exports.isShareSpaceResource=e.isShareSpaceResource;exports.isSpaceResource=e.isSpaceResource;exports.isTrashResource=e.isTrashResource;exports.urlJoin=S.urlJoin;exports.SharePermissionBit=d;exports.call=l;exports.client=b;exports.createHttpError=h;