files_sharing-init.js 50 KB

123
  1. /*! For license information please see files_sharing-init.js.LICENSE.txt */
  2. (()=>{"use strict";var e,t={11090:(e,t,i)=>{var n=i(31352),r=i(77958),s=i(17499),o=i(62520),a=i(65358),l=i(79753);i(14596);const u=null===(d=(0,r.ts)())?(0,s.IY)().setApp("files").build():(0,s.IY)().setApp("files").setUid(d.uid).build();var d,h=(e=>(e.DEFAULT="default",e.HIDDEN="hidden",e))(h||{});class c{_action;constructor(e){this.validateAction(e),this._action=e}get id(){return this._action.id}get displayName(){return this._action.displayName}get title(){return this._action.title}get iconSvgInline(){return this._action.iconSvgInline}get enabled(){return this._action.enabled}get exec(){return this._action.exec}get execBatch(){return this._action.execBatch}get order(){return this._action.order}get parent(){return this._action.parent}get default(){return this._action.default}get inline(){return this._action.inline}get renderInline(){return this._action.renderInline}validateAction(e){if(!e.id||"string"!=typeof e.id)throw new Error("Invalid id");if(!e.displayName||"function"!=typeof e.displayName)throw new Error("Invalid displayName function");if("title"in e&&"function"!=typeof e.title)throw new Error("Invalid title function");if(!e.iconSvgInline||"function"!=typeof e.iconSvgInline)throw new Error("Invalid iconSvgInline function");if(!e.exec||"function"!=typeof e.exec)throw new Error("Invalid exec function");if("enabled"in e&&"function"!=typeof e.enabled)throw new Error("Invalid enabled function");if("execBatch"in e&&"function"!=typeof e.execBatch)throw new Error("Invalid execBatch function");if("order"in e&&"number"!=typeof e.order)throw new Error("Invalid order");if("parent"in e&&"string"!=typeof e.parent)throw new Error("Invalid parent");if(e.default&&!Object.values(h).includes(e.default))throw new Error("Invalid default");if("inline"in e&&"function"!=typeof e.inline)throw new Error("Invalid inline function");if("renderInline"in e&&"function"!=typeof e.renderInline)throw new Error("Invalid renderInline function")}}const p=function(e){typeof window._nc_fileactions>"u"&&(window._nc_fileactions=[],u.debug("FileActions initialized")),window._nc_fileactions.find((t=>t.id===e.id))?u.error(`FileAction ${e.id} already registered`,{action:e}):window._nc_fileactions.push(e)};var f=(e=>(e[e.NONE=0]="NONE",e[e.CREATE=4]="CREATE",e[e.READ=1]="READ",e[e.UPDATE=2]="UPDATE",e[e.DELETE=8]="DELETE",e[e.SHARE=16]="SHARE",e[e.ALL=31]="ALL",e))(f||{}),g=(e=>(e.Folder="folder",e.File="file",e))(g||{});const m=function(e,t){return null!==e.match(t)},w=(e,t)=>{if(e.id&&"number"!=typeof e.id)throw new Error("Invalid id type of value");if(!e.source)throw new Error("Missing mandatory source");try{new URL(e.source)}catch{throw new Error("Invalid source format, source must be a valid URL")}if(!e.source.startsWith("http"))throw new Error("Invalid source format, only http(s) is supported");if(e.mtime&&!(e.mtime instanceof Date))throw new Error("Invalid mtime type");if(e.crtime&&!(e.crtime instanceof Date))throw new Error("Invalid crtime type");if(!e.mime||"string"!=typeof e.mime||!e.mime.match(/^[-\w.]+\/[-+\w.]+$/gi))throw new Error("Missing or invalid mandatory mime");if("size"in e&&"number"!=typeof e.size&&void 0!==e.size)throw new Error("Invalid size type");if("permissions"in e&&void 0!==e.permissions&&!("number"==typeof e.permissions&&e.permissions>=f.NONE&&e.permissions<=f.ALL))throw new Error("Invalid permissions");if(e.owner&&null!==e.owner&&"string"!=typeof e.owner)throw new Error("Invalid owner type");if(e.attributes&&"object"!=typeof e.attributes)throw new Error("Invalid attributes type");if(e.root&&"string"!=typeof e.root)throw new Error("Invalid root type");if(e.root&&!e.root.startsWith("/"))throw new Error("Root must start with a leading slash");if(e.root&&!e.source.includes(e.root))throw new Error("Root must be part of the source");if(e.root&&m(e.source,t)){const i=e.source.match(t)[0];if(!e.source.includes((0,o.join)(i,e.root)))throw new Error("The root must be relative to the service. e.g /files/emma")}if(e.status&&!Object.values(v).includes(e.status))throw new Error("Status must be a valid NodeStatus")};var v=(e=>(e.NEW="new",e.FAILED="failed",e.LOADING="loading",e.LOCKED="locked",e))(v||{});class b{_data;_attributes;_knownDavService=/(remote|public)\.php\/(web)?dav/i;constructor(e,t){w(e,t||this._knownDavService),this._data=e;const i={set:(e,t,i)=>(this.updateMtime(),Reflect.set(e,t,i)),deleteProperty:(e,t)=>(this.updateMtime(),Reflect.deleteProperty(e,t))};this._attributes=new Proxy(e.attributes||{},i),delete this._data.attributes,t&&(this._knownDavService=t)}get source(){return this._data.source.replace(/\/$/i,"")}get encodedSource(){const{origin:e}=new URL(this.source);return e+(0,a.Ec)(this.source.slice(e.length))}get basename(){return(0,o.basename)(this.source)}get extension(){return(0,o.extname)(this.source)}get dirname(){if(this.root){const e=this.source.indexOf(this.root);return(0,o.dirname)(this.source.slice(e+this.root.length)||"/")}const e=new URL(this.source);return(0,o.dirname)(e.pathname)}get mime(){return this._data.mime}get mtime(){return this._data.mtime}get crtime(){return this._data.crtime}get size(){return this._data.size}get attributes(){return this._attributes}get permissions(){return null!==this.owner||this.isDavRessource?void 0!==this._data.permissions?this._data.permissions:f.NONE:f.READ}get owner(){return this.isDavRessource?this._data.owner:null}get isDavRessource(){return m(this.source,this._knownDavService)}get root(){return this._data.root?this._data.root.replace(/^(.+)\/$/,"$1"):this.isDavRessource&&(0,o.dirname)(this.source).split(this._knownDavService).pop()||null}get path(){if(this.root){const e=this.source.indexOf(this.root);return this.source.slice(e+this.root.length)||"/"}return(this.dirname+"/"+this.basename).replace(/\/\//g,"/")}get fileid(){return this._data?.id||this.attributes?.fileid}get status(){return this._data?.status}set status(e){this._data.status=e}move(e){w({...this._data,source:e},this._knownDavService),this._data.source=e,this.updateMtime()}rename(e){if(e.includes("/"))throw new Error("Invalid basename");this.move((0,o.dirname)(this.source)+"/"+e)}updateMtime(){this._data.mtime&&(this._data.mtime=new Date)}}class x extends b{get type(){return g.File}}class y extends b{constructor(e){super({...e,mime:"httpd/unix-directory"})}get type(){return g.Folder}get extension(){return null}get mime(){return"httpd/unix-directory"}}(0,l.generateRemoteUrl)("dav");class N{_views=[];_currentView=null;register(e){if(this._views.find((t=>t.id===e.id)))throw new Error(`View id ${e.id} is already registered`);this._views.push(e)}remove(e){const t=this._views.findIndex((t=>t.id===e));-1!==t&&this._views.splice(t,1)}get views(){return this._views}setActive(e){this._currentView=e}get active(){return this._currentView}}class E{_column;constructor(e){_(e),this._column=e}get id(){return this._column.id}get title(){return this._column.title}get render(){return this._column.render}get sort(){return this._column.sort}get summary(){return this._column.summary}}const _=function(e){if(!e.id||"string"!=typeof e.id)throw new Error("A column id is required");if(!e.title||"string"!=typeof e.title)throw new Error("A column title is required");if(!e.render||"function"!=typeof e.render)throw new Error("A render function is required");if(e.sort&&"function"!=typeof e.sort)throw new Error("Column sortFunction must be a function");if(e.summary&&"function"!=typeof e.summary)throw new Error("Column summary must be a function");return!0};var A={},I={};!function(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",i="["+t+"]["+t+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*",n=new RegExp("^"+i+"$");e.isExist=function(e){return typeof e<"u"},e.isEmptyObject=function(e){return 0===Object.keys(e).length},e.merge=function(e,t,i){if(t){const n=Object.keys(t),r=n.length;for(let s=0;s<r;s++)e[n[s]]="strict"===i?[t[n[s]]]:t[n[s]]}},e.getValue=function(t){return e.isExist(t)?t:""},e.isName=function(e){const t=n.exec(e);return!(null===t||typeof t>"u")},e.getAllMatches=function(e,t){const i=[];let n=t.exec(e);for(;n;){const r=[];r.startIndex=t.lastIndex-n[0].length;const s=n.length;for(let e=0;e<s;e++)r.push(n[e]);i.push(r),n=t.exec(e)}return i},e.nameRegexp=i}(I);const C=I,T={allowBooleanAttributes:!1,unpairedTags:[]};function O(e){return" "===e||"\t"===e||"\n"===e||"\r"===e}function P(e,t){const i=t;for(;t<e.length;t++)if("?"==e[t]||" "==e[t]){const n=e.substr(i,t-i);if(t>5&&"xml"===n)return j("InvalidXml","XML declaration allowed only at the start of the document.",B(e,t));if("?"==e[t]&&">"==e[t+1]){t++;break}continue}return t}function S(e,t){if(e.length>t+5&&"-"===e[t+1]&&"-"===e[t+2]){for(t+=3;t<e.length;t++)if("-"===e[t]&&"-"===e[t+1]&&">"===e[t+2]){t+=2;break}}else if(e.length>t+8&&"D"===e[t+1]&&"O"===e[t+2]&&"C"===e[t+3]&&"T"===e[t+4]&&"Y"===e[t+5]&&"P"===e[t+6]&&"E"===e[t+7]){let i=1;for(t+=8;t<e.length;t++)if("<"===e[t])i++;else if(">"===e[t]&&(i--,0===i))break}else if(e.length>t+9&&"["===e[t+1]&&"C"===e[t+2]&&"D"===e[t+3]&&"A"===e[t+4]&&"T"===e[t+5]&&"A"===e[t+6]&&"["===e[t+7])for(t+=8;t<e.length;t++)if("]"===e[t]&&"]"===e[t+1]&&">"===e[t+2]){t+=2;break}return t}A.validate=function(e,t){t=Object.assign({},T,t);const i=[];let n=!1,r=!1;"\ufeff"===e[0]&&(e=e.substr(1));for(let s=0;s<e.length;s++)if("<"===e[s]&&"?"===e[s+1]){if(s+=2,s=P(e,s),s.err)return s}else{if("<"!==e[s]){if(O(e[s]))continue;return j("InvalidChar","char '"+e[s]+"' is not expected.",B(e,s))}{let o=s;if(s++,"!"===e[s]){s=S(e,s);continue}{let a=!1;"/"===e[s]&&(a=!0,s++);let l="";for(;s<e.length&&">"!==e[s]&&" "!==e[s]&&"\t"!==e[s]&&"\n"!==e[s]&&"\r"!==e[s];s++)l+=e[s];if(l=l.trim(),"/"===l[l.length-1]&&(l=l.substring(0,l.length-1),s--),!H(l)){let t;return t=0===l.trim().length?"Invalid space after '<'.":"Tag '"+l+"' is an invalid name.",j("InvalidTag",t,B(e,s))}const u=D(e,s);if(!1===u)return j("InvalidAttr","Attributes for '"+l+"' have open quote.",B(e,s));let d=u.value;if(s=u.index,"/"===d[d.length-1]){const i=s-d.length;d=d.substring(0,d.length-1);const r=k(d,t);if(!0!==r)return j(r.err.code,r.err.msg,B(e,i+r.err.line));n=!0}else if(a){if(!u.tagClosed)return j("InvalidTag","Closing tag '"+l+"' doesn't have proper closing.",B(e,s));if(d.trim().length>0)return j("InvalidTag","Closing tag '"+l+"' can't have attributes or invalid starting.",B(e,o));{const t=i.pop();if(l!==t.tagName){let i=B(e,t.tagStartPos);return j("InvalidTag","Expected closing tag '"+t.tagName+"' (opened in line "+i.line+", col "+i.col+") instead of closing tag '"+l+"'.",B(e,o))}0==i.length&&(r=!0)}}else{const a=k(d,t);if(!0!==a)return j(a.err.code,a.err.msg,B(e,s-d.length+a.err.line));if(!0===r)return j("InvalidXml","Multiple possible root nodes found.",B(e,s));-1!==t.unpairedTags.indexOf(l)||i.push({tagName:l,tagStartPos:o}),n=!0}for(s++;s<e.length;s++)if("<"===e[s]){if("!"===e[s+1]){s++,s=S(e,s);continue}if("?"!==e[s+1])break;if(s=P(e,++s),s.err)return s}else if("&"===e[s]){const t=M(e,s);if(-1==t)return j("InvalidChar","char '&' is not expected.",B(e,s));s=t}else if(!0===r&&!O(e[s]))return j("InvalidXml","Extra text at the end",B(e,s));"<"===e[s]&&s--}}}return n?1==i.length?j("InvalidTag","Unclosed tag '"+i[0].tagName+"'.",B(e,i[0].tagStartPos)):!(i.length>0)||j("InvalidXml","Invalid '"+JSON.stringify(i.map((e=>e.tagName)),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):j("InvalidXml","Start tag expected.",1)};const V='"',L="'";function D(e,t){let i="",n="",r=!1;for(;t<e.length;t++){if(e[t]===V||e[t]===L)""===n?n=e[t]:n!==e[t]||(n="");else if(">"===e[t]&&""===n){r=!0;break}i+=e[t]}return""===n&&{value:i,index:t,tagClosed:r}}const R=new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");function k(e,t){const i=C.getAllMatches(e,R),n={};for(let e=0;e<i.length;e++){if(0===i[e][1].length)return j("InvalidAttr","Attribute '"+i[e][2]+"' has no space in starting.",$(i[e]));if(void 0!==i[e][3]&&void 0===i[e][4])return j("InvalidAttr","Attribute '"+i[e][2]+"' is without value.",$(i[e]));if(void 0===i[e][3]&&!t.allowBooleanAttributes)return j("InvalidAttr","boolean attribute '"+i[e][2]+"' is not allowed.",$(i[e]));const r=i[e][2];if(!F(r))return j("InvalidAttr","Attribute '"+r+"' is an invalid name.",$(i[e]));if(n.hasOwnProperty(r))return j("InvalidAttr","Attribute '"+r+"' is repeated.",$(i[e]));n[r]=1}return!0}function M(e,t){if(";"===e[++t])return-1;if("#"===e[t])return function(e,t){let i=/\d/;for("x"===e[t]&&(t++,i=/[\da-fA-F]/);t<e.length;t++){if(";"===e[t])return t;if(!e[t].match(i))break}return-1}(e,++t);let i=0;for(;t<e.length;t++,i++)if(!(e[t].match(/\w/)&&i<20)){if(";"===e[t])break;return-1}return t}function j(e,t,i){return{err:{code:e,msg:t,line:i.line||i,col:i.col}}}function F(e){return C.isName(e)}function H(e){return C.isName(e)}function B(e,t){const i=e.substring(0,t).split(/\r?\n/);return{line:i.length,col:i[i.length-1].length+1}}function $(e){return e.startIndex+e[1].length}var U={};const Z={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(e,t,i){return e}};U.buildOptions=function(e){return Object.assign({},Z,e)},U.defaultOptions=Z;const G=I;function Y(e,t){let i="";for(;t<e.length&&"'"!==e[t]&&'"'!==e[t];t++)i+=e[t];if(i=i.trim(),-1!==i.indexOf(" "))throw new Error("External entites are not supported");const n=e[t++];let r="";for(;t<e.length&&e[t]!==n;t++)r+=e[t];return[i,r,t]}function q(e,t){return"!"===e[t+1]&&"-"===e[t+2]&&"-"===e[t+3]}function z(e,t){return"!"===e[t+1]&&"E"===e[t+2]&&"N"===e[t+3]&&"T"===e[t+4]&&"I"===e[t+5]&&"T"===e[t+6]&&"Y"===e[t+7]}function X(e,t){return"!"===e[t+1]&&"E"===e[t+2]&&"L"===e[t+3]&&"E"===e[t+4]&&"M"===e[t+5]&&"E"===e[t+6]&&"N"===e[t+7]&&"T"===e[t+8]}function K(e,t){return"!"===e[t+1]&&"A"===e[t+2]&&"T"===e[t+3]&&"T"===e[t+4]&&"L"===e[t+5]&&"I"===e[t+6]&&"S"===e[t+7]&&"T"===e[t+8]}function W(e,t){return"!"===e[t+1]&&"N"===e[t+2]&&"O"===e[t+3]&&"T"===e[t+4]&&"A"===e[t+5]&&"T"===e[t+6]&&"I"===e[t+7]&&"O"===e[t+8]&&"N"===e[t+9]}function J(e){if(G.isName(e))return e;throw new Error(`Invalid entity name ${e}`)}const Q=/^[-+]?0x[a-fA-F0-9]+$/,ee=/^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/;!Number.parseInt&&window.parseInt&&(Number.parseInt=window.parseInt),!Number.parseFloat&&window.parseFloat&&(Number.parseFloat=window.parseFloat);const te={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};const ie=I,ne=class{constructor(e){this.tagname=e,this.child=[],this[":@"]={}}add(e,t){"__proto__"===e&&(e="#__proto__"),this.child.push({[e]:t})}addChild(e){"__proto__"===e.tagname&&(e.tagname="#__proto__"),e[":@"]&&Object.keys(e[":@"]).length>0?this.child.push({[e.tagname]:e.child,":@":e[":@"]}):this.child.push({[e.tagname]:e.child})}},re=function(e,t){const i={};if("O"!==e[t+3]||"C"!==e[t+4]||"T"!==e[t+5]||"Y"!==e[t+6]||"P"!==e[t+7]||"E"!==e[t+8])throw new Error("Invalid Tag instead of DOCTYPE");{t+=9;let n=1,r=!1,s=!1,o="";for(;t<e.length;t++)if("<"!==e[t]||s)if(">"===e[t]){if(s?"-"===e[t-1]&&"-"===e[t-2]&&(s=!1,n--):n--,0===n)break}else"["===e[t]?r=!0:o+=e[t];else{if(r&&z(e,t))t+=7,[entityName,val,t]=Y(e,t+1),-1===val.indexOf("&")&&(i[J(entityName)]={regx:RegExp(`&${entityName};`,"g"),val});else if(r&&X(e,t))t+=8;else if(r&&K(e,t))t+=8;else if(r&&W(e,t))t+=9;else{if(!q)throw new Error("Invalid DOCTYPE");s=!0}n++,o=""}if(0!==n)throw new Error("Unclosed DOCTYPE")}return{entities:i,i:t}},se=function(e,t={}){if(t=Object.assign({},te,t),!e||"string"!=typeof e)return e;let i=e.trim();if(void 0!==t.skipLike&&t.skipLike.test(i))return e;if(t.hex&&Q.test(i))return Number.parseInt(i,16);{const n=ee.exec(i);if(n){const r=n[1],s=n[2];let o=function(e){return e&&-1!==e.indexOf(".")&&("."===(e=e.replace(/0+$/,""))?e="0":"."===e[0]?e="0"+e:"."===e[e.length-1]&&(e=e.substr(0,e.length-1))),e}(n[3]);const a=n[4]||n[6];if(!t.leadingZeros&&s.length>0&&r&&"."!==i[2])return e;if(!t.leadingZeros&&s.length>0&&!r&&"."!==i[1])return e;{const n=Number(i),l=""+n;return-1!==l.search(/[eE]/)||a?t.eNotation?n:e:-1!==i.indexOf(".")?"0"===l&&""===o||l===o||r&&l==="-"+o?n:e:s?o===l||r+o===l?n:e:i===l||i===r+l?n:e}}return e}};function oe(e){const t=Object.keys(e);for(let i=0;i<t.length;i++){const n=t[i];this.lastEntities[n]={regex:new RegExp("&"+n+";","g"),val:e[n]}}}function ae(e,t,i,n,r,s,o){if(void 0!==e&&(this.options.trimValues&&!n&&(e=e.trim()),e.length>0)){o||(e=this.replaceEntitiesValue(e));const n=this.options.tagValueProcessor(t,e,i,r,s);return null==n?e:typeof n!=typeof e||n!==e?n:this.options.trimValues||e.trim()===e?be(e,this.options.parseTagValue,this.options.numberParseOptions):e}}function le(e){if(this.options.removeNSPrefix){const t=e.split(":"),i="/"===e.charAt(0)?"/":"";if("xmlns"===t[0])return"";2===t.length&&(e=i+t[1])}return e}"<((!\\[CDATA\\[([\\s\\S]*?)(]]>))|((NAME:)?(NAME))([^>]*)>|((\\/)(NAME)\\s*>))([^<]*)".replace(/NAME/g,ie.nameRegexp);const ue=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");function de(e,t,i){if(!this.options.ignoreAttributes&&"string"==typeof e){const i=ie.getAllMatches(e,ue),n=i.length,r={};for(let e=0;e<n;e++){const n=this.resolveNameSpace(i[e][1]);let s=i[e][4],o=this.options.attributeNamePrefix+n;if(n.length)if(this.options.transformAttributeName&&(o=this.options.transformAttributeName(o)),"__proto__"===o&&(o="#__proto__"),void 0!==s){this.options.trimValues&&(s=s.trim()),s=this.replaceEntitiesValue(s);const e=this.options.attributeValueProcessor(n,s,t);r[o]=null==e?s:typeof e!=typeof s||e!==s?e:be(s,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(r[o]=!0)}if(!Object.keys(r).length)return;if(this.options.attributesGroupName){const e={};return e[this.options.attributesGroupName]=r,e}return r}}const he=function(e){e=e.replace(/\r\n?/g,"\n");const t=new ne("!xml");let i=t,n="",r="";for(let s=0;s<e.length;s++)if("<"===e[s])if("/"===e[s+1]){const t=me(e,">",s,"Closing Tag is not closed.");let o=e.substring(s+2,t).trim();if(this.options.removeNSPrefix){const e=o.indexOf(":");-1!==e&&(o=o.substr(e+1))}this.options.transformTagName&&(o=this.options.transformTagName(o)),i&&(n=this.saveTextToParentTag(n,i,r));const a=r.substring(r.lastIndexOf(".")+1);if(o&&-1!==this.options.unpairedTags.indexOf(o))throw new Error(`Unpaired tag can not be used as closing tag: </${o}>`);let l=0;a&&-1!==this.options.unpairedTags.indexOf(a)?(l=r.lastIndexOf(".",r.lastIndexOf(".")-1),this.tagsNodeStack.pop()):l=r.lastIndexOf("."),r=r.substring(0,l),i=this.tagsNodeStack.pop(),n="",s=t}else if("?"===e[s+1]){let t=we(e,s,!1,"?>");if(!t)throw new Error("Pi Tag is not closed.");if(n=this.saveTextToParentTag(n,i,r),!(this.options.ignoreDeclaration&&"?xml"===t.tagName||this.options.ignorePiTags)){const e=new ne(t.tagName);e.add(this.options.textNodeName,""),t.tagName!==t.tagExp&&t.attrExpPresent&&(e[":@"]=this.buildAttributesMap(t.tagExp,r,t.tagName)),this.addChild(i,e,r)}s=t.closeIndex+1}else if("!--"===e.substr(s+1,3)){const t=me(e,"--\x3e",s+4,"Comment is not closed.");if(this.options.commentPropName){const o=e.substring(s+4,t-2);n=this.saveTextToParentTag(n,i,r),i.add(this.options.commentPropName,[{[this.options.textNodeName]:o}])}s=t}else if("!D"===e.substr(s+1,2)){const t=re(e,s);this.docTypeEntities=t.entities,s=t.i}else if("!["===e.substr(s+1,2)){const t=me(e,"]]>",s,"CDATA is not closed.")-2,o=e.substring(s+9,t);if(n=this.saveTextToParentTag(n,i,r),this.options.cdataPropName)i.add(this.options.cdataPropName,[{[this.options.textNodeName]:o}]);else{let e=this.parseTextData(o,i.tagname,r,!0,!1,!0);null==e&&(e=""),i.add(this.options.textNodeName,e)}s=t+2}else{let o=we(e,s,this.options.removeNSPrefix),a=o.tagName;const l=o.rawTagName;let u=o.tagExp,d=o.attrExpPresent,h=o.closeIndex;this.options.transformTagName&&(a=this.options.transformTagName(a)),i&&n&&"!xml"!==i.tagname&&(n=this.saveTextToParentTag(n,i,r,!1));const c=i;if(c&&-1!==this.options.unpairedTags.indexOf(c.tagname)&&(i=this.tagsNodeStack.pop(),r=r.substring(0,r.lastIndexOf("."))),a!==t.tagname&&(r+=r?"."+a:a),this.isItStopNode(this.options.stopNodes,r,a)){let t="";if(u.length>0&&u.lastIndexOf("/")===u.length-1)s=o.closeIndex;else if(-1!==this.options.unpairedTags.indexOf(a))s=o.closeIndex;else{const i=this.readStopNodeData(e,l,h+1);if(!i)throw new Error(`Unexpected end of ${l}`);s=i.i,t=i.tagContent}const n=new ne(a);a!==u&&d&&(n[":@"]=this.buildAttributesMap(u,r,a)),t&&(t=this.parseTextData(t,a,r,!0,d,!0,!0)),r=r.substr(0,r.lastIndexOf(".")),n.add(this.options.textNodeName,t),this.addChild(i,n,r)}else{if(u.length>0&&u.lastIndexOf("/")===u.length-1){"/"===a[a.length-1]?(a=a.substr(0,a.length-1),r=r.substr(0,r.length-1),u=a):u=u.substr(0,u.length-1),this.options.transformTagName&&(a=this.options.transformTagName(a));const e=new ne(a);a!==u&&d&&(e[":@"]=this.buildAttributesMap(u,r,a)),this.addChild(i,e,r),r=r.substr(0,r.lastIndexOf("."))}else{const e=new ne(a);this.tagsNodeStack.push(i),a!==u&&d&&(e[":@"]=this.buildAttributesMap(u,r,a)),this.addChild(i,e,r),i=e}n="",s=h}}else n+=e[s];return t.child};function ce(e,t,i){const n=this.options.updateTag(t.tagname,i,t[":@"]);!1===n||("string"==typeof n&&(t.tagname=n),e.addChild(t))}const pe=function(e){if(this.options.processEntities){for(let t in this.docTypeEntities){const i=this.docTypeEntities[t];e=e.replace(i.regx,i.val)}for(let t in this.lastEntities){const i=this.lastEntities[t];e=e.replace(i.regex,i.val)}if(this.options.htmlEntities)for(let t in this.htmlEntities){const i=this.htmlEntities[t];e=e.replace(i.regex,i.val)}e=e.replace(this.ampEntity.regex,this.ampEntity.val)}return e};function fe(e,t,i,n){return e&&(void 0===n&&(n=0===Object.keys(t.child).length),void 0!==(e=this.parseTextData(e,t.tagname,i,!1,!!t[":@"]&&0!==Object.keys(t[":@"]).length,n))&&""!==e&&t.add(this.options.textNodeName,e),e=""),e}function ge(e,t,i){const n="*."+i;for(const i in e){const r=e[i];if(n===r||t===r)return!0}return!1}function me(e,t,i,n){const r=e.indexOf(t,i);if(-1===r)throw new Error(n);return r+t.length-1}function we(e,t,i,n=">"){const r=function(e,t,i=">"){let n,r="";for(let s=t;s<e.length;s++){let t=e[s];if(n)t===n&&(n="");else if('"'===t||"'"===t)n=t;else if(t===i[0]){if(!i[1])return{data:r,index:s};if(e[s+1]===i[1])return{data:r,index:s}}else"\t"===t&&(t=" ");r+=t}}(e,t+1,n);if(!r)return;let s=r.data;const o=r.index,a=s.search(/\s/);let l=s,u=!0;-1!==a&&(l=s.substr(0,a).replace(/\s\s*$/,""),s=s.substr(a+1));const d=l;if(i){const e=l.indexOf(":");-1!==e&&(l=l.substr(e+1),u=l!==r.data.substr(e+1))}return{tagName:l,tagExp:s,closeIndex:o,attrExpPresent:u,rawTagName:d}}function ve(e,t,i){const n=i;let r=1;for(;i<e.length;i++)if("<"===e[i])if("/"===e[i+1]){const s=me(e,">",i,`${t} is not closed`);if(e.substring(i+2,s).trim()===t&&(r--,0===r))return{tagContent:e.substring(n,i),i:s};i=s}else if("?"===e[i+1])i=me(e,"?>",i+1,"StopNode is not closed.");else if("!--"===e.substr(i+1,3))i=me(e,"--\x3e",i+3,"StopNode is not closed.");else if("!["===e.substr(i+1,2))i=me(e,"]]>",i,"StopNode is not closed.")-2;else{const n=we(e,i,">");n&&((n&&n.tagName)===t&&"/"!==n.tagExp[n.tagExp.length-1]&&r++,i=n.closeIndex)}}function be(e,t,i){if(t&&"string"==typeof e){const t=e.trim();return"true"===t||"false"!==t&&se(e,i)}return ie.isExist(e)?e:""}var xe={};function ye(e,t,i){let n;const r={};for(let s=0;s<e.length;s++){const o=e[s],a=Ne(o);let l="";if(l=void 0===i?a:i+"."+a,a===t.textNodeName)void 0===n?n=o[a]:n+=""+o[a];else{if(void 0===a)continue;if(o[a]){let e=ye(o[a],t,l);const i=_e(e,t);o[":@"]?Ee(e,o[":@"],l,t):1!==Object.keys(e).length||void 0===e[t.textNodeName]||t.alwaysCreateTextNode?0===Object.keys(e).length&&(t.alwaysCreateTextNode?e[t.textNodeName]="":e=""):e=e[t.textNodeName],void 0!==r[a]&&r.hasOwnProperty(a)?(Array.isArray(r[a])||(r[a]=[r[a]]),r[a].push(e)):t.isArray(a,l,i)?r[a]=[e]:r[a]=e}}}return"string"==typeof n?n.length>0&&(r[t.textNodeName]=n):void 0!==n&&(r[t.textNodeName]=n),r}function Ne(e){const t=Object.keys(e);for(let e=0;e<t.length;e++){const i=t[e];if(":@"!==i)return i}}function Ee(e,t,i,n){if(t){const r=Object.keys(t),s=r.length;for(let o=0;o<s;o++){const s=r[o];n.isArray(s,i+"."+s,!0,!0)?e[s]=[t[s]]:e[s]=t[s]}}}function _e(e,t){const{textNodeName:i}=t,n=Object.keys(e).length;return!(0!==n&&(1!==n||!e[i]&&"boolean"!=typeof e[i]&&0!==e[i]))}xe.prettify=function(e,t){return ye(e,t)};const{buildOptions:Ae}=U,Ie=class{constructor(e){this.options=e,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"}},this.addExternalEntities=oe,this.parseXml=he,this.parseTextData=ae,this.resolveNameSpace=le,this.buildAttributesMap=de,this.isItStopNode=ge,this.replaceEntitiesValue=pe,this.readStopNodeData=ve,this.saveTextToParentTag=fe,this.addChild=ce}},{prettify:Ce}=xe,Te=A;function Oe(e,t,i,n){let r="",s=!1;for(let o=0;o<e.length;o++){const a=e[o],l=Pe(a);if(void 0===l)continue;let u="";if(u=0===i.length?l:`${i}.${l}`,l===t.textNodeName){let e=a[l];Ve(u,t)||(e=t.tagValueProcessor(l,e),e=Le(e,t)),s&&(r+=n),r+=e,s=!1;continue}if(l===t.cdataPropName){s&&(r+=n),r+=`<![CDATA[${a[l][0][t.textNodeName]}]]>`,s=!1;continue}if(l===t.commentPropName){r+=n+`\x3c!--${a[l][0][t.textNodeName]}--\x3e`,s=!0;continue}if("?"===l[0]){const e=Se(a[":@"],t),i="?xml"===l?"":n;let o=a[l][0][t.textNodeName];o=0!==o.length?" "+o:"",r+=i+`<${l}${o}${e}?>`,s=!0;continue}let d=n;""!==d&&(d+=t.indentBy);const h=n+`<${l}${Se(a[":@"],t)}`,c=Oe(a[l],t,u,d);-1!==t.unpairedTags.indexOf(l)?t.suppressUnpairedNode?r+=h+">":r+=h+"/>":c&&0!==c.length||!t.suppressEmptyNode?c&&c.endsWith(">")?r+=h+`>${c}${n}</${l}>`:(r+=h+">",c&&""!==n&&(c.includes("/>")||c.includes("</"))?r+=n+t.indentBy+c+n:r+=c,r+=`</${l}>`):r+=h+"/>",s=!0}return r}function Pe(e){const t=Object.keys(e);for(let i=0;i<t.length;i++){const n=t[i];if(e.hasOwnProperty(n)&&":@"!==n)return n}}function Se(e,t){let i="";if(e&&!t.ignoreAttributes)for(let n in e){if(!e.hasOwnProperty(n))continue;let r=t.attributeValueProcessor(n,e[n]);r=Le(r,t),!0===r&&t.suppressBooleanAttributes?i+=` ${n.substr(t.attributeNamePrefix.length)}`:i+=` ${n.substr(t.attributeNamePrefix.length)}="${r}"`}return i}function Ve(e,t){let i=(e=e.substr(0,e.length-t.textNodeName.length-1)).substr(e.lastIndexOf(".")+1);for(let n in t.stopNodes)if(t.stopNodes[n]===e||t.stopNodes[n]==="*."+i)return!0;return!1}function Le(e,t){if(e&&e.length>0&&t.processEntities)for(let i=0;i<t.entities.length;i++){const n=t.entities[i];e=e.replace(n.regex,n.val)}return e}const De=function(e,t){let i="";return t.format&&t.indentBy.length>0&&(i="\n"),Oe(e,t,"",i)},Re={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},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 ke(e){this.options=Object.assign({},Re,e),this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=Fe),this.processTextOrObjNode=Me,this.options.format?(this.indentate=je,this.tagEndChar=">\n",this.newLine="\n"):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function Me(e,t,i){const n=this.j2x(e,i+1);return void 0!==e[this.options.textNodeName]&&1===Object.keys(e).length?this.buildTextValNode(e[this.options.textNodeName],t,n.attrStr,i):this.buildObjectNode(n.val,t,n.attrStr,i)}function je(e){return this.options.indentBy.repeat(e)}function Fe(e){return!(!e.startsWith(this.options.attributeNamePrefix)||e===this.options.textNodeName)&&e.substr(this.attrPrefixLen)}ke.prototype.build=function(e){return this.options.preserveOrder?De(e,this.options):(Array.isArray(e)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(e={[this.options.arrayNodeName]:e}),this.j2x(e,0).val)},ke.prototype.j2x=function(e,t){let i="",n="";for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r))if(typeof e[r]>"u")this.isAttribute(r)&&(n+="");else if(null===e[r])this.isAttribute(r)?n+="":"?"===r[0]?n+=this.indentate(t)+"<"+r+"?"+this.tagEndChar:n+=this.indentate(t)+"<"+r+"/"+this.tagEndChar;else if(e[r]instanceof Date)n+=this.buildTextValNode(e[r],r,"",t);else if("object"!=typeof e[r]){const s=this.isAttribute(r);if(s)i+=this.buildAttrPairStr(s,""+e[r]);else if(r===this.options.textNodeName){let t=this.options.tagValueProcessor(r,""+e[r]);n+=this.replaceEntitiesValue(t)}else n+=this.buildTextValNode(e[r],r,"",t)}else if(Array.isArray(e[r])){const i=e[r].length;let s="";for(let o=0;o<i;o++){const i=e[r][o];typeof i>"u"||(null===i?"?"===r[0]?n+=this.indentate(t)+"<"+r+"?"+this.tagEndChar:n+=this.indentate(t)+"<"+r+"/"+this.tagEndChar:"object"==typeof i?this.options.oneListGroup?s+=this.j2x(i,t+1).val:s+=this.processTextOrObjNode(i,r,t):s+=this.buildTextValNode(i,r,"",t))}this.options.oneListGroup&&(s=this.buildObjectNode(s,r,"",t)),n+=s}else if(this.options.attributesGroupName&&r===this.options.attributesGroupName){const t=Object.keys(e[r]),n=t.length;for(let s=0;s<n;s++)i+=this.buildAttrPairStr(t[s],""+e[r][t[s]])}else n+=this.processTextOrObjNode(e[r],r,t);return{attrStr:i,val:n}},ke.prototype.buildAttrPairStr=function(e,t){return t=this.options.attributeValueProcessor(e,""+t),t=this.replaceEntitiesValue(t),this.options.suppressBooleanAttributes&&"true"===t?" "+e:" "+e+'="'+t+'"'},ke.prototype.buildObjectNode=function(e,t,i,n){if(""===e)return"?"===t[0]?this.indentate(n)+"<"+t+i+"?"+this.tagEndChar:this.indentate(n)+"<"+t+i+this.closeTag(t)+this.tagEndChar;{let r="</"+t+this.tagEndChar,s="";return"?"===t[0]&&(s="?",r=""),!i&&""!==i||-1!==e.indexOf("<")?!1!==this.options.commentPropName&&t===this.options.commentPropName&&0===s.length?this.indentate(n)+`\x3c!--${e}--\x3e`+this.newLine:this.indentate(n)+"<"+t+i+s+this.tagEndChar+e+this.indentate(n)+r:this.indentate(n)+"<"+t+i+s+">"+e+r}},ke.prototype.closeTag=function(e){let t="";return-1!==this.options.unpairedTags.indexOf(e)?this.options.suppressUnpairedNode||(t="/"):t=this.options.suppressEmptyNode?"/":`></${e}`,t},ke.prototype.buildTextValNode=function(e,t,i,n){if(!1!==this.options.cdataPropName&&t===this.options.cdataPropName)return this.indentate(n)+`<![CDATA[${e}]]>`+this.newLine;if(!1!==this.options.commentPropName&&t===this.options.commentPropName)return this.indentate(n)+`\x3c!--${e}--\x3e`+this.newLine;if("?"===t[0])return this.indentate(n)+"<"+t+i+"?"+this.tagEndChar;{let r=this.options.tagValueProcessor(t,e);return r=this.replaceEntitiesValue(r),""===r?this.indentate(n)+"<"+t+i+this.closeTag(t)+this.tagEndChar:this.indentate(n)+"<"+t+i+">"+r+"</"+t+this.tagEndChar}},ke.prototype.replaceEntitiesValue=function(e){if(e&&e.length>0&&this.options.processEntities)for(let t=0;t<this.options.entities.length;t++){const i=this.options.entities[t];e=e.replace(i.regex,i.val)}return e};var He={XMLParser:class{constructor(e){this.externalEntities={},this.options=Ae(e)}parse(e,t){if("string"!=typeof e){if(!e.toString)throw new Error("XML data is accepted in String or Bytes[] form.");e=e.toString()}if(t){!0===t&&(t={});const i=Te.validate(e,t);if(!0!==i)throw Error(`${i.err.msg}:${i.err.line}:${i.err.col}`)}const i=new Ie(this.options);i.addExternalEntities(this.externalEntities);const n=i.parseXml(e);return this.options.preserveOrder||void 0===n?n:Ce(n,this.options)}addEntity(e,t){if(-1!==t.indexOf("&"))throw new Error("Entity value can't have '&'");if(-1!==e.indexOf("&")||-1!==e.indexOf(";"))throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");if("&"===t)throw new Error("An entity with value '&' is not permitted");this.externalEntities[e]=t}},XMLValidator:A,XMLBuilder:ke};class Be{_view;constructor(e){$e(e),this._view=e}get id(){return this._view.id}get name(){return this._view.name}get caption(){return this._view.caption}get emptyTitle(){return this._view.emptyTitle}get emptyCaption(){return this._view.emptyCaption}get getContents(){return this._view.getContents}get icon(){return this._view.icon}set icon(e){this._view.icon=e}get order(){return this._view.order}set order(e){this._view.order=e}get params(){return this._view.params}set params(e){this._view.params=e}get columns(){return this._view.columns}get emptyView(){return this._view.emptyView}get parent(){return this._view.parent}get sticky(){return this._view.sticky}get expanded(){return this._view.expanded}set expanded(e){this._view.expanded=e}get defaultSortKey(){return this._view.defaultSortKey}}const $e=function(e){if(!e.id||"string"!=typeof e.id)throw new Error("View id is required and must be a string");if(!e.name||"string"!=typeof e.name)throw new Error("View name is required and must be a string");if(e.columns&&e.columns.length>0&&(!e.caption||"string"!=typeof e.caption))throw new Error("View caption is required for top-level views and must be a string");if(!e.getContents||"function"!=typeof e.getContents)throw new Error("View getContents is required and must be a function");if(!e.icon||"string"!=typeof e.icon||!function(e){if("string"!=typeof e)throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);if(0===(e=e.trim()).length||!0!==He.XMLValidator.validate(e))return!1;let t;const i=new He.XMLParser;try{t=i.parse(e)}catch{return!1}return!(!t||!("svg"in t))}(e.icon))throw new Error("View icon is required and must be a valid svg string");if(!("order"in e)||"number"!=typeof e.order)throw new Error("View order is required and must be a number");if(e.columns&&e.columns.forEach((e=>{if(!(e instanceof E))throw new Error("View columns must be an array of Column. Invalid column found")})),e.emptyView&&"function"!=typeof e.emptyView)throw new Error("View emptyView must be a function");if(e.parent&&"string"!=typeof e.parent)throw new Error("View parent must be a string");if("sticky"in e&&"boolean"!=typeof e.sticky)throw new Error("View sticky must be a boolean");if("expanded"in e&&"boolean"!=typeof e.expanded)throw new Error("View expanded must be a boolean");if(e.defaultSortKey&&"string"!=typeof e.defaultSortKey)throw new Error("View defaultSortKey must be a string");return!0},Ue='<svg xmlns="http://www.w3.org/2000/svg" id="mdi-account-group" viewBox="0 0 24 24"><path d="M12,5.5A3.5,3.5 0 0,1 15.5,9A3.5,3.5 0 0,1 12,12.5A3.5,3.5 0 0,1 8.5,9A3.5,3.5 0 0,1 12,5.5M5,8C5.56,8 6.08,8.15 6.53,8.42C6.38,9.85 6.8,11.27 7.66,12.38C7.16,13.34 6.16,14 5,14A3,3 0 0,1 2,11A3,3 0 0,1 5,8M19,8A3,3 0 0,1 22,11A3,3 0 0,1 19,14C17.84,14 16.84,13.34 16.34,12.38C17.2,11.27 17.62,9.85 17.47,8.42C17.92,8.15 18.44,8 19,8M5.5,18.25C5.5,16.18 8.41,14.5 12,14.5C15.59,14.5 18.5,16.18 18.5,18.25V20H5.5V18.25M0,20V18.5C0,17.11 1.89,15.94 4.45,15.6C3.86,16.28 3.5,17.22 3.5,18.25V20H0M24,20H20.5V18.25C20.5,17.22 20.14,16.28 19.55,15.6C22.11,15.94 24,17.11 24,18.5V20Z" /></svg>',Ze='<svg xmlns="http://www.w3.org/2000/svg" id="mdi-account-plus" viewBox="0 0 24 24"><path d="M15,14C12.33,14 7,15.33 7,18V20H23V18C23,15.33 17.67,14 15,14M6,10V7H4V10H1V12H4V15H6V12H9V10M15,12A4,4 0 0,0 19,8A4,4 0 0,0 15,4A4,4 0 0,0 11,8A4,4 0 0,0 15,12Z" /></svg>',Ge='<svg xmlns="http://www.w3.org/2000/svg" id="mdi-link" viewBox="0 0 24 24"><path d="M3.9,12C3.9,10.29 5.29,8.9 7,8.9H11V7H7A5,5 0 0,0 2,12A5,5 0 0,0 7,17H11V15.1H7C5.29,15.1 3.9,13.71 3.9,12M8,13H16V11H8V13M17,7H13V8.9H17C18.71,8.9 20.1,10.29 20.1,12C20.1,13.71 18.71,15.1 17,15.1H13V17H17A5,5 0 0,0 22,12A5,5 0 0,0 17,7Z" /></svg>';var Ye=i(93664);const qe=(0,s.IY)().setApp("files_sharing").detectUser().build(),ze=`/files/${(0,r.ts)()?.uid}`,Xe={"Content-Type":"application/json"},Ke=function(e){try{const t="folder"===e?.item_type,i=!0===e?.has_preview,n=t?y:x,r=e.file_source,s=e?.path||e.file_target,o=(0,l.generateRemoteUrl)(`dav/${ze}/${s}`.replaceAll(/\/\//gm,"/"));let a=e?.item_mtime?new Date(1e3*e.item_mtime):void 0;return e?.stime>(e?.item_mtime||0)&&(a=new Date(1e3*e.stime)),new n({id:r,source:o,owner:e?.uid_owner,mime:e?.mimetype,mtime:a,size:e?.item_size,permissions:e?.item_permissions||e?.permissions,root:ze,attributes:{...e,"has-preview":i,favorite:e?.tags?.includes(window.OC.TAG_FAVORITE)?1:0}})}catch(e){return qe.error("Error while parsing OCS entry",{error:e}),null}},We=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const t=(0,l.generateOcsUrl)("apps/files_sharing/api/v1/shares");return Ye.Z.get(t,{headers:Xe,params:{shared_with_me:e,include_tags:!0}})},Je=async function(){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],t=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];const s=[];(!(arguments.length>0&&void 0!==arguments[0])||arguments[0])&&s.push(We(!0),function(){const e=(0,l.generateOcsUrl)("apps/files_sharing/api/v1/remote_shares");return Ye.Z.get(e,{headers:Xe,params:{include_tags:!0}})}()),e&&s.push(We()),t&&s.push(function(){const e=(0,l.generateOcsUrl)("apps/files_sharing/api/v1/shares/pending");return Ye.Z.get(e,{headers:Xe,params:{include_tags:!0}})}(),function(){const e=(0,l.generateOcsUrl)("apps/files_sharing/api/v1/remote_shares/pending");return Ye.Z.get(e,{headers:Xe,params:{include_tags:!0}})}()),i&&s.push(function(){const e=(0,l.generateOcsUrl)("apps/files_sharing/api/v1/deletedshares");return Ye.Z.get(e,{headers:Xe,params:{include_tags:!0}})}());let o=(await Promise.all(s)).map((e=>e.data.ocs.data)).flat().map(Ke).filter((e=>null!==e));return n.length>0&&(o=o.filter((e=>n.includes(e.attributes?.share_type)))),{folder:new y({id:0,source:(0,l.generateRemoteUrl)("dav"+ze),owner:(0,r.ts)()?.uid||null}),contents:o}},Qe="shareoverview",et="sharingin",tt="sharingout",it="sharinglinks",nt="deletedshares",rt="pendingshares";var st=i(69183);p(new c({id:"accept-share",displayName:e=>(0,n.uN)("files_sharing","Accept share","Accept shares",e.length),iconSvgInline:()=>'<svg xmlns="http://www.w3.org/2000/svg" id="mdi-check" viewBox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" /></svg>',enabled:(e,t)=>e.length>0&&t.id===rt,async exec(e){try{const t=!!e.attributes.remote,i=(0,l.generateOcsUrl)("apps/files_sharing/api/v1/{shareBase}/pending/{id}",{shareBase:t?"remote_shares":"shares",id:e.attributes.id});return await Ye.Z.post(i),(0,st.j8)("files:node:deleted",e),!0}catch(e){return!1}},async execBatch(e,t,i){return Promise.all(e.map((e=>this.exec(e,t,i))))},order:1,inline:()=>!0})),p(new c({id:"open-in-files",displayName:()=>(0,n.Iu)("files","Open in Files"),iconSvgInline:()=>"",enabled:(e,t)=>[Qe,et,tt,it].includes(t.id),exec:async e=>(window.OCP.Files.Router.goToRoute(null,{view:"files",fileid:e.fileid},{dir:e.dirname}),null),order:-1e3,default:h.HIDDEN})),p(new c({id:"reject-share",displayName:e=>(0,n.uN)("files_sharing","Reject share","Reject shares",e.length),iconSvgInline:()=>'<svg xmlns="http://www.w3.org/2000/svg" id="mdi-close" viewBox="0 0 24 24"><path d="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z" /></svg>',enabled:(e,t)=>t.id===rt&&0!==e.length&&!e.some((e=>e.attributes.remote_id&&e.attributes.share_type===window.OC.Share.SHARE_TYPE_REMOTE_GROUP)),async exec(e){try{const t=!!e.attributes.remote,i=(0,l.generateOcsUrl)("apps/files_sharing/api/v1/{shareBase}/{id}",{shareBase:t?"remote_shares":"shares",id:e.attributes.id});return await Ye.Z.delete(i),(0,st.j8)("files:node:deleted",e),!0}catch(e){return!1}},async execBatch(e,t,i){return Promise.all(e.map((e=>this.exec(e,t,i))))},order:2,inline:()=>!0})),p(new c({id:"restore-share",displayName:e=>(0,n.uN)("files_sharing","Restore share","Restore shares",e.length),iconSvgInline:()=>'<svg xmlns="http://www.w3.org/2000/svg" id="mdi-arrow-u-left-top" viewBox="0 0 24 24"><path d="M20 13.5C20 17.09 17.09 20 13.5 20H6V18H13.5C16 18 18 16 18 13.5S16 9 13.5 9H7.83L10.91 12.09L9.5 13.5L4 8L9.5 2.5L10.92 3.91L7.83 7H13.5C17.09 7 20 9.91 20 13.5Z" /></svg>',enabled:(e,t)=>e.length>0&&t.id===nt,async exec(e){try{const t=(0,l.generateOcsUrl)("apps/files_sharing/api/v1/deletedshares/{id}",{id:e.attributes.id});return await Ye.Z.post(t),(0,st.j8)("files:node:deleted",e),!0}catch(e){return!1}},async execBatch(e,t,i){return Promise.all(e.map((e=>this.exec(e,t,i))))},order:1,inline:()=>!0}));var ot=i(41922),at=i(48250);const lt=(0,s.IY)().setApp("files").detectUser().build(),ut=new c({id:"details",displayName:()=>(0,n.Iu)("files","Open details"),iconSvgInline:()=>at,enabled:e=>1===e.length&&!!e[0]&&!!window?.OCA?.Files?.Sidebar&&((e[0].root?.startsWith("/files/")&&e[0].permissions!==f.NONE)??!1),async exec(e,t,i){try{return await window.OCA.Files.Sidebar.open(e.path),window.OCP.Files.Router.goToRoute(null,{view:t.id,fileid:e.fileid},{dir:i},!0),null}catch(e){return lt.error("Error while opening sidebar",{error:e}),!1}},order:-50});var dt=i(93379),ht=i.n(dt),ct=i(7795),pt=i.n(ct),ft=i(90569),gt=i.n(ft),mt=i(3565),wt=i.n(mt),vt=i(19216),bt=i.n(vt),xt=i(44589),yt=i.n(xt),Nt=i(8492),Et={};Et.styleTagTransform=yt(),Et.setAttributes=wt(),Et.insert=gt().bind(null,"head"),Et.domAPI=pt(),Et.insertStyleElement=bt(),ht()(Nt.Z,Et),Nt.Z&&Nt.Z.locals&&Nt.Z.locals,p(new c({id:"sharing-status",displayName(e){const t=e[0],i=Object.values(t?.attributes?.["share-types"]||{}).flat(),s=t?.attributes?.["owner-id"];return i.length>0||s&&s!==(0,r.ts)()?.uid?(0,n.Iu)("files_sharing","Shared"):""},title(e){const t=e[0],i=t?.attributes?.["owner-id"],s=t?.attributes?.["owner-display-name"];return i&&i!==(0,r.ts)()?.uid?(0,n.Iu)("files_sharing","Shared by {ownerDisplayName}",{ownerDisplayName:s}):(0,n.Iu)("files_sharing","Show sharing options")},iconSvgInline(e){const t=e[0],i=Object.values(t?.attributes?.["share-types"]||{}).flat();if(i.includes(ot.D.SHARE_TYPE_LINK)||i.includes(ot.D.SHARE_TYPE_EMAIL))return Ge;if(i.includes(ot.D.SHARE_TYPE_GROUP)||i.includes(ot.D.SHARE_TYPE_REMOTE_GROUP))return Ue;if(i.includes(ot.D.SHARE_TYPE_CIRCLE))return'<svg width="16" height="16" viewBox="0 0 21.33 21.33" xmlns="http://www.w3.org/2000/svg"><path d="M10.67 1.33a9.34 9.34 0 100 18.68 9.34 9.34 0 000-18.68zM6.93 15.8a2.33 2.33 0 110-4.67 2.33 2.33 0 010 4.67zm1.4-8.87a2.33 2.33 0 114.67 0 2.33 2.33 0 01-4.67 0zm6.07 8.87a2.33 2.33 0 110-4.67 2.33 2.33 0 010 4.67z"/></svg>\n';const n=t?.attributes?.["owner-id"];return n&&n!==(0,r.ts)()?.uid?(s=n,`<svg width="32" height="32" viewBox="0 0 32 32"\n\t\txmlns="http://www.w3.org/2000/svg" class="sharing-status__avatar">\n\t\t<image href="${(0,l.generateUrl)("/avatar/{userId}/32",{userId:s})}" height="32" width="32" />\n\t</svg>`):Ze;var s},enabled(e){if(1!==e.length)return!1;const t=e[0],i=t?.attributes?.["owner-id"];return!(!i||i===(0,r.ts)()?.uid)||0!=(t.permissions&f.SHARE)},exec:async(e,t,i)=>0!=(e.permissions&f.READ)?(window.OCA?.Files?.Sidebar?.setActiveTab?.("sharing"),ut.exec(e,t,i)):null,inline:()=>!0})),(()=>{const e=(typeof window._nc_navigation>"u"&&(window._nc_navigation=new N,u.debug("Navigation service initialized")),window._nc_navigation);e.register(new Be({id:Qe,name:(0,n.Iu)("files_sharing","Shares"),caption:(0,n.Iu)("files_sharing","Overview of shared files."),emptyTitle:(0,n.Iu)("files_sharing","No shares"),emptyCaption:(0,n.Iu)("files_sharing","Files and folders you shared or have been shared with you will show up here"),icon:Ze,order:20,columns:[],getContents:()=>Je()})),e.register(new Be({id:et,name:(0,n.Iu)("files_sharing","Shared with you"),caption:(0,n.Iu)("files_sharing","List of files that are shared with you."),emptyTitle:(0,n.Iu)("files_sharing","Nothing shared with you yet"),emptyCaption:(0,n.Iu)("files_sharing","Files and folders others shared with you will show up here"),icon:'<svg xmlns="http://www.w3.org/2000/svg" id="mdi-account" viewBox="0 0 24 24"><path d="M12,4A4,4 0 0,1 16,8A4,4 0 0,1 12,12A4,4 0 0,1 8,8A4,4 0 0,1 12,4M12,14C16.42,14 20,15.79 20,18V20H4V18C4,15.79 7.58,14 12,14Z" /></svg>',order:1,parent:Qe,columns:[],getContents:()=>Je(!0,!1,!1,!1)})),e.register(new Be({id:tt,name:(0,n.Iu)("files_sharing","Shared with others"),caption:(0,n.Iu)("files_sharing","List of files that you shared with others."),emptyTitle:(0,n.Iu)("files_sharing","Nothing shared yet"),emptyCaption:(0,n.Iu)("files_sharing","Files and folders you shared will show up here"),icon:Ue,order:2,parent:Qe,columns:[],getContents:()=>Je(!1,!0,!1,!1)})),e.register(new Be({id:it,name:(0,n.Iu)("files_sharing","Shared by link"),caption:(0,n.Iu)("files_sharing","List of files that are shared by link."),emptyTitle:(0,n.Iu)("files_sharing","No shared links"),emptyCaption:(0,n.Iu)("files_sharing","Files and folders you shared by link will show up here"),icon:Ge,order:3,parent:Qe,columns:[],getContents:()=>Je(!1,!0,!1,!1,[window.OC.Share.SHARE_TYPE_LINK])})),e.register(new Be({id:nt,name:(0,n.Iu)("files_sharing","Deleted shares"),caption:(0,n.Iu)("files_sharing","List of shares you left."),emptyTitle:(0,n.Iu)("files_sharing","No deleted shares"),emptyCaption:(0,n.Iu)("files_sharing","Shares you have left will show up here"),icon:'<svg xmlns="http://www.w3.org/2000/svg" id="mdi-delete" viewBox="0 0 24 24"><path d="M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z" /></svg>',order:4,parent:Qe,columns:[],getContents:()=>Je(!1,!1,!1,!0)})),e.register(new Be({id:rt,name:(0,n.Iu)("files_sharing","Pending shares"),caption:(0,n.Iu)("files_sharing","List of unapproved shares."),emptyTitle:(0,n.Iu)("files_sharing","No pending shares"),emptyCaption:(0,n.Iu)("files_sharing","Shares you have received but not approved will show up here"),icon:'<svg xmlns="http://www.w3.org/2000/svg" id="mdi-account-clock" viewBox="0 0 24 24"><path d="M10.63,14.1C12.23,10.58 16.38,9.03 19.9,10.63C23.42,12.23 24.97,16.38 23.37,19.9C22.24,22.4 19.75,24 17,24C14.3,24 11.83,22.44 10.67,20H1V18C1.06,16.86 1.84,15.93 3.34,15.18C4.84,14.43 6.72,14.04 9,14C9.57,14 10.11,14.05 10.63,14.1V14.1M9,4C10.12,4.03 11.06,4.42 11.81,5.17C12.56,5.92 12.93,6.86 12.93,8C12.93,9.14 12.56,10.08 11.81,10.83C11.06,11.58 10.12,11.95 9,11.95C7.88,11.95 6.94,11.58 6.19,10.83C5.44,10.08 5.07,9.14 5.07,8C5.07,6.86 5.44,5.92 6.19,5.17C6.94,4.42 7.88,4.03 9,4M17,22A5,5 0 0,0 22,17A5,5 0 0,0 17,12A5,5 0 0,0 12,17A5,5 0 0,0 17,22M16,14H17.5V16.82L19.94,18.23L19.19,19.53L16,17.69V14Z" /></svg>',order:5,parent:Qe,columns:[],getContents:()=>Je(!1,!1,!0,!1)}))})()},8492:(e,t,i)=>{i.d(t,{Z:()=>a});var n=i(87537),r=i.n(n),s=i(23645),o=i.n(s)()(r());o.push([e.id,".action-items>.files-list__row-action-sharing-status{direction:rtl;padding-right:0 !important}svg.sharing-status__avatar{height:32px !important;width:32px !important;border-radius:32px;overflow:hidden}","",{version:3,sources:["webpack://./apps/files_sharing/src/actions/sharingStatusAction.scss"],names:[],mappings:"AAsBA,qDAEC,aAAA,CAEG,0BAAA,CAGJ,2BACC,sBAAA,CACA,qBAAA,CACA,kBAAA,CACA,eAAA",sourcesContent:["/**\n * @copyright Copyright (c) 2023 John Molakvoæ <skjnldsv@protonmail.com>\n *\n * @author John Molakvoæ <skjnldsv@protonmail.com>\n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\n */\n // Only when rendered inline, when not enough space, this is put in the menu\n.action-items > .files-list__row-action-sharing-status {\n\t// put icon at the end of the button\n\tdirection: rtl;\n\t// align icons with textless inline actions\n padding-right: 0 !important;\n}\n\nsvg.sharing-status__avatar {\n\theight: 32px !important;\n\twidth: 32px !important;\n\tborder-radius: 32px;\n\toverflow: hidden;\n}"],sourceRoot:""}]);const a=o}},i={};function n(e){var r=i[e];if(void 0!==r)return r.exports;var s=i[e]={id:e,loaded:!1,exports:{}};return t[e].call(s.exports,s,s.exports,n),s.loaded=!0,s.exports}n.m=t,e=[],n.O=(t,i,r,s)=>{if(!i){var o=1/0;for(d=0;d<e.length;d++){i=e[d][0],r=e[d][1],s=e[d][2];for(var a=!0,l=0;l<i.length;l++)(!1&s||o>=s)&&Object.keys(n.O).every((e=>n.O[e](i[l])))?i.splice(l--,1):(a=!1,s<o&&(o=s));if(a){e.splice(d--,1);var u=r();void 0!==u&&(t=u)}}return t}s=s||0;for(var d=e.length;d>0&&e[d-1][2]>s;d--)e[d]=e[d-1];e[d]=[i,r,s]},n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.e=()=>Promise.resolve(),n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),n.j=1609,(()=>{n.b=document.baseURI||self.location.href;var e={1609:0};n.O.j=t=>0===e[t];var t=(t,i)=>{var r,s,o=i[0],a=i[1],l=i[2],u=0;if(o.some((t=>0!==e[t]))){for(r in a)n.o(a,r)&&(n.m[r]=a[r]);if(l)var d=l(n)}for(t&&t(i);u<o.length;u++)s=o[u],n.o(e,s)&&e[s]&&e[s][0](),e[s]=0;return n.O(d)},i=self.webpackChunknextcloud=self.webpackChunknextcloud||[];i.forEach(t.bind(null,0)),i.push=t.bind(null,i.push.bind(i))})(),n.nc=void 0;var r=n.O(void 0,[7874],(()=>n(11090)));r=n.O(r)})();
  3. //# sourceMappingURL=files_sharing-init.js.map?v=c40249092fcbe4a9fcdb