(self.webpackChunkncpasswords=self.webpackChunkncpasswords||[]).push([[4473],{25683:(t,e,s)=>{"use strict";s.d(e,{A:()=>i});var r=function(){var t=this,e=t._self._c;return e("div",{staticClass:"row",class:t.rowClass,on:{click:t.setUrl}},[e("translate",{staticClass:"title",attrs:{icon:t.icon,say:t.label,iconClass:"genericIcon"}})],1)};r._withStripped=!0;const a={components:{Translate:s(53024).A},props:{params:{type:Object},label:{type:String},icon:{type:String}},data(){return{route:this.$route.name,rowClass:this.$route.name.toLowerCase()}},methods:{setUrl(){this.params&&this.$router.push({name:this.route,params:this.params})}}};s(67466);const i=(0,s(14486).A)(a,r,[],!1,null,null,null).exports},35251:(t,e,s)=>{var r=s(49414);r.__esModule&&(r=r.default),"string"==typeof r&&(r=[[t.id,r,""]]),r.locals&&(t.exports=r.locals),(0,s(70534).A)("ea0065e8",r,!1,{})},49414:(t,e,s)=>{"use strict";s.r(e),s.d(e,{default:()=>r});const r={}},56607:(t,e,s)=>{"use strict";s.r(e),s.d(e,{default:()=>r});const r={}},67466:(t,e,s)=>{var r=s(56607);r.__esModule&&(r=r.default),"string"==typeof r&&(r=[[t.id,r,""]]),r.locals&&(t.exports=r.locals),(0,s(70534).A)("6df6eda1",r,!1,{})},97325:(t,e,s)=>{"use strict";s.r(e),s.d(e,{default:()=>y});var r=function(){var t=this,e=t._self._c;return e("div",{class:t.getContentClass,attrs:{id:"app-content"}},[e("div",{staticClass:"app-content-left"},[e("breadcrumb",{attrs:{showAddNew:!1,items:t.getBreadcrumb}}),t._v(" "),e("div",{staticClass:"item-list"},[t.isNotEmpty?e("header-line",{attrs:{field:t.sorting.field,ascending:t.sorting.ascending},on:{updateSorting:function(e){return t.updateSorting(e)}}}):t._e(),t._v(" "),t._l(t.shareType,function(s,r){return void 0===t.$route.params.type?e("generic-line",{key:s,attrs:{label:s,icon:"share-alt",params:{type:r.toString()}}}):t._e()}),t._v(" "),t._l(t.passwords,function(s){return e("password-line",{key:s.id,attrs:{password:s}},[e("ul",{staticClass:"line-share-icons",attrs:{slot:"middle"},slot:"middle"},t._l(t.getShareUsers(s.id),function(s){return e("li",{key:s.id,attrs:{title:s.name}},[e("img",{attrs:{src:s.icon,title:s.name,alt:s.name,loading:"lazy",width:"24",height:"24"}}),t._v("\n                        "+t._s(s.name)+"\n                    ")])}),0)])}),t._v(" "),t.isNotEmpty?e("footer-line",{attrs:{passwords:t.passwords}}):t._e(),t._v(" "),t.isEmpty?e("empty",{attrs:{text:t.getEmptyText}}):t._e()],2)],1)])};r._withStripped=!0;var a=s(56423),i=s(45314),n=s(83571),o=s(30845),l=s(25683),d=s(94730),p=s(54164),h=s(5460),u=s(90512),c=s(80444);const m={extends:p.A,components:{Breadcrumb:i.A,HeaderLine:n.A,FooterLine:o.A,GenericLine:l.A,PasswordLine:d.A,empty:()=>s.e(5645).then(s.bind(s,80149))},data:()=>({loading:!1,shareType:["Shared with you","Shared by you"],shareUsers:[]}),computed:{isEmpty(){return!this.loading&&(!(!this.search.active||0!==this.search.total)||!this.passwords.length&&void 0!==this.$route.params.type)},isNotEmpty(){return!this.loading&&!this.isEmpty&&void 0!==this.$route.params.type},getEmptyText(){return this.search.active?c.A.translate('We could not find anything for "{query}"',{query:this.search.query}):"0"===this.$route.params.type.toString()?"No passwords were shared with you":"You did not share any passwords"},getBreadcrumb(){if(void 0!==this.$route.params.type){let t=Number.parseInt(this.$route.params.type),e=this.shareType[t];return[{path:{name:"Shares"},label:c.A.translate("Shares")},{path:this.$route.path,label:c.A.translate(e)}]}return[]}},methods:{refreshView:function(){if(void 0!==this.$route.params.type){let t=Number.parseInt(this.$route.params.type);0===t?a.A.findShares({receiver:"_self"},"model+password").then(e=>{this.updateContentList(e,t)}):a.A.findShares({owner:"_self"},"model+password").then(e=>{this.updateContentList(e,t)}),this.passwords.length||(this.loading=!0)}else this.loading=!1,this.passwords=[]},updateContentList:function(t,e){if(Number.parseInt(this.$route.params.type)!==e)return;this.loading=!1;let s={},r=[];for(let a in t){if(!t.hasOwnProperty(a))continue;let i=t[a].password,n=i.id;i.trashed||(s.hasOwnProperty(n)||(s[n]=i,r[n]=[]),0===e?r[n].push(t[a].owner):r[n].push(t[a].receiver))}for(let t in r)r.hasOwnProperty(t)&&(r[t]=u.A.sortApiObjectArray(r[t],"name"));this.shareUsers=r,this.passwords=u.A.sortApiObjectArray(s,this.getPasswordsSortingField(),this.sorting.ascending)},getShareUsers(t){return this.shareUsers[t]}},watch:{$route:function(){this.refreshView(),h.A.sidebar=null}}};s(35251);const y=(0,s(14486).A)(m,r,[],!1,null,null,null).exports}}]);