"use strict";(self.webpackChunk_bitwarden_web_vault=self.webpackChunk_bitwarden_web_vault||[]).push([[922],{28020(t,n,o){o.d(n,{H7:()=>i.H7,UN:()=>i.UN,bf:()=>i.bf});o(74043),o(83586);var i=o(69196)},6922(t,n,o){o.d(n,{OrgImportComponent:()=>U});var i=o(68108),r=o(69783),e=o(21571),a=o(67553),u=o(3633),c=o(5076),s=o(28020),d=o(95713),l=o(36801),f=o(72932),p=o(25065),v=o(11217),h=function(t,n,o,i){return new(o||(o=Promise))(function(r,e){function a(t){try{c(i.next(t))}catch(n){e(n)}}function u(t){try{c(i.throw(t))}catch(n){e(n)}}function c(t){var n;t.done?r(t.value):(n=t.value,n instanceof o?n:new o(function(t){t(n)})).then(a,u)}c((i=i.apply(t,n||[])).next())})};class m{constructor(t){this.collectionAdminService=t}getAllAdminCollections(t,n){return h(this,void 0,void 0,function*(){return yield(0,i._)(this.collectionAdminService.collectionAdminViews$(t,n))})}}m.ɵfac=function(t){return new(t||m)(v.KVO(e.vE))},m.ɵprov=v.jDH({token:m,factory:m.ɵfac});var g=o(14041),b=o(26983),I=o(35500),w=o(26657),y=o(56898),_=o(10672),z=o(49112),S=o(25740),T=function(t,n,o,i){return new(o||(o=Promise))(function(r,e){function a(t){try{c(i.next(t))}catch(n){e(n)}}function u(t){try{c(i.throw(t))}catch(n){e(n)}}function c(t){var n;t.done?r(t.value):(n=t.value,n instanceof o?n:new o(function(t){t(n)})).then(a,u)}c((i=i.apply(t,n||[])).next())})};class U{constructor(t,n,o,i){this.route=t,this.organizationService=n,this.router=o,this.accountService=i,this.routeOrgId=void 0,this.loading=!1,this.disabled=!1,this.returnTo=void 0}ngOnInit(){var t;const n=this.route.snapshot.paramMap.get("organizationId");if(void 0===n)throw new Error("`organizationId` is a required route parameter");if(!(0,c.e)(n))throw new Error("Invalid OrganizationId provided in route parameter `organizationId`");this.routeOrgId=n,this.returnTo=null!==(t=this.route.snapshot.queryParamMap.get("returnTo"))&&void 0!==t?t:void 0}onSuccessfulImport(t){return T(this,void 0,void 0,function*(){const n=yield(0,i._)((0,u.F6)(this.accountService.activeAccount$)),o=yield(0,i._)(this.organizationService.organizations$(n).pipe((0,r.T)(n=>n.find(n=>n.id===t))));null!=o&&(0,a.of)(o)&&(yield this.router.navigate(["organizations",t,"vault"]))})}}U.ɵfac=function(t){return new(t||U)(g.rXU(b.nX),g.rXU(a.PV),g.rXU(b.Ix),g.rXU(I.D))},U.ɵcmp=g.VBU({type:U,selectors:[["ng-component"]],features:[g.Jv_([...d.F3,(0,l.F)({provide:s.UN,useClass:s.bf,deps:[d.Uz]}),{provide:s.H7,useClass:m,deps:[e.vE]}])],decls:6,vars:8,consts:[[3,"formDisabled","formLoading","onSuccessfulImport","organizationId","returnTo"],["form","import_form_importForm","bitButton","","type","submit","bitFormButton","","buttonType","primary",3,"disabled","loading"]],template:function(t,n){1&t&&(g.nrm(0,"app-header"),g.j41(1,"bit-container")(2,"tools-import",0),g.bIt("formDisabled",function(t){return n.disabled=t})("formLoading",function(t){return n.loading=t})("onSuccessfulImport",function(t){return n.onSuccessfulImport(t)}),g.k0s(),g.j41(3,"button",1),g.EFF(4),g.nI1(5,"i18n"),g.k0s()()),2&t&&(g.R7$(2),g.Y8G("organizationId",g.mNQ(n.routeOrgId))("returnTo",n.returnTo),g.R7$(),g.Y8G("disabled",n.disabled)("loading",n.loading),g.R7$(),g.SpI(" ",g.bMT(5,6,"importVerb")," "))},dependencies:[p.G,w.$,y.Q,_.H,d.Pi,f.G,z.f,S.$],encapsulation:2})}}]);
//# sourceMappingURL=922.e5c11039e5e4c1258f68.js.map