%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /www/varak.net/nextcloud.varak.net/apps_old/apps/text/js/
Upload File :
Create Path :
Current File : //www/varak.net/nextcloud.varak.net/apps_old/apps/text/js/FilePicker-CDU2njOJ-DJRGAqlw.chunk.mjs

/*! third party licenses: js/vendor.LICENSE.txt */
import{V as H,d as D,r as C,c as y,x as W,w as me,t as Le,o as M,p as xe,n as Pe,h as Ie}from"./vue.runtime.esm-fZsuJKoo.chunk.mjs";import{b as L,t as F,i as j,s as Z,p as ae}from"./public-BnJZpQLY.chunk.mjs";import{d as ze,c as se,e as le,g as De,s as Ve,f as U,h as $e,i as Ae,C as oe,j as Oe,k as Me}from"./index-CZpehzPA.chunk.mjs";import{a as He,B as Ee,m as Re,h as Te,D as We,l as je,c as Ze,v as Ue,E as qe}from"./_plugin-vue2_normalizer-CBD_Jxxq.chunk.mjs";import{n as q,a as K,C as Ke,N as G,G as Ge,k as Je}from"./NcNoteCard-CImn6F9p-7OG_jBLc.chunk.mjs";import{s as Qe,u as Xe,e as Ye,g as et}from"./modulepreload-polyfill-DMTabKmO.chunk.mjs";import{a as tt,c as ge,_ as J,U as nt}from"./index-Br6XaFoY.chunk.mjs";import{N as ye}from"./NcCheckboxRadioSwitch-CvMEEI9x-HpgEZPax.chunk.mjs";import{l as _e}from"./index-Ubm2itxG.chunk.mjs";import{a as ce}from"./index-BpvrP2W2.chunk.mjs";import"./emoji-picker-SoWZqoso.chunk.mjs";import"./index-DkzhscpN.chunk.mjs";const it={name:"NcBreadcrumb",components:{NcActions:K,ChevronRight:Ke,NcButton:G},inheritAttrs:!1,props:{name:{type:String,required:!0},title:{type:String,default:null},to:{type:[String,Object],default:void 0},exact:{type:Boolean,default:!1},href:{type:String,default:void 0},icon:{type:String,default:""},forceIconText:{type:Boolean,default:!1},disableDrop:{type:Boolean,default:!1},forceMenu:{type:Boolean,default:!1},open:{type:Boolean,default:!1}},emits:["update:open","dropped"],data(){return{hovering:!1,crumbId:"crumb-id-".concat(Ge())}},computed:{linkAttributes(){return this.to?{to:this.to,exact:this.exact,...this.$attrs}:this.href?{href:this.href,...this.$attrs}:this.$attrs}},methods:{onOpenChange(e){this.$emit("update:open",e)},dropped(e){return this.disableDrop||(this.$emit("dropped",e,this.to||this.href),this.$parent.$emit("dropped",e,this.to||this.href),this.hovering=!1),!1},dragEnter(e){this.disableDrop||(this.hovering=!0)},dragLeave(e){this.disableDrop||e.target.contains(e.relatedTarget)||this.$refs.crumb.contains(e.relatedTarget)||(this.hovering=!1)}}};var rt=function(){var e=this,n=e._self._c;return n("li",e._b({ref:"crumb",staticClass:"vue-crumb",class:{"vue-crumb--hovered":e.hovering},attrs:{draggable:"false"},on:{dragstart:function(t){return t.preventDefault(),(()=>{}).apply(null,arguments)},drop:function(t){return t.preventDefault(),e.dropped.apply(null,arguments)},dragover:function(t){return t.preventDefault(),(()=>{}).apply(null,arguments)},dragenter:e.dragEnter,dragleave:e.dragLeave}},"li",e._d({},[e.crumbId,""])),[(e.name||e.icon||e.$slots.icon)&&!e.$slots.default?n("NcButton",e._g(e._b({attrs:{title:e.title,"aria-label":e.icon?e.name:void 0,type:"tertiary"},scopedSlots:e._u([e.$slots.icon||e.icon?{key:"icon",fn:function(){return[e._t("icon",function(){return[n("span",{staticClass:"icon",class:e.icon})]})]},proxy:!0}:null,!(e.$slots.icon||e.icon)||e.forceIconText?{key:"default",fn:function(){return[e._v(" "+e._s(e.name)+" ")]},proxy:!0}:null],null,!0)},"NcButton",e.linkAttributes,!1),e.$listeners)):e._e(),e.$slots.default?n("NcActions",{ref:"actions",attrs:{type:"tertiary","force-menu":e.forceMenu,open:e.open,"menu-name":e.name,title:e.title,"force-name":!0,container:".vue-crumb[".concat(e.crumbId,"]")},on:{"update:open":e.onOpenChange},scopedSlots:e._u([{key:"icon",fn:function(){return[e._t("menu-icon")]},proxy:!0}],null,!0)},[e._t("default")],2):e._e(),n("ChevronRight",{staticClass:"vue-crumb__separator",attrs:{size:20}})],1)},at=[],st=q(it,rt,at,!1,null,"cfe13af3");const be=st.exports;var R=Symbol(),A=Symbol(),ue=Symbol(),de=Symbol(),Q=function(e){return"frag"in e},lt={get:function(){return this[A]||this.parentElement},configurable:!0},O=function(e,n){A in e||(e[A]=n,Object.defineProperty(e,"parentNode",lt))},ot={get:function(){var e=this.parentNode.childNodes,n=e.indexOf(this);return n>-1&&e[n+1]||null}},E=function(e){ue in e||(e[ue]=!0,Object.defineProperty(e,"nextSibling",ot))},ct=function(e,n){for(;e.parentNode!==n;){var t=e,i=t.parentNode;i&&(e=i)}return e},T,we=function(e){if(!T){var n=Object.getOwnPropertyDescriptor(Node.prototype,"childNodes");T=n.get}var t=T.apply(e),i=Array.from(t).map(function(a){return ct(a,e)});return i.filter(function(a,r){return a!==i[r-1]})},ut={get:function(){return this.frag||we(this)}},dt={get:function(){return this.childNodes[0]||null}};function pt(){return this.childNodes.length>0}var pe=function(e){de in e||(e[de]=!0,Object.defineProperties(e,{childNodes:ut,firstChild:dt}),e.hasChildNodes=pt)};function ft(){var e;(e=this.frag[0]).before.apply(e,arguments)}function ht(){var e=this.frag,n=e.splice(0,e.length);n.forEach(function(t){t.remove()})}var vt=function e(n){var t;return(t=Array.prototype).concat.apply(t,n.map(function(i){return Q(i)?e(i.frag):i}))},mt=function(e,n){var t=e[R];n.before(t),O(t,e),e.frag.unshift(t)};function fe(e){if(Q(this)){var n=this.frag.indexOf(e);if(n>-1){var t=this.frag.splice(n,1),i=t[0];this.frag.length===0&&mt(this,i),e.remove()}}else{var a=we(this),r=a.indexOf(e);r>-1&&e.remove()}return e}function he(e,n){var t=this,i=e.frag||[e];if(Q(this)){if(e[A]===this&&e.parentElement)return e;var a=this.frag;if(n){var r=a.indexOf(n);r>-1&&(a.splice.apply(a,[r,0].concat(i)),n.before.apply(n,i))}else{var s=a[a.length-1];a.push.apply(a,i),s.after.apply(s,i)}Ce(this)}else n?this.childNodes.includes(n)&&n.before.apply(n,i):this.append.apply(this,i);i.forEach(function(v){O(v,t)});var l=i[i.length-1];return E(l),e}function gt(e){if(e[A]===this&&e.parentElement)return e;var n=this.frag,t=n[n.length-1];return t.after(e),O(e,this),Ce(this),n.push(e),e}var Ce=function(e){var n=e[R];e.frag[0]===n&&(e.frag.shift(),n.remove())},yt={set:function(e){var n=this;if(this.frag[0]!==this[R]&&this.frag.slice().forEach(function(i){return n.removeChild(i)}),e){var t=document.createElement("div");t.innerHTML=e,Array.from(t.childNodes).forEach(function(i){n.appendChild(i)})}},get:function(){return""}},_t={inserted:function(e){var n=e.parentNode,t=e.nextSibling,i=e.previousSibling,a=Array.from(e.childNodes),r=document.createComment("");a.length===0&&a.push(r),e.frag=a,e[R]=r;var s=document.createDocumentFragment();s.append.apply(s,vt(a)),e.replaceWith(s),a.forEach(function(l){O(l,e),E(l)}),pe(e),Object.assign(e,{remove:ht,appendChild:gt,insertBefore:he,removeChild:fe,before:ft}),Object.defineProperty(e,"innerHTML",yt),n&&(Object.assign(n,{removeChild:fe,insertBefore:he}),O(e,n),pe(n)),t&&E(e),i&&E(i)},unbind:function(e){e.remove()}},ke={name:"Fragment",directives:{frag:_t},render:function(e){return e("div",{directives:[{name:"frag"}]},this.$slots.default)}};const ve=(e,n,t)=>{if(e!==void 0)for(let i=e.length-1;i>=0;i--){const a=e[i],r=!a.componentOptions&&a.tag&&n.indexOf(a.tag)===-1,s=!!a.componentOptions&&typeof a.componentOptions.tag=="string",l=s&&n.indexOf(a.componentOptions.tag)===-1;(r||!s||l)&&((r||l)&&H.util.warn("".concat(r?a.tag:a.componentOptions.tag," is not allowed inside the ").concat(t.$options.name," component"),t),e.splice(i,1))}},bt={name:"FolderIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var wt=function(){var e=this,n=e._self._c;return n("span",e._b({staticClass:"material-design-icon folder-icon",attrs:{"aria-hidden":e.title?null:!0,"aria-label":e.title,role:"img"},on:{click:function(t){return e.$emit("click",t)}}},"span",e.$attrs,!1),[n("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[n("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?n("title",[e._v(e._s(e.title))]):e._e()])])])},Ct=[],kt=q(bt,wt,Ct,!1,null,null);const St=kt.exports,B="vue-crumb",Ft={name:"NcBreadcrumbs",components:{NcActions:K,NcActionButton:He,NcActionRouter:Ee,NcActionLink:Re,NcBreadcrumb:be,IconFolder:St},props:{rootIcon:{type:String,default:"icon-home"},ariaLabel:{type:String,default:null}},emits:["dropped"],data(){return{hiddenIndices:[],menuBreadcrumbProps:{name:"",forceMenu:!0,disableDrop:!0,open:!1},breadcrumbsRefs:{}}},beforeMount(){ve(this.$slots.default,["NcBreadcrumb"],this)},beforeUpdate(){ve(this.$slots.default,["NcBreadcrumb"],this)},created(){window.addEventListener("resize",tt(()=>{this.handleWindowResize()},100)),Qe("navigation-toggled",this.delayedResize)},mounted(){this.handleWindowResize()},updated(){this.delayedResize(),this.$nextTick(()=>{this.hideCrumbs()})},beforeDestroy(){window.removeEventListener("resize",this.handleWindowResize),Xe("navigation-toggled",this.delayedResize)},methods:{closeActions(e){this.$refs.actionsBreadcrumb.$el.contains(e.relatedTarget)||(this.menuBreadcrumbProps.open=!1)},async delayedResize(){await this.$nextTick(),this.handleWindowResize()},handleWindowResize(){var e;if(!this.$refs.container)return;const n=Object.values(this.breadcrumbsRefs),t=n.length,i=[],a=this.$refs.container.offsetWidth;let r=this.getTotalWidth(n);this.$refs.breadcrumb__actions&&(r+=this.$refs.breadcrumb__actions.offsetWidth);let s=r-a;s+=s>0?64:0;let l=0;const v=Math.floor(t/2);for(;s>0&&l<t-2;){const c=v+(l%2?l+1:l)/2*Math.pow(-1,l+t%2);s-=this.getWidth((e=n[c])==null?void 0:e.elm,c===n.length-1),i.push(c),l++}this.arraysEqual(this.hiddenIndices,i.sort((c,p)=>c-p))||(this.hiddenIndices=i)},arraysEqual(e,n){if(e.length!==n.length)return!1;if(e===n)return!0;if(e===null||n===null)return!1;for(let t=0;t<e.length;++t)if(e[t]!==n[t])return!1;return!0},getTotalWidth(e){return e.reduce((n,t,i)=>n+this.getWidth(t==null?void 0:t.elm,i===e.length-1),0)},getWidth(e,n){if(!(e!=null&&e.classList))return 0;const t=e.classList.contains("".concat(B,"--hidden"));e.style.minWidth="auto",n&&(e.style.maxWidth="210px"),e.classList.remove("".concat(B,"--hidden"));const i=e.offsetWidth;return t&&e.classList.add("".concat(B,"--hidden")),e.style.minWidth="",e.style.maxWidth="",i},preventDefault(e){return e.preventDefault&&e.preventDefault(),!1},dragStart(e){return this.preventDefault(e)},dropped(e,n,t){return t||this.$emit("dropped",e,n),this.menuBreadcrumbProps.open=!1,document.querySelectorAll(".".concat(B)).forEach(i=>{i.classList.remove("".concat(B,"--hovered"))}),this.preventDefault(e)},dragOver(e){return this.preventDefault(e)},dragEnter(e,n){if(!n&&e.target.closest){const t=e.target.closest(".".concat(B));t.classList&&t.classList.contains(B)&&(document.querySelectorAll(".".concat(B)).forEach(i=>{i.classList.remove("".concat(B,"--hovered"))}),t.classList.add("".concat(B,"--hovered")))}},dragLeave(e,n){if(!n&&!e.target.contains(e.relatedTarget)&&e.target.closest){const t=e.target.closest(".".concat(B));if(t.contains(e.relatedTarget))return;t.classList&&t.classList.contains(B)&&t.classList.remove("".concat(B,"--hovered"))}},hideCrumbs(){Object.values(this.breadcrumbsRefs).forEach((e,n)=>{var t;(t=e==null?void 0:e.elm)!=null&&t.classList&&(this.hiddenIndices.includes(n)?e.elm.classList.add("".concat(B,"--hidden")):e.elm.classList.remove("".concat(B,"--hidden")))})},isBreadcrumb(e){var n;return(((n=e==null?void 0:e.componentOptions)==null?void 0:n.tag)||(e==null?void 0:e.tag)||"").includes("NcBreadcrumb")}},render(e){const n=[];if(this.$slots.default.forEach(r=>{var s,l;if(this.isBreadcrumb(r)){n.push(r);return}(r==null?void 0:r.type)===ke&&((l=(s=r==null?void 0:r.children)==null?void 0:s.forEach)==null||l.call(s,v=>{this.isBreadcrumb(v)&&n.push(v)}))}),n.length===0)return;H.set(n[0].componentOptions.propsData,"icon",this.rootIcon),H.set(n[0].componentOptions.propsData,"ref","breadcrumbs");const t={};n.forEach((r,s)=>{H.set(r,"ref","crumb-".concat(s)),t[s]=r});let i=[];if(!this.hiddenIndices.length)i=n;else{i=n.slice(0,Math.round(n.length/2)),i.push(e("NcBreadcrumb",{class:"dropdown",props:this.menuBreadcrumbProps,attrs:{"aria-hidden":!0},ref:"actionsBreadcrumb",key:"actions-breadcrumb-1",nativeOn:{dragstart:this.dragStart,dragenter:()=>{this.menuBreadcrumbProps.open=!0},dragleave:this.closeActions},on:{"update:open":s=>{this.menuBreadcrumbProps.open=s}}},this.hiddenIndices.filter(s=>s<=n.length-1).map(s=>{const l=n[s],v=l.componentOptions.propsData.to,c=l.componentOptions.propsData.href,p=l.componentOptions.propsData.disableDrop,m=l.componentOptions.propsData.title,_=l.componentOptions.propsData.name;let o="NcActionButton",d="";c&&(o="NcActionLink",d=c),v&&(o="NcActionRouter",d=v);const w=e("IconFolder",{props:{size:20},slot:"icon"});return e(o,{class:B,props:{href:c||null,title:m,to:v||null},attrs:{draggable:!1},on:{...l.componentOptions.listeners},nativeOn:{dragstart:this.dragStart,drop:u=>this.dropped(u,d,p),dragover:this.dragOver,dragenter:u=>this.dragEnter(u,p),dragleave:u=>this.dragLeave(u,p)}},[w,_])})));const r=n.slice(Math.round(n.length/2));i=i.concat(r)}const a=[e("nav",{attrs:{"aria-label":this.ariaLabel}},[e("ul",{class:"breadcrumb__crumbs"},[i])])];return this.$slots.actions&&a.push(e("div",{class:"breadcrumb__actions",ref:"breadcrumb__actions"},this.$slots.actions)),this.breadcrumbsRefs=t,e("div",{class:["breadcrumb",{"breadcrumb--collapsed":this.hiddenIndices.length===n.length-2}],ref:"container"},a)}},Nt=null,Bt=null;var Lt=q(Ft,Nt,Bt,!1,null,"629bf30f");const xt=Lt.exports;var Pt="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",It="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",zt="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";const Dt={name:"FileIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var Vt=function(){var e=this,n=e._self._c;return n("span",e._b({staticClass:"material-design-icon file-icon",attrs:{"aria-hidden":e.title?null:!0,"aria-label":e.title,role:"img"},on:{click:function(t){return e.$emit("click",t)}}},"span",e.$attrs,!1),[n("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[n("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?n("title",[e._v(e._s(e.title))]):e._e()])])])},$t=[],At=L(Dt,Vt,$t,!1,null,null);const Se=At.exports,Fe=()=>{var e,n,t;const i=_e("files","config",null),a=C((e=i==null?void 0:i.show_hidden)!=null?e:!0),r=C((n=i==null?void 0:i.sort_favorites_first)!=null?n:!0),s=C((t=i==null?void 0:i.crop_image_previews)!=null?t:!0);return M(async()=>{var l,v,c,p,m,_;if(j())console.debug("Skip loading files settings - currently on public share");else try{const{data:o}=await ge.get(J("/apps/files/api/v1/configs"));a.value=(v=(l=o==null?void 0:o.data)==null?void 0:l.show_hidden)!=null?v:!1,r.value=(p=(c=o==null?void 0:o.data)==null?void 0:c.sort_favorites_first)!=null?p:!0,s.value=(_=(m=o==null?void 0:o.data)==null?void 0:m.crop_image_previews)!=null?_:!0}catch(o){console.error("Could not load files settings",o),Z(F("Could not load files settings"))}}),{showHiddenFiles:a,sortFavoritesFirst:r,cropImagePreviews:s}},Ot=e=>{var n,t,i,a,r,s,l,v,c,p,m,_;const o=k=>k==="asc"?"ascending":k==="desc"?"descending":"none",d=_e("files","viewConfigs",null),w=C({sortBy:(t=(n=d==null?void 0:d.files)==null?void 0:n.sorting_mode)!=null?t:"basename",order:o((a=(i=d==null?void 0:d.files)==null?void 0:i.sorting_direction)!=null?a:"asc")}),u=C({sortBy:(s=(r=d==null?void 0:d.recent)==null?void 0:r.sorting_mode)!=null?s:"basename",order:o((v=(l=d==null?void 0:d.recent)==null?void 0:l.sorting_direction)!=null?v:"asc")}),b=C({sortBy:(p=(c=d==null?void 0:d.favorites)==null?void 0:c.sorting_mode)!=null?p:"basename",order:o((_=(m=d==null?void 0:d.favorites)==null?void 0:m.sorting_direction)!=null?_:"asc")});M(async()=>{var k,P,h,g,I,V,$,z,X,Y,ee,te,ne,ie,re;if(j())console.debug("Skip loading files views - currently on public share");else try{const{data:S}=await ge.get(J("/apps/files/api/v1/views"));w.value={sortBy:(h=(P=(k=S==null?void 0:S.data)==null?void 0:k.files)==null?void 0:P.sorting_mode)!=null?h:"basename",order:o((I=(g=S==null?void 0:S.data)==null?void 0:g.files)==null?void 0:I.sorting_direction)},b.value={sortBy:(z=($=(V=S==null?void 0:S.data)==null?void 0:V.favorites)==null?void 0:$.sorting_mode)!=null?z:"basename",order:o((Y=(X=S==null?void 0:S.data)==null?void 0:X.favorites)==null?void 0:Y.sorting_direction)},u.value={sortBy:(ne=(te=(ee=S==null?void 0:S.data)==null?void 0:ee.recent)==null?void 0:te.sorting_mode)!=null?ne:"basename",order:o((re=(ie=S==null?void 0:S.data)==null?void 0:ie.recent)==null?void 0:re.sorting_direction)}}catch(S){console.error("Could not load files views",S),Z(F("Could not load files views"))}});const N=y(()=>ce(e||"files")==="files"?w.value:ce(e)==="recent"?u.value:b.value),x=y(()=>N.value.sortBy),f=y(()=>N.value.order);return{filesViewConfig:w,favoritesViewConfig:b,recentViewConfig:u,currentConfig:N,sortBy:x,order:f}},Mt={name:"MenuUpIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var Ht=function(){var e=this,n=e._self._c;return n("span",e._b({staticClass:"material-design-icon menu-up-icon",attrs:{"aria-hidden":e.title?null:!0,"aria-label":e.title,role:"img"},on:{click:function(t){return e.$emit("click",t)}}},"span",e.$attrs,!1),[n("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[n("path",{attrs:{d:"M7,15L12,10L17,15H7Z"}},[e.title?n("title",[e._v(e._s(e.title))]):e._e()])])])},Et=[],Rt=L(Mt,Ht,Et,!1,null,null);const Tt=Rt.exports,Wt={name:"MenuDownIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var jt=function(){var e=this,n=e._self._c;return n("span",e._b({staticClass:"material-design-icon menu-down-icon",attrs:{"aria-hidden":e.title?null:!0,"aria-label":e.title,role:"img"},on:{click:function(t){return e.$emit("click",t)}}},"span",e.$attrs,!1),[n("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[n("path",{attrs:{d:"M7,10L12,15L17,10H7Z"}},[e.title?n("title",[e._v(e._s(e.title))]):e._e()])])])},Zt=[],Ut=L(Wt,jt,Zt,!1,null,null);const qt=Ut.exports,Ne={"file-picker__file-icon":"_file-picker__file-icon_19mjt_9"},Kt=D({__name:"LoadingTableRow",props:{showCheckbox:{type:Boolean}},setup(e){return{__sfc:!0,fileListIconStyles:Ne}}});var Gt=function(){var e=this,n=e._self._c,t=e._self._setupProxy;return n("tr",{staticClass:"file-picker__row loading-row",attrs:{"aria-hidden":"true"}},[e.showCheckbox?n("td",{staticClass:"row-checkbox"},[n("span")]):e._e(),n("td",{staticClass:"row-name"},[n("div",{staticClass:"row-wrapper"},[n("span",{class:t.fileListIconStyles["file-picker__file-icon"]}),n("span")])]),e._m(0),e._m(1)])},Jt=[function(){var e=this,n=e._self._c;return e._self._setupProxy,n("td",{staticClass:"row-size"},[n("span")])},function(){var e=this,n=e._self._c;return e._self._setupProxy,n("td",{staticClass:"row-modified"},[n("span")])}],Qt=L(Kt,Gt,Jt,!1,null,"15187afc");const Xt=Qt.exports;function Yt(e,n={}){var t;n={size:32,cropPreview:!1,mimeFallback:!0,...n};try{const i=((t=e.attributes)==null?void 0:t.previewUrl)||J("/core/preview?fileId={fileid}",{fileid:e.fileid});let a;try{a=new URL(i)}catch{a=new URL(i,window.location.origin)}return a.searchParams.set("x","".concat(n.size)),a.searchParams.set("y","".concat(n.size)),a.searchParams.set("mimeFallback","".concat(n.mimeFallback)),a.searchParams.set("a",n.cropPreview===!0?"0":"1"),a.searchParams.set("c","".concat(e.attributes.etag)),a}catch{return null}}const en={name:"FolderIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var tn=function(){var e=this,n=e._self._c;return n("span",e._b({staticClass:"material-design-icon folder-icon",attrs:{"aria-hidden":e.title?null:!0,"aria-label":e.title,role:"img"},on:{click:function(t){return e.$emit("click",t)}}},"span",e.$attrs,!1),[n("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[n("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?n("title",[e._v(e._s(e.title))]):e._e()])])])},nn=[],rn=L(en,tn,nn,!1,null,null);const Be=rn.exports,an={name:"FilePreview"},sn=D({...an,props:{node:null,cropImagePreviews:{type:Boolean}},setup(e){const n=e,t=C(Ne),i=y(()=>Yt(n.node,{cropPreview:n.cropImagePreviews})),a=y(()=>n.node.type===U.File),r=C(!1);return Ie(()=>{if(r.value=!1,i.value){const s=new Image;s.src=i.value.href,s.onerror=()=>s.remove(),s.onload=()=>{r.value=!0,s.remove()}}}),{__sfc:!0,fileListIconStyles:t,props:n,previewURL:i,isFile:a,canLoadPreview:r,IconFile:Se,IconFolder:Be}}});var ln=function(){var e=this,n=e._self._c,t=e._self._setupProxy;return n("div",{class:t.fileListIconStyles["file-picker__file-icon"],style:t.canLoadPreview?{backgroundImage:"url(".concat(t.previewURL,")")}:void 0},[t.canLoadPreview?e._e():[t.isFile?n(t.IconFile,{attrs:{size:20}}):n(t.IconFolder,{attrs:{size:20}})]],2)},on=[],cn=L(sn,ln,on,!1,null,null);const un=cn.exports,dn=D({__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:n}){const t=e,i=y(()=>{var p;return((p=t.node.attributes)==null?void 0:p.displayName)||t.node.basename.slice(0,t.node.extension?-t.node.extension.length:void 0)}),a=y(()=>t.node.extension),r=y(()=>t.node.type===U.Folder),s=y(()=>t.canPick&&(t.allowPickDirectory||!r.value));function l(){n("update:selected",!t.selected)}function v(){r.value?n("enter-directory",t.node):l()}function c(p){p.key==="Enter"&&v()}return{__sfc:!0,props:t,emit:n,displayName:i,fileExtension:a,isDirectory:r,isPickable:s,toggleSelected:l,handleClick:v,handleKeyDown:c,formatFileSize:Me,NcCheckboxRadioSwitch:ye,NcDateTime:qe,t:F,FilePreview:un}}});var pn=function(){var e=this,n=e._self._c,t=e._self._setupProxy;return n("tr",e._g({class:["file-picker__row",{"file-picker__row--selected":e.selected&&!e.showCheckbox}],attrs:{tabindex:e.showCheckbox&&!t.isDirectory?void 0:0,"aria-selected":t.isPickable?e.selected:void 0,"data-filename":e.node.basename,"data-testid":"file-list-row"}},{click:t.handleClick,...!e.showCheckbox||t.isDirectory?{keydown:t.handleKeyDown}:{}}),[e.showCheckbox?n("td",{staticClass:"row-checkbox",on:{click:function(i){return i.stopPropagation(),(()=>{}).apply(null,arguments)}}},[n(t.NcCheckboxRadioSwitch,{attrs:{"aria-label":t.t("Select the row for {nodename}",{nodename:t.displayName}),checked:e.selected,disabled:!t.isPickable,"data-testid":"row-checkbox"},on:{"update:checked":t.toggleSelected}})],1):e._e(),n("td",{staticClass:"row-name"},[n("div",{staticClass:"file-picker__name-container",attrs:{"data-testid":"row-name"}},[n(t.FilePreview,{attrs:{node:e.node,"crop-image-previews":e.cropImagePreviews}}),n("div",{staticClass:"file-picker__file-name",attrs:{title:t.displayName},domProps:{textContent:e._s(t.displayName)}}),n("div",{staticClass:"file-picker__file-extension",domProps:{textContent:e._s(t.fileExtension)}})],1)]),n("td",{staticClass:"row-size"},[e._v(" "+e._s(t.formatFileSize(e.node.size||0))+" ")]),n("td",{staticClass:"row-modified"},[n(t.NcDateTime,{attrs:{timestamp:e.node.mtime,"ignore-seconds":!0}})],1)])},fn=[],hn=L(dn,pn,fn,!1,null,"cb12dccb");const vn=hn.exports,mn=D({__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:n}){const t=e,i=C(),{currentConfig:a}=Ot(t.currentView),r=y(()=>{var f;return(f=i.value)!=null?f:a.value}),s=y(()=>r.value.sortBy==="basename"?r.value.order==="none"?void 0:r.value.order:void 0),l=y(()=>r.value.sortBy==="size"?r.value.order==="none"?void 0:r.value.order:void 0),v=y(()=>r.value.sortBy==="mtime"?r.value.order==="none"?void 0:r.value.order:void 0),c=f=>{r.value.sortBy===f?r.value.order==="ascending"?i.value={sortBy:r.value.sortBy,order:"descending"}:i.value={sortBy:r.value.sortBy,order:"ascending"}:i.value={sortBy:f,order:"ascending"}},{sortFavoritesFirst:p,cropImagePreviews:m}=Fe(),_=y(()=>Ve(t.files,{sortFoldersFirst:!0,sortFavoritesFirst:p.value,sortingOrder:r.value.order==="descending"?"desc":"asc",sortingMode:r.value.sortBy})),o=y(()=>t.files.filter(f=>t.allowPickDirectory||f.type!==U.Folder)),d=y(()=>!t.loading&&t.selectedFiles.length>0&&t.selectedFiles.length>=o.value.length);function w(){t.selectedFiles.length<o.value.length?n("update:selectedFiles",o.value):n("update:selectedFiles",[])}function u(f){t.selectedFiles.includes(f)?n("update:selectedFiles",t.selectedFiles.filter(k=>k.path!==f.path)):t.multiselect?n("update:selectedFiles",[...t.selectedFiles,f]):n("update:selectedFiles",[f])}function b(f){n("update:path",f.path)}const N=C(4),x=C();{const f=()=>Pe(()=>{var k,P,h,g,I;const V=((P=(k=x.value)==null?void 0:k.parentElement)==null?void 0:P.children)||[];let $=((g=(h=x.value)==null?void 0:h.parentElement)==null?void 0:g.clientHeight)||450;for(let z=0;z<V.length;z++)(I=x.value)!=null&&I.isSameNode(V[z])||($-=V[z].clientHeight);N.value=Math.max(1,Math.floor(($-50)/50))});M(()=>{window.addEventListener("resize",f),f()}),xe(()=>{window.removeEventListener("resize",f)})}return{__sfc:!0,props:t,emit:n,customSortingConfig:i,filesAppSorting:a,sortingConfig:r,sortByName:s,sortBySize:l,sortByModified:v,toggleSorting:c,sortFavoritesFirst:p,cropImagePreviews:m,sortedFiles:_,selectableFiles:o,allSelected:d,onSelectAll:w,onNodeSelected:u,onChangeDirectory:b,skeletonNumber:N,fileContainer:x,NcButton:G,NcCheckboxRadioSwitch:ye,t:F,IconSortAscending:Tt,IconSortDescending:qt,LoadingTableRow:Xt,FileListRow:vn}}});var gn=function(){var e=this,n=e._self._c,t=e._self._setupProxy;return n("div",{ref:"fileContainer",staticClass:"file-picker__files"},[n("table",[n("thead",[n("tr",[e.multiselect?n("th",{staticClass:"row-checkbox"},[n("span",{staticClass:"hidden-visually"},[e._v(" "+e._s(t.t("Select entry"))+" ")]),e.multiselect?n(t.NcCheckboxRadioSwitch,{attrs:{"aria-label":t.t("Select all entries"),checked:t.allSelected,"data-testid":"select-all-checkbox"},on:{"update:checked":t.onSelectAll}}):e._e()],1):e._e(),n("th",{staticClass:"row-name",attrs:{"aria-sort":t.sortByName}},[n("div",{staticClass:"header-wrapper"},[n("span",{staticClass:"file-picker__header-preview"}),n(t.NcButton,{attrs:{wide:!0,type:"tertiary","data-test":"file-picker_sort-name"},on:{click:function(i){return t.toggleSorting("basename")}},scopedSlots:e._u([{key:"icon",fn:function(){return[t.sortByName==="ascending"?n(t.IconSortAscending,{attrs:{size:20}}):t.sortByName==="descending"?n(t.IconSortDescending,{attrs:{size:20}}):n("span",{staticStyle:{width:"44px"}})]},proxy:!0}])},[e._v(" "+e._s(t.t("Name"))+" ")])],1)]),n("th",{staticClass:"row-size",attrs:{"aria-sort":t.sortBySize}},[n(t.NcButton,{attrs:{wide:!0,type:"tertiary"},on:{click:function(i){return t.toggleSorting("size")}},scopedSlots:e._u([{key:"icon",fn:function(){return[t.sortBySize==="ascending"?n(t.IconSortAscending,{attrs:{size:20}}):t.sortBySize==="descending"?n(t.IconSortDescending,{attrs:{size:20}}):n("span",{staticStyle:{width:"44px"}})]},proxy:!0}])},[e._v(" "+e._s(t.t("Size"))+" ")])],1),n("th",{staticClass:"row-modified",attrs:{"aria-sort":t.sortByModified}},[n(t.NcButton,{attrs:{wide:!0,type:"tertiary"},on:{click:function(i){return t.toggleSorting("mtime")}},scopedSlots:e._u([{key:"icon",fn:function(){return[t.sortByModified==="ascending"?n(t.IconSortAscending,{attrs:{size:20}}):t.sortByModified==="descending"?n(t.IconSortDescending,{attrs:{size:20}}):n("span",{staticStyle:{width:"44px"}})]},proxy:!0}])},[e._v(" "+e._s(t.t("Modified"))+" ")])],1)])]),n("tbody",[e.loading?e._l(t.skeletonNumber,function(i){return n(t.LoadingTableRow,{key:i,attrs:{"show-checkbox":e.multiselect}})}):e._l(t.sortedFiles,function(i){return n(t.FileListRow,{key:i.fileid||i.path,attrs:{"allow-pick-directory":e.allowPickDirectory,"show-checkbox":e.multiselect,"can-pick":e.multiselect||e.selectedFiles.length===0||e.selectedFiles.includes(i),selected:e.selectedFiles.includes(i),node:i,"crop-image-previews":t.cropImagePreviews},on:{"update:selected":function(a){return t.onNodeSelected(i)},"enter-directory":t.onChangeDirectory}})})],2)])])},yn=[],_n=L(mn,gn,yn,!1,null,"006fdbd0");const bn=_n.exports,wn={name:"HomeIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var Cn=function(){var e=this,n=e._self._c;return n("span",e._b({staticClass:"material-design-icon home-icon",attrs:{"aria-hidden":e.title?null:!0,"aria-label":e.title,role:"img"},on:{click:function(t){return e.$emit("click",t)}}},"span",e.$attrs,!1),[n("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[n("path",{attrs:{d:"M10,20V14H14V20H19V12H22L12,3L2,12H5V20H10Z"}},[e.title?n("title",[e._v(e._s(e.title))]):e._e()])])])},kn=[],Sn=L(wn,Cn,kn,!1,null,null);const Fn=Sn.exports,Nn={name:"PlusIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var Bn=function(){var e=this,n=e._self._c;return n("span",e._b({staticClass:"material-design-icon plus-icon",attrs:{"aria-hidden":e.title?null:!0,"aria-label":e.title,role:"img"},on:{click:function(t){return e.$emit("click",t)}}},"span",e.$attrs,!1),[n("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[n("path",{attrs:{d:"M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z"}},[e.title?n("title",[e._v(e._s(e.title))]):e._e()])])])},Ln=[],xn=L(Nn,Bn,Ln,!1,null,null);const Pn=xn.exports,In=D({__name:"FilePickerBreadcrumbs",props:{path:null,showMenu:{type:Boolean}},emits:["update:path","create-node"],setup(e,{emit:n}){const t=e,i=C(!1),a=C(""),r=C();function s(){var c,p,m,_;const o=a.value.trim(),d=(p=(c=r.value)==null?void 0:c.$el)==null?void 0:p.querySelector("input");let w="";return o.length===0?w=F("Folder name cannot be empty."):o.includes("/")?w=F('"/" is not allowed inside a folder name.'):["..","."].includes(o)?w=F('"{name}" is an invalid folder name.',{name:o}):(m=window.OC.config)!=null&&m.blacklist_files_regex&&o.match((_=window.OC.config)==null?void 0:_.blacklist_files_regex)&&(w=F('"{name}" is not an allowed folder name',{name:o})),d&&d.setCustomValidity(w),w===""}const l=function(){const c=a.value.trim();s()&&(i.value=!1,n("create-node",c),a.value="")},v=y(()=>t.path.split("/").filter(c=>c!=="").map((c,p,m)=>({name:c,path:"/"+m.slice(0,p+1).join("/")})));return{__sfc:!0,props:t,emit:n,actionsOpen:i,newNodeName:a,nameInput:r,validateInput:s,onSubmit:l,pathElements:v,IconFolder:Be,IconHome:Fn,IconPlus:Pn,NcActions:K,NcActionInput:je,NcBreadcrumbs:xt,NcBreadcrumb:be,t:F}}});var zn=function(){var e=this,n=e._self._c,t=e._self._setupProxy;return n(t.NcBreadcrumbs,{staticClass:"file-picker__breadcrumbs",scopedSlots:e._u([{key:"default",fn:function(){return[n(t.NcBreadcrumb,{attrs:{name:t.t("All files"),title:t.t("Home")},on:{click:function(i){return t.emit("update:path","/")}},scopedSlots:e._u([{key:"icon",fn:function(){return[n(t.IconHome,{attrs:{size:20}})]},proxy:!0}])}),e._l(t.pathElements,function(i){return n(t.NcBreadcrumb,{key:i.path,attrs:{name:i.name,title:i.path},on:{click:function(a){return t.emit("update:path",i.path)}}})})]},proxy:!0},e.showMenu?{key:"actions",fn:function(){return[n(t.NcActions,{attrs:{"aria-label":t.t("Create directory"),"force-menu":!0,"force-name":!0,"menu-name":t.t("New"),open:t.actionsOpen,type:"secondary"},on:{"update:open":function(i){t.actionsOpen=i},close:function(i){t.newNodeName=""}},scopedSlots:e._u([{key:"icon",fn:function(){return[n(t.IconPlus,{attrs:{size:20}})]},proxy:!0}],null,!1,2971667417)},[n(t.NcActionInput,{ref:"nameInput",attrs:{value:t.newNodeName,label:t.t("New folder"),placeholder:t.t("New folder name")},on:{"update:value":function(i){t.newNodeName=i},submit:t.onSubmit,input:t.validateInput},scopedSlots:e._u([{key:"icon",fn:function(){return[n(t.IconFolder,{attrs:{size:20}})]},proxy:!0}],null,!1,1614167509)})],1)]},proxy:!0}:null],null,!0)})},Dn=[],Vn=L(In,zn,Dn,!1,null,"b357227a");const $n=Vn.exports,An={name:"CloseIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var On=function(){var e=this,n=e._self._c;return n("span",e._b({staticClass:"material-design-icon close-icon",attrs:{"aria-hidden":e.title?null:!0,"aria-label":e.title,role:"img"},on:{click:function(t){return e.$emit("click",t)}}},"span",e.$attrs,!1),[n("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[n("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?n("title",[e._v(e._s(e.title))]):e._e()])])])},Mn=[],Hn=L(An,On,Mn,!1,null,null);const En=Hn.exports,Rn={name:"MagnifyIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var Tn=function(){var e=this,n=e._self._c;return n("span",e._b({staticClass:"material-design-icon magnify-icon",attrs:{"aria-hidden":e.title?null:!0,"aria-label":e.title,role:"img"},on:{click:function(t){return e.$emit("click",t)}}},"span",e.$attrs,!1),[n("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[n("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?n("title",[e._v(e._s(e.title))]):e._e()])])])},Wn=[],jn=L(Rn,Tn,Wn,!1,null,null);const Zn=jn.exports,Un=e=>{const n=[{id:"files",label:F("All files"),icon:It},{id:"recent",label:F("Recent"),icon:Pt},{id:"favorites",label:F("Favorites"),icon:zt}],t=e.value?n.filter(({id:i})=>i==="files"):n;return{allViews:n,availableViews:t}},qn=D({__name:"FilePickerNavigation",props:{currentView:null,filterString:null,isCollapsed:{type:Boolean},disabledNavigation:{type:Boolean}},emits:["update:currentView","update:filterString"],setup(e,{emit:n}){const t=e,{availableViews:i}=Un(C(et()===null)),a=y(()=>{var r;return(r=i.filter(s=>s.id===t.currentView)[0])!=null?r:i[0]});return{__sfc:!0,props:t,emit:n,availableViews:i,currentViewObject:a,updateFilterValue:r=>n("update:filterString",r),IconClose:En,IconMagnify:Zn,NcButton:G,NcIconSvgWrapper:Je,NcSelect:Ze,NcTextField:Ue,Fragment:ke,t:F}}});var Kn=function(){var e=this,n=e._self._c,t=e._self._setupProxy;return n(t.Fragment,[n(t.NcTextField,{staticClass:"file-picker__filter-input",attrs:{value:e.filterString,label:t.t("Filter file list"),"show-trailing-button":!!e.filterString},on:{"update:value":t.updateFilterValue,"trailing-button-click":function(i){return t.updateFilterValue("")}},scopedSlots:e._u([{key:"trailing-button-icon",fn:function(){return[n(t.IconClose,{attrs:{size:16}})]},proxy:!0}])},[n(t.IconMagnify,{attrs:{size:16}})],1),t.availableViews.length>1&&!e.disabledNavigation?[e.isCollapsed?n(t.NcSelect,{attrs:{"aria-label":t.t("Current view selector"),clearable:!1,searchable:!1,options:t.availableViews,value:t.currentViewObject},on:{input:i=>t.emit("update:currentView",i.id)}}):n("ul",{staticClass:"file-picker__side"},e._l(t.availableViews,function(i){return n("li",{key:i.id},[n(t.NcButton,{attrs:{type:e.currentView===i.id?"primary":"tertiary",wide:!0},on:{click:function(a){return e.$emit("update:currentView",i.id)}},scopedSlots:e._u([{key:"icon",fn:function(){return[n(t.NcIconSvgWrapper,{attrs:{path:i.icon,size:20}})]},proxy:!0}],null,!0)},[e._v(" "+e._s(i.label)+" ")])],1)}),0)]:e._e()],2)},Gn=[],Jn=L(qn,Kn,Gn,!1,null,"b42054b8");const Qn=Jn.exports,Xn=function(e,n){const t=j(),i=t?"/":$e,a=y(()=>t?nt("webdav").replace("/remote.php","/public.php"):ze),r=y(()=>{if(t){const u=document.getElementById("sharingToken").value,b=btoa("".concat(u,":null"));return se(a.value,{Authorization:"Basic ".concat(b)})}return se()}),s=u=>Ae(u,i,a.value),l=()=>{const u=new AbortController,b=Math.round(Date.now()/1e3)-60*60*24*14;return new oe(async(N,x,f)=>{f(()=>u.abort());try{const{data:k}=await r.value.search("/",{signal:u.signal,details:!0,data:Oe(b)}),P=k.results.map(s);N(P)}catch(k){x(k)}})},v=()=>{const u=new AbortController;return new oe(async(b,N,x)=>{x(()=>u.abort());try{const f=(await r.value.getDirectoryContents("".concat(i).concat(n.value),{signal:u.signal,details:!0,includeSelf:!0,data:le()})).data.map(s);b({folder:f.find(k=>k.path===n.value),contents:f.filter(k=>k.path!==n.value)})}catch(f){N(f)}})},c=W([]),p=W(null),m=C(!0),_=C(null);async function o(u){const b=ae.join(n.value,u);await r.value.createDirectory(ae.join(i,b));const N=await d(b);return c.value=[...c.value,N],N}async function d(u,b=void 0){b=b!=null?b:i;const{data:N}=await r.value.stat("".concat(b).concat(u),{details:!0,data:le()});return s(N)}async function w(){_.value&&_.value.cancel(),m.value=!0,e.value==="favorites"?_.value=De(r.value,n.value,i):e.value==="recent"?_.value=l():_.value=v();const u=await _.value;"folder"in u?(p.value=u.folder,c.value=u.contents):(p.value=null,c.value=u),_.value=null,m.value=!1}return me([e,n],()=>w()),M(()=>w()),{isLoading:m,files:c,folder:p,loadFiles:w,createDirectory:o}},Yn=function(e){const n=y(()=>e.value.map(t=>t.split("/")));return{isSupportedMimeType:t=>{const i=t.split("/");return n.value.some(([a,r])=>(i[0]===a||a==="*")&&(i[1]===r||r==="*"))}}},ei={name:"FilePicker"},ti=D({...ei,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:n}){const t=e,i=C(!0),a=y(()=>{const h=c.value.length===0&&t.allowPickDirectory&&u.value?[u.value]:c.value;return(typeof t.buttons=="function"?t.buttons(h,_.value,l.value):t.buttons).map(g=>({...g,disabled:g.disabled||b.value,callback:()=>{r=!0,s(g.callback,h)}}))});let r=!1;const s=async(h,g)=>{h(g),n("close",g),r=!1},l=C("files"),v=y(()=>l.value==="favorites"?F("Favorites"):l.value==="recent"?F("Recent"):""),c=W([]),p=C((window==null?void 0:window.sessionStorage.getItem("NC.FilePicker.LastPath"))||"/"),m=C("");me([m],()=>{t.path===void 0&&m.value&&window.sessionStorage.setItem("NC.FilePicker.LastPath",m.value),c.value=[]});const _=y({get:()=>l.value==="files"?m.value||t.path||p.value:"/",set:h=>{m.value=h}}),o=C(""),{isSupportedMimeType:d}=Yn(Le(t,"mimetypeFilter")),{files:w,folder:u,isLoading:b,loadFiles:N,createDirectory:x}=Xn(l,_);M(()=>N());const{showHiddenFiles:f}=Fe(),k=y(()=>{let h=w.value;return f.value||(h=h.filter(g=>!g.basename.startsWith("."))),t.mimetypeFilter.length>0&&(h=h.filter(g=>g.type==="folder"||g.mime&&d(g.mime))),o.value&&(h=h.filter(g=>g.basename.toLowerCase().includes(o.value.toLowerCase()))),t.filterFn&&(h=h.filter(g=>t.filterFn(g))),h}),P=y(()=>l.value==="files"?F("Upload some content or sync with your devices!"):l.value==="recent"?F("Files and folders you recently modified will show up here."):F("Files and folders you mark as favorite will show up here."));return{__sfc:!0,props:t,emit:n,isOpen:i,dialogButtons:a,isHandlingCallback:r,handleButtonClick:s,currentView:l,viewHeadline:v,selectedFiles:c,savedPath:p,navigatedPath:m,currentPath:_,filterString:o,isSupportedMimeType:d,files:w,currentFolder:u,isLoading:b,loadFiles:N,createDirectory:x,showHiddenFiles:f,filteredFiles:k,noFilesDescription:P,onCreateFolder:async h=>{try{const g=await x(h);m.value=g.path,Ye("files:node:created",w.value.filter(I=>I.basename===h)[0])}catch(g){console.warn("Could not create new folder",{name:h,error:g}),Z(F("Could not create the new folder"))}},handleClose:h=>{!h&&!r&&n("close")},IconFile:Se,FileList:bn,FilePickerBreadcrumbs:$n,FilePickerNavigation:Qn,NcDialog:Te,NcEmptyContent:We,t:F}}});var ni=function(){var e=this,n=e._self._c,t=e._self._setupProxy;return n(t.NcDialog,{attrs:{container:e.container,buttons:t.dialogButtons,name:e.name,size:"large","content-classes":"file-picker__content","dialog-classes":"file-picker","navigation-classes":"file-picker__navigation",open:t.isOpen},on:{"update:open":[function(i){t.isOpen=i},t.handleClose]},scopedSlots:e._u([{key:"navigation",fn:function({isCollapsed:i}){return[n(t.FilePickerNavigation,{attrs:{"is-collapsed":i,"current-view":t.currentView,"filter-string":t.filterString,"disabled-navigation":e.disabledNavigation},on:{"update:currentView":function(a){t.currentView=a},"update:current-view":function(a){t.currentView=a},"update:filterString":function(a){t.filterString=a},"update:filter-string":function(a){t.filterString=a}}})]}}])},[n("div",{staticClass:"file-picker__main"},[t.currentView==="files"?n(t.FilePickerBreadcrumbs,{attrs:{path:t.currentPath,"show-menu":e.allowPickDirectory},on:{"update:path":function(i){t.currentPath=i},"create-node":t.onCreateFolder}}):n("div",{staticClass:"file-picker__view"},[n("h3",[e._v(e._s(t.viewHeadline))])]),t.isLoading||t.filteredFiles.length>0?n(t.FileList,{attrs:{"allow-pick-directory":e.allowPickDirectory,"current-view":t.currentView,files:t.filteredFiles,multiselect:e.multiselect,loading:t.isLoading,path:t.currentPath,"selected-files":t.selectedFiles,name:t.viewHeadline},on:{"update:path":[function(i){t.currentPath=i},function(i){t.currentView="files"}],"update:selectedFiles":function(i){t.selectedFiles=i},"update:selected-files":function(i){t.selectedFiles=i}}}):t.filterString?n(t.NcEmptyContent,{attrs:{name:t.t("No matching files"),description:t.t("No files matching your filter were found.")},scopedSlots:e._u([{key:"icon",fn:function(){return[n(t.IconFile)]},proxy:!0}])}):n(t.NcEmptyContent,{attrs:{name:t.t("No files in here"),description:t.noFilesDescription},scopedSlots:e._u([{key:"icon",fn:function(){return[n(t.IconFile)]},proxy:!0}])})],1)])},ii=[],ri=L(ti,ni,ii,!1,null,"20b719ba");const gi=ri.exports;export{gi as default};

Zerion Mini Shell 1.0