12 |
- "use strict";(self.webpackChunknextcloud=self.webpackChunknextcloud||[]).push([[4065],{9165:(e,t,i)=>{i.d(t,{$BT:()=>c,Ckb:()=>u,EYN:()=>f,F5c:()=>m,Fzw:()=>h,KR_:()=>p,MXC:()=>v,NZC:()=>r,Tfj:()=>o,ZL5:()=>C,dF:()=>g,fEr:()=>d,lWO:()=>a,mbi:()=>l,qFD:()=>n,vrq:()=>s,zY6:()=>w});var l="M16.61 15.15C16.15 15.15 15.77 14.78 15.77 14.32S16.15 13.5 16.61 13.5H16.61C17.07 13.5 17.45 13.86 17.45 14.32C17.45 14.78 17.07 15.15 16.61 15.15M7.41 15.15C6.95 15.15 6.57 14.78 6.57 14.32C6.57 13.86 6.95 13.5 7.41 13.5H7.41C7.87 13.5 8.24 13.86 8.24 14.32C8.24 14.78 7.87 15.15 7.41 15.15M16.91 10.14L18.58 7.26C18.67 7.09 18.61 6.88 18.45 6.79C18.28 6.69 18.07 6.75 18 6.92L16.29 9.83C14.95 9.22 13.5 8.9 12 8.91C10.47 8.91 9 9.24 7.73 9.82L6.04 6.91C5.95 6.74 5.74 6.68 5.57 6.78C5.4 6.87 5.35 7.08 5.44 7.25L7.1 10.13C4.25 11.69 2.29 14.58 2 18H22C21.72 14.59 19.77 11.7 16.91 10.14H16.91Z",n="M2.09 16.8H3.75V9.76H2.09M2.92 8.84C3.44 8.84 3.84 8.44 3.84 7.94C3.84 7.44 3.44 7.04 2.92 7.04C2.4 7.04 2 7.44 2 7.94C2 8.44 2.4 8.84 2.92 8.84M9.25 7.06C6.46 7.06 4.7 8.96 4.7 12C4.7 15.06 6.46 16.96 9.25 16.96C12.04 16.96 13.8 15.06 13.8 12C13.8 8.96 12.04 7.06 9.25 7.06M9.25 8.5C10.96 8.5 12.05 9.87 12.05 12C12.05 14.15 10.96 15.5 9.25 15.5C7.54 15.5 6.46 14.15 6.46 12C6.46 9.87 7.54 8.5 9.25 8.5M14.5 14.11C14.57 15.87 16 16.96 18.22 16.96C20.54 16.96 22 15.82 22 14C22 12.57 21.18 11.77 19.23 11.32L18.13 11.07C16.95 10.79 16.47 10.42 16.47 9.78C16.47 9 17.2 8.45 18.28 8.45C19.38 8.45 20.13 9 20.21 9.89H21.84C21.8 8.2 20.41 7.06 18.29 7.06C16.21 7.06 14.73 8.21 14.73 9.91C14.73 11.28 15.56 12.13 17.33 12.53L18.57 12.82C19.78 13.11 20.27 13.5 20.27 14.2C20.27 15 19.47 15.57 18.31 15.57C17.15 15.57 16.26 15 16.16 14.11H14.5Z",a="M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22A10,10 0 0,1 2,12A10,10 0 0,1 12,2M12,4A8,8 0 0,0 4,12C4,14.09 4.8,16 6.11,17.41L9.88,9.88L17.41,6.11C16,4.8 14.09,4 12,4M12,20A8,8 0 0,0 20,12C20,9.91 19.2,8 17.89,6.59L14.12,14.12L6.59,17.89C8,19.2 9.91,20 12,20M12,12L11.23,11.23L9.7,14.3L12.77,12.77L12,12M12,17.5H13V19H12V17.5M15.88,15.89L16.59,15.18L17.65,16.24L16.94,16.95L15.88,15.89M17.5,12V11H19V12H17.5M12,6.5H11V5H12V6.5M8.12,8.11L7.41,8.82L6.35,7.76L7.06,7.05L8.12,8.11M6.5,12V13H5V12H6.5Z",s="M17,19H7V5H17M17,1H7C5.89,1 5,1.89 5,3V21A2,2 0 0,0 7,23H17A2,2 0 0,0 19,21V3C19,1.89 18.1,1 17,1Z",o="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z",r="M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M16.2,16.2L11,13V7H12.5V12.2L17,14.9L16.2,16.2Z",c="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z",u="M9.27 7.94C9.27 7.94 9.27 7.94 9.27 7.94M6.85 6.74C6.86 6.74 6.86 6.74 6.85 6.74M21.28 8.6C20.85 7.55 19.96 6.42 19.27 6.06C19.83 7.17 20.16 8.28 20.29 9.1L20.29 9.12C19.16 6.3 17.24 5.16 15.67 2.68C15.59 2.56 15.5 2.43 15.43 2.3C15.39 2.23 15.36 2.16 15.32 2.09C15.26 1.96 15.2 1.83 15.17 1.69C15.17 1.68 15.16 1.67 15.15 1.67H15.13L15.12 1.67L15.12 1.67L15.12 1.67C12.9 2.97 11.97 5.26 11.74 6.71C11.05 6.75 10.37 6.92 9.75 7.22C9.63 7.27 9.58 7.41 9.62 7.53C9.67 7.67 9.83 7.74 9.96 7.68C10.5 7.42 11.1 7.27 11.7 7.23L11.75 7.23C11.83 7.22 11.92 7.22 12 7.22C12.5 7.21 12.97 7.28 13.44 7.42L13.5 7.44C13.6 7.46 13.67 7.5 13.75 7.5C13.8 7.54 13.86 7.56 13.91 7.58L14.05 7.64C14.12 7.67 14.19 7.7 14.25 7.73C14.28 7.75 14.31 7.76 14.34 7.78C14.41 7.82 14.5 7.85 14.54 7.89C14.58 7.91 14.62 7.94 14.66 7.96C15.39 8.41 16 9.03 16.41 9.77C15.88 9.4 14.92 9.03 14 9.19C17.6 11 16.63 17.19 11.64 16.95C11.2 16.94 10.76 16.85 10.34 16.7C10.24 16.67 10.14 16.63 10.05 16.58C10 16.56 9.93 16.53 9.88 16.5C8.65 15.87 7.64 14.68 7.5 13.23C7.5 13.23 8 11.5 10.83 11.5C11.14 11.5 12 10.64 12.03 10.4C12.03 10.31 10.29 9.62 9.61 8.95C9.24 8.59 9.07 8.42 8.92 8.29C8.84 8.22 8.75 8.16 8.66 8.1C8.43 7.3 8.42 6.45 8.63 5.65C7.6 6.12 6.8 6.86 6.22 7.5H6.22C5.82 7 5.85 5.35 5.87 5C5.86 5 5.57 5.16 5.54 5.18C5.19 5.43 4.86 5.71 4.56 6C4.21 6.37 3.9 6.74 3.62 7.14C3 8.05 2.5 9.09 2.28 10.18C2.28 10.19 2.18 10.59 2.11 11.1L2.08 11.33C2.06 11.5 2.04 11.65 2 11.91L2 11.94L2 12.27L2 12.32C2 17.85 6.5 22.33 12 22.33C16.97 22.33 21.08 18.74 21.88 14C21.9 13.89 21.91 13.76 21.93 13.63C22.13 11.91 21.91 10.11 21.28 8.6Z",d="M10,4H4C2.89,4 2,4.89 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V8C22,6.89 21.1,6 20,6H12L10,4Z",p="M12,20L15.46,14H15.45C15.79,13.4 16,12.73 16,12C16,10.8 15.46,9.73 14.62,9H19.41C19.79,9.93 20,10.94 20,12A8,8 0 0,1 12,20M4,12C4,10.54 4.39,9.18 5.07,8L8.54,14H8.55C9.24,15.19 10.5,16 12,16C12.45,16 12.88,15.91 13.29,15.77L10.89,19.91C7,19.37 4,16.04 4,12M15,12A3,3 0 0,1 12,15A3,3 0 0,1 9,12A3,3 0 0,1 12,9A3,3 0 0,1 15,12M12,4C14.96,4 17.54,5.61 18.92,8H12C10.06,8 8.45,9.38 8.08,11.21L5.7,7.08C7.16,5.21 9.44,4 12,4M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z",f="M7 14C5.9 14 5 13.1 5 12S5.9 10 7 10 9 10.9 9 12 8.1 14 7 14M12.6 10C11.8 7.7 9.6 6 7 6C3.7 6 1 8.7 1 12S3.7 18 7 18C9.6 18 11.8 16.3 12.6 14H16V18H20V14H23V10H12.6Z",v="M10.86 15.37C10.17 14.6 9.7 13.68 9.55 12.65C9.25 13.11 9 13.61 8.82 14.15C7.9 16.9 9.5 20.33 12.22 21.33C14.56 22.11 17.19 20.72 18.92 19.2C19.18 18.85 21.23 17.04 20.21 16.84C17.19 18.39 13.19 17.95 10.86 15.37M11.46 9.56C12.5 9.55 11.5 9.13 11.07 8.81C10.03 8.24 8.81 7.96 7.63 7.96C3.78 8 .995 10.41 2.3 14.4C3.24 18.28 6.61 21.4 10.59 21.9C8.54 20.61 7.3 18.19 7.3 15.78C7.38 13.25 8.94 10.28 11.46 9.56M2.78 8.24C5.82 6 10.66 6.18 13.28 9C14.3 10.11 15 12 14.07 13.37C12.33 15.25 17.15 15.5 18.18 15.22C21.92 14.5 22.91 10.15 21.13 7.15C19.43 3.75 15.66 1.97 11.96 2C7.9 1.93 4.25 4.5 2.78 8.24Z",m="M21,16H3V4H21M21,2H3C1.89,2 1,2.89 1,4V16A2,2 0 0,0 3,18H10V20H8V22H16V20H14V18H21A2,2 0 0,0 23,16V4C23,2.89 22.1,2 21,2Z",C="M12,17.27L18.18,21L16.54,13.97L22,9.24L14.81,8.62L12,2L9.19,8.62L2,9.24L7.45,13.97L5.82,21L12,17.27Z",g="M12,15.39L8.24,17.66L9.23,13.38L5.91,10.5L10.29,10.13L12,6.09L13.71,10.13L18.09,10.5L14.77,13.38L15.76,17.66M22,9.24L14.81,8.63L12,2L9.19,8.63L2,9.24L7.45,13.97L5.82,21L12,17.27L18.18,21L16.54,13.97L22,9.24Z",h="M19,18H5V6H19M21,4H3C1.89,4 1,4.89 1,6V18A2,2 0 0,0 3,20H21A2,2 0 0,0 23,18V6C23,4.89 22.1,4 21,4Z",w="M16.36,14C16.44,13.34 16.5,12.68 16.5,12C16.5,11.32 16.44,10.66 16.36,10H19.74C19.9,10.64 20,11.31 20,12C20,12.69 19.9,13.36 19.74,14M14.59,19.56C15.19,18.45 15.65,17.25 15.97,16H18.92C17.96,17.65 16.43,18.93 14.59,19.56M14.34,14H9.66C9.56,13.34 9.5,12.68 9.5,12C9.5,11.32 9.56,10.65 9.66,10H14.34C14.43,10.65 14.5,11.32 14.5,12C14.5,12.68 14.43,13.34 14.34,14M12,19.96C11.17,18.76 10.5,17.43 10.09,16H13.91C13.5,17.43 12.83,18.76 12,19.96M8,8H5.08C6.03,6.34 7.57,5.06 9.4,4.44C8.8,5.55 8.35,6.75 8,8M5.08,16H8C8.35,17.25 8.8,18.45 9.4,19.56C7.57,18.93 6.03,17.65 5.08,16M4.26,14C4.1,13.36 4,12.69 4,12C4,11.31 4.1,10.64 4.26,10H7.64C7.56,10.66 7.5,11.32 7.5,12C7.5,12.68 7.56,13.34 7.64,14M12,4.03C12.83,5.23 13.5,6.57 13.91,8H10.09C10.5,6.57 11.17,5.23 12,4.03M18.92,8H15.97C15.65,6.75 15.19,5.55 14.59,4.44C16.43,5.07 17.96,6.34 18.92,8M12,2C6.47,2 2,6.5 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z"},27518:e=>{e.exports="data:image/svg+xml,%3c%21--%20-%20SPDX-FileCopyrightText:%202020%20Google%20Inc.%20-%20SPDX-License-Identifier:%20Apache-2.0%20--%3e%3csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20width=%2724%27%20height=%2724%27%20fill=%27%23222%27%3e%3cpath%20d=%27M15.4%2016.6L10.8%2012l4.6-4.6L14%206l-6%206%206%206%201.4-1.4z%27/%3e%3c/svg%3e"},27514:e=>{e.exports="data:image/svg+xml,%3c%21--%20-%20SPDX-FileCopyrightText:%202020%20Google%20Inc.%20-%20SPDX-License-Identifier:%20Apache-2.0%20--%3e%3csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20width=%2724%27%20height=%2724%27%20fill=%27%23222%27%3e%3cpath%20d=%27M18.4%207.4L17%206l-6%206%206%206%201.4-1.4-4.6-4.6%204.6-4.6m-6%200L11%206l-6%206%206%206%201.4-1.4L7.8%2012l4.6-4.6z%27/%3e%3c/svg%3e"},79722:e=>{e.exports="data:image/svg+xml,%3c%21--%20-%20SPDX-FileCopyrightText:%202020%20Google%20Inc.%20-%20SPDX-License-Identifier:%20Apache-2.0%20--%3e%3csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20width=%2724%27%20height=%2724%27%20fill=%27%23222%27%3e%3cpath%20d=%27M5.6%207.4L7%206l6%206-6%206-1.4-1.4%204.6-4.6-4.6-4.6m6%200L13%206l6%206-6%206-1.4-1.4%204.6-4.6-4.6-4.6z%27/%3e%3c/svg%3e"},86886:e=>{e.exports="data:image/svg+xml,%3c%21--%20-%20SPDX-FileCopyrightText:%202020%20Google%20Inc.%20-%20SPDX-License-Identifier:%20Apache-2.0%20--%3e%3csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20width=%2724%27%20height=%2724%27%20fill=%27%23222%27%3e%3cpath%20d=%27M8.6%2016.6l4.6-4.6-4.6-4.6L10%206l6%206-6%206-1.4-1.4z%27/%3e%3c/svg%3e"},17207:(e,t,i)=>{i.r(t),i.d(t,{default:()=>Ve});var l=i(85471),n=i(78570),a=i(78791),s=i(76333),o=i(32981),r=i(63814),c=i(82680),u=i(59271),d=i(28893),p=i(21777),f=i(96763);const v=Symbol("csrf-retry"),m=Symbol("retryDelay");var C;const g=d.A.create({headers:{requesttoken:null!=(C=(0,p.do)())?C:"","X-Requested-With":"XMLHttpRequest"}}),h=Object.assign(g,{CancelToken:d.A.CancelToken,isCancel:d.A.isCancel});h.interceptors.response.use((e=>e),(e=>async t=>{var i;const{config:l,response:n,request:a}=t,s=null==a?void 0:a.responseURL;if(412===(null==n?void 0:n.status)&&"CSRF check failed"===(null==(i=null==n?void 0:n.data)?void 0:i.message)&&void 0===l[v]){f.warn("Request to ".concat(s," failed because of a CSRF mismatch. Fetching a new token"));const{data:{token:t}}=await e.get((0,r.Jv)("/csrftoken"));return f.debug("New request token ".concat(t," fetched")),e.defaults.headers.requesttoken=t,e({...l,headers:{...l.headers,requesttoken:t},[v]:!0})}return Promise.reject(t)})(h)),h.interceptors.response.use((e=>e),(e=>async t=>{var i;const{config:l,response:n,request:a}=t,s=null==a?void 0:a.responseURL,o=null==n?void 0:n.status,r=null==n?void 0:n.headers;if(503===o&&"1"===r["x-nextcloud-maintenance-mode"]&&l.retryIfMaintenanceMode&&(!l[m]||l[m]<=32)){const t=2*(null!=(i=l[m])?i:1);return f.warn("Request to ".concat(s," failed because of maintenance mode. Retrying in ").concat(t,"s")),await new Promise((e=>{setTimeout(e,1e3*t)})),e({...l,[m]:t})}return Promise.reject(t)})(h)),h.interceptors.response.use((e=>e),(async e=>{var t;const{config:i,response:l,request:n}=e,a=null==n?void 0:n.responseURL;return 401===(null==l?void 0:l.status)&&"Current user is not logged in"===(null==(t=null==l?void 0:l.data)?void 0:t.message)&&i.reloadExpiredSession&&(null==window?void 0:window.location)&&(f.error("Request to ".concat(a," failed because the user session expired. Reloading the page …")),window.location.reload()),Promise.reject(e)})),(0,p.zo)((e=>{g.defaults.headers.requesttoken=e}));var w=i(54914),_=i(9165),y=i(61338),b=i(36117),k=i(43627),L=i(96763);const N={name:"FileIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var F=function(){var e=this,t=e._self._c;return t("span",e._b({staticClass:"material-design-icon file-icon",attrs:{"aria-hidden":!e.title||null,"aria-label":e.title,role:"img"},on:{click:function(t){return e.$emit("click",t)}}},"span",e.$attrs,!1),[t("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[t("path",{attrs:{d:"M13,9V3.5L18.5,9M6,2C4.89,2 4,2.89 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2H6Z"}},[e.title?t("title",[e._v(e._s(e.title))]):e._e()])])])},S=[];const A=(0,n.a)(N,F,S,!1,null,null,null,null).exports,x=()=>{var e,t,i;const a=(0,o.C)("files","config",null),s=(0,l.KR)(null==(e=null==a?void 0:a.show_hidden)||e),u=(0,l.KR)(null==(t=null==a?void 0:a.sort_favorites_first)||t),d=(0,l.KR)(null==(i=null==a?void 0:a.crop_image_previews)||i);return(0,l.sV)((async()=>{var e,t,i,l,a,o;if((0,c.f)())L.debug("Skip loading files settings - currently on public share");else try{const{data:n}=await h.get((0,r.Jv)("/apps/files/api/v1/configs"));s.value=null!=(t=null==(e=null==n?void 0:n.data)?void 0:e.show_hidden)&&t,u.value=null==(l=null==(i=null==n?void 0:n.data)?void 0:i.sort_favorites_first)||l,d.value=null==(o=null==(a=null==n?void 0:n.data)?void 0:a.crop_image_previews)||o}catch(e){L.error("Could not load files settings",e),(0,n.l)((0,n.t)("Could not load files settings"))}})),{showHiddenFiles:s,sortFavoritesFirst:u,cropImagePreviews:d}},M={name:"MenuUpIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var H=function(){var e=this,t=e._self._c;return t("span",e._b({staticClass:"material-design-icon menu-up-icon",attrs:{"aria-hidden":!e.title||null,"aria-label":e.title,role:"img"},on:{click:function(t){return e.$emit("click",t)}}},"span",e.$attrs,!1),[t("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[t("path",{attrs:{d:"M7,15L12,10L17,15H7Z"}},[e.title?t("title",[e._v(e._s(e.title))]):e._e()])])])},V=[];const P=(0,n.a)(M,H,V,!1,null,null,null,null).exports,B={name:"MenuDownIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var I=function(){var e=this,t=e._self._c;return t("span",e._b({staticClass:"material-design-icon menu-down-icon",attrs:{"aria-hidden":!e.title||null,"aria-label":e.title,role:"img"},on:{click:function(t){return e.$emit("click",t)}}},"span",e.$attrs,!1),[t("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[t("path",{attrs:{d:"M7,10L12,15L17,10H7Z"}},[e.title?t("title",[e._v(e._s(e.title))]):e._e()])])])},z=[];const R=(0,n.a)(B,I,z,!1,null,null,null,null).exports,D={"file-picker__file-icon":"_file-picker__file-icon_19mjt_9"},E=(0,l.pM)({__name:"LoadingTableRow",props:{showCheckbox:{type:Boolean}},setup:e=>({__sfc:!0,fileListIconStyles:D})});var W=function(){var e=this,t=e._self._c,i=e._self._setupProxy;return t("tr",{staticClass:"file-picker__row loading-row",attrs:{"aria-hidden":"true"}},[e.showCheckbox?t("td",{staticClass:"row-checkbox"},[t("span")]):e._e(),t("td",{staticClass:"row-name"},[t("div",{staticClass:"row-wrapper"},[t("span",{class:i.fileListIconStyles["file-picker__file-icon"]}),t("span")])]),e._m(0),e._m(1)])},Z=[function(){var e=this._self._c;return this._self._setupProxy,e("td",{staticClass:"row-size"},[e("span")])},function(){var e=this._self._c;return this._self._setupProxy,e("td",{staticClass:"row-modified"},[e("span")])}];const K=(0,n.a)(E,W,Z,!1,null,"15187afc",null,null).exports,T={name:"FolderIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var $=function(){var e=this,t=e._self._c;return t("span",e._b({staticClass:"material-design-icon folder-icon",attrs:{"aria-hidden":!e.title||null,"aria-label":e.title,role:"img"},on:{click:function(t){return e.$emit("click",t)}}},"span",e.$attrs,!1),[t("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[t("path",{attrs:{d:"M10,4H4C2.89,4 2,4.89 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V8C22,6.89 21.1,6 20,6H12L10,4Z"}},[e.title?t("title",[e._v(e._s(e.title))]):e._e()])])])},q=[];const O=(0,n.a)(T,$,q,!1,null,null,null,null).exports,j=(0,l.pM)({name:"FilePreview",props:{node:null,cropImagePreviews:{type:Boolean}},setup(e){const t=e,i=(0,l.KR)(D),n=(0,l.EW)((()=>function(e,t={}){var i;t={size:32,cropPreview:!1,mimeFallback:!0,...t};try{const l=(null==(i=e.attributes)?void 0:i.previewUrl)||(0,r.Jv)("/core/preview?fileId={fileid}",{fileid:e.fileid});let n;try{n=new URL(l)}catch(e){n=new URL(l,window.location.origin)}return n.searchParams.set("x","".concat(t.size)),n.searchParams.set("y","".concat(t.size)),n.searchParams.set("mimeFallback","".concat(t.mimeFallback)),n.searchParams.set("a",!0===t.cropPreview?"0":"1"),n.searchParams.set("c","".concat(e.attributes.etag)),n}catch(e){return null}}(t.node,{cropPreview:t.cropImagePreviews}))),s=(0,l.EW)((()=>t.node.type===a.pt.File)),o=(0,l.KR)(!1);return(0,l.nT)((()=>{if(o.value=!1,n.value){const e=new Image;e.src=n.value.href,e.onerror=()=>e.remove(),e.onload=()=>{o.value=!0,e.remove()}}})),{__sfc:!0,fileListIconStyles:i,props:t,previewURL:n,isFile:s,canLoadPreview:o,IconFile:A,IconFolder:O}}});var X=function(){var e=this,t=e._self._c,i=e._self._setupProxy;return t("div",{class:i.fileListIconStyles["file-picker__file-icon"],style:i.canLoadPreview?{backgroundImage:"url(".concat(i.previewURL,")")}:void 0},[i.canLoadPreview?e._e():[i.isFile?t(i.IconFile,{attrs:{size:20}}):t(i.IconFolder,{attrs:{size:20}})]],2)},J=[];const U=(0,n.a)(j,X,J,!1,null,null,null,null).exports,Q=(0,l.pM)({__name:"FileListRow",props:{allowPickDirectory:{type:Boolean},selected:{type:Boolean},showCheckbox:{type:Boolean},canPick:{type:Boolean},node:null,cropImagePreviews:{type:Boolean}},emits:["update:selected","enter-directory"],setup(e,{emit:t}){const i=e,o=(0,l.EW)((()=>{var e;return(null==(e=i.node.attributes)?void 0:e.displayName)||i.node.basename.slice(0,i.node.extension?-i.node.extension.length:void 0)})),r=(0,l.EW)((()=>i.node.extension)),c=(0,l.EW)((()=>i.node.type===a.pt.Folder)),u=(0,l.EW)((()=>i.canPick&&(i.allowPickDirectory||!c.value)));function d(){t("update:selected",!i.selected)}function p(){c.value?t("enter-directory",i.node):d()}return{__sfc:!0,props:i,emit:t,displayName:o,fileExtension:r,isDirectory:c,isPickable:u,toggleSelected:d,handleClick:p,handleKeyDown:function(e){"Enter"===e.key&&p()},formatFileSize:a.v7,NcCheckboxRadioSwitch:s.AO,NcDateTime:s.lT,t:n.t,FilePreview:U}}});var G=function(){var e=this,t=e._self._c,i=e._self._setupProxy;return t("tr",e._g({class:["file-picker__row",{"file-picker__row--selected":e.selected&&!e.showCheckbox}],attrs:{tabindex:e.showCheckbox&&!i.isDirectory?void 0:0,"aria-selected":i.isPickable?e.selected:void 0,"data-filename":e.node.basename,"data-testid":"file-list-row"}},{click:i.handleClick,...!e.showCheckbox||i.isDirectory?{keydown:i.handleKeyDown}:{}}),[e.showCheckbox?t("td",{staticClass:"row-checkbox",on:{click:function(e){return e.stopPropagation(),(()=>{}).apply(null,arguments)}}},[t(i.NcCheckboxRadioSwitch,{attrs:{"aria-label":i.t("Select the row for {nodename}",{nodename:i.displayName}),checked:e.selected,disabled:!i.isPickable,"data-testid":"row-checkbox"},on:{"update:checked":i.toggleSelected}})],1):e._e(),t("td",{staticClass:"row-name"},[t("div",{staticClass:"file-picker__name-container",attrs:{"data-testid":"row-name"}},[t(i.FilePreview,{attrs:{node:e.node,"crop-image-previews":e.cropImagePreviews}}),t("div",{staticClass:"file-picker__file-name",attrs:{title:i.displayName},domProps:{textContent:e._s(i.displayName)}}),t("div",{staticClass:"file-picker__file-extension",domProps:{textContent:e._s(i.fileExtension)}})],1)]),t("td",{staticClass:"row-size"},[e._v(" "+e._s(i.formatFileSize(e.node.size||0))+" ")]),t("td",{staticClass:"row-modified"},[t(i.NcDateTime,{attrs:{timestamp:e.node.mtime,"ignore-seconds":!0}})],1)])},Y=[];const ee=(0,n.a)(Q,G,Y,!1,null,"cb12dccb",null,null).exports,te=(0,l.pM)({__name:"FileList",props:{currentView:null,multiselect:{type:Boolean},allowPickDirectory:{type:Boolean},loading:{type:Boolean},files:null,selectedFiles:null,path:null},emits:["update:path","update:selectedFiles"],setup(e,{emit:t}){const i=e,d=(0,l.KR)(),{currentConfig:p}=(e=>{var t,i,a,s,d,p,f,v,m,C,g,w;const _=e=>"asc"===e?"ascending":"desc"===e?"descending":"none",y=(0,o.C)("files","viewConfigs",null),b=(0,l.KR)({sortBy:null!=(i=null==(t=null==y?void 0:y.files)?void 0:t.sorting_mode)?i:"basename",order:_(null!=(s=null==(a=null==y?void 0:y.files)?void 0:a.sorting_direction)?s:"asc")}),k=(0,l.KR)({sortBy:null!=(p=null==(d=null==y?void 0:y.recent)?void 0:d.sorting_mode)?p:"basename",order:_(null!=(v=null==(f=null==y?void 0:y.recent)?void 0:f.sorting_direction)?v:"asc")}),N=(0,l.KR)({sortBy:null!=(C=null==(m=null==y?void 0:y.favorites)?void 0:m.sorting_mode)?C:"basename",order:_(null!=(w=null==(g=null==y?void 0:y.favorites)?void 0:g.sorting_direction)?w:"asc")});(0,l.sV)((async()=>{var e,t,i,l,a,s,o,u,d,p,f,v,m,C,g;if((0,c.f)())L.debug("Skip loading files views - currently on public share");else try{const{data:n}=await h.get((0,r.Jv)("/apps/files/api/v1/views"));b.value={sortBy:null!=(i=null==(t=null==(e=null==n?void 0:n.data)?void 0:e.files)?void 0:t.sorting_mode)?i:"basename",order:_(null==(a=null==(l=null==n?void 0:n.data)?void 0:l.files)?void 0:a.sorting_direction)},N.value={sortBy:null!=(u=null==(o=null==(s=null==n?void 0:n.data)?void 0:s.favorites)?void 0:o.sorting_mode)?u:"basename",order:_(null==(p=null==(d=null==n?void 0:n.data)?void 0:d.favorites)?void 0:p.sorting_direction)},k.value={sortBy:null!=(m=null==(v=null==(f=null==n?void 0:n.data)?void 0:f.recent)?void 0:v.sorting_mode)?m:"basename",order:_(null==(g=null==(C=null==n?void 0:n.data)?void 0:C.recent)?void 0:g.sorting_direction)}}catch(e){L.error("Could not load files views",e),(0,n.l)((0,n.t)("Could not load files views"))}}));const F=(0,l.EW)((()=>"files"===(0,u.BA)(e||"files")?b.value:"recent"===(0,u.BA)(e)?k.value:N.value)),S=(0,l.EW)((()=>F.value.sortBy)),A=(0,l.EW)((()=>F.value.order));return{filesViewConfig:b,favoritesViewConfig:N,recentViewConfig:k,currentConfig:F,sortBy:S,order:A}})(i.currentView),f=(0,l.EW)((()=>{var e;return null!=(e=d.value)?e:p.value})),v=(0,l.EW)((()=>"basename"===f.value.sortBy?"none"===f.value.order?void 0:f.value.order:void 0)),m=(0,l.EW)((()=>"size"===f.value.sortBy?"none"===f.value.order?void 0:f.value.order:void 0)),C=(0,l.EW)((()=>"mtime"===f.value.sortBy?"none"===f.value.order?void 0:f.value.order:void 0)),{sortFavoritesFirst:g,cropImagePreviews:w}=x(),_=(0,l.EW)((()=>(0,a.ur)(i.files,{sortFoldersFirst:!0,sortFavoritesFirst:g.value,sortingOrder:"descending"===f.value.order?"desc":"asc",sortingMode:f.value.sortBy}))),y=(0,l.EW)((()=>i.files.filter((e=>i.allowPickDirectory||e.type!==a.pt.Folder)))),b=(0,l.EW)((()=>!i.loading&&i.selectedFiles.length>0&&i.selectedFiles.length>=y.value.length)),k=(0,l.KR)(4),N=(0,l.KR)();{const e=()=>(0,l.dY)((()=>{var e,t,i,l,n;const a=(null==(t=null==(e=N.value)?void 0:e.parentElement)?void 0:t.children)||[];let s=(null==(l=null==(i=N.value)?void 0:i.parentElement)?void 0:l.clientHeight)||450;for(let e=0;e<a.length;e++)(null==(n=N.value)?void 0:n.isSameNode(a[e]))||(s-=a[e].clientHeight);k.value=Math.max(1,Math.floor((s-50)/50))}));(0,l.sV)((()=>{window.addEventListener("resize",e),e()})),(0,l.hi)((()=>{window.removeEventListener("resize",e)}))}return{__sfc:!0,props:i,emit:t,customSortingConfig:d,filesAppSorting:p,sortingConfig:f,sortByName:v,sortBySize:m,sortByModified:C,toggleSorting:e=>{f.value.sortBy===e?"ascending"===f.value.order?d.value={sortBy:f.value.sortBy,order:"descending"}:d.value={sortBy:f.value.sortBy,order:"ascending"}:d.value={sortBy:e,order:"ascending"}},sortFavoritesFirst:g,cropImagePreviews:w,sortedFiles:_,selectableFiles:y,allSelected:b,onSelectAll:function(){i.selectedFiles.length<y.value.length?t("update:selectedFiles",y.value):t("update:selectedFiles",[])},onNodeSelected:function(e){i.selectedFiles.includes(e)?t("update:selectedFiles",i.selectedFiles.filter((t=>t.path!==e.path))):i.multiselect?t("update:selectedFiles",[...i.selectedFiles,e]):t("update:selectedFiles",[e])},onChangeDirectory:function(e){t("update:path",e.path)},skeletonNumber:k,fileContainer:N,NcButton:s.x1,NcCheckboxRadioSwitch:s.AO,t:n.t,IconSortAscending:P,IconSortDescending:R,LoadingTableRow:K,FileListRow:ee}}});var ie=function(){var e=this,t=e._self._c,i=e._self._setupProxy;return t("div",{ref:"fileContainer",staticClass:"file-picker__files"},[t("table",[t("thead",[t("tr",[e.multiselect?t("th",{staticClass:"row-checkbox"},[t("span",{staticClass:"hidden-visually"},[e._v(" "+e._s(i.t("Select entry"))+" ")]),e.multiselect?t(i.NcCheckboxRadioSwitch,{attrs:{"aria-label":i.t("Select all entries"),checked:i.allSelected,"data-testid":"select-all-checkbox"},on:{"update:checked":i.onSelectAll}}):e._e()],1):e._e(),t("th",{staticClass:"row-name",attrs:{"aria-sort":i.sortByName}},[t("div",{staticClass:"header-wrapper"},[t("span",{staticClass:"file-picker__header-preview"}),t(i.NcButton,{attrs:{wide:!0,type:"tertiary","data-test":"file-picker_sort-name"},on:{click:function(e){return i.toggleSorting("basename")}},scopedSlots:e._u([{key:"icon",fn:function(){return["ascending"===i.sortByName?t(i.IconSortAscending,{attrs:{size:20}}):"descending"===i.sortByName?t(i.IconSortDescending,{attrs:{size:20}}):t("span",{staticStyle:{width:"44px"}})]},proxy:!0}])},[e._v(" "+e._s(i.t("Name"))+" ")])],1)]),t("th",{staticClass:"row-size",attrs:{"aria-sort":i.sortBySize}},[t(i.NcButton,{attrs:{wide:!0,type:"tertiary"},on:{click:function(e){return i.toggleSorting("size")}},scopedSlots:e._u([{key:"icon",fn:function(){return["ascending"===i.sortBySize?t(i.IconSortAscending,{attrs:{size:20}}):"descending"===i.sortBySize?t(i.IconSortDescending,{attrs:{size:20}}):t("span",{staticStyle:{width:"44px"}})]},proxy:!0}])},[e._v(" "+e._s(i.t("Size"))+" ")])],1),t("th",{staticClass:"row-modified",attrs:{"aria-sort":i.sortByModified}},[t(i.NcButton,{attrs:{wide:!0,type:"tertiary"},on:{click:function(e){return i.toggleSorting("mtime")}},scopedSlots:e._u([{key:"icon",fn:function(){return["ascending"===i.sortByModified?t(i.IconSortAscending,{attrs:{size:20}}):"descending"===i.sortByModified?t(i.IconSortDescending,{attrs:{size:20}}):t("span",{staticStyle:{width:"44px"}})]},proxy:!0}])},[e._v(" "+e._s(i.t("Modified"))+" ")])],1)])]),t("tbody",[e.loading?e._l(i.skeletonNumber,(function(l){return t(i.LoadingTableRow,{key:l,attrs:{"show-checkbox":e.multiselect}})})):e._l(i.sortedFiles,(function(l){return t(i.FileListRow,{key:l.fileid||l.path,attrs:{"allow-pick-directory":e.allowPickDirectory,"show-checkbox":e.multiselect,"can-pick":e.multiselect||0===e.selectedFiles.length||e.selectedFiles.includes(l),selected:e.selectedFiles.includes(l),node:l,"crop-image-previews":i.cropImagePreviews},on:{"update:selected":function(e){return i.onNodeSelected(l)},"enter-directory":i.onChangeDirectory}})}))],2)])])},le=[];const ne=(0,n.a)(te,ie,le,!1,null,"006fdbd0",null,null).exports,ae={name:"HomeIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var se=function(){var e=this,t=e._self._c;return t("span",e._b({staticClass:"material-design-icon home-icon",attrs:{"aria-hidden":!e.title||null,"aria-label":e.title,role:"img"},on:{click:function(t){return e.$emit("click",t)}}},"span",e.$attrs,!1),[t("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[t("path",{attrs:{d:"M10,20V14H14V20H19V12H22L12,3L2,12H5V20H10Z"}},[e.title?t("title",[e._v(e._s(e.title))]):e._e()])])])},oe=[];const re=(0,n.a)(ae,se,oe,!1,null,null,null,null).exports,ce={name:"PlusIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var ue=function(){var e=this,t=e._self._c;return t("span",e._b({staticClass:"material-design-icon plus-icon",attrs:{"aria-hidden":!e.title||null,"aria-label":e.title,role:"img"},on:{click:function(t){return e.$emit("click",t)}}},"span",e.$attrs,!1),[t("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[t("path",{attrs:{d:"M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z"}},[e.title?t("title",[e._v(e._s(e.title))]):e._e()])])])},de=[];const pe=(0,n.a)(ce,ue,de,!1,null,null,null,null).exports,fe=(0,l.pM)({__name:"FilePickerBreadcrumbs",props:{path:null,showMenu:{type:Boolean}},emits:["update:path","create-node"],setup(e,{emit:t}){const i=e,a=(0,l.KR)(!1),o=(0,l.KR)(""),r=(0,l.KR)();function c(){var e,t,i,l;const a=o.value.trim(),s=null==(t=null==(e=r.value)?void 0:e.$el)?void 0:t.querySelector("input");let c="";return 0===a.length?c=(0,n.t)("Folder name cannot be empty."):a.includes("/")?c=(0,n.t)('"/" is not allowed inside a folder name.'):["..","."].includes(a)?c=(0,n.t)('"{name}" is an invalid folder name.',{name:a}):(null==(i=window.OC.config)?void 0:i.blacklist_files_regex)&&a.match(null==(l=window.OC.config)?void 0:l.blacklist_files_regex)&&(c=(0,n.t)('"{name}" is not an allowed folder name',{name:a})),s&&s.setCustomValidity(c),""===c}const u=(0,l.EW)((()=>i.path.split("/").filter((e=>""!==e)).map(((e,t,i)=>({name:e,path:"/"+i.slice(0,t+1).join("/")})))));return{__sfc:!0,props:i,emit:t,actionsOpen:a,newNodeName:o,nameInput:r,validateInput:c,onSubmit:function(){const e=o.value.trim();c()&&(a.value=!1,t("create-node",e),o.value="")},pathElements:u,IconFolder:O,IconHome:re,IconPlus:pe,NcActions:s.B6,NcActionInput:s.Az,NcBreadcrumbs:s.Qz,NcBreadcrumb:s.R1,t:n.t}}});var ve=function(){var e=this,t=e._self._c,i=e._self._setupProxy;return t(i.NcBreadcrumbs,{staticClass:"file-picker__breadcrumbs",scopedSlots:e._u([{key:"default",fn:function(){return[t(i.NcBreadcrumb,{attrs:{name:i.t("All files"),title:i.t("Home")},on:{click:function(e){return i.emit("update:path","/")}},scopedSlots:e._u([{key:"icon",fn:function(){return[t(i.IconHome,{attrs:{size:20}})]},proxy:!0}])}),e._l(i.pathElements,(function(e){return t(i.NcBreadcrumb,{key:e.path,attrs:{name:e.name,title:e.path},on:{click:function(t){return i.emit("update:path",e.path)}}})}))]},proxy:!0},e.showMenu?{key:"actions",fn:function(){return[t(i.NcActions,{attrs:{"aria-label":i.t("Create directory"),"force-menu":!0,"force-name":!0,"menu-name":i.t("New"),open:i.actionsOpen,type:"secondary"},on:{"update:open":function(e){i.actionsOpen=e},close:function(e){i.newNodeName=""}},scopedSlots:e._u([{key:"icon",fn:function(){return[t(i.IconPlus,{attrs:{size:20}})]},proxy:!0}],null,!1,2971667417)},[t(i.NcActionInput,{ref:"nameInput",attrs:{value:i.newNodeName,label:i.t("New folder"),placeholder:i.t("New folder name")},on:{"update:value":function(e){i.newNodeName=e},submit:i.onSubmit,input:i.validateInput},scopedSlots:e._u([{key:"icon",fn:function(){return[t(i.IconFolder,{attrs:{size:20}})]},proxy:!0}],null,!1,1614167509)})],1)]},proxy:!0}:null],null,!0)})},me=[];const Ce=(0,n.a)(fe,ve,me,!1,null,"b357227a",null,null).exports,ge={name:"CloseIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var he=function(){var e=this,t=e._self._c;return t("span",e._b({staticClass:"material-design-icon close-icon",attrs:{"aria-hidden":!e.title||null,"aria-label":e.title,role:"img"},on:{click:function(t){return e.$emit("click",t)}}},"span",e.$attrs,!1),[t("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[t("path",{attrs:{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"}},[e.title?t("title",[e._v(e._s(e.title))]):e._e()])])])},we=[];const _e=(0,n.a)(ge,he,we,!1,null,null,null,null).exports,ye={name:"MagnifyIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var be=function(){var e=this,t=e._self._c;return t("span",e._b({staticClass:"material-design-icon magnify-icon",attrs:{"aria-hidden":!e.title||null,"aria-label":e.title,role:"img"},on:{click:function(t){return e.$emit("click",t)}}},"span",e.$attrs,!1),[t("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[t("path",{attrs:{d:"M9.5,3A6.5,6.5 0 0,1 16,9.5C16,11.11 15.41,12.59 14.44,13.73L14.71,14H15.5L20.5,19L19,20.5L14,15.5V14.71L13.73,14.44C12.59,15.41 11.11,16 9.5,16A6.5,6.5 0 0,1 3,9.5A6.5,6.5 0 0,1 9.5,3M9.5,5C7,5 5,7 5,9.5C5,12 7,14 9.5,14C12,14 14,12 14,9.5C14,7 12,5 9.5,5Z"}},[e.title?t("title",[e._v(e._s(e.title))]):e._e()])])])},ke=[];const Le=(0,n.a)(ye,be,ke,!1,null,null,null,null).exports,Ne=(0,l.pM)({__name:"FilePickerNavigation",props:{currentView:null,filterString:null,isCollapsed:{type:Boolean},disabledNavigation:{type:Boolean}},emits:["update:currentView","update:filterString"],setup(e,{emit:t}){const i=e,{availableViews:a}=(e=>{const t=[{id:"files",label:(0,n.t)("All files"),icon:_.fEr},{id:"recent",label:(0,n.t)("Recent"),icon:_.NZC},{id:"favorites",label:(0,n.t)("Favorites"),icon:_.ZL5}],i=e.value?t.filter((({id:e})=>"files"===e)):t;return{allViews:t,availableViews:i}})((0,l.KR)(null===(0,p.HW)())),o=(0,l.EW)((()=>{var e;return null!=(e=a.filter((e=>e.id===i.currentView))[0])?e:a[0]}));return{__sfc:!0,props:i,emit:t,availableViews:a,currentViewObject:o,updateFilterValue:e=>t("update:filterString",e),IconClose:_e,IconMagnify:Le,NcButton:s.x1,NcIconSvgWrapper:s.K1,NcSelect:s.EQ,NcTextField:s.v,Fragment:w.F,t:n.t}}});var Fe=function(){var e=this,t=e._self._c,i=e._self._setupProxy;return t(i.Fragment,[t(i.NcTextField,{staticClass:"file-picker__filter-input",attrs:{value:e.filterString,label:i.t("Filter file list"),"show-trailing-button":!!e.filterString},on:{"update:value":i.updateFilterValue,"trailing-button-click":function(e){return i.updateFilterValue("")}},scopedSlots:e._u([{key:"trailing-button-icon",fn:function(){return[t(i.IconClose,{attrs:{size:16}})]},proxy:!0}])},[t(i.IconMagnify,{attrs:{size:16}})],1),i.availableViews.length>1&&!e.disabledNavigation?[e.isCollapsed?t(i.NcSelect,{attrs:{"aria-label":i.t("Current view selector"),clearable:!1,searchable:!1,options:i.availableViews,value:i.currentViewObject},on:{input:e=>i.emit("update:currentView",e.id)}}):t("ul",{staticClass:"file-picker__side"},e._l(i.availableViews,(function(l){return t("li",{key:l.id},[t(i.NcButton,{attrs:{type:e.currentView===l.id?"primary":"tertiary",wide:!0},on:{click:function(t){return e.$emit("update:currentView",l.id)}},scopedSlots:e._u([{key:"icon",fn:function(){return[t(i.NcIconSvgWrapper,{attrs:{path:l.icon,size:20}})]},proxy:!0}],null,!0)},[e._v(" "+e._s(l.label)+" ")])],1)})),0)]:e._e()],2)},Se=[];const Ae=(0,n.a)(Ne,Fe,Se,!1,null,"b42054b8",null,null).exports,xe=(0,l.pM)({name:"FilePicker",props:{buttons:null,name:null,allowPickDirectory:{type:Boolean,default:!1},disabledNavigation:{type:Boolean,default:!1},container:{default:"body"},filterFn:{default:void 0},mimetypeFilter:{default:()=>[]},multiselect:{type:Boolean,default:!0},path:{default:void 0}},emits:["close"],setup(e,{emit:t}){const i=e,o=(0,l.KR)(!0),r=(0,l.EW)((()=>{const e=0===f.value.length&&i.allowPickDirectory&&_.value?[_.value]:f.value;return("function"==typeof i.buttons?i.buttons(e,C.value,d.value):i.buttons).map((t=>({...t,disabled:t.disabled||N.value,callback:()=>{c=!0,u(t.callback,e)}})))}));let c=!1;const u=async(e,i)=>{e(i),t("close",i),c=!1},d=(0,l.KR)("files"),p=(0,l.EW)((()=>"favorites"===d.value?(0,n.t)("Favorites"):"recent"===d.value?(0,n.t)("Recent"):"")),f=(0,l.IJ)([]),v=(0,l.KR)((null==window?void 0:window.sessionStorage.getItem("NC.FilePicker.LastPath"))||"/"),m=(0,l.KR)("");(0,l.wB)([m],(()=>{void 0===i.path&&m.value&&window.sessionStorage.setItem("NC.FilePicker.LastPath",m.value),f.value=[]}));const C=(0,l.EW)({get:()=>"files"===d.value?m.value||i.path||v.value:"/",set:e=>{m.value=e}}),g=(0,l.KR)(""),{isSupportedMimeType:h}=function(e){const t=(0,l.EW)((()=>e.value.map((e=>e.split("/")))));return{isSupportedMimeType:e=>{const i=e.split("/");return t.value.some((([e,t])=>!(i[0]!==e&&"*"!==e||i[1]!==t&&"*"!==t)))}}}((0,l.lW)(i,"mimetypeFilter")),{files:w,folder:_,isLoading:N,loadFiles:F,createDirectory:S}=function(e,t){const i=(0,a.H4)(),n=(0,l.IJ)([]),s=(0,l.IJ)(null),o=(0,l.KR)(!0),r=(0,l.KR)(null);async function c(){r.value&&r.value.cancel(),o.value=!0,"favorites"===e.value?r.value=(0,a.Q$)(i,t.value):"recent"===e.value?r.value=function(e){const t=new AbortController,i=Math.round(Date.now()/1e3)-1209600;return new b.CancelablePromise((async(l,n,s)=>{s((()=>t.abort()));try{const{data:n}=await e.search("/",{signal:t.signal,details:!0,data:(0,a.R3)(i)});l(n.results.map((e=>(0,a.Al)(e))))}catch(e){n(e)}}))}(i):r.value=function(e,t){const i=new AbortController;return new b.CancelablePromise((async(l,n,s)=>{s((()=>i.abort()));try{const n=(await e.getDirectoryContents((0,k.join)(a.lJ,t),{signal:i.signal,details:!0,includeSelf:!0,data:(0,a.VL)()})).data.map((e=>(0,a.Al)(e)));l({contents:n.filter((({path:e})=>e!==t)),folder:n.find((({path:e})=>e===t))})}catch(e){n(e)}}))}(i,t.value);const l=await r.value;"folder"in l?(s.value=l.folder,n.value=l.contents):(s.value=null,n.value=l),r.value=null,o.value=!1}return(0,l.wB)([e,t],(()=>c())),(0,l.sV)((()=>c())),{isLoading:o,files:n,folder:s,loadFiles:c,createDirectory:async function(e){const l=(0,k.join)(t.value,e);await i.createDirectory((0,k.join)(a.lJ,l));const s=await async function(e,t){const{data:i}=await e.stat((0,k.join)(a.lJ,t),{details:!0,data:(0,a.VL)()});return(0,a.Al)(i)}(i,l);return n.value=[...n.value,s],s}}}(d,C);(0,l.sV)((()=>F()));const{showHiddenFiles:M}=x(),H=(0,l.EW)((()=>{let e=w.value;return M.value||(e=e.filter((e=>!e.basename.startsWith(".")))),i.mimetypeFilter.length>0&&(e=e.filter((e=>"folder"===e.type||e.mime&&h(e.mime)))),g.value&&(e=e.filter((e=>e.basename.toLowerCase().includes(g.value.toLowerCase())))),i.filterFn&&(e=e.filter((e=>i.filterFn(e)))),e})),V=(0,l.EW)((()=>"files"===d.value?(0,n.t)("Upload some content or sync with your devices!"):"recent"===d.value?(0,n.t)("Files and folders you recently modified will show up here."):(0,n.t)("Files and folders you mark as favorite will show up here.")));return{__sfc:!0,props:i,emit:t,isOpen:o,dialogButtons:r,isHandlingCallback:c,handleButtonClick:u,currentView:d,viewHeadline:p,selectedFiles:f,savedPath:v,navigatedPath:m,currentPath:C,filterString:g,isSupportedMimeType:h,files:w,currentFolder:_,isLoading:N,loadFiles:F,createDirectory:S,showHiddenFiles:M,filteredFiles:H,noFilesDescription:V,onCreateFolder:async e=>{try{const t=await S(e);m.value=t.path,(0,y.Ic)("files:node:created",w.value.filter((t=>t.basename===e))[0])}catch(t){L.warn("Could not create new folder",{name:e,error:t}),(0,n.l)((0,n.t)("Could not create the new folder"))}},handleClose:e=>{e||c||t("close")},IconFile:A,FileList:ne,FilePickerBreadcrumbs:Ce,FilePickerNavigation:Ae,NcDialog:s.i$,NcEmptyContent:s.yI,t:n.t}}});var Me=function(){var e=this,t=e._self._c,i=e._self._setupProxy;return t(i.NcDialog,{attrs:{container:e.container,buttons:i.dialogButtons,name:e.name,size:"large","content-classes":"file-picker__content","dialog-classes":"file-picker","navigation-classes":"file-picker__navigation",open:i.isOpen},on:{"update:open":[function(e){i.isOpen=e},i.handleClose]},scopedSlots:e._u([{key:"navigation",fn:function({isCollapsed:l}){return[t(i.FilePickerNavigation,{attrs:{"is-collapsed":l,"current-view":i.currentView,"filter-string":i.filterString,"disabled-navigation":e.disabledNavigation},on:{"update:currentView":function(e){i.currentView=e},"update:current-view":function(e){i.currentView=e},"update:filterString":function(e){i.filterString=e},"update:filter-string":function(e){i.filterString=e}}})]}}])},[t("div",{staticClass:"file-picker__main"},["files"===i.currentView?t(i.FilePickerBreadcrumbs,{attrs:{path:i.currentPath,"show-menu":e.allowPickDirectory},on:{"update:path":function(e){i.currentPath=e},"create-node":i.onCreateFolder}}):t("div",{staticClass:"file-picker__view"},[t("h3",[e._v(e._s(i.viewHeadline))])]),i.isLoading||i.filteredFiles.length>0?t(i.FileList,{attrs:{"allow-pick-directory":e.allowPickDirectory,"current-view":i.currentView,files:i.filteredFiles,multiselect:e.multiselect,loading:i.isLoading,path:i.currentPath,"selected-files":i.selectedFiles,name:i.viewHeadline},on:{"update:path":[function(e){i.currentPath=e},function(e){i.currentView="files"}],"update:selectedFiles":function(e){i.selectedFiles=e},"update:selected-files":function(e){i.selectedFiles=e}}}):i.filterString?t(i.NcEmptyContent,{attrs:{name:i.t("No matching files"),description:i.t("No files matching your filter were found.")},scopedSlots:e._u([{key:"icon",fn:function(){return[t(i.IconFile)]},proxy:!0}])}):t(i.NcEmptyContent,{attrs:{name:i.t("No files in here"),description:i.noFilesDescription},scopedSlots:e._u([{key:"icon",fn:function(){return[t(i.IconFile)]},proxy:!0}])})],1)])},He=[];const Ve=(0,n.a)(xe,Me,He,!1,null,"20b719ba",null,null).exports},76333:(e,t,i)=>{i.d(t,{AO:()=>z.N,Az:()=>o.N,B6:()=>d.N,C7:()=>_e.N,EQ:()=>ve.N,K1:()=>ee.N,Qz:()=>B.N,R1:()=>P.N,gb:()=>ye.A,i$:()=>O.N,lT:()=>T.N,mQ:()=>se.A,rE:()=>we.N,v:()=>me.N,x1:()=>I.A,yI:()=>U.A}),i(28054);var l=i(89257),n=i(59602),a=i(30567),s=i(4703),o=i(3771),r=i(73267),c=i(15683),u=i(93806),d=i(54657),p=i(80114),f=i(32831),v=i(98060),m=i(36412),C=i(47611),g=i(10363),h=i(85794),w=i(71265),_=i(20377),y=i(10603),b=i(80329),k=i(62720),L=i(4747),N=i(24551),F=i(72076),S=i(66687),A=i(91774),x=i(85948),M=i(89802),H=i(46503),V=i(79935),P=i(29723),B=i(93355),I=i(54332),z=i(99006),R=i(34894),D=i(51218),E=i(25971),W=i(28331),Z=i(33101),K=i(11134),T=i(92433),$=i(54028),q=i(31126),O=i(7271),j=i(17635),X=i(68296),J=i(6245),U=i(34196),Q=i(78298),G=i(49708),Y=i(94659),ee=i(15676),te=i(66394),ie=i(201),le=i(2509),ne=i(84237),ae=i(71650),se=i(80910),oe=i(54306),re=i(28640),ce=i(97595),ue=i(11868),de=i(23596),pe=i(78914),fe=i(59079),ve=(i(40708),i(41364),i(26287),i(21777),i(30600)),me=i(71906),Ce=(i(61338),i(12679)),ge=i(16160),he=i(48274),we=i(97896),_e=i(8063),ye=i(42740),be=i(65193),ke=i(47741),Le=i(3507),Ne=i(23610),Fe=(i(23020),i(53429),i(9050),i(69257),i(42892)),Se=i(65842),Ae=(i(18300),i(75105),i(92471),i(16406),i(2508));l.A,n.N,a.A,s.A,o.N,r.A,c.A,u.A,p.A,f.A,v.A,d.N,m.N,C.A,g.A,h.N,w.N,_.A,y.N,b.A,k.A,L.N,N.N,F.N,S.A,A.N,x.A,M.N,H.A,pe.N,V.N,P.N,B.N,I.A,z.N,R.N,D.N,E.N,W.A,Z.N,K.N,T.N,$.A,q.A,O.N,j.N,X.A,J.N,U.A,Q.A,G.N,Y.N,ee.N,te.A,ie.N,le.N,ne.A,de.N,ae.A,se.A,oe.N,re.N,ce.N,ue.N,pe.a,fe.N,Ce.N,ve.N,ge.N,he.N,we.N,_e.N,ye.A,me.N,be.N,ke.N,Le.N,Ne.A,Symbol.toStringTag,Fe.u,Se.u,Ae.yw,Symbol.toStringTag}}]);
- //# sourceMappingURL=4065-4065.js.map?v=046658418d1a5670e146
|