From 9df3f8ca49866f9a7ebcfee3f79ae0bfe1b7cfcd Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Wed, 25 Jul 2018 14:27:32 -0400 Subject: [PATCH] Updates --- ...7e1dd0c873724da00116.css => main.3bc8efccbfe0b27994c6.css} | 2 +- ...73724da00116.css.map => main.3bc8efccbfe0b27994c6.css.map} | 2 +- app/main.3bc8efccbfe0b27994c6.js | 2 ++ app/main.3bc8efccbfe0b27994c6.js.map | 1 + app/main.7e1dd0c873724da00116.js | 2 -- app/main.7e1dd0c873724da00116.js.map | 1 - index.html | 4 ++-- 7 files changed, 7 insertions(+), 7 deletions(-) rename app/{main.7e1dd0c873724da00116.css => main.3bc8efccbfe0b27994c6.css} (99%) rename app/{main.7e1dd0c873724da00116.css.map => main.3bc8efccbfe0b27994c6.css.map} (58%) create mode 100644 app/main.3bc8efccbfe0b27994c6.js create mode 100644 app/main.3bc8efccbfe0b27994c6.js.map delete mode 100644 app/main.7e1dd0c873724da00116.js delete mode 100644 app/main.7e1dd0c873724da00116.js.map diff --git a/app/main.7e1dd0c873724da00116.css b/app/main.3bc8efccbfe0b27994c6.css similarity index 99% rename from app/main.7e1dd0c873724da00116.css rename to app/main.3bc8efccbfe0b27994c6.css index e3d764db..91c261ac 100644 --- a/app/main.7e1dd0c873724da00116.css +++ b/app/main.3bc8efccbfe0b27994c6.css @@ -9698,4 +9698,4 @@ img.logo { .overflow-hidden { overflow: hidden; } -/*# sourceMappingURL=main.7e1dd0c873724da00116.css.map*/ \ No newline at end of file +/*# sourceMappingURL=main.3bc8efccbfe0b27994c6.css.map*/ \ No newline at end of file diff --git a/app/main.7e1dd0c873724da00116.css.map b/app/main.3bc8efccbfe0b27994c6.css.map similarity index 58% rename from app/main.7e1dd0c873724da00116.css.map rename to app/main.3bc8efccbfe0b27994c6.css.map index 12fc7c43..3a0ef190 100644 --- a/app/main.7e1dd0c873724da00116.css.map +++ b/app/main.3bc8efccbfe0b27994c6.css.map @@ -1 +1 @@ -{"version":3,"sources":[],"names":[],"mappings":"","file":"app/main.7e1dd0c873724da00116.css","sourceRoot":""} \ No newline at end of file +{"version":3,"sources":[],"names":[],"mappings":"","file":"app/main.3bc8efccbfe0b27994c6.css","sourceRoot":""} \ No newline at end of file diff --git a/app/main.3bc8efccbfe0b27994c6.js b/app/main.3bc8efccbfe0b27994c6.js new file mode 100644 index 00000000..7af145ca --- /dev/null +++ b/app/main.3bc8efccbfe0b27994c6.js @@ -0,0 +1,2 @@ +!function(n){function l(l){for(var t,i,r=l[0],a=l[1],s=l[2],c=0,p=[];c0&&this.toasterService.popAsync("error",this.i18nService.t("errorOccurred"),e[0]),e},n}();l.ValidationService=t},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});e(0),e(17);var t=function(){function n(n,l){this.el=n,this.validationService=l}return n.prototype.ngOnChanges=function(n){var l=this;null!=this.appApiAction&&null!=this.appApiAction.then&&(this.el.nativeElement.loading=!0,this.appApiAction.then(function(n){l.el.nativeElement.loading=!1},function(n){l.el.nativeElement.loading=!1,l.validationService.showError(n)}))},n}();l.ApiActionDirective=t},,function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(){}}();l.CryptoService=t},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(){}}();l.UserService=t},,,,,function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(){}}();l.CipherService=t},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(){}}();l.MessagingService=t},,,,function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(){this.success=!1,this.ciphers=[],this.folders=[],this.folderRelationships=[],this.collections=[],this.collectionRelationships=[]}}();l.ImportResult=t},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=e(539),u=e(157),o=e(177),i=e(216),r=e(49),a=e(179),s=e(128),d=e(156),c=e(91),p=e(53),f=e(219),v=e(101),h=function(){function n(){this.organization=!1,this.newLineRegex=/(?:\r\n|\r|\n)/,this.passwordFieldNames=["password","pass word","passphrase","pass phrase","pass","code","code word","codeword","secret","secret word","personpwd","key","keyword","key word","keyphrase","key phrase","form_pw","wppassword","pin","pwd","pw","pword","passwd","p","serial","serial#","license key","reg #","passwort"],this.usernameFieldNames=["user","name","user name","username","login name","email","e-mail","id","userid","user id","login","form_loginname","wpname","mail","loginid","login id","log","personlogin","first name","last name","card#","account #","member","member #","nom","benutzername"],this.notesFieldNames=["note","notes","comment","comments","memo","description","free form","freeform","free text","freetext","free","kommentar"],this.uriFieldNames=["url","hyper link","hyperlink","link","host","hostname","host name","server","address","hyper ref","href","web","website","web site","site","web-site","uri","ort","adresse"]}return n.prototype.parseXml=function(n){var l=(new DOMParser).parseFromString(n,"application/xml");return null!=l&&null==l.querySelector("parsererror")?l:null},n.prototype.parseCsv=function(n,l){n=this.splitNewLine(n).join("\n").trim();var e=t.parse(n,{header:l,encoding:"UTF-8",skipEmptyLines:!1});return null!=e.errors&&e.errors.length>0&&e.errors.forEach(function(n){console.warn("Error parsing row "+n.row+": "+n.message)}),e.data&&e.data.length>0?e.data:null},n.prototype.parseSingleRowCsv=function(n){if(this.isNullOrWhitespace(n))return null;var l=this.parseCsv(n,!1);return null!=l&&l.length>0&&l[0].length>0?l[0]:null},n.prototype.makeUriArray=function(n){var l=this;if(null==n)return null;if("string"==typeof n){var e=new i.LoginUriView;return e.uri=this.fixUri(n),this.isNullOrWhitespace(e.uri)?null:(e.match=null,[e])}if(n.length>0){var t=[];return n.forEach(function(n){var e=new i.LoginUriView;e.uri=l.fixUri(n),l.isNullOrWhitespace(e.uri)||(e.match=null,t.push(e))}),0===t.length?null:t}return null},n.prototype.fixUri=function(n){return null==n?null:(-1===(n=n.toLowerCase().trim()).indexOf("://")&&n.indexOf(".")>=0&&(n="http://"+n),n.length>1e3?n.substring(0,1e3):n)},n.prototype.nameFromUrl=function(n){var l=r.Utils.getHostname(n);return this.isNullOrWhitespace(l)?null:l.startsWith("www.")?l.replace("www.",""):l},n.prototype.isNullOrWhitespace=function(n){return null==n||""===n.trim()},n.prototype.getValueOrDefault=function(n,l){return void 0===l&&(l=null),this.isNullOrWhitespace(n)?l:n},n.prototype.splitNewLine=function(n){return n.split(this.newLineRegex)},n.prototype.getCardBrand=function(n){if(this.isNullOrWhitespace(n))return null;var l=new RegExp("^4");return null!=n.match(l)?"Visa":/^(5[1-5][0-9]{14}|2(22[1-9][0-9]{12}|2[3-9][0-9]{13}|[3-6][0-9]{14}|7[0-1][0-9]{13}|720[0-9]{12}))$/.test(n)?"Mastercard":(l=new RegExp("^3[47]"),null!=n.match(l)?"Amex":(l=new RegExp("^(6011|622(12[6-9]|1[3-9][0-9]|[2-8][0-9]{2}|9[0-1][0-9]|92[0-5]|64[4-9])|65)"),null!=n.match(l)?"Discover":(l=new RegExp("^36"),null!=n.match(l)?"Diners Club":(l=new RegExp("^30[0-5]"),null!=n.match(l)?"Diners Club":(l=new RegExp("^35(2[89]|[3-8][0-9])"),null!=n.match(l)?"JCB":(l=new RegExp("^(4026|417500|4508|4844|491(3|7))"),null!=n.match(l)?"Visa":null))))))},n.prototype.moveFoldersToCollections=function(n){n.folderRelationships.forEach(function(l){return n.collectionRelationships.push(l)}),n.collections=n.folders.map(function(n){var l=new o.CollectionView;return l.name=n.name,l}),n.folderRelationships=[],n.folders=[]},n.prototype.querySelectorDirectChild=function(n,l){var e=this.querySelectorAllDirectChild(n,l);return 0===e.length?null:e[0]},n.prototype.querySelectorAllDirectChild=function(n,l){return Array.from(n.querySelectorAll(l)).filter(function(l){return l.parentNode===n})},n.prototype.initLoginCipher=function(){var n=new u.CipherView;return n.favorite=!1,n.notes="",n.fields=[],n.login=new d.LoginView,n.type=p.CipherType.Login,n},n.prototype.cleanupCipher=function(n){null!=n&&(n.type!==p.CipherType.Login&&(n.login=null),this.isNullOrWhitespace(n.name)&&(n.name="--"),this.isNullOrWhitespace(n.notes)?n.notes=null:n.notes=n.notes.trim(),null!=n.fields&&0===n.fields.length&&(n.fields=null))},n.prototype.processKvp=function(n,l,e){if(!this.isNullOrWhitespace(e))if(this.isNullOrWhitespace(l)&&(l=""),e.length>200||e.trim().search(this.newLineRegex)>-1)null==n.notes&&(n.notes=""),n.notes+=l+": "+this.splitNewLine(e).join("\n")+"\n";else{null==n.fields&&(n.fields=[]);var t=new a.FieldView;t.type=f.FieldType.Text,t.name=l,t.value=e,n.fields.push(t)}},n.prototype.processFolder=function(n,l){var e=n.folders.length,t=!this.isNullOrWhitespace(l),u=t;if(t)for(var o=0;o-1&&(n="http://"+n),n.startsWith("http://")||n.startsWith("https://"))try{if(null!=o)return new o(n);if("function"==typeof URL)return new URL(n);if(null!=window){var l=window.document.createElement("a");return l.href=n,l}}catch(n){}return null},l.inited=!1,l.isNode=!1,l.isBrowser=!0,l.global=null,l}();l.Utils=i,i.init()}).call(this,e(223),e(103),e(295).Buffer)},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(){}}();l.FolderService=t},,,function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0}),function(n){n[n.Login=1]="Login",n[n.SecureNote=2]="SecureNote",n[n.Card=3]="Card",n[n.Identity=4]="Identity"}(l.CipherType||(l.CipherType={}))},,,,,,,function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){function n(){}return n.prototype.onClick=function(n){n.preventDefault()},n}();l.StopClickDirective=t},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(){}}();l.StateService=t},,,,,function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(){}}();l.SyncService=t},,,,,,,function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(){}}();l.PasswordVerificationRequest=t},,,,,,,,,function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0}),function(n){n[n.Authenticator=0]="Authenticator",n[n.Email=1]="Email",n[n.Duo=2]="Duo",n[n.Yubikey=3]="Yubikey",n[n.U2f=4]="U2f",n[n.Remember=5]="Remember",n[n.OrganizationDuo=6]="OrganizationDuo"}(l.TwoFactorProviderType||(l.TwoFactorProviderType={}))},,,,,function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});e(0);var t=function(){function n(n){this.el=n}return Object.defineProperty(n.prototype,"appAutofocus",{set:function(n){this.autofocus=""===n||!0===n},enumerable:!0,configurable:!0}),n.prototype.ngOnInit=function(){this.autofocus&&this.el.nativeElement.focus()},n}();l.AutofocusDirective=t},,,,function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){function n(n){n&&(this.type=n.type)}return Object.defineProperty(n.prototype,"subTitle",{get:function(){return null},enumerable:!0,configurable:!0}),n}();l.SecureNoteView=t},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){function n(){}return n.prototype.onClick=function(n){n.stopPropagation()},n}();l.StopPropDirective=t},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)});Object.defineProperty(l,"__esModule",{value:!0});var o=e(225),i=(e(0),function(n){function l(l){var e=n.call(this,l)||this;return e.el=null,e}return u(l,n),l.prototype.ngOnDestroy=function(){},l.prototype.show=function(n,l,e){var t=this;void 0===e&&(e=!0),this.parentContainer=l,this.fade=e;var u=this.componentFactoryResolver.resolveComponentFactory(n),i=this.container.createComponent(u),r=Array.from(document.querySelectorAll(".modal"));return r.length>0&&(this.el=o(r[0]),this.el.modal("show"),this.el.on("show.bs.modal",function(){t.onShow.emit()}),this.el.on("shown.bs.modal",function(){t.onShown.emit(),t.el.find("*[appAutoFocus]").focus()}),this.el.on("hide.bs.modal",function(){t.onClose.emit()}),this.el.on("hidden.bs.modal",function(){t.onClosed.emit(),null!=t.parentContainer&&t.parentContainer.clear()})),i.instance},l.prototype.close=function(){null!=this.el&&this.el.modal("hide")},l}(e(837).ModalComponent));l.ModalComponent=i},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(){}}();l.PasswordGenerationService=t},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(){}}();l.AuthService=t},,,,,function(n,l,e){"use strict";var t=this&&this.__awaiter||function(n,l,e,t){return new(e||(e=Promise))(function(u,o){function i(n){try{a(t.next(n))}catch(n){o(n)}}function r(n){try{a(t.throw(n))}catch(n){o(n)}}function a(n){n.done?u(n.value):new e(function(l){l(n.value)}).then(i,r)}a((t=t.apply(n,l||[])).next())})},u=this&&this.__generator||function(n,l){var e,t,u,o,i={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return o={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function r(o){return function(r){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;i;)try{if(e=1,t&&(u=t[2&o[0]?"return":o[0]?"throw":"next"])&&!(u=u.call(t,o[1])).done)return u;switch(t=0,u&&(o=[0,u.value]),o[0]){case 0:case 1:u=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,t=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(u=(u=i.trys).length>0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]-1?n[i]=r||null:n[i]=r?new o.CipherString(r):null}},n.prototype.buildDataModel=function(n,l,e,t){for(var u in void 0===t&&(t=[]),e)if(e.hasOwnProperty(u)){var o=n[e[u]||u];t.indexOf(u)>-1?l[u]=null!=o?o:null:l[u]=null!=o?o.encryptedString:null}},n.prototype.decryptObj=function(n,l,e){return t(this,void 0,void 0,function(){var t,o,i;return u(this,function(u){switch(u.label){case 0:for(i in t=[],o=this,l)l.hasOwnProperty(i)&&function(u){var i=Promise.resolve().then(function(){var n=l[u]||u;return o[n]?o[n].decrypt(e):null}).then(function(l){n[u]=l});t.push(i)}(i);return[4,Promise.all(t)];case 1:return u.sent(),[2,n]}})})},n}();l.default=i},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0}),function(n){n[n.Generic=0]="Generic"}(l.SecureNoteType||(l.SecureNoteType={}))},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){function n(){this.environmentUrlsKey=n.environmentUrlsKey,this.disableGaKey=n.disableGaKey,this.disableAddLoginNotificationKey=n.disableAddLoginNotificationKey,this.disableContextMenuItemKey=n.disableContextMenuItemKey,this.disableFaviconKey=n.disableFaviconKey,this.disableAutoTotpCopyKey=n.disableAutoTotpCopyKey,this.enableAutoFillOnPageLoadKey=n.enableAutoFillOnPageLoadKey,this.lockOptionKey=n.lockOptionKey,this.lastActiveKey=n.lastActiveKey,this.neverDomainsKey=n.neverDomainsKey,this.installedVersionKey=n.installedVersionKey,this.localeKey=n.localeKey,this.themeKey=n.themeKey}return n.environmentUrlsKey="environmentUrls",n.disableGaKey="disableGa",n.disableAddLoginNotificationKey="disableAddLoginNotification",n.disableContextMenuItemKey="disableContextMenuItem",n.disableFaviconKey="disableFavicon",n.disableAutoTotpCopyKey="disableAutoTotpCopy",n.enableAutoFillOnPageLoadKey="enableAutoFillOnPageLoad",n.lockOptionKey="lockOption",n.lastActiveKey="lastActive",n.neverDomainsKey="neverDomains",n.installedVersionKey="installedVersion",n.localeKey="locale",n.themeKey="theme",n}();l.ConstantsService=t},,,,,,,,,,,,function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=e(53),u=e(536),o=e(535),i=e(534),r=e(533),a=e(532),s=e(530),d=function(){return function(n,l,e){var d=this;if(null!=n){switch(this.id=n.id,this.organizationId=n.organizationId,this.folderId=n.folderId,this.userId=l,this.edit=n.edit,this.organizationUseTotp=n.organizationUseTotp,this.favorite=n.favorite,this.revisionDate=n.revisionDate,this.type=n.type,this.name=n.name,this.notes=n.notes,this.collectionIds=null!=e?e:n.collectionIds,this.type){case t.CipherType.Login:this.login=new a.LoginData(n.login);break;case t.CipherType.SecureNote:this.secureNote=new s.SecureNoteData(n.secureNote);break;case t.CipherType.Card:this.card=new o.CardData(n.card);break;case t.CipherType.Identity:this.identity=new r.IdentityData(n.identity)}null!=n.fields&&(this.fields=[],n.fields.forEach(function(n){d.fields.push(new i.FieldData(n))})),null!=n.attachments&&(this.attachments=[],n.attachments.forEach(function(n){d.attachments.push(new u.AttachmentData(n))}))}}}();l.CipherData=d},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){function n(n){this.expMonth=null,this._brand=null}return Object.defineProperty(n.prototype,"maskedCode",{get:function(){return null!=this.code?"•".repeat(this.code.length):null},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"brand",{get:function(){return this._brand},set:function(n){this._brand=n,this._subTitle=null},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"number",{get:function(){return this._number},set:function(n){this._number=n,this._subTitle=null},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"subTitle",{get:function(){return null==this._subTitle&&(this._subTitle=this.brand,null!=this.number&&this.number.length>=4&&(null!=this._subTitle&&""!==this._subTitle?this._subTitle+=", ":this._subTitle="",this._subTitle+="*"+this.number.substr(this.number.length-4))),this._subTitle},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"expiration",{get:function(){if(!this.expMonth&&!this.expYear)return null;var n=null!=this.expMonth?("0"+this.expMonth).slice(-2):"__";return n+=" / "+(null!=this.expYear?this.formatYear(this.expYear):"____")},enumerable:!0,configurable:!0}),n.prototype.formatYear=function(n){return 2===n.length?"20"+n:n},n}();l.CardView=t},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});e(0),e(42);var t=function(){function n(n){this.sanitizer=n,this.width=45,this.height=45,this.charCount=2,this.textColor="#ffffff",this.fontSize=20,this.fontWeight=300,this.dynamic=!1,this.circle=!1}return n.prototype.ngOnInit=function(){this.dynamic||this.generate()},n.prototype.ngOnChanges=function(){this.dynamic&&this.generate()},n.prototype.generate=function(){var n=null,l=this.data.toUpperCase();this.charCount>1&&(n=this.getFirstLetters(l,this.charCount)),null==n&&(n=l.substr(0,this.charCount));var e=this.getCharText(n),t=this.stringToColor(l),u=this.getSvg(this.width,this.height,t);u.appendChild(e);var o=window.document.createElement("div").appendChild(u).outerHTML,i=window.btoa(unescape(encodeURIComponent(o)));this.src="data:image/svg+xml;base64,"+i},n.prototype.stringToColor=function(n){for(var l=0,e=0;e>8*e&255).toString(16)).substr(-2)}return t},n.prototype.getFirstLetters=function(n,l){var e=n.split(" ");if(e.length>1){for(var t="",u=0;u0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]-1&&window.document.body.removeChild(n)}),!this.hidePaypal){window.document.head.removeChild(this.btScript);var n=window.document.head.querySelector("#braintree-dropin-stylesheet");null!=n&&window.document.head.removeChild(n)}},n.prototype.changeMethod=function(){var n=this;"paypal"===this.method?window.setTimeout(function(){window.braintree.dropin.create({authorization:n.platformUtilsService.isDev()?t.btSandbox:t.btProduction,container:"#bt-dropin-container",paymentOptionPriority:["paypal"],paypal:{flow:"vault",buttonStyle:{label:"pay",size:"medium",shape:"pill",color:"blue"}}},function(l,e){null==l?n.btInstance=e:console.error(l)})},250):this.btInstance=null},n.prototype.createPaymentToken=function(){var n=this;return new Promise(function(l,e){if("paypal"===n.method)n.btInstance.requestPaymentMethod().then(function(n){l(n.nonce)}).catch(function(n){e(n.message)});else if("card"===n.method||"bank"===n.method){var t="card"===n.method?window.Stripe.card:window.Stripe.bankAccount,u="card"===n.method?n.card:n.bank;t.createToken(u,function(n,t){200===n&&null!=t.id?l(t.id):null!=t.error?e(t.error.message):e()})}})},n.prototype.getCountry=function(){return this.card.address_country},n}();l.PaymentComponent=u},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(n){this.id=null,n&&(this.id=n.id)}}();l.FolderView=t},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(){}}();l.AuditService=t},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=e(0),u=e(5),o=e(116),i=e(42),r=t.ɵcrt({encapsulation:2,styles:[],data:{}});function a(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,2,"img",[],[[8,"src",4],[8,"title",0]],null,null,null,null)),t.ɵdid(1,278528,null,0,u.NgClass,[t.IterableDiffers,t.KeyValueDiffers,t.ElementRef,t.Renderer2],{ngClass:[0,"ngClass"]},null),t.ɵpod(2,{"rounded-circle":0})],function(n,l){n(l,1,0,n(l,2,0,l.component.circle))},function(n,l){var e=l.component;n(l,0,0,e.sanitizer.bypassSecurityTrustResourceUrl(e.src),t.ɵinlineInterpolate(1,"",e.data,""))})}function s(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"app-avatar",[],null,null,null,a,r)),t.ɵdid(1,638976,null,0,o.AvatarComponent,[i.DomSanitizer],null,null)],function(n,l){n(l,1,0)},null)}l.RenderType_AvatarComponent=r,l.View_AvatarComponent_0=a,l.View_AvatarComponent_Host_0=s;var d=t.ɵccf("app-avatar",o.AvatarComponent,s,{data:"data",width:"width",height:"height",charCount:"charCount",textColor:"textColor",fontSize:"fontSize",fontWeight:"fontWeight",dynamic:"dynamic",circle:"circle"},{},[]);l.AvatarComponentNgFactory=d},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(){}}();l.EnvironmentService=t},,,,,,,,,,,,,,,,,,,,,,function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=e(0),u=e(7),o=e(2),i=e(13),r=e(18),a=e(17),s=e(46),d=e(125),c=e(4),p=e(9),f=e(20),v=t.ɵcrt({encapsulation:2,styles:[],data:{}});function h(n){return t.ɵvid(0,[t.ɵpid(0,u.I18nPipe,[o.I18nService]),(n()(),t.ɵeld(1,0,[["form",1]],null,43,"form",[["ngNativeValidate",""]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngSubmit"],[null,"submit"],[null,"reset"]],function(n,l,e){var u=!0,o=n.component;"submit"===l&&(u=!1!==t.ɵnov(n,2).onSubmit(e)&&u);"reset"===l&&(u=!1!==t.ɵnov(n,2).onReset()&&u);"ngSubmit"===l&&(u=!1!==o.submit()&&u);return u},null,null)),t.ɵdid(2,4210688,null,0,i.NgForm,[[8,null],[8,null]],null,{ngSubmit:"ngSubmit"}),t.ɵprd(2048,null,i.ControlContainer,null,[i.NgForm]),t.ɵdid(4,16384,null,0,i.NgControlStatusGroup,[i.ControlContainer],null,null),t.ɵdid(5,540672,null,0,r.ApiActionDirective,[t.ElementRef,a.ValidationService],{appApiAction:[0,"appApiAction"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(7,0,null,null,19,"div",[["class","modal-body"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(9,0,null,null,2,"p",[],null,null,null,null,null)),(n()(),t.ɵted(10,null,["",""])),t.ɵppd(11,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(13,0,null,null,2,"label",[["for","masterPassword"]],null,null,null,null,null)),(n()(),t.ɵted(14,null,["",""])),t.ɵppd(15,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(17,0,null,null,8,"input",[["appAutoFocus",""],["appInputVerbatim",""],["class","form-control"],["id","masterPassword"],["name","MasterPasswordHash"],["required",""],["type","password"]],[[1,"required",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(n,l,e){var u=!0,o=n.component;"input"===l&&(u=!1!==t.ɵnov(n,18)._handleInput(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,18).onTouched()&&u);"compositionstart"===l&&(u=!1!==t.ɵnov(n,18)._compositionStart()&&u);"compositionend"===l&&(u=!1!==t.ɵnov(n,18)._compositionEnd(e.target.value)&&u);"ngModelChange"===l&&(u=!1!==(o.masterPassword=e)&&u);return u},null,null)),t.ɵdid(18,16384,null,0,i.DefaultValueAccessor,[t.Renderer2,t.ElementRef,[2,i.COMPOSITION_BUFFER_MODE]],null,null),t.ɵdid(19,16384,null,0,i.RequiredValidator,[],{required:[0,"required"]},null),t.ɵprd(1024,null,i.NG_VALIDATORS,function(n){return[n]},[i.RequiredValidator]),t.ɵprd(1024,null,i.NG_VALUE_ACCESSOR,function(n){return[n]},[i.DefaultValueAccessor]),t.ɵdid(22,671744,null,0,i.NgModel,[[2,i.ControlContainer],[2,i.NG_VALIDATORS],[8,null],[2,i.NG_VALUE_ACCESSOR]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,i.NgControl,null,[i.NgModel]),t.ɵdid(24,16384,null,0,i.NgControlStatus,[i.NgControl],null,null),t.ɵdid(25,81920,null,0,s.InputVerbatimDirective,[t.ElementRef,t.Renderer2],{appInputVerbatim:[0,"appInputVerbatim"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(28,0,null,null,15,"div",[["class","modal-footer"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(30,0,null,null,8,"button",[["class","btn btn-primary btn-submit"],["type","submit"]],[[8,"disabled",0]],null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(32,0,null,null,1,"i",[["class","fa fa-spinner fa-spin"]],[[8,"title",0]],null,null,null,null)),t.ɵppd(33,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(35,0,null,null,2,"span",[],null,null,null,null,null)),(n()(),t.ɵted(36,null,["",""])),t.ɵppd(37,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(40,0,null,null,2,"button",[["class","btn btn-outline-secondary"],["data-dismiss","modal"],["type","button"]],null,null,null,null,null)),(n()(),t.ɵted(41,null,["",""])),t.ɵppd(42,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){var e=l.component;n(l,5,0,e.formPromise);n(l,19,0,"");n(l,22,0,"MasterPasswordHash",e.masterPassword);n(l,25,0,"")},function(n,l){n(l,1,0,t.ɵnov(l,4).ngClassUntouched,t.ɵnov(l,4).ngClassTouched,t.ɵnov(l,4).ngClassPristine,t.ɵnov(l,4).ngClassDirty,t.ɵnov(l,4).ngClassValid,t.ɵnov(l,4).ngClassInvalid,t.ɵnov(l,4).ngClassPending),n(l,10,0,t.ɵunv(l,10,0,n(l,11,0,t.ɵnov(l,0),"twoStepLoginAuthDesc"))),n(l,14,0,t.ɵunv(l,14,0,n(l,15,0,t.ɵnov(l,0),"masterPass"))),n(l,17,0,t.ɵnov(l,19).required?"":null,t.ɵnov(l,24).ngClassUntouched,t.ɵnov(l,24).ngClassTouched,t.ɵnov(l,24).ngClassPristine,t.ɵnov(l,24).ngClassDirty,t.ɵnov(l,24).ngClassValid,t.ɵnov(l,24).ngClassInvalid,t.ɵnov(l,24).ngClassPending),n(l,30,0,t.ɵnov(l,1).loading),n(l,32,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,32,0,n(l,33,0,t.ɵnov(l,0),"loading")),"")),n(l,36,0,t.ɵunv(l,36,0,n(l,37,0,t.ɵnov(l,0),"continue"))),n(l,41,0,t.ɵunv(l,41,0,n(l,42,0,t.ɵnov(l,0),"close")))})}function g(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"app-two-factor-verify",[],null,null,null,h,v)),t.ɵdid(1,49152,null,0,d.TwoFactorVerifyComponent,[c.ApiService,o.I18nService,p.ToasterService,f.CryptoService],null,null)],null,null)}l.RenderType_TwoFactorVerifyComponent=v,l.View_TwoFactorVerifyComponent_0=h,l.View_TwoFactorVerifyComponent_Host_0=g;var m=t.ɵccf("app-two-factor-verify",d.TwoFactorVerifyComponent,g,{type:"type",organizationId:"organizationId"},{onAuthed:"onAuthed"},[]);l.TwoFactorVerifyComponentNgFactory=m},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)}),o=this&&this.__awaiter||function(n,l,e,t){return new(e||(e=Promise))(function(u,o){function i(n){try{a(t.next(n))}catch(n){o(n)}}function r(n){try{a(t.throw(n))}catch(n){o(n)}}function a(n){n.done?u(n.value):new e(function(l){l(n.value)}).then(i,r)}a((t=t.apply(n,l||[])).next())})},i=this&&this.__generator||function(n,l){var e,t,u,o,i={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return o={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function r(o){return function(r){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;i;)try{if(e=1,t&&(u=t[2&o[0]?"return":o[0]?"throw":"next"])&&!(u=u.call(t,o[1])).done)return u;switch(t=0,u&&(o=[0,u.value]),o[0]){case 0:case 1:u=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,t=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(u=(u=i.trys).length>0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0?(a=[],[4,this.attachments.reduce(function(n,l){return n.then(function(){return l.decrypt(o)}).then(function(n){a.push(n)})},Promise.resolve())]):[3,13];case 12:i.sent(),n.attachments=a,i.label=13;case 13:return null!=this.fields&&this.fields.length>0?(d=[],[4,this.fields.reduce(function(n,l){return n.then(function(){return l.decrypt(o)}).then(function(n){d.push(n)})},Promise.resolve())]):[3,15];case 14:i.sent(),n.fields=d,i.label=15;case 15:return[2,n]}})})},l.prototype.toCipherData=function(n){var l=new a.CipherData;switch(l.id=this.id,l.organizationId=this.organizationId,l.folderId=this.folderId,l.userId=null!=this.organizationId?n:null,l.edit=this.edit,l.organizationUseTotp=this.organizationUseTotp,l.favorite=this.favorite,l.revisionDate=this.revisionDate,l.type=this.type,l.collectionIds=this.collectionIds,this.buildDataModel(this,l,{name:null,notes:null}),l.type){case r.CipherType.Login:l.login=this.login.toLoginData();break;case r.CipherType.SecureNote:l.secureNote=this.secureNote.toSecureNoteData();break;case r.CipherType.Card:l.card=this.card.toCardData();break;case r.CipherType.Identity:l.identity=this.identity.toIdentityData()}return null!=this.fields&&(l.fields=[],this.fields.forEach(function(n){l.fields.push(n.toFieldData())})),null!=this.attachments&&(l.attachments=[],this.attachments.forEach(function(n){l.attachments.push(n.toAttachmentData())})),l},l}(p.default);l.Cipher=m},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)});Object.defineProperty(l,"__esModule",{value:!0});var o=e(177),i=function(n){function l(l,e){void 0===e&&(e=!1);var t=n.call(this)||this;return null==l?t:(t.buildDomainModel(t,l,{id:null,organizationId:null,name:null,readOnly:null},e,["id","organizationId","readOnly"]),t)}return u(l,n),l.prototype.decrypt=function(){return this.decryptObj(new o.CollectionView(this),{name:null},this.organizationId)},l}(e(100).default);l.Collection=i},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){function n(n){}return Object.defineProperty(n.prototype,"uri",{get:function(){return this.hasUris?this.uris[0].uri:null},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"maskedPassword",{get:function(){return null!=this.password?"••••••••":null},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"subTitle",{get:function(){return this.username},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"canLaunch",{get:function(){return this.hasUris&&this.uris[0].canLaunch},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"hasUris",{get:function(){return null!=this.uris&&this.uris.length>0},enumerable:!0,configurable:!0}),n}();l.LoginView=t},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=e(53),u=function(){function n(n){this.favorite=!1,this.organizationUseTotp=!1,this.edit=!1,n&&(this.id=n.id,this.organizationId=n.organizationId,this.folderId=n.folderId,this.favorite=n.favorite,this.organizationUseTotp=n.organizationUseTotp,this.edit=n.edit,this.type=n.type,this.localData=n.localData,this.collectionIds=n.collectionIds)}return Object.defineProperty(n.prototype,"subTitle",{get:function(){switch(this.type){case t.CipherType.Login:return this.login.subTitle;case t.CipherType.SecureNote:return this.secureNote.subTitle;case t.CipherType.Card:return this.card.subTitle;case t.CipherType.Identity:return this.identity.subTitle}return null},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"hasAttachments",{get:function(){return this.attachments&&this.attachments.length>0},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"hasFields",{get:function(){return this.fields&&this.fields.length>0},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"login_username",{get:function(){return null!=this.login?this.login.username:null},enumerable:!0,configurable:!0}),n}();l.CipherView=u},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=e(53),u=function(){return function(n){var l=this;switch(this.type=n.type,this.folderId=n.folderId,this.organizationId=n.organizationId,this.name=n.name?n.name.encryptedString:null,this.notes=n.notes?n.notes.encryptedString:null,this.favorite=n.favorite,this.type){case t.CipherType.Login:this.login={uris:null,username:n.login.username?n.login.username.encryptedString:null,password:n.login.password?n.login.password.encryptedString:null,totp:n.login.totp?n.login.totp.encryptedString:null},n.login.uris&&(this.login.uris=[],n.login.uris.forEach(function(n){l.login.uris.push({uri:n.uri?n.uri.encryptedString:null,match:null!=n.match?n.match:null})}));break;case t.CipherType.SecureNote:this.secureNote={type:n.secureNote.type};break;case t.CipherType.Card:this.card={cardholderName:n.card.cardholderName?n.card.cardholderName.encryptedString:null,brand:n.card.brand?n.card.brand.encryptedString:null,number:n.card.number?n.card.number.encryptedString:null,expMonth:n.card.expMonth?n.card.expMonth.encryptedString:null,expYear:n.card.expYear?n.card.expYear.encryptedString:null,code:n.card.code?n.card.code.encryptedString:null};break;case t.CipherType.Identity:this.identity={title:n.identity.title?n.identity.title.encryptedString:null,firstName:n.identity.firstName?n.identity.firstName.encryptedString:null,middleName:n.identity.middleName?n.identity.middleName.encryptedString:null,lastName:n.identity.lastName?n.identity.lastName.encryptedString:null,address1:n.identity.address1?n.identity.address1.encryptedString:null,address2:n.identity.address2?n.identity.address2.encryptedString:null,address3:n.identity.address3?n.identity.address3.encryptedString:null,city:n.identity.city?n.identity.city.encryptedString:null,state:n.identity.state?n.identity.state.encryptedString:null,postalCode:n.identity.postalCode?n.identity.postalCode.encryptedString:null,country:n.identity.country?n.identity.country.encryptedString:null,company:n.identity.company?n.identity.company.encryptedString:null,email:n.identity.email?n.identity.email.encryptedString:null,phone:n.identity.phone?n.identity.phone.encryptedString:null,ssn:n.identity.ssn?n.identity.ssn.encryptedString:null,username:n.identity.username?n.identity.username.encryptedString:null,passportNumber:n.identity.passportNumber?n.identity.passportNumber.encryptedString:null,licenseNumber:n.identity.licenseNumber?n.identity.licenseNumber.encryptedString:null}}n.fields&&(this.fields=[],n.fields.forEach(function(n){l.fields.push({type:n.type,name:n.name?n.name.encryptedString:null,value:n.value?n.value.encryptedString:null})})),n.attachments&&(this.attachments={},n.attachments.forEach(function(n){l.attachments[n.id]=n.fileName?n.fileName.encryptedString:null}))}}();l.CipherRequest=u},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0}),function(n){n[n.Android=0]="Android",n[n.iOS=1]="iOS",n[n.ChromeExtension=2]="ChromeExtension",n[n.FirefoxExtension=3]="FirefoxExtension",n[n.OperaExtension=4]="OperaExtension",n[n.EdgeExtension=5]="EdgeExtension",n[n.WindowsDesktop=6]="WindowsDesktop",n[n.MacOsDesktop=7]="MacOsDesktop",n[n.LinuxDesktop=8]="LinuxDesktop",n[n.ChromeBrowser=9]="ChromeBrowser",n[n.FirefoxBrowser=10]="FirefoxBrowser",n[n.OperaBrowser=11]="OperaBrowser",n[n.EdgeBrowser=12]="EdgeBrowser",n[n.IEBrowser=13]="IEBrowser",n[n.UnknownBrowser=14]="UnknownBrowser",n[n.AndroidAmazon=15]="AndroidAmazon",n[n.UWP=16]="UWP",n[n.SafariBrowser=17]="SafariBrowser",n[n.VivaldiBrowser=18]="VivaldiBrowser",n[n.VivaldiExtension=19]="VivaldiExtension",n[n.SafariExtension=20]="SafariExtension"}(l.DeviceType||(l.DeviceType={}))},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){function n(){this.subscribers=new Map}return n.prototype.send=function(n,l){null==l?this.subscribers.forEach(function(l){l(n)}):this.subscribers.has(l)&&this.subscribers.get(l)(n)},n.prototype.subscribe=function(n,l){this.subscribers.has(n)||this.subscribers.set(n,l)},n.prototype.unsubscribe=function(n){this.subscribers.has(n)&&this.subscribers.delete(n)},n}();l.BroadcasterService=t},,,,,,,,,,,,,,function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0}),function(n){n[n.Owner=0]="Owner",n[n.Admin=1]="Admin",n[n.User=2]="User"}(l.OrganizationUserType||(l.OrganizationUserType={}))},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});e(2);var t=e(159),u=e(727),o=function(){function n(n){this.i18nService=n}return n.prototype.getDefaultDateFilters=function(){var n=new Date,l=new Date(n.getFullYear(),n.getMonth(),n.getDate(),23,59);n.setDate(n.getDate()-30);var e=new Date(n.getFullYear(),n.getMonth(),n.getDate(),0,0);return[this.toDateTimeLocalString(e),this.toDateTimeLocalString(l)]},n.prototype.formatDateFilters=function(n,l){var e=new Date(n),t=new Date(l+":59.999");if(isNaN(e.getTime())||isNaN(t.getTime())||t"+e+"";var t=this.makeAnchor(e);return t.setAttribute("href","#/organizations/"+n.organizationId+"/vault?search="+e+"&viewEvents="+n.cipherId),t.outerHTML},n.prototype.formatGroupId=function(n){var l=this.getShortId(n.groupId),e=this.makeAnchor(l);return e.setAttribute("href","#/organizations/"+n.organizationId+"/manage/groups?search="+l),e.outerHTML},n.prototype.formatCollectionId=function(n){var l=this.getShortId(n.collectionId),e=this.makeAnchor(l);return e.setAttribute("href","#/organizations/"+n.organizationId+"/manage/collections?search="+l),e.outerHTML},n.prototype.formatOrgUserId=function(n){var l=this.getShortId(n.organizationUserId),e=this.makeAnchor(l);return e.setAttribute("href","#/organizations/"+n.organizationId+"/manage/people?search="+l+"&viewEvents="+n.organizationUserId),e.outerHTML},n.prototype.makeAnchor=function(n){var l=document.createElement("a");return l.title=this.i18nService.t("view"),l.innerHTML=""+n+"",l},n.prototype.getShortId=function(n){return n.substring(0,8)},n.prototype.toDateTimeLocalString=function(n){return n.getFullYear()+"-"+this.pad(n.getMonth()+1)+"-"+this.pad(n.getDate())+"T"+this.pad(n.getHours())+":"+this.pad(n.getMinutes())},n.prototype.pad=function(n){var l=Math.floor(Math.abs(n));return(l<10?"0":"")+l},n}();l.EventService=o;var i=function(){return function(){}}();l.EventInfo=i;var r=function(){return function(){this.cipherInfo=!0}}();l.EventOptions=r},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(){}}();l.ExportService=t},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(n){n&&(this.id=n.id,this.organizationId=n.organizationId,this.readOnly=n.readOnly)}}();l.CollectionView=t},function(n,l,e){"use strict";var t=this&&this.__awaiter||function(n,l,e,t){return new(e||(e=Promise))(function(u,o){function i(n){try{a(t.next(n))}catch(n){o(n)}}function r(n){try{a(t.throw(n))}catch(n){o(n)}}function a(n){n.done?u(n.value):new e(function(l){l(n.value)}).then(i,r)}a((t=t.apply(n,l||[])).next())})},u=this&&this.__generator||function(n,l){var e,t,u,o,i={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return o={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function r(o){return function(r){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;i;)try{if(e=1,t&&(u=t[2&o[0]?"return":o[0]?"throw":"next"])&&!(u=u.call(t,o[1])).done)return u;switch(t=0,u&&(o=[0,u.value]),o[0]){case 0:case 1:u=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,t=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(u=(u=i.trys).length>0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0))return[3,4];u.label=1;case 1:return u.trys.push([1,3,,4]),[4,this.getFileContents(e[0])];case 2:return null!=(o=u.sent())&&(t=o),[3,4];case 3:return u.sent(),[3,4];case 4:return null==t||""===t?(this.toasterService.popAsync("error",this.i18nService.t("errorOccurred"),this.i18nService.t("selectFile")),[2]):[4,n.parse(t)];case 5:if(!(i=u.sent()).success)return[3,10];if(0===i.folders.length&&0===i.ciphers.length)return this.error(this.i18nService.t("importNothingError")),[2];if(i.ciphers.length>0&&(r=Math.floor(i.ciphers.length/2),a=i.ciphers.length-1,this.badData(i.ciphers[0])&&this.badData(i.ciphers[r])&&this.badData(i.ciphers[a])))return this.error(this.i18nService.t("importFormatError")),[2];u.label=6;case 6:return u.trys.push([6,8,,9]),this.formPromise=this.postImport(i),[4,this.formPromise];case 7:return u.sent(),this.analytics.eventTrack.next({action:"Imported Data",properties:{label:this.format}}),this.toasterService.popAsync("success",null,this.i18nService.t("importSuccess")),this.router.navigate(this.successNavigate),[3,9];case 8:return u.sent(),[3,9];case 9:return[3,11];case 10:this.error(this.i18nService.t("importFormatError")),u.label=11;case 11:return[2]}})})},n.prototype.getFormatInstructionTitle=function(){var n=this;if(null==this.format)return null;var l=this.featuredImportOptions.concat(this.importOptions).filter(function(l){return l.id===n.format});return l.length>0?this.i18nService.t("instructionsFor",l[0].name):null},n.prototype.postImport=function(n){return t(this,void 0,void 0,function(){var l,e,t,s;return u(this,function(u){switch(u.label){case 0:l=new r.ImportCiphersRequest,t=0,u.label=1;case 1:return t0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]-1},enumerable:!0,configurable:!0}),n}();l.LoginUriView=u},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){function n(n){this.title=null}return Object.defineProperty(n.prototype,"firstName",{get:function(){return this._firstName},set:function(n){this._firstName=n,this._subTitle=null},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"lastName",{get:function(){return this._lastName},set:function(n){this._lastName=n,this._subTitle=null},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"subTitle",{get:function(){return null!=this._subTitle||null==this.firstName&&null==this.lastName||(this._subTitle="",null!=this.firstName&&(this._subTitle=this.firstName),null!=this.lastName&&(""!==this._subTitle&&(this._subTitle+=" "),this._subTitle+=this.lastName)),this._subTitle},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"fullName",{get:function(){if(null!=this.title||null!=this.firstName||null!=this.middleName||null!=this.lastName){var n="";return null!=this.title&&(n+=this.title+" "),null!=this.firstName&&(n+=this.firstName+" "),null!=this.middleName&&(n+=this.middleName+" "),null!=this.lastName&&(n+=this.lastName),n.trim()}return null},enumerable:!0,configurable:!0}),n}();l.IdentityView=t},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)}),o=this&&this.__awaiter||function(n,l,e,t){return new(e||(e=Promise))(function(u,o){function i(n){try{a(t.next(n))}catch(n){o(n)}}function r(n){try{a(t.throw(n))}catch(n){o(n)}}function a(n){n.done?u(n.value):new e(function(l){l(n.value)}).then(i,r)}a((t=t.apply(n,l||[])).next())})},i=this&&this.__generator||function(n,l){var e,t,u,o,i={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return o={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function r(o){return function(r){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;i;)try{if(e=1,t&&(u=t[2&o[0]?"return":o[0]?"throw":"next"])&&!(u=u.call(t,o[1])).done)return u;switch(t=0,u&&(o=[0,u.value]),o[0]){case 0:case 1:u=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,t=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(u=(u=i.trys).length>0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]500?500:this.ciphers.length,e=0;e0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]t){if(o===i.TwoFactorProviderType.U2f&&!n)return;e=o,t=r.priority}}),e},n.prototype.logInHelper=function(n,l,e,t,c,p){return u(this,void 0,void 0,function(){var u,f,v,h,g,m,y,C,b,S;return o(this,function(o){switch(o.label){case 0:return[4,this.tokenService.getTwoFactorToken(n)];case 1:return u=o.sent(),[4,this.appIdService.getAppId()];case 2:return f=o.sent(),v=new a.DeviceRequest(f,this.platformUtilsService),h=null!=c&&null!=t?new d.TokenRequest(n,l,t,c,p,v):null!=u?new d.TokenRequest(n,l,i.TwoFactorProviderType.Remember,u,!1,v):new d.TokenRequest(n,l,null,null,!1,v),[4,this.apiService.postIdentityToken(h)];case 3:return g=o.sent(),this.clearState(),(m=new r.AuthResult).twoFactor=!g.accessToken,m.twoFactor?(y=g,this.email=n,this.masterPasswordHash=l,this.key=this.setCryptoKeys?e:null,this.twoFactorProviders=y.twoFactorProviders2,m.twoFactorProviders=y.twoFactorProviders2,[2,m]):(null!=(C=g).twoFactorToken&&this.tokenService.setTwoFactorToken(C.twoFactorToken,n),[4,this.tokenService.setTokens(C.accessToken,C.refreshToken)]);case 4:return o.sent(),[4,this.userService.setUserIdAndEmail(this.tokenService.getUserId(),this.tokenService.getEmail())];case 5:return o.sent(),this.setCryptoKeys?[4,this.cryptoService.setKey(e)]:[3,15];case 6:return o.sent(),[4,this.cryptoService.setKeyHash(l)];case 7:return o.sent(),[4,this.cryptoService.setEncKey(C.key)];case 8:if(o.sent(),null!=C.privateKey)return[3,13];o.label=9;case 9:return o.trys.push([9,12,,13]),[4,this.cryptoService.makeKeyPair()];case 10:return b=o.sent(),[4,this.apiService.postAccountKeys(new s.KeysRequest(b[0],b[1].encryptedString))];case 11:return o.sent(),C.privateKey=b[1].encryptedString,[3,13];case 12:return S=o.sent(),console.error(S),[3,13];case 13:return[4,this.cryptoService.setEncPrivateKey(C.privateKey)];case 14:o.sent(),o.label=15;case 15:return this.messagingService.send("loggedIn"),[2,m]}})})},n.prototype.clearState=function(){this.email=null,this.masterPasswordHash=null,this.twoFactorProviders=null,this.selectedTwoFactorProviderType=null},n}();l.AuthService=c},,,,,,,,,,,,,,,function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(n){this.id=n.Id,this.readOnly=n.ReadOnly}}();l.SelectionReadOnlyResponse=t},function(n,l,e){"use strict";var t=this&&this.__awaiter||function(n,l,e,t){return new(e||(e=Promise))(function(u,o){function i(n){try{a(t.next(n))}catch(n){o(n)}}function r(n){try{a(t.throw(n))}catch(n){o(n)}}function a(n){n.done?u(n.value):new e(function(l){l(n.value)}).then(i,r)}a((t=t.apply(n,l||[])).next())})},u=this&&this.__generator||function(n,l){var e,t,u,o,i={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return o={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function r(o){return function(r){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;i;)try{if(e=1,t&&(u=t[2&o[0]?"return":o[0]?"throw":"next"])&&!(u=u.call(t,o[1])).done)return u;switch(t=0,u&&(o=[0,u.value]),o[0]){case 0:case 1:u=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,t=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(u=(u=i.trys).length>0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&l[0].status===i.OrganizationUserStatusType.Confirmed&&this.events(l[0]),[2]})})}),[2]}})})}),[2]})})},n.prototype.load=function(){return t(this,void 0,void 0,function(){var n,l=this;return u(this,function(e){switch(e.label){case 0:return[4,this.apiService.getOrganizationUsers(this.organizationId)];case 1:return n=e.sent(),this.statusMap.clear(),this.allUsers=null!=n.data&&n.data.length>0?n.data:[],this.allUsers.sort(a.Utils.getSortFunction(this.i18nService,"email")),this.allUsers.forEach(function(n){l.statusMap.has(n.status)?l.statusMap.get(n.status).push(n):l.statusMap.set(n.status,[n])}),this.filter(this.status),this.loading=!1,[2]}})})},n.prototype.filter=function(n){this.status=n,null!=this.status?this.users=this.statusMap.get(this.status):this.users=this.allUsers},Object.defineProperty(n.prototype,"invitedCount",{get:function(){return this.statusMap.has(i.OrganizationUserStatusType.Invited)?this.statusMap.get(i.OrganizationUserStatusType.Invited).length:0},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"acceptedCount",{get:function(){return this.statusMap.has(i.OrganizationUserStatusType.Accepted)?this.statusMap.get(i.OrganizationUserStatusType.Accepted).length:0},enumerable:!0,configurable:!0}),n.prototype.edit=function(n){var l=this;null!=this.modal&&this.modal.close();var e=this.componentFactoryResolver.resolveComponentFactory(s.ModalComponent);this.modal=this.addEditModalRef.createComponent(e).instance;var t=this.modal.show(c.UserAddEditComponent,this.addEditModalRef);t.name=null!=n?n.name||n.email:null,t.organizationId=this.organizationId,t.organizationUserId=null!=n?n.id:null,t.onSavedUser.subscribe(function(){l.modal.close(),l.load()}),t.onDeletedUser.subscribe(function(){l.modal.close(),l.removeUser(n)}),this.modal.onClosed.subscribe(function(){l.modal=null})},n.prototype.invite=function(){this.edit(null)},n.prototype.groups=function(n){var l=this;null!=this.modal&&this.modal.close();var e=this.componentFactoryResolver.resolveComponentFactory(s.ModalComponent);this.modal=this.groupsModalRef.createComponent(e).instance;var t=this.modal.show(p.UserGroupsComponent,this.groupsModalRef);t.name=null!=n?n.name||n.email:null,t.organizationId=this.organizationId,t.organizationUserId=null!=n?n.id:null,t.onSavedUser.subscribe(function(){l.modal.close()}),this.modal.onClosed.subscribe(function(){l.modal=null})},n.prototype.remove=function(n){return t(this,void 0,void 0,function(){return u(this,function(l){switch(l.label){case 0:return[4,this.platformUtilsService.showDialog(this.i18nService.t("removeUserConfirmation"),n.name||n.email,this.i18nService.t("yes"),this.i18nService.t("no"),"warning")];case 1:if(!l.sent())return[2,!1];l.label=2;case 2:return l.trys.push([2,4,,5]),[4,this.apiService.deleteOrganizationUser(this.organizationId,n.id)];case 3:return l.sent(),this.analytics.eventTrack.next({action:"Deleted User"}),this.toasterService.popAsync("success",null,this.i18nService.t("removedUserId",n.name||n.email)),this.removeUser(n),[3,5];case 4:return l.sent(),[3,5];case 5:return[2]}})})},n.prototype.reinvite=function(n){return t(this,void 0,void 0,function(){return u(this,function(l){switch(l.label){case 0:return null!=this.actionPromise?[2]:(this.actionPromise=this.apiService.postOrganizationUserReinvite(this.organizationId,n.id),[4,this.actionPromise]);case 1:return l.sent(),this.analytics.eventTrack.next({action:"Reinvited User"}),this.toasterService.popAsync("success",null,this.i18nService.t("hasBeenReinvited",n.name||n.email)),this.actionPromise=null,[2]}})})},n.prototype.confirm=function(n){return t(this,void 0,void 0,function(){return u(this,function(l){switch(l.label){case 0:return null!=this.actionPromise?[2]:(this.actionPromise=this.doConfirmation(n),[4,this.actionPromise]);case 1:return l.sent(),n.status=i.OrganizationUserStatusType.Confirmed,this.analytics.eventTrack.next({action:"Confirmed User"}),this.toasterService.popAsync("success",null,this.i18nService.t("hasBeenConfirmed",n.name||n.email)),this.actionPromise=null,[2]}})})},n.prototype.events=function(n){return t(this,void 0,void 0,function(){var l,e,t=this;return u(this,function(u){return null!=this.modal&&this.modal.close(),l=this.componentFactoryResolver.resolveComponentFactory(s.ModalComponent),this.modal=this.eventsModalRef.createComponent(l).instance,(e=this.modal.show(d.EntityEventsComponent,this.eventsModalRef)).name=n.name||n.email,e.organizationId=this.organizationId,e.entityId=n.id,e.showUser=!1,e.entity="user",this.modal.onClosed.subscribe(function(){t.modal=null}),[2]})})},n.prototype.doConfirmation=function(n){return t(this,void 0,void 0,function(){var l,e,t,i,r;return u(this,function(u){switch(u.label){case 0:return[4,this.cryptoService.getOrgKey(this.organizationId)];case 1:return l=u.sent(),[4,this.apiService.getUserPublicKey(n.userId)];case 2:return e=u.sent(),t=a.Utils.fromB64ToArray(e.publicKey),[4,this.cryptoService.rsaEncrypt(l.key,t.buffer)];case 3:return i=u.sent(),(r=new o.OrganizationUserConfirmRequest).key=i.encryptedString,[4,this.apiService.postOrganizationUserConfirm(this.organizationId,n.id,r)];case 4:return u.sent(),[2]}})})},n.prototype.removeUser=function(n){var l=this.users.indexOf(n);l>-1&&this.users.splice(l,1)},n}();l.PeopleComponent=f},function(n,l,e){"use strict";var t=this&&this.__awaiter||function(n,l,e,t){return new(e||(e=Promise))(function(u,o){function i(n){try{a(t.next(n))}catch(n){o(n)}}function r(n){try{a(t.throw(n))}catch(n){o(n)}}function a(n){n.done?u(n.value):new e(function(l){l(n.value)}).then(i,r)}a((t=t.apply(n,l||[])).next())})},u=this&&this.__generator||function(n,l){var e,t,u,o,i={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return o={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function r(o){return function(r){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;i;)try{if(e=1,t&&(u=t[2&o[0]?"return":o[0]?"throw":"next"])&&!(u=u.call(t,o[1])).done)return u;switch(t=0,u&&(o=[0,u.value]),o[0]){case 0:case 1:u=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,t=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(u=(u=i.trys).length>0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0?n.data:[]).sort(o.Utils.getSortFunction(this.i18nService,"name")),this.groups=l,this.loading=!1,[2]}})})},n.prototype.edit=function(n){var l=this;null!=this.modal&&this.modal.close();var e=this.componentFactoryResolver.resolveComponentFactory(i.ModalComponent);this.modal=this.addEditModalRef.createComponent(e).instance;var t=this.modal.show(a.GroupAddEditComponent,this.addEditModalRef);t.organizationId=this.organizationId,t.groupId=null!=n?n.id:null,t.onSavedGroup.subscribe(function(){l.modal.close(),l.load()}),t.onDeletedGroup.subscribe(function(){l.modal.close(),l.removeGroup(n)}),this.modal.onClosed.subscribe(function(){l.modal=null})},n.prototype.add=function(){this.edit(null)},n.prototype.delete=function(n){return t(this,void 0,void 0,function(){return u(this,function(l){switch(l.label){case 0:return[4,this.platformUtilsService.showDialog(this.i18nService.t("deleteGroupConfirmation"),n.name,this.i18nService.t("yes"),this.i18nService.t("no"),"warning")];case 1:if(!l.sent())return[2,!1];l.label=2;case 2:return l.trys.push([2,4,,5]),[4,this.apiService.deleteGroup(this.organizationId,n.id)];case 3:return l.sent(),this.analytics.eventTrack.next({action:"Deleted Group"}),this.toasterService.popAsync("success",null,this.i18nService.t("deletedGroupId",n.name)),this.removeGroup(n),[3,5];case 4:return l.sent(),[3,5];case 5:return[2]}})})},n.prototype.users=function(n){var l=this;null!=this.modal&&this.modal.close();var e=this.componentFactoryResolver.resolveComponentFactory(i.ModalComponent);this.modal=this.usersModalRef.createComponent(e).instance;var t=this.modal.show(r.EntityUsersComponent,this.usersModalRef);t.organizationId=this.organizationId,t.entity="group",t.entityId=n.id,t.entityName=n.name,this.modal.onClosed.subscribe(function(){l.modal=null})},n.prototype.removeGroup=function(n){var l=this.groups.indexOf(n);l>-1&&this.groups.splice(l,1)},n}();l.GroupsComponent=s},function(n,l,e){"use strict";var t=this&&this.__awaiter||function(n,l,e,t){return new(e||(e=Promise))(function(u,o){function i(n){try{a(t.next(n))}catch(n){o(n)}}function r(n){try{a(t.throw(n))}catch(n){o(n)}}function a(n){n.done?u(n.value):new e(function(l){l(n.value)}).then(i,r)}a((t=t.apply(n,l||[])).next())})},u=this&&this.__generator||function(n,l){var e,t,u,o,i={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return o={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function r(o){return function(r){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;i;)try{if(e=1,t&&(u=t[2&o[0]?"return":o[0]?"throw":"next"])&&!(u=u.call(t,o[1])).done)return u;switch(t=0,u&&(o=[0,u.value]),o[0]){case 0:case 1:u=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,t=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(u=(u=i.trys).length>0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0?this.events=this.events.concat(o):this.events=o,this.loading=!1,this.morePromise=null,this.refreshPromise=null,[2]}})})},n}();l.EventsComponent=o},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0}),function(n){n[n.Invited=0]="Invited",n[n.Accepted=1]="Accepted",n[n.Confirmed=2]="Confirmed"}(l.OrganizationUserStatusType||(l.OrganizationUserStatusType={}))},function(n,l,e){"use strict";var t=this&&this.__awaiter||function(n,l,e,t){return new(e||(e=Promise))(function(u,o){function i(n){try{a(t.next(n))}catch(n){o(n)}}function r(n){try{a(t.throw(n))}catch(n){o(n)}}function a(n){n.done?u(n.value):new e(function(l){l(n.value)}).then(i,r)}a((t=t.apply(n,l||[])).next())})},u=this&&this.__generator||function(n,l){var e,t,u,o,i={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return o={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function r(o){return function(r){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;i;)try{if(e=1,t&&(u=t[2&o[0]?"return":o[0]?"throw":"next"])&&!(u=u.call(t,o[1])).done)return u;switch(t=0,u&&(o=[0,u.value]),o[0]){case 0:case 1:u=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,t=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(u=(u=i.trys).length>0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]-1&&this.users.splice(l,1),[3,8];case 7:return e.sent(),[3,8];case 8:return[2]}})})},n}();l.EntityUsersComponent=s},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(n,l){this.id=n,this.readOnly=l}}();l.SelectionReadOnlyRequest=t},function(n,l,e){"use strict";var t=this&&this.__awaiter||function(n,l,e,t){return new(e||(e=Promise))(function(u,o){function i(n){try{a(t.next(n))}catch(n){o(n)}}function r(n){try{a(t.throw(n))}catch(n){o(n)}}function a(n){n.done?u(n.value):new e(function(l){l(n.value)}).then(i,r)}a((t=t.apply(n,l||[])).next())})},u=this&&this.__generator||function(n,l){var e,t,u,o,i={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return o={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function r(o){return function(r){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;i;)try{if(e=1,t&&(u=t[2&o[0]?"return":o[0]?"throw":"next"])&&!(u=u.call(t,o[1])).done)return u;switch(t=0,u&&(o=[0,u.value]),o[0]){case 0:case 1:u=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,t=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(u=(u=i.trys).length>0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]-1&&this.collections.splice(l,1)},n}();l.CollectionsComponent=d},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});e(0);var t=function(){function n(){}return n.prototype.transform=function(n,l,e,t,u){return null==n||0===n.length?[]:null==l||l.length<2?n:(l=l.trim().toLowerCase(),n.filter(function(n){return null!=e&&null!=n[e]&&n[e].toString().toLowerCase().indexOf(l)>-1||(null!=t&&null!=n[t]&&n[t].toString().toLowerCase().indexOf(l)>-1||null!=u&&null!=n[u]&&n[u].toString().toLowerCase().indexOf(l)>-1)}))},n}();l.SearchPipe=t},function(n,l,e){"use strict";var t=this&&this.__awaiter||function(n,l,e,t){return new(e||(e=Promise))(function(u,o){function i(n){try{a(t.next(n))}catch(n){o(n)}}function r(n){try{a(t.throw(n))}catch(n){o(n)}}function a(n){n.done?u(n.value):new e(function(l){l(n.value)}).then(i,r)}a((t=t.apply(n,l||[])).next())})},u=this&&this.__generator||function(n,l){var e,t,u,o,i={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return o={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function r(o){return function(r){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;i;)try{if(e=1,t&&(u=t[2&o[0]?"return":o[0]?"throw":"next"])&&!(u=u.call(t,o[1])).done)return u;switch(t=0,u&&(o=[0,u.value]),o[0]){case 0:case 1:u=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,t=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(u=(u=i.trys).length>0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0?this.events=this.events.concat(o):this.events=o,this.loading=!1,this.morePromise=null,this.refreshPromise=null,[2]}})})},n}();l.EntityEventsComponent=o},function(n,l,e){"use strict";var t=this&&this.__awaiter||function(n,l,e,t){return new(e||(e=Promise))(function(u,o){function i(n){try{a(t.next(n))}catch(n){o(n)}}function r(n){try{a(t.throw(n))}catch(n){o(n)}}function a(n){n.done?u(n.value):new e(function(l){l(n.value)}).then(i,r)}a((t=t.apply(n,l||[])).next())})},u=this&&this.__generator||function(n,l){var e,t,u,o,i={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return o={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function r(o){return function(r){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;i;)try{if(e=1,t&&(u=t[2&o[0]?"return":o[0]?"throw":"next"])&&!(u=u.call(t,o[1])).done)return u;switch(t=0,u&&(o=[0,u.value]),o[0]){case 0:case 1:u=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,t=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(u=(u=i.trys).length>0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&this.viewEvents(e[0]),[2]}})})}),[2]}})})})},n.prototype.clearGroupingFilters=function(){return t(this,void 0,void 0,function(){return u(this,function(n){switch(n.label){case 0:return this.ciphersComponent.showAddNew=!0,this.groupingsComponent.searchPlaceholder=this.i18nService.t("searchVault"),[4,this.ciphersComponent.applyFilter()];case 1:return n.sent(),this.clearFilters(),this.go(),[2]}})})},n.prototype.filterCipherType=function(n,l){return void 0===l&&(l=!1),t(this,void 0,void 0,function(){var e;return u(this,function(t){switch(t.label){case 0:return this.ciphersComponent.showAddNew=!0,this.groupingsComponent.searchPlaceholder=this.i18nService.t("searchType"),e=function(l){return l.type===n},l?[4,this.ciphersComponent.load(e)]:[3,2];case 1:return t.sent(),[3,4];case 2:return[4,this.ciphersComponent.applyFilter(e)];case 3:t.sent(),t.label=4;case 4:return this.clearFilters(),this.type=n,this.go(),[2]}})})},n.prototype.filterCollection=function(n,l){return void 0===l&&(l=!1),t(this,void 0,void 0,function(){var e;return u(this,function(t){switch(t.label){case 0:return this.ciphersComponent.showAddNew=!1,this.groupingsComponent.searchPlaceholder=this.i18nService.t("searchCollection"),e=function(l){return"unassigned"===n?null==l.collectionIds||0===l.collectionIds.length:l.collectionIds.indexOf(n)>-1},l?[4,this.ciphersComponent.load(e)]:[3,2];case 1:return t.sent(),[3,4];case 2:return[4,this.ciphersComponent.applyFilter(e)];case 3:t.sent(),t.label=4;case 4:return this.clearFilters(),this.collectionId=n,this.go(),[2]}})})},n.prototype.filterSearchText=function(n){this.ciphersComponent.searchText=n},n.prototype.editCipherAttachments=function(n){var l=this;if(null!=this.organization.maxStorageGb&&0!==this.organization.maxStorageGb){null!=this.modal&&this.modal.close();var e=this.componentFactoryResolver.resolveComponentFactory(o.ModalComponent);this.modal=this.attachmentsModalRef.createComponent(e).instance;var i=this.modal.show(a.AttachmentsComponent,this.attachmentsModalRef);i.organization=this.organization,i.cipherId=n.id;var r=!1;i.onUploadedAttachment.subscribe(function(){return r=!0}),i.onDeletedAttachment.subscribe(function(){return r=!0}),this.modal.onClosed.subscribe(function(){return t(l,void 0,void 0,function(){return u(this,function(n){switch(n.label){case 0:return this.modal=null,r?[4,this.ciphersComponent.refresh()]:[3,2];case 1:n.sent(),n.label=2;case 2:return r=!1,[2]}})})})}else this.messagingService.send("upgradeOrganization",{organizationId:n.organizationId})},n.prototype.editCipherCollections=function(n){var l=this;null!=this.modal&&this.modal.close();var e=this.componentFactoryResolver.resolveComponentFactory(o.ModalComponent);this.modal=this.collectionsModalRef.createComponent(e).instance;var i=this.modal.show(s.CollectionsComponent,this.collectionsModalRef);this.organization.isAdmin&&(i.collectionIds=n.collectionIds,i.collections=this.groupingsComponent.collections.filter(function(n){return!n.readOnly})),i.organization=this.organization,i.cipherId=n.id,i.onSavedCollections.subscribe(function(){return t(l,void 0,void 0,function(){return u(this,function(n){switch(n.label){case 0:return this.modal.close(),[4,this.ciphersComponent.refresh()];case 1:return n.sent(),[2]}})})}),this.modal.onClosed.subscribe(function(){return t(l,void 0,void 0,function(){return u(this,function(n){return this.modal=null,[2]})})})},n.prototype.addCipher=function(){this.editCipher(null).type=this.type},n.prototype.editCipher=function(n){var l=this;null!=this.modal&&this.modal.close();var e=this.componentFactoryResolver.resolveComponentFactory(o.ModalComponent);this.modal=this.cipherAddEditModalRef.createComponent(e).instance;var i=this.modal.show(r.AddEditComponent,this.cipherAddEditModalRef);return i.organization=this.organization,i.cipherId=null==n?null:n.id,i.onSavedCipher.subscribe(function(n){return t(l,void 0,void 0,function(){return u(this,function(n){switch(n.label){case 0:return this.modal.close(),[4,this.ciphersComponent.refresh()];case 1:return n.sent(),[2]}})})}),i.onDeletedCipher.subscribe(function(n){return t(l,void 0,void 0,function(){return u(this,function(n){switch(n.label){case 0:return this.modal.close(),[4,this.ciphersComponent.refresh()];case 1:return n.sent(),[2]}})})}),this.modal.onClosed.subscribe(function(){l.modal=null}),i},n.prototype.viewEvents=function(n){return t(this,void 0,void 0,function(){var l,e,t=this;return u(this,function(u){return null!=this.modal&&this.modal.close(),l=this.componentFactoryResolver.resolveComponentFactory(o.ModalComponent),this.modal=this.eventsModalRef.createComponent(l).instance,(e=this.modal.show(i.EntityEventsComponent,this.eventsModalRef)).name=n.name,e.organizationId=this.organization.id,e.entityId=n.id,e.showUser=!0,e.entity="cipher",this.modal.onClosed.subscribe(function(){t.modal=null}),[2]})})},n.prototype.clearFilters=function(){this.collectionId=null,this.type=null},n.prototype.go=function(n){void 0===n&&(n=null),null==n&&(n={type:this.type,collectionId:this.collectionId});var l=this.router.createUrlTree(["organizations",this.organization.id,"vault"],{queryParams:n}).toString();this.location.go(l)},n}());l.VaultComponent=d},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)}),o=this&&this.__awaiter||function(n,l,e,t){return new(e||(e=Promise))(function(u,o){function i(n){try{a(t.next(n))}catch(n){o(n)}}function r(n){try{a(t.throw(n))}catch(n){o(n)}}function a(n){n.done?u(n.value):new e(function(l){l(n.value)}).then(i,r)}a((t=t.apply(n,l||[])).next())})},i=this&&this.__generator||function(n,l){var e,t,u,o,i={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return o={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function r(o){return function(r){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;i;)try{if(e=1,t&&(u=t[2&o[0]?"return":o[0]?"throw":"next"])&&!(u=u.call(t,o[1])).done)return u;switch(t=0,u&&(o=[0,u.value]),o[0]){case 0:case 1:u=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,t=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(u=(u=i.trys).length>0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]-1}),[2]}})})},n.prototype.ngOnDestroy=function(){this.selectAll(!1)},n.prototype.submit=function(){return t(this,void 0,void 0,function(){return u(this,function(n){switch(n.label){case 0:return this.cipherDomain.collectionIds=this.collections.filter(function(n){return!!n.checked}).map(function(n){return n.id}),this.formPromise=this.saveCollections(),[4,this.formPromise];case 1:return n.sent(),this.onSavedCollections.emit(),this.analytics.eventTrack.next({action:"Edited Cipher Collections"}),this.toasterService.popAsync("success",null,this.i18nService.t("editedItem")),[2]}})})},n.prototype.check=function(n,l){n.checked=null==l?!n.checked:l},n.prototype.selectAll=function(n){var l=this;this.collections.forEach(function(e){return l.check(e,n)})},n.prototype.loadCipher=function(){return this.cipherService.get(this.cipherId)},n.prototype.loadCipherCollections=function(){return this.cipherDomain.collectionIds},n.prototype.loadCollections=function(){return t(this,void 0,void 0,function(){var n=this;return u(this,function(l){switch(l.label){case 0:return[4,this.collectionService.getAllDecrypted()];case 1:return[2,l.sent().filter(function(l){return!l.readOnly&&l.organizationId===n.cipher.organizationId})]}})})},n.prototype.saveCollections=function(){return this.cipherService.saveCollectionsWithServer(this.cipherDomain)},n}());l.CollectionsComponent=i},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)});Object.defineProperty(l,"__esModule",{value:!0});e(12),e(3),e(26),e(20),e(2),e(8),e(35);var o=function(n){function l(l,e,t,u,o,i,r){return n.call(this,l,e,t,u,o,i,r,window)||this}return u(l,n),l}(e(800).AttachmentsComponent);l.AttachmentsComponent=o},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)}),o=this&&this.__awaiter||function(n,l,e,t){return new(e||(e=Promise))(function(u,o){function i(n){try{a(t.next(n))}catch(n){o(n)}}function r(n){try{a(t.throw(n))}catch(n){o(n)}}function a(n){n.done?u(n.value):new e(function(l){l(n.value)}).then(i,r)}a((t=t.apply(n,l||[])).next())})},i=this&&this.__generator||function(n,l){var e,t,u,o,i={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return o={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function r(o){return function(r){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;i;)try{if(e=1,t&&(u=t[2&o[0]?"return":o[0]?"throw":"next"])&&!(u=u.call(t,o[1])).done)return u;switch(t=0,u&&(o=[0,u.value]),o[0]){case 0:case 1:u=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,t=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(u=(u=i.trys).length>0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]-1})];case 1:return l.sent(),this.clearFilters(),this.collectionId=n,this.go(),[2]}})})},n.prototype.filterSearchText=function(n){this.ciphersComponent.searchText=n},n.prototype.editCipherAttachments=function(n){return t(this,void 0,void 0,function(){var l,e,i,r,s,d=this;return u(this,function(c){switch(c.label){case 0:return[4,this.tokenService.getPremium()];case 1:return l=c.sent(),null!=n.organizationId||l?[3,2]:(this.messagingService.send("premiumRequired"),[2]);case 2:return null==n.organizationId?[3,4]:[4,this.userService.getOrganization(n.organizationId)];case 3:if(null!=(e=c.sent())&&(null==e.maxStorageGb||0===e.maxStorageGb))return this.messagingService.send("upgradeOrganization",{organizationId:n.organizationId}),[2];c.label=4;case 4:return null!=this.modal&&this.modal.close(),i=this.componentFactoryResolver.resolveComponentFactory(o.ModalComponent),this.modal=this.attachmentsModalRef.createComponent(i).instance,(r=this.modal.show(a.AttachmentsComponent,this.attachmentsModalRef)).cipherId=n.id,s=!1,r.onUploadedAttachment.subscribe(function(){return s=!0}),r.onDeletedAttachment.subscribe(function(){return s=!0}),this.modal.onClosed.subscribe(function(){return t(d,void 0,void 0,function(){return u(this,function(n){switch(n.label){case 0:return this.modal=null,s?[4,this.ciphersComponent.refresh()]:[3,2];case 1:n.sent(),n.label=2;case 2:return s=!1,[2]}})})}),[2]}})})},n.prototype.shareCipher=function(n){var l=this;null!=this.modal&&this.modal.close();var e=this.componentFactoryResolver.resolveComponentFactory(o.ModalComponent);this.modal=this.shareModalRef.createComponent(e).instance;var i=this.modal.show(v.ShareComponent,this.shareModalRef);i.cipherId=n.id,i.onSharedCipher.subscribe(function(){return t(l,void 0,void 0,function(){return u(this,function(n){switch(n.label){case 0:return this.modal.close(),[4,this.ciphersComponent.refresh()];case 1:return n.sent(),[2]}})})}),this.modal.onClosed.subscribe(function(){return t(l,void 0,void 0,function(){return u(this,function(n){return this.modal=null,[2]})})})},n.prototype.editCipherCollections=function(n){var l=this;null!=this.modal&&this.modal.close();var e=this.componentFactoryResolver.resolveComponentFactory(o.ModalComponent);this.modal=this.collectionsModalRef.createComponent(e).instance;var i=this.modal.show(p.CollectionsComponent,this.collectionsModalRef);i.cipherId=n.id,i.onSavedCollections.subscribe(function(){return t(l,void 0,void 0,function(){return u(this,function(n){switch(n.label){case 0:return this.modal.close(),[4,this.ciphersComponent.refresh()];case 1:return n.sent(),[2]}})})}),this.modal.onClosed.subscribe(function(){return t(l,void 0,void 0,function(){return u(this,function(n){return this.modal=null,[2]})})})},n.prototype.addFolder=function(){return t(this,void 0,void 0,function(){var n,l,e=this;return u(this,function(i){return null!=this.modal&&this.modal.close(),n=this.componentFactoryResolver.resolveComponentFactory(o.ModalComponent),this.modal=this.folderAddEditModalRef.createComponent(n).instance,(l=this.modal.show(f.FolderAddEditComponent,this.folderAddEditModalRef)).folderId=null,l.onSavedFolder.subscribe(function(){return t(e,void 0,void 0,function(){return u(this,function(n){switch(n.label){case 0:return this.modal.close(),[4,this.groupingsComponent.loadFolders()];case 1:return n.sent(),[2]}})})}),this.modal.onClosed.subscribe(function(){e.modal=null}),[2]})})},n.prototype.editFolder=function(n){return t(this,void 0,void 0,function(){var l,e,i=this;return u(this,function(r){return null!=this.modal&&this.modal.close(),l=this.componentFactoryResolver.resolveComponentFactory(o.ModalComponent),this.modal=this.folderAddEditModalRef.createComponent(l).instance,(e=this.modal.show(f.FolderAddEditComponent,this.folderAddEditModalRef)).folderId=n,e.onSavedFolder.subscribe(function(){return t(i,void 0,void 0,function(){return u(this,function(n){switch(n.label){case 0:return this.modal.close(),[4,this.groupingsComponent.loadFolders()];case 1:return n.sent(),[2]}})})}),e.onDeletedFolder.subscribe(function(){return t(i,void 0,void 0,function(){return u(this,function(n){switch(n.label){case 0:return this.modal.close(),[4,this.groupingsComponent.loadFolders()];case 1:return n.sent(),[4,this.filterFolder("none")];case 2:return n.sent(),this.groupingsComponent.selectedFolderId=null,[2]}})})}),this.modal.onClosed.subscribe(function(){i.modal=null}),[2]})})},n.prototype.addCipher=function(){var n=this.editCipher(null);n.type=this.type,n.folderId="none"===this.folderId?null:this.folderId},n.prototype.editCipher=function(n){var l=this;null!=this.modal&&this.modal.close();var e=this.componentFactoryResolver.resolveComponentFactory(o.ModalComponent);this.modal=this.cipherAddEditModalRef.createComponent(e).instance;var i=this.modal.show(r.AddEditComponent,this.cipherAddEditModalRef);return i.cipherId=null==n?null:n.id,i.onSavedCipher.subscribe(function(n){return t(l,void 0,void 0,function(){return u(this,function(n){switch(n.label){case 0:return this.modal.close(),[4,this.ciphersComponent.refresh()];case 1:return n.sent(),[2]}})})}),i.onDeletedCipher.subscribe(function(n){return t(l,void 0,void 0,function(){return u(this,function(n){switch(n.label){case 0:return this.modal.close(),[4,this.ciphersComponent.refresh()];case 1:return n.sent(),[2]}})})}),this.modal.onClosed.subscribe(function(){l.modal=null}),i},n.prototype.bulkDelete=function(){var n=this,l=this.ciphersComponent.getSelectedIds();if(0!==l.length){null!=this.modal&&this.modal.close();var e=this.componentFactoryResolver.resolveComponentFactory(o.ModalComponent);this.modal=this.bulkDeleteModalRef.createComponent(e).instance;var i=this.modal.show(s.BulkDeleteComponent,this.bulkDeleteModalRef);i.cipherIds=l,i.onDeleted.subscribe(function(){return t(n,void 0,void 0,function(){return u(this,function(n){switch(n.label){case 0:return this.modal.close(),[4,this.ciphersComponent.refresh()];case 1:return n.sent(),[2]}})})}),this.modal.onClosed.subscribe(function(){n.modal=null})}else this.toasterService.popAsync("error",this.i18nService.t("errorOccurred"),this.i18nService.t("nothingSelected"))},n.prototype.bulkShare=function(){var n=this,l=this.ciphersComponent.getSelected();if(0!==l.length){null!=this.modal&&this.modal.close();var e=this.componentFactoryResolver.resolveComponentFactory(o.ModalComponent);this.modal=this.bulkShareModalRef.createComponent(e).instance;var i=this.modal.show(c.BulkShareComponent,this.bulkShareModalRef);i.ciphers=l,i.onShared.subscribe(function(){return t(n,void 0,void 0,function(){return u(this,function(n){switch(n.label){case 0:return this.modal.close(),[4,this.ciphersComponent.refresh()];case 1:return n.sent(),[2]}})})}),this.modal.onClosed.subscribe(function(){return t(n,void 0,void 0,function(){return u(this,function(n){return this.modal=null,[2]})})})}else this.toasterService.popAsync("error",this.i18nService.t("errorOccurred"),this.i18nService.t("nothingSelected"))},n.prototype.bulkMove=function(){var n=this,l=this.ciphersComponent.getSelectedIds();if(0!==l.length){null!=this.modal&&this.modal.close();var e=this.componentFactoryResolver.resolveComponentFactory(o.ModalComponent);this.modal=this.bulkMoveModalRef.createComponent(e).instance;var i=this.modal.show(d.BulkMoveComponent,this.bulkMoveModalRef);i.cipherIds=l,i.onMoved.subscribe(function(){return t(n,void 0,void 0,function(){return u(this,function(n){switch(n.label){case 0:return this.modal.close(),[4,this.ciphersComponent.refresh()];case 1:return n.sent(),[2]}})})}),this.modal.onClosed.subscribe(function(){n.modal=null})}else this.toasterService.popAsync("error",this.i18nService.t("errorOccurred"),this.i18nService.t("nothingSelected"))},n.prototype.selectAll=function(n){this.ciphersComponent.selectAll(n)},n.prototype.updateKey=function(){var n=this;null!=this.modal&&this.modal.close();var l=this.componentFactoryResolver.resolveComponentFactory(o.ModalComponent);this.modal=this.updateKeyModalRef.createComponent(l).instance,this.modal.show(i.UpdateKeyComponent,this.updateKeyModalRef),this.modal.onClosed.subscribe(function(){n.modal=null})},n.prototype.clearFilters=function(){this.folderId=null,this.collectionId=null,this.favorites=!1,this.type=null},n.prototype.go=function(n){void 0===n&&(n=null),null==n&&(n={favorites:!!this.favorites||null,type:this.type,folderId:this.folderId,collectionId:this.collectionId});var l=this.router.createUrlTree(["vault"],{queryParams:n}).toString();this.location.go(l)},n.prototype.inOrgWithPremium=function(){return t(this,void 0,void 0,function(){var n,l;return u(this,function(e){switch(e.label){case 0:return[4,this.userService.getAllOrganizations()];case 1:for(n=e.sent(),l=0;l0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]-1?(n="http://"+n,l=!0):this.imageEnabled&&(l=0===n.indexOf("http")&&n.indexOf(".")>-1),this.imageEnabled&&l)try{this.image=this.iconsUrl+"/"+r.Utils.getHostname(n)+"/icon.png",this.fallbackImage="images/fa-globe.png"}catch(n){}}else this.image=null},n}();l.IconComponent=a},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});e(0);var t=function(){function n(){}return n.prototype.ngOnInit=function(){document.body.classList.remove("layout_frontend")},n}();l.UserLayoutComponent=t},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});e(0),e(8);var t=function(){function n(n){this.platformUtilsService=n,this.year="2015"}return n.prototype.ngOnInit=function(){this.year=(new Date).getFullYear().toString(),this.version=this.platformUtilsService.getApplicationVersion()},n}();l.FooterComponent=t},function(n,l,e){"use strict";var t=this&&this.__awaiter||function(n,l,e,t){return new(e||(e=Promise))(function(u,o){function i(n){try{a(t.next(n))}catch(n){o(n)}}function r(n){try{a(t.throw(n))}catch(n){o(n)}}function a(n){n.done?u(n.value):new e(function(l){l(n.value)}).then(i,r)}a((t=t.apply(n,l||[])).next())})},u=this&&this.__generator||function(n,l){var e,t,u,o,i={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return o={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function r(o){return function(r){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;i;)try{if(e=1,t&&(u=t[2&o[0]?"return":o[0]?"throw":"next"])&&!(u=u.call(t,o[1])).done)return u;switch(t=0,u&&(o=[0,u.value]),o[0]){case 0:case 1:u=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,t=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(u=(u=i.trys).length>0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]-1&&(n.email=l.email),null!=l.premium?n.stateService.save("loginRedirect",{route:"/settings/premium"}):null!=l.org&&(n.showCreateOrgMessage=!0,n.stateService.save("loginRedirect",{route:"/settings/create-organization",qParams:{plan:l.org}}))})},l}(e(830).RegisterComponent);l.RegisterComponent=o},function(n,l,e){var t,u,o;u=[],void 0===(o="function"==typeof(t=function(){var n,l,e,t,u,o=/^(?:AUTH|ENROLL)+\|[A-Za-z0-9\+\/=]+\|[A-Za-z0-9\+\/=]+$/,i=/^ERR\|[\w\s\.\(\)]+$/,r=/^DUO_OPEN_WINDOW\|/,a=["duo.com","duosecurity.com","duomobile.s3-us-west-1.amazonaws.com"],s="duo_iframe",d="",c="sig_response";function p(n,l){throw new Error("Duo Web SDK error: "+n+(l?"\nSee "+l+" for more information":""))}function f(n,l){return"dataset"in n?n.dataset[l]:n.getAttribute("data-"+l.replace(/([a-z])([A-Z])/,"$1-$2").toLowerCase())}function v(n,l,e,t){"addEventListener"in window?n.addEventListener(l,t,!1):n.attachEvent(e,t)}function h(n,l,e,t){"removeEventListener"in window?n.removeEventListener(l,t,!1):n.detachEvent(e,t)}function g(n){v(document,"DOMContentLoaded","onreadystatechange",n)}function m(n){h(document,"DOMContentLoaded","onreadystatechange",n)}function y(n){if(n){0===n.indexOf("ERR|")&&p(n.split("|")[1]),-1!==n.indexOf(":")&&2===n.split(":").length||p("Duo was given a bad token. This might indicate a configuration problem with one of Duo's client libraries.","https://www.duosecurity.com/docs/duoweb#first-steps");var t=n.split(":");return l=t[0],e=t[1],{sigRequest:n,duoSig:t[0],appSig:t[1]}}}function C(){if(!(t=document.getElementById(s)))throw new Error('This page does not contain an iframe for Duo to use.Add an element like to this page. See https://www.duosecurity.com/docs/duoweb#3.-show-the-iframe for more information.');w(),m(C)}function b(l){return Boolean(l.origin==="https://"+n&&"string"==typeof l.data&&(l.data.match(o)||l.data.match(i)||l.data.match(r)))}function S(n){if(b(n))if(n.data.match(r)){var l=n.data.substring("DUO_OPEN_WINDOW|".length);(function(n){if(!n)return!1;var l=document.createElement("a");if(l.href=n,"duotrustedendpoints:"===l.protocol)return!0;if("https:"!==l.protocol)return!1;for(var e=0;e0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]-1&&(this.email=e.email),null!=e.premium?this.stateService.save("loginRedirect",{route:"/settings/premium"}):null!=e.org&&this.stateService.save("loginRedirect",{route:"/settings/create-organization",qParams:{plan:e.org}}),[4,n.prototype.ngOnInit.call(this)];case 1:return l.sent(),[2]}})})}),[2]})})},l.prototype.goAfterLogIn=function(){return o(this,void 0,void 0,function(){var n,l;return i(this,function(e){switch(e.label){case 0:return[4,this.stateService.get("orgInvitation")];case 1:return null==(n=e.sent())?[3,2]:(this.router.navigate(["accept-organization"],{queryParams:n}),[3,6]);case 2:return[4,this.stateService.get("loginRedirect")];case 3:return null==(l=e.sent())?[3,5]:(this.router.navigate([l.route],{queryParams:l.qParams}),[4,this.stateService.remove("loginRedirect")]);case 4:return e.sent(),[3,6];case 5:this.router.navigate([this.successRoute]),e.label=6;case 6:return[2]}})})},l}(e(850).LoginComponent);l.LoginComponent=r},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});e(0),e(8);var t=function(){function n(n){this.platformUtilsService=n}return n.prototype.ngOnInit=function(){this.version=this.platformUtilsService.getApplicationVersion(),document.body.classList.add("layout_frontend")},n.prototype.ngOnDestroy=function(){document.body.classList.remove("layout_frontend")},n}();l.FrontendLayoutComponent=t},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(){}}();l.SettingsService=t},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(){}}();l.LockService=t},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(n,l,e){"use strict";var t=this&&this.__awaiter||function(n,l,e,t){return new(e||(e=Promise))(function(u,o){function i(n){try{a(t.next(n))}catch(n){o(n)}}function r(n){try{a(t.throw(n))}catch(n){o(n)}}function a(n){n.done?u(n.value):new e(function(l){l(n.value)}).then(i,r)}a((t=t.apply(n,l||[])).next())})},u=this&&this.__generator||function(n,l){var e,t,u,o,i={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return o={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function r(o){return function(r){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;i;)try{if(e=1,t&&(u=t[2&o[0]?"return":o[0]?"throw":"next"])&&!(u=u.call(t,o[1])).done)return u;switch(t=0,u&&(o=[0,u.value]),o[0]){case 0:case 1:u=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,t=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(u=(u=i.trys).length>0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]=n.length&&(n=Array(l+1-n.length).join(e)+n),n},n.prototype.dec2hex=function(n){return(n<15.5?"0":"")+Math.round(n).toString(16)},n.prototype.hex2dec=function(n){return parseInt(n,16)},n.prototype.b32tohex=function(n){n=n.toUpperCase();for(var l="",e=0;e0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&n.push(l.domains)}),[2,this.settingsService.setEquivalentDomains(n)]})})},n}();l.SyncService=d},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){function n(){this.state={}}return n.prototype.get=function(n){return this.state.hasOwnProperty(n)?Promise.resolve(this.state[n]):Promise.resolve(null)},n.prototype.save=function(n,l){return this.state[n]=l,Promise.resolve()},n.prototype.remove=function(n){return delete this.state[n],Promise.resolve()},n.prototype.purge=function(){return this.state={},Promise.resolve()},n}();l.StateService=t},function(n,l,e){"use strict";var t=this&&this.__awaiter||function(n,l,e,t){return new(e||(e=Promise))(function(u,o){function i(n){try{a(t.next(n))}catch(n){o(n)}}function r(n){try{a(t.throw(n))}catch(n){o(n)}}function a(n){n.done?u(n.value):new e(function(l){l(n.value)}).then(i,r)}a((t=t.apply(n,l||[])).next())})},u=this&&this.__generator||function(n,l){var e,t,u,o,i={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return o={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function r(o){return function(r){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;i;)try{if(e=1,t&&(u=t[2&o[0]?"return":o[0]?"throw":"next"])&&!(u=u.call(t,o[1])).done)return u;switch(t=0,u&&(o=[0,u.value]),o[0]){case 0:case 1:u=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,t=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(u=(u=i.trys).length>0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0)for(p=0;p0)for(p=0;p0)for(p=0;p0)for(p=0;p100&&l.pop(),[4,this.encryptHistory(l)]);case 3:return e=t.sent(),[4,this.storageService.save(s,e)];case 4:return[2,t.sent()]}})})},n.prototype.clear=function(){return t(this,void 0,void 0,function(){return u(this,function(n){switch(n.label){case 0:return this.history=[],[4,this.storageService.remove(s)];case 1:return[2,n.sent()]}})})},n.prototype.encryptHistory=function(n){return t(this,void 0,void 0,function(){var l,e=this;return u(this,function(o){switch(o.label){case 0:return null==n||0===n.length?[2,Promise.resolve([])]:(l=n.map(function(n){return t(e,void 0,void 0,function(){var l;return u(this,function(e){switch(e.label){case 0:return[4,this.cryptoService.encrypt(n.password)];case 1:return l=e.sent(),[2,new i.PasswordHistory(l.encryptedString,n.date)]}})})}),[4,Promise.all(l)]);case 1:return[2,o.sent()]}})})},n.prototype.decryptHistory=function(n){return t(this,void 0,void 0,function(){var l,e=this;return u(this,function(r){switch(r.label){case 0:return null==n||0===n.length?[2,Promise.resolve([])]:(l=n.map(function(n){return t(e,void 0,void 0,function(){var l;return u(this,function(e){switch(e.label){case 0:return[4,this.cryptoService.decryptToUtf8(new o.CipherString(n.password))];case 1:return l=e.sent(),[2,new i.PasswordHistory(l,n.date)]}})})}),[4,Promise.all(l)]);case 1:return[2,r.sent()]}})})},n.prototype.matchesPrevious=function(n,l){return null!=l&&0!==l.length&&l[l.length-1].password===n},n.prototype.shuffleArray=function(n){return t(this,void 0,void 0,function(){var l,e,t;return u(this,function(u){switch(u.label){case 0:e=n.length-1,u.label=1;case 1:return e>0?[4,this.cryptoService.randomNumber(0,e)]:[3,4];case 2:t=u.sent(),l=[n[t],n[e]],n[e]=l[0],n[t]=l[1],u.label=3;case 3:return e--,[3,1];case 4:return[2]}})})},n}();l.PasswordGenerationService=d},function(n,l,e){"use strict";var t=this&&this.__awaiter||function(n,l,e,t){return new(e||(e=Promise))(function(u,o){function i(n){try{a(t.next(n))}catch(n){o(n)}}function r(n){try{a(t.throw(n))}catch(n){o(n)}}function a(n){n.done?u(n.value):new e(function(l){l(n.value)}).then(i,r)}a((t=t.apply(n,l||[])).next())})},u=this&&this.__generator||function(n,l){var e,t,u,o,i={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return o={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function r(o){return function(r){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;i;)try{if(e=1,t&&(u=t[2&o[0]?"return":o[0]?"throw":"next"])&&!(u=u.call(t,o[1])).done)return u;switch(t=0,u&&(o=[0,u.value]),o[0]){case 0:case 1:u=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,t=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(u=(u=i.trys).length>0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]=e?[4,this.lock()]:[3,6]);case 5:t.sent(),t.label=6;case 6:return[2]}})})},n.prototype.lock=function(){return t(this,void 0,void 0,function(){return u(this,function(n){switch(n.label){case 0:return[4,Promise.all([this.cryptoService.clearKey(),this.cryptoService.clearOrgKeys(!0),this.cryptoService.clearKeyPair(!0),this.cryptoService.clearEncKey(!0)])];case 1:return n.sent(),this.folderService.clearCache(),this.cipherService.clearCache(),this.collectionService.clearCache(),this.messagingService.send("locked"),null==this.lockedCallback?[3,3]:[4,this.lockedCallback()];case 2:n.sent(),n.label=3;case 3:return[2]}})})},n.prototype.setLockOption=function(n){return t(this,void 0,void 0,function(){return u(this,function(l){switch(l.label){case 0:return[4,this.storageService.save(o.ConstantsService.lockOptionKey,n)];case 1:return l.sent(),[4,this.cryptoService.toggleKey()];case 2:return l.sent(),[2]}})})},n}();l.LockService=i},function(n,l,e){"use strict";var t=this&&this.__awaiter||function(n,l,e,t){return new(e||(e=Promise))(function(u,o){function i(n){try{a(t.next(n))}catch(n){o(n)}}function r(n){try{a(t.throw(n))}catch(n){o(n)}}function a(n){n.done?u(n.value):new e(function(l){l(n.value)}).then(i,r)}a((t=t.apply(n,l||[])).next())})},u=this&&this.__generator||function(n,l){var e,t,u,o,i={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return o={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function r(o){return function(r){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;i;)try{if(e=1,t&&(u=t[2&o[0]?"return":o[0]?"throw":"next"])&&!(u=u.call(t,o[1])).done)return u;switch(t=0,u&&(o=[0,u.value]),o[0]){case 0:case 1:u=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,t=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(u=(u=i.trys).length>0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&this.cipherService.upsert(o)}return[2]}})})},n.prototype.deleteWithServer=function(n){return t(this,void 0,void 0,function(){return u(this,function(l){switch(l.label){case 0:return[4,this.apiService.deleteFolder(n)];case 1:return l.sent(),[4,this.delete(n)];case 2:return l.sent(),[2]}})})},n}();l.FolderService=p},function(n,l,e){"use strict";var t=this&&this.__awaiter||function(n,l,e,t){return new(e||(e=Promise))(function(u,o){function i(n){try{a(t.next(n))}catch(n){o(n)}}function r(n){try{a(t.throw(n))}catch(n){o(n)}}function a(n){n.done?u(n.value):new e(function(l){l(n.value)}).then(i,r)}a((t=t.apply(n,l||[])).next())})},u=this&&this.__generator||function(n,l){var e,t,u,o,i={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return o={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function r(o){return function(r){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;i;)try{if(e=1,t&&(u=t[2&o[0]?"return":o[0]?"throw":"next"])&&!(u=u.call(t,o[1])).done)return u;switch(t=0,u&&(o=[0,u.value]),o[0]){case 0:case 1:u=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,t=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(u=(u=i.trys).length>0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]=0;r--)(u=n[r])&&(i=(o<3?u(i):o>3?u(l,e,i):u(l,e))||i);return o>3&&i&&Object.defineProperty(l,e,i),i},u=this&&this.__metadata||function(n,l){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(n,l)},o=this&&this.__awaiter||function(n,l,e,t){return new(e||(e=Promise))(function(u,o){function i(n){try{a(t.next(n))}catch(n){o(n)}}function r(n){try{a(t.throw(n))}catch(n){o(n)}}function a(n){n.done?u(n.value):new e(function(l){l(n.value)}).then(i,r)}a((t=t.apply(n,l||[])).next())})},i=this&&this.__generator||function(n,l){var e,t,u,o,i={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return o={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function r(o){return function(r){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;i;)try{if(e=1,t&&(u=t[2&o[0]?"return":o[0]?"throw":"next"])&&!(u=u.call(t,o[1])).done)return u;switch(t=0,u&&(o=[0,u.value]),o[0]){case 0:case 1:u=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,t=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(u=(u=i.trys).length>0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0?[2,this.orgKeys]:[4,this.storageService.get(h)];case 1:if(null==(n=i.sent()))return[2,null];for(u in l=new Map,e=!1,t=[],n)t.push(u);o=0,i.label=2;case 2:return o53)throw new Error("We cannot generate numbers larger than 53 bits.");return o=Math.ceil(u/8),r=Math.pow(2,u)-1,s=Uint8Array.bind,[4,this.cryptoFunctionService.randomBytes(o)];case 1:for(a=new(s.apply(Uint8Array,[void 0,i.sent()])),d=8*(o-1),c=0;c=t?[2,this.randomNumber(n,l)]:[2,n+e]}})})},n.prototype.aesEncrypt=function(n,l){return o(this,void 0,void 0,function(){var e,t,u,o,r,a;return i(this,function(i){switch(i.label){case 0:return e=new s.EncryptedObject,t=e,[4,this.getKeyForEncryption(l)];case 1:return t.key=i.sent(),u=e,[4,this.cryptoFunctionService.randomBytes(16)];case 2:return u.iv=i.sent(),o=e,[4,this.cryptoFunctionService.aesEncrypt(n,e.iv,e.key.encKey)];case 3:return o.data=i.sent(),null==e.key.macKey?[3,5]:((r=new Uint8Array(e.iv.byteLength+e.data.byteLength)).set(new Uint8Array(e.iv),0),r.set(new Uint8Array(e.data),e.iv.byteLength),a=e,[4,this.cryptoFunctionService.hmac(r.buffer,e.key.macKey,"sha256")]);case 4:a.mac=i.sent(),i.label=5;case 5:return[2,e]}})})},n.prototype.aesDecryptToUtf8=function(n,l,e,t,u){return o(this,void 0,void 0,function(){var o,r,a,s;return i(this,function(i){switch(i.label){case 0:return[4,this.getKeyForEncryption(u)];case 1:return o=i.sent(),null!=(r=this.resolveLegacyKey(n,o)).macKey&&null==t?(console.error("mac required."),[2,null]):r.encType!==n?(console.error("encType unavailable."),[2,null]):null==(a=this.cryptoFunctionService.aesDecryptFastParameters(l,e,t,r)).macKey||null==a.mac?[3,4]:[4,this.cryptoFunctionService.hmacFast(a.macData,a.macKey,"sha256")];case 2:return s=i.sent(),[4,this.cryptoFunctionService.compareFast(a.mac,s)];case 3:if(!i.sent())return console.error("mac failed."),[2,null];i.label=4;case 4:return[2,this.cryptoFunctionService.aesDecryptFast(a)]}})})},n.prototype.aesDecryptToBytes=function(n,l,e,t,u){return o(this,void 0,void 0,function(){var o,r,a,s;return i(this,function(i){switch(i.label){case 0:return[4,this.getKeyForEncryption(u)];case 1:return o=i.sent(),null!=(r=this.resolveLegacyKey(n,o)).macKey&&null==t?[2,null]:r.encType!==n?[2,null]:null==r.macKey||null==t?[3,4]:((a=new Uint8Array(e.byteLength+l.byteLength)).set(new Uint8Array(e),0),a.set(new Uint8Array(l),e.byteLength),[4,this.cryptoFunctionService.hmac(a.buffer,r.macKey,"sha256")]);case 2:return null===(s=i.sent())?[2,null]:[4,this.cryptoFunctionService.compare(t,s)];case 3:if(!i.sent())return console.error("mac failed."),[2,null];i.label=4;case 4:return[4,this.cryptoFunctionService.aesDecrypt(l,e,r.encKey)];case 5:return[2,i.sent()]}})})},n.prototype.rsaDecrypt=function(n){return o(this,void 0,void 0,function(){var l,e,t,u,o,a,s,d,c;return i(this,function(i){switch(i.label){case 0:if(l=n.split("."),e=null,1===l.length)e=r.EncryptionType.Rsa2048_OaepSha256_B64,t=[l[0]];else if(2===l.length)try{e=parseInt(l[0],null),t=l[1].split("|")}catch(n){}switch(e){case r.EncryptionType.Rsa2048_OaepSha256_B64:case r.EncryptionType.Rsa2048_OaepSha1_B64:if(1!==t.length)throw new Error("Invalid cipher format.");break;case r.EncryptionType.Rsa2048_OaepSha256_HmacSha256_B64:case r.EncryptionType.Rsa2048_OaepSha1_HmacSha256_B64:if(2!==t.length)throw new Error("Invalid cipher format.");break;default:throw new Error("encType unavailable.")}if(null==t||t.length<=0)throw new Error("encPieces unavailable.");return u=f.Utils.fromB64ToArray(t[0]).buffer,[4,this.getEncKey()];case 1:return null!=(o=i.sent())&&null!=o.macKey&&t.length>1?(a=f.Utils.fromB64ToArray(t[1]).buffer,[4,this.cryptoFunctionService.hmac(u,o.macKey,"sha256")]):[3,4];case 2:return s=i.sent(),[4,this.cryptoFunctionService.compare(a,s)];case 3:if(!i.sent())throw new Error("MAC failed.");i.label=4;case 4:return[4,this.getPrivateKey()];case 5:if(null==(d=i.sent()))throw new Error("No private key.");switch(c="sha1",e){case r.EncryptionType.Rsa2048_OaepSha256_B64:case r.EncryptionType.Rsa2048_OaepSha256_HmacSha256_B64:c="sha256";break;case r.EncryptionType.Rsa2048_OaepSha1_B64:case r.EncryptionType.Rsa2048_OaepSha1_HmacSha256_B64:break;default:throw new Error("encType unavailable.")}return[2,this.cryptoFunctionService.rsaDecrypt(u,d,c)]}})})},n.prototype.getKeyForEncryption=function(n){return o(this,void 0,void 0,function(){var l;return i(this,function(e){switch(e.label){case 0:return null!=n?[2,n]:[4,this.getEncKey()];case 1:return null!=(l=e.sent())?[2,l]:[4,this.getKey()];case 2:return[2,e.sent()]}})})},n.prototype.resolveLegacyKey=function(n,l){return n===r.EncryptionType.AesCbc128_HmacSha256_B64&&l.encType===r.EncryptionType.AesCbc256_B64?(null==this.legacyEtmKey&&(this.legacyEtmKey=new d.SymmetricCryptoKey(l.key,r.EncryptionType.AesCbc128_HmacSha256_B64)),this.legacyEtmKey):l},n.prototype.stretchKey=function(n){return o(this,void 0,void 0,function(){var l,e,t,u,o;return i(this,function(i){switch(i.label){case 0:return l=new Uint8Array(64),t=(e=l).set,[4,this.hkdfExpand(n.key,f.Utils.fromUtf8ToArray("enc"),32)];case 1:return t.apply(e,[i.sent()]),o=(u=l).set,[4,this.hkdfExpand(n.key,f.Utils.fromUtf8ToArray("mac"),32)];case 2:return o.apply(u,[i.sent(),32]),[2,new d.SymmetricCryptoKey(l.buffer)]}})})},n.prototype.hkdfExpand=function(n,l,e){return o(this,void 0,void 0,function(){var t,u,o,r,a,s,d;return i(this,function(i){switch(i.label){case 0:t=32,u=new Uint8Array(e),o=new Uint8Array(0),r=Math.ceil(e/t),a=0,i.label=1;case 1:return a0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]-1})]}})})},l.prototype.getAllDecryptedForUrl=function(n,l){return t(this,void 0,void 0,function(){var e,t,r,a;return u(this,function(u){switch(u.label){case 0:return null!=n||l?(e=this.platformUtilsService.getDomain(n),t=null==e?Promise.resolve([]):this.settingsService.getEquivalentDomains().then(function(n){var l=[];return n.forEach(function(n){n.length&&n.indexOf(e)>=0&&(l=l.concat(n))}),l.length||l.push(e),l}),[4,Promise.all([t,this.getAllDecrypted()])]):[2,Promise.resolve([])];case 1:return r=u.sent(),a=r[0],[2,r[1].filter(function(t){if(l&&l.indexOf(t.type)>-1)return!0;if(null!=n&&t.type===o.CipherType.Login&&null!=t.login.uris)for(var u=0;u-1)return!0;break;case i.UriMatchType.Host:var s=w.Utils.getHost(n);if(null!=s&&s===w.Utils.getHost(r.uri))return!0;break;case i.UriMatchType.Exact:if(n===r.uri)return!0;break;case i.UriMatchType.StartsWith:if(n.startsWith(r.uri))return!0;break;case i.UriMatchType.RegularExpression:try{if(new RegExp(r.uri,"i").test(n))return!0}catch(n){}break;case i.UriMatchType.Never:}}return!1})]}})})},l.prototype.getLastUsedForUrl=function(n){return t(this,void 0,void 0,function(){var l;return u(this,function(e){switch(e.label){case 0:return[4,this.getAllDecryptedForUrl(n)];case 1:return 0===(l=e.sent()).length?[2,null]:[2,l.sort(this.sortCiphersByLastUsed)[0]]}})})},l.prototype.updateLastUsedDate=function(n){return t(this,void 0,void 0,function(){var l,e,t;return u(this,function(u){switch(u.label){case 0:return[4,this.storageService.get(_)];case 1:return(l=u.sent())||(l={}),l[n]?l[n].lastUsedDate=(new Date).getTime():l[n]={lastUsedDate:(new Date).getTime()},[4,this.storageService.save(_,l)];case 2:if(u.sent(),null==this.decryptedCipherCache)return[2];for(e=0;et?-1:null!=t&&null==e?1:0},l.prototype.sortCiphersByLastUsedThenName=function(n,l){var e=this.sortCiphersByLastUsed(n,l);return 0!==e?e:this.getLocaleSortingFunction()(n,l)},l.prototype.getLocaleSortingFunction=function(){var n=this;return function(l,e){var t=l.name,u=e.name;if(null==t&&null!=u)return-1;if(null!=t&&null==u)return 1;if(null==t&&null==u)return 0;var i=n.i18nService.collator?n.i18nService.collator.compare(t,u):t.localeCompare(u);return 0!==i||l.type!==o.CipherType.Login||e.type!==o.CipherType.Login?i:(null!=l.login.username&&(t+=l.login.username),null!=e.login.username&&(u+=e.login.username),n.i18nService.collator?n.i18nService.collator.compare(t,u):t.localeCompare(u))}},l.prototype.encryptObjProperty=function(n,l,e,o){return t(this,void 0,void 0,function(){var t,i,r;return u(this,function(u){switch(u.label){case 0:for(r in t=[],i=this,e)e.hasOwnProperty(r)&&function(l,u){var r=Promise.resolve().then(function(){var t=n[e[l]||l];return t&&""!==t?i.cryptoService.encrypt(t,o):null}).then(function(n){u[l]=n});t.push(r)}(r,l);return[4,Promise.all(t)];case 1:return u.sent(),[2]}})})},l.prototype.encryptCipherData=function(n,l,e){return t(this,void 0,void 0,function(){var t,i;return u(this,function(u){switch(u.label){case 0:switch(n.type){case o.CipherType.Login:return[3,1];case o.CipherType.SecureNote:return[3,7];case o.CipherType.Card:return[3,8];case o.CipherType.Identity:return[3,10]}return[3,12];case 1:return n.login=new f.Login,[4,this.encryptObjProperty(l.login,n.login,{username:null,password:null,totp:null},e)];case 2:if(u.sent(),null==l.login.uris)return[3,6];n.login.uris=[],t=0,u.label=3;case 3:return t0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]-1?[4,l.json()]:[3,3];case 2:e=u.sent(),u.label=3;case 3:return null==e?[3,6]:200!==l.status?[3,4]:[2,new g.IdentityTokenResponse(e)];case 4:return 400===l.status&&e.TwoFactorProviders2&&Object.keys(e.TwoFactorProviders2).length?[4,this.tokenService.clearTwoFactorToken(n.email)]:[3,6];case 5:return u.sent(),[2,new m.IdentityTwoFactorResponse(e)];case 6:return[2,Promise.reject(new c.ErrorResponse(e,l.status,!0))]}})})},n.prototype.refreshIdentityToken=function(){return t(this,void 0,void 0,function(){return u(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.doRefreshToken()];case 1:return n.sent(),[3,3];case 2:return n.sent(),[2,Promise.reject(null)];case 3:return[2]}})})},n.prototype.getProfile=function(){return t(this,void 0,void 0,function(){var n;return u(this,function(l){switch(l.label){case 0:return[4,this.send("GET","/accounts/profile",null,!0,!0)];case 1:return n=l.sent(),[2,new w.ProfileResponse(n)]}})})},n.prototype.getUserBilling=function(){return t(this,void 0,void 0,function(){var n;return u(this,function(l){switch(l.label){case 0:return[4,this.send("GET","/accounts/billing",null,!0,!0)];case 1:return n=l.sent(),[2,new i.BillingResponse(n)]}})})},n.prototype.putProfile=function(n){return t(this,void 0,void 0,function(){var l;return u(this,function(e){switch(e.label){case 0:return[4,this.send("PUT","/accounts/profile",n,!0,!0)];case 1:return l=e.sent(),[2,new w.ProfileResponse(l)]}})})},n.prototype.postEmailToken=function(n){return this.send("POST","/accounts/email-token",n,!0,!1)},n.prototype.postEmail=function(n){return this.send("POST","/accounts/email",n,!0,!1)},n.prototype.postPassword=function(n){return this.send("POST","/accounts/password",n,!0,!1)},n.prototype.postSecurityStamp=function(n){return this.send("POST","/accounts/security-stamp",n,!0,!1)},n.prototype.deleteAccount=function(n){return this.send("DELETE","/accounts",n,!0,!1)},n.prototype.getAccountRevisionDate=function(){return t(this,void 0,void 0,function(){return u(this,function(n){switch(n.label){case 0:return[4,this.send("GET","/accounts/revision-date",null,!0,!0)];case 1:return[2,n.sent()]}})})},n.prototype.postPasswordHint=function(n){return this.send("POST","/accounts/password-hint",n,!1,!1)},n.prototype.postRegister=function(n){return this.send("POST","/accounts/register",n,!1,!1)},n.prototype.postPremium=function(n){return this.send("POST","/accounts/premium",n,!0,!1)},n.prototype.postReinstatePremium=function(){return this.send("POST","/accounts/reinstate-premium",null,!0,!1)},n.prototype.postCancelPremium=function(){return this.send("POST","/accounts/cancel-premium",null,!0,!1)},n.prototype.postAccountStorage=function(n){return this.send("POST","/accounts/storage",n,!0,!1)},n.prototype.postAccountPayment=function(n){return this.send("POST","/accounts/payment",n,!0,!1)},n.prototype.postAccountLicense=function(n){return this.send("POST","/accounts/license",n,!0,!1)},n.prototype.postAccountKeys=function(n){return this.send("POST","/accounts/keys",n,!0,!1)},n.prototype.postAccountKey=function(n){return this.send("POST","/accounts/key",n,!0,!1)},n.prototype.postAccountVerifyEmail=function(){return this.send("POST","/accounts/verify-email",null,!0,!1)},n.prototype.postAccountVerifyEmailToken=function(n){return this.send("POST","/accounts/verify-email-token",n,!1,!1)},n.prototype.postAccountRecoverDelete=function(n){return this.send("POST","/accounts/delete-recover",n,!1,!1)},n.prototype.postAccountRecoverDeleteToken=function(n){return this.send("POST","/accounts/delete-recover-token",n,!1,!1)},n.prototype.postFolder=function(n){return t(this,void 0,void 0,function(){var l;return u(this,function(e){switch(e.label){case 0:return[4,this.send("POST","/folders",n,!0,!0)];case 1:return l=e.sent(),[2,new f.FolderResponse(l)]}})})},n.prototype.putFolder=function(n,l){return t(this,void 0,void 0,function(){var e;return u(this,function(t){switch(t.label){case 0:return[4,this.send("PUT","/folders/"+n,l,!0,!0)];case 1:return e=t.sent(),[2,new f.FolderResponse(e)]}})})},n.prototype.deleteFolder=function(n){return this.send("DELETE","/folders/"+n,null,!0,!1)},n.prototype.getCipher=function(n){return t(this,void 0,void 0,function(){var l;return u(this,function(e){switch(e.label){case 0:return[4,this.send("GET","/ciphers/"+n,null,!0,!0)];case 1:return l=e.sent(),[2,new r.CipherResponse(l)]}})})},n.prototype.getCipherAdmin=function(n){return t(this,void 0,void 0,function(){var l;return u(this,function(e){switch(e.label){case 0:return[4,this.send("GET","/ciphers/"+n+"/admin",null,!0,!0)];case 1:return l=e.sent(),[2,new r.CipherResponse(l)]}})})},n.prototype.getCiphersOrganization=function(n){return t(this,void 0,void 0,function(){var l;return u(this,function(e){switch(e.label){case 0:return[4,this.send("GET","/ciphers/organization-details?organizationId="+n,null,!0,!0)];case 1:return l=e.sent(),[2,new y.ListResponse(l,r.CipherResponse)]}})})},n.prototype.postCipher=function(n){return t(this,void 0,void 0,function(){var l;return u(this,function(e){switch(e.label){case 0:return[4,this.send("POST","/ciphers",n,!0,!0)];case 1:return l=e.sent(),[2,new r.CipherResponse(l)]}})})},n.prototype.postCipherAdmin=function(n){return t(this,void 0,void 0,function(){var l;return u(this,function(e){switch(e.label){case 0:return[4,this.send("POST","/ciphers/admin",n,!0,!0)];case 1:return l=e.sent(),[2,new r.CipherResponse(l)]}})})},n.prototype.putCipher=function(n,l){return t(this,void 0,void 0,function(){var e;return u(this,function(t){switch(t.label){case 0:return[4,this.send("PUT","/ciphers/"+n,l,!0,!0)];case 1:return e=t.sent(),[2,new r.CipherResponse(e)]}})})},n.prototype.putCipherAdmin=function(n,l){return t(this,void 0,void 0,function(){var e;return u(this,function(t){switch(t.label){case 0:return[4,this.send("PUT","/ciphers/"+n+"/admin",l,!0,!0)];case 1:return e=t.sent(),[2,new r.CipherResponse(e)]}})})},n.prototype.deleteCipher=function(n){return this.send("DELETE","/ciphers/"+n,null,!0,!1)},n.prototype.deleteCipherAdmin=function(n){return this.send("DELETE","/ciphers/"+n+"/admin",null,!0,!1)},n.prototype.deleteManyCiphers=function(n){return this.send("DELETE","/ciphers",n,!0,!1)},n.prototype.putMoveCiphers=function(n){return this.send("PUT","/ciphers/move",n,!0,!1)},n.prototype.putShareCipher=function(n,l){return this.send("PUT","/ciphers/"+n+"/share",l,!0,!1)},n.prototype.putShareCiphers=function(n){return this.send("PUT","/ciphers/share",n,!0,!1)},n.prototype.putCipherCollections=function(n,l){return this.send("PUT","/ciphers/"+n+"/collections",l,!0,!1)},n.prototype.putCipherCollectionsAdmin=function(n,l){return this.send("PUT","/ciphers/"+n+"/collections-admin",l,!0,!1)},n.prototype.postPurgeCiphers=function(n){return this.send("POST","/ciphers/purge",n,!0,!1)},n.prototype.postImportCiphers=function(n){return this.send("POST","/ciphers/import",n,!0,!1)},n.prototype.postImportOrganizationCiphers=function(n,l){return this.send("POST","/ciphers/import-organization?organizationId="+n,l,!0,!1)},n.prototype.postCipherAttachment=function(n,l){return t(this,void 0,void 0,function(){var e;return u(this,function(t){switch(t.label){case 0:return[4,this.send("POST","/ciphers/"+n+"/attachment",l,!0,!0)];case 1:return e=t.sent(),[2,new r.CipherResponse(e)]}})})},n.prototype.postCipherAttachmentAdmin=function(n,l){return t(this,void 0,void 0,function(){var e;return u(this,function(t){switch(t.label){case 0:return[4,this.send("POST","/ciphers/"+n+"/attachment-admin",l,!0,!0)];case 1:return e=t.sent(),[2,new r.CipherResponse(e)]}})})},n.prototype.deleteCipherAttachment=function(n,l){return this.send("DELETE","/ciphers/"+n+"/attachment/"+l,null,!0,!1)},n.prototype.deleteCipherAttachmentAdmin=function(n,l){return this.send("DELETE","/ciphers/"+n+"/attachment/"+l+"/admin",null,!0,!1)},n.prototype.postShareCipherAttachment=function(n,l,e,t){return this.send("POST","/ciphers/"+n+"/attachment/"+l+"/share?organizationId="+t,e,!0,!1)},n.prototype.getCollectionDetails=function(n,l){return t(this,void 0,void 0,function(){var e;return u(this,function(t){switch(t.label){case 0:return[4,this.send("GET","/organizations/"+n+"/collections/"+l+"/details",null,!0,!0)];case 1:return e=t.sent(),[2,new a.CollectionGroupDetailsResponse(e)]}})})},n.prototype.getCollections=function(n){return t(this,void 0,void 0,function(){var l;return u(this,function(e){switch(e.label){case 0:return[4,this.send("GET","/organizations/"+n+"/collections",null,!0,!0)];case 1:return l=e.sent(),[2,new y.ListResponse(l,a.CollectionResponse)]}})})},n.prototype.getCollectionUsers=function(n,l){return t(this,void 0,void 0,function(){var e;return u(this,function(t){switch(t.label){case 0:return[4,this.send("GET","/organizations/"+n+"/collections/"+l+"/users",null,!0,!0)];case 1:return e=t.sent(),[2,new y.ListResponse(e,s.CollectionUserResponse)]}})})},n.prototype.postCollection=function(n,l){return t(this,void 0,void 0,function(){var e;return u(this,function(t){switch(t.label){case 0:return[4,this.send("POST","/organizations/"+n+"/collections",l,!0,!0)];case 1:return e=t.sent(),[2,new a.CollectionResponse(e)]}})})},n.prototype.putCollection=function(n,l,e){return t(this,void 0,void 0,function(){var t;return u(this,function(u){switch(u.label){case 0:return[4,this.send("PUT","/organizations/"+n+"/collections/"+l,e,!0,!0)];case 1:return t=u.sent(),[2,new a.CollectionResponse(t)]}})})},n.prototype.deleteCollection=function(n,l){return this.send("DELETE","/organizations/"+n+"/collections/"+l,null,!0,!1)},n.prototype.deleteCollectionUser=function(n,l,e){return this.send("DELETE","/organizations/"+n+"/collections/"+l+"/user/"+e,null,!0,!1)},n.prototype.getGroupDetails=function(n,l){return t(this,void 0,void 0,function(){var e;return u(this,function(t){switch(t.label){case 0:return[4,this.send("GET","/organizations/"+n+"/groups/"+l+"/details",null,!0,!0)];case 1:return e=t.sent(),[2,new v.GroupDetailsResponse(e)]}})})},n.prototype.getGroups=function(n){return t(this,void 0,void 0,function(){var l;return u(this,function(e){switch(e.label){case 0:return[4,this.send("GET","/organizations/"+n+"/groups",null,!0,!0)];case 1:return l=e.sent(),[2,new y.ListResponse(l,v.GroupResponse)]}})})},n.prototype.getGroupUsers=function(n,l){return t(this,void 0,void 0,function(){var e;return u(this,function(t){switch(t.label){case 0:return[4,this.send("GET","/organizations/"+n+"/groups/"+l+"/users",null,!0,!0)];case 1:return e=t.sent(),[2,new y.ListResponse(e,h.GroupUserResponse)]}})})},n.prototype.postGroup=function(n,l){return t(this,void 0,void 0,function(){var e;return u(this,function(t){switch(t.label){case 0:return[4,this.send("POST","/organizations/"+n+"/groups",l,!0,!0)];case 1:return e=t.sent(),[2,new v.GroupResponse(e)]}})})},n.prototype.putGroup=function(n,l,e){return t(this,void 0,void 0,function(){var t;return u(this,function(u){switch(u.label){case 0:return[4,this.send("PUT","/organizations/"+n+"/groups/"+l,e,!0,!0)];case 1:return t=u.sent(),[2,new v.GroupResponse(t)]}})})},n.prototype.deleteGroup=function(n,l){return this.send("DELETE","/organizations/"+n+"/groups/"+l,null,!0,!1)},n.prototype.deleteGroupUser=function(n,l,e){return this.send("DELETE","/organizations/"+n+"/groups/"+l+"/user/"+e,null,!0,!1)},n.prototype.getOrganizationUser=function(n,l){return t(this,void 0,void 0,function(){var e;return u(this,function(t){switch(t.label){case 0:return[4,this.send("GET","/organizations/"+n+"/users/"+l,null,!0,!0)];case 1:return e=t.sent(),[2,new S.OrganizationUserDetailsResponse(e)]}})})},n.prototype.getOrganizationUserGroups=function(n,l){return t(this,void 0,void 0,function(){return u(this,function(e){switch(e.label){case 0:return[4,this.send("GET","/organizations/"+n+"/users/"+l+"/groups",null,!0,!0)];case 1:return[2,e.sent()]}})})},n.prototype.getOrganizationUsers=function(n){return t(this,void 0,void 0,function(){var l;return u(this,function(e){switch(e.label){case 0:return[4,this.send("GET","/organizations/"+n+"/users",null,!0,!0)];case 1:return l=e.sent(),[2,new y.ListResponse(l,S.OrganizationUserUserDetailsResponse)]}})})},n.prototype.postOrganizationUserInvite=function(n,l){return this.send("POST","/organizations/"+n+"/users/invite",l,!0,!1)},n.prototype.postOrganizationUserReinvite=function(n,l){return this.send("POST","/organizations/"+n+"/users/"+l+"/reinvite",null,!0,!1)},n.prototype.postOrganizationUserAccept=function(n,l,e){return this.send("POST","/organizations/"+n+"/users/"+l+"/accept",e,!0,!1)},n.prototype.postOrganizationUserConfirm=function(n,l,e){return this.send("POST","/organizations/"+n+"/users/"+l+"/confirm",e,!0,!1)},n.prototype.putOrganizationUser=function(n,l,e){return this.send("PUT","/organizations/"+n+"/users/"+l,e,!0,!1)},n.prototype.putOrganizationUserGroups=function(n,l,e){return this.send("PUT","/organizations/"+n+"/users/"+l+"/groups",e,!0,!1)},n.prototype.deleteOrganizationUser=function(n,l){return this.send("DELETE","/organizations/"+n+"/users/"+l,null,!0,!1)},n.prototype.getSync=function(){return t(this,void 0,void 0,function(){var n,l;return u(this,function(e){switch(e.label){case 0:return n=this.isDesktopClient||this.isWebClient?"/sync?excludeDomains=true":"/sync",[4,this.send("GET",n,null,!0,!0)];case 1:return l=e.sent(),[2,new R.SyncResponse(l)]}})})},n.prototype.postImportDirectory=function(n,l){return t(this,void 0,void 0,function(){return u(this,function(e){return[2,this.send("POST","/organizations/"+n+"/import",l,!0,!1)]})})},n.prototype.getSettingsDomains=function(){return t(this,void 0,void 0,function(){var n;return u(this,function(l){switch(l.label){case 0:return[4,this.send("GET","/settings/domains",null,!0,!0)];case 1:return n=l.sent(),[2,new d.DomainsResponse(n)]}})})},n.prototype.putSettingsDomains=function(n){return t(this,void 0,void 0,function(){var l;return u(this,function(e){switch(e.label){case 0:return[4,this.send("PUT","/settings/domains",n,!0,!0)];case 1:return l=e.sent(),[2,new d.DomainsResponse(l)]}})})},n.prototype.getTwoFactorProviders=function(){return t(this,void 0,void 0,function(){var n;return u(this,function(l){switch(l.label){case 0:return[4,this.send("GET","/two-factor",null,!0,!0)];case 1:return n=l.sent(),[2,new y.ListResponse(n,E.TwoFactorProviderResponse)]}})})},n.prototype.getTwoFactorOrganizationProviders=function(n){return t(this,void 0,void 0,function(){var l;return u(this,function(e){switch(e.label){case 0:return[4,this.send("GET","/organizations/"+n+"/two-factor",null,!0,!0)];case 1:return l=e.sent(),[2,new y.ListResponse(l,E.TwoFactorProviderResponse)]}})})},n.prototype.getTwoFactorAuthenticator=function(n){return t(this,void 0,void 0,function(){var l;return u(this,function(e){switch(e.label){case 0:return[4,this.send("POST","/two-factor/get-authenticator",n,!0,!0)];case 1:return l=e.sent(),[2,new _.TwoFactorAuthenticatorResponse(l)]}})})},n.prototype.getTwoFactorEmail=function(n){return t(this,void 0,void 0,function(){var l;return u(this,function(e){switch(e.label){case 0:return[4,this.send("POST","/two-factor/get-email",n,!0,!0)];case 1:return l=e.sent(),[2,new A.TwoFactorEmailResponse(l)]}})})},n.prototype.getTwoFactorDuo=function(n){return t(this,void 0,void 0,function(){var l;return u(this,function(e){switch(e.label){case 0:return[4,this.send("POST","/two-factor/get-duo",n,!0,!0)];case 1:return l=e.sent(),[2,new I.TwoFactorDuoResponse(l)]}})})},n.prototype.getTwoFactorOrganizationDuo=function(n,l){return t(this,void 0,void 0,function(){var e;return u(this,function(t){switch(t.label){case 0:return[4,this.send("POST","/organizations/"+n+"/two-factor/get-duo",l,!0,!0)];case 1:return e=t.sent(),[2,new I.TwoFactorDuoResponse(e)]}})})},n.prototype.getTwoFactorYubiKey=function(n){return t(this,void 0,void 0,function(){var l;return u(this,function(e){switch(e.label){case 0:return[4,this.send("POST","/two-factor/get-yubikey",n,!0,!0)];case 1:return l=e.sent(),[2,new T.TwoFactorYubiKeyResponse(l)]}})})},n.prototype.getTwoFactorU2f=function(n){return t(this,void 0,void 0,function(){var l;return u(this,function(e){switch(e.label){case 0:return[4,this.send("POST","/two-factor/get-u2f",n,!0,!0)];case 1:return l=e.sent(),[2,new N.TwoFactorU2fResponse(l)]}})})},n.prototype.getTwoFactorRecover=function(n){return t(this,void 0,void 0,function(){var l;return u(this,function(e){switch(e.label){case 0:return[4,this.send("POST","/two-factor/get-recover",n,!0,!0)];case 1:return l=e.sent(),[2,new O.TwoFactorRecoverResponse(l)]}})})},n.prototype.putTwoFactorAuthenticator=function(n){return t(this,void 0,void 0,function(){var l;return u(this,function(e){switch(e.label){case 0:return[4,this.send("PUT","/two-factor/authenticator",n,!0,!0)];case 1:return l=e.sent(),[2,new _.TwoFactorAuthenticatorResponse(l)]}})})},n.prototype.putTwoFactorEmail=function(n){return t(this,void 0,void 0,function(){var l;return u(this,function(e){switch(e.label){case 0:return[4,this.send("PUT","/two-factor/email",n,!0,!0)];case 1:return l=e.sent(),[2,new A.TwoFactorEmailResponse(l)]}})})},n.prototype.putTwoFactorDuo=function(n){return t(this,void 0,void 0,function(){var l;return u(this,function(e){switch(e.label){case 0:return[4,this.send("PUT","/two-factor/duo",n,!0,!0)];case 1:return l=e.sent(),[2,new I.TwoFactorDuoResponse(l)]}})})},n.prototype.putTwoFactorOrganizationDuo=function(n,l){return t(this,void 0,void 0,function(){var e;return u(this,function(t){switch(t.label){case 0:return[4,this.send("PUT","/organizations/"+n+"/two-factor/duo",l,!0,!0)];case 1:return e=t.sent(),[2,new I.TwoFactorDuoResponse(e)]}})})},n.prototype.putTwoFactorYubiKey=function(n){return t(this,void 0,void 0,function(){var l;return u(this,function(e){switch(e.label){case 0:return[4,this.send("PUT","/two-factor/yubikey",n,!0,!0)];case 1:return l=e.sent(),[2,new T.TwoFactorYubiKeyResponse(l)]}})})},n.prototype.putTwoFactorU2f=function(n){return t(this,void 0,void 0,function(){var l;return u(this,function(e){switch(e.label){case 0:return[4,this.send("PUT","/two-factor/u2f",n,!0,!0)];case 1:return l=e.sent(),[2,new N.TwoFactorU2fResponse(l)]}})})},n.prototype.putTwoFactorDisable=function(n){return t(this,void 0,void 0,function(){var l;return u(this,function(e){switch(e.label){case 0:return[4,this.send("PUT","/two-factor/disable",n,!0,!0)];case 1:return l=e.sent(),[2,new E.TwoFactorProviderResponse(l)]}})})},n.prototype.putTwoFactorOrganizationDisable=function(n,l){return t(this,void 0,void 0,function(){var e;return u(this,function(t){switch(t.label){case 0:return[4,this.send("PUT","/organizations/"+n+"/two-factor/disable",l,!0,!0)];case 1:return e=t.sent(),[2,new E.TwoFactorProviderResponse(e)]}})})},n.prototype.postTwoFactorRecover=function(n){return this.send("POST","/two-factor/recover",n,!1,!1)},n.prototype.postTwoFactorEmailSetup=function(n){return this.send("POST","/two-factor/send-email",n,!0,!1)},n.prototype.postTwoFactorEmail=function(n){return this.send("POST","/two-factor/send-email-login",n,!1,!1)},n.prototype.getOrganization=function(n){return t(this,void 0,void 0,function(){var l;return u(this,function(e){switch(e.label){case 0:return[4,this.send("GET","/organizations/"+n,null,!0,!0)];case 1:return l=e.sent(),[2,new b.OrganizationResponse(l)]}})})},n.prototype.getOrganizationBilling=function(n){return t(this,void 0,void 0,function(){var l;return u(this,function(e){switch(e.label){case 0:return[4,this.send("GET","/organizations/"+n+"/billing",null,!0,!0)];case 1:return l=e.sent(),[2,new C.OrganizationBillingResponse(l)]}})})},n.prototype.getOrganizationLicense=function(n,l){return t(this,void 0,void 0,function(){return u(this,function(e){return[2,this.send("GET","/organizations/"+n+"/license?installationId="+l,null,!0,!0)]})})},n.prototype.postOrganization=function(n){return t(this,void 0,void 0,function(){var l;return u(this,function(e){switch(e.label){case 0:return[4,this.send("POST","/organizations",n,!0,!0)];case 1:return l=e.sent(),[2,new b.OrganizationResponse(l)]}})})},n.prototype.putOrganization=function(n,l){return t(this,void 0,void 0,function(){var e;return u(this,function(t){switch(t.label){case 0:return[4,this.send("PUT","/organizations/"+n,l,!0,!0)];case 1:return e=t.sent(),[2,new b.OrganizationResponse(e)]}})})},n.prototype.postLeaveOrganization=function(n){return this.send("POST","/organizations/"+n+"/leave",null,!0,!1)},n.prototype.postOrganizationLicense=function(n){return t(this,void 0,void 0,function(){var l;return u(this,function(e){switch(e.label){case 0:return[4,this.send("POST","/organizations/license",n,!0,!0)];case 1:return l=e.sent(),[2,new b.OrganizationResponse(l)]}})})},n.prototype.postOrganizationLicenseUpdate=function(n,l){return t(this,void 0,void 0,function(){return u(this,function(e){return[2,this.send("POST","/organizations/"+n+"/license",l,!0,!1)]})})},n.prototype.postOrganizationSeat=function(n,l){return this.send("POST","/organizations/"+n+"/seat",l,!0,!1)},n.prototype.postOrganizationStorage=function(n,l){return this.send("POST","/organizations/"+n+"/storage",l,!0,!1)},n.prototype.postOrganizationPayment=function(n,l){return this.send("POST","/organizations/"+n+"/payment",l,!0,!1)},n.prototype.postOrganizationVerifyBank=function(n,l){return this.send("POST","/organizations/"+n+"/verify-bank",l,!0,!1)},n.prototype.postOrganizationCancel=function(n){return this.send("POST","/organizations/"+n+"/cancel",null,!0,!1)},n.prototype.postOrganizationReinstate=function(n){return this.send("POST","/organizations/"+n+"/reinstate",null,!0,!1)},n.prototype.deleteOrganization=function(n,l){return this.send("DELETE","/organizations/"+n,l,!0,!1)},n.prototype.getEvents=function(n,l,e){return t(this,void 0,void 0,function(){var t;return u(this,function(u){switch(u.label){case 0:return[4,this.send("GET",this.addEventParameters("/events",n,l,e),null,!0,!0)];case 1:return t=u.sent(),[2,new y.ListResponse(t,p.EventResponse)]}})})},n.prototype.getEventsCipher=function(n,l,e,o){return t(this,void 0,void 0,function(){var t;return u(this,function(u){switch(u.label){case 0:return[4,this.send("GET",this.addEventParameters("/ciphers/"+n+"/events",l,e,o),null,!0,!0)];case 1:return t=u.sent(),[2,new y.ListResponse(t,p.EventResponse)]}})})},n.prototype.getEventsOrganization=function(n,l,e,o){return t(this,void 0,void 0,function(){var t;return u(this,function(u){switch(u.label){case 0:return[4,this.send("GET",this.addEventParameters("/organizations/"+n+"/events",l,e,o),null,!0,!0)];case 1:return t=u.sent(),[2,new y.ListResponse(t,p.EventResponse)]}})})},n.prototype.getEventsOrganizationUser=function(n,l,e,o,i){return t(this,void 0,void 0,function(){var t;return u(this,function(u){switch(u.label){case 0:return[4,this.send("GET",this.addEventParameters("/organizations/"+n+"/users/"+l+"/events",e,o,i),null,!0,!0)];case 1:return t=u.sent(),[2,new y.ListResponse(t,p.EventResponse)]}})})},n.prototype.getUserPublicKey=function(n){return t(this,void 0,void 0,function(){var l;return u(this,function(e){switch(e.label){case 0:return[4,this.send("GET","/users/"+n+"/public-key",null,!0,!0)];case 1:return l=e.sent(),[2,new k.UserKeyResponse(l)]}})})},n.prototype.fetch=function(n){return"GET"===n.method&&(n.headers.set("Cache-Control","no-cache"),n.headers.set("Pragma","no-cache")),fetch(n)},n.prototype.send=function(n,l,e,o,i){return t(this,void 0,void 0,function(){var t,r,a,s,d;return u(this,function(u){switch(u.label){case 0:return t=new Headers({"Device-Type":this.deviceType}),r={cache:"no-cache",credentials:this.getCredentials(),method:n},o?[4,this.handleTokenState()]:[3,2];case 1:a=u.sent(),t.set("Authorization",a),u.label=2;case 2:return null!=e&&("string"==typeof e?(r.body=e,t.set("Content-Type","application/x-www-form-urlencoded; charset=utf-8")):"object"==typeof e&&(e instanceof FormData?r.body=e:(t.set("Content-Type","application/json; charset=utf-8"),r.body=JSON.stringify(e)))),i&&t.set("Accept","application/json"),r.headers=t,[4,this.fetch(new Request(this.apiBaseUrl+l,r))];case 3:return s=u.sent(),i&&200===s.status?[4,s.json()]:[3,5];case 4:return[2,u.sent()];case 5:return 200===s.status?[3,7]:[4,this.handleError(s,!1)];case 6:return d=u.sent(),[2,Promise.reject(d)];case 7:return[2]}})})},n.prototype.handleError=function(n,l){return t(this,void 0,void 0,function(){var e,t;return u(this,function(u){switch(u.label){case 0:return l&&400===n.status||401===n.status||403===n.status?[4,this.logoutCallback(!0)]:[3,2];case 1:return u.sent(),[2,null];case 2:return e=null,null!=(t=n.headers.get("content-type"))&&t.indexOf("application/json")>-1?[4,n.json()]:[3,4];case 3:e=u.sent(),u.label=4;case 4:return[2,new c.ErrorResponse(e,n.status,l)]}})})},n.prototype.handleTokenState=function(){return t(this,void 0,void 0,function(){var n,l;return u(this,function(e){switch(e.label){case 0:return[4,this.tokenService.getToken()];case 1:return n=e.sent(),this.tokenService.tokenNeedsRefresh()?[4,this.doRefreshToken()]:[3,3];case 2:l=e.sent(),n=l.accessToken,e.label=3;case 3:return[2,"Bearer "+n]}})})},n.prototype.doRefreshToken=function(){return t(this,void 0,void 0,function(){var n,l,e,t,o,i;return u(this,function(u){switch(u.label){case 0:return[4,this.tokenService.getRefreshToken()];case 1:if(null==(n=u.sent())||""===n)throw new Error;return l=this.tokenService.decodeToken(),[4,this.fetch(new Request(this.identityBaseUrl+"/connect/token",{body:this.qsStringify({grant_type:"refresh_token",client_id:l.client_id,refresh_token:n}),cache:"no-cache",credentials:this.getCredentials(),headers:new Headers({"Content-Type":"application/x-www-form-urlencoded; charset=utf-8",Accept:"application/json","Device-Type":this.deviceType}),method:"POST"}))];case 2:return 200!==(e=u.sent()).status?[3,5]:[4,e.json()];case 3:return t=u.sent(),o=new g.IdentityTokenResponse(t),[4,this.tokenService.setTokens(o.accessToken,o.refreshToken)];case 4:return u.sent(),[2,o];case 5:return[4,this.handleError(e,!0)];case 6:return i=u.sent(),[2,Promise.reject(i)]}})})},n.prototype.qsStringify=function(n){return Object.keys(n).map(function(l){return encodeURIComponent(l)+"="+encodeURIComponent(n[l])}).join("&")},n.prototype.getCredentials=function(){if(!this.isWebClient||this.usingBaseUrl)return"include"},n.prototype.addEventParameters=function(n,l,e,t){return null!=l&&(n+="?start="+l),null!=e&&(n+=n.indexOf("?")>-1?"&":"?",n+="end="+e),null!=t&&(n+=n.indexOf("?")>-1?"&":"?",n+="continuationToken="+t),n},n}();l.ApiService=V},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});e(0),e(13);var t=function(){function n(n,l){this.elementRef=n,this.renderer=l,this.trueValue=!0,this.falseValue=!1,this.propagateChange=function(n){}}return n.prototype.onHostChange=function(n){this.propagateChange(n.target.checked?this.trueValue:this.falseValue)},n.prototype.writeValue=function(n){n===this.trueValue?this.renderer.setProperty(this.elementRef.nativeElement,"checked",!0):this.renderer.setProperty(this.elementRef.nativeElement,"checked",!1)},n.prototype.registerOnChange=function(n){this.propagateChange=n},n.prototype.registerOnTouched=function(n){},n.prototype.setDisabledState=function(n){},n}();l.TrueFalseValueDirective=t},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});e(0);var t=function(){function n(n){this.elRef=n,this.el=null,this.el=n.nativeElement}return n.prototype.ngOnInit=function(){var n=this;this.formEls=Array.from(this.el.querySelectorAll('input:not([type="hidden"]), select, textarea')),this.formEls.forEach(function(l){l.addEventListener("focus",function(l){n.el.classList.add("active")},!1),l.addEventListener("blur",function(l){n.el.classList.remove("active")},!1)})},n.prototype.onClick=function(n){if(n.target===this.el&&this.formEls.length>0){var l=this.formEls[0];if("input"===l.tagName.toLowerCase()){var e=l;if(null!=e.type&&"checkbox"===e.type.toLowerCase())return void e.click()}l.focus()}},n}();l.BoxRowDirective=t},function(n,l,e){"use strict";var t=this&&this.__awaiter||function(n,l,e,t){return new(e||(e=Promise))(function(u,o){function i(n){try{a(t.next(n))}catch(n){o(n)}}function r(n){try{a(t.throw(n))}catch(n){o(n)}}function a(n){n.done?u(n.value):new e(function(l){l(n.value)}).then(i,r)}a((t=t.apply(n,l||[])).next())})},u=this&&this.__generator||function(n,l){var e,t,u,o,i={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return o={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function r(o){return function(r){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;i;)try{if(e=1,t&&(u=t[2&o[0]?"return":o[0]?"throw":"next"])&&!(u=u.call(t,o[1])).done)return u;switch(t=0,u&&(o=[0,u.value]),o[0]){case 0:case 1:u=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,t=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(u=(u=i.trys).length>0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&(l[0].checked=!0)}),[3,5];case 4:return u.sent(),[3,5];case 5:return this.loading=!1,[2]}})})},n.prototype.check=function(n,l){n.checked=null==l?!n.checked:l,n.checked||(n.readOnly=!1)},n.prototype.selectAll=function(n){var l=this;this.groups.forEach(function(e){return l.check(e,n)})},n.prototype.submit=function(){return t(this,void 0,void 0,function(){var n;return u(this,function(l){switch(l.label){case 0:(n=new i.OrganizationUserUpdateGroupsRequest).groupIds=this.groups.filter(function(n){return n.checked}).map(function(n){return n.id}),l.label=1;case 1:return l.trys.push([1,3,,4]),this.formPromise=this.apiService.putOrganizationUserGroups(this.organizationId,this.organizationUserId,n),[4,this.formPromise];case 2:return l.sent(),this.analytics.eventTrack.next({action:"Edited User Groups"}),this.toasterService.popAsync("success",null,this.i18nService.t("editedGroupsForUser",this.name)),this.onSavedUser.emit(),[3,4];case 3:return l.sent(),[3,4];case 4:return[2]}})})},n}();l.UserGroupsComponent=a},function(n,l,e){"use strict";var t=this&&this.__awaiter||function(n,l,e,t){return new(e||(e=Promise))(function(u,o){function i(n){try{a(t.next(n))}catch(n){o(n)}}function r(n){try{a(t.throw(n))}catch(n){o(n)}}function a(n){n.done?u(n.value):new e(function(l){l(n.value)}).then(i,r)}a((t=t.apply(n,l||[])).next())})},u=this&&this.__generator||function(n,l){var e,t,u,o,i={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return o={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function r(o){return function(r){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;i;)try{if(e=1,t&&(u=t[2&o[0]?"return":o[0]?"throw":"next"])&&!(u=u.call(t,o[1])).done)return u;switch(t=0,u&&(o=[0,u.value]),o[0]){case 0:case 1:u=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,t=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(u=(u=i.trys).length>0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&(e[0].checked=!0,e[0].readOnly=n.readOnly)}),[3,5];case 4:return e.sent(),[3,5];case 5:return[3,7];case 6:this.title=this.i18nService.t("inviteUser"),e.label=7;case 7:return this.loading=!1,[2]}})})},n.prototype.loadCollections=function(){return t(this,void 0,void 0,function(){var n,l,e;return u(this,function(t){switch(t.label){case 0:return[4,this.apiService.getCollections(this.organizationId)];case 1:return n=t.sent(),l=n.data.map(function(n){return new r.Collection(new i.CollectionData(n))}),e=this,[4,this.collectionService.decryptMany(l)];case 2:return e.collections=t.sent(),[2]}})})},n.prototype.check=function(n,l){n.checked=null==l?!n.checked:l,n.checked||(n.readOnly=!1)},n.prototype.selectAll=function(n){var l=this;this.collections.forEach(function(e){return l.check(e,n)})},n.prototype.submit=function(){return t(this,void 0,void 0,function(){var n,l;return u(this,function(e){switch(e.label){case 0:n=null,"all"!==this.access&&(n=this.collections.filter(function(n){return n.checked}).map(function(n){return new d.SelectionReadOnlyRequest(n.id,!!n.readOnly)})),e.label=1;case 1:return e.trys.push([1,3,,4]),this.editMode?((l=new s.OrganizationUserUpdateRequest).accessAll="all"===this.access,l.type=this.type,l.collections=n,this.formPromise=this.apiService.putOrganizationUser(this.organizationId,this.organizationUserId,l)):((l=new a.OrganizationUserInviteRequest).emails=this.emails.trim().split(/\s*,\s*/),l.accessAll="all"===this.access,l.type=this.type,l.collections=n,this.formPromise=this.apiService.postOrganizationUserInvite(this.organizationId,l)),[4,this.formPromise];case 2:return e.sent(),this.analytics.eventTrack.next({action:this.editMode?"Edited User":"Invited User"}),this.toasterService.popAsync("success",null,this.i18nService.t(this.editMode?"editedUserId":"invitedUsers",this.name)),this.onSavedUser.emit(),[3,4];case 3:return e.sent(),[3,4];case 4:return[2]}})})},n.prototype.delete=function(){return t(this,void 0,void 0,function(){return u(this,function(n){switch(n.label){case 0:return this.editMode?[4,this.platformUtilsService.showDialog(this.i18nService.t("removeUserConfirmation"),this.name,this.i18nService.t("yes"),this.i18nService.t("no"),"warning")]:[2];case 1:if(!n.sent())return[2,!1];n.label=2;case 2:return n.trys.push([2,4,,5]),this.deletePromise=this.apiService.deleteOrganizationUser(this.organizationId,this.organizationUserId),[4,this.deletePromise];case 3:return n.sent(),this.analytics.eventTrack.next({action:"Deleted User"}),this.toasterService.popAsync("success",null,this.i18nService.t("removedUserId",this.name)),this.onDeletedUser.emit(),[3,5];case 4:return n.sent(),[3,5];case 5:return[2]}})})},n}();l.UserAddEditComponent=p},function(n,l,e){"use strict";var t=this&&this.__awaiter||function(n,l,e,t){return new(e||(e=Promise))(function(u,o){function i(n){try{a(t.next(n))}catch(n){o(n)}}function r(n){try{a(t.throw(n))}catch(n){o(n)}}function a(n){n.done?u(n.value):new e(function(l){l(n.value)}).then(i,r)}a((t=t.apply(n,l||[])).next())})},u=this&&this.__generator||function(n,l){var e,t,u,o,i={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return o={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function r(o){return function(r){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;i;)try{if(e=1,t&&(u=t[2&o[0]?"return":o[0]?"throw":"next"])&&!(u=u.call(t,o[1])).done)return u;switch(t=0,u&&(o=[0,u.value]),o[0]){case 0:case 1:u=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,t=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(u=(u=i.trys).length>0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&(e[0].checked=!0,e[0].readOnly=n.readOnly)}),[3,5];case 4:return e.sent(),[3,5];case 5:return[3,7];case 6:this.title=this.i18nService.t("addGroup"),e.label=7;case 7:return this.loading=!1,[2]}})})},n.prototype.loadCollections=function(){return t(this,void 0,void 0,function(){var n,l,e;return u(this,function(t){switch(t.label){case 0:return[4,this.apiService.getCollections(this.organizationId)];case 1:return n=t.sent(),l=n.data.map(function(n){return new r.Collection(new i.CollectionData(n))}),e=this,[4,this.collectionService.decryptMany(l)];case 2:return e.collections=t.sent(),[2]}})})},n.prototype.check=function(n,l){n.checked=null==l?!n.checked:l,n.checked||(n.readOnly=!1)},n.prototype.selectAll=function(n){var l=this;this.collections.forEach(function(e){return l.check(e,n)})},n.prototype.submit=function(){return t(this,void 0,void 0,function(){var n;return u(this,function(l){switch(l.label){case 0:(n=new a.GroupRequest).name=this.name,n.externalId=this.externalId,n.accessAll="all"===this.access,n.accessAll||(n.collections=this.collections.filter(function(n){return n.checked}).map(function(n){return new s.SelectionReadOnlyRequest(n.id,!!n.readOnly)})),l.label=1;case 1:return l.trys.push([1,3,,4]),this.editMode?this.formPromise=this.apiService.putGroup(this.organizationId,this.groupId,n):this.formPromise=this.apiService.postGroup(this.organizationId,n),[4,this.formPromise];case 2:return l.sent(),this.analytics.eventTrack.next({action:this.editMode?"Edited Group":"Created Group"}),this.toasterService.popAsync("success",null,this.i18nService.t(this.editMode?"editedGroupId":"createdGroupId",this.name)),this.onSavedGroup.emit(),[3,4];case 3:return l.sent(),[3,4];case 4:return[2]}})})},n.prototype.delete=function(){return t(this,void 0,void 0,function(){return u(this,function(n){switch(n.label){case 0:return this.editMode?[4,this.platformUtilsService.showDialog(this.i18nService.t("deleteGroupConfirmation"),this.name,this.i18nService.t("yes"),this.i18nService.t("no"),"warning")]:[2];case 1:if(!n.sent())return[2,!1];n.label=2;case 2:return n.trys.push([2,4,,5]),this.deletePromise=this.apiService.deleteGroup(this.organizationId,this.groupId),[4,this.deletePromise];case 3:return n.sent(),this.analytics.eventTrack.next({action:"Deleted Group"}),this.toasterService.popAsync("success",null,this.i18nService.t("deletedGroupId",this.name)),this.onDeletedGroup.emit(),[3,5];case 4:return n.sent(),[3,5];case 5:return[2]}})})},n}();l.GroupAddEditComponent=d},function(n,l,e){"use strict";var t=this&&this.__awaiter||function(n,l,e,t){return new(e||(e=Promise))(function(u,o){function i(n){try{a(t.next(n))}catch(n){o(n)}}function r(n){try{a(t.throw(n))}catch(n){o(n)}}function a(n){n.done?u(n.value):new e(function(l){l(n.value)}).then(i,r)}a((t=t.apply(n,l||[])).next())})},u=this&&this.__generator||function(n,l){var e,t,u,o,i={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return o={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function r(o){return function(r){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;i;)try{if(e=1,t&&(u=t[2&o[0]?"return":o[0]?"throw":"next"])&&!(u=u.call(t,o[1])).done)return u;switch(t=0,u&&(o=[0,u.value]),o[0]){case 0:case 1:u=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,t=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(u=(u=i.trys).length>0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&(l[0].checked=!0,l[0].readOnly=n.readOnly)}),[3,7];case 6:return u.sent(),[3,7];case 7:return[3,9];case 8:this.title=this.i18nService.t("addCollection"),u.label=9;case 9:return this.groups.forEach(function(n){n.accessAll&&(n.checked=!0)}),this.loading=!1,[2]}})})},n.prototype.check=function(n,l){n.accessAll||(n.checked=null==l?!n.checked:l,n.checked||(n.readOnly=!1))},n.prototype.selectAll=function(n){var l=this;this.groups.forEach(function(e){return l.check(e,n)})},n.prototype.submit=function(){return t(this,void 0,void 0,function(){var n,l;return u(this,function(e){switch(e.label){case 0:return n=new r.CollectionRequest,l=n,[4,this.cryptoService.encrypt(this.name,this.orgKey)];case 1:l.name=e.sent().encryptedString,n.groups=this.groups.filter(function(n){return n.checked&&!n.accessAll}).map(function(n){return new a.SelectionReadOnlyRequest(n.id,!!n.readOnly)}),e.label=2;case 2:return e.trys.push([2,4,,5]),this.editMode?this.formPromise=this.apiService.putCollection(this.organizationId,this.collectionId,n):this.formPromise=this.apiService.postCollection(this.organizationId,n),[4,this.formPromise];case 3:return e.sent(),this.analytics.eventTrack.next({action:this.editMode?"Edited Collection":"Created Collection"}),this.toasterService.popAsync("success",null,this.i18nService.t(this.editMode?"editedCollectionId":"createdCollectionId",this.name)),this.onSavedCollection.emit(),[3,5];case 4:return e.sent(),[3,5];case 5:return[2]}})})},n.prototype.delete=function(){return t(this,void 0,void 0,function(){return u(this,function(n){switch(n.label){case 0:return this.editMode?[4,this.platformUtilsService.showDialog(this.i18nService.t("deleteCollectionConfirmation"),this.name,this.i18nService.t("yes"),this.i18nService.t("no"),"warning")]:[2];case 1:if(!n.sent())return[2,!1];n.label=2;case 2:return n.trys.push([2,4,,5]),this.deletePromise=this.apiService.deleteCollection(this.organizationId,this.collectionId),[4,this.deletePromise];case 3:return n.sent(),this.analytics.eventTrack.next({action:"Deleted Collection"}),this.toasterService.popAsync("success",null,this.i18nService.t("deletedCollectionId",this.name)),this.onDeletedCollection.emit(),[3,5];case 4:return n.sent(),[3,5];case 5:return[2]}})})},n}();l.CollectionAddEditComponent=d},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(n){this.groups=[],null!=n&&(this.name=n.name?n.name.encryptedString:null)}}();l.CollectionRequest=t},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(n){this.collectionIds=null==n?[]:n}}();l.CipherCollectionsRequest=t},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)}),o=this&&this.__awaiter||function(n,l,e,t){return new(e||(e=Promise))(function(u,o){function i(n){try{a(t.next(n))}catch(n){o(n)}}function r(n){try{a(t.throw(n))}catch(n){o(n)}}function a(n){n.done?u(n.value):new e(function(l){l(n.value)}).then(i,r)}a((t=t.apply(n,l||[])).next())})},i=this&&this.__generator||function(n,l){var e,t,u,o,i={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return o={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function r(o){return function(r){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;i;)try{if(e=1,t&&(u=t[2&o[0]?"return":o[0]?"throw":"next"])&&!(u=u.call(t,o[1])).done)return u;switch(t=0,u&&(o=[0,u.value]),o[0]){case 0:case 1:u=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,t=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(u=(u=i.trys).length>0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&(n.uris=[],this.uris.forEach(function(l){n.uris.push(l.toLoginUriData())})),n},l}(e(100).default);l.Login=d},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)});Object.defineProperty(l,"__esModule",{value:!0});var o=e(533),i=e(100),r=e(217),a=function(n){function l(l,e){void 0===e&&(e=!1);var t=n.call(this)||this;return null==l?t:(t.buildDomainModel(t,l,{title:null,firstName:null,middleName:null,lastName:null,address1:null,address2:null,address3:null,city:null,state:null,postalCode:null,country:null,company:null,email:null,phone:null,ssn:null,username:null,passportNumber:null,licenseNumber:null},e,[]),t)}return u(l,n),l.prototype.decrypt=function(n){return this.decryptObj(new r.IdentityView(this),{title:null,firstName:null,middleName:null,lastName:null,address1:null,address2:null,address3:null,city:null,state:null,postalCode:null,country:null,company:null,email:null,phone:null,ssn:null,username:null,passportNumber:null,licenseNumber:null},n)},l.prototype.toIdentityData=function(){var n=new o.IdentityData;return this.buildDataModel(this,n,{title:null,firstName:null,middleName:null,lastName:null,address1:null,address2:null,address3:null,city:null,state:null,postalCode:null,country:null,company:null,email:null,phone:null,ssn:null,username:null,passportNumber:null,licenseNumber:null}),n},l}(i.default);l.Identity=a},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)});Object.defineProperty(l,"__esModule",{value:!0});var o=e(534),i=e(100),r=e(179),a=function(n){function l(l,e){void 0===e&&(e=!1);var t=n.call(this)||this;return null==l?t:(t.type=l.type,t.buildDomainModel(t,l,{name:null,value:null},e,[]),t)}return u(l,n),l.prototype.decrypt=function(n){return this.decryptObj(new r.FieldView(this),{name:null,value:null},n)},l.prototype.toFieldData=function(){var n=new o.FieldData;return this.buildDataModel(this,n,{name:null,value:null,type:null},["type"]),n},l}(i.default);l.Field=a},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)});Object.defineProperty(l,"__esModule",{value:!0});var o=e(535),i=e(100),r=e(115),a=function(n){function l(l,e){void 0===e&&(e=!1);var t=n.call(this)||this;return null==l?t:(t.buildDomainModel(t,l,{cardholderName:null,brand:null,number:null,expMonth:null,expYear:null,code:null},e,[]),t)}return u(l,n),l.prototype.decrypt=function(n){return this.decryptObj(new r.CardView(this),{cardholderName:null,brand:null,number:null,expMonth:null,expYear:null,code:null},n)},l.prototype.toCardData=function(){var n=new o.CardData;return this.buildDataModel(this,n,{cardholderName:null,brand:null,number:null,expMonth:null,expYear:null,code:null}),n},l}(i.default);l.Card=a},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)});Object.defineProperty(l,"__esModule",{value:!0});var o=e(536),i=e(100),r=e(538),a=function(n){function l(l,e){void 0===e&&(e=!1);var t=n.call(this)||this;return null==l?t:(t.size=l.size,t.buildDomainModel(t,l,{id:null,url:null,sizeName:null,fileName:null},e,["id","url","sizeName"]),t)}return u(l,n),l.prototype.decrypt=function(n){return this.decryptObj(new r.AttachmentView(this),{fileName:null},n)},l.prototype.toAttachmentData=function(){var n=new o.AttachmentData;return this.buildDataModel(this,n,{id:null,url:null,sizeName:null,fileName:null},["id","url","sizeName"]),n},l}(i.default);l.Attachment=a},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(n){null!=n&&(this.type=n.type)}}();l.SecureNoteData=t},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(n){this.match=null,null!=n&&(this.uri=n.uri,this.match=n.match)}}();l.LoginUriData=t},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=e(531),u=function(){return function(n){var l=this;null!=n&&(this.username=n.username,this.password=n.password,this.totp=n.totp,n.uris&&(this.uris=[],n.uris.forEach(function(n){l.uris.push(new t.LoginUriData(n))})))}}();l.LoginData=u},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(n){null!=n&&(this.title=n.title,this.firstName=n.firstName,this.middleName=n.middleName,this.lastName=n.lastName,this.address1=n.address1,this.address2=n.address2,this.address3=n.address3,this.city=n.city,this.state=n.state,this.postalCode=n.postalCode,this.country=n.country,this.company=n.company,this.email=n.email,this.phone=n.phone,this.ssn=n.ssn,this.username=n.username,this.passportNumber=n.passportNumber,this.licenseNumber=n.licenseNumber)}}();l.IdentityData=t},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(n){null!=n&&(this.type=n.type,this.name=n.name,this.value=n.value)}}();l.FieldData=t},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(n){null!=n&&(this.cardholderName=n.cardholderName,this.brand=n.brand,this.number=n.number,this.expMonth=n.expMonth,this.expYear=n.expYear,this.code=n.code)}}();l.CardData=t},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(n){null!=n&&(this.id=n.id,this.url=n.url,this.fileName=n.fileName,this.size=n.size,this.sizeName=n.sizeName)}}();l.AttachmentData=t},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)});Object.defineProperty(l,"__esModule",{value:!0});e(12),e(3),e(2),e(94),e(8);var o=function(n){function l(l,e,t,u,o){return n.call(this,l,e,t,u,o,window)||this}return u(l,n),l}(e(733).PasswordGeneratorHistoryComponent);l.PasswordGeneratorHistoryComponent=o},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(n){n&&(this.id=n.id,this.url=n.url,this.size=n.size,this.sizeName=n.sizeName)}}();l.AttachmentView=t},,function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(n,l){this.key=n,this.value=l}}();l.KvpRequest=t},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0}),function(n){n[n.Free=0]="Free",n[n.FamiliesAnnually=1]="FamiliesAnnually",n[n.TeamsMonthly=2]="TeamsMonthly",n[n.TeamsAnnually=3]="TeamsAnnually",n[n.EnterpriseMonthly=4]="EnterpriseMonthly",n[n.EnterpriseAnnually=5]="EnterpriseAnnually",n[n.Custom=6]="Custom"}(l.PlanType||(l.PlanType={}))},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=e(0),u=e(40),o=e(37),i=e(2),r=e(13),a=e(18),s=e(17),d=e(269),c=e(127),p=e(8),f=e(7),v=e(5),h=e(265),g=e(4),m=e(3),y=e(9),C=t.ɵcrt({encapsulation:2,styles:[],data:{}});function b(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,15,"app-callout",[["icon","fa-info-circle"]],null,null,null,u.View_CalloutComponent_0,u.RenderType_CalloutComponent)),t.ɵdid(1,114688,null,0,o.CalloutComponent,[i.I18nService],{icon:[0,"icon"],title:[1,"title"]},null),t.ɵppd(2,1),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵeld(4,0,null,0,2,"p",[],null,null,null,null,null)),(n()(),t.ɵted(5,null,["",""])),t.ɵppd(6,1),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵeld(8,0,null,0,2,"a",[["class","btn btn-outline-secondary"],["href","https://bitwarden.com/contact/"],["rel","noopener"],["target","_blank"]],null,null,null,null,null)),(n()(),t.ɵted(9,null,["\n ","\n "])),t.ɵppd(10,1),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵeld(12,0,null,0,2,"button",[["class","btn btn-outline-secondary"],["type","button"]],null,[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.cancel()&&t);return t},null,null)),(n()(),t.ɵted(13,null,["\n ","\n "])),t.ɵppd(14,1),(n()(),t.ɵted(-1,0,["\n"]))],function(n,l){n(l,1,0,"fa-info-circle",t.ɵinlineInterpolate(1,"",t.ɵunv(l,1,1,n(l,2,0,t.ɵnov(l.parent,0),"contactSupport")),""))},function(n,l){n(l,5,0,t.ɵunv(l,5,0,n(l,6,0,t.ɵnov(l.parent,0),"contactSupportPaymentMethod"))),n(l,9,0,t.ɵunv(l,9,0,n(l,10,0,t.ɵnov(l.parent,0),"contactSupport"))),n(l,13,0,t.ɵunv(l,13,0,n(l,14,0,t.ɵnov(l.parent,0),"close")))})}function S(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,[["form",1]],null,29,"form",[["class","card"],["ngNativeValidate",""]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngSubmit"],[null,"submit"],[null,"reset"]],function(n,l,e){var u=!0,o=n.component;"submit"===l&&(u=!1!==t.ɵnov(n,1).onSubmit(e)&&u);"reset"===l&&(u=!1!==t.ɵnov(n,1).onReset()&&u);"ngSubmit"===l&&(u=!1!==o.submit()&&u);return u},null,null)),t.ɵdid(1,4210688,null,0,r.NgForm,[[8,null],[8,null]],null,{ngSubmit:"ngSubmit"}),t.ɵprd(2048,null,r.ControlContainer,null,[r.NgForm]),t.ɵdid(3,16384,null,0,r.NgControlStatusGroup,[r.ControlContainer],null,null),t.ɵdid(4,540672,null,0,a.ApiActionDirective,[t.ElementRef,s.ValidationService],{appApiAction:[0,"appApiAction"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(6,0,null,null,22,"div",[["class","card-body"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(8,0,null,null,2,"h3",[["class","card-body-header"]],null,null,null,null,null)),(n()(),t.ɵted(9,null,["",""])),t.ɵppd(10,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(12,0,null,null,1,"app-payment",[],null,null,null,d.View_PaymentComponent_0,d.RenderType_PaymentComponent)),t.ɵdid(13,245760,[[1,4]],0,c.PaymentComponent,[i.I18nService,p.PlatformUtilsService],{showOptions:[0,"showOptions"],hideBank:[1,"hideBank"],hidePaypal:[2,"hidePaypal"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(15,0,null,null,8,"button",[["class","btn btn-primary btn-submit"],["type","submit"]],[[8,"disabled",0]],null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(17,0,null,null,1,"i",[["class","fa fa-spinner fa-spin"]],[[8,"title",0]],null,null,null,null)),t.ɵppd(18,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(20,0,null,null,2,"span",[],null,null,null,null,null)),(n()(),t.ɵted(21,null,["",""])),t.ɵppd(22,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(25,0,null,null,2,"button",[["class","btn btn-outline-secondary"],["type","button"]],null,[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.cancel()&&t);return t},null,null)),(n()(),t.ɵted(26,null,["\n ","\n "])),t.ɵppd(27,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){var e=l.component;n(l,4,0,e.formPromise);n(l,13,0,e.organizationId,!e.organizationId,!0)},function(n,l){var e=l.component;n(l,0,0,t.ɵnov(l,3).ngClassUntouched,t.ɵnov(l,3).ngClassTouched,t.ɵnov(l,3).ngClassPristine,t.ɵnov(l,3).ngClassDirty,t.ɵnov(l,3).ngClassValid,t.ɵnov(l,3).ngClassInvalid,t.ɵnov(l,3).ngClassPending),n(l,9,0,t.ɵunv(l,9,0,n(l,10,0,t.ɵnov(l.parent,0),null!=e.currentType?"changePaymentMethod":"addPaymentMethod"))),n(l,15,0,t.ɵnov(l,0).loading),n(l,17,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,17,0,n(l,18,0,t.ɵnov(l.parent,0),"loading")),"")),n(l,21,0,t.ɵunv(l,21,0,n(l,22,0,t.ɵnov(l.parent,0),"submit"))),n(l,26,0,t.ɵunv(l,26,0,n(l,27,0,t.ɵnov(l.parent,0),"cancel")))})}function w(n){return t.ɵvid(0,[t.ɵpid(0,f.I18nPipe,[i.I18nService]),t.ɵqud(671088640,1,{paymentComponent:0}),(n()(),t.ɵand(16777216,null,null,1,null,b)),t.ɵdid(3,16384,null,0,v.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,null,null,1,null,S)),t.ɵdid(6,16384,null,0,v.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){var e=l.component;n(l,3,0,!e.canChange),n(l,6,0,e.canChange)},null)}function R(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"app-adjust-payment",[],null,null,null,w,C)),t.ɵdid(1,49152,null,0,h.AdjustPaymentComponent,[g.ApiService,i.I18nService,m.Angulartics2,y.ToasterService],null,null)],null,null)}l.RenderType_AdjustPaymentComponent=C,l.View_AdjustPaymentComponent_0=w,l.View_AdjustPaymentComponent_Host_0=R;var _=t.ɵccf("app-adjust-payment",h.AdjustPaymentComponent,R,{currentType:"currentType",organizationId:"organizationId"},{onAdjusted:"onAdjusted",onCanceled:"onCanceled"},[]);l.AdjustPaymentComponentNgFactory=_},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=e(0),u=e(7),o=e(2),i=e(5),r=e(13),a=e(18),s=e(17),d=e(266),c=e(4),p=e(3),f=e(9),v=t.ɵcrt({encapsulation:2,styles:[],data:{}});function h(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,8,"div",[["class","mb-3"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,2,"strong",[],null,null,null,null,null)),(n()(),t.ɵted(3,null,["",":"])),t.ɵppd(4,1),(n()(),t.ɵted(5,null,[" "," GB × "," = "," /","\n "])),t.ɵppd(6,2),t.ɵppd(7,2),t.ɵppd(8,1)],null,function(n,l){var e=l.component;n(l,3,0,t.ɵunv(l,3,0,n(l,4,0,t.ɵnov(l.parent,0),"total"))),n(l,5,0,e.storageAdjustment||0,t.ɵunv(l,5,1,n(l,6,0,t.ɵnov(l.parent,1),e.storageGbPrice,"$")),t.ɵunv(l,5,2,n(l,7,0,t.ɵnov(l.parent,1),e.adjustedStorageTotal,"$")),t.ɵunv(l,5,3,n(l,8,0,t.ɵnov(l.parent,0),e.interval)))})}function g(n){return t.ɵvid(0,[t.ɵpid(0,u.I18nPipe,[o.I18nService]),t.ɵpid(0,i.CurrencyPipe,[t.LOCALE_ID]),(n()(),t.ɵeld(2,0,[["form",1]],null,53,"form",[["class","card"],["ngNativeValidate",""]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngSubmit"],[null,"submit"],[null,"reset"]],function(n,l,e){var u=!0,o=n.component;"submit"===l&&(u=!1!==t.ɵnov(n,3).onSubmit(e)&&u);"reset"===l&&(u=!1!==t.ɵnov(n,3).onReset()&&u);"ngSubmit"===l&&(u=!1!==o.submit()&&u);return u},null,null)),t.ɵdid(3,4210688,null,0,r.NgForm,[[8,null],[8,null]],null,{ngSubmit:"ngSubmit"}),t.ɵprd(2048,null,r.ControlContainer,null,[r.NgForm]),t.ɵdid(5,16384,null,0,r.NgControlStatusGroup,[r.ControlContainer],null,null),t.ɵdid(6,540672,null,0,a.ApiActionDirective,[t.ElementRef,s.ValidationService],{appApiAction:[0,"appApiAction"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(8,0,null,null,46,"div",[["class","card-body"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(10,0,null,null,2,"h3",[["class","card-body-header"]],null,null,null,null,null)),(n()(),t.ɵted(11,null,["",""])),t.ɵppd(12,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(14,0,null,null,18,"div",[["class","row"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(16,0,null,null,15,"div",[["class","form-group col-6"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(18,0,null,null,2,"label",[["for","storageAdjustment"]],null,null,null,null,null)),(n()(),t.ɵted(19,null,["",""])),t.ɵppd(20,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(22,0,null,null,8,"input",[["class","form-control"],["id","storageAdjustment"],["max","99"],["min","0"],["name","StroageGbAdjustment"],["required",""],["step","1"],["type","number"]],[[1,"required",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"],[null,"change"]],function(n,l,e){var u=!0,o=n.component;"input"===l&&(u=!1!==t.ɵnov(n,23)._handleInput(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,23).onTouched()&&u);"compositionstart"===l&&(u=!1!==t.ɵnov(n,23)._compositionStart()&&u);"compositionend"===l&&(u=!1!==t.ɵnov(n,23)._compositionEnd(e.target.value)&&u);"change"===l&&(u=!1!==t.ɵnov(n,24).onChange(e.target.value)&&u);"input"===l&&(u=!1!==t.ɵnov(n,24).onChange(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,24).onTouched()&&u);"ngModelChange"===l&&(u=!1!==(o.storageAdjustment=e)&&u);return u},null,null)),t.ɵdid(23,16384,null,0,r.DefaultValueAccessor,[t.Renderer2,t.ElementRef,[2,r.COMPOSITION_BUFFER_MODE]],null,null),t.ɵdid(24,16384,null,0,r.ɵbc,[t.Renderer2,t.ElementRef],null,null),t.ɵdid(25,16384,null,0,r.RequiredValidator,[],{required:[0,"required"]},null),t.ɵprd(1024,null,r.NG_VALIDATORS,function(n){return[n]},[r.RequiredValidator]),t.ɵprd(1024,null,r.NG_VALUE_ACCESSOR,function(n,l){return[n,l]},[r.DefaultValueAccessor,r.ɵbc]),t.ɵdid(28,671744,null,0,r.NgModel,[[2,r.ControlContainer],[2,r.NG_VALIDATORS],[8,null],[2,r.NG_VALUE_ACCESSOR]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,r.NgControl,null,[r.NgModel]),t.ɵdid(30,16384,null,0,r.NgControlStatus,[r.NgControl],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,h)),t.ɵdid(35,16384,null,0,i.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(37,0,null,null,8,"button",[["class","btn btn-primary btn-submit"],["type","submit"]],[[8,"disabled",0]],null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(39,0,null,null,1,"i",[["class","fa fa-spinner fa-spin"]],[[8,"title",0]],null,null,null,null)),t.ɵppd(40,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(42,0,null,null,2,"span",[],null,null,null,null,null)),(n()(),t.ɵted(43,null,["",""])),t.ɵppd(44,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(47,0,null,null,2,"button",[["class","btn btn-outline-secondary"],["type","button"]],null,[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.cancel()&&t);return t},null,null)),(n()(),t.ɵted(48,null,["\n ","\n "])),t.ɵppd(49,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(51,0,null,null,2,"small",[["class","d-block text-muted mt-3"]],null,null,null,null,null)),(n()(),t.ɵted(52,null,["\n ","\n "])),t.ɵppd(53,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){var e=l.component;n(l,6,0,e.formPromise);n(l,25,0,"");n(l,28,0,"StroageGbAdjustment",e.storageAdjustment),n(l,35,0,e.add)},function(n,l){var e=l.component;n(l,2,0,t.ɵnov(l,5).ngClassUntouched,t.ɵnov(l,5).ngClassTouched,t.ɵnov(l,5).ngClassPristine,t.ɵnov(l,5).ngClassDirty,t.ɵnov(l,5).ngClassValid,t.ɵnov(l,5).ngClassInvalid,t.ɵnov(l,5).ngClassPending),n(l,11,0,t.ɵunv(l,11,0,n(l,12,0,t.ɵnov(l,0),e.add?"addStorage":"removeStorage"))),n(l,19,0,t.ɵunv(l,19,0,n(l,20,0,t.ɵnov(l,0),e.add?"gbStorageAdd":"gbStorageRemove"))),n(l,22,0,t.ɵnov(l,25).required?"":null,t.ɵnov(l,30).ngClassUntouched,t.ɵnov(l,30).ngClassTouched,t.ɵnov(l,30).ngClassPristine,t.ɵnov(l,30).ngClassDirty,t.ɵnov(l,30).ngClassValid,t.ɵnov(l,30).ngClassInvalid,t.ɵnov(l,30).ngClassPending),n(l,37,0,t.ɵnov(l,2).loading),n(l,39,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,39,0,n(l,40,0,t.ɵnov(l,0),"loading")),"")),n(l,43,0,t.ɵunv(l,43,0,n(l,44,0,t.ɵnov(l,0),"submit"))),n(l,48,0,t.ɵunv(l,48,0,n(l,49,0,t.ɵnov(l,0),"cancel"))),n(l,52,0,t.ɵunv(l,52,0,n(l,53,0,t.ɵnov(l,0),e.add?"storageAddNote":"storageRemoveNote")))})}function m(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"app-adjust-storage",[],null,null,null,g,v)),t.ɵdid(1,49152,null,0,d.AdjustStorageComponent,[c.ApiService,o.I18nService,p.Angulartics2,f.ToasterService],null,null)],null,null)}l.RenderType_AdjustStorageComponent=v,l.View_AdjustStorageComponent_0=g,l.View_AdjustStorageComponent_Host_0=m;var y=t.ɵccf("app-adjust-storage",d.AdjustStorageComponent,m,{storageGbPrice:"storageGbPrice",add:"add",organizationId:"organizationId",interval:"interval"},{onAdjusted:"onAdjusted",onCanceled:"onCanceled"},[]);l.AdjustStorageComponentNgFactory=y},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=e(0),u=e(7),o=e(2),i=e(13),r=e(18),a=e(17),s=e(267),d=e(4),c=e(3),p=e(9),f=t.ɵcrt({encapsulation:2,styles:[],data:{}});function v(n){return t.ɵvid(0,[t.ɵpid(0,u.I18nPipe,[o.I18nService]),(n()(),t.ɵeld(1,0,[["form",1]],null,32,"form",[["ngNativeValidate",""]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngSubmit"],[null,"submit"],[null,"reset"]],function(n,l,e){var u=!0,o=n.component;"submit"===l&&(u=!1!==t.ɵnov(n,2).onSubmit(e)&&u);"reset"===l&&(u=!1!==t.ɵnov(n,2).onReset()&&u);"ngSubmit"===l&&(u=!1!==o.submit()&&u);return u},null,null)),t.ɵdid(2,4210688,null,0,i.NgForm,[[8,null],[8,null]],null,{ngSubmit:"ngSubmit"}),t.ɵprd(2048,null,i.ControlContainer,null,[i.NgForm]),t.ɵdid(4,16384,null,0,i.NgControlStatusGroup,[i.ControlContainer],null,null),t.ɵdid(5,540672,null,0,r.ApiActionDirective,[t.ElementRef,a.ValidationService],{appApiAction:[0,"appApiAction"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(7,0,null,null,11,"div",[["class","form-group"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(9,0,null,null,2,"label",[["class","sr-only"],["for","file"]],null,null,null,null,null)),(n()(),t.ɵted(10,null,["",""])),t.ɵppd(11,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(13,0,null,null,0,"input",[["class","form-control-file"],["id","file"],["name","file"],["required",""],["type","file"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(15,0,null,null,2,"small",[["class","form-text text-muted"]],null,null,null,null,null)),(n()(),t.ɵted(16,null,["",""])),t.ɵppd(17,2),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(20,0,null,null,8,"button",[["class","btn btn-primary btn-submit"],["type","submit"]],[[8,"disabled",0]],null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(22,0,null,null,1,"i",[["class","fa fa-spinner fa-spin"]],[[8,"title",0]],null,null,null,null)),t.ɵppd(23,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(25,0,null,null,2,"span",[],null,null,null,null,null)),(n()(),t.ɵted(26,null,["",""])),t.ɵppd(27,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(30,0,null,null,2,"button",[["class","btn btn-outline-secondary"],["type","button"]],null,[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.cancel()&&t);return t},null,null)),(n()(),t.ɵted(31,null,["\n ","\n "])),t.ɵppd(32,1),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){n(l,5,0,l.component.formPromise)},function(n,l){var e=l.component;n(l,1,0,t.ɵnov(l,4).ngClassUntouched,t.ɵnov(l,4).ngClassTouched,t.ɵnov(l,4).ngClassPristine,t.ɵnov(l,4).ngClassDirty,t.ɵnov(l,4).ngClassValid,t.ɵnov(l,4).ngClassInvalid,t.ɵnov(l,4).ngClassPending),n(l,10,0,t.ɵunv(l,10,0,n(l,11,0,t.ɵnov(l,0),"licenseFile"))),n(l,16,0,t.ɵunv(l,16,0,n(l,17,0,t.ɵnov(l,0),"licenseFileDesc",e.organizationId?"bitwarden_organization_license.json":"bitwarden_premium_license.json"))),n(l,20,0,t.ɵnov(l,1).loading),n(l,22,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,22,0,n(l,23,0,t.ɵnov(l,0),"loading")),"")),n(l,26,0,t.ɵunv(l,26,0,n(l,27,0,t.ɵnov(l,0),"submit"))),n(l,31,0,t.ɵunv(l,31,0,n(l,32,0,t.ɵnov(l,0),"cancel")))})}function h(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"app-update-license",[],null,null,null,v,f)),t.ɵdid(1,49152,null,0,s.UpdateLicenseComponent,[d.ApiService,o.I18nService,c.Angulartics2,p.ToasterService],null,null)],null,null)}l.RenderType_UpdateLicenseComponent=f,l.View_UpdateLicenseComponent_0=v,l.View_UpdateLicenseComponent_Host_0=h;var g=t.ɵccf("app-update-license",s.UpdateLicenseComponent,h,{organizationId:"organizationId"},{onUpdated:"onUpdated",onCanceled:"onCanceled"},[]);l.UpdateLicenseComponentNgFactory=g},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)}),o=this&&this.__awaiter||function(n,l,e,t){return new(e||(e=Promise))(function(u,o){function i(n){try{a(t.next(n))}catch(n){o(n)}}function r(n){try{a(t.throw(n))}catch(n){o(n)}}function a(n){n.done?u(n.value):new e(function(l){l(n.value)}).then(i,r)}a((t=t.apply(n,l||[])).next())})},i=this&&this.__generator||function(n,l){var e,t,u,o,i={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return o={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function r(o){return function(r){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;i;)try{if(e=1,t&&(u=t[2&o[0]?"return":o[0]?"throw":"next"])&&!(u=u.call(t,o[1])).done)return u;switch(t=0,u&&(o=[0,u.value]),o[0]){case 0:case 1:u=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,t=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(u=(u=i.trys).length>0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0?this.keys[0].key:null,e.key2=null!=this.keys&&this.keys.length>1?this.keys[1].key:null,e.key3=null!=this.keys&&this.keys.length>2?this.keys[2].key:null,e.key4=null!=this.keys&&this.keys.length>3?this.keys[3].key:null,e.key5=null!=this.keys&&this.keys.length>4?this.keys[4].key:null,e.nfc=this.nfc,n.prototype.enable.call(this,function(){return o(l,void 0,void 0,function(){var n;return i(this,function(l){switch(l.label){case 0:return this.formPromise=this.apiService.putTwoFactorYubiKey(e),[4,this.formPromise];case 1:return n=l.sent(),[4,this.processResponse(n)];case 2:return l.sent(),this.toasterService.popAsync("success",null,this.i18nService.t("yubikeysUpdated")),[2]}})})})},l.prototype.disable=function(){return n.prototype.disable.call(this,this.disablePromise)},l.prototype.remove=function(n){n.existingKey=null,n.key=null},l.prototype.processResponse=function(n){this.enabled=n.enabled,this.keys=[{key:n.key1,existingKey:this.padRight(n.key1)},{key:n.key2,existingKey:this.padRight(n.key2)},{key:n.key3,existingKey:this.padRight(n.key3)},{key:n.key4,existingKey:this.padRight(n.key4)},{key:n.key5,existingKey:this.padRight(n.key5)}],this.nfc=n.nfc||!n.enabled},l.prototype.padRight=function(n,l,e){if(void 0===l&&(l="•"),void 0===e&&(e=44),null==n||null==l||n.length>=e)return n;for(var t=(e-n.length)/l.length,u=0;u0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]

'+this.i18nService.t("twoFactorRecoveryYourCode")+":

"+this.code+'

'+new Date+"

"),n.print(),n.close()},n.prototype.formatString=function(n){return null==n?null:n.replace(/(.{4})/g,"$1 ").trim().toUpperCase()},n.prototype.processResponse=function(n){this.code=this.formatString(n.code)},n}();l.TwoFactorRecoveryComponent=u},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)}),o=this&&this.__awaiter||function(n,l,e,t){return new(e||(e=Promise))(function(u,o){function i(n){try{a(t.next(n))}catch(n){o(n)}}function r(n){try{a(t.throw(n))}catch(n){o(n)}}function a(n){n.done?u(n.value):new e(function(l){l(n.value)}).then(i,r)}a((t=t.apply(n,l||[])).next())})},i=this&&this.__generator||function(n,l){var e,t,u,o,i={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return o={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function r(o){return function(r){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;i;)try{if(e=1,t&&(u=t[2&o[0]?"return":o[0]?"throw":"next"])&&!(u=u.call(t,o[1])).done)return u;switch(t=0,u&&(o=[0,u.value]),o[0]){case 0:case 1:u=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,t=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(u=(u=i.trys).length>0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&(this.organizationId=this.organizations[0].id),this.filterCollections(),[2]}})})},n.prototype.ngOnDestroy=function(){this.selectAll(!1)},n.prototype.filterCollections=function(){var n=this;this.selectAll(!1),null==this.organizationId||0===this.writeableCollections.length?this.collections=[]:this.collections=this.writeableCollections.filter(function(l){return l.organizationId===n.organizationId})},n.prototype.submit=function(){return t(this,void 0,void 0,function(){var n,l,e,o,i,r,a,s=this;return u(this,function(d){switch(d.label){case 0:return[4,this.cipherService.get(this.cipherId)];case 1:return[4,d.sent().decrypt()];case 2:if(n=d.sent(),l=[],null!=n.attachments)for(e=0,o=n.attachments;e0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&(this.organizationId=this.organizations[0].id),this.filterCollections(),[2]}})})},n.prototype.ngOnDestroy=function(){this.selectAll(!1)},n.prototype.filterCollections=function(){var n=this;this.selectAll(!1),null==this.organizationId||0===this.writeableCollections.length?this.collections=[]:this.collections=this.writeableCollections.filter(function(l){return l.organizationId===n.organizationId})},n.prototype.submit=function(){return t(this,void 0,void 0,function(){var n;return u(this,function(l){switch(l.label){case 0:return n=this.collections.filter(function(n){return n.checked}).map(function(n){return n.id}),this.formPromise=this.cipherService.shareManyWithServer(this.shareableCiphers,this.organizationId,n),[4,this.formPromise];case 1:return l.sent(),this.onShared.emit(),this.analytics.eventTrack.next({action:"Bulk Shared Items"}),this.toasterService.popAsync("success",null,this.i18nService.t("sharedItems")),[2]}})})},n.prototype.check=function(n,l){n.checked=null==l?!n.checked:l},n.prototype.selectAll=function(n){var l=this;(n?this.collections:this.writeableCollections).forEach(function(e){return l.check(e,n)})},n}());l.BulkShareComponent=i},function(n,l,e){"use strict";var t=this&&this.__awaiter||function(n,l,e,t){return new(e||(e=Promise))(function(u,o){function i(n){try{a(t.next(n))}catch(n){o(n)}}function r(n){try{a(t.throw(n))}catch(n){o(n)}}function a(n){n.done?u(n.value):new e(function(l){l(n.value)}).then(i,r)}a((t=t.apply(n,l||[])).next())})},u=this&&this.__generator||function(n,l){var e,t,u,o,i={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return o={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function r(o){return function(r){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;i;)try{if(e=1,t&&(u=t[2&o[0]?"return":o[0]?"throw":"next"])&&!(u=u.call(t,o[1])).done)return u;switch(t=0,u&&(o=[0,u.value]),o[0]){case 0:case 1:u=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,t=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(u=(u=i.trys).length>0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]-1||!e.onlySearchName&&(!!(l.length>=8&&n.id.startsWith(l))||(null!=n.subTitle&&n.subTitle.toLowerCase().indexOf(l)>-1||!!(n.login&&null!=n.login.uri&&n.login.uri.toLowerCase().indexOf(l)>-1)))}))},n}();l.SearchCiphersPipe=u},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=e(0),u=e(807),o=e(5),i=e(281),r=e(131),a=e(61),s=t.ɵcrt({encapsulation:2,styles:[],data:{}});function d(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"img",[["alt",""]],[[8,"src",4]],[[null,"error"]],function(n,l,e){var u=!0;"error"===l&&(u=!1!==t.ɵnov(n,1).onError()&&u);return u},null,null)),t.ɵdid(1,16384,null,0,u.FallbackSrcDirective,[t.ElementRef],{appFallbackSrc:[0,"appFallbackSrc"]},null)],function(n,l){var e=l.component;n(l,1,0,t.ɵinlineInterpolate(1,"",e.fallbackImage,""))},function(n,l){n(l,0,0,l.component.image)})}function c(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,0,"i",[],[[8,"className",0]],null,null,null,null))],null,function(n,l){var e=l.component;n(l,0,0,t.ɵinlineInterpolate(1,"fa fa-fw fa-lg ",e.icon,""))})}function p(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,7,"div",[["class","icon"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,d)),t.ɵdid(3,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,c)),t.ɵdid(6,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){var e=l.component;n(l,3,0,e.imageEnabled&&e.image),n(l,6,0,!e.imageEnabled||!e.image)},null)}function f(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"app-vault-icon",[],null,null,null,p,s)),t.ɵdid(1,573440,null,0,i.IconComponent,[r.EnvironmentService,a.StateService],null,null)],null,null)}l.RenderType_IconComponent=s,l.View_IconComponent_0=p,l.View_IconComponent_Host_0=f;var v=t.ɵccf("app-vault-icon",i.IconComponent,f,{cipher:"cipher"},{},[]);l.IconComponentNgFactory=v},function(n,l,e){"use strict";var t=this&&this.__awaiter||function(n,l,e,t){return new(e||(e=Promise))(function(u,o){function i(n){try{a(t.next(n))}catch(n){o(n)}}function r(n){try{a(t.throw(n))}catch(n){o(n)}}function a(n){n.done?u(n.value):new e(function(l){l(n.value)}).then(i,r)}a((t=t.apply(n,l||[])).next())})},u=this&&this.__generator||function(n,l){var e,t,u,o,i={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return o={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function r(o){return function(r){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;i;)try{if(e=1,t&&(u=t[2&o[0]?"return":o[0]?"throw":"next"])&&!(u=u.call(t,o[1])).done)return u;switch(t=0,u&&(o=[0,u.value]),o[0]){case 0:case 1:u=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,t=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(u=(u=i.trys).length>0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&n.data.forEach(function(n){var t=new a.Collection(new d.CollectionData(n));l.push(t.decrypt().then(function(n){e.push(n)}))}),Promise.all(l)})),c.push(this.apiService.getCiphersOrganization(n).then(function(n){var l=[];return null!=n&&null!=n.data&&n.data.length>0&&n.data.forEach(function(n){var e=new r.Cipher(new s.CipherData(n));l.push(e.decrypt().then(function(n){t.push(n)}))}),Promise.all(l)})),[4,Promise.all(c)];case 1:return u.sent(),p=new Map,e.forEach(function(n){p.set(n.id,n)}),f=[],t.forEach(function(n){if(n.type===i.CipherType.Login||n.type===i.CipherType.SecureNote){var l={collections:[]};null!=n.collectionIds&&(l.collections=n.collectionIds.filter(function(n){return p.has(n)}).map(function(n){return p.get(n).name})),v.buildCommonCipher(l,n),f.push(l)}}),"csv"===l?[2,o.unparse(f)]:[2,JSON.stringify(f,null," ")]}})})},n.prototype.getFileName=function(n){void 0===n&&(n=null);var l=new Date,e=l.getFullYear()+""+this.padNumber(l.getMonth()+1,2)+this.padNumber(l.getDate(),2)+this.padNumber(l.getHours(),2)+this.padNumber(l.getMinutes(),2)+this.padNumber(l.getSeconds(),2);return"bitwarden"+(n?"_"+n:"")+"_export_"+e+".csv"},n.prototype.padNumber=function(n,l,e){void 0===e&&(e="0");var t=n.toString();return t.length>=l?t:new Array(l-t.length+1).join(e)+t},n.prototype.buildCommonCipher=function(n,l){switch(n.type=null,n.name=l.name,n.notes=l.notes,n.fields=null,n.login_uri=null,n.login_username=null,n.login_password=null,n.login_totp=null,l.fields&&l.fields.forEach(function(l){n.fields?n.fields+="\n":n.fields="",n.fields+=(l.name||"")+": "+l.value}),l.type){case i.CipherType.Login:n.type="login",n.login_username=l.login.username,n.login_password=l.login.password,n.login_totp=l.login.totp,l.login.uris&&(n.login_uri=[],l.login.uris.forEach(function(l){n.login_uri.push(l.uri)}));break;case i.CipherType.SecureNote:n.type="note";break;default:return}return n},n}();l.ExportService=c},function(n,l,e){"use strict";var t,u=this&&this.__awaiter||function(n,l,e,t){return new(e||(e=Promise))(function(u,o){function i(n){try{a(t.next(n))}catch(n){o(n)}}function r(n){try{a(t.throw(n))}catch(n){o(n)}}function a(n){n.done?u(n.value):new e(function(l){l(n.value)}).then(i,r)}a((t=t.apply(n,l||[])).next())})},o=this&&this.__generator||function(n,l){var e,t,u,o,i={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return o={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function r(o){return function(r){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;i;)try{if(e=1,t&&(u=t[2&o[0]?"return":o[0]?"throw":"next"])&&!(u=u.call(t,o[1])).done)return u;switch(t=0,u&&(o=[0,u.value]),o[0]){case 0:case 1:u=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,t=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(u=(u=i.trys).length>0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]-1&&(n=n.substring(0,l)),0!==n.indexOf("!/")&&0!==n.indexOf("#/")||(n=n.substring(1));var e=[];return n.split("/").forEach(function(n){n.match(/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i)?e.push("__guid__"):e.push(n)}),encodeURIComponent(e.join("/"))},n}();l.Analytics=s},function(n,l,e){"use strict";var t=this&&this.__awaiter||function(n,l,e,t){return new(e||(e=Promise))(function(u,o){function i(n){try{a(t.next(n))}catch(n){o(n)}}function r(n){try{a(t.throw(n))}catch(n){o(n)}}function a(n){n.done?u(n.value):new e(function(l){l(n.value)}).then(i,r)}a((t=t.apply(n,l||[])).next())})},u=this&&this.__generator||function(n,l){var e,t,u,o,i={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return o={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function r(o){return function(r){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;i;)try{if(e=1,t&&(u=t[2&o[0]?"return":o[0]?"throw":"next"])&&!(u=u.call(t,o[1])).done)return u;switch(t=0,u&&(o=[0,u.value]),o[0]){case 0:case 1:u=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,t=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(u=(u=i.trys).length>0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]=0?this.browserCache=i.DeviceType.OperaBrowser:-1!==navigator.userAgent.indexOf(" Edge/")?this.browserCache=i.DeviceType.EdgeBrowser:-1!==navigator.userAgent.indexOf(" Vivaldi/")?this.browserCache=i.DeviceType.VivaldiBrowser:-1!==navigator.userAgent.indexOf(" Safari/")&&-1===navigator.userAgent.indexOf("Chrome")?this.browserCache=i.DeviceType.SafariBrowser:window.chrome&&-1!==navigator.userAgent.indexOf(" Chrome/")?this.browserCache=i.DeviceType.ChromeBrowser:-1!==navigator.userAgent.indexOf(" Trident/")?this.browserCache=i.DeviceType.IEBrowser:this.browserCache=i.DeviceType.UnknownBrowser,this.browserCache)},n.prototype.getDeviceString=function(){return i.DeviceType[this.getDevice()].toLowerCase().replace("browser","")},n.prototype.isFirefox=function(){return this.getDevice()===i.DeviceType.FirefoxBrowser},n.prototype.isChrome=function(){return this.getDevice()===i.DeviceType.ChromeBrowser},n.prototype.isEdge=function(){return this.getDevice()===i.DeviceType.EdgeBrowser},n.prototype.isOpera=function(){return this.getDevice()===i.DeviceType.OperaBrowser},n.prototype.isVivaldi=function(){return this.getDevice()===i.DeviceType.VivaldiBrowser},n.prototype.isSafari=function(){return this.getDevice()===i.DeviceType.SafariBrowser},n.prototype.isIE=function(){return this.getDevice()===i.DeviceType.IEBrowser},n.prototype.isMacAppStore=function(){return!1},n.prototype.analyticsId=function(){return"UA-81915606-3"},n.prototype.getDomain=function(n){return r.Utils.getHostname(n)},n.prototype.isViewOpen=function(){return!1},n.prototype.lockTimeout=function(){return 15},n.prototype.launchUri=function(n,l){var e=document.createElement("a");e.href=n,e.target="_blank",e.rel="noreferrer noopener",e.classList.add("d-none"),document.body.appendChild(e),e.click(),document.body.removeChild(e)},n.prototype.saveFile=function(n,l,e,t){var u=null;if(u=null==e||this.isIE()?new Blob([l]):new Blob([l],e),navigator.msSaveOrOpenBlob)navigator.msSaveBlob(u,t);else{var o=n.document.createElement("a");o.href=n.URL.createObjectURL(u),o.download=t,o.style.position="fixed",n.document.body.appendChild(o),o.click(),n.document.body.removeChild(o)}},n.prototype.getApplicationVersion=function(){return"2.0.0"},n.prototype.supportsU2f=function(n){return null!=n&&null!=n.u2f||(this.isChrome()||this.isOpera()||this.isVivaldi())&&!this.isMobile(n)},n.prototype.supportsDuo=function(){return!0},n.prototype.showToast=function(n,l,e,t){throw new Error("showToast not implemented")},n.prototype.showDialog=function(n,l,e,o,i){return t(this,void 0,void 0,function(){var t,r,s,d,c;return u(this,function(u){switch(u.label){case 0:if(t=[null==e?this.i18nService.t("ok"):e],null!=o&&t.unshift(o),r=document.createElement("div"),null!=i){switch((s=document.createElement("i")).classList.add("swal-custom-icon"),i){case"success":s.classList.add("fa","fa-check","text-success");break;case"warning":s.classList.add("fa","fa-warning","text-warning");break;case"error":s.classList.add("fa","fa-bolt","text-danger");break;case"info":s.classList.add("fa","fa-info-circle","text-info")}s.classList.contains("fa")&&r.appendChild(s)}return null!=l&&((d=document.createElement("div")).classList.add("swal-title"),d.appendChild(document.createTextNode(l)),r.appendChild(d)),null!=n&&((c=document.createElement("div")).classList.add("swal-text"),c.appendChild(document.createTextNode(n)),r.appendChild(c)),[4,a({content:{element:r},buttons:t})];case 1:return[2,u.sent()]}})})},n.prototype.isDev=function(){return!1},n.prototype.isSelfHost=function(){return"true"===(!1).toString()},n.prototype.copyToClipboard=function(n,l){var e=l?l.doc:window.document;if(window.clipboardData&&window.clipboardData.setData)window.clipboardData.setData("Text",n);else if(e.queryCommandSupported&&e.queryCommandSupported("copy")){var t=e.createElement("textarea");t.textContent=n,t.style.position="fixed",e.body.appendChild(t),t.select();try{e.execCommand("copy")}catch(n){console.warn("Copy to clipboard failed.",n)}finally{e.body.removeChild(t)}}},n.prototype.isMobile=function(n){var l,e=!1;return l=n.navigator.userAgent||n.navigator.vendor||n.opera,(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(l)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(l.substr(0,4)))&&(e=!0),e||null!=n.navigator.userAgent.match(/iPad/i)},n}();l.WebPlatformUtilsService=s},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){function n(){this.store=new Map}return n.prototype.get=function(n){if(this.store.has(n)){var l=this.store.get(n);return Promise.resolve(l)}return Promise.resolve(null)},n.prototype.save=function(n,l){return null==l?this.remove(n):(this.store.set(n,l),Promise.resolve())},n.prototype.remove=function(n){return this.store.delete(n),Promise.resolve()},n}();l.MemoryStorageService=t},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)}),o=this&&this.__awaiter||function(n,l,e,t){return new(e||(e=Promise))(function(u,o){function i(n){try{a(t.next(n))}catch(n){o(n)}}function r(n){try{a(t.throw(n))}catch(n){o(n)}}function a(n){n.done?u(n.value):new e(function(l){l(n.value)}).then(i,r)}a((t=t.apply(n,l||[])).next())})},i=this&&this.__generator||function(n,l){var e,t,u,o,i={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return o={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function r(o){return function(r){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;i;)try{if(e=1,t&&(u=t[2&o[0]?"return":o[0]?"throw":"next"])&&!(u=u.call(t,o[1])).done)return u;switch(t=0,u&&(o=[0,u.value]),o[0]){case 0:case 1:u=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,t=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(u=(u=i.trys).length>0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]1?"×"+l.context.$implicit.quantity:"",t.ɵunv(l,3,2,n(l,4,0,t.ɵnov(l.parent.parent.parent.parent,2),l.context.$implicit.amount,"$"))),n(l,7,0,t.ɵunv(l,7,0,n(l,8,0,t.ɵnov(l.parent.parent.parent.parent,2),l.context.$implicit.quantity*l.context.$implicit.amount,"$")),t.ɵunv(l,7,1,n(l,9,0,t.ɵnov(l.parent.parent.parent.parent,0),l.context.$implicit.interval)))})}function L(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,14,"div",[["class","col-8"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,2,"strong",[["class","d-block mb-1"]],null,null,null,null,null)),(n()(),t.ɵted(3,null,["",""])),t.ɵppd(4,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(6,0,null,null,7,"table",[["class","table"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(8,0,null,null,4,"tbody",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,F)),t.ɵdid(11,802816,null,0,s.NgForOf,[t.ViewContainerRef,t.TemplateRef,t.IterableDiffers],{ngForOf:[0,"ngForOf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){n(l,11,0,l.component.subscription.items)},function(n,l){n(l,3,0,t.ɵunv(l,3,0,n(l,4,0,t.ɵnov(l.parent.parent.parent,0),"details")))})}function G(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,20,"div",[["class","row"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,14,"div",[["class","col-4"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(4,0,null,null,11,"dl",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(6,0,null,null,2,"dt",[],null,null,null,null,null)),(n()(),t.ɵted(7,null,["",""])),t.ɵppd(8,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(10,0,null,null,1,"dd",[],null,null,null,null,null)),(n()(),t.ɵted(11,null,["",""])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,U)),t.ɵdid(14,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,L)),t.ɵdid(19,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){var e=l.component;n(l,14,0,e.subscription),n(l,19,0,e.subscription)},function(n,l){var e=l.component;n(l,7,0,t.ɵunv(l,7,0,n(l,8,0,t.ɵnov(l.parent.parent,0),"billingPlan"))),n(l,11,0,e.billing.plan)})}function q(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,11,"div",[["class","card mt-3"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,8,"div",[["class","card-body"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(4,0,null,null,2,"h3",[["class","card-body-header"]],null,null,null,null,null)),(n()(),t.ɵted(5,null,["",""])),t.ɵppd(6,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(8,0,null,null,1,"app-update-license",[],null,[[null,"onUpdated"],[null,"onCanceled"]],function(n,l,e){var t=!0,u=n.component;"onUpdated"===l&&(t=!1!==u.closeUpdateLicense(!0)&&t);"onCanceled"===l&&(t=!1!==u.closeUpdateLicense(!1)&&t);return t},d.View_UpdateLicenseComponent_0,d.RenderType_UpdateLicenseComponent)),t.ɵdid(9,49152,null,0,c.UpdateLicenseComponent,[p.ApiService,i.I18nService,f.Angulartics2,v.ToasterService],{organizationId:[0,"organizationId"]},{onUpdated:"onUpdated",onCanceled:"onCanceled"}),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){n(l,9,0,l.component.organizationId)},function(n,l){n(l,5,0,t.ɵunv(l,5,0,n(l,6,0,t.ɵnov(l.parent.parent.parent,0),"updateLicense")))})}function z(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,15,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,9,"div",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(4,0,null,null,2,"button",[["class","btn btn-outline-secondary"],["type","button"]],null,[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.updateLicense()&&t);return t},null,null)),(n()(),t.ɵted(5,null,["\n ","\n "])),t.ɵppd(6,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(8,0,null,null,2,"a",[["class","btn btn-outline-secondary"],["href","https://vault.bitwarden.com"],["rel","noopener"],["target","_blank"]],null,null,null,null,null)),(n()(),t.ɵted(9,null,["\n ","\n "])),t.ɵppd(10,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,q)),t.ɵdid(14,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){n(l,14,0,l.component.showUpdateLicense)},function(n,l){n(l,5,0,t.ɵunv(l,5,0,n(l,6,0,t.ɵnov(l.parent.parent,0),"updateLicense"))),n(l,9,0,t.ɵunv(l,9,0,n(l,10,0,t.ɵnov(l.parent.parent,0),"manageSubscription")))})}function j(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,[["licenseBtn",1]],null,9,"button",[["class","btn btn-outline-secondary btn-submit ml-1"],["type","button"]],[[8,"disabled",0]],[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.downloadLicense()&&t);return t},null,null)),t.ɵdid(1,540672,null,0,r.ApiActionDirective,[t.ElementRef,a.ValidationService],{appApiAction:[0,"appApiAction"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(3,0,null,null,1,"i",[["class","fa fa-spinner fa-spin"]],[[8,"title",0]],null,null,null,null)),t.ɵppd(4,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(6,0,null,null,2,"span",[],null,null,null,null,null)),(n()(),t.ɵted(7,null,["",""])),t.ɵppd(8,1),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){n(l,1,0,l.component.licensePromise)},function(n,l){n(l,0,0,t.ɵnov(l,0).loading),n(l,3,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,3,0,n(l,4,0,t.ɵnov(l.parent.parent.parent,0),"loading")),"")),n(l,7,0,t.ɵunv(l,7,0,n(l,8,0,t.ɵnov(l.parent.parent.parent,0),"downloadLicense")))})}function B(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,[["cancelBtn",1]],null,9,"button",[["class","btn btn-outline-danger btn-submit ml-auto"],["type","button"]],[[8,"disabled",0]],[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.cancel()&&t);return t},null,null)),t.ɵdid(1,540672,null,0,r.ApiActionDirective,[t.ElementRef,a.ValidationService],{appApiAction:[0,"appApiAction"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(3,0,null,null,1,"i",[["class","fa fa-spinner fa-spin"]],[[8,"title",0]],null,null,null,null)),t.ɵppd(4,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(6,0,null,null,2,"span",[],null,null,null,null,null)),(n()(),t.ɵted(7,null,["",""])),t.ɵppd(8,1),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){n(l,1,0,l.component.cancelPromise)},function(n,l){n(l,0,0,t.ɵnov(l,0).loading),n(l,3,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,3,0,n(l,4,0,t.ɵnov(l.parent.parent.parent,0),"loading")),"")),n(l,7,0,t.ɵunv(l,7,0,n(l,8,0,t.ɵnov(l.parent.parent.parent,0),"cancelSubscription")))})}function K(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,9,"div",[["class","d-flex"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,2,"button",[["class","btn btn-outline-secondary"],["type","button"]],null,[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.adjustSeats(!0)&&t);return t},null,null)),(n()(),t.ɵted(3,null,["\n ","\n "])),t.ɵppd(4,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(6,0,null,null,2,"button",[["class","btn btn-outline-secondary ml-1"],["type","button"]],null,[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.adjustSeats(!1)&&t);return t},null,null)),(n()(),t.ɵted(7,null,["\n ","\n "])),t.ɵppd(8,1),(n()(),t.ɵted(-1,null,["\n "]))],null,function(n,l){n(l,3,0,t.ɵunv(l,3,0,n(l,4,0,t.ɵnov(l.parent.parent.parent.parent,0),"addSeats"))),n(l,7,0,t.ɵunv(l,7,0,n(l,8,0,t.ɵnov(l.parent.parent.parent.parent,0),"removeSeats")))})}function H(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"app-adjust-seats",[],null,[[null,"onAdjusted"],[null,"onCanceled"]],function(n,l,e){var t=!0,u=n.component;"onAdjusted"===l&&(t=!1!==u.closeSeats(!0)&&t);"onCanceled"===l&&(t=!1!==u.closeSeats(!1)&&t);return t},h.View_AdjustSeatsComponent_0,h.RenderType_AdjustSeatsComponent)),t.ɵdid(1,49152,null,0,g.AdjustSeatsComponent,[p.ApiService,i.I18nService,f.Angulartics2,v.ToasterService],{seatPrice:[0,"seatPrice"],add:[1,"add"],organizationId:[2,"organizationId"],interval:[3,"interval"]},{onAdjusted:"onAdjusted",onCanceled:"onCanceled"})],function(n,l){var e=l.component;n(l,1,0,e.seatPrice,e.adjustSeatsAdd,e.organizationId,e.billingInterval)},null)}function $(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,10,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,7,"div",[["class","mt-3"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,K)),t.ɵdid(5,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,H)),t.ɵdid(8,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){var e=l.component;n(l,5,0,!e.showAdjustSeats),n(l,8,0,e.showAdjustSeats)},null)}function W(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,9,"div",[["class","d-flex"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,2,"button",[["class","btn btn-outline-secondary"],["type","button"]],null,[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.adjustStorage(!0)&&t);return t},null,null)),(n()(),t.ɵted(3,null,["\n ","\n "])),t.ɵppd(4,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(6,0,null,null,2,"button",[["class","btn btn-outline-secondary ml-1"],["type","button"]],null,[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.adjustStorage(!1)&&t);return t},null,null)),(n()(),t.ɵted(7,null,["\n ","\n "])),t.ɵppd(8,1),(n()(),t.ɵted(-1,null,["\n "]))],null,function(n,l){n(l,3,0,t.ɵunv(l,3,0,n(l,4,0,t.ɵnov(l.parent.parent.parent.parent,0),"addStorage"))),n(l,7,0,t.ɵunv(l,7,0,n(l,8,0,t.ɵnov(l.parent.parent.parent.parent,0),"removeStorage")))})}function Y(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"app-adjust-storage",[],null,[[null,"onAdjusted"],[null,"onCanceled"]],function(n,l,e){var t=!0,u=n.component;"onAdjusted"===l&&(t=!1!==u.closeStorage(!0)&&t);"onCanceled"===l&&(t=!1!==u.closeStorage(!1)&&t);return t},m.View_AdjustStorageComponent_0,m.RenderType_AdjustStorageComponent)),t.ɵdid(1,49152,null,0,y.AdjustStorageComponent,[p.ApiService,i.I18nService,f.Angulartics2,v.ToasterService],{storageGbPrice:[0,"storageGbPrice"],add:[1,"add"],organizationId:[2,"organizationId"],interval:[3,"interval"]},{onAdjusted:"onAdjusted",onCanceled:"onCanceled"})],function(n,l){var e=l.component;n(l,1,0,e.storageGbPrice,e.adjustStorageAdd,e.organizationId,e.billingInterval)},null)}function Z(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,10,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,7,"div",[["class","mt-3"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,W)),t.ɵdid(5,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,Y)),t.ɵdid(8,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){var e=l.component;n(l,5,0,!e.showAdjustStorage),n(l,8,0,e.showAdjustStorage)},null)}function J(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,2,"p",[],null,null,null,null,null)),(n()(),t.ɵted(1,null,["",""])),t.ɵppd(2,1)],null,function(n,l){n(l,1,0,t.ɵunv(l,1,0,n(l,2,0,t.ɵnov(l.parent.parent.parent,0),"noPaymentMethod")))})}function X(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,71,"app-callout",[["type","warning"]],null,null,null,u.View_CalloutComponent_0,u.RenderType_CalloutComponent)),t.ɵdid(1,114688,null,0,o.CalloutComponent,[i.I18nService],{type:[0,"type"],title:[1,"title"]},null),t.ɵppd(2,1),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵeld(4,0,null,0,3,"p",[],null,null,null,null,null)),(n()(),t.ɵted(5,null,[""," ",""])),t.ɵppd(6,1),t.ɵppd(7,1),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵeld(9,0,[["verifyForm",1]],0,61,"form",[["class","form-inline"],["ngNativeValidate",""]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngSubmit"],[null,"submit"],[null,"reset"]],function(n,l,e){var u=!0,o=n.component;"submit"===l&&(u=!1!==t.ɵnov(n,10).onSubmit(e)&&u);"reset"===l&&(u=!1!==t.ɵnov(n,10).onReset()&&u);"ngSubmit"===l&&(u=!1!==o.verifyBank()&&u);return u},null,null)),t.ɵdid(10,4210688,null,0,C.NgForm,[[8,null],[8,null]],null,{ngSubmit:"ngSubmit"}),t.ɵprd(2048,null,C.ControlContainer,null,[C.NgForm]),t.ɵdid(12,16384,null,0,C.NgControlStatusGroup,[C.ControlContainer],null,null),t.ɵdid(13,540672,null,0,r.ApiActionDirective,[t.ElementRef,a.ValidationService],{appApiAction:[0,"appApiAction"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(15,0,null,null,2,"label",[["class","sr-only"],["for","verifyAmount1"]],null,null,null,null,null)),(n()(),t.ɵted(16,null,["",""])),t.ɵppd(17,2),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(19,0,null,null,17,"div",[["class","input-group mr-2"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(21,0,null,null,4,"div",[["class","input-group-prepend"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(23,0,null,null,1,"div",[["class","input-group-text"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["$0."])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(27,0,null,null,8,"input",[["class","form-control"],["id","verifyAmount1"],["max","99"],["min","1"],["name","Amount1"],["placeholder","xx"],["required",""],["step","1"],["type","number"]],[[1,"required",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"],[null,"change"]],function(n,l,e){var u=!0,o=n.component;"input"===l&&(u=!1!==t.ɵnov(n,28)._handleInput(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,28).onTouched()&&u);"compositionstart"===l&&(u=!1!==t.ɵnov(n,28)._compositionStart()&&u);"compositionend"===l&&(u=!1!==t.ɵnov(n,28)._compositionEnd(e.target.value)&&u);"change"===l&&(u=!1!==t.ɵnov(n,29).onChange(e.target.value)&&u);"input"===l&&(u=!1!==t.ɵnov(n,29).onChange(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,29).onTouched()&&u);"ngModelChange"===l&&(u=!1!==(o.verifyAmount1=e)&&u);return u},null,null)),t.ɵdid(28,16384,null,0,C.DefaultValueAccessor,[t.Renderer2,t.ElementRef,[2,C.COMPOSITION_BUFFER_MODE]],null,null),t.ɵdid(29,16384,null,0,C.ɵbc,[t.Renderer2,t.ElementRef],null,null),t.ɵdid(30,16384,null,0,C.RequiredValidator,[],{required:[0,"required"]},null),t.ɵprd(1024,null,C.NG_VALIDATORS,function(n){return[n]},[C.RequiredValidator]),t.ɵprd(1024,null,C.NG_VALUE_ACCESSOR,function(n,l){return[n,l]},[C.DefaultValueAccessor,C.ɵbc]),t.ɵdid(33,671744,null,0,C.NgModel,[[2,C.ControlContainer],[2,C.NG_VALIDATORS],[8,null],[2,C.NG_VALUE_ACCESSOR]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,C.NgControl,null,[C.NgModel]),t.ɵdid(35,16384,null,0,C.NgControlStatus,[C.NgControl],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(38,0,null,null,2,"label",[["class","sr-only"],["for","verifyAmount2"]],null,null,null,null,null)),(n()(),t.ɵted(39,null,["",""])),t.ɵppd(40,2),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(42,0,null,null,17,"div",[["class","input-group mr-2"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(44,0,null,null,4,"div",[["class","input-group-prepend"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(46,0,null,null,1,"div",[["class","input-group-text"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["$0."])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(50,0,null,null,8,"input",[["class","form-control"],["id","verifyAmount2"],["max","99"],["min","1"],["name","Amount2"],["placeholder","xx"],["required",""],["step","1"],["type","number"]],[[1,"required",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"],[null,"change"]],function(n,l,e){var u=!0,o=n.component;"input"===l&&(u=!1!==t.ɵnov(n,51)._handleInput(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,51).onTouched()&&u);"compositionstart"===l&&(u=!1!==t.ɵnov(n,51)._compositionStart()&&u);"compositionend"===l&&(u=!1!==t.ɵnov(n,51)._compositionEnd(e.target.value)&&u);"change"===l&&(u=!1!==t.ɵnov(n,52).onChange(e.target.value)&&u);"input"===l&&(u=!1!==t.ɵnov(n,52).onChange(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,52).onTouched()&&u);"ngModelChange"===l&&(u=!1!==(o.verifyAmount2=e)&&u);return u},null,null)),t.ɵdid(51,16384,null,0,C.DefaultValueAccessor,[t.Renderer2,t.ElementRef,[2,C.COMPOSITION_BUFFER_MODE]],null,null),t.ɵdid(52,16384,null,0,C.ɵbc,[t.Renderer2,t.ElementRef],null,null),t.ɵdid(53,16384,null,0,C.RequiredValidator,[],{required:[0,"required"]},null),t.ɵprd(1024,null,C.NG_VALIDATORS,function(n){return[n]},[C.RequiredValidator]),t.ɵprd(1024,null,C.NG_VALUE_ACCESSOR,function(n,l){return[n,l]},[C.DefaultValueAccessor,C.ɵbc]),t.ɵdid(56,671744,null,0,C.NgModel,[[2,C.ControlContainer],[2,C.NG_VALIDATORS],[8,null],[2,C.NG_VALUE_ACCESSOR]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,C.NgControl,null,[C.NgModel]),t.ɵdid(58,16384,null,0,C.NgControlStatus,[C.NgControl],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(61,0,null,null,8,"button",[["class","btn btn-outline-primary btn-submit"],["type","submit"]],[[8,"disabled",0]],null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(63,0,null,null,1,"i",[["class","fa fa-spinner fa-spin"]],[[8,"title",0]],null,null,null,null)),t.ɵppd(64,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(66,0,null,null,2,"span",[],null,null,null,null,null)),(n()(),t.ɵted(67,null,["",""])),t.ɵppd(68,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,0,["\n "]))],function(n,l){var e=l.component;n(l,1,0,"warning",t.ɵinlineInterpolate(1,"",t.ɵunv(l,1,1,n(l,2,0,t.ɵnov(l.parent.parent.parent.parent,0),"verifyBankAccount")),"")),n(l,13,0,e.verifyBankPromise);n(l,30,0,"");n(l,33,0,"Amount1",e.verifyAmount1);n(l,53,0,"");n(l,56,0,"Amount2",e.verifyAmount2)},function(n,l){n(l,5,0,t.ɵunv(l,5,0,n(l,6,0,t.ɵnov(l.parent.parent.parent.parent,0),"verifyBankAccountDesc")),t.ɵunv(l,5,1,n(l,7,0,t.ɵnov(l.parent.parent.parent.parent,0),"verifyBankAccountFailureWarning"))),n(l,9,0,t.ɵnov(l,12).ngClassUntouched,t.ɵnov(l,12).ngClassTouched,t.ɵnov(l,12).ngClassPristine,t.ɵnov(l,12).ngClassDirty,t.ɵnov(l,12).ngClassValid,t.ɵnov(l,12).ngClassInvalid,t.ɵnov(l,12).ngClassPending),n(l,16,0,t.ɵunv(l,16,0,n(l,17,0,t.ɵnov(l.parent.parent.parent.parent,0),"amount","1"))),n(l,27,0,t.ɵnov(l,30).required?"":null,t.ɵnov(l,35).ngClassUntouched,t.ɵnov(l,35).ngClassTouched,t.ɵnov(l,35).ngClassPristine,t.ɵnov(l,35).ngClassDirty,t.ɵnov(l,35).ngClassValid,t.ɵnov(l,35).ngClassInvalid,t.ɵnov(l,35).ngClassPending),n(l,39,0,t.ɵunv(l,39,0,n(l,40,0,t.ɵnov(l.parent.parent.parent.parent,0),"amount","2"))),n(l,50,0,t.ɵnov(l,53).required?"":null,t.ɵnov(l,58).ngClassUntouched,t.ɵnov(l,58).ngClassTouched,t.ɵnov(l,58).ngClassPristine,t.ɵnov(l,58).ngClassDirty,t.ɵnov(l,58).ngClassValid,t.ɵnov(l,58).ngClassInvalid,t.ɵnov(l,58).ngClassPending),n(l,61,0,t.ɵnov(l,9).loading),n(l,63,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,63,0,n(l,64,0,t.ɵnov(l.parent.parent.parent.parent,0),"loading")),"")),n(l,67,0,t.ɵunv(l,67,0,n(l,68,0,t.ɵnov(l.parent.parent.parent.parent,0),"verifyBankAccount")))})}function Q(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,11,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,X)),t.ɵdid(3,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(5,0,null,null,5,"p",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(7,0,null,null,2,"i",[["class","fa fa-fw"]],null,null,null,null,null)),t.ɵdid(8,278528,null,0,s.NgClass,[t.IterableDiffers,t.KeyValueDiffers,t.ElementRef,t.Renderer2],{klass:[0,"klass"],ngClass:[1,"ngClass"]},null),t.ɵpod(9,{"fa-credit-card":0,"fa-university":1,"fa-paypal text-primary":2}),(n()(),t.ɵted(10,null,["\n ","\n "])),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){var e=l.component;n(l,3,0,e.paymentSource.type===e.paymentMethodType.BankAccount&&e.paymentSource.needsVerification);n(l,8,0,"fa fa-fw",n(l,9,0,e.paymentSource.type===e.paymentMethodType.Card,e.paymentSource.type===e.paymentMethodType.BankAccount,e.paymentSource.type===e.paymentMethodType.PayPal))},function(n,l){n(l,10,0,l.component.paymentSource.description)})}function nn(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,2,"button",[["class","btn btn-outline-secondary"],["type","button"]],null,[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.changePayment()&&t);return t},null,null)),(n()(),t.ɵted(1,null,["\n ","\n "])),t.ɵppd(2,1)],null,function(n,l){var e=l.component;n(l,1,0,t.ɵunv(l,1,0,n(l,2,0,t.ɵnov(l.parent.parent.parent,0),e.paymentSource?"changePaymentMethod":"addPaymentMethod")))})}function ln(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,2,"app-adjust-payment",[],null,[[null,"onAdjusted"],[null,"onCanceled"]],function(n,l,e){var t=!0,u=n.component;"onAdjusted"===l&&(t=!1!==u.closePayment(!0)&&t);"onCanceled"===l&&(t=!1!==u.closePayment(!1)&&t);return t},b.View_AdjustPaymentComponent_0,b.RenderType_AdjustPaymentComponent)),t.ɵdid(1,49152,null,0,S.AdjustPaymentComponent,[p.ApiService,i.I18nService,f.Angulartics2,v.ToasterService],{currentType:[0,"currentType"],organizationId:[1,"organizationId"]},{onAdjusted:"onAdjusted",onCanceled:"onCanceled"}),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){var e=l.component;n(l,1,0,null!=e.paymentSource?e.paymentSource.type:null,e.organizationId)},null)}function en(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,2,"p",[],null,null,null,null,null)),(n()(),t.ɵted(1,null,["",""])),t.ɵppd(2,1)],null,function(n,l){n(l,1,0,t.ɵunv(l,1,0,n(l,2,0,t.ɵnov(l.parent.parent.parent,0),"noCharges")))})}function tn(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,28,"tr",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,8,"td",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(4,0,null,null,5,"a",[["appStopClick",""],["href","#"]],[[8,"title",0]],[[null,"click"]],function(n,l,e){var u=!0,o=n.component;"click"===l&&(u=!1!==t.ɵnov(n,5).onClick(e)&&u);"click"===l&&(u=!1!==o.viewInvoice(n.context.$implicit)&&u);return u},null,null)),t.ɵdid(5,16384,null,0,w.StopClickDirective,[],null,null),t.ɵppd(6,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(8,0,null,null,0,"i",[["class","fa fa-file-pdf-o"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(12,0,null,null,2,"td",[],null,null,null,null,null)),(n()(),t.ɵted(13,null,["",""])),t.ɵppd(14,2),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(16,0,null,null,1,"td",[],null,null,null,null,null)),(n()(),t.ɵted(17,null,["",""])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(19,0,null,null,1,"td",[["class","text-capitalize"]],null,null,null,null,null)),(n()(),t.ɵted(20,null,["",""])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(22,0,null,null,5,"td",[],[[8,"title",0]],null,null,null,null)),t.ɵdid(23,278528,null,0,s.NgClass,[t.IterableDiffers,t.KeyValueDiffers,t.ElementRef,t.Renderer2],{ngClass:[0,"ngClass"]},null),t.ɵpod(24,{"text-strike":0}),t.ɵppd(25,1),(n()(),t.ɵted(26,null,["",""])),t.ɵppd(27,2),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){n(l,23,0,n(l,24,0,l.context.$implicit.refunded))},function(n,l){n(l,4,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,4,0,n(l,6,0,t.ɵnov(l.parent.parent.parent.parent,0),"invoice")),"")),n(l,13,0,t.ɵunv(l,13,0,n(l,14,0,t.ɵnov(l.parent.parent.parent.parent,1),l.context.$implicit.createdDate,"mediumDate"))),n(l,17,0,l.context.$implicit.paymentSource?l.context.$implicit.paymentSource.description:"-"),n(l,20,0,l.context.$implicit.status),n(l,22,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,22,0,n(l,25,0,t.ɵnov(l.parent.parent.parent.parent,0),l.context.$implicit.refunded?"refunded":"")),"")),n(l,26,0,t.ɵunv(l,26,0,n(l,27,0,t.ɵnov(l.parent.parent.parent.parent,2),l.context.$implicit.amount,"$")))})}function un(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,7,"table",[["class","table mb-2"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,4,"tbody",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,tn)),t.ɵdid(5,802816,null,0,s.NgForOf,[t.ViewContainerRef,t.TemplateRef,t.IterableDiffers],{ngForOf:[0,"ngForOf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){n(l,5,0,l.component.charges)},null)}function on(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,75,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,11,"div",[["class","d-flex"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(4,0,null,null,2,"button",[["class","btn btn-outline-secondary"],["type","button"]],null,[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.changePlan()&&t);return t},null,null)),(n()(),t.ɵted(5,null,["\n ","\n "])),t.ɵppd(6,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,j)),t.ɵdid(9,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,B)),t.ɵdid(12,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(15,0,null,null,2,"h2",[["class","spaced-header"]],null,null,null,null,null)),(n()(),t.ɵted(16,null,["",""])),t.ɵppd(17,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(19,0,null,null,2,"p",[],null,null,null,null,null)),(n()(),t.ɵted(20,null,["",""])),t.ɵppd(21,2),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,$)),t.ɵdid(24,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(26,0,null,null,2,"h2",[["class","spaced-header"]],null,null,null,null,null)),(n()(),t.ɵted(27,null,["",""])),t.ɵppd(28,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(30,0,null,null,2,"p",[],null,null,null,null,null)),(n()(),t.ɵted(31,null,["",""])),t.ɵppd(32,3),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(34,0,null,null,7,"div",[["class","progress"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(36,0,null,null,4,"div",[["aria-valuemax","100"],["aria-valuemin","0"],["class","progress-bar bg-success"],["role","progressbar"]],[[1,"aria-valuenow",0]],null,null,null,null)),t.ɵdid(37,278528,null,0,s.NgStyle,[t.KeyValueDiffers,t.ElementRef,t.Renderer2],{ngStyle:[0,"ngStyle"]},null),t.ɵpod(38,{width:0}),(n()(),t.ɵted(39,null,["",""])),t.ɵppd(40,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,Z)),t.ɵdid(44,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(46,0,null,null,2,"h2",[["class","spaced-header"]],null,null,null,null,null)),(n()(),t.ɵted(47,null,["",""])),t.ɵppd(48,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,J)),t.ɵdid(51,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,Q)),t.ɵdid(54,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,nn)),t.ɵdid(57,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,ln)),t.ɵdid(60,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(62,0,null,null,2,"h2",[["class","spaced-header"]],null,null,null,null,null)),(n()(),t.ɵted(63,null,["",""])),t.ɵppd(64,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,en)),t.ɵdid(67,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,un)),t.ɵdid(70,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(72,0,null,null,2,"small",[["class","text-muted"]],null,null,null,null,null)),(n()(),t.ɵted(73,null,["* ",""])),t.ɵppd(74,2),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){var e=l.component;n(l,9,0,e.canDownloadLicense),n(l,12,0,e.subscription&&!e.subscription.cancelled&&!e.subscriptionMarkedForCancel),n(l,24,0,e.subscription&&e.canAdjustSeats),n(l,37,0,n(l,38,0,e.storageProgressWidth+"%")),n(l,44,0,e.subscription&&!e.subscription.cancelled&&!e.subscriptionMarkedForCancel&&e.paymentSource),n(l,51,0,!e.paymentSource),n(l,54,0,e.paymentSource),n(l,57,0,!e.showAdjustPayment),n(l,60,0,e.showAdjustPayment),n(l,67,0,!e.charges||!e.charges.length),n(l,70,0,e.charges&&e.charges.length)},function(n,l){var e=l.component;n(l,5,0,t.ɵunv(l,5,0,n(l,6,0,t.ɵnov(l.parent.parent,0),"changeBillingPlan"))),n(l,16,0,t.ɵunv(l,16,0,n(l,17,0,t.ɵnov(l.parent.parent,0),"userSeats"))),n(l,20,0,t.ɵunv(l,20,0,n(l,21,0,t.ɵnov(l.parent.parent,0),"subscriptionUserSeats",e.billing.seats))),n(l,27,0,t.ɵunv(l,27,0,n(l,28,0,t.ɵnov(l.parent.parent,0),"storage"))),n(l,31,0,t.ɵunv(l,31,0,n(l,32,0,t.ɵnov(l.parent.parent,0),"subscriptionStorage",e.billing.maxStorageGb||0,e.billing.storageName||"0 MB"))),n(l,36,0,e.storagePercentage),n(l,39,0,t.ɵunv(l,39,0,n(l,40,0,t.ɵnov(l.parent.parent,3),e.storagePercentage/100))),n(l,47,0,t.ɵunv(l,47,0,n(l,48,0,t.ɵnov(l.parent.parent,0),"paymentMethod"))),n(l,63,0,t.ɵunv(l,63,0,n(l,64,0,t.ɵnov(l.parent.parent,0),"charges"))),n(l,73,0,t.ɵunv(l,73,0,n(l,74,0,t.ɵnov(l.parent.parent,0),"chargesStatement","BITWARDEN")))})}function rn(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,19,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,k)),t.ɵdid(3,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,V)),t.ɵdid(6,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,x)),t.ɵdid(9,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,G)),t.ɵdid(12,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,z)),t.ɵdid(15,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,on)),t.ɵdid(18,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){var e=l.component;n(l,3,0,e.subscription&&e.subscription.cancelled),n(l,6,0,e.subscriptionMarkedForCancel),n(l,9,0,e.selfHosted),n(l,12,0,!e.selfHosted),n(l,15,0,e.selfHosted),n(l,18,0,!e.selfHosted)},null)}function an(n){return t.ɵvid(0,[t.ɵpid(0,R.I18nPipe,[i.I18nService]),t.ɵpid(0,s.DatePipe,[t.LOCALE_ID]),t.ɵpid(0,s.CurrencyPipe,[t.LOCALE_ID]),t.ɵpid(0,s.PercentPipe,[t.LOCALE_ID]),(n()(),t.ɵeld(4,0,null,null,11,"div",[["class","page-header"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(6,0,null,null,8,"h1",[],null,null,null,null,null)),(n()(),t.ɵted(7,null,["\n ","\n "])),t.ɵppd(8,1),(n()(),t.ɵeld(9,0,null,null,4,"small",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,N)),t.ɵdid(12,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,null,null,1,null,T)),t.ɵdid(18,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,null,null,1,null,rn)),t.ɵdid(21,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){var e=l.component;n(l,12,0,e.firstLoaded&&e.loading),n(l,18,0,!e.firstLoaded&&e.loading),n(l,21,0,e.billing)},function(n,l){n(l,7,0,t.ɵunv(l,7,0,n(l,8,0,t.ɵnov(l,0),"billingAndLicensing")))})}function sn(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"app-org-billing",[],null,null,null,an,O)),t.ɵdid(1,114688,null,0,_.OrganizationBillingComponent,[I.TokenService,p.ApiService,A.PlatformUtilsService,i.I18nService,f.Angulartics2,v.ToasterService,E.ActivatedRoute],null,null)],function(n,l){n(l,1,0)},null)}l.RenderType_OrganizationBillingComponent=O,l.View_OrganizationBillingComponent_0=an,l.View_OrganizationBillingComponent_Host_0=sn;var dn=t.ɵccf("app-org-billing",_.OrganizationBillingComponent,sn,{},{},[]);l.OrganizationBillingComponentNgFactory=dn},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=e(0),u=e(40),o=e(37),i=e(2),r=e(60),a=e(5),s=e(7),d=e(239),c=e(4),p=e(35),f=e(27),v=e(10),h=t.ɵcrt({encapsulation:2,styles:[],data:{}});function g(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,2,"p",[],null,null,null,null,null)),(n()(),t.ɵted(1,null,["",""])),t.ɵppd(2,1)],null,function(n,l){n(l,1,0,t.ɵunv(l,1,0,n(l,2,0,t.ɵnov(l.parent,0),"twoStepLoginDesc")))})}function m(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,2,"p",[],null,null,null,null,null)),(n()(),t.ɵted(1,null,["",""])),t.ɵppd(2,1)],null,function(n,l){n(l,1,0,t.ɵunv(l,1,0,n(l,2,0,t.ɵnov(l.parent,0),"twoStepLoginOrganizationDesc")))})}function y(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,10,"app-callout",[["type","warning"]],null,null,null,u.View_CalloutComponent_0,u.RenderType_CalloutComponent)),t.ɵdid(1,114688,null,0,o.CalloutComponent,[i.I18nService],{type:[0,"type"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵeld(3,0,null,0,2,"p",[],null,null,null,null,null)),(n()(),t.ɵted(4,null,["",""])),t.ɵppd(5,1),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵeld(7,0,null,0,2,"button",[["class","btn btn-outline-secondary"],["type","button"]],null,[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.recoveryCode()&&t);return t},null,null)),(n()(),t.ɵted(8,null,["",""])),t.ɵppd(9,1),(n()(),t.ɵted(-1,0,["\n"]))],function(n,l){n(l,1,0,"warning")},function(n,l){n(l,4,0,t.ɵunv(l,4,0,n(l,5,0,t.ɵnov(l.parent,0),"twoStepLoginRecoveryWarning"))),n(l,8,0,t.ɵunv(l,8,0,n(l,9,0,t.ɵnov(l.parent,0),"viewRecoveryCode")))})}function C(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,4,"small",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,1,"i",[["class","fa fa-spinner fa-spin fa-fw text-muted"]],[[8,"title",0]],null,null,null,null)),t.ɵppd(3,1),(n()(),t.ɵted(-1,null,["\n "]))],null,function(n,l){n(l,2,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,2,0,n(l,3,0,t.ɵnov(l.parent,0),"loading")),""))})}function b(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"i",[["class","fa fa-check text-success fa-fw"]],[[8,"title",0]],null,null,null,null)),t.ɵppd(1,1)],null,function(n,l){n(l,0,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,0,0,n(l,1,0,t.ɵnov(l.parent.parent,0),"enabled")),""))})}function S(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,3,"a",[["appStopClick",""],["class","badge badge-primary"],["href","#"]],null,[[null,"click"]],function(n,l,e){var u=!0,o=n.component;"click"===l&&(u=!1!==t.ɵnov(n,1).onClick(e)&&u);"click"===l&&(u=!1!==o.premiumRequired()&&u);return u},null,null)),t.ɵdid(1,16384,null,0,r.StopClickDirective,[],null,null),(n()(),t.ɵted(2,null,["\n ","\n "])),t.ɵppd(3,1)],null,function(n,l){n(l,2,0,t.ɵunv(l,2,0,n(l,3,0,t.ɵnov(l.parent.parent,0),"premium")))})}function w(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,25,"li",[["class","list-group-item d-flex align-items-center"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,3,"div",[["class","logo-2fa d-flex justify-content-center"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(4,0,null,null,0,"img",[["alt",""]],[[8,"src",4]],null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(7,0,null,null,10,"div",[["class","mx-4"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(9,0,null,null,7,"h3",[["class","mb-0"]],null,null,null,null,null)),(n()(),t.ɵted(10,null,["\n ","\n "])),(n()(),t.ɵand(16777216,null,null,1,null,b)),t.ɵdid(12,16384,null,0,a.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,S)),t.ɵdid(15,16384,null,0,a.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(17,null,["\n ","\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(19,0,null,null,5,"div",[["class","ml-auto"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(21,0,null,null,2,"button",[["class","btn btn-outline-secondary btn-sm"],["type","button"]],[[8,"disabled",0]],[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.manage(n.context.$implicit.type)&&t);return t},null,null)),(n()(),t.ɵted(22,null,["\n ","\n "])),t.ɵppd(23,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){var e=l.component;n(l,12,0,l.context.$implicit.enabled),n(l,15,0,!e.premium&&l.context.$implicit.premium)},function(n,l){var e=l.component;n(l,4,0,"images/two-factor/"+l.context.$implicit.type+".png"),n(l,10,0,l.context.$implicit.name),n(l,17,0,l.context.$implicit.description),n(l,21,0,!e.premium&&l.context.$implicit.premium),n(l,22,0,t.ɵunv(l,22,0,n(l,23,0,t.ɵnov(l.parent,0),"manage")))})}function R(n){return t.ɵvid(0,[(n()(),t.ɵand(0,null,null,0))],null,null)}function _(n){return t.ɵvid(0,[(n()(),t.ɵand(0,null,null,0))],null,null)}function I(n){return t.ɵvid(0,[(n()(),t.ɵand(0,null,null,0))],null,null)}function A(n){return t.ɵvid(0,[(n()(),t.ɵand(0,null,null,0))],null,null)}function E(n){return t.ɵvid(0,[(n()(),t.ɵand(0,null,null,0))],null,null)}function O(n){return t.ɵvid(0,[(n()(),t.ɵand(0,null,null,0))],null,null)}function N(n){return t.ɵvid(0,[t.ɵpid(0,s.I18nPipe,[i.I18nService]),t.ɵqud(402653184,1,{recoveryModalRef:0}),t.ɵqud(402653184,2,{authenticatorModalRef:0}),t.ɵqud(402653184,3,{yubikeyModalRef:0}),t.ɵqud(402653184,4,{u2fModalRef:0}),t.ɵqud(402653184,5,{duoModalRef:0}),t.ɵqud(402653184,6,{emailModalRef:0}),(n()(),t.ɵeld(7,0,null,null,5,"div",[["class","page-header"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(9,0,null,null,2,"h1",[],null,null,null,null,null)),(n()(),t.ɵted(10,null,["",""])),t.ɵppd(11,1),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,null,null,1,null,g)),t.ɵdid(15,16384,null,0,a.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,null,null,1,null,m)),t.ɵdid(18,16384,null,0,a.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,null,null,1,null,y)),t.ɵdid(21,16384,null,0,a.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵeld(23,0,null,null,7,"h2",[],null,null,null,null,null)),t.ɵdid(24,278528,null,0,a.NgClass,[t.IterableDiffers,t.KeyValueDiffers,t.ElementRef,t.Renderer2],{ngClass:[0,"ngClass"]},null),t.ɵpod(25,{"mt-5":0}),(n()(),t.ɵted(26,null,["\n ","\n "])),t.ɵppd(27,1),(n()(),t.ɵand(16777216,null,null,1,null,C)),t.ɵdid(29,16384,null,0,a.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵeld(32,0,null,null,4,"ul",[["class","list-group list-group-2fa"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,w)),t.ɵdid(35,802816,null,0,a.NgForOf,[t.ViewContainerRef,t.TemplateRef,t.IterableDiffers],{ngForOf:[0,"ngForOf"]},null),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n\n"])),(n()(),t.ɵand(16777216,[[2,3],["authenticatorTemplate",2]],null,0,null,R)),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,[[1,3],["recoveryTemplate",2]],null,0,null,_)),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,[[5,3],["duoTemplate",2]],null,0,null,I)),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,[[6,3],["emailTemplate",2]],null,0,null,A)),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,[[3,3],["yubikeyTemplate",2]],null,0,null,E)),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,[[4,3],["u2fTemplate",2]],null,0,null,O)),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){var e=l.component;n(l,15,0,!e.organizationId),n(l,18,0,e.organizationId),n(l,21,0,!e.organizationId),n(l,24,0,n(l,25,0,!e.organizationId)),n(l,29,0,e.loading),n(l,35,0,e.providers)},function(n,l){n(l,10,0,t.ɵunv(l,10,0,n(l,11,0,t.ɵnov(l,0),"twoStepLogin"))),n(l,26,0,t.ɵunv(l,26,0,n(l,27,0,t.ɵnov(l,0),"providers")))})}function T(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"app-two-factor-setup",[],null,null,null,N,h)),t.ɵdid(1,114688,null,0,d.TwoFactorSetupComponent,[c.ApiService,p.TokenService,t.ComponentFactoryResolver,f.MessagingService,v.ActivatedRoute],null,null)],function(n,l){n(l,1,0)},null)}l.RenderType_TwoFactorSetupComponent=h,l.View_TwoFactorSetupComponent_0=N,l.View_TwoFactorSetupComponent_Host_0=T;var k=t.ɵccf("app-two-factor-setup",d.TwoFactorSetupComponent,T,{},{},[]);l.TwoFactorSetupComponentNgFactory=k},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(){}}();l.OrganizationUpdateRequest=t},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=e(0),u=e(13),o=e(18),i=e(17),r=e(130),a=e(116),s=e(42),d=e(7),c=e(2),p=e(5),f=e(240),v=e(4),h=e(3),g=e(9),m=e(10),y=e(66),C=t.ɵcrt({encapsulation:2,styles:[],data:{}});function b(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,4,"div",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,1,"i",[["class","fa fa-spinner fa-spin text-muted"]],[[8,"title",0]],null,null,null,null)),t.ɵppd(3,1),(n()(),t.ɵted(-1,null,["\n"]))],null,function(n,l){n(l,2,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,2,0,n(l,3,0,t.ɵnov(l.parent,0),"loading")),""))})}function S(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,[["form",1]],null,69,"form",[["ngNativeValidate",""]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngSubmit"],[null,"submit"],[null,"reset"]],function(n,l,e){var u=!0,o=n.component;"submit"===l&&(u=!1!==t.ɵnov(n,1).onSubmit(e)&&u);"reset"===l&&(u=!1!==t.ɵnov(n,1).onReset()&&u);"ngSubmit"===l&&(u=!1!==o.submit()&&u);return u},null,null)),t.ɵdid(1,4210688,null,0,u.NgForm,[[8,null],[8,null]],null,{ngSubmit:"ngSubmit"}),t.ɵprd(2048,null,u.ControlContainer,null,[u.NgForm]),t.ɵdid(3,16384,null,0,u.NgControlStatusGroup,[u.ControlContainer],null,null),t.ɵdid(4,540672,null,0,o.ApiActionDirective,[t.ElementRef,i.ValidationService],{appApiAction:[0,"appApiAction"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(6,0,null,null,52,"div",[["class","row"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(8,0,null,null,43,"div",[["class","col-6"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(10,0,null,null,12,"div",[["class","form-group"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(12,0,null,null,2,"label",[["for","name"]],null,null,null,null,null)),(n()(),t.ɵted(13,null,["",""])),t.ɵppd(14,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(16,0,null,null,5,"input",[["class","form-control"],["id","name"],["name","Name"],["type","text"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(n,l,e){var u=!0,o=n.component;"input"===l&&(u=!1!==t.ɵnov(n,17)._handleInput(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,17).onTouched()&&u);"compositionstart"===l&&(u=!1!==t.ɵnov(n,17)._compositionStart()&&u);"compositionend"===l&&(u=!1!==t.ɵnov(n,17)._compositionEnd(e.target.value)&&u);"ngModelChange"===l&&(u=!1!==(o.org.name=e)&&u);return u},null,null)),t.ɵdid(17,16384,null,0,u.DefaultValueAccessor,[t.Renderer2,t.ElementRef,[2,u.COMPOSITION_BUFFER_MODE]],null,null),t.ɵprd(1024,null,u.NG_VALUE_ACCESSOR,function(n){return[n]},[u.DefaultValueAccessor]),t.ɵdid(19,671744,null,0,u.NgModel,[[2,u.ControlContainer],[8,null],[8,null],[2,u.NG_VALUE_ACCESSOR]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,u.NgControl,null,[u.NgModel]),t.ɵdid(21,16384,null,0,u.NgControlStatus,[u.NgControl],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(24,0,null,null,12,"div",[["class","form-group"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(26,0,null,null,2,"label",[["for","billingEmail"]],null,null,null,null,null)),(n()(),t.ɵted(27,null,["",""])),t.ɵppd(28,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(30,0,null,null,5,"input",[["class","form-control"],["id","billingEmail"],["name","BillingEmail"],["type","text"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(n,l,e){var u=!0,o=n.component;"input"===l&&(u=!1!==t.ɵnov(n,31)._handleInput(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,31).onTouched()&&u);"compositionstart"===l&&(u=!1!==t.ɵnov(n,31)._compositionStart()&&u);"compositionend"===l&&(u=!1!==t.ɵnov(n,31)._compositionEnd(e.target.value)&&u);"ngModelChange"===l&&(u=!1!==(o.org.billingEmail=e)&&u);return u},null,null)),t.ɵdid(31,16384,null,0,u.DefaultValueAccessor,[t.Renderer2,t.ElementRef,[2,u.COMPOSITION_BUFFER_MODE]],null,null),t.ɵprd(1024,null,u.NG_VALUE_ACCESSOR,function(n){return[n]},[u.DefaultValueAccessor]),t.ɵdid(33,671744,null,0,u.NgModel,[[2,u.ControlContainer],[8,null],[8,null],[2,u.NG_VALUE_ACCESSOR]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,u.NgControl,null,[u.NgModel]),t.ɵdid(35,16384,null,0,u.NgControlStatus,[u.NgControl],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(38,0,null,null,12,"div",[["class","form-group"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(40,0,null,null,2,"label",[["for","businessName"]],null,null,null,null,null)),(n()(),t.ɵted(41,null,["",""])),t.ɵppd(42,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(44,0,null,null,5,"input",[["class","form-control"],["id","businessName"],["name","BusinessName"],["type","text"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(n,l,e){var u=!0,o=n.component;"input"===l&&(u=!1!==t.ɵnov(n,45)._handleInput(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,45).onTouched()&&u);"compositionstart"===l&&(u=!1!==t.ɵnov(n,45)._compositionStart()&&u);"compositionend"===l&&(u=!1!==t.ɵnov(n,45)._compositionEnd(e.target.value)&&u);"ngModelChange"===l&&(u=!1!==(o.org.businessName=e)&&u);return u},null,null)),t.ɵdid(45,16384,null,0,u.DefaultValueAccessor,[t.Renderer2,t.ElementRef,[2,u.COMPOSITION_BUFFER_MODE]],null,null),t.ɵprd(1024,null,u.NG_VALUE_ACCESSOR,function(n){return[n]},[u.DefaultValueAccessor]),t.ɵdid(47,671744,null,0,u.NgModel,[[2,u.ControlContainer],[8,null],[8,null],[2,u.NG_VALUE_ACCESSOR]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,u.NgControl,null,[u.NgModel]),t.ɵdid(49,16384,null,0,u.NgControlStatus,[u.NgControl],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(53,0,null,null,4,"div",[["class","col-6"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(55,0,null,null,1,"app-avatar",[["dynamic","true"],["fontSize","35"],["height","75"],["width","75"]],null,null,null,r.View_AvatarComponent_0,r.RenderType_AvatarComponent)),t.ɵdid(56,638976,null,0,a.AvatarComponent,[s.DomSanitizer],{data:[0,"data"],width:[1,"width"],height:[2,"height"],fontSize:[3,"fontSize"],dynamic:[4,"dynamic"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(60,0,null,null,8,"button",[["class","btn btn-primary btn-submit"],["type","submit"]],[[8,"disabled",0]],null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(62,0,null,null,1,"i",[["class","fa fa-spinner fa-spin"]],[[8,"title",0]],null,null,null,null)),t.ɵppd(63,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(65,0,null,null,2,"span",[],null,null,null,null,null)),(n()(),t.ɵted(66,null,["",""])),t.ɵppd(67,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){var e=l.component;n(l,4,0,e.formPromise);n(l,19,0,"Name",e.org.name);n(l,33,0,"BillingEmail",e.org.billingEmail);n(l,47,0,"BusinessName",e.org.businessName);n(l,56,0,t.ɵinlineInterpolate(1,"",e.org.name,""),"75","75","35","true")},function(n,l){n(l,0,0,t.ɵnov(l,3).ngClassUntouched,t.ɵnov(l,3).ngClassTouched,t.ɵnov(l,3).ngClassPristine,t.ɵnov(l,3).ngClassDirty,t.ɵnov(l,3).ngClassValid,t.ɵnov(l,3).ngClassInvalid,t.ɵnov(l,3).ngClassPending),n(l,13,0,t.ɵunv(l,13,0,n(l,14,0,t.ɵnov(l.parent,0),"organizationName"))),n(l,16,0,t.ɵnov(l,21).ngClassUntouched,t.ɵnov(l,21).ngClassTouched,t.ɵnov(l,21).ngClassPristine,t.ɵnov(l,21).ngClassDirty,t.ɵnov(l,21).ngClassValid,t.ɵnov(l,21).ngClassInvalid,t.ɵnov(l,21).ngClassPending),n(l,27,0,t.ɵunv(l,27,0,n(l,28,0,t.ɵnov(l.parent,0),"billingEmail"))),n(l,30,0,t.ɵnov(l,35).ngClassUntouched,t.ɵnov(l,35).ngClassTouched,t.ɵnov(l,35).ngClassPristine,t.ɵnov(l,35).ngClassDirty,t.ɵnov(l,35).ngClassValid,t.ɵnov(l,35).ngClassInvalid,t.ɵnov(l,35).ngClassPending),n(l,41,0,t.ɵunv(l,41,0,n(l,42,0,t.ɵnov(l.parent,0),"businessName"))),n(l,44,0,t.ɵnov(l,49).ngClassUntouched,t.ɵnov(l,49).ngClassTouched,t.ɵnov(l,49).ngClassPristine,t.ɵnov(l,49).ngClassDirty,t.ɵnov(l,49).ngClassValid,t.ɵnov(l,49).ngClassInvalid,t.ɵnov(l,49).ngClassPending),n(l,60,0,t.ɵnov(l,0).loading),n(l,62,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,62,0,n(l,63,0,t.ɵnov(l.parent,0),"loading")),"")),n(l,66,0,t.ɵunv(l,66,0,n(l,67,0,t.ɵnov(l.parent,0),"save")))})}function w(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,16,"div",[["class","mb-3"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,1,"div",[],null,null,null,null,null)),(n()(),t.ɵted(3,null,["",""])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(5,0,null,null,1,"div",[],null,null,null,null,null)),(n()(),t.ɵted(6,null,["",""])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(8,0,null,null,1,"div",[],null,null,null,null,null)),(n()(),t.ɵted(9,null,["",""])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(11,0,null,null,1,"div",[],null,null,null,null,null)),(n()(),t.ɵted(12,null,["",""])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(14,0,null,null,1,"div",[],null,null,null,null,null)),(n()(),t.ɵted(15,null,["",""])),(n()(),t.ɵted(-1,null,["\n"]))],null,function(n,l){var e=l.component;n(l,3,0,e.org.businessAddress1),n(l,6,0,e.org.businessAddress2),n(l,9,0,e.org.businessAddress3),n(l,12,0,e.org.businessCountry),n(l,15,0,e.org.businessTaxNumber)})}function R(n){return t.ɵvid(0,[(n()(),t.ɵand(0,null,null,0))],null,null)}function _(n){return t.ɵvid(0,[t.ɵpid(0,d.I18nPipe,[c.I18nService]),t.ɵqud(402653184,1,{deleteModalRef:0}),(n()(),t.ɵeld(2,0,null,null,5,"div",[["class","page-header"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(4,0,null,null,2,"h1",[],null,null,null,null,null)),(n()(),t.ɵted(5,null,["",""])),t.ɵppd(6,1),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,null,null,1,null,b)),t.ɵdid(10,16384,null,0,p.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,null,null,1,null,S)),t.ɵdid(13,16384,null,0,p.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵeld(15,0,null,null,5,"div",[["class","secondary-header border-0 mb-0"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(17,0,null,null,2,"h1",[],null,null,null,null,null)),(n()(),t.ɵted(18,null,["",""])),t.ɵppd(19,1),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,null,null,1,null,w)),t.ɵdid(23,16384,null,0,p.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵeld(25,0,null,null,2,"p",[],null,null,null,null,null)),(n()(),t.ɵted(26,null,["",""])),t.ɵppd(27,1),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵeld(29,0,null,null,2,"a",[["class","btn btn-outline-secondary"],["href","https://bitwarden.com/contact/"],["rel","noopener"],["target","_blank"]],null,null,null,null,null)),(n()(),t.ɵted(30,null,["\n ","\n"])),t.ɵppd(31,1),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵeld(33,0,null,null,5,"div",[["class","secondary-header text-danger border-0 mb-0"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(35,0,null,null,2,"h1",[],null,null,null,null,null)),(n()(),t.ɵted(36,null,["",""])),t.ɵppd(37,1),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵeld(40,0,null,null,12,"div",[["class","card border-danger"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(42,0,null,null,9,"div",[["class","card-body"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(44,0,null,null,2,"p",[],null,null,null,null,null)),(n()(),t.ɵted(45,null,["",""])),t.ɵppd(46,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(48,0,null,null,2,"button",[["class","btn btn-outline-danger"],["type","button"]],null,[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.deleteOrganization()&&t);return t},null,null)),(n()(),t.ɵted(49,null,["",""])),t.ɵppd(50,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,[[1,3],["deleteOrganizationTemplate",2]],null,0,null,R)),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){var e=l.component;n(l,10,0,e.loading),n(l,13,0,e.org&&!e.loading),n(l,23,0,e.org&&(e.org.businessAddress1||e.org.businessTaxNumber))},function(n,l){n(l,5,0,t.ɵunv(l,5,0,n(l,6,0,t.ɵnov(l,0),"myOrganization"))),n(l,18,0,t.ɵunv(l,18,0,n(l,19,0,t.ɵnov(l,0),"taxInformation"))),n(l,26,0,t.ɵunv(l,26,0,n(l,27,0,t.ɵnov(l,0),"taxInformationDesc"))),n(l,30,0,t.ɵunv(l,30,0,n(l,31,0,t.ɵnov(l,0),"contactSupport"))),n(l,36,0,t.ɵunv(l,36,0,n(l,37,0,t.ɵnov(l,0),"dangerZone"))),n(l,45,0,t.ɵunv(l,45,0,n(l,46,0,t.ɵnov(l,0),"dangerZoneDesc"))),n(l,49,0,t.ɵunv(l,49,0,n(l,50,0,t.ɵnov(l,0),"deleteOrganization")))})}function I(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"app-org-account",[],null,null,null,_,C)),t.ɵdid(1,114688,null,0,f.AccountComponent,[t.ComponentFactoryResolver,v.ApiService,c.I18nService,h.Angulartics2,g.ToasterService,m.ActivatedRoute,y.SyncService],null,null)],function(n,l){n(l,1,0)},null)}l.RenderType_AccountComponent=C,l.View_AccountComponent_0=_,l.View_AccountComponent_Host_0=I;var A=t.ɵccf("app-org-account",f.AccountComponent,I,{},{},[]);l.AccountComponentNgFactory=A},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=e(0),u=e(10),o=e(5),i=e(7),r=e(2),a=e(241),s=e(21),d=t.ɵcrt({encapsulation:2,styles:[],data:{}});function c(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,6,"a",[["class","list-group-item"],["routerLink","two-factor"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(n,l,e){var u=!0;"click"===l&&(u=!1!==t.ɵnov(n,1).onClick(e.button,e.ctrlKey,e.metaKey,e.shiftKey)&&u);return u},null,null)),t.ɵdid(1,671744,[[6,4]],0,u.RouterLinkWithHref,[u.Router,u.ActivatedRoute,o.LocationStrategy],{routerLink:[0,"routerLink"]},null),t.ɵdid(2,1720320,null,2,u.RouterLinkActive,[u.Router,t.ElementRef,t.Renderer2,t.ChangeDetectorRef],{routerLinkActive:[0,"routerLinkActive"]},null),t.ɵqud(603979776,5,{links:1}),t.ɵqud(603979776,6,{linksWithHrefs:1}),(n()(),t.ɵted(5,null,["\n ","\n "])),t.ɵppd(6,1)],function(n,l){n(l,1,0,"two-factor");n(l,2,0,"active")},function(n,l){n(l,0,0,t.ɵnov(l,1).target,t.ɵnov(l,1).href),n(l,5,0,t.ɵunv(l,5,0,n(l,6,0,t.ɵnov(l.parent,0),"twoStepLogin")))})}function p(n){return t.ɵvid(0,[t.ɵpid(0,i.I18nPipe,[r.I18nService]),(n()(),t.ɵeld(1,0,null,null,42,"div",[["class","container page-content"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(3,0,null,null,39,"div",[["class","row"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(5,0,null,null,30,"div",[["class","col-3"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(7,0,null,null,27,"div",[["class","card"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(9,0,null,null,2,"div",[["class","card-header"]],null,null,null,null,null)),(n()(),t.ɵted(10,null,["",""])),t.ɵppd(11,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(13,0,null,null,20,"div",[["class","list-group list-group-flush"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(15,0,null,null,6,"a",[["class","list-group-item"],["routerLink","account"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(n,l,e){var u=!0;"click"===l&&(u=!1!==t.ɵnov(n,16).onClick(e.button,e.ctrlKey,e.metaKey,e.shiftKey)&&u);return u},null,null)),t.ɵdid(16,671744,[[2,4]],0,u.RouterLinkWithHref,[u.Router,u.ActivatedRoute,o.LocationStrategy],{routerLink:[0,"routerLink"]},null),t.ɵdid(17,1720320,null,2,u.RouterLinkActive,[u.Router,t.ElementRef,t.Renderer2,t.ChangeDetectorRef],{routerLinkActive:[0,"routerLinkActive"]},null),t.ɵqud(603979776,1,{links:1}),t.ɵqud(603979776,2,{linksWithHrefs:1}),(n()(),t.ɵted(20,null,["\n ","\n "])),t.ɵppd(21,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(23,0,null,null,6,"a",[["class","list-group-item"],["routerLink","billing"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(n,l,e){var u=!0;"click"===l&&(u=!1!==t.ɵnov(n,24).onClick(e.button,e.ctrlKey,e.metaKey,e.shiftKey)&&u);return u},null,null)),t.ɵdid(24,671744,[[4,4]],0,u.RouterLinkWithHref,[u.Router,u.ActivatedRoute,o.LocationStrategy],{routerLink:[0,"routerLink"]},null),t.ɵdid(25,1720320,null,2,u.RouterLinkActive,[u.Router,t.ElementRef,t.Renderer2,t.ChangeDetectorRef],{routerLinkActive:[0,"routerLinkActive"]},null),t.ɵqud(603979776,3,{links:1}),t.ɵqud(603979776,4,{linksWithHrefs:1}),(n()(),t.ɵted(28,null,["\n ","\n "])),t.ɵppd(29,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,c)),t.ɵdid(32,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(37,0,null,null,4,"div",[["class","col-9"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(39,16777216,null,null,1,"router-outlet",[],null,null,null,null,null)),t.ɵdid(40,212992,null,0,u.RouterOutlet,[u.ChildrenOutletContexts,t.ViewContainerRef,t.ComponentFactoryResolver,[8,null],t.ChangeDetectorRef],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){var e=l.component;n(l,16,0,"account");n(l,17,0,"active");n(l,24,0,"billing");n(l,25,0,"active"),n(l,32,0,e.access2fa),n(l,40,0)},function(n,l){n(l,10,0,t.ɵunv(l,10,0,n(l,11,0,t.ɵnov(l,0),"settings"))),n(l,15,0,t.ɵnov(l,16).target,t.ɵnov(l,16).href),n(l,20,0,t.ɵunv(l,20,0,n(l,21,0,t.ɵnov(l,0),"myOrganization"))),n(l,23,0,t.ɵnov(l,24).target,t.ɵnov(l,24).href),n(l,28,0,t.ɵunv(l,28,0,n(l,29,0,t.ɵnov(l,0),"billingAndLicensing")))})}function f(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"app-org-settings",[],null,null,null,p,d)),t.ɵdid(1,114688,null,0,a.SettingsComponent,[u.ActivatedRoute,s.UserService],null,null)],function(n,l){n(l,1,0)},null)}l.RenderType_SettingsComponent=d,l.View_SettingsComponent_0=p,l.View_SettingsComponent_Host_0=f;var v=t.ɵccf("app-org-settings",a.SettingsComponent,f,{},{},[]);l.SettingsComponentNgFactory=v},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(){this.groupIds=[]}}();l.OrganizationUserUpdateGroupsRequest=t},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(){this.collections=[]}}();l.OrganizationUserUpdateRequest=t},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(){this.emails=[],this.collections=[]}}();l.OrganizationUserInviteRequest=t},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(){}}();l.OrganizationUserConfirmRequest=t},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=e(0),u=e(60),o=e(130),i=e(116),r=e(42),a=e(5),s=e(7),d=e(2),c=e(249),p=e(13),f=e(242),v=e(4),h=e(10),g=e(8),m=e(3),y=e(9),C=e(20),b=e(21),S=t.ɵcrt({encapsulation:2,styles:[],data:{}});function w(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"span",[["class","badge badge-pill badge-info"]],null,null,null,null,null)),(n()(),t.ɵted(1,null,["",""]))],null,function(n,l){n(l,1,0,l.component.invitedCount)})}function R(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"span",[["class","badge badge-pill badge-warning"]],null,null,null,null,null)),(n()(),t.ɵted(1,null,["",""]))],null,function(n,l){n(l,1,0,l.component.acceptedCount)})}function _(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"i",[["class","fa fa-spinner fa-spin text-muted"]],[[8,"title",0]],null,null,null,null)),t.ɵppd(1,1)],null,function(n,l){n(l,0,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,0,0,n(l,1,0,t.ɵnov(l.parent,0),"loading")),""))})}function I(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,2,"p",[],null,null,null,null,null)),(n()(),t.ɵted(1,null,["",""])),t.ɵppd(2,1)],null,function(n,l){n(l,1,0,t.ɵunv(l,1,0,n(l,2,0,t.ɵnov(l.parent.parent,0),"noUsersInList")))})}function A(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,2,"span",[["class","badge badge-secondary"]],null,null,null,null,null)),(n()(),t.ɵted(1,null,["",""])),t.ɵppd(2,1)],null,function(n,l){n(l,1,0,t.ɵunv(l,1,0,n(l,2,0,t.ɵnov(l.parent.parent.parent.parent,0),"invited")))})}function E(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,2,"span",[["class","badge badge-warning"]],null,null,null,null,null)),(n()(),t.ɵted(1,null,["",""])),t.ɵppd(2,1)],null,function(n,l){n(l,1,0,t.ɵunv(l,1,0,n(l,2,0,t.ɵnov(l.parent.parent.parent.parent,0),"accepted")))})}function O(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"small",[["class","text-muted d-block"]],null,null,null,null,null)),(n()(),t.ɵted(1,null,["",""]))],null,function(n,l){n(l,1,0,l.parent.context.$implicit.name)})}function N(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,2,"span",[],null,null,null,null,null)),(n()(),t.ɵted(1,null,["",""])),t.ɵppd(2,1)],null,function(n,l){n(l,1,0,t.ɵunv(l,1,0,n(l,2,0,t.ɵnov(l.parent.parent.parent.parent,0),"owner")))})}function T(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,2,"span",[],null,null,null,null,null)),(n()(),t.ɵted(1,null,["",""])),t.ɵppd(2,1)],null,function(n,l){n(l,1,0,t.ɵunv(l,1,0,n(l,2,0,t.ɵnov(l.parent.parent.parent.parent,0),"admin")))})}function k(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,2,"span",[],null,null,null,null,null)),(n()(),t.ɵted(1,null,["",""])),t.ɵppd(2,1)],null,function(n,l){n(l,1,0,t.ɵunv(l,1,0,n(l,2,0,t.ɵnov(l.parent.parent.parent.parent,0),"user")))})}function V(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,5,"a",[["appStopClick",""],["class","dropdown-item"],["href","#"]],null,[[null,"click"]],function(n,l,e){var u=!0,o=n.component;"click"===l&&(u=!1!==t.ɵnov(n,1).onClick(e)&&u);"click"===l&&(u=!1!==o.reinvite(n.parent.context.$implicit)&&u);return u},null,null)),t.ɵdid(1,16384,null,0,u.StopClickDirective,[],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(3,0,null,null,0,"i",[["class","fa fa-fw fa-envelope-o"]],null,null,null,null,null)),(n()(),t.ɵted(4,null,["\n ","\n "])),t.ɵppd(5,1)],null,function(n,l){n(l,4,0,t.ɵunv(l,4,0,n(l,5,0,t.ɵnov(l.parent.parent.parent.parent,0),"resendInvitation")))})}function P(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,5,"a",[["appStopClick",""],["class","dropdown-item text-success"],["href","#"]],null,[[null,"click"]],function(n,l,e){var u=!0,o=n.component;"click"===l&&(u=!1!==t.ɵnov(n,1).onClick(e)&&u);"click"===l&&(u=!1!==o.confirm(n.parent.context.$implicit)&&u);return u},null,null)),t.ɵdid(1,16384,null,0,u.StopClickDirective,[],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(3,0,null,null,0,"i",[["class","fa fa-fw fa-check"]],null,null,null,null,null)),(n()(),t.ɵted(4,null,["\n ","\n "])),t.ɵppd(5,1)],null,function(n,l){n(l,4,0,t.ɵunv(l,4,0,n(l,5,0,t.ɵnov(l.parent.parent.parent.parent,0),"confirm")))})}function M(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,5,"a",[["appStopClick",""],["class","dropdown-item"],["href","#"]],null,[[null,"click"]],function(n,l,e){var u=!0,o=n.component;"click"===l&&(u=!1!==t.ɵnov(n,1).onClick(e)&&u);"click"===l&&(u=!1!==o.groups(n.parent.context.$implicit)&&u);return u},null,null)),t.ɵdid(1,16384,null,0,u.StopClickDirective,[],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(3,0,null,null,0,"i",[["class","fa fa-fw fa-sitemap"]],null,null,null,null,null)),(n()(),t.ɵted(4,null,["\n ","\n "])),t.ɵppd(5,1)],null,function(n,l){n(l,4,0,t.ɵunv(l,4,0,n(l,5,0,t.ɵnov(l.parent.parent.parent.parent,0),"groups")))})}function x(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,5,"a",[["appStopClick",""],["class","dropdown-item"],["href","#"]],null,[[null,"click"]],function(n,l,e){var u=!0,o=n.component;"click"===l&&(u=!1!==t.ɵnov(n,1).onClick(e)&&u);"click"===l&&(u=!1!==o.events(n.parent.context.$implicit)&&u);return u},null,null)),t.ɵdid(1,16384,null,0,u.StopClickDirective,[],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(3,0,null,null,0,"i",[["class","fa fa-fw fa-file-text-o"]],null,null,null,null,null)),(n()(),t.ɵted(4,null,["\n ","\n "])),t.ɵppd(5,1)],null,function(n,l){n(l,4,0,t.ɵunv(l,4,0,n(l,5,0,t.ɵnov(l.parent.parent.parent.parent,0),"eventLogs")))})}function D(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,68,"tr",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,4,"td",[["width","30"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(4,0,null,null,1,"app-avatar",[["height","25"],["width","25"]],null,null,null,o.View_AvatarComponent_0,o.RenderType_AvatarComponent)),t.ɵdid(5,638976,null,0,i.AvatarComponent,[r.DomSanitizer],{data:[0,"data"],width:[1,"width"],height:[2,"height"],fontSize:[3,"fontSize"],circle:[4,"circle"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(8,0,null,null,14,"td",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(10,0,null,null,2,"a",[["appStopClick",""],["href","#"]],null,[[null,"click"]],function(n,l,e){var u=!0,o=n.component;"click"===l&&(u=!1!==t.ɵnov(n,11).onClick(e)&&u);"click"===l&&(u=!1!==o.edit(n.context.$implicit)&&u);return u},null,null)),t.ɵdid(11,16384,null,0,u.StopClickDirective,[],null,null),(n()(),t.ɵted(12,null,["",""])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,A)),t.ɵdid(15,16384,null,0,a.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,E)),t.ɵdid(18,16384,null,0,a.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,O)),t.ɵdid(21,16384,null,0,a.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(24,0,null,null,10,"td",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,N)),t.ɵdid(27,16384,null,0,a.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,T)),t.ɵdid(30,16384,null,0,a.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,k)),t.ɵdid(33,16384,null,0,a.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(36,0,null,null,31,"td",[["class","table-list-options"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(38,0,null,null,28,"div",[["appListDropdown",""],["class","dropdown"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(40,0,null,null,3,"button",[["aria-expanded","false"],["aria-haspopup","true"],["class","btn btn-outline-secondary dropdown-toggle"],["data-toggle","dropdown"],["type","button"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(42,0,null,null,0,"i",[["class","fa fa-cog fa-lg"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(45,0,null,null,20,"div",[["class","dropdown-menu dropdown-menu-right"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,V)),t.ɵdid(48,16384,null,0,a.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,P)),t.ɵdid(51,16384,null,0,a.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,M)),t.ɵdid(54,16384,null,0,a.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,x)),t.ɵdid(57,16384,null,0,a.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(59,0,null,null,5,"a",[["appStopClick",""],["class","dropdown-item text-danger"],["href","#"]],null,[[null,"click"]],function(n,l,e){var u=!0,o=n.component;"click"===l&&(u=!1!==t.ɵnov(n,60).onClick(e)&&u);"click"===l&&(u=!1!==o.remove(n.context.$implicit)&&u);return u},null,null)),t.ɵdid(60,16384,null,0,u.StopClickDirective,[],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(62,0,null,null,0,"i",[["class","fa fa-fw fa-remove"]],null,null,null,null,null)),(n()(),t.ɵted(63,null,["\n ","\n "])),t.ɵppd(64,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){var e=l.component;n(l,5,0,l.context.$implicit.name||l.context.$implicit.email,"25","25",14,!0),n(l,15,0,l.context.$implicit.status===e.organizationUserStatusType.Invited),n(l,18,0,l.context.$implicit.status===e.organizationUserStatusType.Accepted),n(l,21,0,l.context.$implicit.name),n(l,27,0,l.context.$implicit.type===e.organizationUserType.Owner),n(l,30,0,l.context.$implicit.type===e.organizationUserType.Admin),n(l,33,0,l.context.$implicit.type===e.organizationUserType.User),n(l,48,0,l.context.$implicit.status===e.organizationUserStatusType.Invited),n(l,51,0,l.context.$implicit.status===e.organizationUserStatusType.Accepted),n(l,54,0,e.accessGroups),n(l,57,0,e.accessEvents&&l.context.$implicit.status===e.organizationUserStatusType.Confirmed)},function(n,l){n(l,12,0,l.context.$implicit.email),n(l,63,0,t.ɵunv(l,63,0,n(l,64,0,t.ɵnov(l.parent.parent.parent,0),"remove")))})}function U(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,7,"table",[["class","table table-hover table-list"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,4,"tbody",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,D)),t.ɵdid(5,802816,null,0,a.NgForOf,[t.ViewContainerRef,t.TemplateRef,t.IterableDiffers],{ngForOf:[0,"ngForOf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){n(l,5,0,l.parent.context.ngIf)},null)}function F(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,7,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,I)),t.ɵdid(3,16384,null,0,a.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,U)),t.ɵdid(6,16384,null,0,a.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){n(l,3,0,!l.context.ngIf.length),n(l,6,0,l.context.ngIf.length)},null)}function L(n){return t.ɵvid(0,[(n()(),t.ɵand(0,null,null,0))],null,null)}function G(n){return t.ɵvid(0,[(n()(),t.ɵand(0,null,null,0))],null,null)}function q(n){return t.ɵvid(0,[(n()(),t.ɵand(0,null,null,0))],null,null)}function z(n){return t.ɵvid(0,[t.ɵpid(0,s.I18nPipe,[d.I18nService]),t.ɵpid(0,c.SearchPipe,[]),t.ɵqud(402653184,1,{addEditModalRef:0}),t.ɵqud(402653184,2,{groupsModalRef:0}),t.ɵqud(402653184,3,{eventsModalRef:0}),(n()(),t.ɵeld(5,0,null,null,56,"div",[["class","page-header d-flex"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(7,0,null,null,2,"h1",[],null,null,null,null,null)),(n()(),t.ɵted(8,null,["",""])),t.ɵppd(9,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(11,0,null,null,49,"div",[["class","ml-auto d-flex"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(13,0,null,null,25,"div",[["class","btn-group btn-group-sm"],["role","group"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(15,0,null,null,4,"button",[["class","btn btn-outline-secondary"],["type","button"]],null,[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.filter(null)&&t);return t},null,null)),t.ɵdid(16,278528,null,0,a.NgClass,[t.IterableDiffers,t.KeyValueDiffers,t.ElementRef,t.Renderer2],{klass:[0,"klass"],ngClass:[1,"ngClass"]},null),t.ɵpod(17,{active:0}),(n()(),t.ɵted(18,null,["\n ","\n "])),t.ɵppd(19,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(21,0,null,null,7,"button",[["class","btn btn-outline-secondary"],["type","button"]],null,[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.filter(u.organizationUserStatusType.Invited)&&t);return t},null,null)),t.ɵdid(22,278528,null,0,a.NgClass,[t.IterableDiffers,t.KeyValueDiffers,t.ElementRef,t.Renderer2],{klass:[0,"klass"],ngClass:[1,"ngClass"]},null),t.ɵpod(23,{active:0}),(n()(),t.ɵted(24,null,["\n ","\n "])),t.ɵppd(25,1),(n()(),t.ɵand(16777216,null,null,1,null,w)),t.ɵdid(27,16384,null,0,a.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(30,0,null,null,7,"button",[["class","btn btn-outline-secondary"],["type","button"]],null,[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.filter(u.organizationUserStatusType.Accepted)&&t);return t},null,null)),t.ɵdid(31,278528,null,0,a.NgClass,[t.IterableDiffers,t.KeyValueDiffers,t.ElementRef,t.Renderer2],{klass:[0,"klass"],ngClass:[1,"ngClass"]},null),t.ɵpod(32,{active:0}),(n()(),t.ɵted(33,null,["\n ","\n "])),t.ɵppd(34,1),(n()(),t.ɵand(16777216,null,null,1,null,R)),t.ɵdid(36,16384,null,0,a.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(40,0,null,null,13,"div",[["class","ml-3"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(42,0,null,null,2,"label",[["class","sr-only"],["for","search"]],null,null,null,null,null)),(n()(),t.ɵted(43,null,["",""])),t.ɵppd(44,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(46,0,null,null,6,"input",[["class","form-control form-control-sm"],["id","search"],["type","search"]],[[8,"placeholder",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(n,l,e){var u=!0,o=n.component;"input"===l&&(u=!1!==t.ɵnov(n,47)._handleInput(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,47).onTouched()&&u);"compositionstart"===l&&(u=!1!==t.ɵnov(n,47)._compositionStart()&&u);"compositionend"===l&&(u=!1!==t.ɵnov(n,47)._compositionEnd(e.target.value)&&u);"ngModelChange"===l&&(u=!1!==(o.searchText=e)&&u);return u},null,null)),t.ɵdid(47,16384,null,0,p.DefaultValueAccessor,[t.Renderer2,t.ElementRef,[2,p.COMPOSITION_BUFFER_MODE]],null,null),t.ɵprd(1024,null,p.NG_VALUE_ACCESSOR,function(n){return[n]},[p.DefaultValueAccessor]),t.ɵdid(49,671744,null,0,p.NgModel,[[8,null],[8,null],[8,null],[2,p.NG_VALUE_ACCESSOR]],{model:[0,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,p.NgControl,null,[p.NgModel]),t.ɵdid(51,16384,null,0,p.NgControlStatus,[p.NgControl],null,null),t.ɵppd(52,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(55,0,null,null,4,"button",[["class","btn btn-sm btn-outline-primary ml-3"],["type","button"]],null,[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.invite()&&t);return t},null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(57,0,null,null,0,"i",[["class","fa fa-plus fa-fw"]],null,null,null,null,null)),(n()(),t.ɵted(58,null,["\n ","\n "])),t.ɵppd(59,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,null,null,1,null,_)),t.ɵdid(64,16384,null,0,a.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,null,null,2,null,F)),t.ɵdid(67,16384,null,0,a.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),t.ɵppd(68,5),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,[[1,3],["addEdit",2]],null,0,null,L)),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,[[2,3],["groupsTemplate",2]],null,0,null,G)),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,[[3,3],["eventsTemplate",2]],null,0,null,q)),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){var e=l.component;n(l,16,0,"btn btn-outline-secondary",n(l,17,0,null==e.status));n(l,22,0,"btn btn-outline-secondary",n(l,23,0,e.status==e.organizationUserStatusType.Invited)),n(l,27,0,e.invitedCount);n(l,31,0,"btn btn-outline-secondary",n(l,32,0,e.status==e.organizationUserStatusType.Accepted)),n(l,36,0,e.acceptedCount),n(l,49,0,e.searchText),n(l,64,0,e.loading),n(l,67,0,!e.loading&&t.ɵunv(l,67,0,n(l,68,0,t.ɵnov(l,1),e.users,e.searchText,"name","email","id")))},function(n,l){n(l,8,0,t.ɵunv(l,8,0,n(l,9,0,t.ɵnov(l,0),"people"))),n(l,18,0,t.ɵunv(l,18,0,n(l,19,0,t.ɵnov(l,0),"all"))),n(l,24,0,t.ɵunv(l,24,0,n(l,25,0,t.ɵnov(l,0),"invited"))),n(l,33,0,t.ɵunv(l,33,0,n(l,34,0,t.ɵnov(l,0),"accepted"))),n(l,43,0,t.ɵunv(l,43,0,n(l,44,0,t.ɵnov(l,0),"search"))),n(l,46,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,46,0,n(l,52,0,t.ɵnov(l,0),"search")),""),t.ɵnov(l,51).ngClassUntouched,t.ɵnov(l,51).ngClassTouched,t.ɵnov(l,51).ngClassPristine,t.ɵnov(l,51).ngClassDirty,t.ɵnov(l,51).ngClassValid,t.ɵnov(l,51).ngClassInvalid,t.ɵnov(l,51).ngClassPending),n(l,58,0,t.ɵunv(l,58,0,n(l,59,0,t.ɵnov(l,0),"inviteUser")))})}function j(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"app-org-people",[],null,null,null,z,S)),t.ɵdid(1,114688,null,0,f.PeopleComponent,[v.ApiService,h.ActivatedRoute,d.I18nService,t.ComponentFactoryResolver,g.PlatformUtilsService,m.Angulartics2,y.ToasterService,C.CryptoService,b.UserService],null,null)],function(n,l){n(l,1,0)},null)}l.RenderType_PeopleComponent=S,l.View_PeopleComponent_0=z,l.View_PeopleComponent_Host_0=j;var B=t.ɵccf("app-org-people",f.PeopleComponent,j,{},{},[]);l.PeopleComponentNgFactory=B},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(){this.collections=[]}}();l.GroupRequest=t},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=e(0),u=e(60),o=e(5),i=e(7),r=e(2),a=e(249),s=e(13),d=e(243),c=e(4),p=e(10),f=e(3),v=e(9),h=e(8),g=e(21),m=t.ɵcrt({encapsulation:2,styles:[],data:{}});function y(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"i",[["class","fa fa-spinner fa-spin text-muted"]],[[8,"title",0]],null,null,null,null)),t.ɵppd(1,1)],null,function(n,l){n(l,0,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,0,0,n(l,1,0,t.ɵnov(l.parent,0),"loading")),""))})}function C(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,2,"p",[],null,null,null,null,null)),(n()(),t.ɵted(1,null,["",""])),t.ɵppd(2,1)],null,function(n,l){n(l,1,0,t.ɵunv(l,1,0,n(l,2,0,t.ɵnov(l.parent.parent,0),"noGroupsInList")))})}function b(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,36,"tr",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,5,"td",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(4,0,null,null,2,"a",[["appStopClick",""],["href","#"]],null,[[null,"click"]],function(n,l,e){var u=!0,o=n.component;"click"===l&&(u=!1!==t.ɵnov(n,5).onClick(e)&&u);"click"===l&&(u=!1!==o.edit(n.context.$implicit)&&u);return u},null,null)),t.ɵdid(5,16384,null,0,u.StopClickDirective,[],null,null),(n()(),t.ɵted(6,null,["",""])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(9,0,null,null,26,"td",[["class","table-list-options"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(11,0,null,null,23,"div",[["appListDropdown",""],["class","dropdown"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(13,0,null,null,3,"button",[["aria-expanded","false"],["aria-haspopup","true"],["class","btn btn-outline-secondary dropdown-toggle"],["data-toggle","dropdown"],["type","button"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(15,0,null,null,0,"i",[["class","fa fa-cog fa-lg"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(18,0,null,null,15,"div",[["class","dropdown-menu dropdown-menu-right"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(20,0,null,null,5,"a",[["appStopClick",""],["class","dropdown-item"],["href","#"]],null,[[null,"click"]],function(n,l,e){var u=!0,o=n.component;"click"===l&&(u=!1!==t.ɵnov(n,21).onClick(e)&&u);"click"===l&&(u=!1!==o.users(n.context.$implicit)&&u);return u},null,null)),t.ɵdid(21,16384,null,0,u.StopClickDirective,[],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(23,0,null,null,0,"i",[["class","fa fa-fw fa-users"]],null,null,null,null,null)),(n()(),t.ɵted(24,null,["\n ","\n "])),t.ɵppd(25,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(27,0,null,null,5,"a",[["appStopClick",""],["class","dropdown-item text-danger"],["href","#"]],null,[[null,"click"]],function(n,l,e){var u=!0,o=n.component;"click"===l&&(u=!1!==t.ɵnov(n,28).onClick(e)&&u);"click"===l&&(u=!1!==o.delete(n.context.$implicit)&&u);return u},null,null)),t.ɵdid(28,16384,null,0,u.StopClickDirective,[],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(30,0,null,null,0,"i",[["class","fa fa-fw fa-trash-o"]],null,null,null,null,null)),(n()(),t.ɵted(31,null,["\n ","\n "])),t.ɵppd(32,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "]))],null,function(n,l){n(l,6,0,l.context.$implicit.name),n(l,24,0,t.ɵunv(l,24,0,n(l,25,0,t.ɵnov(l.parent.parent.parent,0),"users"))),n(l,31,0,t.ɵunv(l,31,0,n(l,32,0,t.ɵnov(l.parent.parent.parent,0),"delete")))})}function S(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,7,"table",[["class","table table-hover table-list"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,4,"tbody",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,b)),t.ɵdid(5,802816,null,0,o.NgForOf,[t.ViewContainerRef,t.TemplateRef,t.IterableDiffers],{ngForOf:[0,"ngForOf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){n(l,5,0,l.parent.context.ngIf)},null)}function w(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,7,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,C)),t.ɵdid(3,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,S)),t.ɵdid(6,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){n(l,3,0,!l.context.ngIf.length),n(l,6,0,l.context.ngIf.length)},null)}function R(n){return t.ɵvid(0,[(n()(),t.ɵand(0,null,null,0))],null,null)}function _(n){return t.ɵvid(0,[(n()(),t.ɵand(0,null,null,0))],null,null)}function I(n){return t.ɵvid(0,[t.ɵpid(0,i.I18nPipe,[r.I18nService]),t.ɵpid(0,a.SearchPipe,[]),t.ɵqud(402653184,1,{addEditModalRef:0}),t.ɵqud(402653184,2,{usersModalRef:0}),(n()(),t.ɵeld(4,0,null,null,29,"div",[["class","page-header d-flex"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(6,0,null,null,2,"h1",[],null,null,null,null,null)),(n()(),t.ɵted(7,null,["",""])),t.ɵppd(8,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(10,0,null,null,22,"div",[["class","ml-auto d-flex"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(12,0,null,null,13,"div",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(14,0,null,null,2,"label",[["class","sr-only"],["for","search"]],null,null,null,null,null)),(n()(),t.ɵted(15,null,["",""])),t.ɵppd(16,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(18,0,null,null,6,"input",[["class","form-control form-control-sm"],["id","search"],["type","search"]],[[8,"placeholder",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(n,l,e){var u=!0,o=n.component;"input"===l&&(u=!1!==t.ɵnov(n,19)._handleInput(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,19).onTouched()&&u);"compositionstart"===l&&(u=!1!==t.ɵnov(n,19)._compositionStart()&&u);"compositionend"===l&&(u=!1!==t.ɵnov(n,19)._compositionEnd(e.target.value)&&u);"ngModelChange"===l&&(u=!1!==(o.searchText=e)&&u);return u},null,null)),t.ɵdid(19,16384,null,0,s.DefaultValueAccessor,[t.Renderer2,t.ElementRef,[2,s.COMPOSITION_BUFFER_MODE]],null,null),t.ɵprd(1024,null,s.NG_VALUE_ACCESSOR,function(n){return[n]},[s.DefaultValueAccessor]),t.ɵdid(21,671744,null,0,s.NgModel,[[8,null],[8,null],[8,null],[2,s.NG_VALUE_ACCESSOR]],{model:[0,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,s.NgControl,null,[s.NgModel]),t.ɵdid(23,16384,null,0,s.NgControlStatus,[s.NgControl],null,null),t.ɵppd(24,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(27,0,null,null,4,"button",[["class","btn btn-sm btn-outline-primary ml-3"],["type","button"]],null,[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.add()&&t);return t},null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(29,0,null,null,0,"i",[["class","fa fa-plus fa-fw"]],null,null,null,null,null)),(n()(),t.ɵted(30,null,["\n ","\n "])),t.ɵppd(31,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,null,null,1,null,y)),t.ɵdid(36,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,null,null,2,null,w)),t.ɵdid(39,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),t.ɵppd(40,4),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,[[1,3],["addEdit",2]],null,0,null,R)),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,[[2,3],["usersTemplate",2]],null,0,null,_)),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){var e=l.component;n(l,21,0,e.searchText),n(l,36,0,e.loading),n(l,39,0,!e.loading&&t.ɵunv(l,39,0,n(l,40,0,t.ɵnov(l,1),e.groups,e.searchText,"name","id")))},function(n,l){n(l,7,0,t.ɵunv(l,7,0,n(l,8,0,t.ɵnov(l,0),"groups"))),n(l,15,0,t.ɵunv(l,15,0,n(l,16,0,t.ɵnov(l,0),"search"))),n(l,18,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,18,0,n(l,24,0,t.ɵnov(l,0),"search")),""),t.ɵnov(l,23).ngClassUntouched,t.ɵnov(l,23).ngClassTouched,t.ɵnov(l,23).ngClassPristine,t.ɵnov(l,23).ngClassDirty,t.ɵnov(l,23).ngClassValid,t.ɵnov(l,23).ngClassInvalid,t.ɵnov(l,23).ngClassPending),n(l,30,0,t.ɵunv(l,30,0,n(l,31,0,t.ɵnov(l,0),"newGroup")))})}function A(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"app-org-groups",[],null,null,null,I,m)),t.ɵdid(1,114688,null,0,d.GroupsComponent,[c.ApiService,p.ActivatedRoute,r.I18nService,t.ComponentFactoryResolver,f.Angulartics2,v.ToasterService,h.PlatformUtilsService,g.UserService,p.Router],null,null)],function(n,l){n(l,1,0)},null)}l.RenderType_GroupsComponent=m,l.View_GroupsComponent_0=I,l.View_GroupsComponent_Host_0=A;var E=t.ɵccf("app-org-groups",d.GroupsComponent,A,{},{},[]);l.GroupsComponentNgFactory=E},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=e(0),u=e(5),o=e(18),i=e(17),r=e(7),a=e(2),s=e(13),d=e(244),c=e(4),p=e(10),f=e(175),v=e(9),h=e(21),g=t.ɵcrt({encapsulation:2,styles:[],data:{}});function m(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"i",[["class","fa fa-spinner fa-spin text-muted"]],[[8,"title",0]],null,null,null,null)),t.ɵppd(1,1)],null,function(n,l){n(l,0,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,0,0,n(l,1,0,t.ɵnov(l.parent,0),"loading")),""))})}function y(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,2,"p",[],null,null,null,null,null)),(n()(),t.ɵted(1,null,["",""])),t.ɵppd(2,1)],null,function(n,l){n(l,1,0,t.ɵunv(l,1,0,n(l,2,0,t.ɵnov(l.parent.parent,0),"noEventsInList")))})}function C(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,18,"tr",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,2,"td",[],null,null,null,null,null)),(n()(),t.ɵted(3,null,["",""])),t.ɵppd(4,2),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(6,0,null,null,3,"td",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(8,0,null,null,0,"i",[],[[8,"className",0],[8,"title",0]],null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(11,0,null,null,4,"td",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(13,0,null,null,1,"span",[],[[8,"title",0]],null,null,null,null)),(n()(),t.ɵted(14,null,["",""])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(17,0,null,null,0,"td",[],[[8,"innerHTML",1]],null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "]))],null,function(n,l){n(l,3,0,t.ɵunv(l,3,0,n(l,4,0,t.ɵnov(l.parent.parent.parent,1),l.context.$implicit.date,"medium"))),n(l,8,0,t.ɵinlineInterpolate(1,"text-muted fa fa-lg ",l.context.$implicit.appIcon,""),t.ɵinlineInterpolate(2,"",l.context.$implicit.appName,", ",l.context.$implicit.ip,"")),n(l,13,0,t.ɵinlineInterpolate(1,"",l.context.$implicit.userEmail,"")),n(l,14,0,l.context.$implicit.userName),n(l,17,0,l.context.$implicit.message)})}function b(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,32,"table",[["class","table table-hover"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,23,"thead",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(4,0,null,null,20,"tr",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(6,0,null,null,2,"th",[["class","border-top-0"],["width","210"]],null,null,null,null,null)),(n()(),t.ɵted(7,null,["",""])),t.ɵppd(8,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(10,0,null,null,5,"th",[["class","border-top-0"],["width","40"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(12,0,null,null,2,"span",[["class","sr-only"]],null,null,null,null,null)),(n()(),t.ɵted(13,null,["",""])),t.ɵppd(14,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(17,0,null,null,2,"th",[["class","border-top-0"],["width","150"]],null,null,null,null,null)),(n()(),t.ɵted(18,null,["",""])),t.ɵppd(19,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(21,0,null,null,2,"th",[["class","border-top-0"]],null,null,null,null,null)),(n()(),t.ɵted(22,null,["",""])),t.ɵppd(23,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(27,0,null,null,4,"tbody",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,C)),t.ɵdid(30,802816,null,0,u.NgForOf,[t.ViewContainerRef,t.TemplateRef,t.IterableDiffers],{ngForOf:[0,"ngForOf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){n(l,30,0,l.component.events)},function(n,l){n(l,7,0,t.ɵunv(l,7,0,n(l,8,0,t.ɵnov(l.parent.parent,0),"timestamp"))),n(l,13,0,t.ɵunv(l,13,0,n(l,14,0,t.ɵnov(l.parent.parent,0),"device"))),n(l,18,0,t.ɵunv(l,18,0,n(l,19,0,t.ɵnov(l.parent.parent,0),"user"))),n(l,22,0,t.ɵunv(l,22,0,n(l,23,0,t.ɵnov(l.parent.parent,0),"event")))})}function S(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,[["moreBtn",1]],null,9,"button",[["class","btn btn-block btn-link btn-submit"],["type","button"]],[[8,"disabled",0]],[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.loadEvents(!1)&&t);return t},null,null)),t.ɵdid(1,540672,null,0,o.ApiActionDirective,[t.ElementRef,i.ValidationService],{appApiAction:[0,"appApiAction"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(3,0,null,null,1,"i",[["class","fa fa-spinner fa-spin"]],[[8,"title",0]],null,null,null,null)),t.ɵppd(4,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(6,0,null,null,2,"span",[],null,null,null,null,null)),(n()(),t.ɵted(7,null,["",""])),t.ɵppd(8,1),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){n(l,1,0,l.component.morePromise)},function(n,l){n(l,0,0,l.component.loaded&&t.ɵnov(l,0).loading),n(l,3,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,3,0,n(l,4,0,t.ɵnov(l.parent.parent,0),"loading")),"")),n(l,7,0,t.ɵunv(l,7,0,n(l,8,0,t.ɵnov(l.parent.parent,0),"loadMore")))})}function w(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,10,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,y)),t.ɵdid(3,16384,null,0,u.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,b)),t.ɵdid(6,16384,null,0,u.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,S)),t.ɵdid(9,16384,null,0,u.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){var e=l.component;n(l,3,0,!e.events||!e.events.length),n(l,6,0,e.events&&e.events.length),n(l,9,0,e.continuationToken)},null)}function R(n){return t.ɵvid(0,[t.ɵpid(0,r.I18nPipe,[a.I18nService]),t.ɵpid(0,u.DatePipe,[t.LOCALE_ID]),(n()(),t.ɵeld(2,0,null,null,47,"div",[["class","page-header d-flex"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(4,0,null,null,2,"h1",[],null,null,null,null,null)),(n()(),t.ɵted(5,null,["",""])),t.ɵppd(6,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(8,0,null,null,40,"div",[["class","ml-auto d-flex"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(10,0,null,null,28,"div",[["class","form-inline"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(12,0,null,null,2,"label",[["class","sr-only"],["for","start"]],null,null,null,null,null)),(n()(),t.ɵted(13,null,["",""])),t.ɵppd(14,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(16,0,null,null,6,"input",[["class","form-control form-control-sm"],["id","start"],["placeholder","YYYY-MM-DDTHH:MM"],["type","datetime-local"]],[[8,"placeholder",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(n,l,e){var u=!0,o=n.component;"input"===l&&(u=!1!==t.ɵnov(n,17)._handleInput(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,17).onTouched()&&u);"compositionstart"===l&&(u=!1!==t.ɵnov(n,17)._compositionStart()&&u);"compositionend"===l&&(u=!1!==t.ɵnov(n,17)._compositionEnd(e.target.value)&&u);"ngModelChange"===l&&(u=!1!==(o.start=e)&&u);return u},null,null)),t.ɵdid(17,16384,null,0,s.DefaultValueAccessor,[t.Renderer2,t.ElementRef,[2,s.COMPOSITION_BUFFER_MODE]],null,null),t.ɵprd(1024,null,s.NG_VALUE_ACCESSOR,function(n){return[n]},[s.DefaultValueAccessor]),t.ɵdid(19,671744,null,0,s.NgModel,[[8,null],[8,null],[8,null],[2,s.NG_VALUE_ACCESSOR]],{model:[0,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,s.NgControl,null,[s.NgModel]),t.ɵdid(21,16384,null,0,s.NgControlStatus,[s.NgControl],null,null),t.ɵppd(22,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(24,0,null,null,1,"span",[["class","mx-2"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["-"])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(27,0,null,null,2,"label",[["class","sr-only"],["for","end"]],null,null,null,null,null)),(n()(),t.ɵted(28,null,["",""])),t.ɵppd(29,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(31,0,null,null,6,"input",[["class","form-control form-control-sm"],["id","end"],["placeholder","YYYY-MM-DDTHH:MM"],["type","datetime-local"]],[[8,"placeholder",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(n,l,e){var u=!0,o=n.component;"input"===l&&(u=!1!==t.ɵnov(n,32)._handleInput(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,32).onTouched()&&u);"compositionstart"===l&&(u=!1!==t.ɵnov(n,32)._compositionStart()&&u);"compositionend"===l&&(u=!1!==t.ɵnov(n,32)._compositionEnd(e.target.value)&&u);"ngModelChange"===l&&(u=!1!==(o.end=e)&&u);return u},null,null)),t.ɵdid(32,16384,null,0,s.DefaultValueAccessor,[t.Renderer2,t.ElementRef,[2,s.COMPOSITION_BUFFER_MODE]],null,null),t.ɵprd(1024,null,s.NG_VALUE_ACCESSOR,function(n){return[n]},[s.DefaultValueAccessor]),t.ɵdid(34,671744,null,0,s.NgModel,[[8,null],[8,null],[8,null],[2,s.NG_VALUE_ACCESSOR]],{model:[0,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,s.NgControl,null,[s.NgModel]),t.ɵdid(36,16384,null,0,s.NgControlStatus,[s.NgControl],null,null),t.ɵppd(37,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(40,0,[["refreshBtn",1]],null,7,"button",[["class","btn btn-sm btn-outline-primary ml-3"],["type","button"]],[[8,"disabled",0]],[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.loadEvents(!0)&&t);return t},null,null)),t.ɵdid(41,540672,null,0,o.ApiActionDirective,[t.ElementRef,i.ValidationService],{appApiAction:[0,"appApiAction"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(43,0,null,null,2,"i",[["class","fa fa-refresh fa-fw"]],null,null,null,null,null)),t.ɵdid(44,278528,null,0,u.NgClass,[t.IterableDiffers,t.KeyValueDiffers,t.ElementRef,t.Renderer2],{klass:[0,"klass"],ngClass:[1,"ngClass"]},null),t.ɵpod(45,{"fa-spin":0}),(n()(),t.ɵted(46,null,["\n ","\n "])),t.ɵppd(47,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,null,null,1,null,m)),t.ɵdid(52,16384,null,0,u.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,null,null,1,null,w)),t.ɵdid(55,16384,null,0,u.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){var e=l.component;n(l,19,0,e.start),n(l,34,0,e.end),n(l,41,0,e.refreshPromise);n(l,44,0,"fa fa-refresh fa-fw",n(l,45,0,e.loaded&&t.ɵnov(l,40).loading)),n(l,52,0,!e.loaded),n(l,55,0,e.loaded)},function(n,l){var e=l.component;n(l,5,0,t.ɵunv(l,5,0,n(l,6,0,t.ɵnov(l,0),"eventLogs"))),n(l,13,0,t.ɵunv(l,13,0,n(l,14,0,t.ɵnov(l,0),"startDate"))),n(l,16,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,16,0,n(l,22,0,t.ɵnov(l,0),"startDate")),""),t.ɵnov(l,21).ngClassUntouched,t.ɵnov(l,21).ngClassTouched,t.ɵnov(l,21).ngClassPristine,t.ɵnov(l,21).ngClassDirty,t.ɵnov(l,21).ngClassValid,t.ɵnov(l,21).ngClassInvalid,t.ɵnov(l,21).ngClassPending),n(l,28,0,t.ɵunv(l,28,0,n(l,29,0,t.ɵnov(l,0),"endDate"))),n(l,31,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,31,0,n(l,37,0,t.ɵnov(l,0),"endDate")),""),t.ɵnov(l,36).ngClassUntouched,t.ɵnov(l,36).ngClassTouched,t.ɵnov(l,36).ngClassPristine,t.ɵnov(l,36).ngClassDirty,t.ɵnov(l,36).ngClassValid,t.ɵnov(l,36).ngClassInvalid,t.ɵnov(l,36).ngClassPending),n(l,40,0,e.loaded&&t.ɵnov(l,40).loading),n(l,46,0,t.ɵunv(l,46,0,n(l,47,0,t.ɵnov(l,0),"refresh")))})}function _(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"app-org-events",[],null,null,null,R,g)),t.ɵdid(1,114688,null,0,d.EventsComponent,[c.ApiService,p.ActivatedRoute,f.EventService,a.I18nService,v.ToasterService,h.UserService,p.Router],null,null)],function(n,l){n(l,1,0)},null)}l.RenderType_EventsComponent=g,l.View_EventsComponent_0=R,l.View_EventsComponent_Host_0=_;var I=t.ɵccf("app-org-events",d.EventsComponent,_,{},{},[]);l.EventsComponentNgFactory=I},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=e(0),u=e(60),o=e(5),i=e(7),r=e(2),a=e(249),s=e(13),d=e(248),c=e(4),p=e(10),f=e(44),v=e(3),h=e(9),g=e(8),m=t.ɵcrt({encapsulation:2,styles:[],data:{}});function y(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,0,"i",[["class","fa fa-spinner fa-spin text-muted"]],null,null,null,null,null))],null,null)}function C(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,2,"p",[],null,null,null,null,null)),(n()(),t.ɵted(1,null,["",""])),t.ɵppd(2,1)],null,function(n,l){n(l,1,0,t.ɵunv(l,1,0,n(l,2,0,t.ɵnov(l.parent.parent,0),"noCollectionsInList")))})}function b(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,36,"tr",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,5,"td",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(4,0,null,null,2,"a",[["appStopClick",""],["href","#"]],null,[[null,"click"]],function(n,l,e){var u=!0,o=n.component;"click"===l&&(u=!1!==t.ɵnov(n,5).onClick(e)&&u);"click"===l&&(u=!1!==o.edit(n.context.$implicit)&&u);return u},null,null)),t.ɵdid(5,16384,null,0,u.StopClickDirective,[],null,null),(n()(),t.ɵted(6,null,["",""])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(9,0,null,null,26,"td",[["class","table-list-options"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(11,0,null,null,23,"div",[["appListDropdown",""],["class","dropdown"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(13,0,null,null,3,"button",[["aria-expanded","false"],["aria-haspopup","true"],["class","btn btn-outline-secondary dropdown-toggle"],["data-toggle","dropdown"],["type","button"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(15,0,null,null,0,"i",[["class","fa fa-cog fa-lg"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(18,0,null,null,15,"div",[["class","dropdown-menu dropdown-menu-right"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(20,0,null,null,5,"a",[["appStopClick",""],["class","dropdown-item"],["href","#"]],null,[[null,"click"]],function(n,l,e){var u=!0,o=n.component;"click"===l&&(u=!1!==t.ɵnov(n,21).onClick(e)&&u);"click"===l&&(u=!1!==o.users(n.context.$implicit)&&u);return u},null,null)),t.ɵdid(21,16384,null,0,u.StopClickDirective,[],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(23,0,null,null,0,"i",[["class","fa fa-fw fa-users"]],null,null,null,null,null)),(n()(),t.ɵted(24,null,["\n ","\n "])),t.ɵppd(25,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(27,0,null,null,5,"a",[["appStopClick",""],["class","dropdown-item text-danger"],["href","#"]],null,[[null,"click"]],function(n,l,e){var u=!0,o=n.component;"click"===l&&(u=!1!==t.ɵnov(n,28).onClick(e)&&u);"click"===l&&(u=!1!==o.delete(n.context.$implicit)&&u);return u},null,null)),t.ɵdid(28,16384,null,0,u.StopClickDirective,[],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(30,0,null,null,0,"i",[["class","fa fa-fw fa-trash-o"]],null,null,null,null,null)),(n()(),t.ɵted(31,null,["\n ","\n "])),t.ɵppd(32,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "]))],null,function(n,l){n(l,6,0,l.context.$implicit.name),n(l,24,0,t.ɵunv(l,24,0,n(l,25,0,t.ɵnov(l.parent.parent.parent,0),"users"))),n(l,31,0,t.ɵunv(l,31,0,n(l,32,0,t.ɵnov(l.parent.parent.parent,0),"delete")))})}function S(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,7,"table",[["class","table table-hover table-list"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,4,"tbody",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,b)),t.ɵdid(5,802816,null,0,o.NgForOf,[t.ViewContainerRef,t.TemplateRef,t.IterableDiffers],{ngForOf:[0,"ngForOf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){n(l,5,0,l.parent.context.ngIf)},null)}function w(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,7,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,C)),t.ɵdid(3,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,S)),t.ɵdid(6,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){n(l,3,0,!l.context.ngIf.length),n(l,6,0,l.context.ngIf.length)},null)}function R(n){return t.ɵvid(0,[(n()(),t.ɵand(0,null,null,0))],null,null)}function _(n){return t.ɵvid(0,[(n()(),t.ɵand(0,null,null,0))],null,null)}function I(n){return t.ɵvid(0,[t.ɵpid(0,i.I18nPipe,[r.I18nService]),t.ɵpid(0,a.SearchPipe,[]),t.ɵqud(402653184,1,{addEditModalRef:0}),t.ɵqud(402653184,2,{usersModalRef:0}),(n()(),t.ɵeld(4,0,null,null,29,"div",[["class","page-header d-flex"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(6,0,null,null,2,"h1",[],null,null,null,null,null)),(n()(),t.ɵted(7,null,["",""])),t.ɵppd(8,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(10,0,null,null,22,"div",[["class","ml-auto d-flex"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(12,0,null,null,13,"div",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(14,0,null,null,2,"label",[["class","sr-only"],["for","search"]],null,null,null,null,null)),(n()(),t.ɵted(15,null,["",""])),t.ɵppd(16,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(18,0,null,null,6,"input",[["class","form-control form-control-sm"],["id","search"],["type","search"]],[[8,"placeholder",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(n,l,e){var u=!0,o=n.component;"input"===l&&(u=!1!==t.ɵnov(n,19)._handleInput(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,19).onTouched()&&u);"compositionstart"===l&&(u=!1!==t.ɵnov(n,19)._compositionStart()&&u);"compositionend"===l&&(u=!1!==t.ɵnov(n,19)._compositionEnd(e.target.value)&&u);"ngModelChange"===l&&(u=!1!==(o.searchText=e)&&u);return u},null,null)),t.ɵdid(19,16384,null,0,s.DefaultValueAccessor,[t.Renderer2,t.ElementRef,[2,s.COMPOSITION_BUFFER_MODE]],null,null),t.ɵprd(1024,null,s.NG_VALUE_ACCESSOR,function(n){return[n]},[s.DefaultValueAccessor]),t.ɵdid(21,671744,null,0,s.NgModel,[[8,null],[8,null],[8,null],[2,s.NG_VALUE_ACCESSOR]],{model:[0,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,s.NgControl,null,[s.NgModel]),t.ɵdid(23,16384,null,0,s.NgControlStatus,[s.NgControl],null,null),t.ɵppd(24,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(27,0,null,null,4,"button",[["class","btn btn-sm btn-outline-primary ml-3"],["type","button"]],null,[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.add()&&t);return t},null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(29,0,null,null,0,"i",[["class","fa fa-plus fa-fw"]],null,null,null,null,null)),(n()(),t.ɵted(30,null,["\n ","\n "])),t.ɵppd(31,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,null,null,1,null,y)),t.ɵdid(36,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,null,null,2,null,w)),t.ɵdid(39,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),t.ɵppd(40,4),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,[[1,3],["addEdit",2]],null,0,null,R)),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,[[2,3],["usersTemplate",2]],null,0,null,_)),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){var e=l.component;n(l,21,0,e.searchText),n(l,36,0,e.loading),n(l,39,0,!e.loading&&t.ɵunv(l,39,0,n(l,40,0,t.ɵnov(l,1),e.collections,e.searchText,"name","id")))},function(n,l){n(l,7,0,t.ɵunv(l,7,0,n(l,8,0,t.ɵnov(l,0),"collections"))),n(l,15,0,t.ɵunv(l,15,0,n(l,16,0,t.ɵnov(l,0),"search"))),n(l,18,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,18,0,n(l,24,0,t.ɵnov(l,0),"search")),""),t.ɵnov(l,23).ngClassUntouched,t.ɵnov(l,23).ngClassTouched,t.ɵnov(l,23).ngClassPristine,t.ɵnov(l,23).ngClassDirty,t.ɵnov(l,23).ngClassValid,t.ɵnov(l,23).ngClassInvalid,t.ɵnov(l,23).ngClassPending),n(l,30,0,t.ɵunv(l,30,0,n(l,31,0,t.ɵnov(l,0),"newCollection")))})}function A(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"app-org-manage-collections",[],null,null,null,I,m)),t.ɵdid(1,114688,null,0,d.CollectionsComponent,[c.ApiService,p.ActivatedRoute,f.CollectionService,t.ComponentFactoryResolver,v.Angulartics2,h.ToasterService,r.I18nService,g.PlatformUtilsService],null,null)],function(n,l){n(l,1,0)},null)}l.RenderType_CollectionsComponent=m,l.View_CollectionsComponent_0=I,l.View_CollectionsComponent_Host_0=A;var E=t.ɵccf("app-org-manage-collections",d.CollectionsComponent,A,{},{},[]);l.CollectionsComponentNgFactory=E},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=e(0),u=e(10),o=e(5),i=e(7),r=e(2),a=e(250),s=e(21),d=t.ɵcrt({encapsulation:2,styles:[],data:{}});function c(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,6,"a",[["class","list-group-item"],["routerLink","groups"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(n,l,e){var u=!0;"click"===l&&(u=!1!==t.ɵnov(n,1).onClick(e.button,e.ctrlKey,e.metaKey,e.shiftKey)&&u);return u},null,null)),t.ɵdid(1,671744,[[6,4]],0,u.RouterLinkWithHref,[u.Router,u.ActivatedRoute,o.LocationStrategy],{routerLink:[0,"routerLink"]},null),t.ɵdid(2,1720320,null,2,u.RouterLinkActive,[u.Router,t.ElementRef,t.Renderer2,t.ChangeDetectorRef],{routerLinkActive:[0,"routerLinkActive"]},null),t.ɵqud(603979776,5,{links:1}),t.ɵqud(603979776,6,{linksWithHrefs:1}),(n()(),t.ɵted(5,null,["\n ","\n "])),t.ɵppd(6,1)],function(n,l){n(l,1,0,"groups");n(l,2,0,"active")},function(n,l){n(l,0,0,t.ɵnov(l,1).target,t.ɵnov(l,1).href),n(l,5,0,t.ɵunv(l,5,0,n(l,6,0,t.ɵnov(l.parent,0),"groups")))})}function p(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,6,"a",[["class","list-group-item"],["routerLink","events"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(n,l,e){var u=!0;"click"===l&&(u=!1!==t.ɵnov(n,1).onClick(e.button,e.ctrlKey,e.metaKey,e.shiftKey)&&u);return u},null,null)),t.ɵdid(1,671744,[[8,4]],0,u.RouterLinkWithHref,[u.Router,u.ActivatedRoute,o.LocationStrategy],{routerLink:[0,"routerLink"]},null),t.ɵdid(2,1720320,null,2,u.RouterLinkActive,[u.Router,t.ElementRef,t.Renderer2,t.ChangeDetectorRef],{routerLinkActive:[0,"routerLinkActive"]},null),t.ɵqud(603979776,7,{links:1}),t.ɵqud(603979776,8,{linksWithHrefs:1}),(n()(),t.ɵted(5,null,["\n ","\n "])),t.ɵppd(6,1)],function(n,l){n(l,1,0,"events");n(l,2,0,"active")},function(n,l){n(l,0,0,t.ɵnov(l,1).target,t.ɵnov(l,1).href),n(l,5,0,t.ɵunv(l,5,0,n(l,6,0,t.ɵnov(l.parent,0),"eventLogs")))})}function f(n){return t.ɵvid(0,[t.ɵpid(0,i.I18nPipe,[r.I18nService]),(n()(),t.ɵeld(1,0,null,null,45,"div",[["class","container page-content"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(3,0,null,null,42,"div",[["class","row"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(5,0,null,null,33,"div",[["class","col-3"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(7,0,null,null,30,"div",[["class","card"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(9,0,null,null,2,"div",[["class","card-header"]],null,null,null,null,null)),(n()(),t.ɵted(10,null,["",""])),t.ɵppd(11,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(13,0,null,null,23,"div",[["class","list-group list-group-flush"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(15,0,null,null,6,"a",[["class","list-group-item"],["routerLink","people"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(n,l,e){var u=!0;"click"===l&&(u=!1!==t.ɵnov(n,16).onClick(e.button,e.ctrlKey,e.metaKey,e.shiftKey)&&u);return u},null,null)),t.ɵdid(16,671744,[[2,4]],0,u.RouterLinkWithHref,[u.Router,u.ActivatedRoute,o.LocationStrategy],{routerLink:[0,"routerLink"]},null),t.ɵdid(17,1720320,null,2,u.RouterLinkActive,[u.Router,t.ElementRef,t.Renderer2,t.ChangeDetectorRef],{routerLinkActive:[0,"routerLinkActive"]},null),t.ɵqud(603979776,1,{links:1}),t.ɵqud(603979776,2,{linksWithHrefs:1}),(n()(),t.ɵted(20,null,["\n ","\n "])),t.ɵppd(21,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(23,0,null,null,6,"a",[["class","list-group-item"],["routerLink","collections"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(n,l,e){var u=!0;"click"===l&&(u=!1!==t.ɵnov(n,24).onClick(e.button,e.ctrlKey,e.metaKey,e.shiftKey)&&u);return u},null,null)),t.ɵdid(24,671744,[[4,4]],0,u.RouterLinkWithHref,[u.Router,u.ActivatedRoute,o.LocationStrategy],{routerLink:[0,"routerLink"]},null),t.ɵdid(25,1720320,null,2,u.RouterLinkActive,[u.Router,t.ElementRef,t.Renderer2,t.ChangeDetectorRef],{routerLinkActive:[0,"routerLinkActive"]},null),t.ɵqud(603979776,3,{links:1}),t.ɵqud(603979776,4,{linksWithHrefs:1}),(n()(),t.ɵted(28,null,["\n ","\n "])),t.ɵppd(29,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,c)),t.ɵdid(32,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,p)),t.ɵdid(35,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(40,0,null,null,4,"div",[["class","col-9"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(42,16777216,null,null,1,"router-outlet",[],null,null,null,null,null)),t.ɵdid(43,212992,null,0,u.RouterOutlet,[u.ChildrenOutletContexts,t.ViewContainerRef,t.ComponentFactoryResolver,[8,null],t.ChangeDetectorRef],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){var e=l.component;n(l,16,0,"people");n(l,17,0,"active");n(l,24,0,"collections");n(l,25,0,"active"),n(l,32,0,e.accessGroups),n(l,35,0,e.accessEvents),n(l,43,0)},function(n,l){n(l,10,0,t.ɵunv(l,10,0,n(l,11,0,t.ɵnov(l,0),"manage"))),n(l,15,0,t.ɵnov(l,16).target,t.ɵnov(l,16).href),n(l,20,0,t.ɵunv(l,20,0,n(l,21,0,t.ɵnov(l,0),"people"))),n(l,23,0,t.ɵnov(l,24).target,t.ɵnov(l,24).href),n(l,28,0,t.ɵunv(l,28,0,n(l,29,0,t.ɵnov(l,0),"collections")))})}function v(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"app-org-manage",[],null,null,null,f,d)),t.ɵdid(1,114688,null,0,a.ManageComponent,[u.ActivatedRoute,s.UserService],null,null)],function(n,l){n(l,1,0)},null)}l.RenderType_ManageComponent=d,l.View_ManageComponent_0=f,l.View_ManageComponent_Host_0=v;var h=t.ɵccf("app-org-manage",a.ManageComponent,v,{},{},[]);l.ManageComponentNgFactory=h},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=e(0),u=e(7),o=e(2),i=e(13),r=e(18),a=e(17),s=e(40),d=e(37),c=e(46),p=e(251),f=e(3),v=e(9),h=e(20),g=e(21),m=e(8),y=e(176),C=e(10),b=t.ɵcrt({encapsulation:2,styles:[],data:{}});function S(n){return t.ɵvid(0,[t.ɵpid(0,u.I18nPipe,[o.I18nService]),(n()(),t.ɵeld(1,0,[["form",1]],null,51,"form",[["ngNativeValidate",""]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngSubmit"],[null,"submit"],[null,"reset"]],function(n,l,e){var u=!0,o=n.component;"submit"===l&&(u=!1!==t.ɵnov(n,2).onSubmit(e)&&u);"reset"===l&&(u=!1!==t.ɵnov(n,2).onReset()&&u);"ngSubmit"===l&&(u=!1!==o.submit()&&u);return u},null,null)),t.ɵdid(2,4210688,null,0,i.NgForm,[[8,null],[8,null]],null,{ngSubmit:"ngSubmit"}),t.ɵprd(2048,null,i.ControlContainer,null,[i.NgForm]),t.ɵdid(4,16384,null,0,i.NgControlStatusGroup,[i.ControlContainer],null,null),t.ɵdid(5,540672,null,0,r.ApiActionDirective,[t.ElementRef,a.ValidationService],{appApiAction:[0,"appApiAction"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(7,0,null,null,5,"div",[["class","page-header"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(9,0,null,null,2,"h1",[],null,null,null,null,null)),(n()(),t.ɵted(10,null,["",""])),t.ɵppd(11,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(14,0,null,null,2,"p",[],null,null,null,null,null)),(n()(),t.ɵted(15,null,["",""])),t.ɵppd(16,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(18,0,null,null,3,"app-callout",[["type","warning"]],null,null,null,s.View_CalloutComponent_0,s.RenderType_CalloutComponent)),t.ɵdid(19,114688,null,0,d.CalloutComponent,[o.I18nService],{type:[0,"type"]},null),(n()(),t.ɵted(20,0,["",""])),t.ɵppd(21,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(23,0,null,null,18,"div",[["class","row"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(25,0,null,null,15,"div",[["class","form-group col-6"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(27,0,null,null,2,"label",[["for","masterPassword"]],null,null,null,null,null)),(n()(),t.ɵted(28,null,["",""])),t.ɵppd(29,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(31,0,null,null,8,"input",[["appInputVerbatim",""],["class","form-control"],["id","masterPassword"],["name","MasterPassword"],["required",""],["type","password"]],[[1,"required",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(n,l,e){var u=!0,o=n.component;"input"===l&&(u=!1!==t.ɵnov(n,32)._handleInput(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,32).onTouched()&&u);"compositionstart"===l&&(u=!1!==t.ɵnov(n,32)._compositionStart()&&u);"compositionend"===l&&(u=!1!==t.ɵnov(n,32)._compositionEnd(e.target.value)&&u);"ngModelChange"===l&&(u=!1!==(o.masterPassword=e)&&u);return u},null,null)),t.ɵdid(32,16384,null,0,i.DefaultValueAccessor,[t.Renderer2,t.ElementRef,[2,i.COMPOSITION_BUFFER_MODE]],null,null),t.ɵdid(33,16384,null,0,i.RequiredValidator,[],{required:[0,"required"]},null),t.ɵprd(1024,null,i.NG_VALIDATORS,function(n){return[n]},[i.RequiredValidator]),t.ɵprd(1024,null,i.NG_VALUE_ACCESSOR,function(n){return[n]},[i.DefaultValueAccessor]),t.ɵdid(36,671744,null,0,i.NgModel,[[2,i.ControlContainer],[2,i.NG_VALIDATORS],[8,null],[2,i.NG_VALUE_ACCESSOR]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,i.NgControl,null,[i.NgModel]),t.ɵdid(38,16384,null,0,i.NgControlStatus,[i.NgControl],null,null),t.ɵdid(39,81920,null,0,c.InputVerbatimDirective,[t.ElementRef,t.Renderer2],{appInputVerbatim:[0,"appInputVerbatim"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(43,0,null,null,8,"button",[["class","btn btn-primary btn-submit"],["type","submit"]],[[8,"disabled",0]],null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(45,0,null,null,1,"i",[["class","fa fa-spinner fa-spin"]],[[8,"title",0]],null,null,null,null)),t.ɵppd(46,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(48,0,null,null,2,"span",[],null,null,null,null,null)),(n()(),t.ɵted(49,null,["",""])),t.ɵppd(50,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){var e=l.component;n(l,5,0,e.formPromise);n(l,19,0,"warning");n(l,33,0,"");n(l,36,0,"MasterPassword",e.masterPassword);n(l,39,0,"")},function(n,l){n(l,1,0,t.ɵnov(l,4).ngClassUntouched,t.ɵnov(l,4).ngClassTouched,t.ɵnov(l,4).ngClassPristine,t.ɵnov(l,4).ngClassDirty,t.ɵnov(l,4).ngClassValid,t.ɵnov(l,4).ngClassInvalid,t.ɵnov(l,4).ngClassPending),n(l,10,0,t.ɵunv(l,10,0,n(l,11,0,t.ɵnov(l,0),"exportVault"))),n(l,15,0,t.ɵunv(l,15,0,n(l,16,0,t.ɵnov(l,0),"exportMasterPassword"))),n(l,20,0,t.ɵunv(l,20,0,n(l,21,0,t.ɵnov(l,0),"exportWarning"))),n(l,28,0,t.ɵunv(l,28,0,n(l,29,0,t.ɵnov(l,0),"masterPass"))),n(l,31,0,t.ɵnov(l,33).required?"":null,t.ɵnov(l,38).ngClassUntouched,t.ɵnov(l,38).ngClassTouched,t.ɵnov(l,38).ngClassPristine,t.ɵnov(l,38).ngClassDirty,t.ɵnov(l,38).ngClassValid,t.ɵnov(l,38).ngClassInvalid,t.ɵnov(l,38).ngClassPending),n(l,43,0,t.ɵnov(l,1).loading),n(l,45,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,45,0,n(l,46,0,t.ɵnov(l,0),"loading")),"")),n(l,49,0,t.ɵunv(l,49,0,n(l,50,0,t.ɵnov(l,0),"exportVault")))})}function w(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"app-org-export",[],null,null,null,S,b)),t.ɵdid(1,114688,null,0,p.ExportComponent,[f.Angulartics2,v.ToasterService,h.CryptoService,g.UserService,o.I18nService,m.PlatformUtilsService,y.ExportService,C.ActivatedRoute],null,null)],function(n,l){n(l,1,0)},null)}l.RenderType_ExportComponent=b,l.View_ExportComponent_0=S,l.View_ExportComponent_Host_0=w;var R=t.ɵccf("app-org-export",p.ExportComponent,w,{},{onSaved:"onSaved"},[]);l.ExportComponentNgFactory=R},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(){this.ciphers=[],this.collections=[],this.collectionRelationships=[]}}();l.ImportOrganizationCiphersRequest=t},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=e(0),u=e(13),o=e(5),i=e(40),r=e(37),a=e(2),s=e(7),d=e(18),c=e(17),p=e(252),f=e(3),v=e(9),h=e(26),g=e(50),m=e(4),y=e(10),C=e(44),b=t.ɵcrt({encapsulation:2,styles:[],data:{}});function S(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,3,"option",[],null,null,null,null,null)),t.ɵdid(1,147456,null,0,u.NgSelectOption,[t.ElementRef,t.Renderer2,[2,u.SelectControlValueAccessor]],{ngValue:[0,"ngValue"]},null),t.ɵdid(2,147456,null,0,u.ɵq,[t.ElementRef,t.Renderer2,[8,null]],{ngValue:[0,"ngValue"]},null),(n()(),t.ɵted(3,null,["",""]))],function(n,l){n(l,1,0,l.context.$implicit.id),n(l,2,0,l.context.$implicit.id)},function(n,l){n(l,3,0,l.context.$implicit.name)})}function w(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,3,"option",[],null,null,null,null,null)),t.ɵdid(1,147456,null,0,u.NgSelectOption,[t.ElementRef,t.Renderer2,[2,u.SelectControlValueAccessor]],{ngValue:[0,"ngValue"]},null),t.ɵdid(2,147456,null,0,u.ɵq,[t.ElementRef,t.Renderer2,[8,null]],{ngValue:[0,"ngValue"]},null),(n()(),t.ɵted(3,null,["",""]))],function(n,l){n(l,1,0,l.context.$implicit.id),n(l,2,0,l.context.$implicit.id)},function(n,l){n(l,3,0,l.context.$implicit.name)})}function R(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,8,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,2,"option",[["disabled",""],["value","-"]],null,null,null,null,null)),t.ɵdid(3,147456,null,0,u.NgSelectOption,[t.ElementRef,t.Renderer2,[2,u.SelectControlValueAccessor]],{value:[0,"value"]},null),t.ɵdid(4,147456,null,0,u.ɵq,[t.ElementRef,t.Renderer2,[8,null]],{value:[0,"value"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,w)),t.ɵdid(7,802816,null,0,o.NgForOf,[t.ViewContainerRef,t.TemplateRef,t.IterableDiffers],{ngForOf:[0,"ngForOf"]},null),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){var e=l.component;n(l,3,0,"-");n(l,4,0,"-"),n(l,7,0,e.importOptions)},null)}function _(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,4,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n See detailed instructions on our help site at\n "])),(n()(),t.ɵeld(2,0,null,null,1,"a",[["href","https://help.bitwarden.com/article/export-your-data/"],["rel","noopener"],["target","_blank"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["https://help.bitwarden.com/article/export-your-data/"])),(n()(),t.ɵted(-1,null,["\n "]))],null,null)}function I(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,4,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n See detailed instructions on our help site at\n "])),(n()(),t.ɵeld(2,0,null,null,1,"a",[["href","https://help.bitwarden.com/article/import-from-lastpass/"],["rel","noopener"],["target","_blank"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["https://help.bitwarden.com/article/import-from-lastpass/"])),(n()(),t.ɵted(-1,null,["\n "]))],null,null)}function A(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Using the KeePassX desktop application, navigate to "Database" → "Export to CSV file" and save the CSV file.\n ']))],null,null)}function E(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n In the Avira web vault, go to "Settings" → "My Data" → "Export data" and save the CSV file.\n ']))],null,null)}function O(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n In the Blur web vault, click your username at the top and go to "Settings" → "Export Data", then click "Export CSV"\n for your "Accounts".\n ']))],null,null)}function N(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Using the SaveInCloud desktop application, navigate to "File" → "Export" → "As XML" and save the XML file.\n ']))],null,null)}function T(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Using the Padlock desktop application, click the hamburger icon in the top left corner and navigate to "Settings" →\n "Export" button and save the file "As CSV".\n ']))],null,null)}function k(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Using the KeePass 2 desktop application, navigate to "File" → "Export" and select the "KeePass XML (2.x)" option.\n ']))],null,null)}function V(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Using the Universal Password Manager desktop application, navigate to "Database" → "Export" and save the CSV file.\n ']))],null,null)}function P(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Using the SaferPass browser extension, click the hamburger icon in the top left corner and navigate to "Settings". Click\n the "Export accounts" button to save the CSV file.\n ']))],null,null)}function M(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Using the Meldium web vault, navigate to "Settings". Locate the "Export data" function and click "Show me my data" to save\n the CSV file.\n ']))],null,null)}function x(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Log into the Keeper web vault (keepersecurity.com/vault). Navigate to "Backup" (top right) and find the "Export to .csv File"\n option. Click "Export Now" to save the CSV file.\n ']))],null,null)}function D(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"span",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n The process is exactly the same as importing from Google Chrome.\n "]))],null,null)}function U(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,7,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,D)),t.ɵdid(3,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n See detailed instructions on our help site at\n "])),(n()(),t.ɵeld(5,0,null,null,1,"a",[["href","https://help.bitwarden.com/article/import-from-chrome/"],["rel","noopener"],["target","_blank"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["https://help.bitwarden.com/article/import-from-chrome/"])),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){n(l,3,0,"chromecsv"!==l.component.format)},null)}function F(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,4,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n Use the\n "])),(n()(),t.ɵeld(2,0,null,null,1,"a",[["href","https://github.com/kspearrin/ff-password-exporter/blob/master/README.md#ff-password-exporter"],["rel","noopener"],["target","_blank"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["FF Password Exporter"])),(n()(),t.ɵted(-1,null,[" application to export your passwords to a CSV file.\n "]))],null,null)}function L(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,4,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n See detailed instructions on our help site at\n "])),(n()(),t.ɵeld(2,0,null,null,1,"a",[["href","https://help.bitwarden.com/article/import-from-1password/"],["rel","noopener"],["target","_blank"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["https://help.bitwarden.com/article/import-from-1password/"])),(n()(),t.ɵted(-1,null,[".\n "]))],null,null)}function G(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Using the Password Dragon desktop application, navigate to "File" → "Export" → "To XML". In the dialog that pops\n up select "All Rows" and check all fields. Click the "Export" button and save the XML file.\n ']))],null,null)}function q(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Using the Enpass desktop application, navigate to "File" → "Export" → "As CSV". Select "OK" to the warning alert\n and save the CSV file. Note that the importer only supports files exported while Enpass is set to the English\n language, so adjust your settings accordingly.\n ']))],null,null)}function z(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Using the Password Safe desktop application, navigate to "File" → "Export To" → "XML format..." and save the XML\n file.\n ']))],null,null)}function j(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Using the Dashlane desktop application, navigate to "File" → "Export" → "Unsecured archive (readable) in CSV format"\n and save the CSV file.\n ']))],null,null)}function B(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Using the mSecure desktop application, navigate to "File" → "Export" → "CSV File..." and save the CSV file.\n ']))],null,null)}function K(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Using the Sticky Password desktop application, navigate to "Menu" (top right) → "Export" → "Export all". Select\n the unencrypted format XML option and save the XML file.\n ']))],null,null)}function H(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Using the True Key desktop application, click the gear icon (top right) and then navigate to "App Settings". Click the "Export"\n button, enter your password and save the CSV file.\n ']))],null,null)}function $(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Log into the Clipperz web application (clipperz.is/app). Click the hamburger menu icon in the top right to expand the navigation\n bar. Navigate to "Data" → "Export". Click the "download HTML+JSON" button to save the HTML file.\n ']))],null,null)}function W(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Using the RoboForm Editor desktop application, navigate to "RoboForm" (top left) → "Options" → "Account & Data"\n and click the "Export" button. Select all of your data, change the "Format" to "CSV file" and then click the\n "Export" button to save the CSV file. Note: RoboForm only allows you to export Logins. Other items will not be\n exported.\n ']))],null,null)}function Y(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Log into the Passbolt web vault and navigate to the "Passwords" listing. Select all of the passwords you would like to export\n and click the "Export" button at the top of the listing. Choose the "csv (lastpass)" export format and click\n the "Export" button.\n ']))],null,null)}function Z(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Using the Ascendo DataVault desktop application, navigate to "Tools" → "Export". In the dialog that pops up, select\n the "All Items (DVX, CSV)" option. Click the "Ok" button to save the CSV file.\n ']))],null,null)}function J(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Using the Password Boss desktop application, navigate to "File" → "Export data" → "Password Boss JSON - not encrypted"\n and save the JSON file.\n ']))],null,null)}function X(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,4,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Log into the Zoho web vault (vault.zoho.com). Navigate to "Tools" → "Export Secrets". Select "All Secrets" and click\n the "Zoho Vault Format CSV" button. Highlight and copy the data from the textarea. Open a text editor like Notepad\n and paste the data. Save the data from the text editor as\n '])),(n()(),t.ɵeld(2,0,null,null,1,"code",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["zoho_export.csv"])),(n()(),t.ɵted(-1,null,[".\n "]))],null,null)}function Q(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Using the SplashID Safe desktop application, click on the SplashID blue lock logo in the top right corner. Navigate to "Export"\n → "Export as CSV" and save the CSV file.\n ']))],null,null)}function nn(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Using the PassKeep mobile app, navigate to "Backup/Restore". Locate the "CSV Backup/Restore" section and click "Backup to\n CSV" to save the CSV file.\n ']))],null,null)}function ln(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,16,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n Make sure you have python-keyring and python-gnomekeyring installed. Save the\n "])),(n()(),t.ɵeld(2,0,null,null,1,"a",[["href","https://bit.ly/2sMldAI"],["rel","noopener"],["target","_blank"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["GNOME Keyring Import/Export"])),(n()(),t.ɵted(-1,null,[" python script to your desktop as\n "])),(n()(),t.ɵeld(5,0,null,null,1,"code",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["pw_helper.py"])),(n()(),t.ɵted(-1,null,[". Open terminal and run\n "])),(n()(),t.ɵeld(8,0,null,null,1,"code",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["chmod +rx Desktop/pw_helper.py"])),(n()(),t.ɵted(-1,null,[" and then\n "])),(n()(),t.ɵeld(11,0,null,null,1,"code",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["python Desktop/pw_helper.py export Desktop/my_passwords.json"])),(n()(),t.ɵted(-1,null,[". Then upload the resulting\n "])),(n()(),t.ɵeld(14,0,null,null,1,"code",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["my_passwords.json"])),(n()(),t.ɵted(-1,null,[" file here to Bitwarden.\n "]))],null,null)}function en(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Using the Password Agent desktop application navigate to "File" → "Export", select the "Fields to export" button and\n check all of the fields, change the "Output format" to "CSV", and then click the "Start" button to save the CSV\n file.\n ']))],null,null)}function tn(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,98,"app-callout",[["type","info"]],null,null,null,i.View_CalloutComponent_0,i.RenderType_CalloutComponent)),t.ɵdid(1,114688,null,0,r.CalloutComponent,[a.I18nService],{type:[0,"type"],title:[1,"title"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,_)),t.ɵdid(4,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,I)),t.ɵdid(7,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,A)),t.ɵdid(10,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,E)),t.ɵdid(13,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,O)),t.ɵdid(16,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,N)),t.ɵdid(19,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,T)),t.ɵdid(22,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,k)),t.ɵdid(25,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,V)),t.ɵdid(28,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,P)),t.ɵdid(31,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,M)),t.ɵdid(34,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,x)),t.ɵdid(37,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,U)),t.ɵdid(40,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,F)),t.ɵdid(43,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,L)),t.ɵdid(46,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,G)),t.ɵdid(49,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,q)),t.ɵdid(52,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,z)),t.ɵdid(55,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,j)),t.ɵdid(58,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,B)),t.ɵdid(61,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,K)),t.ɵdid(64,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,H)),t.ɵdid(67,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,$)),t.ɵdid(70,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,W)),t.ɵdid(73,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,Y)),t.ɵdid(76,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,Z)),t.ɵdid(79,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,J)),t.ɵdid(82,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,X)),t.ɵdid(85,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,Q)),t.ɵdid(88,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,nn)),t.ɵdid(91,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,ln)),t.ɵdid(94,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,en)),t.ɵdid(97,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "]))],function(n,l){var e=l.component;n(l,1,0,"info",t.ɵinlineInterpolate(1,"",e.getFormatInstructionTitle(),"")),n(l,4,0,"bitwardencsv"===e.format),n(l,7,0,"lastpasscsv"===e.format),n(l,10,0,"keepassxcsv"===e.format),n(l,13,0,"aviracsv"===e.format),n(l,16,0,"blurcsv"===e.format),n(l,19,0,"safeincloudxml"===e.format),n(l,22,0,"padlockcsv"===e.format),n(l,25,0,"keepass2xml"===e.format),n(l,28,0,"upmcsv"===e.format),n(l,31,0,"saferpasscsv"===e.format),n(l,34,0,"meldiumcsv"===e.format),n(l,37,0,"keepercsv"===e.format),n(l,40,0,"chromecsv"===e.format||"operacsv"===e.format||"vivaldicsv"===e.format),n(l,43,0,"firefoxcsv"===e.format),n(l,46,0,"1password1pif"===e.format||"1passwordwincsv"===e.format),n(l,49,0,"passworddragonxml"===e.format),n(l,52,0,"enpasscsv"===e.format),n(l,55,0,"pwsafexml"===e.format),n(l,58,0,"dashlanecsv"===e.format),n(l,61,0,"msecurecsv"===e.format),n(l,64,0,"stickypasswordxml"===e.format),n(l,67,0,"truekeycsv"===e.format),n(l,70,0,"clipperzhtml"===e.format),n(l,73,0,"roboformcsv"===e.format),n(l,76,0,"passboltcsv"===e.format),n(l,79,0,"ascendocsv"===e.format),n(l,82,0,"passwordbossjson"===e.format),n(l,85,0,"zohovaultcsv"===e.format),n(l,88,0,"splashidcsv"===e.format),n(l,91,0,"passkeepcsv"===e.format),n(l,94,0,"gnomejson"===e.format),n(l,97,0,"passwordagentcsv"===e.format)},null)}function un(n){return t.ɵvid(0,[t.ɵpid(0,s.I18nPipe,[a.I18nService]),(n()(),t.ɵeld(1,0,null,null,5,"div",[["class","page-header"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(3,0,null,null,2,"h1",[],null,null,null,null,null)),(n()(),t.ɵted(4,null,["",""])),t.ɵppd(5,1),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵeld(8,0,[["form",1]],null,76,"form",[["ngNativeValidate",""]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngSubmit"],[null,"submit"],[null,"reset"]],function(n,l,e){var u=!0,o=n.component;"submit"===l&&(u=!1!==t.ɵnov(n,9).onSubmit(e)&&u);"reset"===l&&(u=!1!==t.ɵnov(n,9).onReset()&&u);"ngSubmit"===l&&(u=!1!==o.submit()&&u);return u},null,null)),t.ɵdid(9,4210688,null,0,u.NgForm,[[8,null],[8,null]],null,{ngSubmit:"ngSubmit"}),t.ɵprd(2048,null,u.ControlContainer,null,[u.NgForm]),t.ɵdid(11,16384,null,0,u.NgControlStatusGroup,[u.ControlContainer],null,null),t.ɵdid(12,540672,null,0,d.ApiActionDirective,[t.ElementRef,c.ValidationService],{appApiAction:[0,"appApiAction"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(14,0,null,null,27,"div",[["class","row"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(16,0,null,null,24,"div",[["class","col-6"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(18,0,null,null,21,"div",[["class","form-group"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(20,0,null,null,2,"label",[["for","type"]],null,null,null,null,null)),(n()(),t.ɵted(21,null,["1. ",""])),t.ɵppd(22,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(24,0,null,null,14,"select",[["class","form-control"],["id","type"],["name","Format"],["required",""]],[[1,"required",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"change"],[null,"blur"]],function(n,l,e){var u=!0,o=n.component;"change"===l&&(u=!1!==t.ɵnov(n,25).onChange(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,25).onTouched()&&u);"ngModelChange"===l&&(u=!1!==(o.format=e)&&u);return u},null,null)),t.ɵdid(25,16384,null,0,u.SelectControlValueAccessor,[t.Renderer2,t.ElementRef],null,null),t.ɵdid(26,16384,null,0,u.RequiredValidator,[],{required:[0,"required"]},null),t.ɵprd(1024,null,u.NG_VALIDATORS,function(n){return[n]},[u.RequiredValidator]),t.ɵprd(1024,null,u.NG_VALUE_ACCESSOR,function(n){return[n]},[u.SelectControlValueAccessor]),t.ɵdid(29,671744,null,0,u.NgModel,[[2,u.ControlContainer],[2,u.NG_VALIDATORS],[8,null],[2,u.NG_VALUE_ACCESSOR]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,u.NgControl,null,[u.NgModel]),t.ɵdid(31,16384,null,0,u.NgControlStatus,[u.NgControl],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,S)),t.ɵdid(34,802816,null,0,o.NgForOf,[t.ViewContainerRef,t.TemplateRef,t.IterableDiffers],{ngForOf:[0,"ngForOf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,R)),t.ɵdid(37,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,tn)),t.ɵdid(44,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(46,0,null,null,13,"div",[["class","row"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(48,0,null,null,10,"div",[["class","col-6"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(50,0,null,null,7,"div",[["class","form-group"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(52,0,null,null,2,"label",[["for","file"]],null,null,null,null,null)),(n()(),t.ɵted(53,null,["2. ",""])),t.ɵppd(54,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(56,0,null,null,0,"input",[["class","form-control-file"],["id","file"],["name","file"],["type","file"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(61,0,null,null,12,"div",[["class","form-group"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(63,0,null,null,2,"label",[["for","fileContents"]],null,null,null,null,null)),(n()(),t.ɵted(64,null,["",""])),t.ɵppd(65,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(67,0,null,null,5,"textarea",[["class","form-control"],["id","fileContents"],["name","FileContents"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(n,l,e){var u=!0,o=n.component;"input"===l&&(u=!1!==t.ɵnov(n,68)._handleInput(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,68).onTouched()&&u);"compositionstart"===l&&(u=!1!==t.ɵnov(n,68)._compositionStart()&&u);"compositionend"===l&&(u=!1!==t.ɵnov(n,68)._compositionEnd(e.target.value)&&u);"ngModelChange"===l&&(u=!1!==(o.fileContents=e)&&u);return u},null,null)),t.ɵdid(68,16384,null,0,u.DefaultValueAccessor,[t.Renderer2,t.ElementRef,[2,u.COMPOSITION_BUFFER_MODE]],null,null),t.ɵprd(1024,null,u.NG_VALUE_ACCESSOR,function(n){return[n]},[u.DefaultValueAccessor]),t.ɵdid(70,671744,null,0,u.NgModel,[[2,u.ControlContainer],[8,null],[8,null],[2,u.NG_VALUE_ACCESSOR]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,u.NgControl,null,[u.NgModel]),t.ɵdid(72,16384,null,0,u.NgControlStatus,[u.NgControl],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(75,0,null,null,8,"button",[["class","btn btn-primary btn-submit"],["type","submit"]],[[8,"disabled",0]],null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(77,0,null,null,1,"i",[["class","fa fa-spinner fa-spin"]],[[8,"title",0]],null,null,null,null)),t.ɵppd(78,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(80,0,null,null,2,"span",[],null,null,null,null,null)),(n()(),t.ɵted(81,null,["",""])),t.ɵppd(82,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){var e=l.component;n(l,12,0,e.formPromise);n(l,26,0,"");n(l,29,0,"Format",e.format),n(l,34,0,e.featuredImportOptions),n(l,37,0,e.importOptions&&e.importOptions.length),n(l,44,0,e.format);n(l,70,0,"FileContents",e.fileContents)},function(n,l){n(l,4,0,t.ɵunv(l,4,0,n(l,5,0,t.ɵnov(l,0),"importData"))),n(l,8,0,t.ɵnov(l,11).ngClassUntouched,t.ɵnov(l,11).ngClassTouched,t.ɵnov(l,11).ngClassPristine,t.ɵnov(l,11).ngClassDirty,t.ɵnov(l,11).ngClassValid,t.ɵnov(l,11).ngClassInvalid,t.ɵnov(l,11).ngClassPending),n(l,21,0,t.ɵunv(l,21,0,n(l,22,0,t.ɵnov(l,0),"selectFormat"))),n(l,24,0,t.ɵnov(l,26).required?"":null,t.ɵnov(l,31).ngClassUntouched,t.ɵnov(l,31).ngClassTouched,t.ɵnov(l,31).ngClassPristine,t.ɵnov(l,31).ngClassDirty,t.ɵnov(l,31).ngClassValid,t.ɵnov(l,31).ngClassInvalid,t.ɵnov(l,31).ngClassPending),n(l,53,0,t.ɵunv(l,53,0,n(l,54,0,t.ɵnov(l,0),"selectImportFile"))),n(l,64,0,t.ɵunv(l,64,0,n(l,65,0,t.ɵnov(l,0),"orCopyPasteFileContents"))),n(l,67,0,t.ɵnov(l,72).ngClassUntouched,t.ɵnov(l,72).ngClassTouched,t.ɵnov(l,72).ngClassPristine,t.ɵnov(l,72).ngClassDirty,t.ɵnov(l,72).ngClassValid,t.ɵnov(l,72).ngClassInvalid,t.ɵnov(l,72).ngClassPending),n(l,75,0,t.ɵnov(l,8).loading),n(l,77,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,77,0,n(l,78,0,t.ɵnov(l,0),"loading")),"")),n(l,81,0,t.ɵunv(l,81,0,n(l,82,0,t.ɵnov(l,0),"importData")))})}function on(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"app-org-import",[],null,null,null,un,b)),t.ɵdid(1,114688,null,0,p.ImportComponent,[a.I18nService,f.Angulartics2,v.ToasterService,h.CipherService,g.FolderService,m.ApiService,y.Router,C.CollectionService,y.ActivatedRoute],null,null)],function(n,l){n(l,1,0)},null)}l.RenderType_ImportComponent=b,l.View_ImportComponent_0=un,l.View_ImportComponent_Host_0=on;var rn=t.ɵccf("app-org-import",p.ImportComponent,on,{},{},[]);l.ImportComponentNgFactory=rn},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=e(0),u=e(7),o=e(2),i=e(10),r=e(5),a=e(253),s=t.ɵcrt({encapsulation:2,styles:[],data:{}});function d(n){return t.ɵvid(0,[t.ɵpid(0,u.I18nPipe,[o.I18nService]),(n()(),t.ɵeld(1,0,null,null,39,"div",[["class","container page-content"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(3,0,null,null,36,"div",[["class","row"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(5,0,null,null,27,"div",[["class","col-3"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(7,0,null,null,24,"div",[["class","card"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(9,0,null,null,2,"div",[["class","card-header"]],null,null,null,null,null)),(n()(),t.ɵted(10,null,["",""])),t.ɵppd(11,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(13,0,null,null,17,"div",[["class","list-group list-group-flush"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(15,0,null,null,6,"a",[["class","list-group-item"],["routerLink","import"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(n,l,e){var u=!0;"click"===l&&(u=!1!==t.ɵnov(n,16).onClick(e.button,e.ctrlKey,e.metaKey,e.shiftKey)&&u);return u},null,null)),t.ɵdid(16,671744,[[2,4]],0,i.RouterLinkWithHref,[i.Router,i.ActivatedRoute,r.LocationStrategy],{routerLink:[0,"routerLink"]},null),t.ɵdid(17,1720320,null,2,i.RouterLinkActive,[i.Router,t.ElementRef,t.Renderer2,t.ChangeDetectorRef],{routerLinkActive:[0,"routerLinkActive"]},null),t.ɵqud(603979776,1,{links:1}),t.ɵqud(603979776,2,{linksWithHrefs:1}),(n()(),t.ɵted(20,null,["\n ","\n "])),t.ɵppd(21,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(23,0,null,null,6,"a",[["class","list-group-item"],["routerLink","export"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(n,l,e){var u=!0;"click"===l&&(u=!1!==t.ɵnov(n,24).onClick(e.button,e.ctrlKey,e.metaKey,e.shiftKey)&&u);return u},null,null)),t.ɵdid(24,671744,[[4,4]],0,i.RouterLinkWithHref,[i.Router,i.ActivatedRoute,r.LocationStrategy],{routerLink:[0,"routerLink"]},null),t.ɵdid(25,1720320,null,2,i.RouterLinkActive,[i.Router,t.ElementRef,t.Renderer2,t.ChangeDetectorRef],{routerLinkActive:[0,"routerLinkActive"]},null),t.ɵqud(603979776,3,{links:1}),t.ɵqud(603979776,4,{linksWithHrefs:1}),(n()(),t.ɵted(28,null,["\n ","\n "])),t.ɵppd(29,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(34,0,null,null,4,"div",[["class","col-9"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(36,16777216,null,null,1,"router-outlet",[],null,null,null,null,null)),t.ɵdid(37,212992,null,0,i.RouterOutlet,[i.ChildrenOutletContexts,t.ViewContainerRef,t.ComponentFactoryResolver,[8,null],t.ChangeDetectorRef],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){n(l,16,0,"import");n(l,17,0,"active");n(l,24,0,"export");n(l,25,0,"active"),n(l,37,0)},function(n,l){n(l,10,0,t.ɵunv(l,10,0,n(l,11,0,t.ɵnov(l,0),"tools"))),n(l,15,0,t.ɵnov(l,16).target,t.ɵnov(l,16).href),n(l,20,0,t.ɵunv(l,20,0,n(l,21,0,t.ɵnov(l,0),"importData"))),n(l,23,0,t.ɵnov(l,24).target,t.ɵnov(l,24).href),n(l,28,0,t.ɵunv(l,28,0,n(l,29,0,t.ɵnov(l,0),"exportVault")))})}function c(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"app-org-tools",[],null,null,null,d,s)),t.ɵdid(1,49152,null,0,a.ToolsComponent,[],null,null)],null,null)}l.RenderType_ToolsComponent=s,l.View_ToolsComponent_0=d,l.View_ToolsComponent_Host_0=c;var p=t.ɵccf("app-org-tools",a.ToolsComponent,c,{},{},[]);l.ToolsComponentNgFactory=p},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0}),function(n){n[n.User_LoggedIn=1e3]="User_LoggedIn",n[n.User_ChangedPassword=1001]="User_ChangedPassword",n[n.User_Enabled2fa=1002]="User_Enabled2fa",n[n.User_Disabled2fa=1003]="User_Disabled2fa",n[n.User_Recovered2fa=1004]="User_Recovered2fa",n[n.User_FailedLogIn=1005]="User_FailedLogIn",n[n.User_FailedLogIn2fa=1006]="User_FailedLogIn2fa",n[n.Cipher_Created=1100]="Cipher_Created",n[n.Cipher_Updated=1101]="Cipher_Updated",n[n.Cipher_Deleted=1102]="Cipher_Deleted",n[n.Cipher_AttachmentCreated=1103]="Cipher_AttachmentCreated",n[n.Cipher_AttachmentDeleted=1104]="Cipher_AttachmentDeleted",n[n.Cipher_Shared=1105]="Cipher_Shared",n[n.Cipher_UpdatedCollections=1106]="Cipher_UpdatedCollections",n[n.Collection_Created=1300]="Collection_Created",n[n.Collection_Updated=1301]="Collection_Updated",n[n.Collection_Deleted=1302]="Collection_Deleted",n[n.Group_Created=1400]="Group_Created",n[n.Group_Updated=1401]="Group_Updated",n[n.Group_Deleted=1402]="Group_Deleted",n[n.OrganizationUser_Invited=1500]="OrganizationUser_Invited",n[n.OrganizationUser_Confirmed=1501]="OrganizationUser_Confirmed",n[n.OrganizationUser_Updated=1502]="OrganizationUser_Updated",n[n.OrganizationUser_Removed=1503]="OrganizationUser_Removed",n[n.OrganizationUser_UpdatedGroups=1504]="OrganizationUser_UpdatedGroups",n[n.Organization_Updated=1600]="Organization_Updated"}(l.EventType||(l.EventType={}))},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=e(0),u=e(13),o=e(92),i=e(60),r=e(5),a=e(566),s=e(281),d=e(131),c=e(61),p=e(565),f=e(8),v=e(7),h=e(2),g=e(256),m=e(26),y=e(3),C=e(9),b=e(4),S=t.ɵcrt({encapsulation:2,styles:[],data:{}});function w(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,8,"td",[["class","table-list-checkbox"]],null,[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.checkCipher(n.parent.context.$implicit)&&t);return t},null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,5,"input",[["type","checkbox"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"change"],[null,"blur"]],function(n,l,e){var u=!0;"change"===l&&(u=!1!==t.ɵnov(n,3).onChange(e.target.checked)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,3).onTouched()&&u);"ngModelChange"===l&&(u=!1!==(n.parent.context.$implicit.checked=e)&&u);return u},null,null)),t.ɵdid(3,16384,null,0,u.CheckboxControlValueAccessor,[t.Renderer2,t.ElementRef],null,null),t.ɵprd(1024,null,u.NG_VALUE_ACCESSOR,function(n){return[n]},[u.CheckboxControlValueAccessor]),t.ɵdid(5,671744,null,0,u.NgModel,[[8,null],[8,null],[8,null],[2,u.NG_VALUE_ACCESSOR]],{model:[0,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,u.NgControl,null,[u.NgModel]),t.ɵdid(7,16384,null,0,u.NgControlStatus,[u.NgControl],null,null),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){n(l,5,0,l.parent.context.$implicit.checked)},function(n,l){n(l,2,0,t.ɵnov(l,7).ngClassUntouched,t.ɵnov(l,7).ngClassTouched,t.ɵnov(l,7).ngClassPristine,t.ɵnov(l,7).ngClassDirty,t.ɵnov(l,7).ngClassValid,t.ɵnov(l,7).ngClassInvalid,t.ɵnov(l,7).ngClassPending)})}function R(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,2,"i",[["appStopProp",""],["class","fa fa-share-alt"]],[[8,"title",0]],[[null,"click"]],function(n,l,e){var u=!0;"click"===l&&(u=!1!==t.ɵnov(n,1).onClick(e)&&u);return u},null,null)),t.ɵdid(1,16384,null,0,o.StopPropDirective,[],null,null),t.ɵppd(2,1)],null,function(n,l){n(l,0,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,0,0,n(l,2,0,t.ɵnov(l.parent.parent.parent.parent,1),"shared")),""))})}function _(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,2,"i",[["appStopProp",""],["class","fa fa-paperclip"]],[[8,"title",0]],[[null,"click"]],function(n,l,e){var u=!0;"click"===l&&(u=!1!==t.ɵnov(n,1).onClick(e)&&u);return u},null,null)),t.ɵdid(1,16384,null,0,o.StopPropDirective,[],null,null),t.ɵppd(2,1)],null,function(n,l){n(l,0,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,0,0,n(l,2,0,t.ɵnov(l.parent.parent.parent.parent,1),"attachments")),""))})}function I(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,5,"a",[["appStopClick",""],["class","dropdown-item"],["href","#"]],null,[[null,"click"]],function(n,l,e){var u=!0,o=n.component;"click"===l&&(u=!1!==t.ɵnov(n,1).onClick(e)&&u);"click"===l&&(u=!1!==o.copy(n.parent.context.$implicit.login.password,"password","password")&&u);return u},null,null)),t.ɵdid(1,16384,null,0,i.StopClickDirective,[],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(3,0,null,null,0,"i",[["class","fa fa-fw fa-clipboard"]],null,null,null,null,null)),(n()(),t.ɵted(4,null,["\n ","\n "])),t.ɵppd(5,1)],null,function(n,l){n(l,4,0,t.ɵunv(l,4,0,n(l,5,0,t.ɵnov(l.parent.parent.parent.parent,1),"copyPassword")))})}function A(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,5,"a",[["appStopClick",""],["class","dropdown-item"],["href","#"]],null,[[null,"click"]],function(n,l,e){var u=!0,o=n.component;"click"===l&&(u=!1!==t.ɵnov(n,1).onClick(e)&&u);"click"===l&&(u=!1!==o.share(n.parent.context.$implicit)&&u);return u},null,null)),t.ɵdid(1,16384,null,0,i.StopClickDirective,[],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(3,0,null,null,0,"i",[["class","fa fa-fw fa-share-alt"]],null,null,null,null,null)),(n()(),t.ɵted(4,null,["\n ","\n "])),t.ɵppd(5,1)],null,function(n,l){n(l,4,0,t.ɵunv(l,4,0,n(l,5,0,t.ɵnov(l.parent.parent.parent.parent,1),"share")))})}function E(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,5,"a",[["appStopClick",""],["class","dropdown-item"],["href","#"]],null,[[null,"click"]],function(n,l,e){var u=!0,o=n.component;"click"===l&&(u=!1!==t.ɵnov(n,1).onClick(e)&&u);"click"===l&&(u=!1!==o.collections(n.parent.context.$implicit)&&u);return u},null,null)),t.ɵdid(1,16384,null,0,i.StopClickDirective,[],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(3,0,null,null,0,"i",[["class","fa fa-fw fa-cubes"]],null,null,null,null,null)),(n()(),t.ɵted(4,null,["\n ","\n "])),t.ɵppd(5,1)],null,function(n,l){n(l,4,0,t.ɵunv(l,4,0,n(l,5,0,t.ɵnov(l.parent.parent.parent.parent,1),"collections")))})}function O(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,5,"a",[["appStopClick",""],["class","dropdown-item"],["href","#"]],null,[[null,"click"]],function(n,l,e){var u=!0,o=n.component;"click"===l&&(u=!1!==t.ɵnov(n,1).onClick(e)&&u);"click"===l&&(u=!1!==o.events(n.parent.context.$implicit)&&u);return u},null,null)),t.ɵdid(1,16384,null,0,i.StopClickDirective,[],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(3,0,null,null,0,"i",[["class","fa fa-fw fa-file-text-o"]],null,null,null,null,null)),(n()(),t.ɵted(4,null,["\n ","\n "])),t.ɵppd(5,1)],null,function(n,l){n(l,4,0,t.ɵunv(l,4,0,n(l,5,0,t.ɵnov(l.parent.parent.parent.parent,1),"eventLogs")))})}function N(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,71,"tr",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,w)),t.ɵdid(3,16384,null,0,r.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(5,0,null,null,4,"td",[["class","table-list-icon"]],null,[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.checkCipher(n.context.$implicit)&&t);return t},null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(7,0,null,null,1,"app-vault-icon",[],null,null,null,a.View_IconComponent_0,a.RenderType_IconComponent)),t.ɵdid(8,573440,null,0,s.IconComponent,[d.EnvironmentService,c.StateService],{cipher:[0,"cipher"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(11,0,null,null,19,"td",[["class","reduced-lh"]],null,[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.checkCipher(n.context.$implicit)&&t);return t},null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(13,0,null,null,4,"a",[["appStopClick",""],["appStopProp",""],["href","#"]],[[8,"title",0]],[[null,"click"]],function(n,l,e){var u=!0,o=n.component;"click"===l&&(u=!1!==t.ɵnov(n,14).onClick(e)&&u);"click"===l&&(u=!1!==t.ɵnov(n,15).onClick(e)&&u);"click"===l&&(u=!1!==o.selectCipher(n.context.$implicit)&&u);return u},null,null)),t.ɵdid(14,16384,null,0,i.StopClickDirective,[],null,null),t.ɵdid(15,16384,null,0,o.StopPropDirective,[],null,null),t.ɵppd(16,1),(n()(),t.ɵted(17,null,["",""])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,R)),t.ɵdid(20,16384,null,0,r.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,_)),t.ɵdid(23,16384,null,0,r.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(25,0,null,null,0,"br",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(27,0,null,null,2,"small",[["appStopProp",""]],null,[[null,"click"]],function(n,l,e){var u=!0;"click"===l&&(u=!1!==t.ɵnov(n,28).onClick(e)&&u);return u},null,null)),t.ɵdid(28,16384,null,0,o.StopPropDirective,[],null,null),(n()(),t.ɵted(29,null,["",""])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(32,0,null,null,38,"td",[["class","table-list-options"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(34,0,null,null,35,"div",[["appListDropdown",""],["class","dropdown"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(36,0,null,null,3,"button",[["aria-expanded","false"],["aria-haspopup","true"],["class","btn btn-outline-secondary dropdown-toggle"],["data-toggle","dropdown"],["id","dropdownMenuButton"],["type","button"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(38,0,null,null,0,"i",[["class","fa fa-cog fa-lg"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(41,0,null,null,27,"div",[["aria-labelledby","dropdownMenuButton"],["class","dropdown-menu dropdown-menu-right"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,I)),t.ɵdid(44,16384,null,0,r.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(46,0,null,null,5,"a",[["appStopClick",""],["class","dropdown-item"],["href","#"]],null,[[null,"click"]],function(n,l,e){var u=!0,o=n.component;"click"===l&&(u=!1!==t.ɵnov(n,47).onClick(e)&&u);"click"===l&&(u=!1!==o.attachments(n.context.$implicit)&&u);return u},null,null)),t.ɵdid(47,16384,null,0,i.StopClickDirective,[],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(49,0,null,null,0,"i",[["class","fa fa-fw fa-paperclip"]],null,null,null,null,null)),(n()(),t.ɵted(50,null,["\n ","\n "])),t.ɵppd(51,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,A)),t.ɵdid(54,16384,null,0,r.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,E)),t.ɵdid(57,16384,null,0,r.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,O)),t.ɵdid(60,16384,null,0,r.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(62,0,null,null,5,"a",[["appStopClick",""],["class","dropdown-item text-danger"],["href","#"]],null,[[null,"click"]],function(n,l,e){var u=!0,o=n.component;"click"===l&&(u=!1!==t.ɵnov(n,63).onClick(e)&&u);"click"===l&&(u=!1!==o.delete(n.context.$implicit)&&u);return u},null,null)),t.ɵdid(63,16384,null,0,i.StopClickDirective,[],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(65,0,null,null,0,"i",[["class","fa fa-fw fa-trash-o"]],null,null,null,null,null)),(n()(),t.ɵted(66,null,["\n ","\n "])),t.ɵppd(67,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){var e=l.component;n(l,3,0,!e.organization),n(l,8,0,l.context.$implicit),n(l,20,0,!e.organization&&l.context.$implicit.organizationId),n(l,23,0,l.context.$implicit.hasAttachments),n(l,44,0,l.context.$implicit.type===e.cipherType.Login),n(l,54,0,!e.organization&&!l.context.$implicit.organizationId),n(l,57,0,l.context.$implicit.organizationId),n(l,60,0,l.context.$implicit.organizationId&&e.accessEvents)},function(n,l){n(l,13,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,13,0,n(l,16,0,t.ɵnov(l.parent.parent.parent,1),"editItem")),"")),n(l,17,0,l.context.$implicit.name),n(l,29,0,l.context.$implicit.subTitle),n(l,50,0,t.ɵunv(l,50,0,n(l,51,0,t.ɵnov(l.parent.parent.parent,1),"attachments"))),n(l,66,0,t.ɵunv(l,66,0,n(l,67,0,t.ɵnov(l.parent.parent.parent,1),"delete")))})}function T(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,7,"table",[["class","table table-hover table-list table-ciphers"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,4,"tbody",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,N)),t.ɵdid(5,802816,null,0,r.NgForOf,[t.ViewContainerRef,t.TemplateRef,t.IterableDiffers],{ngForOf:[0,"ngForOf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){n(l,5,0,l.parent.context.ngIf)},null)}function k(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"i",[["class","fa fa-spinner fa-spin text-muted"]],[[8,"title",0]],null,null,null,null)),t.ɵppd(1,1)],null,function(n,l){n(l,0,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,0,0,n(l,1,0,t.ɵnov(l.parent.parent.parent,1),"loading")),""))})}function V(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,4,"button",[["class","btn btn-outline-primary"]],null,[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.addCipher()&&t);return t},null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,0,"i",[["class","fa fa-plus fa-fw"]],null,null,null,null,null)),(n()(),t.ɵted(3,null,["",""])),t.ɵppd(4,1)],null,function(n,l){n(l,3,0,t.ɵunv(l,3,0,n(l,4,0,t.ɵnov(l.parent.parent.parent.parent,1),"addItem")))})}function P(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,8,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,2,"p",[],null,null,null,null,null)),(n()(),t.ɵted(3,null,["",""])),t.ɵppd(4,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,V)),t.ɵdid(7,16384,null,0,r.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){n(l,7,0,l.component.showAddNew)},function(n,l){n(l,3,0,t.ɵunv(l,3,0,n(l,4,0,t.ɵnov(l.parent.parent.parent,1),"noItemsInList")))})}function M(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,7,"div",[["class","no-items"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,k)),t.ɵdid(3,16384,null,0,r.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,P)),t.ɵdid(6,16384,null,0,r.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){var e=l.component;n(l,3,0,!e.loaded),n(l,6,0,e.loaded)},null)}function x(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,7,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,T)),t.ɵdid(3,16384,null,0,r.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,M)),t.ɵdid(6,16384,null,0,r.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){n(l,3,0,l.context.ngIf.length>0),n(l,6,0,0===l.context.ngIf.length)},null)}function D(n){return t.ɵvid(0,[t.ɵpid(0,p.SearchCiphersPipe,[f.PlatformUtilsService]),t.ɵpid(0,v.I18nPipe,[h.I18nService]),(n()(),t.ɵand(16777216,null,null,2,null,x)),t.ɵdid(3,16384,null,0,r.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),t.ɵppd(4,2),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){var e=l.component;n(l,3,0,t.ɵunv(l,3,0,n(l,4,0,t.ɵnov(l,0),e.ciphers,e.searchText)))},null)}function U(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"app-org-vault-ciphers",[],null,null,null,D,S)),t.ɵdid(1,49152,null,0,g.CiphersComponent,[m.CipherService,y.Angulartics2,C.ToasterService,h.I18nService,f.PlatformUtilsService,b.ApiService],null,null)],null,null)}l.RenderType_CiphersComponent=S,l.View_CiphersComponent_0=D,l.View_CiphersComponent_Host_0=U;var F=t.ɵccf("app-org-vault-ciphers",g.CiphersComponent,U,{activeCipherId:"activeCipherId",showAddNew:"showAddNew"},{onCipherClicked:"onCipherClicked",onCipherRightClicked:"onCipherRightClicked",onAddCipher:"onAddCipher",onAddCipherOptions:"onAddCipherOptions",onAttachmentsClicked:"onAttachmentsClicked",onShareClicked:"onShareClicked",onCollectionsClicked:"onCollectionsClicked",onEventsClicked:"onEventsClicked"},[]);l.CiphersComponentNgFactory=F},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=e(0),u=e(5),o=e(60),i=e(7),r=e(2),a=e(13),s=e(87),d=e(257),c=e(44),p=e(50),f=e(4),v=t.ɵcrt({encapsulation:2,styles:[],data:{}});function h(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,10,"li",[],null,null,null,null,null)),t.ɵdid(1,278528,null,0,u.NgClass,[t.IterableDiffers,t.KeyValueDiffers,t.ElementRef,t.Renderer2],{ngClass:[0,"ngClass"]},null),t.ɵpod(2,{active:0}),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(4,0,null,null,5,"a",[["appStopClick",""],["href","#"]],null,[[null,"click"]],function(n,l,e){var u=!0,o=n.component;"click"===l&&(u=!1!==t.ɵnov(n,5).onClick(e)&&u);"click"===l&&(u=!1!==o.selectFavorites()&&u);return u},null,null)),t.ɵdid(5,16384,null,0,o.StopClickDirective,[],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(7,0,null,null,0,"i",[["class","fa-li fa fa-fw fa-star"]],null,null,null,null,null)),(n()(),t.ɵted(8,null,["","\n "])),t.ɵppd(9,1),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){n(l,1,0,n(l,2,0,l.component.selectedFavorites))},function(n,l){n(l,8,0,t.ɵunv(l,8,0,n(l,9,0,t.ɵnov(l.parent,0),"favorites")))})}function g(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,4,"p",[["class","text-muted"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,1,"i",[["class","fa fa-spinner fa-spin"]],[[8,"title",0]],null,null,null,null)),t.ɵppd(3,1),(n()(),t.ɵted(-1,null,["\n "]))],null,function(n,l){n(l,2,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,2,0,n(l,3,0,t.ɵnov(l.parent,0),"loading")),""))})}function m(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,5,"a",[["appStopClick",""],["class","text-muted ml-auto show-active"],["href","#"]],[[8,"title",0]],[[null,"click"]],function(n,l,e){var u=!0,o=n.component;"click"===l&&(u=!1!==t.ɵnov(n,1).onClick(e)&&u);"click"===l&&(u=!1!==o.editFolder(n.parent.context.$implicit)&&u);return u},null,null)),t.ɵdid(1,16384,null,0,o.StopClickDirective,[],null,null),t.ɵppd(2,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(4,0,null,null,0,"i",[["class","fa fa-pencil fa-fw"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "]))],null,function(n,l){n(l,0,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,0,0,n(l,2,0,t.ɵnov(l.parent.parent.parent.parent,0),"editFolder")),""))})}function y(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,12,"li",[["class","d-flex"]],null,null,null,null,null)),t.ɵdid(1,278528,null,0,u.NgClass,[t.IterableDiffers,t.KeyValueDiffers,t.ElementRef,t.Renderer2],{klass:[0,"klass"],ngClass:[1,"ngClass"]},null),t.ɵpod(2,{active:0}),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(4,0,null,null,4,"a",[["appStopClick",""],["href","#"]],null,[[null,"click"]],function(n,l,e){var u=!0,o=n.component;"click"===l&&(u=!1!==t.ɵnov(n,5).onClick(e)&&u);"click"===l&&(u=!1!==o.selectFolder(n.context.$implicit)&&u);return u},null,null)),t.ɵdid(5,16384,null,0,o.StopClickDirective,[],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(7,0,null,null,0,"i",[["class","fa-li fa fa-caret-right"]],null,null,null,null,null)),(n()(),t.ɵted(8,null,[" ",""])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,m)),t.ɵdid(11,16384,null,0,u.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){var e=l.component;n(l,1,0,"d-flex",n(l,2,0,e.selectedFolder&&l.context.$implicit.id===e.selectedFolderId)),n(l,11,0,l.context.$implicit.id)},function(n,l){n(l,8,0,l.context.$implicit.name)})}function C(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,18,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,9,"h3",[["class","d-flex"]],null,null,null,null,null)),(n()(),t.ɵted(3,null,["\n ","\n "])),t.ɵppd(4,1),(n()(),t.ɵeld(5,0,null,null,5,"a",[["appStopClick",""],["class","text-muted ml-auto"],["href","#"]],[[8,"title",0]],[[null,"click"]],function(n,l,e){var u=!0,o=n.component;"click"===l&&(u=!1!==t.ɵnov(n,6).onClick(e)&&u);"click"===l&&(u=!1!==o.addFolder()&&u);return u},null,null)),t.ɵdid(6,16384,null,0,o.StopClickDirective,[],null,null),t.ɵppd(7,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(9,0,null,null,0,"i",[["class","fa fa-plus fa-fw"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(13,0,null,null,4,"ul",[["class","fa-ul card-ul carets"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,y)),t.ɵdid(16,802816,null,0,u.NgForOf,[t.ViewContainerRef,t.TemplateRef,t.IterableDiffers],{ngForOf:[0,"ngForOf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){n(l,16,0,l.component.folders)},function(n,l){n(l,3,0,t.ɵunv(l,3,0,n(l,4,0,t.ɵnov(l.parent.parent,0),"folders"))),n(l,5,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,5,0,n(l,7,0,t.ɵnov(l.parent.parent,0),"addFolder")),""))})}function b(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,9,"li",[],null,null,null,null,null)),t.ɵdid(1,278528,null,0,u.NgClass,[t.IterableDiffers,t.KeyValueDiffers,t.ElementRef,t.Renderer2],{ngClass:[0,"ngClass"]},null),t.ɵpod(2,{active:0}),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(4,0,null,null,4,"a",[["appStopClick",""],["href","#"]],null,[[null,"click"]],function(n,l,e){var u=!0,o=n.component;"click"===l&&(u=!1!==t.ɵnov(n,5).onClick(e)&&u);"click"===l&&(u=!1!==o.selectCollection(n.context.$implicit)&&u);return u},null,null)),t.ɵdid(5,16384,null,0,o.StopClickDirective,[],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(7,0,null,null,0,"i",[["class","fa-li fa fa-caret-right"]],null,null,null,null,null)),(n()(),t.ɵted(8,null,[" ",""])),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){var e=l.component;n(l,1,0,n(l,2,0,l.context.$implicit.id===e.selectedCollectionId))},function(n,l){n(l,8,0,l.context.$implicit.name)})}function S(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,11,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,2,"h3",[],null,null,null,null,null)),(n()(),t.ɵted(3,null,["",""])),t.ɵppd(4,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(6,0,null,null,4,"ul",[["class","fa-ul card-ul carets"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,b)),t.ɵdid(9,802816,null,0,u.NgForOf,[t.ViewContainerRef,t.TemplateRef,t.IterableDiffers],{ngForOf:[0,"ngForOf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){n(l,9,0,l.component.collections)},function(n,l){n(l,3,0,t.ɵunv(l,3,0,n(l,4,0,t.ɵnov(l.parent.parent,0),"collections")))})}function w(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,7,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,C)),t.ɵdid(3,16384,null,0,u.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,S)),t.ɵdid(6,16384,null,0,u.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){var e=l.component;n(l,3,0,e.showFolders),n(l,6,0,e.showCollections&&e.collections&&e.collections.length)},null)}function R(n){return t.ɵvid(0,[t.ɵpid(0,i.I18nPipe,[r.I18nService]),(n()(),t.ɵeld(1,0,null,null,95,"div",[["class","card vault-filters"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(3,0,null,null,1,"div",[["class","card-header"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n Filters\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(6,0,null,null,89,"div",[["class","card-body"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(8,0,null,null,7,"input",[["appAutofocus",""],["class","form-control"],["id","search"],["type","search"]],[[8,"placeholder",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(n,l,e){var u=!0,o=n.component;"input"===l&&(u=!1!==t.ɵnov(n,9)._handleInput(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,9).onTouched()&&u);"compositionstart"===l&&(u=!1!==t.ɵnov(n,9)._compositionStart()&&u);"compositionend"===l&&(u=!1!==t.ɵnov(n,9)._compositionEnd(e.target.value)&&u);"ngModelChange"===l&&(u=!1!==(o.searchText=e)&&u);"input"===l&&(u=!1!==o.searchTextChanged()&&u);return u},null,null)),t.ɵdid(9,16384,null,0,a.DefaultValueAccessor,[t.Renderer2,t.ElementRef,[2,a.COMPOSITION_BUFFER_MODE]],null,null),t.ɵprd(1024,null,a.NG_VALUE_ACCESSOR,function(n){return[n]},[a.DefaultValueAccessor]),t.ɵdid(11,671744,null,0,a.NgModel,[[8,null],[8,null],[8,null],[2,a.NG_VALUE_ACCESSOR]],{model:[0,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,a.NgControl,null,[a.NgModel]),t.ɵdid(13,16384,null,0,a.NgControlStatus,[a.NgControl],null,null),t.ɵdid(14,81920,null,0,s.AutofocusDirective,[t.ElementRef],{appAutofocus:[0,"appAutofocus"]},null),t.ɵppd(15,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(17,0,null,null,16,"ul",[["class","fa-ul card-ul"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(19,0,null,null,10,"li",[],null,null,null,null,null)),t.ɵdid(20,278528,null,0,u.NgClass,[t.IterableDiffers,t.KeyValueDiffers,t.ElementRef,t.Renderer2],{ngClass:[0,"ngClass"]},null),t.ɵpod(21,{active:0}),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(23,0,null,null,5,"a",[["appStopClick",""],["href","#"]],null,[[null,"click"]],function(n,l,e){var u=!0,o=n.component;"click"===l&&(u=!1!==t.ɵnov(n,24).onClick(e)&&u);"click"===l&&(u=!1!==o.selectAll()&&u);return u},null,null)),t.ɵdid(24,16384,null,0,o.StopClickDirective,[],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(26,0,null,null,0,"i",[["class","fa-li fa fa-fw fa-th"]],null,null,null,null,null)),(n()(),t.ɵted(27,null,["","\n "])),t.ɵppd(28,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,h)),t.ɵdid(32,16384,null,0,u.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(35,0,null,null,2,"h3",[],null,null,null,null,null)),(n()(),t.ɵted(36,null,["",""])),t.ɵppd(37,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(39,0,null,null,49,"ul",[["class","fa-ul card-ul"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(41,0,null,null,10,"li",[],null,null,null,null,null)),t.ɵdid(42,278528,null,0,u.NgClass,[t.IterableDiffers,t.KeyValueDiffers,t.ElementRef,t.Renderer2],{ngClass:[0,"ngClass"]},null),t.ɵpod(43,{active:0}),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(45,0,null,null,5,"a",[["appStopClick",""],["href","#"]],null,[[null,"click"]],function(n,l,e){var u=!0,o=n.component;"click"===l&&(u=!1!==t.ɵnov(n,46).onClick(e)&&u);"click"===l&&(u=!1!==o.selectType(o.cipherType.Login)&&u);return u},null,null)),t.ɵdid(46,16384,null,0,o.StopClickDirective,[],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(48,0,null,null,0,"i",[["class","fa-li fa fa-fw fa-globe"]],null,null,null,null,null)),(n()(),t.ɵted(49,null,["","\n "])),t.ɵppd(50,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(53,0,null,null,10,"li",[],null,null,null,null,null)),t.ɵdid(54,278528,null,0,u.NgClass,[t.IterableDiffers,t.KeyValueDiffers,t.ElementRef,t.Renderer2],{ngClass:[0,"ngClass"]},null),t.ɵpod(55,{active:0}),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(57,0,null,null,5,"a",[["appStopClick",""],["href","#"]],null,[[null,"click"]],function(n,l,e){var u=!0,o=n.component;"click"===l&&(u=!1!==t.ɵnov(n,58).onClick(e)&&u);"click"===l&&(u=!1!==o.selectType(o.cipherType.Card)&&u);return u},null,null)),t.ɵdid(58,16384,null,0,o.StopClickDirective,[],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(60,0,null,null,0,"i",[["class","fa-li fa fa-fw fa-credit-card"]],null,null,null,null,null)),(n()(),t.ɵted(61,null,["","\n "])),t.ɵppd(62,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(65,0,null,null,10,"li",[],null,null,null,null,null)),t.ɵdid(66,278528,null,0,u.NgClass,[t.IterableDiffers,t.KeyValueDiffers,t.ElementRef,t.Renderer2],{ngClass:[0,"ngClass"]},null),t.ɵpod(67,{active:0}),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(69,0,null,null,5,"a",[["appStopClick",""],["href","#"]],null,[[null,"click"]],function(n,l,e){var u=!0,o=n.component;"click"===l&&(u=!1!==t.ɵnov(n,70).onClick(e)&&u);"click"===l&&(u=!1!==o.selectType(o.cipherType.Identity)&&u);return u},null,null)),t.ɵdid(70,16384,null,0,o.StopClickDirective,[],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(72,0,null,null,0,"i",[["class","fa-li fa fa-fw fa-id-card-o"]],null,null,null,null,null)),(n()(),t.ɵted(73,null,["","\n "])),t.ɵppd(74,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(77,0,null,null,10,"li",[],null,null,null,null,null)),t.ɵdid(78,278528,null,0,u.NgClass,[t.IterableDiffers,t.KeyValueDiffers,t.ElementRef,t.Renderer2],{ngClass:[0,"ngClass"]},null),t.ɵpod(79,{active:0}),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(81,0,null,null,5,"a",[["appStopClick",""],["href","#"]],null,[[null,"click"]],function(n,l,e){var u=!0,o=n.component;"click"===l&&(u=!1!==t.ɵnov(n,82).onClick(e)&&u);"click"===l&&(u=!1!==o.selectType(o.cipherType.SecureNote)&&u);return u},null,null)),t.ɵdid(82,16384,null,0,o.StopClickDirective,[],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(84,0,null,null,0,"i",[["class","fa-li fa fa-fw fa-sticky-note-o"]],null,null,null,null,null)),(n()(),t.ɵted(85,null,["","\n "])),t.ɵppd(86,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,g)),t.ɵdid(91,16384,null,0,u.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,w)),t.ɵdid(94,16384,null,0,u.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){var e=l.component;n(l,11,0,e.searchText);n(l,14,0,""),n(l,20,0,n(l,21,0,e.selectedAll)),n(l,32,0,e.showFavorites),n(l,42,0,n(l,43,0,e.selectedType===e.cipherType.Login)),n(l,54,0,n(l,55,0,e.selectedType===e.cipherType.Card)),n(l,66,0,n(l,67,0,e.selectedType===e.cipherType.Identity)),n(l,78,0,n(l,79,0,e.selectedType===e.cipherType.SecureNote)),n(l,91,0,!e.loaded),n(l,94,0,e.loaded)},function(n,l){var e=l.component;n(l,8,0,t.ɵinlineInterpolate(1,"",e.searchPlaceholder||t.ɵunv(l,8,0,n(l,15,0,t.ɵnov(l,0),"searchVault")),""),t.ɵnov(l,13).ngClassUntouched,t.ɵnov(l,13).ngClassTouched,t.ɵnov(l,13).ngClassPristine,t.ɵnov(l,13).ngClassDirty,t.ɵnov(l,13).ngClassValid,t.ɵnov(l,13).ngClassInvalid,t.ɵnov(l,13).ngClassPending),n(l,27,0,t.ɵunv(l,27,0,n(l,28,0,t.ɵnov(l,0),"allItems"))),n(l,36,0,t.ɵunv(l,36,0,n(l,37,0,t.ɵnov(l,0),"types"))),n(l,49,0,t.ɵunv(l,49,0,n(l,50,0,t.ɵnov(l,0),"typeLogin"))),n(l,61,0,t.ɵunv(l,61,0,n(l,62,0,t.ɵnov(l,0),"typeCard"))),n(l,73,0,t.ɵunv(l,73,0,n(l,74,0,t.ɵnov(l,0),"typeIdentity"))),n(l,85,0,t.ɵunv(l,85,0,n(l,86,0,t.ɵnov(l,0),"typeSecureNote")))})}function _(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"app-org-vault-groupings",[],null,null,null,R,v)),t.ɵdid(1,49152,null,0,d.GroupingsComponent,[c.CollectionService,p.FolderService,f.ApiService,r.I18nService],null,null)],null,null)}l.RenderType_GroupingsComponent=v,l.View_GroupingsComponent_0=R,l.View_GroupingsComponent_Host_0=_;var I=t.ɵccf("app-org-vault-groupings",d.GroupingsComponent,_,{showFolders:"showFolders",showCollections:"showCollections",showFavorites:"showFavorites"},{onAllClicked:"onAllClicked",onFavoritesClicked:"onFavoritesClicked",onCipherTypeClicked:"onCipherTypeClicked",onFolderClicked:"onFolderClicked",onAddFolder:"onAddFolder",onEditFolder:"onEditFolder",onCollectionClicked:"onCollectionClicked",onSearchTextChanged:"onSearchTextChanged"},[]);l.GroupingsComponentNgFactory=I},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=e(0),u=e(7),o=e(2),i=e(729),r=e(257),a=e(44),s=e(50),d=e(4),c=e(728),p=e(256),f=e(26),v=e(3),h=e(9),g=e(8),m=e(255),y=e(10),C=e(21),b=e(5),S=e(66),w=e(27),R=t.ɵcrt({encapsulation:2,styles:[],data:{}});function _(n){return t.ɵvid(0,[(n()(),t.ɵand(0,null,null,0))],null,null)}function I(n){return t.ɵvid(0,[(n()(),t.ɵand(0,null,null,0))],null,null)}function A(n){return t.ɵvid(0,[(n()(),t.ɵand(0,null,null,0))],null,null)}function E(n){return t.ɵvid(0,[(n()(),t.ɵand(0,null,null,0))],null,null)}function O(n){return t.ɵvid(0,[t.ɵpid(0,u.I18nPipe,[o.I18nService]),t.ɵqud(402653184,1,{groupingsComponent:0}),t.ɵqud(402653184,2,{ciphersComponent:0}),t.ɵqud(402653184,3,{attachmentsModalRef:0}),t.ɵqud(402653184,4,{cipherAddEditModalRef:0}),t.ɵqud(402653184,5,{collectionsModalRef:0}),t.ɵqud(402653184,6,{eventsModalRef:0}),(n()(),t.ɵeld(7,0,null,null,31,"div",[["class","container page-content"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(9,0,null,null,28,"div",[["class","row"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(11,0,null,null,5,"div",[["class","col-3"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(13,0,null,null,2,"app-org-vault-groupings",[],null,[[null,"onAllClicked"],[null,"onCipherTypeClicked"],[null,"onCollectionClicked"],[null,"onSearchTextChanged"]],function(n,l,e){var t=!0,u=n.component;"onAllClicked"===l&&(t=!1!==u.clearGroupingFilters()&&t);"onCipherTypeClicked"===l&&(t=!1!==u.filterCipherType(e)&&t);"onCollectionClicked"===l&&(t=!1!==u.filterCollection(e.id)&&t);"onSearchTextChanged"===l&&(t=!1!==u.filterSearchText(e)&&t);return t},i.View_GroupingsComponent_0,i.RenderType_GroupingsComponent)),t.ɵdid(14,49152,[[1,4]],0,r.GroupingsComponent,[a.CollectionService,s.FolderService,d.ApiService,o.I18nService],{showFolders:[0,"showFolders"],showFavorites:[1,"showFavorites"]},{onAllClicked:"onAllClicked",onCipherTypeClicked:"onCipherTypeClicked",onCollectionClicked:"onCollectionClicked",onSearchTextChanged:"onSearchTextChanged"}),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(18,0,null,null,18,"div",[["class","col-9"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(20,0,null,null,11,"div",[["class","page-header d-flex"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(22,0,null,null,2,"h1",[],null,null,null,null,null)),(n()(),t.ɵted(23,null,["",""])),t.ɵppd(24,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(26,0,null,null,4,"button",[["class","btn btn-outline-primary btn-sm ml-auto"],["type","button"]],null,[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.addCipher()&&t);return t},null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(28,0,null,null,0,"i",[["class","fa fa-plus fa-fw"]],null,null,null,null,null)),(n()(),t.ɵted(29,null,["","\n "])),t.ɵppd(30,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(33,0,null,null,2,"app-org-vault-ciphers",[],null,[[null,"onCipherClicked"],[null,"onAttachmentsClicked"],[null,"onAddCipher"],[null,"onCollectionsClicked"],[null,"onEventsClicked"]],function(n,l,e){var t=!0,u=n.component;"onCipherClicked"===l&&(t=!1!==u.editCipher(e)&&t);"onAttachmentsClicked"===l&&(t=!1!==u.editCipherAttachments(e)&&t);"onAddCipher"===l&&(t=!1!==u.addCipher()&&t);"onCollectionsClicked"===l&&(t=!1!==u.editCipherCollections(e)&&t);"onEventsClicked"===l&&(t=!1!==u.viewEvents(e)&&t);return t},c.View_CiphersComponent_0,c.RenderType_CiphersComponent)),t.ɵdid(34,49152,[[2,4]],0,p.CiphersComponent,[f.CipherService,v.Angulartics2,h.ToasterService,o.I18nService,g.PlatformUtilsService,d.ApiService],null,{onCipherClicked:"onCipherClicked",onAddCipher:"onAddCipher",onAttachmentsClicked:"onAttachmentsClicked",onCollectionsClicked:"onCollectionsClicked",onEventsClicked:"onEventsClicked"}),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,[[3,3],["attachments",2]],null,0,null,_)),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,[[4,3],["cipherAddEdit",2]],null,0,null,I)),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,[[5,3],["collections",2]],null,0,null,A)),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,[[6,3],["eventsTemplate",2]],null,0,null,E)),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){n(l,14,0,!1,!1)},function(n,l){n(l,23,0,t.ɵunv(l,23,0,n(l,24,0,t.ɵnov(l,0),"vault"))),n(l,29,0,t.ɵunv(l,29,0,n(l,30,0,t.ɵnov(l,0),"addItem")))})}function N(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"app-org-vault",[],null,null,null,O,R)),t.ɵdid(1,114688,null,0,m.VaultComponent,[y.ActivatedRoute,C.UserService,b.Location,y.Router,S.SyncService,o.I18nService,t.ComponentFactoryResolver,w.MessagingService],null,null)],function(n,l){n(l,1,0)},null)}l.RenderType_VaultComponent=R,l.View_VaultComponent_0=O,l.View_VaultComponent_Host_0=N;var T=t.ɵccf("app-org-vault",m.VaultComponent,N,{},{},[]);l.VaultComponentNgFactory=T},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=e(0),u=e(10),o=e(5),i=e(130),r=e(116),a=e(42),s=e(7),d=e(2),c=e(569),p=e(284),f=e(27),v=e(8),h=e(35),g=e(568),m=e(283),y=e(258),C=e(21),b=t.ɵcrt({encapsulation:2,styles:[],data:{}});function S(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,11,"li",[["class","nav-item"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,8,"a",[["class","nav-link"],["routerLink","settings"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(n,l,e){var u=!0;"click"===l&&(u=!1!==t.ɵnov(n,3).onClick(e.button,e.ctrlKey,e.metaKey,e.shiftKey)&&u);return u},null,null)),t.ɵdid(3,671744,[[8,4]],0,u.RouterLinkWithHref,[u.Router,u.ActivatedRoute,o.LocationStrategy],{routerLink:[0,"routerLink"]},null),t.ɵdid(4,1720320,null,2,u.RouterLinkActive,[u.Router,t.ElementRef,t.Renderer2,t.ChangeDetectorRef],{routerLinkActive:[0,"routerLinkActive"]},null),t.ɵqud(603979776,7,{links:1}),t.ɵqud(603979776,8,{linksWithHrefs:1}),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(8,0,null,null,0,"i",[["class","fa fa-cogs"]],null,null,null,null,null)),(n()(),t.ɵted(9,null,["\n ","\n "])),t.ɵppd(10,1),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){n(l,3,0,"settings");n(l,4,0,"active")},function(n,l){n(l,2,0,t.ɵnov(l,3).target,t.ɵnov(l,3).href),n(l,9,0,t.ɵunv(l,9,0,n(l,10,0,t.ɵnov(l.parent.parent.parent,0),"settings")))})}function w(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,43,"ul",[["class","nav nav-tabs"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,11,"li",[["class","nav-item"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(4,0,null,null,8,"a",[["class","nav-link"],["routerLink","vault"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(n,l,e){var u=!0;"click"===l&&(u=!1!==t.ɵnov(n,5).onClick(e.button,e.ctrlKey,e.metaKey,e.shiftKey)&&u);return u},null,null)),t.ɵdid(5,671744,[[2,4]],0,u.RouterLinkWithHref,[u.Router,u.ActivatedRoute,o.LocationStrategy],{routerLink:[0,"routerLink"]},null),t.ɵdid(6,1720320,null,2,u.RouterLinkActive,[u.Router,t.ElementRef,t.Renderer2,t.ChangeDetectorRef],{routerLinkActive:[0,"routerLinkActive"]},null),t.ɵqud(603979776,1,{links:1}),t.ɵqud(603979776,2,{linksWithHrefs:1}),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(10,0,null,null,0,"i",[["class","fa fa-lock"]],null,null,null,null,null)),(n()(),t.ɵted(11,null,["\n ","\n "])),t.ɵppd(12,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(15,0,null,null,11,"li",[["class","nav-item"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(17,0,null,null,8,"a",[["class","nav-link"],["routerLink","manage"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(n,l,e){var u=!0;"click"===l&&(u=!1!==t.ɵnov(n,18).onClick(e.button,e.ctrlKey,e.metaKey,e.shiftKey)&&u);return u},null,null)),t.ɵdid(18,671744,[[4,4]],0,u.RouterLinkWithHref,[u.Router,u.ActivatedRoute,o.LocationStrategy],{routerLink:[0,"routerLink"]},null),t.ɵdid(19,1720320,null,2,u.RouterLinkActive,[u.Router,t.ElementRef,t.Renderer2,t.ChangeDetectorRef],{routerLinkActive:[0,"routerLinkActive"]},null),t.ɵqud(603979776,3,{links:1}),t.ɵqud(603979776,4,{linksWithHrefs:1}),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(23,0,null,null,0,"i",[["class","fa fa-sliders"]],null,null,null,null,null)),(n()(),t.ɵted(24,null,["\n ","\n "])),t.ɵppd(25,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(28,0,null,null,11,"li",[["class","nav-item"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(30,0,null,null,8,"a",[["class","nav-link"],["routerLink","tools"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(n,l,e){var u=!0;"click"===l&&(u=!1!==t.ɵnov(n,31).onClick(e.button,e.ctrlKey,e.metaKey,e.shiftKey)&&u);return u},null,null)),t.ɵdid(31,671744,[[6,4]],0,u.RouterLinkWithHref,[u.Router,u.ActivatedRoute,o.LocationStrategy],{routerLink:[0,"routerLink"]},null),t.ɵdid(32,1720320,null,2,u.RouterLinkActive,[u.Router,t.ElementRef,t.Renderer2,t.ChangeDetectorRef],{routerLinkActive:[0,"routerLinkActive"]},null),t.ɵqud(603979776,5,{links:1}),t.ɵqud(603979776,6,{linksWithHrefs:1}),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(36,0,null,null,0,"i",[["class","fa fa-wrench"]],null,null,null,null,null)),(n()(),t.ɵted(37,null,["\n ","\n "])),t.ɵppd(38,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,S)),t.ɵdid(42,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){var e=l.component;n(l,5,0,"vault");n(l,6,0,"active");n(l,18,0,"manage");n(l,19,0,"active");n(l,31,0,"tools");n(l,32,0,"active"),n(l,42,0,e.organization.isOwner)},function(n,l){n(l,4,0,t.ɵnov(l,5).target,t.ɵnov(l,5).href),n(l,11,0,t.ɵunv(l,11,0,n(l,12,0,t.ɵnov(l.parent.parent,0),"vault"))),n(l,17,0,t.ɵnov(l,18).target,t.ɵnov(l,18).href),n(l,24,0,t.ɵunv(l,24,0,n(l,25,0,t.ɵnov(l.parent.parent,0),"manage"))),n(l,30,0,t.ɵnov(l,31).target,t.ɵnov(l,31).href),n(l,37,0,t.ɵunv(l,37,0,n(l,38,0,t.ɵnov(l.parent.parent,0),"tools")))})}function R(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,23,"div",[["class","org-nav"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,20,"div",[["class","container d-flex flex-column"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(4,0,null,null,14,"div",[["class","my-auto d-flex align-items-center pl-1"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(6,0,null,null,1,"app-avatar",[],null,null,null,i.View_AvatarComponent_0,i.RenderType_AvatarComponent)),t.ɵdid(7,638976,null,0,r.AvatarComponent,[a.DomSanitizer],{data:[0,"data"],width:[1,"width"],height:[2,"height"],circle:[3,"circle"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(9,0,null,null,8,"div",[["class","org-name ml-3"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(11,0,null,null,1,"span",[],null,null,null,null,null)),(n()(),t.ɵted(12,null,["",""])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(14,0,null,null,2,"small",[["class","text-muted"]],null,null,null,null,null)),(n()(),t.ɵted(15,null,["",""])),t.ɵppd(16,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,w)),t.ɵdid(21,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){var e=l.component;n(l,7,0,e.organization.name,45,45,!0),n(l,21,0,e.organization.isAdmin)},function(n,l){n(l,12,0,l.component.organization.name),n(l,15,0,t.ɵunv(l,15,0,n(l,16,0,t.ɵnov(l.parent,0),"organization")))})}function _(n){return t.ɵvid(0,[t.ɵpid(0,s.I18nPipe,[d.I18nService]),(n()(),t.ɵeld(1,0,null,null,1,"app-navbar",[],null,null,null,c.View_NavbarComponent_0,c.RenderType_NavbarComponent)),t.ɵdid(2,114688,null,0,p.NavbarComponent,[f.MessagingService,v.PlatformUtilsService,h.TokenService],null,null),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,null,null,1,null,R)),t.ɵdid(5,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵeld(7,16777216,null,null,1,"router-outlet",[],null,null,null,null,null)),t.ɵdid(8,212992,null,0,u.RouterOutlet,[u.ChildrenOutletContexts,t.ViewContainerRef,t.ComponentFactoryResolver,[8,null],t.ChangeDetectorRef],null,null),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵeld(10,0,null,null,1,"app-footer",[],null,null,null,g.View_FooterComponent_0,g.RenderType_FooterComponent)),t.ɵdid(11,114688,null,0,m.FooterComponent,[v.PlatformUtilsService],null,null),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){var e=l.component;n(l,2,0),n(l,5,0,e.organization),n(l,8,0),n(l,11,0)},null)}function I(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"app-organization-layout",[],null,null,null,_,b)),t.ɵdid(1,114688,null,0,y.OrganizationLayoutComponent,[u.ActivatedRoute,C.UserService],null,null)],function(n,l){n(l,1,0)},null)}l.RenderType_OrganizationLayoutComponent=b,l.View_OrganizationLayoutComponent_0=_,l.View_OrganizationLayoutComponent_Host_0=I;var A=t.ɵccf("app-organization-layout",y.OrganizationLayoutComponent,I,{},{},[]);l.OrganizationLayoutComponentNgFactory=A},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=e(0),u=e(40),o=e(37),i=e(2),r=e(5),a=e(7),s=e(13),d=e(18),c=e(17),p=e(259),f=e(129),v=e(21),h=t.ɵcrt({encapsulation:2,styles:[],data:{}});function g(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,2,"p",[],null,null,null,null,null)),(n()(),t.ɵted(1,null,["","..."])),t.ɵppd(2,1)],null,function(n,l){n(l,1,0,t.ɵunv(l,1,0,n(l,2,0,t.ɵnov(l.parent.parent,0),"reportError")))})}function m(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,4,"app-callout",[["type","success"]],null,null,null,u.View_CalloutComponent_0,u.RenderType_CalloutComponent)),t.ɵdid(1,114688,null,0,o.CalloutComponent,[i.I18nService],{type:[0,"type"],title:[1,"title"]},null),t.ɵppd(2,1),(n()(),t.ɵted(3,0,["\n ","\n "])),t.ɵppd(4,2)],function(n,l){n(l,1,0,"success",t.ɵinlineInterpolate(1,"",t.ɵunv(l,1,1,n(l,2,0,t.ɵnov(l.parent.parent.parent,0),"goodNews")),""))},function(n,l){var e=l.component;n(l,3,0,t.ɵunv(l,3,0,n(l,4,0,t.ɵnov(l.parent.parent.parent,0),"breachUsernameNotFound",e.checkedUsername)))})}function y(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,4,"app-callout",[["type","danger"]],null,null,null,u.View_CalloutComponent_0,u.RenderType_CalloutComponent)),t.ɵdid(1,114688,null,0,o.CalloutComponent,[i.I18nService],{type:[0,"type"],title:[1,"title"]},null),t.ɵppd(2,1),(n()(),t.ɵted(3,0,["\n ","\n "])),t.ɵppd(4,3)],function(n,l){n(l,1,0,"danger",t.ɵinlineInterpolate(1,"",t.ɵunv(l,1,1,n(l,2,0,t.ɵnov(l.parent.parent.parent,0),"breachFound")),""))},function(n,l){var e=l.component;n(l,3,0,t.ɵunv(l,3,0,n(l,4,0,t.ɵnov(l.parent.parent.parent,0),"breachUsernameFound",e.checkedUsername,e.breachedAccounts.length)))})}function C(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"li",[],null,null,null,null,null)),(n()(),t.ɵted(1,null,["",""]))],null,function(n,l){n(l,1,0,l.context.$implicit)})}function b(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,64,"li",[["class","list-group-item min-height-fix"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,61,"div",[["class","row"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(4,0,null,null,3,"div",[["class","col-2 text-center"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(6,0,null,null,0,"img",[["alt",""],["class","img-fluid"]],[[8,"src",4]],null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(9,0,null,null,16,"div",[["class","col-7"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(11,0,null,null,1,"h3",[["class","text-lg"]],null,null,null,null,null)),(n()(),t.ɵted(12,null,["",""])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(14,0,null,null,0,"p",[],[[8,"innerHTML",1]],null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(16,0,null,null,2,"p",[["class","mb-1"]],null,null,null,null,null)),(n()(),t.ɵted(17,null,["",":"])),t.ɵppd(18,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(20,0,null,null,4,"ul",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,C)),t.ɵdid(23,802816,null,0,r.NgForOf,[t.ViewContainerRef,t.TemplateRef,t.IterableDiffers],{ngForOf:[0,"ngForOf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(27,0,null,null,35,"div",[["class","col-3"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(29,0,null,null,32,"dl",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(31,0,null,null,2,"dt",[],null,null,null,null,null)),(n()(),t.ɵted(32,null,["",""])),t.ɵppd(33,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(35,0,null,null,1,"dd",[],null,null,null,null,null)),(n()(),t.ɵted(36,null,["",""])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(38,0,null,null,2,"dt",[],null,null,null,null,null)),(n()(),t.ɵted(39,null,["",""])),t.ɵppd(40,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(42,0,null,null,2,"dd",[],null,null,null,null,null)),(n()(),t.ɵted(43,null,["",""])),t.ɵppd(44,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(46,0,null,null,2,"dt",[],null,null,null,null,null)),(n()(),t.ɵted(47,null,["",""])),t.ɵppd(48,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(50,0,null,null,2,"dd",[],null,null,null,null,null)),(n()(),t.ɵted(51,null,["",""])),t.ɵppd(52,2),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(54,0,null,null,2,"dt",[],null,null,null,null,null)),(n()(),t.ɵted(55,null,["",""])),t.ɵppd(56,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(58,0,null,null,2,"dd",[],null,null,null,null,null)),(n()(),t.ɵted(59,null,["",""])),t.ɵppd(60,2),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){n(l,23,0,l.context.$implicit.dataClasses)},function(n,l){n(l,6,0,"https://haveibeenpwned.com/Content/Images/PwnedLogos/"+l.context.$implicit.name+"."+l.context.$implicit.logoType),n(l,12,0,l.context.$implicit.title),n(l,14,0,l.context.$implicit.description),n(l,17,0,t.ɵunv(l,17,0,n(l,18,0,t.ɵnov(l.parent.parent.parent.parent,0),"compromisedData"))),n(l,32,0,t.ɵunv(l,32,0,n(l,33,0,t.ɵnov(l.parent.parent.parent.parent,0),"website"))),n(l,36,0,l.context.$implicit.domain),n(l,39,0,t.ɵunv(l,39,0,n(l,40,0,t.ɵnov(l.parent.parent.parent.parent,0),"affectedUsers"))),n(l,43,0,t.ɵunv(l,43,0,n(l,44,0,t.ɵnov(l.parent.parent.parent.parent,1),l.context.$implicit.pwnCount))),n(l,47,0,t.ɵunv(l,47,0,n(l,48,0,t.ɵnov(l.parent.parent.parent.parent,0),"breachOccurred"))),n(l,51,0,t.ɵunv(l,51,0,n(l,52,0,t.ɵnov(l.parent.parent.parent.parent,2),l.context.$implicit.breachDate,"mediumDate"))),n(l,55,0,t.ɵunv(l,55,0,n(l,56,0,t.ɵnov(l.parent.parent.parent.parent,0),"breachReported"))),n(l,59,0,t.ɵunv(l,59,0,n(l,60,0,t.ɵnov(l.parent.parent.parent.parent,2),l.context.$implicit.addedDate,"mediumDate")))})}function S(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,4,"ul",[["class","list-group list-group-breach"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,b)),t.ɵdid(3,802816,null,0,r.NgForOf,[t.ViewContainerRef,t.TemplateRef,t.IterableDiffers],{ngForOf:[0,"ngForOf"]},null),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){n(l,3,0,l.component.breachedAccounts)},null)}function w(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,10,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,m)),t.ɵdid(3,16384,null,0,r.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,y)),t.ɵdid(6,16384,null,0,r.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,S)),t.ɵdid(9,16384,null,0,r.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){var e=l.component;n(l,3,0,!e.breachedAccounts.length),n(l,6,0,e.breachedAccounts.length),n(l,9,0,e.breachedAccounts.length)},null)}function R(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,7,"div",[["class","mt-4"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,g)),t.ɵdid(3,16384,null,0,r.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,w)),t.ɵdid(6,16384,null,0,r.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){var e=l.component;n(l,3,0,e.error),n(l,6,0,!e.error)},null)}function _(n){return t.ɵvid(0,[t.ɵpid(0,a.I18nPipe,[i.I18nService]),t.ɵpid(0,r.DecimalPipe,[t.LOCALE_ID]),t.ɵpid(0,r.DatePipe,[t.LOCALE_ID]),(n()(),t.ɵeld(3,0,null,null,5,"div",[["class","page-header"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(5,0,null,null,2,"h1",[],null,null,null,null,null)),(n()(),t.ɵted(6,null,["",""])),t.ɵppd(7,1),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵeld(10,0,null,null,2,"p",[],null,null,null,null,null)),(n()(),t.ɵted(11,null,["",""])),t.ɵppd(12,1),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵeld(14,0,[["form",1]],null,38,"form",[["ngNativeValidate",""]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngSubmit"],[null,"submit"],[null,"reset"]],function(n,l,e){var u=!0,o=n.component;"submit"===l&&(u=!1!==t.ɵnov(n,15).onSubmit(e)&&u);"reset"===l&&(u=!1!==t.ɵnov(n,15).onReset()&&u);"ngSubmit"===l&&(u=!1!==o.submit()&&u);return u},null,null)),t.ɵdid(15,4210688,null,0,s.NgForm,[[8,null],[8,null]],null,{ngSubmit:"ngSubmit"}),t.ɵprd(2048,null,s.ControlContainer,null,[s.NgForm]),t.ɵdid(17,16384,null,0,s.NgControlStatusGroup,[s.ControlContainer],null,null),t.ɵdid(18,540672,null,0,d.ApiActionDirective,[t.ElementRef,c.ValidationService],{appApiAction:[0,"appApiAction"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(20,0,null,null,21,"div",[["class","row"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(22,0,null,null,18,"div",[["class","form-group col-6"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(24,0,null,null,2,"label",[["for","username"]],null,null,null,null,null)),(n()(),t.ɵted(25,null,["",""])),t.ɵppd(26,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(28,0,null,null,7,"input",[["class","form-control"],["id","username"],["name","Username"],["required",""],["type","text"]],[[1,"required",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(n,l,e){var u=!0,o=n.component;"input"===l&&(u=!1!==t.ɵnov(n,29)._handleInput(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,29).onTouched()&&u);"compositionstart"===l&&(u=!1!==t.ɵnov(n,29)._compositionStart()&&u);"compositionend"===l&&(u=!1!==t.ɵnov(n,29)._compositionEnd(e.target.value)&&u);"ngModelChange"===l&&(u=!1!==(o.username=e)&&u);return u},null,null)),t.ɵdid(29,16384,null,0,s.DefaultValueAccessor,[t.Renderer2,t.ElementRef,[2,s.COMPOSITION_BUFFER_MODE]],null,null),t.ɵdid(30,16384,null,0,s.RequiredValidator,[],{required:[0,"required"]},null),t.ɵprd(1024,null,s.NG_VALIDATORS,function(n){return[n]},[s.RequiredValidator]),t.ɵprd(1024,null,s.NG_VALUE_ACCESSOR,function(n){return[n]},[s.DefaultValueAccessor]),t.ɵdid(33,671744,null,0,s.NgModel,[[2,s.ControlContainer],[2,s.NG_VALIDATORS],[8,null],[2,s.NG_VALUE_ACCESSOR]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,s.NgControl,null,[s.NgModel]),t.ɵdid(35,16384,null,0,s.NgControlStatus,[s.NgControl],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(37,0,null,null,2,"small",[["class","form-text text-muted"]],null,null,null,null,null)),(n()(),t.ɵted(38,null,["",""])),t.ɵppd(39,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(43,0,null,null,8,"button",[["class","btn btn-primary btn-submit"],["type","submit"]],[[8,"disabled",0]],null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(45,0,null,null,1,"i",[["class","fa fa-spinner fa-spin"]],[[8,"title",0]],null,null,null,null)),t.ɵppd(46,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(48,0,null,null,2,"span",[],null,null,null,null,null)),(n()(),t.ɵted(49,null,["",""])),t.ɵppd(50,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,null,null,1,null,R)),t.ɵdid(55,16384,null,0,r.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){var e=l.component;n(l,18,0,e.formPromise);n(l,30,0,"");n(l,33,0,"Username",e.username),n(l,55,0,!t.ɵnov(l,14).loading&&e.checkedUsername)},function(n,l){n(l,6,0,t.ɵunv(l,6,0,n(l,7,0,t.ɵnov(l,0),"dataBreachReport"))),n(l,11,0,t.ɵunv(l,11,0,n(l,12,0,t.ɵnov(l,0),"breachDesc"))),n(l,14,0,t.ɵnov(l,17).ngClassUntouched,t.ɵnov(l,17).ngClassTouched,t.ɵnov(l,17).ngClassPristine,t.ɵnov(l,17).ngClassDirty,t.ɵnov(l,17).ngClassValid,t.ɵnov(l,17).ngClassInvalid,t.ɵnov(l,17).ngClassPending),n(l,25,0,t.ɵunv(l,25,0,n(l,26,0,t.ɵnov(l,0),"username"))),n(l,28,0,t.ɵnov(l,30).required?"":null,t.ɵnov(l,35).ngClassUntouched,t.ɵnov(l,35).ngClassTouched,t.ɵnov(l,35).ngClassPristine,t.ɵnov(l,35).ngClassDirty,t.ɵnov(l,35).ngClassValid,t.ɵnov(l,35).ngClassInvalid,t.ɵnov(l,35).ngClassPending),n(l,38,0,t.ɵunv(l,38,0,n(l,39,0,t.ɵnov(l,0),"breachCheckUsernameEmail"))),n(l,43,0,t.ɵnov(l,14).loading),n(l,45,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,45,0,n(l,46,0,t.ɵnov(l,0),"loading")),"")),n(l,49,0,t.ɵunv(l,49,0,n(l,50,0,t.ɵnov(l,0),"checkBreaches")))})}function I(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"app-breach-report",[],null,null,null,_,h)),t.ɵdid(1,114688,null,0,p.BreachReportComponent,[f.AuditService,v.UserService],null,null)],function(n,l){n(l,1,0)},null)}l.RenderType_BreachReportComponent=h,l.View_BreachReportComponent_0=_,l.View_BreachReportComponent_Host_0=I;var A=t.ɵccf("app-breach-report",p.BreachReportComponent,I,{},{},[]);l.BreachReportComponentNgFactory=A},function(n,l,e){"use strict";var t=this&&this.__awaiter||function(n,l,e,t){return new(e||(e=Promise))(function(u,o){function i(n){try{a(t.next(n))}catch(n){o(n)}}function r(n){try{a(t.throw(n))}catch(n){o(n)}}function a(n){n.done?u(n.value):new e(function(l){l(n.value)}).then(i,r)}a((t=t.apply(n,l||[])).next())})},u=this&&this.__generator||function(n,l){var e,t,u,o,i={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return o={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function r(o){return function(r){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;i;)try{if(e=1,t&&(u=t[2&o[0]?"return":o[0]?"throw":"next"])&&!(u=u.call(t,o[1])).done)return u;switch(t=0,u&&(o=[0,u.value]),o[0]){case 0:case 1:u=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,t=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(u=(u=i.trys).length>0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]128&&(this.options.length=128),this.options.minNumber?this.options.minNumber>this.options.length?this.options.minNumber=this.options.length:this.options.minNumber>9&&(this.options.minNumber=9):this.options.minNumber=0,this.options.minSpecial?this.options.minSpecial>this.options.length?this.options.minSpecial=this.options.length:this.options.minSpecial>9&&(this.options.minSpecial=9):this.options.minSpecial=0,this.options.minSpecial+this.options.minNumber>this.options.length&&(this.options.minSpecial=this.options.length-this.options.minNumber)},n}();l.PasswordGeneratorComponent=i},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=e(0),u=e(7),o=e(2),i=e(13),r=e(260),a=e(94),s=e(3),d=e(8),c=e(9),p=t.ɵcrt({encapsulation:2,styles:[],data:{}});function f(n){return t.ɵvid(0,[(n()(),t.ɵand(0,null,null,0))],null,null)}function v(n){return t.ɵvid(0,[t.ɵpid(0,u.I18nPipe,[o.I18nService]),t.ɵqud(402653184,1,{historyModalRef:0}),(n()(),t.ɵeld(2,0,null,null,5,"div",[["class","page-header"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(4,0,null,null,2,"h1",[],null,null,null,null,null)),(n()(),t.ɵted(5,null,["",""])),t.ɵppd(6,1),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵeld(9,0,null,null,4,"div",[["class","card card-password bg-light my-4"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(11,0,null,null,1,"div",[["class","card-body"]],null,null,null,null,null)),(n()(),t.ɵted(12,null,["\n ","\n "])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵeld(15,0,null,null,46,"div",[["class","row"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(17,0,null,null,13,"div",[["class","form-group col-4"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(19,0,null,null,2,"label",[["for","length"]],null,null,null,null,null)),(n()(),t.ɵted(20,null,["",""])),t.ɵppd(21,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(23,0,null,null,6,"input",[["class","form-control"],["id","length"],["max","128"],["min","5"],["type","number"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"],[null,"change"]],function(n,l,e){var u=!0,o=n.component;"input"===l&&(u=!1!==t.ɵnov(n,24)._handleInput(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,24).onTouched()&&u);"compositionstart"===l&&(u=!1!==t.ɵnov(n,24)._compositionStart()&&u);"compositionend"===l&&(u=!1!==t.ɵnov(n,24)._compositionEnd(e.target.value)&&u);"change"===l&&(u=!1!==t.ɵnov(n,25).onChange(e.target.value)&&u);"input"===l&&(u=!1!==t.ɵnov(n,25).onChange(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,25).onTouched()&&u);"ngModelChange"===l&&(u=!1!==(o.options.length=e)&&u);"input"===l&&(u=!1!==o.saveOptions()&&u);return u},null,null)),t.ɵdid(24,16384,null,0,i.DefaultValueAccessor,[t.Renderer2,t.ElementRef,[2,i.COMPOSITION_BUFFER_MODE]],null,null),t.ɵdid(25,16384,null,0,i.ɵbc,[t.Renderer2,t.ElementRef],null,null),t.ɵprd(1024,null,i.NG_VALUE_ACCESSOR,function(n,l){return[n,l]},[i.DefaultValueAccessor,i.ɵbc]),t.ɵdid(27,671744,null,0,i.NgModel,[[8,null],[8,null],[8,null],[2,i.NG_VALUE_ACCESSOR]],{model:[0,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,i.NgControl,null,[i.NgModel]),t.ɵdid(29,16384,null,0,i.NgControlStatus,[i.NgControl],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(32,0,null,null,13,"div",[["class","form-group col-4"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(34,0,null,null,2,"label",[["for","min-number"]],null,null,null,null,null)),(n()(),t.ɵted(35,null,["",""])),t.ɵppd(36,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(38,0,null,null,6,"input",[["class","form-control"],["id","min-number"],["max","9"],["min","0"],["type","number"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"input"],[null,"ngModelChange"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"],[null,"change"]],function(n,l,e){var u=!0,o=n.component;"input"===l&&(u=!1!==t.ɵnov(n,39)._handleInput(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,39).onTouched()&&u);"compositionstart"===l&&(u=!1!==t.ɵnov(n,39)._compositionStart()&&u);"compositionend"===l&&(u=!1!==t.ɵnov(n,39)._compositionEnd(e.target.value)&&u);"change"===l&&(u=!1!==t.ɵnov(n,40).onChange(e.target.value)&&u);"input"===l&&(u=!1!==t.ɵnov(n,40).onChange(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,40).onTouched()&&u);"input"===l&&(u=!1!==o.saveOptions()&&u);"ngModelChange"===l&&(u=!1!==(o.options.minNumber=e)&&u);return u},null,null)),t.ɵdid(39,16384,null,0,i.DefaultValueAccessor,[t.Renderer2,t.ElementRef,[2,i.COMPOSITION_BUFFER_MODE]],null,null),t.ɵdid(40,16384,null,0,i.ɵbc,[t.Renderer2,t.ElementRef],null,null),t.ɵprd(1024,null,i.NG_VALUE_ACCESSOR,function(n,l){return[n,l]},[i.DefaultValueAccessor,i.ɵbc]),t.ɵdid(42,671744,null,0,i.NgModel,[[8,null],[8,null],[8,null],[2,i.NG_VALUE_ACCESSOR]],{model:[0,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,i.NgControl,null,[i.NgModel]),t.ɵdid(44,16384,null,0,i.NgControlStatus,[i.NgControl],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(47,0,null,null,13,"div",[["class","form-group col-4"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(49,0,null,null,2,"label",[["for","min-special"]],null,null,null,null,null)),(n()(),t.ɵted(50,null,["",""])),t.ɵppd(51,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(53,0,null,null,6,"input",[["class","form-control"],["id","min-special"],["max","9"],["min","0"],["type","number"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"input"],[null,"ngModelChange"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"],[null,"change"]],function(n,l,e){var u=!0,o=n.component;"input"===l&&(u=!1!==t.ɵnov(n,54)._handleInput(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,54).onTouched()&&u);"compositionstart"===l&&(u=!1!==t.ɵnov(n,54)._compositionStart()&&u);"compositionend"===l&&(u=!1!==t.ɵnov(n,54)._compositionEnd(e.target.value)&&u);"change"===l&&(u=!1!==t.ɵnov(n,55).onChange(e.target.value)&&u);"input"===l&&(u=!1!==t.ɵnov(n,55).onChange(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,55).onTouched()&&u);"input"===l&&(u=!1!==o.saveOptions()&&u);"ngModelChange"===l&&(u=!1!==(o.options.minSpecial=e)&&u);return u},null,null)),t.ɵdid(54,16384,null,0,i.DefaultValueAccessor,[t.Renderer2,t.ElementRef,[2,i.COMPOSITION_BUFFER_MODE]],null,null),t.ɵdid(55,16384,null,0,i.ɵbc,[t.Renderer2,t.ElementRef],null,null),t.ɵprd(1024,null,i.NG_VALUE_ACCESSOR,function(n,l){return[n,l]},[i.DefaultValueAccessor,i.ɵbc]),t.ɵdid(57,671744,null,0,i.NgModel,[[8,null],[8,null],[8,null],[2,i.NG_VALUE_ACCESSOR]],{model:[0,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,i.NgControl,null,[i.NgModel]),t.ɵdid(59,16384,null,0,i.NgControlStatus,[i.NgControl],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵeld(63,0,null,null,67,"div",[["class","form-group"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(65,0,null,null,11,"div",[["class","form-check"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(67,0,null,null,5,"input",[["class","form-check-input"],["id","uppercase"],["type","checkbox"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"change"],[null,"ngModelChange"],[null,"blur"]],function(n,l,e){var u=!0,o=n.component;"change"===l&&(u=!1!==t.ɵnov(n,68).onChange(e.target.checked)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,68).onTouched()&&u);"change"===l&&(u=!1!==o.saveOptions()&&u);"ngModelChange"===l&&(u=!1!==(o.options.uppercase=e)&&u);return u},null,null)),t.ɵdid(68,16384,null,0,i.CheckboxControlValueAccessor,[t.Renderer2,t.ElementRef],null,null),t.ɵprd(1024,null,i.NG_VALUE_ACCESSOR,function(n){return[n]},[i.CheckboxControlValueAccessor]),t.ɵdid(70,671744,null,0,i.NgModel,[[8,null],[8,null],[8,null],[2,i.NG_VALUE_ACCESSOR]],{model:[0,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,i.NgControl,null,[i.NgModel]),t.ɵdid(72,16384,null,0,i.NgControlStatus,[i.NgControl],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(74,0,null,null,1,"label",[["class","form-check-label"],["for","uppercase"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["A-Z"])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(78,0,null,null,11,"div",[["class","form-check"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(80,0,null,null,5,"input",[["class","form-check-input"],["id","lowercase"],["type","checkbox"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"change"],[null,"ngModelChange"],[null,"blur"]],function(n,l,e){var u=!0,o=n.component;"change"===l&&(u=!1!==t.ɵnov(n,81).onChange(e.target.checked)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,81).onTouched()&&u);"change"===l&&(u=!1!==o.saveOptions()&&u);"ngModelChange"===l&&(u=!1!==(o.options.lowercase=e)&&u);return u},null,null)),t.ɵdid(81,16384,null,0,i.CheckboxControlValueAccessor,[t.Renderer2,t.ElementRef],null,null),t.ɵprd(1024,null,i.NG_VALUE_ACCESSOR,function(n){return[n]},[i.CheckboxControlValueAccessor]),t.ɵdid(83,671744,null,0,i.NgModel,[[8,null],[8,null],[8,null],[2,i.NG_VALUE_ACCESSOR]],{model:[0,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,i.NgControl,null,[i.NgModel]),t.ɵdid(85,16384,null,0,i.NgControlStatus,[i.NgControl],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(87,0,null,null,1,"label",[["class","form-check-label"],["for","lowercase"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["a-z"])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(91,0,null,null,11,"div",[["class","form-check"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(93,0,null,null,5,"input",[["class","form-check-input"],["id","numbers"],["type","checkbox"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"change"],[null,"ngModelChange"],[null,"blur"]],function(n,l,e){var u=!0,o=n.component;"change"===l&&(u=!1!==t.ɵnov(n,94).onChange(e.target.checked)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,94).onTouched()&&u);"change"===l&&(u=!1!==o.saveOptions()&&u);"ngModelChange"===l&&(u=!1!==(o.options.number=e)&&u);return u},null,null)),t.ɵdid(94,16384,null,0,i.CheckboxControlValueAccessor,[t.Renderer2,t.ElementRef],null,null),t.ɵprd(1024,null,i.NG_VALUE_ACCESSOR,function(n){return[n]},[i.CheckboxControlValueAccessor]),t.ɵdid(96,671744,null,0,i.NgModel,[[8,null],[8,null],[8,null],[2,i.NG_VALUE_ACCESSOR]],{model:[0,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,i.NgControl,null,[i.NgModel]),t.ɵdid(98,16384,null,0,i.NgControlStatus,[i.NgControl],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(100,0,null,null,1,"label",[["class","form-check-label"],["for","numbers"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["0-9"])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(104,0,null,null,11,"div",[["class","form-check"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(106,0,null,null,5,"input",[["class","form-check-input"],["id","special"],["type","checkbox"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"change"],[null,"ngModelChange"],[null,"blur"]],function(n,l,e){var u=!0,o=n.component;"change"===l&&(u=!1!==t.ɵnov(n,107).onChange(e.target.checked)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,107).onTouched()&&u);"change"===l&&(u=!1!==o.saveOptions()&&u);"ngModelChange"===l&&(u=!1!==(o.options.special=e)&&u);return u},null,null)),t.ɵdid(107,16384,null,0,i.CheckboxControlValueAccessor,[t.Renderer2,t.ElementRef],null,null),t.ɵprd(1024,null,i.NG_VALUE_ACCESSOR,function(n){return[n]},[i.CheckboxControlValueAccessor]),t.ɵdid(109,671744,null,0,i.NgModel,[[8,null],[8,null],[8,null],[2,i.NG_VALUE_ACCESSOR]],{model:[0,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,i.NgControl,null,[i.NgModel]),t.ɵdid(111,16384,null,0,i.NgControlStatus,[i.NgControl],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(113,0,null,null,1,"label",[["class","form-check-label"],["for","special"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["!@#$%^&*"])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(117,0,null,null,12,"div",[["class","form-check"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(119,0,null,null,5,"input",[["class","form-check-input"],["id","ambiguous"],["type","checkbox"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"change"],[null,"ngModelChange"],[null,"blur"]],function(n,l,e){var u=!0,o=n.component;"change"===l&&(u=!1!==t.ɵnov(n,120).onChange(e.target.checked)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,120).onTouched()&&u);"change"===l&&(u=!1!==o.saveOptions()&&u);"ngModelChange"===l&&(u=!1!==(o.avoidAmbiguous=e)&&u);return u},null,null)),t.ɵdid(120,16384,null,0,i.CheckboxControlValueAccessor,[t.Renderer2,t.ElementRef],null,null),t.ɵprd(1024,null,i.NG_VALUE_ACCESSOR,function(n){return[n]},[i.CheckboxControlValueAccessor]),t.ɵdid(122,671744,null,0,i.NgModel,[[8,null],[8,null],[8,null],[2,i.NG_VALUE_ACCESSOR]],{model:[0,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,i.NgControl,null,[i.NgModel]),t.ɵdid(124,16384,null,0,i.NgControlStatus,[i.NgControl],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(126,0,null,null,2,"label",[["class","form-check-label"],["for","ambiguous"]],null,null,null,null,null)),(n()(),t.ɵted(127,null,["",""])),t.ɵppd(128,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵeld(132,0,null,null,21,"div",[["class","d-flex"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(134,0,null,null,9,"div",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(136,0,null,null,2,"button",[["class","btn btn-primary"],["type","button"]],null,[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.regenerate()&&t);return t},null,null)),(n()(),t.ɵted(137,null,["\n ","\n "])),t.ɵppd(138,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(140,0,null,null,2,"button",[["class","btn btn-outline-secondary"],["type","button"]],null,[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.copy()&&t);return t},null,null)),(n()(),t.ɵted(141,null,["\n ","\n "])),t.ɵppd(142,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(145,0,null,null,7,"div",[["class","ml-auto"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(147,0,null,null,4,"button",[["class","btn btn-outline-secondary"],["type","button"]],[[8,"title",0]],[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.history()&&t);return t},null,null)),t.ɵppd(148,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(150,0,null,null,0,"i",[["class","fa fa-clock-o fa-lg"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,[[1,3],["historyTemplate",2]],null,0,null,f)),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){var e=l.component;n(l,27,0,e.options.length),n(l,42,0,e.options.minNumber),n(l,57,0,e.options.minSpecial),n(l,70,0,e.options.uppercase),n(l,83,0,e.options.lowercase),n(l,96,0,e.options.number),n(l,109,0,e.options.special),n(l,122,0,e.avoidAmbiguous)},function(n,l){var e=l.component;n(l,5,0,t.ɵunv(l,5,0,n(l,6,0,t.ɵnov(l,0),"passwordGenerator"))),n(l,12,0,e.password),n(l,20,0,t.ɵunv(l,20,0,n(l,21,0,t.ɵnov(l,0),"length"))),n(l,23,0,t.ɵnov(l,29).ngClassUntouched,t.ɵnov(l,29).ngClassTouched,t.ɵnov(l,29).ngClassPristine,t.ɵnov(l,29).ngClassDirty,t.ɵnov(l,29).ngClassValid,t.ɵnov(l,29).ngClassInvalid,t.ɵnov(l,29).ngClassPending),n(l,35,0,t.ɵunv(l,35,0,n(l,36,0,t.ɵnov(l,0),"minNumbers"))),n(l,38,0,t.ɵnov(l,44).ngClassUntouched,t.ɵnov(l,44).ngClassTouched,t.ɵnov(l,44).ngClassPristine,t.ɵnov(l,44).ngClassDirty,t.ɵnov(l,44).ngClassValid,t.ɵnov(l,44).ngClassInvalid,t.ɵnov(l,44).ngClassPending),n(l,50,0,t.ɵunv(l,50,0,n(l,51,0,t.ɵnov(l,0),"minSpecial"))),n(l,53,0,t.ɵnov(l,59).ngClassUntouched,t.ɵnov(l,59).ngClassTouched,t.ɵnov(l,59).ngClassPristine,t.ɵnov(l,59).ngClassDirty,t.ɵnov(l,59).ngClassValid,t.ɵnov(l,59).ngClassInvalid,t.ɵnov(l,59).ngClassPending),n(l,67,0,t.ɵnov(l,72).ngClassUntouched,t.ɵnov(l,72).ngClassTouched,t.ɵnov(l,72).ngClassPristine,t.ɵnov(l,72).ngClassDirty,t.ɵnov(l,72).ngClassValid,t.ɵnov(l,72).ngClassInvalid,t.ɵnov(l,72).ngClassPending),n(l,80,0,t.ɵnov(l,85).ngClassUntouched,t.ɵnov(l,85).ngClassTouched,t.ɵnov(l,85).ngClassPristine,t.ɵnov(l,85).ngClassDirty,t.ɵnov(l,85).ngClassValid,t.ɵnov(l,85).ngClassInvalid,t.ɵnov(l,85).ngClassPending),n(l,93,0,t.ɵnov(l,98).ngClassUntouched,t.ɵnov(l,98).ngClassTouched,t.ɵnov(l,98).ngClassPristine,t.ɵnov(l,98).ngClassDirty,t.ɵnov(l,98).ngClassValid,t.ɵnov(l,98).ngClassInvalid,t.ɵnov(l,98).ngClassPending),n(l,106,0,t.ɵnov(l,111).ngClassUntouched,t.ɵnov(l,111).ngClassTouched,t.ɵnov(l,111).ngClassPristine,t.ɵnov(l,111).ngClassDirty,t.ɵnov(l,111).ngClassValid,t.ɵnov(l,111).ngClassInvalid,t.ɵnov(l,111).ngClassPending),n(l,119,0,t.ɵnov(l,124).ngClassUntouched,t.ɵnov(l,124).ngClassTouched,t.ɵnov(l,124).ngClassPristine,t.ɵnov(l,124).ngClassDirty,t.ɵnov(l,124).ngClassValid,t.ɵnov(l,124).ngClassInvalid,t.ɵnov(l,124).ngClassPending),n(l,127,0,t.ɵunv(l,127,0,n(l,128,0,t.ɵnov(l,0),"ambiguous"))),n(l,137,0,t.ɵunv(l,137,0,n(l,138,0,t.ɵnov(l,0),"regeneratePassword"))),n(l,141,0,t.ɵunv(l,141,0,n(l,142,0,t.ɵnov(l,0),"copyPassword"))),n(l,147,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,147,0,n(l,148,0,t.ɵnov(l,0),"passwordHistory")),""))})}function h(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"app-password-generator",[],null,null,null,v,p)),t.ɵdid(1,114688,null,0,r.PasswordGeneratorComponent,[a.PasswordGenerationService,s.Angulartics2,d.PlatformUtilsService,o.I18nService,c.ToasterService,t.ComponentFactoryResolver],null,null)],function(n,l){n(l,1,0)},null)}l.RenderType_PasswordGeneratorComponent=p,l.View_PasswordGeneratorComponent_0=v,l.View_PasswordGeneratorComponent_Host_0=h;var g=t.ɵccf("app-password-generator",r.PasswordGeneratorComponent,h,{showSelect:"showSelect"},{onSelected:"onSelected"},[]);l.PasswordGeneratorComponentNgFactory=g},function(n,l,e){"use strict";var t=this&&this.__awaiter||function(n,l,e,t){return new(e||(e=Promise))(function(u,o){function i(n){try{a(t.next(n))}catch(n){o(n)}}function r(n){try{a(t.throw(n))}catch(n){o(n)}}function a(n){n.done?u(n.value):new e(function(l){l(n.value)}).then(i,r)}a((t=t.apply(n,l||[])).next())})},u=this&&this.__generator||function(n,l){var e,t,u,o,i={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return o={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function r(o){return function(r){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;i;)try{if(e=1,t&&(u=t[2&o[0]?"return":o[0]?"throw":"next"])&&!(u=u.call(t,o[1])).done)return u;switch(t=0,u&&(o=[0,u.value]),o[0]){case 0:case 1:u=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,t=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(u=(u=i.trys).length>0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]t?l.substring(t+1):null;if(!e.isNullOrWhitespace(u)&&!e.isNullOrWhitespace(o)&&"SecretType"!==u){var i=u.toLowerCase();null==n.login.username&&e.usernameFieldNames.indexOf(i)>-1?n.login.username=o:null==n.login.password&&e.passwordFieldNames.indexOf(i)>-1?n.login.password=o:e.processKvp(n,u,o)}}})},l}(o.BaseImporter);l.ZohoVaultCsvImporter=r},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)});Object.defineProperty(l,"__esModule",{value:!0});var o=e(32),i=e(31),r=function(n){function l(){return null!==n&&n.apply(this,arguments)||this}return u(l,n),l.prototype.parse=function(n){var l=this,e=new i.ImportResult,t=this.parseCsv(n,!1);return null==t?(e.success=!1,e):(t.forEach(function(n){if(5===n.length){var t=l.initLoginCipher();t.name=l.getValueOrDefault(n[0],"--"),t.notes=l.getValueOrDefault(n[4]),t.login.username=l.getValueOrDefault(n[1]),t.login.password=l.getValueOrDefault(n[2]),t.login.uris=l.makeUriArray(n[3]),l.cleanupCipher(t),e.ciphers.push(t)}}),e.success=!0,e)},l}(o.BaseImporter);l.UpmCsvImporter=r},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)});Object.defineProperty(l,"__esModule",{value:!0});var o=e(32),i=e(31),r=e(115),a=e(91),s=e(53),d=e(101),c=["kind","autologin","favorite","hexcolor","protectedwithpassword","subdomainonly","type","tk_export_version","note","title","document_content"],p=function(n){function l(){return null!==n&&n.apply(this,arguments)||this}return u(l,n),l.prototype.parse=function(n){var l=this,e=new i.ImportResult,t=this.parseCsv(n,!0);return null==t?(e.success=!1,e):(t.forEach(function(n){var t=l.initLoginCipher();if(t.favorite="true"===l.getValueOrDefault(n.favorite,"").toLowerCase(),t.name=l.getValueOrDefault(n.name,"--"),t.notes=l.getValueOrDefault(n.memo,""),t.login.username=l.getValueOrDefault(n.login),t.login.password=l.getValueOrDefault(n.password),t.login.uris=l.makeUriArray(n.url),"login"!==n.kind&&(t.name=l.getValueOrDefault(n.title,"--"),t.notes=l.getValueOrDefault(n.note,"")),"cc"===n.kind){if(t.type=s.CipherType.Card,t.card=new r.CardView,t.card.cardholderName=l.getValueOrDefault(n.cardholder),t.card.number=l.getValueOrDefault(n.number),t.card.brand=l.getCardBrand(t.card.number),!l.isNullOrWhitespace(n.expiryDate))try{var u=new Date(n.expiryDate);t.card.expYear=u.getFullYear().toString(),t.card.expMonth=(u.getMonth()+1).toString()}catch(n){}}else if("login"!==n.kind)for(var o in t.type=s.CipherType.SecureNote,t.secureNote=new a.SecureNoteView,t.secureNote.type=d.SecureNoteType.Generic,l.isNullOrWhitespace(t.notes)||(t.notes=l.getValueOrDefault(n.document_content,"")),n)n.hasOwnProperty(o)&&c.indexOf(o.toLowerCase())<0&&!l.isNullOrWhitespace(n[o])&&l.processKvp(t,o,n[o]);l.cleanupCipher(t),e.ciphers.push(t)}),e.success=!0,e)},l}(o.BaseImporter);l.TrueKeyCsvImporter=p},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)});Object.defineProperty(l,"__esModule",{value:!0});var o=e(32),i=e(31),r=function(n){function l(){return null!==n&&n.apply(this,arguments)||this}return u(l,n),l.prototype.parse=function(n){var l=this,e=new i.ImportResult,t=this.parseXml(n);if(null==t)return e.success=!1,e;var u=t.querySelectorAll("root > Database > Logins > Login");return Array.from(u).forEach(function(n){var u=n.getAttribute("ID");if(!l.isNullOrWhitespace(u)){var o=n.getAttribute("Name"),i=n.getAttribute("Password"),r=null,a=null,s=null,d=null,c=null,p=t.querySelector('root > Database > Accounts > Account > LoginLinks > Login[SourceLoginID="'+u+'"]');if(null!=p){var f=p.parentElement.parentElement;null!=f&&(r=f.getAttribute("Name"),a=f.getAttribute("Link"),d=f.getAttribute("ParentID"),s=f.getAttribute("Comments"),l.isNullOrWhitespace(s)||(s=s.split("/n").join("\n")))}l.isNullOrWhitespace(d)||(c=l.buildGroupText(t,d,""),l.processFolder(e,c));var v=l.initLoginCipher();v.name=l.getValueOrDefault(r,"--"),v.notes=l.getValueOrDefault(s),v.login.username=l.getValueOrDefault(o),v.login.password=l.getValueOrDefault(i),v.login.uris=l.makeUriArray(a),l.cleanupCipher(v),e.ciphers.push(v)}}),this.organization&&this.moveFoldersToCollections(e),e.success=!0,e},l.prototype.buildGroupText=function(n,l,e){var t=n.querySelector('root > Database > Groups > Group[ID="'+l+'"]');return null==t?e:(this.isNullOrWhitespace(e)||(e="/"+e),e=t.getAttribute("Name")+e,this.buildGroupText(n,t.getAttribute("ParentID"),e))},l}(o.BaseImporter);l.StickyPasswordXmlImporter=r},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)});Object.defineProperty(l,"__esModule",{value:!0});var o=e(32),i=e(31),r=function(n){function l(){return null!==n&&n.apply(this,arguments)||this}return u(l,n),l.prototype.parse=function(n){var l=this,e=new i.ImportResult,t=this.parseCsv(n,!1);return null==t?(e.success=!1,e):(t.forEach(function(n){if(!(n.length<3)){l.processFolder(e,l.getValueOrDefault(n[n.length-1]));var t=l.initLoginCipher();t.notes=l.getValueOrDefault(n[n.length-2],""),t.name=l.getValueOrDefault(n[1],"--"),"Web Logins"===n[0]||"Servers"===n[0]||"Email Accounts"===n[0]?(t.login.username=l.getValueOrDefault(n[2]),t.login.password=l.getValueOrDefault(n[3]),t.login.uris=l.makeUriArray(n[4]),l.parseFieldsToNotes(t,5,n)):l.parseFieldsToNotes(t,2,n),l.convertToNoteIfNeeded(t),l.cleanupCipher(t),e.ciphers.push(t)}}),this.organization&&this.moveFoldersToCollections(e),e.success=!0,e)},l.prototype.parseFieldsToNotes=function(n,l,e){for(var t=l;t label")).forEach(function(n){var t=n.getAttribute("name"),o=n.getAttribute("id");if(!l.isNullOrWhitespace(t)&&!l.isNullOrWhitespace(o)){u.set(o,e.folders.length);var i=new r.FolderView;i.name=t,e.folders.push(i)}}),Array.from(t.querySelectorAll("database > card")).forEach(function(n){if("true"!==n.getAttribute("template")){var t=l.querySelectorDirectChild(n,"label_id");if(null!=t){var o=t.textContent;!l.isNullOrWhitespace(o)&&u.has(o)&&e.folderRelationships.push([e.ciphers.length,u.get(o)])}var i=l.initLoginCipher();i.name=l.getValueOrDefault(n.getAttribute("title"),"--"),"note"===n.getAttribute("type")?(i.type=s.CipherType.SecureNote,i.secureNote=new a.SecureNoteView,i.secureNote.type=d.SecureNoteType.Generic):Array.from(l.querySelectorAllDirectChild(n,"field")).forEach(function(n){var e=n.textContent;if(!l.isNullOrWhitespace(e)){var t=n.getAttribute("name"),u=l.getValueOrDefault(n.getAttribute("type"),"").toLowerCase();"login"===u?i.login.username=e:"password"===u?i.login.password=e:"notes"===u?i.notes+=e+"\n":"weblogin"===u||"website"===u?i.login.uris=l.makeUriArray(e):l.processKvp(i,t,e)}}),Array.from(l.querySelectorAllDirectChild(n,"notes")).forEach(function(n){i.notes+=n.textContent+"\n"}),l.cleanupCipher(i),e.ciphers.push(i)}}),this.organization&&this.moveFoldersToCollections(e),e.success=!0,e},l}(o.BaseImporter);l.SafeInCloudXmlImporter=c},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)});Object.defineProperty(l,"__esModule",{value:!0});var o=e(32),i=e(31),r=function(n){function l(){return null!==n&&n.apply(this,arguments)||this}return u(l,n),l.prototype.parse=function(n){var l=this,e=new i.ImportResult,t=this.parseCsv(n,!0);if(null==t)return e.success=!1,e;var u=1;return t.forEach(function(n){var o=!l.isNullOrWhitespace(n.Folder)&&n.Folder.startsWith("/")?n.Folder.replace("/",""):n.Folder,i=l.isNullOrWhitespace(o)?null:o;l.processFolder(e,i);var r=l.initLoginCipher();r.notes=l.getValueOrDefault(n.Note),r.name=l.getValueOrDefault(n.Name,"--"),r.login.username=l.getValueOrDefault(n.Login),r.login.password=l.getValueOrDefault(n.Pwd),r.login.uris=l.makeUriArray(n.Url),l.cleanupCipher(r),u===t.length&&"--"===r.name&&l.isNullOrWhitespace(r.login.password)||(e.ciphers.push(r),u++)}),this.organization&&this.moveFoldersToCollections(e),e.success=!0,e},l}(o.BaseImporter);l.RoboFormCsvImporter=r},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)});Object.defineProperty(l,"__esModule",{value:!0});var o=e(32),i=e(31),r=function(n){function l(){return null!==n&&n.apply(this,arguments)||this}return u(l,n),l.prototype.parse=function(n){var l=this,e=new i.ImportResult,t=this.parseXml(n);if(null==t)return e.success=!1,e;var u=t.querySelector("passwordsafe");if(null==u)return e.errorMessage="Missing `passwordsafe` node.",e.success=!1,e;var o=u.getAttribute("delimiter"),r=t.querySelectorAll("passwordsafe > entry");return Array.from(r).forEach(function(n){var t=l.querySelectorDirectChild(n,"group"),u=null==t||l.isNullOrWhitespace(t.textContent)?null:t.textContent.split(".").join("/");l.processFolder(e,u);var i=l.querySelectorDirectChild(n,"title"),r=l.querySelectorDirectChild(n,"username"),a=l.querySelectorDirectChild(n,"email"),s=l.querySelectorDirectChild(n,"password"),d=l.querySelectorDirectChild(n,"url"),c=l.querySelectorDirectChild(n,"notes"),p=l.initLoginCipher();p.name=null!=i?l.getValueOrDefault(i.textContent,"--"):"--",p.notes=null!=c?l.getValueOrDefault(c.textContent,"").split(o).join("\n"):null,p.login.username=null!=r?l.getValueOrDefault(r.textContent):null,p.login.password=null!=s?l.getValueOrDefault(s.textContent):null,p.login.uris=null!=d?l.makeUriArray(d.textContent):null,l.isNullOrWhitespace(p.login.username)&&null!=a?p.login.username=l.getValueOrDefault(a.textContent):null==a||l.isNullOrWhitespace(a.textContent)||(p.notes=l.isNullOrWhitespace(p.notes)?"Email: "+a.textContent:p.notes+"\nEmail: "+a.textContent),l.cleanupCipher(p),e.ciphers.push(p)}),this.organization&&this.moveFoldersToCollections(e),e.success=!0,e},l}(o.BaseImporter);l.PasswordSafeXmlImporter=r},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)});Object.defineProperty(l,"__esModule",{value:!0});var o=e(32),i=e(31),r=function(n){function l(){return null!==n&&n.apply(this,arguments)||this}return u(l,n),l.prototype.parse=function(n){var l=this,e=new i.ImportResult,t=this.parseXml(n);if(null==t)return e.success=!1,e;var u=t.querySelectorAll("PasswordManager > record");return Array.from(u).forEach(function(n){var t=l.querySelectorDirectChild(n,"Category"),u=null==t||l.isNullOrWhitespace(t.textContent)||"Unfiled"===t.textContent?null:t.textContent;l.processFolder(e,u);var o=l.querySelectorDirectChild(n,"Account-Name"),i=l.querySelectorDirectChild(n,"User-Id"),r=l.querySelectorDirectChild(n,"Password"),a=l.querySelectorDirectChild(n,"URL"),s=l.querySelectorDirectChild(n,"Notes"),d=l.initLoginCipher();d.name=null!=o?l.getValueOrDefault(o.textContent,"--"):"--",d.notes=null!=s?l.getValueOrDefault(s.textContent):"",d.login.username=null!=i?l.getValueOrDefault(i.textContent):null,d.login.password=null!=r?l.getValueOrDefault(r.textContent):null,d.login.uris=null!=a?l.makeUriArray(a.textContent):null;for(var c=[],p=1;p<=10;p++)c.push("Attribute-"+p);l.querySelectorAllDirectChild(n,c.join(",")).forEach(function(n){l.isNullOrWhitespace(n.textContent)||"null"===n.textContent||l.processKvp(d,n.tagName,n.textContent)}),l.cleanupCipher(d),e.ciphers.push(d)}),this.organization&&this.moveFoldersToCollections(e),e.success=!0,e},l}(o.BaseImporter);l.PasswordDragonXmlImporter=r},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)});Object.defineProperty(l,"__esModule",{value:!0});var o=e(32),i=e(31),r=e(115),a=e(53),s=function(n){function l(){return null!==n&&n.apply(this,arguments)||this}return u(l,n),l.prototype.parse=function(n){var l=this,e=new i.ImportResult,t=JSON.parse(n);return null==t?(e.success=!1,e):(t.forEach(function(n){var t=l.initLoginCipher();if(t.name=l.getValueOrDefault(n.name,"--"),t.login.uris=l.makeUriArray(n.login_url),null!=n.identifiers){for(var u in l.isNullOrWhitespace(n.identifiers.notes)||(t.notes=n.identifiers.notes.split("\\r\\n").join("\n").split("\\n").join("\n")),"CreditCard"===n.type&&(t.card=new r.CardView,t.type=a.CipherType.Card),n.identifiers)if(n.identifiers.hasOwnProperty(u)){var o=n.identifiers[u],i=null!=o?o.toString():null;if(!l.isNullOrWhitespace(i)&&"notes"!==u&&"ignoreItemInSecurityScore"!==u){if(t.type===a.CipherType.Card){if("cardNumber"===u){t.card.number=i,t.card.brand=l.getCardBrand(i);continue}if("nameOnCard"===u){t.card.cardholderName=i;continue}if("security_code"===u){t.card.code=i;continue}if("expires"===u){try{var s=new Date(i);t.card.expYear=s.getFullYear().toString(),t.card.expMonth=(s.getMonth()+1).toString()}catch(n){}continue}if("cardType"===u)continue}else{if("username"===u){t.login.username=i;continue}if("password"===u){t.login.password=i;continue}if((null==t.login.uris||0===t.login.uris.length)&&l.uriFieldNames.indexOf(u)>-1){t.login.uris=l.makeUriArray(i);continue}}l.processKvp(t,u,i)}}l.convertToNoteIfNeeded(t),l.cleanupCipher(t),e.ciphers.push(t)}}),e.success=!0,e)},l}(o.BaseImporter);l.PasswordBossJsonImporter=s},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)});Object.defineProperty(l,"__esModule",{value:!0});var o=e(32),i=e(31),r=function(n){function l(){return null!==n&&n.apply(this,arguments)||this}return u(l,n),l.prototype.parse=function(n){var l=this,e=new i.ImportResult,t=this.parseCsv(n,!1);return null==t?(e.success=!1,e):(t.forEach(function(n){if(!(n.length<9)){var t=l.getValueOrDefault(n[8],"(None)"),u="(None)"!==t?t.split("\\").join("/"):null;l.processFolder(e,u);var o=l.initLoginCipher();o.notes=l.getValueOrDefault(n[3]),o.name=l.getValueOrDefault(n[0],"--"),o.login.username=l.getValueOrDefault(n[1]),o.login.password=l.getValueOrDefault(n[2]),o.login.uris=l.makeUriArray(n[4]),l.convertToNoteIfNeeded(o),l.cleanupCipher(o),e.ciphers.push(o)}}),this.organization&&this.moveFoldersToCollections(e),e.success=!0,e)},l}(o.BaseImporter);l.PasswordAgentCsvImporter=r},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)});Object.defineProperty(l,"__esModule",{value:!0});var o=e(32),i=e(31),r=function(n){function l(){return null!==n&&n.apply(this,arguments)||this}return u(l,n),l.prototype.parse=function(n){var l=this,e=new i.ImportResult,t=this.parseCsv(n,!0);return null==t?(e.success=!1,e):(t.forEach(function(n){l.processFolder(e,l.getValue("category",n));var t=l.initLoginCipher();t.notes=l.getValue("description",n),t.name=l.getValueOrDefault(l.getValue("title",n),"--"),t.login.username=l.getValue("username",n),t.login.password=l.getValue("password",n),t.login.uris=l.makeUriArray(l.getValue("site",n)),l.processKvp(t,"Password 2",l.getValue("password2",n)),l.cleanupCipher(t),e.ciphers.push(t)}),this.organization&&this.moveFoldersToCollections(e),e.success=!0,e)},l.prototype.getValue=function(n,l){return this.getValueOrDefault(l[n],this.getValueOrDefault(l[" "+n]))},l}(o.BaseImporter);l.PassKeepCsvImporter=r},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)});Object.defineProperty(l,"__esModule",{value:!0});var o=e(32),i=e(31),r=e(177),a=function(n){function l(){return null!==n&&n.apply(this,arguments)||this}return u(l,n),l.prototype.parse=function(n){var l=this,e=new i.ImportResult,t=this.parseCsv(n,!1);if(null==t)return e.success=!1,e;var u=null;return t.forEach(function(n){if(null!=u){if(!(n.length<2||n.length!==u.length)){if(!l.isNullOrWhitespace(n[1]))if(l.organization){(t=n[1].split(",")).forEach(function(n){n=n.trim();for(var l=!0,t=e.collections.length,u=0;u0?t[0].trim():null;l.processFolder(e,o)}var i=l.initLoginCipher();i.name=l.getValueOrDefault(n[0],"--");for(var a=2;a-1?i.login.username=n[a]:l.passwordFieldNames.indexOf(s)>-1?i.login.password=n[a]:l.uriFieldNames.indexOf(s)>-1?i.login.uris=l.makeUriArray(n[a]):l.processKvp(i,u[a],n[a]))}l.cleanupCipher(i),e.ciphers.push(i)}}else u=n.map(function(n){return n})}),e.success=!0,e},l}(o.BaseImporter);l.PadlockCsvImporter=a},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(){}}();l.View=t},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=e(538);l.AttachmentView=t.AttachmentView;var u=e(115);l.CardView=u.CardView;var o=e(157);l.CipherView=o.CipherView;var i=e(179);l.FieldView=i.FieldView;var r=e(217);l.IdentityView=r.IdentityView;var a=e(216);l.LoginUriView=a.LoginUriView;var s=e(156);l.LoginView=s.LoginView;var d=e(91);l.SecureNoteView=d.SecureNoteView;var c=e(752);l.View=c.View},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)});Object.defineProperty(l,"__esModule",{value:!0});var o=e(32),i=e(31),r=e(53),a=e(753),s=["ainfo","autosubmit","notesPlain","ps","scope","tags","title","uuid"],d=function(n){function l(){return null!==n&&n.apply(this,arguments)||this}return u(l,n),l.prototype.parse=function(n){var l=this,e=new i.ImportResult,t=this.parseCsv(n,!0);return null==t?(e.success=!1,e):(t.forEach(function(n){if(!l.isNullOrWhitespace(n.title)){var t=l.initLoginCipher();t.name=l.getValueOrDefault(n.title,"--"),t.notes=l.getValueOrDefault(n.notesPlain,"")+"\n",l.isNullOrWhitespace(n.number)||l.isNullOrWhitespace(n["expiry date"])||(t.type=r.CipherType.Card,t.card=new a.CardView);var u=null;for(var o in n)if(n.hasOwnProperty(o)&&!l.isNullOrWhitespace(n[o])){if(t.type===r.CipherType.Login){if(l.isNullOrWhitespace(t.login.password)&&"password"===o){t.login.password=n[o];continue}if(l.isNullOrWhitespace(t.login.username)&&"username"===o){t.login.username=n[o];continue}if((null==t.login.uris||0===t.login.uri.length)&&"urls"===o){var i=n[o].split(l.newLineRegex);t.login.uris=l.makeUriArray(i);continue}}else if(t.type===r.CipherType.Card){if(l.isNullOrWhitespace(t.card.number)&&"number"===o){t.card.number=n[o],t.card.brand=l.getCardBrand(n.number);continue}if(l.isNullOrWhitespace(t.card.code)&&"verification number"===o){t.card.code=n[o];continue}if(l.isNullOrWhitespace(t.card.cardholderName)&&"cardholder name"===o){t.card.cardholderName=n[o];continue}if(l.isNullOrWhitespace(t.card.expiration)&&"expiry date"===o&&6===n[o].length){t.card.expMonth=n[o].substr(4,2),"0"===t.card.expMonth[0]&&(t.card.expMonth=t.card.expMonth.substr(1,1)),t.card.expYear=n[o].substr(0,4);continue}if("type"===o)continue}-1!==s.indexOf(o)||o.startsWith("section:")||(null==u&&"email"===o&&(u=n[o]),l.processKvp(t,o,n[o]))}t.type===r.CipherType.Login&&!l.isNullOrWhitespace(u)&&l.isNullOrWhitespace(t.login.username)&&-1===u.indexOf("://")&&(t.login.username=u),l.convertToNoteIfNeeded(t),l.cleanupCipher(t),e.ciphers.push(t)}}),e.success=!0,e)},l}(o.BaseImporter);l.OnePasswordWinCsvImporter=d},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)});Object.defineProperty(l,"__esModule",{value:!0});var o=e(32),i=e(31),r=e(115),a=e(91),s=e(53),d=e(101),c=function(n){function l(){var l=null!==n&&n.apply(this,arguments)||this;return l.result=new i.ImportResult,l}return u(l,n),l.prototype.parse=function(n){var l=this;return n.split(this.newLineRegex).forEach(function(n){if(!l.isNullOrWhitespace(n)&&"{"===n[0]){var e=JSON.parse(n),t=l.initLoginCipher();t.favorite=!(!e.openContents||!e.openContents.faveIndex),t.name=l.getValueOrDefault(e.title,"--"),"securenotes.SecureNote"===e.typeName?(t.type=s.CipherType.SecureNote,t.secureNote=new a.SecureNoteView,t.secureNote.type=d.SecureNoteType.Generic):"wallet.financial.CreditCard"===e.typeName?(t.type=s.CipherType.Card,t.card=new r.CardView):t.login.uris=l.makeUriArray(e.location),null!=e.secureContents&&(l.isNullOrWhitespace(e.secureContents.notesPlain)||(t.notes=e.secureContents.notesPlain.split(l.newLineRegex).join("\n")+"\n"),null!=e.secureContents.fields&&l.parseFields(e.secureContents.fields,t,"designation","value","name"),null!=e.secureContents.sections&&e.secureContents.sections.forEach(function(n){null!=n.fields&&l.parseFields(n.fields,t,"n","v","t")})),l.cleanupCipher(t),l.result.ciphers.push(t)}}),this.result.success=!0,this.result},l.prototype.parseFields=function(n,l,e,t,u){var o=this;n.forEach(function(n){if(null!=n[t]&&""!==n[t].toString().trim()){var i=n[t].toString(),r=null!=n[e]?n[e].toString():null;if(l.type===s.CipherType.Login){if(o.isNullOrWhitespace(l.login.username)&&"username"===r)return void(l.login.username=i);if(o.isNullOrWhitespace(l.login.password)&&"password"===r)return void(l.login.password=i);if(o.isNullOrWhitespace(l.login.totp)&&null!=r&&r.startsWith("TOTP_"))return void(l.login.totp=i)}else if(l.type===s.CipherType.Card){if(o.isNullOrWhitespace(l.card.number)&&"ccnum"===r)return l.card.number=i,void(l.card.brand=o.getCardBrand(i));if(o.isNullOrWhitespace(l.card.code)&&"cvv"===r)return void(l.card.code=i);if(o.isNullOrWhitespace(l.card.cardholderName)&&"cardholder"===r)return void(l.card.cardholderName=i);if(o.isNullOrWhitespace(l.card.expiration)&&"expiry"===r&&6===i.length)return l.card.expMonth=i.substr(4,2),"0"===l.card.expMonth[0]&&(l.card.expMonth=l.card.expMonth.substr(1,1)),void(l.card.expYear=i.substr(0,4));if("type"===r)return}var a=o.isNullOrWhitespace(n[u])?"no_name":n[u];o.processKvp(l,a,i)}})},l}(o.BaseImporter);l.OnePassword1PifImporter=c},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)});Object.defineProperty(l,"__esModule",{value:!0});var o=e(32),i=e(31),r=e(53),a=e(101),s=e(91),d=function(n){function l(){return null!==n&&n.apply(this,arguments)||this}return u(l,n),l.prototype.parse=function(n){var l=this,e=new i.ImportResult,t=this.parseCsv(n,!1);return null==t?(e.success=!1,e):(t.forEach(function(n){if(!(n.length<3)){var t="Unassigned"!==l.getValueOrDefault(n[0],"Unassigned")?n[0]:null;l.processFolder(e,t);var u=l.initLoginCipher();if(u.name=l.getValueOrDefault(n[2],"--"),"Web Logins"===n[1])u.login.uris=l.makeUriArray(n[4]),u.login.username=l.getValueOrDefault(n[5]),u.login.password=l.getValueOrDefault(n[6]),u.notes=l.isNullOrWhitespace(n[3])?null:n[3].split("\\n").join("\n");else if(n.length>3){u.type=r.CipherType.SecureNote,u.secureNote=new s.SecureNoteView,u.secureNote.type=a.SecureNoteType.Generic;for(var o=3;o-1){var e=n.ccexp.split("-");e.length>1&&(l.expYear=e[0],l.expMonth=e[1],2===l.expMonth.length&&"0"===l.expMonth[0]&&(l.expMonth=l.expMonth[1]))}return l},l.prototype.parseIdentity=function(n){var l=new d.IdentityView;return l.title=this.getValueOrDefault(n.title),l.firstName=this.getValueOrDefault(n.firstname),l.middleName=this.getValueOrDefault(n.middlename),l.lastName=this.getValueOrDefault(n.lastname),l.username=this.getValueOrDefault(n.username),l.company=this.getValueOrDefault(n.company),l.ssn=this.getValueOrDefault(n.ssn),l.address1=this.getValueOrDefault(n.address1),l.address2=this.getValueOrDefault(n.address2),l.address3=this.getValueOrDefault(n.address3),l.city=this.getValueOrDefault(n.city),l.state=this.getValueOrDefault(n.state),l.postalCode=this.getValueOrDefault(n.zip),l.country=this.getValueOrDefault(n.country),l.email=this.getValueOrDefault(n.email),l.phone=this.getValueOrDefault(n.phone),this.isNullOrWhitespace(l.title)||(l.title=l.title.charAt(0).toUpperCase()+l.title.slice(1)),l},l.prototype.parseSecureNote=function(n,l){var e=this.splitNewLine(n.extra),t=!1;if(e.length){var u=e[0].split(":");if(u.length>1&&"NoteType"===u[0]&&("Credit Card"===u[1]||"Address"===u[1])){if("Credit Card"===u[1]){var o=this.parseSecureNoteMapping(e,{Number:"number","Name on Card":"cardholderName","Security Code":"code"});l.type=f.CipherType.Card,l.card=o[0],l.notes=o[1]}else if("Address"===u[1]){o=this.parseSecureNoteMapping(e,{Title:"title","First Name":"firstName","Last Name":"lastName","Middle Name":"middleName",Company:"company","Address 1":"address1","Address 2":"address2","Address 3":"address3","City / Town":"city",State:"state","Zip / Postal Code":"postalCode",Country:"country","Email Address":"email",Username:"username"});l.type=f.CipherType.Identity,l.identity=o[0],l.notes=o[1]}t=!0}}t||(l.secureNote=new p.SecureNoteView,l.secureNote.type=v.SecureNoteType.Generic,l.notes=this.getValueOrDefault(n.extra))},l.prototype.parseSecureNoteMapping=function(n,l){var e=this,t=null,u={};return n.forEach(function(n){var o=n.split(":");o.length<1||e.isNullOrWhitespace(o[0])||e.isNullOrWhitespace(o[1])||"NoteType"===o[0]||("Notes"===o[0]?e.isNullOrWhitespace(t)?t=o[1]:t+="\n"+o[1]:l.hasOwnProperty(o[0])?u[l[o[0]]]=o[1]:(e.isNullOrWhitespace(t)?t="":t+="\n",t+=o[0]+": "+o[1]))}),[u,t]},l}(o.BaseImporter);l.LastPassCsvImporter=h},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)});Object.defineProperty(l,"__esModule",{value:!0});var o=e(32),i=e(31),r=function(n){function l(){return null!==n&&n.apply(this,arguments)||this}return u(l,n),l.prototype.parse=function(n){var l=this,e=new i.ImportResult,t=this.parseCsv(n,!1);return null==t?(e.success=!1,e):(t.forEach(function(n){if(!(n.length<6)){l.processFolder(e,n[0]);var t=l.initLoginCipher();if(t.notes=l.getValueOrDefault(n[5])+"\n",t.name=l.getValueOrDefault(n[1],"--"),t.login.username=l.getValueOrDefault(n[2]),t.login.password=l.getValueOrDefault(n[3]),t.login.uris=l.makeUriArray(n[4]),n.length>7)for(var u=7;u Root > Group");return null==e?(this.result.errorMessage="Missing `KeePassFile > Root > Group` node.",this.result.success=!1,this.result):(this.traverse(e,!0,""),this.organization&&this.moveFoldersToCollections(this.result),this.result.success=!0,this.result)},l.prototype.traverse=function(n,l,e){var t=this,u=this.result.folders.length,o=e;if(!l){""!==o&&(o+="/");var i=this.querySelectorDirectChild(n,"Name");o+=null==i?"-":i.textContent;var a=new r.FolderView;a.name=o,this.result.folders.push(a)}this.querySelectorAllDirectChild(n,"Entry").forEach(function(n){var e=t.result.ciphers.length,o=t.initLoginCipher();t.querySelectorAllDirectChild(n,"String").forEach(function(n){var l=t.querySelectorDirectChild(n,"Value"),e=null!=l?l.textContent:null;if(!t.isNullOrWhitespace(e)){var u=t.querySelectorDirectChild(n,"Key"),i=null!=u?u.textContent:null;"URL"===i?o.login.uris=t.makeUriArray(e):"UserName"===i?o.login.username=e:"Password"===i?o.login.password=e:"Title"===i?o.name=e:"Notes"===i?o.notes+=e+"\n":t.processKvp(o,i,e)}}),t.cleanupCipher(o),t.result.ciphers.push(o),l||t.result.folderRelationships.push([e,u])}),this.querySelectorAllDirectChild(n,"Group").forEach(function(n){t.traverse(n,!1,o)})},l}(o.BaseImporter);l.KeePass2XmlImporter=a},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)});Object.defineProperty(l,"__esModule",{value:!0});var o=e(32),i=e(31),r=function(n){function l(){return null!==n&&n.apply(this,arguments)||this}return u(l,n),l.prototype.parse=function(n){var l=this,e=new i.ImportResult,t=JSON.parse(n);if(null==t||0===Object.keys(t).length)return e.success=!1,e;var u=function(n){if(!t.hasOwnProperty(n)||o.isNullOrWhitespace(n)||0===t[n].length)return"continue";t[n].forEach(function(t){if(!l.isNullOrWhitespace(t.display_name)&&0===t.display_name.indexOf("http")){l.processFolder(e,n);var u=l.initLoginCipher();if(u.name=t.display_name.replace("http://","").replace("https://",""),u.name.length>30&&(u.name=u.name.substring(0,30)),u.login.password=l.getValueOrDefault(t.secret),u.login.uris=l.makeUriArray(t.display_name),null!=t.attributes)for(var o in u.login.username=null!=t.attributes?l.getValueOrDefault(t.attributes.username_value):null,t.attributes)t.attributes.hasOwnProperty(o)&&"username_value"!==o&&"xdg:schema"!==o&&l.processKvp(u,o,t.attributes[o]);l.convertToNoteIfNeeded(u),l.cleanupCipher(u),e.ciphers.push(u)}})},o=this;for(var r in t)u(r);return this.organization&&this.moveFoldersToCollections(e),e.success=!0,e},l}(o.BaseImporter);l.GnomeJsonImporter=r},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)});Object.defineProperty(l,"__esModule",{value:!0});var o=e(32),i=e(31),r=function(n){function l(){return null!==n&&n.apply(this,arguments)||this}return u(l,n),l.prototype.parse=function(n){var l=this,e=new i.ImportResult,t=this.parseCsv(n,!0);return null==t?(e.success=!1,e):(t.forEach(function(n){var t=l.initLoginCipher();t.name=l.getValueOrDefault(l.nameFromUrl(n.hostname),"--"),t.login.username=l.getValueOrDefault(n.username),t.login.password=l.getValueOrDefault(n.password),t.login.uris=l.makeUriArray(n.hostname),l.cleanupCipher(t),e.ciphers.push(t)}),e.success=!0,e)},l}(o.BaseImporter);l.FirefoxCsvImporter=r},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)});Object.defineProperty(l,"__esModule",{value:!0});var o=e(32),i=e(31),r=e(53),a=e(101),s=e(115),d=e(91),c=function(n){function l(){return null!==n&&n.apply(this,arguments)||this}return u(l,n),l.prototype.parse=function(n){var l=this,e=new i.ImportResult,t=this.parseCsv(n,!1);if(null==t)return e.success=!1,e;var u=!0;return t.forEach(function(n){if(n.length<2||u&&"Title"===n[0])u=!1;else{var t=l.initLoginCipher();if(t.notes=l.getValueOrDefault(n[n.length-1]),t.name=l.getValueOrDefault(n[0],"--"),(2===n.length||n.indexOf("Username")<0&&n.indexOf("Password")<0&&n.indexOf("Email")&&n.indexOf("URL")<0)&&(t.type=r.CipherType.SecureNote,t.secureNote=new d.SecureNoteView,t.secureNote.type=a.SecureNoteType.Generic),n.indexOf("Cardholder")>-1&&n.indexOf("Number")>-1&&n.indexOf("Expiry date")>-1&&(t.type=r.CipherType.Card,t.card=new s.CardView),n.length>2&&n.length%2==0)for(var o=0;o-1?t.login.password=l.getValueOrDefault(o.value):null==t.login.username&&l.usernameFieldNames.indexOf(i)>-1?t.login.username=l.getValueOrDefault(o.value):(null==t.login.uris||0===t.login.uris.length)&&l.uriFieldNames.indexOf(i)>-1?t.login.uris=l.makeUriArray(o.value):l.processKvp(t,o.label,o.value)}}l.convertToNoteIfNeeded(t),l.cleanupCipher(t),e.ciphers.push(t)}),e.success=!0,e)},l}(o.BaseImporter);l.ClipperzHtmlImporter=r},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)});Object.defineProperty(l,"__esModule",{value:!0});var o=e(32),i=e(31),r=function(n){function l(){return null!==n&&n.apply(this,arguments)||this}return u(l,n),l.prototype.parse=function(n){var l=this,e=new i.ImportResult,t=this.parseCsv(n,!0);return null==t?(e.success=!1,e):(t.forEach(function(n){var t=l.initLoginCipher();t.name=l.getValueOrDefault(n.name,"--"),t.login.username=l.getValueOrDefault(n.username),t.login.password=l.getValueOrDefault(n.password),t.login.uris=l.makeUriArray(n.url),l.cleanupCipher(t),e.ciphers.push(t)}),e.success=!0,e)},l}(o.BaseImporter);l.ChromeCsvImporter=r},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)});Object.defineProperty(l,"__esModule",{value:!0});var o=e(32),i=e(31),r=function(n){function l(){return null!==n&&n.apply(this,arguments)||this}return u(l,n),l.prototype.parse=function(n){var l=this,e=new i.ImportResult,t=this.parseCsv(n,!0);return null==t?(e.success=!1,e):(t.forEach(function(n){"null"===n.label&&(n.label=null);var t=l.initLoginCipher();t.name=l.getValueOrDefault(n.label,l.getValueOrDefault(l.nameFromUrl(n.domain),"--")),t.login.uris=l.makeUriArray(n.domain),t.login.password=l.getValueOrDefault(n.password),l.isNullOrWhitespace(n.email)&&!l.isNullOrWhitespace(n.username)?t.login.username=n.username:(t.login.username=l.getValueOrDefault(n.email),t.notes=l.getValueOrDefault(n.username)),l.cleanupCipher(t),e.ciphers.push(t)}),e.success=!0,e)},l}(o.BaseImporter);l.BlurCsvImporter=r},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)});Object.defineProperty(l,"__esModule",{value:!0});var o=e(32),i=e(31),r=e(157),a=e(177),s=e(179),d=e(156),c=e(91),p=e(53),f=e(219),v=e(101),h=function(n){function l(){return null!==n&&n.apply(this,arguments)||this}return u(l,n),l.prototype.parse=function(n){var l=this,e=new i.ImportResult,t=this.parseCsv(n,!0);return null==t?(e.success=!1,e):(t.forEach(function(n){l.organization&&!l.isNullOrWhitespace(n.collections)?n.collections.split(",").forEach(function(n){for(var l=!0,t=e.collections.length,u=0;ui+2&&(h.value=u[o].substr(i+2)),t.fields.push(h)}}switch(null!=n.type?n.type.toLowerCase():null){case"login":case null:t.type=p.CipherType.Login,t.login=new d.LoginView,t.login.totp=l.getValueOrDefault(n.login_totp||n.totp),t.login.username=l.getValueOrDefault(n.login_username||n.username),t.login.password=l.getValueOrDefault(n.login_password||n.password);var g=l.parseSingleRowCsv(n.login_uri||n.uri);t.login.uris=l.makeUriArray(g);break;case"note":t.type=p.CipherType.SecureNote,t.secureNote=new c.SecureNoteView,t.secureNote.type=v.SecureNoteType.Generic}e.ciphers.push(t)}),e.success=!0,e)},l}(o.BaseImporter);l.BitwardenCsvImporter=h},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)});Object.defineProperty(l,"__esModule",{value:!0});var o=e(32),i=e(31),r=function(n){function l(){return null!==n&&n.apply(this,arguments)||this}return u(l,n),l.prototype.parse=function(n){var l=this,e=new i.ImportResult,t=this.parseCsv(n,!0);return null==t?(e.success=!1,e):(t.forEach(function(n){var t=l.initLoginCipher();t.name=l.getValueOrDefault(n.name,l.getValueOrDefault(l.nameFromUrl(n.website),"--")),t.login.uris=l.makeUriArray(n.website),t.login.password=l.getValueOrDefault(n.password),l.isNullOrWhitespace(n.username)&&!l.isNullOrWhitespace(n.secondary_username)?t.login.username=n.secondary_username:(t.login.username=l.getValueOrDefault(n.username),t.notes=l.getValueOrDefault(n.secondary_username)),l.cleanupCipher(t),e.ciphers.push(t)}),e.success=!0,e)},l}(o.BaseImporter);l.AviraCsvImporter=r},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)});Object.defineProperty(l,"__esModule",{value:!0});var o=e(32),i=e(31),r=function(n){function l(){return null!==n&&n.apply(this,arguments)||this}return u(l,n),l.prototype.parse=function(n){var l=this,e=new i.ImportResult,t=this.parseCsv(n,!1);return null==t?(e.success=!1,e):(t.forEach(function(n){if(!(n.length<2)){var t=l.initLoginCipher();if(t.notes=l.getValueOrDefault(n[n.length-1]),t.name=l.getValueOrDefault(n[0],"--"),n.length>2&&n.length%2==0)for(var u=0;u-1?t.login.password=l.getValueOrDefault(o):null==t.login.username&&l.usernameFieldNames.indexOf(r)>-1?t.login.username=l.getValueOrDefault(o):(null==t.login.uris||0===t.login.uris.length)&&l.uriFieldNames.indexOf(r)>-1?t.login.uris=l.makeUriArray(o):l.processKvp(t,i,o)}}l.convertToNoteIfNeeded(t),l.cleanupCipher(t),e.ciphers.push(t)}}),e.success=!0,e)},l}(o.BaseImporter);l.AscendoCsvImporter=r},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(){this.ciphers=[],this.folders=[],this.folderRelationships=[]}}();l.ImportCiphersRequest=t},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=e(0),u=e(13),o=e(5),i=e(40),r=e(37),a=e(2),s=e(7),d=e(18),c=e(17),p=e(214),f=e(3),v=e(9),h=e(26),g=e(50),m=e(4),y=e(10),C=t.ɵcrt({encapsulation:2,styles:[],data:{}});function b(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,3,"option",[],null,null,null,null,null)),t.ɵdid(1,147456,null,0,u.NgSelectOption,[t.ElementRef,t.Renderer2,[2,u.SelectControlValueAccessor]],{ngValue:[0,"ngValue"]},null),t.ɵdid(2,147456,null,0,u.ɵq,[t.ElementRef,t.Renderer2,[8,null]],{ngValue:[0,"ngValue"]},null),(n()(),t.ɵted(3,null,["",""]))],function(n,l){n(l,1,0,l.context.$implicit.id),n(l,2,0,l.context.$implicit.id)},function(n,l){n(l,3,0,l.context.$implicit.name)})}function S(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,3,"option",[],null,null,null,null,null)),t.ɵdid(1,147456,null,0,u.NgSelectOption,[t.ElementRef,t.Renderer2,[2,u.SelectControlValueAccessor]],{ngValue:[0,"ngValue"]},null),t.ɵdid(2,147456,null,0,u.ɵq,[t.ElementRef,t.Renderer2,[8,null]],{ngValue:[0,"ngValue"]},null),(n()(),t.ɵted(3,null,["",""]))],function(n,l){n(l,1,0,l.context.$implicit.id),n(l,2,0,l.context.$implicit.id)},function(n,l){n(l,3,0,l.context.$implicit.name)})}function w(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,8,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,2,"option",[["disabled",""],["value","-"]],null,null,null,null,null)),t.ɵdid(3,147456,null,0,u.NgSelectOption,[t.ElementRef,t.Renderer2,[2,u.SelectControlValueAccessor]],{value:[0,"value"]},null),t.ɵdid(4,147456,null,0,u.ɵq,[t.ElementRef,t.Renderer2,[8,null]],{value:[0,"value"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,S)),t.ɵdid(7,802816,null,0,o.NgForOf,[t.ViewContainerRef,t.TemplateRef,t.IterableDiffers],{ngForOf:[0,"ngForOf"]},null),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){var e=l.component;n(l,3,0,"-");n(l,4,0,"-"),n(l,7,0,e.importOptions)},null)}function R(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,4,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n See detailed instructions on our help site at\n "])),(n()(),t.ɵeld(2,0,null,null,1,"a",[["href","https://help.bitwarden.com/article/export-your-data/"],["rel","noopener"],["target","_blank"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["https://help.bitwarden.com/article/export-your-data/"])),(n()(),t.ɵted(-1,null,["\n "]))],null,null)}function _(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,4,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n See detailed instructions on our help site at\n "])),(n()(),t.ɵeld(2,0,null,null,1,"a",[["href","https://help.bitwarden.com/article/import-from-lastpass/"],["rel","noopener"],["target","_blank"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["https://help.bitwarden.com/article/import-from-lastpass/"])),(n()(),t.ɵted(-1,null,["\n "]))],null,null)}function I(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Using the KeePassX desktop application, navigate to "Database" → "Export to CSV file" and save the CSV file.\n ']))],null,null)}function A(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n In the Avira web vault, go to "Settings" → "My Data" → "Export data" and save the CSV file.\n ']))],null,null)}function E(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n In the Blur web vault, click your username at the top and go to "Settings" → "Export Data", then click "Export CSV"\n for your "Accounts".\n ']))],null,null)}function O(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Using the SaveInCloud desktop application, navigate to "File" → "Export" → "As XML" and save the XML file.\n ']))],null,null)}function N(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Using the Padlock desktop application, click the hamburger icon in the top left corner and navigate to "Settings" →\n "Export" button and save the file "As CSV".\n ']))],null,null)}function T(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Using the KeePass 2 desktop application, navigate to "File" → "Export" and select the "KeePass XML (2.x)" option.\n ']))],null,null)}function k(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Using the Universal Password Manager desktop application, navigate to "Database" → "Export" and save the CSV file.\n ']))],null,null)}function V(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Using the SaferPass browser extension, click the hamburger icon in the top left corner and navigate to "Settings". Click\n the "Export accounts" button to save the CSV file.\n ']))],null,null)}function P(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Using the Meldium web vault, navigate to "Settings". Locate the "Export data" function and click "Show me my data" to save\n the CSV file.\n ']))],null,null)}function M(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Log into the Keeper web vault (keepersecurity.com/vault). Navigate to "Backup" (top right) and find the "Export to .csv File"\n option. Click "Export Now" to save the CSV file.\n ']))],null,null)}function x(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"span",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n The process is exactly the same as importing from Google Chrome.\n "]))],null,null)}function D(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,7,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,x)),t.ɵdid(3,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n See detailed instructions on our help site at\n "])),(n()(),t.ɵeld(5,0,null,null,1,"a",[["href","https://help.bitwarden.com/article/import-from-chrome/"],["rel","noopener"],["target","_blank"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["https://help.bitwarden.com/article/import-from-chrome/"])),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){n(l,3,0,"chromecsv"!==l.component.format)},null)}function U(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,4,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n Use the\n "])),(n()(),t.ɵeld(2,0,null,null,1,"a",[["href","https://github.com/kspearrin/ff-password-exporter/blob/master/README.md#ff-password-exporter"],["rel","noopener"],["target","_blank"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["FF Password Exporter"])),(n()(),t.ɵted(-1,null,[" application to export your passwords to a CSV file.\n "]))],null,null)}function F(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,4,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n See detailed instructions on our help site at\n "])),(n()(),t.ɵeld(2,0,null,null,1,"a",[["href","https://help.bitwarden.com/article/import-from-1password/"],["rel","noopener"],["target","_blank"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["https://help.bitwarden.com/article/import-from-1password/"])),(n()(),t.ɵted(-1,null,[".\n "]))],null,null)}function L(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Using the Password Dragon desktop application, navigate to "File" → "Export" → "To XML". In the dialog that pops\n up select "All Rows" and check all fields. Click the "Export" button and save the XML file.\n ']))],null,null)}function G(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Using the Enpass desktop application, navigate to "File" → "Export" → "As CSV". Select "OK" to the warning alert\n and save the CSV file. Note that the importer only supports files exported while Enpass is set to the English\n language, so adjust your settings accordingly.\n ']))],null,null)}function q(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Using the Password Safe desktop application, navigate to "File" → "Export To" → "XML format..." and save the XML\n file.\n ']))],null,null)}function z(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Using the Dashlane desktop application, navigate to "File" → "Export" → "Unsecured archive (readable) in CSV format"\n and save the CSV file.\n ']))],null,null)}function j(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Using the mSecure desktop application, navigate to "File" → "Export" → "CSV File..." and save the CSV file.\n ']))],null,null)}function B(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Using the Sticky Password desktop application, navigate to "Menu" (top right) → "Export" → "Export all". Select\n the unencrypted format XML option and save the XML file.\n ']))],null,null)}function K(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Using the True Key desktop application, click the gear icon (top right) and then navigate to "App Settings". Click the "Export"\n button, enter your password and save the CSV file.\n ']))],null,null)}function H(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Log into the Clipperz web application (clipperz.is/app). Click the hamburger menu icon in the top right to expand the navigation\n bar. Navigate to "Data" → "Export". Click the "download HTML+JSON" button to save the HTML file.\n ']))],null,null)}function $(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Using the RoboForm Editor desktop application, navigate to "RoboForm" (top left) → "Options" → "Account & Data"\n and click the "Export" button. Select all of your data, change the "Format" to "CSV file" and then click the\n "Export" button to save the CSV file. Note: RoboForm only allows you to export Logins. Other items will not be\n exported.\n ']))],null,null)}function W(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Log into the Passbolt web vault and navigate to the "Passwords" listing. Select all of the passwords you would like to export\n and click the "Export" button at the top of the listing. Choose the "csv (lastpass)" export format and click\n the "Export" button.\n ']))],null,null)}function Y(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Using the Ascendo DataVault desktop application, navigate to "Tools" → "Export". In the dialog that pops up, select\n the "All Items (DVX, CSV)" option. Click the "Ok" button to save the CSV file.\n ']))],null,null)}function Z(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Using the Password Boss desktop application, navigate to "File" → "Export data" → "Password Boss JSON - not encrypted"\n and save the JSON file.\n ']))],null,null)}function J(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,4,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Log into the Zoho web vault (vault.zoho.com). Navigate to "Tools" → "Export Secrets". Select "All Secrets" and click\n the "Zoho Vault Format CSV" button. Highlight and copy the data from the textarea. Open a text editor like Notepad\n and paste the data. Save the data from the text editor as\n '])),(n()(),t.ɵeld(2,0,null,null,1,"code",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["zoho_export.csv"])),(n()(),t.ɵted(-1,null,[".\n "]))],null,null)}function X(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Using the SplashID Safe desktop application, click on the SplashID blue lock logo in the top right corner. Navigate to "Export"\n → "Export as CSV" and save the CSV file.\n ']))],null,null)}function Q(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Using the PassKeep mobile app, navigate to "Backup/Restore". Locate the "CSV Backup/Restore" section and click "Backup to\n CSV" to save the CSV file.\n ']))],null,null)}function nn(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,16,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n Make sure you have python-keyring and python-gnomekeyring installed. Save the\n "])),(n()(),t.ɵeld(2,0,null,null,1,"a",[["href","https://bit.ly/2sMldAI"],["rel","noopener"],["target","_blank"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["GNOME Keyring Import/Export"])),(n()(),t.ɵted(-1,null,[" python script to your desktop as\n "])),(n()(),t.ɵeld(5,0,null,null,1,"code",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["pw_helper.py"])),(n()(),t.ɵted(-1,null,[". Open terminal and run\n "])),(n()(),t.ɵeld(8,0,null,null,1,"code",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["chmod +rx Desktop/pw_helper.py"])),(n()(),t.ɵted(-1,null,[" and then\n "])),(n()(),t.ɵeld(11,0,null,null,1,"code",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["python Desktop/pw_helper.py export Desktop/my_passwords.json"])),(n()(),t.ɵted(-1,null,[". Then upload the resulting\n "])),(n()(),t.ɵeld(14,0,null,null,1,"code",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["my_passwords.json"])),(n()(),t.ɵted(-1,null,[" file here to Bitwarden.\n "]))],null,null)}function ln(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Using the Password Agent desktop application navigate to "File" → "Export", select the "Fields to export" button and\n check all of the fields, change the "Output format" to "CSV", and then click the "Start" button to save the CSV\n file.\n ']))],null,null)}function en(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,98,"app-callout",[["type","info"]],null,null,null,i.View_CalloutComponent_0,i.RenderType_CalloutComponent)),t.ɵdid(1,114688,null,0,r.CalloutComponent,[a.I18nService],{type:[0,"type"],title:[1,"title"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,R)),t.ɵdid(4,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,_)),t.ɵdid(7,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,I)),t.ɵdid(10,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,A)),t.ɵdid(13,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,E)),t.ɵdid(16,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,O)),t.ɵdid(19,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,N)),t.ɵdid(22,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,T)),t.ɵdid(25,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,k)),t.ɵdid(28,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,V)),t.ɵdid(31,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,P)),t.ɵdid(34,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,M)),t.ɵdid(37,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,D)),t.ɵdid(40,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,U)),t.ɵdid(43,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,F)),t.ɵdid(46,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,L)),t.ɵdid(49,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,G)),t.ɵdid(52,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,q)),t.ɵdid(55,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,z)),t.ɵdid(58,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,j)),t.ɵdid(61,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,B)),t.ɵdid(64,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,K)),t.ɵdid(67,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,H)),t.ɵdid(70,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,$)),t.ɵdid(73,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,W)),t.ɵdid(76,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,Y)),t.ɵdid(79,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,Z)),t.ɵdid(82,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,J)),t.ɵdid(85,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,X)),t.ɵdid(88,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,Q)),t.ɵdid(91,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,nn)),t.ɵdid(94,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,ln)),t.ɵdid(97,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "]))],function(n,l){var e=l.component;n(l,1,0,"info",t.ɵinlineInterpolate(1,"",e.getFormatInstructionTitle(),"")),n(l,4,0,"bitwardencsv"===e.format),n(l,7,0,"lastpasscsv"===e.format),n(l,10,0,"keepassxcsv"===e.format),n(l,13,0,"aviracsv"===e.format),n(l,16,0,"blurcsv"===e.format),n(l,19,0,"safeincloudxml"===e.format),n(l,22,0,"padlockcsv"===e.format),n(l,25,0,"keepass2xml"===e.format),n(l,28,0,"upmcsv"===e.format),n(l,31,0,"saferpasscsv"===e.format),n(l,34,0,"meldiumcsv"===e.format),n(l,37,0,"keepercsv"===e.format),n(l,40,0,"chromecsv"===e.format||"operacsv"===e.format||"vivaldicsv"===e.format),n(l,43,0,"firefoxcsv"===e.format),n(l,46,0,"1password1pif"===e.format||"1passwordwincsv"===e.format),n(l,49,0,"passworddragonxml"===e.format),n(l,52,0,"enpasscsv"===e.format),n(l,55,0,"pwsafexml"===e.format),n(l,58,0,"dashlanecsv"===e.format),n(l,61,0,"msecurecsv"===e.format),n(l,64,0,"stickypasswordxml"===e.format),n(l,67,0,"truekeycsv"===e.format),n(l,70,0,"clipperzhtml"===e.format),n(l,73,0,"roboformcsv"===e.format),n(l,76,0,"passboltcsv"===e.format),n(l,79,0,"ascendocsv"===e.format),n(l,82,0,"passwordbossjson"===e.format),n(l,85,0,"zohovaultcsv"===e.format),n(l,88,0,"splashidcsv"===e.format),n(l,91,0,"passkeepcsv"===e.format),n(l,94,0,"gnomejson"===e.format),n(l,97,0,"passwordagentcsv"===e.format)},null)}function tn(n){return t.ɵvid(0,[t.ɵpid(0,s.I18nPipe,[a.I18nService]),(n()(),t.ɵeld(1,0,null,null,5,"div",[["class","page-header"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(3,0,null,null,2,"h1",[],null,null,null,null,null)),(n()(),t.ɵted(4,null,["",""])),t.ɵppd(5,1),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵeld(8,0,[["form",1]],null,76,"form",[["ngNativeValidate",""]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngSubmit"],[null,"submit"],[null,"reset"]],function(n,l,e){var u=!0,o=n.component;"submit"===l&&(u=!1!==t.ɵnov(n,9).onSubmit(e)&&u);"reset"===l&&(u=!1!==t.ɵnov(n,9).onReset()&&u);"ngSubmit"===l&&(u=!1!==o.submit()&&u);return u},null,null)),t.ɵdid(9,4210688,null,0,u.NgForm,[[8,null],[8,null]],null,{ngSubmit:"ngSubmit"}),t.ɵprd(2048,null,u.ControlContainer,null,[u.NgForm]),t.ɵdid(11,16384,null,0,u.NgControlStatusGroup,[u.ControlContainer],null,null),t.ɵdid(12,540672,null,0,d.ApiActionDirective,[t.ElementRef,c.ValidationService],{appApiAction:[0,"appApiAction"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(14,0,null,null,27,"div",[["class","row"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(16,0,null,null,24,"div",[["class","col-6"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(18,0,null,null,21,"div",[["class","form-group"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(20,0,null,null,2,"label",[["for","type"]],null,null,null,null,null)),(n()(),t.ɵted(21,null,["1. ",""])),t.ɵppd(22,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(24,0,null,null,14,"select",[["class","form-control"],["id","type"],["name","Format"],["required",""]],[[1,"required",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"change"],[null,"blur"]],function(n,l,e){var u=!0,o=n.component;"change"===l&&(u=!1!==t.ɵnov(n,25).onChange(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,25).onTouched()&&u);"ngModelChange"===l&&(u=!1!==(o.format=e)&&u);return u},null,null)),t.ɵdid(25,16384,null,0,u.SelectControlValueAccessor,[t.Renderer2,t.ElementRef],null,null),t.ɵdid(26,16384,null,0,u.RequiredValidator,[],{required:[0,"required"]},null),t.ɵprd(1024,null,u.NG_VALIDATORS,function(n){return[n]},[u.RequiredValidator]),t.ɵprd(1024,null,u.NG_VALUE_ACCESSOR,function(n){return[n]},[u.SelectControlValueAccessor]),t.ɵdid(29,671744,null,0,u.NgModel,[[2,u.ControlContainer],[2,u.NG_VALIDATORS],[8,null],[2,u.NG_VALUE_ACCESSOR]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,u.NgControl,null,[u.NgModel]),t.ɵdid(31,16384,null,0,u.NgControlStatus,[u.NgControl],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,b)),t.ɵdid(34,802816,null,0,o.NgForOf,[t.ViewContainerRef,t.TemplateRef,t.IterableDiffers],{ngForOf:[0,"ngForOf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,w)),t.ɵdid(37,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,en)),t.ɵdid(44,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(46,0,null,null,13,"div",[["class","row"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(48,0,null,null,10,"div",[["class","col-6"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(50,0,null,null,7,"div",[["class","form-group"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(52,0,null,null,2,"label",[["for","file"]],null,null,null,null,null)),(n()(),t.ɵted(53,null,["2. ",""])),t.ɵppd(54,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(56,0,null,null,0,"input",[["class","form-control-file"],["id","file"],["name","file"],["type","file"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(61,0,null,null,12,"div",[["class","form-group"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(63,0,null,null,2,"label",[["for","fileContents"]],null,null,null,null,null)),(n()(),t.ɵted(64,null,["",""])),t.ɵppd(65,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(67,0,null,null,5,"textarea",[["class","form-control"],["id","fileContents"],["name","FileContents"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(n,l,e){var u=!0,o=n.component;"input"===l&&(u=!1!==t.ɵnov(n,68)._handleInput(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,68).onTouched()&&u);"compositionstart"===l&&(u=!1!==t.ɵnov(n,68)._compositionStart()&&u);"compositionend"===l&&(u=!1!==t.ɵnov(n,68)._compositionEnd(e.target.value)&&u);"ngModelChange"===l&&(u=!1!==(o.fileContents=e)&&u);return u},null,null)),t.ɵdid(68,16384,null,0,u.DefaultValueAccessor,[t.Renderer2,t.ElementRef,[2,u.COMPOSITION_BUFFER_MODE]],null,null),t.ɵprd(1024,null,u.NG_VALUE_ACCESSOR,function(n){return[n]},[u.DefaultValueAccessor]),t.ɵdid(70,671744,null,0,u.NgModel,[[2,u.ControlContainer],[8,null],[8,null],[2,u.NG_VALUE_ACCESSOR]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,u.NgControl,null,[u.NgModel]),t.ɵdid(72,16384,null,0,u.NgControlStatus,[u.NgControl],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(75,0,null,null,8,"button",[["class","btn btn-primary btn-submit"],["type","submit"]],[[8,"disabled",0]],null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(77,0,null,null,1,"i",[["class","fa fa-spinner fa-spin"]],[[8,"title",0]],null,null,null,null)),t.ɵppd(78,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(80,0,null,null,2,"span",[],null,null,null,null,null)),(n()(),t.ɵted(81,null,["",""])),t.ɵppd(82,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){var e=l.component;n(l,12,0,e.formPromise);n(l,26,0,"");n(l,29,0,"Format",e.format),n(l,34,0,e.featuredImportOptions),n(l,37,0,e.importOptions&&e.importOptions.length),n(l,44,0,e.format);n(l,70,0,"FileContents",e.fileContents)},function(n,l){n(l,4,0,t.ɵunv(l,4,0,n(l,5,0,t.ɵnov(l,0),"importData"))),n(l,8,0,t.ɵnov(l,11).ngClassUntouched,t.ɵnov(l,11).ngClassTouched,t.ɵnov(l,11).ngClassPristine,t.ɵnov(l,11).ngClassDirty,t.ɵnov(l,11).ngClassValid,t.ɵnov(l,11).ngClassInvalid,t.ɵnov(l,11).ngClassPending),n(l,21,0,t.ɵunv(l,21,0,n(l,22,0,t.ɵnov(l,0),"selectFormat"))),n(l,24,0,t.ɵnov(l,26).required?"":null,t.ɵnov(l,31).ngClassUntouched,t.ɵnov(l,31).ngClassTouched,t.ɵnov(l,31).ngClassPristine,t.ɵnov(l,31).ngClassDirty,t.ɵnov(l,31).ngClassValid,t.ɵnov(l,31).ngClassInvalid,t.ɵnov(l,31).ngClassPending),n(l,53,0,t.ɵunv(l,53,0,n(l,54,0,t.ɵnov(l,0),"selectImportFile"))),n(l,64,0,t.ɵunv(l,64,0,n(l,65,0,t.ɵnov(l,0),"orCopyPasteFileContents"))),n(l,67,0,t.ɵnov(l,72).ngClassUntouched,t.ɵnov(l,72).ngClassTouched,t.ɵnov(l,72).ngClassPristine,t.ɵnov(l,72).ngClassDirty,t.ɵnov(l,72).ngClassValid,t.ɵnov(l,72).ngClassInvalid,t.ɵnov(l,72).ngClassPending),n(l,75,0,t.ɵnov(l,8).loading),n(l,77,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,77,0,n(l,78,0,t.ɵnov(l,0),"loading")),"")),n(l,81,0,t.ɵunv(l,81,0,n(l,82,0,t.ɵnov(l,0),"importData")))})}function un(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"app-import",[],null,null,null,tn,C)),t.ɵdid(1,114688,null,0,p.ImportComponent,[a.I18nService,f.Angulartics2,v.ToasterService,h.CipherService,g.FolderService,m.ApiService,y.Router],null,null)],function(n,l){n(l,1,0)},null)}l.RenderType_ImportComponent=C,l.View_ImportComponent_0=tn,l.View_ImportComponent_Host_0=un;var on=t.ɵccf("app-import",p.ImportComponent,un,{},{},[]);l.ImportComponentNgFactory=on},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=e(0),u=e(7),o=e(2),i=e(10),r=e(5),a=e(261),s=t.ɵcrt({encapsulation:2,styles:[],data:{}});function d(n){return t.ɵvid(0,[t.ɵpid(0,u.I18nPipe,[o.I18nService]),(n()(),t.ɵeld(1,0,null,null,65,"div",[["class","container page-content"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(3,0,null,null,62,"div",[["class","row"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(5,0,null,null,53,"div",[["class","col-3"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(7,0,null,null,32,"div",[["class","card mb-4"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(9,0,null,null,2,"div",[["class","card-header"]],null,null,null,null,null)),(n()(),t.ɵted(10,null,["",""])),t.ɵppd(11,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(13,0,null,null,25,"div",[["class","list-group list-group-flush"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(15,0,null,null,6,"a",[["class","list-group-item"],["routerLink","generator"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(n,l,e){var u=!0;"click"===l&&(u=!1!==t.ɵnov(n,16).onClick(e.button,e.ctrlKey,e.metaKey,e.shiftKey)&&u);return u},null,null)),t.ɵdid(16,671744,[[2,4]],0,i.RouterLinkWithHref,[i.Router,i.ActivatedRoute,r.LocationStrategy],{routerLink:[0,"routerLink"]},null),t.ɵdid(17,1720320,null,2,i.RouterLinkActive,[i.Router,t.ElementRef,t.Renderer2,t.ChangeDetectorRef],{routerLinkActive:[0,"routerLinkActive"]},null),t.ɵqud(603979776,1,{links:1}),t.ɵqud(603979776,2,{linksWithHrefs:1}),(n()(),t.ɵted(20,null,["\n ","\n "])),t.ɵppd(21,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(23,0,null,null,6,"a",[["class","list-group-item"],["routerLink","import"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(n,l,e){var u=!0;"click"===l&&(u=!1!==t.ɵnov(n,24).onClick(e.button,e.ctrlKey,e.metaKey,e.shiftKey)&&u);return u},null,null)),t.ɵdid(24,671744,[[4,4]],0,i.RouterLinkWithHref,[i.Router,i.ActivatedRoute,r.LocationStrategy],{routerLink:[0,"routerLink"]},null),t.ɵdid(25,1720320,null,2,i.RouterLinkActive,[i.Router,t.ElementRef,t.Renderer2,t.ChangeDetectorRef],{routerLinkActive:[0,"routerLinkActive"]},null),t.ɵqud(603979776,3,{links:1}),t.ɵqud(603979776,4,{linksWithHrefs:1}),(n()(),t.ɵted(28,null,["\n ","\n "])),t.ɵppd(29,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(31,0,null,null,6,"a",[["class","list-group-item"],["routerLink","export"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(n,l,e){var u=!0;"click"===l&&(u=!1!==t.ɵnov(n,32).onClick(e.button,e.ctrlKey,e.metaKey,e.shiftKey)&&u);return u},null,null)),t.ɵdid(32,671744,[[6,4]],0,i.RouterLinkWithHref,[i.Router,i.ActivatedRoute,r.LocationStrategy],{routerLink:[0,"routerLink"]},null),t.ɵdid(33,1720320,null,2,i.RouterLinkActive,[i.Router,t.ElementRef,t.Renderer2,t.ChangeDetectorRef],{routerLinkActive:[0,"routerLinkActive"]},null),t.ɵqud(603979776,5,{links:1}),t.ɵqud(603979776,6,{linksWithHrefs:1}),(n()(),t.ɵted(36,null,["\n ","\n "])),t.ɵppd(37,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(41,0,null,null,16,"div",[["class","card"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(43,0,null,null,2,"div",[["class","card-header"]],null,null,null,null,null)),(n()(),t.ɵted(44,null,["",""])),t.ɵppd(45,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(47,0,null,null,9,"div",[["class","list-group list-group-flush"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(49,0,null,null,6,"a",[["class","list-group-item"],["routerLink","breach-report"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(n,l,e){var u=!0;"click"===l&&(u=!1!==t.ɵnov(n,50).onClick(e.button,e.ctrlKey,e.metaKey,e.shiftKey)&&u);return u},null,null)),t.ɵdid(50,671744,[[8,4]],0,i.RouterLinkWithHref,[i.Router,i.ActivatedRoute,r.LocationStrategy],{routerLink:[0,"routerLink"]},null),t.ɵdid(51,1720320,null,2,i.RouterLinkActive,[i.Router,t.ElementRef,t.Renderer2,t.ChangeDetectorRef],{routerLinkActive:[0,"routerLinkActive"]},null),t.ɵqud(603979776,7,{links:1}),t.ɵqud(603979776,8,{linksWithHrefs:1}),(n()(),t.ɵted(54,null,["\n ","\n "])),t.ɵppd(55,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(60,0,null,null,4,"div",[["class","col-9"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(62,16777216,null,null,1,"router-outlet",[],null,null,null,null,null)),t.ɵdid(63,212992,null,0,i.RouterOutlet,[i.ChildrenOutletContexts,t.ViewContainerRef,t.ComponentFactoryResolver,[8,null],t.ChangeDetectorRef],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){n(l,16,0,"generator");n(l,17,0,"active");n(l,24,0,"import");n(l,25,0,"active");n(l,32,0,"export");n(l,33,0,"active");n(l,50,0,"breach-report");n(l,51,0,"active"),n(l,63,0)},function(n,l){n(l,10,0,t.ɵunv(l,10,0,n(l,11,0,t.ɵnov(l,0),"tools"))),n(l,15,0,t.ɵnov(l,16).target,t.ɵnov(l,16).href),n(l,20,0,t.ɵunv(l,20,0,n(l,21,0,t.ɵnov(l,0),"passwordGenerator"))),n(l,23,0,t.ɵnov(l,24).target,t.ɵnov(l,24).href),n(l,28,0,t.ɵunv(l,28,0,n(l,29,0,t.ɵnov(l,0),"importData"))),n(l,31,0,t.ɵnov(l,32).target,t.ɵnov(l,32).href),n(l,36,0,t.ɵunv(l,36,0,n(l,37,0,t.ɵnov(l,0),"exportVault"))),n(l,44,0,t.ɵunv(l,44,0,n(l,45,0,t.ɵnov(l,0),"reports"))),n(l,49,0,t.ɵnov(l,50).target,t.ɵnov(l,50).href),n(l,54,0,t.ɵunv(l,54,0,n(l,55,0,t.ɵnov(l,0),"dataBreachReport")))})}function c(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"app-tools",[],null,null,null,d,s)),t.ɵdid(1,49152,null,0,a.ToolsComponent,[],null,null)],null,null)}l.RenderType_ToolsComponent=s,l.View_ToolsComponent_0=d,l.View_ToolsComponent_Host_0=c;var p=t.ɵccf("app-tools",a.ToolsComponent,c,{},{},[]);l.ToolsComponentNgFactory=p},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(){}}();l.OrganizationCreateRequest=t},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=e(0),u=e(13),o=e(18),i=e(17),r=e(5),a=e(269),s=e(127),d=e(2),c=e(8),p=e(7),f=e(262),v=e(4),h=e(3),g=e(9),m=e(20),y=e(10),C=e(66),b=t.ɵcrt({encapsulation:2,styles:[],data:{}});function S(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,35,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,2,"p",[],null,null,null,null,null)),(n()(),t.ɵted(3,null,["",""])),t.ɵppd(4,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(6,0,[["form",1]],null,28,"form",[["ngNativeValidate",""]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngSubmit"],[null,"submit"],[null,"reset"]],function(n,l,e){var u=!0,o=n.component;"submit"===l&&(u=!1!==t.ɵnov(n,7).onSubmit(e)&&u);"reset"===l&&(u=!1!==t.ɵnov(n,7).onReset()&&u);"ngSubmit"===l&&(u=!1!==o.submit()&&u);return u},null,null)),t.ɵdid(7,4210688,null,0,u.NgForm,[[8,null],[8,null]],null,{ngSubmit:"ngSubmit"}),t.ɵprd(2048,null,u.ControlContainer,null,[u.NgForm]),t.ɵdid(9,16384,null,0,u.NgControlStatusGroup,[u.ControlContainer],null,null),t.ɵdid(10,540672,null,0,o.ApiActionDirective,[t.ElementRef,i.ValidationService],{appApiAction:[0,"appApiAction"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(12,0,null,null,11,"div",[["class","form-group"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(14,0,null,null,2,"label",[["for","file"]],null,null,null,null,null)),(n()(),t.ɵted(15,null,["",""])),t.ɵppd(16,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(18,0,null,null,0,"input",[["class","form-control-file"],["id","file"],["name","file"],["required",""],["type","file"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(20,0,null,null,2,"small",[["class","form-text text-muted"]],null,null,null,null,null)),(n()(),t.ɵted(21,null,["",""])),t.ɵppd(22,2),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(25,0,null,null,8,"button",[["class","btn btn-primary btn-submit"],["type","submit"]],[[8,"disabled",0]],null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(27,0,null,null,1,"i",[["class","fa fa-spinner fa-spin"]],[[8,"title",0]],null,null,null,null)),t.ɵppd(28,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(30,0,null,null,2,"span",[],null,null,null,null,null)),(n()(),t.ɵted(31,null,["",""])),t.ɵppd(32,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){n(l,10,0,l.component.formPromise)},function(n,l){n(l,3,0,t.ɵunv(l,3,0,n(l,4,0,t.ɵnov(l.parent,0),"uploadLicenseFileOrg"))),n(l,6,0,t.ɵnov(l,9).ngClassUntouched,t.ɵnov(l,9).ngClassTouched,t.ɵnov(l,9).ngClassPristine,t.ɵnov(l,9).ngClassDirty,t.ɵnov(l,9).ngClassValid,t.ɵnov(l,9).ngClassInvalid,t.ɵnov(l,9).ngClassPending),n(l,15,0,t.ɵunv(l,15,0,n(l,16,0,t.ɵnov(l.parent,0),"licenseFile"))),n(l,21,0,t.ɵunv(l,21,0,n(l,22,0,t.ɵnov(l.parent,0),"licenseFileDesc","bitwarden_organization_license.json"))),n(l,25,0,t.ɵnov(l,6).loading),n(l,27,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,27,0,n(l,28,0,t.ɵnov(l.parent,0),"loading")),"")),n(l,31,0,t.ɵunv(l,31,0,n(l,32,0,t.ɵnov(l.parent,0),"submit")))})}function w(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,15,"div",[["class","row"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,12,"div",[["class","form-group col-6"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(4,0,null,null,2,"label",[["for","businessName"]],null,null,null,null,null)),(n()(),t.ɵted(5,null,["",""])),t.ɵppd(6,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(8,0,null,null,5,"input",[["class","form-control"],["id","businessName"],["name","BusinessName"],["type","text"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(n,l,e){var u=!0,o=n.component;"input"===l&&(u=!1!==t.ɵnov(n,9)._handleInput(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,9).onTouched()&&u);"compositionstart"===l&&(u=!1!==t.ɵnov(n,9)._compositionStart()&&u);"compositionend"===l&&(u=!1!==t.ɵnov(n,9)._compositionEnd(e.target.value)&&u);"ngModelChange"===l&&(u=!1!==(o.businessName=e)&&u);return u},null,null)),t.ɵdid(9,16384,null,0,u.DefaultValueAccessor,[t.Renderer2,t.ElementRef,[2,u.COMPOSITION_BUFFER_MODE]],null,null),t.ɵprd(1024,null,u.NG_VALUE_ACCESSOR,function(n){return[n]},[u.DefaultValueAccessor]),t.ɵdid(11,671744,null,0,u.NgModel,[[2,u.ControlContainer],[8,null],[8,null],[2,u.NG_VALUE_ACCESSOR]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,u.NgControl,null,[u.NgModel]),t.ɵdid(13,16384,null,0,u.NgControlStatus,[u.NgControl],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){n(l,11,0,"BusinessName",l.component.businessName)},function(n,l){n(l,5,0,t.ɵunv(l,5,0,n(l,6,0,t.ɵnov(l.parent.parent,0),"businessName"))),n(l,8,0,t.ɵnov(l,13).ngClassUntouched,t.ɵnov(l,13).ngClassTouched,t.ɵnov(l,13).ngClassPristine,t.ɵnov(l,13).ngClassDirty,t.ɵnov(l,13).ngClassValid,t.ɵnov(l,13).ngClassInvalid,t.ɵnov(l,13).ngClassPending)})}function R(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,29,"div",[["class","form-check form-check-block"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,6,"input",[["class","form-check-input"],["id","planFree"],["name","PlanType"],["type","radio"],["value","free"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"change"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(n,l,e){var u=!0,o=n.component;"input"===l&&(u=!1!==t.ɵnov(n,3)._handleInput(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,3).onTouched()&&u);"compositionstart"===l&&(u=!1!==t.ɵnov(n,3)._compositionStart()&&u);"compositionend"===l&&(u=!1!==t.ɵnov(n,3)._compositionEnd(e.target.value)&&u);"change"===l&&(u=!1!==t.ɵnov(n,4).onChange()&&u);"blur"===l&&(u=!1!==t.ɵnov(n,4).onTouched()&&u);"ngModelChange"===l&&(u=!1!==(o.plan=e)&&u);"change"===l&&(u=!1!==o.changedPlan()&&u);return u},null,null)),t.ɵdid(3,16384,null,0,u.DefaultValueAccessor,[t.Renderer2,t.ElementRef,[2,u.COMPOSITION_BUFFER_MODE]],null,null),t.ɵdid(4,212992,null,0,u.RadioControlValueAccessor,[t.Renderer2,t.ElementRef,u.ɵi,t.Injector],{name:[0,"name"],value:[1,"value"]},null),t.ɵprd(1024,null,u.NG_VALUE_ACCESSOR,function(n,l){return[n,l]},[u.DefaultValueAccessor,u.RadioControlValueAccessor]),t.ɵdid(6,671744,null,0,u.NgModel,[[2,u.ControlContainer],[8,null],[8,null],[2,u.NG_VALUE_ACCESSOR]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,u.NgControl,null,[u.NgModel]),t.ɵdid(8,16384,null,0,u.NgControlStatus,[u.NgControl],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(10,0,null,null,18,"label",[["class","form-check-label"],["for","planFree"]],null,null,null,null,null)),(n()(),t.ɵted(11,null,["\n ","\n "])),t.ɵppd(12,1),(n()(),t.ɵeld(13,0,null,null,2,"small",[["class","mb-1"]],null,null,null,null,null)),(n()(),t.ɵted(14,null,["",""])),t.ɵppd(15,2),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(17,0,null,null,2,"small",[],null,null,null,null,null)),(n()(),t.ɵted(18,null,["• ",""])),t.ɵppd(19,2),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(21,0,null,null,2,"small",[],null,null,null,null,null)),(n()(),t.ɵted(22,null,["• ",""])),t.ɵppd(23,2),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(25,0,null,null,2,"span",[],null,null,null,null,null)),(n()(),t.ɵted(26,null,["",""])),t.ɵppd(27,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){var e=l.component;n(l,4,0,"PlanType","free");n(l,6,0,"PlanType",e.plan)},function(n,l){n(l,2,0,t.ɵnov(l,8).ngClassUntouched,t.ɵnov(l,8).ngClassTouched,t.ɵnov(l,8).ngClassPristine,t.ɵnov(l,8).ngClassDirty,t.ɵnov(l,8).ngClassValid,t.ɵnov(l,8).ngClassInvalid,t.ɵnov(l,8).ngClassPending),n(l,11,0,t.ɵunv(l,11,0,n(l,12,0,t.ɵnov(l.parent.parent,0),"planNameFree"))),n(l,14,0,t.ɵunv(l,14,0,n(l,15,0,t.ɵnov(l.parent.parent,0),"planDescFree","1"))),n(l,18,0,t.ɵunv(l,18,0,n(l,19,0,t.ɵnov(l.parent.parent,0),"limitedUsers","2"))),n(l,22,0,t.ɵunv(l,22,0,n(l,23,0,t.ɵnov(l.parent.parent,0),"limitedCollections","2"))),n(l,26,0,t.ɵunv(l,26,0,n(l,27,0,t.ɵnov(l.parent.parent,0),"freeForever")))})}function _(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,47,"div",[["class","form-check form-check-block"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,6,"input",[["class","form-check-input"],["id","planFamilies"],["name","PlanType"],["type","radio"],["value","families"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"change"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(n,l,e){var u=!0,o=n.component;"input"===l&&(u=!1!==t.ɵnov(n,3)._handleInput(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,3).onTouched()&&u);"compositionstart"===l&&(u=!1!==t.ɵnov(n,3)._compositionStart()&&u);"compositionend"===l&&(u=!1!==t.ɵnov(n,3)._compositionEnd(e.target.value)&&u);"change"===l&&(u=!1!==t.ɵnov(n,4).onChange()&&u);"blur"===l&&(u=!1!==t.ɵnov(n,4).onTouched()&&u);"ngModelChange"===l&&(u=!1!==(o.plan=e)&&u);"change"===l&&(u=!1!==o.changedPlan()&&u);return u},null,null)),t.ɵdid(3,16384,null,0,u.DefaultValueAccessor,[t.Renderer2,t.ElementRef,[2,u.COMPOSITION_BUFFER_MODE]],null,null),t.ɵdid(4,212992,null,0,u.RadioControlValueAccessor,[t.Renderer2,t.ElementRef,u.ɵi,t.Injector],{name:[0,"name"],value:[1,"value"]},null),t.ɵprd(1024,null,u.NG_VALUE_ACCESSOR,function(n,l){return[n,l]},[u.DefaultValueAccessor,u.RadioControlValueAccessor]),t.ɵdid(6,671744,null,0,u.NgModel,[[2,u.ControlContainer],[8,null],[8,null],[2,u.NG_VALUE_ACCESSOR]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,u.NgControl,null,[u.NgModel]),t.ɵdid(8,16384,null,0,u.NgControlStatus,[u.NgControl],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(10,0,null,null,36,"label",[["class","form-check-label"],["for","planFamilies"]],null,null,null,null,null)),(n()(),t.ɵted(11,null,["\n ","\n "])),t.ɵppd(12,1),(n()(),t.ɵeld(13,0,null,null,2,"small",[["class","mb-1"]],null,null,null,null,null)),(n()(),t.ɵted(14,null,["",""])),t.ɵppd(15,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(17,0,null,null,2,"small",[],null,null,null,null,null)),(n()(),t.ɵted(18,null,["• ",""])),t.ɵppd(19,2),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(21,0,null,null,2,"small",[],null,null,null,null,null)),(n()(),t.ɵted(22,null,["• ",""])),t.ɵppd(23,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(25,0,null,null,2,"small",[],null,null,null,null,null)),(n()(),t.ɵted(26,null,["• ",""])),t.ɵppd(27,2),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(29,0,null,null,2,"small",[],null,null,null,null,null)),(n()(),t.ɵted(30,null,["• ",""])),t.ɵppd(31,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(33,0,null,null,2,"small",[],null,null,null,null,null)),(n()(),t.ɵted(34,null,["• ",""])),t.ɵppd(35,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(37,0,null,null,2,"small",[],null,null,null,null,null)),(n()(),t.ɵted(38,null,["• ",""])),t.ɵppd(39,2),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(41,0,null,null,4,"span",[],null,null,null,null,null)),(n()(),t.ɵted(42,null,[""," /",", ",""])),t.ɵppd(43,2),t.ɵppd(44,1),t.ɵppd(45,2),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){var e=l.component;n(l,4,0,"PlanType","families");n(l,6,0,"PlanType",e.plan)},function(n,l){n(l,2,0,t.ɵnov(l,8).ngClassUntouched,t.ɵnov(l,8).ngClassTouched,t.ɵnov(l,8).ngClassPristine,t.ɵnov(l,8).ngClassDirty,t.ɵnov(l,8).ngClassValid,t.ɵnov(l,8).ngClassInvalid,t.ɵnov(l,8).ngClassPending),n(l,11,0,t.ɵunv(l,11,0,n(l,12,0,t.ɵnov(l.parent.parent,0),"planNameFamilies"))),n(l,14,0,t.ɵunv(l,14,0,n(l,15,0,t.ɵnov(l.parent.parent,0),"planDescFamilies"))),n(l,18,0,t.ɵunv(l,18,0,n(l,19,0,t.ɵnov(l.parent.parent,0),"addShareLimitedUsers","5"))),n(l,22,0,t.ɵunv(l,22,0,n(l,23,0,t.ɵnov(l.parent.parent,0),"createUnlimitedCollections"))),n(l,26,0,t.ɵunv(l,26,0,n(l,27,0,t.ɵnov(l.parent.parent,0),"gbEncryptedFileStorage","1 GB"))),n(l,30,0,t.ɵunv(l,30,0,n(l,31,0,t.ɵnov(l.parent.parent,0),"onPremHostingOptional"))),n(l,34,0,t.ɵunv(l,34,0,n(l,35,0,t.ɵnov(l.parent.parent,0),"priorityCustomerSupport"))),n(l,38,0,t.ɵunv(l,38,0,n(l,39,0,t.ɵnov(l.parent.parent,0),"xDayFreeTrial","7"))),n(l,42,0,t.ɵunv(l,42,0,n(l,43,0,t.ɵnov(l.parent.parent,1),1,"$")),t.ɵunv(l,42,1,n(l,44,0,t.ɵnov(l.parent.parent,0),"month")),t.ɵunv(l,42,2,n(l,45,0,t.ɵnov(l.parent.parent,0),"includesXUsers",5)))})}function I(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,30,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,2,"h2",[["class","mt-5"]],null,null,null,null,null)),(n()(),t.ɵted(3,null,["",""])),t.ɵppd(4,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(6,0,null,null,23,"div",[["class","row"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(8,0,null,null,20,"div",[["class","col-6"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(10,0,null,null,2,"label",[["for","additionalSeats"]],null,null,null,null,null)),(n()(),t.ɵted(11,null,["",""])),t.ɵppd(12,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(14,0,null,null,9,"input",[["class","form-control"],["id","additionalSeats"],["max","100000"],["min","1"],["name","AdditionalSeats"],["required",""],["type","number"]],[[8,"placeholder",0],[1,"required",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"],[null,"change"]],function(n,l,e){var u=!0,o=n.component;"input"===l&&(u=!1!==t.ɵnov(n,15)._handleInput(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,15).onTouched()&&u);"compositionstart"===l&&(u=!1!==t.ɵnov(n,15)._compositionStart()&&u);"compositionend"===l&&(u=!1!==t.ɵnov(n,15)._compositionEnd(e.target.value)&&u);"change"===l&&(u=!1!==t.ɵnov(n,16).onChange(e.target.value)&&u);"input"===l&&(u=!1!==t.ɵnov(n,16).onChange(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,16).onTouched()&&u);"ngModelChange"===l&&(u=!1!==(o.additionalSeats=e)&&u);return u},null,null)),t.ɵdid(15,16384,null,0,u.DefaultValueAccessor,[t.Renderer2,t.ElementRef,[2,u.COMPOSITION_BUFFER_MODE]],null,null),t.ɵdid(16,16384,null,0,u.ɵbc,[t.Renderer2,t.ElementRef],null,null),t.ɵdid(17,16384,null,0,u.RequiredValidator,[],{required:[0,"required"]},null),t.ɵprd(1024,null,u.NG_VALIDATORS,function(n){return[n]},[u.RequiredValidator]),t.ɵprd(1024,null,u.NG_VALUE_ACCESSOR,function(n,l){return[n,l]},[u.DefaultValueAccessor,u.ɵbc]),t.ɵdid(20,671744,null,0,u.NgModel,[[2,u.ControlContainer],[2,u.NG_VALIDATORS],[8,null],[2,u.NG_VALUE_ACCESSOR]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,u.NgControl,null,[u.NgModel]),t.ɵdid(22,16384,null,0,u.NgControlStatus,[u.NgControl],null,null),t.ɵppd(23,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(25,0,null,null,2,"small",[["class","text-muted form-text"]],null,null,null,null,null)),(n()(),t.ɵted(26,null,["",""])),t.ɵppd(27,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){var e=l.component;n(l,17,0,"");n(l,20,0,"AdditionalSeats",e.additionalSeats)},function(n,l){n(l,3,0,t.ɵunv(l,3,0,n(l,4,0,t.ɵnov(l.parent.parent.parent,0),"users"))),n(l,11,0,t.ɵunv(l,11,0,n(l,12,0,t.ɵnov(l.parent.parent.parent,0),"userSeats"))),n(l,14,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,14,0,n(l,23,0,t.ɵnov(l.parent.parent.parent,0),"userSeatsDesc")),""),t.ɵnov(l,17).required?"":null,t.ɵnov(l,22).ngClassUntouched,t.ɵnov(l,22).ngClassTouched,t.ɵnov(l,22).ngClassPristine,t.ɵnov(l,22).ngClassDirty,t.ɵnov(l,22).ngClassValid,t.ɵnov(l,22).ngClassInvalid,t.ɵnov(l,22).ngClassPending),n(l,26,0,t.ɵunv(l,26,0,n(l,27,0,t.ɵnov(l.parent.parent.parent,0),"userSeatsHowManyDesc")))})}function A(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,22,"div",[["class","row"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,19,"div",[["class","form-group col-6"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(4,0,null,null,2,"label",[["for","additionalSeats"]],null,null,null,null,null)),(n()(),t.ɵted(5,null,["",""])),t.ɵppd(6,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(8,0,null,null,7,"input",[["class","form-control"],["id","additionalSeats"],["max","100000"],["min","0"],["name","AdditionalSeats"],["type","number"]],[[8,"placeholder",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"],[null,"change"]],function(n,l,e){var u=!0,o=n.component;"input"===l&&(u=!1!==t.ɵnov(n,9)._handleInput(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,9).onTouched()&&u);"compositionstart"===l&&(u=!1!==t.ɵnov(n,9)._compositionStart()&&u);"compositionend"===l&&(u=!1!==t.ɵnov(n,9)._compositionEnd(e.target.value)&&u);"change"===l&&(u=!1!==t.ɵnov(n,10).onChange(e.target.value)&&u);"input"===l&&(u=!1!==t.ɵnov(n,10).onChange(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,10).onTouched()&&u);"ngModelChange"===l&&(u=!1!==(o.additionalSeats=e)&&u);return u},null,null)),t.ɵdid(9,16384,null,0,u.DefaultValueAccessor,[t.Renderer2,t.ElementRef,[2,u.COMPOSITION_BUFFER_MODE]],null,null),t.ɵdid(10,16384,null,0,u.ɵbc,[t.Renderer2,t.ElementRef],null,null),t.ɵprd(1024,null,u.NG_VALUE_ACCESSOR,function(n,l){return[n,l]},[u.DefaultValueAccessor,u.ɵbc]),t.ɵdid(12,671744,null,0,u.NgModel,[[2,u.ControlContainer],[8,null],[8,null],[2,u.NG_VALUE_ACCESSOR]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,u.NgControl,null,[u.NgModel]),t.ɵdid(14,16384,null,0,u.NgControlStatus,[u.NgControl],null,null),t.ɵppd(15,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(17,0,null,null,3,"small",[["class","text-muted form-text"]],null,null,null,null,null)),(n()(),t.ɵted(18,null,["",""])),t.ɵppd(19,2),t.ɵppd(20,3),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){n(l,12,0,"AdditionalSeats",l.component.additionalSeats)},function(n,l){var e=l.component;n(l,5,0,t.ɵunv(l,5,0,n(l,6,0,t.ɵnov(l.parent.parent.parent,0),"additionalUserSeats"))),n(l,8,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,8,0,n(l,15,0,t.ɵnov(l.parent.parent.parent,0),"userSeatsDesc")),""),t.ɵnov(l,14).ngClassUntouched,t.ɵnov(l,14).ngClassTouched,t.ɵnov(l,14).ngClassPristine,t.ɵnov(l,14).ngClassDirty,t.ɵnov(l,14).ngClassValid,t.ɵnov(l,14).ngClassInvalid,t.ɵnov(l,14).ngClassPending),n(l,18,0,t.ɵunv(l,18,0,n(l,20,0,t.ɵnov(l.parent.parent.parent,0),"userSeatsAdditionalDesc",e.plans[e.plan].baseSeats,t.ɵunv(l,18,0,n(l,19,0,t.ɵnov(l.parent.parent.parent,1),e.plans[e.plan].seatPrice,"$")))))})}function E(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,6,"small",[],null,null,null,null,null)),(n()(),t.ɵted(1,null,["\n ",": "," ×12 "," = ","\n /","\n "])),t.ɵppd(2,1),t.ɵppd(3,2),t.ɵppd(4,1),t.ɵppd(5,2),t.ɵppd(6,1)],null,function(n,l){var e=l.component;n(l,1,0,t.ɵunv(l,1,0,n(l,2,0,t.ɵnov(l.parent.parent.parent,0),"basePrice")),t.ɵunv(l,1,1,n(l,3,0,t.ɵnov(l.parent.parent.parent,1),e.plans[e.plan].basePrice,"$")),t.ɵunv(l,1,2,n(l,4,0,t.ɵnov(l.parent.parent.parent,0),"monthAbbr")),t.ɵunv(l,1,3,n(l,5,0,t.ɵnov(l.parent.parent.parent,1),e.baseTotal(!0),"$")),t.ɵunv(l,1,4,n(l,6,0,t.ɵnov(l.parent.parent.parent,0),"year")))})}function O(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,2,"span",[],null,null,null,null,null)),(n()(),t.ɵted(1,null,["",":"])),t.ɵppd(2,1)],null,function(n,l){n(l,1,0,t.ɵunv(l,1,0,n(l,2,0,t.ɵnov(l.parent.parent.parent.parent,0),"additionalUsers")))})}function N(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,2,"span",[],null,null,null,null,null)),(n()(),t.ɵted(1,null,["",":"])),t.ɵppd(2,1)],null,function(n,l){n(l,1,0,t.ɵunv(l,1,0,n(l,2,0,t.ɵnov(l.parent.parent.parent.parent,0),"users")))})}function T(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,11,"small",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,O)),t.ɵdid(3,16384,null,0,r.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,N)),t.ɵdid(6,16384,null,0,r.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(7,null,["\n "," × "," ×12 "," = "," /","\n "])),t.ɵppd(8,2),t.ɵppd(9,1),t.ɵppd(10,2),t.ɵppd(11,1)],function(n,l){var e=l.component;n(l,3,0,e.plans[e.plan].baseSeats),n(l,6,0,!e.plans[e.plan].baseSeats)},function(n,l){var e=l.component;n(l,7,0,e.additionalSeats||0,t.ɵunv(l,7,1,n(l,8,0,t.ɵnov(l.parent.parent.parent,1),e.plans[e.plan].seatPrice,"$")),t.ɵunv(l,7,2,n(l,9,0,t.ɵnov(l.parent.parent.parent,0),"monthAbbr")),t.ɵunv(l,7,3,n(l,10,0,t.ɵnov(l.parent.parent.parent,1),e.seatTotal(!0),"$")),t.ɵunv(l,7,4,n(l,11,0,t.ɵnov(l.parent.parent.parent,0),"year")))})}function k(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,4,"small",[],null,null,null,null,null)),(n()(),t.ɵted(1,null,["\n ",": "," /","\n "])),t.ɵppd(2,1),t.ɵppd(3,2),t.ɵppd(4,1)],null,function(n,l){var e=l.component;n(l,1,0,t.ɵunv(l,1,0,n(l,2,0,t.ɵnov(l.parent.parent.parent.parent,0),"basePrice")),t.ɵunv(l,1,1,n(l,3,0,t.ɵnov(l.parent.parent.parent.parent,1),e.baseTotal(!1),"$")),t.ɵunv(l,1,2,n(l,4,0,t.ɵnov(l.parent.parent.parent.parent,0),"month")))})}function V(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,2,"span",[],null,null,null,null,null)),(n()(),t.ɵted(1,null,["",":"])),t.ɵppd(2,1)],null,function(n,l){n(l,1,0,t.ɵunv(l,1,0,n(l,2,0,t.ɵnov(l.parent.parent.parent.parent.parent,0),"additionalUsers")))})}function P(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,2,"span",[],null,null,null,null,null)),(n()(),t.ɵted(1,null,["",":"])),t.ɵppd(2,1)],null,function(n,l){n(l,1,0,t.ɵunv(l,1,0,n(l,2,0,t.ɵnov(l.parent.parent.parent.parent.parent,0),"users")))})}function M(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,10,"small",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,V)),t.ɵdid(3,16384,null,0,r.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,P)),t.ɵdid(6,16384,null,0,r.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(7,null,["\n "," × "," = "," /","\n "])),t.ɵppd(8,2),t.ɵppd(9,2),t.ɵppd(10,1)],function(n,l){var e=l.component;n(l,3,0,e.plans[e.plan].baseSeats),n(l,6,0,!e.plans[e.plan].baseSeats)},function(n,l){var e=l.component;n(l,7,0,e.additionalSeats||0,t.ɵunv(l,7,1,n(l,8,0,t.ɵnov(l.parent.parent.parent.parent,1),e.plans[e.plan].monthlySeatPrice,"$")),t.ɵunv(l,7,2,n(l,9,0,t.ɵnov(l.parent.parent.parent.parent,1),e.seatTotal(!1),"$")),t.ɵunv(l,7,3,n(l,10,0,t.ɵnov(l.parent.parent.parent.parent,0),"month")))})}function x(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,26,"div",[["class","form-check form-check-block"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,6,"input",[["class","form-check-input"],["id","intervalMonthly"],["name","BillingInterval"],["type","radio"],["value","month"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"],[null,"change"]],function(n,l,e){var u=!0,o=n.component;"input"===l&&(u=!1!==t.ɵnov(n,3)._handleInput(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,3).onTouched()&&u);"compositionstart"===l&&(u=!1!==t.ɵnov(n,3)._compositionStart()&&u);"compositionend"===l&&(u=!1!==t.ɵnov(n,3)._compositionEnd(e.target.value)&&u);"change"===l&&(u=!1!==t.ɵnov(n,4).onChange()&&u);"blur"===l&&(u=!1!==t.ɵnov(n,4).onTouched()&&u);"ngModelChange"===l&&(u=!1!==(o.interval=e)&&u);return u},null,null)),t.ɵdid(3,16384,null,0,u.DefaultValueAccessor,[t.Renderer2,t.ElementRef,[2,u.COMPOSITION_BUFFER_MODE]],null,null),t.ɵdid(4,212992,null,0,u.RadioControlValueAccessor,[t.Renderer2,t.ElementRef,u.ɵi,t.Injector],{name:[0,"name"],value:[1,"value"]},null),t.ɵprd(1024,null,u.NG_VALUE_ACCESSOR,function(n,l){return[n,l]},[u.DefaultValueAccessor,u.RadioControlValueAccessor]),t.ɵdid(6,671744,null,0,u.NgModel,[[2,u.ControlContainer],[8,null],[8,null],[2,u.NG_VALUE_ACCESSOR]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,u.NgControl,null,[u.NgModel]),t.ɵdid(8,16384,null,0,u.NgControlStatus,[u.NgControl],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(10,0,null,null,15,"label",[["class","form-check-label"],["for","intervalMonthly"]],null,null,null,null,null)),(n()(),t.ɵted(11,null,["\n ","\n "])),t.ɵppd(12,1),(n()(),t.ɵand(16777216,null,null,1,null,k)),t.ɵdid(14,16384,null,0,r.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,M)),t.ɵdid(17,16384,null,0,r.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(19,0,null,null,5,"small",[],null,null,null,null,null)),(n()(),t.ɵted(20,null,["\n ",": "," × "," = "," /","\n "])),t.ɵppd(21,1),t.ɵppd(22,2),t.ɵppd(23,2),t.ɵppd(24,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){var e=l.component;n(l,4,0,"BillingInterval","month");n(l,6,0,"BillingInterval",e.interval),n(l,14,0,e.plans[e.plan].monthlyBasePrice),n(l,17,0,!e.plans[e.plan].noAdditionalSeats)},function(n,l){var e=l.component;n(l,2,0,t.ɵnov(l,8).ngClassUntouched,t.ɵnov(l,8).ngClassTouched,t.ɵnov(l,8).ngClassPristine,t.ɵnov(l,8).ngClassDirty,t.ɵnov(l,8).ngClassValid,t.ɵnov(l,8).ngClassInvalid,t.ɵnov(l,8).ngClassPending),n(l,11,0,t.ɵunv(l,11,0,n(l,12,0,t.ɵnov(l.parent.parent.parent,0),"monthly"))),n(l,20,0,t.ɵunv(l,20,0,n(l,21,0,t.ɵnov(l.parent.parent.parent,0),"additionalStorageGb")),e.additionalStorage||0,t.ɵunv(l,20,2,n(l,22,0,t.ɵnov(l.parent.parent.parent,1),e.storageGb.monthlyPrice,"$")),t.ɵunv(l,20,3,n(l,23,0,t.ɵnov(l.parent.parent.parent,1),e.additionalStorageTotal(!1),"$")),t.ɵunv(l,20,4,n(l,24,0,t.ɵnov(l.parent.parent.parent,0),"month")))})}function D(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,94,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,I)),t.ɵdid(3,16384,null,0,r.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(5,0,null,null,2,"h2",[["class","mt-5"]],null,null,null,null,null)),(n()(),t.ɵted(6,null,["",""])),t.ɵppd(7,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,A)),t.ɵdid(10,16384,null,0,r.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(12,0,null,null,22,"div",[["class","row"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(14,0,null,null,19,"div",[["class","form-group col-6"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(16,0,null,null,2,"label",[["for","additionalStorage"]],null,null,null,null,null)),(n()(),t.ɵted(17,null,["",""])),t.ɵppd(18,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(20,0,null,null,7,"input",[["class","form-control"],["id","additionalStorage"],["max","99"],["min","0"],["name","AdditionalStorageGb"],["step","1"],["type","number"]],[[8,"placeholder",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"],[null,"change"]],function(n,l,e){var u=!0,o=n.component;"input"===l&&(u=!1!==t.ɵnov(n,21)._handleInput(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,21).onTouched()&&u);"compositionstart"===l&&(u=!1!==t.ɵnov(n,21)._compositionStart()&&u);"compositionend"===l&&(u=!1!==t.ɵnov(n,21)._compositionEnd(e.target.value)&&u);"change"===l&&(u=!1!==t.ɵnov(n,22).onChange(e.target.value)&&u);"input"===l&&(u=!1!==t.ɵnov(n,22).onChange(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,22).onTouched()&&u);"ngModelChange"===l&&(u=!1!==(o.additionalStorage=e)&&u);return u},null,null)),t.ɵdid(21,16384,null,0,u.DefaultValueAccessor,[t.Renderer2,t.ElementRef,[2,u.COMPOSITION_BUFFER_MODE]],null,null),t.ɵdid(22,16384,null,0,u.ɵbc,[t.Renderer2,t.ElementRef],null,null),t.ɵprd(1024,null,u.NG_VALUE_ACCESSOR,function(n,l){return[n,l]},[u.DefaultValueAccessor,u.ɵbc]),t.ɵdid(24,671744,null,0,u.NgModel,[[2,u.ControlContainer],[8,null],[8,null],[2,u.NG_VALUE_ACCESSOR]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,u.NgControl,null,[u.NgModel]),t.ɵdid(26,16384,null,0,u.NgControlStatus,[u.NgControl],null,null),t.ɵppd(27,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(29,0,null,null,3,"small",[["class","text-muted form-text"]],null,null,null,null,null)),(n()(),t.ɵted(30,null,["",""])),t.ɵppd(31,2),t.ɵppd(32,3),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(36,0,null,null,2,"h2",[["class","spaced-header"]],null,null,null,null,null)),(n()(),t.ɵted(37,null,["",""])),t.ɵppd(38,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(40,0,null,null,27,"div",[["class","form-check form-check-block"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(42,0,null,null,6,"input",[["class","form-check-input"],["id","intervalAnnually"],["name","BillingInterval"],["type","radio"],["value","year"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"],[null,"change"]],function(n,l,e){var u=!0,o=n.component;"input"===l&&(u=!1!==t.ɵnov(n,43)._handleInput(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,43).onTouched()&&u);"compositionstart"===l&&(u=!1!==t.ɵnov(n,43)._compositionStart()&&u);"compositionend"===l&&(u=!1!==t.ɵnov(n,43)._compositionEnd(e.target.value)&&u);"change"===l&&(u=!1!==t.ɵnov(n,44).onChange()&&u);"blur"===l&&(u=!1!==t.ɵnov(n,44).onTouched()&&u);"ngModelChange"===l&&(u=!1!==(o.interval=e)&&u);return u},null,null)),t.ɵdid(43,16384,null,0,u.DefaultValueAccessor,[t.Renderer2,t.ElementRef,[2,u.COMPOSITION_BUFFER_MODE]],null,null),t.ɵdid(44,212992,null,0,u.RadioControlValueAccessor,[t.Renderer2,t.ElementRef,u.ɵi,t.Injector],{name:[0,"name"],value:[1,"value"]},null),t.ɵprd(1024,null,u.NG_VALUE_ACCESSOR,function(n,l){return[n,l]},[u.DefaultValueAccessor,u.RadioControlValueAccessor]),t.ɵdid(46,671744,null,0,u.NgModel,[[2,u.ControlContainer],[8,null],[8,null],[2,u.NG_VALUE_ACCESSOR]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,u.NgControl,null,[u.NgModel]),t.ɵdid(48,16384,null,0,u.NgControlStatus,[u.NgControl],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(50,0,null,null,16,"label",[["class","form-check-label"],["for","intervalAnnually"]],null,null,null,null,null)),(n()(),t.ɵted(51,null,["\n ","\n "])),t.ɵppd(52,1),(n()(),t.ɵand(16777216,null,null,1,null,E)),t.ɵdid(54,16384,null,0,r.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,T)),t.ɵdid(57,16384,null,0,r.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(59,0,null,null,6,"small",[],null,null,null,null,null)),(n()(),t.ɵted(60,null,["\n ",": "," × "," ×12 "," = "," /","\n "])),t.ɵppd(61,1),t.ɵppd(62,2),t.ɵppd(63,1),t.ɵppd(64,2),t.ɵppd(65,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,x)),t.ɵdid(70,16384,null,0,r.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(72,0,null,null,0,"hr",[["class","my-3"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(74,0,null,null,7,"div",[["class","text-lg"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(76,0,null,null,2,"strong",[],null,null,null,null,null)),(n()(),t.ɵted(77,null,["",":"])),t.ɵppd(78,1),(n()(),t.ɵted(79,null,[" "," /","\n "])),t.ɵppd(80,2),t.ɵppd(81,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(83,0,null,null,3,"small",[["class","text-muted font-italic"]],null,null,null,null,null)),(n()(),t.ɵted(84,null,["",""])),t.ɵppd(85,1),t.ɵppd(86,2),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(88,0,null,null,2,"h2",[["class","spaced-header mb-4"]],null,null,null,null,null)),(n()(),t.ɵted(89,null,["",""])),t.ɵppd(90,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(92,0,null,null,1,"app-payment",[],null,null,null,a.View_PaymentComponent_0,a.RenderType_PaymentComponent)),t.ɵdid(93,245760,[[1,4]],0,s.PaymentComponent,[d.I18nService,c.PlatformUtilsService],{hidePaypal:[0,"hidePaypal"]},null),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){var e=l.component;n(l,3,0,!e.plans[e.plan].noAdditionalSeats&&!e.plans[e.plan].baseSeats),n(l,10,0,!e.plans[e.plan].noAdditionalSeats&&e.plans[e.plan].baseSeats);n(l,24,0,"AdditionalStorageGb",e.additionalStorage);n(l,44,0,"BillingInterval","year");n(l,46,0,"BillingInterval",e.interval),n(l,54,0,e.plans[e.plan].annualBasePrice),n(l,57,0,!e.plans[e.plan].noAdditionalSeats),n(l,70,0,e.plans[e.plan].monthlySeatPrice);n(l,93,0,!0)},function(n,l){var e=l.component;n(l,6,0,t.ɵunv(l,6,0,n(l,7,0,t.ɵnov(l.parent.parent,0),"addons"))),n(l,17,0,t.ɵunv(l,17,0,n(l,18,0,t.ɵnov(l.parent.parent,0),"additionalStorageGb"))),n(l,20,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,20,0,n(l,27,0,t.ɵnov(l.parent.parent,0),"additionalStorageGbDesc")),""),t.ɵnov(l,26).ngClassUntouched,t.ɵnov(l,26).ngClassTouched,t.ɵnov(l,26).ngClassPristine,t.ɵnov(l,26).ngClassDirty,t.ɵnov(l,26).ngClassValid,t.ɵnov(l,26).ngClassInvalid,t.ɵnov(l,26).ngClassPending),n(l,30,0,t.ɵunv(l,30,0,n(l,32,0,t.ɵnov(l.parent.parent,0),"additionalStorageDesc","1 GB",t.ɵunv(l,30,0,n(l,31,0,t.ɵnov(l.parent.parent,1),e.storageGb.price,"$"))))),n(l,37,0,t.ɵunv(l,37,0,n(l,38,0,t.ɵnov(l.parent.parent,0),"summary"))),n(l,42,0,t.ɵnov(l,48).ngClassUntouched,t.ɵnov(l,48).ngClassTouched,t.ɵnov(l,48).ngClassPristine,t.ɵnov(l,48).ngClassDirty,t.ɵnov(l,48).ngClassValid,t.ɵnov(l,48).ngClassInvalid,t.ɵnov(l,48).ngClassPending),n(l,51,0,t.ɵunv(l,51,0,n(l,52,0,t.ɵnov(l.parent.parent,0),"annually"))),n(l,60,0,t.ɵunv(l,60,0,n(l,61,0,t.ɵnov(l.parent.parent,0),"additionalStorageGb")),e.additionalStorage||0,t.ɵunv(l,60,2,n(l,62,0,t.ɵnov(l.parent.parent,1),e.storageGb.price,"$")),t.ɵunv(l,60,3,n(l,63,0,t.ɵnov(l.parent.parent,0),"monthAbbr")),t.ɵunv(l,60,4,n(l,64,0,t.ɵnov(l.parent.parent,1),e.additionalStorageTotal(!0),"$")),t.ɵunv(l,60,5,n(l,65,0,t.ɵnov(l.parent.parent,0),"year"))),n(l,77,0,t.ɵunv(l,77,0,n(l,78,0,t.ɵnov(l.parent.parent,0),"total"))),n(l,79,0,t.ɵunv(l,79,0,n(l,80,0,t.ɵnov(l.parent.parent,1),e.total,"USD $")),t.ɵunv(l,79,1,n(l,81,0,t.ɵnov(l.parent.parent,0),e.interval))),n(l,84,0,t.ɵunv(l,84,0,n(l,86,0,t.ɵnov(l.parent.parent,0),"paymentChargedWithTrial",t.ɵunv(l,84,0,n(l,85,0,t.ɵnov(l.parent.parent,0),e.interval))))),n(l,89,0,t.ɵunv(l,89,0,n(l,90,0,t.ɵnov(l.parent.parent,0),"paymentInformation")))})}function U(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,[["form",1]],null,198,"form",[["ngNativeValidate",""]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngSubmit"],[null,"submit"],[null,"reset"]],function(n,l,e){var u=!0,o=n.component;"submit"===l&&(u=!1!==t.ɵnov(n,1).onSubmit(e)&&u);"reset"===l&&(u=!1!==t.ɵnov(n,1).onReset()&&u);"ngSubmit"===l&&(u=!1!==o.submit()&&u);return u},null,null)),t.ɵdid(1,4210688,null,0,u.NgForm,[[8,null],[8,null]],null,{ngSubmit:"ngSubmit"}),t.ɵprd(2048,null,u.ControlContainer,null,[u.NgForm]),t.ɵdid(3,16384,null,0,u.NgControlStatusGroup,[u.ControlContainer],null,null),t.ɵdid(4,540672,null,0,o.ApiActionDirective,[t.ElementRef,i.ValidationService],{appApiAction:[0,"appApiAction"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(6,0,null,null,2,"h2",[["class","mt-5"]],null,null,null,null,null)),(n()(),t.ɵted(7,null,["",""])),t.ɵppd(8,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(10,0,null,null,33,"div",[["class","row"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(12,0,null,null,14,"div",[["class","form-group col-6"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(14,0,null,null,2,"label",[["for","name"]],null,null,null,null,null)),(n()(),t.ɵted(15,null,["",""])),t.ɵppd(16,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(18,0,null,null,7,"input",[["class","form-control"],["id","name"],["name","Name"],["required",""],["type","text"]],[[1,"required",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(n,l,e){var u=!0,o=n.component;"input"===l&&(u=!1!==t.ɵnov(n,19)._handleInput(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,19).onTouched()&&u);"compositionstart"===l&&(u=!1!==t.ɵnov(n,19)._compositionStart()&&u);"compositionend"===l&&(u=!1!==t.ɵnov(n,19)._compositionEnd(e.target.value)&&u);"ngModelChange"===l&&(u=!1!==(o.name=e)&&u);return u},null,null)),t.ɵdid(19,16384,null,0,u.DefaultValueAccessor,[t.Renderer2,t.ElementRef,[2,u.COMPOSITION_BUFFER_MODE]],null,null),t.ɵdid(20,16384,null,0,u.RequiredValidator,[],{required:[0,"required"]},null),t.ɵprd(1024,null,u.NG_VALIDATORS,function(n){return[n]},[u.RequiredValidator]),t.ɵprd(1024,null,u.NG_VALUE_ACCESSOR,function(n){return[n]},[u.DefaultValueAccessor]),t.ɵdid(23,671744,null,0,u.NgModel,[[2,u.ControlContainer],[2,u.NG_VALIDATORS],[8,null],[2,u.NG_VALUE_ACCESSOR]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,u.NgControl,null,[u.NgModel]),t.ɵdid(25,16384,null,0,u.NgControlStatus,[u.NgControl],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(28,0,null,null,14,"div",[["class","form-group col-6"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(30,0,null,null,2,"label",[["for","billingEmail"]],null,null,null,null,null)),(n()(),t.ɵted(31,null,["",""])),t.ɵppd(32,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(34,0,null,null,7,"input",[["class","form-control"],["id","billingEmail"],["name","BillingEmail"],["required",""],["type","text"]],[[1,"required",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(n,l,e){var u=!0,o=n.component;"input"===l&&(u=!1!==t.ɵnov(n,35)._handleInput(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,35).onTouched()&&u);"compositionstart"===l&&(u=!1!==t.ɵnov(n,35)._compositionStart()&&u);"compositionend"===l&&(u=!1!==t.ɵnov(n,35)._compositionEnd(e.target.value)&&u);"ngModelChange"===l&&(u=!1!==(o.billingEmail=e)&&u);return u},null,null)),t.ɵdid(35,16384,null,0,u.DefaultValueAccessor,[t.Renderer2,t.ElementRef,[2,u.COMPOSITION_BUFFER_MODE]],null,null),t.ɵdid(36,16384,null,0,u.RequiredValidator,[],{required:[0,"required"]},null),t.ɵprd(1024,null,u.NG_VALIDATORS,function(n){return[n]},[u.RequiredValidator]),t.ɵprd(1024,null,u.NG_VALUE_ACCESSOR,function(n){return[n]},[u.DefaultValueAccessor]),t.ɵdid(39,671744,null,0,u.NgModel,[[2,u.ControlContainer],[2,u.NG_VALIDATORS],[8,null],[2,u.NG_VALUE_ACCESSOR]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,u.NgControl,null,[u.NgModel]),t.ɵdid(41,16384,null,0,u.NgControlStatus,[u.NgControl],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(45,0,null,null,12,"div",[["class","form-group form-check"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(47,0,null,null,5,"input",[["class","form-check-input"],["id","ownedBusiness"],["name","OwnedBusiness"],["type","checkbox"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"change"],[null,"blur"]],function(n,l,e){var u=!0,o=n.component;"change"===l&&(u=!1!==t.ɵnov(n,48).onChange(e.target.checked)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,48).onTouched()&&u);"ngModelChange"===l&&(u=!1!==(o.ownedBusiness=e)&&u);"change"===l&&(u=!1!==o.changedOwnedBusiness()&&u);return u},null,null)),t.ɵdid(48,16384,null,0,u.CheckboxControlValueAccessor,[t.Renderer2,t.ElementRef],null,null),t.ɵprd(1024,null,u.NG_VALUE_ACCESSOR,function(n){return[n]},[u.CheckboxControlValueAccessor]),t.ɵdid(50,671744,null,0,u.NgModel,[[2,u.ControlContainer],[8,null],[8,null],[2,u.NG_VALUE_ACCESSOR]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,u.NgControl,null,[u.NgModel]),t.ɵdid(52,16384,null,0,u.NgControlStatus,[u.NgControl],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(54,0,null,null,2,"label",[["class","form-check-label"],["for","ownedBusiness"]],null,null,null,null,null)),(n()(),t.ɵted(55,null,["",""])),t.ɵppd(56,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,w)),t.ɵdid(60,16384,null,0,r.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(62,0,null,null,2,"h2",[["class","mt-5"]],null,null,null,null,null)),(n()(),t.ɵted(63,null,["",""])),t.ɵppd(64,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,R)),t.ɵdid(67,16384,null,0,r.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,_)),t.ɵdid(70,16384,null,0,r.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(72,0,null,null,46,"div",[["class","form-check form-check-block"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(74,0,null,null,6,"input",[["class","form-check-input"],["id","planTeams"],["name","PlanType"],["type","radio"],["value","teams"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"change"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(n,l,e){var u=!0,o=n.component;"input"===l&&(u=!1!==t.ɵnov(n,75)._handleInput(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,75).onTouched()&&u);"compositionstart"===l&&(u=!1!==t.ɵnov(n,75)._compositionStart()&&u);"compositionend"===l&&(u=!1!==t.ɵnov(n,75)._compositionEnd(e.target.value)&&u);"change"===l&&(u=!1!==t.ɵnov(n,76).onChange()&&u);"blur"===l&&(u=!1!==t.ɵnov(n,76).onTouched()&&u);"ngModelChange"===l&&(u=!1!==(o.plan=e)&&u);"change"===l&&(u=!1!==o.changedPlan()&&u);return u},null,null)),t.ɵdid(75,16384,null,0,u.DefaultValueAccessor,[t.Renderer2,t.ElementRef,[2,u.COMPOSITION_BUFFER_MODE]],null,null),t.ɵdid(76,212992,null,0,u.RadioControlValueAccessor,[t.Renderer2,t.ElementRef,u.ɵi,t.Injector],{name:[0,"name"],value:[1,"value"]},null),t.ɵprd(1024,null,u.NG_VALUE_ACCESSOR,function(n,l){return[n,l]},[u.DefaultValueAccessor,u.RadioControlValueAccessor]),t.ɵdid(78,671744,null,0,u.NgModel,[[2,u.ControlContainer],[8,null],[8,null],[2,u.NG_VALUE_ACCESSOR]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,u.NgControl,null,[u.NgModel]),t.ɵdid(80,16384,null,0,u.NgControlStatus,[u.NgControl],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(82,0,null,null,35,"label",[["class","form-check-label"],["for","planTeams"]],null,null,null,null,null)),(n()(),t.ɵted(83,null,["\n ","\n "])),t.ɵppd(84,1),(n()(),t.ɵeld(85,0,null,null,2,"small",[["class","mb-1"]],null,null,null,null,null)),(n()(),t.ɵted(86,null,["",""])),t.ɵppd(87,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(89,0,null,null,2,"small",[],null,null,null,null,null)),(n()(),t.ɵted(90,null,["• ",""])),t.ɵppd(91,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(93,0,null,null,2,"small",[],null,null,null,null,null)),(n()(),t.ɵted(94,null,["• ",""])),t.ɵppd(95,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(97,0,null,null,2,"small",[],null,null,null,null,null)),(n()(),t.ɵted(98,null,["• ",""])),t.ɵppd(99,2),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(101,0,null,null,2,"small",[],null,null,null,null,null)),(n()(),t.ɵted(102,null,["• ",""])),t.ɵppd(103,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(105,0,null,null,2,"small",[],null,null,null,null,null)),(n()(),t.ɵted(106,null,["• ",""])),t.ɵppd(107,2),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(109,0,null,null,7,"span",[],null,null,null,null,null)),(n()(),t.ɵted(110,null,[""," /",", ",", ","\n "," /",""])),t.ɵppd(111,2),t.ɵppd(112,1),t.ɵppd(113,2),t.ɵppd(114,1),t.ɵppd(115,2),t.ɵppd(116,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(120,0,null,null,59,"div",[["class","form-check form-check-block"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(122,0,null,null,6,"input",[["class","form-check-input"],["id","planEnterprise"],["name","PlanType"],["type","radio"],["value","enterprise"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"change"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(n,l,e){var u=!0,o=n.component;"input"===l&&(u=!1!==t.ɵnov(n,123)._handleInput(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,123).onTouched()&&u);"compositionstart"===l&&(u=!1!==t.ɵnov(n,123)._compositionStart()&&u);"compositionend"===l&&(u=!1!==t.ɵnov(n,123)._compositionEnd(e.target.value)&&u);"change"===l&&(u=!1!==t.ɵnov(n,124).onChange()&&u);"blur"===l&&(u=!1!==t.ɵnov(n,124).onTouched()&&u);"ngModelChange"===l&&(u=!1!==(o.plan=e)&&u);"change"===l&&(u=!1!==o.changedPlan()&&u);return u},null,null)),t.ɵdid(123,16384,null,0,u.DefaultValueAccessor,[t.Renderer2,t.ElementRef,[2,u.COMPOSITION_BUFFER_MODE]],null,null),t.ɵdid(124,212992,null,0,u.RadioControlValueAccessor,[t.Renderer2,t.ElementRef,u.ɵi,t.Injector],{name:[0,"name"],value:[1,"value"]},null),t.ɵprd(1024,null,u.NG_VALUE_ACCESSOR,function(n,l){return[n,l]},[u.DefaultValueAccessor,u.RadioControlValueAccessor]),t.ɵdid(126,671744,null,0,u.NgModel,[[2,u.ControlContainer],[8,null],[8,null],[2,u.NG_VALUE_ACCESSOR]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,u.NgControl,null,[u.NgModel]),t.ɵdid(128,16384,null,0,u.NgControlStatus,[u.NgControl],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(130,0,null,null,48,"label",[["class","form-check-label"],["for","planEnterprise"]],null,null,null,null,null)),(n()(),t.ɵted(131,null,["\n ","\n "])),t.ɵppd(132,1),(n()(),t.ɵeld(133,0,null,null,2,"small",[["class","mb-1"]],null,null,null,null,null)),(n()(),t.ɵted(134,null,["",""])),t.ɵppd(135,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(137,0,null,null,2,"small",[],null,null,null,null,null)),(n()(),t.ɵted(138,null,["• ",""])),t.ɵppd(139,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(141,0,null,null,2,"small",[],null,null,null,null,null)),(n()(),t.ɵted(142,null,["• ",""])),t.ɵppd(143,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(145,0,null,null,2,"small",[],null,null,null,null,null)),(n()(),t.ɵted(146,null,["• ",""])),t.ɵppd(147,2),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(149,0,null,null,2,"small",[],null,null,null,null,null)),(n()(),t.ɵted(150,null,["• ",""])),t.ɵppd(151,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(153,0,null,null,2,"small",[],null,null,null,null,null)),(n()(),t.ɵted(154,null,["• ",""])),t.ɵppd(155,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(157,0,null,null,2,"small",[],null,null,null,null,null)),(n()(),t.ɵted(158,null,["• ",""])),t.ɵppd(159,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(161,0,null,null,2,"small",[],null,null,null,null,null)),(n()(),t.ɵted(162,null,["• ",""])),t.ɵppd(163,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(165,0,null,null,2,"small",[],null,null,null,null,null)),(n()(),t.ɵted(166,null,["• ",""])),t.ɵppd(167,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(169,0,null,null,2,"small",[],null,null,null,null,null)),(n()(),t.ɵted(170,null,["• ",""])),t.ɵppd(171,2),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(173,0,null,null,4,"span",[],null,null,null,null,null)),(n()(),t.ɵted(174,null,[""," /",""])),t.ɵppd(175,2),t.ɵppd(176,2),t.ɵppd(177,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,D)),t.ɵdid(182,16384,null,0,r.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(184,0,null,null,13,"div",[],null,null,null,null,null)),t.ɵdid(185,278528,null,0,r.NgClass,[t.IterableDiffers,t.KeyValueDiffers,t.ElementRef,t.Renderer2],{ngClass:[0,"ngClass"]},null),t.ɵpod(186,{"mt-4":0}),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(188,0,null,null,8,"button",[["class","btn btn-primary btn-submit"],["type","submit"]],[[8,"disabled",0]],null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(190,0,null,null,1,"i",[["class","fa fa-spinner fa-spin"]],[[8,"title",0]],null,null,null,null)),t.ɵppd(191,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(193,0,null,null,2,"span",[],null,null,null,null,null)),(n()(),t.ɵted(194,null,["",""])),t.ɵppd(195,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){var e=l.component;n(l,4,0,e.formPromise);n(l,20,0,"");n(l,23,0,"Name",e.name);n(l,36,0,"");n(l,39,0,"BillingEmail",e.billingEmail);n(l,50,0,"OwnedBusiness",e.ownedBusiness),n(l,60,0,e.ownedBusiness),n(l,67,0,!e.ownedBusiness),n(l,70,0,!e.ownedBusiness);n(l,76,0,"PlanType","teams");n(l,78,0,"PlanType",e.plan);n(l,124,0,"PlanType","enterprise");n(l,126,0,"PlanType",e.plan),n(l,182,0,!e.plans[e.plan].noPayment),n(l,185,0,n(l,186,0,e.plans[e.plan].noPayment))},function(n,l){n(l,0,0,t.ɵnov(l,3).ngClassUntouched,t.ɵnov(l,3).ngClassTouched,t.ɵnov(l,3).ngClassPristine,t.ɵnov(l,3).ngClassDirty,t.ɵnov(l,3).ngClassValid,t.ɵnov(l,3).ngClassInvalid,t.ɵnov(l,3).ngClassPending),n(l,7,0,t.ɵunv(l,7,0,n(l,8,0,t.ɵnov(l.parent,0),"generalInformation"))),n(l,15,0,t.ɵunv(l,15,0,n(l,16,0,t.ɵnov(l.parent,0),"organizationName"))),n(l,18,0,t.ɵnov(l,20).required?"":null,t.ɵnov(l,25).ngClassUntouched,t.ɵnov(l,25).ngClassTouched,t.ɵnov(l,25).ngClassPristine,t.ɵnov(l,25).ngClassDirty,t.ɵnov(l,25).ngClassValid,t.ɵnov(l,25).ngClassInvalid,t.ɵnov(l,25).ngClassPending),n(l,31,0,t.ɵunv(l,31,0,n(l,32,0,t.ɵnov(l.parent,0),"billingEmail"))),n(l,34,0,t.ɵnov(l,36).required?"":null,t.ɵnov(l,41).ngClassUntouched,t.ɵnov(l,41).ngClassTouched,t.ɵnov(l,41).ngClassPristine,t.ɵnov(l,41).ngClassDirty,t.ɵnov(l,41).ngClassValid,t.ɵnov(l,41).ngClassInvalid,t.ɵnov(l,41).ngClassPending),n(l,47,0,t.ɵnov(l,52).ngClassUntouched,t.ɵnov(l,52).ngClassTouched,t.ɵnov(l,52).ngClassPristine,t.ɵnov(l,52).ngClassDirty,t.ɵnov(l,52).ngClassValid,t.ɵnov(l,52).ngClassInvalid,t.ɵnov(l,52).ngClassPending),n(l,55,0,t.ɵunv(l,55,0,n(l,56,0,t.ɵnov(l.parent,0),"accountOwnedBusiness"))),n(l,63,0,t.ɵunv(l,63,0,n(l,64,0,t.ɵnov(l.parent,0),"chooseYourPlan"))),n(l,74,0,t.ɵnov(l,80).ngClassUntouched,t.ɵnov(l,80).ngClassTouched,t.ɵnov(l,80).ngClassPristine,t.ɵnov(l,80).ngClassDirty,t.ɵnov(l,80).ngClassValid,t.ɵnov(l,80).ngClassInvalid,t.ɵnov(l,80).ngClassPending),n(l,83,0,t.ɵunv(l,83,0,n(l,84,0,t.ɵnov(l.parent,0),"planNameTeams"))),n(l,86,0,t.ɵunv(l,86,0,n(l,87,0,t.ɵnov(l.parent,0),"planDescTeams"))),n(l,90,0,t.ɵunv(l,90,0,n(l,91,0,t.ɵnov(l.parent,0),"addShareUnlimitedUsers"))),n(l,94,0,t.ɵunv(l,94,0,n(l,95,0,t.ɵnov(l.parent,0),"createUnlimitedCollections"))),n(l,98,0,t.ɵunv(l,98,0,n(l,99,0,t.ɵnov(l.parent,0),"gbEncryptedFileStorage","1 GB"))),n(l,102,0,t.ɵunv(l,102,0,n(l,103,0,t.ɵnov(l.parent,0),"priorityCustomerSupport"))),n(l,106,0,t.ɵunv(l,106,0,n(l,107,0,t.ɵnov(l.parent,0),"xDayFreeTrial","7"))),n(l,110,0,t.ɵunv(l,110,0,n(l,111,0,t.ɵnov(l.parent,1),5,"$")),t.ɵunv(l,110,1,n(l,112,0,t.ɵnov(l.parent,0),"month")),t.ɵunv(l,110,2,n(l,113,0,t.ɵnov(l.parent,0),"includesXUsers",5)),t.ɵunv(l,110,3,n(l,114,0,t.ɵnov(l.parent,0),"additionalUsers")).toLowerCase(),t.ɵunv(l,110,4,n(l,115,0,t.ɵnov(l.parent,1),2,"$")),t.ɵunv(l,110,5,n(l,116,0,t.ɵnov(l.parent,0),"month"))),n(l,122,0,t.ɵnov(l,128).ngClassUntouched,t.ɵnov(l,128).ngClassTouched,t.ɵnov(l,128).ngClassPristine,t.ɵnov(l,128).ngClassDirty,t.ɵnov(l,128).ngClassValid,t.ɵnov(l,128).ngClassInvalid,t.ɵnov(l,128).ngClassPending),n(l,131,0,t.ɵunv(l,131,0,n(l,132,0,t.ɵnov(l.parent,0),"planNameEnterprise"))),n(l,134,0,t.ɵunv(l,134,0,n(l,135,0,t.ɵnov(l.parent,0),"planDescEnterprise"))),n(l,138,0,t.ɵunv(l,138,0,n(l,139,0,t.ɵnov(l.parent,0),"addShareUnlimitedUsers"))),n(l,142,0,t.ɵunv(l,142,0,n(l,143,0,t.ɵnov(l.parent,0),"createUnlimitedCollections"))),n(l,146,0,t.ɵunv(l,146,0,n(l,147,0,t.ɵnov(l.parent,0),"gbEncryptedFileStorage","1 GB"))),n(l,150,0,t.ɵunv(l,150,0,n(l,151,0,t.ɵnov(l.parent,0),"controlAccessWithGroups"))),n(l,154,0,t.ɵunv(l,154,0,n(l,155,0,t.ɵnov(l.parent,0),"trackAuditLogs"))),n(l,158,0,t.ɵunv(l,158,0,n(l,159,0,t.ɵnov(l.parent,0),"syncUsersFromDirectory"))),n(l,162,0,t.ɵunv(l,162,0,n(l,163,0,t.ɵnov(l.parent,0),"onPremHostingOptional"))),n(l,166,0,t.ɵunv(l,166,0,n(l,167,0,t.ɵnov(l.parent,0),"priorityCustomerSupport"))),n(l,170,0,t.ɵunv(l,170,0,n(l,171,0,t.ɵnov(l.parent,0),"xDayFreeTrial","7"))),n(l,174,0,t.ɵunv(l,174,0,n(l,176,0,t.ɵnov(l.parent,0),"costPerUser",t.ɵunv(l,174,0,n(l,175,0,t.ɵnov(l.parent,1),3,"$")))),t.ɵunv(l,174,1,n(l,177,0,t.ɵnov(l.parent,0),"month"))),n(l,188,0,t.ɵnov(l,0).loading),n(l,190,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,190,0,n(l,191,0,t.ɵnov(l.parent,0),"loading")),"")),n(l,194,0,t.ɵunv(l,194,0,n(l,195,0,t.ɵnov(l.parent,0),"submit")))})}function F(n){return t.ɵvid(0,[t.ɵpid(0,p.I18nPipe,[d.I18nService]),t.ɵpid(0,r.CurrencyPipe,[t.LOCALE_ID]),t.ɵqud(671088640,1,{paymentComponent:0}),(n()(),t.ɵeld(3,0,null,null,5,"div",[["class","page-header"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(5,0,null,null,2,"h1",[],null,null,null,null,null)),(n()(),t.ɵted(6,null,["",""])),t.ɵppd(7,1),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵeld(10,0,null,null,2,"p",[],null,null,null,null,null)),(n()(),t.ɵted(11,null,["",""])),t.ɵppd(12,1),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,null,null,1,null,S)),t.ɵdid(15,16384,null,0,r.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,null,null,1,null,U)),t.ɵdid(18,16384,null,0,r.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){var e=l.component;n(l,15,0,e.selfHosted),n(l,18,0,!e.selfHosted)},function(n,l){n(l,6,0,t.ɵunv(l,6,0,n(l,7,0,t.ɵnov(l,0),"newOrganization"))),n(l,11,0,t.ɵunv(l,11,0,n(l,12,0,t.ɵnov(l,0),"newOrganizationDesc")))})}function L(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"app-create-organization",[],null,null,null,F,b)),t.ɵdid(1,114688,null,0,f.CreateOrganizationComponent,[v.ApiService,d.I18nService,h.Angulartics2,g.ToasterService,c.PlatformUtilsService,m.CryptoService,y.Router,C.SyncService,y.ActivatedRoute],null,null)],function(n,l){n(l,1,0)},null)}l.RenderType_CreateOrganizationComponent=b,l.View_CreateOrganizationComponent_0=F,l.View_CreateOrganizationComponent_Host_0=L;var G=t.ɵccf("app-create-organization",f.CreateOrganizationComponent,L,{},{},[]);l.CreateOrganizationComponentNgFactory=G},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(){}}();l.PaymentRequest=t},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(){}}();l.StorageRequest=t},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=e(0),u=e(40),o=e(37),i=e(2),r=e(18),a=e(17),s=e(5),d=e(544),c=e(267),p=e(4),f=e(3),v=e(9),h=e(543),g=e(266),m=e(542),y=e(265),C=e(7),b=e(263),S=e(35),w=e(8),R=e(10),_=t.ɵcrt({encapsulation:2,styles:[],data:{}});function I(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"i",[["class","fa fa-spinner fa-spin text-muted"]],[[8,"title",0]],null,null,null,null)),t.ɵppd(1,1)],null,function(n,l){n(l,0,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,0,0,n(l,1,0,t.ɵnov(l.parent,0),"loading")),""))})}function A(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"i",[["class","fa fa-spinner fa-spin text-muted"]],[[8,"title",0]],null,null,null,null)),t.ɵppd(1,1)],null,function(n,l){n(l,0,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,0,0,n(l,1,0,t.ɵnov(l.parent,0),"loading")),""))})}function E(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,4,"app-callout",[["type","warning"]],null,null,null,u.View_CalloutComponent_0,u.RenderType_CalloutComponent)),t.ɵdid(1,114688,null,0,o.CalloutComponent,[i.I18nService],{type:[0,"type"],title:[1,"title"]},null),t.ɵppd(2,1),(n()(),t.ɵted(3,0,["",""])),t.ɵppd(4,1)],function(n,l){n(l,1,0,"warning",t.ɵinlineInterpolate(1,"",t.ɵunv(l,1,1,n(l,2,0,t.ɵnov(l.parent.parent,0),"canceled")),""))},function(n,l){n(l,3,0,t.ɵunv(l,3,0,n(l,4,0,t.ɵnov(l.parent.parent,0),"subscriptionCanceled")))})}function O(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,18,"app-callout",[["type","warning"]],null,null,null,u.View_CalloutComponent_0,u.RenderType_CalloutComponent)),t.ɵdid(1,114688,null,0,o.CalloutComponent,[i.I18nService],{type:[0,"type"],title:[1,"title"]},null),t.ɵppd(2,1),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵeld(4,0,null,0,2,"p",[],null,null,null,null,null)),(n()(),t.ɵted(5,null,["",""])),t.ɵppd(6,1),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵeld(8,0,[["reinstateBtn",1]],0,9,"button",[["class","btn btn-outline-secondary btn-submit"],["type","button"]],[[8,"disabled",0]],[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.reinstate()&&t);return t},null,null)),t.ɵdid(9,540672,null,0,r.ApiActionDirective,[t.ElementRef,a.ValidationService],{appApiAction:[0,"appApiAction"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(11,0,null,null,1,"i",[["class","fa fa-spinner fa-spin"]],[[8,"title",0]],null,null,null,null)),t.ɵppd(12,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(14,0,null,null,2,"span",[],null,null,null,null,null)),(n()(),t.ɵted(15,null,["",""])),t.ɵppd(16,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,0,["\n "]))],function(n,l){var e=l.component;n(l,1,0,"warning",t.ɵinlineInterpolate(1,"",t.ɵunv(l,1,1,n(l,2,0,t.ɵnov(l.parent.parent,0),"pendingCancellation")),"")),n(l,9,0,e.reinstatePromise)},function(n,l){n(l,5,0,t.ɵunv(l,5,0,n(l,6,0,t.ɵnov(l.parent.parent,0),"subscriptionPendingCanceled"))),n(l,8,0,t.ɵnov(l,8).loading),n(l,11,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,11,0,n(l,12,0,t.ɵnov(l.parent.parent,0),"loading")),"")),n(l,15,0,t.ɵunv(l,15,0,n(l,16,0,t.ɵnov(l.parent.parent,0),"reinstateSubscription")))})}function N(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,2,"dd",[],null,null,null,null,null)),(n()(),t.ɵted(1,null,["",""])),t.ɵppd(2,2)],null,function(n,l){var e=l.component;n(l,1,0,t.ɵunv(l,1,0,n(l,2,0,t.ɵnov(l.parent.parent.parent,1),e.billing.expiration,"mediumDate")))})}function T(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,2,"dd",[],null,null,null,null,null)),(n()(),t.ɵted(1,null,["",""])),t.ɵppd(2,1)],null,function(n,l){n(l,1,0,t.ɵunv(l,1,0,n(l,2,0,t.ɵnov(l.parent.parent.parent,0),"neverExpires")))})}function k(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,11,"dl",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,2,"dt",[],null,null,null,null,null)),(n()(),t.ɵted(3,null,["",""])),t.ɵppd(4,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,N)),t.ɵdid(7,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,T)),t.ɵdid(10,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){var e=l.component;n(l,7,0,e.billing.expiration),n(l,10,0,!e.billing.expiration)},function(n,l){n(l,3,0,t.ɵunv(l,3,0,n(l,4,0,t.ɵnov(l.parent.parent,0),"expiration")))})}function V(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,2,"span",[["class","badge badge-warning"]],null,null,null,null,null)),(n()(),t.ɵted(1,null,["",""])),t.ɵppd(2,1)],null,function(n,l){n(l,1,0,t.ɵunv(l,1,0,n(l,2,0,t.ɵnov(l.parent.parent.parent,0),"pendingCancellation")))})}function P(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,10,"tr",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,2,"td",[],null,null,null,null,null)),(n()(),t.ɵted(3,null,["\n "," "," @ ","\n "])),t.ɵppd(4,2),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(6,0,null,null,3,"td",[],null,null,null,null,null)),(n()(),t.ɵted(7,null,["\n "," /","\n "])),t.ɵppd(8,2),t.ɵppd(9,1),(n()(),t.ɵted(-1,null,["\n "]))],null,function(n,l){n(l,3,0,l.context.$implicit.name,l.context.$implicit.quantity>1?"×"+l.context.$implicit.quantity:"",t.ɵunv(l,3,2,n(l,4,0,t.ɵnov(l.parent.parent.parent.parent,2),l.context.$implicit.amount,"$"))),n(l,7,0,t.ɵunv(l,7,0,n(l,8,0,t.ɵnov(l.parent.parent.parent.parent,2),l.context.$implicit.quantity*l.context.$implicit.amount,"$")),t.ɵunv(l,7,1,n(l,9,0,t.ɵnov(l.parent.parent.parent.parent,0),l.context.$implicit.interval)))})}function M(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,14,"div",[["class","col-8"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,2,"strong",[["class","d-block mb-1"]],null,null,null,null,null)),(n()(),t.ɵted(3,null,["",""])),t.ɵppd(4,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(6,0,null,null,7,"table",[["class","table"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(8,0,null,null,4,"tbody",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,P)),t.ɵdid(11,802816,null,0,s.NgForOf,[t.ViewContainerRef,t.TemplateRef,t.IterableDiffers],{ngForOf:[0,"ngForOf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){n(l,11,0,l.component.subscription.items)},function(n,l){n(l,3,0,t.ɵunv(l,3,0,n(l,4,0,t.ɵnov(l.parent.parent.parent,0),"details")))})}function x(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,32,"div",[["class","row"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,26,"div",[["class","col-4"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(4,0,null,null,23,"dl",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(6,0,null,null,2,"dt",[],null,null,null,null,null)),(n()(),t.ɵted(7,null,["",""])),t.ɵppd(8,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(10,0,null,null,7,"dd",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(12,0,null,null,1,"span",[["class","text-capitalize"]],null,null,null,null,null)),(n()(),t.ɵted(13,null,["",""])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,V)),t.ɵdid(16,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(19,0,null,null,2,"dt",[],null,null,null,null,null)),(n()(),t.ɵted(20,null,["",""])),t.ɵppd(21,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(23,0,null,null,3,"dd",[],null,null,null,null,null)),(n()(),t.ɵted(24,null,["","\n "])),t.ɵppd(25,2),t.ɵppd(26,2),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,M)),t.ɵdid(31,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){var e=l.component;n(l,16,0,e.subscriptionMarkedForCancel),n(l,31,0,e.subscription)},function(n,l){var e=l.component;n(l,7,0,t.ɵunv(l,7,0,n(l,8,0,t.ɵnov(l.parent.parent,0),"status"))),n(l,13,0,e.subscription&&e.subscription.status||"-"),n(l,20,0,t.ɵunv(l,20,0,n(l,21,0,t.ɵnov(l.parent.parent,0),"nextCharge"))),n(l,24,0,e.nextInvoice?t.ɵunv(l,24,0,n(l,25,0,t.ɵnov(l.parent.parent,1),e.nextInvoice.date,"mediumDate"))+", "+t.ɵunv(l,24,0,n(l,26,0,t.ɵnov(l.parent.parent,2),e.nextInvoice.amount,"$")):"-")})}function D(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,11,"div",[["class","card mt-3"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,8,"div",[["class","card-body"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(4,0,null,null,2,"h3",[["class","card-body-header"]],null,null,null,null,null)),(n()(),t.ɵted(5,null,["",""])),t.ɵppd(6,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(8,0,null,null,1,"app-update-license",[],null,[[null,"onUpdated"],[null,"onCanceled"]],function(n,l,e){var t=!0,u=n.component;"onUpdated"===l&&(t=!1!==u.closeUpdateLicense(!0)&&t);"onCanceled"===l&&(t=!1!==u.closeUpdateLicense(!1)&&t);return t},d.View_UpdateLicenseComponent_0,d.RenderType_UpdateLicenseComponent)),t.ɵdid(9,49152,null,0,c.UpdateLicenseComponent,[p.ApiService,i.I18nService,f.Angulartics2,v.ToasterService],null,{onUpdated:"onUpdated",onCanceled:"onCanceled"}),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "]))],null,function(n,l){n(l,5,0,t.ɵunv(l,5,0,n(l,6,0,t.ɵnov(l.parent.parent.parent,0),"updateLicense")))})}function U(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,15,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,9,"div",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(4,0,null,null,2,"button",[["class","btn btn-outline-secondary"],["type","button"]],null,[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.updateLicense()&&t);return t},null,null)),(n()(),t.ɵted(5,null,["\n ","\n "])),t.ɵppd(6,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(8,0,null,null,2,"a",[["class","btn btn-outline-secondary"],["href","https://vault.bitwarden.com/#/settings/billing"],["rel","noopener"],["target","_blank"]],null,null,null,null,null)),(n()(),t.ɵted(9,null,["\n ","\n "])),t.ɵppd(10,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,D)),t.ɵdid(14,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){n(l,14,0,l.component.showUpdateLicense)},function(n,l){n(l,5,0,t.ɵunv(l,5,0,n(l,6,0,t.ɵnov(l.parent.parent,0),"updateLicense"))),n(l,9,0,t.ɵunv(l,9,0,n(l,10,0,t.ɵnov(l.parent.parent,0),"manageSubscription")))})}function F(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,2,"button",[["class","btn btn-outline-secondary"],["type","button"]],null,[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.downloadLicense()&&t);return t},null,null)),(n()(),t.ɵted(1,null,["\n ","\n "])),t.ɵppd(2,1)],null,function(n,l){n(l,1,0,t.ɵunv(l,1,0,n(l,2,0,t.ɵnov(l.parent.parent.parent,0),"downloadLicense")))})}function L(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,[["cancelBtn",1]],null,9,"button",[["class","btn btn-outline-danger btn-submit ml-auto"],["type","button"]],[[8,"disabled",0]],[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.cancel()&&t);return t},null,null)),t.ɵdid(1,540672,null,0,r.ApiActionDirective,[t.ElementRef,a.ValidationService],{appApiAction:[0,"appApiAction"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(3,0,null,null,1,"i",[["class","fa fa-spinner fa-spin"]],[[8,"title",0]],null,null,null,null)),t.ɵppd(4,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(6,0,null,null,2,"span",[],null,null,null,null,null)),(n()(),t.ɵted(7,null,["",""])),t.ɵppd(8,1),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){n(l,1,0,l.component.cancelPromise)},function(n,l){n(l,0,0,t.ɵnov(l,0).loading),n(l,3,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,3,0,n(l,4,0,t.ɵnov(l.parent.parent.parent,0),"loading")),"")),n(l,7,0,t.ɵunv(l,7,0,n(l,8,0,t.ɵnov(l.parent.parent.parent,0),"cancelSubscription")))})}function G(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,9,"div",[["class","d-flex"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,2,"button",[["class","btn btn-outline-secondary"],["type","button"]],null,[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.adjustStorage(!0)&&t);return t},null,null)),(n()(),t.ɵted(3,null,["\n ","\n "])),t.ɵppd(4,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(6,0,null,null,2,"button",[["class","ml-1 btn btn-outline-secondary"],["type","button"]],null,[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.adjustStorage(!1)&&t);return t},null,null)),(n()(),t.ɵted(7,null,["\n ","\n "])),t.ɵppd(8,1),(n()(),t.ɵted(-1,null,["\n "]))],null,function(n,l){n(l,3,0,t.ɵunv(l,3,0,n(l,4,0,t.ɵnov(l.parent.parent.parent.parent,0),"addStorage"))),n(l,7,0,t.ɵunv(l,7,0,n(l,8,0,t.ɵnov(l.parent.parent.parent.parent,0),"removeStorage")))})}function q(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"app-adjust-storage",[],null,[[null,"onAdjusted"],[null,"onCanceled"]],function(n,l,e){var t=!0,u=n.component;"onAdjusted"===l&&(t=!1!==u.closeStorage(!0)&&t);"onCanceled"===l&&(t=!1!==u.closeStorage(!1)&&t);return t},h.View_AdjustStorageComponent_0,h.RenderType_AdjustStorageComponent)),t.ɵdid(1,49152,null,0,g.AdjustStorageComponent,[p.ApiService,i.I18nService,f.Angulartics2,v.ToasterService],{storageGbPrice:[0,"storageGbPrice"],add:[1,"add"]},{onAdjusted:"onAdjusted",onCanceled:"onCanceled"})],function(n,l){n(l,1,0,4,l.component.adjustStorageAdd)},null)}function z(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,10,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,7,"div",[["class","mt-3"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,G)),t.ɵdid(5,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,q)),t.ɵdid(8,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){var e=l.component;n(l,5,0,!e.showAdjustStorage),n(l,8,0,e.showAdjustStorage)},null)}function j(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,2,"p",[],null,null,null,null,null)),(n()(),t.ɵted(1,null,["",""])),t.ɵppd(2,1)],null,function(n,l){n(l,1,0,t.ɵunv(l,1,0,n(l,2,0,t.ɵnov(l.parent.parent.parent,0),"noPaymentMethod")))})}function B(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,5,"p",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,2,"i",[["class","fa fa-fw"]],null,null,null,null,null)),t.ɵdid(3,278528,null,0,s.NgClass,[t.IterableDiffers,t.KeyValueDiffers,t.ElementRef,t.Renderer2],{klass:[0,"klass"],ngClass:[1,"ngClass"]},null),t.ɵpod(4,{"fa-credit-card":0,"fa-university":1,"fa-paypal text-primary":2}),(n()(),t.ɵted(5,null,["\n ","\n "]))],function(n,l){var e=l.component;n(l,3,0,"fa fa-fw",n(l,4,0,e.paymentSource.type===e.paymentMethodType.Card,e.paymentSource.type===e.paymentMethodType.BankAccount,e.paymentSource.type===e.paymentMethodType.PayPal))},function(n,l){n(l,5,0,l.component.paymentSource.description)})}function K(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,2,"button",[["class","btn btn-outline-secondary"],["type","button"]],null,[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.changePayment()&&t);return t},null,null)),(n()(),t.ɵted(1,null,["\n ","\n "])),t.ɵppd(2,1)],null,function(n,l){var e=l.component;n(l,1,0,t.ɵunv(l,1,0,n(l,2,0,t.ɵnov(l.parent.parent.parent,0),e.paymentSource?"changePaymentMethod":"addPaymentMethod")))})}function H(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,2,"app-adjust-payment",[],null,[[null,"onAdjusted"],[null,"onCanceled"]],function(n,l,e){var t=!0,u=n.component;"onAdjusted"===l&&(t=!1!==u.closePayment(!0)&&t);"onCanceled"===l&&(t=!1!==u.closePayment(!1)&&t);return t},m.View_AdjustPaymentComponent_0,m.RenderType_AdjustPaymentComponent)),t.ɵdid(1,49152,null,0,y.AdjustPaymentComponent,[p.ApiService,i.I18nService,f.Angulartics2,v.ToasterService],{currentType:[0,"currentType"]},{onAdjusted:"onAdjusted",onCanceled:"onCanceled"}),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){var e=l.component;n(l,1,0,null!=e.paymentSource?e.paymentSource.type:null)},null)}function $(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,2,"p",[],null,null,null,null,null)),(n()(),t.ɵted(1,null,["",""])),t.ɵppd(2,1)],null,function(n,l){n(l,1,0,t.ɵunv(l,1,0,n(l,2,0,t.ɵnov(l.parent.parent.parent,0),"noCharges")))})}function W(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,18,"tr",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,2,"td",[],null,null,null,null,null)),(n()(),t.ɵted(3,null,["",""])),t.ɵppd(4,2),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(6,0,null,null,1,"td",[],null,null,null,null,null)),(n()(),t.ɵted(7,null,["",""])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(9,0,null,null,1,"td",[["class","text-capitalize"]],null,null,null,null,null)),(n()(),t.ɵted(10,null,["",""])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(12,0,null,null,5,"td",[],[[8,"title",0]],null,null,null,null)),t.ɵdid(13,278528,null,0,s.NgClass,[t.IterableDiffers,t.KeyValueDiffers,t.ElementRef,t.Renderer2],{ngClass:[0,"ngClass"]},null),t.ɵpod(14,{"text-strike":0}),t.ɵppd(15,1),(n()(),t.ɵted(16,null,["",""])),t.ɵppd(17,2),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){n(l,13,0,n(l,14,0,l.context.$implicit.refunded))},function(n,l){n(l,3,0,t.ɵunv(l,3,0,n(l,4,0,t.ɵnov(l.parent.parent.parent.parent,1),l.context.$implicit.createdDate,"mediumDate"))),n(l,7,0,l.context.$implicit.paymentSource?l.context.$implicit.paymentSource.description:"-"),n(l,10,0,l.context.$implicit.status),n(l,12,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,12,0,n(l,15,0,t.ɵnov(l.parent.parent.parent.parent,0),l.context.$implicit.refunded?"refunded":"")),"")),n(l,16,0,t.ɵunv(l,16,0,n(l,17,0,t.ɵnov(l.parent.parent.parent.parent,2),l.context.$implicit.amount,"$")))})}function Y(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,7,"table",[["class","table mb-2"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,4,"tbody",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,W)),t.ɵdid(5,802816,null,0,s.NgForOf,[t.ViewContainerRef,t.TemplateRef,t.IterableDiffers],{ngForOf:[0,"ngForOf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){n(l,5,0,l.component.charges)},null)}function Z(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,60,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,7,"div",[["class","d-flex"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,F)),t.ɵdid(5,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,L)),t.ɵdid(8,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(11,0,null,null,2,"h2",[["class","spaced-header"]],null,null,null,null,null)),(n()(),t.ɵted(12,null,["",""])),t.ɵppd(13,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(15,0,null,null,2,"p",[],null,null,null,null,null)),(n()(),t.ɵted(16,null,["",""])),t.ɵppd(17,3),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(19,0,null,null,7,"div",[["class","progress"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(21,0,null,null,4,"div",[["aria-valuemax","100"],["aria-valuemin","0"],["class","progress-bar bg-success"],["role","progressbar"]],[[1,"aria-valuenow",0]],null,null,null,null)),t.ɵdid(22,278528,null,0,s.NgStyle,[t.KeyValueDiffers,t.ElementRef,t.Renderer2],{ngStyle:[0,"ngStyle"]},null),t.ɵpod(23,{width:0}),(n()(),t.ɵted(24,null,["",""])),t.ɵppd(25,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,z)),t.ɵdid(29,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(31,0,null,null,2,"h2",[["class","spaced-header"]],null,null,null,null,null)),(n()(),t.ɵted(32,null,["",""])),t.ɵppd(33,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,j)),t.ɵdid(36,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,B)),t.ɵdid(39,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,K)),t.ɵdid(42,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,H)),t.ɵdid(45,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(47,0,null,null,2,"h2",[["class","spaced-header"]],null,null,null,null,null)),(n()(),t.ɵted(48,null,["",""])),t.ɵppd(49,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,$)),t.ɵdid(52,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,Y)),t.ɵdid(55,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(57,0,null,null,2,"small",[["class","text-muted"]],null,null,null,null,null)),(n()(),t.ɵted(58,null,["* ",""])),t.ɵppd(59,2),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){var e=l.component;n(l,5,0,!e.subscription||!e.subscription.cancelled),n(l,8,0,e.subscription&&!e.subscription.cancelled&&!e.subscriptionMarkedForCancel),n(l,22,0,n(l,23,0,e.storageProgressWidth+"%")),n(l,29,0,e.subscription&&!e.subscription.cancelled&&!e.subscriptionMarkedForCancel&&e.paymentSource),n(l,36,0,!e.paymentSource),n(l,39,0,e.paymentSource),n(l,42,0,!e.showAdjustPayment),n(l,45,0,e.showAdjustPayment),n(l,52,0,!e.charges||!e.charges.length),n(l,55,0,e.charges&&e.charges.length)},function(n,l){var e=l.component;n(l,12,0,t.ɵunv(l,12,0,n(l,13,0,t.ɵnov(l.parent.parent,0),"storage"))),n(l,16,0,t.ɵunv(l,16,0,n(l,17,0,t.ɵnov(l.parent.parent,0),"subscriptionStorage",e.billing.maxStorageGb||0,e.billing.storageName||"0 MB"))),n(l,21,0,e.storagePercentage),n(l,24,0,t.ɵunv(l,24,0,n(l,25,0,t.ɵnov(l.parent.parent,3),e.storagePercentage/100))),n(l,32,0,t.ɵunv(l,32,0,n(l,33,0,t.ɵnov(l.parent.parent,0),"paymentMethod"))),n(l,48,0,t.ɵunv(l,48,0,n(l,49,0,t.ɵnov(l.parent.parent,0),"charges"))),n(l,58,0,t.ɵunv(l,58,0,n(l,59,0,t.ɵnov(l.parent.parent,0),"chargesStatement","BITWARDEN")))})}function J(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,30,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,E)),t.ɵdid(3,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,O)),t.ɵdid(6,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(8,0,null,null,9,"dl",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(10,0,null,null,2,"dt",[],null,null,null,null,null)),(n()(),t.ɵted(11,null,["",""])),t.ɵppd(12,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(14,0,null,null,2,"dd",[],null,null,null,null,null)),(n()(),t.ɵted(15,null,["",""])),t.ɵppd(16,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,k)),t.ɵdid(20,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,x)),t.ɵdid(23,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,U)),t.ɵdid(26,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,Z)),t.ɵdid(29,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){var e=l.component;n(l,3,0,e.subscription&&e.subscription.cancelled),n(l,6,0,e.subscriptionMarkedForCancel),n(l,20,0,e.selfHosted),n(l,23,0,!e.selfHosted),n(l,26,0,e.selfHosted),n(l,29,0,!e.selfHosted)},function(n,l){n(l,11,0,t.ɵunv(l,11,0,n(l,12,0,t.ɵnov(l.parent,0),"subscription"))),n(l,15,0,t.ɵunv(l,15,0,n(l,16,0,t.ɵnov(l.parent,0),"premiumMembership")))})}function X(n){return t.ɵvid(0,[t.ɵpid(0,C.I18nPipe,[i.I18nService]),t.ɵpid(0,s.DatePipe,[t.LOCALE_ID]),t.ɵpid(0,s.CurrencyPipe,[t.LOCALE_ID]),t.ɵpid(0,s.PercentPipe,[t.LOCALE_ID]),(n()(),t.ɵeld(4,0,null,null,11,"div",[["class","page-header"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(6,0,null,null,8,"h1",[],null,null,null,null,null)),(n()(),t.ɵted(7,null,["\n ","\n "])),t.ɵppd(8,1),(n()(),t.ɵeld(9,0,null,null,4,"small",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,I)),t.ɵdid(12,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,null,null,1,null,A)),t.ɵdid(18,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,null,null,1,null,J)),t.ɵdid(21,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){var e=l.component;n(l,12,0,e.firstLoaded&&e.loading),n(l,18,0,!e.firstLoaded&&e.loading),n(l,21,0,e.billing)},function(n,l){n(l,7,0,t.ɵunv(l,7,0,n(l,8,0,t.ɵnov(l,0),"billingAndLicensing")))})}function Q(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"app-user-billing",[],null,null,null,X,_)),t.ɵdid(1,114688,null,0,b.UserBillingComponent,[S.TokenService,p.ApiService,w.PlatformUtilsService,i.I18nService,f.Angulartics2,v.ToasterService,R.Router],null,null)],function(n,l){n(l,1,0)},null)}l.RenderType_UserBillingComponent=_,l.View_UserBillingComponent_0=X,l.View_UserBillingComponent_Host_0=Q;var nn=t.ɵccf("app-user-billing",b.UserBillingComponent,Q,{},{},[]);l.UserBillingComponentNgFactory=nn},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=e(0),u=e(13),o=e(18),i=e(17),r=e(269),a=e(127),s=e(2),d=e(8),c=e(7),p=e(5),f=e(40),v=e(37),h=e(268),g=e(4),m=e(3),y=e(9),C=e(35),b=e(10),S=e(27),w=e(66),R=t.ɵcrt({encapsulation:2,styles:[],data:{}});function _(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,2,"a",[["class","btn btn-outline-secondary"],["href","https://vault.bitwarden.com/#/settings/premium"],["rel","noopener"],["target","_blank"]],null,null,null,null,null)),(n()(),t.ɵted(1,null,["\n ","\n "])),t.ɵppd(2,1)],null,function(n,l){n(l,1,0,t.ɵunv(l,1,0,n(l,2,0,t.ɵnov(l.parent,0),"purchasePremium")))})}function I(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,35,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,2,"p",[],null,null,null,null,null)),(n()(),t.ɵted(3,null,["",""])),t.ɵppd(4,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(6,0,[["form",1]],null,28,"form",[["ngNativeValidate",""]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngSubmit"],[null,"submit"],[null,"reset"]],function(n,l,e){var u=!0,o=n.component;"submit"===l&&(u=!1!==t.ɵnov(n,7).onSubmit(e)&&u);"reset"===l&&(u=!1!==t.ɵnov(n,7).onReset()&&u);"ngSubmit"===l&&(u=!1!==o.submit()&&u);return u},null,null)),t.ɵdid(7,4210688,null,0,u.NgForm,[[8,null],[8,null]],null,{ngSubmit:"ngSubmit"}),t.ɵprd(2048,null,u.ControlContainer,null,[u.NgForm]),t.ɵdid(9,16384,null,0,u.NgControlStatusGroup,[u.ControlContainer],null,null),t.ɵdid(10,540672,null,0,o.ApiActionDirective,[t.ElementRef,i.ValidationService],{appApiAction:[0,"appApiAction"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(12,0,null,null,11,"div",[["class","form-group"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(14,0,null,null,2,"label",[["for","file"]],null,null,null,null,null)),(n()(),t.ɵted(15,null,["",""])),t.ɵppd(16,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(18,0,null,null,0,"input",[["class","form-control-file"],["id","file"],["name","file"],["required",""],["type","file"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(20,0,null,null,2,"small",[["class","form-text text-muted"]],null,null,null,null,null)),(n()(),t.ɵted(21,null,["",""])),t.ɵppd(22,2),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(25,0,null,null,8,"button",[["class","btn btn-primary btn-submit"],["type","submit"]],[[8,"disabled",0]],null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(27,0,null,null,1,"i",[["class","fa fa-spinner fa-spin"]],[[8,"title",0]],null,null,null,null)),t.ɵppd(28,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(30,0,null,null,2,"span",[],null,null,null,null,null)),(n()(),t.ɵted(31,null,["",""])),t.ɵppd(32,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){n(l,10,0,l.component.formPromise)},function(n,l){n(l,3,0,t.ɵunv(l,3,0,n(l,4,0,t.ɵnov(l.parent,0),"uploadLicenseFilePremium"))),n(l,6,0,t.ɵnov(l,9).ngClassUntouched,t.ɵnov(l,9).ngClassTouched,t.ɵnov(l,9).ngClassPristine,t.ɵnov(l,9).ngClassDirty,t.ɵnov(l,9).ngClassValid,t.ɵnov(l,9).ngClassInvalid,t.ɵnov(l,9).ngClassPending),n(l,15,0,t.ɵunv(l,15,0,n(l,16,0,t.ɵnov(l.parent,0),"licenseFile"))),n(l,21,0,t.ɵunv(l,21,0,n(l,22,0,t.ɵnov(l.parent,0),"licenseFileDesc","bitwarden_premium_license.json"))),n(l,25,0,t.ɵnov(l,6).loading),n(l,27,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,27,0,n(l,28,0,t.ɵnov(l.parent,0),"loading")),"")),n(l,31,0,t.ɵunv(l,31,0,n(l,32,0,t.ɵnov(l.parent,0),"submit")))})}function A(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,[["form",1]],null,76,"form",[["ngNativeValidate",""]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngSubmit"],[null,"submit"],[null,"reset"]],function(n,l,e){var u=!0,o=n.component;"submit"===l&&(u=!1!==t.ɵnov(n,1).onSubmit(e)&&u);"reset"===l&&(u=!1!==t.ɵnov(n,1).onReset()&&u);"ngSubmit"===l&&(u=!1!==o.submit()&&u);return u},null,null)),t.ɵdid(1,4210688,null,0,u.NgForm,[[8,null],[8,null]],null,{ngSubmit:"ngSubmit"}),t.ɵprd(2048,null,u.ControlContainer,null,[u.NgForm]),t.ɵdid(3,16384,null,0,u.NgControlStatusGroup,[u.ControlContainer],null,null),t.ɵdid(4,540672,null,0,o.ApiActionDirective,[t.ElementRef,i.ValidationService],{appApiAction:[0,"appApiAction"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(6,0,null,null,2,"h2",[["class","mt-5"]],null,null,null,null,null)),(n()(),t.ɵted(7,null,["",""])),t.ɵppd(8,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(10,0,null,null,22,"div",[["class","row"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(12,0,null,null,19,"div",[["class","form-group col-6"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(14,0,null,null,2,"label",[["for","additionalStorage"]],null,null,null,null,null)),(n()(),t.ɵted(15,null,["",""])),t.ɵppd(16,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(18,0,null,null,7,"input",[["class","form-control"],["id","additionalStorage"],["max","99"],["min","0"],["name","AdditionalStorageGb"],["step","1"],["type","number"]],[[8,"placeholder",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"],[null,"change"]],function(n,l,e){var u=!0,o=n.component;"input"===l&&(u=!1!==t.ɵnov(n,19)._handleInput(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,19).onTouched()&&u);"compositionstart"===l&&(u=!1!==t.ɵnov(n,19)._compositionStart()&&u);"compositionend"===l&&(u=!1!==t.ɵnov(n,19)._compositionEnd(e.target.value)&&u);"change"===l&&(u=!1!==t.ɵnov(n,20).onChange(e.target.value)&&u);"input"===l&&(u=!1!==t.ɵnov(n,20).onChange(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,20).onTouched()&&u);"ngModelChange"===l&&(u=!1!==(o.additionalStorage=e)&&u);return u},null,null)),t.ɵdid(19,16384,null,0,u.DefaultValueAccessor,[t.Renderer2,t.ElementRef,[2,u.COMPOSITION_BUFFER_MODE]],null,null),t.ɵdid(20,16384,null,0,u.ɵbc,[t.Renderer2,t.ElementRef],null,null),t.ɵprd(1024,null,u.NG_VALUE_ACCESSOR,function(n,l){return[n,l]},[u.DefaultValueAccessor,u.ɵbc]),t.ɵdid(22,671744,null,0,u.NgModel,[[2,u.ControlContainer],[8,null],[8,null],[2,u.NG_VALUE_ACCESSOR]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,u.NgControl,null,[u.NgModel]),t.ɵdid(24,16384,null,0,u.NgControlStatus,[u.NgControl],null,null),t.ɵppd(25,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(27,0,null,null,3,"small",[["class","text-muted form-text"]],null,null,null,null,null)),(n()(),t.ɵted(28,null,["",""])),t.ɵppd(29,2),t.ɵppd(30,3),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(34,0,null,null,2,"h2",[["class","spaced-header"]],null,null,null,null,null)),(n()(),t.ɵted(35,null,["",""])),t.ɵppd(36,1),(n()(),t.ɵted(37,null,["\n ",": ","\n "])),t.ɵppd(38,1),t.ɵppd(39,2),(n()(),t.ɵeld(40,0,null,null,0,"br",[],null,null,null,null,null)),(n()(),t.ɵted(41,null,[" ",": "," GB × "," = ","\n "])),t.ɵppd(42,1),t.ɵppd(43,2),t.ɵppd(44,2),(n()(),t.ɵeld(45,0,null,null,0,"hr",[["class","my-3"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(47,0,null,null,7,"div",[["class","text-lg"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(49,0,null,null,2,"strong",[],null,null,null,null,null)),(n()(),t.ɵted(50,null,["",":"])),t.ɵppd(51,1),(n()(),t.ɵted(52,null,[" "," /","\n "])),t.ɵppd(53,2),t.ɵppd(54,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(56,0,null,null,2,"small",[["class","text-muted font-italic"]],null,null,null,null,null)),(n()(),t.ɵted(57,null,["",""])),t.ɵppd(58,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(60,0,null,null,2,"h2",[["class","spaced-header mb-4"]],null,null,null,null,null)),(n()(),t.ɵted(61,null,["",""])),t.ɵppd(62,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(64,0,null,null,1,"app-payment",[],null,null,null,r.View_PaymentComponent_0,r.RenderType_PaymentComponent)),t.ɵdid(65,245760,[[1,4]],0,a.PaymentComponent,[s.I18nService,d.PlatformUtilsService],{hideBank:[0,"hideBank"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(67,0,null,null,8,"button",[["class","btn btn-primary btn-submit"],["type","submit"]],[[8,"disabled",0]],null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(69,0,null,null,1,"i",[["class","fa fa-spinner fa-spin"]],[[8,"title",0]],null,null,null,null)),t.ɵppd(70,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(72,0,null,null,2,"span",[],null,null,null,null,null)),(n()(),t.ɵted(73,null,["",""])),t.ɵppd(74,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){var e=l.component;n(l,4,0,e.formPromise);n(l,22,0,"AdditionalStorageGb",e.additionalStorage);n(l,65,0,!0)},function(n,l){var e=l.component;n(l,0,0,t.ɵnov(l,3).ngClassUntouched,t.ɵnov(l,3).ngClassTouched,t.ɵnov(l,3).ngClassPristine,t.ɵnov(l,3).ngClassDirty,t.ɵnov(l,3).ngClassValid,t.ɵnov(l,3).ngClassInvalid,t.ɵnov(l,3).ngClassPending),n(l,7,0,t.ɵunv(l,7,0,n(l,8,0,t.ɵnov(l.parent,0),"addons"))),n(l,15,0,t.ɵunv(l,15,0,n(l,16,0,t.ɵnov(l.parent,0),"additionalStorageGb"))),n(l,18,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,18,0,n(l,25,0,t.ɵnov(l.parent,0),"additionalStorageGbDesc")),""),t.ɵnov(l,24).ngClassUntouched,t.ɵnov(l,24).ngClassTouched,t.ɵnov(l,24).ngClassPristine,t.ɵnov(l,24).ngClassDirty,t.ɵnov(l,24).ngClassValid,t.ɵnov(l,24).ngClassInvalid,t.ɵnov(l,24).ngClassPending),n(l,28,0,t.ɵunv(l,28,0,n(l,30,0,t.ɵnov(l.parent,0),"additionalStorageDesc","1 GB",t.ɵunv(l,28,0,n(l,29,0,t.ɵnov(l.parent,1),e.storageGbPrice,"$"))))),n(l,35,0,t.ɵunv(l,35,0,n(l,36,0,t.ɵnov(l.parent,0),"summary"))),n(l,37,0,t.ɵunv(l,37,0,n(l,38,0,t.ɵnov(l.parent,0),"premiumMembership")),t.ɵunv(l,37,1,n(l,39,0,t.ɵnov(l.parent,1),e.premiumPrice,"$"))),n(l,41,0,t.ɵunv(l,41,0,n(l,42,0,t.ɵnov(l.parent,0),"additionalStorageGb")),e.additionalStorage||0,t.ɵunv(l,41,2,n(l,43,0,t.ɵnov(l.parent,1),e.storageGbPrice,"$")),t.ɵunv(l,41,3,n(l,44,0,t.ɵnov(l.parent,1),e.additionalStorageTotal,"$"))),n(l,50,0,t.ɵunv(l,50,0,n(l,51,0,t.ɵnov(l.parent,0),"total"))),n(l,52,0,t.ɵunv(l,52,0,n(l,53,0,t.ɵnov(l.parent,1),e.total,"USD $")),t.ɵunv(l,52,1,n(l,54,0,t.ɵnov(l.parent,0),"year"))),n(l,57,0,t.ɵunv(l,57,0,n(l,58,0,t.ɵnov(l.parent,0),"paymentChargedAnnually"))),n(l,61,0,t.ɵunv(l,61,0,n(l,62,0,t.ɵnov(l.parent,0),"paymentInformation"))),n(l,67,0,t.ɵnov(l,0).loading),n(l,69,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,69,0,n(l,70,0,t.ɵnov(l.parent,0),"loading")),"")),n(l,73,0,t.ɵunv(l,73,0,n(l,74,0,t.ɵnov(l.parent,0),"submit")))})}function E(n){return t.ɵvid(0,[t.ɵpid(0,c.I18nPipe,[s.I18nService]),t.ɵpid(0,p.CurrencyPipe,[t.LOCALE_ID]),t.ɵqud(671088640,1,{paymentComponent:0}),(n()(),t.ɵeld(3,0,null,null,5,"div",[["class","page-header"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(5,0,null,null,2,"h1",[],null,null,null,null,null)),(n()(),t.ɵted(6,null,["",""])),t.ɵppd(7,1),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵeld(10,0,null,null,49,"app-callout",[["type","success"]],null,null,null,f.View_CalloutComponent_0,f.RenderType_CalloutComponent)),t.ɵdid(11,114688,null,0,v.CalloutComponent,[s.I18nService],{type:[0,"type"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵeld(13,0,null,0,2,"p",[],null,null,null,null,null)),(n()(),t.ɵted(14,null,["",""])),t.ɵppd(15,1),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵeld(17,0,null,0,31,"ul",[["class","fa-ul"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(19,0,null,null,4,"li",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(21,0,null,null,0,"i",[["class","fa fa-check text-success fa-li"]],null,null,null,null,null)),(n()(),t.ɵted(22,null,["\n ","\n "])),t.ɵppd(23,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(25,0,null,null,4,"li",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(27,0,null,null,0,"i",[["class","fa fa-check text-success fa-li"]],null,null,null,null,null)),(n()(),t.ɵted(28,null,["\n ","\n "])),t.ɵppd(29,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(31,0,null,null,4,"li",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(33,0,null,null,0,"i",[["class","fa fa-check text-success fa-li"]],null,null,null,null,null)),(n()(),t.ɵted(34,null,["\n ","\n "])),t.ɵppd(35,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(37,0,null,null,4,"li",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(39,0,null,null,0,"i",[["class","fa fa-check text-success fa-li"]],null,null,null,null,null)),(n()(),t.ɵted(40,null,["\n ","\n "])),t.ɵppd(41,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(43,0,null,null,4,"li",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(45,0,null,null,0,"i",[["class","fa fa-check text-success fa-li"]],null,null,null,null,null)),(n()(),t.ɵted(46,null,["\n ","\n "])),t.ɵppd(47,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵeld(50,0,null,0,5,"p",[["class","text-lg"]],null,null,null,null,null)),t.ɵdid(51,278528,null,0,p.NgClass,[t.IterableDiffers,t.KeyValueDiffers,t.ElementRef,t.Renderer2],{klass:[0,"klass"],ngClass:[1,"ngClass"]},null),t.ɵpod(52,{"mb-0":0}),(n()(),t.ɵted(53,null,["",""])),t.ɵppd(54,2),t.ɵppd(55,2),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,_)),t.ɵdid(58,16384,null,0,p.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n"])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,null,null,1,null,I)),t.ɵdid(62,16384,null,0,p.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,null,null,1,null,A)),t.ɵdid(65,16384,null,0,p.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){var e=l.component;n(l,11,0,"success");n(l,51,0,"text-lg",n(l,52,0,!e.selfHosted)),n(l,58,0,e.selfHosted),n(l,62,0,e.selfHosted),n(l,65,0,!e.selfHosted)},function(n,l){var e=l.component;n(l,6,0,t.ɵunv(l,6,0,n(l,7,0,t.ɵnov(l,0),"goPremium"))),n(l,14,0,t.ɵunv(l,14,0,n(l,15,0,t.ɵnov(l,0),"premiumUpgradeUnlockFeatures"))),n(l,22,0,t.ɵunv(l,22,0,n(l,23,0,t.ɵnov(l,0),"premiumSignUpStorage"))),n(l,28,0,t.ɵunv(l,28,0,n(l,29,0,t.ɵnov(l,0),"premiumSignUpTwoStep"))),n(l,34,0,t.ɵunv(l,34,0,n(l,35,0,t.ɵnov(l,0),"premiumSignUpTotp"))),n(l,40,0,t.ɵunv(l,40,0,n(l,41,0,t.ɵnov(l,0),"premiumSignUpSupport"))),n(l,46,0,t.ɵunv(l,46,0,n(l,47,0,t.ɵnov(l,0),"premiumSignUpFuture"))),n(l,53,0,t.ɵunv(l,53,0,n(l,55,0,t.ɵnov(l,0),"premiumPrice",t.ɵunv(l,53,0,n(l,54,0,t.ɵnov(l,1),e.premiumPrice,"$")))))})}function O(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"app-premium",[],null,null,null,E,R)),t.ɵdid(1,114688,null,0,h.PremiumComponent,[g.ApiService,s.I18nService,m.Angulartics2,y.ToasterService,d.PlatformUtilsService,C.TokenService,b.Router,S.MessagingService,w.SyncService],null,null)],function(n,l){n(l,1,0)},null)}l.RenderType_PremiumComponent=R,l.View_PremiumComponent_0=E,l.View_PremiumComponent_Host_0=O;var N=t.ɵccf("app-premium",h.PremiumComponent,O,{},{},[]);l.PremiumComponentNgFactory=N},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)});Object.defineProperty(l,"__esModule",{value:!0});var o=function(n){function l(){return null!==n&&n.apply(this,arguments)||this}return u(l,n),l}(e(73).PasswordVerificationRequest);l.UpdateTwoFactorYubioOtpRequest=o},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)});Object.defineProperty(l,"__esModule",{value:!0});var o=function(n){function l(){return null!==n&&n.apply(this,arguments)||this}return u(l,n),l}(e(73).PasswordVerificationRequest);l.UpdateTwoFactorU2fRequest=o},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)});Object.defineProperty(l,"__esModule",{value:!0});var o=function(n){function l(){return null!==n&&n.apply(this,arguments)||this}return u(l,n),l}(e(73).PasswordVerificationRequest);l.UpdateTwoFactorEmailRequest=o},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)});Object.defineProperty(l,"__esModule",{value:!0});var o=function(n){function l(){return null!==n&&n.apply(this,arguments)||this}return u(l,n),l}(e(73).PasswordVerificationRequest);l.UpdateTwoFactorDuoRequest=o},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)});Object.defineProperty(l,"__esModule",{value:!0});var o=function(n){function l(){return null!==n&&n.apply(this,arguments)||this}return u(l,n),l}(e(73).PasswordVerificationRequest);l.TwoFactorProviderRequest=o},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)});Object.defineProperty(l,"__esModule",{value:!0});var o=function(n){function l(){return null!==n&&n.apply(this,arguments)||this}return u(l,n),l}(e(73).PasswordVerificationRequest);l.UpdateTwoFactorAuthenticatorRequest=o},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=e(0),u=e(40),o=e(37),i=e(2),r=e(60),a=e(5),s=e(7),d=e(215),c=e(4),p=e(35),f=e(27),v=t.ɵcrt({encapsulation:2,styles:[],data:{}});function h(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,2,"p",[],null,null,null,null,null)),(n()(),t.ɵted(1,null,["",""])),t.ɵppd(2,1)],null,function(n,l){n(l,1,0,t.ɵunv(l,1,0,n(l,2,0,t.ɵnov(l.parent,0),"twoStepLoginDesc")))})}function g(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,2,"p",[],null,null,null,null,null)),(n()(),t.ɵted(1,null,["",""])),t.ɵppd(2,1)],null,function(n,l){n(l,1,0,t.ɵunv(l,1,0,n(l,2,0,t.ɵnov(l.parent,0),"twoStepLoginOrganizationDesc")))})}function m(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,10,"app-callout",[["type","warning"]],null,null,null,u.View_CalloutComponent_0,u.RenderType_CalloutComponent)),t.ɵdid(1,114688,null,0,o.CalloutComponent,[i.I18nService],{type:[0,"type"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵeld(3,0,null,0,2,"p",[],null,null,null,null,null)),(n()(),t.ɵted(4,null,["",""])),t.ɵppd(5,1),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵeld(7,0,null,0,2,"button",[["class","btn btn-outline-secondary"],["type","button"]],null,[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.recoveryCode()&&t);return t},null,null)),(n()(),t.ɵted(8,null,["",""])),t.ɵppd(9,1),(n()(),t.ɵted(-1,0,["\n"]))],function(n,l){n(l,1,0,"warning")},function(n,l){n(l,4,0,t.ɵunv(l,4,0,n(l,5,0,t.ɵnov(l.parent,0),"twoStepLoginRecoveryWarning"))),n(l,8,0,t.ɵunv(l,8,0,n(l,9,0,t.ɵnov(l.parent,0),"viewRecoveryCode")))})}function y(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,4,"small",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,1,"i",[["class","fa fa-spinner fa-spin fa-fw text-muted"]],[[8,"title",0]],null,null,null,null)),t.ɵppd(3,1),(n()(),t.ɵted(-1,null,["\n "]))],null,function(n,l){n(l,2,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,2,0,n(l,3,0,t.ɵnov(l.parent,0),"loading")),""))})}function C(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"i",[["class","fa fa-check text-success fa-fw"]],[[8,"title",0]],null,null,null,null)),t.ɵppd(1,1)],null,function(n,l){n(l,0,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,0,0,n(l,1,0,t.ɵnov(l.parent.parent,0),"enabled")),""))})}function b(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,3,"a",[["appStopClick",""],["class","badge badge-primary"],["href","#"]],null,[[null,"click"]],function(n,l,e){var u=!0,o=n.component;"click"===l&&(u=!1!==t.ɵnov(n,1).onClick(e)&&u);"click"===l&&(u=!1!==o.premiumRequired()&&u);return u},null,null)),t.ɵdid(1,16384,null,0,r.StopClickDirective,[],null,null),(n()(),t.ɵted(2,null,["\n ","\n "])),t.ɵppd(3,1)],null,function(n,l){n(l,2,0,t.ɵunv(l,2,0,n(l,3,0,t.ɵnov(l.parent.parent,0),"premium")))})}function S(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,25,"li",[["class","list-group-item d-flex align-items-center"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,3,"div",[["class","logo-2fa d-flex justify-content-center"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(4,0,null,null,0,"img",[["alt",""]],[[8,"src",4]],null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(7,0,null,null,10,"div",[["class","mx-4"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(9,0,null,null,7,"h3",[["class","mb-0"]],null,null,null,null,null)),(n()(),t.ɵted(10,null,["\n ","\n "])),(n()(),t.ɵand(16777216,null,null,1,null,C)),t.ɵdid(12,16384,null,0,a.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,b)),t.ɵdid(15,16384,null,0,a.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(17,null,["\n ","\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(19,0,null,null,5,"div",[["class","ml-auto"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(21,0,null,null,2,"button",[["class","btn btn-outline-secondary btn-sm"],["type","button"]],[[8,"disabled",0]],[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.manage(n.context.$implicit.type)&&t);return t},null,null)),(n()(),t.ɵted(22,null,["\n ","\n "])),t.ɵppd(23,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){var e=l.component;n(l,12,0,l.context.$implicit.enabled),n(l,15,0,!e.premium&&l.context.$implicit.premium)},function(n,l){var e=l.component;n(l,4,0,"images/two-factor/"+l.context.$implicit.type+".png"),n(l,10,0,l.context.$implicit.name),n(l,17,0,l.context.$implicit.description),n(l,21,0,!e.premium&&l.context.$implicit.premium),n(l,22,0,t.ɵunv(l,22,0,n(l,23,0,t.ɵnov(l.parent,0),"manage")))})}function w(n){return t.ɵvid(0,[(n()(),t.ɵand(0,null,null,0))],null,null)}function R(n){return t.ɵvid(0,[(n()(),t.ɵand(0,null,null,0))],null,null)}function _(n){return t.ɵvid(0,[(n()(),t.ɵand(0,null,null,0))],null,null)}function I(n){return t.ɵvid(0,[(n()(),t.ɵand(0,null,null,0))],null,null)}function A(n){return t.ɵvid(0,[(n()(),t.ɵand(0,null,null,0))],null,null)}function E(n){return t.ɵvid(0,[(n()(),t.ɵand(0,null,null,0))],null,null)}function O(n){return t.ɵvid(0,[t.ɵpid(0,s.I18nPipe,[i.I18nService]),t.ɵqud(402653184,1,{recoveryModalRef:0}),t.ɵqud(402653184,2,{authenticatorModalRef:0}),t.ɵqud(402653184,3,{yubikeyModalRef:0}),t.ɵqud(402653184,4,{u2fModalRef:0}),t.ɵqud(402653184,5,{duoModalRef:0}),t.ɵqud(402653184,6,{emailModalRef:0}),(n()(),t.ɵeld(7,0,null,null,5,"div",[["class","page-header"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(9,0,null,null,2,"h1",[],null,null,null,null,null)),(n()(),t.ɵted(10,null,["",""])),t.ɵppd(11,1),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,null,null,1,null,h)),t.ɵdid(15,16384,null,0,a.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,null,null,1,null,g)),t.ɵdid(18,16384,null,0,a.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,null,null,1,null,m)),t.ɵdid(21,16384,null,0,a.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵeld(23,0,null,null,7,"h2",[],null,null,null,null,null)),t.ɵdid(24,278528,null,0,a.NgClass,[t.IterableDiffers,t.KeyValueDiffers,t.ElementRef,t.Renderer2],{ngClass:[0,"ngClass"]},null),t.ɵpod(25,{"mt-5":0}),(n()(),t.ɵted(26,null,["\n ","\n "])),t.ɵppd(27,1),(n()(),t.ɵand(16777216,null,null,1,null,y)),t.ɵdid(29,16384,null,0,a.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵeld(32,0,null,null,4,"ul",[["class","list-group list-group-2fa"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,S)),t.ɵdid(35,802816,null,0,a.NgForOf,[t.ViewContainerRef,t.TemplateRef,t.IterableDiffers],{ngForOf:[0,"ngForOf"]},null),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n\n"])),(n()(),t.ɵand(16777216,[[2,3],["authenticatorTemplate",2]],null,0,null,w)),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,[[1,3],["recoveryTemplate",2]],null,0,null,R)),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,[[5,3],["duoTemplate",2]],null,0,null,_)),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,[[6,3],["emailTemplate",2]],null,0,null,I)),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,[[3,3],["yubikeyTemplate",2]],null,0,null,A)),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,[[4,3],["u2fTemplate",2]],null,0,null,E)),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){var e=l.component;n(l,15,0,!e.organizationId),n(l,18,0,e.organizationId),n(l,21,0,!e.organizationId),n(l,24,0,n(l,25,0,!e.organizationId)),n(l,29,0,e.loading),n(l,35,0,e.providers)},function(n,l){n(l,10,0,t.ɵunv(l,10,0,n(l,11,0,t.ɵnov(l,0),"twoStepLogin"))),n(l,26,0,t.ɵunv(l,26,0,n(l,27,0,t.ɵnov(l,0),"providers")))})}function N(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"app-two-factor-setup",[],null,null,null,O,v)),t.ɵdid(1,114688,null,0,d.TwoFactorSetupComponent,[c.ApiService,p.TokenService,t.ComponentFactoryResolver,f.MessagingService],null,null)],function(n,l){n(l,1,0)},null)}l.RenderType_TwoFactorSetupComponent=v,l.View_TwoFactorSetupComponent_0=O,l.View_TwoFactorSetupComponent_Host_0=N;var T=t.ɵccf("app-two-factor-setup",d.TwoFactorSetupComponent,N,{},{},[]);l.TwoFactorSetupComponentNgFactory=T},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(){}}();l.UpdateDomainsRequest=t},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=e(0),u=e(13),o=e(5),i=e(60),r=e(7),a=e(2),s=e(18),d=e(17),c=e(271),p=e(4),f=e(3),v=e(9),h=t.ɵcrt({encapsulation:2,styles:[],data:{}});function g(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,4,"p",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,1,"i",[["class","fa fa-spinner fa-spin text-muted"]],[[8,"title",0]],null,null,null,null)),t.ɵppd(3,1),(n()(),t.ɵted(-1,null,["\n "]))],null,function(n,l){n(l,2,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,2,0,n(l,3,0,t.ɵnov(l.parent,0),"loading")),""))})}function m(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,24,"div",[["class","form-group d-flex"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,15,"div",[["class","flex-fill"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(4,0,null,null,2,"label",[["class","sr-only"]],[[8,"htmlFor",0]],null,null,null,null)),(n()(),t.ɵted(5,null,["",""])),t.ɵppd(6,2),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(8,0,null,null,8,"textarea",[["class","form-control"],["required",""]],[[8,"id",0],[8,"placeholder",0],[1,"required",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(n,l,e){var u=!0,o=n.component;"input"===l&&(u=!1!==t.ɵnov(n,9)._handleInput(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,9).onTouched()&&u);"compositionstart"===l&&(u=!1!==t.ɵnov(n,9)._compositionStart()&&u);"compositionend"===l&&(u=!1!==t.ɵnov(n,9)._compositionEnd(e.target.value)&&u);"ngModelChange"===l&&(u=!1!==(o.custom[n.context.index]=e)&&u);return u},null,null)),t.ɵdid(9,16384,null,0,u.DefaultValueAccessor,[t.Renderer2,t.ElementRef,[2,u.COMPOSITION_BUFFER_MODE]],null,null),t.ɵdid(10,16384,null,0,u.RequiredValidator,[],{required:[0,"required"]},null),t.ɵprd(1024,null,u.NG_VALIDATORS,function(n){return[n]},[u.RequiredValidator]),t.ɵprd(1024,null,u.NG_VALUE_ACCESSOR,function(n){return[n]},[u.DefaultValueAccessor]),t.ɵdid(13,671744,null,0,u.NgModel,[[2,u.ControlContainer],[2,u.NG_VALIDATORS],[8,null],[2,u.NG_VALUE_ACCESSOR]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,u.NgControl,null,[u.NgModel]),t.ɵdid(15,16384,null,0,u.NgControlStatus,[u.NgControl],null,null),t.ɵppd(16,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(19,0,null,null,4,"button",[["class","btn btn-link text-danger ml-2"],["type","button"]],[[8,"title",0]],[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.remove(n.context.index)&&t);return t},null,null)),t.ɵppd(20,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(22,0,null,null,0,"i",[["class","fa fa-minus-circle fa-lg"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){var e=l.component;n(l,10,0,""),n(l,13,0,t.ɵinlineInterpolate(1,"CustomDomain[",l.context.index,"]"),e.custom[l.context.index])},function(n,l){n(l,4,0,t.ɵinlineInterpolate(1,"customDomain_",l.context.index,"")),n(l,5,0,t.ɵunv(l,5,0,n(l,6,0,t.ɵnov(l.parent.parent,0),"customDomainX",l.context.index+1))),n(l,8,0,t.ɵinlineInterpolate(1,"customDomain_",l.context.index,""),t.ɵinlineInterpolate(1,"",t.ɵunv(l,8,1,n(l,16,0,t.ɵnov(l.parent.parent,0),"ex"))," google.com, gmail.com"),t.ɵnov(l,10).required?"":null,t.ɵnov(l,15).ngClassUntouched,t.ɵnov(l,15).ngClassTouched,t.ɵnov(l,15).ngClassPristine,t.ɵnov(l,15).ngClassDirty,t.ɵnov(l,15).ngClassValid,t.ɵnov(l,15).ngClassInvalid,t.ɵnov(l,15).ngClassPending),n(l,19,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,19,0,n(l,20,0,t.ɵnov(l.parent.parent,0),"remove")),""))})}function y(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,14,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,m)),t.ɵdid(3,802816,null,0,o.NgForOf,[t.ViewContainerRef,t.TemplateRef,t.IterableDiffers],{ngForOf:[0,"ngForOf"],ngForTrackBy:[1,"ngForTrackBy"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(5,0,null,null,4,"button",[["class","btn btn-outline-secondary btn-sm mb-2"],["type","button"]],null,[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.add()&&t);return t},null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(7,0,null,null,0,"i",[["class","fa fa-plus fa-fw"]],null,null,null,null,null)),(n()(),t.ɵted(8,null,[" ","\n "])),t.ɵppd(9,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(11,0,null,null,2,"small",[["class","text-muted d-block mb-3"]],null,null,null,null,null)),(n()(),t.ɵted(12,null,["",""])),t.ɵppd(13,1),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){var e=l.component;n(l,3,0,e.custom,e.indexTrackBy)},function(n,l){n(l,8,0,t.ɵunv(l,8,0,n(l,9,0,t.ɵnov(l.parent,0),"newCustomDomain"))),n(l,12,0,t.ɵunv(l,12,0,n(l,13,0,t.ɵnov(l.parent,0),"newCustomDomainDesc")))})}function C(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,4,"p",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,1,"i",[["class","fa fa-spinner fa-spin text-muted"]],[[8,"title",0]],null,null,null,null)),t.ɵppd(3,1),(n()(),t.ɵted(-1,null,["\n "]))],null,function(n,l){n(l,2,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,2,0,n(l,3,0,t.ɵnov(l.parent,0),"loading")),""))})}function b(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,5,"a",[["appStopClick",""],["class","dropdown-item"],["href","#"]],null,[[null,"click"]],function(n,l,e){var u=!0,o=n.component;"click"===l&&(u=!1!==t.ɵnov(n,1).onClick(e)&&u);"click"===l&&(u=!1!==o.toggleExcluded(n.parent.context.$implicit)&&u);return u},null,null)),t.ɵdid(1,16384,null,0,i.StopClickDirective,[],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(3,0,null,null,0,"i",[["class","fa fa-fw fa-close"]],null,null,null,null,null)),(n()(),t.ɵted(4,null,["\n ","\n "])),t.ɵppd(5,1)],null,function(n,l){n(l,4,0,t.ɵunv(l,4,0,n(l,5,0,t.ɵnov(l.parent.parent.parent,0),"exclude")))})}function S(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,5,"a",[["appStopClick",""],["class","dropdown-item"],["href","#"]],null,[[null,"click"]],function(n,l,e){var u=!0,o=n.component;"click"===l&&(u=!1!==t.ɵnov(n,1).onClick(e)&&u);"click"===l&&(u=!1!==o.toggleExcluded(n.parent.context.$implicit)&&u);return u},null,null)),t.ɵdid(1,16384,null,0,i.StopClickDirective,[],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(3,0,null,null,0,"i",[["class","fa fa-fw fa-plus"]],null,null,null,null,null)),(n()(),t.ɵted(4,null,["\n ","\n "])),t.ɵppd(5,1)],null,function(n,l){n(l,4,0,t.ɵunv(l,4,0,n(l,5,0,t.ɵnov(l.parent.parent.parent,0),"include")))})}function w(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,33,"tr",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,3,"td",[],null,null,null,null,null)),t.ɵdid(3,278528,null,0,o.NgClass,[t.IterableDiffers,t.KeyValueDiffers,t.ElementRef,t.Renderer2],{ngClass:[0,"ngClass"]},null),t.ɵpod(4,{"table-list-strike":0}),(n()(),t.ɵted(5,null,["",""])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(7,0,null,null,25,"td",[["class","table-list-options"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(9,0,null,null,22,"div",[["appListDropdown",""],["class","dropdown"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(11,0,null,null,3,"button",[["aria-expanded","false"],["aria-haspopup","true"],["class","btn btn-outline-secondary dropdown-toggle"],["data-toggle","dropdown"],["type","button"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(13,0,null,null,0,"i",[["class","fa fa-cog fa-lg"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(16,0,null,null,14,"div",[["class","dropdown-menu dropdown-menu-right"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,b)),t.ɵdid(19,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,S)),t.ɵdid(22,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(24,0,null,null,5,"a",[["appStopClick",""],["class","dropdown-item"],["href","#"]],null,[[null,"click"]],function(n,l,e){var u=!0,o=n.component;"click"===l&&(u=!1!==t.ɵnov(n,25).onClick(e)&&u);"click"===l&&(u=!1!==o.customize(n.context.$implicit)&&u);return u},null,null)),t.ɵdid(25,16384,null,0,i.StopClickDirective,[],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(27,0,null,null,0,"i",[["class","fa fa-fw fa-scissors"]],null,null,null,null,null)),(n()(),t.ɵted(28,null,["\n ","\n "])),t.ɵppd(29,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){n(l,3,0,n(l,4,0,l.context.$implicit.excluded)),n(l,19,0,!l.context.$implicit.excluded),n(l,22,0,l.context.$implicit.excluded)},function(n,l){n(l,5,0,l.context.$implicit.domains),n(l,28,0,t.ɵunv(l,28,0,n(l,29,0,t.ɵnov(l.parent.parent,0),"customize")))})}function R(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,7,"table",[["class","table table-hover table-list"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,4,"tbody",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,w)),t.ɵdid(5,802816,null,0,o.NgForOf,[t.ViewContainerRef,t.TemplateRef,t.IterableDiffers],{ngForOf:[0,"ngForOf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){n(l,5,0,l.component.global)},null)}function _(n){return t.ɵvid(0,[t.ɵpid(0,r.I18nPipe,[a.I18nService]),(n()(),t.ɵeld(1,0,null,null,5,"div",[["class","page-header"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(3,0,null,null,2,"h1",[],null,null,null,null,null)),(n()(),t.ɵted(4,null,["",""])),t.ɵppd(5,1),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵeld(8,0,null,null,2,"p",[],null,null,null,null,null)),(n()(),t.ɵted(9,null,["",""])),t.ɵppd(10,1),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵeld(12,0,[["form",1]],null,45,"form",[["ngNativeValidate",""]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngSubmit"],[null,"submit"],[null,"reset"]],function(n,l,e){var u=!0,o=n.component;"submit"===l&&(u=!1!==t.ɵnov(n,13).onSubmit(e)&&u);"reset"===l&&(u=!1!==t.ɵnov(n,13).onReset()&&u);"ngSubmit"===l&&(u=!1!==o.submit()&&u);return u},null,null)),t.ɵdid(13,4210688,null,0,u.NgForm,[[8,null],[8,null]],null,{ngSubmit:"ngSubmit"}),t.ɵprd(2048,null,u.ControlContainer,null,[u.NgForm]),t.ɵdid(15,16384,null,0,u.NgControlStatusGroup,[u.ControlContainer],null,null),t.ɵdid(16,540672,null,0,s.ApiActionDirective,[t.ElementRef,d.ValidationService],{appApiAction:[0,"appApiAction"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(18,0,null,null,2,"h2",[],null,null,null,null,null)),(n()(),t.ɵted(19,null,["",""])),t.ɵppd(20,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,g)),t.ɵdid(23,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,y)),t.ɵdid(26,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(28,0,null,null,8,"button",[["class","btn btn-primary btn-submit"],["type","submit"]],[[8,"disabled",0]],null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(30,0,null,null,1,"i",[["class","fa fa-spinner fa-spin"]],[[8,"title",0]],null,null,null,null)),t.ɵppd(31,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(33,0,null,null,2,"span",[],null,null,null,null,null)),(n()(),t.ɵted(34,null,["",""])),t.ɵppd(35,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(38,0,null,null,2,"h2",[["class","spaced-header"]],null,null,null,null,null)),(n()(),t.ɵted(39,null,["",""])),t.ɵppd(40,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,C)),t.ɵdid(43,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,R)),t.ɵdid(46,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(48,0,null,null,8,"button",[["class","btn btn-primary btn-submit"],["type","submit"]],[[8,"disabled",0]],null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(50,0,null,null,1,"i",[["class","fa fa-spinner fa-spin"]],[[8,"title",0]],null,null,null,null)),t.ɵppd(51,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(53,0,null,null,2,"span",[],null,null,null,null,null)),(n()(),t.ɵted(54,null,["",""])),t.ɵppd(55,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){var e=l.component;n(l,16,0,e.formPromise),n(l,23,0,e.loading),n(l,26,0,!e.loading),n(l,43,0,e.loading),n(l,46,0,!e.loading&&e.global.length>0)},function(n,l){n(l,4,0,t.ɵunv(l,4,0,n(l,5,0,t.ɵnov(l,0),"domainRules"))),n(l,9,0,t.ɵunv(l,9,0,n(l,10,0,t.ɵnov(l,0),"domainRulesDesc"))),n(l,12,0,t.ɵnov(l,15).ngClassUntouched,t.ɵnov(l,15).ngClassTouched,t.ɵnov(l,15).ngClassPristine,t.ɵnov(l,15).ngClassDirty,t.ɵnov(l,15).ngClassValid,t.ɵnov(l,15).ngClassInvalid,t.ɵnov(l,15).ngClassPending),n(l,19,0,t.ɵunv(l,19,0,n(l,20,0,t.ɵnov(l,0),"customEqDomains"))),n(l,28,0,t.ɵnov(l,12).loading),n(l,30,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,30,0,n(l,31,0,t.ɵnov(l,0),"loading")),"")),n(l,34,0,t.ɵunv(l,34,0,n(l,35,0,t.ɵnov(l,0),"save"))),n(l,39,0,t.ɵunv(l,39,0,n(l,40,0,t.ɵnov(l,0),"globalEqDomains"))),n(l,48,0,t.ɵnov(l,12).loading),n(l,50,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,50,0,n(l,51,0,t.ɵnov(l,0),"loading")),"")),n(l,54,0,t.ɵunv(l,54,0,n(l,55,0,t.ɵnov(l,0),"save")))})}function I(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"app-domain-rules",[],null,null,null,_,h)),t.ɵdid(1,114688,null,0,c.DomainRulesComponent,[p.ApiService,a.I18nService,f.Angulartics2,v.ToasterService],null,null)],function(n,l){n(l,1,0)},null)}l.RenderType_DomainRulesComponent=h,l.View_DomainRulesComponent_0=_,l.View_DomainRulesComponent_Host_0=I;var A=t.ɵccf("app-domain-rules",c.DomainRulesComponent,I,{},{},[]);l.DomainRulesComponentNgFactory=A},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=e(0),u=e(13),o=e(7),i=e(2),r=e(5),a=e(272),s=e(117),d=e(61),c=e(3),p=e(9),f=t.ɵcrt({encapsulation:2,styles:[],data:{}});function v(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,3,"option",[],null,null,null,null,null)),t.ɵdid(1,147456,null,0,u.NgSelectOption,[t.ElementRef,t.Renderer2,[2,u.SelectControlValueAccessor]],{ngValue:[0,"ngValue"]},null),t.ɵdid(2,147456,null,0,u.ɵq,[t.ElementRef,t.Renderer2,[8,null]],{ngValue:[0,"ngValue"]},null),(n()(),t.ɵted(3,null,["",""]))],function(n,l){n(l,1,0,l.context.$implicit.value),n(l,2,0,l.context.$implicit.value)},function(n,l){n(l,3,0,l.context.$implicit.name)})}function h(n){return t.ɵvid(0,[t.ɵpid(0,o.I18nPipe,[i.I18nService]),(n()(),t.ɵeld(1,0,null,null,5,"div",[["class","page-header"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(3,0,null,null,2,"h1",[],null,null,null,null,null)),(n()(),t.ɵted(4,null,["",""])),t.ɵppd(5,1),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵeld(8,0,null,null,2,"p",[],null,null,null,null,null)),(n()(),t.ɵted(9,null,["",""])),t.ɵppd(10,1),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵeld(12,0,null,null,72,"form",[["ngNativeValidate",""]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngSubmit"],[null,"submit"],[null,"reset"]],function(n,l,e){var u=!0,o=n.component;"submit"===l&&(u=!1!==t.ɵnov(n,13).onSubmit(e)&&u);"reset"===l&&(u=!1!==t.ɵnov(n,13).onReset()&&u);"ngSubmit"===l&&(u=!1!==o.submit()&&u);return u},null,null)),t.ɵdid(13,4210688,null,0,u.NgForm,[[8,null],[8,null]],null,{ngSubmit:"ngSubmit"}),t.ɵprd(2048,null,u.ControlContainer,null,[u.NgForm]),t.ɵdid(15,16384,null,0,u.NgControlStatusGroup,[u.ControlContainer],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(17,0,null,null,35,"div",[["class","row"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(19,0,null,null,32,"div",[["class","col-6"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(21,0,null,null,29,"div",[["class","form-group"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(23,0,null,null,11,"div",[["class","d-flex"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(25,0,null,null,2,"label",[["for","locale"]],null,null,null,null,null)),(n()(),t.ɵted(26,null,["",""])),t.ɵppd(27,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(29,0,null,null,4,"a",[["class","ml-auto"],["href","https://help.bitwarden.com/article/localization/"],["rel","noopener"],["target","_blank"]],[[8,"title",0]],null,null,null,null)),t.ɵppd(30,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(32,0,null,null,0,"i",[["class","fa fa-question-circle-o"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(36,0,null,null,9,"select",[["class","form-control"],["id","locale"],["name","Locale"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"change"],[null,"blur"]],function(n,l,e){var u=!0,o=n.component;"change"===l&&(u=!1!==t.ɵnov(n,37).onChange(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,37).onTouched()&&u);"ngModelChange"===l&&(u=!1!==(o.locale=e)&&u);return u},null,null)),t.ɵdid(37,16384,null,0,u.SelectControlValueAccessor,[t.Renderer2,t.ElementRef],null,null),t.ɵprd(1024,null,u.NG_VALUE_ACCESSOR,function(n){return[n]},[u.SelectControlValueAccessor]),t.ɵdid(39,671744,null,0,u.NgModel,[[2,u.ControlContainer],[8,null],[8,null],[2,u.NG_VALUE_ACCESSOR]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,u.NgControl,null,[u.NgModel]),t.ɵdid(41,16384,null,0,u.NgControlStatus,[u.NgControl],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,v)),t.ɵdid(44,802816,null,0,r.NgForOf,[t.ViewContainerRef,t.TemplateRef,t.IterableDiffers],{ngForOf:[0,"ngForOf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(47,0,null,null,2,"small",[["class","form-text text-muted"]],null,null,null,null,null)),(n()(),t.ɵted(48,null,["",""])),t.ɵppd(49,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(54,0,null,null,25,"div",[["class","form-group"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(56,0,null,null,18,"div",[["class","form-check"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(58,0,null,null,5,"input",[["class","form-check-input"],["id","disableIcons"],["name","DisableIcons"],["type","checkbox"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"change"],[null,"blur"]],function(n,l,e){var u=!0,o=n.component;"change"===l&&(u=!1!==t.ɵnov(n,59).onChange(e.target.checked)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,59).onTouched()&&u);"ngModelChange"===l&&(u=!1!==(o.disableIcons=e)&&u);return u},null,null)),t.ɵdid(59,16384,null,0,u.CheckboxControlValueAccessor,[t.Renderer2,t.ElementRef],null,null),t.ɵprd(1024,null,u.NG_VALUE_ACCESSOR,function(n){return[n]},[u.CheckboxControlValueAccessor]),t.ɵdid(61,671744,null,0,u.NgModel,[[2,u.ControlContainer],[8,null],[8,null],[2,u.NG_VALUE_ACCESSOR]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,u.NgControl,null,[u.NgModel]),t.ɵdid(63,16384,null,0,u.NgControlStatus,[u.NgControl],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(65,0,null,null,2,"label",[["class","form-check-label"],["for","disableIcons"]],null,null,null,null,null)),(n()(),t.ɵted(66,null,["\n ","\n "])),t.ɵppd(67,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(69,0,null,null,4,"a",[["href","https://help.bitwarden.com/article/website-icons/"],["rel","noopener"],["target","_blank"]],[[8,"title",0]],null,null,null,null)),t.ɵppd(70,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(72,0,null,null,0,"i",[["class","fa fa-question-circle-o"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(76,0,null,null,2,"small",[["class","form-text text-muted"]],null,null,null,null,null)),(n()(),t.ɵted(77,null,["",""])),t.ɵppd(78,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(81,0,null,null,2,"button",[["class","btn btn-primary"],["type","submit"]],null,null,null,null,null)),(n()(),t.ɵted(82,null,["\n ","\n "])),t.ɵppd(83,1),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){var e=l.component;n(l,39,0,"Locale",e.locale),n(l,44,0,e.localeOptions);n(l,61,0,"DisableIcons",e.disableIcons)},function(n,l){n(l,4,0,t.ɵunv(l,4,0,n(l,5,0,t.ɵnov(l,0),"options"))),n(l,9,0,t.ɵunv(l,9,0,n(l,10,0,t.ɵnov(l,0),"optionsDesc"))),n(l,12,0,t.ɵnov(l,15).ngClassUntouched,t.ɵnov(l,15).ngClassTouched,t.ɵnov(l,15).ngClassPristine,t.ɵnov(l,15).ngClassDirty,t.ɵnov(l,15).ngClassValid,t.ɵnov(l,15).ngClassInvalid,t.ɵnov(l,15).ngClassPending),n(l,26,0,t.ɵunv(l,26,0,n(l,27,0,t.ɵnov(l,0),"language"))),n(l,29,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,29,0,n(l,30,0,t.ɵnov(l,0),"learnMore")),"")),n(l,36,0,t.ɵnov(l,41).ngClassUntouched,t.ɵnov(l,41).ngClassTouched,t.ɵnov(l,41).ngClassPristine,t.ɵnov(l,41).ngClassDirty,t.ɵnov(l,41).ngClassValid,t.ɵnov(l,41).ngClassInvalid,t.ɵnov(l,41).ngClassPending),n(l,48,0,t.ɵunv(l,48,0,n(l,49,0,t.ɵnov(l,0),"languageDesc"))),n(l,58,0,t.ɵnov(l,63).ngClassUntouched,t.ɵnov(l,63).ngClassTouched,t.ɵnov(l,63).ngClassPristine,t.ɵnov(l,63).ngClassDirty,t.ɵnov(l,63).ngClassValid,t.ɵnov(l,63).ngClassInvalid,t.ɵnov(l,63).ngClassPending),n(l,66,0,t.ɵunv(l,66,0,n(l,67,0,t.ɵnov(l,0),"disableIcons"))),n(l,69,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,69,0,n(l,70,0,t.ɵnov(l,0),"learnMore")),"")),n(l,77,0,t.ɵunv(l,77,0,n(l,78,0,t.ɵnov(l,0),"disableIconsDesc"))),n(l,82,0,t.ɵunv(l,82,0,n(l,83,0,t.ɵnov(l,0),"save")))})}function g(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"app-options",[],null,null,null,h,f)),t.ɵdid(1,114688,null,0,a.OptionsComponent,[s.StorageService,d.StateService,c.Angulartics2,i.I18nService,p.ToasterService],null,null)],function(n,l){n(l,1,0)},null)}l.RenderType_OptionsComponent=f,l.View_OptionsComponent_0=h,l.View_OptionsComponent_Host_0=g;var m=t.ɵccf("app-options",a.OptionsComponent,g,{},{},[]);l.OptionsComponentNgFactory=m},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)});Object.defineProperty(l,"__esModule",{value:!0});var o=function(n){function l(){return null!==n&&n.apply(this,arguments)||this}return u(l,n),l}(e(73).PasswordVerificationRequest);l.PasswordRequest=o},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=e(0),u=e(7),o=e(2),i=e(40),r=e(37),a=e(13),s=e(18),d=e(17),c=e(46),p=e(553),f=e(4),v=e(3),h=e(9),g=e(20),m=e(27),y=e(21),C=t.ɵcrt({encapsulation:2,styles:[],data:{}});function b(n){return t.ɵvid(0,[t.ɵpid(0,u.I18nPipe,[o.I18nService]),(n()(),t.ɵeld(1,0,null,null,3,"app-callout",[["type","warning"]],null,null,null,i.View_CalloutComponent_0,i.RenderType_CalloutComponent)),t.ɵdid(2,114688,null,0,r.CalloutComponent,[o.I18nService],{type:[0,"type"]},null),(n()(),t.ɵted(3,0,["",""])),t.ɵppd(4,1),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵeld(6,0,[["form",1]],null,72,"form",[["ngNativeValidate",""]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngSubmit"],[null,"submit"],[null,"reset"]],function(n,l,e){var u=!0,o=n.component;"submit"===l&&(u=!1!==t.ɵnov(n,7).onSubmit(e)&&u);"reset"===l&&(u=!1!==t.ɵnov(n,7).onReset()&&u);"ngSubmit"===l&&(u=!1!==o.submit()&&u);return u},null,null)),t.ɵdid(7,4210688,null,0,a.NgForm,[[8,null],[8,null]],null,{ngSubmit:"ngSubmit"}),t.ɵprd(2048,null,a.ControlContainer,null,[a.NgForm]),t.ɵdid(9,16384,null,0,a.NgControlStatusGroup,[a.ControlContainer],null,null),t.ɵdid(10,540672,null,0,s.ApiActionDirective,[t.ElementRef,d.ValidationService],{appApiAction:[0,"appApiAction"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(12,0,null,null,55,"div",[["class","row"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(14,0,null,null,52,"div",[["class","col-6"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(16,0,null,null,15,"div",[["class","form-group"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(18,0,null,null,2,"label",[["for","currentMasterPassword"]],null,null,null,null,null)),(n()(),t.ɵted(19,null,["",""])),t.ɵppd(20,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(22,0,null,null,8,"input",[["appInputVerbatim",""],["class","form-control"],["id","currentMasterPassword"],["name","MasterPasswordHash"],["required",""],["type","password"]],[[1,"required",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(n,l,e){var u=!0,o=n.component;"input"===l&&(u=!1!==t.ɵnov(n,23)._handleInput(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,23).onTouched()&&u);"compositionstart"===l&&(u=!1!==t.ɵnov(n,23)._compositionStart()&&u);"compositionend"===l&&(u=!1!==t.ɵnov(n,23)._compositionEnd(e.target.value)&&u);"ngModelChange"===l&&(u=!1!==(o.currentMasterPassword=e)&&u);return u},null,null)),t.ɵdid(23,16384,null,0,a.DefaultValueAccessor,[t.Renderer2,t.ElementRef,[2,a.COMPOSITION_BUFFER_MODE]],null,null),t.ɵdid(24,16384,null,0,a.RequiredValidator,[],{required:[0,"required"]},null),t.ɵprd(1024,null,a.NG_VALIDATORS,function(n){return[n]},[a.RequiredValidator]),t.ɵprd(1024,null,a.NG_VALUE_ACCESSOR,function(n){return[n]},[a.DefaultValueAccessor]),t.ɵdid(27,671744,null,0,a.NgModel,[[2,a.ControlContainer],[2,a.NG_VALIDATORS],[8,null],[2,a.NG_VALUE_ACCESSOR]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,a.NgControl,null,[a.NgModel]),t.ɵdid(29,16384,null,0,a.NgControlStatus,[a.NgControl],null,null),t.ɵdid(30,81920,null,0,c.InputVerbatimDirective,[t.ElementRef,t.Renderer2],{appInputVerbatim:[0,"appInputVerbatim"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(33,0,null,null,15,"div",[["class","form-group"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(35,0,null,null,2,"label",[["for","newMasterPassword"]],null,null,null,null,null)),(n()(),t.ɵted(36,null,["",""])),t.ɵppd(37,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(39,0,null,null,8,"input",[["appInputVerbatim",""],["class","form-control"],["id","newMasterPassword"],["name","NewMasterPasswordHash"],["required",""],["type","password"]],[[1,"required",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(n,l,e){var u=!0,o=n.component;"input"===l&&(u=!1!==t.ɵnov(n,40)._handleInput(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,40).onTouched()&&u);"compositionstart"===l&&(u=!1!==t.ɵnov(n,40)._compositionStart()&&u);"compositionend"===l&&(u=!1!==t.ɵnov(n,40)._compositionEnd(e.target.value)&&u);"ngModelChange"===l&&(u=!1!==(o.newMasterPassword=e)&&u);return u},null,null)),t.ɵdid(40,16384,null,0,a.DefaultValueAccessor,[t.Renderer2,t.ElementRef,[2,a.COMPOSITION_BUFFER_MODE]],null,null),t.ɵdid(41,16384,null,0,a.RequiredValidator,[],{required:[0,"required"]},null),t.ɵprd(1024,null,a.NG_VALIDATORS,function(n){return[n]},[a.RequiredValidator]),t.ɵprd(1024,null,a.NG_VALUE_ACCESSOR,function(n){return[n]},[a.DefaultValueAccessor]),t.ɵdid(44,671744,null,0,a.NgModel,[[2,a.ControlContainer],[2,a.NG_VALIDATORS],[8,null],[2,a.NG_VALUE_ACCESSOR]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,a.NgControl,null,[a.NgModel]),t.ɵdid(46,16384,null,0,a.NgControlStatus,[a.NgControl],null,null),t.ɵdid(47,81920,null,0,c.InputVerbatimDirective,[t.ElementRef,t.Renderer2],{appInputVerbatim:[0,"appInputVerbatim"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(50,0,null,null,15,"div",[["class","form-group"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(52,0,null,null,2,"label",[["for","confirmNewMasterPassword"]],null,null,null,null,null)),(n()(),t.ɵted(53,null,["",""])),t.ɵppd(54,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(56,0,null,null,8,"input",[["appInputVerbatim",""],["class","form-control"],["id","confirmNewMasterPassword"],["name","ConfirmNewMasterPasswordHash"],["required",""],["type","password"]],[[1,"required",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(n,l,e){var u=!0,o=n.component;"input"===l&&(u=!1!==t.ɵnov(n,57)._handleInput(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,57).onTouched()&&u);"compositionstart"===l&&(u=!1!==t.ɵnov(n,57)._compositionStart()&&u);"compositionend"===l&&(u=!1!==t.ɵnov(n,57)._compositionEnd(e.target.value)&&u);"ngModelChange"===l&&(u=!1!==(o.confirmNewMasterPassword=e)&&u);return u},null,null)),t.ɵdid(57,16384,null,0,a.DefaultValueAccessor,[t.Renderer2,t.ElementRef,[2,a.COMPOSITION_BUFFER_MODE]],null,null),t.ɵdid(58,16384,null,0,a.RequiredValidator,[],{required:[0,"required"]},null),t.ɵprd(1024,null,a.NG_VALIDATORS,function(n){return[n]},[a.RequiredValidator]),t.ɵprd(1024,null,a.NG_VALUE_ACCESSOR,function(n){return[n]},[a.DefaultValueAccessor]),t.ɵdid(61,671744,null,0,a.NgModel,[[2,a.ControlContainer],[2,a.NG_VALIDATORS],[8,null],[2,a.NG_VALUE_ACCESSOR]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,a.NgControl,null,[a.NgModel]),t.ɵdid(63,16384,null,0,a.NgControlStatus,[a.NgControl],null,null),t.ɵdid(64,81920,null,0,c.InputVerbatimDirective,[t.ElementRef,t.Renderer2],{appInputVerbatim:[0,"appInputVerbatim"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(69,0,null,null,8,"button",[["class","btn btn-primary btn-submit"],["type","submit"]],[[8,"disabled",0]],null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(71,0,null,null,1,"i",[["class","fa fa-spinner fa-spin"]],[[8,"title",0]],null,null,null,null)),t.ɵppd(72,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(74,0,null,null,2,"span",[],null,null,null,null,null)),(n()(),t.ɵted(75,null,["",""])),t.ɵppd(76,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){var e=l.component;n(l,2,0,"warning"),n(l,10,0,e.formPromise);n(l,24,0,"");n(l,27,0,"MasterPasswordHash",e.currentMasterPassword);n(l,30,0,"");n(l,41,0,"");n(l,44,0,"NewMasterPasswordHash",e.newMasterPassword);n(l,47,0,"");n(l,58,0,"");n(l,61,0,"ConfirmNewMasterPasswordHash",e.confirmNewMasterPassword);n(l,64,0,"")},function(n,l){n(l,3,0,t.ɵunv(l,3,0,n(l,4,0,t.ɵnov(l,0),"loggedOutWarning"))),n(l,6,0,t.ɵnov(l,9).ngClassUntouched,t.ɵnov(l,9).ngClassTouched,t.ɵnov(l,9).ngClassPristine,t.ɵnov(l,9).ngClassDirty,t.ɵnov(l,9).ngClassValid,t.ɵnov(l,9).ngClassInvalid,t.ɵnov(l,9).ngClassPending),n(l,19,0,t.ɵunv(l,19,0,n(l,20,0,t.ɵnov(l,0),"currentMasterPass"))),n(l,22,0,t.ɵnov(l,24).required?"":null,t.ɵnov(l,29).ngClassUntouched,t.ɵnov(l,29).ngClassTouched,t.ɵnov(l,29).ngClassPristine,t.ɵnov(l,29).ngClassDirty,t.ɵnov(l,29).ngClassValid,t.ɵnov(l,29).ngClassInvalid,t.ɵnov(l,29).ngClassPending),n(l,36,0,t.ɵunv(l,36,0,n(l,37,0,t.ɵnov(l,0),"newMasterPass"))),n(l,39,0,t.ɵnov(l,41).required?"":null,t.ɵnov(l,46).ngClassUntouched,t.ɵnov(l,46).ngClassTouched,t.ɵnov(l,46).ngClassPristine,t.ɵnov(l,46).ngClassDirty,t.ɵnov(l,46).ngClassValid,t.ɵnov(l,46).ngClassInvalid,t.ɵnov(l,46).ngClassPending),n(l,53,0,t.ɵunv(l,53,0,n(l,54,0,t.ɵnov(l,0),"confirmNewMasterPass"))),n(l,56,0,t.ɵnov(l,58).required?"":null,t.ɵnov(l,63).ngClassUntouched,t.ɵnov(l,63).ngClassTouched,t.ɵnov(l,63).ngClassPristine,t.ɵnov(l,63).ngClassDirty,t.ɵnov(l,63).ngClassValid,t.ɵnov(l,63).ngClassInvalid,t.ɵnov(l,63).ngClassPending),n(l,69,0,t.ɵnov(l,6).loading),n(l,71,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,71,0,n(l,72,0,t.ɵnov(l,0),"loading")),"")),n(l,75,0,t.ɵunv(l,75,0,n(l,76,0,t.ɵnov(l,0),"changeMasterPassword")))})}function S(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"app-change-password",[],null,null,null,b,C)),t.ɵdid(1,49152,null,0,p.ChangePasswordComponent,[f.ApiService,o.I18nService,v.Angulartics2,h.ToasterService,g.CryptoService,m.MessagingService,y.UserService],null,null)],null,null)}l.RenderType_ChangePasswordComponent=C,l.View_ChangePasswordComponent_0=b,l.View_ChangePasswordComponent_Host_0=S;var w=t.ɵccf("app-change-password",p.ChangePasswordComponent,S,{},{},[]);l.ChangePasswordComponentNgFactory=w},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)});Object.defineProperty(l,"__esModule",{value:!0});var o=function(n){function l(){return null!==n&&n.apply(this,arguments)||this}return u(l,n),l}(e(554).EmailTokenRequest);l.EmailRequest=o},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=e(0),u=e(40),o=e(37),i=e(2),r=e(13),a=e(46),s=e(7),d=e(18),c=e(17),p=e(5),f=e(555),v=e(4),h=e(3),g=e(9),m=e(20),y=e(27),C=t.ɵcrt({encapsulation:2,styles:[],data:{}});function b(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,35,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,0,"hr",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(4,0,null,null,2,"p",[],null,null,null,null,null)),(n()(),t.ɵted(5,null,["",""])),t.ɵppd(6,2),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(8,0,null,null,3,"app-callout",[["type","warning"]],null,null,null,u.View_CalloutComponent_0,u.RenderType_CalloutComponent)),t.ɵdid(9,114688,null,0,o.CalloutComponent,[i.I18nService],{type:[0,"type"]},null),(n()(),t.ɵted(10,0,["",""])),t.ɵppd(11,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(13,0,null,null,21,"div",[["class","row"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(15,0,null,null,18,"div",[["class","col-6"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(17,0,null,null,15,"div",[["class","form-group"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(19,0,null,null,2,"label",[["for","token"]],null,null,null,null,null)),(n()(),t.ɵted(20,null,["",""])),t.ɵppd(21,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(23,0,null,null,8,"input",[["appInputVerbatim",""],["class","form-control"],["id","token"],["name","Token"],["required",""],["type","text"]],[[1,"required",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(n,l,e){var u=!0,o=n.component;"input"===l&&(u=!1!==t.ɵnov(n,24)._handleInput(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,24).onTouched()&&u);"compositionstart"===l&&(u=!1!==t.ɵnov(n,24)._compositionStart()&&u);"compositionend"===l&&(u=!1!==t.ɵnov(n,24)._compositionEnd(e.target.value)&&u);"ngModelChange"===l&&(u=!1!==(o.token=e)&&u);return u},null,null)),t.ɵdid(24,16384,null,0,r.DefaultValueAccessor,[t.Renderer2,t.ElementRef,[2,r.COMPOSITION_BUFFER_MODE]],null,null),t.ɵdid(25,16384,null,0,r.RequiredValidator,[],{required:[0,"required"]},null),t.ɵprd(1024,null,r.NG_VALIDATORS,function(n){return[n]},[r.RequiredValidator]),t.ɵprd(1024,null,r.NG_VALUE_ACCESSOR,function(n){return[n]},[r.DefaultValueAccessor]),t.ɵdid(28,671744,null,0,r.NgModel,[[2,r.ControlContainer],[2,r.NG_VALIDATORS],[8,null],[2,r.NG_VALUE_ACCESSOR]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,r.NgControl,null,[r.NgModel]),t.ɵdid(30,16384,null,0,r.NgControlStatus,[r.NgControl],null,null),t.ɵdid(31,81920,null,0,a.InputVerbatimDirective,[t.ElementRef,t.Renderer2],{appInputVerbatim:[0,"appInputVerbatim"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){var e=l.component;n(l,9,0,"warning");n(l,25,0,"");n(l,28,0,"Token",e.token);n(l,31,0,"")},function(n,l){var e=l.component;n(l,5,0,t.ɵunv(l,5,0,n(l,6,0,t.ɵnov(l.parent,0),"changeEmailDesc",e.newEmail))),n(l,10,0,t.ɵunv(l,10,0,n(l,11,0,t.ɵnov(l.parent,0),"loggedOutWarning"))),n(l,20,0,t.ɵunv(l,20,0,n(l,21,0,t.ɵnov(l.parent,0),"code"))),n(l,23,0,t.ɵnov(l,25).required?"":null,t.ɵnov(l,30).ngClassUntouched,t.ɵnov(l,30).ngClassTouched,t.ɵnov(l,30).ngClassPristine,t.ɵnov(l,30).ngClassDirty,t.ɵnov(l,30).ngClassValid,t.ɵnov(l,30).ngClassInvalid,t.ɵnov(l,30).ngClassPending)})}function S(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,2,"span",[],null,null,null,null,null)),(n()(),t.ɵted(1,null,["",""])),t.ɵppd(2,1)],null,function(n,l){n(l,1,0,t.ɵunv(l,1,0,n(l,2,0,t.ɵnov(l.parent,0),"continue")))})}function w(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,2,"span",[],null,null,null,null,null)),(n()(),t.ɵted(1,null,["",""])),t.ɵppd(2,1)],null,function(n,l){n(l,1,0,t.ɵunv(l,1,0,n(l,2,0,t.ɵnov(l.parent,0),"changeEmail")))})}function R(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,2,"button",[["class","btn btn-outline-secondary"],["type","button"]],null,[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.reset()&&t);return t},null,null)),(n()(),t.ɵted(1,null,["\n ","\n "])),t.ɵppd(2,1)],null,function(n,l){n(l,1,0,t.ɵunv(l,1,0,n(l,2,0,t.ɵnov(l.parent,0),"cancel")))})}function _(n){return t.ɵvid(0,[t.ɵpid(0,s.I18nPipe,[i.I18nService]),(n()(),t.ɵeld(1,0,[["form",1]],null,63,"form",[["ngNativeValidate",""]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngSubmit"],[null,"submit"],[null,"reset"]],function(n,l,e){var u=!0,o=n.component;"submit"===l&&(u=!1!==t.ɵnov(n,2).onSubmit(e)&&u);"reset"===l&&(u=!1!==t.ɵnov(n,2).onReset()&&u);"ngSubmit"===l&&(u=!1!==o.submit()&&u);return u},null,null)),t.ɵdid(2,4210688,null,0,r.NgForm,[[8,null],[8,null]],null,{ngSubmit:"ngSubmit"}),t.ɵprd(2048,null,r.ControlContainer,null,[r.NgForm]),t.ɵdid(4,16384,null,0,r.NgControlStatusGroup,[r.ControlContainer],null,null),t.ɵdid(5,540672,null,0,d.ApiActionDirective,[t.ElementRef,c.ValidationService],{appApiAction:[0,"appApiAction"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(7,0,null,null,38,"div",[["class","row"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(9,0,null,null,35,"div",[["class","col-6"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(11,0,null,null,15,"div",[["class","form-group"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(13,0,null,null,2,"label",[["for","masterPassword"]],null,null,null,null,null)),(n()(),t.ɵted(14,null,["",""])),t.ɵppd(15,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(17,0,null,null,8,"input",[["appInputVerbatim",""],["class","form-control"],["id","masterPassword"],["name","MasterPasswordHash"],["required",""],["type","password"]],[[8,"readOnly",0],[1,"required",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(n,l,e){var u=!0,o=n.component;"input"===l&&(u=!1!==t.ɵnov(n,18)._handleInput(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,18).onTouched()&&u);"compositionstart"===l&&(u=!1!==t.ɵnov(n,18)._compositionStart()&&u);"compositionend"===l&&(u=!1!==t.ɵnov(n,18)._compositionEnd(e.target.value)&&u);"ngModelChange"===l&&(u=!1!==(o.masterPassword=e)&&u);return u},null,null)),t.ɵdid(18,16384,null,0,r.DefaultValueAccessor,[t.Renderer2,t.ElementRef,[2,r.COMPOSITION_BUFFER_MODE]],null,null),t.ɵdid(19,16384,null,0,r.RequiredValidator,[],{required:[0,"required"]},null),t.ɵprd(1024,null,r.NG_VALIDATORS,function(n){return[n]},[r.RequiredValidator]),t.ɵprd(1024,null,r.NG_VALUE_ACCESSOR,function(n){return[n]},[r.DefaultValueAccessor]),t.ɵdid(22,671744,null,0,r.NgModel,[[2,r.ControlContainer],[2,r.NG_VALIDATORS],[8,null],[2,r.NG_VALUE_ACCESSOR]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,r.NgControl,null,[r.NgModel]),t.ɵdid(24,16384,null,0,r.NgControlStatus,[r.NgControl],null,null),t.ɵdid(25,81920,null,0,a.InputVerbatimDirective,[t.ElementRef,t.Renderer2],{appInputVerbatim:[0,"appInputVerbatim"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(28,0,null,null,15,"div",[["class","form-group"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(30,0,null,null,2,"label",[["for","newEmail"]],null,null,null,null,null)),(n()(),t.ɵted(31,null,["",""])),t.ɵppd(32,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(34,0,null,null,8,"input",[["appInputVerbatim","false"],["class","form-control"],["id","newEmail"],["inputmode","email"],["name","NewEmail"],["required",""],["type","text"]],[[8,"readOnly",0],[1,"required",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(n,l,e){var u=!0,o=n.component;"input"===l&&(u=!1!==t.ɵnov(n,35)._handleInput(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,35).onTouched()&&u);"compositionstart"===l&&(u=!1!==t.ɵnov(n,35)._compositionStart()&&u);"compositionend"===l&&(u=!1!==t.ɵnov(n,35)._compositionEnd(e.target.value)&&u);"ngModelChange"===l&&(u=!1!==(o.newEmail=e)&&u);return u},null,null)),t.ɵdid(35,16384,null,0,r.DefaultValueAccessor,[t.Renderer2,t.ElementRef,[2,r.COMPOSITION_BUFFER_MODE]],null,null),t.ɵdid(36,16384,null,0,r.RequiredValidator,[],{required:[0,"required"]},null),t.ɵprd(1024,null,r.NG_VALIDATORS,function(n){return[n]},[r.RequiredValidator]),t.ɵprd(1024,null,r.NG_VALUE_ACCESSOR,function(n){return[n]},[r.DefaultValueAccessor]),t.ɵdid(39,671744,null,0,r.NgModel,[[2,r.ControlContainer],[2,r.NG_VALIDATORS],[8,null],[2,r.NG_VALUE_ACCESSOR]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,r.NgControl,null,[r.NgModel]),t.ɵdid(41,16384,null,0,r.NgControlStatus,[r.NgControl],null,null),t.ɵdid(42,81920,null,0,a.InputVerbatimDirective,[t.ElementRef,t.Renderer2],{appInputVerbatim:[0,"appInputVerbatim"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,b)),t.ɵdid(48,16384,null,0,p.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(50,0,null,null,10,"button",[["class","btn btn-primary btn-submit"],["type","submit"]],[[8,"disabled",0]],null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(52,0,null,null,1,"i",[["class","fa fa-spinner fa-spin"]],[[8,"title",0]],null,null,null,null)),t.ɵppd(53,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,S)),t.ɵdid(56,16384,null,0,p.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,w)),t.ɵdid(59,16384,null,0,p.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,R)),t.ɵdid(63,16384,null,0,p.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){var e=l.component;n(l,5,0,e.formPromise);n(l,19,0,"");n(l,22,0,"MasterPasswordHash",e.masterPassword);n(l,25,0,"");n(l,36,0,"");n(l,39,0,"NewEmail",e.newEmail);n(l,42,0,"false"),n(l,48,0,e.tokenSent),n(l,56,0,!e.tokenSent),n(l,59,0,e.tokenSent),n(l,63,0,e.tokenSent)},function(n,l){var e=l.component;n(l,1,0,t.ɵnov(l,4).ngClassUntouched,t.ɵnov(l,4).ngClassTouched,t.ɵnov(l,4).ngClassPristine,t.ɵnov(l,4).ngClassDirty,t.ɵnov(l,4).ngClassValid,t.ɵnov(l,4).ngClassInvalid,t.ɵnov(l,4).ngClassPending),n(l,14,0,t.ɵunv(l,14,0,n(l,15,0,t.ɵnov(l,0),"masterPass"))),n(l,17,0,e.tokenSent,t.ɵnov(l,19).required?"":null,t.ɵnov(l,24).ngClassUntouched,t.ɵnov(l,24).ngClassTouched,t.ɵnov(l,24).ngClassPristine,t.ɵnov(l,24).ngClassDirty,t.ɵnov(l,24).ngClassValid,t.ɵnov(l,24).ngClassInvalid,t.ɵnov(l,24).ngClassPending),n(l,31,0,t.ɵunv(l,31,0,n(l,32,0,t.ɵnov(l,0),"newEmail"))),n(l,34,0,e.tokenSent,t.ɵnov(l,36).required?"":null,t.ɵnov(l,41).ngClassUntouched,t.ɵnov(l,41).ngClassTouched,t.ɵnov(l,41).ngClassPristine,t.ɵnov(l,41).ngClassDirty,t.ɵnov(l,41).ngClassValid,t.ɵnov(l,41).ngClassInvalid,t.ɵnov(l,41).ngClassPending),n(l,50,0,t.ɵnov(l,1).loading),n(l,52,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,52,0,n(l,53,0,t.ɵnov(l,0),"loading")),""))})}function I(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"app-change-email",[],null,null,null,_,C)),t.ɵdid(1,49152,null,0,f.ChangeEmailComponent,[v.ApiService,i.I18nService,h.Angulartics2,g.ToasterService,m.CryptoService,y.MessagingService],null,null)],null,null)}l.RenderType_ChangeEmailComponent=C,l.View_ChangeEmailComponent_0=_,l.View_ChangeEmailComponent_Host_0=I;var A=t.ɵccf("app-change-email",f.ChangeEmailComponent,I,{},{},[]);l.ChangeEmailComponentNgFactory=A},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(n,l){this.culture="en-US",this.name=n,this.masterPasswordHint=l||null}}();l.UpdateProfileRequest=t},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=e(0),u=e(13),o=e(18),i=e(17),r=e(130),a=e(116),s=e(42),d=e(7),c=e(2),p=e(5),f=e(556),v=e(4),h=e(3),g=e(9),m=t.ɵcrt({encapsulation:2,styles:[],data:{}});function y(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,4,"div",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,1,"i",[["class","fa fa-spinner fa-spin text-muted"]],[[8,"title",0]],null,null,null,null)),t.ɵppd(3,1),(n()(),t.ɵted(-1,null,["\n"]))],null,function(n,l){n(l,2,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,2,0,n(l,3,0,t.ɵnov(l.parent,0),"loading")),""))})}function C(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,[["form",1]],null,69,"form",[["ngNativeValidate",""]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngSubmit"],[null,"submit"],[null,"reset"]],function(n,l,e){var u=!0,o=n.component;"submit"===l&&(u=!1!==t.ɵnov(n,1).onSubmit(e)&&u);"reset"===l&&(u=!1!==t.ɵnov(n,1).onReset()&&u);"ngSubmit"===l&&(u=!1!==o.submit()&&u);return u},null,null)),t.ɵdid(1,4210688,null,0,u.NgForm,[[8,null],[8,null]],null,{ngSubmit:"ngSubmit"}),t.ɵprd(2048,null,u.ControlContainer,null,[u.NgForm]),t.ɵdid(3,16384,null,0,u.NgControlStatusGroup,[u.ControlContainer],null,null),t.ɵdid(4,540672,null,0,o.ApiActionDirective,[t.ElementRef,i.ValidationService],{appApiAction:[0,"appApiAction"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(6,0,null,null,52,"div",[["class","row"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(8,0,null,null,43,"div",[["class","col-6"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(10,0,null,null,12,"div",[["class","form-group"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(12,0,null,null,2,"label",[["for","name"]],null,null,null,null,null)),(n()(),t.ɵted(13,null,["",""])),t.ɵppd(14,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(16,0,null,null,5,"input",[["class","form-control"],["id","name"],["name","Name"],["type","text"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(n,l,e){var u=!0,o=n.component;"input"===l&&(u=!1!==t.ɵnov(n,17)._handleInput(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,17).onTouched()&&u);"compositionstart"===l&&(u=!1!==t.ɵnov(n,17)._compositionStart()&&u);"compositionend"===l&&(u=!1!==t.ɵnov(n,17)._compositionEnd(e.target.value)&&u);"ngModelChange"===l&&(u=!1!==(o.profile.name=e)&&u);return u},null,null)),t.ɵdid(17,16384,null,0,u.DefaultValueAccessor,[t.Renderer2,t.ElementRef,[2,u.COMPOSITION_BUFFER_MODE]],null,null),t.ɵprd(1024,null,u.NG_VALUE_ACCESSOR,function(n){return[n]},[u.DefaultValueAccessor]),t.ɵdid(19,671744,null,0,u.NgModel,[[2,u.ControlContainer],[8,null],[8,null],[2,u.NG_VALUE_ACCESSOR]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,u.NgControl,null,[u.NgModel]),t.ɵdid(21,16384,null,0,u.NgControlStatus,[u.NgControl],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(24,0,null,null,12,"div",[["class","form-group"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(26,0,null,null,2,"label",[["for","email"]],null,null,null,null,null)),(n()(),t.ɵted(27,null,["",""])),t.ɵppd(28,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(30,0,null,null,5,"input",[["class","form-control"],["id","email"],["name","Email"],["readonly",""],["type","text"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(n,l,e){var u=!0,o=n.component;"input"===l&&(u=!1!==t.ɵnov(n,31)._handleInput(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,31).onTouched()&&u);"compositionstart"===l&&(u=!1!==t.ɵnov(n,31)._compositionStart()&&u);"compositionend"===l&&(u=!1!==t.ɵnov(n,31)._compositionEnd(e.target.value)&&u);"ngModelChange"===l&&(u=!1!==(o.profile.email=e)&&u);return u},null,null)),t.ɵdid(31,16384,null,0,u.DefaultValueAccessor,[t.Renderer2,t.ElementRef,[2,u.COMPOSITION_BUFFER_MODE]],null,null),t.ɵprd(1024,null,u.NG_VALUE_ACCESSOR,function(n){return[n]},[u.DefaultValueAccessor]),t.ɵdid(33,671744,null,0,u.NgModel,[[2,u.ControlContainer],[8,null],[8,null],[2,u.NG_VALUE_ACCESSOR]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,u.NgControl,null,[u.NgModel]),t.ɵdid(35,16384,null,0,u.NgControlStatus,[u.NgControl],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(38,0,null,null,12,"div",[["class","form-group"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(40,0,null,null,2,"label",[["for","masterPasswordHint"]],null,null,null,null,null)),(n()(),t.ɵted(41,null,["",""])),t.ɵppd(42,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(44,0,null,null,5,"input",[["class","form-control"],["id","masterPasswordHint"],["name","MasterPasswordHint"],["type","text"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(n,l,e){var u=!0,o=n.component;"input"===l&&(u=!1!==t.ɵnov(n,45)._handleInput(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,45).onTouched()&&u);"compositionstart"===l&&(u=!1!==t.ɵnov(n,45)._compositionStart()&&u);"compositionend"===l&&(u=!1!==t.ɵnov(n,45)._compositionEnd(e.target.value)&&u);"ngModelChange"===l&&(u=!1!==(o.profile.masterPasswordHint=e)&&u);return u},null,null)),t.ɵdid(45,16384,null,0,u.DefaultValueAccessor,[t.Renderer2,t.ElementRef,[2,u.COMPOSITION_BUFFER_MODE]],null,null),t.ɵprd(1024,null,u.NG_VALUE_ACCESSOR,function(n){return[n]},[u.DefaultValueAccessor]),t.ɵdid(47,671744,null,0,u.NgModel,[[2,u.ControlContainer],[8,null],[8,null],[2,u.NG_VALUE_ACCESSOR]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,u.NgControl,null,[u.NgModel]),t.ɵdid(49,16384,null,0,u.NgControlStatus,[u.NgControl],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(53,0,null,null,4,"div",[["class","col-6"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(55,0,null,null,1,"app-avatar",[["dynamic","true"],["fontSize","35"],["height","75"],["width","75"]],null,null,null,r.View_AvatarComponent_0,r.RenderType_AvatarComponent)),t.ɵdid(56,638976,null,0,a.AvatarComponent,[s.DomSanitizer],{data:[0,"data"],width:[1,"width"],height:[2,"height"],fontSize:[3,"fontSize"],dynamic:[4,"dynamic"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(60,0,null,null,8,"button",[["class","btn btn-primary btn-submit"],["type","submit"]],[[8,"disabled",0]],null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(62,0,null,null,1,"i",[["class","fa fa-spinner fa-spin"]],[[8,"title",0]],null,null,null,null)),t.ɵppd(63,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(65,0,null,null,2,"span",[],null,null,null,null,null)),(n()(),t.ɵted(66,null,["",""])),t.ɵppd(67,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){var e=l.component;n(l,4,0,e.formPromise);n(l,19,0,"Name",e.profile.name);n(l,33,0,"Email",e.profile.email);n(l,47,0,"MasterPasswordHint",e.profile.masterPasswordHint);n(l,56,0,t.ɵinlineInterpolate(1,"",e.profile.name||e.profile.email,""),"75","75","35","true")},function(n,l){n(l,0,0,t.ɵnov(l,3).ngClassUntouched,t.ɵnov(l,3).ngClassTouched,t.ɵnov(l,3).ngClassPristine,t.ɵnov(l,3).ngClassDirty,t.ɵnov(l,3).ngClassValid,t.ɵnov(l,3).ngClassInvalid,t.ɵnov(l,3).ngClassPending),n(l,13,0,t.ɵunv(l,13,0,n(l,14,0,t.ɵnov(l.parent,0),"name"))),n(l,16,0,t.ɵnov(l,21).ngClassUntouched,t.ɵnov(l,21).ngClassTouched,t.ɵnov(l,21).ngClassPristine,t.ɵnov(l,21).ngClassDirty,t.ɵnov(l,21).ngClassValid,t.ɵnov(l,21).ngClassInvalid,t.ɵnov(l,21).ngClassPending),n(l,27,0,t.ɵunv(l,27,0,n(l,28,0,t.ɵnov(l.parent,0),"email"))),n(l,30,0,t.ɵnov(l,35).ngClassUntouched,t.ɵnov(l,35).ngClassTouched,t.ɵnov(l,35).ngClassPristine,t.ɵnov(l,35).ngClassDirty,t.ɵnov(l,35).ngClassValid,t.ɵnov(l,35).ngClassInvalid,t.ɵnov(l,35).ngClassPending),n(l,41,0,t.ɵunv(l,41,0,n(l,42,0,t.ɵnov(l.parent,0),"masterPassHintLabel"))),n(l,44,0,t.ɵnov(l,49).ngClassUntouched,t.ɵnov(l,49).ngClassTouched,t.ɵnov(l,49).ngClassPristine,t.ɵnov(l,49).ngClassDirty,t.ɵnov(l,49).ngClassValid,t.ɵnov(l,49).ngClassInvalid,t.ɵnov(l,49).ngClassPending),n(l,60,0,t.ɵnov(l,0).loading),n(l,62,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,62,0,n(l,63,0,t.ɵnov(l.parent,0),"loading")),"")),n(l,66,0,t.ɵunv(l,66,0,n(l,67,0,t.ɵnov(l.parent,0),"save")))})}function b(n){return t.ɵvid(0,[t.ɵpid(0,d.I18nPipe,[c.I18nService]),(n()(),t.ɵand(16777216,null,null,1,null,y)),t.ɵdid(2,16384,null,0,p.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,null,null,1,null,C)),t.ɵdid(5,16384,null,0,p.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){var e=l.component;n(l,2,0,e.loading),n(l,5,0,e.profile&&!e.loading)},null)}function S(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"app-profile",[],null,null,null,b,m)),t.ɵdid(1,114688,null,0,f.ProfileComponent,[v.ApiService,c.I18nService,h.Angulartics2,g.ToasterService],null,null)],function(n,l){n(l,1,0)},null)}l.RenderType_ProfileComponent=m,l.View_ProfileComponent_0=b,l.View_ProfileComponent_Host_0=S;var w=t.ɵccf("app-profile",f.ProfileComponent,S,{},{},[]);l.ProfileComponentNgFactory=w},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=e(0),u=e(7),o=e(2),i=e(796),r=e(556),a=e(4),s=e(3),d=e(9),c=e(794),p=e(555),f=e(20),v=e(27),h=e(792),g=e(553),m=e(21),y=e(273),C=t.ɵcrt({encapsulation:2,styles:[],data:{}});function b(n){return t.ɵvid(0,[(n()(),t.ɵand(0,null,null,0))],null,null)}function S(n){return t.ɵvid(0,[(n()(),t.ɵand(0,null,null,0))],null,null)}function w(n){return t.ɵvid(0,[(n()(),t.ɵand(0,null,null,0))],null,null)}function R(n){return t.ɵvid(0,[t.ɵpid(0,u.I18nPipe,[o.I18nService]),t.ɵqud(402653184,1,{deauthModalRef:0}),t.ɵqud(402653184,2,{purgeModalRef:0}),t.ɵqud(402653184,3,{deleteModalRef:0}),(n()(),t.ɵeld(4,0,null,null,5,"div",[["class","page-header"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(6,0,null,null,2,"h1",[],null,null,null,null,null)),(n()(),t.ɵted(7,null,["",""])),t.ɵppd(8,1),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵeld(11,0,null,null,1,"app-profile",[],null,null,null,i.View_ProfileComponent_0,i.RenderType_ProfileComponent)),t.ɵdid(12,114688,null,0,r.ProfileComponent,[a.ApiService,o.I18nService,s.Angulartics2,d.ToasterService],null,null),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵeld(14,0,null,null,5,"div",[["class","secondary-header"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(16,0,null,null,2,"h1",[],null,null,null,null,null)),(n()(),t.ɵted(17,null,["",""])),t.ɵppd(18,1),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵeld(21,0,null,null,1,"app-change-email",[],null,null,null,c.View_ChangeEmailComponent_0,c.RenderType_ChangeEmailComponent)),t.ɵdid(22,49152,null,0,p.ChangeEmailComponent,[a.ApiService,o.I18nService,s.Angulartics2,d.ToasterService,f.CryptoService,v.MessagingService],null,null),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵeld(24,0,null,null,5,"div",[["class","secondary-header"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(26,0,null,null,2,"h1",[],null,null,null,null,null)),(n()(),t.ɵted(27,null,["",""])),t.ɵppd(28,1),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵeld(31,0,null,null,1,"app-change-password",[],null,null,null,h.View_ChangePasswordComponent_0,h.RenderType_ChangePasswordComponent)),t.ɵdid(32,49152,null,0,g.ChangePasswordComponent,[a.ApiService,o.I18nService,s.Angulartics2,d.ToasterService,f.CryptoService,v.MessagingService,m.UserService],null,null),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵeld(34,0,null,null,5,"div",[["class","secondary-header text-danger border-0 mb-0"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(36,0,null,null,2,"h1",[],null,null,null,null,null)),(n()(),t.ɵted(37,null,["",""])),t.ɵppd(38,1),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵeld(41,0,null,null,20,"div",[["class","card border-danger"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(43,0,null,null,17,"div",[["class","card-body"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(45,0,null,null,2,"p",[],null,null,null,null,null)),(n()(),t.ɵted(46,null,["",""])),t.ɵppd(47,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(49,0,null,null,2,"button",[["class","btn btn-outline-danger"],["type","button"]],null,[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.deauthorizeSessions()&&t);return t},null,null)),(n()(),t.ɵted(50,null,["",""])),t.ɵppd(51,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(53,0,null,null,2,"button",[["class","btn btn-outline-danger"],["type","button"]],null,[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.purgeVault()&&t);return t},null,null)),(n()(),t.ɵted(54,null,["",""])),t.ɵppd(55,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(57,0,null,null,2,"button",[["class","btn btn-outline-danger"],["type","button"]],null,[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.deleteAccount()&&t);return t},null,null)),(n()(),t.ɵted(58,null,["",""])),t.ɵppd(59,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,[[1,3],["deauthorizeSessionsTemplate",2]],null,0,null,b)),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,[[2,3],["purgeVaultTemplate",2]],null,0,null,S)),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,[[3,3],["deleteAccountTemplate",2]],null,0,null,w)),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){n(l,12,0)},function(n,l){n(l,7,0,t.ɵunv(l,7,0,n(l,8,0,t.ɵnov(l,0),"myAccount"))),n(l,17,0,t.ɵunv(l,17,0,n(l,18,0,t.ɵnov(l,0),"changeEmail"))),n(l,27,0,t.ɵunv(l,27,0,n(l,28,0,t.ɵnov(l,0),"changeMasterPassword"))),n(l,37,0,t.ɵunv(l,37,0,n(l,38,0,t.ɵnov(l,0),"dangerZone"))),n(l,46,0,t.ɵunv(l,46,0,n(l,47,0,t.ɵnov(l,0),"dangerZoneDesc"))),n(l,50,0,t.ɵunv(l,50,0,n(l,51,0,t.ɵnov(l,0),"deauthorizeSessions"))),n(l,54,0,t.ɵunv(l,54,0,n(l,55,0,t.ɵnov(l,0),"purgeVault"))),n(l,58,0,t.ɵunv(l,58,0,n(l,59,0,t.ɵnov(l,0),"deleteAccount")))})}function _(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"app-account",[],null,null,null,R,C)),t.ɵdid(1,49152,null,0,y.AccountComponent,[t.ComponentFactoryResolver],null,null)],null,null)}l.RenderType_AccountComponent=C,l.View_AccountComponent_0=R,l.View_AccountComponent_Host_0=_;var I=t.ɵccf("app-account",y.AccountComponent,_,{},{},[]);l.AccountComponentNgFactory=I},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=e(0),u=e(10),o=e(5),i=e(7),r=e(2),a=e(274),s=e(35),d=e(160),c=t.ɵcrt({encapsulation:2,styles:[],data:{}});function p(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,6,"a",[["class","list-group-item"],["routerLink","billing"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(n,l,e){var u=!0;"click"===l&&(u=!1!==t.ɵnov(n,1).onClick(e.button,e.ctrlKey,e.metaKey,e.shiftKey)&&u);return u},null,null)),t.ɵdid(1,671744,[[8,4]],0,u.RouterLinkWithHref,[u.Router,u.ActivatedRoute,o.LocationStrategy],{routerLink:[0,"routerLink"]},null),t.ɵdid(2,1720320,null,2,u.RouterLinkActive,[u.Router,t.ElementRef,t.Renderer2,t.ChangeDetectorRef],{routerLinkActive:[0,"routerLinkActive"]},null),t.ɵqud(603979776,7,{links:1}),t.ɵqud(603979776,8,{linksWithHrefs:1}),(n()(),t.ɵted(5,null,["\n ","\n "])),t.ɵppd(6,1)],function(n,l){n(l,1,0,"billing");n(l,2,0,"active")},function(n,l){n(l,0,0,t.ɵnov(l,1).target,t.ɵnov(l,1).href),n(l,5,0,t.ɵunv(l,5,0,n(l,6,0,t.ɵnov(l.parent,0),"billingAndLicensing")))})}function f(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,6,"a",[["class","list-group-item"],["routerLink","premium"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(n,l,e){var u=!0;"click"===l&&(u=!1!==t.ɵnov(n,1).onClick(e.button,e.ctrlKey,e.metaKey,e.shiftKey)&&u);return u},null,null)),t.ɵdid(1,671744,[[10,4]],0,u.RouterLinkWithHref,[u.Router,u.ActivatedRoute,o.LocationStrategy],{routerLink:[0,"routerLink"]},null),t.ɵdid(2,1720320,null,2,u.RouterLinkActive,[u.Router,t.ElementRef,t.Renderer2,t.ChangeDetectorRef],{routerLinkActive:[0,"routerLinkActive"]},null),t.ɵqud(603979776,9,{links:1}),t.ɵqud(603979776,10,{linksWithHrefs:1}),(n()(),t.ɵted(5,null,["\n ","\n "])),t.ɵppd(6,1)],function(n,l){n(l,1,0,"premium");n(l,2,0,"active")},function(n,l){n(l,0,0,t.ɵnov(l,1).target,t.ɵnov(l,1).href),n(l,5,0,t.ɵunv(l,5,0,n(l,6,0,t.ɵnov(l.parent,0),"goPremium")))})}function v(n){return t.ɵvid(0,[t.ɵpid(0,i.I18nPipe,[r.I18nService]),(n()(),t.ɵeld(1,0,null,null,69,"div",[["class","container page-content"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(3,0,null,null,66,"div",[["class","row"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(5,0,null,null,57,"div",[["class","col-3"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(7,0,null,null,54,"div",[["class","card"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(9,0,null,null,2,"div",[["class","card-header"]],null,null,null,null,null)),(n()(),t.ɵted(10,null,["",""])),t.ɵppd(11,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(13,0,null,null,47,"div",[["class","list-group list-group-flush"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(15,0,null,null,6,"a",[["class","list-group-item"],["routerLink","account"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(n,l,e){var u=!0;"click"===l&&(u=!1!==t.ɵnov(n,16).onClick(e.button,e.ctrlKey,e.metaKey,e.shiftKey)&&u);return u},null,null)),t.ɵdid(16,671744,[[2,4]],0,u.RouterLinkWithHref,[u.Router,u.ActivatedRoute,o.LocationStrategy],{routerLink:[0,"routerLink"]},null),t.ɵdid(17,1720320,null,2,u.RouterLinkActive,[u.Router,t.ElementRef,t.Renderer2,t.ChangeDetectorRef],{routerLinkActive:[0,"routerLinkActive"]},null),t.ɵqud(603979776,1,{links:1}),t.ɵqud(603979776,2,{linksWithHrefs:1}),(n()(),t.ɵted(20,null,["\n ","\n "])),t.ɵppd(21,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(23,0,null,null,6,"a",[["class","list-group-item"],["routerLink","options"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(n,l,e){var u=!0;"click"===l&&(u=!1!==t.ɵnov(n,24).onClick(e.button,e.ctrlKey,e.metaKey,e.shiftKey)&&u);return u},null,null)),t.ɵdid(24,671744,[[4,4]],0,u.RouterLinkWithHref,[u.Router,u.ActivatedRoute,o.LocationStrategy],{routerLink:[0,"routerLink"]},null),t.ɵdid(25,1720320,null,2,u.RouterLinkActive,[u.Router,t.ElementRef,t.Renderer2,t.ChangeDetectorRef],{routerLinkActive:[0,"routerLinkActive"]},null),t.ɵqud(603979776,3,{links:1}),t.ɵqud(603979776,4,{linksWithHrefs:1}),(n()(),t.ɵted(28,null,["\n ","\n "])),t.ɵppd(29,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(31,0,null,null,6,"a",[["class","list-group-item"],["routerLink","organizations"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(n,l,e){var u=!0;"click"===l&&(u=!1!==t.ɵnov(n,32).onClick(e.button,e.ctrlKey,e.metaKey,e.shiftKey)&&u);return u},null,null)),t.ɵdid(32,671744,[[6,4]],0,u.RouterLinkWithHref,[u.Router,u.ActivatedRoute,o.LocationStrategy],{routerLink:[0,"routerLink"]},null),t.ɵdid(33,1720320,null,2,u.RouterLinkActive,[u.Router,t.ElementRef,t.Renderer2,t.ChangeDetectorRef],{routerLinkActive:[0,"routerLinkActive"]},null),t.ɵqud(603979776,5,{links:1}),t.ɵqud(603979776,6,{linksWithHrefs:1}),(n()(),t.ɵted(36,null,["\n ","\n "])),t.ɵppd(37,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,p)),t.ɵdid(40,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,f)),t.ɵdid(43,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(45,0,null,null,6,"a",[["class","list-group-item"],["routerLink","two-factor"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(n,l,e){var u=!0;"click"===l&&(u=!1!==t.ɵnov(n,46).onClick(e.button,e.ctrlKey,e.metaKey,e.shiftKey)&&u);return u},null,null)),t.ɵdid(46,671744,[[12,4]],0,u.RouterLinkWithHref,[u.Router,u.ActivatedRoute,o.LocationStrategy],{routerLink:[0,"routerLink"]},null),t.ɵdid(47,1720320,null,2,u.RouterLinkActive,[u.Router,t.ElementRef,t.Renderer2,t.ChangeDetectorRef],{routerLinkActive:[0,"routerLinkActive"]},null),t.ɵqud(603979776,11,{links:1}),t.ɵqud(603979776,12,{linksWithHrefs:1}),(n()(),t.ɵted(50,null,["\n ","\n "])),t.ɵppd(51,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(53,0,null,null,6,"a",[["class","list-group-item"],["routerLink","domain-rules"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(n,l,e){var u=!0;"click"===l&&(u=!1!==t.ɵnov(n,54).onClick(e.button,e.ctrlKey,e.metaKey,e.shiftKey)&&u);return u},null,null)),t.ɵdid(54,671744,[[14,4]],0,u.RouterLinkWithHref,[u.Router,u.ActivatedRoute,o.LocationStrategy],{routerLink:[0,"routerLink"]},null),t.ɵdid(55,1720320,null,2,u.RouterLinkActive,[u.Router,t.ElementRef,t.Renderer2,t.ChangeDetectorRef],{routerLinkActive:[0,"routerLinkActive"]},null),t.ɵqud(603979776,13,{links:1}),t.ɵqud(603979776,14,{linksWithHrefs:1}),(n()(),t.ɵted(58,null,["\n ","\n "])),t.ɵppd(59,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(64,0,null,null,4,"div",[["class","col-9"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(66,16777216,null,null,1,"router-outlet",[],null,null,null,null,null)),t.ɵdid(67,212992,null,0,u.RouterOutlet,[u.ChildrenOutletContexts,t.ViewContainerRef,t.ComponentFactoryResolver,[8,null],t.ChangeDetectorRef],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){var e=l.component;n(l,16,0,"account");n(l,17,0,"active");n(l,24,0,"options");n(l,25,0,"active");n(l,32,0,"organizations");n(l,33,0,"active"),n(l,40,0,e.premium),n(l,43,0,!e.premium);n(l,46,0,"two-factor");n(l,47,0,"active");n(l,54,0,"domain-rules");n(l,55,0,"active"),n(l,67,0)},function(n,l){n(l,10,0,t.ɵunv(l,10,0,n(l,11,0,t.ɵnov(l,0),"settings"))),n(l,15,0,t.ɵnov(l,16).target,t.ɵnov(l,16).href),n(l,20,0,t.ɵunv(l,20,0,n(l,21,0,t.ɵnov(l,0),"myAccount"))),n(l,23,0,t.ɵnov(l,24).target,t.ɵnov(l,24).href),n(l,28,0,t.ɵunv(l,28,0,n(l,29,0,t.ɵnov(l,0),"options"))),n(l,31,0,t.ɵnov(l,32).target,t.ɵnov(l,32).href),n(l,36,0,t.ɵunv(l,36,0,n(l,37,0,t.ɵnov(l,0),"organizations"))),n(l,45,0,t.ɵnov(l,46).target,t.ɵnov(l,46).href),n(l,50,0,t.ɵunv(l,50,0,n(l,51,0,t.ɵnov(l,0),"twoStepLogin"))),n(l,53,0,t.ɵnov(l,54).target,t.ɵnov(l,54).href),n(l,58,0,t.ɵunv(l,58,0,n(l,59,0,t.ɵnov(l,0),"domainRules")))})}function h(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"app-settings",[],null,null,null,v,c)),t.ɵdid(1,245760,null,0,a.SettingsComponent,[s.TokenService,d.BroadcasterService,t.NgZone],null,null)],function(n,l){n(l,1,0)},null)}l.RenderType_SettingsComponent=c,l.View_SettingsComponent_0=v,l.View_SettingsComponent_Host_0=h;var g=t.ɵccf("app-settings",a.SettingsComponent,h,{},{},[]);l.SettingsComponentNgFactory=g},function(n,l,e){"use strict";var t=this&&this.__awaiter||function(n,l,e,t){return new(e||(e=Promise))(function(u,o){function i(n){try{a(t.next(n))}catch(n){o(n)}}function r(n){try{a(t.throw(n))}catch(n){o(n)}}function a(n){n.done?u(n.value):new e(function(l){l(n.value)}).then(i,r)}a((t=t.apply(n,l||[])).next())})},u=this&&this.__generator||function(n,l){var e,t,u,o,i={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return o={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function r(o){return function(r){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;i;)try{if(e=1,t&&(u=t[2&o[0]?"return":o[0]?"throw":"next"])&&!(u=u.call(t,o[1])).done)return u;switch(t=0,u&&(o=[0,u.value]),o[0]){case 0:case 1:u=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,t=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(u=(u=i.trys).length>0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]104857600)return this.toasterService.popAsync("error",this.i18nService.t("errorOccurred"),this.i18nService.t("maxFileSize")),[2];u.label=1;case 1:return u.trys.push([1,4,,5]),this.formPromise=this.saveCipherAttachment(l[0]),e=this,[4,this.formPromise];case 2:return e.cipherDomain=u.sent(),t=this,[4,this.cipherDomain.decrypt()];case 3:return t.cipher=u.sent(),this.analytics.eventTrack.next({action:"Added Attachment"}),this.toasterService.popAsync("success",null,this.i18nService.t("attachmentSaved")),this.onUploadedAttachment.emit(),[3,5];case 4:return u.sent(),[3,5];case 5:return n.type="",n.type="file",n.value="",[2]}})})},n.prototype.delete=function(n){return t(this,void 0,void 0,function(){var l;return u(this,function(e){switch(e.label){case 0:return null!=this.deletePromises[n.id]?[2]:[4,this.platformUtilsService.showDialog(this.i18nService.t("deleteAttachmentConfirmation"),this.i18nService.t("deleteAttachment"),this.i18nService.t("yes"),this.i18nService.t("no"),"warning")];case 1:if(!e.sent())return[2];e.label=2;case 2:return e.trys.push([2,4,,5]),this.deletePromises[n.id]=this.deleteCipherAttachment(n.id),[4,this.deletePromises[n.id]];case 3:return e.sent(),this.analytics.eventTrack.next({action:"Deleted Attachment"}),this.toasterService.popAsync("success",null,this.i18nService.t("deletedAttachment")),(l=this.cipher.attachments.indexOf(n))>-1&&this.cipher.attachments.splice(l,1),[3,5];case 4:return e.sent(),[3,5];case 5:return this.deletePromises[n.id]=null,this.onDeletedAttachment.emit(),[2]}})})},n.prototype.download=function(n){return t(this,void 0,void 0,function(){var l,e,t,o,i;return u(this,function(u){switch(u.label){case 0:return(l=n).downloading?[2]:this.canAccessAttachments?(l.downloading=!0,[4,fetch(new Request(n.url,{cache:"no-cache"}))]):(this.toasterService.popAsync("error",this.i18nService.t("premiumRequired"),this.i18nService.t("premiumRequiredDesc")),[2]);case 1:if(200!==(e=u.sent()).status)return this.toasterService.popAsync("error",null,this.i18nService.t("errorOccurred")),l.downloading=!1,[2];u.label=2;case 2:return u.trys.push([2,6,,7]),[4,e.arrayBuffer()];case 3:return t=u.sent(),[4,this.cryptoService.getOrgKey(this.cipher.organizationId)];case 4:return o=u.sent(),[4,this.cryptoService.decryptFromBytes(t,o)];case 5:return i=u.sent(),this.platformUtilsService.saveFile(this.win,i,null,n.fileName),[3,7];case 6:return u.sent(),this.toasterService.popAsync("error",null,this.i18nService.t("errorOccurred")),[3,7];case 7:return l.downloading=!1,[2]}})})},n.prototype.loadCipher=function(){return this.cipherService.get(this.cipherId)},n.prototype.saveCipherAttachment=function(n){return this.cipherService.saveAttachmentWithServer(this.cipherDomain,n)},n.prototype.deleteCipherAttachment=function(n){return this.cipherService.deleteAttachmentWithServer(this.cipher.id,n)},n}();l.AttachmentsComponent=i},function(n,l,e){"use strict";var t=this&&this.__awaiter||function(n,l,e,t){return new(e||(e=Promise))(function(u,o){function i(n){try{a(t.next(n))}catch(n){o(n)}}function r(n){try{a(t.throw(n))}catch(n){o(n)}}function a(n){n.done?u(n.value):new e(function(l){l(n.value)}).then(i,r)}a((t=t.apply(n,l||[])).next())})},u=this&&this.__generator||function(n,l){var e,t,u,o,i={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return o={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function r(o){return function(r){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;i;)try{if(e=1,t&&(u=t[2&o[0]?"return":o[0]?"throw":"next"])&&!(u=u.call(t,o[1])).done)return u;switch(t=0,u&&(o=[0,u.value]),o[0]){case 0:case 1:u=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,t=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(u=(u=i.trys).length>0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]-1&&this.cipher.login.uris.splice(l,1)}},n.prototype.addField=function(){null==this.cipher.fields&&(this.cipher.fields=[]);var n=new p.FieldView;n.type=this.addFieldType,this.cipher.fields.push(n)},n.prototype.removeField=function(n){var l=this.cipher.fields.indexOf(n);l>-1&&this.cipher.fields.splice(l,1)},n.prototype.cancel=function(){this.onCancelled.emit(this.cipher)},n.prototype.attachments=function(){this.onEditAttachments.emit(this.cipher)},n.prototype.delete=function(){return t(this,void 0,void 0,function(){return u(this,function(n){switch(n.label){case 0:return[4,this.platformUtilsService.showDialog(this.i18nService.t("deleteItemConfirmation"),this.i18nService.t("deleteItem"),this.i18nService.t("yes"),this.i18nService.t("no"),"warning")];case 1:if(!n.sent())return[2,!1];n.label=2;case 2:return n.trys.push([2,4,,5]),this.deletePromise=this.deleteCipher(),[4,this.deletePromise];case 3:return n.sent(),this.analytics.eventTrack.next({action:"Deleted Cipher"}),this.toasterService.popAsync("success",null,this.i18nService.t("deletedItem")),this.onDeletedCipher.emit(this.cipher),[3,5];case 4:return n.sent(),[3,5];case 5:return[2,!0]}})})},n.prototype.generatePassword=function(){return t(this,void 0,void 0,function(){return u(this,function(n){switch(n.label){case 0:return null!=this.cipher.login&&null!=this.cipher.login.password&&this.cipher.login.password.length?[4,this.platformUtilsService.showDialog(this.i18nService.t("overwritePasswordConfirmation"),this.i18nService.t("overwritePassword"),this.i18nService.t("yes"),this.i18nService.t("no"))]:[3,2];case 1:if(!n.sent())return[2,!1];n.label=2;case 2:return this.onGeneratePassword.emit(),[2,!0]}})})},n.prototype.togglePassword=function(){this.analytics.eventTrack.next({action:"Toggled Password on Edit"}),this.showPassword=!this.showPassword,document.getElementById("loginPassword").focus()},n.prototype.toggleCardCode=function(){this.analytics.eventTrack.next({action:"Toggled CardCode on Edit"}),this.showCardCode=!this.showCardCode,document.getElementById("cardCode").focus()},n.prototype.toggleFieldValue=function(n){var l=n;l.showValue=!l.showValue},n.prototype.toggleUriOptions=function(n){var l=n;l.showOptions=(null!=l.showOptions||null==n.match)&&!l.showOptions},n.prototype.loginUriMatchChanged=function(n){var l=n;l.showOptions=null==l.showOptions||l.showOptions},n.prototype.checkPassword=function(){return t(this,void 0,void 0,function(){var n;return u(this,function(l){switch(l.label){case 0:return null!=this.checkPasswordPromise?[2]:null==this.cipher.login||null==this.cipher.login.password||""===this.cipher.login.password?[2]:(this.analytics.eventTrack.next({action:"Check Password"}),this.checkPasswordPromise=this.auditService.passwordLeaked(this.cipher.login.password),[4,this.checkPasswordPromise]);case 1:return n=l.sent(),this.checkPasswordPromise=null,n>0?this.toasterService.popAsync("warning",null,this.i18nService.t("passwordExposed",n.toString())):this.toasterService.popAsync("success",null,this.i18nService.t("passwordSafe")),[2]}})})},n.prototype.loadCipher=function(){return this.cipherService.get(this.cipherId)},n.prototype.encryptCipher=function(){return this.cipherService.encrypt(this.cipher)},n.prototype.saveCipher=function(n){return this.cipherService.saveWithServer(n)},n.prototype.deleteCipher=function(){return this.cipherService.deleteWithServer(this.cipher.id)},n}();l.AddEditComponent=m},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(){this.ciphers=[],this.folders=[]}}();l.UpdateKeyRequest=t},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)});Object.defineProperty(l,"__esModule",{value:!0});var o=function(n){function l(l){var e=n.call(this,l)||this;return e.id=l.id,e}return u(l,n),l}(e(278).FolderRequest);l.FolderWithIdRequest=o},function(n,l,e){"use strict";var t=this&&this.__awaiter||function(n,l,e,t){return new(e||(e=Promise))(function(u,o){function i(n){try{a(t.next(n))}catch(n){o(n)}}function r(n){try{a(t.throw(n))}catch(n){o(n)}}function a(n){n.done?u(n.value):new e(function(l){l(n.value)}).then(i,r)}a((t=t.apply(n,l||[])).next())})},u=this&&this.__generator||function(n,l){var e,t,u,o,i={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return o={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function r(o){return function(r){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;i;)try{if(e=1,t&&(u=t[2&o[0]?"return":o[0]?"throw":"next"])&&!(u=u.call(t,o[1])).done)return u;switch(t=0,u&&(o=[0,u.value]),o[0]){case 0:case 1:u=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,t=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(u=(u=i.trys).length>0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0),n(l,6,0,0===l.context.ngIf.length)},null)}function x(n){return t.ɵvid(0,[t.ɵpid(0,p.SearchCiphersPipe,[f.PlatformUtilsService]),t.ɵpid(0,v.I18nPipe,[h.I18nService]),(n()(),t.ɵand(16777216,null,null,2,null,M)),t.ɵdid(3,16384,null,0,r.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),t.ɵppd(4,2),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){var e=l.component;n(l,3,0,t.ɵunv(l,3,0,n(l,4,0,t.ɵnov(l,0),e.ciphers,e.searchText)))},null)}function D(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"app-vault-ciphers",[],null,null,null,x,b)),t.ɵdid(1,49152,null,0,g.CiphersComponent,[m.CipherService,y.Angulartics2,C.ToasterService,h.I18nService,f.PlatformUtilsService],null,null)],null,null)}l.RenderType_CiphersComponent=b,l.View_CiphersComponent_0=x,l.View_CiphersComponent_Host_0=D;var U=t.ɵccf("app-vault-ciphers",g.CiphersComponent,D,{activeCipherId:"activeCipherId",showAddNew:"showAddNew"},{onCipherClicked:"onCipherClicked",onCipherRightClicked:"onCipherRightClicked",onAddCipher:"onAddCipher",onAddCipherOptions:"onAddCipherOptions",onAttachmentsClicked:"onAttachmentsClicked",onShareClicked:"onShareClicked",onCollectionsClicked:"onCollectionsClicked"},[]);l.CiphersComponentNgFactory=U},function(n,l,e){"use strict";var t=this&&this.__awaiter||function(n,l,e,t){return new(e||(e=Promise))(function(u,o){function i(n){try{a(t.next(n))}catch(n){o(n)}}function r(n){try{a(t.throw(n))}catch(n){o(n)}}function a(n){n.done?u(n.value):new e(function(l){l(n.value)}).then(i,r)}a((t=t.apply(n,l||[])).next())})},u=this&&this.__generator||function(n,l){var e,t,u,o,i={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return o={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function r(o){return function(r){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;i;)try{if(e=1,t&&(u=t[2&o[0]?"return":o[0]?"throw":"next"])&&!(u=u.call(t,o[1])).done)return u;switch(t=0,u&&(o=[0,u.value]),o[0]){case 0:case 1:u=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,t=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(u=(u=i.trys).length>0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&this.u2f.init({appId:l[0].appId,challenge:l[0].challenge,keys:[{version:l[0].version,keyHandle:l[0].keyHandle}]}),[3,7]):[3,7];case 2:return this.platformUtilsService.getDevice()===o.DeviceType.SafariExtension?[3,7]:(setTimeout(function(){s.init({iframe:void 0,host:n.Host,sig_request:n.Signature,submit_callback:function(n){return t(e,void 0,void 0,function(){var l;return u(this,function(e){switch(e.label){case 0:return null==(l=n.querySelector('input[name="sig_response"]'))?[3,2]:(this.token=l.value,[4,this.submit()]);case 1:e.sent(),e.label=2;case 2:return[2]}})})}})},0),[3,7]);case 3:return this.twoFactorEmail=n.Email,this.authService.twoFactorProviders.size>1?[4,this.sendEmail(!1)]:[3,5];case 4:r.sent(),r.label=5;case 5:case 6:return[3,7];case 7:return[2]}})})},n.prototype.submit=function(){return t(this,void 0,void 0,function(){var n;return u(this,function(l){switch(l.label){case 0:if(null==this.token||""===this.token)return this.toasterService.popAsync("error",this.i18nService.t("errorOccurred"),this.i18nService.t("verificationCodeRequired")),[2];if(this.selectedProviderType===i.TwoFactorProviderType.U2f){if(null==this.u2f)return[2];this.u2f.stop()}else this.selectedProviderType!==i.TwoFactorProviderType.Email&&this.selectedProviderType!==i.TwoFactorProviderType.Authenticator||(this.token=this.token.replace(" ","").trim());l.label=1;case 1:return l.trys.push([1,3,,4]),this.formPromise=this.authService.logInTwoFactor(this.selectedProviderType,this.token,this.remember),[4,this.formPromise];case 2:return l.sent(),null!=this.onSuccessfulLogin&&this.onSuccessfulLogin(),this.analytics.eventTrack.next({action:"Logged In From Two-step"}),null!=this.onSuccessfulLoginNavigate?this.onSuccessfulLoginNavigate():this.router.navigate([this.successRoute]),[3,4];case 3:if(n=l.sent(),this.selectedProviderType!==i.TwoFactorProviderType.U2f||null==this.u2f)throw n;return this.u2f.start(),[3,4];case 4:return[2]}})})},n.prototype.sendEmail=function(n){return t(this,void 0,void 0,function(){var l;return u(this,function(e){switch(e.label){case 0:if(this.selectedProviderType!==i.TwoFactorProviderType.Email)return[2];if(null!=this.emailPromise)return[2];e.label=1;case 1:return e.trys.push([1,3,,4]),l=new r.TwoFactorEmailRequest(this.authService.email,this.authService.masterPasswordHash),this.emailPromise=this.apiService.postTwoFactorEmail(l),[4,this.emailPromise];case 2:return e.sent(),n&&this.toasterService.popAsync("success",null,this.i18nService.t("verificationCodeEmailSent",this.twoFactorEmail)),[3,4];case 3:return e.sent(),[3,4];case 4:return this.emailPromise=null,[2]}})})},n.prototype.cleanupU2f=function(){null!=this.u2f&&(this.u2f.stop(),this.u2f.cleanup())},n}();l.TwoFactorComponent=c},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=e(0),u=function(){function n(n){this.componentFactoryResolver=n,this.onClose=new t.EventEmitter,this.onClosed=new t.EventEmitter,this.onShow=new t.EventEmitter,this.onShown=new t.EventEmitter,this.parentContainer=null,this.fade=!0}return n.prototype.ngOnDestroy=function(){document.body.classList.remove("modal-open"),document.body.removeChild(document.querySelector(".modal-backdrop"))},n.prototype.show=function(n,l,e){var t=this;void 0===e&&(e=!0),this.onShow.emit(),this.parentContainer=l,this.fade=e,document.body.classList.add("modal-open");var u=document.createElement("div");u.className="modal-backdrop"+(this.fade?" fade":""),document.body.appendChild(u);var o=this.componentFactoryResolver.resolveComponentFactory(n),i=this.container.createComponent(o);document.querySelector(".modal-dialog").addEventListener("click",function(n){n.stopPropagation()});for(var r=0,a=Array.from(document.querySelectorAll('.modal, .modal *[data-dismiss="modal"]'));r0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1] string;\r\n translate: (id: string, p1?: string, p2?: string, p3?: string) => string;\r\n}\r\n","import { EnvironmentUrls } from '../models/domain/environmentUrls';\r\n\r\nimport { CipherBulkDeleteRequest } from '../models/request/cipherBulkDeleteRequest';\r\nimport { CipherBulkMoveRequest } from '../models/request/cipherBulkMoveRequest';\r\nimport { CipherBulkShareRequest } from '../models/request/cipherBulkShareRequest';\r\nimport { CipherCollectionsRequest } from '../models/request/cipherCollectionsRequest';\r\nimport { CipherRequest } from '../models/request/cipherRequest';\r\nimport { CipherShareRequest } from '../models/request/cipherShareRequest';\r\nimport { CollectionRequest } from '../models/request/collectionRequest';\r\nimport { DeleteRecoverRequest } from '../models/request/deleteRecoverRequest';\r\nimport { EmailRequest } from '../models/request/emailRequest';\r\nimport { EmailTokenRequest } from '../models/request/emailTokenRequest';\r\nimport { FolderRequest } from '../models/request/folderRequest';\r\nimport { GroupRequest } from '../models/request/groupRequest';\r\nimport { ImportCiphersRequest } from '../models/request/importCiphersRequest';\r\nimport { ImportDirectoryRequest } from '../models/request/importDirectoryRequest';\r\nimport { ImportOrganizationCiphersRequest } from '../models/request/importOrganizationCiphersRequest';\r\nimport { KeysRequest } from '../models/request/keysRequest';\r\nimport { OrganizationCreateRequest } from '../models/request/organizationCreateRequest';\r\nimport { OrganizationUpdateRequest } from '../models/request/organizationUpdateRequest';\r\nimport { OrganizationUserAcceptRequest } from '../models/request/organizationUserAcceptRequest';\r\nimport { OrganizationUserConfirmRequest } from '../models/request/organizationUserConfirmRequest';\r\nimport { OrganizationUserInviteRequest } from '../models/request/organizationUserInviteRequest';\r\nimport { OrganizationUserUpdateGroupsRequest } from '../models/request/organizationUserUpdateGroupsRequest';\r\nimport { OrganizationUserUpdateRequest } from '../models/request/organizationUserUpdateRequest';\r\nimport { PasswordHintRequest } from '../models/request/passwordHintRequest';\r\nimport { PasswordRequest } from '../models/request/passwordRequest';\r\nimport { PasswordVerificationRequest } from '../models/request/passwordVerificationRequest';\r\nimport { PaymentRequest } from '../models/request/paymentRequest';\r\nimport { RegisterRequest } from '../models/request/registerRequest';\r\nimport { SeatRequest } from '../models/request/seatRequest';\r\nimport { StorageRequest } from '../models/request/storageRequest';\r\nimport { TokenRequest } from '../models/request/tokenRequest';\r\nimport { TwoFactorEmailRequest } from '../models/request/twoFactorEmailRequest';\r\nimport { TwoFactorProviderRequest } from '../models/request/twoFactorProviderRequest';\r\nimport { TwoFactorRecoveryRequest } from '../models/request/twoFactorRecoveryRequest';\r\nimport { UpdateDomainsRequest } from '../models/request/updateDomainsRequest';\r\nimport { UpdateKeyRequest } from '../models/request/updateKeyRequest';\r\nimport { UpdateProfileRequest } from '../models/request/updateProfileRequest';\r\nimport { UpdateTwoFactorAuthenticatorRequest } from '../models/request/updateTwoFactorAuthenticatorRequest';\r\nimport { UpdateTwoFactorDuoRequest } from '../models/request/updateTwoFactorDuoRequest';\r\nimport { UpdateTwoFactorEmailRequest } from '../models/request/updateTwoFactorEmailRequest';\r\nimport { UpdateTwoFactorU2fRequest } from '../models/request/updateTwoFactorU2fRequest';\r\nimport { UpdateTwoFactorYubioOtpRequest } from '../models/request/updateTwoFactorYubioOtpRequest';\r\nimport { VerifyBankRequest } from '../models/request/verifyBankRequest';\r\nimport { VerifyDeleteRecoverRequest } from '../models/request/verifyDeleteRecoverRequest';\r\nimport { VerifyEmailRequest } from '../models/request/verifyEmailRequest';\r\n\r\nimport { BillingResponse } from '../models/response/billingResponse';\r\nimport { CipherResponse } from '../models/response/cipherResponse';\r\nimport {\r\n CollectionGroupDetailsResponse,\r\n CollectionResponse,\r\n} from '../models/response/collectionResponse';\r\nimport { CollectionUserResponse } from '../models/response/collectionUserResponse';\r\nimport { DomainsResponse } from '../models/response/domainsResponse';\r\nimport { EventResponse } from '../models/response/eventResponse';\r\nimport { FolderResponse } from '../models/response/folderResponse';\r\nimport {\r\n GroupDetailsResponse,\r\n GroupResponse,\r\n} from '../models/response/groupResponse';\r\nimport { GroupUserResponse } from '../models/response/groupUserResponse';\r\nimport { IdentityTokenResponse } from '../models/response/identityTokenResponse';\r\nimport { IdentityTwoFactorResponse } from '../models/response/identityTwoFactorResponse';\r\nimport { ListResponse } from '../models/response/listResponse';\r\nimport { OrganizationBillingResponse } from '../models/response/organizationBillingResponse';\r\nimport { OrganizationResponse } from '../models/response/organizationResponse';\r\nimport {\r\n OrganizationUserDetailsResponse,\r\n OrganizationUserUserDetailsResponse,\r\n} from '../models/response/organizationUserResponse';\r\nimport { ProfileResponse } from '../models/response/profileResponse';\r\nimport { SyncResponse } from '../models/response/syncResponse';\r\nimport { TwoFactorAuthenticatorResponse } from '../models/response/twoFactorAuthenticatorResponse';\r\nimport { TwoFactorDuoResponse } from '../models/response/twoFactorDuoResponse';\r\nimport { TwoFactorEmailResponse } from '../models/response/twoFactorEmailResponse';\r\nimport { TwoFactorProviderResponse } from '../models/response/twoFactorProviderResponse';\r\nimport { TwoFactorRecoverResponse } from '../models/response/twoFactorRescoverResponse';\r\nimport { TwoFactorU2fResponse } from '../models/response/twoFactorU2fResponse';\r\nimport { TwoFactorYubiKeyResponse } from '../models/response/twoFactorYubiKeyResponse';\r\nimport { UserKeyResponse } from '../models/response/userKeyResponse';\r\n\r\nexport abstract class ApiService {\r\n urlsSet: boolean;\r\n apiBaseUrl: string;\r\n identityBaseUrl: string;\r\n\r\n setUrls: (urls: EnvironmentUrls) => void;\r\n postIdentityToken: (request: TokenRequest) => Promise;\r\n refreshIdentityToken: () => Promise;\r\n\r\n getProfile: () => Promise;\r\n getUserBilling: () => Promise;\r\n putProfile: (request: UpdateProfileRequest) => Promise;\r\n postEmailToken: (request: EmailTokenRequest) => Promise;\r\n postEmail: (request: EmailRequest) => Promise;\r\n postPassword: (request: PasswordRequest) => Promise;\r\n postSecurityStamp: (request: PasswordVerificationRequest) => Promise;\r\n deleteAccount: (request: PasswordVerificationRequest) => Promise;\r\n getAccountRevisionDate: () => Promise;\r\n postPasswordHint: (request: PasswordHintRequest) => Promise;\r\n postRegister: (request: RegisterRequest) => Promise;\r\n postPremium: (data: FormData) => Promise;\r\n postReinstatePremium: () => Promise;\r\n postCancelPremium: () => Promise;\r\n postAccountStorage: (request: StorageRequest) => Promise;\r\n postAccountPayment: (request: PaymentRequest) => Promise;\r\n postAccountLicense: (data: FormData) => Promise;\r\n postAccountKey: (request: UpdateKeyRequest) => Promise;\r\n postAccountKeys: (request: KeysRequest) => Promise;\r\n postAccountVerifyEmail: () => Promise;\r\n postAccountVerifyEmailToken: (request: VerifyEmailRequest) => Promise;\r\n postAccountRecoverDelete: (request: DeleteRecoverRequest) => Promise;\r\n postAccountRecoverDeleteToken: (request: VerifyDeleteRecoverRequest) => Promise;\r\n\r\n postFolder: (request: FolderRequest) => Promise;\r\n putFolder: (id: string, request: FolderRequest) => Promise;\r\n deleteFolder: (id: string) => Promise;\r\n\r\n getCipher: (id: string) => Promise;\r\n getCipherAdmin: (id: string) => Promise;\r\n getCiphersOrganization: (organizationId: string) => Promise>;\r\n postCipher: (request: CipherRequest) => Promise;\r\n postCipherAdmin: (request: CipherRequest) => Promise;\r\n putCipher: (id: string, request: CipherRequest) => Promise;\r\n putCipherAdmin: (id: string, request: CipherRequest) => Promise;\r\n deleteCipher: (id: string) => Promise;\r\n deleteCipherAdmin: (id: string) => Promise;\r\n deleteManyCiphers: (request: CipherBulkDeleteRequest) => Promise;\r\n putMoveCiphers: (request: CipherBulkMoveRequest) => Promise;\r\n putShareCipher: (id: string, request: CipherShareRequest) => Promise;\r\n putShareCiphers: (request: CipherBulkShareRequest) => Promise;\r\n putCipherCollections: (id: string, request: CipherCollectionsRequest) => Promise;\r\n putCipherCollectionsAdmin: (id: string, request: CipherCollectionsRequest) => Promise;\r\n postPurgeCiphers: (request: PasswordVerificationRequest) => Promise;\r\n postImportCiphers: (request: ImportCiphersRequest) => Promise;\r\n postImportOrganizationCiphers: (organizationId: string, request: ImportOrganizationCiphersRequest) => Promise;\r\n\r\n postCipherAttachment: (id: string, data: FormData) => Promise;\r\n postCipherAttachmentAdmin: (id: string, data: FormData) => Promise;\r\n deleteCipherAttachment: (id: string, attachmentId: string) => Promise;\r\n deleteCipherAttachmentAdmin: (id: string, attachmentId: string) => Promise;\r\n postShareCipherAttachment: (id: string, attachmentId: string, data: FormData,\r\n organizationId: string) => Promise;\r\n\r\n getCollectionDetails: (organizationId: string, id: string) => Promise;\r\n getCollections: (organizationId: string) => Promise>;\r\n getCollectionUsers: (organizationId: string, id: string) => Promise>;\r\n postCollection: (organizationId: string, request: CollectionRequest) => Promise;\r\n putCollection: (organizationId: string, id: string, request: CollectionRequest) => Promise;\r\n deleteCollection: (organizationId: string, id: string) => Promise;\r\n deleteCollectionUser: (organizationId: string, id: string, organizationUserId: string) => Promise;\r\n\r\n getGroupDetails: (organizationId: string, id: string) => Promise;\r\n getGroups: (organizationId: string) => Promise>;\r\n getGroupUsers: (organizationId: string, id: string) => Promise>;\r\n postGroup: (organizationId: string, request: GroupRequest) => Promise;\r\n putGroup: (organizationId: string, id: string, request: GroupRequest) => Promise;\r\n deleteGroup: (organizationId: string, id: string) => Promise;\r\n deleteGroupUser: (organizationId: string, id: string, organizationUserId: string) => Promise;\r\n\r\n getOrganizationUser: (organizationId: string, id: string) => Promise;\r\n getOrganizationUserGroups: (organizationId: string, id: string) => Promise;\r\n getOrganizationUsers: (organizationId: string) => Promise>;\r\n postOrganizationUserInvite: (organizationId: string, request: OrganizationUserInviteRequest) => Promise;\r\n postOrganizationUserReinvite: (organizationId: string, id: string) => Promise;\r\n postOrganizationUserAccept: (organizationId: string, id: string,\r\n request: OrganizationUserAcceptRequest) => Promise;\r\n postOrganizationUserConfirm: (organizationId: string, id: string,\r\n request: OrganizationUserConfirmRequest) => Promise;\r\n putOrganizationUser: (organizationId: string, id: string, request: OrganizationUserUpdateRequest) => Promise;\r\n putOrganizationUserGroups: (organizationId: string, id: string,\r\n request: OrganizationUserUpdateGroupsRequest) => Promise;\r\n deleteOrganizationUser: (organizationId: string, id: string) => Promise;\r\n\r\n getSync: () => Promise;\r\n postImportDirectory: (organizationId: string, request: ImportDirectoryRequest) => Promise;\r\n\r\n getSettingsDomains: () => Promise;\r\n putSettingsDomains: (request: UpdateDomainsRequest) => Promise;\r\n\r\n getTwoFactorProviders: () => Promise>;\r\n getTwoFactorOrganizationProviders: (organizationId: string) => Promise>;\r\n getTwoFactorAuthenticator: (request: PasswordVerificationRequest) => Promise;\r\n getTwoFactorEmail: (request: PasswordVerificationRequest) => Promise;\r\n getTwoFactorDuo: (request: PasswordVerificationRequest) => Promise;\r\n getTwoFactorOrganizationDuo: (organizationId: string,\r\n request: PasswordVerificationRequest) => Promise;\r\n getTwoFactorYubiKey: (request: PasswordVerificationRequest) => Promise;\r\n getTwoFactorU2f: (request: PasswordVerificationRequest) => Promise;\r\n getTwoFactorRecover: (request: PasswordVerificationRequest) => Promise;\r\n putTwoFactorAuthenticator: (\r\n request: UpdateTwoFactorAuthenticatorRequest) => Promise;\r\n putTwoFactorEmail: (request: UpdateTwoFactorEmailRequest) => Promise;\r\n putTwoFactorDuo: (request: UpdateTwoFactorDuoRequest) => Promise;\r\n putTwoFactorOrganizationDuo: (organizationId: string,\r\n request: UpdateTwoFactorDuoRequest) => Promise;\r\n putTwoFactorYubiKey: (request: UpdateTwoFactorYubioOtpRequest) => Promise;\r\n putTwoFactorU2f: (request: UpdateTwoFactorU2fRequest) => Promise;\r\n putTwoFactorDisable: (request: TwoFactorProviderRequest) => Promise;\r\n putTwoFactorOrganizationDisable: (organizationId: string,\r\n request: TwoFactorProviderRequest) => Promise;\r\n postTwoFactorRecover: (request: TwoFactorRecoveryRequest) => Promise;\r\n postTwoFactorEmailSetup: (request: TwoFactorEmailRequest) => Promise;\r\n postTwoFactorEmail: (request: TwoFactorEmailRequest) => Promise;\r\n\r\n getOrganization: (id: string) => Promise;\r\n getOrganizationBilling: (id: string) => Promise;\r\n getOrganizationLicense: (id: string, installationId: string) => Promise;\r\n postOrganization: (request: OrganizationCreateRequest) => Promise;\r\n putOrganization: (id: string, request: OrganizationUpdateRequest) => Promise;\r\n postLeaveOrganization: (id: string) => Promise;\r\n postOrganizationLicense: (data: FormData) => Promise;\r\n postOrganizationLicenseUpdate: (id: string, data: FormData) => Promise;\r\n postOrganizationSeat: (id: string, request: SeatRequest) => Promise;\r\n postOrganizationStorage: (id: string, request: StorageRequest) => Promise;\r\n postOrganizationPayment: (id: string, request: PaymentRequest) => Promise;\r\n postOrganizationVerifyBank: (id: string, request: VerifyBankRequest) => Promise;\r\n postOrganizationCancel: (id: string) => Promise;\r\n postOrganizationReinstate: (id: string) => Promise;\r\n deleteOrganization: (id: string, request: PasswordVerificationRequest) => Promise;\r\n\r\n getEvents: (start: string, end: string, token: string) => Promise>;\r\n getEventsCipher: (id: string, start: string, end: string, token: string) => Promise>;\r\n getEventsOrganization: (id: string, start: string, end: string,\r\n token: string) => Promise>;\r\n getEventsOrganizationUser: (organizationId: string, id: string,\r\n start: string, end: string, token: string) => Promise>;\r\n\r\n getUserPublicKey: (id: string) => Promise;\r\n\r\n fetch: (request: Request) => Promise;\r\n}\r\n","import {\n Pipe,\n PipeTransform,\n} from '@angular/core';\r\n\nimport { I18nService } from '../../abstractions/i18n.service';\n\r\n@Pipe({\n name: 'i18n',\n})\r\nexport class I18nPipe implements PipeTransform {\n constructor(private i18nService: I18nService) { }\n\r\n transform(id: string, p1?: string, p2?: string, p3?: string): string {\r\n return this.i18nService.t(id, p1, p2, p3);\r\n }\r\n}\n","import { DeviceType } from '../enums/deviceType';\n\nexport abstract class PlatformUtilsService {\n identityClientId: string;\n getDevice: () => DeviceType;\n getDeviceString: () => string;\n isFirefox: () => boolean;\n isChrome: () => boolean;\n isEdge: () => boolean;\n isOpera: () => boolean;\n isVivaldi: () => boolean;\n isSafari: () => boolean;\n isIE: () => boolean;\n isMacAppStore: () => boolean;\n analyticsId: () => string;\n getDomain: (uriString: string) => string;\n isViewOpen: () => boolean;\n lockTimeout: () => number;\n launchUri: (uri: string, options?: any) => void;\n saveFile: (win: Window, blobData: any, blobOptions: any, fileName: string) => void;\n getApplicationVersion: () => string;\n supportsU2f: (win: Window) => boolean;\n supportsDuo: () => boolean;\n showToast: (type: 'error' | 'success' | 'warning' | 'info', title: string, text: string) => void;\n showDialog: (text: string, title?: string, confirmText?: string, cancelText?: string,\n type?: string) => Promise;\n isDev: () => boolean;\n isSelfHost: () => boolean;\n copyToClipboard: (text: string, options?: any) => void;\n}\n","import { Injectable } from '@angular/core';\n\nimport { ToasterService } from 'angular2-toaster';\n\nimport { I18nService } from '../../abstractions/i18n.service';\n\n@Injectable()\nexport class ValidationService {\n constructor(private toasterService: ToasterService, private i18nService: I18nService) { }\n\n showError(data: any): string[] {\n const defaultErrorMessage = this.i18nService.t('unexpectedError');\n const errors: string[] = [];\n\n if (data != null && typeof data === 'string') {\n errors.push(data);\n } else if (data == null || typeof data !== 'object') {\n errors.push(defaultErrorMessage);\n } else if (data.validationErrors == null) {\n errors.push(data.message ? data.message : defaultErrorMessage);\n } else {\n for (const key in data.validationErrors) {\n if (!data.validationErrors.hasOwnProperty(key)) {\n continue;\n }\n\n data.validationErrors[key].forEach((item: string) => {\n errors.push(item);\n });\n }\n }\n\n if (errors.length > 0) {\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'), errors[0]);\n }\n\n return errors;\n }\n}\n","import {\n Directive,\n ElementRef,\n Input,\n OnChanges,\n} from '@angular/core';\n\nimport { ValidationService } from '../services/validation.service';\r\n\r\n@Directive({\r\n selector: '[appApiAction]',\r\n})\r\nexport class ApiActionDirective implements OnChanges {\r\n @Input() appApiAction: Promise;\n\n constructor(private el: ElementRef, private validationService: ValidationService) { }\n\n ngOnChanges(changes: any) {\n if (this.appApiAction == null || this.appApiAction.then == null) {\r\n return;\r\n }\n\n this.el.nativeElement.loading = true;\n\r\n this.appApiAction.then((response: any) => {\n this.el.nativeElement.loading = false;\n }, (e: any) => {\n this.el.nativeElement.loading = false;\n this.validationService.showError(e);\n });\r\n }\r\n}\n","import { CipherString } from '../models/domain/cipherString';\r\nimport { SymmetricCryptoKey } from '../models/domain/symmetricCryptoKey';\r\n\r\nimport { ProfileOrganizationResponse } from '../models/response/profileOrganizationResponse';\r\n\r\nexport abstract class CryptoService {\r\n setKey: (key: SymmetricCryptoKey) => Promise;\r\n setKeyHash: (keyHash: string) => Promise<{}>;\r\n setEncKey: (encKey: string) => Promise<{}>;\r\n setEncPrivateKey: (encPrivateKey: string) => Promise<{}>;\r\n setOrgKeys: (orgs: ProfileOrganizationResponse[]) => Promise<{}>;\r\n getKey: () => Promise;\r\n getKeyHash: () => Promise;\r\n getEncKey: () => Promise;\r\n getPublicKey: () => Promise;\r\n getPrivateKey: () => Promise;\r\n getOrgKeys: () => Promise>;\r\n getOrgKey: (orgId: string) => Promise;\r\n hasKey: () => Promise;\r\n hasEncKey: () => Promise;\r\n clearKey: () => Promise;\r\n clearKeyHash: () => Promise;\r\n clearEncKey: (memoryOnly?: boolean) => Promise;\r\n clearKeyPair: (memoryOnly?: boolean) => Promise;\r\n clearOrgKeys: (memoryOnly?: boolean) => Promise;\r\n clearKeys: () => Promise;\r\n toggleKey: () => Promise;\r\n makeKey: (password: string, salt: string) => Promise;\r\n makeShareKey: () => Promise<[CipherString, SymmetricCryptoKey]>;\r\n makeKeyPair: (key?: SymmetricCryptoKey) => Promise<[string, CipherString]>;\r\n hashPassword: (password: string, key: SymmetricCryptoKey) => Promise;\r\n makeEncKey: (key: SymmetricCryptoKey) => Promise<[SymmetricCryptoKey, CipherString]>;\r\n encrypt: (plainValue: string | ArrayBuffer, key?: SymmetricCryptoKey) => Promise;\r\n encryptToBytes: (plainValue: ArrayBuffer, key?: SymmetricCryptoKey) => Promise;\r\n rsaEncrypt: (data: ArrayBuffer, publicKey?: ArrayBuffer, key?: SymmetricCryptoKey) => Promise;\r\n decryptToUtf8: (cipherString: CipherString, key?: SymmetricCryptoKey) => Promise;\r\n decryptFromBytes: (encBuf: ArrayBuffer, key: SymmetricCryptoKey) => Promise;\r\n randomNumber: (min: number, max: number) => Promise;\r\n}\r\n","import { OrganizationData } from '../models/data/organizationData';\nimport { Organization } from '../models/domain/organization';\n\nexport abstract class UserService {\n userId: string;\n email: string;\n stamp: string;\n\n setUserIdAndEmail: (userId: string, email: string) => Promise;\n setSecurityStamp: (stamp: string) => Promise;\n getUserId: () => Promise;\n getEmail: () => Promise;\n getSecurityStamp: () => Promise;\n clear: () => Promise;\n isAuthenticated: () => Promise;\n getOrganization: (id: string) => Promise;\n getAllOrganizations: () => Promise;\n replaceOrganizations: (organizations: { [id: string]: OrganizationData; }) => Promise;\n clearOrganizations: (userId: string) => Promise;\n}\n","import { CipherType } from '../enums/cipherType';\n\nimport { CipherData } from '../models/data/cipherData';\n\nimport { Cipher } from '../models/domain/cipher';\nimport { Field } from '../models/domain/field';\nimport { SymmetricCryptoKey } from '../models/domain/symmetricCryptoKey';\n\nimport { AttachmentView } from '../models/view/attachmentView';\nimport { CipherView } from '../models/view/cipherView';\nimport { FieldView } from '../models/view/fieldView';\n\nexport abstract class CipherService {\n decryptedCipherCache: CipherView[];\n\n clearCache: () => void;\n encrypt: (model: CipherView, key?: SymmetricCryptoKey) => Promise;\n encryptFields: (fieldsModel: FieldView[], key: SymmetricCryptoKey) => Promise;\n encryptField: (fieldModel: FieldView, key: SymmetricCryptoKey) => Promise;\n get: (id: string) => Promise;\n getAll: () => Promise;\n getAllDecrypted: () => Promise;\n getAllDecryptedForGrouping: (groupingId: string, folder?: boolean) => Promise;\n getAllDecryptedForUrl: (url: string, includeOtherTypes?: CipherType[]) => Promise;\n getLastUsedForUrl: (url: string) => Promise;\n updateLastUsedDate: (id: string) => Promise;\n saveNeverDomain: (domain: string) => Promise;\n saveWithServer: (cipher: Cipher) => Promise;\n shareWithServer: (cipher: CipherView, organizationId: string, collectionIds: string[]) => Promise;\n shareManyWithServer: (ciphers: CipherView[], organizationId: string, collectionIds: string[]) => Promise;\n shareAttachmentWithServer: (attachmentView: AttachmentView, cipherId: string,\n organizationId: string) => Promise;\n saveAttachmentWithServer: (cipher: Cipher, unencryptedFile: any, admin?: boolean) => Promise;\n saveAttachmentRawWithServer: (cipher: Cipher, filename: string, data: ArrayBuffer,\n admin?: boolean) => Promise;\n saveCollectionsWithServer: (cipher: Cipher) => Promise;\n upsert: (cipher: CipherData | CipherData[]) => Promise;\n replace: (ciphers: { [id: string]: CipherData; }) => Promise;\n clear: (userId: string) => Promise;\n moveManyWithServer: (ids: string[], folderId: string) => Promise;\n delete: (id: string | string[]) => Promise;\n deleteWithServer: (id: string) => Promise;\n deleteManyWithServer: (ids: string[]) => Promise;\n deleteAttachment: (id: string, attachmentId: string) => Promise;\n deleteAttachmentWithServer: (id: string, attachmentId: string) => Promise;\n sortCiphersByLastUsed: (a: any, b: any) => number;\n sortCiphersByLastUsedThenName: (a: any, b: any) => number;\n getLocaleSortingFunction: () => (a: CipherView, b: CipherView) => number;\n}\n","export abstract class MessagingService {\r\n send: (subscriber: string, arg?: any) => void;\r\n}\r\n","import { CipherView } from '../view/cipherView';\nimport { CollectionView } from '../view/collectionView';\nimport { FolderView } from '../view/folderView';\n\nexport class ImportResult {\n success = false;\n errorMessage: string;\n ciphers: CipherView[] = [];\n folders: FolderView[] = [];\n folderRelationships: Array<[number, number]> = [];\n collections: CollectionView[] = [];\n collectionRelationships: Array<[number, number]> = [];\n}\n","import * as papa from 'papaparse';\r\n\r\nimport { ImportResult } from '../models/domain/importResult';\r\n\r\nimport { CipherView } from '../models/view/cipherView';\r\nimport { CollectionView } from '../models/view/collectionView';\r\nimport { LoginUriView } from '../models/view/loginUriView';\r\n\r\nimport { Utils } from '../misc/utils';\r\n\r\nimport { FieldView } from '../models/view/fieldView';\r\nimport { FolderView } from '../models/view/folderView';\r\nimport { LoginView } from '../models/view/loginView';\r\nimport { SecureNoteView } from '../models/view/secureNoteView';\r\n\r\nimport { CipherType } from '../enums/cipherType';\r\nimport { FieldType } from '../enums/fieldType';\r\nimport { SecureNoteType } from '../enums/secureNoteType';\r\n\r\nexport abstract class BaseImporter {\r\n organization = false;\r\n\r\n protected newLineRegex = /(?:\\r\\n|\\r|\\n)/;\r\n\r\n protected passwordFieldNames = [\r\n 'password', 'pass word', 'passphrase', 'pass phrase',\r\n 'pass', 'code', 'code word', 'codeword',\r\n 'secret', 'secret word', 'personpwd',\r\n 'key', 'keyword', 'key word', 'keyphrase', 'key phrase',\r\n 'form_pw', 'wppassword', 'pin', 'pwd', 'pw', 'pword', 'passwd',\r\n 'p', 'serial', 'serial#', 'license key', 'reg #',\r\n\r\n // Non-English names\r\n 'passwort',\r\n ];\r\n\r\n protected usernameFieldNames = [\r\n 'user', 'name', 'user name', 'username', 'login name',\r\n 'email', 'e-mail', 'id', 'userid', 'user id',\r\n 'login', 'form_loginname', 'wpname', 'mail',\r\n 'loginid', 'login id', 'log', 'personlogin',\r\n 'first name', 'last name', 'card#', 'account #',\r\n 'member', 'member #',\r\n\r\n // Non-English names\r\n 'nom', 'benutzername',\r\n ];\r\n\r\n protected notesFieldNames = [\r\n 'note', 'notes', 'comment', 'comments', 'memo',\r\n 'description', 'free form', 'freeform',\r\n 'free text', 'freetext', 'free',\r\n\r\n // Non-English names\r\n 'kommentar',\r\n ];\r\n\r\n protected uriFieldNames: string[] = [\r\n 'url', 'hyper link', 'hyperlink', 'link',\r\n 'host', 'hostname', 'host name', 'server', 'address',\r\n 'hyper ref', 'href', 'web', 'website', 'web site', 'site',\r\n 'web-site', 'uri',\r\n\r\n // Non-English names\r\n 'ort', 'adresse',\r\n ];\r\n\r\n protected parseXml(data: string): Document {\r\n const parser = new DOMParser();\r\n const doc = parser.parseFromString(data, 'application/xml');\r\n return doc != null && doc.querySelector('parsererror') == null ? doc : null;\r\n }\r\n\r\n protected parseCsv(data: string, header: boolean): any[] {\r\n data = this.splitNewLine(data).join('\\n').trim();\r\n const result = papa.parse(data, {\r\n header: header,\r\n encoding: 'UTF-8',\r\n skipEmptyLines: false,\r\n });\r\n if (result.errors != null && result.errors.length > 0) {\r\n result.errors.forEach((e) => {\r\n // tslint:disable-next-line\r\n console.warn('Error parsing row ' + e.row + ': ' + e.message);\r\n });\r\n }\r\n return result.data && result.data.length > 0 ? result.data : null;\r\n }\r\n\r\n protected parseSingleRowCsv(rowData: string) {\r\n if (this.isNullOrWhitespace(rowData)) {\r\n return null;\r\n }\r\n const parsedRow = this.parseCsv(rowData, false);\r\n if (parsedRow != null && parsedRow.length > 0 && parsedRow[0].length > 0) {\r\n return parsedRow[0];\r\n }\r\n return null;\r\n }\r\n\r\n protected makeUriArray(uri: string | string[]): LoginUriView[] {\r\n if (uri == null) {\r\n return null;\r\n }\r\n\r\n if (typeof uri === 'string') {\r\n const loginUri = new LoginUriView();\r\n loginUri.uri = this.fixUri(uri);\r\n if (this.isNullOrWhitespace(loginUri.uri)) {\r\n return null;\r\n }\r\n loginUri.match = null;\r\n return [loginUri];\r\n }\r\n\r\n if (uri.length > 0) {\r\n const returnArr: LoginUriView[] = [];\r\n uri.forEach((u) => {\r\n const loginUri = new LoginUriView();\r\n loginUri.uri = this.fixUri(u);\r\n if (this.isNullOrWhitespace(loginUri.uri)) {\r\n return;\r\n }\r\n loginUri.match = null;\r\n returnArr.push(loginUri);\r\n });\r\n return returnArr.length === 0 ? null : returnArr;\r\n }\r\n\r\n return null;\r\n }\r\n\r\n protected fixUri(uri: string) {\r\n if (uri == null) {\r\n return null;\r\n }\r\n uri = uri.toLowerCase().trim();\r\n if (uri.indexOf('://') === -1 && uri.indexOf('.') >= 0) {\r\n uri = 'http://' + uri;\r\n }\r\n if (uri.length > 1000) {\r\n return uri.substring(0, 1000);\r\n }\r\n return uri;\r\n }\r\n\r\n protected nameFromUrl(url: string) {\r\n const hostname = Utils.getHostname(url);\r\n if (this.isNullOrWhitespace(hostname)) {\r\n return null;\r\n }\r\n return hostname.startsWith('www.') ? hostname.replace('www.', '') : hostname;\r\n }\r\n\r\n protected isNullOrWhitespace(str: string): boolean {\r\n return str == null || str.trim() === '';\r\n }\r\n\r\n protected getValueOrDefault(str: string, defaultValue: string = null): string {\r\n if (this.isNullOrWhitespace(str)) {\r\n return defaultValue;\r\n }\r\n return str;\r\n }\r\n\r\n protected splitNewLine(str: string): string[] {\r\n return str.split(this.newLineRegex);\r\n }\r\n\r\n // ref https://stackoverflow.com/a/5911300\r\n protected getCardBrand(cardNum: string) {\r\n if (this.isNullOrWhitespace(cardNum)) {\r\n return null;\r\n }\r\n\r\n // Visa\r\n let re = new RegExp('^4');\r\n if (cardNum.match(re) != null) {\r\n return 'Visa';\r\n }\r\n\r\n // Mastercard\r\n // Updated for Mastercard 2017 BINs expansion\r\n if (/^(5[1-5][0-9]{14}|2(22[1-9][0-9]{12}|2[3-9][0-9]{13}|[3-6][0-9]{14}|7[0-1][0-9]{13}|720[0-9]{12}))$/\r\n .test(cardNum)) {\r\n return 'Mastercard';\r\n }\r\n\r\n // AMEX\r\n re = new RegExp('^3[47]');\r\n if (cardNum.match(re) != null) {\r\n return 'Amex';\r\n }\r\n\r\n // Discover\r\n re = new RegExp('^(6011|622(12[6-9]|1[3-9][0-9]|[2-8][0-9]{2}|9[0-1][0-9]|92[0-5]|64[4-9])|65)');\r\n if (cardNum.match(re) != null) {\r\n return 'Discover';\r\n }\r\n\r\n // Diners\r\n re = new RegExp('^36');\r\n if (cardNum.match(re) != null) {\r\n return 'Diners Club';\r\n }\r\n\r\n // Diners - Carte Blanche\r\n re = new RegExp('^30[0-5]');\r\n if (cardNum.match(re) != null) {\r\n return 'Diners Club';\r\n }\r\n\r\n // JCB\r\n re = new RegExp('^35(2[89]|[3-8][0-9])');\r\n if (cardNum.match(re) != null) {\r\n return 'JCB';\r\n }\r\n\r\n // Visa Electron\r\n re = new RegExp('^(4026|417500|4508|4844|491(3|7))');\r\n if (cardNum.match(re) != null) {\r\n return 'Visa';\r\n }\r\n\r\n return null;\r\n }\r\n\r\n protected moveFoldersToCollections(result: ImportResult) {\r\n result.folderRelationships.forEach((r) => result.collectionRelationships.push(r));\r\n result.collections = result.folders.map((f) => {\r\n const collection = new CollectionView();\r\n collection.name = f.name;\r\n return collection;\r\n });\r\n result.folderRelationships = [];\r\n result.folders = [];\r\n }\r\n\r\n protected querySelectorDirectChild(parentEl: Element, query: string) {\r\n const els = this.querySelectorAllDirectChild(parentEl, query);\r\n return els.length === 0 ? null : els[0];\r\n }\r\n\r\n protected querySelectorAllDirectChild(parentEl: Element, query: string) {\r\n return Array.from(parentEl.querySelectorAll(query)).filter((el) => el.parentNode === parentEl);\r\n }\r\n\r\n protected initLoginCipher() {\r\n const cipher = new CipherView();\r\n cipher.favorite = false;\r\n cipher.notes = '';\r\n cipher.fields = [];\r\n cipher.login = new LoginView();\r\n cipher.type = CipherType.Login;\r\n return cipher;\r\n }\r\n\r\n protected cleanupCipher(cipher: CipherView) {\r\n if (cipher == null) {\r\n return;\r\n }\r\n if (cipher.type !== CipherType.Login) {\r\n cipher.login = null;\r\n }\r\n if (this.isNullOrWhitespace(cipher.name)) {\r\n cipher.name = '--';\r\n }\r\n if (this.isNullOrWhitespace(cipher.notes)) {\r\n cipher.notes = null;\r\n } else {\r\n cipher.notes = cipher.notes.trim();\r\n }\r\n if (cipher.fields != null && cipher.fields.length === 0) {\r\n cipher.fields = null;\r\n }\r\n }\r\n\r\n protected processKvp(cipher: CipherView, key: string, value: string) {\r\n if (this.isNullOrWhitespace(value)) {\r\n return;\r\n }\r\n if (this.isNullOrWhitespace(key)) {\r\n key = '';\r\n }\r\n if (value.length > 200 || value.trim().search(this.newLineRegex) > -1) {\r\n if (cipher.notes == null) {\r\n cipher.notes = '';\r\n }\r\n cipher.notes += (key + ': ' + this.splitNewLine(value).join('\\n') + '\\n');\r\n } else {\r\n if (cipher.fields == null) {\r\n cipher.fields = [];\r\n }\r\n const field = new FieldView();\r\n field.type = FieldType.Text;\r\n field.name = key;\r\n field.value = value;\r\n cipher.fields.push(field);\r\n }\r\n }\r\n\r\n protected processFolder(result: ImportResult, folderName: string) {\r\n let folderIndex = result.folders.length;\r\n const hasFolder = !this.isNullOrWhitespace(folderName);\r\n let addFolder = hasFolder;\r\n\r\n if (hasFolder) {\r\n for (let i = 0; i < result.folders.length; i++) {\r\n if (result.folders[i].name === folderName) {\r\n addFolder = false;\r\n folderIndex = i;\r\n break;\r\n }\r\n }\r\n }\r\n\r\n if (addFolder) {\r\n const f = new FolderView();\r\n f.name = folderName;\r\n result.folders.push(f);\r\n }\r\n if (hasFolder) {\r\n result.folderRelationships.push([result.ciphers.length, folderIndex]);\r\n }\r\n }\r\n\r\n protected convertToNoteIfNeeded(cipher: CipherView) {\r\n if (cipher.type === CipherType.Login && this.isNullOrWhitespace(cipher.login.username) &&\r\n this.isNullOrWhitespace(cipher.login.password) &&\r\n (cipher.login.uris == null || cipher.login.uris.length === 0)) {\r\n cipher.type = CipherType.SecureNote;\r\n cipher.secureNote = new SecureNoteView();\r\n cipher.secureNote.type = SecureNoteType.Generic;\r\n }\r\n }\r\n}\r\n","export abstract class TokenService {\n token: string;\n decodedToken: any;\n refreshToken: string;\n setTokens: (accessToken: string, refreshToken: string) => Promise;\n setToken: (token: string) => Promise;\n getToken: () => Promise;\n setRefreshToken: (refreshToken: string) => Promise;\n getRefreshToken: () => Promise;\n setTwoFactorToken: (token: string, email: string) => Promise;\n getTwoFactorToken: (email: string) => Promise;\n clearTwoFactorToken: (email: string) => Promise;\n clearToken: () => Promise;\n decodeToken: () => any;\n getTokenExpirationDate: () => Date;\n tokenSecondsRemaining: (offsetSeconds?: number) => number;\n tokenNeedsRefresh: (minutes?: number) => boolean;\n getUserId: () => string;\n getEmail: () => string;\n getEmailVerified: () => boolean;\n getName: () => string;\n getPremium: () => boolean;\n getIssuer: () => string;\n}\n","import {\r\n Component,\r\n Input,\r\n OnInit,\r\n} from '@angular/core';\r\n\r\nimport { I18nService } from 'jslib/abstractions/i18n.service';\r\n\r\n@Component({\r\n selector: 'app-callout',\r\n templateUrl: 'callout.component.html',\r\n})\r\nexport class CalloutComponent implements OnInit {\r\n @Input() type = 'info';\r\n @Input() icon: string;\r\n @Input() title: string;\r\n\r\n calloutStyle: string;\r\n\r\n constructor(private i18nService: I18nService) { }\r\n\r\n ngOnInit() {\r\n this.calloutStyle = this.type;\r\n\r\n if (this.type === 'warning' || this.type === 'danger') {\r\n if (this.type === 'danger') {\r\n this.calloutStyle = 'danger';\r\n }\r\n if (this.title === undefined) {\r\n this.title = this.i18nService.t('warning');\r\n }\r\n if (this.icon === undefined) {\r\n this.icon = 'fa-warning';\r\n }\r\n } else if (this.type === 'error') {\r\n this.calloutStyle = 'danger';\r\n if (this.title === undefined) {\r\n this.title = this.i18nService.t('error');\r\n }\r\n if (this.icon === undefined) {\r\n this.icon = 'fa-bolt';\r\n }\r\n } else if (this.type === 'tip') {\r\n this.calloutStyle = 'success';\r\n if (this.title === undefined) {\r\n this.title = this.i18nService.t('tip');\r\n }\r\n if (this.icon === undefined) {\r\n this.icon = 'fa-lightbulb-o';\r\n }\r\n }\r\n }\r\n}\r\n","
\r\n

\r\n \r\n {{title}}\r\n

\r\n \r\n
\r\n","import { CollectionData } from '../models/data/collectionData';\n\nimport { Collection } from '../models/domain/collection';\n\nimport { CollectionView } from '../models/view/collectionView';\n\nexport abstract class CollectionService {\n decryptedCollectionCache: CollectionView[];\n\n clearCache: () => void;\n encrypt: (model: CollectionView) => Promise;\n decryptMany: (collections: Collection[]) => Promise;\n get: (id: string) => Promise;\n getAll: () => Promise;\n getAllDecrypted: () => Promise;\n upsert: (collection: CollectionData | CollectionData[]) => Promise;\n replace: (collections: { [id: string]: CollectionData; }) => Promise;\n clear: (userId: string) => Promise;\n delete: (id: string | string[]) => Promise;\n}\n","import {\n Directive,\n ElementRef,\n Input,\n Renderer2,\n} from '@angular/core';\n\n@Directive({\n selector: '[appInputVerbatim]',\n})\nexport class InputVerbatimDirective {\n @Input() set appInputVerbatim(condition: boolean | string) {\n this.disableComplete = condition === '' || condition === true;\n }\n\n private disableComplete: boolean;\n\n constructor(private el: ElementRef, private renderer: Renderer2) { }\n\n ngOnInit() {\n if (this.disableComplete && !this.el.nativeElement.hasAttribute('autocomplete')) {\n this.renderer.setAttribute(this.el.nativeElement, 'autocomplete', 'off');\n }\n if (!this.el.nativeElement.hasAttribute('autocapitalize')) {\n this.renderer.setAttribute(this.el.nativeElement, 'autocapitalize', 'none');\n }\n if (!this.el.nativeElement.hasAttribute('autocorrect')) {\n this.renderer.setAttribute(this.el.nativeElement, 'autocorrect', 'none');\n }\n if (!this.el.nativeElement.hasAttribute('spellcheck')) {\n this.renderer.setAttribute(this.el.nativeElement, 'spellcheck', 'false');\n }\n if (!this.el.nativeElement.hasAttribute('inputmode')) {\n this.renderer.setAttribute(this.el.nativeElement, 'inputmode', 'verbatim');\n }\n }\n}\n","import { I18nService } from '../abstractions/i18n.service';\n\n// tslint:disable-next-line\nconst nodeURL = typeof window === 'undefined' ? require('url').URL : null;\n\nexport class Utils {\n static inited = false;\n static isNode = false;\n static isBrowser = true;\n static global: NodeJS.Global | Window = null;\n\n static init() {\n if (Utils.inited) {\n return;\n }\n\n Utils.inited = true;\n Utils.isNode = typeof process !== 'undefined' && (process as any).release != null &&\n (process as any).release.name === 'node';\n Utils.isBrowser = typeof window !== 'undefined';\n Utils.global = Utils.isNode && !Utils.isBrowser ? global : window;\n }\n\n static fromB64ToArray(str: string): Uint8Array {\n if (Utils.isNode) {\n return new Uint8Array(Buffer.from(str, 'base64'));\n } else {\n const binaryString = window.atob(str);\n const bytes = new Uint8Array(binaryString.length);\n for (let i = 0; i < binaryString.length; i++) {\n bytes[i] = binaryString.charCodeAt(i);\n }\n return bytes;\n }\n }\n\n static fromHexToArray(str: string): Uint8Array {\n if (Utils.isNode) {\n return new Uint8Array(Buffer.from(str, 'hex'));\n } else {\n const bytes = new Uint8Array(str.length / 2);\n for (let i = 0; i < str.length; i += 2) {\n bytes[i / 2] = parseInt(str.substr(i, 2), 16);\n }\n return bytes;\n }\n }\n\n static fromUtf8ToArray(str: string): Uint8Array {\n if (Utils.isNode) {\n return new Uint8Array(Buffer.from(str, 'utf8'));\n } else {\n const strUtf8 = unescape(encodeURIComponent(str));\n const arr = new Uint8Array(strUtf8.length);\n for (let i = 0; i < strUtf8.length; i++) {\n arr[i] = strUtf8.charCodeAt(i);\n }\n return arr;\n }\n }\n\n static fromByteStringToArray(str: string): Uint8Array {\n const arr = new Uint8Array(str.length);\n for (let i = 0; i < str.length; i++) {\n arr[i] = str.charCodeAt(i);\n }\n return arr;\n }\n\n static fromBufferToB64(buffer: ArrayBuffer): string {\n if (Utils.isNode) {\n return new Buffer(buffer).toString('base64');\n } else {\n let binary = '';\n const bytes = new Uint8Array(buffer);\n for (let i = 0; i < bytes.byteLength; i++) {\n binary += String.fromCharCode(bytes[i]);\n }\n return window.btoa(binary);\n }\n }\n\n static fromBufferToUtf8(buffer: ArrayBuffer): string {\n if (Utils.isNode) {\n return new Buffer(buffer).toString('utf8');\n } else {\n const bytes = new Uint8Array(buffer);\n const encodedString = String.fromCharCode.apply(null, bytes);\n return decodeURIComponent(escape(encodedString));\n }\n }\n\n static fromBufferToByteString(buffer: ArrayBuffer): string {\n return String.fromCharCode.apply(null, new Uint8Array(buffer));\n }\n\n // ref: https://stackoverflow.com/a/40031979/1090359\n static fromBufferToHex(buffer: ArrayBuffer): string {\n if (Utils.isNode) {\n return new Buffer(buffer).toString('hex');\n } else {\n const bytes = new Uint8Array(buffer);\n return Array.prototype.map.call(bytes, (x: number) => ('00' + x.toString(16)).slice(-2)).join('');\n }\n }\n\n static fromUrlB64ToUtf8(b64Str: string): string {\n let output = b64Str.replace(/-/g, '+').replace(/_/g, '/');\n switch (output.length % 4) {\n case 0:\n break;\n case 2:\n output += '==';\n break;\n case 3:\n output += '=';\n break;\n default:\n throw new Error('Illegal base64url string!');\n }\n\n return Utils.fromB64ToUtf8(output);\n }\n\n static fromB64ToUtf8(b64Str: string): string {\n if (Utils.isNode) {\n return new Buffer(b64Str, 'base64').toString('utf8');\n } else {\n return decodeURIComponent(escape(window.atob(b64Str)));\n }\n }\n\n // ref: http://stackoverflow.com/a/2117523/1090359\n static newGuid(): string {\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {\n // tslint:disable-next-line\n const r = Math.random() * 16 | 0;\n // tslint:disable-next-line\n const v = c === 'x' ? r : (r & 0x3 | 0x8);\n return v.toString(16);\n });\n }\n\n static getHostname(uriString: string): string {\n const url = Utils.getUrl(uriString);\n return url != null ? url.hostname : null;\n }\n\n static getHost(uriString: string): string {\n const url = Utils.getUrl(uriString);\n return url != null ? url.host : null;\n }\n\n static getSortFunction(i18nService: I18nService, prop: string) {\n return (a: any, b: any) => {\n if (a[prop] == null && b[prop] != null) {\n return -1;\n }\n if (a[prop] != null && b[prop] == null) {\n return 1;\n }\n if (a[prop] == null && b[prop] == null) {\n return 0;\n }\n\n return i18nService.collator ? i18nService.collator.compare(a[prop], b[prop]) :\n a[prop].localeCompare(b[prop]);\n };\n }\n\n private static getUrl(uriString: string): URL {\n if (uriString == null) {\n return null;\n }\n\n uriString = uriString.trim();\n if (uriString === '') {\n return null;\n }\n\n if (uriString.indexOf('://') === -1 && uriString.indexOf('.') > -1) {\n uriString = 'http://' + uriString;\n }\n\n if (uriString.startsWith('http://') || uriString.startsWith('https://')) {\n try {\n if (nodeURL != null) {\n return new nodeURL(uriString);\n } else if (typeof URL === 'function') {\n return new URL(uriString);\n } else if (window != null) {\n const anchor = window.document.createElement('a');\n anchor.href = uriString;\n return anchor as any;\n }\n } catch (e) { }\n }\n\n return null;\n }\n}\n\nUtils.init();\n","import { FolderData } from '../models/data/folderData';\n\nimport { Folder } from '../models/domain/folder';\nimport { SymmetricCryptoKey } from '../models/domain/symmetricCryptoKey';\n\nimport { FolderView } from '../models/view/folderView';\n\nexport abstract class FolderService {\n decryptedFolderCache: FolderView[];\n\n clearCache: () => void;\n encrypt: (model: FolderView, key?: SymmetricCryptoKey) => Promise;\n get: (id: string) => Promise;\n getAll: () => Promise;\n getAllDecrypted: () => Promise;\n saveWithServer: (folder: Folder) => Promise;\n upsert: (folder: FolderData | FolderData[]) => Promise;\n replace: (folders: { [id: string]: FolderData; }) => Promise;\n clear: (userId: string) => Promise;\n delete: (id: string | string[]) => Promise;\n deleteWithServer: (id: string) => Promise;\n}\n","export enum CipherType {\r\n Login = 1,\r\n SecureNote = 2,\r\n Card = 3,\r\n Identity = 4,\r\n}\n","import {\n Directive,\n HostListener,\n} from '@angular/core';\r\n\r\n@Directive({\r\n selector: '[appStopClick]',\r\n})\r\nexport class StopClickDirective {\n @HostListener('click', ['$event']) onClick($event: MouseEvent) {\r\n $event.preventDefault();\r\n }\r\n}\n","export abstract class StateService {\r\n get: (key: string) => Promise;\r\n save: (key: string, obj: any) => Promise;\r\n remove: (key: string) => Promise;\r\n purge: () => Promise;\r\n}\r\n","export abstract class SyncService {\r\n syncInProgress: boolean;\n\r\n getLastSync: () => Promise;\r\n setLastSync: (date: Date) => Promise;\r\n syncStarted: () => void;\r\n syncCompleted: (successfully: boolean) => void;\r\n fullSync: (forceSync: boolean) => Promise;\r\n}\r\n","export class PasswordVerificationRequest {\n masterPasswordHash: string;\n}\n","export enum TwoFactorProviderType {\r\n Authenticator = 0,\r\n Email = 1,\r\n Duo = 2,\r\n Yubikey = 3,\n U2f = 4,\r\n Remember = 5,\r\n OrganizationDuo = 6,\r\n}\n","import {\n Directive,\n ElementRef,\n Input,\n} from '@angular/core';\n\n@Directive({\n selector: '[appAutofocus]',\n})\nexport class AutofocusDirective {\n @Input() set appAutofocus(condition: boolean | string) {\n this.autofocus = condition === '' || condition === true;\n }\n\n private autofocus: boolean;\n\n constructor(private el: ElementRef) { }\n\n ngOnInit() {\n if (this.autofocus) {\n this.el.nativeElement.focus();\n }\n }\n}\n","import { SecureNoteType } from '../../enums/secureNoteType';\r\n\r\nimport { View } from './view';\r\n\r\nimport { SecureNote } from '../domain/secureNote';\r\n\r\nexport class SecureNoteView implements View {\r\n type: SecureNoteType;\r\n\r\n constructor(n?: SecureNote) {\r\n if (!n) {\r\n return;\r\n }\r\n\r\n this.type = n.type;\r\n }\r\n\r\n get subTitle(): string {\r\n return null;\r\n }\r\n}\r\n","import {\n Directive,\n HostListener,\n} from '@angular/core';\r\n\r\n@Directive({\r\n selector: '[appStopProp]',\r\n})\r\nexport class StopPropDirective {\n @HostListener('click', ['$event']) onClick($event: MouseEvent) {\r\n $event.stopPropagation();\r\n }\r\n}\n","import * as jq from 'jquery';\r\n\r\nimport {\r\n Component,\r\n ComponentFactoryResolver,\r\n Type,\r\n ViewContainerRef,\r\n} from '@angular/core';\r\n\r\nimport { ModalComponent as BaseModalComponent } from 'jslib/angular/components/modal.component';\r\n\r\n@Component({\r\n selector: 'app-modal',\r\n template: ``,\r\n})\r\nexport class ModalComponent extends BaseModalComponent {\r\n el: any = null;\r\n\r\n constructor(componentFactoryResolver: ComponentFactoryResolver) {\r\n super(componentFactoryResolver);\r\n }\r\n\r\n ngOnDestroy() { /* Nothing */ }\r\n\r\n show(type: Type, parentContainer: ViewContainerRef, fade: boolean = true): T {\r\n this.parentContainer = parentContainer;\r\n this.fade = fade;\r\n\r\n const factory = this.componentFactoryResolver.resolveComponentFactory(type);\r\n const componentRef = this.container.createComponent(factory);\r\n\r\n const modals = Array.from(document.querySelectorAll('.modal'));\r\n if (modals.length > 0) {\r\n this.el = jq(modals[0]);\r\n this.el.modal('show');\r\n\r\n this.el.on('show.bs.modal', () => {\r\n this.onShow.emit();\r\n });\r\n this.el.on('shown.bs.modal', () => {\r\n this.onShown.emit();\r\n this.el.find('*[appAutoFocus]').focus();\r\n });\r\n this.el.on('hide.bs.modal', () => {\r\n this.onClose.emit();\r\n });\r\n this.el.on('hidden.bs.modal', () => {\r\n this.onClosed.emit();\r\n if (this.parentContainer != null) {\r\n this.parentContainer.clear();\r\n }\r\n });\r\n }\r\n\r\n return componentRef.instance;\r\n }\r\n\r\n close() {\r\n if (this.el != null) {\r\n this.el.modal('hide');\r\n }\r\n }\r\n}\r\n","import { PasswordHistory } from '../models/domain/passwordHistory';\r\n\r\nexport abstract class PasswordGenerationService {\r\n generatePassword: (options: any) => Promise;\r\n getOptions: () => any;\r\n saveOptions: (options: any) => Promise;\r\n getHistory: () => Promise;\r\n addHistory: (password: string) => Promise;\r\n clear: () => Promise;\r\n}\r\n","import { TwoFactorProviderType } from '../enums/twoFactorProviderType';\n\nimport { AuthResult } from '../models/domain/authResult';\n\nexport abstract class AuthService {\n email: string;\n masterPasswordHash: string;\n twoFactorProviders: Map;\n selectedTwoFactorProviderType: TwoFactorProviderType;\n\n logIn: (email: string, masterPassword: string) => Promise;\n logInTwoFactor: (twoFactorProvider: TwoFactorProviderType, twoFactorToken: string,\n remember?: boolean) => Promise;\n logInComplete: (email: string, masterPassword: string, twoFactorProvider: TwoFactorProviderType,\n twoFactorToken: string, remember?: boolean) => Promise;\n logOut: (callback: Function) => void;\n getSupportedTwoFactorProviders: (win: Window) => any[];\n getDefaultTwoFactorProvider: (u2fSupported: boolean) => TwoFactorProviderType;\n}\n","import { CipherString } from './cipherString';\n\nimport { View } from '../view/view';\n\nexport default abstract class Domain {\n protected buildDomainModel(domain: D, dataObj: any, map: any,\n alreadyEncrypted: boolean, notEncList: any[] = []) {\n for (const prop in map) {\n if (!map.hasOwnProperty(prop)) {\n continue;\n }\n\n const objProp = dataObj[(map[prop] || prop)];\n if (alreadyEncrypted === true || notEncList.indexOf(prop) > -1) {\n (domain as any)[prop] = objProp ? objProp : null;\n } else {\n (domain as any)[prop] = objProp ? new CipherString(objProp) : null;\n }\n }\n }\n protected buildDataModel(domain: D, dataObj: any, map: any, notCipherStringList: any[] = []) {\n for (const prop in map) {\n if (!map.hasOwnProperty(prop)) {\n continue;\n }\n\n const objProp = (domain as any)[(map[prop] || prop)];\n if (notCipherStringList.indexOf(prop) > -1) {\n (dataObj as any)[prop] = objProp != null ? objProp : null;\n } else {\n (dataObj as any)[prop] = objProp != null ? (objProp as CipherString).encryptedString : null;\n }\n }\n }\n\n protected async decryptObj(viewModel: T, map: any, orgId: string): Promise {\n const promises = [];\n const self: any = this;\n\n for (const prop in map) {\n if (!map.hasOwnProperty(prop)) {\n continue;\n }\n\n // tslint:disable-next-line\n (function (theProp) {\n const p = Promise.resolve().then(() => {\n const mapProp = map[theProp] || theProp;\n if (self[mapProp]) {\n return self[mapProp].decrypt(orgId);\n }\n return null;\n }).then((val: any) => {\n (viewModel as any)[theProp] = val;\n });\n promises.push(p);\n })(prop);\n }\n\n await Promise.all(promises);\n return viewModel;\n }\n}\n","export enum SecureNoteType {\r\n Generic = 0,\r\n}\r\n","export class ConstantsService {\r\n static readonly environmentUrlsKey: string = 'environmentUrls';\r\n static readonly disableGaKey: string = 'disableGa';\r\n static readonly disableAddLoginNotificationKey: string = 'disableAddLoginNotification';\r\n static readonly disableContextMenuItemKey: string = 'disableContextMenuItem';\r\n static readonly disableFaviconKey: string = 'disableFavicon';\r\n static readonly disableAutoTotpCopyKey: string = 'disableAutoTotpCopy';\r\n static readonly enableAutoFillOnPageLoadKey: string = 'enableAutoFillOnPageLoad';\r\n static readonly lockOptionKey: string = 'lockOption';\r\n static readonly lastActiveKey: string = 'lastActive';\r\n static readonly neverDomainsKey: string = 'neverDomains';\r\n static readonly installedVersionKey: string = 'installedVersion';\r\n static readonly localeKey: string = 'locale';\r\n static readonly themeKey: string = 'theme';\r\n\r\n readonly environmentUrlsKey: string = ConstantsService.environmentUrlsKey;\r\n readonly disableGaKey: string = ConstantsService.disableGaKey;\r\n readonly disableAddLoginNotificationKey: string = ConstantsService.disableAddLoginNotificationKey;\r\n readonly disableContextMenuItemKey: string = ConstantsService.disableContextMenuItemKey;\r\n readonly disableFaviconKey: string = ConstantsService.disableFaviconKey;\r\n readonly disableAutoTotpCopyKey: string = ConstantsService.disableAutoTotpCopyKey;\r\n readonly enableAutoFillOnPageLoadKey: string = ConstantsService.enableAutoFillOnPageLoadKey;\r\n readonly lockOptionKey: string = ConstantsService.lockOptionKey;\r\n readonly lastActiveKey: string = ConstantsService.lastActiveKey;\r\n readonly neverDomainsKey: string = ConstantsService.neverDomainsKey;\r\n readonly installedVersionKey: string = ConstantsService.installedVersionKey;\r\n readonly localeKey: string = ConstantsService.localeKey;\r\n readonly themeKey: string = ConstantsService.themeKey;\r\n}\r\n","import { CipherType } from '../../enums/cipherType';\n\nimport { AttachmentData } from './attachmentData';\nimport { CardData } from './cardData';\nimport { FieldData } from './fieldData';\nimport { IdentityData } from './identityData';\nimport { LoginData } from './loginData';\nimport { SecureNoteData } from './secureNoteData';\n\nimport { CipherResponse } from '../response/cipherResponse';\n\nexport class CipherData {\n id: string;\n organizationId: string;\n folderId: string;\n userId: string;\n edit: boolean;\n organizationUseTotp: boolean;\n favorite: boolean;\n revisionDate: Date;\n type: CipherType;\n sizeName: string;\n name: string;\n notes: string;\n login?: LoginData;\n secureNote?: SecureNoteData;\n card?: CardData;\n identity?: IdentityData;\n fields?: FieldData[];\n attachments?: AttachmentData[];\n collectionIds?: string[];\n\n constructor(response?: CipherResponse, userId?: string, collectionIds?: string[]) {\n if (response == null) {\n return;\n }\n\n this.id = response.id;\n this.organizationId = response.organizationId;\n this.folderId = response.folderId;\n this.userId = userId;\n this.edit = response.edit;\n this.organizationUseTotp = response.organizationUseTotp;\n this.favorite = response.favorite;\n this.revisionDate = response.revisionDate;\n this.type = response.type;\n this.name = response.name;\n this.notes = response.notes;\n\n if (collectionIds != null) {\n this.collectionIds = collectionIds;\n } else {\n this.collectionIds = response.collectionIds;\n }\n\n switch (this.type) {\n case CipherType.Login:\n this.login = new LoginData(response.login);\n break;\n case CipherType.SecureNote:\n this.secureNote = new SecureNoteData(response.secureNote);\n break;\n case CipherType.Card:\n this.card = new CardData(response.card);\n break;\n case CipherType.Identity:\n this.identity = new IdentityData(response.identity);\n break;\n default:\n break;\n }\n\n if (response.fields != null) {\n this.fields = [];\n response.fields.forEach((field) => {\n this.fields.push(new FieldData(field));\n });\n }\n\n if (response.attachments != null) {\n this.attachments = [];\n response.attachments.forEach((attachment) => {\n this.attachments.push(new AttachmentData(attachment));\n });\n }\n }\n}\n","import { View } from './view';\r\n\r\nimport { Card } from '../domain/card';\r\n\r\nexport class CardView implements View {\r\n cardholderName: string;\r\n expMonth: string = null;\r\n expYear: string;\r\n code: string;\r\n\r\n // tslint:disable\r\n private _brand: string = null;\r\n private _number: string;\r\n private _subTitle: string;\r\n // tslint:enable\r\n\r\n constructor(c?: Card) {\r\n // ctor\r\n }\r\n\r\n get maskedCode(): string {\r\n return this.code != null ? '•'.repeat(this.code.length) : null;\r\n }\r\n\r\n get brand(): string {\r\n return this._brand;\r\n }\r\n set brand(value: string) {\r\n this._brand = value;\r\n this._subTitle = null;\r\n }\r\n\r\n get number(): string {\r\n return this._number;\r\n }\r\n set number(value: string) {\r\n this._number = value;\r\n this._subTitle = null;\r\n }\r\n\r\n get subTitle(): string {\r\n if (this._subTitle == null) {\r\n this._subTitle = this.brand;\r\n if (this.number != null && this.number.length >= 4) {\r\n if (this._subTitle != null && this._subTitle !== '') {\r\n this._subTitle += ', ';\r\n } else {\r\n this._subTitle = '';\r\n }\r\n this._subTitle += ('*' + this.number.substr(this.number.length - 4));\r\n }\r\n }\r\n return this._subTitle;\r\n }\r\n\r\n get expiration(): string {\r\n if (!this.expMonth && !this.expYear) {\r\n return null;\r\n }\r\n\r\n let exp = this.expMonth != null ? ('0' + this.expMonth).slice(-2) : '__';\r\n exp += (' / ' + (this.expYear != null ? this.formatYear(this.expYear) : '____'));\r\n return exp;\r\n }\r\n\r\n private formatYear(year: string): string {\r\n return year.length === 2 ? '20' + year : year;\r\n }\r\n}\r\n","import {\r\n Component,\r\n Input,\r\n OnChanges,\r\n OnInit,\r\n} from '@angular/core';\r\nimport { DomSanitizer } from '@angular/platform-browser';\r\n\r\n@Component({\r\n selector: 'app-avatar',\r\n template: '',\r\n})\r\nexport class AvatarComponent implements OnChanges, OnInit {\r\n @Input() data: string;\r\n @Input() width = 45;\r\n @Input() height = 45;\r\n @Input() charCount = 2;\r\n @Input() textColor = '#ffffff';\r\n @Input() fontSize = 20;\r\n @Input() fontWeight = 300;\r\n @Input() dynamic = false;\r\n @Input() circle = false;\r\n\r\n src: string;\r\n\r\n constructor(public sanitizer: DomSanitizer) { }\r\n\r\n ngOnInit() {\r\n if (!this.dynamic) {\r\n this.generate();\r\n }\r\n }\r\n\r\n ngOnChanges() {\r\n if (this.dynamic) {\r\n this.generate();\r\n }\r\n }\r\n\r\n private generate() {\r\n let chars: string = null;\r\n const upperData = this.data.toUpperCase();\r\n\r\n if (this.charCount > 1) {\r\n chars = this.getFirstLetters(upperData, this.charCount);\r\n }\r\n if (chars == null) {\r\n chars = upperData.substr(0, this.charCount);\r\n }\r\n\r\n const charObj = this.getCharText(chars);\r\n const color = this.stringToColor(upperData);\r\n const svg = this.getSvg(this.width, this.height, color);\r\n svg.appendChild(charObj);\r\n const html = window.document.createElement('div').appendChild(svg).outerHTML;\r\n const svgHtml = window.btoa(unescape(encodeURIComponent(html)));\r\n this.src = 'data:image/svg+xml;base64,' + svgHtml;\r\n }\r\n\r\n private stringToColor(str: string): string {\r\n let hash = 0;\r\n for (let i = 0; i < str.length; i++) {\r\n // tslint:disable-next-line\r\n hash = str.charCodeAt(i) + ((hash << 5) - hash);\r\n }\r\n let color = '#';\r\n for (let i = 0; i < 3; i++) {\r\n // tslint:disable-next-line\r\n const value = (hash >> (i * 8)) & 0xFF;\r\n color += ('00' + value.toString(16)).substr(-2);\r\n }\r\n return color;\r\n }\r\n\r\n private getFirstLetters(data: string, count: number): string {\r\n const parts = data.split(' ');\r\n if (parts.length > 1) {\r\n let text = '';\r\n for (let i = 0; i < count; i++) {\r\n text += parts[i].substr(0, 1);\r\n }\r\n return text;\r\n }\r\n return null;\r\n }\r\n\r\n private getSvg(width: number, height: number, color: string): HTMLElement {\r\n const svgTag = window.document.createElement('svg');\r\n svgTag.setAttribute('xmlns', 'http://www.w3.org/2000/svg');\r\n svgTag.setAttribute('pointer-events', 'none');\r\n svgTag.setAttribute('width', width.toString());\r\n svgTag.setAttribute('height', height.toString());\r\n svgTag.style.backgroundColor = color;\r\n svgTag.style.width = width + 'px';\r\n svgTag.style.height = height + 'px';\r\n return svgTag;\r\n }\r\n\r\n private getCharText(character: string): HTMLElement {\r\n const textTag = window.document.createElement('text');\r\n textTag.setAttribute('text-anchor', 'middle');\r\n textTag.setAttribute('y', '50%');\r\n textTag.setAttribute('x', '50%');\r\n textTag.setAttribute('dy', '0.35em');\r\n textTag.setAttribute('pointer-events', 'auto');\r\n textTag.setAttribute('fill', this.textColor);\r\n textTag.setAttribute('font-family', '\"Open Sans\",\"Helvetica Neue\",Helvetica,Arial,' +\r\n 'sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",\"Segoe UI Symbol\"');\r\n textTag.textContent = character;\r\n textTag.style.fontWeight = this.fontWeight.toString();\r\n textTag.style.fontSize = this.fontSize + 'px';\r\n return textTag;\r\n }\r\n}\r\n","export abstract class StorageService {\r\n get: (key: string) => Promise;\r\n save: (key: string, obj: any) => Promise;\r\n remove: (key: string) => Promise;\r\n}\r\n","import {\n Component,\n EventEmitter,\n Input,\n Output,\n} from '@angular/core';\n\nimport { ToasterService } from 'angular2-toaster';\n\nimport { TwoFactorProviderType } from 'jslib/enums/twoFactorProviderType';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { CryptoService } from 'jslib/abstractions/crypto.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\n\nimport { PasswordVerificationRequest } from 'jslib/models/request/passwordVerificationRequest';\n\n@Component({\n selector: 'app-two-factor-verify',\n templateUrl: 'two-factor-verify.component.html',\n})\nexport class TwoFactorVerifyComponent {\n @Input() type: TwoFactorProviderType;\n @Input() organizationId: string;\n @Output() onAuthed = new EventEmitter();\n\n masterPassword: string;\n formPromise: Promise;\n\n private masterPasswordHash: string;\n\n constructor(private apiService: ApiService, private i18nService: I18nService,\n private toasterService: ToasterService, private cryptoService: CryptoService) { }\n\n async submit() {\n if (this.masterPassword == null || this.masterPassword === '') {\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'),\n this.i18nService.t('masterPassRequired'));\n return;\n }\n\n const request = new PasswordVerificationRequest();\n request.masterPasswordHash = this.masterPasswordHash =\n await this.cryptoService.hashPassword(this.masterPassword, null);\n\n try {\n switch (this.type) {\n case -1:\n this.formPromise = this.apiService.getTwoFactorRecover(request);\n break;\n case TwoFactorProviderType.Duo:\n case TwoFactorProviderType.OrganizationDuo:\n if (this.organizationId != null) {\n this.formPromise = this.apiService.getTwoFactorOrganizationDuo(this.organizationId, request);\n } else {\n this.formPromise = this.apiService.getTwoFactorDuo(request);\n }\n break;\n case TwoFactorProviderType.Email:\n this.formPromise = this.apiService.getTwoFactorEmail(request);\n break;\n case TwoFactorProviderType.U2f:\n this.formPromise = this.apiService.getTwoFactorU2f(request);\n break;\n case TwoFactorProviderType.Authenticator:\n this.formPromise = this.apiService.getTwoFactorAuthenticator(request);\n break;\n case TwoFactorProviderType.Yubikey:\n this.formPromise = this.apiService.getTwoFactorYubiKey(request);\n break;\n }\n\n const response = await this.formPromise;\n this.onAuthed.emit({\n response: response,\n masterPasswordHash: this.masterPasswordHash,\n });\n } catch { }\n }\n}\n","import { CollectionDetailsResponse } from '../response/collectionResponse';\n\nexport class CollectionData {\n id: string;\n organizationId: string;\n name: string;\n readOnly: boolean;\n\n constructor(response: CollectionDetailsResponse) {\n this.id = response.id;\n this.organizationId = response.organizationId;\n this.name = response.name;\n this.readOnly = response.readOnly;\n }\n}\n","import {\n Component,\n Input,\n OnInit,\n} from '@angular/core';\n\nimport { I18nService } from 'jslib/abstractions/i18n.service';\nimport { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';\n\nconst Keys = {\n stripeTest: 'pk_test_KPoCfZXu7mznb9uSCPZ2JpTD',\n stripeLive: 'pk_live_bpN0P37nMxrMQkcaHXtAybJk',\n btSandbox: 'sandbox_r72q8jq6_9pnxkwm75f87sdc2',\n btProduction: 'production_qfbsv8kc_njj2zjtyngtjmbjd',\n};\n\n@Component({\n selector: 'app-payment',\n templateUrl: 'payment.component.html',\n})\nexport class PaymentComponent implements OnInit {\n @Input() showOptions = true;\n @Input() method: 'card' | 'paypal' | 'bank' = 'card';\n @Input() hideBank = false;\n @Input() hidePaypal = false;\n\n card: any = {\n number: null,\n exp_month: null,\n exp_year: null,\n address_country: '',\n address_zip: null,\n };\n bank: any = {\n routing_number: null,\n account_number: null,\n account_holder_name: null,\n account_holder_type: '',\n currency: 'USD',\n country: 'US',\n };\n cardExpMonthOptions: any[];\n cardExpYearOptions: any[];\n\n private stripeScript: HTMLScriptElement;\n private btScript: HTMLScriptElement;\n private btInstance: any = null;\n\n constructor(i18nService: I18nService, private platformUtilsService: PlatformUtilsService) {\n this.stripeScript = window.document.createElement('script');\n this.stripeScript.src = 'https://js.stripe.com/v2/';\n this.stripeScript.async = true;\n this.stripeScript.onload = () => {\n (window as any).Stripe.setPublishableKey(\n this.platformUtilsService.isDev() ? Keys.stripeTest : Keys.stripeLive);\n };\n this.btScript = window.document.createElement('script');\n this.btScript.src = 'https://js.braintreegateway.com/web/dropin/1.4.0/js/dropin.min.js';\n this.btScript.async = true;\n\n this.cardExpMonthOptions = [\n { name: '-- ' + i18nService.t('select') + ' --', value: null },\n { name: '01 - ' + i18nService.t('january'), value: '01' },\n { name: '02 - ' + i18nService.t('february'), value: '02' },\n { name: '03 - ' + i18nService.t('march'), value: '03' },\n { name: '04 - ' + i18nService.t('april'), value: '04' },\n { name: '05 - ' + i18nService.t('may'), value: '05' },\n { name: '06 - ' + i18nService.t('june'), value: '06' },\n { name: '07 - ' + i18nService.t('july'), value: '07' },\n { name: '08 - ' + i18nService.t('august'), value: '08' },\n { name: '09 - ' + i18nService.t('september'), value: '09' },\n { name: '10 - ' + i18nService.t('october'), value: '10' },\n { name: '11 - ' + i18nService.t('november'), value: '11' },\n { name: '12 - ' + i18nService.t('december'), value: '12' },\n ];\n\n this.cardExpYearOptions = [\n { name: '-- ' + i18nService.t('select') + ' --', value: null },\n ];\n const year = (new Date()).getFullYear();\n for (let i = year; i < (year + 15); i++) {\n this.cardExpYearOptions.push({ name: i.toString(), value: i.toString().slice(-2) });\n }\n }\n\n ngOnInit() {\n if (!this.showOptions) {\n this.hidePaypal = this.method !== 'paypal';\n this.hideBank = this.method !== 'bank';\n }\n window.document.head.appendChild(this.stripeScript);\n if (!this.hidePaypal) {\n window.document.head.appendChild(this.btScript);\n }\n }\n\n ngOnDestroy() {\n window.document.head.removeChild(this.stripeScript);\n Array.from(window.document.querySelectorAll('iframe')).forEach((el) => {\n if (el.src != null && el.src.indexOf('stripe') > -1) {\n window.document.body.removeChild(el);\n }\n });\n if (!this.hidePaypal) {\n window.document.head.removeChild(this.btScript);\n const btStylesheet = window.document.head.querySelector('#braintree-dropin-stylesheet');\n if (btStylesheet != null) {\n window.document.head.removeChild(btStylesheet);\n }\n }\n }\n\n changeMethod() {\n if (this.method !== 'paypal') {\n this.btInstance = null;\n return;\n }\n\n window.setTimeout(() => {\n (window as any).braintree.dropin.create({\n authorization: this.platformUtilsService.isDev() ? Keys.btSandbox : Keys.btProduction,\n container: '#bt-dropin-container',\n paymentOptionPriority: ['paypal'],\n paypal: {\n flow: 'vault',\n buttonStyle: {\n label: 'pay',\n size: 'medium',\n shape: 'pill',\n color: 'blue',\n },\n },\n }, (createErr: any, instance: any) => {\n if (createErr != null) {\n // tslint:disable-next-line\n console.error(createErr);\n return;\n }\n this.btInstance = instance;\n });\n }, 250);\n }\n\n createPaymentToken(): Promise {\n return new Promise((resolve, reject) => {\n if (this.method === 'paypal') {\n this.btInstance.requestPaymentMethod().then((payload: any) => {\n resolve(payload.nonce);\n }).catch((err: any) => {\n reject(err.message);\n });\n } else if (this.method === 'card' || this.method === 'bank') {\n const createObj: any = this.method === 'card' ? (window as any).Stripe.card :\n (window as any).Stripe.bankAccount;\n const sourceObj = this.method === 'card' ? this.card : this.bank;\n createObj.createToken(sourceObj, (status: number, response: any) => {\n if (status === 200 && response.id != null) {\n resolve(response.id);\n } else if (response.error != null) {\n reject(response.error.message);\n } else {\n reject();\n }\n });\n }\n });\n }\n\n getCountry(): string {\n return this.card.address_country;\n }\n}\n","import { View } from './view';\r\n\r\nimport { Folder } from '../domain/folder';\r\n\r\nexport class FolderView implements View {\r\n id: string = null;\r\n name: string;\r\n\r\n constructor(f?: Folder) {\r\n if (!f) {\r\n return;\r\n }\r\n\r\n this.id = f.id;\r\n }\r\n}\r\n","import { BreachAccountResponse } from '../models/response/breachAccountResponse';\n\nexport abstract class AuditService {\n passwordLeaked: (password: string) => Promise;\n breachedAccounts: (username: string) => Promise;\n}\n","","export abstract class EnvironmentService {\n baseUrl: string;\n webVaultUrl: string;\n apiUrl: string;\n identityUrl: string;\n iconsUrl: string;\n\n getWebVaultUrl: () => string;\n setUrlsFromStorage: () => Promise;\n setUrls: (urls: any) => Promise;\n}\n","
\n
\n

{{'twoStepLoginAuthDesc' | i18n}}

\n \n \n
\n
\n \n \n
\n
\n","import { CipherType } from '../../enums/cipherType';\n\nimport { CipherData } from '../data/cipherData';\n\nimport { CipherView } from '../view/cipherView';\n\nimport { Attachment } from './attachment';\nimport { Card } from './card';\nimport { CipherString } from './cipherString';\nimport Domain from './domain';\nimport { Field } from './field';\nimport { Identity } from './identity';\nimport { Login } from './login';\nimport { SecureNote } from './secureNote';\n\nexport class Cipher extends Domain {\n id: string;\n organizationId: string;\n folderId: string;\n name: CipherString;\n notes: CipherString;\n type: CipherType;\n favorite: boolean;\n organizationUseTotp: boolean;\n edit: boolean;\n revisionDate: Date;\n localData: any;\n login: Login;\n identity: Identity;\n card: Card;\n secureNote: SecureNote;\n attachments: Attachment[];\n fields: Field[];\n collectionIds: string[];\n\n constructor(obj?: CipherData, alreadyEncrypted: boolean = false, localData: any = null) {\n super();\n if (obj == null) {\n return;\n }\n\n this.buildDomainModel(this, obj, {\n id: null,\n userId: null,\n organizationId: null,\n folderId: null,\n name: null,\n notes: null,\n }, alreadyEncrypted, ['id', 'userId', 'organizationId', 'folderId']);\n\n this.type = obj.type;\n this.favorite = obj.favorite;\n this.organizationUseTotp = obj.organizationUseTotp;\n this.edit = obj.edit;\n this.revisionDate = obj.revisionDate;\n this.collectionIds = obj.collectionIds;\n this.localData = localData;\n\n switch (this.type) {\n case CipherType.Login:\n this.login = new Login(obj.login, alreadyEncrypted);\n break;\n case CipherType.SecureNote:\n this.secureNote = new SecureNote(obj.secureNote, alreadyEncrypted);\n break;\n case CipherType.Card:\n this.card = new Card(obj.card, alreadyEncrypted);\n break;\n case CipherType.Identity:\n this.identity = new Identity(obj.identity, alreadyEncrypted);\n break;\n default:\n break;\n }\n\n if (obj.attachments != null) {\n this.attachments = [];\n obj.attachments.forEach((attachment) => {\n this.attachments.push(new Attachment(attachment, alreadyEncrypted));\n });\n } else {\n this.attachments = null;\n }\n\n if (obj.fields != null) {\n this.fields = [];\n obj.fields.forEach((field) => {\n this.fields.push(new Field(field, alreadyEncrypted));\n });\n } else {\n this.fields = null;\n }\n }\n\n async decrypt(): Promise {\n const model = new CipherView(this);\n\n await this.decryptObj(model, {\n name: null,\n notes: null,\n }, this.organizationId);\n\n switch (this.type) {\n case CipherType.Login:\n model.login = await this.login.decrypt(this.organizationId);\n break;\n case CipherType.SecureNote:\n model.secureNote = await this.secureNote.decrypt(this.organizationId);\n break;\n case CipherType.Card:\n model.card = await this.card.decrypt(this.organizationId);\n break;\n case CipherType.Identity:\n model.identity = await this.identity.decrypt(this.organizationId);\n break;\n default:\n break;\n }\n\n const orgId = this.organizationId;\n\n if (this.attachments != null && this.attachments.length > 0) {\n const attachments: any[] = [];\n await this.attachments.reduce((promise, attachment) => {\n return promise.then(() => {\n return attachment.decrypt(orgId);\n }).then((decAttachment) => {\n attachments.push(decAttachment);\n });\n }, Promise.resolve());\n model.attachments = attachments;\n }\n\n if (this.fields != null && this.fields.length > 0) {\n const fields: any[] = [];\n await this.fields.reduce((promise, field) => {\n return promise.then(() => {\n return field.decrypt(orgId);\n }).then((decField) => {\n fields.push(decField);\n });\n }, Promise.resolve());\n model.fields = fields;\n }\n\n return model;\n }\n\n toCipherData(userId: string): CipherData {\n const c = new CipherData();\n c.id = this.id;\n c.organizationId = this.organizationId;\n c.folderId = this.folderId;\n c.userId = this.organizationId != null ? userId : null;\n c.edit = this.edit;\n c.organizationUseTotp = this.organizationUseTotp;\n c.favorite = this.favorite;\n c.revisionDate = this.revisionDate;\n c.type = this.type;\n c.collectionIds = this.collectionIds;\n\n this.buildDataModel(this, c, {\n name: null,\n notes: null,\n });\n\n switch (c.type) {\n case CipherType.Login:\n c.login = this.login.toLoginData();\n break;\n case CipherType.SecureNote:\n c.secureNote = this.secureNote.toSecureNoteData();\n break;\n case CipherType.Card:\n c.card = this.card.toCardData();\n break;\n case CipherType.Identity:\n c.identity = this.identity.toIdentityData();\n break;\n default:\n break;\n }\n\n if (this.fields != null) {\n c.fields = [];\n this.fields.forEach((field) => {\n c.fields.push(field.toFieldData());\n });\n }\n\n if (this.attachments != null) {\n c.attachments = [];\n this.attachments.forEach((attachment) => {\n c.attachments.push(attachment.toAttachmentData());\n });\n }\n return c;\n }\n}\n","import { CollectionData } from '../data/collectionData';\n\nimport { CollectionView } from '../view/collectionView';\n\nimport { CipherString } from './cipherString';\nimport Domain from './domain';\n\nexport class Collection extends Domain {\n id: string;\n organizationId: string;\n name: CipherString;\n readOnly: boolean;\n\n constructor(obj?: CollectionData, alreadyEncrypted: boolean = false) {\n super();\n if (obj == null) {\n return;\n }\n\n this.buildDomainModel(this, obj, {\n id: null,\n organizationId: null,\n name: null,\n readOnly: null,\n }, alreadyEncrypted, ['id', 'organizationId', 'readOnly']);\n }\n\n decrypt(): Promise {\n return this.decryptObj(new CollectionView(this), {\n name: null,\n }, this.organizationId);\n }\n}\n","import { LoginUriView } from './loginUriView';\r\nimport { View } from './view';\r\n\r\nimport { Login } from '../domain/login';\r\n\r\nimport { PlatformUtilsService } from '../../abstractions/platformUtils.service';\r\n\r\nexport class LoginView implements View {\r\n username: string;\r\n password: string;\r\n totp: string;\r\n uris: LoginUriView[];\r\n\r\n constructor(l?: Login) {\r\n // ctor\r\n }\r\n\r\n get uri(): string {\r\n return this.hasUris ? this.uris[0].uri : null;\r\n }\r\n\r\n get maskedPassword(): string {\r\n return this.password != null ? '••••••••' : null;\r\n }\r\n\r\n get subTitle(): string {\r\n return this.username;\r\n }\r\n\r\n get canLaunch(): boolean {\r\n return this.hasUris && this.uris[0].canLaunch;\r\n }\r\n\r\n get hasUris(): boolean {\r\n return this.uris != null && this.uris.length > 0;\r\n }\r\n}\r\n","import { CipherType } from '../../enums/cipherType';\n\nimport { Cipher } from '../domain/cipher';\n\nimport { AttachmentView } from './attachmentView';\nimport { CardView } from './cardView';\nimport { FieldView } from './fieldView';\nimport { IdentityView } from './identityView';\nimport { LoginView } from './loginView';\nimport { SecureNoteView } from './secureNoteView';\nimport { View } from './view';\n\nexport class CipherView implements View {\n id: string;\n organizationId: string;\n folderId: string;\n name: string;\n notes: string;\n type: CipherType;\n favorite = false;\n organizationUseTotp = false;\n edit = false;\n localData: any;\n login: LoginView;\n identity: IdentityView;\n card: CardView;\n secureNote: SecureNoteView;\n attachments: AttachmentView[];\n fields: FieldView[];\n collectionIds: string[];\n\n constructor(c?: Cipher) {\n if (!c) {\n return;\n }\n\n this.id = c.id;\n this.organizationId = c.organizationId;\n this.folderId = c.folderId;\n this.favorite = c.favorite;\n this.organizationUseTotp = c.organizationUseTotp;\n this.edit = c.edit;\n this.type = c.type;\n this.localData = c.localData;\n this.collectionIds = c.collectionIds;\n }\n\n get subTitle(): string {\n switch (this.type) {\n case CipherType.Login:\n return this.login.subTitle;\n case CipherType.SecureNote:\n return this.secureNote.subTitle;\n case CipherType.Card:\n return this.card.subTitle;\n case CipherType.Identity:\n return this.identity.subTitle;\n default:\n break;\n }\n\n return null;\n }\n\n get hasAttachments(): boolean {\n return this.attachments && this.attachments.length > 0;\n }\n\n get hasFields(): boolean {\n return this.fields && this.fields.length > 0;\n }\n\n get login_username(): string {\n return this.login != null ? this.login.username : null;\n }\n}\n","import { CipherType } from '../../enums/cipherType';\n\nimport { Cipher } from '../domain/cipher';\n\nimport { CardApi } from '../api/cardApi';\nimport { FieldApi } from '../api/fieldApi';\nimport { IdentityApi } from '../api/identityApi';\nimport { LoginApi } from '../api/loginApi';\nimport { SecureNoteApi } from '../api/secureNoteApi';\n\nexport class CipherRequest {\n type: CipherType;\n folderId: string;\n organizationId: string;\n name: string;\n notes: string;\n favorite: boolean;\n login: LoginApi;\n secureNote: SecureNoteApi;\n card: CardApi;\n identity: IdentityApi;\n fields: FieldApi[];\n attachments: { [id: string]: string; };\n\n constructor(cipher: Cipher) {\n this.type = cipher.type;\n this.folderId = cipher.folderId;\n this.organizationId = cipher.organizationId;\n this.name = cipher.name ? cipher.name.encryptedString : null;\n this.notes = cipher.notes ? cipher.notes.encryptedString : null;\n this.favorite = cipher.favorite;\n\n switch (this.type) {\n case CipherType.Login:\n this.login = {\n uris: null,\n username: cipher.login.username ? cipher.login.username.encryptedString : null,\n password: cipher.login.password ? cipher.login.password.encryptedString : null,\n totp: cipher.login.totp ? cipher.login.totp.encryptedString : null,\n };\n\n if (cipher.login.uris) {\n this.login.uris = [];\n cipher.login.uris.forEach((u) => {\n this.login.uris.push({\n uri: u.uri ? u.uri.encryptedString : null,\n match: u.match != null ? u.match : null,\n });\n });\n }\n break;\n case CipherType.SecureNote:\n this.secureNote = {\n type: cipher.secureNote.type,\n };\n break;\n case CipherType.Card:\n this.card = {\n cardholderName: cipher.card.cardholderName ? cipher.card.cardholderName.encryptedString : null,\n brand: cipher.card.brand ? cipher.card.brand.encryptedString : null,\n number: cipher.card.number ? cipher.card.number.encryptedString : null,\n expMonth: cipher.card.expMonth ? cipher.card.expMonth.encryptedString : null,\n expYear: cipher.card.expYear ? cipher.card.expYear.encryptedString : null,\n code: cipher.card.code ? cipher.card.code.encryptedString : null,\n };\n break;\n case CipherType.Identity:\n this.identity = {\n title: cipher.identity.title ? cipher.identity.title.encryptedString : null,\n firstName: cipher.identity.firstName ? cipher.identity.firstName.encryptedString : null,\n middleName: cipher.identity.middleName ? cipher.identity.middleName.encryptedString : null,\n lastName: cipher.identity.lastName ? cipher.identity.lastName.encryptedString : null,\n address1: cipher.identity.address1 ? cipher.identity.address1.encryptedString : null,\n address2: cipher.identity.address2 ? cipher.identity.address2.encryptedString : null,\n address3: cipher.identity.address3 ? cipher.identity.address3.encryptedString : null,\n city: cipher.identity.city ? cipher.identity.city.encryptedString : null,\n state: cipher.identity.state ? cipher.identity.state.encryptedString : null,\n postalCode: cipher.identity.postalCode ? cipher.identity.postalCode.encryptedString : null,\n country: cipher.identity.country ? cipher.identity.country.encryptedString : null,\n company: cipher.identity.company ? cipher.identity.company.encryptedString : null,\n email: cipher.identity.email ? cipher.identity.email.encryptedString : null,\n phone: cipher.identity.phone ? cipher.identity.phone.encryptedString : null,\n ssn: cipher.identity.ssn ? cipher.identity.ssn.encryptedString : null,\n username: cipher.identity.username ? cipher.identity.username.encryptedString : null,\n passportNumber: cipher.identity.passportNumber ?\n cipher.identity.passportNumber.encryptedString : null,\n licenseNumber: cipher.identity.licenseNumber ? cipher.identity.licenseNumber.encryptedString : null,\n };\n break;\n default:\n break;\n }\n\n if (cipher.fields) {\n this.fields = [];\n cipher.fields.forEach((field) => {\n this.fields.push({\n type: field.type,\n name: field.name ? field.name.encryptedString : null,\n value: field.value ? field.value.encryptedString : null,\n });\n });\n }\n\n if (cipher.attachments) {\n this.attachments = {};\n cipher.attachments.forEach((attachment) => {\n this.attachments[attachment.id] = attachment.fileName ? attachment.fileName.encryptedString : null;\n });\n }\n }\n}\n","export enum DeviceType {\n Android = 0,\n iOS = 1,\n ChromeExtension = 2,\n FirefoxExtension = 3,\n OperaExtension = 4,\n EdgeExtension = 5,\n WindowsDesktop = 6,\n MacOsDesktop = 7,\n LinuxDesktop = 8,\n ChromeBrowser = 9,\n FirefoxBrowser = 10,\n OperaBrowser = 11,\n EdgeBrowser = 12,\n IEBrowser = 13,\n UnknownBrowser = 14,\n AndroidAmazon = 15,\n UWP = 16,\n SafariBrowser = 17,\n VivaldiBrowser = 18,\n VivaldiExtension = 19,\n SafariExtension = 20,\n}\n","import { Injectable } from '@angular/core';\n\n@Injectable()\nexport class BroadcasterService {\n subscribers: Map any> = new Map any>();\n\n send(message: any, id?: string) {\n if (id != null) {\n if (this.subscribers.has(id)) {\n this.subscribers.get(id)(message);\r\n }\n return;\r\n }\n\n this.subscribers.forEach((value) => {\n value(message);\n });\r\n }\n\n subscribe(id: string, messageCallback: (message: any) => any) {\n if (this.subscribers.has(id)) {\n return;\r\n }\n\n this.subscribers.set(id, messageCallback);\r\n }\n\n unsubscribe(id: string) {\n if (this.subscribers.has(id)) {\n this.subscribers.delete(id);\r\n }\r\n }\n}\r\n","export enum OrganizationUserType {\n Owner = 0,\n Admin = 1,\n User = 2,\n}\n","import { Injectable } from '@angular/core';\n\nimport { I18nService } from 'jslib/abstractions/i18n.service';\n\nimport { DeviceType } from 'jslib/enums/deviceType';\nimport { EventType } from 'jslib/enums/eventType';\n\nimport { EventResponse } from 'jslib/models/response/eventResponse';\n\n@Injectable()\nexport class EventService {\n constructor(private i18nService: I18nService) { }\n\n getDefaultDateFilters() {\n const d = new Date();\n const end = new Date(d.getFullYear(), d.getMonth(), d.getDate(), 23, 59);\n d.setDate(d.getDate() - 30);\n const start = new Date(d.getFullYear(), d.getMonth(), d.getDate(), 0, 0);\n return [this.toDateTimeLocalString(start), this.toDateTimeLocalString(end)];\n }\n\n formatDateFilters(filterStart: string, filterEnd: string) {\n const start: Date = new Date(filterStart);\n const end: Date = new Date(filterEnd + ':59.999');\n if (isNaN(start.getTime()) || isNaN(end.getTime()) || end < start) {\n throw new Error('Invalid date range.');\n }\n return [start.toISOString(), end.toISOString()];\n }\n\n getEventInfo(ev: EventResponse, options = new EventOptions()): EventInfo {\n const appInfo = this.getAppInfo(ev.deviceType);\n return {\n message: this.getEventMessage(ev, options),\n appIcon: appInfo[0],\n appName: appInfo[1],\n };\n }\n\n private getEventMessage(ev: EventResponse, options: EventOptions) {\n let msg = '';\n switch (ev.type) {\n // User\n case EventType.User_LoggedIn:\n msg = this.i18nService.t('loggedIn');\n break;\n case EventType.User_ChangedPassword:\n msg = this.i18nService.t('changedPassword');\n break;\n case EventType.User_Enabled2fa:\n msg = this.i18nService.t('enabled2fa');\n break;\n case EventType.User_Disabled2fa:\n msg = this.i18nService.t('disabled2fa');\n break;\n case EventType.User_Recovered2fa:\n msg = this.i18nService.t('recovered2fa');\n break;\n case EventType.User_FailedLogIn:\n msg = this.i18nService.t('failedLogin');\n break;\n case EventType.User_FailedLogIn2fa:\n msg = this.i18nService.t('failedLogin2fa');\n break;\n // Cipher\n case EventType.Cipher_Created:\n msg = this.i18nService.t('createdItemId', this.formatCipherId(ev, options));\n break;\n case EventType.Cipher_Updated:\n msg = this.i18nService.t('editedItemId', this.formatCipherId(ev, options));\n break;\n case EventType.Cipher_Deleted:\n msg = this.i18nService.t('deletedItemId', this.formatCipherId(ev, options));\n break;\n case EventType.Cipher_AttachmentCreated:\n msg = this.i18nService.t('createdAttachmentForItem', this.formatCipherId(ev, options));\n break;\n case EventType.Cipher_AttachmentDeleted:\n msg = this.i18nService.t('deletedAttachmentForItem', this.formatCipherId(ev, options));\n break;\n case EventType.Cipher_Shared:\n msg = this.i18nService.t('sharedItemId', this.formatCipherId(ev, options));\n break;\n case EventType.Cipher_UpdatedCollections:\n msg = this.i18nService.t('editedCollectionsForItem', this.formatCipherId(ev, options));\n break;\n // Collection\n case EventType.Collection_Created:\n msg = this.i18nService.t('createdCollectionId', this.formatCollectionId(ev));\n break;\n case EventType.Collection_Updated:\n msg = this.i18nService.t('editedCollectionId', this.formatCollectionId(ev));\n break;\n case EventType.Collection_Deleted:\n msg = this.i18nService.t('deletedCollectionId', this.formatCollectionId(ev));\n break;\n // Group\n case EventType.Group_Created:\n msg = this.i18nService.t('createdGroupId', this.formatGroupId(ev));\n break;\n case EventType.Group_Updated:\n msg = this.i18nService.t('editedGroupId', this.formatGroupId(ev));\n break;\n case EventType.Group_Deleted:\n msg = this.i18nService.t('deletedGroupId', this.formatGroupId(ev));\n break;\n // Org user\n case EventType.OrganizationUser_Invited:\n msg = this.i18nService.t('invitedUserId', this.formatOrgUserId(ev));\n break;\n case EventType.OrganizationUser_Confirmed:\n msg = this.i18nService.t('confirmedUserId', this.formatOrgUserId(ev));\n break;\n case EventType.OrganizationUser_Updated:\n msg = this.i18nService.t('editedUserId', this.formatOrgUserId(ev));\n break;\n case EventType.OrganizationUser_Removed:\n msg = this.i18nService.t('removedUserId', this.formatOrgUserId(ev));\n break;\n case EventType.OrganizationUser_UpdatedGroups:\n msg = this.i18nService.t('editedGroupsForUser', this.formatOrgUserId(ev));\n break;\n // Org\n case EventType.Organization_Updated:\n msg = this.i18nService.t('editedOrgSettings');\n break;\n default:\n break;\n }\n return msg === '' ? null : msg;\n }\n\n private getAppInfo(deviceType: DeviceType): [string, string] {\n switch (deviceType) {\n case DeviceType.Android:\n return ['fa-android', this.i18nService.t('mobile') + ' - Android'];\n case DeviceType.iOS:\n return ['fa-apple', this.i18nService.t('mobile') + ' - iOS'];\n case DeviceType.UWP:\n return ['fa-windows', this.i18nService.t('mobile') + ' - Windows'];\n case DeviceType.ChromeExtension:\n return ['fa-chrome', this.i18nService.t('extension') + ' - Chrome'];\n case DeviceType.FirefoxExtension:\n return ['fa-firefox', this.i18nService.t('extension') + ' - Firefox'];\n case DeviceType.OperaExtension:\n return ['fa-opera', this.i18nService.t('extension') + ' - Opera'];\n case DeviceType.EdgeExtension:\n return ['fa-edge', this.i18nService.t('extension') + ' - Edge'];\n case DeviceType.VivaldiExtension:\n return ['fa-puzzle-piece', this.i18nService.t('extension') + ' - Vivaldi'];\n case DeviceType.SafariExtension:\n return ['fa-safari', this.i18nService.t('extension') + ' - Safari'];\n case DeviceType.WindowsDesktop:\n return ['fa-windows', this.i18nService.t('desktop') + ' - Windows'];\n case DeviceType.MacOsDesktop:\n return ['fa-apple', this.i18nService.t('desktop') + ' - macOS'];\n case DeviceType.LinuxDesktop:\n return ['fa-linux', this.i18nService.t('desktop') + ' - Linux'];\n case DeviceType.ChromeBrowser:\n return ['fa-globe', this.i18nService.t('webVault') + ' - Chrome'];\n case DeviceType.FirefoxBrowser:\n return ['fa-globe', this.i18nService.t('webVault') + ' - Firefox'];\n case DeviceType.OperaBrowser:\n return ['fa-globe', this.i18nService.t('webVault') + ' - Opera'];\n case DeviceType.SafariBrowser:\n return ['fa-globe', this.i18nService.t('webVault') + ' - Safari'];\n case DeviceType.VivaldiBrowser:\n return ['fa-globe', this.i18nService.t('webVault') + ' - Vivaldi'];\n case DeviceType.EdgeBrowser:\n return ['fa-globe', this.i18nService.t('webVault') + ' - Edge'];\n case DeviceType.IEBrowser:\n return ['fa-globe', this.i18nService.t('webVault') + ' - IE'];\n case DeviceType.UnknownBrowser:\n return ['fa-globe', this.i18nService.t('webVault') + ' - ' + this.i18nService.t('unknown')];\n default:\n return ['fa-globe', this.i18nService.t('unknown')];\n }\n }\n\n private formatCipherId(ev: EventResponse, options: EventOptions) {\n const shortId = this.getShortId(ev.cipherId);\n if (ev.organizationId == null || !options.cipherInfo) {\n return '' + shortId + '';\n }\n const a = this.makeAnchor(shortId);\n a.setAttribute('href', '#/organizations/' + ev.organizationId + '/vault?search=' + shortId +\n '&viewEvents=' + ev.cipherId);\n return a.outerHTML;\n }\n\n private formatGroupId(ev: EventResponse) {\n const shortId = this.getShortId(ev.groupId);\n const a = this.makeAnchor(shortId);\n a.setAttribute('href', '#/organizations/' + ev.organizationId + '/manage/groups?search=' + shortId);\n return a.outerHTML;\n }\n\n private formatCollectionId(ev: EventResponse) {\n const shortId = this.getShortId(ev.collectionId);\n const a = this.makeAnchor(shortId);\n a.setAttribute('href', '#/organizations/' + ev.organizationId + '/manage/collections?search=' + shortId);\n return a.outerHTML;\n }\n\n private formatOrgUserId(ev: EventResponse) {\n const shortId = this.getShortId(ev.organizationUserId);\n const a = this.makeAnchor(shortId);\n a.setAttribute('href', '#/organizations/' + ev.organizationId + '/manage/people?search=' + shortId +\n '&viewEvents=' + ev.organizationUserId);\n return a.outerHTML;\n }\n\n private makeAnchor(shortId: string) {\n const a = document.createElement('a');\n a.title = this.i18nService.t('view');\n a.innerHTML = '' + shortId + '';\n return a;\n }\n\n private getShortId(id: string) {\n return id.substring(0, 8);\n }\n\n private toDateTimeLocalString(date: Date) {\n return date.getFullYear() +\n '-' + this.pad(date.getMonth() + 1) +\n '-' + this.pad(date.getDate()) +\n 'T' + this.pad(date.getHours()) +\n ':' + this.pad(date.getMinutes());\n }\n\n private pad(num: number) {\n const norm = Math.floor(Math.abs(num));\n return (norm < 10 ? '0' : '') + norm;\n }\n}\n\nexport class EventInfo {\n message: string;\n appIcon: string;\n appName: string;\n}\n\nexport class EventOptions {\n cipherInfo = true;\n}\n","export abstract class ExportService {\n getExport: (format?: 'csv' | 'json') => Promise;\n getOrganizationExport: (organizationId: string, format?: 'csv' | 'json') => Promise;\n getFileName: (prefix?: string) => string;\n}\n","import { View } from './view';\n\nimport { Collection } from '../domain/collection';\n\nexport class CollectionView implements View {\n id: string;\n organizationId: string;\n name: string;\n readOnly: boolean;\n\n constructor(c?: Collection) {\n if (!c) {\n return;\n }\n\n this.id = c.id;\n this.organizationId = c.organizationId;\n this.readOnly = c.readOnly;\n }\n}\n","import {\n EventEmitter,\n Output,\n} from '@angular/core';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\nimport { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';\n\nimport { TwoFactorProviderType } from 'jslib/enums/twoFactorProviderType';\nimport { TwoFactorProviderRequest } from 'jslib/models/request/twoFactorProviderRequest';\n\nexport abstract class TwoFactorBaseComponent {\n @Output() onUpdated = new EventEmitter();\n\n type: TwoFactorProviderType;\n organizationId: string;\n twoFactorProviderType = TwoFactorProviderType;\n enabled = false;\n authed = false;\n\n protected masterPasswordHash: string;\n\n constructor(protected apiService: ApiService, protected i18nService: I18nService,\n protected analytics: Angulartics2, protected toasterService: ToasterService,\n protected platformUtilsService: PlatformUtilsService) { }\n\n protected auth(authResponse: any) {\n this.masterPasswordHash = authResponse.masterPasswordHash;\n this.authed = true;\n }\n\n protected async enable(enableFunction: () => Promise) {\n try {\n await enableFunction();\n this.analytics.eventTrack.next({\n action: 'Enabled Two-step ' + TwoFactorProviderType[this.type].toString(),\n });\n this.onUpdated.emit(true);\n } catch { }\n }\n\n protected async disable(promise: Promise) {\n const confirmed = await this.platformUtilsService.showDialog(this.i18nService.t('twoStepDisableDesc'),\n this.i18nService.t('disable'), this.i18nService.t('yes'), this.i18nService.t('no'), 'warning');\n if (!confirmed) {\n return;\n }\n\n try {\n const request = new TwoFactorProviderRequest();\n request.masterPasswordHash = this.masterPasswordHash;\n request.type = this.type;\n if (this.organizationId != null) {\n promise = this.apiService.putTwoFactorOrganizationDisable(this.organizationId, request);\n } else {\n promise = this.apiService.putTwoFactorDisable(request);\n }\n await promise;\n this.enabled = false;\n this.analytics.eventTrack.next({\n action: 'Disabled Two-step ' + TwoFactorProviderType[this.type].toString(),\n });\n this.toasterService.popAsync('success', null, this.i18nService.t('twoStepDisabled'));\n this.onUpdated.emit(false);\n } catch { }\n }\n}\n","import { FieldType } from '../../enums/fieldType';\r\n\r\nimport { View } from './view';\r\n\r\nimport { Field } from '../domain/field';\r\n\r\nexport class FieldView implements View {\r\n name: string;\r\n value: string;\r\n type: FieldType;\r\n\r\n constructor(f?: Field) {\r\n if (!f) {\r\n return;\r\n }\r\n\r\n this.type = f.type;\r\n }\r\n\r\n get maskedValue(): string {\r\n return this.value != null ? '••••••••' : null;\r\n }\r\n}\r\n","export abstract class TotpService {\r\n getCode: (keyb32: string) => Promise;\r\n isAutoCopyEnabled: () => Promise;\r\n}\r\n","import {\n Component,\n Input,\n OnInit,\n} from '@angular/core';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\nimport { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';\nimport { SyncService } from 'jslib/abstractions/sync.service';\nimport { UserService } from 'jslib/abstractions/user.service';\n\nimport { Organization } from 'jslib/models/domain/organization';\n\nimport { Utils } from 'jslib/misc/utils';\n\n@Component({\n selector: 'app-organizations',\n templateUrl: 'organizations.component.html',\n})\nexport class OrganizationsComponent implements OnInit {\n @Input() vault = false;\n\n organizations: Organization[];\n loaded: boolean = false;\n actionPromise: Promise;\n\n constructor(private userService: UserService, private platformUtilsService: PlatformUtilsService,\n private i18nService: I18nService, private apiService: ApiService,\n private analytics: Angulartics2, private toasterService: ToasterService,\n private syncService: SyncService) { }\n\n async ngOnInit() {\n if (!this.vault) {\n await this.load();\n }\n }\n\n async load() {\n const orgs = await this.userService.getAllOrganizations();\n orgs.sort(Utils.getSortFunction(this.i18nService, 'name'));\n this.organizations = orgs;\n this.loaded = true;\n }\n\n async leave(org: Organization) {\n const confirmed = await this.platformUtilsService.showDialog(\n this.i18nService.t('leaveOrganizationConfirmation'), org.name,\n this.i18nService.t('yes'), this.i18nService.t('no'), 'warning');\n if (!confirmed) {\n return false;\n }\n\n try {\n this.actionPromise = this.apiService.postLeaveOrganization(org.id).then(() => {\n return this.syncService.fullSync(true);\n });\n await this.actionPromise;\n this.analytics.eventTrack.next({ action: 'Left Organization' });\n this.toasterService.popAsync('success', null, this.i18nService.t('leftOrganization'));\n await this.load();\n } catch { }\n }\n}\n","import { Injectable } from '@angular/core';\r\nimport { Title } from '@angular/platform-browser';\r\nimport {\r\n ActivatedRoute,\r\n NavigationEnd,\r\n Router,\r\n} from '@angular/router';\r\n\r\nimport { I18nService } from 'jslib/abstractions/i18n.service';\r\n\r\n@Injectable()\r\nexport class RouterService {\r\n private previousUrl: string = undefined;\r\n private currentUrl: string = undefined;\r\n\r\n constructor(private router: Router, private activatedRoute: ActivatedRoute,\r\n private titleService: Title, private i18nService: I18nService) {\r\n this.currentUrl = this.router.url;\r\n router.events.subscribe((event) => {\r\n if (event instanceof NavigationEnd) {\r\n this.previousUrl = this.currentUrl;\r\n this.currentUrl = event.url;\r\n\r\n let title = i18nService.t('pageTitle', 'Bitwarden');\r\n let titleId: string = null;\r\n let rawTitle: string = null;\r\n let child = this.activatedRoute.firstChild;\r\n while (child != null) {\r\n if (child.firstChild != null) {\r\n child = child.firstChild;\r\n } else if (child.snapshot.data != null && child.snapshot.data.title != null) {\r\n rawTitle = child.snapshot.data.title;\r\n break;\r\n } else if (child.snapshot.data != null && child.snapshot.data.titleId != null) {\r\n titleId = child.snapshot.data.titleId;\r\n break;\r\n } else {\r\n titleId = null;\r\n rawTitle = null;\r\n break;\r\n }\r\n }\r\n\r\n if (titleId != null || rawTitle != null) {\r\n const newTitle = rawTitle != null ? rawTitle : i18nService.t(titleId);\r\n if (newTitle != null && newTitle !== '') {\r\n title = (newTitle + ' | ' + title);\r\n }\r\n }\r\n this.titleService.setTitle(title);\r\n }\r\n });\r\n }\r\n\r\n getPreviousUrl() {\r\n return this.previousUrl;\r\n }\r\n}\r\n","import { EncryptionType } from '../../enums/encryptionType';\r\n\r\nimport { CryptoService } from '../../abstractions/crypto.service';\r\n\r\nimport { Utils } from '../../misc/utils';\r\n\r\nexport class CipherString {\r\n encryptedString?: string;\r\n encryptionType?: EncryptionType;\r\n decryptedValue?: string;\r\n data?: string;\r\n iv?: string;\r\n mac?: string;\r\n\r\n constructor(encryptedStringOrType: string | EncryptionType, data?: string, iv?: string, mac?: string) {\r\n if (data != null) {\r\n // data and header\r\n const encType = encryptedStringOrType as EncryptionType;\r\n this.encryptedString = encType + '.' + data;\r\n\r\n // iv\r\n if (iv != null) {\r\n this.encryptedString += ('|' + iv);\r\n }\r\n\r\n // mac\r\n if (mac != null) {\r\n this.encryptedString += ('|' + mac);\r\n }\r\n\r\n this.encryptionType = encType;\r\n this.data = data;\r\n this.iv = iv;\r\n this.mac = mac;\r\n\r\n return;\r\n }\r\n\r\n this.encryptedString = encryptedStringOrType as string;\r\n if (!this.encryptedString) {\r\n return;\r\n }\r\n\r\n const headerPieces = this.encryptedString.split('.');\r\n let encPieces: string[] = null;\r\n\r\n if (headerPieces.length === 2) {\r\n try {\r\n this.encryptionType = parseInt(headerPieces[0], null);\r\n encPieces = headerPieces[1].split('|');\r\n } catch (e) {\r\n return;\r\n }\r\n } else {\r\n encPieces = this.encryptedString.split('|');\r\n this.encryptionType = encPieces.length === 3 ? EncryptionType.AesCbc128_HmacSha256_B64 :\r\n EncryptionType.AesCbc256_B64;\r\n }\r\n\r\n switch (this.encryptionType) {\r\n case EncryptionType.AesCbc128_HmacSha256_B64:\r\n case EncryptionType.AesCbc256_HmacSha256_B64:\r\n if (encPieces.length !== 3) {\r\n return;\r\n }\r\n\r\n this.iv = encPieces[0];\r\n this.data = encPieces[1];\r\n this.mac = encPieces[2];\r\n break;\r\n case EncryptionType.AesCbc256_B64:\r\n if (encPieces.length !== 2) {\r\n return;\r\n }\r\n\r\n this.iv = encPieces[0];\r\n this.data = encPieces[1];\r\n break;\r\n case EncryptionType.Rsa2048_OaepSha256_B64:\r\n case EncryptionType.Rsa2048_OaepSha1_B64:\r\n if (encPieces.length !== 1) {\r\n return;\r\n }\r\n\r\n this.data = encPieces[0];\r\n break;\r\n default:\r\n return;\r\n }\r\n }\r\n\r\n async decrypt(orgId: string): Promise {\r\n if (this.decryptedValue) {\r\n return Promise.resolve(this.decryptedValue);\r\n }\r\n\r\n let cryptoService: CryptoService;\r\n const containerService = (Utils.global as any).bitwardenContainerService;\r\n if (containerService) {\r\n cryptoService = containerService.getCryptoService();\r\n } else {\r\n throw new Error('global bitwardenContainerService not initialized.');\r\n }\r\n\r\n try {\r\n const orgKey = await cryptoService.getOrgKey(orgId);\r\n this.decryptedValue = await cryptoService.decryptToUtf8(this, orgKey);\r\n } catch (e) {\r\n this.decryptedValue = '[error: cannot decrypt]';\r\n }\r\n return this.decryptedValue;\r\n }\r\n}\r\n","import { ToasterService } from 'angular2-toaster';\r\nimport { Angulartics2 } from 'angulartics2';\r\n\r\nimport { Component } from '@angular/core';\r\n\r\nimport { CryptoService } from 'jslib/abstractions/crypto.service';\r\nimport { ExportService } from 'jslib/abstractions/export.service';\r\nimport { I18nService } from 'jslib/abstractions/i18n.service';\r\nimport { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';\r\nimport { UserService } from 'jslib/abstractions/user.service';\r\n\r\nimport { ExportComponent as BaseExportComponent } from 'jslib/angular/components/export.component';\r\n\r\n@Component({\r\n selector: 'app-export',\r\n templateUrl: 'export.component.html',\r\n})\r\nexport class ExportComponent extends BaseExportComponent {\r\n constructor(analytics: Angulartics2, toasterService: ToasterService,\r\n cryptoService: CryptoService, userService: UserService,\r\n i18nService: I18nService, platformUtilsService: PlatformUtilsService,\r\n exportService: ExportService) {\r\n super(analytics, toasterService, cryptoService, userService, i18nService, platformUtilsService,\r\n exportService, window);\r\n }\r\n\r\n protected saved() {\r\n super.saved();\r\n this.masterPassword = null;\r\n this.toasterService.popAsync('success', null, this.i18nService.t('exportSuccess'));\r\n }\r\n}\r\n","import {\n Component,\n OnInit,\n} from '@angular/core';\nimport { Router } from '@angular/router';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { CipherService } from 'jslib/abstractions/cipher.service';\nimport { FolderService } from 'jslib/abstractions/folder.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\n\nimport { ImportResult } from 'jslib/models/domain/importResult';\n\nimport { CipherRequest } from 'jslib/models/request/cipherRequest';\nimport { FolderRequest } from 'jslib/models/request/folderRequest';\nimport { ImportCiphersRequest } from 'jslib/models/request/importCiphersRequest';\nimport { KvpRequest } from 'jslib/models/request/kvpRequest';\n\nimport { CipherView } from 'jslib/models/view/cipherView';\n\nimport { AscendoCsvImporter } from 'jslib/importers/ascendoCsvImporter';\nimport { AviraCsvImporter } from 'jslib/importers/aviraCsvImporter';\nimport { BitwardenCsvImporter } from 'jslib/importers/bitwardenCsvImporter';\nimport { BlurCsvImporter } from 'jslib/importers/blurCsvImporter';\nimport { ChromeCsvImporter } from 'jslib/importers/chromeCsvImporter';\nimport { ClipperzHtmlImporter } from 'jslib/importers/clipperzHtmlImporter';\nimport { DashlaneCsvImporter } from 'jslib/importers/dashlaneCsvImporter';\nimport { EnpassCsvImporter } from 'jslib/importers/enpassCsvImporter';\nimport { FirefoxCsvImporter } from 'jslib/importers/firefoxCsvImporter';\nimport { GnomeJsonImporter } from 'jslib/importers/gnomeJsonImporter';\nimport { Importer } from 'jslib/importers/importer';\nimport { KeePass2XmlImporter } from 'jslib/importers/keepass2XmlImporter';\nimport { KeePassXCsvImporter } from 'jslib/importers/keepassxCsvImporter';\nimport { KeeperCsvImporter } from 'jslib/importers/keeperCsvImporter';\nimport { LastPassCsvImporter } from 'jslib/importers/lastpassCsvImporter';\nimport { MeldiumCsvImporter } from 'jslib/importers/meldiumCsvImporter';\nimport { MSecureCsvImporter } from 'jslib/importers/msecureCsvImporter';\nimport { OnePassword1PifImporter } from 'jslib/importers/onepassword1PifImporter';\nimport { OnePasswordWinCsvImporter } from 'jslib/importers/onepasswordWinCsvImporter';\nimport { PadlockCsvImporter } from 'jslib/importers/padlockCsvImporter';\nimport { PassKeepCsvImporter } from 'jslib/importers/passkeepCsvImporter';\nimport { PasswordAgentCsvImporter } from 'jslib/importers/passwordAgentCsvImporter';\nimport { PasswordBossJsonImporter } from 'jslib/importers/passwordBossJsonImporter';\nimport { PasswordDragonXmlImporter } from 'jslib/importers/passwordDragonXmlImporter';\nimport { PasswordSafeXmlImporter } from 'jslib/importers/passwordSafeXmlImporter';\nimport { RoboFormCsvImporter } from 'jslib/importers/roboformCsvImporter';\nimport { SafeInCloudXmlImporter } from 'jslib/importers/safeInCloudXmlImporter';\nimport { SaferPassCsvImporter } from 'jslib/importers/saferpassCsvImport';\nimport { SplashIdCsvImporter } from 'jslib/importers/splashIdCsvImporter';\nimport { StickyPasswordXmlImporter } from 'jslib/importers/stickyPasswordXmlImporter';\nimport { TrueKeyCsvImporter } from 'jslib/importers/truekeyCsvImporter';\nimport { UpmCsvImporter } from 'jslib/importers/upmCsvImporter';\nimport { ZohoVaultCsvImporter } from 'jslib/importers/zohoVaultCsvImporter';\n\n@Component({\n selector: 'app-import',\n templateUrl: 'import.component.html',\n})\nexport class ImportComponent implements OnInit {\n featuredImportOptions: any[];\n importOptions: any[];\n format: string = null;\n fileContents: string;\n formPromise: Promise;\n\n protected successNavigate: any[] = ['vault'];\n\n constructor(protected i18nService: I18nService, protected analytics: Angulartics2,\n protected toasterService: ToasterService, protected cipherService: CipherService,\n protected folderService: FolderService, protected apiService: ApiService,\n protected router: Router) {\n }\n\n ngOnInit() {\n this.setImportOptions();\n this.importOptions.sort((a, b) => {\n if (a.name == null && b.name != null) {\n return -1;\n }\n if (a.name != null && b.name == null) {\n return 1;\n }\n if (a.name == null && b.name == null) {\n return 0;\n }\n\n return this.i18nService.collator ? this.i18nService.collator.compare(a.name, b.name) :\n a.name.localeCompare(b.name);\n });\n }\n\n async submit() {\n const importer = this.getImporter();\n if (importer === null) {\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'),\n this.i18nService.t('selectFormat'));\n return;\n }\n\n const fileEl = document.getElementById('file') as HTMLInputElement;\n const files = fileEl.files;\n if ((files == null || files.length === 0) && (this.fileContents == null || this.fileContents === '')) {\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'),\n this.i18nService.t('selectFile'));\n return;\n }\n\n let fileContents = this.fileContents;\n if (files != null && files.length > 0) {\n try {\n const content = await this.getFileContents(files[0]);\n if (content != null) {\n fileContents = content;\n }\n } catch { }\n }\n\n if (fileContents == null || fileContents === '') {\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'),\n this.i18nService.t('selectFile'));\n return;\n }\n\n const importResult = await importer.parse(fileContents);\n if (importResult.success) {\n if (importResult.folders.length === 0 && importResult.ciphers.length === 0) {\n this.error(this.i18nService.t('importNothingError'));\n return;\n } else if (importResult.ciphers.length > 0) {\n const halfway = Math.floor(importResult.ciphers.length / 2);\n const last = importResult.ciphers.length - 1;\n if (this.badData(importResult.ciphers[0]) && this.badData(importResult.ciphers[halfway]) &&\n this.badData(importResult.ciphers[last])) {\n this.error(this.i18nService.t('importFormatError'));\n return;\n }\n }\n\n try {\n this.formPromise = this.postImport(importResult);\n await this.formPromise;\n this.analytics.eventTrack.next({\n action: 'Imported Data',\n properties: { label: this.format },\n });\n this.toasterService.popAsync('success', null, this.i18nService.t('importSuccess'));\n this.router.navigate(this.successNavigate);\n } catch { }\n } else {\n this.error(this.i18nService.t('importFormatError'));\n }\n }\n\n getFormatInstructionTitle() {\n if (this.format == null) {\n return null;\n }\n\n const results = this.featuredImportOptions.concat(this.importOptions).filter((o) => o.id === this.format);\n if (results.length > 0) {\n return this.i18nService.t('instructionsFor', results[0].name);\n }\n return null;\n }\n\n protected async postImport(importResult: ImportResult) {\n const request = new ImportCiphersRequest();\n for (let i = 0; i < importResult.ciphers.length; i++) {\n const c = await this.cipherService.encrypt(importResult.ciphers[i]);\n request.ciphers.push(new CipherRequest(c));\n }\n if (importResult.folders != null) {\n for (let i = 0; i < importResult.folders.length; i++) {\n const f = await this.folderService.encrypt(importResult.folders[i]);\n request.folders.push(new FolderRequest(f));\n }\n }\n if (importResult.folderRelationships != null) {\n importResult.folderRelationships.forEach((r) =>\n request.folderRelationships.push(new KvpRequest(r[0], r[1])));\n }\n return await this.apiService.postImportCiphers(request);\n }\n\n protected setImportOptions() {\n this.featuredImportOptions = [\n { id: null, name: '-- ' + this.i18nService.t('select') + ' --' },\n { id: 'bitwardencsv', name: 'Bitwarden (csv)' },\n { id: 'lastpasscsv', name: 'LastPass (csv)' },\n { id: 'chromecsv', name: 'Chrome (csv)' },\n { id: 'firefoxcsv', name: 'Firefox (csv)' },\n { id: 'keepass2xml', name: 'KeePass 2 (xml)' },\n { id: '1password1pif', name: '1Password (1pif)' },\n { id: 'dashlanecsv', name: 'Dashlane (csv)' },\n ];\n\n this.importOptions = [\n { id: 'keepassxcsv', name: 'KeePassX (csv)' },\n { id: '1passwordwincsv', name: '1Password 6 and 7 Windows (csv)' },\n { id: 'roboformcsv', name: 'RoboForm (csv)' },\n { id: 'keepercsv', name: 'Keeper (csv)' },\n { id: 'enpasscsv', name: 'Enpass (csv)' },\n { id: 'safeincloudxml', name: 'SafeInCloud (xml)' },\n { id: 'pwsafexml', name: 'Password Safe (xml)' },\n { id: 'stickypasswordxml', name: 'Sticky Password (xml)' },\n { id: 'msecurecsv', name: 'mSecure (csv)' },\n { id: 'truekeycsv', name: 'True Key (csv)' },\n { id: 'passwordbossjson', name: 'Password Boss (json)' },\n { id: 'zohovaultcsv', name: 'Zoho Vault (csv)' },\n { id: 'splashidcsv', name: 'SplashID (csv)' },\n { id: 'passworddragonxml', name: 'Password Dragon (xml)' },\n { id: 'padlockcsv', name: 'Padlock (csv)' },\n { id: 'passboltcsv', name: 'Passbolt (csv)' },\n { id: 'clipperzhtml', name: 'Clipperz (html)' },\n { id: 'aviracsv', name: 'Avira (csv)' },\n { id: 'saferpasscsv', name: 'SaferPass (csv)' },\n { id: 'upmcsv', name: 'Universal Password Manager (csv)' },\n { id: 'ascendocsv', name: 'Ascendo DataVault (csv)' },\n { id: 'meldiumcsv', name: 'Meldium (csv)' },\n { id: 'passkeepcsv', name: 'PassKeep (csv)' },\n { id: 'operacsv', name: 'Opera (csv)' },\n { id: 'vivaldicsv', name: 'Vivaldi (csv)' },\n { id: 'gnomejson', name: 'GNOME Passwords and Keys/Seahorse (json)' },\n { id: 'blurcsv', name: 'Blur (csv)' },\n { id: 'passwordagentcsv', name: 'Password Agent (csv)' },\n ];\n }\n\n protected getImporter(): Importer {\n if (this.format == null || this.format === '') {\n return null;\n }\n\n switch (this.format) {\n case 'bitwardencsv':\n return new BitwardenCsvImporter();\n case 'lastpasscsv':\n case 'passboltcsv':\n return new LastPassCsvImporter();\n case 'keepassxcsv':\n return new KeePassXCsvImporter();\n case 'aviracsv':\n return new AviraCsvImporter();\n case 'blurcsv':\n return new BlurCsvImporter();\n case 'safeincloudxml':\n return new SafeInCloudXmlImporter();\n case 'padlockcsv':\n return new PadlockCsvImporter();\n case 'keepass2xml':\n return new KeePass2XmlImporter();\n case 'chromecsv':\n case 'operacsv':\n case 'vivaldicsv':\n return new ChromeCsvImporter();\n case 'firefoxcsv':\n return new FirefoxCsvImporter();\n case 'upmcsv':\n return new UpmCsvImporter();\n case 'saferpasscsv':\n return new SaferPassCsvImporter();\n case 'meldiumcsv':\n return new MeldiumCsvImporter();\n case '1password1pif':\n return new OnePassword1PifImporter();\n case '1passwordwincsv':\n return new OnePasswordWinCsvImporter();\n case 'keepercsv':\n return new KeeperCsvImporter();\n case 'passworddragonxml':\n return new PasswordDragonXmlImporter();\n case 'enpasscsv':\n return new EnpassCsvImporter();\n case 'pwsafexml':\n return new PasswordSafeXmlImporter();\n case 'dashlanecsv':\n return new DashlaneCsvImporter();\n case 'msecurecsv':\n return new MSecureCsvImporter();\n case 'stickypasswordxml':\n return new StickyPasswordXmlImporter();\n case 'truekeycsv':\n return new TrueKeyCsvImporter();\n case 'clipperzhtml':\n return new ClipperzHtmlImporter();\n case 'roboformcsv':\n return new RoboFormCsvImporter();\n case 'ascendocsv':\n return new AscendoCsvImporter();\n case 'passwordbossjson':\n return new PasswordBossJsonImporter();\n case 'zohovaultcsv':\n return new ZohoVaultCsvImporter();\n case 'splashidcsv':\n return new SplashIdCsvImporter();\n case 'passkeepcsv':\n return new PassKeepCsvImporter();\n case 'gnomejson':\n return new GnomeJsonImporter();\n case 'passwordagentcsv':\n return new PasswordAgentCsvImporter();\n default:\n return null;\n }\n }\n\n private error(errorMessage: string) {\n this.analytics.eventTrack.next({\n action: 'Import Data Failed',\n properties: { label: this.format },\n });\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'), errorMessage);\n }\n\n private getFileContents(file: File): Promise {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.readAsText(file, 'utf-8');\n reader.onload = (evt) => {\n if (this.format === 'lastpasscsv' && file.type === 'text/html') {\n const parser = new DOMParser();\n const doc = parser.parseFromString(evt.target.result, 'text/html');\n const pre = doc.querySelector('pre');\n if (pre != null) {\n resolve(pre.textContent);\n return;\n }\n reject();\n return;\n }\n\n resolve(evt.target.result);\n };\n reader.onerror = () => {\n reject();\n };\n });\n }\n\n private badData(c: CipherView) {\n return (c.name == null || c.name === '--') &&\n (c.login != null && (c.login.password == null || c.login.password === ''));\n }\n}\n","import {\n Component,\n ComponentFactoryResolver,\n OnInit,\n Type,\n ViewChild,\n ViewContainerRef,\n} from '@angular/core';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { MessagingService } from 'jslib/abstractions/messaging.service';\nimport { TokenService } from 'jslib/abstractions/token.service';\n\nimport { TwoFactorProviders } from 'jslib/services/auth.service';\n\nimport { TwoFactorProviderType } from 'jslib/enums/twoFactorProviderType';\n\nimport { ModalComponent } from '../modal.component';\n\nimport { TwoFactorAuthenticatorComponent } from './two-factor-authenticator.component';\nimport { TwoFactorDuoComponent } from './two-factor-duo.component';\nimport { TwoFactorEmailComponent } from './two-factor-email.component';\nimport { TwoFactorRecoveryComponent } from './two-factor-recovery.component';\nimport { TwoFactorU2fComponent } from './two-factor-u2f.component';\nimport { TwoFactorYubiKeyComponent } from './two-factor-yubikey.component';\n\n@Component({\n selector: 'app-two-factor-setup',\n templateUrl: 'two-factor-setup.component.html',\n})\nexport class TwoFactorSetupComponent implements OnInit {\n @ViewChild('recoveryTemplate', { read: ViewContainerRef }) recoveryModalRef: ViewContainerRef;\n @ViewChild('authenticatorTemplate', { read: ViewContainerRef }) authenticatorModalRef: ViewContainerRef;\n @ViewChild('yubikeyTemplate', { read: ViewContainerRef }) yubikeyModalRef: ViewContainerRef;\n @ViewChild('u2fTemplate', { read: ViewContainerRef }) u2fModalRef: ViewContainerRef;\n @ViewChild('duoTemplate', { read: ViewContainerRef }) duoModalRef: ViewContainerRef;\n @ViewChild('emailTemplate', { read: ViewContainerRef }) emailModalRef: ViewContainerRef;\n\n organizationId: string;\n providers: any[] = [];\n premium: boolean;\n loading = true;\n\n private modal: ModalComponent = null;\n\n constructor(protected apiService: ApiService, protected tokenService: TokenService,\n protected componentFactoryResolver: ComponentFactoryResolver, protected messagingService: MessagingService) { }\n\n async ngOnInit() {\n this.premium = this.tokenService.getPremium();\n\n for (const key in TwoFactorProviders) {\n if (!TwoFactorProviders.hasOwnProperty(key)) {\n continue;\n }\n\n const p = (TwoFactorProviders as any)[key];\n if (this.filterProvider(p.type)) {\n continue;\n }\n\n this.providers.push({\n type: p.type,\n name: p.name,\n description: p.description,\n enabled: false,\n premium: p.premium,\n sort: p.sort,\n });\n }\n\n this.providers.sort((a: any, b: any) => a.sort - b.sort);\n await this.load();\n }\n\n async load() {\n this.loading = true;\n const providerList = await this.getTwoFactorProviders();\n providerList.data.forEach((p) => {\n this.providers.forEach((p2) => {\n if (p.type === p2.type) {\n p2.enabled = p.enabled;\n }\n });\n });\n this.loading = false;\n }\n\n manage(type: TwoFactorProviderType) {\n switch (type) {\n case TwoFactorProviderType.Authenticator:\n const authComp = this.openModal(this.authenticatorModalRef, TwoFactorAuthenticatorComponent);\n authComp.onUpdated.subscribe((enabled: boolean) => {\n this.updateStatus(enabled, TwoFactorProviderType.Authenticator);\n });\n break;\n case TwoFactorProviderType.Yubikey:\n const yubiComp = this.openModal(this.yubikeyModalRef, TwoFactorYubiKeyComponent);\n yubiComp.onUpdated.subscribe((enabled: boolean) => {\n this.updateStatus(enabled, TwoFactorProviderType.Yubikey);\n });\n break;\n case TwoFactorProviderType.Duo:\n const duoComp = this.openModal(this.duoModalRef, TwoFactorDuoComponent);\n duoComp.onUpdated.subscribe((enabled: boolean) => {\n this.updateStatus(enabled, TwoFactorProviderType.Duo);\n });\n break;\n case TwoFactorProviderType.Email:\n const emailComp = this.openModal(this.emailModalRef, TwoFactorEmailComponent);\n emailComp.onUpdated.subscribe((enabled: boolean) => {\n this.updateStatus(enabled, TwoFactorProviderType.Email);\n });\n break;\n case TwoFactorProviderType.U2f:\n const u2fComp = this.openModal(this.u2fModalRef, TwoFactorU2fComponent);\n u2fComp.onUpdated.subscribe((enabled: boolean) => {\n this.updateStatus(enabled, TwoFactorProviderType.U2f);\n });\n break;\n default:\n break;\n }\n }\n\n recoveryCode() {\n this.openModal(this.recoveryModalRef, TwoFactorRecoveryComponent);\n }\n\n async premiumRequired() {\n const premium = await this.tokenService.getPremium();\n if (!premium) {\n this.messagingService.send('premiumRequired');\n return;\n }\n }\n\n protected getTwoFactorProviders() {\n return this.apiService.getTwoFactorProviders();\n }\n\n protected filterProvider(type: TwoFactorProviderType) {\n return type === TwoFactorProviderType.OrganizationDuo;\n }\n\n protected openModal(ref: ViewContainerRef, type: Type): T {\n if (this.modal != null) {\n this.modal.close();\n }\n\n const factory = this.componentFactoryResolver.resolveComponentFactory(ModalComponent);\n this.modal = ref.createComponent(factory).instance;\n const childComponent = this.modal.show(type, ref);\n\n this.modal.onClosed.subscribe(() => {\n this.modal = null;\n });\n return childComponent;\n }\n\n protected updateStatus(enabled: boolean, type: TwoFactorProviderType) {\n if (!enabled && this.modal != null) {\n this.modal.close();\n }\n this.providers.forEach((p) => {\n if (p.type === type) {\n p.enabled = enabled;\n }\n });\n }\n}\n","import { UriMatchType } from '../../enums/uriMatchType';\n\nimport { View } from './view';\n\nimport { LoginUri } from '../domain/loginUri';\n\nimport { PlatformUtilsService } from '../../abstractions/platformUtils.service';\n\nimport { Utils } from '../../misc/utils';\n\nexport class LoginUriView implements View {\n match: UriMatchType = null;\n\n // tslint:disable\n private _uri: string;\n private _domain: string;\n private _hostname: string;\n // tslint:enable\n\n constructor(u?: LoginUri) {\n if (!u) {\n return;\n }\n\n this.match = u.match;\n }\n\n get uri(): string {\n return this._uri;\n }\n set uri(value: string) {\n this._uri = value;\n this._domain = null;\n }\n\n get domain(): string {\n if (this._domain == null && this.uri != null) {\n const containerService = (Utils.global as any).bitwardenContainerService;\n if (containerService) {\n const platformUtilsService: PlatformUtilsService = containerService.getPlatformUtilsService();\n this._domain = platformUtilsService.getDomain(this.uri);\n if (this._domain === '') {\n this._domain = null;\n }\n } else {\n throw new Error('global bitwardenContainerService not initialized.');\n }\n }\n\n return this._domain;\n }\n\n get hostname(): string {\n if (this._hostname == null && this.uri != null) {\n this._hostname = Utils.getHostname(this.uri);\n if (this._hostname === '') {\n this._hostname = null;\n }\n }\n\n return this._hostname;\n }\n\n get hostnameOrUri(): string {\n return this.hostname != null ? this.hostname : this.uri;\n }\n\n get isWebsite(): boolean {\n return this.uri != null && (this.uri.indexOf('http://') === 0 || this.uri.indexOf('https://') === 0);\n }\n\n get canLaunch(): boolean {\n return this.uri != null && this.uri.indexOf('://') > -1;\n }\n}\n","import { View } from './view';\r\n\r\nimport { Identity } from '../domain/identity';\r\n\r\nexport class IdentityView implements View {\r\n title: string = null;\r\n middleName: string;\r\n address1: string;\r\n address2: string;\r\n address3: string;\r\n city: string;\r\n state: string;\r\n postalCode: string;\r\n country: string;\r\n company: string;\r\n email: string;\r\n phone: string;\r\n ssn: string;\r\n username: string;\r\n passportNumber: string;\r\n licenseNumber: string;\r\n\r\n // tslint:disable\r\n private _firstName: string;\r\n private _lastName: string;\r\n private _subTitle: string;\r\n // tslint:enable\r\n\r\n constructor(i?: Identity) {\r\n // ctor\r\n }\r\n\r\n get firstName(): string {\r\n return this._firstName;\r\n }\r\n set firstName(value: string) {\r\n this._firstName = value;\r\n this._subTitle = null;\r\n }\r\n\r\n get lastName(): string {\r\n return this._lastName;\r\n }\r\n set lastName(value: string) {\r\n this._lastName = value;\r\n this._subTitle = null;\r\n }\r\n\r\n get subTitle(): string {\r\n if (this._subTitle == null && (this.firstName != null || this.lastName != null)) {\r\n this._subTitle = '';\r\n if (this.firstName != null) {\r\n this._subTitle = this.firstName;\r\n }\r\n if (this.lastName != null) {\r\n if (this._subTitle !== '') {\r\n this._subTitle += ' ';\r\n }\r\n this._subTitle += this.lastName;\r\n }\r\n }\r\n\r\n return this._subTitle;\r\n }\r\n\r\n get fullName(): string {\r\n if (this.title != null || this.firstName != null || this.middleName != null || this.lastName != null) {\r\n let name = '';\r\n if (this.title != null) {\r\n name += (this.title + ' ');\r\n }\r\n if (this.firstName != null) {\r\n name += (this.firstName + ' ');\r\n }\r\n if (this.middleName != null) {\r\n name += (this.middleName + ' ');\r\n }\r\n if (this.lastName != null) {\r\n name += this.lastName;\r\n }\r\n return name.trim();\r\n }\r\n\r\n return null;\r\n }\r\n}\r\n","import {\r\n Component,\r\n EventEmitter,\r\n Input,\r\n Output,\r\n} from '@angular/core';\r\n\r\nimport { ToasterService } from 'angular2-toaster';\r\nimport { Angulartics2 } from 'angulartics2';\r\n\r\nimport { CipherService } from 'jslib/abstractions/cipher.service';\r\nimport { I18nService } from 'jslib/abstractions/i18n.service';\r\nimport { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';\r\n\r\nimport { CiphersComponent as BaseCiphersComponent } from 'jslib/angular/components/ciphers.component';\r\n\r\nimport { CipherType } from 'jslib/enums/cipherType';\r\n\r\nimport { CipherView } from 'jslib/models/view/cipherView';\r\n\r\nconst MaxCheckedCount = 500;\r\n\r\n@Component({\r\n selector: 'app-vault-ciphers',\r\n templateUrl: 'ciphers.component.html',\r\n})\r\nexport class CiphersComponent extends BaseCiphersComponent {\r\n @Input() showAddNew = true;\r\n @Output() onAttachmentsClicked = new EventEmitter();\r\n @Output() onShareClicked = new EventEmitter();\r\n @Output() onCollectionsClicked = new EventEmitter();\r\n\r\n cipherType = CipherType;\r\n\r\n constructor(cipherService: CipherService, protected analytics: Angulartics2,\r\n protected toasterService: ToasterService, protected i18nService: I18nService,\r\n protected platformUtilsService: PlatformUtilsService) {\r\n super(cipherService);\r\n }\r\n\r\n checkCipher(c: CipherView, select?: boolean) {\r\n (c as any).checked = select == null ? !(c as any).checked : select;\r\n }\r\n\r\n selectAll(select: boolean) {\r\n if (select) {\r\n this.selectAll(false);\r\n }\r\n const selectCount = select && this.ciphers.length > MaxCheckedCount ? MaxCheckedCount : this.ciphers.length;\r\n for (let i = 0; i < selectCount; i++) {\r\n this.checkCipher(this.ciphers[i], select);\r\n }\r\n }\r\n\r\n getSelected(): CipherView[] {\r\n if (this.ciphers == null) {\r\n return [];\r\n }\r\n return this.ciphers.filter((c) => !!(c as any).checked);\r\n }\r\n\r\n getSelectedIds(): string[] {\r\n return this.getSelected().map((c) => c.id);\r\n }\r\n\r\n attachments(c: CipherView) {\r\n this.onAttachmentsClicked.emit(c);\r\n }\r\n\r\n share(c: CipherView) {\r\n this.onShareClicked.emit(c);\r\n }\r\n\r\n collections(c: CipherView) {\r\n this.onCollectionsClicked.emit(c);\r\n }\r\n\r\n async delete(c: CipherView): Promise {\r\n const confirmed = await this.platformUtilsService.showDialog(\r\n this.i18nService.t('deleteItemConfirmation'), this.i18nService.t('deleteItem'),\r\n this.i18nService.t('yes'), this.i18nService.t('no'), 'warning');\r\n if (!confirmed) {\r\n return false;\r\n }\r\n\r\n await this.cipherService.deleteWithServer(c.id);\r\n this.analytics.eventTrack.next({ action: 'Deleted Cipher' });\r\n this.toasterService.popAsync('success', null, this.i18nService.t('deletedItem'));\r\n this.refresh();\r\n }\r\n\r\n copy(value: string, typeI18nKey: string, aType: string) {\r\n if (value == null) {\r\n return;\r\n }\r\n\r\n this.analytics.eventTrack.next({ action: 'Copied ' + aType.toLowerCase() + ' from listing.' });\r\n this.platformUtilsService.copyToClipboard(value, { doc: window.document });\r\n this.toasterService.popAsync('info', null,\r\n this.i18nService.t('valueCopied', this.i18nService.t(typeI18nKey)));\r\n }\r\n}\r\n","export enum FieldType {\r\n Text = 0,\r\n Hidden = 1,\r\n Boolean = 2,\r\n}\r\n","export enum EncryptionType {\r\n AesCbc256_B64 = 0,\r\n AesCbc128_HmacSha256_B64 = 1,\r\n AesCbc256_HmacSha256_B64 = 2,\r\n Rsa2048_OaepSha256_B64 = 3,\r\n Rsa2048_OaepSha1_B64 = 4,\r\n Rsa2048_OaepSha256_HmacSha256_B64 = 5,\r\n Rsa2048_OaepSha1_HmacSha256_B64 = 6,\r\n}\r\n","import {\r\n Component,\r\n EventEmitter,\r\n Output,\r\n} from '@angular/core';\r\n\r\nimport { CollectionService } from 'jslib/abstractions/collection.service';\r\nimport { FolderService } from 'jslib/abstractions/folder.service';\r\n\r\nimport { GroupingsComponent as BaseGroupingsComponent } from 'jslib/angular/components/groupings.component';\r\n\r\n@Component({\r\n selector: 'app-vault-groupings',\r\n templateUrl: 'groupings.component.html',\r\n})\r\nexport class GroupingsComponent extends BaseGroupingsComponent {\r\n @Output() onSearchTextChanged = new EventEmitter();\r\n\r\n searchText: string = '';\r\n searchPlaceholder: string = null;\r\n\r\n constructor(collectionService: CollectionService, folderService: FolderService) {\r\n super(collectionService, folderService);\r\n }\r\n\r\n searchTextChanged() {\r\n this.onSearchTextChanged.emit(this.searchText);\r\n }\r\n}\r\n","import { TwoFactorProviderType } from '../enums/twoFactorProviderType';\n\nimport { AuthResult } from '../models/domain/authResult';\nimport { SymmetricCryptoKey } from '../models/domain/symmetricCryptoKey';\n\nimport { DeviceRequest } from '../models/request/deviceRequest';\nimport { KeysRequest } from '../models/request/keysRequest';\nimport { TokenRequest } from '../models/request/tokenRequest';\n\nimport { IdentityTokenResponse } from '../models/response/identityTokenResponse';\nimport { IdentityTwoFactorResponse } from '../models/response/identityTwoFactorResponse';\n\nimport { ApiService } from '../abstractions/api.service';\nimport { AppIdService } from '../abstractions/appId.service';\nimport { CryptoService } from '../abstractions/crypto.service';\nimport { I18nService } from '../abstractions/i18n.service';\nimport { MessagingService } from '../abstractions/messaging.service';\nimport { PlatformUtilsService } from '../abstractions/platformUtils.service';\nimport { TokenService } from '../abstractions/token.service';\nimport { UserService } from '../abstractions/user.service';\n\nexport const TwoFactorProviders = {\n [TwoFactorProviderType.Authenticator]: {\n type: TwoFactorProviderType.Authenticator,\n name: null as string,\n description: null as string,\n priority: 1,\n sort: 1,\n premium: false,\n },\n [TwoFactorProviderType.Yubikey]: {\n type: TwoFactorProviderType.Yubikey,\n name: null as string,\n description: null as string,\n priority: 3,\n sort: 2,\n premium: true,\n },\n [TwoFactorProviderType.Duo]: {\n type: TwoFactorProviderType.Duo,\n name: 'Duo',\n description: null as string,\n priority: 2,\n sort: 3,\n premium: true,\n },\n [TwoFactorProviderType.OrganizationDuo]: {\n type: TwoFactorProviderType.OrganizationDuo,\n name: 'Duo (Organization)',\n description: null as string,\n priority: 10,\n sort: 4,\n premium: false,\n },\n [TwoFactorProviderType.U2f]: {\n type: TwoFactorProviderType.U2f,\n name: null as string,\n description: null as string,\n priority: 4,\n sort: 5,\n premium: true,\n },\n [TwoFactorProviderType.Email]: {\n type: TwoFactorProviderType.Email,\n name: null as string,\n description: null as string,\n priority: 0,\n sort: 6,\n premium: false,\n },\n};\n\nexport class AuthService {\n email: string;\n masterPasswordHash: string;\n twoFactorProviders: Map;\n selectedTwoFactorProviderType: TwoFactorProviderType = null;\n\n private key: SymmetricCryptoKey;\n\n constructor(private cryptoService: CryptoService, private apiService: ApiService,\n private userService: UserService, private tokenService: TokenService,\n private appIdService: AppIdService, private i18nService: I18nService,\n private platformUtilsService: PlatformUtilsService, private messagingService: MessagingService,\n private setCryptoKeys = true) { }\n\n init() {\n TwoFactorProviders[TwoFactorProviderType.Email].name = this.i18nService.t('emailTitle');\n TwoFactorProviders[TwoFactorProviderType.Email].description = this.i18nService.t('emailDesc');\n\n TwoFactorProviders[TwoFactorProviderType.Authenticator].name = this.i18nService.t('authenticatorAppTitle');\n TwoFactorProviders[TwoFactorProviderType.Authenticator].description =\n this.i18nService.t('authenticatorAppDesc');\n\n TwoFactorProviders[TwoFactorProviderType.Duo].description = this.i18nService.t('duoDesc');\n\n TwoFactorProviders[TwoFactorProviderType.OrganizationDuo].name =\n 'Duo (' + this.i18nService.t('organization') + ')';\n TwoFactorProviders[TwoFactorProviderType.OrganizationDuo].description =\n this.i18nService.t('duoOrganizationDesc');\n\n TwoFactorProviders[TwoFactorProviderType.U2f].name = this.i18nService.t('u2fTitle');\n TwoFactorProviders[TwoFactorProviderType.U2f].description = this.i18nService.t('u2fDesc');\n\n TwoFactorProviders[TwoFactorProviderType.Yubikey].name = this.i18nService.t('yubiKeyTitle');\n TwoFactorProviders[TwoFactorProviderType.Yubikey].description = this.i18nService.t('yubiKeyDesc');\n }\n\n async logIn(email: string, masterPassword: string): Promise {\n this.selectedTwoFactorProviderType = null;\n email = email.toLowerCase();\n const key = await this.cryptoService.makeKey(masterPassword, email);\n const hashedPassword = await this.cryptoService.hashPassword(masterPassword, key);\n return await this.logInHelper(email, hashedPassword, key);\n }\n\n async logInTwoFactor(twoFactorProvider: TwoFactorProviderType, twoFactorToken: string,\n remember?: boolean): Promise {\n return await this.logInHelper(this.email, this.masterPasswordHash, this.key, twoFactorProvider,\n twoFactorToken, remember);\n }\n\n async logInComplete(email: string, masterPassword: string, twoFactorProvider: TwoFactorProviderType,\n twoFactorToken: string, remember?: boolean): Promise {\n this.selectedTwoFactorProviderType = null;\n email = email.toLowerCase();\n const key = await this.cryptoService.makeKey(masterPassword, email);\n const hashedPassword = await this.cryptoService.hashPassword(masterPassword, key);\n return await this.logInHelper(email, hashedPassword, key, twoFactorProvider, twoFactorToken, remember);\n }\n\n logOut(callback: Function) {\n callback();\n this.messagingService.send('loggedOut');\n }\n\n getSupportedTwoFactorProviders(win: Window): any[] {\n const providers: any[] = [];\n if (this.twoFactorProviders == null) {\n return providers;\n }\n\n if (this.twoFactorProviders.has(TwoFactorProviderType.OrganizationDuo) &&\n this.platformUtilsService.supportsDuo()) {\n providers.push(TwoFactorProviders[TwoFactorProviderType.OrganizationDuo]);\n }\n\n if (this.twoFactorProviders.has(TwoFactorProviderType.Authenticator)) {\n providers.push(TwoFactorProviders[TwoFactorProviderType.Authenticator]);\n }\n\n if (this.twoFactorProviders.has(TwoFactorProviderType.Yubikey)) {\n providers.push(TwoFactorProviders[TwoFactorProviderType.Yubikey]);\n }\n\n if (this.twoFactorProviders.has(TwoFactorProviderType.Duo) && this.platformUtilsService.supportsDuo()) {\n providers.push(TwoFactorProviders[TwoFactorProviderType.Duo]);\n }\n\n if (this.twoFactorProviders.has(TwoFactorProviderType.U2f) && this.platformUtilsService.supportsU2f(win)) {\n providers.push(TwoFactorProviders[TwoFactorProviderType.U2f]);\n }\n\n if (this.twoFactorProviders.has(TwoFactorProviderType.Email)) {\n providers.push(TwoFactorProviders[TwoFactorProviderType.Email]);\n }\n\n return providers;\n }\n\n getDefaultTwoFactorProvider(u2fSupported: boolean): TwoFactorProviderType {\n if (this.twoFactorProviders == null) {\n return null;\n }\n\n if (this.selectedTwoFactorProviderType != null &&\n this.twoFactorProviders.has(this.selectedTwoFactorProviderType)) {\n return this.selectedTwoFactorProviderType;\n }\n\n let providerType: TwoFactorProviderType = null;\n let providerPriority = -1;\n this.twoFactorProviders.forEach((value, type) => {\n const provider = (TwoFactorProviders as any)[type];\n if (provider != null && provider.priority > providerPriority) {\n if (type === TwoFactorProviderType.U2f && !u2fSupported) {\n return;\n }\n\n providerType = type;\n providerPriority = provider.priority;\n }\n });\n\n return providerType;\n }\n\n private async logInHelper(email: string, hashedPassword: string, key: SymmetricCryptoKey,\n twoFactorProvider?: TwoFactorProviderType, twoFactorToken?: string, remember?: boolean): Promise {\n const storedTwoFactorToken = await this.tokenService.getTwoFactorToken(email);\n const appId = await this.appIdService.getAppId();\n const deviceRequest = new DeviceRequest(appId, this.platformUtilsService);\n\n let request: TokenRequest;\n if (twoFactorToken != null && twoFactorProvider != null) {\n request = new TokenRequest(email, hashedPassword, twoFactorProvider, twoFactorToken, remember,\n deviceRequest);\n } else if (storedTwoFactorToken != null) {\n request = new TokenRequest(email, hashedPassword, TwoFactorProviderType.Remember,\n storedTwoFactorToken, false, deviceRequest);\n } else {\n request = new TokenRequest(email, hashedPassword, null, null, false, deviceRequest);\n }\n\n const response = await this.apiService.postIdentityToken(request);\n\n this.clearState();\n const result = new AuthResult();\n result.twoFactor = !(response as any).accessToken;\n\n if (result.twoFactor) {\n // two factor required\n const twoFactorResponse = response as IdentityTwoFactorResponse;\n this.email = email;\n this.masterPasswordHash = hashedPassword;\n this.key = this.setCryptoKeys ? key : null;\n this.twoFactorProviders = twoFactorResponse.twoFactorProviders2;\n result.twoFactorProviders = twoFactorResponse.twoFactorProviders2;\n return result;\n }\n\n const tokenResponse = response as IdentityTokenResponse;\n if (tokenResponse.twoFactorToken != null) {\n this.tokenService.setTwoFactorToken(tokenResponse.twoFactorToken, email);\n }\n\n await this.tokenService.setTokens(tokenResponse.accessToken, tokenResponse.refreshToken);\n await this.userService.setUserIdAndEmail(this.tokenService.getUserId(), this.tokenService.getEmail());\n if (this.setCryptoKeys) {\n await this.cryptoService.setKey(key);\n await this.cryptoService.setKeyHash(hashedPassword);\n await this.cryptoService.setEncKey(tokenResponse.key);\n\n // User doesn't have a key pair yet (old account), let's generate one for them\n if (tokenResponse.privateKey == null) {\n try {\n const keyPair = await this.cryptoService.makeKeyPair();\n await this.apiService.postAccountKeys(new KeysRequest(keyPair[0], keyPair[1].encryptedString));\n tokenResponse.privateKey = keyPair[1].encryptedString;\n } catch (e) {\n // tslint:disable-next-line\n console.error(e);\n }\n }\n\n await this.cryptoService.setEncPrivateKey(tokenResponse.privateKey);\n }\n\n this.messagingService.send('loggedIn');\n return result;\n }\n\n private clearState(): void {\n this.email = null;\n this.masterPasswordHash = null;\n this.twoFactorProviders = null;\n this.selectedTwoFactorProviderType = null;\n }\n}\n","export class SelectionReadOnlyResponse {\n id: string;\n readOnly: boolean;\n\n constructor(response: any) {\n this.id = response.Id;\n this.readOnly = response.ReadOnly;\n }\n}\n","import {\n Component,\n OnInit,\n} from '@angular/core';\nimport { ActivatedRoute } from '@angular/router';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { VerifyBankRequest } from 'jslib/models/request/verifyBankRequest';\n\nimport { BillingChargeResponse } from 'jslib/models/response/billingResponse';\nimport { OrganizationBillingResponse } from 'jslib/models/response/organizationBillingResponse';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\nimport { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';\nimport { TokenService } from 'jslib/abstractions/token.service';\n\nimport { PaymentMethodType } from 'jslib/enums/paymentMethodType';\nimport { PlanType } from 'jslib/enums/planType';\n\n@Component({\n selector: 'app-org-billing',\n templateUrl: 'organization-billing.component.html',\n})\nexport class OrganizationBillingComponent implements OnInit {\n loading = false;\n firstLoaded = false;\n organizationId: string;\n adjustSeatsAdd = true;\n showAdjustSeats = false;\n adjustStorageAdd = true;\n showAdjustStorage = false;\n showAdjustPayment = false;\n showUpdateLicense = false;\n billing: OrganizationBillingResponse;\n paymentMethodType = PaymentMethodType;\n selfHosted = false;\n verifyAmount1: number;\n verifyAmount2: number;\n\n cancelPromise: Promise;\n reinstatePromise: Promise;\n licensePromise: Promise;\n verifyBankPromise: Promise;\n\n constructor(private tokenService: TokenService, private apiService: ApiService,\n private platformUtilsService: PlatformUtilsService, private i18nService: I18nService,\n private analytics: Angulartics2, private toasterService: ToasterService,\n private route: ActivatedRoute) {\n this.selfHosted = platformUtilsService.isSelfHost();\n }\n\n async ngOnInit() {\n this.route.parent.parent.params.subscribe(async (params) => {\n this.organizationId = params.organizationId;\n await this.load();\n this.firstLoaded = true;\n });\n }\n\n async load() {\n if (this.loading) {\n return;\n }\n this.loading = true;\n this.billing = await this.apiService.getOrganizationBilling(this.organizationId);\n this.loading = false;\n }\n\n async reinstate() {\n if (this.loading) {\n return;\n }\n\n const confirmed = await this.platformUtilsService.showDialog(this.i18nService.t('reinstateConfirmation'),\n this.i18nService.t('reinstateSubscription'), this.i18nService.t('yes'), this.i18nService.t('cancel'));\n if (!confirmed) {\n return;\n }\n\n try {\n this.reinstatePromise = this.apiService.postOrganizationReinstate(this.organizationId);\n await this.reinstatePromise;\n this.analytics.eventTrack.next({ action: 'Reinstated Plan' });\n this.toasterService.popAsync('success', null, this.i18nService.t('reinstated'));\n this.load();\n } catch { }\n }\n\n async cancel() {\n if (this.loading) {\n return;\n }\n\n const confirmed = await this.platformUtilsService.showDialog(this.i18nService.t('cancelConfirmation'),\n this.i18nService.t('cancelSubscription'), this.i18nService.t('yes'), this.i18nService.t('no'), 'warning');\n if (!confirmed) {\n return;\n }\n\n try {\n this.cancelPromise = this.apiService.postOrganizationCancel(this.organizationId);\n await this.cancelPromise;\n this.analytics.eventTrack.next({ action: 'Canceled Plan' });\n this.toasterService.popAsync('success', null, this.i18nService.t('canceledSubscription'));\n this.load();\n } catch { }\n }\n\n async changePlan() {\n const contactSupport = await this.platformUtilsService.showDialog(this.i18nService.t('changeBillingPlanDesc'),\n this.i18nService.t('changeBillingPlan'), this.i18nService.t('contactSupport'), this.i18nService.t('close'));\n if (contactSupport) {\n this.platformUtilsService.launchUri('https://bitwarden.com/contact');\n }\n }\n\n async downloadLicense() {\n if (this.loading) {\n return;\n }\n\n const installationId = window.prompt(this.i18nService.t('enterInstallationId'));\n if (installationId == null || installationId === '') {\n return;\n }\n\n try {\n this.licensePromise = this.apiService.getOrganizationLicense(this.organizationId, installationId);\n const license = await this.licensePromise;\n const licenseString = JSON.stringify(license, null, 2);\n this.platformUtilsService.saveFile(window, licenseString, null, 'bitwarden_organization_license.json');\n } catch { }\n }\n\n updateLicense() {\n if (this.loading) {\n return;\n }\n this.showUpdateLicense = true;\n }\n\n async verifyBank() {\n if (this.loading) {\n return;\n }\n\n try {\n const request = new VerifyBankRequest();\n request.amount1 = this.verifyAmount1;\n request.amount2 = this.verifyAmount2;\n this.verifyBankPromise = this.apiService.postOrganizationVerifyBank(this.organizationId, request);\n await this.verifyBankPromise;\n this.analytics.eventTrack.next({ action: 'Verified Bank Account' });\n this.toasterService.popAsync('success', null, this.i18nService.t('verifiedBankAccount'));\n this.load();\n } catch { }\n }\n\n closeUpdateLicense(load: boolean) {\n this.showUpdateLicense = false;\n if (load) {\n this.load();\n }\n }\n\n adjustSeats(add: boolean) {\n this.adjustSeatsAdd = add;\n this.showAdjustSeats = true;\n }\n\n closeSeats(load: boolean) {\n this.showAdjustSeats = false;\n if (load) {\n this.load();\n }\n }\n\n adjustStorage(add: boolean) {\n this.adjustStorageAdd = add;\n this.showAdjustStorage = true;\n }\n\n closeStorage(load: boolean) {\n this.showAdjustStorage = false;\n if (load) {\n this.load();\n }\n }\n\n changePayment() {\n this.showAdjustPayment = true;\n }\n\n closePayment(load: boolean) {\n this.showAdjustPayment = false;\n if (load) {\n this.load();\n }\n }\n\n async viewInvoice(charge: BillingChargeResponse) {\n const token = await this.tokenService.getToken();\n const url = this.apiService.apiBaseUrl + '/organizations/' + this.organizationId +\n '/billing-invoice/' + charge.invoiceId + '?access_token=' + token;\n this.platformUtilsService.launchUri(url);\n }\n\n get subscriptionMarkedForCancel() {\n return this.subscription != null && !this.subscription.cancelled && this.subscription.cancelAtEndDate;\n }\n\n get subscription() {\n return this.billing != null ? this.billing.subscription : null;\n }\n\n get nextInvoice() {\n return this.billing != null ? this.billing.upcomingInvoice : null;\n }\n\n get paymentSource() {\n return this.billing != null ? this.billing.paymentSource : null;\n }\n\n get charges() {\n return this.billing != null ? this.billing.charges : null;\n }\n\n get storagePercentage() {\n return this.billing != null && this.billing.maxStorageGb ?\n +(100 * (this.billing.storageGb / this.billing.maxStorageGb)).toFixed(2) : 0;\n }\n\n get storageProgressWidth() {\n return this.storagePercentage < 5 ? 5 : 0;\n }\n\n get billingInterval() {\n const monthly = this.billing.planType === PlanType.EnterpriseMonthly ||\n this.billing.planType === PlanType.TeamsMonthly;\n return monthly ? 'month' : 'year';\n }\n\n get storageGbPrice() {\n return this.billingInterval === 'month' ? 0.5 : 4;\n }\n\n get seatPrice() {\n switch (this.billing.planType) {\n case PlanType.EnterpriseMonthly:\n return 4;\n case PlanType.EnterpriseAnnually:\n return 3;\n case PlanType.TeamsMonthly:\n return 2.5;\n case PlanType.TeamsAnnually:\n return 2;\n default:\n return 0;\n }\n }\n\n get canAdjustSeats() {\n return this.billing.planType === PlanType.EnterpriseMonthly ||\n this.billing.planType === PlanType.EnterpriseAnnually ||\n this.billing.planType === PlanType.TeamsMonthly || this.billing.planType === PlanType.TeamsAnnually;\n }\n\n get canDownloadLicense() {\n return (this.billing.planType !== PlanType.Free && this.subscription == null) ||\n (this.subscription != null && !this.subscription.cancelled);\n }\n}\n","import {\n Component,\n ComponentFactoryResolver,\n} from '@angular/core';\nimport { ActivatedRoute } from '@angular/router';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { MessagingService } from 'jslib/abstractions/messaging.service';\nimport { TokenService } from 'jslib/abstractions/token.service';\n\nimport { TwoFactorProviderType } from 'jslib/enums/twoFactorProviderType';\n\nimport { TwoFactorDuoComponent } from '../../settings/two-factor-duo.component';\nimport { TwoFactorSetupComponent as BaseTwoFactorSetupComponent } from '../../settings/two-factor-setup.component';\n\n@Component({\n selector: 'app-two-factor-setup',\n templateUrl: '../../settings/two-factor-setup.component.html',\n})\nexport class TwoFactorSetupComponent extends BaseTwoFactorSetupComponent {\n constructor(apiService: ApiService, tokenService: TokenService,\n componentFactoryResolver: ComponentFactoryResolver, messagingService: MessagingService,\n private route: ActivatedRoute) {\n super(apiService, tokenService, componentFactoryResolver, messagingService);\n }\n\n async ngOnInit() {\n this.route.parent.parent.params.subscribe(async (params) => {\n this.organizationId = params.organizationId;\n await super.ngOnInit();\n });\n }\n\n manage(type: TwoFactorProviderType) {\n switch (type) {\n case TwoFactorProviderType.OrganizationDuo:\n const duoComp = this.openModal(this.duoModalRef, TwoFactorDuoComponent);\n duoComp.type = TwoFactorProviderType.OrganizationDuo;\n duoComp.organizationId = this.organizationId;\n duoComp.onUpdated.subscribe((enabled: boolean) => {\n this.updateStatus(enabled, TwoFactorProviderType.OrganizationDuo);\n });\n break;\n default:\n break;\n }\n }\n\n protected getTwoFactorProviders() {\n return this.apiService.getTwoFactorOrganizationProviders(this.organizationId);\n }\n\n protected filterProvider(type: TwoFactorProviderType) {\n return type !== TwoFactorProviderType.OrganizationDuo;\n }\n}\n","import {\n Component,\n ComponentFactoryResolver,\n ViewChild,\n ViewContainerRef,\n} from '@angular/core';\nimport { ActivatedRoute } from '@angular/router';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\nimport { SyncService } from 'jslib/abstractions/sync.service';\n\nimport { OrganizationUpdateRequest } from 'jslib/models/request/organizationUpdateRequest';\nimport { OrganizationResponse } from 'jslib/models/response/organizationResponse';\n\nimport { ModalComponent } from '../../modal.component';\nimport { DeleteOrganizationComponent } from './delete-organization.component';\n\n@Component({\n selector: 'app-org-account',\n templateUrl: 'account.component.html',\n})\nexport class AccountComponent {\n @ViewChild('deleteOrganizationTemplate', { read: ViewContainerRef }) deleteModalRef: ViewContainerRef;\n\n loading = true;\n org: OrganizationResponse;\n formPromise: Promise;\n\n private organizationId: string;\n private modal: ModalComponent = null;\n\n constructor(private componentFactoryResolver: ComponentFactoryResolver,\n private apiService: ApiService, private i18nService: I18nService,\n private analytics: Angulartics2, private toasterService: ToasterService,\n private route: ActivatedRoute, private syncService: SyncService) { }\n\n async ngOnInit() {\n this.route.parent.parent.params.subscribe(async (params) => {\n this.organizationId = params.organizationId;\n try {\n this.org = await this.apiService.getOrganization(this.organizationId);\n } catch { }\n });\n this.loading = false;\n }\n\n async submit() {\n try {\n const request = new OrganizationUpdateRequest();\n request.name = this.org.name;\n request.businessName = this.org.businessName;\n request.billingEmail = this.org.billingEmail;\n this.formPromise = this.apiService.putOrganization(this.organizationId, request).then(() => {\n return this.syncService.fullSync(true);\n });\n await this.formPromise;\n this.analytics.eventTrack.next({ action: 'Updated Organization Settings' });\n this.toasterService.popAsync('success', null, this.i18nService.t('organizationUpdated'));\n } catch { }\n }\n\n deleteOrganization() {\n if (this.modal != null) {\n this.modal.close();\n }\n\n const factory = this.componentFactoryResolver.resolveComponentFactory(ModalComponent);\n this.modal = this.deleteModalRef.createComponent(factory).instance;\n const childComponent = this.modal.show(\n DeleteOrganizationComponent, this.deleteModalRef);\n childComponent.organizationId = this.organizationId;\n\n this.modal.onClosed.subscribe(async () => {\n this.modal = null;\n });\n }\n}\n","import { Component } from '@angular/core';\nimport { ActivatedRoute } from '@angular/router';\n\nimport { UserService } from 'jslib/abstractions/user.service';\n\n@Component({\n selector: 'app-org-settings',\n templateUrl: 'settings.component.html',\n})\nexport class SettingsComponent {\n access2fa = false;\n\n constructor(private route: ActivatedRoute, private userService: UserService) { }\n\n ngOnInit() {\n this.route.parent.params.subscribe(async (params) => {\n const organization = await this.userService.getOrganization(params.organizationId);\n this.access2fa = organization.use2fa;\n });\n }\n}\n","import {\n Component,\n ComponentFactoryResolver,\n OnInit,\n ViewChild,\n ViewContainerRef,\n} from '@angular/core';\nimport { ActivatedRoute } from '@angular/router';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { CryptoService } from 'jslib/abstractions/crypto.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\nimport { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';\nimport { UserService } from 'jslib/abstractions/user.service';\n\nimport { OrganizationUserConfirmRequest } from 'jslib/models/request/organizationUserConfirmRequest';\n\nimport { OrganizationUserUserDetailsResponse } from 'jslib/models/response/organizationUserResponse';\n\nimport { OrganizationUserStatusType } from 'jslib/enums/organizationUserStatusType';\nimport { OrganizationUserType } from 'jslib/enums/organizationUserType';\n\nimport { Utils } from 'jslib/misc/utils';\n\nimport { ModalComponent } from '../../modal.component';\nimport { EntityEventsComponent } from './entity-events.component';\nimport { UserAddEditComponent } from './user-add-edit.component';\nimport { UserGroupsComponent } from './user-groups.component';\n\n@Component({\n selector: 'app-org-people',\n templateUrl: 'people.component.html',\n})\nexport class PeopleComponent implements OnInit {\n @ViewChild('addEdit', { read: ViewContainerRef }) addEditModalRef: ViewContainerRef;\n @ViewChild('groupsTemplate', { read: ViewContainerRef }) groupsModalRef: ViewContainerRef;\n @ViewChild('eventsTemplate', { read: ViewContainerRef }) eventsModalRef: ViewContainerRef;\n\n loading = true;\n organizationId: string;\n users: OrganizationUserUserDetailsResponse[];\n searchText: string;\n status: OrganizationUserStatusType = null;\n statusMap = new Map();\n organizationUserType = OrganizationUserType;\n organizationUserStatusType = OrganizationUserStatusType;\n actionPromise: Promise;\n accessEvents = false;\n accessGroups = false;\n\n private modal: ModalComponent = null;\n private allUsers: OrganizationUserUserDetailsResponse[];\n\n constructor(private apiService: ApiService, private route: ActivatedRoute,\n private i18nService: I18nService, private componentFactoryResolver: ComponentFactoryResolver,\n private platformUtilsService: PlatformUtilsService, private analytics: Angulartics2,\n private toasterService: ToasterService, private cryptoService: CryptoService,\n private userService: UserService) { }\n\n async ngOnInit() {\n this.route.parent.parent.params.subscribe(async (params) => {\n this.organizationId = params.organizationId;\n const organization = await this.userService.getOrganization(this.organizationId);\n this.accessEvents = organization.useEvents;\n this.accessGroups = organization.useGroups;\n await this.load();\n\n this.route.queryParams.subscribe(async (qParams) => {\n this.searchText = qParams.search;\n if (qParams.viewEvents != null) {\n const user = this.users.filter((u) => u.id === qParams.viewEvents);\n if (user.length > 0 && user[0].status === OrganizationUserStatusType.Confirmed) {\n this.events(user[0]);\n }\n }\n });\n });\n }\n\n async load() {\n const response = await this.apiService.getOrganizationUsers(this.organizationId);\n this.statusMap.clear();\n this.allUsers = response.data != null && response.data.length > 0 ? response.data : [];\n this.allUsers.sort(Utils.getSortFunction(this.i18nService, 'email'));\n this.allUsers.forEach((u) => {\n if (!this.statusMap.has(u.status)) {\n this.statusMap.set(u.status, [u]);\n } else {\n this.statusMap.get(u.status).push(u);\n }\n });\n this.filter(this.status);\n this.loading = false;\n }\n\n filter(status: OrganizationUserStatusType) {\n this.status = status;\n if (this.status != null) {\n this.users = this.statusMap.get(this.status);\n } else {\n this.users = this.allUsers;\n }\n }\n\n get invitedCount() {\n return this.statusMap.has(OrganizationUserStatusType.Invited) ?\n this.statusMap.get(OrganizationUserStatusType.Invited).length : 0;\n }\n\n get acceptedCount() {\n return this.statusMap.has(OrganizationUserStatusType.Accepted) ?\n this.statusMap.get(OrganizationUserStatusType.Accepted).length : 0;\n }\n\n edit(user: OrganizationUserUserDetailsResponse) {\n if (this.modal != null) {\n this.modal.close();\n }\n\n const factory = this.componentFactoryResolver.resolveComponentFactory(ModalComponent);\n this.modal = this.addEditModalRef.createComponent(factory).instance;\n const childComponent = this.modal.show(\n UserAddEditComponent, this.addEditModalRef);\n\n childComponent.name = user != null ? user.name || user.email : null;\n childComponent.organizationId = this.organizationId;\n childComponent.organizationUserId = user != null ? user.id : null;\n childComponent.onSavedUser.subscribe(() => {\n this.modal.close();\n this.load();\n });\n childComponent.onDeletedUser.subscribe(() => {\n this.modal.close();\n this.removeUser(user);\n });\n\n this.modal.onClosed.subscribe(() => {\n this.modal = null;\n });\n }\n\n invite() {\n this.edit(null);\n }\n\n groups(user: OrganizationUserUserDetailsResponse) {\n if (this.modal != null) {\n this.modal.close();\n }\n\n const factory = this.componentFactoryResolver.resolveComponentFactory(ModalComponent);\n this.modal = this.groupsModalRef.createComponent(factory).instance;\n const childComponent = this.modal.show(\n UserGroupsComponent, this.groupsModalRef);\n\n childComponent.name = user != null ? user.name || user.email : null;\n childComponent.organizationId = this.organizationId;\n childComponent.organizationUserId = user != null ? user.id : null;\n childComponent.onSavedUser.subscribe(() => {\n this.modal.close();\n });\n\n this.modal.onClosed.subscribe(() => {\n this.modal = null;\n });\n }\n\n async remove(user: OrganizationUserUserDetailsResponse) {\n const confirmed = await this.platformUtilsService.showDialog(\n this.i18nService.t('removeUserConfirmation'), user.name || user.email,\n this.i18nService.t('yes'), this.i18nService.t('no'), 'warning');\n if (!confirmed) {\n return false;\n }\n\n try {\n await this.apiService.deleteOrganizationUser(this.organizationId, user.id);\n this.analytics.eventTrack.next({ action: 'Deleted User' });\n this.toasterService.popAsync('success', null, this.i18nService.t('removedUserId', user.name || user.email));\n this.removeUser(user);\n } catch { }\n }\n\n async reinvite(user: OrganizationUserUserDetailsResponse) {\n if (this.actionPromise != null) {\n return;\n }\n this.actionPromise = this.apiService.postOrganizationUserReinvite(this.organizationId, user.id);\n await this.actionPromise;\n this.analytics.eventTrack.next({ action: 'Reinvited User' });\n this.toasterService.popAsync('success', null, this.i18nService.t('hasBeenReinvited', user.name || user.email));\n this.actionPromise = null;\n }\n\n async confirm(user: OrganizationUserUserDetailsResponse) {\n if (this.actionPromise != null) {\n return;\n }\n this.actionPromise = this.doConfirmation(user);\n await this.actionPromise;\n user.status = OrganizationUserStatusType.Confirmed;\n this.analytics.eventTrack.next({ action: 'Confirmed User' });\n this.toasterService.popAsync('success', null, this.i18nService.t('hasBeenConfirmed', user.name || user.email));\n this.actionPromise = null;\n }\n\n async events(user: OrganizationUserUserDetailsResponse) {\n if (this.modal != null) {\n this.modal.close();\n }\n\n const factory = this.componentFactoryResolver.resolveComponentFactory(ModalComponent);\n this.modal = this.eventsModalRef.createComponent(factory).instance;\n const childComponent = this.modal.show(\n EntityEventsComponent, this.eventsModalRef);\n\n childComponent.name = user.name || user.email;\n childComponent.organizationId = this.organizationId;\n childComponent.entityId = user.id;\n childComponent.showUser = false;\n childComponent.entity = 'user';\n\n this.modal.onClosed.subscribe(() => {\n this.modal = null;\n });\n }\n\n private async doConfirmation(user: OrganizationUserUserDetailsResponse) {\n const orgKey = await this.cryptoService.getOrgKey(this.organizationId);\n const publicKeyResponse = await this.apiService.getUserPublicKey(user.userId);\n const publicKey = Utils.fromB64ToArray(publicKeyResponse.publicKey);\n const key = await this.cryptoService.rsaEncrypt(orgKey.key, publicKey.buffer);\n const request = new OrganizationUserConfirmRequest();\n request.key = key.encryptedString;\n await this.apiService.postOrganizationUserConfirm(this.organizationId, user.id, request);\n }\n\n private removeUser(user: OrganizationUserUserDetailsResponse) {\n const index = this.users.indexOf(user);\n if (index > -1) {\n this.users.splice(index, 1);\n }\n }\n}\n","import {\n Component,\n ComponentFactoryResolver,\n OnInit,\n ViewChild,\n ViewContainerRef,\n} from '@angular/core';\nimport {\n ActivatedRoute,\n Router,\n} from '@angular/router';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\nimport { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';\nimport { UserService } from 'jslib/abstractions/user.service';\n\nimport { GroupResponse } from 'jslib/models/response/groupResponse';\n\nimport { Utils } from 'jslib/misc/utils';\n\nimport { ModalComponent } from '../../modal.component';\nimport { EntityUsersComponent } from './entity-users.component';\nimport { GroupAddEditComponent } from './group-add-edit.component';\n\n@Component({\n selector: 'app-org-groups',\n templateUrl: 'groups.component.html',\n})\nexport class GroupsComponent implements OnInit {\n @ViewChild('addEdit', { read: ViewContainerRef }) addEditModalRef: ViewContainerRef;\n @ViewChild('usersTemplate', { read: ViewContainerRef }) usersModalRef: ViewContainerRef;\n\n loading = true;\n organizationId: string;\n groups: GroupResponse[];\n searchText: string;\n\n private modal: ModalComponent = null;\n\n constructor(private apiService: ApiService, private route: ActivatedRoute,\n private i18nService: I18nService, private componentFactoryResolver: ComponentFactoryResolver,\n private analytics: Angulartics2, private toasterService: ToasterService,\n private platformUtilsService: PlatformUtilsService, private userService: UserService,\n private router: Router) { }\n\n async ngOnInit() {\n this.route.parent.parent.params.subscribe(async (params) => {\n this.organizationId = params.organizationId;\n const organization = await this.userService.getOrganization(this.organizationId);\n if (organization == null || !organization.useGroups) {\n this.router.navigate(['/organizations', this.organizationId]);\n return;\n }\n await this.load();\n this.route.queryParams.subscribe(async (qParams) => {\n this.searchText = qParams.search;\n });\n });\n }\n\n async load() {\n const response = await this.apiService.getGroups(this.organizationId);\n const groups = response.data != null && response.data.length > 0 ? response.data : [];\n groups.sort(Utils.getSortFunction(this.i18nService, 'name'));\n this.groups = groups;\n this.loading = false;\n }\n\n edit(group: GroupResponse) {\n if (this.modal != null) {\n this.modal.close();\n }\n\n const factory = this.componentFactoryResolver.resolveComponentFactory(ModalComponent);\n this.modal = this.addEditModalRef.createComponent(factory).instance;\n const childComponent = this.modal.show(\n GroupAddEditComponent, this.addEditModalRef);\n\n childComponent.organizationId = this.organizationId;\n childComponent.groupId = group != null ? group.id : null;\n childComponent.onSavedGroup.subscribe(() => {\n this.modal.close();\n this.load();\n });\n childComponent.onDeletedGroup.subscribe(() => {\n this.modal.close();\n this.removeGroup(group);\n });\n\n this.modal.onClosed.subscribe(() => {\n this.modal = null;\n });\n }\n\n add() {\n this.edit(null);\n }\n\n async delete(group: GroupResponse) {\n const confirmed = await this.platformUtilsService.showDialog(\n this.i18nService.t('deleteGroupConfirmation'), group.name,\n this.i18nService.t('yes'), this.i18nService.t('no'), 'warning');\n if (!confirmed) {\n return false;\n }\n\n try {\n await this.apiService.deleteGroup(this.organizationId, group.id);\n this.analytics.eventTrack.next({ action: 'Deleted Group' });\n this.toasterService.popAsync('success', null, this.i18nService.t('deletedGroupId', group.name));\n this.removeGroup(group);\n } catch { }\n }\n\n users(group: GroupResponse) {\n if (this.modal != null) {\n this.modal.close();\n }\n\n const factory = this.componentFactoryResolver.resolveComponentFactory(ModalComponent);\n this.modal = this.usersModalRef.createComponent(factory).instance;\n const childComponent = this.modal.show(\n EntityUsersComponent, this.usersModalRef);\n\n childComponent.organizationId = this.organizationId;\n childComponent.entity = 'group';\n childComponent.entityId = group.id;\n childComponent.entityName = group.name;\n\n this.modal.onClosed.subscribe(() => {\n this.modal = null;\n });\n }\n\n private removeGroup(group: GroupResponse) {\n const index = this.groups.indexOf(group);\n if (index > -1) {\n this.groups.splice(index, 1);\n }\n }\n}\n","import {\r\n Component,\r\n OnInit,\r\n} from '@angular/core';\r\nimport { ActivatedRoute, Router } from '@angular/router';\r\n\r\nimport { ToasterService } from 'angular2-toaster';\r\n\r\nimport { ApiService } from 'jslib/abstractions/api.service';\r\nimport { I18nService } from 'jslib/abstractions/i18n.service';\r\nimport { UserService } from 'jslib/abstractions/user.service';\r\n\r\nimport { EventService } from '../../services/event.service';\r\n\r\nimport { EventResponse } from 'jslib/models/response/eventResponse';\r\nimport { ListResponse } from 'jslib/models/response/listResponse';\r\n\r\n@Component({\r\n selector: 'app-org-events',\r\n templateUrl: 'events.component.html',\r\n})\r\nexport class EventsComponent implements OnInit {\r\n loading = true;\r\n loaded = false;\r\n organizationId: string;\r\n events: any[];\r\n start: string;\r\n end: string;\r\n continuationToken: string;\r\n refreshPromise: Promise;\r\n morePromise: Promise;\r\n\r\n private orgUsersUserIdMap = new Map();\r\n private orgUsersIdMap = new Map();\r\n\r\n constructor(private apiService: ApiService, private route: ActivatedRoute,\r\n private eventService: EventService, private i18nService: I18nService,\r\n private toasterService: ToasterService, private userService: UserService,\r\n private router: Router) { }\r\n\r\n async ngOnInit() {\r\n this.route.parent.parent.params.subscribe(async (params) => {\r\n this.organizationId = params.organizationId;\r\n const organization = await this.userService.getOrganization(this.organizationId);\r\n if (organization == null || !organization.useEvents) {\r\n this.router.navigate(['/organizations', this.organizationId]);\r\n return;\r\n }\r\n const defaultDates = this.eventService.getDefaultDateFilters();\r\n this.start = defaultDates[0];\r\n this.end = defaultDates[1];\r\n await this.load();\r\n });\r\n }\r\n\r\n async load() {\r\n const response = await this.apiService.getOrganizationUsers(this.organizationId);\r\n response.data.forEach((u) => {\r\n const name = u.name == null || u.name.trim() === '' ? u.email : u.name;\r\n this.orgUsersIdMap.set(u.id, { name: name, email: u.email });\r\n this.orgUsersUserIdMap.set(u.userId, { name: name, email: u.email });\r\n });\r\n await this.loadEvents(true);\r\n this.loaded = true;\r\n }\r\n\r\n async loadEvents(clearExisting: boolean) {\r\n if (this.refreshPromise != null || this.morePromise != null) {\r\n return;\r\n }\r\n\r\n let dates: string[] = null;\r\n try {\r\n dates = this.eventService.formatDateFilters(this.start, this.end);\r\n } catch (e) {\r\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'),\r\n this.i18nService.t('invalidDateRange'));\r\n return;\r\n }\r\n\r\n this.loading = true;\r\n let response: ListResponse;\r\n try {\r\n const promise = this.apiService.getEventsOrganization(this.organizationId, dates[0], dates[1],\r\n clearExisting ? null : this.continuationToken);\r\n if (clearExisting) {\r\n this.refreshPromise = promise;\r\n } else {\r\n this.morePromise = promise;\r\n }\r\n response = await promise;\r\n } catch { }\r\n\r\n this.continuationToken = response.continuationToken;\r\n const events = response.data.map((r) => {\r\n const userId = r.actingUserId == null ? r.userId : r.actingUserId;\r\n const eventInfo = this.eventService.getEventInfo(r);\r\n const user = userId != null && this.orgUsersUserIdMap.has(userId) ?\r\n this.orgUsersUserIdMap.get(userId) : null;\r\n return {\r\n message: eventInfo.message,\r\n appIcon: eventInfo.appIcon,\r\n appName: eventInfo.appName,\r\n userId: userId,\r\n userName: user != null ? user.name : this.i18nService.t('unknown'),\r\n userEmail: user != null ? user.email : '',\r\n date: r.date,\r\n ip: r.ipAddress,\r\n type: r.type,\r\n };\r\n });\r\n\r\n if (!clearExisting && this.events != null && this.events.length > 0) {\r\n this.events = this.events.concat(events);\r\n } else {\r\n this.events = events;\r\n }\r\n\r\n this.loading = false;\r\n this.morePromise = null;\r\n this.refreshPromise = null;\r\n }\r\n}\r\n","export enum OrganizationUserStatusType {\n Invited = 0,\n Accepted = 1,\n Confirmed = 2,\n}\n","import {\n Component,\n EventEmitter,\n Input,\n OnInit,\n Output,\n} from '@angular/core';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\nimport { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';\n\nimport { OrganizationUserStatusType } from 'jslib/enums/organizationUserStatusType';\nimport { OrganizationUserType } from 'jslib/enums/organizationUserType';\n\nimport { Utils } from 'jslib/misc/utils';\n\n@Component({\n selector: 'app-entity-users',\n templateUrl: 'entity-users.component.html',\n})\nexport class EntityUsersComponent implements OnInit {\n @Input() entity: 'group' | 'collection';\n @Input() entityId: string;\n @Input() entityName: string;\n @Input() organizationId: string;\n @Output() onRemovedUser = new EventEmitter();\n\n organizationUserType = OrganizationUserType;\n organizationUserStatusType = OrganizationUserStatusType;\n\n loading = true;\n users: any[] = [];\n actionPromise: Promise;\n\n constructor(private apiService: ApiService, private i18nService: I18nService,\n private analytics: Angulartics2, private toasterService: ToasterService,\n private platformUtilsService: PlatformUtilsService) { }\n\n async ngOnInit() {\n await this.loadUsers();\n this.loading = false;\n }\n\n async loadUsers() {\n let users: any[] = [];\n if (this.entity === 'group') {\n const response = await this.apiService.getGroupUsers(this.organizationId, this.entityId);\n users = response.data.map((r) => r);\n } else if (this.entity === 'collection') {\n const response = await this.apiService.getCollectionUsers(this.organizationId, this.entityId);\n users = response.data.map((r) => r);\n }\n users.sort(Utils.getSortFunction(this.i18nService, 'email'));\n this.users = users;\n }\n\n async remove(user: any) {\n if (this.actionPromise != null || (this.entity === 'collection' && user.accessAll)) {\n return;\n }\n\n const confirmed = await this.platformUtilsService.showDialog(\n this.i18nService.t('removeUserConfirmation'), user.email,\n this.i18nService.t('yes'), this.i18nService.t('no'), 'warning');\n if (!confirmed) {\n return false;\n }\n\n try {\n if (this.entity === 'group') {\n this.actionPromise = this.apiService.deleteGroupUser(this.organizationId, this.entityId,\n user.organizationUserId);\n await this.actionPromise;\n this.analytics.eventTrack.next({ action: 'Removed User From Group' });\n } else if (this.entity === 'collection') {\n this.actionPromise = this.apiService.deleteCollectionUser(this.organizationId, this.entityId,\n user.organizationUserId);\n await this.actionPromise;\n this.analytics.eventTrack.next({ action: 'Removed User From Collection' });\n }\n\n this.toasterService.popAsync('success', null, this.i18nService.t('removedUserId', user.email));\n this.onRemovedUser.emit();\n const index = this.users.indexOf(user);\n if (index > -1) {\n this.users.splice(index, 1);\n }\n } catch { }\n }\n}\n","export class SelectionReadOnlyRequest {\n id: string;\n readOnly: boolean;\n\n constructor(id: string, readOnly: boolean) {\n this.id = id;\n this.readOnly = readOnly;\n }\n}\n","import {\n Component,\n ComponentFactoryResolver,\n OnInit,\n ViewChild,\n ViewContainerRef,\n} from '@angular/core';\nimport { ActivatedRoute } from '@angular/router';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { CollectionService } from 'jslib/abstractions/collection.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\nimport { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';\n\nimport { CollectionData } from 'jslib/models/data/collectionData';\nimport { Collection } from 'jslib/models/domain/collection';\nimport { CollectionDetailsResponse } from 'jslib/models/response/collectionResponse';\nimport { CollectionView } from 'jslib/models/view/collectionView';\n\nimport { ModalComponent } from '../../modal.component';\nimport { CollectionAddEditComponent } from './collection-add-edit.component';\nimport { EntityUsersComponent } from './entity-users.component';\n\n@Component({\n selector: 'app-org-manage-collections',\n templateUrl: 'collections.component.html',\n})\nexport class CollectionsComponent implements OnInit {\n @ViewChild('addEdit', { read: ViewContainerRef }) addEditModalRef: ViewContainerRef;\n @ViewChild('usersTemplate', { read: ViewContainerRef }) usersModalRef: ViewContainerRef;\n\n loading = true;\n organizationId: string;\n collections: CollectionView[];\n searchText: string;\n\n private modal: ModalComponent = null;\n\n constructor(private apiService: ApiService, private route: ActivatedRoute,\n private collectionService: CollectionService, private componentFactoryResolver: ComponentFactoryResolver,\n private analytics: Angulartics2, private toasterService: ToasterService,\n private i18nService: I18nService, private platformUtilsService: PlatformUtilsService) { }\n\n async ngOnInit() {\n this.route.parent.parent.params.subscribe(async (params) => {\n this.organizationId = params.organizationId;\n await this.load();\n this.route.queryParams.subscribe(async (qParams) => {\n this.searchText = qParams.search;\n });\n });\n }\n\n async load() {\n const response = await this.apiService.getCollections(this.organizationId);\n const collections = response.data.map((r) =>\n new Collection(new CollectionData(r as CollectionDetailsResponse)));\n this.collections = await this.collectionService.decryptMany(collections);\n this.loading = false;\n }\n\n edit(collection: CollectionView) {\n if (this.modal != null) {\n this.modal.close();\n }\n\n const factory = this.componentFactoryResolver.resolveComponentFactory(ModalComponent);\n this.modal = this.addEditModalRef.createComponent(factory).instance;\n const childComponent = this.modal.show(\n CollectionAddEditComponent, this.addEditModalRef);\n\n childComponent.organizationId = this.organizationId;\n childComponent.collectionId = collection != null ? collection.id : null;\n childComponent.onSavedCollection.subscribe(() => {\n this.modal.close();\n this.load();\n });\n childComponent.onDeletedCollection.subscribe(() => {\n this.modal.close();\n this.removeCollection(collection);\n });\n\n this.modal.onClosed.subscribe(() => {\n this.modal = null;\n });\n }\n\n add() {\n this.edit(null);\n }\n\n async delete(collection: CollectionView) {\n const confirmed = await this.platformUtilsService.showDialog(\n this.i18nService.t('deleteCollectionConfirmation'), collection.name,\n this.i18nService.t('yes'), this.i18nService.t('no'), 'warning');\n if (!confirmed) {\n return false;\n }\n\n try {\n await this.apiService.deleteCollection(this.organizationId, collection.id);\n this.analytics.eventTrack.next({ action: 'Deleted Collection' });\n this.toasterService.popAsync('success', null, this.i18nService.t('deletedCollectionId', collection.name));\n this.removeCollection(collection);\n } catch { }\n }\n\n users(collection: CollectionView) {\n if (this.modal != null) {\n this.modal.close();\n }\n\n const factory = this.componentFactoryResolver.resolveComponentFactory(ModalComponent);\n this.modal = this.usersModalRef.createComponent(factory).instance;\n const childComponent = this.modal.show(\n EntityUsersComponent, this.usersModalRef);\n\n childComponent.organizationId = this.organizationId;\n childComponent.entity = 'collection';\n childComponent.entityId = collection.id;\n childComponent.entityName = collection.name;\n\n this.modal.onClosed.subscribe(() => {\n this.modal = null;\n });\n }\n\n private removeCollection(collection: CollectionView) {\n const index = this.collections.indexOf(collection);\n if (index > -1) {\n this.collections.splice(index, 1);\n }\n }\n}\n","import {\n Pipe,\n PipeTransform,\n} from '@angular/core';\n\n@Pipe({\n name: 'search',\n})\nexport class SearchPipe implements PipeTransform {\n transform(items: any[], searchText: string, prop1?: string, prop2?: string, prop3?: string): any[] {\n if (items == null || items.length === 0) {\n return [];\n }\n\n if (searchText == null || searchText.length < 2) {\n return items;\n }\n\n searchText = searchText.trim().toLowerCase();\n return items.filter((i) => {\n if (prop1 != null && i[prop1] != null && i[prop1].toString().toLowerCase().indexOf(searchText) > -1) {\n return true;\n }\n if (prop2 != null && i[prop2] != null && i[prop2].toString().toLowerCase().indexOf(searchText) > -1) {\n return true;\n }\n if (prop3 != null && i[prop3] != null && i[prop3].toString().toLowerCase().indexOf(searchText) > -1) {\n return true;\n }\n return false;\n });\n }\n}\n","import {\r\n Component,\r\n OnInit,\r\n} from '@angular/core';\r\nimport { ActivatedRoute } from '@angular/router';\r\n\r\nimport { UserService } from 'jslib/abstractions/user.service';\r\n\r\n@Component({\r\n selector: 'app-org-manage',\r\n templateUrl: 'manage.component.html',\r\n})\r\nexport class ManageComponent implements OnInit {\r\n accessGroups = false;\r\n accessEvents = false;\r\n\r\n constructor(private route: ActivatedRoute, private userService: UserService) { }\r\n\r\n ngOnInit() {\r\n this.route.parent.params.subscribe(async (params) => {\r\n const organization = await this.userService.getOrganization(params.organizationId);\r\n this.accessEvents = organization.useEvents;\r\n this.accessGroups = organization.useGroups;\r\n });\r\n }\r\n}\r\n","import { ToasterService } from 'angular2-toaster';\r\nimport { Angulartics2 } from 'angulartics2';\r\n\r\nimport { Component } from '@angular/core';\r\nimport { ActivatedRoute } from '@angular/router';\r\n\r\nimport { CryptoService } from 'jslib/abstractions/crypto.service';\r\nimport { ExportService } from 'jslib/abstractions/export.service';\r\nimport { I18nService } from 'jslib/abstractions/i18n.service';\r\nimport { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';\r\nimport { UserService } from 'jslib/abstractions/user.service';\r\n\r\nimport { ExportComponent as BaseExportComponent } from '../../tools/export.component';\r\n\r\n@Component({\r\n selector: 'app-org-export',\r\n templateUrl: '../../tools/export.component.html',\r\n})\r\nexport class ExportComponent extends BaseExportComponent {\r\n organizationId: string;\r\n\r\n constructor(analytics: Angulartics2, toasterService: ToasterService,\r\n cryptoService: CryptoService, userService: UserService,\r\n i18nService: I18nService, platformUtilsService: PlatformUtilsService,\r\n exportService: ExportService, private route: ActivatedRoute) {\r\n super(analytics, toasterService, cryptoService, userService, i18nService, platformUtilsService,\r\n exportService);\r\n }\r\n\r\n ngOnInit() {\r\n this.route.parent.parent.params.subscribe(async (params) => {\r\n this.organizationId = params.organizationId;\r\n });\r\n }\r\n\r\n getExportData() {\r\n return this.exportService.getOrganizationExport(this.organizationId, 'csv');\r\n }\r\n\r\n getFileName() {\r\n return super.getFileName('org');\r\n }\r\n}\r\n","import { Component } from '@angular/core';\nimport {\n ActivatedRoute,\n Router,\n} from '@angular/router';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { CipherService } from 'jslib/abstractions/cipher.service';\nimport { CollectionService } from 'jslib/abstractions/collection.service';\nimport { FolderService } from 'jslib/abstractions/folder.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\n\nimport { Importer } from 'jslib/importers/importer';\n\nimport { CipherRequest } from 'jslib/models/request/cipherRequest';\nimport { CollectionRequest } from 'jslib/models/request/collectionRequest';\nimport { ImportOrganizationCiphersRequest } from 'jslib/models/request/importOrganizationCiphersRequest';\nimport { KvpRequest } from 'jslib/models/request/kvpRequest';\n\nimport { ImportResult } from 'jslib/models/domain/importResult';\n\nimport { ImportComponent as BaseImportComponent } from '../../tools/import.component';\n\n@Component({\n selector: 'app-org-import',\n templateUrl: '../../tools/import.component.html',\n})\nexport class ImportComponent extends BaseImportComponent {\n organizationId: string;\n\n constructor(i18nService: I18nService, analytics: Angulartics2,\n toasterService: ToasterService, cipherService: CipherService,\n folderService: FolderService, apiService: ApiService,\n router: Router, private collectionService: CollectionService,\n private route: ActivatedRoute) {\n super(i18nService, analytics, toasterService, cipherService, folderService, apiService, router);\n }\n\n ngOnInit() {\n this.route.parent.parent.params.subscribe(async (params) => {\n this.organizationId = params.organizationId;\n this.successNavigate = ['organizations', this.organizationId, 'vault'];\n super.ngOnInit();\n });\n }\n\n protected async postImport(importResult: ImportResult) {\n const request = new ImportOrganizationCiphersRequest();\n for (let i = 0; i < importResult.ciphers.length; i++) {\n importResult.ciphers[i].organizationId = this.organizationId;\n const c = await this.cipherService.encrypt(importResult.ciphers[i]);\n request.ciphers.push(new CipherRequest(c));\n }\n if (importResult.collections != null) {\n for (let i = 0; i < importResult.collections.length; i++) {\n importResult.collections[i].organizationId = this.organizationId;\n const c = await this.collectionService.encrypt(importResult.collections[i]);\n request.collections.push(new CollectionRequest(c));\n }\n }\n if (importResult.collectionRelationships != null) {\n importResult.collectionRelationships.forEach((r) =>\n request.collectionRelationships.push(new KvpRequest(r[0], r[1])));\n }\n return await this.apiService.postImportOrganizationCiphers(this.organizationId, request);\n }\n\n protected getImporter(): Importer {\n const importer = super.getImporter();\n if (importer != null) {\n importer.organization = true;\n }\n return importer;\n }\n}\n","import { Component } from '@angular/core';\r\n\r\n@Component({\r\n selector: 'app-org-tools',\r\n templateUrl: 'tools.component.html',\r\n})\r\nexport class ToolsComponent { }\r\n","import {\n Component,\n Input,\n OnInit,\n} from '@angular/core';\n\nimport { ToasterService } from 'angular2-toaster';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\n\nimport { EventService } from '../../services/event.service';\n\nimport { EventResponse } from 'jslib/models/response/eventResponse';\nimport { ListResponse } from 'jslib/models/response/listResponse';\n\n@Component({\n selector: 'app-entity-events',\n templateUrl: 'entity-events.component.html',\n})\nexport class EntityEventsComponent implements OnInit {\n @Input() name: string;\n @Input() entity: 'user' | 'cipher';\n @Input() entityId: string;\n @Input() organizationId: string;\n @Input() showUser = false;\n\n loading = true;\n loaded = false;\n events: any[];\n start: string;\n end: string;\n continuationToken: string;\n refreshPromise: Promise;\n morePromise: Promise;\n\n private orgUsersUserIdMap = new Map();\n private orgUsersIdMap = new Map();\n\n constructor(private apiService: ApiService, private i18nService: I18nService,\n private eventService: EventService, private toasterService: ToasterService) { }\n\n async ngOnInit() {\n const defaultDates = this.eventService.getDefaultDateFilters();\n this.start = defaultDates[0];\n this.end = defaultDates[1];\n await this.load();\n }\n\n async load() {\n if (this.showUser) {\n const response = await this.apiService.getOrganizationUsers(this.organizationId);\n response.data.forEach((u) => {\n const name = u.name == null || u.name.trim() === '' ? u.email : u.name;\n this.orgUsersIdMap.set(u.id, { name: name, email: u.email });\n this.orgUsersUserIdMap.set(u.userId, { name: name, email: u.email });\n });\n }\n await this.loadEvents(true);\n this.loaded = true;\n }\n\n async loadEvents(clearExisting: boolean) {\n if (this.refreshPromise != null || this.morePromise != null) {\n return;\n }\n\n let dates: string[] = null;\n try {\n dates = this.eventService.formatDateFilters(this.start, this.end);\n } catch (e) {\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'),\n this.i18nService.t('invalidDateRange'));\n return;\n }\n\n this.loading = true;\n let response: ListResponse;\n try {\n let promise: Promise;\n if (this.entity === 'user') {\n promise = this.apiService.getEventsOrganizationUser(this.organizationId, this.entityId,\n dates[0], dates[1], clearExisting ? null : this.continuationToken);\n } else {\n promise = this.apiService.getEventsCipher(this.entityId,\n dates[0], dates[1], clearExisting ? null : this.continuationToken);\n }\n if (clearExisting) {\n this.refreshPromise = promise;\n } else {\n this.morePromise = promise;\n }\n response = await promise;\n } catch { }\n\n this.continuationToken = response.continuationToken;\n const events = response.data.map((r) => {\n const userId = r.actingUserId == null ? r.userId : r.actingUserId;\n const eventInfo = this.eventService.getEventInfo(r);\n const user = this.showUser && userId != null && this.orgUsersUserIdMap.has(userId) ?\n this.orgUsersUserIdMap.get(userId) : null;\n return {\n message: eventInfo.message,\n appIcon: eventInfo.appIcon,\n appName: eventInfo.appName,\n userId: userId,\n userName: user != null ? user.name : this.showUser ? this.i18nService.t('unknown') : null,\n userEmail: user != null ? user.email : this.showUser ? '' : null,\n date: r.date,\n ip: r.ipAddress,\n type: r.type,\n };\n });\n\n if (!clearExisting && this.events != null && this.events.length > 0) {\n this.events = this.events.concat(events);\n } else {\n this.events = events;\n }\n\n this.loading = false;\n this.morePromise = null;\n this.refreshPromise = null;\n }\n}\n","import { Location } from '@angular/common';\nimport {\n Component,\n ComponentFactoryResolver,\n OnInit,\n ViewChild,\n ViewContainerRef,\n} from '@angular/core';\nimport {\n ActivatedRoute,\n Router,\n} from '@angular/router';\n\nimport { I18nService } from 'jslib/abstractions/i18n.service';\nimport { MessagingService } from 'jslib/abstractions/messaging.service';\nimport { SyncService } from 'jslib/abstractions/sync.service';\nimport { UserService } from 'jslib/abstractions/user.service';\n\nimport { Organization } from 'jslib/models/domain/organization';\nimport { CipherView } from 'jslib/models/view/cipherView';\n\nimport { CipherType } from 'jslib/enums/cipherType';\n\nimport { ModalComponent } from '../../modal.component';\n\nimport { EntityEventsComponent } from '../manage/entity-events.component';\nimport { AddEditComponent } from './add-edit.component';\nimport { AttachmentsComponent } from './attachments.component';\nimport { CiphersComponent } from './ciphers.component';\nimport { CollectionsComponent } from './collections.component';\nimport { GroupingsComponent } from './groupings.component';\n\n@Component({\n selector: 'app-org-vault',\n templateUrl: 'vault.component.html',\n})\nexport class VaultComponent implements OnInit {\n @ViewChild(GroupingsComponent) groupingsComponent: GroupingsComponent;\n @ViewChild(CiphersComponent) ciphersComponent: CiphersComponent;\n @ViewChild('attachments', { read: ViewContainerRef }) attachmentsModalRef: ViewContainerRef;\n @ViewChild('cipherAddEdit', { read: ViewContainerRef }) cipherAddEditModalRef: ViewContainerRef;\n @ViewChild('collections', { read: ViewContainerRef }) collectionsModalRef: ViewContainerRef;\n @ViewChild('eventsTemplate', { read: ViewContainerRef }) eventsModalRef: ViewContainerRef;\n\n organization: Organization;\n collectionId: string;\n type: CipherType;\n\n private modal: ModalComponent = null;\n\n constructor(private route: ActivatedRoute, private userService: UserService,\n private location: Location, private router: Router,\n private syncService: SyncService, private i18nService: I18nService,\n private componentFactoryResolver: ComponentFactoryResolver, private messagingService: MessagingService) { }\n\n ngOnInit() {\n this.route.parent.params.subscribe(async (params) => {\n this.organization = await this.userService.getOrganization(params.organizationId);\n this.groupingsComponent.organization = this.organization;\n this.ciphersComponent.organization = this.organization;\n\n this.route.queryParams.subscribe(async (qParams) => {\n if (!this.organization.isAdmin) {\n await this.syncService.fullSync(false);\n }\n await this.groupingsComponent.load();\n\n if (qParams == null) {\n this.groupingsComponent.selectedAll = true;\n await this.ciphersComponent.load();\n } else {\n if (qParams.type) {\n const t = parseInt(qParams.type, null);\n this.groupingsComponent.selectedType = t;\n await this.filterCipherType(t, true);\n } else if (qParams.collectionId) {\n this.groupingsComponent.selectedCollectionId = qParams.collectionId;\n await this.filterCollection(qParams.collectionId, true);\n } else {\n this.groupingsComponent.selectedAll = true;\n await this.ciphersComponent.load();\n }\n }\n\n this.ciphersComponent.searchText = this.groupingsComponent.searchText = qParams.search;\n if (qParams.viewEvents != null) {\n const cipher = this.ciphersComponent.ciphers.filter((c) => c.id === qParams.viewEvents);\n if (cipher.length > 0) {\n this.viewEvents(cipher[0]);\n }\n }\n });\n });\n }\n\n async clearGroupingFilters() {\n this.ciphersComponent.showAddNew = true;\n this.groupingsComponent.searchPlaceholder = this.i18nService.t('searchVault');\n await this.ciphersComponent.applyFilter();\n this.clearFilters();\n this.go();\n }\n\n async filterCipherType(type: CipherType, load = false) {\n this.ciphersComponent.showAddNew = true;\n this.groupingsComponent.searchPlaceholder = this.i18nService.t('searchType');\n const filter = (c: CipherView) => c.type === type;\n if (load) {\n await this.ciphersComponent.load(filter);\n } else {\n await this.ciphersComponent.applyFilter(filter);\n }\n this.clearFilters();\n this.type = type;\n this.go();\n }\n\n async filterCollection(collectionId: string, load = false) {\n this.ciphersComponent.showAddNew = false;\n this.groupingsComponent.searchPlaceholder = this.i18nService.t('searchCollection');\n const filter = (c: CipherView) => {\n if (collectionId === 'unassigned') {\n return c.collectionIds == null || c.collectionIds.length === 0;\n } else {\n return c.collectionIds.indexOf(collectionId) > -1;\n }\n };\n if (load) {\n await this.ciphersComponent.load(filter);\n } else {\n await this.ciphersComponent.applyFilter(filter);\n }\n this.clearFilters();\n this.collectionId = collectionId;\n this.go();\n }\n\n filterSearchText(searchText: string) {\n this.ciphersComponent.searchText = searchText;\n }\n\n editCipherAttachments(cipher: CipherView) {\n if (this.organization.maxStorageGb == null || this.organization.maxStorageGb === 0) {\n this.messagingService.send('upgradeOrganization', { organizationId: cipher.organizationId });\n return;\n }\n\n if (this.modal != null) {\n this.modal.close();\n }\n\n const factory = this.componentFactoryResolver.resolveComponentFactory(ModalComponent);\n this.modal = this.attachmentsModalRef.createComponent(factory).instance;\n const childComponent = this.modal.show(AttachmentsComponent, this.attachmentsModalRef);\n\n childComponent.organization = this.organization;\n childComponent.cipherId = cipher.id;\n let madeAttachmentChanges = false;\n childComponent.onUploadedAttachment.subscribe(() => madeAttachmentChanges = true);\n childComponent.onDeletedAttachment.subscribe(() => madeAttachmentChanges = true);\n\n this.modal.onClosed.subscribe(async () => {\n this.modal = null;\n if (madeAttachmentChanges) {\n await this.ciphersComponent.refresh();\n }\n madeAttachmentChanges = false;\n });\n }\n\n editCipherCollections(cipher: CipherView) {\n if (this.modal != null) {\n this.modal.close();\n }\n\n const factory = this.componentFactoryResolver.resolveComponentFactory(ModalComponent);\n this.modal = this.collectionsModalRef.createComponent(factory).instance;\n const childComponent = this.modal.show(CollectionsComponent, this.collectionsModalRef);\n\n if (this.organization.isAdmin) {\n childComponent.collectionIds = cipher.collectionIds;\n childComponent.collections = this.groupingsComponent.collections.filter((c) => !c.readOnly);\n }\n childComponent.organization = this.organization;\n childComponent.cipherId = cipher.id;\n childComponent.onSavedCollections.subscribe(async () => {\n this.modal.close();\n await this.ciphersComponent.refresh();\n });\n\n this.modal.onClosed.subscribe(async () => {\n this.modal = null;\n });\n }\n\n addCipher() {\n const component = this.editCipher(null);\n component.type = this.type;\n }\n\n editCipher(cipher: CipherView) {\n if (this.modal != null) {\n this.modal.close();\n }\n\n const factory = this.componentFactoryResolver.resolveComponentFactory(ModalComponent);\n this.modal = this.cipherAddEditModalRef.createComponent(factory).instance;\n const childComponent = this.modal.show(AddEditComponent, this.cipherAddEditModalRef);\n\n childComponent.organization = this.organization;\n childComponent.cipherId = cipher == null ? null : cipher.id;\n childComponent.onSavedCipher.subscribe(async (c: CipherView) => {\n this.modal.close();\n await this.ciphersComponent.refresh();\n });\n childComponent.onDeletedCipher.subscribe(async (c: CipherView) => {\n this.modal.close();\n await this.ciphersComponent.refresh();\n });\n\n this.modal.onClosed.subscribe(() => {\n this.modal = null;\n });\n\n return childComponent;\n }\n\n async viewEvents(cipher: CipherView) {\n if (this.modal != null) {\n this.modal.close();\n }\n\n const factory = this.componentFactoryResolver.resolveComponentFactory(ModalComponent);\n this.modal = this.eventsModalRef.createComponent(factory).instance;\n const childComponent = this.modal.show(\n EntityEventsComponent, this.eventsModalRef);\n\n childComponent.name = cipher.name;\n childComponent.organizationId = this.organization.id;\n childComponent.entityId = cipher.id;\n childComponent.showUser = true;\n childComponent.entity = 'cipher';\n\n this.modal.onClosed.subscribe(() => {\n this.modal = null;\n });\n }\n\n private clearFilters() {\n this.collectionId = null;\n this.type = null;\n }\n\n private go(queryParams: any = null) {\n if (queryParams == null) {\n queryParams = {\n type: this.type,\n collectionId: this.collectionId,\n };\n }\n\n const url = this.router.createUrlTree(['organizations', this.organization.id, 'vault'],\n { queryParams: queryParams }).toString();\n this.location.go(url);\n }\n}\n","import {\n Component,\n EventEmitter,\n Output,\n} from '@angular/core';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { CipherService } from 'jslib/abstractions/cipher.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\nimport { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';\n\nimport { CipherData } from 'jslib/models/data/cipherData';\nimport { Cipher } from 'jslib/models/domain/cipher';\nimport { Organization } from 'jslib/models/domain/organization';\nimport { CipherView } from 'jslib/models/view/cipherView';\n\nimport { CiphersComponent as BaseCiphersComponent } from '../../vault/ciphers.component';\n\n@Component({\n selector: 'app-org-vault-ciphers',\n templateUrl: '../../vault/ciphers.component.html',\n})\nexport class CiphersComponent extends BaseCiphersComponent {\n @Output() onEventsClicked = new EventEmitter();\n\n organization: Organization;\n accessEvents = false;\n\n constructor(cipherService: CipherService, analytics: Angulartics2,\n toasterService: ToasterService, i18nService: I18nService,\n platformUtilsService: PlatformUtilsService, private apiService: ApiService) {\n super(cipherService, analytics, toasterService, i18nService, platformUtilsService);\n }\n\n async load(filter: (cipher: CipherView) => boolean = null) {\n if (!this.organization.isAdmin) {\n await super.load();\n return;\n }\n this.accessEvents = this.organization.useEvents;\n const ciphers = await this.apiService.getCiphersOrganization(this.organization.id);\n if (ciphers != null && ciphers.data != null && ciphers.data.length) {\n const decCiphers: CipherView[] = [];\n const promises: any[] = [];\n ciphers.data.forEach((r) => {\n const data = new CipherData(r);\n const cipher = new Cipher(data);\n promises.push(cipher.decrypt().then((c) => decCiphers.push(c)));\n });\n await Promise.all(promises);\n decCiphers.sort(this.cipherService.getLocaleSortingFunction());\n this.allCiphers = decCiphers;\n } else {\n this.allCiphers = [];\n }\n this.applyFilter(filter);\n this.loaded = true;\n }\n\n applyFilter(filter: (cipher: CipherView) => boolean = null) {\n if (this.organization.isAdmin) {\n super.applyFilter(filter);\n } else {\n const f = (c: CipherView) => c.organizationId === this.organization.id && (filter == null || filter(c));\n super.applyFilter(f);\n }\n }\n\n checkCipher(c: CipherView) {\n // do nothing\n }\n\n events(c: CipherView) {\n this.onEventsClicked.emit(c);\n }\n}\n","import { Component } from '@angular/core';\r\n\r\nimport { ApiService } from 'jslib/abstractions/api.service';\r\nimport { CollectionService } from 'jslib/abstractions/collection.service';\r\nimport { FolderService } from 'jslib/abstractions/folder.service';\r\nimport { I18nService } from 'jslib/abstractions/i18n.service';\r\n\r\nimport { CollectionData } from 'jslib/models/data/collectionData';\r\nimport { Collection } from 'jslib/models/domain/collection';\r\nimport { Organization } from 'jslib/models/domain/organization';\r\nimport { CollectionDetailsResponse } from 'jslib/models/response/collectionResponse';\r\nimport { CollectionView } from 'jslib/models/view/collectionView';\r\n\r\nimport { GroupingsComponent as BaseGroupingsComponent } from '../../vault/groupings.component';\r\n\r\n@Component({\r\n selector: 'app-org-vault-groupings',\r\n templateUrl: '../../vault/groupings.component.html',\r\n})\r\nexport class GroupingsComponent extends BaseGroupingsComponent {\r\n organization: Organization;\r\n\r\n constructor(collectionService: CollectionService, folderService: FolderService,\r\n private apiService: ApiService, private i18nService: I18nService) {\r\n super(collectionService, folderService);\r\n }\r\n\r\n async loadCollections() {\r\n if (!this.organization.isAdmin) {\r\n await super.loadCollections(this.organization.id);\r\n return;\r\n }\r\n const collections = await this.apiService.getCollections(this.organization.id);\r\n if (collections != null && collections.data != null && collections.data.length) {\r\n const collectionDomains = collections.data.map((r) =>\r\n new Collection(new CollectionData(r as CollectionDetailsResponse)));\r\n this.collections = await this.collectionService.decryptMany(collectionDomains);\r\n } else {\r\n this.collections = [];\r\n }\r\n\r\n const unassignedCollection = new CollectionView();\r\n unassignedCollection.name = this.i18nService.t('unassigned');\r\n unassignedCollection.id = 'unassigned';\r\n unassignedCollection.organizationId = this.organization.id;\r\n unassignedCollection.readOnly = true;\r\n this.collections.push(unassignedCollection);\r\n }\r\n}\r\n","import {\r\n Component,\r\n OnInit,\r\n} from '@angular/core';\r\nimport { ActivatedRoute } from '@angular/router';\r\n\r\nimport { UserService } from 'jslib/abstractions/user.service';\r\n\r\nimport { Organization } from 'jslib/models/domain/organization';\r\n\r\n@Component({\r\n selector: 'app-organization-layout',\r\n templateUrl: 'organization-layout.component.html',\r\n})\r\nexport class OrganizationLayoutComponent implements OnInit {\r\n organization: Organization;\r\n\r\n private organizationId: string;\r\n\r\n constructor(private route: ActivatedRoute, private userService: UserService) { }\r\n\r\n ngOnInit() {\r\n document.body.classList.remove('layout_frontend');\r\n this.route.params.subscribe(async (params) => {\r\n this.organizationId = params.organizationId;\r\n await this.load();\r\n });\r\n }\r\n\r\n async load() {\r\n this.organization = await this.userService.getOrganization(this.organizationId);\r\n }\r\n}\r\n","import {\r\n Component,\r\n OnInit,\r\n} from '@angular/core';\r\n\r\nimport { AuditService } from 'jslib/abstractions/audit.service';\r\nimport { UserService } from 'jslib/abstractions/user.service';\r\nimport { BreachAccountResponse } from 'jslib/models/response/breachAccountResponse';\r\n\r\n@Component({\r\n selector: 'app-breach-report',\r\n templateUrl: 'breach-report.component.html',\r\n})\r\nexport class BreachReportComponent implements OnInit {\r\n error = false;\r\n username: string;\r\n checkedUsername: string;\r\n breachedAccounts: BreachAccountResponse[] = [];\r\n formPromise: Promise;\r\n\r\n constructor(private auditService: AuditService, private userService: UserService) { }\r\n\r\n async ngOnInit() {\r\n this.username = await this.userService.getEmail();\r\n }\r\n\r\n async submit() {\r\n this.error = false;\r\n this.username = this.username.toLowerCase();\r\n try {\r\n this.formPromise = this.auditService.breachedAccounts(this.username);\r\n this.breachedAccounts = await this.formPromise;\r\n } catch {\r\n this.error = true;\r\n }\r\n this.checkedUsername = this.username;\r\n }\r\n}\r\n","import { ToasterService } from 'angular2-toaster';\r\nimport { Angulartics2 } from 'angulartics2';\r\n\r\nimport {\r\n Component,\r\n ComponentFactoryResolver,\r\n ViewChild,\r\n ViewContainerRef,\r\n} from '@angular/core';\r\n\r\nimport { I18nService } from 'jslib/abstractions/i18n.service';\r\nimport { PasswordGenerationService } from 'jslib/abstractions/passwordGeneration.service';\r\nimport { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';\r\n\r\nimport {\r\n PasswordGeneratorComponent as BasePasswordGeneratorComponent,\r\n} from 'jslib/angular/components/password-generator.component';\r\n\r\nimport { ModalComponent } from '../modal.component';\r\nimport { PasswordGeneratorHistoryComponent } from './password-generator-history.component';\r\n\r\n@Component({\r\n selector: 'app-password-generator',\r\n templateUrl: 'password-generator.component.html',\r\n})\r\nexport class PasswordGeneratorComponent extends BasePasswordGeneratorComponent {\r\n @ViewChild('historyTemplate', { read: ViewContainerRef }) historyModalRef: ViewContainerRef;\r\n\r\n private modal: ModalComponent = null;\r\n\r\n constructor(passwordGenerationService: PasswordGenerationService, analytics: Angulartics2,\r\n platformUtilsService: PlatformUtilsService, i18nService: I18nService,\r\n toasterService: ToasterService, private componentFactoryResolver: ComponentFactoryResolver) {\r\n super(passwordGenerationService, analytics, platformUtilsService, i18nService, toasterService, window);\r\n }\r\n\r\n history() {\r\n if (this.modal != null) {\r\n this.modal.close();\r\n }\r\n\r\n const factory = this.componentFactoryResolver.resolveComponentFactory(ModalComponent);\r\n this.modal = this.historyModalRef.createComponent(factory).instance;\r\n this.modal.show(PasswordGeneratorHistoryComponent, this.historyModalRef);\r\n\r\n this.modal.onClosed.subscribe(async () => {\r\n this.modal = null;\r\n });\r\n }\r\n}\r\n","import { Component } from '@angular/core';\r\n\r\n@Component({\r\n selector: 'app-tools',\r\n templateUrl: 'tools.component.html',\r\n})\r\nexport class ToolsComponent { }\r\n","import {\n Component,\n OnInit,\n ViewChild,\n} from '@angular/core';\nimport {\n ActivatedRoute,\n Router,\n} from '@angular/router';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { CryptoService } from 'jslib/abstractions/crypto.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\nimport { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';\nimport { SyncService } from 'jslib/abstractions/sync.service';\n\nimport { PaymentComponent } from './payment.component';\n\nimport { PlanType } from 'jslib/enums/planType';\nimport { OrganizationCreateRequest } from 'jslib/models/request/organizationCreateRequest';\n\n@Component({\n selector: 'app-create-organization',\n templateUrl: 'create-organization.component.html',\n})\nexport class CreateOrganizationComponent implements OnInit {\n @ViewChild(PaymentComponent) paymentComponent: PaymentComponent;\n\n selfHosted = false;\n ownedBusiness = false;\n storageGbPriceMonthly = 0.33;\n additionalStorage = 0;\n additionalSeats = 0;\n plan = 'free';\n interval = 'year';\n name: string;\n billingEmail: string;\n businessName: string;\n\n storageGb: any = {\n price: 0.33,\n monthlyPrice: 0.50,\n yearlyPrice: 4,\n };\n\n plans: any = {\n free: {\n basePrice: 0,\n noAdditionalSeats: true,\n noPayment: true,\n },\n families: {\n basePrice: 1,\n annualBasePrice: 12,\n baseSeats: 5,\n noAdditionalSeats: true,\n annualPlanType: PlanType.FamiliesAnnually,\n },\n teams: {\n basePrice: 5,\n annualBasePrice: 60,\n monthlyBasePrice: 8,\n baseSeats: 5,\n seatPrice: 2,\n annualSeatPrice: 24,\n monthlySeatPrice: 2.5,\n monthPlanType: PlanType.TeamsMonthly,\n annualPlanType: PlanType.TeamsAnnually,\n },\n enterprise: {\n seatPrice: 3,\n annualSeatPrice: 36,\n monthlySeatPrice: 4,\n monthPlanType: PlanType.EnterpriseMonthly,\n annualPlanType: PlanType.EnterpriseAnnually,\n },\n };\n\n formPromise: Promise;\n\n constructor(private apiService: ApiService, private i18nService: I18nService,\n private analytics: Angulartics2, private toasterService: ToasterService,\n platformUtilsService: PlatformUtilsService, private cryptoService: CryptoService,\n private router: Router, private syncService: SyncService,\n private route: ActivatedRoute) {\n this.selfHosted = platformUtilsService.isSelfHost();\n }\n\n ngOnInit() {\n this.route.queryParams.subscribe(async (qParams) => {\n if (qParams.plan === 'families' || qParams.plan === 'teams' || qParams.plan === 'enterprise') {\n this.plan = qParams.plan;\n }\n });\n }\n\n async submit() {\n let files: FileList = null;\n if (this.selfHosted) {\n const fileEl = document.getElementById('file') as HTMLInputElement;\n files = fileEl.files;\n if (files == null || files.length === 0) {\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'),\n this.i18nService.t('selectFile'));\n return;\n }\n }\n\n let key: string = null;\n let collectionCt: string = null;\n\n try {\n this.formPromise = this.cryptoService.makeShareKey().then((shareKey) => {\n key = shareKey[0].encryptedString;\n return this.cryptoService.encrypt(this.i18nService.t('defaultCollection'), shareKey[1]);\n }).then((collection) => {\n collectionCt = collection.encryptedString;\n if (this.selfHosted || this.plan === 'free') {\n return null;\n } else {\n return this.paymentComponent.createPaymentToken();\n }\n }).then((token: string) => {\n if (this.selfHosted) {\n const fd = new FormData();\n fd.append('license', files[0]);\n fd.append('key', key);\n fd.append('collectionName', collectionCt);\n return this.apiService.postOrganizationLicense(fd);\n } else {\n const request = new OrganizationCreateRequest();\n request.key = key;\n request.collectionName = collectionCt;\n request.name = this.name;\n request.billingEmail = this.billingEmail;\n\n if (this.plan === 'free') {\n request.planType = PlanType.Free;\n } else {\n request.paymentToken = token;\n request.businessName = this.ownedBusiness ? this.businessName : null;\n request.additionalSeats = this.additionalSeats;\n request.additionalStorageGb = this.additionalStorage;\n request.country = this.paymentComponent.getCountry();\n if (this.interval === 'month') {\n request.planType = this.plans[this.plan].monthPlanType;\n } else {\n request.planType = this.plans[this.plan].annualPlanType;\n }\n }\n return this.apiService.postOrganization(request);\n }\n }).then((response) => {\n return this.finalize(response.id);\n });\n await this.formPromise;\n } catch { }\n }\n\n async finalize(orgId: string) {\n await Promise.all([\n this.apiService.refreshIdentityToken(),\n this.syncService.fullSync(true),\n ]);\n this.analytics.eventTrack.next({ action: 'Created Organization' });\n this.toasterService.popAsync('success', this.i18nService.t('organizationCreated'),\n this.i18nService.t('organizationReadyToGo'));\n this.router.navigate(['/organizations/' + orgId]);\n }\n\n changedPlan() {\n if (this.plans[this.plan].monthPlanType == null) {\n this.interval = 'year';\n }\n\n if (this.plans[this.plan].noAdditionalSeats) {\n this.additionalSeats = 0;\n } else if (!this.additionalSeats && !this.plans[this.plan].baseSeats &&\n !this.plans[this.plan].noAdditionalSeats) {\n this.additionalSeats = 1;\n }\n }\n\n changedOwnedBusiness() {\n if (!this.ownedBusiness || this.plan === 'teams' || this.plan === 'enterprise') {\n return;\n }\n this.plan = 'teams';\n }\n\n additionalStorageTotal(annual: boolean): number {\n if (annual) {\n return (this.additionalStorage || 0) * this.storageGb.yearlyPrice;\n } else {\n return (this.additionalStorage || 0) * this.storageGb.monthlyPrice;\n }\n }\n\n seatTotal(annual: boolean): number {\n if (this.plans[this.plan].noAdditionalSeats) {\n return 0;\n }\n\n if (annual) {\n return this.plans[this.plan].annualSeatPrice * (this.additionalSeats || 0);\n } else {\n return this.plans[this.plan].monthlySeatPrice * (this.additionalSeats || 0);\n }\n }\n\n baseTotal(annual: boolean): number {\n if (annual) {\n return (this.plans[this.plan].annualBasePrice || 0);\n } else {\n return (this.plans[this.plan].monthlyBasePrice || 0);\n }\n }\n\n get total(): number {\n const annual = this.interval === 'year';\n return this.baseTotal(annual) + this.seatTotal(annual) + this.additionalStorageTotal(annual);\n }\n}\n","import {\n Component,\n OnInit,\n} from '@angular/core';\nimport { Router } from '@angular/router';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { BillingResponse } from 'jslib/models/response/billingResponse';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\nimport { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';\nimport { TokenService } from 'jslib/abstractions/token.service';\n\nimport { PaymentMethodType } from 'jslib/enums/paymentMethodType';\n\n@Component({\n selector: 'app-user-billing',\n templateUrl: 'user-billing.component.html',\n})\nexport class UserBillingComponent implements OnInit {\n loading = false;\n firstLoaded = false;\n adjustStorageAdd = true;\n showAdjustStorage = false;\n showAdjustPayment = false;\n showUpdateLicense = false;\n billing: BillingResponse;\n paymentMethodType = PaymentMethodType;\n selfHosted = false;\n\n cancelPromise: Promise;\n reinstatePromise: Promise;\n\n constructor(private tokenService: TokenService, private apiService: ApiService,\n private platformUtilsService: PlatformUtilsService, private i18nService: I18nService,\n private analytics: Angulartics2, private toasterService: ToasterService,\n private router: Router) {\n this.selfHosted = platformUtilsService.isSelfHost();\n }\n\n async ngOnInit() {\n await this.load();\n this.firstLoaded = true;\n }\n\n async load() {\n if (this.loading) {\n return;\n }\n\n const premium = this.tokenService.getPremium();\n if (premium) {\n this.loading = true;\n this.billing = await this.apiService.getUserBilling();\n } else {\n this.router.navigate(['/settings/premium']);\n return;\n }\n\n this.loading = false;\n }\n\n async reinstate() {\n if (this.loading) {\n return;\n }\n\n const confirmed = await this.platformUtilsService.showDialog(this.i18nService.t('reinstateConfirmation'),\n this.i18nService.t('reinstateSubscription'), this.i18nService.t('yes'), this.i18nService.t('cancel'));\n if (!confirmed) {\n return;\n }\n\n try {\n this.reinstatePromise = this.apiService.postReinstatePremium();\n await this.reinstatePromise;\n this.analytics.eventTrack.next({ action: 'Reinstated Premium' });\n this.toasterService.popAsync('success', null, this.i18nService.t('reinstated'));\n this.load();\n } catch { }\n }\n\n async cancel() {\n if (this.loading) {\n return;\n }\n\n const confirmed = await this.platformUtilsService.showDialog(this.i18nService.t('cancelConfirmation'),\n this.i18nService.t('cancelSubscription'), this.i18nService.t('yes'), this.i18nService.t('no'), 'warning');\n if (!confirmed) {\n return;\n }\n\n try {\n this.cancelPromise = this.apiService.postCancelPremium();\n await this.cancelPromise;\n this.analytics.eventTrack.next({ action: 'Canceled Premium' });\n this.toasterService.popAsync('success', null, this.i18nService.t('canceledSubscription'));\n this.load();\n } catch { }\n }\n\n downloadLicense() {\n if (this.loading) {\n return;\n }\n\n const licenseString = JSON.stringify(this.billing.license, null, 2);\n this.platformUtilsService.saveFile(window, licenseString, null, 'bitwarden_premium_license.json');\n }\n\n updateLicense() {\n if (this.loading) {\n return;\n }\n this.showUpdateLicense = true;\n }\n\n closeUpdateLicense(load: boolean) {\n this.showUpdateLicense = false;\n if (load) {\n this.load();\n }\n }\n\n adjustStorage(add: boolean) {\n this.adjustStorageAdd = add;\n this.showAdjustStorage = true;\n }\n\n closeStorage(load: boolean) {\n this.showAdjustStorage = false;\n if (load) {\n this.load();\n }\n }\n\n changePayment() {\n this.showAdjustPayment = true;\n }\n\n closePayment(load: boolean) {\n this.showAdjustPayment = false;\n if (load) {\n this.load();\n }\n }\n\n get subscriptionMarkedForCancel() {\n return this.subscription != null && !this.subscription.cancelled && this.subscription.cancelAtEndDate;\n }\n\n get subscription() {\n return this.billing != null ? this.billing.subscription : null;\n }\n\n get nextInvoice() {\n return this.billing != null ? this.billing.upcomingInvoice : null;\n }\n\n get paymentSource() {\n return this.billing != null ? this.billing.paymentSource : null;\n }\n\n get charges() {\n return this.billing != null ? this.billing.charges : null;\n }\n\n get storagePercentage() {\n return this.billing != null && this.billing.maxStorageGb ?\n +(100 * (this.billing.storageGb / this.billing.maxStorageGb)).toFixed(2) : 0;\n }\n\n get storageProgressWidth() {\n return this.storagePercentage < 5 ? 5 : 0;\n }\n}\n","export enum PaymentMethodType {\n Card = 0,\n BankAccount = 1,\n PayPal = 2,\n Bitcoin = 3,\n}\n","import {\n Component,\n EventEmitter,\n Input,\n Output,\n ViewChild,\n} from '@angular/core';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\n\nimport { PaymentRequest } from 'jslib/models/request/paymentRequest';\n\nimport { PaymentMethodType } from 'jslib/enums/paymentMethodType';\n\nimport { PaymentComponent } from './payment.component';\n\n@Component({\n selector: 'app-adjust-payment',\n templateUrl: 'adjust-payment.component.html',\n})\nexport class AdjustPaymentComponent {\n @ViewChild(PaymentComponent) paymentComponent: PaymentComponent;\n\n @Input() currentType?: PaymentMethodType;\n @Input() organizationId: string;\n @Output() onAdjusted = new EventEmitter();\n @Output() onCanceled = new EventEmitter();\n\n paymentMethodType = PaymentMethodType;\n formPromise: Promise;\n\n constructor(private apiService: ApiService, private i18nService: I18nService,\n private analytics: Angulartics2, private toasterService: ToasterService) { }\n\n async submit() {\n try {\n const request = new PaymentRequest();\n this.formPromise = this.paymentComponent.createPaymentToken().then((token) => {\n request.paymentToken = token;\n if (this.organizationId == null) {\n return this.apiService.postAccountPayment(request);\n } else {\n return this.apiService.postOrganizationPayment(this.organizationId, request);\n }\n });\n await this.formPromise;\n this.analytics.eventTrack.next({\n action: this.currentType == null ? 'Added Payment Method' : 'Changed Payment Method',\n });\n this.toasterService.popAsync('success', null, this.i18nService.t('updatedPaymentMethod'));\n this.onAdjusted.emit();\n } catch { }\n }\n\n cancel() {\n this.onCanceled.emit();\n }\n\n get canChange() {\n return this.currentType == null || this.currentType === PaymentMethodType.Card || this.organizationId != null;\n }\n}\n","import {\n Component,\n EventEmitter,\n Input,\n Output,\n} from '@angular/core';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\n\nimport { StorageRequest } from 'jslib/models/request/storageRequest';\n\n@Component({\n selector: 'app-adjust-storage',\n templateUrl: 'adjust-storage.component.html',\n})\nexport class AdjustStorageComponent {\n @Input() storageGbPrice = 0;\n @Input() add = true;\n @Input() organizationId: string;\n @Input() interval = 'year';\n @Output() onAdjusted = new EventEmitter();\n @Output() onCanceled = new EventEmitter();\n\n storageAdjustment = 0;\n formPromise: Promise;\n\n constructor(private apiService: ApiService, private i18nService: I18nService,\n private analytics: Angulartics2, private toasterService: ToasterService) { }\n\n async submit() {\n try {\n const request = new StorageRequest();\n request.storageGbAdjustment = this.storageAdjustment;\n if (!this.add) {\n request.storageGbAdjustment *= -1;\n }\n\n if (this.organizationId == null) {\n this.formPromise = this.apiService.postAccountStorage(request);\n } else {\n this.formPromise = this.apiService.postOrganizationStorage(this.organizationId, request);\n }\n await this.formPromise;\n this.analytics.eventTrack.next({ action: this.add ? 'Added Storage' : 'Removed Storage' });\n this.toasterService.popAsync('success', null,\n this.i18nService.t('adjustedStorage', request.storageGbAdjustment.toString()));\n this.onAdjusted.emit(this.storageAdjustment);\n } catch { }\n }\n\n cancel() {\n this.onCanceled.emit();\n }\n\n get adjustedStorageTotal(): number {\n return this.storageGbPrice * this.storageAdjustment;\n }\n}\n","import {\n Component,\n EventEmitter,\n Input,\n Output,\n} from '@angular/core';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\n\n@Component({\n selector: 'app-update-license',\n templateUrl: 'update-license.component.html',\n})\nexport class UpdateLicenseComponent {\n @Input() organizationId: string;\n @Output() onUpdated = new EventEmitter();\n @Output() onCanceled = new EventEmitter();\n\n formPromise: Promise;\n\n constructor(private apiService: ApiService, private i18nService: I18nService,\n private analytics: Angulartics2, private toasterService: ToasterService) { }\n\n async submit() {\n const fileEl = document.getElementById('file') as HTMLInputElement;\n const files = fileEl.files;\n if (files == null || files.length === 0) {\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'),\n this.i18nService.t('selectFile'));\n return;\n }\n\n try {\n const fd = new FormData();\n fd.append('license', files[0]);\n\n if (this.organizationId == null) {\n this.formPromise = this.apiService.postAccountLicense(fd);\n } else {\n this.formPromise = this.apiService.postOrganizationLicenseUpdate(this.organizationId, fd);\n }\n\n await this.formPromise;\n this.analytics.eventTrack.next({ action: 'Updated License' });\n this.toasterService.popAsync('success', null, this.i18nService.t('updatedLicense'));\n this.onUpdated.emit();\n } catch { }\n }\n\n cancel() {\n this.onCanceled.emit();\n }\n}\n","import {\n Component,\n OnInit,\n ViewChild,\n} from '@angular/core';\nimport { Router } from '@angular/router';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\nimport { MessagingService } from 'jslib/abstractions/messaging.service';\nimport { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';\nimport { SyncService } from 'jslib/abstractions/sync.service';\nimport { TokenService } from 'jslib/abstractions/token.service';\n\nimport { PaymentComponent } from './payment.component';\n\n@Component({\n selector: 'app-premium',\n templateUrl: 'premium.component.html',\n})\nexport class PremiumComponent implements OnInit {\n @ViewChild(PaymentComponent) paymentComponent: PaymentComponent;\n\n selfHosted = false;\n premiumPrice = 10;\n storageGbPrice = 4;\n additionalStorage = 0;\n\n formPromise: Promise;\n\n constructor(private apiService: ApiService, private i18nService: I18nService,\n private analytics: Angulartics2, private toasterService: ToasterService,\n platformUtilsService: PlatformUtilsService, private tokenService: TokenService,\n private router: Router, private messagingService: MessagingService,\n private syncService: SyncService) {\n this.selfHosted = platformUtilsService.isSelfHost();\n }\n\n async ngOnInit() {\n const premium = await this.tokenService.getPremium();\n if (premium) {\n this.router.navigate(['/settings/billing']);\n return;\n }\n }\n\n async submit() {\n let files: FileList = null;\n if (this.selfHosted) {\n const fileEl = document.getElementById('file') as HTMLInputElement;\n files = fileEl.files;\n if (files == null || files.length === 0) {\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'),\n this.i18nService.t('selectFile'));\n return;\n }\n }\n\n try {\n if (this.selfHosted) {\n if (!this.tokenService.getEmailVerified()) {\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'),\n this.i18nService.t('verifyEmailFirst'));\n return;\n }\n\n const fd = new FormData();\n fd.append('license', files[0]);\n this.formPromise = this.apiService.postAccountLicense(fd).then(() => {\n return this.finalizePremium();\n });\n } else {\n this.formPromise = this.paymentComponent.createPaymentToken().then((token) => {\n const fd = new FormData();\n fd.append('paymentToken', token);\n fd.append('additionalStorageGb', (this.additionalStorage || 0).toString());\n return this.apiService.postPremium(fd);\n }).then(() => {\n return this.finalizePremium();\n });\n }\n await this.formPromise;\n } catch { }\n }\n\n async finalizePremium() {\n await Promise.all([\n this.apiService.refreshIdentityToken(),\n this.syncService.fullSync(true),\n ]);\n this.analytics.eventTrack.next({ action: 'Signed Up Premium' });\n this.toasterService.popAsync('success', null, this.i18nService.t('premiumUpdated'));\n this.messagingService.send('purchasedPremium');\n this.router.navigate(['/settings/billing']);\n }\n\n get additionalStorageTotal(): number {\n return this.storageGbPrice * this.additionalStorage;\n }\n\n get total(): number {\n return this.additionalStorageTotal + this.premiumPrice;\n }\n}\n","
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n\n
\n
\n \n \n
\n
\n \"Visa,\n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n
\n\n
\n
\n {{'paypalClickSubmit' | i18n}}\n
\n
\n\n \n {{'verifyBankAccountInitialDesc' | i18n}} {{'verifyBankAccountFailureWarning' | i18n}}\n \n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n
\n","import { Component } from '@angular/core';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\nimport { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';\n\nimport { TwoFactorProviderType } from 'jslib/enums/twoFactorProviderType';\nimport { UpdateTwoFactorDuoRequest } from 'jslib/models/request/updateTwoFactorDuoRequest';\nimport { TwoFactorDuoResponse } from 'jslib/models/response/twoFactorDuoResponse';\n\nimport { TwoFactorBaseComponent } from './two-factor-base.component';\n\n@Component({\n selector: 'app-two-factor-duo',\n templateUrl: 'two-factor-duo.component.html',\n})\nexport class TwoFactorDuoComponent extends TwoFactorBaseComponent {\n type = TwoFactorProviderType.Duo;\n ikey: string;\n skey: string;\n host: string;\n formPromise: Promise;\n\n constructor(apiService: ApiService, i18nService: I18nService,\n analytics: Angulartics2, toasterService: ToasterService,\n platformUtilsService: PlatformUtilsService) {\n super(apiService, i18nService, analytics, toasterService, platformUtilsService);\n }\n\n auth(authResponse: any) {\n super.auth(authResponse);\n this.processResponse(authResponse.response);\n }\n\n submit() {\n if (this.enabled) {\n return super.disable(this.formPromise);\n } else {\n return this.enable();\n }\n }\n\n protected enable() {\n const request = new UpdateTwoFactorDuoRequest();\n request.masterPasswordHash = this.masterPasswordHash;\n request.integrationKey = this.ikey;\n request.secretKey = this.skey;\n request.host = this.host;\n\n return super.enable(async () => {\n if (this.organizationId != null) {\n this.formPromise = this.apiService.putTwoFactorOrganizationDuo(this.organizationId, request);\n } else {\n this.formPromise = this.apiService.putTwoFactorDuo(request);\n }\n const response = await this.formPromise;\n await this.processResponse(response);\n });\n }\n\n private processResponse(response: TwoFactorDuoResponse) {\n this.ikey = response.integrationKey;\n this.skey = response.secretKey;\n this.host = response.host;\n this.enabled = response.enabled;\n }\n}\n","import {\n Component,\n OnInit,\n} from '@angular/core';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\n\nimport { UpdateDomainsRequest } from 'jslib/models/request/updateDomainsRequest';\n\n@Component({\n selector: 'app-domain-rules',\n templateUrl: 'domain-rules.component.html',\n})\nexport class DomainRulesComponent implements OnInit {\n loading = true;\n custom: string[] = [];\n global: any[] = [];\n formPromise: Promise;\n\n constructor(private apiService: ApiService, private i18nService: I18nService,\n private analytics: Angulartics2, private toasterService: ToasterService) { }\n\n async ngOnInit() {\n const response = await this.apiService.getSettingsDomains();\n this.loading = false;\n if (response.equivalentDomains != null) {\n this.custom = response.equivalentDomains.map((d) => d.join(', '));\n }\n if (response.globalEquivalentDomains != null) {\n this.global = response.globalEquivalentDomains.map((d) => {\n return {\n domains: d.domains.join(', '),\n excluded: d.excluded,\n key: d.type,\n };\n });\n }\n }\n\n toggleExcluded(globalDomain: any) {\n globalDomain.excluded = !globalDomain.excluded;\n }\n\n customize(globalDomain: any) {\n globalDomain.excluded = true;\n this.custom.push(globalDomain.domains);\n }\n\n remove(index: number) {\n this.custom.splice(index, 1);\n }\n\n add() {\n this.custom.push('');\n }\n\n async submit() {\n const request = new UpdateDomainsRequest();\n request.excludedGlobalEquivalentDomains = this.global.filter((d) => d.excluded)\n .map((d) => d.key);\n if (request.excludedGlobalEquivalentDomains.length === 0) {\n request.excludedGlobalEquivalentDomains = null;\n }\n request.equivalentDomains = this.custom.filter((d) => d != null && d.trim() !== '')\n .map((d) => d.split(',').map((d2) => d2.trim()));\n if (request.equivalentDomains.length === 0) {\n request.equivalentDomains = null;\n }\n\n try {\n this.formPromise = this.apiService.putSettingsDomains(request);\n await this.formPromise;\n this.analytics.eventTrack.next({ action: 'Saved Equivalent Domains' });\n this.toasterService.popAsync('success', null, this.i18nService.t('domainsUpdated'));\n } catch { }\n }\n\n indexTrackBy(index: number, obj: any): any {\n return index;\n }\n}\n","import {\n Component,\n OnInit,\n} from '@angular/core';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { I18nService } from 'jslib/abstractions/i18n.service';\nimport { StateService } from 'jslib/abstractions/state.service';\nimport { StorageService } from 'jslib/abstractions/storage.service';\n\nimport { ConstantsService } from 'jslib/services/constants.service';\n\nimport { Utils } from 'jslib/misc/utils';\n\n@Component({\n selector: 'app-options',\n templateUrl: 'options.component.html',\n})\nexport class OptionsComponent implements OnInit {\n disableIcons: boolean;\n locale: string;\n localeOptions: any[];\n\n private startingLocale: string;\n\n constructor(private storageService: StorageService, private stateService: StateService,\n private analytics: Angulartics2, private i18nService: I18nService,\n private toasterService: ToasterService) {\n const localeOptions: any[] = [];\n i18nService.supportedTranslationLocales.forEach((locale) => {\n localeOptions.push({ name: locale, value: locale });\n });\n localeOptions.sort(Utils.getSortFunction(i18nService, 'name'));\n localeOptions.splice(0, 0, { name: i18nService.t('default'), value: null });\n this.localeOptions = localeOptions;\n }\n\n async ngOnInit() {\n this.disableIcons = await this.storageService.get(ConstantsService.disableFaviconKey);\n this.locale = this.startingLocale = await this.storageService.get(ConstantsService.localeKey);\n }\n\n async submit() {\n await this.storageService.save(ConstantsService.disableFaviconKey, this.disableIcons);\n await this.stateService.save(ConstantsService.disableFaviconKey, this.disableIcons);\n await this.storageService.save(ConstantsService.localeKey, this.locale);\n this.analytics.eventTrack.next({ action: 'Saved Options' });\n if (this.locale !== this.startingLocale) {\n window.location.reload();\n } else {\n this.toasterService.popAsync('success', null, this.i18nService.t('optionsUpdated'));\n }\n }\n}\n","import {\r\n Component,\r\n ComponentFactoryResolver,\r\n ViewChild,\r\n ViewContainerRef,\r\n} from '@angular/core';\r\n\r\nimport { ModalComponent } from '../modal.component';\r\nimport { DeauthorizeSessionsComponent } from './deauthorize-sessions.component';\r\nimport { DeleteAccountComponent } from './delete-account.component';\r\nimport { PurgeVaultComponent } from './purge-vault.component';\r\n\r\n@Component({\r\n selector: 'app-account',\r\n templateUrl: 'account.component.html',\r\n})\r\nexport class AccountComponent {\r\n @ViewChild('deauthorizeSessionsTemplate', { read: ViewContainerRef }) deauthModalRef: ViewContainerRef;\r\n @ViewChild('purgeVaultTemplate', { read: ViewContainerRef }) purgeModalRef: ViewContainerRef;\r\n @ViewChild('deleteAccountTemplate', { read: ViewContainerRef }) deleteModalRef: ViewContainerRef;\r\n\r\n private modal: ModalComponent = null;\r\n\r\n constructor(private componentFactoryResolver: ComponentFactoryResolver) { }\r\n\r\n deauthorizeSessions() {\r\n if (this.modal != null) {\r\n this.modal.close();\r\n }\r\n\r\n const factory = this.componentFactoryResolver.resolveComponentFactory(ModalComponent);\r\n this.modal = this.deauthModalRef.createComponent(factory).instance;\r\n this.modal.show(DeauthorizeSessionsComponent, this.deauthModalRef);\r\n\r\n this.modal.onClosed.subscribe(async () => {\r\n this.modal = null;\r\n });\r\n }\r\n\r\n purgeVault() {\r\n if (this.modal != null) {\r\n this.modal.close();\r\n }\r\n\r\n const factory = this.componentFactoryResolver.resolveComponentFactory(ModalComponent);\r\n this.modal = this.purgeModalRef.createComponent(factory).instance;\r\n this.modal.show(PurgeVaultComponent, this.purgeModalRef);\r\n\r\n this.modal.onClosed.subscribe(async () => {\r\n this.modal = null;\r\n });\r\n }\r\n\r\n deleteAccount() {\r\n if (this.modal != null) {\r\n this.modal.close();\r\n }\r\n\r\n const factory = this.componentFactoryResolver.resolveComponentFactory(ModalComponent);\r\n this.modal = this.deleteModalRef.createComponent(factory).instance;\r\n this.modal.show(DeleteAccountComponent, this.deleteModalRef);\r\n\r\n this.modal.onClosed.subscribe(async () => {\r\n this.modal = null;\r\n });\r\n }\r\n}\r\n","import {\r\n Component,\r\n NgZone,\r\n OnDestroy,\r\n OnInit,\r\n} from '@angular/core';\r\n\r\nimport { TokenService } from 'jslib/abstractions/token.service';\r\n\r\nimport { BroadcasterService } from 'jslib/angular/services/broadcaster.service';\r\n\r\nconst BroadcasterSubscriptionId = 'SettingsComponent';\r\n\r\n@Component({\r\n selector: 'app-settings',\r\n templateUrl: 'settings.component.html',\r\n})\r\nexport class SettingsComponent implements OnInit, OnDestroy {\r\n premium: boolean;\r\n\r\n constructor(private tokenService: TokenService, private broadcasterService: BroadcasterService,\r\n private ngZone: NgZone) { }\r\n\r\n async ngOnInit() {\r\n this.broadcasterService.subscribe(BroadcasterSubscriptionId, async (message: any) => {\r\n this.ngZone.run(async () => {\r\n switch (message.command) {\r\n case 'purchasedPremium':\r\n await this.load();\r\n break;\r\n default:\r\n }\r\n });\r\n });\r\n\r\n await this.load();\r\n }\r\n\r\n ngOnDestroy() {\r\n this.broadcasterService.unsubscribe(BroadcasterSubscriptionId);\r\n }\r\n\r\n async load() {\r\n this.premium = await this.tokenService.getPremium();\r\n }\r\n}\r\n","import {\r\n Component,\r\n EventEmitter,\r\n Input,\r\n OnDestroy,\r\n OnInit,\r\n Output,\r\n} from '@angular/core';\r\n\r\nimport { ToasterService } from 'angular2-toaster';\r\nimport { Angulartics2 } from 'angulartics2';\r\n\r\nimport { CipherService } from 'jslib/abstractions/cipher.service';\r\nimport { CollectionService } from 'jslib/abstractions/collection.service';\r\nimport { I18nService } from 'jslib/abstractions/i18n.service';\r\n\r\nimport { CipherView } from 'jslib/models/view/cipherView';\r\nimport { CollectionView } from 'jslib/models/view/collectionView';\r\n\r\nimport { Cipher } from 'jslib/models/domain/cipher';\r\n\r\n@Component({\r\n selector: 'app-vault-collections',\r\n templateUrl: 'collections.component.html',\r\n})\r\nexport class CollectionsComponent implements OnInit, OnDestroy {\r\n @Input() cipherId: string;\r\n @Output() onSavedCollections = new EventEmitter();\r\n\r\n formPromise: Promise;\r\n cipher: CipherView;\r\n collectionIds: string[];\r\n collections: CollectionView[] = [];\r\n\r\n protected cipherDomain: Cipher;\r\n\r\n constructor(protected collectionService: CollectionService, protected analytics: Angulartics2,\r\n protected toasterService: ToasterService, protected i18nService: I18nService,\r\n protected cipherService: CipherService) { }\r\n\r\n async ngOnInit() {\r\n this.cipherDomain = await this.loadCipher();\r\n this.collectionIds = this.loadCipherCollections();\r\n this.cipher = await this.cipherDomain.decrypt();\r\n this.collections = await this.loadCollections();\r\n\r\n this.selectAll(false);\r\n if (this.collectionIds != null) {\r\n this.collections.forEach((c) => {\r\n (c as any).checked = this.collectionIds.indexOf(c.id) > -1;\r\n });\r\n }\r\n }\r\n\r\n ngOnDestroy() {\r\n this.selectAll(false);\r\n }\r\n\r\n async submit() {\r\n this.cipherDomain.collectionIds = this.collections\r\n .filter((c) => !!(c as any).checked)\r\n .map((c) => c.id);\r\n this.formPromise = this.saveCollections();\r\n await this.formPromise;\r\n this.onSavedCollections.emit();\r\n this.analytics.eventTrack.next({ action: 'Edited Cipher Collections' });\r\n this.toasterService.popAsync('success', null, this.i18nService.t('editedItem'));\r\n }\r\n\r\n check(c: CollectionView, select?: boolean) {\r\n (c as any).checked = select == null ? !(c as any).checked : select;\r\n }\r\n\r\n selectAll(select: boolean) {\r\n this.collections.forEach((c) => this.check(c, select));\r\n }\r\n\r\n protected loadCipher() {\r\n return this.cipherService.get(this.cipherId);\r\n }\r\n\r\n protected loadCipherCollections() {\r\n return this.cipherDomain.collectionIds;\r\n }\r\n\r\n protected async loadCollections() {\r\n const allCollections = await this.collectionService.getAllDecrypted();\r\n return allCollections.filter((c) => !c.readOnly && c.organizationId === this.cipher.organizationId);\r\n }\r\n\r\n protected saveCollections() {\r\n return this.cipherService.saveCollectionsWithServer(this.cipherDomain);\r\n }\r\n}\r\n","import { Component } from '@angular/core';\r\n\r\nimport { ToasterService } from 'angular2-toaster';\r\nimport { Angulartics2 } from 'angulartics2';\r\n\r\nimport { CipherService } from 'jslib/abstractions/cipher.service';\r\nimport { CryptoService } from 'jslib/abstractions/crypto.service';\r\nimport { I18nService } from 'jslib/abstractions/i18n.service';\r\nimport { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';\r\nimport { TokenService } from 'jslib/abstractions/token.service';\r\n\r\nimport { AttachmentsComponent as BaseAttachmentsComponent } from 'jslib/angular/components/attachments.component';\r\n\r\n@Component({\r\n selector: 'app-vault-attachments',\r\n templateUrl: 'attachments.component.html',\r\n})\r\nexport class AttachmentsComponent extends BaseAttachmentsComponent {\r\n constructor(cipherService: CipherService, analytics: Angulartics2,\r\n toasterService: ToasterService, i18nService: I18nService,\r\n cryptoService: CryptoService, tokenService: TokenService,\r\n platformUtilsService: PlatformUtilsService) {\r\n super(cipherService, analytics, toasterService, i18nService, cryptoService, tokenService,\r\n platformUtilsService, window);\r\n }\r\n}\r\n","import {\n Component,\n OnInit,\n} from '@angular/core';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { CipherType } from 'jslib/enums/cipherType';\n\nimport { AuditService } from 'jslib/abstractions/audit.service';\nimport { CipherService } from 'jslib/abstractions/cipher.service';\nimport { FolderService } from 'jslib/abstractions/folder.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\nimport { MessagingService } from 'jslib/abstractions/messaging.service';\nimport { PasswordGenerationService } from 'jslib/abstractions/passwordGeneration.service';\nimport { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';\nimport { StateService } from 'jslib/abstractions/state.service';\nimport { TokenService } from 'jslib/abstractions/token.service';\nimport { TotpService } from 'jslib/abstractions/totp.service';\n\nimport { AddEditComponent as BaseAddEditComponent } from 'jslib/angular/components/add-edit.component';\nimport { LoginUriView } from 'jslib/models/view/loginUriView';\n\n@Component({\n selector: 'app-vault-add-edit',\n templateUrl: 'add-edit.component.html',\n})\nexport class AddEditComponent extends BaseAddEditComponent implements OnInit {\n isPremium: boolean;\n totpCode: string;\n totpCodeFormatted: string;\n totpDash: number;\n totpSec: number;\n totpLow: boolean;\n\n protected totpInterval: number;\n\n constructor(cipherService: CipherService, folderService: FolderService,\n i18nService: I18nService, platformUtilsService: PlatformUtilsService,\n analytics: Angulartics2, toasterService: ToasterService,\n auditService: AuditService, stateService: StateService,\n protected tokenService: TokenService, protected totpService: TotpService,\n protected passwordGenerationService: PasswordGenerationService, protected messagingService: MessagingService) {\n super(cipherService, folderService, i18nService, platformUtilsService, analytics,\n toasterService, auditService, stateService);\n }\n\n async ngOnInit() {\n await super.load();\n this.cleanUp();\n\n this.isPremium = this.tokenService.getPremium();\n if (this.cipher.type === CipherType.Login && this.cipher.login.totp &&\n (this.cipher.organizationUseTotp || this.isPremium)) {\n await this.totpUpdateCode();\n await this.totpTick();\n\n this.totpInterval = window.setInterval(async () => {\n await this.totpTick();\n }, 1000);\n }\n }\n\n toggleFavorite() {\n this.cipher.favorite = !this.cipher.favorite;\n }\n\n launch(uri: LoginUriView) {\n if (!uri.canLaunch) {\n return;\n }\n\n this.analytics.eventTrack.next({ action: 'Launched Login URI' });\n this.platformUtilsService.launchUri(uri.uri);\n }\n\n copy(value: string, typeI18nKey: string, aType: string) {\n if (value == null) {\n return;\n }\n\n this.analytics.eventTrack.next({ action: 'Copied ' + aType });\n this.platformUtilsService.copyToClipboard(value, { doc: window.document });\n this.toasterService.popAsync('info', null,\n this.i18nService.t('valueCopied', this.i18nService.t(typeI18nKey)));\n }\n\n async generatePassword(): Promise {\n const confirmed = await super.generatePassword();\n if (confirmed) {\n const options = await this.passwordGenerationService.getOptions();\n this.cipher.login.password = await this.passwordGenerationService.generatePassword(options);\n }\n return confirmed;\n }\n\n async premiumRequired() {\n const premium = await this.tokenService.getPremium();\n if (!premium) {\n this.messagingService.send('premiumRequired');\n return;\n }\n }\n\n async upgradeOrganization() {\n this.messagingService.send('upgradeOrganization', { organizationId: this.cipher.organizationId });\n }\n\n protected cleanUp() {\n if (this.totpInterval) {\n window.clearInterval(this.totpInterval);\n }\n }\n\n protected async totpUpdateCode() {\n if (this.cipher == null || this.cipher.type !== CipherType.Login || this.cipher.login.totp == null) {\n if (this.totpInterval) {\n window.clearInterval(this.totpInterval);\n }\n return;\n }\n\n this.totpCode = await this.totpService.getCode(this.cipher.login.totp);\n if (this.totpCode != null) {\n this.totpCodeFormatted = this.totpCode.substring(0, 3) + ' ' + this.totpCode.substring(3);\n } else {\n this.totpCodeFormatted = null;\n if (this.totpInterval) {\n window.clearInterval(this.totpInterval);\n }\n }\n }\n\n protected async totpTick() {\n const epoch = Math.round(new Date().getTime() / 1000.0);\n const mod = epoch % 30;\n\n this.totpSec = 30 - mod;\n this.totpDash = +(Math.round(((2.62 * mod) + 'e+2') as any) + 'e-2');\n this.totpLow = this.totpSec <= 7;\n if (mod === 0) {\n await this.totpUpdateCode();\n }\n }\n}\n","import { Folder } from '../domain/folder';\r\n\r\nexport class FolderRequest {\r\n name: string;\r\n\r\n constructor(folder: Folder) {\r\n this.name = folder.name ? folder.name.encryptedString : null;\r\n }\r\n}\r\n","import { Location } from '@angular/common';\nimport {\n Component,\n ComponentFactoryResolver,\n OnInit,\n ViewChild,\n ViewContainerRef,\n} from '@angular/core';\nimport {\n ActivatedRoute,\n Router,\n} from '@angular/router';\n\nimport { ToasterService } from 'angular2-toaster';\n\nimport { CipherType } from 'jslib/enums/cipherType';\n\nimport { CipherView } from 'jslib/models/view/cipherView';\n\nimport { ModalComponent } from '../modal.component';\n\nimport { OrganizationsComponent } from '../settings/organizations.component';\nimport { UpdateKeyComponent } from '../settings/update-key.component';\nimport { AddEditComponent } from './add-edit.component';\nimport { AttachmentsComponent } from './attachments.component';\nimport { BulkDeleteComponent } from './bulk-delete.component';\nimport { BulkMoveComponent } from './bulk-move.component';\nimport { BulkShareComponent } from './bulk-share.component';\nimport { CiphersComponent } from './ciphers.component';\nimport { CollectionsComponent } from './collections.component';\nimport { FolderAddEditComponent } from './folder-add-edit.component';\nimport { GroupingsComponent } from './groupings.component';\nimport { ShareComponent } from './share.component';\n\nimport { CryptoService } from 'jslib/abstractions/crypto.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\nimport { MessagingService } from 'jslib/abstractions/messaging.service';\nimport { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';\nimport { SyncService } from 'jslib/abstractions/sync.service';\nimport { TokenService } from 'jslib/abstractions/token.service';\nimport { UserService } from 'jslib/abstractions/user.service';\n\n@Component({\n selector: 'app-vault',\n templateUrl: 'vault.component.html',\n})\nexport class VaultComponent implements OnInit {\n @ViewChild(GroupingsComponent) groupingsComponent: GroupingsComponent;\n @ViewChild(CiphersComponent) ciphersComponent: CiphersComponent;\n @ViewChild(OrganizationsComponent) organizationsComponent: OrganizationsComponent;\n @ViewChild('attachments', { read: ViewContainerRef }) attachmentsModalRef: ViewContainerRef;\n @ViewChild('folderAddEdit', { read: ViewContainerRef }) folderAddEditModalRef: ViewContainerRef;\n @ViewChild('cipherAddEdit', { read: ViewContainerRef }) cipherAddEditModalRef: ViewContainerRef;\n @ViewChild('share', { read: ViewContainerRef }) shareModalRef: ViewContainerRef;\n @ViewChild('collections', { read: ViewContainerRef }) collectionsModalRef: ViewContainerRef;\n @ViewChild('bulkDeleteTemplate', { read: ViewContainerRef }) bulkDeleteModalRef: ViewContainerRef;\n @ViewChild('bulkMoveTemplate', { read: ViewContainerRef }) bulkMoveModalRef: ViewContainerRef;\n @ViewChild('bulkShareTemplate', { read: ViewContainerRef }) bulkShareModalRef: ViewContainerRef;\n @ViewChild('updateKeyTemplate', { read: ViewContainerRef }) updateKeyModalRef: ViewContainerRef;\n\n favorites: boolean = false;\n type: CipherType = null;\n folderId: string = null;\n collectionId: string = null;\n showVerifyEmail = false;\n showBrowserOutdated = false;\n showUpdateKey = false;\n showPremiumCallout = false;\n\n private modal: ModalComponent = null;\n\n constructor(private syncService: SyncService, private route: ActivatedRoute,\n private router: Router, private location: Location,\n private i18nService: I18nService, private componentFactoryResolver: ComponentFactoryResolver,\n private tokenService: TokenService, private cryptoService: CryptoService,\n private messagingService: MessagingService, private userService: UserService,\n private platformUtilsService: PlatformUtilsService, private toasterService: ToasterService) { }\n\n async ngOnInit() {\n this.showVerifyEmail = !(await this.tokenService.getEmailVerified());\n this.showBrowserOutdated = window.navigator.userAgent.indexOf('MSIE') !== -1;\n const hasEncKey = await this.cryptoService.hasEncKey();\n this.showUpdateKey = !hasEncKey;\n const isPremium = await this.tokenService.getPremium();\n\n this.route.queryParams.subscribe(async (params) => {\n await this.syncService.fullSync(false);\n await Promise.all([\n this.groupingsComponent.load(),\n this.organizationsComponent.load(),\n ]);\n\n this.showPremiumCallout = !this.showVerifyEmail && !isPremium &&\n !this.platformUtilsService.isSelfHost() && !(await this.inOrgWithPremium());\n\n if (params == null) {\n this.groupingsComponent.selectedAll = true;\n await this.ciphersComponent.load();\n return;\n }\n\n if (params.favorites) {\n this.groupingsComponent.selectedFavorites = true;\n await this.filterFavorites();\n } else if (params.type) {\n const t = parseInt(params.type, null);\n this.groupingsComponent.selectedType = t;\n await this.filterCipherType(t);\n } else if (params.folderId) {\n this.groupingsComponent.selectedFolder = true;\n this.groupingsComponent.selectedFolderId = params.folderId;\n await this.filterFolder(params.folderId);\n } else if (params.collectionId) {\n this.groupingsComponent.selectedCollectionId = params.collectionId;\n await this.filterCollection(params.collectionId);\n } else {\n this.groupingsComponent.selectedAll = true;\n await this.ciphersComponent.load();\n }\n });\n }\n\n async clearGroupingFilters() {\n this.ciphersComponent.showAddNew = true;\n this.groupingsComponent.searchPlaceholder = this.i18nService.t('searchVault');\n await this.ciphersComponent.load();\n this.clearFilters();\n this.go();\n }\n\n async filterFavorites() {\n this.ciphersComponent.showAddNew = true;\n this.groupingsComponent.searchPlaceholder = this.i18nService.t('searchFavorites');\n await this.ciphersComponent.load((c) => c.favorite);\n this.clearFilters();\n this.favorites = true;\n this.go();\n }\n\n async filterCipherType(type: CipherType) {\n this.ciphersComponent.showAddNew = true;\n this.groupingsComponent.searchPlaceholder = this.i18nService.t('searchType');\n await this.ciphersComponent.load((c) => c.type === type);\n this.clearFilters();\n this.type = type;\n this.go();\n }\n\n async filterFolder(folderId: string) {\n this.ciphersComponent.showAddNew = true;\n folderId = folderId === 'none' ? null : folderId;\n this.groupingsComponent.searchPlaceholder = this.i18nService.t('searchFolder');\n await this.ciphersComponent.load((c) => c.folderId === folderId);\n this.clearFilters();\n this.folderId = folderId == null ? 'none' : folderId;\n this.go();\n }\n\n async filterCollection(collectionId: string) {\n this.ciphersComponent.showAddNew = false;\n this.groupingsComponent.searchPlaceholder = this.i18nService.t('searchCollection');\n await this.ciphersComponent.load((c) => c.collectionIds.indexOf(collectionId) > -1);\n this.clearFilters();\n this.collectionId = collectionId;\n this.go();\n }\n\n filterSearchText(searchText: string) {\n this.ciphersComponent.searchText = searchText;\n }\n\n async editCipherAttachments(cipher: CipherView) {\n const premium = await this.tokenService.getPremium();\n if (cipher.organizationId == null && !premium) {\n this.messagingService.send('premiumRequired');\n return;\n } else if (cipher.organizationId != null) {\n const org = await this.userService.getOrganization(cipher.organizationId);\n if (org != null && (org.maxStorageGb == null || org.maxStorageGb === 0)) {\n this.messagingService.send('upgradeOrganization', { organizationId: cipher.organizationId });\n return;\n }\n }\n\n if (this.modal != null) {\n this.modal.close();\n }\n\n const factory = this.componentFactoryResolver.resolveComponentFactory(ModalComponent);\n this.modal = this.attachmentsModalRef.createComponent(factory).instance;\n const childComponent = this.modal.show(AttachmentsComponent, this.attachmentsModalRef);\n\n childComponent.cipherId = cipher.id;\n let madeAttachmentChanges = false;\n childComponent.onUploadedAttachment.subscribe(() => madeAttachmentChanges = true);\n childComponent.onDeletedAttachment.subscribe(() => madeAttachmentChanges = true);\n\n this.modal.onClosed.subscribe(async () => {\n this.modal = null;\n if (madeAttachmentChanges) {\n await this.ciphersComponent.refresh();\n }\n madeAttachmentChanges = false;\n });\n }\n\n shareCipher(cipher: CipherView) {\n if (this.modal != null) {\n this.modal.close();\n }\n\n const factory = this.componentFactoryResolver.resolveComponentFactory(ModalComponent);\n this.modal = this.shareModalRef.createComponent(factory).instance;\n const childComponent = this.modal.show(ShareComponent, this.shareModalRef);\n\n childComponent.cipherId = cipher.id;\n childComponent.onSharedCipher.subscribe(async () => {\n this.modal.close();\n await this.ciphersComponent.refresh();\n });\n\n this.modal.onClosed.subscribe(async () => {\n this.modal = null;\n });\n }\n\n editCipherCollections(cipher: CipherView) {\n if (this.modal != null) {\n this.modal.close();\n }\n\n const factory = this.componentFactoryResolver.resolveComponentFactory(ModalComponent);\n this.modal = this.collectionsModalRef.createComponent(factory).instance;\n const childComponent = this.modal.show(CollectionsComponent, this.collectionsModalRef);\n\n childComponent.cipherId = cipher.id;\n childComponent.onSavedCollections.subscribe(async () => {\n this.modal.close();\n await this.ciphersComponent.refresh();\n });\n\n this.modal.onClosed.subscribe(async () => {\n this.modal = null;\n });\n }\n\n async addFolder() {\n if (this.modal != null) {\n this.modal.close();\n }\n\n const factory = this.componentFactoryResolver.resolveComponentFactory(ModalComponent);\n this.modal = this.folderAddEditModalRef.createComponent(factory).instance;\n const childComponent = this.modal.show(\n FolderAddEditComponent, this.folderAddEditModalRef);\n\n childComponent.folderId = null;\n childComponent.onSavedFolder.subscribe(async () => {\n this.modal.close();\n await this.groupingsComponent.loadFolders();\n });\n\n this.modal.onClosed.subscribe(() => {\n this.modal = null;\n });\n }\n\n async editFolder(folderId: string) {\n if (this.modal != null) {\n this.modal.close();\n }\n\n const factory = this.componentFactoryResolver.resolveComponentFactory(ModalComponent);\n this.modal = this.folderAddEditModalRef.createComponent(factory).instance;\n const childComponent = this.modal.show(\n FolderAddEditComponent, this.folderAddEditModalRef);\n\n childComponent.folderId = folderId;\n childComponent.onSavedFolder.subscribe(async () => {\n this.modal.close();\n await this.groupingsComponent.loadFolders();\n });\n childComponent.onDeletedFolder.subscribe(async () => {\n this.modal.close();\n await this.groupingsComponent.loadFolders();\n await this.filterFolder('none');\n this.groupingsComponent.selectedFolderId = null;\n });\n\n this.modal.onClosed.subscribe(() => {\n this.modal = null;\n });\n }\n\n addCipher() {\n const component = this.editCipher(null);\n component.type = this.type;\n component.folderId = this.folderId === 'none' ? null : this.folderId;\n }\n\n editCipher(cipher: CipherView) {\n if (this.modal != null) {\n this.modal.close();\n }\n\n const factory = this.componentFactoryResolver.resolveComponentFactory(ModalComponent);\n this.modal = this.cipherAddEditModalRef.createComponent(factory).instance;\n const childComponent = this.modal.show(\n AddEditComponent, this.cipherAddEditModalRef);\n\n childComponent.cipherId = cipher == null ? null : cipher.id;\n childComponent.onSavedCipher.subscribe(async (c: CipherView) => {\n this.modal.close();\n await this.ciphersComponent.refresh();\n });\n childComponent.onDeletedCipher.subscribe(async (c: CipherView) => {\n this.modal.close();\n await this.ciphersComponent.refresh();\n });\n\n this.modal.onClosed.subscribe(() => {\n this.modal = null;\n });\n\n return childComponent;\n }\n\n bulkDelete() {\n const selectedIds = this.ciphersComponent.getSelectedIds();\n if (selectedIds.length === 0) {\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'),\n this.i18nService.t('nothingSelected'));\n return;\n }\n\n if (this.modal != null) {\n this.modal.close();\n }\n\n const factory = this.componentFactoryResolver.resolveComponentFactory(ModalComponent);\n this.modal = this.bulkDeleteModalRef.createComponent(factory).instance;\n const childComponent = this.modal.show(BulkDeleteComponent, this.bulkDeleteModalRef);\n\n childComponent.cipherIds = selectedIds;\n childComponent.onDeleted.subscribe(async () => {\n this.modal.close();\n await this.ciphersComponent.refresh();\n });\n\n this.modal.onClosed.subscribe(() => {\n this.modal = null;\n });\n }\n\n bulkShare() {\n const selectedCiphers = this.ciphersComponent.getSelected();\n if (selectedCiphers.length === 0) {\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'),\n this.i18nService.t('nothingSelected'));\n return;\n }\n\n if (this.modal != null) {\n this.modal.close();\n }\n\n const factory = this.componentFactoryResolver.resolveComponentFactory(ModalComponent);\n this.modal = this.bulkShareModalRef.createComponent(factory).instance;\n const childComponent = this.modal.show(BulkShareComponent, this.bulkShareModalRef);\n\n childComponent.ciphers = selectedCiphers;\n childComponent.onShared.subscribe(async () => {\n this.modal.close();\n await this.ciphersComponent.refresh();\n });\n\n this.modal.onClosed.subscribe(async () => {\n this.modal = null;\n });\n }\n\n bulkMove() {\n const selectedIds = this.ciphersComponent.getSelectedIds();\n if (selectedIds.length === 0) {\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'),\n this.i18nService.t('nothingSelected'));\n return;\n }\n\n if (this.modal != null) {\n this.modal.close();\n }\n\n const factory = this.componentFactoryResolver.resolveComponentFactory(ModalComponent);\n this.modal = this.bulkMoveModalRef.createComponent(factory).instance;\n const childComponent = this.modal.show(BulkMoveComponent, this.bulkMoveModalRef);\n\n childComponent.cipherIds = selectedIds;\n childComponent.onMoved.subscribe(async () => {\n this.modal.close();\n await this.ciphersComponent.refresh();\n });\n\n this.modal.onClosed.subscribe(() => {\n this.modal = null;\n });\n }\n\n selectAll(select: boolean) {\n this.ciphersComponent.selectAll(select);\n }\n\n updateKey() {\n if (this.modal != null) {\n this.modal.close();\n }\n\n const factory = this.componentFactoryResolver.resolveComponentFactory(ModalComponent);\n this.modal = this.updateKeyModalRef.createComponent(factory).instance;\n this.modal.show(UpdateKeyComponent, this.updateKeyModalRef);\n\n this.modal.onClosed.subscribe(() => {\n this.modal = null;\n });\n }\n\n private clearFilters() {\n this.folderId = null;\n this.collectionId = null;\n this.favorites = false;\n this.type = null;\n }\n\n private go(queryParams: any = null) {\n if (queryParams == null) {\n queryParams = {\n favorites: this.favorites ? true : null,\n type: this.type,\n folderId: this.folderId,\n collectionId: this.collectionId,\n };\n }\n\n const url = this.router.createUrlTree(['vault'], { queryParams: queryParams }).toString();\n this.location.go(url);\n }\n\n private async inOrgWithPremium() {\n const orgs = await this.userService.getAllOrganizations();\n for (let i = 0; i < orgs.length; i++) {\n if (orgs[i].usersGetPremium) {\n return true;\n }\n }\n return false;\n }\n}\n","export enum UriMatchType {\r\n Domain = 0,\r\n Host = 1,\r\n StartsWith = 2,\r\n Exact = 3,\r\n RegularExpression = 4,\r\n Never = 5,\r\n}\r\n","import {\n Component,\n Input,\n OnChanges,\n} from '@angular/core';\n\nimport { CipherType } from '../../enums/cipherType';\n\nimport { EnvironmentService } from '../../abstractions/environment.service';\nimport { StateService } from '../../abstractions/state.service';\n\nimport { ConstantsService } from '../../services/constants.service';\n\nimport { Utils } from '../../misc/utils';\n\n@Component({\n selector: 'app-vault-icon',\n templateUrl: 'icon.component.html',\n})\nexport class IconComponent implements OnChanges {\n @Input() cipher: any;\n icon: string;\n image: string;\n fallbackImage: string;\n imageEnabled: boolean;\n\n private iconsUrl: string;\n\n constructor(private environmentService: EnvironmentService, private stateService: StateService) {\n this.iconsUrl = environmentService.iconsUrl;\n if (!this.iconsUrl) {\n if (environmentService.baseUrl) {\n this.iconsUrl = environmentService.baseUrl + '/icons';\n } else {\n this.iconsUrl = 'https://icons.bitwarden.net';\n }\n }\n }\n\n async ngOnChanges() {\n this.imageEnabled = !(await this.stateService.get(ConstantsService.disableFaviconKey));\n\n switch (this.cipher.type) {\n case CipherType.Login:\n this.icon = 'fa-globe';\n this.setLoginIcon();\n break;\n case CipherType.SecureNote:\n this.icon = 'fa-sticky-note-o';\n break;\n case CipherType.Card:\n this.icon = 'fa-credit-card';\n break;\n case CipherType.Identity:\n this.icon = 'fa-id-card-o';\n break;\n default:\n break;\n }\n }\n\n private setLoginIcon() {\n if (this.cipher.login.uri) {\n let hostnameUri = this.cipher.login.uri;\n let isWebsite = false;\n\n if (hostnameUri.indexOf('androidapp://') === 0) {\n this.icon = 'fa-android';\n this.image = null;\n } else if (hostnameUri.indexOf('iosapp://') === 0) {\n this.icon = 'fa-apple';\n this.image = null;\n } else if (this.imageEnabled && hostnameUri.indexOf('://') === -1 && hostnameUri.indexOf('.') > -1) {\n hostnameUri = 'http://' + hostnameUri;\n isWebsite = true;\n } else if (this.imageEnabled) {\n isWebsite = hostnameUri.indexOf('http') === 0 && hostnameUri.indexOf('.') > -1;\n }\n\n if (this.imageEnabled && isWebsite) {\n try {\n this.image = this.iconsUrl + '/' + Utils.getHostname(hostnameUri) + '/icon.png';\n this.fallbackImage = 'images/fa-globe.png';\n } catch (e) { }\n }\n } else {\n this.image = null;\n }\n }\n}\n","import {\r\n Component,\r\n OnInit,\r\n} from '@angular/core';\r\n\r\n@Component({\r\n selector: 'app-user-layout',\r\n templateUrl: 'user-layout.component.html',\r\n})\r\nexport class UserLayoutComponent implements OnInit {\r\n ngOnInit() {\r\n document.body.classList.remove('layout_frontend');\r\n }\r\n}\r\n","import {\n Component,\n OnInit,\n} from '@angular/core';\n\nimport { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';\n\n@Component({\n selector: 'app-footer',\n templateUrl: 'footer.component.html',\n})\nexport class FooterComponent implements OnInit {\n version: string;\n year: string = '2015';\n\n constructor(private platformUtilsService: PlatformUtilsService) { }\n\n ngOnInit() {\n this.year = new Date().getFullYear().toString();\n this.version = this.platformUtilsService.getApplicationVersion();\n }\n}\n","import {\r\n Component,\r\n OnInit,\r\n} from '@angular/core';\r\n\r\nimport { MessagingService } from 'jslib/abstractions/messaging.service';\r\nimport { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';\r\nimport { TokenService } from 'jslib/abstractions/token.service';\r\n\r\n@Component({\r\n selector: 'app-navbar',\r\n templateUrl: 'navbar.component.html',\r\n})\r\nexport class NavbarComponent implements OnInit {\r\n selfHosted = false;\r\n name: string;\r\n\r\n constructor(private messagingService: MessagingService, private platformUtilsService: PlatformUtilsService,\r\n private tokenService: TokenService) {\r\n this.selfHosted = this.platformUtilsService.isSelfHost();\r\n }\r\n\r\n async ngOnInit() {\r\n this.name = await this.tokenService.getName();\r\n if (this.name == null || this.name.trim() === '') {\r\n this.name = await this.tokenService.getEmail();\r\n }\r\n }\r\n\r\n lock() {\r\n this.messagingService.send('lockVault');\r\n }\r\n\r\n logOut() {\r\n this.messagingService.send('logout');\r\n }\r\n}\r\n","import {\n Component,\n OnInit,\n} from '@angular/core';\nimport {\n ActivatedRoute,\n Router,\n} from '@angular/router';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\n\nimport { VerifyDeleteRecoverRequest } from 'jslib/models/request/verifyDeleteRecoverRequest';\n\n@Component({\n selector: 'app-verify-recover-delete',\n templateUrl: 'verify-recover-delete.component.html',\n})\nexport class VerifyRecoverDeleteComponent implements OnInit {\n email: string;\n formPromise: Promise;\n\n private userId: string;\n private token: string;\n\n constructor(private router: Router, private apiService: ApiService,\n private analytics: Angulartics2, private toasterService: ToasterService,\n private i18nService: I18nService, private route: ActivatedRoute) {\n }\n\n ngOnInit() {\n let fired = false;\n this.route.queryParams.subscribe(async (qParams) => {\n if (fired) {\n return;\n }\n fired = true;\n if (qParams.userId != null && qParams.token != null && qParams.email != null) {\n this.userId = qParams.userId;\n this.token = qParams.token;\n this.email = qParams.email;\n } else {\n this.router.navigate(['/']);\n }\n });\n }\n\n async submit() {\n try {\n const request = new VerifyDeleteRecoverRequest(this.userId, this.token);\n this.formPromise = this.apiService.postAccountRecoverDeleteToken(request);\n await this.formPromise;\n this.analytics.eventTrack.next({ action: 'Recovered Delete' });\n this.toasterService.popAsync('success', this.i18nService.t('accountDeleted'),\n this.i18nService.t('accountDeletedDesc'));\n this.router.navigate(['/']);\n } catch { }\n }\n}\n","import { Component } from '@angular/core';\nimport { Router } from '@angular/router';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\n\nimport { DeleteRecoverRequest } from 'jslib/models/request/deleteRecoverRequest';\n\n@Component({\n selector: 'app-recover-delete',\n templateUrl: 'recover-delete.component.html',\n})\nexport class RecoverDeleteComponent {\n email: string;\n formPromise: Promise;\n\n constructor(private router: Router, private apiService: ApiService,\n private analytics: Angulartics2, private toasterService: ToasterService,\n private i18nService: I18nService) {\n }\n\n async submit() {\n try {\n const request = new DeleteRecoverRequest();\n request.email = this.email.toLowerCase();\n this.formPromise = this.apiService.postAccountRecoverDelete(request);\n await this.formPromise;\n this.analytics.eventTrack.next({ action: 'Started Delete Recovery' });\n this.toasterService.popAsync('success', null, this.i18nService.t('deleteRecoverEmailSent'));\n this.router.navigate(['/']);\n } catch { }\n }\n}\n","import { Component } from '@angular/core';\nimport { Router } from '@angular/router';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { CryptoService } from 'jslib/abstractions/crypto.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\n\nimport { TwoFactorRecoveryRequest } from 'jslib/models/request/twoFactorRecoveryRequest';\n\n@Component({\n selector: 'app-recover-two-factor',\n templateUrl: 'recover-two-factor.component.html',\n})\nexport class RecoverTwoFactorComponent {\n email: string;\n masterPassword: string;\n recoveryCode: string;\n formPromise: Promise;\n\n constructor(private router: Router, private apiService: ApiService,\n private analytics: Angulartics2, private toasterService: ToasterService,\n private i18nService: I18nService, private cryptoService: CryptoService) {\n }\n\n async submit() {\n try {\n const request = new TwoFactorRecoveryRequest();\n request.recoveryCode = this.recoveryCode.replace(/\\s/g, '').toLowerCase();\n request.email = this.email.toLowerCase();\n const key = await this.cryptoService.makeKey(this.masterPassword, request.email);\n request.masterPasswordHash = await this.cryptoService.hashPassword(this.masterPassword, key);\n this.formPromise = this.apiService.postTwoFactorRecover(request);\n await this.formPromise;\n this.analytics.eventTrack.next({ action: 'Recovered 2FA' });\n this.toasterService.popAsync('success', null, this.i18nService.t('twoStepRecoverDisabled'));\n this.router.navigate(['/']);\n } catch { }\n }\n}\n","import {\n Component,\n OnInit,\n} from '@angular/core';\nimport {\n ActivatedRoute,\n Router,\n} from '@angular/router';\n\nimport {\n Toast,\n ToasterService,\n} from 'angular2-toaster';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\nimport { StateService } from 'jslib/abstractions/state.service';\nimport { UserService } from 'jslib/abstractions/user.service';\n\nimport { OrganizationUserAcceptRequest } from 'jslib/models/request/organizationUserAcceptRequest';\n\n@Component({\n selector: 'app-accept-organization',\n templateUrl: 'accept-organization.component.html',\n})\nexport class AcceptOrganizationComponent implements OnInit {\n loading = true;\n authed = false;\n orgName: string;\n email: string;\n actionPromise: Promise;\n\n constructor(private router: Router, private toasterService: ToasterService,\n private i18nService: I18nService, private route: ActivatedRoute,\n private apiService: ApiService, private userService: UserService,\n private stateService: StateService) { }\n\n ngOnInit() {\n let fired = false;\n this.route.queryParams.subscribe(async (qParams) => {\n if (fired) {\n return;\n }\n fired = true;\n await this.stateService.remove('orgInvitation');\n let error = qParams.organizationId == null || qParams.organizationUserId == null || qParams.token == null;\n if (!error) {\n this.authed = await this.userService.isAuthenticated();\n if (this.authed) {\n const request = new OrganizationUserAcceptRequest();\n request.token = qParams.token;\n try {\n this.actionPromise = this.apiService.postOrganizationUserAccept(qParams.organizationId,\n qParams.organizationUserId, request);\n await this.actionPromise;\n const toast: Toast = {\n type: 'success',\n title: this.i18nService.t('inviteAccepted'),\n body: this.i18nService.t('inviteAcceptedDesc'),\n timeout: 10000,\n };\n this.toasterService.popAsync(toast);\n this.router.navigate(['/vault']);\n } catch {\n error = true;\n }\n } else {\n await this.stateService.save('orgInvitation', qParams);\n this.email = qParams.email;\n this.orgName = qParams.organizationName;\n if (this.orgName != null) {\n // Fix URL encoding of space issue with Angular\n this.orgName = this.orgName.replace(/\\+/g, ' ');\n }\n }\n }\n\n if (error) {\n this.toasterService.popAsync('error', null, this.i18nService.t('inviteAcceptFailed'));\n this.router.navigate(['/']);\n }\n\n this.loading = false;\n });\n }\n}\n","import {\n Component,\n OnInit,\n} from '@angular/core';\nimport {\n ActivatedRoute,\n Router,\n} from '@angular/router';\n\nimport { ToasterService } from 'angular2-toaster';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\nimport { UserService } from 'jslib/abstractions/user.service';\n\nimport { VerifyEmailRequest } from 'jslib/models/request/verifyEmailRequest';\n\n@Component({\n selector: 'app-verify-email-token',\n templateUrl: 'verify-email-token.component.html',\n})\nexport class VerifyEmailTokenComponent implements OnInit {\n constructor(private router: Router, private toasterService: ToasterService,\n private i18nService: I18nService, private route: ActivatedRoute,\n private apiService: ApiService, private userService: UserService) { }\n\n ngOnInit() {\n let fired = false;\n this.route.queryParams.subscribe(async (qParams) => {\n if (fired) {\n return;\n }\n fired = true;\n if (qParams.userId != null && qParams.token != null) {\n try {\n await this.apiService.postAccountVerifyEmailToken(\n new VerifyEmailRequest(qParams.userId, qParams.token));\n const authed = await this.userService.isAuthenticated();\n if (authed) {\n await this.apiService.refreshIdentityToken();\n }\n this.toasterService.popAsync('success', null, this.i18nService.t('emailVerified'));\n this.router.navigate(['/']);\n return;\n } catch { }\n }\n this.toasterService.popAsync('error', null, this.i18nService.t('emailVerifiedFailed'));\n this.router.navigate(['/']);\n });\n }\n}\n","import {\r\n Component,\r\n OnInit,\r\n} from '@angular/core';\r\nimport { Router } from '@angular/router';\r\n\r\nimport { ToasterService } from 'angular2-toaster';\r\nimport { Angulartics2 } from 'angulartics2';\r\n\r\nimport { CryptoService } from 'jslib/abstractions/crypto.service';\r\nimport { I18nService } from 'jslib/abstractions/i18n.service';\r\nimport { MessagingService } from 'jslib/abstractions/messaging.service';\r\nimport { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';\r\nimport { UserService } from 'jslib/abstractions/user.service';\r\n\r\nimport { RouterService } from '../services/router.service';\r\n\r\nimport { LockComponent as BaseLockComponent } from 'jslib/angular/components/lock.component';\r\n\r\n@Component({\r\n selector: 'app-lock',\r\n templateUrl: 'lock.component.html',\r\n})\r\nexport class LockComponent extends BaseLockComponent implements OnInit {\r\n constructor(router: Router, analytics: Angulartics2,\r\n toasterService: ToasterService, i18nService: I18nService,\r\n platformUtilsService: PlatformUtilsService, messagingService: MessagingService,\r\n userService: UserService, cryptoService: CryptoService,\r\n private routerService: RouterService) {\r\n super(router, analytics, toasterService, i18nService, platformUtilsService,\r\n messagingService, userService, cryptoService);\r\n }\r\n\r\n async ngOnInit() {\r\n const authed = await this.userService.isAuthenticated();\r\n if (!authed) {\r\n this.router.navigate(['/']);\r\n } else if (await this.cryptoService.hasKey()) {\r\n this.router.navigate(['vault']);\r\n }\r\n\r\n const previousUrl = this.routerService.getPreviousUrl();\r\n if (previousUrl !== '/' && previousUrl.indexOf('lock') === -1) {\r\n this.successRoute = previousUrl;\r\n }\r\n }\r\n}\r\n","import { Component } from '@angular/core';\r\nimport { Router } from '@angular/router';\r\n\r\nimport { ToasterService } from 'angular2-toaster';\r\nimport { Angulartics2 } from 'angulartics2';\r\n\r\nimport { ApiService } from 'jslib/abstractions/api.service';\r\nimport { I18nService } from 'jslib/abstractions/i18n.service';\r\n\r\nimport { HintComponent as BaseHintComponent } from 'jslib/angular/components/hint.component';\r\n\r\n@Component({\r\n selector: 'app-hint',\r\n templateUrl: 'hint.component.html',\r\n})\r\nexport class HintComponent extends BaseHintComponent {\r\n constructor(router: Router, analytics: Angulartics2,\r\n toasterService: ToasterService, i18nService: I18nService,\r\n apiService: ApiService) {\r\n super(router, analytics, toasterService, i18nService, apiService);\r\n }\r\n}\r\n","import { Component } from '@angular/core';\nimport {\n ActivatedRoute,\n Router,\n} from '@angular/router';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { AuthService } from 'jslib/abstractions/auth.service';\nimport { CryptoService } from 'jslib/abstractions/crypto.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\nimport { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';\nimport { StateService } from 'jslib/abstractions/state.service';\n\nimport { RegisterComponent as BaseRegisterComponent } from 'jslib/angular/components/register.component';\n\n@Component({\n selector: 'app-register',\n templateUrl: 'register.component.html',\n})\nexport class RegisterComponent extends BaseRegisterComponent {\n showCreateOrgMessage = false;\n showTerms = true;\n\n constructor(authService: AuthService, router: Router,\n analytics: Angulartics2, toasterService: ToasterService,\n i18nService: I18nService, cryptoService: CryptoService,\n apiService: ApiService, private route: ActivatedRoute,\n stateService: StateService, platformUtilsService: PlatformUtilsService) {\n super(authService, router, analytics, toasterService, i18nService, cryptoService, apiService, stateService);\n this.showTerms = !platformUtilsService.isSelfHost();\n }\n\n ngOnInit() {\n this.route.queryParams.subscribe((qParams) => {\n if (qParams.email != null && qParams.email.indexOf('@') > -1) {\n this.email = qParams.email;\n }\n if (qParams.premium != null) {\n this.stateService.save('loginRedirect', { route: '/settings/premium' });\n } else if (qParams.org != null) {\n this.showCreateOrgMessage = true;\n this.stateService.save('loginRedirect',\n { route: '/settings/create-organization', qParams: { plan: qParams.org } });\n }\n });\n }\n}\n","/**\r\n * Duo Web SDK v2\r\n * Copyright 2017, Duo Security\r\n */\r\n(function (root, factory) {\r\n /*eslint-disable */\r\n if (typeof define === 'function' && define.amd) {\r\n // AMD. Register as an anonymous module.\r\n define([], factory);\r\n /*eslint-enable */\r\n }\r\n else if (typeof module === 'object' && module.exports) {\r\n // Node. Does not work with strict CommonJS, but\r\n // only CommonJS-like environments that support module.exports,\r\n // like Node.\r\n module.exports = factory();\r\n }\r\n else {\r\n // Browser globals (root is window)\r\n var Duo = factory();\r\n // If the Javascript was loaded via a script tag, attempt to autoload\r\n // the frame.\r\n Duo._onReady(Duo.init);\r\n // Attach Duo to the `window` object\r\n root.Duo = Duo;\r\n }\r\n}(this, function () {\r\n var DUO_MESSAGE_FORMAT = /^(?:AUTH|ENROLL)+\\|[A-Za-z0-9\\+\\/=]+\\|[A-Za-z0-9\\+\\/=]+$/;\r\n var DUO_ERROR_FORMAT = /^ERR\\|[\\w\\s\\.\\(\\)]+$/;\r\n var DUO_OPEN_WINDOW_FORMAT = /^DUO_OPEN_WINDOW\\|/;\r\n var VALID_OPEN_WINDOW_DOMAINS = [\r\n 'duo.com',\r\n 'duosecurity.com',\r\n 'duomobile.s3-us-west-1.amazonaws.com'\r\n ];\r\n var iframeId = 'duo_iframe', postAction = '', postArgument = 'sig_response', host, sigRequest, duoSig, appSig, iframe, submitCallback;\r\n function throwError(message, url) {\r\n throw new Error('Duo Web SDK error: ' + message +\r\n (url ? ('\\n' + 'See ' + url + ' for more information') : ''));\r\n }\r\n function hyphenize(str) {\r\n return str.replace(/([a-z])([A-Z])/, '$1-$2').toLowerCase();\r\n }\r\n // cross-browser data attributes\r\n function getDataAttribute(element, name) {\r\n if ('dataset' in element) {\r\n return element.dataset[name];\r\n }\r\n else {\r\n return element.getAttribute('data-' + hyphenize(name));\r\n }\r\n }\r\n // cross-browser event binding/unbinding\r\n function on(context, event, fallbackEvent, callback) {\r\n if ('addEventListener' in window) {\r\n context.addEventListener(event, callback, false);\r\n }\r\n else {\r\n context.attachEvent(fallbackEvent, callback);\r\n }\r\n }\r\n function off(context, event, fallbackEvent, callback) {\r\n if ('removeEventListener' in window) {\r\n context.removeEventListener(event, callback, false);\r\n }\r\n else {\r\n context.detachEvent(fallbackEvent, callback);\r\n }\r\n }\r\n function onReady(callback) {\r\n on(document, 'DOMContentLoaded', 'onreadystatechange', callback);\r\n }\r\n function offReady(callback) {\r\n off(document, 'DOMContentLoaded', 'onreadystatechange', callback);\r\n }\r\n function onMessage(callback) {\r\n on(window, 'message', 'onmessage', callback);\r\n }\r\n function offMessage(callback) {\r\n off(window, 'message', 'onmessage', callback);\r\n }\r\n /**\r\n * Parse the sig_request parameter, throwing errors if the token contains\r\n * a server error or if the token is invalid.\r\n *\r\n * @param {String} sig Request token\r\n */\r\n function parseSigRequest(sig) {\r\n if (!sig) {\r\n // nothing to do\r\n return;\r\n }\r\n // see if the token contains an error, throwing it if it does\r\n if (sig.indexOf('ERR|') === 0) {\r\n throwError(sig.split('|')[1]);\r\n }\r\n // validate the token\r\n if (sig.indexOf(':') === -1 || sig.split(':').length !== 2) {\r\n throwError('Duo was given a bad token. This might indicate a configuration ' +\r\n 'problem with one of Duo\\'s client libraries.', 'https://www.duosecurity.com/docs/duoweb#first-steps');\r\n }\r\n var sigParts = sig.split(':');\r\n // hang on to the token, and the parsed duo and app sigs\r\n sigRequest = sig;\r\n duoSig = sigParts[0];\r\n appSig = sigParts[1];\r\n return {\r\n sigRequest: sig,\r\n duoSig: sigParts[0],\r\n appSig: sigParts[1]\r\n };\r\n }\r\n /**\r\n * This function is set up to run when the DOM is ready, if the iframe was\r\n * not available during `init`.\r\n */\r\n function onDOMReady() {\r\n iframe = document.getElementById(iframeId);\r\n if (!iframe) {\r\n throw new Error('This page does not contain an iframe for Duo to use.' +\r\n 'Add an element like ' +\r\n 'to this page. ' +\r\n 'See https://www.duosecurity.com/docs/duoweb#3.-show-the-iframe ' +\r\n 'for more information.');\r\n }\r\n // we've got an iframe, away we go!\r\n ready();\r\n // always clean up after yourself\r\n offReady(onDOMReady);\r\n }\r\n /**\r\n * Validate that a MessageEvent came from the Duo service, and that it\r\n * is a properly formatted payload.\r\n *\r\n * The Google Chrome sign-in page injects some JS into pages that also\r\n * make use of postMessage, so we need to do additional validation above\r\n * and beyond the origin.\r\n *\r\n * @param {MessageEvent} event Message received via postMessage\r\n */\r\n function isDuoMessage(event) {\r\n return Boolean(event.origin === ('https://' + host) &&\r\n typeof event.data === 'string' &&\r\n (event.data.match(DUO_MESSAGE_FORMAT) ||\r\n event.data.match(DUO_ERROR_FORMAT) ||\r\n event.data.match(DUO_OPEN_WINDOW_FORMAT)));\r\n }\r\n /**\r\n * Validate the request token and prepare for the iframe to become ready.\r\n *\r\n * All options below can be passed into an options hash to `Duo.init`, or\r\n * specified on the iframe using `data-` attributes.\r\n *\r\n * Options specified using the options hash will take precedence over\r\n * `data-` attributes.\r\n *\r\n * Example using options hash:\r\n * ```javascript\r\n * Duo.init({\r\n * iframe: \"some_other_id\",\r\n * host: \"api-main.duo.test\",\r\n * sig_request: \"...\",\r\n * post_action: \"/auth\",\r\n * post_argument: \"resp\"\r\n * });\r\n * ```\r\n *\r\n * Example using `data-` attributes:\r\n * ```\r\n * \r\n * ```\r\n *\r\n * @param {Object} options\r\n * @param {String} options.iframe The iframe, or id of an iframe to set up\r\n * @param {String} options.host Hostname\r\n * @param {String} options.sig_request Request token\r\n * @param {String} [options.post_action=''] URL to POST back to after successful auth\r\n * @param {String} [options.post_argument='sig_response'] Parameter name to use for response token\r\n * @param {Function} [options.submit_callback] If provided, duo will not submit the form instead execute\r\n * the callback function with reference to the \"duo_form\" form object\r\n * submit_callback can be used to prevent the webpage from reloading.\r\n */\r\n function init(options) {\r\n if (options) {\r\n if (options.host) {\r\n host = options.host;\r\n }\r\n if (options.sig_request) {\r\n parseSigRequest(options.sig_request);\r\n }\r\n if (options.post_action) {\r\n postAction = options.post_action;\r\n }\r\n if (options.post_argument) {\r\n postArgument = options.post_argument;\r\n }\r\n if (options.iframe) {\r\n if (options.iframe.tagName) {\r\n iframe = options.iframe;\r\n }\r\n else if (typeof options.iframe === 'string') {\r\n iframeId = options.iframe;\r\n }\r\n }\r\n if (typeof options.submit_callback === 'function') {\r\n submitCallback = options.submit_callback;\r\n }\r\n }\r\n // if we were given an iframe, no need to wait for the rest of the DOM\r\n if (false && iframe) {\r\n ready();\r\n }\r\n else {\r\n // try to find the iframe in the DOM\r\n iframe = document.getElementById(iframeId);\r\n // iframe is in the DOM, away we go!\r\n if (iframe) {\r\n ready();\r\n }\r\n else {\r\n // wait until the DOM is ready, then try again\r\n onReady(onDOMReady);\r\n }\r\n }\r\n // always clean up after yourself!\r\n offReady(init);\r\n }\r\n /**\r\n * This function is called when a message was received from another domain\r\n * using the `postMessage` API. Check that the event came from the Duo\r\n * service domain, and that the message is a properly formatted payload,\r\n * then perform the post back to the primary service.\r\n *\r\n * @param event Event object (contains origin and data)\r\n */\r\n function onReceivedMessage(event) {\r\n if (isDuoMessage(event)) {\r\n if (event.data.match(DUO_OPEN_WINDOW_FORMAT)) {\r\n var url = event.data.substring(\"DUO_OPEN_WINDOW|\".length);\r\n if (isValidUrlToOpen(url)) {\r\n // Open the URL that comes after the DUO_WINDOW_OPEN token.\r\n window.open(url, \"_self\");\r\n }\r\n }\r\n else {\r\n // the event came from duo, do the post back\r\n doPostBack(event.data);\r\n // always clean up after yourself!\r\n offMessage(onReceivedMessage);\r\n }\r\n }\r\n }\r\n /**\r\n * Validate that this passed in URL is one that we will actually allow to\r\n * be opened.\r\n * @param url String URL that the message poster wants to open\r\n * @returns {boolean} true if we allow this url to be opened in the window\r\n */\r\n function isValidUrlToOpen(url) {\r\n if (!url) {\r\n return false;\r\n }\r\n var parser = document.createElement('a');\r\n parser.href = url;\r\n if (parser.protocol === \"duotrustedendpoints:\") {\r\n return true;\r\n }\r\n else if (parser.protocol !== \"https:\") {\r\n return false;\r\n }\r\n for (var i = 0; i < VALID_OPEN_WINDOW_DOMAINS.length; i++) {\r\n if (parser.hostname.endsWith(\".\" + VALID_OPEN_WINDOW_DOMAINS[i]) ||\r\n parser.hostname === VALID_OPEN_WINDOW_DOMAINS[i]) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n /**\r\n * Point the iframe at Duo, then wait for it to postMessage back to us.\r\n */\r\n function ready() {\r\n if (!host) {\r\n host = getDataAttribute(iframe, 'host');\r\n if (!host) {\r\n throwError('No API hostname is given for Duo to use. Be sure to pass ' +\r\n 'a `host` parameter to Duo.init, or through the `data-host` ' +\r\n 'attribute on the iframe element.', 'https://www.duosecurity.com/docs/duoweb#3.-show-the-iframe');\r\n }\r\n }\r\n if (!duoSig || !appSig) {\r\n parseSigRequest(getDataAttribute(iframe, 'sigRequest'));\r\n if (!duoSig || !appSig) {\r\n throwError('No valid signed request is given. Be sure to give the ' +\r\n '`sig_request` parameter to Duo.init, or use the ' +\r\n '`data-sig-request` attribute on the iframe element.', 'https://www.duosecurity.com/docs/duoweb#3.-show-the-iframe');\r\n }\r\n }\r\n // if postAction/Argument are defaults, see if they are specified\r\n // as data attributes on the iframe\r\n if (postAction === '') {\r\n postAction = getDataAttribute(iframe, 'postAction') || postAction;\r\n }\r\n if (postArgument === 'sig_response') {\r\n postArgument = getDataAttribute(iframe, 'postArgument') || postArgument;\r\n }\r\n // point the iframe at Duo\r\n iframe.src = [\r\n 'https://', host, '/frame/web/v1/auth?tx=', duoSig,\r\n '&parent=', encodeURIComponent(document.location.href),\r\n '&v=2.6'\r\n ].join('');\r\n // listen for the 'message' event\r\n onMessage(onReceivedMessage);\r\n }\r\n /**\r\n * We received a postMessage from Duo. POST back to the primary service\r\n * with the response token, and any additional user-supplied parameters\r\n * given in form#duo_form.\r\n */\r\n function doPostBack(response) {\r\n // create a hidden input to contain the response token\r\n var input = document.createElement('input');\r\n input.type = 'hidden';\r\n input.name = postArgument;\r\n input.value = response + ':' + appSig;\r\n // user may supply their own form with additional inputs\r\n var form = document.getElementById('duo_form');\r\n // if the form doesn't exist, create one\r\n if (!form) {\r\n form = document.createElement('form');\r\n // insert the new form after the iframe\r\n iframe.parentElement.insertBefore(form, iframe.nextSibling);\r\n }\r\n // make sure we are actually posting to the right place\r\n form.method = 'POST';\r\n form.action = postAction;\r\n // add the response token input to the form\r\n form.appendChild(input);\r\n // away we go!\r\n if (typeof submitCallback === \"function\") {\r\n submitCallback.call(null, form);\r\n }\r\n else {\r\n form.submit();\r\n }\r\n }\r\n return {\r\n init: init,\r\n _onReady: onReady,\r\n _parseSigRequest: parseSigRequest,\r\n _isDuoMessage: isDuoMessage,\r\n _doPostBack: doPostBack\r\n };\r\n}));\r\n//# sourceMappingURL=duo.js.map","import {\n Component,\n ComponentFactoryResolver,\n ViewChild,\n ViewContainerRef,\n} from '@angular/core';\n\nimport { Router } from '@angular/router';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { TwoFactorOptionsComponent } from './two-factor-options.component';\n\nimport { ModalComponent } from '../modal.component';\n\nimport { TwoFactorProviderType } from 'jslib/enums/twoFactorProviderType';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { AuthService } from 'jslib/abstractions/auth.service';\nimport { EnvironmentService } from 'jslib/abstractions/environment.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\nimport { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';\nimport { StateService } from 'jslib/abstractions/state.service';\n\nimport { TwoFactorComponent as BaseTwoFactorComponent } from 'jslib/angular/components/two-factor.component';\n\n@Component({\n selector: 'app-two-factor',\n templateUrl: 'two-factor.component.html',\n})\nexport class TwoFactorComponent extends BaseTwoFactorComponent {\n @ViewChild('twoFactorOptions', { read: ViewContainerRef }) twoFactorOptionsModal: ViewContainerRef;\n\n constructor(authService: AuthService, router: Router,\n analytics: Angulartics2, toasterService: ToasterService,\n i18nService: I18nService, apiService: ApiService,\n platformUtilsService: PlatformUtilsService, private stateService: StateService,\n environmentService: EnvironmentService, private componentFactoryResolver: ComponentFactoryResolver) {\n super(authService, router, analytics, toasterService, i18nService, apiService,\n platformUtilsService, window, environmentService);\n this.onSuccessfulLoginNavigate = this.goAfterLogIn;\n }\n\n anotherMethod() {\n const factory = this.componentFactoryResolver.resolveComponentFactory(ModalComponent);\n const modal = this.twoFactorOptionsModal.createComponent(factory).instance;\n const childComponent = modal.show(TwoFactorOptionsComponent,\n this.twoFactorOptionsModal);\n\n childComponent.onProviderSelected.subscribe(async (provider: TwoFactorProviderType) => {\n modal.close();\n this.selectedProviderType = provider;\n await this.init();\n });\n childComponent.onRecoverSelected.subscribe(() => {\n modal.close();\n });\n }\n\n async goAfterLogIn() {\n const invite = await this.stateService.get('orgInvitation');\n if (invite != null) {\n this.router.navigate(['accept-organization'], { queryParams: invite });\n } else {\n const loginRedirect = await this.stateService.get('loginRedirect');\n if (loginRedirect != null) {\n this.router.navigate([loginRedirect.route], { queryParams: loginRedirect.qParams });\n await this.stateService.remove('loginRedirect');\n } else {\n this.router.navigate([this.successRoute]);\n }\n }\n }\n}\n","import { Component } from '@angular/core';\nimport {\n ActivatedRoute,\n Router,\n} from '@angular/router';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { AuthService } from 'jslib/abstractions/auth.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\nimport { StateService } from 'jslib/abstractions/state.service';\nimport { StorageService } from 'jslib/abstractions/storage.service';\n\nimport { LoginComponent as BaseLoginComponent } from 'jslib/angular/components/login.component';\n\n@Component({\n selector: 'app-login',\n templateUrl: 'login.component.html',\n})\nexport class LoginComponent extends BaseLoginComponent {\n constructor(authService: AuthService, router: Router,\n analytics: Angulartics2, toasterService: ToasterService,\n i18nService: I18nService, private route: ActivatedRoute,\n storageService: StorageService, private stateService: StateService) {\n super(authService, router, analytics, toasterService, i18nService, storageService);\n this.onSuccessfulLoginNavigate = this.goAfterLogIn;\n }\n\n async ngOnInit() {\n this.route.queryParams.subscribe(async (qParams) => {\n if (qParams.email != null && qParams.email.indexOf('@') > -1) {\n this.email = qParams.email;\n }\n if (qParams.premium != null) {\n this.stateService.save('loginRedirect', { route: '/settings/premium' });\n } else if (qParams.org != null) {\n this.stateService.save('loginRedirect',\n { route: '/settings/create-organization', qParams: { plan: qParams.org } });\n }\n await super.ngOnInit();\n });\n }\n\n async goAfterLogIn() {\n const invite = await this.stateService.get('orgInvitation');\n if (invite != null) {\n this.router.navigate(['accept-organization'], { queryParams: invite });\n } else {\n const loginRedirect = await this.stateService.get('loginRedirect');\n if (loginRedirect != null) {\n this.router.navigate([loginRedirect.route], { queryParams: loginRedirect.qParams });\n await this.stateService.remove('loginRedirect');\n } else {\n this.router.navigate([this.successRoute]);\n }\n }\n }\n}\n","import {\r\n Component,\r\n OnDestroy,\r\n OnInit,\r\n} from '@angular/core';\r\n\r\nimport { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';\r\n\r\n@Component({\r\n selector: 'app-frontend-layout',\r\n templateUrl: 'frontend-layout.component.html',\r\n})\r\nexport class FrontendLayoutComponent implements OnInit, OnDestroy {\r\n version: string;\r\n\r\n constructor(private platformUtilsService: PlatformUtilsService) { }\r\n\r\n ngOnInit() {\r\n this.version = this.platformUtilsService.getApplicationVersion();\r\n document.body.classList.add('layout_frontend');\r\n }\r\n\r\n ngOnDestroy() {\r\n document.body.classList.remove('layout_frontend');\r\n }\r\n}\r\n","export abstract class SettingsService {\r\n clearCache: () => void;\r\n getEquivalentDomains: () => Promise;\r\n setEquivalentDomains: (equivalentDomains: string[][]) => Promise;\r\n clear: (userId: string) => Promise;\r\n}\r\n","export abstract class LockService {\r\n checkLock: () => Promise;\r\n lock: () => Promise;\r\n setLockOption: (lockOption: number) => Promise;\r\n}\r\n","import { Injectable } from '@angular/core';\r\nimport {\r\n CanActivate,\r\n Router,\r\n} from '@angular/router';\r\n\r\nimport { CryptoService } from 'jslib/abstractions/crypto.service';\r\nimport { UserService } from 'jslib/abstractions/user.service';\r\n\r\n@Injectable()\r\nexport class UnauthGuardService implements CanActivate {\r\n constructor(private cryptoService: CryptoService, private userService: UserService,\r\n private router: Router) { }\r\n\r\n async canActivate() {\r\n const isAuthed = await this.userService.isAuthenticated();\r\n if (isAuthed) {\r\n const hasKey = await this.cryptoService.hasKey();\r\n if (!hasKey) {\r\n this.router.navigate(['lock']);\r\n } else {\r\n this.router.navigate(['vault']);\r\n }\r\n return false;\r\n }\r\n\r\n return true;\r\n }\r\n}\r\n","import { Injectable } from '@angular/core';\r\nimport {\r\n ActivatedRouteSnapshot,\r\n CanActivate,\r\n Router,\r\n} from '@angular/router';\r\n\r\nimport { UserService } from 'jslib/abstractions/user.service';\r\n\r\nimport { OrganizationUserType } from 'jslib/enums/organizationUserType';\r\n\r\n@Injectable()\r\nexport class OrganizationTypeGuardService implements CanActivate {\r\n constructor(private userService: UserService, private router: Router) { }\r\n\r\n async canActivate(route: ActivatedRouteSnapshot) {\r\n const org = await this.userService.getOrganization(route.parent.params.organizationId);\r\n const allowedTypes = route.data == null ? null : route.data.allowedTypes as OrganizationUserType[];\r\n if (allowedTypes == null || allowedTypes.indexOf(org.type) === -1) {\r\n this.router.navigate(['/organizations', org.id]);\r\n return false;\r\n }\r\n\r\n return true;\r\n }\r\n}\r\n","import { Injectable } from '@angular/core';\r\nimport {\r\n ActivatedRouteSnapshot,\r\n CanActivate,\r\n Router,\r\n} from '@angular/router';\r\n\r\nimport { UserService } from 'jslib/abstractions/user.service';\r\n\r\n@Injectable()\r\nexport class OrganizationGuardService implements CanActivate {\r\n constructor(private userService: UserService, private router: Router) { }\r\n\r\n async canActivate(route: ActivatedRouteSnapshot) {\r\n const org = await this.userService.getOrganization(route.params.organizationId);\r\n if (org == null) {\r\n this.router.navigate(['/']);\r\n return false;\r\n }\r\n\r\n return true;\r\n }\r\n}\r\n","import { Injectable } from '@angular/core';\nimport {\n CanActivate,\n Router,\n} from '@angular/router';\n\nimport { CryptoService } from '../../abstractions/crypto.service';\nimport { MessagingService } from '../../abstractions/messaging.service';\nimport { UserService } from '../../abstractions/user.service';\n\n@Injectable()\nexport class AuthGuardService implements CanActivate {\n constructor(private cryptoService: CryptoService, private userService: UserService, private router: Router,\n private messagingService: MessagingService) { }\n\n async canActivate() {\n const isAuthed = await this.userService.isAuthenticated();\n if (!isAuthed) {\n this.messagingService.send('logout');\n return false;\n }\n\n const hasKey = await this.cryptoService.hasKey();\n if (!hasKey) {\n this.router.navigate(['lock']);\n return false;\n }\n\n return true;\n }\n}\n","import { StorageService } from '../abstractions/storage.service';\nimport { TokenService } from '../abstractions/token.service';\nimport { UserService as UserServiceAbstraction } from '../abstractions/user.service';\n\nimport { OrganizationData } from '../models/data/organizationData';\nimport { Organization } from '../models/domain/organization';\n\nconst Keys = {\n userId: 'userId',\n userEmail: 'userEmail',\n stamp: 'securityStamp',\n organizationsPrefix: 'organizations_',\n};\n\nexport class UserService implements UserServiceAbstraction {\n userId: string;\n email: string;\n stamp: string;\n\n constructor(private tokenService: TokenService, private storageService: StorageService) {\n }\n\n setUserIdAndEmail(userId: string, email: string): Promise {\n this.email = email;\n this.userId = userId;\n\n return Promise.all([\n this.storageService.save(Keys.userEmail, email),\n this.storageService.save(Keys.userId, userId),\n ]);\n }\n\n setSecurityStamp(stamp: string): Promise {\n this.stamp = stamp;\n return this.storageService.save(Keys.stamp, stamp);\n }\n\n async getUserId(): Promise {\n if (this.userId != null) {\n return this.userId;\n }\n\n this.userId = await this.storageService.get(Keys.userId);\n return this.userId;\n }\n\n async getEmail(): Promise {\n if (this.email != null) {\n return this.email;\n }\n\n this.email = await this.storageService.get(Keys.userEmail);\n return this.email;\n }\n\n async getSecurityStamp(): Promise {\n if (this.stamp != null) {\n return this.stamp;\n }\n\n this.stamp = await this.storageService.get(Keys.stamp);\n return this.stamp;\n }\n\n async clear(): Promise {\n const userId = await this.getUserId();\n\n await Promise.all([\n this.storageService.remove(Keys.userId),\n this.storageService.remove(Keys.userEmail),\n this.storageService.remove(Keys.stamp),\n this.clearOrganizations(userId),\n ]);\n\n this.userId = this.email = this.stamp = null;\n }\n\n async isAuthenticated(): Promise {\n const token = await this.tokenService.getToken();\n if (token == null) {\n return false;\n }\n\n const userId = await this.getUserId();\n return userId != null;\n }\n\n async getOrganization(id: string): Promise {\n const userId = await this.getUserId();\n const organizations = await this.storageService.get<{ [id: string]: OrganizationData; }>(\n Keys.organizationsPrefix + userId);\n if (organizations == null || !organizations.hasOwnProperty(id)) {\n return null;\n }\n\n return new Organization(organizations[id]);\n }\n\n async getAllOrganizations(): Promise {\n const userId = await this.getUserId();\n const organizations = await this.storageService.get<{ [id: string]: OrganizationData; }>(\n Keys.organizationsPrefix + userId);\n const response: Organization[] = [];\n for (const id in organizations) {\n if (organizations.hasOwnProperty(id)) {\n response.push(new Organization(organizations[id]));\n }\n }\n return response;\n }\n\n async replaceOrganizations(organizations: { [id: string]: OrganizationData; }): Promise {\n const userId = await this.getUserId();\n await this.storageService.save(Keys.organizationsPrefix + userId, organizations);\n }\n\n async clearOrganizations(userId: string): Promise {\n await this.storageService.remove(Keys.organizationsPrefix + userId);\n }\n}\n","import { ConstantsService } from './constants.service';\r\n\r\nimport { CryptoFunctionService } from '../abstractions/cryptoFunction.service';\r\nimport { StorageService } from '../abstractions/storage.service';\r\nimport { TotpService as TotpServiceAbstraction } from '../abstractions/totp.service';\r\n\r\nimport { Utils } from '../misc/utils';\r\n\r\nconst b32Chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567';\r\n\r\nexport class TotpService implements TotpServiceAbstraction {\r\n constructor(private storageService: StorageService, private cryptoFunctionService: CryptoFunctionService) {}\r\n\r\n async getCode(keyb32: string): Promise {\r\n const epoch = Math.round(new Date().getTime() / 1000.0);\r\n const timeHex = this.leftpad(this.dec2hex(Math.floor(epoch / 30)), 16, '0');\r\n const timeBytes = Utils.fromHexToArray(timeHex);\r\n const keyBytes = this.b32tobytes(keyb32);\r\n\r\n if (!keyBytes.length || !timeBytes.length) {\r\n return null;\r\n }\r\n\r\n const hashHex = await this.sign(keyBytes, timeBytes);\r\n if (!hashHex) {\r\n return null;\r\n }\r\n\r\n const offset = this.hex2dec(hashHex.substring(hashHex.length - 1));\r\n // tslint:disable-next-line\r\n let otp = (this.hex2dec(hashHex.substr(offset * 2, 8)) & this.hex2dec('7fffffff')) + '';\r\n otp = (otp).substr(otp.length - 6, 6);\r\n return otp;\r\n }\r\n\r\n async isAutoCopyEnabled(): Promise {\r\n return !(await this.storageService.get(ConstantsService.disableAutoTotpCopyKey));\r\n }\r\n\r\n // Helpers\r\n\r\n private leftpad(s: string, l: number, p: string): string {\r\n if (l + 1 >= s.length) {\r\n s = Array(l + 1 - s.length).join(p) + s;\r\n }\r\n return s;\r\n }\r\n\r\n private dec2hex(d: number): string {\r\n return (d < 15.5 ? '0' : '') + Math.round(d).toString(16);\r\n }\r\n\r\n private hex2dec(s: string): number {\r\n return parseInt(s, 16);\r\n }\r\n\r\n private b32tohex(s: string): string {\r\n s = s.toUpperCase();\r\n let cleanedInput = '';\r\n\r\n for (let i = 0; i < s.length; i++) {\r\n if (b32Chars.indexOf(s[i]) < 0) {\r\n continue;\r\n }\r\n\r\n cleanedInput += s[i];\r\n }\r\n s = cleanedInput;\r\n\r\n let bits = '';\r\n let hex = '';\r\n for (let i = 0; i < s.length; i++) {\r\n const byteIndex = b32Chars.indexOf(s.charAt(i));\r\n if (byteIndex < 0) {\r\n continue;\r\n }\r\n bits += this.leftpad(byteIndex.toString(2), 5, '0');\r\n }\r\n for (let i = 0; i + 4 <= bits.length; i += 4) {\r\n const chunk = bits.substr(i, 4);\r\n hex = hex + parseInt(chunk, 2).toString(16);\r\n }\r\n return hex;\r\n }\r\n\r\n private b32tobytes(s: string): Uint8Array {\r\n return Utils.fromHexToArray(this.b32tohex(s));\r\n }\r\n\r\n private async sign(keyBytes: Uint8Array, timeBytes: Uint8Array) {\r\n const signature = await this.cryptoFunctionService.hmac(timeBytes.buffer, keyBytes.buffer, 'sha1');\r\n return Utils.fromBufferToHex(signature);\r\n }\r\n}\r\n","import { ConstantsService } from './constants.service';\n\nimport { StorageService } from '../abstractions/storage.service';\nimport { TokenService as TokenServiceAbstraction } from '../abstractions/token.service';\n\nimport { Utils } from '../misc/utils';\n\nconst Keys = {\n accessToken: 'accessToken',\n refreshToken: 'refreshToken',\n twoFactorTokenPrefix: 'twoFactorToken_',\n};\n\nexport class TokenService implements TokenServiceAbstraction {\n token: string;\n decodedToken: any;\n refreshToken: string;\n\n constructor(private storageService: StorageService) {\n }\n\n setTokens(accessToken: string, refreshToken: string): Promise {\n return Promise.all([\n this.setToken(accessToken),\n this.setRefreshToken(refreshToken),\n ]);\n }\n\n setToken(token: string): Promise {\n this.token = token;\n this.decodedToken = null;\n return this.storageService.save(Keys.accessToken, token);\n }\n\n async getToken(): Promise {\n if (this.token != null) {\n return this.token;\n }\n\n this.token = await this.storageService.get(Keys.accessToken);\n return this.token;\n }\n\n setRefreshToken(refreshToken: string): Promise {\n this.refreshToken = refreshToken;\n return this.storageService.save(Keys.refreshToken, refreshToken);\n }\n\n async getRefreshToken(): Promise {\n if (this.refreshToken != null) {\n return this.refreshToken;\n }\n\n this.refreshToken = await this.storageService.get(Keys.refreshToken);\n return this.refreshToken;\n }\n\n setTwoFactorToken(token: string, email: string): Promise {\n return this.storageService.save(Keys.twoFactorTokenPrefix + email, token);\n }\n\n getTwoFactorToken(email: string): Promise {\n return this.storageService.get(Keys.twoFactorTokenPrefix + email);\n }\n\n clearTwoFactorToken(email: string): Promise {\n return this.storageService.remove(Keys.twoFactorTokenPrefix + email);\n }\n\n clearToken(): Promise {\n this.token = null;\n this.decodedToken = null;\n this.refreshToken = null;\n\n return Promise.all([\n this.storageService.remove(Keys.accessToken),\n this.storageService.remove(Keys.refreshToken),\n ]);\n }\n\n // jwthelper methods\n // ref https://github.com/auth0/angular-jwt/blob/master/src/angularJwt/services/jwt.js\n\n decodeToken(): any {\n if (this.decodedToken) {\n return this.decodedToken;\n }\n\n if (this.token == null) {\n throw new Error('Token not found.');\n }\n\n const parts = this.token.split('.');\n if (parts.length !== 3) {\n throw new Error('JWT must have 3 parts');\n }\n\n const decoded = Utils.fromUrlB64ToUtf8(parts[1]);\n if (decoded == null) {\n throw new Error('Cannot decode the token');\n }\n\n this.decodedToken = JSON.parse(decoded);\n return this.decodedToken;\n }\n\n getTokenExpirationDate(): Date {\n const decoded = this.decodeToken();\n if (typeof decoded.exp === 'undefined') {\n return null;\n }\n\n const d = new Date(0); // The 0 here is the key, which sets the date to the epoch\n d.setUTCSeconds(decoded.exp);\n return d;\n }\n\n tokenSecondsRemaining(offsetSeconds: number = 0): number {\n const d = this.getTokenExpirationDate();\n if (d == null) {\n return 0;\n }\n\n const msRemaining = d.valueOf() - (new Date().valueOf() + (offsetSeconds * 1000));\n return Math.round(msRemaining / 1000);\n }\n\n tokenNeedsRefresh(minutes: number = 5): boolean {\n const sRemaining = this.tokenSecondsRemaining();\n return sRemaining < (60 * minutes);\n }\n\n getUserId(): string {\n const decoded = this.decodeToken();\n if (typeof decoded.sub === 'undefined') {\n throw new Error('No user id found');\n }\n\n return decoded.sub as string;\n }\n\n getEmail(): string {\n const decoded = this.decodeToken();\n if (typeof decoded.email === 'undefined') {\n throw new Error('No email found');\n }\n\n return decoded.email as string;\n }\n\n getEmailVerified(): boolean {\n const decoded = this.decodeToken();\n if (typeof decoded.email_verified === 'undefined') {\n throw new Error('No email verification found');\n }\n\n return decoded.email_verified as boolean;\n }\n\n getName(): string {\n const decoded = this.decodeToken();\n if (typeof decoded.name === 'undefined') {\n return null;\n }\n\n return decoded.name as string;\n }\n\n getPremium(): boolean {\n const decoded = this.decodeToken();\n if (typeof decoded.premium === 'undefined') {\n return false;\n }\n\n return decoded.premium as boolean;\n }\n\n getIssuer(): string {\n const decoded = this.decodeToken();\n if (typeof decoded.iss === 'undefined') {\n throw new Error('No issuer found');\n }\n\n return decoded.iss as string;\n }\n}\n","import { ApiService } from '../abstractions/api.service';\nimport { CipherService } from '../abstractions/cipher.service';\nimport { CollectionService } from '../abstractions/collection.service';\nimport { CryptoService } from '../abstractions/crypto.service';\nimport { FolderService } from '../abstractions/folder.service';\nimport { MessagingService } from '../abstractions/messaging.service';\nimport { SettingsService } from '../abstractions/settings.service';\nimport { StorageService } from '../abstractions/storage.service';\nimport { SyncService as SyncServiceAbstraction } from '../abstractions/sync.service';\nimport { UserService } from '../abstractions/user.service';\n\nimport { CipherData } from '../models/data/cipherData';\nimport { CollectionData } from '../models/data/collectionData';\nimport { FolderData } from '../models/data/folderData';\nimport { OrganizationData } from '../models/data/organizationData';\n\nimport { CipherResponse } from '../models/response/cipherResponse';\nimport { CollectionDetailsResponse } from '../models/response/collectionResponse';\nimport { DomainsResponse } from '../models/response/domainsResponse';\nimport { FolderResponse } from '../models/response/folderResponse';\nimport { ProfileResponse } from '../models/response/profileResponse';\n\nconst Keys = {\n lastSyncPrefix: 'lastSync_',\n};\n\nexport class SyncService implements SyncServiceAbstraction {\n syncInProgress: boolean = false;\n\n constructor(private userService: UserService, private apiService: ApiService,\n private settingsService: SettingsService, private folderService: FolderService,\n private cipherService: CipherService, private cryptoService: CryptoService,\n private collectionService: CollectionService, private storageService: StorageService,\n private messagingService: MessagingService, private logoutCallback: (expired: boolean) => Promise) {\n }\n\n async getLastSync(): Promise {\n const userId = await this.userService.getUserId();\n if (userId == null) {\n return null;\n }\n\n const lastSync = await this.storageService.get(Keys.lastSyncPrefix + userId);\n if (lastSync) {\n return new Date(lastSync);\n }\n\n return null;\n }\n\n async setLastSync(date: Date): Promise {\n const userId = await this.userService.getUserId();\n if (userId == null) {\n return;\n }\n\n await this.storageService.save(Keys.lastSyncPrefix + userId, date.toJSON());\n }\n\n syncStarted() {\n this.syncInProgress = true;\n this.messagingService.send('syncStarted');\n }\n\n syncCompleted(successfully: boolean) {\n this.syncInProgress = false;\n this.messagingService.send('syncCompleted', { successfully: successfully });\n }\n\n async fullSync(forceSync: boolean): Promise {\n this.syncStarted();\n const isAuthenticated = await this.userService.isAuthenticated();\n if (!isAuthenticated) {\n this.syncCompleted(false);\n return false;\n }\n\n const now = new Date();\n const needsSyncResult = await this.needsSyncing(forceSync);\n const needsSync = needsSyncResult[0];\n const skipped = needsSyncResult[1];\n\n if (skipped) {\n this.syncCompleted(false);\n return false;\n }\n\n if (!needsSync) {\n await this.setLastSync(now);\n this.syncCompleted(false);\n return false;\n }\n\n const userId = await this.userService.getUserId();\n try {\n const response = await this.apiService.getSync();\n\n await this.syncProfile(response.profile);\n await this.syncFolders(userId, response.folders);\n await this.syncCollections(response.collections);\n await this.syncCiphers(userId, response.ciphers);\n await this.syncSettings(userId, response.domains);\n\n await this.setLastSync(now);\n this.syncCompleted(true);\n return true;\n } catch (e) {\n this.syncCompleted(false);\n return false;\n }\n }\n\n // Helpers\n\n private async needsSyncing(forceSync: boolean) {\n if (forceSync) {\n return [true, false];\n }\n\n try {\n const response = await this.apiService.getAccountRevisionDate();\n const accountRevisionDate = new Date(response);\n const lastSync = await this.getLastSync();\n if (lastSync != null && accountRevisionDate <= lastSync) {\n return [false, false];\n }\n\n return [true, false];\n } catch (e) {\n return [false, true];\n }\n }\n\n private async syncProfile(response: ProfileResponse) {\n const stamp = await this.userService.getSecurityStamp();\n if (stamp != null && stamp !== response.securityStamp) {\n if (this.logoutCallback != null) {\n await this.logoutCallback(true);\n }\n\n throw new Error('Stamp has changed');\n }\n\n await this.cryptoService.setEncKey(response.key);\n await this.cryptoService.setEncPrivateKey(response.privateKey);\n await this.cryptoService.setOrgKeys(response.organizations);\n await this.userService.setSecurityStamp(response.securityStamp);\n await this.userService.setSecurityStamp(response.securityStamp);\n\n const organizations: { [id: string]: OrganizationData; } = {};\n response.organizations.forEach((o) => {\n organizations[o.id] = new OrganizationData(o);\n });\n return await this.userService.replaceOrganizations(organizations);\n }\n\n private async syncFolders(userId: string, response: FolderResponse[]) {\n const folders: { [id: string]: FolderData; } = {};\n response.forEach((f) => {\n folders[f.id] = new FolderData(f, userId);\n });\n return await this.folderService.replace(folders);\n }\n\n private async syncCollections(response: CollectionDetailsResponse[]) {\n const collections: { [id: string]: CollectionData; } = {};\n response.forEach((c) => {\n collections[c.id] = new CollectionData(c);\n });\n return await this.collectionService.replace(collections);\n }\n\n private async syncCiphers(userId: string, response: CipherResponse[]) {\n const ciphers: { [id: string]: CipherData; } = {};\n response.forEach((c) => {\n ciphers[c.id] = new CipherData(c, userId);\n });\n return await this.cipherService.replace(ciphers);\n }\n\n private async syncSettings(userId: string, response: DomainsResponse) {\n let eqDomains: string[][] = [];\n if (response != null && response.equivalentDomains != null) {\n eqDomains = eqDomains.concat(response.equivalentDomains);\n }\n\n if (response != null && response.globalEquivalentDomains != null) {\n response.globalEquivalentDomains.forEach((global) => {\n if (global.domains.length > 0) {\n eqDomains.push(global.domains);\n }\n });\n }\n\n return this.settingsService.setEquivalentDomains(eqDomains);\n }\n}\n","import { StateService as StateServiceAbstraction } from '../abstractions/state.service';\r\n\r\nexport class StateService implements StateServiceAbstraction {\r\n private state: any = {};\r\n\r\n get(key: string): Promise {\r\n if (this.state.hasOwnProperty(key)) {\r\n return Promise.resolve(this.state[key]);\r\n }\r\n return Promise.resolve(null);\r\n }\r\n\r\n save(key: string, obj: any): Promise {\r\n this.state[key] = obj;\r\n return Promise.resolve();\r\n }\r\n\r\n remove(key: string): Promise {\r\n delete this.state[key];\r\n return Promise.resolve();\r\n }\r\n\r\n purge(): Promise {\r\n this.state = {};\r\n return Promise.resolve();\r\n }\r\n}\r\n","import { SettingsService as SettingsServiceAbstraction } from '../abstractions/settings.service';\r\nimport { StorageService } from '../abstractions/storage.service';\r\nimport { UserService } from '../abstractions/user.service';\r\n\r\nconst Keys = {\r\n settingsPrefix: 'settings_',\r\n equivalentDomains: 'equivalentDomains',\r\n};\r\n\r\nexport class SettingsService implements SettingsServiceAbstraction {\r\n private settingsCache: any;\r\n\r\n constructor(private userService: UserService, private storageService: StorageService) {\r\n }\r\n\r\n clearCache(): void {\r\n this.settingsCache = null;\r\n }\r\n\r\n getEquivalentDomains(): Promise {\r\n return this.getSettingsKey(Keys.equivalentDomains);\r\n }\r\n\r\n async setEquivalentDomains(equivalentDomains: string[][]): Promise {\r\n await this.setSettingsKey(Keys.equivalentDomains, equivalentDomains);\r\n }\r\n\r\n async clear(userId: string): Promise {\r\n await this.storageService.remove(Keys.settingsPrefix + userId);\r\n this.settingsCache = null;\r\n }\r\n\r\n // Helpers\r\n\r\n private async getSettings(): Promise {\r\n if (this.settingsCache == null) {\r\n const userId = await this.userService.getUserId();\r\n this.settingsCache = this.storageService.get(Keys.settingsPrefix + userId);\r\n }\r\n return this.settingsCache;\r\n }\r\n\r\n private async getSettingsKey(key: string): Promise {\r\n const settings = await this.getSettings();\r\n if (settings != null && settings[key]) {\r\n return settings[key];\r\n }\r\n return null;\r\n }\r\n\r\n private async setSettingsKey(key: string, value: any): Promise {\r\n const userId = await this.userService.getUserId();\r\n let settings = await this.getSettings();\r\n if (!settings) {\r\n settings = {};\r\n }\r\n\r\n settings[key] = value;\r\n await this.storageService.save(Keys.settingsPrefix + userId, settings);\r\n this.settingsCache = settings;\r\n }\r\n}\r\n","import { CipherString } from '../models/domain/cipherString';\nimport { PasswordHistory } from '../models/domain/passwordHistory';\n\nimport { CryptoService } from '../abstractions/crypto.service';\nimport {\n PasswordGenerationService as PasswordGenerationServiceAbstraction,\n} from '../abstractions/passwordGeneration.service';\nimport { StorageService } from '../abstractions/storage.service';\n\nconst DefaultOptions = {\n length: 14,\n ambiguous: false,\n number: true,\n minNumber: 1,\n uppercase: true,\n minUppercase: 0,\n lowercase: true,\n minLowercase: 0,\n special: false,\n minSpecial: 1,\n};\n\nconst Keys = {\n options: 'passwordGenerationOptions',\n history: 'generatedPasswordHistory',\n};\n\nconst MaxPasswordsInHistory = 100;\n\nexport class PasswordGenerationService implements PasswordGenerationServiceAbstraction {\n private optionsCache: any;\n private history: PasswordHistory[];\n\n constructor(private cryptoService: CryptoService, private storageService: StorageService) { }\n\n async generatePassword(options: any): Promise {\n // overload defaults with given options\n const o = Object.assign({}, DefaultOptions, options);\n\n // sanitize\n if (o.uppercase && o.minUppercase <= 0) {\n o.minUppercase = 1;\n }\n if (o.lowercase && o.minLowercase <= 0) {\n o.minLowercase = 1;\n }\n if (o.number && o.minNumber <= 0) {\n o.minNumber = 1;\n }\n if (o.special && o.minSpecial <= 0) {\n o.minSpecial = 1;\n }\n\n if (!o.length || o.length < 1) {\n o.length = 10;\n }\n\n const minLength: number = o.minUppercase + o.minLowercase + o.minNumber + o.minSpecial;\n if (o.length < minLength) {\n o.length = minLength;\n }\n\n const positions: string[] = [];\n if (o.lowercase && o.minLowercase > 0) {\n for (let i = 0; i < o.minLowercase; i++) {\n positions.push('l');\n }\n }\n if (o.uppercase && o.minUppercase > 0) {\n for (let i = 0; i < o.minUppercase; i++) {\n positions.push('u');\n }\n }\n if (o.number && o.minNumber > 0) {\n for (let i = 0; i < o.minNumber; i++) {\n positions.push('n');\n }\n }\n if (o.special && o.minSpecial > 0) {\n for (let i = 0; i < o.minSpecial; i++) {\n positions.push('s');\n }\n }\n while (positions.length < o.length) {\n positions.push('a');\n }\n\n // shuffle\n await this.shuffleArray(positions);\n\n // build out the char sets\n let allCharSet = '';\n\n let lowercaseCharSet = 'abcdefghijkmnopqrstuvwxyz';\n if (o.ambiguous) {\n lowercaseCharSet += 'l';\n }\n if (o.lowercase) {\n allCharSet += lowercaseCharSet;\n }\n\n let uppercaseCharSet = 'ABCDEFGHIJKLMNPQRSTUVWXYZ';\n if (o.ambiguous) {\n uppercaseCharSet += 'O';\n }\n if (o.uppercase) {\n allCharSet += uppercaseCharSet;\n }\n\n let numberCharSet = '23456789';\n if (o.ambiguous) {\n numberCharSet += '01';\n }\n if (o.number) {\n allCharSet += numberCharSet;\n }\n\n const specialCharSet = '!@#$%^&*';\n if (o.special) {\n allCharSet += specialCharSet;\n }\n\n let password = '';\n for (let i = 0; i < o.length; i++) {\n let positionChars: string;\n switch (positions[i]) {\n case 'l':\n positionChars = lowercaseCharSet;\n break;\n case 'u':\n positionChars = uppercaseCharSet;\n break;\n case 'n':\n positionChars = numberCharSet;\n break;\n case 's':\n positionChars = specialCharSet;\n break;\n case 'a':\n positionChars = allCharSet;\n break;\n default:\n break;\n }\n\n const randomCharIndex = await this.cryptoService.randomNumber(0, positionChars.length - 1);\n password += positionChars.charAt(randomCharIndex);\n }\n\n return password;\n }\n\n async getOptions() {\n if (this.optionsCache == null) {\n const options = await this.storageService.get(Keys.options);\n if (options == null) {\n this.optionsCache = DefaultOptions;\n } else {\n this.optionsCache = options;\n }\n }\n\n return this.optionsCache;\n }\n\n async saveOptions(options: any) {\n await this.storageService.save(Keys.options, options);\n this.optionsCache = options;\n }\n\n async getHistory(): Promise {\n const hasKey = await this.cryptoService.hasKey();\n if (!hasKey) {\n return new Array();\n }\n\n if (!this.history) {\n const encrypted = await this.storageService.get(Keys.history);\n this.history = await this.decryptHistory(encrypted);\n }\n\n return this.history || new Array();\n }\n\n async addHistory(password: string): Promise {\n // Cannot add new history if no key is available\n const hasKey = await this.cryptoService.hasKey();\n if (!hasKey) {\n return;\n }\n\n const currentHistory = await this.getHistory();\n\n // Prevent duplicates\n if (this.matchesPrevious(password, currentHistory)) {\n return;\n }\n\n currentHistory.unshift(new PasswordHistory(password, Date.now()));\n\n // Remove old items.\n if (currentHistory.length > MaxPasswordsInHistory) {\n currentHistory.pop();\n }\n\n const newHistory = await this.encryptHistory(currentHistory);\n return await this.storageService.save(Keys.history, newHistory);\n }\n\n async clear(): Promise {\n this.history = [];\n return await this.storageService.remove(Keys.history);\n }\n\n private async encryptHistory(history: PasswordHistory[]): Promise {\n if (history == null || history.length === 0) {\n return Promise.resolve([]);\n }\n\n const promises = history.map(async (item) => {\n const encrypted = await this.cryptoService.encrypt(item.password);\n return new PasswordHistory(encrypted.encryptedString, item.date);\n });\n\n return await Promise.all(promises);\n }\n\n private async decryptHistory(history: PasswordHistory[]): Promise {\n if (history == null || history.length === 0) {\n return Promise.resolve([]);\n }\n\n const promises = history.map(async (item) => {\n const decrypted = await this.cryptoService.decryptToUtf8(new CipherString(item.password));\n return new PasswordHistory(decrypted, item.date);\n });\n\n return await Promise.all(promises);\n }\n\n private matchesPrevious(password: string, history: PasswordHistory[]): boolean {\n if (history == null || history.length === 0) {\n return false;\n }\n\n return history[history.length - 1].password === password;\n }\n\n // ref: https://stackoverflow.com/a/12646864/1090359\n private async shuffleArray(array: string[]) {\n for (let i = array.length - 1; i > 0; i--) {\n const j = await this.cryptoService.randomNumber(0, i);\n [array[i], array[j]] = [array[j], array[i]];\n }\n }\n}\n","import { ConstantsService } from './constants.service';\n\nimport { CipherService } from '../abstractions/cipher.service';\nimport { CollectionService } from '../abstractions/collection.service';\nimport { CryptoService } from '../abstractions/crypto.service';\nimport { FolderService } from '../abstractions/folder.service';\nimport { LockService as LockServiceAbstraction } from '../abstractions/lock.service';\nimport { MessagingService } from '../abstractions/messaging.service';\nimport { PlatformUtilsService } from '../abstractions/platformUtils.service';\nimport { StorageService } from '../abstractions/storage.service';\n\nexport class LockService implements LockServiceAbstraction {\n private inited = false;\n\n constructor(private cipherService: CipherService, private folderService: FolderService,\n private collectionService: CollectionService, private cryptoService: CryptoService,\n private platformUtilsService: PlatformUtilsService, private storageService: StorageService,\n private messagingService: MessagingService, private lockedCallback: () => Promise) {\n }\n\n init(checkOnInterval: boolean) {\n if (this.inited) {\n return;\n }\n\n this.inited = true;\n if (checkOnInterval) {\n this.checkLock();\n setInterval(() => this.checkLock(), 10 * 1000); // check every 10 seconds\n }\n }\n\n async checkLock(): Promise {\n if (this.platformUtilsService.isViewOpen()) {\n // Do not lock\n return;\n }\n\n const hasKey = await this.cryptoService.hasKey();\n if (!hasKey) {\n // no key so no need to lock\n return;\n }\n\n let lockOption = this.platformUtilsService.lockTimeout();\n if (lockOption == null) {\n lockOption = await this.storageService.get(ConstantsService.lockOptionKey);\n }\n if (lockOption == null || lockOption < 0) {\n return;\n }\n\n const lastActive = await this.storageService.get(ConstantsService.lastActiveKey);\n if (lastActive == null) {\n return;\n }\n\n const lockOptionSeconds = lockOption * 60;\n const diffSeconds = ((new Date()).getTime() - lastActive) / 1000;\n if (diffSeconds >= lockOptionSeconds) {\n // need to lock now\n await this.lock();\n }\n }\n\n async lock(): Promise {\n await Promise.all([\n this.cryptoService.clearKey(),\n this.cryptoService.clearOrgKeys(true),\n this.cryptoService.clearKeyPair(true),\n this.cryptoService.clearEncKey(true),\n ]);\n\n this.folderService.clearCache();\n this.cipherService.clearCache();\n this.collectionService.clearCache();\n this.messagingService.send('locked');\n if (this.lockedCallback != null) {\n await this.lockedCallback();\n }\n }\n\n async setLockOption(lockOption: number): Promise {\n await this.storageService.save(ConstantsService.lockOptionKey, lockOption);\n await this.cryptoService.toggleKey();\n }\n}\n","import { I18nService as I18nServiceAbstraction } from '../abstractions/i18n.service';\n\nexport class I18nService implements I18nServiceAbstraction {\n locale: string;\n // First locale is the default (English)\n supportedTranslationLocales: string[] = ['en'];\n translationLocale: string;\n collator: Intl.Collator;\n\n protected inited: boolean;\n protected defaultMessages: any = {};\n protected localeMessages: any = {};\n\n constructor(protected systemLanguage: string, protected localesDirectory: string,\n protected getLocalesJson: (formattedLocale: string) => Promise) {\n this.systemLanguage = systemLanguage.replace('_', '-');\n }\n\n async init(locale?: string) {\n if (this.inited) {\n throw new Error('i18n already initialized.');\n }\n if (this.supportedTranslationLocales == null || this.supportedTranslationLocales.length === 0) {\n throw new Error('supportedTranslationLocales not set.');\n }\n\n this.inited = true;\n this.locale = this.translationLocale = locale != null ? locale : this.systemLanguage;\n\n try {\n this.collator = new Intl.Collator(this.locale, { numeric: true, sensitivity: 'base' });\n } catch {\n this.collator = null;\n }\n\n if (this.supportedTranslationLocales.indexOf(this.translationLocale) === -1) {\n this.translationLocale = this.translationLocale.slice(0, 2);\n\n if (this.supportedTranslationLocales.indexOf(this.translationLocale) === -1) {\n this.translationLocale = this.supportedTranslationLocales[0];\n }\n }\n\n if (this.localesDirectory != null) {\n await this.loadMessages(this.translationLocale, this.localeMessages);\n if (this.translationLocale !== this.supportedTranslationLocales[0]) {\n await this.loadMessages(this.supportedTranslationLocales[0], this.defaultMessages);\n }\n }\n }\n\n t(id: string, p1?: string, p2?: string, p3?: string): string {\n return this.translate(id, p1, p2, p3);\n }\n\n translate(id: string, p1?: string, p2?: string, p3?: string): string {\n let result: string;\n if (this.localeMessages.hasOwnProperty(id) && this.localeMessages[id]) {\n result = this.localeMessages[id];\n } else if (this.defaultMessages.hasOwnProperty(id) && this.defaultMessages[id]) {\n result = this.defaultMessages[id];\n } else {\n result = '';\n }\n\n if (result !== '') {\n if (p1 != null) {\n result = result.split('__$1__').join(p1);\n }\n if (p2 != null) {\n result = result.split('__$2__').join(p2);\n }\n if (p3 != null) {\n result = result.split('__$3__').join(p3);\n }\n }\n\n return result;\n }\n\n private async loadMessages(locale: string, messagesObj: any): Promise {\n const formattedLocale = locale.replace('-', '_');\n const locales = await this.getLocalesJson(formattedLocale);\n for (const prop in locales) {\n if (!locales.hasOwnProperty(prop)) {\n continue;\n }\n messagesObj[prop] = locales[prop].message;\n\n if (locales[prop].placeholders) {\n for (const placeProp in locales[prop].placeholders) {\n if (!locales[prop].placeholders.hasOwnProperty(placeProp) ||\n !locales[prop].placeholders[placeProp].content) {\n continue;\n }\n\n const replaceToken = '\\\\$' + placeProp.toUpperCase() + '\\\\$';\n let replaceContent = locales[prop].placeholders[placeProp].content;\n if (replaceContent === '$1' || replaceContent === '$2' || replaceContent === '$3') {\n replaceContent = '__' + replaceContent + '__';\n }\n messagesObj[prop] = messagesObj[prop].replace(new RegExp(replaceToken, 'g'), replaceContent);\n }\n }\n }\n }\n\n}\n","import { FolderResponse } from '../response/folderResponse';\r\n\r\nexport class FolderData {\r\n id: string;\r\n userId: string;\r\n name: string;\r\n revisionDate: string;\r\n\r\n constructor(response: FolderResponse, userId: string) {\r\n this.userId = userId;\r\n this.name = response.name;\r\n this.id = response.id;\r\n this.revisionDate = response.revisionDate;\r\n }\r\n}\r\n","import { FolderData } from '../models/data/folderData';\r\n\r\nimport { Folder } from '../models/domain/folder';\r\nimport { SymmetricCryptoKey } from '../models/domain/symmetricCryptoKey';\r\n\r\nimport { FolderRequest } from '../models/request/folderRequest';\r\n\r\nimport { FolderResponse } from '../models/response/folderResponse';\r\n\r\nimport { FolderView } from '../models/view/folderView';\r\n\r\nimport { ApiService } from '../abstractions/api.service';\r\nimport { CipherService } from '../abstractions/cipher.service';\r\nimport { CryptoService } from '../abstractions/crypto.service';\r\nimport { FolderService as FolderServiceAbstraction } from '../abstractions/folder.service';\r\nimport { I18nService } from '../abstractions/i18n.service';\r\nimport { StorageService } from '../abstractions/storage.service';\r\nimport { UserService } from '../abstractions/user.service';\r\nimport { CipherData } from '../models/data/cipherData';\r\n\r\nimport { Utils } from '../misc/utils';\r\n\r\nconst Keys = {\r\n foldersPrefix: 'folders_',\r\n ciphersPrefix: 'ciphers_',\r\n};\r\n\r\nexport class FolderService implements FolderServiceAbstraction {\r\n decryptedFolderCache: FolderView[];\r\n\r\n constructor(private cryptoService: CryptoService, private userService: UserService,\r\n private apiService: ApiService, private storageService: StorageService,\r\n private i18nService: I18nService, private cipherService: CipherService) { }\r\n\r\n clearCache(): void {\r\n this.decryptedFolderCache = null;\r\n }\r\n\r\n async encrypt(model: FolderView, key?: SymmetricCryptoKey): Promise {\r\n const folder = new Folder();\r\n folder.id = model.id;\r\n folder.name = await this.cryptoService.encrypt(model.name, key);\r\n return folder;\r\n }\r\n\r\n async get(id: string): Promise {\r\n const userId = await this.userService.getUserId();\r\n const folders = await this.storageService.get<{ [id: string]: FolderData; }>(\r\n Keys.foldersPrefix + userId);\r\n if (folders == null || !folders.hasOwnProperty(id)) {\r\n return null;\r\n }\r\n\r\n return new Folder(folders[id]);\r\n }\r\n\r\n async getAll(): Promise {\r\n const userId = await this.userService.getUserId();\r\n const folders = await this.storageService.get<{ [id: string]: FolderData; }>(\r\n Keys.foldersPrefix + userId);\r\n const response: Folder[] = [];\r\n for (const id in folders) {\r\n if (folders.hasOwnProperty(id)) {\r\n response.push(new Folder(folders[id]));\r\n }\r\n }\r\n return response;\r\n }\r\n\r\n async getAllDecrypted(): Promise {\r\n if (this.decryptedFolderCache != null) {\r\n return this.decryptedFolderCache;\r\n }\r\n\r\n const hasKey = await this.cryptoService.hasKey();\r\n if (!hasKey) {\r\n throw new Error('No key.');\r\n }\r\n\r\n const decFolders: FolderView[] = [];\r\n const promises: Array> = [];\r\n const folders = await this.getAll();\r\n folders.forEach((folder) => {\r\n promises.push(folder.decrypt().then((f) => decFolders.push(f)));\r\n });\r\n\r\n await Promise.all(promises);\r\n decFolders.sort(Utils.getSortFunction(this.i18nService, 'name'));\r\n\r\n const noneFolder = new FolderView();\r\n noneFolder.name = this.i18nService.t('noneFolder');\r\n decFolders.push(noneFolder);\r\n\r\n this.decryptedFolderCache = decFolders;\r\n return this.decryptedFolderCache;\r\n }\r\n\r\n async saveWithServer(folder: Folder): Promise {\r\n const request = new FolderRequest(folder);\r\n\r\n let response: FolderResponse;\r\n if (folder.id == null) {\r\n response = await this.apiService.postFolder(request);\r\n folder.id = response.id;\r\n } else {\r\n response = await this.apiService.putFolder(folder.id, request);\r\n }\r\n\r\n const userId = await this.userService.getUserId();\r\n const data = new FolderData(response, userId);\r\n await this.upsert(data);\r\n }\r\n\r\n async upsert(folder: FolderData | FolderData[]): Promise {\r\n const userId = await this.userService.getUserId();\r\n let folders = await this.storageService.get<{ [id: string]: FolderData; }>(\r\n Keys.foldersPrefix + userId);\r\n if (folders == null) {\r\n folders = {};\r\n }\r\n\r\n if (folder instanceof FolderData) {\r\n const f = folder as FolderData;\r\n folders[f.id] = f;\r\n } else {\r\n (folder as FolderData[]).forEach((f) => {\r\n folders[f.id] = f;\r\n });\r\n }\r\n\r\n await this.storageService.save(Keys.foldersPrefix + userId, folders);\r\n this.decryptedFolderCache = null;\r\n }\r\n\r\n async replace(folders: { [id: string]: FolderData; }): Promise {\r\n const userId = await this.userService.getUserId();\r\n await this.storageService.save(Keys.foldersPrefix + userId, folders);\r\n this.decryptedFolderCache = null;\r\n }\r\n\r\n async clear(userId: string): Promise {\r\n await this.storageService.remove(Keys.foldersPrefix + userId);\r\n this.decryptedFolderCache = null;\r\n }\r\n\r\n async delete(id: string | string[]): Promise {\r\n const userId = await this.userService.getUserId();\r\n const folders = await this.storageService.get<{ [id: string]: FolderData; }>(\r\n Keys.foldersPrefix + userId);\r\n if (folders == null) {\r\n return;\r\n }\r\n\r\n if (typeof id === 'string') {\r\n const i = id as string;\r\n delete folders[id];\r\n } else {\r\n (id as string[]).forEach((i) => {\r\n delete folders[i];\r\n });\r\n }\r\n\r\n await this.storageService.save(Keys.foldersPrefix + userId, folders);\r\n this.decryptedFolderCache = null;\r\n\r\n // Items in a deleted folder are re-assigned to \"No Folder\"\r\n const ciphers = await this.storageService.get<{ [id: string]: CipherData; }>(Keys.ciphersPrefix + userId);\r\n if (ciphers != null) {\r\n const updates: CipherData[] = [];\r\n for (const cId in ciphers) {\r\n if (ciphers[cId].folderId === id) {\r\n ciphers[cId].folderId = null;\r\n updates.push(ciphers[cId]);\r\n }\r\n }\r\n if (updates.length > 0) {\r\n this.cipherService.upsert(updates);\r\n }\r\n }\r\n }\r\n\r\n async deleteWithServer(id: string): Promise {\r\n await this.apiService.deleteFolder(id);\r\n await this.delete(id);\r\n }\r\n}\r\n","import { EnvironmentUrls } from '../models/domain/environmentUrls';\n\nimport { ConstantsService } from './constants.service';\n\nimport { ApiService } from '../abstractions/api.service';\nimport { EnvironmentService as EnvironmentServiceAbstraction } from '../abstractions/environment.service';\nimport { StorageService } from '../abstractions/storage.service';\n\nexport class EnvironmentService implements EnvironmentServiceAbstraction {\n baseUrl: string;\n webVaultUrl: string;\n apiUrl: string;\n identityUrl: string;\n iconsUrl: string;\n\n constructor(private apiService: ApiService, private storageService: StorageService) {}\n\n getWebVaultUrl(): string {\n if (this.webVaultUrl != null) {\n return this.webVaultUrl;\n } else if (this.baseUrl) {\n return this.baseUrl;\n }\n return null;\n }\n\n async setUrlsFromStorage(): Promise {\n const urlsObj: any = await this.storageService.get(ConstantsService.environmentUrlsKey);\n const urls = urlsObj || {\n base: null,\n api: null,\n identity: null,\n icons: null,\n webVault: null,\n };\n\n const envUrls = new EnvironmentUrls();\n\n if (urls.base) {\n this.baseUrl = envUrls.base = urls.base;\n await this.apiService.setUrls(envUrls);\n return;\n }\n\n this.webVaultUrl = urls.webVault;\n this.apiUrl = envUrls.api = urls.api;\n this.identityUrl = envUrls.identity = urls.identity;\n this.iconsUrl = urls.icons;\n await this.apiService.setUrls(envUrls);\n }\n\n async setUrls(urls: any): Promise {\n urls.base = this.formatUrl(urls.base);\n urls.webVault = this.formatUrl(urls.webVault);\n urls.api = this.formatUrl(urls.api);\n urls.identity = this.formatUrl(urls.identity);\n urls.icons = this.formatUrl(urls.icons);\n\n await this.storageService.save(ConstantsService.environmentUrlsKey, {\n base: urls.base,\n api: urls.api,\n identity: urls.identity,\n webVault: urls.webVault,\n icons: urls.icons,\n });\n\n this.baseUrl = urls.base;\n this.webVaultUrl = urls.webVault;\n this.apiUrl = urls.api;\n this.identityUrl = urls.identity;\n this.iconsUrl = urls.icons;\n\n const envUrls = new EnvironmentUrls();\n if (this.baseUrl) {\n envUrls.base = this.baseUrl;\n } else {\n envUrls.api = this.apiUrl;\n envUrls.identity = this.identityUrl;\n }\n\n await this.apiService.setUrls(envUrls);\n return urls;\n }\n\n private formatUrl(url: string): string {\n if (url == null || url === '') {\n return null;\n }\n\n url = url.replace(/\\/+$/g, '');\n if (!url.startsWith('http://') && !url.startsWith('https://')) {\n url = 'https://' + url;\n }\n\n return url;\n }\n}\n","import { EncryptionType } from '../enums/encryptionType';\r\n\r\nimport { CipherString } from '../models/domain/cipherString';\r\nimport { EncryptedObject } from '../models/domain/encryptedObject';\r\nimport { SymmetricCryptoKey } from '../models/domain/symmetricCryptoKey';\r\nimport { ProfileOrganizationResponse } from '../models/response/profileOrganizationResponse';\r\n\r\nimport { CryptoService as CryptoServiceAbstraction } from '../abstractions/crypto.service';\r\nimport { CryptoFunctionService } from '../abstractions/cryptoFunction.service';\r\nimport { StorageService } from '../abstractions/storage.service';\r\n\r\nimport { ConstantsService } from './constants.service';\r\n\r\nimport { sequentialize } from '../misc/sequentialize';\r\nimport { Utils } from '../misc/utils';\r\n\r\nconst Keys = {\r\n key: 'key',\r\n encOrgKeys: 'encOrgKeys',\r\n encPrivateKey: 'encPrivateKey',\r\n encKey: 'encKey',\r\n keyHash: 'keyHash',\r\n};\r\n\r\nexport class CryptoService implements CryptoServiceAbstraction {\r\n private key: SymmetricCryptoKey;\r\n private encKey: SymmetricCryptoKey;\r\n private legacyEtmKey: SymmetricCryptoKey;\r\n private keyHash: string;\r\n private publicKey: ArrayBuffer;\r\n private privateKey: ArrayBuffer;\r\n private orgKeys: Map;\r\n\r\n constructor(private storageService: StorageService, private secureStorageService: StorageService,\r\n private cryptoFunctionService: CryptoFunctionService) { }\r\n\r\n async setKey(key: SymmetricCryptoKey): Promise {\r\n this.key = key;\r\n\r\n const option = await this.storageService.get(ConstantsService.lockOptionKey);\r\n if (option != null) {\r\n // if we have a lock option set, we do not store the key\r\n return;\r\n }\r\n\r\n return this.secureStorageService.save(Keys.key, key.keyB64);\r\n }\r\n\r\n setKeyHash(keyHash: string): Promise<{}> {\r\n this.keyHash = keyHash;\r\n return this.storageService.save(Keys.keyHash, keyHash);\r\n }\r\n\r\n async setEncKey(encKey: string): Promise<{}> {\r\n if (encKey == null) {\r\n return;\r\n }\r\n\r\n await this.storageService.save(Keys.encKey, encKey);\r\n this.encKey = null;\r\n }\r\n\r\n async setEncPrivateKey(encPrivateKey: string): Promise<{}> {\r\n if (encPrivateKey == null) {\r\n return;\r\n }\r\n\r\n await this.storageService.save(Keys.encPrivateKey, encPrivateKey);\r\n this.privateKey = null;\r\n }\r\n\r\n setOrgKeys(orgs: ProfileOrganizationResponse[]): Promise<{}> {\r\n const orgKeys: any = {};\r\n orgs.forEach((org) => {\r\n orgKeys[org.id] = org.key;\r\n });\r\n\r\n return this.storageService.save(Keys.encOrgKeys, orgKeys);\r\n }\r\n\r\n async getKey(): Promise {\r\n if (this.key != null) {\r\n return this.key;\r\n }\r\n\r\n const option = await this.storageService.get(ConstantsService.lockOptionKey);\r\n if (option != null) {\r\n return null;\r\n }\r\n\r\n const key = await this.secureStorageService.get(Keys.key);\r\n if (key != null) {\r\n this.key = new SymmetricCryptoKey(Utils.fromB64ToArray(key).buffer);\r\n }\r\n\r\n return key == null ? null : this.key;\r\n }\r\n\r\n getKeyHash(): Promise {\r\n if (this.keyHash != null) {\r\n return Promise.resolve(this.keyHash);\r\n }\r\n\r\n return this.storageService.get(Keys.keyHash);\r\n }\r\n\r\n @sequentialize(() => 'getEncKey')\r\n async getEncKey(): Promise {\r\n if (this.encKey != null) {\r\n return this.encKey;\r\n }\r\n\r\n const encKey = await this.storageService.get(Keys.encKey);\r\n if (encKey == null) {\r\n return null;\r\n }\r\n\r\n const key = await this.getKey();\r\n if (key == null) {\r\n return null;\r\n }\r\n\r\n let decEncKey: ArrayBuffer;\r\n const encKeyCipher = new CipherString(encKey);\r\n if (encKeyCipher.encryptionType === EncryptionType.AesCbc256_B64) {\r\n decEncKey = await this.decrypt(encKeyCipher, key);\r\n } else if (encKeyCipher.encryptionType === EncryptionType.AesCbc256_HmacSha256_B64) {\r\n const newKey = await this.stretchKey(key);\r\n decEncKey = await this.decrypt(encKeyCipher, newKey);\r\n } else {\r\n throw new Error('Unsupported encKey type.');\r\n }\r\n\r\n if (decEncKey == null) {\r\n return null;\r\n }\r\n this.encKey = new SymmetricCryptoKey(decEncKey);\r\n return this.encKey;\r\n }\r\n\r\n async getPublicKey(): Promise {\r\n if (this.publicKey != null) {\r\n return this.publicKey;\r\n }\r\n\r\n const privateKey = await this.getPrivateKey();\r\n if (privateKey == null) {\r\n return null;\r\n }\r\n\r\n this.publicKey = await this.cryptoFunctionService.rsaExtractPublicKey(privateKey);\r\n return this.publicKey;\r\n }\r\n\r\n async getPrivateKey(): Promise {\r\n if (this.privateKey != null) {\r\n return this.privateKey;\r\n }\r\n\r\n const encPrivateKey = await this.storageService.get(Keys.encPrivateKey);\r\n if (encPrivateKey == null) {\r\n return null;\r\n }\r\n\r\n this.privateKey = await this.decrypt(new CipherString(encPrivateKey), null);\r\n return this.privateKey;\r\n }\r\n\r\n @sequentialize(() => 'getOrgKeys')\r\n async getOrgKeys(): Promise> {\r\n if (this.orgKeys != null && this.orgKeys.size > 0) {\r\n return this.orgKeys;\r\n }\r\n\r\n const encOrgKeys = await this.storageService.get(Keys.encOrgKeys);\r\n if (encOrgKeys == null) {\r\n return null;\r\n }\r\n\r\n const orgKeys: Map = new Map();\r\n let setKey = false;\r\n\r\n for (const orgId in encOrgKeys) {\r\n if (!encOrgKeys.hasOwnProperty(orgId)) {\r\n continue;\r\n }\r\n\r\n const decValue = await this.rsaDecrypt(encOrgKeys[orgId]);\r\n orgKeys.set(orgId, new SymmetricCryptoKey(decValue));\r\n setKey = true;\r\n }\r\n\r\n if (setKey) {\r\n this.orgKeys = orgKeys;\r\n }\r\n\r\n return this.orgKeys;\r\n }\r\n\r\n async getOrgKey(orgId: string): Promise {\r\n if (orgId == null) {\r\n return null;\r\n }\r\n\r\n const orgKeys = await this.getOrgKeys();\r\n if (orgKeys == null || !orgKeys.has(orgId)) {\r\n return null;\r\n }\r\n\r\n return orgKeys.get(orgId);\r\n }\r\n\r\n async hasKey(): Promise {\r\n return (await this.getKey()) != null;\r\n }\r\n\r\n async hasEncKey(): Promise {\r\n const encKey = await this.storageService.get(Keys.encKey);\r\n return encKey != null;\r\n }\r\n\r\n clearKey(): Promise {\r\n this.key = this.legacyEtmKey = null;\r\n return this.secureStorageService.remove(Keys.key);\r\n }\r\n\r\n clearKeyHash(): Promise {\r\n this.keyHash = null;\r\n return this.storageService.remove(Keys.keyHash);\r\n }\r\n\r\n clearEncKey(memoryOnly?: boolean): Promise {\r\n this.encKey = null;\r\n if (memoryOnly) {\r\n return Promise.resolve();\r\n }\r\n return this.storageService.remove(Keys.encKey);\r\n }\r\n\r\n clearKeyPair(memoryOnly?: boolean): Promise {\r\n this.privateKey = null;\r\n this.publicKey = null;\r\n if (memoryOnly) {\r\n return Promise.resolve();\r\n }\r\n return this.storageService.remove(Keys.encPrivateKey);\r\n }\r\n\r\n clearOrgKeys(memoryOnly?: boolean): Promise {\r\n this.orgKeys = null;\r\n if (memoryOnly) {\r\n return Promise.resolve();\r\n }\r\n return this.storageService.remove(Keys.encOrgKeys);\r\n }\r\n\r\n clearKeys(): Promise {\r\n return Promise.all([\r\n this.clearKey(),\r\n this.clearKeyHash(),\r\n this.clearOrgKeys(),\r\n this.clearEncKey(),\r\n this.clearKeyPair(),\r\n ]);\r\n }\r\n\r\n async toggleKey(): Promise {\r\n const key = await this.getKey();\r\n const option = await this.storageService.get(ConstantsService.lockOptionKey);\r\n if (option != null || option === 0) {\r\n // if we have a lock option set, clear the key\r\n await this.clearKey();\r\n this.key = key;\r\n return;\r\n }\r\n\r\n await this.setKey(key);\r\n }\r\n\r\n async makeKey(password: string, salt: string): Promise {\r\n const key = await this.cryptoFunctionService.pbkdf2(password, salt, 'sha256', 5000);\r\n return new SymmetricCryptoKey(key);\r\n }\r\n\r\n async makeShareKey(): Promise<[CipherString, SymmetricCryptoKey]> {\r\n const shareKey = await this.cryptoFunctionService.randomBytes(64);\r\n const publicKey = await this.getPublicKey();\r\n const encKey = await this.getEncKey();\r\n const encShareKey = await this.rsaEncrypt(shareKey, publicKey, encKey);\r\n return [encShareKey, new SymmetricCryptoKey(shareKey)];\r\n }\r\n\r\n async makeKeyPair(key?: SymmetricCryptoKey): Promise<[string, CipherString]> {\r\n const keyPair = await this.cryptoFunctionService.rsaGenerateKeyPair(2048);\r\n const publicB64 = Utils.fromBufferToB64(keyPair[0]);\r\n const privateEnc = await this.encrypt(keyPair[1], key);\r\n return [publicB64, privateEnc];\r\n }\r\n\r\n async hashPassword(password: string, key: SymmetricCryptoKey): Promise {\r\n if (key == null) {\r\n key = await this.getKey();\r\n }\r\n if (password == null || key == null) {\r\n throw new Error('Invalid parameters.');\r\n }\r\n\r\n const hash = await this.cryptoFunctionService.pbkdf2(key.key, password, 'sha256', 1);\r\n return Utils.fromBufferToB64(hash);\r\n }\r\n\r\n async makeEncKey(key: SymmetricCryptoKey): Promise<[SymmetricCryptoKey, CipherString]> {\r\n const encKey = await this.cryptoFunctionService.randomBytes(64);\r\n let encKeyEnc: CipherString = null;\r\n // TODO: Uncomment when we're ready to enable key stretching\r\n encKeyEnc = await this.encrypt(encKey, key);\r\n /*\r\n if (key.key.byteLength === 32) {\r\n const newKey = await this.stretchKey(key);\r\n encKeyEnc = await this.encrypt(encKey, newKey);\r\n } else if (key.key.byteLength === 64) {\r\n encKeyEnc = await this.encrypt(encKey, key);\r\n } else {\r\n throw new Error('Invalid key size.');\r\n }\r\n */\r\n return [new SymmetricCryptoKey(encKey), encKeyEnc];\r\n }\r\n\r\n async encrypt(plainValue: string | ArrayBuffer, key?: SymmetricCryptoKey): Promise {\r\n if (plainValue == null) {\r\n return Promise.resolve(null);\r\n }\r\n\r\n let plainBuf: ArrayBuffer;\r\n if (typeof (plainValue) === 'string') {\r\n plainBuf = Utils.fromUtf8ToArray(plainValue).buffer;\r\n } else {\r\n plainBuf = plainValue;\r\n }\r\n\r\n const encObj = await this.aesEncrypt(plainBuf, key);\r\n const iv = Utils.fromBufferToB64(encObj.iv);\r\n const data = Utils.fromBufferToB64(encObj.data);\r\n const mac = encObj.mac != null ? Utils.fromBufferToB64(encObj.mac) : null;\r\n return new CipherString(encObj.key.encType, iv, data, mac);\r\n }\r\n\r\n async encryptToBytes(plainValue: ArrayBuffer, key?: SymmetricCryptoKey): Promise {\r\n const encValue = await this.aesEncrypt(plainValue, key);\r\n let macLen = 0;\r\n if (encValue.mac != null) {\r\n macLen = encValue.mac.byteLength;\r\n }\r\n\r\n const encBytes = new Uint8Array(1 + encValue.iv.byteLength + macLen + encValue.data.byteLength);\r\n encBytes.set([encValue.key.encType]);\r\n encBytes.set(new Uint8Array(encValue.iv), 1);\r\n if (encValue.mac != null) {\r\n encBytes.set(new Uint8Array(encValue.mac), 1 + encValue.iv.byteLength);\r\n }\r\n\r\n encBytes.set(new Uint8Array(encValue.data), 1 + encValue.iv.byteLength + macLen);\r\n return encBytes.buffer;\r\n }\r\n\r\n async rsaEncrypt(data: ArrayBuffer, publicKey?: ArrayBuffer, key?: SymmetricCryptoKey): Promise {\r\n if (publicKey == null) {\r\n publicKey = await this.getPublicKey();\r\n }\r\n if (publicKey == null) {\r\n throw new Error('Public key unavailable.');\r\n }\r\n\r\n let type = EncryptionType.Rsa2048_OaepSha1_B64;\r\n const encBytes = await this.cryptoFunctionService.rsaEncrypt(data, publicKey, 'sha1');\r\n let mac: string = null;\r\n if (key != null && key.macKey != null) {\r\n type = EncryptionType.Rsa2048_OaepSha1_HmacSha256_B64;\r\n const macBytes = await this.cryptoFunctionService.hmac(encBytes, key.macKey, 'sha256');\r\n mac = Utils.fromBufferToB64(macBytes);\r\n }\r\n return new CipherString(type, Utils.fromBufferToB64(encBytes), null, mac);\r\n }\r\n\r\n async decrypt(cipherString: CipherString, key?: SymmetricCryptoKey): Promise {\r\n const iv = Utils.fromB64ToArray(cipherString.iv).buffer;\r\n const data = Utils.fromB64ToArray(cipherString.data).buffer;\r\n const mac = cipherString.mac ? Utils.fromB64ToArray(cipherString.mac).buffer : null;\r\n const decipher = await this.aesDecryptToBytes(cipherString.encryptionType, data, iv, mac, key);\r\n if (decipher == null) {\r\n return null;\r\n }\r\n\r\n return decipher;\r\n }\r\n\r\n async decryptToUtf8(cipherString: CipherString, key?: SymmetricCryptoKey): Promise {\r\n return await this.aesDecryptToUtf8(cipherString.encryptionType, cipherString.data,\r\n cipherString.iv, cipherString.mac, key);\r\n }\r\n\r\n async decryptFromBytes(encBuf: ArrayBuffer, key: SymmetricCryptoKey): Promise {\r\n if (encBuf == null) {\r\n throw new Error('no encBuf.');\r\n }\r\n\r\n const encBytes = new Uint8Array(encBuf);\r\n const encType = encBytes[0];\r\n let ctBytes: Uint8Array = null;\r\n let ivBytes: Uint8Array = null;\r\n let macBytes: Uint8Array = null;\r\n\r\n switch (encType) {\r\n case EncryptionType.AesCbc128_HmacSha256_B64:\r\n case EncryptionType.AesCbc256_HmacSha256_B64:\r\n if (encBytes.length <= 49) { // 1 + 16 + 32 + ctLength\r\n return null;\r\n }\r\n\r\n ivBytes = encBytes.slice(1, 17);\r\n macBytes = encBytes.slice(17, 49);\r\n ctBytes = encBytes.slice(49);\r\n break;\r\n case EncryptionType.AesCbc256_B64:\r\n if (encBytes.length <= 17) { // 1 + 16 + ctLength\r\n return null;\r\n }\r\n\r\n ivBytes = encBytes.slice(1, 17);\r\n ctBytes = encBytes.slice(17);\r\n break;\r\n default:\r\n return null;\r\n }\r\n\r\n return await this.aesDecryptToBytes(encType, ctBytes.buffer, ivBytes.buffer,\r\n macBytes != null ? macBytes.buffer : null, key);\r\n }\r\n\r\n // EFForg/OpenWireless\r\n // ref https://github.com/EFForg/OpenWireless/blob/master/app/js/diceware.js\r\n async randomNumber(min: number, max: number): Promise {\r\n let rval = 0;\r\n const range = max - min + 1;\r\n const bitsNeeded = Math.ceil(Math.log2(range));\r\n if (bitsNeeded > 53) {\r\n throw new Error('We cannot generate numbers larger than 53 bits.');\r\n }\r\n\r\n const bytesNeeded = Math.ceil(bitsNeeded / 8);\r\n const mask = Math.pow(2, bitsNeeded) - 1;\r\n // 7776 -> (2^13 = 8192) -1 == 8191 or 0x00001111 11111111\r\n\r\n // Fill a byte array with N random numbers\r\n const byteArray = new Uint8Array(await this.cryptoFunctionService.randomBytes(bytesNeeded));\r\n\r\n let p = (bytesNeeded - 1) * 8;\r\n for (let i = 0; i < bytesNeeded; i++) {\r\n rval += byteArray[i] * Math.pow(2, p);\r\n p -= 8;\r\n }\r\n\r\n // Use & to apply the mask and reduce the number of recursive lookups\r\n // tslint:disable-next-line\r\n rval = rval & mask;\r\n\r\n if (rval >= range) {\r\n // Integer out of acceptable range\r\n return this.randomNumber(min, max);\r\n }\r\n\r\n // Return an integer that falls within the range\r\n return min + rval;\r\n }\r\n\r\n // Helpers\r\n\r\n private async aesEncrypt(data: ArrayBuffer, key: SymmetricCryptoKey): Promise {\r\n const obj = new EncryptedObject();\r\n obj.key = await this.getKeyForEncryption(key);\r\n obj.iv = await this.cryptoFunctionService.randomBytes(16);\r\n obj.data = await this.cryptoFunctionService.aesEncrypt(data, obj.iv, obj.key.encKey);\r\n\r\n if (obj.key.macKey != null) {\r\n const macData = new Uint8Array(obj.iv.byteLength + obj.data.byteLength);\r\n macData.set(new Uint8Array(obj.iv), 0);\r\n macData.set(new Uint8Array(obj.data), obj.iv.byteLength);\r\n obj.mac = await this.cryptoFunctionService.hmac(macData.buffer, obj.key.macKey, 'sha256');\r\n }\r\n\r\n return obj;\r\n }\r\n\r\n private async aesDecryptToUtf8(encType: EncryptionType, data: string, iv: string, mac: string,\r\n key: SymmetricCryptoKey): Promise {\r\n const keyForEnc = await this.getKeyForEncryption(key);\r\n const theKey = this.resolveLegacyKey(encType, keyForEnc);\r\n\r\n if (theKey.macKey != null && mac == null) {\r\n // tslint:disable-next-line\r\n console.error('mac required.');\r\n return null;\r\n }\r\n\r\n if (theKey.encType !== encType) {\r\n // tslint:disable-next-line\r\n console.error('encType unavailable.');\r\n return null;\r\n }\r\n\r\n const fastParams = this.cryptoFunctionService.aesDecryptFastParameters(data, iv, mac, theKey);\r\n if (fastParams.macKey != null && fastParams.mac != null) {\r\n const computedMac = await this.cryptoFunctionService.hmacFast(fastParams.macData,\r\n fastParams.macKey, 'sha256');\r\n const macsEqual = await this.cryptoFunctionService.compareFast(fastParams.mac, computedMac);\r\n if (!macsEqual) {\r\n // tslint:disable-next-line\r\n console.error('mac failed.');\r\n return null;\r\n }\r\n }\r\n\r\n return this.cryptoFunctionService.aesDecryptFast(fastParams);\r\n }\r\n\r\n private async aesDecryptToBytes(encType: EncryptionType, data: ArrayBuffer, iv: ArrayBuffer,\r\n mac: ArrayBuffer, key: SymmetricCryptoKey): Promise {\r\n const keyForEnc = await this.getKeyForEncryption(key);\r\n const theKey = this.resolveLegacyKey(encType, keyForEnc);\r\n\r\n if (theKey.macKey != null && mac == null) {\r\n return null;\r\n }\r\n\r\n if (theKey.encType !== encType) {\r\n return null;\r\n }\r\n\r\n if (theKey.macKey != null && mac != null) {\r\n const macData = new Uint8Array(iv.byteLength + data.byteLength);\r\n macData.set(new Uint8Array(iv), 0);\r\n macData.set(new Uint8Array(data), iv.byteLength);\r\n const computedMac = await this.cryptoFunctionService.hmac(macData.buffer, theKey.macKey, 'sha256');\r\n if (computedMac === null) {\r\n return null;\r\n }\r\n\r\n const macsMatch = await this.cryptoFunctionService.compare(mac, computedMac);\r\n if (!macsMatch) {\r\n // tslint:disable-next-line\r\n console.error('mac failed.');\r\n return null;\r\n }\r\n }\r\n\r\n return await this.cryptoFunctionService.aesDecrypt(data, iv, theKey.encKey);\r\n }\r\n\r\n private async rsaDecrypt(encValue: string): Promise {\r\n const headerPieces = encValue.split('.');\r\n let encType: EncryptionType = null;\r\n let encPieces: string[];\r\n\r\n if (headerPieces.length === 1) {\r\n encType = EncryptionType.Rsa2048_OaepSha256_B64;\r\n encPieces = [headerPieces[0]];\r\n } else if (headerPieces.length === 2) {\r\n try {\r\n encType = parseInt(headerPieces[0], null);\r\n encPieces = headerPieces[1].split('|');\r\n } catch (e) { }\r\n }\r\n\r\n switch (encType) {\r\n case EncryptionType.Rsa2048_OaepSha256_B64:\r\n case EncryptionType.Rsa2048_OaepSha1_B64:\r\n if (encPieces.length !== 1) {\r\n throw new Error('Invalid cipher format.');\r\n }\r\n break;\r\n case EncryptionType.Rsa2048_OaepSha256_HmacSha256_B64:\r\n case EncryptionType.Rsa2048_OaepSha1_HmacSha256_B64:\r\n if (encPieces.length !== 2) {\r\n throw new Error('Invalid cipher format.');\r\n }\r\n break;\r\n default:\r\n throw new Error('encType unavailable.');\r\n }\r\n\r\n if (encPieces == null || encPieces.length <= 0) {\r\n throw new Error('encPieces unavailable.');\r\n }\r\n\r\n const data = Utils.fromB64ToArray(encPieces[0]).buffer;\r\n const key = await this.getEncKey();\r\n if (key != null && key.macKey != null && encPieces.length > 1) {\r\n const mac = Utils.fromB64ToArray(encPieces[1]).buffer;\r\n const computedMac = await this.cryptoFunctionService.hmac(data, key.macKey, 'sha256');\r\n const macsEqual = await this.cryptoFunctionService.compare(mac, computedMac);\r\n if (!macsEqual) {\r\n throw new Error('MAC failed.');\r\n }\r\n }\r\n\r\n const privateKey = await this.getPrivateKey();\r\n if (privateKey == null) {\r\n throw new Error('No private key.');\r\n }\r\n\r\n let alg: 'sha1' | 'sha256' = 'sha1';\r\n switch (encType) {\r\n case EncryptionType.Rsa2048_OaepSha256_B64:\r\n case EncryptionType.Rsa2048_OaepSha256_HmacSha256_B64:\r\n alg = 'sha256';\r\n break;\r\n case EncryptionType.Rsa2048_OaepSha1_B64:\r\n case EncryptionType.Rsa2048_OaepSha1_HmacSha256_B64:\r\n break;\r\n default:\r\n throw new Error('encType unavailable.');\r\n }\r\n\r\n return this.cryptoFunctionService.rsaDecrypt(data, privateKey, alg);\r\n }\r\n\r\n private async getKeyForEncryption(key?: SymmetricCryptoKey): Promise {\r\n if (key != null) {\r\n return key;\r\n }\r\n\r\n const encKey = await this.getEncKey();\r\n if (encKey != null) {\r\n return encKey;\r\n }\r\n\r\n return await this.getKey();\r\n }\r\n\r\n private resolveLegacyKey(encType: EncryptionType, key: SymmetricCryptoKey): SymmetricCryptoKey {\r\n if (encType === EncryptionType.AesCbc128_HmacSha256_B64 &&\r\n key.encType === EncryptionType.AesCbc256_B64) {\r\n // Old encrypt-then-mac scheme, make a new key\r\n if (this.legacyEtmKey == null) {\r\n this.legacyEtmKey = new SymmetricCryptoKey(key.key, EncryptionType.AesCbc128_HmacSha256_B64);\r\n }\r\n return this.legacyEtmKey;\r\n }\r\n\r\n return key;\r\n }\r\n\r\n private async stretchKey(key: SymmetricCryptoKey): Promise {\r\n const newKey = new Uint8Array(64);\r\n newKey.set(await this.hkdfExpand(key.key, Utils.fromUtf8ToArray('enc'), 32));\r\n newKey.set(await this.hkdfExpand(key.key, Utils.fromUtf8ToArray('mac'), 32), 32);\r\n return new SymmetricCryptoKey(newKey.buffer);\r\n }\r\n\r\n // ref: https://tools.ietf.org/html/rfc5869\r\n private async hkdfExpand(prk: ArrayBuffer, info: Uint8Array, size: number) {\r\n const hashLen = 32; // sha256\r\n const okm = new Uint8Array(size);\r\n let previousT = new Uint8Array(0);\r\n const n = Math.ceil(size / hashLen);\r\n for (let i = 0; i < n; i++) {\r\n const t = new Uint8Array(previousT.length + info.length + 1);\r\n t.set(previousT);\r\n t.set(info, previousT.length);\r\n t.set([i + 1], t.length - 1);\r\n previousT = new Uint8Array(await this.cryptoFunctionService.hmac(t.buffer, prk, 'sha256'));\r\n okm.set(previousT, i * hashLen);\r\n }\r\n return okm;\r\n }\r\n}\r\n","import { CryptoService } from '../abstractions/crypto.service';\nimport { PlatformUtilsService } from '../abstractions/platformUtils.service';\n\nexport class ContainerService {\n constructor(private cryptoService: CryptoService,\n private platformUtilsService: PlatformUtilsService) {\n }\n\n // deprecated, use attachToGlobal instead\n attachToWindow(win: any) {\n this.attachToGlobal(win);\n }\n\n attachToGlobal(global: any) {\n if (!global.bitwardenContainerService) {\n global.bitwardenContainerService = this;\n }\n }\n\n getCryptoService(): CryptoService {\n return this.cryptoService;\n }\n\n getPlatformUtilsService(): PlatformUtilsService {\n return this.platformUtilsService;\n }\n}\n","import { CollectionData } from '../models/data/collectionData';\r\n\r\nimport { Collection } from '../models/domain/collection';\r\n\r\nimport { CollectionView } from '../models/view/collectionView';\r\n\r\nimport { CollectionService as CollectionServiceAbstraction } from '../abstractions/collection.service';\r\nimport { CryptoService } from '../abstractions/crypto.service';\r\nimport { I18nService } from '../abstractions/i18n.service';\r\nimport { StorageService } from '../abstractions/storage.service';\r\nimport { UserService } from '../abstractions/user.service';\r\n\r\nimport { Utils } from '../misc/utils';\r\n\r\nconst Keys = {\r\n collectionsPrefix: 'collections_',\r\n};\r\n\r\nexport class CollectionService implements CollectionServiceAbstraction {\r\n decryptedCollectionCache: CollectionView[];\r\n\r\n constructor(private cryptoService: CryptoService, private userService: UserService,\r\n private storageService: StorageService, private i18nService: I18nService) {\r\n }\r\n\r\n clearCache(): void {\r\n this.decryptedCollectionCache = null;\r\n }\r\n\r\n async encrypt(model: CollectionView): Promise {\r\n if (model.organizationId == null) {\r\n throw new Error('Collection has no organization id.');\r\n }\r\n const key = await this.cryptoService.getOrgKey(model.organizationId);\r\n if (key == null) {\r\n throw new Error('No key for this collection\\'s organization.');\r\n }\r\n const collection = new Collection();\r\n collection.id = model.id;\r\n collection.organizationId = model.organizationId;\r\n collection.readOnly = model.readOnly;\r\n collection.name = await this.cryptoService.encrypt(model.name, key);\r\n return collection;\r\n }\r\n\r\n async decryptMany(collections: Collection[]): Promise {\r\n if (collections == null) {\r\n return [];\r\n }\r\n const decCollections: CollectionView[] = [];\r\n const promises: Array> = [];\r\n collections.forEach((collection) => {\r\n promises.push(collection.decrypt().then((c) => decCollections.push(c)));\r\n });\r\n await Promise.all(promises);\r\n return decCollections.sort(Utils.getSortFunction(this.i18nService, 'name'));\r\n }\r\n\r\n async get(id: string): Promise {\r\n const userId = await this.userService.getUserId();\r\n const collections = await this.storageService.get<{ [id: string]: CollectionData; }>(\r\n Keys.collectionsPrefix + userId);\r\n if (collections == null || !collections.hasOwnProperty(id)) {\r\n return null;\r\n }\r\n\r\n return new Collection(collections[id]);\r\n }\r\n\r\n async getAll(): Promise {\r\n const userId = await this.userService.getUserId();\r\n const collections = await this.storageService.get<{ [id: string]: CollectionData; }>(\r\n Keys.collectionsPrefix + userId);\r\n const response: Collection[] = [];\r\n for (const id in collections) {\r\n if (collections.hasOwnProperty(id)) {\r\n response.push(new Collection(collections[id]));\r\n }\r\n }\r\n return response;\r\n }\r\n\r\n async getAllDecrypted(): Promise {\r\n if (this.decryptedCollectionCache != null) {\r\n return this.decryptedCollectionCache;\r\n }\r\n\r\n const hasKey = await this.cryptoService.hasKey();\r\n if (!hasKey) {\r\n throw new Error('No key.');\r\n }\r\n\r\n const collections = await this.getAll();\r\n this.decryptedCollectionCache = await this.decryptMany(collections);\r\n return this.decryptedCollectionCache;\r\n }\r\n\r\n async upsert(collection: CollectionData | CollectionData[]): Promise {\r\n const userId = await this.userService.getUserId();\r\n let collections = await this.storageService.get<{ [id: string]: CollectionData; }>(\r\n Keys.collectionsPrefix + userId);\r\n if (collections == null) {\r\n collections = {};\r\n }\r\n\r\n if (collection instanceof CollectionData) {\r\n const c = collection as CollectionData;\r\n collections[c.id] = c;\r\n } else {\r\n (collection as CollectionData[]).forEach((c) => {\r\n collections[c.id] = c;\r\n });\r\n }\r\n\r\n await this.storageService.save(Keys.collectionsPrefix + userId, collections);\r\n this.decryptedCollectionCache = null;\r\n }\r\n\r\n async replace(collections: { [id: string]: CollectionData; }): Promise {\r\n const userId = await this.userService.getUserId();\r\n await this.storageService.save(Keys.collectionsPrefix + userId, collections);\r\n this.decryptedCollectionCache = null;\r\n }\r\n\r\n async clear(userId: string): Promise {\r\n await this.storageService.remove(Keys.collectionsPrefix + userId);\r\n this.decryptedCollectionCache = null;\r\n }\r\n\r\n async delete(id: string | string[]): Promise {\r\n const userId = await this.userService.getUserId();\r\n const collections = await this.storageService.get<{ [id: string]: CollectionData; }>(\r\n Keys.collectionsPrefix + userId);\r\n if (collections == null) {\r\n return;\r\n }\r\n\r\n if (typeof id === 'string') {\r\n const i = id as string;\r\n delete collections[id];\r\n } else {\r\n (id as string[]).forEach((i) => {\r\n delete collections[i];\r\n });\r\n }\r\n\r\n await this.storageService.save(Keys.collectionsPrefix + userId, collections);\r\n this.decryptedCollectionCache = null;\r\n }\r\n}\r\n","import { CipherType } from '../enums/cipherType';\r\nimport { UriMatchType } from '../enums/uriMatchType';\r\n\r\nimport { CipherData } from '../models/data/cipherData';\r\n\r\nimport { Attachment } from '../models/domain/attachment';\r\nimport { Card } from '../models/domain/card';\r\nimport { Cipher } from '../models/domain/cipher';\r\nimport { CipherString } from '../models/domain/cipherString';\r\nimport Domain from '../models/domain/domain';\r\nimport { Field } from '../models/domain/field';\r\nimport { Identity } from '../models/domain/identity';\r\nimport { Login } from '../models/domain/login';\r\nimport { LoginUri } from '../models/domain/loginUri';\r\nimport { SecureNote } from '../models/domain/secureNote';\r\nimport { SymmetricCryptoKey } from '../models/domain/symmetricCryptoKey';\r\n\r\nimport { CipherBulkDeleteRequest } from '../models/request/cipherBulkDeleteRequest';\r\nimport { CipherBulkMoveRequest } from '../models/request/cipherBulkMoveRequest';\r\nimport { CipherBulkShareRequest } from '../models/request/cipherBulkShareRequest';\r\nimport { CipherCollectionsRequest } from '../models/request/cipherCollectionsRequest';\r\nimport { CipherRequest } from '../models/request/cipherRequest';\r\nimport { CipherShareRequest } from '../models/request/cipherShareRequest';\r\n\r\nimport { CipherResponse } from '../models/response/cipherResponse';\r\nimport { ErrorResponse } from '../models/response/errorResponse';\r\n\r\nimport { AttachmentView } from '../models/view/attachmentView';\r\nimport { CipherView } from '../models/view/cipherView';\r\nimport { FieldView } from '../models/view/fieldView';\r\nimport { View } from '../models/view/view';\r\n\r\nimport { ApiService } from '../abstractions/api.service';\r\nimport { CipherService as CipherServiceAbstraction } from '../abstractions/cipher.service';\r\nimport { CryptoService } from '../abstractions/crypto.service';\r\nimport { I18nService } from '../abstractions/i18n.service';\r\nimport { PlatformUtilsService } from '../abstractions/platformUtils.service';\r\nimport { SettingsService } from '../abstractions/settings.service';\r\nimport { StorageService } from '../abstractions/storage.service';\r\nimport { UserService } from '../abstractions/user.service';\r\n\r\nimport { Utils } from '../misc/utils';\r\n\r\nconst Keys = {\r\n ciphersPrefix: 'ciphers_',\r\n localData: 'sitesLocalData',\r\n neverDomains: 'neverDomains',\r\n};\r\n\r\nexport class CipherService implements CipherServiceAbstraction {\r\n decryptedCipherCache: CipherView[];\r\n\r\n constructor(private cryptoService: CryptoService, private userService: UserService,\r\n private settingsService: SettingsService, private apiService: ApiService,\r\n private storageService: StorageService, private i18nService: I18nService,\r\n private platformUtilsService: PlatformUtilsService) {\r\n }\r\n\r\n clearCache(): void {\r\n this.decryptedCipherCache = null;\r\n }\r\n\r\n async encrypt(model: CipherView, key?: SymmetricCryptoKey): Promise {\r\n const cipher = new Cipher();\r\n cipher.id = model.id;\r\n cipher.folderId = model.folderId;\r\n cipher.favorite = model.favorite;\r\n cipher.organizationId = model.organizationId;\r\n cipher.type = model.type;\r\n cipher.collectionIds = model.collectionIds;\r\n\r\n if (key == null && cipher.organizationId != null) {\r\n key = await this.cryptoService.getOrgKey(cipher.organizationId);\r\n }\r\n await Promise.all([\r\n this.encryptObjProperty(model, cipher, {\r\n name: null,\r\n notes: null,\r\n }, key),\r\n this.encryptCipherData(cipher, model, key),\r\n this.encryptFields(model.fields, key).then((fields) => {\r\n cipher.fields = fields;\r\n }),\r\n this.encryptAttachments(model.attachments, key).then((attachments) => {\r\n cipher.attachments = attachments;\r\n }),\r\n ]);\r\n\r\n return cipher;\r\n }\r\n\r\n async encryptAttachments(attachmentsModel: AttachmentView[], key: SymmetricCryptoKey): Promise {\r\n if (attachmentsModel == null || attachmentsModel.length === 0) {\r\n return null;\r\n }\r\n\r\n const promises: Array> = [];\r\n const encAttachments: Attachment[] = [];\r\n attachmentsModel.forEach(async (model) => {\r\n const attachment = new Attachment();\r\n attachment.id = model.id;\r\n attachment.size = model.size;\r\n attachment.sizeName = model.sizeName;\r\n attachment.url = model.url;\r\n const promise = this.encryptObjProperty(model, attachment, {\r\n fileName: null,\r\n }, key).then(() => {\r\n encAttachments.push(attachment);\r\n });\r\n promises.push(promise);\r\n });\r\n\r\n await Promise.all(promises);\r\n return encAttachments;\r\n }\r\n\r\n async encryptFields(fieldsModel: FieldView[], key: SymmetricCryptoKey): Promise {\r\n if (!fieldsModel || !fieldsModel.length) {\r\n return null;\r\n }\r\n\r\n const self = this;\r\n const encFields: Field[] = [];\r\n await fieldsModel.reduce((promise, field) => {\r\n return promise.then(() => {\r\n return self.encryptField(field, key);\r\n }).then((encField: Field) => {\r\n encFields.push(encField);\r\n });\r\n }, Promise.resolve());\r\n\r\n return encFields;\r\n }\r\n\r\n async encryptField(fieldModel: FieldView, key: SymmetricCryptoKey): Promise {\r\n const field = new Field();\r\n field.type = fieldModel.type;\r\n\r\n await this.encryptObjProperty(fieldModel, field, {\r\n name: null,\r\n value: null,\r\n }, key);\r\n\r\n return field;\r\n }\r\n\r\n async get(id: string): Promise {\r\n const userId = await this.userService.getUserId();\r\n const localData = await this.storageService.get(Keys.localData);\r\n const ciphers = await this.storageService.get<{ [id: string]: CipherData; }>(\r\n Keys.ciphersPrefix + userId);\r\n if (ciphers == null || !ciphers.hasOwnProperty(id)) {\r\n return null;\r\n }\r\n\r\n return new Cipher(ciphers[id], false, localData ? localData[id] : null);\r\n }\r\n\r\n async getAll(): Promise {\r\n const userId = await this.userService.getUserId();\r\n const localData = await this.storageService.get(Keys.localData);\r\n const ciphers = await this.storageService.get<{ [id: string]: CipherData; }>(\r\n Keys.ciphersPrefix + userId);\r\n const response: Cipher[] = [];\r\n for (const id in ciphers) {\r\n if (ciphers.hasOwnProperty(id)) {\r\n response.push(new Cipher(ciphers[id], false, localData ? localData[id] : null));\r\n }\r\n }\r\n return response;\r\n }\r\n\r\n async getAllDecrypted(): Promise {\r\n if (this.decryptedCipherCache != null) {\r\n return this.decryptedCipherCache;\r\n }\r\n\r\n const decCiphers: CipherView[] = [];\r\n const hasKey = await this.cryptoService.hasKey();\r\n if (!hasKey) {\r\n throw new Error('No key.');\r\n }\r\n\r\n const promises: any[] = [];\r\n const ciphers = await this.getAll();\r\n ciphers.forEach((cipher) => {\r\n promises.push(cipher.decrypt().then((c) => decCiphers.push(c)));\r\n });\r\n\r\n await Promise.all(promises);\r\n decCiphers.sort(this.getLocaleSortingFunction());\r\n this.decryptedCipherCache = decCiphers;\r\n return this.decryptedCipherCache;\r\n }\r\n\r\n async getAllDecryptedForGrouping(groupingId: string, folder: boolean = true): Promise {\r\n const ciphers = await this.getAllDecrypted();\r\n\r\n return ciphers.filter((cipher) => {\r\n if (folder && cipher.folderId === groupingId) {\r\n return true;\r\n } else if (!folder && cipher.collectionIds != null && cipher.collectionIds.indexOf(groupingId) > -1) {\r\n return true;\r\n }\r\n\r\n return false;\r\n });\r\n }\r\n\r\n async getAllDecryptedForUrl(url: string, includeOtherTypes?: CipherType[]): Promise {\r\n if (url == null && !includeOtherTypes) {\r\n return Promise.resolve([]);\r\n }\r\n\r\n const domain = this.platformUtilsService.getDomain(url);\r\n const eqDomainsPromise = domain == null ? Promise.resolve([]) :\r\n this.settingsService.getEquivalentDomains().then((eqDomains: any[][]) => {\r\n let matches: any[] = [];\r\n eqDomains.forEach((eqDomain) => {\r\n if (eqDomain.length && eqDomain.indexOf(domain) >= 0) {\r\n matches = matches.concat(eqDomain);\r\n }\r\n });\r\n\r\n if (!matches.length) {\r\n matches.push(domain);\r\n }\r\n\r\n return matches;\r\n });\r\n\r\n const result = await Promise.all([eqDomainsPromise, this.getAllDecrypted()]);\r\n const matchingDomains = result[0];\r\n const ciphers = result[1];\r\n\r\n return ciphers.filter((cipher) => {\r\n if (includeOtherTypes && includeOtherTypes.indexOf(cipher.type) > -1) {\r\n return true;\r\n }\r\n\r\n if (url != null && cipher.type === CipherType.Login && cipher.login.uris != null) {\r\n for (let i = 0; i < cipher.login.uris.length; i++) {\r\n const u = cipher.login.uris[i];\r\n if (u.uri == null) {\r\n continue;\r\n }\r\n\r\n switch (u.match) {\r\n case null:\r\n case undefined:\r\n case UriMatchType.Domain:\r\n if (domain != null && u.domain != null && matchingDomains.indexOf(u.domain) > -1) {\r\n return true;\r\n }\r\n break;\r\n case UriMatchType.Host:\r\n const urlHost = Utils.getHost(url);\r\n if (urlHost != null && urlHost === Utils.getHost(u.uri)) {\r\n return true;\r\n }\r\n break;\r\n case UriMatchType.Exact:\r\n if (url === u.uri) {\r\n return true;\r\n }\r\n break;\r\n case UriMatchType.StartsWith:\r\n if (url.startsWith(u.uri)) {\r\n return true;\r\n }\r\n break;\r\n case UriMatchType.RegularExpression:\r\n try {\r\n const regex = new RegExp(u.uri, 'i');\r\n if (regex.test(url)) {\r\n return true;\r\n }\r\n } catch { }\r\n break;\r\n case UriMatchType.Never:\r\n default:\r\n break;\r\n }\r\n }\r\n }\r\n\r\n return false;\r\n });\r\n }\r\n\r\n async getLastUsedForUrl(url: string): Promise {\r\n const ciphers = await this.getAllDecryptedForUrl(url);\r\n if (ciphers.length === 0) {\r\n return null;\r\n }\r\n\r\n const sortedCiphers = ciphers.sort(this.sortCiphersByLastUsed);\r\n return sortedCiphers[0];\r\n }\r\n\r\n async updateLastUsedDate(id: string): Promise {\r\n let ciphersLocalData = await this.storageService.get(Keys.localData);\r\n if (!ciphersLocalData) {\r\n ciphersLocalData = {};\r\n }\r\n\r\n if (ciphersLocalData[id]) {\r\n ciphersLocalData[id].lastUsedDate = new Date().getTime();\r\n } else {\r\n ciphersLocalData[id] = {\r\n lastUsedDate: new Date().getTime(),\r\n };\r\n }\r\n\r\n await this.storageService.save(Keys.localData, ciphersLocalData);\r\n\r\n if (this.decryptedCipherCache == null) {\r\n return;\r\n }\r\n\r\n for (let i = 0; i < this.decryptedCipherCache.length; i++) {\r\n const cached = this.decryptedCipherCache[i];\r\n if (cached.id === id) {\r\n cached.localData = ciphersLocalData[id];\r\n break;\r\n }\r\n }\r\n }\r\n\r\n async saveNeverDomain(domain: string): Promise {\r\n if (domain == null) {\r\n return;\r\n }\r\n\r\n let domains = await this.storageService.get<{ [id: string]: any; }>(Keys.neverDomains);\r\n if (!domains) {\r\n domains = {};\r\n }\r\n domains[domain] = null;\r\n await this.storageService.save(Keys.neverDomains, domains);\r\n }\r\n\r\n async saveWithServer(cipher: Cipher): Promise {\r\n const request = new CipherRequest(cipher);\r\n\r\n let response: CipherResponse;\r\n if (cipher.id == null) {\r\n response = await this.apiService.postCipher(request);\r\n cipher.id = response.id;\r\n } else {\r\n response = await this.apiService.putCipher(cipher.id, request);\r\n }\r\n\r\n const userId = await this.userService.getUserId();\r\n const data = new CipherData(response, userId, cipher.collectionIds);\r\n await this.upsert(data);\r\n }\r\n\r\n async shareWithServer(cipher: CipherView, organizationId: string, collectionIds: string[]): Promise {\r\n cipher.organizationId = organizationId;\r\n cipher.collectionIds = collectionIds;\r\n const encCipher = await this.encrypt(cipher);\r\n const request = new CipherShareRequest(encCipher);\r\n await this.apiService.putShareCipher(cipher.id, request);\r\n const userId = await this.userService.getUserId();\r\n await this.upsert(encCipher.toCipherData(userId));\r\n }\r\n\r\n async shareManyWithServer(ciphers: CipherView[], organizationId: string, collectionIds: string[]): Promise {\r\n const promises: Array> = [];\r\n const encCiphers: Cipher[] = [];\r\n for (const cipher of ciphers) {\r\n cipher.organizationId = organizationId;\r\n cipher.collectionIds = collectionIds;\r\n promises.push(this.encrypt(cipher).then((c) => {\r\n encCiphers.push(c);\r\n }));\r\n }\r\n await Promise.all(promises);\r\n const request = new CipherBulkShareRequest(encCiphers, collectionIds);\r\n await this.apiService.putShareCiphers(request);\r\n const userId = await this.userService.getUserId();\r\n await this.upsert(encCiphers.map((c) => c.toCipherData(userId)));\r\n }\r\n\r\n async shareAttachmentWithServer(attachmentView: AttachmentView, cipherId: string,\r\n organizationId: string): Promise {\r\n const attachmentResponse = await fetch(new Request(attachmentView.url, { cache: 'no-cache' }));\r\n if (attachmentResponse.status !== 200) {\r\n throw Error('Failed to download attachment: ' + attachmentResponse.status.toString());\r\n }\r\n\r\n const buf = await attachmentResponse.arrayBuffer();\r\n const decBuf = await this.cryptoService.decryptFromBytes(buf, null);\r\n const key = await this.cryptoService.getOrgKey(organizationId);\r\n const encData = await this.cryptoService.encryptToBytes(decBuf, key);\r\n const encFileName = await this.cryptoService.encrypt(attachmentView.fileName, key);\r\n\r\n const fd = new FormData();\r\n try {\r\n const blob = new Blob([encData], { type: 'application/octet-stream' });\r\n fd.append('data', blob, encFileName.encryptedString);\r\n } catch (e) {\r\n if (Utils.isNode && !Utils.isBrowser) {\r\n fd.append('data', new Buffer(encData) as any, {\r\n filepath: encFileName.encryptedString,\r\n contentType: 'application/octet-stream',\r\n } as any);\r\n } else {\r\n throw e;\r\n }\r\n }\r\n\r\n let response: CipherResponse;\r\n try {\r\n response = await this.apiService.postShareCipherAttachment(cipherId, attachmentView.id, fd,\r\n organizationId);\r\n } catch (e) {\r\n throw new Error((e as ErrorResponse).getSingleMessage());\r\n }\r\n }\r\n\r\n saveAttachmentWithServer(cipher: Cipher, unencryptedFile: any, admin = false): Promise {\r\n return new Promise((resolve, reject) => {\r\n const reader = new FileReader();\r\n reader.readAsArrayBuffer(unencryptedFile);\r\n reader.onload = async (evt: any) => {\r\n try {\r\n const cData = await this.saveAttachmentRawWithServer(cipher,\r\n unencryptedFile.name, evt.target.result, admin);\r\n resolve(cData);\r\n } catch (e) {\r\n reject(e);\r\n }\r\n };\r\n reader.onerror = (evt) => {\r\n reject('Error reading file.');\r\n };\r\n });\r\n }\r\n\r\n async saveAttachmentRawWithServer(cipher: Cipher, filename: string,\r\n data: ArrayBuffer, admin = false): Promise {\r\n const key = await this.cryptoService.getOrgKey(cipher.organizationId);\r\n const encFileName = await this.cryptoService.encrypt(filename, key);\r\n const encData = await this.cryptoService.encryptToBytes(data, key);\r\n\r\n const fd = new FormData();\r\n try {\r\n const blob = new Blob([encData], { type: 'application/octet-stream' });\r\n fd.append('data', blob, encFileName.encryptedString);\r\n } catch (e) {\r\n if (Utils.isNode && !Utils.isBrowser) {\r\n fd.append('data', new Buffer(encData) as any, {\r\n filepath: encFileName.encryptedString,\r\n contentType: 'application/octet-stream',\r\n } as any);\r\n } else {\r\n throw e;\r\n }\r\n }\r\n\r\n let response: CipherResponse;\r\n try {\r\n if (admin) {\r\n response = await this.apiService.postCipherAttachmentAdmin(cipher.id, fd);\r\n } else {\r\n response = await this.apiService.postCipherAttachment(cipher.id, fd);\r\n }\r\n } catch (e) {\r\n throw new Error((e as ErrorResponse).getSingleMessage());\r\n }\r\n\r\n const userId = await this.userService.getUserId();\r\n const cData = new CipherData(response, userId, cipher.collectionIds);\r\n if (!admin) {\r\n this.upsert(cData);\r\n }\r\n return new Cipher(cData);\r\n }\r\n\r\n async saveCollectionsWithServer(cipher: Cipher): Promise {\r\n const request = new CipherCollectionsRequest(cipher.collectionIds);\r\n await this.apiService.putCipherCollections(cipher.id, request);\r\n const userId = await this.userService.getUserId();\r\n const data = cipher.toCipherData(userId);\r\n await this.upsert(data);\r\n }\r\n\r\n async upsert(cipher: CipherData | CipherData[]): Promise {\r\n const userId = await this.userService.getUserId();\r\n let ciphers = await this.storageService.get<{ [id: string]: CipherData; }>(\r\n Keys.ciphersPrefix + userId);\r\n if (ciphers == null) {\r\n ciphers = {};\r\n }\r\n\r\n if (cipher instanceof CipherData) {\r\n const c = cipher as CipherData;\r\n ciphers[c.id] = c;\r\n } else {\r\n (cipher as CipherData[]).forEach((c) => {\r\n ciphers[c.id] = c;\r\n });\r\n }\r\n\r\n await this.storageService.save(Keys.ciphersPrefix + userId, ciphers);\r\n this.decryptedCipherCache = null;\r\n }\r\n\r\n async replace(ciphers: { [id: string]: CipherData; }): Promise {\r\n const userId = await this.userService.getUserId();\r\n await this.storageService.save(Keys.ciphersPrefix + userId, ciphers);\r\n this.decryptedCipherCache = null;\r\n }\r\n\r\n async clear(userId: string): Promise {\r\n await this.storageService.remove(Keys.ciphersPrefix + userId);\r\n this.decryptedCipherCache = null;\r\n }\r\n\r\n async moveManyWithServer(ids: string[], folderId: string): Promise {\r\n await this.apiService.putMoveCiphers(new CipherBulkMoveRequest(ids, folderId));\r\n\r\n const userId = await this.userService.getUserId();\r\n let ciphers = await this.storageService.get<{ [id: string]: CipherData; }>(\r\n Keys.ciphersPrefix + userId);\r\n if (ciphers == null) {\r\n ciphers = {};\r\n }\r\n\r\n ids.forEach((id) => {\r\n if (ciphers.hasOwnProperty(id)) {\r\n ciphers[id].folderId = folderId;\r\n }\r\n });\r\n\r\n await this.storageService.save(Keys.ciphersPrefix + userId, ciphers);\r\n this.decryptedCipherCache = null;\r\n }\r\n\r\n async delete(id: string | string[]): Promise {\r\n const userId = await this.userService.getUserId();\r\n const ciphers = await this.storageService.get<{ [id: string]: CipherData; }>(\r\n Keys.ciphersPrefix + userId);\r\n if (ciphers == null) {\r\n return;\r\n }\r\n\r\n if (typeof id === 'string') {\r\n const i = id as string;\r\n delete ciphers[id];\r\n } else {\r\n (id as string[]).forEach((i) => {\r\n delete ciphers[i];\r\n });\r\n }\r\n\r\n await this.storageService.save(Keys.ciphersPrefix + userId, ciphers);\r\n this.decryptedCipherCache = null;\r\n }\r\n\r\n async deleteWithServer(id: string): Promise {\r\n await this.apiService.deleteCipher(id);\r\n await this.delete(id);\r\n }\r\n\r\n async deleteManyWithServer(ids: string[]): Promise {\r\n await this.apiService.deleteManyCiphers(new CipherBulkDeleteRequest(ids));\r\n await this.delete(ids);\r\n }\r\n\r\n async deleteAttachment(id: string, attachmentId: string): Promise {\r\n const userId = await this.userService.getUserId();\r\n const ciphers = await this.storageService.get<{ [id: string]: CipherData; }>(\r\n Keys.ciphersPrefix + userId);\r\n\r\n if (ciphers == null || !ciphers.hasOwnProperty(id) || ciphers[id].attachments == null) {\r\n return;\r\n }\r\n\r\n for (let i = 0; i < ciphers[id].attachments.length; i++) {\r\n if (ciphers[id].attachments[i].id === attachmentId) {\r\n ciphers[id].attachments.splice(i, 1);\r\n }\r\n }\r\n\r\n await this.storageService.save(Keys.ciphersPrefix + userId, ciphers);\r\n this.decryptedCipherCache = null;\r\n }\r\n\r\n async deleteAttachmentWithServer(id: string, attachmentId: string): Promise {\r\n try {\r\n await this.apiService.deleteCipherAttachment(id, attachmentId);\r\n } catch (e) {\r\n return Promise.reject((e as ErrorResponse).getSingleMessage());\r\n }\r\n await this.deleteAttachment(id, attachmentId);\r\n }\r\n\r\n sortCiphersByLastUsed(a: CipherView, b: CipherView): number {\r\n const aLastUsed = a.localData && a.localData.lastUsedDate ? a.localData.lastUsedDate as number : null;\r\n const bLastUsed = b.localData && b.localData.lastUsedDate ? b.localData.lastUsedDate as number : null;\r\n\r\n if (aLastUsed != null && bLastUsed != null && aLastUsed < bLastUsed) {\r\n return 1;\r\n }\r\n if (aLastUsed != null && bLastUsed == null) {\r\n return -1;\r\n }\r\n\r\n if (bLastUsed != null && aLastUsed != null && aLastUsed > bLastUsed) {\r\n return -1;\r\n }\r\n if (bLastUsed != null && aLastUsed == null) {\r\n return 1;\r\n }\r\n\r\n return 0;\r\n }\r\n\r\n sortCiphersByLastUsedThenName(a: CipherView, b: CipherView): number {\r\n const result = this.sortCiphersByLastUsed(a, b);\r\n if (result !== 0) {\r\n return result;\r\n }\r\n\r\n return this.getLocaleSortingFunction()(a, b);\r\n }\r\n\r\n getLocaleSortingFunction(): (a: CipherView, b: CipherView) => number {\r\n return (a, b) => {\r\n let aName = a.name;\r\n let bName = b.name;\r\n\r\n if (aName == null && bName != null) {\r\n return -1;\r\n }\r\n if (aName != null && bName == null) {\r\n return 1;\r\n }\r\n if (aName == null && bName == null) {\r\n return 0;\r\n }\r\n\r\n const result = this.i18nService.collator ? this.i18nService.collator.compare(aName, bName) :\r\n aName.localeCompare(bName);\r\n\r\n if (result !== 0 || a.type !== CipherType.Login || b.type !== CipherType.Login) {\r\n return result;\r\n }\r\n\r\n if (a.login.username != null) {\r\n aName += a.login.username;\r\n }\r\n\r\n if (b.login.username != null) {\r\n bName += b.login.username;\r\n }\r\n\r\n return this.i18nService.collator ? this.i18nService.collator.compare(aName, bName) :\r\n aName.localeCompare(bName);\r\n };\r\n }\r\n\r\n // Helpers\r\n\r\n private async encryptObjProperty(model: V, obj: D,\r\n map: any, key: SymmetricCryptoKey): Promise {\r\n const promises = [];\r\n const self = this;\r\n\r\n for (const prop in map) {\r\n if (!map.hasOwnProperty(prop)) {\r\n continue;\r\n }\r\n\r\n // tslint:disable-next-line\r\n (function (theProp, theObj) {\r\n const p = Promise.resolve().then(() => {\r\n const modelProp = (model as any)[(map[theProp] || theProp)];\r\n if (modelProp && modelProp !== '') {\r\n return self.cryptoService.encrypt(modelProp, key);\r\n }\r\n return null;\r\n }).then((val: CipherString) => {\r\n (theObj as any)[theProp] = val;\r\n });\r\n promises.push(p);\r\n })(prop, obj);\r\n }\r\n\r\n await Promise.all(promises);\r\n }\r\n\r\n private async encryptCipherData(cipher: Cipher, model: CipherView, key: SymmetricCryptoKey) {\r\n switch (cipher.type) {\r\n case CipherType.Login:\r\n cipher.login = new Login();\r\n await this.encryptObjProperty(model.login, cipher.login, {\r\n username: null,\r\n password: null,\r\n totp: null,\r\n }, key);\r\n\r\n if (model.login.uris != null) {\r\n cipher.login.uris = [];\r\n for (let i = 0; i < model.login.uris.length; i++) {\r\n const loginUri = new LoginUri();\r\n loginUri.match = model.login.uris[i].match;\r\n await this.encryptObjProperty(model.login.uris[i], loginUri, {\r\n uri: null,\r\n }, key);\r\n cipher.login.uris.push(loginUri);\r\n }\r\n }\r\n return;\r\n case CipherType.SecureNote:\r\n cipher.secureNote = new SecureNote();\r\n cipher.secureNote.type = model.secureNote.type;\r\n return;\r\n case CipherType.Card:\r\n cipher.card = new Card();\r\n await this.encryptObjProperty(model.card, cipher.card, {\r\n cardholderName: null,\r\n brand: null,\r\n number: null,\r\n expMonth: null,\r\n expYear: null,\r\n code: null,\r\n }, key);\r\n return;\r\n case CipherType.Identity:\r\n cipher.identity = new Identity();\r\n await this.encryptObjProperty(model.identity, cipher.identity, {\r\n title: null,\r\n firstName: null,\r\n middleName: null,\r\n lastName: null,\r\n address1: null,\r\n address2: null,\r\n address3: null,\r\n city: null,\r\n state: null,\r\n postalCode: null,\r\n country: null,\r\n company: null,\r\n email: null,\r\n phone: null,\r\n ssn: null,\r\n username: null,\r\n passportNumber: null,\r\n licenseNumber: null,\r\n }, key);\r\n return;\r\n default:\r\n throw new Error('Unknown cipher type.');\r\n }\r\n }\r\n}\r\n","import { ApiService } from '../abstractions/api.service';\r\nimport { AuditService as AuditServiceAbstraction } from '../abstractions/audit.service';\r\nimport { CryptoFunctionService } from '../abstractions/cryptoFunction.service';\r\n\r\nimport { Utils } from '../misc/utils';\r\n\r\nimport { BreachAccountResponse } from '../models/response/breachAccountResponse';\r\n\r\nconst PwnedPasswordsApi = 'https://api.pwnedpasswords.com/range/';\r\nconst HibpBreachApi = 'https://haveibeenpwned.com/api/v2/breachedaccount/';\r\n\r\nexport class AuditService implements AuditServiceAbstraction {\r\n constructor(private cryptoFunctionService: CryptoFunctionService, private apiService: ApiService) { }\r\n\r\n async passwordLeaked(password: string): Promise {\r\n const hashBytes = await this.cryptoFunctionService.hash(password, 'sha1');\r\n const hash = Utils.fromBufferToHex(hashBytes).toUpperCase();\r\n const hashStart = hash.substr(0, 5);\r\n const hashEnding = hash.substr(5);\r\n\r\n const response = await fetch(new Request(PwnedPasswordsApi + hashStart));\r\n const leakedHashes = await response.text();\r\n const match = leakedHashes.split(/\\r?\\n/).find((v) => {\r\n return v.split(':')[0] === hashEnding;\r\n });\r\n\r\n return match != null ? parseInt(match.split(':')[1], 10) : 0;\r\n }\r\n\r\n async breachedAccounts(username: string): Promise {\r\n const response = await this.apiService.fetch(new Request(HibpBreachApi + username));\r\n if (response.status === 404) {\r\n return [];\r\n } else if (response.status !== 200) {\r\n throw new Error();\r\n }\r\n const responseJson = await response.json();\r\n return responseJson.map((a: any) => new BreachAccountResponse(a));\r\n }\r\n}\r\n","import { Utils } from '../misc/utils';\r\n\r\nimport { AppIdService as AppIdServiceAbstraction } from '../abstractions/appId.service';\r\nimport { StorageService } from '../abstractions/storage.service';\r\n\r\nexport class AppIdService implements AppIdServiceAbstraction {\r\n constructor(private storageService: StorageService) {\r\n }\r\n\r\n getAppId(): Promise {\r\n return this.makeAndGetAppId('appId');\r\n }\r\n\r\n getAnonymousAppId(): Promise {\r\n return this.makeAndGetAppId('anonymousAppId');\r\n }\r\n\r\n private async makeAndGetAppId(key: string) {\r\n const existingId = await this.storageService.get(key);\r\n if (existingId != null) {\r\n return existingId;\r\n }\r\n\r\n const guid = Utils.newGuid();\r\n await this.storageService.save(key, guid);\r\n return guid;\r\n }\r\n}\r\n","import { ProfileOrganizationResponse } from './profileOrganizationResponse';\r\n\r\nexport class ProfileResponse {\r\n id: string;\r\n name: string;\r\n email: string;\r\n emailVerified: boolean;\r\n masterPasswordHint: string;\r\n premium: boolean;\r\n culture: string;\r\n twoFactorEnabled: boolean;\r\n key: string;\r\n privateKey: string;\r\n securityStamp: string;\r\n organizations: ProfileOrganizationResponse[] = [];\r\n\r\n constructor(response: any) {\r\n this.id = response.Id;\r\n this.name = response.Name;\r\n this.email = response.Email;\r\n this.emailVerified = response.EmailVerified;\r\n this.masterPasswordHint = response.MasterPasswordHint;\r\n this.premium = response.Premium;\r\n this.culture = response.Culture;\r\n this.twoFactorEnabled = response.TwoFactorEnabled;\r\n this.key = response.Key;\r\n this.privateKey = response.PrivateKey;\r\n this.securityStamp = response.SecurityStamp;\r\n\r\n if (response.Organizations) {\r\n response.Organizations.forEach((org: any) => {\r\n this.organizations.push(new ProfileOrganizationResponse(org));\r\n });\r\n }\r\n }\r\n}\r\n","import { PlanType } from '../../enums/planType';\n\nexport class OrganizationResponse {\n id: string;\n name: string;\n businessName: string;\n businessAddress1: string;\n businessAddress2: string;\n businessAddress3: string;\n businessCountry: string;\n businessTaxNumber: string;\n billingEmail: string;\n plan: string;\n planType: PlanType;\n seats: number;\n maxCollections: number;\n maxStorageGb: number;\n useGroups: boolean;\n useDirectory: boolean;\n useEvents: boolean;\n useTotp: boolean;\n use2fa: boolean;\n\n constructor(response: any) {\n this.id = response.Id;\n this.name = response.Name;\n this.businessName = response.BusinessName;\n this.businessAddress1 = response.BusinessAddress1;\n this.businessAddress2 = response.BusinessAddress2;\n this.businessAddress3 = response.BusinessAddress3;\n this.businessCountry = response.BusinessCountry;\n this.businessTaxNumber = response.BusinessTaxNumber;\n this.billingEmail = response.BillingEmail;\n this.plan = response.Plan;\n this.planType = response.PlanType;\n this.seats = response.Seats;\n this.maxCollections = response.MaxCollections;\n this.maxStorageGb = response.MaxStorageGb;\n this.useGroups = response.UseGroups;\n this.useDirectory = response.UseDirectory;\n this.useEvents = response.UseEvents;\n this.useTotp = response.UseTotp;\n this.use2fa = response.Use2fa;\n }\n}\n","export class FolderResponse {\r\n id: string;\r\n name: string;\r\n revisionDate: string;\r\n\r\n constructor(response: any) {\r\n this.id = response.Id;\r\n this.name = response.Name;\r\n this.revisionDate = response.RevisionDate;\r\n }\r\n}\r\n","import { GlobalDomainResponse } from './globalDomainResponse';\r\n\r\nexport class DomainsResponse {\r\n equivalentDomains: string[][];\r\n globalEquivalentDomains: GlobalDomainResponse[] = [];\r\n\r\n constructor(response: any) {\r\n this.equivalentDomains = response.EquivalentDomains;\r\n\r\n this.globalEquivalentDomains = [];\r\n if (response.GlobalEquivalentDomains) {\r\n response.GlobalEquivalentDomains.forEach((domain: any) => {\r\n this.globalEquivalentDomains.push(new GlobalDomainResponse(domain));\r\n });\r\n }\r\n }\r\n}\r\n","import { SelectionReadOnlyResponse } from './selectionReadOnlyResponse';\n\nexport class CollectionResponse {\n id: string;\n organizationId: string;\n name: string;\n\n constructor(response: any) {\n this.id = response.Id;\n this.organizationId = response.OrganizationId;\n this.name = response.Name;\n }\n}\n\nexport class CollectionDetailsResponse extends CollectionResponse {\n readOnly: boolean;\n\n constructor(response: any) {\n super(response);\n this.readOnly = response.ReadOnly || false;\n }\n}\n\nexport class CollectionGroupDetailsResponse extends CollectionResponse {\n groups: SelectionReadOnlyResponse[] = [];\n\n constructor(response: any) {\n super(response);\n if (response.Groups != null) {\n this.groups = response.Groups.map((g: any) => new SelectionReadOnlyResponse(g));\n }\n }\n}\n","import { AttachmentResponse } from './attachmentResponse';\n\nimport { CardApi } from '../api/cardApi';\nimport { FieldApi } from '../api/fieldApi';\nimport { IdentityApi } from '../api/identityApi';\nimport { LoginApi } from '../api/loginApi';\nimport { SecureNoteApi } from '../api/secureNoteApi';\n\nexport class CipherResponse {\n id: string;\n organizationId: string;\n folderId: string;\n type: number;\n name: string;\n notes: string;\n fields: FieldApi[];\n login: LoginApi;\n card: CardApi;\n identity: IdentityApi;\n secureNote: SecureNoteApi;\n favorite: boolean;\n edit: boolean;\n organizationUseTotp: boolean;\n revisionDate: Date;\n attachments: AttachmentResponse[];\n collectionIds: string[];\n\n constructor(response: any) {\n this.id = response.Id;\n this.organizationId = response.OrganizationId;\n this.folderId = response.FolderId || null;\n this.type = response.Type;\n this.name = response.Name;\n this.notes = response.Notes;\n this.favorite = response.Favorite || false;\n this.edit = response.Edit || true;\n this.organizationUseTotp = response.OrganizationUseTotp;\n this.revisionDate = new Date(response.RevisionDate);\n\n if (response.Login != null) {\n this.login = new LoginApi(response.Login);\n }\n\n if (response.Card != null) {\n this.card = new CardApi(response.Card);\n }\n\n if (response.Identity != null) {\n this.identity = new IdentityApi(response.Identity);\n }\n\n if (response.SecureNote != null) {\n this.secureNote = new SecureNoteApi(response.SecureNote);\n }\n\n if (response.Fields != null) {\n this.fields = [];\n response.Fields.forEach((field: any) => {\n this.fields.push(new FieldApi(field));\n });\n }\n\n if (response.Attachments != null) {\n this.attachments = [];\n response.Attachments.forEach((attachment: any) => {\n this.attachments.push(new AttachmentResponse(attachment));\n });\n }\n\n if (response.CollectionIds) {\n this.collectionIds = [];\n response.CollectionIds.forEach((id: string) => {\n this.collectionIds.push(id);\n });\n }\n }\n}\n","import { PaymentMethodType } from '../../enums/paymentMethodType';\n\nexport class BillingResponse {\n storageName: string;\n storageGb: number;\n maxStorageGb: number;\n paymentSource: BillingSourceResponse;\n subscription: BillingSubscriptionResponse;\n upcomingInvoice: BillingInvoiceResponse;\n charges: BillingChargeResponse[] = [];\n license: any;\n expiration: Date;\n\n constructor(response: any) {\n this.storageName = response.StorageName;\n this.storageGb = response.StorageGb;\n this.maxStorageGb = response.MaxStorageGb;\n this.paymentSource = response.PaymentSource == null ? null : new BillingSourceResponse(response.PaymentSource);\n this.subscription = response.Subscription == null ?\n null : new BillingSubscriptionResponse(response.Subscription);\n this.upcomingInvoice = response.UpcomingInvoice == null ?\n null : new BillingInvoiceResponse(response.UpcomingInvoice);\n if (response.Charges != null) {\n this.charges = response.Charges.map((c: any) => new BillingChargeResponse(c));\n }\n this.license = response.License;\n this.expiration = response.Expiration;\n }\n}\n\nexport class BillingSourceResponse {\n type: PaymentMethodType;\n cardBrand: string;\n description: string;\n needsVerification: boolean;\n\n constructor(response: any) {\n this.type = response.Type;\n this.cardBrand = response.CardBrand;\n this.description = response.Description;\n this.needsVerification = response.NeedsVerification;\n }\n}\n\nexport class BillingSubscriptionResponse {\n trialStartDate: Date;\n trialEndDate: Date;\n periodStartDate: Date;\n periodEndDate: Date;\n cancelledDate: Date;\n cancelAtEndDate: boolean;\n status: string;\n cancelled: boolean;\n items: BillingSubscriptionItemResponse[] = [];\n\n constructor(response: any) {\n this.trialEndDate = response.TrialStartDate;\n this.trialEndDate = response.TrialEndDate;\n this.periodStartDate = response.PeriodStartDate;\n this.periodEndDate = response.PeriodEndDate;\n this.cancelledDate = response.CancelledDate;\n this.cancelAtEndDate = response.CancelAtEndDate;\n this.status = response.Status;\n this.cancelled = response.Cancelled;\n if (response.Items != null) {\n this.items = response.Items.map((i: any) => new BillingSubscriptionItemResponse(i));\n }\n }\n}\n\nexport class BillingSubscriptionItemResponse {\n name: string;\n amount: number;\n quantity: number;\n interval: string;\n\n constructor(response: any) {\n this.name = response.Name;\n this.amount = response.Amount;\n this.quantity = response.Quantity;\n this.interval = response.Interval;\n }\n}\n\nexport class BillingInvoiceResponse {\n date: Date;\n amount: number;\n\n constructor(response: any) {\n this.date = response.Date;\n this.amount = response.Amount;\n }\n}\n\nexport class BillingChargeResponse {\n createdDate: Date;\n amount: number;\n paymentSource: BillingSourceResponse;\n status: string;\n failureMessage: string;\n refunded: boolean;\n partiallyRefunded: boolean;\n refundedAmount: number;\n invoiceId: string;\n\n constructor(response: any) {\n this.createdDate = response.CreatedDate;\n this.amount = response.Amount;\n this.paymentSource = response.PaymentSource != null ? new BillingSourceResponse(response.PaymentSource) : null;\n this.status = response.Status;\n this.failureMessage = response.FailureMessage;\n this.refunded = response.Refunded;\n this.partiallyRefunded = response.PartiallyRefunded;\n this.refundedAmount = response.RefundedAmount;\n this.invoiceId = response.InvoiceId;\n }\n}\n","import { DeviceType } from '../enums/deviceType';\r\n\r\nimport { ApiService as ApiServiceAbstraction } from '../abstractions/api.service';\r\nimport { PlatformUtilsService } from '../abstractions/platformUtils.service';\r\nimport { TokenService } from '../abstractions/token.service';\r\n\r\nimport { EnvironmentUrls } from '../models/domain/environmentUrls';\r\n\r\nimport { CipherBulkDeleteRequest } from '../models/request/cipherBulkDeleteRequest';\r\nimport { CipherBulkMoveRequest } from '../models/request/cipherBulkMoveRequest';\r\nimport { CipherBulkShareRequest } from '../models/request/cipherBulkShareRequest';\r\nimport { CipherCollectionsRequest } from '../models/request/cipherCollectionsRequest';\r\nimport { CipherRequest } from '../models/request/cipherRequest';\r\nimport { CipherShareRequest } from '../models/request/cipherShareRequest';\r\nimport { CollectionRequest } from '../models/request/collectionRequest';\r\nimport { DeleteRecoverRequest } from '../models/request/deleteRecoverRequest';\r\nimport { EmailRequest } from '../models/request/emailRequest';\r\nimport { EmailTokenRequest } from '../models/request/emailTokenRequest';\r\nimport { FolderRequest } from '../models/request/folderRequest';\r\nimport { GroupRequest } from '../models/request/groupRequest';\r\nimport { ImportCiphersRequest } from '../models/request/importCiphersRequest';\r\nimport { ImportDirectoryRequest } from '../models/request/importDirectoryRequest';\r\nimport { ImportOrganizationCiphersRequest } from '../models/request/importOrganizationCiphersRequest';\r\nimport { KeysRequest } from '../models/request/keysRequest';\r\nimport { OrganizationCreateRequest } from '../models/request/organizationCreateRequest';\r\nimport { OrganizationUpdateRequest } from '../models/request/organizationUpdateRequest';\r\nimport { OrganizationUserAcceptRequest } from '../models/request/organizationUserAcceptRequest';\r\nimport { OrganizationUserConfirmRequest } from '../models/request/organizationUserConfirmRequest';\r\nimport { OrganizationUserInviteRequest } from '../models/request/organizationUserInviteRequest';\r\nimport { OrganizationUserUpdateGroupsRequest } from '../models/request/organizationUserUpdateGroupsRequest';\r\nimport { OrganizationUserUpdateRequest } from '../models/request/organizationUserUpdateRequest';\r\nimport { PasswordHintRequest } from '../models/request/passwordHintRequest';\r\nimport { PasswordRequest } from '../models/request/passwordRequest';\r\nimport { PasswordVerificationRequest } from '../models/request/passwordVerificationRequest';\r\nimport { PaymentRequest } from '../models/request/paymentRequest';\r\nimport { RegisterRequest } from '../models/request/registerRequest';\r\nimport { SeatRequest } from '../models/request/seatRequest';\r\nimport { StorageRequest } from '../models/request/storageRequest';\r\nimport { TokenRequest } from '../models/request/tokenRequest';\r\nimport { TwoFactorEmailRequest } from '../models/request/twoFactorEmailRequest';\r\nimport { TwoFactorProviderRequest } from '../models/request/twoFactorProviderRequest';\r\nimport { TwoFactorRecoveryRequest } from '../models/request/twoFactorRecoveryRequest';\r\nimport { UpdateDomainsRequest } from '../models/request/updateDomainsRequest';\r\nimport { UpdateKeyRequest } from '../models/request/updateKeyRequest';\r\nimport { UpdateProfileRequest } from '../models/request/updateProfileRequest';\r\nimport { UpdateTwoFactorAuthenticatorRequest } from '../models/request/updateTwoFactorAuthenticatorRequest';\r\nimport { UpdateTwoFactorDuoRequest } from '../models/request/updateTwoFactorDuoRequest';\r\nimport { UpdateTwoFactorEmailRequest } from '../models/request/updateTwoFactorEmailRequest';\r\nimport { UpdateTwoFactorU2fRequest } from '../models/request/updateTwoFactorU2fRequest';\r\nimport { UpdateTwoFactorYubioOtpRequest } from '../models/request/updateTwoFactorYubioOtpRequest';\r\nimport { VerifyBankRequest } from '../models/request/verifyBankRequest';\r\nimport { VerifyDeleteRecoverRequest } from '../models/request/verifyDeleteRecoverRequest';\r\nimport { VerifyEmailRequest } from '../models/request/verifyEmailRequest';\r\n\r\nimport { BillingResponse } from '../models/response/billingResponse';\r\nimport { CipherResponse } from '../models/response/cipherResponse';\r\nimport {\r\n CollectionGroupDetailsResponse,\r\n CollectionResponse,\r\n} from '../models/response/collectionResponse';\r\nimport { CollectionUserResponse } from '../models/response/collectionUserResponse';\r\nimport { DomainsResponse } from '../models/response/domainsResponse';\r\nimport { ErrorResponse } from '../models/response/errorResponse';\r\nimport { EventResponse } from '../models/response/eventResponse';\r\nimport { FolderResponse } from '../models/response/folderResponse';\r\nimport {\r\n GroupDetailsResponse,\r\n GroupResponse,\r\n} from '../models/response/groupResponse';\r\nimport { GroupUserResponse } from '../models/response/groupUserResponse';\r\nimport { IdentityTokenResponse } from '../models/response/identityTokenResponse';\r\nimport { IdentityTwoFactorResponse } from '../models/response/identityTwoFactorResponse';\r\nimport { ListResponse } from '../models/response/listResponse';\r\nimport { OrganizationBillingResponse } from '../models/response/organizationBillingResponse';\r\nimport { OrganizationResponse } from '../models/response/organizationResponse';\r\nimport {\r\n OrganizationUserDetailsResponse,\r\n OrganizationUserUserDetailsResponse,\r\n} from '../models/response/organizationUserResponse';\r\nimport { ProfileResponse } from '../models/response/profileResponse';\r\nimport { SyncResponse } from '../models/response/syncResponse';\r\nimport { TwoFactorAuthenticatorResponse } from '../models/response/twoFactorAuthenticatorResponse';\r\nimport { TwoFactorDuoResponse } from '../models/response/twoFactorDuoResponse';\r\nimport { TwoFactorEmailResponse } from '../models/response/twoFactorEmailResponse';\r\nimport { TwoFactorProviderResponse } from '../models/response/twoFactorProviderResponse';\r\nimport { TwoFactorRecoverResponse } from '../models/response/twoFactorRescoverResponse';\r\nimport { TwoFactorU2fResponse } from '../models/response/twoFactorU2fResponse';\r\nimport { TwoFactorYubiKeyResponse } from '../models/response/twoFactorYubiKeyResponse';\r\nimport { UserKeyResponse } from '../models/response/userKeyResponse';\r\n\r\nexport class ApiService implements ApiServiceAbstraction {\r\n urlsSet: boolean = false;\r\n apiBaseUrl: string;\r\n identityBaseUrl: string;\r\n\r\n private deviceType: string;\r\n private isWebClient = false;\r\n private isDesktopClient = false;\r\n private usingBaseUrl = false;\r\n\r\n constructor(private tokenService: TokenService, private platformUtilsService: PlatformUtilsService,\r\n private logoutCallback: (expired: boolean) => Promise) {\r\n const device = platformUtilsService.getDevice();\r\n this.deviceType = device.toString();\r\n this.isWebClient = device === DeviceType.IEBrowser || device === DeviceType.ChromeBrowser ||\r\n device === DeviceType.EdgeBrowser || device === DeviceType.FirefoxBrowser ||\r\n device === DeviceType.OperaBrowser || device === DeviceType.SafariBrowser ||\r\n device === DeviceType.UnknownBrowser || device === DeviceType.VivaldiBrowser;\r\n this.isDesktopClient = device === DeviceType.WindowsDesktop || device === DeviceType.MacOsDesktop ||\r\n device === DeviceType.LinuxDesktop;\r\n }\r\n\r\n setUrls(urls: EnvironmentUrls): void {\r\n this.urlsSet = true;\r\n\r\n if (urls.base != null) {\r\n this.usingBaseUrl = true;\r\n this.apiBaseUrl = urls.base + '/api';\r\n this.identityBaseUrl = urls.base + '/identity';\r\n return;\r\n }\r\n\r\n if (urls.api != null && urls.identity != null) {\r\n this.apiBaseUrl = urls.api;\r\n this.identityBaseUrl = urls.identity;\r\n return;\r\n }\r\n\r\n /* tslint:disable */\r\n // Local Dev\r\n //this.apiBaseUrl = 'http://localhost:4000';\r\n //this.identityBaseUrl = 'http://localhost:33656';\r\n\r\n // Production\r\n this.apiBaseUrl = 'https://api.bitwarden.com';\r\n this.identityBaseUrl = 'https://identity.bitwarden.com';\r\n /* tslint:enable */\r\n }\r\n\r\n // Auth APIs\r\n\r\n async postIdentityToken(request: TokenRequest): Promise {\r\n const response = await this.fetch(new Request(this.identityBaseUrl + '/connect/token', {\r\n body: this.qsStringify(request.toIdentityToken(this.platformUtilsService.identityClientId)),\r\n credentials: this.getCredentials(),\r\n cache: 'no-cache',\r\n headers: new Headers({\r\n 'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8',\r\n 'Accept': 'application/json',\r\n 'Device-Type': this.deviceType,\r\n }),\r\n method: 'POST',\r\n }));\r\n\r\n let responseJson: any = null;\r\n const typeHeader = response.headers.get('content-type');\r\n if (typeHeader != null && typeHeader.indexOf('application/json') > -1) {\r\n responseJson = await response.json();\r\n }\r\n\r\n if (responseJson != null) {\r\n if (response.status === 200) {\r\n return new IdentityTokenResponse(responseJson);\r\n } else if (response.status === 400 && responseJson.TwoFactorProviders2 &&\r\n Object.keys(responseJson.TwoFactorProviders2).length) {\r\n await this.tokenService.clearTwoFactorToken(request.email);\r\n return new IdentityTwoFactorResponse(responseJson);\r\n }\r\n }\r\n\r\n return Promise.reject(new ErrorResponse(responseJson, response.status, true));\r\n }\r\n\r\n async refreshIdentityToken(): Promise {\r\n try {\r\n await this.doRefreshToken();\r\n } catch (e) {\r\n return Promise.reject(null);\r\n }\r\n }\r\n\r\n // Account APIs\r\n\r\n async getProfile(): Promise {\r\n const r = await this.send('GET', '/accounts/profile', null, true, true);\r\n return new ProfileResponse(r);\r\n }\r\n\r\n async getUserBilling(): Promise {\r\n const r = await this.send('GET', '/accounts/billing', null, true, true);\r\n return new BillingResponse(r);\r\n }\r\n\r\n async putProfile(request: UpdateProfileRequest): Promise {\r\n const r = await this.send('PUT', '/accounts/profile', request, true, true);\r\n return new ProfileResponse(r);\r\n }\r\n\r\n postEmailToken(request: EmailTokenRequest): Promise {\r\n return this.send('POST', '/accounts/email-token', request, true, false);\r\n }\r\n\r\n postEmail(request: EmailRequest): Promise {\r\n return this.send('POST', '/accounts/email', request, true, false);\r\n }\r\n\r\n postPassword(request: PasswordRequest): Promise {\r\n return this.send('POST', '/accounts/password', request, true, false);\r\n }\r\n\r\n postSecurityStamp(request: PasswordVerificationRequest): Promise {\r\n return this.send('POST', '/accounts/security-stamp', request, true, false);\r\n }\r\n\r\n deleteAccount(request: PasswordVerificationRequest): Promise {\r\n return this.send('DELETE', '/accounts', request, true, false);\r\n }\r\n\r\n async getAccountRevisionDate(): Promise {\r\n const r = await this.send('GET', '/accounts/revision-date', null, true, true);\r\n return r as number;\r\n }\r\n\r\n postPasswordHint(request: PasswordHintRequest): Promise {\r\n return this.send('POST', '/accounts/password-hint', request, false, false);\r\n }\r\n\r\n postRegister(request: RegisterRequest): Promise {\r\n return this.send('POST', '/accounts/register', request, false, false);\r\n }\r\n\r\n postPremium(data: FormData): Promise {\r\n return this.send('POST', '/accounts/premium', data, true, false);\r\n }\r\n\r\n postReinstatePremium(): Promise {\r\n return this.send('POST', '/accounts/reinstate-premium', null, true, false);\r\n }\r\n\r\n postCancelPremium(): Promise {\r\n return this.send('POST', '/accounts/cancel-premium', null, true, false);\r\n }\r\n\r\n postAccountStorage(request: StorageRequest): Promise {\r\n return this.send('POST', '/accounts/storage', request, true, false);\r\n }\r\n\r\n postAccountPayment(request: PaymentRequest): Promise {\r\n return this.send('POST', '/accounts/payment', request, true, false);\r\n }\r\n\r\n postAccountLicense(data: FormData): Promise {\r\n return this.send('POST', '/accounts/license', data, true, false);\r\n }\r\n\r\n postAccountKeys(request: KeysRequest): Promise {\r\n return this.send('POST', '/accounts/keys', request, true, false);\r\n }\r\n\r\n postAccountKey(request: UpdateKeyRequest): Promise {\r\n return this.send('POST', '/accounts/key', request, true, false);\r\n }\r\n\r\n postAccountVerifyEmail(): Promise {\r\n return this.send('POST', '/accounts/verify-email', null, true, false);\r\n }\r\n\r\n postAccountVerifyEmailToken(request: VerifyEmailRequest): Promise {\r\n return this.send('POST', '/accounts/verify-email-token', request, false, false);\r\n }\r\n\r\n postAccountRecoverDelete(request: DeleteRecoverRequest): Promise {\r\n return this.send('POST', '/accounts/delete-recover', request, false, false);\r\n }\r\n\r\n postAccountRecoverDeleteToken(request: VerifyDeleteRecoverRequest): Promise {\r\n return this.send('POST', '/accounts/delete-recover-token', request, false, false);\r\n }\r\n\r\n // Folder APIs\r\n\r\n async postFolder(request: FolderRequest): Promise {\r\n const r = await this.send('POST', '/folders', request, true, true);\r\n return new FolderResponse(r);\r\n }\r\n\r\n async putFolder(id: string, request: FolderRequest): Promise {\r\n const r = await this.send('PUT', '/folders/' + id, request, true, true);\r\n return new FolderResponse(r);\r\n }\r\n\r\n deleteFolder(id: string): Promise {\r\n return this.send('DELETE', '/folders/' + id, null, true, false);\r\n }\r\n\r\n // Cipher APIs\r\n\r\n async getCipher(id: string): Promise {\r\n const r = await this.send('GET', '/ciphers/' + id, null, true, true);\r\n return new CipherResponse(r);\r\n }\r\n\r\n async getCipherAdmin(id: string): Promise {\r\n const r = await this.send('GET', '/ciphers/' + id + '/admin', null, true, true);\r\n return new CipherResponse(r);\r\n }\r\n\r\n async getCiphersOrganization(organizationId: string): Promise> {\r\n const r = await this.send('GET', '/ciphers/organization-details?organizationId=' + organizationId,\r\n null, true, true);\r\n return new ListResponse(r, CipherResponse);\r\n }\r\n\r\n async postCipher(request: CipherRequest): Promise {\r\n const r = await this.send('POST', '/ciphers', request, true, true);\r\n return new CipherResponse(r);\r\n }\r\n\r\n async postCipherAdmin(request: CipherRequest): Promise {\r\n const r = await this.send('POST', '/ciphers/admin', request, true, true);\r\n return new CipherResponse(r);\r\n }\r\n\r\n async putCipher(id: string, request: CipherRequest): Promise {\r\n const r = await this.send('PUT', '/ciphers/' + id, request, true, true);\r\n return new CipherResponse(r);\r\n }\r\n\r\n async putCipherAdmin(id: string, request: CipherRequest): Promise {\r\n const r = await this.send('PUT', '/ciphers/' + id + '/admin', request, true, true);\r\n return new CipherResponse(r);\r\n }\r\n\r\n deleteCipher(id: string): Promise {\r\n return this.send('DELETE', '/ciphers/' + id, null, true, false);\r\n }\r\n\r\n deleteCipherAdmin(id: string): Promise {\r\n return this.send('DELETE', '/ciphers/' + id + '/admin', null, true, false);\r\n }\r\n\r\n deleteManyCiphers(request: CipherBulkDeleteRequest): Promise {\r\n return this.send('DELETE', '/ciphers', request, true, false);\r\n }\r\n\r\n putMoveCiphers(request: CipherBulkMoveRequest): Promise {\r\n return this.send('PUT', '/ciphers/move', request, true, false);\r\n }\r\n\r\n putShareCipher(id: string, request: CipherShareRequest): Promise {\r\n return this.send('PUT', '/ciphers/' + id + '/share', request, true, false);\r\n }\r\n\r\n putShareCiphers(request: CipherBulkShareRequest): Promise {\r\n return this.send('PUT', '/ciphers/share', request, true, false);\r\n }\r\n\r\n putCipherCollections(id: string, request: CipherCollectionsRequest): Promise {\r\n return this.send('PUT', '/ciphers/' + id + '/collections', request, true, false);\r\n }\r\n\r\n putCipherCollectionsAdmin(id: string, request: CipherCollectionsRequest): Promise {\r\n return this.send('PUT', '/ciphers/' + id + '/collections-admin', request, true, false);\r\n }\r\n\r\n postPurgeCiphers(request: PasswordVerificationRequest): Promise {\r\n return this.send('POST', '/ciphers/purge', request, true, false);\r\n }\r\n\r\n postImportCiphers(request: ImportCiphersRequest): Promise {\r\n return this.send('POST', '/ciphers/import', request, true, false);\r\n }\r\n\r\n postImportOrganizationCiphers(organizationId: string, request: ImportOrganizationCiphersRequest): Promise {\r\n return this.send('POST', '/ciphers/import-organization?organizationId=' + organizationId, request, true, false);\r\n }\r\n\r\n // Attachments APIs\r\n\r\n async postCipherAttachment(id: string, data: FormData): Promise {\r\n const r = await this.send('POST', '/ciphers/' + id + '/attachment', data, true, true);\r\n return new CipherResponse(r);\r\n }\r\n\r\n async postCipherAttachmentAdmin(id: string, data: FormData): Promise {\r\n const r = await this.send('POST', '/ciphers/' + id + '/attachment-admin', data, true, true);\r\n return new CipherResponse(r);\r\n }\r\n\r\n deleteCipherAttachment(id: string, attachmentId: string): Promise {\r\n return this.send('DELETE', '/ciphers/' + id + '/attachment/' + attachmentId, null, true, false);\r\n }\r\n\r\n deleteCipherAttachmentAdmin(id: string, attachmentId: string): Promise {\r\n return this.send('DELETE', '/ciphers/' + id + '/attachment/' + attachmentId + '/admin', null, true, false);\r\n }\r\n\r\n postShareCipherAttachment(id: string, attachmentId: string, data: FormData,\r\n organizationId: string): Promise {\r\n return this.send('POST', '/ciphers/' + id + '/attachment/' +\r\n attachmentId + '/share?organizationId=' + organizationId, data, true, false);\r\n }\r\n\r\n // Collections APIs\r\n\r\n async getCollectionDetails(organizationId: string, id: string): Promise {\r\n const r = await this.send('GET', '/organizations/' + organizationId + '/collections/' + id + '/details',\r\n null, true, true);\r\n return new CollectionGroupDetailsResponse(r);\r\n }\r\n\r\n async getCollections(organizationId: string): Promise> {\r\n const r = await this.send('GET', '/organizations/' + organizationId + '/collections', null, true, true);\r\n return new ListResponse(r, CollectionResponse);\r\n }\r\n\r\n async getCollectionUsers(organizationId: string, id: string): Promise> {\r\n const r = await this.send('GET', '/organizations/' + organizationId + '/collections/' + id + '/users',\r\n null, true, true);\r\n return new ListResponse(r, CollectionUserResponse);\r\n }\r\n\r\n async postCollection(organizationId: string, request: CollectionRequest): Promise {\r\n const r = await this.send('POST', '/organizations/' + organizationId + '/collections', request, true, true);\r\n return new CollectionResponse(r);\r\n }\r\n\r\n async putCollection(organizationId: string, id: string, request: CollectionRequest): Promise {\r\n const r = await this.send('PUT', '/organizations/' + organizationId + '/collections/' + id,\r\n request, true, true);\r\n return new CollectionResponse(r);\r\n }\r\n\r\n deleteCollection(organizationId: string, id: string): Promise {\r\n return this.send('DELETE', '/organizations/' + organizationId + '/collections/' + id, null, true, false);\r\n }\r\n\r\n deleteCollectionUser(organizationId: string, id: string, organizationUserId: string): Promise {\r\n return this.send('DELETE',\r\n '/organizations/' + organizationId + '/collections/' + id + '/user/' + organizationUserId,\r\n null, true, false);\r\n }\r\n\r\n // Groups APIs\r\n\r\n async getGroupDetails(organizationId: string, id: string): Promise {\r\n const r = await this.send('GET', '/organizations/' + organizationId + '/groups/' + id + '/details',\r\n null, true, true);\r\n return new GroupDetailsResponse(r);\r\n }\r\n\r\n async getGroups(organizationId: string): Promise> {\r\n const r = await this.send('GET', '/organizations/' + organizationId + '/groups', null, true, true);\r\n return new ListResponse(r, GroupResponse);\r\n }\r\n\r\n async getGroupUsers(organizationId: string, id: string): Promise> {\r\n const r = await this.send('GET', '/organizations/' + organizationId + '/groups/' + id + '/users',\r\n null, true, true);\r\n return new ListResponse(r, GroupUserResponse);\r\n }\r\n\r\n async postGroup(organizationId: string, request: GroupRequest): Promise {\r\n const r = await this.send('POST', '/organizations/' + organizationId + '/groups', request, true, true);\r\n return new GroupResponse(r);\r\n }\r\n\r\n async putGroup(organizationId: string, id: string, request: GroupRequest): Promise {\r\n const r = await this.send('PUT', '/organizations/' + organizationId + '/groups/' + id, request, true, true);\r\n return new GroupResponse(r);\r\n }\r\n\r\n deleteGroup(organizationId: string, id: string): Promise {\r\n return this.send('DELETE', '/organizations/' + organizationId + '/groups/' + id, null, true, false);\r\n }\r\n\r\n deleteGroupUser(organizationId: string, id: string, organizationUserId: string): Promise {\r\n return this.send('DELETE',\r\n '/organizations/' + organizationId + '/groups/' + id + '/user/' + organizationUserId, null, true, false);\r\n }\r\n\r\n // Organization User APIs\r\n\r\n async getOrganizationUser(organizationId: string, id: string): Promise {\r\n const r = await this.send('GET', '/organizations/' + organizationId + '/users/' + id, null, true, true);\r\n return new OrganizationUserDetailsResponse(r);\r\n }\r\n\r\n async getOrganizationUserGroups(organizationId: string, id: string): Promise {\r\n const r = await this.send('GET', '/organizations/' + organizationId + '/users/' + id + '/groups',\r\n null, true, true);\r\n return r;\r\n }\r\n\r\n async getOrganizationUsers(organizationId: string): Promise> {\r\n const r = await this.send('GET', '/organizations/' + organizationId + '/users', null, true, true);\r\n return new ListResponse(r, OrganizationUserUserDetailsResponse);\r\n }\r\n\r\n postOrganizationUserInvite(organizationId: string, request: OrganizationUserInviteRequest): Promise {\r\n return this.send('POST', '/organizations/' + organizationId + '/users/invite', request, true, false);\r\n }\r\n\r\n postOrganizationUserReinvite(organizationId: string, id: string): Promise {\r\n return this.send('POST', '/organizations/' + organizationId + '/users/' + id + '/reinvite', null, true, false);\r\n }\r\n\r\n postOrganizationUserAccept(organizationId: string, id: string,\r\n request: OrganizationUserAcceptRequest): Promise {\r\n return this.send('POST', '/organizations/' + organizationId + '/users/' + id + '/accept', request, true, false);\r\n }\r\n\r\n postOrganizationUserConfirm(organizationId: string, id: string,\r\n request: OrganizationUserConfirmRequest): Promise {\r\n return this.send('POST', '/organizations/' + organizationId + '/users/' + id + '/confirm',\r\n request, true, false);\r\n }\r\n\r\n putOrganizationUser(organizationId: string, id: string, request: OrganizationUserUpdateRequest): Promise {\r\n return this.send('PUT', '/organizations/' + organizationId + '/users/' + id, request, true, false);\r\n }\r\n\r\n putOrganizationUserGroups(organizationId: string, id: string,\r\n request: OrganizationUserUpdateGroupsRequest): Promise {\r\n return this.send('PUT', '/organizations/' + organizationId + '/users/' + id + '/groups', request, true, false);\r\n }\r\n\r\n deleteOrganizationUser(organizationId: string, id: string): Promise {\r\n return this.send('DELETE', '/organizations/' + organizationId + '/users/' + id, null, true, false);\r\n }\r\n\r\n // Sync APIs\r\n\r\n async getSync(): Promise {\r\n const path = this.isDesktopClient || this.isWebClient ? '/sync?excludeDomains=true' : '/sync';\r\n const r = await this.send('GET', path, null, true, true);\r\n return new SyncResponse(r);\r\n }\r\n\r\n async postImportDirectory(organizationId: string, request: ImportDirectoryRequest): Promise {\r\n return this.send('POST', '/organizations/' + organizationId + '/import', request, true, false);\r\n }\r\n\r\n // Settings APIs\r\n\r\n async getSettingsDomains(): Promise {\r\n const r = await this.send('GET', '/settings/domains', null, true, true);\r\n return new DomainsResponse(r);\r\n }\r\n\r\n async putSettingsDomains(request: UpdateDomainsRequest): Promise {\r\n const r = await this.send('PUT', '/settings/domains', request, true, true);\r\n return new DomainsResponse(r);\r\n }\r\n\r\n // Two-factor APIs\r\n\r\n async getTwoFactorProviders(): Promise> {\r\n const r = await this.send('GET', '/two-factor', null, true, true);\r\n return new ListResponse(r, TwoFactorProviderResponse);\r\n }\r\n\r\n async getTwoFactorOrganizationProviders(organizationId: string): Promise> {\r\n const r = await this.send('GET', '/organizations/' + organizationId + '/two-factor', null, true, true);\r\n return new ListResponse(r, TwoFactorProviderResponse);\r\n }\r\n\r\n async getTwoFactorAuthenticator(request: PasswordVerificationRequest): Promise {\r\n const r = await this.send('POST', '/two-factor/get-authenticator', request, true, true);\r\n return new TwoFactorAuthenticatorResponse(r);\r\n }\r\n\r\n async getTwoFactorEmail(request: PasswordVerificationRequest): Promise {\r\n const r = await this.send('POST', '/two-factor/get-email', request, true, true);\r\n return new TwoFactorEmailResponse(r);\r\n }\r\n\r\n async getTwoFactorDuo(request: PasswordVerificationRequest): Promise {\r\n const r = await this.send('POST', '/two-factor/get-duo', request, true, true);\r\n return new TwoFactorDuoResponse(r);\r\n }\r\n\r\n async getTwoFactorOrganizationDuo(organizationId: string,\r\n request: PasswordVerificationRequest): Promise {\r\n const r = await this.send('POST', '/organizations/' + organizationId + '/two-factor/get-duo',\r\n request, true, true);\r\n return new TwoFactorDuoResponse(r);\r\n }\r\n\r\n async getTwoFactorYubiKey(request: PasswordVerificationRequest): Promise {\r\n const r = await this.send('POST', '/two-factor/get-yubikey', request, true, true);\r\n return new TwoFactorYubiKeyResponse(r);\r\n }\r\n\r\n async getTwoFactorU2f(request: PasswordVerificationRequest): Promise {\r\n const r = await this.send('POST', '/two-factor/get-u2f', request, true, true);\r\n return new TwoFactorU2fResponse(r);\r\n }\r\n\r\n async getTwoFactorRecover(request: PasswordVerificationRequest): Promise {\r\n const r = await this.send('POST', '/two-factor/get-recover', request, true, true);\r\n return new TwoFactorRecoverResponse(r);\r\n }\r\n\r\n async putTwoFactorAuthenticator(\r\n request: UpdateTwoFactorAuthenticatorRequest): Promise {\r\n const r = await this.send('PUT', '/two-factor/authenticator', request, true, true);\r\n return new TwoFactorAuthenticatorResponse(r);\r\n }\r\n\r\n async putTwoFactorEmail(request: UpdateTwoFactorEmailRequest): Promise {\r\n const r = await this.send('PUT', '/two-factor/email', request, true, true);\r\n return new TwoFactorEmailResponse(r);\r\n }\r\n\r\n async putTwoFactorDuo(request: UpdateTwoFactorDuoRequest): Promise {\r\n const r = await this.send('PUT', '/two-factor/duo', request, true, true);\r\n return new TwoFactorDuoResponse(r);\r\n }\r\n\r\n async putTwoFactorOrganizationDuo(organizationId: string,\r\n request: UpdateTwoFactorDuoRequest): Promise {\r\n const r = await this.send('PUT', '/organizations/' + organizationId + '/two-factor/duo', request, true, true);\r\n return new TwoFactorDuoResponse(r);\r\n }\r\n\r\n async putTwoFactorYubiKey(request: UpdateTwoFactorYubioOtpRequest): Promise {\r\n const r = await this.send('PUT', '/two-factor/yubikey', request, true, true);\r\n return new TwoFactorYubiKeyResponse(r);\r\n }\r\n\r\n async putTwoFactorU2f(request: UpdateTwoFactorU2fRequest): Promise {\r\n const r = await this.send('PUT', '/two-factor/u2f', request, true, true);\r\n return new TwoFactorU2fResponse(r);\r\n }\r\n\r\n async putTwoFactorDisable(request: TwoFactorProviderRequest): Promise {\r\n const r = await this.send('PUT', '/two-factor/disable', request, true, true);\r\n return new TwoFactorProviderResponse(r);\r\n }\r\n\r\n async putTwoFactorOrganizationDisable(organizationId: string,\r\n request: TwoFactorProviderRequest): Promise {\r\n const r = await this.send('PUT', '/organizations/' + organizationId + '/two-factor/disable',\r\n request, true, true);\r\n return new TwoFactorProviderResponse(r);\r\n }\r\n\r\n postTwoFactorRecover(request: TwoFactorRecoveryRequest): Promise {\r\n return this.send('POST', '/two-factor/recover', request, false, false);\r\n }\r\n\r\n postTwoFactorEmailSetup(request: TwoFactorEmailRequest): Promise {\r\n return this.send('POST', '/two-factor/send-email', request, true, false);\r\n }\r\n\r\n postTwoFactorEmail(request: TwoFactorEmailRequest): Promise {\r\n return this.send('POST', '/two-factor/send-email-login', request, false, false);\r\n }\r\n\r\n // Organization APIs\r\n\r\n async getOrganization(id: string): Promise {\r\n const r = await this.send('GET', '/organizations/' + id, null, true, true);\r\n return new OrganizationResponse(r);\r\n }\r\n\r\n async getOrganizationBilling(id: string): Promise {\r\n const r = await this.send('GET', '/organizations/' + id + '/billing', null, true, true);\r\n return new OrganizationBillingResponse(r);\r\n }\r\n\r\n async getOrganizationLicense(id: string, installationId: string): Promise {\r\n return this.send('GET', '/organizations/' + id + '/license?installationId=' + installationId,\r\n null, true, true);\r\n }\r\n\r\n async postOrganization(request: OrganizationCreateRequest): Promise {\r\n const r = await this.send('POST', '/organizations', request, true, true);\r\n return new OrganizationResponse(r);\r\n }\r\n\r\n async putOrganization(id: string, request: OrganizationUpdateRequest): Promise {\r\n const r = await this.send('PUT', '/organizations/' + id, request, true, true);\r\n return new OrganizationResponse(r);\r\n }\r\n\r\n postLeaveOrganization(id: string): Promise {\r\n return this.send('POST', '/organizations/' + id + '/leave', null, true, false);\r\n }\r\n\r\n async postOrganizationLicense(data: FormData): Promise {\r\n const r = await this.send('POST', '/organizations/license', data, true, true);\r\n return new OrganizationResponse(r);\r\n }\r\n\r\n async postOrganizationLicenseUpdate(id: string, data: FormData): Promise {\r\n return this.send('POST', '/organizations/' + id + '/license', data, true, false);\r\n }\r\n\r\n postOrganizationSeat(id: string, request: SeatRequest): Promise {\r\n return this.send('POST', '/organizations/' + id + '/seat', request, true, false);\r\n }\r\n\r\n postOrganizationStorage(id: string, request: StorageRequest): Promise {\r\n return this.send('POST', '/organizations/' + id + '/storage', request, true, false);\r\n }\r\n\r\n postOrganizationPayment(id: string, request: PaymentRequest): Promise {\r\n return this.send('POST', '/organizations/' + id + '/payment', request, true, false);\r\n }\r\n\r\n postOrganizationVerifyBank(id: string, request: VerifyBankRequest): Promise {\r\n return this.send('POST', '/organizations/' + id + '/verify-bank', request, true, false);\r\n }\r\n\r\n postOrganizationCancel(id: string): Promise {\r\n return this.send('POST', '/organizations/' + id + '/cancel', null, true, false);\r\n }\r\n\r\n postOrganizationReinstate(id: string): Promise {\r\n return this.send('POST', '/organizations/' + id + '/reinstate', null, true, false);\r\n }\r\n\r\n deleteOrganization(id: string, request: PasswordVerificationRequest): Promise {\r\n return this.send('DELETE', '/organizations/' + id, request, true, false);\r\n }\r\n\r\n // Event APIs\r\n\r\n async getEvents(start: string, end: string, token: string): Promise> {\r\n const r = await this.send('GET', this.addEventParameters('/events', start, end, token), null, true, true);\r\n return new ListResponse(r, EventResponse);\r\n }\r\n\r\n async getEventsCipher(id: string, start: string, end: string,\r\n token: string): Promise> {\r\n const r = await this.send('GET', this.addEventParameters('/ciphers/' + id + '/events', start, end, token),\r\n null, true, true);\r\n return new ListResponse(r, EventResponse);\r\n }\r\n\r\n async getEventsOrganization(id: string, start: string, end: string,\r\n token: string): Promise> {\r\n const r = await this.send('GET', this.addEventParameters('/organizations/' + id + '/events', start, end, token),\r\n null, true, true);\r\n return new ListResponse(r, EventResponse);\r\n }\r\n\r\n async getEventsOrganizationUser(organizationId: string, id: string,\r\n start: string, end: string, token: string): Promise> {\r\n const r = await this.send('GET',\r\n this.addEventParameters('/organizations/' + organizationId + '/users/' + id + '/events', start, end, token),\r\n null, true, true);\r\n return new ListResponse(r, EventResponse);\r\n }\r\n\r\n // User APIs\r\n\r\n async getUserPublicKey(id: string): Promise {\r\n const r = await this.send('GET', '/users/' + id + '/public-key', null, true, true);\r\n return new UserKeyResponse(r);\r\n }\r\n\r\n // Helpers\r\n\r\n fetch(request: Request): Promise {\r\n if (request.method === 'GET') {\r\n request.headers.set('Cache-Control', 'no-cache');\r\n request.headers.set('Pragma', 'no-cache');\r\n }\r\n return fetch(request);\r\n }\r\n\r\n private async send(method: 'GET' | 'POST' | 'PUT' | 'DELETE', path: string, body: any,\r\n authed: boolean, hasResponse: boolean): Promise {\r\n const headers = new Headers({\r\n 'Device-Type': this.deviceType,\r\n });\r\n\r\n const requestInit: RequestInit = {\r\n cache: 'no-cache',\r\n credentials: this.getCredentials(),\r\n method: method,\r\n };\r\n\r\n if (authed) {\r\n const authHeader = await this.handleTokenState();\r\n headers.set('Authorization', authHeader);\r\n }\r\n if (body != null) {\r\n if (typeof body === 'string') {\r\n requestInit.body = body;\r\n headers.set('Content-Type', 'application/x-www-form-urlencoded; charset=utf-8');\r\n } else if (typeof body === 'object') {\r\n if (body instanceof FormData) {\r\n requestInit.body = body;\r\n } else {\r\n headers.set('Content-Type', 'application/json; charset=utf-8');\r\n requestInit.body = JSON.stringify(body);\r\n }\r\n }\r\n }\r\n if (hasResponse) {\r\n headers.set('Accept', 'application/json');\r\n }\r\n\r\n requestInit.headers = headers;\r\n const response = await this.fetch(new Request(this.apiBaseUrl + path, requestInit));\r\n\r\n if (hasResponse && response.status === 200) {\r\n const responseJson = await response.json();\r\n return responseJson;\r\n } else if (response.status !== 200) {\r\n const error = await this.handleError(response, false);\r\n return Promise.reject(error);\r\n }\r\n }\r\n\r\n private async handleError(response: Response, tokenError: boolean): Promise {\r\n if ((tokenError && response.status === 400) || response.status === 401 || response.status === 403) {\r\n await this.logoutCallback(true);\r\n return null;\r\n }\r\n\r\n let responseJson: any = null;\r\n const typeHeader = response.headers.get('content-type');\r\n if (typeHeader != null && typeHeader.indexOf('application/json') > -1) {\r\n responseJson = await response.json();\r\n }\r\n\r\n return new ErrorResponse(responseJson, response.status, tokenError);\r\n }\r\n\r\n private async handleTokenState(): Promise {\r\n let accessToken = await this.tokenService.getToken();\r\n if (this.tokenService.tokenNeedsRefresh()) {\r\n const tokenResponse = await this.doRefreshToken();\r\n accessToken = tokenResponse.accessToken;\r\n }\r\n\r\n return 'Bearer ' + accessToken;\r\n }\r\n\r\n private async doRefreshToken(): Promise {\r\n const refreshToken = await this.tokenService.getRefreshToken();\r\n if (refreshToken == null || refreshToken === '') {\r\n throw new Error();\r\n }\r\n\r\n const decodedToken = this.tokenService.decodeToken();\r\n const response = await this.fetch(new Request(this.identityBaseUrl + '/connect/token', {\r\n body: this.qsStringify({\r\n grant_type: 'refresh_token',\r\n client_id: decodedToken.client_id,\r\n refresh_token: refreshToken,\r\n }),\r\n cache: 'no-cache',\r\n credentials: this.getCredentials(),\r\n headers: new Headers({\r\n 'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8',\r\n 'Accept': 'application/json',\r\n 'Device-Type': this.deviceType,\r\n }),\r\n method: 'POST',\r\n }));\r\n\r\n if (response.status === 200) {\r\n const responseJson = await response.json();\r\n const tokenResponse = new IdentityTokenResponse(responseJson);\r\n await this.tokenService.setTokens(tokenResponse.accessToken, tokenResponse.refreshToken);\r\n return tokenResponse;\r\n } else {\r\n const error = await this.handleError(response, true);\r\n return Promise.reject(error);\r\n }\r\n }\r\n\r\n private qsStringify(params: any): string {\r\n return Object.keys(params).map((key) => {\r\n return encodeURIComponent(key) + '=' + encodeURIComponent(params[key]);\r\n }).join('&');\r\n }\r\n\r\n private getCredentials(): RequestCredentials {\r\n if (!this.isWebClient || this.usingBaseUrl) {\r\n return 'include';\r\n }\r\n return undefined;\r\n }\r\n\r\n private addEventParameters(base: string, start: string, end: string, token: string) {\r\n if (start != null) {\r\n base += ('?start=' + start);\r\n }\r\n if (end != null) {\r\n base += (base.indexOf('?') > -1 ? '&' : '?');\r\n base += ('end=' + end);\r\n }\r\n if (token != null) {\r\n base += (base.indexOf('?') > -1 ? '&' : '?');\r\n base += ('continuationToken=' + token);\r\n }\r\n return base;\r\n }\r\n}\r\n","import {\r\n Directive,\r\n ElementRef,\r\n forwardRef,\r\n HostListener,\r\n Input,\r\n Renderer2,\r\n} from '@angular/core';\r\nimport {\r\n ControlValueAccessor,\r\n NG_VALUE_ACCESSOR,\r\n NgControl,\r\n} from '@angular/forms';\r\n\r\n// ref: https://juristr.com/blog/2018/02/ng-true-value-directive/\r\n@Directive({\r\n selector: 'input[type=checkbox][appTrueFalseValue]',\r\n providers: [\r\n {\r\n provide: NG_VALUE_ACCESSOR,\r\n useExisting: forwardRef(() => TrueFalseValueDirective),\r\n multi: true,\r\n },\r\n ],\r\n})\r\nexport class TrueFalseValueDirective implements ControlValueAccessor {\r\n @Input() trueValue = true;\r\n @Input() falseValue = false;\r\n\r\n constructor(private elementRef: ElementRef, private renderer: Renderer2) { }\r\n\r\n @HostListener('change', ['$event'])\r\n onHostChange(ev: any) {\r\n this.propagateChange(ev.target.checked ? this.trueValue : this.falseValue);\r\n }\r\n\r\n writeValue(obj: any): void {\r\n if (obj === this.trueValue) {\r\n this.renderer.setProperty(this.elementRef.nativeElement, 'checked', true);\r\n } else {\r\n this.renderer.setProperty(this.elementRef.nativeElement, 'checked', false);\r\n }\r\n }\r\n\r\n registerOnChange(fn: any): void {\r\n this.propagateChange = fn;\r\n }\r\n\r\n registerOnTouched(fn: any): void { /* nothing */ }\r\n\r\n setDisabledState?(isDisabled: boolean): void { /* nothing */ }\r\n\r\n private propagateChange = (_: any) => { /* nothing */ };\r\n}\r\n","import {\r\n Directive,\r\n ElementRef,\r\n HostListener,\r\n OnInit,\r\n} from '@angular/core';\r\n\r\n@Directive({\r\n selector: '[appBoxRow]',\r\n})\r\nexport class BoxRowDirective implements OnInit {\r\n el: HTMLElement = null;\r\n formEls: Element[];\r\n\r\n constructor(private elRef: ElementRef) {\r\n this.el = elRef.nativeElement;\r\n }\r\n\r\n ngOnInit(): void {\r\n this.formEls = Array.from(this.el.querySelectorAll('input:not([type=\"hidden\"]), select, textarea'));\r\n this.formEls.forEach((formEl) => {\r\n formEl.addEventListener('focus', (event: Event) => {\r\n this.el.classList.add('active');\r\n }, false);\r\n\r\n formEl.addEventListener('blur', (event: Event) => {\r\n this.el.classList.remove('active');\r\n }, false);\r\n });\r\n }\r\n\r\n @HostListener('click', ['$event']) onClick(event: Event) {\r\n if (event.target !== this.el) {\r\n return;\r\n }\r\n\r\n if (this.formEls.length > 0) {\r\n const formEl = (this.formEls[0] as HTMLElement);\r\n if (formEl.tagName.toLowerCase() === 'input') {\r\n const inputEl = (formEl as HTMLInputElement);\r\n if (inputEl.type != null && inputEl.type.toLowerCase() === 'checkbox') {\r\n inputEl.click();\r\n return;\r\n }\r\n }\r\n formEl.focus();\r\n }\r\n }\r\n}\r\n","import {\n Component,\n EventEmitter,\n Input,\n Output,\n} from '@angular/core';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\n\nimport { SeatRequest } from 'jslib/models/request/seatRequest';\n\n@Component({\n selector: 'app-adjust-seats',\n templateUrl: 'adjust-seats.component.html',\n})\nexport class AdjustSeatsComponent {\n @Input() seatPrice = 0;\n @Input() add = true;\n @Input() organizationId: string;\n @Input() interval = 'year';\n @Output() onAdjusted = new EventEmitter();\n @Output() onCanceled = new EventEmitter();\n\n seatAdjustment = 0;\n formPromise: Promise;\n\n constructor(private apiService: ApiService, private i18nService: I18nService,\n private analytics: Angulartics2, private toasterService: ToasterService) { }\n\n async submit() {\n try {\n const request = new SeatRequest();\n request.seatAdjustment = this.seatAdjustment;\n if (!this.add) {\n request.seatAdjustment *= -1;\n }\n\n this.formPromise = this.apiService.postOrganizationSeat(this.organizationId, request);\n await this.formPromise;\n this.analytics.eventTrack.next({ action: this.add ? 'Added Seats' : 'Removed Seats' });\n this.toasterService.popAsync('success', null,\n this.i18nService.t('adjustedSeats', request.seatAdjustment.toString()));\n this.onAdjusted.emit(this.seatAdjustment);\n } catch { }\n }\n\n cancel() {\n this.onCanceled.emit();\n }\n\n get adjustedSeatTotal(): number {\n return this.seatAdjustment * this.seatAdjustment;\n }\n}\n","import { Component } from '@angular/core';\nimport { Router } from '@angular/router';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { CryptoService } from 'jslib/abstractions/crypto.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\n\nimport { PasswordVerificationRequest } from 'jslib/models/request/passwordVerificationRequest';\n\n@Component({\n selector: 'app-delete-organization',\n templateUrl: 'delete-organization.component.html',\n})\nexport class DeleteOrganizationComponent {\n organizationId: string;\n\n masterPassword: string;\n formPromise: Promise;\n\n constructor(private apiService: ApiService, private i18nService: I18nService,\n private analytics: Angulartics2, private toasterService: ToasterService,\n private cryptoService: CryptoService, private router: Router) { }\n\n async submit() {\n if (this.masterPassword == null || this.masterPassword === '') {\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'),\n this.i18nService.t('masterPassRequired'));\n return;\n }\n\n const request = new PasswordVerificationRequest();\n request.masterPasswordHash = await this.cryptoService.hashPassword(this.masterPassword, null);\n try {\n this.formPromise = this.apiService.deleteOrganization(this.organizationId, request);\n await this.formPromise;\n this.analytics.eventTrack.next({ action: 'Deleted Organization' });\n this.toasterService.popAsync('success', this.i18nService.t('organizationDeleted'),\n this.i18nService.t('organizationDeletedDesc'));\n this.router.navigate(['/']);\n } catch { }\n }\n}\n","import {\n Component,\n EventEmitter,\n Input,\n OnInit,\n Output,\n} from '@angular/core';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\n\nimport { OrganizationUserUpdateGroupsRequest } from 'jslib/models/request/organizationUserUpdateGroupsRequest';\nimport { GroupResponse } from 'jslib/models/response/groupResponse';\n\nimport { Utils } from 'jslib/misc/utils';\n\n@Component({\n selector: 'app-user-groups',\n templateUrl: 'user-groups.component.html',\n})\nexport class UserGroupsComponent implements OnInit {\n @Input() name: string;\n @Input() organizationUserId: string;\n @Input() organizationId: string;\n @Output() onSavedUser = new EventEmitter();\n\n loading = true;\n groups: GroupResponse[] = [];\n formPromise: Promise;\n\n constructor(private apiService: ApiService, private i18nService: I18nService,\n private analytics: Angulartics2, private toasterService: ToasterService) { }\n\n async ngOnInit() {\n const groupsResponse = await this.apiService.getGroups(this.organizationId);\n const groups = groupsResponse.data.map((r) => r);\n groups.sort(Utils.getSortFunction(this.i18nService, 'name'));\n this.groups = groups;\n\n try {\n const userGroups = await this.apiService.getOrganizationUserGroups(\n this.organizationId, this.organizationUserId);\n if (userGroups != null && this.groups != null) {\n userGroups.forEach((ug) => {\n const group = this.groups.filter((g) => g.id === ug);\n if (group != null && group.length > 0) {\n (group[0] as any).checked = true;\n }\n });\n }\n } catch { }\n\n this.loading = false;\n }\n\n check(g: GroupResponse, select?: boolean) {\n (g as any).checked = select == null ? !(g as any).checked : select;\n if (!(g as any).checked) {\n (g as any).readOnly = false;\n }\n }\n\n selectAll(select: boolean) {\n this.groups.forEach((g) => this.check(g, select));\n }\n\n async submit() {\n const request = new OrganizationUserUpdateGroupsRequest();\n request.groupIds = this.groups.filter((g) => (g as any).checked).map((g) => g.id);\n\n try {\n this.formPromise = this.apiService.putOrganizationUserGroups(this.organizationId, this.organizationUserId,\n request);\n await this.formPromise;\n this.analytics.eventTrack.next({ action: 'Edited User Groups' });\n this.toasterService.popAsync('success', null, this.i18nService.t('editedGroupsForUser', this.name));\n this.onSavedUser.emit();\n } catch { }\n }\n}\n","import {\r\n Component,\r\n EventEmitter,\r\n Input,\r\n OnInit,\r\n Output,\r\n} from '@angular/core';\r\n\r\nimport { ToasterService } from 'angular2-toaster';\r\nimport { Angulartics2 } from 'angulartics2';\r\n\r\nimport { ApiService } from 'jslib/abstractions/api.service';\r\nimport { CollectionService } from 'jslib/abstractions/collection.service';\r\nimport { I18nService } from 'jslib/abstractions/i18n.service';\r\nimport { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';\r\n\r\nimport { CollectionData } from 'jslib/models/data/collectionData';\r\nimport { Collection } from 'jslib/models/domain/collection';\r\nimport { OrganizationUserInviteRequest } from 'jslib/models/request/organizationUserInviteRequest';\r\nimport { OrganizationUserUpdateRequest } from 'jslib/models/request/organizationUserUpdateRequest';\r\nimport { SelectionReadOnlyRequest } from 'jslib/models/request/selectionReadOnlyRequest';\r\nimport { CollectionDetailsResponse } from 'jslib/models/response/collectionResponse';\r\nimport { CollectionView } from 'jslib/models/view/collectionView';\r\n\r\nimport { OrganizationUserType } from 'jslib/enums/organizationUserType';\r\n\r\n@Component({\r\n selector: 'app-user-add-edit',\r\n templateUrl: 'user-add-edit.component.html',\r\n})\r\nexport class UserAddEditComponent implements OnInit {\r\n @Input() name: string;\r\n @Input() organizationUserId: string;\r\n @Input() organizationId: string;\r\n @Output() onSavedUser = new EventEmitter();\r\n @Output() onDeletedUser = new EventEmitter();\r\n\r\n loading = true;\r\n editMode: boolean = false;\r\n title: string;\r\n emails: string;\r\n type: OrganizationUserType = OrganizationUserType.User;\r\n access: 'all' | 'selected' = 'selected';\r\n collections: CollectionView[] = [];\r\n formPromise: Promise;\r\n deletePromise: Promise;\r\n organizationUserType = OrganizationUserType;\r\n\r\n constructor(private apiService: ApiService, private i18nService: I18nService,\r\n private analytics: Angulartics2, private toasterService: ToasterService,\r\n private collectionService: CollectionService, private platformUtilsService: PlatformUtilsService) { }\r\n\r\n async ngOnInit() {\r\n this.editMode = this.loading = this.organizationUserId != null;\r\n await this.loadCollections();\r\n\r\n if (this.editMode) {\r\n this.editMode = true;\r\n this.title = this.i18nService.t('editUser');\r\n try {\r\n const user = await this.apiService.getOrganizationUser(this.organizationId, this.organizationUserId);\r\n this.access = user.accessAll ? 'all' : 'selected';\r\n this.type = user.type;\r\n if (user.collections != null && this.collections != null) {\r\n user.collections.forEach((s) => {\r\n const collection = this.collections.filter((c) => c.id === s.id);\r\n if (collection != null && collection.length > 0) {\r\n (collection[0] as any).checked = true;\r\n collection[0].readOnly = s.readOnly;\r\n }\r\n });\r\n }\r\n } catch { }\r\n } else {\r\n this.title = this.i18nService.t('inviteUser');\r\n }\r\n\r\n this.loading = false;\r\n }\r\n\r\n async loadCollections() {\r\n const response = await this.apiService.getCollections(this.organizationId);\r\n const collections = response.data.map((r) =>\r\n new Collection(new CollectionData(r as CollectionDetailsResponse)));\r\n this.collections = await this.collectionService.decryptMany(collections);\r\n }\r\n\r\n check(c: CollectionView, select?: boolean) {\r\n (c as any).checked = select == null ? !(c as any).checked : select;\r\n if (!(c as any).checked) {\r\n c.readOnly = false;\r\n }\r\n }\r\n\r\n selectAll(select: boolean) {\r\n this.collections.forEach((c) => this.check(c, select));\r\n }\r\n\r\n async submit() {\r\n let collections: SelectionReadOnlyRequest[] = null;\r\n if (this.access !== 'all') {\r\n collections = this.collections.filter((c) => (c as any).checked)\r\n .map((c) => new SelectionReadOnlyRequest(c.id, !!c.readOnly));\r\n }\r\n\r\n try {\r\n if (this.editMode) {\r\n const request = new OrganizationUserUpdateRequest();\r\n request.accessAll = this.access === 'all';\r\n request.type = this.type;\r\n request.collections = collections;\r\n this.formPromise = this.apiService.putOrganizationUser(this.organizationId, this.organizationUserId,\r\n request);\r\n } else {\r\n const request = new OrganizationUserInviteRequest();\r\n request.emails = this.emails.trim().split(/\\s*,\\s*/);\r\n request.accessAll = this.access === 'all';\r\n request.type = this.type;\r\n request.collections = collections;\r\n this.formPromise = this.apiService.postOrganizationUserInvite(this.organizationId, request);\r\n }\r\n await this.formPromise;\r\n this.analytics.eventTrack.next({ action: this.editMode ? 'Edited User' : 'Invited User' });\r\n this.toasterService.popAsync('success', null,\r\n this.i18nService.t(this.editMode ? 'editedUserId' : 'invitedUsers', this.name));\r\n this.onSavedUser.emit();\r\n } catch { }\r\n }\r\n\r\n async delete() {\r\n if (!this.editMode) {\r\n return;\r\n }\r\n\r\n const confirmed = await this.platformUtilsService.showDialog(\r\n this.i18nService.t('removeUserConfirmation'), this.name,\r\n this.i18nService.t('yes'), this.i18nService.t('no'), 'warning');\r\n if (!confirmed) {\r\n return false;\r\n }\r\n\r\n try {\r\n this.deletePromise = this.apiService.deleteOrganizationUser(this.organizationId, this.organizationUserId);\r\n await this.deletePromise;\r\n this.analytics.eventTrack.next({ action: 'Deleted User' });\r\n this.toasterService.popAsync('success', null, this.i18nService.t('removedUserId', this.name));\r\n this.onDeletedUser.emit();\r\n } catch { }\r\n }\r\n}\r\n","import {\r\n Component,\r\n EventEmitter,\r\n Input,\r\n OnInit,\r\n Output,\r\n} from '@angular/core';\r\n\r\nimport { ToasterService } from 'angular2-toaster';\r\nimport { Angulartics2 } from 'angulartics2';\r\n\r\nimport { ApiService } from 'jslib/abstractions/api.service';\r\nimport { CollectionService } from 'jslib/abstractions/collection.service';\r\nimport { I18nService } from 'jslib/abstractions/i18n.service';\r\nimport { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';\r\n\r\nimport { CollectionData } from 'jslib/models/data/collectionData';\r\nimport { Collection } from 'jslib/models/domain/collection';\r\nimport { GroupRequest } from 'jslib/models/request/groupRequest';\r\nimport { SelectionReadOnlyRequest } from 'jslib/models/request/selectionReadOnlyRequest';\r\nimport { CollectionDetailsResponse } from 'jslib/models/response/collectionResponse';\r\nimport { CollectionView } from 'jslib/models/view/collectionView';\r\n\r\n@Component({\r\n selector: 'app-group-add-edit',\r\n templateUrl: 'group-add-edit.component.html',\r\n})\r\nexport class GroupAddEditComponent implements OnInit {\r\n @Input() groupId: string;\r\n @Input() organizationId: string;\r\n @Output() onSavedGroup = new EventEmitter();\r\n @Output() onDeletedGroup = new EventEmitter();\r\n\r\n loading = true;\r\n editMode: boolean = false;\r\n title: string;\r\n name: string;\r\n externalId: string;\r\n access: 'all' | 'selected' = 'selected';\r\n collections: CollectionView[] = [];\r\n formPromise: Promise;\r\n deletePromise: Promise;\r\n\r\n constructor(private apiService: ApiService, private i18nService: I18nService,\r\n private analytics: Angulartics2, private toasterService: ToasterService,\r\n private collectionService: CollectionService, private platformUtilsService: PlatformUtilsService) { }\r\n\r\n async ngOnInit() {\r\n this.editMode = this.loading = this.groupId != null;\r\n await this.loadCollections();\r\n\r\n if (this.editMode) {\r\n this.editMode = true;\r\n this.title = this.i18nService.t('editGroup');\r\n try {\r\n const group = await this.apiService.getGroupDetails(this.organizationId, this.groupId);\r\n this.access = group.accessAll ? 'all' : 'selected';\r\n this.name = group.name;\r\n this.externalId = group.externalId;\r\n if (group.collections != null && this.collections != null) {\r\n group.collections.forEach((s) => {\r\n const collection = this.collections.filter((c) => c.id === s.id);\r\n if (collection != null && collection.length > 0) {\r\n (collection[0] as any).checked = true;\r\n collection[0].readOnly = s.readOnly;\r\n }\r\n });\r\n }\r\n } catch { }\r\n } else {\r\n this.title = this.i18nService.t('addGroup');\r\n }\r\n\r\n this.loading = false;\r\n }\r\n\r\n async loadCollections() {\r\n const response = await this.apiService.getCollections(this.organizationId);\r\n const collections = response.data.map((r) =>\r\n new Collection(new CollectionData(r as CollectionDetailsResponse)));\r\n this.collections = await this.collectionService.decryptMany(collections);\r\n }\r\n\r\n check(c: CollectionView, select?: boolean) {\r\n (c as any).checked = select == null ? !(c as any).checked : select;\r\n if (!(c as any).checked) {\r\n c.readOnly = false;\r\n }\r\n }\r\n\r\n selectAll(select: boolean) {\r\n this.collections.forEach((c) => this.check(c, select));\r\n }\r\n\r\n async submit() {\r\n const request = new GroupRequest();\r\n request.name = this.name;\r\n request.externalId = this.externalId;\r\n request.accessAll = this.access === 'all';\r\n if (!request.accessAll) {\r\n request.collections = this.collections.filter((c) => (c as any).checked)\r\n .map((c) => new SelectionReadOnlyRequest(c.id, !!c.readOnly));\r\n }\r\n\r\n try {\r\n if (this.editMode) {\r\n this.formPromise = this.apiService.putGroup(this.organizationId, this.groupId, request);\r\n } else {\r\n this.formPromise = this.apiService.postGroup(this.organizationId, request);\r\n }\r\n await this.formPromise;\r\n this.analytics.eventTrack.next({ action: this.editMode ? 'Edited Group' : 'Created Group' });\r\n this.toasterService.popAsync('success', null,\r\n this.i18nService.t(this.editMode ? 'editedGroupId' : 'createdGroupId', this.name));\r\n this.onSavedGroup.emit();\r\n } catch { }\r\n }\r\n\r\n async delete() {\r\n if (!this.editMode) {\r\n return;\r\n }\r\n\r\n const confirmed = await this.platformUtilsService.showDialog(\r\n this.i18nService.t('deleteGroupConfirmation'), this.name,\r\n this.i18nService.t('yes'), this.i18nService.t('no'), 'warning');\r\n if (!confirmed) {\r\n return false;\r\n }\r\n\r\n try {\r\n this.deletePromise = this.apiService.deleteGroup(this.organizationId, this.groupId);\r\n await this.deletePromise;\r\n this.analytics.eventTrack.next({ action: 'Deleted Group' });\r\n this.toasterService.popAsync('success', null, this.i18nService.t('deletedGroupId', this.name));\r\n this.onDeletedGroup.emit();\r\n } catch { }\r\n }\r\n}\r\n","import {\n Component,\n EventEmitter,\n Input,\n OnInit,\n Output,\n} from '@angular/core';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { CryptoService } from 'jslib/abstractions/crypto.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\nimport { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';\n\nimport { CipherString } from 'jslib/models/domain/cipherString';\nimport { SymmetricCryptoKey } from 'jslib/models/domain/symmetricCryptoKey';\nimport { CollectionRequest } from 'jslib/models/request/collectionRequest';\nimport { SelectionReadOnlyRequest } from 'jslib/models/request/selectionReadOnlyRequest';\nimport { GroupResponse } from 'jslib/models/response/groupResponse';\n\nimport { Utils } from 'jslib/misc/utils';\n\n@Component({\n selector: 'app-collection-add-edit',\n templateUrl: 'collection-add-edit.component.html',\n})\nexport class CollectionAddEditComponent implements OnInit {\n @Input() collectionId: string;\n @Input() organizationId: string;\n @Output() onSavedCollection = new EventEmitter();\n @Output() onDeletedCollection = new EventEmitter();\n\n loading = true;\n editMode: boolean = false;\n title: string;\n name: string;\n groups: GroupResponse[] = [];\n formPromise: Promise;\n deletePromise: Promise;\n\n private orgKey: SymmetricCryptoKey;\n\n constructor(private apiService: ApiService, private i18nService: I18nService,\n private analytics: Angulartics2, private toasterService: ToasterService,\n private platformUtilsService: PlatformUtilsService, private cryptoService: CryptoService) { }\n\n async ngOnInit() {\n this.editMode = this.loading = this.collectionId != null;\n const groupsResponse = await this.apiService.getGroups(this.organizationId);\n this.groups = groupsResponse.data.map((r) => r).sort(Utils.getSortFunction(this.i18nService, 'name'));\n this.orgKey = await this.cryptoService.getOrgKey(this.organizationId);\n\n if (this.editMode) {\n this.editMode = true;\n this.title = this.i18nService.t('editCollection');\n try {\n const collection = await this.apiService.getCollectionDetails(this.organizationId, this.collectionId);\n this.name = await this.cryptoService.decryptToUtf8(new CipherString(collection.name), this.orgKey);\n if (collection.groups != null && this.groups != null) {\n collection.groups.forEach((s) => {\n const group = this.groups.filter((g) => !g.accessAll && g.id === s.id);\n if (group != null && group.length > 0) {\n (group[0] as any).checked = true;\n (group[0] as any).readOnly = s.readOnly;\n }\n });\n }\n } catch { }\n } else {\n this.title = this.i18nService.t('addCollection');\n }\n\n this.groups.forEach((g) => {\n if (g.accessAll) {\n (g as any).checked = true;\n }\n });\n\n this.loading = false;\n }\n\n check(g: GroupResponse, select?: boolean) {\n if (g.accessAll) {\n return;\n }\n (g as any).checked = select == null ? !(g as any).checked : select;\n if (!(g as any).checked) {\n (g as any).readOnly = false;\n }\n }\n\n selectAll(select: boolean) {\n this.groups.forEach((g) => this.check(g, select));\n }\n\n async submit() {\n const request = new CollectionRequest();\n request.name = (await this.cryptoService.encrypt(this.name, this.orgKey)).encryptedString;\n request.groups = this.groups.filter((g) => (g as any).checked && !g.accessAll)\n .map((g) => new SelectionReadOnlyRequest(g.id, !!(g as any).readOnly));\n\n try {\n if (this.editMode) {\n this.formPromise = this.apiService.putCollection(this.organizationId, this.collectionId, request);\n } else {\n this.formPromise = this.apiService.postCollection(this.organizationId, request);\n }\n await this.formPromise;\n this.analytics.eventTrack.next({ action: this.editMode ? 'Edited Collection' : 'Created Collection' });\n this.toasterService.popAsync('success', null,\n this.i18nService.t(this.editMode ? 'editedCollectionId' : 'createdCollectionId', this.name));\n this.onSavedCollection.emit();\n } catch { }\n }\n\n async delete() {\n if (!this.editMode) {\n return;\n }\n\n const confirmed = await this.platformUtilsService.showDialog(\n this.i18nService.t('deleteCollectionConfirmation'), this.name,\n this.i18nService.t('yes'), this.i18nService.t('no'), 'warning');\n if (!confirmed) {\n return false;\n }\n\n try {\n this.deletePromise = this.apiService.deleteCollection(this.organizationId, this.collectionId);\n await this.deletePromise;\n this.analytics.eventTrack.next({ action: 'Deleted Collection' });\n this.toasterService.popAsync('success', null, this.i18nService.t('deletedCollectionId', this.name));\n this.onDeletedCollection.emit();\n } catch { }\n }\n}\n","import { Collection } from '../domain/collection';\n\nimport { SelectionReadOnlyRequest } from './selectionReadOnlyRequest';\n\nexport class CollectionRequest {\n name: string;\n groups: SelectionReadOnlyRequest[] = [];\n\n constructor(collection?: Collection) {\n if (collection == null) {\n return;\n }\n this.name = collection.name ? collection.name.encryptedString : null;\n }\n}\n","export class CipherCollectionsRequest {\n collectionIds: string[];\n\n constructor(collectionIds: string[]) {\n this.collectionIds = collectionIds == null ? [] : collectionIds;\n }\n}\n","import { Component } from '@angular/core';\r\n\r\nimport { ToasterService } from 'angular2-toaster';\r\nimport { Angulartics2 } from 'angulartics2';\r\n\r\nimport { ApiService } from 'jslib/abstractions/api.service';\r\nimport { CipherService } from 'jslib/abstractions/cipher.service';\r\nimport { CollectionService } from 'jslib/abstractions/collection.service';\r\nimport { I18nService } from 'jslib/abstractions/i18n.service';\r\n\r\nimport { CipherData } from 'jslib/models/data/cipherData';\r\nimport { Cipher } from 'jslib/models/domain/cipher';\r\nimport { Organization } from 'jslib/models/domain/organization';\r\nimport { CipherCollectionsRequest } from 'jslib/models/request/cipherCollectionsRequest';\r\n\r\nimport { CollectionsComponent as BaseCollectionsComponent } from '../../vault/collections.component';\r\n\r\n@Component({\r\n selector: 'app-org-vault-collections',\r\n templateUrl: '../../vault/collections.component.html',\r\n})\r\nexport class CollectionsComponent extends BaseCollectionsComponent {\r\n organization: Organization;\r\n\r\n constructor(collectionService: CollectionService, analytics: Angulartics2,\r\n toasterService: ToasterService, i18nService: I18nService,\r\n cipherService: CipherService, private apiService: ApiService) {\r\n super(collectionService, analytics, toasterService, i18nService, cipherService);\r\n }\r\n\r\n protected async loadCipher() {\r\n if (!this.organization.isAdmin) {\r\n return await super.loadCipher();\r\n }\r\n const response = await this.apiService.getCipherAdmin(this.cipherId);\r\n return new Cipher(new CipherData(response));\r\n }\r\n\r\n protected loadCipherCollections() {\r\n if (!this.organization.isAdmin) {\r\n return super.loadCipherCollections();\r\n }\r\n return this.collectionIds;\r\n }\r\n\r\n protected loadCollections() {\r\n if (!this.organization.isAdmin) {\r\n return super.loadCollections();\r\n }\r\n return Promise.resolve(this.collections);\r\n }\r\n\r\n protected saveCollections() {\r\n const request = new CipherCollectionsRequest(this.cipherDomain.collectionIds);\r\n return this.apiService.putCipherCollectionsAdmin(this.cipherId, request);\r\n }\r\n}\r\n","import { Component } from '@angular/core';\r\n\r\nimport { ToasterService } from 'angular2-toaster';\r\nimport { Angulartics2 } from 'angulartics2';\r\n\r\nimport { ApiService } from 'jslib/abstractions/api.service';\r\nimport { CipherService } from 'jslib/abstractions/cipher.service';\r\nimport { CryptoService } from 'jslib/abstractions/crypto.service';\r\nimport { I18nService } from 'jslib/abstractions/i18n.service';\r\nimport { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';\r\nimport { TokenService } from 'jslib/abstractions/token.service';\r\n\r\nimport { CipherData } from 'jslib/models/data/cipherData';\r\nimport { Cipher } from 'jslib/models/domain/cipher';\r\nimport { Organization } from 'jslib/models/domain/organization';\r\n\r\nimport { AttachmentsComponent as BaseAttachmentsComponent } from '../../vault/attachments.component';\r\n\r\n@Component({\r\n selector: 'app-org-vault-attachments',\r\n templateUrl: '../../vault/attachments.component.html',\r\n})\r\nexport class AttachmentsComponent extends BaseAttachmentsComponent {\r\n organization: Organization;\r\n\r\n constructor(cipherService: CipherService, analytics: Angulartics2,\r\n toasterService: ToasterService, i18nService: I18nService,\r\n cryptoService: CryptoService, tokenService: TokenService,\r\n platformUtilsService: PlatformUtilsService, private apiService: ApiService) {\r\n super(cipherService, analytics, toasterService, i18nService, cryptoService, tokenService,\r\n platformUtilsService);\r\n }\r\n\r\n protected async loadCipher() {\r\n if (!this.organization.isAdmin) {\r\n return await super.loadCipher();\r\n }\r\n const response = await this.apiService.getCipherAdmin(this.cipherId);\r\n return new Cipher(new CipherData(response));\r\n }\r\n\r\n protected saveCipherAttachment(file: File) {\r\n return this.cipherService.saveAttachmentWithServer(this.cipherDomain, file, this.organization.isAdmin);\r\n }\r\n\r\n protected deleteCipherAttachment(attachmentId: string) {\r\n if (!this.organization.isAdmin) {\r\n return super.deleteCipherAttachment(attachmentId);\r\n }\r\n return this.apiService.deleteCipherAttachmentAdmin(this.cipherId, attachmentId);\r\n }\r\n}\r\n","import {\n Component,\n OnInit,\n} from '@angular/core';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { AuditService } from 'jslib/abstractions/audit.service';\nimport { CipherService } from 'jslib/abstractions/cipher.service';\nimport { FolderService } from 'jslib/abstractions/folder.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\nimport { MessagingService } from 'jslib/abstractions/messaging.service';\nimport { PasswordGenerationService } from 'jslib/abstractions/passwordGeneration.service';\nimport { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';\nimport { StateService } from 'jslib/abstractions/state.service';\nimport { TokenService } from 'jslib/abstractions/token.service';\nimport { TotpService } from 'jslib/abstractions/totp.service';\n\nimport { CipherData } from 'jslib/models/data/cipherData';\nimport { Cipher } from 'jslib/models/domain/cipher';\nimport { Organization } from 'jslib/models/domain/organization';\nimport { CipherRequest } from 'jslib/models/request/cipherRequest';\n\nimport { AddEditComponent as BaseAddEditComponent } from '../../vault/add-edit.component';\n\n@Component({\n selector: 'app-org-vault-add-edit',\n templateUrl: '../../vault/add-edit.component.html',\n})\nexport class AddEditComponent extends BaseAddEditComponent implements OnInit {\n organization: Organization;\n\n constructor(cipherService: CipherService, folderService: FolderService,\n i18nService: I18nService, platformUtilsService: PlatformUtilsService,\n analytics: Angulartics2, toasterService: ToasterService,\n auditService: AuditService, stateService: StateService,\n tokenService: TokenService, totpService: TotpService,\n passwordGenerationService: PasswordGenerationService, private apiService: ApiService,\n messagingService: MessagingService) {\n super(cipherService, folderService, i18nService, platformUtilsService, analytics,\n toasterService, auditService, stateService, tokenService, totpService, passwordGenerationService,\n messagingService);\n }\n\n protected async loadCipher() {\n if (!this.organization.isAdmin) {\n return await super.loadCipher();\n }\n const response = await this.apiService.getCipherAdmin(this.cipherId);\n return new Cipher(new CipherData(response));\n }\n\n protected encryptCipher() {\n if (!this.editMode) {\n this.cipher.organizationId = this.organization.id;\n }\n return super.encryptCipher();\n }\n\n protected async saveCipher(cipher: Cipher) {\n if (!this.organization.isAdmin) {\n return super.saveCipher(cipher);\n }\n const request = new CipherRequest(cipher);\n if (this.editMode) {\n return this.apiService.putCipherAdmin(this.cipherId, request);\n } else {\n return this.apiService.postCipherAdmin(request);\n }\n }\n\n protected async deleteCipher() {\n if (!this.organization.isAdmin) {\n return super.deleteCipher();\n }\n return this.apiService.deleteCipherAdmin(this.cipherId);\n }\n}\n","import { SecureNoteType } from '../../enums/secureNoteType';\n\nimport { SecureNoteData } from '../data/secureNoteData';\n\nimport Domain from './domain';\n\nimport { SecureNoteView } from '../view/secureNoteView';\n\nexport class SecureNote extends Domain {\n type: SecureNoteType;\n\n constructor(obj?: SecureNoteData, alreadyEncrypted: boolean = false) {\n super();\n if (obj == null) {\n return;\n }\n\n this.type = obj.type;\n }\n\n decrypt(orgId: string): Promise {\n return Promise.resolve(new SecureNoteView(this));\n }\n\n toSecureNoteData(): SecureNoteData {\n const n = new SecureNoteData();\n n.type = this.type;\n return n;\n }\n}\n","import { UriMatchType } from '../../enums/uriMatchType';\n\nimport { LoginUriData } from '../data/loginUriData';\n\nimport { LoginUriView } from '../view/loginUriView';\n\nimport { CipherString } from './cipherString';\nimport Domain from './domain';\n\nexport class LoginUri extends Domain {\n uri: CipherString;\n match: UriMatchType;\n\n constructor(obj?: LoginUriData, alreadyEncrypted: boolean = false) {\n super();\n if (obj == null) {\n return;\n }\n\n this.match = obj.match;\n this.buildDomainModel(this, obj, {\n uri: null,\n }, alreadyEncrypted, []);\n }\n\n decrypt(orgId: string): Promise {\n return this.decryptObj(new LoginUriView(this), {\n uri: null,\n }, orgId);\n }\n\n toLoginUriData(): LoginUriData {\n const u = new LoginUriData();\n this.buildDataModel(this, u, {\n uri: null,\n }, ['match']);\n return u;\n }\n}\n","import { LoginUri } from './loginUri';\n\nimport { LoginData } from '../data/loginData';\n\nimport { LoginUriView } from '../view/loginUriView';\nimport { LoginView } from '../view/loginView';\n\nimport { CipherString } from './cipherString';\nimport Domain from './domain';\n\nexport class Login extends Domain {\n uris: LoginUri[];\n username: CipherString;\n password: CipherString;\n totp: CipherString;\n\n constructor(obj?: LoginData, alreadyEncrypted: boolean = false) {\n super();\n if (obj == null) {\n return;\n }\n\n this.buildDomainModel(this, obj, {\n username: null,\n password: null,\n totp: null,\n }, alreadyEncrypted, []);\n\n if (obj.uris) {\n this.uris = [];\n obj.uris.forEach((u) => {\n this.uris.push(new LoginUri(u, alreadyEncrypted));\n });\n }\n }\n\n async decrypt(orgId: string): Promise {\n const view = await this.decryptObj(new LoginView(this), {\n username: null,\n password: null,\n totp: null,\n }, orgId);\n\n if (this.uris != null) {\n view.uris = [];\n for (let i = 0; i < this.uris.length; i++) {\n const uri = await this.uris[i].decrypt(orgId);\n view.uris.push(uri);\n }\n }\n\n return view;\n }\n\n toLoginData(): LoginData {\n const l = new LoginData();\n this.buildDataModel(this, l, {\n username: null,\n password: null,\n totp: null,\n });\n\n if (this.uris != null && this.uris.length > 0) {\n l.uris = [];\n this.uris.forEach((u) => {\n l.uris.push(u.toLoginUriData());\n });\n }\n\n return l;\n }\n}\n","import { IdentityData } from '../data/identityData';\n\nimport { CipherString } from './cipherString';\nimport Domain from './domain';\n\nimport { IdentityView } from '../view/identityView';\n\nexport class Identity extends Domain {\n title: CipherString;\n firstName: CipherString;\n middleName: CipherString;\n lastName: CipherString;\n address1: CipherString;\n address2: CipherString;\n address3: CipherString;\n city: CipherString;\n state: CipherString;\n postalCode: CipherString;\n country: CipherString;\n company: CipherString;\n email: CipherString;\n phone: CipherString;\n ssn: CipherString;\n username: CipherString;\n passportNumber: CipherString;\n licenseNumber: CipherString;\n\n constructor(obj?: IdentityData, alreadyEncrypted: boolean = false) {\n super();\n if (obj == null) {\n return;\n }\n\n this.buildDomainModel(this, obj, {\n title: null,\n firstName: null,\n middleName: null,\n lastName: null,\n address1: null,\n address2: null,\n address3: null,\n city: null,\n state: null,\n postalCode: null,\n country: null,\n company: null,\n email: null,\n phone: null,\n ssn: null,\n username: null,\n passportNumber: null,\n licenseNumber: null,\n }, alreadyEncrypted, []);\n }\n\n decrypt(orgId: string): Promise {\n return this.decryptObj(new IdentityView(this), {\n title: null,\n firstName: null,\n middleName: null,\n lastName: null,\n address1: null,\n address2: null,\n address3: null,\n city: null,\n state: null,\n postalCode: null,\n country: null,\n company: null,\n email: null,\n phone: null,\n ssn: null,\n username: null,\n passportNumber: null,\n licenseNumber: null,\n }, orgId);\n }\n\n toIdentityData(): IdentityData {\n const i = new IdentityData();\n this.buildDataModel(this, i, {\n title: null,\n firstName: null,\n middleName: null,\n lastName: null,\n address1: null,\n address2: null,\n address3: null,\n city: null,\n state: null,\n postalCode: null,\n country: null,\n company: null,\n email: null,\n phone: null,\n ssn: null,\n username: null,\n passportNumber: null,\n licenseNumber: null,\n });\n return i;\n }\n}\n","import { FieldType } from '../../enums/fieldType';\n\nimport { FieldData } from '../data/fieldData';\n\nimport { CipherString } from './cipherString';\nimport Domain from './domain';\n\nimport { FieldView } from '../view/fieldView';\n\nexport class Field extends Domain {\n name: CipherString;\n value: CipherString;\n type: FieldType;\n\n constructor(obj?: FieldData, alreadyEncrypted: boolean = false) {\n super();\n if (obj == null) {\n return;\n }\n\n this.type = obj.type;\n this.buildDomainModel(this, obj, {\n name: null,\n value: null,\n }, alreadyEncrypted, []);\n }\n\n decrypt(orgId: string): Promise {\n return this.decryptObj(new FieldView(this), {\n name: null,\n value: null,\n }, orgId);\n }\n\n toFieldData(): FieldData {\n const f = new FieldData();\n this.buildDataModel(this, f, {\n name: null,\n value: null,\n type: null,\n }, ['type']);\n return f;\n }\n}\n","import { CardData } from '../data/cardData';\n\nimport { CipherString } from './cipherString';\nimport Domain from './domain';\n\nimport { CardView } from '../view/cardView';\n\nexport class Card extends Domain {\n cardholderName: CipherString;\n brand: CipherString;\n number: CipherString;\n expMonth: CipherString;\n expYear: CipherString;\n code: CipherString;\n\n constructor(obj?: CardData, alreadyEncrypted: boolean = false) {\n super();\n if (obj == null) {\n return;\n }\n\n this.buildDomainModel(this, obj, {\n cardholderName: null,\n brand: null,\n number: null,\n expMonth: null,\n expYear: null,\n code: null,\n }, alreadyEncrypted, []);\n }\n\n decrypt(orgId: string): Promise {\n return this.decryptObj(new CardView(this), {\n cardholderName: null,\n brand: null,\n number: null,\n expMonth: null,\n expYear: null,\n code: null,\n }, orgId);\n }\n\n toCardData(): CardData {\n const c = new CardData();\n this.buildDataModel(this, c, {\n cardholderName: null,\n brand: null,\n number: null,\n expMonth: null,\n expYear: null,\n code: null,\n });\n return c;\n }\n}\n","import { AttachmentData } from '../data/attachmentData';\n\nimport { CipherString } from './cipherString';\nimport Domain from './domain';\n\nimport { AttachmentView } from '../view/attachmentView';\n\nexport class Attachment extends Domain {\n id: string;\n url: string;\n size: number;\n sizeName: string;\n fileName: CipherString;\n\n constructor(obj?: AttachmentData, alreadyEncrypted: boolean = false) {\n super();\n if (obj == null) {\n return;\n }\n\n this.size = obj.size;\n this.buildDomainModel(this, obj, {\n id: null,\n url: null,\n sizeName: null,\n fileName: null,\n }, alreadyEncrypted, ['id', 'url', 'sizeName']);\n }\n\n decrypt(orgId: string): Promise {\n return this.decryptObj(new AttachmentView(this), {\n fileName: null,\n }, orgId);\n }\n\n toAttachmentData(): AttachmentData {\n const a = new AttachmentData();\n this.buildDataModel(this, a, {\n id: null,\n url: null,\n sizeName: null,\n fileName: null,\n }, ['id', 'url', 'sizeName']);\n return a;\n }\n}\n","import { SecureNoteType } from '../../enums/secureNoteType';\n\nimport { SecureNoteApi } from '../api/secureNoteApi';\n\nexport class SecureNoteData {\n type: SecureNoteType;\n\n constructor(data?: SecureNoteApi) {\n if (data == null) {\n return;\n }\n\n this.type = data.type;\n }\n}\n","import { UriMatchType } from '../../enums/uriMatchType';\n\nimport { LoginUriApi } from '../api/loginUriApi';\n\nexport class LoginUriData {\n uri: string;\n match: UriMatchType = null;\n\n constructor(data?: LoginUriApi) {\n if (data == null) {\n return;\n }\n this.uri = data.uri;\n this.match = data.match;\n }\n}\n","import { LoginApi } from '../api/loginApi';\nimport { LoginUriApi } from '../api/loginUriApi';\n\nimport { LoginUriData } from './loginUriData';\n\nexport class LoginData {\n uris: LoginUriData[];\n username: string;\n password: string;\n totp: string;\n\n constructor(data?: LoginApi) {\n if (data == null) {\n return;\n }\n\n this.username = data.username;\n this.password = data.password;\n this.totp = data.totp;\n\n if (data.uris) {\n this.uris = [];\n data.uris.forEach((u) => {\n this.uris.push(new LoginUriData(u));\n });\n }\n }\n}\n","import { IdentityApi } from '../api/identityApi';\n\nexport class IdentityData {\n title: string;\n firstName: string;\n middleName: string;\n lastName: string;\n address1: string;\n address2: string;\n address3: string;\n city: string;\n state: string;\n postalCode: string;\n country: string;\n company: string;\n email: string;\n phone: string;\n ssn: string;\n username: string;\n passportNumber: string;\n licenseNumber: string;\n\n constructor(data?: IdentityApi) {\n if (data == null) {\n return;\n }\n\n this.title = data.title;\n this.firstName = data.firstName;\n this.middleName = data.middleName;\n this.lastName = data.lastName;\n this.address1 = data.address1;\n this.address2 = data.address2;\n this.address3 = data.address3;\n this.city = data.city;\n this.state = data.state;\n this.postalCode = data.postalCode;\n this.country = data.country;\n this.company = data.company;\n this.email = data.email;\n this.phone = data.phone;\n this.ssn = data.ssn;\n this.username = data.username;\n this.passportNumber = data.passportNumber;\n this.licenseNumber = data.licenseNumber;\n }\n}\n","import { FieldType } from '../../enums/fieldType';\n\nimport { FieldApi } from '../api/fieldApi';\n\nexport class FieldData {\n type: FieldType;\n name: string;\n value: string;\n\n constructor(response?: FieldApi) {\n if (response == null) {\n return;\n }\n this.type = response.type;\n this.name = response.name;\n this.value = response.value;\n }\n}\n","import { CardApi } from '../api/cardApi';\n\nexport class CardData {\n cardholderName: string;\n brand: string;\n number: string;\n expMonth: string;\n expYear: string;\n code: string;\n\n constructor(data?: CardApi) {\n if (data == null) {\n return;\n }\n\n this.cardholderName = data.cardholderName;\n this.brand = data.brand;\n this.number = data.number;\n this.expMonth = data.expMonth;\n this.expYear = data.expYear;\n this.code = data.code;\n }\n}\n","import { AttachmentResponse } from '../response/attachmentResponse';\n\nexport class AttachmentData {\n id: string;\n url: string;\n fileName: string;\n size: number;\n sizeName: string;\n\n constructor(response?: AttachmentResponse) {\n if (response == null) {\n return;\n }\n this.id = response.id;\n this.url = response.url;\n this.fileName = response.fileName;\n this.size = response.size;\n this.sizeName = response.sizeName;\n }\n}\n","import { ToasterService } from 'angular2-toaster';\r\nimport { Angulartics2 } from 'angulartics2';\r\n\r\nimport { Component } from '@angular/core';\r\n\r\nimport { I18nService } from 'jslib/abstractions/i18n.service';\r\nimport { PasswordGenerationService } from 'jslib/abstractions/passwordGeneration.service';\r\nimport { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';\r\n\r\nimport {\r\n PasswordGeneratorHistoryComponent as BasePasswordGeneratorHistoryComponent,\r\n} from 'jslib/angular/components/password-generator-history.component';\r\n\r\n@Component({\r\n selector: 'app-password-generator-history',\r\n templateUrl: 'password-generator-history.component.html',\r\n})\r\nexport class PasswordGeneratorHistoryComponent extends BasePasswordGeneratorHistoryComponent {\r\n constructor(passwordGenerationService: PasswordGenerationService, analytics: Angulartics2,\r\n platformUtilsService: PlatformUtilsService, i18nService: I18nService,\r\n toasterService: ToasterService) {\r\n super(passwordGenerationService, analytics, platformUtilsService, i18nService, toasterService, window);\r\n }\r\n}\r\n","import { View } from './view';\n\nimport { Attachment } from '../domain/attachment';\n\nexport class AttachmentView implements View {\n id: string;\n url: string;\n size: number;\n sizeName: string;\n fileName: string;\n\n constructor(a?: Attachment) {\n if (!a) {\n return;\n }\n\n this.id = a.id;\n this.url = a.url;\n this.size = a.size;\n this.sizeName = a.sizeName;\n }\n}\n","export class KvpRequest {\n key: TK;\n value: TV;\n\n constructor(key: TK, value: TV) {\n this.key = key;\n this.value = value;\n }\n}\n","export enum PlanType {\n Free = 0,\n FamiliesAnnually = 1,\n TeamsMonthly = 2,\n TeamsAnnually = 3,\n EnterpriseMonthly = 4,\n EnterpriseAnnually = 5,\n Custom = 6,\n}\n","\n

{{'contactSupportPaymentMethod' | i18n}}

\n \n {{'contactSupport' | i18n}}\n \n \n
\n
\n
\n

{{(currentType != null ? 'changePaymentMethod' : 'addPaymentMethod') | i18n}}

\n \n \n \n
\n
\n","
\n
\n

{{(add ? 'addStorage' : 'removeStorage') | i18n}}

\n
\n
\n \n \n
\n
\n
\n {{'total' | i18n}}: {{storageAdjustment || 0}} GB × {{storageGbPrice | currency:'$'}} = {{adjustedStorageTotal\n | currency:'$'}} /{{interval | i18n}}\n
\n \n \n \n {{(add ? 'storageAddNote' : 'storageRemoveNote') | i18n}}\n \n
\n
\n","
\n
\n \n \n {{'licenseFileDesc' | i18n : (!organizationId ? 'bitwarden_premium_license.json' : 'bitwarden_organization_license.json')}}\n
\n \n \n
\n","import { Component } from '@angular/core';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\nimport { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';\n\nimport { UpdateTwoFactorYubioOtpRequest } from 'jslib/models/request/updateTwoFactorYubioOtpRequest';\nimport { TwoFactorYubiKeyResponse } from 'jslib/models/response/twoFactorYubiKeyResponse';\n\nimport { TwoFactorProviderType } from 'jslib/enums/twoFactorProviderType';\n\nimport { TwoFactorBaseComponent } from './two-factor-base.component';\n\n@Component({\n selector: 'app-two-factor-yubikey',\n templateUrl: 'two-factor-yubikey.component.html',\n})\nexport class TwoFactorYubiKeyComponent extends TwoFactorBaseComponent {\n type = TwoFactorProviderType.Yubikey;\n keys: any[];\n nfc = false;\n\n formPromise: Promise;\n disablePromise: Promise;\n\n constructor(apiService: ApiService, i18nService: I18nService,\n analytics: Angulartics2, toasterService: ToasterService,\n platformUtilsService: PlatformUtilsService) {\n super(apiService, i18nService, analytics, toasterService, platformUtilsService);\n }\n\n auth(authResponse: any) {\n super.auth(authResponse);\n this.processResponse(authResponse.response);\n }\n\n submit() {\n const request = new UpdateTwoFactorYubioOtpRequest();\n request.masterPasswordHash = this.masterPasswordHash;\n request.key1 = this.keys != null && this.keys.length > 0 ? this.keys[0].key : null;\n request.key2 = this.keys != null && this.keys.length > 1 ? this.keys[1].key : null;\n request.key3 = this.keys != null && this.keys.length > 2 ? this.keys[2].key : null;\n request.key4 = this.keys != null && this.keys.length > 3 ? this.keys[3].key : null;\n request.key5 = this.keys != null && this.keys.length > 4 ? this.keys[4].key : null;\n request.nfc = this.nfc;\n\n return super.enable(async () => {\n this.formPromise = this.apiService.putTwoFactorYubiKey(request);\n const response = await this.formPromise;\n await this.processResponse(response);\n this.toasterService.popAsync('success', null, this.i18nService.t('yubikeysUpdated'));\n });\n }\n\n disable() {\n return super.disable(this.disablePromise);\n }\n\n remove(key: any) {\n key.existingKey = null;\n key.key = null;\n }\n\n private processResponse(response: TwoFactorYubiKeyResponse) {\n this.enabled = response.enabled;\n this.keys = [\n { key: response.key1, existingKey: this.padRight(response.key1) },\n { key: response.key2, existingKey: this.padRight(response.key2) },\n { key: response.key3, existingKey: this.padRight(response.key3) },\n { key: response.key4, existingKey: this.padRight(response.key4) },\n { key: response.key5, existingKey: this.padRight(response.key5) },\n ];\n this.nfc = response.nfc || !response.enabled;\n }\n\n private padRight(str: string, character = '•', size = 44) {\n if (str == null || character == null || str.length >= size) {\n return str;\n }\n const max = (size - str.length) / character.length;\n for (let i = 0; i < max; i++) {\n str += character;\n }\n return str;\n }\n}\n","import {\n Component,\n OnDestroy,\n OnInit,\n} from '@angular/core';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\nimport { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';\n\nimport { TwoFactorProviderType } from 'jslib/enums/twoFactorProviderType';\nimport { UpdateTwoFactorU2fRequest } from 'jslib/models/request/updateTwoFactorU2fRequest';\nimport {\n ChallengeResponse,\n TwoFactorU2fResponse,\n} from 'jslib/models/response/twoFactorU2fResponse';\n\nimport { TwoFactorBaseComponent } from './two-factor-base.component';\n\n@Component({\n selector: 'app-two-factor-u2f',\n templateUrl: 'two-factor-u2f.component.html',\n})\nexport class TwoFactorU2fComponent extends TwoFactorBaseComponent implements OnInit, OnDestroy {\n type = TwoFactorProviderType.U2f;\n u2fChallenge: ChallengeResponse;\n u2fError: boolean;\n u2fListening: boolean;\n u2fResponse: string;\n formPromise: Promise;\n\n private closed = false;\n private u2fScript: HTMLScriptElement;\n\n constructor(apiService: ApiService, i18nService: I18nService,\n analytics: Angulartics2, toasterService: ToasterService,\n platformUtilsService: PlatformUtilsService) {\n super(apiService, i18nService, analytics, toasterService, platformUtilsService);\n this.u2fScript = window.document.createElement('script');\n this.u2fScript.src = 'scripts/u2f.js';\n this.u2fScript.async = true;\n }\n\n ngOnInit() {\n window.document.body.appendChild(this.u2fScript);\n }\n\n ngOnDestroy() {\n this.closed = true;\n window.document.body.removeChild(this.u2fScript);\n }\n\n auth(authResponse: any) {\n super.auth(authResponse);\n this.processResponse(authResponse.response);\n this.readDevice();\n }\n\n submit() {\n if (this.enabled) {\n return super.disable(this.formPromise);\n } else {\n return this.enable();\n }\n }\n\n protected enable() {\n const request = new UpdateTwoFactorU2fRequest();\n request.masterPasswordHash = this.masterPasswordHash;\n request.deviceResponse = this.u2fResponse;\n\n return super.enable(async () => {\n this.formPromise = this.apiService.putTwoFactorU2f(request);\n const response = await this.formPromise;\n await this.processResponse(response);\n });\n }\n\n private readDevice() {\n if (this.closed || this.enabled) {\n return;\n }\n\n // tslint:disable-next-line\n console.log('listening for key...');\n\n this.u2fResponse = null;\n this.u2fError = false;\n this.u2fListening = true;\n\n (window as any).u2f.register(this.u2fChallenge.appId, [{\n version: this.u2fChallenge.version,\n challenge: this.u2fChallenge.challenge,\n }], [], (data: any) => {\n this.u2fListening = false;\n if (data.errorCode === 5) {\n this.readDevice();\n return;\n } else if (data.errorCode) {\n this.u2fError = true;\n // tslint:disable-next-line\n console.log('error: ' + data.errorCode);\n return;\n }\n this.u2fResponse = JSON.stringify(data);\n }, 10);\n }\n\n private processResponse(response: TwoFactorU2fResponse) {\n this.u2fChallenge = response.challenge;\n this.enabled = response.enabled;\n }\n}\n","import { Component } from '@angular/core';\n\nimport { I18nService } from 'jslib/abstractions/i18n.service';\n\nimport { TwoFactorRecoverResponse } from 'jslib/models/response/twoFactorRescoverResponse';\n\nimport { TwoFactorProviderType } from 'jslib/enums/twoFactorProviderType';\n\n@Component({\n selector: 'app-two-factor-recovery',\n templateUrl: 'two-factor-recovery.component.html',\n})\nexport class TwoFactorRecoveryComponent {\n type = -1;\n code: string;\n authed: boolean;\n twoFactorProviderType = TwoFactorProviderType;\n\n constructor(private i18nService: I18nService) { }\n\n auth(authResponse: any) {\n this.authed = true;\n this.processResponse(authResponse.response);\n }\n\n print() {\n const w = window.open();\n w.document.write('
' +\n '

' + this.i18nService.t('twoFactorRecoveryYourCode') + ':

' +\n '' +\n this.code + '
' +\n '

' + new Date() + '

');\n w.print();\n w.close();\n }\n\n private formatString(s: string) {\n if (s == null) {\n return null;\n }\n return s.replace(/(.{4})/g, '$1 ').trim().toUpperCase();\n }\n\n private processResponse(response: TwoFactorRecoverResponse) {\n this.code = this.formatString(response.code);\n }\n}\n","import { Component } from '@angular/core';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\nimport { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';\nimport { UserService } from 'jslib/abstractions/user.service';\n\nimport { TwoFactorEmailRequest } from 'jslib/models/request/twoFactorEmailRequest';\n\nimport { TwoFactorProviderType } from 'jslib/enums/twoFactorProviderType';\nimport { UpdateTwoFactorEmailRequest } from 'jslib/models/request/updateTwoFactorEmailRequest';\nimport { TwoFactorEmailResponse } from 'jslib/models/response/twoFactorEmailResponse';\n\nimport { TwoFactorBaseComponent } from './two-factor-base.component';\n\n@Component({\n selector: 'app-two-factor-email',\n templateUrl: 'two-factor-email.component.html',\n})\nexport class TwoFactorEmailComponent extends TwoFactorBaseComponent {\n type = TwoFactorProviderType.Email;\n email: string;\n token: string;\n sentEmail: string;\n formPromise: Promise;\n emailPromise: Promise;\n\n constructor(apiService: ApiService, i18nService: I18nService,\n analytics: Angulartics2, toasterService: ToasterService,\n platformUtilsService: PlatformUtilsService, private userService: UserService) {\n super(apiService, i18nService, analytics, toasterService, platformUtilsService);\n }\n\n auth(authResponse: any) {\n super.auth(authResponse);\n return this.processResponse(authResponse.response);\n }\n\n submit() {\n if (this.enabled) {\n return super.disable(this.formPromise);\n } else {\n return this.enable();\n }\n }\n\n async sendEmail() {\n try {\n const request = new TwoFactorEmailRequest(this.email, this.masterPasswordHash);\n this.emailPromise = this.apiService.postTwoFactorEmailSetup(request);\n await this.emailPromise;\n this.sentEmail = this.email;\n } catch { }\n }\n\n protected enable() {\n const request = new UpdateTwoFactorEmailRequest();\n request.masterPasswordHash = this.masterPasswordHash;\n request.email = this.email;\n request.token = this.token;\n\n return super.enable(async () => {\n this.formPromise = this.apiService.putTwoFactorEmail(request);\n const response = await this.formPromise;\n await this.processResponse(response);\n });\n }\n\n private async processResponse(response: TwoFactorEmailResponse) {\n this.token = null;\n this.email = response.email;\n this.enabled = response.enabled;\n if (!this.enabled && (this.email == null || this.email === '')) {\n this.email = await this.userService.getEmail();\n }\n }\n}\n","import {\n Component,\n OnDestroy,\n OnInit,\n} from '@angular/core';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\nimport { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';\nimport { UserService } from 'jslib/abstractions/user.service';\n\nimport { UpdateTwoFactorAuthenticatorRequest } from 'jslib/models/request/updateTwoFactorAuthenticatorRequest';\nimport { TwoFactorAuthenticatorResponse } from 'jslib/models/response/twoFactorAuthenticatorResponse';\n\nimport { TwoFactorProviderType } from 'jslib/enums/twoFactorProviderType';\n\nimport { TwoFactorBaseComponent } from './two-factor-base.component';\n\n@Component({\n selector: 'app-two-factor-authenticator',\n templateUrl: 'two-factor-authenticator.component.html',\n})\nexport class TwoFactorAuthenticatorComponent extends TwoFactorBaseComponent implements OnInit, OnDestroy {\n type = TwoFactorProviderType.Authenticator;\n key: string;\n token: string;\n formPromise: Promise;\n\n private qrScript: HTMLScriptElement;\n\n constructor(apiService: ApiService, i18nService: I18nService,\n analytics: Angulartics2, toasterService: ToasterService,\n private userService: UserService, platformUtilsService: PlatformUtilsService) {\n super(apiService, i18nService, analytics, toasterService, platformUtilsService);\n this.qrScript = window.document.createElement('script');\n this.qrScript.src = 'scripts/qrious.min.js';\n this.qrScript.async = true;\n }\n\n ngOnInit() {\n window.document.body.appendChild(this.qrScript);\n }\n\n ngOnDestroy() {\n window.document.body.removeChild(this.qrScript);\n }\n\n auth(authResponse: any) {\n super.auth(authResponse);\n return this.processResponse(authResponse.response);\n }\n\n submit() {\n if (this.enabled) {\n return super.disable(this.formPromise);\n } else {\n return this.enable();\n }\n }\n\n protected enable() {\n const request = new UpdateTwoFactorAuthenticatorRequest();\n request.masterPasswordHash = this.masterPasswordHash;\n request.token = this.token;\n request.key = this.key;\n\n return super.enable(async () => {\n this.formPromise = this.apiService.putTwoFactorAuthenticator(request);\n const response = await this.formPromise;\n await this.processResponse(response);\n });\n }\n\n private async processResponse(response: TwoFactorAuthenticatorResponse) {\n this.token = null;\n this.enabled = response.enabled;\n this.key = response.key;\n const email = await this.userService.getEmail();\n window.setTimeout(() => {\n const qr = new (window as any).QRious({\n element: document.getElementById('qr'),\n value: 'otpauth://totp/Bitwarden:' + encodeURIComponent(email) +\n '?secret=' + encodeURIComponent(this.key) + '&issuer=Bitwarden',\n size: 160,\n });\n }, 100);\n }\n}\n","import { Component } from '@angular/core';\r\nimport { Router } from '@angular/router';\r\n\r\nimport { ToasterService } from 'angular2-toaster';\r\nimport { Angulartics2 } from 'angulartics2';\r\n\r\nimport { ApiService } from 'jslib/abstractions/api.service';\r\nimport { CryptoService } from 'jslib/abstractions/crypto.service';\r\nimport { I18nService } from 'jslib/abstractions/i18n.service';\r\n\r\nimport { PasswordVerificationRequest } from 'jslib/models/request/passwordVerificationRequest';\r\n\r\n@Component({\r\n selector: 'app-purge-vault',\r\n templateUrl: 'purge-vault.component.html',\r\n})\r\nexport class PurgeVaultComponent {\r\n masterPassword: string;\r\n formPromise: Promise;\r\n\r\n constructor(private apiService: ApiService, private i18nService: I18nService,\r\n private analytics: Angulartics2, private toasterService: ToasterService,\r\n private cryptoService: CryptoService, private router: Router) { }\r\n\r\n async submit() {\r\n if (this.masterPassword == null || this.masterPassword === '') {\r\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'),\r\n this.i18nService.t('masterPassRequired'));\r\n return;\r\n }\r\n\r\n const request = new PasswordVerificationRequest();\r\n request.masterPasswordHash = await this.cryptoService.hashPassword(this.masterPassword, null);\r\n try {\r\n this.formPromise = this.apiService.postPurgeCiphers(request);\r\n await this.formPromise;\r\n this.analytics.eventTrack.next({ action: 'Purged Vault' });\r\n this.toasterService.popAsync('success', null, this.i18nService.t('vaultPurged'));\r\n this.router.navigate(['vault']);\r\n } catch { }\r\n }\r\n}\r\n","import { Component } from '@angular/core';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { CryptoService } from 'jslib/abstractions/crypto.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\nimport { MessagingService } from 'jslib/abstractions/messaging.service';\n\nimport { PasswordVerificationRequest } from 'jslib/models/request/passwordVerificationRequest';\n\n@Component({\n selector: 'app-delete-account',\n templateUrl: 'delete-account.component.html',\n})\nexport class DeleteAccountComponent {\n masterPassword: string;\n formPromise: Promise;\n\n constructor(private apiService: ApiService, private i18nService: I18nService,\n private analytics: Angulartics2, private toasterService: ToasterService,\n private cryptoService: CryptoService, private messagingService: MessagingService) { }\n\n async submit() {\n if (this.masterPassword == null || this.masterPassword === '') {\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'),\n this.i18nService.t('masterPassRequired'));\n return;\n }\n\n const request = new PasswordVerificationRequest();\n request.masterPasswordHash = await this.cryptoService.hashPassword(this.masterPassword, null);\n try {\n this.formPromise = this.apiService.deleteAccount(request);\n await this.formPromise;\n this.analytics.eventTrack.next({ action: 'Deleted Account' });\n this.toasterService.popAsync('success', this.i18nService.t('accountDeleted'),\n this.i18nService.t('accountDeletedDesc'));\n this.messagingService.send('logout');\n } catch { }\n }\n}\n","import { Component } from '@angular/core';\r\n\r\nimport { ToasterService } from 'angular2-toaster';\r\nimport { Angulartics2 } from 'angulartics2';\r\n\r\nimport { ApiService } from 'jslib/abstractions/api.service';\r\nimport { CryptoService } from 'jslib/abstractions/crypto.service';\r\nimport { I18nService } from 'jslib/abstractions/i18n.service';\r\nimport { MessagingService } from 'jslib/abstractions/messaging.service';\r\n\r\nimport { PasswordVerificationRequest } from 'jslib/models/request/passwordVerificationRequest';\r\n\r\n@Component({\r\n selector: 'app-deauthorize-sessions',\r\n templateUrl: 'deauthorize-sessions.component.html',\r\n})\r\nexport class DeauthorizeSessionsComponent {\r\n masterPassword: string;\r\n formPromise: Promise;\r\n\r\n constructor(private apiService: ApiService, private i18nService: I18nService,\r\n private analytics: Angulartics2, private toasterService: ToasterService,\r\n private cryptoService: CryptoService, private messagingService: MessagingService) { }\r\n\r\n async submit() {\r\n if (this.masterPassword == null || this.masterPassword === '') {\r\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'),\r\n this.i18nService.t('masterPassRequired'));\r\n return;\r\n }\r\n\r\n const request = new PasswordVerificationRequest();\r\n request.masterPasswordHash = await this.cryptoService.hashPassword(this.masterPassword, null);\r\n try {\r\n this.formPromise = this.apiService.postSecurityStamp(request);\r\n await this.formPromise;\r\n this.analytics.eventTrack.next({ action: 'Deauthorized Sessions' });\r\n this.toasterService.popAsync('success', this.i18nService.t('sessionsDeauthorized'),\r\n this.i18nService.t('logBackIn'));\r\n this.messagingService.send('logout');\r\n } catch { }\r\n }\r\n}\r\n","import {\n Component,\n} from '@angular/core';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { CryptoService } from 'jslib/abstractions/crypto.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\nimport { MessagingService } from 'jslib/abstractions/messaging.service';\nimport { UserService } from 'jslib/abstractions/user.service';\nimport { PasswordRequest } from 'jslib/models/request/passwordRequest';\n\n@Component({\n selector: 'app-change-password',\n templateUrl: 'change-password.component.html',\n})\nexport class ChangePasswordComponent {\n currentMasterPassword: string;\n newMasterPassword: string;\n confirmNewMasterPassword: string;\n formPromise: Promise;\n\n constructor(private apiService: ApiService, private i18nService: I18nService,\n private analytics: Angulartics2, private toasterService: ToasterService,\n private cryptoService: CryptoService, private messagingService: MessagingService,\n private userService: UserService) { }\n\n async submit() {\n const hasEncKey = await this.cryptoService.hasEncKey();\n if (!hasEncKey) {\n this.toasterService.popAsync('error', null, this.i18nService.t('updateKey'));\n return;\n }\n\n if (this.currentMasterPassword == null || this.currentMasterPassword === '' ||\n this.newMasterPassword == null || this.newMasterPassword === '') {\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'),\n this.i18nService.t('masterPassRequired'));\n return;\n }\n if (this.newMasterPassword.length < 8) {\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'),\n this.i18nService.t('masterPassLength'));\n return;\n }\n if (this.newMasterPassword !== this.confirmNewMasterPassword) {\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'),\n this.i18nService.t('masterPassDoesntMatch'));\n return;\n }\n\n const request = new PasswordRequest();\n request.masterPasswordHash = await this.cryptoService.hashPassword(this.currentMasterPassword, null);\n const email = await this.userService.getEmail();\n const newKey = await this.cryptoService.makeKey(this.newMasterPassword, email);\n request.newMasterPasswordHash = await this.cryptoService.hashPassword(this.newMasterPassword, newKey);\n const encKey = await this.cryptoService.getEncKey();\n const newEncKey = await this.cryptoService.encrypt(encKey.key, newKey);\n request.key = newEncKey.encryptedString;\n try {\n this.formPromise = this.apiService.postPassword(request);\n await this.formPromise;\n this.analytics.eventTrack.next({ action: 'Changed Password' });\n this.toasterService.popAsync('success', this.i18nService.t('masterPasswordChanged'),\n this.i18nService.t('logBackIn'));\n this.messagingService.send('logout');\n } catch { }\n }\n}\n","import { PasswordVerificationRequest } from './passwordVerificationRequest';\n\nexport class EmailTokenRequest extends PasswordVerificationRequest {\n newEmail: string;\n masterPasswordHash: string;\n}\n","import {\n Component,\n} from '@angular/core';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { CryptoService } from 'jslib/abstractions/crypto.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\nimport { MessagingService } from 'jslib/abstractions/messaging.service';\n\nimport { EmailRequest } from 'jslib/models/request/emailRequest';\nimport { EmailTokenRequest } from 'jslib/models/request/emailTokenRequest';\n\n@Component({\n selector: 'app-change-email',\n templateUrl: 'change-email.component.html',\n})\nexport class ChangeEmailComponent {\n masterPassword: string;\n newEmail: string;\n token: string;\n tokenSent = false;\n\n formPromise: Promise;\n\n constructor(private apiService: ApiService, private i18nService: I18nService,\n private analytics: Angulartics2, private toasterService: ToasterService,\n private cryptoService: CryptoService, private messagingService: MessagingService) { }\n\n async submit() {\n const hasEncKey = await this.cryptoService.hasEncKey();\n if (!hasEncKey) {\n this.toasterService.popAsync('error', null, this.i18nService.t('updateKey'));\n return;\n }\n\n this.newEmail = this.newEmail.toLowerCase();\n if (!this.tokenSent) {\n const request = new EmailTokenRequest();\n request.newEmail = this.newEmail;\n request.masterPasswordHash = await this.cryptoService.hashPassword(this.masterPassword, null);\n try {\n this.formPromise = this.apiService.postEmailToken(request);\n await this.formPromise;\n this.tokenSent = true;\n } catch { }\n } else {\n const request = new EmailRequest();\n request.token = this.token;\n request.newEmail = this.newEmail;\n request.masterPasswordHash = await this.cryptoService.hashPassword(this.masterPassword, null);\n const newKey = await this.cryptoService.makeKey(this.masterPassword, this.newEmail);\n request.newMasterPasswordHash = await this.cryptoService.hashPassword(this.masterPassword, newKey);\n const encKey = await this.cryptoService.getEncKey();\n const newEncKey = await this.cryptoService.encrypt(encKey.key, newKey);\n request.key = newEncKey.encryptedString;\n try {\n this.formPromise = this.apiService.postEmail(request);\n await this.formPromise;\n this.reset();\n this.analytics.eventTrack.next({ action: 'Changed Email' });\n this.toasterService.popAsync('success', this.i18nService.t('emailChanged'),\n this.i18nService.t('logBackIn'));\n this.messagingService.send('logout');\n } catch { }\n }\n }\n\n reset() {\n this.token = this.newEmail = this.masterPassword = null;\n this.tokenSent = false;\n }\n}\n","import {\r\n Component,\r\n OnInit,\r\n} from '@angular/core';\r\n\r\nimport { ToasterService } from 'angular2-toaster';\r\nimport { Angulartics2 } from 'angulartics2';\r\n\r\nimport { ApiService } from 'jslib/abstractions/api.service';\r\nimport { I18nService } from 'jslib/abstractions/i18n.service';\r\n\r\nimport { UpdateProfileRequest } from 'jslib/models/request/updateProfileRequest';\r\n\r\nimport { ProfileResponse } from 'jslib/models/response/profileResponse';\r\n\r\n@Component({\r\n selector: 'app-profile',\r\n templateUrl: 'profile.component.html',\r\n})\r\nexport class ProfileComponent implements OnInit {\r\n loading = true;\r\n profile: ProfileResponse;\r\n\r\n formPromise: Promise;\r\n\r\n constructor(private apiService: ApiService, private i18nService: I18nService,\r\n private analytics: Angulartics2, private toasterService: ToasterService) { }\r\n\r\n async ngOnInit() {\r\n this.profile = await this.apiService.getProfile();\r\n this.loading = false;\r\n }\r\n\r\n async submit() {\r\n try {\r\n const request = new UpdateProfileRequest(this.profile.name, this.profile.masterPasswordHint);\r\n this.formPromise = this.apiService.putProfile(request);\r\n await this.formPromise;\r\n this.analytics.eventTrack.next({ action: 'Updated Profile' });\r\n this.toasterService.popAsync('success', null, this.i18nService.t('accountUpdated'));\r\n } catch { }\r\n }\r\n}\r\n","import {\n Component,\n EventEmitter,\n Input,\n OnDestroy,\n OnInit,\n Output,\n} from '@angular/core';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { CipherService } from 'jslib/abstractions/cipher.service';\nimport { CollectionService } from 'jslib/abstractions/collection.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\nimport { UserService } from 'jslib/abstractions/user.service';\n\nimport { Organization } from 'jslib/models/domain/organization';\nimport { CipherView } from 'jslib/models/view/cipherView';\nimport { CollectionView } from 'jslib/models/view/collectionView';\n\n@Component({\n selector: 'app-vault-share',\n templateUrl: 'share.component.html',\n})\nexport class ShareComponent implements OnInit, OnDestroy {\n @Input() cipherId: string;\n @Input() organizationId: string;\n @Output() onSharedCipher = new EventEmitter();\n\n formPromise: Promise;\n cipher: CipherView;\n collections: CollectionView[] = [];\n organizations: Organization[] = [];\n\n private writeableCollections: CollectionView[] = [];\n\n constructor(private collectionService: CollectionService, private analytics: Angulartics2,\n private toasterService: ToasterService, private i18nService: I18nService,\n private userService: UserService, private cipherService: CipherService) { }\n\n async ngOnInit() {\n const cipherDomain = await this.cipherService.get(this.cipherId);\n this.cipher = await cipherDomain.decrypt();\n const allCollections = await this.collectionService.getAllDecrypted();\n this.writeableCollections = allCollections.filter((c) => !c.readOnly);\n this.organizations = await this.userService.getAllOrganizations();\n if (this.organizationId == null && this.organizations.length > 0) {\n this.organizationId = this.organizations[0].id;\n }\n this.filterCollections();\n }\n\n ngOnDestroy() {\n this.selectAll(false);\n }\n\n filterCollections() {\n this.selectAll(false);\n if (this.organizationId == null || this.writeableCollections.length === 0) {\n this.collections = [];\n } else {\n this.collections = this.writeableCollections.filter((c) => c.organizationId === this.organizationId);\n }\n }\n\n async submit() {\n const cipherDomain = await this.cipherService.get(this.cipherId);\n const cipherView = await cipherDomain.decrypt();\n\n const attachmentPromises: Array> = [];\n if (cipherView.attachments != null) {\n for (const attachment of cipherView.attachments) {\n const promise = this.cipherService.shareAttachmentWithServer(attachment,\n cipherView.id, this.organizationId);\n attachmentPromises.push(promise);\n }\n }\n\n const checkedCollectionIds = this.collections.filter((c) => (c as any).checked).map((c) => c.id);\n this.formPromise = Promise.all(attachmentPromises).then(async () => {\n await this.cipherService.shareWithServer(cipherView, this.organizationId, checkedCollectionIds);\n this.onSharedCipher.emit();\n this.analytics.eventTrack.next({ action: 'Shared Cipher' });\n this.toasterService.popAsync('success', null, this.i18nService.t('sharedItem'));\n });\n await this.formPromise;\n }\n\n check(c: CollectionView, select?: boolean) {\n (c as any).checked = select == null ? !(c as any).checked : select;\n }\n\n selectAll(select: boolean) {\n const collections = select ? this.collections : this.writeableCollections;\n collections.forEach((c) => this.check(c, select));\n }\n}\n","import { Component } from '@angular/core';\r\n\r\nimport { ToasterService } from 'angular2-toaster';\r\nimport { Angulartics2 } from 'angulartics2';\r\n\r\nimport { FolderService } from 'jslib/abstractions/folder.service';\r\nimport { I18nService } from 'jslib/abstractions/i18n.service';\r\nimport { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';\r\n\r\nimport {\r\n FolderAddEditComponent as BaseFolderAddEditComponent,\r\n} from 'jslib/angular/components/folder-add-edit.component';\r\n\r\n@Component({\r\n selector: 'app-folder-add-edit',\r\n templateUrl: 'folder-add-edit.component.html',\r\n})\r\nexport class FolderAddEditComponent extends BaseFolderAddEditComponent {\r\n constructor(folderService: FolderService, i18nService: I18nService,\r\n analytics: Angulartics2, toasterService: ToasterService,\r\n platformUtilsService: PlatformUtilsService) {\r\n super(folderService, i18nService, analytics, toasterService, platformUtilsService);\r\n }\r\n}\r\n","import {\n Component,\n EventEmitter,\n Input,\n OnInit,\n Output,\n} from '@angular/core';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { CipherService } from 'jslib/abstractions/cipher.service';\nimport { CollectionService } from 'jslib/abstractions/collection.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\nimport { UserService } from 'jslib/abstractions/user.service';\n\nimport { CipherView } from 'jslib/models/view';\nimport { CollectionView } from 'jslib/models/view/collectionView';\n\nimport { Organization } from 'jslib/models/domain/organization';\n\n@Component({\n selector: 'app-vault-bulk-share',\n templateUrl: 'bulk-share.component.html',\n})\nexport class BulkShareComponent implements OnInit {\n @Input() ciphers: CipherView[] = [];\n @Input() organizationId: string;\n @Output() onShared = new EventEmitter();\n\n nonShareableCount = 0;\n collections: CollectionView[] = [];\n organizations: Organization[] = [];\n shareableCiphers: CipherView[] = [];\n formPromise: Promise;\n\n private writeableCollections: CollectionView[] = [];\n\n constructor(private analytics: Angulartics2, private cipherService: CipherService,\n private toasterService: ToasterService, private i18nService: I18nService,\n private collectionService: CollectionService, private userService: UserService) { }\n\n async ngOnInit() {\n this.shareableCiphers = this.ciphers.filter((c) => !c.hasAttachments && c.organizationId == null);\n this.nonShareableCount = this.ciphers.length - this.shareableCiphers.length;\n const allCollections = await this.collectionService.getAllDecrypted();\n this.writeableCollections = allCollections.filter((c) => !c.readOnly);\n this.organizations = await this.userService.getAllOrganizations();\n if (this.organizationId == null && this.organizations.length > 0) {\n this.organizationId = this.organizations[0].id;\n }\n this.filterCollections();\n }\n\n ngOnDestroy() {\n this.selectAll(false);\n }\n\n filterCollections() {\n this.selectAll(false);\n if (this.organizationId == null || this.writeableCollections.length === 0) {\n this.collections = [];\n } else {\n this.collections = this.writeableCollections.filter((c) => c.organizationId === this.organizationId);\n }\n }\n\n async submit() {\n const checkedCollectionIds = this.collections.filter((c) => (c as any).checked).map((c) => c.id);\n this.formPromise = this.cipherService.shareManyWithServer(this.shareableCiphers, this.organizationId,\n checkedCollectionIds);\n await this.formPromise;\n this.onShared.emit();\n this.analytics.eventTrack.next({ action: 'Bulk Shared Items' });\n this.toasterService.popAsync('success', null, this.i18nService.t('sharedItems'));\n }\n\n check(c: CollectionView, select?: boolean) {\n (c as any).checked = select == null ? !(c as any).checked : select;\n }\n\n selectAll(select: boolean) {\n const collections = select ? this.collections : this.writeableCollections;\n collections.forEach((c) => this.check(c, select));\n }\n}\n","import {\r\n Component,\r\n EventEmitter,\r\n Input,\r\n OnInit,\r\n Output,\r\n} from '@angular/core';\r\n\r\nimport { ToasterService } from 'angular2-toaster';\r\nimport { Angulartics2 } from 'angulartics2';\r\n\r\nimport { CipherService } from 'jslib/abstractions/cipher.service';\r\nimport { FolderService } from 'jslib/abstractions/folder.service';\r\nimport { I18nService } from 'jslib/abstractions/i18n.service';\r\n\r\nimport { FolderView } from 'jslib/models/view/folderView';\r\n\r\n@Component({\r\n selector: 'app-vault-bulk-move',\r\n templateUrl: 'bulk-move.component.html',\r\n})\r\nexport class BulkMoveComponent implements OnInit {\r\n @Input() cipherIds: string[] = [];\r\n @Output() onMoved = new EventEmitter();\r\n\r\n folderId: string = null;\r\n folders: FolderView[] = [];\r\n formPromise: Promise;\r\n\r\n constructor(private analytics: Angulartics2, private cipherService: CipherService,\r\n private toasterService: ToasterService, private i18nService: I18nService,\r\n private folderService: FolderService) { }\r\n\r\n async ngOnInit() {\r\n this.folders = await this.folderService.getAllDecrypted();\r\n this.folderId = this.folders[0].id;\r\n }\r\n\r\n async submit() {\r\n this.formPromise = this.cipherService.moveManyWithServer(this.cipherIds, this.folderId);\r\n await this.formPromise;\r\n this.onMoved.emit();\r\n this.analytics.eventTrack.next({ action: 'Bulk Moved Items' });\r\n this.toasterService.popAsync('success', null, this.i18nService.t('movedItems'));\r\n }\r\n}\r\n","import {\r\n Component,\r\n EventEmitter,\r\n Input,\r\n Output,\r\n} from '@angular/core';\r\n\r\nimport { ToasterService } from 'angular2-toaster';\r\nimport { Angulartics2 } from 'angulartics2';\r\n\r\nimport { CipherService } from 'jslib/abstractions/cipher.service';\r\nimport { I18nService } from 'jslib/abstractions/i18n.service';\r\n\r\n@Component({\r\n selector: 'app-vault-bulk-delete',\r\n templateUrl: 'bulk-delete.component.html',\r\n})\r\nexport class BulkDeleteComponent {\r\n @Input() cipherIds: string[] = [];\r\n @Output() onDeleted = new EventEmitter();\r\n\r\n formPromise: Promise;\r\n\r\n constructor(private analytics: Angulartics2, private cipherService: CipherService,\r\n private toasterService: ToasterService, private i18nService: I18nService) { }\r\n\r\n async submit() {\r\n this.formPromise = this.cipherService.deleteManyWithServer(this.cipherIds);\r\n await this.formPromise;\r\n this.onDeleted.emit();\r\n this.analytics.eventTrack.next({ action: 'Bulk Deleted Items' });\r\n this.toasterService.popAsync('success', null, this.i18nService.t('deletedItems'));\r\n }\r\n}\r\n","import { CipherRequest } from './cipherRequest';\n\nimport { Cipher } from '../domain/cipher';\n\nexport class CipherWithIdRequest extends CipherRequest {\n id: string;\n\n constructor(cipher: Cipher) {\n super(cipher);\n this.id = cipher.id;\n }\n}\n","import { Component } from '@angular/core';\n\nimport {\n Toast,\n ToasterService,\n} from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { CipherService } from 'jslib/abstractions/cipher.service';\nimport { CryptoService } from 'jslib/abstractions/crypto.service';\nimport { FolderService } from 'jslib/abstractions/folder.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\nimport { MessagingService } from 'jslib/abstractions/messaging.service';\nimport { SyncService } from 'jslib/abstractions/sync.service';\n\nimport { CipherString } from 'jslib/models/domain/cipherString';\n\nimport { CipherWithIdRequest } from 'jslib/models/request/cipherWithIdRequest';\nimport { FolderWithIdRequest } from 'jslib/models/request/folderWithIdRequest';\nimport { UpdateKeyRequest } from 'jslib/models/request/updateKeyRequest';\n\n@Component({\n selector: 'app-update-key',\n templateUrl: 'update-key.component.html',\n})\nexport class UpdateKeyComponent {\n masterPassword: string;\n formPromise: Promise;\n\n constructor(private apiService: ApiService, private i18nService: I18nService,\n private analytics: Angulartics2, private toasterService: ToasterService,\n private cryptoService: CryptoService, private messagingService: MessagingService,\n private syncService: SyncService, private folderService: FolderService,\n private cipherService: CipherService) { }\n\n async submit() {\n const hasEncKey = await this.cryptoService.hasEncKey();\n if (hasEncKey) {\n return;\n }\n\n if (this.masterPassword == null || this.masterPassword === '') {\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'),\n this.i18nService.t('masterPassRequired'));\n return;\n }\n\n try {\n this.formPromise = this.makeRequest().then((request) => {\n return this.apiService.postAccountKey(request);\n });\n await this.formPromise;\n this.analytics.eventTrack.next({ action: 'Key Updated' });\n const toast: Toast = {\n type: 'success',\n title: this.i18nService.t('keyUpdated'),\n body: this.i18nService.t('logBackInOthersToo'),\n timeout: 15000,\n };\n this.toasterService.popAsync(toast);\n this.messagingService.send('logout');\n } catch { }\n }\n\n private async makeRequest(): Promise {\n const key = await this.cryptoService.getKey();\n const encKey = await this.cryptoService.makeEncKey(key);\n const privateKey = await this.cryptoService.getPrivateKey();\n let encPrivateKey: CipherString = null;\n if (privateKey != null) {\n encPrivateKey = await this.cryptoService.encrypt(privateKey, encKey[0]);\n }\n const request = new UpdateKeyRequest();\n request.privateKey = encPrivateKey != null ? encPrivateKey.encryptedString : null;\n request.key = encKey[1].encryptedString;\n request.masterPasswordHash = await this.cryptoService.hashPassword(this.masterPassword, null);\n\n await this.syncService.fullSync(true);\n\n const folders = await this.folderService.getAllDecrypted();\n for (let i = 0; i < folders.length; i++) {\n if (folders[i].id == null) {\n continue;\n }\n const folder = await this.folderService.encrypt(folders[i], encKey[0]);\n request.folders.push(new FolderWithIdRequest(folder));\n }\n\n const ciphers = await this.cipherService.getAllDecrypted();\n for (let i = 0; i < ciphers.length; i++) {\n if (ciphers[i].organizationId != null) {\n continue;\n }\n const cipher = await this.cipherService.encrypt(ciphers[i], encKey[0]);\n request.ciphers.push(new CipherWithIdRequest(cipher));\n }\n\n return request;\n }\n}\n","\r\n

\r\n \r\n

\r\n \r\n \r\n

{{'noOrganizationsList' | i18n}}

\r\n
\r\n \r\n \r\n {{'newOrganization' | i18n}}\r\n \r\n
\r\n\r\n
\r\n

\r\n {{'organizations' | i18n}}\r\n \r\n \r\n \r\n

\r\n \r\n \r\n {{'newOrganization' | i18n}}\r\n \r\n
\r\n \r\n \r\n \r\n

{{'noOrganizationsList' | i18n}}

\r\n \r\n \r\n {{'newOrganization' | i18n}}\r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n \r\n {{o.name}}\r\n \r\n
\r\n \r\n \r\n
\r\n
\r\n
\r\n
\r\n","import {\n Pipe,\n PipeTransform,\n} from '@angular/core';\n\nimport { CipherView } from '../../models/view/cipherView';\n\nimport { PlatformUtilsService } from '../../abstractions/platformUtils.service';\n\nimport { DeviceType } from '../../enums';\n\n@Pipe({\n name: 'searchCiphers',\n})\nexport class SearchCiphersPipe implements PipeTransform {\n private onlySearchName = false;\n\n constructor(platformUtilsService: PlatformUtilsService) {\n this.onlySearchName = platformUtilsService.getDevice() === DeviceType.EdgeExtension;\n }\n\n transform(ciphers: CipherView[], searchText: string): CipherView[] {\n if (ciphers == null || ciphers.length === 0) {\n return [];\n }\n\n if (searchText == null || searchText.length < 2) {\n return ciphers;\n }\n\n searchText = searchText.trim().toLowerCase();\n return ciphers.filter((c) => {\n if (c.name != null && c.name.toLowerCase().indexOf(searchText) > -1) {\n return true;\n }\n if (this.onlySearchName) {\n return false;\n }\n if (searchText.length >= 8 && c.id.startsWith(searchText)) {\n return true;\n }\n if (c.subTitle != null && c.subTitle.toLowerCase().indexOf(searchText) > -1) {\n return true;\n }\n if (c.login && c.login.uri != null && c.login.uri.toLowerCase().indexOf(searchText) > -1) {\n return true;\n }\n\n return false;\n });\n }\n}\n","
\r\n \"\"\r\n \r\n
\r\n","import { Component } from '@angular/core';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\n\n@Component({\n selector: 'app-verify-email',\n templateUrl: 'verify-email.component.html',\n})\nexport class VerifyEmailComponent {\n actionPromise: Promise;\n\n constructor(private apiService: ApiService, private i18nService: I18nService,\n private analytics: Angulartics2, private toasterService: ToasterService) { }\n\n async send() {\n if (this.actionPromise != null) {\n return;\n }\n try {\n this.actionPromise = this.apiService.postAccountVerifyEmail();\n await this.actionPromise;\n this.analytics.eventTrack.next({ action: 'Sent Verification Email' });\n this.toasterService.popAsync('success', null, this.i18nService.t('checkInboxForVerification'));\n } catch { }\n this.actionPromise = null;\n }\n}\n","
\n
\n
\n © {{year}}, 8bit Solutions LLC\n
\n
\n
\n {{'versionNumber' | i18n : version}}\n
\n
\n
\n","\n","export class KeysRequest {\n publicKey: string;\n encryptedPrivateKey: string;\n\n constructor(publicKey: string, encryptedPrivateKey: string) {\n this.publicKey = publicKey;\n this.encryptedPrivateKey = encryptedPrivateKey;\n }\n}\n","import { PasswordVerificationRequest } from './passwordVerificationRequest';\n\nexport class TwoFactorEmailRequest extends PasswordVerificationRequest {\n email: string;\n\n constructor(email: string, masterPasswordHash: string) {\n super();\n this.masterPasswordHash = masterPasswordHash;\n this.email = email;\n }\n}\n","import { Component } from '@angular/core';\r\nimport { Router } from '@angular/router';\r\n\r\nimport { ToasterService } from 'angular2-toaster';\r\nimport { Angulartics2 } from 'angulartics2';\r\n\r\nimport { AuthService } from 'jslib/abstractions/auth.service';\r\nimport { I18nService } from 'jslib/abstractions/i18n.service';\r\nimport { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';\r\n\r\nimport {\r\n TwoFactorOptionsComponent as BaseTwoFactorOptionsComponent,\r\n} from 'jslib/angular/components/two-factor-options.component';\r\n\r\n@Component({\r\n selector: 'app-two-factor-options',\r\n templateUrl: 'two-factor-options.component.html',\r\n})\r\nexport class TwoFactorOptionsComponent extends BaseTwoFactorOptionsComponent {\r\n constructor(authService: AuthService, router: Router,\r\n analytics: Angulartics2, toasterService: ToasterService,\r\n i18nService: I18nService, platformUtilsService: PlatformUtilsService) {\r\n super(authService, router, analytics, toasterService, i18nService, platformUtilsService, window);\r\n }\r\n}\r\n","import * as jq from 'jquery';\nimport * as _swal from 'sweetalert';\nimport { SweetAlert } from 'sweetalert/typings/core';\n\nimport {\n ToasterConfig,\n ToasterService,\n} from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\nimport { Angulartics2GoogleAnalytics } from 'angulartics2/ga';\n\nimport {\n Component,\n NgZone,\n OnDestroy,\n OnInit,\n} from '@angular/core';\nimport {\n NavigationEnd,\n Router,\n} from '@angular/router';\n\nimport { BroadcasterService } from 'jslib/angular/services/broadcaster.service';\n\nimport { StorageService } from 'jslib/abstractions/storage.service';\n\nimport { AuthService } from 'jslib/abstractions/auth.service';\nimport { CipherService } from 'jslib/abstractions/cipher.service';\nimport { CollectionService } from 'jslib/abstractions/collection.service';\nimport { CryptoService } from 'jslib/abstractions/crypto.service';\nimport { FolderService } from 'jslib/abstractions/folder.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\nimport { LockService } from 'jslib/abstractions/lock.service';\nimport { PasswordGenerationService } from 'jslib/abstractions/passwordGeneration.service';\nimport { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';\nimport { SettingsService } from 'jslib/abstractions/settings.service';\nimport { SyncService } from 'jslib/abstractions/sync.service';\nimport { TokenService } from 'jslib/abstractions/token.service';\nimport { UserService } from 'jslib/abstractions/user.service';\n\nimport { ConstantsService } from 'jslib/services/constants.service';\n\nimport { RouterService } from './services/router.service';\n\nconst BroadcasterSubscriptionId = 'AppComponent';\n// Hack due to Angular 5.2 bug\nconst swal: SweetAlert = _swal as any;\n\n@Component({\n selector: 'app-root',\n templateUrl: 'app.component.html',\n})\nexport class AppComponent implements OnDestroy, OnInit {\n toasterConfig: ToasterConfig = new ToasterConfig({\n showCloseButton: true,\n mouseoverTimerStop: true,\n animation: 'flyRight',\n limit: 5,\n });\n\n private lastActivity: number = null;\n\n constructor(private angulartics2GoogleAnalytics: Angulartics2GoogleAnalytics,\n private broadcasterService: BroadcasterService, private userService: UserService,\n private tokenService: TokenService, private folderService: FolderService,\n private settingsService: SettingsService, private syncService: SyncService,\n private passwordGenerationService: PasswordGenerationService, private cipherService: CipherService,\n private authService: AuthService, private router: Router, private analytics: Angulartics2,\n private toasterService: ToasterService, private i18nService: I18nService,\n private platformUtilsService: PlatformUtilsService, private ngZone: NgZone,\n private lockService: LockService, private storageService: StorageService,\n private cryptoService: CryptoService, private collectionService: CollectionService,\n private routerService: RouterService) { }\n\n ngOnInit() {\n this.ngZone.runOutsideAngular(() => {\n window.onmousemove = () => this.recordActivity();\n window.onmousedown = () => this.recordActivity();\n window.ontouchstart = () => this.recordActivity();\n window.onclick = () => this.recordActivity();\n window.onscroll = () => this.recordActivity();\n window.onkeypress = () => this.recordActivity();\n });\n\n this.broadcasterService.subscribe(BroadcasterSubscriptionId, async (message: any) => {\n this.ngZone.run(async () => {\n switch (message.command) {\n case 'loggedIn':\n case 'unlocked':\n case 'loggedOut':\n break;\n case 'logout':\n this.logOut(!!message.expired);\n break;\n case 'lockVault':\n await this.lockService.lock();\n break;\n case 'locked':\n this.router.navigate(['lock']);\n break;\n case 'syncStarted':\n break;\n case 'syncCompleted':\n break;\n case 'upgradeOrganization':\n const upgradeConfirmed = await this.platformUtilsService.showDialog(\n this.i18nService.t('upgradeOrganizationDesc'), this.i18nService.t('upgradeOrganization'),\n this.i18nService.t('upgradeOrganization'), this.i18nService.t('cancel'));\n if (upgradeConfirmed) {\n this.router.navigate(['organizations', message.organizationId, 'settings', 'billing']);\n }\n break;\n case 'premiumRequired':\n const premiumConfirmed = await this.platformUtilsService.showDialog(\n this.i18nService.t('premiumRequiredDesc'), this.i18nService.t('premiumRequired'),\n this.i18nService.t('learnMore'), this.i18nService.t('cancel'));\n if (premiumConfirmed) {\n this.router.navigate(['settings/premium']);\n }\n break;\n default:\n break;\n }\n });\n });\n\n this.router.events.subscribe((event) => {\n if (event instanceof NavigationEnd) {\n const modals = Array.from(document.querySelectorAll('.modal'));\n for (const modal of modals) {\n (jq(modal) as any).modal('hide');\n }\n\n if (document.querySelector('.swal-modal') != null) {\n swal.close(undefined);\n }\n }\n });\n }\n\n ngOnDestroy() {\n this.broadcasterService.unsubscribe(BroadcasterSubscriptionId);\n }\n\n private async logOut(expired: boolean) {\n const userId = await this.userService.getUserId();\n\n await Promise.all([\n this.syncService.setLastSync(new Date(0)),\n this.tokenService.clearToken(),\n this.cryptoService.clearKeys(),\n this.userService.clear(),\n this.settingsService.clear(userId),\n this.cipherService.clear(userId),\n this.folderService.clear(userId),\n this.collectionService.clear(userId),\n this.passwordGenerationService.clear(),\n ]);\n\n this.authService.logOut(async () => {\n this.analytics.eventTrack.next({ action: 'Logged Out' });\n if (expired) {\n this.toasterService.popAsync('warning', this.i18nService.t('loggedOut'),\n this.i18nService.t('loginExpired'));\n }\n this.router.navigate(['/']);\n });\n }\n\n private async recordActivity() {\n const now = (new Date()).getTime();\n if (this.lastActivity != null && now - this.lastActivity < 250) {\n return;\n }\n\n this.lastActivity = now;\n this.storageService.save(ConstantsService.lastActiveKey, now);\n }\n}\n","function webpackEmptyAsyncContext(req) {\n\t// Here Promise.resolve().then() is used instead of new Promise() to prevent\n\t// uncaught exception popping up in devtools\n\treturn Promise.resolve().then(function() {\n\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\te.code = 'MODULE_NOT_FOUND';\n\t\tthrow e;\n\t});\n}\nwebpackEmptyAsyncContext.keys = function() { return []; };\nwebpackEmptyAsyncContext.resolve = webpackEmptyAsyncContext;\nmodule.exports = webpackEmptyAsyncContext;\nwebpackEmptyAsyncContext.id = 589;","import { NgModule } from '@angular/core';\nimport {\n RouterModule,\n Routes,\n} from '@angular/router';\n\nimport { FrontendLayoutComponent } from './layouts/frontend-layout.component';\nimport { OrganizationLayoutComponent } from './layouts/organization-layout.component';\nimport { UserLayoutComponent } from './layouts/user-layout.component';\n\nimport { AcceptOrganizationComponent } from './accounts/accept-organization.component';\nimport { HintComponent } from './accounts/hint.component';\nimport { LockComponent } from './accounts/lock.component';\nimport { LoginComponent } from './accounts/login.component';\nimport { RecoverDeleteComponent } from './accounts/recover-delete.component';\nimport { RecoverTwoFactorComponent } from './accounts/recover-two-factor.component';\nimport { RegisterComponent } from './accounts/register.component';\nimport { TwoFactorComponent } from './accounts/two-factor.component';\nimport { VerifyEmailTokenComponent } from './accounts/verify-email-token.component';\nimport { VerifyRecoverDeleteComponent } from './accounts/verify-recover-delete.component';\n\nimport { CollectionsComponent as OrgManageCollectionsComponent } from './organizations/manage/collections.component';\nimport { EventsComponent as OrgEventsComponent } from './organizations/manage/events.component';\nimport { GroupsComponent as OrgGroupsComponent } from './organizations/manage/groups.component';\nimport { ManageComponent as OrgManageComponent } from './organizations/manage/manage.component';\nimport { PeopleComponent as OrgPeopleComponent } from './organizations/manage/people.component';\n\nimport { AccountComponent as OrgAccountComponent } from './organizations/settings/account.component';\nimport { OrganizationBillingComponent } from './organizations/settings/organization-billing.component';\nimport { SettingsComponent as OrgSettingsComponent } from './organizations/settings/settings.component';\nimport {\n TwoFactorSetupComponent as OrgTwoFactorSetupComponent,\n} from './organizations/settings/two-factor-setup.component';\n\nimport { ExportComponent as OrgExportComponent } from './organizations/tools/export.component';\nimport { ImportComponent as OrgImportComponent } from './organizations/tools/import.component';\nimport { ToolsComponent as OrgToolsComponent } from './organizations/tools/tools.component';\n\nimport { VaultComponent as OrgVaultComponent } from './organizations/vault/vault.component';\n\nimport { AccountComponent } from './settings/account.component';\nimport { CreateOrganizationComponent } from './settings/create-organization.component';\nimport { DomainRulesComponent } from './settings/domain-rules.component';\nimport { OptionsComponent } from './settings/options.component';\nimport { OrganizationsComponent } from './settings/organizations.component';\nimport { PremiumComponent } from './settings/premium.component';\nimport { SettingsComponent } from './settings/settings.component';\nimport { TwoFactorSetupComponent } from './settings/two-factor-setup.component';\nimport { UserBillingComponent } from './settings/user-billing.component';\n\nimport { BreachReportComponent } from './tools/breach-report.component';\nimport { ExportComponent } from './tools/export.component';\nimport { ImportComponent } from './tools/import.component';\nimport { PasswordGeneratorComponent } from './tools/password-generator.component';\nimport { ToolsComponent } from './tools/tools.component';\n\nimport { VaultComponent } from './vault/vault.component';\n\nimport { OrganizationGuardService } from './services/organization-guard.service';\nimport { OrganizationTypeGuardService } from './services/organization-type-guard.service';\nimport { UnauthGuardService } from './services/unauth-guard.service';\n\nimport { AuthGuardService } from 'jslib/angular/services/auth-guard.service';\n\nimport { OrganizationUserType } from 'jslib/enums/organizationUserType';\n\nconst routes: Routes = [\n {\n path: '',\n component: FrontendLayoutComponent,\n children: [\n { path: '', pathMatch: 'full', component: LoginComponent, canActivate: [UnauthGuardService] },\n { path: '2fa', component: TwoFactorComponent, canActivate: [UnauthGuardService] },\n {\n path: 'register', component: RegisterComponent,\n canActivate: [UnauthGuardService],\n data: { titleId: 'createAccount' },\n },\n {\n path: 'hint', component: HintComponent,\n canActivate: [UnauthGuardService],\n data: { titleId: 'passwordHint' },\n },\n { path: 'lock', component: LockComponent },\n { path: 'verify-email', component: VerifyEmailTokenComponent },\n {\n path: 'accept-organization',\n component: AcceptOrganizationComponent,\n data: { titleId: 'joinOrganization' },\n },\n { path: 'recover', pathMatch: 'full', redirectTo: 'recover-2fa' },\n {\n path: 'recover-2fa',\n component: RecoverTwoFactorComponent,\n canActivate: [UnauthGuardService],\n data: { titleId: 'recoverAccountTwoStep' },\n },\n {\n path: 'recover-delete',\n component: RecoverDeleteComponent,\n canActivate: [UnauthGuardService],\n data: { titleId: 'deleteAccount' },\n },\n {\n path: 'verify-recover-delete',\n component: VerifyRecoverDeleteComponent,\n canActivate: [UnauthGuardService],\n data: { titleId: 'deleteAccount' },\n },\n ],\n },\n {\n path: '',\n component: UserLayoutComponent,\n canActivate: [AuthGuardService],\n children: [\n { path: 'vault', component: VaultComponent, data: { titleId: 'myVault' } },\n {\n path: 'settings',\n component: SettingsComponent,\n children: [\n { path: '', pathMatch: 'full', redirectTo: 'account' },\n { path: 'account', component: AccountComponent, data: { titleId: 'myAccount' } },\n { path: 'options', component: OptionsComponent, data: { titleId: 'options' } },\n { path: 'domain-rules', component: DomainRulesComponent, data: { titleId: 'domainRules' } },\n { path: 'two-factor', component: TwoFactorSetupComponent, data: { titleId: 'twoStepLogin' } },\n { path: 'premium', component: PremiumComponent, data: { titleId: 'goPremium' } },\n { path: 'billing', component: UserBillingComponent, data: { titleId: 'billingAndLicensing' } },\n { path: 'organizations', component: OrganizationsComponent, data: { titleId: 'organizations' } },\n {\n path: 'create-organization',\n component: CreateOrganizationComponent,\n data: { titleId: 'newOrganization' },\n },\n ],\n },\n {\n path: 'tools',\n component: ToolsComponent,\n canActivate: [AuthGuardService],\n children: [\n { path: '', pathMatch: 'full', redirectTo: 'generator' },\n { path: 'import', component: ImportComponent, data: { titleId: 'importData' } },\n { path: 'export', component: ExportComponent, data: { titleId: 'exportVault' } },\n {\n path: 'generator',\n component: PasswordGeneratorComponent,\n data: { titleId: 'passwordGenerator' },\n },\n { path: 'breach-report', component: BreachReportComponent, data: { titleId: 'dataBreachReport' } },\n ],\n },\n ],\n },\n {\n path: 'organizations/:organizationId',\n component: OrganizationLayoutComponent,\n canActivate: [AuthGuardService, OrganizationGuardService],\n children: [\n { path: '', pathMatch: 'full', redirectTo: 'vault' },\n { path: 'vault', component: OrgVaultComponent, data: { titleId: 'vault' } },\n {\n path: 'tools',\n component: OrgToolsComponent,\n canActivate: [OrganizationTypeGuardService],\n data: { allowedTypes: [OrganizationUserType.Owner, OrganizationUserType.Admin] },\n children: [\n { path: '', pathMatch: 'full', redirectTo: 'import' },\n { path: 'import', component: OrgImportComponent, data: { titleId: 'importData' } },\n { path: 'export', component: OrgExportComponent, data: { titleId: 'exportVault' } },\n ],\n },\n {\n path: 'manage',\n component: OrgManageComponent,\n canActivate: [OrganizationTypeGuardService],\n data: { allowedTypes: [OrganizationUserType.Owner, OrganizationUserType.Admin] },\n children: [\n { path: '', pathMatch: 'full', redirectTo: 'people' },\n { path: 'collections', component: OrgManageCollectionsComponent, data: { titleId: 'collections' } },\n { path: 'events', component: OrgEventsComponent, data: { titleId: 'eventLogs' } },\n { path: 'groups', component: OrgGroupsComponent, data: { titleId: 'groups' } },\n { path: 'people', component: OrgPeopleComponent, data: { titleId: 'people' } },\n ],\n },\n {\n path: 'settings',\n component: OrgSettingsComponent,\n canActivate: [OrganizationTypeGuardService],\n data: { allowedTypes: [OrganizationUserType.Owner] },\n children: [\n { path: '', pathMatch: 'full', redirectTo: 'account' },\n { path: 'account', component: OrgAccountComponent, data: { titleId: 'myOrganization' } },\n { path: 'two-factor', component: OrgTwoFactorSetupComponent, data: { titleId: 'twoStepLogin' } },\n {\n path: 'billing',\n component: OrganizationBillingComponent,\n data: { titleId: 'billingAndLicensing' },\n },\n ],\n },\n ],\n },\n { path: '**', redirectTo: '' },\n];\n\n@NgModule({\n imports: [RouterModule.forRoot(routes, {\n useHash: true,\n /*enableTracing: true,*/\n })],\n exports: [RouterModule],\n})\nexport class AppRoutingModule { }\n","export class DecryptParameters {\n encKey: T;\n data: T;\n iv: T;\n macKey: T;\n mac: T;\n macData: T;\n}\n","import * as forge from 'node-forge';\n\nimport { CryptoFunctionService } from '../abstractions/cryptoFunction.service';\nimport { PlatformUtilsService } from '../abstractions/platformUtils.service';\n\nimport { Utils } from '../misc/utils';\n\nimport { SymmetricCryptoKey } from '../models/domain';\nimport { DecryptParameters } from '../models/domain/decryptParameters';\n\nexport class WebCryptoFunctionService implements CryptoFunctionService {\n private crypto: Crypto;\n private subtle: SubtleCrypto;\n private isEdge: boolean;\n private isIE: boolean;\n\n constructor(private win: Window, private platformUtilsService: PlatformUtilsService) {\n this.crypto = typeof win.crypto !== 'undefined' ? win.crypto : null;\n this.subtle = (!!this.crypto && typeof win.crypto.subtle !== 'undefined') ? win.crypto.subtle : null;\n this.isEdge = platformUtilsService.isEdge();\n this.isIE = platformUtilsService.isIE();\n }\n\n async pbkdf2(password: string | ArrayBuffer, salt: string | ArrayBuffer, algorithm: 'sha256' | 'sha512',\n iterations: number): Promise {\n if (this.isEdge || this.isIE) {\n const forgeLen = algorithm === 'sha256' ? 32 : 64;\n const passwordBytes = this.toByteString(password);\n const saltBytes = this.toByteString(salt);\n const derivedKeyBytes = (forge as any).pbkdf2(passwordBytes, saltBytes, iterations, forgeLen, algorithm);\n return Utils.fromByteStringToArray(derivedKeyBytes).buffer;\n }\n\n const wcLen = algorithm === 'sha256' ? 256 : 512;\n const passwordBuf = this.toBuf(password);\n const saltBuf = this.toBuf(salt);\n\n const pbkdf2Params: Pbkdf2Params = {\n name: 'PBKDF2',\n salt: saltBuf,\n iterations: iterations,\n hash: { name: this.toWebCryptoAlgorithm(algorithm) },\n };\n\n const impKey = await this.subtle.importKey('raw', passwordBuf, { name: 'PBKDF2' } as any,\n false, ['deriveBits']);\n return await this.subtle.deriveBits(pbkdf2Params, impKey, wcLen);\n }\n\n async hash(value: string | ArrayBuffer, algorithm: 'sha1' | 'sha256' | 'sha512'): Promise {\n if ((this.isEdge || this.isIE) && algorithm === 'sha1') {\n const md = forge.md.sha1.create();\n const valueBytes = this.toByteString(value);\n md.update(valueBytes, 'raw');\n return Utils.fromByteStringToArray(md.digest().data).buffer;\n }\n\n const valueBuf = this.toBuf(value);\n return await this.subtle.digest({ name: this.toWebCryptoAlgorithm(algorithm) }, valueBuf);\n }\n\n async hmac(value: ArrayBuffer, key: ArrayBuffer, algorithm: 'sha1' | 'sha256' | 'sha512'): Promise {\n const signingAlgorithm = {\n name: 'HMAC',\n hash: { name: this.toWebCryptoAlgorithm(algorithm) },\n };\n\n const impKey = await this.subtle.importKey('raw', key, signingAlgorithm, false, ['sign']);\n return await this.subtle.sign(signingAlgorithm, impKey, value);\n }\n\n // Safely compare two values in a way that protects against timing attacks (Double HMAC Verification).\n // ref: https://www.nccgroup.trust/us/about-us/newsroom-and-events/blog/2011/february/double-hmac-verification/\n // ref: https://paragonie.com/blog/2015/11/preventing-timing-attacks-on-string-comparison-with-double-hmac-strategy\n async compare(a: ArrayBuffer, b: ArrayBuffer): Promise {\n const macKey = await this.randomBytes(32);\n const signingAlgorithm = {\n name: 'HMAC',\n hash: { name: 'SHA-256' },\n };\n const impKey = await this.subtle.importKey('raw', macKey, signingAlgorithm, false, ['sign']);\n const mac1 = await this.subtle.sign(signingAlgorithm, impKey, a);\n const mac2 = await this.subtle.sign(signingAlgorithm, impKey, b);\n\n if (mac1.byteLength !== mac2.byteLength) {\n return false;\n }\n\n const arr1 = new Uint8Array(mac1);\n const arr2 = new Uint8Array(mac2);\n for (let i = 0; i < arr2.length; i++) {\n if (arr1[i] !== arr2[i]) {\n return false;\n }\n }\n\n return true;\n }\n\n hmacFast(value: string, key: string, algorithm: 'sha1' | 'sha256' | 'sha512'): Promise {\n const hmac = (forge as any).hmac.create();\n hmac.start(algorithm, key);\n hmac.update(value);\n const bytes = hmac.digest().getBytes();\n return Promise.resolve(bytes);\n }\n\n async compareFast(a: string, b: string): Promise {\n const rand = await this.randomBytes(32);\n const bytes = new Uint32Array(rand);\n const buffer = forge.util.createBuffer();\n for (let i = 0; i < bytes.length; i++) {\n buffer.putInt32(bytes[i]);\n }\n const macKey = buffer.getBytes();\n\n const hmac = (forge as any).hmac.create();\n hmac.start('sha256', macKey);\n hmac.update(a);\n const mac1 = hmac.digest().getBytes();\n\n hmac.start(null, null);\n hmac.update(b);\n const mac2 = hmac.digest().getBytes();\n\n const equals = mac1 === mac2;\n return equals;\n }\n\n async aesEncrypt(data: ArrayBuffer, iv: ArrayBuffer, key: ArrayBuffer): Promise {\n const impKey = await this.subtle.importKey('raw', key, { name: 'AES-CBC' } as any, false, ['encrypt']);\n return await this.subtle.encrypt({ name: 'AES-CBC', iv: iv }, impKey, data);\n }\n\n aesDecryptFastParameters(data: string, iv: string, mac: string, key: SymmetricCryptoKey):\n DecryptParameters {\n const p = new DecryptParameters();\n if (key.meta != null) {\n p.encKey = key.meta.encKeyByteString;\n p.macKey = key.meta.macKeyByteString;\n }\n\n if (p.encKey == null) {\n p.encKey = forge.util.decode64(key.encKeyB64);\n }\n p.data = forge.util.decode64(data);\n p.iv = forge.util.decode64(iv);\n p.macData = p.iv + p.data;\n if (p.macKey == null && key.macKeyB64 != null) {\n p.macKey = forge.util.decode64(key.macKeyB64);\n }\n if (mac != null) {\n p.mac = forge.util.decode64(mac);\n }\n\n // cache byte string keys for later\n if (key.meta == null) {\n key.meta = {};\n }\n if (key.meta.encKeyByteString == null) {\n key.meta.encKeyByteString = p.encKey;\n }\n if (p.macKey != null && key.meta.macKeyByteString == null) {\n key.meta.macKeyByteString = p.macKey;\n }\n\n return p;\n }\n\n aesDecryptFast(parameters: DecryptParameters): Promise {\n const dataBuffer = (forge as any).util.createBuffer(parameters.data);\n const decipher = (forge as any).cipher.createDecipher('AES-CBC', parameters.encKey);\n decipher.start({ iv: parameters.iv });\n decipher.update(dataBuffer);\n decipher.finish();\n const val = decipher.output.toString('utf8');\n return Promise.resolve(val);\n }\n\n async aesDecrypt(data: ArrayBuffer, iv: ArrayBuffer, key: ArrayBuffer): Promise {\n const impKey = await this.subtle.importKey('raw', key, { name: 'AES-CBC' } as any, false, ['decrypt']);\n return await this.subtle.decrypt({ name: 'AES-CBC', iv: iv }, impKey, data);\n }\n\n async rsaEncrypt(data: ArrayBuffer, publicKey: ArrayBuffer, algorithm: 'sha1' | 'sha256'): Promise {\n // Note: Edge browser requires that we specify name and hash for both key import and decrypt.\n // We cannot use the proper types here.\n const rsaParams = {\n name: 'RSA-OAEP',\n hash: { name: this.toWebCryptoAlgorithm(algorithm) },\n };\n const impKey = await this.subtle.importKey('spki', publicKey, rsaParams, false, ['encrypt']);\n return await this.subtle.encrypt(rsaParams, impKey, data);\n }\n\n async rsaDecrypt(data: ArrayBuffer, privateKey: ArrayBuffer, algorithm: 'sha1' | 'sha256'): Promise {\n // Note: Edge browser requires that we specify name and hash for both key import and decrypt.\n // We cannot use the proper types here.\n const rsaParams = {\n name: 'RSA-OAEP',\n hash: { name: this.toWebCryptoAlgorithm(algorithm) },\n };\n const impKey = await this.subtle.importKey('pkcs8', privateKey, rsaParams, false, ['decrypt']);\n return await this.subtle.decrypt(rsaParams, impKey, data);\n }\n\n async rsaExtractPublicKey(privateKey: ArrayBuffer): Promise {\n const rsaParams = {\n name: 'RSA-OAEP',\n // Have to specify some algorithm\n hash: { name: this.toWebCryptoAlgorithm('sha1') },\n };\n const impPrivateKey = await this.subtle.importKey('pkcs8', privateKey, rsaParams, true, ['decrypt']);\n const jwkPrivateKey = await this.subtle.exportKey('jwk', impPrivateKey);\n const jwkPublicKeyParams = {\n kty: 'RSA',\n e: jwkPrivateKey.e,\n n: jwkPrivateKey.n,\n alg: 'RSA-OAEP',\n ext: true,\n };\n const impPublicKey = await this.subtle.importKey('jwk', jwkPublicKeyParams, rsaParams, true, ['encrypt']);\n return await this.subtle.exportKey('spki', impPublicKey);\n }\n\n async rsaGenerateKeyPair(length: 1024 | 2048 | 4096): Promise<[ArrayBuffer, ArrayBuffer]> {\n const rsaParams = {\n name: 'RSA-OAEP',\n modulusLength: length,\n publicExponent: new Uint8Array([0x01, 0x00, 0x01]), // 65537\n // Have to specify some algorithm\n hash: { name: this.toWebCryptoAlgorithm('sha1') },\n };\n const keyPair = await this.subtle.generateKey(rsaParams, true, ['encrypt', 'decrypt']);\n const publicKey = await this.subtle.exportKey('spki', keyPair.publicKey);\n const privateKey = await this.subtle.exportKey('pkcs8', keyPair.privateKey);\n return [publicKey, privateKey];\n }\n\n randomBytes(length: number): Promise {\n const arr = new Uint8Array(length);\n this.crypto.getRandomValues(arr);\n return Promise.resolve(arr.buffer);\n }\n\n private toBuf(value: string | ArrayBuffer): ArrayBuffer {\n let buf: ArrayBuffer;\n if (typeof (value) === 'string') {\n buf = Utils.fromUtf8ToArray(value).buffer;\n } else {\n buf = value;\n }\n return buf;\n }\n\n private toByteString(value: string | ArrayBuffer): string {\n let bytes: string;\n if (typeof (value) === 'string') {\n bytes = forge.util.encodeUtf8(value);\n } else {\n bytes = Utils.fromBufferToByteString(value);\n }\n return bytes;\n }\n\n private toWebCryptoAlgorithm(algorithm: 'sha1' | 'sha256' | 'sha512'): string {\n return algorithm === 'sha1' ? 'SHA-1' : algorithm === 'sha256' ? 'SHA-256' : 'SHA-512';\n }\n}\n","import * as papa from 'papaparse';\n\nimport { CipherType } from '../enums/cipherType';\n\nimport { ApiService } from '../abstractions/api.service';\nimport { CipherService } from '../abstractions/cipher.service';\nimport { ExportService as ExportServiceAbstraction } from '../abstractions/export.service';\nimport { FolderService } from '../abstractions/folder.service';\n\nimport { CipherView } from '../models/view/cipherView';\nimport { CollectionView } from '../models/view/collectionView';\nimport { FolderView } from '../models/view/folderView';\n\nimport { Cipher } from '../models/domain/cipher';\nimport { Collection } from '../models/domain/collection';\n\nimport { CipherData } from '../models/data/cipherData';\nimport { CollectionData } from '../models/data/collectionData';\nimport { CollectionDetailsResponse } from '../models/response/collectionResponse';\n\nexport class ExportService implements ExportServiceAbstraction {\n constructor(private folderService: FolderService, private cipherService: CipherService,\n private apiService: ApiService) { }\n\n async getExport(format: 'csv' | 'json' = 'csv'): Promise {\n let decFolders: FolderView[] = [];\n let decCiphers: CipherView[] = [];\n const promises = [];\n\n promises.push(this.folderService.getAllDecrypted().then((folders) => {\n decFolders = folders;\n }));\n\n promises.push(this.cipherService.getAllDecrypted().then((ciphers) => {\n decCiphers = ciphers;\n }));\n\n await Promise.all(promises);\n\n const foldersMap = new Map();\n decFolders.forEach((f) => {\n foldersMap.set(f.id, f);\n });\n\n const exportCiphers: any[] = [];\n decCiphers.forEach((c) => {\n // only export logins and secure notes\n if (c.type !== CipherType.Login && c.type !== CipherType.SecureNote) {\n return;\n }\n\n if (c.organizationId != null) {\n return;\n }\n\n const cipher: any = {};\n cipher.folder = c.folderId != null && foldersMap.has(c.folderId) ? foldersMap.get(c.folderId).name : null;\n cipher.favorite = c.favorite ? 1 : null;\n this.buildCommonCipher(cipher, c);\n exportCiphers.push(cipher);\n });\n\n if (format === 'csv') {\n return papa.unparse(exportCiphers);\n } else {\n return JSON.stringify(exportCiphers, null, ' ');\n }\n }\n\n async getOrganizationExport(organizationId: string, format: 'csv' | 'json' = 'csv'): Promise {\n const decCollections: CollectionView[] = [];\n const decCiphers: CipherView[] = [];\n const promises = [];\n\n promises.push(this.apiService.getCollections(organizationId).then((collections) => {\n const collectionPromises: any = [];\n if (collections != null && collections.data != null && collections.data.length > 0) {\n collections.data.forEach((c) => {\n const collection = new Collection(new CollectionData(c as CollectionDetailsResponse));\n collectionPromises.push(collection.decrypt().then((decCol) => {\n decCollections.push(decCol);\n }));\n });\n }\n return Promise.all(collectionPromises);\n }));\n\n promises.push(this.apiService.getCiphersOrganization(organizationId).then((ciphers) => {\n const cipherPromises: any = [];\n if (ciphers != null && ciphers.data != null && ciphers.data.length > 0) {\n ciphers.data.forEach((c) => {\n const cipher = new Cipher(new CipherData(c));\n cipherPromises.push(cipher.decrypt().then((decCipher) => {\n decCiphers.push(decCipher);\n }));\n });\n }\n return Promise.all(cipherPromises);\n }));\n\n await Promise.all(promises);\n\n const collectionsMap = new Map();\n decCollections.forEach((c) => {\n collectionsMap.set(c.id, c);\n });\n\n const exportCiphers: any[] = [];\n decCiphers.forEach((c) => {\n // only export logins and secure notes\n if (c.type !== CipherType.Login && c.type !== CipherType.SecureNote) {\n return;\n }\n\n const cipher: any = {};\n cipher.collections = [];\n if (c.collectionIds != null) {\n cipher.collections = c.collectionIds.filter((id) => collectionsMap.has(id))\n .map((id) => collectionsMap.get(id).name);\n }\n this.buildCommonCipher(cipher, c);\n exportCiphers.push(cipher);\n });\n\n if (format === 'csv') {\n return papa.unparse(exportCiphers);\n } else {\n return JSON.stringify(exportCiphers, null, ' ');\n }\n }\n\n getFileName(prefix: string = null): string {\n const now = new Date();\n const dateString =\n now.getFullYear() + '' + this.padNumber(now.getMonth() + 1, 2) + '' + this.padNumber(now.getDate(), 2) +\n this.padNumber(now.getHours(), 2) + '' + this.padNumber(now.getMinutes(), 2) +\n this.padNumber(now.getSeconds(), 2);\n\n return 'bitwarden' + (prefix ? ('_' + prefix) : '') + '_export_' + dateString + '.csv';\n }\n\n private padNumber(num: number, width: number, padCharacter: string = '0'): string {\n const numString = num.toString();\n return numString.length >= width ? numString :\n new Array(width - numString.length + 1).join(padCharacter) + numString;\n }\n\n private buildCommonCipher(cipher: any, c: CipherView) {\n cipher.type = null;\n cipher.name = c.name;\n cipher.notes = c.notes;\n cipher.fields = null;\n // Login props\n cipher.login_uri = null;\n cipher.login_username = null;\n cipher.login_password = null;\n cipher.login_totp = null;\n\n if (c.fields) {\n c.fields.forEach((f: any) => {\n if (!cipher.fields) {\n cipher.fields = '';\n } else {\n cipher.fields += '\\n';\n }\n\n cipher.fields += ((f.name || '') + ': ' + f.value);\n });\n }\n\n switch (c.type) {\n case CipherType.Login:\n cipher.type = 'login';\n cipher.login_username = c.login.username;\n cipher.login_password = c.login.password;\n cipher.login_totp = c.login.totp;\n\n if (c.login.uris) {\n cipher.login_uri = [];\n c.login.uris.forEach((u) => {\n cipher.login_uri.push(u.uri);\n });\n }\n break;\n case CipherType.SecureNote:\n cipher.type = 'note';\n break;\n default:\n return;\n }\n\n return cipher;\n }\n}\n","import { AppIdService } from '../abstractions/appId.service';\nimport { PlatformUtilsService } from '../abstractions/platformUtils.service';\nimport { StorageService } from '../abstractions/storage.service';\n\nimport { ConstantsService } from '../services/constants.service';\n\nimport { DeviceType } from '../enums/deviceType';\n\nconst GaObj = 'ga';\n\nexport const AnalyticsIds = {\n [DeviceType.ChromeExtension]: 'UA-81915606-6',\n [DeviceType.FirefoxExtension]: 'UA-81915606-7',\n [DeviceType.OperaExtension]: 'UA-81915606-8',\n [DeviceType.EdgeExtension]: 'UA-81915606-9',\n [DeviceType.VivaldiExtension]: 'UA-81915606-15',\n [DeviceType.SafariExtension]: 'UA-81915606-16',\n [DeviceType.WindowsDesktop]: 'UA-81915606-17',\n [DeviceType.LinuxDesktop]: 'UA-81915606-19',\n [DeviceType.MacOsDesktop]: 'UA-81915606-18',\n};\n\nexport class Analytics {\n private gaTrackingId: string = null;\n private defaultDisabled = false;\n private appVersion: string;\n\n constructor(win: Window, private gaFilter?: () => boolean,\n private platformUtilsService?: PlatformUtilsService, private storageService?: StorageService,\n private appIdService?: AppIdService, private dependencyResolver?: () => any) {\n if (dependencyResolver != null) {\n const deps = dependencyResolver();\n if (platformUtilsService == null && deps.platformUtilsService) {\n this.platformUtilsService = deps.platformUtilsService as PlatformUtilsService;\n }\n if (storageService == null && deps.storageService) {\n this.storageService = deps.storageService as StorageService;\n }\n if (appIdService == null && deps.appIdService) {\n this.appIdService = deps.appIdService as AppIdService;\n }\n }\n\n this.appVersion = this.platformUtilsService.getApplicationVersion();\n this.defaultDisabled = this.platformUtilsService.getDevice() === DeviceType.FirefoxExtension ||\n this.platformUtilsService.isMacAppStore();\n this.gaTrackingId = this.platformUtilsService.analyticsId();\n\n (win as any).GoogleAnalyticsObject = GaObj;\n (win as any)[GaObj] = async (action: string, param1: any, param2?: any) => {\n await this.ga(action, param1, param2);\n };\n }\n\n async ga(action: string, param1: any, param2?: any) {\n if (this.gaFilter != null && this.gaFilter()) {\n return;\n }\n\n const disabled = await this.storageService.get(ConstantsService.disableGaKey);\n if ((this.defaultDisabled && disabled == null) || disabled != null && disabled) {\n return;\n }\n\n if (action !== 'send' || !param1) {\n return;\n }\n\n const gaAnonAppId = await this.appIdService.getAnonymousAppId();\n const version = encodeURIComponent(this.appVersion);\n let message = 'v=1&tid=' + this.gaTrackingId + '&cid=' + gaAnonAppId + '&cd1=' + version;\n\n if (param1 === 'pageview' && param2) {\n message += this.gaTrackPageView(param2);\n } else if (typeof param1 === 'object' && param1.hitType === 'pageview') {\n message += this.gaTrackPageView(param1.page);\n } else if (param1 === 'event' && param2) {\n message += this.gaTrackEvent(param2);\n } else if (typeof param1 === 'object' && param1.hitType === 'event') {\n message += this.gaTrackEvent(param1);\n }\n\n const request = new XMLHttpRequest();\n request.open('POST', 'https://www.google-analytics.com/collect', true);\n request.send(message);\n }\n\n private gaTrackEvent(options: any) {\n return '&t=event&ec=' + (options.eventCategory ? encodeURIComponent(options.eventCategory) : 'Event') +\n '&ea=' + encodeURIComponent(options.eventAction) +\n (options.eventLabel ? '&el=' + encodeURIComponent(options.eventLabel) : '') +\n (options.eventValue ? '&ev=' + encodeURIComponent(options.eventValue) : '') +\n (options.page ? '&dp=' + this.cleanPagePath(options.page) : '');\n }\n\n private gaTrackPageView(pagePath: string) {\n return '&t=pageview&dp=' + this.cleanPagePath(pagePath);\n }\n\n private cleanPagePath(pagePath: string) {\n const paramIndex = pagePath.indexOf('?');\n if (paramIndex > -1) {\n pagePath = pagePath.substring(0, paramIndex);\n }\n if (pagePath.indexOf('!/') === 0 || pagePath.indexOf('#/') === 0) {\n pagePath = pagePath.substring(1);\n }\n const pathParts = pagePath.split('/');\n const newPathParts: string[] = [];\n pathParts.forEach((p) => {\n if (p.match(/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i)) {\n newPathParts.push('__guid__');\n } else {\n newPathParts.push(p);\n }\n });\n return encodeURIComponent(newPathParts.join('/'));\n }\n}\n","import * as _swal from 'sweetalert';\nimport { SweetAlert } from 'sweetalert/typings/core';\n\nimport { DeviceType } from 'jslib/enums/deviceType';\n\nimport { I18nService } from 'jslib/abstractions/i18n.service';\nimport { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';\n\nimport { Utils } from 'jslib/misc/utils';\n\n// Hack due to Angular 5.2 bug\nconst swal: SweetAlert = _swal as any;\n\nexport class WebPlatformUtilsService implements PlatformUtilsService {\n identityClientId: string = 'web';\n\n private browserCache: DeviceType = null;\n\n constructor(private i18nService: I18nService) { }\n\n getDevice(): DeviceType {\n if (this.browserCache != null) {\n return this.browserCache;\n }\n\n if (navigator.userAgent.indexOf(' Firefox/') !== -1 || navigator.userAgent.indexOf(' Gecko/') !== -1) {\n this.browserCache = DeviceType.FirefoxBrowser;\n } else if (navigator.userAgent.indexOf(' OPR/') >= 0) {\n this.browserCache = DeviceType.OperaBrowser;\n } else if (navigator.userAgent.indexOf(' Edge/') !== -1) {\n this.browserCache = DeviceType.EdgeBrowser;\n } else if (navigator.userAgent.indexOf(' Vivaldi/') !== -1) {\n this.browserCache = DeviceType.VivaldiBrowser;\n } else if (navigator.userAgent.indexOf(' Safari/') !== -1 && navigator.userAgent.indexOf('Chrome') === -1) {\n this.browserCache = DeviceType.SafariBrowser;\n } else if ((window as any).chrome && navigator.userAgent.indexOf(' Chrome/') !== -1) {\n this.browserCache = DeviceType.ChromeBrowser;\n } else if (navigator.userAgent.indexOf(' Trident/') !== -1) {\n this.browserCache = DeviceType.IEBrowser;\n } else {\n this.browserCache = DeviceType.UnknownBrowser;\n }\n\n return this.browserCache;\n }\n\n getDeviceString(): string {\n const device = DeviceType[this.getDevice()].toLowerCase();\n return device.replace('browser', '');\n }\n\n isFirefox(): boolean {\n return this.getDevice() === DeviceType.FirefoxBrowser;\n }\n\n isChrome(): boolean {\n return this.getDevice() === DeviceType.ChromeBrowser;\n }\n\n isEdge(): boolean {\n return this.getDevice() === DeviceType.EdgeBrowser;\n }\n\n isOpera(): boolean {\n return this.getDevice() === DeviceType.OperaBrowser;\n }\n\n isVivaldi(): boolean {\n return this.getDevice() === DeviceType.VivaldiBrowser;\n }\n\n isSafari(): boolean {\n return this.getDevice() === DeviceType.SafariBrowser;\n }\n\n isIE(): boolean {\n return this.getDevice() === DeviceType.IEBrowser;\n }\n\n isMacAppStore(): boolean {\n return false;\n }\n\n analyticsId(): string {\n return 'UA-81915606-3';\n }\n\n getDomain(uriString: string): string {\n return Utils.getHostname(uriString);\n }\n\n isViewOpen(): boolean {\n return false;\n }\n\n lockTimeout(): number {\n return 15;\n }\n\n launchUri(uri: string, options?: any): void {\n const a = document.createElement('a');\n a.href = uri;\n a.target = '_blank';\n a.rel = 'noreferrer noopener';\n a.classList.add('d-none');\n document.body.appendChild(a);\n a.click();\n document.body.removeChild(a);\n }\n\n saveFile(win: Window, blobData: any, blobOptions: any, fileName: string): void {\n let blob: Blob = null;\n if (blobOptions != null && !this.isIE()) {\n blob = new Blob([blobData], blobOptions);\n } else {\n blob = new Blob([blobData]);\n }\n if (navigator.msSaveOrOpenBlob) {\n navigator.msSaveBlob(blob, fileName);\n } else {\n const a = win.document.createElement('a');\n a.href = win.URL.createObjectURL(blob);\n a.download = fileName;\n a.style.position = 'fixed';\n win.document.body.appendChild(a);\n a.click();\n win.document.body.removeChild(a);\n }\n }\n\n getApplicationVersion(): string {\n return process.env.APPLICATION_VERSION || '-';\n }\n\n supportsU2f(win: Window): boolean {\n if (win != null && (win as any).u2f != null) {\n return true;\n }\n return (this.isChrome() || this.isOpera() || this.isVivaldi()) && !this.isMobile(win);\n }\n\n supportsDuo(): boolean {\n return true;\n }\n\n showToast(type: 'error' | 'success' | 'warning' | 'info', title: string, text: string, global?: any): void {\n throw new Error('showToast not implemented');\n }\n\n async showDialog(text: string, title?: string, confirmText?: string, cancelText?: string, type?: string) {\n const buttons = [confirmText == null ? this.i18nService.t('ok') : confirmText];\n if (cancelText != null) {\n buttons.unshift(cancelText);\n }\n\n const contentDiv = document.createElement('div');\n if (type != null) {\n const icon = document.createElement('i');\n icon.classList.add('swal-custom-icon');\n switch (type) {\n case 'success':\n icon.classList.add('fa', 'fa-check', 'text-success');\n break;\n case 'warning':\n icon.classList.add('fa', 'fa-warning', 'text-warning');\n break;\n case 'error':\n icon.classList.add('fa', 'fa-bolt', 'text-danger');\n break;\n case 'info':\n icon.classList.add('fa', 'fa-info-circle', 'text-info');\n break;\n default:\n break;\n }\n if (icon.classList.contains('fa')) {\n contentDiv.appendChild(icon);\n }\n }\n\n if (title != null) {\n const titleDiv = document.createElement('div');\n titleDiv.classList.add('swal-title');\n titleDiv.appendChild(document.createTextNode(title));\n contentDiv.appendChild(titleDiv);\n }\n\n if (text != null) {\n const textDiv = document.createElement('div');\n textDiv.classList.add('swal-text');\n textDiv.appendChild(document.createTextNode(text));\n contentDiv.appendChild(textDiv);\n }\n\n const confirmed = await swal({\n content: { element: contentDiv },\n buttons: buttons,\n });\n return confirmed;\n }\n\n isDev(): boolean {\n return process.env.ENV === 'development';\n }\n\n isSelfHost(): boolean {\n return process.env.SELF_HOST.toString() === 'true';\n }\n\n copyToClipboard(text: string, options?: any): void {\n const doc = options ? options.doc : window.document;\n if ((window as any).clipboardData && (window as any).clipboardData.setData) {\n // IE specific code path to prevent textarea being shown while dialog is visible.\n (window as any).clipboardData.setData('Text', text);\n } else if (doc.queryCommandSupported && doc.queryCommandSupported('copy')) {\n const textarea = doc.createElement('textarea');\n textarea.textContent = text;\n // Prevent scrolling to bottom of page in MS Edge.\n textarea.style.position = 'fixed';\n doc.body.appendChild(textarea);\n textarea.select();\n\n try {\n // Security exception may be thrown by some browsers.\n doc.execCommand('copy');\n } catch (e) {\n // tslint:disable-next-line\n console.warn('Copy to clipboard failed.', e);\n } finally {\n doc.body.removeChild(textarea);\n }\n }\n }\n\n private isMobile(win: Window) {\n let mobile = false;\n ((a) => {\n // tslint:disable-next-line\n if (/(android|bb\\d+|meego).+mobile|avantgo|bada\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\\-(n|u)|c55\\/|capi|ccwa|cdm\\-|cell|chtm|cldc|cmd\\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\\-s|devi|dica|dmob|do(c|p)o|ds(12|\\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\\-|_)|g1 u|g560|gene|gf\\-5|g\\-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd\\-(m|p|t)|hei\\-|hi(pt|ta)|hp( i|ip)|hs\\-c|ht(c(\\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\\-(20|go|ma)|i230|iac( |\\-|\\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\\/)|klon|kpt |kwc\\-|kyo(c|k)|le(no|xi)|lg( g|\\/(k|l|u)|50|54|\\-[a-w])|libw|lynx|m1\\-w|m3ga|m50\\/|ma(te|ui|xo)|mc(01|21|ca)|m\\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\\-2|po(ck|rt|se)|prox|psio|pt\\-g|qa\\-a|qc(07|12|21|32|60|\\-[2-7]|i\\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\\-|oo|p\\-)|sdk\\/|se(c(\\-|0|1)|47|mc|nd|ri)|sgh\\-|shar|sie(\\-|m)|sk\\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\\-|v\\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\\-|tdg\\-|tel(i|m)|tim\\-|t\\-mo|to(pl|sh)|ts(70|m\\-|m3|m5)|tx\\-9|up(\\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\\-|your|zeto|zte\\-/i.test(a.substr(0, 4))) {\n mobile = true;\n }\n })(win.navigator.userAgent || win.navigator.vendor || (win as any).opera);\n\n return mobile || win.navigator.userAgent.match(/iPad/i) != null;\n }\n}\n","import { StorageService } from 'jslib/abstractions/storage.service';\r\n\r\nexport class MemoryStorageService implements StorageService {\r\n private store = new Map();\r\n\r\n get(key: string): Promise {\r\n if (this.store.has(key)) {\r\n const obj = this.store.get(key);\r\n return Promise.resolve(obj as T);\r\n }\r\n return Promise.resolve(null);\r\n }\r\n\r\n save(key: string, obj: any): Promise {\r\n if (obj == null) {\r\n return this.remove(key);\r\n }\r\n this.store.set(key, obj);\r\n return Promise.resolve();\r\n }\r\n\r\n remove(key: string): Promise {\r\n this.store.delete(key);\r\n return Promise.resolve();\r\n }\r\n}\r\n","import { I18nService as BaseI18nService } from 'jslib/services/i18n.service';\n\nexport class I18nService extends BaseI18nService {\n constructor(systemLanguage: string, localesDirectory: string) {\n super(systemLanguage || 'en-US', localesDirectory, async (formattedLocale: string) => {\n const filePath = this.localesDirectory + '/' + formattedLocale + '/messages.json?cache=' +\n process.env.CACHE_TAG;\n const localesResult = await fetch(filePath);\n const locales = await localesResult.json();\n return locales;\n });\n\n this.supportedTranslationLocales = [\n 'en', 'da', 'sk',\n ];\n }\n}\n","import { OrganizationData } from '../data/organizationData';\n\nimport { OrganizationUserStatusType } from '../../enums/organizationUserStatusType';\nimport { OrganizationUserType } from '../../enums/organizationUserType';\n\nexport class Organization {\n id: string;\n name: string;\n status: OrganizationUserStatusType;\n type: OrganizationUserType;\n enabled: boolean;\n useGroups: boolean;\n useDirectory: boolean;\n useEvents: boolean;\n useTotp: boolean;\n use2fa: boolean;\n selfHost: boolean;\n usersGetPremium: boolean;\n seats: number;\n maxCollections: number;\n maxStorageGb?: number;\n\n constructor(obj?: OrganizationData) {\n if (obj == null) {\n return;\n }\n\n this.id = obj.id;\n this.name = obj.name;\n this.status = obj.status;\n this.type = obj.type;\n this.enabled = obj.enabled;\n this.useGroups = obj.useGroups;\n this.useDirectory = obj.useDirectory;\n this.useEvents = obj.useEvents;\n this.useTotp = obj.useTotp;\n this.use2fa = obj.use2fa;\n this.selfHost = obj.selfHost;\n this.usersGetPremium = obj.usersGetPremium;\n this.seats = obj.seats;\n this.maxCollections = obj.maxCollections;\n this.maxStorageGb = obj.maxStorageGb;\n }\n\n get canAccess() {\n if (this.type === OrganizationUserType.Owner) {\n return true;\n }\n return this.enabled && this.status === OrganizationUserStatusType.Confirmed;\n }\n\n get isAdmin() {\n return this.type === OrganizationUserType.Owner || this.type === OrganizationUserType.Admin;\n }\n\n get isOwner() {\n return this.type === OrganizationUserType.Owner;\n }\n}\n","import { ProfileOrganizationResponse } from '../response/profileOrganizationResponse';\n\nimport { OrganizationUserStatusType } from '../../enums/organizationUserStatusType';\nimport { OrganizationUserType } from '../../enums/organizationUserType';\n\nexport class OrganizationData {\n id: string;\n name: string;\n status: OrganizationUserStatusType;\n type: OrganizationUserType;\n enabled: boolean;\n useGroups: boolean;\n useDirectory: boolean;\n useEvents: boolean;\n useTotp: boolean;\n use2fa: boolean;\n selfHost: boolean;\n usersGetPremium: boolean;\n seats: number;\n maxCollections: number;\n maxStorageGb?: number;\n\n constructor(response: ProfileOrganizationResponse) {\n this.id = response.id;\n this.name = response.name;\n this.status = response.status;\n this.type = response.type;\n this.enabled = response.enabled;\n this.useGroups = response.useGroups;\n this.useDirectory = response.useDirectory;\n this.useEvents = response.useEvents;\n this.useTotp = response.useTotp;\n this.use2fa = response.use2fa;\n this.selfHost = response.selfHost;\n this.usersGetPremium = response.usersGetPremium;\n this.seats = response.seats;\n this.maxCollections = response.maxCollections;\n this.maxStorageGb = response.maxStorageGb;\n }\n}\n","export class PasswordHistory {\r\n password: string;\r\n date: number;\r\n\r\n constructor(password: string, date: number) {\r\n this.password = password;\r\n this.date = date;\r\n }\r\n}\r\n","import { FolderData } from '../data/folderData';\r\n\r\nimport { FolderView } from '../view/folderView';\r\n\r\nimport { CipherString } from './cipherString';\r\nimport Domain from './domain';\r\n\r\nexport class Folder extends Domain {\r\n id: string;\r\n name: CipherString;\r\n\r\n constructor(obj?: FolderData, alreadyEncrypted: boolean = false) {\r\n super();\r\n if (obj == null) {\r\n return;\r\n }\r\n\r\n this.buildDomainModel(this, obj, {\r\n id: null,\r\n name: null,\r\n }, alreadyEncrypted, ['id']);\r\n }\r\n\r\n decrypt(): Promise {\r\n return this.decryptObj(new FolderView(this), {\r\n name: null,\r\n }, null);\r\n }\r\n}\r\n","export class EnvironmentUrls {\r\n base: string;\r\n api: string;\r\n identity: string;\r\n}\r\n","/**\r\n * Use as a Decorator on async functions, it will prevent multiple 'active' calls as the same time\r\n *\r\n * If a promise was returned from a previous call to this function, that hasn't yet resolved it will\r\n * be returned, instead of calling the original function again\r\n *\r\n * Results are not cached, once the promise has returned, the next call will result in a fresh call\r\n *\r\n * WARNING: The decorator's scope is singleton, so using it on transient objects can lead to memory leaks.\r\n * Read more at https://github.com/bitwarden/jslib/pull/7\r\n */\r\nexport function sequentialize(cacheKey: (args: any[]) => string) {\r\n return (target: any, propertyKey: string | symbol, descriptor: PropertyDescriptor) => {\r\n const originalMethod: () => Promise = descriptor.value;\r\n const caches = new Map>>();\r\n\r\n const getCache = (obj: any) => {\r\n let cache = caches.get(obj);\r\n if (cache != null) {\r\n return cache;\r\n }\r\n cache = new Map>();\r\n caches.set(obj, cache);\r\n return cache;\r\n };\r\n\r\n return {\r\n value: function(...args: any[]) {\r\n const argsCacheKey = cacheKey(args);\r\n const cache = getCache(this);\r\n let response = cache.get(argsCacheKey);\r\n if (response != null) {\r\n return response;\r\n }\r\n\r\n response = originalMethod.apply(this, args).then((val: any) => {\r\n cache.delete(argsCacheKey);\r\n return val;\r\n }).catch((err: any) => {\r\n cache.delete(argsCacheKey);\r\n throw err;\r\n });\r\n\r\n cache.set(argsCacheKey, response);\r\n return response;\r\n },\r\n };\r\n };\r\n}\r\n","import { EncryptionType } from '../../enums/encryptionType';\n\nimport { Utils } from '../../misc/utils';\n\nexport class SymmetricCryptoKey {\n key: ArrayBuffer;\n encKey?: ArrayBuffer;\n macKey?: ArrayBuffer;\n encType: EncryptionType;\n\n keyB64: string;\n encKeyB64: string;\n macKeyB64: string;\n\n meta: any;\n\n constructor(key: ArrayBuffer, encType?: EncryptionType) {\n if (key == null) {\n throw new Error('Must provide key');\n }\n\n if (encType == null) {\n if (key.byteLength === 32) {\n encType = EncryptionType.AesCbc256_B64;\n } else if (key.byteLength === 64) {\n encType = EncryptionType.AesCbc256_HmacSha256_B64;\n } else {\n throw new Error('Unable to determine encType.');\n }\n }\n\n this.key = key;\n this.encType = encType;\n\n if (encType === EncryptionType.AesCbc256_B64 && key.byteLength === 32) {\n this.encKey = key;\n this.macKey = null;\n } else if (encType === EncryptionType.AesCbc128_HmacSha256_B64 && key.byteLength === 32) {\n this.encKey = key.slice(0, 16);\n this.macKey = key.slice(16, 32);\n } else if (encType === EncryptionType.AesCbc256_HmacSha256_B64 && key.byteLength === 64) {\n this.encKey = key.slice(0, 32);\n this.macKey = key.slice(32, 64);\n } else {\n throw new Error('Unsupported encType/key length.');\n }\n\n if (this.key != null) {\n this.keyB64 = Utils.fromBufferToB64(this.key);\n }\n if (this.encKey != null) {\n this.encKeyB64 = Utils.fromBufferToB64(this.encKey);\n }\n if (this.macKey != null) {\n this.macKeyB64 = Utils.fromBufferToB64(this.macKey);\n }\n }\n}\n","import { SymmetricCryptoKey } from './symmetricCryptoKey';\n\nexport class EncryptedObject {\n iv: ArrayBuffer;\n data: ArrayBuffer;\n mac: ArrayBuffer;\n key: SymmetricCryptoKey;\n}\n","import { CipherRequest } from './cipherRequest';\n\nimport { Cipher } from '../domain/cipher';\n\nexport class CipherShareRequest {\n cipher: CipherRequest;\n collectionIds: string[];\n\n constructor(cipher: Cipher) {\n this.cipher = new CipherRequest(cipher);\n this.collectionIds = cipher.collectionIds;\n }\n}\n","import { CipherWithIdRequest } from './cipherWithIdRequest';\n\nimport { Cipher } from '../domain/cipher';\n\nexport class CipherBulkShareRequest {\n ciphers: CipherWithIdRequest[];\n collectionIds: string[];\n\n constructor(ciphers: Cipher[], collectionIds: string[]) {\n if (ciphers != null) {\n this.ciphers = [];\n ciphers.forEach((c) => {\n this.ciphers.push(new CipherWithIdRequest(c));\n });\n }\n this.collectionIds = collectionIds;\n }\n}\n","export class CipherBulkMoveRequest {\n ids: string[];\n folderId: string;\n\n constructor(ids: string[], folderId: string) {\n this.ids = ids == null ? [] : ids;\n this.folderId = folderId;\n }\n}\n","export class CipherBulkDeleteRequest {\n ids: string[];\n\n constructor(ids: string[]) {\n this.ids = ids == null ? [] : ids;\n }\n}\n","export class BreachAccountResponse {\n addedDate: Date;\n breachDate: Date;\n dataClasses: string[];\n description: string;\n domain: string;\n isActive: boolean;\n isVerified: boolean;\n logoType: string;\n modifiedDate: Date;\n name: string;\n pwnCount: number;\n title: string;\n\n constructor(response: any) {\n this.addedDate = response.AddedDate;\n this.breachDate = response.BreachDate;\n this.dataClasses = response.DataClasses;\n this.description = response.Description;\n this.domain = response.Domain;\n this.isActive = response.IsActive;\n this.isVerified = response.IsVerified;\n this.logoType = response.LogoType;\n this.modifiedDate = response.ModifiedDate;\n this.name = response.Name;\n this.pwnCount = response.PwnCount;\n this.title = response.Title;\n }\n}\n","export class UserKeyResponse {\n userId: string;\n publicKey: string;\n\n constructor(response: any) {\n this.userId = response.UserId;\n this.publicKey = response.PublicKey;\n }\n}\n","export class TwoFactorYubiKeyResponse {\n enabled: boolean;\n key1: string;\n key2: string;\n key3: string;\n key4: string;\n key5: string;\n nfc: boolean;\n\n constructor(response: any) {\n this.enabled = response.Enabled;\n this.key1 = response.Key1;\n this.key2 = response.Key2;\n this.key3 = response.Key3;\n this.key4 = response.Key4;\n this.key5 = response.Key5;\n this.nfc = response.Nfc;\n }\n}\n","export class TwoFactorU2fResponse {\r\n enabled: boolean;\r\n challenge: ChallengeResponse;\r\n\r\n constructor(response: any) {\r\n this.enabled = response.Enabled;\r\n this.challenge = response.Challenge == null ? null : new ChallengeResponse(response.Challenge);\r\n }\r\n}\r\n\r\nexport class ChallengeResponse {\r\n userId: string;\r\n appId: string;\r\n challenge: string;\r\n version: string;\r\n\r\n constructor(response: any) {\r\n this.userId = response.UserId;\r\n this.appId = response.AppId;\r\n this.challenge = response.Challenge;\r\n this.version = response.Version;\r\n }\r\n}\r\n","export class TwoFactorRecoverResponse {\n code: string;\n\n constructor(response: any) {\n this.code = response.Code;\n }\n}\n","import { TwoFactorProviderType } from '../../enums/twoFactorProviderType';\n\nexport class TwoFactorProviderResponse {\n enabled: boolean;\n type: TwoFactorProviderType;\n\n constructor(response: any) {\n this.enabled = response.Enabled;\n this.type = response.Type;\n }\n}\n","export class TwoFactorEmailResponse {\n enabled: boolean;\n email: string;\n\n constructor(response: any) {\n this.enabled = response.Enabled;\n this.email = response.Email;\n }\n}\n","export class TwoFactorDuoResponse {\n enabled: boolean;\n host: string;\n secretKey: string;\n integrationKey: string;\n\n constructor(response: any) {\n this.enabled = response.Enabled;\n this.host = response.Host;\n this.secretKey = response.SecretKey;\n this.integrationKey = response.IntegrationKey;\n }\n}\n","export class TwoFactorAuthenticatorResponse {\n enabled: boolean;\n key: string;\n\n constructor(response: any) {\n this.enabled = response.Enabled;\n this.key = response.Key;\n }\n}\n","import { CipherResponse } from './cipherResponse';\nimport { CollectionDetailsResponse } from './collectionResponse';\nimport { DomainsResponse } from './domainsResponse';\nimport { FolderResponse } from './folderResponse';\nimport { ProfileResponse } from './profileResponse';\n\nexport class SyncResponse {\n profile?: ProfileResponse;\n folders: FolderResponse[] = [];\n collections: CollectionDetailsResponse[] = [];\n ciphers: CipherResponse[] = [];\n domains?: DomainsResponse;\n\n constructor(response: any) {\n if (response.Profile) {\n this.profile = new ProfileResponse(response.Profile);\n }\n\n if (response.Folders) {\n response.Folders.forEach((folder: any) => {\n this.folders.push(new FolderResponse(folder));\n });\n }\n\n if (response.Collections) {\n response.Collections.forEach((collection: any) => {\n this.collections.push(new CollectionDetailsResponse(collection));\n });\n }\n\n if (response.Ciphers) {\n response.Ciphers.forEach((cipher: any) => {\n this.ciphers.push(new CipherResponse(cipher));\n });\n }\n\n if (response.Domains) {\n this.domains = new DomainsResponse(response.Domains);\n }\n }\n}\n","import { OrganizationUserStatusType } from '../../enums/organizationUserStatusType';\nimport { OrganizationUserType } from '../../enums/organizationUserType';\n\nexport class ProfileOrganizationResponse {\n id: string;\n name: string;\n useGroups: boolean;\n useDirectory: boolean;\n useEvents: boolean;\n useTotp: boolean;\n use2fa: boolean;\n selfHost: boolean;\n usersGetPremium: boolean;\n seats: number;\n maxCollections: number;\n maxStorageGb?: number;\n key: string;\n status: OrganizationUserStatusType;\n type: OrganizationUserType;\n enabled: boolean;\n\n constructor(response: any) {\n this.id = response.Id;\n this.name = response.Name;\n this.useGroups = response.UseGroups;\n this.useDirectory = response.UseDirectory;\n this.useEvents = response.UseEvents;\n this.useTotp = response.UseTotp;\n this.use2fa = response.Use2fa;\n this.selfHost = response.SelfHost;\n this.usersGetPremium = response.UsersGetPremium;\n this.seats = response.Seats;\n this.maxCollections = response.MaxCollections;\n this.maxStorageGb = response.MaxStorageGb;\n this.key = response.Key;\n this.status = response.Status;\n this.type = response.Type;\n this.enabled = response.Enabled;\n }\n}\n","import { OrganizationUserStatusType } from '../../enums/organizationUserStatusType';\nimport { OrganizationUserType } from '../../enums/organizationUserType';\nimport { SelectionReadOnlyResponse } from './selectionReadOnlyResponse';\n\nexport class OrganizationUserResponse {\n id: string;\n userId: string;\n type: OrganizationUserType;\n status: OrganizationUserStatusType;\n accessAll: boolean;\n\n constructor(response: any) {\n this.id = response.Id;\n this.userId = response.UserId;\n this.type = response.Type;\n this.status = response.Status;\n this.accessAll = response.AccessAll;\n }\n}\n\nexport class OrganizationUserUserDetailsResponse extends OrganizationUserResponse {\n name: string;\n email: string;\n\n constructor(response: any) {\n super(response);\n this.name = response.Name;\n this.email = response.Email;\n }\n}\n\nexport class OrganizationUserDetailsResponse extends OrganizationUserResponse {\n collections: SelectionReadOnlyResponse[] = [];\n\n constructor(response: any) {\n super(response);\n if (response.Collections != null) {\n this.collections = response.Collections.map((c: any) => new SelectionReadOnlyResponse(c));\n }\n }\n}\n","import {\n BillingChargeResponse,\n BillingInvoiceResponse,\n BillingSourceResponse,\n BillingSubscriptionResponse,\n} from './billingResponse';\nimport { OrganizationResponse } from './organizationResponse';\n\nexport class OrganizationBillingResponse extends OrganizationResponse {\n storageName: string;\n storageGb: number;\n paymentSource: BillingSourceResponse;\n subscription: BillingSubscriptionResponse;\n upcomingInvoice: BillingInvoiceResponse;\n charges: BillingChargeResponse[] = [];\n expiration: Date;\n\n constructor(response: any) {\n super(response);\n this.storageName = response.StorageName;\n this.storageGb = response.StorageGb;\n this.paymentSource = response.PaymentSource == null ? null : new BillingSourceResponse(response.PaymentSource);\n this.subscription = response.Subscription == null ?\n null : new BillingSubscriptionResponse(response.Subscription);\n this.upcomingInvoice = response.UpcomingInvoice == null ?\n null : new BillingInvoiceResponse(response.UpcomingInvoice);\n if (response.Charges != null) {\n this.charges = response.Charges.map((c: any) => new BillingChargeResponse(c));\n }\n this.expiration = response.Expiration;\n }\n}\n","export class ListResponse {\n data: T[];\n continuationToken: string;\n\n constructor(response: any, t: new (dataResponse: any) => T) {\n this.data = response.Data == null ? [] : response.Data.map((dr: any) => new t(dr));\n this.continuationToken = response.ContinuationToken;\n }\n}\n","import { TwoFactorProviderType } from '../../enums/twoFactorProviderType';\r\n\r\nexport class IdentityTwoFactorResponse {\r\n twoFactorProviders: TwoFactorProviderType[];\r\n twoFactorProviders2 = new Map();\r\n\r\n constructor(response: any) {\r\n this.twoFactorProviders = response.TwoFactorProviders;\r\n if (response.TwoFactorProviders2 != null) {\r\n for (const prop in response.TwoFactorProviders2) {\r\n if (response.TwoFactorProviders2.hasOwnProperty(prop)) {\r\n this.twoFactorProviders2.set(parseInt(prop, null), response.TwoFactorProviders2[prop]);\r\n }\r\n }\r\n }\r\n }\r\n}\r\n","export class IdentityTokenResponse {\r\n accessToken: string;\r\n expiresIn: number;\r\n refreshToken: string;\r\n tokenType: string;\r\n\r\n privateKey: string;\r\n key: string;\r\n twoFactorToken: string;\r\n\r\n constructor(response: any) {\r\n this.accessToken = response.access_token;\r\n this.expiresIn = response.expires_in;\r\n this.refreshToken = response.refresh_token;\r\n this.tokenType = response.token_type;\r\n\r\n this.privateKey = response.PrivateKey;\r\n this.key = response.Key;\r\n this.twoFactorToken = response.TwoFactorToken;\r\n }\r\n}\r\n","import { OrganizationUserStatusType } from '../../enums/organizationUserStatusType';\nimport { OrganizationUserType } from '../../enums/organizationUserType';\n\nexport class GroupUserResponse {\n organizationUserId: string;\n accessAll: boolean;\n name: string;\n email: string;\n type: OrganizationUserType;\n status: OrganizationUserStatusType;\n\n constructor(response: any) {\n this.organizationUserId = response.OrganizationUserId;\n this.accessAll = response.AccessAll;\n this.name = response.Name;\n this.email = response.Email;\n this.type = response.Type;\n this.status = response.Status;\n }\n}\n","import { SelectionReadOnlyResponse } from './selectionReadOnlyResponse';\n\nexport class GroupResponse {\n id: string;\n organizationId: string;\n name: string;\n accessAll: boolean;\n externalId: string;\n\n constructor(response: any) {\n this.id = response.Id;\n this.organizationId = response.OrganizationId;\n this.name = response.Name;\n this.accessAll = response.AccessAll;\n this.externalId = response.ExternalId;\n }\n}\n\nexport class GroupDetailsResponse extends GroupResponse {\n collections: SelectionReadOnlyResponse[] = [];\n\n constructor(response: any) {\n super(response);\n if (response.Collections != null) {\n this.collections = response.Collections.map((c: any) => new SelectionReadOnlyResponse(c));\n }\n }\n}\n","import { DeviceType } from '../../enums/deviceType';\nimport { EventType } from '../../enums/eventType';\n\nexport class EventResponse {\n type: EventType;\n userId: string;\n organizationId: string;\n cipherId: string;\n collectionId: string;\n groupId: string;\n organizationUserId: string;\n actingUserId: string;\n date: Date;\n deviceType: DeviceType;\n ipAddress: string;\n\n constructor(response: any) {\n this.type = response.Type;\n this.userId = response.UserId;\n this.organizationId = response.OrganizationId;\n this.cipherId = response.CipherId;\n this.collectionId = response.CollectionId;\n this.groupId = response.GroupId;\n this.organizationUserId = response.OrganizationUserId;\n this.actingUserId = response.ActingUserId;\n this.date = response.Date;\n this.deviceType = response.DeviceType;\n this.ipAddress = response.IpAddress;\n }\n}\n","export class ErrorResponse {\n message: string;\n validationErrors: { [key: string]: string[]; };\n statusCode: number;\n\n constructor(response: any, status: number, identityResponse?: boolean) {\n let errorModel = null;\n if (identityResponse && response && response.ErrorModel) {\n errorModel = response.ErrorModel;\n } else if (response) {\n errorModel = response;\n }\n\n if (errorModel) {\n this.message = errorModel.Message;\n this.validationErrors = errorModel.ValidationErrors;\n } else {\n if (status === 429) {\n this.message = 'Rate limit exceeded. Try again later.';\n }\n }\n this.statusCode = status;\n }\n\n getSingleMessage(): string {\n if (this.validationErrors) {\n for (const key in this.validationErrors) {\n if (!this.validationErrors.hasOwnProperty(key)) {\n continue;\n }\n if (this.validationErrors[key].length) {\n return this.validationErrors[key][0];\n }\n }\n }\n return this.message;\n }\n}\n","export class GlobalDomainResponse {\r\n type: number;\r\n domains: string[];\r\n excluded: number[];\r\n\r\n constructor(response: any) {\r\n this.type = response.Type;\r\n this.domains = response.Domains;\r\n this.excluded = response.Excluded;\r\n }\r\n}\r\n","import { OrganizationUserStatusType } from '../../enums/organizationUserStatusType';\nimport { OrganizationUserType } from '../../enums/organizationUserType';\n\nexport class CollectionUserResponse {\n organizationUserId: string;\n accessAll: boolean;\n name: string;\n email: string;\n type: OrganizationUserType;\n status: OrganizationUserStatusType;\n readOnly: boolean;\n\n constructor(response: any) {\n this.organizationUserId = response.OrganizationUserId;\n this.accessAll = response.AccessAll;\n this.name = response.Name;\n this.email = response.Email;\n this.type = response.Type;\n this.status = response.Status;\n this.readOnly = response.ReadOnly;\n }\n}\n","import { SecureNoteType } from '../../enums/secureNoteType';\r\n\r\nexport class SecureNoteApi {\r\n type: SecureNoteType;\r\n\r\n constructor(data: any) {\r\n this.type = data.Type;\r\n }\r\n}\r\n","import { UriMatchType } from '../../enums/uriMatchType';\r\n\r\nexport class LoginUriApi {\r\n uri: string;\r\n match: UriMatchType = null;\r\n\r\n constructor(data: any) {\r\n this.uri = data.Uri;\r\n this.match = data.Match != null ? data.Match : null;\r\n }\r\n}\r\n","import { LoginUriApi } from './loginUriApi';\r\n\r\nexport class LoginApi {\r\n uris: LoginUriApi[];\r\n username: string;\r\n password: string;\r\n totp: string;\r\n\r\n constructor(data: any) {\r\n this.username = data.Username;\r\n this.password = data.Password;\r\n this.totp = data.Totp;\r\n\r\n if (data.Uris) {\r\n this.uris = [];\r\n data.Uris.forEach((u: any) => {\r\n this.uris.push(new LoginUriApi(u));\r\n });\r\n }\r\n }\r\n}\r\n","export class IdentityApi {\r\n title: string;\r\n firstName: string;\r\n middleName: string;\r\n lastName: string;\r\n address1: string;\r\n address2: string;\r\n address3: string;\r\n city: string;\r\n state: string;\r\n postalCode: string;\r\n country: string;\r\n company: string;\r\n email: string;\r\n phone: string;\r\n ssn: string;\r\n username: string;\r\n passportNumber: string;\r\n licenseNumber: string;\r\n\r\n constructor(data: any) {\r\n this.title = data.Title;\r\n this.firstName = data.FirstName;\r\n this.middleName = data.MiddleName;\r\n this.lastName = data.LastName;\r\n this.address1 = data.Address1;\r\n this.address2 = data.Address2;\r\n this.address3 = data.Address3;\r\n this.city = data.City;\r\n this.state = data.State;\r\n this.postalCode = data.PostalCode;\r\n this.country = data.Country;\r\n this.company = data.Company;\r\n this.email = data.Email;\r\n this.phone = data.Phone;\r\n this.ssn = data.SSN;\r\n this.username = data.Username;\r\n this.passportNumber = data.PassportNumber;\r\n this.licenseNumber = data.LicenseNumber;\r\n }\r\n}\r\n","import { FieldType } from '../../enums/fieldType';\r\n\r\nexport class FieldApi {\r\n name: string;\r\n value: string;\r\n type: FieldType;\r\n\r\n constructor(response: any) {\r\n this.type = response.Type;\r\n this.name = response.Name;\r\n this.value = response.Value;\r\n }\r\n}\r\n","export class CardApi {\r\n cardholderName: string;\r\n brand: string;\r\n number: string;\r\n expMonth: string;\r\n expYear: string;\r\n code: string;\r\n\r\n constructor(data: any) {\r\n this.cardholderName = data.CardholderName;\r\n this.brand = data.Brand;\r\n this.number = data.Number;\r\n this.expMonth = data.ExpMonth;\r\n this.expYear = data.ExpYear;\r\n this.code = data.Code;\r\n }\r\n}\r\n","export class AttachmentResponse {\r\n id: string;\r\n url: string;\r\n fileName: string;\r\n size: number;\r\n sizeName: string;\r\n\r\n constructor(response: any) {\r\n this.id = response.Id;\r\n this.url = response.Url;\r\n this.fileName = response.FileName;\r\n this.size = response.Size;\r\n this.sizeName = response.SizeName;\r\n }\r\n}\r\n","export { ApiService } from './api.service';\nexport { AppIdService } from './appId.service';\nexport { AuditService } from './audit.service';\nexport { AuthService } from './auth.service';\nexport { CipherService } from './cipher.service';\nexport { CollectionService } from './collection.service';\nexport { ConstantsService } from './constants.service';\nexport { ContainerService } from './container.service';\nexport { CryptoService } from './crypto.service';\nexport { EnvironmentService } from './environment.service';\nexport { FolderService } from './folder.service';\nexport { I18nService } from './i18n.service';\nexport { LockService } from './lock.service';\nexport { PasswordGenerationService } from './passwordGeneration.service';\nexport { SettingsService } from './settings.service';\nexport { StateService } from './state.service';\nexport { SyncService } from './sync.service';\nexport { TokenService } from './token.service';\nexport { TotpService } from './totp.service';\nexport { UserService } from './user.service';\n","import { StorageService } from 'jslib/abstractions/storage.service';\nimport { ConstantsService } from 'jslib/services';\n\nexport class HtmlStorageService implements StorageService {\n private localStorageKeys = new Set(['appId', 'anonymousAppId', 'rememberedEmail', 'passwordGenerationOptions',\n ConstantsService.disableFaviconKey, ConstantsService.lockOptionKey, 'rememberEmail',\n ConstantsService.localeKey, ConstantsService.lockOptionKey]);\n private localStorageStartsWithKeys = ['twoFactorToken_'];\n\n get(key: string): Promise {\n let json: string = null;\n if (this.isLocalStorage(key)) {\n json = window.localStorage.getItem(key);\n } else {\n json = window.sessionStorage.getItem(key);\n }\n if (json != null) {\n const obj = JSON.parse(json);\n return Promise.resolve(obj as T);\n }\n return Promise.resolve(null);\n }\n\n save(key: string, obj: any): Promise {\n if (obj == null) {\n return this.remove(key);\n }\n\n const json = JSON.stringify(obj);\n if (this.isLocalStorage(key)) {\n window.localStorage.setItem(key, json);\n } else {\n window.sessionStorage.setItem(key, json);\n }\n return Promise.resolve();\n }\n\n remove(key: string): Promise {\n if (this.isLocalStorage(key)) {\n window.localStorage.removeItem(key);\n } else {\n window.sessionStorage.removeItem(key);\n }\n return Promise.resolve();\n }\n\n private isLocalStorage(key: string): boolean {\n if (this.localStorageKeys.has(key)) {\n return true;\n }\n for (const swKey of this.localStorageStartsWithKeys) {\n if (key.startsWith(swKey)) {\n return true;\n }\n }\n return false;\n }\n}\n","import { MessagingService } from 'jslib/abstractions/messaging.service';\r\n\r\nimport { BroadcasterService } from 'jslib/angular/services/broadcaster.service';\r\n\r\nexport class BroadcasterMessagingService implements MessagingService {\r\n constructor(private broadcasterService: BroadcasterService) { }\r\n\r\n send(subscriber: string, arg: any = {}) {\r\n const message = Object.assign({}, { command: subscriber }, arg);\r\n this.broadcasterService.send(message);\r\n }\r\n}\r\n","import {\n APP_INITIALIZER,\n LOCALE_ID,\n NgModule,\n} from '@angular/core';\n\nimport { ToasterModule } from 'angular2-toaster';\n\nimport { BroadcasterMessagingService } from '../../services/broadcasterMessaging.service';\nimport { HtmlStorageService } from '../../services/htmlStorage.service';\nimport { I18nService } from '../../services/i18n.service';\nimport { MemoryStorageService } from '../../services/memoryStorage.service';\nimport { WebPlatformUtilsService } from '../../services/webPlatformUtils.service';\n\nimport { EventService } from './event.service';\nimport { OrganizationGuardService } from './organization-guard.service';\nimport { OrganizationTypeGuardService } from './organization-type-guard.service';\nimport { RouterService } from './router.service';\nimport { UnauthGuardService } from './unauth-guard.service';\n\nimport { AuthGuardService } from 'jslib/angular/services/auth-guard.service';\nimport { BroadcasterService } from 'jslib/angular/services/broadcaster.service';\nimport { ValidationService } from 'jslib/angular/services/validation.service';\n\nimport { Analytics } from 'jslib/misc/analytics';\n\nimport { ApiService } from 'jslib/services/api.service';\nimport { AppIdService } from 'jslib/services/appId.service';\nimport { AuditService } from 'jslib/services/audit.service';\nimport { AuthService } from 'jslib/services/auth.service';\nimport { CipherService } from 'jslib/services/cipher.service';\nimport { CollectionService } from 'jslib/services/collection.service';\nimport { ConstantsService } from 'jslib/services/constants.service';\nimport { ContainerService } from 'jslib/services/container.service';\nimport { CryptoService } from 'jslib/services/crypto.service';\nimport { EnvironmentService } from 'jslib/services/environment.service';\nimport { ExportService } from 'jslib/services/export.service';\nimport { FolderService } from 'jslib/services/folder.service';\nimport { LockService } from 'jslib/services/lock.service';\nimport { PasswordGenerationService } from 'jslib/services/passwordGeneration.service';\nimport { SettingsService } from 'jslib/services/settings.service';\nimport { StateService } from 'jslib/services/state.service';\nimport { SyncService } from 'jslib/services/sync.service';\nimport { TokenService } from 'jslib/services/token.service';\nimport { TotpService } from 'jslib/services/totp.service';\nimport { UserService } from 'jslib/services/user.service';\nimport { WebCryptoFunctionService } from 'jslib/services/webCryptoFunction.service';\n\nimport { ApiService as ApiServiceAbstraction } from 'jslib/abstractions/api.service';\nimport { AppIdService as AppIdServiceAbstraction } from 'jslib/abstractions/appId.service';\nimport { AuditService as AuditServiceAbstraction } from 'jslib/abstractions/audit.service';\nimport { AuthService as AuthServiceAbstraction } from 'jslib/abstractions/auth.service';\nimport { CipherService as CipherServiceAbstraction } from 'jslib/abstractions/cipher.service';\nimport { CollectionService as CollectionServiceAbstraction } from 'jslib/abstractions/collection.service';\nimport { CryptoService as CryptoServiceAbstraction } from 'jslib/abstractions/crypto.service';\nimport { CryptoFunctionService as CryptoFunctionServiceAbstraction } from 'jslib/abstractions/cryptoFunction.service';\nimport { EnvironmentService as EnvironmentServiceAbstraction } from 'jslib/abstractions/environment.service';\nimport { ExportService as ExportServiceAbstraction } from 'jslib/abstractions/export.service';\nimport { FolderService as FolderServiceAbstraction } from 'jslib/abstractions/folder.service';\nimport { I18nService as I18nServiceAbstraction } from 'jslib/abstractions/i18n.service';\nimport { LockService as LockServiceAbstraction } from 'jslib/abstractions/lock.service';\nimport { LogService as LogServiceAbstraction } from 'jslib/abstractions/log.service';\nimport { MessagingService as MessagingServiceAbstraction } from 'jslib/abstractions/messaging.service';\nimport {\n PasswordGenerationService as PasswordGenerationServiceAbstraction,\n} from 'jslib/abstractions/passwordGeneration.service';\nimport { PlatformUtilsService as PlatformUtilsServiceAbstraction } from 'jslib/abstractions/platformUtils.service';\nimport { SettingsService as SettingsServiceAbstraction } from 'jslib/abstractions/settings.service';\nimport { StateService as StateServiceAbstraction } from 'jslib/abstractions/state.service';\nimport { StorageService as StorageServiceAbstraction } from 'jslib/abstractions/storage.service';\nimport { SyncService as SyncServiceAbstraction } from 'jslib/abstractions/sync.service';\nimport { TokenService as TokenServiceAbstraction } from 'jslib/abstractions/token.service';\nimport { TotpService as TotpServiceAbstraction } from 'jslib/abstractions/totp.service';\nimport { UserService as UserServiceAbstraction } from 'jslib/abstractions/user.service';\n\nconst i18nService = new I18nService(window.navigator.language, 'locales');\nconst stateService = new StateService();\nconst broadcasterService = new BroadcasterService();\nconst messagingService = new BroadcasterMessagingService(broadcasterService);\nconst platformUtilsService = new WebPlatformUtilsService(i18nService);\nconst storageService: StorageServiceAbstraction = new HtmlStorageService();\nconst secureStorageService: StorageServiceAbstraction = new MemoryStorageService();\nconst cryptoFunctionService: CryptoFunctionServiceAbstraction = new WebCryptoFunctionService(window,\n platformUtilsService);\nconst cryptoService = new CryptoService(storageService,\n platformUtilsService.isDev() ? storageService : secureStorageService, cryptoFunctionService);\nconst tokenService = new TokenService(storageService);\nconst appIdService = new AppIdService(storageService);\nconst apiService = new ApiService(tokenService, platformUtilsService,\n async (expired: boolean) => messagingService.send('logout', { expired: expired }));\nconst environmentService = new EnvironmentService(apiService, storageService);\nconst userService = new UserService(tokenService, storageService);\nconst settingsService = new SettingsService(userService, storageService);\nconst cipherService = new CipherService(cryptoService, userService, settingsService,\n apiService, storageService, i18nService, platformUtilsService);\nconst folderService = new FolderService(cryptoService, userService, apiService, storageService,\n i18nService, cipherService);\nconst collectionService = new CollectionService(cryptoService, userService, storageService, i18nService);\nconst lockService = new LockService(cipherService, folderService, collectionService,\n cryptoService, platformUtilsService, storageService, messagingService, null);\nconst syncService = new SyncService(userService, apiService, settingsService,\n folderService, cipherService, cryptoService, collectionService, storageService, messagingService,\n async (expired: boolean) => messagingService.send('logout', { expired: expired }));\nconst passwordGenerationService = new PasswordGenerationService(cryptoService, storageService);\nconst totpService = new TotpService(storageService, cryptoFunctionService);\nconst containerService = new ContainerService(cryptoService, platformUtilsService);\nconst authService = new AuthService(cryptoService, apiService,\n userService, tokenService, appIdService, i18nService, platformUtilsService, messagingService);\nconst exportService = new ExportService(folderService, cipherService, apiService);\nconst auditService = new AuditService(cryptoFunctionService, apiService);\n\nconst analytics = new Analytics(window, () => platformUtilsService.isDev() || platformUtilsService.isSelfHost(),\n platformUtilsService, storageService, appIdService);\ncontainerService.attachToWindow(window);\n\nexport function initFactory(): Function {\n return async () => {\n const isDev = platformUtilsService.isDev();\n if (!isDev && platformUtilsService.isSelfHost()) {\n environmentService.baseUrl = window.location.origin;\n }\n await apiService.setUrls({\n base: isDev ? null : window.location.origin,\n api: isDev ? 'http://localhost:4000' : null,\n identity: isDev ? 'http://localhost:33656' : null,\n });\n\n lockService.init(true);\n const locale = await storageService.get(ConstantsService.localeKey);\n await i18nService.init(locale);\n await authService.init();\n const htmlEl = window.document.documentElement;\n htmlEl.classList.add('locale_' + i18nService.translationLocale);\n let theme = await storageService.get(ConstantsService.themeKey);\n if (theme == null) {\n theme = 'light';\n }\n htmlEl.classList.add('theme_' + theme);\n stateService.save(ConstantsService.disableFaviconKey,\n await storageService.get(ConstantsService.disableFaviconKey));\n };\n}\n\n@NgModule({\n imports: [\n ToasterModule,\n ],\n declarations: [],\n providers: [\n ValidationService,\n AuthGuardService,\n OrganizationGuardService,\n OrganizationTypeGuardService,\n UnauthGuardService,\n RouterService,\n EventService,\n { provide: AuditServiceAbstraction, useValue: auditService },\n { provide: AuthServiceAbstraction, useValue: authService },\n { provide: CipherServiceAbstraction, useValue: cipherService },\n { provide: FolderServiceAbstraction, useValue: folderService },\n { provide: CollectionServiceAbstraction, useValue: collectionService },\n { provide: EnvironmentServiceAbstraction, useValue: environmentService },\n { provide: TotpServiceAbstraction, useValue: totpService },\n { provide: TokenServiceAbstraction, useValue: tokenService },\n { provide: I18nServiceAbstraction, useValue: i18nService },\n { provide: CryptoServiceAbstraction, useValue: cryptoService },\n { provide: PlatformUtilsServiceAbstraction, useValue: platformUtilsService },\n { provide: PasswordGenerationServiceAbstraction, useValue: passwordGenerationService },\n { provide: ApiServiceAbstraction, useValue: apiService },\n { provide: SyncServiceAbstraction, useValue: syncService },\n { provide: UserServiceAbstraction, useValue: userService },\n { provide: MessagingServiceAbstraction, useValue: messagingService },\n { provide: BroadcasterService, useValue: broadcasterService },\n { provide: SettingsServiceAbstraction, useValue: settingsService },\n { provide: LockServiceAbstraction, useValue: lockService },\n { provide: StorageServiceAbstraction, useValue: storageService },\n { provide: StateServiceAbstraction, useValue: stateService },\n { provide: ExportServiceAbstraction, useValue: exportService },\n {\n provide: APP_INITIALIZER,\n useFactory: initFactory,\n deps: [],\n multi: true,\n },\n {\n provide: LOCALE_ID,\n useFactory: () => i18nService.translationLocale,\n deps: [],\n },\n ],\n})\nexport class ServicesModule {\n}\n","\r\n\r\n","
\n
\n
\n
\n

{{'updateEncryptionKey' | i18n}}

\n \n
\n
\n

{{'updateEncryptionKeyShortDesc' | i18n}} {{'updateEncryptionKeyDesc' | i18n}}\n {{'learnMore' | i18n}}\n

\n {{'updateEncryptionKeyWarning' | i18n}}\n \n \n
\n
\n \n \n
\n
\n
\n
\n","
\n
\n
\n
\n

\n {{'twoStepLogin' | i18n}}\n YubiKey\n

\n \n
\n \n \n
\n
\n \n {{'twoStepLoginProviderEnabled' | i18n}}\n \n \n

{{'twoFactorYubikeyWarning' | i18n}}

\n
    \n
  • {{'twoFactorYubikeySupportUsb' | i18n}}
  • \n
  • {{'twoFactorYubikeySupportMobile' | i18n}}
  • \n
\n
\n \"\"\n

{{'twoFactorYubikeyAdd' | i18n}}:

\n
    \n
  1. {{'twoFactorYubikeyPlugIn' | i18n}}
  2. \n
  3. {{'twoFactorYubikeySelectKey' | i18n}}
  4. \n
  5. {{'twoFactorYubikeyTouchButton' | i18n}}
  6. \n
  7. {{'twoFactorYubikeySaveForm' | i18n}}
  8. \n
\n
\n
\n
\n \n \n
\n {{k.existingKey}}\n \n
\n
\n
\n {{'nfcSupport' | i18n}}\n
\n \n \n
\n {{'twoFactorYubikeySupportsNfcDesc' | i18n}}\n
\n
\n \n \n \n
\n
\n
\n
\n
\n","
\n
\n
\n
\n

\n {{'twoStepLogin' | i18n}}\n FIDO U2F\n

\n \n
\n \n \n
\n
\n \n {{'twoStepLoginProviderEnabled' | i18n}}\n \n \n

{{'twoFactorU2fWarning' | i18n}}

\n
    \n
  • {{'twoFactorU2fSupportWeb' | i18n}}
  • \n
\n
\n \n \"\"\n

{{'twoFactorU2fAdd' | i18n}}:

\n
    \n
  1. {{'twoFactorU2fPlugIn' | i18n}}
  2. \n
  3. {{'twoFactorU2fTouchButton' | i18n}}
  4. \n
\n
\n
\n \n

\n \n

\n {{'twoFactorU2fWaiting' | i18n}}...\n
\n \n

\n \n

\n {{'twoFactorU2fClickEnable' | i18n}}\n
\n \n

\n \n

\n {{'twoFactorU2fProblemReading' | i18n}}\n
\n
\n
\n
\n
\n \n \n
\n
\n
\n
\n
\n","
\n
\n
\n
\n

\n {{'twoStepLogin' | i18n}}\n {{'recoveryCodeTitle' | i18n}}\n

\n \n
\n \n \n \n
\n \n

{{'twoFactorRecoveryYourCode' | i18n}}:

\n {{code}}\n
\n \n {{'twoFactorRecoveryNoCode' | i18n}}\n \n
\n
\n \n \n
\n
\n
\n
\n
\n","
\n
\n
\n
\n

{{'twoStepOptions' | i18n}}

\n \n
\n \n
\n \n
\n
\n
\n
\n","
\n
\n
\n
\n

\n {{'twoStepLogin' | i18n}}\n {{'emailTitle' | i18n}}\n

\n \n
\n \n \n
\n
\n \n \n {{'twoStepLoginProviderEnabled' | i18n}}\n \n {{'email' | i18n}}: {{email}}\n \n \n

\n {{'twoFactorEmailDesc' | i18n}}\n \"\"\n

\n
\n \n \n
\n
\n \n \n {{'verificationCodeEmailSent' | i18n : sentEmail}}\n \n
\n
\n \n \n
\n
\n
\n
\n \n \n
\n
\n
\n
\n
\n","
\n
\n
\n
\n

\n {{'twoStepLogin' | i18n}}\n Duo\n

\n \n
\n \n \n
\n
\n \n \n {{'twoStepLoginProviderEnabled' | i18n}}\n \n \"\"\n {{'twoFactorDuoIntegrationKey' | i18n}}: {{ikey}}\n
\n {{'twoFactorDuoSecretKey' | i18n}}: {{skey}}\n
\n {{'twoFactorDuoApiHostname' | i18n}}: {{host}}\n
\n \n \"\"\n

{{'twoFactorDuoDesc' | i18n}}

\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n
\n
\n \n \n
\n
\n
\n
\n
\n","
\n
\n
\n
\n

\n {{'twoStepLogin' | i18n}}\n {{'authenticatorAppTitle' | i18n}}\n

\n \n
\n \n \n
\n
\n \n \"\"\n

{{'twoStepAuthenticatorDesc' | i18n}}

\n

\n 1. {{'twoStepAuthenticatorDownloadApp' | i18n}}\n

\n
\n \n \n

{{'twoStepLoginProviderEnabled' | i18n}}

\n {{'twoStepAuthenticatorReaddDesc' | i18n}}\n
\n \"\"\n

{{'twoStepAuthenticatorNeedApp' | i18n}}

\n
\n \n

{{'twoStepAuthenticatorAppsRecommended' | i18n}}

\n

\n 2. {{'twoStepAuthenticatorScanCode' | i18n}}\n

\n
\n

\n
\n {{key}}\n

\n \n \n \n \n
\n
\n \n \n
\n
\n
\n
\n
\n","
\n
\n
\n
\n

\n {{'share' | i18n}}\n {{cipher.name}}\n

\n \n
\n
\n

{{'shareDesc' | i18n}}

\n
\n \n \n
\n
\n

{{'collections' | i18n}}

\n
\n \n \n
\n
\n
\n {{'noCollectionsInList' | i18n}}\n
\n \n \n \n \n \n \n \n
\n \n \n {{c.name}}\n
\n
\n
\n \n \n
\n
\n
\n
\n","
\n
\n
\n
\n

{{'purgeVault' | i18n}}

\n \n
\n
\n

{{'purgeVaultDesc' | i18n}}

\n {{'purgeVaultWarning' | i18n}}\n \n \n
\n
\n \n \n
\n
\n
\n
\n","
\n
\n
\n
\n

{{'passwordHistory' | i18n}}

\n \n
\n
    \n
  • \n
    \n
    {{h.password}}
    \n {{h.date | date:'medium'}}\n
    \n
    \n \n
    \n
  • \n
\n
\n {{'noPasswordsInList' | i18n}}\n
\n
\n \n
\n \n
\n
\n
\n
\n
\n","
\n
\n
\n
\n

\n {{'groupAccess' | i18n}}\n {{name}}\n

\n \n
\n
\n \n
\n
\n

{{'groupAccessUserDesc' | i18n}}

\n
\n {{'noGroupsInList' | i18n}}\n
\n \n \n \n \n \n \n \n
\n \n \n {{g.name}}\n
\n
\n
\n \n \n
\n
\n
\n
\n","
\n
\n
\n
\n

\n {{title}}\n {{name}}\n

\n \n
\n
\n \n
\n
\n \n

{{'inviteUserDesc' | i18n}}

\n
\n \n \n {{'inviteMultipleEmailDesc' | i18n : '20'}}\n
\n
\n

{{'userType' | i18n}}

\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n

\n
\n {{'accessControl' | i18n}}\n
\n
\n \n \n
\n

\n
\n
\n \n \n
\n
\n \n \n
\n
\n \n
\n {{'noCollectionsInList' | i18n}}\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
 {{'name' | i18n}}{{'readOnly' | i18n}}
\n \n \n {{c.name}}\n \n \n
\n
\n
\n
\n \n \n
\n \n
\n
\n
\n
\n
\n","
\n
\n
\n
\n

{{title}}

\n \n
\n
\n \n
\n
\n
\n \n \n
\n
\n \n \n {{'externalIdGroupDesc' | i18n}}\n
\n

\n
\n {{'accessControl' | i18n}}\n
\n
\n \n \n
\n

\n
\n
\n \n \n
\n
\n \n \n
\n
\n \n
\n {{'noCollectionsInList' | i18n}}\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
 {{'name' | i18n}}{{'readOnly' | i18n}}
\n \n \n {{c.name}}\n \n \n
\n
\n
\n
\n \n \n
\n \n
\n
\n
\n
\n
\n","
\n
\n
\n
\n

\n {{'userAccess' | i18n}}\n {{entityName}}\n

\n \n
\n
\n \n
\n
\n \n {{'noUsersInList' | i18n}}\n \n \n \n \n \n \n \n \n \n \n \n
\n \n \n {{u.email}}\n {{'invited' | i18n}}\n {{'accepted' | i18n}}\n {{u.name}}\n \n \n \n \n {{'owner' | i18n}}\n {{'admin' | i18n}}\n {{'user' | i18n}}\n \n \n
\n
\n
\n \n
\n
\n
\n
\n","
\n
\n
\n
\n

\n {{'eventLogs' | i18n}}\n {{name}}\n

\n \n
\n
\n \n
\n
\n
\n
\n \n \n -\n \n \n
\n \n
\n
\n
\n {{'noEventsInList' | i18n}}\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
{{'timestamp' | i18n}}\n {{'device' | i18n}}\n {{'user' | i18n}}{{'event' | i18n}}
{{e.date | date:'medium'}}\n \n \n {{e.userName}}\n
\n \n
\n
\n \n
\n
\n
\n
\n","
\n
\n
\n
\n

\n {{'collections' | i18n}}\n {{cipher.name}}\n

\n \n
\n
\n

{{'collectionsDesc' | i18n}}

\n
\n

{{'collections' | i18n}}

\n
\n \n \n
\n
\n
\n {{'noCollectionsInList' | i18n}}\n
\n \n \n \n \n \n \n \n
\n \n \n {{c.name}}\n
\n
\n
\n \n \n
\n
\n
\n
\n","
\n
\n
\n
\n

{{title}}

\n \n
\n
\n \n
\n
\n
\n \n \n
\n

\n {{'groupAccess' | i18n}}\n
\n \n \n
\n

\n
\n {{'noGroupsInList' | i18n}}\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
 {{'name' | i18n}}{{'readOnly' | i18n}}
\n \n \n \n {{g.name}}\n \n \n \n \n
\n
\n
\n \n \n
\n \n
\n
\n
\n
\n
\n","
\n
\n
\n
\n

\n {{'attachments' | i18n}}\n {{cipher.name}}\n

\n \n
\n
\n \n \n \n \n \n \n \n \n
\n \n \n \n {{a.fileName}}\n
\n {{a.sizeName}}\n
\n \n
\n

{{'newAttachment' | i18n}}

\n \n \n {{'maxFileSize' | i18n}}\n
\n
\n \n \n
\n
\n
\n
\n","
\n
\n
\n
\n

{{title}}

\n \n
\n
\n
\n
\n \n \n
\n
\n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n \n
\n \n
\n \n
\n
\n
\n
\n
\n \n \n
\n
\n \n
\n \n \n
\n
\n
\n
\n
\n
\n \n \n
\n
\n \n
\n \n {{totpSec}}\n \n \n \n \n \n \n \n {{totpCodeFormatted}}\n \n
\n
\n
\n \n
\n
\n \n
\n \n
\n \n \n
\n
\n
\n
\n
\n \n \n \n \n
\n
\n \n \n
\n
\n
\n
\n \n {{'newUri' | i18n}}\n \n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n
\n
\n \n
\n \n
\n \n
\n
\n
\n
\n \n \n
\n
\n \n \n
\n
\n
\n
\n \n
\n \n
\n \n \n
\n
\n
\n
\n
\n \n \n
\n
\n \n \n
\n
\n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n
\n
\n \n \n
\n
\n \n \n
\n
\n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n
\n
\n \n \n
\n
\n \n \n
\n
\n
\n
\n \n \n
\n
\n \n \n
\n
\n
\n
\n \n \n
\n
\n \n \n
\n
\n
\n
\n \n \n
\n
\n \n \n
\n
\n
\n
\n \n \n
\n
\n
\n
\n \n \n
\n

{{'customFields' | i18n}}

\n \n
\n
\n
\n \n \n \n \n
\n \n
\n
\n \n
\n
\n \n
\n \n
\n
\n
\n \n
\n \n \n
\n
\n
\n \n
\n \n
\n
\n
\n
\n \n {{'newCustomField' | i18n}}\n \n
\n
\n \n \n
\n
\n
\n
\n \n \n
\n \n \n
\n
\n
\n
\n
\n","","
\n
\n
\n
\n

{{title}}

\n \n
\n
\n \n \n
\n
\n \n \n
\n \n
\n
\n
\n
\n
\n","
\n
\n
\n
\n

{{'deleteOrganization' | i18n}}

\n \n
\n
\n

{{'deleteOrganizationDesc' | i18n}}

\n {{'deleteOrganizationWarning' | i18n}}\n \n \n
\n
\n \n \n
\n
\n
\n
\n","
\n
\n
\n
\n

{{'deleteAccount' | i18n}}

\n \n
\n
\n

{{'deleteAccountDesc' | i18n}}

\n {{'deleteAccountWarning' | i18n}}\n \n \n
\n
\n \n \n
\n
\n
\n
\n","
\n
\n
\n
\n

{{'deauthorizeSessions' | i18n}}

\n \n
\n
\n

{{'deauthorizeSessionsDesc' | i18n}}

\n {{'deauthorizeSessionsWarning' | i18n}}\n \n \n
\n
\n \n \n
\n
\n
\n
\n","
\n
\n
\n
\n

\n {{'shareSelected' | i18n}}\n

\n \n
\n
\n

{{'shareManyDesc' | i18n}}

\n

{{'shareSelectedItemsDesc' | i18n: this.ciphers.length : shareableCiphers.length : nonShareableCount}}

\n
\n \n \n
\n
\n

{{'collections' | i18n}}

\n
\n \n \n
\n
\n
\n {{'noCollectionsInList' | i18n}}\n
\n \n \n \n \n \n \n \n
\n \n \n {{c.name}}\n
\n
\n
\n \n \n
\n
\n
\n
\n","
\n
\n
\n
\n

\n {{'moveSelected' | i18n}}\n

\n \n
\n
\n

{{'moveSelectedItemsDesc' | i18n: cipherIds.length}}

\n
\n \n \n
\n
\n
\n \n \n
\n
\n
\n
\n","
\n
\n
\n
\n

\n {{'deleteSelected' | i18n}}\n

\n \n
\n
\n {{'deleteSelectedItemsDesc' | i18n: cipherIds.length}}\n
\n
\n \n \n
\n
\n
\n
\n","export class VerifyBankRequest {\n amount1: number;\n amount2: number;\n}\n","export class SeatRequest {\n seatAdjustment: number;\n}\n","
\n
\n

{{(add ? 'addSeats' : 'removeSeats') | i18n}}

\n
\n
\n \n \n
\n
\n
\n {{'total' | i18n}}: {{seatAdjustment || 0}} × {{seatPrice | currency:'$'}} = {{adjustedSeatTotal\n | currency:'$'}} /{{interval | i18n}}\n
\n \n \n \n {{(add ? 'seatsAddNote' : 'seatsRemoveNote') | i18n}}\n \n
\n
\n","
\n

\n {{'billingAndLicensing' | i18n}}\n \n \n \n

\n
\n\n\n {{'subscriptionCanceled' | i18n}}\n \n

{{'subscriptionPendingCanceled' | i18n}}

\n \n
\n
\n
{{'billingPlan' | i18n}}
\n
{{billing.plan}}
\n
{{'expiration' | i18n}}
\n
{{billing.expiration | date:'mediumDate'}}
\n
{{'neverExpires' | i18n}}
\n
\n
\n
\n
\n
{{'billingPlan' | i18n}}
\n
{{billing.plan}}
\n \n
{{'status' | i18n}}
\n
\n {{subscription.status || '-'}}\n {{'pendingCancellation' | i18n}}\n
\n
{{'nextCharge' | i18n}}
\n
{{nextInvoice ? ((nextInvoice.date | date: 'mediumDate') + ', ' + (nextInvoice.amount | currency:'$'))\n : '-'}}\n
\n
\n
\n
\n
\n {{'details' | i18n}}\n \n \n \n \n \n \n \n
\n {{i.name}} {{i.quantity > 1 ? '×' + i.quantity : ''}} @ {{i.amount | currency:'$'}}\n \n {{(i.quantity * i.amount) | currency:'$'}} /{{i.interval | i18n}}\n
\n
\n
\n \n
\n \n \n {{'manageSubscription' | i18n}}\n \n
\n
\n
\n

{{'updateLicense' | i18n}}

\n \n
\n
\n
\n \n
\n \n \n \n
\n

{{'userSeats' | i18n}}

\n

{{'subscriptionUserSeats' | i18n : billing.seats}}

\n \n
\n
\n \n \n
\n \n
\n
\n

{{'storage' | i18n}}

\n

{{'subscriptionStorage' | i18n : billing.maxStorageGb || 0 : billing.storageName || '0 MB'}}

\n
\n
{{(storagePercentage / 100) | percent}}
\n
\n \n
\n
\n \n \n
\n \n
\n
\n

{{'paymentMethod' | i18n}}

\n

{{'noPaymentMethod' | i18n}}

\n \n \n

{{'verifyBankAccountDesc' | i18n}} {{'verifyBankAccountFailureWarning' | i18n}}

\n
\n \n
\n
\n
$0.
\n
\n \n
\n \n
\n
\n
$0.
\n
\n \n
\n \n
\n
\n

\n \n {{paymentSource.description}}\n

\n
\n \n \n \n

{{'charges' | i18n}}

\n

{{'noCharges' | i18n}}

\n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n {{c.createdDate | date:'mediumDate'}}{{c.paymentSource ? c.paymentSource.description : '-'}}{{c.status}}{{c.amount | currency:'$'}}
\n * {{'chargesStatement' | i18n : 'BITWARDEN'}}\n
\n
\n","
\n

{{'twoStepLogin' | i18n}}

\n
\n

{{'twoStepLoginDesc' | i18n}}

\n

{{'twoStepLoginOrganizationDesc' | i18n}}

\n\n

{{'twoStepLoginRecoveryWarning' | i18n}}

\n \n
\n

\n {{'providers' | i18n}}\n \n \n \n

\n\n\n\n\n\n\n\n\n","export class OrganizationUpdateRequest {\n name: string;\n businessName: string;\n billingEmail: string;\n}\n","
\n

{{'myOrganization' | i18n}}

\n
\n
\n \n
\n
\n
\n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n
\n \n
\n
\n \n
\n
\n

{{'taxInformation' | i18n}}

\n
\n
\n
{{org.businessAddress1}}
\n
{{org.businessAddress2}}
\n
{{org.businessAddress3}}
\n
{{org.businessCountry}}
\n
{{org.businessTaxNumber}}
\n
\n

{{'taxInformationDesc' | i18n}}

\n\n {{'contactSupport' | i18n}}\n\n
\n

{{'dangerZone' | i18n}}

\n
\n
\n
\n

{{'dangerZoneDesc' | i18n}}

\n \n
\n
\n\n","
\n \n
\n","export class OrganizationUserUpdateGroupsRequest {\n groupIds: string[] = [];\n}\n","import { OrganizationUserType } from '../../enums/organizationUserType';\n\nimport { SelectionReadOnlyRequest } from './selectionReadOnlyRequest';\n\nexport class OrganizationUserUpdateRequest {\n type: OrganizationUserType;\n accessAll: boolean;\n collections: SelectionReadOnlyRequest[] = [];\n}\n","import { OrganizationUserType } from '../../enums/organizationUserType';\n\nimport { SelectionReadOnlyRequest } from './selectionReadOnlyRequest';\n\nexport class OrganizationUserInviteRequest {\n emails: string[] = [];\n type: OrganizationUserType;\n accessAll: boolean;\n collections: SelectionReadOnlyRequest[] = [];\n}\n","export class OrganizationUserConfirmRequest {\n key: string;\n}\n","
\n

{{'people' | i18n}}

\n
\n
\n \n \n \n
\n
\n \n \n
\n \n
\n
\n\n\n

{{'noUsersInList' | i18n}}

\n \n \n \n \n \n \n \n \n \n
\n \n \n {{u.email}}\n {{'invited' | i18n}}\n {{'accepted' | i18n}}\n {{u.name}}\n \n {{'owner' | i18n}}\n {{'admin' | i18n}}\n {{'user' | i18n}}\n \n \n
\n
\n\n\n\n","import { SelectionReadOnlyRequest } from './selectionReadOnlyRequest';\n\nexport class GroupRequest {\n name: string;\n accessAll: boolean;\n externalId: string;\n collections: SelectionReadOnlyRequest[] = [];\n}\n","
\n

{{'groups' | i18n}}

\n
\n
\n \n \n
\n \n
\n
\n\n\n

{{'noGroupsInList' | i18n}}

\n \n \n \n \n \n \n \n
\n {{g.name}}\n \n \n
\n
\n\n\n","
\n

{{'eventLogs' | i18n}}

\n
\n
\n \n \n -\n \n \n
\n \n
\n
\n\n\n

{{'noEventsInList' | i18n}}

\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
{{'timestamp' | i18n}}\n {{'device' | i18n}}\n {{'user' | i18n}}{{'event' | i18n}}
{{e.date | date:'medium'}}\n \n \n {{e.userName}}\n
\n \n
\n","
\n

{{'collections' | i18n}}

\n
\n
\n \n \n
\n \n
\n
\n\n\n

{{'noCollectionsInList' | i18n}}

\n \n \n \n \n \n \n \n
\n {{c.name}}\n \n \n
\n
\n\n\n","
\r\n
\r\n \r\n
\r\n \r\n
\r\n
\r\n
\r\n","
\n
\n

{{'exportVault' | i18n}}

\n
\n

{{'exportMasterPassword' | i18n}}

\n {{'exportWarning' | i18n}}\n
\n
\n \n \n
\n
\n \n
\n","import { CipherRequest } from './cipherRequest';\nimport { CollectionRequest } from './collectionRequest';\nimport { KvpRequest } from './kvpRequest';\n\nexport class ImportOrganizationCiphersRequest {\n ciphers: CipherRequest[] = [];\n collections: CollectionRequest[] = [];\n collectionRelationships: Array> = [];\n}\n","
\n

{{'importData' | i18n}}

\n
\n
\n
\n
\n
\n \n \n
\n
\n
\n \n \n See detailed instructions on our help site at\n https://help.bitwarden.com/article/export-your-data/\n \n \n See detailed instructions on our help site at\n https://help.bitwarden.com/article/import-from-lastpass/\n \n \n Using the KeePassX desktop application, navigate to \"Database\" → \"Export to CSV file\" and save the CSV file.\n \n \n In the Avira web vault, go to \"Settings\" → \"My Data\" → \"Export data\" and save the CSV file.\n \n \n In the Blur web vault, click your username at the top and go to \"Settings\" → \"Export Data\", then click \"Export CSV\"\n for your \"Accounts\".\n \n \n Using the SaveInCloud desktop application, navigate to \"File\" → \"Export\" → \"As XML\" and save the XML file.\n \n \n Using the Padlock desktop application, click the hamburger icon in the top left corner and navigate to \"Settings\" →\n \"Export\" button and save the file \"As CSV\".\n \n \n Using the KeePass 2 desktop application, navigate to \"File\" → \"Export\" and select the \"KeePass XML (2.x)\" option.\n \n \n Using the Universal Password Manager desktop application, navigate to \"Database\" → \"Export\" and save the CSV file.\n \n \n Using the SaferPass browser extension, click the hamburger icon in the top left corner and navigate to \"Settings\". Click\n the \"Export accounts\" button to save the CSV file.\n \n \n Using the Meldium web vault, navigate to \"Settings\". Locate the \"Export data\" function and click \"Show me my data\" to save\n the CSV file.\n \n \n Log into the Keeper web vault (keepersecurity.com/vault). Navigate to \"Backup\" (top right) and find the \"Export to .csv File\"\n option. Click \"Export Now\" to save the CSV file.\n \n \n \n The process is exactly the same as importing from Google Chrome.\n \n See detailed instructions on our help site at\n https://help.bitwarden.com/article/import-from-chrome/\n \n \n Use the\n FF Password Exporter application to export your passwords to a CSV file.\n \n \n See detailed instructions on our help site at\n https://help.bitwarden.com/article/import-from-1password/.\n \n \n Using the Password Dragon desktop application, navigate to \"File\" → \"Export\" → \"To XML\". In the dialog that pops\n up select \"All Rows\" and check all fields. Click the \"Export\" button and save the XML file.\n \n \n Using the Enpass desktop application, navigate to \"File\" → \"Export\" → \"As CSV\". Select \"OK\" to the warning alert\n and save the CSV file. Note that the importer only supports files exported while Enpass is set to the English\n language, so adjust your settings accordingly.\n \n \n Using the Password Safe desktop application, navigate to \"File\" → \"Export To\" → \"XML format...\" and save the XML\n file.\n \n \n Using the Dashlane desktop application, navigate to \"File\" → \"Export\" → \"Unsecured archive (readable) in CSV format\"\n and save the CSV file.\n \n \n Using the mSecure desktop application, navigate to \"File\" → \"Export\" → \"CSV File...\" and save the CSV file.\n \n \n Using the Sticky Password desktop application, navigate to \"Menu\" (top right) → \"Export\" → \"Export all\". Select\n the unencrypted format XML option and save the XML file.\n \n \n Using the True Key desktop application, click the gear icon (top right) and then navigate to \"App Settings\". Click the \"Export\"\n button, enter your password and save the CSV file.\n \n \n Log into the Clipperz web application (clipperz.is/app). Click the hamburger menu icon in the top right to expand the navigation\n bar. Navigate to \"Data\" → \"Export\". Click the \"download HTML+JSON\" button to save the HTML file.\n \n \n Using the RoboForm Editor desktop application, navigate to \"RoboForm\" (top left) → \"Options\" → \"Account & Data\"\n and click the \"Export\" button. Select all of your data, change the \"Format\" to \"CSV file\" and then click the\n \"Export\" button to save the CSV file. Note: RoboForm only allows you to export Logins. Other items will not be\n exported.\n \n \n Log into the Passbolt web vault and navigate to the \"Passwords\" listing. Select all of the passwords you would like to export\n and click the \"Export\" button at the top of the listing. Choose the \"csv (lastpass)\" export format and click\n the \"Export\" button.\n \n \n Using the Ascendo DataVault desktop application, navigate to \"Tools\" → \"Export\". In the dialog that pops up, select\n the \"All Items (DVX, CSV)\" option. Click the \"Ok\" button to save the CSV file.\n \n \n Using the Password Boss desktop application, navigate to \"File\" → \"Export data\" → \"Password Boss JSON - not encrypted\"\n and save the JSON file.\n \n \n Log into the Zoho web vault (vault.zoho.com). Navigate to \"Tools\" → \"Export Secrets\". Select \"All Secrets\" and click\n the \"Zoho Vault Format CSV\" button. Highlight and copy the data from the textarea. Open a text editor like Notepad\n and paste the data. Save the data from the text editor as\n zoho_export.csv.\n \n \n Using the SplashID Safe desktop application, click on the SplashID blue lock logo in the top right corner. Navigate to \"Export\"\n → \"Export as CSV\" and save the CSV file.\n \n \n Using the PassKeep mobile app, navigate to \"Backup/Restore\". Locate the \"CSV Backup/Restore\" section and click \"Backup to\n CSV\" to save the CSV file.\n \n \n Make sure you have python-keyring and python-gnomekeyring installed. Save the\n GNOME Keyring Import/Export python script to your desktop as\n pw_helper.py. Open terminal and run\n chmod +rx Desktop/pw_helper.py and then\n python Desktop/pw_helper.py export Desktop/my_passwords.json. Then upload the resulting\n my_passwords.json file here to Bitwarden.\n \n \n Using the Password Agent desktop application navigate to \"File\" → \"Export\", select the \"Fields to export\" button and\n check all of the fields, change the \"Output format\" to \"CSV\", and then click the \"Start\" button to save the CSV\n file.\n \n \n
\n
\n
\n \n \n
\n
\n
\n
\n \n \n
\n \n
\n","
\r\n
\r\n
\r\n
\r\n
{{'tools' | i18n}}
\r\n \r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n","export enum EventType {\n User_LoggedIn = 1000,\n User_ChangedPassword = 1001,\n User_Enabled2fa = 1002,\n User_Disabled2fa = 1003,\n User_Recovered2fa = 1004,\n User_FailedLogIn = 1005,\n User_FailedLogIn2fa = 1006,\n\n Cipher_Created = 1100,\n Cipher_Updated = 1101,\n Cipher_Deleted = 1102,\n Cipher_AttachmentCreated = 1103,\n Cipher_AttachmentDeleted = 1104,\n Cipher_Shared = 1105,\n Cipher_UpdatedCollections = 1106,\n\n Collection_Created = 1300,\n Collection_Updated = 1301,\n Collection_Deleted = 1302,\n\n Group_Created = 1400,\n Group_Updated = 1401,\n Group_Deleted = 1402,\n\n OrganizationUser_Invited = 1500,\n OrganizationUser_Confirmed = 1501,\n OrganizationUser_Updated = 1502,\n OrganizationUser_Removed = 1503,\n OrganizationUser_UpdatedGroups = 1504,\n\n Organization_Updated = 1600,\n\n}\n","\n 0\">\n \n \n \n \n \n \n \n \n
\n \n \n \n \n {{c.name}}\n \n \n
\n {{c.subTitle}}\n
\n \n
\n
\n \n \n

{{'noItemsInList' | i18n}}

\n \n
\n
\n
\n","
\n
\n Filters\n
\n
\n \n \n

{{'types' | i18n}}

\n \n

\n \n

\n \n \n

\n {{'folders' | i18n}}\n \n \n \n

\n \n
\n \n

{{'collections' | i18n}}

\n \n
\n
\n
\n
\n","
\n
\n
\n \n \n
\n
\n
\n

{{'vault' | i18n}}

\n \n
\n \n \n
\n
\n
\n\n\n\n\n","\n
\n
\n
\n \n
\n {{organization.name}}\n {{'organization' | i18n}}\n
\n
\n \n
\n
\n\n\n","
\n

{{'dataBreachReport' | i18n}}

\n
\n

{{'breachDesc' | i18n}}

\n
\n
\n
\n \n \n {{'breachCheckUsernameEmail' | i18n}}\n
\n
\n \n
\n
\n

{{'reportError' | i18n}}...

\n \n \n {{'breachUsernameNotFound' | i18n : checkedUsername}}\n \n \n {{'breachUsernameFound' | i18n : checkedUsername : breachedAccounts.length}}\n \n
    \n
  • \n
    \n
    \n \"\"\n
    \n
    \n

    {{a.title}}

    \n

    \n

    {{'compromisedData' | i18n}}:

    \n
      \n
    • {{d}}
    • \n
    \n
    \n
    \n
    \n
    {{'website' | i18n}}
    \n
    {{a.domain}}
    \n
    {{'affectedUsers' | i18n}}
    \n
    {{a.pwnCount | number}}
    \n
    {{'breachOccurred' | i18n}}
    \n
    {{a.breachDate | date: 'mediumDate'}}
    \n
    {{'breachReported' | i18n}}
    \n
    {{a.addedDate | date: 'mediumDate'}}
    \n
    \n
    \n
    \n
  • \n
\n
\n
\n","import { ToasterService } from 'angular2-toaster';\r\nimport { Angulartics2 } from 'angulartics2';\r\n\r\nimport { OnInit } from '@angular/core';\r\n\r\nimport { I18nService } from '../../abstractions/i18n.service';\r\nimport { PasswordGenerationService } from '../../abstractions/passwordGeneration.service';\r\nimport { PlatformUtilsService } from '../../abstractions/platformUtils.service';\r\n\r\nimport { PasswordHistory } from '../../models/domain/passwordHistory';\r\n\r\nexport class PasswordGeneratorHistoryComponent implements OnInit {\r\n history: PasswordHistory[] = [];\r\n\r\n constructor(protected passwordGenerationService: PasswordGenerationService, protected analytics: Angulartics2,\r\n protected platformUtilsService: PlatformUtilsService, protected i18nService: I18nService,\r\n protected toasterService: ToasterService, private win: Window) { }\r\n\r\n async ngOnInit() {\r\n this.history = await this.passwordGenerationService.getHistory();\r\n }\r\n\r\n clear() {\r\n this.history = [];\r\n this.passwordGenerationService.clear();\r\n }\r\n\r\n copy(password: string) {\r\n this.analytics.eventTrack.next({ action: 'Copied Historical Password' });\n const copyOptions = this.win != null ? { doc: this.win.document } : null;\r\n this.platformUtilsService.copyToClipboard(password, copyOptions);\r\n this.toasterService.popAsync('info', null, this.i18nService.t('valueCopied', this.i18nService.t('password')));\r\n }\r\n}\r\n","import { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport {\n EventEmitter,\n Input,\n OnInit,\n Output,\n} from '@angular/core';\n\nimport { I18nService } from '../../abstractions/i18n.service';\nimport { PasswordGenerationService } from '../../abstractions/passwordGeneration.service';\nimport { PlatformUtilsService } from '../../abstractions/platformUtils.service';\n\nexport class PasswordGeneratorComponent implements OnInit {\n @Input() showSelect: boolean = false;\n @Output() onSelected = new EventEmitter();\n\n options: any = {};\n password: string = '-';\n showOptions = false;\n avoidAmbiguous = false;\n\n constructor(protected passwordGenerationService: PasswordGenerationService, protected analytics: Angulartics2,\n protected platformUtilsService: PlatformUtilsService, protected i18nService: I18nService,\n protected toasterService: ToasterService, private win: Window) { }\n\n async ngOnInit() {\n this.options = await this.passwordGenerationService.getOptions();\n this.avoidAmbiguous = !this.options.ambiguous;\n this.password = await this.passwordGenerationService.generatePassword(this.options);\n this.analytics.eventTrack.next({ action: 'Generated Password' });\n await this.passwordGenerationService.addHistory(this.password);\n }\n\n async sliderChanged() {\n this.saveOptions(false);\n await this.passwordGenerationService.addHistory(this.password);\n this.analytics.eventTrack.next({ action: 'Regenerated Password' });\n }\n\n async sliderInput() {\n this.normalizeOptions();\n this.password = await this.passwordGenerationService.generatePassword(this.options);\n }\n\n async saveOptions(regenerate: boolean = true) {\n this.normalizeOptions();\n await this.passwordGenerationService.saveOptions(this.options);\n\n if (regenerate) {\n await this.regenerate();\n }\n }\n\n async regenerate() {\n this.password = await this.passwordGenerationService.generatePassword(this.options);\n await this.passwordGenerationService.addHistory(this.password);\n this.analytics.eventTrack.next({ action: 'Regenerated Password' });\n }\n\n copy() {\n this.analytics.eventTrack.next({ action: 'Copied Generated Password' });\n const copyOptions = this.win != null ? { doc: this.win.document } : null;\n this.platformUtilsService.copyToClipboard(this.password, copyOptions);\n this.toasterService.popAsync('info', null, this.i18nService.t('valueCopied', this.i18nService.t('password')));\n }\n\n select() {\n this.analytics.eventTrack.next({ action: 'Selected Generated Password' });\n this.onSelected.emit(this.password);\n }\n\n toggleOptions() {\n this.showOptions = !this.showOptions;\n }\n\n private normalizeOptions() {\n this.options.minLowercase = 0;\n this.options.minUppercase = 0;\n this.options.ambiguous = !this.avoidAmbiguous;\n\n if (!this.options.uppercase && !this.options.lowercase && !this.options.number && !this.options.special) {\n this.options.lowercase = true;\n const lowercase = document.querySelector('#lowercase') as HTMLInputElement;\n if (lowercase) {\n lowercase.checked = true;\n }\n }\n\n if (!this.options.length || this.options.length < 5) {\n this.options.length = 5;\n } else if (this.options.length > 128) {\n this.options.length = 128;\n }\n\n if (!this.options.minNumber) {\n this.options.minNumber = 0;\n } else if (this.options.minNumber > this.options.length) {\n this.options.minNumber = this.options.length;\n } else if (this.options.minNumber > 9) {\n this.options.minNumber = 9;\n }\n\n if (!this.options.minSpecial) {\n this.options.minSpecial = 0;\n } else if (this.options.minSpecial > this.options.length) {\n this.options.minSpecial = this.options.length;\n } else if (this.options.minSpecial > 9) {\n this.options.minSpecial = 9;\n }\n\n if (this.options.minSpecial + this.options.minNumber > this.options.length) {\n this.options.minSpecial = this.options.length - this.options.minNumber;\n }\n }\n}\n","
\n

{{'passwordGenerator' | i18n}}

\n
\n
\n
\n {{password}}\n
\n
\n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n
\n
\n \n \n
\n
\n \n
\n
\n\n","import { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport {\n EventEmitter,\n Output,\n} from '@angular/core';\n\nimport { CryptoService } from '../../abstractions/crypto.service';\nimport { ExportService } from '../../abstractions/export.service';\nimport { I18nService } from '../../abstractions/i18n.service';\nimport { PlatformUtilsService } from '../../abstractions/platformUtils.service';\nimport { UserService } from '../../abstractions/user.service';\n\nexport class ExportComponent {\n @Output() onSaved = new EventEmitter();\n\n formPromise: Promise;\n masterPassword: string;\n showPassword = false;\n\n constructor(protected analytics: Angulartics2, protected toasterService: ToasterService,\n protected cryptoService: CryptoService, protected userService: UserService,\n protected i18nService: I18nService, protected platformUtilsService: PlatformUtilsService,\n protected exportService: ExportService, protected win: Window) { }\n\n async submit() {\n if (this.masterPassword == null || this.masterPassword === '') {\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'),\n this.i18nService.t('invalidMasterPassword'));\n return;\n }\n\n const email = await this.userService.getEmail();\n const key = await this.cryptoService.makeKey(this.masterPassword, email);\n const keyHash = await this.cryptoService.hashPassword(this.masterPassword, key);\n const storedKeyHash = await this.cryptoService.getKeyHash();\n\n if (storedKeyHash != null && keyHash != null && storedKeyHash === keyHash) {\n try {\n this.formPromise = this.getExportData();\n const data = await this.formPromise;\n this.analytics.eventTrack.next({ action: 'Exported Data' });\n this.downloadFile(data);\n this.saved();\n } catch { }\n } else {\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'),\n this.i18nService.t('invalidMasterPassword'));\n }\n }\n\n togglePassword() {\n this.analytics.eventTrack.next({ action: 'Toggled Master Password on Export' });\n this.showPassword = !this.showPassword;\n document.getElementById('masterPassword').focus();\n }\n\n protected saved() {\n this.onSaved.emit();\n }\n\n protected getExportData() {\n return this.exportService.getExport('csv');\n }\n\n protected getFileName(prefix?: string) {\n return this.exportService.getFileName(prefix);\n }\n\n private downloadFile(csv: string): void {\n const fileName = this.getFileName();\n this.platformUtilsService.saveFile(this.win, csv, { type: 'text/plain' }, fileName);\n }\n}\n","import { BaseImporter } from './baseImporter';\r\nimport { Importer } from './importer';\r\n\r\nimport { ImportResult } from '../models/domain/importResult';\r\nimport { CipherView } from '../models/view';\r\n\r\nexport class ZohoVaultCsvImporter extends BaseImporter implements Importer {\r\n parse(data: string): ImportResult {\r\n const result = new ImportResult();\r\n const results = this.parseCsv(data, true);\r\n if (results == null) {\r\n result.success = false;\r\n return result;\r\n }\r\n\r\n results.forEach((value) => {\r\n if (this.isNullOrWhitespace(value['Secret Name'])) {\r\n return;\r\n }\r\n this.processFolder(result, this.getValueOrDefault(value.ChamberName));\r\n const cipher = this.initLoginCipher();\r\n cipher.favorite = this.getValueOrDefault(value.Favorite, '0') === '1';\r\n cipher.notes = this.getValueOrDefault(value.Notes);\r\n cipher.name = this.getValueOrDefault(value['Secret Name'], '--');\r\n cipher.login.uris = this.makeUriArray(value['Secret URL']);\r\n this.parseData(cipher, value.SecretData);\r\n this.parseData(cipher, value.CustomData);\r\n this.convertToNoteIfNeeded(cipher);\r\n this.cleanupCipher(cipher);\r\n result.ciphers.push(cipher);\r\n });\r\n\r\n if (this.organization) {\r\n this.moveFoldersToCollections(result);\r\n }\r\n\r\n result.success = true;\r\n return result;\r\n }\r\n\r\n private parseData(cipher: CipherView, data: string) {\r\n if (this.isNullOrWhitespace(data)) {\r\n return;\r\n }\r\n const dataLines = this.splitNewLine(data);\r\n dataLines.forEach((line) => {\r\n const delimPosition = line.indexOf(':');\r\n if (delimPosition < 0) {\r\n return;\r\n }\r\n const field = line.substring(0, delimPosition);\r\n const value = line.length > delimPosition ? line.substring(delimPosition + 1) : null;\r\n if (this.isNullOrWhitespace(field) || this.isNullOrWhitespace(value) || field === 'SecretType') {\r\n return;\r\n }\r\n const fieldLower = field.toLowerCase();\r\n if (cipher.login.username == null && this.usernameFieldNames.indexOf(fieldLower) > -1) {\r\n cipher.login.username = value;\r\n } else if (cipher.login.password == null && this.passwordFieldNames.indexOf(fieldLower) > -1) {\r\n cipher.login.password = value;\r\n } else {\r\n this.processKvp(cipher, field, value);\r\n }\r\n });\r\n }\r\n}\r\n","import { BaseImporter } from './baseImporter';\nimport { Importer } from './importer';\n\nimport { ImportResult } from '../models/domain/importResult';\n\nexport class UpmCsvImporter extends BaseImporter implements Importer {\n parse(data: string): ImportResult {\n const result = new ImportResult();\n const results = this.parseCsv(data, false);\n if (results == null) {\n result.success = false;\n return result;\n }\n\n results.forEach((value) => {\n if (value.length !== 5) {\n return;\n }\n const cipher = this.initLoginCipher();\n cipher.name = this.getValueOrDefault(value[0], '--');\n cipher.notes = this.getValueOrDefault(value[4]);\n cipher.login.username = this.getValueOrDefault(value[1]);\n cipher.login.password = this.getValueOrDefault(value[2]);\n cipher.login.uris = this.makeUriArray(value[3]);\n this.cleanupCipher(cipher);\n result.ciphers.push(cipher);\n });\n\n result.success = true;\n return result;\n }\n}\n","import { BaseImporter } from './baseImporter';\nimport { Importer } from './importer';\n\nimport { ImportResult } from '../models/domain/importResult';\n\nimport { CardView } from '../models/view/cardView';\nimport { SecureNoteView } from '../models/view/secureNoteView';\n\nimport { CipherType } from '../enums/cipherType';\nimport { SecureNoteType } from '../enums/secureNoteType';\n\nconst PropertiesToIgnore = ['kind', 'autologin', 'favorite', 'hexcolor', 'protectedwithpassword', 'subdomainonly',\n 'type', 'tk_export_version', 'note', 'title', 'document_content',\n];\n\nexport class TrueKeyCsvImporter extends BaseImporter implements Importer {\n parse(data: string): ImportResult {\n const result = new ImportResult();\n const results = this.parseCsv(data, true);\n if (results == null) {\n result.success = false;\n return result;\n }\n\n results.forEach((value) => {\n const cipher = this.initLoginCipher();\n cipher.favorite = this.getValueOrDefault(value.favorite, '').toLowerCase() === 'true';\n cipher.name = this.getValueOrDefault(value.name, '--');\n cipher.notes = this.getValueOrDefault(value.memo, '');\n cipher.login.username = this.getValueOrDefault(value.login);\n cipher.login.password = this.getValueOrDefault(value.password);\n cipher.login.uris = this.makeUriArray(value.url);\n\n if (value.kind !== 'login') {\n cipher.name = this.getValueOrDefault(value.title, '--');\n cipher.notes = this.getValueOrDefault(value.note, '');\n }\n\n if (value.kind === 'cc') {\n cipher.type = CipherType.Card;\n cipher.card = new CardView();\n cipher.card.cardholderName = this.getValueOrDefault(value.cardholder);\n cipher.card.number = this.getValueOrDefault(value.number);\n cipher.card.brand = this.getCardBrand(cipher.card.number);\n if (!this.isNullOrWhitespace(value.expiryDate)) {\n try {\n const expDate = new Date(value.expiryDate);\n cipher.card.expYear = expDate.getFullYear().toString();\n cipher.card.expMonth = (expDate.getMonth() + 1).toString();\n } catch { }\n }\n } else if (value.kind !== 'login') {\n cipher.type = CipherType.SecureNote;\n cipher.secureNote = new SecureNoteView();\n cipher.secureNote.type = SecureNoteType.Generic;\n if (!this.isNullOrWhitespace(cipher.notes)) {\n cipher.notes = this.getValueOrDefault(value.document_content, '');\n }\n for (const property in value) {\n if (value.hasOwnProperty(property) && PropertiesToIgnore.indexOf(property.toLowerCase()) < 0 &&\n !this.isNullOrWhitespace(value[property])) {\n this.processKvp(cipher, property, value[property]);\n }\n }\n }\n\n this.cleanupCipher(cipher);\n result.ciphers.push(cipher);\n });\n\n result.success = true;\n return result;\n }\n}\n","import { BaseImporter } from './baseImporter';\r\nimport { Importer } from './importer';\r\n\r\nimport { ImportResult } from '../models/domain/importResult';\r\n\r\nexport class StickyPasswordXmlImporter extends BaseImporter implements Importer {\r\n parse(data: string): ImportResult {\r\n const result = new ImportResult();\r\n const doc = this.parseXml(data);\r\n if (doc == null) {\r\n result.success = false;\r\n return result;\r\n }\r\n\r\n const loginNodes = doc.querySelectorAll('root > Database > Logins > Login');\r\n Array.from(loginNodes).forEach((loginNode) => {\r\n const accountId = loginNode.getAttribute('ID');\r\n if (this.isNullOrWhitespace(accountId)) {\r\n return;\r\n }\r\n\r\n const usernameText = loginNode.getAttribute('Name');\r\n const passwordText = loginNode.getAttribute('Password');\r\n let titleText: string = null;\r\n let linkText: string = null;\r\n let notesText: string = null;\r\n let groupId: string = null;\r\n let groupText: string = null;\r\n\r\n const accountLogin = doc.querySelector('root > Database > Accounts > Account > ' +\r\n 'LoginLinks > Login[SourceLoginID=\"' + accountId + '\"]');\r\n if (accountLogin != null) {\r\n const account = accountLogin.parentElement.parentElement;\r\n if (account != null) {\r\n titleText = account.getAttribute('Name');\r\n linkText = account.getAttribute('Link');\r\n groupId = account.getAttribute('ParentID');\r\n notesText = account.getAttribute('Comments');\r\n if (!this.isNullOrWhitespace(notesText)) {\r\n notesText = notesText.split('/n').join('\\n');\r\n }\r\n }\r\n }\r\n\r\n if (!this.isNullOrWhitespace(groupId)) {\r\n groupText = this.buildGroupText(doc, groupId, '');\r\n this.processFolder(result, groupText);\r\n }\r\n\r\n const cipher = this.initLoginCipher();\r\n cipher.name = this.getValueOrDefault(titleText, '--');\r\n cipher.notes = this.getValueOrDefault(notesText);\r\n cipher.login.username = this.getValueOrDefault(usernameText);\r\n cipher.login.password = this.getValueOrDefault(passwordText);\r\n cipher.login.uris = this.makeUriArray(linkText);\r\n this.cleanupCipher(cipher);\r\n result.ciphers.push(cipher);\r\n });\r\n\r\n if (this.organization) {\r\n this.moveFoldersToCollections(result);\r\n }\r\n\r\n result.success = true;\r\n return result;\r\n }\r\n\r\n buildGroupText(doc: Document, groupId: string, groupText: string): string {\r\n const group = doc.querySelector('root > Database > Groups > Group[ID=\"' + groupId + '\"]');\r\n if (group == null) {\r\n return groupText;\r\n }\r\n if (!this.isNullOrWhitespace(groupText)) {\r\n groupText = '/' + groupText;\r\n }\r\n groupText = group.getAttribute('Name') + groupText;\r\n return this.buildGroupText(doc, group.getAttribute('ParentID'), groupText);\r\n }\r\n}\r\n","import { BaseImporter } from './baseImporter';\r\nimport { Importer } from './importer';\r\n\r\nimport { ImportResult } from '../models/domain/importResult';\r\nimport { CipherView } from '../models/view/cipherView';\r\n\r\nexport class SplashIdCsvImporter extends BaseImporter implements Importer {\r\n parse(data: string): ImportResult {\r\n const result = new ImportResult();\r\n const results = this.parseCsv(data, false);\r\n if (results == null) {\r\n result.success = false;\r\n return result;\r\n }\r\n\r\n results.forEach((value) => {\r\n if (value.length < 3) {\r\n return;\r\n }\r\n\r\n this.processFolder(result, this.getValueOrDefault(value[value.length - 1]));\r\n const cipher = this.initLoginCipher();\r\n cipher.notes = this.getValueOrDefault(value[value.length - 2], '');\r\n cipher.name = this.getValueOrDefault(value[1], '--');\r\n\r\n if (value[0] === 'Web Logins' || value[0] === 'Servers' || value[0] === 'Email Accounts') {\r\n cipher.login.username = this.getValueOrDefault(value[2]);\r\n cipher.login.password = this.getValueOrDefault(value[3]);\r\n cipher.login.uris = this.makeUriArray(value[4]);\r\n this.parseFieldsToNotes(cipher, 5, value);\r\n } else {\r\n this.parseFieldsToNotes(cipher, 2, value);\r\n }\r\n\r\n this.convertToNoteIfNeeded(cipher);\r\n this.cleanupCipher(cipher);\r\n result.ciphers.push(cipher);\r\n });\r\n\r\n if (this.organization) {\r\n this.moveFoldersToCollections(result);\r\n }\r\n\r\n result.success = true;\r\n return result;\r\n }\r\n\r\n private parseFieldsToNotes(cipher: CipherView, startIndex: number, value: any) {\r\n // last 3 rows do not get parsed\r\n for (let i = startIndex; i < value.length - 3; i++) {\r\n if (this.isNullOrWhitespace(value[i])) {\r\n continue;\r\n }\r\n cipher.notes += (value[i] + '\\n');\r\n }\r\n }\r\n}\r\n","import { BaseImporter } from './baseImporter';\nimport { Importer } from './importer';\n\nimport { ImportResult } from '../models/domain/importResult';\n\nexport class SaferPassCsvImporter extends BaseImporter implements Importer {\n parse(data: string): ImportResult {\n const result = new ImportResult();\n const results = this.parseCsv(data, true);\n if (results == null) {\n result.success = false;\n return result;\n }\n\n results.forEach((value) => {\n const cipher = this.initLoginCipher();\n cipher.name = this.getValueOrDefault(this.nameFromUrl(value.url), '--');\n cipher.notes = this.getValueOrDefault(value.notes);\n cipher.login.username = this.getValueOrDefault(value.username);\n cipher.login.password = this.getValueOrDefault(value.password);\n cipher.login.uris = this.makeUriArray(value.url);\n this.cleanupCipher(cipher);\n result.ciphers.push(cipher);\n });\n\n result.success = true;\n return result;\n }\n}\n","import { BaseImporter } from './baseImporter';\nimport { Importer } from './importer';\n\nimport { ImportResult } from '../models/domain/importResult';\n\nimport { FolderView } from '../models/view/folderView';\nimport { SecureNoteView } from '../models/view/secureNoteView';\n\nimport { CipherType } from '../enums/cipherType';\nimport { SecureNoteType } from '../enums/secureNoteType';\n\nexport class SafeInCloudXmlImporter extends BaseImporter implements Importer {\n parse(data: string): ImportResult {\n const result = new ImportResult();\n const doc = this.parseXml(data);\n if (doc == null) {\n result.success = false;\n return result;\n }\n\n const db = doc.querySelector('database');\n if (db == null) {\n result.errorMessage = 'Missing `database` node.';\n result.success = false;\n return result;\n }\n\n const foldersMap = new Map();\n\n Array.from(doc.querySelectorAll('database > label')).forEach((labelEl) => {\n const name = labelEl.getAttribute('name');\n const id = labelEl.getAttribute('id');\n if (!this.isNullOrWhitespace(name) && !this.isNullOrWhitespace(id)) {\n foldersMap.set(id, result.folders.length);\n const folder = new FolderView();\n folder.name = name;\n result.folders.push(folder);\n }\n });\n\n Array.from(doc.querySelectorAll('database > card')).forEach((cardEl) => {\n if (cardEl.getAttribute('template') === 'true') {\n return;\n }\n\n const labelIdEl = this.querySelectorDirectChild(cardEl, 'label_id');\n if (labelIdEl != null) {\n const labelId = labelIdEl.textContent;\n if (!this.isNullOrWhitespace(labelId) && foldersMap.has(labelId)) {\n result.folderRelationships.push([result.ciphers.length, foldersMap.get(labelId)]);\n }\n }\n\n const cipher = this.initLoginCipher();\n cipher.name = this.getValueOrDefault(cardEl.getAttribute('title'), '--');\n\n const cardType = cardEl.getAttribute('type');\n if (cardType === 'note') {\n cipher.type = CipherType.SecureNote;\n cipher.secureNote = new SecureNoteView();\n cipher.secureNote.type = SecureNoteType.Generic;\n } else {\n Array.from(this.querySelectorAllDirectChild(cardEl, 'field')).forEach((fieldEl) => {\n const text = fieldEl.textContent;\n if (this.isNullOrWhitespace(text)) {\n return;\n }\n const name = fieldEl.getAttribute('name');\n const fieldType = this.getValueOrDefault(fieldEl.getAttribute('type'), '').toLowerCase();\n if (fieldType === 'login') {\n cipher.login.username = text;\n } else if (fieldType === 'password') {\n cipher.login.password = text;\n } else if (fieldType === 'notes') {\n cipher.notes += (text + '\\n');\n } else if (fieldType === 'weblogin' || fieldType === 'website') {\n cipher.login.uris = this.makeUriArray(text);\n } else {\n this.processKvp(cipher, name, text);\n }\n });\n }\n\n Array.from(this.querySelectorAllDirectChild(cardEl, 'notes')).forEach((notesEl) => {\n cipher.notes += (notesEl.textContent + '\\n');\n });\n\n this.cleanupCipher(cipher);\n result.ciphers.push(cipher);\n });\n\n if (this.organization) {\n this.moveFoldersToCollections(result);\n }\n\n result.success = true;\n return result;\n }\n}\n","import { BaseImporter } from './baseImporter';\r\nimport { Importer } from './importer';\r\n\r\nimport { ImportResult } from '../models/domain/importResult';\r\n\r\nexport class RoboFormCsvImporter extends BaseImporter implements Importer {\r\n parse(data: string): ImportResult {\r\n const result = new ImportResult();\r\n const results = this.parseCsv(data, true);\r\n if (results == null) {\r\n result.success = false;\r\n return result;\r\n }\r\n\r\n let i = 1;\r\n results.forEach((value) => {\r\n const folder = !this.isNullOrWhitespace(value.Folder) && value.Folder.startsWith('/') ?\r\n value.Folder.replace('/', '') : value.Folder;\r\n const folderName = !this.isNullOrWhitespace(folder) ? folder : null;\r\n this.processFolder(result, folderName);\r\n\r\n const cipher = this.initLoginCipher();\r\n cipher.notes = this.getValueOrDefault(value.Note);\r\n cipher.name = this.getValueOrDefault(value.Name, '--');\r\n cipher.login.username = this.getValueOrDefault(value.Login);\r\n cipher.login.password = this.getValueOrDefault(value.Pwd);\r\n cipher.login.uris = this.makeUriArray(value.Url);\r\n this.cleanupCipher(cipher);\r\n\r\n if (i === results.length && cipher.name === '--' && this.isNullOrWhitespace(cipher.login.password)) {\r\n return;\r\n }\r\n result.ciphers.push(cipher);\r\n i++;\r\n });\r\n\r\n if (this.organization) {\r\n this.moveFoldersToCollections(result);\r\n }\r\n\r\n result.success = true;\r\n return result;\r\n }\r\n}\r\n","import { BaseImporter } from './baseImporter';\r\nimport { Importer } from './importer';\r\n\r\nimport { ImportResult } from '../models/domain/importResult';\r\n\r\nexport class PasswordSafeXmlImporter extends BaseImporter implements Importer {\r\n parse(data: string): ImportResult {\r\n const result = new ImportResult();\r\n const doc = this.parseXml(data);\r\n if (doc == null) {\r\n result.success = false;\r\n return result;\r\n }\r\n\r\n const passwordSafe = doc.querySelector('passwordsafe');\r\n if (passwordSafe == null) {\r\n result.errorMessage = 'Missing `passwordsafe` node.';\r\n result.success = false;\r\n return result;\r\n }\r\n\r\n const notesDelimiter = passwordSafe.getAttribute('delimiter');\r\n const entries = doc.querySelectorAll('passwordsafe > entry');\r\n Array.from(entries).forEach((entry) => {\r\n const group = this.querySelectorDirectChild(entry, 'group');\r\n const groupText = group != null && !this.isNullOrWhitespace(group.textContent) ?\r\n group.textContent.split('.').join('/') : null;\r\n this.processFolder(result, groupText);\r\n\r\n const title = this.querySelectorDirectChild(entry, 'title');\r\n const username = this.querySelectorDirectChild(entry, 'username');\r\n const email = this.querySelectorDirectChild(entry, 'email');\r\n const password = this.querySelectorDirectChild(entry, 'password');\r\n const url = this.querySelectorDirectChild(entry, 'url');\r\n const notes = this.querySelectorDirectChild(entry, 'notes');\r\n const cipher = this.initLoginCipher();\r\n cipher.name = title != null ? this.getValueOrDefault(title.textContent, '--') : '--';\r\n cipher.notes = notes != null ?\r\n this.getValueOrDefault(notes.textContent, '').split(notesDelimiter).join('\\n') : null;\r\n cipher.login.username = username != null ? this.getValueOrDefault(username.textContent) : null;\r\n cipher.login.password = password != null ? this.getValueOrDefault(password.textContent) : null;\r\n cipher.login.uris = url != null ? this.makeUriArray(url.textContent) : null;\r\n\r\n if (this.isNullOrWhitespace(cipher.login.username) && email != null) {\r\n cipher.login.username = this.getValueOrDefault(email.textContent);\r\n } else if (email != null && !this.isNullOrWhitespace(email.textContent)) {\r\n cipher.notes = this.isNullOrWhitespace(cipher.notes) ? 'Email: ' + email.textContent\r\n : (cipher.notes + '\\n' + 'Email: ' + email.textContent);\r\n }\r\n\r\n this.cleanupCipher(cipher);\r\n result.ciphers.push(cipher);\r\n });\r\n\r\n if (this.organization) {\r\n this.moveFoldersToCollections(result);\r\n }\r\n\r\n result.success = true;\r\n return result;\r\n }\r\n}\r\n","import { BaseImporter } from './baseImporter';\nimport { Importer } from './importer';\n\nimport { ImportResult } from '../models/domain/importResult';\n\nexport class PasswordDragonXmlImporter extends BaseImporter implements Importer {\n parse(data: string): ImportResult {\n const result = new ImportResult();\n const doc = this.parseXml(data);\n if (doc == null) {\n result.success = false;\n return result;\n }\n\n const records = doc.querySelectorAll('PasswordManager > record');\n Array.from(records).forEach((record) => {\n const category = this.querySelectorDirectChild(record, 'Category');\n const categoryText = category != null && !this.isNullOrWhitespace(category.textContent) &&\n category.textContent !== 'Unfiled' ? category.textContent : null;\n this.processFolder(result, categoryText);\n\n const accountName = this.querySelectorDirectChild(record, 'Account-Name');\n const userId = this.querySelectorDirectChild(record, 'User-Id');\n const password = this.querySelectorDirectChild(record, 'Password');\n const url = this.querySelectorDirectChild(record, 'URL');\n const notes = this.querySelectorDirectChild(record, 'Notes');\n const cipher = this.initLoginCipher();\n cipher.name = accountName != null ? this.getValueOrDefault(accountName.textContent, '--') : '--';\n cipher.notes = notes != null ? this.getValueOrDefault(notes.textContent) : '';\n cipher.login.username = userId != null ? this.getValueOrDefault(userId.textContent) : null;\n cipher.login.password = password != null ? this.getValueOrDefault(password.textContent) : null;\n cipher.login.uris = url != null ? this.makeUriArray(url.textContent) : null;\n\n const attributes: string[] = [];\n for (let i = 1; i <= 10; i++) {\n attributes.push('Attribute-' + i);\n }\n\n this.querySelectorAllDirectChild(record, attributes.join(',')).forEach((attr) => {\n if (this.isNullOrWhitespace(attr.textContent) || attr.textContent === 'null') {\n return;\n }\n this.processKvp(cipher, attr.tagName, attr.textContent);\n });\n\n this.cleanupCipher(cipher);\n result.ciphers.push(cipher);\n });\n\n if (this.organization) {\n this.moveFoldersToCollections(result);\n }\n\n result.success = true;\n return result;\n }\n}\n","import { BaseImporter } from './baseImporter';\r\nimport { Importer } from './importer';\r\n\r\nimport { ImportResult } from '../models/domain/importResult';\r\n\r\nimport { CardView } from '../models/view/cardView';\r\n\r\nimport { CipherType } from '../enums/cipherType';\r\n\r\nexport class PasswordBossJsonImporter extends BaseImporter implements Importer {\r\n parse(data: string): ImportResult {\r\n const result = new ImportResult();\r\n const results = JSON.parse(data);\r\n if (results == null) {\r\n result.success = false;\r\n return result;\r\n }\r\n\r\n results.forEach((value: any) => {\r\n const cipher = this.initLoginCipher();\r\n cipher.name = this.getValueOrDefault(value.name, '--');\r\n cipher.login.uris = this.makeUriArray(value.login_url);\r\n\r\n if (value.identifiers == null) {\r\n return;\r\n }\r\n\r\n if (!this.isNullOrWhitespace(value.identifiers.notes)) {\r\n cipher.notes = value.identifiers.notes.split('\\\\r\\\\n').join('\\n').split('\\\\n').join('\\n');\r\n }\r\n\r\n if (value.type === 'CreditCard') {\r\n cipher.card = new CardView();\r\n cipher.type = CipherType.Card;\r\n }\r\n\r\n for (const property in value.identifiers) {\r\n if (!value.identifiers.hasOwnProperty(property)) {\r\n continue;\r\n }\r\n const valObj = value.identifiers[property];\r\n const val = valObj != null ? valObj.toString() : null;\r\n if (this.isNullOrWhitespace(val) || property === 'notes' || property === 'ignoreItemInSecurityScore') {\r\n continue;\r\n }\r\n\r\n if (cipher.type === CipherType.Card) {\r\n if (property === 'cardNumber') {\r\n cipher.card.number = val;\r\n cipher.card.brand = this.getCardBrand(val);\r\n continue;\r\n } else if (property === 'nameOnCard') {\r\n cipher.card.cardholderName = val;\r\n continue;\r\n } else if (property === 'security_code') {\r\n cipher.card.code = val;\r\n continue;\r\n } else if (property === 'expires') {\r\n try {\r\n const expDate = new Date(val);\r\n cipher.card.expYear = expDate.getFullYear().toString();\r\n cipher.card.expMonth = (expDate.getMonth() + 1).toString();\r\n } catch { }\r\n continue;\r\n } else if (property === 'cardType') {\r\n continue;\r\n }\r\n } else {\r\n if (property === 'username') {\r\n cipher.login.username = val;\r\n continue;\r\n } else if (property === 'password') {\r\n cipher.login.password = val;\r\n continue;\r\n } else if ((cipher.login.uris == null || cipher.login.uris.length === 0) &&\r\n this.uriFieldNames.indexOf(property) > -1) {\r\n cipher.login.uris = this.makeUriArray(val);\r\n continue;\r\n }\r\n }\r\n\r\n this.processKvp(cipher, property, val);\r\n }\r\n\r\n this.convertToNoteIfNeeded(cipher);\r\n this.cleanupCipher(cipher);\r\n result.ciphers.push(cipher);\r\n });\r\n\r\n result.success = true;\r\n return result;\r\n }\r\n}\r\n","import { BaseImporter } from './baseImporter';\r\nimport { Importer } from './importer';\r\n\r\nimport { ImportResult } from '../models/domain/importResult';\r\n\r\nexport class PasswordAgentCsvImporter extends BaseImporter implements Importer {\r\n parse(data: string): ImportResult {\r\n const result = new ImportResult();\r\n const results = this.parseCsv(data, false);\r\n if (results == null) {\r\n result.success = false;\r\n return result;\r\n }\r\n\r\n results.forEach((value) => {\r\n if (value.length < 9) {\r\n return;\r\n }\r\n const folder = this.getValueOrDefault(value[8], '(None)');\r\n const folderName = folder !== '(None)' ? folder.split('\\\\').join('/') : null;\r\n this.processFolder(result, folderName);\r\n const cipher = this.initLoginCipher();\r\n cipher.notes = this.getValueOrDefault(value[3]);\r\n cipher.name = this.getValueOrDefault(value[0], '--');\r\n cipher.login.username = this.getValueOrDefault(value[1]);\r\n cipher.login.password = this.getValueOrDefault(value[2]);\r\n cipher.login.uris = this.makeUriArray(value[4]);\r\n this.convertToNoteIfNeeded(cipher);\r\n this.cleanupCipher(cipher);\r\n result.ciphers.push(cipher);\r\n });\r\n\r\n if (this.organization) {\r\n this.moveFoldersToCollections(result);\r\n }\r\n\r\n result.success = true;\r\n return result;\r\n }\r\n}\r\n","import { BaseImporter } from './baseImporter';\r\nimport { Importer } from './importer';\r\n\r\nimport { ImportResult } from '../models/domain/importResult';\r\n\r\nexport class PassKeepCsvImporter extends BaseImporter implements Importer {\r\n parse(data: string): ImportResult {\r\n const result = new ImportResult();\r\n const results = this.parseCsv(data, true);\r\n if (results == null) {\r\n result.success = false;\r\n return result;\r\n }\r\n\r\n results.forEach((value) => {\r\n this.processFolder(result, this.getValue('category', value));\r\n const cipher = this.initLoginCipher();\r\n cipher.notes = this.getValue('description', value);\r\n cipher.name = this.getValueOrDefault(this.getValue('title', value), '--');\r\n cipher.login.username = this.getValue('username', value);\r\n cipher.login.password = this.getValue('password', value);\r\n cipher.login.uris = this.makeUriArray(this.getValue('site', value));\r\n this.processKvp(cipher, 'Password 2', this.getValue('password2', value));\r\n this.cleanupCipher(cipher);\r\n result.ciphers.push(cipher);\r\n });\r\n\r\n if (this.organization) {\r\n this.moveFoldersToCollections(result);\r\n }\r\n\r\n result.success = true;\r\n return result;\r\n }\r\n\r\n private getValue(key: string, value: any) {\r\n return this.getValueOrDefault(value[key], this.getValueOrDefault(value[(' ' + key)]));\r\n }\r\n}\r\n","import { BaseImporter } from './baseImporter';\nimport { Importer } from './importer';\n\nimport { ImportResult } from '../models/domain/importResult';\n\nimport { CollectionView } from '../models/view/collectionView';\nimport { FolderView } from '../models/view/folderView';\n\nexport class PadlockCsvImporter extends BaseImporter implements Importer {\n parse(data: string): ImportResult {\n const result = new ImportResult();\n const results = this.parseCsv(data, false);\n if (results == null) {\n result.success = false;\n return result;\n }\n\n let headers: string[] = null;\n results.forEach((value) => {\n if (headers == null) {\n headers = value.map((v: string) => v);\n return;\n }\n\n if (value.length < 2 || value.length !== headers.length) {\n return;\n }\n\n if (!this.isNullOrWhitespace(value[1])) {\n if (this.organization) {\n const tags = (value[1] as string).split(',');\n tags.forEach((tag) => {\n tag = tag.trim();\n let addCollection = true;\n let collectionIndex = result.collections.length;\n\n for (let i = 0; i < result.collections.length; i++) {\n if (result.collections[i].name === tag) {\n addCollection = false;\n collectionIndex = i;\n break;\n }\n }\n\n if (addCollection) {\n const collection = new CollectionView();\n collection.name = tag;\n result.collections.push(collection);\n }\n\n result.collectionRelationships.push([result.ciphers.length, collectionIndex]);\n });\n } else {\n const tags = (value[1] as string).split(',');\n const tag = tags.length > 0 ? tags[0].trim() : null;\n this.processFolder(result, tag);\n }\n }\n\n const cipher = this.initLoginCipher();\n cipher.name = this.getValueOrDefault(value[0], '--');\n\n for (let i = 2; i < value.length; i++) {\n const header = headers[i].trim().toLowerCase();\n if (this.isNullOrWhitespace(value[i]) || this.isNullOrWhitespace(header)) {\n continue;\n }\n\n if (this.usernameFieldNames.indexOf(header) > -1) {\n cipher.login.username = value[i];\n } else if (this.passwordFieldNames.indexOf(header) > -1) {\n cipher.login.password = value[i];\n } else if (this.uriFieldNames.indexOf(header) > -1) {\n cipher.login.uris = this.makeUriArray(value[i]);\n } else {\n this.processKvp(cipher, headers[i], value[i]);\n }\n }\n\n this.cleanupCipher(cipher);\n result.ciphers.push(cipher);\n });\n\n result.success = true;\n return result;\n }\n}\n","export class View {\r\n}\n","export { AttachmentView } from './attachmentView';\r\nexport { CardView } from './cardView';\r\nexport { CipherView } from './cipherView';\r\nexport { FieldView } from './fieldView';\r\nexport { IdentityView } from './identityView';\r\nexport { LoginUriView } from './loginUriView';\r\nexport { LoginView } from './loginView';\r\nexport { SecureNoteView } from './secureNoteView';\r\nexport { View } from './view';\r\n","import { BaseImporter } from './baseImporter';\r\nimport { Importer } from './importer';\r\n\r\nimport { ImportResult } from '../models/domain/importResult';\r\n\r\nimport { CipherType } from '../enums/cipherType';\r\nimport { CardView } from '../models/view';\r\n\r\nconst IgnoredProperties = ['ainfo', 'autosubmit', 'notesPlain', 'ps', 'scope', 'tags', 'title', 'uuid'];\r\n\r\nexport class OnePasswordWinCsvImporter extends BaseImporter implements Importer {\r\n parse(data: string): ImportResult {\r\n const result = new ImportResult();\r\n const results = this.parseCsv(data, true);\r\n if (results == null) {\r\n result.success = false;\r\n return result;\r\n }\r\n\r\n results.forEach((value) => {\r\n if (this.isNullOrWhitespace(value.title)) {\r\n return;\r\n }\r\n\r\n const cipher = this.initLoginCipher();\r\n cipher.name = this.getValueOrDefault(value.title, '--');\r\n cipher.notes = this.getValueOrDefault(value.notesPlain, '') + '\\n';\r\n\r\n if (!this.isNullOrWhitespace(value.number) && !this.isNullOrWhitespace(value['expiry date'])) {\r\n cipher.type = CipherType.Card;\r\n cipher.card = new CardView();\r\n }\r\n\r\n let altUsername: string = null;\r\n for (const property in value) {\r\n if (!value.hasOwnProperty(property) || this.isNullOrWhitespace(value[property])) {\r\n continue;\r\n }\r\n\r\n if (cipher.type === CipherType.Login) {\r\n if (this.isNullOrWhitespace(cipher.login.password) && property === 'password') {\r\n cipher.login.password = value[property];\r\n continue;\r\n } else if (this.isNullOrWhitespace(cipher.login.username) && property === 'username') {\r\n cipher.login.username = value[property];\r\n continue;\r\n } else if ((cipher.login.uris == null || cipher.login.uri.length === 0) && property === 'urls') {\r\n const urls = value[property].split(this.newLineRegex);\r\n cipher.login.uris = this.makeUriArray(urls);\r\n continue;\r\n }\r\n } else if (cipher.type === CipherType.Card) {\r\n if (this.isNullOrWhitespace(cipher.card.number) && property === 'number') {\r\n cipher.card.number = value[property];\r\n cipher.card.brand = this.getCardBrand(value.number);\r\n continue;\r\n } else if (this.isNullOrWhitespace(cipher.card.code) && property === 'verification number') {\r\n cipher.card.code = value[property];\r\n continue;\r\n } else if (this.isNullOrWhitespace(cipher.card.cardholderName) && property === 'cardholder name') {\r\n cipher.card.cardholderName = value[property];\r\n continue;\r\n } else if (this.isNullOrWhitespace(cipher.card.expiration) && property === 'expiry date' &&\r\n value[property].length === 6) {\r\n cipher.card.expMonth = (value[property] as string).substr(4, 2);\r\n if (cipher.card.expMonth[0] === '0') {\r\n cipher.card.expMonth = cipher.card.expMonth.substr(1, 1);\r\n }\r\n cipher.card.expYear = (value[property] as string).substr(0, 4);\r\n continue;\r\n } else if (property === 'type') {\r\n // Skip since brand was determined from number above\r\n continue;\r\n }\r\n }\r\n\r\n if (IgnoredProperties.indexOf(property) === -1 && !property.startsWith('section:')) {\r\n if (altUsername == null && property === 'email') {\r\n altUsername = value[property];\r\n }\r\n this.processKvp(cipher, property, value[property]);\r\n }\r\n }\r\n\r\n if (cipher.type === CipherType.Login && !this.isNullOrWhitespace(altUsername) &&\r\n this.isNullOrWhitespace(cipher.login.username) && altUsername.indexOf('://') === -1) {\r\n cipher.login.username = altUsername;\r\n }\r\n\r\n this.convertToNoteIfNeeded(cipher);\r\n this.cleanupCipher(cipher);\r\n result.ciphers.push(cipher);\r\n });\r\n\r\n result.success = true;\r\n return result;\r\n }\r\n}\r\n","import { BaseImporter } from './baseImporter';\nimport { Importer } from './importer';\n\nimport { ImportResult } from '../models/domain/importResult';\n\nimport { CardView } from '../models/view/cardView';\nimport { CipherView } from '../models/view/cipherView';\nimport { SecureNoteView } from '../models/view/secureNoteView';\n\nimport { CipherType } from '../enums/cipherType';\nimport { SecureNoteType } from '../enums/secureNoteType';\n\nexport class OnePassword1PifImporter extends BaseImporter implements Importer {\n result = new ImportResult();\n\n parse(data: string): ImportResult {\n data.split(this.newLineRegex).forEach((line) => {\n if (this.isNullOrWhitespace(line) || line[0] !== '{') {\n return;\n }\n const item = JSON.parse(line);\n const cipher = this.initLoginCipher();\n cipher.favorite = item.openContents && item.openContents.faveIndex ? true : false;\n cipher.name = this.getValueOrDefault(item.title, '--');\n\n if (item.typeName === 'securenotes.SecureNote') {\n cipher.type = CipherType.SecureNote;\n cipher.secureNote = new SecureNoteView();\n cipher.secureNote.type = SecureNoteType.Generic;\n } else if (item.typeName === 'wallet.financial.CreditCard') {\n cipher.type = CipherType.Card;\n cipher.card = new CardView();\n } else {\n cipher.login.uris = this.makeUriArray(item.location);\n }\n\n if (item.secureContents != null) {\n if (!this.isNullOrWhitespace(item.secureContents.notesPlain)) {\n cipher.notes = item.secureContents.notesPlain.split(this.newLineRegex).join('\\n') + '\\n';\n }\n if (item.secureContents.fields != null) {\n this.parseFields(item.secureContents.fields, cipher, 'designation', 'value', 'name');\n }\n if (item.secureContents.sections != null) {\n item.secureContents.sections.forEach((section: any) => {\n if (section.fields != null) {\n this.parseFields(section.fields, cipher, 'n', 'v', 't');\n }\n });\n }\n }\n\n this.cleanupCipher(cipher);\n this.result.ciphers.push(cipher);\n });\n\n this.result.success = true;\n return this.result;\n }\n\n private parseFields(fields: any[], cipher: CipherView, designationKey: string, valueKey: string, nameKey: string) {\n fields.forEach((field: any) => {\n if (field[valueKey] == null || field[valueKey].toString().trim() === '') {\n return;\n }\n\n const fieldValue = field[valueKey].toString();\n const fieldDesignation = field[designationKey] != null ? field[designationKey].toString() : null;\n\n if (cipher.type === CipherType.Login) {\n if (this.isNullOrWhitespace(cipher.login.username) && fieldDesignation === 'username') {\n cipher.login.username = fieldValue;\n return;\n } else if (this.isNullOrWhitespace(cipher.login.password) && fieldDesignation === 'password') {\n cipher.login.password = fieldValue;\n return;\n } else if (this.isNullOrWhitespace(cipher.login.totp) && fieldDesignation != null &&\n fieldDesignation.startsWith('TOTP_')) {\n cipher.login.totp = fieldValue;\n return;\n }\n } else if (cipher.type === CipherType.Card) {\n if (this.isNullOrWhitespace(cipher.card.number) && fieldDesignation === 'ccnum') {\n cipher.card.number = fieldValue;\n cipher.card.brand = this.getCardBrand(fieldValue);\n return;\n } else if (this.isNullOrWhitespace(cipher.card.code) && fieldDesignation === 'cvv') {\n cipher.card.code = fieldValue;\n return;\n } else if (this.isNullOrWhitespace(cipher.card.cardholderName) && fieldDesignation === 'cardholder') {\n cipher.card.cardholderName = fieldValue;\n return;\n } else if (this.isNullOrWhitespace(cipher.card.expiration) && fieldDesignation === 'expiry' &&\n fieldValue.length === 6) {\n cipher.card.expMonth = (fieldValue as string).substr(4, 2);\n if (cipher.card.expMonth[0] === '0') {\n cipher.card.expMonth = cipher.card.expMonth.substr(1, 1);\n }\n cipher.card.expYear = (fieldValue as string).substr(0, 4);\n return;\n } else if (fieldDesignation === 'type') {\n // Skip since brand was determined from number above\n return;\n }\n }\n\n const fieldName = this.isNullOrWhitespace(field[nameKey]) ? 'no_name' : field[nameKey];\n this.processKvp(cipher, fieldName, fieldValue);\n });\n }\n}\n","import { BaseImporter } from './baseImporter';\nimport { Importer } from './importer';\n\nimport { ImportResult } from '../models/domain/importResult';\n\nimport { CipherType } from '../enums/cipherType';\nimport { SecureNoteType } from '../enums/secureNoteType';\n\nimport { SecureNoteView } from '../models/view/secureNoteView';\n\nexport class MSecureCsvImporter extends BaseImporter implements Importer {\n parse(data: string): ImportResult {\n const result = new ImportResult();\n const results = this.parseCsv(data, false);\n if (results == null) {\n result.success = false;\n return result;\n }\n\n results.forEach((value) => {\n if (value.length < 3) {\n return;\n }\n\n const folderName = this.getValueOrDefault(value[0], 'Unassigned') !== 'Unassigned' ? value[0] : null;\n this.processFolder(result, folderName);\n\n const cipher = this.initLoginCipher();\n cipher.name = this.getValueOrDefault(value[2], '--');\n\n if (value[1] === 'Web Logins') {\n cipher.login.uris = this.makeUriArray(value[4]);\n cipher.login.username = this.getValueOrDefault(value[5]);\n cipher.login.password = this.getValueOrDefault(value[6]);\n cipher.notes = !this.isNullOrWhitespace(value[3]) ? value[3].split('\\\\n').join('\\n') : null;\n } else if (value.length > 3) {\n cipher.type = CipherType.SecureNote;\n cipher.secureNote = new SecureNoteView();\n cipher.secureNote.type = SecureNoteType.Generic;\n for (let i = 3; i < value.length; i++) {\n if (!this.isNullOrWhitespace(value[i])) {\n cipher.notes += (value[i] + '\\n');\n }\n }\n }\n\n if (!this.isNullOrWhitespace(value[1]) && cipher.type !== CipherType.Login) {\n cipher.name = value[1] + ': ' + cipher.name;\n }\n\n this.cleanupCipher(cipher);\n result.ciphers.push(cipher);\n });\n\n if (this.organization) {\n this.moveFoldersToCollections(result);\n }\n\n result.success = true;\n return result;\n }\n}\n","import { BaseImporter } from './baseImporter';\nimport { Importer } from './importer';\n\nimport { ImportResult } from '../models/domain/importResult';\n\nexport class MeldiumCsvImporter extends BaseImporter implements Importer {\n parse(data: string): ImportResult {\n const result = new ImportResult();\n const results = this.parseCsv(data, true);\n if (results == null) {\n result.success = false;\n return result;\n }\n\n results.forEach((value) => {\n const cipher = this.initLoginCipher();\n cipher.name = this.getValueOrDefault(value.DisplayName, '--');\n cipher.notes = this.getValueOrDefault(value.Notes);\n cipher.login.username = this.getValueOrDefault(value.UserName);\n cipher.login.password = this.getValueOrDefault(value.Password);\n cipher.login.uris = this.makeUriArray(value.Url);\n this.cleanupCipher(cipher);\n result.ciphers.push(cipher);\n });\n\n result.success = true;\n return result;\n }\n}\n","import { BaseImporter } from './baseImporter';\r\nimport { Importer } from './importer';\r\n\r\nimport { ImportResult } from '../models/domain/importResult';\r\n\r\nimport { CardView } from '../models/view/cardView';\r\nimport { CipherView } from '../models/view/cipherView';\r\nimport { FolderView } from '../models/view/folderView';\r\nimport { IdentityView } from '../models/view/identityView';\r\nimport { LoginView } from '../models/view/loginView';\r\nimport { SecureNoteView } from '../models/view/secureNoteView';\r\n\r\nimport { CipherType } from '../enums/cipherType';\r\nimport { SecureNoteType } from '../enums/secureNoteType';\r\n\r\nexport class LastPassCsvImporter extends BaseImporter implements Importer {\r\n parse(data: string): ImportResult {\r\n const result = new ImportResult();\r\n const results = this.parseCsv(data, true);\r\n if (results == null) {\r\n result.success = false;\r\n return result;\r\n }\r\n\r\n results.forEach((value, index) => {\r\n const cipherIndex = result.ciphers.length;\r\n let folderIndex = result.folders.length;\r\n const hasFolder = this.getValueOrDefault(value.grouping, '(none)') !== '(none)';\r\n let addFolder = hasFolder;\r\n\r\n if (hasFolder) {\r\n for (let i = 0; i < result.folders.length; i++) {\r\n if (result.folders[i].name === value.grouping) {\r\n addFolder = false;\r\n folderIndex = i;\r\n break;\r\n }\r\n }\r\n }\r\n\r\n const cipher = this.buildBaseCipher(value);\r\n if (cipher.type === CipherType.Login) {\r\n cipher.notes = this.getValueOrDefault(value.extra);\r\n cipher.login = new LoginView();\r\n cipher.login.uris = this.makeUriArray(value.url);\r\n cipher.login.username = this.getValueOrDefault(value.username);\r\n cipher.login.password = this.getValueOrDefault(value.password);\r\n } else if (cipher.type === CipherType.SecureNote) {\r\n this.parseSecureNote(value, cipher);\r\n } else if (cipher.type === CipherType.Card) {\r\n cipher.card = this.parseCard(value);\r\n cipher.notes = this.getValueOrDefault(value.notes);\r\n } else if (cipher.type === CipherType.Identity) {\r\n cipher.identity = this.parseIdentity(value);\r\n cipher.notes = this.getValueOrDefault(value.notes);\r\n if (!this.isNullOrWhitespace(value.ccnum)) {\r\n // there is a card on this identity too\r\n const cardCipher = this.buildBaseCipher(value);\r\n cardCipher.identity = null;\r\n cardCipher.type = CipherType.Card;\r\n cardCipher.card = this.parseCard(value);\r\n result.ciphers.push(cardCipher);\r\n }\r\n }\r\n\r\n result.ciphers.push(cipher);\r\n\r\n if (addFolder) {\r\n const f = new FolderView();\r\n f.name = value.grouping;\r\n result.folders.push(f);\r\n }\r\n if (hasFolder) {\r\n result.folderRelationships.push([cipherIndex, folderIndex]);\r\n }\r\n });\r\n\r\n if (this.organization) {\r\n this.moveFoldersToCollections(result);\r\n }\r\n\r\n result.success = true;\r\n return result;\r\n }\r\n\r\n private buildBaseCipher(value: any) {\r\n const cipher = new CipherView();\r\n if (value.hasOwnProperty('profilename') && value.hasOwnProperty('profilelanguage')) {\r\n // form fill\r\n cipher.favorite = false;\r\n cipher.name = this.getValueOrDefault(value.profilename, '--');\r\n cipher.type = CipherType.Card;\r\n\r\n if (!this.isNullOrWhitespace(value.title) || !this.isNullOrWhitespace(value.firstname) ||\r\n !this.isNullOrWhitespace(value.lastname) || !this.isNullOrWhitespace(value.address1) ||\r\n !this.isNullOrWhitespace(value.phone) || !this.isNullOrWhitespace(value.username) ||\r\n !this.isNullOrWhitespace(value.email)) {\r\n cipher.type = CipherType.Identity;\r\n }\r\n } else {\r\n // site or secure note\r\n cipher.favorite = !this.organization && this.getValueOrDefault(value.fav, '0') === '1';\r\n cipher.name = this.getValueOrDefault(value.name, '--');\r\n cipher.type = value.url === 'http://sn' ? CipherType.SecureNote : CipherType.Login;\r\n }\r\n return cipher;\r\n }\r\n\r\n private parseCard(value: any): CardView {\r\n const card = new CardView();\r\n card.cardholderName = this.getValueOrDefault(value.ccname);\r\n card.number = this.getValueOrDefault(value.ccnum);\r\n card.code = this.getValueOrDefault(value.cccsc);\r\n card.brand = this.getCardBrand(value.ccnum);\r\n\r\n if (!this.isNullOrWhitespace(value.ccexp) && value.ccexp.indexOf('-') > -1) {\r\n const ccexpParts = (value.ccexp as string).split('-');\r\n if (ccexpParts.length > 1) {\r\n card.expYear = ccexpParts[0];\r\n card.expMonth = ccexpParts[1];\r\n if (card.expMonth.length === 2 && card.expMonth[0] === '0') {\r\n card.expMonth = card.expMonth[1];\r\n }\r\n }\r\n }\r\n\r\n return card;\r\n }\r\n\r\n private parseIdentity(value: any): IdentityView {\r\n const identity = new IdentityView();\r\n identity.title = this.getValueOrDefault(value.title);\r\n identity.firstName = this.getValueOrDefault(value.firstname);\r\n identity.middleName = this.getValueOrDefault(value.middlename);\r\n identity.lastName = this.getValueOrDefault(value.lastname);\r\n identity.username = this.getValueOrDefault(value.username);\r\n identity.company = this.getValueOrDefault(value.company);\r\n identity.ssn = this.getValueOrDefault(value.ssn);\r\n identity.address1 = this.getValueOrDefault(value.address1);\r\n identity.address2 = this.getValueOrDefault(value.address2);\r\n identity.address3 = this.getValueOrDefault(value.address3);\r\n identity.city = this.getValueOrDefault(value.city);\r\n identity.state = this.getValueOrDefault(value.state);\r\n identity.postalCode = this.getValueOrDefault(value.zip);\r\n identity.country = this.getValueOrDefault(value.country);\r\n identity.email = this.getValueOrDefault(value.email);\r\n identity.phone = this.getValueOrDefault(value.phone);\r\n\r\n if (!this.isNullOrWhitespace(identity.title)) {\r\n identity.title = identity.title.charAt(0).toUpperCase() + identity.title.slice(1);\r\n }\r\n\r\n return identity;\r\n }\r\n\r\n private parseSecureNote(value: any, cipher: CipherView) {\r\n const extraParts = this.splitNewLine(value.extra);\r\n let processedNote = false;\r\n\r\n if (extraParts.length) {\r\n const typeParts = extraParts[0].split(':');\r\n if (typeParts.length > 1 && typeParts[0] === 'NoteType' &&\r\n (typeParts[1] === 'Credit Card' || typeParts[1] === 'Address')) {\r\n if (typeParts[1] === 'Credit Card') {\r\n const mappedData = this.parseSecureNoteMapping(extraParts, {\r\n 'Number': 'number',\r\n 'Name on Card': 'cardholderName',\r\n 'Security Code': 'code',\r\n });\r\n cipher.type = CipherType.Card;\r\n cipher.card = mappedData[0];\r\n cipher.notes = mappedData[1];\r\n } else if (typeParts[1] === 'Address') {\r\n const mappedData = this.parseSecureNoteMapping(extraParts, {\r\n 'Title': 'title',\r\n 'First Name': 'firstName',\r\n 'Last Name': 'lastName',\r\n 'Middle Name': 'middleName',\r\n 'Company': 'company',\r\n 'Address 1': 'address1',\r\n 'Address 2': 'address2',\r\n 'Address 3': 'address3',\r\n 'City / Town': 'city',\r\n 'State': 'state',\r\n 'Zip / Postal Code': 'postalCode',\r\n 'Country': 'country',\r\n 'Email Address': 'email',\r\n 'Username': 'username',\r\n });\r\n cipher.type = CipherType.Identity;\r\n cipher.identity = mappedData[0];\r\n cipher.notes = mappedData[1];\r\n }\r\n processedNote = true;\r\n }\r\n }\r\n\r\n if (!processedNote) {\r\n cipher.secureNote = new SecureNoteView();\r\n cipher.secureNote.type = SecureNoteType.Generic;\r\n cipher.notes = this.getValueOrDefault(value.extra);\r\n }\r\n }\r\n\r\n private parseSecureNoteMapping(extraParts: string[], map: any): [T, string] {\r\n let notes: string = null;\r\n const dataObj: any = {};\r\n\r\n extraParts.forEach((extraPart) => {\r\n const fieldParts = extraPart.split(':');\r\n if (fieldParts.length < 1 || this.isNullOrWhitespace(fieldParts[0]) ||\r\n this.isNullOrWhitespace(fieldParts[1]) || fieldParts[0] === 'NoteType') {\r\n return;\r\n }\r\n\r\n if (fieldParts[0] === 'Notes') {\r\n if (!this.isNullOrWhitespace(notes)) {\r\n notes += ('\\n' + fieldParts[1]);\r\n } else {\r\n notes = fieldParts[1];\r\n }\r\n } else if (map.hasOwnProperty(fieldParts[0])) {\r\n dataObj[map[fieldParts[0]]] = fieldParts[1];\r\n } else {\r\n if (!this.isNullOrWhitespace(notes)) {\r\n notes += '\\n';\r\n } else {\r\n notes = '';\r\n }\r\n\r\n notes += (fieldParts[0] + ': ' + fieldParts[1]);\r\n }\r\n });\r\n\r\n return [dataObj as T, notes];\r\n }\r\n}\r\n","import { BaseImporter } from './baseImporter';\nimport { Importer } from './importer';\n\nimport { ImportResult } from '../models/domain/importResult';\n\nimport { FolderView } from '../models/view/folderView';\n\nexport class KeeperCsvImporter extends BaseImporter implements Importer {\n parse(data: string): ImportResult {\n const result = new ImportResult();\n const results = this.parseCsv(data, false);\n if (results == null) {\n result.success = false;\n return result;\n }\n\n results.forEach((value) => {\n if (value.length < 6) {\n return;\n }\n\n this.processFolder(result, value[0]);\n const cipher = this.initLoginCipher();\n cipher.notes = this.getValueOrDefault(value[5]) + '\\n';\n cipher.name = this.getValueOrDefault(value[1], '--');\n cipher.login.username = this.getValueOrDefault(value[2]);\n cipher.login.password = this.getValueOrDefault(value[3]);\n cipher.login.uris = this.makeUriArray(value[4]);\n\n if (value.length > 7) {\n // we have some custom fields.\n for (let i = 7; i < value.length; i = i + 2) {\n this.processKvp(cipher, value[i], value[i + 1]);\n }\n }\n\n this.cleanupCipher(cipher);\n result.ciphers.push(cipher);\n });\n\n if (this.organization) {\n this.moveFoldersToCollections(result);\n }\n\n result.success = true;\n return result;\n }\n}\n","import { BaseImporter } from './baseImporter';\r\nimport { Importer } from './importer';\r\n\r\nimport { ImportResult } from '../models/domain/importResult';\r\n\r\nexport class KeePassXCsvImporter extends BaseImporter implements Importer {\r\n parse(data: string): ImportResult {\r\n const result = new ImportResult();\r\n const results = this.parseCsv(data, true);\r\n if (results == null) {\r\n result.success = false;\r\n return result;\r\n }\r\n\r\n results.forEach((value) => {\r\n if (this.isNullOrWhitespace(value.Title)) {\r\n return;\r\n }\r\n\r\n value.Group = !this.isNullOrWhitespace(value.Group) && value.Group.startsWith('Root/') ?\r\n value.Group.replace('Root/', '') : value.Group;\r\n const groupName = !this.isNullOrWhitespace(value.Group) ? value.Group : null;\r\n this.processFolder(result, groupName);\r\n\r\n const cipher = this.initLoginCipher();\r\n cipher.notes = this.getValueOrDefault(value.Notes);\r\n cipher.name = this.getValueOrDefault(value.Title, '--');\r\n cipher.login.username = this.getValueOrDefault(value.Username);\r\n cipher.login.password = this.getValueOrDefault(value.Password);\r\n cipher.login.uris = this.makeUriArray(value.URL);\r\n this.cleanupCipher(cipher);\r\n result.ciphers.push(cipher);\r\n });\r\n\r\n if (this.organization) {\r\n this.moveFoldersToCollections(result);\r\n }\r\n\r\n result.success = true;\r\n return result;\r\n }\r\n}\r\n","import { BaseImporter } from './baseImporter';\r\nimport { Importer } from './importer';\r\n\r\nimport { ImportResult } from '../models/domain/importResult';\r\n\r\nimport { FolderView } from '../models/view/folderView';\r\n\r\nexport class KeePass2XmlImporter extends BaseImporter implements Importer {\r\n result = new ImportResult();\r\n\r\n parse(data: string): ImportResult {\r\n const doc = this.parseXml(data);\r\n if (doc == null) {\r\n this.result.success = false;\r\n return this.result;\r\n }\r\n\r\n const rootGroup = doc.querySelector('KeePassFile > Root > Group');\r\n if (rootGroup == null) {\r\n this.result.errorMessage = 'Missing `KeePassFile > Root > Group` node.';\r\n this.result.success = false;\r\n return this.result;\r\n }\r\n\r\n this.traverse(rootGroup, true, '');\r\n\r\n if (this.organization) {\r\n this.moveFoldersToCollections(this.result);\r\n }\r\n\r\n this.result.success = true;\r\n return this.result;\r\n }\r\n\r\n traverse(node: Element, isRootNode: boolean, groupPrefixName: string) {\r\n const folderIndex = this.result.folders.length;\r\n let groupName = groupPrefixName;\r\n\r\n if (!isRootNode) {\r\n if (groupName !== '') {\r\n groupName += '/';\r\n }\r\n const nameEl = this.querySelectorDirectChild(node, 'Name');\r\n groupName += nameEl == null ? '-' : nameEl.textContent;\r\n const folder = new FolderView();\r\n folder.name = groupName;\r\n this.result.folders.push(folder);\r\n }\r\n\r\n this.querySelectorAllDirectChild(node, 'Entry').forEach((entry) => {\r\n const cipherIndex = this.result.ciphers.length;\r\n\r\n const cipher = this.initLoginCipher();\r\n this.querySelectorAllDirectChild(entry, 'String').forEach((entryString) => {\r\n const valueEl = this.querySelectorDirectChild(entryString, 'Value');\r\n const value = valueEl != null ? valueEl.textContent : null;\r\n if (this.isNullOrWhitespace(value)) {\r\n return;\r\n }\r\n const keyEl = this.querySelectorDirectChild(entryString, 'Key');\r\n const key = keyEl != null ? keyEl.textContent : null;\r\n\r\n if (key === 'URL') {\r\n cipher.login.uris = this.makeUriArray(value);\r\n } else if (key === 'UserName') {\r\n cipher.login.username = value;\r\n } else if (key === 'Password') {\r\n cipher.login.password = value;\r\n } else if (key === 'Title') {\r\n cipher.name = value;\r\n } else if (key === 'Notes') {\r\n cipher.notes += (value + '\\n');\r\n } else {\r\n this.processKvp(cipher, key, value);\r\n }\r\n });\r\n\r\n this.cleanupCipher(cipher);\r\n this.result.ciphers.push(cipher);\r\n\r\n if (!isRootNode) {\r\n this.result.folderRelationships.push([cipherIndex, folderIndex]);\r\n }\r\n });\r\n\r\n this.querySelectorAllDirectChild(node, 'Group').forEach((group) => {\r\n this.traverse(group, false, groupName);\r\n });\r\n }\r\n}\r\n","import { BaseImporter } from './baseImporter';\r\nimport { Importer } from './importer';\r\n\r\nimport { ImportResult } from '../models/domain/importResult';\r\n\r\nexport class GnomeJsonImporter extends BaseImporter implements Importer {\r\n parse(data: string): ImportResult {\r\n const result = new ImportResult();\r\n const results = JSON.parse(data);\r\n if (results == null || Object.keys(results).length === 0) {\r\n result.success = false;\r\n return result;\r\n }\r\n\r\n for (const keyRing in results) {\r\n if (!results.hasOwnProperty(keyRing) || this.isNullOrWhitespace(keyRing) ||\r\n results[keyRing].length === 0) {\r\n continue;\r\n }\r\n\r\n results[keyRing].forEach((value: any) => {\r\n if (this.isNullOrWhitespace(value.display_name) || value.display_name.indexOf('http') !== 0) {\r\n return;\r\n }\r\n\r\n this.processFolder(result, keyRing);\r\n const cipher = this.initLoginCipher();\r\n cipher.name = value.display_name.replace('http://', '').replace('https://', '');\r\n if (cipher.name.length > 30) {\r\n cipher.name = cipher.name.substring(0, 30);\r\n }\r\n cipher.login.password = this.getValueOrDefault(value.secret);\r\n cipher.login.uris = this.makeUriArray(value.display_name);\r\n\r\n if (value.attributes != null) {\r\n cipher.login.username = value.attributes != null ?\r\n this.getValueOrDefault(value.attributes.username_value) : null;\r\n for (const attr in value.attributes) {\r\n if (!value.attributes.hasOwnProperty(attr) || attr === 'username_value' ||\r\n attr === 'xdg:schema') {\r\n continue;\r\n }\r\n this.processKvp(cipher, attr, value.attributes[attr]);\r\n }\r\n }\r\n\r\n this.convertToNoteIfNeeded(cipher);\r\n this.cleanupCipher(cipher);\r\n result.ciphers.push(cipher);\r\n });\r\n }\r\n\r\n if (this.organization) {\r\n this.moveFoldersToCollections(result);\r\n }\r\n\r\n result.success = true;\r\n return result;\r\n }\r\n}\r\n","import { BaseImporter } from './baseImporter';\nimport { Importer } from './importer';\n\nimport { ImportResult } from '../models/domain/importResult';\n\nexport class FirefoxCsvImporter extends BaseImporter implements Importer {\n parse(data: string): ImportResult {\n const result = new ImportResult();\n const results = this.parseCsv(data, true);\n if (results == null) {\n result.success = false;\n return result;\n }\n\n results.forEach((value) => {\n const cipher = this.initLoginCipher();\n cipher.name = this.getValueOrDefault(this.nameFromUrl(value.hostname), '--');\n cipher.login.username = this.getValueOrDefault(value.username);\n cipher.login.password = this.getValueOrDefault(value.password);\n cipher.login.uris = this.makeUriArray(value.hostname);\n this.cleanupCipher(cipher);\n result.ciphers.push(cipher);\n });\n\n result.success = true;\n return result;\n }\n}\n","import { BaseImporter } from './baseImporter';\nimport { Importer } from './importer';\n\nimport { ImportResult } from '../models/domain/importResult';\n\nimport { CipherType } from '../enums/cipherType';\nimport { SecureNoteType } from '../enums/secureNoteType';\n\nimport { CardView } from '../models/view/cardView';\nimport { SecureNoteView } from '../models/view/secureNoteView';\n\nexport class EnpassCsvImporter extends BaseImporter implements Importer {\n parse(data: string): ImportResult {\n const result = new ImportResult();\n const results = this.parseCsv(data, false);\n if (results == null) {\n result.success = false;\n return result;\n }\n\n let firstRow = true;\n results.forEach((value) => {\n if (value.length < 2 || (firstRow && value[0] === 'Title')) {\n firstRow = false;\n return;\n }\n\n const cipher = this.initLoginCipher();\n cipher.notes = this.getValueOrDefault(value[value.length - 1]);\n cipher.name = this.getValueOrDefault(value[0], '--');\n\n if (value.length === 2 || (value.indexOf('Username') < 0 && value.indexOf('Password') < 0 &&\n value.indexOf('Email') && value.indexOf('URL') < 0)) {\n cipher.type = CipherType.SecureNote;\n cipher.secureNote = new SecureNoteView();\n cipher.secureNote.type = SecureNoteType.Generic;\n }\n\n if (value.indexOf('Cardholder') > -1 && value.indexOf('Number') > -1 && value.indexOf('Expiry date') > -1) {\n cipher.type = CipherType.Card;\n cipher.card = new CardView();\n }\n\n if (value.length > 2 && (value.length % 2) === 0) {\n for (let i = 0; i < value.length - 2; i += 2) {\n const fieldValue: string = value[i + 2];\n if (this.isNullOrWhitespace(fieldValue)) {\n continue;\n }\n\n const fieldName: string = value[i + 1];\n const fieldNameLower = fieldName.toLowerCase();\n\n if (cipher.type === CipherType.Login) {\n if (fieldNameLower === 'url' && (cipher.login.uris == null || cipher.login.uris.length === 0)) {\n cipher.login.uris = this.makeUriArray(fieldValue);\n continue;\n } else if ((fieldNameLower === 'username' || fieldNameLower === 'email') &&\n this.isNullOrWhitespace(cipher.login.username)) {\n cipher.login.username = fieldValue;\n continue;\n } else if (fieldNameLower === 'password' && this.isNullOrWhitespace(cipher.login.password)) {\n cipher.login.password = fieldValue;\n continue;\n } else if (fieldNameLower === 'totp' && this.isNullOrWhitespace(cipher.login.totp)) {\n cipher.login.totp = fieldValue;\n continue;\n }\n } else if (cipher.type === CipherType.Card) {\n if (fieldNameLower === 'cardholder' && this.isNullOrWhitespace(cipher.card.cardholderName)) {\n cipher.card.cardholderName = fieldValue;\n continue;\n } else if (fieldNameLower === 'number' && this.isNullOrWhitespace(cipher.card.number)) {\n cipher.card.number = fieldValue;\n cipher.card.brand = this.getCardBrand(fieldValue);\n continue;\n } else if (fieldNameLower === 'cvc' && this.isNullOrWhitespace(cipher.card.code)) {\n cipher.card.code = fieldValue;\n continue;\n } else if (fieldNameLower === 'expiry date' && this.isNullOrWhitespace(cipher.card.expMonth) &&\n this.isNullOrWhitespace(cipher.card.expYear)) {\n const parts = fieldValue.split('/');\n if (parts.length === 2) {\n let month: string = null;\n let year: string = null;\n if (parts[0].length === 1 || parts[0].length === 2) {\n month = parts[0];\n if (month.length === 2 && month[0] === '0') {\n month = month.substr(1, 1);\n }\n }\n if (parts[1].length === 2 || parts[1].length === 4) {\n year = month.length === 2 ? '20' + parts[1] : parts[1];\n }\n if (month != null && year != null) {\n cipher.card.expMonth = month;\n cipher.card.expYear = year;\n continue;\n }\n }\n } else if (fieldNameLower === 'type') {\n // Skip since brand was determined from number above\n continue;\n }\n }\n\n this.processKvp(cipher, fieldName, fieldValue);\n }\n }\n\n this.cleanupCipher(cipher);\n result.ciphers.push(cipher);\n });\n\n result.success = true;\n return result;\n }\n}\n","import { BaseImporter } from './baseImporter';\nimport { Importer } from './importer';\n\nimport { ImportResult } from '../models/domain/importResult';\n\nexport class DashlaneCsvImporter extends BaseImporter implements Importer {\n parse(data: string): ImportResult {\n const result = new ImportResult();\n const results = this.parseCsv(data, false);\n if (results == null) {\n result.success = false;\n return result;\n }\n\n results.forEach((value) => {\n let skip = false;\n if (value.length < 2) {\n return;\n }\n\n const cipher = this.initLoginCipher();\n cipher.name = this.getValueOrDefault(value[0], '--');\n\n if (value.length === 2) {\n cipher.login.uris = this.makeUriArray(value[1]);\n } else if (value.length === 3) {\n cipher.login.uris = this.makeUriArray(value[1]);\n cipher.login.username = this.getValueOrDefault(value[2]);\n } else if (value.length === 4) {\n if (this.isNullOrWhitespace(value[2]) && this.isNullOrWhitespace(value[3])) {\n cipher.login.username = value[1];\n cipher.notes = value[2] + '\\n' + value[3];\n } else {\n cipher.login.username = value[2];\n cipher.notes = value[1] + '\\n' + value[3];\n }\n } else if (value.length === 5) {\n cipher.login.uris = this.makeUriArray(value[1]);\n cipher.login.username = this.getValueOrDefault(value[2]);\n cipher.login.password = this.getValueOrDefault(value[3]);\n cipher.notes = this.getValueOrDefault(value[4]);\n } else if (value.length === 6) {\n if (this.isNullOrWhitespace(value[2])) {\n cipher.login.username = this.getValueOrDefault(value[3]);\n cipher.login.password = this.getValueOrDefault(value[4]);\n cipher.notes = this.getValueOrDefault(value[5]);\n } else {\n cipher.login.username = this.getValueOrDefault(value[2]);\n cipher.login.password = this.getValueOrDefault(value[3]);\n cipher.notes = this.getValueOrDefault(value[4], '') + '\\n' + this.getValueOrDefault(value[5], '');\n }\n cipher.login.uris = this.makeUriArray(value[1]);\n } else if (value.length === 7) {\n if (this.isNullOrWhitespace(value[2])) {\n cipher.login.username = this.getValueOrDefault(value[3]);\n cipher.notes = this.getValueOrDefault(value[4], '') + '\\n' + this.getValueOrDefault(value[6], '');\n } else {\n cipher.login.username = this.getValueOrDefault(value[2]);\n cipher.notes = this.getValueOrDefault(value[3], '') + '\\n' +\n this.getValueOrDefault(value[4], '') + '\\n' + this.getValueOrDefault(value[6], '');\n }\n cipher.login.uris = this.makeUriArray(value[1]);\n cipher.login.password = this.getValueOrDefault(value[5]);\n } else {\n for (let i = 1; i < value.length; i++) {\n cipher.notes += (value[i] + '\\n');\n if (value[i] === 'NO_TYPE') {\n skip = true;\n break;\n }\n }\n }\n\n if (skip) {\n return;\n }\n if (this.isNullOrWhitespace(cipher.login.username)) {\n cipher.login.username = null;\n }\n if (this.isNullOrWhitespace(cipher.login.password)) {\n cipher.login.password = null;\n }\n this.cleanupCipher(cipher);\n result.ciphers.push(cipher);\n });\n\n result.success = true;\n return result;\n }\n}\n","import { BaseImporter } from './baseImporter';\r\nimport { Importer } from './importer';\r\n\r\nimport { ImportResult } from '../models/domain/importResult';\r\n\r\nexport class ClipperzHtmlImporter extends BaseImporter implements Importer {\r\n parse(data: string): ImportResult {\r\n const result = new ImportResult();\r\n const doc = this.parseXml(data);\r\n if (doc == null) {\r\n result.success = false;\r\n return result;\r\n }\r\n\r\n const textarea = doc.querySelector('textarea');\r\n if (textarea == null || this.isNullOrWhitespace(textarea.textContent)) {\r\n result.errorMessage = 'Missing textarea.';\r\n result.success = false;\r\n return result;\r\n }\r\n\r\n const entries = JSON.parse(textarea.textContent);\r\n entries.forEach((entry: any) => {\r\n const cipher = this.initLoginCipher();\r\n if (!this.isNullOrWhitespace(entry.label)) {\r\n cipher.name = entry.label.split(' ')[0];\r\n }\r\n if (entry.data != null && !this.isNullOrWhitespace(entry.data.notes)) {\r\n cipher.notes = entry.data.notes.split('\\\\n').join('\\n');\r\n }\r\n\r\n if (entry.currentVersion != null && entry.currentVersion.fields != null) {\r\n for (const property in entry.currentVersion.fields) {\r\n if (!entry.currentVersion.fields.hasOwnProperty(property)) {\r\n continue;\r\n }\r\n\r\n const field = entry.currentVersion.fields[property];\r\n const actionType = field.actionType != null ? field.actionType.toLowerCase() : null;\r\n switch (actionType) {\r\n case 'password':\r\n cipher.login.password = this.getValueOrDefault(field.value);\r\n break;\r\n case 'email':\r\n case 'username':\r\n case 'user':\r\n case 'name':\r\n cipher.login.username = this.getValueOrDefault(field.value);\r\n break;\r\n case 'url':\r\n cipher.login.uris = this.makeUriArray(field.value);\r\n break;\r\n default:\r\n const labelLower = field.label != null ? field.label.toLowerCase() : null;\r\n if (cipher.login.password == null && this.passwordFieldNames.indexOf(labelLower) > -1) {\r\n cipher.login.password = this.getValueOrDefault(field.value);\r\n } else if (cipher.login.username == null &&\r\n this.usernameFieldNames.indexOf(labelLower) > -1) {\r\n cipher.login.username = this.getValueOrDefault(field.value);\r\n } else if ((cipher.login.uris == null || cipher.login.uris.length === 0) &&\r\n this.uriFieldNames.indexOf(labelLower) > -1) {\r\n cipher.login.uris = this.makeUriArray(field.value);\r\n } else {\r\n this.processKvp(cipher, field.label, field.value);\r\n }\r\n break;\r\n }\r\n }\r\n }\r\n\r\n this.convertToNoteIfNeeded(cipher);\r\n this.cleanupCipher(cipher);\r\n result.ciphers.push(cipher);\r\n });\r\n\r\n result.success = true;\r\n return result;\r\n }\r\n}\r\n","import { BaseImporter } from './baseImporter';\nimport { Importer } from './importer';\n\nimport { ImportResult } from '../models/domain/importResult';\n\nexport class ChromeCsvImporter extends BaseImporter implements Importer {\n parse(data: string): ImportResult {\n const result = new ImportResult();\n const results = this.parseCsv(data, true);\n if (results == null) {\n result.success = false;\n return result;\n }\n\n results.forEach((value) => {\n const cipher = this.initLoginCipher();\n cipher.name = this.getValueOrDefault(value.name, '--');\n cipher.login.username = this.getValueOrDefault(value.username);\n cipher.login.password = this.getValueOrDefault(value.password);\n cipher.login.uris = this.makeUriArray(value.url);\n this.cleanupCipher(cipher);\n result.ciphers.push(cipher);\n });\n\n result.success = true;\n return result;\n }\n}\n","import { BaseImporter } from './baseImporter';\nimport { Importer } from './importer';\n\nimport { ImportResult } from '../models/domain/importResult';\n\nexport class BlurCsvImporter extends BaseImporter implements Importer {\n parse(data: string): ImportResult {\n const result = new ImportResult();\n const results = this.parseCsv(data, true);\n if (results == null) {\n result.success = false;\n return result;\n }\n\n results.forEach((value) => {\n if (value.label === 'null') {\n value.label = null;\n }\n const cipher = this.initLoginCipher();\n cipher.name = this.getValueOrDefault(value.label,\n this.getValueOrDefault(this.nameFromUrl(value.domain), '--'));\n cipher.login.uris = this.makeUriArray(value.domain);\n cipher.login.password = this.getValueOrDefault(value.password);\n\n if (this.isNullOrWhitespace(value.email) && !this.isNullOrWhitespace(value.username)) {\n cipher.login.username = value.username;\n } else {\n cipher.login.username = this.getValueOrDefault(value.email);\n cipher.notes = this.getValueOrDefault(value.username);\n }\n\n this.cleanupCipher(cipher);\n result.ciphers.push(cipher);\n });\n\n result.success = true;\n return result;\n }\n}\n","import { BaseImporter } from './baseImporter';\nimport { Importer } from './importer';\n\nimport { ImportResult } from '../models/domain/importResult';\n\nimport { CipherView } from '../models/view/cipherView';\nimport { CollectionView } from '../models/view/collectionView';\nimport { FieldView } from '../models/view/fieldView';\nimport { FolderView } from '../models/view/folderView';\nimport { LoginView } from '../models/view/loginView';\nimport { SecureNoteView } from '../models/view/secureNoteView';\n\nimport { CipherType } from '../enums/cipherType';\nimport { FieldType } from '../enums/fieldType';\nimport { SecureNoteType } from '../enums/secureNoteType';\n\nexport class BitwardenCsvImporter extends BaseImporter implements Importer {\n parse(data: string): ImportResult {\n const result = new ImportResult();\n const results = this.parseCsv(data, true);\n if (results == null) {\n result.success = false;\n return result;\n }\n\n results.forEach((value) => {\n if (this.organization && !this.isNullOrWhitespace(value.collections)) {\n const collections = (value.collections as string).split(',');\n collections.forEach((col) => {\n let addCollection = true;\n let collectionIndex = result.collections.length;\n\n for (let i = 0; i < result.collections.length; i++) {\n if (result.collections[i].name === col) {\n addCollection = false;\n collectionIndex = i;\n break;\n }\n }\n\n if (addCollection) {\n const collection = new CollectionView();\n collection.name = col;\n result.collections.push(collection);\n }\n\n result.collectionRelationships.push([result.ciphers.length, collectionIndex]);\n });\n } else if (!this.organization) {\n this.processFolder(result, value.folder);\n }\n\n const cipher = new CipherView();\n cipher.favorite = !this.organization && this.getValueOrDefault(value.favorite, '0') !== '0' ? true : false;\n cipher.type = CipherType.Login;\n cipher.notes = this.getValueOrDefault(value.notes);\n cipher.name = this.getValueOrDefault(value.name, '--');\n\n if (!this.isNullOrWhitespace(value.fields)) {\n const fields = this.splitNewLine(value.fields);\n for (let i = 0; i < fields.length; i++) {\n if (this.isNullOrWhitespace(fields[i])) {\n continue;\n }\n\n const delimPosition = fields[i].lastIndexOf(': ');\n if (delimPosition === -1) {\n continue;\n }\n\n if (cipher.fields == null) {\n cipher.fields = [];\n }\n\n const field = new FieldView();\n field.name = fields[i].substr(0, delimPosition);\n field.value = null;\n field.type = FieldType.Text;\n if (fields[i].length > (delimPosition + 2)) {\n field.value = fields[i].substr(delimPosition + 2);\n }\n cipher.fields.push(field);\n }\n }\n\n const valueType = value.type != null ? value.type.toLowerCase() : null;\n switch (valueType) {\n case 'login':\n case null:\n cipher.type = CipherType.Login;\n cipher.login = new LoginView();\n cipher.login.totp = this.getValueOrDefault(value.login_totp || value.totp);\n cipher.login.username = this.getValueOrDefault(value.login_username || value.username);\n cipher.login.password = this.getValueOrDefault(value.login_password || value.password);\n const uris = this.parseSingleRowCsv(value.login_uri || value.uri);\n cipher.login.uris = this.makeUriArray(uris);\n break;\n case 'note':\n cipher.type = CipherType.SecureNote;\n cipher.secureNote = new SecureNoteView();\n cipher.secureNote.type = SecureNoteType.Generic;\n break;\n default:\n break;\n }\n\n result.ciphers.push(cipher);\n });\n\n result.success = true;\n return result;\n }\n}\n","import { BaseImporter } from './baseImporter';\nimport { Importer } from './importer';\n\nimport { ImportResult } from '../models/domain/importResult';\n\nexport class AviraCsvImporter extends BaseImporter implements Importer {\n parse(data: string): ImportResult {\n const result = new ImportResult();\n const results = this.parseCsv(data, true);\n if (results == null) {\n result.success = false;\n return result;\n }\n\n results.forEach((value) => {\n const cipher = this.initLoginCipher();\n cipher.name = this.getValueOrDefault(value.name,\n this.getValueOrDefault(this.nameFromUrl(value.website), '--'));\n cipher.login.uris = this.makeUriArray(value.website);\n cipher.login.password = this.getValueOrDefault(value.password);\n\n if (this.isNullOrWhitespace(value.username) && !this.isNullOrWhitespace(value.secondary_username)) {\n cipher.login.username = value.secondary_username;\n } else {\n cipher.login.username = this.getValueOrDefault(value.username);\n cipher.notes = this.getValueOrDefault(value.secondary_username);\n }\n\n this.cleanupCipher(cipher);\n result.ciphers.push(cipher);\n });\n\n result.success = true;\n return result;\n }\n}\n","import { BaseImporter } from './baseImporter';\r\nimport { Importer } from './importer';\r\n\r\nimport { ImportResult } from '../models/domain/importResult';\r\n\r\nexport class AscendoCsvImporter extends BaseImporter implements Importer {\r\n parse(data: string): ImportResult {\r\n const result = new ImportResult();\r\n const results = this.parseCsv(data, false);\r\n if (results == null) {\r\n result.success = false;\r\n return result;\r\n }\r\n\r\n results.forEach((value) => {\r\n if (value.length < 2) {\r\n return;\r\n }\r\n\r\n const cipher = this.initLoginCipher();\r\n cipher.notes = this.getValueOrDefault(value[value.length - 1]);\r\n cipher.name = this.getValueOrDefault(value[0], '--');\r\n\r\n if (value.length > 2 && (value.length % 2) === 0) {\r\n for (let i = 0; i < value.length - 2; i += 2) {\r\n const val: string = value[i + 2];\r\n const field: string = value[i + 1];\r\n if (this.isNullOrWhitespace(val) || this.isNullOrWhitespace(field)) {\r\n continue;\r\n }\r\n\r\n const fieldLower = field.toLowerCase();\r\n if (cipher.login.password == null && this.passwordFieldNames.indexOf(fieldLower) > -1) {\r\n cipher.login.password = this.getValueOrDefault(val);\r\n } else if (cipher.login.username == null &&\r\n this.usernameFieldNames.indexOf(fieldLower) > -1) {\r\n cipher.login.username = this.getValueOrDefault(val);\r\n } else if ((cipher.login.uris == null || cipher.login.uris.length === 0) &&\r\n this.uriFieldNames.indexOf(fieldLower) > -1) {\r\n cipher.login.uris = this.makeUriArray(val);\r\n } else {\r\n this.processKvp(cipher, field, val);\r\n }\r\n }\r\n }\r\n\r\n this.convertToNoteIfNeeded(cipher);\r\n this.cleanupCipher(cipher);\r\n result.ciphers.push(cipher);\r\n });\r\n\r\n result.success = true;\r\n return result;\r\n }\r\n}\r\n","import { CipherRequest } from './cipherRequest';\nimport { FolderRequest } from './folderRequest';\nimport { KvpRequest } from './kvpRequest';\n\nexport class ImportCiphersRequest {\n ciphers: CipherRequest[] = [];\n folders: FolderRequest[] = [];\n folderRelationships: Array> = [];\n}\n","
\r\n
\r\n
\r\n \r\n
\r\n
{{'reports' | i18n}}
\r\n \r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n","import { PlanType } from '../../enums/planType';\n\nexport class OrganizationCreateRequest {\n name: string;\n businessName: string;\n billingEmail: string;\n planType: PlanType;\n key: string;\n paymentToken: string;\n additionalSeats: number;\n additionalStorageGb: number;\n collectionName: string;\n country: string;\n}\n","
\n

{{'newOrganization' | i18n}}

\n
\n

{{'newOrganizationDesc' | i18n}}

\n\n

{{'uploadLicenseFileOrg' | i18n}}

\n
\n
\n \n \n {{'licenseFileDesc' | i18n : 'bitwarden_organization_license.json'}}\n
\n \n
\n
\n
\n

{{'generalInformation' | i18n}}

\n
\n
\n \n \n
\n
\n \n \n
\n
\n
\n \n \n
\n
\n
\n \n \n
\n
\n

{{'chooseYourPlan' | i18n}}

\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n \n \n

{{'users' | i18n}}

\n
\n
\n \n \n {{'userSeatsHowManyDesc' | i18n}}\n
\n
\n
\n

{{'addons' | i18n}}

\n
\n
\n \n \n {{'userSeatsAdditionalDesc' | i18n : plans[plan].baseSeats : (plans[plan].seatPrice | currency:'$')}}\n
\n
\n
\n
\n \n \n {{'additionalStorageDesc' | i18n : '1 GB' : (storageGb.price | currency:'$')}}\n
\n
\n

{{'summary' | i18n}}

\n
\n \n \n
\n
\n \n \n
\n
\n
\n {{'total' | i18n}}: {{total | currency:'USD $'}} /{{interval | i18n}}\n
\n {{'paymentChargedWithTrial' | i18n : (interval | i18n) }}\n

{{'paymentInformation' | i18n}}

\n \n
\n
\n \n
\n
\n","export class PaymentRequest {\n paymentToken: string;\n}\n","export class StorageRequest {\n storageGbAdjustment: number;\n}\n","
\n

\n {{'billingAndLicensing' | i18n}}\n \n \n \n

\n
\n\n\n {{'subscriptionCanceled' | i18n}}\n \n

{{'subscriptionPendingCanceled' | i18n}}

\n \n
\n
\n
{{'subscription' | i18n}}
\n
{{'premiumMembership' | i18n}}
\n
\n
\n
{{'expiration' | i18n}}
\n
{{billing.expiration | date:'mediumDate'}}
\n
{{'neverExpires' | i18n}}
\n
\n
\n
\n
\n
{{'status' | i18n}}
\n
\n {{(subscription && subscription.status) || '-'}}\n {{'pendingCancellation' | i18n}}\n
\n
{{'nextCharge' | i18n}}
\n
{{nextInvoice ? ((nextInvoice.date | date: 'mediumDate') + ', ' + (nextInvoice.amount | currency:'$')) :\n '-'}}\n
\n
\n
\n
\n {{'details' | i18n}}\n \n \n \n \n \n \n \n
\n {{i.name}} {{i.quantity > 1 ? '×' + i.quantity : ''}} @ {{i.amount | currency:'$'}}\n \n {{(i.quantity * i.amount) | currency:'$'}} /{{i.interval | i18n}}\n
\n
\n
\n \n
\n \n \n {{'manageSubscription' | i18n}}\n \n
\n
\n
\n

{{'updateLicense' | i18n}}

\n \n
\n
\n
\n \n
\n \n \n
\n

{{'storage' | i18n}}

\n

{{'subscriptionStorage' | i18n : billing.maxStorageGb || 0 : billing.storageName || '0 MB'}}

\n
\n
{{(storagePercentage / 100) | percent}}
\n
\n \n
\n
\n \n \n
\n \n
\n
\n

{{'paymentMethod' | i18n}}

\n

{{'noPaymentMethod' | i18n}}

\n

\n \n {{paymentSource.description}}\n

\n \n \n \n

{{'charges' | i18n}}

\n

{{'noCharges' | i18n}}

\n \n \n \n \n \n \n \n \n \n
{{c.createdDate | date:'mediumDate'}}{{c.paymentSource ? c.paymentSource.description : '-'}}{{c.status}}{{c.amount | currency:'$'}}
\n * {{'chargesStatement' | i18n : 'BITWARDEN'}}\n
\n
\n","
\n

{{'goPremium' | i18n}}

\n
\n\n

{{'premiumUpgradeUnlockFeatures' | i18n}}

\n
    \n
  • \n \n {{'premiumSignUpStorage' | i18n}}\n
  • \n
  • \n \n {{'premiumSignUpTwoStep' | i18n}}\n
  • \n
  • \n \n {{'premiumSignUpTotp' | i18n}}\n
  • \n
  • \n \n {{'premiumSignUpSupport' | i18n}}\n
  • \n
  • \n \n {{'premiumSignUpFuture' | i18n}}\n
  • \n
\n

{{'premiumPrice' | i18n : (premiumPrice | currency:'$')}}

\n \n {{'purchasePremium' | i18n}}\n \n
\n\n

{{'uploadLicenseFilePremium' | i18n}}

\n
\n
\n \n \n {{'licenseFileDesc' | i18n : 'bitwarden_premium_license.json'}}\n
\n \n
\n
\n
\n

{{'addons' | i18n}}

\n
\n
\n \n \n {{'additionalStorageDesc' | i18n : '1 GB' : (storageGbPrice | currency:'$')}}\n
\n
\n

{{'summary' | i18n}}

\n {{'premiumMembership' | i18n}}: {{premiumPrice | currency:'$'}}\n
{{'additionalStorageGb' | i18n}}: {{additionalStorage || 0}} GB × {{storageGbPrice | currency:'$'}} = {{additionalStorageTotal\n | currency:'$'}}\n
\n
\n {{'total' | i18n}}: {{total | currency:'USD $'}} /{{'year' | i18n}}\n
\n {{'paymentChargedAnnually' | i18n}}\n

{{'paymentInformation' | i18n}}

\n \n \n
\n","import { PasswordVerificationRequest } from './passwordVerificationRequest';\n\nexport class UpdateTwoFactorYubioOtpRequest extends PasswordVerificationRequest {\n key1: string;\n key2: string;\n key3: string;\n key4: string;\n key5: string;\n nfc: boolean;\n}\n","import { PasswordVerificationRequest } from './passwordVerificationRequest';\n\nexport class UpdateTwoFactorU2fRequest extends PasswordVerificationRequest {\n deviceResponse: string;\n}\n","import { PasswordVerificationRequest } from './passwordVerificationRequest';\n\nexport class UpdateTwoFactorEmailRequest extends PasswordVerificationRequest {\n token: string;\n email: string;\n}\n","import { PasswordVerificationRequest } from './passwordVerificationRequest';\n\nexport class UpdateTwoFactorDuoRequest extends PasswordVerificationRequest {\n integrationKey: string;\n secretKey: string;\n host: string;\n}\n","import { PasswordVerificationRequest } from './passwordVerificationRequest';\n\nimport { TwoFactorProviderType } from '../../enums/twoFactorProviderType';\n\nexport class TwoFactorProviderRequest extends PasswordVerificationRequest {\n type: TwoFactorProviderType;\n}\n","import { PasswordVerificationRequest } from './passwordVerificationRequest';\n\nexport class UpdateTwoFactorAuthenticatorRequest extends PasswordVerificationRequest {\n token: string;\n key: string;\n}\n","export class UpdateDomainsRequest {\n equivalentDomains: string[][];\n excludedGlobalEquivalentDomains: number[];\n}\n","
\n

{{'domainRules' | i18n}}

\n
\n

{{'domainRulesDesc' | i18n}}

\n
\n

{{'customEqDomains' | i18n}}

\n

\n \n

\n \n
\n
\n \n \n
\n \n
\n \n {{'newCustomDomainDesc' | i18n}}\n
\n \n

{{'globalEqDomains' | i18n}}

\n

\n \n

\n 0\">\n \n \n \n \n \n \n
{{d.domains}}\n \n
\n \n
\n","
\n

{{'options' | i18n}}

\n
\n

{{'optionsDesc' | i18n}}

\n
\n
\n
\n
\n
\n \n \n \n \n
\n \n {{'languageDesc' | i18n}}\n
\n
\n
\n
\n
\n \n \n \n \n \n
\n {{'disableIconsDesc' | i18n}}\n
\n \n
\n","import { PasswordVerificationRequest } from './passwordVerificationRequest';\n\nexport class PasswordRequest extends PasswordVerificationRequest {\n newMasterPasswordHash: string;\n key: string;\n}\n","{{'loggedOutWarning' | i18n}}\n
\n
\n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n
\n \n
\n","import { EmailTokenRequest } from './emailTokenRequest';\n\nexport class EmailRequest extends EmailTokenRequest {\n newMasterPasswordHash: string;\n token: string;\n key: string;\n}\n","
\n
\n
\n
\n \n \n
\n
\n \n \n
\n
\n
\n \n
\n

{{'changeEmailDesc' | i18n : newEmail}}

\n {{'loggedOutWarning' | i18n}}\n
\n
\n
\n \n \n
\n
\n
\n
\n \n \n
\n","export class UpdateProfileRequest {\n name: string;\n masterPasswordHint: string;\n culture = 'en-US'; // deprecated\n\n constructor(name: string, masterPasswordHint: string) {\n this.name = name;\n this.masterPasswordHint = masterPasswordHint ? masterPasswordHint : null;\n }\n}\n","
\n \n
\n
\n
\n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n
\n \n
\n
\n \n
\n","
\n

{{'myAccount' | i18n}}

\n
\n\n
\n

{{'changeEmail' | i18n}}

\n
\n\n
\n

{{'changeMasterPassword' | i18n}}

\n
\n\n
\n

{{'dangerZone' | i18n}}

\n
\n
\n
\n

{{'dangerZoneDesc' | i18n}}

\n \n \n \n
\n
\n\n\n\n","\n","import {\n EventEmitter,\n Input,\n OnInit,\n Output,\n} from '@angular/core';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { FolderService } from '../../abstractions/folder.service';\nimport { I18nService } from '../../abstractions/i18n.service';\nimport { PlatformUtilsService } from '../../abstractions/platformUtils.service';\n\nimport { FolderView } from '../../models/view/folderView';\n\nexport class FolderAddEditComponent implements OnInit {\n @Input() folderId: string;\n @Output() onSavedFolder = new EventEmitter();\n @Output() onDeletedFolder = new EventEmitter();\n\n editMode: boolean = false;\n folder: FolderView = new FolderView();\n title: string;\n formPromise: Promise;\n deletePromise: Promise;\n\n constructor(protected folderService: FolderService, protected i18nService: I18nService,\n protected analytics: Angulartics2, protected toasterService: ToasterService,\n protected platformUtilsService: PlatformUtilsService) { }\n\n async ngOnInit() {\n this.editMode = this.folderId != null;\n\n if (this.editMode) {\n this.editMode = true;\n this.title = this.i18nService.t('editFolder');\n const folder = await this.folderService.get(this.folderId);\n this.folder = await folder.decrypt();\n } else {\n this.title = this.i18nService.t('addFolder');\n }\n }\n\n async submit(): Promise {\n if (this.folder.name == null || this.folder.name === '') {\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'),\n this.i18nService.t('nameRequired'));\n return false;\n }\n\n try {\n const folder = await this.folderService.encrypt(this.folder);\n this.formPromise = this.folderService.saveWithServer(folder);\n await this.formPromise;\n this.analytics.eventTrack.next({ action: this.editMode ? 'Edited Folder' : 'Added Folder' });\n this.toasterService.popAsync('success', null,\n this.i18nService.t(this.editMode ? 'editedFolder' : 'addedFolder'));\n this.onSavedFolder.emit(this.folder);\n return true;\n } catch { }\n\n return false;\n }\n\n async delete(): Promise {\n const confirmed = await this.platformUtilsService.showDialog(\n this.i18nService.t('deleteFolderConfirmation'), this.i18nService.t('deleteFolder'),\n this.i18nService.t('yes'), this.i18nService.t('no'), 'warning');\n if (!confirmed) {\n return false;\n }\n\n try {\n this.deletePromise = this.folderService.deleteWithServer(this.folder.id);\n await this.deletePromise;\n this.analytics.eventTrack.next({ action: 'Deleted Folder' });\n this.toasterService.popAsync('success', null, this.i18nService.t('deletedFolder'));\n this.onDeletedFolder.emit(this.folder);\n } catch { }\n\n return true;\n }\n}\n","import {\n EventEmitter,\n Input,\n OnInit,\n Output,\n} from '@angular/core';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { CipherService } from '../../abstractions/cipher.service';\nimport { CryptoService } from '../../abstractions/crypto.service';\nimport { I18nService } from '../../abstractions/i18n.service';\nimport { PlatformUtilsService } from '../../abstractions/platformUtils.service';\nimport { TokenService } from '../../abstractions/token.service';\n\nimport { Cipher } from '../../models/domain/cipher';\n\nimport { AttachmentView } from '../../models/view/attachmentView';\nimport { CipherView } from '../../models/view/cipherView';\n\nexport class AttachmentsComponent implements OnInit {\n @Input() cipherId: string;\n @Output() onUploadedAttachment = new EventEmitter();\n @Output() onDeletedAttachment = new EventEmitter();\n\n cipher: CipherView;\n cipherDomain: Cipher;\n hasUpdatedKey: boolean;\n canAccessAttachments: boolean;\n formPromise: Promise;\n deletePromises: { [id: string]: Promise; } = {};\n\n constructor(protected cipherService: CipherService, protected analytics: Angulartics2,\n protected toasterService: ToasterService, protected i18nService: I18nService,\n protected cryptoService: CryptoService, protected tokenService: TokenService,\n protected platformUtilsService: PlatformUtilsService, protected win: Window) { }\n\n async ngOnInit() {\n this.cipherDomain = await this.loadCipher();\n this.cipher = await this.cipherDomain.decrypt();\n\n this.hasUpdatedKey = await this.cryptoService.hasEncKey();\n const isPremium = this.tokenService.getPremium();\n this.canAccessAttachments = isPremium || this.cipher.organizationId != null;\n\n if (!this.canAccessAttachments) {\n const confirmed = await this.platformUtilsService.showDialog(\n this.i18nService.t('premiumRequiredDesc'), this.i18nService.t('premiumRequired'),\n this.i18nService.t('learnMore'), this.i18nService.t('cancel'));\n if (confirmed) {\n this.platformUtilsService.launchUri('https://vault.bitwarden.com/#/?premium=purchase');\n }\n } else if (!this.hasUpdatedKey) {\n const confirmed = await this.platformUtilsService.showDialog(\n this.i18nService.t('updateKey'), this.i18nService.t('featureUnavailable'),\n this.i18nService.t('learnMore'), this.i18nService.t('cancel'), 'warning');\n if (confirmed) {\n this.platformUtilsService.launchUri('https://help.bitwarden.com/article/update-encryption-key/');\n }\n }\n }\n\n async submit() {\n if (!this.hasUpdatedKey) {\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'),\n this.i18nService.t('updateKey'));\n return;\n }\n\n const fileEl = document.getElementById('file') as HTMLInputElement;\n const files = fileEl.files;\n if (files == null || files.length === 0) {\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'),\n this.i18nService.t('selectFile'));\n return;\n }\n\n if (files[0].size > 104857600) { // 100 MB\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'),\n this.i18nService.t('maxFileSize'));\n return;\n }\n\n try {\n this.formPromise = this.saveCipherAttachment(files[0]);\n this.cipherDomain = await this.formPromise;\n this.cipher = await this.cipherDomain.decrypt();\n this.analytics.eventTrack.next({ action: 'Added Attachment' });\n this.toasterService.popAsync('success', null, this.i18nService.t('attachmentSaved'));\n this.onUploadedAttachment.emit();\n } catch { }\n\n // reset file input\n // ref: https://stackoverflow.com/a/20552042\n fileEl.type = '';\n fileEl.type = 'file';\n fileEl.value = '';\n }\n\n async delete(attachment: AttachmentView) {\n if (this.deletePromises[attachment.id] != null) {\n return;\n }\n\n const confirmed = await this.platformUtilsService.showDialog(\n this.i18nService.t('deleteAttachmentConfirmation'), this.i18nService.t('deleteAttachment'),\n this.i18nService.t('yes'), this.i18nService.t('no'), 'warning');\n if (!confirmed) {\n return;\n }\n\n try {\n this.deletePromises[attachment.id] = this.deleteCipherAttachment(attachment.id);\n await this.deletePromises[attachment.id];\n this.analytics.eventTrack.next({ action: 'Deleted Attachment' });\n this.toasterService.popAsync('success', null, this.i18nService.t('deletedAttachment'));\n const i = this.cipher.attachments.indexOf(attachment);\n if (i > -1) {\n this.cipher.attachments.splice(i, 1);\n }\n } catch { }\n\n this.deletePromises[attachment.id] = null;\n this.onDeletedAttachment.emit();\n }\n\n async download(attachment: AttachmentView) {\n const a = (attachment as any);\n if (a.downloading) {\n return;\n }\n\n if (!this.canAccessAttachments) {\n this.toasterService.popAsync('error', this.i18nService.t('premiumRequired'),\n this.i18nService.t('premiumRequiredDesc'));\n return;\n }\n\n a.downloading = true;\n const response = await fetch(new Request(attachment.url, { cache: 'no-cache' }));\n if (response.status !== 200) {\n this.toasterService.popAsync('error', null, this.i18nService.t('errorOccurred'));\n a.downloading = false;\n return;\n }\n\n try {\n const buf = await response.arrayBuffer();\n const key = await this.cryptoService.getOrgKey(this.cipher.organizationId);\n const decBuf = await this.cryptoService.decryptFromBytes(buf, key);\n this.platformUtilsService.saveFile(this.win, decBuf, null, attachment.fileName);\n } catch (e) {\n this.toasterService.popAsync('error', null, this.i18nService.t('errorOccurred'));\n }\n\n a.downloading = false;\n }\n\n protected loadCipher() {\n return this.cipherService.get(this.cipherId);\n }\n\n protected saveCipherAttachment(file: File) {\n return this.cipherService.saveAttachmentWithServer(this.cipherDomain, file);\n }\n\n protected deleteCipherAttachment(attachmentId: string) {\n return this.cipherService.deleteAttachmentWithServer(this.cipher.id, attachmentId);\n }\n}\n","import {\n EventEmitter,\n Input,\n Output,\n} from '@angular/core';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { CipherType } from '../../enums/cipherType';\nimport { FieldType } from '../../enums/fieldType';\nimport { SecureNoteType } from '../../enums/secureNoteType';\nimport { UriMatchType } from '../../enums/uriMatchType';\n\nimport { AuditService } from '../../abstractions/audit.service';\nimport { CipherService } from '../../abstractions/cipher.service';\nimport { FolderService } from '../../abstractions/folder.service';\nimport { I18nService } from '../../abstractions/i18n.service';\nimport { PlatformUtilsService } from '../../abstractions/platformUtils.service';\nimport { StateService } from '../../abstractions/state.service';\n\nimport { Cipher } from '../../models/domain/cipher';\n\nimport { CardView } from '../../models/view/cardView';\nimport { CipherView } from '../../models/view/cipherView';\nimport { FieldView } from '../../models/view/fieldView';\nimport { FolderView } from '../../models/view/folderView';\nimport { IdentityView } from '../../models/view/identityView';\nimport { LoginUriView } from '../../models/view/loginUriView';\nimport { LoginView } from '../../models/view/loginView';\nimport { SecureNoteView } from '../../models/view/secureNoteView';\n\nexport class AddEditComponent {\n @Input() folderId: string = null;\n @Input() cipherId: string;\n @Input() type: CipherType;\n @Output() onSavedCipher = new EventEmitter();\n @Output() onDeletedCipher = new EventEmitter();\n @Output() onCancelled = new EventEmitter();\n @Output() onEditAttachments = new EventEmitter();\n @Output() onGeneratePassword = new EventEmitter();\n\n editMode: boolean = false;\n cipher: CipherView;\n folders: FolderView[];\n title: string;\n formPromise: Promise;\n deletePromise: Promise;\n checkPasswordPromise: Promise;\n showPassword: boolean = false;\n showCardCode: boolean = false;\n cipherType = CipherType;\n fieldType = FieldType;\n addFieldType: FieldType = FieldType.Text;\n typeOptions: any[];\n cardBrandOptions: any[];\n cardExpMonthOptions: any[];\n identityTitleOptions: any[];\n addFieldTypeOptions: any[];\n uriMatchOptions: any[];\n\n constructor(protected cipherService: CipherService, protected folderService: FolderService,\n protected i18nService: I18nService, protected platformUtilsService: PlatformUtilsService,\n protected analytics: Angulartics2, protected toasterService: ToasterService,\n protected auditService: AuditService, protected stateService: StateService) {\n this.typeOptions = [\n { name: i18nService.t('typeLogin'), value: CipherType.Login },\n { name: i18nService.t('typeCard'), value: CipherType.Card },\n { name: i18nService.t('typeIdentity'), value: CipherType.Identity },\n { name: i18nService.t('typeSecureNote'), value: CipherType.SecureNote },\n ];\n this.cardBrandOptions = [\n { name: '-- ' + i18nService.t('select') + ' --', value: null },\n { name: 'Visa', value: 'Visa' },\n { name: 'Mastercard', value: 'Mastercard' },\n { name: 'American Express', value: 'Amex' },\n { name: 'Discover', value: 'Discover' },\n { name: 'Diners Club', value: 'Diners Club' },\n { name: 'JCB', value: 'JCB' },\n { name: 'Maestro', value: 'Maestro' },\n { name: 'UnionPay', value: 'UnionPay' },\n { name: i18nService.t('other'), value: 'Other' },\n ];\n this.cardExpMonthOptions = [\n { name: '-- ' + i18nService.t('select') + ' --', value: null },\n { name: '01 - ' + i18nService.t('january'), value: '1' },\n { name: '02 - ' + i18nService.t('february'), value: '2' },\n { name: '03 - ' + i18nService.t('march'), value: '3' },\n { name: '04 - ' + i18nService.t('april'), value: '4' },\n { name: '05 - ' + i18nService.t('may'), value: '5' },\n { name: '06 - ' + i18nService.t('june'), value: '6' },\n { name: '07 - ' + i18nService.t('july'), value: '7' },\n { name: '08 - ' + i18nService.t('august'), value: '8' },\n { name: '09 - ' + i18nService.t('september'), value: '9' },\n { name: '10 - ' + i18nService.t('october'), value: '10' },\n { name: '11 - ' + i18nService.t('november'), value: '11' },\n { name: '12 - ' + i18nService.t('december'), value: '12' },\n ];\n this.identityTitleOptions = [\n { name: '-- ' + i18nService.t('select') + ' --', value: null },\n { name: i18nService.t('mr'), value: i18nService.t('mr') },\n { name: i18nService.t('mrs'), value: i18nService.t('mrs') },\n { name: i18nService.t('ms'), value: i18nService.t('ms') },\n { name: i18nService.t('dr'), value: i18nService.t('dr') },\n ];\n this.addFieldTypeOptions = [\n { name: i18nService.t('cfTypeText'), value: FieldType.Text },\n { name: i18nService.t('cfTypeHidden'), value: FieldType.Hidden },\n { name: i18nService.t('cfTypeBoolean'), value: FieldType.Boolean },\n ];\n this.uriMatchOptions = [\n { name: i18nService.t('defaultMatchDetection'), value: null },\n { name: i18nService.t('baseDomain'), value: UriMatchType.Domain },\n { name: i18nService.t('host'), value: UriMatchType.Host },\n { name: i18nService.t('startsWith'), value: UriMatchType.StartsWith },\n { name: i18nService.t('regEx'), value: UriMatchType.RegularExpression },\n { name: i18nService.t('exact'), value: UriMatchType.Exact },\n { name: i18nService.t('never'), value: UriMatchType.Never },\n ];\n }\n\n async load() {\n this.editMode = this.cipherId != null;\n if (this.editMode) {\n this.editMode = true;\n this.title = this.i18nService.t('editItem');\n } else {\n this.title = this.i18nService.t('addItem');\n }\n\n this.cipher = await this.stateService.get('addEditCipher');\n await this.stateService.remove('addEditCipher');\n if (this.cipher == null) {\n if (this.editMode) {\n const cipher = await this.loadCipher();\n this.cipher = await cipher.decrypt();\n } else {\n this.cipher = new CipherView();\n this.cipher.folderId = this.folderId;\n this.cipher.type = this.type == null ? CipherType.Login : this.type;\n this.cipher.login = new LoginView();\n this.cipher.login.uris = [new LoginUriView()];\n this.cipher.card = new CardView();\n this.cipher.identity = new IdentityView();\n this.cipher.secureNote = new SecureNoteView();\n this.cipher.secureNote.type = SecureNoteType.Generic;\n }\n }\n\n this.folders = await this.folderService.getAllDecrypted();\n }\n\n async submit(): Promise {\n if (this.cipher.name == null || this.cipher.name === '') {\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'),\n this.i18nService.t('nameRequired'));\n return false;\n }\n\n if (!this.editMode && this.cipher.type === CipherType.Login &&\n this.cipher.login.uris != null && this.cipher.login.uris.length === 1 &&\n (this.cipher.login.uris[0].uri == null || this.cipher.login.uris[0].uri === '')) {\n this.cipher.login.uris = null;\n }\n\n const cipher = await this.encryptCipher();\n try {\n this.formPromise = this.saveCipher(cipher);\n await this.formPromise;\n this.cipher.id = cipher.id;\n this.analytics.eventTrack.next({ action: this.editMode ? 'Edited Cipher' : 'Added Cipher' });\n this.toasterService.popAsync('success', null,\n this.i18nService.t(this.editMode ? 'editedItem' : 'addedItem'));\n this.onSavedCipher.emit(this.cipher);\n return true;\n } catch { }\n\n return false;\n }\n\n addUri() {\n if (this.cipher.type !== CipherType.Login) {\n return;\n }\n\n if (this.cipher.login.uris == null) {\n this.cipher.login.uris = [];\n }\n\n this.cipher.login.uris.push(new LoginUriView());\n }\n\n removeUri(uri: LoginUriView) {\n if (this.cipher.type !== CipherType.Login || this.cipher.login.uris == null) {\n return;\n }\n\n const i = this.cipher.login.uris.indexOf(uri);\n if (i > -1) {\n this.cipher.login.uris.splice(i, 1);\n }\n }\n\n addField() {\n if (this.cipher.fields == null) {\n this.cipher.fields = [];\n }\n\n const f = new FieldView();\n f.type = this.addFieldType;\n this.cipher.fields.push(f);\n }\n\n removeField(field: FieldView) {\n const i = this.cipher.fields.indexOf(field);\n if (i > -1) {\n this.cipher.fields.splice(i, 1);\n }\n }\n\n cancel() {\n this.onCancelled.emit(this.cipher);\n }\n\n attachments() {\n this.onEditAttachments.emit(this.cipher);\n }\n\n async delete(): Promise {\n const confirmed = await this.platformUtilsService.showDialog(\n this.i18nService.t('deleteItemConfirmation'), this.i18nService.t('deleteItem'),\n this.i18nService.t('yes'), this.i18nService.t('no'), 'warning');\n if (!confirmed) {\n return false;\n }\n\n try {\n this.deletePromise = this.deleteCipher();\n await this.deletePromise;\n this.analytics.eventTrack.next({ action: 'Deleted Cipher' });\n this.toasterService.popAsync('success', null, this.i18nService.t('deletedItem'));\n this.onDeletedCipher.emit(this.cipher);\n } catch { }\n\n return true;\n }\n\n async generatePassword(): Promise {\n if (this.cipher.login != null && this.cipher.login.password != null && this.cipher.login.password.length) {\n const confirmed = await this.platformUtilsService.showDialog(\n this.i18nService.t('overwritePasswordConfirmation'), this.i18nService.t('overwritePassword'),\n this.i18nService.t('yes'), this.i18nService.t('no'));\n if (!confirmed) {\n return false;\n }\n }\n\n this.onGeneratePassword.emit();\n return true;\n }\n\n togglePassword() {\n this.analytics.eventTrack.next({ action: 'Toggled Password on Edit' });\n this.showPassword = !this.showPassword;\n document.getElementById('loginPassword').focus();\n }\n\n toggleCardCode() {\n this.analytics.eventTrack.next({ action: 'Toggled CardCode on Edit' });\n this.showCardCode = !this.showCardCode;\n document.getElementById('cardCode').focus();\n }\n\n toggleFieldValue(field: FieldView) {\n const f = (field as any);\n f.showValue = !f.showValue;\n }\n\n toggleUriOptions(uri: LoginUriView) {\n const u = (uri as any);\n u.showOptions = u.showOptions == null && uri.match != null ? false : !u.showOptions;\n }\n\n loginUriMatchChanged(uri: LoginUriView) {\n const u = (uri as any);\n u.showOptions = u.showOptions == null ? true : u.showOptions;\n }\n\n async checkPassword() {\n if (this.checkPasswordPromise != null) {\n return;\n }\n\n if (this.cipher.login == null || this.cipher.login.password == null || this.cipher.login.password === '') {\n return;\n }\n\n this.analytics.eventTrack.next({ action: 'Check Password' });\n this.checkPasswordPromise = this.auditService.passwordLeaked(this.cipher.login.password);\n const matches = await this.checkPasswordPromise;\n this.checkPasswordPromise = null;\n\n if (matches > 0) {\n this.toasterService.popAsync('warning', null, this.i18nService.t('passwordExposed', matches.toString()));\n } else {\n this.toasterService.popAsync('success', null, this.i18nService.t('passwordSafe'));\n }\n }\n\n protected loadCipher() {\n return this.cipherService.get(this.cipherId);\n }\n\n protected encryptCipher() {\n return this.cipherService.encrypt(this.cipher);\n }\n\n protected saveCipher(cipher: Cipher) {\n return this.cipherService.saveWithServer(cipher);\n }\n\n protected deleteCipher() {\n return this.cipherService.deleteWithServer(this.cipher.id);\n }\n}\n","import { CipherWithIdRequest } from './cipherWithIdRequest';\nimport { FolderWithIdRequest } from './folderWithIdRequest';\n\nexport class UpdateKeyRequest {\n ciphers: CipherWithIdRequest[] = [];\n folders: FolderWithIdRequest[] = [];\n masterPasswordHash: string;\n privateKey: string;\n key: string;\n}\n","import { FolderRequest } from './folderRequest';\n\nimport { Folder } from '../domain/folder';\n\nexport class FolderWithIdRequest extends FolderRequest {\n id: string;\n\n constructor(folder: Folder) {\n super(folder);\n this.id = folder.id;\n }\n}\n","import {\n EventEmitter,\n Input,\n Output,\n} from '@angular/core';\n\nimport { CipherService } from '../../abstractions/cipher.service';\n\nimport { CipherView } from '../../models/view/cipherView';\n\nexport class CiphersComponent {\n @Input() activeCipherId: string = null;\n @Output() onCipherClicked = new EventEmitter();\n @Output() onCipherRightClicked = new EventEmitter();\n @Output() onAddCipher = new EventEmitter();\n @Output() onAddCipherOptions = new EventEmitter();\n\n loaded: boolean = false;\n ciphers: CipherView[] = [];\n searchText: string;\n searchPlaceholder: string = null;\n\n protected allCiphers: CipherView[] = [];\n protected filter: (cipher: CipherView) => boolean = null;\n\n constructor(protected cipherService: CipherService) { }\n\n async load(filter: (cipher: CipherView) => boolean = null) {\n this.allCiphers = await this.cipherService.getAllDecrypted();\n this.applyFilter(filter);\n this.loaded = true;\n }\n\n async refresh() {\n this.loaded = false;\n this.ciphers = [];\n await this.load(this.filter);\n }\n\n applyFilter(filter: (cipher: CipherView) => boolean = null) {\n this.filter = filter;\n if (this.filter == null) {\n this.ciphers = this.allCiphers;\n } else {\n this.ciphers = this.allCiphers.filter(this.filter);\n }\n }\n\n selectCipher(cipher: CipherView) {\n this.onCipherClicked.emit(cipher);\n }\n\n rightClickCipher(cipher: CipherView) {\n this.onCipherRightClicked.emit(cipher);\n }\n\n addCipher() {\n this.onAddCipher.emit();\n }\n\n addCipherOptions() {\n this.onAddCipherOptions.emit();\n }\n}\n","export enum LogLevelType {\r\n Debug,\r\n Info,\r\n Warning,\r\n Error,\r\n}\r\n","export { CipherType } from './cipherType';\r\nexport { DeviceType } from './deviceType';\r\nexport { EncryptionType } from './encryptionType';\r\nexport { FieldType } from './fieldType';\r\nexport { LogLevelType } from './logLevelType';\r\nexport { SecureNoteType } from './secureNoteType';\r\nexport { TwoFactorProviderType } from './twoFactorProviderType';\r\nexport { UriMatchType } from './uriMatchType';\r\n","import {\n Directive,\n ElementRef,\n HostListener,\n Input,\n} from '@angular/core';\r\n\r\n@Directive({\r\n selector: '[appFallbackSrc]',\r\n})\r\nexport class FallbackSrcDirective {\n @Input('appFallbackSrc') appFallbackSrc: string;\n\n constructor(private el: ElementRef) {\n }\n\n @HostListener('error') onError() {\r\n this.el.nativeElement.src = this.appFallbackSrc;\r\n }\r\n}\n","import {\n Component,\n EventEmitter,\n Input,\n Output,\n} from '@angular/core';\n\nimport { CipherType } from '../../enums/cipherType';\n\nimport { CollectionView } from '../../models/view/collectionView';\nimport { FolderView } from '../../models/view/folderView';\n\nimport { CollectionService } from '../../abstractions/collection.service';\nimport { FolderService } from '../../abstractions/folder.service';\n\nexport class GroupingsComponent {\n @Input() showFolders = true;\n @Input() showCollections = true;\n @Input() showFavorites = true;\n\n @Output() onAllClicked = new EventEmitter();\n @Output() onFavoritesClicked = new EventEmitter();\n @Output() onCipherTypeClicked = new EventEmitter();\n @Output() onFolderClicked = new EventEmitter();\n @Output() onAddFolder = new EventEmitter();\n @Output() onEditFolder = new EventEmitter();\n @Output() onCollectionClicked = new EventEmitter();\n\n folders: FolderView[];\n collections: CollectionView[];\n loaded: boolean = false;\n cipherType = CipherType;\n selectedAll: boolean = false;\n selectedFavorites: boolean = false;\n selectedType: CipherType = null;\n selectedFolder: boolean = false;\n selectedFolderId: string = null;\n selectedCollectionId: string = null;\n\n constructor(protected collectionService: CollectionService, protected folderService: FolderService) { }\n\n async load(setLoaded = true) {\n await this.loadFolders();\n await this.loadCollections();\n\n if (setLoaded) {\n this.loaded = true;\n }\n }\n\n async loadCollections(organizationId?: string) {\n if (!this.showCollections) {\n return;\n }\n const collections = await this.collectionService.getAllDecrypted();\n if (organizationId != null) {\n this.collections = collections.filter((c) => c.organizationId === organizationId);\n } else {\n this.collections = collections;\n }\n }\n\n async loadFolders() {\n if (!this.showFolders) {\n return;\n }\n this.folders = await this.folderService.getAllDecrypted();\n }\n\n selectAll() {\n this.clearSelections();\n this.selectedAll = true;\n this.onAllClicked.emit();\n }\n\n selectFavorites() {\n this.clearSelections();\n this.selectedFavorites = true;\n this.onFavoritesClicked.emit();\n }\n\n selectType(type: CipherType) {\n this.clearSelections();\n this.selectedType = type;\n this.onCipherTypeClicked.emit(type);\n }\n\n selectFolder(folder: FolderView) {\n this.clearSelections();\n this.selectedFolder = true;\n this.selectedFolderId = folder.id;\n this.onFolderClicked.emit(folder);\n }\n\n addFolder() {\n this.onAddFolder.emit();\n }\n\n editFolder(folder: FolderView) {\n this.onEditFolder.emit(folder);\n }\n\n selectCollection(collection: CollectionView) {\n this.clearSelections();\n this.selectedCollectionId = collection.id;\n this.onCollectionClicked.emit(collection);\n }\n\n clearSelections() {\n this.selectedAll = false;\n this.selectedFavorites = false;\n this.selectedType = null;\n this.selectedFolder = false;\n this.selectedFolderId = null;\n this.selectedCollectionId = null;\n }\n}\n","
\n
\n {{'verifyEmail' | i18n}}\n
\n
\n

{{'verifyEmailDesc' | i18n}}

\n \n
\n
\n","
\n
\n
\n \n \n
\n \n
\n
\n
\n {{'updateKeyTitle' | i18n}}\n
\n
\n

{{'updateEncryptionKeyShortDesc' | i18n}}

\n \n
\n
\n \n
\n
\n {{'updateBrowser' | i18n}}\n
\n
\n

{{'updateBrowserDesc' | i18n}}

\n \n {{'updateBrowser' | i18n}}\n \n
\n
\n
\n
\n {{'goPremium' | i18n}}\n
\n
\n

{{'premiumUpgradeUnlockFeatures' | i18n}}

\n \n {{'goPremium' | i18n}}\n \n
\n
\n
\n
\n {{'organizations' | i18n}}\n \n \n \n
\n
\n \n
\n
\n
\n
\n
\n\n\n\n\n\n\n\n\n\n","\r\n\r\n\r\n","export class VerifyDeleteRecoverRequest {\n userId: string;\n token: string;\n\n constructor(userId: string, token: string) {\n this.userId = userId;\n this.token = token;\n }\n}\n","
\n
\n
\n

{{'deleteAccount' | i18n}}

\n
\n
\n {{'deleteAccountWarning' | i18n}}\n

\n {{email}}\n

\n

{{'deleteRecoverConfirmDesc' | i18n}}

\n
\n
\n \n \n {{'cancel' | i18n}}\n \n
\n
\n
\n
\n
\n
\n","export class DeleteRecoverRequest {\n email: string;\n}\n","
\n
\n
\n

{{'deleteAccount' | i18n}}

\n
\n
\n

{{'deleteRecoverDesc' | i18n}}

\n
\n \n \n
\n
\n
\n \n \n {{'cancel' | i18n}}\n \n
\n
\n
\n
\n
\n
\n","import { PasswordVerificationRequest } from './passwordVerificationRequest';\n\nexport class TwoFactorRecoveryRequest extends PasswordVerificationRequest {\n recoveryCode: string;\n email: string;\n}\n","
\n
\n
\n

{{'recoverAccountTwoStep' | i18n}}

\n
\n
\n

{{'recoverAccountTwoStepDesc' | i18n}}\n {{'learnMore' | i18n}}\n

\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n
\n \n \n {{'cancel' | i18n}}\n \n
\n
\n
\n
\n
\n
\n","export class OrganizationUserAcceptRequest {\n token: string;\n}\n","
\n
\n \"Bitwarden\"\n

\n \n

\n
\n
\n
\n
\n
\n

{{'joinOrganization' | i18n}}

\n
\n
\n

\n {{orgName}}\n {{email}}\n

\n

{{'joinOrganizationDesc' | i18n}}

\n
\n \n
\n
\n
\n
\n
\n","export class VerifyEmailRequest {\n userId: string;\n token: string;\n\n constructor(userId: string, token: string) {\n this.userId = userId;\n this.token = token;\n }\n}\n","
\n
\n \"Bitwarden\"\n

\n \n

\n
\n
\n","import { Router } from '@angular/router';\r\n\r\nimport { ToasterService } from 'angular2-toaster';\r\nimport { Angulartics2 } from 'angulartics2';\r\n\r\nimport { CryptoService } from '../../abstractions/crypto.service';\r\nimport { I18nService } from '../../abstractions/i18n.service';\r\nimport { MessagingService } from '../../abstractions/messaging.service';\r\nimport { PlatformUtilsService } from '../../abstractions/platformUtils.service';\r\nimport { UserService } from '../../abstractions/user.service';\r\n\r\nexport class LockComponent {\r\n masterPassword: string = '';\r\n showPassword: boolean = false;\r\n\r\n protected successRoute: string = 'vault';\r\n\r\n constructor(protected router: Router, protected analytics: Angulartics2,\r\n protected toasterService: ToasterService, protected i18nService: I18nService,\r\n protected platformUtilsService: PlatformUtilsService, protected messagingService: MessagingService,\r\n protected userService: UserService, protected cryptoService: CryptoService) { }\r\n\r\n async submit() {\r\n if (this.masterPassword == null || this.masterPassword === '') {\r\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'),\r\n this.i18nService.t('masterPassRequired'));\r\n return;\r\n }\r\n\r\n const email = await this.userService.getEmail();\r\n const key = await this.cryptoService.makeKey(this.masterPassword, email);\r\n const keyHash = await this.cryptoService.hashPassword(this.masterPassword, key);\r\n const storedKeyHash = await this.cryptoService.getKeyHash();\r\n\r\n if (storedKeyHash != null && keyHash != null && storedKeyHash === keyHash) {\r\n await this.cryptoService.setKey(key);\r\n this.messagingService.send('unlocked');\r\n this.router.navigate([this.successRoute]);\r\n } else {\r\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'),\r\n this.i18nService.t('invalidMasterPassword'));\r\n }\r\n }\r\n\r\n async logOut() {\r\n const confirmed = await this.platformUtilsService.showDialog(this.i18nService.t('logOutConfirmation'),\r\n this.i18nService.t('logOut'), this.i18nService.t('logOut'), this.i18nService.t('cancel'));\r\n if (confirmed) {\r\n this.messagingService.send('logout');\r\n }\r\n }\r\n\r\n togglePassword() {\r\n this.analytics.eventTrack.next({ action: 'Toggled Master Password on Unlock' });\r\n this.showPassword = !this.showPassword;\r\n document.getElementById('masterPassword').focus();\r\n }\r\n}\r\n","
\n
\n
\n

\n \n

\n

{{'yourVaultIsLocked' | i18n}}

\n
\n
\n
\n \n
\n \n \n
\n
\n
\n
\n \n \n
\n
\n
\n
\n
\n
\n","export class PasswordHintRequest {\r\n email: string;\r\n\r\n constructor(email: string) {\r\n this.email = email;\r\n }\r\n}\r\n","import { Router } from '@angular/router';\r\n\r\nimport { ToasterService } from 'angular2-toaster';\r\nimport { Angulartics2 } from 'angulartics2';\r\n\r\nimport { PasswordHintRequest } from '../../models/request/passwordHintRequest';\r\n\r\nimport { ApiService } from '../../abstractions/api.service';\r\nimport { I18nService } from '../../abstractions/i18n.service';\r\n\r\nexport class HintComponent {\r\n email: string = '';\r\n formPromise: Promise;\r\n\r\n protected successRoute = 'login';\r\n\r\n constructor(protected router: Router, protected analytics: Angulartics2,\r\n protected toasterService: ToasterService, protected i18nService: I18nService,\r\n protected apiService: ApiService) { }\r\n\r\n async submit() {\r\n if (this.email == null || this.email === '') {\r\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'),\r\n this.i18nService.t('emailRequired'));\r\n return;\r\n }\r\n if (this.email.indexOf('@') === -1) {\r\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'),\r\n this.i18nService.t('invalidEmail'));\r\n return;\r\n }\r\n\r\n try {\r\n this.formPromise = this.apiService.postPasswordHint(new PasswordHintRequest(this.email));\r\n await this.formPromise;\r\n this.analytics.eventTrack.next({ action: 'Requested Hint' });\r\n this.toasterService.popAsync('success', null, this.i18nService.t('masterPassSent'));\r\n this.router.navigate([this.successRoute]);\r\n } catch { }\r\n }\r\n}\r\n","
\n
\n
\n

{{'passwordHint' | i18n}}

\n
\n
\n
\n \n \n {{'enterEmailToGetHint' | i18n}}\n
\n
\n
\n \n \n {{'cancel' | i18n}}\n \n
\n
\n
\n
\n
\n
\n","import { KeysRequest } from './keysRequest';\n\nexport class RegisterRequest {\n name: string;\n email: string;\n masterPasswordHash: string;\n masterPasswordHint: string;\n key: string;\n keys: KeysRequest;\n token: string;\n organizationUserId: string;\n\n constructor(email: string, name: string, masterPasswordHash: string, masterPasswordHint: string, key: string) {\n this.name = name;\n this.email = email;\n this.masterPasswordHash = masterPasswordHash;\n this.masterPasswordHint = masterPasswordHint ? masterPasswordHint : null;\n this.key = key;\n }\n}\n","import { Router } from '@angular/router';\r\n\r\nimport { ToasterService } from 'angular2-toaster';\r\nimport { Angulartics2 } from 'angulartics2';\r\n\r\nimport { KeysRequest } from '../../models/request/keysRequest';\r\nimport { RegisterRequest } from '../../models/request/registerRequest';\r\n\r\nimport { ApiService } from '../../abstractions/api.service';\r\nimport { AuthService } from '../../abstractions/auth.service';\r\nimport { CryptoService } from '../../abstractions/crypto.service';\r\nimport { I18nService } from '../../abstractions/i18n.service';\r\nimport { StateService } from '../../abstractions/state.service';\r\n\r\nexport class RegisterComponent {\r\n name: string = '';\r\n email: string = '';\r\n masterPassword: string = '';\r\n confirmMasterPassword: string = '';\r\n hint: string = '';\r\n showPassword: boolean = false;\r\n formPromise: Promise;\r\n\r\n protected successRoute = 'login';\r\n\r\n constructor(protected authService: AuthService, protected router: Router,\r\n protected analytics: Angulartics2, protected toasterService: ToasterService,\r\n protected i18nService: I18nService, protected cryptoService: CryptoService,\r\n protected apiService: ApiService, protected stateService: StateService) { }\r\n\r\n async submit() {\r\n if (this.email == null || this.email === '') {\r\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'),\r\n this.i18nService.t('emailRequired'));\r\n return;\r\n }\r\n if (this.email.indexOf('@') === -1) {\r\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'),\r\n this.i18nService.t('invalidEmail'));\r\n return;\r\n }\r\n if (this.masterPassword == null || this.masterPassword === '') {\r\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'),\r\n this.i18nService.t('masterPassRequired'));\r\n return;\r\n }\r\n if (this.masterPassword.length < 8) {\r\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'),\r\n this.i18nService.t('masterPassLength'));\r\n return;\r\n }\r\n if (this.masterPassword !== this.confirmMasterPassword) {\r\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'),\r\n this.i18nService.t('masterPassDoesntMatch'));\r\n return;\r\n }\r\n\r\n this.name = this.name === '' ? null : this.name;\r\n this.email = this.email.toLowerCase();\r\n const key = await this.cryptoService.makeKey(this.masterPassword, this.email);\r\n const encKey = await this.cryptoService.makeEncKey(key);\r\n const hashedPassword = await this.cryptoService.hashPassword(this.masterPassword, key);\r\n const keys = await this.cryptoService.makeKeyPair(encKey[0]);\r\n const request = new RegisterRequest(this.email, this.name, hashedPassword,\r\n this.hint, encKey[1].encryptedString);\r\n request.keys = new KeysRequest(keys[0], keys[1].encryptedString);\r\n const orgInvite = await this.stateService.get('orgInvitation');\r\n if (orgInvite != null && orgInvite.token != null && orgInvite.organizationUserId != null) {\r\n request.token = orgInvite.token;\r\n request.organizationUserId = orgInvite.organizationUserId;\r\n }\r\n\r\n try {\r\n this.formPromise = this.apiService.postRegister(request);\r\n await this.formPromise;\r\n this.analytics.eventTrack.next({ action: 'Registered' });\r\n this.toasterService.popAsync('success', null, this.i18nService.t('newAccountCreated'));\r\n this.router.navigate([this.successRoute], { queryParams: { email: this.email } });\r\n } catch { }\r\n }\r\n\r\n togglePassword(confirmField: boolean) {\r\n this.analytics.eventTrack.next({ action: 'Toggled Master Password on Register' });\r\n this.showPassword = !this.showPassword;\r\n document.getElementById(confirmField ? 'masterPasswordRetype' : 'masterPassword').focus();\r\n }\r\n}\r\n","
\n
\n
\n

{{'createAccount' | i18n}}

\n
\n
\n \n {{'createOrganizationCreatePersonalAccount' | i18n}}\n \n
\n \n \n {{'emailAddressDesc' | i18n}}\n
\n
\n \n \n {{'yourNameDesc' | i18n}}\n
\n
\n \n
\n \n \n
\n {{'masterPassDesc' | i18n}}\n
\n
\n \n
\n \n \n
\n
\n
\n \n \n {{'masterPassHintDesc' | i18n}}\n
\n
\n
\n \n \n {{'cancel' | i18n}}\n \n
\n \n {{'submitAgreePolicies' | i18n}}\n {{'termsOfService' | i18n}},\n {{'privacyPolicy' | i18n}}\n \n
\n
\n
\n
\n
\n","export class U2f {\r\n private iframe: HTMLIFrameElement = null;\r\n private connectorLink: HTMLAnchorElement;\r\n private parseFunction = this.parseMessage.bind(this);\r\n\r\n constructor(private win: Window, private webVaultUrl: string, private successCallback: Function,\r\n private errorCallback: Function, private infoCallback: Function) {\r\n this.connectorLink = win.document.createElement('a');\r\n this.webVaultUrl = webVaultUrl != null && webVaultUrl !== '' ? webVaultUrl : 'https://vault.bitwarden.com';\r\n }\r\n\r\n init(data: any): void {\r\n this.connectorLink.href = this.webVaultUrl + '/u2f-connector.html' +\r\n '?data=' + this.base64Encode(JSON.stringify(data)) +\r\n '&parent=' + encodeURIComponent(this.win.document.location.href) +\r\n '&v=1';\r\n\r\n this.iframe = this.win.document.getElementById('u2f_iframe') as HTMLIFrameElement;\r\n this.iframe.src = this.connectorLink.href;\r\n\r\n this.win.addEventListener('message', this.parseFunction, false);\r\n }\r\n\r\n stop() {\r\n this.sendMessage('stop');\r\n }\r\n\r\n start() {\r\n this.sendMessage('start');\r\n }\r\n\r\n sendMessage(message: any) {\r\n if (!this.iframe || !this.iframe.src || !this.iframe.contentWindow) {\r\n return;\r\n }\r\n\r\n this.iframe.contentWindow.postMessage(message, this.iframe.src);\r\n }\r\n\r\n base64Encode(str: string): string {\r\n return btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, (match, p1) => {\r\n return String.fromCharCode(('0x' + p1) as any);\r\n }));\r\n }\r\n\r\n cleanup() {\r\n this.win.removeEventListener('message', this.parseFunction, false);\r\n }\r\n\r\n private parseMessage(event: MessageEvent) {\r\n if (!this.validMessage(event)) {\r\n return;\r\n }\r\n\r\n const parts: string[] = event.data.split('|');\r\n if (parts[0] === 'success' && this.successCallback) {\r\n this.successCallback(parts[1]);\r\n } else if (parts[0] === 'error' && this.errorCallback) {\r\n this.errorCallback(parts[1]);\r\n } else if (parts[0] === 'info' && this.infoCallback) {\r\n this.infoCallback(parts[1]);\r\n }\r\n }\r\n\r\n private validMessage(event: MessageEvent) {\r\n if (event.origin == null || event.origin === '' || event.origin !== (this.connectorLink as any).origin ||\r\n event.data == null || typeof (event.data) !== 'string') {\r\n return false;\r\n }\r\n\r\n return event.data.indexOf('success|') === 0 || event.data.indexOf('error|') === 0 ||\r\n event.data.indexOf('info|') === 0;\r\n }\r\n}\r\n","import { TwoFactorProviderType } from '../../enums/twoFactorProviderType';\n\nimport { DeviceRequest } from './deviceRequest';\r\n\r\nexport class TokenRequest {\r\n email: string;\r\n masterPasswordHash: string;\r\n token: string;\r\n provider: TwoFactorProviderType;\r\n remember: boolean;\r\n device?: DeviceRequest;\r\n\r\n constructor(email: string, masterPasswordHash: string, provider: TwoFactorProviderType,\r\n token: string, remember: boolean, device?: DeviceRequest) {\r\n this.email = email;\r\n this.masterPasswordHash = masterPasswordHash;\r\n this.token = token;\r\n this.provider = provider;\r\n this.remember = remember;\r\n this.device = device != null ? device : null;\r\n }\r\n\r\n toIdentityToken(clientId: string) {\r\n const obj: any = {\r\n grant_type: 'password',\r\n username: this.email,\r\n password: this.masterPasswordHash,\r\n scope: 'api offline_access',\r\n client_id: clientId,\r\n };\r\n\r\n if (this.device) {\r\n obj.deviceType = this.device.type;\r\n obj.deviceIdentifier = this.device.identifier;\r\n obj.deviceName = this.device.name;\r\n // no push tokens for browser apps yet\r\n // obj.devicePushToken = this.device.pushToken;\r\n }\r\n\r\n if (this.token && this.provider !== null && (typeof this.provider !== 'undefined')) {\r\n obj.twoFactorToken = this.token;\r\n obj.twoFactorProvider = this.provider;\r\n obj.twoFactorRemember = this.remember ? '1' : '0';\r\n }\r\n\r\n return obj;\r\n }\r\n}\r\n","import { DeviceType } from '../../enums/deviceType';\r\n\r\nimport { PlatformUtilsService } from '../../abstractions/platformUtils.service';\r\n\r\nexport class DeviceRequest {\r\n type: DeviceType;\r\n name: string;\r\n identifier: string;\r\n pushToken?: string;\r\n\r\n constructor(appId: string, platformUtilsService: PlatformUtilsService) {\r\n this.type = platformUtilsService.getDevice();\r\n this.name = platformUtilsService.getDeviceString();\r\n this.identifier = appId;\r\n this.pushToken = null;\r\n }\r\n}\r\n","import { TwoFactorProviderType } from '../../enums/twoFactorProviderType';\r\n\r\nexport class AuthResult {\r\n twoFactor: boolean = false;\r\n twoFactorProviders: Map = null;\r\n}\r\n","import {\r\n OnDestroy,\r\n OnInit,\r\n} from '@angular/core';\r\nimport { Router } from '@angular/router';\r\n\r\nimport { ToasterService } from 'angular2-toaster';\r\nimport { Angulartics2 } from 'angulartics2';\r\n\r\nimport { DeviceType } from '../../enums/deviceType';\r\nimport { TwoFactorProviderType } from '../../enums/twoFactorProviderType';\r\n\r\nimport { TwoFactorEmailRequest } from '../../models/request/twoFactorEmailRequest';\r\n\r\nimport { ApiService } from '../../abstractions/api.service';\r\nimport { AuthService } from '../../abstractions/auth.service';\r\nimport { EnvironmentService } from '../../abstractions/environment.service';\r\nimport { I18nService } from '../../abstractions/i18n.service';\r\nimport { PlatformUtilsService } from '../../abstractions/platformUtils.service';\r\n\r\nimport { TwoFactorProviders } from '../../services/auth.service';\r\n\r\nimport * as DuoWebSDK from '../../misc/duo';\r\nimport { U2f } from '../../misc/u2f';\r\n\r\nexport class TwoFactorComponent implements OnInit, OnDestroy {\r\n token: string = '';\r\n remember: boolean = false;\r\n u2fReady: boolean = false;\r\n providers = TwoFactorProviders;\r\n providerType = TwoFactorProviderType;\r\n selectedProviderType: TwoFactorProviderType = TwoFactorProviderType.Authenticator;\r\n u2fSupported: boolean = false;\r\n u2f: U2f = null;\r\n title: string = '';\r\n twoFactorEmail: string = null;\r\n formPromise: Promise;\r\n emailPromise: Promise;\r\n onSuccessfulLogin: () => Promise;\r\n onSuccessfulLoginNavigate: () => Promise;\r\n\r\n protected loginRoute = 'login';\r\n protected successRoute = 'vault';\r\n\r\n constructor(protected authService: AuthService, protected router: Router,\r\n protected analytics: Angulartics2, protected toasterService: ToasterService,\r\n protected i18nService: I18nService, protected apiService: ApiService,\r\n protected platformUtilsService: PlatformUtilsService, protected win: Window,\r\n protected environmentService: EnvironmentService) {\r\n this.u2fSupported = this.platformUtilsService.supportsU2f(win);\r\n }\r\n\r\n async ngOnInit() {\r\n if (this.authService.email == null || this.authService.masterPasswordHash == null ||\r\n this.authService.twoFactorProviders == null) {\r\n this.router.navigate([this.loginRoute]);\r\n return;\r\n }\r\n\r\n if (this.win != null && this.u2fSupported) {\r\n let customWebVaultUrl: string = null;\r\n if (this.environmentService.baseUrl != null) {\r\n customWebVaultUrl = this.environmentService.baseUrl;\r\n } else if (this.environmentService.webVaultUrl != null) {\r\n customWebVaultUrl = this.environmentService.webVaultUrl;\r\n }\r\n\r\n this.u2f = new U2f(this.win, customWebVaultUrl, (token: string) => {\r\n this.token = token;\r\n this.submit();\r\n }, (error: string) => {\r\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'), error);\r\n }, (info: string) => {\r\n if (info === 'ready') {\r\n this.u2fReady = true;\r\n }\r\n });\r\n }\r\n\r\n this.selectedProviderType = this.authService.getDefaultTwoFactorProvider(this.u2fSupported);\r\n await this.init();\r\n }\r\n\r\n ngOnDestroy(): void {\r\n this.cleanupU2f();\r\n this.u2f = null;\r\n }\r\n\r\n async init() {\r\n if (this.selectedProviderType == null) {\r\n this.title = this.i18nService.t('loginUnavailable');\r\n return;\r\n }\r\n\r\n this.cleanupU2f();\r\n this.title = (TwoFactorProviders as any)[this.selectedProviderType].name;\r\n const params = this.authService.twoFactorProviders.get(this.selectedProviderType);\r\n switch (this.selectedProviderType) {\r\n case TwoFactorProviderType.U2f:\r\n if (!this.u2fSupported || this.u2f == null) {\r\n break;\r\n }\r\n\r\n const challenges = JSON.parse(params.Challenges);\r\n if (challenges.length > 0) {\r\n this.u2f.init({\r\n appId: challenges[0].appId,\r\n challenge: challenges[0].challenge,\r\n keys: [{\r\n version: challenges[0].version,\r\n keyHandle: challenges[0].keyHandle,\r\n }],\r\n });\r\n }\r\n break;\r\n case TwoFactorProviderType.Duo:\r\n case TwoFactorProviderType.OrganizationDuo:\r\n if (this.platformUtilsService.getDevice() === DeviceType.SafariExtension) {\r\n break;\r\n }\r\n\r\n setTimeout(() => {\r\n DuoWebSDK.init({\r\n iframe: undefined,\r\n host: params.Host,\r\n sig_request: params.Signature,\r\n submit_callback: async (f: HTMLFormElement) => {\r\n const sig = f.querySelector('input[name=\"sig_response\"]') as HTMLInputElement;\r\n if (sig != null) {\r\n this.token = sig.value;\r\n await this.submit();\r\n }\r\n },\r\n });\r\n }, 0);\r\n break;\r\n case TwoFactorProviderType.Email:\r\n this.twoFactorEmail = params.Email;\r\n if (this.authService.twoFactorProviders.size > 1) {\r\n await this.sendEmail(false);\r\n }\r\n break;\r\n default:\r\n break;\r\n }\r\n }\r\n\r\n async submit() {\r\n if (this.token == null || this.token === '') {\r\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'),\r\n this.i18nService.t('verificationCodeRequired'));\r\n return;\r\n }\r\n\r\n if (this.selectedProviderType === TwoFactorProviderType.U2f) {\r\n if (this.u2f != null) {\r\n this.u2f.stop();\r\n } else {\r\n return;\r\n }\r\n } else if (this.selectedProviderType === TwoFactorProviderType.Email ||\r\n this.selectedProviderType === TwoFactorProviderType.Authenticator) {\r\n this.token = this.token.replace(' ', '').trim();\r\n }\r\n\r\n try {\r\n this.formPromise = this.authService.logInTwoFactor(this.selectedProviderType, this.token, this.remember);\r\n await this.formPromise;\r\n if (this.onSuccessfulLogin != null) {\r\n this.onSuccessfulLogin();\r\n }\r\n this.analytics.eventTrack.next({ action: 'Logged In From Two-step' });\r\n if (this.onSuccessfulLoginNavigate != null) {\r\n this.onSuccessfulLoginNavigate();\r\n } else {\r\n this.router.navigate([this.successRoute]);\r\n }\r\n } catch (e) {\r\n if (this.selectedProviderType === TwoFactorProviderType.U2f && this.u2f != null) {\r\n this.u2f.start();\r\n } else {\r\n throw e;\r\n }\r\n }\r\n }\r\n\r\n async sendEmail(doToast: boolean) {\r\n if (this.selectedProviderType !== TwoFactorProviderType.Email) {\r\n return;\r\n }\r\n\r\n if (this.emailPromise != null) {\r\n return;\r\n }\r\n\r\n try {\r\n const request = new TwoFactorEmailRequest(this.authService.email, this.authService.masterPasswordHash);\r\n this.emailPromise = this.apiService.postTwoFactorEmail(request);\r\n await this.emailPromise;\r\n if (doToast) {\r\n this.toasterService.popAsync('success', null,\r\n this.i18nService.t('verificationCodeEmailSent', this.twoFactorEmail));\r\n }\r\n } catch { }\r\n\r\n this.emailPromise = null;\r\n }\r\n\r\n private cleanupU2f() {\r\n if (this.u2f != null) {\r\n this.u2f.stop();\r\n this.u2f.cleanup();\r\n }\r\n }\r\n}\r\n","import {\r\n Component,\r\n ComponentFactoryResolver,\r\n EventEmitter,\r\n OnDestroy,\r\n Output,\r\n Type,\r\n ViewChild,\r\n ViewContainerRef,\r\n} from '@angular/core';\r\n\r\n@Component({\r\n selector: 'app-modal',\r\n template: ``,\r\n})\r\nexport class ModalComponent implements OnDestroy {\r\n @Output() onClose = new EventEmitter();\r\n @Output() onClosed = new EventEmitter();\r\n @Output() onShow = new EventEmitter();\r\n @Output() onShown = new EventEmitter();\r\n @ViewChild('container', { read: ViewContainerRef }) container: ViewContainerRef;\r\n parentContainer: ViewContainerRef = null;\r\n fade: boolean = true;\r\n\r\n constructor(protected componentFactoryResolver: ComponentFactoryResolver) { }\r\n\r\n ngOnDestroy() {\r\n document.body.classList.remove('modal-open');\r\n document.body.removeChild(document.querySelector('.modal-backdrop'));\r\n }\r\n\r\n show(type: Type, parentContainer: ViewContainerRef, fade: boolean = true): T {\r\n this.onShow.emit();\r\n this.parentContainer = parentContainer;\r\n this.fade = fade;\r\n\r\n document.body.classList.add('modal-open');\r\n const backdrop = document.createElement('div');\r\n backdrop.className = 'modal-backdrop' + (this.fade ? ' fade' : '');\r\n document.body.appendChild(backdrop);\r\n\r\n const factory = this.componentFactoryResolver.resolveComponentFactory(type);\r\n const componentRef = this.container.createComponent(factory);\r\n\r\n document.querySelector('.modal-dialog').addEventListener('click', (e: Event) => {\r\n e.stopPropagation();\r\n });\r\n\r\n const modals = Array.from(document.querySelectorAll('.modal, .modal *[data-dismiss=\"modal\"]'));\r\n for (const closeElement of modals) {\r\n closeElement.addEventListener('click', (event) => {\r\n this.close();\r\n });\r\n }\r\n\r\n this.onShown.emit();\r\n return componentRef.instance;\r\n }\r\n\r\n close() {\r\n this.onClose.emit();\r\n this.onClosed.emit();\r\n if (this.parentContainer != null) {\r\n this.parentContainer.clear();\r\n }\r\n }\r\n}\r\n","import {\n EventEmitter,\n Input,\n OnInit,\n Output,\n} from '@angular/core';\nimport { Router } from '@angular/router';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { TwoFactorProviderType } from '../../enums/twoFactorProviderType';\n\nimport { AuthService } from '../../abstractions/auth.service';\nimport { I18nService } from '../../abstractions/i18n.service';\nimport { PlatformUtilsService } from '../../abstractions/platformUtils.service';\n\nimport { TwoFactorProviders } from '../../services/auth.service';\n\nexport class TwoFactorOptionsComponent implements OnInit {\n @Output() onProviderSelected = new EventEmitter();\n @Output() onRecoverSelected = new EventEmitter();\n\n providers: any[] = [];\n\n constructor(protected authService: AuthService, protected router: Router,\n protected analytics: Angulartics2, protected toasterService: ToasterService,\n protected i18nService: I18nService, protected platformUtilsService: PlatformUtilsService,\n protected win: Window) { }\n\n ngOnInit() {\n this.providers = this.authService.getSupportedTwoFactorProviders(this.win);\n }\n\n choose(p: any) {\n this.onProviderSelected.emit(p.type);\n }\n\n recover() {\n this.analytics.eventTrack.next({ action: 'Selected Recover' });\n this.platformUtilsService.launchUri('https://help.bitwarden.com/article/lost-two-step-device/');\n this.onRecoverSelected.emit();\n }\n}\n","
\n
\n
\n

{{title}}

\n
\n
\n \n

{{'enterVerificationCodeApp' | i18n}}

\n

\n {{'enterVerificationCodeEmail' | i18n : twoFactorEmail}}\n

\n
\n \n \n \n \n {{'sendVerificationCodeEmailAgain' | i18n}}\n \n \n
\n
\n \n

{{'insertYubiKey' | i18n}}

\n \"\"\n
\n \n \n
\n
\n \n

\n \n

\n \n

{{'insertU2f' | i18n}}

\n \"\"\n
\n
\n \n
\n \n
\n
\n \n
\n \n \n
\n \n

{{'noTwoStepProviders' | i18n}}

\n

{{'noTwoStepProviders2' | i18n}}

\n
\n
\n
\n \n \n {{'cancel' | i18n}}\n \n
\n \n
\n
\n
\n
\n
\n\n\n","import {\n Input,\n OnInit,\n} from '@angular/core';\nimport { Router } from '@angular/router';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { AuthResult } from '../../models/domain/authResult';\n\nimport { AuthService } from '../../abstractions/auth.service';\nimport { I18nService } from '../../abstractions/i18n.service';\nimport { StorageService } from '../../abstractions/storage.service';\n\nimport { Utils } from '../../misc/utils';\n\nconst Keys = {\n rememberedEmail: 'rememberedEmail',\n rememberEmail: 'rememberEmail',\n};\n\nexport class LoginComponent implements OnInit {\n @Input() email: string = '';\n @Input() rememberEmail = true;\n\n masterPassword: string = '';\n showPassword: boolean = false;\n formPromise: Promise;\n onSuccessfulLogin: () => Promise;\n onSuccessfulLoginNavigate: () => Promise;\n\n protected twoFactorRoute = '2fa';\n protected successRoute = 'vault';\n\n constructor(protected authService: AuthService, protected router: Router,\n protected analytics: Angulartics2, protected toasterService: ToasterService,\n protected i18nService: I18nService, private storageService: StorageService) { }\n\n async ngOnInit() {\n if (this.email == null || this.email === '') {\n this.email = await this.storageService.get(Keys.rememberedEmail);\n if (this.email == null) {\n this.email = '';\n }\n }\n this.rememberEmail = await this.storageService.get(Keys.rememberEmail);\n if (this.rememberEmail == null) {\n this.rememberEmail = true;\n }\n if (Utils.isBrowser) {\n document.getElementById(this.email == null || this.email === '' ? 'email' : 'masterPassword').focus();\n }\n }\n\n async submit() {\n if (this.email == null || this.email === '') {\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'),\n this.i18nService.t('emailRequired'));\n return;\n }\n if (this.email.indexOf('@') === -1) {\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'),\n this.i18nService.t('invalidEmail'));\n return;\n }\n if (this.masterPassword == null || this.masterPassword === '') {\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'),\n this.i18nService.t('masterPassRequired'));\n return;\n }\n\n try {\n this.formPromise = this.authService.logIn(this.email, this.masterPassword);\n const response = await this.formPromise;\n await this.storageService.save(Keys.rememberEmail, this.rememberEmail);\n if (this.rememberEmail) {\n await this.storageService.save(Keys.rememberedEmail, this.email);\n } else {\n await this.storageService.remove(Keys.rememberedEmail);\n }\n if (response.twoFactor) {\n this.analytics.eventTrack.next({ action: 'Logged In To Two-step' });\n this.router.navigate([this.twoFactorRoute]);\n } else {\n if (this.onSuccessfulLogin != null) {\n this.onSuccessfulLogin();\n }\n this.analytics.eventTrack.next({ action: 'Logged In' });\n if (this.onSuccessfulLoginNavigate != null) {\n this.onSuccessfulLoginNavigate();\n } else {\n this.router.navigate([this.successRoute]);\n }\n }\n } catch { }\n }\n\n togglePassword() {\n this.analytics.eventTrack.next({ action: 'Toggled Master Password on Login' });\n this.showPassword = !this.showPassword;\n document.getElementById('masterPassword').focus();\n }\n}\n","
\n
\n
\n \n

{{'loginOrCreateNewAccount' | i18n}}

\n
\n
\n
\n \n \n
\n
\n \n
\n \n \n
\n \n {{'getMasterPasswordHint' | i18n}}\n \n
\n
\n \n \n
\n
\n
\n \n \n {{'createAccount' | i18n}}\n \n
\n
\n
\n
\n
\n
\n","\n
\n © 2018, 8bit Solutions LLC\n
{{'versionNumber' | i18n : version}}\n
\n","import 'core-js';\n\nimport { ToasterModule } from 'angular2-toaster';\nimport { Angulartics2Module } from 'angulartics2';\nimport { Angulartics2GoogleAnalytics } from 'angulartics2/ga';\n\nimport { AppRoutingModule } from './app-routing.module';\n\nimport { NgModule } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { BrowserModule } from '@angular/platform-browser';\nimport { BrowserAnimationsModule } from '@angular/platform-browser/animations';\n\nimport { ServicesModule } from './services/services.module';\n\nimport { AppComponent } from './app.component';\nimport { ModalComponent } from './modal.component';\n\nimport { AvatarComponent } from './components/avatar.component';\nimport { CalloutComponent } from './components/callout.component';\n\nimport { FooterComponent } from './layouts/footer.component';\nimport { FrontendLayoutComponent } from './layouts/frontend-layout.component';\nimport { NavbarComponent } from './layouts/navbar.component';\nimport { OrganizationLayoutComponent } from './layouts/organization-layout.component';\nimport { UserLayoutComponent } from './layouts/user-layout.component';\n\nimport { AcceptOrganizationComponent } from './accounts/accept-organization.component';\nimport { HintComponent } from './accounts/hint.component';\nimport { LockComponent } from './accounts/lock.component';\nimport { LoginComponent } from './accounts/login.component';\nimport { RecoverDeleteComponent } from './accounts/recover-delete.component';\nimport { RecoverTwoFactorComponent } from './accounts/recover-two-factor.component';\nimport { RegisterComponent } from './accounts/register.component';\nimport { TwoFactorOptionsComponent } from './accounts/two-factor-options.component';\nimport { TwoFactorComponent } from './accounts/two-factor.component';\nimport { VerifyEmailTokenComponent } from './accounts/verify-email-token.component';\nimport { VerifyRecoverDeleteComponent } from './accounts/verify-recover-delete.component';\n\nimport {\n CollectionAddEditComponent as OrgCollectionAddEditComponent,\n} from './organizations/manage/collection-add-edit.component';\nimport { CollectionsComponent as OrgManageCollectionsComponent } from './organizations/manage/collections.component';\nimport { EntityEventsComponent as OrgEntityEventsComponent } from './organizations/manage/entity-events.component';\nimport { EntityUsersComponent as OrgEntityUsersComponent } from './organizations/manage/entity-users.component';\nimport { EventsComponent as OrgEventsComponent } from './organizations/manage/events.component';\nimport { GroupAddEditComponent as OrgGroupAddEditComponent } from './organizations/manage/group-add-edit.component';\nimport { GroupsComponent as OrgGroupsComponent } from './organizations/manage/groups.component';\nimport { ManageComponent as OrgManageComponent } from './organizations/manage/manage.component';\nimport { PeopleComponent as OrgPeopleComponent } from './organizations/manage/people.component';\nimport { UserAddEditComponent as OrgUserAddEditComponent } from './organizations/manage/user-add-edit.component';\nimport { UserGroupsComponent as OrgUserGroupsComponent } from './organizations/manage/user-groups.component';\n\nimport { AccountComponent as OrgAccountComponent } from './organizations/settings/account.component';\nimport { AdjustSeatsComponent } from './organizations/settings/adjust-seats.component';\nimport { DeleteOrganizationComponent } from './organizations/settings/delete-organization.component';\nimport { OrganizationBillingComponent } from './organizations/settings/organization-billing.component';\nimport { SettingsComponent as OrgSettingComponent } from './organizations/settings/settings.component';\nimport {\n TwoFactorSetupComponent as OrgTwoFactorSetupComponent,\n} from './organizations/settings/two-factor-setup.component';\n\nimport { ExportComponent as OrgExportComponent } from './organizations/tools/export.component';\nimport { ImportComponent as OrgImportComponent } from './organizations/tools/import.component';\nimport { ToolsComponent as OrgToolsComponent } from './organizations/tools/tools.component';\n\nimport { AddEditComponent as OrgAddEditComponent } from './organizations/vault/add-edit.component';\nimport { AttachmentsComponent as OrgAttachmentsComponent } from './organizations/vault/attachments.component';\nimport { CiphersComponent as OrgCiphersComponent } from './organizations/vault/ciphers.component';\nimport { CollectionsComponent as OrgCollectionsComponent } from './organizations/vault/collections.component';\nimport { GroupingsComponent as OrgGroupingsComponent } from './organizations/vault/groupings.component';\nimport { VaultComponent as OrgVaultComponent } from './organizations/vault/vault.component';\n\nimport { AccountComponent } from './settings/account.component';\nimport { AdjustPaymentComponent } from './settings/adjust-payment.component';\nimport { AdjustStorageComponent } from './settings/adjust-storage.component';\nimport { ChangeEmailComponent } from './settings/change-email.component';\nimport { ChangePasswordComponent } from './settings/change-password.component';\nimport { CreateOrganizationComponent } from './settings/create-organization.component';\nimport { DeauthorizeSessionsComponent } from './settings/deauthorize-sessions.component';\nimport { DeleteAccountComponent } from './settings/delete-account.component';\nimport { DomainRulesComponent } from './settings/domain-rules.component';\nimport { OptionsComponent } from './settings/options.component';\nimport { OrganizationsComponent } from './settings/organizations.component';\nimport { PaymentComponent } from './settings/payment.component';\nimport { PremiumComponent } from './settings/premium.component';\nimport { ProfileComponent } from './settings/profile.component';\nimport { PurgeVaultComponent } from './settings/purge-vault.component';\nimport { SettingsComponent } from './settings/settings.component';\nimport { TwoFactorAuthenticatorComponent } from './settings/two-factor-authenticator.component';\nimport { TwoFactorDuoComponent } from './settings/two-factor-duo.component';\nimport { TwoFactorEmailComponent } from './settings/two-factor-email.component';\nimport { TwoFactorRecoveryComponent } from './settings/two-factor-recovery.component';\nimport { TwoFactorSetupComponent } from './settings/two-factor-setup.component';\nimport { TwoFactorU2fComponent } from './settings/two-factor-u2f.component';\nimport { TwoFactorVerifyComponent } from './settings/two-factor-verify.component';\nimport { TwoFactorYubiKeyComponent } from './settings/two-factor-yubikey.component';\nimport { UpdateKeyComponent } from './settings/update-key.component';\nimport { UpdateLicenseComponent } from './settings/update-license.component';\nimport { UserBillingComponent } from './settings/user-billing.component';\nimport { VerifyEmailComponent } from './settings/verify-email.component';\n\nimport { BreachReportComponent } from './tools/breach-report.component';\nimport { ExportComponent } from './tools/export.component';\nimport { ImportComponent } from './tools/import.component';\nimport { PasswordGeneratorHistoryComponent } from './tools/password-generator-history.component';\nimport { PasswordGeneratorComponent } from './tools/password-generator.component';\nimport { ToolsComponent } from './tools/tools.component';\n\nimport { AddEditComponent } from './vault/add-edit.component';\nimport { AttachmentsComponent } from './vault/attachments.component';\nimport { BulkDeleteComponent } from './vault/bulk-delete.component';\nimport { BulkMoveComponent } from './vault/bulk-move.component';\nimport { BulkShareComponent } from './vault/bulk-share.component';\nimport { CiphersComponent } from './vault/ciphers.component';\nimport { CollectionsComponent } from './vault/collections.component';\nimport { FolderAddEditComponent } from './vault/folder-add-edit.component';\nimport { GroupingsComponent } from './vault/groupings.component';\nimport { ShareComponent } from './vault/share.component';\nimport { VaultComponent } from './vault/vault.component';\n\nimport { IconComponent } from 'jslib/angular/components/icon.component';\n\nimport { ApiActionDirective } from 'jslib/angular/directives/api-action.directive';\nimport { AutofocusDirective } from 'jslib/angular/directives/autofocus.directive';\nimport { BlurClickDirective } from 'jslib/angular/directives/blur-click.directive';\nimport { BoxRowDirective } from 'jslib/angular/directives/box-row.directive';\nimport { FallbackSrcDirective } from 'jslib/angular/directives/fallback-src.directive';\nimport { InputVerbatimDirective } from 'jslib/angular/directives/input-verbatim.directive';\nimport { StopClickDirective } from 'jslib/angular/directives/stop-click.directive';\nimport { StopPropDirective } from 'jslib/angular/directives/stop-prop.directive';\nimport { TrueFalseValueDirective } from 'jslib/angular/directives/true-false-value.directive';\n\nimport { I18nPipe } from 'jslib/angular/pipes/i18n.pipe';\nimport { SearchCiphersPipe } from 'jslib/angular/pipes/search-ciphers.pipe';\nimport { SearchPipe } from 'jslib/angular/pipes/search.pipe';\n\nimport { registerLocaleData } from '@angular/common';\nimport localeDa from '@angular/common/locales/da';\nimport localeSk from '@angular/common/locales/sk';\n\nregisterLocaleData(localeDa, 'da');\nregisterLocaleData(localeSk, 'sk');\n\n@NgModule({\n imports: [\n BrowserModule,\n BrowserAnimationsModule,\n FormsModule,\n AppRoutingModule,\n ServicesModule,\n Angulartics2Module.forRoot([Angulartics2GoogleAnalytics], {\n pageTracking: {\n clearQueryParams: true,\n },\n }),\n ToasterModule,\n ],\n declarations: [\n AcceptOrganizationComponent,\n AccountComponent,\n AddEditComponent,\n AdjustPaymentComponent,\n AdjustSeatsComponent,\n AdjustStorageComponent,\n ApiActionDirective,\n AppComponent,\n AttachmentsComponent,\n AutofocusDirective,\n AvatarComponent,\n BlurClickDirective,\n BoxRowDirective,\n BreachReportComponent,\n BulkDeleteComponent,\n BulkMoveComponent,\n BulkShareComponent,\n CalloutComponent,\n ChangeEmailComponent,\n ChangePasswordComponent,\n CiphersComponent,\n CollectionsComponent,\n CreateOrganizationComponent,\n DeauthorizeSessionsComponent,\n DeleteAccountComponent,\n DeleteOrganizationComponent,\n DomainRulesComponent,\n ExportComponent,\n FallbackSrcDirective,\n FolderAddEditComponent,\n FooterComponent,\n FrontendLayoutComponent,\n GroupingsComponent,\n HintComponent,\n IconComponent,\n I18nPipe,\n ImportComponent,\n InputVerbatimDirective,\n LockComponent,\n LoginComponent,\n ModalComponent,\n NavbarComponent,\n OptionsComponent,\n OrgAccountComponent,\n OrgAddEditComponent,\n OrganizationBillingComponent,\n OrgAttachmentsComponent,\n OrgCiphersComponent,\n OrgCollectionAddEditComponent,\n OrgCollectionsComponent,\n OrgEntityEventsComponent,\n OrgEntityUsersComponent,\n OrgEventsComponent,\n OrgExportComponent,\n OrgImportComponent,\n OrgGroupAddEditComponent,\n OrgGroupingsComponent,\n OrgGroupsComponent,\n OrgManageCollectionsComponent,\n OrgManageComponent,\n OrgPeopleComponent,\n OrgSettingComponent,\n OrgToolsComponent,\n OrgTwoFactorSetupComponent,\n OrgUserAddEditComponent,\n OrgUserGroupsComponent,\n OrganizationsComponent,\n OrganizationLayoutComponent,\n OrgVaultComponent,\n PasswordGeneratorComponent,\n PasswordGeneratorHistoryComponent,\n PaymentComponent,\n PremiumComponent,\n ProfileComponent,\n PurgeVaultComponent,\n RecoverDeleteComponent,\n RecoverTwoFactorComponent,\n RegisterComponent,\n SearchCiphersPipe,\n SearchPipe,\n SettingsComponent,\n ShareComponent,\n StopClickDirective,\n StopPropDirective,\n ToolsComponent,\n TrueFalseValueDirective,\n TwoFactorAuthenticatorComponent,\n TwoFactorComponent,\n TwoFactorDuoComponent,\n TwoFactorEmailComponent,\n TwoFactorOptionsComponent,\n TwoFactorRecoveryComponent,\n TwoFactorSetupComponent,\n TwoFactorU2fComponent,\n TwoFactorVerifyComponent,\n TwoFactorYubiKeyComponent,\n UpdateKeyComponent,\n UpdateLicenseComponent,\n UserBillingComponent,\n UserLayoutComponent,\n VaultComponent,\n VerifyEmailComponent,\n VerifyEmailTokenComponent,\n VerifyRecoverDeleteComponent,\n ],\n entryComponents: [\n AddEditComponent,\n AttachmentsComponent,\n BulkDeleteComponent,\n BulkMoveComponent,\n BulkShareComponent,\n CollectionsComponent,\n DeauthorizeSessionsComponent,\n DeleteAccountComponent,\n DeleteOrganizationComponent,\n FolderAddEditComponent,\n ModalComponent,\n OrgAddEditComponent,\n OrgAttachmentsComponent,\n OrgCollectionAddEditComponent,\n OrgCollectionsComponent,\n OrgEntityEventsComponent,\n OrgEntityUsersComponent,\n OrgGroupAddEditComponent,\n OrgUserAddEditComponent,\n OrgUserGroupsComponent,\n PasswordGeneratorHistoryComponent,\n PurgeVaultComponent,\n ShareComponent,\n TwoFactorAuthenticatorComponent,\n TwoFactorDuoComponent,\n TwoFactorEmailComponent,\n TwoFactorOptionsComponent,\n TwoFactorRecoveryComponent,\n TwoFactorU2fComponent,\n TwoFactorYubiKeyComponent,\n UpdateKeyComponent,\n ],\n providers: [],\n bootstrap: [AppComponent],\n})\nexport class AppModule { }\n","import { enableProdMode } from '@angular/core';\nimport { platformBrowserDynamic } from '@angular/platform-browser-dynamic';\n\nimport 'bootstrap';\nimport 'jquery';\nimport 'popper.js';\n\n// tslint:disable-next-line\nrequire('../scss/styles.scss');\n\nimport { AppModule } from './app.module';\n\nif (process.env.ENV === 'production') {\n enableProdMode();\n}\n\nplatformBrowserDynamic().bootstrapModule(AppModule);\n"],"sourceRoot":""} \ No newline at end of file diff --git a/app/main.7e1dd0c873724da00116.js b/app/main.7e1dd0c873724da00116.js deleted file mode 100644 index 79a93564..00000000 --- a/app/main.7e1dd0c873724da00116.js +++ /dev/null @@ -1,2 +0,0 @@ -!function(n){function l(l){for(var t,i,r=l[0],a=l[1],s=l[2],c=0,p=[];c0&&this.toasterService.popAsync("error",this.i18nService.t("errorOccurred"),e[0]),e},n}();l.ValidationService=t},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});e(0),e(17);var t=function(){function n(n,l){this.el=n,this.validationService=l}return n.prototype.ngOnChanges=function(n){var l=this;null!=this.appApiAction&&null!=this.appApiAction.then&&(this.el.nativeElement.loading=!0,this.appApiAction.then(function(n){l.el.nativeElement.loading=!1},function(n){l.el.nativeElement.loading=!1,l.validationService.showError(n)}))},n}();l.ApiActionDirective=t},,function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(){}}();l.CryptoService=t},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(){}}();l.UserService=t},,,,,function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(){}}();l.CipherService=t},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(){}}();l.MessagingService=t},,,,function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(){this.success=!1,this.ciphers=[],this.folders=[],this.folderRelationships=[],this.collections=[],this.collectionRelationships=[]}}();l.ImportResult=t},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=e(539),u=e(157),o=e(177),i=e(216),r=e(49),a=e(179),s=e(128),d=e(156),c=e(91),p=e(53),f=e(219),v=e(101),h=function(){function n(){this.organization=!1,this.newLineRegex=/(?:\r\n|\r|\n)/,this.passwordFieldNames=["password","pass word","passphrase","pass phrase","pass","code","code word","codeword","secret","secret word","personpwd","key","keyword","key word","keyphrase","key phrase","form_pw","wppassword","pin","pwd","pw","pword","passwd","p","serial","serial#","license key","reg #","passwort"],this.usernameFieldNames=["user","name","user name","username","login name","email","e-mail","id","userid","user id","login","form_loginname","wpname","mail","loginid","login id","log","personlogin","first name","last name","card#","account #","member","member #","nom","benutzername"],this.notesFieldNames=["note","notes","comment","comments","memo","description","free form","freeform","free text","freetext","free","kommentar"],this.uriFieldNames=["url","hyper link","hyperlink","link","host","hostname","host name","server","address","hyper ref","href","web","website","web site","site","web-site","uri","ort","adresse"]}return n.prototype.parseXml=function(n){var l=(new DOMParser).parseFromString(n,"application/xml");return null!=l&&null==l.querySelector("parsererror")?l:null},n.prototype.parseCsv=function(n,l){n=this.splitNewLine(n).join("\n").trim();var e=t.parse(n,{header:l,encoding:"UTF-8",skipEmptyLines:!1});return null!=e.errors&&e.errors.length>0&&e.errors.forEach(function(n){console.warn("Error parsing row "+n.row+": "+n.message)}),e.data&&e.data.length>0?e.data:null},n.prototype.parseSingleRowCsv=function(n){if(this.isNullOrWhitespace(n))return null;var l=this.parseCsv(n,!1);return null!=l&&l.length>0&&l[0].length>0?l[0]:null},n.prototype.makeUriArray=function(n){var l=this;if(null==n)return null;if("string"==typeof n){var e=new i.LoginUriView;return e.uri=this.fixUri(n),this.isNullOrWhitespace(e.uri)?null:(e.match=null,[e])}if(n.length>0){var t=[];return n.forEach(function(n){var e=new i.LoginUriView;e.uri=l.fixUri(n),l.isNullOrWhitespace(e.uri)||(e.match=null,t.push(e))}),0===t.length?null:t}return null},n.prototype.fixUri=function(n){return null==n?null:(-1===(n=n.toLowerCase().trim()).indexOf("://")&&n.indexOf(".")>=0&&(n="http://"+n),n.length>1e3?n.substring(0,1e3):n)},n.prototype.nameFromUrl=function(n){var l=r.Utils.getHostname(n);return this.isNullOrWhitespace(l)?null:l.startsWith("www.")?l.replace("www.",""):l},n.prototype.isNullOrWhitespace=function(n){return null==n||""===n.trim()},n.prototype.getValueOrDefault=function(n,l){return void 0===l&&(l=null),this.isNullOrWhitespace(n)?l:n},n.prototype.splitNewLine=function(n){return n.split(this.newLineRegex)},n.prototype.getCardBrand=function(n){if(this.isNullOrWhitespace(n))return null;var l=new RegExp("^4");return null!=n.match(l)?"Visa":/^(5[1-5][0-9]{14}|2(22[1-9][0-9]{12}|2[3-9][0-9]{13}|[3-6][0-9]{14}|7[0-1][0-9]{13}|720[0-9]{12}))$/.test(n)?"Mastercard":(l=new RegExp("^3[47]"),null!=n.match(l)?"Amex":(l=new RegExp("^(6011|622(12[6-9]|1[3-9][0-9]|[2-8][0-9]{2}|9[0-1][0-9]|92[0-5]|64[4-9])|65)"),null!=n.match(l)?"Discover":(l=new RegExp("^36"),null!=n.match(l)?"Diners Club":(l=new RegExp("^30[0-5]"),null!=n.match(l)?"Diners Club":(l=new RegExp("^35(2[89]|[3-8][0-9])"),null!=n.match(l)?"JCB":(l=new RegExp("^(4026|417500|4508|4844|491(3|7))"),null!=n.match(l)?"Visa":null))))))},n.prototype.moveFoldersToCollections=function(n){n.folderRelationships.forEach(function(l){return n.collectionRelationships.push(l)}),n.collections=n.folders.map(function(n){var l=new o.CollectionView;return l.name=n.name,l}),n.folderRelationships=[],n.folders=[]},n.prototype.querySelectorDirectChild=function(n,l){var e=this.querySelectorAllDirectChild(n,l);return 0===e.length?null:e[0]},n.prototype.querySelectorAllDirectChild=function(n,l){return Array.from(n.querySelectorAll(l)).filter(function(l){return l.parentNode===n})},n.prototype.initLoginCipher=function(){var n=new u.CipherView;return n.favorite=!1,n.notes="",n.fields=[],n.login=new d.LoginView,n.type=p.CipherType.Login,n},n.prototype.cleanupCipher=function(n){null!=n&&(n.type!==p.CipherType.Login&&(n.login=null),this.isNullOrWhitespace(n.name)&&(n.name="--"),this.isNullOrWhitespace(n.notes)?n.notes=null:n.notes=n.notes.trim(),null!=n.fields&&0===n.fields.length&&(n.fields=null))},n.prototype.processKvp=function(n,l,e){if(!this.isNullOrWhitespace(e))if(this.isNullOrWhitespace(l)&&(l=""),e.length>200||e.trim().search(this.newLineRegex)>-1)null==n.notes&&(n.notes=""),n.notes+=l+": "+this.splitNewLine(e).join("\n")+"\n";else{null==n.fields&&(n.fields=[]);var t=new a.FieldView;t.type=f.FieldType.Text,t.name=l,t.value=e,n.fields.push(t)}},n.prototype.processFolder=function(n,l){var e=n.folders.length,t=!this.isNullOrWhitespace(l),u=t;if(t)for(var o=0;o-1&&(n="http://"+n),n.startsWith("http://")||n.startsWith("https://"))try{if(null!=o)return new o(n);if("function"==typeof URL)return new URL(n);if(null!=window){var l=window.document.createElement("a");return l.href=n,l}}catch(n){}return null},l.inited=!1,l.isNode=!1,l.isBrowser=!0,l.global=null,l}();l.Utils=i,i.init()}).call(this,e(223),e(103),e(295).Buffer)},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(){}}();l.FolderService=t},,,function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0}),function(n){n[n.Login=1]="Login",n[n.SecureNote=2]="SecureNote",n[n.Card=3]="Card",n[n.Identity=4]="Identity"}(l.CipherType||(l.CipherType={}))},,,,,,,function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){function n(){}return n.prototype.onClick=function(n){n.preventDefault()},n}();l.StopClickDirective=t},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(){}}();l.StateService=t},,,,,function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(){}}();l.SyncService=t},,,,,,,function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(){}}();l.PasswordVerificationRequest=t},,,,,,,,,function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0}),function(n){n[n.Authenticator=0]="Authenticator",n[n.Email=1]="Email",n[n.Duo=2]="Duo",n[n.Yubikey=3]="Yubikey",n[n.U2f=4]="U2f",n[n.Remember=5]="Remember",n[n.OrganizationDuo=6]="OrganizationDuo"}(l.TwoFactorProviderType||(l.TwoFactorProviderType={}))},,,,,function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});e(0);var t=function(){function n(n){this.el=n}return Object.defineProperty(n.prototype,"appAutofocus",{set:function(n){this.autofocus=""===n||!0===n},enumerable:!0,configurable:!0}),n.prototype.ngOnInit=function(){this.autofocus&&this.el.nativeElement.focus()},n}();l.AutofocusDirective=t},,,,function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){function n(n){n&&(this.type=n.type)}return Object.defineProperty(n.prototype,"subTitle",{get:function(){return null},enumerable:!0,configurable:!0}),n}();l.SecureNoteView=t},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){function n(){}return n.prototype.onClick=function(n){n.stopPropagation()},n}();l.StopPropDirective=t},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)});Object.defineProperty(l,"__esModule",{value:!0});var o=e(225),i=(e(0),function(n){function l(l){var e=n.call(this,l)||this;return e.el=null,e}return u(l,n),l.prototype.ngOnDestroy=function(){},l.prototype.show=function(n,l,e){var t=this;void 0===e&&(e=!0),this.parentContainer=l,this.fade=e;var u=this.componentFactoryResolver.resolveComponentFactory(n),i=this.container.createComponent(u),r=Array.from(document.querySelectorAll(".modal"));return r.length>0&&(this.el=o(r[0]),this.el.modal("show"),this.el.on("show.bs.modal",function(){t.onShow.emit()}),this.el.on("shown.bs.modal",function(){t.onShown.emit(),t.el.find("*[appAutoFocus]").focus()}),this.el.on("hide.bs.modal",function(){t.onClose.emit()}),this.el.on("hidden.bs.modal",function(){t.onClosed.emit(),null!=t.parentContainer&&t.parentContainer.clear()})),i.instance},l.prototype.close=function(){null!=this.el&&this.el.modal("hide")},l}(e(837).ModalComponent));l.ModalComponent=i},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(){}}();l.PasswordGenerationService=t},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(){}}();l.AuthService=t},,,,,function(n,l,e){"use strict";var t=this&&this.__awaiter||function(n,l,e,t){return new(e||(e=Promise))(function(u,o){function i(n){try{a(t.next(n))}catch(n){o(n)}}function r(n){try{a(t.throw(n))}catch(n){o(n)}}function a(n){n.done?u(n.value):new e(function(l){l(n.value)}).then(i,r)}a((t=t.apply(n,l||[])).next())})},u=this&&this.__generator||function(n,l){var e,t,u,o,i={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return o={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function r(o){return function(r){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;i;)try{if(e=1,t&&(u=t[2&o[0]?"return":o[0]?"throw":"next"])&&!(u=u.call(t,o[1])).done)return u;switch(t=0,u&&(o=[0,u.value]),o[0]){case 0:case 1:u=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,t=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(u=(u=i.trys).length>0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]-1?n[i]=r||null:n[i]=r?new o.CipherString(r):null}},n.prototype.buildDataModel=function(n,l,e,t){for(var u in void 0===t&&(t=[]),e)if(e.hasOwnProperty(u)){var o=n[e[u]||u];t.indexOf(u)>-1?l[u]=null!=o?o:null:l[u]=null!=o?o.encryptedString:null}},n.prototype.decryptObj=function(n,l,e){return t(this,void 0,void 0,function(){var t,o,i;return u(this,function(u){switch(u.label){case 0:for(i in t=[],o=this,l)l.hasOwnProperty(i)&&function(u){var i=Promise.resolve().then(function(){var n=l[u]||u;return o[n]?o[n].decrypt(e):null}).then(function(l){n[u]=l});t.push(i)}(i);return[4,Promise.all(t)];case 1:return u.sent(),[2,n]}})})},n}();l.default=i},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0}),function(n){n[n.Generic=0]="Generic"}(l.SecureNoteType||(l.SecureNoteType={}))},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){function n(){this.environmentUrlsKey=n.environmentUrlsKey,this.disableGaKey=n.disableGaKey,this.disableAddLoginNotificationKey=n.disableAddLoginNotificationKey,this.disableContextMenuItemKey=n.disableContextMenuItemKey,this.disableFaviconKey=n.disableFaviconKey,this.disableAutoTotpCopyKey=n.disableAutoTotpCopyKey,this.enableAutoFillOnPageLoadKey=n.enableAutoFillOnPageLoadKey,this.lockOptionKey=n.lockOptionKey,this.lastActiveKey=n.lastActiveKey,this.neverDomainsKey=n.neverDomainsKey,this.installedVersionKey=n.installedVersionKey,this.localeKey=n.localeKey,this.themeKey=n.themeKey}return n.environmentUrlsKey="environmentUrls",n.disableGaKey="disableGa",n.disableAddLoginNotificationKey="disableAddLoginNotification",n.disableContextMenuItemKey="disableContextMenuItem",n.disableFaviconKey="disableFavicon",n.disableAutoTotpCopyKey="disableAutoTotpCopy",n.enableAutoFillOnPageLoadKey="enableAutoFillOnPageLoad",n.lockOptionKey="lockOption",n.lastActiveKey="lastActive",n.neverDomainsKey="neverDomains",n.installedVersionKey="installedVersion",n.localeKey="locale",n.themeKey="theme",n}();l.ConstantsService=t},,,,,,,,,,,,function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=e(53),u=e(536),o=e(535),i=e(534),r=e(533),a=e(532),s=e(530),d=function(){return function(n,l,e){var d=this;if(null!=n){switch(this.id=n.id,this.organizationId=n.organizationId,this.folderId=n.folderId,this.userId=l,this.edit=n.edit,this.organizationUseTotp=n.organizationUseTotp,this.favorite=n.favorite,this.revisionDate=n.revisionDate,this.type=n.type,this.name=n.name,this.notes=n.notes,this.collectionIds=null!=e?e:n.collectionIds,this.type){case t.CipherType.Login:this.login=new a.LoginData(n.login);break;case t.CipherType.SecureNote:this.secureNote=new s.SecureNoteData(n.secureNote);break;case t.CipherType.Card:this.card=new o.CardData(n.card);break;case t.CipherType.Identity:this.identity=new r.IdentityData(n.identity)}null!=n.fields&&(this.fields=[],n.fields.forEach(function(n){d.fields.push(new i.FieldData(n))})),null!=n.attachments&&(this.attachments=[],n.attachments.forEach(function(n){d.attachments.push(new u.AttachmentData(n))}))}}}();l.CipherData=d},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){function n(n){this.expMonth=null,this._brand=null}return Object.defineProperty(n.prototype,"maskedCode",{get:function(){return null!=this.code?"•".repeat(this.code.length):null},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"brand",{get:function(){return this._brand},set:function(n){this._brand=n,this._subTitle=null},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"number",{get:function(){return this._number},set:function(n){this._number=n,this._subTitle=null},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"subTitle",{get:function(){return null==this._subTitle&&(this._subTitle=this.brand,null!=this.number&&this.number.length>=4&&(null!=this._subTitle&&""!==this._subTitle?this._subTitle+=", ":this._subTitle="",this._subTitle+="*"+this.number.substr(this.number.length-4))),this._subTitle},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"expiration",{get:function(){if(!this.expMonth&&!this.expYear)return null;var n=null!=this.expMonth?("0"+this.expMonth).slice(-2):"__";return n+=" / "+(null!=this.expYear?this.formatYear(this.expYear):"____")},enumerable:!0,configurable:!0}),n.prototype.formatYear=function(n){return 2===n.length?"20"+n:n},n}();l.CardView=t},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});e(0),e(42);var t=function(){function n(n){this.sanitizer=n,this.width=45,this.height=45,this.charCount=2,this.textColor="#ffffff",this.fontSize=20,this.fontWeight=300,this.dynamic=!1,this.circle=!1}return n.prototype.ngOnInit=function(){this.dynamic||this.generate()},n.prototype.ngOnChanges=function(){this.dynamic&&this.generate()},n.prototype.generate=function(){var n=null,l=this.data.toUpperCase();this.charCount>1&&(n=this.getFirstLetters(l,this.charCount)),null==n&&(n=l.substr(0,this.charCount));var e=this.getCharText(n),t=this.stringToColor(l),u=this.getSvg(this.width,this.height,t);u.appendChild(e);var o=window.document.createElement("div").appendChild(u).outerHTML,i=window.btoa(unescape(encodeURIComponent(o)));this.src="data:image/svg+xml;base64,"+i},n.prototype.stringToColor=function(n){for(var l=0,e=0;e>8*e&255).toString(16)).substr(-2)}return t},n.prototype.getFirstLetters=function(n,l){var e=n.split(" ");if(e.length>1){for(var t="",u=0;u0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]-1&&window.document.body.removeChild(n)}),!this.hidePaypal){window.document.head.removeChild(this.btScript);var n=window.document.head.querySelector("#braintree-dropin-stylesheet");null!=n&&window.document.head.removeChild(n)}},n.prototype.changeMethod=function(){var n=this;"paypal"===this.method?window.setTimeout(function(){window.braintree.dropin.create({authorization:n.platformUtilsService.isDev()?t.btSandbox:t.btProduction,container:"#bt-dropin-container",paymentOptionPriority:["paypal"],paypal:{flow:"vault",buttonStyle:{label:"pay",size:"medium",shape:"pill",color:"blue"}}},function(l,e){null==l?n.btInstance=e:console.error(l)})},250):this.btInstance=null},n.prototype.createPaymentToken=function(){var n=this;return new Promise(function(l,e){if("paypal"===n.method)n.btInstance.requestPaymentMethod().then(function(n){l(n.nonce)}).catch(function(n){e(n.message)});else if("card"===n.method||"bank"===n.method){var t="card"===n.method?window.Stripe.card:window.Stripe.bankAccount,u="card"===n.method?n.card:n.bank;t.createToken(u,function(n,t){200===n&&null!=t.id?l(t.id):null!=t.error?e(t.error.message):e()})}})},n.prototype.getCountry=function(){return this.card.address_country},n}();l.PaymentComponent=u},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(n){this.id=null,n&&(this.id=n.id)}}();l.FolderView=t},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(){}}();l.AuditService=t},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=e(0),u=e(5),o=e(116),i=e(42),r=t.ɵcrt({encapsulation:2,styles:[],data:{}});function a(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,2,"img",[],[[8,"src",4],[8,"title",0]],null,null,null,null)),t.ɵdid(1,278528,null,0,u.NgClass,[t.IterableDiffers,t.KeyValueDiffers,t.ElementRef,t.Renderer2],{ngClass:[0,"ngClass"]},null),t.ɵpod(2,{"rounded-circle":0})],function(n,l){n(l,1,0,n(l,2,0,l.component.circle))},function(n,l){var e=l.component;n(l,0,0,e.sanitizer.bypassSecurityTrustResourceUrl(e.src),t.ɵinlineInterpolate(1,"",e.data,""))})}function s(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"app-avatar",[],null,null,null,a,r)),t.ɵdid(1,638976,null,0,o.AvatarComponent,[i.DomSanitizer],null,null)],function(n,l){n(l,1,0)},null)}l.RenderType_AvatarComponent=r,l.View_AvatarComponent_0=a,l.View_AvatarComponent_Host_0=s;var d=t.ɵccf("app-avatar",o.AvatarComponent,s,{data:"data",width:"width",height:"height",charCount:"charCount",textColor:"textColor",fontSize:"fontSize",fontWeight:"fontWeight",dynamic:"dynamic",circle:"circle"},{},[]);l.AvatarComponentNgFactory=d},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(){}}();l.EnvironmentService=t},,,,,,,,,,,,,,,,,,,,,,function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=e(0),u=e(7),o=e(2),i=e(13),r=e(18),a=e(17),s=e(46),d=e(125),c=e(4),p=e(9),f=e(20),v=t.ɵcrt({encapsulation:2,styles:[],data:{}});function h(n){return t.ɵvid(0,[t.ɵpid(0,u.I18nPipe,[o.I18nService]),(n()(),t.ɵeld(1,0,[["form",1]],null,43,"form",[["ngNativeValidate",""]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngSubmit"],[null,"submit"],[null,"reset"]],function(n,l,e){var u=!0,o=n.component;"submit"===l&&(u=!1!==t.ɵnov(n,2).onSubmit(e)&&u);"reset"===l&&(u=!1!==t.ɵnov(n,2).onReset()&&u);"ngSubmit"===l&&(u=!1!==o.submit()&&u);return u},null,null)),t.ɵdid(2,4210688,null,0,i.NgForm,[[8,null],[8,null]],null,{ngSubmit:"ngSubmit"}),t.ɵprd(2048,null,i.ControlContainer,null,[i.NgForm]),t.ɵdid(4,16384,null,0,i.NgControlStatusGroup,[i.ControlContainer],null,null),t.ɵdid(5,540672,null,0,r.ApiActionDirective,[t.ElementRef,a.ValidationService],{appApiAction:[0,"appApiAction"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(7,0,null,null,19,"div",[["class","modal-body"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(9,0,null,null,2,"p",[],null,null,null,null,null)),(n()(),t.ɵted(10,null,["",""])),t.ɵppd(11,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(13,0,null,null,2,"label",[["for","masterPassword"]],null,null,null,null,null)),(n()(),t.ɵted(14,null,["",""])),t.ɵppd(15,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(17,0,null,null,8,"input",[["appAutoFocus",""],["appInputVerbatim",""],["class","form-control"],["id","masterPassword"],["name","MasterPasswordHash"],["required",""],["type","password"]],[[1,"required",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(n,l,e){var u=!0,o=n.component;"input"===l&&(u=!1!==t.ɵnov(n,18)._handleInput(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,18).onTouched()&&u);"compositionstart"===l&&(u=!1!==t.ɵnov(n,18)._compositionStart()&&u);"compositionend"===l&&(u=!1!==t.ɵnov(n,18)._compositionEnd(e.target.value)&&u);"ngModelChange"===l&&(u=!1!==(o.masterPassword=e)&&u);return u},null,null)),t.ɵdid(18,16384,null,0,i.DefaultValueAccessor,[t.Renderer2,t.ElementRef,[2,i.COMPOSITION_BUFFER_MODE]],null,null),t.ɵdid(19,16384,null,0,i.RequiredValidator,[],{required:[0,"required"]},null),t.ɵprd(1024,null,i.NG_VALIDATORS,function(n){return[n]},[i.RequiredValidator]),t.ɵprd(1024,null,i.NG_VALUE_ACCESSOR,function(n){return[n]},[i.DefaultValueAccessor]),t.ɵdid(22,671744,null,0,i.NgModel,[[2,i.ControlContainer],[2,i.NG_VALIDATORS],[8,null],[2,i.NG_VALUE_ACCESSOR]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,i.NgControl,null,[i.NgModel]),t.ɵdid(24,16384,null,0,i.NgControlStatus,[i.NgControl],null,null),t.ɵdid(25,81920,null,0,s.InputVerbatimDirective,[t.ElementRef,t.Renderer2],{appInputVerbatim:[0,"appInputVerbatim"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(28,0,null,null,15,"div",[["class","modal-footer"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(30,0,null,null,8,"button",[["class","btn btn-primary btn-submit"],["type","submit"]],[[8,"disabled",0]],null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(32,0,null,null,1,"i",[["class","fa fa-spinner fa-spin"]],[[8,"title",0]],null,null,null,null)),t.ɵppd(33,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(35,0,null,null,2,"span",[],null,null,null,null,null)),(n()(),t.ɵted(36,null,["",""])),t.ɵppd(37,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(40,0,null,null,2,"button",[["class","btn btn-outline-secondary"],["data-dismiss","modal"],["type","button"]],null,null,null,null,null)),(n()(),t.ɵted(41,null,["",""])),t.ɵppd(42,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){var e=l.component;n(l,5,0,e.formPromise);n(l,19,0,"");n(l,22,0,"MasterPasswordHash",e.masterPassword);n(l,25,0,"")},function(n,l){n(l,1,0,t.ɵnov(l,4).ngClassUntouched,t.ɵnov(l,4).ngClassTouched,t.ɵnov(l,4).ngClassPristine,t.ɵnov(l,4).ngClassDirty,t.ɵnov(l,4).ngClassValid,t.ɵnov(l,4).ngClassInvalid,t.ɵnov(l,4).ngClassPending),n(l,10,0,t.ɵunv(l,10,0,n(l,11,0,t.ɵnov(l,0),"twoStepLoginAuthDesc"))),n(l,14,0,t.ɵunv(l,14,0,n(l,15,0,t.ɵnov(l,0),"masterPass"))),n(l,17,0,t.ɵnov(l,19).required?"":null,t.ɵnov(l,24).ngClassUntouched,t.ɵnov(l,24).ngClassTouched,t.ɵnov(l,24).ngClassPristine,t.ɵnov(l,24).ngClassDirty,t.ɵnov(l,24).ngClassValid,t.ɵnov(l,24).ngClassInvalid,t.ɵnov(l,24).ngClassPending),n(l,30,0,t.ɵnov(l,1).loading),n(l,32,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,32,0,n(l,33,0,t.ɵnov(l,0),"loading")),"")),n(l,36,0,t.ɵunv(l,36,0,n(l,37,0,t.ɵnov(l,0),"continue"))),n(l,41,0,t.ɵunv(l,41,0,n(l,42,0,t.ɵnov(l,0),"close")))})}function g(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"app-two-factor-verify",[],null,null,null,h,v)),t.ɵdid(1,49152,null,0,d.TwoFactorVerifyComponent,[c.ApiService,o.I18nService,p.ToasterService,f.CryptoService],null,null)],null,null)}l.RenderType_TwoFactorVerifyComponent=v,l.View_TwoFactorVerifyComponent_0=h,l.View_TwoFactorVerifyComponent_Host_0=g;var m=t.ɵccf("app-two-factor-verify",d.TwoFactorVerifyComponent,g,{type:"type",organizationId:"organizationId"},{onAuthed:"onAuthed"},[]);l.TwoFactorVerifyComponentNgFactory=m},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)}),o=this&&this.__awaiter||function(n,l,e,t){return new(e||(e=Promise))(function(u,o){function i(n){try{a(t.next(n))}catch(n){o(n)}}function r(n){try{a(t.throw(n))}catch(n){o(n)}}function a(n){n.done?u(n.value):new e(function(l){l(n.value)}).then(i,r)}a((t=t.apply(n,l||[])).next())})},i=this&&this.__generator||function(n,l){var e,t,u,o,i={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return o={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function r(o){return function(r){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;i;)try{if(e=1,t&&(u=t[2&o[0]?"return":o[0]?"throw":"next"])&&!(u=u.call(t,o[1])).done)return u;switch(t=0,u&&(o=[0,u.value]),o[0]){case 0:case 1:u=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,t=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(u=(u=i.trys).length>0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0?(a=[],[4,this.attachments.reduce(function(n,l){return n.then(function(){return l.decrypt(o)}).then(function(n){a.push(n)})},Promise.resolve())]):[3,13];case 12:i.sent(),n.attachments=a,i.label=13;case 13:return null!=this.fields&&this.fields.length>0?(d=[],[4,this.fields.reduce(function(n,l){return n.then(function(){return l.decrypt(o)}).then(function(n){d.push(n)})},Promise.resolve())]):[3,15];case 14:i.sent(),n.fields=d,i.label=15;case 15:return[2,n]}})})},l.prototype.toCipherData=function(n){var l=new a.CipherData;switch(l.id=this.id,l.organizationId=this.organizationId,l.folderId=this.folderId,l.userId=null!=this.organizationId?n:null,l.edit=this.edit,l.organizationUseTotp=this.organizationUseTotp,l.favorite=this.favorite,l.revisionDate=this.revisionDate,l.type=this.type,l.collectionIds=this.collectionIds,this.buildDataModel(this,l,{name:null,notes:null}),l.type){case r.CipherType.Login:l.login=this.login.toLoginData();break;case r.CipherType.SecureNote:l.secureNote=this.secureNote.toSecureNoteData();break;case r.CipherType.Card:l.card=this.card.toCardData();break;case r.CipherType.Identity:l.identity=this.identity.toIdentityData()}return null!=this.fields&&(l.fields=[],this.fields.forEach(function(n){l.fields.push(n.toFieldData())})),null!=this.attachments&&(l.attachments=[],this.attachments.forEach(function(n){l.attachments.push(n.toAttachmentData())})),l},l}(p.default);l.Cipher=m},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)});Object.defineProperty(l,"__esModule",{value:!0});var o=e(177),i=function(n){function l(l,e){void 0===e&&(e=!1);var t=n.call(this)||this;return null==l?t:(t.buildDomainModel(t,l,{id:null,organizationId:null,name:null,readOnly:null},e,["id","organizationId","readOnly"]),t)}return u(l,n),l.prototype.decrypt=function(){return this.decryptObj(new o.CollectionView(this),{name:null},this.organizationId)},l}(e(100).default);l.Collection=i},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){function n(n){}return Object.defineProperty(n.prototype,"uri",{get:function(){return this.hasUris?this.uris[0].uri:null},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"maskedPassword",{get:function(){return null!=this.password?"••••••••":null},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"subTitle",{get:function(){return this.username},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"canLaunch",{get:function(){return this.hasUris&&this.uris[0].canLaunch},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"hasUris",{get:function(){return null!=this.uris&&this.uris.length>0},enumerable:!0,configurable:!0}),n}();l.LoginView=t},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=e(53),u=function(){function n(n){this.favorite=!1,this.organizationUseTotp=!1,this.edit=!1,n&&(this.id=n.id,this.organizationId=n.organizationId,this.folderId=n.folderId,this.favorite=n.favorite,this.organizationUseTotp=n.organizationUseTotp,this.edit=n.edit,this.type=n.type,this.localData=n.localData,this.collectionIds=n.collectionIds)}return Object.defineProperty(n.prototype,"subTitle",{get:function(){switch(this.type){case t.CipherType.Login:return this.login.subTitle;case t.CipherType.SecureNote:return this.secureNote.subTitle;case t.CipherType.Card:return this.card.subTitle;case t.CipherType.Identity:return this.identity.subTitle}return null},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"hasAttachments",{get:function(){return this.attachments&&this.attachments.length>0},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"hasFields",{get:function(){return this.fields&&this.fields.length>0},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"login_username",{get:function(){return null!=this.login?this.login.username:null},enumerable:!0,configurable:!0}),n}();l.CipherView=u},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=e(53),u=function(){return function(n){var l=this;switch(this.type=n.type,this.folderId=n.folderId,this.organizationId=n.organizationId,this.name=n.name?n.name.encryptedString:null,this.notes=n.notes?n.notes.encryptedString:null,this.favorite=n.favorite,this.type){case t.CipherType.Login:this.login={uris:null,username:n.login.username?n.login.username.encryptedString:null,password:n.login.password?n.login.password.encryptedString:null,totp:n.login.totp?n.login.totp.encryptedString:null},n.login.uris&&(this.login.uris=[],n.login.uris.forEach(function(n){l.login.uris.push({uri:n.uri?n.uri.encryptedString:null,match:null!=n.match?n.match:null})}));break;case t.CipherType.SecureNote:this.secureNote={type:n.secureNote.type};break;case t.CipherType.Card:this.card={cardholderName:n.card.cardholderName?n.card.cardholderName.encryptedString:null,brand:n.card.brand?n.card.brand.encryptedString:null,number:n.card.number?n.card.number.encryptedString:null,expMonth:n.card.expMonth?n.card.expMonth.encryptedString:null,expYear:n.card.expYear?n.card.expYear.encryptedString:null,code:n.card.code?n.card.code.encryptedString:null};break;case t.CipherType.Identity:this.identity={title:n.identity.title?n.identity.title.encryptedString:null,firstName:n.identity.firstName?n.identity.firstName.encryptedString:null,middleName:n.identity.middleName?n.identity.middleName.encryptedString:null,lastName:n.identity.lastName?n.identity.lastName.encryptedString:null,address1:n.identity.address1?n.identity.address1.encryptedString:null,address2:n.identity.address2?n.identity.address2.encryptedString:null,address3:n.identity.address3?n.identity.address3.encryptedString:null,city:n.identity.city?n.identity.city.encryptedString:null,state:n.identity.state?n.identity.state.encryptedString:null,postalCode:n.identity.postalCode?n.identity.postalCode.encryptedString:null,country:n.identity.country?n.identity.country.encryptedString:null,company:n.identity.company?n.identity.company.encryptedString:null,email:n.identity.email?n.identity.email.encryptedString:null,phone:n.identity.phone?n.identity.phone.encryptedString:null,ssn:n.identity.ssn?n.identity.ssn.encryptedString:null,username:n.identity.username?n.identity.username.encryptedString:null,passportNumber:n.identity.passportNumber?n.identity.passportNumber.encryptedString:null,licenseNumber:n.identity.licenseNumber?n.identity.licenseNumber.encryptedString:null}}n.fields&&(this.fields=[],n.fields.forEach(function(n){l.fields.push({type:n.type,name:n.name?n.name.encryptedString:null,value:n.value?n.value.encryptedString:null})})),n.attachments&&(this.attachments={},n.attachments.forEach(function(n){l.attachments[n.id]=n.fileName?n.fileName.encryptedString:null}))}}();l.CipherRequest=u},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0}),function(n){n[n.Android=0]="Android",n[n.iOS=1]="iOS",n[n.ChromeExtension=2]="ChromeExtension",n[n.FirefoxExtension=3]="FirefoxExtension",n[n.OperaExtension=4]="OperaExtension",n[n.EdgeExtension=5]="EdgeExtension",n[n.WindowsDesktop=6]="WindowsDesktop",n[n.MacOsDesktop=7]="MacOsDesktop",n[n.LinuxDesktop=8]="LinuxDesktop",n[n.ChromeBrowser=9]="ChromeBrowser",n[n.FirefoxBrowser=10]="FirefoxBrowser",n[n.OperaBrowser=11]="OperaBrowser",n[n.EdgeBrowser=12]="EdgeBrowser",n[n.IEBrowser=13]="IEBrowser",n[n.UnknownBrowser=14]="UnknownBrowser",n[n.AndroidAmazon=15]="AndroidAmazon",n[n.UWP=16]="UWP",n[n.SafariBrowser=17]="SafariBrowser",n[n.VivaldiBrowser=18]="VivaldiBrowser",n[n.VivaldiExtension=19]="VivaldiExtension",n[n.SafariExtension=20]="SafariExtension"}(l.DeviceType||(l.DeviceType={}))},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){function n(){this.subscribers=new Map}return n.prototype.send=function(n,l){null==l?this.subscribers.forEach(function(l){l(n)}):this.subscribers.has(l)&&this.subscribers.get(l)(n)},n.prototype.subscribe=function(n,l){this.subscribers.has(n)||this.subscribers.set(n,l)},n.prototype.unsubscribe=function(n){this.subscribers.has(n)&&this.subscribers.delete(n)},n}();l.BroadcasterService=t},,,,,,,,,,,,,,function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0}),function(n){n[n.Owner=0]="Owner",n[n.Admin=1]="Admin",n[n.User=2]="User"}(l.OrganizationUserType||(l.OrganizationUserType={}))},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});e(2);var t=e(159),u=e(727),o=function(){function n(n){this.i18nService=n}return n.prototype.getDefaultDateFilters=function(){var n=new Date,l=new Date(n.getFullYear(),n.getMonth(),n.getDate(),23,59);n.setDate(n.getDate()-30);var e=new Date(n.getFullYear(),n.getMonth(),n.getDate(),0,0);return[this.toDateTimeLocalString(e),this.toDateTimeLocalString(l)]},n.prototype.formatDateFilters=function(n,l){var e=new Date(n),t=new Date(l+":59.999");if(isNaN(e.getTime())||isNaN(t.getTime())||t"+e+"";var t=this.makeAnchor(e);return t.setAttribute("href","#/organizations/"+n.organizationId+"/vault?search="+e+"&viewEvents="+n.cipherId),t.outerHTML},n.prototype.formatGroupId=function(n){var l=this.getShortId(n.groupId),e=this.makeAnchor(l);return e.setAttribute("href","#/organizations/"+n.organizationId+"/manage/groups?search="+l),e.outerHTML},n.prototype.formatCollectionId=function(n){var l=this.getShortId(n.collectionId),e=this.makeAnchor(l);return e.setAttribute("href","#/organizations/"+n.organizationId+"/manage/collections?search="+l),e.outerHTML},n.prototype.formatOrgUserId=function(n){var l=this.getShortId(n.organizationUserId),e=this.makeAnchor(l);return e.setAttribute("href","#/organizations/"+n.organizationId+"/manage/people?search="+l+"&viewEvents="+n.organizationUserId),e.outerHTML},n.prototype.makeAnchor=function(n){var l=document.createElement("a");return l.title=this.i18nService.t("view"),l.innerHTML=""+n+"",l},n.prototype.getShortId=function(n){return n.substring(0,8)},n.prototype.toDateTimeLocalString=function(n){return n.getFullYear()+"-"+this.pad(n.getMonth()+1)+"-"+this.pad(n.getDate())+"T"+this.pad(n.getHours())+":"+this.pad(n.getMinutes())},n.prototype.pad=function(n){var l=Math.floor(Math.abs(n));return(l<10?"0":"")+l},n}();l.EventService=o;var i=function(){return function(){}}();l.EventInfo=i;var r=function(){return function(){this.cipherInfo=!0}}();l.EventOptions=r},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(){}}();l.ExportService=t},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(n){n&&(this.id=n.id,this.organizationId=n.organizationId,this.readOnly=n.readOnly)}}();l.CollectionView=t},function(n,l,e){"use strict";var t=this&&this.__awaiter||function(n,l,e,t){return new(e||(e=Promise))(function(u,o){function i(n){try{a(t.next(n))}catch(n){o(n)}}function r(n){try{a(t.throw(n))}catch(n){o(n)}}function a(n){n.done?u(n.value):new e(function(l){l(n.value)}).then(i,r)}a((t=t.apply(n,l||[])).next())})},u=this&&this.__generator||function(n,l){var e,t,u,o,i={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return o={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function r(o){return function(r){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;i;)try{if(e=1,t&&(u=t[2&o[0]?"return":o[0]?"throw":"next"])&&!(u=u.call(t,o[1])).done)return u;switch(t=0,u&&(o=[0,u.value]),o[0]){case 0:case 1:u=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,t=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(u=(u=i.trys).length>0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0))return[3,4];u.label=1;case 1:return u.trys.push([1,3,,4]),[4,this.getFileContents(e[0])];case 2:return null!=(o=u.sent())&&(t=o),[3,4];case 3:return u.sent(),[3,4];case 4:return null==t||""===t?(this.toasterService.popAsync("error",this.i18nService.t("errorOccurred"),this.i18nService.t("selectFile")),[2]):[4,n.parse(t)];case 5:if(!(i=u.sent()).success)return[3,10];if(0===i.folders.length&&0===i.ciphers.length)return this.error(this.i18nService.t("importNothingError")),[2];if(i.ciphers.length>0&&(r=Math.floor(i.ciphers.length/2),a=i.ciphers.length-1,this.badData(i.ciphers[0])&&this.badData(i.ciphers[r])&&this.badData(i.ciphers[a])))return this.error(this.i18nService.t("importFormatError")),[2];u.label=6;case 6:return u.trys.push([6,8,,9]),this.formPromise=this.postImport(i),[4,this.formPromise];case 7:return u.sent(),this.analytics.eventTrack.next({action:"Imported Data",properties:{label:this.format}}),this.toasterService.popAsync("success",null,this.i18nService.t("importSuccess")),this.router.navigate(this.successNavigate),[3,9];case 8:return u.sent(),[3,9];case 9:return[3,11];case 10:this.error(this.i18nService.t("importFormatError")),u.label=11;case 11:return[2]}})})},n.prototype.getFormatInstructionTitle=function(){var n=this;if(null==this.format)return null;var l=this.featuredImportOptions.concat(this.importOptions).filter(function(l){return l.id===n.format});return l.length>0?this.i18nService.t("instructionsFor",l[0].name):null},n.prototype.postImport=function(n){return t(this,void 0,void 0,function(){var l,e,t,s;return u(this,function(u){switch(u.label){case 0:l=new r.ImportCiphersRequest,t=0,u.label=1;case 1:return t0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]-1},enumerable:!0,configurable:!0}),n}();l.LoginUriView=u},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){function n(n){this.title=null}return Object.defineProperty(n.prototype,"firstName",{get:function(){return this._firstName},set:function(n){this._firstName=n,this._subTitle=null},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"lastName",{get:function(){return this._lastName},set:function(n){this._lastName=n,this._subTitle=null},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"subTitle",{get:function(){return null!=this._subTitle||null==this.firstName&&null==this.lastName||(this._subTitle="",null!=this.firstName&&(this._subTitle=this.firstName),null!=this.lastName&&(""!==this._subTitle&&(this._subTitle+=" "),this._subTitle+=this.lastName)),this._subTitle},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"fullName",{get:function(){if(null!=this.title||null!=this.firstName||null!=this.middleName||null!=this.lastName){var n="";return null!=this.title&&(n+=this.title+" "),null!=this.firstName&&(n+=this.firstName+" "),null!=this.middleName&&(n+=this.middleName+" "),null!=this.lastName&&(n+=this.lastName),n.trim()}return null},enumerable:!0,configurable:!0}),n}();l.IdentityView=t},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)}),o=this&&this.__awaiter||function(n,l,e,t){return new(e||(e=Promise))(function(u,o){function i(n){try{a(t.next(n))}catch(n){o(n)}}function r(n){try{a(t.throw(n))}catch(n){o(n)}}function a(n){n.done?u(n.value):new e(function(l){l(n.value)}).then(i,r)}a((t=t.apply(n,l||[])).next())})},i=this&&this.__generator||function(n,l){var e,t,u,o,i={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return o={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function r(o){return function(r){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;i;)try{if(e=1,t&&(u=t[2&o[0]?"return":o[0]?"throw":"next"])&&!(u=u.call(t,o[1])).done)return u;switch(t=0,u&&(o=[0,u.value]),o[0]){case 0:case 1:u=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,t=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(u=(u=i.trys).length>0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]500?500:this.ciphers.length,e=0;e0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]t){if(o===i.TwoFactorProviderType.U2f&&!n)return;e=o,t=r.priority}}),e},n.prototype.logInHelper=function(n,l,e,t,c,p){return u(this,void 0,void 0,function(){var u,f,v,h,g,m,y,C,b,S;return o(this,function(o){switch(o.label){case 0:return[4,this.tokenService.getTwoFactorToken(n)];case 1:return u=o.sent(),[4,this.appIdService.getAppId()];case 2:return f=o.sent(),v=new a.DeviceRequest(f,this.platformUtilsService),h=null!=c&&null!=t?new d.TokenRequest(n,l,t,c,p,v):null!=u?new d.TokenRequest(n,l,i.TwoFactorProviderType.Remember,u,!1,v):new d.TokenRequest(n,l,null,null,!1,v),[4,this.apiService.postIdentityToken(h)];case 3:return g=o.sent(),this.clearState(),(m=new r.AuthResult).twoFactor=!g.accessToken,m.twoFactor?(y=g,this.email=n,this.masterPasswordHash=l,this.key=this.setCryptoKeys?e:null,this.twoFactorProviders=y.twoFactorProviders2,m.twoFactorProviders=y.twoFactorProviders2,[2,m]):(null!=(C=g).twoFactorToken&&this.tokenService.setTwoFactorToken(C.twoFactorToken,n),[4,this.tokenService.setTokens(C.accessToken,C.refreshToken)]);case 4:return o.sent(),[4,this.userService.setUserIdAndEmail(this.tokenService.getUserId(),this.tokenService.getEmail())];case 5:return o.sent(),this.setCryptoKeys?[4,this.cryptoService.setKey(e)]:[3,15];case 6:return o.sent(),[4,this.cryptoService.setKeyHash(l)];case 7:return o.sent(),[4,this.cryptoService.setEncKey(C.key)];case 8:if(o.sent(),null!=C.privateKey)return[3,13];o.label=9;case 9:return o.trys.push([9,12,,13]),[4,this.cryptoService.makeKeyPair()];case 10:return b=o.sent(),[4,this.apiService.postAccountKeys(new s.KeysRequest(b[0],b[1].encryptedString))];case 11:return o.sent(),C.privateKey=b[1].encryptedString,[3,13];case 12:return S=o.sent(),console.error(S),[3,13];case 13:return[4,this.cryptoService.setEncPrivateKey(C.privateKey)];case 14:o.sent(),o.label=15;case 15:return this.messagingService.send("loggedIn"),[2,m]}})})},n.prototype.clearState=function(){this.email=null,this.masterPasswordHash=null,this.twoFactorProviders=null,this.selectedTwoFactorProviderType=null},n}();l.AuthService=c},,,,,,,,,,,,,,,function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(n){this.id=n.Id,this.readOnly=n.ReadOnly}}();l.SelectionReadOnlyResponse=t},function(n,l,e){"use strict";var t=this&&this.__awaiter||function(n,l,e,t){return new(e||(e=Promise))(function(u,o){function i(n){try{a(t.next(n))}catch(n){o(n)}}function r(n){try{a(t.throw(n))}catch(n){o(n)}}function a(n){n.done?u(n.value):new e(function(l){l(n.value)}).then(i,r)}a((t=t.apply(n,l||[])).next())})},u=this&&this.__generator||function(n,l){var e,t,u,o,i={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return o={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function r(o){return function(r){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;i;)try{if(e=1,t&&(u=t[2&o[0]?"return":o[0]?"throw":"next"])&&!(u=u.call(t,o[1])).done)return u;switch(t=0,u&&(o=[0,u.value]),o[0]){case 0:case 1:u=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,t=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(u=(u=i.trys).length>0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&l[0].status===i.OrganizationUserStatusType.Confirmed&&this.events(l[0]),[2]})})}),[2]}})})}),[2]})})},n.prototype.load=function(){return t(this,void 0,void 0,function(){var n,l=this;return u(this,function(e){switch(e.label){case 0:return[4,this.apiService.getOrganizationUsers(this.organizationId)];case 1:return n=e.sent(),this.statusMap.clear(),this.allUsers=null!=n.data&&n.data.length>0?n.data:[],this.allUsers.sort(a.Utils.getSortFunction(this.i18nService,"email")),this.allUsers.forEach(function(n){l.statusMap.has(n.status)?l.statusMap.get(n.status).push(n):l.statusMap.set(n.status,[n])}),this.filter(this.status),this.loading=!1,[2]}})})},n.prototype.filter=function(n){this.status=n,null!=this.status?this.users=this.statusMap.get(this.status):this.users=this.allUsers},Object.defineProperty(n.prototype,"invitedCount",{get:function(){return this.statusMap.has(i.OrganizationUserStatusType.Invited)?this.statusMap.get(i.OrganizationUserStatusType.Invited).length:0},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"acceptedCount",{get:function(){return this.statusMap.has(i.OrganizationUserStatusType.Accepted)?this.statusMap.get(i.OrganizationUserStatusType.Accepted).length:0},enumerable:!0,configurable:!0}),n.prototype.edit=function(n){var l=this;null!=this.modal&&this.modal.close();var e=this.componentFactoryResolver.resolveComponentFactory(s.ModalComponent);this.modal=this.addEditModalRef.createComponent(e).instance;var t=this.modal.show(c.UserAddEditComponent,this.addEditModalRef);t.name=null!=n?n.name||n.email:null,t.organizationId=this.organizationId,t.organizationUserId=null!=n?n.id:null,t.onSavedUser.subscribe(function(){l.modal.close(),l.load()}),t.onDeletedUser.subscribe(function(){l.modal.close(),l.removeUser(n)}),this.modal.onClosed.subscribe(function(){l.modal=null})},n.prototype.invite=function(){this.edit(null)},n.prototype.groups=function(n){var l=this;null!=this.modal&&this.modal.close();var e=this.componentFactoryResolver.resolveComponentFactory(s.ModalComponent);this.modal=this.groupsModalRef.createComponent(e).instance;var t=this.modal.show(p.UserGroupsComponent,this.groupsModalRef);t.name=null!=n?n.name||n.email:null,t.organizationId=this.organizationId,t.organizationUserId=null!=n?n.id:null,t.onSavedUser.subscribe(function(){l.modal.close()}),this.modal.onClosed.subscribe(function(){l.modal=null})},n.prototype.remove=function(n){return t(this,void 0,void 0,function(){return u(this,function(l){switch(l.label){case 0:return[4,this.platformUtilsService.showDialog(this.i18nService.t("removeUserConfirmation"),n.name||n.email,this.i18nService.t("yes"),this.i18nService.t("no"),"warning")];case 1:if(!l.sent())return[2,!1];l.label=2;case 2:return l.trys.push([2,4,,5]),[4,this.apiService.deleteOrganizationUser(this.organizationId,n.id)];case 3:return l.sent(),this.analytics.eventTrack.next({action:"Deleted User"}),this.toasterService.popAsync("success",null,this.i18nService.t("removedUserId",n.name||n.email)),this.removeUser(n),[3,5];case 4:return l.sent(),[3,5];case 5:return[2]}})})},n.prototype.reinvite=function(n){return t(this,void 0,void 0,function(){return u(this,function(l){switch(l.label){case 0:return null!=this.actionPromise?[2]:(this.actionPromise=this.apiService.postOrganizationUserReinvite(this.organizationId,n.id),[4,this.actionPromise]);case 1:return l.sent(),this.analytics.eventTrack.next({action:"Reinvited User"}),this.toasterService.popAsync("success",null,this.i18nService.t("hasBeenReinvited",n.name||n.email)),this.actionPromise=null,[2]}})})},n.prototype.confirm=function(n){return t(this,void 0,void 0,function(){return u(this,function(l){switch(l.label){case 0:return null!=this.actionPromise?[2]:(this.actionPromise=this.doConfirmation(n),[4,this.actionPromise]);case 1:return l.sent(),n.status=i.OrganizationUserStatusType.Confirmed,this.analytics.eventTrack.next({action:"Confirmed User"}),this.toasterService.popAsync("success",null,this.i18nService.t("hasBeenConfirmed",n.name||n.email)),this.actionPromise=null,[2]}})})},n.prototype.events=function(n){return t(this,void 0,void 0,function(){var l,e,t=this;return u(this,function(u){return null!=this.modal&&this.modal.close(),l=this.componentFactoryResolver.resolveComponentFactory(s.ModalComponent),this.modal=this.eventsModalRef.createComponent(l).instance,(e=this.modal.show(d.EntityEventsComponent,this.eventsModalRef)).name=n.name||n.email,e.organizationId=this.organizationId,e.entityId=n.id,e.showUser=!1,e.entity="user",this.modal.onClosed.subscribe(function(){t.modal=null}),[2]})})},n.prototype.doConfirmation=function(n){return t(this,void 0,void 0,function(){var l,e,t,i,r;return u(this,function(u){switch(u.label){case 0:return[4,this.cryptoService.getOrgKey(this.organizationId)];case 1:return l=u.sent(),[4,this.apiService.getUserPublicKey(n.userId)];case 2:return e=u.sent(),t=a.Utils.fromB64ToArray(e.publicKey),[4,this.cryptoService.rsaEncrypt(l.key,t.buffer)];case 3:return i=u.sent(),(r=new o.OrganizationUserConfirmRequest).key=i.encryptedString,[4,this.apiService.postOrganizationUserConfirm(this.organizationId,n.id,r)];case 4:return u.sent(),[2]}})})},n.prototype.removeUser=function(n){var l=this.users.indexOf(n);l>-1&&this.users.splice(l,1)},n}();l.PeopleComponent=f},function(n,l,e){"use strict";var t=this&&this.__awaiter||function(n,l,e,t){return new(e||(e=Promise))(function(u,o){function i(n){try{a(t.next(n))}catch(n){o(n)}}function r(n){try{a(t.throw(n))}catch(n){o(n)}}function a(n){n.done?u(n.value):new e(function(l){l(n.value)}).then(i,r)}a((t=t.apply(n,l||[])).next())})},u=this&&this.__generator||function(n,l){var e,t,u,o,i={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return o={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function r(o){return function(r){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;i;)try{if(e=1,t&&(u=t[2&o[0]?"return":o[0]?"throw":"next"])&&!(u=u.call(t,o[1])).done)return u;switch(t=0,u&&(o=[0,u.value]),o[0]){case 0:case 1:u=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,t=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(u=(u=i.trys).length>0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0?n.data:[]).sort(o.Utils.getSortFunction(this.i18nService,"name")),this.groups=l,this.loading=!1,[2]}})})},n.prototype.edit=function(n){var l=this;null!=this.modal&&this.modal.close();var e=this.componentFactoryResolver.resolveComponentFactory(i.ModalComponent);this.modal=this.addEditModalRef.createComponent(e).instance;var t=this.modal.show(a.GroupAddEditComponent,this.addEditModalRef);t.organizationId=this.organizationId,t.groupId=null!=n?n.id:null,t.onSavedGroup.subscribe(function(){l.modal.close(),l.load()}),t.onDeletedGroup.subscribe(function(){l.modal.close(),l.removeGroup(n)}),this.modal.onClosed.subscribe(function(){l.modal=null})},n.prototype.add=function(){this.edit(null)},n.prototype.delete=function(n){return t(this,void 0,void 0,function(){return u(this,function(l){switch(l.label){case 0:return[4,this.platformUtilsService.showDialog(this.i18nService.t("deleteGroupConfirmation"),n.name,this.i18nService.t("yes"),this.i18nService.t("no"),"warning")];case 1:if(!l.sent())return[2,!1];l.label=2;case 2:return l.trys.push([2,4,,5]),[4,this.apiService.deleteGroup(this.organizationId,n.id)];case 3:return l.sent(),this.analytics.eventTrack.next({action:"Deleted Group"}),this.toasterService.popAsync("success",null,this.i18nService.t("deletedGroupId",n.name)),this.removeGroup(n),[3,5];case 4:return l.sent(),[3,5];case 5:return[2]}})})},n.prototype.users=function(n){var l=this;null!=this.modal&&this.modal.close();var e=this.componentFactoryResolver.resolveComponentFactory(i.ModalComponent);this.modal=this.usersModalRef.createComponent(e).instance;var t=this.modal.show(r.EntityUsersComponent,this.usersModalRef);t.organizationId=this.organizationId,t.entity="group",t.entityId=n.id,t.entityName=n.name,this.modal.onClosed.subscribe(function(){l.modal=null})},n.prototype.removeGroup=function(n){var l=this.groups.indexOf(n);l>-1&&this.groups.splice(l,1)},n}();l.GroupsComponent=s},function(n,l,e){"use strict";var t=this&&this.__awaiter||function(n,l,e,t){return new(e||(e=Promise))(function(u,o){function i(n){try{a(t.next(n))}catch(n){o(n)}}function r(n){try{a(t.throw(n))}catch(n){o(n)}}function a(n){n.done?u(n.value):new e(function(l){l(n.value)}).then(i,r)}a((t=t.apply(n,l||[])).next())})},u=this&&this.__generator||function(n,l){var e,t,u,o,i={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return o={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function r(o){return function(r){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;i;)try{if(e=1,t&&(u=t[2&o[0]?"return":o[0]?"throw":"next"])&&!(u=u.call(t,o[1])).done)return u;switch(t=0,u&&(o=[0,u.value]),o[0]){case 0:case 1:u=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,t=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(u=(u=i.trys).length>0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0?this.events=this.events.concat(o):this.events=o,this.loading=!1,this.morePromise=null,this.refreshPromise=null,[2]}})})},n}();l.EventsComponent=o},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0}),function(n){n[n.Invited=0]="Invited",n[n.Accepted=1]="Accepted",n[n.Confirmed=2]="Confirmed"}(l.OrganizationUserStatusType||(l.OrganizationUserStatusType={}))},function(n,l,e){"use strict";var t=this&&this.__awaiter||function(n,l,e,t){return new(e||(e=Promise))(function(u,o){function i(n){try{a(t.next(n))}catch(n){o(n)}}function r(n){try{a(t.throw(n))}catch(n){o(n)}}function a(n){n.done?u(n.value):new e(function(l){l(n.value)}).then(i,r)}a((t=t.apply(n,l||[])).next())})},u=this&&this.__generator||function(n,l){var e,t,u,o,i={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return o={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function r(o){return function(r){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;i;)try{if(e=1,t&&(u=t[2&o[0]?"return":o[0]?"throw":"next"])&&!(u=u.call(t,o[1])).done)return u;switch(t=0,u&&(o=[0,u.value]),o[0]){case 0:case 1:u=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,t=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(u=(u=i.trys).length>0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]-1&&this.users.splice(l,1),[3,8];case 7:return e.sent(),[3,8];case 8:return[2]}})})},n}();l.EntityUsersComponent=s},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(n,l){this.id=n,this.readOnly=l}}();l.SelectionReadOnlyRequest=t},function(n,l,e){"use strict";var t=this&&this.__awaiter||function(n,l,e,t){return new(e||(e=Promise))(function(u,o){function i(n){try{a(t.next(n))}catch(n){o(n)}}function r(n){try{a(t.throw(n))}catch(n){o(n)}}function a(n){n.done?u(n.value):new e(function(l){l(n.value)}).then(i,r)}a((t=t.apply(n,l||[])).next())})},u=this&&this.__generator||function(n,l){var e,t,u,o,i={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return o={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function r(o){return function(r){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;i;)try{if(e=1,t&&(u=t[2&o[0]?"return":o[0]?"throw":"next"])&&!(u=u.call(t,o[1])).done)return u;switch(t=0,u&&(o=[0,u.value]),o[0]){case 0:case 1:u=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,t=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(u=(u=i.trys).length>0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]-1&&this.collections.splice(l,1)},n}();l.CollectionsComponent=d},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});e(0);var t=function(){function n(){}return n.prototype.transform=function(n,l,e,t,u){return null==n||0===n.length?[]:null==l||l.length<2?n:(l=l.trim().toLowerCase(),n.filter(function(n){return null!=e&&null!=n[e]&&n[e].toString().toLowerCase().indexOf(l)>-1||(null!=t&&null!=n[t]&&n[t].toString().toLowerCase().indexOf(l)>-1||null!=u&&null!=n[u]&&n[u].toString().toLowerCase().indexOf(l)>-1)}))},n}();l.SearchPipe=t},function(n,l,e){"use strict";var t=this&&this.__awaiter||function(n,l,e,t){return new(e||(e=Promise))(function(u,o){function i(n){try{a(t.next(n))}catch(n){o(n)}}function r(n){try{a(t.throw(n))}catch(n){o(n)}}function a(n){n.done?u(n.value):new e(function(l){l(n.value)}).then(i,r)}a((t=t.apply(n,l||[])).next())})},u=this&&this.__generator||function(n,l){var e,t,u,o,i={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return o={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function r(o){return function(r){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;i;)try{if(e=1,t&&(u=t[2&o[0]?"return":o[0]?"throw":"next"])&&!(u=u.call(t,o[1])).done)return u;switch(t=0,u&&(o=[0,u.value]),o[0]){case 0:case 1:u=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,t=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(u=(u=i.trys).length>0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0?this.events=this.events.concat(o):this.events=o,this.loading=!1,this.morePromise=null,this.refreshPromise=null,[2]}})})},n}();l.EntityEventsComponent=o},function(n,l,e){"use strict";var t=this&&this.__awaiter||function(n,l,e,t){return new(e||(e=Promise))(function(u,o){function i(n){try{a(t.next(n))}catch(n){o(n)}}function r(n){try{a(t.throw(n))}catch(n){o(n)}}function a(n){n.done?u(n.value):new e(function(l){l(n.value)}).then(i,r)}a((t=t.apply(n,l||[])).next())})},u=this&&this.__generator||function(n,l){var e,t,u,o,i={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return o={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function r(o){return function(r){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;i;)try{if(e=1,t&&(u=t[2&o[0]?"return":o[0]?"throw":"next"])&&!(u=u.call(t,o[1])).done)return u;switch(t=0,u&&(o=[0,u.value]),o[0]){case 0:case 1:u=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,t=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(u=(u=i.trys).length>0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&this.viewEvents(e[0]),[2]}})})}),[2]}})})})},n.prototype.clearGroupingFilters=function(){return t(this,void 0,void 0,function(){return u(this,function(n){switch(n.label){case 0:return this.ciphersComponent.showAddNew=!0,this.groupingsComponent.searchPlaceholder=this.i18nService.t("searchVault"),[4,this.ciphersComponent.applyFilter()];case 1:return n.sent(),this.clearFilters(),this.go(),[2]}})})},n.prototype.filterCipherType=function(n,l){return void 0===l&&(l=!1),t(this,void 0,void 0,function(){var e;return u(this,function(t){switch(t.label){case 0:return this.ciphersComponent.showAddNew=!0,this.groupingsComponent.searchPlaceholder=this.i18nService.t("searchType"),e=function(l){return l.type===n},l?[4,this.ciphersComponent.load(e)]:[3,2];case 1:return t.sent(),[3,4];case 2:return[4,this.ciphersComponent.applyFilter(e)];case 3:t.sent(),t.label=4;case 4:return this.clearFilters(),this.type=n,this.go(),[2]}})})},n.prototype.filterCollection=function(n,l){return void 0===l&&(l=!1),t(this,void 0,void 0,function(){var e;return u(this,function(t){switch(t.label){case 0:return this.ciphersComponent.showAddNew=!1,this.groupingsComponent.searchPlaceholder=this.i18nService.t("searchCollection"),e=function(l){return"unassigned"===n?null==l.collectionIds||0===l.collectionIds.length:l.collectionIds.indexOf(n)>-1},l?[4,this.ciphersComponent.load(e)]:[3,2];case 1:return t.sent(),[3,4];case 2:return[4,this.ciphersComponent.applyFilter(e)];case 3:t.sent(),t.label=4;case 4:return this.clearFilters(),this.collectionId=n,this.go(),[2]}})})},n.prototype.filterSearchText=function(n){this.ciphersComponent.searchText=n},n.prototype.editCipherAttachments=function(n){var l=this;if(null!=this.organization.maxStorageGb&&0!==this.organization.maxStorageGb){null!=this.modal&&this.modal.close();var e=this.componentFactoryResolver.resolveComponentFactory(o.ModalComponent);this.modal=this.attachmentsModalRef.createComponent(e).instance;var i=this.modal.show(a.AttachmentsComponent,this.attachmentsModalRef);i.organization=this.organization,i.cipherId=n.id;var r=!1;i.onUploadedAttachment.subscribe(function(){return r=!0}),i.onDeletedAttachment.subscribe(function(){return r=!0}),this.modal.onClosed.subscribe(function(){return t(l,void 0,void 0,function(){return u(this,function(n){switch(n.label){case 0:return this.modal=null,r?[4,this.ciphersComponent.refresh()]:[3,2];case 1:n.sent(),n.label=2;case 2:return r=!1,[2]}})})})}else this.messagingService.send("upgradeOrganization",{organizationId:n.organizationId})},n.prototype.editCipherCollections=function(n){var l=this;null!=this.modal&&this.modal.close();var e=this.componentFactoryResolver.resolveComponentFactory(o.ModalComponent);this.modal=this.collectionsModalRef.createComponent(e).instance;var i=this.modal.show(s.CollectionsComponent,this.collectionsModalRef);this.organization.isAdmin&&(i.collectionIds=n.collectionIds,i.collections=this.groupingsComponent.collections.filter(function(n){return!n.readOnly})),i.organization=this.organization,i.cipherId=n.id,i.onSavedCollections.subscribe(function(){return t(l,void 0,void 0,function(){return u(this,function(n){switch(n.label){case 0:return this.modal.close(),[4,this.ciphersComponent.refresh()];case 1:return n.sent(),[2]}})})}),this.modal.onClosed.subscribe(function(){return t(l,void 0,void 0,function(){return u(this,function(n){return this.modal=null,[2]})})})},n.prototype.addCipher=function(){this.editCipher(null).type=this.type},n.prototype.editCipher=function(n){var l=this;null!=this.modal&&this.modal.close();var e=this.componentFactoryResolver.resolveComponentFactory(o.ModalComponent);this.modal=this.cipherAddEditModalRef.createComponent(e).instance;var i=this.modal.show(r.AddEditComponent,this.cipherAddEditModalRef);return i.organization=this.organization,i.cipherId=null==n?null:n.id,i.onSavedCipher.subscribe(function(n){return t(l,void 0,void 0,function(){return u(this,function(n){switch(n.label){case 0:return this.modal.close(),[4,this.ciphersComponent.refresh()];case 1:return n.sent(),[2]}})})}),i.onDeletedCipher.subscribe(function(n){return t(l,void 0,void 0,function(){return u(this,function(n){switch(n.label){case 0:return this.modal.close(),[4,this.ciphersComponent.refresh()];case 1:return n.sent(),[2]}})})}),this.modal.onClosed.subscribe(function(){l.modal=null}),i},n.prototype.viewEvents=function(n){return t(this,void 0,void 0,function(){var l,e,t=this;return u(this,function(u){return null!=this.modal&&this.modal.close(),l=this.componentFactoryResolver.resolveComponentFactory(o.ModalComponent),this.modal=this.eventsModalRef.createComponent(l).instance,(e=this.modal.show(i.EntityEventsComponent,this.eventsModalRef)).name=n.name,e.organizationId=this.organization.id,e.entityId=n.id,e.showUser=!0,e.entity="cipher",this.modal.onClosed.subscribe(function(){t.modal=null}),[2]})})},n.prototype.clearFilters=function(){this.collectionId=null,this.type=null},n.prototype.go=function(n){void 0===n&&(n=null),null==n&&(n={type:this.type,collectionId:this.collectionId});var l=this.router.createUrlTree(["organizations",this.organization.id,"vault"],{queryParams:n}).toString();this.location.go(l)},n}());l.VaultComponent=d},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)}),o=this&&this.__awaiter||function(n,l,e,t){return new(e||(e=Promise))(function(u,o){function i(n){try{a(t.next(n))}catch(n){o(n)}}function r(n){try{a(t.throw(n))}catch(n){o(n)}}function a(n){n.done?u(n.value):new e(function(l){l(n.value)}).then(i,r)}a((t=t.apply(n,l||[])).next())})},i=this&&this.__generator||function(n,l){var e,t,u,o,i={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return o={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function r(o){return function(r){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;i;)try{if(e=1,t&&(u=t[2&o[0]?"return":o[0]?"throw":"next"])&&!(u=u.call(t,o[1])).done)return u;switch(t=0,u&&(o=[0,u.value]),o[0]){case 0:case 1:u=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,t=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(u=(u=i.trys).length>0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]-1}),[2]}})})},n.prototype.ngOnDestroy=function(){this.selectAll(!1)},n.prototype.submit=function(){return t(this,void 0,void 0,function(){return u(this,function(n){switch(n.label){case 0:return this.cipherDomain.collectionIds=this.collections.filter(function(n){return!!n.checked}).map(function(n){return n.id}),this.formPromise=this.saveCollections(),[4,this.formPromise];case 1:return n.sent(),this.onSavedCollections.emit(),this.analytics.eventTrack.next({action:"Edited Cipher Collections"}),this.toasterService.popAsync("success",null,this.i18nService.t("editedItem")),[2]}})})},n.prototype.check=function(n,l){n.checked=null==l?!n.checked:l},n.prototype.selectAll=function(n){var l=this;this.collections.forEach(function(e){return l.check(e,n)})},n.prototype.loadCipher=function(){return this.cipherService.get(this.cipherId)},n.prototype.loadCipherCollections=function(){return this.cipherDomain.collectionIds},n.prototype.loadCollections=function(){return t(this,void 0,void 0,function(){var n=this;return u(this,function(l){switch(l.label){case 0:return[4,this.collectionService.getAllDecrypted()];case 1:return[2,l.sent().filter(function(l){return!l.readOnly&&l.organizationId===n.cipher.organizationId})]}})})},n.prototype.saveCollections=function(){return this.cipherService.saveCollectionsWithServer(this.cipherDomain)},n}());l.CollectionsComponent=i},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)});Object.defineProperty(l,"__esModule",{value:!0});e(12),e(3),e(26),e(20),e(2),e(8),e(35);var o=function(n){function l(l,e,t,u,o,i,r){return n.call(this,l,e,t,u,o,i,r,window)||this}return u(l,n),l}(e(800).AttachmentsComponent);l.AttachmentsComponent=o},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)}),o=this&&this.__awaiter||function(n,l,e,t){return new(e||(e=Promise))(function(u,o){function i(n){try{a(t.next(n))}catch(n){o(n)}}function r(n){try{a(t.throw(n))}catch(n){o(n)}}function a(n){n.done?u(n.value):new e(function(l){l(n.value)}).then(i,r)}a((t=t.apply(n,l||[])).next())})},i=this&&this.__generator||function(n,l){var e,t,u,o,i={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return o={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function r(o){return function(r){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;i;)try{if(e=1,t&&(u=t[2&o[0]?"return":o[0]?"throw":"next"])&&!(u=u.call(t,o[1])).done)return u;switch(t=0,u&&(o=[0,u.value]),o[0]){case 0:case 1:u=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,t=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(u=(u=i.trys).length>0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]-1})];case 1:return l.sent(),this.clearFilters(),this.collectionId=n,this.go(),[2]}})})},n.prototype.filterSearchText=function(n){this.ciphersComponent.searchText=n},n.prototype.editCipherAttachments=function(n){return t(this,void 0,void 0,function(){var l,e,i,r,s,d=this;return u(this,function(c){switch(c.label){case 0:return[4,this.tokenService.getPremium()];case 1:return l=c.sent(),null!=n.organizationId||l?[3,2]:(this.messagingService.send("premiumRequired"),[2]);case 2:return null==n.organizationId?[3,4]:[4,this.userService.getOrganization(n.organizationId)];case 3:if(null!=(e=c.sent())&&(null==e.maxStorageGb||0===e.maxStorageGb))return this.messagingService.send("upgradeOrganization",{organizationId:n.organizationId}),[2];c.label=4;case 4:return null!=this.modal&&this.modal.close(),i=this.componentFactoryResolver.resolveComponentFactory(o.ModalComponent),this.modal=this.attachmentsModalRef.createComponent(i).instance,(r=this.modal.show(a.AttachmentsComponent,this.attachmentsModalRef)).cipherId=n.id,s=!1,r.onUploadedAttachment.subscribe(function(){return s=!0}),r.onDeletedAttachment.subscribe(function(){return s=!0}),this.modal.onClosed.subscribe(function(){return t(d,void 0,void 0,function(){return u(this,function(n){switch(n.label){case 0:return this.modal=null,s?[4,this.ciphersComponent.refresh()]:[3,2];case 1:n.sent(),n.label=2;case 2:return s=!1,[2]}})})}),[2]}})})},n.prototype.shareCipher=function(n){var l=this;null!=this.modal&&this.modal.close();var e=this.componentFactoryResolver.resolveComponentFactory(o.ModalComponent);this.modal=this.shareModalRef.createComponent(e).instance;var i=this.modal.show(v.ShareComponent,this.shareModalRef);i.cipherId=n.id,i.onSharedCipher.subscribe(function(){return t(l,void 0,void 0,function(){return u(this,function(n){switch(n.label){case 0:return this.modal.close(),[4,this.ciphersComponent.refresh()];case 1:return n.sent(),[2]}})})}),this.modal.onClosed.subscribe(function(){return t(l,void 0,void 0,function(){return u(this,function(n){return this.modal=null,[2]})})})},n.prototype.editCipherCollections=function(n){var l=this;null!=this.modal&&this.modal.close();var e=this.componentFactoryResolver.resolveComponentFactory(o.ModalComponent);this.modal=this.collectionsModalRef.createComponent(e).instance;var i=this.modal.show(p.CollectionsComponent,this.collectionsModalRef);i.cipherId=n.id,i.onSavedCollections.subscribe(function(){return t(l,void 0,void 0,function(){return u(this,function(n){switch(n.label){case 0:return this.modal.close(),[4,this.ciphersComponent.refresh()];case 1:return n.sent(),[2]}})})}),this.modal.onClosed.subscribe(function(){return t(l,void 0,void 0,function(){return u(this,function(n){return this.modal=null,[2]})})})},n.prototype.addFolder=function(){return t(this,void 0,void 0,function(){var n,l,e=this;return u(this,function(i){return null!=this.modal&&this.modal.close(),n=this.componentFactoryResolver.resolveComponentFactory(o.ModalComponent),this.modal=this.folderAddEditModalRef.createComponent(n).instance,(l=this.modal.show(f.FolderAddEditComponent,this.folderAddEditModalRef)).folderId=null,l.onSavedFolder.subscribe(function(){return t(e,void 0,void 0,function(){return u(this,function(n){switch(n.label){case 0:return this.modal.close(),[4,this.groupingsComponent.loadFolders()];case 1:return n.sent(),[2]}})})}),this.modal.onClosed.subscribe(function(){e.modal=null}),[2]})})},n.prototype.editFolder=function(n){return t(this,void 0,void 0,function(){var l,e,i=this;return u(this,function(r){return null!=this.modal&&this.modal.close(),l=this.componentFactoryResolver.resolveComponentFactory(o.ModalComponent),this.modal=this.folderAddEditModalRef.createComponent(l).instance,(e=this.modal.show(f.FolderAddEditComponent,this.folderAddEditModalRef)).folderId=n,e.onSavedFolder.subscribe(function(){return t(i,void 0,void 0,function(){return u(this,function(n){switch(n.label){case 0:return this.modal.close(),[4,this.groupingsComponent.loadFolders()];case 1:return n.sent(),[2]}})})}),e.onDeletedFolder.subscribe(function(){return t(i,void 0,void 0,function(){return u(this,function(n){switch(n.label){case 0:return this.modal.close(),[4,this.groupingsComponent.loadFolders()];case 1:return n.sent(),[4,this.filterFolder("none")];case 2:return n.sent(),this.groupingsComponent.selectedFolderId=null,[2]}})})}),this.modal.onClosed.subscribe(function(){i.modal=null}),[2]})})},n.prototype.addCipher=function(){var n=this.editCipher(null);n.type=this.type,n.folderId="none"===this.folderId?null:this.folderId},n.prototype.editCipher=function(n){var l=this;null!=this.modal&&this.modal.close();var e=this.componentFactoryResolver.resolveComponentFactory(o.ModalComponent);this.modal=this.cipherAddEditModalRef.createComponent(e).instance;var i=this.modal.show(r.AddEditComponent,this.cipherAddEditModalRef);return i.cipherId=null==n?null:n.id,i.onSavedCipher.subscribe(function(n){return t(l,void 0,void 0,function(){return u(this,function(n){switch(n.label){case 0:return this.modal.close(),[4,this.ciphersComponent.refresh()];case 1:return n.sent(),[2]}})})}),i.onDeletedCipher.subscribe(function(n){return t(l,void 0,void 0,function(){return u(this,function(n){switch(n.label){case 0:return this.modal.close(),[4,this.ciphersComponent.refresh()];case 1:return n.sent(),[2]}})})}),this.modal.onClosed.subscribe(function(){l.modal=null}),i},n.prototype.bulkDelete=function(){var n=this,l=this.ciphersComponent.getSelectedIds();if(0!==l.length){null!=this.modal&&this.modal.close();var e=this.componentFactoryResolver.resolveComponentFactory(o.ModalComponent);this.modal=this.bulkDeleteModalRef.createComponent(e).instance;var i=this.modal.show(s.BulkDeleteComponent,this.bulkDeleteModalRef);i.cipherIds=l,i.onDeleted.subscribe(function(){return t(n,void 0,void 0,function(){return u(this,function(n){switch(n.label){case 0:return this.modal.close(),[4,this.ciphersComponent.refresh()];case 1:return n.sent(),[2]}})})}),this.modal.onClosed.subscribe(function(){n.modal=null})}else this.toasterService.popAsync("error",this.i18nService.t("errorOccurred"),this.i18nService.t("nothingSelected"))},n.prototype.bulkShare=function(){var n=this,l=this.ciphersComponent.getSelected();if(0!==l.length){null!=this.modal&&this.modal.close();var e=this.componentFactoryResolver.resolveComponentFactory(o.ModalComponent);this.modal=this.bulkShareModalRef.createComponent(e).instance;var i=this.modal.show(c.BulkShareComponent,this.bulkShareModalRef);i.ciphers=l,i.onShared.subscribe(function(){return t(n,void 0,void 0,function(){return u(this,function(n){switch(n.label){case 0:return this.modal.close(),[4,this.ciphersComponent.refresh()];case 1:return n.sent(),[2]}})})}),this.modal.onClosed.subscribe(function(){return t(n,void 0,void 0,function(){return u(this,function(n){return this.modal=null,[2]})})})}else this.toasterService.popAsync("error",this.i18nService.t("errorOccurred"),this.i18nService.t("nothingSelected"))},n.prototype.bulkMove=function(){var n=this,l=this.ciphersComponent.getSelectedIds();if(0!==l.length){null!=this.modal&&this.modal.close();var e=this.componentFactoryResolver.resolveComponentFactory(o.ModalComponent);this.modal=this.bulkMoveModalRef.createComponent(e).instance;var i=this.modal.show(d.BulkMoveComponent,this.bulkMoveModalRef);i.cipherIds=l,i.onMoved.subscribe(function(){return t(n,void 0,void 0,function(){return u(this,function(n){switch(n.label){case 0:return this.modal.close(),[4,this.ciphersComponent.refresh()];case 1:return n.sent(),[2]}})})}),this.modal.onClosed.subscribe(function(){n.modal=null})}else this.toasterService.popAsync("error",this.i18nService.t("errorOccurred"),this.i18nService.t("nothingSelected"))},n.prototype.selectAll=function(n){this.ciphersComponent.selectAll(n)},n.prototype.updateKey=function(){var n=this;null!=this.modal&&this.modal.close();var l=this.componentFactoryResolver.resolveComponentFactory(o.ModalComponent);this.modal=this.updateKeyModalRef.createComponent(l).instance,this.modal.show(i.UpdateKeyComponent,this.updateKeyModalRef),this.modal.onClosed.subscribe(function(){n.modal=null})},n.prototype.clearFilters=function(){this.folderId=null,this.collectionId=null,this.favorites=!1,this.type=null},n.prototype.go=function(n){void 0===n&&(n=null),null==n&&(n={favorites:!!this.favorites||null,type:this.type,folderId:this.folderId,collectionId:this.collectionId});var l=this.router.createUrlTree(["vault"],{queryParams:n}).toString();this.location.go(l)},n.prototype.inOrgWithPremium=function(){return t(this,void 0,void 0,function(){var n,l;return u(this,function(e){switch(e.label){case 0:return[4,this.userService.getAllOrganizations()];case 1:for(n=e.sent(),l=0;l0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]-1?(n="http://"+n,l=!0):this.imageEnabled&&(l=0===n.indexOf("http")&&n.indexOf(".")>-1),this.imageEnabled&&l)try{this.image=this.iconsUrl+"/"+r.Utils.getHostname(n)+"/icon.png",this.fallbackImage="images/fa-globe.png"}catch(n){}}else this.image=null},n}();l.IconComponent=a},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});e(0);var t=function(){function n(){}return n.prototype.ngOnInit=function(){document.body.classList.remove("layout_frontend")},n}();l.UserLayoutComponent=t},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});e(0),e(8);var t=function(){function n(n){this.platformUtilsService=n,this.year="2015"}return n.prototype.ngOnInit=function(){this.year=(new Date).getFullYear().toString(),this.version=this.platformUtilsService.getApplicationVersion()},n}();l.FooterComponent=t},function(n,l,e){"use strict";var t=this&&this.__awaiter||function(n,l,e,t){return new(e||(e=Promise))(function(u,o){function i(n){try{a(t.next(n))}catch(n){o(n)}}function r(n){try{a(t.throw(n))}catch(n){o(n)}}function a(n){n.done?u(n.value):new e(function(l){l(n.value)}).then(i,r)}a((t=t.apply(n,l||[])).next())})},u=this&&this.__generator||function(n,l){var e,t,u,o,i={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return o={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function r(o){return function(r){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;i;)try{if(e=1,t&&(u=t[2&o[0]?"return":o[0]?"throw":"next"])&&!(u=u.call(t,o[1])).done)return u;switch(t=0,u&&(o=[0,u.value]),o[0]){case 0:case 1:u=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,t=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(u=(u=i.trys).length>0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]-1&&(n.email=l.email),null!=l.premium?n.stateService.save("loginRedirect",{route:"/settings/premium"}):null!=l.org&&(n.showCreateOrgMessage=!0,n.stateService.save("loginRedirect",{route:"/settings/create-organization",qParams:{plan:l.org}}))})},l}(e(830).RegisterComponent);l.RegisterComponent=o},function(n,l,e){var t,u,o;u=[],void 0===(o="function"==typeof(t=function(){var n,l,e,t,u,o=/^(?:AUTH|ENROLL)+\|[A-Za-z0-9\+\/=]+\|[A-Za-z0-9\+\/=]+$/,i=/^ERR\|[\w\s\.\(\)]+$/,r=/^DUO_OPEN_WINDOW\|/,a=["duo.com","duosecurity.com","duomobile.s3-us-west-1.amazonaws.com"],s="duo_iframe",d="",c="sig_response";function p(n,l){throw new Error("Duo Web SDK error: "+n+(l?"\nSee "+l+" for more information":""))}function f(n,l){return"dataset"in n?n.dataset[l]:n.getAttribute("data-"+l.replace(/([a-z])([A-Z])/,"$1-$2").toLowerCase())}function v(n,l,e,t){"addEventListener"in window?n.addEventListener(l,t,!1):n.attachEvent(e,t)}function h(n,l,e,t){"removeEventListener"in window?n.removeEventListener(l,t,!1):n.detachEvent(e,t)}function g(n){v(document,"DOMContentLoaded","onreadystatechange",n)}function m(n){h(document,"DOMContentLoaded","onreadystatechange",n)}function y(n){if(n){0===n.indexOf("ERR|")&&p(n.split("|")[1]),-1!==n.indexOf(":")&&2===n.split(":").length||p("Duo was given a bad token. This might indicate a configuration problem with one of Duo's client libraries.","https://www.duosecurity.com/docs/duoweb#first-steps");var t=n.split(":");return l=t[0],e=t[1],{sigRequest:n,duoSig:t[0],appSig:t[1]}}}function C(){if(!(t=document.getElementById(s)))throw new Error('This page does not contain an iframe for Duo to use.Add an element like to this page. See https://www.duosecurity.com/docs/duoweb#3.-show-the-iframe for more information.');w(),m(C)}function b(l){return Boolean(l.origin==="https://"+n&&"string"==typeof l.data&&(l.data.match(o)||l.data.match(i)||l.data.match(r)))}function S(n){if(b(n))if(n.data.match(r)){var l=n.data.substring("DUO_OPEN_WINDOW|".length);(function(n){if(!n)return!1;var l=document.createElement("a");if(l.href=n,"duotrustedendpoints:"===l.protocol)return!0;if("https:"!==l.protocol)return!1;for(var e=0;e0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]-1&&(this.email=e.email),null!=e.premium?this.stateService.save("loginRedirect",{route:"/settings/premium"}):null!=e.org&&this.stateService.save("loginRedirect",{route:"/settings/create-organization",qParams:{plan:e.org}}),[4,n.prototype.ngOnInit.call(this)];case 1:return l.sent(),[2]}})})}),[2]})})},l.prototype.goAfterLogIn=function(){return o(this,void 0,void 0,function(){var n,l;return i(this,function(e){switch(e.label){case 0:return[4,this.stateService.get("orgInvitation")];case 1:return null==(n=e.sent())?[3,2]:(this.router.navigate(["accept-organization"],{queryParams:n}),[3,6]);case 2:return[4,this.stateService.get("loginRedirect")];case 3:return null==(l=e.sent())?[3,5]:(this.router.navigate([l.route],{queryParams:l.qParams}),[4,this.stateService.remove("loginRedirect")]);case 4:return e.sent(),[3,6];case 5:this.router.navigate([this.successRoute]),e.label=6;case 6:return[2]}})})},l}(e(850).LoginComponent);l.LoginComponent=r},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});e(0),e(8);var t=function(){function n(n){this.platformUtilsService=n}return n.prototype.ngOnInit=function(){this.version=this.platformUtilsService.getApplicationVersion(),document.body.classList.add("layout_frontend")},n.prototype.ngOnDestroy=function(){document.body.classList.remove("layout_frontend")},n}();l.FrontendLayoutComponent=t},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(){}}();l.SettingsService=t},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(){}}();l.LockService=t},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(n,l,e){"use strict";var t=this&&this.__awaiter||function(n,l,e,t){return new(e||(e=Promise))(function(u,o){function i(n){try{a(t.next(n))}catch(n){o(n)}}function r(n){try{a(t.throw(n))}catch(n){o(n)}}function a(n){n.done?u(n.value):new e(function(l){l(n.value)}).then(i,r)}a((t=t.apply(n,l||[])).next())})},u=this&&this.__generator||function(n,l){var e,t,u,o,i={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return o={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function r(o){return function(r){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;i;)try{if(e=1,t&&(u=t[2&o[0]?"return":o[0]?"throw":"next"])&&!(u=u.call(t,o[1])).done)return u;switch(t=0,u&&(o=[0,u.value]),o[0]){case 0:case 1:u=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,t=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(u=(u=i.trys).length>0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]=n.length&&(n=Array(l+1-n.length).join(e)+n),n},n.prototype.dec2hex=function(n){return(n<15.5?"0":"")+Math.round(n).toString(16)},n.prototype.hex2dec=function(n){return parseInt(n,16)},n.prototype.b32tohex=function(n){n=n.toUpperCase();for(var l="",e=0;e0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&n.push(l.domains)}),[2,this.settingsService.setEquivalentDomains(n)]})})},n}();l.SyncService=d},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){function n(){this.state={}}return n.prototype.get=function(n){return this.state.hasOwnProperty(n)?Promise.resolve(this.state[n]):Promise.resolve(null)},n.prototype.save=function(n,l){return this.state[n]=l,Promise.resolve()},n.prototype.remove=function(n){return delete this.state[n],Promise.resolve()},n.prototype.purge=function(){return this.state={},Promise.resolve()},n}();l.StateService=t},function(n,l,e){"use strict";var t=this&&this.__awaiter||function(n,l,e,t){return new(e||(e=Promise))(function(u,o){function i(n){try{a(t.next(n))}catch(n){o(n)}}function r(n){try{a(t.throw(n))}catch(n){o(n)}}function a(n){n.done?u(n.value):new e(function(l){l(n.value)}).then(i,r)}a((t=t.apply(n,l||[])).next())})},u=this&&this.__generator||function(n,l){var e,t,u,o,i={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return o={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function r(o){return function(r){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;i;)try{if(e=1,t&&(u=t[2&o[0]?"return":o[0]?"throw":"next"])&&!(u=u.call(t,o[1])).done)return u;switch(t=0,u&&(o=[0,u.value]),o[0]){case 0:case 1:u=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,t=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(u=(u=i.trys).length>0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0)for(p=0;p0)for(p=0;p0)for(p=0;p0)for(p=0;p100&&l.pop(),[4,this.encryptHistory(l)]);case 3:return e=t.sent(),[4,this.storageService.save(s,e)];case 4:return[2,t.sent()]}})})},n.prototype.clear=function(){return t(this,void 0,void 0,function(){return u(this,function(n){switch(n.label){case 0:return this.history=[],[4,this.storageService.remove(s)];case 1:return[2,n.sent()]}})})},n.prototype.encryptHistory=function(n){return t(this,void 0,void 0,function(){var l,e=this;return u(this,function(o){switch(o.label){case 0:return null==n||0===n.length?[2,Promise.resolve([])]:(l=n.map(function(n){return t(e,void 0,void 0,function(){var l;return u(this,function(e){switch(e.label){case 0:return[4,this.cryptoService.encrypt(n.password)];case 1:return l=e.sent(),[2,new i.PasswordHistory(l.encryptedString,n.date)]}})})}),[4,Promise.all(l)]);case 1:return[2,o.sent()]}})})},n.prototype.decryptHistory=function(n){return t(this,void 0,void 0,function(){var l,e=this;return u(this,function(r){switch(r.label){case 0:return null==n||0===n.length?[2,Promise.resolve([])]:(l=n.map(function(n){return t(e,void 0,void 0,function(){var l;return u(this,function(e){switch(e.label){case 0:return[4,this.cryptoService.decryptToUtf8(new o.CipherString(n.password))];case 1:return l=e.sent(),[2,new i.PasswordHistory(l,n.date)]}})})}),[4,Promise.all(l)]);case 1:return[2,r.sent()]}})})},n.prototype.matchesPrevious=function(n,l){return null!=l&&0!==l.length&&l[l.length-1].password===n},n.prototype.shuffleArray=function(n){return t(this,void 0,void 0,function(){var l,e,t;return u(this,function(u){switch(u.label){case 0:e=n.length-1,u.label=1;case 1:return e>0?[4,this.cryptoService.randomNumber(0,e)]:[3,4];case 2:t=u.sent(),l=[n[t],n[e]],n[e]=l[0],n[t]=l[1],u.label=3;case 3:return e--,[3,1];case 4:return[2]}})})},n}();l.PasswordGenerationService=d},function(n,l,e){"use strict";var t=this&&this.__awaiter||function(n,l,e,t){return new(e||(e=Promise))(function(u,o){function i(n){try{a(t.next(n))}catch(n){o(n)}}function r(n){try{a(t.throw(n))}catch(n){o(n)}}function a(n){n.done?u(n.value):new e(function(l){l(n.value)}).then(i,r)}a((t=t.apply(n,l||[])).next())})},u=this&&this.__generator||function(n,l){var e,t,u,o,i={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return o={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function r(o){return function(r){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;i;)try{if(e=1,t&&(u=t[2&o[0]?"return":o[0]?"throw":"next"])&&!(u=u.call(t,o[1])).done)return u;switch(t=0,u&&(o=[0,u.value]),o[0]){case 0:case 1:u=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,t=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(u=(u=i.trys).length>0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]=e?[4,this.lock()]:[3,6]);case 5:t.sent(),t.label=6;case 6:return[2]}})})},n.prototype.lock=function(){return t(this,void 0,void 0,function(){return u(this,function(n){switch(n.label){case 0:return[4,Promise.all([this.cryptoService.clearKey(),this.cryptoService.clearOrgKeys(!0),this.cryptoService.clearKeyPair(!0),this.cryptoService.clearEncKey(!0)])];case 1:return n.sent(),this.folderService.clearCache(),this.cipherService.clearCache(),this.collectionService.clearCache(),this.messagingService.send("locked"),null==this.lockedCallback?[3,3]:[4,this.lockedCallback()];case 2:n.sent(),n.label=3;case 3:return[2]}})})},n.prototype.setLockOption=function(n){return t(this,void 0,void 0,function(){return u(this,function(l){switch(l.label){case 0:return[4,this.storageService.save(o.ConstantsService.lockOptionKey,n)];case 1:return l.sent(),[4,this.cryptoService.toggleKey()];case 2:return l.sent(),[2]}})})},n}();l.LockService=i},function(n,l,e){"use strict";var t=this&&this.__awaiter||function(n,l,e,t){return new(e||(e=Promise))(function(u,o){function i(n){try{a(t.next(n))}catch(n){o(n)}}function r(n){try{a(t.throw(n))}catch(n){o(n)}}function a(n){n.done?u(n.value):new e(function(l){l(n.value)}).then(i,r)}a((t=t.apply(n,l||[])).next())})},u=this&&this.__generator||function(n,l){var e,t,u,o,i={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return o={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function r(o){return function(r){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;i;)try{if(e=1,t&&(u=t[2&o[0]?"return":o[0]?"throw":"next"])&&!(u=u.call(t,o[1])).done)return u;switch(t=0,u&&(o=[0,u.value]),o[0]){case 0:case 1:u=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,t=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(u=(u=i.trys).length>0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&this.cipherService.upsert(o)}return[2]}})})},n.prototype.deleteWithServer=function(n){return t(this,void 0,void 0,function(){return u(this,function(l){switch(l.label){case 0:return[4,this.apiService.deleteFolder(n)];case 1:return l.sent(),[4,this.delete(n)];case 2:return l.sent(),[2]}})})},n}();l.FolderService=p},function(n,l,e){"use strict";var t=this&&this.__awaiter||function(n,l,e,t){return new(e||(e=Promise))(function(u,o){function i(n){try{a(t.next(n))}catch(n){o(n)}}function r(n){try{a(t.throw(n))}catch(n){o(n)}}function a(n){n.done?u(n.value):new e(function(l){l(n.value)}).then(i,r)}a((t=t.apply(n,l||[])).next())})},u=this&&this.__generator||function(n,l){var e,t,u,o,i={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return o={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function r(o){return function(r){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;i;)try{if(e=1,t&&(u=t[2&o[0]?"return":o[0]?"throw":"next"])&&!(u=u.call(t,o[1])).done)return u;switch(t=0,u&&(o=[0,u.value]),o[0]){case 0:case 1:u=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,t=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(u=(u=i.trys).length>0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]=0;r--)(u=n[r])&&(i=(o<3?u(i):o>3?u(l,e,i):u(l,e))||i);return o>3&&i&&Object.defineProperty(l,e,i),i},u=this&&this.__metadata||function(n,l){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(n,l)},o=this&&this.__awaiter||function(n,l,e,t){return new(e||(e=Promise))(function(u,o){function i(n){try{a(t.next(n))}catch(n){o(n)}}function r(n){try{a(t.throw(n))}catch(n){o(n)}}function a(n){n.done?u(n.value):new e(function(l){l(n.value)}).then(i,r)}a((t=t.apply(n,l||[])).next())})},i=this&&this.__generator||function(n,l){var e,t,u,o,i={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return o={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function r(o){return function(r){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;i;)try{if(e=1,t&&(u=t[2&o[0]?"return":o[0]?"throw":"next"])&&!(u=u.call(t,o[1])).done)return u;switch(t=0,u&&(o=[0,u.value]),o[0]){case 0:case 1:u=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,t=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(u=(u=i.trys).length>0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0?[2,this.orgKeys]:[4,this.storageService.get(h)];case 1:if(null==(n=i.sent()))return[2,null];for(u in l=new Map,e=!1,t=[],n)t.push(u);o=0,i.label=2;case 2:return o53)throw new Error("We cannot generate numbers larger than 53 bits.");return o=Math.ceil(u/8),r=Math.pow(2,u)-1,s=Uint8Array.bind,[4,this.cryptoFunctionService.randomBytes(o)];case 1:for(a=new(s.apply(Uint8Array,[void 0,i.sent()])),d=8*(o-1),c=0;c=t?[2,this.randomNumber(n,l)]:[2,n+e]}})})},n.prototype.aesEncrypt=function(n,l){return o(this,void 0,void 0,function(){var e,t,u,o,r,a;return i(this,function(i){switch(i.label){case 0:return e=new s.EncryptedObject,t=e,[4,this.getKeyForEncryption(l)];case 1:return t.key=i.sent(),u=e,[4,this.cryptoFunctionService.randomBytes(16)];case 2:return u.iv=i.sent(),o=e,[4,this.cryptoFunctionService.aesEncrypt(n,e.iv,e.key.encKey)];case 3:return o.data=i.sent(),null==e.key.macKey?[3,5]:((r=new Uint8Array(e.iv.byteLength+e.data.byteLength)).set(new Uint8Array(e.iv),0),r.set(new Uint8Array(e.data),e.iv.byteLength),a=e,[4,this.cryptoFunctionService.hmac(r.buffer,e.key.macKey,"sha256")]);case 4:a.mac=i.sent(),i.label=5;case 5:return[2,e]}})})},n.prototype.aesDecryptToUtf8=function(n,l,e,t,u){return o(this,void 0,void 0,function(){var o,r,a,s;return i(this,function(i){switch(i.label){case 0:return[4,this.getKeyForEncryption(u)];case 1:return o=i.sent(),null!=(r=this.resolveLegacyKey(n,o)).macKey&&null==t?(console.error("mac required."),[2,null]):r.encType!==n?(console.error("encType unavailable."),[2,null]):null==(a=this.cryptoFunctionService.aesDecryptFastParameters(l,e,t,r)).macKey||null==a.mac?[3,4]:[4,this.cryptoFunctionService.hmacFast(a.macData,a.macKey,"sha256")];case 2:return s=i.sent(),[4,this.cryptoFunctionService.compareFast(a.mac,s)];case 3:if(!i.sent())return console.error("mac failed."),[2,null];i.label=4;case 4:return[2,this.cryptoFunctionService.aesDecryptFast(a)]}})})},n.prototype.aesDecryptToBytes=function(n,l,e,t,u){return o(this,void 0,void 0,function(){var o,r,a,s;return i(this,function(i){switch(i.label){case 0:return[4,this.getKeyForEncryption(u)];case 1:return o=i.sent(),null!=(r=this.resolveLegacyKey(n,o)).macKey&&null==t?[2,null]:r.encType!==n?[2,null]:null==r.macKey||null==t?[3,4]:((a=new Uint8Array(e.byteLength+l.byteLength)).set(new Uint8Array(e),0),a.set(new Uint8Array(l),e.byteLength),[4,this.cryptoFunctionService.hmac(a.buffer,r.macKey,"sha256")]);case 2:return null===(s=i.sent())?[2,null]:[4,this.cryptoFunctionService.compare(t,s)];case 3:if(!i.sent())return console.error("mac failed."),[2,null];i.label=4;case 4:return[4,this.cryptoFunctionService.aesDecrypt(l,e,r.encKey)];case 5:return[2,i.sent()]}})})},n.prototype.rsaDecrypt=function(n){return o(this,void 0,void 0,function(){var l,e,t,u,o,a,s,d,c;return i(this,function(i){switch(i.label){case 0:if(l=n.split("."),e=null,1===l.length)e=r.EncryptionType.Rsa2048_OaepSha256_B64,t=[l[0]];else if(2===l.length)try{e=parseInt(l[0],null),t=l[1].split("|")}catch(n){}switch(e){case r.EncryptionType.Rsa2048_OaepSha256_B64:case r.EncryptionType.Rsa2048_OaepSha1_B64:if(1!==t.length)throw new Error("Invalid cipher format.");break;case r.EncryptionType.Rsa2048_OaepSha256_HmacSha256_B64:case r.EncryptionType.Rsa2048_OaepSha1_HmacSha256_B64:if(2!==t.length)throw new Error("Invalid cipher format.");break;default:throw new Error("encType unavailable.")}if(null==t||t.length<=0)throw new Error("encPieces unavailable.");return u=f.Utils.fromB64ToArray(t[0]).buffer,[4,this.getEncKey()];case 1:return null!=(o=i.sent())&&null!=o.macKey&&t.length>1?(a=f.Utils.fromB64ToArray(t[1]).buffer,[4,this.cryptoFunctionService.hmac(u,o.macKey,"sha256")]):[3,4];case 2:return s=i.sent(),[4,this.cryptoFunctionService.compare(a,s)];case 3:if(!i.sent())throw new Error("MAC failed.");i.label=4;case 4:return[4,this.getPrivateKey()];case 5:if(null==(d=i.sent()))throw new Error("No private key.");switch(c="sha1",e){case r.EncryptionType.Rsa2048_OaepSha256_B64:case r.EncryptionType.Rsa2048_OaepSha256_HmacSha256_B64:c="sha256";break;case r.EncryptionType.Rsa2048_OaepSha1_B64:case r.EncryptionType.Rsa2048_OaepSha1_HmacSha256_B64:break;default:throw new Error("encType unavailable.")}return[2,this.cryptoFunctionService.rsaDecrypt(u,d,c)]}})})},n.prototype.getKeyForEncryption=function(n){return o(this,void 0,void 0,function(){var l;return i(this,function(e){switch(e.label){case 0:return null!=n?[2,n]:[4,this.getEncKey()];case 1:return null!=(l=e.sent())?[2,l]:[4,this.getKey()];case 2:return[2,e.sent()]}})})},n.prototype.resolveLegacyKey=function(n,l){return n===r.EncryptionType.AesCbc128_HmacSha256_B64&&l.encType===r.EncryptionType.AesCbc256_B64?(null==this.legacyEtmKey&&(this.legacyEtmKey=new d.SymmetricCryptoKey(l.key,r.EncryptionType.AesCbc128_HmacSha256_B64)),this.legacyEtmKey):l},n.prototype.stretchKey=function(n){return o(this,void 0,void 0,function(){var l,e,t,u,o;return i(this,function(i){switch(i.label){case 0:return l=new Uint8Array(64),t=(e=l).set,[4,this.hkdfExpand(n.key,f.Utils.fromUtf8ToArray("enc"),32)];case 1:return t.apply(e,[i.sent()]),o=(u=l).set,[4,this.hkdfExpand(n.key,f.Utils.fromUtf8ToArray("mac"),32)];case 2:return o.apply(u,[i.sent(),32]),[2,new d.SymmetricCryptoKey(l.buffer)]}})})},n.prototype.hkdfExpand=function(n,l,e){return o(this,void 0,void 0,function(){var t,u,o,r,a,s,d;return i(this,function(i){switch(i.label){case 0:t=32,u=new Uint8Array(e),o=new Uint8Array(0),r=Math.ceil(e/t),a=0,i.label=1;case 1:return a0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]-1})]}})})},l.prototype.getAllDecryptedForUrl=function(n,l){return t(this,void 0,void 0,function(){var e,t,r,a;return u(this,function(u){switch(u.label){case 0:return null!=n||l?(e=this.platformUtilsService.getDomain(n),t=null==e?Promise.resolve([]):this.settingsService.getEquivalentDomains().then(function(n){var l=[];return n.forEach(function(n){n.length&&n.indexOf(e)>=0&&(l=l.concat(n))}),l.length||l.push(e),l}),[4,Promise.all([t,this.getAllDecrypted()])]):[2,Promise.resolve([])];case 1:return r=u.sent(),a=r[0],[2,r[1].filter(function(t){if(l&&l.indexOf(t.type)>-1)return!0;if(null!=n&&t.type===o.CipherType.Login&&null!=t.login.uris)for(var u=0;u-1)return!0;break;case i.UriMatchType.Host:var s=w.Utils.getHost(n);if(null!=s&&s===w.Utils.getHost(r.uri))return!0;break;case i.UriMatchType.Exact:if(n===r.uri)return!0;break;case i.UriMatchType.StartsWith:if(n.startsWith(r.uri))return!0;break;case i.UriMatchType.RegularExpression:try{if(new RegExp(r.uri,"i").test(n))return!0}catch(n){}break;case i.UriMatchType.Never:}}return!1})]}})})},l.prototype.getLastUsedForUrl=function(n){return t(this,void 0,void 0,function(){var l;return u(this,function(e){switch(e.label){case 0:return[4,this.getAllDecryptedForUrl(n)];case 1:return 0===(l=e.sent()).length?[2,null]:[2,l.sort(this.sortCiphersByLastUsed)[0]]}})})},l.prototype.updateLastUsedDate=function(n){return t(this,void 0,void 0,function(){var l,e,t;return u(this,function(u){switch(u.label){case 0:return[4,this.storageService.get(_)];case 1:return(l=u.sent())||(l={}),l[n]?l[n].lastUsedDate=(new Date).getTime():l[n]={lastUsedDate:(new Date).getTime()},[4,this.storageService.save(_,l)];case 2:if(u.sent(),null==this.decryptedCipherCache)return[2];for(e=0;et?-1:null!=t&&null==e?1:0},l.prototype.sortCiphersByLastUsedThenName=function(n,l){var e=this.sortCiphersByLastUsed(n,l);return 0!==e?e:this.getLocaleSortingFunction()(n,l)},l.prototype.getLocaleSortingFunction=function(){var n=this;return function(l,e){var t=l.name,u=e.name;if(null==t&&null!=u)return-1;if(null!=t&&null==u)return 1;if(null==t&&null==u)return 0;var i=n.i18nService.collator?n.i18nService.collator.compare(t,u):t.localeCompare(u);return 0!==i||l.type!==o.CipherType.Login||e.type!==o.CipherType.Login?i:(null!=l.login.username&&(t+=l.login.username),null!=e.login.username&&(u+=e.login.username),n.i18nService.collator?n.i18nService.collator.compare(t,u):t.localeCompare(u))}},l.prototype.encryptObjProperty=function(n,l,e,o){return t(this,void 0,void 0,function(){var t,i,r;return u(this,function(u){switch(u.label){case 0:for(r in t=[],i=this,e)e.hasOwnProperty(r)&&function(l,u){var r=Promise.resolve().then(function(){var t=n[e[l]||l];return t&&""!==t?i.cryptoService.encrypt(t,o):null}).then(function(n){u[l]=n});t.push(r)}(r,l);return[4,Promise.all(t)];case 1:return u.sent(),[2]}})})},l.prototype.encryptCipherData=function(n,l,e){return t(this,void 0,void 0,function(){var t,i;return u(this,function(u){switch(u.label){case 0:switch(n.type){case o.CipherType.Login:return[3,1];case o.CipherType.SecureNote:return[3,7];case o.CipherType.Card:return[3,8];case o.CipherType.Identity:return[3,10]}return[3,12];case 1:return n.login=new f.Login,[4,this.encryptObjProperty(l.login,n.login,{username:null,password:null,totp:null},e)];case 2:if(u.sent(),null==l.login.uris)return[3,6];n.login.uris=[],t=0,u.label=3;case 3:return t0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]-1?[4,l.json()]:[3,3];case 2:e=u.sent(),u.label=3;case 3:return null==e?[3,6]:200!==l.status?[3,4]:[2,new g.IdentityTokenResponse(e)];case 4:return 400===l.status&&e.TwoFactorProviders2&&Object.keys(e.TwoFactorProviders2).length?[4,this.tokenService.clearTwoFactorToken(n.email)]:[3,6];case 5:return u.sent(),[2,new m.IdentityTwoFactorResponse(e)];case 6:return[2,Promise.reject(new c.ErrorResponse(e,l.status,!0))]}})})},n.prototype.refreshIdentityToken=function(){return t(this,void 0,void 0,function(){return u(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.doRefreshToken()];case 1:return n.sent(),[3,3];case 2:return n.sent(),[2,Promise.reject(null)];case 3:return[2]}})})},n.prototype.getProfile=function(){return t(this,void 0,void 0,function(){var n;return u(this,function(l){switch(l.label){case 0:return[4,this.send("GET","/accounts/profile",null,!0,!0)];case 1:return n=l.sent(),[2,new w.ProfileResponse(n)]}})})},n.prototype.getUserBilling=function(){return t(this,void 0,void 0,function(){var n;return u(this,function(l){switch(l.label){case 0:return[4,this.send("GET","/accounts/billing",null,!0,!0)];case 1:return n=l.sent(),[2,new i.BillingResponse(n)]}})})},n.prototype.putProfile=function(n){return t(this,void 0,void 0,function(){var l;return u(this,function(e){switch(e.label){case 0:return[4,this.send("PUT","/accounts/profile",n,!0,!0)];case 1:return l=e.sent(),[2,new w.ProfileResponse(l)]}})})},n.prototype.postEmailToken=function(n){return this.send("POST","/accounts/email-token",n,!0,!1)},n.prototype.postEmail=function(n){return this.send("POST","/accounts/email",n,!0,!1)},n.prototype.postPassword=function(n){return this.send("POST","/accounts/password",n,!0,!1)},n.prototype.postSecurityStamp=function(n){return this.send("POST","/accounts/security-stamp",n,!0,!1)},n.prototype.deleteAccount=function(n){return this.send("DELETE","/accounts",n,!0,!1)},n.prototype.getAccountRevisionDate=function(){return t(this,void 0,void 0,function(){return u(this,function(n){switch(n.label){case 0:return[4,this.send("GET","/accounts/revision-date",null,!0,!0)];case 1:return[2,n.sent()]}})})},n.prototype.postPasswordHint=function(n){return this.send("POST","/accounts/password-hint",n,!1,!1)},n.prototype.postRegister=function(n){return this.send("POST","/accounts/register",n,!1,!1)},n.prototype.postPremium=function(n){return this.send("POST","/accounts/premium",n,!0,!1)},n.prototype.postReinstatePremium=function(){return this.send("POST","/accounts/reinstate-premium",null,!0,!1)},n.prototype.postCancelPremium=function(){return this.send("POST","/accounts/cancel-premium",null,!0,!1)},n.prototype.postAccountStorage=function(n){return this.send("POST","/accounts/storage",n,!0,!1)},n.prototype.postAccountPayment=function(n){return this.send("POST","/accounts/payment",n,!0,!1)},n.prototype.postAccountLicense=function(n){return this.send("POST","/accounts/license",n,!0,!1)},n.prototype.postAccountKeys=function(n){return this.send("POST","/accounts/keys",n,!0,!1)},n.prototype.postAccountKey=function(n){return this.send("POST","/accounts/key",n,!0,!1)},n.prototype.postAccountVerifyEmail=function(){return this.send("POST","/accounts/verify-email",null,!0,!1)},n.prototype.postAccountVerifyEmailToken=function(n){return this.send("POST","/accounts/verify-email-token",n,!1,!1)},n.prototype.postAccountRecoverDelete=function(n){return this.send("POST","/accounts/delete-recover",n,!1,!1)},n.prototype.postAccountRecoverDeleteToken=function(n){return this.send("POST","/accounts/delete-recover-token",n,!1,!1)},n.prototype.postFolder=function(n){return t(this,void 0,void 0,function(){var l;return u(this,function(e){switch(e.label){case 0:return[4,this.send("POST","/folders",n,!0,!0)];case 1:return l=e.sent(),[2,new f.FolderResponse(l)]}})})},n.prototype.putFolder=function(n,l){return t(this,void 0,void 0,function(){var e;return u(this,function(t){switch(t.label){case 0:return[4,this.send("PUT","/folders/"+n,l,!0,!0)];case 1:return e=t.sent(),[2,new f.FolderResponse(e)]}})})},n.prototype.deleteFolder=function(n){return this.send("DELETE","/folders/"+n,null,!0,!1)},n.prototype.getCipher=function(n){return t(this,void 0,void 0,function(){var l;return u(this,function(e){switch(e.label){case 0:return[4,this.send("GET","/ciphers/"+n,null,!0,!0)];case 1:return l=e.sent(),[2,new r.CipherResponse(l)]}})})},n.prototype.getCipherAdmin=function(n){return t(this,void 0,void 0,function(){var l;return u(this,function(e){switch(e.label){case 0:return[4,this.send("GET","/ciphers/"+n+"/admin",null,!0,!0)];case 1:return l=e.sent(),[2,new r.CipherResponse(l)]}})})},n.prototype.getCiphersOrganization=function(n){return t(this,void 0,void 0,function(){var l;return u(this,function(e){switch(e.label){case 0:return[4,this.send("GET","/ciphers/organization-details?organizationId="+n,null,!0,!0)];case 1:return l=e.sent(),[2,new y.ListResponse(l,r.CipherResponse)]}})})},n.prototype.postCipher=function(n){return t(this,void 0,void 0,function(){var l;return u(this,function(e){switch(e.label){case 0:return[4,this.send("POST","/ciphers",n,!0,!0)];case 1:return l=e.sent(),[2,new r.CipherResponse(l)]}})})},n.prototype.postCipherAdmin=function(n){return t(this,void 0,void 0,function(){var l;return u(this,function(e){switch(e.label){case 0:return[4,this.send("POST","/ciphers/admin",n,!0,!0)];case 1:return l=e.sent(),[2,new r.CipherResponse(l)]}})})},n.prototype.putCipher=function(n,l){return t(this,void 0,void 0,function(){var e;return u(this,function(t){switch(t.label){case 0:return[4,this.send("PUT","/ciphers/"+n,l,!0,!0)];case 1:return e=t.sent(),[2,new r.CipherResponse(e)]}})})},n.prototype.putCipherAdmin=function(n,l){return t(this,void 0,void 0,function(){var e;return u(this,function(t){switch(t.label){case 0:return[4,this.send("PUT","/ciphers/"+n+"/admin",l,!0,!0)];case 1:return e=t.sent(),[2,new r.CipherResponse(e)]}})})},n.prototype.deleteCipher=function(n){return this.send("DELETE","/ciphers/"+n,null,!0,!1)},n.prototype.deleteCipherAdmin=function(n){return this.send("DELETE","/ciphers/"+n+"/admin",null,!0,!1)},n.prototype.deleteManyCiphers=function(n){return this.send("DELETE","/ciphers",n,!0,!1)},n.prototype.putMoveCiphers=function(n){return this.send("PUT","/ciphers/move",n,!0,!1)},n.prototype.putShareCipher=function(n,l){return this.send("PUT","/ciphers/"+n+"/share",l,!0,!1)},n.prototype.putShareCiphers=function(n){return this.send("PUT","/ciphers/share",n,!0,!1)},n.prototype.putCipherCollections=function(n,l){return this.send("PUT","/ciphers/"+n+"/collections",l,!0,!1)},n.prototype.putCipherCollectionsAdmin=function(n,l){return this.send("PUT","/ciphers/"+n+"/collections-admin",l,!0,!1)},n.prototype.postPurgeCiphers=function(n){return this.send("POST","/ciphers/purge",n,!0,!1)},n.prototype.postImportCiphers=function(n){return this.send("POST","/ciphers/import",n,!0,!1)},n.prototype.postImportOrganizationCiphers=function(n,l){return this.send("POST","/ciphers/import-organization?organizationId="+n,l,!0,!1)},n.prototype.postCipherAttachment=function(n,l){return t(this,void 0,void 0,function(){var e;return u(this,function(t){switch(t.label){case 0:return[4,this.send("POST","/ciphers/"+n+"/attachment",l,!0,!0)];case 1:return e=t.sent(),[2,new r.CipherResponse(e)]}})})},n.prototype.postCipherAttachmentAdmin=function(n,l){return t(this,void 0,void 0,function(){var e;return u(this,function(t){switch(t.label){case 0:return[4,this.send("POST","/ciphers/"+n+"/attachment-admin",l,!0,!0)];case 1:return e=t.sent(),[2,new r.CipherResponse(e)]}})})},n.prototype.deleteCipherAttachment=function(n,l){return this.send("DELETE","/ciphers/"+n+"/attachment/"+l,null,!0,!1)},n.prototype.deleteCipherAttachmentAdmin=function(n,l){return this.send("DELETE","/ciphers/"+n+"/attachment/"+l+"/admin",null,!0,!1)},n.prototype.postShareCipherAttachment=function(n,l,e,t){return this.send("POST","/ciphers/"+n+"/attachment/"+l+"/share?organizationId="+t,e,!0,!1)},n.prototype.getCollectionDetails=function(n,l){return t(this,void 0,void 0,function(){var e;return u(this,function(t){switch(t.label){case 0:return[4,this.send("GET","/organizations/"+n+"/collections/"+l+"/details",null,!0,!0)];case 1:return e=t.sent(),[2,new a.CollectionGroupDetailsResponse(e)]}})})},n.prototype.getCollections=function(n){return t(this,void 0,void 0,function(){var l;return u(this,function(e){switch(e.label){case 0:return[4,this.send("GET","/organizations/"+n+"/collections",null,!0,!0)];case 1:return l=e.sent(),[2,new y.ListResponse(l,a.CollectionResponse)]}})})},n.prototype.getCollectionUsers=function(n,l){return t(this,void 0,void 0,function(){var e;return u(this,function(t){switch(t.label){case 0:return[4,this.send("GET","/organizations/"+n+"/collections/"+l+"/users",null,!0,!0)];case 1:return e=t.sent(),[2,new y.ListResponse(e,s.CollectionUserResponse)]}})})},n.prototype.postCollection=function(n,l){return t(this,void 0,void 0,function(){var e;return u(this,function(t){switch(t.label){case 0:return[4,this.send("POST","/organizations/"+n+"/collections",l,!0,!0)];case 1:return e=t.sent(),[2,new a.CollectionResponse(e)]}})})},n.prototype.putCollection=function(n,l,e){return t(this,void 0,void 0,function(){var t;return u(this,function(u){switch(u.label){case 0:return[4,this.send("PUT","/organizations/"+n+"/collections/"+l,e,!0,!0)];case 1:return t=u.sent(),[2,new a.CollectionResponse(t)]}})})},n.prototype.deleteCollection=function(n,l){return this.send("DELETE","/organizations/"+n+"/collections/"+l,null,!0,!1)},n.prototype.deleteCollectionUser=function(n,l,e){return this.send("DELETE","/organizations/"+n+"/collections/"+l+"/user/"+e,null,!0,!1)},n.prototype.getGroupDetails=function(n,l){return t(this,void 0,void 0,function(){var e;return u(this,function(t){switch(t.label){case 0:return[4,this.send("GET","/organizations/"+n+"/groups/"+l+"/details",null,!0,!0)];case 1:return e=t.sent(),[2,new v.GroupDetailsResponse(e)]}})})},n.prototype.getGroups=function(n){return t(this,void 0,void 0,function(){var l;return u(this,function(e){switch(e.label){case 0:return[4,this.send("GET","/organizations/"+n+"/groups",null,!0,!0)];case 1:return l=e.sent(),[2,new y.ListResponse(l,v.GroupResponse)]}})})},n.prototype.getGroupUsers=function(n,l){return t(this,void 0,void 0,function(){var e;return u(this,function(t){switch(t.label){case 0:return[4,this.send("GET","/organizations/"+n+"/groups/"+l+"/users",null,!0,!0)];case 1:return e=t.sent(),[2,new y.ListResponse(e,h.GroupUserResponse)]}})})},n.prototype.postGroup=function(n,l){return t(this,void 0,void 0,function(){var e;return u(this,function(t){switch(t.label){case 0:return[4,this.send("POST","/organizations/"+n+"/groups",l,!0,!0)];case 1:return e=t.sent(),[2,new v.GroupResponse(e)]}})})},n.prototype.putGroup=function(n,l,e){return t(this,void 0,void 0,function(){var t;return u(this,function(u){switch(u.label){case 0:return[4,this.send("PUT","/organizations/"+n+"/groups/"+l,e,!0,!0)];case 1:return t=u.sent(),[2,new v.GroupResponse(t)]}})})},n.prototype.deleteGroup=function(n,l){return this.send("DELETE","/organizations/"+n+"/groups/"+l,null,!0,!1)},n.prototype.deleteGroupUser=function(n,l,e){return this.send("DELETE","/organizations/"+n+"/groups/"+l+"/user/"+e,null,!0,!1)},n.prototype.getOrganizationUser=function(n,l){return t(this,void 0,void 0,function(){var e;return u(this,function(t){switch(t.label){case 0:return[4,this.send("GET","/organizations/"+n+"/users/"+l,null,!0,!0)];case 1:return e=t.sent(),[2,new S.OrganizationUserDetailsResponse(e)]}})})},n.prototype.getOrganizationUserGroups=function(n,l){return t(this,void 0,void 0,function(){return u(this,function(e){switch(e.label){case 0:return[4,this.send("GET","/organizations/"+n+"/users/"+l+"/groups",null,!0,!0)];case 1:return[2,e.sent()]}})})},n.prototype.getOrganizationUsers=function(n){return t(this,void 0,void 0,function(){var l;return u(this,function(e){switch(e.label){case 0:return[4,this.send("GET","/organizations/"+n+"/users",null,!0,!0)];case 1:return l=e.sent(),[2,new y.ListResponse(l,S.OrganizationUserUserDetailsResponse)]}})})},n.prototype.postOrganizationUserInvite=function(n,l){return this.send("POST","/organizations/"+n+"/users/invite",l,!0,!1)},n.prototype.postOrganizationUserReinvite=function(n,l){return this.send("POST","/organizations/"+n+"/users/"+l+"/reinvite",null,!0,!1)},n.prototype.postOrganizationUserAccept=function(n,l,e){return this.send("POST","/organizations/"+n+"/users/"+l+"/accept",e,!0,!1)},n.prototype.postOrganizationUserConfirm=function(n,l,e){return this.send("POST","/organizations/"+n+"/users/"+l+"/confirm",e,!0,!1)},n.prototype.putOrganizationUser=function(n,l,e){return this.send("PUT","/organizations/"+n+"/users/"+l,e,!0,!1)},n.prototype.putOrganizationUserGroups=function(n,l,e){return this.send("PUT","/organizations/"+n+"/users/"+l+"/groups",e,!0,!1)},n.prototype.deleteOrganizationUser=function(n,l){return this.send("DELETE","/organizations/"+n+"/users/"+l,null,!0,!1)},n.prototype.getSync=function(){return t(this,void 0,void 0,function(){var n,l;return u(this,function(e){switch(e.label){case 0:return n=this.isDesktopClient||this.isWebClient?"/sync?excludeDomains=true":"/sync",[4,this.send("GET",n,null,!0,!0)];case 1:return l=e.sent(),[2,new R.SyncResponse(l)]}})})},n.prototype.postImportDirectory=function(n,l){return t(this,void 0,void 0,function(){return u(this,function(e){return[2,this.send("POST","/organizations/"+n+"/import",l,!0,!1)]})})},n.prototype.getSettingsDomains=function(){return t(this,void 0,void 0,function(){var n;return u(this,function(l){switch(l.label){case 0:return[4,this.send("GET","/settings/domains",null,!0,!0)];case 1:return n=l.sent(),[2,new d.DomainsResponse(n)]}})})},n.prototype.putSettingsDomains=function(n){return t(this,void 0,void 0,function(){var l;return u(this,function(e){switch(e.label){case 0:return[4,this.send("PUT","/settings/domains",n,!0,!0)];case 1:return l=e.sent(),[2,new d.DomainsResponse(l)]}})})},n.prototype.getTwoFactorProviders=function(){return t(this,void 0,void 0,function(){var n;return u(this,function(l){switch(l.label){case 0:return[4,this.send("GET","/two-factor",null,!0,!0)];case 1:return n=l.sent(),[2,new y.ListResponse(n,E.TwoFactorProviderResponse)]}})})},n.prototype.getTwoFactorOrganizationProviders=function(n){return t(this,void 0,void 0,function(){var l;return u(this,function(e){switch(e.label){case 0:return[4,this.send("GET","/organizations/"+n+"/two-factor",null,!0,!0)];case 1:return l=e.sent(),[2,new y.ListResponse(l,E.TwoFactorProviderResponse)]}})})},n.prototype.getTwoFactorAuthenticator=function(n){return t(this,void 0,void 0,function(){var l;return u(this,function(e){switch(e.label){case 0:return[4,this.send("POST","/two-factor/get-authenticator",n,!0,!0)];case 1:return l=e.sent(),[2,new _.TwoFactorAuthenticatorResponse(l)]}})})},n.prototype.getTwoFactorEmail=function(n){return t(this,void 0,void 0,function(){var l;return u(this,function(e){switch(e.label){case 0:return[4,this.send("POST","/two-factor/get-email",n,!0,!0)];case 1:return l=e.sent(),[2,new A.TwoFactorEmailResponse(l)]}})})},n.prototype.getTwoFactorDuo=function(n){return t(this,void 0,void 0,function(){var l;return u(this,function(e){switch(e.label){case 0:return[4,this.send("POST","/two-factor/get-duo",n,!0,!0)];case 1:return l=e.sent(),[2,new I.TwoFactorDuoResponse(l)]}})})},n.prototype.getTwoFactorOrganizationDuo=function(n,l){return t(this,void 0,void 0,function(){var e;return u(this,function(t){switch(t.label){case 0:return[4,this.send("POST","/organizations/"+n+"/two-factor/get-duo",l,!0,!0)];case 1:return e=t.sent(),[2,new I.TwoFactorDuoResponse(e)]}})})},n.prototype.getTwoFactorYubiKey=function(n){return t(this,void 0,void 0,function(){var l;return u(this,function(e){switch(e.label){case 0:return[4,this.send("POST","/two-factor/get-yubikey",n,!0,!0)];case 1:return l=e.sent(),[2,new T.TwoFactorYubiKeyResponse(l)]}})})},n.prototype.getTwoFactorU2f=function(n){return t(this,void 0,void 0,function(){var l;return u(this,function(e){switch(e.label){case 0:return[4,this.send("POST","/two-factor/get-u2f",n,!0,!0)];case 1:return l=e.sent(),[2,new N.TwoFactorU2fResponse(l)]}})})},n.prototype.getTwoFactorRecover=function(n){return t(this,void 0,void 0,function(){var l;return u(this,function(e){switch(e.label){case 0:return[4,this.send("POST","/two-factor/get-recover",n,!0,!0)];case 1:return l=e.sent(),[2,new O.TwoFactorRecoverResponse(l)]}})})},n.prototype.putTwoFactorAuthenticator=function(n){return t(this,void 0,void 0,function(){var l;return u(this,function(e){switch(e.label){case 0:return[4,this.send("PUT","/two-factor/authenticator",n,!0,!0)];case 1:return l=e.sent(),[2,new _.TwoFactorAuthenticatorResponse(l)]}})})},n.prototype.putTwoFactorEmail=function(n){return t(this,void 0,void 0,function(){var l;return u(this,function(e){switch(e.label){case 0:return[4,this.send("PUT","/two-factor/email",n,!0,!0)];case 1:return l=e.sent(),[2,new A.TwoFactorEmailResponse(l)]}})})},n.prototype.putTwoFactorDuo=function(n){return t(this,void 0,void 0,function(){var l;return u(this,function(e){switch(e.label){case 0:return[4,this.send("PUT","/two-factor/duo",n,!0,!0)];case 1:return l=e.sent(),[2,new I.TwoFactorDuoResponse(l)]}})})},n.prototype.putTwoFactorOrganizationDuo=function(n,l){return t(this,void 0,void 0,function(){var e;return u(this,function(t){switch(t.label){case 0:return[4,this.send("PUT","/organizations/"+n+"/two-factor/duo",l,!0,!0)];case 1:return e=t.sent(),[2,new I.TwoFactorDuoResponse(e)]}})})},n.prototype.putTwoFactorYubiKey=function(n){return t(this,void 0,void 0,function(){var l;return u(this,function(e){switch(e.label){case 0:return[4,this.send("PUT","/two-factor/yubikey",n,!0,!0)];case 1:return l=e.sent(),[2,new T.TwoFactorYubiKeyResponse(l)]}})})},n.prototype.putTwoFactorU2f=function(n){return t(this,void 0,void 0,function(){var l;return u(this,function(e){switch(e.label){case 0:return[4,this.send("PUT","/two-factor/u2f",n,!0,!0)];case 1:return l=e.sent(),[2,new N.TwoFactorU2fResponse(l)]}})})},n.prototype.putTwoFactorDisable=function(n){return t(this,void 0,void 0,function(){var l;return u(this,function(e){switch(e.label){case 0:return[4,this.send("PUT","/two-factor/disable",n,!0,!0)];case 1:return l=e.sent(),[2,new E.TwoFactorProviderResponse(l)]}})})},n.prototype.putTwoFactorOrganizationDisable=function(n,l){return t(this,void 0,void 0,function(){var e;return u(this,function(t){switch(t.label){case 0:return[4,this.send("PUT","/organizations/"+n+"/two-factor/disable",l,!0,!0)];case 1:return e=t.sent(),[2,new E.TwoFactorProviderResponse(e)]}})})},n.prototype.postTwoFactorRecover=function(n){return this.send("POST","/two-factor/recover",n,!1,!1)},n.prototype.postTwoFactorEmailSetup=function(n){return this.send("POST","/two-factor/send-email",n,!0,!1)},n.prototype.postTwoFactorEmail=function(n){return this.send("POST","/two-factor/send-email-login",n,!1,!1)},n.prototype.getOrganization=function(n){return t(this,void 0,void 0,function(){var l;return u(this,function(e){switch(e.label){case 0:return[4,this.send("GET","/organizations/"+n,null,!0,!0)];case 1:return l=e.sent(),[2,new b.OrganizationResponse(l)]}})})},n.prototype.getOrganizationBilling=function(n){return t(this,void 0,void 0,function(){var l;return u(this,function(e){switch(e.label){case 0:return[4,this.send("GET","/organizations/"+n+"/billing",null,!0,!0)];case 1:return l=e.sent(),[2,new C.OrganizationBillingResponse(l)]}})})},n.prototype.getOrganizationLicense=function(n,l){return t(this,void 0,void 0,function(){return u(this,function(e){return[2,this.send("GET","/organizations/"+n+"/license?installationId="+l,null,!0,!0)]})})},n.prototype.postOrganization=function(n){return t(this,void 0,void 0,function(){var l;return u(this,function(e){switch(e.label){case 0:return[4,this.send("POST","/organizations",n,!0,!0)];case 1:return l=e.sent(),[2,new b.OrganizationResponse(l)]}})})},n.prototype.putOrganization=function(n,l){return t(this,void 0,void 0,function(){var e;return u(this,function(t){switch(t.label){case 0:return[4,this.send("PUT","/organizations/"+n,l,!0,!0)];case 1:return e=t.sent(),[2,new b.OrganizationResponse(e)]}})})},n.prototype.postLeaveOrganization=function(n){return this.send("POST","/organizations/"+n+"/leave",null,!0,!1)},n.prototype.postOrganizationLicense=function(n){return t(this,void 0,void 0,function(){var l;return u(this,function(e){switch(e.label){case 0:return[4,this.send("POST","/organizations/license",n,!0,!0)];case 1:return l=e.sent(),[2,new b.OrganizationResponse(l)]}})})},n.prototype.postOrganizationLicenseUpdate=function(n,l){return t(this,void 0,void 0,function(){return u(this,function(e){return[2,this.send("POST","/organizations/"+n+"/license",l,!0,!1)]})})},n.prototype.postOrganizationSeat=function(n,l){return this.send("POST","/organizations/"+n+"/seat",l,!0,!1)},n.prototype.postOrganizationStorage=function(n,l){return this.send("POST","/organizations/"+n+"/storage",l,!0,!1)},n.prototype.postOrganizationPayment=function(n,l){return this.send("POST","/organizations/"+n+"/payment",l,!0,!1)},n.prototype.postOrganizationVerifyBank=function(n,l){return this.send("POST","/organizations/"+n+"/verify-bank",l,!0,!1)},n.prototype.postOrganizationCancel=function(n){return this.send("POST","/organizations/"+n+"/cancel",null,!0,!1)},n.prototype.postOrganizationReinstate=function(n){return this.send("POST","/organizations/"+n+"/reinstate",null,!0,!1)},n.prototype.deleteOrganization=function(n,l){return this.send("DELETE","/organizations/"+n,l,!0,!1)},n.prototype.getEvents=function(n,l,e){return t(this,void 0,void 0,function(){var t;return u(this,function(u){switch(u.label){case 0:return[4,this.send("GET",this.addEventParameters("/events",n,l,e),null,!0,!0)];case 1:return t=u.sent(),[2,new y.ListResponse(t,p.EventResponse)]}})})},n.prototype.getEventsCipher=function(n,l,e,o){return t(this,void 0,void 0,function(){var t;return u(this,function(u){switch(u.label){case 0:return[4,this.send("GET",this.addEventParameters("/ciphers/"+n+"/events",l,e,o),null,!0,!0)];case 1:return t=u.sent(),[2,new y.ListResponse(t,p.EventResponse)]}})})},n.prototype.getEventsOrganization=function(n,l,e,o){return t(this,void 0,void 0,function(){var t;return u(this,function(u){switch(u.label){case 0:return[4,this.send("GET",this.addEventParameters("/organizations/"+n+"/events",l,e,o),null,!0,!0)];case 1:return t=u.sent(),[2,new y.ListResponse(t,p.EventResponse)]}})})},n.prototype.getEventsOrganizationUser=function(n,l,e,o,i){return t(this,void 0,void 0,function(){var t;return u(this,function(u){switch(u.label){case 0:return[4,this.send("GET",this.addEventParameters("/organizations/"+n+"/users/"+l+"/events",e,o,i),null,!0,!0)];case 1:return t=u.sent(),[2,new y.ListResponse(t,p.EventResponse)]}})})},n.prototype.getUserPublicKey=function(n){return t(this,void 0,void 0,function(){var l;return u(this,function(e){switch(e.label){case 0:return[4,this.send("GET","/users/"+n+"/public-key",null,!0,!0)];case 1:return l=e.sent(),[2,new k.UserKeyResponse(l)]}})})},n.prototype.fetch=function(n){return"GET"===n.method&&(n.headers.set("Cache-Control","no-cache"),n.headers.set("Pragma","no-cache")),fetch(n)},n.prototype.send=function(n,l,e,o,i){return t(this,void 0,void 0,function(){var t,r,a,s,d;return u(this,function(u){switch(u.label){case 0:return t=new Headers({"Device-Type":this.deviceType}),r={cache:"no-cache",credentials:this.getCredentials(),method:n},o?[4,this.handleTokenState()]:[3,2];case 1:a=u.sent(),t.set("Authorization",a),u.label=2;case 2:return null!=e&&("string"==typeof e?(r.body=e,t.set("Content-Type","application/x-www-form-urlencoded; charset=utf-8")):"object"==typeof e&&(e instanceof FormData?r.body=e:(t.set("Content-Type","application/json; charset=utf-8"),r.body=JSON.stringify(e)))),i&&t.set("Accept","application/json"),r.headers=t,[4,this.fetch(new Request(this.apiBaseUrl+l,r))];case 3:return s=u.sent(),i&&200===s.status?[4,s.json()]:[3,5];case 4:return[2,u.sent()];case 5:return 200===s.status?[3,7]:[4,this.handleError(s,!1)];case 6:return d=u.sent(),[2,Promise.reject(d)];case 7:return[2]}})})},n.prototype.handleError=function(n,l){return t(this,void 0,void 0,function(){var e,t;return u(this,function(u){switch(u.label){case 0:return l&&400===n.status||401===n.status||403===n.status?[4,this.logoutCallback(!0)]:[3,2];case 1:return u.sent(),[2,null];case 2:return e=null,null!=(t=n.headers.get("content-type"))&&t.indexOf("application/json")>-1?[4,n.json()]:[3,4];case 3:e=u.sent(),u.label=4;case 4:return[2,new c.ErrorResponse(e,n.status,l)]}})})},n.prototype.handleTokenState=function(){return t(this,void 0,void 0,function(){var n,l;return u(this,function(e){switch(e.label){case 0:return[4,this.tokenService.getToken()];case 1:return n=e.sent(),this.tokenService.tokenNeedsRefresh()?[4,this.doRefreshToken()]:[3,3];case 2:l=e.sent(),n=l.accessToken,e.label=3;case 3:return[2,"Bearer "+n]}})})},n.prototype.doRefreshToken=function(){return t(this,void 0,void 0,function(){var n,l,e,t,o,i;return u(this,function(u){switch(u.label){case 0:return[4,this.tokenService.getRefreshToken()];case 1:if(null==(n=u.sent())||""===n)throw new Error;return l=this.tokenService.decodeToken(),[4,this.fetch(new Request(this.identityBaseUrl+"/connect/token",{body:this.qsStringify({grant_type:"refresh_token",client_id:l.client_id,refresh_token:n}),cache:"no-cache",credentials:this.getCredentials(),headers:new Headers({"Content-Type":"application/x-www-form-urlencoded; charset=utf-8",Accept:"application/json","Device-Type":this.deviceType}),method:"POST"}))];case 2:return 200!==(e=u.sent()).status?[3,5]:[4,e.json()];case 3:return t=u.sent(),o=new g.IdentityTokenResponse(t),[4,this.tokenService.setTokens(o.accessToken,o.refreshToken)];case 4:return u.sent(),[2,o];case 5:return[4,this.handleError(e,!0)];case 6:return i=u.sent(),[2,Promise.reject(i)]}})})},n.prototype.qsStringify=function(n){return Object.keys(n).map(function(l){return encodeURIComponent(l)+"="+encodeURIComponent(n[l])}).join("&")},n.prototype.getCredentials=function(){if(!this.isWebClient||this.usingBaseUrl)return"include"},n.prototype.addEventParameters=function(n,l,e,t){return null!=l&&(n+="?start="+l),null!=e&&(n+=n.indexOf("?")>-1?"&":"?",n+="end="+e),null!=t&&(n+=n.indexOf("?")>-1?"&":"?",n+="continuationToken="+t),n},n}();l.ApiService=V},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});e(0),e(13);var t=function(){function n(n,l){this.elementRef=n,this.renderer=l,this.trueValue=!0,this.falseValue=!1,this.propagateChange=function(n){}}return n.prototype.onHostChange=function(n){this.propagateChange(n.target.checked?this.trueValue:this.falseValue)},n.prototype.writeValue=function(n){n===this.trueValue?this.renderer.setProperty(this.elementRef.nativeElement,"checked",!0):this.renderer.setProperty(this.elementRef.nativeElement,"checked",!1)},n.prototype.registerOnChange=function(n){this.propagateChange=n},n.prototype.registerOnTouched=function(n){},n.prototype.setDisabledState=function(n){},n}();l.TrueFalseValueDirective=t},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});e(0);var t=function(){function n(n){this.elRef=n,this.el=null,this.el=n.nativeElement}return n.prototype.ngOnInit=function(){var n=this;this.formEls=Array.from(this.el.querySelectorAll('input:not([type="hidden"]), select, textarea')),this.formEls.forEach(function(l){l.addEventListener("focus",function(l){n.el.classList.add("active")},!1),l.addEventListener("blur",function(l){n.el.classList.remove("active")},!1)})},n.prototype.onClick=function(n){if(n.target===this.el&&this.formEls.length>0){var l=this.formEls[0];if("input"===l.tagName.toLowerCase()){var e=l;if(null!=e.type&&"checkbox"===e.type.toLowerCase())return void e.click()}l.focus()}},n}();l.BoxRowDirective=t},function(n,l,e){"use strict";var t=this&&this.__awaiter||function(n,l,e,t){return new(e||(e=Promise))(function(u,o){function i(n){try{a(t.next(n))}catch(n){o(n)}}function r(n){try{a(t.throw(n))}catch(n){o(n)}}function a(n){n.done?u(n.value):new e(function(l){l(n.value)}).then(i,r)}a((t=t.apply(n,l||[])).next())})},u=this&&this.__generator||function(n,l){var e,t,u,o,i={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return o={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function r(o){return function(r){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;i;)try{if(e=1,t&&(u=t[2&o[0]?"return":o[0]?"throw":"next"])&&!(u=u.call(t,o[1])).done)return u;switch(t=0,u&&(o=[0,u.value]),o[0]){case 0:case 1:u=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,t=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(u=(u=i.trys).length>0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&(l[0].checked=!0)}),[3,5];case 4:return u.sent(),[3,5];case 5:return this.loading=!1,[2]}})})},n.prototype.check=function(n,l){n.checked=null==l?!n.checked:l,n.checked||(n.readOnly=!1)},n.prototype.selectAll=function(n){var l=this;this.groups.forEach(function(e){return l.check(e,n)})},n.prototype.submit=function(){return t(this,void 0,void 0,function(){var n;return u(this,function(l){switch(l.label){case 0:(n=new i.OrganizationUserUpdateGroupsRequest).groupIds=this.groups.filter(function(n){return n.checked}).map(function(n){return n.id}),l.label=1;case 1:return l.trys.push([1,3,,4]),this.formPromise=this.apiService.putOrganizationUserGroups(this.organizationId,this.organizationUserId,n),[4,this.formPromise];case 2:return l.sent(),this.analytics.eventTrack.next({action:"Edited User Groups"}),this.toasterService.popAsync("success",null,this.i18nService.t("editedGroupsForUser",this.name)),this.onSavedUser.emit(),[3,4];case 3:return l.sent(),[3,4];case 4:return[2]}})})},n}();l.UserGroupsComponent=a},function(n,l,e){"use strict";var t=this&&this.__awaiter||function(n,l,e,t){return new(e||(e=Promise))(function(u,o){function i(n){try{a(t.next(n))}catch(n){o(n)}}function r(n){try{a(t.throw(n))}catch(n){o(n)}}function a(n){n.done?u(n.value):new e(function(l){l(n.value)}).then(i,r)}a((t=t.apply(n,l||[])).next())})},u=this&&this.__generator||function(n,l){var e,t,u,o,i={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return o={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function r(o){return function(r){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;i;)try{if(e=1,t&&(u=t[2&o[0]?"return":o[0]?"throw":"next"])&&!(u=u.call(t,o[1])).done)return u;switch(t=0,u&&(o=[0,u.value]),o[0]){case 0:case 1:u=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,t=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(u=(u=i.trys).length>0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&(e[0].checked=!0,e[0].readOnly=n.readOnly)}),[3,5];case 4:return e.sent(),[3,5];case 5:return[3,7];case 6:this.title=this.i18nService.t("inviteUser"),e.label=7;case 7:return this.loading=!1,[2]}})})},n.prototype.loadCollections=function(){return t(this,void 0,void 0,function(){var n,l,e;return u(this,function(t){switch(t.label){case 0:return[4,this.apiService.getCollections(this.organizationId)];case 1:return n=t.sent(),l=n.data.map(function(n){return new r.Collection(new i.CollectionData(n))}),e=this,[4,this.collectionService.decryptMany(l)];case 2:return e.collections=t.sent(),[2]}})})},n.prototype.check=function(n,l){n.checked=null==l?!n.checked:l,n.checked||(n.readOnly=!1)},n.prototype.selectAll=function(n){var l=this;this.collections.forEach(function(e){return l.check(e,n)})},n.prototype.submit=function(){return t(this,void 0,void 0,function(){var n,l;return u(this,function(e){switch(e.label){case 0:n=null,"all"!==this.access&&(n=this.collections.filter(function(n){return n.checked}).map(function(n){return new d.SelectionReadOnlyRequest(n.id,!!n.readOnly)})),e.label=1;case 1:return e.trys.push([1,3,,4]),this.editMode?((l=new s.OrganizationUserUpdateRequest).accessAll="all"===this.access,l.type=this.type,l.collections=n,this.formPromise=this.apiService.putOrganizationUser(this.organizationId,this.organizationUserId,l)):((l=new a.OrganizationUserInviteRequest).emails=this.emails.trim().split(/\s*,\s*/),l.accessAll="all"===this.access,l.type=this.type,l.collections=n,this.formPromise=this.apiService.postOrganizationUserInvite(this.organizationId,l)),[4,this.formPromise];case 2:return e.sent(),this.analytics.eventTrack.next({action:this.editMode?"Edited User":"Invited User"}),this.toasterService.popAsync("success",null,this.i18nService.t(this.editMode?"editedUserId":"invitedUsers",this.name)),this.onSavedUser.emit(),[3,4];case 3:return e.sent(),[3,4];case 4:return[2]}})})},n.prototype.delete=function(){return t(this,void 0,void 0,function(){return u(this,function(n){switch(n.label){case 0:return this.editMode?[4,this.platformUtilsService.showDialog(this.i18nService.t("removeUserConfirmation"),this.name,this.i18nService.t("yes"),this.i18nService.t("no"),"warning")]:[2];case 1:if(!n.sent())return[2,!1];n.label=2;case 2:return n.trys.push([2,4,,5]),this.deletePromise=this.apiService.deleteOrganizationUser(this.organizationId,this.organizationUserId),[4,this.deletePromise];case 3:return n.sent(),this.analytics.eventTrack.next({action:"Deleted User"}),this.toasterService.popAsync("success",null,this.i18nService.t("removedUserId",this.name)),this.onDeletedUser.emit(),[3,5];case 4:return n.sent(),[3,5];case 5:return[2]}})})},n}();l.UserAddEditComponent=p},function(n,l,e){"use strict";var t=this&&this.__awaiter||function(n,l,e,t){return new(e||(e=Promise))(function(u,o){function i(n){try{a(t.next(n))}catch(n){o(n)}}function r(n){try{a(t.throw(n))}catch(n){o(n)}}function a(n){n.done?u(n.value):new e(function(l){l(n.value)}).then(i,r)}a((t=t.apply(n,l||[])).next())})},u=this&&this.__generator||function(n,l){var e,t,u,o,i={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return o={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function r(o){return function(r){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;i;)try{if(e=1,t&&(u=t[2&o[0]?"return":o[0]?"throw":"next"])&&!(u=u.call(t,o[1])).done)return u;switch(t=0,u&&(o=[0,u.value]),o[0]){case 0:case 1:u=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,t=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(u=(u=i.trys).length>0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&(e[0].checked=!0,e[0].readOnly=n.readOnly)}),[3,5];case 4:return e.sent(),[3,5];case 5:return[3,7];case 6:this.title=this.i18nService.t("addGroup"),e.label=7;case 7:return this.loading=!1,[2]}})})},n.prototype.loadCollections=function(){return t(this,void 0,void 0,function(){var n,l,e;return u(this,function(t){switch(t.label){case 0:return[4,this.apiService.getCollections(this.organizationId)];case 1:return n=t.sent(),l=n.data.map(function(n){return new r.Collection(new i.CollectionData(n))}),e=this,[4,this.collectionService.decryptMany(l)];case 2:return e.collections=t.sent(),[2]}})})},n.prototype.check=function(n,l){n.checked=null==l?!n.checked:l,n.checked||(n.readOnly=!1)},n.prototype.selectAll=function(n){var l=this;this.collections.forEach(function(e){return l.check(e,n)})},n.prototype.submit=function(){return t(this,void 0,void 0,function(){var n;return u(this,function(l){switch(l.label){case 0:(n=new a.GroupRequest).name=this.name,n.externalId=this.externalId,n.accessAll="all"===this.access,n.accessAll||(n.collections=this.collections.filter(function(n){return n.checked}).map(function(n){return new s.SelectionReadOnlyRequest(n.id,!!n.readOnly)})),l.label=1;case 1:return l.trys.push([1,3,,4]),this.editMode?this.formPromise=this.apiService.putGroup(this.organizationId,this.groupId,n):this.formPromise=this.apiService.postGroup(this.organizationId,n),[4,this.formPromise];case 2:return l.sent(),this.analytics.eventTrack.next({action:this.editMode?"Edited Group":"Created Group"}),this.toasterService.popAsync("success",null,this.i18nService.t(this.editMode?"editedGroupId":"createdGroupId",this.name)),this.onSavedGroup.emit(),[3,4];case 3:return l.sent(),[3,4];case 4:return[2]}})})},n.prototype.delete=function(){return t(this,void 0,void 0,function(){return u(this,function(n){switch(n.label){case 0:return this.editMode?[4,this.platformUtilsService.showDialog(this.i18nService.t("deleteGroupConfirmation"),this.name,this.i18nService.t("yes"),this.i18nService.t("no"),"warning")]:[2];case 1:if(!n.sent())return[2,!1];n.label=2;case 2:return n.trys.push([2,4,,5]),this.deletePromise=this.apiService.deleteGroup(this.organizationId,this.groupId),[4,this.deletePromise];case 3:return n.sent(),this.analytics.eventTrack.next({action:"Deleted Group"}),this.toasterService.popAsync("success",null,this.i18nService.t("deletedGroupId",this.name)),this.onDeletedGroup.emit(),[3,5];case 4:return n.sent(),[3,5];case 5:return[2]}})})},n}();l.GroupAddEditComponent=d},function(n,l,e){"use strict";var t=this&&this.__awaiter||function(n,l,e,t){return new(e||(e=Promise))(function(u,o){function i(n){try{a(t.next(n))}catch(n){o(n)}}function r(n){try{a(t.throw(n))}catch(n){o(n)}}function a(n){n.done?u(n.value):new e(function(l){l(n.value)}).then(i,r)}a((t=t.apply(n,l||[])).next())})},u=this&&this.__generator||function(n,l){var e,t,u,o,i={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return o={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function r(o){return function(r){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;i;)try{if(e=1,t&&(u=t[2&o[0]?"return":o[0]?"throw":"next"])&&!(u=u.call(t,o[1])).done)return u;switch(t=0,u&&(o=[0,u.value]),o[0]){case 0:case 1:u=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,t=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(u=(u=i.trys).length>0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&(l[0].checked=!0,l[0].readOnly=n.readOnly)}),[3,7];case 6:return u.sent(),[3,7];case 7:return[3,9];case 8:this.title=this.i18nService.t("addCollection"),u.label=9;case 9:return this.groups.forEach(function(n){n.accessAll&&(n.checked=!0)}),this.loading=!1,[2]}})})},n.prototype.check=function(n,l){n.accessAll||(n.checked=null==l?!n.checked:l,n.checked||(n.readOnly=!1))},n.prototype.selectAll=function(n){var l=this;this.groups.forEach(function(e){return l.check(e,n)})},n.prototype.submit=function(){return t(this,void 0,void 0,function(){var n,l;return u(this,function(e){switch(e.label){case 0:return n=new r.CollectionRequest,l=n,[4,this.cryptoService.encrypt(this.name,this.orgKey)];case 1:l.name=e.sent().encryptedString,n.groups=this.groups.filter(function(n){return n.checked&&!n.accessAll}).map(function(n){return new a.SelectionReadOnlyRequest(n.id,!!n.readOnly)}),e.label=2;case 2:return e.trys.push([2,4,,5]),this.editMode?this.formPromise=this.apiService.putCollection(this.organizationId,this.collectionId,n):this.formPromise=this.apiService.postCollection(this.organizationId,n),[4,this.formPromise];case 3:return e.sent(),this.analytics.eventTrack.next({action:this.editMode?"Edited Collection":"Created Collection"}),this.toasterService.popAsync("success",null,this.i18nService.t(this.editMode?"editedCollectionId":"createdCollectionId",this.name)),this.onSavedCollection.emit(),[3,5];case 4:return e.sent(),[3,5];case 5:return[2]}})})},n.prototype.delete=function(){return t(this,void 0,void 0,function(){return u(this,function(n){switch(n.label){case 0:return this.editMode?[4,this.platformUtilsService.showDialog(this.i18nService.t("deleteCollectionConfirmation"),this.name,this.i18nService.t("yes"),this.i18nService.t("no"),"warning")]:[2];case 1:if(!n.sent())return[2,!1];n.label=2;case 2:return n.trys.push([2,4,,5]),this.deletePromise=this.apiService.deleteCollection(this.organizationId,this.collectionId),[4,this.deletePromise];case 3:return n.sent(),this.analytics.eventTrack.next({action:"Deleted Collection"}),this.toasterService.popAsync("success",null,this.i18nService.t("deletedCollectionId",this.name)),this.onDeletedCollection.emit(),[3,5];case 4:return n.sent(),[3,5];case 5:return[2]}})})},n}();l.CollectionAddEditComponent=d},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(n){this.groups=[],null!=n&&(this.name=n.name?n.name.encryptedString:null)}}();l.CollectionRequest=t},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(n){this.collectionIds=null==n?[]:n}}();l.CipherCollectionsRequest=t},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)}),o=this&&this.__awaiter||function(n,l,e,t){return new(e||(e=Promise))(function(u,o){function i(n){try{a(t.next(n))}catch(n){o(n)}}function r(n){try{a(t.throw(n))}catch(n){o(n)}}function a(n){n.done?u(n.value):new e(function(l){l(n.value)}).then(i,r)}a((t=t.apply(n,l||[])).next())})},i=this&&this.__generator||function(n,l){var e,t,u,o,i={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return o={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function r(o){return function(r){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;i;)try{if(e=1,t&&(u=t[2&o[0]?"return":o[0]?"throw":"next"])&&!(u=u.call(t,o[1])).done)return u;switch(t=0,u&&(o=[0,u.value]),o[0]){case 0:case 1:u=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,t=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(u=(u=i.trys).length>0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&(n.uris=[],this.uris.forEach(function(l){n.uris.push(l.toLoginUriData())})),n},l}(e(100).default);l.Login=d},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)});Object.defineProperty(l,"__esModule",{value:!0});var o=e(533),i=e(100),r=e(217),a=function(n){function l(l,e){void 0===e&&(e=!1);var t=n.call(this)||this;return null==l?t:(t.buildDomainModel(t,l,{title:null,firstName:null,middleName:null,lastName:null,address1:null,address2:null,address3:null,city:null,state:null,postalCode:null,country:null,company:null,email:null,phone:null,ssn:null,username:null,passportNumber:null,licenseNumber:null},e,[]),t)}return u(l,n),l.prototype.decrypt=function(n){return this.decryptObj(new r.IdentityView(this),{title:null,firstName:null,middleName:null,lastName:null,address1:null,address2:null,address3:null,city:null,state:null,postalCode:null,country:null,company:null,email:null,phone:null,ssn:null,username:null,passportNumber:null,licenseNumber:null},n)},l.prototype.toIdentityData=function(){var n=new o.IdentityData;return this.buildDataModel(this,n,{title:null,firstName:null,middleName:null,lastName:null,address1:null,address2:null,address3:null,city:null,state:null,postalCode:null,country:null,company:null,email:null,phone:null,ssn:null,username:null,passportNumber:null,licenseNumber:null}),n},l}(i.default);l.Identity=a},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)});Object.defineProperty(l,"__esModule",{value:!0});var o=e(534),i=e(100),r=e(179),a=function(n){function l(l,e){void 0===e&&(e=!1);var t=n.call(this)||this;return null==l?t:(t.type=l.type,t.buildDomainModel(t,l,{name:null,value:null},e,[]),t)}return u(l,n),l.prototype.decrypt=function(n){return this.decryptObj(new r.FieldView(this),{name:null,value:null},n)},l.prototype.toFieldData=function(){var n=new o.FieldData;return this.buildDataModel(this,n,{name:null,value:null,type:null},["type"]),n},l}(i.default);l.Field=a},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)});Object.defineProperty(l,"__esModule",{value:!0});var o=e(535),i=e(100),r=e(115),a=function(n){function l(l,e){void 0===e&&(e=!1);var t=n.call(this)||this;return null==l?t:(t.buildDomainModel(t,l,{cardholderName:null,brand:null,number:null,expMonth:null,expYear:null,code:null},e,[]),t)}return u(l,n),l.prototype.decrypt=function(n){return this.decryptObj(new r.CardView(this),{cardholderName:null,brand:null,number:null,expMonth:null,expYear:null,code:null},n)},l.prototype.toCardData=function(){var n=new o.CardData;return this.buildDataModel(this,n,{cardholderName:null,brand:null,number:null,expMonth:null,expYear:null,code:null}),n},l}(i.default);l.Card=a},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)});Object.defineProperty(l,"__esModule",{value:!0});var o=e(536),i=e(100),r=e(538),a=function(n){function l(l,e){void 0===e&&(e=!1);var t=n.call(this)||this;return null==l?t:(t.size=l.size,t.buildDomainModel(t,l,{id:null,url:null,sizeName:null,fileName:null},e,["id","url","sizeName"]),t)}return u(l,n),l.prototype.decrypt=function(n){return this.decryptObj(new r.AttachmentView(this),{fileName:null},n)},l.prototype.toAttachmentData=function(){var n=new o.AttachmentData;return this.buildDataModel(this,n,{id:null,url:null,sizeName:null,fileName:null},["id","url","sizeName"]),n},l}(i.default);l.Attachment=a},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(n){null!=n&&(this.type=n.type)}}();l.SecureNoteData=t},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(n){this.match=null,null!=n&&(this.uri=n.uri,this.match=n.match)}}();l.LoginUriData=t},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=e(531),u=function(){return function(n){var l=this;null!=n&&(this.username=n.username,this.password=n.password,this.totp=n.totp,n.uris&&(this.uris=[],n.uris.forEach(function(n){l.uris.push(new t.LoginUriData(n))})))}}();l.LoginData=u},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(n){null!=n&&(this.title=n.title,this.firstName=n.firstName,this.middleName=n.middleName,this.lastName=n.lastName,this.address1=n.address1,this.address2=n.address2,this.address3=n.address3,this.city=n.city,this.state=n.state,this.postalCode=n.postalCode,this.country=n.country,this.company=n.company,this.email=n.email,this.phone=n.phone,this.ssn=n.ssn,this.username=n.username,this.passportNumber=n.passportNumber,this.licenseNumber=n.licenseNumber)}}();l.IdentityData=t},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(n){null!=n&&(this.type=n.type,this.name=n.name,this.value=n.value)}}();l.FieldData=t},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(n){null!=n&&(this.cardholderName=n.cardholderName,this.brand=n.brand,this.number=n.number,this.expMonth=n.expMonth,this.expYear=n.expYear,this.code=n.code)}}();l.CardData=t},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(n){null!=n&&(this.id=n.id,this.url=n.url,this.fileName=n.fileName,this.size=n.size,this.sizeName=n.sizeName)}}();l.AttachmentData=t},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)});Object.defineProperty(l,"__esModule",{value:!0});e(12),e(3),e(2),e(94),e(8);var o=function(n){function l(l,e,t,u,o){return n.call(this,l,e,t,u,o,window)||this}return u(l,n),l}(e(733).PasswordGeneratorHistoryComponent);l.PasswordGeneratorHistoryComponent=o},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(n){n&&(this.id=n.id,this.url=n.url,this.size=n.size,this.sizeName=n.sizeName)}}();l.AttachmentView=t},,function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(n,l){this.key=n,this.value=l}}();l.KvpRequest=t},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0}),function(n){n[n.Free=0]="Free",n[n.FamiliesAnnually=1]="FamiliesAnnually",n[n.TeamsMonthly=2]="TeamsMonthly",n[n.TeamsAnnually=3]="TeamsAnnually",n[n.EnterpriseMonthly=4]="EnterpriseMonthly",n[n.EnterpriseAnnually=5]="EnterpriseAnnually",n[n.Custom=6]="Custom"}(l.PlanType||(l.PlanType={}))},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=e(0),u=e(40),o=e(37),i=e(2),r=e(13),a=e(18),s=e(17),d=e(269),c=e(127),p=e(8),f=e(7),v=e(5),h=e(265),g=e(4),m=e(3),y=e(9),C=t.ɵcrt({encapsulation:2,styles:[],data:{}});function b(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,15,"app-callout",[["icon","fa-info-circle"]],null,null,null,u.View_CalloutComponent_0,u.RenderType_CalloutComponent)),t.ɵdid(1,114688,null,0,o.CalloutComponent,[i.I18nService],{icon:[0,"icon"],title:[1,"title"]},null),t.ɵppd(2,1),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵeld(4,0,null,0,2,"p",[],null,null,null,null,null)),(n()(),t.ɵted(5,null,["",""])),t.ɵppd(6,1),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵeld(8,0,null,0,2,"a",[["class","btn btn-outline-secondary"],["href","https://bitwarden.com/contact/"],["rel","noopener"],["target","_blank"]],null,null,null,null,null)),(n()(),t.ɵted(9,null,["\n ","\n "])),t.ɵppd(10,1),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵeld(12,0,null,0,2,"button",[["class","btn btn-outline-secondary"],["type","button"]],null,[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.cancel()&&t);return t},null,null)),(n()(),t.ɵted(13,null,["\n ","\n "])),t.ɵppd(14,1),(n()(),t.ɵted(-1,0,["\n"]))],function(n,l){n(l,1,0,"fa-info-circle",t.ɵinlineInterpolate(1,"",t.ɵunv(l,1,1,n(l,2,0,t.ɵnov(l.parent,0),"contactSupport")),""))},function(n,l){n(l,5,0,t.ɵunv(l,5,0,n(l,6,0,t.ɵnov(l.parent,0),"contactSupportPaymentMethod"))),n(l,9,0,t.ɵunv(l,9,0,n(l,10,0,t.ɵnov(l.parent,0),"contactSupport"))),n(l,13,0,t.ɵunv(l,13,0,n(l,14,0,t.ɵnov(l.parent,0),"close")))})}function S(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,[["form",1]],null,29,"form",[["class","card"],["ngNativeValidate",""]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngSubmit"],[null,"submit"],[null,"reset"]],function(n,l,e){var u=!0,o=n.component;"submit"===l&&(u=!1!==t.ɵnov(n,1).onSubmit(e)&&u);"reset"===l&&(u=!1!==t.ɵnov(n,1).onReset()&&u);"ngSubmit"===l&&(u=!1!==o.submit()&&u);return u},null,null)),t.ɵdid(1,4210688,null,0,r.NgForm,[[8,null],[8,null]],null,{ngSubmit:"ngSubmit"}),t.ɵprd(2048,null,r.ControlContainer,null,[r.NgForm]),t.ɵdid(3,16384,null,0,r.NgControlStatusGroup,[r.ControlContainer],null,null),t.ɵdid(4,540672,null,0,a.ApiActionDirective,[t.ElementRef,s.ValidationService],{appApiAction:[0,"appApiAction"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(6,0,null,null,22,"div",[["class","card-body"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(8,0,null,null,2,"h3",[["class","card-body-header"]],null,null,null,null,null)),(n()(),t.ɵted(9,null,["",""])),t.ɵppd(10,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(12,0,null,null,1,"app-payment",[],null,null,null,d.View_PaymentComponent_0,d.RenderType_PaymentComponent)),t.ɵdid(13,245760,[[1,4]],0,c.PaymentComponent,[i.I18nService,p.PlatformUtilsService],{showOptions:[0,"showOptions"],hideBank:[1,"hideBank"],hidePaypal:[2,"hidePaypal"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(15,0,null,null,8,"button",[["class","btn btn-primary btn-submit"],["type","submit"]],[[8,"disabled",0]],null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(17,0,null,null,1,"i",[["class","fa fa-spinner fa-spin"]],[[8,"title",0]],null,null,null,null)),t.ɵppd(18,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(20,0,null,null,2,"span",[],null,null,null,null,null)),(n()(),t.ɵted(21,null,["",""])),t.ɵppd(22,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(25,0,null,null,2,"button",[["class","btn btn-outline-secondary"],["type","button"]],null,[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.cancel()&&t);return t},null,null)),(n()(),t.ɵted(26,null,["\n ","\n "])),t.ɵppd(27,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){var e=l.component;n(l,4,0,e.formPromise);n(l,13,0,e.organizationId,!e.organizationId,!0)},function(n,l){var e=l.component;n(l,0,0,t.ɵnov(l,3).ngClassUntouched,t.ɵnov(l,3).ngClassTouched,t.ɵnov(l,3).ngClassPristine,t.ɵnov(l,3).ngClassDirty,t.ɵnov(l,3).ngClassValid,t.ɵnov(l,3).ngClassInvalid,t.ɵnov(l,3).ngClassPending),n(l,9,0,t.ɵunv(l,9,0,n(l,10,0,t.ɵnov(l.parent,0),null!=e.currentType?"changePaymentMethod":"addPaymentMethod"))),n(l,15,0,t.ɵnov(l,0).loading),n(l,17,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,17,0,n(l,18,0,t.ɵnov(l.parent,0),"loading")),"")),n(l,21,0,t.ɵunv(l,21,0,n(l,22,0,t.ɵnov(l.parent,0),"submit"))),n(l,26,0,t.ɵunv(l,26,0,n(l,27,0,t.ɵnov(l.parent,0),"cancel")))})}function w(n){return t.ɵvid(0,[t.ɵpid(0,f.I18nPipe,[i.I18nService]),t.ɵqud(671088640,1,{paymentComponent:0}),(n()(),t.ɵand(16777216,null,null,1,null,b)),t.ɵdid(3,16384,null,0,v.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,null,null,1,null,S)),t.ɵdid(6,16384,null,0,v.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){var e=l.component;n(l,3,0,!e.canChange),n(l,6,0,e.canChange)},null)}function R(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"app-adjust-payment",[],null,null,null,w,C)),t.ɵdid(1,49152,null,0,h.AdjustPaymentComponent,[g.ApiService,i.I18nService,m.Angulartics2,y.ToasterService],null,null)],null,null)}l.RenderType_AdjustPaymentComponent=C,l.View_AdjustPaymentComponent_0=w,l.View_AdjustPaymentComponent_Host_0=R;var _=t.ɵccf("app-adjust-payment",h.AdjustPaymentComponent,R,{currentType:"currentType",organizationId:"organizationId"},{onAdjusted:"onAdjusted",onCanceled:"onCanceled"},[]);l.AdjustPaymentComponentNgFactory=_},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=e(0),u=e(7),o=e(2),i=e(5),r=e(13),a=e(18),s=e(17),d=e(266),c=e(4),p=e(3),f=e(9),v=t.ɵcrt({encapsulation:2,styles:[],data:{}});function h(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,8,"div",[["class","mb-3"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,2,"strong",[],null,null,null,null,null)),(n()(),t.ɵted(3,null,["",":"])),t.ɵppd(4,1),(n()(),t.ɵted(5,null,[" "," GB × "," = "," /","\n "])),t.ɵppd(6,2),t.ɵppd(7,2),t.ɵppd(8,1)],null,function(n,l){var e=l.component;n(l,3,0,t.ɵunv(l,3,0,n(l,4,0,t.ɵnov(l.parent,0),"total"))),n(l,5,0,e.storageAdjustment||0,t.ɵunv(l,5,1,n(l,6,0,t.ɵnov(l.parent,1),e.storageGbPrice,"$")),t.ɵunv(l,5,2,n(l,7,0,t.ɵnov(l.parent,1),e.adjustedStorageTotal,"$")),t.ɵunv(l,5,3,n(l,8,0,t.ɵnov(l.parent,0),e.interval)))})}function g(n){return t.ɵvid(0,[t.ɵpid(0,u.I18nPipe,[o.I18nService]),t.ɵpid(0,i.CurrencyPipe,[t.LOCALE_ID]),(n()(),t.ɵeld(2,0,[["form",1]],null,53,"form",[["class","card"],["ngNativeValidate",""]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngSubmit"],[null,"submit"],[null,"reset"]],function(n,l,e){var u=!0,o=n.component;"submit"===l&&(u=!1!==t.ɵnov(n,3).onSubmit(e)&&u);"reset"===l&&(u=!1!==t.ɵnov(n,3).onReset()&&u);"ngSubmit"===l&&(u=!1!==o.submit()&&u);return u},null,null)),t.ɵdid(3,4210688,null,0,r.NgForm,[[8,null],[8,null]],null,{ngSubmit:"ngSubmit"}),t.ɵprd(2048,null,r.ControlContainer,null,[r.NgForm]),t.ɵdid(5,16384,null,0,r.NgControlStatusGroup,[r.ControlContainer],null,null),t.ɵdid(6,540672,null,0,a.ApiActionDirective,[t.ElementRef,s.ValidationService],{appApiAction:[0,"appApiAction"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(8,0,null,null,46,"div",[["class","card-body"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(10,0,null,null,2,"h3",[["class","card-body-header"]],null,null,null,null,null)),(n()(),t.ɵted(11,null,["",""])),t.ɵppd(12,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(14,0,null,null,18,"div",[["class","row"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(16,0,null,null,15,"div",[["class","form-group col-6"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(18,0,null,null,2,"label",[["for","storageAdjustment"]],null,null,null,null,null)),(n()(),t.ɵted(19,null,["",""])),t.ɵppd(20,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(22,0,null,null,8,"input",[["class","form-control"],["id","storageAdjustment"],["max","99"],["min","0"],["name","StroageGbAdjustment"],["required",""],["step","1"],["type","number"]],[[1,"required",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"],[null,"change"]],function(n,l,e){var u=!0,o=n.component;"input"===l&&(u=!1!==t.ɵnov(n,23)._handleInput(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,23).onTouched()&&u);"compositionstart"===l&&(u=!1!==t.ɵnov(n,23)._compositionStart()&&u);"compositionend"===l&&(u=!1!==t.ɵnov(n,23)._compositionEnd(e.target.value)&&u);"change"===l&&(u=!1!==t.ɵnov(n,24).onChange(e.target.value)&&u);"input"===l&&(u=!1!==t.ɵnov(n,24).onChange(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,24).onTouched()&&u);"ngModelChange"===l&&(u=!1!==(o.storageAdjustment=e)&&u);return u},null,null)),t.ɵdid(23,16384,null,0,r.DefaultValueAccessor,[t.Renderer2,t.ElementRef,[2,r.COMPOSITION_BUFFER_MODE]],null,null),t.ɵdid(24,16384,null,0,r.ɵbc,[t.Renderer2,t.ElementRef],null,null),t.ɵdid(25,16384,null,0,r.RequiredValidator,[],{required:[0,"required"]},null),t.ɵprd(1024,null,r.NG_VALIDATORS,function(n){return[n]},[r.RequiredValidator]),t.ɵprd(1024,null,r.NG_VALUE_ACCESSOR,function(n,l){return[n,l]},[r.DefaultValueAccessor,r.ɵbc]),t.ɵdid(28,671744,null,0,r.NgModel,[[2,r.ControlContainer],[2,r.NG_VALIDATORS],[8,null],[2,r.NG_VALUE_ACCESSOR]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,r.NgControl,null,[r.NgModel]),t.ɵdid(30,16384,null,0,r.NgControlStatus,[r.NgControl],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,h)),t.ɵdid(35,16384,null,0,i.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(37,0,null,null,8,"button",[["class","btn btn-primary btn-submit"],["type","submit"]],[[8,"disabled",0]],null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(39,0,null,null,1,"i",[["class","fa fa-spinner fa-spin"]],[[8,"title",0]],null,null,null,null)),t.ɵppd(40,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(42,0,null,null,2,"span",[],null,null,null,null,null)),(n()(),t.ɵted(43,null,["",""])),t.ɵppd(44,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(47,0,null,null,2,"button",[["class","btn btn-outline-secondary"],["type","button"]],null,[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.cancel()&&t);return t},null,null)),(n()(),t.ɵted(48,null,["\n ","\n "])),t.ɵppd(49,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(51,0,null,null,2,"small",[["class","d-block text-muted mt-3"]],null,null,null,null,null)),(n()(),t.ɵted(52,null,["\n ","\n "])),t.ɵppd(53,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){var e=l.component;n(l,6,0,e.formPromise);n(l,25,0,"");n(l,28,0,"StroageGbAdjustment",e.storageAdjustment),n(l,35,0,e.add)},function(n,l){var e=l.component;n(l,2,0,t.ɵnov(l,5).ngClassUntouched,t.ɵnov(l,5).ngClassTouched,t.ɵnov(l,5).ngClassPristine,t.ɵnov(l,5).ngClassDirty,t.ɵnov(l,5).ngClassValid,t.ɵnov(l,5).ngClassInvalid,t.ɵnov(l,5).ngClassPending),n(l,11,0,t.ɵunv(l,11,0,n(l,12,0,t.ɵnov(l,0),e.add?"addStorage":"removeStorage"))),n(l,19,0,t.ɵunv(l,19,0,n(l,20,0,t.ɵnov(l,0),e.add?"gbStorageAdd":"gbStorageRemove"))),n(l,22,0,t.ɵnov(l,25).required?"":null,t.ɵnov(l,30).ngClassUntouched,t.ɵnov(l,30).ngClassTouched,t.ɵnov(l,30).ngClassPristine,t.ɵnov(l,30).ngClassDirty,t.ɵnov(l,30).ngClassValid,t.ɵnov(l,30).ngClassInvalid,t.ɵnov(l,30).ngClassPending),n(l,37,0,t.ɵnov(l,2).loading),n(l,39,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,39,0,n(l,40,0,t.ɵnov(l,0),"loading")),"")),n(l,43,0,t.ɵunv(l,43,0,n(l,44,0,t.ɵnov(l,0),"submit"))),n(l,48,0,t.ɵunv(l,48,0,n(l,49,0,t.ɵnov(l,0),"cancel"))),n(l,52,0,t.ɵunv(l,52,0,n(l,53,0,t.ɵnov(l,0),e.add?"storageAddNote":"storageRemoveNote")))})}function m(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"app-adjust-storage",[],null,null,null,g,v)),t.ɵdid(1,49152,null,0,d.AdjustStorageComponent,[c.ApiService,o.I18nService,p.Angulartics2,f.ToasterService],null,null)],null,null)}l.RenderType_AdjustStorageComponent=v,l.View_AdjustStorageComponent_0=g,l.View_AdjustStorageComponent_Host_0=m;var y=t.ɵccf("app-adjust-storage",d.AdjustStorageComponent,m,{storageGbPrice:"storageGbPrice",add:"add",organizationId:"organizationId",interval:"interval"},{onAdjusted:"onAdjusted",onCanceled:"onCanceled"},[]);l.AdjustStorageComponentNgFactory=y},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=e(0),u=e(7),o=e(2),i=e(13),r=e(18),a=e(17),s=e(267),d=e(4),c=e(3),p=e(9),f=t.ɵcrt({encapsulation:2,styles:[],data:{}});function v(n){return t.ɵvid(0,[t.ɵpid(0,u.I18nPipe,[o.I18nService]),(n()(),t.ɵeld(1,0,[["form",1]],null,32,"form",[["ngNativeValidate",""]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngSubmit"],[null,"submit"],[null,"reset"]],function(n,l,e){var u=!0,o=n.component;"submit"===l&&(u=!1!==t.ɵnov(n,2).onSubmit(e)&&u);"reset"===l&&(u=!1!==t.ɵnov(n,2).onReset()&&u);"ngSubmit"===l&&(u=!1!==o.submit()&&u);return u},null,null)),t.ɵdid(2,4210688,null,0,i.NgForm,[[8,null],[8,null]],null,{ngSubmit:"ngSubmit"}),t.ɵprd(2048,null,i.ControlContainer,null,[i.NgForm]),t.ɵdid(4,16384,null,0,i.NgControlStatusGroup,[i.ControlContainer],null,null),t.ɵdid(5,540672,null,0,r.ApiActionDirective,[t.ElementRef,a.ValidationService],{appApiAction:[0,"appApiAction"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(7,0,null,null,11,"div",[["class","form-group"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(9,0,null,null,2,"label",[["class","sr-only"],["for","file"]],null,null,null,null,null)),(n()(),t.ɵted(10,null,["",""])),t.ɵppd(11,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(13,0,null,null,0,"input",[["class","form-control-file"],["id","file"],["name","file"],["required",""],["type","file"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(15,0,null,null,2,"small",[["class","form-text text-muted"]],null,null,null,null,null)),(n()(),t.ɵted(16,null,["",""])),t.ɵppd(17,2),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(20,0,null,null,8,"button",[["class","btn btn-primary btn-submit"],["type","submit"]],[[8,"disabled",0]],null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(22,0,null,null,1,"i",[["class","fa fa-spinner fa-spin"]],[[8,"title",0]],null,null,null,null)),t.ɵppd(23,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(25,0,null,null,2,"span",[],null,null,null,null,null)),(n()(),t.ɵted(26,null,["",""])),t.ɵppd(27,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(30,0,null,null,2,"button",[["class","btn btn-outline-secondary"],["type","button"]],null,[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.cancel()&&t);return t},null,null)),(n()(),t.ɵted(31,null,["\n ","\n "])),t.ɵppd(32,1),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){n(l,5,0,l.component.formPromise)},function(n,l){var e=l.component;n(l,1,0,t.ɵnov(l,4).ngClassUntouched,t.ɵnov(l,4).ngClassTouched,t.ɵnov(l,4).ngClassPristine,t.ɵnov(l,4).ngClassDirty,t.ɵnov(l,4).ngClassValid,t.ɵnov(l,4).ngClassInvalid,t.ɵnov(l,4).ngClassPending),n(l,10,0,t.ɵunv(l,10,0,n(l,11,0,t.ɵnov(l,0),"licenseFile"))),n(l,16,0,t.ɵunv(l,16,0,n(l,17,0,t.ɵnov(l,0),"licenseFileDesc",e.organizationId?"bitwarden_organization_license.json":"bitwarden_premium_license.json"))),n(l,20,0,t.ɵnov(l,1).loading),n(l,22,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,22,0,n(l,23,0,t.ɵnov(l,0),"loading")),"")),n(l,26,0,t.ɵunv(l,26,0,n(l,27,0,t.ɵnov(l,0),"submit"))),n(l,31,0,t.ɵunv(l,31,0,n(l,32,0,t.ɵnov(l,0),"cancel")))})}function h(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"app-update-license",[],null,null,null,v,f)),t.ɵdid(1,49152,null,0,s.UpdateLicenseComponent,[d.ApiService,o.I18nService,c.Angulartics2,p.ToasterService],null,null)],null,null)}l.RenderType_UpdateLicenseComponent=f,l.View_UpdateLicenseComponent_0=v,l.View_UpdateLicenseComponent_Host_0=h;var g=t.ɵccf("app-update-license",s.UpdateLicenseComponent,h,{organizationId:"organizationId"},{onUpdated:"onUpdated",onCanceled:"onCanceled"},[]);l.UpdateLicenseComponentNgFactory=g},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)}),o=this&&this.__awaiter||function(n,l,e,t){return new(e||(e=Promise))(function(u,o){function i(n){try{a(t.next(n))}catch(n){o(n)}}function r(n){try{a(t.throw(n))}catch(n){o(n)}}function a(n){n.done?u(n.value):new e(function(l){l(n.value)}).then(i,r)}a((t=t.apply(n,l||[])).next())})},i=this&&this.__generator||function(n,l){var e,t,u,o,i={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return o={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function r(o){return function(r){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;i;)try{if(e=1,t&&(u=t[2&o[0]?"return":o[0]?"throw":"next"])&&!(u=u.call(t,o[1])).done)return u;switch(t=0,u&&(o=[0,u.value]),o[0]){case 0:case 1:u=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,t=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(u=(u=i.trys).length>0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0?this.keys[0].key:null,e.key2=null!=this.keys&&this.keys.length>1?this.keys[1].key:null,e.key3=null!=this.keys&&this.keys.length>2?this.keys[2].key:null,e.key4=null!=this.keys&&this.keys.length>3?this.keys[3].key:null,e.key5=null!=this.keys&&this.keys.length>4?this.keys[4].key:null,e.nfc=this.nfc,n.prototype.enable.call(this,function(){return o(l,void 0,void 0,function(){var n;return i(this,function(l){switch(l.label){case 0:return this.formPromise=this.apiService.putTwoFactorYubiKey(e),[4,this.formPromise];case 1:return n=l.sent(),[4,this.processResponse(n)];case 2:return l.sent(),this.toasterService.popAsync("success",null,this.i18nService.t("yubikeysUpdated")),[2]}})})})},l.prototype.disable=function(){return n.prototype.disable.call(this,this.disablePromise)},l.prototype.remove=function(n){n.existingKey=null,n.key=null},l.prototype.processResponse=function(n){this.enabled=n.enabled,this.keys=[{key:n.key1,existingKey:this.padRight(n.key1)},{key:n.key2,existingKey:this.padRight(n.key2)},{key:n.key3,existingKey:this.padRight(n.key3)},{key:n.key4,existingKey:this.padRight(n.key4)},{key:n.key5,existingKey:this.padRight(n.key5)}],this.nfc=n.nfc||!n.enabled},l.prototype.padRight=function(n,l,e){if(void 0===l&&(l="•"),void 0===e&&(e=44),null==n||null==l||n.length>=e)return n;for(var t=(e-n.length)/l.length,u=0;u0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]

'+this.i18nService.t("twoFactorRecoveryYourCode")+":

"+this.code+'

'+new Date+"

"),n.print(),n.close()},n.prototype.formatString=function(n){return null==n?null:n.replace(/(.{4})/g,"$1 ").trim().toUpperCase()},n.prototype.processResponse=function(n){this.code=this.formatString(n.code)},n}();l.TwoFactorRecoveryComponent=u},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)}),o=this&&this.__awaiter||function(n,l,e,t){return new(e||(e=Promise))(function(u,o){function i(n){try{a(t.next(n))}catch(n){o(n)}}function r(n){try{a(t.throw(n))}catch(n){o(n)}}function a(n){n.done?u(n.value):new e(function(l){l(n.value)}).then(i,r)}a((t=t.apply(n,l||[])).next())})},i=this&&this.__generator||function(n,l){var e,t,u,o,i={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return o={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function r(o){return function(r){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;i;)try{if(e=1,t&&(u=t[2&o[0]?"return":o[0]?"throw":"next"])&&!(u=u.call(t,o[1])).done)return u;switch(t=0,u&&(o=[0,u.value]),o[0]){case 0:case 1:u=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,t=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(u=(u=i.trys).length>0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&(this.organizationId=this.organizations[0].id),this.filterCollections(),[2]}})})},n.prototype.ngOnDestroy=function(){this.selectAll(!1)},n.prototype.filterCollections=function(){var n=this;this.selectAll(!1),null==this.organizationId||0===this.writeableCollections.length?this.collections=[]:this.collections=this.writeableCollections.filter(function(l){return l.organizationId===n.organizationId})},n.prototype.submit=function(){return t(this,void 0,void 0,function(){var n,l,e,o,i,r,a,s=this;return u(this,function(d){switch(d.label){case 0:return[4,this.cipherService.get(this.cipherId)];case 1:return[4,d.sent().decrypt()];case 2:if(n=d.sent(),l=[],null!=n.attachments)for(e=0,o=n.attachments;e0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&(this.organizationId=this.organizations[0].id),this.filterCollections(),[2]}})})},n.prototype.ngOnDestroy=function(){this.selectAll(!1)},n.prototype.filterCollections=function(){var n=this;this.selectAll(!1),null==this.organizationId||0===this.writeableCollections.length?this.collections=[]:this.collections=this.writeableCollections.filter(function(l){return l.organizationId===n.organizationId})},n.prototype.submit=function(){return t(this,void 0,void 0,function(){var n;return u(this,function(l){switch(l.label){case 0:return n=this.collections.filter(function(n){return n.checked}).map(function(n){return n.id}),this.formPromise=this.cipherService.shareManyWithServer(this.shareableCiphers,this.organizationId,n),[4,this.formPromise];case 1:return l.sent(),this.onShared.emit(),this.analytics.eventTrack.next({action:"Bulk Shared Items"}),this.toasterService.popAsync("success",null,this.i18nService.t("sharedItems")),[2]}})})},n.prototype.check=function(n,l){n.checked=null==l?!n.checked:l},n.prototype.selectAll=function(n){var l=this;(n?this.collections:this.writeableCollections).forEach(function(e){return l.check(e,n)})},n}());l.BulkShareComponent=i},function(n,l,e){"use strict";var t=this&&this.__awaiter||function(n,l,e,t){return new(e||(e=Promise))(function(u,o){function i(n){try{a(t.next(n))}catch(n){o(n)}}function r(n){try{a(t.throw(n))}catch(n){o(n)}}function a(n){n.done?u(n.value):new e(function(l){l(n.value)}).then(i,r)}a((t=t.apply(n,l||[])).next())})},u=this&&this.__generator||function(n,l){var e,t,u,o,i={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return o={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function r(o){return function(r){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;i;)try{if(e=1,t&&(u=t[2&o[0]?"return":o[0]?"throw":"next"])&&!(u=u.call(t,o[1])).done)return u;switch(t=0,u&&(o=[0,u.value]),o[0]){case 0:case 1:u=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,t=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(u=(u=i.trys).length>0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]-1||!e.onlySearchName&&(!!(l.length>=8&&n.id.startsWith(l))||(null!=n.subTitle&&n.subTitle.toLowerCase().indexOf(l)>-1||!!(n.login&&null!=n.login.uri&&n.login.uri.toLowerCase().indexOf(l)>-1)))}))},n}();l.SearchCiphersPipe=u},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=e(0),u=e(807),o=e(5),i=e(281),r=e(131),a=e(61),s=t.ɵcrt({encapsulation:2,styles:[],data:{}});function d(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"img",[["alt",""]],[[8,"src",4]],[[null,"error"]],function(n,l,e){var u=!0;"error"===l&&(u=!1!==t.ɵnov(n,1).onError()&&u);return u},null,null)),t.ɵdid(1,16384,null,0,u.FallbackSrcDirective,[t.ElementRef],{appFallbackSrc:[0,"appFallbackSrc"]},null)],function(n,l){var e=l.component;n(l,1,0,t.ɵinlineInterpolate(1,"",e.fallbackImage,""))},function(n,l){n(l,0,0,l.component.image)})}function c(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,0,"i",[],[[8,"className",0]],null,null,null,null))],null,function(n,l){var e=l.component;n(l,0,0,t.ɵinlineInterpolate(1,"fa fa-fw fa-lg ",e.icon,""))})}function p(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,7,"div",[["class","icon"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,d)),t.ɵdid(3,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,c)),t.ɵdid(6,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){var e=l.component;n(l,3,0,e.imageEnabled&&e.image),n(l,6,0,!e.imageEnabled||!e.image)},null)}function f(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"app-vault-icon",[],null,null,null,p,s)),t.ɵdid(1,573440,null,0,i.IconComponent,[r.EnvironmentService,a.StateService],null,null)],null,null)}l.RenderType_IconComponent=s,l.View_IconComponent_0=p,l.View_IconComponent_Host_0=f;var v=t.ɵccf("app-vault-icon",i.IconComponent,f,{cipher:"cipher"},{},[]);l.IconComponentNgFactory=v},function(n,l,e){"use strict";var t=this&&this.__awaiter||function(n,l,e,t){return new(e||(e=Promise))(function(u,o){function i(n){try{a(t.next(n))}catch(n){o(n)}}function r(n){try{a(t.throw(n))}catch(n){o(n)}}function a(n){n.done?u(n.value):new e(function(l){l(n.value)}).then(i,r)}a((t=t.apply(n,l||[])).next())})},u=this&&this.__generator||function(n,l){var e,t,u,o,i={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return o={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function r(o){return function(r){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;i;)try{if(e=1,t&&(u=t[2&o[0]?"return":o[0]?"throw":"next"])&&!(u=u.call(t,o[1])).done)return u;switch(t=0,u&&(o=[0,u.value]),o[0]){case 0:case 1:u=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,t=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(u=(u=i.trys).length>0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&n.data.forEach(function(n){var t=new a.Collection(new d.CollectionData(n));l.push(t.decrypt().then(function(n){e.push(n)}))}),Promise.all(l)})),c.push(this.apiService.getCiphersOrganization(n).then(function(n){var l=[];return null!=n&&null!=n.data&&n.data.length>0&&n.data.forEach(function(n){var e=new r.Cipher(new s.CipherData(n));l.push(e.decrypt().then(function(n){t.push(n)}))}),Promise.all(l)})),[4,Promise.all(c)];case 1:return u.sent(),p=new Map,e.forEach(function(n){p.set(n.id,n)}),f=[],t.forEach(function(n){if(n.type===i.CipherType.Login||n.type===i.CipherType.SecureNote){var l={collections:[]};null!=n.collectionIds&&(l.collections=n.collectionIds.filter(function(n){return p.has(n)}).map(function(n){return p.get(n).name})),v.buildCommonCipher(l,n),f.push(l)}}),"csv"===l?[2,o.unparse(f)]:[2,JSON.stringify(f,null," ")]}})})},n.prototype.getFileName=function(n){void 0===n&&(n=null);var l=new Date,e=l.getFullYear()+""+this.padNumber(l.getMonth()+1,2)+this.padNumber(l.getDate(),2)+this.padNumber(l.getHours(),2)+this.padNumber(l.getMinutes(),2)+this.padNumber(l.getSeconds(),2);return"bitwarden"+(n?"_"+n:"")+"_export_"+e+".csv"},n.prototype.padNumber=function(n,l,e){void 0===e&&(e="0");var t=n.toString();return t.length>=l?t:new Array(l-t.length+1).join(e)+t},n.prototype.buildCommonCipher=function(n,l){switch(n.type=null,n.name=l.name,n.notes=l.notes,n.fields=null,n.login_uri=null,n.login_username=null,n.login_password=null,n.login_totp=null,l.fields&&l.fields.forEach(function(l){n.fields?n.fields+="\n":n.fields="",n.fields+=(l.name||"")+": "+l.value}),l.type){case i.CipherType.Login:n.type="login",n.login_username=l.login.username,n.login_password=l.login.password,n.login_totp=l.login.totp,l.login.uris&&(n.login_uri=[],l.login.uris.forEach(function(l){n.login_uri.push(l.uri)}));break;case i.CipherType.SecureNote:n.type="note";break;default:return}return n},n}();l.ExportService=c},function(n,l,e){"use strict";var t,u=this&&this.__awaiter||function(n,l,e,t){return new(e||(e=Promise))(function(u,o){function i(n){try{a(t.next(n))}catch(n){o(n)}}function r(n){try{a(t.throw(n))}catch(n){o(n)}}function a(n){n.done?u(n.value):new e(function(l){l(n.value)}).then(i,r)}a((t=t.apply(n,l||[])).next())})},o=this&&this.__generator||function(n,l){var e,t,u,o,i={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return o={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function r(o){return function(r){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;i;)try{if(e=1,t&&(u=t[2&o[0]?"return":o[0]?"throw":"next"])&&!(u=u.call(t,o[1])).done)return u;switch(t=0,u&&(o=[0,u.value]),o[0]){case 0:case 1:u=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,t=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(u=(u=i.trys).length>0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]-1&&(n=n.substring(0,l)),0!==n.indexOf("!/")&&0!==n.indexOf("#/")||(n=n.substring(1));var e=[];return n.split("/").forEach(function(n){n.match(/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i)?e.push("__guid__"):e.push(n)}),encodeURIComponent(e.join("/"))},n}();l.Analytics=s},function(n,l,e){"use strict";var t=this&&this.__awaiter||function(n,l,e,t){return new(e||(e=Promise))(function(u,o){function i(n){try{a(t.next(n))}catch(n){o(n)}}function r(n){try{a(t.throw(n))}catch(n){o(n)}}function a(n){n.done?u(n.value):new e(function(l){l(n.value)}).then(i,r)}a((t=t.apply(n,l||[])).next())})},u=this&&this.__generator||function(n,l){var e,t,u,o,i={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return o={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function r(o){return function(r){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;i;)try{if(e=1,t&&(u=t[2&o[0]?"return":o[0]?"throw":"next"])&&!(u=u.call(t,o[1])).done)return u;switch(t=0,u&&(o=[0,u.value]),o[0]){case 0:case 1:u=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,t=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(u=(u=i.trys).length>0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]=0?this.browserCache=i.DeviceType.OperaBrowser:-1!==navigator.userAgent.indexOf(" Edge/")?this.browserCache=i.DeviceType.EdgeBrowser:-1!==navigator.userAgent.indexOf(" Vivaldi/")?this.browserCache=i.DeviceType.VivaldiBrowser:-1!==navigator.userAgent.indexOf(" Safari/")&&-1===navigator.userAgent.indexOf("Chrome")?this.browserCache=i.DeviceType.SafariBrowser:window.chrome&&-1!==navigator.userAgent.indexOf(" Chrome/")?this.browserCache=i.DeviceType.ChromeBrowser:-1!==navigator.userAgent.indexOf(" Trident/")?this.browserCache=i.DeviceType.IEBrowser:this.browserCache=i.DeviceType.UnknownBrowser,this.browserCache)},n.prototype.getDeviceString=function(){return i.DeviceType[this.getDevice()].toLowerCase().replace("browser","")},n.prototype.isFirefox=function(){return this.getDevice()===i.DeviceType.FirefoxBrowser},n.prototype.isChrome=function(){return this.getDevice()===i.DeviceType.ChromeBrowser},n.prototype.isEdge=function(){return this.getDevice()===i.DeviceType.EdgeBrowser},n.prototype.isOpera=function(){return this.getDevice()===i.DeviceType.OperaBrowser},n.prototype.isVivaldi=function(){return this.getDevice()===i.DeviceType.VivaldiBrowser},n.prototype.isSafari=function(){return this.getDevice()===i.DeviceType.SafariBrowser},n.prototype.isIE=function(){return this.getDevice()===i.DeviceType.IEBrowser},n.prototype.isMacAppStore=function(){return!1},n.prototype.analyticsId=function(){return"UA-81915606-3"},n.prototype.getDomain=function(n){return r.Utils.getHostname(n)},n.prototype.isViewOpen=function(){return!1},n.prototype.lockTimeout=function(){return 15},n.prototype.launchUri=function(n,l){var e=document.createElement("a");e.href=n,e.target="_blank",e.rel="noreferrer noopener",e.classList.add("d-none"),document.body.appendChild(e),e.click(),document.body.removeChild(e)},n.prototype.saveFile=function(n,l,e,t){var u=null;if(u=null==e||this.isIE()?new Blob([l]):new Blob([l],e),navigator.msSaveOrOpenBlob)navigator.msSaveBlob(u,t);else{var o=n.document.createElement("a");o.href=n.URL.createObjectURL(u),o.download=t,o.style.position="fixed",n.document.body.appendChild(o),o.click(),n.document.body.removeChild(o)}},n.prototype.getApplicationVersion=function(){return"2.0.0"},n.prototype.supportsU2f=function(n){return null!=n&&null!=n.u2f||(this.isChrome()||this.isOpera()||this.isVivaldi())&&!this.isMobile(n)},n.prototype.supportsDuo=function(){return!0},n.prototype.showToast=function(n,l,e,t){throw new Error("showToast not implemented")},n.prototype.showDialog=function(n,l,e,o,i){return t(this,void 0,void 0,function(){var t,r,s,d,c;return u(this,function(u){switch(u.label){case 0:if(t=[null==e?this.i18nService.t("ok"):e],null!=o&&t.unshift(o),r=document.createElement("div"),null!=i){switch((s=document.createElement("i")).classList.add("swal-custom-icon"),i){case"success":s.classList.add("fa","fa-check","text-success");break;case"warning":s.classList.add("fa","fa-warning","text-warning");break;case"error":s.classList.add("fa","fa-bolt","text-danger");break;case"info":s.classList.add("fa","fa-info-circle","text-info")}s.classList.contains("fa")&&r.appendChild(s)}return null!=l&&((d=document.createElement("div")).classList.add("swal-title"),d.appendChild(document.createTextNode(l)),r.appendChild(d)),null!=n&&((c=document.createElement("div")).classList.add("swal-text"),c.appendChild(document.createTextNode(n)),r.appendChild(c)),[4,a({content:{element:r},buttons:t})];case 1:return[2,u.sent()]}})})},n.prototype.isDev=function(){return!1},n.prototype.isSelfHost=function(){return"true"===(!1).toString()},n.prototype.copyToClipboard=function(n,l){var e=l?l.doc:window.document;if(window.clipboardData&&window.clipboardData.setData)window.clipboardData.setData("Text",n);else if(e.queryCommandSupported&&e.queryCommandSupported("copy")){var t=e.createElement("textarea");t.textContent=n,t.style.position="fixed",e.body.appendChild(t),t.select();try{e.execCommand("copy")}catch(n){console.warn("Copy to clipboard failed.",n)}finally{e.body.removeChild(t)}}},n.prototype.isMobile=function(n){var l,e=!1;return l=n.navigator.userAgent||n.navigator.vendor||n.opera,(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(l)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(l.substr(0,4)))&&(e=!0),e||null!=n.navigator.userAgent.match(/iPad/i)},n}();l.WebPlatformUtilsService=s},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){function n(){this.store=new Map}return n.prototype.get=function(n){if(this.store.has(n)){var l=this.store.get(n);return Promise.resolve(l)}return Promise.resolve(null)},n.prototype.save=function(n,l){return null==l?this.remove(n):(this.store.set(n,l),Promise.resolve())},n.prototype.remove=function(n){return this.store.delete(n),Promise.resolve()},n}();l.MemoryStorageService=t},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)}),o=this&&this.__awaiter||function(n,l,e,t){return new(e||(e=Promise))(function(u,o){function i(n){try{a(t.next(n))}catch(n){o(n)}}function r(n){try{a(t.throw(n))}catch(n){o(n)}}function a(n){n.done?u(n.value):new e(function(l){l(n.value)}).then(i,r)}a((t=t.apply(n,l||[])).next())})},i=this&&this.__generator||function(n,l){var e,t,u,o,i={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return o={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function r(o){return function(r){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;i;)try{if(e=1,t&&(u=t[2&o[0]?"return":o[0]?"throw":"next"])&&!(u=u.call(t,o[1])).done)return u;switch(t=0,u&&(o=[0,u.value]),o[0]){case 0:case 1:u=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,t=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(u=(u=i.trys).length>0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]1?"×"+l.context.$implicit.quantity:"",t.ɵunv(l,3,2,n(l,4,0,t.ɵnov(l.parent.parent.parent.parent,2),l.context.$implicit.amount,"$"))),n(l,7,0,t.ɵunv(l,7,0,n(l,8,0,t.ɵnov(l.parent.parent.parent.parent,2),l.context.$implicit.quantity*l.context.$implicit.amount,"$")),t.ɵunv(l,7,1,n(l,9,0,t.ɵnov(l.parent.parent.parent.parent,0),l.context.$implicit.interval)))})}function L(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,14,"div",[["class","col-8"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,2,"strong",[["class","d-block mb-1"]],null,null,null,null,null)),(n()(),t.ɵted(3,null,["",""])),t.ɵppd(4,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(6,0,null,null,7,"table",[["class","table"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(8,0,null,null,4,"tbody",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,F)),t.ɵdid(11,802816,null,0,s.NgForOf,[t.ViewContainerRef,t.TemplateRef,t.IterableDiffers],{ngForOf:[0,"ngForOf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){n(l,11,0,l.component.subscription.items)},function(n,l){n(l,3,0,t.ɵunv(l,3,0,n(l,4,0,t.ɵnov(l.parent.parent.parent,0),"details")))})}function G(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,20,"div",[["class","row"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,14,"div",[["class","col-4"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(4,0,null,null,11,"dl",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(6,0,null,null,2,"dt",[],null,null,null,null,null)),(n()(),t.ɵted(7,null,["",""])),t.ɵppd(8,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(10,0,null,null,1,"dd",[],null,null,null,null,null)),(n()(),t.ɵted(11,null,["",""])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,U)),t.ɵdid(14,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,L)),t.ɵdid(19,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){var e=l.component;n(l,14,0,e.subscription),n(l,19,0,e.subscription)},function(n,l){var e=l.component;n(l,7,0,t.ɵunv(l,7,0,n(l,8,0,t.ɵnov(l.parent.parent,0),"billingPlan"))),n(l,11,0,e.billing.plan)})}function q(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,11,"div",[["class","card mt-3"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,8,"div",[["class","card-body"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(4,0,null,null,2,"h3",[["class","card-body-header"]],null,null,null,null,null)),(n()(),t.ɵted(5,null,["",""])),t.ɵppd(6,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(8,0,null,null,1,"app-update-license",[],null,[[null,"onUpdated"],[null,"onCanceled"]],function(n,l,e){var t=!0,u=n.component;"onUpdated"===l&&(t=!1!==u.closeUpdateLicense(!0)&&t);"onCanceled"===l&&(t=!1!==u.closeUpdateLicense(!1)&&t);return t},d.View_UpdateLicenseComponent_0,d.RenderType_UpdateLicenseComponent)),t.ɵdid(9,49152,null,0,c.UpdateLicenseComponent,[p.ApiService,i.I18nService,f.Angulartics2,v.ToasterService],{organizationId:[0,"organizationId"]},{onUpdated:"onUpdated",onCanceled:"onCanceled"}),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){n(l,9,0,l.component.organizationId)},function(n,l){n(l,5,0,t.ɵunv(l,5,0,n(l,6,0,t.ɵnov(l.parent.parent.parent,0),"updateLicense")))})}function z(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,15,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,9,"div",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(4,0,null,null,2,"button",[["class","btn btn-outline-secondary"],["type","button"]],null,[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.updateLicense()&&t);return t},null,null)),(n()(),t.ɵted(5,null,["\n ","\n "])),t.ɵppd(6,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(8,0,null,null,2,"a",[["class","btn btn-outline-secondary"],["href","https://vault.bitwarden.com"],["rel","noopener"],["target","_blank"]],null,null,null,null,null)),(n()(),t.ɵted(9,null,["\n ","\n "])),t.ɵppd(10,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,q)),t.ɵdid(14,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){n(l,14,0,l.component.showUpdateLicense)},function(n,l){n(l,5,0,t.ɵunv(l,5,0,n(l,6,0,t.ɵnov(l.parent.parent,0),"updateLicense"))),n(l,9,0,t.ɵunv(l,9,0,n(l,10,0,t.ɵnov(l.parent.parent,0),"manageSubscription")))})}function j(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,[["licenseBtn",1]],null,9,"button",[["class","btn btn-outline-secondary btn-submit ml-1"],["type","button"]],[[8,"disabled",0]],[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.downloadLicense()&&t);return t},null,null)),t.ɵdid(1,540672,null,0,r.ApiActionDirective,[t.ElementRef,a.ValidationService],{appApiAction:[0,"appApiAction"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(3,0,null,null,1,"i",[["class","fa fa-spinner fa-spin"]],[[8,"title",0]],null,null,null,null)),t.ɵppd(4,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(6,0,null,null,2,"span",[],null,null,null,null,null)),(n()(),t.ɵted(7,null,["",""])),t.ɵppd(8,1),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){n(l,1,0,l.component.licensePromise)},function(n,l){n(l,0,0,t.ɵnov(l,0).loading),n(l,3,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,3,0,n(l,4,0,t.ɵnov(l.parent.parent.parent,0),"loading")),"")),n(l,7,0,t.ɵunv(l,7,0,n(l,8,0,t.ɵnov(l.parent.parent.parent,0),"downloadLicense")))})}function B(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,[["cancelBtn",1]],null,9,"button",[["class","btn btn-outline-danger btn-submit ml-auto"],["type","button"]],[[8,"disabled",0]],[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.cancel()&&t);return t},null,null)),t.ɵdid(1,540672,null,0,r.ApiActionDirective,[t.ElementRef,a.ValidationService],{appApiAction:[0,"appApiAction"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(3,0,null,null,1,"i",[["class","fa fa-spinner fa-spin"]],[[8,"title",0]],null,null,null,null)),t.ɵppd(4,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(6,0,null,null,2,"span",[],null,null,null,null,null)),(n()(),t.ɵted(7,null,["",""])),t.ɵppd(8,1),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){n(l,1,0,l.component.cancelPromise)},function(n,l){n(l,0,0,t.ɵnov(l,0).loading),n(l,3,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,3,0,n(l,4,0,t.ɵnov(l.parent.parent.parent,0),"loading")),"")),n(l,7,0,t.ɵunv(l,7,0,n(l,8,0,t.ɵnov(l.parent.parent.parent,0),"cancelSubscription")))})}function K(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,9,"div",[["class","d-flex"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,2,"button",[["class","btn btn-outline-secondary"],["type","button"]],null,[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.adjustSeats(!0)&&t);return t},null,null)),(n()(),t.ɵted(3,null,["\n ","\n "])),t.ɵppd(4,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(6,0,null,null,2,"button",[["class","btn btn-outline-secondary ml-1"],["type","button"]],null,[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.adjustSeats(!1)&&t);return t},null,null)),(n()(),t.ɵted(7,null,["\n ","\n "])),t.ɵppd(8,1),(n()(),t.ɵted(-1,null,["\n "]))],null,function(n,l){n(l,3,0,t.ɵunv(l,3,0,n(l,4,0,t.ɵnov(l.parent.parent.parent.parent,0),"addSeats"))),n(l,7,0,t.ɵunv(l,7,0,n(l,8,0,t.ɵnov(l.parent.parent.parent.parent,0),"removeSeats")))})}function H(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"app-adjust-seats",[],null,[[null,"onAdjusted"],[null,"onCanceled"]],function(n,l,e){var t=!0,u=n.component;"onAdjusted"===l&&(t=!1!==u.closeSeats(!0)&&t);"onCanceled"===l&&(t=!1!==u.closeSeats(!1)&&t);return t},h.View_AdjustSeatsComponent_0,h.RenderType_AdjustSeatsComponent)),t.ɵdid(1,49152,null,0,g.AdjustSeatsComponent,[p.ApiService,i.I18nService,f.Angulartics2,v.ToasterService],{seatPrice:[0,"seatPrice"],add:[1,"add"],organizationId:[2,"organizationId"],interval:[3,"interval"]},{onAdjusted:"onAdjusted",onCanceled:"onCanceled"})],function(n,l){var e=l.component;n(l,1,0,e.seatPrice,e.adjustSeatsAdd,e.organizationId,e.billingInterval)},null)}function $(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,10,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,7,"div",[["class","mt-3"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,K)),t.ɵdid(5,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,H)),t.ɵdid(8,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){var e=l.component;n(l,5,0,!e.showAdjustSeats),n(l,8,0,e.showAdjustSeats)},null)}function W(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,9,"div",[["class","d-flex"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,2,"button",[["class","btn btn-outline-secondary"],["type","button"]],null,[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.adjustStorage(!0)&&t);return t},null,null)),(n()(),t.ɵted(3,null,["\n ","\n "])),t.ɵppd(4,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(6,0,null,null,2,"button",[["class","btn btn-outline-secondary ml-1"],["type","button"]],null,[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.adjustStorage(!1)&&t);return t},null,null)),(n()(),t.ɵted(7,null,["\n ","\n "])),t.ɵppd(8,1),(n()(),t.ɵted(-1,null,["\n "]))],null,function(n,l){n(l,3,0,t.ɵunv(l,3,0,n(l,4,0,t.ɵnov(l.parent.parent.parent.parent,0),"addStorage"))),n(l,7,0,t.ɵunv(l,7,0,n(l,8,0,t.ɵnov(l.parent.parent.parent.parent,0),"removeStorage")))})}function Y(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"app-adjust-storage",[],null,[[null,"onAdjusted"],[null,"onCanceled"]],function(n,l,e){var t=!0,u=n.component;"onAdjusted"===l&&(t=!1!==u.closeStorage(!0)&&t);"onCanceled"===l&&(t=!1!==u.closeStorage(!1)&&t);return t},m.View_AdjustStorageComponent_0,m.RenderType_AdjustStorageComponent)),t.ɵdid(1,49152,null,0,y.AdjustStorageComponent,[p.ApiService,i.I18nService,f.Angulartics2,v.ToasterService],{storageGbPrice:[0,"storageGbPrice"],add:[1,"add"],organizationId:[2,"organizationId"],interval:[3,"interval"]},{onAdjusted:"onAdjusted",onCanceled:"onCanceled"})],function(n,l){var e=l.component;n(l,1,0,e.storageGbPrice,e.adjustStorageAdd,e.organizationId,e.billingInterval)},null)}function Z(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,10,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,7,"div",[["class","mt-3"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,W)),t.ɵdid(5,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,Y)),t.ɵdid(8,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){var e=l.component;n(l,5,0,!e.showAdjustStorage),n(l,8,0,e.showAdjustStorage)},null)}function J(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,2,"p",[],null,null,null,null,null)),(n()(),t.ɵted(1,null,["",""])),t.ɵppd(2,1)],null,function(n,l){n(l,1,0,t.ɵunv(l,1,0,n(l,2,0,t.ɵnov(l.parent.parent.parent,0),"noPaymentMethod")))})}function X(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,71,"app-callout",[["type","warning"]],null,null,null,u.View_CalloutComponent_0,u.RenderType_CalloutComponent)),t.ɵdid(1,114688,null,0,o.CalloutComponent,[i.I18nService],{type:[0,"type"],title:[1,"title"]},null),t.ɵppd(2,1),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵeld(4,0,null,0,3,"p",[],null,null,null,null,null)),(n()(),t.ɵted(5,null,[""," ",""])),t.ɵppd(6,1),t.ɵppd(7,1),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵeld(9,0,[["verifyForm",1]],0,61,"form",[["class","form-inline"],["ngNativeValidate",""]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngSubmit"],[null,"submit"],[null,"reset"]],function(n,l,e){var u=!0,o=n.component;"submit"===l&&(u=!1!==t.ɵnov(n,10).onSubmit(e)&&u);"reset"===l&&(u=!1!==t.ɵnov(n,10).onReset()&&u);"ngSubmit"===l&&(u=!1!==o.verifyBank()&&u);return u},null,null)),t.ɵdid(10,4210688,null,0,C.NgForm,[[8,null],[8,null]],null,{ngSubmit:"ngSubmit"}),t.ɵprd(2048,null,C.ControlContainer,null,[C.NgForm]),t.ɵdid(12,16384,null,0,C.NgControlStatusGroup,[C.ControlContainer],null,null),t.ɵdid(13,540672,null,0,r.ApiActionDirective,[t.ElementRef,a.ValidationService],{appApiAction:[0,"appApiAction"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(15,0,null,null,2,"label",[["class","sr-only"],["for","verifyAmount1"]],null,null,null,null,null)),(n()(),t.ɵted(16,null,["",""])),t.ɵppd(17,2),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(19,0,null,null,17,"div",[["class","input-group mr-2"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(21,0,null,null,4,"div",[["class","input-group-prepend"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(23,0,null,null,1,"div",[["class","input-group-text"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["$0."])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(27,0,null,null,8,"input",[["class","form-control"],["id","verifyAmount1"],["max","99"],["min","1"],["name","Amount1"],["placeholder","xx"],["required",""],["step","1"],["type","number"]],[[1,"required",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"],[null,"change"]],function(n,l,e){var u=!0,o=n.component;"input"===l&&(u=!1!==t.ɵnov(n,28)._handleInput(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,28).onTouched()&&u);"compositionstart"===l&&(u=!1!==t.ɵnov(n,28)._compositionStart()&&u);"compositionend"===l&&(u=!1!==t.ɵnov(n,28)._compositionEnd(e.target.value)&&u);"change"===l&&(u=!1!==t.ɵnov(n,29).onChange(e.target.value)&&u);"input"===l&&(u=!1!==t.ɵnov(n,29).onChange(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,29).onTouched()&&u);"ngModelChange"===l&&(u=!1!==(o.verifyAmount1=e)&&u);return u},null,null)),t.ɵdid(28,16384,null,0,C.DefaultValueAccessor,[t.Renderer2,t.ElementRef,[2,C.COMPOSITION_BUFFER_MODE]],null,null),t.ɵdid(29,16384,null,0,C.ɵbc,[t.Renderer2,t.ElementRef],null,null),t.ɵdid(30,16384,null,0,C.RequiredValidator,[],{required:[0,"required"]},null),t.ɵprd(1024,null,C.NG_VALIDATORS,function(n){return[n]},[C.RequiredValidator]),t.ɵprd(1024,null,C.NG_VALUE_ACCESSOR,function(n,l){return[n,l]},[C.DefaultValueAccessor,C.ɵbc]),t.ɵdid(33,671744,null,0,C.NgModel,[[2,C.ControlContainer],[2,C.NG_VALIDATORS],[8,null],[2,C.NG_VALUE_ACCESSOR]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,C.NgControl,null,[C.NgModel]),t.ɵdid(35,16384,null,0,C.NgControlStatus,[C.NgControl],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(38,0,null,null,2,"label",[["class","sr-only"],["for","verifyAmount2"]],null,null,null,null,null)),(n()(),t.ɵted(39,null,["",""])),t.ɵppd(40,2),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(42,0,null,null,17,"div",[["class","input-group mr-2"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(44,0,null,null,4,"div",[["class","input-group-prepend"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(46,0,null,null,1,"div",[["class","input-group-text"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["$0."])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(50,0,null,null,8,"input",[["class","form-control"],["id","verifyAmount2"],["max","99"],["min","1"],["name","Amount2"],["placeholder","xx"],["required",""],["step","1"],["type","number"]],[[1,"required",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"],[null,"change"]],function(n,l,e){var u=!0,o=n.component;"input"===l&&(u=!1!==t.ɵnov(n,51)._handleInput(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,51).onTouched()&&u);"compositionstart"===l&&(u=!1!==t.ɵnov(n,51)._compositionStart()&&u);"compositionend"===l&&(u=!1!==t.ɵnov(n,51)._compositionEnd(e.target.value)&&u);"change"===l&&(u=!1!==t.ɵnov(n,52).onChange(e.target.value)&&u);"input"===l&&(u=!1!==t.ɵnov(n,52).onChange(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,52).onTouched()&&u);"ngModelChange"===l&&(u=!1!==(o.verifyAmount2=e)&&u);return u},null,null)),t.ɵdid(51,16384,null,0,C.DefaultValueAccessor,[t.Renderer2,t.ElementRef,[2,C.COMPOSITION_BUFFER_MODE]],null,null),t.ɵdid(52,16384,null,0,C.ɵbc,[t.Renderer2,t.ElementRef],null,null),t.ɵdid(53,16384,null,0,C.RequiredValidator,[],{required:[0,"required"]},null),t.ɵprd(1024,null,C.NG_VALIDATORS,function(n){return[n]},[C.RequiredValidator]),t.ɵprd(1024,null,C.NG_VALUE_ACCESSOR,function(n,l){return[n,l]},[C.DefaultValueAccessor,C.ɵbc]),t.ɵdid(56,671744,null,0,C.NgModel,[[2,C.ControlContainer],[2,C.NG_VALIDATORS],[8,null],[2,C.NG_VALUE_ACCESSOR]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,C.NgControl,null,[C.NgModel]),t.ɵdid(58,16384,null,0,C.NgControlStatus,[C.NgControl],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(61,0,null,null,8,"button",[["class","btn btn-outline-primary btn-submit"],["type","submit"]],[[8,"disabled",0]],null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(63,0,null,null,1,"i",[["class","fa fa-spinner fa-spin"]],[[8,"title",0]],null,null,null,null)),t.ɵppd(64,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(66,0,null,null,2,"span",[],null,null,null,null,null)),(n()(),t.ɵted(67,null,["",""])),t.ɵppd(68,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,0,["\n "]))],function(n,l){var e=l.component;n(l,1,0,"warning",t.ɵinlineInterpolate(1,"",t.ɵunv(l,1,1,n(l,2,0,t.ɵnov(l.parent.parent.parent.parent,0),"verifyBankAccount")),"")),n(l,13,0,e.verifyBankPromise);n(l,30,0,"");n(l,33,0,"Amount1",e.verifyAmount1);n(l,53,0,"");n(l,56,0,"Amount2",e.verifyAmount2)},function(n,l){n(l,5,0,t.ɵunv(l,5,0,n(l,6,0,t.ɵnov(l.parent.parent.parent.parent,0),"verifyBankAccountDesc")),t.ɵunv(l,5,1,n(l,7,0,t.ɵnov(l.parent.parent.parent.parent,0),"verifyBankAccountFailureWarning"))),n(l,9,0,t.ɵnov(l,12).ngClassUntouched,t.ɵnov(l,12).ngClassTouched,t.ɵnov(l,12).ngClassPristine,t.ɵnov(l,12).ngClassDirty,t.ɵnov(l,12).ngClassValid,t.ɵnov(l,12).ngClassInvalid,t.ɵnov(l,12).ngClassPending),n(l,16,0,t.ɵunv(l,16,0,n(l,17,0,t.ɵnov(l.parent.parent.parent.parent,0),"amount","1"))),n(l,27,0,t.ɵnov(l,30).required?"":null,t.ɵnov(l,35).ngClassUntouched,t.ɵnov(l,35).ngClassTouched,t.ɵnov(l,35).ngClassPristine,t.ɵnov(l,35).ngClassDirty,t.ɵnov(l,35).ngClassValid,t.ɵnov(l,35).ngClassInvalid,t.ɵnov(l,35).ngClassPending),n(l,39,0,t.ɵunv(l,39,0,n(l,40,0,t.ɵnov(l.parent.parent.parent.parent,0),"amount","2"))),n(l,50,0,t.ɵnov(l,53).required?"":null,t.ɵnov(l,58).ngClassUntouched,t.ɵnov(l,58).ngClassTouched,t.ɵnov(l,58).ngClassPristine,t.ɵnov(l,58).ngClassDirty,t.ɵnov(l,58).ngClassValid,t.ɵnov(l,58).ngClassInvalid,t.ɵnov(l,58).ngClassPending),n(l,61,0,t.ɵnov(l,9).loading),n(l,63,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,63,0,n(l,64,0,t.ɵnov(l.parent.parent.parent.parent,0),"loading")),"")),n(l,67,0,t.ɵunv(l,67,0,n(l,68,0,t.ɵnov(l.parent.parent.parent.parent,0),"verifyBankAccount")))})}function Q(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,11,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,X)),t.ɵdid(3,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(5,0,null,null,5,"p",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(7,0,null,null,2,"i",[["class","fa fa-fw"]],null,null,null,null,null)),t.ɵdid(8,278528,null,0,s.NgClass,[t.IterableDiffers,t.KeyValueDiffers,t.ElementRef,t.Renderer2],{klass:[0,"klass"],ngClass:[1,"ngClass"]},null),t.ɵpod(9,{"fa-credit-card":0,"fa-university":1,"fa-paypal text-primary":2}),(n()(),t.ɵted(10,null,["\n ","\n "])),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){var e=l.component;n(l,3,0,e.paymentSource.type===e.paymentMethodType.BankAccount&&e.paymentSource.needsVerification);n(l,8,0,"fa fa-fw",n(l,9,0,e.paymentSource.type===e.paymentMethodType.Card,e.paymentSource.type===e.paymentMethodType.BankAccount,e.paymentSource.type===e.paymentMethodType.PayPal))},function(n,l){n(l,10,0,l.component.paymentSource.description)})}function nn(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,2,"button",[["class","btn btn-outline-secondary"],["type","button"]],null,[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.changePayment()&&t);return t},null,null)),(n()(),t.ɵted(1,null,["\n ","\n "])),t.ɵppd(2,1)],null,function(n,l){var e=l.component;n(l,1,0,t.ɵunv(l,1,0,n(l,2,0,t.ɵnov(l.parent.parent.parent,0),e.paymentSource?"changePaymentMethod":"addPaymentMethod")))})}function ln(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,2,"app-adjust-payment",[],null,[[null,"onAdjusted"],[null,"onCanceled"]],function(n,l,e){var t=!0,u=n.component;"onAdjusted"===l&&(t=!1!==u.closePayment(!0)&&t);"onCanceled"===l&&(t=!1!==u.closePayment(!1)&&t);return t},b.View_AdjustPaymentComponent_0,b.RenderType_AdjustPaymentComponent)),t.ɵdid(1,49152,null,0,S.AdjustPaymentComponent,[p.ApiService,i.I18nService,f.Angulartics2,v.ToasterService],{currentType:[0,"currentType"],organizationId:[1,"organizationId"]},{onAdjusted:"onAdjusted",onCanceled:"onCanceled"}),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){var e=l.component;n(l,1,0,null!=e.paymentSource?e.paymentSource.type:null,e.organizationId)},null)}function en(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,2,"p",[],null,null,null,null,null)),(n()(),t.ɵted(1,null,["",""])),t.ɵppd(2,1)],null,function(n,l){n(l,1,0,t.ɵunv(l,1,0,n(l,2,0,t.ɵnov(l.parent.parent.parent,0),"noCharges")))})}function tn(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,28,"tr",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,8,"td",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(4,0,null,null,5,"a",[["appStopClick",""],["href","#"]],[[8,"title",0]],[[null,"click"]],function(n,l,e){var u=!0,o=n.component;"click"===l&&(u=!1!==t.ɵnov(n,5).onClick(e)&&u);"click"===l&&(u=!1!==o.viewInvoice(n.context.$implicit)&&u);return u},null,null)),t.ɵdid(5,16384,null,0,w.StopClickDirective,[],null,null),t.ɵppd(6,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(8,0,null,null,0,"i",[["class","fa fa-file-pdf-o"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(12,0,null,null,2,"td",[],null,null,null,null,null)),(n()(),t.ɵted(13,null,["",""])),t.ɵppd(14,2),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(16,0,null,null,1,"td",[],null,null,null,null,null)),(n()(),t.ɵted(17,null,["",""])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(19,0,null,null,1,"td",[["class","text-capitalize"]],null,null,null,null,null)),(n()(),t.ɵted(20,null,["",""])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(22,0,null,null,5,"td",[],[[8,"title",0]],null,null,null,null)),t.ɵdid(23,278528,null,0,s.NgClass,[t.IterableDiffers,t.KeyValueDiffers,t.ElementRef,t.Renderer2],{ngClass:[0,"ngClass"]},null),t.ɵpod(24,{"text-strike":0}),t.ɵppd(25,1),(n()(),t.ɵted(26,null,["",""])),t.ɵppd(27,2),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){n(l,23,0,n(l,24,0,l.context.$implicit.refunded))},function(n,l){n(l,4,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,4,0,n(l,6,0,t.ɵnov(l.parent.parent.parent.parent,0),"invoice")),"")),n(l,13,0,t.ɵunv(l,13,0,n(l,14,0,t.ɵnov(l.parent.parent.parent.parent,1),l.context.$implicit.createdDate,"mediumDate"))),n(l,17,0,l.context.$implicit.paymentSource?l.context.$implicit.paymentSource.description:"-"),n(l,20,0,l.context.$implicit.status),n(l,22,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,22,0,n(l,25,0,t.ɵnov(l.parent.parent.parent.parent,0),l.context.$implicit.refunded?"refunded":"")),"")),n(l,26,0,t.ɵunv(l,26,0,n(l,27,0,t.ɵnov(l.parent.parent.parent.parent,2),l.context.$implicit.amount,"$")))})}function un(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,7,"table",[["class","table mb-2"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,4,"tbody",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,tn)),t.ɵdid(5,802816,null,0,s.NgForOf,[t.ViewContainerRef,t.TemplateRef,t.IterableDiffers],{ngForOf:[0,"ngForOf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){n(l,5,0,l.component.charges)},null)}function on(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,75,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,11,"div",[["class","d-flex"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(4,0,null,null,2,"button",[["class","btn btn-outline-secondary"],["type","button"]],null,[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.changePlan()&&t);return t},null,null)),(n()(),t.ɵted(5,null,["\n ","\n "])),t.ɵppd(6,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,j)),t.ɵdid(9,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,B)),t.ɵdid(12,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(15,0,null,null,2,"h2",[["class","spaced-header"]],null,null,null,null,null)),(n()(),t.ɵted(16,null,["",""])),t.ɵppd(17,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(19,0,null,null,2,"p",[],null,null,null,null,null)),(n()(),t.ɵted(20,null,["",""])),t.ɵppd(21,2),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,$)),t.ɵdid(24,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(26,0,null,null,2,"h2",[["class","spaced-header"]],null,null,null,null,null)),(n()(),t.ɵted(27,null,["",""])),t.ɵppd(28,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(30,0,null,null,2,"p",[],null,null,null,null,null)),(n()(),t.ɵted(31,null,["",""])),t.ɵppd(32,3),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(34,0,null,null,7,"div",[["class","progress"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(36,0,null,null,4,"div",[["aria-valuemax","100"],["aria-valuemin","0"],["class","progress-bar bg-success"],["role","progressbar"]],[[1,"aria-valuenow",0]],null,null,null,null)),t.ɵdid(37,278528,null,0,s.NgStyle,[t.KeyValueDiffers,t.ElementRef,t.Renderer2],{ngStyle:[0,"ngStyle"]},null),t.ɵpod(38,{width:0}),(n()(),t.ɵted(39,null,["",""])),t.ɵppd(40,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,Z)),t.ɵdid(44,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(46,0,null,null,2,"h2",[["class","spaced-header"]],null,null,null,null,null)),(n()(),t.ɵted(47,null,["",""])),t.ɵppd(48,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,J)),t.ɵdid(51,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,Q)),t.ɵdid(54,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,nn)),t.ɵdid(57,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,ln)),t.ɵdid(60,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(62,0,null,null,2,"h2",[["class","spaced-header"]],null,null,null,null,null)),(n()(),t.ɵted(63,null,["",""])),t.ɵppd(64,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,en)),t.ɵdid(67,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,un)),t.ɵdid(70,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(72,0,null,null,2,"small",[["class","text-muted"]],null,null,null,null,null)),(n()(),t.ɵted(73,null,["* ",""])),t.ɵppd(74,2),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){var e=l.component;n(l,9,0,e.canDownloadLicense),n(l,12,0,e.subscription&&!e.subscription.cancelled&&!e.subscriptionMarkedForCancel),n(l,24,0,e.subscription&&e.canAdjustSeats),n(l,37,0,n(l,38,0,e.storageProgressWidth+"%")),n(l,44,0,e.subscription&&!e.subscription.cancelled&&!e.subscriptionMarkedForCancel&&e.paymentSource),n(l,51,0,!e.paymentSource),n(l,54,0,e.paymentSource),n(l,57,0,!e.showAdjustPayment),n(l,60,0,e.showAdjustPayment),n(l,67,0,!e.charges||!e.charges.length),n(l,70,0,e.charges&&e.charges.length)},function(n,l){var e=l.component;n(l,5,0,t.ɵunv(l,5,0,n(l,6,0,t.ɵnov(l.parent.parent,0),"changeBillingPlan"))),n(l,16,0,t.ɵunv(l,16,0,n(l,17,0,t.ɵnov(l.parent.parent,0),"userSeats"))),n(l,20,0,t.ɵunv(l,20,0,n(l,21,0,t.ɵnov(l.parent.parent,0),"subscriptionUserSeats",e.billing.seats))),n(l,27,0,t.ɵunv(l,27,0,n(l,28,0,t.ɵnov(l.parent.parent,0),"storage"))),n(l,31,0,t.ɵunv(l,31,0,n(l,32,0,t.ɵnov(l.parent.parent,0),"subscriptionStorage",e.billing.maxStorageGb||0,e.billing.storageName||"0 MB"))),n(l,36,0,e.storagePercentage),n(l,39,0,t.ɵunv(l,39,0,n(l,40,0,t.ɵnov(l.parent.parent,3),e.storagePercentage/100))),n(l,47,0,t.ɵunv(l,47,0,n(l,48,0,t.ɵnov(l.parent.parent,0),"paymentMethod"))),n(l,63,0,t.ɵunv(l,63,0,n(l,64,0,t.ɵnov(l.parent.parent,0),"charges"))),n(l,73,0,t.ɵunv(l,73,0,n(l,74,0,t.ɵnov(l.parent.parent,0),"chargesStatement","BITWARDEN")))})}function rn(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,19,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,k)),t.ɵdid(3,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,V)),t.ɵdid(6,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,x)),t.ɵdid(9,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,G)),t.ɵdid(12,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,z)),t.ɵdid(15,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,on)),t.ɵdid(18,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){var e=l.component;n(l,3,0,e.subscription&&e.subscription.cancelled),n(l,6,0,e.subscriptionMarkedForCancel),n(l,9,0,e.selfHosted),n(l,12,0,!e.selfHosted),n(l,15,0,e.selfHosted),n(l,18,0,!e.selfHosted)},null)}function an(n){return t.ɵvid(0,[t.ɵpid(0,R.I18nPipe,[i.I18nService]),t.ɵpid(0,s.DatePipe,[t.LOCALE_ID]),t.ɵpid(0,s.CurrencyPipe,[t.LOCALE_ID]),t.ɵpid(0,s.PercentPipe,[t.LOCALE_ID]),(n()(),t.ɵeld(4,0,null,null,11,"div",[["class","page-header"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(6,0,null,null,8,"h1",[],null,null,null,null,null)),(n()(),t.ɵted(7,null,["\n ","\n "])),t.ɵppd(8,1),(n()(),t.ɵeld(9,0,null,null,4,"small",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,N)),t.ɵdid(12,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,null,null,1,null,T)),t.ɵdid(18,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,null,null,1,null,rn)),t.ɵdid(21,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){var e=l.component;n(l,12,0,e.firstLoaded&&e.loading),n(l,18,0,!e.firstLoaded&&e.loading),n(l,21,0,e.billing)},function(n,l){n(l,7,0,t.ɵunv(l,7,0,n(l,8,0,t.ɵnov(l,0),"billingAndLicensing")))})}function sn(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"app-org-billing",[],null,null,null,an,O)),t.ɵdid(1,114688,null,0,_.OrganizationBillingComponent,[I.TokenService,p.ApiService,A.PlatformUtilsService,i.I18nService,f.Angulartics2,v.ToasterService,E.ActivatedRoute],null,null)],function(n,l){n(l,1,0)},null)}l.RenderType_OrganizationBillingComponent=O,l.View_OrganizationBillingComponent_0=an,l.View_OrganizationBillingComponent_Host_0=sn;var dn=t.ɵccf("app-org-billing",_.OrganizationBillingComponent,sn,{},{},[]);l.OrganizationBillingComponentNgFactory=dn},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=e(0),u=e(40),o=e(37),i=e(2),r=e(60),a=e(5),s=e(7),d=e(239),c=e(4),p=e(35),f=e(27),v=e(10),h=t.ɵcrt({encapsulation:2,styles:[],data:{}});function g(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,2,"p",[],null,null,null,null,null)),(n()(),t.ɵted(1,null,["",""])),t.ɵppd(2,1)],null,function(n,l){n(l,1,0,t.ɵunv(l,1,0,n(l,2,0,t.ɵnov(l.parent,0),"twoStepLoginDesc")))})}function m(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,2,"p",[],null,null,null,null,null)),(n()(),t.ɵted(1,null,["",""])),t.ɵppd(2,1)],null,function(n,l){n(l,1,0,t.ɵunv(l,1,0,n(l,2,0,t.ɵnov(l.parent,0),"twoStepLoginOrganizationDesc")))})}function y(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,10,"app-callout",[["type","warning"]],null,null,null,u.View_CalloutComponent_0,u.RenderType_CalloutComponent)),t.ɵdid(1,114688,null,0,o.CalloutComponent,[i.I18nService],{type:[0,"type"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵeld(3,0,null,0,2,"p",[],null,null,null,null,null)),(n()(),t.ɵted(4,null,["",""])),t.ɵppd(5,1),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵeld(7,0,null,0,2,"button",[["class","btn btn-outline-secondary"],["type","button"]],null,[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.recoveryCode()&&t);return t},null,null)),(n()(),t.ɵted(8,null,["",""])),t.ɵppd(9,1),(n()(),t.ɵted(-1,0,["\n"]))],function(n,l){n(l,1,0,"warning")},function(n,l){n(l,4,0,t.ɵunv(l,4,0,n(l,5,0,t.ɵnov(l.parent,0),"twoStepLoginRecoveryWarning"))),n(l,8,0,t.ɵunv(l,8,0,n(l,9,0,t.ɵnov(l.parent,0),"viewRecoveryCode")))})}function C(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,4,"small",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,1,"i",[["class","fa fa-spinner fa-spin fa-fw text-muted"]],[[8,"title",0]],null,null,null,null)),t.ɵppd(3,1),(n()(),t.ɵted(-1,null,["\n "]))],null,function(n,l){n(l,2,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,2,0,n(l,3,0,t.ɵnov(l.parent,0),"loading")),""))})}function b(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"i",[["class","fa fa-check text-success fa-fw"]],[[8,"title",0]],null,null,null,null)),t.ɵppd(1,1)],null,function(n,l){n(l,0,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,0,0,n(l,1,0,t.ɵnov(l.parent.parent,0),"enabled")),""))})}function S(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,3,"a",[["appStopClick",""],["class","badge badge-primary"],["href","#"]],null,[[null,"click"]],function(n,l,e){var u=!0,o=n.component;"click"===l&&(u=!1!==t.ɵnov(n,1).onClick(e)&&u);"click"===l&&(u=!1!==o.premiumRequired()&&u);return u},null,null)),t.ɵdid(1,16384,null,0,r.StopClickDirective,[],null,null),(n()(),t.ɵted(2,null,["\n ","\n "])),t.ɵppd(3,1)],null,function(n,l){n(l,2,0,t.ɵunv(l,2,0,n(l,3,0,t.ɵnov(l.parent.parent,0),"premium")))})}function w(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,25,"li",[["class","list-group-item d-flex align-items-center"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,3,"div",[["class","logo-2fa d-flex justify-content-center"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(4,0,null,null,0,"img",[["alt",""]],[[8,"src",4]],null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(7,0,null,null,10,"div",[["class","mx-4"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(9,0,null,null,7,"h3",[["class","mb-0"]],null,null,null,null,null)),(n()(),t.ɵted(10,null,["\n ","\n "])),(n()(),t.ɵand(16777216,null,null,1,null,b)),t.ɵdid(12,16384,null,0,a.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,S)),t.ɵdid(15,16384,null,0,a.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(17,null,["\n ","\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(19,0,null,null,5,"div",[["class","ml-auto"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(21,0,null,null,2,"button",[["class","btn btn-outline-secondary btn-sm"],["type","button"]],[[8,"disabled",0]],[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.manage(n.context.$implicit.type)&&t);return t},null,null)),(n()(),t.ɵted(22,null,["\n ","\n "])),t.ɵppd(23,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){var e=l.component;n(l,12,0,l.context.$implicit.enabled),n(l,15,0,!e.premium&&l.context.$implicit.premium)},function(n,l){var e=l.component;n(l,4,0,"images/two-factor/"+l.context.$implicit.type+".png"),n(l,10,0,l.context.$implicit.name),n(l,17,0,l.context.$implicit.description),n(l,21,0,!e.premium&&l.context.$implicit.premium),n(l,22,0,t.ɵunv(l,22,0,n(l,23,0,t.ɵnov(l.parent,0),"manage")))})}function R(n){return t.ɵvid(0,[(n()(),t.ɵand(0,null,null,0))],null,null)}function _(n){return t.ɵvid(0,[(n()(),t.ɵand(0,null,null,0))],null,null)}function I(n){return t.ɵvid(0,[(n()(),t.ɵand(0,null,null,0))],null,null)}function A(n){return t.ɵvid(0,[(n()(),t.ɵand(0,null,null,0))],null,null)}function E(n){return t.ɵvid(0,[(n()(),t.ɵand(0,null,null,0))],null,null)}function O(n){return t.ɵvid(0,[(n()(),t.ɵand(0,null,null,0))],null,null)}function N(n){return t.ɵvid(0,[t.ɵpid(0,s.I18nPipe,[i.I18nService]),t.ɵqud(402653184,1,{recoveryModalRef:0}),t.ɵqud(402653184,2,{authenticatorModalRef:0}),t.ɵqud(402653184,3,{yubikeyModalRef:0}),t.ɵqud(402653184,4,{u2fModalRef:0}),t.ɵqud(402653184,5,{duoModalRef:0}),t.ɵqud(402653184,6,{emailModalRef:0}),(n()(),t.ɵeld(7,0,null,null,5,"div",[["class","page-header"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(9,0,null,null,2,"h1",[],null,null,null,null,null)),(n()(),t.ɵted(10,null,["",""])),t.ɵppd(11,1),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,null,null,1,null,g)),t.ɵdid(15,16384,null,0,a.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,null,null,1,null,m)),t.ɵdid(18,16384,null,0,a.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,null,null,1,null,y)),t.ɵdid(21,16384,null,0,a.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵeld(23,0,null,null,7,"h2",[],null,null,null,null,null)),t.ɵdid(24,278528,null,0,a.NgClass,[t.IterableDiffers,t.KeyValueDiffers,t.ElementRef,t.Renderer2],{ngClass:[0,"ngClass"]},null),t.ɵpod(25,{"mt-5":0}),(n()(),t.ɵted(26,null,["\n ","\n "])),t.ɵppd(27,1),(n()(),t.ɵand(16777216,null,null,1,null,C)),t.ɵdid(29,16384,null,0,a.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵeld(32,0,null,null,4,"ul",[["class","list-group list-group-2fa"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,w)),t.ɵdid(35,802816,null,0,a.NgForOf,[t.ViewContainerRef,t.TemplateRef,t.IterableDiffers],{ngForOf:[0,"ngForOf"]},null),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n\n"])),(n()(),t.ɵand(16777216,[[2,3],["authenticatorTemplate",2]],null,0,null,R)),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,[[1,3],["recoveryTemplate",2]],null,0,null,_)),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,[[5,3],["duoTemplate",2]],null,0,null,I)),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,[[6,3],["emailTemplate",2]],null,0,null,A)),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,[[3,3],["yubikeyTemplate",2]],null,0,null,E)),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,[[4,3],["u2fTemplate",2]],null,0,null,O)),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){var e=l.component;n(l,15,0,!e.organizationId),n(l,18,0,e.organizationId),n(l,21,0,!e.organizationId),n(l,24,0,n(l,25,0,!e.organizationId)),n(l,29,0,e.loading),n(l,35,0,e.providers)},function(n,l){n(l,10,0,t.ɵunv(l,10,0,n(l,11,0,t.ɵnov(l,0),"twoStepLogin"))),n(l,26,0,t.ɵunv(l,26,0,n(l,27,0,t.ɵnov(l,0),"providers")))})}function T(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"app-two-factor-setup",[],null,null,null,N,h)),t.ɵdid(1,114688,null,0,d.TwoFactorSetupComponent,[c.ApiService,p.TokenService,t.ComponentFactoryResolver,f.MessagingService,v.ActivatedRoute],null,null)],function(n,l){n(l,1,0)},null)}l.RenderType_TwoFactorSetupComponent=h,l.View_TwoFactorSetupComponent_0=N,l.View_TwoFactorSetupComponent_Host_0=T;var k=t.ɵccf("app-two-factor-setup",d.TwoFactorSetupComponent,T,{},{},[]);l.TwoFactorSetupComponentNgFactory=k},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(){}}();l.OrganizationUpdateRequest=t},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=e(0),u=e(13),o=e(18),i=e(17),r=e(130),a=e(116),s=e(42),d=e(7),c=e(2),p=e(5),f=e(240),v=e(4),h=e(3),g=e(9),m=e(10),y=e(66),C=t.ɵcrt({encapsulation:2,styles:[],data:{}});function b(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,4,"div",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,1,"i",[["class","fa fa-spinner fa-spin text-muted"]],[[8,"title",0]],null,null,null,null)),t.ɵppd(3,1),(n()(),t.ɵted(-1,null,["\n"]))],null,function(n,l){n(l,2,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,2,0,n(l,3,0,t.ɵnov(l.parent,0),"loading")),""))})}function S(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,[["form",1]],null,69,"form",[["ngNativeValidate",""]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngSubmit"],[null,"submit"],[null,"reset"]],function(n,l,e){var u=!0,o=n.component;"submit"===l&&(u=!1!==t.ɵnov(n,1).onSubmit(e)&&u);"reset"===l&&(u=!1!==t.ɵnov(n,1).onReset()&&u);"ngSubmit"===l&&(u=!1!==o.submit()&&u);return u},null,null)),t.ɵdid(1,4210688,null,0,u.NgForm,[[8,null],[8,null]],null,{ngSubmit:"ngSubmit"}),t.ɵprd(2048,null,u.ControlContainer,null,[u.NgForm]),t.ɵdid(3,16384,null,0,u.NgControlStatusGroup,[u.ControlContainer],null,null),t.ɵdid(4,540672,null,0,o.ApiActionDirective,[t.ElementRef,i.ValidationService],{appApiAction:[0,"appApiAction"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(6,0,null,null,52,"div",[["class","row"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(8,0,null,null,43,"div",[["class","col-6"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(10,0,null,null,12,"div",[["class","form-group"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(12,0,null,null,2,"label",[["for","name"]],null,null,null,null,null)),(n()(),t.ɵted(13,null,["",""])),t.ɵppd(14,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(16,0,null,null,5,"input",[["class","form-control"],["id","name"],["name","Name"],["type","text"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(n,l,e){var u=!0,o=n.component;"input"===l&&(u=!1!==t.ɵnov(n,17)._handleInput(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,17).onTouched()&&u);"compositionstart"===l&&(u=!1!==t.ɵnov(n,17)._compositionStart()&&u);"compositionend"===l&&(u=!1!==t.ɵnov(n,17)._compositionEnd(e.target.value)&&u);"ngModelChange"===l&&(u=!1!==(o.org.name=e)&&u);return u},null,null)),t.ɵdid(17,16384,null,0,u.DefaultValueAccessor,[t.Renderer2,t.ElementRef,[2,u.COMPOSITION_BUFFER_MODE]],null,null),t.ɵprd(1024,null,u.NG_VALUE_ACCESSOR,function(n){return[n]},[u.DefaultValueAccessor]),t.ɵdid(19,671744,null,0,u.NgModel,[[2,u.ControlContainer],[8,null],[8,null],[2,u.NG_VALUE_ACCESSOR]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,u.NgControl,null,[u.NgModel]),t.ɵdid(21,16384,null,0,u.NgControlStatus,[u.NgControl],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(24,0,null,null,12,"div",[["class","form-group"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(26,0,null,null,2,"label",[["for","billingEmail"]],null,null,null,null,null)),(n()(),t.ɵted(27,null,["",""])),t.ɵppd(28,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(30,0,null,null,5,"input",[["class","form-control"],["id","billingEmail"],["name","BillingEmail"],["type","text"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(n,l,e){var u=!0,o=n.component;"input"===l&&(u=!1!==t.ɵnov(n,31)._handleInput(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,31).onTouched()&&u);"compositionstart"===l&&(u=!1!==t.ɵnov(n,31)._compositionStart()&&u);"compositionend"===l&&(u=!1!==t.ɵnov(n,31)._compositionEnd(e.target.value)&&u);"ngModelChange"===l&&(u=!1!==(o.org.billingEmail=e)&&u);return u},null,null)),t.ɵdid(31,16384,null,0,u.DefaultValueAccessor,[t.Renderer2,t.ElementRef,[2,u.COMPOSITION_BUFFER_MODE]],null,null),t.ɵprd(1024,null,u.NG_VALUE_ACCESSOR,function(n){return[n]},[u.DefaultValueAccessor]),t.ɵdid(33,671744,null,0,u.NgModel,[[2,u.ControlContainer],[8,null],[8,null],[2,u.NG_VALUE_ACCESSOR]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,u.NgControl,null,[u.NgModel]),t.ɵdid(35,16384,null,0,u.NgControlStatus,[u.NgControl],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(38,0,null,null,12,"div",[["class","form-group"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(40,0,null,null,2,"label",[["for","businessName"]],null,null,null,null,null)),(n()(),t.ɵted(41,null,["",""])),t.ɵppd(42,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(44,0,null,null,5,"input",[["class","form-control"],["id","businessName"],["name","BusinessName"],["type","text"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(n,l,e){var u=!0,o=n.component;"input"===l&&(u=!1!==t.ɵnov(n,45)._handleInput(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,45).onTouched()&&u);"compositionstart"===l&&(u=!1!==t.ɵnov(n,45)._compositionStart()&&u);"compositionend"===l&&(u=!1!==t.ɵnov(n,45)._compositionEnd(e.target.value)&&u);"ngModelChange"===l&&(u=!1!==(o.org.businessName=e)&&u);return u},null,null)),t.ɵdid(45,16384,null,0,u.DefaultValueAccessor,[t.Renderer2,t.ElementRef,[2,u.COMPOSITION_BUFFER_MODE]],null,null),t.ɵprd(1024,null,u.NG_VALUE_ACCESSOR,function(n){return[n]},[u.DefaultValueAccessor]),t.ɵdid(47,671744,null,0,u.NgModel,[[2,u.ControlContainer],[8,null],[8,null],[2,u.NG_VALUE_ACCESSOR]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,u.NgControl,null,[u.NgModel]),t.ɵdid(49,16384,null,0,u.NgControlStatus,[u.NgControl],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(53,0,null,null,4,"div",[["class","col-6"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(55,0,null,null,1,"app-avatar",[["dynamic","true"],["fontSize","35"],["height","75"],["width","75"]],null,null,null,r.View_AvatarComponent_0,r.RenderType_AvatarComponent)),t.ɵdid(56,638976,null,0,a.AvatarComponent,[s.DomSanitizer],{data:[0,"data"],width:[1,"width"],height:[2,"height"],fontSize:[3,"fontSize"],dynamic:[4,"dynamic"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(60,0,null,null,8,"button",[["class","btn btn-primary btn-submit"],["type","submit"]],[[8,"disabled",0]],null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(62,0,null,null,1,"i",[["class","fa fa-spinner fa-spin"]],[[8,"title",0]],null,null,null,null)),t.ɵppd(63,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(65,0,null,null,2,"span",[],null,null,null,null,null)),(n()(),t.ɵted(66,null,["",""])),t.ɵppd(67,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){var e=l.component;n(l,4,0,e.formPromise);n(l,19,0,"Name",e.org.name);n(l,33,0,"BillingEmail",e.org.billingEmail);n(l,47,0,"BusinessName",e.org.businessName);n(l,56,0,t.ɵinlineInterpolate(1,"",e.org.name,""),"75","75","35","true")},function(n,l){n(l,0,0,t.ɵnov(l,3).ngClassUntouched,t.ɵnov(l,3).ngClassTouched,t.ɵnov(l,3).ngClassPristine,t.ɵnov(l,3).ngClassDirty,t.ɵnov(l,3).ngClassValid,t.ɵnov(l,3).ngClassInvalid,t.ɵnov(l,3).ngClassPending),n(l,13,0,t.ɵunv(l,13,0,n(l,14,0,t.ɵnov(l.parent,0),"organizationName"))),n(l,16,0,t.ɵnov(l,21).ngClassUntouched,t.ɵnov(l,21).ngClassTouched,t.ɵnov(l,21).ngClassPristine,t.ɵnov(l,21).ngClassDirty,t.ɵnov(l,21).ngClassValid,t.ɵnov(l,21).ngClassInvalid,t.ɵnov(l,21).ngClassPending),n(l,27,0,t.ɵunv(l,27,0,n(l,28,0,t.ɵnov(l.parent,0),"billingEmail"))),n(l,30,0,t.ɵnov(l,35).ngClassUntouched,t.ɵnov(l,35).ngClassTouched,t.ɵnov(l,35).ngClassPristine,t.ɵnov(l,35).ngClassDirty,t.ɵnov(l,35).ngClassValid,t.ɵnov(l,35).ngClassInvalid,t.ɵnov(l,35).ngClassPending),n(l,41,0,t.ɵunv(l,41,0,n(l,42,0,t.ɵnov(l.parent,0),"businessName"))),n(l,44,0,t.ɵnov(l,49).ngClassUntouched,t.ɵnov(l,49).ngClassTouched,t.ɵnov(l,49).ngClassPristine,t.ɵnov(l,49).ngClassDirty,t.ɵnov(l,49).ngClassValid,t.ɵnov(l,49).ngClassInvalid,t.ɵnov(l,49).ngClassPending),n(l,60,0,t.ɵnov(l,0).loading),n(l,62,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,62,0,n(l,63,0,t.ɵnov(l.parent,0),"loading")),"")),n(l,66,0,t.ɵunv(l,66,0,n(l,67,0,t.ɵnov(l.parent,0),"save")))})}function w(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,16,"div",[["class","mb-3"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,1,"div",[],null,null,null,null,null)),(n()(),t.ɵted(3,null,["",""])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(5,0,null,null,1,"div",[],null,null,null,null,null)),(n()(),t.ɵted(6,null,["",""])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(8,0,null,null,1,"div",[],null,null,null,null,null)),(n()(),t.ɵted(9,null,["",""])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(11,0,null,null,1,"div",[],null,null,null,null,null)),(n()(),t.ɵted(12,null,["",""])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(14,0,null,null,1,"div",[],null,null,null,null,null)),(n()(),t.ɵted(15,null,["",""])),(n()(),t.ɵted(-1,null,["\n"]))],null,function(n,l){var e=l.component;n(l,3,0,e.org.businessAddress1),n(l,6,0,e.org.businessAddress2),n(l,9,0,e.org.businessAddress3),n(l,12,0,e.org.businessCountry),n(l,15,0,e.org.businessTaxNumber)})}function R(n){return t.ɵvid(0,[(n()(),t.ɵand(0,null,null,0))],null,null)}function _(n){return t.ɵvid(0,[t.ɵpid(0,d.I18nPipe,[c.I18nService]),t.ɵqud(402653184,1,{deleteModalRef:0}),(n()(),t.ɵeld(2,0,null,null,5,"div",[["class","page-header"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(4,0,null,null,2,"h1",[],null,null,null,null,null)),(n()(),t.ɵted(5,null,["",""])),t.ɵppd(6,1),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,null,null,1,null,b)),t.ɵdid(10,16384,null,0,p.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,null,null,1,null,S)),t.ɵdid(13,16384,null,0,p.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵeld(15,0,null,null,5,"div",[["class","secondary-header border-0 mb-0"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(17,0,null,null,2,"h1",[],null,null,null,null,null)),(n()(),t.ɵted(18,null,["",""])),t.ɵppd(19,1),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,null,null,1,null,w)),t.ɵdid(23,16384,null,0,p.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵeld(25,0,null,null,2,"p",[],null,null,null,null,null)),(n()(),t.ɵted(26,null,["",""])),t.ɵppd(27,1),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵeld(29,0,null,null,2,"a",[["class","btn btn-outline-secondary"],["href","https://bitwarden.com/contact/"],["rel","noopener"],["target","_blank"]],null,null,null,null,null)),(n()(),t.ɵted(30,null,["\n ","\n"])),t.ɵppd(31,1),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵeld(33,0,null,null,5,"div",[["class","secondary-header text-danger border-0 mb-0"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(35,0,null,null,2,"h1",[],null,null,null,null,null)),(n()(),t.ɵted(36,null,["",""])),t.ɵppd(37,1),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵeld(40,0,null,null,12,"div",[["class","card border-danger"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(42,0,null,null,9,"div",[["class","card-body"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(44,0,null,null,2,"p",[],null,null,null,null,null)),(n()(),t.ɵted(45,null,["",""])),t.ɵppd(46,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(48,0,null,null,2,"button",[["class","btn btn-outline-danger"],["type","button"]],null,[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.deleteOrganization()&&t);return t},null,null)),(n()(),t.ɵted(49,null,["",""])),t.ɵppd(50,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,[[1,3],["deleteOrganizationTemplate",2]],null,0,null,R)),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){var e=l.component;n(l,10,0,e.loading),n(l,13,0,e.org&&!e.loading),n(l,23,0,e.org&&(e.org.businessAddress1||e.org.businessTaxNumber))},function(n,l){n(l,5,0,t.ɵunv(l,5,0,n(l,6,0,t.ɵnov(l,0),"myOrganization"))),n(l,18,0,t.ɵunv(l,18,0,n(l,19,0,t.ɵnov(l,0),"taxInformation"))),n(l,26,0,t.ɵunv(l,26,0,n(l,27,0,t.ɵnov(l,0),"taxInformationDesc"))),n(l,30,0,t.ɵunv(l,30,0,n(l,31,0,t.ɵnov(l,0),"contactSupport"))),n(l,36,0,t.ɵunv(l,36,0,n(l,37,0,t.ɵnov(l,0),"dangerZone"))),n(l,45,0,t.ɵunv(l,45,0,n(l,46,0,t.ɵnov(l,0),"dangerZoneDesc"))),n(l,49,0,t.ɵunv(l,49,0,n(l,50,0,t.ɵnov(l,0),"deleteOrganization")))})}function I(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"app-org-account",[],null,null,null,_,C)),t.ɵdid(1,114688,null,0,f.AccountComponent,[t.ComponentFactoryResolver,v.ApiService,c.I18nService,h.Angulartics2,g.ToasterService,m.ActivatedRoute,y.SyncService],null,null)],function(n,l){n(l,1,0)},null)}l.RenderType_AccountComponent=C,l.View_AccountComponent_0=_,l.View_AccountComponent_Host_0=I;var A=t.ɵccf("app-org-account",f.AccountComponent,I,{},{},[]);l.AccountComponentNgFactory=A},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=e(0),u=e(10),o=e(5),i=e(7),r=e(2),a=e(241),s=e(21),d=t.ɵcrt({encapsulation:2,styles:[],data:{}});function c(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,6,"a",[["class","list-group-item"],["routerLink","two-factor"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(n,l,e){var u=!0;"click"===l&&(u=!1!==t.ɵnov(n,1).onClick(e.button,e.ctrlKey,e.metaKey,e.shiftKey)&&u);return u},null,null)),t.ɵdid(1,671744,[[6,4]],0,u.RouterLinkWithHref,[u.Router,u.ActivatedRoute,o.LocationStrategy],{routerLink:[0,"routerLink"]},null),t.ɵdid(2,1720320,null,2,u.RouterLinkActive,[u.Router,t.ElementRef,t.Renderer2,t.ChangeDetectorRef],{routerLinkActive:[0,"routerLinkActive"]},null),t.ɵqud(603979776,5,{links:1}),t.ɵqud(603979776,6,{linksWithHrefs:1}),(n()(),t.ɵted(5,null,["\n ","\n "])),t.ɵppd(6,1)],function(n,l){n(l,1,0,"two-factor");n(l,2,0,"active")},function(n,l){n(l,0,0,t.ɵnov(l,1).target,t.ɵnov(l,1).href),n(l,5,0,t.ɵunv(l,5,0,n(l,6,0,t.ɵnov(l.parent,0),"twoStepLogin")))})}function p(n){return t.ɵvid(0,[t.ɵpid(0,i.I18nPipe,[r.I18nService]),(n()(),t.ɵeld(1,0,null,null,42,"div",[["class","container page-content"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(3,0,null,null,39,"div",[["class","row"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(5,0,null,null,30,"div",[["class","col-3"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(7,0,null,null,27,"div",[["class","card"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(9,0,null,null,2,"div",[["class","card-header"]],null,null,null,null,null)),(n()(),t.ɵted(10,null,["",""])),t.ɵppd(11,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(13,0,null,null,20,"div",[["class","list-group list-group-flush"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(15,0,null,null,6,"a",[["class","list-group-item"],["routerLink","account"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(n,l,e){var u=!0;"click"===l&&(u=!1!==t.ɵnov(n,16).onClick(e.button,e.ctrlKey,e.metaKey,e.shiftKey)&&u);return u},null,null)),t.ɵdid(16,671744,[[2,4]],0,u.RouterLinkWithHref,[u.Router,u.ActivatedRoute,o.LocationStrategy],{routerLink:[0,"routerLink"]},null),t.ɵdid(17,1720320,null,2,u.RouterLinkActive,[u.Router,t.ElementRef,t.Renderer2,t.ChangeDetectorRef],{routerLinkActive:[0,"routerLinkActive"]},null),t.ɵqud(603979776,1,{links:1}),t.ɵqud(603979776,2,{linksWithHrefs:1}),(n()(),t.ɵted(20,null,["\n ","\n "])),t.ɵppd(21,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(23,0,null,null,6,"a",[["class","list-group-item"],["routerLink","billing"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(n,l,e){var u=!0;"click"===l&&(u=!1!==t.ɵnov(n,24).onClick(e.button,e.ctrlKey,e.metaKey,e.shiftKey)&&u);return u},null,null)),t.ɵdid(24,671744,[[4,4]],0,u.RouterLinkWithHref,[u.Router,u.ActivatedRoute,o.LocationStrategy],{routerLink:[0,"routerLink"]},null),t.ɵdid(25,1720320,null,2,u.RouterLinkActive,[u.Router,t.ElementRef,t.Renderer2,t.ChangeDetectorRef],{routerLinkActive:[0,"routerLinkActive"]},null),t.ɵqud(603979776,3,{links:1}),t.ɵqud(603979776,4,{linksWithHrefs:1}),(n()(),t.ɵted(28,null,["\n ","\n "])),t.ɵppd(29,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,c)),t.ɵdid(32,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(37,0,null,null,4,"div",[["class","col-9"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(39,16777216,null,null,1,"router-outlet",[],null,null,null,null,null)),t.ɵdid(40,212992,null,0,u.RouterOutlet,[u.ChildrenOutletContexts,t.ViewContainerRef,t.ComponentFactoryResolver,[8,null],t.ChangeDetectorRef],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){var e=l.component;n(l,16,0,"account");n(l,17,0,"active");n(l,24,0,"billing");n(l,25,0,"active"),n(l,32,0,e.access2fa),n(l,40,0)},function(n,l){n(l,10,0,t.ɵunv(l,10,0,n(l,11,0,t.ɵnov(l,0),"settings"))),n(l,15,0,t.ɵnov(l,16).target,t.ɵnov(l,16).href),n(l,20,0,t.ɵunv(l,20,0,n(l,21,0,t.ɵnov(l,0),"myOrganization"))),n(l,23,0,t.ɵnov(l,24).target,t.ɵnov(l,24).href),n(l,28,0,t.ɵunv(l,28,0,n(l,29,0,t.ɵnov(l,0),"billingAndLicensing")))})}function f(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"app-org-settings",[],null,null,null,p,d)),t.ɵdid(1,114688,null,0,a.SettingsComponent,[u.ActivatedRoute,s.UserService],null,null)],function(n,l){n(l,1,0)},null)}l.RenderType_SettingsComponent=d,l.View_SettingsComponent_0=p,l.View_SettingsComponent_Host_0=f;var v=t.ɵccf("app-org-settings",a.SettingsComponent,f,{},{},[]);l.SettingsComponentNgFactory=v},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(){this.groupIds=[]}}();l.OrganizationUserUpdateGroupsRequest=t},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(){this.collections=[]}}();l.OrganizationUserUpdateRequest=t},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(){this.emails=[],this.collections=[]}}();l.OrganizationUserInviteRequest=t},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(){}}();l.OrganizationUserConfirmRequest=t},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=e(0),u=e(60),o=e(130),i=e(116),r=e(42),a=e(5),s=e(7),d=e(2),c=e(249),p=e(13),f=e(242),v=e(4),h=e(10),g=e(8),m=e(3),y=e(9),C=e(20),b=e(21),S=t.ɵcrt({encapsulation:2,styles:[],data:{}});function w(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"span",[["class","badge badge-pill badge-info"]],null,null,null,null,null)),(n()(),t.ɵted(1,null,["",""]))],null,function(n,l){n(l,1,0,l.component.invitedCount)})}function R(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"span",[["class","badge badge-pill badge-warning"]],null,null,null,null,null)),(n()(),t.ɵted(1,null,["",""]))],null,function(n,l){n(l,1,0,l.component.acceptedCount)})}function _(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"i",[["class","fa fa-spinner fa-spin text-muted"]],[[8,"title",0]],null,null,null,null)),t.ɵppd(1,1)],null,function(n,l){n(l,0,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,0,0,n(l,1,0,t.ɵnov(l.parent,0),"loading")),""))})}function I(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,2,"p",[],null,null,null,null,null)),(n()(),t.ɵted(1,null,["",""])),t.ɵppd(2,1)],null,function(n,l){n(l,1,0,t.ɵunv(l,1,0,n(l,2,0,t.ɵnov(l.parent.parent,0),"noUsersInList")))})}function A(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,2,"span",[["class","badge badge-secondary"]],null,null,null,null,null)),(n()(),t.ɵted(1,null,["",""])),t.ɵppd(2,1)],null,function(n,l){n(l,1,0,t.ɵunv(l,1,0,n(l,2,0,t.ɵnov(l.parent.parent.parent.parent,0),"invited")))})}function E(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,2,"span",[["class","badge badge-warning"]],null,null,null,null,null)),(n()(),t.ɵted(1,null,["",""])),t.ɵppd(2,1)],null,function(n,l){n(l,1,0,t.ɵunv(l,1,0,n(l,2,0,t.ɵnov(l.parent.parent.parent.parent,0),"accepted")))})}function O(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"small",[["class","text-muted d-block"]],null,null,null,null,null)),(n()(),t.ɵted(1,null,["",""]))],null,function(n,l){n(l,1,0,l.parent.context.$implicit.name)})}function N(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,2,"span",[],null,null,null,null,null)),(n()(),t.ɵted(1,null,["",""])),t.ɵppd(2,1)],null,function(n,l){n(l,1,0,t.ɵunv(l,1,0,n(l,2,0,t.ɵnov(l.parent.parent.parent.parent,0),"owner")))})}function T(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,2,"span",[],null,null,null,null,null)),(n()(),t.ɵted(1,null,["",""])),t.ɵppd(2,1)],null,function(n,l){n(l,1,0,t.ɵunv(l,1,0,n(l,2,0,t.ɵnov(l.parent.parent.parent.parent,0),"admin")))})}function k(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,2,"span",[],null,null,null,null,null)),(n()(),t.ɵted(1,null,["",""])),t.ɵppd(2,1)],null,function(n,l){n(l,1,0,t.ɵunv(l,1,0,n(l,2,0,t.ɵnov(l.parent.parent.parent.parent,0),"user")))})}function V(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,5,"a",[["appStopClick",""],["class","dropdown-item"],["href","#"]],null,[[null,"click"]],function(n,l,e){var u=!0,o=n.component;"click"===l&&(u=!1!==t.ɵnov(n,1).onClick(e)&&u);"click"===l&&(u=!1!==o.reinvite(n.parent.context.$implicit)&&u);return u},null,null)),t.ɵdid(1,16384,null,0,u.StopClickDirective,[],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(3,0,null,null,0,"i",[["class","fa fa-fw fa-envelope-o"]],null,null,null,null,null)),(n()(),t.ɵted(4,null,["\n ","\n "])),t.ɵppd(5,1)],null,function(n,l){n(l,4,0,t.ɵunv(l,4,0,n(l,5,0,t.ɵnov(l.parent.parent.parent.parent,0),"resendInvitation")))})}function P(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,5,"a",[["appStopClick",""],["class","dropdown-item text-success"],["href","#"]],null,[[null,"click"]],function(n,l,e){var u=!0,o=n.component;"click"===l&&(u=!1!==t.ɵnov(n,1).onClick(e)&&u);"click"===l&&(u=!1!==o.confirm(n.parent.context.$implicit)&&u);return u},null,null)),t.ɵdid(1,16384,null,0,u.StopClickDirective,[],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(3,0,null,null,0,"i",[["class","fa fa-fw fa-check"]],null,null,null,null,null)),(n()(),t.ɵted(4,null,["\n ","\n "])),t.ɵppd(5,1)],null,function(n,l){n(l,4,0,t.ɵunv(l,4,0,n(l,5,0,t.ɵnov(l.parent.parent.parent.parent,0),"confirm")))})}function M(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,5,"a",[["appStopClick",""],["class","dropdown-item"],["href","#"]],null,[[null,"click"]],function(n,l,e){var u=!0,o=n.component;"click"===l&&(u=!1!==t.ɵnov(n,1).onClick(e)&&u);"click"===l&&(u=!1!==o.groups(n.parent.context.$implicit)&&u);return u},null,null)),t.ɵdid(1,16384,null,0,u.StopClickDirective,[],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(3,0,null,null,0,"i",[["class","fa fa-fw fa-sitemap"]],null,null,null,null,null)),(n()(),t.ɵted(4,null,["\n ","\n "])),t.ɵppd(5,1)],null,function(n,l){n(l,4,0,t.ɵunv(l,4,0,n(l,5,0,t.ɵnov(l.parent.parent.parent.parent,0),"groups")))})}function x(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,5,"a",[["appStopClick",""],["class","dropdown-item"],["href","#"]],null,[[null,"click"]],function(n,l,e){var u=!0,o=n.component;"click"===l&&(u=!1!==t.ɵnov(n,1).onClick(e)&&u);"click"===l&&(u=!1!==o.events(n.parent.context.$implicit)&&u);return u},null,null)),t.ɵdid(1,16384,null,0,u.StopClickDirective,[],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(3,0,null,null,0,"i",[["class","fa fa-fw fa-file-text-o"]],null,null,null,null,null)),(n()(),t.ɵted(4,null,["\n ","\n "])),t.ɵppd(5,1)],null,function(n,l){n(l,4,0,t.ɵunv(l,4,0,n(l,5,0,t.ɵnov(l.parent.parent.parent.parent,0),"eventLogs")))})}function D(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,68,"tr",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,4,"td",[["width","30"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(4,0,null,null,1,"app-avatar",[["height","25"],["width","25"]],null,null,null,o.View_AvatarComponent_0,o.RenderType_AvatarComponent)),t.ɵdid(5,638976,null,0,i.AvatarComponent,[r.DomSanitizer],{data:[0,"data"],width:[1,"width"],height:[2,"height"],fontSize:[3,"fontSize"],circle:[4,"circle"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(8,0,null,null,14,"td",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(10,0,null,null,2,"a",[["appStopClick",""],["href","#"]],null,[[null,"click"]],function(n,l,e){var u=!0,o=n.component;"click"===l&&(u=!1!==t.ɵnov(n,11).onClick(e)&&u);"click"===l&&(u=!1!==o.edit(n.context.$implicit)&&u);return u},null,null)),t.ɵdid(11,16384,null,0,u.StopClickDirective,[],null,null),(n()(),t.ɵted(12,null,["",""])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,A)),t.ɵdid(15,16384,null,0,a.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,E)),t.ɵdid(18,16384,null,0,a.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,O)),t.ɵdid(21,16384,null,0,a.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(24,0,null,null,10,"td",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,N)),t.ɵdid(27,16384,null,0,a.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,T)),t.ɵdid(30,16384,null,0,a.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,k)),t.ɵdid(33,16384,null,0,a.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(36,0,null,null,31,"td",[["class","table-list-options"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(38,0,null,null,28,"div",[["appListDropdown",""],["class","dropdown"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(40,0,null,null,3,"button",[["aria-expanded","false"],["aria-haspopup","true"],["class","btn btn-outline-secondary dropdown-toggle"],["data-toggle","dropdown"],["type","button"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(42,0,null,null,0,"i",[["class","fa fa-cog fa-lg"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(45,0,null,null,20,"div",[["class","dropdown-menu dropdown-menu-right"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,V)),t.ɵdid(48,16384,null,0,a.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,P)),t.ɵdid(51,16384,null,0,a.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,M)),t.ɵdid(54,16384,null,0,a.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,x)),t.ɵdid(57,16384,null,0,a.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(59,0,null,null,5,"a",[["appStopClick",""],["class","dropdown-item text-danger"],["href","#"]],null,[[null,"click"]],function(n,l,e){var u=!0,o=n.component;"click"===l&&(u=!1!==t.ɵnov(n,60).onClick(e)&&u);"click"===l&&(u=!1!==o.remove(n.context.$implicit)&&u);return u},null,null)),t.ɵdid(60,16384,null,0,u.StopClickDirective,[],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(62,0,null,null,0,"i",[["class","fa fa-fw fa-remove"]],null,null,null,null,null)),(n()(),t.ɵted(63,null,["\n ","\n "])),t.ɵppd(64,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){var e=l.component;n(l,5,0,l.context.$implicit.name||l.context.$implicit.email,"25","25",14,!0),n(l,15,0,l.context.$implicit.status===e.organizationUserStatusType.Invited),n(l,18,0,l.context.$implicit.status===e.organizationUserStatusType.Accepted),n(l,21,0,l.context.$implicit.name),n(l,27,0,l.context.$implicit.type===e.organizationUserType.Owner),n(l,30,0,l.context.$implicit.type===e.organizationUserType.Admin),n(l,33,0,l.context.$implicit.type===e.organizationUserType.User),n(l,48,0,l.context.$implicit.status===e.organizationUserStatusType.Invited),n(l,51,0,l.context.$implicit.status===e.organizationUserStatusType.Accepted),n(l,54,0,e.accessGroups),n(l,57,0,e.accessEvents&&l.context.$implicit.status===e.organizationUserStatusType.Confirmed)},function(n,l){n(l,12,0,l.context.$implicit.email),n(l,63,0,t.ɵunv(l,63,0,n(l,64,0,t.ɵnov(l.parent.parent.parent,0),"remove")))})}function U(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,7,"table",[["class","table table-hover table-list"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,4,"tbody",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,D)),t.ɵdid(5,802816,null,0,a.NgForOf,[t.ViewContainerRef,t.TemplateRef,t.IterableDiffers],{ngForOf:[0,"ngForOf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){n(l,5,0,l.parent.context.ngIf)},null)}function F(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,7,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,I)),t.ɵdid(3,16384,null,0,a.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,U)),t.ɵdid(6,16384,null,0,a.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){n(l,3,0,!l.context.ngIf.length),n(l,6,0,l.context.ngIf.length)},null)}function L(n){return t.ɵvid(0,[(n()(),t.ɵand(0,null,null,0))],null,null)}function G(n){return t.ɵvid(0,[(n()(),t.ɵand(0,null,null,0))],null,null)}function q(n){return t.ɵvid(0,[(n()(),t.ɵand(0,null,null,0))],null,null)}function z(n){return t.ɵvid(0,[t.ɵpid(0,s.I18nPipe,[d.I18nService]),t.ɵpid(0,c.SearchPipe,[]),t.ɵqud(402653184,1,{addEditModalRef:0}),t.ɵqud(402653184,2,{groupsModalRef:0}),t.ɵqud(402653184,3,{eventsModalRef:0}),(n()(),t.ɵeld(5,0,null,null,56,"div",[["class","page-header d-flex"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(7,0,null,null,2,"h1",[],null,null,null,null,null)),(n()(),t.ɵted(8,null,["",""])),t.ɵppd(9,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(11,0,null,null,49,"div",[["class","ml-auto d-flex"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(13,0,null,null,25,"div",[["class","btn-group btn-group-sm"],["role","group"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(15,0,null,null,4,"button",[["class","btn btn-outline-secondary"],["type","button"]],null,[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.filter(null)&&t);return t},null,null)),t.ɵdid(16,278528,null,0,a.NgClass,[t.IterableDiffers,t.KeyValueDiffers,t.ElementRef,t.Renderer2],{klass:[0,"klass"],ngClass:[1,"ngClass"]},null),t.ɵpod(17,{active:0}),(n()(),t.ɵted(18,null,["\n ","\n "])),t.ɵppd(19,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(21,0,null,null,7,"button",[["class","btn btn-outline-secondary"],["type","button"]],null,[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.filter(u.organizationUserStatusType.Invited)&&t);return t},null,null)),t.ɵdid(22,278528,null,0,a.NgClass,[t.IterableDiffers,t.KeyValueDiffers,t.ElementRef,t.Renderer2],{klass:[0,"klass"],ngClass:[1,"ngClass"]},null),t.ɵpod(23,{active:0}),(n()(),t.ɵted(24,null,["\n ","\n "])),t.ɵppd(25,1),(n()(),t.ɵand(16777216,null,null,1,null,w)),t.ɵdid(27,16384,null,0,a.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(30,0,null,null,7,"button",[["class","btn btn-outline-secondary"],["type","button"]],null,[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.filter(u.organizationUserStatusType.Accepted)&&t);return t},null,null)),t.ɵdid(31,278528,null,0,a.NgClass,[t.IterableDiffers,t.KeyValueDiffers,t.ElementRef,t.Renderer2],{klass:[0,"klass"],ngClass:[1,"ngClass"]},null),t.ɵpod(32,{active:0}),(n()(),t.ɵted(33,null,["\n ","\n "])),t.ɵppd(34,1),(n()(),t.ɵand(16777216,null,null,1,null,R)),t.ɵdid(36,16384,null,0,a.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(40,0,null,null,13,"div",[["class","ml-3"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(42,0,null,null,2,"label",[["class","sr-only"],["for","search"]],null,null,null,null,null)),(n()(),t.ɵted(43,null,["",""])),t.ɵppd(44,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(46,0,null,null,6,"input",[["class","form-control form-control-sm"],["id","search"],["type","search"]],[[8,"placeholder",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(n,l,e){var u=!0,o=n.component;"input"===l&&(u=!1!==t.ɵnov(n,47)._handleInput(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,47).onTouched()&&u);"compositionstart"===l&&(u=!1!==t.ɵnov(n,47)._compositionStart()&&u);"compositionend"===l&&(u=!1!==t.ɵnov(n,47)._compositionEnd(e.target.value)&&u);"ngModelChange"===l&&(u=!1!==(o.searchText=e)&&u);return u},null,null)),t.ɵdid(47,16384,null,0,p.DefaultValueAccessor,[t.Renderer2,t.ElementRef,[2,p.COMPOSITION_BUFFER_MODE]],null,null),t.ɵprd(1024,null,p.NG_VALUE_ACCESSOR,function(n){return[n]},[p.DefaultValueAccessor]),t.ɵdid(49,671744,null,0,p.NgModel,[[8,null],[8,null],[8,null],[2,p.NG_VALUE_ACCESSOR]],{model:[0,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,p.NgControl,null,[p.NgModel]),t.ɵdid(51,16384,null,0,p.NgControlStatus,[p.NgControl],null,null),t.ɵppd(52,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(55,0,null,null,4,"button",[["class","btn btn-sm btn-outline-primary ml-3"],["type","button"]],null,[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.invite()&&t);return t},null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(57,0,null,null,0,"i",[["class","fa fa-plus fa-fw"]],null,null,null,null,null)),(n()(),t.ɵted(58,null,["\n ","\n "])),t.ɵppd(59,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,null,null,1,null,_)),t.ɵdid(64,16384,null,0,a.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,null,null,2,null,F)),t.ɵdid(67,16384,null,0,a.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),t.ɵppd(68,5),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,[[1,3],["addEdit",2]],null,0,null,L)),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,[[2,3],["groupsTemplate",2]],null,0,null,G)),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,[[3,3],["eventsTemplate",2]],null,0,null,q)),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){var e=l.component;n(l,16,0,"btn btn-outline-secondary",n(l,17,0,null==e.status));n(l,22,0,"btn btn-outline-secondary",n(l,23,0,e.status==e.organizationUserStatusType.Invited)),n(l,27,0,e.invitedCount);n(l,31,0,"btn btn-outline-secondary",n(l,32,0,e.status==e.organizationUserStatusType.Accepted)),n(l,36,0,e.acceptedCount),n(l,49,0,e.searchText),n(l,64,0,e.loading),n(l,67,0,!e.loading&&t.ɵunv(l,67,0,n(l,68,0,t.ɵnov(l,1),e.users,e.searchText,"name","email","id")))},function(n,l){n(l,8,0,t.ɵunv(l,8,0,n(l,9,0,t.ɵnov(l,0),"people"))),n(l,18,0,t.ɵunv(l,18,0,n(l,19,0,t.ɵnov(l,0),"all"))),n(l,24,0,t.ɵunv(l,24,0,n(l,25,0,t.ɵnov(l,0),"invited"))),n(l,33,0,t.ɵunv(l,33,0,n(l,34,0,t.ɵnov(l,0),"accepted"))),n(l,43,0,t.ɵunv(l,43,0,n(l,44,0,t.ɵnov(l,0),"search"))),n(l,46,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,46,0,n(l,52,0,t.ɵnov(l,0),"search")),""),t.ɵnov(l,51).ngClassUntouched,t.ɵnov(l,51).ngClassTouched,t.ɵnov(l,51).ngClassPristine,t.ɵnov(l,51).ngClassDirty,t.ɵnov(l,51).ngClassValid,t.ɵnov(l,51).ngClassInvalid,t.ɵnov(l,51).ngClassPending),n(l,58,0,t.ɵunv(l,58,0,n(l,59,0,t.ɵnov(l,0),"inviteUser")))})}function j(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"app-org-people",[],null,null,null,z,S)),t.ɵdid(1,114688,null,0,f.PeopleComponent,[v.ApiService,h.ActivatedRoute,d.I18nService,t.ComponentFactoryResolver,g.PlatformUtilsService,m.Angulartics2,y.ToasterService,C.CryptoService,b.UserService],null,null)],function(n,l){n(l,1,0)},null)}l.RenderType_PeopleComponent=S,l.View_PeopleComponent_0=z,l.View_PeopleComponent_Host_0=j;var B=t.ɵccf("app-org-people",f.PeopleComponent,j,{},{},[]);l.PeopleComponentNgFactory=B},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(){this.collections=[]}}();l.GroupRequest=t},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=e(0),u=e(60),o=e(5),i=e(7),r=e(2),a=e(249),s=e(13),d=e(243),c=e(4),p=e(10),f=e(3),v=e(9),h=e(8),g=e(21),m=t.ɵcrt({encapsulation:2,styles:[],data:{}});function y(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"i",[["class","fa fa-spinner fa-spin text-muted"]],[[8,"title",0]],null,null,null,null)),t.ɵppd(1,1)],null,function(n,l){n(l,0,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,0,0,n(l,1,0,t.ɵnov(l.parent,0),"loading")),""))})}function C(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,2,"p",[],null,null,null,null,null)),(n()(),t.ɵted(1,null,["",""])),t.ɵppd(2,1)],null,function(n,l){n(l,1,0,t.ɵunv(l,1,0,n(l,2,0,t.ɵnov(l.parent.parent,0),"noGroupsInList")))})}function b(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,36,"tr",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,5,"td",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(4,0,null,null,2,"a",[["appStopClick",""],["href","#"]],null,[[null,"click"]],function(n,l,e){var u=!0,o=n.component;"click"===l&&(u=!1!==t.ɵnov(n,5).onClick(e)&&u);"click"===l&&(u=!1!==o.edit(n.context.$implicit)&&u);return u},null,null)),t.ɵdid(5,16384,null,0,u.StopClickDirective,[],null,null),(n()(),t.ɵted(6,null,["",""])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(9,0,null,null,26,"td",[["class","table-list-options"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(11,0,null,null,23,"div",[["appListDropdown",""],["class","dropdown"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(13,0,null,null,3,"button",[["aria-expanded","false"],["aria-haspopup","true"],["class","btn btn-outline-secondary dropdown-toggle"],["data-toggle","dropdown"],["type","button"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(15,0,null,null,0,"i",[["class","fa fa-cog fa-lg"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(18,0,null,null,15,"div",[["class","dropdown-menu dropdown-menu-right"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(20,0,null,null,5,"a",[["appStopClick",""],["class","dropdown-item"],["href","#"]],null,[[null,"click"]],function(n,l,e){var u=!0,o=n.component;"click"===l&&(u=!1!==t.ɵnov(n,21).onClick(e)&&u);"click"===l&&(u=!1!==o.users(n.context.$implicit)&&u);return u},null,null)),t.ɵdid(21,16384,null,0,u.StopClickDirective,[],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(23,0,null,null,0,"i",[["class","fa fa-fw fa-users"]],null,null,null,null,null)),(n()(),t.ɵted(24,null,["\n ","\n "])),t.ɵppd(25,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(27,0,null,null,5,"a",[["appStopClick",""],["class","dropdown-item text-danger"],["href","#"]],null,[[null,"click"]],function(n,l,e){var u=!0,o=n.component;"click"===l&&(u=!1!==t.ɵnov(n,28).onClick(e)&&u);"click"===l&&(u=!1!==o.delete(n.context.$implicit)&&u);return u},null,null)),t.ɵdid(28,16384,null,0,u.StopClickDirective,[],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(30,0,null,null,0,"i",[["class","fa fa-fw fa-trash-o"]],null,null,null,null,null)),(n()(),t.ɵted(31,null,["\n ","\n "])),t.ɵppd(32,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "]))],null,function(n,l){n(l,6,0,l.context.$implicit.name),n(l,24,0,t.ɵunv(l,24,0,n(l,25,0,t.ɵnov(l.parent.parent.parent,0),"users"))),n(l,31,0,t.ɵunv(l,31,0,n(l,32,0,t.ɵnov(l.parent.parent.parent,0),"delete")))})}function S(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,7,"table",[["class","table table-hover table-list"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,4,"tbody",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,b)),t.ɵdid(5,802816,null,0,o.NgForOf,[t.ViewContainerRef,t.TemplateRef,t.IterableDiffers],{ngForOf:[0,"ngForOf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){n(l,5,0,l.parent.context.ngIf)},null)}function w(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,7,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,C)),t.ɵdid(3,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,S)),t.ɵdid(6,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){n(l,3,0,!l.context.ngIf.length),n(l,6,0,l.context.ngIf.length)},null)}function R(n){return t.ɵvid(0,[(n()(),t.ɵand(0,null,null,0))],null,null)}function _(n){return t.ɵvid(0,[(n()(),t.ɵand(0,null,null,0))],null,null)}function I(n){return t.ɵvid(0,[t.ɵpid(0,i.I18nPipe,[r.I18nService]),t.ɵpid(0,a.SearchPipe,[]),t.ɵqud(402653184,1,{addEditModalRef:0}),t.ɵqud(402653184,2,{usersModalRef:0}),(n()(),t.ɵeld(4,0,null,null,29,"div",[["class","page-header d-flex"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(6,0,null,null,2,"h1",[],null,null,null,null,null)),(n()(),t.ɵted(7,null,["",""])),t.ɵppd(8,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(10,0,null,null,22,"div",[["class","ml-auto d-flex"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(12,0,null,null,13,"div",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(14,0,null,null,2,"label",[["class","sr-only"],["for","search"]],null,null,null,null,null)),(n()(),t.ɵted(15,null,["",""])),t.ɵppd(16,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(18,0,null,null,6,"input",[["class","form-control form-control-sm"],["id","search"],["type","search"]],[[8,"placeholder",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(n,l,e){var u=!0,o=n.component;"input"===l&&(u=!1!==t.ɵnov(n,19)._handleInput(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,19).onTouched()&&u);"compositionstart"===l&&(u=!1!==t.ɵnov(n,19)._compositionStart()&&u);"compositionend"===l&&(u=!1!==t.ɵnov(n,19)._compositionEnd(e.target.value)&&u);"ngModelChange"===l&&(u=!1!==(o.searchText=e)&&u);return u},null,null)),t.ɵdid(19,16384,null,0,s.DefaultValueAccessor,[t.Renderer2,t.ElementRef,[2,s.COMPOSITION_BUFFER_MODE]],null,null),t.ɵprd(1024,null,s.NG_VALUE_ACCESSOR,function(n){return[n]},[s.DefaultValueAccessor]),t.ɵdid(21,671744,null,0,s.NgModel,[[8,null],[8,null],[8,null],[2,s.NG_VALUE_ACCESSOR]],{model:[0,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,s.NgControl,null,[s.NgModel]),t.ɵdid(23,16384,null,0,s.NgControlStatus,[s.NgControl],null,null),t.ɵppd(24,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(27,0,null,null,4,"button",[["class","btn btn-sm btn-outline-primary ml-3"],["type","button"]],null,[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.add()&&t);return t},null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(29,0,null,null,0,"i",[["class","fa fa-plus fa-fw"]],null,null,null,null,null)),(n()(),t.ɵted(30,null,["\n ","\n "])),t.ɵppd(31,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,null,null,1,null,y)),t.ɵdid(36,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,null,null,2,null,w)),t.ɵdid(39,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),t.ɵppd(40,4),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,[[1,3],["addEdit",2]],null,0,null,R)),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,[[2,3],["usersTemplate",2]],null,0,null,_)),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){var e=l.component;n(l,21,0,e.searchText),n(l,36,0,e.loading),n(l,39,0,!e.loading&&t.ɵunv(l,39,0,n(l,40,0,t.ɵnov(l,1),e.groups,e.searchText,"name","id")))},function(n,l){n(l,7,0,t.ɵunv(l,7,0,n(l,8,0,t.ɵnov(l,0),"groups"))),n(l,15,0,t.ɵunv(l,15,0,n(l,16,0,t.ɵnov(l,0),"search"))),n(l,18,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,18,0,n(l,24,0,t.ɵnov(l,0),"search")),""),t.ɵnov(l,23).ngClassUntouched,t.ɵnov(l,23).ngClassTouched,t.ɵnov(l,23).ngClassPristine,t.ɵnov(l,23).ngClassDirty,t.ɵnov(l,23).ngClassValid,t.ɵnov(l,23).ngClassInvalid,t.ɵnov(l,23).ngClassPending),n(l,30,0,t.ɵunv(l,30,0,n(l,31,0,t.ɵnov(l,0),"newGroup")))})}function A(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"app-org-groups",[],null,null,null,I,m)),t.ɵdid(1,114688,null,0,d.GroupsComponent,[c.ApiService,p.ActivatedRoute,r.I18nService,t.ComponentFactoryResolver,f.Angulartics2,v.ToasterService,h.PlatformUtilsService,g.UserService,p.Router],null,null)],function(n,l){n(l,1,0)},null)}l.RenderType_GroupsComponent=m,l.View_GroupsComponent_0=I,l.View_GroupsComponent_Host_0=A;var E=t.ɵccf("app-org-groups",d.GroupsComponent,A,{},{},[]);l.GroupsComponentNgFactory=E},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=e(0),u=e(5),o=e(18),i=e(17),r=e(7),a=e(2),s=e(13),d=e(244),c=e(4),p=e(10),f=e(175),v=e(9),h=e(21),g=t.ɵcrt({encapsulation:2,styles:[],data:{}});function m(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"i",[["class","fa fa-spinner fa-spin text-muted"]],[[8,"title",0]],null,null,null,null)),t.ɵppd(1,1)],null,function(n,l){n(l,0,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,0,0,n(l,1,0,t.ɵnov(l.parent,0),"loading")),""))})}function y(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,2,"p",[],null,null,null,null,null)),(n()(),t.ɵted(1,null,["",""])),t.ɵppd(2,1)],null,function(n,l){n(l,1,0,t.ɵunv(l,1,0,n(l,2,0,t.ɵnov(l.parent.parent,0),"noEventsInList")))})}function C(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,18,"tr",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,2,"td",[],null,null,null,null,null)),(n()(),t.ɵted(3,null,["",""])),t.ɵppd(4,2),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(6,0,null,null,3,"td",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(8,0,null,null,0,"i",[],[[8,"className",0],[8,"title",0]],null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(11,0,null,null,4,"td",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(13,0,null,null,1,"span",[],[[8,"title",0]],null,null,null,null)),(n()(),t.ɵted(14,null,["",""])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(17,0,null,null,0,"td",[],[[8,"innerHTML",1]],null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "]))],null,function(n,l){n(l,3,0,t.ɵunv(l,3,0,n(l,4,0,t.ɵnov(l.parent.parent.parent,1),l.context.$implicit.date,"medium"))),n(l,8,0,t.ɵinlineInterpolate(1,"text-muted fa fa-lg ",l.context.$implicit.appIcon,""),t.ɵinlineInterpolate(2,"",l.context.$implicit.appName,", ",l.context.$implicit.ip,"")),n(l,13,0,t.ɵinlineInterpolate(1,"",l.context.$implicit.userEmail,"")),n(l,14,0,l.context.$implicit.userName),n(l,17,0,l.context.$implicit.message)})}function b(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,32,"table",[["class","table table-hover"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,23,"thead",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(4,0,null,null,20,"tr",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(6,0,null,null,2,"th",[["class","border-top-0"],["width","210"]],null,null,null,null,null)),(n()(),t.ɵted(7,null,["",""])),t.ɵppd(8,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(10,0,null,null,5,"th",[["class","border-top-0"],["width","40"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(12,0,null,null,2,"span",[["class","sr-only"]],null,null,null,null,null)),(n()(),t.ɵted(13,null,["",""])),t.ɵppd(14,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(17,0,null,null,2,"th",[["class","border-top-0"],["width","150"]],null,null,null,null,null)),(n()(),t.ɵted(18,null,["",""])),t.ɵppd(19,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(21,0,null,null,2,"th",[["class","border-top-0"]],null,null,null,null,null)),(n()(),t.ɵted(22,null,["",""])),t.ɵppd(23,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(27,0,null,null,4,"tbody",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,C)),t.ɵdid(30,802816,null,0,u.NgForOf,[t.ViewContainerRef,t.TemplateRef,t.IterableDiffers],{ngForOf:[0,"ngForOf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){n(l,30,0,l.component.events)},function(n,l){n(l,7,0,t.ɵunv(l,7,0,n(l,8,0,t.ɵnov(l.parent.parent,0),"timestamp"))),n(l,13,0,t.ɵunv(l,13,0,n(l,14,0,t.ɵnov(l.parent.parent,0),"device"))),n(l,18,0,t.ɵunv(l,18,0,n(l,19,0,t.ɵnov(l.parent.parent,0),"user"))),n(l,22,0,t.ɵunv(l,22,0,n(l,23,0,t.ɵnov(l.parent.parent,0),"event")))})}function S(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,[["moreBtn",1]],null,9,"button",[["class","btn btn-block btn-link btn-submit"],["type","button"]],[[8,"disabled",0]],[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.loadEvents(!1)&&t);return t},null,null)),t.ɵdid(1,540672,null,0,o.ApiActionDirective,[t.ElementRef,i.ValidationService],{appApiAction:[0,"appApiAction"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(3,0,null,null,1,"i",[["class","fa fa-spinner fa-spin"]],[[8,"title",0]],null,null,null,null)),t.ɵppd(4,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(6,0,null,null,2,"span",[],null,null,null,null,null)),(n()(),t.ɵted(7,null,["",""])),t.ɵppd(8,1),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){n(l,1,0,l.component.morePromise)},function(n,l){n(l,0,0,l.component.loaded&&t.ɵnov(l,0).loading),n(l,3,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,3,0,n(l,4,0,t.ɵnov(l.parent.parent,0),"loading")),"")),n(l,7,0,t.ɵunv(l,7,0,n(l,8,0,t.ɵnov(l.parent.parent,0),"loadMore")))})}function w(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,10,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,y)),t.ɵdid(3,16384,null,0,u.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,b)),t.ɵdid(6,16384,null,0,u.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,S)),t.ɵdid(9,16384,null,0,u.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){var e=l.component;n(l,3,0,!e.events||!e.events.length),n(l,6,0,e.events&&e.events.length),n(l,9,0,e.continuationToken)},null)}function R(n){return t.ɵvid(0,[t.ɵpid(0,r.I18nPipe,[a.I18nService]),t.ɵpid(0,u.DatePipe,[t.LOCALE_ID]),(n()(),t.ɵeld(2,0,null,null,47,"div",[["class","page-header d-flex"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(4,0,null,null,2,"h1",[],null,null,null,null,null)),(n()(),t.ɵted(5,null,["",""])),t.ɵppd(6,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(8,0,null,null,40,"div",[["class","ml-auto d-flex"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(10,0,null,null,28,"div",[["class","form-inline"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(12,0,null,null,2,"label",[["class","sr-only"],["for","start"]],null,null,null,null,null)),(n()(),t.ɵted(13,null,["",""])),t.ɵppd(14,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(16,0,null,null,6,"input",[["class","form-control form-control-sm"],["id","start"],["placeholder","YYYY-MM-DDTHH:MM"],["type","datetime-local"]],[[8,"placeholder",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(n,l,e){var u=!0,o=n.component;"input"===l&&(u=!1!==t.ɵnov(n,17)._handleInput(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,17).onTouched()&&u);"compositionstart"===l&&(u=!1!==t.ɵnov(n,17)._compositionStart()&&u);"compositionend"===l&&(u=!1!==t.ɵnov(n,17)._compositionEnd(e.target.value)&&u);"ngModelChange"===l&&(u=!1!==(o.start=e)&&u);return u},null,null)),t.ɵdid(17,16384,null,0,s.DefaultValueAccessor,[t.Renderer2,t.ElementRef,[2,s.COMPOSITION_BUFFER_MODE]],null,null),t.ɵprd(1024,null,s.NG_VALUE_ACCESSOR,function(n){return[n]},[s.DefaultValueAccessor]),t.ɵdid(19,671744,null,0,s.NgModel,[[8,null],[8,null],[8,null],[2,s.NG_VALUE_ACCESSOR]],{model:[0,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,s.NgControl,null,[s.NgModel]),t.ɵdid(21,16384,null,0,s.NgControlStatus,[s.NgControl],null,null),t.ɵppd(22,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(24,0,null,null,1,"span",[["class","mx-2"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["-"])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(27,0,null,null,2,"label",[["class","sr-only"],["for","end"]],null,null,null,null,null)),(n()(),t.ɵted(28,null,["",""])),t.ɵppd(29,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(31,0,null,null,6,"input",[["class","form-control form-control-sm"],["id","end"],["placeholder","YYYY-MM-DDTHH:MM"],["type","datetime-local"]],[[8,"placeholder",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(n,l,e){var u=!0,o=n.component;"input"===l&&(u=!1!==t.ɵnov(n,32)._handleInput(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,32).onTouched()&&u);"compositionstart"===l&&(u=!1!==t.ɵnov(n,32)._compositionStart()&&u);"compositionend"===l&&(u=!1!==t.ɵnov(n,32)._compositionEnd(e.target.value)&&u);"ngModelChange"===l&&(u=!1!==(o.end=e)&&u);return u},null,null)),t.ɵdid(32,16384,null,0,s.DefaultValueAccessor,[t.Renderer2,t.ElementRef,[2,s.COMPOSITION_BUFFER_MODE]],null,null),t.ɵprd(1024,null,s.NG_VALUE_ACCESSOR,function(n){return[n]},[s.DefaultValueAccessor]),t.ɵdid(34,671744,null,0,s.NgModel,[[8,null],[8,null],[8,null],[2,s.NG_VALUE_ACCESSOR]],{model:[0,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,s.NgControl,null,[s.NgModel]),t.ɵdid(36,16384,null,0,s.NgControlStatus,[s.NgControl],null,null),t.ɵppd(37,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(40,0,[["refreshBtn",1]],null,7,"button",[["class","btn btn-sm btn-outline-primary ml-3"],["type","button"]],[[8,"disabled",0]],[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.loadEvents(!0)&&t);return t},null,null)),t.ɵdid(41,540672,null,0,o.ApiActionDirective,[t.ElementRef,i.ValidationService],{appApiAction:[0,"appApiAction"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(43,0,null,null,2,"i",[["class","fa fa-refresh fa-fw"]],null,null,null,null,null)),t.ɵdid(44,278528,null,0,u.NgClass,[t.IterableDiffers,t.KeyValueDiffers,t.ElementRef,t.Renderer2],{klass:[0,"klass"],ngClass:[1,"ngClass"]},null),t.ɵpod(45,{"fa-spin":0}),(n()(),t.ɵted(46,null,["\n ","\n "])),t.ɵppd(47,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,null,null,1,null,m)),t.ɵdid(52,16384,null,0,u.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,null,null,1,null,w)),t.ɵdid(55,16384,null,0,u.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){var e=l.component;n(l,19,0,e.start),n(l,34,0,e.end),n(l,41,0,e.refreshPromise);n(l,44,0,"fa fa-refresh fa-fw",n(l,45,0,e.loaded&&t.ɵnov(l,40).loading)),n(l,52,0,!e.loaded),n(l,55,0,e.loaded)},function(n,l){var e=l.component;n(l,5,0,t.ɵunv(l,5,0,n(l,6,0,t.ɵnov(l,0),"eventLogs"))),n(l,13,0,t.ɵunv(l,13,0,n(l,14,0,t.ɵnov(l,0),"startDate"))),n(l,16,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,16,0,n(l,22,0,t.ɵnov(l,0),"startDate")),""),t.ɵnov(l,21).ngClassUntouched,t.ɵnov(l,21).ngClassTouched,t.ɵnov(l,21).ngClassPristine,t.ɵnov(l,21).ngClassDirty,t.ɵnov(l,21).ngClassValid,t.ɵnov(l,21).ngClassInvalid,t.ɵnov(l,21).ngClassPending),n(l,28,0,t.ɵunv(l,28,0,n(l,29,0,t.ɵnov(l,0),"endDate"))),n(l,31,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,31,0,n(l,37,0,t.ɵnov(l,0),"endDate")),""),t.ɵnov(l,36).ngClassUntouched,t.ɵnov(l,36).ngClassTouched,t.ɵnov(l,36).ngClassPristine,t.ɵnov(l,36).ngClassDirty,t.ɵnov(l,36).ngClassValid,t.ɵnov(l,36).ngClassInvalid,t.ɵnov(l,36).ngClassPending),n(l,40,0,e.loaded&&t.ɵnov(l,40).loading),n(l,46,0,t.ɵunv(l,46,0,n(l,47,0,t.ɵnov(l,0),"refresh")))})}function _(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"app-org-events",[],null,null,null,R,g)),t.ɵdid(1,114688,null,0,d.EventsComponent,[c.ApiService,p.ActivatedRoute,f.EventService,a.I18nService,v.ToasterService,h.UserService,p.Router],null,null)],function(n,l){n(l,1,0)},null)}l.RenderType_EventsComponent=g,l.View_EventsComponent_0=R,l.View_EventsComponent_Host_0=_;var I=t.ɵccf("app-org-events",d.EventsComponent,_,{},{},[]);l.EventsComponentNgFactory=I},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=e(0),u=e(60),o=e(5),i=e(7),r=e(2),a=e(249),s=e(13),d=e(248),c=e(4),p=e(10),f=e(44),v=e(3),h=e(9),g=e(8),m=t.ɵcrt({encapsulation:2,styles:[],data:{}});function y(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,0,"i",[["class","fa fa-spinner fa-spin text-muted"]],null,null,null,null,null))],null,null)}function C(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,2,"p",[],null,null,null,null,null)),(n()(),t.ɵted(1,null,["",""])),t.ɵppd(2,1)],null,function(n,l){n(l,1,0,t.ɵunv(l,1,0,n(l,2,0,t.ɵnov(l.parent.parent,0),"noCollectionsInList")))})}function b(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,36,"tr",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,5,"td",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(4,0,null,null,2,"a",[["appStopClick",""],["href","#"]],null,[[null,"click"]],function(n,l,e){var u=!0,o=n.component;"click"===l&&(u=!1!==t.ɵnov(n,5).onClick(e)&&u);"click"===l&&(u=!1!==o.edit(n.context.$implicit)&&u);return u},null,null)),t.ɵdid(5,16384,null,0,u.StopClickDirective,[],null,null),(n()(),t.ɵted(6,null,["",""])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(9,0,null,null,26,"td",[["class","table-list-options"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(11,0,null,null,23,"div",[["appListDropdown",""],["class","dropdown"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(13,0,null,null,3,"button",[["aria-expanded","false"],["aria-haspopup","true"],["class","btn btn-outline-secondary dropdown-toggle"],["data-toggle","dropdown"],["type","button"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(15,0,null,null,0,"i",[["class","fa fa-cog fa-lg"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(18,0,null,null,15,"div",[["class","dropdown-menu dropdown-menu-right"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(20,0,null,null,5,"a",[["appStopClick",""],["class","dropdown-item"],["href","#"]],null,[[null,"click"]],function(n,l,e){var u=!0,o=n.component;"click"===l&&(u=!1!==t.ɵnov(n,21).onClick(e)&&u);"click"===l&&(u=!1!==o.users(n.context.$implicit)&&u);return u},null,null)),t.ɵdid(21,16384,null,0,u.StopClickDirective,[],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(23,0,null,null,0,"i",[["class","fa fa-fw fa-users"]],null,null,null,null,null)),(n()(),t.ɵted(24,null,["\n ","\n "])),t.ɵppd(25,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(27,0,null,null,5,"a",[["appStopClick",""],["class","dropdown-item text-danger"],["href","#"]],null,[[null,"click"]],function(n,l,e){var u=!0,o=n.component;"click"===l&&(u=!1!==t.ɵnov(n,28).onClick(e)&&u);"click"===l&&(u=!1!==o.delete(n.context.$implicit)&&u);return u},null,null)),t.ɵdid(28,16384,null,0,u.StopClickDirective,[],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(30,0,null,null,0,"i",[["class","fa fa-fw fa-trash-o"]],null,null,null,null,null)),(n()(),t.ɵted(31,null,["\n ","\n "])),t.ɵppd(32,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "]))],null,function(n,l){n(l,6,0,l.context.$implicit.name),n(l,24,0,t.ɵunv(l,24,0,n(l,25,0,t.ɵnov(l.parent.parent.parent,0),"users"))),n(l,31,0,t.ɵunv(l,31,0,n(l,32,0,t.ɵnov(l.parent.parent.parent,0),"delete")))})}function S(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,7,"table",[["class","table table-hover table-list"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,4,"tbody",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,b)),t.ɵdid(5,802816,null,0,o.NgForOf,[t.ViewContainerRef,t.TemplateRef,t.IterableDiffers],{ngForOf:[0,"ngForOf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){n(l,5,0,l.parent.context.ngIf)},null)}function w(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,7,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,C)),t.ɵdid(3,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,S)),t.ɵdid(6,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){n(l,3,0,!l.context.ngIf.length),n(l,6,0,l.context.ngIf.length)},null)}function R(n){return t.ɵvid(0,[(n()(),t.ɵand(0,null,null,0))],null,null)}function _(n){return t.ɵvid(0,[(n()(),t.ɵand(0,null,null,0))],null,null)}function I(n){return t.ɵvid(0,[t.ɵpid(0,i.I18nPipe,[r.I18nService]),t.ɵpid(0,a.SearchPipe,[]),t.ɵqud(402653184,1,{addEditModalRef:0}),t.ɵqud(402653184,2,{usersModalRef:0}),(n()(),t.ɵeld(4,0,null,null,29,"div",[["class","page-header d-flex"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(6,0,null,null,2,"h1",[],null,null,null,null,null)),(n()(),t.ɵted(7,null,["",""])),t.ɵppd(8,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(10,0,null,null,22,"div",[["class","ml-auto d-flex"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(12,0,null,null,13,"div",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(14,0,null,null,2,"label",[["class","sr-only"],["for","search"]],null,null,null,null,null)),(n()(),t.ɵted(15,null,["",""])),t.ɵppd(16,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(18,0,null,null,6,"input",[["class","form-control form-control-sm"],["id","search"],["type","search"]],[[8,"placeholder",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(n,l,e){var u=!0,o=n.component;"input"===l&&(u=!1!==t.ɵnov(n,19)._handleInput(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,19).onTouched()&&u);"compositionstart"===l&&(u=!1!==t.ɵnov(n,19)._compositionStart()&&u);"compositionend"===l&&(u=!1!==t.ɵnov(n,19)._compositionEnd(e.target.value)&&u);"ngModelChange"===l&&(u=!1!==(o.searchText=e)&&u);return u},null,null)),t.ɵdid(19,16384,null,0,s.DefaultValueAccessor,[t.Renderer2,t.ElementRef,[2,s.COMPOSITION_BUFFER_MODE]],null,null),t.ɵprd(1024,null,s.NG_VALUE_ACCESSOR,function(n){return[n]},[s.DefaultValueAccessor]),t.ɵdid(21,671744,null,0,s.NgModel,[[8,null],[8,null],[8,null],[2,s.NG_VALUE_ACCESSOR]],{model:[0,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,s.NgControl,null,[s.NgModel]),t.ɵdid(23,16384,null,0,s.NgControlStatus,[s.NgControl],null,null),t.ɵppd(24,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(27,0,null,null,4,"button",[["class","btn btn-sm btn-outline-primary ml-3"],["type","button"]],null,[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.add()&&t);return t},null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(29,0,null,null,0,"i",[["class","fa fa-plus fa-fw"]],null,null,null,null,null)),(n()(),t.ɵted(30,null,["\n ","\n "])),t.ɵppd(31,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,null,null,1,null,y)),t.ɵdid(36,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,null,null,2,null,w)),t.ɵdid(39,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),t.ɵppd(40,4),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,[[1,3],["addEdit",2]],null,0,null,R)),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,[[2,3],["usersTemplate",2]],null,0,null,_)),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){var e=l.component;n(l,21,0,e.searchText),n(l,36,0,e.loading),n(l,39,0,!e.loading&&t.ɵunv(l,39,0,n(l,40,0,t.ɵnov(l,1),e.collections,e.searchText,"name","id")))},function(n,l){n(l,7,0,t.ɵunv(l,7,0,n(l,8,0,t.ɵnov(l,0),"collections"))),n(l,15,0,t.ɵunv(l,15,0,n(l,16,0,t.ɵnov(l,0),"search"))),n(l,18,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,18,0,n(l,24,0,t.ɵnov(l,0),"search")),""),t.ɵnov(l,23).ngClassUntouched,t.ɵnov(l,23).ngClassTouched,t.ɵnov(l,23).ngClassPristine,t.ɵnov(l,23).ngClassDirty,t.ɵnov(l,23).ngClassValid,t.ɵnov(l,23).ngClassInvalid,t.ɵnov(l,23).ngClassPending),n(l,30,0,t.ɵunv(l,30,0,n(l,31,0,t.ɵnov(l,0),"newCollection")))})}function A(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"app-org-manage-collections",[],null,null,null,I,m)),t.ɵdid(1,114688,null,0,d.CollectionsComponent,[c.ApiService,p.ActivatedRoute,f.CollectionService,t.ComponentFactoryResolver,v.Angulartics2,h.ToasterService,r.I18nService,g.PlatformUtilsService],null,null)],function(n,l){n(l,1,0)},null)}l.RenderType_CollectionsComponent=m,l.View_CollectionsComponent_0=I,l.View_CollectionsComponent_Host_0=A;var E=t.ɵccf("app-org-manage-collections",d.CollectionsComponent,A,{},{},[]);l.CollectionsComponentNgFactory=E},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=e(0),u=e(10),o=e(5),i=e(7),r=e(2),a=e(250),s=e(21),d=t.ɵcrt({encapsulation:2,styles:[],data:{}});function c(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,6,"a",[["class","list-group-item"],["routerLink","groups"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(n,l,e){var u=!0;"click"===l&&(u=!1!==t.ɵnov(n,1).onClick(e.button,e.ctrlKey,e.metaKey,e.shiftKey)&&u);return u},null,null)),t.ɵdid(1,671744,[[6,4]],0,u.RouterLinkWithHref,[u.Router,u.ActivatedRoute,o.LocationStrategy],{routerLink:[0,"routerLink"]},null),t.ɵdid(2,1720320,null,2,u.RouterLinkActive,[u.Router,t.ElementRef,t.Renderer2,t.ChangeDetectorRef],{routerLinkActive:[0,"routerLinkActive"]},null),t.ɵqud(603979776,5,{links:1}),t.ɵqud(603979776,6,{linksWithHrefs:1}),(n()(),t.ɵted(5,null,["\n ","\n "])),t.ɵppd(6,1)],function(n,l){n(l,1,0,"groups");n(l,2,0,"active")},function(n,l){n(l,0,0,t.ɵnov(l,1).target,t.ɵnov(l,1).href),n(l,5,0,t.ɵunv(l,5,0,n(l,6,0,t.ɵnov(l.parent,0),"groups")))})}function p(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,6,"a",[["class","list-group-item"],["routerLink","events"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(n,l,e){var u=!0;"click"===l&&(u=!1!==t.ɵnov(n,1).onClick(e.button,e.ctrlKey,e.metaKey,e.shiftKey)&&u);return u},null,null)),t.ɵdid(1,671744,[[8,4]],0,u.RouterLinkWithHref,[u.Router,u.ActivatedRoute,o.LocationStrategy],{routerLink:[0,"routerLink"]},null),t.ɵdid(2,1720320,null,2,u.RouterLinkActive,[u.Router,t.ElementRef,t.Renderer2,t.ChangeDetectorRef],{routerLinkActive:[0,"routerLinkActive"]},null),t.ɵqud(603979776,7,{links:1}),t.ɵqud(603979776,8,{linksWithHrefs:1}),(n()(),t.ɵted(5,null,["\n ","\n "])),t.ɵppd(6,1)],function(n,l){n(l,1,0,"events");n(l,2,0,"active")},function(n,l){n(l,0,0,t.ɵnov(l,1).target,t.ɵnov(l,1).href),n(l,5,0,t.ɵunv(l,5,0,n(l,6,0,t.ɵnov(l.parent,0),"eventLogs")))})}function f(n){return t.ɵvid(0,[t.ɵpid(0,i.I18nPipe,[r.I18nService]),(n()(),t.ɵeld(1,0,null,null,45,"div",[["class","container page-content"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(3,0,null,null,42,"div",[["class","row"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(5,0,null,null,33,"div",[["class","col-3"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(7,0,null,null,30,"div",[["class","card"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(9,0,null,null,2,"div",[["class","card-header"]],null,null,null,null,null)),(n()(),t.ɵted(10,null,["",""])),t.ɵppd(11,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(13,0,null,null,23,"div",[["class","list-group list-group-flush"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(15,0,null,null,6,"a",[["class","list-group-item"],["routerLink","people"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(n,l,e){var u=!0;"click"===l&&(u=!1!==t.ɵnov(n,16).onClick(e.button,e.ctrlKey,e.metaKey,e.shiftKey)&&u);return u},null,null)),t.ɵdid(16,671744,[[2,4]],0,u.RouterLinkWithHref,[u.Router,u.ActivatedRoute,o.LocationStrategy],{routerLink:[0,"routerLink"]},null),t.ɵdid(17,1720320,null,2,u.RouterLinkActive,[u.Router,t.ElementRef,t.Renderer2,t.ChangeDetectorRef],{routerLinkActive:[0,"routerLinkActive"]},null),t.ɵqud(603979776,1,{links:1}),t.ɵqud(603979776,2,{linksWithHrefs:1}),(n()(),t.ɵted(20,null,["\n ","\n "])),t.ɵppd(21,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(23,0,null,null,6,"a",[["class","list-group-item"],["routerLink","collections"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(n,l,e){var u=!0;"click"===l&&(u=!1!==t.ɵnov(n,24).onClick(e.button,e.ctrlKey,e.metaKey,e.shiftKey)&&u);return u},null,null)),t.ɵdid(24,671744,[[4,4]],0,u.RouterLinkWithHref,[u.Router,u.ActivatedRoute,o.LocationStrategy],{routerLink:[0,"routerLink"]},null),t.ɵdid(25,1720320,null,2,u.RouterLinkActive,[u.Router,t.ElementRef,t.Renderer2,t.ChangeDetectorRef],{routerLinkActive:[0,"routerLinkActive"]},null),t.ɵqud(603979776,3,{links:1}),t.ɵqud(603979776,4,{linksWithHrefs:1}),(n()(),t.ɵted(28,null,["\n ","\n "])),t.ɵppd(29,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,c)),t.ɵdid(32,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,p)),t.ɵdid(35,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(40,0,null,null,4,"div",[["class","col-9"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(42,16777216,null,null,1,"router-outlet",[],null,null,null,null,null)),t.ɵdid(43,212992,null,0,u.RouterOutlet,[u.ChildrenOutletContexts,t.ViewContainerRef,t.ComponentFactoryResolver,[8,null],t.ChangeDetectorRef],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){var e=l.component;n(l,16,0,"people");n(l,17,0,"active");n(l,24,0,"collections");n(l,25,0,"active"),n(l,32,0,e.accessGroups),n(l,35,0,e.accessEvents),n(l,43,0)},function(n,l){n(l,10,0,t.ɵunv(l,10,0,n(l,11,0,t.ɵnov(l,0),"manage"))),n(l,15,0,t.ɵnov(l,16).target,t.ɵnov(l,16).href),n(l,20,0,t.ɵunv(l,20,0,n(l,21,0,t.ɵnov(l,0),"people"))),n(l,23,0,t.ɵnov(l,24).target,t.ɵnov(l,24).href),n(l,28,0,t.ɵunv(l,28,0,n(l,29,0,t.ɵnov(l,0),"collections")))})}function v(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"app-org-manage",[],null,null,null,f,d)),t.ɵdid(1,114688,null,0,a.ManageComponent,[u.ActivatedRoute,s.UserService],null,null)],function(n,l){n(l,1,0)},null)}l.RenderType_ManageComponent=d,l.View_ManageComponent_0=f,l.View_ManageComponent_Host_0=v;var h=t.ɵccf("app-org-manage",a.ManageComponent,v,{},{},[]);l.ManageComponentNgFactory=h},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=e(0),u=e(7),o=e(2),i=e(13),r=e(18),a=e(17),s=e(40),d=e(37),c=e(46),p=e(251),f=e(3),v=e(9),h=e(20),g=e(21),m=e(8),y=e(176),C=e(10),b=t.ɵcrt({encapsulation:2,styles:[],data:{}});function S(n){return t.ɵvid(0,[t.ɵpid(0,u.I18nPipe,[o.I18nService]),(n()(),t.ɵeld(1,0,[["form",1]],null,51,"form",[["ngNativeValidate",""]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngSubmit"],[null,"submit"],[null,"reset"]],function(n,l,e){var u=!0,o=n.component;"submit"===l&&(u=!1!==t.ɵnov(n,2).onSubmit(e)&&u);"reset"===l&&(u=!1!==t.ɵnov(n,2).onReset()&&u);"ngSubmit"===l&&(u=!1!==o.submit()&&u);return u},null,null)),t.ɵdid(2,4210688,null,0,i.NgForm,[[8,null],[8,null]],null,{ngSubmit:"ngSubmit"}),t.ɵprd(2048,null,i.ControlContainer,null,[i.NgForm]),t.ɵdid(4,16384,null,0,i.NgControlStatusGroup,[i.ControlContainer],null,null),t.ɵdid(5,540672,null,0,r.ApiActionDirective,[t.ElementRef,a.ValidationService],{appApiAction:[0,"appApiAction"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(7,0,null,null,5,"div",[["class","page-header"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(9,0,null,null,2,"h1",[],null,null,null,null,null)),(n()(),t.ɵted(10,null,["",""])),t.ɵppd(11,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(14,0,null,null,2,"p",[],null,null,null,null,null)),(n()(),t.ɵted(15,null,["",""])),t.ɵppd(16,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(18,0,null,null,3,"app-callout",[["type","warning"]],null,null,null,s.View_CalloutComponent_0,s.RenderType_CalloutComponent)),t.ɵdid(19,114688,null,0,d.CalloutComponent,[o.I18nService],{type:[0,"type"]},null),(n()(),t.ɵted(20,0,["",""])),t.ɵppd(21,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(23,0,null,null,18,"div",[["class","row"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(25,0,null,null,15,"div",[["class","form-group col-6"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(27,0,null,null,2,"label",[["for","masterPassword"]],null,null,null,null,null)),(n()(),t.ɵted(28,null,["",""])),t.ɵppd(29,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(31,0,null,null,8,"input",[["appInputVerbatim",""],["class","form-control"],["id","masterPassword"],["name","MasterPassword"],["required",""],["type","password"]],[[1,"required",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(n,l,e){var u=!0,o=n.component;"input"===l&&(u=!1!==t.ɵnov(n,32)._handleInput(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,32).onTouched()&&u);"compositionstart"===l&&(u=!1!==t.ɵnov(n,32)._compositionStart()&&u);"compositionend"===l&&(u=!1!==t.ɵnov(n,32)._compositionEnd(e.target.value)&&u);"ngModelChange"===l&&(u=!1!==(o.masterPassword=e)&&u);return u},null,null)),t.ɵdid(32,16384,null,0,i.DefaultValueAccessor,[t.Renderer2,t.ElementRef,[2,i.COMPOSITION_BUFFER_MODE]],null,null),t.ɵdid(33,16384,null,0,i.RequiredValidator,[],{required:[0,"required"]},null),t.ɵprd(1024,null,i.NG_VALIDATORS,function(n){return[n]},[i.RequiredValidator]),t.ɵprd(1024,null,i.NG_VALUE_ACCESSOR,function(n){return[n]},[i.DefaultValueAccessor]),t.ɵdid(36,671744,null,0,i.NgModel,[[2,i.ControlContainer],[2,i.NG_VALIDATORS],[8,null],[2,i.NG_VALUE_ACCESSOR]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,i.NgControl,null,[i.NgModel]),t.ɵdid(38,16384,null,0,i.NgControlStatus,[i.NgControl],null,null),t.ɵdid(39,81920,null,0,c.InputVerbatimDirective,[t.ElementRef,t.Renderer2],{appInputVerbatim:[0,"appInputVerbatim"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(43,0,null,null,8,"button",[["class","btn btn-primary btn-submit"],["type","submit"]],[[8,"disabled",0]],null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(45,0,null,null,1,"i",[["class","fa fa-spinner fa-spin"]],[[8,"title",0]],null,null,null,null)),t.ɵppd(46,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(48,0,null,null,2,"span",[],null,null,null,null,null)),(n()(),t.ɵted(49,null,["",""])),t.ɵppd(50,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){var e=l.component;n(l,5,0,e.formPromise);n(l,19,0,"warning");n(l,33,0,"");n(l,36,0,"MasterPassword",e.masterPassword);n(l,39,0,"")},function(n,l){n(l,1,0,t.ɵnov(l,4).ngClassUntouched,t.ɵnov(l,4).ngClassTouched,t.ɵnov(l,4).ngClassPristine,t.ɵnov(l,4).ngClassDirty,t.ɵnov(l,4).ngClassValid,t.ɵnov(l,4).ngClassInvalid,t.ɵnov(l,4).ngClassPending),n(l,10,0,t.ɵunv(l,10,0,n(l,11,0,t.ɵnov(l,0),"exportVault"))),n(l,15,0,t.ɵunv(l,15,0,n(l,16,0,t.ɵnov(l,0),"exportMasterPassword"))),n(l,20,0,t.ɵunv(l,20,0,n(l,21,0,t.ɵnov(l,0),"exportWarning"))),n(l,28,0,t.ɵunv(l,28,0,n(l,29,0,t.ɵnov(l,0),"masterPass"))),n(l,31,0,t.ɵnov(l,33).required?"":null,t.ɵnov(l,38).ngClassUntouched,t.ɵnov(l,38).ngClassTouched,t.ɵnov(l,38).ngClassPristine,t.ɵnov(l,38).ngClassDirty,t.ɵnov(l,38).ngClassValid,t.ɵnov(l,38).ngClassInvalid,t.ɵnov(l,38).ngClassPending),n(l,43,0,t.ɵnov(l,1).loading),n(l,45,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,45,0,n(l,46,0,t.ɵnov(l,0),"loading")),"")),n(l,49,0,t.ɵunv(l,49,0,n(l,50,0,t.ɵnov(l,0),"exportVault")))})}function w(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"app-org-export",[],null,null,null,S,b)),t.ɵdid(1,114688,null,0,p.ExportComponent,[f.Angulartics2,v.ToasterService,h.CryptoService,g.UserService,o.I18nService,m.PlatformUtilsService,y.ExportService,C.ActivatedRoute],null,null)],function(n,l){n(l,1,0)},null)}l.RenderType_ExportComponent=b,l.View_ExportComponent_0=S,l.View_ExportComponent_Host_0=w;var R=t.ɵccf("app-org-export",p.ExportComponent,w,{},{onSaved:"onSaved"},[]);l.ExportComponentNgFactory=R},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(){this.ciphers=[],this.collections=[],this.collectionRelationships=[]}}();l.ImportOrganizationCiphersRequest=t},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=e(0),u=e(13),o=e(5),i=e(40),r=e(37),a=e(2),s=e(7),d=e(18),c=e(17),p=e(252),f=e(3),v=e(9),h=e(26),g=e(50),m=e(4),y=e(10),C=e(44),b=t.ɵcrt({encapsulation:2,styles:[],data:{}});function S(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,3,"option",[],null,null,null,null,null)),t.ɵdid(1,147456,null,0,u.NgSelectOption,[t.ElementRef,t.Renderer2,[2,u.SelectControlValueAccessor]],{ngValue:[0,"ngValue"]},null),t.ɵdid(2,147456,null,0,u.ɵq,[t.ElementRef,t.Renderer2,[8,null]],{ngValue:[0,"ngValue"]},null),(n()(),t.ɵted(3,null,["",""]))],function(n,l){n(l,1,0,l.context.$implicit.id),n(l,2,0,l.context.$implicit.id)},function(n,l){n(l,3,0,l.context.$implicit.name)})}function w(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,3,"option",[],null,null,null,null,null)),t.ɵdid(1,147456,null,0,u.NgSelectOption,[t.ElementRef,t.Renderer2,[2,u.SelectControlValueAccessor]],{ngValue:[0,"ngValue"]},null),t.ɵdid(2,147456,null,0,u.ɵq,[t.ElementRef,t.Renderer2,[8,null]],{ngValue:[0,"ngValue"]},null),(n()(),t.ɵted(3,null,["",""]))],function(n,l){n(l,1,0,l.context.$implicit.id),n(l,2,0,l.context.$implicit.id)},function(n,l){n(l,3,0,l.context.$implicit.name)})}function R(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,8,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,2,"option",[["disabled",""],["value","-"]],null,null,null,null,null)),t.ɵdid(3,147456,null,0,u.NgSelectOption,[t.ElementRef,t.Renderer2,[2,u.SelectControlValueAccessor]],{value:[0,"value"]},null),t.ɵdid(4,147456,null,0,u.ɵq,[t.ElementRef,t.Renderer2,[8,null]],{value:[0,"value"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,w)),t.ɵdid(7,802816,null,0,o.NgForOf,[t.ViewContainerRef,t.TemplateRef,t.IterableDiffers],{ngForOf:[0,"ngForOf"]},null),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){var e=l.component;n(l,3,0,"-");n(l,4,0,"-"),n(l,7,0,e.importOptions)},null)}function _(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,4,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n See detailed instructions on our help site at\n "])),(n()(),t.ɵeld(2,0,null,null,1,"a",[["href","https://help.bitwarden.com/article/export-your-data/"],["rel","noopener"],["target","_blank"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["https://help.bitwarden.com/article/export-your-data/"])),(n()(),t.ɵted(-1,null,["\n "]))],null,null)}function I(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,4,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n See detailed instructions on our help site at\n "])),(n()(),t.ɵeld(2,0,null,null,1,"a",[["href","https://help.bitwarden.com/article/import-from-lastpass/"],["rel","noopener"],["target","_blank"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["https://help.bitwarden.com/article/import-from-lastpass/"])),(n()(),t.ɵted(-1,null,["\n "]))],null,null)}function A(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Using the KeePassX desktop application, navigate to "Database" → "Export to CSV file" and save the CSV file.\n ']))],null,null)}function E(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n In the Avira web vault, go to "Settings" → "My Data" → "Export data" and save the CSV file.\n ']))],null,null)}function O(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n In the Blur web vault, click your username at the top and go to "Settings" → "Export Data", then click "Export CSV"\n for your "Accounts".\n ']))],null,null)}function N(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Using the SaveInCloud desktop application, navigate to "File" → "Export" → "As XML" and save the XML file.\n ']))],null,null)}function T(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Using the Padlock desktop application, click the hamburger icon in the top left corner and navigate to "Settings" →\n "Export" button and save the file "As CSV".\n ']))],null,null)}function k(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Using the KeePass 2 desktop application, navigate to "File" → "Export" and select the "KeePass XML (2.x)" option.\n ']))],null,null)}function V(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Using the Universal Password Manager desktop application, navigate to "Database" → "Export" and save the CSV file.\n ']))],null,null)}function P(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Using the SaferPass browser extension, click the hamburger icon in the top left corner and navigate to "Settings". Click\n the "Export accounts" button to save the CSV file.\n ']))],null,null)}function M(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Using the Meldium web vault, navigate to "Settings". Locate the "Export data" function and click "Show me my data" to save\n the CSV file.\n ']))],null,null)}function x(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Log into the Keeper web vault (keepersecurity.com/vault). Navigate to "Backup" (top right) and find the "Export to .csv File"\n option. Click "Export Now" to save the CSV file.\n ']))],null,null)}function D(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"span",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n The process is exactly the same as importing from Google Chrome.\n "]))],null,null)}function U(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,7,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,D)),t.ɵdid(3,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n See detailed instructions on our help site at\n "])),(n()(),t.ɵeld(5,0,null,null,1,"a",[["href","https://help.bitwarden.com/article/import-from-chrome/"],["rel","noopener"],["target","_blank"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["https://help.bitwarden.com/article/import-from-chrome/"])),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){n(l,3,0,"chromecsv"!==l.component.format)},null)}function F(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,4,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n Use the\n "])),(n()(),t.ɵeld(2,0,null,null,1,"a",[["href","https://github.com/kspearrin/ff-password-exporter/blob/master/README.md#ff-password-exporter"],["rel","noopener"],["target","_blank"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["FF Password Exporter"])),(n()(),t.ɵted(-1,null,[" application to export your passwords to a CSV file.\n "]))],null,null)}function L(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,4,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n See detailed instructions on our help site at\n "])),(n()(),t.ɵeld(2,0,null,null,1,"a",[["href","https://help.bitwarden.com/article/import-from-1password/"],["rel","noopener"],["target","_blank"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["https://help.bitwarden.com/article/import-from-1password/"])),(n()(),t.ɵted(-1,null,[".\n "]))],null,null)}function G(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Using the Password Dragon desktop application, navigate to "File" → "Export" → "To XML". In the dialog that pops\n up select "All Rows" and check all fields. Click the "Export" button and save the XML file.\n ']))],null,null)}function q(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Using the Enpass desktop application, navigate to "File" → "Export" → "As CSV". Select "OK" to the warning alert\n and save the CSV file. Note that the importer only supports files exported while Enpass is set to the English\n language, so adjust your settings accordingly.\n ']))],null,null)}function z(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Using the Password Safe desktop application, navigate to "File" → "Export To" → "XML format..." and save the XML\n file.\n ']))],null,null)}function j(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Using the Dashlane desktop application, navigate to "File" → "Export" → "Unsecured archive (readable) in CSV format"\n and save the CSV file.\n ']))],null,null)}function B(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Using the mSecure desktop application, navigate to "File" → "Export" → "CSV File..." and save the CSV file.\n ']))],null,null)}function K(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Using the Sticky Password desktop application, navigate to "Menu" (top right) → "Export" → "Export all". Select\n the unencrypted format XML option and save the XML file.\n ']))],null,null)}function H(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Using the True Key desktop application, click the gear icon (top right) and then navigate to "App Settings". Click the "Export"\n button, enter your password and save the CSV file.\n ']))],null,null)}function $(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Log into the Clipperz web application (clipperz.is/app). Click the hamburger menu icon in the top right to expand the navigation\n bar. Navigate to "Data" → "Export". Click the "download HTML+JSON" button to save the HTML file.\n ']))],null,null)}function W(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Using the RoboForm Editor desktop application, navigate to "RoboForm" (top left) → "Options" → "Account & Data"\n and click the "Export" button. Select all of your data, change the "Format" to "CSV file" and then click the\n "Export" button to save the CSV file. Note: RoboForm only allows you to export Logins. Other items will not be\n exported.\n ']))],null,null)}function Y(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Log into the Passbolt web vault and navigate to the "Passwords" listing. Select all of the passwords you would like to export\n and click the "Export" button at the top of the listing. Choose the "csv (lastpass)" export format and click\n the "Export" button.\n ']))],null,null)}function Z(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Using the Ascendo DataVault desktop application, navigate to "Tools" → "Export". In the dialog that pops up, select\n the "All Items (DVX, CSV)" option. Click the "Ok" button to save the CSV file.\n ']))],null,null)}function J(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Using the Password Boss desktop application, navigate to "File" → "Export data" → "Password Boss JSON - not encrypted"\n and save the JSON file.\n ']))],null,null)}function X(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,4,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Log into the Zoho web vault (vault.zoho.com). Navigate to "Tools" → "Export Secrets". Select "All Secrets" and click\n the "Zoho Vault Format CSV" button. Highlight and copy the data from the textarea. Open a text editor like Notepad\n and paste the data. Save the data from the text editor as\n '])),(n()(),t.ɵeld(2,0,null,null,1,"code",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["zoho_export.csv"])),(n()(),t.ɵted(-1,null,[".\n "]))],null,null)}function Q(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Using the SplashID Safe desktop application, click on the SplashID blue lock logo in the top right corner. Navigate to "Export"\n → "Export as CSV" and save the CSV file.\n ']))],null,null)}function nn(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Using the PassKeep mobile app, navigate to "Backup/Restore". Locate the "CSV Backup/Restore" section and click "Backup to\n CSV" to save the CSV file.\n ']))],null,null)}function ln(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,16,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n Make sure you have python-keyring and python-gnomekeyring installed. Save the\n "])),(n()(),t.ɵeld(2,0,null,null,1,"a",[["href","https://bit.ly/2sMldAI"],["rel","noopener"],["target","_blank"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["GNOME Keyring Import/Export"])),(n()(),t.ɵted(-1,null,[" python script to your desktop as\n "])),(n()(),t.ɵeld(5,0,null,null,1,"code",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["pw_helper.py"])),(n()(),t.ɵted(-1,null,[". Open terminal and run\n "])),(n()(),t.ɵeld(8,0,null,null,1,"code",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["chmod +rx Desktop/pw_helper.py"])),(n()(),t.ɵted(-1,null,[" and then\n "])),(n()(),t.ɵeld(11,0,null,null,1,"code",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["python Desktop/pw_helper.py export Desktop/my_passwords.json"])),(n()(),t.ɵted(-1,null,[". Then upload the resulting\n "])),(n()(),t.ɵeld(14,0,null,null,1,"code",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["my_passwords.json"])),(n()(),t.ɵted(-1,null,[" file here to Bitwarden.\n "]))],null,null)}function en(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Using the Password Agent desktop application navigate to "File" → "Export", select the "Fields to export" button and\n check all of the fields, change the "Output format" to "CSV", and then click the "Start" button to save the CSV\n file.\n ']))],null,null)}function tn(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,98,"app-callout",[["type","info"]],null,null,null,i.View_CalloutComponent_0,i.RenderType_CalloutComponent)),t.ɵdid(1,114688,null,0,r.CalloutComponent,[a.I18nService],{type:[0,"type"],title:[1,"title"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,_)),t.ɵdid(4,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,I)),t.ɵdid(7,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,A)),t.ɵdid(10,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,E)),t.ɵdid(13,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,O)),t.ɵdid(16,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,N)),t.ɵdid(19,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,T)),t.ɵdid(22,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,k)),t.ɵdid(25,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,V)),t.ɵdid(28,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,P)),t.ɵdid(31,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,M)),t.ɵdid(34,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,x)),t.ɵdid(37,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,U)),t.ɵdid(40,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,F)),t.ɵdid(43,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,L)),t.ɵdid(46,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,G)),t.ɵdid(49,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,q)),t.ɵdid(52,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,z)),t.ɵdid(55,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,j)),t.ɵdid(58,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,B)),t.ɵdid(61,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,K)),t.ɵdid(64,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,H)),t.ɵdid(67,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,$)),t.ɵdid(70,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,W)),t.ɵdid(73,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,Y)),t.ɵdid(76,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,Z)),t.ɵdid(79,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,J)),t.ɵdid(82,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,X)),t.ɵdid(85,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,Q)),t.ɵdid(88,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,nn)),t.ɵdid(91,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,ln)),t.ɵdid(94,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,en)),t.ɵdid(97,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "]))],function(n,l){var e=l.component;n(l,1,0,"info",t.ɵinlineInterpolate(1,"",e.getFormatInstructionTitle(),"")),n(l,4,0,"bitwardencsv"===e.format),n(l,7,0,"lastpasscsv"===e.format),n(l,10,0,"keepassxcsv"===e.format),n(l,13,0,"aviracsv"===e.format),n(l,16,0,"blurcsv"===e.format),n(l,19,0,"safeincloudxml"===e.format),n(l,22,0,"padlockcsv"===e.format),n(l,25,0,"keepass2xml"===e.format),n(l,28,0,"upmcsv"===e.format),n(l,31,0,"saferpasscsv"===e.format),n(l,34,0,"meldiumcsv"===e.format),n(l,37,0,"keepercsv"===e.format),n(l,40,0,"chromecsv"===e.format||"operacsv"===e.format||"vivaldicsv"===e.format),n(l,43,0,"firefoxcsv"===e.format),n(l,46,0,"1password1pif"===e.format||"1passwordwincsv"===e.format),n(l,49,0,"passworddragonxml"===e.format),n(l,52,0,"enpasscsv"===e.format),n(l,55,0,"pwsafexml"===e.format),n(l,58,0,"dashlanecsv"===e.format),n(l,61,0,"msecurecsv"===e.format),n(l,64,0,"stickypasswordxml"===e.format),n(l,67,0,"truekeycsv"===e.format),n(l,70,0,"clipperzhtml"===e.format),n(l,73,0,"roboformcsv"===e.format),n(l,76,0,"passboltcsv"===e.format),n(l,79,0,"ascendocsv"===e.format),n(l,82,0,"passwordbossjson"===e.format),n(l,85,0,"zohovaultcsv"===e.format),n(l,88,0,"splashidcsv"===e.format),n(l,91,0,"passkeepcsv"===e.format),n(l,94,0,"gnomejson"===e.format),n(l,97,0,"passwordagentcsv"===e.format)},null)}function un(n){return t.ɵvid(0,[t.ɵpid(0,s.I18nPipe,[a.I18nService]),(n()(),t.ɵeld(1,0,null,null,5,"div",[["class","page-header"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(3,0,null,null,2,"h1",[],null,null,null,null,null)),(n()(),t.ɵted(4,null,["",""])),t.ɵppd(5,1),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵeld(8,0,[["form",1]],null,76,"form",[["ngNativeValidate",""]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngSubmit"],[null,"submit"],[null,"reset"]],function(n,l,e){var u=!0,o=n.component;"submit"===l&&(u=!1!==t.ɵnov(n,9).onSubmit(e)&&u);"reset"===l&&(u=!1!==t.ɵnov(n,9).onReset()&&u);"ngSubmit"===l&&(u=!1!==o.submit()&&u);return u},null,null)),t.ɵdid(9,4210688,null,0,u.NgForm,[[8,null],[8,null]],null,{ngSubmit:"ngSubmit"}),t.ɵprd(2048,null,u.ControlContainer,null,[u.NgForm]),t.ɵdid(11,16384,null,0,u.NgControlStatusGroup,[u.ControlContainer],null,null),t.ɵdid(12,540672,null,0,d.ApiActionDirective,[t.ElementRef,c.ValidationService],{appApiAction:[0,"appApiAction"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(14,0,null,null,27,"div",[["class","row"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(16,0,null,null,24,"div",[["class","col-6"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(18,0,null,null,21,"div",[["class","form-group"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(20,0,null,null,2,"label",[["for","type"]],null,null,null,null,null)),(n()(),t.ɵted(21,null,["1. ",""])),t.ɵppd(22,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(24,0,null,null,14,"select",[["class","form-control"],["id","type"],["name","Format"],["required",""]],[[1,"required",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"change"],[null,"blur"]],function(n,l,e){var u=!0,o=n.component;"change"===l&&(u=!1!==t.ɵnov(n,25).onChange(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,25).onTouched()&&u);"ngModelChange"===l&&(u=!1!==(o.format=e)&&u);return u},null,null)),t.ɵdid(25,16384,null,0,u.SelectControlValueAccessor,[t.Renderer2,t.ElementRef],null,null),t.ɵdid(26,16384,null,0,u.RequiredValidator,[],{required:[0,"required"]},null),t.ɵprd(1024,null,u.NG_VALIDATORS,function(n){return[n]},[u.RequiredValidator]),t.ɵprd(1024,null,u.NG_VALUE_ACCESSOR,function(n){return[n]},[u.SelectControlValueAccessor]),t.ɵdid(29,671744,null,0,u.NgModel,[[2,u.ControlContainer],[2,u.NG_VALIDATORS],[8,null],[2,u.NG_VALUE_ACCESSOR]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,u.NgControl,null,[u.NgModel]),t.ɵdid(31,16384,null,0,u.NgControlStatus,[u.NgControl],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,S)),t.ɵdid(34,802816,null,0,o.NgForOf,[t.ViewContainerRef,t.TemplateRef,t.IterableDiffers],{ngForOf:[0,"ngForOf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,R)),t.ɵdid(37,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,tn)),t.ɵdid(44,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(46,0,null,null,13,"div",[["class","row"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(48,0,null,null,10,"div",[["class","col-6"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(50,0,null,null,7,"div",[["class","form-group"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(52,0,null,null,2,"label",[["for","file"]],null,null,null,null,null)),(n()(),t.ɵted(53,null,["2. ",""])),t.ɵppd(54,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(56,0,null,null,0,"input",[["class","form-control-file"],["id","file"],["name","file"],["type","file"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(61,0,null,null,12,"div",[["class","form-group"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(63,0,null,null,2,"label",[["for","fileContents"]],null,null,null,null,null)),(n()(),t.ɵted(64,null,["",""])),t.ɵppd(65,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(67,0,null,null,5,"textarea",[["class","form-control"],["id","fileContents"],["name","FileContents"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(n,l,e){var u=!0,o=n.component;"input"===l&&(u=!1!==t.ɵnov(n,68)._handleInput(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,68).onTouched()&&u);"compositionstart"===l&&(u=!1!==t.ɵnov(n,68)._compositionStart()&&u);"compositionend"===l&&(u=!1!==t.ɵnov(n,68)._compositionEnd(e.target.value)&&u);"ngModelChange"===l&&(u=!1!==(o.fileContents=e)&&u);return u},null,null)),t.ɵdid(68,16384,null,0,u.DefaultValueAccessor,[t.Renderer2,t.ElementRef,[2,u.COMPOSITION_BUFFER_MODE]],null,null),t.ɵprd(1024,null,u.NG_VALUE_ACCESSOR,function(n){return[n]},[u.DefaultValueAccessor]),t.ɵdid(70,671744,null,0,u.NgModel,[[2,u.ControlContainer],[8,null],[8,null],[2,u.NG_VALUE_ACCESSOR]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,u.NgControl,null,[u.NgModel]),t.ɵdid(72,16384,null,0,u.NgControlStatus,[u.NgControl],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(75,0,null,null,8,"button",[["class","btn btn-primary btn-submit"],["type","submit"]],[[8,"disabled",0]],null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(77,0,null,null,1,"i",[["class","fa fa-spinner fa-spin"]],[[8,"title",0]],null,null,null,null)),t.ɵppd(78,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(80,0,null,null,2,"span",[],null,null,null,null,null)),(n()(),t.ɵted(81,null,["",""])),t.ɵppd(82,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){var e=l.component;n(l,12,0,e.formPromise);n(l,26,0,"");n(l,29,0,"Format",e.format),n(l,34,0,e.featuredImportOptions),n(l,37,0,e.importOptions&&e.importOptions.length),n(l,44,0,e.format);n(l,70,0,"FileContents",e.fileContents)},function(n,l){n(l,4,0,t.ɵunv(l,4,0,n(l,5,0,t.ɵnov(l,0),"importData"))),n(l,8,0,t.ɵnov(l,11).ngClassUntouched,t.ɵnov(l,11).ngClassTouched,t.ɵnov(l,11).ngClassPristine,t.ɵnov(l,11).ngClassDirty,t.ɵnov(l,11).ngClassValid,t.ɵnov(l,11).ngClassInvalid,t.ɵnov(l,11).ngClassPending),n(l,21,0,t.ɵunv(l,21,0,n(l,22,0,t.ɵnov(l,0),"selectFormat"))),n(l,24,0,t.ɵnov(l,26).required?"":null,t.ɵnov(l,31).ngClassUntouched,t.ɵnov(l,31).ngClassTouched,t.ɵnov(l,31).ngClassPristine,t.ɵnov(l,31).ngClassDirty,t.ɵnov(l,31).ngClassValid,t.ɵnov(l,31).ngClassInvalid,t.ɵnov(l,31).ngClassPending),n(l,53,0,t.ɵunv(l,53,0,n(l,54,0,t.ɵnov(l,0),"selectImportFile"))),n(l,64,0,t.ɵunv(l,64,0,n(l,65,0,t.ɵnov(l,0),"orCopyPasteFileContents"))),n(l,67,0,t.ɵnov(l,72).ngClassUntouched,t.ɵnov(l,72).ngClassTouched,t.ɵnov(l,72).ngClassPristine,t.ɵnov(l,72).ngClassDirty,t.ɵnov(l,72).ngClassValid,t.ɵnov(l,72).ngClassInvalid,t.ɵnov(l,72).ngClassPending),n(l,75,0,t.ɵnov(l,8).loading),n(l,77,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,77,0,n(l,78,0,t.ɵnov(l,0),"loading")),"")),n(l,81,0,t.ɵunv(l,81,0,n(l,82,0,t.ɵnov(l,0),"importData")))})}function on(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"app-org-import",[],null,null,null,un,b)),t.ɵdid(1,114688,null,0,p.ImportComponent,[a.I18nService,f.Angulartics2,v.ToasterService,h.CipherService,g.FolderService,m.ApiService,y.Router,C.CollectionService,y.ActivatedRoute],null,null)],function(n,l){n(l,1,0)},null)}l.RenderType_ImportComponent=b,l.View_ImportComponent_0=un,l.View_ImportComponent_Host_0=on;var rn=t.ɵccf("app-org-import",p.ImportComponent,on,{},{},[]);l.ImportComponentNgFactory=rn},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=e(0),u=e(7),o=e(2),i=e(10),r=e(5),a=e(253),s=t.ɵcrt({encapsulation:2,styles:[],data:{}});function d(n){return t.ɵvid(0,[t.ɵpid(0,u.I18nPipe,[o.I18nService]),(n()(),t.ɵeld(1,0,null,null,39,"div",[["class","container page-content"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(3,0,null,null,36,"div",[["class","row"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(5,0,null,null,27,"div",[["class","col-3"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(7,0,null,null,24,"div",[["class","card"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(9,0,null,null,2,"div",[["class","card-header"]],null,null,null,null,null)),(n()(),t.ɵted(10,null,["",""])),t.ɵppd(11,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(13,0,null,null,17,"div",[["class","list-group list-group-flush"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(15,0,null,null,6,"a",[["class","list-group-item"],["routerLink","import"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(n,l,e){var u=!0;"click"===l&&(u=!1!==t.ɵnov(n,16).onClick(e.button,e.ctrlKey,e.metaKey,e.shiftKey)&&u);return u},null,null)),t.ɵdid(16,671744,[[2,4]],0,i.RouterLinkWithHref,[i.Router,i.ActivatedRoute,r.LocationStrategy],{routerLink:[0,"routerLink"]},null),t.ɵdid(17,1720320,null,2,i.RouterLinkActive,[i.Router,t.ElementRef,t.Renderer2,t.ChangeDetectorRef],{routerLinkActive:[0,"routerLinkActive"]},null),t.ɵqud(603979776,1,{links:1}),t.ɵqud(603979776,2,{linksWithHrefs:1}),(n()(),t.ɵted(20,null,["\n ","\n "])),t.ɵppd(21,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(23,0,null,null,6,"a",[["class","list-group-item"],["routerLink","export"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(n,l,e){var u=!0;"click"===l&&(u=!1!==t.ɵnov(n,24).onClick(e.button,e.ctrlKey,e.metaKey,e.shiftKey)&&u);return u},null,null)),t.ɵdid(24,671744,[[4,4]],0,i.RouterLinkWithHref,[i.Router,i.ActivatedRoute,r.LocationStrategy],{routerLink:[0,"routerLink"]},null),t.ɵdid(25,1720320,null,2,i.RouterLinkActive,[i.Router,t.ElementRef,t.Renderer2,t.ChangeDetectorRef],{routerLinkActive:[0,"routerLinkActive"]},null),t.ɵqud(603979776,3,{links:1}),t.ɵqud(603979776,4,{linksWithHrefs:1}),(n()(),t.ɵted(28,null,["\n ","\n "])),t.ɵppd(29,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(34,0,null,null,4,"div",[["class","col-9"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(36,16777216,null,null,1,"router-outlet",[],null,null,null,null,null)),t.ɵdid(37,212992,null,0,i.RouterOutlet,[i.ChildrenOutletContexts,t.ViewContainerRef,t.ComponentFactoryResolver,[8,null],t.ChangeDetectorRef],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){n(l,16,0,"import");n(l,17,0,"active");n(l,24,0,"export");n(l,25,0,"active"),n(l,37,0)},function(n,l){n(l,10,0,t.ɵunv(l,10,0,n(l,11,0,t.ɵnov(l,0),"tools"))),n(l,15,0,t.ɵnov(l,16).target,t.ɵnov(l,16).href),n(l,20,0,t.ɵunv(l,20,0,n(l,21,0,t.ɵnov(l,0),"importData"))),n(l,23,0,t.ɵnov(l,24).target,t.ɵnov(l,24).href),n(l,28,0,t.ɵunv(l,28,0,n(l,29,0,t.ɵnov(l,0),"exportVault")))})}function c(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"app-org-tools",[],null,null,null,d,s)),t.ɵdid(1,49152,null,0,a.ToolsComponent,[],null,null)],null,null)}l.RenderType_ToolsComponent=s,l.View_ToolsComponent_0=d,l.View_ToolsComponent_Host_0=c;var p=t.ɵccf("app-org-tools",a.ToolsComponent,c,{},{},[]);l.ToolsComponentNgFactory=p},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0}),function(n){n[n.User_LoggedIn=1e3]="User_LoggedIn",n[n.User_ChangedPassword=1001]="User_ChangedPassword",n[n.User_Enabled2fa=1002]="User_Enabled2fa",n[n.User_Disabled2fa=1003]="User_Disabled2fa",n[n.User_Recovered2fa=1004]="User_Recovered2fa",n[n.User_FailedLogIn=1005]="User_FailedLogIn",n[n.User_FailedLogIn2fa=1006]="User_FailedLogIn2fa",n[n.Cipher_Created=1100]="Cipher_Created",n[n.Cipher_Updated=1101]="Cipher_Updated",n[n.Cipher_Deleted=1102]="Cipher_Deleted",n[n.Cipher_AttachmentCreated=1103]="Cipher_AttachmentCreated",n[n.Cipher_AttachmentDeleted=1104]="Cipher_AttachmentDeleted",n[n.Cipher_Shared=1105]="Cipher_Shared",n[n.Cipher_UpdatedCollections=1106]="Cipher_UpdatedCollections",n[n.Collection_Created=1300]="Collection_Created",n[n.Collection_Updated=1301]="Collection_Updated",n[n.Collection_Deleted=1302]="Collection_Deleted",n[n.Group_Created=1400]="Group_Created",n[n.Group_Updated=1401]="Group_Updated",n[n.Group_Deleted=1402]="Group_Deleted",n[n.OrganizationUser_Invited=1500]="OrganizationUser_Invited",n[n.OrganizationUser_Confirmed=1501]="OrganizationUser_Confirmed",n[n.OrganizationUser_Updated=1502]="OrganizationUser_Updated",n[n.OrganizationUser_Removed=1503]="OrganizationUser_Removed",n[n.OrganizationUser_UpdatedGroups=1504]="OrganizationUser_UpdatedGroups",n[n.Organization_Updated=1600]="Organization_Updated"}(l.EventType||(l.EventType={}))},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=e(0),u=e(13),o=e(92),i=e(60),r=e(5),a=e(566),s=e(281),d=e(131),c=e(61),p=e(565),f=e(8),v=e(7),h=e(2),g=e(256),m=e(26),y=e(3),C=e(9),b=e(4),S=t.ɵcrt({encapsulation:2,styles:[],data:{}});function w(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,8,"td",[["class","table-list-checkbox"]],null,[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.checkCipher(n.parent.context.$implicit)&&t);return t},null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,5,"input",[["type","checkbox"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"change"],[null,"blur"]],function(n,l,e){var u=!0;"change"===l&&(u=!1!==t.ɵnov(n,3).onChange(e.target.checked)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,3).onTouched()&&u);"ngModelChange"===l&&(u=!1!==(n.parent.context.$implicit.checked=e)&&u);return u},null,null)),t.ɵdid(3,16384,null,0,u.CheckboxControlValueAccessor,[t.Renderer2,t.ElementRef],null,null),t.ɵprd(1024,null,u.NG_VALUE_ACCESSOR,function(n){return[n]},[u.CheckboxControlValueAccessor]),t.ɵdid(5,671744,null,0,u.NgModel,[[8,null],[8,null],[8,null],[2,u.NG_VALUE_ACCESSOR]],{model:[0,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,u.NgControl,null,[u.NgModel]),t.ɵdid(7,16384,null,0,u.NgControlStatus,[u.NgControl],null,null),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){n(l,5,0,l.parent.context.$implicit.checked)},function(n,l){n(l,2,0,t.ɵnov(l,7).ngClassUntouched,t.ɵnov(l,7).ngClassTouched,t.ɵnov(l,7).ngClassPristine,t.ɵnov(l,7).ngClassDirty,t.ɵnov(l,7).ngClassValid,t.ɵnov(l,7).ngClassInvalid,t.ɵnov(l,7).ngClassPending)})}function R(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,2,"i",[["appStopProp",""],["class","fa fa-share-alt"]],[[8,"title",0]],[[null,"click"]],function(n,l,e){var u=!0;"click"===l&&(u=!1!==t.ɵnov(n,1).onClick(e)&&u);return u},null,null)),t.ɵdid(1,16384,null,0,o.StopPropDirective,[],null,null),t.ɵppd(2,1)],null,function(n,l){n(l,0,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,0,0,n(l,2,0,t.ɵnov(l.parent.parent.parent.parent,1),"shared")),""))})}function _(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,2,"i",[["appStopProp",""],["class","fa fa-paperclip"]],[[8,"title",0]],[[null,"click"]],function(n,l,e){var u=!0;"click"===l&&(u=!1!==t.ɵnov(n,1).onClick(e)&&u);return u},null,null)),t.ɵdid(1,16384,null,0,o.StopPropDirective,[],null,null),t.ɵppd(2,1)],null,function(n,l){n(l,0,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,0,0,n(l,2,0,t.ɵnov(l.parent.parent.parent.parent,1),"attachments")),""))})}function I(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,5,"a",[["appStopClick",""],["class","dropdown-item"],["href","#"]],null,[[null,"click"]],function(n,l,e){var u=!0,o=n.component;"click"===l&&(u=!1!==t.ɵnov(n,1).onClick(e)&&u);"click"===l&&(u=!1!==o.copy(n.parent.context.$implicit.login.password,"password","password")&&u);return u},null,null)),t.ɵdid(1,16384,null,0,i.StopClickDirective,[],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(3,0,null,null,0,"i",[["class","fa fa-fw fa-clipboard"]],null,null,null,null,null)),(n()(),t.ɵted(4,null,["\n ","\n "])),t.ɵppd(5,1)],null,function(n,l){n(l,4,0,t.ɵunv(l,4,0,n(l,5,0,t.ɵnov(l.parent.parent.parent.parent,1),"copyPassword")))})}function A(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,5,"a",[["appStopClick",""],["class","dropdown-item"],["href","#"]],null,[[null,"click"]],function(n,l,e){var u=!0,o=n.component;"click"===l&&(u=!1!==t.ɵnov(n,1).onClick(e)&&u);"click"===l&&(u=!1!==o.share(n.parent.context.$implicit)&&u);return u},null,null)),t.ɵdid(1,16384,null,0,i.StopClickDirective,[],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(3,0,null,null,0,"i",[["class","fa fa-fw fa-share-alt"]],null,null,null,null,null)),(n()(),t.ɵted(4,null,["\n ","\n "])),t.ɵppd(5,1)],null,function(n,l){n(l,4,0,t.ɵunv(l,4,0,n(l,5,0,t.ɵnov(l.parent.parent.parent.parent,1),"share")))})}function E(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,5,"a",[["appStopClick",""],["class","dropdown-item"],["href","#"]],null,[[null,"click"]],function(n,l,e){var u=!0,o=n.component;"click"===l&&(u=!1!==t.ɵnov(n,1).onClick(e)&&u);"click"===l&&(u=!1!==o.collections(n.parent.context.$implicit)&&u);return u},null,null)),t.ɵdid(1,16384,null,0,i.StopClickDirective,[],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(3,0,null,null,0,"i",[["class","fa fa-fw fa-cubes"]],null,null,null,null,null)),(n()(),t.ɵted(4,null,["\n ","\n "])),t.ɵppd(5,1)],null,function(n,l){n(l,4,0,t.ɵunv(l,4,0,n(l,5,0,t.ɵnov(l.parent.parent.parent.parent,1),"collections")))})}function O(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,5,"a",[["appStopClick",""],["class","dropdown-item"],["href","#"]],null,[[null,"click"]],function(n,l,e){var u=!0,o=n.component;"click"===l&&(u=!1!==t.ɵnov(n,1).onClick(e)&&u);"click"===l&&(u=!1!==o.events(n.parent.context.$implicit)&&u);return u},null,null)),t.ɵdid(1,16384,null,0,i.StopClickDirective,[],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(3,0,null,null,0,"i",[["class","fa fa-fw fa-file-text-o"]],null,null,null,null,null)),(n()(),t.ɵted(4,null,["\n ","\n "])),t.ɵppd(5,1)],null,function(n,l){n(l,4,0,t.ɵunv(l,4,0,n(l,5,0,t.ɵnov(l.parent.parent.parent.parent,1),"eventLogs")))})}function N(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,71,"tr",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,w)),t.ɵdid(3,16384,null,0,r.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(5,0,null,null,4,"td",[["class","table-list-icon"]],null,[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.checkCipher(n.context.$implicit)&&t);return t},null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(7,0,null,null,1,"app-vault-icon",[],null,null,null,a.View_IconComponent_0,a.RenderType_IconComponent)),t.ɵdid(8,573440,null,0,s.IconComponent,[d.EnvironmentService,c.StateService],{cipher:[0,"cipher"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(11,0,null,null,19,"td",[["class","reduced-lh"]],null,[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.checkCipher(n.context.$implicit)&&t);return t},null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(13,0,null,null,4,"a",[["appStopClick",""],["appStopProp",""],["href","#"]],[[8,"title",0]],[[null,"click"]],function(n,l,e){var u=!0,o=n.component;"click"===l&&(u=!1!==t.ɵnov(n,14).onClick(e)&&u);"click"===l&&(u=!1!==t.ɵnov(n,15).onClick(e)&&u);"click"===l&&(u=!1!==o.selectCipher(n.context.$implicit)&&u);return u},null,null)),t.ɵdid(14,16384,null,0,i.StopClickDirective,[],null,null),t.ɵdid(15,16384,null,0,o.StopPropDirective,[],null,null),t.ɵppd(16,1),(n()(),t.ɵted(17,null,["",""])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,R)),t.ɵdid(20,16384,null,0,r.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,_)),t.ɵdid(23,16384,null,0,r.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(25,0,null,null,0,"br",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(27,0,null,null,2,"small",[["appStopProp",""]],null,[[null,"click"]],function(n,l,e){var u=!0;"click"===l&&(u=!1!==t.ɵnov(n,28).onClick(e)&&u);return u},null,null)),t.ɵdid(28,16384,null,0,o.StopPropDirective,[],null,null),(n()(),t.ɵted(29,null,["",""])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(32,0,null,null,38,"td",[["class","table-list-options"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(34,0,null,null,35,"div",[["appListDropdown",""],["class","dropdown"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(36,0,null,null,3,"button",[["aria-expanded","false"],["aria-haspopup","true"],["class","btn btn-outline-secondary dropdown-toggle"],["data-toggle","dropdown"],["id","dropdownMenuButton"],["type","button"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(38,0,null,null,0,"i",[["class","fa fa-cog fa-lg"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(41,0,null,null,27,"div",[["aria-labelledby","dropdownMenuButton"],["class","dropdown-menu dropdown-menu-right"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,I)),t.ɵdid(44,16384,null,0,r.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(46,0,null,null,5,"a",[["appStopClick",""],["class","dropdown-item"],["href","#"]],null,[[null,"click"]],function(n,l,e){var u=!0,o=n.component;"click"===l&&(u=!1!==t.ɵnov(n,47).onClick(e)&&u);"click"===l&&(u=!1!==o.attachments(n.context.$implicit)&&u);return u},null,null)),t.ɵdid(47,16384,null,0,i.StopClickDirective,[],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(49,0,null,null,0,"i",[["class","fa fa-fw fa-paperclip"]],null,null,null,null,null)),(n()(),t.ɵted(50,null,["\n ","\n "])),t.ɵppd(51,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,A)),t.ɵdid(54,16384,null,0,r.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,E)),t.ɵdid(57,16384,null,0,r.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,O)),t.ɵdid(60,16384,null,0,r.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(62,0,null,null,5,"a",[["appStopClick",""],["class","dropdown-item text-danger"],["href","#"]],null,[[null,"click"]],function(n,l,e){var u=!0,o=n.component;"click"===l&&(u=!1!==t.ɵnov(n,63).onClick(e)&&u);"click"===l&&(u=!1!==o.delete(n.context.$implicit)&&u);return u},null,null)),t.ɵdid(63,16384,null,0,i.StopClickDirective,[],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(65,0,null,null,0,"i",[["class","fa fa-fw fa-trash-o"]],null,null,null,null,null)),(n()(),t.ɵted(66,null,["\n ","\n "])),t.ɵppd(67,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){var e=l.component;n(l,3,0,!e.organization),n(l,8,0,l.context.$implicit),n(l,20,0,!e.organization&&l.context.$implicit.organizationId),n(l,23,0,l.context.$implicit.hasAttachments),n(l,44,0,l.context.$implicit.type===e.cipherType.Login),n(l,54,0,!e.organization&&!l.context.$implicit.organizationId),n(l,57,0,l.context.$implicit.organizationId),n(l,60,0,l.context.$implicit.organizationId&&e.accessEvents)},function(n,l){n(l,13,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,13,0,n(l,16,0,t.ɵnov(l.parent.parent.parent,1),"editItem")),"")),n(l,17,0,l.context.$implicit.name),n(l,29,0,l.context.$implicit.subTitle),n(l,50,0,t.ɵunv(l,50,0,n(l,51,0,t.ɵnov(l.parent.parent.parent,1),"attachments"))),n(l,66,0,t.ɵunv(l,66,0,n(l,67,0,t.ɵnov(l.parent.parent.parent,1),"delete")))})}function T(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,7,"table",[["class","table table-hover table-list table-ciphers"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,4,"tbody",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,N)),t.ɵdid(5,802816,null,0,r.NgForOf,[t.ViewContainerRef,t.TemplateRef,t.IterableDiffers],{ngForOf:[0,"ngForOf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){n(l,5,0,l.parent.context.ngIf)},null)}function k(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"i",[["class","fa fa-spinner fa-spin text-muted"]],[[8,"title",0]],null,null,null,null)),t.ɵppd(1,1)],null,function(n,l){n(l,0,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,0,0,n(l,1,0,t.ɵnov(l.parent.parent.parent,1),"loading")),""))})}function V(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,4,"button",[["class","btn btn-outline-primary"]],null,[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.addCipher()&&t);return t},null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,0,"i",[["class","fa fa-plus fa-fw"]],null,null,null,null,null)),(n()(),t.ɵted(3,null,["",""])),t.ɵppd(4,1)],null,function(n,l){n(l,3,0,t.ɵunv(l,3,0,n(l,4,0,t.ɵnov(l.parent.parent.parent.parent,1),"addItem")))})}function P(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,8,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,2,"p",[],null,null,null,null,null)),(n()(),t.ɵted(3,null,["",""])),t.ɵppd(4,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,V)),t.ɵdid(7,16384,null,0,r.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){n(l,7,0,l.component.showAddNew)},function(n,l){n(l,3,0,t.ɵunv(l,3,0,n(l,4,0,t.ɵnov(l.parent.parent.parent,1),"noItemsInList")))})}function M(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,7,"div",[["class","no-items"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,k)),t.ɵdid(3,16384,null,0,r.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,P)),t.ɵdid(6,16384,null,0,r.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){var e=l.component;n(l,3,0,!e.loaded),n(l,6,0,e.loaded)},null)}function x(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,7,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,T)),t.ɵdid(3,16384,null,0,r.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,M)),t.ɵdid(6,16384,null,0,r.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){n(l,3,0,l.context.ngIf.length>0),n(l,6,0,0===l.context.ngIf.length)},null)}function D(n){return t.ɵvid(0,[t.ɵpid(0,p.SearchCiphersPipe,[f.PlatformUtilsService]),t.ɵpid(0,v.I18nPipe,[h.I18nService]),(n()(),t.ɵand(16777216,null,null,2,null,x)),t.ɵdid(3,16384,null,0,r.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),t.ɵppd(4,2),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){var e=l.component;n(l,3,0,t.ɵunv(l,3,0,n(l,4,0,t.ɵnov(l,0),e.ciphers,e.searchText)))},null)}function U(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"app-org-vault-ciphers",[],null,null,null,D,S)),t.ɵdid(1,49152,null,0,g.CiphersComponent,[m.CipherService,y.Angulartics2,C.ToasterService,h.I18nService,f.PlatformUtilsService,b.ApiService],null,null)],null,null)}l.RenderType_CiphersComponent=S,l.View_CiphersComponent_0=D,l.View_CiphersComponent_Host_0=U;var F=t.ɵccf("app-org-vault-ciphers",g.CiphersComponent,U,{activeCipherId:"activeCipherId",showAddNew:"showAddNew"},{onCipherClicked:"onCipherClicked",onCipherRightClicked:"onCipherRightClicked",onAddCipher:"onAddCipher",onAddCipherOptions:"onAddCipherOptions",onAttachmentsClicked:"onAttachmentsClicked",onShareClicked:"onShareClicked",onCollectionsClicked:"onCollectionsClicked",onEventsClicked:"onEventsClicked"},[]);l.CiphersComponentNgFactory=F},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=e(0),u=e(5),o=e(60),i=e(7),r=e(2),a=e(13),s=e(87),d=e(257),c=e(44),p=e(50),f=e(4),v=t.ɵcrt({encapsulation:2,styles:[],data:{}});function h(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,10,"li",[],null,null,null,null,null)),t.ɵdid(1,278528,null,0,u.NgClass,[t.IterableDiffers,t.KeyValueDiffers,t.ElementRef,t.Renderer2],{ngClass:[0,"ngClass"]},null),t.ɵpod(2,{active:0}),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(4,0,null,null,5,"a",[["appStopClick",""],["href","#"]],null,[[null,"click"]],function(n,l,e){var u=!0,o=n.component;"click"===l&&(u=!1!==t.ɵnov(n,5).onClick(e)&&u);"click"===l&&(u=!1!==o.selectFavorites()&&u);return u},null,null)),t.ɵdid(5,16384,null,0,o.StopClickDirective,[],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(7,0,null,null,0,"i",[["class","fa-li fa fa-fw fa-star"]],null,null,null,null,null)),(n()(),t.ɵted(8,null,["","\n "])),t.ɵppd(9,1),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){n(l,1,0,n(l,2,0,l.component.selectedFavorites))},function(n,l){n(l,8,0,t.ɵunv(l,8,0,n(l,9,0,t.ɵnov(l.parent,0),"favorites")))})}function g(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,4,"p",[["class","text-muted"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,1,"i",[["class","fa fa-spinner fa-spin"]],[[8,"title",0]],null,null,null,null)),t.ɵppd(3,1),(n()(),t.ɵted(-1,null,["\n "]))],null,function(n,l){n(l,2,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,2,0,n(l,3,0,t.ɵnov(l.parent,0),"loading")),""))})}function m(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,5,"a",[["appStopClick",""],["class","text-muted ml-auto show-active"],["href","#"]],[[8,"title",0]],[[null,"click"]],function(n,l,e){var u=!0,o=n.component;"click"===l&&(u=!1!==t.ɵnov(n,1).onClick(e)&&u);"click"===l&&(u=!1!==o.editFolder(n.parent.context.$implicit)&&u);return u},null,null)),t.ɵdid(1,16384,null,0,o.StopClickDirective,[],null,null),t.ɵppd(2,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(4,0,null,null,0,"i",[["class","fa fa-pencil fa-fw"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "]))],null,function(n,l){n(l,0,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,0,0,n(l,2,0,t.ɵnov(l.parent.parent.parent.parent,0),"editFolder")),""))})}function y(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,12,"li",[["class","d-flex"]],null,null,null,null,null)),t.ɵdid(1,278528,null,0,u.NgClass,[t.IterableDiffers,t.KeyValueDiffers,t.ElementRef,t.Renderer2],{klass:[0,"klass"],ngClass:[1,"ngClass"]},null),t.ɵpod(2,{active:0}),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(4,0,null,null,4,"a",[["appStopClick",""],["href","#"]],null,[[null,"click"]],function(n,l,e){var u=!0,o=n.component;"click"===l&&(u=!1!==t.ɵnov(n,5).onClick(e)&&u);"click"===l&&(u=!1!==o.selectFolder(n.context.$implicit)&&u);return u},null,null)),t.ɵdid(5,16384,null,0,o.StopClickDirective,[],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(7,0,null,null,0,"i",[["class","fa-li fa fa-caret-right"]],null,null,null,null,null)),(n()(),t.ɵted(8,null,[" ",""])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,m)),t.ɵdid(11,16384,null,0,u.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){var e=l.component;n(l,1,0,"d-flex",n(l,2,0,e.selectedFolder&&l.context.$implicit.id===e.selectedFolderId)),n(l,11,0,l.context.$implicit.id)},function(n,l){n(l,8,0,l.context.$implicit.name)})}function C(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,18,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,9,"h3",[["class","d-flex"]],null,null,null,null,null)),(n()(),t.ɵted(3,null,["\n ","\n "])),t.ɵppd(4,1),(n()(),t.ɵeld(5,0,null,null,5,"a",[["appStopClick",""],["class","text-muted ml-auto"],["href","#"]],[[8,"title",0]],[[null,"click"]],function(n,l,e){var u=!0,o=n.component;"click"===l&&(u=!1!==t.ɵnov(n,6).onClick(e)&&u);"click"===l&&(u=!1!==o.addFolder()&&u);return u},null,null)),t.ɵdid(6,16384,null,0,o.StopClickDirective,[],null,null),t.ɵppd(7,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(9,0,null,null,0,"i",[["class","fa fa-plus fa-fw"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(13,0,null,null,4,"ul",[["class","fa-ul card-ul carets"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,y)),t.ɵdid(16,802816,null,0,u.NgForOf,[t.ViewContainerRef,t.TemplateRef,t.IterableDiffers],{ngForOf:[0,"ngForOf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){n(l,16,0,l.component.folders)},function(n,l){n(l,3,0,t.ɵunv(l,3,0,n(l,4,0,t.ɵnov(l.parent.parent,0),"folders"))),n(l,5,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,5,0,n(l,7,0,t.ɵnov(l.parent.parent,0),"addFolder")),""))})}function b(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,9,"li",[],null,null,null,null,null)),t.ɵdid(1,278528,null,0,u.NgClass,[t.IterableDiffers,t.KeyValueDiffers,t.ElementRef,t.Renderer2],{ngClass:[0,"ngClass"]},null),t.ɵpod(2,{active:0}),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(4,0,null,null,4,"a",[["appStopClick",""],["href","#"]],null,[[null,"click"]],function(n,l,e){var u=!0,o=n.component;"click"===l&&(u=!1!==t.ɵnov(n,5).onClick(e)&&u);"click"===l&&(u=!1!==o.selectCollection(n.context.$implicit)&&u);return u},null,null)),t.ɵdid(5,16384,null,0,o.StopClickDirective,[],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(7,0,null,null,0,"i",[["class","fa-li fa fa-caret-right"]],null,null,null,null,null)),(n()(),t.ɵted(8,null,[" ",""])),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){var e=l.component;n(l,1,0,n(l,2,0,l.context.$implicit.id===e.selectedCollectionId))},function(n,l){n(l,8,0,l.context.$implicit.name)})}function S(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,11,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,2,"h3",[],null,null,null,null,null)),(n()(),t.ɵted(3,null,["",""])),t.ɵppd(4,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(6,0,null,null,4,"ul",[["class","fa-ul card-ul carets"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,b)),t.ɵdid(9,802816,null,0,u.NgForOf,[t.ViewContainerRef,t.TemplateRef,t.IterableDiffers],{ngForOf:[0,"ngForOf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){n(l,9,0,l.component.collections)},function(n,l){n(l,3,0,t.ɵunv(l,3,0,n(l,4,0,t.ɵnov(l.parent.parent,0),"collections")))})}function w(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,7,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,C)),t.ɵdid(3,16384,null,0,u.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,S)),t.ɵdid(6,16384,null,0,u.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){var e=l.component;n(l,3,0,e.showFolders),n(l,6,0,e.showCollections&&e.collections&&e.collections.length)},null)}function R(n){return t.ɵvid(0,[t.ɵpid(0,i.I18nPipe,[r.I18nService]),(n()(),t.ɵeld(1,0,null,null,95,"div",[["class","card vault-filters"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(3,0,null,null,1,"div",[["class","card-header"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n Filters\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(6,0,null,null,89,"div",[["class","card-body"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(8,0,null,null,7,"input",[["appAutofocus",""],["class","form-control"],["id","search"],["type","search"]],[[8,"placeholder",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(n,l,e){var u=!0,o=n.component;"input"===l&&(u=!1!==t.ɵnov(n,9)._handleInput(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,9).onTouched()&&u);"compositionstart"===l&&(u=!1!==t.ɵnov(n,9)._compositionStart()&&u);"compositionend"===l&&(u=!1!==t.ɵnov(n,9)._compositionEnd(e.target.value)&&u);"ngModelChange"===l&&(u=!1!==(o.searchText=e)&&u);"input"===l&&(u=!1!==o.searchTextChanged()&&u);return u},null,null)),t.ɵdid(9,16384,null,0,a.DefaultValueAccessor,[t.Renderer2,t.ElementRef,[2,a.COMPOSITION_BUFFER_MODE]],null,null),t.ɵprd(1024,null,a.NG_VALUE_ACCESSOR,function(n){return[n]},[a.DefaultValueAccessor]),t.ɵdid(11,671744,null,0,a.NgModel,[[8,null],[8,null],[8,null],[2,a.NG_VALUE_ACCESSOR]],{model:[0,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,a.NgControl,null,[a.NgModel]),t.ɵdid(13,16384,null,0,a.NgControlStatus,[a.NgControl],null,null),t.ɵdid(14,81920,null,0,s.AutofocusDirective,[t.ElementRef],{appAutofocus:[0,"appAutofocus"]},null),t.ɵppd(15,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(17,0,null,null,16,"ul",[["class","fa-ul card-ul"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(19,0,null,null,10,"li",[],null,null,null,null,null)),t.ɵdid(20,278528,null,0,u.NgClass,[t.IterableDiffers,t.KeyValueDiffers,t.ElementRef,t.Renderer2],{ngClass:[0,"ngClass"]},null),t.ɵpod(21,{active:0}),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(23,0,null,null,5,"a",[["appStopClick",""],["href","#"]],null,[[null,"click"]],function(n,l,e){var u=!0,o=n.component;"click"===l&&(u=!1!==t.ɵnov(n,24).onClick(e)&&u);"click"===l&&(u=!1!==o.selectAll()&&u);return u},null,null)),t.ɵdid(24,16384,null,0,o.StopClickDirective,[],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(26,0,null,null,0,"i",[["class","fa-li fa fa-fw fa-th"]],null,null,null,null,null)),(n()(),t.ɵted(27,null,["","\n "])),t.ɵppd(28,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,h)),t.ɵdid(32,16384,null,0,u.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(35,0,null,null,2,"h3",[],null,null,null,null,null)),(n()(),t.ɵted(36,null,["",""])),t.ɵppd(37,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(39,0,null,null,49,"ul",[["class","fa-ul card-ul"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(41,0,null,null,10,"li",[],null,null,null,null,null)),t.ɵdid(42,278528,null,0,u.NgClass,[t.IterableDiffers,t.KeyValueDiffers,t.ElementRef,t.Renderer2],{ngClass:[0,"ngClass"]},null),t.ɵpod(43,{active:0}),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(45,0,null,null,5,"a",[["appStopClick",""],["href","#"]],null,[[null,"click"]],function(n,l,e){var u=!0,o=n.component;"click"===l&&(u=!1!==t.ɵnov(n,46).onClick(e)&&u);"click"===l&&(u=!1!==o.selectType(o.cipherType.Login)&&u);return u},null,null)),t.ɵdid(46,16384,null,0,o.StopClickDirective,[],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(48,0,null,null,0,"i",[["class","fa-li fa fa-fw fa-globe"]],null,null,null,null,null)),(n()(),t.ɵted(49,null,["","\n "])),t.ɵppd(50,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(53,0,null,null,10,"li",[],null,null,null,null,null)),t.ɵdid(54,278528,null,0,u.NgClass,[t.IterableDiffers,t.KeyValueDiffers,t.ElementRef,t.Renderer2],{ngClass:[0,"ngClass"]},null),t.ɵpod(55,{active:0}),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(57,0,null,null,5,"a",[["appStopClick",""],["href","#"]],null,[[null,"click"]],function(n,l,e){var u=!0,o=n.component;"click"===l&&(u=!1!==t.ɵnov(n,58).onClick(e)&&u);"click"===l&&(u=!1!==o.selectType(o.cipherType.Card)&&u);return u},null,null)),t.ɵdid(58,16384,null,0,o.StopClickDirective,[],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(60,0,null,null,0,"i",[["class","fa-li fa fa-fw fa-credit-card"]],null,null,null,null,null)),(n()(),t.ɵted(61,null,["","\n "])),t.ɵppd(62,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(65,0,null,null,10,"li",[],null,null,null,null,null)),t.ɵdid(66,278528,null,0,u.NgClass,[t.IterableDiffers,t.KeyValueDiffers,t.ElementRef,t.Renderer2],{ngClass:[0,"ngClass"]},null),t.ɵpod(67,{active:0}),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(69,0,null,null,5,"a",[["appStopClick",""],["href","#"]],null,[[null,"click"]],function(n,l,e){var u=!0,o=n.component;"click"===l&&(u=!1!==t.ɵnov(n,70).onClick(e)&&u);"click"===l&&(u=!1!==o.selectType(o.cipherType.Identity)&&u);return u},null,null)),t.ɵdid(70,16384,null,0,o.StopClickDirective,[],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(72,0,null,null,0,"i",[["class","fa-li fa fa-fw fa-id-card-o"]],null,null,null,null,null)),(n()(),t.ɵted(73,null,["","\n "])),t.ɵppd(74,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(77,0,null,null,10,"li",[],null,null,null,null,null)),t.ɵdid(78,278528,null,0,u.NgClass,[t.IterableDiffers,t.KeyValueDiffers,t.ElementRef,t.Renderer2],{ngClass:[0,"ngClass"]},null),t.ɵpod(79,{active:0}),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(81,0,null,null,5,"a",[["appStopClick",""],["href","#"]],null,[[null,"click"]],function(n,l,e){var u=!0,o=n.component;"click"===l&&(u=!1!==t.ɵnov(n,82).onClick(e)&&u);"click"===l&&(u=!1!==o.selectType(o.cipherType.SecureNote)&&u);return u},null,null)),t.ɵdid(82,16384,null,0,o.StopClickDirective,[],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(84,0,null,null,0,"i",[["class","fa-li fa fa-fw fa-sticky-note-o"]],null,null,null,null,null)),(n()(),t.ɵted(85,null,["","\n "])),t.ɵppd(86,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,g)),t.ɵdid(91,16384,null,0,u.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,w)),t.ɵdid(94,16384,null,0,u.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){var e=l.component;n(l,11,0,e.searchText);n(l,14,0,""),n(l,20,0,n(l,21,0,e.selectedAll)),n(l,32,0,e.showFavorites),n(l,42,0,n(l,43,0,e.selectedType===e.cipherType.Login)),n(l,54,0,n(l,55,0,e.selectedType===e.cipherType.Card)),n(l,66,0,n(l,67,0,e.selectedType===e.cipherType.Identity)),n(l,78,0,n(l,79,0,e.selectedType===e.cipherType.SecureNote)),n(l,91,0,!e.loaded),n(l,94,0,e.loaded)},function(n,l){var e=l.component;n(l,8,0,t.ɵinlineInterpolate(1,"",e.searchPlaceholder||t.ɵunv(l,8,0,n(l,15,0,t.ɵnov(l,0),"searchVault")),""),t.ɵnov(l,13).ngClassUntouched,t.ɵnov(l,13).ngClassTouched,t.ɵnov(l,13).ngClassPristine,t.ɵnov(l,13).ngClassDirty,t.ɵnov(l,13).ngClassValid,t.ɵnov(l,13).ngClassInvalid,t.ɵnov(l,13).ngClassPending),n(l,27,0,t.ɵunv(l,27,0,n(l,28,0,t.ɵnov(l,0),"allItems"))),n(l,36,0,t.ɵunv(l,36,0,n(l,37,0,t.ɵnov(l,0),"types"))),n(l,49,0,t.ɵunv(l,49,0,n(l,50,0,t.ɵnov(l,0),"typeLogin"))),n(l,61,0,t.ɵunv(l,61,0,n(l,62,0,t.ɵnov(l,0),"typeCard"))),n(l,73,0,t.ɵunv(l,73,0,n(l,74,0,t.ɵnov(l,0),"typeIdentity"))),n(l,85,0,t.ɵunv(l,85,0,n(l,86,0,t.ɵnov(l,0),"typeSecureNote")))})}function _(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"app-org-vault-groupings",[],null,null,null,R,v)),t.ɵdid(1,49152,null,0,d.GroupingsComponent,[c.CollectionService,p.FolderService,f.ApiService,r.I18nService],null,null)],null,null)}l.RenderType_GroupingsComponent=v,l.View_GroupingsComponent_0=R,l.View_GroupingsComponent_Host_0=_;var I=t.ɵccf("app-org-vault-groupings",d.GroupingsComponent,_,{showFolders:"showFolders",showCollections:"showCollections",showFavorites:"showFavorites"},{onAllClicked:"onAllClicked",onFavoritesClicked:"onFavoritesClicked",onCipherTypeClicked:"onCipherTypeClicked",onFolderClicked:"onFolderClicked",onAddFolder:"onAddFolder",onEditFolder:"onEditFolder",onCollectionClicked:"onCollectionClicked",onSearchTextChanged:"onSearchTextChanged"},[]);l.GroupingsComponentNgFactory=I},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=e(0),u=e(7),o=e(2),i=e(729),r=e(257),a=e(44),s=e(50),d=e(4),c=e(728),p=e(256),f=e(26),v=e(3),h=e(9),g=e(8),m=e(255),y=e(10),C=e(21),b=e(5),S=e(66),w=e(27),R=t.ɵcrt({encapsulation:2,styles:[],data:{}});function _(n){return t.ɵvid(0,[(n()(),t.ɵand(0,null,null,0))],null,null)}function I(n){return t.ɵvid(0,[(n()(),t.ɵand(0,null,null,0))],null,null)}function A(n){return t.ɵvid(0,[(n()(),t.ɵand(0,null,null,0))],null,null)}function E(n){return t.ɵvid(0,[(n()(),t.ɵand(0,null,null,0))],null,null)}function O(n){return t.ɵvid(0,[t.ɵpid(0,u.I18nPipe,[o.I18nService]),t.ɵqud(402653184,1,{groupingsComponent:0}),t.ɵqud(402653184,2,{ciphersComponent:0}),t.ɵqud(402653184,3,{attachmentsModalRef:0}),t.ɵqud(402653184,4,{cipherAddEditModalRef:0}),t.ɵqud(402653184,5,{collectionsModalRef:0}),t.ɵqud(402653184,6,{eventsModalRef:0}),(n()(),t.ɵeld(7,0,null,null,31,"div",[["class","container page-content"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(9,0,null,null,28,"div",[["class","row"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(11,0,null,null,5,"div",[["class","col-3"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(13,0,null,null,2,"app-org-vault-groupings",[],null,[[null,"onAllClicked"],[null,"onCipherTypeClicked"],[null,"onCollectionClicked"],[null,"onSearchTextChanged"]],function(n,l,e){var t=!0,u=n.component;"onAllClicked"===l&&(t=!1!==u.clearGroupingFilters()&&t);"onCipherTypeClicked"===l&&(t=!1!==u.filterCipherType(e)&&t);"onCollectionClicked"===l&&(t=!1!==u.filterCollection(e.id)&&t);"onSearchTextChanged"===l&&(t=!1!==u.filterSearchText(e)&&t);return t},i.View_GroupingsComponent_0,i.RenderType_GroupingsComponent)),t.ɵdid(14,49152,[[1,4]],0,r.GroupingsComponent,[a.CollectionService,s.FolderService,d.ApiService,o.I18nService],{showFolders:[0,"showFolders"],showFavorites:[1,"showFavorites"]},{onAllClicked:"onAllClicked",onCipherTypeClicked:"onCipherTypeClicked",onCollectionClicked:"onCollectionClicked",onSearchTextChanged:"onSearchTextChanged"}),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(18,0,null,null,18,"div",[["class","col-9"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(20,0,null,null,11,"div",[["class","page-header d-flex"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(22,0,null,null,2,"h1",[],null,null,null,null,null)),(n()(),t.ɵted(23,null,["",""])),t.ɵppd(24,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(26,0,null,null,4,"button",[["class","btn btn-outline-primary btn-sm ml-auto"],["type","button"]],null,[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.addCipher()&&t);return t},null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(28,0,null,null,0,"i",[["class","fa fa-plus fa-fw"]],null,null,null,null,null)),(n()(),t.ɵted(29,null,["","\n "])),t.ɵppd(30,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(33,0,null,null,2,"app-org-vault-ciphers",[],null,[[null,"onCipherClicked"],[null,"onAttachmentsClicked"],[null,"onAddCipher"],[null,"onCollectionsClicked"],[null,"onEventsClicked"]],function(n,l,e){var t=!0,u=n.component;"onCipherClicked"===l&&(t=!1!==u.editCipher(e)&&t);"onAttachmentsClicked"===l&&(t=!1!==u.editCipherAttachments(e)&&t);"onAddCipher"===l&&(t=!1!==u.addCipher()&&t);"onCollectionsClicked"===l&&(t=!1!==u.editCipherCollections(e)&&t);"onEventsClicked"===l&&(t=!1!==u.viewEvents(e)&&t);return t},c.View_CiphersComponent_0,c.RenderType_CiphersComponent)),t.ɵdid(34,49152,[[2,4]],0,p.CiphersComponent,[f.CipherService,v.Angulartics2,h.ToasterService,o.I18nService,g.PlatformUtilsService,d.ApiService],null,{onCipherClicked:"onCipherClicked",onAddCipher:"onAddCipher",onAttachmentsClicked:"onAttachmentsClicked",onCollectionsClicked:"onCollectionsClicked",onEventsClicked:"onEventsClicked"}),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,[[3,3],["attachments",2]],null,0,null,_)),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,[[4,3],["cipherAddEdit",2]],null,0,null,I)),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,[[5,3],["collections",2]],null,0,null,A)),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,[[6,3],["eventsTemplate",2]],null,0,null,E)),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){n(l,14,0,!1,!1)},function(n,l){n(l,23,0,t.ɵunv(l,23,0,n(l,24,0,t.ɵnov(l,0),"vault"))),n(l,29,0,t.ɵunv(l,29,0,n(l,30,0,t.ɵnov(l,0),"addItem")))})}function N(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"app-org-vault",[],null,null,null,O,R)),t.ɵdid(1,114688,null,0,m.VaultComponent,[y.ActivatedRoute,C.UserService,b.Location,y.Router,S.SyncService,o.I18nService,t.ComponentFactoryResolver,w.MessagingService],null,null)],function(n,l){n(l,1,0)},null)}l.RenderType_VaultComponent=R,l.View_VaultComponent_0=O,l.View_VaultComponent_Host_0=N;var T=t.ɵccf("app-org-vault",m.VaultComponent,N,{},{},[]);l.VaultComponentNgFactory=T},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=e(0),u=e(10),o=e(5),i=e(130),r=e(116),a=e(42),s=e(7),d=e(2),c=e(569),p=e(284),f=e(27),v=e(8),h=e(35),g=e(568),m=e(283),y=e(258),C=e(21),b=t.ɵcrt({encapsulation:2,styles:[],data:{}});function S(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,11,"li",[["class","nav-item"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,8,"a",[["class","nav-link"],["routerLink","settings"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(n,l,e){var u=!0;"click"===l&&(u=!1!==t.ɵnov(n,3).onClick(e.button,e.ctrlKey,e.metaKey,e.shiftKey)&&u);return u},null,null)),t.ɵdid(3,671744,[[8,4]],0,u.RouterLinkWithHref,[u.Router,u.ActivatedRoute,o.LocationStrategy],{routerLink:[0,"routerLink"]},null),t.ɵdid(4,1720320,null,2,u.RouterLinkActive,[u.Router,t.ElementRef,t.Renderer2,t.ChangeDetectorRef],{routerLinkActive:[0,"routerLinkActive"]},null),t.ɵqud(603979776,7,{links:1}),t.ɵqud(603979776,8,{linksWithHrefs:1}),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(8,0,null,null,0,"i",[["class","fa fa-cogs"]],null,null,null,null,null)),(n()(),t.ɵted(9,null,["\n ","\n "])),t.ɵppd(10,1),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){n(l,3,0,"settings");n(l,4,0,"active")},function(n,l){n(l,2,0,t.ɵnov(l,3).target,t.ɵnov(l,3).href),n(l,9,0,t.ɵunv(l,9,0,n(l,10,0,t.ɵnov(l.parent.parent.parent,0),"settings")))})}function w(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,43,"ul",[["class","nav nav-tabs"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,11,"li",[["class","nav-item"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(4,0,null,null,8,"a",[["class","nav-link"],["routerLink","vault"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(n,l,e){var u=!0;"click"===l&&(u=!1!==t.ɵnov(n,5).onClick(e.button,e.ctrlKey,e.metaKey,e.shiftKey)&&u);return u},null,null)),t.ɵdid(5,671744,[[2,4]],0,u.RouterLinkWithHref,[u.Router,u.ActivatedRoute,o.LocationStrategy],{routerLink:[0,"routerLink"]},null),t.ɵdid(6,1720320,null,2,u.RouterLinkActive,[u.Router,t.ElementRef,t.Renderer2,t.ChangeDetectorRef],{routerLinkActive:[0,"routerLinkActive"]},null),t.ɵqud(603979776,1,{links:1}),t.ɵqud(603979776,2,{linksWithHrefs:1}),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(10,0,null,null,0,"i",[["class","fa fa-lock"]],null,null,null,null,null)),(n()(),t.ɵted(11,null,["\n ","\n "])),t.ɵppd(12,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(15,0,null,null,11,"li",[["class","nav-item"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(17,0,null,null,8,"a",[["class","nav-link"],["routerLink","manage"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(n,l,e){var u=!0;"click"===l&&(u=!1!==t.ɵnov(n,18).onClick(e.button,e.ctrlKey,e.metaKey,e.shiftKey)&&u);return u},null,null)),t.ɵdid(18,671744,[[4,4]],0,u.RouterLinkWithHref,[u.Router,u.ActivatedRoute,o.LocationStrategy],{routerLink:[0,"routerLink"]},null),t.ɵdid(19,1720320,null,2,u.RouterLinkActive,[u.Router,t.ElementRef,t.Renderer2,t.ChangeDetectorRef],{routerLinkActive:[0,"routerLinkActive"]},null),t.ɵqud(603979776,3,{links:1}),t.ɵqud(603979776,4,{linksWithHrefs:1}),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(23,0,null,null,0,"i",[["class","fa fa-sliders"]],null,null,null,null,null)),(n()(),t.ɵted(24,null,["\n ","\n "])),t.ɵppd(25,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(28,0,null,null,11,"li",[["class","nav-item"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(30,0,null,null,8,"a",[["class","nav-link"],["routerLink","tools"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(n,l,e){var u=!0;"click"===l&&(u=!1!==t.ɵnov(n,31).onClick(e.button,e.ctrlKey,e.metaKey,e.shiftKey)&&u);return u},null,null)),t.ɵdid(31,671744,[[6,4]],0,u.RouterLinkWithHref,[u.Router,u.ActivatedRoute,o.LocationStrategy],{routerLink:[0,"routerLink"]},null),t.ɵdid(32,1720320,null,2,u.RouterLinkActive,[u.Router,t.ElementRef,t.Renderer2,t.ChangeDetectorRef],{routerLinkActive:[0,"routerLinkActive"]},null),t.ɵqud(603979776,5,{links:1}),t.ɵqud(603979776,6,{linksWithHrefs:1}),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(36,0,null,null,0,"i",[["class","fa fa-wrench"]],null,null,null,null,null)),(n()(),t.ɵted(37,null,["\n ","\n "])),t.ɵppd(38,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,S)),t.ɵdid(42,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){var e=l.component;n(l,5,0,"vault");n(l,6,0,"active");n(l,18,0,"manage");n(l,19,0,"active");n(l,31,0,"tools");n(l,32,0,"active"),n(l,42,0,e.organization.isOwner)},function(n,l){n(l,4,0,t.ɵnov(l,5).target,t.ɵnov(l,5).href),n(l,11,0,t.ɵunv(l,11,0,n(l,12,0,t.ɵnov(l.parent.parent,0),"vault"))),n(l,17,0,t.ɵnov(l,18).target,t.ɵnov(l,18).href),n(l,24,0,t.ɵunv(l,24,0,n(l,25,0,t.ɵnov(l.parent.parent,0),"manage"))),n(l,30,0,t.ɵnov(l,31).target,t.ɵnov(l,31).href),n(l,37,0,t.ɵunv(l,37,0,n(l,38,0,t.ɵnov(l.parent.parent,0),"tools")))})}function R(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,23,"div",[["class","org-nav"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,20,"div",[["class","container d-flex flex-column"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(4,0,null,null,14,"div",[["class","my-auto d-flex align-items-center pl-1"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(6,0,null,null,1,"app-avatar",[],null,null,null,i.View_AvatarComponent_0,i.RenderType_AvatarComponent)),t.ɵdid(7,638976,null,0,r.AvatarComponent,[a.DomSanitizer],{data:[0,"data"],width:[1,"width"],height:[2,"height"],circle:[3,"circle"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(9,0,null,null,8,"div",[["class","org-name ml-3"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(11,0,null,null,1,"span",[],null,null,null,null,null)),(n()(),t.ɵted(12,null,["",""])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(14,0,null,null,2,"small",[["class","text-muted"]],null,null,null,null,null)),(n()(),t.ɵted(15,null,["",""])),t.ɵppd(16,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,w)),t.ɵdid(21,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){var e=l.component;n(l,7,0,e.organization.name,45,45,!0),n(l,21,0,e.organization.isAdmin)},function(n,l){n(l,12,0,l.component.organization.name),n(l,15,0,t.ɵunv(l,15,0,n(l,16,0,t.ɵnov(l.parent,0),"organization")))})}function _(n){return t.ɵvid(0,[t.ɵpid(0,s.I18nPipe,[d.I18nService]),(n()(),t.ɵeld(1,0,null,null,1,"app-navbar",[],null,null,null,c.View_NavbarComponent_0,c.RenderType_NavbarComponent)),t.ɵdid(2,114688,null,0,p.NavbarComponent,[f.MessagingService,v.PlatformUtilsService,h.TokenService],null,null),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,null,null,1,null,R)),t.ɵdid(5,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵeld(7,16777216,null,null,1,"router-outlet",[],null,null,null,null,null)),t.ɵdid(8,212992,null,0,u.RouterOutlet,[u.ChildrenOutletContexts,t.ViewContainerRef,t.ComponentFactoryResolver,[8,null],t.ChangeDetectorRef],null,null),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵeld(10,0,null,null,1,"app-footer",[],null,null,null,g.View_FooterComponent_0,g.RenderType_FooterComponent)),t.ɵdid(11,114688,null,0,m.FooterComponent,[v.PlatformUtilsService],null,null),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){var e=l.component;n(l,2,0),n(l,5,0,e.organization),n(l,8,0),n(l,11,0)},null)}function I(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"app-organization-layout",[],null,null,null,_,b)),t.ɵdid(1,114688,null,0,y.OrganizationLayoutComponent,[u.ActivatedRoute,C.UserService],null,null)],function(n,l){n(l,1,0)},null)}l.RenderType_OrganizationLayoutComponent=b,l.View_OrganizationLayoutComponent_0=_,l.View_OrganizationLayoutComponent_Host_0=I;var A=t.ɵccf("app-organization-layout",y.OrganizationLayoutComponent,I,{},{},[]);l.OrganizationLayoutComponentNgFactory=A},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=e(0),u=e(40),o=e(37),i=e(2),r=e(5),a=e(7),s=e(13),d=e(18),c=e(17),p=e(259),f=e(129),v=e(21),h=t.ɵcrt({encapsulation:2,styles:[],data:{}});function g(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,2,"p",[],null,null,null,null,null)),(n()(),t.ɵted(1,null,["","..."])),t.ɵppd(2,1)],null,function(n,l){n(l,1,0,t.ɵunv(l,1,0,n(l,2,0,t.ɵnov(l.parent.parent,0),"reportError")))})}function m(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,4,"app-callout",[["type","success"]],null,null,null,u.View_CalloutComponent_0,u.RenderType_CalloutComponent)),t.ɵdid(1,114688,null,0,o.CalloutComponent,[i.I18nService],{type:[0,"type"],title:[1,"title"]},null),t.ɵppd(2,1),(n()(),t.ɵted(3,0,["\n ","\n "])),t.ɵppd(4,2)],function(n,l){n(l,1,0,"success",t.ɵinlineInterpolate(1,"",t.ɵunv(l,1,1,n(l,2,0,t.ɵnov(l.parent.parent.parent,0),"goodNews")),""))},function(n,l){var e=l.component;n(l,3,0,t.ɵunv(l,3,0,n(l,4,0,t.ɵnov(l.parent.parent.parent,0),"breachUsernameNotFound",e.checkedUsername)))})}function y(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,4,"app-callout",[["type","danger"]],null,null,null,u.View_CalloutComponent_0,u.RenderType_CalloutComponent)),t.ɵdid(1,114688,null,0,o.CalloutComponent,[i.I18nService],{type:[0,"type"],title:[1,"title"]},null),t.ɵppd(2,1),(n()(),t.ɵted(3,0,["\n ","\n "])),t.ɵppd(4,3)],function(n,l){n(l,1,0,"danger",t.ɵinlineInterpolate(1,"",t.ɵunv(l,1,1,n(l,2,0,t.ɵnov(l.parent.parent.parent,0),"breachFound")),""))},function(n,l){var e=l.component;n(l,3,0,t.ɵunv(l,3,0,n(l,4,0,t.ɵnov(l.parent.parent.parent,0),"breachUsernameFound",e.checkedUsername,e.breachedAccounts.length)))})}function C(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"li",[],null,null,null,null,null)),(n()(),t.ɵted(1,null,["",""]))],null,function(n,l){n(l,1,0,l.context.$implicit)})}function b(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,64,"li",[["class","list-group-item min-height-fix"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,61,"div",[["class","row"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(4,0,null,null,3,"div",[["class","col-2 text-center"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(6,0,null,null,0,"img",[["alt",""],["class","img-fluid"]],[[8,"src",4]],null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(9,0,null,null,16,"div",[["class","col-7"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(11,0,null,null,1,"h3",[["class","text-lg"]],null,null,null,null,null)),(n()(),t.ɵted(12,null,["",""])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(14,0,null,null,0,"p",[],[[8,"innerHTML",1]],null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(16,0,null,null,2,"p",[["class","mb-1"]],null,null,null,null,null)),(n()(),t.ɵted(17,null,["",":"])),t.ɵppd(18,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(20,0,null,null,4,"ul",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,C)),t.ɵdid(23,802816,null,0,r.NgForOf,[t.ViewContainerRef,t.TemplateRef,t.IterableDiffers],{ngForOf:[0,"ngForOf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(27,0,null,null,35,"div",[["class","col-3"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(29,0,null,null,32,"dl",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(31,0,null,null,2,"dt",[],null,null,null,null,null)),(n()(),t.ɵted(32,null,["",""])),t.ɵppd(33,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(35,0,null,null,1,"dd",[],null,null,null,null,null)),(n()(),t.ɵted(36,null,["",""])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(38,0,null,null,2,"dt",[],null,null,null,null,null)),(n()(),t.ɵted(39,null,["",""])),t.ɵppd(40,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(42,0,null,null,2,"dd",[],null,null,null,null,null)),(n()(),t.ɵted(43,null,["",""])),t.ɵppd(44,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(46,0,null,null,2,"dt",[],null,null,null,null,null)),(n()(),t.ɵted(47,null,["",""])),t.ɵppd(48,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(50,0,null,null,2,"dd",[],null,null,null,null,null)),(n()(),t.ɵted(51,null,["",""])),t.ɵppd(52,2),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(54,0,null,null,2,"dt",[],null,null,null,null,null)),(n()(),t.ɵted(55,null,["",""])),t.ɵppd(56,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(58,0,null,null,2,"dd",[],null,null,null,null,null)),(n()(),t.ɵted(59,null,["",""])),t.ɵppd(60,2),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){n(l,23,0,l.context.$implicit.dataClasses)},function(n,l){n(l,6,0,"https://haveibeenpwned.com/Content/Images/PwnedLogos/"+l.context.$implicit.name+"."+l.context.$implicit.logoType),n(l,12,0,l.context.$implicit.title),n(l,14,0,l.context.$implicit.description),n(l,17,0,t.ɵunv(l,17,0,n(l,18,0,t.ɵnov(l.parent.parent.parent.parent,0),"compromisedData"))),n(l,32,0,t.ɵunv(l,32,0,n(l,33,0,t.ɵnov(l.parent.parent.parent.parent,0),"website"))),n(l,36,0,l.context.$implicit.domain),n(l,39,0,t.ɵunv(l,39,0,n(l,40,0,t.ɵnov(l.parent.parent.parent.parent,0),"affectedUsers"))),n(l,43,0,t.ɵunv(l,43,0,n(l,44,0,t.ɵnov(l.parent.parent.parent.parent,1),l.context.$implicit.pwnCount))),n(l,47,0,t.ɵunv(l,47,0,n(l,48,0,t.ɵnov(l.parent.parent.parent.parent,0),"breachOccurred"))),n(l,51,0,t.ɵunv(l,51,0,n(l,52,0,t.ɵnov(l.parent.parent.parent.parent,2),l.context.$implicit.breachDate,"mediumDate"))),n(l,55,0,t.ɵunv(l,55,0,n(l,56,0,t.ɵnov(l.parent.parent.parent.parent,0),"breachReported"))),n(l,59,0,t.ɵunv(l,59,0,n(l,60,0,t.ɵnov(l.parent.parent.parent.parent,2),l.context.$implicit.addedDate,"mediumDate")))})}function S(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,4,"ul",[["class","list-group list-group-breach"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,b)),t.ɵdid(3,802816,null,0,r.NgForOf,[t.ViewContainerRef,t.TemplateRef,t.IterableDiffers],{ngForOf:[0,"ngForOf"]},null),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){n(l,3,0,l.component.breachedAccounts)},null)}function w(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,10,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,m)),t.ɵdid(3,16384,null,0,r.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,y)),t.ɵdid(6,16384,null,0,r.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,S)),t.ɵdid(9,16384,null,0,r.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){var e=l.component;n(l,3,0,!e.breachedAccounts.length),n(l,6,0,e.breachedAccounts.length),n(l,9,0,e.breachedAccounts.length)},null)}function R(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,7,"div",[["class","mt-4"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,g)),t.ɵdid(3,16384,null,0,r.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,w)),t.ɵdid(6,16384,null,0,r.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){var e=l.component;n(l,3,0,e.error),n(l,6,0,!e.error)},null)}function _(n){return t.ɵvid(0,[t.ɵpid(0,a.I18nPipe,[i.I18nService]),t.ɵpid(0,r.DecimalPipe,[t.LOCALE_ID]),t.ɵpid(0,r.DatePipe,[t.LOCALE_ID]),(n()(),t.ɵeld(3,0,null,null,5,"div",[["class","page-header"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(5,0,null,null,2,"h1",[],null,null,null,null,null)),(n()(),t.ɵted(6,null,["",""])),t.ɵppd(7,1),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵeld(10,0,null,null,2,"p",[],null,null,null,null,null)),(n()(),t.ɵted(11,null,["",""])),t.ɵppd(12,1),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵeld(14,0,[["form",1]],null,38,"form",[["ngNativeValidate",""]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngSubmit"],[null,"submit"],[null,"reset"]],function(n,l,e){var u=!0,o=n.component;"submit"===l&&(u=!1!==t.ɵnov(n,15).onSubmit(e)&&u);"reset"===l&&(u=!1!==t.ɵnov(n,15).onReset()&&u);"ngSubmit"===l&&(u=!1!==o.submit()&&u);return u},null,null)),t.ɵdid(15,4210688,null,0,s.NgForm,[[8,null],[8,null]],null,{ngSubmit:"ngSubmit"}),t.ɵprd(2048,null,s.ControlContainer,null,[s.NgForm]),t.ɵdid(17,16384,null,0,s.NgControlStatusGroup,[s.ControlContainer],null,null),t.ɵdid(18,540672,null,0,d.ApiActionDirective,[t.ElementRef,c.ValidationService],{appApiAction:[0,"appApiAction"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(20,0,null,null,21,"div",[["class","row"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(22,0,null,null,18,"div",[["class","form-group col-6"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(24,0,null,null,2,"label",[["for","username"]],null,null,null,null,null)),(n()(),t.ɵted(25,null,["",""])),t.ɵppd(26,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(28,0,null,null,7,"input",[["class","form-control"],["id","username"],["name","Username"],["required",""],["type","text"]],[[1,"required",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(n,l,e){var u=!0,o=n.component;"input"===l&&(u=!1!==t.ɵnov(n,29)._handleInput(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,29).onTouched()&&u);"compositionstart"===l&&(u=!1!==t.ɵnov(n,29)._compositionStart()&&u);"compositionend"===l&&(u=!1!==t.ɵnov(n,29)._compositionEnd(e.target.value)&&u);"ngModelChange"===l&&(u=!1!==(o.username=e)&&u);return u},null,null)),t.ɵdid(29,16384,null,0,s.DefaultValueAccessor,[t.Renderer2,t.ElementRef,[2,s.COMPOSITION_BUFFER_MODE]],null,null),t.ɵdid(30,16384,null,0,s.RequiredValidator,[],{required:[0,"required"]},null),t.ɵprd(1024,null,s.NG_VALIDATORS,function(n){return[n]},[s.RequiredValidator]),t.ɵprd(1024,null,s.NG_VALUE_ACCESSOR,function(n){return[n]},[s.DefaultValueAccessor]),t.ɵdid(33,671744,null,0,s.NgModel,[[2,s.ControlContainer],[2,s.NG_VALIDATORS],[8,null],[2,s.NG_VALUE_ACCESSOR]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,s.NgControl,null,[s.NgModel]),t.ɵdid(35,16384,null,0,s.NgControlStatus,[s.NgControl],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(37,0,null,null,2,"small",[["class","form-text text-muted"]],null,null,null,null,null)),(n()(),t.ɵted(38,null,["",""])),t.ɵppd(39,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(43,0,null,null,8,"button",[["class","btn btn-primary btn-submit"],["type","submit"]],[[8,"disabled",0]],null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(45,0,null,null,1,"i",[["class","fa fa-spinner fa-spin"]],[[8,"title",0]],null,null,null,null)),t.ɵppd(46,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(48,0,null,null,2,"span",[],null,null,null,null,null)),(n()(),t.ɵted(49,null,["",""])),t.ɵppd(50,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,null,null,1,null,R)),t.ɵdid(55,16384,null,0,r.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){var e=l.component;n(l,18,0,e.formPromise);n(l,30,0,"");n(l,33,0,"Username",e.username),n(l,55,0,!t.ɵnov(l,14).loading&&e.checkedUsername)},function(n,l){n(l,6,0,t.ɵunv(l,6,0,n(l,7,0,t.ɵnov(l,0),"dataBreachReport"))),n(l,11,0,t.ɵunv(l,11,0,n(l,12,0,t.ɵnov(l,0),"breachDesc"))),n(l,14,0,t.ɵnov(l,17).ngClassUntouched,t.ɵnov(l,17).ngClassTouched,t.ɵnov(l,17).ngClassPristine,t.ɵnov(l,17).ngClassDirty,t.ɵnov(l,17).ngClassValid,t.ɵnov(l,17).ngClassInvalid,t.ɵnov(l,17).ngClassPending),n(l,25,0,t.ɵunv(l,25,0,n(l,26,0,t.ɵnov(l,0),"username"))),n(l,28,0,t.ɵnov(l,30).required?"":null,t.ɵnov(l,35).ngClassUntouched,t.ɵnov(l,35).ngClassTouched,t.ɵnov(l,35).ngClassPristine,t.ɵnov(l,35).ngClassDirty,t.ɵnov(l,35).ngClassValid,t.ɵnov(l,35).ngClassInvalid,t.ɵnov(l,35).ngClassPending),n(l,38,0,t.ɵunv(l,38,0,n(l,39,0,t.ɵnov(l,0),"breachCheckUsernameEmail"))),n(l,43,0,t.ɵnov(l,14).loading),n(l,45,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,45,0,n(l,46,0,t.ɵnov(l,0),"loading")),"")),n(l,49,0,t.ɵunv(l,49,0,n(l,50,0,t.ɵnov(l,0),"checkBreaches")))})}function I(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"app-breach-report",[],null,null,null,_,h)),t.ɵdid(1,114688,null,0,p.BreachReportComponent,[f.AuditService,v.UserService],null,null)],function(n,l){n(l,1,0)},null)}l.RenderType_BreachReportComponent=h,l.View_BreachReportComponent_0=_,l.View_BreachReportComponent_Host_0=I;var A=t.ɵccf("app-breach-report",p.BreachReportComponent,I,{},{},[]);l.BreachReportComponentNgFactory=A},function(n,l,e){"use strict";var t=this&&this.__awaiter||function(n,l,e,t){return new(e||(e=Promise))(function(u,o){function i(n){try{a(t.next(n))}catch(n){o(n)}}function r(n){try{a(t.throw(n))}catch(n){o(n)}}function a(n){n.done?u(n.value):new e(function(l){l(n.value)}).then(i,r)}a((t=t.apply(n,l||[])).next())})},u=this&&this.__generator||function(n,l){var e,t,u,o,i={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return o={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function r(o){return function(r){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;i;)try{if(e=1,t&&(u=t[2&o[0]?"return":o[0]?"throw":"next"])&&!(u=u.call(t,o[1])).done)return u;switch(t=0,u&&(o=[0,u.value]),o[0]){case 0:case 1:u=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,t=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(u=(u=i.trys).length>0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]128&&(this.options.length=128),this.options.minNumber?this.options.minNumber>this.options.length?this.options.minNumber=this.options.length:this.options.minNumber>9&&(this.options.minNumber=9):this.options.minNumber=0,this.options.minSpecial?this.options.minSpecial>this.options.length?this.options.minSpecial=this.options.length:this.options.minSpecial>9&&(this.options.minSpecial=9):this.options.minSpecial=0,this.options.minSpecial+this.options.minNumber>this.options.length&&(this.options.minSpecial=this.options.length-this.options.minNumber)},n}();l.PasswordGeneratorComponent=i},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=e(0),u=e(7),o=e(2),i=e(13),r=e(260),a=e(94),s=e(3),d=e(8),c=e(9),p=t.ɵcrt({encapsulation:2,styles:[],data:{}});function f(n){return t.ɵvid(0,[(n()(),t.ɵand(0,null,null,0))],null,null)}function v(n){return t.ɵvid(0,[t.ɵpid(0,u.I18nPipe,[o.I18nService]),t.ɵqud(402653184,1,{historyModalRef:0}),(n()(),t.ɵeld(2,0,null,null,5,"div",[["class","page-header"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(4,0,null,null,2,"h1",[],null,null,null,null,null)),(n()(),t.ɵted(5,null,["",""])),t.ɵppd(6,1),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵeld(9,0,null,null,4,"div",[["class","card card-password bg-light my-4"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(11,0,null,null,1,"div",[["class","card-body"]],null,null,null,null,null)),(n()(),t.ɵted(12,null,["\n ","\n "])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵeld(15,0,null,null,46,"div",[["class","row"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(17,0,null,null,13,"div",[["class","form-group col-4"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(19,0,null,null,2,"label",[["for","length"]],null,null,null,null,null)),(n()(),t.ɵted(20,null,["",""])),t.ɵppd(21,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(23,0,null,null,6,"input",[["class","form-control"],["id","length"],["max","128"],["min","5"],["type","number"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"],[null,"change"]],function(n,l,e){var u=!0,o=n.component;"input"===l&&(u=!1!==t.ɵnov(n,24)._handleInput(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,24).onTouched()&&u);"compositionstart"===l&&(u=!1!==t.ɵnov(n,24)._compositionStart()&&u);"compositionend"===l&&(u=!1!==t.ɵnov(n,24)._compositionEnd(e.target.value)&&u);"change"===l&&(u=!1!==t.ɵnov(n,25).onChange(e.target.value)&&u);"input"===l&&(u=!1!==t.ɵnov(n,25).onChange(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,25).onTouched()&&u);"ngModelChange"===l&&(u=!1!==(o.options.length=e)&&u);"input"===l&&(u=!1!==o.saveOptions()&&u);return u},null,null)),t.ɵdid(24,16384,null,0,i.DefaultValueAccessor,[t.Renderer2,t.ElementRef,[2,i.COMPOSITION_BUFFER_MODE]],null,null),t.ɵdid(25,16384,null,0,i.ɵbc,[t.Renderer2,t.ElementRef],null,null),t.ɵprd(1024,null,i.NG_VALUE_ACCESSOR,function(n,l){return[n,l]},[i.DefaultValueAccessor,i.ɵbc]),t.ɵdid(27,671744,null,0,i.NgModel,[[8,null],[8,null],[8,null],[2,i.NG_VALUE_ACCESSOR]],{model:[0,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,i.NgControl,null,[i.NgModel]),t.ɵdid(29,16384,null,0,i.NgControlStatus,[i.NgControl],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(32,0,null,null,13,"div",[["class","form-group col-4"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(34,0,null,null,2,"label",[["for","min-number"]],null,null,null,null,null)),(n()(),t.ɵted(35,null,["",""])),t.ɵppd(36,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(38,0,null,null,6,"input",[["class","form-control"],["id","min-number"],["max","9"],["min","0"],["type","number"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"input"],[null,"ngModelChange"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"],[null,"change"]],function(n,l,e){var u=!0,o=n.component;"input"===l&&(u=!1!==t.ɵnov(n,39)._handleInput(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,39).onTouched()&&u);"compositionstart"===l&&(u=!1!==t.ɵnov(n,39)._compositionStart()&&u);"compositionend"===l&&(u=!1!==t.ɵnov(n,39)._compositionEnd(e.target.value)&&u);"change"===l&&(u=!1!==t.ɵnov(n,40).onChange(e.target.value)&&u);"input"===l&&(u=!1!==t.ɵnov(n,40).onChange(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,40).onTouched()&&u);"input"===l&&(u=!1!==o.saveOptions()&&u);"ngModelChange"===l&&(u=!1!==(o.options.minNumber=e)&&u);return u},null,null)),t.ɵdid(39,16384,null,0,i.DefaultValueAccessor,[t.Renderer2,t.ElementRef,[2,i.COMPOSITION_BUFFER_MODE]],null,null),t.ɵdid(40,16384,null,0,i.ɵbc,[t.Renderer2,t.ElementRef],null,null),t.ɵprd(1024,null,i.NG_VALUE_ACCESSOR,function(n,l){return[n,l]},[i.DefaultValueAccessor,i.ɵbc]),t.ɵdid(42,671744,null,0,i.NgModel,[[8,null],[8,null],[8,null],[2,i.NG_VALUE_ACCESSOR]],{model:[0,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,i.NgControl,null,[i.NgModel]),t.ɵdid(44,16384,null,0,i.NgControlStatus,[i.NgControl],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(47,0,null,null,13,"div",[["class","form-group col-4"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(49,0,null,null,2,"label",[["for","min-special"]],null,null,null,null,null)),(n()(),t.ɵted(50,null,["",""])),t.ɵppd(51,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(53,0,null,null,6,"input",[["class","form-control"],["id","min-special"],["max","9"],["min","0"],["type","number"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"input"],[null,"ngModelChange"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"],[null,"change"]],function(n,l,e){var u=!0,o=n.component;"input"===l&&(u=!1!==t.ɵnov(n,54)._handleInput(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,54).onTouched()&&u);"compositionstart"===l&&(u=!1!==t.ɵnov(n,54)._compositionStart()&&u);"compositionend"===l&&(u=!1!==t.ɵnov(n,54)._compositionEnd(e.target.value)&&u);"change"===l&&(u=!1!==t.ɵnov(n,55).onChange(e.target.value)&&u);"input"===l&&(u=!1!==t.ɵnov(n,55).onChange(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,55).onTouched()&&u);"input"===l&&(u=!1!==o.saveOptions()&&u);"ngModelChange"===l&&(u=!1!==(o.options.minSpecial=e)&&u);return u},null,null)),t.ɵdid(54,16384,null,0,i.DefaultValueAccessor,[t.Renderer2,t.ElementRef,[2,i.COMPOSITION_BUFFER_MODE]],null,null),t.ɵdid(55,16384,null,0,i.ɵbc,[t.Renderer2,t.ElementRef],null,null),t.ɵprd(1024,null,i.NG_VALUE_ACCESSOR,function(n,l){return[n,l]},[i.DefaultValueAccessor,i.ɵbc]),t.ɵdid(57,671744,null,0,i.NgModel,[[8,null],[8,null],[8,null],[2,i.NG_VALUE_ACCESSOR]],{model:[0,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,i.NgControl,null,[i.NgModel]),t.ɵdid(59,16384,null,0,i.NgControlStatus,[i.NgControl],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵeld(63,0,null,null,67,"div",[["class","form-group"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(65,0,null,null,11,"div",[["class","form-check"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(67,0,null,null,5,"input",[["class","form-check-input"],["id","uppercase"],["type","checkbox"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"change"],[null,"ngModelChange"],[null,"blur"]],function(n,l,e){var u=!0,o=n.component;"change"===l&&(u=!1!==t.ɵnov(n,68).onChange(e.target.checked)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,68).onTouched()&&u);"change"===l&&(u=!1!==o.saveOptions()&&u);"ngModelChange"===l&&(u=!1!==(o.options.uppercase=e)&&u);return u},null,null)),t.ɵdid(68,16384,null,0,i.CheckboxControlValueAccessor,[t.Renderer2,t.ElementRef],null,null),t.ɵprd(1024,null,i.NG_VALUE_ACCESSOR,function(n){return[n]},[i.CheckboxControlValueAccessor]),t.ɵdid(70,671744,null,0,i.NgModel,[[8,null],[8,null],[8,null],[2,i.NG_VALUE_ACCESSOR]],{model:[0,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,i.NgControl,null,[i.NgModel]),t.ɵdid(72,16384,null,0,i.NgControlStatus,[i.NgControl],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(74,0,null,null,1,"label",[["class","form-check-label"],["for","uppercase"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["A-Z"])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(78,0,null,null,11,"div",[["class","form-check"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(80,0,null,null,5,"input",[["class","form-check-input"],["id","lowercase"],["type","checkbox"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"change"],[null,"ngModelChange"],[null,"blur"]],function(n,l,e){var u=!0,o=n.component;"change"===l&&(u=!1!==t.ɵnov(n,81).onChange(e.target.checked)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,81).onTouched()&&u);"change"===l&&(u=!1!==o.saveOptions()&&u);"ngModelChange"===l&&(u=!1!==(o.options.lowercase=e)&&u);return u},null,null)),t.ɵdid(81,16384,null,0,i.CheckboxControlValueAccessor,[t.Renderer2,t.ElementRef],null,null),t.ɵprd(1024,null,i.NG_VALUE_ACCESSOR,function(n){return[n]},[i.CheckboxControlValueAccessor]),t.ɵdid(83,671744,null,0,i.NgModel,[[8,null],[8,null],[8,null],[2,i.NG_VALUE_ACCESSOR]],{model:[0,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,i.NgControl,null,[i.NgModel]),t.ɵdid(85,16384,null,0,i.NgControlStatus,[i.NgControl],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(87,0,null,null,1,"label",[["class","form-check-label"],["for","lowercase"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["a-z"])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(91,0,null,null,11,"div",[["class","form-check"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(93,0,null,null,5,"input",[["class","form-check-input"],["id","numbers"],["type","checkbox"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"change"],[null,"ngModelChange"],[null,"blur"]],function(n,l,e){var u=!0,o=n.component;"change"===l&&(u=!1!==t.ɵnov(n,94).onChange(e.target.checked)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,94).onTouched()&&u);"change"===l&&(u=!1!==o.saveOptions()&&u);"ngModelChange"===l&&(u=!1!==(o.options.number=e)&&u);return u},null,null)),t.ɵdid(94,16384,null,0,i.CheckboxControlValueAccessor,[t.Renderer2,t.ElementRef],null,null),t.ɵprd(1024,null,i.NG_VALUE_ACCESSOR,function(n){return[n]},[i.CheckboxControlValueAccessor]),t.ɵdid(96,671744,null,0,i.NgModel,[[8,null],[8,null],[8,null],[2,i.NG_VALUE_ACCESSOR]],{model:[0,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,i.NgControl,null,[i.NgModel]),t.ɵdid(98,16384,null,0,i.NgControlStatus,[i.NgControl],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(100,0,null,null,1,"label",[["class","form-check-label"],["for","numbers"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["0-9"])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(104,0,null,null,11,"div",[["class","form-check"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(106,0,null,null,5,"input",[["class","form-check-input"],["id","special"],["type","checkbox"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"change"],[null,"ngModelChange"],[null,"blur"]],function(n,l,e){var u=!0,o=n.component;"change"===l&&(u=!1!==t.ɵnov(n,107).onChange(e.target.checked)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,107).onTouched()&&u);"change"===l&&(u=!1!==o.saveOptions()&&u);"ngModelChange"===l&&(u=!1!==(o.options.special=e)&&u);return u},null,null)),t.ɵdid(107,16384,null,0,i.CheckboxControlValueAccessor,[t.Renderer2,t.ElementRef],null,null),t.ɵprd(1024,null,i.NG_VALUE_ACCESSOR,function(n){return[n]},[i.CheckboxControlValueAccessor]),t.ɵdid(109,671744,null,0,i.NgModel,[[8,null],[8,null],[8,null],[2,i.NG_VALUE_ACCESSOR]],{model:[0,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,i.NgControl,null,[i.NgModel]),t.ɵdid(111,16384,null,0,i.NgControlStatus,[i.NgControl],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(113,0,null,null,1,"label",[["class","form-check-label"],["for","special"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["!@#$%^&*"])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(117,0,null,null,12,"div",[["class","form-check"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(119,0,null,null,5,"input",[["class","form-check-input"],["id","ambiguous"],["type","checkbox"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"change"],[null,"ngModelChange"],[null,"blur"]],function(n,l,e){var u=!0,o=n.component;"change"===l&&(u=!1!==t.ɵnov(n,120).onChange(e.target.checked)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,120).onTouched()&&u);"change"===l&&(u=!1!==o.saveOptions()&&u);"ngModelChange"===l&&(u=!1!==(o.avoidAmbiguous=e)&&u);return u},null,null)),t.ɵdid(120,16384,null,0,i.CheckboxControlValueAccessor,[t.Renderer2,t.ElementRef],null,null),t.ɵprd(1024,null,i.NG_VALUE_ACCESSOR,function(n){return[n]},[i.CheckboxControlValueAccessor]),t.ɵdid(122,671744,null,0,i.NgModel,[[8,null],[8,null],[8,null],[2,i.NG_VALUE_ACCESSOR]],{model:[0,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,i.NgControl,null,[i.NgModel]),t.ɵdid(124,16384,null,0,i.NgControlStatus,[i.NgControl],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(126,0,null,null,2,"label",[["class","form-check-label"],["for","ambiguous"]],null,null,null,null,null)),(n()(),t.ɵted(127,null,["",""])),t.ɵppd(128,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵeld(132,0,null,null,21,"div",[["class","d-flex"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(134,0,null,null,9,"div",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(136,0,null,null,2,"button",[["class","btn btn-primary"],["type","button"]],null,[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.regenerate()&&t);return t},null,null)),(n()(),t.ɵted(137,null,["\n ","\n "])),t.ɵppd(138,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(140,0,null,null,2,"button",[["class","btn btn-outline-secondary"],["type","button"]],null,[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.copy()&&t);return t},null,null)),(n()(),t.ɵted(141,null,["\n ","\n "])),t.ɵppd(142,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(145,0,null,null,7,"div",[["class","ml-auto"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(147,0,null,null,4,"button",[["class","btn btn-outline-secondary"],["type","button"]],[[8,"title",0]],[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.history()&&t);return t},null,null)),t.ɵppd(148,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(150,0,null,null,0,"i",[["class","fa fa-clock-o fa-lg"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,[[1,3],["historyTemplate",2]],null,0,null,f)),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){var e=l.component;n(l,27,0,e.options.length),n(l,42,0,e.options.minNumber),n(l,57,0,e.options.minSpecial),n(l,70,0,e.options.uppercase),n(l,83,0,e.options.lowercase),n(l,96,0,e.options.number),n(l,109,0,e.options.special),n(l,122,0,e.avoidAmbiguous)},function(n,l){var e=l.component;n(l,5,0,t.ɵunv(l,5,0,n(l,6,0,t.ɵnov(l,0),"passwordGenerator"))),n(l,12,0,e.password),n(l,20,0,t.ɵunv(l,20,0,n(l,21,0,t.ɵnov(l,0),"length"))),n(l,23,0,t.ɵnov(l,29).ngClassUntouched,t.ɵnov(l,29).ngClassTouched,t.ɵnov(l,29).ngClassPristine,t.ɵnov(l,29).ngClassDirty,t.ɵnov(l,29).ngClassValid,t.ɵnov(l,29).ngClassInvalid,t.ɵnov(l,29).ngClassPending),n(l,35,0,t.ɵunv(l,35,0,n(l,36,0,t.ɵnov(l,0),"minNumbers"))),n(l,38,0,t.ɵnov(l,44).ngClassUntouched,t.ɵnov(l,44).ngClassTouched,t.ɵnov(l,44).ngClassPristine,t.ɵnov(l,44).ngClassDirty,t.ɵnov(l,44).ngClassValid,t.ɵnov(l,44).ngClassInvalid,t.ɵnov(l,44).ngClassPending),n(l,50,0,t.ɵunv(l,50,0,n(l,51,0,t.ɵnov(l,0),"minSpecial"))),n(l,53,0,t.ɵnov(l,59).ngClassUntouched,t.ɵnov(l,59).ngClassTouched,t.ɵnov(l,59).ngClassPristine,t.ɵnov(l,59).ngClassDirty,t.ɵnov(l,59).ngClassValid,t.ɵnov(l,59).ngClassInvalid,t.ɵnov(l,59).ngClassPending),n(l,67,0,t.ɵnov(l,72).ngClassUntouched,t.ɵnov(l,72).ngClassTouched,t.ɵnov(l,72).ngClassPristine,t.ɵnov(l,72).ngClassDirty,t.ɵnov(l,72).ngClassValid,t.ɵnov(l,72).ngClassInvalid,t.ɵnov(l,72).ngClassPending),n(l,80,0,t.ɵnov(l,85).ngClassUntouched,t.ɵnov(l,85).ngClassTouched,t.ɵnov(l,85).ngClassPristine,t.ɵnov(l,85).ngClassDirty,t.ɵnov(l,85).ngClassValid,t.ɵnov(l,85).ngClassInvalid,t.ɵnov(l,85).ngClassPending),n(l,93,0,t.ɵnov(l,98).ngClassUntouched,t.ɵnov(l,98).ngClassTouched,t.ɵnov(l,98).ngClassPristine,t.ɵnov(l,98).ngClassDirty,t.ɵnov(l,98).ngClassValid,t.ɵnov(l,98).ngClassInvalid,t.ɵnov(l,98).ngClassPending),n(l,106,0,t.ɵnov(l,111).ngClassUntouched,t.ɵnov(l,111).ngClassTouched,t.ɵnov(l,111).ngClassPristine,t.ɵnov(l,111).ngClassDirty,t.ɵnov(l,111).ngClassValid,t.ɵnov(l,111).ngClassInvalid,t.ɵnov(l,111).ngClassPending),n(l,119,0,t.ɵnov(l,124).ngClassUntouched,t.ɵnov(l,124).ngClassTouched,t.ɵnov(l,124).ngClassPristine,t.ɵnov(l,124).ngClassDirty,t.ɵnov(l,124).ngClassValid,t.ɵnov(l,124).ngClassInvalid,t.ɵnov(l,124).ngClassPending),n(l,127,0,t.ɵunv(l,127,0,n(l,128,0,t.ɵnov(l,0),"ambiguous"))),n(l,137,0,t.ɵunv(l,137,0,n(l,138,0,t.ɵnov(l,0),"regeneratePassword"))),n(l,141,0,t.ɵunv(l,141,0,n(l,142,0,t.ɵnov(l,0),"copyPassword"))),n(l,147,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,147,0,n(l,148,0,t.ɵnov(l,0),"passwordHistory")),""))})}function h(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"app-password-generator",[],null,null,null,v,p)),t.ɵdid(1,114688,null,0,r.PasswordGeneratorComponent,[a.PasswordGenerationService,s.Angulartics2,d.PlatformUtilsService,o.I18nService,c.ToasterService,t.ComponentFactoryResolver],null,null)],function(n,l){n(l,1,0)},null)}l.RenderType_PasswordGeneratorComponent=p,l.View_PasswordGeneratorComponent_0=v,l.View_PasswordGeneratorComponent_Host_0=h;var g=t.ɵccf("app-password-generator",r.PasswordGeneratorComponent,h,{showSelect:"showSelect"},{onSelected:"onSelected"},[]);l.PasswordGeneratorComponentNgFactory=g},function(n,l,e){"use strict";var t=this&&this.__awaiter||function(n,l,e,t){return new(e||(e=Promise))(function(u,o){function i(n){try{a(t.next(n))}catch(n){o(n)}}function r(n){try{a(t.throw(n))}catch(n){o(n)}}function a(n){n.done?u(n.value):new e(function(l){l(n.value)}).then(i,r)}a((t=t.apply(n,l||[])).next())})},u=this&&this.__generator||function(n,l){var e,t,u,o,i={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return o={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function r(o){return function(r){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;i;)try{if(e=1,t&&(u=t[2&o[0]?"return":o[0]?"throw":"next"])&&!(u=u.call(t,o[1])).done)return u;switch(t=0,u&&(o=[0,u.value]),o[0]){case 0:case 1:u=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,t=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(u=(u=i.trys).length>0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]t?l.substring(t+1):null;if(!e.isNullOrWhitespace(u)&&!e.isNullOrWhitespace(o)&&"SecretType"!==u){var i=u.toLowerCase();null==n.login.username&&e.usernameFieldNames.indexOf(i)>-1?n.login.username=o:null==n.login.password&&e.passwordFieldNames.indexOf(i)>-1?n.login.password=o:e.processKvp(n,u,o)}}})},l}(o.BaseImporter);l.ZohoVaultCsvImporter=r},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)});Object.defineProperty(l,"__esModule",{value:!0});var o=e(32),i=e(31),r=function(n){function l(){return null!==n&&n.apply(this,arguments)||this}return u(l,n),l.prototype.parse=function(n){var l=this,e=new i.ImportResult,t=this.parseCsv(n,!1);return null==t?(e.success=!1,e):(t.forEach(function(n){if(5===n.length){var t=l.initLoginCipher();t.name=l.getValueOrDefault(n[0],"--"),t.notes=l.getValueOrDefault(n[4]),t.login.username=l.getValueOrDefault(n[1]),t.login.password=l.getValueOrDefault(n[2]),t.login.uris=l.makeUriArray(n[3]),l.cleanupCipher(t),e.ciphers.push(t)}}),e.success=!0,e)},l}(o.BaseImporter);l.UpmCsvImporter=r},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)});Object.defineProperty(l,"__esModule",{value:!0});var o=e(32),i=e(31),r=e(115),a=e(91),s=e(53),d=e(101),c=["kind","autologin","favorite","hexcolor","protectedwithpassword","subdomainonly","type","tk_export_version","note","title","document_content"],p=function(n){function l(){return null!==n&&n.apply(this,arguments)||this}return u(l,n),l.prototype.parse=function(n){var l=this,e=new i.ImportResult,t=this.parseCsv(n,!0);return null==t?(e.success=!1,e):(t.forEach(function(n){var t=l.initLoginCipher();if(t.favorite="true"===l.getValueOrDefault(n.favorite,"").toLowerCase(),t.name=l.getValueOrDefault(n.name,"--"),t.notes=l.getValueOrDefault(n.memo,""),t.login.username=l.getValueOrDefault(n.login),t.login.password=l.getValueOrDefault(n.password),t.login.uris=l.makeUriArray(n.url),"login"!==n.kind&&(t.name=l.getValueOrDefault(n.title,"--"),t.notes=l.getValueOrDefault(n.note,"")),"cc"===n.kind){if(t.type=s.CipherType.Card,t.card=new r.CardView,t.card.cardholderName=l.getValueOrDefault(n.cardholder),t.card.number=l.getValueOrDefault(n.number),t.card.brand=l.getCardBrand(t.card.number),!l.isNullOrWhitespace(n.expiryDate))try{var u=new Date(n.expiryDate);t.card.expYear=u.getFullYear().toString(),t.card.expMonth=(u.getMonth()+1).toString()}catch(n){}}else if("login"!==n.kind)for(var o in t.type=s.CipherType.SecureNote,t.secureNote=new a.SecureNoteView,t.secureNote.type=d.SecureNoteType.Generic,l.isNullOrWhitespace(t.notes)||(t.notes=l.getValueOrDefault(n.document_content,"")),n)n.hasOwnProperty(o)&&c.indexOf(o.toLowerCase())<0&&!l.isNullOrWhitespace(n[o])&&l.processKvp(t,o,n[o]);l.cleanupCipher(t),e.ciphers.push(t)}),e.success=!0,e)},l}(o.BaseImporter);l.TrueKeyCsvImporter=p},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)});Object.defineProperty(l,"__esModule",{value:!0});var o=e(32),i=e(31),r=function(n){function l(){return null!==n&&n.apply(this,arguments)||this}return u(l,n),l.prototype.parse=function(n){var l=this,e=new i.ImportResult,t=this.parseXml(n);if(null==t)return e.success=!1,e;var u=t.querySelectorAll("root > Database > Logins > Login");return Array.from(u).forEach(function(n){var u=n.getAttribute("ID");if(!l.isNullOrWhitespace(u)){var o=n.getAttribute("Name"),i=n.getAttribute("Password"),r=null,a=null,s=null,d=null,c=null,p=t.querySelector('root > Database > Accounts > Account > LoginLinks > Login[SourceLoginID="'+u+'"]');if(null!=p){var f=p.parentElement.parentElement;null!=f&&(r=f.getAttribute("Name"),a=f.getAttribute("Link"),d=f.getAttribute("ParentID"),s=f.getAttribute("Comments"),l.isNullOrWhitespace(s)||(s=s.split("/n").join("\n")))}l.isNullOrWhitespace(d)||(c=l.buildGroupText(t,d,""),l.processFolder(e,c));var v=l.initLoginCipher();v.name=l.getValueOrDefault(r,"--"),v.notes=l.getValueOrDefault(s),v.login.username=l.getValueOrDefault(o),v.login.password=l.getValueOrDefault(i),v.login.uris=l.makeUriArray(a),l.cleanupCipher(v),e.ciphers.push(v)}}),this.organization&&this.moveFoldersToCollections(e),e.success=!0,e},l.prototype.buildGroupText=function(n,l,e){var t=n.querySelector('root > Database > Groups > Group[ID="'+l+'"]');return null==t?e:(this.isNullOrWhitespace(e)||(e="/"+e),e=t.getAttribute("Name")+e,this.buildGroupText(n,t.getAttribute("ParentID"),e))},l}(o.BaseImporter);l.StickyPasswordXmlImporter=r},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)});Object.defineProperty(l,"__esModule",{value:!0});var o=e(32),i=e(31),r=function(n){function l(){return null!==n&&n.apply(this,arguments)||this}return u(l,n),l.prototype.parse=function(n){var l=this,e=new i.ImportResult,t=this.parseCsv(n,!1);return null==t?(e.success=!1,e):(t.forEach(function(n){if(!(n.length<3)){l.processFolder(e,l.getValueOrDefault(n[n.length-1]));var t=l.initLoginCipher();t.notes=l.getValueOrDefault(n[n.length-2],""),t.name=l.getValueOrDefault(n[1],"--"),"Web Logins"===n[0]||"Servers"===n[0]||"Email Accounts"===n[0]?(t.login.username=l.getValueOrDefault(n[2]),t.login.password=l.getValueOrDefault(n[3]),t.login.uris=l.makeUriArray(n[4]),l.parseFieldsToNotes(t,5,n)):l.parseFieldsToNotes(t,2,n),l.convertToNoteIfNeeded(t),l.cleanupCipher(t),e.ciphers.push(t)}}),this.organization&&this.moveFoldersToCollections(e),e.success=!0,e)},l.prototype.parseFieldsToNotes=function(n,l,e){for(var t=l;t label")).forEach(function(n){var t=n.getAttribute("name"),o=n.getAttribute("id");if(!l.isNullOrWhitespace(t)&&!l.isNullOrWhitespace(o)){u.set(o,e.folders.length);var i=new r.FolderView;i.name=t,e.folders.push(i)}}),Array.from(t.querySelectorAll("database > card")).forEach(function(n){if("true"!==n.getAttribute("template")){var t=l.querySelectorDirectChild(n,"label_id");if(null!=t){var o=t.textContent;!l.isNullOrWhitespace(o)&&u.has(o)&&e.folderRelationships.push([e.ciphers.length,u.get(o)])}var i=l.initLoginCipher();i.name=l.getValueOrDefault(n.getAttribute("title"),"--"),"note"===n.getAttribute("type")?(i.type=s.CipherType.SecureNote,i.secureNote=new a.SecureNoteView,i.secureNote.type=d.SecureNoteType.Generic):Array.from(l.querySelectorAllDirectChild(n,"field")).forEach(function(n){var e=n.textContent;if(!l.isNullOrWhitespace(e)){var t=n.getAttribute("name"),u=l.getValueOrDefault(n.getAttribute("type"),"").toLowerCase();"login"===u?i.login.username=e:"password"===u?i.login.password=e:"notes"===u?i.notes+=e+"\n":"weblogin"===u||"website"===u?i.login.uris=l.makeUriArray(e):l.processKvp(i,t,e)}}),Array.from(l.querySelectorAllDirectChild(n,"notes")).forEach(function(n){i.notes+=n.textContent+"\n"}),l.cleanupCipher(i),e.ciphers.push(i)}}),this.organization&&this.moveFoldersToCollections(e),e.success=!0,e},l}(o.BaseImporter);l.SafeInCloudXmlImporter=c},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)});Object.defineProperty(l,"__esModule",{value:!0});var o=e(32),i=e(31),r=function(n){function l(){return null!==n&&n.apply(this,arguments)||this}return u(l,n),l.prototype.parse=function(n){var l=this,e=new i.ImportResult,t=this.parseCsv(n,!0);if(null==t)return e.success=!1,e;var u=1;return t.forEach(function(n){var o=!l.isNullOrWhitespace(n.Folder)&&n.Folder.startsWith("/")?n.Folder.replace("/",""):n.Folder,i=l.isNullOrWhitespace(o)?null:o;l.processFolder(e,i);var r=l.initLoginCipher();r.notes=l.getValueOrDefault(n.Note),r.name=l.getValueOrDefault(n.Name,"--"),r.login.username=l.getValueOrDefault(n.Login),r.login.password=l.getValueOrDefault(n.Pwd),r.login.uris=l.makeUriArray(n.Url),l.cleanupCipher(r),u===t.length&&"--"===r.name&&l.isNullOrWhitespace(r.login.password)||(e.ciphers.push(r),u++)}),this.organization&&this.moveFoldersToCollections(e),e.success=!0,e},l}(o.BaseImporter);l.RoboFormCsvImporter=r},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)});Object.defineProperty(l,"__esModule",{value:!0});var o=e(32),i=e(31),r=function(n){function l(){return null!==n&&n.apply(this,arguments)||this}return u(l,n),l.prototype.parse=function(n){var l=this,e=new i.ImportResult,t=this.parseXml(n);if(null==t)return e.success=!1,e;var u=t.querySelector("passwordsafe");if(null==u)return e.errorMessage="Missing `passwordsafe` node.",e.success=!1,e;var o=u.getAttribute("delimiter"),r=t.querySelectorAll("passwordsafe > entry");return Array.from(r).forEach(function(n){var t=l.querySelectorDirectChild(n,"group"),u=null==t||l.isNullOrWhitespace(t.textContent)?null:t.textContent.split(".").join("/");l.processFolder(e,u);var i=l.querySelectorDirectChild(n,"title"),r=l.querySelectorDirectChild(n,"username"),a=l.querySelectorDirectChild(n,"email"),s=l.querySelectorDirectChild(n,"password"),d=l.querySelectorDirectChild(n,"url"),c=l.querySelectorDirectChild(n,"notes"),p=l.initLoginCipher();p.name=null!=i?l.getValueOrDefault(i.textContent,"--"):"--",p.notes=null!=c?l.getValueOrDefault(c.textContent,"").split(o).join("\n"):null,p.login.username=null!=r?l.getValueOrDefault(r.textContent):null,p.login.password=null!=s?l.getValueOrDefault(s.textContent):null,p.login.uris=null!=d?l.makeUriArray(d.textContent):null,l.isNullOrWhitespace(p.login.username)&&null!=a?p.login.username=l.getValueOrDefault(a.textContent):null==a||l.isNullOrWhitespace(a.textContent)||(p.notes=l.isNullOrWhitespace(p.notes)?"Email: "+a.textContent:p.notes+"\nEmail: "+a.textContent),l.cleanupCipher(p),e.ciphers.push(p)}),this.organization&&this.moveFoldersToCollections(e),e.success=!0,e},l}(o.BaseImporter);l.PasswordSafeXmlImporter=r},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)});Object.defineProperty(l,"__esModule",{value:!0});var o=e(32),i=e(31),r=function(n){function l(){return null!==n&&n.apply(this,arguments)||this}return u(l,n),l.prototype.parse=function(n){var l=this,e=new i.ImportResult,t=this.parseXml(n);if(null==t)return e.success=!1,e;var u=t.querySelectorAll("PasswordManager > record");return Array.from(u).forEach(function(n){var t=l.querySelectorDirectChild(n,"Category"),u=null==t||l.isNullOrWhitespace(t.textContent)||"Unfiled"===t.textContent?null:t.textContent;l.processFolder(e,u);var o=l.querySelectorDirectChild(n,"Account-Name"),i=l.querySelectorDirectChild(n,"User-Id"),r=l.querySelectorDirectChild(n,"Password"),a=l.querySelectorDirectChild(n,"URL"),s=l.querySelectorDirectChild(n,"Notes"),d=l.initLoginCipher();d.name=null!=o?l.getValueOrDefault(o.textContent,"--"):"--",d.notes=null!=s?l.getValueOrDefault(s.textContent):"",d.login.username=null!=i?l.getValueOrDefault(i.textContent):null,d.login.password=null!=r?l.getValueOrDefault(r.textContent):null,d.login.uris=null!=a?l.makeUriArray(a.textContent):null;for(var c=[],p=1;p<=10;p++)c.push("Attribute-"+p);l.querySelectorAllDirectChild(n,c.join(",")).forEach(function(n){l.isNullOrWhitespace(n.textContent)||"null"===n.textContent||l.processKvp(d,n.tagName,n.textContent)}),l.cleanupCipher(d),e.ciphers.push(d)}),this.organization&&this.moveFoldersToCollections(e),e.success=!0,e},l}(o.BaseImporter);l.PasswordDragonXmlImporter=r},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)});Object.defineProperty(l,"__esModule",{value:!0});var o=e(32),i=e(31),r=e(115),a=e(53),s=function(n){function l(){return null!==n&&n.apply(this,arguments)||this}return u(l,n),l.prototype.parse=function(n){var l=this,e=new i.ImportResult,t=JSON.parse(n);return null==t?(e.success=!1,e):(t.forEach(function(n){var t=l.initLoginCipher();if(t.name=l.getValueOrDefault(n.name,"--"),t.login.uris=l.makeUriArray(n.login_url),null!=n.identifiers){for(var u in l.isNullOrWhitespace(n.identifiers.notes)||(t.notes=n.identifiers.notes.split("\\r\\n").join("\n").split("\\n").join("\n")),"CreditCard"===n.type&&(t.card=new r.CardView,t.type=a.CipherType.Card),n.identifiers)if(n.identifiers.hasOwnProperty(u)){var o=n.identifiers[u],i=null!=o?o.toString():null;if(!l.isNullOrWhitespace(i)&&"notes"!==u&&"ignoreItemInSecurityScore"!==u){if(t.type===a.CipherType.Card){if("cardNumber"===u){t.card.number=i,t.card.brand=l.getCardBrand(i);continue}if("nameOnCard"===u){t.card.cardholderName=i;continue}if("security_code"===u){t.card.code=i;continue}if("expires"===u){try{var s=new Date(i);t.card.expYear=s.getFullYear().toString(),t.card.expMonth=(s.getMonth()+1).toString()}catch(n){}continue}if("cardType"===u)continue}else{if("username"===u){t.login.username=i;continue}if("password"===u){t.login.password=i;continue}if((null==t.login.uris||0===t.login.uris.length)&&l.uriFieldNames.indexOf(u)>-1){t.login.uris=l.makeUriArray(i);continue}}l.processKvp(t,u,i)}}l.convertToNoteIfNeeded(t),l.cleanupCipher(t),e.ciphers.push(t)}}),e.success=!0,e)},l}(o.BaseImporter);l.PasswordBossJsonImporter=s},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)});Object.defineProperty(l,"__esModule",{value:!0});var o=e(32),i=e(31),r=function(n){function l(){return null!==n&&n.apply(this,arguments)||this}return u(l,n),l.prototype.parse=function(n){var l=this,e=new i.ImportResult,t=this.parseCsv(n,!1);return null==t?(e.success=!1,e):(t.forEach(function(n){if(!(n.length<9)){var t=l.getValueOrDefault(n[8],"(None)"),u="(None)"!==t?t.split("\\").join("/"):null;l.processFolder(e,u);var o=l.initLoginCipher();o.notes=l.getValueOrDefault(n[3]),o.name=l.getValueOrDefault(n[0],"--"),o.login.username=l.getValueOrDefault(n[1]),o.login.password=l.getValueOrDefault(n[2]),o.login.uris=l.makeUriArray(n[4]),l.convertToNoteIfNeeded(o),l.cleanupCipher(o),e.ciphers.push(o)}}),this.organization&&this.moveFoldersToCollections(e),e.success=!0,e)},l}(o.BaseImporter);l.PasswordAgentCsvImporter=r},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)});Object.defineProperty(l,"__esModule",{value:!0});var o=e(32),i=e(31),r=function(n){function l(){return null!==n&&n.apply(this,arguments)||this}return u(l,n),l.prototype.parse=function(n){var l=this,e=new i.ImportResult,t=this.parseCsv(n,!0);return null==t?(e.success=!1,e):(t.forEach(function(n){l.processFolder(e,l.getValue("category",n));var t=l.initLoginCipher();t.notes=l.getValue("description",n),t.name=l.getValueOrDefault(l.getValue("title",n),"--"),t.login.username=l.getValue("username",n),t.login.password=l.getValue("password",n),t.login.uris=l.makeUriArray(l.getValue("site",n)),l.processKvp(t,"Password 2",l.getValue("password2",n)),l.cleanupCipher(t),e.ciphers.push(t)}),this.organization&&this.moveFoldersToCollections(e),e.success=!0,e)},l.prototype.getValue=function(n,l){return this.getValueOrDefault(l[n],this.getValueOrDefault(l[" "+n]))},l}(o.BaseImporter);l.PassKeepCsvImporter=r},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)});Object.defineProperty(l,"__esModule",{value:!0});var o=e(32),i=e(31),r=e(177),a=function(n){function l(){return null!==n&&n.apply(this,arguments)||this}return u(l,n),l.prototype.parse=function(n){var l=this,e=new i.ImportResult,t=this.parseCsv(n,!1);if(null==t)return e.success=!1,e;var u=null;return t.forEach(function(n){if(null!=u){if(!(n.length<2||n.length!==u.length)){if(!l.isNullOrWhitespace(n[1]))if(l.organization){(t=n[1].split(",")).forEach(function(n){n=n.trim();for(var l=!0,t=e.collections.length,u=0;u0?t[0].trim():null;l.processFolder(e,o)}var i=l.initLoginCipher();i.name=l.getValueOrDefault(n[0],"--");for(var a=2;a-1?i.login.username=n[a]:l.passwordFieldNames.indexOf(s)>-1?i.login.password=n[a]:l.uriFieldNames.indexOf(s)>-1?i.login.uris=l.makeUriArray(n[a]):l.processKvp(i,u[a],n[a]))}l.cleanupCipher(i),e.ciphers.push(i)}}else u=n.map(function(n){return n})}),e.success=!0,e},l}(o.BaseImporter);l.PadlockCsvImporter=a},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(){}}();l.View=t},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=e(538);l.AttachmentView=t.AttachmentView;var u=e(115);l.CardView=u.CardView;var o=e(157);l.CipherView=o.CipherView;var i=e(179);l.FieldView=i.FieldView;var r=e(217);l.IdentityView=r.IdentityView;var a=e(216);l.LoginUriView=a.LoginUriView;var s=e(156);l.LoginView=s.LoginView;var d=e(91);l.SecureNoteView=d.SecureNoteView;var c=e(752);l.View=c.View},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)});Object.defineProperty(l,"__esModule",{value:!0});var o=e(32),i=e(31),r=e(53),a=e(753),s=["ainfo","autosubmit","notesPlain","ps","scope","tags","title","uuid"],d=function(n){function l(){return null!==n&&n.apply(this,arguments)||this}return u(l,n),l.prototype.parse=function(n){var l=this,e=new i.ImportResult,t=this.parseCsv(n,!0);return null==t?(e.success=!1,e):(t.forEach(function(n){if(!l.isNullOrWhitespace(n.title)){var t=l.initLoginCipher();t.name=l.getValueOrDefault(n.title,"--"),t.notes=l.getValueOrDefault(n.notesPlain,"")+"\n",l.isNullOrWhitespace(n.number)||l.isNullOrWhitespace(n["expiry date"])||(t.type=r.CipherType.Card,t.card=new a.CardView);var u=null;for(var o in n)if(n.hasOwnProperty(o)&&!l.isNullOrWhitespace(n[o])){if(t.type===r.CipherType.Login){if(l.isNullOrWhitespace(t.login.password)&&"password"===o){t.login.password=n[o];continue}if(l.isNullOrWhitespace(t.login.username)&&"username"===o){t.login.username=n[o];continue}if((null==t.login.uris||0===t.login.uri.length)&&"urls"===o){var i=n[o].split(l.newLineRegex);t.login.uris=l.makeUriArray(i);continue}}else if(t.type===r.CipherType.Card){if(l.isNullOrWhitespace(t.card.number)&&"number"===o){t.card.number=n[o],t.card.brand=l.getCardBrand(n.number);continue}if(l.isNullOrWhitespace(t.card.code)&&"verification number"===o){t.card.code=n[o];continue}if(l.isNullOrWhitespace(t.card.cardholderName)&&"cardholder name"===o){t.card.cardholderName=n[o];continue}if(l.isNullOrWhitespace(t.card.expiration)&&"expiry date"===o&&6===n[o].length){t.card.expMonth=n[o].substr(4,2),"0"===t.card.expMonth[0]&&(t.card.expMonth=t.card.expMonth.substr(1,1)),t.card.expYear=n[o].substr(0,4);continue}if("type"===o)continue}-1!==s.indexOf(o)||o.startsWith("section:")||(null==u&&"email"===o&&(u=n[o]),l.processKvp(t,o,n[o]))}t.type===r.CipherType.Login&&!l.isNullOrWhitespace(u)&&l.isNullOrWhitespace(t.login.username)&&-1===u.indexOf("://")&&(t.login.username=u),l.convertToNoteIfNeeded(t),l.cleanupCipher(t),e.ciphers.push(t)}}),e.success=!0,e)},l}(o.BaseImporter);l.OnePasswordWinCsvImporter=d},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)});Object.defineProperty(l,"__esModule",{value:!0});var o=e(32),i=e(31),r=e(115),a=e(91),s=e(53),d=e(101),c=function(n){function l(){var l=null!==n&&n.apply(this,arguments)||this;return l.result=new i.ImportResult,l}return u(l,n),l.prototype.parse=function(n){var l=this;return n.split(this.newLineRegex).forEach(function(n){if(!l.isNullOrWhitespace(n)&&"{"===n[0]){var e=JSON.parse(n),t=l.initLoginCipher();t.favorite=!(!e.openContents||!e.openContents.faveIndex),t.name=l.getValueOrDefault(e.title,"--"),"securenotes.SecureNote"===e.typeName?(t.type=s.CipherType.SecureNote,t.secureNote=new a.SecureNoteView,t.secureNote.type=d.SecureNoteType.Generic):"wallet.financial.CreditCard"===e.typeName?(t.type=s.CipherType.Card,t.card=new r.CardView):t.login.uris=l.makeUriArray(e.location),null!=e.secureContents&&(l.isNullOrWhitespace(e.secureContents.notesPlain)||(t.notes=e.secureContents.notesPlain.split(l.newLineRegex).join("\n")+"\n"),null!=e.secureContents.fields&&l.parseFields(e.secureContents.fields,t,"designation","value","name"),null!=e.secureContents.sections&&e.secureContents.sections.forEach(function(n){null!=n.fields&&l.parseFields(n.fields,t,"n","v","t")})),l.cleanupCipher(t),l.result.ciphers.push(t)}}),this.result.success=!0,this.result},l.prototype.parseFields=function(n,l,e,t,u){var o=this;n.forEach(function(n){if(null!=n[t]&&""!==n[t].toString().trim()){var i=n[t].toString(),r=null!=n[e]?n[e].toString():null;if(l.type===s.CipherType.Login){if(o.isNullOrWhitespace(l.login.username)&&"username"===r)return void(l.login.username=i);if(o.isNullOrWhitespace(l.login.password)&&"password"===r)return void(l.login.password=i);if(o.isNullOrWhitespace(l.login.totp)&&null!=r&&r.startsWith("TOTP_"))return void(l.login.totp=i)}else if(l.type===s.CipherType.Card){if(o.isNullOrWhitespace(l.card.number)&&"ccnum"===r)return l.card.number=i,void(l.card.brand=o.getCardBrand(i));if(o.isNullOrWhitespace(l.card.code)&&"cvv"===r)return void(l.card.code=i);if(o.isNullOrWhitespace(l.card.cardholderName)&&"cardholder"===r)return void(l.card.cardholderName=i);if(o.isNullOrWhitespace(l.card.expiration)&&"expiry"===r&&6===i.length)return l.card.expMonth=i.substr(4,2),"0"===l.card.expMonth[0]&&(l.card.expMonth=l.card.expMonth.substr(1,1)),void(l.card.expYear=i.substr(0,4));if("type"===r)return}var a=o.isNullOrWhitespace(n[u])?"no_name":n[u];o.processKvp(l,a,i)}})},l}(o.BaseImporter);l.OnePassword1PifImporter=c},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)});Object.defineProperty(l,"__esModule",{value:!0});var o=e(32),i=e(31),r=e(53),a=e(101),s=e(91),d=function(n){function l(){return null!==n&&n.apply(this,arguments)||this}return u(l,n),l.prototype.parse=function(n){var l=this,e=new i.ImportResult,t=this.parseCsv(n,!1);return null==t?(e.success=!1,e):(t.forEach(function(n){if(!(n.length<3)){var t="Unassigned"!==l.getValueOrDefault(n[0],"Unassigned")?n[0]:null;l.processFolder(e,t);var u=l.initLoginCipher();if(u.name=l.getValueOrDefault(n[2],"--"),"Web Logins"===n[1])u.login.uris=l.makeUriArray(n[4]),u.login.username=l.getValueOrDefault(n[5]),u.login.password=l.getValueOrDefault(n[6]),u.notes=l.isNullOrWhitespace(n[3])?null:n[3].split("\\n").join("\n");else if(n.length>3){u.type=r.CipherType.SecureNote,u.secureNote=new s.SecureNoteView,u.secureNote.type=a.SecureNoteType.Generic;for(var o=3;o-1){var e=n.ccexp.split("-");e.length>1&&(l.expYear=e[0],l.expMonth=e[1],2===l.expMonth.length&&"0"===l.expMonth[0]&&(l.expMonth=l.expMonth[1]))}return l},l.prototype.parseIdentity=function(n){var l=new d.IdentityView;return l.title=this.getValueOrDefault(n.title),l.firstName=this.getValueOrDefault(n.firstname),l.middleName=this.getValueOrDefault(n.middlename),l.lastName=this.getValueOrDefault(n.lastname),l.username=this.getValueOrDefault(n.username),l.company=this.getValueOrDefault(n.company),l.ssn=this.getValueOrDefault(n.ssn),l.address1=this.getValueOrDefault(n.address1),l.address2=this.getValueOrDefault(n.address2),l.address3=this.getValueOrDefault(n.address3),l.city=this.getValueOrDefault(n.city),l.state=this.getValueOrDefault(n.state),l.postalCode=this.getValueOrDefault(n.zip),l.country=this.getValueOrDefault(n.country),l.email=this.getValueOrDefault(n.email),l.phone=this.getValueOrDefault(n.phone),this.isNullOrWhitespace(l.title)||(l.title=l.title.charAt(0).toUpperCase()+l.title.slice(1)),l},l.prototype.parseSecureNote=function(n,l){var e=this.splitNewLine(n.extra),t=!1;if(e.length){var u=e[0].split(":");if(u.length>1&&"NoteType"===u[0]&&("Credit Card"===u[1]||"Address"===u[1])){if("Credit Card"===u[1]){var o=this.parseSecureNoteMapping(e,{Number:"number","Name on Card":"cardholderName","Security Code":"code"});l.type=f.CipherType.Card,l.card=o[0],l.notes=o[1]}else if("Address"===u[1]){o=this.parseSecureNoteMapping(e,{Title:"title","First Name":"firstName","Last Name":"lastName","Middle Name":"middleName",Company:"company","Address 1":"address1","Address 2":"address2","Address 3":"address3","City / Town":"city",State:"state","Zip / Postal Code":"postalCode",Country:"country","Email Address":"email",Username:"username"});l.type=f.CipherType.Identity,l.identity=o[0],l.notes=o[1]}t=!0}}t||(l.secureNote=new p.SecureNoteView,l.secureNote.type=v.SecureNoteType.Generic,l.notes=this.getValueOrDefault(n.extra))},l.prototype.parseSecureNoteMapping=function(n,l){var e=this,t=null,u={};return n.forEach(function(n){var o=n.split(":");o.length<1||e.isNullOrWhitespace(o[0])||e.isNullOrWhitespace(o[1])||"NoteType"===o[0]||("Notes"===o[0]?e.isNullOrWhitespace(t)?t=o[1]:t+="\n"+o[1]:l.hasOwnProperty(o[0])?u[l[o[0]]]=o[1]:(e.isNullOrWhitespace(t)?t="":t+="\n",t+=o[0]+": "+o[1]))}),[u,t]},l}(o.BaseImporter);l.LastPassCsvImporter=h},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)});Object.defineProperty(l,"__esModule",{value:!0});var o=e(32),i=e(31),r=function(n){function l(){return null!==n&&n.apply(this,arguments)||this}return u(l,n),l.prototype.parse=function(n){var l=this,e=new i.ImportResult,t=this.parseCsv(n,!1);return null==t?(e.success=!1,e):(t.forEach(function(n){if(!(n.length<6)){l.processFolder(e,n[0]);var t=l.initLoginCipher();if(t.notes=l.getValueOrDefault(n[5])+"\n",t.name=l.getValueOrDefault(n[1],"--"),t.login.username=l.getValueOrDefault(n[2]),t.login.password=l.getValueOrDefault(n[3]),t.login.uris=l.makeUriArray(n[4]),n.length>7)for(var u=7;u Root > Group");return null==e?(this.result.errorMessage="Missing `KeePassFile > Root > Group` node.",this.result.success=!1,this.result):(this.traverse(e,!0,""),this.organization&&this.moveFoldersToCollections(this.result),this.result.success=!0,this.result)},l.prototype.traverse=function(n,l,e){var t=this,u=this.result.folders.length,o=e;if(!l){""!==o&&(o+="/");var i=this.querySelectorDirectChild(n,"Name");o+=null==i?"-":i.textContent;var a=new r.FolderView;a.name=o,this.result.folders.push(a)}this.querySelectorAllDirectChild(n,"Entry").forEach(function(n){var e=t.result.ciphers.length,o=t.initLoginCipher();t.querySelectorAllDirectChild(n,"String").forEach(function(n){var l=t.querySelectorDirectChild(n,"Value"),e=null!=l?l.textContent:null;if(!t.isNullOrWhitespace(e)){var u=t.querySelectorDirectChild(n,"Key"),i=null!=u?u.textContent:null;"URL"===i?o.login.uris=t.makeUriArray(e):"UserName"===i?o.login.username=e:"Password"===i?o.login.password=e:"Title"===i?o.name=e:"Notes"===i?o.notes+=e+"\n":t.processKvp(o,i,e)}}),t.cleanupCipher(o),t.result.ciphers.push(o),l||t.result.folderRelationships.push([e,u])}),this.querySelectorAllDirectChild(n,"Group").forEach(function(n){t.traverse(n,!1,o)})},l}(o.BaseImporter);l.KeePass2XmlImporter=a},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)});Object.defineProperty(l,"__esModule",{value:!0});var o=e(32),i=e(31),r=function(n){function l(){return null!==n&&n.apply(this,arguments)||this}return u(l,n),l.prototype.parse=function(n){var l=this,e=new i.ImportResult,t=JSON.parse(n);if(null==t||0===Object.keys(t).length)return e.success=!1,e;var u=function(n){if(!t.hasOwnProperty(n)||o.isNullOrWhitespace(n)||0===t[n].length)return"continue";t[n].forEach(function(t){if(!l.isNullOrWhitespace(t.display_name)&&0===t.display_name.indexOf("http")){l.processFolder(e,n);var u=l.initLoginCipher();if(u.name=t.display_name.replace("http://","").replace("https://",""),u.name.length>30&&(u.name=u.name.substring(0,30)),u.login.password=l.getValueOrDefault(t.secret),u.login.uris=l.makeUriArray(t.display_name),null!=t.attributes)for(var o in u.login.username=null!=t.attributes?l.getValueOrDefault(t.attributes.username_value):null,t.attributes)t.attributes.hasOwnProperty(o)&&"username_value"!==o&&"xdg:schema"!==o&&l.processKvp(u,o,t.attributes[o]);l.convertToNoteIfNeeded(u),l.cleanupCipher(u),e.ciphers.push(u)}})},o=this;for(var r in t)u(r);return this.organization&&this.moveFoldersToCollections(e),e.success=!0,e},l}(o.BaseImporter);l.GnomeJsonImporter=r},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)});Object.defineProperty(l,"__esModule",{value:!0});var o=e(32),i=e(31),r=function(n){function l(){return null!==n&&n.apply(this,arguments)||this}return u(l,n),l.prototype.parse=function(n){var l=this,e=new i.ImportResult,t=this.parseCsv(n,!0);return null==t?(e.success=!1,e):(t.forEach(function(n){var t=l.initLoginCipher();t.name=l.getValueOrDefault(l.nameFromUrl(n.hostname),"--"),t.login.username=l.getValueOrDefault(n.username),t.login.password=l.getValueOrDefault(n.password),t.login.uris=l.makeUriArray(n.hostname),l.cleanupCipher(t),e.ciphers.push(t)}),e.success=!0,e)},l}(o.BaseImporter);l.FirefoxCsvImporter=r},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)});Object.defineProperty(l,"__esModule",{value:!0});var o=e(32),i=e(31),r=e(53),a=e(101),s=e(115),d=e(91),c=function(n){function l(){return null!==n&&n.apply(this,arguments)||this}return u(l,n),l.prototype.parse=function(n){var l=this,e=new i.ImportResult,t=this.parseCsv(n,!1);if(null==t)return e.success=!1,e;var u=!0;return t.forEach(function(n){if(n.length<2||u&&"Title"===n[0])u=!1;else{var t=l.initLoginCipher();if(t.notes=l.getValueOrDefault(n[n.length-1]),t.name=l.getValueOrDefault(n[0],"--"),(2===n.length||n.indexOf("Username")<0&&n.indexOf("Password")<0&&n.indexOf("Email")&&n.indexOf("URL")<0)&&(t.type=r.CipherType.SecureNote,t.secureNote=new d.SecureNoteView,t.secureNote.type=a.SecureNoteType.Generic),n.indexOf("Cardholder")>-1&&n.indexOf("Number")>-1&&n.indexOf("Expiry date")>-1&&(t.type=r.CipherType.Card,t.card=new s.CardView),n.length>2&&n.length%2==0)for(var o=0;o-1?t.login.password=l.getValueOrDefault(o.value):null==t.login.username&&l.usernameFieldNames.indexOf(i)>-1?t.login.username=l.getValueOrDefault(o.value):(null==t.login.uris||0===t.login.uris.length)&&l.uriFieldNames.indexOf(i)>-1?t.login.uris=l.makeUriArray(o.value):l.processKvp(t,o.label,o.value)}}l.convertToNoteIfNeeded(t),l.cleanupCipher(t),e.ciphers.push(t)}),e.success=!0,e)},l}(o.BaseImporter);l.ClipperzHtmlImporter=r},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)});Object.defineProperty(l,"__esModule",{value:!0});var o=e(32),i=e(31),r=function(n){function l(){return null!==n&&n.apply(this,arguments)||this}return u(l,n),l.prototype.parse=function(n){var l=this,e=new i.ImportResult,t=this.parseCsv(n,!0);return null==t?(e.success=!1,e):(t.forEach(function(n){var t=l.initLoginCipher();t.name=l.getValueOrDefault(n.name,"--"),t.login.username=l.getValueOrDefault(n.username),t.login.password=l.getValueOrDefault(n.password),t.login.uris=l.makeUriArray(n.url),l.cleanupCipher(t),e.ciphers.push(t)}),e.success=!0,e)},l}(o.BaseImporter);l.ChromeCsvImporter=r},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)});Object.defineProperty(l,"__esModule",{value:!0});var o=e(32),i=e(31),r=function(n){function l(){return null!==n&&n.apply(this,arguments)||this}return u(l,n),l.prototype.parse=function(n){var l=this,e=new i.ImportResult,t=this.parseCsv(n,!0);return null==t?(e.success=!1,e):(t.forEach(function(n){"null"===n.label&&(n.label=null);var t=l.initLoginCipher();t.name=l.getValueOrDefault(n.label,l.getValueOrDefault(l.nameFromUrl(n.domain),"--")),t.login.uris=l.makeUriArray(n.domain),t.login.password=l.getValueOrDefault(n.password),l.isNullOrWhitespace(n.email)&&!l.isNullOrWhitespace(n.username)?t.login.username=n.username:(t.login.username=l.getValueOrDefault(n.email),t.notes=l.getValueOrDefault(n.username)),l.cleanupCipher(t),e.ciphers.push(t)}),e.success=!0,e)},l}(o.BaseImporter);l.BlurCsvImporter=r},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)});Object.defineProperty(l,"__esModule",{value:!0});var o=e(32),i=e(31),r=e(157),a=e(177),s=e(179),d=e(156),c=e(91),p=e(53),f=e(219),v=e(101),h=function(n){function l(){return null!==n&&n.apply(this,arguments)||this}return u(l,n),l.prototype.parse=function(n){var l=this,e=new i.ImportResult,t=this.parseCsv(n,!0);return null==t?(e.success=!1,e):(t.forEach(function(n){l.organization&&!l.isNullOrWhitespace(n.collections)?n.collections.split(",").forEach(function(n){for(var l=!0,t=e.collections.length,u=0;ui+2&&(h.value=u[o].substr(i+2)),t.fields.push(h)}}switch(null!=n.type?n.type.toLowerCase():null){case"login":case null:t.type=p.CipherType.Login,t.login=new d.LoginView,t.login.totp=l.getValueOrDefault(n.login_totp||n.totp),t.login.username=l.getValueOrDefault(n.login_username||n.username),t.login.password=l.getValueOrDefault(n.login_password||n.password);var g=l.parseSingleRowCsv(n.login_uri||n.uri);t.login.uris=l.makeUriArray(g);break;case"note":t.type=p.CipherType.SecureNote,t.secureNote=new c.SecureNoteView,t.secureNote.type=v.SecureNoteType.Generic}e.ciphers.push(t)}),e.success=!0,e)},l}(o.BaseImporter);l.BitwardenCsvImporter=h},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)});Object.defineProperty(l,"__esModule",{value:!0});var o=e(32),i=e(31),r=function(n){function l(){return null!==n&&n.apply(this,arguments)||this}return u(l,n),l.prototype.parse=function(n){var l=this,e=new i.ImportResult,t=this.parseCsv(n,!0);return null==t?(e.success=!1,e):(t.forEach(function(n){var t=l.initLoginCipher();t.name=l.getValueOrDefault(n.name,l.getValueOrDefault(l.nameFromUrl(n.website),"--")),t.login.uris=l.makeUriArray(n.website),t.login.password=l.getValueOrDefault(n.password),l.isNullOrWhitespace(n.username)&&!l.isNullOrWhitespace(n.secondary_username)?t.login.username=n.secondary_username:(t.login.username=l.getValueOrDefault(n.username),t.notes=l.getValueOrDefault(n.secondary_username)),l.cleanupCipher(t),e.ciphers.push(t)}),e.success=!0,e)},l}(o.BaseImporter);l.AviraCsvImporter=r},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)});Object.defineProperty(l,"__esModule",{value:!0});var o=e(32),i=e(31),r=function(n){function l(){return null!==n&&n.apply(this,arguments)||this}return u(l,n),l.prototype.parse=function(n){var l=this,e=new i.ImportResult,t=this.parseCsv(n,!1);return null==t?(e.success=!1,e):(t.forEach(function(n){if(!(n.length<2)){var t=l.initLoginCipher();if(t.notes=l.getValueOrDefault(n[n.length-1]),t.name=l.getValueOrDefault(n[0],"--"),n.length>2&&n.length%2==0)for(var u=0;u-1?t.login.password=l.getValueOrDefault(o):null==t.login.username&&l.usernameFieldNames.indexOf(r)>-1?t.login.username=l.getValueOrDefault(o):(null==t.login.uris||0===t.login.uris.length)&&l.uriFieldNames.indexOf(r)>-1?t.login.uris=l.makeUriArray(o):l.processKvp(t,i,o)}}l.convertToNoteIfNeeded(t),l.cleanupCipher(t),e.ciphers.push(t)}}),e.success=!0,e)},l}(o.BaseImporter);l.AscendoCsvImporter=r},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(){this.ciphers=[],this.folders=[],this.folderRelationships=[]}}();l.ImportCiphersRequest=t},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=e(0),u=e(13),o=e(5),i=e(40),r=e(37),a=e(2),s=e(7),d=e(18),c=e(17),p=e(214),f=e(3),v=e(9),h=e(26),g=e(50),m=e(4),y=e(10),C=t.ɵcrt({encapsulation:2,styles:[],data:{}});function b(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,3,"option",[],null,null,null,null,null)),t.ɵdid(1,147456,null,0,u.NgSelectOption,[t.ElementRef,t.Renderer2,[2,u.SelectControlValueAccessor]],{ngValue:[0,"ngValue"]},null),t.ɵdid(2,147456,null,0,u.ɵq,[t.ElementRef,t.Renderer2,[8,null]],{ngValue:[0,"ngValue"]},null),(n()(),t.ɵted(3,null,["",""]))],function(n,l){n(l,1,0,l.context.$implicit.id),n(l,2,0,l.context.$implicit.id)},function(n,l){n(l,3,0,l.context.$implicit.name)})}function S(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,3,"option",[],null,null,null,null,null)),t.ɵdid(1,147456,null,0,u.NgSelectOption,[t.ElementRef,t.Renderer2,[2,u.SelectControlValueAccessor]],{ngValue:[0,"ngValue"]},null),t.ɵdid(2,147456,null,0,u.ɵq,[t.ElementRef,t.Renderer2,[8,null]],{ngValue:[0,"ngValue"]},null),(n()(),t.ɵted(3,null,["",""]))],function(n,l){n(l,1,0,l.context.$implicit.id),n(l,2,0,l.context.$implicit.id)},function(n,l){n(l,3,0,l.context.$implicit.name)})}function w(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,8,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,2,"option",[["disabled",""],["value","-"]],null,null,null,null,null)),t.ɵdid(3,147456,null,0,u.NgSelectOption,[t.ElementRef,t.Renderer2,[2,u.SelectControlValueAccessor]],{value:[0,"value"]},null),t.ɵdid(4,147456,null,0,u.ɵq,[t.ElementRef,t.Renderer2,[8,null]],{value:[0,"value"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,S)),t.ɵdid(7,802816,null,0,o.NgForOf,[t.ViewContainerRef,t.TemplateRef,t.IterableDiffers],{ngForOf:[0,"ngForOf"]},null),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){var e=l.component;n(l,3,0,"-");n(l,4,0,"-"),n(l,7,0,e.importOptions)},null)}function R(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,4,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n See detailed instructions on our help site at\n "])),(n()(),t.ɵeld(2,0,null,null,1,"a",[["href","https://help.bitwarden.com/article/export-your-data/"],["rel","noopener"],["target","_blank"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["https://help.bitwarden.com/article/export-your-data/"])),(n()(),t.ɵted(-1,null,["\n "]))],null,null)}function _(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,4,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n See detailed instructions on our help site at\n "])),(n()(),t.ɵeld(2,0,null,null,1,"a",[["href","https://help.bitwarden.com/article/import-from-lastpass/"],["rel","noopener"],["target","_blank"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["https://help.bitwarden.com/article/import-from-lastpass/"])),(n()(),t.ɵted(-1,null,["\n "]))],null,null)}function I(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Using the KeePassX desktop application, navigate to "Database" → "Export to CSV file" and save the CSV file.\n ']))],null,null)}function A(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n In the Avira web vault, go to "Settings" → "My Data" → "Export data" and save the CSV file.\n ']))],null,null)}function E(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n In the Blur web vault, click your username at the top and go to "Settings" → "Export Data", then click "Export CSV"\n for your "Accounts".\n ']))],null,null)}function O(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Using the SaveInCloud desktop application, navigate to "File" → "Export" → "As XML" and save the XML file.\n ']))],null,null)}function N(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Using the Padlock desktop application, click the hamburger icon in the top left corner and navigate to "Settings" →\n "Export" button and save the file "As CSV".\n ']))],null,null)}function T(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Using the KeePass 2 desktop application, navigate to "File" → "Export" and select the "KeePass XML (2.x)" option.\n ']))],null,null)}function k(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Using the Universal Password Manager desktop application, navigate to "Database" → "Export" and save the CSV file.\n ']))],null,null)}function V(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Using the SaferPass browser extension, click the hamburger icon in the top left corner and navigate to "Settings". Click\n the "Export accounts" button to save the CSV file.\n ']))],null,null)}function P(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Using the Meldium web vault, navigate to "Settings". Locate the "Export data" function and click "Show me my data" to save\n the CSV file.\n ']))],null,null)}function M(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Log into the Keeper web vault (keepersecurity.com/vault). Navigate to "Backup" (top right) and find the "Export to .csv File"\n option. Click "Export Now" to save the CSV file.\n ']))],null,null)}function x(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"span",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n The process is exactly the same as importing from Google Chrome.\n "]))],null,null)}function D(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,7,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,x)),t.ɵdid(3,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n See detailed instructions on our help site at\n "])),(n()(),t.ɵeld(5,0,null,null,1,"a",[["href","https://help.bitwarden.com/article/import-from-chrome/"],["rel","noopener"],["target","_blank"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["https://help.bitwarden.com/article/import-from-chrome/"])),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){n(l,3,0,"chromecsv"!==l.component.format)},null)}function U(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,4,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n Use the\n "])),(n()(),t.ɵeld(2,0,null,null,1,"a",[["href","https://github.com/kspearrin/ff-password-exporter/blob/master/README.md#ff-password-exporter"],["rel","noopener"],["target","_blank"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["FF Password Exporter"])),(n()(),t.ɵted(-1,null,[" application to export your passwords to a CSV file.\n "]))],null,null)}function F(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,4,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n See detailed instructions on our help site at\n "])),(n()(),t.ɵeld(2,0,null,null,1,"a",[["href","https://help.bitwarden.com/article/import-from-1password/"],["rel","noopener"],["target","_blank"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["https://help.bitwarden.com/article/import-from-1password/"])),(n()(),t.ɵted(-1,null,[".\n "]))],null,null)}function L(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Using the Password Dragon desktop application, navigate to "File" → "Export" → "To XML". In the dialog that pops\n up select "All Rows" and check all fields. Click the "Export" button and save the XML file.\n ']))],null,null)}function G(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Using the Enpass desktop application, navigate to "File" → "Export" → "As CSV". Select "OK" to the warning alert\n and save the CSV file. Note that the importer only supports files exported while Enpass is set to the English\n language, so adjust your settings accordingly.\n ']))],null,null)}function q(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Using the Password Safe desktop application, navigate to "File" → "Export To" → "XML format..." and save the XML\n file.\n ']))],null,null)}function z(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Using the Dashlane desktop application, navigate to "File" → "Export" → "Unsecured archive (readable) in CSV format"\n and save the CSV file.\n ']))],null,null)}function j(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Using the mSecure desktop application, navigate to "File" → "Export" → "CSV File..." and save the CSV file.\n ']))],null,null)}function B(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Using the Sticky Password desktop application, navigate to "Menu" (top right) → "Export" → "Export all". Select\n the unencrypted format XML option and save the XML file.\n ']))],null,null)}function K(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Using the True Key desktop application, click the gear icon (top right) and then navigate to "App Settings". Click the "Export"\n button, enter your password and save the CSV file.\n ']))],null,null)}function H(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Log into the Clipperz web application (clipperz.is/app). Click the hamburger menu icon in the top right to expand the navigation\n bar. Navigate to "Data" → "Export". Click the "download HTML+JSON" button to save the HTML file.\n ']))],null,null)}function $(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Using the RoboForm Editor desktop application, navigate to "RoboForm" (top left) → "Options" → "Account & Data"\n and click the "Export" button. Select all of your data, change the "Format" to "CSV file" and then click the\n "Export" button to save the CSV file. Note: RoboForm only allows you to export Logins. Other items will not be\n exported.\n ']))],null,null)}function W(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Log into the Passbolt web vault and navigate to the "Passwords" listing. Select all of the passwords you would like to export\n and click the "Export" button at the top of the listing. Choose the "csv (lastpass)" export format and click\n the "Export" button.\n ']))],null,null)}function Y(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Using the Ascendo DataVault desktop application, navigate to "Tools" → "Export". In the dialog that pops up, select\n the "All Items (DVX, CSV)" option. Click the "Ok" button to save the CSV file.\n ']))],null,null)}function Z(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Using the Password Boss desktop application, navigate to "File" → "Export data" → "Password Boss JSON - not encrypted"\n and save the JSON file.\n ']))],null,null)}function J(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,4,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Log into the Zoho web vault (vault.zoho.com). Navigate to "Tools" → "Export Secrets". Select "All Secrets" and click\n the "Zoho Vault Format CSV" button. Highlight and copy the data from the textarea. Open a text editor like Notepad\n and paste the data. Save the data from the text editor as\n '])),(n()(),t.ɵeld(2,0,null,null,1,"code",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["zoho_export.csv"])),(n()(),t.ɵted(-1,null,[".\n "]))],null,null)}function X(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Using the SplashID Safe desktop application, click on the SplashID blue lock logo in the top right corner. Navigate to "Export"\n → "Export as CSV" and save the CSV file.\n ']))],null,null)}function Q(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Using the PassKeep mobile app, navigate to "Backup/Restore". Locate the "CSV Backup/Restore" section and click "Backup to\n CSV" to save the CSV file.\n ']))],null,null)}function nn(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,16,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n Make sure you have python-keyring and python-gnomekeyring installed. Save the\n "])),(n()(),t.ɵeld(2,0,null,null,1,"a",[["href","https://bit.ly/2sMldAI"],["rel","noopener"],["target","_blank"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["GNOME Keyring Import/Export"])),(n()(),t.ɵted(-1,null,[" python script to your desktop as\n "])),(n()(),t.ɵeld(5,0,null,null,1,"code",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["pw_helper.py"])),(n()(),t.ɵted(-1,null,[". Open terminal and run\n "])),(n()(),t.ɵeld(8,0,null,null,1,"code",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["chmod +rx Desktop/pw_helper.py"])),(n()(),t.ɵted(-1,null,[" and then\n "])),(n()(),t.ɵeld(11,0,null,null,1,"code",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["python Desktop/pw_helper.py export Desktop/my_passwords.json"])),(n()(),t.ɵted(-1,null,[". Then upload the resulting\n "])),(n()(),t.ɵeld(14,0,null,null,1,"code",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["my_passwords.json"])),(n()(),t.ɵted(-1,null,[" file here to Bitwarden.\n "]))],null,null)}function ln(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,['\n Using the Password Agent desktop application navigate to "File" → "Export", select the "Fields to export" button and\n check all of the fields, change the "Output format" to "CSV", and then click the "Start" button to save the CSV\n file.\n ']))],null,null)}function en(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,98,"app-callout",[["type","info"]],null,null,null,i.View_CalloutComponent_0,i.RenderType_CalloutComponent)),t.ɵdid(1,114688,null,0,r.CalloutComponent,[a.I18nService],{type:[0,"type"],title:[1,"title"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,R)),t.ɵdid(4,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,_)),t.ɵdid(7,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,I)),t.ɵdid(10,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,A)),t.ɵdid(13,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,E)),t.ɵdid(16,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,O)),t.ɵdid(19,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,N)),t.ɵdid(22,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,T)),t.ɵdid(25,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,k)),t.ɵdid(28,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,V)),t.ɵdid(31,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,P)),t.ɵdid(34,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,M)),t.ɵdid(37,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,D)),t.ɵdid(40,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,U)),t.ɵdid(43,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,F)),t.ɵdid(46,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,L)),t.ɵdid(49,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,G)),t.ɵdid(52,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,q)),t.ɵdid(55,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,z)),t.ɵdid(58,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,j)),t.ɵdid(61,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,B)),t.ɵdid(64,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,K)),t.ɵdid(67,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,H)),t.ɵdid(70,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,$)),t.ɵdid(73,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,W)),t.ɵdid(76,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,Y)),t.ɵdid(79,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,Z)),t.ɵdid(82,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,J)),t.ɵdid(85,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,X)),t.ɵdid(88,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,Q)),t.ɵdid(91,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,nn)),t.ɵdid(94,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,ln)),t.ɵdid(97,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n "]))],function(n,l){var e=l.component;n(l,1,0,"info",t.ɵinlineInterpolate(1,"",e.getFormatInstructionTitle(),"")),n(l,4,0,"bitwardencsv"===e.format),n(l,7,0,"lastpasscsv"===e.format),n(l,10,0,"keepassxcsv"===e.format),n(l,13,0,"aviracsv"===e.format),n(l,16,0,"blurcsv"===e.format),n(l,19,0,"safeincloudxml"===e.format),n(l,22,0,"padlockcsv"===e.format),n(l,25,0,"keepass2xml"===e.format),n(l,28,0,"upmcsv"===e.format),n(l,31,0,"saferpasscsv"===e.format),n(l,34,0,"meldiumcsv"===e.format),n(l,37,0,"keepercsv"===e.format),n(l,40,0,"chromecsv"===e.format||"operacsv"===e.format||"vivaldicsv"===e.format),n(l,43,0,"firefoxcsv"===e.format),n(l,46,0,"1password1pif"===e.format||"1passwordwincsv"===e.format),n(l,49,0,"passworddragonxml"===e.format),n(l,52,0,"enpasscsv"===e.format),n(l,55,0,"pwsafexml"===e.format),n(l,58,0,"dashlanecsv"===e.format),n(l,61,0,"msecurecsv"===e.format),n(l,64,0,"stickypasswordxml"===e.format),n(l,67,0,"truekeycsv"===e.format),n(l,70,0,"clipperzhtml"===e.format),n(l,73,0,"roboformcsv"===e.format),n(l,76,0,"passboltcsv"===e.format),n(l,79,0,"ascendocsv"===e.format),n(l,82,0,"passwordbossjson"===e.format),n(l,85,0,"zohovaultcsv"===e.format),n(l,88,0,"splashidcsv"===e.format),n(l,91,0,"passkeepcsv"===e.format),n(l,94,0,"gnomejson"===e.format),n(l,97,0,"passwordagentcsv"===e.format)},null)}function tn(n){return t.ɵvid(0,[t.ɵpid(0,s.I18nPipe,[a.I18nService]),(n()(),t.ɵeld(1,0,null,null,5,"div",[["class","page-header"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(3,0,null,null,2,"h1",[],null,null,null,null,null)),(n()(),t.ɵted(4,null,["",""])),t.ɵppd(5,1),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵeld(8,0,[["form",1]],null,76,"form",[["ngNativeValidate",""]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngSubmit"],[null,"submit"],[null,"reset"]],function(n,l,e){var u=!0,o=n.component;"submit"===l&&(u=!1!==t.ɵnov(n,9).onSubmit(e)&&u);"reset"===l&&(u=!1!==t.ɵnov(n,9).onReset()&&u);"ngSubmit"===l&&(u=!1!==o.submit()&&u);return u},null,null)),t.ɵdid(9,4210688,null,0,u.NgForm,[[8,null],[8,null]],null,{ngSubmit:"ngSubmit"}),t.ɵprd(2048,null,u.ControlContainer,null,[u.NgForm]),t.ɵdid(11,16384,null,0,u.NgControlStatusGroup,[u.ControlContainer],null,null),t.ɵdid(12,540672,null,0,d.ApiActionDirective,[t.ElementRef,c.ValidationService],{appApiAction:[0,"appApiAction"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(14,0,null,null,27,"div",[["class","row"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(16,0,null,null,24,"div",[["class","col-6"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(18,0,null,null,21,"div",[["class","form-group"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(20,0,null,null,2,"label",[["for","type"]],null,null,null,null,null)),(n()(),t.ɵted(21,null,["1. ",""])),t.ɵppd(22,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(24,0,null,null,14,"select",[["class","form-control"],["id","type"],["name","Format"],["required",""]],[[1,"required",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"change"],[null,"blur"]],function(n,l,e){var u=!0,o=n.component;"change"===l&&(u=!1!==t.ɵnov(n,25).onChange(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,25).onTouched()&&u);"ngModelChange"===l&&(u=!1!==(o.format=e)&&u);return u},null,null)),t.ɵdid(25,16384,null,0,u.SelectControlValueAccessor,[t.Renderer2,t.ElementRef],null,null),t.ɵdid(26,16384,null,0,u.RequiredValidator,[],{required:[0,"required"]},null),t.ɵprd(1024,null,u.NG_VALIDATORS,function(n){return[n]},[u.RequiredValidator]),t.ɵprd(1024,null,u.NG_VALUE_ACCESSOR,function(n){return[n]},[u.SelectControlValueAccessor]),t.ɵdid(29,671744,null,0,u.NgModel,[[2,u.ControlContainer],[2,u.NG_VALIDATORS],[8,null],[2,u.NG_VALUE_ACCESSOR]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,u.NgControl,null,[u.NgModel]),t.ɵdid(31,16384,null,0,u.NgControlStatus,[u.NgControl],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,b)),t.ɵdid(34,802816,null,0,o.NgForOf,[t.ViewContainerRef,t.TemplateRef,t.IterableDiffers],{ngForOf:[0,"ngForOf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,w)),t.ɵdid(37,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,en)),t.ɵdid(44,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(46,0,null,null,13,"div",[["class","row"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(48,0,null,null,10,"div",[["class","col-6"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(50,0,null,null,7,"div",[["class","form-group"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(52,0,null,null,2,"label",[["for","file"]],null,null,null,null,null)),(n()(),t.ɵted(53,null,["2. ",""])),t.ɵppd(54,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(56,0,null,null,0,"input",[["class","form-control-file"],["id","file"],["name","file"],["type","file"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(61,0,null,null,12,"div",[["class","form-group"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(63,0,null,null,2,"label",[["for","fileContents"]],null,null,null,null,null)),(n()(),t.ɵted(64,null,["",""])),t.ɵppd(65,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(67,0,null,null,5,"textarea",[["class","form-control"],["id","fileContents"],["name","FileContents"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(n,l,e){var u=!0,o=n.component;"input"===l&&(u=!1!==t.ɵnov(n,68)._handleInput(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,68).onTouched()&&u);"compositionstart"===l&&(u=!1!==t.ɵnov(n,68)._compositionStart()&&u);"compositionend"===l&&(u=!1!==t.ɵnov(n,68)._compositionEnd(e.target.value)&&u);"ngModelChange"===l&&(u=!1!==(o.fileContents=e)&&u);return u},null,null)),t.ɵdid(68,16384,null,0,u.DefaultValueAccessor,[t.Renderer2,t.ElementRef,[2,u.COMPOSITION_BUFFER_MODE]],null,null),t.ɵprd(1024,null,u.NG_VALUE_ACCESSOR,function(n){return[n]},[u.DefaultValueAccessor]),t.ɵdid(70,671744,null,0,u.NgModel,[[2,u.ControlContainer],[8,null],[8,null],[2,u.NG_VALUE_ACCESSOR]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,u.NgControl,null,[u.NgModel]),t.ɵdid(72,16384,null,0,u.NgControlStatus,[u.NgControl],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(75,0,null,null,8,"button",[["class","btn btn-primary btn-submit"],["type","submit"]],[[8,"disabled",0]],null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(77,0,null,null,1,"i",[["class","fa fa-spinner fa-spin"]],[[8,"title",0]],null,null,null,null)),t.ɵppd(78,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(80,0,null,null,2,"span",[],null,null,null,null,null)),(n()(),t.ɵted(81,null,["",""])),t.ɵppd(82,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){var e=l.component;n(l,12,0,e.formPromise);n(l,26,0,"");n(l,29,0,"Format",e.format),n(l,34,0,e.featuredImportOptions),n(l,37,0,e.importOptions&&e.importOptions.length),n(l,44,0,e.format);n(l,70,0,"FileContents",e.fileContents)},function(n,l){n(l,4,0,t.ɵunv(l,4,0,n(l,5,0,t.ɵnov(l,0),"importData"))),n(l,8,0,t.ɵnov(l,11).ngClassUntouched,t.ɵnov(l,11).ngClassTouched,t.ɵnov(l,11).ngClassPristine,t.ɵnov(l,11).ngClassDirty,t.ɵnov(l,11).ngClassValid,t.ɵnov(l,11).ngClassInvalid,t.ɵnov(l,11).ngClassPending),n(l,21,0,t.ɵunv(l,21,0,n(l,22,0,t.ɵnov(l,0),"selectFormat"))),n(l,24,0,t.ɵnov(l,26).required?"":null,t.ɵnov(l,31).ngClassUntouched,t.ɵnov(l,31).ngClassTouched,t.ɵnov(l,31).ngClassPristine,t.ɵnov(l,31).ngClassDirty,t.ɵnov(l,31).ngClassValid,t.ɵnov(l,31).ngClassInvalid,t.ɵnov(l,31).ngClassPending),n(l,53,0,t.ɵunv(l,53,0,n(l,54,0,t.ɵnov(l,0),"selectImportFile"))),n(l,64,0,t.ɵunv(l,64,0,n(l,65,0,t.ɵnov(l,0),"orCopyPasteFileContents"))),n(l,67,0,t.ɵnov(l,72).ngClassUntouched,t.ɵnov(l,72).ngClassTouched,t.ɵnov(l,72).ngClassPristine,t.ɵnov(l,72).ngClassDirty,t.ɵnov(l,72).ngClassValid,t.ɵnov(l,72).ngClassInvalid,t.ɵnov(l,72).ngClassPending),n(l,75,0,t.ɵnov(l,8).loading),n(l,77,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,77,0,n(l,78,0,t.ɵnov(l,0),"loading")),"")),n(l,81,0,t.ɵunv(l,81,0,n(l,82,0,t.ɵnov(l,0),"importData")))})}function un(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"app-import",[],null,null,null,tn,C)),t.ɵdid(1,114688,null,0,p.ImportComponent,[a.I18nService,f.Angulartics2,v.ToasterService,h.CipherService,g.FolderService,m.ApiService,y.Router],null,null)],function(n,l){n(l,1,0)},null)}l.RenderType_ImportComponent=C,l.View_ImportComponent_0=tn,l.View_ImportComponent_Host_0=un;var on=t.ɵccf("app-import",p.ImportComponent,un,{},{},[]);l.ImportComponentNgFactory=on},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=e(0),u=e(7),o=e(2),i=e(10),r=e(5),a=e(261),s=t.ɵcrt({encapsulation:2,styles:[],data:{}});function d(n){return t.ɵvid(0,[t.ɵpid(0,u.I18nPipe,[o.I18nService]),(n()(),t.ɵeld(1,0,null,null,65,"div",[["class","container page-content"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(3,0,null,null,62,"div",[["class","row"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(5,0,null,null,53,"div",[["class","col-3"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(7,0,null,null,32,"div",[["class","card mb-4"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(9,0,null,null,2,"div",[["class","card-header"]],null,null,null,null,null)),(n()(),t.ɵted(10,null,["",""])),t.ɵppd(11,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(13,0,null,null,25,"div",[["class","list-group list-group-flush"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(15,0,null,null,6,"a",[["class","list-group-item"],["routerLink","generator"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(n,l,e){var u=!0;"click"===l&&(u=!1!==t.ɵnov(n,16).onClick(e.button,e.ctrlKey,e.metaKey,e.shiftKey)&&u);return u},null,null)),t.ɵdid(16,671744,[[2,4]],0,i.RouterLinkWithHref,[i.Router,i.ActivatedRoute,r.LocationStrategy],{routerLink:[0,"routerLink"]},null),t.ɵdid(17,1720320,null,2,i.RouterLinkActive,[i.Router,t.ElementRef,t.Renderer2,t.ChangeDetectorRef],{routerLinkActive:[0,"routerLinkActive"]},null),t.ɵqud(603979776,1,{links:1}),t.ɵqud(603979776,2,{linksWithHrefs:1}),(n()(),t.ɵted(20,null,["\n ","\n "])),t.ɵppd(21,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(23,0,null,null,6,"a",[["class","list-group-item"],["routerLink","import"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(n,l,e){var u=!0;"click"===l&&(u=!1!==t.ɵnov(n,24).onClick(e.button,e.ctrlKey,e.metaKey,e.shiftKey)&&u);return u},null,null)),t.ɵdid(24,671744,[[4,4]],0,i.RouterLinkWithHref,[i.Router,i.ActivatedRoute,r.LocationStrategy],{routerLink:[0,"routerLink"]},null),t.ɵdid(25,1720320,null,2,i.RouterLinkActive,[i.Router,t.ElementRef,t.Renderer2,t.ChangeDetectorRef],{routerLinkActive:[0,"routerLinkActive"]},null),t.ɵqud(603979776,3,{links:1}),t.ɵqud(603979776,4,{linksWithHrefs:1}),(n()(),t.ɵted(28,null,["\n ","\n "])),t.ɵppd(29,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(31,0,null,null,6,"a",[["class","list-group-item"],["routerLink","export"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(n,l,e){var u=!0;"click"===l&&(u=!1!==t.ɵnov(n,32).onClick(e.button,e.ctrlKey,e.metaKey,e.shiftKey)&&u);return u},null,null)),t.ɵdid(32,671744,[[6,4]],0,i.RouterLinkWithHref,[i.Router,i.ActivatedRoute,r.LocationStrategy],{routerLink:[0,"routerLink"]},null),t.ɵdid(33,1720320,null,2,i.RouterLinkActive,[i.Router,t.ElementRef,t.Renderer2,t.ChangeDetectorRef],{routerLinkActive:[0,"routerLinkActive"]},null),t.ɵqud(603979776,5,{links:1}),t.ɵqud(603979776,6,{linksWithHrefs:1}),(n()(),t.ɵted(36,null,["\n ","\n "])),t.ɵppd(37,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(41,0,null,null,16,"div",[["class","card"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(43,0,null,null,2,"div",[["class","card-header"]],null,null,null,null,null)),(n()(),t.ɵted(44,null,["",""])),t.ɵppd(45,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(47,0,null,null,9,"div",[["class","list-group list-group-flush"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(49,0,null,null,6,"a",[["class","list-group-item"],["routerLink","breach-report"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(n,l,e){var u=!0;"click"===l&&(u=!1!==t.ɵnov(n,50).onClick(e.button,e.ctrlKey,e.metaKey,e.shiftKey)&&u);return u},null,null)),t.ɵdid(50,671744,[[8,4]],0,i.RouterLinkWithHref,[i.Router,i.ActivatedRoute,r.LocationStrategy],{routerLink:[0,"routerLink"]},null),t.ɵdid(51,1720320,null,2,i.RouterLinkActive,[i.Router,t.ElementRef,t.Renderer2,t.ChangeDetectorRef],{routerLinkActive:[0,"routerLinkActive"]},null),t.ɵqud(603979776,7,{links:1}),t.ɵqud(603979776,8,{linksWithHrefs:1}),(n()(),t.ɵted(54,null,["\n ","\n "])),t.ɵppd(55,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(60,0,null,null,4,"div",[["class","col-9"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(62,16777216,null,null,1,"router-outlet",[],null,null,null,null,null)),t.ɵdid(63,212992,null,0,i.RouterOutlet,[i.ChildrenOutletContexts,t.ViewContainerRef,t.ComponentFactoryResolver,[8,null],t.ChangeDetectorRef],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){n(l,16,0,"generator");n(l,17,0,"active");n(l,24,0,"import");n(l,25,0,"active");n(l,32,0,"export");n(l,33,0,"active");n(l,50,0,"breach-report");n(l,51,0,"active"),n(l,63,0)},function(n,l){n(l,10,0,t.ɵunv(l,10,0,n(l,11,0,t.ɵnov(l,0),"tools"))),n(l,15,0,t.ɵnov(l,16).target,t.ɵnov(l,16).href),n(l,20,0,t.ɵunv(l,20,0,n(l,21,0,t.ɵnov(l,0),"passwordGenerator"))),n(l,23,0,t.ɵnov(l,24).target,t.ɵnov(l,24).href),n(l,28,0,t.ɵunv(l,28,0,n(l,29,0,t.ɵnov(l,0),"importData"))),n(l,31,0,t.ɵnov(l,32).target,t.ɵnov(l,32).href),n(l,36,0,t.ɵunv(l,36,0,n(l,37,0,t.ɵnov(l,0),"exportVault"))),n(l,44,0,t.ɵunv(l,44,0,n(l,45,0,t.ɵnov(l,0),"reports"))),n(l,49,0,t.ɵnov(l,50).target,t.ɵnov(l,50).href),n(l,54,0,t.ɵunv(l,54,0,n(l,55,0,t.ɵnov(l,0),"dataBreachReport")))})}function c(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"app-tools",[],null,null,null,d,s)),t.ɵdid(1,49152,null,0,a.ToolsComponent,[],null,null)],null,null)}l.RenderType_ToolsComponent=s,l.View_ToolsComponent_0=d,l.View_ToolsComponent_Host_0=c;var p=t.ɵccf("app-tools",a.ToolsComponent,c,{},{},[]);l.ToolsComponentNgFactory=p},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(){}}();l.OrganizationCreateRequest=t},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=e(0),u=e(13),o=e(18),i=e(17),r=e(5),a=e(269),s=e(127),d=e(2),c=e(8),p=e(7),f=e(262),v=e(4),h=e(3),g=e(9),m=e(20),y=e(10),C=e(66),b=t.ɵcrt({encapsulation:2,styles:[],data:{}});function S(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,35,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,2,"p",[],null,null,null,null,null)),(n()(),t.ɵted(3,null,["",""])),t.ɵppd(4,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(6,0,[["form",1]],null,28,"form",[["ngNativeValidate",""]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngSubmit"],[null,"submit"],[null,"reset"]],function(n,l,e){var u=!0,o=n.component;"submit"===l&&(u=!1!==t.ɵnov(n,7).onSubmit(e)&&u);"reset"===l&&(u=!1!==t.ɵnov(n,7).onReset()&&u);"ngSubmit"===l&&(u=!1!==o.submit()&&u);return u},null,null)),t.ɵdid(7,4210688,null,0,u.NgForm,[[8,null],[8,null]],null,{ngSubmit:"ngSubmit"}),t.ɵprd(2048,null,u.ControlContainer,null,[u.NgForm]),t.ɵdid(9,16384,null,0,u.NgControlStatusGroup,[u.ControlContainer],null,null),t.ɵdid(10,540672,null,0,o.ApiActionDirective,[t.ElementRef,i.ValidationService],{appApiAction:[0,"appApiAction"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(12,0,null,null,11,"div",[["class","form-group"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(14,0,null,null,2,"label",[["for","file"]],null,null,null,null,null)),(n()(),t.ɵted(15,null,["",""])),t.ɵppd(16,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(18,0,null,null,0,"input",[["class","form-control-file"],["id","file"],["name","file"],["required",""],["type","file"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(20,0,null,null,2,"small",[["class","form-text text-muted"]],null,null,null,null,null)),(n()(),t.ɵted(21,null,["",""])),t.ɵppd(22,2),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(25,0,null,null,8,"button",[["class","btn btn-primary btn-submit"],["type","submit"]],[[8,"disabled",0]],null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(27,0,null,null,1,"i",[["class","fa fa-spinner fa-spin"]],[[8,"title",0]],null,null,null,null)),t.ɵppd(28,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(30,0,null,null,2,"span",[],null,null,null,null,null)),(n()(),t.ɵted(31,null,["",""])),t.ɵppd(32,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){n(l,10,0,l.component.formPromise)},function(n,l){n(l,3,0,t.ɵunv(l,3,0,n(l,4,0,t.ɵnov(l.parent,0),"uploadLicenseFileOrg"))),n(l,6,0,t.ɵnov(l,9).ngClassUntouched,t.ɵnov(l,9).ngClassTouched,t.ɵnov(l,9).ngClassPristine,t.ɵnov(l,9).ngClassDirty,t.ɵnov(l,9).ngClassValid,t.ɵnov(l,9).ngClassInvalid,t.ɵnov(l,9).ngClassPending),n(l,15,0,t.ɵunv(l,15,0,n(l,16,0,t.ɵnov(l.parent,0),"licenseFile"))),n(l,21,0,t.ɵunv(l,21,0,n(l,22,0,t.ɵnov(l.parent,0),"licenseFileDesc","bitwarden_organization_license.json"))),n(l,25,0,t.ɵnov(l,6).loading),n(l,27,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,27,0,n(l,28,0,t.ɵnov(l.parent,0),"loading")),"")),n(l,31,0,t.ɵunv(l,31,0,n(l,32,0,t.ɵnov(l.parent,0),"submit")))})}function w(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,15,"div",[["class","row"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,12,"div",[["class","form-group col-6"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(4,0,null,null,2,"label",[["for","businessName"]],null,null,null,null,null)),(n()(),t.ɵted(5,null,["",""])),t.ɵppd(6,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(8,0,null,null,5,"input",[["class","form-control"],["id","businessName"],["name","BusinessName"],["type","text"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(n,l,e){var u=!0,o=n.component;"input"===l&&(u=!1!==t.ɵnov(n,9)._handleInput(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,9).onTouched()&&u);"compositionstart"===l&&(u=!1!==t.ɵnov(n,9)._compositionStart()&&u);"compositionend"===l&&(u=!1!==t.ɵnov(n,9)._compositionEnd(e.target.value)&&u);"ngModelChange"===l&&(u=!1!==(o.businessName=e)&&u);return u},null,null)),t.ɵdid(9,16384,null,0,u.DefaultValueAccessor,[t.Renderer2,t.ElementRef,[2,u.COMPOSITION_BUFFER_MODE]],null,null),t.ɵprd(1024,null,u.NG_VALUE_ACCESSOR,function(n){return[n]},[u.DefaultValueAccessor]),t.ɵdid(11,671744,null,0,u.NgModel,[[2,u.ControlContainer],[8,null],[8,null],[2,u.NG_VALUE_ACCESSOR]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,u.NgControl,null,[u.NgModel]),t.ɵdid(13,16384,null,0,u.NgControlStatus,[u.NgControl],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){n(l,11,0,"BusinessName",l.component.businessName)},function(n,l){n(l,5,0,t.ɵunv(l,5,0,n(l,6,0,t.ɵnov(l.parent.parent,0),"businessName"))),n(l,8,0,t.ɵnov(l,13).ngClassUntouched,t.ɵnov(l,13).ngClassTouched,t.ɵnov(l,13).ngClassPristine,t.ɵnov(l,13).ngClassDirty,t.ɵnov(l,13).ngClassValid,t.ɵnov(l,13).ngClassInvalid,t.ɵnov(l,13).ngClassPending)})}function R(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,29,"div",[["class","form-check form-check-block"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,6,"input",[["class","form-check-input"],["id","planFree"],["name","PlanType"],["type","radio"],["value","free"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"change"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(n,l,e){var u=!0,o=n.component;"input"===l&&(u=!1!==t.ɵnov(n,3)._handleInput(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,3).onTouched()&&u);"compositionstart"===l&&(u=!1!==t.ɵnov(n,3)._compositionStart()&&u);"compositionend"===l&&(u=!1!==t.ɵnov(n,3)._compositionEnd(e.target.value)&&u);"change"===l&&(u=!1!==t.ɵnov(n,4).onChange()&&u);"blur"===l&&(u=!1!==t.ɵnov(n,4).onTouched()&&u);"ngModelChange"===l&&(u=!1!==(o.plan=e)&&u);"change"===l&&(u=!1!==o.changedPlan()&&u);return u},null,null)),t.ɵdid(3,16384,null,0,u.DefaultValueAccessor,[t.Renderer2,t.ElementRef,[2,u.COMPOSITION_BUFFER_MODE]],null,null),t.ɵdid(4,212992,null,0,u.RadioControlValueAccessor,[t.Renderer2,t.ElementRef,u.ɵi,t.Injector],{name:[0,"name"],value:[1,"value"]},null),t.ɵprd(1024,null,u.NG_VALUE_ACCESSOR,function(n,l){return[n,l]},[u.DefaultValueAccessor,u.RadioControlValueAccessor]),t.ɵdid(6,671744,null,0,u.NgModel,[[2,u.ControlContainer],[8,null],[8,null],[2,u.NG_VALUE_ACCESSOR]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,u.NgControl,null,[u.NgModel]),t.ɵdid(8,16384,null,0,u.NgControlStatus,[u.NgControl],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(10,0,null,null,18,"label",[["class","form-check-label"],["for","planFree"]],null,null,null,null,null)),(n()(),t.ɵted(11,null,["\n ","\n "])),t.ɵppd(12,1),(n()(),t.ɵeld(13,0,null,null,2,"small",[["class","mb-1"]],null,null,null,null,null)),(n()(),t.ɵted(14,null,["",""])),t.ɵppd(15,2),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(17,0,null,null,2,"small",[],null,null,null,null,null)),(n()(),t.ɵted(18,null,["• ",""])),t.ɵppd(19,2),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(21,0,null,null,2,"small",[],null,null,null,null,null)),(n()(),t.ɵted(22,null,["• ",""])),t.ɵppd(23,2),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(25,0,null,null,2,"span",[],null,null,null,null,null)),(n()(),t.ɵted(26,null,["",""])),t.ɵppd(27,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){var e=l.component;n(l,4,0,"PlanType","free");n(l,6,0,"PlanType",e.plan)},function(n,l){n(l,2,0,t.ɵnov(l,8).ngClassUntouched,t.ɵnov(l,8).ngClassTouched,t.ɵnov(l,8).ngClassPristine,t.ɵnov(l,8).ngClassDirty,t.ɵnov(l,8).ngClassValid,t.ɵnov(l,8).ngClassInvalid,t.ɵnov(l,8).ngClassPending),n(l,11,0,t.ɵunv(l,11,0,n(l,12,0,t.ɵnov(l.parent.parent,0),"planNameFree"))),n(l,14,0,t.ɵunv(l,14,0,n(l,15,0,t.ɵnov(l.parent.parent,0),"planDescFree","1"))),n(l,18,0,t.ɵunv(l,18,0,n(l,19,0,t.ɵnov(l.parent.parent,0),"limitedUsers","2"))),n(l,22,0,t.ɵunv(l,22,0,n(l,23,0,t.ɵnov(l.parent.parent,0),"limitedCollections","2"))),n(l,26,0,t.ɵunv(l,26,0,n(l,27,0,t.ɵnov(l.parent.parent,0),"freeForever")))})}function _(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,47,"div",[["class","form-check form-check-block"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,6,"input",[["class","form-check-input"],["id","planFamilies"],["name","PlanType"],["type","radio"],["value","families"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"change"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(n,l,e){var u=!0,o=n.component;"input"===l&&(u=!1!==t.ɵnov(n,3)._handleInput(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,3).onTouched()&&u);"compositionstart"===l&&(u=!1!==t.ɵnov(n,3)._compositionStart()&&u);"compositionend"===l&&(u=!1!==t.ɵnov(n,3)._compositionEnd(e.target.value)&&u);"change"===l&&(u=!1!==t.ɵnov(n,4).onChange()&&u);"blur"===l&&(u=!1!==t.ɵnov(n,4).onTouched()&&u);"ngModelChange"===l&&(u=!1!==(o.plan=e)&&u);"change"===l&&(u=!1!==o.changedPlan()&&u);return u},null,null)),t.ɵdid(3,16384,null,0,u.DefaultValueAccessor,[t.Renderer2,t.ElementRef,[2,u.COMPOSITION_BUFFER_MODE]],null,null),t.ɵdid(4,212992,null,0,u.RadioControlValueAccessor,[t.Renderer2,t.ElementRef,u.ɵi,t.Injector],{name:[0,"name"],value:[1,"value"]},null),t.ɵprd(1024,null,u.NG_VALUE_ACCESSOR,function(n,l){return[n,l]},[u.DefaultValueAccessor,u.RadioControlValueAccessor]),t.ɵdid(6,671744,null,0,u.NgModel,[[2,u.ControlContainer],[8,null],[8,null],[2,u.NG_VALUE_ACCESSOR]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,u.NgControl,null,[u.NgModel]),t.ɵdid(8,16384,null,0,u.NgControlStatus,[u.NgControl],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(10,0,null,null,36,"label",[["class","form-check-label"],["for","planFamilies"]],null,null,null,null,null)),(n()(),t.ɵted(11,null,["\n ","\n "])),t.ɵppd(12,1),(n()(),t.ɵeld(13,0,null,null,2,"small",[["class","mb-1"]],null,null,null,null,null)),(n()(),t.ɵted(14,null,["",""])),t.ɵppd(15,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(17,0,null,null,2,"small",[],null,null,null,null,null)),(n()(),t.ɵted(18,null,["• ",""])),t.ɵppd(19,2),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(21,0,null,null,2,"small",[],null,null,null,null,null)),(n()(),t.ɵted(22,null,["• ",""])),t.ɵppd(23,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(25,0,null,null,2,"small",[],null,null,null,null,null)),(n()(),t.ɵted(26,null,["• ",""])),t.ɵppd(27,2),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(29,0,null,null,2,"small",[],null,null,null,null,null)),(n()(),t.ɵted(30,null,["• ",""])),t.ɵppd(31,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(33,0,null,null,2,"small",[],null,null,null,null,null)),(n()(),t.ɵted(34,null,["• ",""])),t.ɵppd(35,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(37,0,null,null,2,"small",[],null,null,null,null,null)),(n()(),t.ɵted(38,null,["• ",""])),t.ɵppd(39,2),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(41,0,null,null,4,"span",[],null,null,null,null,null)),(n()(),t.ɵted(42,null,[""," /",", ",""])),t.ɵppd(43,2),t.ɵppd(44,1),t.ɵppd(45,2),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){var e=l.component;n(l,4,0,"PlanType","families");n(l,6,0,"PlanType",e.plan)},function(n,l){n(l,2,0,t.ɵnov(l,8).ngClassUntouched,t.ɵnov(l,8).ngClassTouched,t.ɵnov(l,8).ngClassPristine,t.ɵnov(l,8).ngClassDirty,t.ɵnov(l,8).ngClassValid,t.ɵnov(l,8).ngClassInvalid,t.ɵnov(l,8).ngClassPending),n(l,11,0,t.ɵunv(l,11,0,n(l,12,0,t.ɵnov(l.parent.parent,0),"planNameFamilies"))),n(l,14,0,t.ɵunv(l,14,0,n(l,15,0,t.ɵnov(l.parent.parent,0),"planDescFamilies"))),n(l,18,0,t.ɵunv(l,18,0,n(l,19,0,t.ɵnov(l.parent.parent,0),"addShareLimitedUsers","5"))),n(l,22,0,t.ɵunv(l,22,0,n(l,23,0,t.ɵnov(l.parent.parent,0),"createUnlimitedCollections"))),n(l,26,0,t.ɵunv(l,26,0,n(l,27,0,t.ɵnov(l.parent.parent,0),"gbEncryptedFileStorage","1 GB"))),n(l,30,0,t.ɵunv(l,30,0,n(l,31,0,t.ɵnov(l.parent.parent,0),"onPremHostingOptional"))),n(l,34,0,t.ɵunv(l,34,0,n(l,35,0,t.ɵnov(l.parent.parent,0),"priorityCustomerSupport"))),n(l,38,0,t.ɵunv(l,38,0,n(l,39,0,t.ɵnov(l.parent.parent,0),"xDayFreeTrial","7"))),n(l,42,0,t.ɵunv(l,42,0,n(l,43,0,t.ɵnov(l.parent.parent,1),1,"$")),t.ɵunv(l,42,1,n(l,44,0,t.ɵnov(l.parent.parent,0),"month")),t.ɵunv(l,42,2,n(l,45,0,t.ɵnov(l.parent.parent,0),"includesXUsers",5)))})}function I(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,30,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,2,"h2",[["class","mt-5"]],null,null,null,null,null)),(n()(),t.ɵted(3,null,["",""])),t.ɵppd(4,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(6,0,null,null,23,"div",[["class","row"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(8,0,null,null,20,"div",[["class","col-6"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(10,0,null,null,2,"label",[["for","additionalSeats"]],null,null,null,null,null)),(n()(),t.ɵted(11,null,["",""])),t.ɵppd(12,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(14,0,null,null,9,"input",[["class","form-control"],["id","additionalSeats"],["max","100000"],["min","1"],["name","AdditionalSeats"],["required",""],["type","number"]],[[8,"placeholder",0],[1,"required",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"],[null,"change"]],function(n,l,e){var u=!0,o=n.component;"input"===l&&(u=!1!==t.ɵnov(n,15)._handleInput(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,15).onTouched()&&u);"compositionstart"===l&&(u=!1!==t.ɵnov(n,15)._compositionStart()&&u);"compositionend"===l&&(u=!1!==t.ɵnov(n,15)._compositionEnd(e.target.value)&&u);"change"===l&&(u=!1!==t.ɵnov(n,16).onChange(e.target.value)&&u);"input"===l&&(u=!1!==t.ɵnov(n,16).onChange(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,16).onTouched()&&u);"ngModelChange"===l&&(u=!1!==(o.additionalSeats=e)&&u);return u},null,null)),t.ɵdid(15,16384,null,0,u.DefaultValueAccessor,[t.Renderer2,t.ElementRef,[2,u.COMPOSITION_BUFFER_MODE]],null,null),t.ɵdid(16,16384,null,0,u.ɵbc,[t.Renderer2,t.ElementRef],null,null),t.ɵdid(17,16384,null,0,u.RequiredValidator,[],{required:[0,"required"]},null),t.ɵprd(1024,null,u.NG_VALIDATORS,function(n){return[n]},[u.RequiredValidator]),t.ɵprd(1024,null,u.NG_VALUE_ACCESSOR,function(n,l){return[n,l]},[u.DefaultValueAccessor,u.ɵbc]),t.ɵdid(20,671744,null,0,u.NgModel,[[2,u.ControlContainer],[2,u.NG_VALIDATORS],[8,null],[2,u.NG_VALUE_ACCESSOR]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,u.NgControl,null,[u.NgModel]),t.ɵdid(22,16384,null,0,u.NgControlStatus,[u.NgControl],null,null),t.ɵppd(23,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(25,0,null,null,2,"small",[["class","text-muted form-text"]],null,null,null,null,null)),(n()(),t.ɵted(26,null,["",""])),t.ɵppd(27,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){var e=l.component;n(l,17,0,"");n(l,20,0,"AdditionalSeats",e.additionalSeats)},function(n,l){n(l,3,0,t.ɵunv(l,3,0,n(l,4,0,t.ɵnov(l.parent.parent.parent,0),"users"))),n(l,11,0,t.ɵunv(l,11,0,n(l,12,0,t.ɵnov(l.parent.parent.parent,0),"userSeats"))),n(l,14,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,14,0,n(l,23,0,t.ɵnov(l.parent.parent.parent,0),"userSeatsDesc")),""),t.ɵnov(l,17).required?"":null,t.ɵnov(l,22).ngClassUntouched,t.ɵnov(l,22).ngClassTouched,t.ɵnov(l,22).ngClassPristine,t.ɵnov(l,22).ngClassDirty,t.ɵnov(l,22).ngClassValid,t.ɵnov(l,22).ngClassInvalid,t.ɵnov(l,22).ngClassPending),n(l,26,0,t.ɵunv(l,26,0,n(l,27,0,t.ɵnov(l.parent.parent.parent,0),"userSeatsHowManyDesc")))})}function A(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,22,"div",[["class","row"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,19,"div",[["class","form-group col-6"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(4,0,null,null,2,"label",[["for","additionalSeats"]],null,null,null,null,null)),(n()(),t.ɵted(5,null,["",""])),t.ɵppd(6,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(8,0,null,null,7,"input",[["class","form-control"],["id","additionalSeats"],["max","100000"],["min","0"],["name","AdditionalSeats"],["type","number"]],[[8,"placeholder",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"],[null,"change"]],function(n,l,e){var u=!0,o=n.component;"input"===l&&(u=!1!==t.ɵnov(n,9)._handleInput(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,9).onTouched()&&u);"compositionstart"===l&&(u=!1!==t.ɵnov(n,9)._compositionStart()&&u);"compositionend"===l&&(u=!1!==t.ɵnov(n,9)._compositionEnd(e.target.value)&&u);"change"===l&&(u=!1!==t.ɵnov(n,10).onChange(e.target.value)&&u);"input"===l&&(u=!1!==t.ɵnov(n,10).onChange(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,10).onTouched()&&u);"ngModelChange"===l&&(u=!1!==(o.additionalSeats=e)&&u);return u},null,null)),t.ɵdid(9,16384,null,0,u.DefaultValueAccessor,[t.Renderer2,t.ElementRef,[2,u.COMPOSITION_BUFFER_MODE]],null,null),t.ɵdid(10,16384,null,0,u.ɵbc,[t.Renderer2,t.ElementRef],null,null),t.ɵprd(1024,null,u.NG_VALUE_ACCESSOR,function(n,l){return[n,l]},[u.DefaultValueAccessor,u.ɵbc]),t.ɵdid(12,671744,null,0,u.NgModel,[[2,u.ControlContainer],[8,null],[8,null],[2,u.NG_VALUE_ACCESSOR]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,u.NgControl,null,[u.NgModel]),t.ɵdid(14,16384,null,0,u.NgControlStatus,[u.NgControl],null,null),t.ɵppd(15,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(17,0,null,null,3,"small",[["class","text-muted form-text"]],null,null,null,null,null)),(n()(),t.ɵted(18,null,["",""])),t.ɵppd(19,2),t.ɵppd(20,3),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){n(l,12,0,"AdditionalSeats",l.component.additionalSeats)},function(n,l){var e=l.component;n(l,5,0,t.ɵunv(l,5,0,n(l,6,0,t.ɵnov(l.parent.parent.parent,0),"additionalUserSeats"))),n(l,8,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,8,0,n(l,15,0,t.ɵnov(l.parent.parent.parent,0),"userSeatsDesc")),""),t.ɵnov(l,14).ngClassUntouched,t.ɵnov(l,14).ngClassTouched,t.ɵnov(l,14).ngClassPristine,t.ɵnov(l,14).ngClassDirty,t.ɵnov(l,14).ngClassValid,t.ɵnov(l,14).ngClassInvalid,t.ɵnov(l,14).ngClassPending),n(l,18,0,t.ɵunv(l,18,0,n(l,20,0,t.ɵnov(l.parent.parent.parent,0),"userSeatsAdditionalDesc",e.plans[e.plan].baseSeats,t.ɵunv(l,18,0,n(l,19,0,t.ɵnov(l.parent.parent.parent,1),e.plans[e.plan].seatPrice,"$")))))})}function E(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,6,"small",[],null,null,null,null,null)),(n()(),t.ɵted(1,null,["\n ",": "," ×12 "," = ","\n /","\n "])),t.ɵppd(2,1),t.ɵppd(3,2),t.ɵppd(4,1),t.ɵppd(5,2),t.ɵppd(6,1)],null,function(n,l){var e=l.component;n(l,1,0,t.ɵunv(l,1,0,n(l,2,0,t.ɵnov(l.parent.parent.parent,0),"basePrice")),t.ɵunv(l,1,1,n(l,3,0,t.ɵnov(l.parent.parent.parent,1),e.plans[e.plan].basePrice,"$")),t.ɵunv(l,1,2,n(l,4,0,t.ɵnov(l.parent.parent.parent,0),"monthAbbr")),t.ɵunv(l,1,3,n(l,5,0,t.ɵnov(l.parent.parent.parent,1),e.baseTotal(!0),"$")),t.ɵunv(l,1,4,n(l,6,0,t.ɵnov(l.parent.parent.parent,0),"year")))})}function O(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,2,"span",[],null,null,null,null,null)),(n()(),t.ɵted(1,null,["",":"])),t.ɵppd(2,1)],null,function(n,l){n(l,1,0,t.ɵunv(l,1,0,n(l,2,0,t.ɵnov(l.parent.parent.parent.parent,0),"additionalUsers")))})}function N(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,2,"span",[],null,null,null,null,null)),(n()(),t.ɵted(1,null,["",":"])),t.ɵppd(2,1)],null,function(n,l){n(l,1,0,t.ɵunv(l,1,0,n(l,2,0,t.ɵnov(l.parent.parent.parent.parent,0),"users")))})}function T(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,11,"small",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,O)),t.ɵdid(3,16384,null,0,r.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,N)),t.ɵdid(6,16384,null,0,r.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(7,null,["\n "," × "," ×12 "," = "," /","\n "])),t.ɵppd(8,2),t.ɵppd(9,1),t.ɵppd(10,2),t.ɵppd(11,1)],function(n,l){var e=l.component;n(l,3,0,e.plans[e.plan].baseSeats),n(l,6,0,!e.plans[e.plan].baseSeats)},function(n,l){var e=l.component;n(l,7,0,e.additionalSeats||0,t.ɵunv(l,7,1,n(l,8,0,t.ɵnov(l.parent.parent.parent,1),e.plans[e.plan].seatPrice,"$")),t.ɵunv(l,7,2,n(l,9,0,t.ɵnov(l.parent.parent.parent,0),"monthAbbr")),t.ɵunv(l,7,3,n(l,10,0,t.ɵnov(l.parent.parent.parent,1),e.seatTotal(!0),"$")),t.ɵunv(l,7,4,n(l,11,0,t.ɵnov(l.parent.parent.parent,0),"year")))})}function k(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,4,"small",[],null,null,null,null,null)),(n()(),t.ɵted(1,null,["\n ",": "," /","\n "])),t.ɵppd(2,1),t.ɵppd(3,2),t.ɵppd(4,1)],null,function(n,l){var e=l.component;n(l,1,0,t.ɵunv(l,1,0,n(l,2,0,t.ɵnov(l.parent.parent.parent.parent,0),"basePrice")),t.ɵunv(l,1,1,n(l,3,0,t.ɵnov(l.parent.parent.parent.parent,1),e.baseTotal(!1),"$")),t.ɵunv(l,1,2,n(l,4,0,t.ɵnov(l.parent.parent.parent.parent,0),"month")))})}function V(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,2,"span",[],null,null,null,null,null)),(n()(),t.ɵted(1,null,["",":"])),t.ɵppd(2,1)],null,function(n,l){n(l,1,0,t.ɵunv(l,1,0,n(l,2,0,t.ɵnov(l.parent.parent.parent.parent.parent,0),"additionalUsers")))})}function P(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,2,"span",[],null,null,null,null,null)),(n()(),t.ɵted(1,null,["",":"])),t.ɵppd(2,1)],null,function(n,l){n(l,1,0,t.ɵunv(l,1,0,n(l,2,0,t.ɵnov(l.parent.parent.parent.parent.parent,0),"users")))})}function M(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,10,"small",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,V)),t.ɵdid(3,16384,null,0,r.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,P)),t.ɵdid(6,16384,null,0,r.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(7,null,["\n "," × "," = "," /","\n "])),t.ɵppd(8,2),t.ɵppd(9,2),t.ɵppd(10,1)],function(n,l){var e=l.component;n(l,3,0,e.plans[e.plan].baseSeats),n(l,6,0,!e.plans[e.plan].baseSeats)},function(n,l){var e=l.component;n(l,7,0,e.additionalSeats||0,t.ɵunv(l,7,1,n(l,8,0,t.ɵnov(l.parent.parent.parent.parent,1),e.plans[e.plan].monthlySeatPrice,"$")),t.ɵunv(l,7,2,n(l,9,0,t.ɵnov(l.parent.parent.parent.parent,1),e.seatTotal(!1),"$")),t.ɵunv(l,7,3,n(l,10,0,t.ɵnov(l.parent.parent.parent.parent,0),"month")))})}function x(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,26,"div",[["class","form-check form-check-block"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,6,"input",[["class","form-check-input"],["id","intervalMonthly"],["name","BillingInterval"],["type","radio"],["value","month"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"],[null,"change"]],function(n,l,e){var u=!0,o=n.component;"input"===l&&(u=!1!==t.ɵnov(n,3)._handleInput(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,3).onTouched()&&u);"compositionstart"===l&&(u=!1!==t.ɵnov(n,3)._compositionStart()&&u);"compositionend"===l&&(u=!1!==t.ɵnov(n,3)._compositionEnd(e.target.value)&&u);"change"===l&&(u=!1!==t.ɵnov(n,4).onChange()&&u);"blur"===l&&(u=!1!==t.ɵnov(n,4).onTouched()&&u);"ngModelChange"===l&&(u=!1!==(o.interval=e)&&u);return u},null,null)),t.ɵdid(3,16384,null,0,u.DefaultValueAccessor,[t.Renderer2,t.ElementRef,[2,u.COMPOSITION_BUFFER_MODE]],null,null),t.ɵdid(4,212992,null,0,u.RadioControlValueAccessor,[t.Renderer2,t.ElementRef,u.ɵi,t.Injector],{name:[0,"name"],value:[1,"value"]},null),t.ɵprd(1024,null,u.NG_VALUE_ACCESSOR,function(n,l){return[n,l]},[u.DefaultValueAccessor,u.RadioControlValueAccessor]),t.ɵdid(6,671744,null,0,u.NgModel,[[2,u.ControlContainer],[8,null],[8,null],[2,u.NG_VALUE_ACCESSOR]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,u.NgControl,null,[u.NgModel]),t.ɵdid(8,16384,null,0,u.NgControlStatus,[u.NgControl],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(10,0,null,null,15,"label",[["class","form-check-label"],["for","intervalMonthly"]],null,null,null,null,null)),(n()(),t.ɵted(11,null,["\n ","\n "])),t.ɵppd(12,1),(n()(),t.ɵand(16777216,null,null,1,null,k)),t.ɵdid(14,16384,null,0,r.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,M)),t.ɵdid(17,16384,null,0,r.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(19,0,null,null,5,"small",[],null,null,null,null,null)),(n()(),t.ɵted(20,null,["\n ",": "," × "," = "," /","\n "])),t.ɵppd(21,1),t.ɵppd(22,2),t.ɵppd(23,2),t.ɵppd(24,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){var e=l.component;n(l,4,0,"BillingInterval","month");n(l,6,0,"BillingInterval",e.interval),n(l,14,0,e.plans[e.plan].monthlyBasePrice),n(l,17,0,!e.plans[e.plan].noAdditionalSeats)},function(n,l){var e=l.component;n(l,2,0,t.ɵnov(l,8).ngClassUntouched,t.ɵnov(l,8).ngClassTouched,t.ɵnov(l,8).ngClassPristine,t.ɵnov(l,8).ngClassDirty,t.ɵnov(l,8).ngClassValid,t.ɵnov(l,8).ngClassInvalid,t.ɵnov(l,8).ngClassPending),n(l,11,0,t.ɵunv(l,11,0,n(l,12,0,t.ɵnov(l.parent.parent.parent,0),"monthly"))),n(l,20,0,t.ɵunv(l,20,0,n(l,21,0,t.ɵnov(l.parent.parent.parent,0),"additionalStorageGb")),e.additionalStorage||0,t.ɵunv(l,20,2,n(l,22,0,t.ɵnov(l.parent.parent.parent,1),e.storageGb.monthlyPrice,"$")),t.ɵunv(l,20,3,n(l,23,0,t.ɵnov(l.parent.parent.parent,1),e.additionalStorageTotal(!1),"$")),t.ɵunv(l,20,4,n(l,24,0,t.ɵnov(l.parent.parent.parent,0),"month")))})}function D(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,94,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,I)),t.ɵdid(3,16384,null,0,r.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(5,0,null,null,2,"h2",[["class","mt-5"]],null,null,null,null,null)),(n()(),t.ɵted(6,null,["",""])),t.ɵppd(7,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,A)),t.ɵdid(10,16384,null,0,r.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(12,0,null,null,22,"div",[["class","row"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(14,0,null,null,19,"div",[["class","form-group col-6"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(16,0,null,null,2,"label",[["for","additionalStorage"]],null,null,null,null,null)),(n()(),t.ɵted(17,null,["",""])),t.ɵppd(18,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(20,0,null,null,7,"input",[["class","form-control"],["id","additionalStorage"],["max","99"],["min","0"],["name","AdditionalStorageGb"],["step","1"],["type","number"]],[[8,"placeholder",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"],[null,"change"]],function(n,l,e){var u=!0,o=n.component;"input"===l&&(u=!1!==t.ɵnov(n,21)._handleInput(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,21).onTouched()&&u);"compositionstart"===l&&(u=!1!==t.ɵnov(n,21)._compositionStart()&&u);"compositionend"===l&&(u=!1!==t.ɵnov(n,21)._compositionEnd(e.target.value)&&u);"change"===l&&(u=!1!==t.ɵnov(n,22).onChange(e.target.value)&&u);"input"===l&&(u=!1!==t.ɵnov(n,22).onChange(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,22).onTouched()&&u);"ngModelChange"===l&&(u=!1!==(o.additionalStorage=e)&&u);return u},null,null)),t.ɵdid(21,16384,null,0,u.DefaultValueAccessor,[t.Renderer2,t.ElementRef,[2,u.COMPOSITION_BUFFER_MODE]],null,null),t.ɵdid(22,16384,null,0,u.ɵbc,[t.Renderer2,t.ElementRef],null,null),t.ɵprd(1024,null,u.NG_VALUE_ACCESSOR,function(n,l){return[n,l]},[u.DefaultValueAccessor,u.ɵbc]),t.ɵdid(24,671744,null,0,u.NgModel,[[2,u.ControlContainer],[8,null],[8,null],[2,u.NG_VALUE_ACCESSOR]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,u.NgControl,null,[u.NgModel]),t.ɵdid(26,16384,null,0,u.NgControlStatus,[u.NgControl],null,null),t.ɵppd(27,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(29,0,null,null,3,"small",[["class","text-muted form-text"]],null,null,null,null,null)),(n()(),t.ɵted(30,null,["",""])),t.ɵppd(31,2),t.ɵppd(32,3),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(36,0,null,null,2,"h2",[["class","spaced-header"]],null,null,null,null,null)),(n()(),t.ɵted(37,null,["",""])),t.ɵppd(38,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(40,0,null,null,27,"div",[["class","form-check form-check-block"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(42,0,null,null,6,"input",[["class","form-check-input"],["id","intervalAnnually"],["name","BillingInterval"],["type","radio"],["value","year"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"],[null,"change"]],function(n,l,e){var u=!0,o=n.component;"input"===l&&(u=!1!==t.ɵnov(n,43)._handleInput(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,43).onTouched()&&u);"compositionstart"===l&&(u=!1!==t.ɵnov(n,43)._compositionStart()&&u);"compositionend"===l&&(u=!1!==t.ɵnov(n,43)._compositionEnd(e.target.value)&&u);"change"===l&&(u=!1!==t.ɵnov(n,44).onChange()&&u);"blur"===l&&(u=!1!==t.ɵnov(n,44).onTouched()&&u);"ngModelChange"===l&&(u=!1!==(o.interval=e)&&u);return u},null,null)),t.ɵdid(43,16384,null,0,u.DefaultValueAccessor,[t.Renderer2,t.ElementRef,[2,u.COMPOSITION_BUFFER_MODE]],null,null),t.ɵdid(44,212992,null,0,u.RadioControlValueAccessor,[t.Renderer2,t.ElementRef,u.ɵi,t.Injector],{name:[0,"name"],value:[1,"value"]},null),t.ɵprd(1024,null,u.NG_VALUE_ACCESSOR,function(n,l){return[n,l]},[u.DefaultValueAccessor,u.RadioControlValueAccessor]),t.ɵdid(46,671744,null,0,u.NgModel,[[2,u.ControlContainer],[8,null],[8,null],[2,u.NG_VALUE_ACCESSOR]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,u.NgControl,null,[u.NgModel]),t.ɵdid(48,16384,null,0,u.NgControlStatus,[u.NgControl],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(50,0,null,null,16,"label",[["class","form-check-label"],["for","intervalAnnually"]],null,null,null,null,null)),(n()(),t.ɵted(51,null,["\n ","\n "])),t.ɵppd(52,1),(n()(),t.ɵand(16777216,null,null,1,null,E)),t.ɵdid(54,16384,null,0,r.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,T)),t.ɵdid(57,16384,null,0,r.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(59,0,null,null,6,"small",[],null,null,null,null,null)),(n()(),t.ɵted(60,null,["\n ",": "," × "," ×12 "," = "," /","\n "])),t.ɵppd(61,1),t.ɵppd(62,2),t.ɵppd(63,1),t.ɵppd(64,2),t.ɵppd(65,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,x)),t.ɵdid(70,16384,null,0,r.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(72,0,null,null,0,"hr",[["class","my-3"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(74,0,null,null,7,"div",[["class","text-lg"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(76,0,null,null,2,"strong",[],null,null,null,null,null)),(n()(),t.ɵted(77,null,["",":"])),t.ɵppd(78,1),(n()(),t.ɵted(79,null,[" "," /","\n "])),t.ɵppd(80,2),t.ɵppd(81,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(83,0,null,null,3,"small",[["class","text-muted font-italic"]],null,null,null,null,null)),(n()(),t.ɵted(84,null,["",""])),t.ɵppd(85,1),t.ɵppd(86,2),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(88,0,null,null,2,"h2",[["class","spaced-header mb-4"]],null,null,null,null,null)),(n()(),t.ɵted(89,null,["",""])),t.ɵppd(90,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(92,0,null,null,1,"app-payment",[],null,null,null,a.View_PaymentComponent_0,a.RenderType_PaymentComponent)),t.ɵdid(93,245760,[[1,4]],0,s.PaymentComponent,[d.I18nService,c.PlatformUtilsService],{hidePaypal:[0,"hidePaypal"]},null),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){var e=l.component;n(l,3,0,!e.plans[e.plan].noAdditionalSeats&&!e.plans[e.plan].baseSeats),n(l,10,0,!e.plans[e.plan].noAdditionalSeats&&e.plans[e.plan].baseSeats);n(l,24,0,"AdditionalStorageGb",e.additionalStorage);n(l,44,0,"BillingInterval","year");n(l,46,0,"BillingInterval",e.interval),n(l,54,0,e.plans[e.plan].annualBasePrice),n(l,57,0,!e.plans[e.plan].noAdditionalSeats),n(l,70,0,e.plans[e.plan].monthlySeatPrice);n(l,93,0,!0)},function(n,l){var e=l.component;n(l,6,0,t.ɵunv(l,6,0,n(l,7,0,t.ɵnov(l.parent.parent,0),"addons"))),n(l,17,0,t.ɵunv(l,17,0,n(l,18,0,t.ɵnov(l.parent.parent,0),"additionalStorageGb"))),n(l,20,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,20,0,n(l,27,0,t.ɵnov(l.parent.parent,0),"additionalStorageGbDesc")),""),t.ɵnov(l,26).ngClassUntouched,t.ɵnov(l,26).ngClassTouched,t.ɵnov(l,26).ngClassPristine,t.ɵnov(l,26).ngClassDirty,t.ɵnov(l,26).ngClassValid,t.ɵnov(l,26).ngClassInvalid,t.ɵnov(l,26).ngClassPending),n(l,30,0,t.ɵunv(l,30,0,n(l,32,0,t.ɵnov(l.parent.parent,0),"additionalStorageDesc","1 GB",t.ɵunv(l,30,0,n(l,31,0,t.ɵnov(l.parent.parent,1),e.storageGb.price,"$"))))),n(l,37,0,t.ɵunv(l,37,0,n(l,38,0,t.ɵnov(l.parent.parent,0),"summary"))),n(l,42,0,t.ɵnov(l,48).ngClassUntouched,t.ɵnov(l,48).ngClassTouched,t.ɵnov(l,48).ngClassPristine,t.ɵnov(l,48).ngClassDirty,t.ɵnov(l,48).ngClassValid,t.ɵnov(l,48).ngClassInvalid,t.ɵnov(l,48).ngClassPending),n(l,51,0,t.ɵunv(l,51,0,n(l,52,0,t.ɵnov(l.parent.parent,0),"annually"))),n(l,60,0,t.ɵunv(l,60,0,n(l,61,0,t.ɵnov(l.parent.parent,0),"additionalStorageGb")),e.additionalStorage||0,t.ɵunv(l,60,2,n(l,62,0,t.ɵnov(l.parent.parent,1),e.storageGb.price,"$")),t.ɵunv(l,60,3,n(l,63,0,t.ɵnov(l.parent.parent,0),"monthAbbr")),t.ɵunv(l,60,4,n(l,64,0,t.ɵnov(l.parent.parent,1),e.additionalStorageTotal(!0),"$")),t.ɵunv(l,60,5,n(l,65,0,t.ɵnov(l.parent.parent,0),"year"))),n(l,77,0,t.ɵunv(l,77,0,n(l,78,0,t.ɵnov(l.parent.parent,0),"total"))),n(l,79,0,t.ɵunv(l,79,0,n(l,80,0,t.ɵnov(l.parent.parent,1),e.total,"USD $")),t.ɵunv(l,79,1,n(l,81,0,t.ɵnov(l.parent.parent,0),e.interval))),n(l,84,0,t.ɵunv(l,84,0,n(l,86,0,t.ɵnov(l.parent.parent,0),"paymentChargedWithTrial",t.ɵunv(l,84,0,n(l,85,0,t.ɵnov(l.parent.parent,0),e.interval))))),n(l,89,0,t.ɵunv(l,89,0,n(l,90,0,t.ɵnov(l.parent.parent,0),"paymentInformation")))})}function U(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,[["form",1]],null,198,"form",[["ngNativeValidate",""]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngSubmit"],[null,"submit"],[null,"reset"]],function(n,l,e){var u=!0,o=n.component;"submit"===l&&(u=!1!==t.ɵnov(n,1).onSubmit(e)&&u);"reset"===l&&(u=!1!==t.ɵnov(n,1).onReset()&&u);"ngSubmit"===l&&(u=!1!==o.submit()&&u);return u},null,null)),t.ɵdid(1,4210688,null,0,u.NgForm,[[8,null],[8,null]],null,{ngSubmit:"ngSubmit"}),t.ɵprd(2048,null,u.ControlContainer,null,[u.NgForm]),t.ɵdid(3,16384,null,0,u.NgControlStatusGroup,[u.ControlContainer],null,null),t.ɵdid(4,540672,null,0,o.ApiActionDirective,[t.ElementRef,i.ValidationService],{appApiAction:[0,"appApiAction"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(6,0,null,null,2,"h2",[["class","mt-5"]],null,null,null,null,null)),(n()(),t.ɵted(7,null,["",""])),t.ɵppd(8,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(10,0,null,null,33,"div",[["class","row"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(12,0,null,null,14,"div",[["class","form-group col-6"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(14,0,null,null,2,"label",[["for","name"]],null,null,null,null,null)),(n()(),t.ɵted(15,null,["",""])),t.ɵppd(16,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(18,0,null,null,7,"input",[["class","form-control"],["id","name"],["name","Name"],["required",""],["type","text"]],[[1,"required",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(n,l,e){var u=!0,o=n.component;"input"===l&&(u=!1!==t.ɵnov(n,19)._handleInput(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,19).onTouched()&&u);"compositionstart"===l&&(u=!1!==t.ɵnov(n,19)._compositionStart()&&u);"compositionend"===l&&(u=!1!==t.ɵnov(n,19)._compositionEnd(e.target.value)&&u);"ngModelChange"===l&&(u=!1!==(o.name=e)&&u);return u},null,null)),t.ɵdid(19,16384,null,0,u.DefaultValueAccessor,[t.Renderer2,t.ElementRef,[2,u.COMPOSITION_BUFFER_MODE]],null,null),t.ɵdid(20,16384,null,0,u.RequiredValidator,[],{required:[0,"required"]},null),t.ɵprd(1024,null,u.NG_VALIDATORS,function(n){return[n]},[u.RequiredValidator]),t.ɵprd(1024,null,u.NG_VALUE_ACCESSOR,function(n){return[n]},[u.DefaultValueAccessor]),t.ɵdid(23,671744,null,0,u.NgModel,[[2,u.ControlContainer],[2,u.NG_VALIDATORS],[8,null],[2,u.NG_VALUE_ACCESSOR]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,u.NgControl,null,[u.NgModel]),t.ɵdid(25,16384,null,0,u.NgControlStatus,[u.NgControl],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(28,0,null,null,14,"div",[["class","form-group col-6"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(30,0,null,null,2,"label",[["for","billingEmail"]],null,null,null,null,null)),(n()(),t.ɵted(31,null,["",""])),t.ɵppd(32,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(34,0,null,null,7,"input",[["class","form-control"],["id","billingEmail"],["name","BillingEmail"],["required",""],["type","text"]],[[1,"required",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(n,l,e){var u=!0,o=n.component;"input"===l&&(u=!1!==t.ɵnov(n,35)._handleInput(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,35).onTouched()&&u);"compositionstart"===l&&(u=!1!==t.ɵnov(n,35)._compositionStart()&&u);"compositionend"===l&&(u=!1!==t.ɵnov(n,35)._compositionEnd(e.target.value)&&u);"ngModelChange"===l&&(u=!1!==(o.billingEmail=e)&&u);return u},null,null)),t.ɵdid(35,16384,null,0,u.DefaultValueAccessor,[t.Renderer2,t.ElementRef,[2,u.COMPOSITION_BUFFER_MODE]],null,null),t.ɵdid(36,16384,null,0,u.RequiredValidator,[],{required:[0,"required"]},null),t.ɵprd(1024,null,u.NG_VALIDATORS,function(n){return[n]},[u.RequiredValidator]),t.ɵprd(1024,null,u.NG_VALUE_ACCESSOR,function(n){return[n]},[u.DefaultValueAccessor]),t.ɵdid(39,671744,null,0,u.NgModel,[[2,u.ControlContainer],[2,u.NG_VALIDATORS],[8,null],[2,u.NG_VALUE_ACCESSOR]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,u.NgControl,null,[u.NgModel]),t.ɵdid(41,16384,null,0,u.NgControlStatus,[u.NgControl],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(45,0,null,null,12,"div",[["class","form-group form-check"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(47,0,null,null,5,"input",[["class","form-check-input"],["id","ownedBusiness"],["name","OwnedBusiness"],["type","checkbox"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"change"],[null,"blur"]],function(n,l,e){var u=!0,o=n.component;"change"===l&&(u=!1!==t.ɵnov(n,48).onChange(e.target.checked)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,48).onTouched()&&u);"ngModelChange"===l&&(u=!1!==(o.ownedBusiness=e)&&u);"change"===l&&(u=!1!==o.changedOwnedBusiness()&&u);return u},null,null)),t.ɵdid(48,16384,null,0,u.CheckboxControlValueAccessor,[t.Renderer2,t.ElementRef],null,null),t.ɵprd(1024,null,u.NG_VALUE_ACCESSOR,function(n){return[n]},[u.CheckboxControlValueAccessor]),t.ɵdid(50,671744,null,0,u.NgModel,[[2,u.ControlContainer],[8,null],[8,null],[2,u.NG_VALUE_ACCESSOR]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,u.NgControl,null,[u.NgModel]),t.ɵdid(52,16384,null,0,u.NgControlStatus,[u.NgControl],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(54,0,null,null,2,"label",[["class","form-check-label"],["for","ownedBusiness"]],null,null,null,null,null)),(n()(),t.ɵted(55,null,["",""])),t.ɵppd(56,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,w)),t.ɵdid(60,16384,null,0,r.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(62,0,null,null,2,"h2",[["class","mt-5"]],null,null,null,null,null)),(n()(),t.ɵted(63,null,["",""])),t.ɵppd(64,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,R)),t.ɵdid(67,16384,null,0,r.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,_)),t.ɵdid(70,16384,null,0,r.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(72,0,null,null,46,"div",[["class","form-check form-check-block"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(74,0,null,null,6,"input",[["class","form-check-input"],["id","planTeams"],["name","PlanType"],["type","radio"],["value","teams"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"change"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(n,l,e){var u=!0,o=n.component;"input"===l&&(u=!1!==t.ɵnov(n,75)._handleInput(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,75).onTouched()&&u);"compositionstart"===l&&(u=!1!==t.ɵnov(n,75)._compositionStart()&&u);"compositionend"===l&&(u=!1!==t.ɵnov(n,75)._compositionEnd(e.target.value)&&u);"change"===l&&(u=!1!==t.ɵnov(n,76).onChange()&&u);"blur"===l&&(u=!1!==t.ɵnov(n,76).onTouched()&&u);"ngModelChange"===l&&(u=!1!==(o.plan=e)&&u);"change"===l&&(u=!1!==o.changedPlan()&&u);return u},null,null)),t.ɵdid(75,16384,null,0,u.DefaultValueAccessor,[t.Renderer2,t.ElementRef,[2,u.COMPOSITION_BUFFER_MODE]],null,null),t.ɵdid(76,212992,null,0,u.RadioControlValueAccessor,[t.Renderer2,t.ElementRef,u.ɵi,t.Injector],{name:[0,"name"],value:[1,"value"]},null),t.ɵprd(1024,null,u.NG_VALUE_ACCESSOR,function(n,l){return[n,l]},[u.DefaultValueAccessor,u.RadioControlValueAccessor]),t.ɵdid(78,671744,null,0,u.NgModel,[[2,u.ControlContainer],[8,null],[8,null],[2,u.NG_VALUE_ACCESSOR]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,u.NgControl,null,[u.NgModel]),t.ɵdid(80,16384,null,0,u.NgControlStatus,[u.NgControl],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(82,0,null,null,35,"label",[["class","form-check-label"],["for","planTeams"]],null,null,null,null,null)),(n()(),t.ɵted(83,null,["\n ","\n "])),t.ɵppd(84,1),(n()(),t.ɵeld(85,0,null,null,2,"small",[["class","mb-1"]],null,null,null,null,null)),(n()(),t.ɵted(86,null,["",""])),t.ɵppd(87,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(89,0,null,null,2,"small",[],null,null,null,null,null)),(n()(),t.ɵted(90,null,["• ",""])),t.ɵppd(91,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(93,0,null,null,2,"small",[],null,null,null,null,null)),(n()(),t.ɵted(94,null,["• ",""])),t.ɵppd(95,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(97,0,null,null,2,"small",[],null,null,null,null,null)),(n()(),t.ɵted(98,null,["• ",""])),t.ɵppd(99,2),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(101,0,null,null,2,"small",[],null,null,null,null,null)),(n()(),t.ɵted(102,null,["• ",""])),t.ɵppd(103,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(105,0,null,null,2,"small",[],null,null,null,null,null)),(n()(),t.ɵted(106,null,["• ",""])),t.ɵppd(107,2),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(109,0,null,null,7,"span",[],null,null,null,null,null)),(n()(),t.ɵted(110,null,[""," /",", ",", ","\n "," /",""])),t.ɵppd(111,2),t.ɵppd(112,1),t.ɵppd(113,2),t.ɵppd(114,1),t.ɵppd(115,2),t.ɵppd(116,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(120,0,null,null,59,"div",[["class","form-check form-check-block"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(122,0,null,null,6,"input",[["class","form-check-input"],["id","planEnterprise"],["name","PlanType"],["type","radio"],["value","enterprise"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"change"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(n,l,e){var u=!0,o=n.component;"input"===l&&(u=!1!==t.ɵnov(n,123)._handleInput(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,123).onTouched()&&u);"compositionstart"===l&&(u=!1!==t.ɵnov(n,123)._compositionStart()&&u);"compositionend"===l&&(u=!1!==t.ɵnov(n,123)._compositionEnd(e.target.value)&&u);"change"===l&&(u=!1!==t.ɵnov(n,124).onChange()&&u);"blur"===l&&(u=!1!==t.ɵnov(n,124).onTouched()&&u);"ngModelChange"===l&&(u=!1!==(o.plan=e)&&u);"change"===l&&(u=!1!==o.changedPlan()&&u);return u},null,null)),t.ɵdid(123,16384,null,0,u.DefaultValueAccessor,[t.Renderer2,t.ElementRef,[2,u.COMPOSITION_BUFFER_MODE]],null,null),t.ɵdid(124,212992,null,0,u.RadioControlValueAccessor,[t.Renderer2,t.ElementRef,u.ɵi,t.Injector],{name:[0,"name"],value:[1,"value"]},null),t.ɵprd(1024,null,u.NG_VALUE_ACCESSOR,function(n,l){return[n,l]},[u.DefaultValueAccessor,u.RadioControlValueAccessor]),t.ɵdid(126,671744,null,0,u.NgModel,[[2,u.ControlContainer],[8,null],[8,null],[2,u.NG_VALUE_ACCESSOR]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,u.NgControl,null,[u.NgModel]),t.ɵdid(128,16384,null,0,u.NgControlStatus,[u.NgControl],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(130,0,null,null,48,"label",[["class","form-check-label"],["for","planEnterprise"]],null,null,null,null,null)),(n()(),t.ɵted(131,null,["\n ","\n "])),t.ɵppd(132,1),(n()(),t.ɵeld(133,0,null,null,2,"small",[["class","mb-1"]],null,null,null,null,null)),(n()(),t.ɵted(134,null,["",""])),t.ɵppd(135,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(137,0,null,null,2,"small",[],null,null,null,null,null)),(n()(),t.ɵted(138,null,["• ",""])),t.ɵppd(139,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(141,0,null,null,2,"small",[],null,null,null,null,null)),(n()(),t.ɵted(142,null,["• ",""])),t.ɵppd(143,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(145,0,null,null,2,"small",[],null,null,null,null,null)),(n()(),t.ɵted(146,null,["• ",""])),t.ɵppd(147,2),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(149,0,null,null,2,"small",[],null,null,null,null,null)),(n()(),t.ɵted(150,null,["• ",""])),t.ɵppd(151,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(153,0,null,null,2,"small",[],null,null,null,null,null)),(n()(),t.ɵted(154,null,["• ",""])),t.ɵppd(155,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(157,0,null,null,2,"small",[],null,null,null,null,null)),(n()(),t.ɵted(158,null,["• ",""])),t.ɵppd(159,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(161,0,null,null,2,"small",[],null,null,null,null,null)),(n()(),t.ɵted(162,null,["• ",""])),t.ɵppd(163,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(165,0,null,null,2,"small",[],null,null,null,null,null)),(n()(),t.ɵted(166,null,["• ",""])),t.ɵppd(167,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(169,0,null,null,2,"small",[],null,null,null,null,null)),(n()(),t.ɵted(170,null,["• ",""])),t.ɵppd(171,2),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(173,0,null,null,4,"span",[],null,null,null,null,null)),(n()(),t.ɵted(174,null,[""," /",""])),t.ɵppd(175,2),t.ɵppd(176,2),t.ɵppd(177,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,D)),t.ɵdid(182,16384,null,0,r.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(184,0,null,null,13,"div",[],null,null,null,null,null)),t.ɵdid(185,278528,null,0,r.NgClass,[t.IterableDiffers,t.KeyValueDiffers,t.ElementRef,t.Renderer2],{ngClass:[0,"ngClass"]},null),t.ɵpod(186,{"mt-4":0}),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(188,0,null,null,8,"button",[["class","btn btn-primary btn-submit"],["type","submit"]],[[8,"disabled",0]],null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(190,0,null,null,1,"i",[["class","fa fa-spinner fa-spin"]],[[8,"title",0]],null,null,null,null)),t.ɵppd(191,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(193,0,null,null,2,"span",[],null,null,null,null,null)),(n()(),t.ɵted(194,null,["",""])),t.ɵppd(195,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){var e=l.component;n(l,4,0,e.formPromise);n(l,20,0,"");n(l,23,0,"Name",e.name);n(l,36,0,"");n(l,39,0,"BillingEmail",e.billingEmail);n(l,50,0,"OwnedBusiness",e.ownedBusiness),n(l,60,0,e.ownedBusiness),n(l,67,0,!e.ownedBusiness),n(l,70,0,!e.ownedBusiness);n(l,76,0,"PlanType","teams");n(l,78,0,"PlanType",e.plan);n(l,124,0,"PlanType","enterprise");n(l,126,0,"PlanType",e.plan),n(l,182,0,!e.plans[e.plan].noPayment),n(l,185,0,n(l,186,0,e.plans[e.plan].noPayment))},function(n,l){n(l,0,0,t.ɵnov(l,3).ngClassUntouched,t.ɵnov(l,3).ngClassTouched,t.ɵnov(l,3).ngClassPristine,t.ɵnov(l,3).ngClassDirty,t.ɵnov(l,3).ngClassValid,t.ɵnov(l,3).ngClassInvalid,t.ɵnov(l,3).ngClassPending),n(l,7,0,t.ɵunv(l,7,0,n(l,8,0,t.ɵnov(l.parent,0),"generalInformation"))),n(l,15,0,t.ɵunv(l,15,0,n(l,16,0,t.ɵnov(l.parent,0),"organizationName"))),n(l,18,0,t.ɵnov(l,20).required?"":null,t.ɵnov(l,25).ngClassUntouched,t.ɵnov(l,25).ngClassTouched,t.ɵnov(l,25).ngClassPristine,t.ɵnov(l,25).ngClassDirty,t.ɵnov(l,25).ngClassValid,t.ɵnov(l,25).ngClassInvalid,t.ɵnov(l,25).ngClassPending),n(l,31,0,t.ɵunv(l,31,0,n(l,32,0,t.ɵnov(l.parent,0),"billingEmail"))),n(l,34,0,t.ɵnov(l,36).required?"":null,t.ɵnov(l,41).ngClassUntouched,t.ɵnov(l,41).ngClassTouched,t.ɵnov(l,41).ngClassPristine,t.ɵnov(l,41).ngClassDirty,t.ɵnov(l,41).ngClassValid,t.ɵnov(l,41).ngClassInvalid,t.ɵnov(l,41).ngClassPending),n(l,47,0,t.ɵnov(l,52).ngClassUntouched,t.ɵnov(l,52).ngClassTouched,t.ɵnov(l,52).ngClassPristine,t.ɵnov(l,52).ngClassDirty,t.ɵnov(l,52).ngClassValid,t.ɵnov(l,52).ngClassInvalid,t.ɵnov(l,52).ngClassPending),n(l,55,0,t.ɵunv(l,55,0,n(l,56,0,t.ɵnov(l.parent,0),"accountOwnedBusiness"))),n(l,63,0,t.ɵunv(l,63,0,n(l,64,0,t.ɵnov(l.parent,0),"chooseYourPlan"))),n(l,74,0,t.ɵnov(l,80).ngClassUntouched,t.ɵnov(l,80).ngClassTouched,t.ɵnov(l,80).ngClassPristine,t.ɵnov(l,80).ngClassDirty,t.ɵnov(l,80).ngClassValid,t.ɵnov(l,80).ngClassInvalid,t.ɵnov(l,80).ngClassPending),n(l,83,0,t.ɵunv(l,83,0,n(l,84,0,t.ɵnov(l.parent,0),"planNameTeams"))),n(l,86,0,t.ɵunv(l,86,0,n(l,87,0,t.ɵnov(l.parent,0),"planDescTeams"))),n(l,90,0,t.ɵunv(l,90,0,n(l,91,0,t.ɵnov(l.parent,0),"addShareUnlimitedUsers"))),n(l,94,0,t.ɵunv(l,94,0,n(l,95,0,t.ɵnov(l.parent,0),"createUnlimitedCollections"))),n(l,98,0,t.ɵunv(l,98,0,n(l,99,0,t.ɵnov(l.parent,0),"gbEncryptedFileStorage","1 GB"))),n(l,102,0,t.ɵunv(l,102,0,n(l,103,0,t.ɵnov(l.parent,0),"priorityCustomerSupport"))),n(l,106,0,t.ɵunv(l,106,0,n(l,107,0,t.ɵnov(l.parent,0),"xDayFreeTrial","7"))),n(l,110,0,t.ɵunv(l,110,0,n(l,111,0,t.ɵnov(l.parent,1),5,"$")),t.ɵunv(l,110,1,n(l,112,0,t.ɵnov(l.parent,0),"month")),t.ɵunv(l,110,2,n(l,113,0,t.ɵnov(l.parent,0),"includesXUsers",5)),t.ɵunv(l,110,3,n(l,114,0,t.ɵnov(l.parent,0),"additionalUsers")).toLowerCase(),t.ɵunv(l,110,4,n(l,115,0,t.ɵnov(l.parent,1),2,"$")),t.ɵunv(l,110,5,n(l,116,0,t.ɵnov(l.parent,0),"month"))),n(l,122,0,t.ɵnov(l,128).ngClassUntouched,t.ɵnov(l,128).ngClassTouched,t.ɵnov(l,128).ngClassPristine,t.ɵnov(l,128).ngClassDirty,t.ɵnov(l,128).ngClassValid,t.ɵnov(l,128).ngClassInvalid,t.ɵnov(l,128).ngClassPending),n(l,131,0,t.ɵunv(l,131,0,n(l,132,0,t.ɵnov(l.parent,0),"planNameEnterprise"))),n(l,134,0,t.ɵunv(l,134,0,n(l,135,0,t.ɵnov(l.parent,0),"planDescEnterprise"))),n(l,138,0,t.ɵunv(l,138,0,n(l,139,0,t.ɵnov(l.parent,0),"addShareUnlimitedUsers"))),n(l,142,0,t.ɵunv(l,142,0,n(l,143,0,t.ɵnov(l.parent,0),"createUnlimitedCollections"))),n(l,146,0,t.ɵunv(l,146,0,n(l,147,0,t.ɵnov(l.parent,0),"gbEncryptedFileStorage","1 GB"))),n(l,150,0,t.ɵunv(l,150,0,n(l,151,0,t.ɵnov(l.parent,0),"controlAccessWithGroups"))),n(l,154,0,t.ɵunv(l,154,0,n(l,155,0,t.ɵnov(l.parent,0),"trackAuditLogs"))),n(l,158,0,t.ɵunv(l,158,0,n(l,159,0,t.ɵnov(l.parent,0),"syncUsersFromDirectory"))),n(l,162,0,t.ɵunv(l,162,0,n(l,163,0,t.ɵnov(l.parent,0),"onPremHostingOptional"))),n(l,166,0,t.ɵunv(l,166,0,n(l,167,0,t.ɵnov(l.parent,0),"priorityCustomerSupport"))),n(l,170,0,t.ɵunv(l,170,0,n(l,171,0,t.ɵnov(l.parent,0),"xDayFreeTrial","7"))),n(l,174,0,t.ɵunv(l,174,0,n(l,176,0,t.ɵnov(l.parent,0),"costPerUser",t.ɵunv(l,174,0,n(l,175,0,t.ɵnov(l.parent,1),3,"$")))),t.ɵunv(l,174,1,n(l,177,0,t.ɵnov(l.parent,0),"month"))),n(l,188,0,t.ɵnov(l,0).loading),n(l,190,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,190,0,n(l,191,0,t.ɵnov(l.parent,0),"loading")),"")),n(l,194,0,t.ɵunv(l,194,0,n(l,195,0,t.ɵnov(l.parent,0),"submit")))})}function F(n){return t.ɵvid(0,[t.ɵpid(0,p.I18nPipe,[d.I18nService]),t.ɵpid(0,r.CurrencyPipe,[t.LOCALE_ID]),t.ɵqud(671088640,1,{paymentComponent:0}),(n()(),t.ɵeld(3,0,null,null,5,"div",[["class","page-header"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(5,0,null,null,2,"h1",[],null,null,null,null,null)),(n()(),t.ɵted(6,null,["",""])),t.ɵppd(7,1),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵeld(10,0,null,null,2,"p",[],null,null,null,null,null)),(n()(),t.ɵted(11,null,["",""])),t.ɵppd(12,1),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,null,null,1,null,S)),t.ɵdid(15,16384,null,0,r.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,null,null,1,null,U)),t.ɵdid(18,16384,null,0,r.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){var e=l.component;n(l,15,0,e.selfHosted),n(l,18,0,!e.selfHosted)},function(n,l){n(l,6,0,t.ɵunv(l,6,0,n(l,7,0,t.ɵnov(l,0),"newOrganization"))),n(l,11,0,t.ɵunv(l,11,0,n(l,12,0,t.ɵnov(l,0),"newOrganizationDesc")))})}function L(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"app-create-organization",[],null,null,null,F,b)),t.ɵdid(1,114688,null,0,f.CreateOrganizationComponent,[v.ApiService,d.I18nService,h.Angulartics2,g.ToasterService,c.PlatformUtilsService,m.CryptoService,y.Router,C.SyncService,y.ActivatedRoute],null,null)],function(n,l){n(l,1,0)},null)}l.RenderType_CreateOrganizationComponent=b,l.View_CreateOrganizationComponent_0=F,l.View_CreateOrganizationComponent_Host_0=L;var G=t.ɵccf("app-create-organization",f.CreateOrganizationComponent,L,{},{},[]);l.CreateOrganizationComponentNgFactory=G},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(){}}();l.PaymentRequest=t},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(){}}();l.StorageRequest=t},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=e(0),u=e(40),o=e(37),i=e(2),r=e(18),a=e(17),s=e(5),d=e(544),c=e(267),p=e(4),f=e(3),v=e(9),h=e(543),g=e(266),m=e(542),y=e(265),C=e(7),b=e(263),S=e(35),w=e(8),R=e(10),_=t.ɵcrt({encapsulation:2,styles:[],data:{}});function I(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"i",[["class","fa fa-spinner fa-spin text-muted"]],[[8,"title",0]],null,null,null,null)),t.ɵppd(1,1)],null,function(n,l){n(l,0,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,0,0,n(l,1,0,t.ɵnov(l.parent,0),"loading")),""))})}function A(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"i",[["class","fa fa-spinner fa-spin text-muted"]],[[8,"title",0]],null,null,null,null)),t.ɵppd(1,1)],null,function(n,l){n(l,0,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,0,0,n(l,1,0,t.ɵnov(l.parent,0),"loading")),""))})}function E(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,4,"app-callout",[["type","warning"]],null,null,null,u.View_CalloutComponent_0,u.RenderType_CalloutComponent)),t.ɵdid(1,114688,null,0,o.CalloutComponent,[i.I18nService],{type:[0,"type"],title:[1,"title"]},null),t.ɵppd(2,1),(n()(),t.ɵted(3,0,["",""])),t.ɵppd(4,1)],function(n,l){n(l,1,0,"warning",t.ɵinlineInterpolate(1,"",t.ɵunv(l,1,1,n(l,2,0,t.ɵnov(l.parent.parent,0),"canceled")),""))},function(n,l){n(l,3,0,t.ɵunv(l,3,0,n(l,4,0,t.ɵnov(l.parent.parent,0),"subscriptionCanceled")))})}function O(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,18,"app-callout",[["type","warning"]],null,null,null,u.View_CalloutComponent_0,u.RenderType_CalloutComponent)),t.ɵdid(1,114688,null,0,o.CalloutComponent,[i.I18nService],{type:[0,"type"],title:[1,"title"]},null),t.ɵppd(2,1),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵeld(4,0,null,0,2,"p",[],null,null,null,null,null)),(n()(),t.ɵted(5,null,["",""])),t.ɵppd(6,1),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵeld(8,0,[["reinstateBtn",1]],0,9,"button",[["class","btn btn-outline-secondary btn-submit"],["type","button"]],[[8,"disabled",0]],[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.reinstate()&&t);return t},null,null)),t.ɵdid(9,540672,null,0,r.ApiActionDirective,[t.ElementRef,a.ValidationService],{appApiAction:[0,"appApiAction"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(11,0,null,null,1,"i",[["class","fa fa-spinner fa-spin"]],[[8,"title",0]],null,null,null,null)),t.ɵppd(12,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(14,0,null,null,2,"span",[],null,null,null,null,null)),(n()(),t.ɵted(15,null,["",""])),t.ɵppd(16,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,0,["\n "]))],function(n,l){var e=l.component;n(l,1,0,"warning",t.ɵinlineInterpolate(1,"",t.ɵunv(l,1,1,n(l,2,0,t.ɵnov(l.parent.parent,0),"pendingCancellation")),"")),n(l,9,0,e.reinstatePromise)},function(n,l){n(l,5,0,t.ɵunv(l,5,0,n(l,6,0,t.ɵnov(l.parent.parent,0),"subscriptionPendingCanceled"))),n(l,8,0,t.ɵnov(l,8).loading),n(l,11,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,11,0,n(l,12,0,t.ɵnov(l.parent.parent,0),"loading")),"")),n(l,15,0,t.ɵunv(l,15,0,n(l,16,0,t.ɵnov(l.parent.parent,0),"reinstateSubscription")))})}function N(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,2,"dd",[],null,null,null,null,null)),(n()(),t.ɵted(1,null,["",""])),t.ɵppd(2,2)],null,function(n,l){var e=l.component;n(l,1,0,t.ɵunv(l,1,0,n(l,2,0,t.ɵnov(l.parent.parent.parent,1),e.billing.expiration,"mediumDate")))})}function T(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,2,"dd",[],null,null,null,null,null)),(n()(),t.ɵted(1,null,["",""])),t.ɵppd(2,1)],null,function(n,l){n(l,1,0,t.ɵunv(l,1,0,n(l,2,0,t.ɵnov(l.parent.parent.parent,0),"neverExpires")))})}function k(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,11,"dl",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,2,"dt",[],null,null,null,null,null)),(n()(),t.ɵted(3,null,["",""])),t.ɵppd(4,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,N)),t.ɵdid(7,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,T)),t.ɵdid(10,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){var e=l.component;n(l,7,0,e.billing.expiration),n(l,10,0,!e.billing.expiration)},function(n,l){n(l,3,0,t.ɵunv(l,3,0,n(l,4,0,t.ɵnov(l.parent.parent,0),"expiration")))})}function V(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,2,"span",[["class","badge badge-warning"]],null,null,null,null,null)),(n()(),t.ɵted(1,null,["",""])),t.ɵppd(2,1)],null,function(n,l){n(l,1,0,t.ɵunv(l,1,0,n(l,2,0,t.ɵnov(l.parent.parent.parent,0),"pendingCancellation")))})}function P(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,10,"tr",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,2,"td",[],null,null,null,null,null)),(n()(),t.ɵted(3,null,["\n "," "," @ ","\n "])),t.ɵppd(4,2),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(6,0,null,null,3,"td",[],null,null,null,null,null)),(n()(),t.ɵted(7,null,["\n "," /","\n "])),t.ɵppd(8,2),t.ɵppd(9,1),(n()(),t.ɵted(-1,null,["\n "]))],null,function(n,l){n(l,3,0,l.context.$implicit.name,l.context.$implicit.quantity>1?"×"+l.context.$implicit.quantity:"",t.ɵunv(l,3,2,n(l,4,0,t.ɵnov(l.parent.parent.parent.parent,2),l.context.$implicit.amount,"$"))),n(l,7,0,t.ɵunv(l,7,0,n(l,8,0,t.ɵnov(l.parent.parent.parent.parent,2),l.context.$implicit.quantity*l.context.$implicit.amount,"$")),t.ɵunv(l,7,1,n(l,9,0,t.ɵnov(l.parent.parent.parent.parent,0),l.context.$implicit.interval)))})}function M(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,14,"div",[["class","col-8"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,2,"strong",[["class","d-block mb-1"]],null,null,null,null,null)),(n()(),t.ɵted(3,null,["",""])),t.ɵppd(4,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(6,0,null,null,7,"table",[["class","table"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(8,0,null,null,4,"tbody",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,P)),t.ɵdid(11,802816,null,0,s.NgForOf,[t.ViewContainerRef,t.TemplateRef,t.IterableDiffers],{ngForOf:[0,"ngForOf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){n(l,11,0,l.component.subscription.items)},function(n,l){n(l,3,0,t.ɵunv(l,3,0,n(l,4,0,t.ɵnov(l.parent.parent.parent,0),"details")))})}function x(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,32,"div",[["class","row"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,26,"div",[["class","col-4"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(4,0,null,null,23,"dl",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(6,0,null,null,2,"dt",[],null,null,null,null,null)),(n()(),t.ɵted(7,null,["",""])),t.ɵppd(8,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(10,0,null,null,7,"dd",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(12,0,null,null,1,"span",[["class","text-capitalize"]],null,null,null,null,null)),(n()(),t.ɵted(13,null,["",""])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,V)),t.ɵdid(16,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(19,0,null,null,2,"dt",[],null,null,null,null,null)),(n()(),t.ɵted(20,null,["",""])),t.ɵppd(21,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(23,0,null,null,3,"dd",[],null,null,null,null,null)),(n()(),t.ɵted(24,null,["","\n "])),t.ɵppd(25,2),t.ɵppd(26,2),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,M)),t.ɵdid(31,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){var e=l.component;n(l,16,0,e.subscriptionMarkedForCancel),n(l,31,0,e.subscription)},function(n,l){var e=l.component;n(l,7,0,t.ɵunv(l,7,0,n(l,8,0,t.ɵnov(l.parent.parent,0),"status"))),n(l,13,0,e.subscription&&e.subscription.status||"-"),n(l,20,0,t.ɵunv(l,20,0,n(l,21,0,t.ɵnov(l.parent.parent,0),"nextCharge"))),n(l,24,0,e.nextInvoice?t.ɵunv(l,24,0,n(l,25,0,t.ɵnov(l.parent.parent,1),e.nextInvoice.date,"mediumDate"))+", "+t.ɵunv(l,24,0,n(l,26,0,t.ɵnov(l.parent.parent,2),e.nextInvoice.amount,"$")):"-")})}function D(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,11,"div",[["class","card mt-3"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,8,"div",[["class","card-body"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(4,0,null,null,2,"h3",[["class","card-body-header"]],null,null,null,null,null)),(n()(),t.ɵted(5,null,["",""])),t.ɵppd(6,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(8,0,null,null,1,"app-update-license",[],null,[[null,"onUpdated"],[null,"onCanceled"]],function(n,l,e){var t=!0,u=n.component;"onUpdated"===l&&(t=!1!==u.closeUpdateLicense(!0)&&t);"onCanceled"===l&&(t=!1!==u.closeUpdateLicense(!1)&&t);return t},d.View_UpdateLicenseComponent_0,d.RenderType_UpdateLicenseComponent)),t.ɵdid(9,49152,null,0,c.UpdateLicenseComponent,[p.ApiService,i.I18nService,f.Angulartics2,v.ToasterService],null,{onUpdated:"onUpdated",onCanceled:"onCanceled"}),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "]))],null,function(n,l){n(l,5,0,t.ɵunv(l,5,0,n(l,6,0,t.ɵnov(l.parent.parent.parent,0),"updateLicense")))})}function U(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,15,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,9,"div",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(4,0,null,null,2,"button",[["class","btn btn-outline-secondary"],["type","button"]],null,[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.updateLicense()&&t);return t},null,null)),(n()(),t.ɵted(5,null,["\n ","\n "])),t.ɵppd(6,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(8,0,null,null,2,"a",[["class","btn btn-outline-secondary"],["href","https://vault.bitwarden.com/#/settings/billing"],["rel","noopener"],["target","_blank"]],null,null,null,null,null)),(n()(),t.ɵted(9,null,["\n ","\n "])),t.ɵppd(10,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,D)),t.ɵdid(14,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){n(l,14,0,l.component.showUpdateLicense)},function(n,l){n(l,5,0,t.ɵunv(l,5,0,n(l,6,0,t.ɵnov(l.parent.parent,0),"updateLicense"))),n(l,9,0,t.ɵunv(l,9,0,n(l,10,0,t.ɵnov(l.parent.parent,0),"manageSubscription")))})}function F(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,2,"button",[["class","btn btn-outline-secondary"],["type","button"]],null,[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.downloadLicense()&&t);return t},null,null)),(n()(),t.ɵted(1,null,["\n ","\n "])),t.ɵppd(2,1)],null,function(n,l){n(l,1,0,t.ɵunv(l,1,0,n(l,2,0,t.ɵnov(l.parent.parent.parent,0),"downloadLicense")))})}function L(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,[["cancelBtn",1]],null,9,"button",[["class","btn btn-outline-danger btn-submit ml-auto"],["type","button"]],[[8,"disabled",0]],[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.cancel()&&t);return t},null,null)),t.ɵdid(1,540672,null,0,r.ApiActionDirective,[t.ElementRef,a.ValidationService],{appApiAction:[0,"appApiAction"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(3,0,null,null,1,"i",[["class","fa fa-spinner fa-spin"]],[[8,"title",0]],null,null,null,null)),t.ɵppd(4,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(6,0,null,null,2,"span",[],null,null,null,null,null)),(n()(),t.ɵted(7,null,["",""])),t.ɵppd(8,1),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){n(l,1,0,l.component.cancelPromise)},function(n,l){n(l,0,0,t.ɵnov(l,0).loading),n(l,3,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,3,0,n(l,4,0,t.ɵnov(l.parent.parent.parent,0),"loading")),"")),n(l,7,0,t.ɵunv(l,7,0,n(l,8,0,t.ɵnov(l.parent.parent.parent,0),"cancelSubscription")))})}function G(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,9,"div",[["class","d-flex"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,2,"button",[["class","btn btn-outline-secondary"],["type","button"]],null,[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.adjustStorage(!0)&&t);return t},null,null)),(n()(),t.ɵted(3,null,["\n ","\n "])),t.ɵppd(4,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(6,0,null,null,2,"button",[["class","ml-1 btn btn-outline-secondary"],["type","button"]],null,[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.adjustStorage(!1)&&t);return t},null,null)),(n()(),t.ɵted(7,null,["\n ","\n "])),t.ɵppd(8,1),(n()(),t.ɵted(-1,null,["\n "]))],null,function(n,l){n(l,3,0,t.ɵunv(l,3,0,n(l,4,0,t.ɵnov(l.parent.parent.parent.parent,0),"addStorage"))),n(l,7,0,t.ɵunv(l,7,0,n(l,8,0,t.ɵnov(l.parent.parent.parent.parent,0),"removeStorage")))})}function q(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"app-adjust-storage",[],null,[[null,"onAdjusted"],[null,"onCanceled"]],function(n,l,e){var t=!0,u=n.component;"onAdjusted"===l&&(t=!1!==u.closeStorage(!0)&&t);"onCanceled"===l&&(t=!1!==u.closeStorage(!1)&&t);return t},h.View_AdjustStorageComponent_0,h.RenderType_AdjustStorageComponent)),t.ɵdid(1,49152,null,0,g.AdjustStorageComponent,[p.ApiService,i.I18nService,f.Angulartics2,v.ToasterService],{storageGbPrice:[0,"storageGbPrice"],add:[1,"add"]},{onAdjusted:"onAdjusted",onCanceled:"onCanceled"})],function(n,l){n(l,1,0,4,l.component.adjustStorageAdd)},null)}function z(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,10,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,7,"div",[["class","mt-3"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,G)),t.ɵdid(5,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,q)),t.ɵdid(8,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){var e=l.component;n(l,5,0,!e.showAdjustStorage),n(l,8,0,e.showAdjustStorage)},null)}function j(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,2,"p",[],null,null,null,null,null)),(n()(),t.ɵted(1,null,["",""])),t.ɵppd(2,1)],null,function(n,l){n(l,1,0,t.ɵunv(l,1,0,n(l,2,0,t.ɵnov(l.parent.parent.parent,0),"noPaymentMethod")))})}function B(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,5,"p",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,2,"i",[["class","fa fa-fw"]],null,null,null,null,null)),t.ɵdid(3,278528,null,0,s.NgClass,[t.IterableDiffers,t.KeyValueDiffers,t.ElementRef,t.Renderer2],{klass:[0,"klass"],ngClass:[1,"ngClass"]},null),t.ɵpod(4,{"fa-credit-card":0,"fa-university":1,"fa-paypal text-primary":2}),(n()(),t.ɵted(5,null,["\n ","\n "]))],function(n,l){var e=l.component;n(l,3,0,"fa fa-fw",n(l,4,0,e.paymentSource.type===e.paymentMethodType.Card,e.paymentSource.type===e.paymentMethodType.BankAccount,e.paymentSource.type===e.paymentMethodType.PayPal))},function(n,l){n(l,5,0,l.component.paymentSource.description)})}function K(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,2,"button",[["class","btn btn-outline-secondary"],["type","button"]],null,[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.changePayment()&&t);return t},null,null)),(n()(),t.ɵted(1,null,["\n ","\n "])),t.ɵppd(2,1)],null,function(n,l){var e=l.component;n(l,1,0,t.ɵunv(l,1,0,n(l,2,0,t.ɵnov(l.parent.parent.parent,0),e.paymentSource?"changePaymentMethod":"addPaymentMethod")))})}function H(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,2,"app-adjust-payment",[],null,[[null,"onAdjusted"],[null,"onCanceled"]],function(n,l,e){var t=!0,u=n.component;"onAdjusted"===l&&(t=!1!==u.closePayment(!0)&&t);"onCanceled"===l&&(t=!1!==u.closePayment(!1)&&t);return t},m.View_AdjustPaymentComponent_0,m.RenderType_AdjustPaymentComponent)),t.ɵdid(1,49152,null,0,y.AdjustPaymentComponent,[p.ApiService,i.I18nService,f.Angulartics2,v.ToasterService],{currentType:[0,"currentType"]},{onAdjusted:"onAdjusted",onCanceled:"onCanceled"}),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){var e=l.component;n(l,1,0,null!=e.paymentSource?e.paymentSource.type:null)},null)}function $(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,2,"p",[],null,null,null,null,null)),(n()(),t.ɵted(1,null,["",""])),t.ɵppd(2,1)],null,function(n,l){n(l,1,0,t.ɵunv(l,1,0,n(l,2,0,t.ɵnov(l.parent.parent.parent,0),"noCharges")))})}function W(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,18,"tr",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,2,"td",[],null,null,null,null,null)),(n()(),t.ɵted(3,null,["",""])),t.ɵppd(4,2),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(6,0,null,null,1,"td",[],null,null,null,null,null)),(n()(),t.ɵted(7,null,["",""])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(9,0,null,null,1,"td",[["class","text-capitalize"]],null,null,null,null,null)),(n()(),t.ɵted(10,null,["",""])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(12,0,null,null,5,"td",[],[[8,"title",0]],null,null,null,null)),t.ɵdid(13,278528,null,0,s.NgClass,[t.IterableDiffers,t.KeyValueDiffers,t.ElementRef,t.Renderer2],{ngClass:[0,"ngClass"]},null),t.ɵpod(14,{"text-strike":0}),t.ɵppd(15,1),(n()(),t.ɵted(16,null,["",""])),t.ɵppd(17,2),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){n(l,13,0,n(l,14,0,l.context.$implicit.refunded))},function(n,l){n(l,3,0,t.ɵunv(l,3,0,n(l,4,0,t.ɵnov(l.parent.parent.parent.parent,1),l.context.$implicit.createdDate,"mediumDate"))),n(l,7,0,l.context.$implicit.paymentSource?l.context.$implicit.paymentSource.description:"-"),n(l,10,0,l.context.$implicit.status),n(l,12,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,12,0,n(l,15,0,t.ɵnov(l.parent.parent.parent.parent,0),l.context.$implicit.refunded?"refunded":"")),"")),n(l,16,0,t.ɵunv(l,16,0,n(l,17,0,t.ɵnov(l.parent.parent.parent.parent,2),l.context.$implicit.amount,"$")))})}function Y(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,7,"table",[["class","table mb-2"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,4,"tbody",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,W)),t.ɵdid(5,802816,null,0,s.NgForOf,[t.ViewContainerRef,t.TemplateRef,t.IterableDiffers],{ngForOf:[0,"ngForOf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){n(l,5,0,l.component.charges)},null)}function Z(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,60,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,7,"div",[["class","d-flex"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,F)),t.ɵdid(5,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,L)),t.ɵdid(8,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(11,0,null,null,2,"h2",[["class","spaced-header"]],null,null,null,null,null)),(n()(),t.ɵted(12,null,["",""])),t.ɵppd(13,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(15,0,null,null,2,"p",[],null,null,null,null,null)),(n()(),t.ɵted(16,null,["",""])),t.ɵppd(17,3),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(19,0,null,null,7,"div",[["class","progress"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(21,0,null,null,4,"div",[["aria-valuemax","100"],["aria-valuemin","0"],["class","progress-bar bg-success"],["role","progressbar"]],[[1,"aria-valuenow",0]],null,null,null,null)),t.ɵdid(22,278528,null,0,s.NgStyle,[t.KeyValueDiffers,t.ElementRef,t.Renderer2],{ngStyle:[0,"ngStyle"]},null),t.ɵpod(23,{width:0}),(n()(),t.ɵted(24,null,["",""])),t.ɵppd(25,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,z)),t.ɵdid(29,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(31,0,null,null,2,"h2",[["class","spaced-header"]],null,null,null,null,null)),(n()(),t.ɵted(32,null,["",""])),t.ɵppd(33,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,j)),t.ɵdid(36,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,B)),t.ɵdid(39,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,K)),t.ɵdid(42,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,H)),t.ɵdid(45,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(47,0,null,null,2,"h2",[["class","spaced-header"]],null,null,null,null,null)),(n()(),t.ɵted(48,null,["",""])),t.ɵppd(49,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,$)),t.ɵdid(52,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,Y)),t.ɵdid(55,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(57,0,null,null,2,"small",[["class","text-muted"]],null,null,null,null,null)),(n()(),t.ɵted(58,null,["* ",""])),t.ɵppd(59,2),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){var e=l.component;n(l,5,0,!e.subscription||!e.subscription.cancelled),n(l,8,0,e.subscription&&!e.subscription.cancelled&&!e.subscriptionMarkedForCancel),n(l,22,0,n(l,23,0,e.storageProgressWidth+"%")),n(l,29,0,e.subscription&&!e.subscription.cancelled&&!e.subscriptionMarkedForCancel&&e.paymentSource),n(l,36,0,!e.paymentSource),n(l,39,0,e.paymentSource),n(l,42,0,!e.showAdjustPayment),n(l,45,0,e.showAdjustPayment),n(l,52,0,!e.charges||!e.charges.length),n(l,55,0,e.charges&&e.charges.length)},function(n,l){var e=l.component;n(l,12,0,t.ɵunv(l,12,0,n(l,13,0,t.ɵnov(l.parent.parent,0),"storage"))),n(l,16,0,t.ɵunv(l,16,0,n(l,17,0,t.ɵnov(l.parent.parent,0),"subscriptionStorage",e.billing.maxStorageGb||0,e.billing.storageName||"0 MB"))),n(l,21,0,e.storagePercentage),n(l,24,0,t.ɵunv(l,24,0,n(l,25,0,t.ɵnov(l.parent.parent,3),e.storagePercentage/100))),n(l,32,0,t.ɵunv(l,32,0,n(l,33,0,t.ɵnov(l.parent.parent,0),"paymentMethod"))),n(l,48,0,t.ɵunv(l,48,0,n(l,49,0,t.ɵnov(l.parent.parent,0),"charges"))),n(l,58,0,t.ɵunv(l,58,0,n(l,59,0,t.ɵnov(l.parent.parent,0),"chargesStatement","BITWARDEN")))})}function J(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,30,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,E)),t.ɵdid(3,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,O)),t.ɵdid(6,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(8,0,null,null,9,"dl",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(10,0,null,null,2,"dt",[],null,null,null,null,null)),(n()(),t.ɵted(11,null,["",""])),t.ɵppd(12,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(14,0,null,null,2,"dd",[],null,null,null,null,null)),(n()(),t.ɵted(15,null,["",""])),t.ɵppd(16,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,k)),t.ɵdid(20,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,x)),t.ɵdid(23,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,U)),t.ɵdid(26,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,Z)),t.ɵdid(29,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){var e=l.component;n(l,3,0,e.subscription&&e.subscription.cancelled),n(l,6,0,e.subscriptionMarkedForCancel),n(l,20,0,e.selfHosted),n(l,23,0,!e.selfHosted),n(l,26,0,e.selfHosted),n(l,29,0,!e.selfHosted)},function(n,l){n(l,11,0,t.ɵunv(l,11,0,n(l,12,0,t.ɵnov(l.parent,0),"subscription"))),n(l,15,0,t.ɵunv(l,15,0,n(l,16,0,t.ɵnov(l.parent,0),"premiumMembership")))})}function X(n){return t.ɵvid(0,[t.ɵpid(0,C.I18nPipe,[i.I18nService]),t.ɵpid(0,s.DatePipe,[t.LOCALE_ID]),t.ɵpid(0,s.CurrencyPipe,[t.LOCALE_ID]),t.ɵpid(0,s.PercentPipe,[t.LOCALE_ID]),(n()(),t.ɵeld(4,0,null,null,11,"div",[["class","page-header"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(6,0,null,null,8,"h1",[],null,null,null,null,null)),(n()(),t.ɵted(7,null,["\n ","\n "])),t.ɵppd(8,1),(n()(),t.ɵeld(9,0,null,null,4,"small",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,I)),t.ɵdid(12,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,null,null,1,null,A)),t.ɵdid(18,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,null,null,1,null,J)),t.ɵdid(21,16384,null,0,s.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){var e=l.component;n(l,12,0,e.firstLoaded&&e.loading),n(l,18,0,!e.firstLoaded&&e.loading),n(l,21,0,e.billing)},function(n,l){n(l,7,0,t.ɵunv(l,7,0,n(l,8,0,t.ɵnov(l,0),"billingAndLicensing")))})}function Q(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"app-user-billing",[],null,null,null,X,_)),t.ɵdid(1,114688,null,0,b.UserBillingComponent,[S.TokenService,p.ApiService,w.PlatformUtilsService,i.I18nService,f.Angulartics2,v.ToasterService,R.Router],null,null)],function(n,l){n(l,1,0)},null)}l.RenderType_UserBillingComponent=_,l.View_UserBillingComponent_0=X,l.View_UserBillingComponent_Host_0=Q;var nn=t.ɵccf("app-user-billing",b.UserBillingComponent,Q,{},{},[]);l.UserBillingComponentNgFactory=nn},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=e(0),u=e(13),o=e(18),i=e(17),r=e(269),a=e(127),s=e(2),d=e(8),c=e(7),p=e(5),f=e(40),v=e(37),h=e(268),g=e(4),m=e(3),y=e(9),C=e(35),b=e(10),S=e(27),w=e(66),R=t.ɵcrt({encapsulation:2,styles:[],data:{}});function _(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,2,"a",[["class","btn btn-outline-secondary"],["href","https://vault.bitwarden.com/#/settings/premium"],["rel","noopener"],["target","_blank"]],null,null,null,null,null)),(n()(),t.ɵted(1,null,["\n ","\n "])),t.ɵppd(2,1)],null,function(n,l){n(l,1,0,t.ɵunv(l,1,0,n(l,2,0,t.ɵnov(l.parent,0),"purchasePremium")))})}function I(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,35,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,2,"p",[],null,null,null,null,null)),(n()(),t.ɵted(3,null,["",""])),t.ɵppd(4,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(6,0,[["form",1]],null,28,"form",[["ngNativeValidate",""]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngSubmit"],[null,"submit"],[null,"reset"]],function(n,l,e){var u=!0,o=n.component;"submit"===l&&(u=!1!==t.ɵnov(n,7).onSubmit(e)&&u);"reset"===l&&(u=!1!==t.ɵnov(n,7).onReset()&&u);"ngSubmit"===l&&(u=!1!==o.submit()&&u);return u},null,null)),t.ɵdid(7,4210688,null,0,u.NgForm,[[8,null],[8,null]],null,{ngSubmit:"ngSubmit"}),t.ɵprd(2048,null,u.ControlContainer,null,[u.NgForm]),t.ɵdid(9,16384,null,0,u.NgControlStatusGroup,[u.ControlContainer],null,null),t.ɵdid(10,540672,null,0,o.ApiActionDirective,[t.ElementRef,i.ValidationService],{appApiAction:[0,"appApiAction"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(12,0,null,null,11,"div",[["class","form-group"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(14,0,null,null,2,"label",[["for","file"]],null,null,null,null,null)),(n()(),t.ɵted(15,null,["",""])),t.ɵppd(16,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(18,0,null,null,0,"input",[["class","form-control-file"],["id","file"],["name","file"],["required",""],["type","file"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(20,0,null,null,2,"small",[["class","form-text text-muted"]],null,null,null,null,null)),(n()(),t.ɵted(21,null,["",""])),t.ɵppd(22,2),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(25,0,null,null,8,"button",[["class","btn btn-primary btn-submit"],["type","submit"]],[[8,"disabled",0]],null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(27,0,null,null,1,"i",[["class","fa fa-spinner fa-spin"]],[[8,"title",0]],null,null,null,null)),t.ɵppd(28,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(30,0,null,null,2,"span",[],null,null,null,null,null)),(n()(),t.ɵted(31,null,["",""])),t.ɵppd(32,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){n(l,10,0,l.component.formPromise)},function(n,l){n(l,3,0,t.ɵunv(l,3,0,n(l,4,0,t.ɵnov(l.parent,0),"uploadLicenseFilePremium"))),n(l,6,0,t.ɵnov(l,9).ngClassUntouched,t.ɵnov(l,9).ngClassTouched,t.ɵnov(l,9).ngClassPristine,t.ɵnov(l,9).ngClassDirty,t.ɵnov(l,9).ngClassValid,t.ɵnov(l,9).ngClassInvalid,t.ɵnov(l,9).ngClassPending),n(l,15,0,t.ɵunv(l,15,0,n(l,16,0,t.ɵnov(l.parent,0),"licenseFile"))),n(l,21,0,t.ɵunv(l,21,0,n(l,22,0,t.ɵnov(l.parent,0),"licenseFileDesc","bitwarden_premium_license.json"))),n(l,25,0,t.ɵnov(l,6).loading),n(l,27,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,27,0,n(l,28,0,t.ɵnov(l.parent,0),"loading")),"")),n(l,31,0,t.ɵunv(l,31,0,n(l,32,0,t.ɵnov(l.parent,0),"submit")))})}function A(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,[["form",1]],null,76,"form",[["ngNativeValidate",""]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngSubmit"],[null,"submit"],[null,"reset"]],function(n,l,e){var u=!0,o=n.component;"submit"===l&&(u=!1!==t.ɵnov(n,1).onSubmit(e)&&u);"reset"===l&&(u=!1!==t.ɵnov(n,1).onReset()&&u);"ngSubmit"===l&&(u=!1!==o.submit()&&u);return u},null,null)),t.ɵdid(1,4210688,null,0,u.NgForm,[[8,null],[8,null]],null,{ngSubmit:"ngSubmit"}),t.ɵprd(2048,null,u.ControlContainer,null,[u.NgForm]),t.ɵdid(3,16384,null,0,u.NgControlStatusGroup,[u.ControlContainer],null,null),t.ɵdid(4,540672,null,0,o.ApiActionDirective,[t.ElementRef,i.ValidationService],{appApiAction:[0,"appApiAction"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(6,0,null,null,2,"h2",[["class","mt-5"]],null,null,null,null,null)),(n()(),t.ɵted(7,null,["",""])),t.ɵppd(8,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(10,0,null,null,22,"div",[["class","row"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(12,0,null,null,19,"div",[["class","form-group col-6"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(14,0,null,null,2,"label",[["for","additionalStorage"]],null,null,null,null,null)),(n()(),t.ɵted(15,null,["",""])),t.ɵppd(16,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(18,0,null,null,7,"input",[["class","form-control"],["id","additionalStorage"],["max","99"],["min","0"],["name","AdditionalStorageGb"],["step","1"],["type","number"]],[[8,"placeholder",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"],[null,"change"]],function(n,l,e){var u=!0,o=n.component;"input"===l&&(u=!1!==t.ɵnov(n,19)._handleInput(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,19).onTouched()&&u);"compositionstart"===l&&(u=!1!==t.ɵnov(n,19)._compositionStart()&&u);"compositionend"===l&&(u=!1!==t.ɵnov(n,19)._compositionEnd(e.target.value)&&u);"change"===l&&(u=!1!==t.ɵnov(n,20).onChange(e.target.value)&&u);"input"===l&&(u=!1!==t.ɵnov(n,20).onChange(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,20).onTouched()&&u);"ngModelChange"===l&&(u=!1!==(o.additionalStorage=e)&&u);return u},null,null)),t.ɵdid(19,16384,null,0,u.DefaultValueAccessor,[t.Renderer2,t.ElementRef,[2,u.COMPOSITION_BUFFER_MODE]],null,null),t.ɵdid(20,16384,null,0,u.ɵbc,[t.Renderer2,t.ElementRef],null,null),t.ɵprd(1024,null,u.NG_VALUE_ACCESSOR,function(n,l){return[n,l]},[u.DefaultValueAccessor,u.ɵbc]),t.ɵdid(22,671744,null,0,u.NgModel,[[2,u.ControlContainer],[8,null],[8,null],[2,u.NG_VALUE_ACCESSOR]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,u.NgControl,null,[u.NgModel]),t.ɵdid(24,16384,null,0,u.NgControlStatus,[u.NgControl],null,null),t.ɵppd(25,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(27,0,null,null,3,"small",[["class","text-muted form-text"]],null,null,null,null,null)),(n()(),t.ɵted(28,null,["",""])),t.ɵppd(29,2),t.ɵppd(30,3),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(34,0,null,null,2,"h2",[["class","spaced-header"]],null,null,null,null,null)),(n()(),t.ɵted(35,null,["",""])),t.ɵppd(36,1),(n()(),t.ɵted(37,null,["\n ",": ","\n "])),t.ɵppd(38,1),t.ɵppd(39,2),(n()(),t.ɵeld(40,0,null,null,0,"br",[],null,null,null,null,null)),(n()(),t.ɵted(41,null,[" ",": "," GB × "," = ","\n "])),t.ɵppd(42,1),t.ɵppd(43,2),t.ɵppd(44,2),(n()(),t.ɵeld(45,0,null,null,0,"hr",[["class","my-3"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(47,0,null,null,7,"div",[["class","text-lg"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(49,0,null,null,2,"strong",[],null,null,null,null,null)),(n()(),t.ɵted(50,null,["",":"])),t.ɵppd(51,1),(n()(),t.ɵted(52,null,[" "," /","\n "])),t.ɵppd(53,2),t.ɵppd(54,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(56,0,null,null,2,"small",[["class","text-muted font-italic"]],null,null,null,null,null)),(n()(),t.ɵted(57,null,["",""])),t.ɵppd(58,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(60,0,null,null,2,"h2",[["class","spaced-header mb-4"]],null,null,null,null,null)),(n()(),t.ɵted(61,null,["",""])),t.ɵppd(62,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(64,0,null,null,1,"app-payment",[],null,null,null,r.View_PaymentComponent_0,r.RenderType_PaymentComponent)),t.ɵdid(65,245760,[[1,4]],0,a.PaymentComponent,[s.I18nService,d.PlatformUtilsService],{hideBank:[0,"hideBank"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(67,0,null,null,8,"button",[["class","btn btn-primary btn-submit"],["type","submit"]],[[8,"disabled",0]],null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(69,0,null,null,1,"i",[["class","fa fa-spinner fa-spin"]],[[8,"title",0]],null,null,null,null)),t.ɵppd(70,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(72,0,null,null,2,"span",[],null,null,null,null,null)),(n()(),t.ɵted(73,null,["",""])),t.ɵppd(74,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){var e=l.component;n(l,4,0,e.formPromise);n(l,22,0,"AdditionalStorageGb",e.additionalStorage);n(l,65,0,!0)},function(n,l){var e=l.component;n(l,0,0,t.ɵnov(l,3).ngClassUntouched,t.ɵnov(l,3).ngClassTouched,t.ɵnov(l,3).ngClassPristine,t.ɵnov(l,3).ngClassDirty,t.ɵnov(l,3).ngClassValid,t.ɵnov(l,3).ngClassInvalid,t.ɵnov(l,3).ngClassPending),n(l,7,0,t.ɵunv(l,7,0,n(l,8,0,t.ɵnov(l.parent,0),"addons"))),n(l,15,0,t.ɵunv(l,15,0,n(l,16,0,t.ɵnov(l.parent,0),"additionalStorageGb"))),n(l,18,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,18,0,n(l,25,0,t.ɵnov(l.parent,0),"additionalStorageGbDesc")),""),t.ɵnov(l,24).ngClassUntouched,t.ɵnov(l,24).ngClassTouched,t.ɵnov(l,24).ngClassPristine,t.ɵnov(l,24).ngClassDirty,t.ɵnov(l,24).ngClassValid,t.ɵnov(l,24).ngClassInvalid,t.ɵnov(l,24).ngClassPending),n(l,28,0,t.ɵunv(l,28,0,n(l,30,0,t.ɵnov(l.parent,0),"additionalStorageDesc","1 GB",t.ɵunv(l,28,0,n(l,29,0,t.ɵnov(l.parent,1),e.storageGbPrice,"$"))))),n(l,35,0,t.ɵunv(l,35,0,n(l,36,0,t.ɵnov(l.parent,0),"summary"))),n(l,37,0,t.ɵunv(l,37,0,n(l,38,0,t.ɵnov(l.parent,0),"premiumMembership")),t.ɵunv(l,37,1,n(l,39,0,t.ɵnov(l.parent,1),e.premiumPrice,"$"))),n(l,41,0,t.ɵunv(l,41,0,n(l,42,0,t.ɵnov(l.parent,0),"additionalStorageGb")),e.additionalStorage||0,t.ɵunv(l,41,2,n(l,43,0,t.ɵnov(l.parent,1),e.storageGbPrice,"$")),t.ɵunv(l,41,3,n(l,44,0,t.ɵnov(l.parent,1),e.additionalStorageTotal,"$"))),n(l,50,0,t.ɵunv(l,50,0,n(l,51,0,t.ɵnov(l.parent,0),"total"))),n(l,52,0,t.ɵunv(l,52,0,n(l,53,0,t.ɵnov(l.parent,1),e.total,"USD $")),t.ɵunv(l,52,1,n(l,54,0,t.ɵnov(l.parent,0),"year"))),n(l,57,0,t.ɵunv(l,57,0,n(l,58,0,t.ɵnov(l.parent,0),"paymentChargedAnnually"))),n(l,61,0,t.ɵunv(l,61,0,n(l,62,0,t.ɵnov(l.parent,0),"paymentInformation"))),n(l,67,0,t.ɵnov(l,0).loading),n(l,69,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,69,0,n(l,70,0,t.ɵnov(l.parent,0),"loading")),"")),n(l,73,0,t.ɵunv(l,73,0,n(l,74,0,t.ɵnov(l.parent,0),"submit")))})}function E(n){return t.ɵvid(0,[t.ɵpid(0,c.I18nPipe,[s.I18nService]),t.ɵpid(0,p.CurrencyPipe,[t.LOCALE_ID]),t.ɵqud(671088640,1,{paymentComponent:0}),(n()(),t.ɵeld(3,0,null,null,5,"div",[["class","page-header"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(5,0,null,null,2,"h1",[],null,null,null,null,null)),(n()(),t.ɵted(6,null,["",""])),t.ɵppd(7,1),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵeld(10,0,null,null,49,"app-callout",[["type","success"]],null,null,null,f.View_CalloutComponent_0,f.RenderType_CalloutComponent)),t.ɵdid(11,114688,null,0,v.CalloutComponent,[s.I18nService],{type:[0,"type"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵeld(13,0,null,0,2,"p",[],null,null,null,null,null)),(n()(),t.ɵted(14,null,["",""])),t.ɵppd(15,1),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵeld(17,0,null,0,31,"ul",[["class","fa-ul"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(19,0,null,null,4,"li",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(21,0,null,null,0,"i",[["class","fa fa-check text-success fa-li"]],null,null,null,null,null)),(n()(),t.ɵted(22,null,["\n ","\n "])),t.ɵppd(23,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(25,0,null,null,4,"li",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(27,0,null,null,0,"i",[["class","fa fa-check text-success fa-li"]],null,null,null,null,null)),(n()(),t.ɵted(28,null,["\n ","\n "])),t.ɵppd(29,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(31,0,null,null,4,"li",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(33,0,null,null,0,"i",[["class","fa fa-check text-success fa-li"]],null,null,null,null,null)),(n()(),t.ɵted(34,null,["\n ","\n "])),t.ɵppd(35,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(37,0,null,null,4,"li",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(39,0,null,null,0,"i",[["class","fa fa-check text-success fa-li"]],null,null,null,null,null)),(n()(),t.ɵted(40,null,["\n ","\n "])),t.ɵppd(41,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(43,0,null,null,4,"li",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(45,0,null,null,0,"i",[["class","fa fa-check text-success fa-li"]],null,null,null,null,null)),(n()(),t.ɵted(46,null,["\n ","\n "])),t.ɵppd(47,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵeld(50,0,null,0,5,"p",[["class","text-lg"]],null,null,null,null,null)),t.ɵdid(51,278528,null,0,p.NgClass,[t.IterableDiffers,t.KeyValueDiffers,t.ElementRef,t.Renderer2],{klass:[0,"klass"],ngClass:[1,"ngClass"]},null),t.ɵpod(52,{"mb-0":0}),(n()(),t.ɵted(53,null,["",""])),t.ɵppd(54,2),t.ɵppd(55,2),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵand(16777216,null,0,1,null,_)),t.ɵdid(58,16384,null,0,p.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,0,["\n"])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,null,null,1,null,I)),t.ɵdid(62,16384,null,0,p.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,null,null,1,null,A)),t.ɵdid(65,16384,null,0,p.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){var e=l.component;n(l,11,0,"success");n(l,51,0,"text-lg",n(l,52,0,!e.selfHosted)),n(l,58,0,e.selfHosted),n(l,62,0,e.selfHosted),n(l,65,0,!e.selfHosted)},function(n,l){var e=l.component;n(l,6,0,t.ɵunv(l,6,0,n(l,7,0,t.ɵnov(l,0),"goPremium"))),n(l,14,0,t.ɵunv(l,14,0,n(l,15,0,t.ɵnov(l,0),"premiumUpgradeUnlockFeatures"))),n(l,22,0,t.ɵunv(l,22,0,n(l,23,0,t.ɵnov(l,0),"premiumSignUpStorage"))),n(l,28,0,t.ɵunv(l,28,0,n(l,29,0,t.ɵnov(l,0),"premiumSignUpTwoStep"))),n(l,34,0,t.ɵunv(l,34,0,n(l,35,0,t.ɵnov(l,0),"premiumSignUpTotp"))),n(l,40,0,t.ɵunv(l,40,0,n(l,41,0,t.ɵnov(l,0),"premiumSignUpSupport"))),n(l,46,0,t.ɵunv(l,46,0,n(l,47,0,t.ɵnov(l,0),"premiumSignUpFuture"))),n(l,53,0,t.ɵunv(l,53,0,n(l,55,0,t.ɵnov(l,0),"premiumPrice",t.ɵunv(l,53,0,n(l,54,0,t.ɵnov(l,1),e.premiumPrice,"$")))))})}function O(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"app-premium",[],null,null,null,E,R)),t.ɵdid(1,114688,null,0,h.PremiumComponent,[g.ApiService,s.I18nService,m.Angulartics2,y.ToasterService,d.PlatformUtilsService,C.TokenService,b.Router,S.MessagingService,w.SyncService],null,null)],function(n,l){n(l,1,0)},null)}l.RenderType_PremiumComponent=R,l.View_PremiumComponent_0=E,l.View_PremiumComponent_Host_0=O;var N=t.ɵccf("app-premium",h.PremiumComponent,O,{},{},[]);l.PremiumComponentNgFactory=N},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)});Object.defineProperty(l,"__esModule",{value:!0});var o=function(n){function l(){return null!==n&&n.apply(this,arguments)||this}return u(l,n),l}(e(73).PasswordVerificationRequest);l.UpdateTwoFactorYubioOtpRequest=o},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)});Object.defineProperty(l,"__esModule",{value:!0});var o=function(n){function l(){return null!==n&&n.apply(this,arguments)||this}return u(l,n),l}(e(73).PasswordVerificationRequest);l.UpdateTwoFactorU2fRequest=o},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)});Object.defineProperty(l,"__esModule",{value:!0});var o=function(n){function l(){return null!==n&&n.apply(this,arguments)||this}return u(l,n),l}(e(73).PasswordVerificationRequest);l.UpdateTwoFactorEmailRequest=o},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)});Object.defineProperty(l,"__esModule",{value:!0});var o=function(n){function l(){return null!==n&&n.apply(this,arguments)||this}return u(l,n),l}(e(73).PasswordVerificationRequest);l.UpdateTwoFactorDuoRequest=o},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)});Object.defineProperty(l,"__esModule",{value:!0});var o=function(n){function l(){return null!==n&&n.apply(this,arguments)||this}return u(l,n),l}(e(73).PasswordVerificationRequest);l.TwoFactorProviderRequest=o},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)});Object.defineProperty(l,"__esModule",{value:!0});var o=function(n){function l(){return null!==n&&n.apply(this,arguments)||this}return u(l,n),l}(e(73).PasswordVerificationRequest);l.UpdateTwoFactorAuthenticatorRequest=o},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=e(0),u=e(40),o=e(37),i=e(2),r=e(60),a=e(5),s=e(7),d=e(215),c=e(4),p=e(35),f=e(27),v=t.ɵcrt({encapsulation:2,styles:[],data:{}});function h(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,2,"p",[],null,null,null,null,null)),(n()(),t.ɵted(1,null,["",""])),t.ɵppd(2,1)],null,function(n,l){n(l,1,0,t.ɵunv(l,1,0,n(l,2,0,t.ɵnov(l.parent,0),"twoStepLoginDesc")))})}function g(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,2,"p",[],null,null,null,null,null)),(n()(),t.ɵted(1,null,["",""])),t.ɵppd(2,1)],null,function(n,l){n(l,1,0,t.ɵunv(l,1,0,n(l,2,0,t.ɵnov(l.parent,0),"twoStepLoginOrganizationDesc")))})}function m(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,10,"app-callout",[["type","warning"]],null,null,null,u.View_CalloutComponent_0,u.RenderType_CalloutComponent)),t.ɵdid(1,114688,null,0,o.CalloutComponent,[i.I18nService],{type:[0,"type"]},null),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵeld(3,0,null,0,2,"p",[],null,null,null,null,null)),(n()(),t.ɵted(4,null,["",""])),t.ɵppd(5,1),(n()(),t.ɵted(-1,0,["\n "])),(n()(),t.ɵeld(7,0,null,0,2,"button",[["class","btn btn-outline-secondary"],["type","button"]],null,[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.recoveryCode()&&t);return t},null,null)),(n()(),t.ɵted(8,null,["",""])),t.ɵppd(9,1),(n()(),t.ɵted(-1,0,["\n"]))],function(n,l){n(l,1,0,"warning")},function(n,l){n(l,4,0,t.ɵunv(l,4,0,n(l,5,0,t.ɵnov(l.parent,0),"twoStepLoginRecoveryWarning"))),n(l,8,0,t.ɵunv(l,8,0,n(l,9,0,t.ɵnov(l.parent,0),"viewRecoveryCode")))})}function y(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,4,"small",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,1,"i",[["class","fa fa-spinner fa-spin fa-fw text-muted"]],[[8,"title",0]],null,null,null,null)),t.ɵppd(3,1),(n()(),t.ɵted(-1,null,["\n "]))],null,function(n,l){n(l,2,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,2,0,n(l,3,0,t.ɵnov(l.parent,0),"loading")),""))})}function C(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"i",[["class","fa fa-check text-success fa-fw"]],[[8,"title",0]],null,null,null,null)),t.ɵppd(1,1)],null,function(n,l){n(l,0,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,0,0,n(l,1,0,t.ɵnov(l.parent.parent,0),"enabled")),""))})}function b(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,3,"a",[["appStopClick",""],["class","badge badge-primary"],["href","#"]],null,[[null,"click"]],function(n,l,e){var u=!0,o=n.component;"click"===l&&(u=!1!==t.ɵnov(n,1).onClick(e)&&u);"click"===l&&(u=!1!==o.premiumRequired()&&u);return u},null,null)),t.ɵdid(1,16384,null,0,r.StopClickDirective,[],null,null),(n()(),t.ɵted(2,null,["\n ","\n "])),t.ɵppd(3,1)],null,function(n,l){n(l,2,0,t.ɵunv(l,2,0,n(l,3,0,t.ɵnov(l.parent.parent,0),"premium")))})}function S(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,25,"li",[["class","list-group-item d-flex align-items-center"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,3,"div",[["class","logo-2fa d-flex justify-content-center"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(4,0,null,null,0,"img",[["alt",""]],[[8,"src",4]],null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(7,0,null,null,10,"div",[["class","mx-4"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(9,0,null,null,7,"h3",[["class","mb-0"]],null,null,null,null,null)),(n()(),t.ɵted(10,null,["\n ","\n "])),(n()(),t.ɵand(16777216,null,null,1,null,C)),t.ɵdid(12,16384,null,0,a.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,b)),t.ɵdid(15,16384,null,0,a.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(17,null,["\n ","\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(19,0,null,null,5,"div",[["class","ml-auto"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(21,0,null,null,2,"button",[["class","btn btn-outline-secondary btn-sm"],["type","button"]],[[8,"disabled",0]],[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.manage(n.context.$implicit.type)&&t);return t},null,null)),(n()(),t.ɵted(22,null,["\n ","\n "])),t.ɵppd(23,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){var e=l.component;n(l,12,0,l.context.$implicit.enabled),n(l,15,0,!e.premium&&l.context.$implicit.premium)},function(n,l){var e=l.component;n(l,4,0,"images/two-factor/"+l.context.$implicit.type+".png"),n(l,10,0,l.context.$implicit.name),n(l,17,0,l.context.$implicit.description),n(l,21,0,!e.premium&&l.context.$implicit.premium),n(l,22,0,t.ɵunv(l,22,0,n(l,23,0,t.ɵnov(l.parent,0),"manage")))})}function w(n){return t.ɵvid(0,[(n()(),t.ɵand(0,null,null,0))],null,null)}function R(n){return t.ɵvid(0,[(n()(),t.ɵand(0,null,null,0))],null,null)}function _(n){return t.ɵvid(0,[(n()(),t.ɵand(0,null,null,0))],null,null)}function I(n){return t.ɵvid(0,[(n()(),t.ɵand(0,null,null,0))],null,null)}function A(n){return t.ɵvid(0,[(n()(),t.ɵand(0,null,null,0))],null,null)}function E(n){return t.ɵvid(0,[(n()(),t.ɵand(0,null,null,0))],null,null)}function O(n){return t.ɵvid(0,[t.ɵpid(0,s.I18nPipe,[i.I18nService]),t.ɵqud(402653184,1,{recoveryModalRef:0}),t.ɵqud(402653184,2,{authenticatorModalRef:0}),t.ɵqud(402653184,3,{yubikeyModalRef:0}),t.ɵqud(402653184,4,{u2fModalRef:0}),t.ɵqud(402653184,5,{duoModalRef:0}),t.ɵqud(402653184,6,{emailModalRef:0}),(n()(),t.ɵeld(7,0,null,null,5,"div",[["class","page-header"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(9,0,null,null,2,"h1",[],null,null,null,null,null)),(n()(),t.ɵted(10,null,["",""])),t.ɵppd(11,1),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,null,null,1,null,h)),t.ɵdid(15,16384,null,0,a.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,null,null,1,null,g)),t.ɵdid(18,16384,null,0,a.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,null,null,1,null,m)),t.ɵdid(21,16384,null,0,a.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵeld(23,0,null,null,7,"h2",[],null,null,null,null,null)),t.ɵdid(24,278528,null,0,a.NgClass,[t.IterableDiffers,t.KeyValueDiffers,t.ElementRef,t.Renderer2],{ngClass:[0,"ngClass"]},null),t.ɵpod(25,{"mt-5":0}),(n()(),t.ɵted(26,null,["\n ","\n "])),t.ɵppd(27,1),(n()(),t.ɵand(16777216,null,null,1,null,y)),t.ɵdid(29,16384,null,0,a.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵeld(32,0,null,null,4,"ul",[["class","list-group list-group-2fa"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,S)),t.ɵdid(35,802816,null,0,a.NgForOf,[t.ViewContainerRef,t.TemplateRef,t.IterableDiffers],{ngForOf:[0,"ngForOf"]},null),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n\n"])),(n()(),t.ɵand(16777216,[[2,3],["authenticatorTemplate",2]],null,0,null,w)),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,[[1,3],["recoveryTemplate",2]],null,0,null,R)),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,[[5,3],["duoTemplate",2]],null,0,null,_)),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,[[6,3],["emailTemplate",2]],null,0,null,I)),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,[[3,3],["yubikeyTemplate",2]],null,0,null,A)),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,[[4,3],["u2fTemplate",2]],null,0,null,E)),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){var e=l.component;n(l,15,0,!e.organizationId),n(l,18,0,e.organizationId),n(l,21,0,!e.organizationId),n(l,24,0,n(l,25,0,!e.organizationId)),n(l,29,0,e.loading),n(l,35,0,e.providers)},function(n,l){n(l,10,0,t.ɵunv(l,10,0,n(l,11,0,t.ɵnov(l,0),"twoStepLogin"))),n(l,26,0,t.ɵunv(l,26,0,n(l,27,0,t.ɵnov(l,0),"providers")))})}function N(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"app-two-factor-setup",[],null,null,null,O,v)),t.ɵdid(1,114688,null,0,d.TwoFactorSetupComponent,[c.ApiService,p.TokenService,t.ComponentFactoryResolver,f.MessagingService],null,null)],function(n,l){n(l,1,0)},null)}l.RenderType_TwoFactorSetupComponent=v,l.View_TwoFactorSetupComponent_0=O,l.View_TwoFactorSetupComponent_Host_0=N;var T=t.ɵccf("app-two-factor-setup",d.TwoFactorSetupComponent,N,{},{},[]);l.TwoFactorSetupComponentNgFactory=T},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(){}}();l.UpdateDomainsRequest=t},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=e(0),u=e(13),o=e(5),i=e(60),r=e(7),a=e(2),s=e(18),d=e(17),c=e(271),p=e(4),f=e(3),v=e(9),h=t.ɵcrt({encapsulation:2,styles:[],data:{}});function g(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,4,"p",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,1,"i",[["class","fa fa-spinner fa-spin text-muted"]],[[8,"title",0]],null,null,null,null)),t.ɵppd(3,1),(n()(),t.ɵted(-1,null,["\n "]))],null,function(n,l){n(l,2,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,2,0,n(l,3,0,t.ɵnov(l.parent,0),"loading")),""))})}function m(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,24,"div",[["class","form-group d-flex"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,15,"div",[["class","flex-fill"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(4,0,null,null,2,"label",[["class","sr-only"]],[[8,"htmlFor",0]],null,null,null,null)),(n()(),t.ɵted(5,null,["",""])),t.ɵppd(6,2),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(8,0,null,null,8,"textarea",[["class","form-control"],["required",""]],[[8,"id",0],[8,"placeholder",0],[1,"required",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(n,l,e){var u=!0,o=n.component;"input"===l&&(u=!1!==t.ɵnov(n,9)._handleInput(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,9).onTouched()&&u);"compositionstart"===l&&(u=!1!==t.ɵnov(n,9)._compositionStart()&&u);"compositionend"===l&&(u=!1!==t.ɵnov(n,9)._compositionEnd(e.target.value)&&u);"ngModelChange"===l&&(u=!1!==(o.custom[n.context.index]=e)&&u);return u},null,null)),t.ɵdid(9,16384,null,0,u.DefaultValueAccessor,[t.Renderer2,t.ElementRef,[2,u.COMPOSITION_BUFFER_MODE]],null,null),t.ɵdid(10,16384,null,0,u.RequiredValidator,[],{required:[0,"required"]},null),t.ɵprd(1024,null,u.NG_VALIDATORS,function(n){return[n]},[u.RequiredValidator]),t.ɵprd(1024,null,u.NG_VALUE_ACCESSOR,function(n){return[n]},[u.DefaultValueAccessor]),t.ɵdid(13,671744,null,0,u.NgModel,[[2,u.ControlContainer],[2,u.NG_VALIDATORS],[8,null],[2,u.NG_VALUE_ACCESSOR]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,u.NgControl,null,[u.NgModel]),t.ɵdid(15,16384,null,0,u.NgControlStatus,[u.NgControl],null,null),t.ɵppd(16,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(19,0,null,null,4,"button",[["class","btn btn-link text-danger ml-2"],["type","button"]],[[8,"title",0]],[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.remove(n.context.index)&&t);return t},null,null)),t.ɵppd(20,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(22,0,null,null,0,"i",[["class","fa fa-minus-circle fa-lg"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){var e=l.component;n(l,10,0,""),n(l,13,0,t.ɵinlineInterpolate(1,"CustomDomain[",l.context.index,"]"),e.custom[l.context.index])},function(n,l){n(l,4,0,t.ɵinlineInterpolate(1,"customDomain_",l.context.index,"")),n(l,5,0,t.ɵunv(l,5,0,n(l,6,0,t.ɵnov(l.parent.parent,0),"customDomainX",l.context.index+1))),n(l,8,0,t.ɵinlineInterpolate(1,"customDomain_",l.context.index,""),t.ɵinlineInterpolate(1,"",t.ɵunv(l,8,1,n(l,16,0,t.ɵnov(l.parent.parent,0),"ex"))," google.com, gmail.com"),t.ɵnov(l,10).required?"":null,t.ɵnov(l,15).ngClassUntouched,t.ɵnov(l,15).ngClassTouched,t.ɵnov(l,15).ngClassPristine,t.ɵnov(l,15).ngClassDirty,t.ɵnov(l,15).ngClassValid,t.ɵnov(l,15).ngClassInvalid,t.ɵnov(l,15).ngClassPending),n(l,19,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,19,0,n(l,20,0,t.ɵnov(l.parent.parent,0),"remove")),""))})}function y(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,14,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,m)),t.ɵdid(3,802816,null,0,o.NgForOf,[t.ViewContainerRef,t.TemplateRef,t.IterableDiffers],{ngForOf:[0,"ngForOf"],ngForTrackBy:[1,"ngForTrackBy"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(5,0,null,null,4,"button",[["class","btn btn-outline-secondary btn-sm mb-2"],["type","button"]],null,[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.add()&&t);return t},null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(7,0,null,null,0,"i",[["class","fa fa-plus fa-fw"]],null,null,null,null,null)),(n()(),t.ɵted(8,null,[" ","\n "])),t.ɵppd(9,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(11,0,null,null,2,"small",[["class","text-muted d-block mb-3"]],null,null,null,null,null)),(n()(),t.ɵted(12,null,["",""])),t.ɵppd(13,1),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){var e=l.component;n(l,3,0,e.custom,e.indexTrackBy)},function(n,l){n(l,8,0,t.ɵunv(l,8,0,n(l,9,0,t.ɵnov(l.parent,0),"newCustomDomain"))),n(l,12,0,t.ɵunv(l,12,0,n(l,13,0,t.ɵnov(l.parent,0),"newCustomDomainDesc")))})}function C(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,4,"p",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,1,"i",[["class","fa fa-spinner fa-spin text-muted"]],[[8,"title",0]],null,null,null,null)),t.ɵppd(3,1),(n()(),t.ɵted(-1,null,["\n "]))],null,function(n,l){n(l,2,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,2,0,n(l,3,0,t.ɵnov(l.parent,0),"loading")),""))})}function b(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,5,"a",[["appStopClick",""],["class","dropdown-item"],["href","#"]],null,[[null,"click"]],function(n,l,e){var u=!0,o=n.component;"click"===l&&(u=!1!==t.ɵnov(n,1).onClick(e)&&u);"click"===l&&(u=!1!==o.toggleExcluded(n.parent.context.$implicit)&&u);return u},null,null)),t.ɵdid(1,16384,null,0,i.StopClickDirective,[],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(3,0,null,null,0,"i",[["class","fa fa-fw fa-close"]],null,null,null,null,null)),(n()(),t.ɵted(4,null,["\n ","\n "])),t.ɵppd(5,1)],null,function(n,l){n(l,4,0,t.ɵunv(l,4,0,n(l,5,0,t.ɵnov(l.parent.parent.parent,0),"exclude")))})}function S(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,5,"a",[["appStopClick",""],["class","dropdown-item"],["href","#"]],null,[[null,"click"]],function(n,l,e){var u=!0,o=n.component;"click"===l&&(u=!1!==t.ɵnov(n,1).onClick(e)&&u);"click"===l&&(u=!1!==o.toggleExcluded(n.parent.context.$implicit)&&u);return u},null,null)),t.ɵdid(1,16384,null,0,i.StopClickDirective,[],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(3,0,null,null,0,"i",[["class","fa fa-fw fa-plus"]],null,null,null,null,null)),(n()(),t.ɵted(4,null,["\n ","\n "])),t.ɵppd(5,1)],null,function(n,l){n(l,4,0,t.ɵunv(l,4,0,n(l,5,0,t.ɵnov(l.parent.parent.parent,0),"include")))})}function w(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,33,"tr",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,3,"td",[],null,null,null,null,null)),t.ɵdid(3,278528,null,0,o.NgClass,[t.IterableDiffers,t.KeyValueDiffers,t.ElementRef,t.Renderer2],{ngClass:[0,"ngClass"]},null),t.ɵpod(4,{"table-list-strike":0}),(n()(),t.ɵted(5,null,["",""])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(7,0,null,null,25,"td",[["class","table-list-options"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(9,0,null,null,22,"div",[["appListDropdown",""],["class","dropdown"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(11,0,null,null,3,"button",[["aria-expanded","false"],["aria-haspopup","true"],["class","btn btn-outline-secondary dropdown-toggle"],["data-toggle","dropdown"],["type","button"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(13,0,null,null,0,"i",[["class","fa fa-cog fa-lg"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(16,0,null,null,14,"div",[["class","dropdown-menu dropdown-menu-right"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,b)),t.ɵdid(19,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,S)),t.ɵdid(22,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(24,0,null,null,5,"a",[["appStopClick",""],["class","dropdown-item"],["href","#"]],null,[[null,"click"]],function(n,l,e){var u=!0,o=n.component;"click"===l&&(u=!1!==t.ɵnov(n,25).onClick(e)&&u);"click"===l&&(u=!1!==o.customize(n.context.$implicit)&&u);return u},null,null)),t.ɵdid(25,16384,null,0,i.StopClickDirective,[],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(27,0,null,null,0,"i",[["class","fa fa-fw fa-scissors"]],null,null,null,null,null)),(n()(),t.ɵted(28,null,["\n ","\n "])),t.ɵppd(29,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){n(l,3,0,n(l,4,0,l.context.$implicit.excluded)),n(l,19,0,!l.context.$implicit.excluded),n(l,22,0,l.context.$implicit.excluded)},function(n,l){n(l,5,0,l.context.$implicit.domains),n(l,28,0,t.ɵunv(l,28,0,n(l,29,0,t.ɵnov(l.parent.parent,0),"customize")))})}function R(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,7,"table",[["class","table table-hover table-list"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,4,"tbody",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,w)),t.ɵdid(5,802816,null,0,o.NgForOf,[t.ViewContainerRef,t.TemplateRef,t.IterableDiffers],{ngForOf:[0,"ngForOf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){n(l,5,0,l.component.global)},null)}function _(n){return t.ɵvid(0,[t.ɵpid(0,r.I18nPipe,[a.I18nService]),(n()(),t.ɵeld(1,0,null,null,5,"div",[["class","page-header"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(3,0,null,null,2,"h1",[],null,null,null,null,null)),(n()(),t.ɵted(4,null,["",""])),t.ɵppd(5,1),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵeld(8,0,null,null,2,"p",[],null,null,null,null,null)),(n()(),t.ɵted(9,null,["",""])),t.ɵppd(10,1),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵeld(12,0,[["form",1]],null,45,"form",[["ngNativeValidate",""]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngSubmit"],[null,"submit"],[null,"reset"]],function(n,l,e){var u=!0,o=n.component;"submit"===l&&(u=!1!==t.ɵnov(n,13).onSubmit(e)&&u);"reset"===l&&(u=!1!==t.ɵnov(n,13).onReset()&&u);"ngSubmit"===l&&(u=!1!==o.submit()&&u);return u},null,null)),t.ɵdid(13,4210688,null,0,u.NgForm,[[8,null],[8,null]],null,{ngSubmit:"ngSubmit"}),t.ɵprd(2048,null,u.ControlContainer,null,[u.NgForm]),t.ɵdid(15,16384,null,0,u.NgControlStatusGroup,[u.ControlContainer],null,null),t.ɵdid(16,540672,null,0,s.ApiActionDirective,[t.ElementRef,d.ValidationService],{appApiAction:[0,"appApiAction"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(18,0,null,null,2,"h2",[],null,null,null,null,null)),(n()(),t.ɵted(19,null,["",""])),t.ɵppd(20,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,g)),t.ɵdid(23,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,y)),t.ɵdid(26,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(28,0,null,null,8,"button",[["class","btn btn-primary btn-submit"],["type","submit"]],[[8,"disabled",0]],null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(30,0,null,null,1,"i",[["class","fa fa-spinner fa-spin"]],[[8,"title",0]],null,null,null,null)),t.ɵppd(31,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(33,0,null,null,2,"span",[],null,null,null,null,null)),(n()(),t.ɵted(34,null,["",""])),t.ɵppd(35,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(38,0,null,null,2,"h2",[["class","spaced-header"]],null,null,null,null,null)),(n()(),t.ɵted(39,null,["",""])),t.ɵppd(40,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,C)),t.ɵdid(43,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,R)),t.ɵdid(46,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(48,0,null,null,8,"button",[["class","btn btn-primary btn-submit"],["type","submit"]],[[8,"disabled",0]],null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(50,0,null,null,1,"i",[["class","fa fa-spinner fa-spin"]],[[8,"title",0]],null,null,null,null)),t.ɵppd(51,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(53,0,null,null,2,"span",[],null,null,null,null,null)),(n()(),t.ɵted(54,null,["",""])),t.ɵppd(55,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){var e=l.component;n(l,16,0,e.formPromise),n(l,23,0,e.loading),n(l,26,0,!e.loading),n(l,43,0,e.loading),n(l,46,0,!e.loading&&e.global.length>0)},function(n,l){n(l,4,0,t.ɵunv(l,4,0,n(l,5,0,t.ɵnov(l,0),"domainRules"))),n(l,9,0,t.ɵunv(l,9,0,n(l,10,0,t.ɵnov(l,0),"domainRulesDesc"))),n(l,12,0,t.ɵnov(l,15).ngClassUntouched,t.ɵnov(l,15).ngClassTouched,t.ɵnov(l,15).ngClassPristine,t.ɵnov(l,15).ngClassDirty,t.ɵnov(l,15).ngClassValid,t.ɵnov(l,15).ngClassInvalid,t.ɵnov(l,15).ngClassPending),n(l,19,0,t.ɵunv(l,19,0,n(l,20,0,t.ɵnov(l,0),"customEqDomains"))),n(l,28,0,t.ɵnov(l,12).loading),n(l,30,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,30,0,n(l,31,0,t.ɵnov(l,0),"loading")),"")),n(l,34,0,t.ɵunv(l,34,0,n(l,35,0,t.ɵnov(l,0),"save"))),n(l,39,0,t.ɵunv(l,39,0,n(l,40,0,t.ɵnov(l,0),"globalEqDomains"))),n(l,48,0,t.ɵnov(l,12).loading),n(l,50,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,50,0,n(l,51,0,t.ɵnov(l,0),"loading")),"")),n(l,54,0,t.ɵunv(l,54,0,n(l,55,0,t.ɵnov(l,0),"save")))})}function I(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"app-domain-rules",[],null,null,null,_,h)),t.ɵdid(1,114688,null,0,c.DomainRulesComponent,[p.ApiService,a.I18nService,f.Angulartics2,v.ToasterService],null,null)],function(n,l){n(l,1,0)},null)}l.RenderType_DomainRulesComponent=h,l.View_DomainRulesComponent_0=_,l.View_DomainRulesComponent_Host_0=I;var A=t.ɵccf("app-domain-rules",c.DomainRulesComponent,I,{},{},[]);l.DomainRulesComponentNgFactory=A},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=e(0),u=e(13),o=e(7),i=e(2),r=e(5),a=e(272),s=e(117),d=e(61),c=e(3),p=e(9),f=t.ɵcrt({encapsulation:2,styles:[],data:{}});function v(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,3,"option",[],null,null,null,null,null)),t.ɵdid(1,147456,null,0,u.NgSelectOption,[t.ElementRef,t.Renderer2,[2,u.SelectControlValueAccessor]],{ngValue:[0,"ngValue"]},null),t.ɵdid(2,147456,null,0,u.ɵq,[t.ElementRef,t.Renderer2,[8,null]],{ngValue:[0,"ngValue"]},null),(n()(),t.ɵted(3,null,["",""]))],function(n,l){n(l,1,0,l.context.$implicit.value),n(l,2,0,l.context.$implicit.value)},function(n,l){n(l,3,0,l.context.$implicit.name)})}function h(n){return t.ɵvid(0,[t.ɵpid(0,o.I18nPipe,[i.I18nService]),(n()(),t.ɵeld(1,0,null,null,5,"div",[["class","page-header"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(3,0,null,null,2,"h1",[],null,null,null,null,null)),(n()(),t.ɵted(4,null,["",""])),t.ɵppd(5,1),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵeld(8,0,null,null,2,"p",[],null,null,null,null,null)),(n()(),t.ɵted(9,null,["",""])),t.ɵppd(10,1),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵeld(12,0,null,null,72,"form",[["ngNativeValidate",""]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngSubmit"],[null,"submit"],[null,"reset"]],function(n,l,e){var u=!0,o=n.component;"submit"===l&&(u=!1!==t.ɵnov(n,13).onSubmit(e)&&u);"reset"===l&&(u=!1!==t.ɵnov(n,13).onReset()&&u);"ngSubmit"===l&&(u=!1!==o.submit()&&u);return u},null,null)),t.ɵdid(13,4210688,null,0,u.NgForm,[[8,null],[8,null]],null,{ngSubmit:"ngSubmit"}),t.ɵprd(2048,null,u.ControlContainer,null,[u.NgForm]),t.ɵdid(15,16384,null,0,u.NgControlStatusGroup,[u.ControlContainer],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(17,0,null,null,35,"div",[["class","row"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(19,0,null,null,32,"div",[["class","col-6"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(21,0,null,null,29,"div",[["class","form-group"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(23,0,null,null,11,"div",[["class","d-flex"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(25,0,null,null,2,"label",[["for","locale"]],null,null,null,null,null)),(n()(),t.ɵted(26,null,["",""])),t.ɵppd(27,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(29,0,null,null,4,"a",[["class","ml-auto"],["href","https://help.bitwarden.com/article/localization/"],["rel","noopener"],["target","_blank"]],[[8,"title",0]],null,null,null,null)),t.ɵppd(30,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(32,0,null,null,0,"i",[["class","fa fa-question-circle-o"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(36,0,null,null,9,"select",[["class","form-control"],["id","locale"],["name","Locale"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"change"],[null,"blur"]],function(n,l,e){var u=!0,o=n.component;"change"===l&&(u=!1!==t.ɵnov(n,37).onChange(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,37).onTouched()&&u);"ngModelChange"===l&&(u=!1!==(o.locale=e)&&u);return u},null,null)),t.ɵdid(37,16384,null,0,u.SelectControlValueAccessor,[t.Renderer2,t.ElementRef],null,null),t.ɵprd(1024,null,u.NG_VALUE_ACCESSOR,function(n){return[n]},[u.SelectControlValueAccessor]),t.ɵdid(39,671744,null,0,u.NgModel,[[2,u.ControlContainer],[8,null],[8,null],[2,u.NG_VALUE_ACCESSOR]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,u.NgControl,null,[u.NgModel]),t.ɵdid(41,16384,null,0,u.NgControlStatus,[u.NgControl],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,v)),t.ɵdid(44,802816,null,0,r.NgForOf,[t.ViewContainerRef,t.TemplateRef,t.IterableDiffers],{ngForOf:[0,"ngForOf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(47,0,null,null,2,"small",[["class","form-text text-muted"]],null,null,null,null,null)),(n()(),t.ɵted(48,null,["",""])),t.ɵppd(49,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(54,0,null,null,25,"div",[["class","form-group"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(56,0,null,null,18,"div",[["class","form-check"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(58,0,null,null,5,"input",[["class","form-check-input"],["id","disableIcons"],["name","DisableIcons"],["type","checkbox"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"change"],[null,"blur"]],function(n,l,e){var u=!0,o=n.component;"change"===l&&(u=!1!==t.ɵnov(n,59).onChange(e.target.checked)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,59).onTouched()&&u);"ngModelChange"===l&&(u=!1!==(o.disableIcons=e)&&u);return u},null,null)),t.ɵdid(59,16384,null,0,u.CheckboxControlValueAccessor,[t.Renderer2,t.ElementRef],null,null),t.ɵprd(1024,null,u.NG_VALUE_ACCESSOR,function(n){return[n]},[u.CheckboxControlValueAccessor]),t.ɵdid(61,671744,null,0,u.NgModel,[[2,u.ControlContainer],[8,null],[8,null],[2,u.NG_VALUE_ACCESSOR]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,u.NgControl,null,[u.NgModel]),t.ɵdid(63,16384,null,0,u.NgControlStatus,[u.NgControl],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(65,0,null,null,2,"label",[["class","form-check-label"],["for","disableIcons"]],null,null,null,null,null)),(n()(),t.ɵted(66,null,["\n ","\n "])),t.ɵppd(67,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(69,0,null,null,4,"a",[["href","https://help.bitwarden.com/article/website-icons/"],["rel","noopener"],["target","_blank"]],[[8,"title",0]],null,null,null,null)),t.ɵppd(70,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(72,0,null,null,0,"i",[["class","fa fa-question-circle-o"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(76,0,null,null,2,"small",[["class","form-text text-muted"]],null,null,null,null,null)),(n()(),t.ɵted(77,null,["",""])),t.ɵppd(78,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(81,0,null,null,2,"button",[["class","btn btn-primary"],["type","submit"]],null,null,null,null,null)),(n()(),t.ɵted(82,null,["\n ","\n "])),t.ɵppd(83,1),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){var e=l.component;n(l,39,0,"Locale",e.locale),n(l,44,0,e.localeOptions);n(l,61,0,"DisableIcons",e.disableIcons)},function(n,l){n(l,4,0,t.ɵunv(l,4,0,n(l,5,0,t.ɵnov(l,0),"options"))),n(l,9,0,t.ɵunv(l,9,0,n(l,10,0,t.ɵnov(l,0),"optionsDesc"))),n(l,12,0,t.ɵnov(l,15).ngClassUntouched,t.ɵnov(l,15).ngClassTouched,t.ɵnov(l,15).ngClassPristine,t.ɵnov(l,15).ngClassDirty,t.ɵnov(l,15).ngClassValid,t.ɵnov(l,15).ngClassInvalid,t.ɵnov(l,15).ngClassPending),n(l,26,0,t.ɵunv(l,26,0,n(l,27,0,t.ɵnov(l,0),"language"))),n(l,29,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,29,0,n(l,30,0,t.ɵnov(l,0),"learnMore")),"")),n(l,36,0,t.ɵnov(l,41).ngClassUntouched,t.ɵnov(l,41).ngClassTouched,t.ɵnov(l,41).ngClassPristine,t.ɵnov(l,41).ngClassDirty,t.ɵnov(l,41).ngClassValid,t.ɵnov(l,41).ngClassInvalid,t.ɵnov(l,41).ngClassPending),n(l,48,0,t.ɵunv(l,48,0,n(l,49,0,t.ɵnov(l,0),"languageDesc"))),n(l,58,0,t.ɵnov(l,63).ngClassUntouched,t.ɵnov(l,63).ngClassTouched,t.ɵnov(l,63).ngClassPristine,t.ɵnov(l,63).ngClassDirty,t.ɵnov(l,63).ngClassValid,t.ɵnov(l,63).ngClassInvalid,t.ɵnov(l,63).ngClassPending),n(l,66,0,t.ɵunv(l,66,0,n(l,67,0,t.ɵnov(l,0),"disableIcons"))),n(l,69,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,69,0,n(l,70,0,t.ɵnov(l,0),"learnMore")),"")),n(l,77,0,t.ɵunv(l,77,0,n(l,78,0,t.ɵnov(l,0),"disableIconsDesc"))),n(l,82,0,t.ɵunv(l,82,0,n(l,83,0,t.ɵnov(l,0),"save")))})}function g(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"app-options",[],null,null,null,h,f)),t.ɵdid(1,114688,null,0,a.OptionsComponent,[s.StorageService,d.StateService,c.Angulartics2,i.I18nService,p.ToasterService],null,null)],function(n,l){n(l,1,0)},null)}l.RenderType_OptionsComponent=f,l.View_OptionsComponent_0=h,l.View_OptionsComponent_Host_0=g;var m=t.ɵccf("app-options",a.OptionsComponent,g,{},{},[]);l.OptionsComponentNgFactory=m},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)});Object.defineProperty(l,"__esModule",{value:!0});var o=function(n){function l(){return null!==n&&n.apply(this,arguments)||this}return u(l,n),l}(e(73).PasswordVerificationRequest);l.PasswordRequest=o},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=e(0),u=e(7),o=e(2),i=e(40),r=e(37),a=e(13),s=e(18),d=e(17),c=e(46),p=e(553),f=e(4),v=e(3),h=e(9),g=e(20),m=e(27),y=e(21),C=t.ɵcrt({encapsulation:2,styles:[],data:{}});function b(n){return t.ɵvid(0,[t.ɵpid(0,u.I18nPipe,[o.I18nService]),(n()(),t.ɵeld(1,0,null,null,3,"app-callout",[["type","warning"]],null,null,null,i.View_CalloutComponent_0,i.RenderType_CalloutComponent)),t.ɵdid(2,114688,null,0,r.CalloutComponent,[o.I18nService],{type:[0,"type"]},null),(n()(),t.ɵted(3,0,["",""])),t.ɵppd(4,1),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵeld(6,0,[["form",1]],null,72,"form",[["ngNativeValidate",""]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngSubmit"],[null,"submit"],[null,"reset"]],function(n,l,e){var u=!0,o=n.component;"submit"===l&&(u=!1!==t.ɵnov(n,7).onSubmit(e)&&u);"reset"===l&&(u=!1!==t.ɵnov(n,7).onReset()&&u);"ngSubmit"===l&&(u=!1!==o.submit()&&u);return u},null,null)),t.ɵdid(7,4210688,null,0,a.NgForm,[[8,null],[8,null]],null,{ngSubmit:"ngSubmit"}),t.ɵprd(2048,null,a.ControlContainer,null,[a.NgForm]),t.ɵdid(9,16384,null,0,a.NgControlStatusGroup,[a.ControlContainer],null,null),t.ɵdid(10,540672,null,0,s.ApiActionDirective,[t.ElementRef,d.ValidationService],{appApiAction:[0,"appApiAction"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(12,0,null,null,55,"div",[["class","row"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(14,0,null,null,52,"div",[["class","col-6"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(16,0,null,null,15,"div",[["class","form-group"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(18,0,null,null,2,"label",[["for","currentMasterPassword"]],null,null,null,null,null)),(n()(),t.ɵted(19,null,["",""])),t.ɵppd(20,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(22,0,null,null,8,"input",[["appInputVerbatim",""],["class","form-control"],["id","currentMasterPassword"],["name","MasterPasswordHash"],["required",""],["type","password"]],[[1,"required",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(n,l,e){var u=!0,o=n.component;"input"===l&&(u=!1!==t.ɵnov(n,23)._handleInput(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,23).onTouched()&&u);"compositionstart"===l&&(u=!1!==t.ɵnov(n,23)._compositionStart()&&u);"compositionend"===l&&(u=!1!==t.ɵnov(n,23)._compositionEnd(e.target.value)&&u);"ngModelChange"===l&&(u=!1!==(o.currentMasterPassword=e)&&u);return u},null,null)),t.ɵdid(23,16384,null,0,a.DefaultValueAccessor,[t.Renderer2,t.ElementRef,[2,a.COMPOSITION_BUFFER_MODE]],null,null),t.ɵdid(24,16384,null,0,a.RequiredValidator,[],{required:[0,"required"]},null),t.ɵprd(1024,null,a.NG_VALIDATORS,function(n){return[n]},[a.RequiredValidator]),t.ɵprd(1024,null,a.NG_VALUE_ACCESSOR,function(n){return[n]},[a.DefaultValueAccessor]),t.ɵdid(27,671744,null,0,a.NgModel,[[2,a.ControlContainer],[2,a.NG_VALIDATORS],[8,null],[2,a.NG_VALUE_ACCESSOR]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,a.NgControl,null,[a.NgModel]),t.ɵdid(29,16384,null,0,a.NgControlStatus,[a.NgControl],null,null),t.ɵdid(30,81920,null,0,c.InputVerbatimDirective,[t.ElementRef,t.Renderer2],{appInputVerbatim:[0,"appInputVerbatim"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(33,0,null,null,15,"div",[["class","form-group"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(35,0,null,null,2,"label",[["for","newMasterPassword"]],null,null,null,null,null)),(n()(),t.ɵted(36,null,["",""])),t.ɵppd(37,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(39,0,null,null,8,"input",[["appInputVerbatim",""],["class","form-control"],["id","newMasterPassword"],["name","NewMasterPasswordHash"],["required",""],["type","password"]],[[1,"required",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(n,l,e){var u=!0,o=n.component;"input"===l&&(u=!1!==t.ɵnov(n,40)._handleInput(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,40).onTouched()&&u);"compositionstart"===l&&(u=!1!==t.ɵnov(n,40)._compositionStart()&&u);"compositionend"===l&&(u=!1!==t.ɵnov(n,40)._compositionEnd(e.target.value)&&u);"ngModelChange"===l&&(u=!1!==(o.newMasterPassword=e)&&u);return u},null,null)),t.ɵdid(40,16384,null,0,a.DefaultValueAccessor,[t.Renderer2,t.ElementRef,[2,a.COMPOSITION_BUFFER_MODE]],null,null),t.ɵdid(41,16384,null,0,a.RequiredValidator,[],{required:[0,"required"]},null),t.ɵprd(1024,null,a.NG_VALIDATORS,function(n){return[n]},[a.RequiredValidator]),t.ɵprd(1024,null,a.NG_VALUE_ACCESSOR,function(n){return[n]},[a.DefaultValueAccessor]),t.ɵdid(44,671744,null,0,a.NgModel,[[2,a.ControlContainer],[2,a.NG_VALIDATORS],[8,null],[2,a.NG_VALUE_ACCESSOR]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,a.NgControl,null,[a.NgModel]),t.ɵdid(46,16384,null,0,a.NgControlStatus,[a.NgControl],null,null),t.ɵdid(47,81920,null,0,c.InputVerbatimDirective,[t.ElementRef,t.Renderer2],{appInputVerbatim:[0,"appInputVerbatim"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(50,0,null,null,15,"div",[["class","form-group"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(52,0,null,null,2,"label",[["for","confirmNewMasterPassword"]],null,null,null,null,null)),(n()(),t.ɵted(53,null,["",""])),t.ɵppd(54,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(56,0,null,null,8,"input",[["appInputVerbatim",""],["class","form-control"],["id","confirmNewMasterPassword"],["name","ConfirmNewMasterPasswordHash"],["required",""],["type","password"]],[[1,"required",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(n,l,e){var u=!0,o=n.component;"input"===l&&(u=!1!==t.ɵnov(n,57)._handleInput(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,57).onTouched()&&u);"compositionstart"===l&&(u=!1!==t.ɵnov(n,57)._compositionStart()&&u);"compositionend"===l&&(u=!1!==t.ɵnov(n,57)._compositionEnd(e.target.value)&&u);"ngModelChange"===l&&(u=!1!==(o.confirmNewMasterPassword=e)&&u);return u},null,null)),t.ɵdid(57,16384,null,0,a.DefaultValueAccessor,[t.Renderer2,t.ElementRef,[2,a.COMPOSITION_BUFFER_MODE]],null,null),t.ɵdid(58,16384,null,0,a.RequiredValidator,[],{required:[0,"required"]},null),t.ɵprd(1024,null,a.NG_VALIDATORS,function(n){return[n]},[a.RequiredValidator]),t.ɵprd(1024,null,a.NG_VALUE_ACCESSOR,function(n){return[n]},[a.DefaultValueAccessor]),t.ɵdid(61,671744,null,0,a.NgModel,[[2,a.ControlContainer],[2,a.NG_VALIDATORS],[8,null],[2,a.NG_VALUE_ACCESSOR]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,a.NgControl,null,[a.NgModel]),t.ɵdid(63,16384,null,0,a.NgControlStatus,[a.NgControl],null,null),t.ɵdid(64,81920,null,0,c.InputVerbatimDirective,[t.ElementRef,t.Renderer2],{appInputVerbatim:[0,"appInputVerbatim"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(69,0,null,null,8,"button",[["class","btn btn-primary btn-submit"],["type","submit"]],[[8,"disabled",0]],null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(71,0,null,null,1,"i",[["class","fa fa-spinner fa-spin"]],[[8,"title",0]],null,null,null,null)),t.ɵppd(72,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(74,0,null,null,2,"span",[],null,null,null,null,null)),(n()(),t.ɵted(75,null,["",""])),t.ɵppd(76,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){var e=l.component;n(l,2,0,"warning"),n(l,10,0,e.formPromise);n(l,24,0,"");n(l,27,0,"MasterPasswordHash",e.currentMasterPassword);n(l,30,0,"");n(l,41,0,"");n(l,44,0,"NewMasterPasswordHash",e.newMasterPassword);n(l,47,0,"");n(l,58,0,"");n(l,61,0,"ConfirmNewMasterPasswordHash",e.confirmNewMasterPassword);n(l,64,0,"")},function(n,l){n(l,3,0,t.ɵunv(l,3,0,n(l,4,0,t.ɵnov(l,0),"loggedOutWarning"))),n(l,6,0,t.ɵnov(l,9).ngClassUntouched,t.ɵnov(l,9).ngClassTouched,t.ɵnov(l,9).ngClassPristine,t.ɵnov(l,9).ngClassDirty,t.ɵnov(l,9).ngClassValid,t.ɵnov(l,9).ngClassInvalid,t.ɵnov(l,9).ngClassPending),n(l,19,0,t.ɵunv(l,19,0,n(l,20,0,t.ɵnov(l,0),"currentMasterPass"))),n(l,22,0,t.ɵnov(l,24).required?"":null,t.ɵnov(l,29).ngClassUntouched,t.ɵnov(l,29).ngClassTouched,t.ɵnov(l,29).ngClassPristine,t.ɵnov(l,29).ngClassDirty,t.ɵnov(l,29).ngClassValid,t.ɵnov(l,29).ngClassInvalid,t.ɵnov(l,29).ngClassPending),n(l,36,0,t.ɵunv(l,36,0,n(l,37,0,t.ɵnov(l,0),"newMasterPass"))),n(l,39,0,t.ɵnov(l,41).required?"":null,t.ɵnov(l,46).ngClassUntouched,t.ɵnov(l,46).ngClassTouched,t.ɵnov(l,46).ngClassPristine,t.ɵnov(l,46).ngClassDirty,t.ɵnov(l,46).ngClassValid,t.ɵnov(l,46).ngClassInvalid,t.ɵnov(l,46).ngClassPending),n(l,53,0,t.ɵunv(l,53,0,n(l,54,0,t.ɵnov(l,0),"confirmNewMasterPass"))),n(l,56,0,t.ɵnov(l,58).required?"":null,t.ɵnov(l,63).ngClassUntouched,t.ɵnov(l,63).ngClassTouched,t.ɵnov(l,63).ngClassPristine,t.ɵnov(l,63).ngClassDirty,t.ɵnov(l,63).ngClassValid,t.ɵnov(l,63).ngClassInvalid,t.ɵnov(l,63).ngClassPending),n(l,69,0,t.ɵnov(l,6).loading),n(l,71,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,71,0,n(l,72,0,t.ɵnov(l,0),"loading")),"")),n(l,75,0,t.ɵunv(l,75,0,n(l,76,0,t.ɵnov(l,0),"changeMasterPassword")))})}function S(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"app-change-password",[],null,null,null,b,C)),t.ɵdid(1,49152,null,0,p.ChangePasswordComponent,[f.ApiService,o.I18nService,v.Angulartics2,h.ToasterService,g.CryptoService,m.MessagingService,y.UserService],null,null)],null,null)}l.RenderType_ChangePasswordComponent=C,l.View_ChangePasswordComponent_0=b,l.View_ChangePasswordComponent_Host_0=S;var w=t.ɵccf("app-change-password",p.ChangePasswordComponent,S,{},{},[]);l.ChangePasswordComponentNgFactory=w},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)});Object.defineProperty(l,"__esModule",{value:!0});var o=function(n){function l(){return null!==n&&n.apply(this,arguments)||this}return u(l,n),l}(e(554).EmailTokenRequest);l.EmailRequest=o},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=e(0),u=e(40),o=e(37),i=e(2),r=e(13),a=e(46),s=e(7),d=e(18),c=e(17),p=e(5),f=e(555),v=e(4),h=e(3),g=e(9),m=e(20),y=e(27),C=t.ɵcrt({encapsulation:2,styles:[],data:{}});function b(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,35,null,null,null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,0,"hr",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(4,0,null,null,2,"p",[],null,null,null,null,null)),(n()(),t.ɵted(5,null,["",""])),t.ɵppd(6,2),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(8,0,null,null,3,"app-callout",[["type","warning"]],null,null,null,u.View_CalloutComponent_0,u.RenderType_CalloutComponent)),t.ɵdid(9,114688,null,0,o.CalloutComponent,[i.I18nService],{type:[0,"type"]},null),(n()(),t.ɵted(10,0,["",""])),t.ɵppd(11,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(13,0,null,null,21,"div",[["class","row"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(15,0,null,null,18,"div",[["class","col-6"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(17,0,null,null,15,"div",[["class","form-group"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(19,0,null,null,2,"label",[["for","token"]],null,null,null,null,null)),(n()(),t.ɵted(20,null,["",""])),t.ɵppd(21,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(23,0,null,null,8,"input",[["appInputVerbatim",""],["class","form-control"],["id","token"],["name","Token"],["required",""],["type","text"]],[[1,"required",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(n,l,e){var u=!0,o=n.component;"input"===l&&(u=!1!==t.ɵnov(n,24)._handleInput(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,24).onTouched()&&u);"compositionstart"===l&&(u=!1!==t.ɵnov(n,24)._compositionStart()&&u);"compositionend"===l&&(u=!1!==t.ɵnov(n,24)._compositionEnd(e.target.value)&&u);"ngModelChange"===l&&(u=!1!==(o.token=e)&&u);return u},null,null)),t.ɵdid(24,16384,null,0,r.DefaultValueAccessor,[t.Renderer2,t.ElementRef,[2,r.COMPOSITION_BUFFER_MODE]],null,null),t.ɵdid(25,16384,null,0,r.RequiredValidator,[],{required:[0,"required"]},null),t.ɵprd(1024,null,r.NG_VALIDATORS,function(n){return[n]},[r.RequiredValidator]),t.ɵprd(1024,null,r.NG_VALUE_ACCESSOR,function(n){return[n]},[r.DefaultValueAccessor]),t.ɵdid(28,671744,null,0,r.NgModel,[[2,r.ControlContainer],[2,r.NG_VALIDATORS],[8,null],[2,r.NG_VALUE_ACCESSOR]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,r.NgControl,null,[r.NgModel]),t.ɵdid(30,16384,null,0,r.NgControlStatus,[r.NgControl],null,null),t.ɵdid(31,81920,null,0,a.InputVerbatimDirective,[t.ElementRef,t.Renderer2],{appInputVerbatim:[0,"appInputVerbatim"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "]))],function(n,l){var e=l.component;n(l,9,0,"warning");n(l,25,0,"");n(l,28,0,"Token",e.token);n(l,31,0,"")},function(n,l){var e=l.component;n(l,5,0,t.ɵunv(l,5,0,n(l,6,0,t.ɵnov(l.parent,0),"changeEmailDesc",e.newEmail))),n(l,10,0,t.ɵunv(l,10,0,n(l,11,0,t.ɵnov(l.parent,0),"loggedOutWarning"))),n(l,20,0,t.ɵunv(l,20,0,n(l,21,0,t.ɵnov(l.parent,0),"code"))),n(l,23,0,t.ɵnov(l,25).required?"":null,t.ɵnov(l,30).ngClassUntouched,t.ɵnov(l,30).ngClassTouched,t.ɵnov(l,30).ngClassPristine,t.ɵnov(l,30).ngClassDirty,t.ɵnov(l,30).ngClassValid,t.ɵnov(l,30).ngClassInvalid,t.ɵnov(l,30).ngClassPending)})}function S(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,2,"span",[],null,null,null,null,null)),(n()(),t.ɵted(1,null,["",""])),t.ɵppd(2,1)],null,function(n,l){n(l,1,0,t.ɵunv(l,1,0,n(l,2,0,t.ɵnov(l.parent,0),"continue")))})}function w(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,2,"span",[],null,null,null,null,null)),(n()(),t.ɵted(1,null,["",""])),t.ɵppd(2,1)],null,function(n,l){n(l,1,0,t.ɵunv(l,1,0,n(l,2,0,t.ɵnov(l.parent,0),"changeEmail")))})}function R(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,2,"button",[["class","btn btn-outline-secondary"],["type","button"]],null,[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.reset()&&t);return t},null,null)),(n()(),t.ɵted(1,null,["\n ","\n "])),t.ɵppd(2,1)],null,function(n,l){n(l,1,0,t.ɵunv(l,1,0,n(l,2,0,t.ɵnov(l.parent,0),"cancel")))})}function _(n){return t.ɵvid(0,[t.ɵpid(0,s.I18nPipe,[i.I18nService]),(n()(),t.ɵeld(1,0,[["form",1]],null,63,"form",[["ngNativeValidate",""]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngSubmit"],[null,"submit"],[null,"reset"]],function(n,l,e){var u=!0,o=n.component;"submit"===l&&(u=!1!==t.ɵnov(n,2).onSubmit(e)&&u);"reset"===l&&(u=!1!==t.ɵnov(n,2).onReset()&&u);"ngSubmit"===l&&(u=!1!==o.submit()&&u);return u},null,null)),t.ɵdid(2,4210688,null,0,r.NgForm,[[8,null],[8,null]],null,{ngSubmit:"ngSubmit"}),t.ɵprd(2048,null,r.ControlContainer,null,[r.NgForm]),t.ɵdid(4,16384,null,0,r.NgControlStatusGroup,[r.ControlContainer],null,null),t.ɵdid(5,540672,null,0,d.ApiActionDirective,[t.ElementRef,c.ValidationService],{appApiAction:[0,"appApiAction"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(7,0,null,null,38,"div",[["class","row"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(9,0,null,null,35,"div",[["class","col-6"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(11,0,null,null,15,"div",[["class","form-group"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(13,0,null,null,2,"label",[["for","masterPassword"]],null,null,null,null,null)),(n()(),t.ɵted(14,null,["",""])),t.ɵppd(15,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(17,0,null,null,8,"input",[["appInputVerbatim",""],["class","form-control"],["id","masterPassword"],["name","MasterPasswordHash"],["required",""],["type","password"]],[[8,"readOnly",0],[1,"required",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(n,l,e){var u=!0,o=n.component;"input"===l&&(u=!1!==t.ɵnov(n,18)._handleInput(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,18).onTouched()&&u);"compositionstart"===l&&(u=!1!==t.ɵnov(n,18)._compositionStart()&&u);"compositionend"===l&&(u=!1!==t.ɵnov(n,18)._compositionEnd(e.target.value)&&u);"ngModelChange"===l&&(u=!1!==(o.masterPassword=e)&&u);return u},null,null)),t.ɵdid(18,16384,null,0,r.DefaultValueAccessor,[t.Renderer2,t.ElementRef,[2,r.COMPOSITION_BUFFER_MODE]],null,null),t.ɵdid(19,16384,null,0,r.RequiredValidator,[],{required:[0,"required"]},null),t.ɵprd(1024,null,r.NG_VALIDATORS,function(n){return[n]},[r.RequiredValidator]),t.ɵprd(1024,null,r.NG_VALUE_ACCESSOR,function(n){return[n]},[r.DefaultValueAccessor]),t.ɵdid(22,671744,null,0,r.NgModel,[[2,r.ControlContainer],[2,r.NG_VALIDATORS],[8,null],[2,r.NG_VALUE_ACCESSOR]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,r.NgControl,null,[r.NgModel]),t.ɵdid(24,16384,null,0,r.NgControlStatus,[r.NgControl],null,null),t.ɵdid(25,81920,null,0,a.InputVerbatimDirective,[t.ElementRef,t.Renderer2],{appInputVerbatim:[0,"appInputVerbatim"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(28,0,null,null,15,"div",[["class","form-group"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(30,0,null,null,2,"label",[["for","newEmail"]],null,null,null,null,null)),(n()(),t.ɵted(31,null,["",""])),t.ɵppd(32,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(34,0,null,null,8,"input",[["appInputVerbatim","false"],["class","form-control"],["id","newEmail"],["inputmode","email"],["name","NewEmail"],["required",""],["type","text"]],[[8,"readOnly",0],[1,"required",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(n,l,e){var u=!0,o=n.component;"input"===l&&(u=!1!==t.ɵnov(n,35)._handleInput(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,35).onTouched()&&u);"compositionstart"===l&&(u=!1!==t.ɵnov(n,35)._compositionStart()&&u);"compositionend"===l&&(u=!1!==t.ɵnov(n,35)._compositionEnd(e.target.value)&&u);"ngModelChange"===l&&(u=!1!==(o.newEmail=e)&&u);return u},null,null)),t.ɵdid(35,16384,null,0,r.DefaultValueAccessor,[t.Renderer2,t.ElementRef,[2,r.COMPOSITION_BUFFER_MODE]],null,null),t.ɵdid(36,16384,null,0,r.RequiredValidator,[],{required:[0,"required"]},null),t.ɵprd(1024,null,r.NG_VALIDATORS,function(n){return[n]},[r.RequiredValidator]),t.ɵprd(1024,null,r.NG_VALUE_ACCESSOR,function(n){return[n]},[r.DefaultValueAccessor]),t.ɵdid(39,671744,null,0,r.NgModel,[[2,r.ControlContainer],[2,r.NG_VALIDATORS],[8,null],[2,r.NG_VALUE_ACCESSOR]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,r.NgControl,null,[r.NgModel]),t.ɵdid(41,16384,null,0,r.NgControlStatus,[r.NgControl],null,null),t.ɵdid(42,81920,null,0,a.InputVerbatimDirective,[t.ElementRef,t.Renderer2],{appInputVerbatim:[0,"appInputVerbatim"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,b)),t.ɵdid(48,16384,null,0,p.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(50,0,null,null,10,"button",[["class","btn btn-primary btn-submit"],["type","submit"]],[[8,"disabled",0]],null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(52,0,null,null,1,"i",[["class","fa fa-spinner fa-spin"]],[[8,"title",0]],null,null,null,null)),t.ɵppd(53,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,S)),t.ɵdid(56,16384,null,0,p.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,w)),t.ɵdid(59,16384,null,0,p.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,R)),t.ɵdid(63,16384,null,0,p.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){var e=l.component;n(l,5,0,e.formPromise);n(l,19,0,"");n(l,22,0,"MasterPasswordHash",e.masterPassword);n(l,25,0,"");n(l,36,0,"");n(l,39,0,"NewEmail",e.newEmail);n(l,42,0,"false"),n(l,48,0,e.tokenSent),n(l,56,0,!e.tokenSent),n(l,59,0,e.tokenSent),n(l,63,0,e.tokenSent)},function(n,l){var e=l.component;n(l,1,0,t.ɵnov(l,4).ngClassUntouched,t.ɵnov(l,4).ngClassTouched,t.ɵnov(l,4).ngClassPristine,t.ɵnov(l,4).ngClassDirty,t.ɵnov(l,4).ngClassValid,t.ɵnov(l,4).ngClassInvalid,t.ɵnov(l,4).ngClassPending),n(l,14,0,t.ɵunv(l,14,0,n(l,15,0,t.ɵnov(l,0),"masterPass"))),n(l,17,0,e.tokenSent,t.ɵnov(l,19).required?"":null,t.ɵnov(l,24).ngClassUntouched,t.ɵnov(l,24).ngClassTouched,t.ɵnov(l,24).ngClassPristine,t.ɵnov(l,24).ngClassDirty,t.ɵnov(l,24).ngClassValid,t.ɵnov(l,24).ngClassInvalid,t.ɵnov(l,24).ngClassPending),n(l,31,0,t.ɵunv(l,31,0,n(l,32,0,t.ɵnov(l,0),"newEmail"))),n(l,34,0,e.tokenSent,t.ɵnov(l,36).required?"":null,t.ɵnov(l,41).ngClassUntouched,t.ɵnov(l,41).ngClassTouched,t.ɵnov(l,41).ngClassPristine,t.ɵnov(l,41).ngClassDirty,t.ɵnov(l,41).ngClassValid,t.ɵnov(l,41).ngClassInvalid,t.ɵnov(l,41).ngClassPending),n(l,50,0,t.ɵnov(l,1).loading),n(l,52,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,52,0,n(l,53,0,t.ɵnov(l,0),"loading")),""))})}function I(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"app-change-email",[],null,null,null,_,C)),t.ɵdid(1,49152,null,0,f.ChangeEmailComponent,[v.ApiService,i.I18nService,h.Angulartics2,g.ToasterService,m.CryptoService,y.MessagingService],null,null)],null,null)}l.RenderType_ChangeEmailComponent=C,l.View_ChangeEmailComponent_0=_,l.View_ChangeEmailComponent_Host_0=I;var A=t.ɵccf("app-change-email",f.ChangeEmailComponent,I,{},{},[]);l.ChangeEmailComponentNgFactory=A},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(n,l){this.culture="en-US",this.name=n,this.masterPasswordHint=l||null}}();l.UpdateProfileRequest=t},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=e(0),u=e(13),o=e(18),i=e(17),r=e(130),a=e(116),s=e(42),d=e(7),c=e(2),p=e(5),f=e(556),v=e(4),h=e(3),g=e(9),m=t.ɵcrt({encapsulation:2,styles:[],data:{}});function y(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,4,"div",[],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(2,0,null,null,1,"i",[["class","fa fa-spinner fa-spin text-muted"]],[[8,"title",0]],null,null,null,null)),t.ɵppd(3,1),(n()(),t.ɵted(-1,null,["\n"]))],null,function(n,l){n(l,2,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,2,0,n(l,3,0,t.ɵnov(l.parent,0),"loading")),""))})}function C(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,[["form",1]],null,69,"form",[["ngNativeValidate",""]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngSubmit"],[null,"submit"],[null,"reset"]],function(n,l,e){var u=!0,o=n.component;"submit"===l&&(u=!1!==t.ɵnov(n,1).onSubmit(e)&&u);"reset"===l&&(u=!1!==t.ɵnov(n,1).onReset()&&u);"ngSubmit"===l&&(u=!1!==o.submit()&&u);return u},null,null)),t.ɵdid(1,4210688,null,0,u.NgForm,[[8,null],[8,null]],null,{ngSubmit:"ngSubmit"}),t.ɵprd(2048,null,u.ControlContainer,null,[u.NgForm]),t.ɵdid(3,16384,null,0,u.NgControlStatusGroup,[u.ControlContainer],null,null),t.ɵdid(4,540672,null,0,o.ApiActionDirective,[t.ElementRef,i.ValidationService],{appApiAction:[0,"appApiAction"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(6,0,null,null,52,"div",[["class","row"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(8,0,null,null,43,"div",[["class","col-6"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(10,0,null,null,12,"div",[["class","form-group"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(12,0,null,null,2,"label",[["for","name"]],null,null,null,null,null)),(n()(),t.ɵted(13,null,["",""])),t.ɵppd(14,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(16,0,null,null,5,"input",[["class","form-control"],["id","name"],["name","Name"],["type","text"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(n,l,e){var u=!0,o=n.component;"input"===l&&(u=!1!==t.ɵnov(n,17)._handleInput(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,17).onTouched()&&u);"compositionstart"===l&&(u=!1!==t.ɵnov(n,17)._compositionStart()&&u);"compositionend"===l&&(u=!1!==t.ɵnov(n,17)._compositionEnd(e.target.value)&&u);"ngModelChange"===l&&(u=!1!==(o.profile.name=e)&&u);return u},null,null)),t.ɵdid(17,16384,null,0,u.DefaultValueAccessor,[t.Renderer2,t.ElementRef,[2,u.COMPOSITION_BUFFER_MODE]],null,null),t.ɵprd(1024,null,u.NG_VALUE_ACCESSOR,function(n){return[n]},[u.DefaultValueAccessor]),t.ɵdid(19,671744,null,0,u.NgModel,[[2,u.ControlContainer],[8,null],[8,null],[2,u.NG_VALUE_ACCESSOR]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,u.NgControl,null,[u.NgModel]),t.ɵdid(21,16384,null,0,u.NgControlStatus,[u.NgControl],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(24,0,null,null,12,"div",[["class","form-group"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(26,0,null,null,2,"label",[["for","email"]],null,null,null,null,null)),(n()(),t.ɵted(27,null,["",""])),t.ɵppd(28,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(30,0,null,null,5,"input",[["class","form-control"],["id","email"],["name","Email"],["readonly",""],["type","text"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(n,l,e){var u=!0,o=n.component;"input"===l&&(u=!1!==t.ɵnov(n,31)._handleInput(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,31).onTouched()&&u);"compositionstart"===l&&(u=!1!==t.ɵnov(n,31)._compositionStart()&&u);"compositionend"===l&&(u=!1!==t.ɵnov(n,31)._compositionEnd(e.target.value)&&u);"ngModelChange"===l&&(u=!1!==(o.profile.email=e)&&u);return u},null,null)),t.ɵdid(31,16384,null,0,u.DefaultValueAccessor,[t.Renderer2,t.ElementRef,[2,u.COMPOSITION_BUFFER_MODE]],null,null),t.ɵprd(1024,null,u.NG_VALUE_ACCESSOR,function(n){return[n]},[u.DefaultValueAccessor]),t.ɵdid(33,671744,null,0,u.NgModel,[[2,u.ControlContainer],[8,null],[8,null],[2,u.NG_VALUE_ACCESSOR]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,u.NgControl,null,[u.NgModel]),t.ɵdid(35,16384,null,0,u.NgControlStatus,[u.NgControl],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(38,0,null,null,12,"div",[["class","form-group"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(40,0,null,null,2,"label",[["for","masterPasswordHint"]],null,null,null,null,null)),(n()(),t.ɵted(41,null,["",""])),t.ɵppd(42,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(44,0,null,null,5,"input",[["class","form-control"],["id","masterPasswordHint"],["name","MasterPasswordHint"],["type","text"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(n,l,e){var u=!0,o=n.component;"input"===l&&(u=!1!==t.ɵnov(n,45)._handleInput(e.target.value)&&u);"blur"===l&&(u=!1!==t.ɵnov(n,45).onTouched()&&u);"compositionstart"===l&&(u=!1!==t.ɵnov(n,45)._compositionStart()&&u);"compositionend"===l&&(u=!1!==t.ɵnov(n,45)._compositionEnd(e.target.value)&&u);"ngModelChange"===l&&(u=!1!==(o.profile.masterPasswordHint=e)&&u);return u},null,null)),t.ɵdid(45,16384,null,0,u.DefaultValueAccessor,[t.Renderer2,t.ElementRef,[2,u.COMPOSITION_BUFFER_MODE]],null,null),t.ɵprd(1024,null,u.NG_VALUE_ACCESSOR,function(n){return[n]},[u.DefaultValueAccessor]),t.ɵdid(47,671744,null,0,u.NgModel,[[2,u.ControlContainer],[8,null],[8,null],[2,u.NG_VALUE_ACCESSOR]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),t.ɵprd(2048,null,u.NgControl,null,[u.NgModel]),t.ɵdid(49,16384,null,0,u.NgControlStatus,[u.NgControl],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(53,0,null,null,4,"div",[["class","col-6"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(55,0,null,null,1,"app-avatar",[["dynamic","true"],["fontSize","35"],["height","75"],["width","75"]],null,null,null,r.View_AvatarComponent_0,r.RenderType_AvatarComponent)),t.ɵdid(56,638976,null,0,a.AvatarComponent,[s.DomSanitizer],{data:[0,"data"],width:[1,"width"],height:[2,"height"],fontSize:[3,"fontSize"],dynamic:[4,"dynamic"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(60,0,null,null,8,"button",[["class","btn btn-primary btn-submit"],["type","submit"]],[[8,"disabled",0]],null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(62,0,null,null,1,"i",[["class","fa fa-spinner fa-spin"]],[[8,"title",0]],null,null,null,null)),t.ɵppd(63,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(65,0,null,null,2,"span",[],null,null,null,null,null)),(n()(),t.ɵted(66,null,["",""])),t.ɵppd(67,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){var e=l.component;n(l,4,0,e.formPromise);n(l,19,0,"Name",e.profile.name);n(l,33,0,"Email",e.profile.email);n(l,47,0,"MasterPasswordHint",e.profile.masterPasswordHint);n(l,56,0,t.ɵinlineInterpolate(1,"",e.profile.name||e.profile.email,""),"75","75","35","true")},function(n,l){n(l,0,0,t.ɵnov(l,3).ngClassUntouched,t.ɵnov(l,3).ngClassTouched,t.ɵnov(l,3).ngClassPristine,t.ɵnov(l,3).ngClassDirty,t.ɵnov(l,3).ngClassValid,t.ɵnov(l,3).ngClassInvalid,t.ɵnov(l,3).ngClassPending),n(l,13,0,t.ɵunv(l,13,0,n(l,14,0,t.ɵnov(l.parent,0),"name"))),n(l,16,0,t.ɵnov(l,21).ngClassUntouched,t.ɵnov(l,21).ngClassTouched,t.ɵnov(l,21).ngClassPristine,t.ɵnov(l,21).ngClassDirty,t.ɵnov(l,21).ngClassValid,t.ɵnov(l,21).ngClassInvalid,t.ɵnov(l,21).ngClassPending),n(l,27,0,t.ɵunv(l,27,0,n(l,28,0,t.ɵnov(l.parent,0),"email"))),n(l,30,0,t.ɵnov(l,35).ngClassUntouched,t.ɵnov(l,35).ngClassTouched,t.ɵnov(l,35).ngClassPristine,t.ɵnov(l,35).ngClassDirty,t.ɵnov(l,35).ngClassValid,t.ɵnov(l,35).ngClassInvalid,t.ɵnov(l,35).ngClassPending),n(l,41,0,t.ɵunv(l,41,0,n(l,42,0,t.ɵnov(l.parent,0),"masterPassHintLabel"))),n(l,44,0,t.ɵnov(l,49).ngClassUntouched,t.ɵnov(l,49).ngClassTouched,t.ɵnov(l,49).ngClassPristine,t.ɵnov(l,49).ngClassDirty,t.ɵnov(l,49).ngClassValid,t.ɵnov(l,49).ngClassInvalid,t.ɵnov(l,49).ngClassPending),n(l,60,0,t.ɵnov(l,0).loading),n(l,62,0,t.ɵinlineInterpolate(1,"",t.ɵunv(l,62,0,n(l,63,0,t.ɵnov(l.parent,0),"loading")),"")),n(l,66,0,t.ɵunv(l,66,0,n(l,67,0,t.ɵnov(l.parent,0),"save")))})}function b(n){return t.ɵvid(0,[t.ɵpid(0,d.I18nPipe,[c.I18nService]),(n()(),t.ɵand(16777216,null,null,1,null,y)),t.ɵdid(2,16384,null,0,p.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,null,null,1,null,C)),t.ɵdid(5,16384,null,0,p.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){var e=l.component;n(l,2,0,e.loading),n(l,5,0,e.profile&&!e.loading)},null)}function S(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"app-profile",[],null,null,null,b,m)),t.ɵdid(1,114688,null,0,f.ProfileComponent,[v.ApiService,c.I18nService,h.Angulartics2,g.ToasterService],null,null)],function(n,l){n(l,1,0)},null)}l.RenderType_ProfileComponent=m,l.View_ProfileComponent_0=b,l.View_ProfileComponent_Host_0=S;var w=t.ɵccf("app-profile",f.ProfileComponent,S,{},{},[]);l.ProfileComponentNgFactory=w},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=e(0),u=e(7),o=e(2),i=e(796),r=e(556),a=e(4),s=e(3),d=e(9),c=e(794),p=e(555),f=e(20),v=e(27),h=e(792),g=e(553),m=e(21),y=e(273),C=t.ɵcrt({encapsulation:2,styles:[],data:{}});function b(n){return t.ɵvid(0,[(n()(),t.ɵand(0,null,null,0))],null,null)}function S(n){return t.ɵvid(0,[(n()(),t.ɵand(0,null,null,0))],null,null)}function w(n){return t.ɵvid(0,[(n()(),t.ɵand(0,null,null,0))],null,null)}function R(n){return t.ɵvid(0,[t.ɵpid(0,u.I18nPipe,[o.I18nService]),t.ɵqud(402653184,1,{deauthModalRef:0}),t.ɵqud(402653184,2,{purgeModalRef:0}),t.ɵqud(402653184,3,{deleteModalRef:0}),(n()(),t.ɵeld(4,0,null,null,5,"div",[["class","page-header"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(6,0,null,null,2,"h1",[],null,null,null,null,null)),(n()(),t.ɵted(7,null,["",""])),t.ɵppd(8,1),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵeld(11,0,null,null,1,"app-profile",[],null,null,null,i.View_ProfileComponent_0,i.RenderType_ProfileComponent)),t.ɵdid(12,114688,null,0,r.ProfileComponent,[a.ApiService,o.I18nService,s.Angulartics2,d.ToasterService],null,null),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵeld(14,0,null,null,5,"div",[["class","secondary-header"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(16,0,null,null,2,"h1",[],null,null,null,null,null)),(n()(),t.ɵted(17,null,["",""])),t.ɵppd(18,1),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵeld(21,0,null,null,1,"app-change-email",[],null,null,null,c.View_ChangeEmailComponent_0,c.RenderType_ChangeEmailComponent)),t.ɵdid(22,49152,null,0,p.ChangeEmailComponent,[a.ApiService,o.I18nService,s.Angulartics2,d.ToasterService,f.CryptoService,v.MessagingService],null,null),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵeld(24,0,null,null,5,"div",[["class","secondary-header"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(26,0,null,null,2,"h1",[],null,null,null,null,null)),(n()(),t.ɵted(27,null,["",""])),t.ɵppd(28,1),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵeld(31,0,null,null,1,"app-change-password",[],null,null,null,h.View_ChangePasswordComponent_0,h.RenderType_ChangePasswordComponent)),t.ɵdid(32,49152,null,0,g.ChangePasswordComponent,[a.ApiService,o.I18nService,s.Angulartics2,d.ToasterService,f.CryptoService,v.MessagingService,m.UserService],null,null),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵeld(34,0,null,null,5,"div",[["class","secondary-header text-danger border-0 mb-0"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(36,0,null,null,2,"h1",[],null,null,null,null,null)),(n()(),t.ɵted(37,null,["",""])),t.ɵppd(38,1),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵeld(41,0,null,null,20,"div",[["class","card border-danger"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(43,0,null,null,17,"div",[["class","card-body"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(45,0,null,null,2,"p",[],null,null,null,null,null)),(n()(),t.ɵted(46,null,["",""])),t.ɵppd(47,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(49,0,null,null,2,"button",[["class","btn btn-outline-danger"],["type","button"]],null,[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.deauthorizeSessions()&&t);return t},null,null)),(n()(),t.ɵted(50,null,["",""])),t.ɵppd(51,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(53,0,null,null,2,"button",[["class","btn btn-outline-danger"],["type","button"]],null,[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.purgeVault()&&t);return t},null,null)),(n()(),t.ɵted(54,null,["",""])),t.ɵppd(55,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(57,0,null,null,2,"button",[["class","btn btn-outline-danger"],["type","button"]],null,[[null,"click"]],function(n,l,e){var t=!0,u=n.component;"click"===l&&(t=!1!==u.deleteAccount()&&t);return t},null,null)),(n()(),t.ɵted(58,null,["",""])),t.ɵppd(59,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,[[1,3],["deauthorizeSessionsTemplate",2]],null,0,null,b)),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,[[2,3],["purgeVaultTemplate",2]],null,0,null,S)),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵand(16777216,[[3,3],["deleteAccountTemplate",2]],null,0,null,w)),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){n(l,12,0)},function(n,l){n(l,7,0,t.ɵunv(l,7,0,n(l,8,0,t.ɵnov(l,0),"myAccount"))),n(l,17,0,t.ɵunv(l,17,0,n(l,18,0,t.ɵnov(l,0),"changeEmail"))),n(l,27,0,t.ɵunv(l,27,0,n(l,28,0,t.ɵnov(l,0),"changeMasterPassword"))),n(l,37,0,t.ɵunv(l,37,0,n(l,38,0,t.ɵnov(l,0),"dangerZone"))),n(l,46,0,t.ɵunv(l,46,0,n(l,47,0,t.ɵnov(l,0),"dangerZoneDesc"))),n(l,50,0,t.ɵunv(l,50,0,n(l,51,0,t.ɵnov(l,0),"deauthorizeSessions"))),n(l,54,0,t.ɵunv(l,54,0,n(l,55,0,t.ɵnov(l,0),"purgeVault"))),n(l,58,0,t.ɵunv(l,58,0,n(l,59,0,t.ɵnov(l,0),"deleteAccount")))})}function _(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"app-account",[],null,null,null,R,C)),t.ɵdid(1,49152,null,0,y.AccountComponent,[t.ComponentFactoryResolver],null,null)],null,null)}l.RenderType_AccountComponent=C,l.View_AccountComponent_0=R,l.View_AccountComponent_Host_0=_;var I=t.ɵccf("app-account",y.AccountComponent,_,{},{},[]);l.AccountComponentNgFactory=I},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=e(0),u=e(10),o=e(5),i=e(7),r=e(2),a=e(274),s=e(35),d=e(160),c=t.ɵcrt({encapsulation:2,styles:[],data:{}});function p(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,6,"a",[["class","list-group-item"],["routerLink","billing"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(n,l,e){var u=!0;"click"===l&&(u=!1!==t.ɵnov(n,1).onClick(e.button,e.ctrlKey,e.metaKey,e.shiftKey)&&u);return u},null,null)),t.ɵdid(1,671744,[[8,4]],0,u.RouterLinkWithHref,[u.Router,u.ActivatedRoute,o.LocationStrategy],{routerLink:[0,"routerLink"]},null),t.ɵdid(2,1720320,null,2,u.RouterLinkActive,[u.Router,t.ElementRef,t.Renderer2,t.ChangeDetectorRef],{routerLinkActive:[0,"routerLinkActive"]},null),t.ɵqud(603979776,7,{links:1}),t.ɵqud(603979776,8,{linksWithHrefs:1}),(n()(),t.ɵted(5,null,["\n ","\n "])),t.ɵppd(6,1)],function(n,l){n(l,1,0,"billing");n(l,2,0,"active")},function(n,l){n(l,0,0,t.ɵnov(l,1).target,t.ɵnov(l,1).href),n(l,5,0,t.ɵunv(l,5,0,n(l,6,0,t.ɵnov(l.parent,0),"billingAndLicensing")))})}function f(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,6,"a",[["class","list-group-item"],["routerLink","premium"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(n,l,e){var u=!0;"click"===l&&(u=!1!==t.ɵnov(n,1).onClick(e.button,e.ctrlKey,e.metaKey,e.shiftKey)&&u);return u},null,null)),t.ɵdid(1,671744,[[10,4]],0,u.RouterLinkWithHref,[u.Router,u.ActivatedRoute,o.LocationStrategy],{routerLink:[0,"routerLink"]},null),t.ɵdid(2,1720320,null,2,u.RouterLinkActive,[u.Router,t.ElementRef,t.Renderer2,t.ChangeDetectorRef],{routerLinkActive:[0,"routerLinkActive"]},null),t.ɵqud(603979776,9,{links:1}),t.ɵqud(603979776,10,{linksWithHrefs:1}),(n()(),t.ɵted(5,null,["\n ","\n "])),t.ɵppd(6,1)],function(n,l){n(l,1,0,"premium");n(l,2,0,"active")},function(n,l){n(l,0,0,t.ɵnov(l,1).target,t.ɵnov(l,1).href),n(l,5,0,t.ɵunv(l,5,0,n(l,6,0,t.ɵnov(l.parent,0),"goPremium")))})}function v(n){return t.ɵvid(0,[t.ɵpid(0,i.I18nPipe,[r.I18nService]),(n()(),t.ɵeld(1,0,null,null,69,"div",[["class","container page-content"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(3,0,null,null,66,"div",[["class","row"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(5,0,null,null,57,"div",[["class","col-3"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(7,0,null,null,54,"div",[["class","card"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(9,0,null,null,2,"div",[["class","card-header"]],null,null,null,null,null)),(n()(),t.ɵted(10,null,["",""])),t.ɵppd(11,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(13,0,null,null,47,"div",[["class","list-group list-group-flush"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(15,0,null,null,6,"a",[["class","list-group-item"],["routerLink","account"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(n,l,e){var u=!0;"click"===l&&(u=!1!==t.ɵnov(n,16).onClick(e.button,e.ctrlKey,e.metaKey,e.shiftKey)&&u);return u},null,null)),t.ɵdid(16,671744,[[2,4]],0,u.RouterLinkWithHref,[u.Router,u.ActivatedRoute,o.LocationStrategy],{routerLink:[0,"routerLink"]},null),t.ɵdid(17,1720320,null,2,u.RouterLinkActive,[u.Router,t.ElementRef,t.Renderer2,t.ChangeDetectorRef],{routerLinkActive:[0,"routerLinkActive"]},null),t.ɵqud(603979776,1,{links:1}),t.ɵqud(603979776,2,{linksWithHrefs:1}),(n()(),t.ɵted(20,null,["\n ","\n "])),t.ɵppd(21,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(23,0,null,null,6,"a",[["class","list-group-item"],["routerLink","options"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(n,l,e){var u=!0;"click"===l&&(u=!1!==t.ɵnov(n,24).onClick(e.button,e.ctrlKey,e.metaKey,e.shiftKey)&&u);return u},null,null)),t.ɵdid(24,671744,[[4,4]],0,u.RouterLinkWithHref,[u.Router,u.ActivatedRoute,o.LocationStrategy],{routerLink:[0,"routerLink"]},null),t.ɵdid(25,1720320,null,2,u.RouterLinkActive,[u.Router,t.ElementRef,t.Renderer2,t.ChangeDetectorRef],{routerLinkActive:[0,"routerLinkActive"]},null),t.ɵqud(603979776,3,{links:1}),t.ɵqud(603979776,4,{linksWithHrefs:1}),(n()(),t.ɵted(28,null,["\n ","\n "])),t.ɵppd(29,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(31,0,null,null,6,"a",[["class","list-group-item"],["routerLink","organizations"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(n,l,e){var u=!0;"click"===l&&(u=!1!==t.ɵnov(n,32).onClick(e.button,e.ctrlKey,e.metaKey,e.shiftKey)&&u);return u},null,null)),t.ɵdid(32,671744,[[6,4]],0,u.RouterLinkWithHref,[u.Router,u.ActivatedRoute,o.LocationStrategy],{routerLink:[0,"routerLink"]},null),t.ɵdid(33,1720320,null,2,u.RouterLinkActive,[u.Router,t.ElementRef,t.Renderer2,t.ChangeDetectorRef],{routerLinkActive:[0,"routerLinkActive"]},null),t.ɵqud(603979776,5,{links:1}),t.ɵqud(603979776,6,{linksWithHrefs:1}),(n()(),t.ɵted(36,null,["\n ","\n "])),t.ɵppd(37,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,p)),t.ɵdid(40,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵand(16777216,null,null,1,null,f)),t.ɵdid(43,16384,null,0,o.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(45,0,null,null,6,"a",[["class","list-group-item"],["routerLink","two-factor"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(n,l,e){var u=!0;"click"===l&&(u=!1!==t.ɵnov(n,46).onClick(e.button,e.ctrlKey,e.metaKey,e.shiftKey)&&u);return u},null,null)),t.ɵdid(46,671744,[[12,4]],0,u.RouterLinkWithHref,[u.Router,u.ActivatedRoute,o.LocationStrategy],{routerLink:[0,"routerLink"]},null),t.ɵdid(47,1720320,null,2,u.RouterLinkActive,[u.Router,t.ElementRef,t.Renderer2,t.ChangeDetectorRef],{routerLinkActive:[0,"routerLinkActive"]},null),t.ɵqud(603979776,11,{links:1}),t.ɵqud(603979776,12,{linksWithHrefs:1}),(n()(),t.ɵted(50,null,["\n ","\n "])),t.ɵppd(51,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(53,0,null,null,6,"a",[["class","list-group-item"],["routerLink","domain-rules"],["routerLinkActive","active"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(n,l,e){var u=!0;"click"===l&&(u=!1!==t.ɵnov(n,54).onClick(e.button,e.ctrlKey,e.metaKey,e.shiftKey)&&u);return u},null,null)),t.ɵdid(54,671744,[[14,4]],0,u.RouterLinkWithHref,[u.Router,u.ActivatedRoute,o.LocationStrategy],{routerLink:[0,"routerLink"]},null),t.ɵdid(55,1720320,null,2,u.RouterLinkActive,[u.Router,t.ElementRef,t.Renderer2,t.ChangeDetectorRef],{routerLinkActive:[0,"routerLinkActive"]},null),t.ɵqud(603979776,13,{links:1}),t.ɵqud(603979776,14,{linksWithHrefs:1}),(n()(),t.ɵted(58,null,["\n ","\n "])),t.ɵppd(59,1),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(64,0,null,null,4,"div",[["class","col-9"]],null,null,null,null,null)),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵeld(66,16777216,null,null,1,"router-outlet",[],null,null,null,null,null)),t.ɵdid(67,212992,null,0,u.RouterOutlet,[u.ChildrenOutletContexts,t.ViewContainerRef,t.ComponentFactoryResolver,[8,null],t.ChangeDetectorRef],null,null),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n "])),(n()(),t.ɵted(-1,null,["\n"])),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){var e=l.component;n(l,16,0,"account");n(l,17,0,"active");n(l,24,0,"options");n(l,25,0,"active");n(l,32,0,"organizations");n(l,33,0,"active"),n(l,40,0,e.premium),n(l,43,0,!e.premium);n(l,46,0,"two-factor");n(l,47,0,"active");n(l,54,0,"domain-rules");n(l,55,0,"active"),n(l,67,0)},function(n,l){n(l,10,0,t.ɵunv(l,10,0,n(l,11,0,t.ɵnov(l,0),"settings"))),n(l,15,0,t.ɵnov(l,16).target,t.ɵnov(l,16).href),n(l,20,0,t.ɵunv(l,20,0,n(l,21,0,t.ɵnov(l,0),"myAccount"))),n(l,23,0,t.ɵnov(l,24).target,t.ɵnov(l,24).href),n(l,28,0,t.ɵunv(l,28,0,n(l,29,0,t.ɵnov(l,0),"options"))),n(l,31,0,t.ɵnov(l,32).target,t.ɵnov(l,32).href),n(l,36,0,t.ɵunv(l,36,0,n(l,37,0,t.ɵnov(l,0),"organizations"))),n(l,45,0,t.ɵnov(l,46).target,t.ɵnov(l,46).href),n(l,50,0,t.ɵunv(l,50,0,n(l,51,0,t.ɵnov(l,0),"twoStepLogin"))),n(l,53,0,t.ɵnov(l,54).target,t.ɵnov(l,54).href),n(l,58,0,t.ɵunv(l,58,0,n(l,59,0,t.ɵnov(l,0),"domainRules")))})}function h(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"app-settings",[],null,null,null,v,c)),t.ɵdid(1,245760,null,0,a.SettingsComponent,[s.TokenService,d.BroadcasterService,t.NgZone],null,null)],function(n,l){n(l,1,0)},null)}l.RenderType_SettingsComponent=c,l.View_SettingsComponent_0=v,l.View_SettingsComponent_Host_0=h;var g=t.ɵccf("app-settings",a.SettingsComponent,h,{},{},[]);l.SettingsComponentNgFactory=g},function(n,l,e){"use strict";var t=this&&this.__awaiter||function(n,l,e,t){return new(e||(e=Promise))(function(u,o){function i(n){try{a(t.next(n))}catch(n){o(n)}}function r(n){try{a(t.throw(n))}catch(n){o(n)}}function a(n){n.done?u(n.value):new e(function(l){l(n.value)}).then(i,r)}a((t=t.apply(n,l||[])).next())})},u=this&&this.__generator||function(n,l){var e,t,u,o,i={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return o={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function r(o){return function(r){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;i;)try{if(e=1,t&&(u=t[2&o[0]?"return":o[0]?"throw":"next"])&&!(u=u.call(t,o[1])).done)return u;switch(t=0,u&&(o=[0,u.value]),o[0]){case 0:case 1:u=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,t=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(u=(u=i.trys).length>0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]104857600)return this.toasterService.popAsync("error",this.i18nService.t("errorOccurred"),this.i18nService.t("maxFileSize")),[2];u.label=1;case 1:return u.trys.push([1,4,,5]),this.formPromise=this.saveCipherAttachment(l[0]),e=this,[4,this.formPromise];case 2:return e.cipherDomain=u.sent(),t=this,[4,this.cipherDomain.decrypt()];case 3:return t.cipher=u.sent(),this.analytics.eventTrack.next({action:"Added Attachment"}),this.toasterService.popAsync("success",null,this.i18nService.t("attachmentSaved")),this.onUploadedAttachment.emit(),[3,5];case 4:return u.sent(),[3,5];case 5:return n.type="",n.type="file",n.value="",[2]}})})},n.prototype.delete=function(n){return t(this,void 0,void 0,function(){var l;return u(this,function(e){switch(e.label){case 0:return null!=this.deletePromises[n.id]?[2]:[4,this.platformUtilsService.showDialog(this.i18nService.t("deleteAttachmentConfirmation"),this.i18nService.t("deleteAttachment"),this.i18nService.t("yes"),this.i18nService.t("no"),"warning")];case 1:if(!e.sent())return[2];e.label=2;case 2:return e.trys.push([2,4,,5]),this.deletePromises[n.id]=this.deleteCipherAttachment(n.id),[4,this.deletePromises[n.id]];case 3:return e.sent(),this.analytics.eventTrack.next({action:"Deleted Attachment"}),this.toasterService.popAsync("success",null,this.i18nService.t("deletedAttachment")),(l=this.cipher.attachments.indexOf(n))>-1&&this.cipher.attachments.splice(l,1),[3,5];case 4:return e.sent(),[3,5];case 5:return this.deletePromises[n.id]=null,this.onDeletedAttachment.emit(),[2]}})})},n.prototype.download=function(n){return t(this,void 0,void 0,function(){var l,e,t,o,i;return u(this,function(u){switch(u.label){case 0:return(l=n).downloading?[2]:this.canAccessAttachments?(l.downloading=!0,[4,fetch(new Request(n.url,{cache:"no-cache"}))]):(this.toasterService.popAsync("error",this.i18nService.t("premiumRequired"),this.i18nService.t("premiumRequiredDesc")),[2]);case 1:if(200!==(e=u.sent()).status)return this.toasterService.popAsync("error",null,this.i18nService.t("errorOccurred")),l.downloading=!1,[2];u.label=2;case 2:return u.trys.push([2,6,,7]),[4,e.arrayBuffer()];case 3:return t=u.sent(),[4,this.cryptoService.getOrgKey(this.cipher.organizationId)];case 4:return o=u.sent(),[4,this.cryptoService.decryptFromBytes(t,o)];case 5:return i=u.sent(),this.platformUtilsService.saveFile(this.win,i,null,n.fileName),[3,7];case 6:return u.sent(),this.toasterService.popAsync("error",null,this.i18nService.t("errorOccurred")),[3,7];case 7:return l.downloading=!1,[2]}})})},n.prototype.loadCipher=function(){return this.cipherService.get(this.cipherId)},n.prototype.saveCipherAttachment=function(n){return this.cipherService.saveAttachmentWithServer(this.cipherDomain,n)},n.prototype.deleteCipherAttachment=function(n){return this.cipherService.deleteAttachmentWithServer(this.cipher.id,n)},n}();l.AttachmentsComponent=i},function(n,l,e){"use strict";var t=this&&this.__awaiter||function(n,l,e,t){return new(e||(e=Promise))(function(u,o){function i(n){try{a(t.next(n))}catch(n){o(n)}}function r(n){try{a(t.throw(n))}catch(n){o(n)}}function a(n){n.done?u(n.value):new e(function(l){l(n.value)}).then(i,r)}a((t=t.apply(n,l||[])).next())})},u=this&&this.__generator||function(n,l){var e,t,u,o,i={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return o={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function r(o){return function(r){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;i;)try{if(e=1,t&&(u=t[2&o[0]?"return":o[0]?"throw":"next"])&&!(u=u.call(t,o[1])).done)return u;switch(t=0,u&&(o=[0,u.value]),o[0]){case 0:case 1:u=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,t=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(u=(u=i.trys).length>0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]-1&&this.cipher.login.uris.splice(l,1)}},n.prototype.addField=function(){null==this.cipher.fields&&(this.cipher.fields=[]);var n=new p.FieldView;n.type=this.addFieldType,this.cipher.fields.push(n)},n.prototype.removeField=function(n){var l=this.cipher.fields.indexOf(n);l>-1&&this.cipher.fields.splice(l,1)},n.prototype.cancel=function(){this.onCancelled.emit(this.cipher)},n.prototype.attachments=function(){this.onEditAttachments.emit(this.cipher)},n.prototype.delete=function(){return t(this,void 0,void 0,function(){return u(this,function(n){switch(n.label){case 0:return[4,this.platformUtilsService.showDialog(this.i18nService.t("deleteItemConfirmation"),this.i18nService.t("deleteItem"),this.i18nService.t("yes"),this.i18nService.t("no"),"warning")];case 1:if(!n.sent())return[2,!1];n.label=2;case 2:return n.trys.push([2,4,,5]),this.deletePromise=this.deleteCipher(),[4,this.deletePromise];case 3:return n.sent(),this.analytics.eventTrack.next({action:"Deleted Cipher"}),this.toasterService.popAsync("success",null,this.i18nService.t("deletedItem")),this.onDeletedCipher.emit(this.cipher),[3,5];case 4:return n.sent(),[3,5];case 5:return[2,!0]}})})},n.prototype.generatePassword=function(){return t(this,void 0,void 0,function(){return u(this,function(n){switch(n.label){case 0:return null!=this.cipher.login&&null!=this.cipher.login.password&&this.cipher.login.password.length?[4,this.platformUtilsService.showDialog(this.i18nService.t("overwritePasswordConfirmation"),this.i18nService.t("overwritePassword"),this.i18nService.t("yes"),this.i18nService.t("no"))]:[3,2];case 1:if(!n.sent())return[2,!1];n.label=2;case 2:return this.onGeneratePassword.emit(),[2,!0]}})})},n.prototype.togglePassword=function(){this.analytics.eventTrack.next({action:"Toggled Password on Edit"}),this.showPassword=!this.showPassword,document.getElementById("loginPassword").focus()},n.prototype.toggleCardCode=function(){this.analytics.eventTrack.next({action:"Toggled CardCode on Edit"}),this.showCardCode=!this.showCardCode,document.getElementById("cardCode").focus()},n.prototype.toggleFieldValue=function(n){var l=n;l.showValue=!l.showValue},n.prototype.toggleUriOptions=function(n){var l=n;l.showOptions=(null!=l.showOptions||null==n.match)&&!l.showOptions},n.prototype.loginUriMatchChanged=function(n){var l=n;l.showOptions=null==l.showOptions||l.showOptions},n.prototype.checkPassword=function(){return t(this,void 0,void 0,function(){var n;return u(this,function(l){switch(l.label){case 0:return null!=this.checkPasswordPromise?[2]:null==this.cipher.login||null==this.cipher.login.password||""===this.cipher.login.password?[2]:(this.analytics.eventTrack.next({action:"Check Password"}),this.checkPasswordPromise=this.auditService.passwordLeaked(this.cipher.login.password),[4,this.checkPasswordPromise]);case 1:return n=l.sent(),this.checkPasswordPromise=null,n>0?this.toasterService.popAsync("warning",null,this.i18nService.t("passwordExposed",n.toString())):this.toasterService.popAsync("success",null,this.i18nService.t("passwordSafe")),[2]}})})},n.prototype.loadCipher=function(){return this.cipherService.get(this.cipherId)},n.prototype.encryptCipher=function(){return this.cipherService.encrypt(this.cipher)},n.prototype.saveCipher=function(n){return this.cipherService.saveWithServer(n)},n.prototype.deleteCipher=function(){return this.cipherService.deleteWithServer(this.cipher.id)},n}();l.AddEditComponent=m},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=function(){return function(){this.ciphers=[],this.folders=[]}}();l.UpdateKeyRequest=t},function(n,l,e){"use strict";var t,u=this&&this.__extends||(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var e in l)l.hasOwnProperty(e)&&(n[e]=l[e])},function(n,l){function e(){this.constructor=n}t(n,l),n.prototype=null===l?Object.create(l):(e.prototype=l.prototype,new e)});Object.defineProperty(l,"__esModule",{value:!0});var o=function(n){function l(l){var e=n.call(this,l)||this;return e.id=l.id,e}return u(l,n),l}(e(278).FolderRequest);l.FolderWithIdRequest=o},function(n,l,e){"use strict";var t=this&&this.__awaiter||function(n,l,e,t){return new(e||(e=Promise))(function(u,o){function i(n){try{a(t.next(n))}catch(n){o(n)}}function r(n){try{a(t.throw(n))}catch(n){o(n)}}function a(n){n.done?u(n.value):new e(function(l){l(n.value)}).then(i,r)}a((t=t.apply(n,l||[])).next())})},u=this&&this.__generator||function(n,l){var e,t,u,o,i={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return o={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function r(o){return function(r){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;i;)try{if(e=1,t&&(u=t[2&o[0]?"return":o[0]?"throw":"next"])&&!(u=u.call(t,o[1])).done)return u;switch(t=0,u&&(o=[0,u.value]),o[0]){case 0:case 1:u=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,t=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(u=(u=i.trys).length>0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0),n(l,6,0,0===l.context.ngIf.length)},null)}function x(n){return t.ɵvid(0,[t.ɵpid(0,p.SearchCiphersPipe,[f.PlatformUtilsService]),t.ɵpid(0,v.I18nPipe,[h.I18nService]),(n()(),t.ɵand(16777216,null,null,2,null,M)),t.ɵdid(3,16384,null,0,r.NgIf,[t.ViewContainerRef,t.TemplateRef],{ngIf:[0,"ngIf"]},null),t.ɵppd(4,2),(n()(),t.ɵted(-1,null,["\n"]))],function(n,l){var e=l.component;n(l,3,0,t.ɵunv(l,3,0,n(l,4,0,t.ɵnov(l,0),e.ciphers,e.searchText)))},null)}function D(n){return t.ɵvid(0,[(n()(),t.ɵeld(0,0,null,null,1,"app-vault-ciphers",[],null,null,null,x,b)),t.ɵdid(1,49152,null,0,g.CiphersComponent,[m.CipherService,y.Angulartics2,C.ToasterService,h.I18nService,f.PlatformUtilsService],null,null)],null,null)}l.RenderType_CiphersComponent=b,l.View_CiphersComponent_0=x,l.View_CiphersComponent_Host_0=D;var U=t.ɵccf("app-vault-ciphers",g.CiphersComponent,D,{activeCipherId:"activeCipherId",showAddNew:"showAddNew"},{onCipherClicked:"onCipherClicked",onCipherRightClicked:"onCipherRightClicked",onAddCipher:"onAddCipher",onAddCipherOptions:"onAddCipherOptions",onAttachmentsClicked:"onAttachmentsClicked",onShareClicked:"onShareClicked",onCollectionsClicked:"onCollectionsClicked"},[]);l.CiphersComponentNgFactory=U},function(n,l,e){"use strict";var t=this&&this.__awaiter||function(n,l,e,t){return new(e||(e=Promise))(function(u,o){function i(n){try{a(t.next(n))}catch(n){o(n)}}function r(n){try{a(t.throw(n))}catch(n){o(n)}}function a(n){n.done?u(n.value):new e(function(l){l(n.value)}).then(i,r)}a((t=t.apply(n,l||[])).next())})},u=this&&this.__generator||function(n,l){var e,t,u,o,i={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return o={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function r(o){return function(r){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;i;)try{if(e=1,t&&(u=t[2&o[0]?"return":o[0]?"throw":"next"])&&!(u=u.call(t,o[1])).done)return u;switch(t=0,u&&(o=[0,u.value]),o[0]){case 0:case 1:u=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,t=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(u=(u=i.trys).length>0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&this.u2f.init({appId:l[0].appId,challenge:l[0].challenge,keys:[{version:l[0].version,keyHandle:l[0].keyHandle}]}),[3,7]):[3,7];case 2:return this.platformUtilsService.getDevice()===o.DeviceType.SafariExtension?[3,7]:(setTimeout(function(){s.init({iframe:void 0,host:n.Host,sig_request:n.Signature,submit_callback:function(n){return t(e,void 0,void 0,function(){var l;return u(this,function(e){switch(e.label){case 0:return null==(l=n.querySelector('input[name="sig_response"]'))?[3,2]:(this.token=l.value,[4,this.submit()]);case 1:e.sent(),e.label=2;case 2:return[2]}})})}})},0),[3,7]);case 3:return this.twoFactorEmail=n.Email,this.authService.twoFactorProviders.size>1?[4,this.sendEmail(!1)]:[3,5];case 4:r.sent(),r.label=5;case 5:case 6:return[3,7];case 7:return[2]}})})},n.prototype.submit=function(){return t(this,void 0,void 0,function(){var n;return u(this,function(l){switch(l.label){case 0:if(null==this.token||""===this.token)return this.toasterService.popAsync("error",this.i18nService.t("errorOccurred"),this.i18nService.t("verificationCodeRequired")),[2];if(this.selectedProviderType===i.TwoFactorProviderType.U2f){if(null==this.u2f)return[2];this.u2f.stop()}else this.selectedProviderType!==i.TwoFactorProviderType.Email&&this.selectedProviderType!==i.TwoFactorProviderType.Authenticator||(this.token=this.token.replace(" ","").trim());l.label=1;case 1:return l.trys.push([1,3,,4]),this.formPromise=this.authService.logInTwoFactor(this.selectedProviderType,this.token,this.remember),[4,this.formPromise];case 2:return l.sent(),null!=this.onSuccessfulLogin&&this.onSuccessfulLogin(),this.analytics.eventTrack.next({action:"Logged In From Two-step"}),null!=this.onSuccessfulLoginNavigate?this.onSuccessfulLoginNavigate():this.router.navigate([this.successRoute]),[3,4];case 3:if(n=l.sent(),this.selectedProviderType!==i.TwoFactorProviderType.U2f||null==this.u2f)throw n;return this.u2f.start(),[3,4];case 4:return[2]}})})},n.prototype.sendEmail=function(n){return t(this,void 0,void 0,function(){var l;return u(this,function(e){switch(e.label){case 0:if(this.selectedProviderType!==i.TwoFactorProviderType.Email)return[2];if(null!=this.emailPromise)return[2];e.label=1;case 1:return e.trys.push([1,3,,4]),l=new r.TwoFactorEmailRequest(this.authService.email,this.authService.masterPasswordHash),this.emailPromise=this.apiService.postTwoFactorEmail(l),[4,this.emailPromise];case 2:return e.sent(),n&&this.toasterService.popAsync("success",null,this.i18nService.t("verificationCodeEmailSent",this.twoFactorEmail)),[3,4];case 3:return e.sent(),[3,4];case 4:return this.emailPromise=null,[2]}})})},n.prototype.cleanupU2f=function(){null!=this.u2f&&(this.u2f.stop(),this.u2f.cleanup())},n}();l.TwoFactorComponent=c},function(n,l,e){"use strict";Object.defineProperty(l,"__esModule",{value:!0});var t=e(0),u=function(){function n(n){this.componentFactoryResolver=n,this.onClose=new t.EventEmitter,this.onClosed=new t.EventEmitter,this.onShow=new t.EventEmitter,this.onShown=new t.EventEmitter,this.parentContainer=null,this.fade=!0}return n.prototype.ngOnDestroy=function(){document.body.classList.remove("modal-open"),document.body.removeChild(document.querySelector(".modal-backdrop"))},n.prototype.show=function(n,l,e){var t=this;void 0===e&&(e=!0),this.onShow.emit(),this.parentContainer=l,this.fade=e,document.body.classList.add("modal-open");var u=document.createElement("div");u.className="modal-backdrop"+(this.fade?" fade":""),document.body.appendChild(u);var o=this.componentFactoryResolver.resolveComponentFactory(n),i=this.container.createComponent(o);document.querySelector(".modal-dialog").addEventListener("click",function(n){n.stopPropagation()});for(var r=0,a=Array.from(document.querySelectorAll('.modal, .modal *[data-dismiss="modal"]'));r0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1] string;\r\n translate: (id: string, p1?: string, p2?: string, p3?: string) => string;\r\n}\r\n","import { EnvironmentUrls } from '../models/domain/environmentUrls';\r\n\r\nimport { CipherBulkDeleteRequest } from '../models/request/cipherBulkDeleteRequest';\r\nimport { CipherBulkMoveRequest } from '../models/request/cipherBulkMoveRequest';\r\nimport { CipherBulkShareRequest } from '../models/request/cipherBulkShareRequest';\r\nimport { CipherCollectionsRequest } from '../models/request/cipherCollectionsRequest';\r\nimport { CipherRequest } from '../models/request/cipherRequest';\r\nimport { CipherShareRequest } from '../models/request/cipherShareRequest';\r\nimport { CollectionRequest } from '../models/request/collectionRequest';\r\nimport { DeleteRecoverRequest } from '../models/request/deleteRecoverRequest';\r\nimport { EmailRequest } from '../models/request/emailRequest';\r\nimport { EmailTokenRequest } from '../models/request/emailTokenRequest';\r\nimport { FolderRequest } from '../models/request/folderRequest';\r\nimport { GroupRequest } from '../models/request/groupRequest';\r\nimport { ImportCiphersRequest } from '../models/request/importCiphersRequest';\r\nimport { ImportDirectoryRequest } from '../models/request/importDirectoryRequest';\r\nimport { ImportOrganizationCiphersRequest } from '../models/request/importOrganizationCiphersRequest';\r\nimport { KeysRequest } from '../models/request/keysRequest';\r\nimport { OrganizationCreateRequest } from '../models/request/organizationCreateRequest';\r\nimport { OrganizationUpdateRequest } from '../models/request/organizationUpdateRequest';\r\nimport { OrganizationUserAcceptRequest } from '../models/request/organizationUserAcceptRequest';\r\nimport { OrganizationUserConfirmRequest } from '../models/request/organizationUserConfirmRequest';\r\nimport { OrganizationUserInviteRequest } from '../models/request/organizationUserInviteRequest';\r\nimport { OrganizationUserUpdateGroupsRequest } from '../models/request/organizationUserUpdateGroupsRequest';\r\nimport { OrganizationUserUpdateRequest } from '../models/request/organizationUserUpdateRequest';\r\nimport { PasswordHintRequest } from '../models/request/passwordHintRequest';\r\nimport { PasswordRequest } from '../models/request/passwordRequest';\r\nimport { PasswordVerificationRequest } from '../models/request/passwordVerificationRequest';\r\nimport { PaymentRequest } from '../models/request/paymentRequest';\r\nimport { RegisterRequest } from '../models/request/registerRequest';\r\nimport { SeatRequest } from '../models/request/seatRequest';\r\nimport { StorageRequest } from '../models/request/storageRequest';\r\nimport { TokenRequest } from '../models/request/tokenRequest';\r\nimport { TwoFactorEmailRequest } from '../models/request/twoFactorEmailRequest';\r\nimport { TwoFactorProviderRequest } from '../models/request/twoFactorProviderRequest';\r\nimport { TwoFactorRecoveryRequest } from '../models/request/twoFactorRecoveryRequest';\r\nimport { UpdateDomainsRequest } from '../models/request/updateDomainsRequest';\r\nimport { UpdateKeyRequest } from '../models/request/updateKeyRequest';\r\nimport { UpdateProfileRequest } from '../models/request/updateProfileRequest';\r\nimport { UpdateTwoFactorAuthenticatorRequest } from '../models/request/updateTwoFactorAuthenticatorRequest';\r\nimport { UpdateTwoFactorDuoRequest } from '../models/request/updateTwoFactorDuoRequest';\r\nimport { UpdateTwoFactorEmailRequest } from '../models/request/updateTwoFactorEmailRequest';\r\nimport { UpdateTwoFactorU2fRequest } from '../models/request/updateTwoFactorU2fRequest';\r\nimport { UpdateTwoFactorYubioOtpRequest } from '../models/request/updateTwoFactorYubioOtpRequest';\r\nimport { VerifyBankRequest } from '../models/request/verifyBankRequest';\r\nimport { VerifyDeleteRecoverRequest } from '../models/request/verifyDeleteRecoverRequest';\r\nimport { VerifyEmailRequest } from '../models/request/verifyEmailRequest';\r\n\r\nimport { BillingResponse } from '../models/response/billingResponse';\r\nimport { CipherResponse } from '../models/response/cipherResponse';\r\nimport {\r\n CollectionGroupDetailsResponse,\r\n CollectionResponse,\r\n} from '../models/response/collectionResponse';\r\nimport { CollectionUserResponse } from '../models/response/collectionUserResponse';\r\nimport { DomainsResponse } from '../models/response/domainsResponse';\r\nimport { EventResponse } from '../models/response/eventResponse';\r\nimport { FolderResponse } from '../models/response/folderResponse';\r\nimport {\r\n GroupDetailsResponse,\r\n GroupResponse,\r\n} from '../models/response/groupResponse';\r\nimport { GroupUserResponse } from '../models/response/groupUserResponse';\r\nimport { IdentityTokenResponse } from '../models/response/identityTokenResponse';\r\nimport { IdentityTwoFactorResponse } from '../models/response/identityTwoFactorResponse';\r\nimport { ListResponse } from '../models/response/listResponse';\r\nimport { OrganizationBillingResponse } from '../models/response/organizationBillingResponse';\r\nimport { OrganizationResponse } from '../models/response/organizationResponse';\r\nimport {\r\n OrganizationUserDetailsResponse,\r\n OrganizationUserUserDetailsResponse,\r\n} from '../models/response/organizationUserResponse';\r\nimport { ProfileResponse } from '../models/response/profileResponse';\r\nimport { SyncResponse } from '../models/response/syncResponse';\r\nimport { TwoFactorAuthenticatorResponse } from '../models/response/twoFactorAuthenticatorResponse';\r\nimport { TwoFactorDuoResponse } from '../models/response/twoFactorDuoResponse';\r\nimport { TwoFactorEmailResponse } from '../models/response/twoFactorEmailResponse';\r\nimport { TwoFactorProviderResponse } from '../models/response/twoFactorProviderResponse';\r\nimport { TwoFactorRecoverResponse } from '../models/response/twoFactorRescoverResponse';\r\nimport { TwoFactorU2fResponse } from '../models/response/twoFactorU2fResponse';\r\nimport { TwoFactorYubiKeyResponse } from '../models/response/twoFactorYubiKeyResponse';\r\nimport { UserKeyResponse } from '../models/response/userKeyResponse';\r\n\r\nexport abstract class ApiService {\r\n urlsSet: boolean;\r\n apiBaseUrl: string;\r\n identityBaseUrl: string;\r\n\r\n setUrls: (urls: EnvironmentUrls) => void;\r\n postIdentityToken: (request: TokenRequest) => Promise;\r\n refreshIdentityToken: () => Promise;\r\n\r\n getProfile: () => Promise;\r\n getUserBilling: () => Promise;\r\n putProfile: (request: UpdateProfileRequest) => Promise;\r\n postEmailToken: (request: EmailTokenRequest) => Promise;\r\n postEmail: (request: EmailRequest) => Promise;\r\n postPassword: (request: PasswordRequest) => Promise;\r\n postSecurityStamp: (request: PasswordVerificationRequest) => Promise;\r\n deleteAccount: (request: PasswordVerificationRequest) => Promise;\r\n getAccountRevisionDate: () => Promise;\r\n postPasswordHint: (request: PasswordHintRequest) => Promise;\r\n postRegister: (request: RegisterRequest) => Promise;\r\n postPremium: (data: FormData) => Promise;\r\n postReinstatePremium: () => Promise;\r\n postCancelPremium: () => Promise;\r\n postAccountStorage: (request: StorageRequest) => Promise;\r\n postAccountPayment: (request: PaymentRequest) => Promise;\r\n postAccountLicense: (data: FormData) => Promise;\r\n postAccountKey: (request: UpdateKeyRequest) => Promise;\r\n postAccountKeys: (request: KeysRequest) => Promise;\r\n postAccountVerifyEmail: () => Promise;\r\n postAccountVerifyEmailToken: (request: VerifyEmailRequest) => Promise;\r\n postAccountRecoverDelete: (request: DeleteRecoverRequest) => Promise;\r\n postAccountRecoverDeleteToken: (request: VerifyDeleteRecoverRequest) => Promise;\r\n\r\n postFolder: (request: FolderRequest) => Promise;\r\n putFolder: (id: string, request: FolderRequest) => Promise;\r\n deleteFolder: (id: string) => Promise;\r\n\r\n getCipher: (id: string) => Promise;\r\n getCipherAdmin: (id: string) => Promise;\r\n getCiphersOrganization: (organizationId: string) => Promise>;\r\n postCipher: (request: CipherRequest) => Promise;\r\n postCipherAdmin: (request: CipherRequest) => Promise;\r\n putCipher: (id: string, request: CipherRequest) => Promise;\r\n putCipherAdmin: (id: string, request: CipherRequest) => Promise;\r\n deleteCipher: (id: string) => Promise;\r\n deleteCipherAdmin: (id: string) => Promise;\r\n deleteManyCiphers: (request: CipherBulkDeleteRequest) => Promise;\r\n putMoveCiphers: (request: CipherBulkMoveRequest) => Promise;\r\n putShareCipher: (id: string, request: CipherShareRequest) => Promise;\r\n putShareCiphers: (request: CipherBulkShareRequest) => Promise;\r\n putCipherCollections: (id: string, request: CipherCollectionsRequest) => Promise;\r\n putCipherCollectionsAdmin: (id: string, request: CipherCollectionsRequest) => Promise;\r\n postPurgeCiphers: (request: PasswordVerificationRequest) => Promise;\r\n postImportCiphers: (request: ImportCiphersRequest) => Promise;\r\n postImportOrganizationCiphers: (organizationId: string, request: ImportOrganizationCiphersRequest) => Promise;\r\n\r\n postCipherAttachment: (id: string, data: FormData) => Promise;\r\n postCipherAttachmentAdmin: (id: string, data: FormData) => Promise;\r\n deleteCipherAttachment: (id: string, attachmentId: string) => Promise;\r\n deleteCipherAttachmentAdmin: (id: string, attachmentId: string) => Promise;\r\n postShareCipherAttachment: (id: string, attachmentId: string, data: FormData,\r\n organizationId: string) => Promise;\r\n\r\n getCollectionDetails: (organizationId: string, id: string) => Promise;\r\n getCollections: (organizationId: string) => Promise>;\r\n getCollectionUsers: (organizationId: string, id: string) => Promise>;\r\n postCollection: (organizationId: string, request: CollectionRequest) => Promise;\r\n putCollection: (organizationId: string, id: string, request: CollectionRequest) => Promise;\r\n deleteCollection: (organizationId: string, id: string) => Promise;\r\n deleteCollectionUser: (organizationId: string, id: string, organizationUserId: string) => Promise;\r\n\r\n getGroupDetails: (organizationId: string, id: string) => Promise;\r\n getGroups: (organizationId: string) => Promise>;\r\n getGroupUsers: (organizationId: string, id: string) => Promise>;\r\n postGroup: (organizationId: string, request: GroupRequest) => Promise;\r\n putGroup: (organizationId: string, id: string, request: GroupRequest) => Promise;\r\n deleteGroup: (organizationId: string, id: string) => Promise;\r\n deleteGroupUser: (organizationId: string, id: string, organizationUserId: string) => Promise;\r\n\r\n getOrganizationUser: (organizationId: string, id: string) => Promise;\r\n getOrganizationUserGroups: (organizationId: string, id: string) => Promise;\r\n getOrganizationUsers: (organizationId: string) => Promise>;\r\n postOrganizationUserInvite: (organizationId: string, request: OrganizationUserInviteRequest) => Promise;\r\n postOrganizationUserReinvite: (organizationId: string, id: string) => Promise;\r\n postOrganizationUserAccept: (organizationId: string, id: string,\r\n request: OrganizationUserAcceptRequest) => Promise;\r\n postOrganizationUserConfirm: (organizationId: string, id: string,\r\n request: OrganizationUserConfirmRequest) => Promise;\r\n putOrganizationUser: (organizationId: string, id: string, request: OrganizationUserUpdateRequest) => Promise;\r\n putOrganizationUserGroups: (organizationId: string, id: string,\r\n request: OrganizationUserUpdateGroupsRequest) => Promise;\r\n deleteOrganizationUser: (organizationId: string, id: string) => Promise;\r\n\r\n getSync: () => Promise;\r\n postImportDirectory: (organizationId: string, request: ImportDirectoryRequest) => Promise;\r\n\r\n getSettingsDomains: () => Promise;\r\n putSettingsDomains: (request: UpdateDomainsRequest) => Promise;\r\n\r\n getTwoFactorProviders: () => Promise>;\r\n getTwoFactorOrganizationProviders: (organizationId: string) => Promise>;\r\n getTwoFactorAuthenticator: (request: PasswordVerificationRequest) => Promise;\r\n getTwoFactorEmail: (request: PasswordVerificationRequest) => Promise;\r\n getTwoFactorDuo: (request: PasswordVerificationRequest) => Promise;\r\n getTwoFactorOrganizationDuo: (organizationId: string,\r\n request: PasswordVerificationRequest) => Promise;\r\n getTwoFactorYubiKey: (request: PasswordVerificationRequest) => Promise;\r\n getTwoFactorU2f: (request: PasswordVerificationRequest) => Promise;\r\n getTwoFactorRecover: (request: PasswordVerificationRequest) => Promise;\r\n putTwoFactorAuthenticator: (\r\n request: UpdateTwoFactorAuthenticatorRequest) => Promise;\r\n putTwoFactorEmail: (request: UpdateTwoFactorEmailRequest) => Promise;\r\n putTwoFactorDuo: (request: UpdateTwoFactorDuoRequest) => Promise;\r\n putTwoFactorOrganizationDuo: (organizationId: string,\r\n request: UpdateTwoFactorDuoRequest) => Promise;\r\n putTwoFactorYubiKey: (request: UpdateTwoFactorYubioOtpRequest) => Promise;\r\n putTwoFactorU2f: (request: UpdateTwoFactorU2fRequest) => Promise;\r\n putTwoFactorDisable: (request: TwoFactorProviderRequest) => Promise;\r\n putTwoFactorOrganizationDisable: (organizationId: string,\r\n request: TwoFactorProviderRequest) => Promise;\r\n postTwoFactorRecover: (request: TwoFactorRecoveryRequest) => Promise;\r\n postTwoFactorEmailSetup: (request: TwoFactorEmailRequest) => Promise;\r\n postTwoFactorEmail: (request: TwoFactorEmailRequest) => Promise;\r\n\r\n getOrganization: (id: string) => Promise;\r\n getOrganizationBilling: (id: string) => Promise;\r\n getOrganizationLicense: (id: string, installationId: string) => Promise;\r\n postOrganization: (request: OrganizationCreateRequest) => Promise;\r\n putOrganization: (id: string, request: OrganizationUpdateRequest) => Promise;\r\n postLeaveOrganization: (id: string) => Promise;\r\n postOrganizationLicense: (data: FormData) => Promise;\r\n postOrganizationLicenseUpdate: (id: string, data: FormData) => Promise;\r\n postOrganizationSeat: (id: string, request: SeatRequest) => Promise;\r\n postOrganizationStorage: (id: string, request: StorageRequest) => Promise;\r\n postOrganizationPayment: (id: string, request: PaymentRequest) => Promise;\r\n postOrganizationVerifyBank: (id: string, request: VerifyBankRequest) => Promise;\r\n postOrganizationCancel: (id: string) => Promise;\r\n postOrganizationReinstate: (id: string) => Promise;\r\n deleteOrganization: (id: string, request: PasswordVerificationRequest) => Promise;\r\n\r\n getEvents: (start: string, end: string, token: string) => Promise>;\r\n getEventsCipher: (id: string, start: string, end: string, token: string) => Promise>;\r\n getEventsOrganization: (id: string, start: string, end: string,\r\n token: string) => Promise>;\r\n getEventsOrganizationUser: (organizationId: string, id: string,\r\n start: string, end: string, token: string) => Promise>;\r\n\r\n getUserPublicKey: (id: string) => Promise;\r\n\r\n fetch: (request: Request) => Promise;\r\n}\r\n","import {\n Pipe,\n PipeTransform,\n} from '@angular/core';\r\n\nimport { I18nService } from '../../abstractions/i18n.service';\n\r\n@Pipe({\n name: 'i18n',\n})\r\nexport class I18nPipe implements PipeTransform {\n constructor(private i18nService: I18nService) { }\n\r\n transform(id: string, p1?: string, p2?: string, p3?: string): string {\r\n return this.i18nService.t(id, p1, p2, p3);\r\n }\r\n}\n","import { DeviceType } from '../enums/deviceType';\n\nexport abstract class PlatformUtilsService {\n identityClientId: string;\n getDevice: () => DeviceType;\n getDeviceString: () => string;\n isFirefox: () => boolean;\n isChrome: () => boolean;\n isEdge: () => boolean;\n isOpera: () => boolean;\n isVivaldi: () => boolean;\n isSafari: () => boolean;\n isIE: () => boolean;\n isMacAppStore: () => boolean;\n analyticsId: () => string;\n getDomain: (uriString: string) => string;\n isViewOpen: () => boolean;\n lockTimeout: () => number;\n launchUri: (uri: string, options?: any) => void;\n saveFile: (win: Window, blobData: any, blobOptions: any, fileName: string) => void;\n getApplicationVersion: () => string;\n supportsU2f: (win: Window) => boolean;\n supportsDuo: () => boolean;\n showToast: (type: 'error' | 'success' | 'warning' | 'info', title: string, text: string) => void;\n showDialog: (text: string, title?: string, confirmText?: string, cancelText?: string,\n type?: string) => Promise;\n isDev: () => boolean;\n isSelfHost: () => boolean;\n copyToClipboard: (text: string, options?: any) => void;\n}\n","import { Injectable } from '@angular/core';\n\nimport { ToasterService } from 'angular2-toaster';\n\nimport { I18nService } from '../../abstractions/i18n.service';\n\n@Injectable()\nexport class ValidationService {\n constructor(private toasterService: ToasterService, private i18nService: I18nService) { }\n\n showError(data: any): string[] {\n const defaultErrorMessage = this.i18nService.t('unexpectedError');\n const errors: string[] = [];\n\n if (data != null && typeof data === 'string') {\n errors.push(data);\n } else if (data == null || typeof data !== 'object') {\n errors.push(defaultErrorMessage);\n } else if (data.validationErrors == null) {\n errors.push(data.message ? data.message : defaultErrorMessage);\n } else {\n for (const key in data.validationErrors) {\n if (!data.validationErrors.hasOwnProperty(key)) {\n continue;\n }\n\n data.validationErrors[key].forEach((item: string) => {\n errors.push(item);\n });\n }\n }\n\n if (errors.length > 0) {\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'), errors[0]);\n }\n\n return errors;\n }\n}\n","import {\n Directive,\n ElementRef,\n Input,\n OnChanges,\n} from '@angular/core';\n\nimport { ValidationService } from '../services/validation.service';\r\n\r\n@Directive({\r\n selector: '[appApiAction]',\r\n})\r\nexport class ApiActionDirective implements OnChanges {\r\n @Input() appApiAction: Promise;\n\n constructor(private el: ElementRef, private validationService: ValidationService) { }\n\n ngOnChanges(changes: any) {\n if (this.appApiAction == null || this.appApiAction.then == null) {\r\n return;\r\n }\n\n this.el.nativeElement.loading = true;\n\r\n this.appApiAction.then((response: any) => {\n this.el.nativeElement.loading = false;\n }, (e: any) => {\n this.el.nativeElement.loading = false;\n this.validationService.showError(e);\n });\r\n }\r\n}\n","import { CipherString } from '../models/domain/cipherString';\r\nimport { SymmetricCryptoKey } from '../models/domain/symmetricCryptoKey';\r\n\r\nimport { ProfileOrganizationResponse } from '../models/response/profileOrganizationResponse';\r\n\r\nexport abstract class CryptoService {\r\n setKey: (key: SymmetricCryptoKey) => Promise;\r\n setKeyHash: (keyHash: string) => Promise<{}>;\r\n setEncKey: (encKey: string) => Promise<{}>;\r\n setEncPrivateKey: (encPrivateKey: string) => Promise<{}>;\r\n setOrgKeys: (orgs: ProfileOrganizationResponse[]) => Promise<{}>;\r\n getKey: () => Promise;\r\n getKeyHash: () => Promise;\r\n getEncKey: () => Promise;\r\n getPublicKey: () => Promise;\r\n getPrivateKey: () => Promise;\r\n getOrgKeys: () => Promise>;\r\n getOrgKey: (orgId: string) => Promise;\r\n hasKey: () => Promise;\r\n hasEncKey: () => Promise;\r\n clearKey: () => Promise;\r\n clearKeyHash: () => Promise;\r\n clearEncKey: (memoryOnly?: boolean) => Promise;\r\n clearKeyPair: (memoryOnly?: boolean) => Promise;\r\n clearOrgKeys: (memoryOnly?: boolean) => Promise;\r\n clearKeys: () => Promise;\r\n toggleKey: () => Promise;\r\n makeKey: (password: string, salt: string) => Promise;\r\n makeShareKey: () => Promise<[CipherString, SymmetricCryptoKey]>;\r\n makeKeyPair: (key?: SymmetricCryptoKey) => Promise<[string, CipherString]>;\r\n hashPassword: (password: string, key: SymmetricCryptoKey) => Promise;\r\n makeEncKey: (key: SymmetricCryptoKey) => Promise<[SymmetricCryptoKey, CipherString]>;\r\n encrypt: (plainValue: string | ArrayBuffer, key?: SymmetricCryptoKey) => Promise;\r\n encryptToBytes: (plainValue: ArrayBuffer, key?: SymmetricCryptoKey) => Promise;\r\n rsaEncrypt: (data: ArrayBuffer, publicKey?: ArrayBuffer, key?: SymmetricCryptoKey) => Promise;\r\n decryptToUtf8: (cipherString: CipherString, key?: SymmetricCryptoKey) => Promise;\r\n decryptFromBytes: (encBuf: ArrayBuffer, key: SymmetricCryptoKey) => Promise;\r\n randomNumber: (min: number, max: number) => Promise;\r\n}\r\n","import { OrganizationData } from '../models/data/organizationData';\nimport { Organization } from '../models/domain/organization';\n\nexport abstract class UserService {\n userId: string;\n email: string;\n stamp: string;\n\n setUserIdAndEmail: (userId: string, email: string) => Promise;\n setSecurityStamp: (stamp: string) => Promise;\n getUserId: () => Promise;\n getEmail: () => Promise;\n getSecurityStamp: () => Promise;\n clear: () => Promise;\n isAuthenticated: () => Promise;\n getOrganization: (id: string) => Promise;\n getAllOrganizations: () => Promise;\n replaceOrganizations: (organizations: { [id: string]: OrganizationData; }) => Promise;\n clearOrganizations: (userId: string) => Promise;\n}\n","import { CipherType } from '../enums/cipherType';\n\nimport { CipherData } from '../models/data/cipherData';\n\nimport { Cipher } from '../models/domain/cipher';\nimport { Field } from '../models/domain/field';\nimport { SymmetricCryptoKey } from '../models/domain/symmetricCryptoKey';\n\nimport { AttachmentView } from '../models/view/attachmentView';\nimport { CipherView } from '../models/view/cipherView';\nimport { FieldView } from '../models/view/fieldView';\n\nexport abstract class CipherService {\n decryptedCipherCache: CipherView[];\n\n clearCache: () => void;\n encrypt: (model: CipherView, key?: SymmetricCryptoKey) => Promise;\n encryptFields: (fieldsModel: FieldView[], key: SymmetricCryptoKey) => Promise;\n encryptField: (fieldModel: FieldView, key: SymmetricCryptoKey) => Promise;\n get: (id: string) => Promise;\n getAll: () => Promise;\n getAllDecrypted: () => Promise;\n getAllDecryptedForGrouping: (groupingId: string, folder?: boolean) => Promise;\n getAllDecryptedForUrl: (url: string, includeOtherTypes?: CipherType[]) => Promise;\n getLastUsedForUrl: (url: string) => Promise;\n updateLastUsedDate: (id: string) => Promise;\n saveNeverDomain: (domain: string) => Promise;\n saveWithServer: (cipher: Cipher) => Promise;\n shareWithServer: (cipher: CipherView, organizationId: string, collectionIds: string[]) => Promise;\n shareManyWithServer: (ciphers: CipherView[], organizationId: string, collectionIds: string[]) => Promise;\n shareAttachmentWithServer: (attachmentView: AttachmentView, cipherId: string,\n organizationId: string) => Promise;\n saveAttachmentWithServer: (cipher: Cipher, unencryptedFile: any, admin?: boolean) => Promise;\n saveAttachmentRawWithServer: (cipher: Cipher, filename: string, data: ArrayBuffer,\n admin?: boolean) => Promise;\n saveCollectionsWithServer: (cipher: Cipher) => Promise;\n upsert: (cipher: CipherData | CipherData[]) => Promise;\n replace: (ciphers: { [id: string]: CipherData; }) => Promise;\n clear: (userId: string) => Promise;\n moveManyWithServer: (ids: string[], folderId: string) => Promise;\n delete: (id: string | string[]) => Promise;\n deleteWithServer: (id: string) => Promise;\n deleteManyWithServer: (ids: string[]) => Promise;\n deleteAttachment: (id: string, attachmentId: string) => Promise;\n deleteAttachmentWithServer: (id: string, attachmentId: string) => Promise;\n sortCiphersByLastUsed: (a: any, b: any) => number;\n sortCiphersByLastUsedThenName: (a: any, b: any) => number;\n getLocaleSortingFunction: () => (a: CipherView, b: CipherView) => number;\n}\n","export abstract class MessagingService {\r\n send: (subscriber: string, arg?: any) => void;\r\n}\r\n","import { CipherView } from '../view/cipherView';\nimport { CollectionView } from '../view/collectionView';\nimport { FolderView } from '../view/folderView';\n\nexport class ImportResult {\n success = false;\n errorMessage: string;\n ciphers: CipherView[] = [];\n folders: FolderView[] = [];\n folderRelationships: Array<[number, number]> = [];\n collections: CollectionView[] = [];\n collectionRelationships: Array<[number, number]> = [];\n}\n","import * as papa from 'papaparse';\r\n\r\nimport { ImportResult } from '../models/domain/importResult';\r\n\r\nimport { CipherView } from '../models/view/cipherView';\r\nimport { CollectionView } from '../models/view/collectionView';\r\nimport { LoginUriView } from '../models/view/loginUriView';\r\n\r\nimport { Utils } from '../misc/utils';\r\n\r\nimport { FieldView } from '../models/view/fieldView';\r\nimport { FolderView } from '../models/view/folderView';\r\nimport { LoginView } from '../models/view/loginView';\r\nimport { SecureNoteView } from '../models/view/secureNoteView';\r\n\r\nimport { CipherType } from '../enums/cipherType';\r\nimport { FieldType } from '../enums/fieldType';\r\nimport { SecureNoteType } from '../enums/secureNoteType';\r\n\r\nexport abstract class BaseImporter {\r\n organization = false;\r\n\r\n protected newLineRegex = /(?:\\r\\n|\\r|\\n)/;\r\n\r\n protected passwordFieldNames = [\r\n 'password', 'pass word', 'passphrase', 'pass phrase',\r\n 'pass', 'code', 'code word', 'codeword',\r\n 'secret', 'secret word', 'personpwd',\r\n 'key', 'keyword', 'key word', 'keyphrase', 'key phrase',\r\n 'form_pw', 'wppassword', 'pin', 'pwd', 'pw', 'pword', 'passwd',\r\n 'p', 'serial', 'serial#', 'license key', 'reg #',\r\n\r\n // Non-English names\r\n 'passwort',\r\n ];\r\n\r\n protected usernameFieldNames = [\r\n 'user', 'name', 'user name', 'username', 'login name',\r\n 'email', 'e-mail', 'id', 'userid', 'user id',\r\n 'login', 'form_loginname', 'wpname', 'mail',\r\n 'loginid', 'login id', 'log', 'personlogin',\r\n 'first name', 'last name', 'card#', 'account #',\r\n 'member', 'member #',\r\n\r\n // Non-English names\r\n 'nom', 'benutzername',\r\n ];\r\n\r\n protected notesFieldNames = [\r\n 'note', 'notes', 'comment', 'comments', 'memo',\r\n 'description', 'free form', 'freeform',\r\n 'free text', 'freetext', 'free',\r\n\r\n // Non-English names\r\n 'kommentar',\r\n ];\r\n\r\n protected uriFieldNames: string[] = [\r\n 'url', 'hyper link', 'hyperlink', 'link',\r\n 'host', 'hostname', 'host name', 'server', 'address',\r\n 'hyper ref', 'href', 'web', 'website', 'web site', 'site',\r\n 'web-site', 'uri',\r\n\r\n // Non-English names\r\n 'ort', 'adresse',\r\n ];\r\n\r\n protected parseXml(data: string): Document {\r\n const parser = new DOMParser();\r\n const doc = parser.parseFromString(data, 'application/xml');\r\n return doc != null && doc.querySelector('parsererror') == null ? doc : null;\r\n }\r\n\r\n protected parseCsv(data: string, header: boolean): any[] {\r\n data = this.splitNewLine(data).join('\\n').trim();\r\n const result = papa.parse(data, {\r\n header: header,\r\n encoding: 'UTF-8',\r\n skipEmptyLines: false,\r\n });\r\n if (result.errors != null && result.errors.length > 0) {\r\n result.errors.forEach((e) => {\r\n // tslint:disable-next-line\r\n console.warn('Error parsing row ' + e.row + ': ' + e.message);\r\n });\r\n }\r\n return result.data && result.data.length > 0 ? result.data : null;\r\n }\r\n\r\n protected parseSingleRowCsv(rowData: string) {\r\n if (this.isNullOrWhitespace(rowData)) {\r\n return null;\r\n }\r\n const parsedRow = this.parseCsv(rowData, false);\r\n if (parsedRow != null && parsedRow.length > 0 && parsedRow[0].length > 0) {\r\n return parsedRow[0];\r\n }\r\n return null;\r\n }\r\n\r\n protected makeUriArray(uri: string | string[]): LoginUriView[] {\r\n if (uri == null) {\r\n return null;\r\n }\r\n\r\n if (typeof uri === 'string') {\r\n const loginUri = new LoginUriView();\r\n loginUri.uri = this.fixUri(uri);\r\n if (this.isNullOrWhitespace(loginUri.uri)) {\r\n return null;\r\n }\r\n loginUri.match = null;\r\n return [loginUri];\r\n }\r\n\r\n if (uri.length > 0) {\r\n const returnArr: LoginUriView[] = [];\r\n uri.forEach((u) => {\r\n const loginUri = new LoginUriView();\r\n loginUri.uri = this.fixUri(u);\r\n if (this.isNullOrWhitespace(loginUri.uri)) {\r\n return;\r\n }\r\n loginUri.match = null;\r\n returnArr.push(loginUri);\r\n });\r\n return returnArr.length === 0 ? null : returnArr;\r\n }\r\n\r\n return null;\r\n }\r\n\r\n protected fixUri(uri: string) {\r\n if (uri == null) {\r\n return null;\r\n }\r\n uri = uri.toLowerCase().trim();\r\n if (uri.indexOf('://') === -1 && uri.indexOf('.') >= 0) {\r\n uri = 'http://' + uri;\r\n }\r\n if (uri.length > 1000) {\r\n return uri.substring(0, 1000);\r\n }\r\n return uri;\r\n }\r\n\r\n protected nameFromUrl(url: string) {\r\n const hostname = Utils.getHostname(url);\r\n if (this.isNullOrWhitespace(hostname)) {\r\n return null;\r\n }\r\n return hostname.startsWith('www.') ? hostname.replace('www.', '') : hostname;\r\n }\r\n\r\n protected isNullOrWhitespace(str: string): boolean {\r\n return str == null || str.trim() === '';\r\n }\r\n\r\n protected getValueOrDefault(str: string, defaultValue: string = null): string {\r\n if (this.isNullOrWhitespace(str)) {\r\n return defaultValue;\r\n }\r\n return str;\r\n }\r\n\r\n protected splitNewLine(str: string): string[] {\r\n return str.split(this.newLineRegex);\r\n }\r\n\r\n // ref https://stackoverflow.com/a/5911300\r\n protected getCardBrand(cardNum: string) {\r\n if (this.isNullOrWhitespace(cardNum)) {\r\n return null;\r\n }\r\n\r\n // Visa\r\n let re = new RegExp('^4');\r\n if (cardNum.match(re) != null) {\r\n return 'Visa';\r\n }\r\n\r\n // Mastercard\r\n // Updated for Mastercard 2017 BINs expansion\r\n if (/^(5[1-5][0-9]{14}|2(22[1-9][0-9]{12}|2[3-9][0-9]{13}|[3-6][0-9]{14}|7[0-1][0-9]{13}|720[0-9]{12}))$/\r\n .test(cardNum)) {\r\n return 'Mastercard';\r\n }\r\n\r\n // AMEX\r\n re = new RegExp('^3[47]');\r\n if (cardNum.match(re) != null) {\r\n return 'Amex';\r\n }\r\n\r\n // Discover\r\n re = new RegExp('^(6011|622(12[6-9]|1[3-9][0-9]|[2-8][0-9]{2}|9[0-1][0-9]|92[0-5]|64[4-9])|65)');\r\n if (cardNum.match(re) != null) {\r\n return 'Discover';\r\n }\r\n\r\n // Diners\r\n re = new RegExp('^36');\r\n if (cardNum.match(re) != null) {\r\n return 'Diners Club';\r\n }\r\n\r\n // Diners - Carte Blanche\r\n re = new RegExp('^30[0-5]');\r\n if (cardNum.match(re) != null) {\r\n return 'Diners Club';\r\n }\r\n\r\n // JCB\r\n re = new RegExp('^35(2[89]|[3-8][0-9])');\r\n if (cardNum.match(re) != null) {\r\n return 'JCB';\r\n }\r\n\r\n // Visa Electron\r\n re = new RegExp('^(4026|417500|4508|4844|491(3|7))');\r\n if (cardNum.match(re) != null) {\r\n return 'Visa';\r\n }\r\n\r\n return null;\r\n }\r\n\r\n protected moveFoldersToCollections(result: ImportResult) {\r\n result.folderRelationships.forEach((r) => result.collectionRelationships.push(r));\r\n result.collections = result.folders.map((f) => {\r\n const collection = new CollectionView();\r\n collection.name = f.name;\r\n return collection;\r\n });\r\n result.folderRelationships = [];\r\n result.folders = [];\r\n }\r\n\r\n protected querySelectorDirectChild(parentEl: Element, query: string) {\r\n const els = this.querySelectorAllDirectChild(parentEl, query);\r\n return els.length === 0 ? null : els[0];\r\n }\r\n\r\n protected querySelectorAllDirectChild(parentEl: Element, query: string) {\r\n return Array.from(parentEl.querySelectorAll(query)).filter((el) => el.parentNode === parentEl);\r\n }\r\n\r\n protected initLoginCipher() {\r\n const cipher = new CipherView();\r\n cipher.favorite = false;\r\n cipher.notes = '';\r\n cipher.fields = [];\r\n cipher.login = new LoginView();\r\n cipher.type = CipherType.Login;\r\n return cipher;\r\n }\r\n\r\n protected cleanupCipher(cipher: CipherView) {\r\n if (cipher == null) {\r\n return;\r\n }\r\n if (cipher.type !== CipherType.Login) {\r\n cipher.login = null;\r\n }\r\n if (this.isNullOrWhitespace(cipher.name)) {\r\n cipher.name = '--';\r\n }\r\n if (this.isNullOrWhitespace(cipher.notes)) {\r\n cipher.notes = null;\r\n } else {\r\n cipher.notes = cipher.notes.trim();\r\n }\r\n if (cipher.fields != null && cipher.fields.length === 0) {\r\n cipher.fields = null;\r\n }\r\n }\r\n\r\n protected processKvp(cipher: CipherView, key: string, value: string) {\r\n if (this.isNullOrWhitespace(value)) {\r\n return;\r\n }\r\n if (this.isNullOrWhitespace(key)) {\r\n key = '';\r\n }\r\n if (value.length > 200 || value.trim().search(this.newLineRegex) > -1) {\r\n if (cipher.notes == null) {\r\n cipher.notes = '';\r\n }\r\n cipher.notes += (key + ': ' + this.splitNewLine(value).join('\\n') + '\\n');\r\n } else {\r\n if (cipher.fields == null) {\r\n cipher.fields = [];\r\n }\r\n const field = new FieldView();\r\n field.type = FieldType.Text;\r\n field.name = key;\r\n field.value = value;\r\n cipher.fields.push(field);\r\n }\r\n }\r\n\r\n protected processFolder(result: ImportResult, folderName: string) {\r\n let folderIndex = result.folders.length;\r\n const hasFolder = !this.isNullOrWhitespace(folderName);\r\n let addFolder = hasFolder;\r\n\r\n if (hasFolder) {\r\n for (let i = 0; i < result.folders.length; i++) {\r\n if (result.folders[i].name === folderName) {\r\n addFolder = false;\r\n folderIndex = i;\r\n break;\r\n }\r\n }\r\n }\r\n\r\n if (addFolder) {\r\n const f = new FolderView();\r\n f.name = folderName;\r\n result.folders.push(f);\r\n }\r\n if (hasFolder) {\r\n result.folderRelationships.push([result.ciphers.length, folderIndex]);\r\n }\r\n }\r\n\r\n protected convertToNoteIfNeeded(cipher: CipherView) {\r\n if (cipher.type === CipherType.Login && this.isNullOrWhitespace(cipher.login.username) &&\r\n this.isNullOrWhitespace(cipher.login.password) &&\r\n (cipher.login.uris == null || cipher.login.uris.length === 0)) {\r\n cipher.type = CipherType.SecureNote;\r\n cipher.secureNote = new SecureNoteView();\r\n cipher.secureNote.type = SecureNoteType.Generic;\r\n }\r\n }\r\n}\r\n","export abstract class TokenService {\n token: string;\n decodedToken: any;\n refreshToken: string;\n setTokens: (accessToken: string, refreshToken: string) => Promise;\n setToken: (token: string) => Promise;\n getToken: () => Promise;\n setRefreshToken: (refreshToken: string) => Promise;\n getRefreshToken: () => Promise;\n setTwoFactorToken: (token: string, email: string) => Promise;\n getTwoFactorToken: (email: string) => Promise;\n clearTwoFactorToken: (email: string) => Promise;\n clearToken: () => Promise;\n decodeToken: () => any;\n getTokenExpirationDate: () => Date;\n tokenSecondsRemaining: (offsetSeconds?: number) => number;\n tokenNeedsRefresh: (minutes?: number) => boolean;\n getUserId: () => string;\n getEmail: () => string;\n getEmailVerified: () => boolean;\n getName: () => string;\n getPremium: () => boolean;\n getIssuer: () => string;\n}\n","import {\r\n Component,\r\n Input,\r\n OnInit,\r\n} from '@angular/core';\r\n\r\nimport { I18nService } from 'jslib/abstractions/i18n.service';\r\n\r\n@Component({\r\n selector: 'app-callout',\r\n templateUrl: 'callout.component.html',\r\n})\r\nexport class CalloutComponent implements OnInit {\r\n @Input() type = 'info';\r\n @Input() icon: string;\r\n @Input() title: string;\r\n\r\n calloutStyle: string;\r\n\r\n constructor(private i18nService: I18nService) { }\r\n\r\n ngOnInit() {\r\n this.calloutStyle = this.type;\r\n\r\n if (this.type === 'warning' || this.type === 'danger') {\r\n if (this.type === 'danger') {\r\n this.calloutStyle = 'danger';\r\n }\r\n if (this.title === undefined) {\r\n this.title = this.i18nService.t('warning');\r\n }\r\n if (this.icon === undefined) {\r\n this.icon = 'fa-warning';\r\n }\r\n } else if (this.type === 'error') {\r\n this.calloutStyle = 'danger';\r\n if (this.title === undefined) {\r\n this.title = this.i18nService.t('error');\r\n }\r\n if (this.icon === undefined) {\r\n this.icon = 'fa-bolt';\r\n }\r\n } else if (this.type === 'tip') {\r\n this.calloutStyle = 'success';\r\n if (this.title === undefined) {\r\n this.title = this.i18nService.t('tip');\r\n }\r\n if (this.icon === undefined) {\r\n this.icon = 'fa-lightbulb-o';\r\n }\r\n }\r\n }\r\n}\r\n","
\r\n

\r\n \r\n {{title}}\r\n

\r\n \r\n
\r\n","import { CollectionData } from '../models/data/collectionData';\n\nimport { Collection } from '../models/domain/collection';\n\nimport { CollectionView } from '../models/view/collectionView';\n\nexport abstract class CollectionService {\n decryptedCollectionCache: CollectionView[];\n\n clearCache: () => void;\n encrypt: (model: CollectionView) => Promise;\n decryptMany: (collections: Collection[]) => Promise;\n get: (id: string) => Promise;\n getAll: () => Promise;\n getAllDecrypted: () => Promise;\n upsert: (collection: CollectionData | CollectionData[]) => Promise;\n replace: (collections: { [id: string]: CollectionData; }) => Promise;\n clear: (userId: string) => Promise;\n delete: (id: string | string[]) => Promise;\n}\n","import {\n Directive,\n ElementRef,\n Input,\n Renderer2,\n} from '@angular/core';\n\n@Directive({\n selector: '[appInputVerbatim]',\n})\nexport class InputVerbatimDirective {\n @Input() set appInputVerbatim(condition: boolean | string) {\n this.disableComplete = condition === '' || condition === true;\n }\n\n private disableComplete: boolean;\n\n constructor(private el: ElementRef, private renderer: Renderer2) { }\n\n ngOnInit() {\n if (this.disableComplete && !this.el.nativeElement.hasAttribute('autocomplete')) {\n this.renderer.setAttribute(this.el.nativeElement, 'autocomplete', 'off');\n }\n if (!this.el.nativeElement.hasAttribute('autocapitalize')) {\n this.renderer.setAttribute(this.el.nativeElement, 'autocapitalize', 'none');\n }\n if (!this.el.nativeElement.hasAttribute('autocorrect')) {\n this.renderer.setAttribute(this.el.nativeElement, 'autocorrect', 'none');\n }\n if (!this.el.nativeElement.hasAttribute('spellcheck')) {\n this.renderer.setAttribute(this.el.nativeElement, 'spellcheck', 'false');\n }\n if (!this.el.nativeElement.hasAttribute('inputmode')) {\n this.renderer.setAttribute(this.el.nativeElement, 'inputmode', 'verbatim');\n }\n }\n}\n","import { I18nService } from '../abstractions/i18n.service';\n\n// tslint:disable-next-line\nconst nodeURL = typeof window === 'undefined' ? require('url').URL : null;\n\nexport class Utils {\n static inited = false;\n static isNode = false;\n static isBrowser = true;\n static global: NodeJS.Global | Window = null;\n\n static init() {\n if (Utils.inited) {\n return;\n }\n\n Utils.inited = true;\n Utils.isNode = typeof process !== 'undefined' && (process as any).release != null &&\n (process as any).release.name === 'node';\n Utils.isBrowser = typeof window !== 'undefined';\n Utils.global = Utils.isNode && !Utils.isBrowser ? global : window;\n }\n\n static fromB64ToArray(str: string): Uint8Array {\n if (Utils.isNode) {\n return new Uint8Array(Buffer.from(str, 'base64'));\n } else {\n const binaryString = window.atob(str);\n const bytes = new Uint8Array(binaryString.length);\n for (let i = 0; i < binaryString.length; i++) {\n bytes[i] = binaryString.charCodeAt(i);\n }\n return bytes;\n }\n }\n\n static fromHexToArray(str: string): Uint8Array {\n if (Utils.isNode) {\n return new Uint8Array(Buffer.from(str, 'hex'));\n } else {\n const bytes = new Uint8Array(str.length / 2);\n for (let i = 0; i < str.length; i += 2) {\n bytes[i / 2] = parseInt(str.substr(i, 2), 16);\n }\n return bytes;\n }\n }\n\n static fromUtf8ToArray(str: string): Uint8Array {\n if (Utils.isNode) {\n return new Uint8Array(Buffer.from(str, 'utf8'));\n } else {\n const strUtf8 = unescape(encodeURIComponent(str));\n const arr = new Uint8Array(strUtf8.length);\n for (let i = 0; i < strUtf8.length; i++) {\n arr[i] = strUtf8.charCodeAt(i);\n }\n return arr;\n }\n }\n\n static fromByteStringToArray(str: string): Uint8Array {\n const arr = new Uint8Array(str.length);\n for (let i = 0; i < str.length; i++) {\n arr[i] = str.charCodeAt(i);\n }\n return arr;\n }\n\n static fromBufferToB64(buffer: ArrayBuffer): string {\n if (Utils.isNode) {\n return new Buffer(buffer).toString('base64');\n } else {\n let binary = '';\n const bytes = new Uint8Array(buffer);\n for (let i = 0; i < bytes.byteLength; i++) {\n binary += String.fromCharCode(bytes[i]);\n }\n return window.btoa(binary);\n }\n }\n\n static fromBufferToUtf8(buffer: ArrayBuffer): string {\n if (Utils.isNode) {\n return new Buffer(buffer).toString('utf8');\n } else {\n const bytes = new Uint8Array(buffer);\n const encodedString = String.fromCharCode.apply(null, bytes);\n return decodeURIComponent(escape(encodedString));\n }\n }\n\n static fromBufferToByteString(buffer: ArrayBuffer): string {\n return String.fromCharCode.apply(null, new Uint8Array(buffer));\n }\n\n // ref: https://stackoverflow.com/a/40031979/1090359\n static fromBufferToHex(buffer: ArrayBuffer): string {\n if (Utils.isNode) {\n return new Buffer(buffer).toString('hex');\n } else {\n const bytes = new Uint8Array(buffer);\n return Array.prototype.map.call(bytes, (x: number) => ('00' + x.toString(16)).slice(-2)).join('');\n }\n }\n\n static fromUrlB64ToUtf8(b64Str: string): string {\n let output = b64Str.replace(/-/g, '+').replace(/_/g, '/');\n switch (output.length % 4) {\n case 0:\n break;\n case 2:\n output += '==';\n break;\n case 3:\n output += '=';\n break;\n default:\n throw new Error('Illegal base64url string!');\n }\n\n return Utils.fromB64ToUtf8(output);\n }\n\n static fromB64ToUtf8(b64Str: string): string {\n if (Utils.isNode) {\n return new Buffer(b64Str, 'base64').toString('utf8');\n } else {\n return decodeURIComponent(escape(window.atob(b64Str)));\n }\n }\n\n // ref: http://stackoverflow.com/a/2117523/1090359\n static newGuid(): string {\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {\n // tslint:disable-next-line\n const r = Math.random() * 16 | 0;\n // tslint:disable-next-line\n const v = c === 'x' ? r : (r & 0x3 | 0x8);\n return v.toString(16);\n });\n }\n\n static getHostname(uriString: string): string {\n const url = Utils.getUrl(uriString);\n return url != null ? url.hostname : null;\n }\n\n static getHost(uriString: string): string {\n const url = Utils.getUrl(uriString);\n return url != null ? url.host : null;\n }\n\n static getSortFunction(i18nService: I18nService, prop: string) {\n return (a: any, b: any) => {\n if (a[prop] == null && b[prop] != null) {\n return -1;\n }\n if (a[prop] != null && b[prop] == null) {\n return 1;\n }\n if (a[prop] == null && b[prop] == null) {\n return 0;\n }\n\n return i18nService.collator ? i18nService.collator.compare(a[prop], b[prop]) :\n a[prop].localeCompare(b[prop]);\n };\n }\n\n private static getUrl(uriString: string): URL {\n if (uriString == null) {\n return null;\n }\n\n uriString = uriString.trim();\n if (uriString === '') {\n return null;\n }\n\n if (uriString.indexOf('://') === -1 && uriString.indexOf('.') > -1) {\n uriString = 'http://' + uriString;\n }\n\n if (uriString.startsWith('http://') || uriString.startsWith('https://')) {\n try {\n if (nodeURL != null) {\n return new nodeURL(uriString);\n } else if (typeof URL === 'function') {\n return new URL(uriString);\n } else if (window != null) {\n const anchor = window.document.createElement('a');\n anchor.href = uriString;\n return anchor as any;\n }\n } catch (e) { }\n }\n\n return null;\n }\n}\n\nUtils.init();\n","import { FolderData } from '../models/data/folderData';\n\nimport { Folder } from '../models/domain/folder';\nimport { SymmetricCryptoKey } from '../models/domain/symmetricCryptoKey';\n\nimport { FolderView } from '../models/view/folderView';\n\nexport abstract class FolderService {\n decryptedFolderCache: FolderView[];\n\n clearCache: () => void;\n encrypt: (model: FolderView, key?: SymmetricCryptoKey) => Promise;\n get: (id: string) => Promise;\n getAll: () => Promise;\n getAllDecrypted: () => Promise;\n saveWithServer: (folder: Folder) => Promise;\n upsert: (folder: FolderData | FolderData[]) => Promise;\n replace: (folders: { [id: string]: FolderData; }) => Promise;\n clear: (userId: string) => Promise;\n delete: (id: string | string[]) => Promise;\n deleteWithServer: (id: string) => Promise;\n}\n","export enum CipherType {\r\n Login = 1,\r\n SecureNote = 2,\r\n Card = 3,\r\n Identity = 4,\r\n}\n","import {\n Directive,\n HostListener,\n} from '@angular/core';\r\n\r\n@Directive({\r\n selector: '[appStopClick]',\r\n})\r\nexport class StopClickDirective {\n @HostListener('click', ['$event']) onClick($event: MouseEvent) {\r\n $event.preventDefault();\r\n }\r\n}\n","export abstract class StateService {\r\n get: (key: string) => Promise;\r\n save: (key: string, obj: any) => Promise;\r\n remove: (key: string) => Promise;\r\n purge: () => Promise;\r\n}\r\n","export abstract class SyncService {\r\n syncInProgress: boolean;\n\r\n getLastSync: () => Promise;\r\n setLastSync: (date: Date) => Promise;\r\n syncStarted: () => void;\r\n syncCompleted: (successfully: boolean) => void;\r\n fullSync: (forceSync: boolean) => Promise;\r\n}\r\n","export class PasswordVerificationRequest {\n masterPasswordHash: string;\n}\n","export enum TwoFactorProviderType {\r\n Authenticator = 0,\r\n Email = 1,\r\n Duo = 2,\r\n Yubikey = 3,\n U2f = 4,\r\n Remember = 5,\r\n OrganizationDuo = 6,\r\n}\n","import {\n Directive,\n ElementRef,\n Input,\n} from '@angular/core';\n\n@Directive({\n selector: '[appAutofocus]',\n})\nexport class AutofocusDirective {\n @Input() set appAutofocus(condition: boolean | string) {\n this.autofocus = condition === '' || condition === true;\n }\n\n private autofocus: boolean;\n\n constructor(private el: ElementRef) { }\n\n ngOnInit() {\n if (this.autofocus) {\n this.el.nativeElement.focus();\n }\n }\n}\n","import { SecureNoteType } from '../../enums/secureNoteType';\r\n\r\nimport { View } from './view';\r\n\r\nimport { SecureNote } from '../domain/secureNote';\r\n\r\nexport class SecureNoteView implements View {\r\n type: SecureNoteType;\r\n\r\n constructor(n?: SecureNote) {\r\n if (!n) {\r\n return;\r\n }\r\n\r\n this.type = n.type;\r\n }\r\n\r\n get subTitle(): string {\r\n return null;\r\n }\r\n}\r\n","import {\n Directive,\n HostListener,\n} from '@angular/core';\r\n\r\n@Directive({\r\n selector: '[appStopProp]',\r\n})\r\nexport class StopPropDirective {\n @HostListener('click', ['$event']) onClick($event: MouseEvent) {\r\n $event.stopPropagation();\r\n }\r\n}\n","import * as jq from 'jquery';\r\n\r\nimport {\r\n Component,\r\n ComponentFactoryResolver,\r\n Type,\r\n ViewContainerRef,\r\n} from '@angular/core';\r\n\r\nimport { ModalComponent as BaseModalComponent } from 'jslib/angular/components/modal.component';\r\n\r\n@Component({\r\n selector: 'app-modal',\r\n template: ``,\r\n})\r\nexport class ModalComponent extends BaseModalComponent {\r\n el: any = null;\r\n\r\n constructor(componentFactoryResolver: ComponentFactoryResolver) {\r\n super(componentFactoryResolver);\r\n }\r\n\r\n ngOnDestroy() { /* Nothing */ }\r\n\r\n show(type: Type, parentContainer: ViewContainerRef, fade: boolean = true): T {\r\n this.parentContainer = parentContainer;\r\n this.fade = fade;\r\n\r\n const factory = this.componentFactoryResolver.resolveComponentFactory(type);\r\n const componentRef = this.container.createComponent(factory);\r\n\r\n const modals = Array.from(document.querySelectorAll('.modal'));\r\n if (modals.length > 0) {\r\n this.el = jq(modals[0]);\r\n this.el.modal('show');\r\n\r\n this.el.on('show.bs.modal', () => {\r\n this.onShow.emit();\r\n });\r\n this.el.on('shown.bs.modal', () => {\r\n this.onShown.emit();\r\n this.el.find('*[appAutoFocus]').focus();\r\n });\r\n this.el.on('hide.bs.modal', () => {\r\n this.onClose.emit();\r\n });\r\n this.el.on('hidden.bs.modal', () => {\r\n this.onClosed.emit();\r\n if (this.parentContainer != null) {\r\n this.parentContainer.clear();\r\n }\r\n });\r\n }\r\n\r\n return componentRef.instance;\r\n }\r\n\r\n close() {\r\n if (this.el != null) {\r\n this.el.modal('hide');\r\n }\r\n }\r\n}\r\n","import { PasswordHistory } from '../models/domain/passwordHistory';\r\n\r\nexport abstract class PasswordGenerationService {\r\n generatePassword: (options: any) => Promise;\r\n getOptions: () => any;\r\n saveOptions: (options: any) => Promise;\r\n getHistory: () => Promise;\r\n addHistory: (password: string) => Promise;\r\n clear: () => Promise;\r\n}\r\n","import { TwoFactorProviderType } from '../enums/twoFactorProviderType';\n\nimport { AuthResult } from '../models/domain/authResult';\n\nexport abstract class AuthService {\n email: string;\n masterPasswordHash: string;\n twoFactorProviders: Map;\n selectedTwoFactorProviderType: TwoFactorProviderType;\n\n logIn: (email: string, masterPassword: string) => Promise;\n logInTwoFactor: (twoFactorProvider: TwoFactorProviderType, twoFactorToken: string,\n remember?: boolean) => Promise;\n logInComplete: (email: string, masterPassword: string, twoFactorProvider: TwoFactorProviderType,\n twoFactorToken: string, remember?: boolean) => Promise;\n logOut: (callback: Function) => void;\n getSupportedTwoFactorProviders: (win: Window) => any[];\n getDefaultTwoFactorProvider: (u2fSupported: boolean) => TwoFactorProviderType;\n}\n","import { CipherString } from './cipherString';\n\nimport { View } from '../view/view';\n\nexport default abstract class Domain {\n protected buildDomainModel(domain: D, dataObj: any, map: any,\n alreadyEncrypted: boolean, notEncList: any[] = []) {\n for (const prop in map) {\n if (!map.hasOwnProperty(prop)) {\n continue;\n }\n\n const objProp = dataObj[(map[prop] || prop)];\n if (alreadyEncrypted === true || notEncList.indexOf(prop) > -1) {\n (domain as any)[prop] = objProp ? objProp : null;\n } else {\n (domain as any)[prop] = objProp ? new CipherString(objProp) : null;\n }\n }\n }\n protected buildDataModel(domain: D, dataObj: any, map: any, notCipherStringList: any[] = []) {\n for (const prop in map) {\n if (!map.hasOwnProperty(prop)) {\n continue;\n }\n\n const objProp = (domain as any)[(map[prop] || prop)];\n if (notCipherStringList.indexOf(prop) > -1) {\n (dataObj as any)[prop] = objProp != null ? objProp : null;\n } else {\n (dataObj as any)[prop] = objProp != null ? (objProp as CipherString).encryptedString : null;\n }\n }\n }\n\n protected async decryptObj(viewModel: T, map: any, orgId: string): Promise {\n const promises = [];\n const self: any = this;\n\n for (const prop in map) {\n if (!map.hasOwnProperty(prop)) {\n continue;\n }\n\n // tslint:disable-next-line\n (function (theProp) {\n const p = Promise.resolve().then(() => {\n const mapProp = map[theProp] || theProp;\n if (self[mapProp]) {\n return self[mapProp].decrypt(orgId);\n }\n return null;\n }).then((val: any) => {\n (viewModel as any)[theProp] = val;\n });\n promises.push(p);\n })(prop);\n }\n\n await Promise.all(promises);\n return viewModel;\n }\n}\n","export enum SecureNoteType {\r\n Generic = 0,\r\n}\r\n","export class ConstantsService {\r\n static readonly environmentUrlsKey: string = 'environmentUrls';\r\n static readonly disableGaKey: string = 'disableGa';\r\n static readonly disableAddLoginNotificationKey: string = 'disableAddLoginNotification';\r\n static readonly disableContextMenuItemKey: string = 'disableContextMenuItem';\r\n static readonly disableFaviconKey: string = 'disableFavicon';\r\n static readonly disableAutoTotpCopyKey: string = 'disableAutoTotpCopy';\r\n static readonly enableAutoFillOnPageLoadKey: string = 'enableAutoFillOnPageLoad';\r\n static readonly lockOptionKey: string = 'lockOption';\r\n static readonly lastActiveKey: string = 'lastActive';\r\n static readonly neverDomainsKey: string = 'neverDomains';\r\n static readonly installedVersionKey: string = 'installedVersion';\r\n static readonly localeKey: string = 'locale';\r\n static readonly themeKey: string = 'theme';\r\n\r\n readonly environmentUrlsKey: string = ConstantsService.environmentUrlsKey;\r\n readonly disableGaKey: string = ConstantsService.disableGaKey;\r\n readonly disableAddLoginNotificationKey: string = ConstantsService.disableAddLoginNotificationKey;\r\n readonly disableContextMenuItemKey: string = ConstantsService.disableContextMenuItemKey;\r\n readonly disableFaviconKey: string = ConstantsService.disableFaviconKey;\r\n readonly disableAutoTotpCopyKey: string = ConstantsService.disableAutoTotpCopyKey;\r\n readonly enableAutoFillOnPageLoadKey: string = ConstantsService.enableAutoFillOnPageLoadKey;\r\n readonly lockOptionKey: string = ConstantsService.lockOptionKey;\r\n readonly lastActiveKey: string = ConstantsService.lastActiveKey;\r\n readonly neverDomainsKey: string = ConstantsService.neverDomainsKey;\r\n readonly installedVersionKey: string = ConstantsService.installedVersionKey;\r\n readonly localeKey: string = ConstantsService.localeKey;\r\n readonly themeKey: string = ConstantsService.themeKey;\r\n}\r\n","import { CipherType } from '../../enums/cipherType';\n\nimport { AttachmentData } from './attachmentData';\nimport { CardData } from './cardData';\nimport { FieldData } from './fieldData';\nimport { IdentityData } from './identityData';\nimport { LoginData } from './loginData';\nimport { SecureNoteData } from './secureNoteData';\n\nimport { CipherResponse } from '../response/cipherResponse';\n\nexport class CipherData {\n id: string;\n organizationId: string;\n folderId: string;\n userId: string;\n edit: boolean;\n organizationUseTotp: boolean;\n favorite: boolean;\n revisionDate: Date;\n type: CipherType;\n sizeName: string;\n name: string;\n notes: string;\n login?: LoginData;\n secureNote?: SecureNoteData;\n card?: CardData;\n identity?: IdentityData;\n fields?: FieldData[];\n attachments?: AttachmentData[];\n collectionIds?: string[];\n\n constructor(response?: CipherResponse, userId?: string, collectionIds?: string[]) {\n if (response == null) {\n return;\n }\n\n this.id = response.id;\n this.organizationId = response.organizationId;\n this.folderId = response.folderId;\n this.userId = userId;\n this.edit = response.edit;\n this.organizationUseTotp = response.organizationUseTotp;\n this.favorite = response.favorite;\n this.revisionDate = response.revisionDate;\n this.type = response.type;\n this.name = response.name;\n this.notes = response.notes;\n\n if (collectionIds != null) {\n this.collectionIds = collectionIds;\n } else {\n this.collectionIds = response.collectionIds;\n }\n\n switch (this.type) {\n case CipherType.Login:\n this.login = new LoginData(response.login);\n break;\n case CipherType.SecureNote:\n this.secureNote = new SecureNoteData(response.secureNote);\n break;\n case CipherType.Card:\n this.card = new CardData(response.card);\n break;\n case CipherType.Identity:\n this.identity = new IdentityData(response.identity);\n break;\n default:\n break;\n }\n\n if (response.fields != null) {\n this.fields = [];\n response.fields.forEach((field) => {\n this.fields.push(new FieldData(field));\n });\n }\n\n if (response.attachments != null) {\n this.attachments = [];\n response.attachments.forEach((attachment) => {\n this.attachments.push(new AttachmentData(attachment));\n });\n }\n }\n}\n","import { View } from './view';\r\n\r\nimport { Card } from '../domain/card';\r\n\r\nexport class CardView implements View {\r\n cardholderName: string;\r\n expMonth: string = null;\r\n expYear: string;\r\n code: string;\r\n\r\n // tslint:disable\r\n private _brand: string = null;\r\n private _number: string;\r\n private _subTitle: string;\r\n // tslint:enable\r\n\r\n constructor(c?: Card) {\r\n // ctor\r\n }\r\n\r\n get maskedCode(): string {\r\n return this.code != null ? '•'.repeat(this.code.length) : null;\r\n }\r\n\r\n get brand(): string {\r\n return this._brand;\r\n }\r\n set brand(value: string) {\r\n this._brand = value;\r\n this._subTitle = null;\r\n }\r\n\r\n get number(): string {\r\n return this._number;\r\n }\r\n set number(value: string) {\r\n this._number = value;\r\n this._subTitle = null;\r\n }\r\n\r\n get subTitle(): string {\r\n if (this._subTitle == null) {\r\n this._subTitle = this.brand;\r\n if (this.number != null && this.number.length >= 4) {\r\n if (this._subTitle != null && this._subTitle !== '') {\r\n this._subTitle += ', ';\r\n } else {\r\n this._subTitle = '';\r\n }\r\n this._subTitle += ('*' + this.number.substr(this.number.length - 4));\r\n }\r\n }\r\n return this._subTitle;\r\n }\r\n\r\n get expiration(): string {\r\n if (!this.expMonth && !this.expYear) {\r\n return null;\r\n }\r\n\r\n let exp = this.expMonth != null ? ('0' + this.expMonth).slice(-2) : '__';\r\n exp += (' / ' + (this.expYear != null ? this.formatYear(this.expYear) : '____'));\r\n return exp;\r\n }\r\n\r\n private formatYear(year: string): string {\r\n return year.length === 2 ? '20' + year : year;\r\n }\r\n}\r\n","import {\r\n Component,\r\n Input,\r\n OnChanges,\r\n OnInit,\r\n} from '@angular/core';\r\nimport { DomSanitizer } from '@angular/platform-browser';\r\n\r\n@Component({\r\n selector: 'app-avatar',\r\n template: '',\r\n})\r\nexport class AvatarComponent implements OnChanges, OnInit {\r\n @Input() data: string;\r\n @Input() width = 45;\r\n @Input() height = 45;\r\n @Input() charCount = 2;\r\n @Input() textColor = '#ffffff';\r\n @Input() fontSize = 20;\r\n @Input() fontWeight = 300;\r\n @Input() dynamic = false;\r\n @Input() circle = false;\r\n\r\n src: string;\r\n\r\n constructor(public sanitizer: DomSanitizer) { }\r\n\r\n ngOnInit() {\r\n if (!this.dynamic) {\r\n this.generate();\r\n }\r\n }\r\n\r\n ngOnChanges() {\r\n if (this.dynamic) {\r\n this.generate();\r\n }\r\n }\r\n\r\n private generate() {\r\n let chars: string = null;\r\n const upperData = this.data.toUpperCase();\r\n\r\n if (this.charCount > 1) {\r\n chars = this.getFirstLetters(upperData, this.charCount);\r\n }\r\n if (chars == null) {\r\n chars = upperData.substr(0, this.charCount);\r\n }\r\n\r\n const charObj = this.getCharText(chars);\r\n const color = this.stringToColor(upperData);\r\n const svg = this.getSvg(this.width, this.height, color);\r\n svg.appendChild(charObj);\r\n const html = window.document.createElement('div').appendChild(svg).outerHTML;\r\n const svgHtml = window.btoa(unescape(encodeURIComponent(html)));\r\n this.src = 'data:image/svg+xml;base64,' + svgHtml;\r\n }\r\n\r\n private stringToColor(str: string): string {\r\n let hash = 0;\r\n for (let i = 0; i < str.length; i++) {\r\n // tslint:disable-next-line\r\n hash = str.charCodeAt(i) + ((hash << 5) - hash);\r\n }\r\n let color = '#';\r\n for (let i = 0; i < 3; i++) {\r\n // tslint:disable-next-line\r\n const value = (hash >> (i * 8)) & 0xFF;\r\n color += ('00' + value.toString(16)).substr(-2);\r\n }\r\n return color;\r\n }\r\n\r\n private getFirstLetters(data: string, count: number): string {\r\n const parts = data.split(' ');\r\n if (parts.length > 1) {\r\n let text = '';\r\n for (let i = 0; i < count; i++) {\r\n text += parts[i].substr(0, 1);\r\n }\r\n return text;\r\n }\r\n return null;\r\n }\r\n\r\n private getSvg(width: number, height: number, color: string): HTMLElement {\r\n const svgTag = window.document.createElement('svg');\r\n svgTag.setAttribute('xmlns', 'http://www.w3.org/2000/svg');\r\n svgTag.setAttribute('pointer-events', 'none');\r\n svgTag.setAttribute('width', width.toString());\r\n svgTag.setAttribute('height', height.toString());\r\n svgTag.style.backgroundColor = color;\r\n svgTag.style.width = width + 'px';\r\n svgTag.style.height = height + 'px';\r\n return svgTag;\r\n }\r\n\r\n private getCharText(character: string): HTMLElement {\r\n const textTag = window.document.createElement('text');\r\n textTag.setAttribute('text-anchor', 'middle');\r\n textTag.setAttribute('y', '50%');\r\n textTag.setAttribute('x', '50%');\r\n textTag.setAttribute('dy', '0.35em');\r\n textTag.setAttribute('pointer-events', 'auto');\r\n textTag.setAttribute('fill', this.textColor);\r\n textTag.setAttribute('font-family', '\"Open Sans\",\"Helvetica Neue\",Helvetica,Arial,' +\r\n 'sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",\"Segoe UI Symbol\"');\r\n textTag.textContent = character;\r\n textTag.style.fontWeight = this.fontWeight.toString();\r\n textTag.style.fontSize = this.fontSize + 'px';\r\n return textTag;\r\n }\r\n}\r\n","export abstract class StorageService {\r\n get: (key: string) => Promise;\r\n save: (key: string, obj: any) => Promise;\r\n remove: (key: string) => Promise;\r\n}\r\n","import {\n Component,\n EventEmitter,\n Input,\n Output,\n} from '@angular/core';\n\nimport { ToasterService } from 'angular2-toaster';\n\nimport { TwoFactorProviderType } from 'jslib/enums/twoFactorProviderType';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { CryptoService } from 'jslib/abstractions/crypto.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\n\nimport { PasswordVerificationRequest } from 'jslib/models/request/passwordVerificationRequest';\n\n@Component({\n selector: 'app-two-factor-verify',\n templateUrl: 'two-factor-verify.component.html',\n})\nexport class TwoFactorVerifyComponent {\n @Input() type: TwoFactorProviderType;\n @Input() organizationId: string;\n @Output() onAuthed = new EventEmitter();\n\n masterPassword: string;\n formPromise: Promise;\n\n private masterPasswordHash: string;\n\n constructor(private apiService: ApiService, private i18nService: I18nService,\n private toasterService: ToasterService, private cryptoService: CryptoService) { }\n\n async submit() {\n if (this.masterPassword == null || this.masterPassword === '') {\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'),\n this.i18nService.t('masterPassRequired'));\n return;\n }\n\n const request = new PasswordVerificationRequest();\n request.masterPasswordHash = this.masterPasswordHash =\n await this.cryptoService.hashPassword(this.masterPassword, null);\n\n try {\n switch (this.type) {\n case -1:\n this.formPromise = this.apiService.getTwoFactorRecover(request);\n break;\n case TwoFactorProviderType.Duo:\n case TwoFactorProviderType.OrganizationDuo:\n if (this.organizationId != null) {\n this.formPromise = this.apiService.getTwoFactorOrganizationDuo(this.organizationId, request);\n } else {\n this.formPromise = this.apiService.getTwoFactorDuo(request);\n }\n break;\n case TwoFactorProviderType.Email:\n this.formPromise = this.apiService.getTwoFactorEmail(request);\n break;\n case TwoFactorProviderType.U2f:\n this.formPromise = this.apiService.getTwoFactorU2f(request);\n break;\n case TwoFactorProviderType.Authenticator:\n this.formPromise = this.apiService.getTwoFactorAuthenticator(request);\n break;\n case TwoFactorProviderType.Yubikey:\n this.formPromise = this.apiService.getTwoFactorYubiKey(request);\n break;\n }\n\n const response = await this.formPromise;\n this.onAuthed.emit({\n response: response,\n masterPasswordHash: this.masterPasswordHash,\n });\n } catch { }\n }\n}\n","import { CollectionDetailsResponse } from '../response/collectionResponse';\n\nexport class CollectionData {\n id: string;\n organizationId: string;\n name: string;\n readOnly: boolean;\n\n constructor(response: CollectionDetailsResponse) {\n this.id = response.id;\n this.organizationId = response.organizationId;\n this.name = response.name;\n this.readOnly = response.readOnly;\n }\n}\n","import {\n Component,\n Input,\n OnInit,\n} from '@angular/core';\n\nimport { I18nService } from 'jslib/abstractions/i18n.service';\nimport { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';\n\nconst Keys = {\n stripeTest: 'pk_test_KPoCfZXu7mznb9uSCPZ2JpTD',\n stripeLive: 'pk_live_bpN0P37nMxrMQkcaHXtAybJk',\n btSandbox: 'sandbox_r72q8jq6_9pnxkwm75f87sdc2',\n btProduction: 'production_qfbsv8kc_njj2zjtyngtjmbjd',\n};\n\n@Component({\n selector: 'app-payment',\n templateUrl: 'payment.component.html',\n})\nexport class PaymentComponent implements OnInit {\n @Input() showOptions = true;\n @Input() method: 'card' | 'paypal' | 'bank' = 'card';\n @Input() hideBank = false;\n @Input() hidePaypal = false;\n\n card: any = {\n number: null,\n exp_month: null,\n exp_year: null,\n address_country: '',\n address_zip: null,\n };\n bank: any = {\n routing_number: null,\n account_number: null,\n account_holder_name: null,\n account_holder_type: '',\n currency: 'USD',\n country: 'US',\n };\n cardExpMonthOptions: any[];\n cardExpYearOptions: any[];\n\n private stripeScript: HTMLScriptElement;\n private btScript: HTMLScriptElement;\n private btInstance: any = null;\n\n constructor(i18nService: I18nService, private platformUtilsService: PlatformUtilsService) {\n this.stripeScript = window.document.createElement('script');\n this.stripeScript.src = 'https://js.stripe.com/v2/';\n this.stripeScript.async = true;\n this.stripeScript.onload = () => {\n (window as any).Stripe.setPublishableKey(\n this.platformUtilsService.isDev() ? Keys.stripeTest : Keys.stripeLive);\n };\n this.btScript = window.document.createElement('script');\n this.btScript.src = 'https://js.braintreegateway.com/web/dropin/1.4.0/js/dropin.min.js';\n this.btScript.async = true;\n\n this.cardExpMonthOptions = [\n { name: '-- ' + i18nService.t('select') + ' --', value: null },\n { name: '01 - ' + i18nService.t('january'), value: '01' },\n { name: '02 - ' + i18nService.t('february'), value: '02' },\n { name: '03 - ' + i18nService.t('march'), value: '03' },\n { name: '04 - ' + i18nService.t('april'), value: '04' },\n { name: '05 - ' + i18nService.t('may'), value: '05' },\n { name: '06 - ' + i18nService.t('june'), value: '06' },\n { name: '07 - ' + i18nService.t('july'), value: '07' },\n { name: '08 - ' + i18nService.t('august'), value: '08' },\n { name: '09 - ' + i18nService.t('september'), value: '09' },\n { name: '10 - ' + i18nService.t('october'), value: '10' },\n { name: '11 - ' + i18nService.t('november'), value: '11' },\n { name: '12 - ' + i18nService.t('december'), value: '12' },\n ];\n\n this.cardExpYearOptions = [\n { name: '-- ' + i18nService.t('select') + ' --', value: null },\n ];\n const year = (new Date()).getFullYear();\n for (let i = year; i < (year + 15); i++) {\n this.cardExpYearOptions.push({ name: i.toString(), value: i.toString().slice(-2) });\n }\n }\n\n ngOnInit() {\n if (!this.showOptions) {\n this.hidePaypal = this.method !== 'paypal';\n this.hideBank = this.method !== 'bank';\n }\n window.document.head.appendChild(this.stripeScript);\n if (!this.hidePaypal) {\n window.document.head.appendChild(this.btScript);\n }\n }\n\n ngOnDestroy() {\n window.document.head.removeChild(this.stripeScript);\n Array.from(window.document.querySelectorAll('iframe')).forEach((el) => {\n if (el.src != null && el.src.indexOf('stripe') > -1) {\n window.document.body.removeChild(el);\n }\n });\n if (!this.hidePaypal) {\n window.document.head.removeChild(this.btScript);\n const btStylesheet = window.document.head.querySelector('#braintree-dropin-stylesheet');\n if (btStylesheet != null) {\n window.document.head.removeChild(btStylesheet);\n }\n }\n }\n\n changeMethod() {\n if (this.method !== 'paypal') {\n this.btInstance = null;\n return;\n }\n\n window.setTimeout(() => {\n (window as any).braintree.dropin.create({\n authorization: this.platformUtilsService.isDev() ? Keys.btSandbox : Keys.btProduction,\n container: '#bt-dropin-container',\n paymentOptionPriority: ['paypal'],\n paypal: {\n flow: 'vault',\n buttonStyle: {\n label: 'pay',\n size: 'medium',\n shape: 'pill',\n color: 'blue',\n },\n },\n }, (createErr: any, instance: any) => {\n if (createErr != null) {\n // tslint:disable-next-line\n console.error(createErr);\n return;\n }\n this.btInstance = instance;\n });\n }, 250);\n }\n\n createPaymentToken(): Promise {\n return new Promise((resolve, reject) => {\n if (this.method === 'paypal') {\n this.btInstance.requestPaymentMethod().then((payload: any) => {\n resolve(payload.nonce);\n }).catch((err: any) => {\n reject(err.message);\n });\n } else if (this.method === 'card' || this.method === 'bank') {\n const createObj: any = this.method === 'card' ? (window as any).Stripe.card :\n (window as any).Stripe.bankAccount;\n const sourceObj = this.method === 'card' ? this.card : this.bank;\n createObj.createToken(sourceObj, (status: number, response: any) => {\n if (status === 200 && response.id != null) {\n resolve(response.id);\n } else if (response.error != null) {\n reject(response.error.message);\n } else {\n reject();\n }\n });\n }\n });\n }\n\n getCountry(): string {\n return this.card.address_country;\n }\n}\n","import { View } from './view';\r\n\r\nimport { Folder } from '../domain/folder';\r\n\r\nexport class FolderView implements View {\r\n id: string = null;\r\n name: string;\r\n\r\n constructor(f?: Folder) {\r\n if (!f) {\r\n return;\r\n }\r\n\r\n this.id = f.id;\r\n }\r\n}\r\n","import { BreachAccountResponse } from '../models/response/breachAccountResponse';\n\nexport abstract class AuditService {\n passwordLeaked: (password: string) => Promise;\n breachedAccounts: (username: string) => Promise;\n}\n","","export abstract class EnvironmentService {\n baseUrl: string;\n webVaultUrl: string;\n apiUrl: string;\n identityUrl: string;\n iconsUrl: string;\n\n getWebVaultUrl: () => string;\n setUrlsFromStorage: () => Promise;\n setUrls: (urls: any) => Promise;\n}\n","
\n
\n

{{'twoStepLoginAuthDesc' | i18n}}

\n \n \n
\n
\n \n \n
\n
\n","import { CipherType } from '../../enums/cipherType';\n\nimport { CipherData } from '../data/cipherData';\n\nimport { CipherView } from '../view/cipherView';\n\nimport { Attachment } from './attachment';\nimport { Card } from './card';\nimport { CipherString } from './cipherString';\nimport Domain from './domain';\nimport { Field } from './field';\nimport { Identity } from './identity';\nimport { Login } from './login';\nimport { SecureNote } from './secureNote';\n\nexport class Cipher extends Domain {\n id: string;\n organizationId: string;\n folderId: string;\n name: CipherString;\n notes: CipherString;\n type: CipherType;\n favorite: boolean;\n organizationUseTotp: boolean;\n edit: boolean;\n revisionDate: Date;\n localData: any;\n login: Login;\n identity: Identity;\n card: Card;\n secureNote: SecureNote;\n attachments: Attachment[];\n fields: Field[];\n collectionIds: string[];\n\n constructor(obj?: CipherData, alreadyEncrypted: boolean = false, localData: any = null) {\n super();\n if (obj == null) {\n return;\n }\n\n this.buildDomainModel(this, obj, {\n id: null,\n userId: null,\n organizationId: null,\n folderId: null,\n name: null,\n notes: null,\n }, alreadyEncrypted, ['id', 'userId', 'organizationId', 'folderId']);\n\n this.type = obj.type;\n this.favorite = obj.favorite;\n this.organizationUseTotp = obj.organizationUseTotp;\n this.edit = obj.edit;\n this.revisionDate = obj.revisionDate;\n this.collectionIds = obj.collectionIds;\n this.localData = localData;\n\n switch (this.type) {\n case CipherType.Login:\n this.login = new Login(obj.login, alreadyEncrypted);\n break;\n case CipherType.SecureNote:\n this.secureNote = new SecureNote(obj.secureNote, alreadyEncrypted);\n break;\n case CipherType.Card:\n this.card = new Card(obj.card, alreadyEncrypted);\n break;\n case CipherType.Identity:\n this.identity = new Identity(obj.identity, alreadyEncrypted);\n break;\n default:\n break;\n }\n\n if (obj.attachments != null) {\n this.attachments = [];\n obj.attachments.forEach((attachment) => {\n this.attachments.push(new Attachment(attachment, alreadyEncrypted));\n });\n } else {\n this.attachments = null;\n }\n\n if (obj.fields != null) {\n this.fields = [];\n obj.fields.forEach((field) => {\n this.fields.push(new Field(field, alreadyEncrypted));\n });\n } else {\n this.fields = null;\n }\n }\n\n async decrypt(): Promise {\n const model = new CipherView(this);\n\n await this.decryptObj(model, {\n name: null,\n notes: null,\n }, this.organizationId);\n\n switch (this.type) {\n case CipherType.Login:\n model.login = await this.login.decrypt(this.organizationId);\n break;\n case CipherType.SecureNote:\n model.secureNote = await this.secureNote.decrypt(this.organizationId);\n break;\n case CipherType.Card:\n model.card = await this.card.decrypt(this.organizationId);\n break;\n case CipherType.Identity:\n model.identity = await this.identity.decrypt(this.organizationId);\n break;\n default:\n break;\n }\n\n const orgId = this.organizationId;\n\n if (this.attachments != null && this.attachments.length > 0) {\n const attachments: any[] = [];\n await this.attachments.reduce((promise, attachment) => {\n return promise.then(() => {\n return attachment.decrypt(orgId);\n }).then((decAttachment) => {\n attachments.push(decAttachment);\n });\n }, Promise.resolve());\n model.attachments = attachments;\n }\n\n if (this.fields != null && this.fields.length > 0) {\n const fields: any[] = [];\n await this.fields.reduce((promise, field) => {\n return promise.then(() => {\n return field.decrypt(orgId);\n }).then((decField) => {\n fields.push(decField);\n });\n }, Promise.resolve());\n model.fields = fields;\n }\n\n return model;\n }\n\n toCipherData(userId: string): CipherData {\n const c = new CipherData();\n c.id = this.id;\n c.organizationId = this.organizationId;\n c.folderId = this.folderId;\n c.userId = this.organizationId != null ? userId : null;\n c.edit = this.edit;\n c.organizationUseTotp = this.organizationUseTotp;\n c.favorite = this.favorite;\n c.revisionDate = this.revisionDate;\n c.type = this.type;\n c.collectionIds = this.collectionIds;\n\n this.buildDataModel(this, c, {\n name: null,\n notes: null,\n });\n\n switch (c.type) {\n case CipherType.Login:\n c.login = this.login.toLoginData();\n break;\n case CipherType.SecureNote:\n c.secureNote = this.secureNote.toSecureNoteData();\n break;\n case CipherType.Card:\n c.card = this.card.toCardData();\n break;\n case CipherType.Identity:\n c.identity = this.identity.toIdentityData();\n break;\n default:\n break;\n }\n\n if (this.fields != null) {\n c.fields = [];\n this.fields.forEach((field) => {\n c.fields.push(field.toFieldData());\n });\n }\n\n if (this.attachments != null) {\n c.attachments = [];\n this.attachments.forEach((attachment) => {\n c.attachments.push(attachment.toAttachmentData());\n });\n }\n return c;\n }\n}\n","import { CollectionData } from '../data/collectionData';\n\nimport { CollectionView } from '../view/collectionView';\n\nimport { CipherString } from './cipherString';\nimport Domain from './domain';\n\nexport class Collection extends Domain {\n id: string;\n organizationId: string;\n name: CipherString;\n readOnly: boolean;\n\n constructor(obj?: CollectionData, alreadyEncrypted: boolean = false) {\n super();\n if (obj == null) {\n return;\n }\n\n this.buildDomainModel(this, obj, {\n id: null,\n organizationId: null,\n name: null,\n readOnly: null,\n }, alreadyEncrypted, ['id', 'organizationId', 'readOnly']);\n }\n\n decrypt(): Promise {\n return this.decryptObj(new CollectionView(this), {\n name: null,\n }, this.organizationId);\n }\n}\n","import { LoginUriView } from './loginUriView';\r\nimport { View } from './view';\r\n\r\nimport { Login } from '../domain/login';\r\n\r\nimport { PlatformUtilsService } from '../../abstractions/platformUtils.service';\r\n\r\nexport class LoginView implements View {\r\n username: string;\r\n password: string;\r\n totp: string;\r\n uris: LoginUriView[];\r\n\r\n constructor(l?: Login) {\r\n // ctor\r\n }\r\n\r\n get uri(): string {\r\n return this.hasUris ? this.uris[0].uri : null;\r\n }\r\n\r\n get maskedPassword(): string {\r\n return this.password != null ? '••••••••' : null;\r\n }\r\n\r\n get subTitle(): string {\r\n return this.username;\r\n }\r\n\r\n get canLaunch(): boolean {\r\n return this.hasUris && this.uris[0].canLaunch;\r\n }\r\n\r\n get hasUris(): boolean {\r\n return this.uris != null && this.uris.length > 0;\r\n }\r\n}\r\n","import { CipherType } from '../../enums/cipherType';\n\nimport { Cipher } from '../domain/cipher';\n\nimport { AttachmentView } from './attachmentView';\nimport { CardView } from './cardView';\nimport { FieldView } from './fieldView';\nimport { IdentityView } from './identityView';\nimport { LoginView } from './loginView';\nimport { SecureNoteView } from './secureNoteView';\nimport { View } from './view';\n\nexport class CipherView implements View {\n id: string;\n organizationId: string;\n folderId: string;\n name: string;\n notes: string;\n type: CipherType;\n favorite = false;\n organizationUseTotp = false;\n edit = false;\n localData: any;\n login: LoginView;\n identity: IdentityView;\n card: CardView;\n secureNote: SecureNoteView;\n attachments: AttachmentView[];\n fields: FieldView[];\n collectionIds: string[];\n\n constructor(c?: Cipher) {\n if (!c) {\n return;\n }\n\n this.id = c.id;\n this.organizationId = c.organizationId;\n this.folderId = c.folderId;\n this.favorite = c.favorite;\n this.organizationUseTotp = c.organizationUseTotp;\n this.edit = c.edit;\n this.type = c.type;\n this.localData = c.localData;\n this.collectionIds = c.collectionIds;\n }\n\n get subTitle(): string {\n switch (this.type) {\n case CipherType.Login:\n return this.login.subTitle;\n case CipherType.SecureNote:\n return this.secureNote.subTitle;\n case CipherType.Card:\n return this.card.subTitle;\n case CipherType.Identity:\n return this.identity.subTitle;\n default:\n break;\n }\n\n return null;\n }\n\n get hasAttachments(): boolean {\n return this.attachments && this.attachments.length > 0;\n }\n\n get hasFields(): boolean {\n return this.fields && this.fields.length > 0;\n }\n\n get login_username(): string {\n return this.login != null ? this.login.username : null;\n }\n}\n","import { CipherType } from '../../enums/cipherType';\n\nimport { Cipher } from '../domain/cipher';\n\nimport { CardApi } from '../api/cardApi';\nimport { FieldApi } from '../api/fieldApi';\nimport { IdentityApi } from '../api/identityApi';\nimport { LoginApi } from '../api/loginApi';\nimport { SecureNoteApi } from '../api/secureNoteApi';\n\nexport class CipherRequest {\n type: CipherType;\n folderId: string;\n organizationId: string;\n name: string;\n notes: string;\n favorite: boolean;\n login: LoginApi;\n secureNote: SecureNoteApi;\n card: CardApi;\n identity: IdentityApi;\n fields: FieldApi[];\n attachments: { [id: string]: string; };\n\n constructor(cipher: Cipher) {\n this.type = cipher.type;\n this.folderId = cipher.folderId;\n this.organizationId = cipher.organizationId;\n this.name = cipher.name ? cipher.name.encryptedString : null;\n this.notes = cipher.notes ? cipher.notes.encryptedString : null;\n this.favorite = cipher.favorite;\n\n switch (this.type) {\n case CipherType.Login:\n this.login = {\n uris: null,\n username: cipher.login.username ? cipher.login.username.encryptedString : null,\n password: cipher.login.password ? cipher.login.password.encryptedString : null,\n totp: cipher.login.totp ? cipher.login.totp.encryptedString : null,\n };\n\n if (cipher.login.uris) {\n this.login.uris = [];\n cipher.login.uris.forEach((u) => {\n this.login.uris.push({\n uri: u.uri ? u.uri.encryptedString : null,\n match: u.match != null ? u.match : null,\n });\n });\n }\n break;\n case CipherType.SecureNote:\n this.secureNote = {\n type: cipher.secureNote.type,\n };\n break;\n case CipherType.Card:\n this.card = {\n cardholderName: cipher.card.cardholderName ? cipher.card.cardholderName.encryptedString : null,\n brand: cipher.card.brand ? cipher.card.brand.encryptedString : null,\n number: cipher.card.number ? cipher.card.number.encryptedString : null,\n expMonth: cipher.card.expMonth ? cipher.card.expMonth.encryptedString : null,\n expYear: cipher.card.expYear ? cipher.card.expYear.encryptedString : null,\n code: cipher.card.code ? cipher.card.code.encryptedString : null,\n };\n break;\n case CipherType.Identity:\n this.identity = {\n title: cipher.identity.title ? cipher.identity.title.encryptedString : null,\n firstName: cipher.identity.firstName ? cipher.identity.firstName.encryptedString : null,\n middleName: cipher.identity.middleName ? cipher.identity.middleName.encryptedString : null,\n lastName: cipher.identity.lastName ? cipher.identity.lastName.encryptedString : null,\n address1: cipher.identity.address1 ? cipher.identity.address1.encryptedString : null,\n address2: cipher.identity.address2 ? cipher.identity.address2.encryptedString : null,\n address3: cipher.identity.address3 ? cipher.identity.address3.encryptedString : null,\n city: cipher.identity.city ? cipher.identity.city.encryptedString : null,\n state: cipher.identity.state ? cipher.identity.state.encryptedString : null,\n postalCode: cipher.identity.postalCode ? cipher.identity.postalCode.encryptedString : null,\n country: cipher.identity.country ? cipher.identity.country.encryptedString : null,\n company: cipher.identity.company ? cipher.identity.company.encryptedString : null,\n email: cipher.identity.email ? cipher.identity.email.encryptedString : null,\n phone: cipher.identity.phone ? cipher.identity.phone.encryptedString : null,\n ssn: cipher.identity.ssn ? cipher.identity.ssn.encryptedString : null,\n username: cipher.identity.username ? cipher.identity.username.encryptedString : null,\n passportNumber: cipher.identity.passportNumber ?\n cipher.identity.passportNumber.encryptedString : null,\n licenseNumber: cipher.identity.licenseNumber ? cipher.identity.licenseNumber.encryptedString : null,\n };\n break;\n default:\n break;\n }\n\n if (cipher.fields) {\n this.fields = [];\n cipher.fields.forEach((field) => {\n this.fields.push({\n type: field.type,\n name: field.name ? field.name.encryptedString : null,\n value: field.value ? field.value.encryptedString : null,\n });\n });\n }\n\n if (cipher.attachments) {\n this.attachments = {};\n cipher.attachments.forEach((attachment) => {\n this.attachments[attachment.id] = attachment.fileName ? attachment.fileName.encryptedString : null;\n });\n }\n }\n}\n","export enum DeviceType {\n Android = 0,\n iOS = 1,\n ChromeExtension = 2,\n FirefoxExtension = 3,\n OperaExtension = 4,\n EdgeExtension = 5,\n WindowsDesktop = 6,\n MacOsDesktop = 7,\n LinuxDesktop = 8,\n ChromeBrowser = 9,\n FirefoxBrowser = 10,\n OperaBrowser = 11,\n EdgeBrowser = 12,\n IEBrowser = 13,\n UnknownBrowser = 14,\n AndroidAmazon = 15,\n UWP = 16,\n SafariBrowser = 17,\n VivaldiBrowser = 18,\n VivaldiExtension = 19,\n SafariExtension = 20,\n}\n","import { Injectable } from '@angular/core';\n\n@Injectable()\nexport class BroadcasterService {\n subscribers: Map any> = new Map any>();\n\n send(message: any, id?: string) {\n if (id != null) {\n if (this.subscribers.has(id)) {\n this.subscribers.get(id)(message);\r\n }\n return;\r\n }\n\n this.subscribers.forEach((value) => {\n value(message);\n });\r\n }\n\n subscribe(id: string, messageCallback: (message: any) => any) {\n if (this.subscribers.has(id)) {\n return;\r\n }\n\n this.subscribers.set(id, messageCallback);\r\n }\n\n unsubscribe(id: string) {\n if (this.subscribers.has(id)) {\n this.subscribers.delete(id);\r\n }\r\n }\n}\r\n","export enum OrganizationUserType {\n Owner = 0,\n Admin = 1,\n User = 2,\n}\n","import { Injectable } from '@angular/core';\n\nimport { I18nService } from 'jslib/abstractions/i18n.service';\n\nimport { DeviceType } from 'jslib/enums/deviceType';\nimport { EventType } from 'jslib/enums/eventType';\n\nimport { EventResponse } from 'jslib/models/response/eventResponse';\n\n@Injectable()\nexport class EventService {\n constructor(private i18nService: I18nService) { }\n\n getDefaultDateFilters() {\n const d = new Date();\n const end = new Date(d.getFullYear(), d.getMonth(), d.getDate(), 23, 59);\n d.setDate(d.getDate() - 30);\n const start = new Date(d.getFullYear(), d.getMonth(), d.getDate(), 0, 0);\n return [this.toDateTimeLocalString(start), this.toDateTimeLocalString(end)];\n }\n\n formatDateFilters(filterStart: string, filterEnd: string) {\n const start: Date = new Date(filterStart);\n const end: Date = new Date(filterEnd + ':59.999');\n if (isNaN(start.getTime()) || isNaN(end.getTime()) || end < start) {\n throw new Error('Invalid date range.');\n }\n return [start.toISOString(), end.toISOString()];\n }\n\n getEventInfo(ev: EventResponse, options = new EventOptions()): EventInfo {\n const appInfo = this.getAppInfo(ev.deviceType);\n return {\n message: this.getEventMessage(ev, options),\n appIcon: appInfo[0],\n appName: appInfo[1],\n };\n }\n\n private getEventMessage(ev: EventResponse, options: EventOptions) {\n let msg = '';\n switch (ev.type) {\n // User\n case EventType.User_LoggedIn:\n msg = this.i18nService.t('loggedIn');\n break;\n case EventType.User_ChangedPassword:\n msg = this.i18nService.t('changedPassword');\n break;\n case EventType.User_Enabled2fa:\n msg = this.i18nService.t('enabled2fa');\n break;\n case EventType.User_Disabled2fa:\n msg = this.i18nService.t('disabled2fa');\n break;\n case EventType.User_Recovered2fa:\n msg = this.i18nService.t('recovered2fa');\n break;\n case EventType.User_FailedLogIn:\n msg = this.i18nService.t('failedLogin');\n break;\n case EventType.User_FailedLogIn2fa:\n msg = this.i18nService.t('failedLogin2fa');\n break;\n // Cipher\n case EventType.Cipher_Created:\n msg = this.i18nService.t('createdItemId', this.formatCipherId(ev, options));\n break;\n case EventType.Cipher_Updated:\n msg = this.i18nService.t('editedItemId', this.formatCipherId(ev, options));\n break;\n case EventType.Cipher_Deleted:\n msg = this.i18nService.t('deletedItemId', this.formatCipherId(ev, options));\n break;\n case EventType.Cipher_AttachmentCreated:\n msg = this.i18nService.t('createdAttachmentForItem', this.formatCipherId(ev, options));\n break;\n case EventType.Cipher_AttachmentDeleted:\n msg = this.i18nService.t('deletedAttachmentForItem', this.formatCipherId(ev, options));\n break;\n case EventType.Cipher_Shared:\n msg = this.i18nService.t('sharedItemId', this.formatCipherId(ev, options));\n break;\n case EventType.Cipher_UpdatedCollections:\n msg = this.i18nService.t('editedCollectionsForItem', this.formatCipherId(ev, options));\n break;\n // Collection\n case EventType.Collection_Created:\n msg = this.i18nService.t('createdCollectionId', this.formatCollectionId(ev));\n break;\n case EventType.Collection_Updated:\n msg = this.i18nService.t('editedCollectionId', this.formatCollectionId(ev));\n break;\n case EventType.Collection_Deleted:\n msg = this.i18nService.t('deletedCollectionId', this.formatCollectionId(ev));\n break;\n // Group\n case EventType.Group_Created:\n msg = this.i18nService.t('createdGroupId', this.formatGroupId(ev));\n break;\n case EventType.Group_Updated:\n msg = this.i18nService.t('editedGroupId', this.formatGroupId(ev));\n break;\n case EventType.Group_Deleted:\n msg = this.i18nService.t('deletedGroupId', this.formatGroupId(ev));\n break;\n // Org user\n case EventType.OrganizationUser_Invited:\n msg = this.i18nService.t('invitedUserId', this.formatOrgUserId(ev));\n break;\n case EventType.OrganizationUser_Confirmed:\n msg = this.i18nService.t('confirmedUserId', this.formatOrgUserId(ev));\n break;\n case EventType.OrganizationUser_Updated:\n msg = this.i18nService.t('editedUserId', this.formatOrgUserId(ev));\n break;\n case EventType.OrganizationUser_Removed:\n msg = this.i18nService.t('removedUserId', this.formatOrgUserId(ev));\n break;\n case EventType.OrganizationUser_UpdatedGroups:\n msg = this.i18nService.t('editedGroupsForUser', this.formatOrgUserId(ev));\n break;\n // Org\n case EventType.Organization_Updated:\n msg = this.i18nService.t('editedOrgSettings');\n break;\n default:\n break;\n }\n return msg === '' ? null : msg;\n }\n\n private getAppInfo(deviceType: DeviceType): [string, string] {\n switch (deviceType) {\n case DeviceType.Android:\n return ['fa-android', this.i18nService.t('mobile') + ' - Android'];\n case DeviceType.iOS:\n return ['fa-apple', this.i18nService.t('mobile') + ' - iOS'];\n case DeviceType.UWP:\n return ['fa-windows', this.i18nService.t('mobile') + ' - Windows'];\n case DeviceType.ChromeExtension:\n return ['fa-chrome', this.i18nService.t('extension') + ' - Chrome'];\n case DeviceType.FirefoxExtension:\n return ['fa-firefox', this.i18nService.t('extension') + ' - Firefox'];\n case DeviceType.OperaExtension:\n return ['fa-opera', this.i18nService.t('extension') + ' - Opera'];\n case DeviceType.EdgeExtension:\n return ['fa-edge', this.i18nService.t('extension') + ' - Edge'];\n case DeviceType.VivaldiExtension:\n return ['fa-puzzle-piece', this.i18nService.t('extension') + ' - Vivaldi'];\n case DeviceType.SafariExtension:\n return ['fa-safari', this.i18nService.t('extension') + ' - Safari'];\n case DeviceType.WindowsDesktop:\n return ['fa-windows', this.i18nService.t('desktop') + ' - Windows'];\n case DeviceType.MacOsDesktop:\n return ['fa-apple', this.i18nService.t('desktop') + ' - macOS'];\n case DeviceType.LinuxDesktop:\n return ['fa-linux', this.i18nService.t('desktop') + ' - Linux'];\n case DeviceType.ChromeBrowser:\n return ['fa-globe', this.i18nService.t('webVault') + ' - Chrome'];\n case DeviceType.FirefoxBrowser:\n return ['fa-globe', this.i18nService.t('webVault') + ' - Firefox'];\n case DeviceType.OperaBrowser:\n return ['fa-globe', this.i18nService.t('webVault') + ' - Opera'];\n case DeviceType.SafariBrowser:\n return ['fa-globe', this.i18nService.t('webVault') + ' - Safari'];\n case DeviceType.VivaldiBrowser:\n return ['fa-globe', this.i18nService.t('webVault') + ' - Vivaldi'];\n case DeviceType.EdgeBrowser:\n return ['fa-globe', this.i18nService.t('webVault') + ' - Edge'];\n case DeviceType.IEBrowser:\n return ['fa-globe', this.i18nService.t('webVault') + ' - IE'];\n case DeviceType.UnknownBrowser:\n return ['fa-globe', this.i18nService.t('webVault') + ' - ' + this.i18nService.t('unknown')];\n default:\n return ['fa-globe', this.i18nService.t('unknown')];\n }\n }\n\n private formatCipherId(ev: EventResponse, options: EventOptions) {\n const shortId = this.getShortId(ev.cipherId);\n if (ev.organizationId == null || !options.cipherInfo) {\n return '' + shortId + '';\n }\n const a = this.makeAnchor(shortId);\n a.setAttribute('href', '#/organizations/' + ev.organizationId + '/vault?search=' + shortId +\n '&viewEvents=' + ev.cipherId);\n return a.outerHTML;\n }\n\n private formatGroupId(ev: EventResponse) {\n const shortId = this.getShortId(ev.groupId);\n const a = this.makeAnchor(shortId);\n a.setAttribute('href', '#/organizations/' + ev.organizationId + '/manage/groups?search=' + shortId);\n return a.outerHTML;\n }\n\n private formatCollectionId(ev: EventResponse) {\n const shortId = this.getShortId(ev.collectionId);\n const a = this.makeAnchor(shortId);\n a.setAttribute('href', '#/organizations/' + ev.organizationId + '/manage/collections?search=' + shortId);\n return a.outerHTML;\n }\n\n private formatOrgUserId(ev: EventResponse) {\n const shortId = this.getShortId(ev.organizationUserId);\n const a = this.makeAnchor(shortId);\n a.setAttribute('href', '#/organizations/' + ev.organizationId + '/manage/people?search=' + shortId +\n '&viewEvents=' + ev.organizationUserId);\n return a.outerHTML;\n }\n\n private makeAnchor(shortId: string) {\n const a = document.createElement('a');\n a.title = this.i18nService.t('view');\n a.innerHTML = '' + shortId + '';\n return a;\n }\n\n private getShortId(id: string) {\n return id.substring(0, 8);\n }\n\n private toDateTimeLocalString(date: Date) {\n return date.getFullYear() +\n '-' + this.pad(date.getMonth() + 1) +\n '-' + this.pad(date.getDate()) +\n 'T' + this.pad(date.getHours()) +\n ':' + this.pad(date.getMinutes());\n }\n\n private pad(num: number) {\n const norm = Math.floor(Math.abs(num));\n return (norm < 10 ? '0' : '') + norm;\n }\n}\n\nexport class EventInfo {\n message: string;\n appIcon: string;\n appName: string;\n}\n\nexport class EventOptions {\n cipherInfo = true;\n}\n","export abstract class ExportService {\n getExport: (format?: 'csv' | 'json') => Promise;\n getOrganizationExport: (organizationId: string, format?: 'csv' | 'json') => Promise;\n getFileName: (prefix?: string) => string;\n}\n","import { View } from './view';\n\nimport { Collection } from '../domain/collection';\n\nexport class CollectionView implements View {\n id: string;\n organizationId: string;\n name: string;\n readOnly: boolean;\n\n constructor(c?: Collection) {\n if (!c) {\n return;\n }\n\n this.id = c.id;\n this.organizationId = c.organizationId;\n this.readOnly = c.readOnly;\n }\n}\n","import {\n EventEmitter,\n Output,\n} from '@angular/core';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\nimport { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';\n\nimport { TwoFactorProviderType } from 'jslib/enums/twoFactorProviderType';\nimport { TwoFactorProviderRequest } from 'jslib/models/request/twoFactorProviderRequest';\n\nexport abstract class TwoFactorBaseComponent {\n @Output() onUpdated = new EventEmitter();\n\n type: TwoFactorProviderType;\n organizationId: string;\n twoFactorProviderType = TwoFactorProviderType;\n enabled = false;\n authed = false;\n\n protected masterPasswordHash: string;\n\n constructor(protected apiService: ApiService, protected i18nService: I18nService,\n protected analytics: Angulartics2, protected toasterService: ToasterService,\n protected platformUtilsService: PlatformUtilsService) { }\n\n protected auth(authResponse: any) {\n this.masterPasswordHash = authResponse.masterPasswordHash;\n this.authed = true;\n }\n\n protected async enable(enableFunction: () => Promise) {\n try {\n await enableFunction();\n this.analytics.eventTrack.next({\n action: 'Enabled Two-step ' + TwoFactorProviderType[this.type].toString(),\n });\n this.onUpdated.emit(true);\n } catch { }\n }\n\n protected async disable(promise: Promise) {\n const confirmed = await this.platformUtilsService.showDialog(this.i18nService.t('twoStepDisableDesc'),\n this.i18nService.t('disable'), this.i18nService.t('yes'), this.i18nService.t('no'), 'warning');\n if (!confirmed) {\n return;\n }\n\n try {\n const request = new TwoFactorProviderRequest();\n request.masterPasswordHash = this.masterPasswordHash;\n request.type = this.type;\n if (this.organizationId != null) {\n promise = this.apiService.putTwoFactorOrganizationDisable(this.organizationId, request);\n } else {\n promise = this.apiService.putTwoFactorDisable(request);\n }\n await promise;\n this.enabled = false;\n this.analytics.eventTrack.next({\n action: 'Disabled Two-step ' + TwoFactorProviderType[this.type].toString(),\n });\n this.toasterService.popAsync('success', null, this.i18nService.t('twoStepDisabled'));\n this.onUpdated.emit(false);\n } catch { }\n }\n}\n","import { FieldType } from '../../enums/fieldType';\r\n\r\nimport { View } from './view';\r\n\r\nimport { Field } from '../domain/field';\r\n\r\nexport class FieldView implements View {\r\n name: string;\r\n value: string;\r\n type: FieldType;\r\n\r\n constructor(f?: Field) {\r\n if (!f) {\r\n return;\r\n }\r\n\r\n this.type = f.type;\r\n }\r\n\r\n get maskedValue(): string {\r\n return this.value != null ? '••••••••' : null;\r\n }\r\n}\r\n","export abstract class TotpService {\r\n getCode: (keyb32: string) => Promise;\r\n isAutoCopyEnabled: () => Promise;\r\n}\r\n","import {\n Component,\n Input,\n OnInit,\n} from '@angular/core';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\nimport { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';\nimport { SyncService } from 'jslib/abstractions/sync.service';\nimport { UserService } from 'jslib/abstractions/user.service';\n\nimport { Organization } from 'jslib/models/domain/organization';\n\nimport { Utils } from 'jslib/misc/utils';\n\n@Component({\n selector: 'app-organizations',\n templateUrl: 'organizations.component.html',\n})\nexport class OrganizationsComponent implements OnInit {\n @Input() vault = false;\n\n organizations: Organization[];\n loaded: boolean = false;\n actionPromise: Promise;\n\n constructor(private userService: UserService, private platformUtilsService: PlatformUtilsService,\n private i18nService: I18nService, private apiService: ApiService,\n private analytics: Angulartics2, private toasterService: ToasterService,\n private syncService: SyncService) { }\n\n async ngOnInit() {\n if (!this.vault) {\n await this.load();\n }\n }\n\n async load() {\n const orgs = await this.userService.getAllOrganizations();\n orgs.sort(Utils.getSortFunction(this.i18nService, 'name'));\n this.organizations = orgs;\n this.loaded = true;\n }\n\n async leave(org: Organization) {\n const confirmed = await this.platformUtilsService.showDialog(\n this.i18nService.t('leaveOrganizationConfirmation'), org.name,\n this.i18nService.t('yes'), this.i18nService.t('no'), 'warning');\n if (!confirmed) {\n return false;\n }\n\n try {\n this.actionPromise = this.apiService.postLeaveOrganization(org.id).then(() => {\n return this.syncService.fullSync(true);\n });\n await this.actionPromise;\n this.analytics.eventTrack.next({ action: 'Left Organization' });\n this.toasterService.popAsync('success', null, this.i18nService.t('leftOrganization'));\n await this.load();\n } catch { }\n }\n}\n","import { Injectable } from '@angular/core';\r\nimport { Title } from '@angular/platform-browser';\r\nimport {\r\n ActivatedRoute,\r\n NavigationEnd,\r\n Router,\r\n} from '@angular/router';\r\n\r\nimport { I18nService } from 'jslib/abstractions/i18n.service';\r\n\r\n@Injectable()\r\nexport class RouterService {\r\n private previousUrl: string = undefined;\r\n private currentUrl: string = undefined;\r\n\r\n constructor(private router: Router, private activatedRoute: ActivatedRoute,\r\n private titleService: Title, private i18nService: I18nService) {\r\n this.currentUrl = this.router.url;\r\n router.events.subscribe((event) => {\r\n if (event instanceof NavigationEnd) {\r\n this.previousUrl = this.currentUrl;\r\n this.currentUrl = event.url;\r\n\r\n let title = i18nService.t('pageTitle', 'Bitwarden');\r\n let titleId: string = null;\r\n let rawTitle: string = null;\r\n let child = this.activatedRoute.firstChild;\r\n while (child != null) {\r\n if (child.firstChild != null) {\r\n child = child.firstChild;\r\n } else if (child.snapshot.data != null && child.snapshot.data.title != null) {\r\n rawTitle = child.snapshot.data.title;\r\n break;\r\n } else if (child.snapshot.data != null && child.snapshot.data.titleId != null) {\r\n titleId = child.snapshot.data.titleId;\r\n break;\r\n } else {\r\n titleId = null;\r\n rawTitle = null;\r\n break;\r\n }\r\n }\r\n\r\n if (titleId != null || rawTitle != null) {\r\n const newTitle = rawTitle != null ? rawTitle : i18nService.t(titleId);\r\n if (newTitle != null && newTitle !== '') {\r\n title = (newTitle + ' | ' + title);\r\n }\r\n }\r\n this.titleService.setTitle(title);\r\n }\r\n });\r\n }\r\n\r\n getPreviousUrl() {\r\n return this.previousUrl;\r\n }\r\n}\r\n","import { EncryptionType } from '../../enums/encryptionType';\r\n\r\nimport { CryptoService } from '../../abstractions/crypto.service';\r\n\r\nimport { Utils } from '../../misc/utils';\r\n\r\nexport class CipherString {\r\n encryptedString?: string;\r\n encryptionType?: EncryptionType;\r\n decryptedValue?: string;\r\n data?: string;\r\n iv?: string;\r\n mac?: string;\r\n\r\n constructor(encryptedStringOrType: string | EncryptionType, data?: string, iv?: string, mac?: string) {\r\n if (data != null) {\r\n // data and header\r\n const encType = encryptedStringOrType as EncryptionType;\r\n this.encryptedString = encType + '.' + data;\r\n\r\n // iv\r\n if (iv != null) {\r\n this.encryptedString += ('|' + iv);\r\n }\r\n\r\n // mac\r\n if (mac != null) {\r\n this.encryptedString += ('|' + mac);\r\n }\r\n\r\n this.encryptionType = encType;\r\n this.data = data;\r\n this.iv = iv;\r\n this.mac = mac;\r\n\r\n return;\r\n }\r\n\r\n this.encryptedString = encryptedStringOrType as string;\r\n if (!this.encryptedString) {\r\n return;\r\n }\r\n\r\n const headerPieces = this.encryptedString.split('.');\r\n let encPieces: string[] = null;\r\n\r\n if (headerPieces.length === 2) {\r\n try {\r\n this.encryptionType = parseInt(headerPieces[0], null);\r\n encPieces = headerPieces[1].split('|');\r\n } catch (e) {\r\n return;\r\n }\r\n } else {\r\n encPieces = this.encryptedString.split('|');\r\n this.encryptionType = encPieces.length === 3 ? EncryptionType.AesCbc128_HmacSha256_B64 :\r\n EncryptionType.AesCbc256_B64;\r\n }\r\n\r\n switch (this.encryptionType) {\r\n case EncryptionType.AesCbc128_HmacSha256_B64:\r\n case EncryptionType.AesCbc256_HmacSha256_B64:\r\n if (encPieces.length !== 3) {\r\n return;\r\n }\r\n\r\n this.iv = encPieces[0];\r\n this.data = encPieces[1];\r\n this.mac = encPieces[2];\r\n break;\r\n case EncryptionType.AesCbc256_B64:\r\n if (encPieces.length !== 2) {\r\n return;\r\n }\r\n\r\n this.iv = encPieces[0];\r\n this.data = encPieces[1];\r\n break;\r\n case EncryptionType.Rsa2048_OaepSha256_B64:\r\n case EncryptionType.Rsa2048_OaepSha1_B64:\r\n if (encPieces.length !== 1) {\r\n return;\r\n }\r\n\r\n this.data = encPieces[0];\r\n break;\r\n default:\r\n return;\r\n }\r\n }\r\n\r\n async decrypt(orgId: string): Promise {\r\n if (this.decryptedValue) {\r\n return Promise.resolve(this.decryptedValue);\r\n }\r\n\r\n let cryptoService: CryptoService;\r\n const containerService = (Utils.global as any).bitwardenContainerService;\r\n if (containerService) {\r\n cryptoService = containerService.getCryptoService();\r\n } else {\r\n throw new Error('global bitwardenContainerService not initialized.');\r\n }\r\n\r\n try {\r\n const orgKey = await cryptoService.getOrgKey(orgId);\r\n this.decryptedValue = await cryptoService.decryptToUtf8(this, orgKey);\r\n } catch (e) {\r\n this.decryptedValue = '[error: cannot decrypt]';\r\n }\r\n return this.decryptedValue;\r\n }\r\n}\r\n","import { ToasterService } from 'angular2-toaster';\r\nimport { Angulartics2 } from 'angulartics2';\r\n\r\nimport { Component } from '@angular/core';\r\n\r\nimport { CryptoService } from 'jslib/abstractions/crypto.service';\r\nimport { ExportService } from 'jslib/abstractions/export.service';\r\nimport { I18nService } from 'jslib/abstractions/i18n.service';\r\nimport { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';\r\nimport { UserService } from 'jslib/abstractions/user.service';\r\n\r\nimport { ExportComponent as BaseExportComponent } from 'jslib/angular/components/export.component';\r\n\r\n@Component({\r\n selector: 'app-export',\r\n templateUrl: 'export.component.html',\r\n})\r\nexport class ExportComponent extends BaseExportComponent {\r\n constructor(analytics: Angulartics2, toasterService: ToasterService,\r\n cryptoService: CryptoService, userService: UserService,\r\n i18nService: I18nService, platformUtilsService: PlatformUtilsService,\r\n exportService: ExportService) {\r\n super(analytics, toasterService, cryptoService, userService, i18nService, platformUtilsService,\r\n exportService, window);\r\n }\r\n\r\n protected saved() {\r\n super.saved();\r\n this.masterPassword = null;\r\n this.toasterService.popAsync('success', null, this.i18nService.t('exportSuccess'));\r\n }\r\n}\r\n","import {\n Component,\n OnInit,\n} from '@angular/core';\nimport { Router } from '@angular/router';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { CipherService } from 'jslib/abstractions/cipher.service';\nimport { FolderService } from 'jslib/abstractions/folder.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\n\nimport { ImportResult } from 'jslib/models/domain/importResult';\n\nimport { CipherRequest } from 'jslib/models/request/cipherRequest';\nimport { FolderRequest } from 'jslib/models/request/folderRequest';\nimport { ImportCiphersRequest } from 'jslib/models/request/importCiphersRequest';\nimport { KvpRequest } from 'jslib/models/request/kvpRequest';\n\nimport { CipherView } from 'jslib/models/view/cipherView';\n\nimport { AscendoCsvImporter } from 'jslib/importers/ascendoCsvImporter';\nimport { AviraCsvImporter } from 'jslib/importers/aviraCsvImporter';\nimport { BitwardenCsvImporter } from 'jslib/importers/bitwardenCsvImporter';\nimport { BlurCsvImporter } from 'jslib/importers/blurCsvImporter';\nimport { ChromeCsvImporter } from 'jslib/importers/chromeCsvImporter';\nimport { ClipperzHtmlImporter } from 'jslib/importers/clipperzHtmlImporter';\nimport { DashlaneCsvImporter } from 'jslib/importers/dashlaneCsvImporter';\nimport { EnpassCsvImporter } from 'jslib/importers/enpassCsvImporter';\nimport { FirefoxCsvImporter } from 'jslib/importers/firefoxCsvImporter';\nimport { GnomeJsonImporter } from 'jslib/importers/gnomeJsonImporter';\nimport { Importer } from 'jslib/importers/importer';\nimport { KeePass2XmlImporter } from 'jslib/importers/keepass2XmlImporter';\nimport { KeePassXCsvImporter } from 'jslib/importers/keepassxCsvImporter';\nimport { KeeperCsvImporter } from 'jslib/importers/keeperCsvImporter';\nimport { LastPassCsvImporter } from 'jslib/importers/lastpassCsvImporter';\nimport { MeldiumCsvImporter } from 'jslib/importers/meldiumCsvImporter';\nimport { MSecureCsvImporter } from 'jslib/importers/msecureCsvImporter';\nimport { OnePassword1PifImporter } from 'jslib/importers/onepassword1PifImporter';\nimport { OnePasswordWinCsvImporter } from 'jslib/importers/onepasswordWinCsvImporter';\nimport { PadlockCsvImporter } from 'jslib/importers/padlockCsvImporter';\nimport { PassKeepCsvImporter } from 'jslib/importers/passkeepCsvImporter';\nimport { PasswordAgentCsvImporter } from 'jslib/importers/passwordAgentCsvImporter';\nimport { PasswordBossJsonImporter } from 'jslib/importers/passwordBossJsonImporter';\nimport { PasswordDragonXmlImporter } from 'jslib/importers/passwordDragonXmlImporter';\nimport { PasswordSafeXmlImporter } from 'jslib/importers/passwordSafeXmlImporter';\nimport { RoboFormCsvImporter } from 'jslib/importers/roboformCsvImporter';\nimport { SafeInCloudXmlImporter } from 'jslib/importers/safeInCloudXmlImporter';\nimport { SaferPassCsvImporter } from 'jslib/importers/saferpassCsvImport';\nimport { SplashIdCsvImporter } from 'jslib/importers/splashIdCsvImporter';\nimport { StickyPasswordXmlImporter } from 'jslib/importers/stickyPasswordXmlImporter';\nimport { TrueKeyCsvImporter } from 'jslib/importers/truekeyCsvImporter';\nimport { UpmCsvImporter } from 'jslib/importers/upmCsvImporter';\nimport { ZohoVaultCsvImporter } from 'jslib/importers/zohoVaultCsvImporter';\n\n@Component({\n selector: 'app-import',\n templateUrl: 'import.component.html',\n})\nexport class ImportComponent implements OnInit {\n featuredImportOptions: any[];\n importOptions: any[];\n format: string = null;\n fileContents: string;\n formPromise: Promise;\n\n protected successNavigate: any[] = ['vault'];\n\n constructor(protected i18nService: I18nService, protected analytics: Angulartics2,\n protected toasterService: ToasterService, protected cipherService: CipherService,\n protected folderService: FolderService, protected apiService: ApiService,\n protected router: Router) {\n }\n\n ngOnInit() {\n this.setImportOptions();\n this.importOptions.sort((a, b) => {\n if (a.name == null && b.name != null) {\n return -1;\n }\n if (a.name != null && b.name == null) {\n return 1;\n }\n if (a.name == null && b.name == null) {\n return 0;\n }\n\n return this.i18nService.collator ? this.i18nService.collator.compare(a.name, b.name) :\n a.name.localeCompare(b.name);\n });\n }\n\n async submit() {\n const importer = this.getImporter();\n if (importer === null) {\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'),\n this.i18nService.t('selectFormat'));\n return;\n }\n\n const fileEl = document.getElementById('file') as HTMLInputElement;\n const files = fileEl.files;\n if ((files == null || files.length === 0) && (this.fileContents == null || this.fileContents === '')) {\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'),\n this.i18nService.t('selectFile'));\n return;\n }\n\n let fileContents = this.fileContents;\n if (files != null && files.length > 0) {\n try {\n const content = await this.getFileContents(files[0]);\n if (content != null) {\n fileContents = content;\n }\n } catch { }\n }\n\n if (fileContents == null || fileContents === '') {\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'),\n this.i18nService.t('selectFile'));\n return;\n }\n\n const importResult = await importer.parse(fileContents);\n if (importResult.success) {\n if (importResult.folders.length === 0 && importResult.ciphers.length === 0) {\n this.error(this.i18nService.t('importNothingError'));\n return;\n } else if (importResult.ciphers.length > 0) {\n const halfway = Math.floor(importResult.ciphers.length / 2);\n const last = importResult.ciphers.length - 1;\n if (this.badData(importResult.ciphers[0]) && this.badData(importResult.ciphers[halfway]) &&\n this.badData(importResult.ciphers[last])) {\n this.error(this.i18nService.t('importFormatError'));\n return;\n }\n }\n\n try {\n this.formPromise = this.postImport(importResult);\n await this.formPromise;\n this.analytics.eventTrack.next({\n action: 'Imported Data',\n properties: { label: this.format },\n });\n this.toasterService.popAsync('success', null, this.i18nService.t('importSuccess'));\n this.router.navigate(this.successNavigate);\n } catch { }\n } else {\n this.error(this.i18nService.t('importFormatError'));\n }\n }\n\n getFormatInstructionTitle() {\n if (this.format == null) {\n return null;\n }\n\n const results = this.featuredImportOptions.concat(this.importOptions).filter((o) => o.id === this.format);\n if (results.length > 0) {\n return this.i18nService.t('instructionsFor', results[0].name);\n }\n return null;\n }\n\n protected async postImport(importResult: ImportResult) {\n const request = new ImportCiphersRequest();\n for (let i = 0; i < importResult.ciphers.length; i++) {\n const c = await this.cipherService.encrypt(importResult.ciphers[i]);\n request.ciphers.push(new CipherRequest(c));\n }\n if (importResult.folders != null) {\n for (let i = 0; i < importResult.folders.length; i++) {\n const f = await this.folderService.encrypt(importResult.folders[i]);\n request.folders.push(new FolderRequest(f));\n }\n }\n if (importResult.folderRelationships != null) {\n importResult.folderRelationships.forEach((r) =>\n request.folderRelationships.push(new KvpRequest(r[0], r[1])));\n }\n return await this.apiService.postImportCiphers(request);\n }\n\n protected setImportOptions() {\n this.featuredImportOptions = [\n { id: null, name: '-- ' + this.i18nService.t('select') + ' --' },\n { id: 'bitwardencsv', name: 'Bitwarden (csv)' },\n { id: 'lastpasscsv', name: 'LastPass (csv)' },\n { id: 'chromecsv', name: 'Chrome (csv)' },\n { id: 'firefoxcsv', name: 'Firefox (csv)' },\n { id: 'keepass2xml', name: 'KeePass 2 (xml)' },\n { id: '1password1pif', name: '1Password (1pif)' },\n { id: 'dashlanecsv', name: 'Dashlane (csv)' },\n ];\n\n this.importOptions = [\n { id: 'keepassxcsv', name: 'KeePassX (csv)' },\n { id: '1passwordwincsv', name: '1Password 6 and 7 Windows (csv)' },\n { id: 'roboformcsv', name: 'RoboForm (csv)' },\n { id: 'keepercsv', name: 'Keeper (csv)' },\n { id: 'enpasscsv', name: 'Enpass (csv)' },\n { id: 'safeincloudxml', name: 'SafeInCloud (xml)' },\n { id: 'pwsafexml', name: 'Password Safe (xml)' },\n { id: 'stickypasswordxml', name: 'Sticky Password (xml)' },\n { id: 'msecurecsv', name: 'mSecure (csv)' },\n { id: 'truekeycsv', name: 'True Key (csv)' },\n { id: 'passwordbossjson', name: 'Password Boss (json)' },\n { id: 'zohovaultcsv', name: 'Zoho Vault (csv)' },\n { id: 'splashidcsv', name: 'SplashID (csv)' },\n { id: 'passworddragonxml', name: 'Password Dragon (xml)' },\n { id: 'padlockcsv', name: 'Padlock (csv)' },\n { id: 'passboltcsv', name: 'Passbolt (csv)' },\n { id: 'clipperzhtml', name: 'Clipperz (html)' },\n { id: 'aviracsv', name: 'Avira (csv)' },\n { id: 'saferpasscsv', name: 'SaferPass (csv)' },\n { id: 'upmcsv', name: 'Universal Password Manager (csv)' },\n { id: 'ascendocsv', name: 'Ascendo DataVault (csv)' },\n { id: 'meldiumcsv', name: 'Meldium (csv)' },\n { id: 'passkeepcsv', name: 'PassKeep (csv)' },\n { id: 'operacsv', name: 'Opera (csv)' },\n { id: 'vivaldicsv', name: 'Vivaldi (csv)' },\n { id: 'gnomejson', name: 'GNOME Passwords and Keys/Seahorse (json)' },\n { id: 'blurcsv', name: 'Blur (csv)' },\n { id: 'passwordagentcsv', name: 'Password Agent (csv)' },\n ];\n }\n\n protected getImporter(): Importer {\n if (this.format == null || this.format === '') {\n return null;\n }\n\n switch (this.format) {\n case 'bitwardencsv':\n return new BitwardenCsvImporter();\n case 'lastpasscsv':\n case 'passboltcsv':\n return new LastPassCsvImporter();\n case 'keepassxcsv':\n return new KeePassXCsvImporter();\n case 'aviracsv':\n return new AviraCsvImporter();\n case 'blurcsv':\n return new BlurCsvImporter();\n case 'safeincloudxml':\n return new SafeInCloudXmlImporter();\n case 'padlockcsv':\n return new PadlockCsvImporter();\n case 'keepass2xml':\n return new KeePass2XmlImporter();\n case 'chromecsv':\n case 'operacsv':\n case 'vivaldicsv':\n return new ChromeCsvImporter();\n case 'firefoxcsv':\n return new FirefoxCsvImporter();\n case 'upmcsv':\n return new UpmCsvImporter();\n case 'saferpasscsv':\n return new SaferPassCsvImporter();\n case 'meldiumcsv':\n return new MeldiumCsvImporter();\n case '1password1pif':\n return new OnePassword1PifImporter();\n case '1passwordwincsv':\n return new OnePasswordWinCsvImporter();\n case 'keepercsv':\n return new KeeperCsvImporter();\n case 'passworddragonxml':\n return new PasswordDragonXmlImporter();\n case 'enpasscsv':\n return new EnpassCsvImporter();\n case 'pwsafexml':\n return new PasswordSafeXmlImporter();\n case 'dashlanecsv':\n return new DashlaneCsvImporter();\n case 'msecurecsv':\n return new MSecureCsvImporter();\n case 'stickypasswordxml':\n return new StickyPasswordXmlImporter();\n case 'truekeycsv':\n return new TrueKeyCsvImporter();\n case 'clipperzhtml':\n return new ClipperzHtmlImporter();\n case 'roboformcsv':\n return new RoboFormCsvImporter();\n case 'ascendocsv':\n return new AscendoCsvImporter();\n case 'passwordbossjson':\n return new PasswordBossJsonImporter();\n case 'zohovaultcsv':\n return new ZohoVaultCsvImporter();\n case 'splashidcsv':\n return new SplashIdCsvImporter();\n case 'passkeepcsv':\n return new PassKeepCsvImporter();\n case 'gnomejson':\n return new GnomeJsonImporter();\n case 'passwordagentcsv':\n return new PasswordAgentCsvImporter();\n default:\n return null;\n }\n }\n\n private error(errorMessage: string) {\n this.analytics.eventTrack.next({\n action: 'Import Data Failed',\n properties: { label: this.format },\n });\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'), errorMessage);\n }\n\n private getFileContents(file: File): Promise {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.readAsText(file, 'utf-8');\n reader.onload = (evt) => {\n if (this.format === 'lastpasscsv' && file.type === 'text/html') {\n const parser = new DOMParser();\n const doc = parser.parseFromString(evt.target.result, 'text/html');\n const pre = doc.querySelector('pre');\n if (pre != null) {\n resolve(pre.textContent);\n return;\n }\n reject();\n return;\n }\n\n resolve(evt.target.result);\n };\n reader.onerror = () => {\n reject();\n };\n });\n }\n\n private badData(c: CipherView) {\n return (c.name == null || c.name === '--') &&\n (c.login != null && (c.login.password == null || c.login.password === ''));\n }\n}\n","import {\n Component,\n ComponentFactoryResolver,\n OnInit,\n Type,\n ViewChild,\n ViewContainerRef,\n} from '@angular/core';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { MessagingService } from 'jslib/abstractions/messaging.service';\nimport { TokenService } from 'jslib/abstractions/token.service';\n\nimport { TwoFactorProviders } from 'jslib/services/auth.service';\n\nimport { TwoFactorProviderType } from 'jslib/enums/twoFactorProviderType';\n\nimport { ModalComponent } from '../modal.component';\n\nimport { TwoFactorAuthenticatorComponent } from './two-factor-authenticator.component';\nimport { TwoFactorDuoComponent } from './two-factor-duo.component';\nimport { TwoFactorEmailComponent } from './two-factor-email.component';\nimport { TwoFactorRecoveryComponent } from './two-factor-recovery.component';\nimport { TwoFactorU2fComponent } from './two-factor-u2f.component';\nimport { TwoFactorYubiKeyComponent } from './two-factor-yubikey.component';\n\n@Component({\n selector: 'app-two-factor-setup',\n templateUrl: 'two-factor-setup.component.html',\n})\nexport class TwoFactorSetupComponent implements OnInit {\n @ViewChild('recoveryTemplate', { read: ViewContainerRef }) recoveryModalRef: ViewContainerRef;\n @ViewChild('authenticatorTemplate', { read: ViewContainerRef }) authenticatorModalRef: ViewContainerRef;\n @ViewChild('yubikeyTemplate', { read: ViewContainerRef }) yubikeyModalRef: ViewContainerRef;\n @ViewChild('u2fTemplate', { read: ViewContainerRef }) u2fModalRef: ViewContainerRef;\n @ViewChild('duoTemplate', { read: ViewContainerRef }) duoModalRef: ViewContainerRef;\n @ViewChild('emailTemplate', { read: ViewContainerRef }) emailModalRef: ViewContainerRef;\n\n organizationId: string;\n providers: any[] = [];\n premium: boolean;\n loading = true;\n\n private modal: ModalComponent = null;\n\n constructor(protected apiService: ApiService, protected tokenService: TokenService,\n protected componentFactoryResolver: ComponentFactoryResolver, protected messagingService: MessagingService) { }\n\n async ngOnInit() {\n this.premium = this.tokenService.getPremium();\n\n for (const key in TwoFactorProviders) {\n if (!TwoFactorProviders.hasOwnProperty(key)) {\n continue;\n }\n\n const p = (TwoFactorProviders as any)[key];\n if (this.filterProvider(p.type)) {\n continue;\n }\n\n this.providers.push({\n type: p.type,\n name: p.name,\n description: p.description,\n enabled: false,\n premium: p.premium,\n sort: p.sort,\n });\n }\n\n this.providers.sort((a: any, b: any) => a.sort - b.sort);\n await this.load();\n }\n\n async load() {\n this.loading = true;\n const providerList = await this.getTwoFactorProviders();\n providerList.data.forEach((p) => {\n this.providers.forEach((p2) => {\n if (p.type === p2.type) {\n p2.enabled = p.enabled;\n }\n });\n });\n this.loading = false;\n }\n\n manage(type: TwoFactorProviderType) {\n switch (type) {\n case TwoFactorProviderType.Authenticator:\n const authComp = this.openModal(this.authenticatorModalRef, TwoFactorAuthenticatorComponent);\n authComp.onUpdated.subscribe((enabled: boolean) => {\n this.updateStatus(enabled, TwoFactorProviderType.Authenticator);\n });\n break;\n case TwoFactorProviderType.Yubikey:\n const yubiComp = this.openModal(this.yubikeyModalRef, TwoFactorYubiKeyComponent);\n yubiComp.onUpdated.subscribe((enabled: boolean) => {\n this.updateStatus(enabled, TwoFactorProviderType.Yubikey);\n });\n break;\n case TwoFactorProviderType.Duo:\n const duoComp = this.openModal(this.duoModalRef, TwoFactorDuoComponent);\n duoComp.onUpdated.subscribe((enabled: boolean) => {\n this.updateStatus(enabled, TwoFactorProviderType.Duo);\n });\n break;\n case TwoFactorProviderType.Email:\n const emailComp = this.openModal(this.emailModalRef, TwoFactorEmailComponent);\n emailComp.onUpdated.subscribe((enabled: boolean) => {\n this.updateStatus(enabled, TwoFactorProviderType.Email);\n });\n break;\n case TwoFactorProviderType.U2f:\n const u2fComp = this.openModal(this.u2fModalRef, TwoFactorU2fComponent);\n u2fComp.onUpdated.subscribe((enabled: boolean) => {\n this.updateStatus(enabled, TwoFactorProviderType.U2f);\n });\n break;\n default:\n break;\n }\n }\n\n recoveryCode() {\n this.openModal(this.recoveryModalRef, TwoFactorRecoveryComponent);\n }\n\n async premiumRequired() {\n const premium = await this.tokenService.getPremium();\n if (!premium) {\n this.messagingService.send('premiumRequired');\n return;\n }\n }\n\n protected getTwoFactorProviders() {\n return this.apiService.getTwoFactorProviders();\n }\n\n protected filterProvider(type: TwoFactorProviderType) {\n return type === TwoFactorProviderType.OrganizationDuo;\n }\n\n protected openModal(ref: ViewContainerRef, type: Type): T {\n if (this.modal != null) {\n this.modal.close();\n }\n\n const factory = this.componentFactoryResolver.resolveComponentFactory(ModalComponent);\n this.modal = ref.createComponent(factory).instance;\n const childComponent = this.modal.show(type, ref);\n\n this.modal.onClosed.subscribe(() => {\n this.modal = null;\n });\n return childComponent;\n }\n\n protected updateStatus(enabled: boolean, type: TwoFactorProviderType) {\n if (!enabled && this.modal != null) {\n this.modal.close();\n }\n this.providers.forEach((p) => {\n if (p.type === type) {\n p.enabled = enabled;\n }\n });\n }\n}\n","import { UriMatchType } from '../../enums/uriMatchType';\n\nimport { View } from './view';\n\nimport { LoginUri } from '../domain/loginUri';\n\nimport { PlatformUtilsService } from '../../abstractions/platformUtils.service';\n\nimport { Utils } from '../../misc/utils';\n\nexport class LoginUriView implements View {\n match: UriMatchType = null;\n\n // tslint:disable\n private _uri: string;\n private _domain: string;\n private _hostname: string;\n // tslint:enable\n\n constructor(u?: LoginUri) {\n if (!u) {\n return;\n }\n\n this.match = u.match;\n }\n\n get uri(): string {\n return this._uri;\n }\n set uri(value: string) {\n this._uri = value;\n this._domain = null;\n }\n\n get domain(): string {\n if (this._domain == null && this.uri != null) {\n const containerService = (Utils.global as any).bitwardenContainerService;\n if (containerService) {\n const platformUtilsService: PlatformUtilsService = containerService.getPlatformUtilsService();\n this._domain = platformUtilsService.getDomain(this.uri);\n if (this._domain === '') {\n this._domain = null;\n }\n } else {\n throw new Error('global bitwardenContainerService not initialized.');\n }\n }\n\n return this._domain;\n }\n\n get hostname(): string {\n if (this._hostname == null && this.uri != null) {\n this._hostname = Utils.getHostname(this.uri);\n if (this._hostname === '') {\n this._hostname = null;\n }\n }\n\n return this._hostname;\n }\n\n get hostnameOrUri(): string {\n return this.hostname != null ? this.hostname : this.uri;\n }\n\n get isWebsite(): boolean {\n return this.uri != null && (this.uri.indexOf('http://') === 0 || this.uri.indexOf('https://') === 0);\n }\n\n get canLaunch(): boolean {\n return this.uri != null && this.uri.indexOf('://') > -1;\n }\n}\n","import { View } from './view';\r\n\r\nimport { Identity } from '../domain/identity';\r\n\r\nexport class IdentityView implements View {\r\n title: string = null;\r\n middleName: string;\r\n address1: string;\r\n address2: string;\r\n address3: string;\r\n city: string;\r\n state: string;\r\n postalCode: string;\r\n country: string;\r\n company: string;\r\n email: string;\r\n phone: string;\r\n ssn: string;\r\n username: string;\r\n passportNumber: string;\r\n licenseNumber: string;\r\n\r\n // tslint:disable\r\n private _firstName: string;\r\n private _lastName: string;\r\n private _subTitle: string;\r\n // tslint:enable\r\n\r\n constructor(i?: Identity) {\r\n // ctor\r\n }\r\n\r\n get firstName(): string {\r\n return this._firstName;\r\n }\r\n set firstName(value: string) {\r\n this._firstName = value;\r\n this._subTitle = null;\r\n }\r\n\r\n get lastName(): string {\r\n return this._lastName;\r\n }\r\n set lastName(value: string) {\r\n this._lastName = value;\r\n this._subTitle = null;\r\n }\r\n\r\n get subTitle(): string {\r\n if (this._subTitle == null && (this.firstName != null || this.lastName != null)) {\r\n this._subTitle = '';\r\n if (this.firstName != null) {\r\n this._subTitle = this.firstName;\r\n }\r\n if (this.lastName != null) {\r\n if (this._subTitle !== '') {\r\n this._subTitle += ' ';\r\n }\r\n this._subTitle += this.lastName;\r\n }\r\n }\r\n\r\n return this._subTitle;\r\n }\r\n\r\n get fullName(): string {\r\n if (this.title != null || this.firstName != null || this.middleName != null || this.lastName != null) {\r\n let name = '';\r\n if (this.title != null) {\r\n name += (this.title + ' ');\r\n }\r\n if (this.firstName != null) {\r\n name += (this.firstName + ' ');\r\n }\r\n if (this.middleName != null) {\r\n name += (this.middleName + ' ');\r\n }\r\n if (this.lastName != null) {\r\n name += this.lastName;\r\n }\r\n return name.trim();\r\n }\r\n\r\n return null;\r\n }\r\n}\r\n","import {\r\n Component,\r\n EventEmitter,\r\n Input,\r\n Output,\r\n} from '@angular/core';\r\n\r\nimport { ToasterService } from 'angular2-toaster';\r\nimport { Angulartics2 } from 'angulartics2';\r\n\r\nimport { CipherService } from 'jslib/abstractions/cipher.service';\r\nimport { I18nService } from 'jslib/abstractions/i18n.service';\r\nimport { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';\r\n\r\nimport { CiphersComponent as BaseCiphersComponent } from 'jslib/angular/components/ciphers.component';\r\n\r\nimport { CipherType } from 'jslib/enums/cipherType';\r\n\r\nimport { CipherView } from 'jslib/models/view/cipherView';\r\n\r\nconst MaxCheckedCount = 500;\r\n\r\n@Component({\r\n selector: 'app-vault-ciphers',\r\n templateUrl: 'ciphers.component.html',\r\n})\r\nexport class CiphersComponent extends BaseCiphersComponent {\r\n @Input() showAddNew = true;\r\n @Output() onAttachmentsClicked = new EventEmitter();\r\n @Output() onShareClicked = new EventEmitter();\r\n @Output() onCollectionsClicked = new EventEmitter();\r\n\r\n cipherType = CipherType;\r\n\r\n constructor(cipherService: CipherService, protected analytics: Angulartics2,\r\n protected toasterService: ToasterService, protected i18nService: I18nService,\r\n protected platformUtilsService: PlatformUtilsService) {\r\n super(cipherService);\r\n }\r\n\r\n checkCipher(c: CipherView, select?: boolean) {\r\n (c as any).checked = select == null ? !(c as any).checked : select;\r\n }\r\n\r\n selectAll(select: boolean) {\r\n if (select) {\r\n this.selectAll(false);\r\n }\r\n const selectCount = select && this.ciphers.length > MaxCheckedCount ? MaxCheckedCount : this.ciphers.length;\r\n for (let i = 0; i < selectCount; i++) {\r\n this.checkCipher(this.ciphers[i], select);\r\n }\r\n }\r\n\r\n getSelected(): CipherView[] {\r\n if (this.ciphers == null) {\r\n return [];\r\n }\r\n return this.ciphers.filter((c) => !!(c as any).checked);\r\n }\r\n\r\n getSelectedIds(): string[] {\r\n return this.getSelected().map((c) => c.id);\r\n }\r\n\r\n attachments(c: CipherView) {\r\n this.onAttachmentsClicked.emit(c);\r\n }\r\n\r\n share(c: CipherView) {\r\n this.onShareClicked.emit(c);\r\n }\r\n\r\n collections(c: CipherView) {\r\n this.onCollectionsClicked.emit(c);\r\n }\r\n\r\n async delete(c: CipherView): Promise {\r\n const confirmed = await this.platformUtilsService.showDialog(\r\n this.i18nService.t('deleteItemConfirmation'), this.i18nService.t('deleteItem'),\r\n this.i18nService.t('yes'), this.i18nService.t('no'), 'warning');\r\n if (!confirmed) {\r\n return false;\r\n }\r\n\r\n await this.cipherService.deleteWithServer(c.id);\r\n this.analytics.eventTrack.next({ action: 'Deleted Cipher' });\r\n this.toasterService.popAsync('success', null, this.i18nService.t('deletedItem'));\r\n this.refresh();\r\n }\r\n\r\n copy(value: string, typeI18nKey: string, aType: string) {\r\n if (value == null) {\r\n return;\r\n }\r\n\r\n this.analytics.eventTrack.next({ action: 'Copied ' + aType.toLowerCase() + ' from listing.' });\r\n this.platformUtilsService.copyToClipboard(value, { doc: window.document });\r\n this.toasterService.popAsync('info', null,\r\n this.i18nService.t('valueCopied', this.i18nService.t(typeI18nKey)));\r\n }\r\n}\r\n","export enum FieldType {\r\n Text = 0,\r\n Hidden = 1,\r\n Boolean = 2,\r\n}\r\n","export enum EncryptionType {\r\n AesCbc256_B64 = 0,\r\n AesCbc128_HmacSha256_B64 = 1,\r\n AesCbc256_HmacSha256_B64 = 2,\r\n Rsa2048_OaepSha256_B64 = 3,\r\n Rsa2048_OaepSha1_B64 = 4,\r\n Rsa2048_OaepSha256_HmacSha256_B64 = 5,\r\n Rsa2048_OaepSha1_HmacSha256_B64 = 6,\r\n}\r\n","import {\r\n Component,\r\n EventEmitter,\r\n Output,\r\n} from '@angular/core';\r\n\r\nimport { CollectionService } from 'jslib/abstractions/collection.service';\r\nimport { FolderService } from 'jslib/abstractions/folder.service';\r\n\r\nimport { GroupingsComponent as BaseGroupingsComponent } from 'jslib/angular/components/groupings.component';\r\n\r\n@Component({\r\n selector: 'app-vault-groupings',\r\n templateUrl: 'groupings.component.html',\r\n})\r\nexport class GroupingsComponent extends BaseGroupingsComponent {\r\n @Output() onSearchTextChanged = new EventEmitter();\r\n\r\n searchText: string = '';\r\n searchPlaceholder: string = null;\r\n\r\n constructor(collectionService: CollectionService, folderService: FolderService) {\r\n super(collectionService, folderService);\r\n }\r\n\r\n searchTextChanged() {\r\n this.onSearchTextChanged.emit(this.searchText);\r\n }\r\n}\r\n","import { TwoFactorProviderType } from '../enums/twoFactorProviderType';\n\nimport { AuthResult } from '../models/domain/authResult';\nimport { SymmetricCryptoKey } from '../models/domain/symmetricCryptoKey';\n\nimport { DeviceRequest } from '../models/request/deviceRequest';\nimport { KeysRequest } from '../models/request/keysRequest';\nimport { TokenRequest } from '../models/request/tokenRequest';\n\nimport { IdentityTokenResponse } from '../models/response/identityTokenResponse';\nimport { IdentityTwoFactorResponse } from '../models/response/identityTwoFactorResponse';\n\nimport { ApiService } from '../abstractions/api.service';\nimport { AppIdService } from '../abstractions/appId.service';\nimport { CryptoService } from '../abstractions/crypto.service';\nimport { I18nService } from '../abstractions/i18n.service';\nimport { MessagingService } from '../abstractions/messaging.service';\nimport { PlatformUtilsService } from '../abstractions/platformUtils.service';\nimport { TokenService } from '../abstractions/token.service';\nimport { UserService } from '../abstractions/user.service';\n\nexport const TwoFactorProviders = {\n [TwoFactorProviderType.Authenticator]: {\n type: TwoFactorProviderType.Authenticator,\n name: null as string,\n description: null as string,\n priority: 1,\n sort: 1,\n premium: false,\n },\n [TwoFactorProviderType.Yubikey]: {\n type: TwoFactorProviderType.Yubikey,\n name: null as string,\n description: null as string,\n priority: 3,\n sort: 2,\n premium: true,\n },\n [TwoFactorProviderType.Duo]: {\n type: TwoFactorProviderType.Duo,\n name: 'Duo',\n description: null as string,\n priority: 2,\n sort: 3,\n premium: true,\n },\n [TwoFactorProviderType.OrganizationDuo]: {\n type: TwoFactorProviderType.OrganizationDuo,\n name: 'Duo (Organization)',\n description: null as string,\n priority: 10,\n sort: 4,\n premium: false,\n },\n [TwoFactorProviderType.U2f]: {\n type: TwoFactorProviderType.U2f,\n name: null as string,\n description: null as string,\n priority: 4,\n sort: 5,\n premium: true,\n },\n [TwoFactorProviderType.Email]: {\n type: TwoFactorProviderType.Email,\n name: null as string,\n description: null as string,\n priority: 0,\n sort: 6,\n premium: false,\n },\n};\n\nexport class AuthService {\n email: string;\n masterPasswordHash: string;\n twoFactorProviders: Map;\n selectedTwoFactorProviderType: TwoFactorProviderType = null;\n\n private key: SymmetricCryptoKey;\n\n constructor(private cryptoService: CryptoService, private apiService: ApiService,\n private userService: UserService, private tokenService: TokenService,\n private appIdService: AppIdService, private i18nService: I18nService,\n private platformUtilsService: PlatformUtilsService, private messagingService: MessagingService,\n private setCryptoKeys = true) { }\n\n init() {\n TwoFactorProviders[TwoFactorProviderType.Email].name = this.i18nService.t('emailTitle');\n TwoFactorProviders[TwoFactorProviderType.Email].description = this.i18nService.t('emailDesc');\n\n TwoFactorProviders[TwoFactorProviderType.Authenticator].name = this.i18nService.t('authenticatorAppTitle');\n TwoFactorProviders[TwoFactorProviderType.Authenticator].description =\n this.i18nService.t('authenticatorAppDesc');\n\n TwoFactorProviders[TwoFactorProviderType.Duo].description = this.i18nService.t('duoDesc');\n\n TwoFactorProviders[TwoFactorProviderType.OrganizationDuo].name =\n 'Duo (' + this.i18nService.t('organization') + ')';\n TwoFactorProviders[TwoFactorProviderType.OrganizationDuo].description =\n this.i18nService.t('duoOrganizationDesc');\n\n TwoFactorProviders[TwoFactorProviderType.U2f].name = this.i18nService.t('u2fTitle');\n TwoFactorProviders[TwoFactorProviderType.U2f].description = this.i18nService.t('u2fDesc');\n\n TwoFactorProviders[TwoFactorProviderType.Yubikey].name = this.i18nService.t('yubiKeyTitle');\n TwoFactorProviders[TwoFactorProviderType.Yubikey].description = this.i18nService.t('yubiKeyDesc');\n }\n\n async logIn(email: string, masterPassword: string): Promise {\n this.selectedTwoFactorProviderType = null;\n email = email.toLowerCase();\n const key = await this.cryptoService.makeKey(masterPassword, email);\n const hashedPassword = await this.cryptoService.hashPassword(masterPassword, key);\n return await this.logInHelper(email, hashedPassword, key);\n }\n\n async logInTwoFactor(twoFactorProvider: TwoFactorProviderType, twoFactorToken: string,\n remember?: boolean): Promise {\n return await this.logInHelper(this.email, this.masterPasswordHash, this.key, twoFactorProvider,\n twoFactorToken, remember);\n }\n\n async logInComplete(email: string, masterPassword: string, twoFactorProvider: TwoFactorProviderType,\n twoFactorToken: string, remember?: boolean): Promise {\n this.selectedTwoFactorProviderType = null;\n email = email.toLowerCase();\n const key = await this.cryptoService.makeKey(masterPassword, email);\n const hashedPassword = await this.cryptoService.hashPassword(masterPassword, key);\n return await this.logInHelper(email, hashedPassword, key, twoFactorProvider, twoFactorToken, remember);\n }\n\n logOut(callback: Function) {\n callback();\n this.messagingService.send('loggedOut');\n }\n\n getSupportedTwoFactorProviders(win: Window): any[] {\n const providers: any[] = [];\n if (this.twoFactorProviders == null) {\n return providers;\n }\n\n if (this.twoFactorProviders.has(TwoFactorProviderType.OrganizationDuo) &&\n this.platformUtilsService.supportsDuo()) {\n providers.push(TwoFactorProviders[TwoFactorProviderType.OrganizationDuo]);\n }\n\n if (this.twoFactorProviders.has(TwoFactorProviderType.Authenticator)) {\n providers.push(TwoFactorProviders[TwoFactorProviderType.Authenticator]);\n }\n\n if (this.twoFactorProviders.has(TwoFactorProviderType.Yubikey)) {\n providers.push(TwoFactorProviders[TwoFactorProviderType.Yubikey]);\n }\n\n if (this.twoFactorProviders.has(TwoFactorProviderType.Duo) && this.platformUtilsService.supportsDuo()) {\n providers.push(TwoFactorProviders[TwoFactorProviderType.Duo]);\n }\n\n if (this.twoFactorProviders.has(TwoFactorProviderType.U2f) && this.platformUtilsService.supportsU2f(win)) {\n providers.push(TwoFactorProviders[TwoFactorProviderType.U2f]);\n }\n\n if (this.twoFactorProviders.has(TwoFactorProviderType.Email)) {\n providers.push(TwoFactorProviders[TwoFactorProviderType.Email]);\n }\n\n return providers;\n }\n\n getDefaultTwoFactorProvider(u2fSupported: boolean): TwoFactorProviderType {\n if (this.twoFactorProviders == null) {\n return null;\n }\n\n if (this.selectedTwoFactorProviderType != null &&\n this.twoFactorProviders.has(this.selectedTwoFactorProviderType)) {\n return this.selectedTwoFactorProviderType;\n }\n\n let providerType: TwoFactorProviderType = null;\n let providerPriority = -1;\n this.twoFactorProviders.forEach((value, type) => {\n const provider = (TwoFactorProviders as any)[type];\n if (provider != null && provider.priority > providerPriority) {\n if (type === TwoFactorProviderType.U2f && !u2fSupported) {\n return;\n }\n\n providerType = type;\n providerPriority = provider.priority;\n }\n });\n\n return providerType;\n }\n\n private async logInHelper(email: string, hashedPassword: string, key: SymmetricCryptoKey,\n twoFactorProvider?: TwoFactorProviderType, twoFactorToken?: string, remember?: boolean): Promise {\n const storedTwoFactorToken = await this.tokenService.getTwoFactorToken(email);\n const appId = await this.appIdService.getAppId();\n const deviceRequest = new DeviceRequest(appId, this.platformUtilsService);\n\n let request: TokenRequest;\n if (twoFactorToken != null && twoFactorProvider != null) {\n request = new TokenRequest(email, hashedPassword, twoFactorProvider, twoFactorToken, remember,\n deviceRequest);\n } else if (storedTwoFactorToken != null) {\n request = new TokenRequest(email, hashedPassword, TwoFactorProviderType.Remember,\n storedTwoFactorToken, false, deviceRequest);\n } else {\n request = new TokenRequest(email, hashedPassword, null, null, false, deviceRequest);\n }\n\n const response = await this.apiService.postIdentityToken(request);\n\n this.clearState();\n const result = new AuthResult();\n result.twoFactor = !(response as any).accessToken;\n\n if (result.twoFactor) {\n // two factor required\n const twoFactorResponse = response as IdentityTwoFactorResponse;\n this.email = email;\n this.masterPasswordHash = hashedPassword;\n this.key = this.setCryptoKeys ? key : null;\n this.twoFactorProviders = twoFactorResponse.twoFactorProviders2;\n result.twoFactorProviders = twoFactorResponse.twoFactorProviders2;\n return result;\n }\n\n const tokenResponse = response as IdentityTokenResponse;\n if (tokenResponse.twoFactorToken != null) {\n this.tokenService.setTwoFactorToken(tokenResponse.twoFactorToken, email);\n }\n\n await this.tokenService.setTokens(tokenResponse.accessToken, tokenResponse.refreshToken);\n await this.userService.setUserIdAndEmail(this.tokenService.getUserId(), this.tokenService.getEmail());\n if (this.setCryptoKeys) {\n await this.cryptoService.setKey(key);\n await this.cryptoService.setKeyHash(hashedPassword);\n await this.cryptoService.setEncKey(tokenResponse.key);\n\n // User doesn't have a key pair yet (old account), let's generate one for them\n if (tokenResponse.privateKey == null) {\n try {\n const keyPair = await this.cryptoService.makeKeyPair();\n await this.apiService.postAccountKeys(new KeysRequest(keyPair[0], keyPair[1].encryptedString));\n tokenResponse.privateKey = keyPair[1].encryptedString;\n } catch (e) {\n // tslint:disable-next-line\n console.error(e);\n }\n }\n\n await this.cryptoService.setEncPrivateKey(tokenResponse.privateKey);\n }\n\n this.messagingService.send('loggedIn');\n return result;\n }\n\n private clearState(): void {\n this.email = null;\n this.masterPasswordHash = null;\n this.twoFactorProviders = null;\n this.selectedTwoFactorProviderType = null;\n }\n}\n","export class SelectionReadOnlyResponse {\n id: string;\n readOnly: boolean;\n\n constructor(response: any) {\n this.id = response.Id;\n this.readOnly = response.ReadOnly;\n }\n}\n","import {\n Component,\n OnInit,\n} from '@angular/core';\nimport { ActivatedRoute } from '@angular/router';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { VerifyBankRequest } from 'jslib/models/request/verifyBankRequest';\n\nimport { BillingChargeResponse } from 'jslib/models/response/billingResponse';\nimport { OrganizationBillingResponse } from 'jslib/models/response/organizationBillingResponse';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\nimport { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';\nimport { TokenService } from 'jslib/abstractions/token.service';\n\nimport { PaymentMethodType } from 'jslib/enums/paymentMethodType';\nimport { PlanType } from 'jslib/enums/planType';\n\n@Component({\n selector: 'app-org-billing',\n templateUrl: 'organization-billing.component.html',\n})\nexport class OrganizationBillingComponent implements OnInit {\n loading = false;\n firstLoaded = false;\n organizationId: string;\n adjustSeatsAdd = true;\n showAdjustSeats = false;\n adjustStorageAdd = true;\n showAdjustStorage = false;\n showAdjustPayment = false;\n showUpdateLicense = false;\n billing: OrganizationBillingResponse;\n paymentMethodType = PaymentMethodType;\n selfHosted = false;\n verifyAmount1: number;\n verifyAmount2: number;\n\n cancelPromise: Promise;\n reinstatePromise: Promise;\n licensePromise: Promise;\n verifyBankPromise: Promise;\n\n constructor(private tokenService: TokenService, private apiService: ApiService,\n private platformUtilsService: PlatformUtilsService, private i18nService: I18nService,\n private analytics: Angulartics2, private toasterService: ToasterService,\n private route: ActivatedRoute) {\n this.selfHosted = platformUtilsService.isSelfHost();\n }\n\n async ngOnInit() {\n this.route.parent.parent.params.subscribe(async (params) => {\n this.organizationId = params.organizationId;\n await this.load();\n this.firstLoaded = true;\n });\n }\n\n async load() {\n if (this.loading) {\n return;\n }\n this.loading = true;\n this.billing = await this.apiService.getOrganizationBilling(this.organizationId);\n this.loading = false;\n }\n\n async reinstate() {\n if (this.loading) {\n return;\n }\n\n const confirmed = await this.platformUtilsService.showDialog(this.i18nService.t('reinstateConfirmation'),\n this.i18nService.t('reinstateSubscription'), this.i18nService.t('yes'), this.i18nService.t('cancel'));\n if (!confirmed) {\n return;\n }\n\n try {\n this.reinstatePromise = this.apiService.postOrganizationReinstate(this.organizationId);\n await this.reinstatePromise;\n this.analytics.eventTrack.next({ action: 'Reinstated Plan' });\n this.toasterService.popAsync('success', null, this.i18nService.t('reinstated'));\n this.load();\n } catch { }\n }\n\n async cancel() {\n if (this.loading) {\n return;\n }\n\n const confirmed = await this.platformUtilsService.showDialog(this.i18nService.t('cancelConfirmation'),\n this.i18nService.t('cancelSubscription'), this.i18nService.t('yes'), this.i18nService.t('no'), 'warning');\n if (!confirmed) {\n return;\n }\n\n try {\n this.cancelPromise = this.apiService.postOrganizationCancel(this.organizationId);\n await this.cancelPromise;\n this.analytics.eventTrack.next({ action: 'Canceled Plan' });\n this.toasterService.popAsync('success', null, this.i18nService.t('canceledSubscription'));\n this.load();\n } catch { }\n }\n\n async changePlan() {\n const contactSupport = await this.platformUtilsService.showDialog(this.i18nService.t('changeBillingPlanDesc'),\n this.i18nService.t('changeBillingPlan'), this.i18nService.t('contactSupport'), this.i18nService.t('close'));\n if (contactSupport) {\n this.platformUtilsService.launchUri('https://bitwarden.com/contact');\n }\n }\n\n async downloadLicense() {\n if (this.loading) {\n return;\n }\n\n const installationId = window.prompt(this.i18nService.t('enterInstallationId'));\n if (installationId == null || installationId === '') {\n return;\n }\n\n try {\n this.licensePromise = this.apiService.getOrganizationLicense(this.organizationId, installationId);\n const license = await this.licensePromise;\n const licenseString = JSON.stringify(license, null, 2);\n this.platformUtilsService.saveFile(window, licenseString, null, 'bitwarden_organization_license.json');\n } catch { }\n }\n\n updateLicense() {\n if (this.loading) {\n return;\n }\n this.showUpdateLicense = true;\n }\n\n async verifyBank() {\n if (this.loading) {\n return;\n }\n\n try {\n const request = new VerifyBankRequest();\n request.amount1 = this.verifyAmount1;\n request.amount2 = this.verifyAmount2;\n this.verifyBankPromise = this.apiService.postOrganizationVerifyBank(this.organizationId, request);\n await this.verifyBankPromise;\n this.analytics.eventTrack.next({ action: 'Verified Bank Account' });\n this.toasterService.popAsync('success', null, this.i18nService.t('verifiedBankAccount'));\n this.load();\n } catch { }\n }\n\n closeUpdateLicense(load: boolean) {\n this.showUpdateLicense = false;\n if (load) {\n this.load();\n }\n }\n\n adjustSeats(add: boolean) {\n this.adjustSeatsAdd = add;\n this.showAdjustSeats = true;\n }\n\n closeSeats(load: boolean) {\n this.showAdjustSeats = false;\n if (load) {\n this.load();\n }\n }\n\n adjustStorage(add: boolean) {\n this.adjustStorageAdd = add;\n this.showAdjustStorage = true;\n }\n\n closeStorage(load: boolean) {\n this.showAdjustStorage = false;\n if (load) {\n this.load();\n }\n }\n\n changePayment() {\n this.showAdjustPayment = true;\n }\n\n closePayment(load: boolean) {\n this.showAdjustPayment = false;\n if (load) {\n this.load();\n }\n }\n\n async viewInvoice(charge: BillingChargeResponse) {\n const token = await this.tokenService.getToken();\n const url = this.apiService.apiBaseUrl + '/organizations/' + this.organizationId +\n '/billing-invoice/' + charge.invoiceId + '?access_token=' + token;\n this.platformUtilsService.launchUri(url);\n }\n\n get subscriptionMarkedForCancel() {\n return this.subscription != null && !this.subscription.cancelled && this.subscription.cancelAtEndDate;\n }\n\n get subscription() {\n return this.billing != null ? this.billing.subscription : null;\n }\n\n get nextInvoice() {\n return this.billing != null ? this.billing.upcomingInvoice : null;\n }\n\n get paymentSource() {\n return this.billing != null ? this.billing.paymentSource : null;\n }\n\n get charges() {\n return this.billing != null ? this.billing.charges : null;\n }\n\n get storagePercentage() {\n return this.billing != null && this.billing.maxStorageGb ?\n +(100 * (this.billing.storageGb / this.billing.maxStorageGb)).toFixed(2) : 0;\n }\n\n get storageProgressWidth() {\n return this.storagePercentage < 5 ? 5 : 0;\n }\n\n get billingInterval() {\n const monthly = this.billing.planType === PlanType.EnterpriseMonthly ||\n this.billing.planType === PlanType.TeamsMonthly;\n return monthly ? 'month' : 'year';\n }\n\n get storageGbPrice() {\n return this.billingInterval === 'month' ? 0.5 : 4;\n }\n\n get seatPrice() {\n switch (this.billing.planType) {\n case PlanType.EnterpriseMonthly:\n return 4;\n case PlanType.EnterpriseAnnually:\n return 3;\n case PlanType.TeamsMonthly:\n return 2.5;\n case PlanType.TeamsAnnually:\n return 2;\n default:\n return 0;\n }\n }\n\n get canAdjustSeats() {\n return this.billing.planType === PlanType.EnterpriseMonthly ||\n this.billing.planType === PlanType.EnterpriseAnnually ||\n this.billing.planType === PlanType.TeamsMonthly || this.billing.planType === PlanType.TeamsAnnually;\n }\n\n get canDownloadLicense() {\n return (this.billing.planType !== PlanType.Free && this.subscription == null) ||\n (this.subscription != null && !this.subscription.cancelled);\n }\n}\n","import {\n Component,\n ComponentFactoryResolver,\n} from '@angular/core';\nimport { ActivatedRoute } from '@angular/router';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { MessagingService } from 'jslib/abstractions/messaging.service';\nimport { TokenService } from 'jslib/abstractions/token.service';\n\nimport { TwoFactorProviderType } from 'jslib/enums/twoFactorProviderType';\n\nimport { TwoFactorDuoComponent } from '../../settings/two-factor-duo.component';\nimport { TwoFactorSetupComponent as BaseTwoFactorSetupComponent } from '../../settings/two-factor-setup.component';\n\n@Component({\n selector: 'app-two-factor-setup',\n templateUrl: '../../settings/two-factor-setup.component.html',\n})\nexport class TwoFactorSetupComponent extends BaseTwoFactorSetupComponent {\n constructor(apiService: ApiService, tokenService: TokenService,\n componentFactoryResolver: ComponentFactoryResolver, messagingService: MessagingService,\n private route: ActivatedRoute) {\n super(apiService, tokenService, componentFactoryResolver, messagingService);\n }\n\n async ngOnInit() {\n this.route.parent.parent.params.subscribe(async (params) => {\n this.organizationId = params.organizationId;\n await super.ngOnInit();\n });\n }\n\n manage(type: TwoFactorProviderType) {\n switch (type) {\n case TwoFactorProviderType.OrganizationDuo:\n const duoComp = this.openModal(this.duoModalRef, TwoFactorDuoComponent);\n duoComp.type = TwoFactorProviderType.OrganizationDuo;\n duoComp.organizationId = this.organizationId;\n duoComp.onUpdated.subscribe((enabled: boolean) => {\n this.updateStatus(enabled, TwoFactorProviderType.OrganizationDuo);\n });\n break;\n default:\n break;\n }\n }\n\n protected getTwoFactorProviders() {\n return this.apiService.getTwoFactorOrganizationProviders(this.organizationId);\n }\n\n protected filterProvider(type: TwoFactorProviderType) {\n return type !== TwoFactorProviderType.OrganizationDuo;\n }\n}\n","import {\n Component,\n ComponentFactoryResolver,\n ViewChild,\n ViewContainerRef,\n} from '@angular/core';\nimport { ActivatedRoute } from '@angular/router';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\nimport { SyncService } from 'jslib/abstractions/sync.service';\n\nimport { OrganizationUpdateRequest } from 'jslib/models/request/organizationUpdateRequest';\nimport { OrganizationResponse } from 'jslib/models/response/organizationResponse';\n\nimport { ModalComponent } from '../../modal.component';\nimport { DeleteOrganizationComponent } from './delete-organization.component';\n\n@Component({\n selector: 'app-org-account',\n templateUrl: 'account.component.html',\n})\nexport class AccountComponent {\n @ViewChild('deleteOrganizationTemplate', { read: ViewContainerRef }) deleteModalRef: ViewContainerRef;\n\n loading = true;\n org: OrganizationResponse;\n formPromise: Promise;\n\n private organizationId: string;\n private modal: ModalComponent = null;\n\n constructor(private componentFactoryResolver: ComponentFactoryResolver,\n private apiService: ApiService, private i18nService: I18nService,\n private analytics: Angulartics2, private toasterService: ToasterService,\n private route: ActivatedRoute, private syncService: SyncService) { }\n\n async ngOnInit() {\n this.route.parent.parent.params.subscribe(async (params) => {\n this.organizationId = params.organizationId;\n try {\n this.org = await this.apiService.getOrganization(this.organizationId);\n } catch { }\n });\n this.loading = false;\n }\n\n async submit() {\n try {\n const request = new OrganizationUpdateRequest();\n request.name = this.org.name;\n request.businessName = this.org.businessName;\n request.billingEmail = this.org.billingEmail;\n this.formPromise = this.apiService.putOrganization(this.organizationId, request).then(() => {\n return this.syncService.fullSync(true);\n });\n await this.formPromise;\n this.analytics.eventTrack.next({ action: 'Updated Organization Settings' });\n this.toasterService.popAsync('success', null, this.i18nService.t('organizationUpdated'));\n } catch { }\n }\n\n deleteOrganization() {\n if (this.modal != null) {\n this.modal.close();\n }\n\n const factory = this.componentFactoryResolver.resolveComponentFactory(ModalComponent);\n this.modal = this.deleteModalRef.createComponent(factory).instance;\n const childComponent = this.modal.show(\n DeleteOrganizationComponent, this.deleteModalRef);\n childComponent.organizationId = this.organizationId;\n\n this.modal.onClosed.subscribe(async () => {\n this.modal = null;\n });\n }\n}\n","import { Component } from '@angular/core';\nimport { ActivatedRoute } from '@angular/router';\n\nimport { UserService } from 'jslib/abstractions/user.service';\n\n@Component({\n selector: 'app-org-settings',\n templateUrl: 'settings.component.html',\n})\nexport class SettingsComponent {\n access2fa = false;\n\n constructor(private route: ActivatedRoute, private userService: UserService) { }\n\n ngOnInit() {\n this.route.parent.params.subscribe(async (params) => {\n const organization = await this.userService.getOrganization(params.organizationId);\n this.access2fa = organization.use2fa;\n });\n }\n}\n","import {\n Component,\n ComponentFactoryResolver,\n OnInit,\n ViewChild,\n ViewContainerRef,\n} from '@angular/core';\nimport { ActivatedRoute } from '@angular/router';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { CryptoService } from 'jslib/abstractions/crypto.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\nimport { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';\nimport { UserService } from 'jslib/abstractions/user.service';\n\nimport { OrganizationUserConfirmRequest } from 'jslib/models/request/organizationUserConfirmRequest';\n\nimport { OrganizationUserUserDetailsResponse } from 'jslib/models/response/organizationUserResponse';\n\nimport { OrganizationUserStatusType } from 'jslib/enums/organizationUserStatusType';\nimport { OrganizationUserType } from 'jslib/enums/organizationUserType';\n\nimport { Utils } from 'jslib/misc/utils';\n\nimport { ModalComponent } from '../../modal.component';\nimport { EntityEventsComponent } from './entity-events.component';\nimport { UserAddEditComponent } from './user-add-edit.component';\nimport { UserGroupsComponent } from './user-groups.component';\n\n@Component({\n selector: 'app-org-people',\n templateUrl: 'people.component.html',\n})\nexport class PeopleComponent implements OnInit {\n @ViewChild('addEdit', { read: ViewContainerRef }) addEditModalRef: ViewContainerRef;\n @ViewChild('groupsTemplate', { read: ViewContainerRef }) groupsModalRef: ViewContainerRef;\n @ViewChild('eventsTemplate', { read: ViewContainerRef }) eventsModalRef: ViewContainerRef;\n\n loading = true;\n organizationId: string;\n users: OrganizationUserUserDetailsResponse[];\n searchText: string;\n status: OrganizationUserStatusType = null;\n statusMap = new Map();\n organizationUserType = OrganizationUserType;\n organizationUserStatusType = OrganizationUserStatusType;\n actionPromise: Promise;\n accessEvents = false;\n accessGroups = false;\n\n private modal: ModalComponent = null;\n private allUsers: OrganizationUserUserDetailsResponse[];\n\n constructor(private apiService: ApiService, private route: ActivatedRoute,\n private i18nService: I18nService, private componentFactoryResolver: ComponentFactoryResolver,\n private platformUtilsService: PlatformUtilsService, private analytics: Angulartics2,\n private toasterService: ToasterService, private cryptoService: CryptoService,\n private userService: UserService) { }\n\n async ngOnInit() {\n this.route.parent.parent.params.subscribe(async (params) => {\n this.organizationId = params.organizationId;\n const organization = await this.userService.getOrganization(this.organizationId);\n this.accessEvents = organization.useEvents;\n this.accessGroups = organization.useGroups;\n await this.load();\n\n this.route.queryParams.subscribe(async (qParams) => {\n this.searchText = qParams.search;\n if (qParams.viewEvents != null) {\n const user = this.users.filter((u) => u.id === qParams.viewEvents);\n if (user.length > 0 && user[0].status === OrganizationUserStatusType.Confirmed) {\n this.events(user[0]);\n }\n }\n });\n });\n }\n\n async load() {\n const response = await this.apiService.getOrganizationUsers(this.organizationId);\n this.statusMap.clear();\n this.allUsers = response.data != null && response.data.length > 0 ? response.data : [];\n this.allUsers.sort(Utils.getSortFunction(this.i18nService, 'email'));\n this.allUsers.forEach((u) => {\n if (!this.statusMap.has(u.status)) {\n this.statusMap.set(u.status, [u]);\n } else {\n this.statusMap.get(u.status).push(u);\n }\n });\n this.filter(this.status);\n this.loading = false;\n }\n\n filter(status: OrganizationUserStatusType) {\n this.status = status;\n if (this.status != null) {\n this.users = this.statusMap.get(this.status);\n } else {\n this.users = this.allUsers;\n }\n }\n\n get invitedCount() {\n return this.statusMap.has(OrganizationUserStatusType.Invited) ?\n this.statusMap.get(OrganizationUserStatusType.Invited).length : 0;\n }\n\n get acceptedCount() {\n return this.statusMap.has(OrganizationUserStatusType.Accepted) ?\n this.statusMap.get(OrganizationUserStatusType.Accepted).length : 0;\n }\n\n edit(user: OrganizationUserUserDetailsResponse) {\n if (this.modal != null) {\n this.modal.close();\n }\n\n const factory = this.componentFactoryResolver.resolveComponentFactory(ModalComponent);\n this.modal = this.addEditModalRef.createComponent(factory).instance;\n const childComponent = this.modal.show(\n UserAddEditComponent, this.addEditModalRef);\n\n childComponent.name = user != null ? user.name || user.email : null;\n childComponent.organizationId = this.organizationId;\n childComponent.organizationUserId = user != null ? user.id : null;\n childComponent.onSavedUser.subscribe(() => {\n this.modal.close();\n this.load();\n });\n childComponent.onDeletedUser.subscribe(() => {\n this.modal.close();\n this.removeUser(user);\n });\n\n this.modal.onClosed.subscribe(() => {\n this.modal = null;\n });\n }\n\n invite() {\n this.edit(null);\n }\n\n groups(user: OrganizationUserUserDetailsResponse) {\n if (this.modal != null) {\n this.modal.close();\n }\n\n const factory = this.componentFactoryResolver.resolveComponentFactory(ModalComponent);\n this.modal = this.groupsModalRef.createComponent(factory).instance;\n const childComponent = this.modal.show(\n UserGroupsComponent, this.groupsModalRef);\n\n childComponent.name = user != null ? user.name || user.email : null;\n childComponent.organizationId = this.organizationId;\n childComponent.organizationUserId = user != null ? user.id : null;\n childComponent.onSavedUser.subscribe(() => {\n this.modal.close();\n });\n\n this.modal.onClosed.subscribe(() => {\n this.modal = null;\n });\n }\n\n async remove(user: OrganizationUserUserDetailsResponse) {\n const confirmed = await this.platformUtilsService.showDialog(\n this.i18nService.t('removeUserConfirmation'), user.name || user.email,\n this.i18nService.t('yes'), this.i18nService.t('no'), 'warning');\n if (!confirmed) {\n return false;\n }\n\n try {\n await this.apiService.deleteOrganizationUser(this.organizationId, user.id);\n this.analytics.eventTrack.next({ action: 'Deleted User' });\n this.toasterService.popAsync('success', null, this.i18nService.t('removedUserId', user.name || user.email));\n this.removeUser(user);\n } catch { }\n }\n\n async reinvite(user: OrganizationUserUserDetailsResponse) {\n if (this.actionPromise != null) {\n return;\n }\n this.actionPromise = this.apiService.postOrganizationUserReinvite(this.organizationId, user.id);\n await this.actionPromise;\n this.analytics.eventTrack.next({ action: 'Reinvited User' });\n this.toasterService.popAsync('success', null, this.i18nService.t('hasBeenReinvited', user.name || user.email));\n this.actionPromise = null;\n }\n\n async confirm(user: OrganizationUserUserDetailsResponse) {\n if (this.actionPromise != null) {\n return;\n }\n this.actionPromise = this.doConfirmation(user);\n await this.actionPromise;\n user.status = OrganizationUserStatusType.Confirmed;\n this.analytics.eventTrack.next({ action: 'Confirmed User' });\n this.toasterService.popAsync('success', null, this.i18nService.t('hasBeenConfirmed', user.name || user.email));\n this.actionPromise = null;\n }\n\n async events(user: OrganizationUserUserDetailsResponse) {\n if (this.modal != null) {\n this.modal.close();\n }\n\n const factory = this.componentFactoryResolver.resolveComponentFactory(ModalComponent);\n this.modal = this.eventsModalRef.createComponent(factory).instance;\n const childComponent = this.modal.show(\n EntityEventsComponent, this.eventsModalRef);\n\n childComponent.name = user.name || user.email;\n childComponent.organizationId = this.organizationId;\n childComponent.entityId = user.id;\n childComponent.showUser = false;\n childComponent.entity = 'user';\n\n this.modal.onClosed.subscribe(() => {\n this.modal = null;\n });\n }\n\n private async doConfirmation(user: OrganizationUserUserDetailsResponse) {\n const orgKey = await this.cryptoService.getOrgKey(this.organizationId);\n const publicKeyResponse = await this.apiService.getUserPublicKey(user.userId);\n const publicKey = Utils.fromB64ToArray(publicKeyResponse.publicKey);\n const key = await this.cryptoService.rsaEncrypt(orgKey.key, publicKey.buffer);\n const request = new OrganizationUserConfirmRequest();\n request.key = key.encryptedString;\n await this.apiService.postOrganizationUserConfirm(this.organizationId, user.id, request);\n }\n\n private removeUser(user: OrganizationUserUserDetailsResponse) {\n const index = this.users.indexOf(user);\n if (index > -1) {\n this.users.splice(index, 1);\n }\n }\n}\n","import {\n Component,\n ComponentFactoryResolver,\n OnInit,\n ViewChild,\n ViewContainerRef,\n} from '@angular/core';\nimport {\n ActivatedRoute,\n Router,\n} from '@angular/router';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\nimport { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';\nimport { UserService } from 'jslib/abstractions/user.service';\n\nimport { GroupResponse } from 'jslib/models/response/groupResponse';\n\nimport { Utils } from 'jslib/misc/utils';\n\nimport { ModalComponent } from '../../modal.component';\nimport { EntityUsersComponent } from './entity-users.component';\nimport { GroupAddEditComponent } from './group-add-edit.component';\n\n@Component({\n selector: 'app-org-groups',\n templateUrl: 'groups.component.html',\n})\nexport class GroupsComponent implements OnInit {\n @ViewChild('addEdit', { read: ViewContainerRef }) addEditModalRef: ViewContainerRef;\n @ViewChild('usersTemplate', { read: ViewContainerRef }) usersModalRef: ViewContainerRef;\n\n loading = true;\n organizationId: string;\n groups: GroupResponse[];\n searchText: string;\n\n private modal: ModalComponent = null;\n\n constructor(private apiService: ApiService, private route: ActivatedRoute,\n private i18nService: I18nService, private componentFactoryResolver: ComponentFactoryResolver,\n private analytics: Angulartics2, private toasterService: ToasterService,\n private platformUtilsService: PlatformUtilsService, private userService: UserService,\n private router: Router) { }\n\n async ngOnInit() {\n this.route.parent.parent.params.subscribe(async (params) => {\n this.organizationId = params.organizationId;\n const organization = await this.userService.getOrganization(this.organizationId);\n if (organization == null || !organization.useGroups) {\n this.router.navigate(['/organizations', this.organizationId]);\n return;\n }\n await this.load();\n this.route.queryParams.subscribe(async (qParams) => {\n this.searchText = qParams.search;\n });\n });\n }\n\n async load() {\n const response = await this.apiService.getGroups(this.organizationId);\n const groups = response.data != null && response.data.length > 0 ? response.data : [];\n groups.sort(Utils.getSortFunction(this.i18nService, 'name'));\n this.groups = groups;\n this.loading = false;\n }\n\n edit(group: GroupResponse) {\n if (this.modal != null) {\n this.modal.close();\n }\n\n const factory = this.componentFactoryResolver.resolveComponentFactory(ModalComponent);\n this.modal = this.addEditModalRef.createComponent(factory).instance;\n const childComponent = this.modal.show(\n GroupAddEditComponent, this.addEditModalRef);\n\n childComponent.organizationId = this.organizationId;\n childComponent.groupId = group != null ? group.id : null;\n childComponent.onSavedGroup.subscribe(() => {\n this.modal.close();\n this.load();\n });\n childComponent.onDeletedGroup.subscribe(() => {\n this.modal.close();\n this.removeGroup(group);\n });\n\n this.modal.onClosed.subscribe(() => {\n this.modal = null;\n });\n }\n\n add() {\n this.edit(null);\n }\n\n async delete(group: GroupResponse) {\n const confirmed = await this.platformUtilsService.showDialog(\n this.i18nService.t('deleteGroupConfirmation'), group.name,\n this.i18nService.t('yes'), this.i18nService.t('no'), 'warning');\n if (!confirmed) {\n return false;\n }\n\n try {\n await this.apiService.deleteGroup(this.organizationId, group.id);\n this.analytics.eventTrack.next({ action: 'Deleted Group' });\n this.toasterService.popAsync('success', null, this.i18nService.t('deletedGroupId', group.name));\n this.removeGroup(group);\n } catch { }\n }\n\n users(group: GroupResponse) {\n if (this.modal != null) {\n this.modal.close();\n }\n\n const factory = this.componentFactoryResolver.resolveComponentFactory(ModalComponent);\n this.modal = this.usersModalRef.createComponent(factory).instance;\n const childComponent = this.modal.show(\n EntityUsersComponent, this.usersModalRef);\n\n childComponent.organizationId = this.organizationId;\n childComponent.entity = 'group';\n childComponent.entityId = group.id;\n childComponent.entityName = group.name;\n\n this.modal.onClosed.subscribe(() => {\n this.modal = null;\n });\n }\n\n private removeGroup(group: GroupResponse) {\n const index = this.groups.indexOf(group);\n if (index > -1) {\n this.groups.splice(index, 1);\n }\n }\n}\n","import {\r\n Component,\r\n OnInit,\r\n} from '@angular/core';\r\nimport { ActivatedRoute, Router } from '@angular/router';\r\n\r\nimport { ToasterService } from 'angular2-toaster';\r\n\r\nimport { ApiService } from 'jslib/abstractions/api.service';\r\nimport { I18nService } from 'jslib/abstractions/i18n.service';\r\nimport { UserService } from 'jslib/abstractions/user.service';\r\n\r\nimport { EventService } from '../../services/event.service';\r\n\r\nimport { EventResponse } from 'jslib/models/response/eventResponse';\r\nimport { ListResponse } from 'jslib/models/response/listResponse';\r\n\r\n@Component({\r\n selector: 'app-org-events',\r\n templateUrl: 'events.component.html',\r\n})\r\nexport class EventsComponent implements OnInit {\r\n loading = true;\r\n loaded = false;\r\n organizationId: string;\r\n events: any[];\r\n start: string;\r\n end: string;\r\n continuationToken: string;\r\n refreshPromise: Promise;\r\n morePromise: Promise;\r\n\r\n private orgUsersUserIdMap = new Map();\r\n private orgUsersIdMap = new Map();\r\n\r\n constructor(private apiService: ApiService, private route: ActivatedRoute,\r\n private eventService: EventService, private i18nService: I18nService,\r\n private toasterService: ToasterService, private userService: UserService,\r\n private router: Router) { }\r\n\r\n async ngOnInit() {\r\n this.route.parent.parent.params.subscribe(async (params) => {\r\n this.organizationId = params.organizationId;\r\n const organization = await this.userService.getOrganization(this.organizationId);\r\n if (organization == null || !organization.useEvents) {\r\n this.router.navigate(['/organizations', this.organizationId]);\r\n return;\r\n }\r\n const defaultDates = this.eventService.getDefaultDateFilters();\r\n this.start = defaultDates[0];\r\n this.end = defaultDates[1];\r\n await this.load();\r\n });\r\n }\r\n\r\n async load() {\r\n const response = await this.apiService.getOrganizationUsers(this.organizationId);\r\n response.data.forEach((u) => {\r\n const name = u.name == null || u.name.trim() === '' ? u.email : u.name;\r\n this.orgUsersIdMap.set(u.id, { name: name, email: u.email });\r\n this.orgUsersUserIdMap.set(u.userId, { name: name, email: u.email });\r\n });\r\n await this.loadEvents(true);\r\n this.loaded = true;\r\n }\r\n\r\n async loadEvents(clearExisting: boolean) {\r\n if (this.refreshPromise != null || this.morePromise != null) {\r\n return;\r\n }\r\n\r\n let dates: string[] = null;\r\n try {\r\n dates = this.eventService.formatDateFilters(this.start, this.end);\r\n } catch (e) {\r\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'),\r\n this.i18nService.t('invalidDateRange'));\r\n return;\r\n }\r\n\r\n this.loading = true;\r\n let response: ListResponse;\r\n try {\r\n const promise = this.apiService.getEventsOrganization(this.organizationId, dates[0], dates[1],\r\n clearExisting ? null : this.continuationToken);\r\n if (clearExisting) {\r\n this.refreshPromise = promise;\r\n } else {\r\n this.morePromise = promise;\r\n }\r\n response = await promise;\r\n } catch { }\r\n\r\n this.continuationToken = response.continuationToken;\r\n const events = response.data.map((r) => {\r\n const userId = r.actingUserId == null ? r.userId : r.actingUserId;\r\n const eventInfo = this.eventService.getEventInfo(r);\r\n const user = userId != null && this.orgUsersUserIdMap.has(userId) ?\r\n this.orgUsersUserIdMap.get(userId) : null;\r\n return {\r\n message: eventInfo.message,\r\n appIcon: eventInfo.appIcon,\r\n appName: eventInfo.appName,\r\n userId: userId,\r\n userName: user != null ? user.name : this.i18nService.t('unknown'),\r\n userEmail: user != null ? user.email : '',\r\n date: r.date,\r\n ip: r.ipAddress,\r\n type: r.type,\r\n };\r\n });\r\n\r\n if (!clearExisting && this.events != null && this.events.length > 0) {\r\n this.events = this.events.concat(events);\r\n } else {\r\n this.events = events;\r\n }\r\n\r\n this.loading = false;\r\n this.morePromise = null;\r\n this.refreshPromise = null;\r\n }\r\n}\r\n","export enum OrganizationUserStatusType {\n Invited = 0,\n Accepted = 1,\n Confirmed = 2,\n}\n","import {\n Component,\n EventEmitter,\n Input,\n OnInit,\n Output,\n} from '@angular/core';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\nimport { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';\n\nimport { OrganizationUserStatusType } from 'jslib/enums/organizationUserStatusType';\nimport { OrganizationUserType } from 'jslib/enums/organizationUserType';\n\nimport { Utils } from 'jslib/misc/utils';\n\n@Component({\n selector: 'app-entity-users',\n templateUrl: 'entity-users.component.html',\n})\nexport class EntityUsersComponent implements OnInit {\n @Input() entity: 'group' | 'collection';\n @Input() entityId: string;\n @Input() entityName: string;\n @Input() organizationId: string;\n @Output() onRemovedUser = new EventEmitter();\n\n organizationUserType = OrganizationUserType;\n organizationUserStatusType = OrganizationUserStatusType;\n\n loading = true;\n users: any[] = [];\n actionPromise: Promise;\n\n constructor(private apiService: ApiService, private i18nService: I18nService,\n private analytics: Angulartics2, private toasterService: ToasterService,\n private platformUtilsService: PlatformUtilsService) { }\n\n async ngOnInit() {\n await this.loadUsers();\n this.loading = false;\n }\n\n async loadUsers() {\n let users: any[] = [];\n if (this.entity === 'group') {\n const response = await this.apiService.getGroupUsers(this.organizationId, this.entityId);\n users = response.data.map((r) => r);\n } else if (this.entity === 'collection') {\n const response = await this.apiService.getCollectionUsers(this.organizationId, this.entityId);\n users = response.data.map((r) => r);\n }\n users.sort(Utils.getSortFunction(this.i18nService, 'email'));\n this.users = users;\n }\n\n async remove(user: any) {\n if (this.actionPromise != null || (this.entity === 'collection' && user.accessAll)) {\n return;\n }\n\n const confirmed = await this.platformUtilsService.showDialog(\n this.i18nService.t('removeUserConfirmation'), user.email,\n this.i18nService.t('yes'), this.i18nService.t('no'), 'warning');\n if (!confirmed) {\n return false;\n }\n\n try {\n if (this.entity === 'group') {\n this.actionPromise = this.apiService.deleteGroupUser(this.organizationId, this.entityId,\n user.organizationUserId);\n await this.actionPromise;\n this.analytics.eventTrack.next({ action: 'Removed User From Group' });\n } else if (this.entity === 'collection') {\n this.actionPromise = this.apiService.deleteCollectionUser(this.organizationId, this.entityId,\n user.organizationUserId);\n await this.actionPromise;\n this.analytics.eventTrack.next({ action: 'Removed User From Collection' });\n }\n\n this.toasterService.popAsync('success', null, this.i18nService.t('removedUserId', user.email));\n this.onRemovedUser.emit();\n const index = this.users.indexOf(user);\n if (index > -1) {\n this.users.splice(index, 1);\n }\n } catch { }\n }\n}\n","export class SelectionReadOnlyRequest {\n id: string;\n readOnly: boolean;\n\n constructor(id: string, readOnly: boolean) {\n this.id = id;\n this.readOnly = readOnly;\n }\n}\n","import {\n Component,\n ComponentFactoryResolver,\n OnInit,\n ViewChild,\n ViewContainerRef,\n} from '@angular/core';\nimport { ActivatedRoute } from '@angular/router';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { CollectionService } from 'jslib/abstractions/collection.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\nimport { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';\n\nimport { CollectionData } from 'jslib/models/data/collectionData';\nimport { Collection } from 'jslib/models/domain/collection';\nimport { CollectionDetailsResponse } from 'jslib/models/response/collectionResponse';\nimport { CollectionView } from 'jslib/models/view/collectionView';\n\nimport { ModalComponent } from '../../modal.component';\nimport { CollectionAddEditComponent } from './collection-add-edit.component';\nimport { EntityUsersComponent } from './entity-users.component';\n\n@Component({\n selector: 'app-org-manage-collections',\n templateUrl: 'collections.component.html',\n})\nexport class CollectionsComponent implements OnInit {\n @ViewChild('addEdit', { read: ViewContainerRef }) addEditModalRef: ViewContainerRef;\n @ViewChild('usersTemplate', { read: ViewContainerRef }) usersModalRef: ViewContainerRef;\n\n loading = true;\n organizationId: string;\n collections: CollectionView[];\n searchText: string;\n\n private modal: ModalComponent = null;\n\n constructor(private apiService: ApiService, private route: ActivatedRoute,\n private collectionService: CollectionService, private componentFactoryResolver: ComponentFactoryResolver,\n private analytics: Angulartics2, private toasterService: ToasterService,\n private i18nService: I18nService, private platformUtilsService: PlatformUtilsService) { }\n\n async ngOnInit() {\n this.route.parent.parent.params.subscribe(async (params) => {\n this.organizationId = params.organizationId;\n await this.load();\n this.route.queryParams.subscribe(async (qParams) => {\n this.searchText = qParams.search;\n });\n });\n }\n\n async load() {\n const response = await this.apiService.getCollections(this.organizationId);\n const collections = response.data.map((r) =>\n new Collection(new CollectionData(r as CollectionDetailsResponse)));\n this.collections = await this.collectionService.decryptMany(collections);\n this.loading = false;\n }\n\n edit(collection: CollectionView) {\n if (this.modal != null) {\n this.modal.close();\n }\n\n const factory = this.componentFactoryResolver.resolveComponentFactory(ModalComponent);\n this.modal = this.addEditModalRef.createComponent(factory).instance;\n const childComponent = this.modal.show(\n CollectionAddEditComponent, this.addEditModalRef);\n\n childComponent.organizationId = this.organizationId;\n childComponent.collectionId = collection != null ? collection.id : null;\n childComponent.onSavedCollection.subscribe(() => {\n this.modal.close();\n this.load();\n });\n childComponent.onDeletedCollection.subscribe(() => {\n this.modal.close();\n this.removeCollection(collection);\n });\n\n this.modal.onClosed.subscribe(() => {\n this.modal = null;\n });\n }\n\n add() {\n this.edit(null);\n }\n\n async delete(collection: CollectionView) {\n const confirmed = await this.platformUtilsService.showDialog(\n this.i18nService.t('deleteCollectionConfirmation'), collection.name,\n this.i18nService.t('yes'), this.i18nService.t('no'), 'warning');\n if (!confirmed) {\n return false;\n }\n\n try {\n await this.apiService.deleteCollection(this.organizationId, collection.id);\n this.analytics.eventTrack.next({ action: 'Deleted Collection' });\n this.toasterService.popAsync('success', null, this.i18nService.t('deletedCollectionId', collection.name));\n this.removeCollection(collection);\n } catch { }\n }\n\n users(collection: CollectionView) {\n if (this.modal != null) {\n this.modal.close();\n }\n\n const factory = this.componentFactoryResolver.resolveComponentFactory(ModalComponent);\n this.modal = this.usersModalRef.createComponent(factory).instance;\n const childComponent = this.modal.show(\n EntityUsersComponent, this.usersModalRef);\n\n childComponent.organizationId = this.organizationId;\n childComponent.entity = 'collection';\n childComponent.entityId = collection.id;\n childComponent.entityName = collection.name;\n\n this.modal.onClosed.subscribe(() => {\n this.modal = null;\n });\n }\n\n private removeCollection(collection: CollectionView) {\n const index = this.collections.indexOf(collection);\n if (index > -1) {\n this.collections.splice(index, 1);\n }\n }\n}\n","import {\n Pipe,\n PipeTransform,\n} from '@angular/core';\n\n@Pipe({\n name: 'search',\n})\nexport class SearchPipe implements PipeTransform {\n transform(items: any[], searchText: string, prop1?: string, prop2?: string, prop3?: string): any[] {\n if (items == null || items.length === 0) {\n return [];\n }\n\n if (searchText == null || searchText.length < 2) {\n return items;\n }\n\n searchText = searchText.trim().toLowerCase();\n return items.filter((i) => {\n if (prop1 != null && i[prop1] != null && i[prop1].toString().toLowerCase().indexOf(searchText) > -1) {\n return true;\n }\n if (prop2 != null && i[prop2] != null && i[prop2].toString().toLowerCase().indexOf(searchText) > -1) {\n return true;\n }\n if (prop3 != null && i[prop3] != null && i[prop3].toString().toLowerCase().indexOf(searchText) > -1) {\n return true;\n }\n return false;\n });\n }\n}\n","import {\r\n Component,\r\n OnInit,\r\n} from '@angular/core';\r\nimport { ActivatedRoute } from '@angular/router';\r\n\r\nimport { UserService } from 'jslib/abstractions/user.service';\r\n\r\n@Component({\r\n selector: 'app-org-manage',\r\n templateUrl: 'manage.component.html',\r\n})\r\nexport class ManageComponent implements OnInit {\r\n accessGroups = false;\r\n accessEvents = false;\r\n\r\n constructor(private route: ActivatedRoute, private userService: UserService) { }\r\n\r\n ngOnInit() {\r\n this.route.parent.params.subscribe(async (params) => {\r\n const organization = await this.userService.getOrganization(params.organizationId);\r\n this.accessEvents = organization.useEvents;\r\n this.accessGroups = organization.useGroups;\r\n });\r\n }\r\n}\r\n","import { ToasterService } from 'angular2-toaster';\r\nimport { Angulartics2 } from 'angulartics2';\r\n\r\nimport { Component } from '@angular/core';\r\nimport { ActivatedRoute } from '@angular/router';\r\n\r\nimport { CryptoService } from 'jslib/abstractions/crypto.service';\r\nimport { ExportService } from 'jslib/abstractions/export.service';\r\nimport { I18nService } from 'jslib/abstractions/i18n.service';\r\nimport { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';\r\nimport { UserService } from 'jslib/abstractions/user.service';\r\n\r\nimport { ExportComponent as BaseExportComponent } from '../../tools/export.component';\r\n\r\n@Component({\r\n selector: 'app-org-export',\r\n templateUrl: '../../tools/export.component.html',\r\n})\r\nexport class ExportComponent extends BaseExportComponent {\r\n organizationId: string;\r\n\r\n constructor(analytics: Angulartics2, toasterService: ToasterService,\r\n cryptoService: CryptoService, userService: UserService,\r\n i18nService: I18nService, platformUtilsService: PlatformUtilsService,\r\n exportService: ExportService, private route: ActivatedRoute) {\r\n super(analytics, toasterService, cryptoService, userService, i18nService, platformUtilsService,\r\n exportService);\r\n }\r\n\r\n ngOnInit() {\r\n this.route.parent.parent.params.subscribe(async (params) => {\r\n this.organizationId = params.organizationId;\r\n });\r\n }\r\n\r\n getExportData() {\r\n return this.exportService.getOrganizationExport(this.organizationId, 'csv');\r\n }\r\n\r\n getFileName() {\r\n return super.getFileName('org');\r\n }\r\n}\r\n","import { Component } from '@angular/core';\nimport {\n ActivatedRoute,\n Router,\n} from '@angular/router';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { CipherService } from 'jslib/abstractions/cipher.service';\nimport { CollectionService } from 'jslib/abstractions/collection.service';\nimport { FolderService } from 'jslib/abstractions/folder.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\n\nimport { Importer } from 'jslib/importers/importer';\n\nimport { CipherRequest } from 'jslib/models/request/cipherRequest';\nimport { CollectionRequest } from 'jslib/models/request/collectionRequest';\nimport { ImportOrganizationCiphersRequest } from 'jslib/models/request/importOrganizationCiphersRequest';\nimport { KvpRequest } from 'jslib/models/request/kvpRequest';\n\nimport { ImportResult } from 'jslib/models/domain/importResult';\n\nimport { ImportComponent as BaseImportComponent } from '../../tools/import.component';\n\n@Component({\n selector: 'app-org-import',\n templateUrl: '../../tools/import.component.html',\n})\nexport class ImportComponent extends BaseImportComponent {\n organizationId: string;\n\n constructor(i18nService: I18nService, analytics: Angulartics2,\n toasterService: ToasterService, cipherService: CipherService,\n folderService: FolderService, apiService: ApiService,\n router: Router, private collectionService: CollectionService,\n private route: ActivatedRoute) {\n super(i18nService, analytics, toasterService, cipherService, folderService, apiService, router);\n }\n\n ngOnInit() {\n this.route.parent.parent.params.subscribe(async (params) => {\n this.organizationId = params.organizationId;\n this.successNavigate = ['organizations', this.organizationId, 'vault'];\n super.ngOnInit();\n });\n }\n\n protected async postImport(importResult: ImportResult) {\n const request = new ImportOrganizationCiphersRequest();\n for (let i = 0; i < importResult.ciphers.length; i++) {\n importResult.ciphers[i].organizationId = this.organizationId;\n const c = await this.cipherService.encrypt(importResult.ciphers[i]);\n request.ciphers.push(new CipherRequest(c));\n }\n if (importResult.collections != null) {\n for (let i = 0; i < importResult.collections.length; i++) {\n importResult.collections[i].organizationId = this.organizationId;\n const c = await this.collectionService.encrypt(importResult.collections[i]);\n request.collections.push(new CollectionRequest(c));\n }\n }\n if (importResult.collectionRelationships != null) {\n importResult.collectionRelationships.forEach((r) =>\n request.collectionRelationships.push(new KvpRequest(r[0], r[1])));\n }\n return await this.apiService.postImportOrganizationCiphers(this.organizationId, request);\n }\n\n protected getImporter(): Importer {\n const importer = super.getImporter();\n if (importer != null) {\n importer.organization = true;\n }\n return importer;\n }\n}\n","import { Component } from '@angular/core';\r\n\r\n@Component({\r\n selector: 'app-org-tools',\r\n templateUrl: 'tools.component.html',\r\n})\r\nexport class ToolsComponent { }\r\n","import {\n Component,\n Input,\n OnInit,\n} from '@angular/core';\n\nimport { ToasterService } from 'angular2-toaster';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\n\nimport { EventService } from '../../services/event.service';\n\nimport { EventResponse } from 'jslib/models/response/eventResponse';\nimport { ListResponse } from 'jslib/models/response/listResponse';\n\n@Component({\n selector: 'app-entity-events',\n templateUrl: 'entity-events.component.html',\n})\nexport class EntityEventsComponent implements OnInit {\n @Input() name: string;\n @Input() entity: 'user' | 'cipher';\n @Input() entityId: string;\n @Input() organizationId: string;\n @Input() showUser = false;\n\n loading = true;\n loaded = false;\n events: any[];\n start: string;\n end: string;\n continuationToken: string;\n refreshPromise: Promise;\n morePromise: Promise;\n\n private orgUsersUserIdMap = new Map();\n private orgUsersIdMap = new Map();\n\n constructor(private apiService: ApiService, private i18nService: I18nService,\n private eventService: EventService, private toasterService: ToasterService) { }\n\n async ngOnInit() {\n const defaultDates = this.eventService.getDefaultDateFilters();\n this.start = defaultDates[0];\n this.end = defaultDates[1];\n await this.load();\n }\n\n async load() {\n if (this.showUser) {\n const response = await this.apiService.getOrganizationUsers(this.organizationId);\n response.data.forEach((u) => {\n const name = u.name == null || u.name.trim() === '' ? u.email : u.name;\n this.orgUsersIdMap.set(u.id, { name: name, email: u.email });\n this.orgUsersUserIdMap.set(u.userId, { name: name, email: u.email });\n });\n }\n await this.loadEvents(true);\n this.loaded = true;\n }\n\n async loadEvents(clearExisting: boolean) {\n if (this.refreshPromise != null || this.morePromise != null) {\n return;\n }\n\n let dates: string[] = null;\n try {\n dates = this.eventService.formatDateFilters(this.start, this.end);\n } catch (e) {\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'),\n this.i18nService.t('invalidDateRange'));\n return;\n }\n\n this.loading = true;\n let response: ListResponse;\n try {\n let promise: Promise;\n if (this.entity === 'user') {\n promise = this.apiService.getEventsOrganizationUser(this.organizationId, this.entityId,\n dates[0], dates[1], clearExisting ? null : this.continuationToken);\n } else {\n promise = this.apiService.getEventsCipher(this.entityId,\n dates[0], dates[1], clearExisting ? null : this.continuationToken);\n }\n if (clearExisting) {\n this.refreshPromise = promise;\n } else {\n this.morePromise = promise;\n }\n response = await promise;\n } catch { }\n\n this.continuationToken = response.continuationToken;\n const events = response.data.map((r) => {\n const userId = r.actingUserId == null ? r.userId : r.actingUserId;\n const eventInfo = this.eventService.getEventInfo(r);\n const user = this.showUser && userId != null && this.orgUsersUserIdMap.has(userId) ?\n this.orgUsersUserIdMap.get(userId) : null;\n return {\n message: eventInfo.message,\n appIcon: eventInfo.appIcon,\n appName: eventInfo.appName,\n userId: userId,\n userName: user != null ? user.name : this.showUser ? this.i18nService.t('unknown') : null,\n userEmail: user != null ? user.email : this.showUser ? '' : null,\n date: r.date,\n ip: r.ipAddress,\n type: r.type,\n };\n });\n\n if (!clearExisting && this.events != null && this.events.length > 0) {\n this.events = this.events.concat(events);\n } else {\n this.events = events;\n }\n\n this.loading = false;\n this.morePromise = null;\n this.refreshPromise = null;\n }\n}\n","import { Location } from '@angular/common';\nimport {\n Component,\n ComponentFactoryResolver,\n OnInit,\n ViewChild,\n ViewContainerRef,\n} from '@angular/core';\nimport {\n ActivatedRoute,\n Router,\n} from '@angular/router';\n\nimport { I18nService } from 'jslib/abstractions/i18n.service';\nimport { MessagingService } from 'jslib/abstractions/messaging.service';\nimport { SyncService } from 'jslib/abstractions/sync.service';\nimport { UserService } from 'jslib/abstractions/user.service';\n\nimport { Organization } from 'jslib/models/domain/organization';\nimport { CipherView } from 'jslib/models/view/cipherView';\n\nimport { CipherType } from 'jslib/enums/cipherType';\n\nimport { ModalComponent } from '../../modal.component';\n\nimport { EntityEventsComponent } from '../manage/entity-events.component';\nimport { AddEditComponent } from './add-edit.component';\nimport { AttachmentsComponent } from './attachments.component';\nimport { CiphersComponent } from './ciphers.component';\nimport { CollectionsComponent } from './collections.component';\nimport { GroupingsComponent } from './groupings.component';\n\n@Component({\n selector: 'app-org-vault',\n templateUrl: 'vault.component.html',\n})\nexport class VaultComponent implements OnInit {\n @ViewChild(GroupingsComponent) groupingsComponent: GroupingsComponent;\n @ViewChild(CiphersComponent) ciphersComponent: CiphersComponent;\n @ViewChild('attachments', { read: ViewContainerRef }) attachmentsModalRef: ViewContainerRef;\n @ViewChild('cipherAddEdit', { read: ViewContainerRef }) cipherAddEditModalRef: ViewContainerRef;\n @ViewChild('collections', { read: ViewContainerRef }) collectionsModalRef: ViewContainerRef;\n @ViewChild('eventsTemplate', { read: ViewContainerRef }) eventsModalRef: ViewContainerRef;\n\n organization: Organization;\n collectionId: string;\n type: CipherType;\n\n private modal: ModalComponent = null;\n\n constructor(private route: ActivatedRoute, private userService: UserService,\n private location: Location, private router: Router,\n private syncService: SyncService, private i18nService: I18nService,\n private componentFactoryResolver: ComponentFactoryResolver, private messagingService: MessagingService) { }\n\n ngOnInit() {\n this.route.parent.params.subscribe(async (params) => {\n this.organization = await this.userService.getOrganization(params.organizationId);\n this.groupingsComponent.organization = this.organization;\n this.ciphersComponent.organization = this.organization;\n\n this.route.queryParams.subscribe(async (qParams) => {\n if (!this.organization.isAdmin) {\n await this.syncService.fullSync(false);\n }\n await this.groupingsComponent.load();\n\n if (qParams == null) {\n this.groupingsComponent.selectedAll = true;\n await this.ciphersComponent.load();\n } else {\n if (qParams.type) {\n const t = parseInt(qParams.type, null);\n this.groupingsComponent.selectedType = t;\n await this.filterCipherType(t, true);\n } else if (qParams.collectionId) {\n this.groupingsComponent.selectedCollectionId = qParams.collectionId;\n await this.filterCollection(qParams.collectionId, true);\n } else {\n this.groupingsComponent.selectedAll = true;\n await this.ciphersComponent.load();\n }\n }\n\n this.ciphersComponent.searchText = this.groupingsComponent.searchText = qParams.search;\n if (qParams.viewEvents != null) {\n const cipher = this.ciphersComponent.ciphers.filter((c) => c.id === qParams.viewEvents);\n if (cipher.length > 0) {\n this.viewEvents(cipher[0]);\n }\n }\n });\n });\n }\n\n async clearGroupingFilters() {\n this.ciphersComponent.showAddNew = true;\n this.groupingsComponent.searchPlaceholder = this.i18nService.t('searchVault');\n await this.ciphersComponent.applyFilter();\n this.clearFilters();\n this.go();\n }\n\n async filterCipherType(type: CipherType, load = false) {\n this.ciphersComponent.showAddNew = true;\n this.groupingsComponent.searchPlaceholder = this.i18nService.t('searchType');\n const filter = (c: CipherView) => c.type === type;\n if (load) {\n await this.ciphersComponent.load(filter);\n } else {\n await this.ciphersComponent.applyFilter(filter);\n }\n this.clearFilters();\n this.type = type;\n this.go();\n }\n\n async filterCollection(collectionId: string, load = false) {\n this.ciphersComponent.showAddNew = false;\n this.groupingsComponent.searchPlaceholder = this.i18nService.t('searchCollection');\n const filter = (c: CipherView) => {\n if (collectionId === 'unassigned') {\n return c.collectionIds == null || c.collectionIds.length === 0;\n } else {\n return c.collectionIds.indexOf(collectionId) > -1;\n }\n };\n if (load) {\n await this.ciphersComponent.load(filter);\n } else {\n await this.ciphersComponent.applyFilter(filter);\n }\n this.clearFilters();\n this.collectionId = collectionId;\n this.go();\n }\n\n filterSearchText(searchText: string) {\n this.ciphersComponent.searchText = searchText;\n }\n\n editCipherAttachments(cipher: CipherView) {\n if (this.organization.maxStorageGb == null || this.organization.maxStorageGb === 0) {\n this.messagingService.send('upgradeOrganization', { organizationId: cipher.organizationId });\n return;\n }\n\n if (this.modal != null) {\n this.modal.close();\n }\n\n const factory = this.componentFactoryResolver.resolveComponentFactory(ModalComponent);\n this.modal = this.attachmentsModalRef.createComponent(factory).instance;\n const childComponent = this.modal.show(AttachmentsComponent, this.attachmentsModalRef);\n\n childComponent.organization = this.organization;\n childComponent.cipherId = cipher.id;\n let madeAttachmentChanges = false;\n childComponent.onUploadedAttachment.subscribe(() => madeAttachmentChanges = true);\n childComponent.onDeletedAttachment.subscribe(() => madeAttachmentChanges = true);\n\n this.modal.onClosed.subscribe(async () => {\n this.modal = null;\n if (madeAttachmentChanges) {\n await this.ciphersComponent.refresh();\n }\n madeAttachmentChanges = false;\n });\n }\n\n editCipherCollections(cipher: CipherView) {\n if (this.modal != null) {\n this.modal.close();\n }\n\n const factory = this.componentFactoryResolver.resolveComponentFactory(ModalComponent);\n this.modal = this.collectionsModalRef.createComponent(factory).instance;\n const childComponent = this.modal.show(CollectionsComponent, this.collectionsModalRef);\n\n if (this.organization.isAdmin) {\n childComponent.collectionIds = cipher.collectionIds;\n childComponent.collections = this.groupingsComponent.collections.filter((c) => !c.readOnly);\n }\n childComponent.organization = this.organization;\n childComponent.cipherId = cipher.id;\n childComponent.onSavedCollections.subscribe(async () => {\n this.modal.close();\n await this.ciphersComponent.refresh();\n });\n\n this.modal.onClosed.subscribe(async () => {\n this.modal = null;\n });\n }\n\n addCipher() {\n const component = this.editCipher(null);\n component.type = this.type;\n }\n\n editCipher(cipher: CipherView) {\n if (this.modal != null) {\n this.modal.close();\n }\n\n const factory = this.componentFactoryResolver.resolveComponentFactory(ModalComponent);\n this.modal = this.cipherAddEditModalRef.createComponent(factory).instance;\n const childComponent = this.modal.show(AddEditComponent, this.cipherAddEditModalRef);\n\n childComponent.organization = this.organization;\n childComponent.cipherId = cipher == null ? null : cipher.id;\n childComponent.onSavedCipher.subscribe(async (c: CipherView) => {\n this.modal.close();\n await this.ciphersComponent.refresh();\n });\n childComponent.onDeletedCipher.subscribe(async (c: CipherView) => {\n this.modal.close();\n await this.ciphersComponent.refresh();\n });\n\n this.modal.onClosed.subscribe(() => {\n this.modal = null;\n });\n\n return childComponent;\n }\n\n async viewEvents(cipher: CipherView) {\n if (this.modal != null) {\n this.modal.close();\n }\n\n const factory = this.componentFactoryResolver.resolveComponentFactory(ModalComponent);\n this.modal = this.eventsModalRef.createComponent(factory).instance;\n const childComponent = this.modal.show(\n EntityEventsComponent, this.eventsModalRef);\n\n childComponent.name = cipher.name;\n childComponent.organizationId = this.organization.id;\n childComponent.entityId = cipher.id;\n childComponent.showUser = true;\n childComponent.entity = 'cipher';\n\n this.modal.onClosed.subscribe(() => {\n this.modal = null;\n });\n }\n\n private clearFilters() {\n this.collectionId = null;\n this.type = null;\n }\n\n private go(queryParams: any = null) {\n if (queryParams == null) {\n queryParams = {\n type: this.type,\n collectionId: this.collectionId,\n };\n }\n\n const url = this.router.createUrlTree(['organizations', this.organization.id, 'vault'],\n { queryParams: queryParams }).toString();\n this.location.go(url);\n }\n}\n","import {\n Component,\n EventEmitter,\n Output,\n} from '@angular/core';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { CipherService } from 'jslib/abstractions/cipher.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\nimport { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';\n\nimport { CipherData } from 'jslib/models/data/cipherData';\nimport { Cipher } from 'jslib/models/domain/cipher';\nimport { Organization } from 'jslib/models/domain/organization';\nimport { CipherView } from 'jslib/models/view/cipherView';\n\nimport { CiphersComponent as BaseCiphersComponent } from '../../vault/ciphers.component';\n\n@Component({\n selector: 'app-org-vault-ciphers',\n templateUrl: '../../vault/ciphers.component.html',\n})\nexport class CiphersComponent extends BaseCiphersComponent {\n @Output() onEventsClicked = new EventEmitter();\n\n organization: Organization;\n accessEvents = false;\n\n constructor(cipherService: CipherService, analytics: Angulartics2,\n toasterService: ToasterService, i18nService: I18nService,\n platformUtilsService: PlatformUtilsService, private apiService: ApiService) {\n super(cipherService, analytics, toasterService, i18nService, platformUtilsService);\n }\n\n async load(filter: (cipher: CipherView) => boolean = null) {\n if (!this.organization.isAdmin) {\n await super.load();\n return;\n }\n this.accessEvents = this.organization.useEvents;\n const ciphers = await this.apiService.getCiphersOrganization(this.organization.id);\n if (ciphers != null && ciphers.data != null && ciphers.data.length) {\n const decCiphers: CipherView[] = [];\n const promises: any[] = [];\n ciphers.data.forEach((r) => {\n const data = new CipherData(r);\n const cipher = new Cipher(data);\n promises.push(cipher.decrypt().then((c) => decCiphers.push(c)));\n });\n await Promise.all(promises);\n decCiphers.sort(this.cipherService.getLocaleSortingFunction());\n this.allCiphers = decCiphers;\n } else {\n this.allCiphers = [];\n }\n this.applyFilter(filter);\n this.loaded = true;\n }\n\n applyFilter(filter: (cipher: CipherView) => boolean = null) {\n if (this.organization.isAdmin) {\n super.applyFilter(filter);\n } else {\n const f = (c: CipherView) => c.organizationId === this.organization.id && (filter == null || filter(c));\n super.applyFilter(f);\n }\n }\n\n checkCipher(c: CipherView) {\n // do nothing\n }\n\n events(c: CipherView) {\n this.onEventsClicked.emit(c);\n }\n}\n","import { Component } from '@angular/core';\r\n\r\nimport { ApiService } from 'jslib/abstractions/api.service';\r\nimport { CollectionService } from 'jslib/abstractions/collection.service';\r\nimport { FolderService } from 'jslib/abstractions/folder.service';\r\nimport { I18nService } from 'jslib/abstractions/i18n.service';\r\n\r\nimport { CollectionData } from 'jslib/models/data/collectionData';\r\nimport { Collection } from 'jslib/models/domain/collection';\r\nimport { Organization } from 'jslib/models/domain/organization';\r\nimport { CollectionDetailsResponse } from 'jslib/models/response/collectionResponse';\r\nimport { CollectionView } from 'jslib/models/view/collectionView';\r\n\r\nimport { GroupingsComponent as BaseGroupingsComponent } from '../../vault/groupings.component';\r\n\r\n@Component({\r\n selector: 'app-org-vault-groupings',\r\n templateUrl: '../../vault/groupings.component.html',\r\n})\r\nexport class GroupingsComponent extends BaseGroupingsComponent {\r\n organization: Organization;\r\n\r\n constructor(collectionService: CollectionService, folderService: FolderService,\r\n private apiService: ApiService, private i18nService: I18nService) {\r\n super(collectionService, folderService);\r\n }\r\n\r\n async loadCollections() {\r\n if (!this.organization.isAdmin) {\r\n await super.loadCollections(this.organization.id);\r\n return;\r\n }\r\n const collections = await this.apiService.getCollections(this.organization.id);\r\n if (collections != null && collections.data != null && collections.data.length) {\r\n const collectionDomains = collections.data.map((r) =>\r\n new Collection(new CollectionData(r as CollectionDetailsResponse)));\r\n this.collections = await this.collectionService.decryptMany(collectionDomains);\r\n } else {\r\n this.collections = [];\r\n }\r\n\r\n const unassignedCollection = new CollectionView();\r\n unassignedCollection.name = this.i18nService.t('unassigned');\r\n unassignedCollection.id = 'unassigned';\r\n unassignedCollection.organizationId = this.organization.id;\r\n unassignedCollection.readOnly = true;\r\n this.collections.push(unassignedCollection);\r\n }\r\n}\r\n","import {\r\n Component,\r\n OnInit,\r\n} from '@angular/core';\r\nimport { ActivatedRoute } from '@angular/router';\r\n\r\nimport { UserService } from 'jslib/abstractions/user.service';\r\n\r\nimport { Organization } from 'jslib/models/domain/organization';\r\n\r\n@Component({\r\n selector: 'app-organization-layout',\r\n templateUrl: 'organization-layout.component.html',\r\n})\r\nexport class OrganizationLayoutComponent implements OnInit {\r\n organization: Organization;\r\n\r\n private organizationId: string;\r\n\r\n constructor(private route: ActivatedRoute, private userService: UserService) { }\r\n\r\n ngOnInit() {\r\n document.body.classList.remove('layout_frontend');\r\n this.route.params.subscribe(async (params) => {\r\n this.organizationId = params.organizationId;\r\n await this.load();\r\n });\r\n }\r\n\r\n async load() {\r\n this.organization = await this.userService.getOrganization(this.organizationId);\r\n }\r\n}\r\n","import {\r\n Component,\r\n OnInit,\r\n} from '@angular/core';\r\n\r\nimport { AuditService } from 'jslib/abstractions/audit.service';\r\nimport { UserService } from 'jslib/abstractions/user.service';\r\nimport { BreachAccountResponse } from 'jslib/models/response/breachAccountResponse';\r\n\r\n@Component({\r\n selector: 'app-breach-report',\r\n templateUrl: 'breach-report.component.html',\r\n})\r\nexport class BreachReportComponent implements OnInit {\r\n error = false;\r\n username: string;\r\n checkedUsername: string;\r\n breachedAccounts: BreachAccountResponse[] = [];\r\n formPromise: Promise;\r\n\r\n constructor(private auditService: AuditService, private userService: UserService) { }\r\n\r\n async ngOnInit() {\r\n this.username = await this.userService.getEmail();\r\n }\r\n\r\n async submit() {\r\n this.error = false;\r\n this.username = this.username.toLowerCase();\r\n try {\r\n this.formPromise = this.auditService.breachedAccounts(this.username);\r\n this.breachedAccounts = await this.formPromise;\r\n } catch {\r\n this.error = true;\r\n }\r\n this.checkedUsername = this.username;\r\n }\r\n}\r\n","import { ToasterService } from 'angular2-toaster';\r\nimport { Angulartics2 } from 'angulartics2';\r\n\r\nimport {\r\n Component,\r\n ComponentFactoryResolver,\r\n ViewChild,\r\n ViewContainerRef,\r\n} from '@angular/core';\r\n\r\nimport { I18nService } from 'jslib/abstractions/i18n.service';\r\nimport { PasswordGenerationService } from 'jslib/abstractions/passwordGeneration.service';\r\nimport { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';\r\n\r\nimport {\r\n PasswordGeneratorComponent as BasePasswordGeneratorComponent,\r\n} from 'jslib/angular/components/password-generator.component';\r\n\r\nimport { ModalComponent } from '../modal.component';\r\nimport { PasswordGeneratorHistoryComponent } from './password-generator-history.component';\r\n\r\n@Component({\r\n selector: 'app-password-generator',\r\n templateUrl: 'password-generator.component.html',\r\n})\r\nexport class PasswordGeneratorComponent extends BasePasswordGeneratorComponent {\r\n @ViewChild('historyTemplate', { read: ViewContainerRef }) historyModalRef: ViewContainerRef;\r\n\r\n private modal: ModalComponent = null;\r\n\r\n constructor(passwordGenerationService: PasswordGenerationService, analytics: Angulartics2,\r\n platformUtilsService: PlatformUtilsService, i18nService: I18nService,\r\n toasterService: ToasterService, private componentFactoryResolver: ComponentFactoryResolver) {\r\n super(passwordGenerationService, analytics, platformUtilsService, i18nService, toasterService, window);\r\n }\r\n\r\n history() {\r\n if (this.modal != null) {\r\n this.modal.close();\r\n }\r\n\r\n const factory = this.componentFactoryResolver.resolveComponentFactory(ModalComponent);\r\n this.modal = this.historyModalRef.createComponent(factory).instance;\r\n this.modal.show(PasswordGeneratorHistoryComponent, this.historyModalRef);\r\n\r\n this.modal.onClosed.subscribe(async () => {\r\n this.modal = null;\r\n });\r\n }\r\n}\r\n","import { Component } from '@angular/core';\r\n\r\n@Component({\r\n selector: 'app-tools',\r\n templateUrl: 'tools.component.html',\r\n})\r\nexport class ToolsComponent { }\r\n","import {\n Component,\n OnInit,\n ViewChild,\n} from '@angular/core';\nimport {\n ActivatedRoute,\n Router,\n} from '@angular/router';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { CryptoService } from 'jslib/abstractions/crypto.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\nimport { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';\nimport { SyncService } from 'jslib/abstractions/sync.service';\n\nimport { PaymentComponent } from './payment.component';\n\nimport { PlanType } from 'jslib/enums/planType';\nimport { OrganizationCreateRequest } from 'jslib/models/request/organizationCreateRequest';\n\n@Component({\n selector: 'app-create-organization',\n templateUrl: 'create-organization.component.html',\n})\nexport class CreateOrganizationComponent implements OnInit {\n @ViewChild(PaymentComponent) paymentComponent: PaymentComponent;\n\n selfHosted = false;\n ownedBusiness = false;\n storageGbPriceMonthly = 0.33;\n additionalStorage = 0;\n additionalSeats = 0;\n plan = 'free';\n interval = 'year';\n name: string;\n billingEmail: string;\n businessName: string;\n\n storageGb: any = {\n price: 0.33,\n monthlyPrice: 0.50,\n yearlyPrice: 4,\n };\n\n plans: any = {\n free: {\n basePrice: 0,\n noAdditionalSeats: true,\n noPayment: true,\n },\n families: {\n basePrice: 1,\n annualBasePrice: 12,\n baseSeats: 5,\n noAdditionalSeats: true,\n annualPlanType: PlanType.FamiliesAnnually,\n },\n teams: {\n basePrice: 5,\n annualBasePrice: 60,\n monthlyBasePrice: 8,\n baseSeats: 5,\n seatPrice: 2,\n annualSeatPrice: 24,\n monthlySeatPrice: 2.5,\n monthPlanType: PlanType.TeamsMonthly,\n annualPlanType: PlanType.TeamsAnnually,\n },\n enterprise: {\n seatPrice: 3,\n annualSeatPrice: 36,\n monthlySeatPrice: 4,\n monthPlanType: PlanType.EnterpriseMonthly,\n annualPlanType: PlanType.EnterpriseAnnually,\n },\n };\n\n formPromise: Promise;\n\n constructor(private apiService: ApiService, private i18nService: I18nService,\n private analytics: Angulartics2, private toasterService: ToasterService,\n platformUtilsService: PlatformUtilsService, private cryptoService: CryptoService,\n private router: Router, private syncService: SyncService,\n private route: ActivatedRoute) {\n this.selfHosted = platformUtilsService.isSelfHost();\n }\n\n ngOnInit() {\n this.route.queryParams.subscribe(async (qParams) => {\n if (qParams.plan === 'families' || qParams.plan === 'teams' || qParams.plan === 'enterprise') {\n this.plan = qParams.plan;\n }\n });\n }\n\n async submit() {\n let files: FileList = null;\n if (this.selfHosted) {\n const fileEl = document.getElementById('file') as HTMLInputElement;\n files = fileEl.files;\n if (files == null || files.length === 0) {\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'),\n this.i18nService.t('selectFile'));\n return;\n }\n }\n\n let key: string = null;\n let collectionCt: string = null;\n\n try {\n this.formPromise = this.cryptoService.makeShareKey().then((shareKey) => {\n key = shareKey[0].encryptedString;\n return this.cryptoService.encrypt(this.i18nService.t('defaultCollection'), shareKey[1]);\n }).then((collection) => {\n collectionCt = collection.encryptedString;\n if (this.selfHosted || this.plan === 'free') {\n return null;\n } else {\n return this.paymentComponent.createPaymentToken();\n }\n }).then((token: string) => {\n if (this.selfHosted) {\n const fd = new FormData();\n fd.append('license', files[0]);\n fd.append('key', key);\n fd.append('collectionName', collectionCt);\n return this.apiService.postOrganizationLicense(fd);\n } else {\n const request = new OrganizationCreateRequest();\n request.key = key;\n request.collectionName = collectionCt;\n request.name = this.name;\n request.billingEmail = this.billingEmail;\n\n if (this.plan === 'free') {\n request.planType = PlanType.Free;\n } else {\n request.paymentToken = token;\n request.businessName = this.ownedBusiness ? this.businessName : null;\n request.additionalSeats = this.additionalSeats;\n request.additionalStorageGb = this.additionalStorage;\n request.country = this.paymentComponent.getCountry();\n if (this.interval === 'month') {\n request.planType = this.plans[this.plan].monthPlanType;\n } else {\n request.planType = this.plans[this.plan].annualPlanType;\n }\n }\n return this.apiService.postOrganization(request);\n }\n }).then((response) => {\n return this.finalize(response.id);\n });\n await this.formPromise;\n } catch { }\n }\n\n async finalize(orgId: string) {\n await Promise.all([\n this.apiService.refreshIdentityToken(),\n this.syncService.fullSync(true),\n ]);\n this.analytics.eventTrack.next({ action: 'Created Organization' });\n this.toasterService.popAsync('success', this.i18nService.t('organizationCreated'),\n this.i18nService.t('organizationReadyToGo'));\n this.router.navigate(['/organizations/' + orgId]);\n }\n\n changedPlan() {\n if (this.plans[this.plan].monthPlanType == null) {\n this.interval = 'year';\n }\n\n if (this.plans[this.plan].noAdditionalSeats) {\n this.additionalSeats = 0;\n } else if (!this.additionalSeats && !this.plans[this.plan].baseSeats &&\n !this.plans[this.plan].noAdditionalSeats) {\n this.additionalSeats = 1;\n }\n }\n\n changedOwnedBusiness() {\n if (!this.ownedBusiness || this.plan === 'teams' || this.plan === 'enterprise') {\n return;\n }\n this.plan = 'teams';\n }\n\n additionalStorageTotal(annual: boolean): number {\n if (annual) {\n return (this.additionalStorage || 0) * this.storageGb.yearlyPrice;\n } else {\n return (this.additionalStorage || 0) * this.storageGb.monthlyPrice;\n }\n }\n\n seatTotal(annual: boolean): number {\n if (this.plans[this.plan].noAdditionalSeats) {\n return 0;\n }\n\n if (annual) {\n return this.plans[this.plan].annualSeatPrice * (this.additionalSeats || 0);\n } else {\n return this.plans[this.plan].monthlySeatPrice * (this.additionalSeats || 0);\n }\n }\n\n baseTotal(annual: boolean): number {\n if (annual) {\n return (this.plans[this.plan].annualBasePrice || 0);\n } else {\n return (this.plans[this.plan].monthlyBasePrice || 0);\n }\n }\n\n get total(): number {\n const annual = this.interval === 'year';\n return this.baseTotal(annual) + this.seatTotal(annual) + this.additionalStorageTotal(annual);\n }\n}\n","import {\n Component,\n OnInit,\n} from '@angular/core';\nimport { Router } from '@angular/router';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { BillingResponse } from 'jslib/models/response/billingResponse';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\nimport { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';\nimport { TokenService } from 'jslib/abstractions/token.service';\n\nimport { PaymentMethodType } from 'jslib/enums/paymentMethodType';\n\n@Component({\n selector: 'app-user-billing',\n templateUrl: 'user-billing.component.html',\n})\nexport class UserBillingComponent implements OnInit {\n loading = false;\n firstLoaded = false;\n adjustStorageAdd = true;\n showAdjustStorage = false;\n showAdjustPayment = false;\n showUpdateLicense = false;\n billing: BillingResponse;\n paymentMethodType = PaymentMethodType;\n selfHosted = false;\n\n cancelPromise: Promise;\n reinstatePromise: Promise;\n\n constructor(private tokenService: TokenService, private apiService: ApiService,\n private platformUtilsService: PlatformUtilsService, private i18nService: I18nService,\n private analytics: Angulartics2, private toasterService: ToasterService,\n private router: Router) {\n this.selfHosted = platformUtilsService.isSelfHost();\n }\n\n async ngOnInit() {\n await this.load();\n this.firstLoaded = true;\n }\n\n async load() {\n if (this.loading) {\n return;\n }\n\n const premium = this.tokenService.getPremium();\n if (premium) {\n this.loading = true;\n this.billing = await this.apiService.getUserBilling();\n } else {\n this.router.navigate(['/settings/premium']);\n return;\n }\n\n this.loading = false;\n }\n\n async reinstate() {\n if (this.loading) {\n return;\n }\n\n const confirmed = await this.platformUtilsService.showDialog(this.i18nService.t('reinstateConfirmation'),\n this.i18nService.t('reinstateSubscription'), this.i18nService.t('yes'), this.i18nService.t('cancel'));\n if (!confirmed) {\n return;\n }\n\n try {\n this.reinstatePromise = this.apiService.postReinstatePremium();\n await this.reinstatePromise;\n this.analytics.eventTrack.next({ action: 'Reinstated Premium' });\n this.toasterService.popAsync('success', null, this.i18nService.t('reinstated'));\n this.load();\n } catch { }\n }\n\n async cancel() {\n if (this.loading) {\n return;\n }\n\n const confirmed = await this.platformUtilsService.showDialog(this.i18nService.t('cancelConfirmation'),\n this.i18nService.t('cancelSubscription'), this.i18nService.t('yes'), this.i18nService.t('no'), 'warning');\n if (!confirmed) {\n return;\n }\n\n try {\n this.cancelPromise = this.apiService.postCancelPremium();\n await this.cancelPromise;\n this.analytics.eventTrack.next({ action: 'Canceled Premium' });\n this.toasterService.popAsync('success', null, this.i18nService.t('canceledSubscription'));\n this.load();\n } catch { }\n }\n\n downloadLicense() {\n if (this.loading) {\n return;\n }\n\n const licenseString = JSON.stringify(this.billing.license, null, 2);\n this.platformUtilsService.saveFile(window, licenseString, null, 'bitwarden_premium_license.json');\n }\n\n updateLicense() {\n if (this.loading) {\n return;\n }\n this.showUpdateLicense = true;\n }\n\n closeUpdateLicense(load: boolean) {\n this.showUpdateLicense = false;\n if (load) {\n this.load();\n }\n }\n\n adjustStorage(add: boolean) {\n this.adjustStorageAdd = add;\n this.showAdjustStorage = true;\n }\n\n closeStorage(load: boolean) {\n this.showAdjustStorage = false;\n if (load) {\n this.load();\n }\n }\n\n changePayment() {\n this.showAdjustPayment = true;\n }\n\n closePayment(load: boolean) {\n this.showAdjustPayment = false;\n if (load) {\n this.load();\n }\n }\n\n get subscriptionMarkedForCancel() {\n return this.subscription != null && !this.subscription.cancelled && this.subscription.cancelAtEndDate;\n }\n\n get subscription() {\n return this.billing != null ? this.billing.subscription : null;\n }\n\n get nextInvoice() {\n return this.billing != null ? this.billing.upcomingInvoice : null;\n }\n\n get paymentSource() {\n return this.billing != null ? this.billing.paymentSource : null;\n }\n\n get charges() {\n return this.billing != null ? this.billing.charges : null;\n }\n\n get storagePercentage() {\n return this.billing != null && this.billing.maxStorageGb ?\n +(100 * (this.billing.storageGb / this.billing.maxStorageGb)).toFixed(2) : 0;\n }\n\n get storageProgressWidth() {\n return this.storagePercentage < 5 ? 5 : 0;\n }\n}\n","export enum PaymentMethodType {\n Card = 0,\n BankAccount = 1,\n PayPal = 2,\n Bitcoin = 3,\n}\n","import {\n Component,\n EventEmitter,\n Input,\n Output,\n ViewChild,\n} from '@angular/core';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\n\nimport { PaymentRequest } from 'jslib/models/request/paymentRequest';\n\nimport { PaymentMethodType } from 'jslib/enums/paymentMethodType';\n\nimport { PaymentComponent } from './payment.component';\n\n@Component({\n selector: 'app-adjust-payment',\n templateUrl: 'adjust-payment.component.html',\n})\nexport class AdjustPaymentComponent {\n @ViewChild(PaymentComponent) paymentComponent: PaymentComponent;\n\n @Input() currentType?: PaymentMethodType;\n @Input() organizationId: string;\n @Output() onAdjusted = new EventEmitter();\n @Output() onCanceled = new EventEmitter();\n\n paymentMethodType = PaymentMethodType;\n formPromise: Promise;\n\n constructor(private apiService: ApiService, private i18nService: I18nService,\n private analytics: Angulartics2, private toasterService: ToasterService) { }\n\n async submit() {\n try {\n const request = new PaymentRequest();\n this.formPromise = this.paymentComponent.createPaymentToken().then((token) => {\n request.paymentToken = token;\n if (this.organizationId == null) {\n return this.apiService.postAccountPayment(request);\n } else {\n return this.apiService.postOrganizationPayment(this.organizationId, request);\n }\n });\n await this.formPromise;\n this.analytics.eventTrack.next({\n action: this.currentType == null ? 'Added Payment Method' : 'Changed Payment Method',\n });\n this.toasterService.popAsync('success', null, this.i18nService.t('updatedPaymentMethod'));\n this.onAdjusted.emit();\n } catch { }\n }\n\n cancel() {\n this.onCanceled.emit();\n }\n\n get canChange() {\n return this.currentType == null || this.currentType === PaymentMethodType.Card || this.organizationId != null;\n }\n}\n","import {\n Component,\n EventEmitter,\n Input,\n Output,\n} from '@angular/core';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\n\nimport { StorageRequest } from 'jslib/models/request/storageRequest';\n\n@Component({\n selector: 'app-adjust-storage',\n templateUrl: 'adjust-storage.component.html',\n})\nexport class AdjustStorageComponent {\n @Input() storageGbPrice = 0;\n @Input() add = true;\n @Input() organizationId: string;\n @Input() interval = 'year';\n @Output() onAdjusted = new EventEmitter();\n @Output() onCanceled = new EventEmitter();\n\n storageAdjustment = 0;\n formPromise: Promise;\n\n constructor(private apiService: ApiService, private i18nService: I18nService,\n private analytics: Angulartics2, private toasterService: ToasterService) { }\n\n async submit() {\n try {\n const request = new StorageRequest();\n request.storageGbAdjustment = this.storageAdjustment;\n if (!this.add) {\n request.storageGbAdjustment *= -1;\n }\n\n if (this.organizationId == null) {\n this.formPromise = this.apiService.postAccountStorage(request);\n } else {\n this.formPromise = this.apiService.postOrganizationStorage(this.organizationId, request);\n }\n await this.formPromise;\n this.analytics.eventTrack.next({ action: this.add ? 'Added Storage' : 'Removed Storage' });\n this.toasterService.popAsync('success', null,\n this.i18nService.t('adjustedStorage', request.storageGbAdjustment.toString()));\n this.onAdjusted.emit(this.storageAdjustment);\n } catch { }\n }\n\n cancel() {\n this.onCanceled.emit();\n }\n\n get adjustedStorageTotal(): number {\n return this.storageGbPrice * this.storageAdjustment;\n }\n}\n","import {\n Component,\n EventEmitter,\n Input,\n Output,\n} from '@angular/core';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\n\n@Component({\n selector: 'app-update-license',\n templateUrl: 'update-license.component.html',\n})\nexport class UpdateLicenseComponent {\n @Input() organizationId: string;\n @Output() onUpdated = new EventEmitter();\n @Output() onCanceled = new EventEmitter();\n\n formPromise: Promise;\n\n constructor(private apiService: ApiService, private i18nService: I18nService,\n private analytics: Angulartics2, private toasterService: ToasterService) { }\n\n async submit() {\n const fileEl = document.getElementById('file') as HTMLInputElement;\n const files = fileEl.files;\n if (files == null || files.length === 0) {\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'),\n this.i18nService.t('selectFile'));\n return;\n }\n\n try {\n const fd = new FormData();\n fd.append('license', files[0]);\n\n if (this.organizationId == null) {\n this.formPromise = this.apiService.postAccountLicense(fd);\n } else {\n this.formPromise = this.apiService.postOrganizationLicenseUpdate(this.organizationId, fd);\n }\n\n await this.formPromise;\n this.analytics.eventTrack.next({ action: 'Updated License' });\n this.toasterService.popAsync('success', null, this.i18nService.t('updatedLicense'));\n this.onUpdated.emit();\n } catch { }\n }\n\n cancel() {\n this.onCanceled.emit();\n }\n}\n","import {\n Component,\n OnInit,\n ViewChild,\n} from '@angular/core';\nimport { Router } from '@angular/router';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\nimport { MessagingService } from 'jslib/abstractions/messaging.service';\nimport { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';\nimport { SyncService } from 'jslib/abstractions/sync.service';\nimport { TokenService } from 'jslib/abstractions/token.service';\n\nimport { PaymentComponent } from './payment.component';\n\n@Component({\n selector: 'app-premium',\n templateUrl: 'premium.component.html',\n})\nexport class PremiumComponent implements OnInit {\n @ViewChild(PaymentComponent) paymentComponent: PaymentComponent;\n\n selfHosted = false;\n premiumPrice = 10;\n storageGbPrice = 4;\n additionalStorage = 0;\n\n formPromise: Promise;\n\n constructor(private apiService: ApiService, private i18nService: I18nService,\n private analytics: Angulartics2, private toasterService: ToasterService,\n platformUtilsService: PlatformUtilsService, private tokenService: TokenService,\n private router: Router, private messagingService: MessagingService,\n private syncService: SyncService) {\n this.selfHosted = platformUtilsService.isSelfHost();\n }\n\n async ngOnInit() {\n const premium = await this.tokenService.getPremium();\n if (premium) {\n this.router.navigate(['/settings/billing']);\n return;\n }\n }\n\n async submit() {\n let files: FileList = null;\n if (this.selfHosted) {\n const fileEl = document.getElementById('file') as HTMLInputElement;\n files = fileEl.files;\n if (files == null || files.length === 0) {\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'),\n this.i18nService.t('selectFile'));\n return;\n }\n }\n\n try {\n if (this.selfHosted) {\n if (!this.tokenService.getEmailVerified()) {\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'),\n this.i18nService.t('verifyEmailFirst'));\n return;\n }\n\n const fd = new FormData();\n fd.append('license', files[0]);\n this.formPromise = this.apiService.postAccountLicense(fd).then(() => {\n return this.finalizePremium();\n });\n } else {\n this.formPromise = this.paymentComponent.createPaymentToken().then((token) => {\n const fd = new FormData();\n fd.append('paymentToken', token);\n fd.append('additionalStorageGb', (this.additionalStorage || 0).toString());\n return this.apiService.postPremium(fd);\n }).then(() => {\n return this.finalizePremium();\n });\n }\n await this.formPromise;\n } catch { }\n }\n\n async finalizePremium() {\n await Promise.all([\n this.apiService.refreshIdentityToken(),\n this.syncService.fullSync(true),\n ]);\n this.analytics.eventTrack.next({ action: 'Signed Up Premium' });\n this.toasterService.popAsync('success', null, this.i18nService.t('premiumUpdated'));\n this.messagingService.send('purchasedPremium');\n this.router.navigate(['/settings/billing']);\n }\n\n get additionalStorageTotal(): number {\n return this.storageGbPrice * this.additionalStorage;\n }\n\n get total(): number {\n return this.additionalStorageTotal + this.premiumPrice;\n }\n}\n","
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n\n
\n
\n \n \n
\n
\n \"Visa,\n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n
\n\n
\n
\n {{'paypalClickSubmit' | i18n}}\n
\n
\n\n \n {{'verifyBankAccountInitialDesc' | i18n}} {{'verifyBankAccountFailureWarning' | i18n}}\n \n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n
\n","import { Component } from '@angular/core';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\nimport { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';\n\nimport { TwoFactorProviderType } from 'jslib/enums/twoFactorProviderType';\nimport { UpdateTwoFactorDuoRequest } from 'jslib/models/request/updateTwoFactorDuoRequest';\nimport { TwoFactorDuoResponse } from 'jslib/models/response/twoFactorDuoResponse';\n\nimport { TwoFactorBaseComponent } from './two-factor-base.component';\n\n@Component({\n selector: 'app-two-factor-duo',\n templateUrl: 'two-factor-duo.component.html',\n})\nexport class TwoFactorDuoComponent extends TwoFactorBaseComponent {\n type = TwoFactorProviderType.Duo;\n ikey: string;\n skey: string;\n host: string;\n formPromise: Promise;\n\n constructor(apiService: ApiService, i18nService: I18nService,\n analytics: Angulartics2, toasterService: ToasterService,\n platformUtilsService: PlatformUtilsService) {\n super(apiService, i18nService, analytics, toasterService, platformUtilsService);\n }\n\n auth(authResponse: any) {\n super.auth(authResponse);\n this.processResponse(authResponse.response);\n }\n\n submit() {\n if (this.enabled) {\n return super.disable(this.formPromise);\n } else {\n return this.enable();\n }\n }\n\n protected enable() {\n const request = new UpdateTwoFactorDuoRequest();\n request.masterPasswordHash = this.masterPasswordHash;\n request.integrationKey = this.ikey;\n request.secretKey = this.skey;\n request.host = this.host;\n\n return super.enable(async () => {\n if (this.organizationId != null) {\n this.formPromise = this.apiService.putTwoFactorOrganizationDuo(this.organizationId, request);\n } else {\n this.formPromise = this.apiService.putTwoFactorDuo(request);\n }\n const response = await this.formPromise;\n await this.processResponse(response);\n });\n }\n\n private processResponse(response: TwoFactorDuoResponse) {\n this.ikey = response.integrationKey;\n this.skey = response.secretKey;\n this.host = response.host;\n this.enabled = response.enabled;\n }\n}\n","import {\n Component,\n OnInit,\n} from '@angular/core';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\n\nimport { UpdateDomainsRequest } from 'jslib/models/request/updateDomainsRequest';\n\n@Component({\n selector: 'app-domain-rules',\n templateUrl: 'domain-rules.component.html',\n})\nexport class DomainRulesComponent implements OnInit {\n loading = true;\n custom: string[] = [];\n global: any[] = [];\n formPromise: Promise;\n\n constructor(private apiService: ApiService, private i18nService: I18nService,\n private analytics: Angulartics2, private toasterService: ToasterService) { }\n\n async ngOnInit() {\n const response = await this.apiService.getSettingsDomains();\n this.loading = false;\n if (response.equivalentDomains != null) {\n this.custom = response.equivalentDomains.map((d) => d.join(', '));\n }\n if (response.globalEquivalentDomains != null) {\n this.global = response.globalEquivalentDomains.map((d) => {\n return {\n domains: d.domains.join(', '),\n excluded: d.excluded,\n key: d.type,\n };\n });\n }\n }\n\n toggleExcluded(globalDomain: any) {\n globalDomain.excluded = !globalDomain.excluded;\n }\n\n customize(globalDomain: any) {\n globalDomain.excluded = true;\n this.custom.push(globalDomain.domains);\n }\n\n remove(index: number) {\n this.custom.splice(index, 1);\n }\n\n add() {\n this.custom.push('');\n }\n\n async submit() {\n const request = new UpdateDomainsRequest();\n request.excludedGlobalEquivalentDomains = this.global.filter((d) => d.excluded)\n .map((d) => d.key);\n if (request.excludedGlobalEquivalentDomains.length === 0) {\n request.excludedGlobalEquivalentDomains = null;\n }\n request.equivalentDomains = this.custom.filter((d) => d != null && d.trim() !== '')\n .map((d) => d.split(',').map((d2) => d2.trim()));\n if (request.equivalentDomains.length === 0) {\n request.equivalentDomains = null;\n }\n\n try {\n this.formPromise = this.apiService.putSettingsDomains(request);\n await this.formPromise;\n this.analytics.eventTrack.next({ action: 'Saved Equivalent Domains' });\n this.toasterService.popAsync('success', null, this.i18nService.t('domainsUpdated'));\n } catch { }\n }\n\n indexTrackBy(index: number, obj: any): any {\n return index;\n }\n}\n","import {\n Component,\n OnInit,\n} from '@angular/core';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { I18nService } from 'jslib/abstractions/i18n.service';\nimport { StateService } from 'jslib/abstractions/state.service';\nimport { StorageService } from 'jslib/abstractions/storage.service';\n\nimport { ConstantsService } from 'jslib/services/constants.service';\n\nimport { Utils } from 'jslib/misc/utils';\n\n@Component({\n selector: 'app-options',\n templateUrl: 'options.component.html',\n})\nexport class OptionsComponent implements OnInit {\n disableIcons: boolean;\n locale: string;\n localeOptions: any[];\n\n private startingLocale: string;\n\n constructor(private storageService: StorageService, private stateService: StateService,\n private analytics: Angulartics2, private i18nService: I18nService,\n private toasterService: ToasterService) {\n const localeOptions: any[] = [];\n i18nService.supportedTranslationLocales.forEach((locale) => {\n localeOptions.push({ name: locale, value: locale });\n });\n localeOptions.sort(Utils.getSortFunction(i18nService, 'name'));\n localeOptions.splice(0, 0, { name: i18nService.t('default'), value: null });\n this.localeOptions = localeOptions;\n }\n\n async ngOnInit() {\n this.disableIcons = await this.storageService.get(ConstantsService.disableFaviconKey);\n this.locale = this.startingLocale = await this.storageService.get(ConstantsService.localeKey);\n }\n\n async submit() {\n await this.storageService.save(ConstantsService.disableFaviconKey, this.disableIcons);\n await this.stateService.save(ConstantsService.disableFaviconKey, this.disableIcons);\n await this.storageService.save(ConstantsService.localeKey, this.locale);\n this.analytics.eventTrack.next({ action: 'Saved Options' });\n if (this.locale !== this.startingLocale) {\n window.location.reload();\n } else {\n this.toasterService.popAsync('success', null, this.i18nService.t('optionsUpdated'));\n }\n }\n}\n","import {\r\n Component,\r\n ComponentFactoryResolver,\r\n ViewChild,\r\n ViewContainerRef,\r\n} from '@angular/core';\r\n\r\nimport { ModalComponent } from '../modal.component';\r\nimport { DeauthorizeSessionsComponent } from './deauthorize-sessions.component';\r\nimport { DeleteAccountComponent } from './delete-account.component';\r\nimport { PurgeVaultComponent } from './purge-vault.component';\r\n\r\n@Component({\r\n selector: 'app-account',\r\n templateUrl: 'account.component.html',\r\n})\r\nexport class AccountComponent {\r\n @ViewChild('deauthorizeSessionsTemplate', { read: ViewContainerRef }) deauthModalRef: ViewContainerRef;\r\n @ViewChild('purgeVaultTemplate', { read: ViewContainerRef }) purgeModalRef: ViewContainerRef;\r\n @ViewChild('deleteAccountTemplate', { read: ViewContainerRef }) deleteModalRef: ViewContainerRef;\r\n\r\n private modal: ModalComponent = null;\r\n\r\n constructor(private componentFactoryResolver: ComponentFactoryResolver) { }\r\n\r\n deauthorizeSessions() {\r\n if (this.modal != null) {\r\n this.modal.close();\r\n }\r\n\r\n const factory = this.componentFactoryResolver.resolveComponentFactory(ModalComponent);\r\n this.modal = this.deauthModalRef.createComponent(factory).instance;\r\n this.modal.show(DeauthorizeSessionsComponent, this.deauthModalRef);\r\n\r\n this.modal.onClosed.subscribe(async () => {\r\n this.modal = null;\r\n });\r\n }\r\n\r\n purgeVault() {\r\n if (this.modal != null) {\r\n this.modal.close();\r\n }\r\n\r\n const factory = this.componentFactoryResolver.resolveComponentFactory(ModalComponent);\r\n this.modal = this.purgeModalRef.createComponent(factory).instance;\r\n this.modal.show(PurgeVaultComponent, this.purgeModalRef);\r\n\r\n this.modal.onClosed.subscribe(async () => {\r\n this.modal = null;\r\n });\r\n }\r\n\r\n deleteAccount() {\r\n if (this.modal != null) {\r\n this.modal.close();\r\n }\r\n\r\n const factory = this.componentFactoryResolver.resolveComponentFactory(ModalComponent);\r\n this.modal = this.deleteModalRef.createComponent(factory).instance;\r\n this.modal.show(DeleteAccountComponent, this.deleteModalRef);\r\n\r\n this.modal.onClosed.subscribe(async () => {\r\n this.modal = null;\r\n });\r\n }\r\n}\r\n","import {\r\n Component,\r\n NgZone,\r\n OnDestroy,\r\n OnInit,\r\n} from '@angular/core';\r\n\r\nimport { TokenService } from 'jslib/abstractions/token.service';\r\n\r\nimport { BroadcasterService } from 'jslib/angular/services/broadcaster.service';\r\n\r\nconst BroadcasterSubscriptionId = 'SettingsComponent';\r\n\r\n@Component({\r\n selector: 'app-settings',\r\n templateUrl: 'settings.component.html',\r\n})\r\nexport class SettingsComponent implements OnInit, OnDestroy {\r\n premium: boolean;\r\n\r\n constructor(private tokenService: TokenService, private broadcasterService: BroadcasterService,\r\n private ngZone: NgZone) { }\r\n\r\n async ngOnInit() {\r\n this.broadcasterService.subscribe(BroadcasterSubscriptionId, async (message: any) => {\r\n this.ngZone.run(async () => {\r\n switch (message.command) {\r\n case 'purchasedPremium':\r\n await this.load();\r\n break;\r\n default:\r\n }\r\n });\r\n });\r\n\r\n await this.load();\r\n }\r\n\r\n ngOnDestroy() {\r\n this.broadcasterService.unsubscribe(BroadcasterSubscriptionId);\r\n }\r\n\r\n async load() {\r\n this.premium = await this.tokenService.getPremium();\r\n }\r\n}\r\n","import {\r\n Component,\r\n EventEmitter,\r\n Input,\r\n OnDestroy,\r\n OnInit,\r\n Output,\r\n} from '@angular/core';\r\n\r\nimport { ToasterService } from 'angular2-toaster';\r\nimport { Angulartics2 } from 'angulartics2';\r\n\r\nimport { CipherService } from 'jslib/abstractions/cipher.service';\r\nimport { CollectionService } from 'jslib/abstractions/collection.service';\r\nimport { I18nService } from 'jslib/abstractions/i18n.service';\r\n\r\nimport { CipherView } from 'jslib/models/view/cipherView';\r\nimport { CollectionView } from 'jslib/models/view/collectionView';\r\n\r\nimport { Cipher } from 'jslib/models/domain/cipher';\r\n\r\n@Component({\r\n selector: 'app-vault-collections',\r\n templateUrl: 'collections.component.html',\r\n})\r\nexport class CollectionsComponent implements OnInit, OnDestroy {\r\n @Input() cipherId: string;\r\n @Output() onSavedCollections = new EventEmitter();\r\n\r\n formPromise: Promise;\r\n cipher: CipherView;\r\n collectionIds: string[];\r\n collections: CollectionView[] = [];\r\n\r\n protected cipherDomain: Cipher;\r\n\r\n constructor(protected collectionService: CollectionService, protected analytics: Angulartics2,\r\n protected toasterService: ToasterService, protected i18nService: I18nService,\r\n protected cipherService: CipherService) { }\r\n\r\n async ngOnInit() {\r\n this.cipherDomain = await this.loadCipher();\r\n this.collectionIds = this.loadCipherCollections();\r\n this.cipher = await this.cipherDomain.decrypt();\r\n this.collections = await this.loadCollections();\r\n\r\n this.selectAll(false);\r\n if (this.collectionIds != null) {\r\n this.collections.forEach((c) => {\r\n (c as any).checked = this.collectionIds.indexOf(c.id) > -1;\r\n });\r\n }\r\n }\r\n\r\n ngOnDestroy() {\r\n this.selectAll(false);\r\n }\r\n\r\n async submit() {\r\n this.cipherDomain.collectionIds = this.collections\r\n .filter((c) => !!(c as any).checked)\r\n .map((c) => c.id);\r\n this.formPromise = this.saveCollections();\r\n await this.formPromise;\r\n this.onSavedCollections.emit();\r\n this.analytics.eventTrack.next({ action: 'Edited Cipher Collections' });\r\n this.toasterService.popAsync('success', null, this.i18nService.t('editedItem'));\r\n }\r\n\r\n check(c: CollectionView, select?: boolean) {\r\n (c as any).checked = select == null ? !(c as any).checked : select;\r\n }\r\n\r\n selectAll(select: boolean) {\r\n this.collections.forEach((c) => this.check(c, select));\r\n }\r\n\r\n protected loadCipher() {\r\n return this.cipherService.get(this.cipherId);\r\n }\r\n\r\n protected loadCipherCollections() {\r\n return this.cipherDomain.collectionIds;\r\n }\r\n\r\n protected async loadCollections() {\r\n const allCollections = await this.collectionService.getAllDecrypted();\r\n return allCollections.filter((c) => !c.readOnly && c.organizationId === this.cipher.organizationId);\r\n }\r\n\r\n protected saveCollections() {\r\n return this.cipherService.saveCollectionsWithServer(this.cipherDomain);\r\n }\r\n}\r\n","import { Component } from '@angular/core';\r\n\r\nimport { ToasterService } from 'angular2-toaster';\r\nimport { Angulartics2 } from 'angulartics2';\r\n\r\nimport { CipherService } from 'jslib/abstractions/cipher.service';\r\nimport { CryptoService } from 'jslib/abstractions/crypto.service';\r\nimport { I18nService } from 'jslib/abstractions/i18n.service';\r\nimport { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';\r\nimport { TokenService } from 'jslib/abstractions/token.service';\r\n\r\nimport { AttachmentsComponent as BaseAttachmentsComponent } from 'jslib/angular/components/attachments.component';\r\n\r\n@Component({\r\n selector: 'app-vault-attachments',\r\n templateUrl: 'attachments.component.html',\r\n})\r\nexport class AttachmentsComponent extends BaseAttachmentsComponent {\r\n constructor(cipherService: CipherService, analytics: Angulartics2,\r\n toasterService: ToasterService, i18nService: I18nService,\r\n cryptoService: CryptoService, tokenService: TokenService,\r\n platformUtilsService: PlatformUtilsService) {\r\n super(cipherService, analytics, toasterService, i18nService, cryptoService, tokenService,\r\n platformUtilsService, window);\r\n }\r\n}\r\n","import {\n Component,\n OnInit,\n} from '@angular/core';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { CipherType } from 'jslib/enums/cipherType';\n\nimport { AuditService } from 'jslib/abstractions/audit.service';\nimport { CipherService } from 'jslib/abstractions/cipher.service';\nimport { FolderService } from 'jslib/abstractions/folder.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\nimport { MessagingService } from 'jslib/abstractions/messaging.service';\nimport { PasswordGenerationService } from 'jslib/abstractions/passwordGeneration.service';\nimport { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';\nimport { StateService } from 'jslib/abstractions/state.service';\nimport { TokenService } from 'jslib/abstractions/token.service';\nimport { TotpService } from 'jslib/abstractions/totp.service';\n\nimport { AddEditComponent as BaseAddEditComponent } from 'jslib/angular/components/add-edit.component';\nimport { LoginUriView } from 'jslib/models/view/loginUriView';\n\n@Component({\n selector: 'app-vault-add-edit',\n templateUrl: 'add-edit.component.html',\n})\nexport class AddEditComponent extends BaseAddEditComponent implements OnInit {\n isPremium: boolean;\n totpCode: string;\n totpCodeFormatted: string;\n totpDash: number;\n totpSec: number;\n totpLow: boolean;\n\n protected totpInterval: number;\n\n constructor(cipherService: CipherService, folderService: FolderService,\n i18nService: I18nService, platformUtilsService: PlatformUtilsService,\n analytics: Angulartics2, toasterService: ToasterService,\n auditService: AuditService, stateService: StateService,\n protected tokenService: TokenService, protected totpService: TotpService,\n protected passwordGenerationService: PasswordGenerationService, protected messagingService: MessagingService) {\n super(cipherService, folderService, i18nService, platformUtilsService, analytics,\n toasterService, auditService, stateService);\n }\n\n async ngOnInit() {\n await super.load();\n this.cleanUp();\n\n this.isPremium = this.tokenService.getPremium();\n if (this.cipher.type === CipherType.Login && this.cipher.login.totp &&\n (this.cipher.organizationUseTotp || this.isPremium)) {\n await this.totpUpdateCode();\n await this.totpTick();\n\n this.totpInterval = window.setInterval(async () => {\n await this.totpTick();\n }, 1000);\n }\n }\n\n toggleFavorite() {\n this.cipher.favorite = !this.cipher.favorite;\n }\n\n launch(uri: LoginUriView) {\n if (!uri.canLaunch) {\n return;\n }\n\n this.analytics.eventTrack.next({ action: 'Launched Login URI' });\n this.platformUtilsService.launchUri(uri.uri);\n }\n\n copy(value: string, typeI18nKey: string, aType: string) {\n if (value == null) {\n return;\n }\n\n this.analytics.eventTrack.next({ action: 'Copied ' + aType });\n this.platformUtilsService.copyToClipboard(value, { doc: window.document });\n this.toasterService.popAsync('info', null,\n this.i18nService.t('valueCopied', this.i18nService.t(typeI18nKey)));\n }\n\n async generatePassword(): Promise {\n const confirmed = await super.generatePassword();\n if (confirmed) {\n const options = await this.passwordGenerationService.getOptions();\n this.cipher.login.password = await this.passwordGenerationService.generatePassword(options);\n }\n return confirmed;\n }\n\n async premiumRequired() {\n const premium = await this.tokenService.getPremium();\n if (!premium) {\n this.messagingService.send('premiumRequired');\n return;\n }\n }\n\n async upgradeOrganization() {\n this.messagingService.send('upgradeOrganization', { organizationId: this.cipher.organizationId });\n }\n\n protected cleanUp() {\n if (this.totpInterval) {\n window.clearInterval(this.totpInterval);\n }\n }\n\n protected async totpUpdateCode() {\n if (this.cipher == null || this.cipher.type !== CipherType.Login || this.cipher.login.totp == null) {\n if (this.totpInterval) {\n window.clearInterval(this.totpInterval);\n }\n return;\n }\n\n this.totpCode = await this.totpService.getCode(this.cipher.login.totp);\n if (this.totpCode != null) {\n this.totpCodeFormatted = this.totpCode.substring(0, 3) + ' ' + this.totpCode.substring(3);\n } else {\n this.totpCodeFormatted = null;\n if (this.totpInterval) {\n window.clearInterval(this.totpInterval);\n }\n }\n }\n\n protected async totpTick() {\n const epoch = Math.round(new Date().getTime() / 1000.0);\n const mod = epoch % 30;\n\n this.totpSec = 30 - mod;\n this.totpDash = +(Math.round(((2.62 * mod) + 'e+2') as any) + 'e-2');\n this.totpLow = this.totpSec <= 7;\n if (mod === 0) {\n await this.totpUpdateCode();\n }\n }\n}\n","import { Folder } from '../domain/folder';\r\n\r\nexport class FolderRequest {\r\n name: string;\r\n\r\n constructor(folder: Folder) {\r\n this.name = folder.name ? folder.name.encryptedString : null;\r\n }\r\n}\r\n","import { Location } from '@angular/common';\nimport {\n Component,\n ComponentFactoryResolver,\n OnInit,\n ViewChild,\n ViewContainerRef,\n} from '@angular/core';\nimport {\n ActivatedRoute,\n Router,\n} from '@angular/router';\n\nimport { ToasterService } from 'angular2-toaster';\n\nimport { CipherType } from 'jslib/enums/cipherType';\n\nimport { CipherView } from 'jslib/models/view/cipherView';\n\nimport { ModalComponent } from '../modal.component';\n\nimport { OrganizationsComponent } from '../settings/organizations.component';\nimport { UpdateKeyComponent } from '../settings/update-key.component';\nimport { AddEditComponent } from './add-edit.component';\nimport { AttachmentsComponent } from './attachments.component';\nimport { BulkDeleteComponent } from './bulk-delete.component';\nimport { BulkMoveComponent } from './bulk-move.component';\nimport { BulkShareComponent } from './bulk-share.component';\nimport { CiphersComponent } from './ciphers.component';\nimport { CollectionsComponent } from './collections.component';\nimport { FolderAddEditComponent } from './folder-add-edit.component';\nimport { GroupingsComponent } from './groupings.component';\nimport { ShareComponent } from './share.component';\n\nimport { CryptoService } from 'jslib/abstractions/crypto.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\nimport { MessagingService } from 'jslib/abstractions/messaging.service';\nimport { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';\nimport { SyncService } from 'jslib/abstractions/sync.service';\nimport { TokenService } from 'jslib/abstractions/token.service';\nimport { UserService } from 'jslib/abstractions/user.service';\n\n@Component({\n selector: 'app-vault',\n templateUrl: 'vault.component.html',\n})\nexport class VaultComponent implements OnInit {\n @ViewChild(GroupingsComponent) groupingsComponent: GroupingsComponent;\n @ViewChild(CiphersComponent) ciphersComponent: CiphersComponent;\n @ViewChild(OrganizationsComponent) organizationsComponent: OrganizationsComponent;\n @ViewChild('attachments', { read: ViewContainerRef }) attachmentsModalRef: ViewContainerRef;\n @ViewChild('folderAddEdit', { read: ViewContainerRef }) folderAddEditModalRef: ViewContainerRef;\n @ViewChild('cipherAddEdit', { read: ViewContainerRef }) cipherAddEditModalRef: ViewContainerRef;\n @ViewChild('share', { read: ViewContainerRef }) shareModalRef: ViewContainerRef;\n @ViewChild('collections', { read: ViewContainerRef }) collectionsModalRef: ViewContainerRef;\n @ViewChild('bulkDeleteTemplate', { read: ViewContainerRef }) bulkDeleteModalRef: ViewContainerRef;\n @ViewChild('bulkMoveTemplate', { read: ViewContainerRef }) bulkMoveModalRef: ViewContainerRef;\n @ViewChild('bulkShareTemplate', { read: ViewContainerRef }) bulkShareModalRef: ViewContainerRef;\n @ViewChild('updateKeyTemplate', { read: ViewContainerRef }) updateKeyModalRef: ViewContainerRef;\n\n favorites: boolean = false;\n type: CipherType = null;\n folderId: string = null;\n collectionId: string = null;\n showVerifyEmail = false;\n showBrowserOutdated = false;\n showUpdateKey = false;\n showPremiumCallout = false;\n\n private modal: ModalComponent = null;\n\n constructor(private syncService: SyncService, private route: ActivatedRoute,\n private router: Router, private location: Location,\n private i18nService: I18nService, private componentFactoryResolver: ComponentFactoryResolver,\n private tokenService: TokenService, private cryptoService: CryptoService,\n private messagingService: MessagingService, private userService: UserService,\n private platformUtilsService: PlatformUtilsService, private toasterService: ToasterService) { }\n\n async ngOnInit() {\n this.showVerifyEmail = !(await this.tokenService.getEmailVerified());\n this.showBrowserOutdated = window.navigator.userAgent.indexOf('MSIE') !== -1;\n const hasEncKey = await this.cryptoService.hasEncKey();\n this.showUpdateKey = !hasEncKey;\n const isPremium = await this.tokenService.getPremium();\n\n this.route.queryParams.subscribe(async (params) => {\n await this.syncService.fullSync(false);\n await Promise.all([\n this.groupingsComponent.load(),\n this.organizationsComponent.load(),\n ]);\n\n this.showPremiumCallout = !this.showVerifyEmail && !isPremium &&\n !this.platformUtilsService.isSelfHost() && !(await this.inOrgWithPremium());\n\n if (params == null) {\n this.groupingsComponent.selectedAll = true;\n await this.ciphersComponent.load();\n return;\n }\n\n if (params.favorites) {\n this.groupingsComponent.selectedFavorites = true;\n await this.filterFavorites();\n } else if (params.type) {\n const t = parseInt(params.type, null);\n this.groupingsComponent.selectedType = t;\n await this.filterCipherType(t);\n } else if (params.folderId) {\n this.groupingsComponent.selectedFolder = true;\n this.groupingsComponent.selectedFolderId = params.folderId;\n await this.filterFolder(params.folderId);\n } else if (params.collectionId) {\n this.groupingsComponent.selectedCollectionId = params.collectionId;\n await this.filterCollection(params.collectionId);\n } else {\n this.groupingsComponent.selectedAll = true;\n await this.ciphersComponent.load();\n }\n });\n }\n\n async clearGroupingFilters() {\n this.ciphersComponent.showAddNew = true;\n this.groupingsComponent.searchPlaceholder = this.i18nService.t('searchVault');\n await this.ciphersComponent.load();\n this.clearFilters();\n this.go();\n }\n\n async filterFavorites() {\n this.ciphersComponent.showAddNew = true;\n this.groupingsComponent.searchPlaceholder = this.i18nService.t('searchFavorites');\n await this.ciphersComponent.load((c) => c.favorite);\n this.clearFilters();\n this.favorites = true;\n this.go();\n }\n\n async filterCipherType(type: CipherType) {\n this.ciphersComponent.showAddNew = true;\n this.groupingsComponent.searchPlaceholder = this.i18nService.t('searchType');\n await this.ciphersComponent.load((c) => c.type === type);\n this.clearFilters();\n this.type = type;\n this.go();\n }\n\n async filterFolder(folderId: string) {\n this.ciphersComponent.showAddNew = true;\n folderId = folderId === 'none' ? null : folderId;\n this.groupingsComponent.searchPlaceholder = this.i18nService.t('searchFolder');\n await this.ciphersComponent.load((c) => c.folderId === folderId);\n this.clearFilters();\n this.folderId = folderId == null ? 'none' : folderId;\n this.go();\n }\n\n async filterCollection(collectionId: string) {\n this.ciphersComponent.showAddNew = false;\n this.groupingsComponent.searchPlaceholder = this.i18nService.t('searchCollection');\n await this.ciphersComponent.load((c) => c.collectionIds.indexOf(collectionId) > -1);\n this.clearFilters();\n this.collectionId = collectionId;\n this.go();\n }\n\n filterSearchText(searchText: string) {\n this.ciphersComponent.searchText = searchText;\n }\n\n async editCipherAttachments(cipher: CipherView) {\n const premium = await this.tokenService.getPremium();\n if (cipher.organizationId == null && !premium) {\n this.messagingService.send('premiumRequired');\n return;\n } else if (cipher.organizationId != null) {\n const org = await this.userService.getOrganization(cipher.organizationId);\n if (org != null && (org.maxStorageGb == null || org.maxStorageGb === 0)) {\n this.messagingService.send('upgradeOrganization', { organizationId: cipher.organizationId });\n return;\n }\n }\n\n if (this.modal != null) {\n this.modal.close();\n }\n\n const factory = this.componentFactoryResolver.resolveComponentFactory(ModalComponent);\n this.modal = this.attachmentsModalRef.createComponent(factory).instance;\n const childComponent = this.modal.show(AttachmentsComponent, this.attachmentsModalRef);\n\n childComponent.cipherId = cipher.id;\n let madeAttachmentChanges = false;\n childComponent.onUploadedAttachment.subscribe(() => madeAttachmentChanges = true);\n childComponent.onDeletedAttachment.subscribe(() => madeAttachmentChanges = true);\n\n this.modal.onClosed.subscribe(async () => {\n this.modal = null;\n if (madeAttachmentChanges) {\n await this.ciphersComponent.refresh();\n }\n madeAttachmentChanges = false;\n });\n }\n\n shareCipher(cipher: CipherView) {\n if (this.modal != null) {\n this.modal.close();\n }\n\n const factory = this.componentFactoryResolver.resolveComponentFactory(ModalComponent);\n this.modal = this.shareModalRef.createComponent(factory).instance;\n const childComponent = this.modal.show(ShareComponent, this.shareModalRef);\n\n childComponent.cipherId = cipher.id;\n childComponent.onSharedCipher.subscribe(async () => {\n this.modal.close();\n await this.ciphersComponent.refresh();\n });\n\n this.modal.onClosed.subscribe(async () => {\n this.modal = null;\n });\n }\n\n editCipherCollections(cipher: CipherView) {\n if (this.modal != null) {\n this.modal.close();\n }\n\n const factory = this.componentFactoryResolver.resolveComponentFactory(ModalComponent);\n this.modal = this.collectionsModalRef.createComponent(factory).instance;\n const childComponent = this.modal.show(CollectionsComponent, this.collectionsModalRef);\n\n childComponent.cipherId = cipher.id;\n childComponent.onSavedCollections.subscribe(async () => {\n this.modal.close();\n await this.ciphersComponent.refresh();\n });\n\n this.modal.onClosed.subscribe(async () => {\n this.modal = null;\n });\n }\n\n async addFolder() {\n if (this.modal != null) {\n this.modal.close();\n }\n\n const factory = this.componentFactoryResolver.resolveComponentFactory(ModalComponent);\n this.modal = this.folderAddEditModalRef.createComponent(factory).instance;\n const childComponent = this.modal.show(\n FolderAddEditComponent, this.folderAddEditModalRef);\n\n childComponent.folderId = null;\n childComponent.onSavedFolder.subscribe(async () => {\n this.modal.close();\n await this.groupingsComponent.loadFolders();\n });\n\n this.modal.onClosed.subscribe(() => {\n this.modal = null;\n });\n }\n\n async editFolder(folderId: string) {\n if (this.modal != null) {\n this.modal.close();\n }\n\n const factory = this.componentFactoryResolver.resolveComponentFactory(ModalComponent);\n this.modal = this.folderAddEditModalRef.createComponent(factory).instance;\n const childComponent = this.modal.show(\n FolderAddEditComponent, this.folderAddEditModalRef);\n\n childComponent.folderId = folderId;\n childComponent.onSavedFolder.subscribe(async () => {\n this.modal.close();\n await this.groupingsComponent.loadFolders();\n });\n childComponent.onDeletedFolder.subscribe(async () => {\n this.modal.close();\n await this.groupingsComponent.loadFolders();\n await this.filterFolder('none');\n this.groupingsComponent.selectedFolderId = null;\n });\n\n this.modal.onClosed.subscribe(() => {\n this.modal = null;\n });\n }\n\n addCipher() {\n const component = this.editCipher(null);\n component.type = this.type;\n component.folderId = this.folderId === 'none' ? null : this.folderId;\n }\n\n editCipher(cipher: CipherView) {\n if (this.modal != null) {\n this.modal.close();\n }\n\n const factory = this.componentFactoryResolver.resolveComponentFactory(ModalComponent);\n this.modal = this.cipherAddEditModalRef.createComponent(factory).instance;\n const childComponent = this.modal.show(\n AddEditComponent, this.cipherAddEditModalRef);\n\n childComponent.cipherId = cipher == null ? null : cipher.id;\n childComponent.onSavedCipher.subscribe(async (c: CipherView) => {\n this.modal.close();\n await this.ciphersComponent.refresh();\n });\n childComponent.onDeletedCipher.subscribe(async (c: CipherView) => {\n this.modal.close();\n await this.ciphersComponent.refresh();\n });\n\n this.modal.onClosed.subscribe(() => {\n this.modal = null;\n });\n\n return childComponent;\n }\n\n bulkDelete() {\n const selectedIds = this.ciphersComponent.getSelectedIds();\n if (selectedIds.length === 0) {\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'),\n this.i18nService.t('nothingSelected'));\n return;\n }\n\n if (this.modal != null) {\n this.modal.close();\n }\n\n const factory = this.componentFactoryResolver.resolveComponentFactory(ModalComponent);\n this.modal = this.bulkDeleteModalRef.createComponent(factory).instance;\n const childComponent = this.modal.show(BulkDeleteComponent, this.bulkDeleteModalRef);\n\n childComponent.cipherIds = selectedIds;\n childComponent.onDeleted.subscribe(async () => {\n this.modal.close();\n await this.ciphersComponent.refresh();\n });\n\n this.modal.onClosed.subscribe(() => {\n this.modal = null;\n });\n }\n\n bulkShare() {\n const selectedCiphers = this.ciphersComponent.getSelected();\n if (selectedCiphers.length === 0) {\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'),\n this.i18nService.t('nothingSelected'));\n return;\n }\n\n if (this.modal != null) {\n this.modal.close();\n }\n\n const factory = this.componentFactoryResolver.resolveComponentFactory(ModalComponent);\n this.modal = this.bulkShareModalRef.createComponent(factory).instance;\n const childComponent = this.modal.show(BulkShareComponent, this.bulkShareModalRef);\n\n childComponent.ciphers = selectedCiphers;\n childComponent.onShared.subscribe(async () => {\n this.modal.close();\n await this.ciphersComponent.refresh();\n });\n\n this.modal.onClosed.subscribe(async () => {\n this.modal = null;\n });\n }\n\n bulkMove() {\n const selectedIds = this.ciphersComponent.getSelectedIds();\n if (selectedIds.length === 0) {\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'),\n this.i18nService.t('nothingSelected'));\n return;\n }\n\n if (this.modal != null) {\n this.modal.close();\n }\n\n const factory = this.componentFactoryResolver.resolveComponentFactory(ModalComponent);\n this.modal = this.bulkMoveModalRef.createComponent(factory).instance;\n const childComponent = this.modal.show(BulkMoveComponent, this.bulkMoveModalRef);\n\n childComponent.cipherIds = selectedIds;\n childComponent.onMoved.subscribe(async () => {\n this.modal.close();\n await this.ciphersComponent.refresh();\n });\n\n this.modal.onClosed.subscribe(() => {\n this.modal = null;\n });\n }\n\n selectAll(select: boolean) {\n this.ciphersComponent.selectAll(select);\n }\n\n updateKey() {\n if (this.modal != null) {\n this.modal.close();\n }\n\n const factory = this.componentFactoryResolver.resolveComponentFactory(ModalComponent);\n this.modal = this.updateKeyModalRef.createComponent(factory).instance;\n this.modal.show(UpdateKeyComponent, this.updateKeyModalRef);\n\n this.modal.onClosed.subscribe(() => {\n this.modal = null;\n });\n }\n\n private clearFilters() {\n this.folderId = null;\n this.collectionId = null;\n this.favorites = false;\n this.type = null;\n }\n\n private go(queryParams: any = null) {\n if (queryParams == null) {\n queryParams = {\n favorites: this.favorites ? true : null,\n type: this.type,\n folderId: this.folderId,\n collectionId: this.collectionId,\n };\n }\n\n const url = this.router.createUrlTree(['vault'], { queryParams: queryParams }).toString();\n this.location.go(url);\n }\n\n private async inOrgWithPremium() {\n const orgs = await this.userService.getAllOrganizations();\n for (let i = 0; i < orgs.length; i++) {\n if (orgs[i].usersGetPremium) {\n return true;\n }\n }\n return false;\n }\n}\n","export enum UriMatchType {\r\n Domain = 0,\r\n Host = 1,\r\n StartsWith = 2,\r\n Exact = 3,\r\n RegularExpression = 4,\r\n Never = 5,\r\n}\r\n","import {\n Component,\n Input,\n OnChanges,\n} from '@angular/core';\n\nimport { CipherType } from '../../enums/cipherType';\n\nimport { EnvironmentService } from '../../abstractions/environment.service';\nimport { StateService } from '../../abstractions/state.service';\n\nimport { ConstantsService } from '../../services/constants.service';\n\nimport { Utils } from '../../misc/utils';\n\n@Component({\n selector: 'app-vault-icon',\n templateUrl: 'icon.component.html',\n})\nexport class IconComponent implements OnChanges {\n @Input() cipher: any;\n icon: string;\n image: string;\n fallbackImage: string;\n imageEnabled: boolean;\n\n private iconsUrl: string;\n\n constructor(private environmentService: EnvironmentService, private stateService: StateService) {\n this.iconsUrl = environmentService.iconsUrl;\n if (!this.iconsUrl) {\n if (environmentService.baseUrl) {\n this.iconsUrl = environmentService.baseUrl + '/icons';\n } else {\n this.iconsUrl = 'https://icons.bitwarden.net';\n }\n }\n }\n\n async ngOnChanges() {\n this.imageEnabled = !(await this.stateService.get(ConstantsService.disableFaviconKey));\n\n switch (this.cipher.type) {\n case CipherType.Login:\n this.icon = 'fa-globe';\n this.setLoginIcon();\n break;\n case CipherType.SecureNote:\n this.icon = 'fa-sticky-note-o';\n break;\n case CipherType.Card:\n this.icon = 'fa-credit-card';\n break;\n case CipherType.Identity:\n this.icon = 'fa-id-card-o';\n break;\n default:\n break;\n }\n }\n\n private setLoginIcon() {\n if (this.cipher.login.uri) {\n let hostnameUri = this.cipher.login.uri;\n let isWebsite = false;\n\n if (hostnameUri.indexOf('androidapp://') === 0) {\n this.icon = 'fa-android';\n this.image = null;\n } else if (hostnameUri.indexOf('iosapp://') === 0) {\n this.icon = 'fa-apple';\n this.image = null;\n } else if (this.imageEnabled && hostnameUri.indexOf('://') === -1 && hostnameUri.indexOf('.') > -1) {\n hostnameUri = 'http://' + hostnameUri;\n isWebsite = true;\n } else if (this.imageEnabled) {\n isWebsite = hostnameUri.indexOf('http') === 0 && hostnameUri.indexOf('.') > -1;\n }\n\n if (this.imageEnabled && isWebsite) {\n try {\n this.image = this.iconsUrl + '/' + Utils.getHostname(hostnameUri) + '/icon.png';\n this.fallbackImage = 'images/fa-globe.png';\n } catch (e) { }\n }\n } else {\n this.image = null;\n }\n }\n}\n","import {\r\n Component,\r\n OnInit,\r\n} from '@angular/core';\r\n\r\n@Component({\r\n selector: 'app-user-layout',\r\n templateUrl: 'user-layout.component.html',\r\n})\r\nexport class UserLayoutComponent implements OnInit {\r\n ngOnInit() {\r\n document.body.classList.remove('layout_frontend');\r\n }\r\n}\r\n","import {\n Component,\n OnInit,\n} from '@angular/core';\n\nimport { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';\n\n@Component({\n selector: 'app-footer',\n templateUrl: 'footer.component.html',\n})\nexport class FooterComponent implements OnInit {\n version: string;\n year: string = '2015';\n\n constructor(private platformUtilsService: PlatformUtilsService) { }\n\n ngOnInit() {\n this.year = new Date().getFullYear().toString();\n this.version = this.platformUtilsService.getApplicationVersion();\n }\n}\n","import {\r\n Component,\r\n OnInit,\r\n} from '@angular/core';\r\n\r\nimport { MessagingService } from 'jslib/abstractions/messaging.service';\r\nimport { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';\r\nimport { TokenService } from 'jslib/abstractions/token.service';\r\n\r\n@Component({\r\n selector: 'app-navbar',\r\n templateUrl: 'navbar.component.html',\r\n})\r\nexport class NavbarComponent implements OnInit {\r\n selfHosted = false;\r\n name: string;\r\n\r\n constructor(private messagingService: MessagingService, private platformUtilsService: PlatformUtilsService,\r\n private tokenService: TokenService) {\r\n this.selfHosted = this.platformUtilsService.isSelfHost();\r\n }\r\n\r\n async ngOnInit() {\r\n this.name = await this.tokenService.getName();\r\n if (this.name == null || this.name.trim() === '') {\r\n this.name = await this.tokenService.getEmail();\r\n }\r\n }\r\n\r\n lock() {\r\n this.messagingService.send('lockVault');\r\n }\r\n\r\n logOut() {\r\n this.messagingService.send('logout');\r\n }\r\n}\r\n","import {\n Component,\n OnInit,\n} from '@angular/core';\nimport {\n ActivatedRoute,\n Router,\n} from '@angular/router';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\n\nimport { VerifyDeleteRecoverRequest } from 'jslib/models/request/verifyDeleteRecoverRequest';\n\n@Component({\n selector: 'app-verify-recover-delete',\n templateUrl: 'verify-recover-delete.component.html',\n})\nexport class VerifyRecoverDeleteComponent implements OnInit {\n email: string;\n formPromise: Promise;\n\n private userId: string;\n private token: string;\n\n constructor(private router: Router, private apiService: ApiService,\n private analytics: Angulartics2, private toasterService: ToasterService,\n private i18nService: I18nService, private route: ActivatedRoute) {\n }\n\n ngOnInit() {\n let fired = false;\n this.route.queryParams.subscribe(async (qParams) => {\n if (fired) {\n return;\n }\n fired = true;\n if (qParams.userId != null && qParams.token != null && qParams.email != null) {\n this.userId = qParams.userId;\n this.token = qParams.token;\n this.email = qParams.email;\n } else {\n this.router.navigate(['/']);\n }\n });\n }\n\n async submit() {\n try {\n const request = new VerifyDeleteRecoverRequest(this.userId, this.token);\n this.formPromise = this.apiService.postAccountRecoverDeleteToken(request);\n await this.formPromise;\n this.analytics.eventTrack.next({ action: 'Recovered Delete' });\n this.toasterService.popAsync('success', this.i18nService.t('accountDeleted'),\n this.i18nService.t('accountDeletedDesc'));\n this.router.navigate(['/']);\n } catch { }\n }\n}\n","import { Component } from '@angular/core';\nimport { Router } from '@angular/router';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\n\nimport { DeleteRecoverRequest } from 'jslib/models/request/deleteRecoverRequest';\n\n@Component({\n selector: 'app-recover-delete',\n templateUrl: 'recover-delete.component.html',\n})\nexport class RecoverDeleteComponent {\n email: string;\n formPromise: Promise;\n\n constructor(private router: Router, private apiService: ApiService,\n private analytics: Angulartics2, private toasterService: ToasterService,\n private i18nService: I18nService) {\n }\n\n async submit() {\n try {\n const request = new DeleteRecoverRequest();\n request.email = this.email.toLowerCase();\n this.formPromise = this.apiService.postAccountRecoverDelete(request);\n await this.formPromise;\n this.analytics.eventTrack.next({ action: 'Started Delete Recovery' });\n this.toasterService.popAsync('success', null, this.i18nService.t('deleteRecoverEmailSent'));\n this.router.navigate(['/']);\n } catch { }\n }\n}\n","import { Component } from '@angular/core';\nimport { Router } from '@angular/router';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { CryptoService } from 'jslib/abstractions/crypto.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\n\nimport { TwoFactorRecoveryRequest } from 'jslib/models/request/twoFactorRecoveryRequest';\n\n@Component({\n selector: 'app-recover-two-factor',\n templateUrl: 'recover-two-factor.component.html',\n})\nexport class RecoverTwoFactorComponent {\n email: string;\n masterPassword: string;\n recoveryCode: string;\n formPromise: Promise;\n\n constructor(private router: Router, private apiService: ApiService,\n private analytics: Angulartics2, private toasterService: ToasterService,\n private i18nService: I18nService, private cryptoService: CryptoService) {\n }\n\n async submit() {\n try {\n const request = new TwoFactorRecoveryRequest();\n request.recoveryCode = this.recoveryCode.replace(/\\s/g, '').toLowerCase();\n request.email = this.email.toLowerCase();\n const key = await this.cryptoService.makeKey(this.masterPassword, request.email);\n request.masterPasswordHash = await this.cryptoService.hashPassword(this.masterPassword, key);\n this.formPromise = this.apiService.postTwoFactorRecover(request);\n await this.formPromise;\n this.analytics.eventTrack.next({ action: 'Recovered 2FA' });\n this.toasterService.popAsync('success', null, this.i18nService.t('twoStepRecoverDisabled'));\n this.router.navigate(['/']);\n } catch { }\n }\n}\n","import {\n Component,\n OnInit,\n} from '@angular/core';\nimport {\n ActivatedRoute,\n Router,\n} from '@angular/router';\n\nimport {\n Toast,\n ToasterService,\n} from 'angular2-toaster';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\nimport { StateService } from 'jslib/abstractions/state.service';\nimport { UserService } from 'jslib/abstractions/user.service';\n\nimport { OrganizationUserAcceptRequest } from 'jslib/models/request/organizationUserAcceptRequest';\n\n@Component({\n selector: 'app-accept-organization',\n templateUrl: 'accept-organization.component.html',\n})\nexport class AcceptOrganizationComponent implements OnInit {\n loading = true;\n authed = false;\n orgName: string;\n email: string;\n actionPromise: Promise;\n\n constructor(private router: Router, private toasterService: ToasterService,\n private i18nService: I18nService, private route: ActivatedRoute,\n private apiService: ApiService, private userService: UserService,\n private stateService: StateService) { }\n\n ngOnInit() {\n let fired = false;\n this.route.queryParams.subscribe(async (qParams) => {\n if (fired) {\n return;\n }\n fired = true;\n await this.stateService.remove('orgInvitation');\n let error = qParams.organizationId == null || qParams.organizationUserId == null || qParams.token == null;\n if (!error) {\n this.authed = await this.userService.isAuthenticated();\n if (this.authed) {\n const request = new OrganizationUserAcceptRequest();\n request.token = qParams.token;\n try {\n this.actionPromise = this.apiService.postOrganizationUserAccept(qParams.organizationId,\n qParams.organizationUserId, request);\n await this.actionPromise;\n const toast: Toast = {\n type: 'success',\n title: this.i18nService.t('inviteAccepted'),\n body: this.i18nService.t('inviteAcceptedDesc'),\n timeout: 10000,\n };\n this.toasterService.popAsync(toast);\n this.router.navigate(['/vault']);\n } catch {\n error = true;\n }\n } else {\n await this.stateService.save('orgInvitation', qParams);\n this.email = qParams.email;\n this.orgName = qParams.organizationName;\n if (this.orgName != null) {\n // Fix URL encoding of space issue with Angular\n this.orgName = this.orgName.replace(/\\+/g, ' ');\n }\n }\n }\n\n if (error) {\n this.toasterService.popAsync('error', null, this.i18nService.t('inviteAcceptFailed'));\n this.router.navigate(['/']);\n }\n\n this.loading = false;\n });\n }\n}\n","import {\n Component,\n OnInit,\n} from '@angular/core';\nimport {\n ActivatedRoute,\n Router,\n} from '@angular/router';\n\nimport { ToasterService } from 'angular2-toaster';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\nimport { UserService } from 'jslib/abstractions/user.service';\n\nimport { VerifyEmailRequest } from 'jslib/models/request/verifyEmailRequest';\n\n@Component({\n selector: 'app-verify-email-token',\n templateUrl: 'verify-email-token.component.html',\n})\nexport class VerifyEmailTokenComponent implements OnInit {\n constructor(private router: Router, private toasterService: ToasterService,\n private i18nService: I18nService, private route: ActivatedRoute,\n private apiService: ApiService, private userService: UserService) { }\n\n ngOnInit() {\n let fired = false;\n this.route.queryParams.subscribe(async (qParams) => {\n if (fired) {\n return;\n }\n fired = true;\n if (qParams.userId != null && qParams.token != null) {\n try {\n await this.apiService.postAccountVerifyEmailToken(\n new VerifyEmailRequest(qParams.userId, qParams.token));\n const authed = await this.userService.isAuthenticated();\n if (authed) {\n await this.apiService.refreshIdentityToken();\n }\n this.toasterService.popAsync('success', null, this.i18nService.t('emailVerified'));\n this.router.navigate(['/']);\n return;\n } catch { }\n }\n this.toasterService.popAsync('error', null, this.i18nService.t('emailVerifiedFailed'));\n this.router.navigate(['/']);\n });\n }\n}\n","import {\r\n Component,\r\n OnInit,\r\n} from '@angular/core';\r\nimport { Router } from '@angular/router';\r\n\r\nimport { ToasterService } from 'angular2-toaster';\r\nimport { Angulartics2 } from 'angulartics2';\r\n\r\nimport { CryptoService } from 'jslib/abstractions/crypto.service';\r\nimport { I18nService } from 'jslib/abstractions/i18n.service';\r\nimport { MessagingService } from 'jslib/abstractions/messaging.service';\r\nimport { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';\r\nimport { UserService } from 'jslib/abstractions/user.service';\r\n\r\nimport { RouterService } from '../services/router.service';\r\n\r\nimport { LockComponent as BaseLockComponent } from 'jslib/angular/components/lock.component';\r\n\r\n@Component({\r\n selector: 'app-lock',\r\n templateUrl: 'lock.component.html',\r\n})\r\nexport class LockComponent extends BaseLockComponent implements OnInit {\r\n constructor(router: Router, analytics: Angulartics2,\r\n toasterService: ToasterService, i18nService: I18nService,\r\n platformUtilsService: PlatformUtilsService, messagingService: MessagingService,\r\n userService: UserService, cryptoService: CryptoService,\r\n private routerService: RouterService) {\r\n super(router, analytics, toasterService, i18nService, platformUtilsService,\r\n messagingService, userService, cryptoService);\r\n }\r\n\r\n async ngOnInit() {\r\n const authed = await this.userService.isAuthenticated();\r\n if (!authed) {\r\n this.router.navigate(['/']);\r\n } else if (await this.cryptoService.hasKey()) {\r\n this.router.navigate(['vault']);\r\n }\r\n\r\n const previousUrl = this.routerService.getPreviousUrl();\r\n if (previousUrl !== '/' && previousUrl.indexOf('lock') === -1) {\r\n this.successRoute = previousUrl;\r\n }\r\n }\r\n}\r\n","import { Component } from '@angular/core';\r\nimport { Router } from '@angular/router';\r\n\r\nimport { ToasterService } from 'angular2-toaster';\r\nimport { Angulartics2 } from 'angulartics2';\r\n\r\nimport { ApiService } from 'jslib/abstractions/api.service';\r\nimport { I18nService } from 'jslib/abstractions/i18n.service';\r\n\r\nimport { HintComponent as BaseHintComponent } from 'jslib/angular/components/hint.component';\r\n\r\n@Component({\r\n selector: 'app-hint',\r\n templateUrl: 'hint.component.html',\r\n})\r\nexport class HintComponent extends BaseHintComponent {\r\n constructor(router: Router, analytics: Angulartics2,\r\n toasterService: ToasterService, i18nService: I18nService,\r\n apiService: ApiService) {\r\n super(router, analytics, toasterService, i18nService, apiService);\r\n }\r\n}\r\n","import { Component } from '@angular/core';\nimport {\n ActivatedRoute,\n Router,\n} from '@angular/router';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { AuthService } from 'jslib/abstractions/auth.service';\nimport { CryptoService } from 'jslib/abstractions/crypto.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\nimport { StateService } from 'jslib/abstractions/state.service';\n\nimport { RegisterComponent as BaseRegisterComponent } from 'jslib/angular/components/register.component';\n\n@Component({\n selector: 'app-register',\n templateUrl: 'register.component.html',\n})\nexport class RegisterComponent extends BaseRegisterComponent {\n showCreateOrgMessage = false;\n\n constructor(authService: AuthService, router: Router,\n analytics: Angulartics2, toasterService: ToasterService,\n i18nService: I18nService, cryptoService: CryptoService,\n apiService: ApiService, private route: ActivatedRoute,\n stateService: StateService) {\n super(authService, router, analytics, toasterService, i18nService, cryptoService, apiService, stateService);\n }\n\n ngOnInit() {\n this.route.queryParams.subscribe((qParams) => {\n if (qParams.email != null && qParams.email.indexOf('@') > -1) {\n this.email = qParams.email;\n }\n if (qParams.premium != null) {\n this.stateService.save('loginRedirect', { route: '/settings/premium' });\n } else if (qParams.org != null) {\n this.showCreateOrgMessage = true;\n this.stateService.save('loginRedirect',\n { route: '/settings/create-organization', qParams: { plan: qParams.org } });\n }\n });\n }\n}\n","/**\r\n * Duo Web SDK v2\r\n * Copyright 2017, Duo Security\r\n */\r\n(function (root, factory) {\r\n /*eslint-disable */\r\n if (typeof define === 'function' && define.amd) {\r\n // AMD. Register as an anonymous module.\r\n define([], factory);\r\n /*eslint-enable */\r\n }\r\n else if (typeof module === 'object' && module.exports) {\r\n // Node. Does not work with strict CommonJS, but\r\n // only CommonJS-like environments that support module.exports,\r\n // like Node.\r\n module.exports = factory();\r\n }\r\n else {\r\n // Browser globals (root is window)\r\n var Duo = factory();\r\n // If the Javascript was loaded via a script tag, attempt to autoload\r\n // the frame.\r\n Duo._onReady(Duo.init);\r\n // Attach Duo to the `window` object\r\n root.Duo = Duo;\r\n }\r\n}(this, function () {\r\n var DUO_MESSAGE_FORMAT = /^(?:AUTH|ENROLL)+\\|[A-Za-z0-9\\+\\/=]+\\|[A-Za-z0-9\\+\\/=]+$/;\r\n var DUO_ERROR_FORMAT = /^ERR\\|[\\w\\s\\.\\(\\)]+$/;\r\n var DUO_OPEN_WINDOW_FORMAT = /^DUO_OPEN_WINDOW\\|/;\r\n var VALID_OPEN_WINDOW_DOMAINS = [\r\n 'duo.com',\r\n 'duosecurity.com',\r\n 'duomobile.s3-us-west-1.amazonaws.com'\r\n ];\r\n var iframeId = 'duo_iframe', postAction = '', postArgument = 'sig_response', host, sigRequest, duoSig, appSig, iframe, submitCallback;\r\n function throwError(message, url) {\r\n throw new Error('Duo Web SDK error: ' + message +\r\n (url ? ('\\n' + 'See ' + url + ' for more information') : ''));\r\n }\r\n function hyphenize(str) {\r\n return str.replace(/([a-z])([A-Z])/, '$1-$2').toLowerCase();\r\n }\r\n // cross-browser data attributes\r\n function getDataAttribute(element, name) {\r\n if ('dataset' in element) {\r\n return element.dataset[name];\r\n }\r\n else {\r\n return element.getAttribute('data-' + hyphenize(name));\r\n }\r\n }\r\n // cross-browser event binding/unbinding\r\n function on(context, event, fallbackEvent, callback) {\r\n if ('addEventListener' in window) {\r\n context.addEventListener(event, callback, false);\r\n }\r\n else {\r\n context.attachEvent(fallbackEvent, callback);\r\n }\r\n }\r\n function off(context, event, fallbackEvent, callback) {\r\n if ('removeEventListener' in window) {\r\n context.removeEventListener(event, callback, false);\r\n }\r\n else {\r\n context.detachEvent(fallbackEvent, callback);\r\n }\r\n }\r\n function onReady(callback) {\r\n on(document, 'DOMContentLoaded', 'onreadystatechange', callback);\r\n }\r\n function offReady(callback) {\r\n off(document, 'DOMContentLoaded', 'onreadystatechange', callback);\r\n }\r\n function onMessage(callback) {\r\n on(window, 'message', 'onmessage', callback);\r\n }\r\n function offMessage(callback) {\r\n off(window, 'message', 'onmessage', callback);\r\n }\r\n /**\r\n * Parse the sig_request parameter, throwing errors if the token contains\r\n * a server error or if the token is invalid.\r\n *\r\n * @param {String} sig Request token\r\n */\r\n function parseSigRequest(sig) {\r\n if (!sig) {\r\n // nothing to do\r\n return;\r\n }\r\n // see if the token contains an error, throwing it if it does\r\n if (sig.indexOf('ERR|') === 0) {\r\n throwError(sig.split('|')[1]);\r\n }\r\n // validate the token\r\n if (sig.indexOf(':') === -1 || sig.split(':').length !== 2) {\r\n throwError('Duo was given a bad token. This might indicate a configuration ' +\r\n 'problem with one of Duo\\'s client libraries.', 'https://www.duosecurity.com/docs/duoweb#first-steps');\r\n }\r\n var sigParts = sig.split(':');\r\n // hang on to the token, and the parsed duo and app sigs\r\n sigRequest = sig;\r\n duoSig = sigParts[0];\r\n appSig = sigParts[1];\r\n return {\r\n sigRequest: sig,\r\n duoSig: sigParts[0],\r\n appSig: sigParts[1]\r\n };\r\n }\r\n /**\r\n * This function is set up to run when the DOM is ready, if the iframe was\r\n * not available during `init`.\r\n */\r\n function onDOMReady() {\r\n iframe = document.getElementById(iframeId);\r\n if (!iframe) {\r\n throw new Error('This page does not contain an iframe for Duo to use.' +\r\n 'Add an element like ' +\r\n 'to this page. ' +\r\n 'See https://www.duosecurity.com/docs/duoweb#3.-show-the-iframe ' +\r\n 'for more information.');\r\n }\r\n // we've got an iframe, away we go!\r\n ready();\r\n // always clean up after yourself\r\n offReady(onDOMReady);\r\n }\r\n /**\r\n * Validate that a MessageEvent came from the Duo service, and that it\r\n * is a properly formatted payload.\r\n *\r\n * The Google Chrome sign-in page injects some JS into pages that also\r\n * make use of postMessage, so we need to do additional validation above\r\n * and beyond the origin.\r\n *\r\n * @param {MessageEvent} event Message received via postMessage\r\n */\r\n function isDuoMessage(event) {\r\n return Boolean(event.origin === ('https://' + host) &&\r\n typeof event.data === 'string' &&\r\n (event.data.match(DUO_MESSAGE_FORMAT) ||\r\n event.data.match(DUO_ERROR_FORMAT) ||\r\n event.data.match(DUO_OPEN_WINDOW_FORMAT)));\r\n }\r\n /**\r\n * Validate the request token and prepare for the iframe to become ready.\r\n *\r\n * All options below can be passed into an options hash to `Duo.init`, or\r\n * specified on the iframe using `data-` attributes.\r\n *\r\n * Options specified using the options hash will take precedence over\r\n * `data-` attributes.\r\n *\r\n * Example using options hash:\r\n * ```javascript\r\n * Duo.init({\r\n * iframe: \"some_other_id\",\r\n * host: \"api-main.duo.test\",\r\n * sig_request: \"...\",\r\n * post_action: \"/auth\",\r\n * post_argument: \"resp\"\r\n * });\r\n * ```\r\n *\r\n * Example using `data-` attributes:\r\n * ```\r\n * \r\n * ```\r\n *\r\n * @param {Object} options\r\n * @param {String} options.iframe The iframe, or id of an iframe to set up\r\n * @param {String} options.host Hostname\r\n * @param {String} options.sig_request Request token\r\n * @param {String} [options.post_action=''] URL to POST back to after successful auth\r\n * @param {String} [options.post_argument='sig_response'] Parameter name to use for response token\r\n * @param {Function} [options.submit_callback] If provided, duo will not submit the form instead execute\r\n * the callback function with reference to the \"duo_form\" form object\r\n * submit_callback can be used to prevent the webpage from reloading.\r\n */\r\n function init(options) {\r\n if (options) {\r\n if (options.host) {\r\n host = options.host;\r\n }\r\n if (options.sig_request) {\r\n parseSigRequest(options.sig_request);\r\n }\r\n if (options.post_action) {\r\n postAction = options.post_action;\r\n }\r\n if (options.post_argument) {\r\n postArgument = options.post_argument;\r\n }\r\n if (options.iframe) {\r\n if (options.iframe.tagName) {\r\n iframe = options.iframe;\r\n }\r\n else if (typeof options.iframe === 'string') {\r\n iframeId = options.iframe;\r\n }\r\n }\r\n if (typeof options.submit_callback === 'function') {\r\n submitCallback = options.submit_callback;\r\n }\r\n }\r\n // if we were given an iframe, no need to wait for the rest of the DOM\r\n if (false && iframe) {\r\n ready();\r\n }\r\n else {\r\n // try to find the iframe in the DOM\r\n iframe = document.getElementById(iframeId);\r\n // iframe is in the DOM, away we go!\r\n if (iframe) {\r\n ready();\r\n }\r\n else {\r\n // wait until the DOM is ready, then try again\r\n onReady(onDOMReady);\r\n }\r\n }\r\n // always clean up after yourself!\r\n offReady(init);\r\n }\r\n /**\r\n * This function is called when a message was received from another domain\r\n * using the `postMessage` API. Check that the event came from the Duo\r\n * service domain, and that the message is a properly formatted payload,\r\n * then perform the post back to the primary service.\r\n *\r\n * @param event Event object (contains origin and data)\r\n */\r\n function onReceivedMessage(event) {\r\n if (isDuoMessage(event)) {\r\n if (event.data.match(DUO_OPEN_WINDOW_FORMAT)) {\r\n var url = event.data.substring(\"DUO_OPEN_WINDOW|\".length);\r\n if (isValidUrlToOpen(url)) {\r\n // Open the URL that comes after the DUO_WINDOW_OPEN token.\r\n window.open(url, \"_self\");\r\n }\r\n }\r\n else {\r\n // the event came from duo, do the post back\r\n doPostBack(event.data);\r\n // always clean up after yourself!\r\n offMessage(onReceivedMessage);\r\n }\r\n }\r\n }\r\n /**\r\n * Validate that this passed in URL is one that we will actually allow to\r\n * be opened.\r\n * @param url String URL that the message poster wants to open\r\n * @returns {boolean} true if we allow this url to be opened in the window\r\n */\r\n function isValidUrlToOpen(url) {\r\n if (!url) {\r\n return false;\r\n }\r\n var parser = document.createElement('a');\r\n parser.href = url;\r\n if (parser.protocol === \"duotrustedendpoints:\") {\r\n return true;\r\n }\r\n else if (parser.protocol !== \"https:\") {\r\n return false;\r\n }\r\n for (var i = 0; i < VALID_OPEN_WINDOW_DOMAINS.length; i++) {\r\n if (parser.hostname.endsWith(\".\" + VALID_OPEN_WINDOW_DOMAINS[i]) ||\r\n parser.hostname === VALID_OPEN_WINDOW_DOMAINS[i]) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n /**\r\n * Point the iframe at Duo, then wait for it to postMessage back to us.\r\n */\r\n function ready() {\r\n if (!host) {\r\n host = getDataAttribute(iframe, 'host');\r\n if (!host) {\r\n throwError('No API hostname is given for Duo to use. Be sure to pass ' +\r\n 'a `host` parameter to Duo.init, or through the `data-host` ' +\r\n 'attribute on the iframe element.', 'https://www.duosecurity.com/docs/duoweb#3.-show-the-iframe');\r\n }\r\n }\r\n if (!duoSig || !appSig) {\r\n parseSigRequest(getDataAttribute(iframe, 'sigRequest'));\r\n if (!duoSig || !appSig) {\r\n throwError('No valid signed request is given. Be sure to give the ' +\r\n '`sig_request` parameter to Duo.init, or use the ' +\r\n '`data-sig-request` attribute on the iframe element.', 'https://www.duosecurity.com/docs/duoweb#3.-show-the-iframe');\r\n }\r\n }\r\n // if postAction/Argument are defaults, see if they are specified\r\n // as data attributes on the iframe\r\n if (postAction === '') {\r\n postAction = getDataAttribute(iframe, 'postAction') || postAction;\r\n }\r\n if (postArgument === 'sig_response') {\r\n postArgument = getDataAttribute(iframe, 'postArgument') || postArgument;\r\n }\r\n // point the iframe at Duo\r\n iframe.src = [\r\n 'https://', host, '/frame/web/v1/auth?tx=', duoSig,\r\n '&parent=', encodeURIComponent(document.location.href),\r\n '&v=2.6'\r\n ].join('');\r\n // listen for the 'message' event\r\n onMessage(onReceivedMessage);\r\n }\r\n /**\r\n * We received a postMessage from Duo. POST back to the primary service\r\n * with the response token, and any additional user-supplied parameters\r\n * given in form#duo_form.\r\n */\r\n function doPostBack(response) {\r\n // create a hidden input to contain the response token\r\n var input = document.createElement('input');\r\n input.type = 'hidden';\r\n input.name = postArgument;\r\n input.value = response + ':' + appSig;\r\n // user may supply their own form with additional inputs\r\n var form = document.getElementById('duo_form');\r\n // if the form doesn't exist, create one\r\n if (!form) {\r\n form = document.createElement('form');\r\n // insert the new form after the iframe\r\n iframe.parentElement.insertBefore(form, iframe.nextSibling);\r\n }\r\n // make sure we are actually posting to the right place\r\n form.method = 'POST';\r\n form.action = postAction;\r\n // add the response token input to the form\r\n form.appendChild(input);\r\n // away we go!\r\n if (typeof submitCallback === \"function\") {\r\n submitCallback.call(null, form);\r\n }\r\n else {\r\n form.submit();\r\n }\r\n }\r\n return {\r\n init: init,\r\n _onReady: onReady,\r\n _parseSigRequest: parseSigRequest,\r\n _isDuoMessage: isDuoMessage,\r\n _doPostBack: doPostBack\r\n };\r\n}));\r\n//# sourceMappingURL=duo.js.map","import {\n Component,\n ComponentFactoryResolver,\n ViewChild,\n ViewContainerRef,\n} from '@angular/core';\n\nimport { Router } from '@angular/router';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { TwoFactorOptionsComponent } from './two-factor-options.component';\n\nimport { ModalComponent } from '../modal.component';\n\nimport { TwoFactorProviderType } from 'jslib/enums/twoFactorProviderType';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { AuthService } from 'jslib/abstractions/auth.service';\nimport { EnvironmentService } from 'jslib/abstractions/environment.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\nimport { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';\nimport { StateService } from 'jslib/abstractions/state.service';\n\nimport { TwoFactorComponent as BaseTwoFactorComponent } from 'jslib/angular/components/two-factor.component';\n\n@Component({\n selector: 'app-two-factor',\n templateUrl: 'two-factor.component.html',\n})\nexport class TwoFactorComponent extends BaseTwoFactorComponent {\n @ViewChild('twoFactorOptions', { read: ViewContainerRef }) twoFactorOptionsModal: ViewContainerRef;\n\n constructor(authService: AuthService, router: Router,\n analytics: Angulartics2, toasterService: ToasterService,\n i18nService: I18nService, apiService: ApiService,\n platformUtilsService: PlatformUtilsService, private stateService: StateService,\n environmentService: EnvironmentService, private componentFactoryResolver: ComponentFactoryResolver) {\n super(authService, router, analytics, toasterService, i18nService, apiService,\n platformUtilsService, window, environmentService);\n this.onSuccessfulLoginNavigate = this.goAfterLogIn;\n }\n\n anotherMethod() {\n const factory = this.componentFactoryResolver.resolveComponentFactory(ModalComponent);\n const modal = this.twoFactorOptionsModal.createComponent(factory).instance;\n const childComponent = modal.show(TwoFactorOptionsComponent,\n this.twoFactorOptionsModal);\n\n childComponent.onProviderSelected.subscribe(async (provider: TwoFactorProviderType) => {\n modal.close();\n this.selectedProviderType = provider;\n await this.init();\n });\n childComponent.onRecoverSelected.subscribe(() => {\n modal.close();\n });\n }\n\n async goAfterLogIn() {\n const invite = await this.stateService.get('orgInvitation');\n if (invite != null) {\n this.router.navigate(['accept-organization'], { queryParams: invite });\n } else {\n const loginRedirect = await this.stateService.get('loginRedirect');\n if (loginRedirect != null) {\n this.router.navigate([loginRedirect.route], { queryParams: loginRedirect.qParams });\n await this.stateService.remove('loginRedirect');\n } else {\n this.router.navigate([this.successRoute]);\n }\n }\n }\n}\n","import { Component } from '@angular/core';\nimport {\n ActivatedRoute,\n Router,\n} from '@angular/router';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { AuthService } from 'jslib/abstractions/auth.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\nimport { StateService } from 'jslib/abstractions/state.service';\nimport { StorageService } from 'jslib/abstractions/storage.service';\n\nimport { LoginComponent as BaseLoginComponent } from 'jslib/angular/components/login.component';\n\n@Component({\n selector: 'app-login',\n templateUrl: 'login.component.html',\n})\nexport class LoginComponent extends BaseLoginComponent {\n constructor(authService: AuthService, router: Router,\n analytics: Angulartics2, toasterService: ToasterService,\n i18nService: I18nService, private route: ActivatedRoute,\n storageService: StorageService, private stateService: StateService) {\n super(authService, router, analytics, toasterService, i18nService, storageService);\n this.onSuccessfulLoginNavigate = this.goAfterLogIn;\n }\n\n async ngOnInit() {\n this.route.queryParams.subscribe(async (qParams) => {\n if (qParams.email != null && qParams.email.indexOf('@') > -1) {\n this.email = qParams.email;\n }\n if (qParams.premium != null) {\n this.stateService.save('loginRedirect', { route: '/settings/premium' });\n } else if (qParams.org != null) {\n this.stateService.save('loginRedirect',\n { route: '/settings/create-organization', qParams: { plan: qParams.org } });\n }\n await super.ngOnInit();\n });\n }\n\n async goAfterLogIn() {\n const invite = await this.stateService.get('orgInvitation');\n if (invite != null) {\n this.router.navigate(['accept-organization'], { queryParams: invite });\n } else {\n const loginRedirect = await this.stateService.get('loginRedirect');\n if (loginRedirect != null) {\n this.router.navigate([loginRedirect.route], { queryParams: loginRedirect.qParams });\n await this.stateService.remove('loginRedirect');\n } else {\n this.router.navigate([this.successRoute]);\n }\n }\n }\n}\n","import {\r\n Component,\r\n OnDestroy,\r\n OnInit,\r\n} from '@angular/core';\r\n\r\nimport { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';\r\n\r\n@Component({\r\n selector: 'app-frontend-layout',\r\n templateUrl: 'frontend-layout.component.html',\r\n})\r\nexport class FrontendLayoutComponent implements OnInit, OnDestroy {\r\n version: string;\r\n\r\n constructor(private platformUtilsService: PlatformUtilsService) { }\r\n\r\n ngOnInit() {\r\n this.version = this.platformUtilsService.getApplicationVersion();\r\n document.body.classList.add('layout_frontend');\r\n }\r\n\r\n ngOnDestroy() {\r\n document.body.classList.remove('layout_frontend');\r\n }\r\n}\r\n","export abstract class SettingsService {\r\n clearCache: () => void;\r\n getEquivalentDomains: () => Promise;\r\n setEquivalentDomains: (equivalentDomains: string[][]) => Promise;\r\n clear: (userId: string) => Promise;\r\n}\r\n","export abstract class LockService {\r\n checkLock: () => Promise;\r\n lock: () => Promise;\r\n setLockOption: (lockOption: number) => Promise;\r\n}\r\n","import { Injectable } from '@angular/core';\r\nimport {\r\n CanActivate,\r\n Router,\r\n} from '@angular/router';\r\n\r\nimport { CryptoService } from 'jslib/abstractions/crypto.service';\r\nimport { UserService } from 'jslib/abstractions/user.service';\r\n\r\n@Injectable()\r\nexport class UnauthGuardService implements CanActivate {\r\n constructor(private cryptoService: CryptoService, private userService: UserService,\r\n private router: Router) { }\r\n\r\n async canActivate() {\r\n const isAuthed = await this.userService.isAuthenticated();\r\n if (isAuthed) {\r\n const hasKey = await this.cryptoService.hasKey();\r\n if (!hasKey) {\r\n this.router.navigate(['lock']);\r\n } else {\r\n this.router.navigate(['vault']);\r\n }\r\n return false;\r\n }\r\n\r\n return true;\r\n }\r\n}\r\n","import { Injectable } from '@angular/core';\r\nimport {\r\n ActivatedRouteSnapshot,\r\n CanActivate,\r\n Router,\r\n} from '@angular/router';\r\n\r\nimport { UserService } from 'jslib/abstractions/user.service';\r\n\r\nimport { OrganizationUserType } from 'jslib/enums/organizationUserType';\r\n\r\n@Injectable()\r\nexport class OrganizationTypeGuardService implements CanActivate {\r\n constructor(private userService: UserService, private router: Router) { }\r\n\r\n async canActivate(route: ActivatedRouteSnapshot) {\r\n const org = await this.userService.getOrganization(route.parent.params.organizationId);\r\n const allowedTypes = route.data == null ? null : route.data.allowedTypes as OrganizationUserType[];\r\n if (allowedTypes == null || allowedTypes.indexOf(org.type) === -1) {\r\n this.router.navigate(['/organizations', org.id]);\r\n return false;\r\n }\r\n\r\n return true;\r\n }\r\n}\r\n","import { Injectable } from '@angular/core';\r\nimport {\r\n ActivatedRouteSnapshot,\r\n CanActivate,\r\n Router,\r\n} from '@angular/router';\r\n\r\nimport { UserService } from 'jslib/abstractions/user.service';\r\n\r\n@Injectable()\r\nexport class OrganizationGuardService implements CanActivate {\r\n constructor(private userService: UserService, private router: Router) { }\r\n\r\n async canActivate(route: ActivatedRouteSnapshot) {\r\n const org = await this.userService.getOrganization(route.params.organizationId);\r\n if (org == null) {\r\n this.router.navigate(['/']);\r\n return false;\r\n }\r\n\r\n return true;\r\n }\r\n}\r\n","import { Injectable } from '@angular/core';\nimport {\n CanActivate,\n Router,\n} from '@angular/router';\n\nimport { CryptoService } from '../../abstractions/crypto.service';\nimport { MessagingService } from '../../abstractions/messaging.service';\nimport { UserService } from '../../abstractions/user.service';\n\n@Injectable()\nexport class AuthGuardService implements CanActivate {\n constructor(private cryptoService: CryptoService, private userService: UserService, private router: Router,\n private messagingService: MessagingService) { }\n\n async canActivate() {\n const isAuthed = await this.userService.isAuthenticated();\n if (!isAuthed) {\n this.messagingService.send('logout');\n return false;\n }\n\n const hasKey = await this.cryptoService.hasKey();\n if (!hasKey) {\n this.router.navigate(['lock']);\n return false;\n }\n\n return true;\n }\n}\n","import { StorageService } from '../abstractions/storage.service';\nimport { TokenService } from '../abstractions/token.service';\nimport { UserService as UserServiceAbstraction } from '../abstractions/user.service';\n\nimport { OrganizationData } from '../models/data/organizationData';\nimport { Organization } from '../models/domain/organization';\n\nconst Keys = {\n userId: 'userId',\n userEmail: 'userEmail',\n stamp: 'securityStamp',\n organizationsPrefix: 'organizations_',\n};\n\nexport class UserService implements UserServiceAbstraction {\n userId: string;\n email: string;\n stamp: string;\n\n constructor(private tokenService: TokenService, private storageService: StorageService) {\n }\n\n setUserIdAndEmail(userId: string, email: string): Promise {\n this.email = email;\n this.userId = userId;\n\n return Promise.all([\n this.storageService.save(Keys.userEmail, email),\n this.storageService.save(Keys.userId, userId),\n ]);\n }\n\n setSecurityStamp(stamp: string): Promise {\n this.stamp = stamp;\n return this.storageService.save(Keys.stamp, stamp);\n }\n\n async getUserId(): Promise {\n if (this.userId != null) {\n return this.userId;\n }\n\n this.userId = await this.storageService.get(Keys.userId);\n return this.userId;\n }\n\n async getEmail(): Promise {\n if (this.email != null) {\n return this.email;\n }\n\n this.email = await this.storageService.get(Keys.userEmail);\n return this.email;\n }\n\n async getSecurityStamp(): Promise {\n if (this.stamp != null) {\n return this.stamp;\n }\n\n this.stamp = await this.storageService.get(Keys.stamp);\n return this.stamp;\n }\n\n async clear(): Promise {\n const userId = await this.getUserId();\n\n await Promise.all([\n this.storageService.remove(Keys.userId),\n this.storageService.remove(Keys.userEmail),\n this.storageService.remove(Keys.stamp),\n this.clearOrganizations(userId),\n ]);\n\n this.userId = this.email = this.stamp = null;\n }\n\n async isAuthenticated(): Promise {\n const token = await this.tokenService.getToken();\n if (token == null) {\n return false;\n }\n\n const userId = await this.getUserId();\n return userId != null;\n }\n\n async getOrganization(id: string): Promise {\n const userId = await this.getUserId();\n const organizations = await this.storageService.get<{ [id: string]: OrganizationData; }>(\n Keys.organizationsPrefix + userId);\n if (organizations == null || !organizations.hasOwnProperty(id)) {\n return null;\n }\n\n return new Organization(organizations[id]);\n }\n\n async getAllOrganizations(): Promise {\n const userId = await this.getUserId();\n const organizations = await this.storageService.get<{ [id: string]: OrganizationData; }>(\n Keys.organizationsPrefix + userId);\n const response: Organization[] = [];\n for (const id in organizations) {\n if (organizations.hasOwnProperty(id)) {\n response.push(new Organization(organizations[id]));\n }\n }\n return response;\n }\n\n async replaceOrganizations(organizations: { [id: string]: OrganizationData; }): Promise {\n const userId = await this.getUserId();\n await this.storageService.save(Keys.organizationsPrefix + userId, organizations);\n }\n\n async clearOrganizations(userId: string): Promise {\n await this.storageService.remove(Keys.organizationsPrefix + userId);\n }\n}\n","import { ConstantsService } from './constants.service';\r\n\r\nimport { CryptoFunctionService } from '../abstractions/cryptoFunction.service';\r\nimport { StorageService } from '../abstractions/storage.service';\r\nimport { TotpService as TotpServiceAbstraction } from '../abstractions/totp.service';\r\n\r\nimport { Utils } from '../misc/utils';\r\n\r\nconst b32Chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567';\r\n\r\nexport class TotpService implements TotpServiceAbstraction {\r\n constructor(private storageService: StorageService, private cryptoFunctionService: CryptoFunctionService) {}\r\n\r\n async getCode(keyb32: string): Promise {\r\n const epoch = Math.round(new Date().getTime() / 1000.0);\r\n const timeHex = this.leftpad(this.dec2hex(Math.floor(epoch / 30)), 16, '0');\r\n const timeBytes = Utils.fromHexToArray(timeHex);\r\n const keyBytes = this.b32tobytes(keyb32);\r\n\r\n if (!keyBytes.length || !timeBytes.length) {\r\n return null;\r\n }\r\n\r\n const hashHex = await this.sign(keyBytes, timeBytes);\r\n if (!hashHex) {\r\n return null;\r\n }\r\n\r\n const offset = this.hex2dec(hashHex.substring(hashHex.length - 1));\r\n // tslint:disable-next-line\r\n let otp = (this.hex2dec(hashHex.substr(offset * 2, 8)) & this.hex2dec('7fffffff')) + '';\r\n otp = (otp).substr(otp.length - 6, 6);\r\n return otp;\r\n }\r\n\r\n async isAutoCopyEnabled(): Promise {\r\n return !(await this.storageService.get(ConstantsService.disableAutoTotpCopyKey));\r\n }\r\n\r\n // Helpers\r\n\r\n private leftpad(s: string, l: number, p: string): string {\r\n if (l + 1 >= s.length) {\r\n s = Array(l + 1 - s.length).join(p) + s;\r\n }\r\n return s;\r\n }\r\n\r\n private dec2hex(d: number): string {\r\n return (d < 15.5 ? '0' : '') + Math.round(d).toString(16);\r\n }\r\n\r\n private hex2dec(s: string): number {\r\n return parseInt(s, 16);\r\n }\r\n\r\n private b32tohex(s: string): string {\r\n s = s.toUpperCase();\r\n let cleanedInput = '';\r\n\r\n for (let i = 0; i < s.length; i++) {\r\n if (b32Chars.indexOf(s[i]) < 0) {\r\n continue;\r\n }\r\n\r\n cleanedInput += s[i];\r\n }\r\n s = cleanedInput;\r\n\r\n let bits = '';\r\n let hex = '';\r\n for (let i = 0; i < s.length; i++) {\r\n const byteIndex = b32Chars.indexOf(s.charAt(i));\r\n if (byteIndex < 0) {\r\n continue;\r\n }\r\n bits += this.leftpad(byteIndex.toString(2), 5, '0');\r\n }\r\n for (let i = 0; i + 4 <= bits.length; i += 4) {\r\n const chunk = bits.substr(i, 4);\r\n hex = hex + parseInt(chunk, 2).toString(16);\r\n }\r\n return hex;\r\n }\r\n\r\n private b32tobytes(s: string): Uint8Array {\r\n return Utils.fromHexToArray(this.b32tohex(s));\r\n }\r\n\r\n private async sign(keyBytes: Uint8Array, timeBytes: Uint8Array) {\r\n const signature = await this.cryptoFunctionService.hmac(timeBytes.buffer, keyBytes.buffer, 'sha1');\r\n return Utils.fromBufferToHex(signature);\r\n }\r\n}\r\n","import { ConstantsService } from './constants.service';\n\nimport { StorageService } from '../abstractions/storage.service';\nimport { TokenService as TokenServiceAbstraction } from '../abstractions/token.service';\n\nimport { Utils } from '../misc/utils';\n\nconst Keys = {\n accessToken: 'accessToken',\n refreshToken: 'refreshToken',\n twoFactorTokenPrefix: 'twoFactorToken_',\n};\n\nexport class TokenService implements TokenServiceAbstraction {\n token: string;\n decodedToken: any;\n refreshToken: string;\n\n constructor(private storageService: StorageService) {\n }\n\n setTokens(accessToken: string, refreshToken: string): Promise {\n return Promise.all([\n this.setToken(accessToken),\n this.setRefreshToken(refreshToken),\n ]);\n }\n\n setToken(token: string): Promise {\n this.token = token;\n this.decodedToken = null;\n return this.storageService.save(Keys.accessToken, token);\n }\n\n async getToken(): Promise {\n if (this.token != null) {\n return this.token;\n }\n\n this.token = await this.storageService.get(Keys.accessToken);\n return this.token;\n }\n\n setRefreshToken(refreshToken: string): Promise {\n this.refreshToken = refreshToken;\n return this.storageService.save(Keys.refreshToken, refreshToken);\n }\n\n async getRefreshToken(): Promise {\n if (this.refreshToken != null) {\n return this.refreshToken;\n }\n\n this.refreshToken = await this.storageService.get(Keys.refreshToken);\n return this.refreshToken;\n }\n\n setTwoFactorToken(token: string, email: string): Promise {\n return this.storageService.save(Keys.twoFactorTokenPrefix + email, token);\n }\n\n getTwoFactorToken(email: string): Promise {\n return this.storageService.get(Keys.twoFactorTokenPrefix + email);\n }\n\n clearTwoFactorToken(email: string): Promise {\n return this.storageService.remove(Keys.twoFactorTokenPrefix + email);\n }\n\n clearToken(): Promise {\n this.token = null;\n this.decodedToken = null;\n this.refreshToken = null;\n\n return Promise.all([\n this.storageService.remove(Keys.accessToken),\n this.storageService.remove(Keys.refreshToken),\n ]);\n }\n\n // jwthelper methods\n // ref https://github.com/auth0/angular-jwt/blob/master/src/angularJwt/services/jwt.js\n\n decodeToken(): any {\n if (this.decodedToken) {\n return this.decodedToken;\n }\n\n if (this.token == null) {\n throw new Error('Token not found.');\n }\n\n const parts = this.token.split('.');\n if (parts.length !== 3) {\n throw new Error('JWT must have 3 parts');\n }\n\n const decoded = Utils.fromUrlB64ToUtf8(parts[1]);\n if (decoded == null) {\n throw new Error('Cannot decode the token');\n }\n\n this.decodedToken = JSON.parse(decoded);\n return this.decodedToken;\n }\n\n getTokenExpirationDate(): Date {\n const decoded = this.decodeToken();\n if (typeof decoded.exp === 'undefined') {\n return null;\n }\n\n const d = new Date(0); // The 0 here is the key, which sets the date to the epoch\n d.setUTCSeconds(decoded.exp);\n return d;\n }\n\n tokenSecondsRemaining(offsetSeconds: number = 0): number {\n const d = this.getTokenExpirationDate();\n if (d == null) {\n return 0;\n }\n\n const msRemaining = d.valueOf() - (new Date().valueOf() + (offsetSeconds * 1000));\n return Math.round(msRemaining / 1000);\n }\n\n tokenNeedsRefresh(minutes: number = 5): boolean {\n const sRemaining = this.tokenSecondsRemaining();\n return sRemaining < (60 * minutes);\n }\n\n getUserId(): string {\n const decoded = this.decodeToken();\n if (typeof decoded.sub === 'undefined') {\n throw new Error('No user id found');\n }\n\n return decoded.sub as string;\n }\n\n getEmail(): string {\n const decoded = this.decodeToken();\n if (typeof decoded.email === 'undefined') {\n throw new Error('No email found');\n }\n\n return decoded.email as string;\n }\n\n getEmailVerified(): boolean {\n const decoded = this.decodeToken();\n if (typeof decoded.email_verified === 'undefined') {\n throw new Error('No email verification found');\n }\n\n return decoded.email_verified as boolean;\n }\n\n getName(): string {\n const decoded = this.decodeToken();\n if (typeof decoded.name === 'undefined') {\n return null;\n }\n\n return decoded.name as string;\n }\n\n getPremium(): boolean {\n const decoded = this.decodeToken();\n if (typeof decoded.premium === 'undefined') {\n return false;\n }\n\n return decoded.premium as boolean;\n }\n\n getIssuer(): string {\n const decoded = this.decodeToken();\n if (typeof decoded.iss === 'undefined') {\n throw new Error('No issuer found');\n }\n\n return decoded.iss as string;\n }\n}\n","import { ApiService } from '../abstractions/api.service';\nimport { CipherService } from '../abstractions/cipher.service';\nimport { CollectionService } from '../abstractions/collection.service';\nimport { CryptoService } from '../abstractions/crypto.service';\nimport { FolderService } from '../abstractions/folder.service';\nimport { MessagingService } from '../abstractions/messaging.service';\nimport { SettingsService } from '../abstractions/settings.service';\nimport { StorageService } from '../abstractions/storage.service';\nimport { SyncService as SyncServiceAbstraction } from '../abstractions/sync.service';\nimport { UserService } from '../abstractions/user.service';\n\nimport { CipherData } from '../models/data/cipherData';\nimport { CollectionData } from '../models/data/collectionData';\nimport { FolderData } from '../models/data/folderData';\nimport { OrganizationData } from '../models/data/organizationData';\n\nimport { CipherResponse } from '../models/response/cipherResponse';\nimport { CollectionDetailsResponse } from '../models/response/collectionResponse';\nimport { DomainsResponse } from '../models/response/domainsResponse';\nimport { FolderResponse } from '../models/response/folderResponse';\nimport { ProfileResponse } from '../models/response/profileResponse';\n\nconst Keys = {\n lastSyncPrefix: 'lastSync_',\n};\n\nexport class SyncService implements SyncServiceAbstraction {\n syncInProgress: boolean = false;\n\n constructor(private userService: UserService, private apiService: ApiService,\n private settingsService: SettingsService, private folderService: FolderService,\n private cipherService: CipherService, private cryptoService: CryptoService,\n private collectionService: CollectionService, private storageService: StorageService,\n private messagingService: MessagingService, private logoutCallback: (expired: boolean) => Promise) {\n }\n\n async getLastSync(): Promise {\n const userId = await this.userService.getUserId();\n if (userId == null) {\n return null;\n }\n\n const lastSync = await this.storageService.get(Keys.lastSyncPrefix + userId);\n if (lastSync) {\n return new Date(lastSync);\n }\n\n return null;\n }\n\n async setLastSync(date: Date): Promise {\n const userId = await this.userService.getUserId();\n if (userId == null) {\n return;\n }\n\n await this.storageService.save(Keys.lastSyncPrefix + userId, date.toJSON());\n }\n\n syncStarted() {\n this.syncInProgress = true;\n this.messagingService.send('syncStarted');\n }\n\n syncCompleted(successfully: boolean) {\n this.syncInProgress = false;\n this.messagingService.send('syncCompleted', { successfully: successfully });\n }\n\n async fullSync(forceSync: boolean): Promise {\n this.syncStarted();\n const isAuthenticated = await this.userService.isAuthenticated();\n if (!isAuthenticated) {\n this.syncCompleted(false);\n return false;\n }\n\n const now = new Date();\n const needsSyncResult = await this.needsSyncing(forceSync);\n const needsSync = needsSyncResult[0];\n const skipped = needsSyncResult[1];\n\n if (skipped) {\n this.syncCompleted(false);\n return false;\n }\n\n if (!needsSync) {\n await this.setLastSync(now);\n this.syncCompleted(false);\n return false;\n }\n\n const userId = await this.userService.getUserId();\n try {\n const response = await this.apiService.getSync();\n\n await this.syncProfile(response.profile);\n await this.syncFolders(userId, response.folders);\n await this.syncCollections(response.collections);\n await this.syncCiphers(userId, response.ciphers);\n await this.syncSettings(userId, response.domains);\n\n await this.setLastSync(now);\n this.syncCompleted(true);\n return true;\n } catch (e) {\n this.syncCompleted(false);\n return false;\n }\n }\n\n // Helpers\n\n private async needsSyncing(forceSync: boolean) {\n if (forceSync) {\n return [true, false];\n }\n\n try {\n const response = await this.apiService.getAccountRevisionDate();\n const accountRevisionDate = new Date(response);\n const lastSync = await this.getLastSync();\n if (lastSync != null && accountRevisionDate <= lastSync) {\n return [false, false];\n }\n\n return [true, false];\n } catch (e) {\n return [false, true];\n }\n }\n\n private async syncProfile(response: ProfileResponse) {\n const stamp = await this.userService.getSecurityStamp();\n if (stamp != null && stamp !== response.securityStamp) {\n if (this.logoutCallback != null) {\n await this.logoutCallback(true);\n }\n\n throw new Error('Stamp has changed');\n }\n\n await this.cryptoService.setEncKey(response.key);\n await this.cryptoService.setEncPrivateKey(response.privateKey);\n await this.cryptoService.setOrgKeys(response.organizations);\n await this.userService.setSecurityStamp(response.securityStamp);\n await this.userService.setSecurityStamp(response.securityStamp);\n\n const organizations: { [id: string]: OrganizationData; } = {};\n response.organizations.forEach((o) => {\n organizations[o.id] = new OrganizationData(o);\n });\n return await this.userService.replaceOrganizations(organizations);\n }\n\n private async syncFolders(userId: string, response: FolderResponse[]) {\n const folders: { [id: string]: FolderData; } = {};\n response.forEach((f) => {\n folders[f.id] = new FolderData(f, userId);\n });\n return await this.folderService.replace(folders);\n }\n\n private async syncCollections(response: CollectionDetailsResponse[]) {\n const collections: { [id: string]: CollectionData; } = {};\n response.forEach((c) => {\n collections[c.id] = new CollectionData(c);\n });\n return await this.collectionService.replace(collections);\n }\n\n private async syncCiphers(userId: string, response: CipherResponse[]) {\n const ciphers: { [id: string]: CipherData; } = {};\n response.forEach((c) => {\n ciphers[c.id] = new CipherData(c, userId);\n });\n return await this.cipherService.replace(ciphers);\n }\n\n private async syncSettings(userId: string, response: DomainsResponse) {\n let eqDomains: string[][] = [];\n if (response != null && response.equivalentDomains != null) {\n eqDomains = eqDomains.concat(response.equivalentDomains);\n }\n\n if (response != null && response.globalEquivalentDomains != null) {\n response.globalEquivalentDomains.forEach((global) => {\n if (global.domains.length > 0) {\n eqDomains.push(global.domains);\n }\n });\n }\n\n return this.settingsService.setEquivalentDomains(eqDomains);\n }\n}\n","import { StateService as StateServiceAbstraction } from '../abstractions/state.service';\r\n\r\nexport class StateService implements StateServiceAbstraction {\r\n private state: any = {};\r\n\r\n get(key: string): Promise {\r\n if (this.state.hasOwnProperty(key)) {\r\n return Promise.resolve(this.state[key]);\r\n }\r\n return Promise.resolve(null);\r\n }\r\n\r\n save(key: string, obj: any): Promise {\r\n this.state[key] = obj;\r\n return Promise.resolve();\r\n }\r\n\r\n remove(key: string): Promise {\r\n delete this.state[key];\r\n return Promise.resolve();\r\n }\r\n\r\n purge(): Promise {\r\n this.state = {};\r\n return Promise.resolve();\r\n }\r\n}\r\n","import { SettingsService as SettingsServiceAbstraction } from '../abstractions/settings.service';\r\nimport { StorageService } from '../abstractions/storage.service';\r\nimport { UserService } from '../abstractions/user.service';\r\n\r\nconst Keys = {\r\n settingsPrefix: 'settings_',\r\n equivalentDomains: 'equivalentDomains',\r\n};\r\n\r\nexport class SettingsService implements SettingsServiceAbstraction {\r\n private settingsCache: any;\r\n\r\n constructor(private userService: UserService, private storageService: StorageService) {\r\n }\r\n\r\n clearCache(): void {\r\n this.settingsCache = null;\r\n }\r\n\r\n getEquivalentDomains(): Promise {\r\n return this.getSettingsKey(Keys.equivalentDomains);\r\n }\r\n\r\n async setEquivalentDomains(equivalentDomains: string[][]): Promise {\r\n await this.setSettingsKey(Keys.equivalentDomains, equivalentDomains);\r\n }\r\n\r\n async clear(userId: string): Promise {\r\n await this.storageService.remove(Keys.settingsPrefix + userId);\r\n this.settingsCache = null;\r\n }\r\n\r\n // Helpers\r\n\r\n private async getSettings(): Promise {\r\n if (this.settingsCache == null) {\r\n const userId = await this.userService.getUserId();\r\n this.settingsCache = this.storageService.get(Keys.settingsPrefix + userId);\r\n }\r\n return this.settingsCache;\r\n }\r\n\r\n private async getSettingsKey(key: string): Promise {\r\n const settings = await this.getSettings();\r\n if (settings != null && settings[key]) {\r\n return settings[key];\r\n }\r\n return null;\r\n }\r\n\r\n private async setSettingsKey(key: string, value: any): Promise {\r\n const userId = await this.userService.getUserId();\r\n let settings = await this.getSettings();\r\n if (!settings) {\r\n settings = {};\r\n }\r\n\r\n settings[key] = value;\r\n await this.storageService.save(Keys.settingsPrefix + userId, settings);\r\n this.settingsCache = settings;\r\n }\r\n}\r\n","import { CipherString } from '../models/domain/cipherString';\nimport { PasswordHistory } from '../models/domain/passwordHistory';\n\nimport { CryptoService } from '../abstractions/crypto.service';\nimport {\n PasswordGenerationService as PasswordGenerationServiceAbstraction,\n} from '../abstractions/passwordGeneration.service';\nimport { StorageService } from '../abstractions/storage.service';\n\nconst DefaultOptions = {\n length: 14,\n ambiguous: false,\n number: true,\n minNumber: 1,\n uppercase: true,\n minUppercase: 0,\n lowercase: true,\n minLowercase: 0,\n special: false,\n minSpecial: 1,\n};\n\nconst Keys = {\n options: 'passwordGenerationOptions',\n history: 'generatedPasswordHistory',\n};\n\nconst MaxPasswordsInHistory = 100;\n\nexport class PasswordGenerationService implements PasswordGenerationServiceAbstraction {\n private optionsCache: any;\n private history: PasswordHistory[];\n\n constructor(private cryptoService: CryptoService, private storageService: StorageService) { }\n\n async generatePassword(options: any): Promise {\n // overload defaults with given options\n const o = Object.assign({}, DefaultOptions, options);\n\n // sanitize\n if (o.uppercase && o.minUppercase <= 0) {\n o.minUppercase = 1;\n }\n if (o.lowercase && o.minLowercase <= 0) {\n o.minLowercase = 1;\n }\n if (o.number && o.minNumber <= 0) {\n o.minNumber = 1;\n }\n if (o.special && o.minSpecial <= 0) {\n o.minSpecial = 1;\n }\n\n if (!o.length || o.length < 1) {\n o.length = 10;\n }\n\n const minLength: number = o.minUppercase + o.minLowercase + o.minNumber + o.minSpecial;\n if (o.length < minLength) {\n o.length = minLength;\n }\n\n const positions: string[] = [];\n if (o.lowercase && o.minLowercase > 0) {\n for (let i = 0; i < o.minLowercase; i++) {\n positions.push('l');\n }\n }\n if (o.uppercase && o.minUppercase > 0) {\n for (let i = 0; i < o.minUppercase; i++) {\n positions.push('u');\n }\n }\n if (o.number && o.minNumber > 0) {\n for (let i = 0; i < o.minNumber; i++) {\n positions.push('n');\n }\n }\n if (o.special && o.minSpecial > 0) {\n for (let i = 0; i < o.minSpecial; i++) {\n positions.push('s');\n }\n }\n while (positions.length < o.length) {\n positions.push('a');\n }\n\n // shuffle\n await this.shuffleArray(positions);\n\n // build out the char sets\n let allCharSet = '';\n\n let lowercaseCharSet = 'abcdefghijkmnopqrstuvwxyz';\n if (o.ambiguous) {\n lowercaseCharSet += 'l';\n }\n if (o.lowercase) {\n allCharSet += lowercaseCharSet;\n }\n\n let uppercaseCharSet = 'ABCDEFGHIJKLMNPQRSTUVWXYZ';\n if (o.ambiguous) {\n uppercaseCharSet += 'O';\n }\n if (o.uppercase) {\n allCharSet += uppercaseCharSet;\n }\n\n let numberCharSet = '23456789';\n if (o.ambiguous) {\n numberCharSet += '01';\n }\n if (o.number) {\n allCharSet += numberCharSet;\n }\n\n const specialCharSet = '!@#$%^&*';\n if (o.special) {\n allCharSet += specialCharSet;\n }\n\n let password = '';\n for (let i = 0; i < o.length; i++) {\n let positionChars: string;\n switch (positions[i]) {\n case 'l':\n positionChars = lowercaseCharSet;\n break;\n case 'u':\n positionChars = uppercaseCharSet;\n break;\n case 'n':\n positionChars = numberCharSet;\n break;\n case 's':\n positionChars = specialCharSet;\n break;\n case 'a':\n positionChars = allCharSet;\n break;\n default:\n break;\n }\n\n const randomCharIndex = await this.cryptoService.randomNumber(0, positionChars.length - 1);\n password += positionChars.charAt(randomCharIndex);\n }\n\n return password;\n }\n\n async getOptions() {\n if (this.optionsCache == null) {\n const options = await this.storageService.get(Keys.options);\n if (options == null) {\n this.optionsCache = DefaultOptions;\n } else {\n this.optionsCache = options;\n }\n }\n\n return this.optionsCache;\n }\n\n async saveOptions(options: any) {\n await this.storageService.save(Keys.options, options);\n this.optionsCache = options;\n }\n\n async getHistory(): Promise {\n const hasKey = await this.cryptoService.hasKey();\n if (!hasKey) {\n return new Array();\n }\n\n if (!this.history) {\n const encrypted = await this.storageService.get(Keys.history);\n this.history = await this.decryptHistory(encrypted);\n }\n\n return this.history || new Array();\n }\n\n async addHistory(password: string): Promise {\n // Cannot add new history if no key is available\n const hasKey = await this.cryptoService.hasKey();\n if (!hasKey) {\n return;\n }\n\n const currentHistory = await this.getHistory();\n\n // Prevent duplicates\n if (this.matchesPrevious(password, currentHistory)) {\n return;\n }\n\n currentHistory.unshift(new PasswordHistory(password, Date.now()));\n\n // Remove old items.\n if (currentHistory.length > MaxPasswordsInHistory) {\n currentHistory.pop();\n }\n\n const newHistory = await this.encryptHistory(currentHistory);\n return await this.storageService.save(Keys.history, newHistory);\n }\n\n async clear(): Promise {\n this.history = [];\n return await this.storageService.remove(Keys.history);\n }\n\n private async encryptHistory(history: PasswordHistory[]): Promise {\n if (history == null || history.length === 0) {\n return Promise.resolve([]);\n }\n\n const promises = history.map(async (item) => {\n const encrypted = await this.cryptoService.encrypt(item.password);\n return new PasswordHistory(encrypted.encryptedString, item.date);\n });\n\n return await Promise.all(promises);\n }\n\n private async decryptHistory(history: PasswordHistory[]): Promise {\n if (history == null || history.length === 0) {\n return Promise.resolve([]);\n }\n\n const promises = history.map(async (item) => {\n const decrypted = await this.cryptoService.decryptToUtf8(new CipherString(item.password));\n return new PasswordHistory(decrypted, item.date);\n });\n\n return await Promise.all(promises);\n }\n\n private matchesPrevious(password: string, history: PasswordHistory[]): boolean {\n if (history == null || history.length === 0) {\n return false;\n }\n\n return history[history.length - 1].password === password;\n }\n\n // ref: https://stackoverflow.com/a/12646864/1090359\n private async shuffleArray(array: string[]) {\n for (let i = array.length - 1; i > 0; i--) {\n const j = await this.cryptoService.randomNumber(0, i);\n [array[i], array[j]] = [array[j], array[i]];\n }\n }\n}\n","import { ConstantsService } from './constants.service';\n\nimport { CipherService } from '../abstractions/cipher.service';\nimport { CollectionService } from '../abstractions/collection.service';\nimport { CryptoService } from '../abstractions/crypto.service';\nimport { FolderService } from '../abstractions/folder.service';\nimport { LockService as LockServiceAbstraction } from '../abstractions/lock.service';\nimport { MessagingService } from '../abstractions/messaging.service';\nimport { PlatformUtilsService } from '../abstractions/platformUtils.service';\nimport { StorageService } from '../abstractions/storage.service';\n\nexport class LockService implements LockServiceAbstraction {\n private inited = false;\n\n constructor(private cipherService: CipherService, private folderService: FolderService,\n private collectionService: CollectionService, private cryptoService: CryptoService,\n private platformUtilsService: PlatformUtilsService, private storageService: StorageService,\n private messagingService: MessagingService, private lockedCallback: () => Promise) {\n }\n\n init(checkOnInterval: boolean) {\n if (this.inited) {\n return;\n }\n\n this.inited = true;\n if (checkOnInterval) {\n this.checkLock();\n setInterval(() => this.checkLock(), 10 * 1000); // check every 10 seconds\n }\n }\n\n async checkLock(): Promise {\n if (this.platformUtilsService.isViewOpen()) {\n // Do not lock\n return;\n }\n\n const hasKey = await this.cryptoService.hasKey();\n if (!hasKey) {\n // no key so no need to lock\n return;\n }\n\n let lockOption = this.platformUtilsService.lockTimeout();\n if (lockOption == null) {\n lockOption = await this.storageService.get(ConstantsService.lockOptionKey);\n }\n if (lockOption == null || lockOption < 0) {\n return;\n }\n\n const lastActive = await this.storageService.get(ConstantsService.lastActiveKey);\n if (lastActive == null) {\n return;\n }\n\n const lockOptionSeconds = lockOption * 60;\n const diffSeconds = ((new Date()).getTime() - lastActive) / 1000;\n if (diffSeconds >= lockOptionSeconds) {\n // need to lock now\n await this.lock();\n }\n }\n\n async lock(): Promise {\n await Promise.all([\n this.cryptoService.clearKey(),\n this.cryptoService.clearOrgKeys(true),\n this.cryptoService.clearKeyPair(true),\n this.cryptoService.clearEncKey(true),\n ]);\n\n this.folderService.clearCache();\n this.cipherService.clearCache();\n this.collectionService.clearCache();\n this.messagingService.send('locked');\n if (this.lockedCallback != null) {\n await this.lockedCallback();\n }\n }\n\n async setLockOption(lockOption: number): Promise {\n await this.storageService.save(ConstantsService.lockOptionKey, lockOption);\n await this.cryptoService.toggleKey();\n }\n}\n","import { I18nService as I18nServiceAbstraction } from '../abstractions/i18n.service';\n\nexport class I18nService implements I18nServiceAbstraction {\n locale: string;\n // First locale is the default (English)\n supportedTranslationLocales: string[] = ['en'];\n translationLocale: string;\n collator: Intl.Collator;\n\n protected inited: boolean;\n protected defaultMessages: any = {};\n protected localeMessages: any = {};\n\n constructor(protected systemLanguage: string, protected localesDirectory: string,\n protected getLocalesJson: (formattedLocale: string) => Promise) {\n this.systemLanguage = systemLanguage.replace('_', '-');\n }\n\n async init(locale?: string) {\n if (this.inited) {\n throw new Error('i18n already initialized.');\n }\n if (this.supportedTranslationLocales == null || this.supportedTranslationLocales.length === 0) {\n throw new Error('supportedTranslationLocales not set.');\n }\n\n this.inited = true;\n this.locale = this.translationLocale = locale != null ? locale : this.systemLanguage;\n\n try {\n this.collator = new Intl.Collator(this.locale, { numeric: true, sensitivity: 'base' });\n } catch {\n this.collator = null;\n }\n\n if (this.supportedTranslationLocales.indexOf(this.translationLocale) === -1) {\n this.translationLocale = this.translationLocale.slice(0, 2);\n\n if (this.supportedTranslationLocales.indexOf(this.translationLocale) === -1) {\n this.translationLocale = this.supportedTranslationLocales[0];\n }\n }\n\n if (this.localesDirectory != null) {\n await this.loadMessages(this.translationLocale, this.localeMessages);\n if (this.translationLocale !== this.supportedTranslationLocales[0]) {\n await this.loadMessages(this.supportedTranslationLocales[0], this.defaultMessages);\n }\n }\n }\n\n t(id: string, p1?: string, p2?: string, p3?: string): string {\n return this.translate(id, p1, p2, p3);\n }\n\n translate(id: string, p1?: string, p2?: string, p3?: string): string {\n let result: string;\n if (this.localeMessages.hasOwnProperty(id) && this.localeMessages[id]) {\n result = this.localeMessages[id];\n } else if (this.defaultMessages.hasOwnProperty(id) && this.defaultMessages[id]) {\n result = this.defaultMessages[id];\n } else {\n result = '';\n }\n\n if (result !== '') {\n if (p1 != null) {\n result = result.split('__$1__').join(p1);\n }\n if (p2 != null) {\n result = result.split('__$2__').join(p2);\n }\n if (p3 != null) {\n result = result.split('__$3__').join(p3);\n }\n }\n\n return result;\n }\n\n private async loadMessages(locale: string, messagesObj: any): Promise {\n const formattedLocale = locale.replace('-', '_');\n const locales = await this.getLocalesJson(formattedLocale);\n for (const prop in locales) {\n if (!locales.hasOwnProperty(prop)) {\n continue;\n }\n messagesObj[prop] = locales[prop].message;\n\n if (locales[prop].placeholders) {\n for (const placeProp in locales[prop].placeholders) {\n if (!locales[prop].placeholders.hasOwnProperty(placeProp) ||\n !locales[prop].placeholders[placeProp].content) {\n continue;\n }\n\n const replaceToken = '\\\\$' + placeProp.toUpperCase() + '\\\\$';\n let replaceContent = locales[prop].placeholders[placeProp].content;\n if (replaceContent === '$1' || replaceContent === '$2' || replaceContent === '$3') {\n replaceContent = '__' + replaceContent + '__';\n }\n messagesObj[prop] = messagesObj[prop].replace(new RegExp(replaceToken, 'g'), replaceContent);\n }\n }\n }\n }\n\n}\n","import { FolderResponse } from '../response/folderResponse';\r\n\r\nexport class FolderData {\r\n id: string;\r\n userId: string;\r\n name: string;\r\n revisionDate: string;\r\n\r\n constructor(response: FolderResponse, userId: string) {\r\n this.userId = userId;\r\n this.name = response.name;\r\n this.id = response.id;\r\n this.revisionDate = response.revisionDate;\r\n }\r\n}\r\n","import { FolderData } from '../models/data/folderData';\r\n\r\nimport { Folder } from '../models/domain/folder';\r\nimport { SymmetricCryptoKey } from '../models/domain/symmetricCryptoKey';\r\n\r\nimport { FolderRequest } from '../models/request/folderRequest';\r\n\r\nimport { FolderResponse } from '../models/response/folderResponse';\r\n\r\nimport { FolderView } from '../models/view/folderView';\r\n\r\nimport { ApiService } from '../abstractions/api.service';\r\nimport { CipherService } from '../abstractions/cipher.service';\r\nimport { CryptoService } from '../abstractions/crypto.service';\r\nimport { FolderService as FolderServiceAbstraction } from '../abstractions/folder.service';\r\nimport { I18nService } from '../abstractions/i18n.service';\r\nimport { StorageService } from '../abstractions/storage.service';\r\nimport { UserService } from '../abstractions/user.service';\r\nimport { CipherData } from '../models/data/cipherData';\r\n\r\nimport { Utils } from '../misc/utils';\r\n\r\nconst Keys = {\r\n foldersPrefix: 'folders_',\r\n ciphersPrefix: 'ciphers_',\r\n};\r\n\r\nexport class FolderService implements FolderServiceAbstraction {\r\n decryptedFolderCache: FolderView[];\r\n\r\n constructor(private cryptoService: CryptoService, private userService: UserService,\r\n private apiService: ApiService, private storageService: StorageService,\r\n private i18nService: I18nService, private cipherService: CipherService) { }\r\n\r\n clearCache(): void {\r\n this.decryptedFolderCache = null;\r\n }\r\n\r\n async encrypt(model: FolderView, key?: SymmetricCryptoKey): Promise {\r\n const folder = new Folder();\r\n folder.id = model.id;\r\n folder.name = await this.cryptoService.encrypt(model.name, key);\r\n return folder;\r\n }\r\n\r\n async get(id: string): Promise {\r\n const userId = await this.userService.getUserId();\r\n const folders = await this.storageService.get<{ [id: string]: FolderData; }>(\r\n Keys.foldersPrefix + userId);\r\n if (folders == null || !folders.hasOwnProperty(id)) {\r\n return null;\r\n }\r\n\r\n return new Folder(folders[id]);\r\n }\r\n\r\n async getAll(): Promise {\r\n const userId = await this.userService.getUserId();\r\n const folders = await this.storageService.get<{ [id: string]: FolderData; }>(\r\n Keys.foldersPrefix + userId);\r\n const response: Folder[] = [];\r\n for (const id in folders) {\r\n if (folders.hasOwnProperty(id)) {\r\n response.push(new Folder(folders[id]));\r\n }\r\n }\r\n return response;\r\n }\r\n\r\n async getAllDecrypted(): Promise {\r\n if (this.decryptedFolderCache != null) {\r\n return this.decryptedFolderCache;\r\n }\r\n\r\n const hasKey = await this.cryptoService.hasKey();\r\n if (!hasKey) {\r\n throw new Error('No key.');\r\n }\r\n\r\n const decFolders: FolderView[] = [];\r\n const promises: Array> = [];\r\n const folders = await this.getAll();\r\n folders.forEach((folder) => {\r\n promises.push(folder.decrypt().then((f) => decFolders.push(f)));\r\n });\r\n\r\n await Promise.all(promises);\r\n decFolders.sort(Utils.getSortFunction(this.i18nService, 'name'));\r\n\r\n const noneFolder = new FolderView();\r\n noneFolder.name = this.i18nService.t('noneFolder');\r\n decFolders.push(noneFolder);\r\n\r\n this.decryptedFolderCache = decFolders;\r\n return this.decryptedFolderCache;\r\n }\r\n\r\n async saveWithServer(folder: Folder): Promise {\r\n const request = new FolderRequest(folder);\r\n\r\n let response: FolderResponse;\r\n if (folder.id == null) {\r\n response = await this.apiService.postFolder(request);\r\n folder.id = response.id;\r\n } else {\r\n response = await this.apiService.putFolder(folder.id, request);\r\n }\r\n\r\n const userId = await this.userService.getUserId();\r\n const data = new FolderData(response, userId);\r\n await this.upsert(data);\r\n }\r\n\r\n async upsert(folder: FolderData | FolderData[]): Promise {\r\n const userId = await this.userService.getUserId();\r\n let folders = await this.storageService.get<{ [id: string]: FolderData; }>(\r\n Keys.foldersPrefix + userId);\r\n if (folders == null) {\r\n folders = {};\r\n }\r\n\r\n if (folder instanceof FolderData) {\r\n const f = folder as FolderData;\r\n folders[f.id] = f;\r\n } else {\r\n (folder as FolderData[]).forEach((f) => {\r\n folders[f.id] = f;\r\n });\r\n }\r\n\r\n await this.storageService.save(Keys.foldersPrefix + userId, folders);\r\n this.decryptedFolderCache = null;\r\n }\r\n\r\n async replace(folders: { [id: string]: FolderData; }): Promise {\r\n const userId = await this.userService.getUserId();\r\n await this.storageService.save(Keys.foldersPrefix + userId, folders);\r\n this.decryptedFolderCache = null;\r\n }\r\n\r\n async clear(userId: string): Promise {\r\n await this.storageService.remove(Keys.foldersPrefix + userId);\r\n this.decryptedFolderCache = null;\r\n }\r\n\r\n async delete(id: string | string[]): Promise {\r\n const userId = await this.userService.getUserId();\r\n const folders = await this.storageService.get<{ [id: string]: FolderData; }>(\r\n Keys.foldersPrefix + userId);\r\n if (folders == null) {\r\n return;\r\n }\r\n\r\n if (typeof id === 'string') {\r\n const i = id as string;\r\n delete folders[id];\r\n } else {\r\n (id as string[]).forEach((i) => {\r\n delete folders[i];\r\n });\r\n }\r\n\r\n await this.storageService.save(Keys.foldersPrefix + userId, folders);\r\n this.decryptedFolderCache = null;\r\n\r\n // Items in a deleted folder are re-assigned to \"No Folder\"\r\n const ciphers = await this.storageService.get<{ [id: string]: CipherData; }>(Keys.ciphersPrefix + userId);\r\n if (ciphers != null) {\r\n const updates: CipherData[] = [];\r\n for (const cId in ciphers) {\r\n if (ciphers[cId].folderId === id) {\r\n ciphers[cId].folderId = null;\r\n updates.push(ciphers[cId]);\r\n }\r\n }\r\n if (updates.length > 0) {\r\n this.cipherService.upsert(updates);\r\n }\r\n }\r\n }\r\n\r\n async deleteWithServer(id: string): Promise {\r\n await this.apiService.deleteFolder(id);\r\n await this.delete(id);\r\n }\r\n}\r\n","import { EnvironmentUrls } from '../models/domain/environmentUrls';\n\nimport { ConstantsService } from './constants.service';\n\nimport { ApiService } from '../abstractions/api.service';\nimport { EnvironmentService as EnvironmentServiceAbstraction } from '../abstractions/environment.service';\nimport { StorageService } from '../abstractions/storage.service';\n\nexport class EnvironmentService implements EnvironmentServiceAbstraction {\n baseUrl: string;\n webVaultUrl: string;\n apiUrl: string;\n identityUrl: string;\n iconsUrl: string;\n\n constructor(private apiService: ApiService, private storageService: StorageService) {}\n\n getWebVaultUrl(): string {\n if (this.webVaultUrl != null) {\n return this.webVaultUrl;\n } else if (this.baseUrl) {\n return this.baseUrl;\n }\n return null;\n }\n\n async setUrlsFromStorage(): Promise {\n const urlsObj: any = await this.storageService.get(ConstantsService.environmentUrlsKey);\n const urls = urlsObj || {\n base: null,\n api: null,\n identity: null,\n icons: null,\n webVault: null,\n };\n\n const envUrls = new EnvironmentUrls();\n\n if (urls.base) {\n this.baseUrl = envUrls.base = urls.base;\n await this.apiService.setUrls(envUrls);\n return;\n }\n\n this.webVaultUrl = urls.webVault;\n this.apiUrl = envUrls.api = urls.api;\n this.identityUrl = envUrls.identity = urls.identity;\n this.iconsUrl = urls.icons;\n await this.apiService.setUrls(envUrls);\n }\n\n async setUrls(urls: any): Promise {\n urls.base = this.formatUrl(urls.base);\n urls.webVault = this.formatUrl(urls.webVault);\n urls.api = this.formatUrl(urls.api);\n urls.identity = this.formatUrl(urls.identity);\n urls.icons = this.formatUrl(urls.icons);\n\n await this.storageService.save(ConstantsService.environmentUrlsKey, {\n base: urls.base,\n api: urls.api,\n identity: urls.identity,\n webVault: urls.webVault,\n icons: urls.icons,\n });\n\n this.baseUrl = urls.base;\n this.webVaultUrl = urls.webVault;\n this.apiUrl = urls.api;\n this.identityUrl = urls.identity;\n this.iconsUrl = urls.icons;\n\n const envUrls = new EnvironmentUrls();\n if (this.baseUrl) {\n envUrls.base = this.baseUrl;\n } else {\n envUrls.api = this.apiUrl;\n envUrls.identity = this.identityUrl;\n }\n\n await this.apiService.setUrls(envUrls);\n return urls;\n }\n\n private formatUrl(url: string): string {\n if (url == null || url === '') {\n return null;\n }\n\n url = url.replace(/\\/+$/g, '');\n if (!url.startsWith('http://') && !url.startsWith('https://')) {\n url = 'https://' + url;\n }\n\n return url;\n }\n}\n","import { EncryptionType } from '../enums/encryptionType';\r\n\r\nimport { CipherString } from '../models/domain/cipherString';\r\nimport { EncryptedObject } from '../models/domain/encryptedObject';\r\nimport { SymmetricCryptoKey } from '../models/domain/symmetricCryptoKey';\r\nimport { ProfileOrganizationResponse } from '../models/response/profileOrganizationResponse';\r\n\r\nimport { CryptoService as CryptoServiceAbstraction } from '../abstractions/crypto.service';\r\nimport { CryptoFunctionService } from '../abstractions/cryptoFunction.service';\r\nimport { StorageService } from '../abstractions/storage.service';\r\n\r\nimport { ConstantsService } from './constants.service';\r\n\r\nimport { sequentialize } from '../misc/sequentialize';\r\nimport { Utils } from '../misc/utils';\r\n\r\nconst Keys = {\r\n key: 'key',\r\n encOrgKeys: 'encOrgKeys',\r\n encPrivateKey: 'encPrivateKey',\r\n encKey: 'encKey',\r\n keyHash: 'keyHash',\r\n};\r\n\r\nexport class CryptoService implements CryptoServiceAbstraction {\r\n private key: SymmetricCryptoKey;\r\n private encKey: SymmetricCryptoKey;\r\n private legacyEtmKey: SymmetricCryptoKey;\r\n private keyHash: string;\r\n private publicKey: ArrayBuffer;\r\n private privateKey: ArrayBuffer;\r\n private orgKeys: Map;\r\n\r\n constructor(private storageService: StorageService, private secureStorageService: StorageService,\r\n private cryptoFunctionService: CryptoFunctionService) { }\r\n\r\n async setKey(key: SymmetricCryptoKey): Promise {\r\n this.key = key;\r\n\r\n const option = await this.storageService.get(ConstantsService.lockOptionKey);\r\n if (option != null) {\r\n // if we have a lock option set, we do not store the key\r\n return;\r\n }\r\n\r\n return this.secureStorageService.save(Keys.key, key.keyB64);\r\n }\r\n\r\n setKeyHash(keyHash: string): Promise<{}> {\r\n this.keyHash = keyHash;\r\n return this.storageService.save(Keys.keyHash, keyHash);\r\n }\r\n\r\n async setEncKey(encKey: string): Promise<{}> {\r\n if (encKey == null) {\r\n return;\r\n }\r\n\r\n await this.storageService.save(Keys.encKey, encKey);\r\n this.encKey = null;\r\n }\r\n\r\n async setEncPrivateKey(encPrivateKey: string): Promise<{}> {\r\n if (encPrivateKey == null) {\r\n return;\r\n }\r\n\r\n await this.storageService.save(Keys.encPrivateKey, encPrivateKey);\r\n this.privateKey = null;\r\n }\r\n\r\n setOrgKeys(orgs: ProfileOrganizationResponse[]): Promise<{}> {\r\n const orgKeys: any = {};\r\n orgs.forEach((org) => {\r\n orgKeys[org.id] = org.key;\r\n });\r\n\r\n return this.storageService.save(Keys.encOrgKeys, orgKeys);\r\n }\r\n\r\n async getKey(): Promise {\r\n if (this.key != null) {\r\n return this.key;\r\n }\r\n\r\n const option = await this.storageService.get(ConstantsService.lockOptionKey);\r\n if (option != null) {\r\n return null;\r\n }\r\n\r\n const key = await this.secureStorageService.get(Keys.key);\r\n if (key != null) {\r\n this.key = new SymmetricCryptoKey(Utils.fromB64ToArray(key).buffer);\r\n }\r\n\r\n return key == null ? null : this.key;\r\n }\r\n\r\n getKeyHash(): Promise {\r\n if (this.keyHash != null) {\r\n return Promise.resolve(this.keyHash);\r\n }\r\n\r\n return this.storageService.get(Keys.keyHash);\r\n }\r\n\r\n @sequentialize(() => 'getEncKey')\r\n async getEncKey(): Promise {\r\n if (this.encKey != null) {\r\n return this.encKey;\r\n }\r\n\r\n const encKey = await this.storageService.get(Keys.encKey);\r\n if (encKey == null) {\r\n return null;\r\n }\r\n\r\n const key = await this.getKey();\r\n if (key == null) {\r\n return null;\r\n }\r\n\r\n let decEncKey: ArrayBuffer;\r\n const encKeyCipher = new CipherString(encKey);\r\n if (encKeyCipher.encryptionType === EncryptionType.AesCbc256_B64) {\r\n decEncKey = await this.decrypt(encKeyCipher, key);\r\n } else if (encKeyCipher.encryptionType === EncryptionType.AesCbc256_HmacSha256_B64) {\r\n const newKey = await this.stretchKey(key);\r\n decEncKey = await this.decrypt(encKeyCipher, newKey);\r\n } else {\r\n throw new Error('Unsupported encKey type.');\r\n }\r\n\r\n if (decEncKey == null) {\r\n return null;\r\n }\r\n this.encKey = new SymmetricCryptoKey(decEncKey);\r\n return this.encKey;\r\n }\r\n\r\n async getPublicKey(): Promise {\r\n if (this.publicKey != null) {\r\n return this.publicKey;\r\n }\r\n\r\n const privateKey = await this.getPrivateKey();\r\n if (privateKey == null) {\r\n return null;\r\n }\r\n\r\n this.publicKey = await this.cryptoFunctionService.rsaExtractPublicKey(privateKey);\r\n return this.publicKey;\r\n }\r\n\r\n async getPrivateKey(): Promise {\r\n if (this.privateKey != null) {\r\n return this.privateKey;\r\n }\r\n\r\n const encPrivateKey = await this.storageService.get(Keys.encPrivateKey);\r\n if (encPrivateKey == null) {\r\n return null;\r\n }\r\n\r\n this.privateKey = await this.decrypt(new CipherString(encPrivateKey), null);\r\n return this.privateKey;\r\n }\r\n\r\n @sequentialize(() => 'getOrgKeys')\r\n async getOrgKeys(): Promise> {\r\n if (this.orgKeys != null && this.orgKeys.size > 0) {\r\n return this.orgKeys;\r\n }\r\n\r\n const encOrgKeys = await this.storageService.get(Keys.encOrgKeys);\r\n if (encOrgKeys == null) {\r\n return null;\r\n }\r\n\r\n const orgKeys: Map = new Map();\r\n let setKey = false;\r\n\r\n for (const orgId in encOrgKeys) {\r\n if (!encOrgKeys.hasOwnProperty(orgId)) {\r\n continue;\r\n }\r\n\r\n const decValue = await this.rsaDecrypt(encOrgKeys[orgId]);\r\n orgKeys.set(orgId, new SymmetricCryptoKey(decValue));\r\n setKey = true;\r\n }\r\n\r\n if (setKey) {\r\n this.orgKeys = orgKeys;\r\n }\r\n\r\n return this.orgKeys;\r\n }\r\n\r\n async getOrgKey(orgId: string): Promise {\r\n if (orgId == null) {\r\n return null;\r\n }\r\n\r\n const orgKeys = await this.getOrgKeys();\r\n if (orgKeys == null || !orgKeys.has(orgId)) {\r\n return null;\r\n }\r\n\r\n return orgKeys.get(orgId);\r\n }\r\n\r\n async hasKey(): Promise {\r\n return (await this.getKey()) != null;\r\n }\r\n\r\n async hasEncKey(): Promise {\r\n const encKey = await this.storageService.get(Keys.encKey);\r\n return encKey != null;\r\n }\r\n\r\n clearKey(): Promise {\r\n this.key = this.legacyEtmKey = null;\r\n return this.secureStorageService.remove(Keys.key);\r\n }\r\n\r\n clearKeyHash(): Promise {\r\n this.keyHash = null;\r\n return this.storageService.remove(Keys.keyHash);\r\n }\r\n\r\n clearEncKey(memoryOnly?: boolean): Promise {\r\n this.encKey = null;\r\n if (memoryOnly) {\r\n return Promise.resolve();\r\n }\r\n return this.storageService.remove(Keys.encKey);\r\n }\r\n\r\n clearKeyPair(memoryOnly?: boolean): Promise {\r\n this.privateKey = null;\r\n this.publicKey = null;\r\n if (memoryOnly) {\r\n return Promise.resolve();\r\n }\r\n return this.storageService.remove(Keys.encPrivateKey);\r\n }\r\n\r\n clearOrgKeys(memoryOnly?: boolean): Promise {\r\n this.orgKeys = null;\r\n if (memoryOnly) {\r\n return Promise.resolve();\r\n }\r\n return this.storageService.remove(Keys.encOrgKeys);\r\n }\r\n\r\n clearKeys(): Promise {\r\n return Promise.all([\r\n this.clearKey(),\r\n this.clearKeyHash(),\r\n this.clearOrgKeys(),\r\n this.clearEncKey(),\r\n this.clearKeyPair(),\r\n ]);\r\n }\r\n\r\n async toggleKey(): Promise {\r\n const key = await this.getKey();\r\n const option = await this.storageService.get(ConstantsService.lockOptionKey);\r\n if (option != null || option === 0) {\r\n // if we have a lock option set, clear the key\r\n await this.clearKey();\r\n this.key = key;\r\n return;\r\n }\r\n\r\n await this.setKey(key);\r\n }\r\n\r\n async makeKey(password: string, salt: string): Promise {\r\n const key = await this.cryptoFunctionService.pbkdf2(password, salt, 'sha256', 5000);\r\n return new SymmetricCryptoKey(key);\r\n }\r\n\r\n async makeShareKey(): Promise<[CipherString, SymmetricCryptoKey]> {\r\n const shareKey = await this.cryptoFunctionService.randomBytes(64);\r\n const publicKey = await this.getPublicKey();\r\n const encKey = await this.getEncKey();\r\n const encShareKey = await this.rsaEncrypt(shareKey, publicKey, encKey);\r\n return [encShareKey, new SymmetricCryptoKey(shareKey)];\r\n }\r\n\r\n async makeKeyPair(key?: SymmetricCryptoKey): Promise<[string, CipherString]> {\r\n const keyPair = await this.cryptoFunctionService.rsaGenerateKeyPair(2048);\r\n const publicB64 = Utils.fromBufferToB64(keyPair[0]);\r\n const privateEnc = await this.encrypt(keyPair[1], key);\r\n return [publicB64, privateEnc];\r\n }\r\n\r\n async hashPassword(password: string, key: SymmetricCryptoKey): Promise {\r\n if (key == null) {\r\n key = await this.getKey();\r\n }\r\n if (password == null || key == null) {\r\n throw new Error('Invalid parameters.');\r\n }\r\n\r\n const hash = await this.cryptoFunctionService.pbkdf2(key.key, password, 'sha256', 1);\r\n return Utils.fromBufferToB64(hash);\r\n }\r\n\r\n async makeEncKey(key: SymmetricCryptoKey): Promise<[SymmetricCryptoKey, CipherString]> {\r\n const encKey = await this.cryptoFunctionService.randomBytes(64);\r\n let encKeyEnc: CipherString = null;\r\n // TODO: Uncomment when we're ready to enable key stretching\r\n encKeyEnc = await this.encrypt(encKey, key);\r\n /*\r\n if (key.key.byteLength === 32) {\r\n const newKey = await this.stretchKey(key);\r\n encKeyEnc = await this.encrypt(encKey, newKey);\r\n } else if (key.key.byteLength === 64) {\r\n encKeyEnc = await this.encrypt(encKey, key);\r\n } else {\r\n throw new Error('Invalid key size.');\r\n }\r\n */\r\n return [new SymmetricCryptoKey(encKey), encKeyEnc];\r\n }\r\n\r\n async encrypt(plainValue: string | ArrayBuffer, key?: SymmetricCryptoKey): Promise {\r\n if (plainValue == null) {\r\n return Promise.resolve(null);\r\n }\r\n\r\n let plainBuf: ArrayBuffer;\r\n if (typeof (plainValue) === 'string') {\r\n plainBuf = Utils.fromUtf8ToArray(plainValue).buffer;\r\n } else {\r\n plainBuf = plainValue;\r\n }\r\n\r\n const encObj = await this.aesEncrypt(plainBuf, key);\r\n const iv = Utils.fromBufferToB64(encObj.iv);\r\n const data = Utils.fromBufferToB64(encObj.data);\r\n const mac = encObj.mac != null ? Utils.fromBufferToB64(encObj.mac) : null;\r\n return new CipherString(encObj.key.encType, iv, data, mac);\r\n }\r\n\r\n async encryptToBytes(plainValue: ArrayBuffer, key?: SymmetricCryptoKey): Promise {\r\n const encValue = await this.aesEncrypt(plainValue, key);\r\n let macLen = 0;\r\n if (encValue.mac != null) {\r\n macLen = encValue.mac.byteLength;\r\n }\r\n\r\n const encBytes = new Uint8Array(1 + encValue.iv.byteLength + macLen + encValue.data.byteLength);\r\n encBytes.set([encValue.key.encType]);\r\n encBytes.set(new Uint8Array(encValue.iv), 1);\r\n if (encValue.mac != null) {\r\n encBytes.set(new Uint8Array(encValue.mac), 1 + encValue.iv.byteLength);\r\n }\r\n\r\n encBytes.set(new Uint8Array(encValue.data), 1 + encValue.iv.byteLength + macLen);\r\n return encBytes.buffer;\r\n }\r\n\r\n async rsaEncrypt(data: ArrayBuffer, publicKey?: ArrayBuffer, key?: SymmetricCryptoKey): Promise {\r\n if (publicKey == null) {\r\n publicKey = await this.getPublicKey();\r\n }\r\n if (publicKey == null) {\r\n throw new Error('Public key unavailable.');\r\n }\r\n\r\n let type = EncryptionType.Rsa2048_OaepSha1_B64;\r\n const encBytes = await this.cryptoFunctionService.rsaEncrypt(data, publicKey, 'sha1');\r\n let mac: string = null;\r\n if (key != null && key.macKey != null) {\r\n type = EncryptionType.Rsa2048_OaepSha1_HmacSha256_B64;\r\n const macBytes = await this.cryptoFunctionService.hmac(encBytes, key.macKey, 'sha256');\r\n mac = Utils.fromBufferToB64(macBytes);\r\n }\r\n return new CipherString(type, Utils.fromBufferToB64(encBytes), null, mac);\r\n }\r\n\r\n async decrypt(cipherString: CipherString, key?: SymmetricCryptoKey): Promise {\r\n const iv = Utils.fromB64ToArray(cipherString.iv).buffer;\r\n const data = Utils.fromB64ToArray(cipherString.data).buffer;\r\n const mac = cipherString.mac ? Utils.fromB64ToArray(cipherString.mac).buffer : null;\r\n const decipher = await this.aesDecryptToBytes(cipherString.encryptionType, data, iv, mac, key);\r\n if (decipher == null) {\r\n return null;\r\n }\r\n\r\n return decipher;\r\n }\r\n\r\n async decryptToUtf8(cipherString: CipherString, key?: SymmetricCryptoKey): Promise {\r\n return await this.aesDecryptToUtf8(cipherString.encryptionType, cipherString.data,\r\n cipherString.iv, cipherString.mac, key);\r\n }\r\n\r\n async decryptFromBytes(encBuf: ArrayBuffer, key: SymmetricCryptoKey): Promise {\r\n if (encBuf == null) {\r\n throw new Error('no encBuf.');\r\n }\r\n\r\n const encBytes = new Uint8Array(encBuf);\r\n const encType = encBytes[0];\r\n let ctBytes: Uint8Array = null;\r\n let ivBytes: Uint8Array = null;\r\n let macBytes: Uint8Array = null;\r\n\r\n switch (encType) {\r\n case EncryptionType.AesCbc128_HmacSha256_B64:\r\n case EncryptionType.AesCbc256_HmacSha256_B64:\r\n if (encBytes.length <= 49) { // 1 + 16 + 32 + ctLength\r\n return null;\r\n }\r\n\r\n ivBytes = encBytes.slice(1, 17);\r\n macBytes = encBytes.slice(17, 49);\r\n ctBytes = encBytes.slice(49);\r\n break;\r\n case EncryptionType.AesCbc256_B64:\r\n if (encBytes.length <= 17) { // 1 + 16 + ctLength\r\n return null;\r\n }\r\n\r\n ivBytes = encBytes.slice(1, 17);\r\n ctBytes = encBytes.slice(17);\r\n break;\r\n default:\r\n return null;\r\n }\r\n\r\n return await this.aesDecryptToBytes(encType, ctBytes.buffer, ivBytes.buffer,\r\n macBytes != null ? macBytes.buffer : null, key);\r\n }\r\n\r\n // EFForg/OpenWireless\r\n // ref https://github.com/EFForg/OpenWireless/blob/master/app/js/diceware.js\r\n async randomNumber(min: number, max: number): Promise {\r\n let rval = 0;\r\n const range = max - min + 1;\r\n const bitsNeeded = Math.ceil(Math.log2(range));\r\n if (bitsNeeded > 53) {\r\n throw new Error('We cannot generate numbers larger than 53 bits.');\r\n }\r\n\r\n const bytesNeeded = Math.ceil(bitsNeeded / 8);\r\n const mask = Math.pow(2, bitsNeeded) - 1;\r\n // 7776 -> (2^13 = 8192) -1 == 8191 or 0x00001111 11111111\r\n\r\n // Fill a byte array with N random numbers\r\n const byteArray = new Uint8Array(await this.cryptoFunctionService.randomBytes(bytesNeeded));\r\n\r\n let p = (bytesNeeded - 1) * 8;\r\n for (let i = 0; i < bytesNeeded; i++) {\r\n rval += byteArray[i] * Math.pow(2, p);\r\n p -= 8;\r\n }\r\n\r\n // Use & to apply the mask and reduce the number of recursive lookups\r\n // tslint:disable-next-line\r\n rval = rval & mask;\r\n\r\n if (rval >= range) {\r\n // Integer out of acceptable range\r\n return this.randomNumber(min, max);\r\n }\r\n\r\n // Return an integer that falls within the range\r\n return min + rval;\r\n }\r\n\r\n // Helpers\r\n\r\n private async aesEncrypt(data: ArrayBuffer, key: SymmetricCryptoKey): Promise {\r\n const obj = new EncryptedObject();\r\n obj.key = await this.getKeyForEncryption(key);\r\n obj.iv = await this.cryptoFunctionService.randomBytes(16);\r\n obj.data = await this.cryptoFunctionService.aesEncrypt(data, obj.iv, obj.key.encKey);\r\n\r\n if (obj.key.macKey != null) {\r\n const macData = new Uint8Array(obj.iv.byteLength + obj.data.byteLength);\r\n macData.set(new Uint8Array(obj.iv), 0);\r\n macData.set(new Uint8Array(obj.data), obj.iv.byteLength);\r\n obj.mac = await this.cryptoFunctionService.hmac(macData.buffer, obj.key.macKey, 'sha256');\r\n }\r\n\r\n return obj;\r\n }\r\n\r\n private async aesDecryptToUtf8(encType: EncryptionType, data: string, iv: string, mac: string,\r\n key: SymmetricCryptoKey): Promise {\r\n const keyForEnc = await this.getKeyForEncryption(key);\r\n const theKey = this.resolveLegacyKey(encType, keyForEnc);\r\n\r\n if (theKey.macKey != null && mac == null) {\r\n // tslint:disable-next-line\r\n console.error('mac required.');\r\n return null;\r\n }\r\n\r\n if (theKey.encType !== encType) {\r\n // tslint:disable-next-line\r\n console.error('encType unavailable.');\r\n return null;\r\n }\r\n\r\n const fastParams = this.cryptoFunctionService.aesDecryptFastParameters(data, iv, mac, theKey);\r\n if (fastParams.macKey != null && fastParams.mac != null) {\r\n const computedMac = await this.cryptoFunctionService.hmacFast(fastParams.macData,\r\n fastParams.macKey, 'sha256');\r\n const macsEqual = await this.cryptoFunctionService.compareFast(fastParams.mac, computedMac);\r\n if (!macsEqual) {\r\n // tslint:disable-next-line\r\n console.error('mac failed.');\r\n return null;\r\n }\r\n }\r\n\r\n return this.cryptoFunctionService.aesDecryptFast(fastParams);\r\n }\r\n\r\n private async aesDecryptToBytes(encType: EncryptionType, data: ArrayBuffer, iv: ArrayBuffer,\r\n mac: ArrayBuffer, key: SymmetricCryptoKey): Promise {\r\n const keyForEnc = await this.getKeyForEncryption(key);\r\n const theKey = this.resolveLegacyKey(encType, keyForEnc);\r\n\r\n if (theKey.macKey != null && mac == null) {\r\n return null;\r\n }\r\n\r\n if (theKey.encType !== encType) {\r\n return null;\r\n }\r\n\r\n if (theKey.macKey != null && mac != null) {\r\n const macData = new Uint8Array(iv.byteLength + data.byteLength);\r\n macData.set(new Uint8Array(iv), 0);\r\n macData.set(new Uint8Array(data), iv.byteLength);\r\n const computedMac = await this.cryptoFunctionService.hmac(macData.buffer, theKey.macKey, 'sha256');\r\n if (computedMac === null) {\r\n return null;\r\n }\r\n\r\n const macsMatch = await this.cryptoFunctionService.compare(mac, computedMac);\r\n if (!macsMatch) {\r\n // tslint:disable-next-line\r\n console.error('mac failed.');\r\n return null;\r\n }\r\n }\r\n\r\n return await this.cryptoFunctionService.aesDecrypt(data, iv, theKey.encKey);\r\n }\r\n\r\n private async rsaDecrypt(encValue: string): Promise {\r\n const headerPieces = encValue.split('.');\r\n let encType: EncryptionType = null;\r\n let encPieces: string[];\r\n\r\n if (headerPieces.length === 1) {\r\n encType = EncryptionType.Rsa2048_OaepSha256_B64;\r\n encPieces = [headerPieces[0]];\r\n } else if (headerPieces.length === 2) {\r\n try {\r\n encType = parseInt(headerPieces[0], null);\r\n encPieces = headerPieces[1].split('|');\r\n } catch (e) { }\r\n }\r\n\r\n switch (encType) {\r\n case EncryptionType.Rsa2048_OaepSha256_B64:\r\n case EncryptionType.Rsa2048_OaepSha1_B64:\r\n if (encPieces.length !== 1) {\r\n throw new Error('Invalid cipher format.');\r\n }\r\n break;\r\n case EncryptionType.Rsa2048_OaepSha256_HmacSha256_B64:\r\n case EncryptionType.Rsa2048_OaepSha1_HmacSha256_B64:\r\n if (encPieces.length !== 2) {\r\n throw new Error('Invalid cipher format.');\r\n }\r\n break;\r\n default:\r\n throw new Error('encType unavailable.');\r\n }\r\n\r\n if (encPieces == null || encPieces.length <= 0) {\r\n throw new Error('encPieces unavailable.');\r\n }\r\n\r\n const data = Utils.fromB64ToArray(encPieces[0]).buffer;\r\n const key = await this.getEncKey();\r\n if (key != null && key.macKey != null && encPieces.length > 1) {\r\n const mac = Utils.fromB64ToArray(encPieces[1]).buffer;\r\n const computedMac = await this.cryptoFunctionService.hmac(data, key.macKey, 'sha256');\r\n const macsEqual = await this.cryptoFunctionService.compare(mac, computedMac);\r\n if (!macsEqual) {\r\n throw new Error('MAC failed.');\r\n }\r\n }\r\n\r\n const privateKey = await this.getPrivateKey();\r\n if (privateKey == null) {\r\n throw new Error('No private key.');\r\n }\r\n\r\n let alg: 'sha1' | 'sha256' = 'sha1';\r\n switch (encType) {\r\n case EncryptionType.Rsa2048_OaepSha256_B64:\r\n case EncryptionType.Rsa2048_OaepSha256_HmacSha256_B64:\r\n alg = 'sha256';\r\n break;\r\n case EncryptionType.Rsa2048_OaepSha1_B64:\r\n case EncryptionType.Rsa2048_OaepSha1_HmacSha256_B64:\r\n break;\r\n default:\r\n throw new Error('encType unavailable.');\r\n }\r\n\r\n return this.cryptoFunctionService.rsaDecrypt(data, privateKey, alg);\r\n }\r\n\r\n private async getKeyForEncryption(key?: SymmetricCryptoKey): Promise {\r\n if (key != null) {\r\n return key;\r\n }\r\n\r\n const encKey = await this.getEncKey();\r\n if (encKey != null) {\r\n return encKey;\r\n }\r\n\r\n return await this.getKey();\r\n }\r\n\r\n private resolveLegacyKey(encType: EncryptionType, key: SymmetricCryptoKey): SymmetricCryptoKey {\r\n if (encType === EncryptionType.AesCbc128_HmacSha256_B64 &&\r\n key.encType === EncryptionType.AesCbc256_B64) {\r\n // Old encrypt-then-mac scheme, make a new key\r\n if (this.legacyEtmKey == null) {\r\n this.legacyEtmKey = new SymmetricCryptoKey(key.key, EncryptionType.AesCbc128_HmacSha256_B64);\r\n }\r\n return this.legacyEtmKey;\r\n }\r\n\r\n return key;\r\n }\r\n\r\n private async stretchKey(key: SymmetricCryptoKey): Promise {\r\n const newKey = new Uint8Array(64);\r\n newKey.set(await this.hkdfExpand(key.key, Utils.fromUtf8ToArray('enc'), 32));\r\n newKey.set(await this.hkdfExpand(key.key, Utils.fromUtf8ToArray('mac'), 32), 32);\r\n return new SymmetricCryptoKey(newKey.buffer);\r\n }\r\n\r\n // ref: https://tools.ietf.org/html/rfc5869\r\n private async hkdfExpand(prk: ArrayBuffer, info: Uint8Array, size: number) {\r\n const hashLen = 32; // sha256\r\n const okm = new Uint8Array(size);\r\n let previousT = new Uint8Array(0);\r\n const n = Math.ceil(size / hashLen);\r\n for (let i = 0; i < n; i++) {\r\n const t = new Uint8Array(previousT.length + info.length + 1);\r\n t.set(previousT);\r\n t.set(info, previousT.length);\r\n t.set([i + 1], t.length - 1);\r\n previousT = new Uint8Array(await this.cryptoFunctionService.hmac(t.buffer, prk, 'sha256'));\r\n okm.set(previousT, i * hashLen);\r\n }\r\n return okm;\r\n }\r\n}\r\n","import { CryptoService } from '../abstractions/crypto.service';\nimport { PlatformUtilsService } from '../abstractions/platformUtils.service';\n\nexport class ContainerService {\n constructor(private cryptoService: CryptoService,\n private platformUtilsService: PlatformUtilsService) {\n }\n\n // deprecated, use attachToGlobal instead\n attachToWindow(win: any) {\n this.attachToGlobal(win);\n }\n\n attachToGlobal(global: any) {\n if (!global.bitwardenContainerService) {\n global.bitwardenContainerService = this;\n }\n }\n\n getCryptoService(): CryptoService {\n return this.cryptoService;\n }\n\n getPlatformUtilsService(): PlatformUtilsService {\n return this.platformUtilsService;\n }\n}\n","import { CollectionData } from '../models/data/collectionData';\r\n\r\nimport { Collection } from '../models/domain/collection';\r\n\r\nimport { CollectionView } from '../models/view/collectionView';\r\n\r\nimport { CollectionService as CollectionServiceAbstraction } from '../abstractions/collection.service';\r\nimport { CryptoService } from '../abstractions/crypto.service';\r\nimport { I18nService } from '../abstractions/i18n.service';\r\nimport { StorageService } from '../abstractions/storage.service';\r\nimport { UserService } from '../abstractions/user.service';\r\n\r\nimport { Utils } from '../misc/utils';\r\n\r\nconst Keys = {\r\n collectionsPrefix: 'collections_',\r\n};\r\n\r\nexport class CollectionService implements CollectionServiceAbstraction {\r\n decryptedCollectionCache: CollectionView[];\r\n\r\n constructor(private cryptoService: CryptoService, private userService: UserService,\r\n private storageService: StorageService, private i18nService: I18nService) {\r\n }\r\n\r\n clearCache(): void {\r\n this.decryptedCollectionCache = null;\r\n }\r\n\r\n async encrypt(model: CollectionView): Promise {\r\n if (model.organizationId == null) {\r\n throw new Error('Collection has no organization id.');\r\n }\r\n const key = await this.cryptoService.getOrgKey(model.organizationId);\r\n if (key == null) {\r\n throw new Error('No key for this collection\\'s organization.');\r\n }\r\n const collection = new Collection();\r\n collection.id = model.id;\r\n collection.organizationId = model.organizationId;\r\n collection.readOnly = model.readOnly;\r\n collection.name = await this.cryptoService.encrypt(model.name, key);\r\n return collection;\r\n }\r\n\r\n async decryptMany(collections: Collection[]): Promise {\r\n if (collections == null) {\r\n return [];\r\n }\r\n const decCollections: CollectionView[] = [];\r\n const promises: Array> = [];\r\n collections.forEach((collection) => {\r\n promises.push(collection.decrypt().then((c) => decCollections.push(c)));\r\n });\r\n await Promise.all(promises);\r\n return decCollections.sort(Utils.getSortFunction(this.i18nService, 'name'));\r\n }\r\n\r\n async get(id: string): Promise {\r\n const userId = await this.userService.getUserId();\r\n const collections = await this.storageService.get<{ [id: string]: CollectionData; }>(\r\n Keys.collectionsPrefix + userId);\r\n if (collections == null || !collections.hasOwnProperty(id)) {\r\n return null;\r\n }\r\n\r\n return new Collection(collections[id]);\r\n }\r\n\r\n async getAll(): Promise {\r\n const userId = await this.userService.getUserId();\r\n const collections = await this.storageService.get<{ [id: string]: CollectionData; }>(\r\n Keys.collectionsPrefix + userId);\r\n const response: Collection[] = [];\r\n for (const id in collections) {\r\n if (collections.hasOwnProperty(id)) {\r\n response.push(new Collection(collections[id]));\r\n }\r\n }\r\n return response;\r\n }\r\n\r\n async getAllDecrypted(): Promise {\r\n if (this.decryptedCollectionCache != null) {\r\n return this.decryptedCollectionCache;\r\n }\r\n\r\n const hasKey = await this.cryptoService.hasKey();\r\n if (!hasKey) {\r\n throw new Error('No key.');\r\n }\r\n\r\n const collections = await this.getAll();\r\n this.decryptedCollectionCache = await this.decryptMany(collections);\r\n return this.decryptedCollectionCache;\r\n }\r\n\r\n async upsert(collection: CollectionData | CollectionData[]): Promise {\r\n const userId = await this.userService.getUserId();\r\n let collections = await this.storageService.get<{ [id: string]: CollectionData; }>(\r\n Keys.collectionsPrefix + userId);\r\n if (collections == null) {\r\n collections = {};\r\n }\r\n\r\n if (collection instanceof CollectionData) {\r\n const c = collection as CollectionData;\r\n collections[c.id] = c;\r\n } else {\r\n (collection as CollectionData[]).forEach((c) => {\r\n collections[c.id] = c;\r\n });\r\n }\r\n\r\n await this.storageService.save(Keys.collectionsPrefix + userId, collections);\r\n this.decryptedCollectionCache = null;\r\n }\r\n\r\n async replace(collections: { [id: string]: CollectionData; }): Promise {\r\n const userId = await this.userService.getUserId();\r\n await this.storageService.save(Keys.collectionsPrefix + userId, collections);\r\n this.decryptedCollectionCache = null;\r\n }\r\n\r\n async clear(userId: string): Promise {\r\n await this.storageService.remove(Keys.collectionsPrefix + userId);\r\n this.decryptedCollectionCache = null;\r\n }\r\n\r\n async delete(id: string | string[]): Promise {\r\n const userId = await this.userService.getUserId();\r\n const collections = await this.storageService.get<{ [id: string]: CollectionData; }>(\r\n Keys.collectionsPrefix + userId);\r\n if (collections == null) {\r\n return;\r\n }\r\n\r\n if (typeof id === 'string') {\r\n const i = id as string;\r\n delete collections[id];\r\n } else {\r\n (id as string[]).forEach((i) => {\r\n delete collections[i];\r\n });\r\n }\r\n\r\n await this.storageService.save(Keys.collectionsPrefix + userId, collections);\r\n this.decryptedCollectionCache = null;\r\n }\r\n}\r\n","import { CipherType } from '../enums/cipherType';\r\nimport { UriMatchType } from '../enums/uriMatchType';\r\n\r\nimport { CipherData } from '../models/data/cipherData';\r\n\r\nimport { Attachment } from '../models/domain/attachment';\r\nimport { Card } from '../models/domain/card';\r\nimport { Cipher } from '../models/domain/cipher';\r\nimport { CipherString } from '../models/domain/cipherString';\r\nimport Domain from '../models/domain/domain';\r\nimport { Field } from '../models/domain/field';\r\nimport { Identity } from '../models/domain/identity';\r\nimport { Login } from '../models/domain/login';\r\nimport { LoginUri } from '../models/domain/loginUri';\r\nimport { SecureNote } from '../models/domain/secureNote';\r\nimport { SymmetricCryptoKey } from '../models/domain/symmetricCryptoKey';\r\n\r\nimport { CipherBulkDeleteRequest } from '../models/request/cipherBulkDeleteRequest';\r\nimport { CipherBulkMoveRequest } from '../models/request/cipherBulkMoveRequest';\r\nimport { CipherBulkShareRequest } from '../models/request/cipherBulkShareRequest';\r\nimport { CipherCollectionsRequest } from '../models/request/cipherCollectionsRequest';\r\nimport { CipherRequest } from '../models/request/cipherRequest';\r\nimport { CipherShareRequest } from '../models/request/cipherShareRequest';\r\n\r\nimport { CipherResponse } from '../models/response/cipherResponse';\r\nimport { ErrorResponse } from '../models/response/errorResponse';\r\n\r\nimport { AttachmentView } from '../models/view/attachmentView';\r\nimport { CipherView } from '../models/view/cipherView';\r\nimport { FieldView } from '../models/view/fieldView';\r\nimport { View } from '../models/view/view';\r\n\r\nimport { ApiService } from '../abstractions/api.service';\r\nimport { CipherService as CipherServiceAbstraction } from '../abstractions/cipher.service';\r\nimport { CryptoService } from '../abstractions/crypto.service';\r\nimport { I18nService } from '../abstractions/i18n.service';\r\nimport { PlatformUtilsService } from '../abstractions/platformUtils.service';\r\nimport { SettingsService } from '../abstractions/settings.service';\r\nimport { StorageService } from '../abstractions/storage.service';\r\nimport { UserService } from '../abstractions/user.service';\r\n\r\nimport { Utils } from '../misc/utils';\r\n\r\nconst Keys = {\r\n ciphersPrefix: 'ciphers_',\r\n localData: 'sitesLocalData',\r\n neverDomains: 'neverDomains',\r\n};\r\n\r\nexport class CipherService implements CipherServiceAbstraction {\r\n decryptedCipherCache: CipherView[];\r\n\r\n constructor(private cryptoService: CryptoService, private userService: UserService,\r\n private settingsService: SettingsService, private apiService: ApiService,\r\n private storageService: StorageService, private i18nService: I18nService,\r\n private platformUtilsService: PlatformUtilsService) {\r\n }\r\n\r\n clearCache(): void {\r\n this.decryptedCipherCache = null;\r\n }\r\n\r\n async encrypt(model: CipherView, key?: SymmetricCryptoKey): Promise {\r\n const cipher = new Cipher();\r\n cipher.id = model.id;\r\n cipher.folderId = model.folderId;\r\n cipher.favorite = model.favorite;\r\n cipher.organizationId = model.organizationId;\r\n cipher.type = model.type;\r\n cipher.collectionIds = model.collectionIds;\r\n\r\n if (key == null && cipher.organizationId != null) {\r\n key = await this.cryptoService.getOrgKey(cipher.organizationId);\r\n }\r\n await Promise.all([\r\n this.encryptObjProperty(model, cipher, {\r\n name: null,\r\n notes: null,\r\n }, key),\r\n this.encryptCipherData(cipher, model, key),\r\n this.encryptFields(model.fields, key).then((fields) => {\r\n cipher.fields = fields;\r\n }),\r\n this.encryptAttachments(model.attachments, key).then((attachments) => {\r\n cipher.attachments = attachments;\r\n }),\r\n ]);\r\n\r\n return cipher;\r\n }\r\n\r\n async encryptAttachments(attachmentsModel: AttachmentView[], key: SymmetricCryptoKey): Promise {\r\n if (attachmentsModel == null || attachmentsModel.length === 0) {\r\n return null;\r\n }\r\n\r\n const promises: Array> = [];\r\n const encAttachments: Attachment[] = [];\r\n attachmentsModel.forEach(async (model) => {\r\n const attachment = new Attachment();\r\n attachment.id = model.id;\r\n attachment.size = model.size;\r\n attachment.sizeName = model.sizeName;\r\n attachment.url = model.url;\r\n const promise = this.encryptObjProperty(model, attachment, {\r\n fileName: null,\r\n }, key).then(() => {\r\n encAttachments.push(attachment);\r\n });\r\n promises.push(promise);\r\n });\r\n\r\n await Promise.all(promises);\r\n return encAttachments;\r\n }\r\n\r\n async encryptFields(fieldsModel: FieldView[], key: SymmetricCryptoKey): Promise {\r\n if (!fieldsModel || !fieldsModel.length) {\r\n return null;\r\n }\r\n\r\n const self = this;\r\n const encFields: Field[] = [];\r\n await fieldsModel.reduce((promise, field) => {\r\n return promise.then(() => {\r\n return self.encryptField(field, key);\r\n }).then((encField: Field) => {\r\n encFields.push(encField);\r\n });\r\n }, Promise.resolve());\r\n\r\n return encFields;\r\n }\r\n\r\n async encryptField(fieldModel: FieldView, key: SymmetricCryptoKey): Promise {\r\n const field = new Field();\r\n field.type = fieldModel.type;\r\n\r\n await this.encryptObjProperty(fieldModel, field, {\r\n name: null,\r\n value: null,\r\n }, key);\r\n\r\n return field;\r\n }\r\n\r\n async get(id: string): Promise {\r\n const userId = await this.userService.getUserId();\r\n const localData = await this.storageService.get(Keys.localData);\r\n const ciphers = await this.storageService.get<{ [id: string]: CipherData; }>(\r\n Keys.ciphersPrefix + userId);\r\n if (ciphers == null || !ciphers.hasOwnProperty(id)) {\r\n return null;\r\n }\r\n\r\n return new Cipher(ciphers[id], false, localData ? localData[id] : null);\r\n }\r\n\r\n async getAll(): Promise {\r\n const userId = await this.userService.getUserId();\r\n const localData = await this.storageService.get(Keys.localData);\r\n const ciphers = await this.storageService.get<{ [id: string]: CipherData; }>(\r\n Keys.ciphersPrefix + userId);\r\n const response: Cipher[] = [];\r\n for (const id in ciphers) {\r\n if (ciphers.hasOwnProperty(id)) {\r\n response.push(new Cipher(ciphers[id], false, localData ? localData[id] : null));\r\n }\r\n }\r\n return response;\r\n }\r\n\r\n async getAllDecrypted(): Promise {\r\n if (this.decryptedCipherCache != null) {\r\n return this.decryptedCipherCache;\r\n }\r\n\r\n const decCiphers: CipherView[] = [];\r\n const hasKey = await this.cryptoService.hasKey();\r\n if (!hasKey) {\r\n throw new Error('No key.');\r\n }\r\n\r\n const promises: any[] = [];\r\n const ciphers = await this.getAll();\r\n ciphers.forEach((cipher) => {\r\n promises.push(cipher.decrypt().then((c) => decCiphers.push(c)));\r\n });\r\n\r\n await Promise.all(promises);\r\n decCiphers.sort(this.getLocaleSortingFunction());\r\n this.decryptedCipherCache = decCiphers;\r\n return this.decryptedCipherCache;\r\n }\r\n\r\n async getAllDecryptedForGrouping(groupingId: string, folder: boolean = true): Promise {\r\n const ciphers = await this.getAllDecrypted();\r\n\r\n return ciphers.filter((cipher) => {\r\n if (folder && cipher.folderId === groupingId) {\r\n return true;\r\n } else if (!folder && cipher.collectionIds != null && cipher.collectionIds.indexOf(groupingId) > -1) {\r\n return true;\r\n }\r\n\r\n return false;\r\n });\r\n }\r\n\r\n async getAllDecryptedForUrl(url: string, includeOtherTypes?: CipherType[]): Promise {\r\n if (url == null && !includeOtherTypes) {\r\n return Promise.resolve([]);\r\n }\r\n\r\n const domain = this.platformUtilsService.getDomain(url);\r\n const eqDomainsPromise = domain == null ? Promise.resolve([]) :\r\n this.settingsService.getEquivalentDomains().then((eqDomains: any[][]) => {\r\n let matches: any[] = [];\r\n eqDomains.forEach((eqDomain) => {\r\n if (eqDomain.length && eqDomain.indexOf(domain) >= 0) {\r\n matches = matches.concat(eqDomain);\r\n }\r\n });\r\n\r\n if (!matches.length) {\r\n matches.push(domain);\r\n }\r\n\r\n return matches;\r\n });\r\n\r\n const result = await Promise.all([eqDomainsPromise, this.getAllDecrypted()]);\r\n const matchingDomains = result[0];\r\n const ciphers = result[1];\r\n\r\n return ciphers.filter((cipher) => {\r\n if (includeOtherTypes && includeOtherTypes.indexOf(cipher.type) > -1) {\r\n return true;\r\n }\r\n\r\n if (url != null && cipher.type === CipherType.Login && cipher.login.uris != null) {\r\n for (let i = 0; i < cipher.login.uris.length; i++) {\r\n const u = cipher.login.uris[i];\r\n if (u.uri == null) {\r\n continue;\r\n }\r\n\r\n switch (u.match) {\r\n case null:\r\n case undefined:\r\n case UriMatchType.Domain:\r\n if (domain != null && u.domain != null && matchingDomains.indexOf(u.domain) > -1) {\r\n return true;\r\n }\r\n break;\r\n case UriMatchType.Host:\r\n const urlHost = Utils.getHost(url);\r\n if (urlHost != null && urlHost === Utils.getHost(u.uri)) {\r\n return true;\r\n }\r\n break;\r\n case UriMatchType.Exact:\r\n if (url === u.uri) {\r\n return true;\r\n }\r\n break;\r\n case UriMatchType.StartsWith:\r\n if (url.startsWith(u.uri)) {\r\n return true;\r\n }\r\n break;\r\n case UriMatchType.RegularExpression:\r\n try {\r\n const regex = new RegExp(u.uri, 'i');\r\n if (regex.test(url)) {\r\n return true;\r\n }\r\n } catch { }\r\n break;\r\n case UriMatchType.Never:\r\n default:\r\n break;\r\n }\r\n }\r\n }\r\n\r\n return false;\r\n });\r\n }\r\n\r\n async getLastUsedForUrl(url: string): Promise {\r\n const ciphers = await this.getAllDecryptedForUrl(url);\r\n if (ciphers.length === 0) {\r\n return null;\r\n }\r\n\r\n const sortedCiphers = ciphers.sort(this.sortCiphersByLastUsed);\r\n return sortedCiphers[0];\r\n }\r\n\r\n async updateLastUsedDate(id: string): Promise {\r\n let ciphersLocalData = await this.storageService.get(Keys.localData);\r\n if (!ciphersLocalData) {\r\n ciphersLocalData = {};\r\n }\r\n\r\n if (ciphersLocalData[id]) {\r\n ciphersLocalData[id].lastUsedDate = new Date().getTime();\r\n } else {\r\n ciphersLocalData[id] = {\r\n lastUsedDate: new Date().getTime(),\r\n };\r\n }\r\n\r\n await this.storageService.save(Keys.localData, ciphersLocalData);\r\n\r\n if (this.decryptedCipherCache == null) {\r\n return;\r\n }\r\n\r\n for (let i = 0; i < this.decryptedCipherCache.length; i++) {\r\n const cached = this.decryptedCipherCache[i];\r\n if (cached.id === id) {\r\n cached.localData = ciphersLocalData[id];\r\n break;\r\n }\r\n }\r\n }\r\n\r\n async saveNeverDomain(domain: string): Promise {\r\n if (domain == null) {\r\n return;\r\n }\r\n\r\n let domains = await this.storageService.get<{ [id: string]: any; }>(Keys.neverDomains);\r\n if (!domains) {\r\n domains = {};\r\n }\r\n domains[domain] = null;\r\n await this.storageService.save(Keys.neverDomains, domains);\r\n }\r\n\r\n async saveWithServer(cipher: Cipher): Promise {\r\n const request = new CipherRequest(cipher);\r\n\r\n let response: CipherResponse;\r\n if (cipher.id == null) {\r\n response = await this.apiService.postCipher(request);\r\n cipher.id = response.id;\r\n } else {\r\n response = await this.apiService.putCipher(cipher.id, request);\r\n }\r\n\r\n const userId = await this.userService.getUserId();\r\n const data = new CipherData(response, userId, cipher.collectionIds);\r\n await this.upsert(data);\r\n }\r\n\r\n async shareWithServer(cipher: CipherView, organizationId: string, collectionIds: string[]): Promise {\r\n cipher.organizationId = organizationId;\r\n cipher.collectionIds = collectionIds;\r\n const encCipher = await this.encrypt(cipher);\r\n const request = new CipherShareRequest(encCipher);\r\n await this.apiService.putShareCipher(cipher.id, request);\r\n const userId = await this.userService.getUserId();\r\n await this.upsert(encCipher.toCipherData(userId));\r\n }\r\n\r\n async shareManyWithServer(ciphers: CipherView[], organizationId: string, collectionIds: string[]): Promise {\r\n const promises: Array> = [];\r\n const encCiphers: Cipher[] = [];\r\n for (const cipher of ciphers) {\r\n cipher.organizationId = organizationId;\r\n cipher.collectionIds = collectionIds;\r\n promises.push(this.encrypt(cipher).then((c) => {\r\n encCiphers.push(c);\r\n }));\r\n }\r\n await Promise.all(promises);\r\n const request = new CipherBulkShareRequest(encCiphers, collectionIds);\r\n await this.apiService.putShareCiphers(request);\r\n const userId = await this.userService.getUserId();\r\n await this.upsert(encCiphers.map((c) => c.toCipherData(userId)));\r\n }\r\n\r\n async shareAttachmentWithServer(attachmentView: AttachmentView, cipherId: string,\r\n organizationId: string): Promise {\r\n const attachmentResponse = await fetch(new Request(attachmentView.url, { cache: 'no-cache' }));\r\n if (attachmentResponse.status !== 200) {\r\n throw Error('Failed to download attachment: ' + attachmentResponse.status.toString());\r\n }\r\n\r\n const buf = await attachmentResponse.arrayBuffer();\r\n const decBuf = await this.cryptoService.decryptFromBytes(buf, null);\r\n const key = await this.cryptoService.getOrgKey(organizationId);\r\n const encData = await this.cryptoService.encryptToBytes(decBuf, key);\r\n const encFileName = await this.cryptoService.encrypt(attachmentView.fileName, key);\r\n\r\n const fd = new FormData();\r\n try {\r\n const blob = new Blob([encData], { type: 'application/octet-stream' });\r\n fd.append('data', blob, encFileName.encryptedString);\r\n } catch (e) {\r\n if (Utils.isNode && !Utils.isBrowser) {\r\n fd.append('data', new Buffer(encData) as any, {\r\n filepath: encFileName.encryptedString,\r\n contentType: 'application/octet-stream',\r\n } as any);\r\n } else {\r\n throw e;\r\n }\r\n }\r\n\r\n let response: CipherResponse;\r\n try {\r\n response = await this.apiService.postShareCipherAttachment(cipherId, attachmentView.id, fd,\r\n organizationId);\r\n } catch (e) {\r\n throw new Error((e as ErrorResponse).getSingleMessage());\r\n }\r\n }\r\n\r\n saveAttachmentWithServer(cipher: Cipher, unencryptedFile: any, admin = false): Promise {\r\n return new Promise((resolve, reject) => {\r\n const reader = new FileReader();\r\n reader.readAsArrayBuffer(unencryptedFile);\r\n reader.onload = async (evt: any) => {\r\n try {\r\n const cData = await this.saveAttachmentRawWithServer(cipher,\r\n unencryptedFile.name, evt.target.result, admin);\r\n resolve(cData);\r\n } catch (e) {\r\n reject(e);\r\n }\r\n };\r\n reader.onerror = (evt) => {\r\n reject('Error reading file.');\r\n };\r\n });\r\n }\r\n\r\n async saveAttachmentRawWithServer(cipher: Cipher, filename: string,\r\n data: ArrayBuffer, admin = false): Promise {\r\n const key = await this.cryptoService.getOrgKey(cipher.organizationId);\r\n const encFileName = await this.cryptoService.encrypt(filename, key);\r\n const encData = await this.cryptoService.encryptToBytes(data, key);\r\n\r\n const fd = new FormData();\r\n try {\r\n const blob = new Blob([encData], { type: 'application/octet-stream' });\r\n fd.append('data', blob, encFileName.encryptedString);\r\n } catch (e) {\r\n if (Utils.isNode && !Utils.isBrowser) {\r\n fd.append('data', new Buffer(encData) as any, {\r\n filepath: encFileName.encryptedString,\r\n contentType: 'application/octet-stream',\r\n } as any);\r\n } else {\r\n throw e;\r\n }\r\n }\r\n\r\n let response: CipherResponse;\r\n try {\r\n if (admin) {\r\n response = await this.apiService.postCipherAttachmentAdmin(cipher.id, fd);\r\n } else {\r\n response = await this.apiService.postCipherAttachment(cipher.id, fd);\r\n }\r\n } catch (e) {\r\n throw new Error((e as ErrorResponse).getSingleMessage());\r\n }\r\n\r\n const userId = await this.userService.getUserId();\r\n const cData = new CipherData(response, userId, cipher.collectionIds);\r\n if (!admin) {\r\n this.upsert(cData);\r\n }\r\n return new Cipher(cData);\r\n }\r\n\r\n async saveCollectionsWithServer(cipher: Cipher): Promise {\r\n const request = new CipherCollectionsRequest(cipher.collectionIds);\r\n await this.apiService.putCipherCollections(cipher.id, request);\r\n const userId = await this.userService.getUserId();\r\n const data = cipher.toCipherData(userId);\r\n await this.upsert(data);\r\n }\r\n\r\n async upsert(cipher: CipherData | CipherData[]): Promise {\r\n const userId = await this.userService.getUserId();\r\n let ciphers = await this.storageService.get<{ [id: string]: CipherData; }>(\r\n Keys.ciphersPrefix + userId);\r\n if (ciphers == null) {\r\n ciphers = {};\r\n }\r\n\r\n if (cipher instanceof CipherData) {\r\n const c = cipher as CipherData;\r\n ciphers[c.id] = c;\r\n } else {\r\n (cipher as CipherData[]).forEach((c) => {\r\n ciphers[c.id] = c;\r\n });\r\n }\r\n\r\n await this.storageService.save(Keys.ciphersPrefix + userId, ciphers);\r\n this.decryptedCipherCache = null;\r\n }\r\n\r\n async replace(ciphers: { [id: string]: CipherData; }): Promise {\r\n const userId = await this.userService.getUserId();\r\n await this.storageService.save(Keys.ciphersPrefix + userId, ciphers);\r\n this.decryptedCipherCache = null;\r\n }\r\n\r\n async clear(userId: string): Promise {\r\n await this.storageService.remove(Keys.ciphersPrefix + userId);\r\n this.decryptedCipherCache = null;\r\n }\r\n\r\n async moveManyWithServer(ids: string[], folderId: string): Promise {\r\n await this.apiService.putMoveCiphers(new CipherBulkMoveRequest(ids, folderId));\r\n\r\n const userId = await this.userService.getUserId();\r\n let ciphers = await this.storageService.get<{ [id: string]: CipherData; }>(\r\n Keys.ciphersPrefix + userId);\r\n if (ciphers == null) {\r\n ciphers = {};\r\n }\r\n\r\n ids.forEach((id) => {\r\n if (ciphers.hasOwnProperty(id)) {\r\n ciphers[id].folderId = folderId;\r\n }\r\n });\r\n\r\n await this.storageService.save(Keys.ciphersPrefix + userId, ciphers);\r\n this.decryptedCipherCache = null;\r\n }\r\n\r\n async delete(id: string | string[]): Promise {\r\n const userId = await this.userService.getUserId();\r\n const ciphers = await this.storageService.get<{ [id: string]: CipherData; }>(\r\n Keys.ciphersPrefix + userId);\r\n if (ciphers == null) {\r\n return;\r\n }\r\n\r\n if (typeof id === 'string') {\r\n const i = id as string;\r\n delete ciphers[id];\r\n } else {\r\n (id as string[]).forEach((i) => {\r\n delete ciphers[i];\r\n });\r\n }\r\n\r\n await this.storageService.save(Keys.ciphersPrefix + userId, ciphers);\r\n this.decryptedCipherCache = null;\r\n }\r\n\r\n async deleteWithServer(id: string): Promise {\r\n await this.apiService.deleteCipher(id);\r\n await this.delete(id);\r\n }\r\n\r\n async deleteManyWithServer(ids: string[]): Promise {\r\n await this.apiService.deleteManyCiphers(new CipherBulkDeleteRequest(ids));\r\n await this.delete(ids);\r\n }\r\n\r\n async deleteAttachment(id: string, attachmentId: string): Promise {\r\n const userId = await this.userService.getUserId();\r\n const ciphers = await this.storageService.get<{ [id: string]: CipherData; }>(\r\n Keys.ciphersPrefix + userId);\r\n\r\n if (ciphers == null || !ciphers.hasOwnProperty(id) || ciphers[id].attachments == null) {\r\n return;\r\n }\r\n\r\n for (let i = 0; i < ciphers[id].attachments.length; i++) {\r\n if (ciphers[id].attachments[i].id === attachmentId) {\r\n ciphers[id].attachments.splice(i, 1);\r\n }\r\n }\r\n\r\n await this.storageService.save(Keys.ciphersPrefix + userId, ciphers);\r\n this.decryptedCipherCache = null;\r\n }\r\n\r\n async deleteAttachmentWithServer(id: string, attachmentId: string): Promise {\r\n try {\r\n await this.apiService.deleteCipherAttachment(id, attachmentId);\r\n } catch (e) {\r\n return Promise.reject((e as ErrorResponse).getSingleMessage());\r\n }\r\n await this.deleteAttachment(id, attachmentId);\r\n }\r\n\r\n sortCiphersByLastUsed(a: CipherView, b: CipherView): number {\r\n const aLastUsed = a.localData && a.localData.lastUsedDate ? a.localData.lastUsedDate as number : null;\r\n const bLastUsed = b.localData && b.localData.lastUsedDate ? b.localData.lastUsedDate as number : null;\r\n\r\n if (aLastUsed != null && bLastUsed != null && aLastUsed < bLastUsed) {\r\n return 1;\r\n }\r\n if (aLastUsed != null && bLastUsed == null) {\r\n return -1;\r\n }\r\n\r\n if (bLastUsed != null && aLastUsed != null && aLastUsed > bLastUsed) {\r\n return -1;\r\n }\r\n if (bLastUsed != null && aLastUsed == null) {\r\n return 1;\r\n }\r\n\r\n return 0;\r\n }\r\n\r\n sortCiphersByLastUsedThenName(a: CipherView, b: CipherView): number {\r\n const result = this.sortCiphersByLastUsed(a, b);\r\n if (result !== 0) {\r\n return result;\r\n }\r\n\r\n return this.getLocaleSortingFunction()(a, b);\r\n }\r\n\r\n getLocaleSortingFunction(): (a: CipherView, b: CipherView) => number {\r\n return (a, b) => {\r\n let aName = a.name;\r\n let bName = b.name;\r\n\r\n if (aName == null && bName != null) {\r\n return -1;\r\n }\r\n if (aName != null && bName == null) {\r\n return 1;\r\n }\r\n if (aName == null && bName == null) {\r\n return 0;\r\n }\r\n\r\n const result = this.i18nService.collator ? this.i18nService.collator.compare(aName, bName) :\r\n aName.localeCompare(bName);\r\n\r\n if (result !== 0 || a.type !== CipherType.Login || b.type !== CipherType.Login) {\r\n return result;\r\n }\r\n\r\n if (a.login.username != null) {\r\n aName += a.login.username;\r\n }\r\n\r\n if (b.login.username != null) {\r\n bName += b.login.username;\r\n }\r\n\r\n return this.i18nService.collator ? this.i18nService.collator.compare(aName, bName) :\r\n aName.localeCompare(bName);\r\n };\r\n }\r\n\r\n // Helpers\r\n\r\n private async encryptObjProperty(model: V, obj: D,\r\n map: any, key: SymmetricCryptoKey): Promise {\r\n const promises = [];\r\n const self = this;\r\n\r\n for (const prop in map) {\r\n if (!map.hasOwnProperty(prop)) {\r\n continue;\r\n }\r\n\r\n // tslint:disable-next-line\r\n (function (theProp, theObj) {\r\n const p = Promise.resolve().then(() => {\r\n const modelProp = (model as any)[(map[theProp] || theProp)];\r\n if (modelProp && modelProp !== '') {\r\n return self.cryptoService.encrypt(modelProp, key);\r\n }\r\n return null;\r\n }).then((val: CipherString) => {\r\n (theObj as any)[theProp] = val;\r\n });\r\n promises.push(p);\r\n })(prop, obj);\r\n }\r\n\r\n await Promise.all(promises);\r\n }\r\n\r\n private async encryptCipherData(cipher: Cipher, model: CipherView, key: SymmetricCryptoKey) {\r\n switch (cipher.type) {\r\n case CipherType.Login:\r\n cipher.login = new Login();\r\n await this.encryptObjProperty(model.login, cipher.login, {\r\n username: null,\r\n password: null,\r\n totp: null,\r\n }, key);\r\n\r\n if (model.login.uris != null) {\r\n cipher.login.uris = [];\r\n for (let i = 0; i < model.login.uris.length; i++) {\r\n const loginUri = new LoginUri();\r\n loginUri.match = model.login.uris[i].match;\r\n await this.encryptObjProperty(model.login.uris[i], loginUri, {\r\n uri: null,\r\n }, key);\r\n cipher.login.uris.push(loginUri);\r\n }\r\n }\r\n return;\r\n case CipherType.SecureNote:\r\n cipher.secureNote = new SecureNote();\r\n cipher.secureNote.type = model.secureNote.type;\r\n return;\r\n case CipherType.Card:\r\n cipher.card = new Card();\r\n await this.encryptObjProperty(model.card, cipher.card, {\r\n cardholderName: null,\r\n brand: null,\r\n number: null,\r\n expMonth: null,\r\n expYear: null,\r\n code: null,\r\n }, key);\r\n return;\r\n case CipherType.Identity:\r\n cipher.identity = new Identity();\r\n await this.encryptObjProperty(model.identity, cipher.identity, {\r\n title: null,\r\n firstName: null,\r\n middleName: null,\r\n lastName: null,\r\n address1: null,\r\n address2: null,\r\n address3: null,\r\n city: null,\r\n state: null,\r\n postalCode: null,\r\n country: null,\r\n company: null,\r\n email: null,\r\n phone: null,\r\n ssn: null,\r\n username: null,\r\n passportNumber: null,\r\n licenseNumber: null,\r\n }, key);\r\n return;\r\n default:\r\n throw new Error('Unknown cipher type.');\r\n }\r\n }\r\n}\r\n","import { ApiService } from '../abstractions/api.service';\r\nimport { AuditService as AuditServiceAbstraction } from '../abstractions/audit.service';\r\nimport { CryptoFunctionService } from '../abstractions/cryptoFunction.service';\r\n\r\nimport { Utils } from '../misc/utils';\r\n\r\nimport { BreachAccountResponse } from '../models/response/breachAccountResponse';\r\n\r\nconst PwnedPasswordsApi = 'https://api.pwnedpasswords.com/range/';\r\nconst HibpBreachApi = 'https://haveibeenpwned.com/api/v2/breachedaccount/';\r\n\r\nexport class AuditService implements AuditServiceAbstraction {\r\n constructor(private cryptoFunctionService: CryptoFunctionService, private apiService: ApiService) { }\r\n\r\n async passwordLeaked(password: string): Promise {\r\n const hashBytes = await this.cryptoFunctionService.hash(password, 'sha1');\r\n const hash = Utils.fromBufferToHex(hashBytes).toUpperCase();\r\n const hashStart = hash.substr(0, 5);\r\n const hashEnding = hash.substr(5);\r\n\r\n const response = await fetch(new Request(PwnedPasswordsApi + hashStart));\r\n const leakedHashes = await response.text();\r\n const match = leakedHashes.split(/\\r?\\n/).find((v) => {\r\n return v.split(':')[0] === hashEnding;\r\n });\r\n\r\n return match != null ? parseInt(match.split(':')[1], 10) : 0;\r\n }\r\n\r\n async breachedAccounts(username: string): Promise {\r\n const response = await this.apiService.fetch(new Request(HibpBreachApi + username));\r\n if (response.status === 404) {\r\n return [];\r\n } else if (response.status !== 200) {\r\n throw new Error();\r\n }\r\n const responseJson = await response.json();\r\n return responseJson.map((a: any) => new BreachAccountResponse(a));\r\n }\r\n}\r\n","import { Utils } from '../misc/utils';\r\n\r\nimport { AppIdService as AppIdServiceAbstraction } from '../abstractions/appId.service';\r\nimport { StorageService } from '../abstractions/storage.service';\r\n\r\nexport class AppIdService implements AppIdServiceAbstraction {\r\n constructor(private storageService: StorageService) {\r\n }\r\n\r\n getAppId(): Promise {\r\n return this.makeAndGetAppId('appId');\r\n }\r\n\r\n getAnonymousAppId(): Promise {\r\n return this.makeAndGetAppId('anonymousAppId');\r\n }\r\n\r\n private async makeAndGetAppId(key: string) {\r\n const existingId = await this.storageService.get(key);\r\n if (existingId != null) {\r\n return existingId;\r\n }\r\n\r\n const guid = Utils.newGuid();\r\n await this.storageService.save(key, guid);\r\n return guid;\r\n }\r\n}\r\n","import { ProfileOrganizationResponse } from './profileOrganizationResponse';\r\n\r\nexport class ProfileResponse {\r\n id: string;\r\n name: string;\r\n email: string;\r\n emailVerified: boolean;\r\n masterPasswordHint: string;\r\n premium: boolean;\r\n culture: string;\r\n twoFactorEnabled: boolean;\r\n key: string;\r\n privateKey: string;\r\n securityStamp: string;\r\n organizations: ProfileOrganizationResponse[] = [];\r\n\r\n constructor(response: any) {\r\n this.id = response.Id;\r\n this.name = response.Name;\r\n this.email = response.Email;\r\n this.emailVerified = response.EmailVerified;\r\n this.masterPasswordHint = response.MasterPasswordHint;\r\n this.premium = response.Premium;\r\n this.culture = response.Culture;\r\n this.twoFactorEnabled = response.TwoFactorEnabled;\r\n this.key = response.Key;\r\n this.privateKey = response.PrivateKey;\r\n this.securityStamp = response.SecurityStamp;\r\n\r\n if (response.Organizations) {\r\n response.Organizations.forEach((org: any) => {\r\n this.organizations.push(new ProfileOrganizationResponse(org));\r\n });\r\n }\r\n }\r\n}\r\n","import { PlanType } from '../../enums/planType';\n\nexport class OrganizationResponse {\n id: string;\n name: string;\n businessName: string;\n businessAddress1: string;\n businessAddress2: string;\n businessAddress3: string;\n businessCountry: string;\n businessTaxNumber: string;\n billingEmail: string;\n plan: string;\n planType: PlanType;\n seats: number;\n maxCollections: number;\n maxStorageGb: number;\n useGroups: boolean;\n useDirectory: boolean;\n useEvents: boolean;\n useTotp: boolean;\n use2fa: boolean;\n\n constructor(response: any) {\n this.id = response.Id;\n this.name = response.Name;\n this.businessName = response.BusinessName;\n this.businessAddress1 = response.BusinessAddress1;\n this.businessAddress2 = response.BusinessAddress2;\n this.businessAddress3 = response.BusinessAddress3;\n this.businessCountry = response.BusinessCountry;\n this.businessTaxNumber = response.BusinessTaxNumber;\n this.billingEmail = response.BillingEmail;\n this.plan = response.Plan;\n this.planType = response.PlanType;\n this.seats = response.Seats;\n this.maxCollections = response.MaxCollections;\n this.maxStorageGb = response.MaxStorageGb;\n this.useGroups = response.UseGroups;\n this.useDirectory = response.UseDirectory;\n this.useEvents = response.UseEvents;\n this.useTotp = response.UseTotp;\n this.use2fa = response.Use2fa;\n }\n}\n","export class FolderResponse {\r\n id: string;\r\n name: string;\r\n revisionDate: string;\r\n\r\n constructor(response: any) {\r\n this.id = response.Id;\r\n this.name = response.Name;\r\n this.revisionDate = response.RevisionDate;\r\n }\r\n}\r\n","import { GlobalDomainResponse } from './globalDomainResponse';\r\n\r\nexport class DomainsResponse {\r\n equivalentDomains: string[][];\r\n globalEquivalentDomains: GlobalDomainResponse[] = [];\r\n\r\n constructor(response: any) {\r\n this.equivalentDomains = response.EquivalentDomains;\r\n\r\n this.globalEquivalentDomains = [];\r\n if (response.GlobalEquivalentDomains) {\r\n response.GlobalEquivalentDomains.forEach((domain: any) => {\r\n this.globalEquivalentDomains.push(new GlobalDomainResponse(domain));\r\n });\r\n }\r\n }\r\n}\r\n","import { SelectionReadOnlyResponse } from './selectionReadOnlyResponse';\n\nexport class CollectionResponse {\n id: string;\n organizationId: string;\n name: string;\n\n constructor(response: any) {\n this.id = response.Id;\n this.organizationId = response.OrganizationId;\n this.name = response.Name;\n }\n}\n\nexport class CollectionDetailsResponse extends CollectionResponse {\n readOnly: boolean;\n\n constructor(response: any) {\n super(response);\n this.readOnly = response.ReadOnly || false;\n }\n}\n\nexport class CollectionGroupDetailsResponse extends CollectionResponse {\n groups: SelectionReadOnlyResponse[] = [];\n\n constructor(response: any) {\n super(response);\n if (response.Groups != null) {\n this.groups = response.Groups.map((g: any) => new SelectionReadOnlyResponse(g));\n }\n }\n}\n","import { AttachmentResponse } from './attachmentResponse';\n\nimport { CardApi } from '../api/cardApi';\nimport { FieldApi } from '../api/fieldApi';\nimport { IdentityApi } from '../api/identityApi';\nimport { LoginApi } from '../api/loginApi';\nimport { SecureNoteApi } from '../api/secureNoteApi';\n\nexport class CipherResponse {\n id: string;\n organizationId: string;\n folderId: string;\n type: number;\n name: string;\n notes: string;\n fields: FieldApi[];\n login: LoginApi;\n card: CardApi;\n identity: IdentityApi;\n secureNote: SecureNoteApi;\n favorite: boolean;\n edit: boolean;\n organizationUseTotp: boolean;\n revisionDate: Date;\n attachments: AttachmentResponse[];\n collectionIds: string[];\n\n constructor(response: any) {\n this.id = response.Id;\n this.organizationId = response.OrganizationId;\n this.folderId = response.FolderId || null;\n this.type = response.Type;\n this.name = response.Name;\n this.notes = response.Notes;\n this.favorite = response.Favorite || false;\n this.edit = response.Edit || true;\n this.organizationUseTotp = response.OrganizationUseTotp;\n this.revisionDate = new Date(response.RevisionDate);\n\n if (response.Login != null) {\n this.login = new LoginApi(response.Login);\n }\n\n if (response.Card != null) {\n this.card = new CardApi(response.Card);\n }\n\n if (response.Identity != null) {\n this.identity = new IdentityApi(response.Identity);\n }\n\n if (response.SecureNote != null) {\n this.secureNote = new SecureNoteApi(response.SecureNote);\n }\n\n if (response.Fields != null) {\n this.fields = [];\n response.Fields.forEach((field: any) => {\n this.fields.push(new FieldApi(field));\n });\n }\n\n if (response.Attachments != null) {\n this.attachments = [];\n response.Attachments.forEach((attachment: any) => {\n this.attachments.push(new AttachmentResponse(attachment));\n });\n }\n\n if (response.CollectionIds) {\n this.collectionIds = [];\n response.CollectionIds.forEach((id: string) => {\n this.collectionIds.push(id);\n });\n }\n }\n}\n","import { PaymentMethodType } from '../../enums/paymentMethodType';\n\nexport class BillingResponse {\n storageName: string;\n storageGb: number;\n maxStorageGb: number;\n paymentSource: BillingSourceResponse;\n subscription: BillingSubscriptionResponse;\n upcomingInvoice: BillingInvoiceResponse;\n charges: BillingChargeResponse[] = [];\n license: any;\n expiration: Date;\n\n constructor(response: any) {\n this.storageName = response.StorageName;\n this.storageGb = response.StorageGb;\n this.maxStorageGb = response.MaxStorageGb;\n this.paymentSource = response.PaymentSource == null ? null : new BillingSourceResponse(response.PaymentSource);\n this.subscription = response.Subscription == null ?\n null : new BillingSubscriptionResponse(response.Subscription);\n this.upcomingInvoice = response.UpcomingInvoice == null ?\n null : new BillingInvoiceResponse(response.UpcomingInvoice);\n if (response.Charges != null) {\n this.charges = response.Charges.map((c: any) => new BillingChargeResponse(c));\n }\n this.license = response.License;\n this.expiration = response.Expiration;\n }\n}\n\nexport class BillingSourceResponse {\n type: PaymentMethodType;\n cardBrand: string;\n description: string;\n needsVerification: boolean;\n\n constructor(response: any) {\n this.type = response.Type;\n this.cardBrand = response.CardBrand;\n this.description = response.Description;\n this.needsVerification = response.NeedsVerification;\n }\n}\n\nexport class BillingSubscriptionResponse {\n trialStartDate: Date;\n trialEndDate: Date;\n periodStartDate: Date;\n periodEndDate: Date;\n cancelledDate: Date;\n cancelAtEndDate: boolean;\n status: string;\n cancelled: boolean;\n items: BillingSubscriptionItemResponse[] = [];\n\n constructor(response: any) {\n this.trialEndDate = response.TrialStartDate;\n this.trialEndDate = response.TrialEndDate;\n this.periodStartDate = response.PeriodStartDate;\n this.periodEndDate = response.PeriodEndDate;\n this.cancelledDate = response.CancelledDate;\n this.cancelAtEndDate = response.CancelAtEndDate;\n this.status = response.Status;\n this.cancelled = response.Cancelled;\n if (response.Items != null) {\n this.items = response.Items.map((i: any) => new BillingSubscriptionItemResponse(i));\n }\n }\n}\n\nexport class BillingSubscriptionItemResponse {\n name: string;\n amount: number;\n quantity: number;\n interval: string;\n\n constructor(response: any) {\n this.name = response.Name;\n this.amount = response.Amount;\n this.quantity = response.Quantity;\n this.interval = response.Interval;\n }\n}\n\nexport class BillingInvoiceResponse {\n date: Date;\n amount: number;\n\n constructor(response: any) {\n this.date = response.Date;\n this.amount = response.Amount;\n }\n}\n\nexport class BillingChargeResponse {\n createdDate: Date;\n amount: number;\n paymentSource: BillingSourceResponse;\n status: string;\n failureMessage: string;\n refunded: boolean;\n partiallyRefunded: boolean;\n refundedAmount: number;\n invoiceId: string;\n\n constructor(response: any) {\n this.createdDate = response.CreatedDate;\n this.amount = response.Amount;\n this.paymentSource = response.PaymentSource != null ? new BillingSourceResponse(response.PaymentSource) : null;\n this.status = response.Status;\n this.failureMessage = response.FailureMessage;\n this.refunded = response.Refunded;\n this.partiallyRefunded = response.PartiallyRefunded;\n this.refundedAmount = response.RefundedAmount;\n this.invoiceId = response.InvoiceId;\n }\n}\n","import { DeviceType } from '../enums/deviceType';\r\n\r\nimport { ApiService as ApiServiceAbstraction } from '../abstractions/api.service';\r\nimport { PlatformUtilsService } from '../abstractions/platformUtils.service';\r\nimport { TokenService } from '../abstractions/token.service';\r\n\r\nimport { EnvironmentUrls } from '../models/domain/environmentUrls';\r\n\r\nimport { CipherBulkDeleteRequest } from '../models/request/cipherBulkDeleteRequest';\r\nimport { CipherBulkMoveRequest } from '../models/request/cipherBulkMoveRequest';\r\nimport { CipherBulkShareRequest } from '../models/request/cipherBulkShareRequest';\r\nimport { CipherCollectionsRequest } from '../models/request/cipherCollectionsRequest';\r\nimport { CipherRequest } from '../models/request/cipherRequest';\r\nimport { CipherShareRequest } from '../models/request/cipherShareRequest';\r\nimport { CollectionRequest } from '../models/request/collectionRequest';\r\nimport { DeleteRecoverRequest } from '../models/request/deleteRecoverRequest';\r\nimport { EmailRequest } from '../models/request/emailRequest';\r\nimport { EmailTokenRequest } from '../models/request/emailTokenRequest';\r\nimport { FolderRequest } from '../models/request/folderRequest';\r\nimport { GroupRequest } from '../models/request/groupRequest';\r\nimport { ImportCiphersRequest } from '../models/request/importCiphersRequest';\r\nimport { ImportDirectoryRequest } from '../models/request/importDirectoryRequest';\r\nimport { ImportOrganizationCiphersRequest } from '../models/request/importOrganizationCiphersRequest';\r\nimport { KeysRequest } from '../models/request/keysRequest';\r\nimport { OrganizationCreateRequest } from '../models/request/organizationCreateRequest';\r\nimport { OrganizationUpdateRequest } from '../models/request/organizationUpdateRequest';\r\nimport { OrganizationUserAcceptRequest } from '../models/request/organizationUserAcceptRequest';\r\nimport { OrganizationUserConfirmRequest } from '../models/request/organizationUserConfirmRequest';\r\nimport { OrganizationUserInviteRequest } from '../models/request/organizationUserInviteRequest';\r\nimport { OrganizationUserUpdateGroupsRequest } from '../models/request/organizationUserUpdateGroupsRequest';\r\nimport { OrganizationUserUpdateRequest } from '../models/request/organizationUserUpdateRequest';\r\nimport { PasswordHintRequest } from '../models/request/passwordHintRequest';\r\nimport { PasswordRequest } from '../models/request/passwordRequest';\r\nimport { PasswordVerificationRequest } from '../models/request/passwordVerificationRequest';\r\nimport { PaymentRequest } from '../models/request/paymentRequest';\r\nimport { RegisterRequest } from '../models/request/registerRequest';\r\nimport { SeatRequest } from '../models/request/seatRequest';\r\nimport { StorageRequest } from '../models/request/storageRequest';\r\nimport { TokenRequest } from '../models/request/tokenRequest';\r\nimport { TwoFactorEmailRequest } from '../models/request/twoFactorEmailRequest';\r\nimport { TwoFactorProviderRequest } from '../models/request/twoFactorProviderRequest';\r\nimport { TwoFactorRecoveryRequest } from '../models/request/twoFactorRecoveryRequest';\r\nimport { UpdateDomainsRequest } from '../models/request/updateDomainsRequest';\r\nimport { UpdateKeyRequest } from '../models/request/updateKeyRequest';\r\nimport { UpdateProfileRequest } from '../models/request/updateProfileRequest';\r\nimport { UpdateTwoFactorAuthenticatorRequest } from '../models/request/updateTwoFactorAuthenticatorRequest';\r\nimport { UpdateTwoFactorDuoRequest } from '../models/request/updateTwoFactorDuoRequest';\r\nimport { UpdateTwoFactorEmailRequest } from '../models/request/updateTwoFactorEmailRequest';\r\nimport { UpdateTwoFactorU2fRequest } from '../models/request/updateTwoFactorU2fRequest';\r\nimport { UpdateTwoFactorYubioOtpRequest } from '../models/request/updateTwoFactorYubioOtpRequest';\r\nimport { VerifyBankRequest } from '../models/request/verifyBankRequest';\r\nimport { VerifyDeleteRecoverRequest } from '../models/request/verifyDeleteRecoverRequest';\r\nimport { VerifyEmailRequest } from '../models/request/verifyEmailRequest';\r\n\r\nimport { BillingResponse } from '../models/response/billingResponse';\r\nimport { CipherResponse } from '../models/response/cipherResponse';\r\nimport {\r\n CollectionGroupDetailsResponse,\r\n CollectionResponse,\r\n} from '../models/response/collectionResponse';\r\nimport { CollectionUserResponse } from '../models/response/collectionUserResponse';\r\nimport { DomainsResponse } from '../models/response/domainsResponse';\r\nimport { ErrorResponse } from '../models/response/errorResponse';\r\nimport { EventResponse } from '../models/response/eventResponse';\r\nimport { FolderResponse } from '../models/response/folderResponse';\r\nimport {\r\n GroupDetailsResponse,\r\n GroupResponse,\r\n} from '../models/response/groupResponse';\r\nimport { GroupUserResponse } from '../models/response/groupUserResponse';\r\nimport { IdentityTokenResponse } from '../models/response/identityTokenResponse';\r\nimport { IdentityTwoFactorResponse } from '../models/response/identityTwoFactorResponse';\r\nimport { ListResponse } from '../models/response/listResponse';\r\nimport { OrganizationBillingResponse } from '../models/response/organizationBillingResponse';\r\nimport { OrganizationResponse } from '../models/response/organizationResponse';\r\nimport {\r\n OrganizationUserDetailsResponse,\r\n OrganizationUserUserDetailsResponse,\r\n} from '../models/response/organizationUserResponse';\r\nimport { ProfileResponse } from '../models/response/profileResponse';\r\nimport { SyncResponse } from '../models/response/syncResponse';\r\nimport { TwoFactorAuthenticatorResponse } from '../models/response/twoFactorAuthenticatorResponse';\r\nimport { TwoFactorDuoResponse } from '../models/response/twoFactorDuoResponse';\r\nimport { TwoFactorEmailResponse } from '../models/response/twoFactorEmailResponse';\r\nimport { TwoFactorProviderResponse } from '../models/response/twoFactorProviderResponse';\r\nimport { TwoFactorRecoverResponse } from '../models/response/twoFactorRescoverResponse';\r\nimport { TwoFactorU2fResponse } from '../models/response/twoFactorU2fResponse';\r\nimport { TwoFactorYubiKeyResponse } from '../models/response/twoFactorYubiKeyResponse';\r\nimport { UserKeyResponse } from '../models/response/userKeyResponse';\r\n\r\nexport class ApiService implements ApiServiceAbstraction {\r\n urlsSet: boolean = false;\r\n apiBaseUrl: string;\r\n identityBaseUrl: string;\r\n\r\n private deviceType: string;\r\n private isWebClient = false;\r\n private isDesktopClient = false;\r\n private usingBaseUrl = false;\r\n\r\n constructor(private tokenService: TokenService, private platformUtilsService: PlatformUtilsService,\r\n private logoutCallback: (expired: boolean) => Promise) {\r\n const device = platformUtilsService.getDevice();\r\n this.deviceType = device.toString();\r\n this.isWebClient = device === DeviceType.IEBrowser || device === DeviceType.ChromeBrowser ||\r\n device === DeviceType.EdgeBrowser || device === DeviceType.FirefoxBrowser ||\r\n device === DeviceType.OperaBrowser || device === DeviceType.SafariBrowser ||\r\n device === DeviceType.UnknownBrowser || device === DeviceType.VivaldiBrowser;\r\n this.isDesktopClient = device === DeviceType.WindowsDesktop || device === DeviceType.MacOsDesktop ||\r\n device === DeviceType.LinuxDesktop;\r\n }\r\n\r\n setUrls(urls: EnvironmentUrls): void {\r\n this.urlsSet = true;\r\n\r\n if (urls.base != null) {\r\n this.usingBaseUrl = true;\r\n this.apiBaseUrl = urls.base + '/api';\r\n this.identityBaseUrl = urls.base + '/identity';\r\n return;\r\n }\r\n\r\n if (urls.api != null && urls.identity != null) {\r\n this.apiBaseUrl = urls.api;\r\n this.identityBaseUrl = urls.identity;\r\n return;\r\n }\r\n\r\n /* tslint:disable */\r\n // Local Dev\r\n //this.apiBaseUrl = 'http://localhost:4000';\r\n //this.identityBaseUrl = 'http://localhost:33656';\r\n\r\n // Production\r\n this.apiBaseUrl = 'https://api.bitwarden.com';\r\n this.identityBaseUrl = 'https://identity.bitwarden.com';\r\n /* tslint:enable */\r\n }\r\n\r\n // Auth APIs\r\n\r\n async postIdentityToken(request: TokenRequest): Promise {\r\n const response = await this.fetch(new Request(this.identityBaseUrl + '/connect/token', {\r\n body: this.qsStringify(request.toIdentityToken(this.platformUtilsService.identityClientId)),\r\n credentials: this.getCredentials(),\r\n cache: 'no-cache',\r\n headers: new Headers({\r\n 'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8',\r\n 'Accept': 'application/json',\r\n 'Device-Type': this.deviceType,\r\n }),\r\n method: 'POST',\r\n }));\r\n\r\n let responseJson: any = null;\r\n const typeHeader = response.headers.get('content-type');\r\n if (typeHeader != null && typeHeader.indexOf('application/json') > -1) {\r\n responseJson = await response.json();\r\n }\r\n\r\n if (responseJson != null) {\r\n if (response.status === 200) {\r\n return new IdentityTokenResponse(responseJson);\r\n } else if (response.status === 400 && responseJson.TwoFactorProviders2 &&\r\n Object.keys(responseJson.TwoFactorProviders2).length) {\r\n await this.tokenService.clearTwoFactorToken(request.email);\r\n return new IdentityTwoFactorResponse(responseJson);\r\n }\r\n }\r\n\r\n return Promise.reject(new ErrorResponse(responseJson, response.status, true));\r\n }\r\n\r\n async refreshIdentityToken(): Promise {\r\n try {\r\n await this.doRefreshToken();\r\n } catch (e) {\r\n return Promise.reject(null);\r\n }\r\n }\r\n\r\n // Account APIs\r\n\r\n async getProfile(): Promise {\r\n const r = await this.send('GET', '/accounts/profile', null, true, true);\r\n return new ProfileResponse(r);\r\n }\r\n\r\n async getUserBilling(): Promise {\r\n const r = await this.send('GET', '/accounts/billing', null, true, true);\r\n return new BillingResponse(r);\r\n }\r\n\r\n async putProfile(request: UpdateProfileRequest): Promise {\r\n const r = await this.send('PUT', '/accounts/profile', request, true, true);\r\n return new ProfileResponse(r);\r\n }\r\n\r\n postEmailToken(request: EmailTokenRequest): Promise {\r\n return this.send('POST', '/accounts/email-token', request, true, false);\r\n }\r\n\r\n postEmail(request: EmailRequest): Promise {\r\n return this.send('POST', '/accounts/email', request, true, false);\r\n }\r\n\r\n postPassword(request: PasswordRequest): Promise {\r\n return this.send('POST', '/accounts/password', request, true, false);\r\n }\r\n\r\n postSecurityStamp(request: PasswordVerificationRequest): Promise {\r\n return this.send('POST', '/accounts/security-stamp', request, true, false);\r\n }\r\n\r\n deleteAccount(request: PasswordVerificationRequest): Promise {\r\n return this.send('DELETE', '/accounts', request, true, false);\r\n }\r\n\r\n async getAccountRevisionDate(): Promise {\r\n const r = await this.send('GET', '/accounts/revision-date', null, true, true);\r\n return r as number;\r\n }\r\n\r\n postPasswordHint(request: PasswordHintRequest): Promise {\r\n return this.send('POST', '/accounts/password-hint', request, false, false);\r\n }\r\n\r\n postRegister(request: RegisterRequest): Promise {\r\n return this.send('POST', '/accounts/register', request, false, false);\r\n }\r\n\r\n postPremium(data: FormData): Promise {\r\n return this.send('POST', '/accounts/premium', data, true, false);\r\n }\r\n\r\n postReinstatePremium(): Promise {\r\n return this.send('POST', '/accounts/reinstate-premium', null, true, false);\r\n }\r\n\r\n postCancelPremium(): Promise {\r\n return this.send('POST', '/accounts/cancel-premium', null, true, false);\r\n }\r\n\r\n postAccountStorage(request: StorageRequest): Promise {\r\n return this.send('POST', '/accounts/storage', request, true, false);\r\n }\r\n\r\n postAccountPayment(request: PaymentRequest): Promise {\r\n return this.send('POST', '/accounts/payment', request, true, false);\r\n }\r\n\r\n postAccountLicense(data: FormData): Promise {\r\n return this.send('POST', '/accounts/license', data, true, false);\r\n }\r\n\r\n postAccountKeys(request: KeysRequest): Promise {\r\n return this.send('POST', '/accounts/keys', request, true, false);\r\n }\r\n\r\n postAccountKey(request: UpdateKeyRequest): Promise {\r\n return this.send('POST', '/accounts/key', request, true, false);\r\n }\r\n\r\n postAccountVerifyEmail(): Promise {\r\n return this.send('POST', '/accounts/verify-email', null, true, false);\r\n }\r\n\r\n postAccountVerifyEmailToken(request: VerifyEmailRequest): Promise {\r\n return this.send('POST', '/accounts/verify-email-token', request, false, false);\r\n }\r\n\r\n postAccountRecoverDelete(request: DeleteRecoverRequest): Promise {\r\n return this.send('POST', '/accounts/delete-recover', request, false, false);\r\n }\r\n\r\n postAccountRecoverDeleteToken(request: VerifyDeleteRecoverRequest): Promise {\r\n return this.send('POST', '/accounts/delete-recover-token', request, false, false);\r\n }\r\n\r\n // Folder APIs\r\n\r\n async postFolder(request: FolderRequest): Promise {\r\n const r = await this.send('POST', '/folders', request, true, true);\r\n return new FolderResponse(r);\r\n }\r\n\r\n async putFolder(id: string, request: FolderRequest): Promise {\r\n const r = await this.send('PUT', '/folders/' + id, request, true, true);\r\n return new FolderResponse(r);\r\n }\r\n\r\n deleteFolder(id: string): Promise {\r\n return this.send('DELETE', '/folders/' + id, null, true, false);\r\n }\r\n\r\n // Cipher APIs\r\n\r\n async getCipher(id: string): Promise {\r\n const r = await this.send('GET', '/ciphers/' + id, null, true, true);\r\n return new CipherResponse(r);\r\n }\r\n\r\n async getCipherAdmin(id: string): Promise {\r\n const r = await this.send('GET', '/ciphers/' + id + '/admin', null, true, true);\r\n return new CipherResponse(r);\r\n }\r\n\r\n async getCiphersOrganization(organizationId: string): Promise> {\r\n const r = await this.send('GET', '/ciphers/organization-details?organizationId=' + organizationId,\r\n null, true, true);\r\n return new ListResponse(r, CipherResponse);\r\n }\r\n\r\n async postCipher(request: CipherRequest): Promise {\r\n const r = await this.send('POST', '/ciphers', request, true, true);\r\n return new CipherResponse(r);\r\n }\r\n\r\n async postCipherAdmin(request: CipherRequest): Promise {\r\n const r = await this.send('POST', '/ciphers/admin', request, true, true);\r\n return new CipherResponse(r);\r\n }\r\n\r\n async putCipher(id: string, request: CipherRequest): Promise {\r\n const r = await this.send('PUT', '/ciphers/' + id, request, true, true);\r\n return new CipherResponse(r);\r\n }\r\n\r\n async putCipherAdmin(id: string, request: CipherRequest): Promise {\r\n const r = await this.send('PUT', '/ciphers/' + id + '/admin', request, true, true);\r\n return new CipherResponse(r);\r\n }\r\n\r\n deleteCipher(id: string): Promise {\r\n return this.send('DELETE', '/ciphers/' + id, null, true, false);\r\n }\r\n\r\n deleteCipherAdmin(id: string): Promise {\r\n return this.send('DELETE', '/ciphers/' + id + '/admin', null, true, false);\r\n }\r\n\r\n deleteManyCiphers(request: CipherBulkDeleteRequest): Promise {\r\n return this.send('DELETE', '/ciphers', request, true, false);\r\n }\r\n\r\n putMoveCiphers(request: CipherBulkMoveRequest): Promise {\r\n return this.send('PUT', '/ciphers/move', request, true, false);\r\n }\r\n\r\n putShareCipher(id: string, request: CipherShareRequest): Promise {\r\n return this.send('PUT', '/ciphers/' + id + '/share', request, true, false);\r\n }\r\n\r\n putShareCiphers(request: CipherBulkShareRequest): Promise {\r\n return this.send('PUT', '/ciphers/share', request, true, false);\r\n }\r\n\r\n putCipherCollections(id: string, request: CipherCollectionsRequest): Promise {\r\n return this.send('PUT', '/ciphers/' + id + '/collections', request, true, false);\r\n }\r\n\r\n putCipherCollectionsAdmin(id: string, request: CipherCollectionsRequest): Promise {\r\n return this.send('PUT', '/ciphers/' + id + '/collections-admin', request, true, false);\r\n }\r\n\r\n postPurgeCiphers(request: PasswordVerificationRequest): Promise {\r\n return this.send('POST', '/ciphers/purge', request, true, false);\r\n }\r\n\r\n postImportCiphers(request: ImportCiphersRequest): Promise {\r\n return this.send('POST', '/ciphers/import', request, true, false);\r\n }\r\n\r\n postImportOrganizationCiphers(organizationId: string, request: ImportOrganizationCiphersRequest): Promise {\r\n return this.send('POST', '/ciphers/import-organization?organizationId=' + organizationId, request, true, false);\r\n }\r\n\r\n // Attachments APIs\r\n\r\n async postCipherAttachment(id: string, data: FormData): Promise {\r\n const r = await this.send('POST', '/ciphers/' + id + '/attachment', data, true, true);\r\n return new CipherResponse(r);\r\n }\r\n\r\n async postCipherAttachmentAdmin(id: string, data: FormData): Promise {\r\n const r = await this.send('POST', '/ciphers/' + id + '/attachment-admin', data, true, true);\r\n return new CipherResponse(r);\r\n }\r\n\r\n deleteCipherAttachment(id: string, attachmentId: string): Promise {\r\n return this.send('DELETE', '/ciphers/' + id + '/attachment/' + attachmentId, null, true, false);\r\n }\r\n\r\n deleteCipherAttachmentAdmin(id: string, attachmentId: string): Promise {\r\n return this.send('DELETE', '/ciphers/' + id + '/attachment/' + attachmentId + '/admin', null, true, false);\r\n }\r\n\r\n postShareCipherAttachment(id: string, attachmentId: string, data: FormData,\r\n organizationId: string): Promise {\r\n return this.send('POST', '/ciphers/' + id + '/attachment/' +\r\n attachmentId + '/share?organizationId=' + organizationId, data, true, false);\r\n }\r\n\r\n // Collections APIs\r\n\r\n async getCollectionDetails(organizationId: string, id: string): Promise {\r\n const r = await this.send('GET', '/organizations/' + organizationId + '/collections/' + id + '/details',\r\n null, true, true);\r\n return new CollectionGroupDetailsResponse(r);\r\n }\r\n\r\n async getCollections(organizationId: string): Promise> {\r\n const r = await this.send('GET', '/organizations/' + organizationId + '/collections', null, true, true);\r\n return new ListResponse(r, CollectionResponse);\r\n }\r\n\r\n async getCollectionUsers(organizationId: string, id: string): Promise> {\r\n const r = await this.send('GET', '/organizations/' + organizationId + '/collections/' + id + '/users',\r\n null, true, true);\r\n return new ListResponse(r, CollectionUserResponse);\r\n }\r\n\r\n async postCollection(organizationId: string, request: CollectionRequest): Promise {\r\n const r = await this.send('POST', '/organizations/' + organizationId + '/collections', request, true, true);\r\n return new CollectionResponse(r);\r\n }\r\n\r\n async putCollection(organizationId: string, id: string, request: CollectionRequest): Promise {\r\n const r = await this.send('PUT', '/organizations/' + organizationId + '/collections/' + id,\r\n request, true, true);\r\n return new CollectionResponse(r);\r\n }\r\n\r\n deleteCollection(organizationId: string, id: string): Promise {\r\n return this.send('DELETE', '/organizations/' + organizationId + '/collections/' + id, null, true, false);\r\n }\r\n\r\n deleteCollectionUser(organizationId: string, id: string, organizationUserId: string): Promise {\r\n return this.send('DELETE',\r\n '/organizations/' + organizationId + '/collections/' + id + '/user/' + organizationUserId,\r\n null, true, false);\r\n }\r\n\r\n // Groups APIs\r\n\r\n async getGroupDetails(organizationId: string, id: string): Promise {\r\n const r = await this.send('GET', '/organizations/' + organizationId + '/groups/' + id + '/details',\r\n null, true, true);\r\n return new GroupDetailsResponse(r);\r\n }\r\n\r\n async getGroups(organizationId: string): Promise> {\r\n const r = await this.send('GET', '/organizations/' + organizationId + '/groups', null, true, true);\r\n return new ListResponse(r, GroupResponse);\r\n }\r\n\r\n async getGroupUsers(organizationId: string, id: string): Promise> {\r\n const r = await this.send('GET', '/organizations/' + organizationId + '/groups/' + id + '/users',\r\n null, true, true);\r\n return new ListResponse(r, GroupUserResponse);\r\n }\r\n\r\n async postGroup(organizationId: string, request: GroupRequest): Promise {\r\n const r = await this.send('POST', '/organizations/' + organizationId + '/groups', request, true, true);\r\n return new GroupResponse(r);\r\n }\r\n\r\n async putGroup(organizationId: string, id: string, request: GroupRequest): Promise {\r\n const r = await this.send('PUT', '/organizations/' + organizationId + '/groups/' + id, request, true, true);\r\n return new GroupResponse(r);\r\n }\r\n\r\n deleteGroup(organizationId: string, id: string): Promise {\r\n return this.send('DELETE', '/organizations/' + organizationId + '/groups/' + id, null, true, false);\r\n }\r\n\r\n deleteGroupUser(organizationId: string, id: string, organizationUserId: string): Promise {\r\n return this.send('DELETE',\r\n '/organizations/' + organizationId + '/groups/' + id + '/user/' + organizationUserId, null, true, false);\r\n }\r\n\r\n // Organization User APIs\r\n\r\n async getOrganizationUser(organizationId: string, id: string): Promise {\r\n const r = await this.send('GET', '/organizations/' + organizationId + '/users/' + id, null, true, true);\r\n return new OrganizationUserDetailsResponse(r);\r\n }\r\n\r\n async getOrganizationUserGroups(organizationId: string, id: string): Promise {\r\n const r = await this.send('GET', '/organizations/' + organizationId + '/users/' + id + '/groups',\r\n null, true, true);\r\n return r;\r\n }\r\n\r\n async getOrganizationUsers(organizationId: string): Promise> {\r\n const r = await this.send('GET', '/organizations/' + organizationId + '/users', null, true, true);\r\n return new ListResponse(r, OrganizationUserUserDetailsResponse);\r\n }\r\n\r\n postOrganizationUserInvite(organizationId: string, request: OrganizationUserInviteRequest): Promise {\r\n return this.send('POST', '/organizations/' + organizationId + '/users/invite', request, true, false);\r\n }\r\n\r\n postOrganizationUserReinvite(organizationId: string, id: string): Promise {\r\n return this.send('POST', '/organizations/' + organizationId + '/users/' + id + '/reinvite', null, true, false);\r\n }\r\n\r\n postOrganizationUserAccept(organizationId: string, id: string,\r\n request: OrganizationUserAcceptRequest): Promise {\r\n return this.send('POST', '/organizations/' + organizationId + '/users/' + id + '/accept', request, true, false);\r\n }\r\n\r\n postOrganizationUserConfirm(organizationId: string, id: string,\r\n request: OrganizationUserConfirmRequest): Promise {\r\n return this.send('POST', '/organizations/' + organizationId + '/users/' + id + '/confirm',\r\n request, true, false);\r\n }\r\n\r\n putOrganizationUser(organizationId: string, id: string, request: OrganizationUserUpdateRequest): Promise {\r\n return this.send('PUT', '/organizations/' + organizationId + '/users/' + id, request, true, false);\r\n }\r\n\r\n putOrganizationUserGroups(organizationId: string, id: string,\r\n request: OrganizationUserUpdateGroupsRequest): Promise {\r\n return this.send('PUT', '/organizations/' + organizationId + '/users/' + id + '/groups', request, true, false);\r\n }\r\n\r\n deleteOrganizationUser(organizationId: string, id: string): Promise {\r\n return this.send('DELETE', '/organizations/' + organizationId + '/users/' + id, null, true, false);\r\n }\r\n\r\n // Sync APIs\r\n\r\n async getSync(): Promise {\r\n const path = this.isDesktopClient || this.isWebClient ? '/sync?excludeDomains=true' : '/sync';\r\n const r = await this.send('GET', path, null, true, true);\r\n return new SyncResponse(r);\r\n }\r\n\r\n async postImportDirectory(organizationId: string, request: ImportDirectoryRequest): Promise {\r\n return this.send('POST', '/organizations/' + organizationId + '/import', request, true, false);\r\n }\r\n\r\n // Settings APIs\r\n\r\n async getSettingsDomains(): Promise {\r\n const r = await this.send('GET', '/settings/domains', null, true, true);\r\n return new DomainsResponse(r);\r\n }\r\n\r\n async putSettingsDomains(request: UpdateDomainsRequest): Promise {\r\n const r = await this.send('PUT', '/settings/domains', request, true, true);\r\n return new DomainsResponse(r);\r\n }\r\n\r\n // Two-factor APIs\r\n\r\n async getTwoFactorProviders(): Promise> {\r\n const r = await this.send('GET', '/two-factor', null, true, true);\r\n return new ListResponse(r, TwoFactorProviderResponse);\r\n }\r\n\r\n async getTwoFactorOrganizationProviders(organizationId: string): Promise> {\r\n const r = await this.send('GET', '/organizations/' + organizationId + '/two-factor', null, true, true);\r\n return new ListResponse(r, TwoFactorProviderResponse);\r\n }\r\n\r\n async getTwoFactorAuthenticator(request: PasswordVerificationRequest): Promise {\r\n const r = await this.send('POST', '/two-factor/get-authenticator', request, true, true);\r\n return new TwoFactorAuthenticatorResponse(r);\r\n }\r\n\r\n async getTwoFactorEmail(request: PasswordVerificationRequest): Promise {\r\n const r = await this.send('POST', '/two-factor/get-email', request, true, true);\r\n return new TwoFactorEmailResponse(r);\r\n }\r\n\r\n async getTwoFactorDuo(request: PasswordVerificationRequest): Promise {\r\n const r = await this.send('POST', '/two-factor/get-duo', request, true, true);\r\n return new TwoFactorDuoResponse(r);\r\n }\r\n\r\n async getTwoFactorOrganizationDuo(organizationId: string,\r\n request: PasswordVerificationRequest): Promise {\r\n const r = await this.send('POST', '/organizations/' + organizationId + '/two-factor/get-duo',\r\n request, true, true);\r\n return new TwoFactorDuoResponse(r);\r\n }\r\n\r\n async getTwoFactorYubiKey(request: PasswordVerificationRequest): Promise {\r\n const r = await this.send('POST', '/two-factor/get-yubikey', request, true, true);\r\n return new TwoFactorYubiKeyResponse(r);\r\n }\r\n\r\n async getTwoFactorU2f(request: PasswordVerificationRequest): Promise {\r\n const r = await this.send('POST', '/two-factor/get-u2f', request, true, true);\r\n return new TwoFactorU2fResponse(r);\r\n }\r\n\r\n async getTwoFactorRecover(request: PasswordVerificationRequest): Promise {\r\n const r = await this.send('POST', '/two-factor/get-recover', request, true, true);\r\n return new TwoFactorRecoverResponse(r);\r\n }\r\n\r\n async putTwoFactorAuthenticator(\r\n request: UpdateTwoFactorAuthenticatorRequest): Promise {\r\n const r = await this.send('PUT', '/two-factor/authenticator', request, true, true);\r\n return new TwoFactorAuthenticatorResponse(r);\r\n }\r\n\r\n async putTwoFactorEmail(request: UpdateTwoFactorEmailRequest): Promise {\r\n const r = await this.send('PUT', '/two-factor/email', request, true, true);\r\n return new TwoFactorEmailResponse(r);\r\n }\r\n\r\n async putTwoFactorDuo(request: UpdateTwoFactorDuoRequest): Promise {\r\n const r = await this.send('PUT', '/two-factor/duo', request, true, true);\r\n return new TwoFactorDuoResponse(r);\r\n }\r\n\r\n async putTwoFactorOrganizationDuo(organizationId: string,\r\n request: UpdateTwoFactorDuoRequest): Promise {\r\n const r = await this.send('PUT', '/organizations/' + organizationId + '/two-factor/duo', request, true, true);\r\n return new TwoFactorDuoResponse(r);\r\n }\r\n\r\n async putTwoFactorYubiKey(request: UpdateTwoFactorYubioOtpRequest): Promise {\r\n const r = await this.send('PUT', '/two-factor/yubikey', request, true, true);\r\n return new TwoFactorYubiKeyResponse(r);\r\n }\r\n\r\n async putTwoFactorU2f(request: UpdateTwoFactorU2fRequest): Promise {\r\n const r = await this.send('PUT', '/two-factor/u2f', request, true, true);\r\n return new TwoFactorU2fResponse(r);\r\n }\r\n\r\n async putTwoFactorDisable(request: TwoFactorProviderRequest): Promise {\r\n const r = await this.send('PUT', '/two-factor/disable', request, true, true);\r\n return new TwoFactorProviderResponse(r);\r\n }\r\n\r\n async putTwoFactorOrganizationDisable(organizationId: string,\r\n request: TwoFactorProviderRequest): Promise {\r\n const r = await this.send('PUT', '/organizations/' + organizationId + '/two-factor/disable',\r\n request, true, true);\r\n return new TwoFactorProviderResponse(r);\r\n }\r\n\r\n postTwoFactorRecover(request: TwoFactorRecoveryRequest): Promise {\r\n return this.send('POST', '/two-factor/recover', request, false, false);\r\n }\r\n\r\n postTwoFactorEmailSetup(request: TwoFactorEmailRequest): Promise {\r\n return this.send('POST', '/two-factor/send-email', request, true, false);\r\n }\r\n\r\n postTwoFactorEmail(request: TwoFactorEmailRequest): Promise {\r\n return this.send('POST', '/two-factor/send-email-login', request, false, false);\r\n }\r\n\r\n // Organization APIs\r\n\r\n async getOrganization(id: string): Promise {\r\n const r = await this.send('GET', '/organizations/' + id, null, true, true);\r\n return new OrganizationResponse(r);\r\n }\r\n\r\n async getOrganizationBilling(id: string): Promise {\r\n const r = await this.send('GET', '/organizations/' + id + '/billing', null, true, true);\r\n return new OrganizationBillingResponse(r);\r\n }\r\n\r\n async getOrganizationLicense(id: string, installationId: string): Promise {\r\n return this.send('GET', '/organizations/' + id + '/license?installationId=' + installationId,\r\n null, true, true);\r\n }\r\n\r\n async postOrganization(request: OrganizationCreateRequest): Promise {\r\n const r = await this.send('POST', '/organizations', request, true, true);\r\n return new OrganizationResponse(r);\r\n }\r\n\r\n async putOrganization(id: string, request: OrganizationUpdateRequest): Promise {\r\n const r = await this.send('PUT', '/organizations/' + id, request, true, true);\r\n return new OrganizationResponse(r);\r\n }\r\n\r\n postLeaveOrganization(id: string): Promise {\r\n return this.send('POST', '/organizations/' + id + '/leave', null, true, false);\r\n }\r\n\r\n async postOrganizationLicense(data: FormData): Promise {\r\n const r = await this.send('POST', '/organizations/license', data, true, true);\r\n return new OrganizationResponse(r);\r\n }\r\n\r\n async postOrganizationLicenseUpdate(id: string, data: FormData): Promise {\r\n return this.send('POST', '/organizations/' + id + '/license', data, true, false);\r\n }\r\n\r\n postOrganizationSeat(id: string, request: SeatRequest): Promise {\r\n return this.send('POST', '/organizations/' + id + '/seat', request, true, false);\r\n }\r\n\r\n postOrganizationStorage(id: string, request: StorageRequest): Promise {\r\n return this.send('POST', '/organizations/' + id + '/storage', request, true, false);\r\n }\r\n\r\n postOrganizationPayment(id: string, request: PaymentRequest): Promise {\r\n return this.send('POST', '/organizations/' + id + '/payment', request, true, false);\r\n }\r\n\r\n postOrganizationVerifyBank(id: string, request: VerifyBankRequest): Promise {\r\n return this.send('POST', '/organizations/' + id + '/verify-bank', request, true, false);\r\n }\r\n\r\n postOrganizationCancel(id: string): Promise {\r\n return this.send('POST', '/organizations/' + id + '/cancel', null, true, false);\r\n }\r\n\r\n postOrganizationReinstate(id: string): Promise {\r\n return this.send('POST', '/organizations/' + id + '/reinstate', null, true, false);\r\n }\r\n\r\n deleteOrganization(id: string, request: PasswordVerificationRequest): Promise {\r\n return this.send('DELETE', '/organizations/' + id, request, true, false);\r\n }\r\n\r\n // Event APIs\r\n\r\n async getEvents(start: string, end: string, token: string): Promise> {\r\n const r = await this.send('GET', this.addEventParameters('/events', start, end, token), null, true, true);\r\n return new ListResponse(r, EventResponse);\r\n }\r\n\r\n async getEventsCipher(id: string, start: string, end: string,\r\n token: string): Promise> {\r\n const r = await this.send('GET', this.addEventParameters('/ciphers/' + id + '/events', start, end, token),\r\n null, true, true);\r\n return new ListResponse(r, EventResponse);\r\n }\r\n\r\n async getEventsOrganization(id: string, start: string, end: string,\r\n token: string): Promise> {\r\n const r = await this.send('GET', this.addEventParameters('/organizations/' + id + '/events', start, end, token),\r\n null, true, true);\r\n return new ListResponse(r, EventResponse);\r\n }\r\n\r\n async getEventsOrganizationUser(organizationId: string, id: string,\r\n start: string, end: string, token: string): Promise> {\r\n const r = await this.send('GET',\r\n this.addEventParameters('/organizations/' + organizationId + '/users/' + id + '/events', start, end, token),\r\n null, true, true);\r\n return new ListResponse(r, EventResponse);\r\n }\r\n\r\n // User APIs\r\n\r\n async getUserPublicKey(id: string): Promise {\r\n const r = await this.send('GET', '/users/' + id + '/public-key', null, true, true);\r\n return new UserKeyResponse(r);\r\n }\r\n\r\n // Helpers\r\n\r\n fetch(request: Request): Promise {\r\n if (request.method === 'GET') {\r\n request.headers.set('Cache-Control', 'no-cache');\r\n request.headers.set('Pragma', 'no-cache');\r\n }\r\n return fetch(request);\r\n }\r\n\r\n private async send(method: 'GET' | 'POST' | 'PUT' | 'DELETE', path: string, body: any,\r\n authed: boolean, hasResponse: boolean): Promise {\r\n const headers = new Headers({\r\n 'Device-Type': this.deviceType,\r\n });\r\n\r\n const requestInit: RequestInit = {\r\n cache: 'no-cache',\r\n credentials: this.getCredentials(),\r\n method: method,\r\n };\r\n\r\n if (authed) {\r\n const authHeader = await this.handleTokenState();\r\n headers.set('Authorization', authHeader);\r\n }\r\n if (body != null) {\r\n if (typeof body === 'string') {\r\n requestInit.body = body;\r\n headers.set('Content-Type', 'application/x-www-form-urlencoded; charset=utf-8');\r\n } else if (typeof body === 'object') {\r\n if (body instanceof FormData) {\r\n requestInit.body = body;\r\n } else {\r\n headers.set('Content-Type', 'application/json; charset=utf-8');\r\n requestInit.body = JSON.stringify(body);\r\n }\r\n }\r\n }\r\n if (hasResponse) {\r\n headers.set('Accept', 'application/json');\r\n }\r\n\r\n requestInit.headers = headers;\r\n const response = await this.fetch(new Request(this.apiBaseUrl + path, requestInit));\r\n\r\n if (hasResponse && response.status === 200) {\r\n const responseJson = await response.json();\r\n return responseJson;\r\n } else if (response.status !== 200) {\r\n const error = await this.handleError(response, false);\r\n return Promise.reject(error);\r\n }\r\n }\r\n\r\n private async handleError(response: Response, tokenError: boolean): Promise {\r\n if ((tokenError && response.status === 400) || response.status === 401 || response.status === 403) {\r\n await this.logoutCallback(true);\r\n return null;\r\n }\r\n\r\n let responseJson: any = null;\r\n const typeHeader = response.headers.get('content-type');\r\n if (typeHeader != null && typeHeader.indexOf('application/json') > -1) {\r\n responseJson = await response.json();\r\n }\r\n\r\n return new ErrorResponse(responseJson, response.status, tokenError);\r\n }\r\n\r\n private async handleTokenState(): Promise {\r\n let accessToken = await this.tokenService.getToken();\r\n if (this.tokenService.tokenNeedsRefresh()) {\r\n const tokenResponse = await this.doRefreshToken();\r\n accessToken = tokenResponse.accessToken;\r\n }\r\n\r\n return 'Bearer ' + accessToken;\r\n }\r\n\r\n private async doRefreshToken(): Promise {\r\n const refreshToken = await this.tokenService.getRefreshToken();\r\n if (refreshToken == null || refreshToken === '') {\r\n throw new Error();\r\n }\r\n\r\n const decodedToken = this.tokenService.decodeToken();\r\n const response = await this.fetch(new Request(this.identityBaseUrl + '/connect/token', {\r\n body: this.qsStringify({\r\n grant_type: 'refresh_token',\r\n client_id: decodedToken.client_id,\r\n refresh_token: refreshToken,\r\n }),\r\n cache: 'no-cache',\r\n credentials: this.getCredentials(),\r\n headers: new Headers({\r\n 'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8',\r\n 'Accept': 'application/json',\r\n 'Device-Type': this.deviceType,\r\n }),\r\n method: 'POST',\r\n }));\r\n\r\n if (response.status === 200) {\r\n const responseJson = await response.json();\r\n const tokenResponse = new IdentityTokenResponse(responseJson);\r\n await this.tokenService.setTokens(tokenResponse.accessToken, tokenResponse.refreshToken);\r\n return tokenResponse;\r\n } else {\r\n const error = await this.handleError(response, true);\r\n return Promise.reject(error);\r\n }\r\n }\r\n\r\n private qsStringify(params: any): string {\r\n return Object.keys(params).map((key) => {\r\n return encodeURIComponent(key) + '=' + encodeURIComponent(params[key]);\r\n }).join('&');\r\n }\r\n\r\n private getCredentials(): RequestCredentials {\r\n if (!this.isWebClient || this.usingBaseUrl) {\r\n return 'include';\r\n }\r\n return undefined;\r\n }\r\n\r\n private addEventParameters(base: string, start: string, end: string, token: string) {\r\n if (start != null) {\r\n base += ('?start=' + start);\r\n }\r\n if (end != null) {\r\n base += (base.indexOf('?') > -1 ? '&' : '?');\r\n base += ('end=' + end);\r\n }\r\n if (token != null) {\r\n base += (base.indexOf('?') > -1 ? '&' : '?');\r\n base += ('continuationToken=' + token);\r\n }\r\n return base;\r\n }\r\n}\r\n","import {\r\n Directive,\r\n ElementRef,\r\n forwardRef,\r\n HostListener,\r\n Input,\r\n Renderer2,\r\n} from '@angular/core';\r\nimport {\r\n ControlValueAccessor,\r\n NG_VALUE_ACCESSOR,\r\n NgControl,\r\n} from '@angular/forms';\r\n\r\n// ref: https://juristr.com/blog/2018/02/ng-true-value-directive/\r\n@Directive({\r\n selector: 'input[type=checkbox][appTrueFalseValue]',\r\n providers: [\r\n {\r\n provide: NG_VALUE_ACCESSOR,\r\n useExisting: forwardRef(() => TrueFalseValueDirective),\r\n multi: true,\r\n },\r\n ],\r\n})\r\nexport class TrueFalseValueDirective implements ControlValueAccessor {\r\n @Input() trueValue = true;\r\n @Input() falseValue = false;\r\n\r\n constructor(private elementRef: ElementRef, private renderer: Renderer2) { }\r\n\r\n @HostListener('change', ['$event'])\r\n onHostChange(ev: any) {\r\n this.propagateChange(ev.target.checked ? this.trueValue : this.falseValue);\r\n }\r\n\r\n writeValue(obj: any): void {\r\n if (obj === this.trueValue) {\r\n this.renderer.setProperty(this.elementRef.nativeElement, 'checked', true);\r\n } else {\r\n this.renderer.setProperty(this.elementRef.nativeElement, 'checked', false);\r\n }\r\n }\r\n\r\n registerOnChange(fn: any): void {\r\n this.propagateChange = fn;\r\n }\r\n\r\n registerOnTouched(fn: any): void { /* nothing */ }\r\n\r\n setDisabledState?(isDisabled: boolean): void { /* nothing */ }\r\n\r\n private propagateChange = (_: any) => { /* nothing */ };\r\n}\r\n","import {\r\n Directive,\r\n ElementRef,\r\n HostListener,\r\n OnInit,\r\n} from '@angular/core';\r\n\r\n@Directive({\r\n selector: '[appBoxRow]',\r\n})\r\nexport class BoxRowDirective implements OnInit {\r\n el: HTMLElement = null;\r\n formEls: Element[];\r\n\r\n constructor(private elRef: ElementRef) {\r\n this.el = elRef.nativeElement;\r\n }\r\n\r\n ngOnInit(): void {\r\n this.formEls = Array.from(this.el.querySelectorAll('input:not([type=\"hidden\"]), select, textarea'));\r\n this.formEls.forEach((formEl) => {\r\n formEl.addEventListener('focus', (event: Event) => {\r\n this.el.classList.add('active');\r\n }, false);\r\n\r\n formEl.addEventListener('blur', (event: Event) => {\r\n this.el.classList.remove('active');\r\n }, false);\r\n });\r\n }\r\n\r\n @HostListener('click', ['$event']) onClick(event: Event) {\r\n if (event.target !== this.el) {\r\n return;\r\n }\r\n\r\n if (this.formEls.length > 0) {\r\n const formEl = (this.formEls[0] as HTMLElement);\r\n if (formEl.tagName.toLowerCase() === 'input') {\r\n const inputEl = (formEl as HTMLInputElement);\r\n if (inputEl.type != null && inputEl.type.toLowerCase() === 'checkbox') {\r\n inputEl.click();\r\n return;\r\n }\r\n }\r\n formEl.focus();\r\n }\r\n }\r\n}\r\n","import {\n Component,\n EventEmitter,\n Input,\n Output,\n} from '@angular/core';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\n\nimport { SeatRequest } from 'jslib/models/request/seatRequest';\n\n@Component({\n selector: 'app-adjust-seats',\n templateUrl: 'adjust-seats.component.html',\n})\nexport class AdjustSeatsComponent {\n @Input() seatPrice = 0;\n @Input() add = true;\n @Input() organizationId: string;\n @Input() interval = 'year';\n @Output() onAdjusted = new EventEmitter();\n @Output() onCanceled = new EventEmitter();\n\n seatAdjustment = 0;\n formPromise: Promise;\n\n constructor(private apiService: ApiService, private i18nService: I18nService,\n private analytics: Angulartics2, private toasterService: ToasterService) { }\n\n async submit() {\n try {\n const request = new SeatRequest();\n request.seatAdjustment = this.seatAdjustment;\n if (!this.add) {\n request.seatAdjustment *= -1;\n }\n\n this.formPromise = this.apiService.postOrganizationSeat(this.organizationId, request);\n await this.formPromise;\n this.analytics.eventTrack.next({ action: this.add ? 'Added Seats' : 'Removed Seats' });\n this.toasterService.popAsync('success', null,\n this.i18nService.t('adjustedSeats', request.seatAdjustment.toString()));\n this.onAdjusted.emit(this.seatAdjustment);\n } catch { }\n }\n\n cancel() {\n this.onCanceled.emit();\n }\n\n get adjustedSeatTotal(): number {\n return this.seatAdjustment * this.seatAdjustment;\n }\n}\n","import { Component } from '@angular/core';\nimport { Router } from '@angular/router';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { CryptoService } from 'jslib/abstractions/crypto.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\n\nimport { PasswordVerificationRequest } from 'jslib/models/request/passwordVerificationRequest';\n\n@Component({\n selector: 'app-delete-organization',\n templateUrl: 'delete-organization.component.html',\n})\nexport class DeleteOrganizationComponent {\n organizationId: string;\n\n masterPassword: string;\n formPromise: Promise;\n\n constructor(private apiService: ApiService, private i18nService: I18nService,\n private analytics: Angulartics2, private toasterService: ToasterService,\n private cryptoService: CryptoService, private router: Router) { }\n\n async submit() {\n if (this.masterPassword == null || this.masterPassword === '') {\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'),\n this.i18nService.t('masterPassRequired'));\n return;\n }\n\n const request = new PasswordVerificationRequest();\n request.masterPasswordHash = await this.cryptoService.hashPassword(this.masterPassword, null);\n try {\n this.formPromise = this.apiService.deleteOrganization(this.organizationId, request);\n await this.formPromise;\n this.analytics.eventTrack.next({ action: 'Deleted Organization' });\n this.toasterService.popAsync('success', this.i18nService.t('organizationDeleted'),\n this.i18nService.t('organizationDeletedDesc'));\n this.router.navigate(['/']);\n } catch { }\n }\n}\n","import {\n Component,\n EventEmitter,\n Input,\n OnInit,\n Output,\n} from '@angular/core';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\n\nimport { OrganizationUserUpdateGroupsRequest } from 'jslib/models/request/organizationUserUpdateGroupsRequest';\nimport { GroupResponse } from 'jslib/models/response/groupResponse';\n\nimport { Utils } from 'jslib/misc/utils';\n\n@Component({\n selector: 'app-user-groups',\n templateUrl: 'user-groups.component.html',\n})\nexport class UserGroupsComponent implements OnInit {\n @Input() name: string;\n @Input() organizationUserId: string;\n @Input() organizationId: string;\n @Output() onSavedUser = new EventEmitter();\n\n loading = true;\n groups: GroupResponse[] = [];\n formPromise: Promise;\n\n constructor(private apiService: ApiService, private i18nService: I18nService,\n private analytics: Angulartics2, private toasterService: ToasterService) { }\n\n async ngOnInit() {\n const groupsResponse = await this.apiService.getGroups(this.organizationId);\n const groups = groupsResponse.data.map((r) => r);\n groups.sort(Utils.getSortFunction(this.i18nService, 'name'));\n this.groups = groups;\n\n try {\n const userGroups = await this.apiService.getOrganizationUserGroups(\n this.organizationId, this.organizationUserId);\n if (userGroups != null && this.groups != null) {\n userGroups.forEach((ug) => {\n const group = this.groups.filter((g) => g.id === ug);\n if (group != null && group.length > 0) {\n (group[0] as any).checked = true;\n }\n });\n }\n } catch { }\n\n this.loading = false;\n }\n\n check(g: GroupResponse, select?: boolean) {\n (g as any).checked = select == null ? !(g as any).checked : select;\n if (!(g as any).checked) {\n (g as any).readOnly = false;\n }\n }\n\n selectAll(select: boolean) {\n this.groups.forEach((g) => this.check(g, select));\n }\n\n async submit() {\n const request = new OrganizationUserUpdateGroupsRequest();\n request.groupIds = this.groups.filter((g) => (g as any).checked).map((g) => g.id);\n\n try {\n this.formPromise = this.apiService.putOrganizationUserGroups(this.organizationId, this.organizationUserId,\n request);\n await this.formPromise;\n this.analytics.eventTrack.next({ action: 'Edited User Groups' });\n this.toasterService.popAsync('success', null, this.i18nService.t('editedGroupsForUser', this.name));\n this.onSavedUser.emit();\n } catch { }\n }\n}\n","import {\r\n Component,\r\n EventEmitter,\r\n Input,\r\n OnInit,\r\n Output,\r\n} from '@angular/core';\r\n\r\nimport { ToasterService } from 'angular2-toaster';\r\nimport { Angulartics2 } from 'angulartics2';\r\n\r\nimport { ApiService } from 'jslib/abstractions/api.service';\r\nimport { CollectionService } from 'jslib/abstractions/collection.service';\r\nimport { I18nService } from 'jslib/abstractions/i18n.service';\r\nimport { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';\r\n\r\nimport { CollectionData } from 'jslib/models/data/collectionData';\r\nimport { Collection } from 'jslib/models/domain/collection';\r\nimport { OrganizationUserInviteRequest } from 'jslib/models/request/organizationUserInviteRequest';\r\nimport { OrganizationUserUpdateRequest } from 'jslib/models/request/organizationUserUpdateRequest';\r\nimport { SelectionReadOnlyRequest } from 'jslib/models/request/selectionReadOnlyRequest';\r\nimport { CollectionDetailsResponse } from 'jslib/models/response/collectionResponse';\r\nimport { CollectionView } from 'jslib/models/view/collectionView';\r\n\r\nimport { OrganizationUserType } from 'jslib/enums/organizationUserType';\r\n\r\n@Component({\r\n selector: 'app-user-add-edit',\r\n templateUrl: 'user-add-edit.component.html',\r\n})\r\nexport class UserAddEditComponent implements OnInit {\r\n @Input() name: string;\r\n @Input() organizationUserId: string;\r\n @Input() organizationId: string;\r\n @Output() onSavedUser = new EventEmitter();\r\n @Output() onDeletedUser = new EventEmitter();\r\n\r\n loading = true;\r\n editMode: boolean = false;\r\n title: string;\r\n emails: string;\r\n type: OrganizationUserType = OrganizationUserType.User;\r\n access: 'all' | 'selected' = 'selected';\r\n collections: CollectionView[] = [];\r\n formPromise: Promise;\r\n deletePromise: Promise;\r\n organizationUserType = OrganizationUserType;\r\n\r\n constructor(private apiService: ApiService, private i18nService: I18nService,\r\n private analytics: Angulartics2, private toasterService: ToasterService,\r\n private collectionService: CollectionService, private platformUtilsService: PlatformUtilsService) { }\r\n\r\n async ngOnInit() {\r\n this.editMode = this.loading = this.organizationUserId != null;\r\n await this.loadCollections();\r\n\r\n if (this.editMode) {\r\n this.editMode = true;\r\n this.title = this.i18nService.t('editUser');\r\n try {\r\n const user = await this.apiService.getOrganizationUser(this.organizationId, this.organizationUserId);\r\n this.access = user.accessAll ? 'all' : 'selected';\r\n this.type = user.type;\r\n if (user.collections != null && this.collections != null) {\r\n user.collections.forEach((s) => {\r\n const collection = this.collections.filter((c) => c.id === s.id);\r\n if (collection != null && collection.length > 0) {\r\n (collection[0] as any).checked = true;\r\n collection[0].readOnly = s.readOnly;\r\n }\r\n });\r\n }\r\n } catch { }\r\n } else {\r\n this.title = this.i18nService.t('inviteUser');\r\n }\r\n\r\n this.loading = false;\r\n }\r\n\r\n async loadCollections() {\r\n const response = await this.apiService.getCollections(this.organizationId);\r\n const collections = response.data.map((r) =>\r\n new Collection(new CollectionData(r as CollectionDetailsResponse)));\r\n this.collections = await this.collectionService.decryptMany(collections);\r\n }\r\n\r\n check(c: CollectionView, select?: boolean) {\r\n (c as any).checked = select == null ? !(c as any).checked : select;\r\n if (!(c as any).checked) {\r\n c.readOnly = false;\r\n }\r\n }\r\n\r\n selectAll(select: boolean) {\r\n this.collections.forEach((c) => this.check(c, select));\r\n }\r\n\r\n async submit() {\r\n let collections: SelectionReadOnlyRequest[] = null;\r\n if (this.access !== 'all') {\r\n collections = this.collections.filter((c) => (c as any).checked)\r\n .map((c) => new SelectionReadOnlyRequest(c.id, !!c.readOnly));\r\n }\r\n\r\n try {\r\n if (this.editMode) {\r\n const request = new OrganizationUserUpdateRequest();\r\n request.accessAll = this.access === 'all';\r\n request.type = this.type;\r\n request.collections = collections;\r\n this.formPromise = this.apiService.putOrganizationUser(this.organizationId, this.organizationUserId,\r\n request);\r\n } else {\r\n const request = new OrganizationUserInviteRequest();\r\n request.emails = this.emails.trim().split(/\\s*,\\s*/);\r\n request.accessAll = this.access === 'all';\r\n request.type = this.type;\r\n request.collections = collections;\r\n this.formPromise = this.apiService.postOrganizationUserInvite(this.organizationId, request);\r\n }\r\n await this.formPromise;\r\n this.analytics.eventTrack.next({ action: this.editMode ? 'Edited User' : 'Invited User' });\r\n this.toasterService.popAsync('success', null,\r\n this.i18nService.t(this.editMode ? 'editedUserId' : 'invitedUsers', this.name));\r\n this.onSavedUser.emit();\r\n } catch { }\r\n }\r\n\r\n async delete() {\r\n if (!this.editMode) {\r\n return;\r\n }\r\n\r\n const confirmed = await this.platformUtilsService.showDialog(\r\n this.i18nService.t('removeUserConfirmation'), this.name,\r\n this.i18nService.t('yes'), this.i18nService.t('no'), 'warning');\r\n if (!confirmed) {\r\n return false;\r\n }\r\n\r\n try {\r\n this.deletePromise = this.apiService.deleteOrganizationUser(this.organizationId, this.organizationUserId);\r\n await this.deletePromise;\r\n this.analytics.eventTrack.next({ action: 'Deleted User' });\r\n this.toasterService.popAsync('success', null, this.i18nService.t('removedUserId', this.name));\r\n this.onDeletedUser.emit();\r\n } catch { }\r\n }\r\n}\r\n","import {\r\n Component,\r\n EventEmitter,\r\n Input,\r\n OnInit,\r\n Output,\r\n} from '@angular/core';\r\n\r\nimport { ToasterService } from 'angular2-toaster';\r\nimport { Angulartics2 } from 'angulartics2';\r\n\r\nimport { ApiService } from 'jslib/abstractions/api.service';\r\nimport { CollectionService } from 'jslib/abstractions/collection.service';\r\nimport { I18nService } from 'jslib/abstractions/i18n.service';\r\nimport { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';\r\n\r\nimport { CollectionData } from 'jslib/models/data/collectionData';\r\nimport { Collection } from 'jslib/models/domain/collection';\r\nimport { GroupRequest } from 'jslib/models/request/groupRequest';\r\nimport { SelectionReadOnlyRequest } from 'jslib/models/request/selectionReadOnlyRequest';\r\nimport { CollectionDetailsResponse } from 'jslib/models/response/collectionResponse';\r\nimport { CollectionView } from 'jslib/models/view/collectionView';\r\n\r\n@Component({\r\n selector: 'app-group-add-edit',\r\n templateUrl: 'group-add-edit.component.html',\r\n})\r\nexport class GroupAddEditComponent implements OnInit {\r\n @Input() groupId: string;\r\n @Input() organizationId: string;\r\n @Output() onSavedGroup = new EventEmitter();\r\n @Output() onDeletedGroup = new EventEmitter();\r\n\r\n loading = true;\r\n editMode: boolean = false;\r\n title: string;\r\n name: string;\r\n externalId: string;\r\n access: 'all' | 'selected' = 'selected';\r\n collections: CollectionView[] = [];\r\n formPromise: Promise;\r\n deletePromise: Promise;\r\n\r\n constructor(private apiService: ApiService, private i18nService: I18nService,\r\n private analytics: Angulartics2, private toasterService: ToasterService,\r\n private collectionService: CollectionService, private platformUtilsService: PlatformUtilsService) { }\r\n\r\n async ngOnInit() {\r\n this.editMode = this.loading = this.groupId != null;\r\n await this.loadCollections();\r\n\r\n if (this.editMode) {\r\n this.editMode = true;\r\n this.title = this.i18nService.t('editGroup');\r\n try {\r\n const group = await this.apiService.getGroupDetails(this.organizationId, this.groupId);\r\n this.access = group.accessAll ? 'all' : 'selected';\r\n this.name = group.name;\r\n this.externalId = group.externalId;\r\n if (group.collections != null && this.collections != null) {\r\n group.collections.forEach((s) => {\r\n const collection = this.collections.filter((c) => c.id === s.id);\r\n if (collection != null && collection.length > 0) {\r\n (collection[0] as any).checked = true;\r\n collection[0].readOnly = s.readOnly;\r\n }\r\n });\r\n }\r\n } catch { }\r\n } else {\r\n this.title = this.i18nService.t('addGroup');\r\n }\r\n\r\n this.loading = false;\r\n }\r\n\r\n async loadCollections() {\r\n const response = await this.apiService.getCollections(this.organizationId);\r\n const collections = response.data.map((r) =>\r\n new Collection(new CollectionData(r as CollectionDetailsResponse)));\r\n this.collections = await this.collectionService.decryptMany(collections);\r\n }\r\n\r\n check(c: CollectionView, select?: boolean) {\r\n (c as any).checked = select == null ? !(c as any).checked : select;\r\n if (!(c as any).checked) {\r\n c.readOnly = false;\r\n }\r\n }\r\n\r\n selectAll(select: boolean) {\r\n this.collections.forEach((c) => this.check(c, select));\r\n }\r\n\r\n async submit() {\r\n const request = new GroupRequest();\r\n request.name = this.name;\r\n request.externalId = this.externalId;\r\n request.accessAll = this.access === 'all';\r\n if (!request.accessAll) {\r\n request.collections = this.collections.filter((c) => (c as any).checked)\r\n .map((c) => new SelectionReadOnlyRequest(c.id, !!c.readOnly));\r\n }\r\n\r\n try {\r\n if (this.editMode) {\r\n this.formPromise = this.apiService.putGroup(this.organizationId, this.groupId, request);\r\n } else {\r\n this.formPromise = this.apiService.postGroup(this.organizationId, request);\r\n }\r\n await this.formPromise;\r\n this.analytics.eventTrack.next({ action: this.editMode ? 'Edited Group' : 'Created Group' });\r\n this.toasterService.popAsync('success', null,\r\n this.i18nService.t(this.editMode ? 'editedGroupId' : 'createdGroupId', this.name));\r\n this.onSavedGroup.emit();\r\n } catch { }\r\n }\r\n\r\n async delete() {\r\n if (!this.editMode) {\r\n return;\r\n }\r\n\r\n const confirmed = await this.platformUtilsService.showDialog(\r\n this.i18nService.t('deleteGroupConfirmation'), this.name,\r\n this.i18nService.t('yes'), this.i18nService.t('no'), 'warning');\r\n if (!confirmed) {\r\n return false;\r\n }\r\n\r\n try {\r\n this.deletePromise = this.apiService.deleteGroup(this.organizationId, this.groupId);\r\n await this.deletePromise;\r\n this.analytics.eventTrack.next({ action: 'Deleted Group' });\r\n this.toasterService.popAsync('success', null, this.i18nService.t('deletedGroupId', this.name));\r\n this.onDeletedGroup.emit();\r\n } catch { }\r\n }\r\n}\r\n","import {\n Component,\n EventEmitter,\n Input,\n OnInit,\n Output,\n} from '@angular/core';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { CryptoService } from 'jslib/abstractions/crypto.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\nimport { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';\n\nimport { CipherString } from 'jslib/models/domain/cipherString';\nimport { SymmetricCryptoKey } from 'jslib/models/domain/symmetricCryptoKey';\nimport { CollectionRequest } from 'jslib/models/request/collectionRequest';\nimport { SelectionReadOnlyRequest } from 'jslib/models/request/selectionReadOnlyRequest';\nimport { GroupResponse } from 'jslib/models/response/groupResponse';\n\nimport { Utils } from 'jslib/misc/utils';\n\n@Component({\n selector: 'app-collection-add-edit',\n templateUrl: 'collection-add-edit.component.html',\n})\nexport class CollectionAddEditComponent implements OnInit {\n @Input() collectionId: string;\n @Input() organizationId: string;\n @Output() onSavedCollection = new EventEmitter();\n @Output() onDeletedCollection = new EventEmitter();\n\n loading = true;\n editMode: boolean = false;\n title: string;\n name: string;\n groups: GroupResponse[] = [];\n formPromise: Promise;\n deletePromise: Promise;\n\n private orgKey: SymmetricCryptoKey;\n\n constructor(private apiService: ApiService, private i18nService: I18nService,\n private analytics: Angulartics2, private toasterService: ToasterService,\n private platformUtilsService: PlatformUtilsService, private cryptoService: CryptoService) { }\n\n async ngOnInit() {\n this.editMode = this.loading = this.collectionId != null;\n const groupsResponse = await this.apiService.getGroups(this.organizationId);\n this.groups = groupsResponse.data.map((r) => r).sort(Utils.getSortFunction(this.i18nService, 'name'));\n this.orgKey = await this.cryptoService.getOrgKey(this.organizationId);\n\n if (this.editMode) {\n this.editMode = true;\n this.title = this.i18nService.t('editCollection');\n try {\n const collection = await this.apiService.getCollectionDetails(this.organizationId, this.collectionId);\n this.name = await this.cryptoService.decryptToUtf8(new CipherString(collection.name), this.orgKey);\n if (collection.groups != null && this.groups != null) {\n collection.groups.forEach((s) => {\n const group = this.groups.filter((g) => !g.accessAll && g.id === s.id);\n if (group != null && group.length > 0) {\n (group[0] as any).checked = true;\n (group[0] as any).readOnly = s.readOnly;\n }\n });\n }\n } catch { }\n } else {\n this.title = this.i18nService.t('addCollection');\n }\n\n this.groups.forEach((g) => {\n if (g.accessAll) {\n (g as any).checked = true;\n }\n });\n\n this.loading = false;\n }\n\n check(g: GroupResponse, select?: boolean) {\n if (g.accessAll) {\n return;\n }\n (g as any).checked = select == null ? !(g as any).checked : select;\n if (!(g as any).checked) {\n (g as any).readOnly = false;\n }\n }\n\n selectAll(select: boolean) {\n this.groups.forEach((g) => this.check(g, select));\n }\n\n async submit() {\n const request = new CollectionRequest();\n request.name = (await this.cryptoService.encrypt(this.name, this.orgKey)).encryptedString;\n request.groups = this.groups.filter((g) => (g as any).checked && !g.accessAll)\n .map((g) => new SelectionReadOnlyRequest(g.id, !!(g as any).readOnly));\n\n try {\n if (this.editMode) {\n this.formPromise = this.apiService.putCollection(this.organizationId, this.collectionId, request);\n } else {\n this.formPromise = this.apiService.postCollection(this.organizationId, request);\n }\n await this.formPromise;\n this.analytics.eventTrack.next({ action: this.editMode ? 'Edited Collection' : 'Created Collection' });\n this.toasterService.popAsync('success', null,\n this.i18nService.t(this.editMode ? 'editedCollectionId' : 'createdCollectionId', this.name));\n this.onSavedCollection.emit();\n } catch { }\n }\n\n async delete() {\n if (!this.editMode) {\n return;\n }\n\n const confirmed = await this.platformUtilsService.showDialog(\n this.i18nService.t('deleteCollectionConfirmation'), this.name,\n this.i18nService.t('yes'), this.i18nService.t('no'), 'warning');\n if (!confirmed) {\n return false;\n }\n\n try {\n this.deletePromise = this.apiService.deleteCollection(this.organizationId, this.collectionId);\n await this.deletePromise;\n this.analytics.eventTrack.next({ action: 'Deleted Collection' });\n this.toasterService.popAsync('success', null, this.i18nService.t('deletedCollectionId', this.name));\n this.onDeletedCollection.emit();\n } catch { }\n }\n}\n","import { Collection } from '../domain/collection';\n\nimport { SelectionReadOnlyRequest } from './selectionReadOnlyRequest';\n\nexport class CollectionRequest {\n name: string;\n groups: SelectionReadOnlyRequest[] = [];\n\n constructor(collection?: Collection) {\n if (collection == null) {\n return;\n }\n this.name = collection.name ? collection.name.encryptedString : null;\n }\n}\n","export class CipherCollectionsRequest {\n collectionIds: string[];\n\n constructor(collectionIds: string[]) {\n this.collectionIds = collectionIds == null ? [] : collectionIds;\n }\n}\n","import { Component } from '@angular/core';\r\n\r\nimport { ToasterService } from 'angular2-toaster';\r\nimport { Angulartics2 } from 'angulartics2';\r\n\r\nimport { ApiService } from 'jslib/abstractions/api.service';\r\nimport { CipherService } from 'jslib/abstractions/cipher.service';\r\nimport { CollectionService } from 'jslib/abstractions/collection.service';\r\nimport { I18nService } from 'jslib/abstractions/i18n.service';\r\n\r\nimport { CipherData } from 'jslib/models/data/cipherData';\r\nimport { Cipher } from 'jslib/models/domain/cipher';\r\nimport { Organization } from 'jslib/models/domain/organization';\r\nimport { CipherCollectionsRequest } from 'jslib/models/request/cipherCollectionsRequest';\r\n\r\nimport { CollectionsComponent as BaseCollectionsComponent } from '../../vault/collections.component';\r\n\r\n@Component({\r\n selector: 'app-org-vault-collections',\r\n templateUrl: '../../vault/collections.component.html',\r\n})\r\nexport class CollectionsComponent extends BaseCollectionsComponent {\r\n organization: Organization;\r\n\r\n constructor(collectionService: CollectionService, analytics: Angulartics2,\r\n toasterService: ToasterService, i18nService: I18nService,\r\n cipherService: CipherService, private apiService: ApiService) {\r\n super(collectionService, analytics, toasterService, i18nService, cipherService);\r\n }\r\n\r\n protected async loadCipher() {\r\n if (!this.organization.isAdmin) {\r\n return await super.loadCipher();\r\n }\r\n const response = await this.apiService.getCipherAdmin(this.cipherId);\r\n return new Cipher(new CipherData(response));\r\n }\r\n\r\n protected loadCipherCollections() {\r\n if (!this.organization.isAdmin) {\r\n return super.loadCipherCollections();\r\n }\r\n return this.collectionIds;\r\n }\r\n\r\n protected loadCollections() {\r\n if (!this.organization.isAdmin) {\r\n return super.loadCollections();\r\n }\r\n return Promise.resolve(this.collections);\r\n }\r\n\r\n protected saveCollections() {\r\n const request = new CipherCollectionsRequest(this.cipherDomain.collectionIds);\r\n return this.apiService.putCipherCollectionsAdmin(this.cipherId, request);\r\n }\r\n}\r\n","import { Component } from '@angular/core';\r\n\r\nimport { ToasterService } from 'angular2-toaster';\r\nimport { Angulartics2 } from 'angulartics2';\r\n\r\nimport { ApiService } from 'jslib/abstractions/api.service';\r\nimport { CipherService } from 'jslib/abstractions/cipher.service';\r\nimport { CryptoService } from 'jslib/abstractions/crypto.service';\r\nimport { I18nService } from 'jslib/abstractions/i18n.service';\r\nimport { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';\r\nimport { TokenService } from 'jslib/abstractions/token.service';\r\n\r\nimport { CipherData } from 'jslib/models/data/cipherData';\r\nimport { Cipher } from 'jslib/models/domain/cipher';\r\nimport { Organization } from 'jslib/models/domain/organization';\r\n\r\nimport { AttachmentsComponent as BaseAttachmentsComponent } from '../../vault/attachments.component';\r\n\r\n@Component({\r\n selector: 'app-org-vault-attachments',\r\n templateUrl: '../../vault/attachments.component.html',\r\n})\r\nexport class AttachmentsComponent extends BaseAttachmentsComponent {\r\n organization: Organization;\r\n\r\n constructor(cipherService: CipherService, analytics: Angulartics2,\r\n toasterService: ToasterService, i18nService: I18nService,\r\n cryptoService: CryptoService, tokenService: TokenService,\r\n platformUtilsService: PlatformUtilsService, private apiService: ApiService) {\r\n super(cipherService, analytics, toasterService, i18nService, cryptoService, tokenService,\r\n platformUtilsService);\r\n }\r\n\r\n protected async loadCipher() {\r\n if (!this.organization.isAdmin) {\r\n return await super.loadCipher();\r\n }\r\n const response = await this.apiService.getCipherAdmin(this.cipherId);\r\n return new Cipher(new CipherData(response));\r\n }\r\n\r\n protected saveCipherAttachment(file: File) {\r\n return this.cipherService.saveAttachmentWithServer(this.cipherDomain, file, this.organization.isAdmin);\r\n }\r\n\r\n protected deleteCipherAttachment(attachmentId: string) {\r\n if (!this.organization.isAdmin) {\r\n return super.deleteCipherAttachment(attachmentId);\r\n }\r\n return this.apiService.deleteCipherAttachmentAdmin(this.cipherId, attachmentId);\r\n }\r\n}\r\n","import {\n Component,\n OnInit,\n} from '@angular/core';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { AuditService } from 'jslib/abstractions/audit.service';\nimport { CipherService } from 'jslib/abstractions/cipher.service';\nimport { FolderService } from 'jslib/abstractions/folder.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\nimport { MessagingService } from 'jslib/abstractions/messaging.service';\nimport { PasswordGenerationService } from 'jslib/abstractions/passwordGeneration.service';\nimport { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';\nimport { StateService } from 'jslib/abstractions/state.service';\nimport { TokenService } from 'jslib/abstractions/token.service';\nimport { TotpService } from 'jslib/abstractions/totp.service';\n\nimport { CipherData } from 'jslib/models/data/cipherData';\nimport { Cipher } from 'jslib/models/domain/cipher';\nimport { Organization } from 'jslib/models/domain/organization';\nimport { CipherRequest } from 'jslib/models/request/cipherRequest';\n\nimport { AddEditComponent as BaseAddEditComponent } from '../../vault/add-edit.component';\n\n@Component({\n selector: 'app-org-vault-add-edit',\n templateUrl: '../../vault/add-edit.component.html',\n})\nexport class AddEditComponent extends BaseAddEditComponent implements OnInit {\n organization: Organization;\n\n constructor(cipherService: CipherService, folderService: FolderService,\n i18nService: I18nService, platformUtilsService: PlatformUtilsService,\n analytics: Angulartics2, toasterService: ToasterService,\n auditService: AuditService, stateService: StateService,\n tokenService: TokenService, totpService: TotpService,\n passwordGenerationService: PasswordGenerationService, private apiService: ApiService,\n messagingService: MessagingService) {\n super(cipherService, folderService, i18nService, platformUtilsService, analytics,\n toasterService, auditService, stateService, tokenService, totpService, passwordGenerationService,\n messagingService);\n }\n\n protected async loadCipher() {\n if (!this.organization.isAdmin) {\n return await super.loadCipher();\n }\n const response = await this.apiService.getCipherAdmin(this.cipherId);\n return new Cipher(new CipherData(response));\n }\n\n protected encryptCipher() {\n if (!this.editMode) {\n this.cipher.organizationId = this.organization.id;\n }\n return super.encryptCipher();\n }\n\n protected async saveCipher(cipher: Cipher) {\n if (!this.organization.isAdmin) {\n return super.saveCipher(cipher);\n }\n const request = new CipherRequest(cipher);\n if (this.editMode) {\n return this.apiService.putCipherAdmin(this.cipherId, request);\n } else {\n return this.apiService.postCipherAdmin(request);\n }\n }\n\n protected async deleteCipher() {\n if (!this.organization.isAdmin) {\n return super.deleteCipher();\n }\n return this.apiService.deleteCipherAdmin(this.cipherId);\n }\n}\n","import { SecureNoteType } from '../../enums/secureNoteType';\n\nimport { SecureNoteData } from '../data/secureNoteData';\n\nimport Domain from './domain';\n\nimport { SecureNoteView } from '../view/secureNoteView';\n\nexport class SecureNote extends Domain {\n type: SecureNoteType;\n\n constructor(obj?: SecureNoteData, alreadyEncrypted: boolean = false) {\n super();\n if (obj == null) {\n return;\n }\n\n this.type = obj.type;\n }\n\n decrypt(orgId: string): Promise {\n return Promise.resolve(new SecureNoteView(this));\n }\n\n toSecureNoteData(): SecureNoteData {\n const n = new SecureNoteData();\n n.type = this.type;\n return n;\n }\n}\n","import { UriMatchType } from '../../enums/uriMatchType';\n\nimport { LoginUriData } from '../data/loginUriData';\n\nimport { LoginUriView } from '../view/loginUriView';\n\nimport { CipherString } from './cipherString';\nimport Domain from './domain';\n\nexport class LoginUri extends Domain {\n uri: CipherString;\n match: UriMatchType;\n\n constructor(obj?: LoginUriData, alreadyEncrypted: boolean = false) {\n super();\n if (obj == null) {\n return;\n }\n\n this.match = obj.match;\n this.buildDomainModel(this, obj, {\n uri: null,\n }, alreadyEncrypted, []);\n }\n\n decrypt(orgId: string): Promise {\n return this.decryptObj(new LoginUriView(this), {\n uri: null,\n }, orgId);\n }\n\n toLoginUriData(): LoginUriData {\n const u = new LoginUriData();\n this.buildDataModel(this, u, {\n uri: null,\n }, ['match']);\n return u;\n }\n}\n","import { LoginUri } from './loginUri';\n\nimport { LoginData } from '../data/loginData';\n\nimport { LoginUriView } from '../view/loginUriView';\nimport { LoginView } from '../view/loginView';\n\nimport { CipherString } from './cipherString';\nimport Domain from './domain';\n\nexport class Login extends Domain {\n uris: LoginUri[];\n username: CipherString;\n password: CipherString;\n totp: CipherString;\n\n constructor(obj?: LoginData, alreadyEncrypted: boolean = false) {\n super();\n if (obj == null) {\n return;\n }\n\n this.buildDomainModel(this, obj, {\n username: null,\n password: null,\n totp: null,\n }, alreadyEncrypted, []);\n\n if (obj.uris) {\n this.uris = [];\n obj.uris.forEach((u) => {\n this.uris.push(new LoginUri(u, alreadyEncrypted));\n });\n }\n }\n\n async decrypt(orgId: string): Promise {\n const view = await this.decryptObj(new LoginView(this), {\n username: null,\n password: null,\n totp: null,\n }, orgId);\n\n if (this.uris != null) {\n view.uris = [];\n for (let i = 0; i < this.uris.length; i++) {\n const uri = await this.uris[i].decrypt(orgId);\n view.uris.push(uri);\n }\n }\n\n return view;\n }\n\n toLoginData(): LoginData {\n const l = new LoginData();\n this.buildDataModel(this, l, {\n username: null,\n password: null,\n totp: null,\n });\n\n if (this.uris != null && this.uris.length > 0) {\n l.uris = [];\n this.uris.forEach((u) => {\n l.uris.push(u.toLoginUriData());\n });\n }\n\n return l;\n }\n}\n","import { IdentityData } from '../data/identityData';\n\nimport { CipherString } from './cipherString';\nimport Domain from './domain';\n\nimport { IdentityView } from '../view/identityView';\n\nexport class Identity extends Domain {\n title: CipherString;\n firstName: CipherString;\n middleName: CipherString;\n lastName: CipherString;\n address1: CipherString;\n address2: CipherString;\n address3: CipherString;\n city: CipherString;\n state: CipherString;\n postalCode: CipherString;\n country: CipherString;\n company: CipherString;\n email: CipherString;\n phone: CipherString;\n ssn: CipherString;\n username: CipherString;\n passportNumber: CipherString;\n licenseNumber: CipherString;\n\n constructor(obj?: IdentityData, alreadyEncrypted: boolean = false) {\n super();\n if (obj == null) {\n return;\n }\n\n this.buildDomainModel(this, obj, {\n title: null,\n firstName: null,\n middleName: null,\n lastName: null,\n address1: null,\n address2: null,\n address3: null,\n city: null,\n state: null,\n postalCode: null,\n country: null,\n company: null,\n email: null,\n phone: null,\n ssn: null,\n username: null,\n passportNumber: null,\n licenseNumber: null,\n }, alreadyEncrypted, []);\n }\n\n decrypt(orgId: string): Promise {\n return this.decryptObj(new IdentityView(this), {\n title: null,\n firstName: null,\n middleName: null,\n lastName: null,\n address1: null,\n address2: null,\n address3: null,\n city: null,\n state: null,\n postalCode: null,\n country: null,\n company: null,\n email: null,\n phone: null,\n ssn: null,\n username: null,\n passportNumber: null,\n licenseNumber: null,\n }, orgId);\n }\n\n toIdentityData(): IdentityData {\n const i = new IdentityData();\n this.buildDataModel(this, i, {\n title: null,\n firstName: null,\n middleName: null,\n lastName: null,\n address1: null,\n address2: null,\n address3: null,\n city: null,\n state: null,\n postalCode: null,\n country: null,\n company: null,\n email: null,\n phone: null,\n ssn: null,\n username: null,\n passportNumber: null,\n licenseNumber: null,\n });\n return i;\n }\n}\n","import { FieldType } from '../../enums/fieldType';\n\nimport { FieldData } from '../data/fieldData';\n\nimport { CipherString } from './cipherString';\nimport Domain from './domain';\n\nimport { FieldView } from '../view/fieldView';\n\nexport class Field extends Domain {\n name: CipherString;\n value: CipherString;\n type: FieldType;\n\n constructor(obj?: FieldData, alreadyEncrypted: boolean = false) {\n super();\n if (obj == null) {\n return;\n }\n\n this.type = obj.type;\n this.buildDomainModel(this, obj, {\n name: null,\n value: null,\n }, alreadyEncrypted, []);\n }\n\n decrypt(orgId: string): Promise {\n return this.decryptObj(new FieldView(this), {\n name: null,\n value: null,\n }, orgId);\n }\n\n toFieldData(): FieldData {\n const f = new FieldData();\n this.buildDataModel(this, f, {\n name: null,\n value: null,\n type: null,\n }, ['type']);\n return f;\n }\n}\n","import { CardData } from '../data/cardData';\n\nimport { CipherString } from './cipherString';\nimport Domain from './domain';\n\nimport { CardView } from '../view/cardView';\n\nexport class Card extends Domain {\n cardholderName: CipherString;\n brand: CipherString;\n number: CipherString;\n expMonth: CipherString;\n expYear: CipherString;\n code: CipherString;\n\n constructor(obj?: CardData, alreadyEncrypted: boolean = false) {\n super();\n if (obj == null) {\n return;\n }\n\n this.buildDomainModel(this, obj, {\n cardholderName: null,\n brand: null,\n number: null,\n expMonth: null,\n expYear: null,\n code: null,\n }, alreadyEncrypted, []);\n }\n\n decrypt(orgId: string): Promise {\n return this.decryptObj(new CardView(this), {\n cardholderName: null,\n brand: null,\n number: null,\n expMonth: null,\n expYear: null,\n code: null,\n }, orgId);\n }\n\n toCardData(): CardData {\n const c = new CardData();\n this.buildDataModel(this, c, {\n cardholderName: null,\n brand: null,\n number: null,\n expMonth: null,\n expYear: null,\n code: null,\n });\n return c;\n }\n}\n","import { AttachmentData } from '../data/attachmentData';\n\nimport { CipherString } from './cipherString';\nimport Domain from './domain';\n\nimport { AttachmentView } from '../view/attachmentView';\n\nexport class Attachment extends Domain {\n id: string;\n url: string;\n size: number;\n sizeName: string;\n fileName: CipherString;\n\n constructor(obj?: AttachmentData, alreadyEncrypted: boolean = false) {\n super();\n if (obj == null) {\n return;\n }\n\n this.size = obj.size;\n this.buildDomainModel(this, obj, {\n id: null,\n url: null,\n sizeName: null,\n fileName: null,\n }, alreadyEncrypted, ['id', 'url', 'sizeName']);\n }\n\n decrypt(orgId: string): Promise {\n return this.decryptObj(new AttachmentView(this), {\n fileName: null,\n }, orgId);\n }\n\n toAttachmentData(): AttachmentData {\n const a = new AttachmentData();\n this.buildDataModel(this, a, {\n id: null,\n url: null,\n sizeName: null,\n fileName: null,\n }, ['id', 'url', 'sizeName']);\n return a;\n }\n}\n","import { SecureNoteType } from '../../enums/secureNoteType';\n\nimport { SecureNoteApi } from '../api/secureNoteApi';\n\nexport class SecureNoteData {\n type: SecureNoteType;\n\n constructor(data?: SecureNoteApi) {\n if (data == null) {\n return;\n }\n\n this.type = data.type;\n }\n}\n","import { UriMatchType } from '../../enums/uriMatchType';\n\nimport { LoginUriApi } from '../api/loginUriApi';\n\nexport class LoginUriData {\n uri: string;\n match: UriMatchType = null;\n\n constructor(data?: LoginUriApi) {\n if (data == null) {\n return;\n }\n this.uri = data.uri;\n this.match = data.match;\n }\n}\n","import { LoginApi } from '../api/loginApi';\nimport { LoginUriApi } from '../api/loginUriApi';\n\nimport { LoginUriData } from './loginUriData';\n\nexport class LoginData {\n uris: LoginUriData[];\n username: string;\n password: string;\n totp: string;\n\n constructor(data?: LoginApi) {\n if (data == null) {\n return;\n }\n\n this.username = data.username;\n this.password = data.password;\n this.totp = data.totp;\n\n if (data.uris) {\n this.uris = [];\n data.uris.forEach((u) => {\n this.uris.push(new LoginUriData(u));\n });\n }\n }\n}\n","import { IdentityApi } from '../api/identityApi';\n\nexport class IdentityData {\n title: string;\n firstName: string;\n middleName: string;\n lastName: string;\n address1: string;\n address2: string;\n address3: string;\n city: string;\n state: string;\n postalCode: string;\n country: string;\n company: string;\n email: string;\n phone: string;\n ssn: string;\n username: string;\n passportNumber: string;\n licenseNumber: string;\n\n constructor(data?: IdentityApi) {\n if (data == null) {\n return;\n }\n\n this.title = data.title;\n this.firstName = data.firstName;\n this.middleName = data.middleName;\n this.lastName = data.lastName;\n this.address1 = data.address1;\n this.address2 = data.address2;\n this.address3 = data.address3;\n this.city = data.city;\n this.state = data.state;\n this.postalCode = data.postalCode;\n this.country = data.country;\n this.company = data.company;\n this.email = data.email;\n this.phone = data.phone;\n this.ssn = data.ssn;\n this.username = data.username;\n this.passportNumber = data.passportNumber;\n this.licenseNumber = data.licenseNumber;\n }\n}\n","import { FieldType } from '../../enums/fieldType';\n\nimport { FieldApi } from '../api/fieldApi';\n\nexport class FieldData {\n type: FieldType;\n name: string;\n value: string;\n\n constructor(response?: FieldApi) {\n if (response == null) {\n return;\n }\n this.type = response.type;\n this.name = response.name;\n this.value = response.value;\n }\n}\n","import { CardApi } from '../api/cardApi';\n\nexport class CardData {\n cardholderName: string;\n brand: string;\n number: string;\n expMonth: string;\n expYear: string;\n code: string;\n\n constructor(data?: CardApi) {\n if (data == null) {\n return;\n }\n\n this.cardholderName = data.cardholderName;\n this.brand = data.brand;\n this.number = data.number;\n this.expMonth = data.expMonth;\n this.expYear = data.expYear;\n this.code = data.code;\n }\n}\n","import { AttachmentResponse } from '../response/attachmentResponse';\n\nexport class AttachmentData {\n id: string;\n url: string;\n fileName: string;\n size: number;\n sizeName: string;\n\n constructor(response?: AttachmentResponse) {\n if (response == null) {\n return;\n }\n this.id = response.id;\n this.url = response.url;\n this.fileName = response.fileName;\n this.size = response.size;\n this.sizeName = response.sizeName;\n }\n}\n","import { ToasterService } from 'angular2-toaster';\r\nimport { Angulartics2 } from 'angulartics2';\r\n\r\nimport { Component } from '@angular/core';\r\n\r\nimport { I18nService } from 'jslib/abstractions/i18n.service';\r\nimport { PasswordGenerationService } from 'jslib/abstractions/passwordGeneration.service';\r\nimport { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';\r\n\r\nimport {\r\n PasswordGeneratorHistoryComponent as BasePasswordGeneratorHistoryComponent,\r\n} from 'jslib/angular/components/password-generator-history.component';\r\n\r\n@Component({\r\n selector: 'app-password-generator-history',\r\n templateUrl: 'password-generator-history.component.html',\r\n})\r\nexport class PasswordGeneratorHistoryComponent extends BasePasswordGeneratorHistoryComponent {\r\n constructor(passwordGenerationService: PasswordGenerationService, analytics: Angulartics2,\r\n platformUtilsService: PlatformUtilsService, i18nService: I18nService,\r\n toasterService: ToasterService) {\r\n super(passwordGenerationService, analytics, platformUtilsService, i18nService, toasterService, window);\r\n }\r\n}\r\n","import { View } from './view';\n\nimport { Attachment } from '../domain/attachment';\n\nexport class AttachmentView implements View {\n id: string;\n url: string;\n size: number;\n sizeName: string;\n fileName: string;\n\n constructor(a?: Attachment) {\n if (!a) {\n return;\n }\n\n this.id = a.id;\n this.url = a.url;\n this.size = a.size;\n this.sizeName = a.sizeName;\n }\n}\n","export class KvpRequest {\n key: TK;\n value: TV;\n\n constructor(key: TK, value: TV) {\n this.key = key;\n this.value = value;\n }\n}\n","export enum PlanType {\n Free = 0,\n FamiliesAnnually = 1,\n TeamsMonthly = 2,\n TeamsAnnually = 3,\n EnterpriseMonthly = 4,\n EnterpriseAnnually = 5,\n Custom = 6,\n}\n","\n

{{'contactSupportPaymentMethod' | i18n}}

\n \n {{'contactSupport' | i18n}}\n \n \n
\n
\n
\n

{{(currentType != null ? 'changePaymentMethod' : 'addPaymentMethod') | i18n}}

\n \n \n \n
\n
\n","
\n
\n

{{(add ? 'addStorage' : 'removeStorage') | i18n}}

\n
\n
\n \n \n
\n
\n
\n {{'total' | i18n}}: {{storageAdjustment || 0}} GB × {{storageGbPrice | currency:'$'}} = {{adjustedStorageTotal\n | currency:'$'}} /{{interval | i18n}}\n
\n \n \n \n {{(add ? 'storageAddNote' : 'storageRemoveNote') | i18n}}\n \n
\n
\n","
\n
\n \n \n {{'licenseFileDesc' | i18n : (!organizationId ? 'bitwarden_premium_license.json' : 'bitwarden_organization_license.json')}}\n
\n \n \n
\n","import { Component } from '@angular/core';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\nimport { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';\n\nimport { UpdateTwoFactorYubioOtpRequest } from 'jslib/models/request/updateTwoFactorYubioOtpRequest';\nimport { TwoFactorYubiKeyResponse } from 'jslib/models/response/twoFactorYubiKeyResponse';\n\nimport { TwoFactorProviderType } from 'jslib/enums/twoFactorProviderType';\n\nimport { TwoFactorBaseComponent } from './two-factor-base.component';\n\n@Component({\n selector: 'app-two-factor-yubikey',\n templateUrl: 'two-factor-yubikey.component.html',\n})\nexport class TwoFactorYubiKeyComponent extends TwoFactorBaseComponent {\n type = TwoFactorProviderType.Yubikey;\n keys: any[];\n nfc = false;\n\n formPromise: Promise;\n disablePromise: Promise;\n\n constructor(apiService: ApiService, i18nService: I18nService,\n analytics: Angulartics2, toasterService: ToasterService,\n platformUtilsService: PlatformUtilsService) {\n super(apiService, i18nService, analytics, toasterService, platformUtilsService);\n }\n\n auth(authResponse: any) {\n super.auth(authResponse);\n this.processResponse(authResponse.response);\n }\n\n submit() {\n const request = new UpdateTwoFactorYubioOtpRequest();\n request.masterPasswordHash = this.masterPasswordHash;\n request.key1 = this.keys != null && this.keys.length > 0 ? this.keys[0].key : null;\n request.key2 = this.keys != null && this.keys.length > 1 ? this.keys[1].key : null;\n request.key3 = this.keys != null && this.keys.length > 2 ? this.keys[2].key : null;\n request.key4 = this.keys != null && this.keys.length > 3 ? this.keys[3].key : null;\n request.key5 = this.keys != null && this.keys.length > 4 ? this.keys[4].key : null;\n request.nfc = this.nfc;\n\n return super.enable(async () => {\n this.formPromise = this.apiService.putTwoFactorYubiKey(request);\n const response = await this.formPromise;\n await this.processResponse(response);\n this.toasterService.popAsync('success', null, this.i18nService.t('yubikeysUpdated'));\n });\n }\n\n disable() {\n return super.disable(this.disablePromise);\n }\n\n remove(key: any) {\n key.existingKey = null;\n key.key = null;\n }\n\n private processResponse(response: TwoFactorYubiKeyResponse) {\n this.enabled = response.enabled;\n this.keys = [\n { key: response.key1, existingKey: this.padRight(response.key1) },\n { key: response.key2, existingKey: this.padRight(response.key2) },\n { key: response.key3, existingKey: this.padRight(response.key3) },\n { key: response.key4, existingKey: this.padRight(response.key4) },\n { key: response.key5, existingKey: this.padRight(response.key5) },\n ];\n this.nfc = response.nfc || !response.enabled;\n }\n\n private padRight(str: string, character = '•', size = 44) {\n if (str == null || character == null || str.length >= size) {\n return str;\n }\n const max = (size - str.length) / character.length;\n for (let i = 0; i < max; i++) {\n str += character;\n }\n return str;\n }\n}\n","import {\n Component,\n OnDestroy,\n OnInit,\n} from '@angular/core';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\nimport { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';\n\nimport { TwoFactorProviderType } from 'jslib/enums/twoFactorProviderType';\nimport { UpdateTwoFactorU2fRequest } from 'jslib/models/request/updateTwoFactorU2fRequest';\nimport {\n ChallengeResponse,\n TwoFactorU2fResponse,\n} from 'jslib/models/response/twoFactorU2fResponse';\n\nimport { TwoFactorBaseComponent } from './two-factor-base.component';\n\n@Component({\n selector: 'app-two-factor-u2f',\n templateUrl: 'two-factor-u2f.component.html',\n})\nexport class TwoFactorU2fComponent extends TwoFactorBaseComponent implements OnInit, OnDestroy {\n type = TwoFactorProviderType.U2f;\n u2fChallenge: ChallengeResponse;\n u2fError: boolean;\n u2fListening: boolean;\n u2fResponse: string;\n formPromise: Promise;\n\n private closed = false;\n private u2fScript: HTMLScriptElement;\n\n constructor(apiService: ApiService, i18nService: I18nService,\n analytics: Angulartics2, toasterService: ToasterService,\n platformUtilsService: PlatformUtilsService) {\n super(apiService, i18nService, analytics, toasterService, platformUtilsService);\n this.u2fScript = window.document.createElement('script');\n this.u2fScript.src = 'scripts/u2f.js';\n this.u2fScript.async = true;\n }\n\n ngOnInit() {\n window.document.body.appendChild(this.u2fScript);\n }\n\n ngOnDestroy() {\n this.closed = true;\n window.document.body.removeChild(this.u2fScript);\n }\n\n auth(authResponse: any) {\n super.auth(authResponse);\n this.processResponse(authResponse.response);\n this.readDevice();\n }\n\n submit() {\n if (this.enabled) {\n return super.disable(this.formPromise);\n } else {\n return this.enable();\n }\n }\n\n protected enable() {\n const request = new UpdateTwoFactorU2fRequest();\n request.masterPasswordHash = this.masterPasswordHash;\n request.deviceResponse = this.u2fResponse;\n\n return super.enable(async () => {\n this.formPromise = this.apiService.putTwoFactorU2f(request);\n const response = await this.formPromise;\n await this.processResponse(response);\n });\n }\n\n private readDevice() {\n if (this.closed || this.enabled) {\n return;\n }\n\n // tslint:disable-next-line\n console.log('listening for key...');\n\n this.u2fResponse = null;\n this.u2fError = false;\n this.u2fListening = true;\n\n (window as any).u2f.register(this.u2fChallenge.appId, [{\n version: this.u2fChallenge.version,\n challenge: this.u2fChallenge.challenge,\n }], [], (data: any) => {\n this.u2fListening = false;\n if (data.errorCode === 5) {\n this.readDevice();\n return;\n } else if (data.errorCode) {\n this.u2fError = true;\n // tslint:disable-next-line\n console.log('error: ' + data.errorCode);\n return;\n }\n this.u2fResponse = JSON.stringify(data);\n }, 10);\n }\n\n private processResponse(response: TwoFactorU2fResponse) {\n this.u2fChallenge = response.challenge;\n this.enabled = response.enabled;\n }\n}\n","import { Component } from '@angular/core';\n\nimport { I18nService } from 'jslib/abstractions/i18n.service';\n\nimport { TwoFactorRecoverResponse } from 'jslib/models/response/twoFactorRescoverResponse';\n\nimport { TwoFactorProviderType } from 'jslib/enums/twoFactorProviderType';\n\n@Component({\n selector: 'app-two-factor-recovery',\n templateUrl: 'two-factor-recovery.component.html',\n})\nexport class TwoFactorRecoveryComponent {\n type = -1;\n code: string;\n authed: boolean;\n twoFactorProviderType = TwoFactorProviderType;\n\n constructor(private i18nService: I18nService) { }\n\n auth(authResponse: any) {\n this.authed = true;\n this.processResponse(authResponse.response);\n }\n\n print() {\n const w = window.open();\n w.document.write('
' +\n '

' + this.i18nService.t('twoFactorRecoveryYourCode') + ':

' +\n '' +\n this.code + '
' +\n '

' + new Date() + '

');\n w.print();\n w.close();\n }\n\n private formatString(s: string) {\n if (s == null) {\n return null;\n }\n return s.replace(/(.{4})/g, '$1 ').trim().toUpperCase();\n }\n\n private processResponse(response: TwoFactorRecoverResponse) {\n this.code = this.formatString(response.code);\n }\n}\n","import { Component } from '@angular/core';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\nimport { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';\nimport { UserService } from 'jslib/abstractions/user.service';\n\nimport { TwoFactorEmailRequest } from 'jslib/models/request/twoFactorEmailRequest';\n\nimport { TwoFactorProviderType } from 'jslib/enums/twoFactorProviderType';\nimport { UpdateTwoFactorEmailRequest } from 'jslib/models/request/updateTwoFactorEmailRequest';\nimport { TwoFactorEmailResponse } from 'jslib/models/response/twoFactorEmailResponse';\n\nimport { TwoFactorBaseComponent } from './two-factor-base.component';\n\n@Component({\n selector: 'app-two-factor-email',\n templateUrl: 'two-factor-email.component.html',\n})\nexport class TwoFactorEmailComponent extends TwoFactorBaseComponent {\n type = TwoFactorProviderType.Email;\n email: string;\n token: string;\n sentEmail: string;\n formPromise: Promise;\n emailPromise: Promise;\n\n constructor(apiService: ApiService, i18nService: I18nService,\n analytics: Angulartics2, toasterService: ToasterService,\n platformUtilsService: PlatformUtilsService, private userService: UserService) {\n super(apiService, i18nService, analytics, toasterService, platformUtilsService);\n }\n\n auth(authResponse: any) {\n super.auth(authResponse);\n return this.processResponse(authResponse.response);\n }\n\n submit() {\n if (this.enabled) {\n return super.disable(this.formPromise);\n } else {\n return this.enable();\n }\n }\n\n async sendEmail() {\n try {\n const request = new TwoFactorEmailRequest(this.email, this.masterPasswordHash);\n this.emailPromise = this.apiService.postTwoFactorEmailSetup(request);\n await this.emailPromise;\n this.sentEmail = this.email;\n } catch { }\n }\n\n protected enable() {\n const request = new UpdateTwoFactorEmailRequest();\n request.masterPasswordHash = this.masterPasswordHash;\n request.email = this.email;\n request.token = this.token;\n\n return super.enable(async () => {\n this.formPromise = this.apiService.putTwoFactorEmail(request);\n const response = await this.formPromise;\n await this.processResponse(response);\n });\n }\n\n private async processResponse(response: TwoFactorEmailResponse) {\n this.token = null;\n this.email = response.email;\n this.enabled = response.enabled;\n if (!this.enabled && (this.email == null || this.email === '')) {\n this.email = await this.userService.getEmail();\n }\n }\n}\n","import {\n Component,\n OnDestroy,\n OnInit,\n} from '@angular/core';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\nimport { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';\nimport { UserService } from 'jslib/abstractions/user.service';\n\nimport { UpdateTwoFactorAuthenticatorRequest } from 'jslib/models/request/updateTwoFactorAuthenticatorRequest';\nimport { TwoFactorAuthenticatorResponse } from 'jslib/models/response/twoFactorAuthenticatorResponse';\n\nimport { TwoFactorProviderType } from 'jslib/enums/twoFactorProviderType';\n\nimport { TwoFactorBaseComponent } from './two-factor-base.component';\n\n@Component({\n selector: 'app-two-factor-authenticator',\n templateUrl: 'two-factor-authenticator.component.html',\n})\nexport class TwoFactorAuthenticatorComponent extends TwoFactorBaseComponent implements OnInit, OnDestroy {\n type = TwoFactorProviderType.Authenticator;\n key: string;\n token: string;\n formPromise: Promise;\n\n private qrScript: HTMLScriptElement;\n\n constructor(apiService: ApiService, i18nService: I18nService,\n analytics: Angulartics2, toasterService: ToasterService,\n private userService: UserService, platformUtilsService: PlatformUtilsService) {\n super(apiService, i18nService, analytics, toasterService, platformUtilsService);\n this.qrScript = window.document.createElement('script');\n this.qrScript.src = 'scripts/qrious.min.js';\n this.qrScript.async = true;\n }\n\n ngOnInit() {\n window.document.body.appendChild(this.qrScript);\n }\n\n ngOnDestroy() {\n window.document.body.removeChild(this.qrScript);\n }\n\n auth(authResponse: any) {\n super.auth(authResponse);\n return this.processResponse(authResponse.response);\n }\n\n submit() {\n if (this.enabled) {\n return super.disable(this.formPromise);\n } else {\n return this.enable();\n }\n }\n\n protected enable() {\n const request = new UpdateTwoFactorAuthenticatorRequest();\n request.masterPasswordHash = this.masterPasswordHash;\n request.token = this.token;\n request.key = this.key;\n\n return super.enable(async () => {\n this.formPromise = this.apiService.putTwoFactorAuthenticator(request);\n const response = await this.formPromise;\n await this.processResponse(response);\n });\n }\n\n private async processResponse(response: TwoFactorAuthenticatorResponse) {\n this.token = null;\n this.enabled = response.enabled;\n this.key = response.key;\n const email = await this.userService.getEmail();\n window.setTimeout(() => {\n const qr = new (window as any).QRious({\n element: document.getElementById('qr'),\n value: 'otpauth://totp/Bitwarden:' + encodeURIComponent(email) +\n '?secret=' + encodeURIComponent(this.key) + '&issuer=Bitwarden',\n size: 160,\n });\n }, 100);\n }\n}\n","import { Component } from '@angular/core';\r\nimport { Router } from '@angular/router';\r\n\r\nimport { ToasterService } from 'angular2-toaster';\r\nimport { Angulartics2 } from 'angulartics2';\r\n\r\nimport { ApiService } from 'jslib/abstractions/api.service';\r\nimport { CryptoService } from 'jslib/abstractions/crypto.service';\r\nimport { I18nService } from 'jslib/abstractions/i18n.service';\r\n\r\nimport { PasswordVerificationRequest } from 'jslib/models/request/passwordVerificationRequest';\r\n\r\n@Component({\r\n selector: 'app-purge-vault',\r\n templateUrl: 'purge-vault.component.html',\r\n})\r\nexport class PurgeVaultComponent {\r\n masterPassword: string;\r\n formPromise: Promise;\r\n\r\n constructor(private apiService: ApiService, private i18nService: I18nService,\r\n private analytics: Angulartics2, private toasterService: ToasterService,\r\n private cryptoService: CryptoService, private router: Router) { }\r\n\r\n async submit() {\r\n if (this.masterPassword == null || this.masterPassword === '') {\r\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'),\r\n this.i18nService.t('masterPassRequired'));\r\n return;\r\n }\r\n\r\n const request = new PasswordVerificationRequest();\r\n request.masterPasswordHash = await this.cryptoService.hashPassword(this.masterPassword, null);\r\n try {\r\n this.formPromise = this.apiService.postPurgeCiphers(request);\r\n await this.formPromise;\r\n this.analytics.eventTrack.next({ action: 'Purged Vault' });\r\n this.toasterService.popAsync('success', null, this.i18nService.t('vaultPurged'));\r\n this.router.navigate(['vault']);\r\n } catch { }\r\n }\r\n}\r\n","import { Component } from '@angular/core';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { CryptoService } from 'jslib/abstractions/crypto.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\nimport { MessagingService } from 'jslib/abstractions/messaging.service';\n\nimport { PasswordVerificationRequest } from 'jslib/models/request/passwordVerificationRequest';\n\n@Component({\n selector: 'app-delete-account',\n templateUrl: 'delete-account.component.html',\n})\nexport class DeleteAccountComponent {\n masterPassword: string;\n formPromise: Promise;\n\n constructor(private apiService: ApiService, private i18nService: I18nService,\n private analytics: Angulartics2, private toasterService: ToasterService,\n private cryptoService: CryptoService, private messagingService: MessagingService) { }\n\n async submit() {\n if (this.masterPassword == null || this.masterPassword === '') {\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'),\n this.i18nService.t('masterPassRequired'));\n return;\n }\n\n const request = new PasswordVerificationRequest();\n request.masterPasswordHash = await this.cryptoService.hashPassword(this.masterPassword, null);\n try {\n this.formPromise = this.apiService.deleteAccount(request);\n await this.formPromise;\n this.analytics.eventTrack.next({ action: 'Deleted Account' });\n this.toasterService.popAsync('success', this.i18nService.t('accountDeleted'),\n this.i18nService.t('accountDeletedDesc'));\n this.messagingService.send('logout');\n } catch { }\n }\n}\n","import { Component } from '@angular/core';\r\n\r\nimport { ToasterService } from 'angular2-toaster';\r\nimport { Angulartics2 } from 'angulartics2';\r\n\r\nimport { ApiService } from 'jslib/abstractions/api.service';\r\nimport { CryptoService } from 'jslib/abstractions/crypto.service';\r\nimport { I18nService } from 'jslib/abstractions/i18n.service';\r\nimport { MessagingService } from 'jslib/abstractions/messaging.service';\r\n\r\nimport { PasswordVerificationRequest } from 'jslib/models/request/passwordVerificationRequest';\r\n\r\n@Component({\r\n selector: 'app-deauthorize-sessions',\r\n templateUrl: 'deauthorize-sessions.component.html',\r\n})\r\nexport class DeauthorizeSessionsComponent {\r\n masterPassword: string;\r\n formPromise: Promise;\r\n\r\n constructor(private apiService: ApiService, private i18nService: I18nService,\r\n private analytics: Angulartics2, private toasterService: ToasterService,\r\n private cryptoService: CryptoService, private messagingService: MessagingService) { }\r\n\r\n async submit() {\r\n if (this.masterPassword == null || this.masterPassword === '') {\r\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'),\r\n this.i18nService.t('masterPassRequired'));\r\n return;\r\n }\r\n\r\n const request = new PasswordVerificationRequest();\r\n request.masterPasswordHash = await this.cryptoService.hashPassword(this.masterPassword, null);\r\n try {\r\n this.formPromise = this.apiService.postSecurityStamp(request);\r\n await this.formPromise;\r\n this.analytics.eventTrack.next({ action: 'Deauthorized Sessions' });\r\n this.toasterService.popAsync('success', this.i18nService.t('sessionsDeauthorized'),\r\n this.i18nService.t('logBackIn'));\r\n this.messagingService.send('logout');\r\n } catch { }\r\n }\r\n}\r\n","import {\n Component,\n} from '@angular/core';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { CryptoService } from 'jslib/abstractions/crypto.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\nimport { MessagingService } from 'jslib/abstractions/messaging.service';\nimport { UserService } from 'jslib/abstractions/user.service';\nimport { PasswordRequest } from 'jslib/models/request/passwordRequest';\n\n@Component({\n selector: 'app-change-password',\n templateUrl: 'change-password.component.html',\n})\nexport class ChangePasswordComponent {\n currentMasterPassword: string;\n newMasterPassword: string;\n confirmNewMasterPassword: string;\n formPromise: Promise;\n\n constructor(private apiService: ApiService, private i18nService: I18nService,\n private analytics: Angulartics2, private toasterService: ToasterService,\n private cryptoService: CryptoService, private messagingService: MessagingService,\n private userService: UserService) { }\n\n async submit() {\n const hasEncKey = await this.cryptoService.hasEncKey();\n if (!hasEncKey) {\n this.toasterService.popAsync('error', null, this.i18nService.t('updateKey'));\n return;\n }\n\n if (this.currentMasterPassword == null || this.currentMasterPassword === '' ||\n this.newMasterPassword == null || this.newMasterPassword === '') {\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'),\n this.i18nService.t('masterPassRequired'));\n return;\n }\n if (this.newMasterPassword.length < 8) {\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'),\n this.i18nService.t('masterPassLength'));\n return;\n }\n if (this.newMasterPassword !== this.confirmNewMasterPassword) {\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'),\n this.i18nService.t('masterPassDoesntMatch'));\n return;\n }\n\n const request = new PasswordRequest();\n request.masterPasswordHash = await this.cryptoService.hashPassword(this.currentMasterPassword, null);\n const email = await this.userService.getEmail();\n const newKey = await this.cryptoService.makeKey(this.newMasterPassword, email);\n request.newMasterPasswordHash = await this.cryptoService.hashPassword(this.newMasterPassword, newKey);\n const encKey = await this.cryptoService.getEncKey();\n const newEncKey = await this.cryptoService.encrypt(encKey.key, newKey);\n request.key = newEncKey.encryptedString;\n try {\n this.formPromise = this.apiService.postPassword(request);\n await this.formPromise;\n this.analytics.eventTrack.next({ action: 'Changed Password' });\n this.toasterService.popAsync('success', this.i18nService.t('masterPasswordChanged'),\n this.i18nService.t('logBackIn'));\n this.messagingService.send('logout');\n } catch { }\n }\n}\n","import { PasswordVerificationRequest } from './passwordVerificationRequest';\n\nexport class EmailTokenRequest extends PasswordVerificationRequest {\n newEmail: string;\n masterPasswordHash: string;\n}\n","import {\n Component,\n} from '@angular/core';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { CryptoService } from 'jslib/abstractions/crypto.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\nimport { MessagingService } from 'jslib/abstractions/messaging.service';\n\nimport { EmailRequest } from 'jslib/models/request/emailRequest';\nimport { EmailTokenRequest } from 'jslib/models/request/emailTokenRequest';\n\n@Component({\n selector: 'app-change-email',\n templateUrl: 'change-email.component.html',\n})\nexport class ChangeEmailComponent {\n masterPassword: string;\n newEmail: string;\n token: string;\n tokenSent = false;\n\n formPromise: Promise;\n\n constructor(private apiService: ApiService, private i18nService: I18nService,\n private analytics: Angulartics2, private toasterService: ToasterService,\n private cryptoService: CryptoService, private messagingService: MessagingService) { }\n\n async submit() {\n const hasEncKey = await this.cryptoService.hasEncKey();\n if (!hasEncKey) {\n this.toasterService.popAsync('error', null, this.i18nService.t('updateKey'));\n return;\n }\n\n this.newEmail = this.newEmail.toLowerCase();\n if (!this.tokenSent) {\n const request = new EmailTokenRequest();\n request.newEmail = this.newEmail;\n request.masterPasswordHash = await this.cryptoService.hashPassword(this.masterPassword, null);\n try {\n this.formPromise = this.apiService.postEmailToken(request);\n await this.formPromise;\n this.tokenSent = true;\n } catch { }\n } else {\n const request = new EmailRequest();\n request.token = this.token;\n request.newEmail = this.newEmail;\n request.masterPasswordHash = await this.cryptoService.hashPassword(this.masterPassword, null);\n const newKey = await this.cryptoService.makeKey(this.masterPassword, this.newEmail);\n request.newMasterPasswordHash = await this.cryptoService.hashPassword(this.masterPassword, newKey);\n const encKey = await this.cryptoService.getEncKey();\n const newEncKey = await this.cryptoService.encrypt(encKey.key, newKey);\n request.key = newEncKey.encryptedString;\n try {\n this.formPromise = this.apiService.postEmail(request);\n await this.formPromise;\n this.reset();\n this.analytics.eventTrack.next({ action: 'Changed Email' });\n this.toasterService.popAsync('success', this.i18nService.t('emailChanged'),\n this.i18nService.t('logBackIn'));\n this.messagingService.send('logout');\n } catch { }\n }\n }\n\n reset() {\n this.token = this.newEmail = this.masterPassword = null;\n this.tokenSent = false;\n }\n}\n","import {\r\n Component,\r\n OnInit,\r\n} from '@angular/core';\r\n\r\nimport { ToasterService } from 'angular2-toaster';\r\nimport { Angulartics2 } from 'angulartics2';\r\n\r\nimport { ApiService } from 'jslib/abstractions/api.service';\r\nimport { I18nService } from 'jslib/abstractions/i18n.service';\r\n\r\nimport { UpdateProfileRequest } from 'jslib/models/request/updateProfileRequest';\r\n\r\nimport { ProfileResponse } from 'jslib/models/response/profileResponse';\r\n\r\n@Component({\r\n selector: 'app-profile',\r\n templateUrl: 'profile.component.html',\r\n})\r\nexport class ProfileComponent implements OnInit {\r\n loading = true;\r\n profile: ProfileResponse;\r\n\r\n formPromise: Promise;\r\n\r\n constructor(private apiService: ApiService, private i18nService: I18nService,\r\n private analytics: Angulartics2, private toasterService: ToasterService) { }\r\n\r\n async ngOnInit() {\r\n this.profile = await this.apiService.getProfile();\r\n this.loading = false;\r\n }\r\n\r\n async submit() {\r\n try {\r\n const request = new UpdateProfileRequest(this.profile.name, this.profile.masterPasswordHint);\r\n this.formPromise = this.apiService.putProfile(request);\r\n await this.formPromise;\r\n this.analytics.eventTrack.next({ action: 'Updated Profile' });\r\n this.toasterService.popAsync('success', null, this.i18nService.t('accountUpdated'));\r\n } catch { }\r\n }\r\n}\r\n","import {\n Component,\n EventEmitter,\n Input,\n OnDestroy,\n OnInit,\n Output,\n} from '@angular/core';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { CipherService } from 'jslib/abstractions/cipher.service';\nimport { CollectionService } from 'jslib/abstractions/collection.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\nimport { UserService } from 'jslib/abstractions/user.service';\n\nimport { Organization } from 'jslib/models/domain/organization';\nimport { CipherView } from 'jslib/models/view/cipherView';\nimport { CollectionView } from 'jslib/models/view/collectionView';\n\n@Component({\n selector: 'app-vault-share',\n templateUrl: 'share.component.html',\n})\nexport class ShareComponent implements OnInit, OnDestroy {\n @Input() cipherId: string;\n @Input() organizationId: string;\n @Output() onSharedCipher = new EventEmitter();\n\n formPromise: Promise;\n cipher: CipherView;\n collections: CollectionView[] = [];\n organizations: Organization[] = [];\n\n private writeableCollections: CollectionView[] = [];\n\n constructor(private collectionService: CollectionService, private analytics: Angulartics2,\n private toasterService: ToasterService, private i18nService: I18nService,\n private userService: UserService, private cipherService: CipherService) { }\n\n async ngOnInit() {\n const cipherDomain = await this.cipherService.get(this.cipherId);\n this.cipher = await cipherDomain.decrypt();\n const allCollections = await this.collectionService.getAllDecrypted();\n this.writeableCollections = allCollections.filter((c) => !c.readOnly);\n this.organizations = await this.userService.getAllOrganizations();\n if (this.organizationId == null && this.organizations.length > 0) {\n this.organizationId = this.organizations[0].id;\n }\n this.filterCollections();\n }\n\n ngOnDestroy() {\n this.selectAll(false);\n }\n\n filterCollections() {\n this.selectAll(false);\n if (this.organizationId == null || this.writeableCollections.length === 0) {\n this.collections = [];\n } else {\n this.collections = this.writeableCollections.filter((c) => c.organizationId === this.organizationId);\n }\n }\n\n async submit() {\n const cipherDomain = await this.cipherService.get(this.cipherId);\n const cipherView = await cipherDomain.decrypt();\n\n const attachmentPromises: Array> = [];\n if (cipherView.attachments != null) {\n for (const attachment of cipherView.attachments) {\n const promise = this.cipherService.shareAttachmentWithServer(attachment,\n cipherView.id, this.organizationId);\n attachmentPromises.push(promise);\n }\n }\n\n const checkedCollectionIds = this.collections.filter((c) => (c as any).checked).map((c) => c.id);\n this.formPromise = Promise.all(attachmentPromises).then(async () => {\n await this.cipherService.shareWithServer(cipherView, this.organizationId, checkedCollectionIds);\n this.onSharedCipher.emit();\n this.analytics.eventTrack.next({ action: 'Shared Cipher' });\n this.toasterService.popAsync('success', null, this.i18nService.t('sharedItem'));\n });\n await this.formPromise;\n }\n\n check(c: CollectionView, select?: boolean) {\n (c as any).checked = select == null ? !(c as any).checked : select;\n }\n\n selectAll(select: boolean) {\n const collections = select ? this.collections : this.writeableCollections;\n collections.forEach((c) => this.check(c, select));\n }\n}\n","import { Component } from '@angular/core';\r\n\r\nimport { ToasterService } from 'angular2-toaster';\r\nimport { Angulartics2 } from 'angulartics2';\r\n\r\nimport { FolderService } from 'jslib/abstractions/folder.service';\r\nimport { I18nService } from 'jslib/abstractions/i18n.service';\r\nimport { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';\r\n\r\nimport {\r\n FolderAddEditComponent as BaseFolderAddEditComponent,\r\n} from 'jslib/angular/components/folder-add-edit.component';\r\n\r\n@Component({\r\n selector: 'app-folder-add-edit',\r\n templateUrl: 'folder-add-edit.component.html',\r\n})\r\nexport class FolderAddEditComponent extends BaseFolderAddEditComponent {\r\n constructor(folderService: FolderService, i18nService: I18nService,\r\n analytics: Angulartics2, toasterService: ToasterService,\r\n platformUtilsService: PlatformUtilsService) {\r\n super(folderService, i18nService, analytics, toasterService, platformUtilsService);\r\n }\r\n}\r\n","import {\n Component,\n EventEmitter,\n Input,\n OnInit,\n Output,\n} from '@angular/core';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { CipherService } from 'jslib/abstractions/cipher.service';\nimport { CollectionService } from 'jslib/abstractions/collection.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\nimport { UserService } from 'jslib/abstractions/user.service';\n\nimport { CipherView } from 'jslib/models/view';\nimport { CollectionView } from 'jslib/models/view/collectionView';\n\nimport { Organization } from 'jslib/models/domain/organization';\n\n@Component({\n selector: 'app-vault-bulk-share',\n templateUrl: 'bulk-share.component.html',\n})\nexport class BulkShareComponent implements OnInit {\n @Input() ciphers: CipherView[] = [];\n @Input() organizationId: string;\n @Output() onShared = new EventEmitter();\n\n nonShareableCount = 0;\n collections: CollectionView[] = [];\n organizations: Organization[] = [];\n shareableCiphers: CipherView[] = [];\n formPromise: Promise;\n\n private writeableCollections: CollectionView[] = [];\n\n constructor(private analytics: Angulartics2, private cipherService: CipherService,\n private toasterService: ToasterService, private i18nService: I18nService,\n private collectionService: CollectionService, private userService: UserService) { }\n\n async ngOnInit() {\n this.shareableCiphers = this.ciphers.filter((c) => !c.hasAttachments && c.organizationId == null);\n this.nonShareableCount = this.ciphers.length - this.shareableCiphers.length;\n const allCollections = await this.collectionService.getAllDecrypted();\n this.writeableCollections = allCollections.filter((c) => !c.readOnly);\n this.organizations = await this.userService.getAllOrganizations();\n if (this.organizationId == null && this.organizations.length > 0) {\n this.organizationId = this.organizations[0].id;\n }\n this.filterCollections();\n }\n\n ngOnDestroy() {\n this.selectAll(false);\n }\n\n filterCollections() {\n this.selectAll(false);\n if (this.organizationId == null || this.writeableCollections.length === 0) {\n this.collections = [];\n } else {\n this.collections = this.writeableCollections.filter((c) => c.organizationId === this.organizationId);\n }\n }\n\n async submit() {\n const checkedCollectionIds = this.collections.filter((c) => (c as any).checked).map((c) => c.id);\n this.formPromise = this.cipherService.shareManyWithServer(this.shareableCiphers, this.organizationId,\n checkedCollectionIds);\n await this.formPromise;\n this.onShared.emit();\n this.analytics.eventTrack.next({ action: 'Bulk Shared Items' });\n this.toasterService.popAsync('success', null, this.i18nService.t('sharedItems'));\n }\n\n check(c: CollectionView, select?: boolean) {\n (c as any).checked = select == null ? !(c as any).checked : select;\n }\n\n selectAll(select: boolean) {\n const collections = select ? this.collections : this.writeableCollections;\n collections.forEach((c) => this.check(c, select));\n }\n}\n","import {\r\n Component,\r\n EventEmitter,\r\n Input,\r\n OnInit,\r\n Output,\r\n} from '@angular/core';\r\n\r\nimport { ToasterService } from 'angular2-toaster';\r\nimport { Angulartics2 } from 'angulartics2';\r\n\r\nimport { CipherService } from 'jslib/abstractions/cipher.service';\r\nimport { FolderService } from 'jslib/abstractions/folder.service';\r\nimport { I18nService } from 'jslib/abstractions/i18n.service';\r\n\r\nimport { FolderView } from 'jslib/models/view/folderView';\r\n\r\n@Component({\r\n selector: 'app-vault-bulk-move',\r\n templateUrl: 'bulk-move.component.html',\r\n})\r\nexport class BulkMoveComponent implements OnInit {\r\n @Input() cipherIds: string[] = [];\r\n @Output() onMoved = new EventEmitter();\r\n\r\n folderId: string = null;\r\n folders: FolderView[] = [];\r\n formPromise: Promise;\r\n\r\n constructor(private analytics: Angulartics2, private cipherService: CipherService,\r\n private toasterService: ToasterService, private i18nService: I18nService,\r\n private folderService: FolderService) { }\r\n\r\n async ngOnInit() {\r\n this.folders = await this.folderService.getAllDecrypted();\r\n this.folderId = this.folders[0].id;\r\n }\r\n\r\n async submit() {\r\n this.formPromise = this.cipherService.moveManyWithServer(this.cipherIds, this.folderId);\r\n await this.formPromise;\r\n this.onMoved.emit();\r\n this.analytics.eventTrack.next({ action: 'Bulk Moved Items' });\r\n this.toasterService.popAsync('success', null, this.i18nService.t('movedItems'));\r\n }\r\n}\r\n","import {\r\n Component,\r\n EventEmitter,\r\n Input,\r\n Output,\r\n} from '@angular/core';\r\n\r\nimport { ToasterService } from 'angular2-toaster';\r\nimport { Angulartics2 } from 'angulartics2';\r\n\r\nimport { CipherService } from 'jslib/abstractions/cipher.service';\r\nimport { I18nService } from 'jslib/abstractions/i18n.service';\r\n\r\n@Component({\r\n selector: 'app-vault-bulk-delete',\r\n templateUrl: 'bulk-delete.component.html',\r\n})\r\nexport class BulkDeleteComponent {\r\n @Input() cipherIds: string[] = [];\r\n @Output() onDeleted = new EventEmitter();\r\n\r\n formPromise: Promise;\r\n\r\n constructor(private analytics: Angulartics2, private cipherService: CipherService,\r\n private toasterService: ToasterService, private i18nService: I18nService) { }\r\n\r\n async submit() {\r\n this.formPromise = this.cipherService.deleteManyWithServer(this.cipherIds);\r\n await this.formPromise;\r\n this.onDeleted.emit();\r\n this.analytics.eventTrack.next({ action: 'Bulk Deleted Items' });\r\n this.toasterService.popAsync('success', null, this.i18nService.t('deletedItems'));\r\n }\r\n}\r\n","import { CipherRequest } from './cipherRequest';\n\nimport { Cipher } from '../domain/cipher';\n\nexport class CipherWithIdRequest extends CipherRequest {\n id: string;\n\n constructor(cipher: Cipher) {\n super(cipher);\n this.id = cipher.id;\n }\n}\n","import { Component } from '@angular/core';\n\nimport {\n Toast,\n ToasterService,\n} from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { CipherService } from 'jslib/abstractions/cipher.service';\nimport { CryptoService } from 'jslib/abstractions/crypto.service';\nimport { FolderService } from 'jslib/abstractions/folder.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\nimport { MessagingService } from 'jslib/abstractions/messaging.service';\nimport { SyncService } from 'jslib/abstractions/sync.service';\n\nimport { CipherString } from 'jslib/models/domain/cipherString';\n\nimport { CipherWithIdRequest } from 'jslib/models/request/cipherWithIdRequest';\nimport { FolderWithIdRequest } from 'jslib/models/request/folderWithIdRequest';\nimport { UpdateKeyRequest } from 'jslib/models/request/updateKeyRequest';\n\n@Component({\n selector: 'app-update-key',\n templateUrl: 'update-key.component.html',\n})\nexport class UpdateKeyComponent {\n masterPassword: string;\n formPromise: Promise;\n\n constructor(private apiService: ApiService, private i18nService: I18nService,\n private analytics: Angulartics2, private toasterService: ToasterService,\n private cryptoService: CryptoService, private messagingService: MessagingService,\n private syncService: SyncService, private folderService: FolderService,\n private cipherService: CipherService) { }\n\n async submit() {\n const hasEncKey = await this.cryptoService.hasEncKey();\n if (hasEncKey) {\n return;\n }\n\n if (this.masterPassword == null || this.masterPassword === '') {\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'),\n this.i18nService.t('masterPassRequired'));\n return;\n }\n\n try {\n this.formPromise = this.makeRequest().then((request) => {\n return this.apiService.postAccountKey(request);\n });\n await this.formPromise;\n this.analytics.eventTrack.next({ action: 'Key Updated' });\n const toast: Toast = {\n type: 'success',\n title: this.i18nService.t('keyUpdated'),\n body: this.i18nService.t('logBackInOthersToo'),\n timeout: 15000,\n };\n this.toasterService.popAsync(toast);\n this.messagingService.send('logout');\n } catch { }\n }\n\n private async makeRequest(): Promise {\n const key = await this.cryptoService.getKey();\n const encKey = await this.cryptoService.makeEncKey(key);\n const privateKey = await this.cryptoService.getPrivateKey();\n let encPrivateKey: CipherString = null;\n if (privateKey != null) {\n encPrivateKey = await this.cryptoService.encrypt(privateKey, encKey[0]);\n }\n const request = new UpdateKeyRequest();\n request.privateKey = encPrivateKey != null ? encPrivateKey.encryptedString : null;\n request.key = encKey[1].encryptedString;\n request.masterPasswordHash = await this.cryptoService.hashPassword(this.masterPassword, null);\n\n await this.syncService.fullSync(true);\n\n const folders = await this.folderService.getAllDecrypted();\n for (let i = 0; i < folders.length; i++) {\n if (folders[i].id == null) {\n continue;\n }\n const folder = await this.folderService.encrypt(folders[i], encKey[0]);\n request.folders.push(new FolderWithIdRequest(folder));\n }\n\n const ciphers = await this.cipherService.getAllDecrypted();\n for (let i = 0; i < ciphers.length; i++) {\n if (ciphers[i].organizationId != null) {\n continue;\n }\n const cipher = await this.cipherService.encrypt(ciphers[i], encKey[0]);\n request.ciphers.push(new CipherWithIdRequest(cipher));\n }\n\n return request;\n }\n}\n","\r\n

\r\n \r\n

\r\n \r\n \r\n

{{'noOrganizationsList' | i18n}}

\r\n
\r\n \r\n \r\n {{'newOrganization' | i18n}}\r\n \r\n
\r\n\r\n
\r\n

\r\n {{'organizations' | i18n}}\r\n \r\n \r\n \r\n

\r\n \r\n \r\n {{'newOrganization' | i18n}}\r\n \r\n
\r\n \r\n \r\n \r\n

{{'noOrganizationsList' | i18n}}

\r\n \r\n \r\n {{'newOrganization' | i18n}}\r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n \r\n {{o.name}}\r\n \r\n
\r\n \r\n \r\n
\r\n
\r\n
\r\n
\r\n","import {\n Pipe,\n PipeTransform,\n} from '@angular/core';\n\nimport { CipherView } from '../../models/view/cipherView';\n\nimport { PlatformUtilsService } from '../../abstractions/platformUtils.service';\n\nimport { DeviceType } from '../../enums';\n\n@Pipe({\n name: 'searchCiphers',\n})\nexport class SearchCiphersPipe implements PipeTransform {\n private onlySearchName = false;\n\n constructor(platformUtilsService: PlatformUtilsService) {\n this.onlySearchName = platformUtilsService.getDevice() === DeviceType.EdgeExtension;\n }\n\n transform(ciphers: CipherView[], searchText: string): CipherView[] {\n if (ciphers == null || ciphers.length === 0) {\n return [];\n }\n\n if (searchText == null || searchText.length < 2) {\n return ciphers;\n }\n\n searchText = searchText.trim().toLowerCase();\n return ciphers.filter((c) => {\n if (c.name != null && c.name.toLowerCase().indexOf(searchText) > -1) {\n return true;\n }\n if (this.onlySearchName) {\n return false;\n }\n if (searchText.length >= 8 && c.id.startsWith(searchText)) {\n return true;\n }\n if (c.subTitle != null && c.subTitle.toLowerCase().indexOf(searchText) > -1) {\n return true;\n }\n if (c.login && c.login.uri != null && c.login.uri.toLowerCase().indexOf(searchText) > -1) {\n return true;\n }\n\n return false;\n });\n }\n}\n","
\r\n \"\"\r\n \r\n
\r\n","import { Component } from '@angular/core';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { ApiService } from 'jslib/abstractions/api.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\n\n@Component({\n selector: 'app-verify-email',\n templateUrl: 'verify-email.component.html',\n})\nexport class VerifyEmailComponent {\n actionPromise: Promise;\n\n constructor(private apiService: ApiService, private i18nService: I18nService,\n private analytics: Angulartics2, private toasterService: ToasterService) { }\n\n async send() {\n if (this.actionPromise != null) {\n return;\n }\n try {\n this.actionPromise = this.apiService.postAccountVerifyEmail();\n await this.actionPromise;\n this.analytics.eventTrack.next({ action: 'Sent Verification Email' });\n this.toasterService.popAsync('success', null, this.i18nService.t('checkInboxForVerification'));\n } catch { }\n this.actionPromise = null;\n }\n}\n","
\n
\n
\n © {{year}}, 8bit Solutions LLC\n
\n
\n
\n {{'versionNumber' | i18n : version}}\n
\n
\n
\n","\n","export class KeysRequest {\n publicKey: string;\n encryptedPrivateKey: string;\n\n constructor(publicKey: string, encryptedPrivateKey: string) {\n this.publicKey = publicKey;\n this.encryptedPrivateKey = encryptedPrivateKey;\n }\n}\n","import { PasswordVerificationRequest } from './passwordVerificationRequest';\n\nexport class TwoFactorEmailRequest extends PasswordVerificationRequest {\n email: string;\n\n constructor(email: string, masterPasswordHash: string) {\n super();\n this.masterPasswordHash = masterPasswordHash;\n this.email = email;\n }\n}\n","import { Component } from '@angular/core';\r\nimport { Router } from '@angular/router';\r\n\r\nimport { ToasterService } from 'angular2-toaster';\r\nimport { Angulartics2 } from 'angulartics2';\r\n\r\nimport { AuthService } from 'jslib/abstractions/auth.service';\r\nimport { I18nService } from 'jslib/abstractions/i18n.service';\r\nimport { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';\r\n\r\nimport {\r\n TwoFactorOptionsComponent as BaseTwoFactorOptionsComponent,\r\n} from 'jslib/angular/components/two-factor-options.component';\r\n\r\n@Component({\r\n selector: 'app-two-factor-options',\r\n templateUrl: 'two-factor-options.component.html',\r\n})\r\nexport class TwoFactorOptionsComponent extends BaseTwoFactorOptionsComponent {\r\n constructor(authService: AuthService, router: Router,\r\n analytics: Angulartics2, toasterService: ToasterService,\r\n i18nService: I18nService, platformUtilsService: PlatformUtilsService) {\r\n super(authService, router, analytics, toasterService, i18nService, platformUtilsService, window);\r\n }\r\n}\r\n","import * as jq from 'jquery';\nimport * as _swal from 'sweetalert';\nimport { SweetAlert } from 'sweetalert/typings/core';\n\nimport {\n ToasterConfig,\n ToasterService,\n} from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\nimport { Angulartics2GoogleAnalytics } from 'angulartics2/ga';\n\nimport {\n Component,\n NgZone,\n OnDestroy,\n OnInit,\n} from '@angular/core';\nimport {\n NavigationEnd,\n Router,\n} from '@angular/router';\n\nimport { BroadcasterService } from 'jslib/angular/services/broadcaster.service';\n\nimport { StorageService } from 'jslib/abstractions/storage.service';\n\nimport { AuthService } from 'jslib/abstractions/auth.service';\nimport { CipherService } from 'jslib/abstractions/cipher.service';\nimport { CollectionService } from 'jslib/abstractions/collection.service';\nimport { CryptoService } from 'jslib/abstractions/crypto.service';\nimport { FolderService } from 'jslib/abstractions/folder.service';\nimport { I18nService } from 'jslib/abstractions/i18n.service';\nimport { LockService } from 'jslib/abstractions/lock.service';\nimport { PasswordGenerationService } from 'jslib/abstractions/passwordGeneration.service';\nimport { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';\nimport { SettingsService } from 'jslib/abstractions/settings.service';\nimport { SyncService } from 'jslib/abstractions/sync.service';\nimport { TokenService } from 'jslib/abstractions/token.service';\nimport { UserService } from 'jslib/abstractions/user.service';\n\nimport { ConstantsService } from 'jslib/services/constants.service';\n\nimport { RouterService } from './services/router.service';\n\nconst BroadcasterSubscriptionId = 'AppComponent';\n// Hack due to Angular 5.2 bug\nconst swal: SweetAlert = _swal as any;\n\n@Component({\n selector: 'app-root',\n templateUrl: 'app.component.html',\n})\nexport class AppComponent implements OnDestroy, OnInit {\n toasterConfig: ToasterConfig = new ToasterConfig({\n showCloseButton: true,\n mouseoverTimerStop: true,\n animation: 'flyRight',\n limit: 5,\n });\n\n private lastActivity: number = null;\n\n constructor(private angulartics2GoogleAnalytics: Angulartics2GoogleAnalytics,\n private broadcasterService: BroadcasterService, private userService: UserService,\n private tokenService: TokenService, private folderService: FolderService,\n private settingsService: SettingsService, private syncService: SyncService,\n private passwordGenerationService: PasswordGenerationService, private cipherService: CipherService,\n private authService: AuthService, private router: Router, private analytics: Angulartics2,\n private toasterService: ToasterService, private i18nService: I18nService,\n private platformUtilsService: PlatformUtilsService, private ngZone: NgZone,\n private lockService: LockService, private storageService: StorageService,\n private cryptoService: CryptoService, private collectionService: CollectionService,\n private routerService: RouterService) { }\n\n ngOnInit() {\n this.ngZone.runOutsideAngular(() => {\n window.onmousemove = () => this.recordActivity();\n window.onmousedown = () => this.recordActivity();\n window.ontouchstart = () => this.recordActivity();\n window.onclick = () => this.recordActivity();\n window.onscroll = () => this.recordActivity();\n window.onkeypress = () => this.recordActivity();\n });\n\n this.broadcasterService.subscribe(BroadcasterSubscriptionId, async (message: any) => {\n this.ngZone.run(async () => {\n switch (message.command) {\n case 'loggedIn':\n case 'unlocked':\n case 'loggedOut':\n break;\n case 'logout':\n this.logOut(!!message.expired);\n break;\n case 'lockVault':\n await this.lockService.lock();\n break;\n case 'locked':\n this.router.navigate(['lock']);\n break;\n case 'syncStarted':\n break;\n case 'syncCompleted':\n break;\n case 'upgradeOrganization':\n const upgradeConfirmed = await this.platformUtilsService.showDialog(\n this.i18nService.t('upgradeOrganizationDesc'), this.i18nService.t('upgradeOrganization'),\n this.i18nService.t('upgradeOrganization'), this.i18nService.t('cancel'));\n if (upgradeConfirmed) {\n this.router.navigate(['organizations', message.organizationId, 'settings', 'billing']);\n }\n break;\n case 'premiumRequired':\n const premiumConfirmed = await this.platformUtilsService.showDialog(\n this.i18nService.t('premiumRequiredDesc'), this.i18nService.t('premiumRequired'),\n this.i18nService.t('learnMore'), this.i18nService.t('cancel'));\n if (premiumConfirmed) {\n this.router.navigate(['settings/premium']);\n }\n break;\n default:\n break;\n }\n });\n });\n\n this.router.events.subscribe((event) => {\n if (event instanceof NavigationEnd) {\n const modals = Array.from(document.querySelectorAll('.modal'));\n for (const modal of modals) {\n (jq(modal) as any).modal('hide');\n }\n\n if (document.querySelector('.swal-modal') != null) {\n swal.close(undefined);\n }\n }\n });\n }\n\n ngOnDestroy() {\n this.broadcasterService.unsubscribe(BroadcasterSubscriptionId);\n }\n\n private async logOut(expired: boolean) {\n const userId = await this.userService.getUserId();\n\n await Promise.all([\n this.syncService.setLastSync(new Date(0)),\n this.tokenService.clearToken(),\n this.cryptoService.clearKeys(),\n this.userService.clear(),\n this.settingsService.clear(userId),\n this.cipherService.clear(userId),\n this.folderService.clear(userId),\n this.collectionService.clear(userId),\n this.passwordGenerationService.clear(),\n ]);\n\n this.authService.logOut(async () => {\n this.analytics.eventTrack.next({ action: 'Logged Out' });\n if (expired) {\n this.toasterService.popAsync('warning', this.i18nService.t('loggedOut'),\n this.i18nService.t('loginExpired'));\n }\n this.router.navigate(['/']);\n });\n }\n\n private async recordActivity() {\n const now = (new Date()).getTime();\n if (this.lastActivity != null && now - this.lastActivity < 250) {\n return;\n }\n\n this.lastActivity = now;\n this.storageService.save(ConstantsService.lastActiveKey, now);\n }\n}\n","function webpackEmptyAsyncContext(req) {\n\t// Here Promise.resolve().then() is used instead of new Promise() to prevent\n\t// uncaught exception popping up in devtools\n\treturn Promise.resolve().then(function() {\n\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\te.code = 'MODULE_NOT_FOUND';\n\t\tthrow e;\n\t});\n}\nwebpackEmptyAsyncContext.keys = function() { return []; };\nwebpackEmptyAsyncContext.resolve = webpackEmptyAsyncContext;\nmodule.exports = webpackEmptyAsyncContext;\nwebpackEmptyAsyncContext.id = 589;","import { NgModule } from '@angular/core';\nimport {\n RouterModule,\n Routes,\n} from '@angular/router';\n\nimport { FrontendLayoutComponent } from './layouts/frontend-layout.component';\nimport { OrganizationLayoutComponent } from './layouts/organization-layout.component';\nimport { UserLayoutComponent } from './layouts/user-layout.component';\n\nimport { AcceptOrganizationComponent } from './accounts/accept-organization.component';\nimport { HintComponent } from './accounts/hint.component';\nimport { LockComponent } from './accounts/lock.component';\nimport { LoginComponent } from './accounts/login.component';\nimport { RecoverDeleteComponent } from './accounts/recover-delete.component';\nimport { RecoverTwoFactorComponent } from './accounts/recover-two-factor.component';\nimport { RegisterComponent } from './accounts/register.component';\nimport { TwoFactorComponent } from './accounts/two-factor.component';\nimport { VerifyEmailTokenComponent } from './accounts/verify-email-token.component';\nimport { VerifyRecoverDeleteComponent } from './accounts/verify-recover-delete.component';\n\nimport { CollectionsComponent as OrgManageCollectionsComponent } from './organizations/manage/collections.component';\nimport { EventsComponent as OrgEventsComponent } from './organizations/manage/events.component';\nimport { GroupsComponent as OrgGroupsComponent } from './organizations/manage/groups.component';\nimport { ManageComponent as OrgManageComponent } from './organizations/manage/manage.component';\nimport { PeopleComponent as OrgPeopleComponent } from './organizations/manage/people.component';\n\nimport { AccountComponent as OrgAccountComponent } from './organizations/settings/account.component';\nimport { OrganizationBillingComponent } from './organizations/settings/organization-billing.component';\nimport { SettingsComponent as OrgSettingsComponent } from './organizations/settings/settings.component';\nimport {\n TwoFactorSetupComponent as OrgTwoFactorSetupComponent,\n} from './organizations/settings/two-factor-setup.component';\n\nimport { ExportComponent as OrgExportComponent } from './organizations/tools/export.component';\nimport { ImportComponent as OrgImportComponent } from './organizations/tools/import.component';\nimport { ToolsComponent as OrgToolsComponent } from './organizations/tools/tools.component';\n\nimport { VaultComponent as OrgVaultComponent } from './organizations/vault/vault.component';\n\nimport { AccountComponent } from './settings/account.component';\nimport { CreateOrganizationComponent } from './settings/create-organization.component';\nimport { DomainRulesComponent } from './settings/domain-rules.component';\nimport { OptionsComponent } from './settings/options.component';\nimport { OrganizationsComponent } from './settings/organizations.component';\nimport { PremiumComponent } from './settings/premium.component';\nimport { SettingsComponent } from './settings/settings.component';\nimport { TwoFactorSetupComponent } from './settings/two-factor-setup.component';\nimport { UserBillingComponent } from './settings/user-billing.component';\n\nimport { BreachReportComponent } from './tools/breach-report.component';\nimport { ExportComponent } from './tools/export.component';\nimport { ImportComponent } from './tools/import.component';\nimport { PasswordGeneratorComponent } from './tools/password-generator.component';\nimport { ToolsComponent } from './tools/tools.component';\n\nimport { VaultComponent } from './vault/vault.component';\n\nimport { OrganizationGuardService } from './services/organization-guard.service';\nimport { OrganizationTypeGuardService } from './services/organization-type-guard.service';\nimport { UnauthGuardService } from './services/unauth-guard.service';\n\nimport { AuthGuardService } from 'jslib/angular/services/auth-guard.service';\n\nimport { OrganizationUserType } from 'jslib/enums/organizationUserType';\n\nconst routes: Routes = [\n {\n path: '',\n component: FrontendLayoutComponent,\n children: [\n { path: '', pathMatch: 'full', component: LoginComponent, canActivate: [UnauthGuardService] },\n { path: '2fa', component: TwoFactorComponent, canActivate: [UnauthGuardService] },\n {\n path: 'register', component: RegisterComponent,\n canActivate: [UnauthGuardService],\n data: { titleId: 'createAccount' },\n },\n {\n path: 'hint', component: HintComponent,\n canActivate: [UnauthGuardService],\n data: { titleId: 'passwordHint' },\n },\n { path: 'lock', component: LockComponent },\n { path: 'verify-email', component: VerifyEmailTokenComponent },\n {\n path: 'accept-organization',\n component: AcceptOrganizationComponent,\n data: { titleId: 'joinOrganization' },\n },\n { path: 'recover', pathMatch: 'full', redirectTo: 'recover-2fa' },\n {\n path: 'recover-2fa',\n component: RecoverTwoFactorComponent,\n canActivate: [UnauthGuardService],\n data: { titleId: 'recoverAccountTwoStep' },\n },\n {\n path: 'recover-delete',\n component: RecoverDeleteComponent,\n canActivate: [UnauthGuardService],\n data: { titleId: 'deleteAccount' },\n },\n {\n path: 'verify-recover-delete',\n component: VerifyRecoverDeleteComponent,\n canActivate: [UnauthGuardService],\n data: { titleId: 'deleteAccount' },\n },\n ],\n },\n {\n path: '',\n component: UserLayoutComponent,\n canActivate: [AuthGuardService],\n children: [\n { path: 'vault', component: VaultComponent, data: { titleId: 'myVault' } },\n {\n path: 'settings',\n component: SettingsComponent,\n children: [\n { path: '', pathMatch: 'full', redirectTo: 'account' },\n { path: 'account', component: AccountComponent, data: { titleId: 'myAccount' } },\n { path: 'options', component: OptionsComponent, data: { titleId: 'options' } },\n { path: 'domain-rules', component: DomainRulesComponent, data: { titleId: 'domainRules' } },\n { path: 'two-factor', component: TwoFactorSetupComponent, data: { titleId: 'twoStepLogin' } },\n { path: 'premium', component: PremiumComponent, data: { titleId: 'goPremium' } },\n { path: 'billing', component: UserBillingComponent, data: { titleId: 'billingAndLicensing' } },\n { path: 'organizations', component: OrganizationsComponent, data: { titleId: 'organizations' } },\n {\n path: 'create-organization',\n component: CreateOrganizationComponent,\n data: { titleId: 'newOrganization' },\n },\n ],\n },\n {\n path: 'tools',\n component: ToolsComponent,\n canActivate: [AuthGuardService],\n children: [\n { path: '', pathMatch: 'full', redirectTo: 'generator' },\n { path: 'import', component: ImportComponent, data: { titleId: 'importData' } },\n { path: 'export', component: ExportComponent, data: { titleId: 'exportVault' } },\n {\n path: 'generator',\n component: PasswordGeneratorComponent,\n data: { titleId: 'passwordGenerator' },\n },\n { path: 'breach-report', component: BreachReportComponent, data: { titleId: 'dataBreachReport' } },\n ],\n },\n ],\n },\n {\n path: 'organizations/:organizationId',\n component: OrganizationLayoutComponent,\n canActivate: [AuthGuardService, OrganizationGuardService],\n children: [\n { path: '', pathMatch: 'full', redirectTo: 'vault' },\n { path: 'vault', component: OrgVaultComponent, data: { titleId: 'vault' } },\n {\n path: 'tools',\n component: OrgToolsComponent,\n canActivate: [OrganizationTypeGuardService],\n data: { allowedTypes: [OrganizationUserType.Owner, OrganizationUserType.Admin] },\n children: [\n { path: '', pathMatch: 'full', redirectTo: 'import' },\n { path: 'import', component: OrgImportComponent, data: { titleId: 'importData' } },\n { path: 'export', component: OrgExportComponent, data: { titleId: 'exportVault' } },\n ],\n },\n {\n path: 'manage',\n component: OrgManageComponent,\n canActivate: [OrganizationTypeGuardService],\n data: { allowedTypes: [OrganizationUserType.Owner, OrganizationUserType.Admin] },\n children: [\n { path: '', pathMatch: 'full', redirectTo: 'people' },\n { path: 'collections', component: OrgManageCollectionsComponent, data: { titleId: 'collections' } },\n { path: 'events', component: OrgEventsComponent, data: { titleId: 'eventLogs' } },\n { path: 'groups', component: OrgGroupsComponent, data: { titleId: 'groups' } },\n { path: 'people', component: OrgPeopleComponent, data: { titleId: 'people' } },\n ],\n },\n {\n path: 'settings',\n component: OrgSettingsComponent,\n canActivate: [OrganizationTypeGuardService],\n data: { allowedTypes: [OrganizationUserType.Owner] },\n children: [\n { path: '', pathMatch: 'full', redirectTo: 'account' },\n { path: 'account', component: OrgAccountComponent, data: { titleId: 'myOrganization' } },\n { path: 'two-factor', component: OrgTwoFactorSetupComponent, data: { titleId: 'twoStepLogin' } },\n {\n path: 'billing',\n component: OrganizationBillingComponent,\n data: { titleId: 'billingAndLicensing' },\n },\n ],\n },\n ],\n },\n { path: '**', redirectTo: '' },\n];\n\n@NgModule({\n imports: [RouterModule.forRoot(routes, {\n useHash: true,\n /*enableTracing: true,*/\n })],\n exports: [RouterModule],\n})\nexport class AppRoutingModule { }\n","export class DecryptParameters {\n encKey: T;\n data: T;\n iv: T;\n macKey: T;\n mac: T;\n macData: T;\n}\n","import * as forge from 'node-forge';\n\nimport { CryptoFunctionService } from '../abstractions/cryptoFunction.service';\nimport { PlatformUtilsService } from '../abstractions/platformUtils.service';\n\nimport { Utils } from '../misc/utils';\n\nimport { SymmetricCryptoKey } from '../models/domain';\nimport { DecryptParameters } from '../models/domain/decryptParameters';\n\nexport class WebCryptoFunctionService implements CryptoFunctionService {\n private crypto: Crypto;\n private subtle: SubtleCrypto;\n private isEdge: boolean;\n private isIE: boolean;\n\n constructor(private win: Window, private platformUtilsService: PlatformUtilsService) {\n this.crypto = typeof win.crypto !== 'undefined' ? win.crypto : null;\n this.subtle = (!!this.crypto && typeof win.crypto.subtle !== 'undefined') ? win.crypto.subtle : null;\n this.isEdge = platformUtilsService.isEdge();\n this.isIE = platformUtilsService.isIE();\n }\n\n async pbkdf2(password: string | ArrayBuffer, salt: string | ArrayBuffer, algorithm: 'sha256' | 'sha512',\n iterations: number): Promise {\n if (this.isEdge || this.isIE) {\n const forgeLen = algorithm === 'sha256' ? 32 : 64;\n const passwordBytes = this.toByteString(password);\n const saltBytes = this.toByteString(salt);\n const derivedKeyBytes = (forge as any).pbkdf2(passwordBytes, saltBytes, iterations, forgeLen, algorithm);\n return Utils.fromByteStringToArray(derivedKeyBytes).buffer;\n }\n\n const wcLen = algorithm === 'sha256' ? 256 : 512;\n const passwordBuf = this.toBuf(password);\n const saltBuf = this.toBuf(salt);\n\n const pbkdf2Params: Pbkdf2Params = {\n name: 'PBKDF2',\n salt: saltBuf,\n iterations: iterations,\n hash: { name: this.toWebCryptoAlgorithm(algorithm) },\n };\n\n const impKey = await this.subtle.importKey('raw', passwordBuf, { name: 'PBKDF2' } as any,\n false, ['deriveBits']);\n return await this.subtle.deriveBits(pbkdf2Params, impKey, wcLen);\n }\n\n async hash(value: string | ArrayBuffer, algorithm: 'sha1' | 'sha256' | 'sha512'): Promise {\n if ((this.isEdge || this.isIE) && algorithm === 'sha1') {\n const md = forge.md.sha1.create();\n const valueBytes = this.toByteString(value);\n md.update(valueBytes, 'raw');\n return Utils.fromByteStringToArray(md.digest().data).buffer;\n }\n\n const valueBuf = this.toBuf(value);\n return await this.subtle.digest({ name: this.toWebCryptoAlgorithm(algorithm) }, valueBuf);\n }\n\n async hmac(value: ArrayBuffer, key: ArrayBuffer, algorithm: 'sha1' | 'sha256' | 'sha512'): Promise {\n const signingAlgorithm = {\n name: 'HMAC',\n hash: { name: this.toWebCryptoAlgorithm(algorithm) },\n };\n\n const impKey = await this.subtle.importKey('raw', key, signingAlgorithm, false, ['sign']);\n return await this.subtle.sign(signingAlgorithm, impKey, value);\n }\n\n // Safely compare two values in a way that protects against timing attacks (Double HMAC Verification).\n // ref: https://www.nccgroup.trust/us/about-us/newsroom-and-events/blog/2011/february/double-hmac-verification/\n // ref: https://paragonie.com/blog/2015/11/preventing-timing-attacks-on-string-comparison-with-double-hmac-strategy\n async compare(a: ArrayBuffer, b: ArrayBuffer): Promise {\n const macKey = await this.randomBytes(32);\n const signingAlgorithm = {\n name: 'HMAC',\n hash: { name: 'SHA-256' },\n };\n const impKey = await this.subtle.importKey('raw', macKey, signingAlgorithm, false, ['sign']);\n const mac1 = await this.subtle.sign(signingAlgorithm, impKey, a);\n const mac2 = await this.subtle.sign(signingAlgorithm, impKey, b);\n\n if (mac1.byteLength !== mac2.byteLength) {\n return false;\n }\n\n const arr1 = new Uint8Array(mac1);\n const arr2 = new Uint8Array(mac2);\n for (let i = 0; i < arr2.length; i++) {\n if (arr1[i] !== arr2[i]) {\n return false;\n }\n }\n\n return true;\n }\n\n hmacFast(value: string, key: string, algorithm: 'sha1' | 'sha256' | 'sha512'): Promise {\n const hmac = (forge as any).hmac.create();\n hmac.start(algorithm, key);\n hmac.update(value);\n const bytes = hmac.digest().getBytes();\n return Promise.resolve(bytes);\n }\n\n async compareFast(a: string, b: string): Promise {\n const rand = await this.randomBytes(32);\n const bytes = new Uint32Array(rand);\n const buffer = forge.util.createBuffer();\n for (let i = 0; i < bytes.length; i++) {\n buffer.putInt32(bytes[i]);\n }\n const macKey = buffer.getBytes();\n\n const hmac = (forge as any).hmac.create();\n hmac.start('sha256', macKey);\n hmac.update(a);\n const mac1 = hmac.digest().getBytes();\n\n hmac.start(null, null);\n hmac.update(b);\n const mac2 = hmac.digest().getBytes();\n\n const equals = mac1 === mac2;\n return equals;\n }\n\n async aesEncrypt(data: ArrayBuffer, iv: ArrayBuffer, key: ArrayBuffer): Promise {\n const impKey = await this.subtle.importKey('raw', key, { name: 'AES-CBC' } as any, false, ['encrypt']);\n return await this.subtle.encrypt({ name: 'AES-CBC', iv: iv }, impKey, data);\n }\n\n aesDecryptFastParameters(data: string, iv: string, mac: string, key: SymmetricCryptoKey):\n DecryptParameters {\n const p = new DecryptParameters();\n if (key.meta != null) {\n p.encKey = key.meta.encKeyByteString;\n p.macKey = key.meta.macKeyByteString;\n }\n\n if (p.encKey == null) {\n p.encKey = forge.util.decode64(key.encKeyB64);\n }\n p.data = forge.util.decode64(data);\n p.iv = forge.util.decode64(iv);\n p.macData = p.iv + p.data;\n if (p.macKey == null && key.macKeyB64 != null) {\n p.macKey = forge.util.decode64(key.macKeyB64);\n }\n if (mac != null) {\n p.mac = forge.util.decode64(mac);\n }\n\n // cache byte string keys for later\n if (key.meta == null) {\n key.meta = {};\n }\n if (key.meta.encKeyByteString == null) {\n key.meta.encKeyByteString = p.encKey;\n }\n if (p.macKey != null && key.meta.macKeyByteString == null) {\n key.meta.macKeyByteString = p.macKey;\n }\n\n return p;\n }\n\n aesDecryptFast(parameters: DecryptParameters): Promise {\n const dataBuffer = (forge as any).util.createBuffer(parameters.data);\n const decipher = (forge as any).cipher.createDecipher('AES-CBC', parameters.encKey);\n decipher.start({ iv: parameters.iv });\n decipher.update(dataBuffer);\n decipher.finish();\n const val = decipher.output.toString('utf8');\n return Promise.resolve(val);\n }\n\n async aesDecrypt(data: ArrayBuffer, iv: ArrayBuffer, key: ArrayBuffer): Promise {\n const impKey = await this.subtle.importKey('raw', key, { name: 'AES-CBC' } as any, false, ['decrypt']);\n return await this.subtle.decrypt({ name: 'AES-CBC', iv: iv }, impKey, data);\n }\n\n async rsaEncrypt(data: ArrayBuffer, publicKey: ArrayBuffer, algorithm: 'sha1' | 'sha256'): Promise {\n // Note: Edge browser requires that we specify name and hash for both key import and decrypt.\n // We cannot use the proper types here.\n const rsaParams = {\n name: 'RSA-OAEP',\n hash: { name: this.toWebCryptoAlgorithm(algorithm) },\n };\n const impKey = await this.subtle.importKey('spki', publicKey, rsaParams, false, ['encrypt']);\n return await this.subtle.encrypt(rsaParams, impKey, data);\n }\n\n async rsaDecrypt(data: ArrayBuffer, privateKey: ArrayBuffer, algorithm: 'sha1' | 'sha256'): Promise {\n // Note: Edge browser requires that we specify name and hash for both key import and decrypt.\n // We cannot use the proper types here.\n const rsaParams = {\n name: 'RSA-OAEP',\n hash: { name: this.toWebCryptoAlgorithm(algorithm) },\n };\n const impKey = await this.subtle.importKey('pkcs8', privateKey, rsaParams, false, ['decrypt']);\n return await this.subtle.decrypt(rsaParams, impKey, data);\n }\n\n async rsaExtractPublicKey(privateKey: ArrayBuffer): Promise {\n const rsaParams = {\n name: 'RSA-OAEP',\n // Have to specify some algorithm\n hash: { name: this.toWebCryptoAlgorithm('sha1') },\n };\n const impPrivateKey = await this.subtle.importKey('pkcs8', privateKey, rsaParams, true, ['decrypt']);\n const jwkPrivateKey = await this.subtle.exportKey('jwk', impPrivateKey);\n const jwkPublicKeyParams = {\n kty: 'RSA',\n e: jwkPrivateKey.e,\n n: jwkPrivateKey.n,\n alg: 'RSA-OAEP',\n ext: true,\n };\n const impPublicKey = await this.subtle.importKey('jwk', jwkPublicKeyParams, rsaParams, true, ['encrypt']);\n return await this.subtle.exportKey('spki', impPublicKey);\n }\n\n async rsaGenerateKeyPair(length: 1024 | 2048 | 4096): Promise<[ArrayBuffer, ArrayBuffer]> {\n const rsaParams = {\n name: 'RSA-OAEP',\n modulusLength: length,\n publicExponent: new Uint8Array([0x01, 0x00, 0x01]), // 65537\n // Have to specify some algorithm\n hash: { name: this.toWebCryptoAlgorithm('sha1') },\n };\n const keyPair = await this.subtle.generateKey(rsaParams, true, ['encrypt', 'decrypt']);\n const publicKey = await this.subtle.exportKey('spki', keyPair.publicKey);\n const privateKey = await this.subtle.exportKey('pkcs8', keyPair.privateKey);\n return [publicKey, privateKey];\n }\n\n randomBytes(length: number): Promise {\n const arr = new Uint8Array(length);\n this.crypto.getRandomValues(arr);\n return Promise.resolve(arr.buffer);\n }\n\n private toBuf(value: string | ArrayBuffer): ArrayBuffer {\n let buf: ArrayBuffer;\n if (typeof (value) === 'string') {\n buf = Utils.fromUtf8ToArray(value).buffer;\n } else {\n buf = value;\n }\n return buf;\n }\n\n private toByteString(value: string | ArrayBuffer): string {\n let bytes: string;\n if (typeof (value) === 'string') {\n bytes = forge.util.encodeUtf8(value);\n } else {\n bytes = Utils.fromBufferToByteString(value);\n }\n return bytes;\n }\n\n private toWebCryptoAlgorithm(algorithm: 'sha1' | 'sha256' | 'sha512'): string {\n return algorithm === 'sha1' ? 'SHA-1' : algorithm === 'sha256' ? 'SHA-256' : 'SHA-512';\n }\n}\n","import * as papa from 'papaparse';\n\nimport { CipherType } from '../enums/cipherType';\n\nimport { ApiService } from '../abstractions/api.service';\nimport { CipherService } from '../abstractions/cipher.service';\nimport { ExportService as ExportServiceAbstraction } from '../abstractions/export.service';\nimport { FolderService } from '../abstractions/folder.service';\n\nimport { CipherView } from '../models/view/cipherView';\nimport { CollectionView } from '../models/view/collectionView';\nimport { FolderView } from '../models/view/folderView';\n\nimport { Cipher } from '../models/domain/cipher';\nimport { Collection } from '../models/domain/collection';\n\nimport { CipherData } from '../models/data/cipherData';\nimport { CollectionData } from '../models/data/collectionData';\nimport { CollectionDetailsResponse } from '../models/response/collectionResponse';\n\nexport class ExportService implements ExportServiceAbstraction {\n constructor(private folderService: FolderService, private cipherService: CipherService,\n private apiService: ApiService) { }\n\n async getExport(format: 'csv' | 'json' = 'csv'): Promise {\n let decFolders: FolderView[] = [];\n let decCiphers: CipherView[] = [];\n const promises = [];\n\n promises.push(this.folderService.getAllDecrypted().then((folders) => {\n decFolders = folders;\n }));\n\n promises.push(this.cipherService.getAllDecrypted().then((ciphers) => {\n decCiphers = ciphers;\n }));\n\n await Promise.all(promises);\n\n const foldersMap = new Map();\n decFolders.forEach((f) => {\n foldersMap.set(f.id, f);\n });\n\n const exportCiphers: any[] = [];\n decCiphers.forEach((c) => {\n // only export logins and secure notes\n if (c.type !== CipherType.Login && c.type !== CipherType.SecureNote) {\n return;\n }\n\n if (c.organizationId != null) {\n return;\n }\n\n const cipher: any = {};\n cipher.folder = c.folderId != null && foldersMap.has(c.folderId) ? foldersMap.get(c.folderId).name : null;\n cipher.favorite = c.favorite ? 1 : null;\n this.buildCommonCipher(cipher, c);\n exportCiphers.push(cipher);\n });\n\n if (format === 'csv') {\n return papa.unparse(exportCiphers);\n } else {\n return JSON.stringify(exportCiphers, null, ' ');\n }\n }\n\n async getOrganizationExport(organizationId: string, format: 'csv' | 'json' = 'csv'): Promise {\n const decCollections: CollectionView[] = [];\n const decCiphers: CipherView[] = [];\n const promises = [];\n\n promises.push(this.apiService.getCollections(organizationId).then((collections) => {\n const collectionPromises: any = [];\n if (collections != null && collections.data != null && collections.data.length > 0) {\n collections.data.forEach((c) => {\n const collection = new Collection(new CollectionData(c as CollectionDetailsResponse));\n collectionPromises.push(collection.decrypt().then((decCol) => {\n decCollections.push(decCol);\n }));\n });\n }\n return Promise.all(collectionPromises);\n }));\n\n promises.push(this.apiService.getCiphersOrganization(organizationId).then((ciphers) => {\n const cipherPromises: any = [];\n if (ciphers != null && ciphers.data != null && ciphers.data.length > 0) {\n ciphers.data.forEach((c) => {\n const cipher = new Cipher(new CipherData(c));\n cipherPromises.push(cipher.decrypt().then((decCipher) => {\n decCiphers.push(decCipher);\n }));\n });\n }\n return Promise.all(cipherPromises);\n }));\n\n await Promise.all(promises);\n\n const collectionsMap = new Map();\n decCollections.forEach((c) => {\n collectionsMap.set(c.id, c);\n });\n\n const exportCiphers: any[] = [];\n decCiphers.forEach((c) => {\n // only export logins and secure notes\n if (c.type !== CipherType.Login && c.type !== CipherType.SecureNote) {\n return;\n }\n\n const cipher: any = {};\n cipher.collections = [];\n if (c.collectionIds != null) {\n cipher.collections = c.collectionIds.filter((id) => collectionsMap.has(id))\n .map((id) => collectionsMap.get(id).name);\n }\n this.buildCommonCipher(cipher, c);\n exportCiphers.push(cipher);\n });\n\n if (format === 'csv') {\n return papa.unparse(exportCiphers);\n } else {\n return JSON.stringify(exportCiphers, null, ' ');\n }\n }\n\n getFileName(prefix: string = null): string {\n const now = new Date();\n const dateString =\n now.getFullYear() + '' + this.padNumber(now.getMonth() + 1, 2) + '' + this.padNumber(now.getDate(), 2) +\n this.padNumber(now.getHours(), 2) + '' + this.padNumber(now.getMinutes(), 2) +\n this.padNumber(now.getSeconds(), 2);\n\n return 'bitwarden' + (prefix ? ('_' + prefix) : '') + '_export_' + dateString + '.csv';\n }\n\n private padNumber(num: number, width: number, padCharacter: string = '0'): string {\n const numString = num.toString();\n return numString.length >= width ? numString :\n new Array(width - numString.length + 1).join(padCharacter) + numString;\n }\n\n private buildCommonCipher(cipher: any, c: CipherView) {\n cipher.type = null;\n cipher.name = c.name;\n cipher.notes = c.notes;\n cipher.fields = null;\n // Login props\n cipher.login_uri = null;\n cipher.login_username = null;\n cipher.login_password = null;\n cipher.login_totp = null;\n\n if (c.fields) {\n c.fields.forEach((f: any) => {\n if (!cipher.fields) {\n cipher.fields = '';\n } else {\n cipher.fields += '\\n';\n }\n\n cipher.fields += ((f.name || '') + ': ' + f.value);\n });\n }\n\n switch (c.type) {\n case CipherType.Login:\n cipher.type = 'login';\n cipher.login_username = c.login.username;\n cipher.login_password = c.login.password;\n cipher.login_totp = c.login.totp;\n\n if (c.login.uris) {\n cipher.login_uri = [];\n c.login.uris.forEach((u) => {\n cipher.login_uri.push(u.uri);\n });\n }\n break;\n case CipherType.SecureNote:\n cipher.type = 'note';\n break;\n default:\n return;\n }\n\n return cipher;\n }\n}\n","import { AppIdService } from '../abstractions/appId.service';\nimport { PlatformUtilsService } from '../abstractions/platformUtils.service';\nimport { StorageService } from '../abstractions/storage.service';\n\nimport { ConstantsService } from '../services/constants.service';\n\nimport { DeviceType } from '../enums/deviceType';\n\nconst GaObj = 'ga';\n\nexport const AnalyticsIds = {\n [DeviceType.ChromeExtension]: 'UA-81915606-6',\n [DeviceType.FirefoxExtension]: 'UA-81915606-7',\n [DeviceType.OperaExtension]: 'UA-81915606-8',\n [DeviceType.EdgeExtension]: 'UA-81915606-9',\n [DeviceType.VivaldiExtension]: 'UA-81915606-15',\n [DeviceType.SafariExtension]: 'UA-81915606-16',\n [DeviceType.WindowsDesktop]: 'UA-81915606-17',\n [DeviceType.LinuxDesktop]: 'UA-81915606-19',\n [DeviceType.MacOsDesktop]: 'UA-81915606-18',\n};\n\nexport class Analytics {\n private gaTrackingId: string = null;\n private defaultDisabled = false;\n private appVersion: string;\n\n constructor(win: Window, private gaFilter?: () => boolean,\n private platformUtilsService?: PlatformUtilsService, private storageService?: StorageService,\n private appIdService?: AppIdService, private dependencyResolver?: () => any) {\n if (dependencyResolver != null) {\n const deps = dependencyResolver();\n if (platformUtilsService == null && deps.platformUtilsService) {\n this.platformUtilsService = deps.platformUtilsService as PlatformUtilsService;\n }\n if (storageService == null && deps.storageService) {\n this.storageService = deps.storageService as StorageService;\n }\n if (appIdService == null && deps.appIdService) {\n this.appIdService = deps.appIdService as AppIdService;\n }\n }\n\n this.appVersion = this.platformUtilsService.getApplicationVersion();\n this.defaultDisabled = this.platformUtilsService.getDevice() === DeviceType.FirefoxExtension ||\n this.platformUtilsService.isMacAppStore();\n this.gaTrackingId = this.platformUtilsService.analyticsId();\n\n (win as any).GoogleAnalyticsObject = GaObj;\n (win as any)[GaObj] = async (action: string, param1: any, param2?: any) => {\n await this.ga(action, param1, param2);\n };\n }\n\n async ga(action: string, param1: any, param2?: any) {\n if (this.gaFilter != null && this.gaFilter()) {\n return;\n }\n\n const disabled = await this.storageService.get(ConstantsService.disableGaKey);\n if ((this.defaultDisabled && disabled == null) || disabled != null && disabled) {\n return;\n }\n\n if (action !== 'send' || !param1) {\n return;\n }\n\n const gaAnonAppId = await this.appIdService.getAnonymousAppId();\n const version = encodeURIComponent(this.appVersion);\n let message = 'v=1&tid=' + this.gaTrackingId + '&cid=' + gaAnonAppId + '&cd1=' + version;\n\n if (param1 === 'pageview' && param2) {\n message += this.gaTrackPageView(param2);\n } else if (typeof param1 === 'object' && param1.hitType === 'pageview') {\n message += this.gaTrackPageView(param1.page);\n } else if (param1 === 'event' && param2) {\n message += this.gaTrackEvent(param2);\n } else if (typeof param1 === 'object' && param1.hitType === 'event') {\n message += this.gaTrackEvent(param1);\n }\n\n const request = new XMLHttpRequest();\n request.open('POST', 'https://www.google-analytics.com/collect', true);\n request.send(message);\n }\n\n private gaTrackEvent(options: any) {\n return '&t=event&ec=' + (options.eventCategory ? encodeURIComponent(options.eventCategory) : 'Event') +\n '&ea=' + encodeURIComponent(options.eventAction) +\n (options.eventLabel ? '&el=' + encodeURIComponent(options.eventLabel) : '') +\n (options.eventValue ? '&ev=' + encodeURIComponent(options.eventValue) : '') +\n (options.page ? '&dp=' + this.cleanPagePath(options.page) : '');\n }\n\n private gaTrackPageView(pagePath: string) {\n return '&t=pageview&dp=' + this.cleanPagePath(pagePath);\n }\n\n private cleanPagePath(pagePath: string) {\n const paramIndex = pagePath.indexOf('?');\n if (paramIndex > -1) {\n pagePath = pagePath.substring(0, paramIndex);\n }\n if (pagePath.indexOf('!/') === 0 || pagePath.indexOf('#/') === 0) {\n pagePath = pagePath.substring(1);\n }\n const pathParts = pagePath.split('/');\n const newPathParts: string[] = [];\n pathParts.forEach((p) => {\n if (p.match(/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i)) {\n newPathParts.push('__guid__');\n } else {\n newPathParts.push(p);\n }\n });\n return encodeURIComponent(newPathParts.join('/'));\n }\n}\n","import * as _swal from 'sweetalert';\nimport { SweetAlert } from 'sweetalert/typings/core';\n\nimport { DeviceType } from 'jslib/enums/deviceType';\n\nimport { I18nService } from 'jslib/abstractions/i18n.service';\nimport { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';\n\nimport { Utils } from 'jslib/misc/utils';\n\n// Hack due to Angular 5.2 bug\nconst swal: SweetAlert = _swal as any;\n\nexport class WebPlatformUtilsService implements PlatformUtilsService {\n identityClientId: string = 'web';\n\n private browserCache: DeviceType = null;\n\n constructor(private i18nService: I18nService) { }\n\n getDevice(): DeviceType {\n if (this.browserCache != null) {\n return this.browserCache;\n }\n\n if (navigator.userAgent.indexOf(' Firefox/') !== -1 || navigator.userAgent.indexOf(' Gecko/') !== -1) {\n this.browserCache = DeviceType.FirefoxBrowser;\n } else if (navigator.userAgent.indexOf(' OPR/') >= 0) {\n this.browserCache = DeviceType.OperaBrowser;\n } else if (navigator.userAgent.indexOf(' Edge/') !== -1) {\n this.browserCache = DeviceType.EdgeBrowser;\n } else if (navigator.userAgent.indexOf(' Vivaldi/') !== -1) {\n this.browserCache = DeviceType.VivaldiBrowser;\n } else if (navigator.userAgent.indexOf(' Safari/') !== -1 && navigator.userAgent.indexOf('Chrome') === -1) {\n this.browserCache = DeviceType.SafariBrowser;\n } else if ((window as any).chrome && navigator.userAgent.indexOf(' Chrome/') !== -1) {\n this.browserCache = DeviceType.ChromeBrowser;\n } else if (navigator.userAgent.indexOf(' Trident/') !== -1) {\n this.browserCache = DeviceType.IEBrowser;\n } else {\n this.browserCache = DeviceType.UnknownBrowser;\n }\n\n return this.browserCache;\n }\n\n getDeviceString(): string {\n const device = DeviceType[this.getDevice()].toLowerCase();\n return device.replace('browser', '');\n }\n\n isFirefox(): boolean {\n return this.getDevice() === DeviceType.FirefoxBrowser;\n }\n\n isChrome(): boolean {\n return this.getDevice() === DeviceType.ChromeBrowser;\n }\n\n isEdge(): boolean {\n return this.getDevice() === DeviceType.EdgeBrowser;\n }\n\n isOpera(): boolean {\n return this.getDevice() === DeviceType.OperaBrowser;\n }\n\n isVivaldi(): boolean {\n return this.getDevice() === DeviceType.VivaldiBrowser;\n }\n\n isSafari(): boolean {\n return this.getDevice() === DeviceType.SafariBrowser;\n }\n\n isIE(): boolean {\n return this.getDevice() === DeviceType.IEBrowser;\n }\n\n isMacAppStore(): boolean {\n return false;\n }\n\n analyticsId(): string {\n return 'UA-81915606-3';\n }\n\n getDomain(uriString: string): string {\n return Utils.getHostname(uriString);\n }\n\n isViewOpen(): boolean {\n return false;\n }\n\n lockTimeout(): number {\n return 15;\n }\n\n launchUri(uri: string, options?: any): void {\n const a = document.createElement('a');\n a.href = uri;\n a.target = '_blank';\n a.rel = 'noreferrer noopener';\n a.classList.add('d-none');\n document.body.appendChild(a);\n a.click();\n document.body.removeChild(a);\n }\n\n saveFile(win: Window, blobData: any, blobOptions: any, fileName: string): void {\n let blob: Blob = null;\n if (blobOptions != null && !this.isIE()) {\n blob = new Blob([blobData], blobOptions);\n } else {\n blob = new Blob([blobData]);\n }\n if (navigator.msSaveOrOpenBlob) {\n navigator.msSaveBlob(blob, fileName);\n } else {\n const a = win.document.createElement('a');\n a.href = win.URL.createObjectURL(blob);\n a.download = fileName;\n a.style.position = 'fixed';\n win.document.body.appendChild(a);\n a.click();\n win.document.body.removeChild(a);\n }\n }\n\n getApplicationVersion(): string {\n return process.env.APPLICATION_VERSION || '-';\n }\n\n supportsU2f(win: Window): boolean {\n if (win != null && (win as any).u2f != null) {\n return true;\n }\n return (this.isChrome() || this.isOpera() || this.isVivaldi()) && !this.isMobile(win);\n }\n\n supportsDuo(): boolean {\n return true;\n }\n\n showToast(type: 'error' | 'success' | 'warning' | 'info', title: string, text: string, global?: any): void {\n throw new Error('showToast not implemented');\n }\n\n async showDialog(text: string, title?: string, confirmText?: string, cancelText?: string, type?: string) {\n const buttons = [confirmText == null ? this.i18nService.t('ok') : confirmText];\n if (cancelText != null) {\n buttons.unshift(cancelText);\n }\n\n const contentDiv = document.createElement('div');\n if (type != null) {\n const icon = document.createElement('i');\n icon.classList.add('swal-custom-icon');\n switch (type) {\n case 'success':\n icon.classList.add('fa', 'fa-check', 'text-success');\n break;\n case 'warning':\n icon.classList.add('fa', 'fa-warning', 'text-warning');\n break;\n case 'error':\n icon.classList.add('fa', 'fa-bolt', 'text-danger');\n break;\n case 'info':\n icon.classList.add('fa', 'fa-info-circle', 'text-info');\n break;\n default:\n break;\n }\n if (icon.classList.contains('fa')) {\n contentDiv.appendChild(icon);\n }\n }\n\n if (title != null) {\n const titleDiv = document.createElement('div');\n titleDiv.classList.add('swal-title');\n titleDiv.appendChild(document.createTextNode(title));\n contentDiv.appendChild(titleDiv);\n }\n\n if (text != null) {\n const textDiv = document.createElement('div');\n textDiv.classList.add('swal-text');\n textDiv.appendChild(document.createTextNode(text));\n contentDiv.appendChild(textDiv);\n }\n\n const confirmed = await swal({\n content: { element: contentDiv },\n buttons: buttons,\n });\n return confirmed;\n }\n\n isDev(): boolean {\n return process.env.ENV === 'development';\n }\n\n isSelfHost(): boolean {\n return process.env.SELF_HOST.toString() === 'true';\n }\n\n copyToClipboard(text: string, options?: any): void {\n const doc = options ? options.doc : window.document;\n if ((window as any).clipboardData && (window as any).clipboardData.setData) {\n // IE specific code path to prevent textarea being shown while dialog is visible.\n (window as any).clipboardData.setData('Text', text);\n } else if (doc.queryCommandSupported && doc.queryCommandSupported('copy')) {\n const textarea = doc.createElement('textarea');\n textarea.textContent = text;\n // Prevent scrolling to bottom of page in MS Edge.\n textarea.style.position = 'fixed';\n doc.body.appendChild(textarea);\n textarea.select();\n\n try {\n // Security exception may be thrown by some browsers.\n doc.execCommand('copy');\n } catch (e) {\n // tslint:disable-next-line\n console.warn('Copy to clipboard failed.', e);\n } finally {\n doc.body.removeChild(textarea);\n }\n }\n }\n\n private isMobile(win: Window) {\n let mobile = false;\n ((a) => {\n // tslint:disable-next-line\n if (/(android|bb\\d+|meego).+mobile|avantgo|bada\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\\-(n|u)|c55\\/|capi|ccwa|cdm\\-|cell|chtm|cldc|cmd\\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\\-s|devi|dica|dmob|do(c|p)o|ds(12|\\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\\-|_)|g1 u|g560|gene|gf\\-5|g\\-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd\\-(m|p|t)|hei\\-|hi(pt|ta)|hp( i|ip)|hs\\-c|ht(c(\\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\\-(20|go|ma)|i230|iac( |\\-|\\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\\/)|klon|kpt |kwc\\-|kyo(c|k)|le(no|xi)|lg( g|\\/(k|l|u)|50|54|\\-[a-w])|libw|lynx|m1\\-w|m3ga|m50\\/|ma(te|ui|xo)|mc(01|21|ca)|m\\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\\-2|po(ck|rt|se)|prox|psio|pt\\-g|qa\\-a|qc(07|12|21|32|60|\\-[2-7]|i\\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\\-|oo|p\\-)|sdk\\/|se(c(\\-|0|1)|47|mc|nd|ri)|sgh\\-|shar|sie(\\-|m)|sk\\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\\-|v\\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\\-|tdg\\-|tel(i|m)|tim\\-|t\\-mo|to(pl|sh)|ts(70|m\\-|m3|m5)|tx\\-9|up(\\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\\-|your|zeto|zte\\-/i.test(a.substr(0, 4))) {\n mobile = true;\n }\n })(win.navigator.userAgent || win.navigator.vendor || (win as any).opera);\n\n return mobile || win.navigator.userAgent.match(/iPad/i) != null;\n }\n}\n","import { StorageService } from 'jslib/abstractions/storage.service';\r\n\r\nexport class MemoryStorageService implements StorageService {\r\n private store = new Map();\r\n\r\n get(key: string): Promise {\r\n if (this.store.has(key)) {\r\n const obj = this.store.get(key);\r\n return Promise.resolve(obj as T);\r\n }\r\n return Promise.resolve(null);\r\n }\r\n\r\n save(key: string, obj: any): Promise {\r\n if (obj == null) {\r\n return this.remove(key);\r\n }\r\n this.store.set(key, obj);\r\n return Promise.resolve();\r\n }\r\n\r\n remove(key: string): Promise {\r\n this.store.delete(key);\r\n return Promise.resolve();\r\n }\r\n}\r\n","import { I18nService as BaseI18nService } from 'jslib/services/i18n.service';\n\nexport class I18nService extends BaseI18nService {\n constructor(systemLanguage: string, localesDirectory: string) {\n super(systemLanguage || 'en-US', localesDirectory, async (formattedLocale: string) => {\n const filePath = this.localesDirectory + '/' + formattedLocale + '/messages.json?cache=' +\n process.env.CACHE_TAG;\n const localesResult = await fetch(filePath);\n const locales = await localesResult.json();\n return locales;\n });\n\n this.supportedTranslationLocales = [\n 'en', 'da', 'sk',\n ];\n }\n}\n","import { OrganizationData } from '../data/organizationData';\n\nimport { OrganizationUserStatusType } from '../../enums/organizationUserStatusType';\nimport { OrganizationUserType } from '../../enums/organizationUserType';\n\nexport class Organization {\n id: string;\n name: string;\n status: OrganizationUserStatusType;\n type: OrganizationUserType;\n enabled: boolean;\n useGroups: boolean;\n useDirectory: boolean;\n useEvents: boolean;\n useTotp: boolean;\n use2fa: boolean;\n selfHost: boolean;\n usersGetPremium: boolean;\n seats: number;\n maxCollections: number;\n maxStorageGb?: number;\n\n constructor(obj?: OrganizationData) {\n if (obj == null) {\n return;\n }\n\n this.id = obj.id;\n this.name = obj.name;\n this.status = obj.status;\n this.type = obj.type;\n this.enabled = obj.enabled;\n this.useGroups = obj.useGroups;\n this.useDirectory = obj.useDirectory;\n this.useEvents = obj.useEvents;\n this.useTotp = obj.useTotp;\n this.use2fa = obj.use2fa;\n this.selfHost = obj.selfHost;\n this.usersGetPremium = obj.usersGetPremium;\n this.seats = obj.seats;\n this.maxCollections = obj.maxCollections;\n this.maxStorageGb = obj.maxStorageGb;\n }\n\n get canAccess() {\n if (this.type === OrganizationUserType.Owner) {\n return true;\n }\n return this.enabled && this.status === OrganizationUserStatusType.Confirmed;\n }\n\n get isAdmin() {\n return this.type === OrganizationUserType.Owner || this.type === OrganizationUserType.Admin;\n }\n\n get isOwner() {\n return this.type === OrganizationUserType.Owner;\n }\n}\n","import { ProfileOrganizationResponse } from '../response/profileOrganizationResponse';\n\nimport { OrganizationUserStatusType } from '../../enums/organizationUserStatusType';\nimport { OrganizationUserType } from '../../enums/organizationUserType';\n\nexport class OrganizationData {\n id: string;\n name: string;\n status: OrganizationUserStatusType;\n type: OrganizationUserType;\n enabled: boolean;\n useGroups: boolean;\n useDirectory: boolean;\n useEvents: boolean;\n useTotp: boolean;\n use2fa: boolean;\n selfHost: boolean;\n usersGetPremium: boolean;\n seats: number;\n maxCollections: number;\n maxStorageGb?: number;\n\n constructor(response: ProfileOrganizationResponse) {\n this.id = response.id;\n this.name = response.name;\n this.status = response.status;\n this.type = response.type;\n this.enabled = response.enabled;\n this.useGroups = response.useGroups;\n this.useDirectory = response.useDirectory;\n this.useEvents = response.useEvents;\n this.useTotp = response.useTotp;\n this.use2fa = response.use2fa;\n this.selfHost = response.selfHost;\n this.usersGetPremium = response.usersGetPremium;\n this.seats = response.seats;\n this.maxCollections = response.maxCollections;\n this.maxStorageGb = response.maxStorageGb;\n }\n}\n","export class PasswordHistory {\r\n password: string;\r\n date: number;\r\n\r\n constructor(password: string, date: number) {\r\n this.password = password;\r\n this.date = date;\r\n }\r\n}\r\n","import { FolderData } from '../data/folderData';\r\n\r\nimport { FolderView } from '../view/folderView';\r\n\r\nimport { CipherString } from './cipherString';\r\nimport Domain from './domain';\r\n\r\nexport class Folder extends Domain {\r\n id: string;\r\n name: CipherString;\r\n\r\n constructor(obj?: FolderData, alreadyEncrypted: boolean = false) {\r\n super();\r\n if (obj == null) {\r\n return;\r\n }\r\n\r\n this.buildDomainModel(this, obj, {\r\n id: null,\r\n name: null,\r\n }, alreadyEncrypted, ['id']);\r\n }\r\n\r\n decrypt(): Promise {\r\n return this.decryptObj(new FolderView(this), {\r\n name: null,\r\n }, null);\r\n }\r\n}\r\n","export class EnvironmentUrls {\r\n base: string;\r\n api: string;\r\n identity: string;\r\n}\r\n","/**\r\n * Use as a Decorator on async functions, it will prevent multiple 'active' calls as the same time\r\n *\r\n * If a promise was returned from a previous call to this function, that hasn't yet resolved it will\r\n * be returned, instead of calling the original function again\r\n *\r\n * Results are not cached, once the promise has returned, the next call will result in a fresh call\r\n *\r\n * WARNING: The decorator's scope is singleton, so using it on transient objects can lead to memory leaks.\r\n * Read more at https://github.com/bitwarden/jslib/pull/7\r\n */\r\nexport function sequentialize(cacheKey: (args: any[]) => string) {\r\n return (target: any, propertyKey: string | symbol, descriptor: PropertyDescriptor) => {\r\n const originalMethod: () => Promise = descriptor.value;\r\n const caches = new Map>>();\r\n\r\n const getCache = (obj: any) => {\r\n let cache = caches.get(obj);\r\n if (cache != null) {\r\n return cache;\r\n }\r\n cache = new Map>();\r\n caches.set(obj, cache);\r\n return cache;\r\n };\r\n\r\n return {\r\n value: function(...args: any[]) {\r\n const argsCacheKey = cacheKey(args);\r\n const cache = getCache(this);\r\n let response = cache.get(argsCacheKey);\r\n if (response != null) {\r\n return response;\r\n }\r\n\r\n response = originalMethod.apply(this, args).then((val: any) => {\r\n cache.delete(argsCacheKey);\r\n return val;\r\n }).catch((err: any) => {\r\n cache.delete(argsCacheKey);\r\n throw err;\r\n });\r\n\r\n cache.set(argsCacheKey, response);\r\n return response;\r\n },\r\n };\r\n };\r\n}\r\n","import { EncryptionType } from '../../enums/encryptionType';\n\nimport { Utils } from '../../misc/utils';\n\nexport class SymmetricCryptoKey {\n key: ArrayBuffer;\n encKey?: ArrayBuffer;\n macKey?: ArrayBuffer;\n encType: EncryptionType;\n\n keyB64: string;\n encKeyB64: string;\n macKeyB64: string;\n\n meta: any;\n\n constructor(key: ArrayBuffer, encType?: EncryptionType) {\n if (key == null) {\n throw new Error('Must provide key');\n }\n\n if (encType == null) {\n if (key.byteLength === 32) {\n encType = EncryptionType.AesCbc256_B64;\n } else if (key.byteLength === 64) {\n encType = EncryptionType.AesCbc256_HmacSha256_B64;\n } else {\n throw new Error('Unable to determine encType.');\n }\n }\n\n this.key = key;\n this.encType = encType;\n\n if (encType === EncryptionType.AesCbc256_B64 && key.byteLength === 32) {\n this.encKey = key;\n this.macKey = null;\n } else if (encType === EncryptionType.AesCbc128_HmacSha256_B64 && key.byteLength === 32) {\n this.encKey = key.slice(0, 16);\n this.macKey = key.slice(16, 32);\n } else if (encType === EncryptionType.AesCbc256_HmacSha256_B64 && key.byteLength === 64) {\n this.encKey = key.slice(0, 32);\n this.macKey = key.slice(32, 64);\n } else {\n throw new Error('Unsupported encType/key length.');\n }\n\n if (this.key != null) {\n this.keyB64 = Utils.fromBufferToB64(this.key);\n }\n if (this.encKey != null) {\n this.encKeyB64 = Utils.fromBufferToB64(this.encKey);\n }\n if (this.macKey != null) {\n this.macKeyB64 = Utils.fromBufferToB64(this.macKey);\n }\n }\n}\n","import { SymmetricCryptoKey } from './symmetricCryptoKey';\n\nexport class EncryptedObject {\n iv: ArrayBuffer;\n data: ArrayBuffer;\n mac: ArrayBuffer;\n key: SymmetricCryptoKey;\n}\n","import { CipherRequest } from './cipherRequest';\n\nimport { Cipher } from '../domain/cipher';\n\nexport class CipherShareRequest {\n cipher: CipherRequest;\n collectionIds: string[];\n\n constructor(cipher: Cipher) {\n this.cipher = new CipherRequest(cipher);\n this.collectionIds = cipher.collectionIds;\n }\n}\n","import { CipherWithIdRequest } from './cipherWithIdRequest';\n\nimport { Cipher } from '../domain/cipher';\n\nexport class CipherBulkShareRequest {\n ciphers: CipherWithIdRequest[];\n collectionIds: string[];\n\n constructor(ciphers: Cipher[], collectionIds: string[]) {\n if (ciphers != null) {\n this.ciphers = [];\n ciphers.forEach((c) => {\n this.ciphers.push(new CipherWithIdRequest(c));\n });\n }\n this.collectionIds = collectionIds;\n }\n}\n","export class CipherBulkMoveRequest {\n ids: string[];\n folderId: string;\n\n constructor(ids: string[], folderId: string) {\n this.ids = ids == null ? [] : ids;\n this.folderId = folderId;\n }\n}\n","export class CipherBulkDeleteRequest {\n ids: string[];\n\n constructor(ids: string[]) {\n this.ids = ids == null ? [] : ids;\n }\n}\n","export class BreachAccountResponse {\n addedDate: Date;\n breachDate: Date;\n dataClasses: string[];\n description: string;\n domain: string;\n isActive: boolean;\n isVerified: boolean;\n logoType: string;\n modifiedDate: Date;\n name: string;\n pwnCount: number;\n title: string;\n\n constructor(response: any) {\n this.addedDate = response.AddedDate;\n this.breachDate = response.BreachDate;\n this.dataClasses = response.DataClasses;\n this.description = response.Description;\n this.domain = response.Domain;\n this.isActive = response.IsActive;\n this.isVerified = response.IsVerified;\n this.logoType = response.LogoType;\n this.modifiedDate = response.ModifiedDate;\n this.name = response.Name;\n this.pwnCount = response.PwnCount;\n this.title = response.Title;\n }\n}\n","export class UserKeyResponse {\n userId: string;\n publicKey: string;\n\n constructor(response: any) {\n this.userId = response.UserId;\n this.publicKey = response.PublicKey;\n }\n}\n","export class TwoFactorYubiKeyResponse {\n enabled: boolean;\n key1: string;\n key2: string;\n key3: string;\n key4: string;\n key5: string;\n nfc: boolean;\n\n constructor(response: any) {\n this.enabled = response.Enabled;\n this.key1 = response.Key1;\n this.key2 = response.Key2;\n this.key3 = response.Key3;\n this.key4 = response.Key4;\n this.key5 = response.Key5;\n this.nfc = response.Nfc;\n }\n}\n","export class TwoFactorU2fResponse {\r\n enabled: boolean;\r\n challenge: ChallengeResponse;\r\n\r\n constructor(response: any) {\r\n this.enabled = response.Enabled;\r\n this.challenge = response.Challenge == null ? null : new ChallengeResponse(response.Challenge);\r\n }\r\n}\r\n\r\nexport class ChallengeResponse {\r\n userId: string;\r\n appId: string;\r\n challenge: string;\r\n version: string;\r\n\r\n constructor(response: any) {\r\n this.userId = response.UserId;\r\n this.appId = response.AppId;\r\n this.challenge = response.Challenge;\r\n this.version = response.Version;\r\n }\r\n}\r\n","export class TwoFactorRecoverResponse {\n code: string;\n\n constructor(response: any) {\n this.code = response.Code;\n }\n}\n","import { TwoFactorProviderType } from '../../enums/twoFactorProviderType';\n\nexport class TwoFactorProviderResponse {\n enabled: boolean;\n type: TwoFactorProviderType;\n\n constructor(response: any) {\n this.enabled = response.Enabled;\n this.type = response.Type;\n }\n}\n","export class TwoFactorEmailResponse {\n enabled: boolean;\n email: string;\n\n constructor(response: any) {\n this.enabled = response.Enabled;\n this.email = response.Email;\n }\n}\n","export class TwoFactorDuoResponse {\n enabled: boolean;\n host: string;\n secretKey: string;\n integrationKey: string;\n\n constructor(response: any) {\n this.enabled = response.Enabled;\n this.host = response.Host;\n this.secretKey = response.SecretKey;\n this.integrationKey = response.IntegrationKey;\n }\n}\n","export class TwoFactorAuthenticatorResponse {\n enabled: boolean;\n key: string;\n\n constructor(response: any) {\n this.enabled = response.Enabled;\n this.key = response.Key;\n }\n}\n","import { CipherResponse } from './cipherResponse';\nimport { CollectionDetailsResponse } from './collectionResponse';\nimport { DomainsResponse } from './domainsResponse';\nimport { FolderResponse } from './folderResponse';\nimport { ProfileResponse } from './profileResponse';\n\nexport class SyncResponse {\n profile?: ProfileResponse;\n folders: FolderResponse[] = [];\n collections: CollectionDetailsResponse[] = [];\n ciphers: CipherResponse[] = [];\n domains?: DomainsResponse;\n\n constructor(response: any) {\n if (response.Profile) {\n this.profile = new ProfileResponse(response.Profile);\n }\n\n if (response.Folders) {\n response.Folders.forEach((folder: any) => {\n this.folders.push(new FolderResponse(folder));\n });\n }\n\n if (response.Collections) {\n response.Collections.forEach((collection: any) => {\n this.collections.push(new CollectionDetailsResponse(collection));\n });\n }\n\n if (response.Ciphers) {\n response.Ciphers.forEach((cipher: any) => {\n this.ciphers.push(new CipherResponse(cipher));\n });\n }\n\n if (response.Domains) {\n this.domains = new DomainsResponse(response.Domains);\n }\n }\n}\n","import { OrganizationUserStatusType } from '../../enums/organizationUserStatusType';\nimport { OrganizationUserType } from '../../enums/organizationUserType';\n\nexport class ProfileOrganizationResponse {\n id: string;\n name: string;\n useGroups: boolean;\n useDirectory: boolean;\n useEvents: boolean;\n useTotp: boolean;\n use2fa: boolean;\n selfHost: boolean;\n usersGetPremium: boolean;\n seats: number;\n maxCollections: number;\n maxStorageGb?: number;\n key: string;\n status: OrganizationUserStatusType;\n type: OrganizationUserType;\n enabled: boolean;\n\n constructor(response: any) {\n this.id = response.Id;\n this.name = response.Name;\n this.useGroups = response.UseGroups;\n this.useDirectory = response.UseDirectory;\n this.useEvents = response.UseEvents;\n this.useTotp = response.UseTotp;\n this.use2fa = response.Use2fa;\n this.selfHost = response.SelfHost;\n this.usersGetPremium = response.UsersGetPremium;\n this.seats = response.Seats;\n this.maxCollections = response.MaxCollections;\n this.maxStorageGb = response.MaxStorageGb;\n this.key = response.Key;\n this.status = response.Status;\n this.type = response.Type;\n this.enabled = response.Enabled;\n }\n}\n","import { OrganizationUserStatusType } from '../../enums/organizationUserStatusType';\nimport { OrganizationUserType } from '../../enums/organizationUserType';\nimport { SelectionReadOnlyResponse } from './selectionReadOnlyResponse';\n\nexport class OrganizationUserResponse {\n id: string;\n userId: string;\n type: OrganizationUserType;\n status: OrganizationUserStatusType;\n accessAll: boolean;\n\n constructor(response: any) {\n this.id = response.Id;\n this.userId = response.UserId;\n this.type = response.Type;\n this.status = response.Status;\n this.accessAll = response.AccessAll;\n }\n}\n\nexport class OrganizationUserUserDetailsResponse extends OrganizationUserResponse {\n name: string;\n email: string;\n\n constructor(response: any) {\n super(response);\n this.name = response.Name;\n this.email = response.Email;\n }\n}\n\nexport class OrganizationUserDetailsResponse extends OrganizationUserResponse {\n collections: SelectionReadOnlyResponse[] = [];\n\n constructor(response: any) {\n super(response);\n if (response.Collections != null) {\n this.collections = response.Collections.map((c: any) => new SelectionReadOnlyResponse(c));\n }\n }\n}\n","import {\n BillingChargeResponse,\n BillingInvoiceResponse,\n BillingSourceResponse,\n BillingSubscriptionResponse,\n} from './billingResponse';\nimport { OrganizationResponse } from './organizationResponse';\n\nexport class OrganizationBillingResponse extends OrganizationResponse {\n storageName: string;\n storageGb: number;\n paymentSource: BillingSourceResponse;\n subscription: BillingSubscriptionResponse;\n upcomingInvoice: BillingInvoiceResponse;\n charges: BillingChargeResponse[] = [];\n expiration: Date;\n\n constructor(response: any) {\n super(response);\n this.storageName = response.StorageName;\n this.storageGb = response.StorageGb;\n this.paymentSource = response.PaymentSource == null ? null : new BillingSourceResponse(response.PaymentSource);\n this.subscription = response.Subscription == null ?\n null : new BillingSubscriptionResponse(response.Subscription);\n this.upcomingInvoice = response.UpcomingInvoice == null ?\n null : new BillingInvoiceResponse(response.UpcomingInvoice);\n if (response.Charges != null) {\n this.charges = response.Charges.map((c: any) => new BillingChargeResponse(c));\n }\n this.expiration = response.Expiration;\n }\n}\n","export class ListResponse {\n data: T[];\n continuationToken: string;\n\n constructor(response: any, t: new (dataResponse: any) => T) {\n this.data = response.Data == null ? [] : response.Data.map((dr: any) => new t(dr));\n this.continuationToken = response.ContinuationToken;\n }\n}\n","import { TwoFactorProviderType } from '../../enums/twoFactorProviderType';\r\n\r\nexport class IdentityTwoFactorResponse {\r\n twoFactorProviders: TwoFactorProviderType[];\r\n twoFactorProviders2 = new Map();\r\n\r\n constructor(response: any) {\r\n this.twoFactorProviders = response.TwoFactorProviders;\r\n if (response.TwoFactorProviders2 != null) {\r\n for (const prop in response.TwoFactorProviders2) {\r\n if (response.TwoFactorProviders2.hasOwnProperty(prop)) {\r\n this.twoFactorProviders2.set(parseInt(prop, null), response.TwoFactorProviders2[prop]);\r\n }\r\n }\r\n }\r\n }\r\n}\r\n","export class IdentityTokenResponse {\r\n accessToken: string;\r\n expiresIn: number;\r\n refreshToken: string;\r\n tokenType: string;\r\n\r\n privateKey: string;\r\n key: string;\r\n twoFactorToken: string;\r\n\r\n constructor(response: any) {\r\n this.accessToken = response.access_token;\r\n this.expiresIn = response.expires_in;\r\n this.refreshToken = response.refresh_token;\r\n this.tokenType = response.token_type;\r\n\r\n this.privateKey = response.PrivateKey;\r\n this.key = response.Key;\r\n this.twoFactorToken = response.TwoFactorToken;\r\n }\r\n}\r\n","import { OrganizationUserStatusType } from '../../enums/organizationUserStatusType';\nimport { OrganizationUserType } from '../../enums/organizationUserType';\n\nexport class GroupUserResponse {\n organizationUserId: string;\n accessAll: boolean;\n name: string;\n email: string;\n type: OrganizationUserType;\n status: OrganizationUserStatusType;\n\n constructor(response: any) {\n this.organizationUserId = response.OrganizationUserId;\n this.accessAll = response.AccessAll;\n this.name = response.Name;\n this.email = response.Email;\n this.type = response.Type;\n this.status = response.Status;\n }\n}\n","import { SelectionReadOnlyResponse } from './selectionReadOnlyResponse';\n\nexport class GroupResponse {\n id: string;\n organizationId: string;\n name: string;\n accessAll: boolean;\n externalId: string;\n\n constructor(response: any) {\n this.id = response.Id;\n this.organizationId = response.OrganizationId;\n this.name = response.Name;\n this.accessAll = response.AccessAll;\n this.externalId = response.ExternalId;\n }\n}\n\nexport class GroupDetailsResponse extends GroupResponse {\n collections: SelectionReadOnlyResponse[] = [];\n\n constructor(response: any) {\n super(response);\n if (response.Collections != null) {\n this.collections = response.Collections.map((c: any) => new SelectionReadOnlyResponse(c));\n }\n }\n}\n","import { DeviceType } from '../../enums/deviceType';\nimport { EventType } from '../../enums/eventType';\n\nexport class EventResponse {\n type: EventType;\n userId: string;\n organizationId: string;\n cipherId: string;\n collectionId: string;\n groupId: string;\n organizationUserId: string;\n actingUserId: string;\n date: Date;\n deviceType: DeviceType;\n ipAddress: string;\n\n constructor(response: any) {\n this.type = response.Type;\n this.userId = response.UserId;\n this.organizationId = response.OrganizationId;\n this.cipherId = response.CipherId;\n this.collectionId = response.CollectionId;\n this.groupId = response.GroupId;\n this.organizationUserId = response.OrganizationUserId;\n this.actingUserId = response.ActingUserId;\n this.date = response.Date;\n this.deviceType = response.DeviceType;\n this.ipAddress = response.IpAddress;\n }\n}\n","export class ErrorResponse {\n message: string;\n validationErrors: { [key: string]: string[]; };\n statusCode: number;\n\n constructor(response: any, status: number, identityResponse?: boolean) {\n let errorModel = null;\n if (identityResponse && response && response.ErrorModel) {\n errorModel = response.ErrorModel;\n } else if (response) {\n errorModel = response;\n }\n\n if (errorModel) {\n this.message = errorModel.Message;\n this.validationErrors = errorModel.ValidationErrors;\n } else {\n if (status === 429) {\n this.message = 'Rate limit exceeded. Try again later.';\n }\n }\n this.statusCode = status;\n }\n\n getSingleMessage(): string {\n if (this.validationErrors) {\n for (const key in this.validationErrors) {\n if (!this.validationErrors.hasOwnProperty(key)) {\n continue;\n }\n if (this.validationErrors[key].length) {\n return this.validationErrors[key][0];\n }\n }\n }\n return this.message;\n }\n}\n","export class GlobalDomainResponse {\r\n type: number;\r\n domains: string[];\r\n excluded: number[];\r\n\r\n constructor(response: any) {\r\n this.type = response.Type;\r\n this.domains = response.Domains;\r\n this.excluded = response.Excluded;\r\n }\r\n}\r\n","import { OrganizationUserStatusType } from '../../enums/organizationUserStatusType';\nimport { OrganizationUserType } from '../../enums/organizationUserType';\n\nexport class CollectionUserResponse {\n organizationUserId: string;\n accessAll: boolean;\n name: string;\n email: string;\n type: OrganizationUserType;\n status: OrganizationUserStatusType;\n readOnly: boolean;\n\n constructor(response: any) {\n this.organizationUserId = response.OrganizationUserId;\n this.accessAll = response.AccessAll;\n this.name = response.Name;\n this.email = response.Email;\n this.type = response.Type;\n this.status = response.Status;\n this.readOnly = response.ReadOnly;\n }\n}\n","import { SecureNoteType } from '../../enums/secureNoteType';\r\n\r\nexport class SecureNoteApi {\r\n type: SecureNoteType;\r\n\r\n constructor(data: any) {\r\n this.type = data.Type;\r\n }\r\n}\r\n","import { UriMatchType } from '../../enums/uriMatchType';\r\n\r\nexport class LoginUriApi {\r\n uri: string;\r\n match: UriMatchType = null;\r\n\r\n constructor(data: any) {\r\n this.uri = data.Uri;\r\n this.match = data.Match != null ? data.Match : null;\r\n }\r\n}\r\n","import { LoginUriApi } from './loginUriApi';\r\n\r\nexport class LoginApi {\r\n uris: LoginUriApi[];\r\n username: string;\r\n password: string;\r\n totp: string;\r\n\r\n constructor(data: any) {\r\n this.username = data.Username;\r\n this.password = data.Password;\r\n this.totp = data.Totp;\r\n\r\n if (data.Uris) {\r\n this.uris = [];\r\n data.Uris.forEach((u: any) => {\r\n this.uris.push(new LoginUriApi(u));\r\n });\r\n }\r\n }\r\n}\r\n","export class IdentityApi {\r\n title: string;\r\n firstName: string;\r\n middleName: string;\r\n lastName: string;\r\n address1: string;\r\n address2: string;\r\n address3: string;\r\n city: string;\r\n state: string;\r\n postalCode: string;\r\n country: string;\r\n company: string;\r\n email: string;\r\n phone: string;\r\n ssn: string;\r\n username: string;\r\n passportNumber: string;\r\n licenseNumber: string;\r\n\r\n constructor(data: any) {\r\n this.title = data.Title;\r\n this.firstName = data.FirstName;\r\n this.middleName = data.MiddleName;\r\n this.lastName = data.LastName;\r\n this.address1 = data.Address1;\r\n this.address2 = data.Address2;\r\n this.address3 = data.Address3;\r\n this.city = data.City;\r\n this.state = data.State;\r\n this.postalCode = data.PostalCode;\r\n this.country = data.Country;\r\n this.company = data.Company;\r\n this.email = data.Email;\r\n this.phone = data.Phone;\r\n this.ssn = data.SSN;\r\n this.username = data.Username;\r\n this.passportNumber = data.PassportNumber;\r\n this.licenseNumber = data.LicenseNumber;\r\n }\r\n}\r\n","import { FieldType } from '../../enums/fieldType';\r\n\r\nexport class FieldApi {\r\n name: string;\r\n value: string;\r\n type: FieldType;\r\n\r\n constructor(response: any) {\r\n this.type = response.Type;\r\n this.name = response.Name;\r\n this.value = response.Value;\r\n }\r\n}\r\n","export class CardApi {\r\n cardholderName: string;\r\n brand: string;\r\n number: string;\r\n expMonth: string;\r\n expYear: string;\r\n code: string;\r\n\r\n constructor(data: any) {\r\n this.cardholderName = data.CardholderName;\r\n this.brand = data.Brand;\r\n this.number = data.Number;\r\n this.expMonth = data.ExpMonth;\r\n this.expYear = data.ExpYear;\r\n this.code = data.Code;\r\n }\r\n}\r\n","export class AttachmentResponse {\r\n id: string;\r\n url: string;\r\n fileName: string;\r\n size: number;\r\n sizeName: string;\r\n\r\n constructor(response: any) {\r\n this.id = response.Id;\r\n this.url = response.Url;\r\n this.fileName = response.FileName;\r\n this.size = response.Size;\r\n this.sizeName = response.SizeName;\r\n }\r\n}\r\n","export { ApiService } from './api.service';\nexport { AppIdService } from './appId.service';\nexport { AuditService } from './audit.service';\nexport { AuthService } from './auth.service';\nexport { CipherService } from './cipher.service';\nexport { CollectionService } from './collection.service';\nexport { ConstantsService } from './constants.service';\nexport { ContainerService } from './container.service';\nexport { CryptoService } from './crypto.service';\nexport { EnvironmentService } from './environment.service';\nexport { FolderService } from './folder.service';\nexport { I18nService } from './i18n.service';\nexport { LockService } from './lock.service';\nexport { PasswordGenerationService } from './passwordGeneration.service';\nexport { SettingsService } from './settings.service';\nexport { StateService } from './state.service';\nexport { SyncService } from './sync.service';\nexport { TokenService } from './token.service';\nexport { TotpService } from './totp.service';\nexport { UserService } from './user.service';\n","import { StorageService } from 'jslib/abstractions/storage.service';\nimport { ConstantsService } from 'jslib/services';\n\nexport class HtmlStorageService implements StorageService {\n private localStorageKeys = new Set(['appId', 'anonymousAppId', 'rememberedEmail', 'passwordGenerationOptions',\n ConstantsService.disableFaviconKey, ConstantsService.lockOptionKey, 'rememberEmail',\n ConstantsService.localeKey, ConstantsService.lockOptionKey]);\n private localStorageStartsWithKeys = ['twoFactorToken_'];\n\n get(key: string): Promise {\n let json: string = null;\n if (this.isLocalStorage(key)) {\n json = window.localStorage.getItem(key);\n } else {\n json = window.sessionStorage.getItem(key);\n }\n if (json != null) {\n const obj = JSON.parse(json);\n return Promise.resolve(obj as T);\n }\n return Promise.resolve(null);\n }\n\n save(key: string, obj: any): Promise {\n if (obj == null) {\n return this.remove(key);\n }\n\n const json = JSON.stringify(obj);\n if (this.isLocalStorage(key)) {\n window.localStorage.setItem(key, json);\n } else {\n window.sessionStorage.setItem(key, json);\n }\n return Promise.resolve();\n }\n\n remove(key: string): Promise {\n if (this.isLocalStorage(key)) {\n window.localStorage.removeItem(key);\n } else {\n window.sessionStorage.removeItem(key);\n }\n return Promise.resolve();\n }\n\n private isLocalStorage(key: string): boolean {\n if (this.localStorageKeys.has(key)) {\n return true;\n }\n for (const swKey of this.localStorageStartsWithKeys) {\n if (key.startsWith(swKey)) {\n return true;\n }\n }\n return false;\n }\n}\n","import { MessagingService } from 'jslib/abstractions/messaging.service';\r\n\r\nimport { BroadcasterService } from 'jslib/angular/services/broadcaster.service';\r\n\r\nexport class BroadcasterMessagingService implements MessagingService {\r\n constructor(private broadcasterService: BroadcasterService) { }\r\n\r\n send(subscriber: string, arg: any = {}) {\r\n const message = Object.assign({}, { command: subscriber }, arg);\r\n this.broadcasterService.send(message);\r\n }\r\n}\r\n","import {\n APP_INITIALIZER,\n LOCALE_ID,\n NgModule,\n} from '@angular/core';\n\nimport { ToasterModule } from 'angular2-toaster';\n\nimport { BroadcasterMessagingService } from '../../services/broadcasterMessaging.service';\nimport { HtmlStorageService } from '../../services/htmlStorage.service';\nimport { I18nService } from '../../services/i18n.service';\nimport { MemoryStorageService } from '../../services/memoryStorage.service';\nimport { WebPlatformUtilsService } from '../../services/webPlatformUtils.service';\n\nimport { EventService } from './event.service';\nimport { OrganizationGuardService } from './organization-guard.service';\nimport { OrganizationTypeGuardService } from './organization-type-guard.service';\nimport { RouterService } from './router.service';\nimport { UnauthGuardService } from './unauth-guard.service';\n\nimport { AuthGuardService } from 'jslib/angular/services/auth-guard.service';\nimport { BroadcasterService } from 'jslib/angular/services/broadcaster.service';\nimport { ValidationService } from 'jslib/angular/services/validation.service';\n\nimport { Analytics } from 'jslib/misc/analytics';\n\nimport { ApiService } from 'jslib/services/api.service';\nimport { AppIdService } from 'jslib/services/appId.service';\nimport { AuditService } from 'jslib/services/audit.service';\nimport { AuthService } from 'jslib/services/auth.service';\nimport { CipherService } from 'jslib/services/cipher.service';\nimport { CollectionService } from 'jslib/services/collection.service';\nimport { ConstantsService } from 'jslib/services/constants.service';\nimport { ContainerService } from 'jslib/services/container.service';\nimport { CryptoService } from 'jslib/services/crypto.service';\nimport { EnvironmentService } from 'jslib/services/environment.service';\nimport { ExportService } from 'jslib/services/export.service';\nimport { FolderService } from 'jslib/services/folder.service';\nimport { LockService } from 'jslib/services/lock.service';\nimport { PasswordGenerationService } from 'jslib/services/passwordGeneration.service';\nimport { SettingsService } from 'jslib/services/settings.service';\nimport { StateService } from 'jslib/services/state.service';\nimport { SyncService } from 'jslib/services/sync.service';\nimport { TokenService } from 'jslib/services/token.service';\nimport { TotpService } from 'jslib/services/totp.service';\nimport { UserService } from 'jslib/services/user.service';\nimport { WebCryptoFunctionService } from 'jslib/services/webCryptoFunction.service';\n\nimport { ApiService as ApiServiceAbstraction } from 'jslib/abstractions/api.service';\nimport { AppIdService as AppIdServiceAbstraction } from 'jslib/abstractions/appId.service';\nimport { AuditService as AuditServiceAbstraction } from 'jslib/abstractions/audit.service';\nimport { AuthService as AuthServiceAbstraction } from 'jslib/abstractions/auth.service';\nimport { CipherService as CipherServiceAbstraction } from 'jslib/abstractions/cipher.service';\nimport { CollectionService as CollectionServiceAbstraction } from 'jslib/abstractions/collection.service';\nimport { CryptoService as CryptoServiceAbstraction } from 'jslib/abstractions/crypto.service';\nimport { CryptoFunctionService as CryptoFunctionServiceAbstraction } from 'jslib/abstractions/cryptoFunction.service';\nimport { EnvironmentService as EnvironmentServiceAbstraction } from 'jslib/abstractions/environment.service';\nimport { ExportService as ExportServiceAbstraction } from 'jslib/abstractions/export.service';\nimport { FolderService as FolderServiceAbstraction } from 'jslib/abstractions/folder.service';\nimport { I18nService as I18nServiceAbstraction } from 'jslib/abstractions/i18n.service';\nimport { LockService as LockServiceAbstraction } from 'jslib/abstractions/lock.service';\nimport { LogService as LogServiceAbstraction } from 'jslib/abstractions/log.service';\nimport { MessagingService as MessagingServiceAbstraction } from 'jslib/abstractions/messaging.service';\nimport {\n PasswordGenerationService as PasswordGenerationServiceAbstraction,\n} from 'jslib/abstractions/passwordGeneration.service';\nimport { PlatformUtilsService as PlatformUtilsServiceAbstraction } from 'jslib/abstractions/platformUtils.service';\nimport { SettingsService as SettingsServiceAbstraction } from 'jslib/abstractions/settings.service';\nimport { StateService as StateServiceAbstraction } from 'jslib/abstractions/state.service';\nimport { StorageService as StorageServiceAbstraction } from 'jslib/abstractions/storage.service';\nimport { SyncService as SyncServiceAbstraction } from 'jslib/abstractions/sync.service';\nimport { TokenService as TokenServiceAbstraction } from 'jslib/abstractions/token.service';\nimport { TotpService as TotpServiceAbstraction } from 'jslib/abstractions/totp.service';\nimport { UserService as UserServiceAbstraction } from 'jslib/abstractions/user.service';\n\nconst i18nService = new I18nService(window.navigator.language, 'locales');\nconst stateService = new StateService();\nconst broadcasterService = new BroadcasterService();\nconst messagingService = new BroadcasterMessagingService(broadcasterService);\nconst platformUtilsService = new WebPlatformUtilsService(i18nService);\nconst storageService: StorageServiceAbstraction = new HtmlStorageService();\nconst secureStorageService: StorageServiceAbstraction = new MemoryStorageService();\nconst cryptoFunctionService: CryptoFunctionServiceAbstraction = new WebCryptoFunctionService(window,\n platformUtilsService);\nconst cryptoService = new CryptoService(storageService,\n platformUtilsService.isDev() ? storageService : secureStorageService, cryptoFunctionService);\nconst tokenService = new TokenService(storageService);\nconst appIdService = new AppIdService(storageService);\nconst apiService = new ApiService(tokenService, platformUtilsService,\n async (expired: boolean) => messagingService.send('logout', { expired: expired }));\nconst environmentService = new EnvironmentService(apiService, storageService);\nconst userService = new UserService(tokenService, storageService);\nconst settingsService = new SettingsService(userService, storageService);\nconst cipherService = new CipherService(cryptoService, userService, settingsService,\n apiService, storageService, i18nService, platformUtilsService);\nconst folderService = new FolderService(cryptoService, userService, apiService, storageService,\n i18nService, cipherService);\nconst collectionService = new CollectionService(cryptoService, userService, storageService, i18nService);\nconst lockService = new LockService(cipherService, folderService, collectionService,\n cryptoService, platformUtilsService, storageService, messagingService, null);\nconst syncService = new SyncService(userService, apiService, settingsService,\n folderService, cipherService, cryptoService, collectionService, storageService, messagingService,\n async (expired: boolean) => messagingService.send('logout', { expired: expired }));\nconst passwordGenerationService = new PasswordGenerationService(cryptoService, storageService);\nconst totpService = new TotpService(storageService, cryptoFunctionService);\nconst containerService = new ContainerService(cryptoService, platformUtilsService);\nconst authService = new AuthService(cryptoService, apiService,\n userService, tokenService, appIdService, i18nService, platformUtilsService, messagingService);\nconst exportService = new ExportService(folderService, cipherService, apiService);\nconst auditService = new AuditService(cryptoFunctionService, apiService);\n\nconst analytics = new Analytics(window, () => platformUtilsService.isDev() || platformUtilsService.isSelfHost(),\n platformUtilsService, storageService, appIdService);\ncontainerService.attachToWindow(window);\n\nexport function initFactory(): Function {\n return async () => {\n const isDev = platformUtilsService.isDev();\n if (!isDev && platformUtilsService.isSelfHost()) {\n environmentService.baseUrl = window.location.origin;\n }\n await apiService.setUrls({\n base: isDev ? null : window.location.origin,\n api: isDev ? 'http://localhost:4000' : null,\n identity: isDev ? 'http://localhost:33656' : null,\n });\n\n lockService.init(true);\n const locale = await storageService.get(ConstantsService.localeKey);\n await i18nService.init(locale);\n await authService.init();\n const htmlEl = window.document.documentElement;\n htmlEl.classList.add('locale_' + i18nService.translationLocale);\n let theme = await storageService.get(ConstantsService.themeKey);\n if (theme == null) {\n theme = 'light';\n }\n htmlEl.classList.add('theme_' + theme);\n stateService.save(ConstantsService.disableFaviconKey,\n await storageService.get(ConstantsService.disableFaviconKey));\n };\n}\n\n@NgModule({\n imports: [\n ToasterModule,\n ],\n declarations: [],\n providers: [\n ValidationService,\n AuthGuardService,\n OrganizationGuardService,\n OrganizationTypeGuardService,\n UnauthGuardService,\n RouterService,\n EventService,\n { provide: AuditServiceAbstraction, useValue: auditService },\n { provide: AuthServiceAbstraction, useValue: authService },\n { provide: CipherServiceAbstraction, useValue: cipherService },\n { provide: FolderServiceAbstraction, useValue: folderService },\n { provide: CollectionServiceAbstraction, useValue: collectionService },\n { provide: EnvironmentServiceAbstraction, useValue: environmentService },\n { provide: TotpServiceAbstraction, useValue: totpService },\n { provide: TokenServiceAbstraction, useValue: tokenService },\n { provide: I18nServiceAbstraction, useValue: i18nService },\n { provide: CryptoServiceAbstraction, useValue: cryptoService },\n { provide: PlatformUtilsServiceAbstraction, useValue: platformUtilsService },\n { provide: PasswordGenerationServiceAbstraction, useValue: passwordGenerationService },\n { provide: ApiServiceAbstraction, useValue: apiService },\n { provide: SyncServiceAbstraction, useValue: syncService },\n { provide: UserServiceAbstraction, useValue: userService },\n { provide: MessagingServiceAbstraction, useValue: messagingService },\n { provide: BroadcasterService, useValue: broadcasterService },\n { provide: SettingsServiceAbstraction, useValue: settingsService },\n { provide: LockServiceAbstraction, useValue: lockService },\n { provide: StorageServiceAbstraction, useValue: storageService },\n { provide: StateServiceAbstraction, useValue: stateService },\n { provide: ExportServiceAbstraction, useValue: exportService },\n {\n provide: APP_INITIALIZER,\n useFactory: initFactory,\n deps: [],\n multi: true,\n },\n {\n provide: LOCALE_ID,\n useFactory: () => i18nService.translationLocale,\n deps: [],\n },\n ],\n})\nexport class ServicesModule {\n}\n","\r\n\r\n","
\n
\n
\n
\n

{{'updateEncryptionKey' | i18n}}

\n \n
\n
\n

{{'updateEncryptionKeyShortDesc' | i18n}} {{'updateEncryptionKeyDesc' | i18n}}\n {{'learnMore' | i18n}}\n

\n {{'updateEncryptionKeyWarning' | i18n}}\n \n \n
\n
\n \n \n
\n
\n
\n
\n","
\n
\n
\n
\n

\n {{'twoStepLogin' | i18n}}\n YubiKey\n

\n \n
\n \n \n
\n
\n \n {{'twoStepLoginProviderEnabled' | i18n}}\n \n \n

{{'twoFactorYubikeyWarning' | i18n}}

\n
    \n
  • {{'twoFactorYubikeySupportUsb' | i18n}}
  • \n
  • {{'twoFactorYubikeySupportMobile' | i18n}}
  • \n
\n
\n \"\"\n

{{'twoFactorYubikeyAdd' | i18n}}:

\n
    \n
  1. {{'twoFactorYubikeyPlugIn' | i18n}}
  2. \n
  3. {{'twoFactorYubikeySelectKey' | i18n}}
  4. \n
  5. {{'twoFactorYubikeyTouchButton' | i18n}}
  6. \n
  7. {{'twoFactorYubikeySaveForm' | i18n}}
  8. \n
\n
\n
\n
\n \n \n
\n {{k.existingKey}}\n \n
\n
\n
\n {{'nfcSupport' | i18n}}\n
\n \n \n
\n {{'twoFactorYubikeySupportsNfcDesc' | i18n}}\n
\n
\n \n \n \n
\n
\n
\n
\n
\n","
\n
\n
\n
\n

\n {{'twoStepLogin' | i18n}}\n FIDO U2F\n

\n \n
\n \n \n
\n
\n \n {{'twoStepLoginProviderEnabled' | i18n}}\n \n \n

{{'twoFactorU2fWarning' | i18n}}

\n
    \n
  • {{'twoFactorU2fSupportWeb' | i18n}}
  • \n
\n
\n \n \"\"\n

{{'twoFactorU2fAdd' | i18n}}:

\n
    \n
  1. {{'twoFactorU2fPlugIn' | i18n}}
  2. \n
  3. {{'twoFactorU2fTouchButton' | i18n}}
  4. \n
\n
\n
\n \n

\n \n

\n {{'twoFactorU2fWaiting' | i18n}}...\n
\n \n

\n \n

\n {{'twoFactorU2fClickEnable' | i18n}}\n
\n \n

\n \n

\n {{'twoFactorU2fProblemReading' | i18n}}\n
\n
\n
\n
\n
\n \n \n
\n
\n
\n
\n
\n","
\n
\n
\n
\n

\n {{'twoStepLogin' | i18n}}\n {{'recoveryCodeTitle' | i18n}}\n

\n \n
\n \n \n \n
\n \n

{{'twoFactorRecoveryYourCode' | i18n}}:

\n {{code}}\n
\n \n {{'twoFactorRecoveryNoCode' | i18n}}\n \n
\n
\n \n \n
\n
\n
\n
\n
\n","
\n
\n
\n
\n

{{'twoStepOptions' | i18n}}

\n \n
\n \n
\n \n
\n
\n
\n
\n","
\n
\n
\n
\n

\n {{'twoStepLogin' | i18n}}\n {{'emailTitle' | i18n}}\n

\n \n
\n \n \n
\n
\n \n \n {{'twoStepLoginProviderEnabled' | i18n}}\n \n {{'email' | i18n}}: {{email}}\n \n \n

\n {{'twoFactorEmailDesc' | i18n}}\n \"\"\n

\n
\n \n \n
\n
\n \n \n {{'verificationCodeEmailSent' | i18n : sentEmail}}\n \n
\n
\n \n \n
\n
\n
\n
\n \n \n
\n
\n
\n
\n
\n","
\n
\n
\n
\n

\n {{'twoStepLogin' | i18n}}\n Duo\n

\n \n
\n \n \n
\n
\n \n \n {{'twoStepLoginProviderEnabled' | i18n}}\n \n \"\"\n {{'twoFactorDuoIntegrationKey' | i18n}}: {{ikey}}\n
\n {{'twoFactorDuoSecretKey' | i18n}}: {{skey}}\n
\n {{'twoFactorDuoApiHostname' | i18n}}: {{host}}\n
\n \n \"\"\n

{{'twoFactorDuoDesc' | i18n}}

\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n
\n
\n \n \n
\n
\n
\n
\n
\n","
\n
\n
\n
\n

\n {{'twoStepLogin' | i18n}}\n {{'authenticatorAppTitle' | i18n}}\n

\n \n
\n \n \n
\n
\n \n \"\"\n

{{'twoStepAuthenticatorDesc' | i18n}}

\n

\n 1. {{'twoStepAuthenticatorDownloadApp' | i18n}}\n

\n
\n \n \n

{{'twoStepLoginProviderEnabled' | i18n}}

\n {{'twoStepAuthenticatorReaddDesc' | i18n}}\n
\n \"\"\n

{{'twoStepAuthenticatorNeedApp' | i18n}}

\n
\n \n

{{'twoStepAuthenticatorAppsRecommended' | i18n}}

\n

\n 2. {{'twoStepAuthenticatorScanCode' | i18n}}\n

\n
\n

\n
\n {{key}}\n

\n \n \n \n \n
\n
\n \n \n
\n
\n
\n
\n
\n","
\n
\n
\n
\n

\n {{'share' | i18n}}\n {{cipher.name}}\n

\n \n
\n
\n

{{'shareDesc' | i18n}}

\n
\n \n \n
\n
\n

{{'collections' | i18n}}

\n
\n \n \n
\n
\n
\n {{'noCollectionsInList' | i18n}}\n
\n \n \n \n \n \n \n \n
\n \n \n {{c.name}}\n
\n
\n
\n \n \n
\n
\n
\n
\n","
\n
\n
\n
\n

{{'purgeVault' | i18n}}

\n \n
\n
\n

{{'purgeVaultDesc' | i18n}}

\n {{'purgeVaultWarning' | i18n}}\n \n \n
\n
\n \n \n
\n
\n
\n
\n","
\n
\n
\n
\n

{{'passwordHistory' | i18n}}

\n \n
\n
    \n
  • \n
    \n
    {{h.password}}
    \n {{h.date | date:'medium'}}\n
    \n
    \n \n
    \n
  • \n
\n
\n {{'noPasswordsInList' | i18n}}\n
\n
\n \n
\n \n
\n
\n
\n
\n
\n","
\n
\n
\n
\n

\n {{'groupAccess' | i18n}}\n {{name}}\n

\n \n
\n
\n \n
\n
\n

{{'groupAccessUserDesc' | i18n}}

\n
\n {{'noGroupsInList' | i18n}}\n
\n \n \n \n \n \n \n \n
\n \n \n {{g.name}}\n
\n
\n
\n \n \n
\n
\n
\n
\n","
\n
\n
\n
\n

\n {{title}}\n {{name}}\n

\n \n
\n
\n \n
\n
\n \n

{{'inviteUserDesc' | i18n}}

\n
\n \n \n {{'inviteMultipleEmailDesc' | i18n : '20'}}\n
\n
\n

{{'userType' | i18n}}

\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n

\n
\n {{'accessControl' | i18n}}\n
\n
\n \n \n
\n

\n
\n
\n \n \n
\n
\n \n \n
\n
\n \n
\n {{'noCollectionsInList' | i18n}}\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
 {{'name' | i18n}}{{'readOnly' | i18n}}
\n \n \n {{c.name}}\n \n \n
\n
\n
\n
\n \n \n
\n \n
\n
\n
\n
\n
\n","
\n
\n
\n
\n

{{title}}

\n \n
\n
\n \n
\n
\n
\n \n \n
\n
\n \n \n {{'externalIdGroupDesc' | i18n}}\n
\n

\n
\n {{'accessControl' | i18n}}\n
\n
\n \n \n
\n

\n
\n
\n \n \n
\n
\n \n \n
\n
\n \n
\n {{'noCollectionsInList' | i18n}}\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
 {{'name' | i18n}}{{'readOnly' | i18n}}
\n \n \n {{c.name}}\n \n \n
\n
\n
\n
\n \n \n
\n \n
\n
\n
\n
\n
\n","
\n
\n
\n
\n

\n {{'userAccess' | i18n}}\n {{entityName}}\n

\n \n
\n
\n \n
\n
\n \n {{'noUsersInList' | i18n}}\n \n \n \n \n \n \n \n \n \n \n \n
\n \n \n {{u.email}}\n {{'invited' | i18n}}\n {{'accepted' | i18n}}\n {{u.name}}\n \n \n \n \n {{'owner' | i18n}}\n {{'admin' | i18n}}\n {{'user' | i18n}}\n \n \n
\n
\n
\n \n
\n
\n
\n
\n","
\n
\n
\n
\n

\n {{'eventLogs' | i18n}}\n {{name}}\n

\n \n
\n
\n \n
\n
\n
\n
\n \n \n -\n \n \n
\n \n
\n
\n
\n {{'noEventsInList' | i18n}}\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
{{'timestamp' | i18n}}\n {{'device' | i18n}}\n {{'user' | i18n}}{{'event' | i18n}}
{{e.date | date:'medium'}}\n \n \n {{e.userName}}\n
\n \n
\n
\n \n
\n
\n
\n
\n","
\n
\n
\n
\n

\n {{'collections' | i18n}}\n {{cipher.name}}\n

\n \n
\n
\n

{{'collectionsDesc' | i18n}}

\n
\n

{{'collections' | i18n}}

\n
\n \n \n
\n
\n
\n {{'noCollectionsInList' | i18n}}\n
\n \n \n \n \n \n \n \n
\n \n \n {{c.name}}\n
\n
\n
\n \n \n
\n
\n
\n
\n","
\n
\n
\n
\n

{{title}}

\n \n
\n
\n \n
\n
\n
\n \n \n
\n

\n {{'groupAccess' | i18n}}\n
\n \n \n
\n

\n
\n {{'noGroupsInList' | i18n}}\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
 {{'name' | i18n}}{{'readOnly' | i18n}}
\n \n \n \n {{g.name}}\n \n \n \n \n
\n
\n
\n \n \n
\n \n
\n
\n
\n
\n
\n","
\n
\n
\n
\n

\n {{'attachments' | i18n}}\n {{cipher.name}}\n

\n \n
\n
\n \n \n \n \n \n \n \n \n
\n \n \n \n {{a.fileName}}\n
\n {{a.sizeName}}\n
\n \n
\n

{{'newAttachment' | i18n}}

\n \n \n {{'maxFileSize' | i18n}}\n
\n
\n \n \n
\n
\n
\n
\n","
\n
\n
\n
\n

{{title}}

\n \n
\n
\n
\n
\n \n \n
\n
\n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n \n
\n \n
\n \n
\n
\n
\n
\n
\n \n \n
\n
\n \n
\n \n \n
\n
\n
\n
\n
\n
\n \n \n
\n
\n \n
\n \n {{totpSec}}\n \n \n \n \n \n \n \n {{totpCodeFormatted}}\n \n
\n
\n
\n \n
\n
\n \n
\n \n
\n \n \n
\n
\n
\n
\n
\n \n \n \n \n
\n
\n \n \n
\n
\n
\n
\n \n {{'newUri' | i18n}}\n \n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n
\n
\n \n
\n \n
\n \n
\n
\n
\n
\n \n \n
\n
\n \n \n
\n
\n
\n
\n \n
\n \n
\n \n \n
\n
\n
\n
\n
\n \n \n
\n
\n \n \n
\n
\n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n
\n
\n \n \n
\n
\n \n \n
\n
\n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n
\n
\n \n \n
\n
\n \n \n
\n
\n
\n
\n \n \n
\n
\n \n \n
\n
\n
\n
\n \n \n
\n
\n \n \n
\n
\n
\n
\n \n \n
\n
\n \n \n
\n
\n
\n
\n \n \n
\n
\n
\n
\n \n \n
\n

{{'customFields' | i18n}}

\n \n
\n
\n
\n \n \n \n \n
\n \n
\n
\n \n
\n
\n \n
\n \n
\n
\n
\n \n
\n \n \n
\n
\n
\n \n
\n \n
\n
\n
\n
\n \n {{'newCustomField' | i18n}}\n \n
\n
\n \n \n
\n
\n
\n
\n \n \n
\n \n \n
\n
\n
\n
\n
\n","","
\n
\n
\n
\n

{{title}}

\n \n
\n
\n \n \n
\n
\n \n \n
\n \n
\n
\n
\n
\n
\n","
\n
\n
\n
\n

{{'deleteOrganization' | i18n}}

\n \n
\n
\n

{{'deleteOrganizationDesc' | i18n}}

\n {{'deleteOrganizationWarning' | i18n}}\n \n \n
\n
\n \n \n
\n
\n
\n
\n","
\n
\n
\n
\n

{{'deleteAccount' | i18n}}

\n \n
\n
\n

{{'deleteAccountDesc' | i18n}}

\n {{'deleteAccountWarning' | i18n}}\n \n \n
\n
\n \n \n
\n
\n
\n
\n","
\n
\n
\n
\n

{{'deauthorizeSessions' | i18n}}

\n \n
\n
\n

{{'deauthorizeSessionsDesc' | i18n}}

\n {{'deauthorizeSessionsWarning' | i18n}}\n \n \n
\n
\n \n \n
\n
\n
\n
\n","
\n
\n
\n
\n

\n {{'shareSelected' | i18n}}\n

\n \n
\n
\n

{{'shareManyDesc' | i18n}}

\n

{{'shareSelectedItemsDesc' | i18n: this.ciphers.length : shareableCiphers.length : nonShareableCount}}

\n
\n \n \n
\n
\n

{{'collections' | i18n}}

\n
\n \n \n
\n
\n
\n {{'noCollectionsInList' | i18n}}\n
\n \n \n \n \n \n \n \n
\n \n \n {{c.name}}\n
\n
\n
\n \n \n
\n
\n
\n
\n","
\n
\n
\n
\n

\n {{'moveSelected' | i18n}}\n

\n \n
\n
\n

{{'moveSelectedItemsDesc' | i18n: cipherIds.length}}

\n
\n \n \n
\n
\n
\n \n \n
\n
\n
\n
\n","
\n
\n
\n
\n

\n {{'deleteSelected' | i18n}}\n

\n \n
\n
\n {{'deleteSelectedItemsDesc' | i18n: cipherIds.length}}\n
\n
\n \n \n
\n
\n
\n
\n","export class VerifyBankRequest {\n amount1: number;\n amount2: number;\n}\n","export class SeatRequest {\n seatAdjustment: number;\n}\n","
\n
\n

{{(add ? 'addSeats' : 'removeSeats') | i18n}}

\n
\n
\n \n \n
\n
\n
\n {{'total' | i18n}}: {{seatAdjustment || 0}} × {{seatPrice | currency:'$'}} = {{adjustedSeatTotal\n | currency:'$'}} /{{interval | i18n}}\n
\n \n \n \n {{(add ? 'seatsAddNote' : 'seatsRemoveNote') | i18n}}\n \n
\n
\n","
\n

\n {{'billingAndLicensing' | i18n}}\n \n \n \n

\n
\n\n\n {{'subscriptionCanceled' | i18n}}\n \n

{{'subscriptionPendingCanceled' | i18n}}

\n \n
\n
\n
{{'billingPlan' | i18n}}
\n
{{billing.plan}}
\n
{{'expiration' | i18n}}
\n
{{billing.expiration | date:'mediumDate'}}
\n
{{'neverExpires' | i18n}}
\n
\n
\n
\n
\n
{{'billingPlan' | i18n}}
\n
{{billing.plan}}
\n \n
{{'status' | i18n}}
\n
\n {{subscription.status || '-'}}\n {{'pendingCancellation' | i18n}}\n
\n
{{'nextCharge' | i18n}}
\n
{{nextInvoice ? ((nextInvoice.date | date: 'mediumDate') + ', ' + (nextInvoice.amount | currency:'$'))\n : '-'}}\n
\n
\n
\n
\n
\n {{'details' | i18n}}\n \n \n \n \n \n \n \n
\n {{i.name}} {{i.quantity > 1 ? '×' + i.quantity : ''}} @ {{i.amount | currency:'$'}}\n \n {{(i.quantity * i.amount) | currency:'$'}} /{{i.interval | i18n}}\n
\n
\n
\n \n
\n \n \n {{'manageSubscription' | i18n}}\n \n
\n
\n
\n

{{'updateLicense' | i18n}}

\n \n
\n
\n
\n \n
\n \n \n \n
\n

{{'userSeats' | i18n}}

\n

{{'subscriptionUserSeats' | i18n : billing.seats}}

\n \n
\n
\n \n \n
\n \n
\n
\n

{{'storage' | i18n}}

\n

{{'subscriptionStorage' | i18n : billing.maxStorageGb || 0 : billing.storageName || '0 MB'}}

\n
\n
{{(storagePercentage / 100) | percent}}
\n
\n \n
\n
\n \n \n
\n \n
\n
\n

{{'paymentMethod' | i18n}}

\n

{{'noPaymentMethod' | i18n}}

\n \n \n

{{'verifyBankAccountDesc' | i18n}} {{'verifyBankAccountFailureWarning' | i18n}}

\n
\n \n
\n
\n
$0.
\n
\n \n
\n \n
\n
\n
$0.
\n
\n \n
\n \n
\n
\n

\n \n {{paymentSource.description}}\n

\n
\n \n \n \n

{{'charges' | i18n}}

\n

{{'noCharges' | i18n}}

\n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n {{c.createdDate | date:'mediumDate'}}{{c.paymentSource ? c.paymentSource.description : '-'}}{{c.status}}{{c.amount | currency:'$'}}
\n * {{'chargesStatement' | i18n : 'BITWARDEN'}}\n
\n
\n","
\n

{{'twoStepLogin' | i18n}}

\n
\n

{{'twoStepLoginDesc' | i18n}}

\n

{{'twoStepLoginOrganizationDesc' | i18n}}

\n\n

{{'twoStepLoginRecoveryWarning' | i18n}}

\n \n
\n

\n {{'providers' | i18n}}\n \n \n \n

\n\n\n\n\n\n\n\n\n","export class OrganizationUpdateRequest {\n name: string;\n businessName: string;\n billingEmail: string;\n}\n","
\n

{{'myOrganization' | i18n}}

\n
\n
\n \n
\n
\n
\n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n
\n \n
\n
\n \n
\n
\n

{{'taxInformation' | i18n}}

\n
\n
\n
{{org.businessAddress1}}
\n
{{org.businessAddress2}}
\n
{{org.businessAddress3}}
\n
{{org.businessCountry}}
\n
{{org.businessTaxNumber}}
\n
\n

{{'taxInformationDesc' | i18n}}

\n\n {{'contactSupport' | i18n}}\n\n
\n

{{'dangerZone' | i18n}}

\n
\n
\n
\n

{{'dangerZoneDesc' | i18n}}

\n \n
\n
\n\n","
\n \n
\n","export class OrganizationUserUpdateGroupsRequest {\n groupIds: string[] = [];\n}\n","import { OrganizationUserType } from '../../enums/organizationUserType';\n\nimport { SelectionReadOnlyRequest } from './selectionReadOnlyRequest';\n\nexport class OrganizationUserUpdateRequest {\n type: OrganizationUserType;\n accessAll: boolean;\n collections: SelectionReadOnlyRequest[] = [];\n}\n","import { OrganizationUserType } from '../../enums/organizationUserType';\n\nimport { SelectionReadOnlyRequest } from './selectionReadOnlyRequest';\n\nexport class OrganizationUserInviteRequest {\n emails: string[] = [];\n type: OrganizationUserType;\n accessAll: boolean;\n collections: SelectionReadOnlyRequest[] = [];\n}\n","export class OrganizationUserConfirmRequest {\n key: string;\n}\n","
\n

{{'people' | i18n}}

\n
\n
\n \n \n \n
\n
\n \n \n
\n \n
\n
\n\n\n

{{'noUsersInList' | i18n}}

\n \n \n \n \n \n \n \n \n \n
\n \n \n {{u.email}}\n {{'invited' | i18n}}\n {{'accepted' | i18n}}\n {{u.name}}\n \n {{'owner' | i18n}}\n {{'admin' | i18n}}\n {{'user' | i18n}}\n \n \n
\n
\n\n\n\n","import { SelectionReadOnlyRequest } from './selectionReadOnlyRequest';\n\nexport class GroupRequest {\n name: string;\n accessAll: boolean;\n externalId: string;\n collections: SelectionReadOnlyRequest[] = [];\n}\n","
\n

{{'groups' | i18n}}

\n
\n
\n \n \n
\n \n
\n
\n\n\n

{{'noGroupsInList' | i18n}}

\n \n \n \n \n \n \n \n
\n {{g.name}}\n \n \n
\n
\n\n\n","
\n

{{'eventLogs' | i18n}}

\n
\n
\n \n \n -\n \n \n
\n \n
\n
\n\n\n

{{'noEventsInList' | i18n}}

\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
{{'timestamp' | i18n}}\n {{'device' | i18n}}\n {{'user' | i18n}}{{'event' | i18n}}
{{e.date | date:'medium'}}\n \n \n {{e.userName}}\n
\n \n
\n","
\n

{{'collections' | i18n}}

\n
\n
\n \n \n
\n \n
\n
\n\n\n

{{'noCollectionsInList' | i18n}}

\n \n \n \n \n \n \n \n
\n {{c.name}}\n \n \n
\n
\n\n\n","
\r\n
\r\n \r\n
\r\n \r\n
\r\n
\r\n
\r\n","
\n
\n

{{'exportVault' | i18n}}

\n
\n

{{'exportMasterPassword' | i18n}}

\n {{'exportWarning' | i18n}}\n
\n
\n \n \n
\n
\n \n
\n","import { CipherRequest } from './cipherRequest';\nimport { CollectionRequest } from './collectionRequest';\nimport { KvpRequest } from './kvpRequest';\n\nexport class ImportOrganizationCiphersRequest {\n ciphers: CipherRequest[] = [];\n collections: CollectionRequest[] = [];\n collectionRelationships: Array> = [];\n}\n","
\n

{{'importData' | i18n}}

\n
\n
\n
\n
\n
\n \n \n
\n
\n
\n \n \n See detailed instructions on our help site at\n https://help.bitwarden.com/article/export-your-data/\n \n \n See detailed instructions on our help site at\n https://help.bitwarden.com/article/import-from-lastpass/\n \n \n Using the KeePassX desktop application, navigate to \"Database\" → \"Export to CSV file\" and save the CSV file.\n \n \n In the Avira web vault, go to \"Settings\" → \"My Data\" → \"Export data\" and save the CSV file.\n \n \n In the Blur web vault, click your username at the top and go to \"Settings\" → \"Export Data\", then click \"Export CSV\"\n for your \"Accounts\".\n \n \n Using the SaveInCloud desktop application, navigate to \"File\" → \"Export\" → \"As XML\" and save the XML file.\n \n \n Using the Padlock desktop application, click the hamburger icon in the top left corner and navigate to \"Settings\" →\n \"Export\" button and save the file \"As CSV\".\n \n \n Using the KeePass 2 desktop application, navigate to \"File\" → \"Export\" and select the \"KeePass XML (2.x)\" option.\n \n \n Using the Universal Password Manager desktop application, navigate to \"Database\" → \"Export\" and save the CSV file.\n \n \n Using the SaferPass browser extension, click the hamburger icon in the top left corner and navigate to \"Settings\". Click\n the \"Export accounts\" button to save the CSV file.\n \n \n Using the Meldium web vault, navigate to \"Settings\". Locate the \"Export data\" function and click \"Show me my data\" to save\n the CSV file.\n \n \n Log into the Keeper web vault (keepersecurity.com/vault). Navigate to \"Backup\" (top right) and find the \"Export to .csv File\"\n option. Click \"Export Now\" to save the CSV file.\n \n \n \n The process is exactly the same as importing from Google Chrome.\n \n See detailed instructions on our help site at\n https://help.bitwarden.com/article/import-from-chrome/\n \n \n Use the\n FF Password Exporter application to export your passwords to a CSV file.\n \n \n See detailed instructions on our help site at\n https://help.bitwarden.com/article/import-from-1password/.\n \n \n Using the Password Dragon desktop application, navigate to \"File\" → \"Export\" → \"To XML\". In the dialog that pops\n up select \"All Rows\" and check all fields. Click the \"Export\" button and save the XML file.\n \n \n Using the Enpass desktop application, navigate to \"File\" → \"Export\" → \"As CSV\". Select \"OK\" to the warning alert\n and save the CSV file. Note that the importer only supports files exported while Enpass is set to the English\n language, so adjust your settings accordingly.\n \n \n Using the Password Safe desktop application, navigate to \"File\" → \"Export To\" → \"XML format...\" and save the XML\n file.\n \n \n Using the Dashlane desktop application, navigate to \"File\" → \"Export\" → \"Unsecured archive (readable) in CSV format\"\n and save the CSV file.\n \n \n Using the mSecure desktop application, navigate to \"File\" → \"Export\" → \"CSV File...\" and save the CSV file.\n \n \n Using the Sticky Password desktop application, navigate to \"Menu\" (top right) → \"Export\" → \"Export all\". Select\n the unencrypted format XML option and save the XML file.\n \n \n Using the True Key desktop application, click the gear icon (top right) and then navigate to \"App Settings\". Click the \"Export\"\n button, enter your password and save the CSV file.\n \n \n Log into the Clipperz web application (clipperz.is/app). Click the hamburger menu icon in the top right to expand the navigation\n bar. Navigate to \"Data\" → \"Export\". Click the \"download HTML+JSON\" button to save the HTML file.\n \n \n Using the RoboForm Editor desktop application, navigate to \"RoboForm\" (top left) → \"Options\" → \"Account & Data\"\n and click the \"Export\" button. Select all of your data, change the \"Format\" to \"CSV file\" and then click the\n \"Export\" button to save the CSV file. Note: RoboForm only allows you to export Logins. Other items will not be\n exported.\n \n \n Log into the Passbolt web vault and navigate to the \"Passwords\" listing. Select all of the passwords you would like to export\n and click the \"Export\" button at the top of the listing. Choose the \"csv (lastpass)\" export format and click\n the \"Export\" button.\n \n \n Using the Ascendo DataVault desktop application, navigate to \"Tools\" → \"Export\". In the dialog that pops up, select\n the \"All Items (DVX, CSV)\" option. Click the \"Ok\" button to save the CSV file.\n \n \n Using the Password Boss desktop application, navigate to \"File\" → \"Export data\" → \"Password Boss JSON - not encrypted\"\n and save the JSON file.\n \n \n Log into the Zoho web vault (vault.zoho.com). Navigate to \"Tools\" → \"Export Secrets\". Select \"All Secrets\" and click\n the \"Zoho Vault Format CSV\" button. Highlight and copy the data from the textarea. Open a text editor like Notepad\n and paste the data. Save the data from the text editor as\n zoho_export.csv.\n \n \n Using the SplashID Safe desktop application, click on the SplashID blue lock logo in the top right corner. Navigate to \"Export\"\n → \"Export as CSV\" and save the CSV file.\n \n \n Using the PassKeep mobile app, navigate to \"Backup/Restore\". Locate the \"CSV Backup/Restore\" section and click \"Backup to\n CSV\" to save the CSV file.\n \n \n Make sure you have python-keyring and python-gnomekeyring installed. Save the\n GNOME Keyring Import/Export python script to your desktop as\n pw_helper.py. Open terminal and run\n chmod +rx Desktop/pw_helper.py and then\n python Desktop/pw_helper.py export Desktop/my_passwords.json. Then upload the resulting\n my_passwords.json file here to Bitwarden.\n \n \n Using the Password Agent desktop application navigate to \"File\" → \"Export\", select the \"Fields to export\" button and\n check all of the fields, change the \"Output format\" to \"CSV\", and then click the \"Start\" button to save the CSV\n file.\n \n \n
\n
\n
\n \n \n
\n
\n
\n
\n \n \n
\n \n
\n","
\r\n
\r\n
\r\n
\r\n
{{'tools' | i18n}}
\r\n \r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n","export enum EventType {\n User_LoggedIn = 1000,\n User_ChangedPassword = 1001,\n User_Enabled2fa = 1002,\n User_Disabled2fa = 1003,\n User_Recovered2fa = 1004,\n User_FailedLogIn = 1005,\n User_FailedLogIn2fa = 1006,\n\n Cipher_Created = 1100,\n Cipher_Updated = 1101,\n Cipher_Deleted = 1102,\n Cipher_AttachmentCreated = 1103,\n Cipher_AttachmentDeleted = 1104,\n Cipher_Shared = 1105,\n Cipher_UpdatedCollections = 1106,\n\n Collection_Created = 1300,\n Collection_Updated = 1301,\n Collection_Deleted = 1302,\n\n Group_Created = 1400,\n Group_Updated = 1401,\n Group_Deleted = 1402,\n\n OrganizationUser_Invited = 1500,\n OrganizationUser_Confirmed = 1501,\n OrganizationUser_Updated = 1502,\n OrganizationUser_Removed = 1503,\n OrganizationUser_UpdatedGroups = 1504,\n\n Organization_Updated = 1600,\n\n}\n","\n 0\">\n \n \n \n \n \n \n \n \n
\n \n \n \n \n {{c.name}}\n \n \n
\n {{c.subTitle}}\n
\n \n
\n
\n \n \n

{{'noItemsInList' | i18n}}

\n \n
\n
\n
\n","
\n
\n Filters\n
\n
\n \n \n

{{'types' | i18n}}

\n \n

\n \n

\n \n \n

\n {{'folders' | i18n}}\n \n \n \n

\n \n
\n \n

{{'collections' | i18n}}

\n \n
\n
\n
\n
\n","
\n
\n
\n \n \n
\n
\n
\n

{{'vault' | i18n}}

\n \n
\n \n \n
\n
\n
\n\n\n\n\n","\n
\n
\n
\n \n
\n {{organization.name}}\n {{'organization' | i18n}}\n
\n
\n \n
\n
\n\n\n","
\n

{{'dataBreachReport' | i18n}}

\n
\n

{{'breachDesc' | i18n}}

\n
\n
\n
\n \n \n {{'breachCheckUsernameEmail' | i18n}}\n
\n
\n \n
\n
\n

{{'reportError' | i18n}}...

\n \n \n {{'breachUsernameNotFound' | i18n : checkedUsername}}\n \n \n {{'breachUsernameFound' | i18n : checkedUsername : breachedAccounts.length}}\n \n
    \n
  • \n
    \n
    \n \"\"\n
    \n
    \n

    {{a.title}}

    \n

    \n

    {{'compromisedData' | i18n}}:

    \n
      \n
    • {{d}}
    • \n
    \n
    \n
    \n
    \n
    {{'website' | i18n}}
    \n
    {{a.domain}}
    \n
    {{'affectedUsers' | i18n}}
    \n
    {{a.pwnCount | number}}
    \n
    {{'breachOccurred' | i18n}}
    \n
    {{a.breachDate | date: 'mediumDate'}}
    \n
    {{'breachReported' | i18n}}
    \n
    {{a.addedDate | date: 'mediumDate'}}
    \n
    \n
    \n
    \n
  • \n
\n
\n
\n","import { ToasterService } from 'angular2-toaster';\r\nimport { Angulartics2 } from 'angulartics2';\r\n\r\nimport { OnInit } from '@angular/core';\r\n\r\nimport { I18nService } from '../../abstractions/i18n.service';\r\nimport { PasswordGenerationService } from '../../abstractions/passwordGeneration.service';\r\nimport { PlatformUtilsService } from '../../abstractions/platformUtils.service';\r\n\r\nimport { PasswordHistory } from '../../models/domain/passwordHistory';\r\n\r\nexport class PasswordGeneratorHistoryComponent implements OnInit {\r\n history: PasswordHistory[] = [];\r\n\r\n constructor(protected passwordGenerationService: PasswordGenerationService, protected analytics: Angulartics2,\r\n protected platformUtilsService: PlatformUtilsService, protected i18nService: I18nService,\r\n protected toasterService: ToasterService, private win: Window) { }\r\n\r\n async ngOnInit() {\r\n this.history = await this.passwordGenerationService.getHistory();\r\n }\r\n\r\n clear() {\r\n this.history = [];\r\n this.passwordGenerationService.clear();\r\n }\r\n\r\n copy(password: string) {\r\n this.analytics.eventTrack.next({ action: 'Copied Historical Password' });\n const copyOptions = this.win != null ? { doc: this.win.document } : null;\r\n this.platformUtilsService.copyToClipboard(password, copyOptions);\r\n this.toasterService.popAsync('info', null, this.i18nService.t('valueCopied', this.i18nService.t('password')));\r\n }\r\n}\r\n","import { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport {\n EventEmitter,\n Input,\n OnInit,\n Output,\n} from '@angular/core';\n\nimport { I18nService } from '../../abstractions/i18n.service';\nimport { PasswordGenerationService } from '../../abstractions/passwordGeneration.service';\nimport { PlatformUtilsService } from '../../abstractions/platformUtils.service';\n\nexport class PasswordGeneratorComponent implements OnInit {\n @Input() showSelect: boolean = false;\n @Output() onSelected = new EventEmitter();\n\n options: any = {};\n password: string = '-';\n showOptions = false;\n avoidAmbiguous = false;\n\n constructor(protected passwordGenerationService: PasswordGenerationService, protected analytics: Angulartics2,\n protected platformUtilsService: PlatformUtilsService, protected i18nService: I18nService,\n protected toasterService: ToasterService, private win: Window) { }\n\n async ngOnInit() {\n this.options = await this.passwordGenerationService.getOptions();\n this.avoidAmbiguous = !this.options.ambiguous;\n this.password = await this.passwordGenerationService.generatePassword(this.options);\n this.analytics.eventTrack.next({ action: 'Generated Password' });\n await this.passwordGenerationService.addHistory(this.password);\n }\n\n async sliderChanged() {\n this.saveOptions(false);\n await this.passwordGenerationService.addHistory(this.password);\n this.analytics.eventTrack.next({ action: 'Regenerated Password' });\n }\n\n async sliderInput() {\n this.normalizeOptions();\n this.password = await this.passwordGenerationService.generatePassword(this.options);\n }\n\n async saveOptions(regenerate: boolean = true) {\n this.normalizeOptions();\n await this.passwordGenerationService.saveOptions(this.options);\n\n if (regenerate) {\n await this.regenerate();\n }\n }\n\n async regenerate() {\n this.password = await this.passwordGenerationService.generatePassword(this.options);\n await this.passwordGenerationService.addHistory(this.password);\n this.analytics.eventTrack.next({ action: 'Regenerated Password' });\n }\n\n copy() {\n this.analytics.eventTrack.next({ action: 'Copied Generated Password' });\n const copyOptions = this.win != null ? { doc: this.win.document } : null;\n this.platformUtilsService.copyToClipboard(this.password, copyOptions);\n this.toasterService.popAsync('info', null, this.i18nService.t('valueCopied', this.i18nService.t('password')));\n }\n\n select() {\n this.analytics.eventTrack.next({ action: 'Selected Generated Password' });\n this.onSelected.emit(this.password);\n }\n\n toggleOptions() {\n this.showOptions = !this.showOptions;\n }\n\n private normalizeOptions() {\n this.options.minLowercase = 0;\n this.options.minUppercase = 0;\n this.options.ambiguous = !this.avoidAmbiguous;\n\n if (!this.options.uppercase && !this.options.lowercase && !this.options.number && !this.options.special) {\n this.options.lowercase = true;\n const lowercase = document.querySelector('#lowercase') as HTMLInputElement;\n if (lowercase) {\n lowercase.checked = true;\n }\n }\n\n if (!this.options.length || this.options.length < 5) {\n this.options.length = 5;\n } else if (this.options.length > 128) {\n this.options.length = 128;\n }\n\n if (!this.options.minNumber) {\n this.options.minNumber = 0;\n } else if (this.options.minNumber > this.options.length) {\n this.options.minNumber = this.options.length;\n } else if (this.options.minNumber > 9) {\n this.options.minNumber = 9;\n }\n\n if (!this.options.minSpecial) {\n this.options.minSpecial = 0;\n } else if (this.options.minSpecial > this.options.length) {\n this.options.minSpecial = this.options.length;\n } else if (this.options.minSpecial > 9) {\n this.options.minSpecial = 9;\n }\n\n if (this.options.minSpecial + this.options.minNumber > this.options.length) {\n this.options.minSpecial = this.options.length - this.options.minNumber;\n }\n }\n}\n","
\n

{{'passwordGenerator' | i18n}}

\n
\n
\n
\n {{password}}\n
\n
\n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n
\n
\n \n \n
\n
\n \n
\n
\n\n","import { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport {\n EventEmitter,\n Output,\n} from '@angular/core';\n\nimport { CryptoService } from '../../abstractions/crypto.service';\nimport { ExportService } from '../../abstractions/export.service';\nimport { I18nService } from '../../abstractions/i18n.service';\nimport { PlatformUtilsService } from '../../abstractions/platformUtils.service';\nimport { UserService } from '../../abstractions/user.service';\n\nexport class ExportComponent {\n @Output() onSaved = new EventEmitter();\n\n formPromise: Promise;\n masterPassword: string;\n showPassword = false;\n\n constructor(protected analytics: Angulartics2, protected toasterService: ToasterService,\n protected cryptoService: CryptoService, protected userService: UserService,\n protected i18nService: I18nService, protected platformUtilsService: PlatformUtilsService,\n protected exportService: ExportService, protected win: Window) { }\n\n async submit() {\n if (this.masterPassword == null || this.masterPassword === '') {\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'),\n this.i18nService.t('invalidMasterPassword'));\n return;\n }\n\n const email = await this.userService.getEmail();\n const key = await this.cryptoService.makeKey(this.masterPassword, email);\n const keyHash = await this.cryptoService.hashPassword(this.masterPassword, key);\n const storedKeyHash = await this.cryptoService.getKeyHash();\n\n if (storedKeyHash != null && keyHash != null && storedKeyHash === keyHash) {\n try {\n this.formPromise = this.getExportData();\n const data = await this.formPromise;\n this.analytics.eventTrack.next({ action: 'Exported Data' });\n this.downloadFile(data);\n this.saved();\n } catch { }\n } else {\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'),\n this.i18nService.t('invalidMasterPassword'));\n }\n }\n\n togglePassword() {\n this.analytics.eventTrack.next({ action: 'Toggled Master Password on Export' });\n this.showPassword = !this.showPassword;\n document.getElementById('masterPassword').focus();\n }\n\n protected saved() {\n this.onSaved.emit();\n }\n\n protected getExportData() {\n return this.exportService.getExport('csv');\n }\n\n protected getFileName(prefix?: string) {\n return this.exportService.getFileName(prefix);\n }\n\n private downloadFile(csv: string): void {\n const fileName = this.getFileName();\n this.platformUtilsService.saveFile(this.win, csv, { type: 'text/plain' }, fileName);\n }\n}\n","import { BaseImporter } from './baseImporter';\r\nimport { Importer } from './importer';\r\n\r\nimport { ImportResult } from '../models/domain/importResult';\r\nimport { CipherView } from '../models/view';\r\n\r\nexport class ZohoVaultCsvImporter extends BaseImporter implements Importer {\r\n parse(data: string): ImportResult {\r\n const result = new ImportResult();\r\n const results = this.parseCsv(data, true);\r\n if (results == null) {\r\n result.success = false;\r\n return result;\r\n }\r\n\r\n results.forEach((value) => {\r\n if (this.isNullOrWhitespace(value['Secret Name'])) {\r\n return;\r\n }\r\n this.processFolder(result, this.getValueOrDefault(value.ChamberName));\r\n const cipher = this.initLoginCipher();\r\n cipher.favorite = this.getValueOrDefault(value.Favorite, '0') === '1';\r\n cipher.notes = this.getValueOrDefault(value.Notes);\r\n cipher.name = this.getValueOrDefault(value['Secret Name'], '--');\r\n cipher.login.uris = this.makeUriArray(value['Secret URL']);\r\n this.parseData(cipher, value.SecretData);\r\n this.parseData(cipher, value.CustomData);\r\n this.convertToNoteIfNeeded(cipher);\r\n this.cleanupCipher(cipher);\r\n result.ciphers.push(cipher);\r\n });\r\n\r\n if (this.organization) {\r\n this.moveFoldersToCollections(result);\r\n }\r\n\r\n result.success = true;\r\n return result;\r\n }\r\n\r\n private parseData(cipher: CipherView, data: string) {\r\n if (this.isNullOrWhitespace(data)) {\r\n return;\r\n }\r\n const dataLines = this.splitNewLine(data);\r\n dataLines.forEach((line) => {\r\n const delimPosition = line.indexOf(':');\r\n if (delimPosition < 0) {\r\n return;\r\n }\r\n const field = line.substring(0, delimPosition);\r\n const value = line.length > delimPosition ? line.substring(delimPosition + 1) : null;\r\n if (this.isNullOrWhitespace(field) || this.isNullOrWhitespace(value) || field === 'SecretType') {\r\n return;\r\n }\r\n const fieldLower = field.toLowerCase();\r\n if (cipher.login.username == null && this.usernameFieldNames.indexOf(fieldLower) > -1) {\r\n cipher.login.username = value;\r\n } else if (cipher.login.password == null && this.passwordFieldNames.indexOf(fieldLower) > -1) {\r\n cipher.login.password = value;\r\n } else {\r\n this.processKvp(cipher, field, value);\r\n }\r\n });\r\n }\r\n}\r\n","import { BaseImporter } from './baseImporter';\nimport { Importer } from './importer';\n\nimport { ImportResult } from '../models/domain/importResult';\n\nexport class UpmCsvImporter extends BaseImporter implements Importer {\n parse(data: string): ImportResult {\n const result = new ImportResult();\n const results = this.parseCsv(data, false);\n if (results == null) {\n result.success = false;\n return result;\n }\n\n results.forEach((value) => {\n if (value.length !== 5) {\n return;\n }\n const cipher = this.initLoginCipher();\n cipher.name = this.getValueOrDefault(value[0], '--');\n cipher.notes = this.getValueOrDefault(value[4]);\n cipher.login.username = this.getValueOrDefault(value[1]);\n cipher.login.password = this.getValueOrDefault(value[2]);\n cipher.login.uris = this.makeUriArray(value[3]);\n this.cleanupCipher(cipher);\n result.ciphers.push(cipher);\n });\n\n result.success = true;\n return result;\n }\n}\n","import { BaseImporter } from './baseImporter';\nimport { Importer } from './importer';\n\nimport { ImportResult } from '../models/domain/importResult';\n\nimport { CardView } from '../models/view/cardView';\nimport { SecureNoteView } from '../models/view/secureNoteView';\n\nimport { CipherType } from '../enums/cipherType';\nimport { SecureNoteType } from '../enums/secureNoteType';\n\nconst PropertiesToIgnore = ['kind', 'autologin', 'favorite', 'hexcolor', 'protectedwithpassword', 'subdomainonly',\n 'type', 'tk_export_version', 'note', 'title', 'document_content',\n];\n\nexport class TrueKeyCsvImporter extends BaseImporter implements Importer {\n parse(data: string): ImportResult {\n const result = new ImportResult();\n const results = this.parseCsv(data, true);\n if (results == null) {\n result.success = false;\n return result;\n }\n\n results.forEach((value) => {\n const cipher = this.initLoginCipher();\n cipher.favorite = this.getValueOrDefault(value.favorite, '').toLowerCase() === 'true';\n cipher.name = this.getValueOrDefault(value.name, '--');\n cipher.notes = this.getValueOrDefault(value.memo, '');\n cipher.login.username = this.getValueOrDefault(value.login);\n cipher.login.password = this.getValueOrDefault(value.password);\n cipher.login.uris = this.makeUriArray(value.url);\n\n if (value.kind !== 'login') {\n cipher.name = this.getValueOrDefault(value.title, '--');\n cipher.notes = this.getValueOrDefault(value.note, '');\n }\n\n if (value.kind === 'cc') {\n cipher.type = CipherType.Card;\n cipher.card = new CardView();\n cipher.card.cardholderName = this.getValueOrDefault(value.cardholder);\n cipher.card.number = this.getValueOrDefault(value.number);\n cipher.card.brand = this.getCardBrand(cipher.card.number);\n if (!this.isNullOrWhitespace(value.expiryDate)) {\n try {\n const expDate = new Date(value.expiryDate);\n cipher.card.expYear = expDate.getFullYear().toString();\n cipher.card.expMonth = (expDate.getMonth() + 1).toString();\n } catch { }\n }\n } else if (value.kind !== 'login') {\n cipher.type = CipherType.SecureNote;\n cipher.secureNote = new SecureNoteView();\n cipher.secureNote.type = SecureNoteType.Generic;\n if (!this.isNullOrWhitespace(cipher.notes)) {\n cipher.notes = this.getValueOrDefault(value.document_content, '');\n }\n for (const property in value) {\n if (value.hasOwnProperty(property) && PropertiesToIgnore.indexOf(property.toLowerCase()) < 0 &&\n !this.isNullOrWhitespace(value[property])) {\n this.processKvp(cipher, property, value[property]);\n }\n }\n }\n\n this.cleanupCipher(cipher);\n result.ciphers.push(cipher);\n });\n\n result.success = true;\n return result;\n }\n}\n","import { BaseImporter } from './baseImporter';\r\nimport { Importer } from './importer';\r\n\r\nimport { ImportResult } from '../models/domain/importResult';\r\n\r\nexport class StickyPasswordXmlImporter extends BaseImporter implements Importer {\r\n parse(data: string): ImportResult {\r\n const result = new ImportResult();\r\n const doc = this.parseXml(data);\r\n if (doc == null) {\r\n result.success = false;\r\n return result;\r\n }\r\n\r\n const loginNodes = doc.querySelectorAll('root > Database > Logins > Login');\r\n Array.from(loginNodes).forEach((loginNode) => {\r\n const accountId = loginNode.getAttribute('ID');\r\n if (this.isNullOrWhitespace(accountId)) {\r\n return;\r\n }\r\n\r\n const usernameText = loginNode.getAttribute('Name');\r\n const passwordText = loginNode.getAttribute('Password');\r\n let titleText: string = null;\r\n let linkText: string = null;\r\n let notesText: string = null;\r\n let groupId: string = null;\r\n let groupText: string = null;\r\n\r\n const accountLogin = doc.querySelector('root > Database > Accounts > Account > ' +\r\n 'LoginLinks > Login[SourceLoginID=\"' + accountId + '\"]');\r\n if (accountLogin != null) {\r\n const account = accountLogin.parentElement.parentElement;\r\n if (account != null) {\r\n titleText = account.getAttribute('Name');\r\n linkText = account.getAttribute('Link');\r\n groupId = account.getAttribute('ParentID');\r\n notesText = account.getAttribute('Comments');\r\n if (!this.isNullOrWhitespace(notesText)) {\r\n notesText = notesText.split('/n').join('\\n');\r\n }\r\n }\r\n }\r\n\r\n if (!this.isNullOrWhitespace(groupId)) {\r\n groupText = this.buildGroupText(doc, groupId, '');\r\n this.processFolder(result, groupText);\r\n }\r\n\r\n const cipher = this.initLoginCipher();\r\n cipher.name = this.getValueOrDefault(titleText, '--');\r\n cipher.notes = this.getValueOrDefault(notesText);\r\n cipher.login.username = this.getValueOrDefault(usernameText);\r\n cipher.login.password = this.getValueOrDefault(passwordText);\r\n cipher.login.uris = this.makeUriArray(linkText);\r\n this.cleanupCipher(cipher);\r\n result.ciphers.push(cipher);\r\n });\r\n\r\n if (this.organization) {\r\n this.moveFoldersToCollections(result);\r\n }\r\n\r\n result.success = true;\r\n return result;\r\n }\r\n\r\n buildGroupText(doc: Document, groupId: string, groupText: string): string {\r\n const group = doc.querySelector('root > Database > Groups > Group[ID=\"' + groupId + '\"]');\r\n if (group == null) {\r\n return groupText;\r\n }\r\n if (!this.isNullOrWhitespace(groupText)) {\r\n groupText = '/' + groupText;\r\n }\r\n groupText = group.getAttribute('Name') + groupText;\r\n return this.buildGroupText(doc, group.getAttribute('ParentID'), groupText);\r\n }\r\n}\r\n","import { BaseImporter } from './baseImporter';\r\nimport { Importer } from './importer';\r\n\r\nimport { ImportResult } from '../models/domain/importResult';\r\nimport { CipherView } from '../models/view/cipherView';\r\n\r\nexport class SplashIdCsvImporter extends BaseImporter implements Importer {\r\n parse(data: string): ImportResult {\r\n const result = new ImportResult();\r\n const results = this.parseCsv(data, false);\r\n if (results == null) {\r\n result.success = false;\r\n return result;\r\n }\r\n\r\n results.forEach((value) => {\r\n if (value.length < 3) {\r\n return;\r\n }\r\n\r\n this.processFolder(result, this.getValueOrDefault(value[value.length - 1]));\r\n const cipher = this.initLoginCipher();\r\n cipher.notes = this.getValueOrDefault(value[value.length - 2], '');\r\n cipher.name = this.getValueOrDefault(value[1], '--');\r\n\r\n if (value[0] === 'Web Logins' || value[0] === 'Servers' || value[0] === 'Email Accounts') {\r\n cipher.login.username = this.getValueOrDefault(value[2]);\r\n cipher.login.password = this.getValueOrDefault(value[3]);\r\n cipher.login.uris = this.makeUriArray(value[4]);\r\n this.parseFieldsToNotes(cipher, 5, value);\r\n } else {\r\n this.parseFieldsToNotes(cipher, 2, value);\r\n }\r\n\r\n this.convertToNoteIfNeeded(cipher);\r\n this.cleanupCipher(cipher);\r\n result.ciphers.push(cipher);\r\n });\r\n\r\n if (this.organization) {\r\n this.moveFoldersToCollections(result);\r\n }\r\n\r\n result.success = true;\r\n return result;\r\n }\r\n\r\n private parseFieldsToNotes(cipher: CipherView, startIndex: number, value: any) {\r\n // last 3 rows do not get parsed\r\n for (let i = startIndex; i < value.length - 3; i++) {\r\n if (this.isNullOrWhitespace(value[i])) {\r\n continue;\r\n }\r\n cipher.notes += (value[i] + '\\n');\r\n }\r\n }\r\n}\r\n","import { BaseImporter } from './baseImporter';\nimport { Importer } from './importer';\n\nimport { ImportResult } from '../models/domain/importResult';\n\nexport class SaferPassCsvImporter extends BaseImporter implements Importer {\n parse(data: string): ImportResult {\n const result = new ImportResult();\n const results = this.parseCsv(data, true);\n if (results == null) {\n result.success = false;\n return result;\n }\n\n results.forEach((value) => {\n const cipher = this.initLoginCipher();\n cipher.name = this.getValueOrDefault(this.nameFromUrl(value.url), '--');\n cipher.notes = this.getValueOrDefault(value.notes);\n cipher.login.username = this.getValueOrDefault(value.username);\n cipher.login.password = this.getValueOrDefault(value.password);\n cipher.login.uris = this.makeUriArray(value.url);\n this.cleanupCipher(cipher);\n result.ciphers.push(cipher);\n });\n\n result.success = true;\n return result;\n }\n}\n","import { BaseImporter } from './baseImporter';\nimport { Importer } from './importer';\n\nimport { ImportResult } from '../models/domain/importResult';\n\nimport { FolderView } from '../models/view/folderView';\nimport { SecureNoteView } from '../models/view/secureNoteView';\n\nimport { CipherType } from '../enums/cipherType';\nimport { SecureNoteType } from '../enums/secureNoteType';\n\nexport class SafeInCloudXmlImporter extends BaseImporter implements Importer {\n parse(data: string): ImportResult {\n const result = new ImportResult();\n const doc = this.parseXml(data);\n if (doc == null) {\n result.success = false;\n return result;\n }\n\n const db = doc.querySelector('database');\n if (db == null) {\n result.errorMessage = 'Missing `database` node.';\n result.success = false;\n return result;\n }\n\n const foldersMap = new Map();\n\n Array.from(doc.querySelectorAll('database > label')).forEach((labelEl) => {\n const name = labelEl.getAttribute('name');\n const id = labelEl.getAttribute('id');\n if (!this.isNullOrWhitespace(name) && !this.isNullOrWhitespace(id)) {\n foldersMap.set(id, result.folders.length);\n const folder = new FolderView();\n folder.name = name;\n result.folders.push(folder);\n }\n });\n\n Array.from(doc.querySelectorAll('database > card')).forEach((cardEl) => {\n if (cardEl.getAttribute('template') === 'true') {\n return;\n }\n\n const labelIdEl = this.querySelectorDirectChild(cardEl, 'label_id');\n if (labelIdEl != null) {\n const labelId = labelIdEl.textContent;\n if (!this.isNullOrWhitespace(labelId) && foldersMap.has(labelId)) {\n result.folderRelationships.push([result.ciphers.length, foldersMap.get(labelId)]);\n }\n }\n\n const cipher = this.initLoginCipher();\n cipher.name = this.getValueOrDefault(cardEl.getAttribute('title'), '--');\n\n const cardType = cardEl.getAttribute('type');\n if (cardType === 'note') {\n cipher.type = CipherType.SecureNote;\n cipher.secureNote = new SecureNoteView();\n cipher.secureNote.type = SecureNoteType.Generic;\n } else {\n Array.from(this.querySelectorAllDirectChild(cardEl, 'field')).forEach((fieldEl) => {\n const text = fieldEl.textContent;\n if (this.isNullOrWhitespace(text)) {\n return;\n }\n const name = fieldEl.getAttribute('name');\n const fieldType = this.getValueOrDefault(fieldEl.getAttribute('type'), '').toLowerCase();\n if (fieldType === 'login') {\n cipher.login.username = text;\n } else if (fieldType === 'password') {\n cipher.login.password = text;\n } else if (fieldType === 'notes') {\n cipher.notes += (text + '\\n');\n } else if (fieldType === 'weblogin' || fieldType === 'website') {\n cipher.login.uris = this.makeUriArray(text);\n } else {\n this.processKvp(cipher, name, text);\n }\n });\n }\n\n Array.from(this.querySelectorAllDirectChild(cardEl, 'notes')).forEach((notesEl) => {\n cipher.notes += (notesEl.textContent + '\\n');\n });\n\n this.cleanupCipher(cipher);\n result.ciphers.push(cipher);\n });\n\n if (this.organization) {\n this.moveFoldersToCollections(result);\n }\n\n result.success = true;\n return result;\n }\n}\n","import { BaseImporter } from './baseImporter';\r\nimport { Importer } from './importer';\r\n\r\nimport { ImportResult } from '../models/domain/importResult';\r\n\r\nexport class RoboFormCsvImporter extends BaseImporter implements Importer {\r\n parse(data: string): ImportResult {\r\n const result = new ImportResult();\r\n const results = this.parseCsv(data, true);\r\n if (results == null) {\r\n result.success = false;\r\n return result;\r\n }\r\n\r\n let i = 1;\r\n results.forEach((value) => {\r\n const folder = !this.isNullOrWhitespace(value.Folder) && value.Folder.startsWith('/') ?\r\n value.Folder.replace('/', '') : value.Folder;\r\n const folderName = !this.isNullOrWhitespace(folder) ? folder : null;\r\n this.processFolder(result, folderName);\r\n\r\n const cipher = this.initLoginCipher();\r\n cipher.notes = this.getValueOrDefault(value.Note);\r\n cipher.name = this.getValueOrDefault(value.Name, '--');\r\n cipher.login.username = this.getValueOrDefault(value.Login);\r\n cipher.login.password = this.getValueOrDefault(value.Pwd);\r\n cipher.login.uris = this.makeUriArray(value.Url);\r\n this.cleanupCipher(cipher);\r\n\r\n if (i === results.length && cipher.name === '--' && this.isNullOrWhitespace(cipher.login.password)) {\r\n return;\r\n }\r\n result.ciphers.push(cipher);\r\n i++;\r\n });\r\n\r\n if (this.organization) {\r\n this.moveFoldersToCollections(result);\r\n }\r\n\r\n result.success = true;\r\n return result;\r\n }\r\n}\r\n","import { BaseImporter } from './baseImporter';\r\nimport { Importer } from './importer';\r\n\r\nimport { ImportResult } from '../models/domain/importResult';\r\n\r\nexport class PasswordSafeXmlImporter extends BaseImporter implements Importer {\r\n parse(data: string): ImportResult {\r\n const result = new ImportResult();\r\n const doc = this.parseXml(data);\r\n if (doc == null) {\r\n result.success = false;\r\n return result;\r\n }\r\n\r\n const passwordSafe = doc.querySelector('passwordsafe');\r\n if (passwordSafe == null) {\r\n result.errorMessage = 'Missing `passwordsafe` node.';\r\n result.success = false;\r\n return result;\r\n }\r\n\r\n const notesDelimiter = passwordSafe.getAttribute('delimiter');\r\n const entries = doc.querySelectorAll('passwordsafe > entry');\r\n Array.from(entries).forEach((entry) => {\r\n const group = this.querySelectorDirectChild(entry, 'group');\r\n const groupText = group != null && !this.isNullOrWhitespace(group.textContent) ?\r\n group.textContent.split('.').join('/') : null;\r\n this.processFolder(result, groupText);\r\n\r\n const title = this.querySelectorDirectChild(entry, 'title');\r\n const username = this.querySelectorDirectChild(entry, 'username');\r\n const email = this.querySelectorDirectChild(entry, 'email');\r\n const password = this.querySelectorDirectChild(entry, 'password');\r\n const url = this.querySelectorDirectChild(entry, 'url');\r\n const notes = this.querySelectorDirectChild(entry, 'notes');\r\n const cipher = this.initLoginCipher();\r\n cipher.name = title != null ? this.getValueOrDefault(title.textContent, '--') : '--';\r\n cipher.notes = notes != null ?\r\n this.getValueOrDefault(notes.textContent, '').split(notesDelimiter).join('\\n') : null;\r\n cipher.login.username = username != null ? this.getValueOrDefault(username.textContent) : null;\r\n cipher.login.password = password != null ? this.getValueOrDefault(password.textContent) : null;\r\n cipher.login.uris = url != null ? this.makeUriArray(url.textContent) : null;\r\n\r\n if (this.isNullOrWhitespace(cipher.login.username) && email != null) {\r\n cipher.login.username = this.getValueOrDefault(email.textContent);\r\n } else if (email != null && !this.isNullOrWhitespace(email.textContent)) {\r\n cipher.notes = this.isNullOrWhitespace(cipher.notes) ? 'Email: ' + email.textContent\r\n : (cipher.notes + '\\n' + 'Email: ' + email.textContent);\r\n }\r\n\r\n this.cleanupCipher(cipher);\r\n result.ciphers.push(cipher);\r\n });\r\n\r\n if (this.organization) {\r\n this.moveFoldersToCollections(result);\r\n }\r\n\r\n result.success = true;\r\n return result;\r\n }\r\n}\r\n","import { BaseImporter } from './baseImporter';\nimport { Importer } from './importer';\n\nimport { ImportResult } from '../models/domain/importResult';\n\nexport class PasswordDragonXmlImporter extends BaseImporter implements Importer {\n parse(data: string): ImportResult {\n const result = new ImportResult();\n const doc = this.parseXml(data);\n if (doc == null) {\n result.success = false;\n return result;\n }\n\n const records = doc.querySelectorAll('PasswordManager > record');\n Array.from(records).forEach((record) => {\n const category = this.querySelectorDirectChild(record, 'Category');\n const categoryText = category != null && !this.isNullOrWhitespace(category.textContent) &&\n category.textContent !== 'Unfiled' ? category.textContent : null;\n this.processFolder(result, categoryText);\n\n const accountName = this.querySelectorDirectChild(record, 'Account-Name');\n const userId = this.querySelectorDirectChild(record, 'User-Id');\n const password = this.querySelectorDirectChild(record, 'Password');\n const url = this.querySelectorDirectChild(record, 'URL');\n const notes = this.querySelectorDirectChild(record, 'Notes');\n const cipher = this.initLoginCipher();\n cipher.name = accountName != null ? this.getValueOrDefault(accountName.textContent, '--') : '--';\n cipher.notes = notes != null ? this.getValueOrDefault(notes.textContent) : '';\n cipher.login.username = userId != null ? this.getValueOrDefault(userId.textContent) : null;\n cipher.login.password = password != null ? this.getValueOrDefault(password.textContent) : null;\n cipher.login.uris = url != null ? this.makeUriArray(url.textContent) : null;\n\n const attributes: string[] = [];\n for (let i = 1; i <= 10; i++) {\n attributes.push('Attribute-' + i);\n }\n\n this.querySelectorAllDirectChild(record, attributes.join(',')).forEach((attr) => {\n if (this.isNullOrWhitespace(attr.textContent) || attr.textContent === 'null') {\n return;\n }\n this.processKvp(cipher, attr.tagName, attr.textContent);\n });\n\n this.cleanupCipher(cipher);\n result.ciphers.push(cipher);\n });\n\n if (this.organization) {\n this.moveFoldersToCollections(result);\n }\n\n result.success = true;\n return result;\n }\n}\n","import { BaseImporter } from './baseImporter';\r\nimport { Importer } from './importer';\r\n\r\nimport { ImportResult } from '../models/domain/importResult';\r\n\r\nimport { CardView } from '../models/view/cardView';\r\n\r\nimport { CipherType } from '../enums/cipherType';\r\n\r\nexport class PasswordBossJsonImporter extends BaseImporter implements Importer {\r\n parse(data: string): ImportResult {\r\n const result = new ImportResult();\r\n const results = JSON.parse(data);\r\n if (results == null) {\r\n result.success = false;\r\n return result;\r\n }\r\n\r\n results.forEach((value: any) => {\r\n const cipher = this.initLoginCipher();\r\n cipher.name = this.getValueOrDefault(value.name, '--');\r\n cipher.login.uris = this.makeUriArray(value.login_url);\r\n\r\n if (value.identifiers == null) {\r\n return;\r\n }\r\n\r\n if (!this.isNullOrWhitespace(value.identifiers.notes)) {\r\n cipher.notes = value.identifiers.notes.split('\\\\r\\\\n').join('\\n').split('\\\\n').join('\\n');\r\n }\r\n\r\n if (value.type === 'CreditCard') {\r\n cipher.card = new CardView();\r\n cipher.type = CipherType.Card;\r\n }\r\n\r\n for (const property in value.identifiers) {\r\n if (!value.identifiers.hasOwnProperty(property)) {\r\n continue;\r\n }\r\n const valObj = value.identifiers[property];\r\n const val = valObj != null ? valObj.toString() : null;\r\n if (this.isNullOrWhitespace(val) || property === 'notes' || property === 'ignoreItemInSecurityScore') {\r\n continue;\r\n }\r\n\r\n if (cipher.type === CipherType.Card) {\r\n if (property === 'cardNumber') {\r\n cipher.card.number = val;\r\n cipher.card.brand = this.getCardBrand(val);\r\n continue;\r\n } else if (property === 'nameOnCard') {\r\n cipher.card.cardholderName = val;\r\n continue;\r\n } else if (property === 'security_code') {\r\n cipher.card.code = val;\r\n continue;\r\n } else if (property === 'expires') {\r\n try {\r\n const expDate = new Date(val);\r\n cipher.card.expYear = expDate.getFullYear().toString();\r\n cipher.card.expMonth = (expDate.getMonth() + 1).toString();\r\n } catch { }\r\n continue;\r\n } else if (property === 'cardType') {\r\n continue;\r\n }\r\n } else {\r\n if (property === 'username') {\r\n cipher.login.username = val;\r\n continue;\r\n } else if (property === 'password') {\r\n cipher.login.password = val;\r\n continue;\r\n } else if ((cipher.login.uris == null || cipher.login.uris.length === 0) &&\r\n this.uriFieldNames.indexOf(property) > -1) {\r\n cipher.login.uris = this.makeUriArray(val);\r\n continue;\r\n }\r\n }\r\n\r\n this.processKvp(cipher, property, val);\r\n }\r\n\r\n this.convertToNoteIfNeeded(cipher);\r\n this.cleanupCipher(cipher);\r\n result.ciphers.push(cipher);\r\n });\r\n\r\n result.success = true;\r\n return result;\r\n }\r\n}\r\n","import { BaseImporter } from './baseImporter';\r\nimport { Importer } from './importer';\r\n\r\nimport { ImportResult } from '../models/domain/importResult';\r\n\r\nexport class PasswordAgentCsvImporter extends BaseImporter implements Importer {\r\n parse(data: string): ImportResult {\r\n const result = new ImportResult();\r\n const results = this.parseCsv(data, false);\r\n if (results == null) {\r\n result.success = false;\r\n return result;\r\n }\r\n\r\n results.forEach((value) => {\r\n if (value.length < 9) {\r\n return;\r\n }\r\n const folder = this.getValueOrDefault(value[8], '(None)');\r\n const folderName = folder !== '(None)' ? folder.split('\\\\').join('/') : null;\r\n this.processFolder(result, folderName);\r\n const cipher = this.initLoginCipher();\r\n cipher.notes = this.getValueOrDefault(value[3]);\r\n cipher.name = this.getValueOrDefault(value[0], '--');\r\n cipher.login.username = this.getValueOrDefault(value[1]);\r\n cipher.login.password = this.getValueOrDefault(value[2]);\r\n cipher.login.uris = this.makeUriArray(value[4]);\r\n this.convertToNoteIfNeeded(cipher);\r\n this.cleanupCipher(cipher);\r\n result.ciphers.push(cipher);\r\n });\r\n\r\n if (this.organization) {\r\n this.moveFoldersToCollections(result);\r\n }\r\n\r\n result.success = true;\r\n return result;\r\n }\r\n}\r\n","import { BaseImporter } from './baseImporter';\r\nimport { Importer } from './importer';\r\n\r\nimport { ImportResult } from '../models/domain/importResult';\r\n\r\nexport class PassKeepCsvImporter extends BaseImporter implements Importer {\r\n parse(data: string): ImportResult {\r\n const result = new ImportResult();\r\n const results = this.parseCsv(data, true);\r\n if (results == null) {\r\n result.success = false;\r\n return result;\r\n }\r\n\r\n results.forEach((value) => {\r\n this.processFolder(result, this.getValue('category', value));\r\n const cipher = this.initLoginCipher();\r\n cipher.notes = this.getValue('description', value);\r\n cipher.name = this.getValueOrDefault(this.getValue('title', value), '--');\r\n cipher.login.username = this.getValue('username', value);\r\n cipher.login.password = this.getValue('password', value);\r\n cipher.login.uris = this.makeUriArray(this.getValue('site', value));\r\n this.processKvp(cipher, 'Password 2', this.getValue('password2', value));\r\n this.cleanupCipher(cipher);\r\n result.ciphers.push(cipher);\r\n });\r\n\r\n if (this.organization) {\r\n this.moveFoldersToCollections(result);\r\n }\r\n\r\n result.success = true;\r\n return result;\r\n }\r\n\r\n private getValue(key: string, value: any) {\r\n return this.getValueOrDefault(value[key], this.getValueOrDefault(value[(' ' + key)]));\r\n }\r\n}\r\n","import { BaseImporter } from './baseImporter';\nimport { Importer } from './importer';\n\nimport { ImportResult } from '../models/domain/importResult';\n\nimport { CollectionView } from '../models/view/collectionView';\nimport { FolderView } from '../models/view/folderView';\n\nexport class PadlockCsvImporter extends BaseImporter implements Importer {\n parse(data: string): ImportResult {\n const result = new ImportResult();\n const results = this.parseCsv(data, false);\n if (results == null) {\n result.success = false;\n return result;\n }\n\n let headers: string[] = null;\n results.forEach((value) => {\n if (headers == null) {\n headers = value.map((v: string) => v);\n return;\n }\n\n if (value.length < 2 || value.length !== headers.length) {\n return;\n }\n\n if (!this.isNullOrWhitespace(value[1])) {\n if (this.organization) {\n const tags = (value[1] as string).split(',');\n tags.forEach((tag) => {\n tag = tag.trim();\n let addCollection = true;\n let collectionIndex = result.collections.length;\n\n for (let i = 0; i < result.collections.length; i++) {\n if (result.collections[i].name === tag) {\n addCollection = false;\n collectionIndex = i;\n break;\n }\n }\n\n if (addCollection) {\n const collection = new CollectionView();\n collection.name = tag;\n result.collections.push(collection);\n }\n\n result.collectionRelationships.push([result.ciphers.length, collectionIndex]);\n });\n } else {\n const tags = (value[1] as string).split(',');\n const tag = tags.length > 0 ? tags[0].trim() : null;\n this.processFolder(result, tag);\n }\n }\n\n const cipher = this.initLoginCipher();\n cipher.name = this.getValueOrDefault(value[0], '--');\n\n for (let i = 2; i < value.length; i++) {\n const header = headers[i].trim().toLowerCase();\n if (this.isNullOrWhitespace(value[i]) || this.isNullOrWhitespace(header)) {\n continue;\n }\n\n if (this.usernameFieldNames.indexOf(header) > -1) {\n cipher.login.username = value[i];\n } else if (this.passwordFieldNames.indexOf(header) > -1) {\n cipher.login.password = value[i];\n } else if (this.uriFieldNames.indexOf(header) > -1) {\n cipher.login.uris = this.makeUriArray(value[i]);\n } else {\n this.processKvp(cipher, headers[i], value[i]);\n }\n }\n\n this.cleanupCipher(cipher);\n result.ciphers.push(cipher);\n });\n\n result.success = true;\n return result;\n }\n}\n","export class View {\r\n}\n","export { AttachmentView } from './attachmentView';\r\nexport { CardView } from './cardView';\r\nexport { CipherView } from './cipherView';\r\nexport { FieldView } from './fieldView';\r\nexport { IdentityView } from './identityView';\r\nexport { LoginUriView } from './loginUriView';\r\nexport { LoginView } from './loginView';\r\nexport { SecureNoteView } from './secureNoteView';\r\nexport { View } from './view';\r\n","import { BaseImporter } from './baseImporter';\r\nimport { Importer } from './importer';\r\n\r\nimport { ImportResult } from '../models/domain/importResult';\r\n\r\nimport { CipherType } from '../enums/cipherType';\r\nimport { CardView } from '../models/view';\r\n\r\nconst IgnoredProperties = ['ainfo', 'autosubmit', 'notesPlain', 'ps', 'scope', 'tags', 'title', 'uuid'];\r\n\r\nexport class OnePasswordWinCsvImporter extends BaseImporter implements Importer {\r\n parse(data: string): ImportResult {\r\n const result = new ImportResult();\r\n const results = this.parseCsv(data, true);\r\n if (results == null) {\r\n result.success = false;\r\n return result;\r\n }\r\n\r\n results.forEach((value) => {\r\n if (this.isNullOrWhitespace(value.title)) {\r\n return;\r\n }\r\n\r\n const cipher = this.initLoginCipher();\r\n cipher.name = this.getValueOrDefault(value.title, '--');\r\n cipher.notes = this.getValueOrDefault(value.notesPlain, '') + '\\n';\r\n\r\n if (!this.isNullOrWhitespace(value.number) && !this.isNullOrWhitespace(value['expiry date'])) {\r\n cipher.type = CipherType.Card;\r\n cipher.card = new CardView();\r\n }\r\n\r\n let altUsername: string = null;\r\n for (const property in value) {\r\n if (!value.hasOwnProperty(property) || this.isNullOrWhitespace(value[property])) {\r\n continue;\r\n }\r\n\r\n if (cipher.type === CipherType.Login) {\r\n if (this.isNullOrWhitespace(cipher.login.password) && property === 'password') {\r\n cipher.login.password = value[property];\r\n continue;\r\n } else if (this.isNullOrWhitespace(cipher.login.username) && property === 'username') {\r\n cipher.login.username = value[property];\r\n continue;\r\n } else if ((cipher.login.uris == null || cipher.login.uri.length === 0) && property === 'urls') {\r\n const urls = value[property].split(this.newLineRegex);\r\n cipher.login.uris = this.makeUriArray(urls);\r\n continue;\r\n }\r\n } else if (cipher.type === CipherType.Card) {\r\n if (this.isNullOrWhitespace(cipher.card.number) && property === 'number') {\r\n cipher.card.number = value[property];\r\n cipher.card.brand = this.getCardBrand(value.number);\r\n continue;\r\n } else if (this.isNullOrWhitespace(cipher.card.code) && property === 'verification number') {\r\n cipher.card.code = value[property];\r\n continue;\r\n } else if (this.isNullOrWhitespace(cipher.card.cardholderName) && property === 'cardholder name') {\r\n cipher.card.cardholderName = value[property];\r\n continue;\r\n } else if (this.isNullOrWhitespace(cipher.card.expiration) && property === 'expiry date' &&\r\n value[property].length === 6) {\r\n cipher.card.expMonth = (value[property] as string).substr(4, 2);\r\n if (cipher.card.expMonth[0] === '0') {\r\n cipher.card.expMonth = cipher.card.expMonth.substr(1, 1);\r\n }\r\n cipher.card.expYear = (value[property] as string).substr(0, 4);\r\n continue;\r\n } else if (property === 'type') {\r\n // Skip since brand was determined from number above\r\n continue;\r\n }\r\n }\r\n\r\n if (IgnoredProperties.indexOf(property) === -1 && !property.startsWith('section:')) {\r\n if (altUsername == null && property === 'email') {\r\n altUsername = value[property];\r\n }\r\n this.processKvp(cipher, property, value[property]);\r\n }\r\n }\r\n\r\n if (cipher.type === CipherType.Login && !this.isNullOrWhitespace(altUsername) &&\r\n this.isNullOrWhitespace(cipher.login.username) && altUsername.indexOf('://') === -1) {\r\n cipher.login.username = altUsername;\r\n }\r\n\r\n this.convertToNoteIfNeeded(cipher);\r\n this.cleanupCipher(cipher);\r\n result.ciphers.push(cipher);\r\n });\r\n\r\n result.success = true;\r\n return result;\r\n }\r\n}\r\n","import { BaseImporter } from './baseImporter';\nimport { Importer } from './importer';\n\nimport { ImportResult } from '../models/domain/importResult';\n\nimport { CardView } from '../models/view/cardView';\nimport { CipherView } from '../models/view/cipherView';\nimport { SecureNoteView } from '../models/view/secureNoteView';\n\nimport { CipherType } from '../enums/cipherType';\nimport { SecureNoteType } from '../enums/secureNoteType';\n\nexport class OnePassword1PifImporter extends BaseImporter implements Importer {\n result = new ImportResult();\n\n parse(data: string): ImportResult {\n data.split(this.newLineRegex).forEach((line) => {\n if (this.isNullOrWhitespace(line) || line[0] !== '{') {\n return;\n }\n const item = JSON.parse(line);\n const cipher = this.initLoginCipher();\n cipher.favorite = item.openContents && item.openContents.faveIndex ? true : false;\n cipher.name = this.getValueOrDefault(item.title, '--');\n\n if (item.typeName === 'securenotes.SecureNote') {\n cipher.type = CipherType.SecureNote;\n cipher.secureNote = new SecureNoteView();\n cipher.secureNote.type = SecureNoteType.Generic;\n } else if (item.typeName === 'wallet.financial.CreditCard') {\n cipher.type = CipherType.Card;\n cipher.card = new CardView();\n } else {\n cipher.login.uris = this.makeUriArray(item.location);\n }\n\n if (item.secureContents != null) {\n if (!this.isNullOrWhitespace(item.secureContents.notesPlain)) {\n cipher.notes = item.secureContents.notesPlain.split(this.newLineRegex).join('\\n') + '\\n';\n }\n if (item.secureContents.fields != null) {\n this.parseFields(item.secureContents.fields, cipher, 'designation', 'value', 'name');\n }\n if (item.secureContents.sections != null) {\n item.secureContents.sections.forEach((section: any) => {\n if (section.fields != null) {\n this.parseFields(section.fields, cipher, 'n', 'v', 't');\n }\n });\n }\n }\n\n this.cleanupCipher(cipher);\n this.result.ciphers.push(cipher);\n });\n\n this.result.success = true;\n return this.result;\n }\n\n private parseFields(fields: any[], cipher: CipherView, designationKey: string, valueKey: string, nameKey: string) {\n fields.forEach((field: any) => {\n if (field[valueKey] == null || field[valueKey].toString().trim() === '') {\n return;\n }\n\n const fieldValue = field[valueKey].toString();\n const fieldDesignation = field[designationKey] != null ? field[designationKey].toString() : null;\n\n if (cipher.type === CipherType.Login) {\n if (this.isNullOrWhitespace(cipher.login.username) && fieldDesignation === 'username') {\n cipher.login.username = fieldValue;\n return;\n } else if (this.isNullOrWhitespace(cipher.login.password) && fieldDesignation === 'password') {\n cipher.login.password = fieldValue;\n return;\n } else if (this.isNullOrWhitespace(cipher.login.totp) && fieldDesignation != null &&\n fieldDesignation.startsWith('TOTP_')) {\n cipher.login.totp = fieldValue;\n return;\n }\n } else if (cipher.type === CipherType.Card) {\n if (this.isNullOrWhitespace(cipher.card.number) && fieldDesignation === 'ccnum') {\n cipher.card.number = fieldValue;\n cipher.card.brand = this.getCardBrand(fieldValue);\n return;\n } else if (this.isNullOrWhitespace(cipher.card.code) && fieldDesignation === 'cvv') {\n cipher.card.code = fieldValue;\n return;\n } else if (this.isNullOrWhitespace(cipher.card.cardholderName) && fieldDesignation === 'cardholder') {\n cipher.card.cardholderName = fieldValue;\n return;\n } else if (this.isNullOrWhitespace(cipher.card.expiration) && fieldDesignation === 'expiry' &&\n fieldValue.length === 6) {\n cipher.card.expMonth = (fieldValue as string).substr(4, 2);\n if (cipher.card.expMonth[0] === '0') {\n cipher.card.expMonth = cipher.card.expMonth.substr(1, 1);\n }\n cipher.card.expYear = (fieldValue as string).substr(0, 4);\n return;\n } else if (fieldDesignation === 'type') {\n // Skip since brand was determined from number above\n return;\n }\n }\n\n const fieldName = this.isNullOrWhitespace(field[nameKey]) ? 'no_name' : field[nameKey];\n this.processKvp(cipher, fieldName, fieldValue);\n });\n }\n}\n","import { BaseImporter } from './baseImporter';\nimport { Importer } from './importer';\n\nimport { ImportResult } from '../models/domain/importResult';\n\nimport { CipherType } from '../enums/cipherType';\nimport { SecureNoteType } from '../enums/secureNoteType';\n\nimport { SecureNoteView } from '../models/view/secureNoteView';\n\nexport class MSecureCsvImporter extends BaseImporter implements Importer {\n parse(data: string): ImportResult {\n const result = new ImportResult();\n const results = this.parseCsv(data, false);\n if (results == null) {\n result.success = false;\n return result;\n }\n\n results.forEach((value) => {\n if (value.length < 3) {\n return;\n }\n\n const folderName = this.getValueOrDefault(value[0], 'Unassigned') !== 'Unassigned' ? value[0] : null;\n this.processFolder(result, folderName);\n\n const cipher = this.initLoginCipher();\n cipher.name = this.getValueOrDefault(value[2], '--');\n\n if (value[1] === 'Web Logins') {\n cipher.login.uris = this.makeUriArray(value[4]);\n cipher.login.username = this.getValueOrDefault(value[5]);\n cipher.login.password = this.getValueOrDefault(value[6]);\n cipher.notes = !this.isNullOrWhitespace(value[3]) ? value[3].split('\\\\n').join('\\n') : null;\n } else if (value.length > 3) {\n cipher.type = CipherType.SecureNote;\n cipher.secureNote = new SecureNoteView();\n cipher.secureNote.type = SecureNoteType.Generic;\n for (let i = 3; i < value.length; i++) {\n if (!this.isNullOrWhitespace(value[i])) {\n cipher.notes += (value[i] + '\\n');\n }\n }\n }\n\n if (!this.isNullOrWhitespace(value[1]) && cipher.type !== CipherType.Login) {\n cipher.name = value[1] + ': ' + cipher.name;\n }\n\n this.cleanupCipher(cipher);\n result.ciphers.push(cipher);\n });\n\n if (this.organization) {\n this.moveFoldersToCollections(result);\n }\n\n result.success = true;\n return result;\n }\n}\n","import { BaseImporter } from './baseImporter';\nimport { Importer } from './importer';\n\nimport { ImportResult } from '../models/domain/importResult';\n\nexport class MeldiumCsvImporter extends BaseImporter implements Importer {\n parse(data: string): ImportResult {\n const result = new ImportResult();\n const results = this.parseCsv(data, true);\n if (results == null) {\n result.success = false;\n return result;\n }\n\n results.forEach((value) => {\n const cipher = this.initLoginCipher();\n cipher.name = this.getValueOrDefault(value.DisplayName, '--');\n cipher.notes = this.getValueOrDefault(value.Notes);\n cipher.login.username = this.getValueOrDefault(value.UserName);\n cipher.login.password = this.getValueOrDefault(value.Password);\n cipher.login.uris = this.makeUriArray(value.Url);\n this.cleanupCipher(cipher);\n result.ciphers.push(cipher);\n });\n\n result.success = true;\n return result;\n }\n}\n","import { BaseImporter } from './baseImporter';\r\nimport { Importer } from './importer';\r\n\r\nimport { ImportResult } from '../models/domain/importResult';\r\n\r\nimport { CardView } from '../models/view/cardView';\r\nimport { CipherView } from '../models/view/cipherView';\r\nimport { FolderView } from '../models/view/folderView';\r\nimport { IdentityView } from '../models/view/identityView';\r\nimport { LoginView } from '../models/view/loginView';\r\nimport { SecureNoteView } from '../models/view/secureNoteView';\r\n\r\nimport { CipherType } from '../enums/cipherType';\r\nimport { SecureNoteType } from '../enums/secureNoteType';\r\n\r\nexport class LastPassCsvImporter extends BaseImporter implements Importer {\r\n parse(data: string): ImportResult {\r\n const result = new ImportResult();\r\n const results = this.parseCsv(data, true);\r\n if (results == null) {\r\n result.success = false;\r\n return result;\r\n }\r\n\r\n results.forEach((value, index) => {\r\n const cipherIndex = result.ciphers.length;\r\n let folderIndex = result.folders.length;\r\n const hasFolder = this.getValueOrDefault(value.grouping, '(none)') !== '(none)';\r\n let addFolder = hasFolder;\r\n\r\n if (hasFolder) {\r\n for (let i = 0; i < result.folders.length; i++) {\r\n if (result.folders[i].name === value.grouping) {\r\n addFolder = false;\r\n folderIndex = i;\r\n break;\r\n }\r\n }\r\n }\r\n\r\n const cipher = this.buildBaseCipher(value);\r\n if (cipher.type === CipherType.Login) {\r\n cipher.notes = this.getValueOrDefault(value.extra);\r\n cipher.login = new LoginView();\r\n cipher.login.uris = this.makeUriArray(value.url);\r\n cipher.login.username = this.getValueOrDefault(value.username);\r\n cipher.login.password = this.getValueOrDefault(value.password);\r\n } else if (cipher.type === CipherType.SecureNote) {\r\n this.parseSecureNote(value, cipher);\r\n } else if (cipher.type === CipherType.Card) {\r\n cipher.card = this.parseCard(value);\r\n cipher.notes = this.getValueOrDefault(value.notes);\r\n } else if (cipher.type === CipherType.Identity) {\r\n cipher.identity = this.parseIdentity(value);\r\n cipher.notes = this.getValueOrDefault(value.notes);\r\n if (!this.isNullOrWhitespace(value.ccnum)) {\r\n // there is a card on this identity too\r\n const cardCipher = this.buildBaseCipher(value);\r\n cardCipher.identity = null;\r\n cardCipher.type = CipherType.Card;\r\n cardCipher.card = this.parseCard(value);\r\n result.ciphers.push(cardCipher);\r\n }\r\n }\r\n\r\n result.ciphers.push(cipher);\r\n\r\n if (addFolder) {\r\n const f = new FolderView();\r\n f.name = value.grouping;\r\n result.folders.push(f);\r\n }\r\n if (hasFolder) {\r\n result.folderRelationships.push([cipherIndex, folderIndex]);\r\n }\r\n });\r\n\r\n if (this.organization) {\r\n this.moveFoldersToCollections(result);\r\n }\r\n\r\n result.success = true;\r\n return result;\r\n }\r\n\r\n private buildBaseCipher(value: any) {\r\n const cipher = new CipherView();\r\n if (value.hasOwnProperty('profilename') && value.hasOwnProperty('profilelanguage')) {\r\n // form fill\r\n cipher.favorite = false;\r\n cipher.name = this.getValueOrDefault(value.profilename, '--');\r\n cipher.type = CipherType.Card;\r\n\r\n if (!this.isNullOrWhitespace(value.title) || !this.isNullOrWhitespace(value.firstname) ||\r\n !this.isNullOrWhitespace(value.lastname) || !this.isNullOrWhitespace(value.address1) ||\r\n !this.isNullOrWhitespace(value.phone) || !this.isNullOrWhitespace(value.username) ||\r\n !this.isNullOrWhitespace(value.email)) {\r\n cipher.type = CipherType.Identity;\r\n }\r\n } else {\r\n // site or secure note\r\n cipher.favorite = !this.organization && this.getValueOrDefault(value.fav, '0') === '1';\r\n cipher.name = this.getValueOrDefault(value.name, '--');\r\n cipher.type = value.url === 'http://sn' ? CipherType.SecureNote : CipherType.Login;\r\n }\r\n return cipher;\r\n }\r\n\r\n private parseCard(value: any): CardView {\r\n const card = new CardView();\r\n card.cardholderName = this.getValueOrDefault(value.ccname);\r\n card.number = this.getValueOrDefault(value.ccnum);\r\n card.code = this.getValueOrDefault(value.cccsc);\r\n card.brand = this.getCardBrand(value.ccnum);\r\n\r\n if (!this.isNullOrWhitespace(value.ccexp) && value.ccexp.indexOf('-') > -1) {\r\n const ccexpParts = (value.ccexp as string).split('-');\r\n if (ccexpParts.length > 1) {\r\n card.expYear = ccexpParts[0];\r\n card.expMonth = ccexpParts[1];\r\n if (card.expMonth.length === 2 && card.expMonth[0] === '0') {\r\n card.expMonth = card.expMonth[1];\r\n }\r\n }\r\n }\r\n\r\n return card;\r\n }\r\n\r\n private parseIdentity(value: any): IdentityView {\r\n const identity = new IdentityView();\r\n identity.title = this.getValueOrDefault(value.title);\r\n identity.firstName = this.getValueOrDefault(value.firstname);\r\n identity.middleName = this.getValueOrDefault(value.middlename);\r\n identity.lastName = this.getValueOrDefault(value.lastname);\r\n identity.username = this.getValueOrDefault(value.username);\r\n identity.company = this.getValueOrDefault(value.company);\r\n identity.ssn = this.getValueOrDefault(value.ssn);\r\n identity.address1 = this.getValueOrDefault(value.address1);\r\n identity.address2 = this.getValueOrDefault(value.address2);\r\n identity.address3 = this.getValueOrDefault(value.address3);\r\n identity.city = this.getValueOrDefault(value.city);\r\n identity.state = this.getValueOrDefault(value.state);\r\n identity.postalCode = this.getValueOrDefault(value.zip);\r\n identity.country = this.getValueOrDefault(value.country);\r\n identity.email = this.getValueOrDefault(value.email);\r\n identity.phone = this.getValueOrDefault(value.phone);\r\n\r\n if (!this.isNullOrWhitespace(identity.title)) {\r\n identity.title = identity.title.charAt(0).toUpperCase() + identity.title.slice(1);\r\n }\r\n\r\n return identity;\r\n }\r\n\r\n private parseSecureNote(value: any, cipher: CipherView) {\r\n const extraParts = this.splitNewLine(value.extra);\r\n let processedNote = false;\r\n\r\n if (extraParts.length) {\r\n const typeParts = extraParts[0].split(':');\r\n if (typeParts.length > 1 && typeParts[0] === 'NoteType' &&\r\n (typeParts[1] === 'Credit Card' || typeParts[1] === 'Address')) {\r\n if (typeParts[1] === 'Credit Card') {\r\n const mappedData = this.parseSecureNoteMapping(extraParts, {\r\n 'Number': 'number',\r\n 'Name on Card': 'cardholderName',\r\n 'Security Code': 'code',\r\n });\r\n cipher.type = CipherType.Card;\r\n cipher.card = mappedData[0];\r\n cipher.notes = mappedData[1];\r\n } else if (typeParts[1] === 'Address') {\r\n const mappedData = this.parseSecureNoteMapping(extraParts, {\r\n 'Title': 'title',\r\n 'First Name': 'firstName',\r\n 'Last Name': 'lastName',\r\n 'Middle Name': 'middleName',\r\n 'Company': 'company',\r\n 'Address 1': 'address1',\r\n 'Address 2': 'address2',\r\n 'Address 3': 'address3',\r\n 'City / Town': 'city',\r\n 'State': 'state',\r\n 'Zip / Postal Code': 'postalCode',\r\n 'Country': 'country',\r\n 'Email Address': 'email',\r\n 'Username': 'username',\r\n });\r\n cipher.type = CipherType.Identity;\r\n cipher.identity = mappedData[0];\r\n cipher.notes = mappedData[1];\r\n }\r\n processedNote = true;\r\n }\r\n }\r\n\r\n if (!processedNote) {\r\n cipher.secureNote = new SecureNoteView();\r\n cipher.secureNote.type = SecureNoteType.Generic;\r\n cipher.notes = this.getValueOrDefault(value.extra);\r\n }\r\n }\r\n\r\n private parseSecureNoteMapping(extraParts: string[], map: any): [T, string] {\r\n let notes: string = null;\r\n const dataObj: any = {};\r\n\r\n extraParts.forEach((extraPart) => {\r\n const fieldParts = extraPart.split(':');\r\n if (fieldParts.length < 1 || this.isNullOrWhitespace(fieldParts[0]) ||\r\n this.isNullOrWhitespace(fieldParts[1]) || fieldParts[0] === 'NoteType') {\r\n return;\r\n }\r\n\r\n if (fieldParts[0] === 'Notes') {\r\n if (!this.isNullOrWhitespace(notes)) {\r\n notes += ('\\n' + fieldParts[1]);\r\n } else {\r\n notes = fieldParts[1];\r\n }\r\n } else if (map.hasOwnProperty(fieldParts[0])) {\r\n dataObj[map[fieldParts[0]]] = fieldParts[1];\r\n } else {\r\n if (!this.isNullOrWhitespace(notes)) {\r\n notes += '\\n';\r\n } else {\r\n notes = '';\r\n }\r\n\r\n notes += (fieldParts[0] + ': ' + fieldParts[1]);\r\n }\r\n });\r\n\r\n return [dataObj as T, notes];\r\n }\r\n}\r\n","import { BaseImporter } from './baseImporter';\nimport { Importer } from './importer';\n\nimport { ImportResult } from '../models/domain/importResult';\n\nimport { FolderView } from '../models/view/folderView';\n\nexport class KeeperCsvImporter extends BaseImporter implements Importer {\n parse(data: string): ImportResult {\n const result = new ImportResult();\n const results = this.parseCsv(data, false);\n if (results == null) {\n result.success = false;\n return result;\n }\n\n results.forEach((value) => {\n if (value.length < 6) {\n return;\n }\n\n this.processFolder(result, value[0]);\n const cipher = this.initLoginCipher();\n cipher.notes = this.getValueOrDefault(value[5]) + '\\n';\n cipher.name = this.getValueOrDefault(value[1], '--');\n cipher.login.username = this.getValueOrDefault(value[2]);\n cipher.login.password = this.getValueOrDefault(value[3]);\n cipher.login.uris = this.makeUriArray(value[4]);\n\n if (value.length > 7) {\n // we have some custom fields.\n for (let i = 7; i < value.length; i = i + 2) {\n this.processKvp(cipher, value[i], value[i + 1]);\n }\n }\n\n this.cleanupCipher(cipher);\n result.ciphers.push(cipher);\n });\n\n if (this.organization) {\n this.moveFoldersToCollections(result);\n }\n\n result.success = true;\n return result;\n }\n}\n","import { BaseImporter } from './baseImporter';\r\nimport { Importer } from './importer';\r\n\r\nimport { ImportResult } from '../models/domain/importResult';\r\n\r\nexport class KeePassXCsvImporter extends BaseImporter implements Importer {\r\n parse(data: string): ImportResult {\r\n const result = new ImportResult();\r\n const results = this.parseCsv(data, true);\r\n if (results == null) {\r\n result.success = false;\r\n return result;\r\n }\r\n\r\n results.forEach((value) => {\r\n if (this.isNullOrWhitespace(value.Title)) {\r\n return;\r\n }\r\n\r\n value.Group = !this.isNullOrWhitespace(value.Group) && value.Group.startsWith('Root/') ?\r\n value.Group.replace('Root/', '') : value.Group;\r\n const groupName = !this.isNullOrWhitespace(value.Group) ? value.Group : null;\r\n this.processFolder(result, groupName);\r\n\r\n const cipher = this.initLoginCipher();\r\n cipher.notes = this.getValueOrDefault(value.Notes);\r\n cipher.name = this.getValueOrDefault(value.Title, '--');\r\n cipher.login.username = this.getValueOrDefault(value.Username);\r\n cipher.login.password = this.getValueOrDefault(value.Password);\r\n cipher.login.uris = this.makeUriArray(value.URL);\r\n this.cleanupCipher(cipher);\r\n result.ciphers.push(cipher);\r\n });\r\n\r\n if (this.organization) {\r\n this.moveFoldersToCollections(result);\r\n }\r\n\r\n result.success = true;\r\n return result;\r\n }\r\n}\r\n","import { BaseImporter } from './baseImporter';\r\nimport { Importer } from './importer';\r\n\r\nimport { ImportResult } from '../models/domain/importResult';\r\n\r\nimport { FolderView } from '../models/view/folderView';\r\n\r\nexport class KeePass2XmlImporter extends BaseImporter implements Importer {\r\n result = new ImportResult();\r\n\r\n parse(data: string): ImportResult {\r\n const doc = this.parseXml(data);\r\n if (doc == null) {\r\n this.result.success = false;\r\n return this.result;\r\n }\r\n\r\n const rootGroup = doc.querySelector('KeePassFile > Root > Group');\r\n if (rootGroup == null) {\r\n this.result.errorMessage = 'Missing `KeePassFile > Root > Group` node.';\r\n this.result.success = false;\r\n return this.result;\r\n }\r\n\r\n this.traverse(rootGroup, true, '');\r\n\r\n if (this.organization) {\r\n this.moveFoldersToCollections(this.result);\r\n }\r\n\r\n this.result.success = true;\r\n return this.result;\r\n }\r\n\r\n traverse(node: Element, isRootNode: boolean, groupPrefixName: string) {\r\n const folderIndex = this.result.folders.length;\r\n let groupName = groupPrefixName;\r\n\r\n if (!isRootNode) {\r\n if (groupName !== '') {\r\n groupName += '/';\r\n }\r\n const nameEl = this.querySelectorDirectChild(node, 'Name');\r\n groupName += nameEl == null ? '-' : nameEl.textContent;\r\n const folder = new FolderView();\r\n folder.name = groupName;\r\n this.result.folders.push(folder);\r\n }\r\n\r\n this.querySelectorAllDirectChild(node, 'Entry').forEach((entry) => {\r\n const cipherIndex = this.result.ciphers.length;\r\n\r\n const cipher = this.initLoginCipher();\r\n this.querySelectorAllDirectChild(entry, 'String').forEach((entryString) => {\r\n const valueEl = this.querySelectorDirectChild(entryString, 'Value');\r\n const value = valueEl != null ? valueEl.textContent : null;\r\n if (this.isNullOrWhitespace(value)) {\r\n return;\r\n }\r\n const keyEl = this.querySelectorDirectChild(entryString, 'Key');\r\n const key = keyEl != null ? keyEl.textContent : null;\r\n\r\n if (key === 'URL') {\r\n cipher.login.uris = this.makeUriArray(value);\r\n } else if (key === 'UserName') {\r\n cipher.login.username = value;\r\n } else if (key === 'Password') {\r\n cipher.login.password = value;\r\n } else if (key === 'Title') {\r\n cipher.name = value;\r\n } else if (key === 'Notes') {\r\n cipher.notes += (value + '\\n');\r\n } else {\r\n this.processKvp(cipher, key, value);\r\n }\r\n });\r\n\r\n this.cleanupCipher(cipher);\r\n this.result.ciphers.push(cipher);\r\n\r\n if (!isRootNode) {\r\n this.result.folderRelationships.push([cipherIndex, folderIndex]);\r\n }\r\n });\r\n\r\n this.querySelectorAllDirectChild(node, 'Group').forEach((group) => {\r\n this.traverse(group, false, groupName);\r\n });\r\n }\r\n}\r\n","import { BaseImporter } from './baseImporter';\r\nimport { Importer } from './importer';\r\n\r\nimport { ImportResult } from '../models/domain/importResult';\r\n\r\nexport class GnomeJsonImporter extends BaseImporter implements Importer {\r\n parse(data: string): ImportResult {\r\n const result = new ImportResult();\r\n const results = JSON.parse(data);\r\n if (results == null || Object.keys(results).length === 0) {\r\n result.success = false;\r\n return result;\r\n }\r\n\r\n for (const keyRing in results) {\r\n if (!results.hasOwnProperty(keyRing) || this.isNullOrWhitespace(keyRing) ||\r\n results[keyRing].length === 0) {\r\n continue;\r\n }\r\n\r\n results[keyRing].forEach((value: any) => {\r\n if (this.isNullOrWhitespace(value.display_name) || value.display_name.indexOf('http') !== 0) {\r\n return;\r\n }\r\n\r\n this.processFolder(result, keyRing);\r\n const cipher = this.initLoginCipher();\r\n cipher.name = value.display_name.replace('http://', '').replace('https://', '');\r\n if (cipher.name.length > 30) {\r\n cipher.name = cipher.name.substring(0, 30);\r\n }\r\n cipher.login.password = this.getValueOrDefault(value.secret);\r\n cipher.login.uris = this.makeUriArray(value.display_name);\r\n\r\n if (value.attributes != null) {\r\n cipher.login.username = value.attributes != null ?\r\n this.getValueOrDefault(value.attributes.username_value) : null;\r\n for (const attr in value.attributes) {\r\n if (!value.attributes.hasOwnProperty(attr) || attr === 'username_value' ||\r\n attr === 'xdg:schema') {\r\n continue;\r\n }\r\n this.processKvp(cipher, attr, value.attributes[attr]);\r\n }\r\n }\r\n\r\n this.convertToNoteIfNeeded(cipher);\r\n this.cleanupCipher(cipher);\r\n result.ciphers.push(cipher);\r\n });\r\n }\r\n\r\n if (this.organization) {\r\n this.moveFoldersToCollections(result);\r\n }\r\n\r\n result.success = true;\r\n return result;\r\n }\r\n}\r\n","import { BaseImporter } from './baseImporter';\nimport { Importer } from './importer';\n\nimport { ImportResult } from '../models/domain/importResult';\n\nexport class FirefoxCsvImporter extends BaseImporter implements Importer {\n parse(data: string): ImportResult {\n const result = new ImportResult();\n const results = this.parseCsv(data, true);\n if (results == null) {\n result.success = false;\n return result;\n }\n\n results.forEach((value) => {\n const cipher = this.initLoginCipher();\n cipher.name = this.getValueOrDefault(this.nameFromUrl(value.hostname), '--');\n cipher.login.username = this.getValueOrDefault(value.username);\n cipher.login.password = this.getValueOrDefault(value.password);\n cipher.login.uris = this.makeUriArray(value.hostname);\n this.cleanupCipher(cipher);\n result.ciphers.push(cipher);\n });\n\n result.success = true;\n return result;\n }\n}\n","import { BaseImporter } from './baseImporter';\nimport { Importer } from './importer';\n\nimport { ImportResult } from '../models/domain/importResult';\n\nimport { CipherType } from '../enums/cipherType';\nimport { SecureNoteType } from '../enums/secureNoteType';\n\nimport { CardView } from '../models/view/cardView';\nimport { SecureNoteView } from '../models/view/secureNoteView';\n\nexport class EnpassCsvImporter extends BaseImporter implements Importer {\n parse(data: string): ImportResult {\n const result = new ImportResult();\n const results = this.parseCsv(data, false);\n if (results == null) {\n result.success = false;\n return result;\n }\n\n let firstRow = true;\n results.forEach((value) => {\n if (value.length < 2 || (firstRow && value[0] === 'Title')) {\n firstRow = false;\n return;\n }\n\n const cipher = this.initLoginCipher();\n cipher.notes = this.getValueOrDefault(value[value.length - 1]);\n cipher.name = this.getValueOrDefault(value[0], '--');\n\n if (value.length === 2 || (value.indexOf('Username') < 0 && value.indexOf('Password') < 0 &&\n value.indexOf('Email') && value.indexOf('URL') < 0)) {\n cipher.type = CipherType.SecureNote;\n cipher.secureNote = new SecureNoteView();\n cipher.secureNote.type = SecureNoteType.Generic;\n }\n\n if (value.indexOf('Cardholder') > -1 && value.indexOf('Number') > -1 && value.indexOf('Expiry date') > -1) {\n cipher.type = CipherType.Card;\n cipher.card = new CardView();\n }\n\n if (value.length > 2 && (value.length % 2) === 0) {\n for (let i = 0; i < value.length - 2; i += 2) {\n const fieldValue: string = value[i + 2];\n if (this.isNullOrWhitespace(fieldValue)) {\n continue;\n }\n\n const fieldName: string = value[i + 1];\n const fieldNameLower = fieldName.toLowerCase();\n\n if (cipher.type === CipherType.Login) {\n if (fieldNameLower === 'url' && (cipher.login.uris == null || cipher.login.uris.length === 0)) {\n cipher.login.uris = this.makeUriArray(fieldValue);\n continue;\n } else if ((fieldNameLower === 'username' || fieldNameLower === 'email') &&\n this.isNullOrWhitespace(cipher.login.username)) {\n cipher.login.username = fieldValue;\n continue;\n } else if (fieldNameLower === 'password' && this.isNullOrWhitespace(cipher.login.password)) {\n cipher.login.password = fieldValue;\n continue;\n } else if (fieldNameLower === 'totp' && this.isNullOrWhitespace(cipher.login.totp)) {\n cipher.login.totp = fieldValue;\n continue;\n }\n } else if (cipher.type === CipherType.Card) {\n if (fieldNameLower === 'cardholder' && this.isNullOrWhitespace(cipher.card.cardholderName)) {\n cipher.card.cardholderName = fieldValue;\n continue;\n } else if (fieldNameLower === 'number' && this.isNullOrWhitespace(cipher.card.number)) {\n cipher.card.number = fieldValue;\n cipher.card.brand = this.getCardBrand(fieldValue);\n continue;\n } else if (fieldNameLower === 'cvc' && this.isNullOrWhitespace(cipher.card.code)) {\n cipher.card.code = fieldValue;\n continue;\n } else if (fieldNameLower === 'expiry date' && this.isNullOrWhitespace(cipher.card.expMonth) &&\n this.isNullOrWhitespace(cipher.card.expYear)) {\n const parts = fieldValue.split('/');\n if (parts.length === 2) {\n let month: string = null;\n let year: string = null;\n if (parts[0].length === 1 || parts[0].length === 2) {\n month = parts[0];\n if (month.length === 2 && month[0] === '0') {\n month = month.substr(1, 1);\n }\n }\n if (parts[1].length === 2 || parts[1].length === 4) {\n year = month.length === 2 ? '20' + parts[1] : parts[1];\n }\n if (month != null && year != null) {\n cipher.card.expMonth = month;\n cipher.card.expYear = year;\n continue;\n }\n }\n } else if (fieldNameLower === 'type') {\n // Skip since brand was determined from number above\n continue;\n }\n }\n\n this.processKvp(cipher, fieldName, fieldValue);\n }\n }\n\n this.cleanupCipher(cipher);\n result.ciphers.push(cipher);\n });\n\n result.success = true;\n return result;\n }\n}\n","import { BaseImporter } from './baseImporter';\nimport { Importer } from './importer';\n\nimport { ImportResult } from '../models/domain/importResult';\n\nexport class DashlaneCsvImporter extends BaseImporter implements Importer {\n parse(data: string): ImportResult {\n const result = new ImportResult();\n const results = this.parseCsv(data, false);\n if (results == null) {\n result.success = false;\n return result;\n }\n\n results.forEach((value) => {\n let skip = false;\n if (value.length < 2) {\n return;\n }\n\n const cipher = this.initLoginCipher();\n cipher.name = this.getValueOrDefault(value[0], '--');\n\n if (value.length === 2) {\n cipher.login.uris = this.makeUriArray(value[1]);\n } else if (value.length === 3) {\n cipher.login.uris = this.makeUriArray(value[1]);\n cipher.login.username = this.getValueOrDefault(value[2]);\n } else if (value.length === 4) {\n if (this.isNullOrWhitespace(value[2]) && this.isNullOrWhitespace(value[3])) {\n cipher.login.username = value[1];\n cipher.notes = value[2] + '\\n' + value[3];\n } else {\n cipher.login.username = value[2];\n cipher.notes = value[1] + '\\n' + value[3];\n }\n } else if (value.length === 5) {\n cipher.login.uris = this.makeUriArray(value[1]);\n cipher.login.username = this.getValueOrDefault(value[2]);\n cipher.login.password = this.getValueOrDefault(value[3]);\n cipher.notes = this.getValueOrDefault(value[4]);\n } else if (value.length === 6) {\n if (this.isNullOrWhitespace(value[2])) {\n cipher.login.username = this.getValueOrDefault(value[3]);\n cipher.login.password = this.getValueOrDefault(value[4]);\n cipher.notes = this.getValueOrDefault(value[5]);\n } else {\n cipher.login.username = this.getValueOrDefault(value[2]);\n cipher.login.password = this.getValueOrDefault(value[3]);\n cipher.notes = this.getValueOrDefault(value[4], '') + '\\n' + this.getValueOrDefault(value[5], '');\n }\n cipher.login.uris = this.makeUriArray(value[1]);\n } else if (value.length === 7) {\n if (this.isNullOrWhitespace(value[2])) {\n cipher.login.username = this.getValueOrDefault(value[3]);\n cipher.notes = this.getValueOrDefault(value[4], '') + '\\n' + this.getValueOrDefault(value[6], '');\n } else {\n cipher.login.username = this.getValueOrDefault(value[2]);\n cipher.notes = this.getValueOrDefault(value[3], '') + '\\n' +\n this.getValueOrDefault(value[4], '') + '\\n' + this.getValueOrDefault(value[6], '');\n }\n cipher.login.uris = this.makeUriArray(value[1]);\n cipher.login.password = this.getValueOrDefault(value[5]);\n } else {\n for (let i = 1; i < value.length; i++) {\n cipher.notes += (value[i] + '\\n');\n if (value[i] === 'NO_TYPE') {\n skip = true;\n break;\n }\n }\n }\n\n if (skip) {\n return;\n }\n if (this.isNullOrWhitespace(cipher.login.username)) {\n cipher.login.username = null;\n }\n if (this.isNullOrWhitespace(cipher.login.password)) {\n cipher.login.password = null;\n }\n this.cleanupCipher(cipher);\n result.ciphers.push(cipher);\n });\n\n result.success = true;\n return result;\n }\n}\n","import { BaseImporter } from './baseImporter';\r\nimport { Importer } from './importer';\r\n\r\nimport { ImportResult } from '../models/domain/importResult';\r\n\r\nexport class ClipperzHtmlImporter extends BaseImporter implements Importer {\r\n parse(data: string): ImportResult {\r\n const result = new ImportResult();\r\n const doc = this.parseXml(data);\r\n if (doc == null) {\r\n result.success = false;\r\n return result;\r\n }\r\n\r\n const textarea = doc.querySelector('textarea');\r\n if (textarea == null || this.isNullOrWhitespace(textarea.textContent)) {\r\n result.errorMessage = 'Missing textarea.';\r\n result.success = false;\r\n return result;\r\n }\r\n\r\n const entries = JSON.parse(textarea.textContent);\r\n entries.forEach((entry: any) => {\r\n const cipher = this.initLoginCipher();\r\n if (!this.isNullOrWhitespace(entry.label)) {\r\n cipher.name = entry.label.split(' ')[0];\r\n }\r\n if (entry.data != null && !this.isNullOrWhitespace(entry.data.notes)) {\r\n cipher.notes = entry.data.notes.split('\\\\n').join('\\n');\r\n }\r\n\r\n if (entry.currentVersion != null && entry.currentVersion.fields != null) {\r\n for (const property in entry.currentVersion.fields) {\r\n if (!entry.currentVersion.fields.hasOwnProperty(property)) {\r\n continue;\r\n }\r\n\r\n const field = entry.currentVersion.fields[property];\r\n const actionType = field.actionType != null ? field.actionType.toLowerCase() : null;\r\n switch (actionType) {\r\n case 'password':\r\n cipher.login.password = this.getValueOrDefault(field.value);\r\n break;\r\n case 'email':\r\n case 'username':\r\n case 'user':\r\n case 'name':\r\n cipher.login.username = this.getValueOrDefault(field.value);\r\n break;\r\n case 'url':\r\n cipher.login.uris = this.makeUriArray(field.value);\r\n break;\r\n default:\r\n const labelLower = field.label != null ? field.label.toLowerCase() : null;\r\n if (cipher.login.password == null && this.passwordFieldNames.indexOf(labelLower) > -1) {\r\n cipher.login.password = this.getValueOrDefault(field.value);\r\n } else if (cipher.login.username == null &&\r\n this.usernameFieldNames.indexOf(labelLower) > -1) {\r\n cipher.login.username = this.getValueOrDefault(field.value);\r\n } else if ((cipher.login.uris == null || cipher.login.uris.length === 0) &&\r\n this.uriFieldNames.indexOf(labelLower) > -1) {\r\n cipher.login.uris = this.makeUriArray(field.value);\r\n } else {\r\n this.processKvp(cipher, field.label, field.value);\r\n }\r\n break;\r\n }\r\n }\r\n }\r\n\r\n this.convertToNoteIfNeeded(cipher);\r\n this.cleanupCipher(cipher);\r\n result.ciphers.push(cipher);\r\n });\r\n\r\n result.success = true;\r\n return result;\r\n }\r\n}\r\n","import { BaseImporter } from './baseImporter';\nimport { Importer } from './importer';\n\nimport { ImportResult } from '../models/domain/importResult';\n\nexport class ChromeCsvImporter extends BaseImporter implements Importer {\n parse(data: string): ImportResult {\n const result = new ImportResult();\n const results = this.parseCsv(data, true);\n if (results == null) {\n result.success = false;\n return result;\n }\n\n results.forEach((value) => {\n const cipher = this.initLoginCipher();\n cipher.name = this.getValueOrDefault(value.name, '--');\n cipher.login.username = this.getValueOrDefault(value.username);\n cipher.login.password = this.getValueOrDefault(value.password);\n cipher.login.uris = this.makeUriArray(value.url);\n this.cleanupCipher(cipher);\n result.ciphers.push(cipher);\n });\n\n result.success = true;\n return result;\n }\n}\n","import { BaseImporter } from './baseImporter';\nimport { Importer } from './importer';\n\nimport { ImportResult } from '../models/domain/importResult';\n\nexport class BlurCsvImporter extends BaseImporter implements Importer {\n parse(data: string): ImportResult {\n const result = new ImportResult();\n const results = this.parseCsv(data, true);\n if (results == null) {\n result.success = false;\n return result;\n }\n\n results.forEach((value) => {\n if (value.label === 'null') {\n value.label = null;\n }\n const cipher = this.initLoginCipher();\n cipher.name = this.getValueOrDefault(value.label,\n this.getValueOrDefault(this.nameFromUrl(value.domain), '--'));\n cipher.login.uris = this.makeUriArray(value.domain);\n cipher.login.password = this.getValueOrDefault(value.password);\n\n if (this.isNullOrWhitespace(value.email) && !this.isNullOrWhitespace(value.username)) {\n cipher.login.username = value.username;\n } else {\n cipher.login.username = this.getValueOrDefault(value.email);\n cipher.notes = this.getValueOrDefault(value.username);\n }\n\n this.cleanupCipher(cipher);\n result.ciphers.push(cipher);\n });\n\n result.success = true;\n return result;\n }\n}\n","import { BaseImporter } from './baseImporter';\nimport { Importer } from './importer';\n\nimport { ImportResult } from '../models/domain/importResult';\n\nimport { CipherView } from '../models/view/cipherView';\nimport { CollectionView } from '../models/view/collectionView';\nimport { FieldView } from '../models/view/fieldView';\nimport { FolderView } from '../models/view/folderView';\nimport { LoginView } from '../models/view/loginView';\nimport { SecureNoteView } from '../models/view/secureNoteView';\n\nimport { CipherType } from '../enums/cipherType';\nimport { FieldType } from '../enums/fieldType';\nimport { SecureNoteType } from '../enums/secureNoteType';\n\nexport class BitwardenCsvImporter extends BaseImporter implements Importer {\n parse(data: string): ImportResult {\n const result = new ImportResult();\n const results = this.parseCsv(data, true);\n if (results == null) {\n result.success = false;\n return result;\n }\n\n results.forEach((value) => {\n if (this.organization && !this.isNullOrWhitespace(value.collections)) {\n const collections = (value.collections as string).split(',');\n collections.forEach((col) => {\n let addCollection = true;\n let collectionIndex = result.collections.length;\n\n for (let i = 0; i < result.collections.length; i++) {\n if (result.collections[i].name === col) {\n addCollection = false;\n collectionIndex = i;\n break;\n }\n }\n\n if (addCollection) {\n const collection = new CollectionView();\n collection.name = col;\n result.collections.push(collection);\n }\n\n result.collectionRelationships.push([result.ciphers.length, collectionIndex]);\n });\n } else if (!this.organization) {\n this.processFolder(result, value.folder);\n }\n\n const cipher = new CipherView();\n cipher.favorite = !this.organization && this.getValueOrDefault(value.favorite, '0') !== '0' ? true : false;\n cipher.type = CipherType.Login;\n cipher.notes = this.getValueOrDefault(value.notes);\n cipher.name = this.getValueOrDefault(value.name, '--');\n\n if (!this.isNullOrWhitespace(value.fields)) {\n const fields = this.splitNewLine(value.fields);\n for (let i = 0; i < fields.length; i++) {\n if (this.isNullOrWhitespace(fields[i])) {\n continue;\n }\n\n const delimPosition = fields[i].lastIndexOf(': ');\n if (delimPosition === -1) {\n continue;\n }\n\n if (cipher.fields == null) {\n cipher.fields = [];\n }\n\n const field = new FieldView();\n field.name = fields[i].substr(0, delimPosition);\n field.value = null;\n field.type = FieldType.Text;\n if (fields[i].length > (delimPosition + 2)) {\n field.value = fields[i].substr(delimPosition + 2);\n }\n cipher.fields.push(field);\n }\n }\n\n const valueType = value.type != null ? value.type.toLowerCase() : null;\n switch (valueType) {\n case 'login':\n case null:\n cipher.type = CipherType.Login;\n cipher.login = new LoginView();\n cipher.login.totp = this.getValueOrDefault(value.login_totp || value.totp);\n cipher.login.username = this.getValueOrDefault(value.login_username || value.username);\n cipher.login.password = this.getValueOrDefault(value.login_password || value.password);\n const uris = this.parseSingleRowCsv(value.login_uri || value.uri);\n cipher.login.uris = this.makeUriArray(uris);\n break;\n case 'note':\n cipher.type = CipherType.SecureNote;\n cipher.secureNote = new SecureNoteView();\n cipher.secureNote.type = SecureNoteType.Generic;\n break;\n default:\n break;\n }\n\n result.ciphers.push(cipher);\n });\n\n result.success = true;\n return result;\n }\n}\n","import { BaseImporter } from './baseImporter';\nimport { Importer } from './importer';\n\nimport { ImportResult } from '../models/domain/importResult';\n\nexport class AviraCsvImporter extends BaseImporter implements Importer {\n parse(data: string): ImportResult {\n const result = new ImportResult();\n const results = this.parseCsv(data, true);\n if (results == null) {\n result.success = false;\n return result;\n }\n\n results.forEach((value) => {\n const cipher = this.initLoginCipher();\n cipher.name = this.getValueOrDefault(value.name,\n this.getValueOrDefault(this.nameFromUrl(value.website), '--'));\n cipher.login.uris = this.makeUriArray(value.website);\n cipher.login.password = this.getValueOrDefault(value.password);\n\n if (this.isNullOrWhitespace(value.username) && !this.isNullOrWhitespace(value.secondary_username)) {\n cipher.login.username = value.secondary_username;\n } else {\n cipher.login.username = this.getValueOrDefault(value.username);\n cipher.notes = this.getValueOrDefault(value.secondary_username);\n }\n\n this.cleanupCipher(cipher);\n result.ciphers.push(cipher);\n });\n\n result.success = true;\n return result;\n }\n}\n","import { BaseImporter } from './baseImporter';\r\nimport { Importer } from './importer';\r\n\r\nimport { ImportResult } from '../models/domain/importResult';\r\n\r\nexport class AscendoCsvImporter extends BaseImporter implements Importer {\r\n parse(data: string): ImportResult {\r\n const result = new ImportResult();\r\n const results = this.parseCsv(data, false);\r\n if (results == null) {\r\n result.success = false;\r\n return result;\r\n }\r\n\r\n results.forEach((value) => {\r\n if (value.length < 2) {\r\n return;\r\n }\r\n\r\n const cipher = this.initLoginCipher();\r\n cipher.notes = this.getValueOrDefault(value[value.length - 1]);\r\n cipher.name = this.getValueOrDefault(value[0], '--');\r\n\r\n if (value.length > 2 && (value.length % 2) === 0) {\r\n for (let i = 0; i < value.length - 2; i += 2) {\r\n const val: string = value[i + 2];\r\n const field: string = value[i + 1];\r\n if (this.isNullOrWhitespace(val) || this.isNullOrWhitespace(field)) {\r\n continue;\r\n }\r\n\r\n const fieldLower = field.toLowerCase();\r\n if (cipher.login.password == null && this.passwordFieldNames.indexOf(fieldLower) > -1) {\r\n cipher.login.password = this.getValueOrDefault(val);\r\n } else if (cipher.login.username == null &&\r\n this.usernameFieldNames.indexOf(fieldLower) > -1) {\r\n cipher.login.username = this.getValueOrDefault(val);\r\n } else if ((cipher.login.uris == null || cipher.login.uris.length === 0) &&\r\n this.uriFieldNames.indexOf(fieldLower) > -1) {\r\n cipher.login.uris = this.makeUriArray(val);\r\n } else {\r\n this.processKvp(cipher, field, val);\r\n }\r\n }\r\n }\r\n\r\n this.convertToNoteIfNeeded(cipher);\r\n this.cleanupCipher(cipher);\r\n result.ciphers.push(cipher);\r\n });\r\n\r\n result.success = true;\r\n return result;\r\n }\r\n}\r\n","import { CipherRequest } from './cipherRequest';\nimport { FolderRequest } from './folderRequest';\nimport { KvpRequest } from './kvpRequest';\n\nexport class ImportCiphersRequest {\n ciphers: CipherRequest[] = [];\n folders: FolderRequest[] = [];\n folderRelationships: Array> = [];\n}\n","
\r\n
\r\n
\r\n \r\n
\r\n
{{'reports' | i18n}}
\r\n \r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n","import { PlanType } from '../../enums/planType';\n\nexport class OrganizationCreateRequest {\n name: string;\n businessName: string;\n billingEmail: string;\n planType: PlanType;\n key: string;\n paymentToken: string;\n additionalSeats: number;\n additionalStorageGb: number;\n collectionName: string;\n country: string;\n}\n","
\n

{{'newOrganization' | i18n}}

\n
\n

{{'newOrganizationDesc' | i18n}}

\n\n

{{'uploadLicenseFileOrg' | i18n}}

\n
\n
\n \n \n {{'licenseFileDesc' | i18n : 'bitwarden_organization_license.json'}}\n
\n \n
\n
\n
\n

{{'generalInformation' | i18n}}

\n
\n
\n \n \n
\n
\n \n \n
\n
\n
\n \n \n
\n
\n
\n \n \n
\n
\n

{{'chooseYourPlan' | i18n}}

\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n \n \n

{{'users' | i18n}}

\n
\n
\n \n \n {{'userSeatsHowManyDesc' | i18n}}\n
\n
\n
\n

{{'addons' | i18n}}

\n
\n
\n \n \n {{'userSeatsAdditionalDesc' | i18n : plans[plan].baseSeats : (plans[plan].seatPrice | currency:'$')}}\n
\n
\n
\n
\n \n \n {{'additionalStorageDesc' | i18n : '1 GB' : (storageGb.price | currency:'$')}}\n
\n
\n

{{'summary' | i18n}}

\n
\n \n \n
\n
\n \n \n
\n
\n
\n {{'total' | i18n}}: {{total | currency:'USD $'}} /{{interval | i18n}}\n
\n {{'paymentChargedWithTrial' | i18n : (interval | i18n) }}\n

{{'paymentInformation' | i18n}}

\n \n
\n
\n \n
\n
\n","export class PaymentRequest {\n paymentToken: string;\n}\n","export class StorageRequest {\n storageGbAdjustment: number;\n}\n","
\n

\n {{'billingAndLicensing' | i18n}}\n \n \n \n

\n
\n\n\n {{'subscriptionCanceled' | i18n}}\n \n

{{'subscriptionPendingCanceled' | i18n}}

\n \n
\n
\n
{{'subscription' | i18n}}
\n
{{'premiumMembership' | i18n}}
\n
\n
\n
{{'expiration' | i18n}}
\n
{{billing.expiration | date:'mediumDate'}}
\n
{{'neverExpires' | i18n}}
\n
\n
\n
\n
\n
{{'status' | i18n}}
\n
\n {{(subscription && subscription.status) || '-'}}\n {{'pendingCancellation' | i18n}}\n
\n
{{'nextCharge' | i18n}}
\n
{{nextInvoice ? ((nextInvoice.date | date: 'mediumDate') + ', ' + (nextInvoice.amount | currency:'$')) :\n '-'}}\n
\n
\n
\n
\n {{'details' | i18n}}\n \n \n \n \n \n \n \n
\n {{i.name}} {{i.quantity > 1 ? '×' + i.quantity : ''}} @ {{i.amount | currency:'$'}}\n \n {{(i.quantity * i.amount) | currency:'$'}} /{{i.interval | i18n}}\n
\n
\n
\n \n
\n \n \n {{'manageSubscription' | i18n}}\n \n
\n
\n
\n

{{'updateLicense' | i18n}}

\n \n
\n
\n
\n \n
\n \n \n
\n

{{'storage' | i18n}}

\n

{{'subscriptionStorage' | i18n : billing.maxStorageGb || 0 : billing.storageName || '0 MB'}}

\n
\n
{{(storagePercentage / 100) | percent}}
\n
\n \n
\n
\n \n \n
\n \n
\n
\n

{{'paymentMethod' | i18n}}

\n

{{'noPaymentMethod' | i18n}}

\n

\n \n {{paymentSource.description}}\n

\n \n \n \n

{{'charges' | i18n}}

\n

{{'noCharges' | i18n}}

\n \n \n \n \n \n \n \n \n \n
{{c.createdDate | date:'mediumDate'}}{{c.paymentSource ? c.paymentSource.description : '-'}}{{c.status}}{{c.amount | currency:'$'}}
\n * {{'chargesStatement' | i18n : 'BITWARDEN'}}\n
\n
\n","
\n

{{'goPremium' | i18n}}

\n
\n\n

{{'premiumUpgradeUnlockFeatures' | i18n}}

\n
    \n
  • \n \n {{'premiumSignUpStorage' | i18n}}\n
  • \n
  • \n \n {{'premiumSignUpTwoStep' | i18n}}\n
  • \n
  • \n \n {{'premiumSignUpTotp' | i18n}}\n
  • \n
  • \n \n {{'premiumSignUpSupport' | i18n}}\n
  • \n
  • \n \n {{'premiumSignUpFuture' | i18n}}\n
  • \n
\n

{{'premiumPrice' | i18n : (premiumPrice | currency:'$')}}

\n \n {{'purchasePremium' | i18n}}\n \n
\n\n

{{'uploadLicenseFilePremium' | i18n}}

\n
\n
\n \n \n {{'licenseFileDesc' | i18n : 'bitwarden_premium_license.json'}}\n
\n \n
\n
\n
\n

{{'addons' | i18n}}

\n
\n
\n \n \n {{'additionalStorageDesc' | i18n : '1 GB' : (storageGbPrice | currency:'$')}}\n
\n
\n

{{'summary' | i18n}}

\n {{'premiumMembership' | i18n}}: {{premiumPrice | currency:'$'}}\n
{{'additionalStorageGb' | i18n}}: {{additionalStorage || 0}} GB × {{storageGbPrice | currency:'$'}} = {{additionalStorageTotal\n | currency:'$'}}\n
\n
\n {{'total' | i18n}}: {{total | currency:'USD $'}} /{{'year' | i18n}}\n
\n {{'paymentChargedAnnually' | i18n}}\n

{{'paymentInformation' | i18n}}

\n \n \n
\n","import { PasswordVerificationRequest } from './passwordVerificationRequest';\n\nexport class UpdateTwoFactorYubioOtpRequest extends PasswordVerificationRequest {\n key1: string;\n key2: string;\n key3: string;\n key4: string;\n key5: string;\n nfc: boolean;\n}\n","import { PasswordVerificationRequest } from './passwordVerificationRequest';\n\nexport class UpdateTwoFactorU2fRequest extends PasswordVerificationRequest {\n deviceResponse: string;\n}\n","import { PasswordVerificationRequest } from './passwordVerificationRequest';\n\nexport class UpdateTwoFactorEmailRequest extends PasswordVerificationRequest {\n token: string;\n email: string;\n}\n","import { PasswordVerificationRequest } from './passwordVerificationRequest';\n\nexport class UpdateTwoFactorDuoRequest extends PasswordVerificationRequest {\n integrationKey: string;\n secretKey: string;\n host: string;\n}\n","import { PasswordVerificationRequest } from './passwordVerificationRequest';\n\nimport { TwoFactorProviderType } from '../../enums/twoFactorProviderType';\n\nexport class TwoFactorProviderRequest extends PasswordVerificationRequest {\n type: TwoFactorProviderType;\n}\n","import { PasswordVerificationRequest } from './passwordVerificationRequest';\n\nexport class UpdateTwoFactorAuthenticatorRequest extends PasswordVerificationRequest {\n token: string;\n key: string;\n}\n","export class UpdateDomainsRequest {\n equivalentDomains: string[][];\n excludedGlobalEquivalentDomains: number[];\n}\n","
\n

{{'domainRules' | i18n}}

\n
\n

{{'domainRulesDesc' | i18n}}

\n
\n

{{'customEqDomains' | i18n}}

\n

\n \n

\n \n
\n
\n \n \n
\n \n
\n \n {{'newCustomDomainDesc' | i18n}}\n
\n \n

{{'globalEqDomains' | i18n}}

\n

\n \n

\n 0\">\n \n \n \n \n \n \n
{{d.domains}}\n \n
\n \n
\n","
\n

{{'options' | i18n}}

\n
\n

{{'optionsDesc' | i18n}}

\n
\n
\n
\n
\n
\n \n \n \n \n
\n \n {{'languageDesc' | i18n}}\n
\n
\n
\n
\n
\n \n \n \n \n \n
\n {{'disableIconsDesc' | i18n}}\n
\n \n
\n","import { PasswordVerificationRequest } from './passwordVerificationRequest';\n\nexport class PasswordRequest extends PasswordVerificationRequest {\n newMasterPasswordHash: string;\n key: string;\n}\n","{{'loggedOutWarning' | i18n}}\n
\n
\n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n
\n \n
\n","import { EmailTokenRequest } from './emailTokenRequest';\n\nexport class EmailRequest extends EmailTokenRequest {\n newMasterPasswordHash: string;\n token: string;\n key: string;\n}\n","
\n
\n
\n
\n \n \n
\n
\n \n \n
\n
\n
\n \n
\n

{{'changeEmailDesc' | i18n : newEmail}}

\n {{'loggedOutWarning' | i18n}}\n
\n
\n
\n \n \n
\n
\n
\n
\n \n \n
\n","export class UpdateProfileRequest {\n name: string;\n masterPasswordHint: string;\n culture = 'en-US'; // deprecated\n\n constructor(name: string, masterPasswordHint: string) {\n this.name = name;\n this.masterPasswordHint = masterPasswordHint ? masterPasswordHint : null;\n }\n}\n","
\n \n
\n
\n
\n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n
\n \n
\n
\n \n
\n","
\n

{{'myAccount' | i18n}}

\n
\n\n
\n

{{'changeEmail' | i18n}}

\n
\n\n
\n

{{'changeMasterPassword' | i18n}}

\n
\n\n
\n

{{'dangerZone' | i18n}}

\n
\n
\n
\n

{{'dangerZoneDesc' | i18n}}

\n \n \n \n
\n
\n\n\n\n","\n","import {\n EventEmitter,\n Input,\n OnInit,\n Output,\n} from '@angular/core';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { FolderService } from '../../abstractions/folder.service';\nimport { I18nService } from '../../abstractions/i18n.service';\nimport { PlatformUtilsService } from '../../abstractions/platformUtils.service';\n\nimport { FolderView } from '../../models/view/folderView';\n\nexport class FolderAddEditComponent implements OnInit {\n @Input() folderId: string;\n @Output() onSavedFolder = new EventEmitter();\n @Output() onDeletedFolder = new EventEmitter();\n\n editMode: boolean = false;\n folder: FolderView = new FolderView();\n title: string;\n formPromise: Promise;\n deletePromise: Promise;\n\n constructor(protected folderService: FolderService, protected i18nService: I18nService,\n protected analytics: Angulartics2, protected toasterService: ToasterService,\n protected platformUtilsService: PlatformUtilsService) { }\n\n async ngOnInit() {\n this.editMode = this.folderId != null;\n\n if (this.editMode) {\n this.editMode = true;\n this.title = this.i18nService.t('editFolder');\n const folder = await this.folderService.get(this.folderId);\n this.folder = await folder.decrypt();\n } else {\n this.title = this.i18nService.t('addFolder');\n }\n }\n\n async submit(): Promise {\n if (this.folder.name == null || this.folder.name === '') {\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'),\n this.i18nService.t('nameRequired'));\n return false;\n }\n\n try {\n const folder = await this.folderService.encrypt(this.folder);\n this.formPromise = this.folderService.saveWithServer(folder);\n await this.formPromise;\n this.analytics.eventTrack.next({ action: this.editMode ? 'Edited Folder' : 'Added Folder' });\n this.toasterService.popAsync('success', null,\n this.i18nService.t(this.editMode ? 'editedFolder' : 'addedFolder'));\n this.onSavedFolder.emit(this.folder);\n return true;\n } catch { }\n\n return false;\n }\n\n async delete(): Promise {\n const confirmed = await this.platformUtilsService.showDialog(\n this.i18nService.t('deleteFolderConfirmation'), this.i18nService.t('deleteFolder'),\n this.i18nService.t('yes'), this.i18nService.t('no'), 'warning');\n if (!confirmed) {\n return false;\n }\n\n try {\n this.deletePromise = this.folderService.deleteWithServer(this.folder.id);\n await this.deletePromise;\n this.analytics.eventTrack.next({ action: 'Deleted Folder' });\n this.toasterService.popAsync('success', null, this.i18nService.t('deletedFolder'));\n this.onDeletedFolder.emit(this.folder);\n } catch { }\n\n return true;\n }\n}\n","import {\n EventEmitter,\n Input,\n OnInit,\n Output,\n} from '@angular/core';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { CipherService } from '../../abstractions/cipher.service';\nimport { CryptoService } from '../../abstractions/crypto.service';\nimport { I18nService } from '../../abstractions/i18n.service';\nimport { PlatformUtilsService } from '../../abstractions/platformUtils.service';\nimport { TokenService } from '../../abstractions/token.service';\n\nimport { Cipher } from '../../models/domain/cipher';\n\nimport { AttachmentView } from '../../models/view/attachmentView';\nimport { CipherView } from '../../models/view/cipherView';\n\nexport class AttachmentsComponent implements OnInit {\n @Input() cipherId: string;\n @Output() onUploadedAttachment = new EventEmitter();\n @Output() onDeletedAttachment = new EventEmitter();\n\n cipher: CipherView;\n cipherDomain: Cipher;\n hasUpdatedKey: boolean;\n canAccessAttachments: boolean;\n formPromise: Promise;\n deletePromises: { [id: string]: Promise; } = {};\n\n constructor(protected cipherService: CipherService, protected analytics: Angulartics2,\n protected toasterService: ToasterService, protected i18nService: I18nService,\n protected cryptoService: CryptoService, protected tokenService: TokenService,\n protected platformUtilsService: PlatformUtilsService, protected win: Window) { }\n\n async ngOnInit() {\n this.cipherDomain = await this.loadCipher();\n this.cipher = await this.cipherDomain.decrypt();\n\n this.hasUpdatedKey = await this.cryptoService.hasEncKey();\n const isPremium = this.tokenService.getPremium();\n this.canAccessAttachments = isPremium || this.cipher.organizationId != null;\n\n if (!this.canAccessAttachments) {\n const confirmed = await this.platformUtilsService.showDialog(\n this.i18nService.t('premiumRequiredDesc'), this.i18nService.t('premiumRequired'),\n this.i18nService.t('learnMore'), this.i18nService.t('cancel'));\n if (confirmed) {\n this.platformUtilsService.launchUri('https://vault.bitwarden.com/#/?premium=purchase');\n }\n } else if (!this.hasUpdatedKey) {\n const confirmed = await this.platformUtilsService.showDialog(\n this.i18nService.t('updateKey'), this.i18nService.t('featureUnavailable'),\n this.i18nService.t('learnMore'), this.i18nService.t('cancel'), 'warning');\n if (confirmed) {\n this.platformUtilsService.launchUri('https://help.bitwarden.com/article/update-encryption-key/');\n }\n }\n }\n\n async submit() {\n if (!this.hasUpdatedKey) {\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'),\n this.i18nService.t('updateKey'));\n return;\n }\n\n const fileEl = document.getElementById('file') as HTMLInputElement;\n const files = fileEl.files;\n if (files == null || files.length === 0) {\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'),\n this.i18nService.t('selectFile'));\n return;\n }\n\n if (files[0].size > 104857600) { // 100 MB\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'),\n this.i18nService.t('maxFileSize'));\n return;\n }\n\n try {\n this.formPromise = this.saveCipherAttachment(files[0]);\n this.cipherDomain = await this.formPromise;\n this.cipher = await this.cipherDomain.decrypt();\n this.analytics.eventTrack.next({ action: 'Added Attachment' });\n this.toasterService.popAsync('success', null, this.i18nService.t('attachmentSaved'));\n this.onUploadedAttachment.emit();\n } catch { }\n\n // reset file input\n // ref: https://stackoverflow.com/a/20552042\n fileEl.type = '';\n fileEl.type = 'file';\n fileEl.value = '';\n }\n\n async delete(attachment: AttachmentView) {\n if (this.deletePromises[attachment.id] != null) {\n return;\n }\n\n const confirmed = await this.platformUtilsService.showDialog(\n this.i18nService.t('deleteAttachmentConfirmation'), this.i18nService.t('deleteAttachment'),\n this.i18nService.t('yes'), this.i18nService.t('no'), 'warning');\n if (!confirmed) {\n return;\n }\n\n try {\n this.deletePromises[attachment.id] = this.deleteCipherAttachment(attachment.id);\n await this.deletePromises[attachment.id];\n this.analytics.eventTrack.next({ action: 'Deleted Attachment' });\n this.toasterService.popAsync('success', null, this.i18nService.t('deletedAttachment'));\n const i = this.cipher.attachments.indexOf(attachment);\n if (i > -1) {\n this.cipher.attachments.splice(i, 1);\n }\n } catch { }\n\n this.deletePromises[attachment.id] = null;\n this.onDeletedAttachment.emit();\n }\n\n async download(attachment: AttachmentView) {\n const a = (attachment as any);\n if (a.downloading) {\n return;\n }\n\n if (!this.canAccessAttachments) {\n this.toasterService.popAsync('error', this.i18nService.t('premiumRequired'),\n this.i18nService.t('premiumRequiredDesc'));\n return;\n }\n\n a.downloading = true;\n const response = await fetch(new Request(attachment.url, { cache: 'no-cache' }));\n if (response.status !== 200) {\n this.toasterService.popAsync('error', null, this.i18nService.t('errorOccurred'));\n a.downloading = false;\n return;\n }\n\n try {\n const buf = await response.arrayBuffer();\n const key = await this.cryptoService.getOrgKey(this.cipher.organizationId);\n const decBuf = await this.cryptoService.decryptFromBytes(buf, key);\n this.platformUtilsService.saveFile(this.win, decBuf, null, attachment.fileName);\n } catch (e) {\n this.toasterService.popAsync('error', null, this.i18nService.t('errorOccurred'));\n }\n\n a.downloading = false;\n }\n\n protected loadCipher() {\n return this.cipherService.get(this.cipherId);\n }\n\n protected saveCipherAttachment(file: File) {\n return this.cipherService.saveAttachmentWithServer(this.cipherDomain, file);\n }\n\n protected deleteCipherAttachment(attachmentId: string) {\n return this.cipherService.deleteAttachmentWithServer(this.cipher.id, attachmentId);\n }\n}\n","import {\n EventEmitter,\n Input,\n Output,\n} from '@angular/core';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { CipherType } from '../../enums/cipherType';\nimport { FieldType } from '../../enums/fieldType';\nimport { SecureNoteType } from '../../enums/secureNoteType';\nimport { UriMatchType } from '../../enums/uriMatchType';\n\nimport { AuditService } from '../../abstractions/audit.service';\nimport { CipherService } from '../../abstractions/cipher.service';\nimport { FolderService } from '../../abstractions/folder.service';\nimport { I18nService } from '../../abstractions/i18n.service';\nimport { PlatformUtilsService } from '../../abstractions/platformUtils.service';\nimport { StateService } from '../../abstractions/state.service';\n\nimport { Cipher } from '../../models/domain/cipher';\n\nimport { CardView } from '../../models/view/cardView';\nimport { CipherView } from '../../models/view/cipherView';\nimport { FieldView } from '../../models/view/fieldView';\nimport { FolderView } from '../../models/view/folderView';\nimport { IdentityView } from '../../models/view/identityView';\nimport { LoginUriView } from '../../models/view/loginUriView';\nimport { LoginView } from '../../models/view/loginView';\nimport { SecureNoteView } from '../../models/view/secureNoteView';\n\nexport class AddEditComponent {\n @Input() folderId: string = null;\n @Input() cipherId: string;\n @Input() type: CipherType;\n @Output() onSavedCipher = new EventEmitter();\n @Output() onDeletedCipher = new EventEmitter();\n @Output() onCancelled = new EventEmitter();\n @Output() onEditAttachments = new EventEmitter();\n @Output() onGeneratePassword = new EventEmitter();\n\n editMode: boolean = false;\n cipher: CipherView;\n folders: FolderView[];\n title: string;\n formPromise: Promise;\n deletePromise: Promise;\n checkPasswordPromise: Promise;\n showPassword: boolean = false;\n showCardCode: boolean = false;\n cipherType = CipherType;\n fieldType = FieldType;\n addFieldType: FieldType = FieldType.Text;\n typeOptions: any[];\n cardBrandOptions: any[];\n cardExpMonthOptions: any[];\n identityTitleOptions: any[];\n addFieldTypeOptions: any[];\n uriMatchOptions: any[];\n\n constructor(protected cipherService: CipherService, protected folderService: FolderService,\n protected i18nService: I18nService, protected platformUtilsService: PlatformUtilsService,\n protected analytics: Angulartics2, protected toasterService: ToasterService,\n protected auditService: AuditService, protected stateService: StateService) {\n this.typeOptions = [\n { name: i18nService.t('typeLogin'), value: CipherType.Login },\n { name: i18nService.t('typeCard'), value: CipherType.Card },\n { name: i18nService.t('typeIdentity'), value: CipherType.Identity },\n { name: i18nService.t('typeSecureNote'), value: CipherType.SecureNote },\n ];\n this.cardBrandOptions = [\n { name: '-- ' + i18nService.t('select') + ' --', value: null },\n { name: 'Visa', value: 'Visa' },\n { name: 'Mastercard', value: 'Mastercard' },\n { name: 'American Express', value: 'Amex' },\n { name: 'Discover', value: 'Discover' },\n { name: 'Diners Club', value: 'Diners Club' },\n { name: 'JCB', value: 'JCB' },\n { name: 'Maestro', value: 'Maestro' },\n { name: 'UnionPay', value: 'UnionPay' },\n { name: i18nService.t('other'), value: 'Other' },\n ];\n this.cardExpMonthOptions = [\n { name: '-- ' + i18nService.t('select') + ' --', value: null },\n { name: '01 - ' + i18nService.t('january'), value: '1' },\n { name: '02 - ' + i18nService.t('february'), value: '2' },\n { name: '03 - ' + i18nService.t('march'), value: '3' },\n { name: '04 - ' + i18nService.t('april'), value: '4' },\n { name: '05 - ' + i18nService.t('may'), value: '5' },\n { name: '06 - ' + i18nService.t('june'), value: '6' },\n { name: '07 - ' + i18nService.t('july'), value: '7' },\n { name: '08 - ' + i18nService.t('august'), value: '8' },\n { name: '09 - ' + i18nService.t('september'), value: '9' },\n { name: '10 - ' + i18nService.t('october'), value: '10' },\n { name: '11 - ' + i18nService.t('november'), value: '11' },\n { name: '12 - ' + i18nService.t('december'), value: '12' },\n ];\n this.identityTitleOptions = [\n { name: '-- ' + i18nService.t('select') + ' --', value: null },\n { name: i18nService.t('mr'), value: i18nService.t('mr') },\n { name: i18nService.t('mrs'), value: i18nService.t('mrs') },\n { name: i18nService.t('ms'), value: i18nService.t('ms') },\n { name: i18nService.t('dr'), value: i18nService.t('dr') },\n ];\n this.addFieldTypeOptions = [\n { name: i18nService.t('cfTypeText'), value: FieldType.Text },\n { name: i18nService.t('cfTypeHidden'), value: FieldType.Hidden },\n { name: i18nService.t('cfTypeBoolean'), value: FieldType.Boolean },\n ];\n this.uriMatchOptions = [\n { name: i18nService.t('defaultMatchDetection'), value: null },\n { name: i18nService.t('baseDomain'), value: UriMatchType.Domain },\n { name: i18nService.t('host'), value: UriMatchType.Host },\n { name: i18nService.t('startsWith'), value: UriMatchType.StartsWith },\n { name: i18nService.t('regEx'), value: UriMatchType.RegularExpression },\n { name: i18nService.t('exact'), value: UriMatchType.Exact },\n { name: i18nService.t('never'), value: UriMatchType.Never },\n ];\n }\n\n async load() {\n this.editMode = this.cipherId != null;\n if (this.editMode) {\n this.editMode = true;\n this.title = this.i18nService.t('editItem');\n } else {\n this.title = this.i18nService.t('addItem');\n }\n\n this.cipher = await this.stateService.get('addEditCipher');\n await this.stateService.remove('addEditCipher');\n if (this.cipher == null) {\n if (this.editMode) {\n const cipher = await this.loadCipher();\n this.cipher = await cipher.decrypt();\n } else {\n this.cipher = new CipherView();\n this.cipher.folderId = this.folderId;\n this.cipher.type = this.type == null ? CipherType.Login : this.type;\n this.cipher.login = new LoginView();\n this.cipher.login.uris = [new LoginUriView()];\n this.cipher.card = new CardView();\n this.cipher.identity = new IdentityView();\n this.cipher.secureNote = new SecureNoteView();\n this.cipher.secureNote.type = SecureNoteType.Generic;\n }\n }\n\n this.folders = await this.folderService.getAllDecrypted();\n }\n\n async submit(): Promise {\n if (this.cipher.name == null || this.cipher.name === '') {\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'),\n this.i18nService.t('nameRequired'));\n return false;\n }\n\n if (!this.editMode && this.cipher.type === CipherType.Login &&\n this.cipher.login.uris != null && this.cipher.login.uris.length === 1 &&\n (this.cipher.login.uris[0].uri == null || this.cipher.login.uris[0].uri === '')) {\n this.cipher.login.uris = null;\n }\n\n const cipher = await this.encryptCipher();\n try {\n this.formPromise = this.saveCipher(cipher);\n await this.formPromise;\n this.cipher.id = cipher.id;\n this.analytics.eventTrack.next({ action: this.editMode ? 'Edited Cipher' : 'Added Cipher' });\n this.toasterService.popAsync('success', null,\n this.i18nService.t(this.editMode ? 'editedItem' : 'addedItem'));\n this.onSavedCipher.emit(this.cipher);\n return true;\n } catch { }\n\n return false;\n }\n\n addUri() {\n if (this.cipher.type !== CipherType.Login) {\n return;\n }\n\n if (this.cipher.login.uris == null) {\n this.cipher.login.uris = [];\n }\n\n this.cipher.login.uris.push(new LoginUriView());\n }\n\n removeUri(uri: LoginUriView) {\n if (this.cipher.type !== CipherType.Login || this.cipher.login.uris == null) {\n return;\n }\n\n const i = this.cipher.login.uris.indexOf(uri);\n if (i > -1) {\n this.cipher.login.uris.splice(i, 1);\n }\n }\n\n addField() {\n if (this.cipher.fields == null) {\n this.cipher.fields = [];\n }\n\n const f = new FieldView();\n f.type = this.addFieldType;\n this.cipher.fields.push(f);\n }\n\n removeField(field: FieldView) {\n const i = this.cipher.fields.indexOf(field);\n if (i > -1) {\n this.cipher.fields.splice(i, 1);\n }\n }\n\n cancel() {\n this.onCancelled.emit(this.cipher);\n }\n\n attachments() {\n this.onEditAttachments.emit(this.cipher);\n }\n\n async delete(): Promise {\n const confirmed = await this.platformUtilsService.showDialog(\n this.i18nService.t('deleteItemConfirmation'), this.i18nService.t('deleteItem'),\n this.i18nService.t('yes'), this.i18nService.t('no'), 'warning');\n if (!confirmed) {\n return false;\n }\n\n try {\n this.deletePromise = this.deleteCipher();\n await this.deletePromise;\n this.analytics.eventTrack.next({ action: 'Deleted Cipher' });\n this.toasterService.popAsync('success', null, this.i18nService.t('deletedItem'));\n this.onDeletedCipher.emit(this.cipher);\n } catch { }\n\n return true;\n }\n\n async generatePassword(): Promise {\n if (this.cipher.login != null && this.cipher.login.password != null && this.cipher.login.password.length) {\n const confirmed = await this.platformUtilsService.showDialog(\n this.i18nService.t('overwritePasswordConfirmation'), this.i18nService.t('overwritePassword'),\n this.i18nService.t('yes'), this.i18nService.t('no'));\n if (!confirmed) {\n return false;\n }\n }\n\n this.onGeneratePassword.emit();\n return true;\n }\n\n togglePassword() {\n this.analytics.eventTrack.next({ action: 'Toggled Password on Edit' });\n this.showPassword = !this.showPassword;\n document.getElementById('loginPassword').focus();\n }\n\n toggleCardCode() {\n this.analytics.eventTrack.next({ action: 'Toggled CardCode on Edit' });\n this.showCardCode = !this.showCardCode;\n document.getElementById('cardCode').focus();\n }\n\n toggleFieldValue(field: FieldView) {\n const f = (field as any);\n f.showValue = !f.showValue;\n }\n\n toggleUriOptions(uri: LoginUriView) {\n const u = (uri as any);\n u.showOptions = u.showOptions == null && uri.match != null ? false : !u.showOptions;\n }\n\n loginUriMatchChanged(uri: LoginUriView) {\n const u = (uri as any);\n u.showOptions = u.showOptions == null ? true : u.showOptions;\n }\n\n async checkPassword() {\n if (this.checkPasswordPromise != null) {\n return;\n }\n\n if (this.cipher.login == null || this.cipher.login.password == null || this.cipher.login.password === '') {\n return;\n }\n\n this.analytics.eventTrack.next({ action: 'Check Password' });\n this.checkPasswordPromise = this.auditService.passwordLeaked(this.cipher.login.password);\n const matches = await this.checkPasswordPromise;\n this.checkPasswordPromise = null;\n\n if (matches > 0) {\n this.toasterService.popAsync('warning', null, this.i18nService.t('passwordExposed', matches.toString()));\n } else {\n this.toasterService.popAsync('success', null, this.i18nService.t('passwordSafe'));\n }\n }\n\n protected loadCipher() {\n return this.cipherService.get(this.cipherId);\n }\n\n protected encryptCipher() {\n return this.cipherService.encrypt(this.cipher);\n }\n\n protected saveCipher(cipher: Cipher) {\n return this.cipherService.saveWithServer(cipher);\n }\n\n protected deleteCipher() {\n return this.cipherService.deleteWithServer(this.cipher.id);\n }\n}\n","import { CipherWithIdRequest } from './cipherWithIdRequest';\nimport { FolderWithIdRequest } from './folderWithIdRequest';\n\nexport class UpdateKeyRequest {\n ciphers: CipherWithIdRequest[] = [];\n folders: FolderWithIdRequest[] = [];\n masterPasswordHash: string;\n privateKey: string;\n key: string;\n}\n","import { FolderRequest } from './folderRequest';\n\nimport { Folder } from '../domain/folder';\n\nexport class FolderWithIdRequest extends FolderRequest {\n id: string;\n\n constructor(folder: Folder) {\n super(folder);\n this.id = folder.id;\n }\n}\n","import {\n EventEmitter,\n Input,\n Output,\n} from '@angular/core';\n\nimport { CipherService } from '../../abstractions/cipher.service';\n\nimport { CipherView } from '../../models/view/cipherView';\n\nexport class CiphersComponent {\n @Input() activeCipherId: string = null;\n @Output() onCipherClicked = new EventEmitter();\n @Output() onCipherRightClicked = new EventEmitter();\n @Output() onAddCipher = new EventEmitter();\n @Output() onAddCipherOptions = new EventEmitter();\n\n loaded: boolean = false;\n ciphers: CipherView[] = [];\n searchText: string;\n searchPlaceholder: string = null;\n\n protected allCiphers: CipherView[] = [];\n protected filter: (cipher: CipherView) => boolean = null;\n\n constructor(protected cipherService: CipherService) { }\n\n async load(filter: (cipher: CipherView) => boolean = null) {\n this.allCiphers = await this.cipherService.getAllDecrypted();\n this.applyFilter(filter);\n this.loaded = true;\n }\n\n async refresh() {\n this.loaded = false;\n this.ciphers = [];\n await this.load(this.filter);\n }\n\n applyFilter(filter: (cipher: CipherView) => boolean = null) {\n this.filter = filter;\n if (this.filter == null) {\n this.ciphers = this.allCiphers;\n } else {\n this.ciphers = this.allCiphers.filter(this.filter);\n }\n }\n\n selectCipher(cipher: CipherView) {\n this.onCipherClicked.emit(cipher);\n }\n\n rightClickCipher(cipher: CipherView) {\n this.onCipherRightClicked.emit(cipher);\n }\n\n addCipher() {\n this.onAddCipher.emit();\n }\n\n addCipherOptions() {\n this.onAddCipherOptions.emit();\n }\n}\n","export enum LogLevelType {\r\n Debug,\r\n Info,\r\n Warning,\r\n Error,\r\n}\r\n","export { CipherType } from './cipherType';\r\nexport { DeviceType } from './deviceType';\r\nexport { EncryptionType } from './encryptionType';\r\nexport { FieldType } from './fieldType';\r\nexport { LogLevelType } from './logLevelType';\r\nexport { SecureNoteType } from './secureNoteType';\r\nexport { TwoFactorProviderType } from './twoFactorProviderType';\r\nexport { UriMatchType } from './uriMatchType';\r\n","import {\n Directive,\n ElementRef,\n HostListener,\n Input,\n} from '@angular/core';\r\n\r\n@Directive({\r\n selector: '[appFallbackSrc]',\r\n})\r\nexport class FallbackSrcDirective {\n @Input('appFallbackSrc') appFallbackSrc: string;\n\n constructor(private el: ElementRef) {\n }\n\n @HostListener('error') onError() {\r\n this.el.nativeElement.src = this.appFallbackSrc;\r\n }\r\n}\n","import {\n Component,\n EventEmitter,\n Input,\n Output,\n} from '@angular/core';\n\nimport { CipherType } from '../../enums/cipherType';\n\nimport { CollectionView } from '../../models/view/collectionView';\nimport { FolderView } from '../../models/view/folderView';\n\nimport { CollectionService } from '../../abstractions/collection.service';\nimport { FolderService } from '../../abstractions/folder.service';\n\nexport class GroupingsComponent {\n @Input() showFolders = true;\n @Input() showCollections = true;\n @Input() showFavorites = true;\n\n @Output() onAllClicked = new EventEmitter();\n @Output() onFavoritesClicked = new EventEmitter();\n @Output() onCipherTypeClicked = new EventEmitter();\n @Output() onFolderClicked = new EventEmitter();\n @Output() onAddFolder = new EventEmitter();\n @Output() onEditFolder = new EventEmitter();\n @Output() onCollectionClicked = new EventEmitter();\n\n folders: FolderView[];\n collections: CollectionView[];\n loaded: boolean = false;\n cipherType = CipherType;\n selectedAll: boolean = false;\n selectedFavorites: boolean = false;\n selectedType: CipherType = null;\n selectedFolder: boolean = false;\n selectedFolderId: string = null;\n selectedCollectionId: string = null;\n\n constructor(protected collectionService: CollectionService, protected folderService: FolderService) { }\n\n async load(setLoaded = true) {\n await this.loadFolders();\n await this.loadCollections();\n\n if (setLoaded) {\n this.loaded = true;\n }\n }\n\n async loadCollections(organizationId?: string) {\n if (!this.showCollections) {\n return;\n }\n const collections = await this.collectionService.getAllDecrypted();\n if (organizationId != null) {\n this.collections = collections.filter((c) => c.organizationId === organizationId);\n } else {\n this.collections = collections;\n }\n }\n\n async loadFolders() {\n if (!this.showFolders) {\n return;\n }\n this.folders = await this.folderService.getAllDecrypted();\n }\n\n selectAll() {\n this.clearSelections();\n this.selectedAll = true;\n this.onAllClicked.emit();\n }\n\n selectFavorites() {\n this.clearSelections();\n this.selectedFavorites = true;\n this.onFavoritesClicked.emit();\n }\n\n selectType(type: CipherType) {\n this.clearSelections();\n this.selectedType = type;\n this.onCipherTypeClicked.emit(type);\n }\n\n selectFolder(folder: FolderView) {\n this.clearSelections();\n this.selectedFolder = true;\n this.selectedFolderId = folder.id;\n this.onFolderClicked.emit(folder);\n }\n\n addFolder() {\n this.onAddFolder.emit();\n }\n\n editFolder(folder: FolderView) {\n this.onEditFolder.emit(folder);\n }\n\n selectCollection(collection: CollectionView) {\n this.clearSelections();\n this.selectedCollectionId = collection.id;\n this.onCollectionClicked.emit(collection);\n }\n\n clearSelections() {\n this.selectedAll = false;\n this.selectedFavorites = false;\n this.selectedType = null;\n this.selectedFolder = false;\n this.selectedFolderId = null;\n this.selectedCollectionId = null;\n }\n}\n","
\n
\n {{'verifyEmail' | i18n}}\n
\n
\n

{{'verifyEmailDesc' | i18n}}

\n \n
\n
\n","
\n
\n
\n \n \n
\n \n
\n
\n
\n {{'updateKeyTitle' | i18n}}\n
\n
\n

{{'updateEncryptionKeyShortDesc' | i18n}}

\n \n
\n
\n \n
\n
\n {{'updateBrowser' | i18n}}\n
\n
\n

{{'updateBrowserDesc' | i18n}}

\n \n {{'updateBrowser' | i18n}}\n \n
\n
\n
\n
\n {{'goPremium' | i18n}}\n
\n
\n

{{'premiumUpgradeUnlockFeatures' | i18n}}

\n \n {{'goPremium' | i18n}}\n \n
\n
\n
\n
\n {{'organizations' | i18n}}\n \n \n \n
\n
\n \n
\n
\n
\n
\n
\n\n\n\n\n\n\n\n\n\n","\r\n\r\n\r\n","export class VerifyDeleteRecoverRequest {\n userId: string;\n token: string;\n\n constructor(userId: string, token: string) {\n this.userId = userId;\n this.token = token;\n }\n}\n","
\n
\n
\n

{{'deleteAccount' | i18n}}

\n
\n
\n {{'deleteAccountWarning' | i18n}}\n

\n {{email}}\n

\n

{{'deleteRecoverConfirmDesc' | i18n}}

\n
\n
\n \n \n {{'cancel' | i18n}}\n \n
\n
\n
\n
\n
\n
\n","export class DeleteRecoverRequest {\n email: string;\n}\n","
\n
\n
\n

{{'deleteAccount' | i18n}}

\n
\n
\n

{{'deleteRecoverDesc' | i18n}}

\n
\n \n \n
\n
\n
\n \n \n {{'cancel' | i18n}}\n \n
\n
\n
\n
\n
\n
\n","import { PasswordVerificationRequest } from './passwordVerificationRequest';\n\nexport class TwoFactorRecoveryRequest extends PasswordVerificationRequest {\n recoveryCode: string;\n email: string;\n}\n","
\n
\n
\n

{{'recoverAccountTwoStep' | i18n}}

\n
\n
\n

{{'recoverAccountTwoStepDesc' | i18n}}\n {{'learnMore' | i18n}}\n

\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n
\n \n \n {{'cancel' | i18n}}\n \n
\n
\n
\n
\n
\n
\n","export class OrganizationUserAcceptRequest {\n token: string;\n}\n","
\n
\n \"Bitwarden\"\n

\n \n

\n
\n
\n
\n
\n
\n

{{'joinOrganization' | i18n}}

\n
\n
\n

\n {{orgName}}\n {{email}}\n

\n

{{'joinOrganizationDesc' | i18n}}

\n
\n \n
\n
\n
\n
\n
\n","export class VerifyEmailRequest {\n userId: string;\n token: string;\n\n constructor(userId: string, token: string) {\n this.userId = userId;\n this.token = token;\n }\n}\n","
\n
\n \"Bitwarden\"\n

\n \n

\n
\n
\n","import { Router } from '@angular/router';\r\n\r\nimport { ToasterService } from 'angular2-toaster';\r\nimport { Angulartics2 } from 'angulartics2';\r\n\r\nimport { CryptoService } from '../../abstractions/crypto.service';\r\nimport { I18nService } from '../../abstractions/i18n.service';\r\nimport { MessagingService } from '../../abstractions/messaging.service';\r\nimport { PlatformUtilsService } from '../../abstractions/platformUtils.service';\r\nimport { UserService } from '../../abstractions/user.service';\r\n\r\nexport class LockComponent {\r\n masterPassword: string = '';\r\n showPassword: boolean = false;\r\n\r\n protected successRoute: string = 'vault';\r\n\r\n constructor(protected router: Router, protected analytics: Angulartics2,\r\n protected toasterService: ToasterService, protected i18nService: I18nService,\r\n protected platformUtilsService: PlatformUtilsService, protected messagingService: MessagingService,\r\n protected userService: UserService, protected cryptoService: CryptoService) { }\r\n\r\n async submit() {\r\n if (this.masterPassword == null || this.masterPassword === '') {\r\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'),\r\n this.i18nService.t('masterPassRequired'));\r\n return;\r\n }\r\n\r\n const email = await this.userService.getEmail();\r\n const key = await this.cryptoService.makeKey(this.masterPassword, email);\r\n const keyHash = await this.cryptoService.hashPassword(this.masterPassword, key);\r\n const storedKeyHash = await this.cryptoService.getKeyHash();\r\n\r\n if (storedKeyHash != null && keyHash != null && storedKeyHash === keyHash) {\r\n await this.cryptoService.setKey(key);\r\n this.messagingService.send('unlocked');\r\n this.router.navigate([this.successRoute]);\r\n } else {\r\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'),\r\n this.i18nService.t('invalidMasterPassword'));\r\n }\r\n }\r\n\r\n async logOut() {\r\n const confirmed = await this.platformUtilsService.showDialog(this.i18nService.t('logOutConfirmation'),\r\n this.i18nService.t('logOut'), this.i18nService.t('logOut'), this.i18nService.t('cancel'));\r\n if (confirmed) {\r\n this.messagingService.send('logout');\r\n }\r\n }\r\n\r\n togglePassword() {\r\n this.analytics.eventTrack.next({ action: 'Toggled Master Password on Unlock' });\r\n this.showPassword = !this.showPassword;\r\n document.getElementById('masterPassword').focus();\r\n }\r\n}\r\n","
\n
\n
\n

\n \n

\n

{{'yourVaultIsLocked' | i18n}}

\n
\n
\n
\n \n
\n \n \n
\n
\n
\n
\n \n \n
\n
\n
\n
\n
\n
\n","export class PasswordHintRequest {\r\n email: string;\r\n\r\n constructor(email: string) {\r\n this.email = email;\r\n }\r\n}\r\n","import { Router } from '@angular/router';\r\n\r\nimport { ToasterService } from 'angular2-toaster';\r\nimport { Angulartics2 } from 'angulartics2';\r\n\r\nimport { PasswordHintRequest } from '../../models/request/passwordHintRequest';\r\n\r\nimport { ApiService } from '../../abstractions/api.service';\r\nimport { I18nService } from '../../abstractions/i18n.service';\r\n\r\nexport class HintComponent {\r\n email: string = '';\r\n formPromise: Promise;\r\n\r\n protected successRoute = 'login';\r\n\r\n constructor(protected router: Router, protected analytics: Angulartics2,\r\n protected toasterService: ToasterService, protected i18nService: I18nService,\r\n protected apiService: ApiService) { }\r\n\r\n async submit() {\r\n if (this.email == null || this.email === '') {\r\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'),\r\n this.i18nService.t('emailRequired'));\r\n return;\r\n }\r\n if (this.email.indexOf('@') === -1) {\r\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'),\r\n this.i18nService.t('invalidEmail'));\r\n return;\r\n }\r\n\r\n try {\r\n this.formPromise = this.apiService.postPasswordHint(new PasswordHintRequest(this.email));\r\n await this.formPromise;\r\n this.analytics.eventTrack.next({ action: 'Requested Hint' });\r\n this.toasterService.popAsync('success', null, this.i18nService.t('masterPassSent'));\r\n this.router.navigate([this.successRoute]);\r\n } catch { }\r\n }\r\n}\r\n","
\n
\n
\n

{{'passwordHint' | i18n}}

\n
\n
\n
\n \n \n {{'enterEmailToGetHint' | i18n}}\n
\n
\n
\n \n \n {{'cancel' | i18n}}\n \n
\n
\n
\n
\n
\n
\n","import { KeysRequest } from './keysRequest';\n\nexport class RegisterRequest {\n name: string;\n email: string;\n masterPasswordHash: string;\n masterPasswordHint: string;\n key: string;\n keys: KeysRequest;\n token: string;\n organizationUserId: string;\n\n constructor(email: string, name: string, masterPasswordHash: string, masterPasswordHint: string, key: string) {\n this.name = name;\n this.email = email;\n this.masterPasswordHash = masterPasswordHash;\n this.masterPasswordHint = masterPasswordHint ? masterPasswordHint : null;\n this.key = key;\n }\n}\n","import { Router } from '@angular/router';\r\n\r\nimport { ToasterService } from 'angular2-toaster';\r\nimport { Angulartics2 } from 'angulartics2';\r\n\r\nimport { KeysRequest } from '../../models/request/keysRequest';\r\nimport { RegisterRequest } from '../../models/request/registerRequest';\r\n\r\nimport { ApiService } from '../../abstractions/api.service';\r\nimport { AuthService } from '../../abstractions/auth.service';\r\nimport { CryptoService } from '../../abstractions/crypto.service';\r\nimport { I18nService } from '../../abstractions/i18n.service';\r\nimport { StateService } from '../../abstractions/state.service';\r\n\r\nexport class RegisterComponent {\r\n name: string = '';\r\n email: string = '';\r\n masterPassword: string = '';\r\n confirmMasterPassword: string = '';\r\n hint: string = '';\r\n showPassword: boolean = false;\r\n formPromise: Promise;\r\n\r\n protected successRoute = 'login';\r\n\r\n constructor(protected authService: AuthService, protected router: Router,\r\n protected analytics: Angulartics2, protected toasterService: ToasterService,\r\n protected i18nService: I18nService, protected cryptoService: CryptoService,\r\n protected apiService: ApiService, protected stateService: StateService) { }\r\n\r\n async submit() {\r\n if (this.email == null || this.email === '') {\r\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'),\r\n this.i18nService.t('emailRequired'));\r\n return;\r\n }\r\n if (this.email.indexOf('@') === -1) {\r\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'),\r\n this.i18nService.t('invalidEmail'));\r\n return;\r\n }\r\n if (this.masterPassword == null || this.masterPassword === '') {\r\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'),\r\n this.i18nService.t('masterPassRequired'));\r\n return;\r\n }\r\n if (this.masterPassword.length < 8) {\r\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'),\r\n this.i18nService.t('masterPassLength'));\r\n return;\r\n }\r\n if (this.masterPassword !== this.confirmMasterPassword) {\r\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'),\r\n this.i18nService.t('masterPassDoesntMatch'));\r\n return;\r\n }\r\n\r\n this.name = this.name === '' ? null : this.name;\r\n this.email = this.email.toLowerCase();\r\n const key = await this.cryptoService.makeKey(this.masterPassword, this.email);\r\n const encKey = await this.cryptoService.makeEncKey(key);\r\n const hashedPassword = await this.cryptoService.hashPassword(this.masterPassword, key);\r\n const keys = await this.cryptoService.makeKeyPair(encKey[0]);\r\n const request = new RegisterRequest(this.email, this.name, hashedPassword,\r\n this.hint, encKey[1].encryptedString);\r\n request.keys = new KeysRequest(keys[0], keys[1].encryptedString);\r\n const orgInvite = await this.stateService.get('orgInvitation');\r\n if (orgInvite != null && orgInvite.token != null && orgInvite.organizationUserId != null) {\r\n request.token = orgInvite.token;\r\n request.organizationUserId = orgInvite.organizationUserId;\r\n }\r\n\r\n try {\r\n this.formPromise = this.apiService.postRegister(request);\r\n await this.formPromise;\r\n this.analytics.eventTrack.next({ action: 'Registered' });\r\n this.toasterService.popAsync('success', null, this.i18nService.t('newAccountCreated'));\r\n this.router.navigate([this.successRoute], { queryParams: { email: this.email } });\r\n } catch { }\r\n }\r\n\r\n togglePassword(confirmField: boolean) {\r\n this.analytics.eventTrack.next({ action: 'Toggled Master Password on Register' });\r\n this.showPassword = !this.showPassword;\r\n document.getElementById(confirmField ? 'masterPasswordRetype' : 'masterPassword').focus();\r\n }\r\n}\r\n","
\n
\n
\n

{{'createAccount' | i18n}}

\n
\n
\n \n {{'createOrganizationCreatePersonalAccount' | i18n}}\n \n
\n \n \n {{'emailAddressDesc' | i18n}}\n
\n
\n \n \n {{'yourNameDesc' | i18n}}\n
\n
\n \n
\n \n \n
\n {{'masterPassDesc' | i18n}}\n
\n
\n \n
\n \n \n
\n
\n
\n \n \n {{'masterPassHintDesc' | i18n}}\n
\n
\n
\n \n \n {{'cancel' | i18n}}\n \n
\n \n {{'submitAgreePolicies' | i18n}}\n {{'termsOfService' | i18n}},\n {{'privacyPolicy' | i18n}}\n \n
\n
\n
\n
\n
\n","export class U2f {\r\n private iframe: HTMLIFrameElement = null;\r\n private connectorLink: HTMLAnchorElement;\r\n private parseFunction = this.parseMessage.bind(this);\r\n\r\n constructor(private win: Window, private webVaultUrl: string, private successCallback: Function,\r\n private errorCallback: Function, private infoCallback: Function) {\r\n this.connectorLink = win.document.createElement('a');\r\n this.webVaultUrl = webVaultUrl != null && webVaultUrl !== '' ? webVaultUrl : 'https://vault.bitwarden.com';\r\n }\r\n\r\n init(data: any): void {\r\n this.connectorLink.href = this.webVaultUrl + '/u2f-connector.html' +\r\n '?data=' + this.base64Encode(JSON.stringify(data)) +\r\n '&parent=' + encodeURIComponent(this.win.document.location.href) +\r\n '&v=1';\r\n\r\n this.iframe = this.win.document.getElementById('u2f_iframe') as HTMLIFrameElement;\r\n this.iframe.src = this.connectorLink.href;\r\n\r\n this.win.addEventListener('message', this.parseFunction, false);\r\n }\r\n\r\n stop() {\r\n this.sendMessage('stop');\r\n }\r\n\r\n start() {\r\n this.sendMessage('start');\r\n }\r\n\r\n sendMessage(message: any) {\r\n if (!this.iframe || !this.iframe.src || !this.iframe.contentWindow) {\r\n return;\r\n }\r\n\r\n this.iframe.contentWindow.postMessage(message, this.iframe.src);\r\n }\r\n\r\n base64Encode(str: string): string {\r\n return btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, (match, p1) => {\r\n return String.fromCharCode(('0x' + p1) as any);\r\n }));\r\n }\r\n\r\n cleanup() {\r\n this.win.removeEventListener('message', this.parseFunction, false);\r\n }\r\n\r\n private parseMessage(event: MessageEvent) {\r\n if (!this.validMessage(event)) {\r\n return;\r\n }\r\n\r\n const parts: string[] = event.data.split('|');\r\n if (parts[0] === 'success' && this.successCallback) {\r\n this.successCallback(parts[1]);\r\n } else if (parts[0] === 'error' && this.errorCallback) {\r\n this.errorCallback(parts[1]);\r\n } else if (parts[0] === 'info' && this.infoCallback) {\r\n this.infoCallback(parts[1]);\r\n }\r\n }\r\n\r\n private validMessage(event: MessageEvent) {\r\n if (event.origin == null || event.origin === '' || event.origin !== (this.connectorLink as any).origin ||\r\n event.data == null || typeof (event.data) !== 'string') {\r\n return false;\r\n }\r\n\r\n return event.data.indexOf('success|') === 0 || event.data.indexOf('error|') === 0 ||\r\n event.data.indexOf('info|') === 0;\r\n }\r\n}\r\n","import { TwoFactorProviderType } from '../../enums/twoFactorProviderType';\n\nimport { DeviceRequest } from './deviceRequest';\r\n\r\nexport class TokenRequest {\r\n email: string;\r\n masterPasswordHash: string;\r\n token: string;\r\n provider: TwoFactorProviderType;\r\n remember: boolean;\r\n device?: DeviceRequest;\r\n\r\n constructor(email: string, masterPasswordHash: string, provider: TwoFactorProviderType,\r\n token: string, remember: boolean, device?: DeviceRequest) {\r\n this.email = email;\r\n this.masterPasswordHash = masterPasswordHash;\r\n this.token = token;\r\n this.provider = provider;\r\n this.remember = remember;\r\n this.device = device != null ? device : null;\r\n }\r\n\r\n toIdentityToken(clientId: string) {\r\n const obj: any = {\r\n grant_type: 'password',\r\n username: this.email,\r\n password: this.masterPasswordHash,\r\n scope: 'api offline_access',\r\n client_id: clientId,\r\n };\r\n\r\n if (this.device) {\r\n obj.deviceType = this.device.type;\r\n obj.deviceIdentifier = this.device.identifier;\r\n obj.deviceName = this.device.name;\r\n // no push tokens for browser apps yet\r\n // obj.devicePushToken = this.device.pushToken;\r\n }\r\n\r\n if (this.token && this.provider !== null && (typeof this.provider !== 'undefined')) {\r\n obj.twoFactorToken = this.token;\r\n obj.twoFactorProvider = this.provider;\r\n obj.twoFactorRemember = this.remember ? '1' : '0';\r\n }\r\n\r\n return obj;\r\n }\r\n}\r\n","import { DeviceType } from '../../enums/deviceType';\r\n\r\nimport { PlatformUtilsService } from '../../abstractions/platformUtils.service';\r\n\r\nexport class DeviceRequest {\r\n type: DeviceType;\r\n name: string;\r\n identifier: string;\r\n pushToken?: string;\r\n\r\n constructor(appId: string, platformUtilsService: PlatformUtilsService) {\r\n this.type = platformUtilsService.getDevice();\r\n this.name = platformUtilsService.getDeviceString();\r\n this.identifier = appId;\r\n this.pushToken = null;\r\n }\r\n}\r\n","import { TwoFactorProviderType } from '../../enums/twoFactorProviderType';\r\n\r\nexport class AuthResult {\r\n twoFactor: boolean = false;\r\n twoFactorProviders: Map = null;\r\n}\r\n","import {\r\n OnDestroy,\r\n OnInit,\r\n} from '@angular/core';\r\nimport { Router } from '@angular/router';\r\n\r\nimport { ToasterService } from 'angular2-toaster';\r\nimport { Angulartics2 } from 'angulartics2';\r\n\r\nimport { DeviceType } from '../../enums/deviceType';\r\nimport { TwoFactorProviderType } from '../../enums/twoFactorProviderType';\r\n\r\nimport { TwoFactorEmailRequest } from '../../models/request/twoFactorEmailRequest';\r\n\r\nimport { ApiService } from '../../abstractions/api.service';\r\nimport { AuthService } from '../../abstractions/auth.service';\r\nimport { EnvironmentService } from '../../abstractions/environment.service';\r\nimport { I18nService } from '../../abstractions/i18n.service';\r\nimport { PlatformUtilsService } from '../../abstractions/platformUtils.service';\r\n\r\nimport { TwoFactorProviders } from '../../services/auth.service';\r\n\r\nimport * as DuoWebSDK from '../../misc/duo';\r\nimport { U2f } from '../../misc/u2f';\r\n\r\nexport class TwoFactorComponent implements OnInit, OnDestroy {\r\n token: string = '';\r\n remember: boolean = false;\r\n u2fReady: boolean = false;\r\n providers = TwoFactorProviders;\r\n providerType = TwoFactorProviderType;\r\n selectedProviderType: TwoFactorProviderType = TwoFactorProviderType.Authenticator;\r\n u2fSupported: boolean = false;\r\n u2f: U2f = null;\r\n title: string = '';\r\n twoFactorEmail: string = null;\r\n formPromise: Promise;\r\n emailPromise: Promise;\r\n onSuccessfulLogin: () => Promise;\r\n onSuccessfulLoginNavigate: () => Promise;\r\n\r\n protected loginRoute = 'login';\r\n protected successRoute = 'vault';\r\n\r\n constructor(protected authService: AuthService, protected router: Router,\r\n protected analytics: Angulartics2, protected toasterService: ToasterService,\r\n protected i18nService: I18nService, protected apiService: ApiService,\r\n protected platformUtilsService: PlatformUtilsService, protected win: Window,\r\n protected environmentService: EnvironmentService) {\r\n this.u2fSupported = this.platformUtilsService.supportsU2f(win);\r\n }\r\n\r\n async ngOnInit() {\r\n if (this.authService.email == null || this.authService.masterPasswordHash == null ||\r\n this.authService.twoFactorProviders == null) {\r\n this.router.navigate([this.loginRoute]);\r\n return;\r\n }\r\n\r\n if (this.win != null && this.u2fSupported) {\r\n let customWebVaultUrl: string = null;\r\n if (this.environmentService.baseUrl != null) {\r\n customWebVaultUrl = this.environmentService.baseUrl;\r\n } else if (this.environmentService.webVaultUrl != null) {\r\n customWebVaultUrl = this.environmentService.webVaultUrl;\r\n }\r\n\r\n this.u2f = new U2f(this.win, customWebVaultUrl, (token: string) => {\r\n this.token = token;\r\n this.submit();\r\n }, (error: string) => {\r\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'), error);\r\n }, (info: string) => {\r\n if (info === 'ready') {\r\n this.u2fReady = true;\r\n }\r\n });\r\n }\r\n\r\n this.selectedProviderType = this.authService.getDefaultTwoFactorProvider(this.u2fSupported);\r\n await this.init();\r\n }\r\n\r\n ngOnDestroy(): void {\r\n this.cleanupU2f();\r\n this.u2f = null;\r\n }\r\n\r\n async init() {\r\n if (this.selectedProviderType == null) {\r\n this.title = this.i18nService.t('loginUnavailable');\r\n return;\r\n }\r\n\r\n this.cleanupU2f();\r\n this.title = (TwoFactorProviders as any)[this.selectedProviderType].name;\r\n const params = this.authService.twoFactorProviders.get(this.selectedProviderType);\r\n switch (this.selectedProviderType) {\r\n case TwoFactorProviderType.U2f:\r\n if (!this.u2fSupported || this.u2f == null) {\r\n break;\r\n }\r\n\r\n const challenges = JSON.parse(params.Challenges);\r\n if (challenges.length > 0) {\r\n this.u2f.init({\r\n appId: challenges[0].appId,\r\n challenge: challenges[0].challenge,\r\n keys: [{\r\n version: challenges[0].version,\r\n keyHandle: challenges[0].keyHandle,\r\n }],\r\n });\r\n }\r\n break;\r\n case TwoFactorProviderType.Duo:\r\n case TwoFactorProviderType.OrganizationDuo:\r\n if (this.platformUtilsService.getDevice() === DeviceType.SafariExtension) {\r\n break;\r\n }\r\n\r\n setTimeout(() => {\r\n DuoWebSDK.init({\r\n iframe: undefined,\r\n host: params.Host,\r\n sig_request: params.Signature,\r\n submit_callback: async (f: HTMLFormElement) => {\r\n const sig = f.querySelector('input[name=\"sig_response\"]') as HTMLInputElement;\r\n if (sig != null) {\r\n this.token = sig.value;\r\n await this.submit();\r\n }\r\n },\r\n });\r\n }, 0);\r\n break;\r\n case TwoFactorProviderType.Email:\r\n this.twoFactorEmail = params.Email;\r\n if (this.authService.twoFactorProviders.size > 1) {\r\n await this.sendEmail(false);\r\n }\r\n break;\r\n default:\r\n break;\r\n }\r\n }\r\n\r\n async submit() {\r\n if (this.token == null || this.token === '') {\r\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'),\r\n this.i18nService.t('verificationCodeRequired'));\r\n return;\r\n }\r\n\r\n if (this.selectedProviderType === TwoFactorProviderType.U2f) {\r\n if (this.u2f != null) {\r\n this.u2f.stop();\r\n } else {\r\n return;\r\n }\r\n } else if (this.selectedProviderType === TwoFactorProviderType.Email ||\r\n this.selectedProviderType === TwoFactorProviderType.Authenticator) {\r\n this.token = this.token.replace(' ', '').trim();\r\n }\r\n\r\n try {\r\n this.formPromise = this.authService.logInTwoFactor(this.selectedProviderType, this.token, this.remember);\r\n await this.formPromise;\r\n if (this.onSuccessfulLogin != null) {\r\n this.onSuccessfulLogin();\r\n }\r\n this.analytics.eventTrack.next({ action: 'Logged In From Two-step' });\r\n if (this.onSuccessfulLoginNavigate != null) {\r\n this.onSuccessfulLoginNavigate();\r\n } else {\r\n this.router.navigate([this.successRoute]);\r\n }\r\n } catch (e) {\r\n if (this.selectedProviderType === TwoFactorProviderType.U2f && this.u2f != null) {\r\n this.u2f.start();\r\n } else {\r\n throw e;\r\n }\r\n }\r\n }\r\n\r\n async sendEmail(doToast: boolean) {\r\n if (this.selectedProviderType !== TwoFactorProviderType.Email) {\r\n return;\r\n }\r\n\r\n if (this.emailPromise != null) {\r\n return;\r\n }\r\n\r\n try {\r\n const request = new TwoFactorEmailRequest(this.authService.email, this.authService.masterPasswordHash);\r\n this.emailPromise = this.apiService.postTwoFactorEmail(request);\r\n await this.emailPromise;\r\n if (doToast) {\r\n this.toasterService.popAsync('success', null,\r\n this.i18nService.t('verificationCodeEmailSent', this.twoFactorEmail));\r\n }\r\n } catch { }\r\n\r\n this.emailPromise = null;\r\n }\r\n\r\n private cleanupU2f() {\r\n if (this.u2f != null) {\r\n this.u2f.stop();\r\n this.u2f.cleanup();\r\n }\r\n }\r\n}\r\n","import {\r\n Component,\r\n ComponentFactoryResolver,\r\n EventEmitter,\r\n OnDestroy,\r\n Output,\r\n Type,\r\n ViewChild,\r\n ViewContainerRef,\r\n} from '@angular/core';\r\n\r\n@Component({\r\n selector: 'app-modal',\r\n template: ``,\r\n})\r\nexport class ModalComponent implements OnDestroy {\r\n @Output() onClose = new EventEmitter();\r\n @Output() onClosed = new EventEmitter();\r\n @Output() onShow = new EventEmitter();\r\n @Output() onShown = new EventEmitter();\r\n @ViewChild('container', { read: ViewContainerRef }) container: ViewContainerRef;\r\n parentContainer: ViewContainerRef = null;\r\n fade: boolean = true;\r\n\r\n constructor(protected componentFactoryResolver: ComponentFactoryResolver) { }\r\n\r\n ngOnDestroy() {\r\n document.body.classList.remove('modal-open');\r\n document.body.removeChild(document.querySelector('.modal-backdrop'));\r\n }\r\n\r\n show(type: Type, parentContainer: ViewContainerRef, fade: boolean = true): T {\r\n this.onShow.emit();\r\n this.parentContainer = parentContainer;\r\n this.fade = fade;\r\n\r\n document.body.classList.add('modal-open');\r\n const backdrop = document.createElement('div');\r\n backdrop.className = 'modal-backdrop' + (this.fade ? ' fade' : '');\r\n document.body.appendChild(backdrop);\r\n\r\n const factory = this.componentFactoryResolver.resolveComponentFactory(type);\r\n const componentRef = this.container.createComponent(factory);\r\n\r\n document.querySelector('.modal-dialog').addEventListener('click', (e: Event) => {\r\n e.stopPropagation();\r\n });\r\n\r\n const modals = Array.from(document.querySelectorAll('.modal, .modal *[data-dismiss=\"modal\"]'));\r\n for (const closeElement of modals) {\r\n closeElement.addEventListener('click', (event) => {\r\n this.close();\r\n });\r\n }\r\n\r\n this.onShown.emit();\r\n return componentRef.instance;\r\n }\r\n\r\n close() {\r\n this.onClose.emit();\r\n this.onClosed.emit();\r\n if (this.parentContainer != null) {\r\n this.parentContainer.clear();\r\n }\r\n }\r\n}\r\n","import {\n EventEmitter,\n Input,\n OnInit,\n Output,\n} from '@angular/core';\nimport { Router } from '@angular/router';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { TwoFactorProviderType } from '../../enums/twoFactorProviderType';\n\nimport { AuthService } from '../../abstractions/auth.service';\nimport { I18nService } from '../../abstractions/i18n.service';\nimport { PlatformUtilsService } from '../../abstractions/platformUtils.service';\n\nimport { TwoFactorProviders } from '../../services/auth.service';\n\nexport class TwoFactorOptionsComponent implements OnInit {\n @Output() onProviderSelected = new EventEmitter();\n @Output() onRecoverSelected = new EventEmitter();\n\n providers: any[] = [];\n\n constructor(protected authService: AuthService, protected router: Router,\n protected analytics: Angulartics2, protected toasterService: ToasterService,\n protected i18nService: I18nService, protected platformUtilsService: PlatformUtilsService,\n protected win: Window) { }\n\n ngOnInit() {\n this.providers = this.authService.getSupportedTwoFactorProviders(this.win);\n }\n\n choose(p: any) {\n this.onProviderSelected.emit(p.type);\n }\n\n recover() {\n this.analytics.eventTrack.next({ action: 'Selected Recover' });\n this.platformUtilsService.launchUri('https://help.bitwarden.com/article/lost-two-step-device/');\n this.onRecoverSelected.emit();\n }\n}\n","
\n
\n
\n

{{title}}

\n
\n
\n \n

{{'enterVerificationCodeApp' | i18n}}

\n

\n {{'enterVerificationCodeEmail' | i18n : twoFactorEmail}}\n

\n
\n \n \n \n \n {{'sendVerificationCodeEmailAgain' | i18n}}\n \n \n
\n
\n \n

{{'insertYubiKey' | i18n}}

\n \"\"\n
\n \n \n
\n
\n \n

\n \n

\n \n

{{'insertU2f' | i18n}}

\n \"\"\n
\n
\n \n
\n \n
\n
\n \n
\n \n \n
\n \n

{{'noTwoStepProviders' | i18n}}

\n

{{'noTwoStepProviders2' | i18n}}

\n
\n
\n
\n \n \n {{'cancel' | i18n}}\n \n
\n \n
\n
\n
\n
\n
\n\n\n","import {\n Input,\n OnInit,\n} from '@angular/core';\nimport { Router } from '@angular/router';\n\nimport { ToasterService } from 'angular2-toaster';\nimport { Angulartics2 } from 'angulartics2';\n\nimport { AuthResult } from '../../models/domain/authResult';\n\nimport { AuthService } from '../../abstractions/auth.service';\nimport { I18nService } from '../../abstractions/i18n.service';\nimport { StorageService } from '../../abstractions/storage.service';\n\nimport { Utils } from '../../misc/utils';\n\nconst Keys = {\n rememberedEmail: 'rememberedEmail',\n rememberEmail: 'rememberEmail',\n};\n\nexport class LoginComponent implements OnInit {\n @Input() email: string = '';\n @Input() rememberEmail = true;\n\n masterPassword: string = '';\n showPassword: boolean = false;\n formPromise: Promise;\n onSuccessfulLogin: () => Promise;\n onSuccessfulLoginNavigate: () => Promise;\n\n protected twoFactorRoute = '2fa';\n protected successRoute = 'vault';\n\n constructor(protected authService: AuthService, protected router: Router,\n protected analytics: Angulartics2, protected toasterService: ToasterService,\n protected i18nService: I18nService, private storageService: StorageService) { }\n\n async ngOnInit() {\n if (this.email == null || this.email === '') {\n this.email = await this.storageService.get(Keys.rememberedEmail);\n if (this.email == null) {\n this.email = '';\n }\n }\n this.rememberEmail = await this.storageService.get(Keys.rememberEmail);\n if (this.rememberEmail == null) {\n this.rememberEmail = true;\n }\n if (Utils.isBrowser) {\n document.getElementById(this.email == null || this.email === '' ? 'email' : 'masterPassword').focus();\n }\n }\n\n async submit() {\n if (this.email == null || this.email === '') {\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'),\n this.i18nService.t('emailRequired'));\n return;\n }\n if (this.email.indexOf('@') === -1) {\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'),\n this.i18nService.t('invalidEmail'));\n return;\n }\n if (this.masterPassword == null || this.masterPassword === '') {\n this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'),\n this.i18nService.t('masterPassRequired'));\n return;\n }\n\n try {\n this.formPromise = this.authService.logIn(this.email, this.masterPassword);\n const response = await this.formPromise;\n await this.storageService.save(Keys.rememberEmail, this.rememberEmail);\n if (this.rememberEmail) {\n await this.storageService.save(Keys.rememberedEmail, this.email);\n } else {\n await this.storageService.remove(Keys.rememberedEmail);\n }\n if (response.twoFactor) {\n this.analytics.eventTrack.next({ action: 'Logged In To Two-step' });\n this.router.navigate([this.twoFactorRoute]);\n } else {\n if (this.onSuccessfulLogin != null) {\n this.onSuccessfulLogin();\n }\n this.analytics.eventTrack.next({ action: 'Logged In' });\n if (this.onSuccessfulLoginNavigate != null) {\n this.onSuccessfulLoginNavigate();\n } else {\n this.router.navigate([this.successRoute]);\n }\n }\n } catch { }\n }\n\n togglePassword() {\n this.analytics.eventTrack.next({ action: 'Toggled Master Password on Login' });\n this.showPassword = !this.showPassword;\n document.getElementById('masterPassword').focus();\n }\n}\n","
\n
\n
\n \n

{{'loginOrCreateNewAccount' | i18n}}

\n
\n
\n
\n \n \n
\n
\n \n
\n \n \n
\n \n {{'getMasterPasswordHint' | i18n}}\n \n
\n
\n \n \n
\n
\n
\n \n \n {{'createAccount' | i18n}}\n \n
\n
\n
\n
\n
\n
\n","\r\n
\r\n © 2018, 8bit Solutions LLC\r\n
{{'versionNumber' | i18n : version}}\r\n
\r\n","import 'core-js';\n\nimport { ToasterModule } from 'angular2-toaster';\nimport { Angulartics2Module } from 'angulartics2';\nimport { Angulartics2GoogleAnalytics } from 'angulartics2/ga';\n\nimport { AppRoutingModule } from './app-routing.module';\n\nimport { NgModule } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { BrowserModule } from '@angular/platform-browser';\nimport { BrowserAnimationsModule } from '@angular/platform-browser/animations';\n\nimport { ServicesModule } from './services/services.module';\n\nimport { AppComponent } from './app.component';\nimport { ModalComponent } from './modal.component';\n\nimport { AvatarComponent } from './components/avatar.component';\nimport { CalloutComponent } from './components/callout.component';\n\nimport { FooterComponent } from './layouts/footer.component';\nimport { FrontendLayoutComponent } from './layouts/frontend-layout.component';\nimport { NavbarComponent } from './layouts/navbar.component';\nimport { OrganizationLayoutComponent } from './layouts/organization-layout.component';\nimport { UserLayoutComponent } from './layouts/user-layout.component';\n\nimport { AcceptOrganizationComponent } from './accounts/accept-organization.component';\nimport { HintComponent } from './accounts/hint.component';\nimport { LockComponent } from './accounts/lock.component';\nimport { LoginComponent } from './accounts/login.component';\nimport { RecoverDeleteComponent } from './accounts/recover-delete.component';\nimport { RecoverTwoFactorComponent } from './accounts/recover-two-factor.component';\nimport { RegisterComponent } from './accounts/register.component';\nimport { TwoFactorOptionsComponent } from './accounts/two-factor-options.component';\nimport { TwoFactorComponent } from './accounts/two-factor.component';\nimport { VerifyEmailTokenComponent } from './accounts/verify-email-token.component';\nimport { VerifyRecoverDeleteComponent } from './accounts/verify-recover-delete.component';\n\nimport {\n CollectionAddEditComponent as OrgCollectionAddEditComponent,\n} from './organizations/manage/collection-add-edit.component';\nimport { CollectionsComponent as OrgManageCollectionsComponent } from './organizations/manage/collections.component';\nimport { EntityEventsComponent as OrgEntityEventsComponent } from './organizations/manage/entity-events.component';\nimport { EntityUsersComponent as OrgEntityUsersComponent } from './organizations/manage/entity-users.component';\nimport { EventsComponent as OrgEventsComponent } from './organizations/manage/events.component';\nimport { GroupAddEditComponent as OrgGroupAddEditComponent } from './organizations/manage/group-add-edit.component';\nimport { GroupsComponent as OrgGroupsComponent } from './organizations/manage/groups.component';\nimport { ManageComponent as OrgManageComponent } from './organizations/manage/manage.component';\nimport { PeopleComponent as OrgPeopleComponent } from './organizations/manage/people.component';\nimport { UserAddEditComponent as OrgUserAddEditComponent } from './organizations/manage/user-add-edit.component';\nimport { UserGroupsComponent as OrgUserGroupsComponent } from './organizations/manage/user-groups.component';\n\nimport { AccountComponent as OrgAccountComponent } from './organizations/settings/account.component';\nimport { AdjustSeatsComponent } from './organizations/settings/adjust-seats.component';\nimport { DeleteOrganizationComponent } from './organizations/settings/delete-organization.component';\nimport { OrganizationBillingComponent } from './organizations/settings/organization-billing.component';\nimport { SettingsComponent as OrgSettingComponent } from './organizations/settings/settings.component';\nimport {\n TwoFactorSetupComponent as OrgTwoFactorSetupComponent,\n} from './organizations/settings/two-factor-setup.component';\n\nimport { ExportComponent as OrgExportComponent } from './organizations/tools/export.component';\nimport { ImportComponent as OrgImportComponent } from './organizations/tools/import.component';\nimport { ToolsComponent as OrgToolsComponent } from './organizations/tools/tools.component';\n\nimport { AddEditComponent as OrgAddEditComponent } from './organizations/vault/add-edit.component';\nimport { AttachmentsComponent as OrgAttachmentsComponent } from './organizations/vault/attachments.component';\nimport { CiphersComponent as OrgCiphersComponent } from './organizations/vault/ciphers.component';\nimport { CollectionsComponent as OrgCollectionsComponent } from './organizations/vault/collections.component';\nimport { GroupingsComponent as OrgGroupingsComponent } from './organizations/vault/groupings.component';\nimport { VaultComponent as OrgVaultComponent } from './organizations/vault/vault.component';\n\nimport { AccountComponent } from './settings/account.component';\nimport { AdjustPaymentComponent } from './settings/adjust-payment.component';\nimport { AdjustStorageComponent } from './settings/adjust-storage.component';\nimport { ChangeEmailComponent } from './settings/change-email.component';\nimport { ChangePasswordComponent } from './settings/change-password.component';\nimport { CreateOrganizationComponent } from './settings/create-organization.component';\nimport { DeauthorizeSessionsComponent } from './settings/deauthorize-sessions.component';\nimport { DeleteAccountComponent } from './settings/delete-account.component';\nimport { DomainRulesComponent } from './settings/domain-rules.component';\nimport { OptionsComponent } from './settings/options.component';\nimport { OrganizationsComponent } from './settings/organizations.component';\nimport { PaymentComponent } from './settings/payment.component';\nimport { PremiumComponent } from './settings/premium.component';\nimport { ProfileComponent } from './settings/profile.component';\nimport { PurgeVaultComponent } from './settings/purge-vault.component';\nimport { SettingsComponent } from './settings/settings.component';\nimport { TwoFactorAuthenticatorComponent } from './settings/two-factor-authenticator.component';\nimport { TwoFactorDuoComponent } from './settings/two-factor-duo.component';\nimport { TwoFactorEmailComponent } from './settings/two-factor-email.component';\nimport { TwoFactorRecoveryComponent } from './settings/two-factor-recovery.component';\nimport { TwoFactorSetupComponent } from './settings/two-factor-setup.component';\nimport { TwoFactorU2fComponent } from './settings/two-factor-u2f.component';\nimport { TwoFactorVerifyComponent } from './settings/two-factor-verify.component';\nimport { TwoFactorYubiKeyComponent } from './settings/two-factor-yubikey.component';\nimport { UpdateKeyComponent } from './settings/update-key.component';\nimport { UpdateLicenseComponent } from './settings/update-license.component';\nimport { UserBillingComponent } from './settings/user-billing.component';\nimport { VerifyEmailComponent } from './settings/verify-email.component';\n\nimport { BreachReportComponent } from './tools/breach-report.component';\nimport { ExportComponent } from './tools/export.component';\nimport { ImportComponent } from './tools/import.component';\nimport { PasswordGeneratorHistoryComponent } from './tools/password-generator-history.component';\nimport { PasswordGeneratorComponent } from './tools/password-generator.component';\nimport { ToolsComponent } from './tools/tools.component';\n\nimport { AddEditComponent } from './vault/add-edit.component';\nimport { AttachmentsComponent } from './vault/attachments.component';\nimport { BulkDeleteComponent } from './vault/bulk-delete.component';\nimport { BulkMoveComponent } from './vault/bulk-move.component';\nimport { BulkShareComponent } from './vault/bulk-share.component';\nimport { CiphersComponent } from './vault/ciphers.component';\nimport { CollectionsComponent } from './vault/collections.component';\nimport { FolderAddEditComponent } from './vault/folder-add-edit.component';\nimport { GroupingsComponent } from './vault/groupings.component';\nimport { ShareComponent } from './vault/share.component';\nimport { VaultComponent } from './vault/vault.component';\n\nimport { IconComponent } from 'jslib/angular/components/icon.component';\n\nimport { ApiActionDirective } from 'jslib/angular/directives/api-action.directive';\nimport { AutofocusDirective } from 'jslib/angular/directives/autofocus.directive';\nimport { BlurClickDirective } from 'jslib/angular/directives/blur-click.directive';\nimport { BoxRowDirective } from 'jslib/angular/directives/box-row.directive';\nimport { FallbackSrcDirective } from 'jslib/angular/directives/fallback-src.directive';\nimport { InputVerbatimDirective } from 'jslib/angular/directives/input-verbatim.directive';\nimport { StopClickDirective } from 'jslib/angular/directives/stop-click.directive';\nimport { StopPropDirective } from 'jslib/angular/directives/stop-prop.directive';\nimport { TrueFalseValueDirective } from 'jslib/angular/directives/true-false-value.directive';\n\nimport { I18nPipe } from 'jslib/angular/pipes/i18n.pipe';\nimport { SearchCiphersPipe } from 'jslib/angular/pipes/search-ciphers.pipe';\nimport { SearchPipe } from 'jslib/angular/pipes/search.pipe';\n\nimport { registerLocaleData } from '@angular/common';\nimport localeDa from '@angular/common/locales/da';\nimport localeSk from '@angular/common/locales/sk';\n\nregisterLocaleData(localeDa, 'da');\nregisterLocaleData(localeSk, 'sk');\n\n@NgModule({\n imports: [\n BrowserModule,\n BrowserAnimationsModule,\n FormsModule,\n AppRoutingModule,\n ServicesModule,\n Angulartics2Module.forRoot([Angulartics2GoogleAnalytics], {\n pageTracking: {\n clearQueryParams: true,\n },\n }),\n ToasterModule,\n ],\n declarations: [\n AcceptOrganizationComponent,\n AccountComponent,\n AddEditComponent,\n AdjustPaymentComponent,\n AdjustSeatsComponent,\n AdjustStorageComponent,\n ApiActionDirective,\n AppComponent,\n AttachmentsComponent,\n AutofocusDirective,\n AvatarComponent,\n BlurClickDirective,\n BoxRowDirective,\n BreachReportComponent,\n BulkDeleteComponent,\n BulkMoveComponent,\n BulkShareComponent,\n CalloutComponent,\n ChangeEmailComponent,\n ChangePasswordComponent,\n CiphersComponent,\n CollectionsComponent,\n CreateOrganizationComponent,\n DeauthorizeSessionsComponent,\n DeleteAccountComponent,\n DeleteOrganizationComponent,\n DomainRulesComponent,\n ExportComponent,\n FallbackSrcDirective,\n FolderAddEditComponent,\n FooterComponent,\n FrontendLayoutComponent,\n GroupingsComponent,\n HintComponent,\n IconComponent,\n I18nPipe,\n ImportComponent,\n InputVerbatimDirective,\n LockComponent,\n LoginComponent,\n ModalComponent,\n NavbarComponent,\n OptionsComponent,\n OrgAccountComponent,\n OrgAddEditComponent,\n OrganizationBillingComponent,\n OrgAttachmentsComponent,\n OrgCiphersComponent,\n OrgCollectionAddEditComponent,\n OrgCollectionsComponent,\n OrgEntityEventsComponent,\n OrgEntityUsersComponent,\n OrgEventsComponent,\n OrgExportComponent,\n OrgImportComponent,\n OrgGroupAddEditComponent,\n OrgGroupingsComponent,\n OrgGroupsComponent,\n OrgManageCollectionsComponent,\n OrgManageComponent,\n OrgPeopleComponent,\n OrgSettingComponent,\n OrgToolsComponent,\n OrgTwoFactorSetupComponent,\n OrgUserAddEditComponent,\n OrgUserGroupsComponent,\n OrganizationsComponent,\n OrganizationLayoutComponent,\n OrgVaultComponent,\n PasswordGeneratorComponent,\n PasswordGeneratorHistoryComponent,\n PaymentComponent,\n PremiumComponent,\n ProfileComponent,\n PurgeVaultComponent,\n RecoverDeleteComponent,\n RecoverTwoFactorComponent,\n RegisterComponent,\n SearchCiphersPipe,\n SearchPipe,\n SettingsComponent,\n ShareComponent,\n StopClickDirective,\n StopPropDirective,\n ToolsComponent,\n TrueFalseValueDirective,\n TwoFactorAuthenticatorComponent,\n TwoFactorComponent,\n TwoFactorDuoComponent,\n TwoFactorEmailComponent,\n TwoFactorOptionsComponent,\n TwoFactorRecoveryComponent,\n TwoFactorSetupComponent,\n TwoFactorU2fComponent,\n TwoFactorVerifyComponent,\n TwoFactorYubiKeyComponent,\n UpdateKeyComponent,\n UpdateLicenseComponent,\n UserBillingComponent,\n UserLayoutComponent,\n VaultComponent,\n VerifyEmailComponent,\n VerifyEmailTokenComponent,\n VerifyRecoverDeleteComponent,\n ],\n entryComponents: [\n AddEditComponent,\n AttachmentsComponent,\n BulkDeleteComponent,\n BulkMoveComponent,\n BulkShareComponent,\n CollectionsComponent,\n DeauthorizeSessionsComponent,\n DeleteAccountComponent,\n DeleteOrganizationComponent,\n FolderAddEditComponent,\n ModalComponent,\n OrgAddEditComponent,\n OrgAttachmentsComponent,\n OrgCollectionAddEditComponent,\n OrgCollectionsComponent,\n OrgEntityEventsComponent,\n OrgEntityUsersComponent,\n OrgGroupAddEditComponent,\n OrgUserAddEditComponent,\n OrgUserGroupsComponent,\n PasswordGeneratorHistoryComponent,\n PurgeVaultComponent,\n ShareComponent,\n TwoFactorAuthenticatorComponent,\n TwoFactorDuoComponent,\n TwoFactorEmailComponent,\n TwoFactorOptionsComponent,\n TwoFactorRecoveryComponent,\n TwoFactorU2fComponent,\n TwoFactorYubiKeyComponent,\n UpdateKeyComponent,\n ],\n providers: [],\n bootstrap: [AppComponent],\n})\nexport class AppModule { }\n","import { enableProdMode } from '@angular/core';\nimport { platformBrowserDynamic } from '@angular/platform-browser-dynamic';\n\nimport 'bootstrap';\nimport 'jquery';\nimport 'popper.js';\n\n// tslint:disable-next-line\nrequire('../scss/styles.scss');\n\nimport { AppModule } from './app.module';\n\nif (process.env.ENV === 'production') {\n enableProdMode();\n}\n\nplatformBrowserDynamic().bootstrapModule(AppModule);\n"],"sourceRoot":""} \ No newline at end of file diff --git a/index.html b/index.html index 249c186b..145cb5cc 100644 --- a/index.html +++ b/index.html @@ -12,7 +12,7 @@ - + @@ -25,6 +25,6 @@ - +