(()=>{vare,r,t,o={15340:()=>{},43723:(e,r,t)=>{"use strict";varo=t(19051),a=t(85168),n=t(61338),s=t(81222),i=t(53334),d=t(63814),l=t(98469),c=t(85471),p=t(94219),u=t(93663);constf=(0,c.pM)({__name:"RemoteShareDialog",props:{name:null,owner:null,remote:null,passwordRequired:{type:Boolean}},emits:["close"],setup(e,{emit:r}){constt=e,o=(0,c.KR)(""),a=(0,c.EW)(()=>[{label:(0,i.t)("federatedfilesharing","Cancel"),callback:()=>r("close",!1)},{label:(0,i.t)("federatedfilesharing","Add remote share"),type:t.passwordRequired?"submit":void0,variant:"primary",callback:()=>r("close",!0,o.value)}]);return{__sfc:!0,props:t,emit:r,password:o,buttons:a,t:i.t,NcDialog:p.A,NcPasswordField:u.A}}});varm=t(85072),h=t.n(m),g=t(97825),w=t.n(g),b=t(77659),v=t.n(b),y=t(55056),A=t.n(y),_=t(10540),O=t.n(_),C=t(41113),S=t.n(C),k=t(85994),P={};P.styleTagTransform=S(),P.setAttributes=A(),P.insert=v().bind(null,"head"),P.domAPI=w(),P.insertStyleElement=O(),h()(k.A,P),k.A&&k.A.locals&&k.A.locals;constR=(0,t(14486).A)(f,function(){vare=this,r=e._self._c,t=e._self._setupProxy;returnr(t.NcDialog,{attrs:{buttons:t.buttons,"is-form":e.passwordRequired,name:t.t("federatedfilesharing","Remote share")},on:{submit:function(e){returnt.emit("close",!0,t.password)}}},[r("p",[e._v("\n\t\t"+e._s(t.t("federatedfilesharing","Do you want to add the remote share {name} from {owner}@{remote}?",{name:e.name,owner:e.owner,remote:e.remote}))+"\n\t")]),e._v(" "),e.passwordRequired?r(t.NcPasswordField,{staticClass:"remote-share-dialog__password",attrs:{label:t.t("federatedfilesharing","Remote share password"),value:t.password},on:{"update:value":function(e){t.password=e}}}):e._e()],1)},[],!1,null,"014832cd",null).exports,x=(0,t(35947).YK)().setApp("federatedfilesharing").build();functionE(){window?.OCP?.Files?.Router?.goToRoute?window.OCP.Files.Router.goToRoute(null,{...window.OCP.Files.Router.params,fileid:void0},{...window.OCP.Files.Router.query,dir:"/",openfile:void0}):window.location.reload()}window.OCA.Sharing=window.OCA.Sharing??{},window.OCA.Sharing.showAddExternalDialog=function(e,r,t){consto=e.ownerDisplayName||e.owner;(function(e,r,t,o=!1){const{promise:a,reject:n,resolve:s}=Promise.withResolvers();return(0,l.S)(R,{name:e,owner:r,remote:t,passwordRequired:o},(e,r)=>{o&&e?s(r):e?s(void0):n()}),a})(e.name,o,e.remote.replace(/^https?:\/\//,"").replace(/\/$/,""),r).then(r=>t(!0,{...e,password:r})).catch(()=>t(!1,e))},window.addEventListener("DOMContentLoaded",()=>{!function(){conste=window.OC.Util.History.parseUrlQuery();if(e.remote&&e.token&&e.name){constr=(e,r)=>{!1!==e&&o.Ay.post((0,d.Jv)("apps/federatedfilesharing/askForFederatedShare"),{remote:r.remote,token:r.token,owner:r.owner,ownerDisplayName:r.ownerDisplayName||r.owner,name:r.name,password:r.password||""}).then(({data:e})=>{Object.hasOwn(e,"legacyMount")?E():(0,a.cf)(e.message)}).catch(e=>{x.error("Error while processing incoming share",{error:e}),(0,o.F0)(e)&&e.response.data.message?(0,a.Qg)(e.response.data.message):(0,a.Qg)((0,i.t)("federatedfilesharing","Incoming share could not be processed"))})};location.hash="",e.passwordProtected=1===parseInt(e.protected,10),window.OCA.Sharing.showAddExternalDialog(e,e.passwordProtected,r)}}(),!0!==(0,s.C)("federatedfilesharing","notificationsEnabled",!0)&&asyncfunction(){const{data:e}=awaito.Ay.get((0,d.Jv)("/apps/files_sharing/api/externalShares"));for(letr=0;r<e.length;++r)window.OCA.Sharing.showAddExternalDialog(e[r],!1,function(e,r){!1===e?o.Ay.delete((0,d.Jv)("/apps/files_sharing/api/externalShares/"+r.id)):o.Ay.post((0,d.Jv)("/apps/files_sharing/api/externalShares"),{id:r.id}).then(()=>E())})}(),(0,n.B1)("notifications:action:executed",({action:e,notification:r})=>{"files_sharing"===r.app&&"remote_share"===r.object_type&&"POST"===e.type&&E()})})},47790:()=>{},51069:()=>{},63779:()=>{},64688:()=>{},66089:()=>{},73776:()=>{},77199:()=>{},77965:()=>{},78982:()=>{},79368:()=>{},79838:()=>{},85994:(e,r,t)=>{"use strict";t.d(r,{A:()=>i});varo=t(71354),a=t.n(o),n=t(76314),s=t.n(n)()(a());s.push([e.id,".remote-share-dialog__password[data-v-014832cd]