!function(e){function t(t){for(var r,a,s=t[0],l=t[1],c=t[2],u=0,d=[];u0),i.ɵɵadvance(2),i.ɵɵproperty("ngIf",(null==n.enforcedPolicyOptions?null:n.enforcedPolicyOptions.minLength)>0),i.ɵɵadvance(2),i.ɵɵproperty("ngIf",null==n.enforcedPolicyOptions?null:n.enforcedPolicyOptions.requireUpper),i.ɵɵadvance(2),i.ɵɵproperty("ngIf",null==n.enforcedPolicyOptions?null:n.enforcedPolicyOptions.requireLower),i.ɵɵadvance(2),i.ɵɵproperty("ngIf",null==n.enforcedPolicyOptions?null:n.enforcedPolicyOptions.requireNumbers),i.ɵɵadvance(2),i.ɵɵproperty("ngIf",null==n.enforcedPolicyOptions?null:n.enforcedPolicyOptions.requireSpecial)}}var y=function(e){return{clickable:e}},g=["*"],x=function(){function e(e){this.i18nService=e,this.type="info",this.useAlertRole=!1}return e.prototype.ngOnInit=function(){this.calloutStyle=this.type,void 0===this.enforcedPolicyMessage&&(this.enforcedPolicyMessage=this.i18nService.t("masterPasswordPolicyInEffect")),"warning"===this.type||"danger"===this.type?("danger"===this.type&&(this.calloutStyle="danger"),void 0===this.title&&(this.title=this.i18nService.t("warning")),void 0===this.icon&&(this.icon="fa-warning")):"error"===this.type?(this.calloutStyle="danger",void 0===this.title&&(this.title=this.i18nService.t("error")),void 0===this.icon&&(this.icon="fa-bolt")):"tip"===this.type&&(this.calloutStyle="success",void 0===this.title&&(this.title=this.i18nService.t("tip")),void 0===this.icon&&(this.icon="fa-lightbulb-o"))},e.prototype.getPasswordScoreAlertDisplay=function(){if(null==this.enforcedPolicyOptions)return"";var e;switch(this.enforcedPolicyOptions.minComplexity){case 4:e=this.i18nService.t("strong");break;case 3:e=this.i18nService.t("good");break;default:e=this.i18nService.t("weak")}return e+" ("+this.enforcedPolicyOptions.minComplexity+")"},e.ɵfac=function(t){return new(t||e)(i.ɵɵdirectiveInject(o.I18nService))},e.ɵcmp=i.ɵɵdefineComponent({type:e,selectors:[["app-callout"]],inputs:{type:"type",icon:"icon",title:"title",clickable:"clickable",enforcedPolicyOptions:"enforcedPolicyOptions",enforcedPolicyMessage:"enforcedPolicyMessage",useAlertRole:"useAlertRole"},ngContentSelectors:g,decls:10,vars:9,consts:[[3,"ngClass"],["callout",""],["class","callout-heading",4,"ngIf"],["class","enforced-policy-options",4,"ngIf"],[1,"callout-heading"],["aria-hidden","true",3,"class",4,"ngIf"],["aria-hidden","true"],[1,"enforced-policy-options"],[4,"ngIf"]],template:function(e,t){1&e&&(i.ɵɵprojectionDef(),i.ɵɵelementStart(0,"div",0,1),i.ɵɵtext(2," "),i.ɵɵtemplate(3,c,4,2,"h3",2),i.ɵɵtext(4," "),i.ɵɵtemplate(5,v,17,7,"div",3),i.ɵɵtext(6," "),i.ɵɵprojection(7),i.ɵɵtext(8," "),i.ɵɵelementEnd(),i.ɵɵtext(9," ")),2&e&&(i.ɵɵclassMapInterpolate1("callout callout-",t.calloutStyle,""),i.ɵɵproperty("ngClass",i.ɵɵpureFunction1(7,y,t.clickable)),i.ɵɵattribute("role",t.useAlertRole?"alert":null),i.ɵɵadvance(3),i.ɵɵproperty("ngIf",t.title),i.ɵɵadvance(2),i.ɵɵproperty("ngIf",t.enforcedPolicyOptions))},directives:[a.NgClass,a.NgIf],pipes:[s.I18nPipe],encapsulation:2}),e}();t.CalloutComponent=x,("undefined"==typeof ngDevMode||ngDevMode)&&i.ɵsetClassMetadata(x,[{type:r.Component,args:[{selector:"app-callout",templateUrl:"callout.component.html"}]}],(function(){return[{type:o.I18nService}]}),{type:[{type:r.Input}],icon:[{type:r.Input}],title:[{type:r.Input}],clickable:[{type:r.Input}],enforcedPolicyOptions:[{type:r.Input}],enforcedPolicyMessage:[{type:r.Input}],useAlertRole:[{type:r.Input}]})},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&r.topModal.instance.close()}))}return Object.defineProperty(e.prototype,"modalCount",{get:function(){return this.modalList.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"topModal",{get:function(){return this.modalList[this.modalCount-1]},enumerable:!1,configurable:!0}),e.prototype.openViewRef=function(e,t,n){return void 0===n&&(n=null),r(this,void 0,void 0,(function(){var r,o,s;return i(this,(function(i){switch(i.label){case 0:return r=this.openInternal(e,null,!1),o=r[0],(s=r[1]).instance.setComponentParameters=n,t.insert(s.hostView),[4,o.onCreated.pipe(a.first()).toPromise()];case 1:return i.sent(),[2,[o,s.instance.componentRef.instance]]}}))}))},e.prototype.open=function(e,t){var n;if(null!==(n=null==t?void 0:t.allowMultipleModals)&&void 0!==n&&n||!(this.modalCount>0)){var r=this.openInternal(e,t,!0),i=r[0];r[1];return i}},e.prototype.registerComponentFactoryResolver=function(e,t){this.factoryResolvers.set(e,t)},e.prototype.resolveComponentFactory=function(e){return this.factoryResolvers.has(e)?this.factoryResolvers.get(e).resolveComponentFactory(e):this.componentFactoryResolver.resolveComponentFactory(e)},e.prototype.openInternal=function(e,t,n){var r=this,i=this.createModalComponent(t),o=i[0],s=i[1];if(s.instance.childComponentType=e,n){this.applicationRef.attachView(s.hostView);var l=s.hostView.rootNodes[0];document.body.appendChild(l)}return o.onClosed.pipe(a.first()).subscribe((function(){n&&r.applicationRef.detachView(s.hostView),s.destroy(),r.modalList.pop(),r.modalCount>0&&r.topModal.instance.getFocus()})),this.setupHandlers(o),this.modalList.push(s),[o,s]},e.prototype.setupHandlers=function(e){var t=this,n=null;e.onCreated.pipe(a.first()).subscribe((function(r){document.body.classList.add("modal-open");var i=r.querySelector(".modal"),o=i.querySelector(".modal-dialog");(n=document.createElement("div")).className="modal-backdrop fade",n.style.zIndex=t.modalCount+"040",i.prepend(n),o.addEventListener("click",(function(e){e.stopPropagation()})),o.style.zIndex=t.modalCount+"050";for(var a=0,s=Array.from(r.querySelectorAll('.modal-backdrop, .modal *[data-dismiss="modal"]'));a1&&(r+=e.slice(1)),void 0===t[e=r]&&(e=e.toLowerCase()),void 0===t[e]&&(e=e.toUpperCase())}return t[e]},e}();t.BaseResponse=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PolicyService=void 0;var r=function(){};t.PolicyService=r},function(e,t,n){"use strict";(function(e,r,i){Object.defineProperty(t,"__esModule",{value:!0}),t.Utils=void 0;var o=n(1002),a="undefined"==typeof window?n(1003):null,s=function(){function t(){}return t.init=function(){t.inited||(t.inited=!0,t.isNode=void 0!==e&&null!=e.release&&"node"===e.release.name,t.isBrowser="undefined"!=typeof window,t.isNativeScript=!t.isNode&&!t.isBrowser,t.isMobileBrowser=t.isBrowser&&this.isMobile(window),t.isAppleMobileBrowser=t.isBrowser&&this.isAppleMobile(window),t.global=t.isNativeScript||t.isNode&&!t.isBrowser?r:window)},t.fromB64ToArray=function(e){if(t.isNode||t.isNativeScript)return new Uint8Array(i.from(e,"base64"));for(var n=window.atob(e),r=new Uint8Array(n.length),o=0;o-1&&(n=t.getUrlObject("http://"+e)));return n},t.camelToPascalCase=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},t.validIpAddress=function(e){return/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(e)},t.isMobile=function(e){var t,n=!1;return t=e.navigator.userAgent||e.navigator.vendor||e.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(t)||/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(t.substr(0,4)))&&(n=!0),n||null!=e.navigator.userAgent.match(/iPad/i)},t.isAppleMobile=function(e){return null!=e.navigator.userAgent.match(/iPhone/i)||null!=e.navigator.userAgent.match(/iPad/i)},t.getUrlObject=function(e){try{if(null!=a)return a.URL?new a.URL(e):a.parse(e);if("function"==typeof URL)return new URL(e);if(null!=window){var t=e.indexOf("://")>-1;if(!t&&e.indexOf(".")>-1)e="http://"+e;else if(!t)return null;var n=window.document.createElement("a");return n.href=e,n}}catch(r){}return null},t.inited=!1,t.isNativeScript=!1,t.isNode=!1,t.isBrowser=!0,t.isMobileBrowser=!1,t.isAppleMobileBrowser=!1,t.global=null,t.tldEndingRegex=/.*\.(com|net|org|edu|uk|gov|ca|de|jp|fr|au|ru|ch|io|es|us|co|xyz|info|ly|mil)$/,t.regexpEmojiPresentation=/(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])/g,t}();t.Utils=s,s.init()}).call(this,n(134),n(97),n(111).Buffer)},,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BaseImporter=void 0;var r=n(705),i=n(144),o=n(185),a=n(316),s=n(28),l=n(266),c=n(146),p=n(165),u=n(108),d=n(43),m=n(137),f=n(109),h=n(703),v=function(){function e(){this.organizationId=null,this.logService=new h.ConsoleLogService(!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"],this.parseCsvOptions={encoding:"UTF-8",skipEmptyLines:!1}}return Object.defineProperty(e.prototype,"organization",{get:function(){return null!=this.organizationId},enumerable:!1,configurable:!0}),e.prototype.parseXml=function(e){var t=(new DOMParser).parseFromString(e,"application/xml");return null!=t&&null==t.querySelector("parsererror")?t:null},e.prototype.parseCsv=function(e,t,n){var i=this;void 0===n&&(n={});var o=Object.assign({header:t},this.parseCsvOptions,n);e=this.splitNewLine(e).join("\n").trim();var a=r.parse(e,o);return null!=a.errors&&a.errors.length>0&&a.errors.forEach((function(e){null!=e.row&&i.logService.warning("Error parsing row "+e.row+": "+e.message)})),a.data&&a.data.length>0?a.data:null},e.prototype.parseSingleRowCsv=function(e){if(this.isNullOrWhitespace(e))return null;var t=this.parseCsv(e,!1);return null!=t&&t.length>0&&t[0].length>0?t[0]:null},e.prototype.makeUriArray=function(e){var t=this;if(null==e)return null;if("string"==typeof e){var n=new a.LoginUriView;return n.uri=this.fixUri(e),this.isNullOrWhitespace(n.uri)?null:(n.match=null,[n])}if(e.length>0){var r=[];return e.forEach((function(e){var n=new a.LoginUriView;n.uri=t.fixUri(e),t.isNullOrWhitespace(n.uri)||(n.match=null,r.push(n))})),0===r.length?null:r}return null},e.prototype.fixUri=function(e){return null==e?null:(-1===(e=e.trim()).indexOf("://")&&e.indexOf(".")>=0&&(e="http://"+e),e.length>1e3?e.substring(0,1e3):e)},e.prototype.nameFromUrl=function(e){var t=s.Utils.getHostname(e);return this.isNullOrWhitespace(t)?null:t.startsWith("www.")?t.replace("www.",""):t},e.prototype.isNullOrWhitespace=function(e){return s.Utils.isNullOrWhitespace(e)},e.prototype.getValueOrDefault=function(e,t){return void 0===t&&(t=null),this.isNullOrWhitespace(e)?t:e},e.prototype.splitNewLine=function(e){return e.split(this.newLineRegex)},e.prototype.getCardBrand=function(e){if(this.isNullOrWhitespace(e))return null;var t=new RegExp("^4");return null!=e.match(t)?"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(e)?"Mastercard":(t=new RegExp("^3[47]"),null!=e.match(t)?"Amex":(t=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!=e.match(t)?"Discover":(t=new RegExp("^36"),null!=e.match(t)?"Diners Club":(t=new RegExp("^30[0-5]"),null!=e.match(t)?"Diners Club":(t=new RegExp("^35(2[89]|[3-8][0-9])"),null!=e.match(t)?"JCB":(t=new RegExp("^(4026|417500|4508|4844|491(3|7))"),null!=e.match(t)?"Visa":null))))))},e.prototype.setCardExpiration=function(e,t){if(!this.isNullOrWhitespace(t)){var n=(t=t.replace(/\s/g,"")).split("/");if(2===n.length){var r=null,i=null;if(1!==n[0].length&&2!==n[0].length||2===(r=n[0]).length&&"0"===r[0]&&(r=r.substr(1,1)),2!==n[1].length&&4!==n[1].length||(i=2===r.length?"20"+n[1]:n[1]),null!=r&&null!=i)return e.card.expMonth=r,e.card.expYear=i,!0}}return!1},e.prototype.moveFoldersToCollections=function(e){e.folderRelationships.forEach((function(t){return e.collectionRelationships.push(t)})),e.collections=e.folders.map((function(e){var t=new o.CollectionView;return t.name=e.name,t})),e.folderRelationships=[],e.folders=[]},e.prototype.querySelectorDirectChild=function(e,t){var n=this.querySelectorAllDirectChild(e,t);return 0===n.length?null:n[0]},e.prototype.querySelectorAllDirectChild=function(e,t){return Array.from(e.querySelectorAll(t)).filter((function(t){return t.parentNode===e}))},e.prototype.initLoginCipher=function(){var e=new i.CipherView;return e.favorite=!1,e.notes="",e.fields=[],e.login=new p.LoginView,e.type=d.CipherType.Login,e},e.prototype.cleanupCipher=function(e){null!=e&&(e.type!==d.CipherType.Login&&(e.login=null),this.isNullOrWhitespace(e.name)&&(e.name="--"),this.isNullOrWhitespace(e.notes)?e.notes=null:e.notes=e.notes.trim(),null!=e.fields&&0===e.fields.length&&(e.fields=null))},e.prototype.processKvp=function(e,t,n,r){if(void 0===r&&(r=m.FieldType.Text),!this.isNullOrWhitespace(n))if(this.isNullOrWhitespace(t)&&(t=""),n.length>200||n.trim().search(this.newLineRegex)>-1)null==e.notes&&(e.notes=""),e.notes+=t+": "+this.splitNewLine(n).join("\n")+"\n";else{null==e.fields&&(e.fields=[]);var i=new l.FieldView;i.type=r,i.name=t,i.value=n,e.fields.push(i)}},e.prototype.processFolder=function(e,t){var n=e.folders.length,r=!this.isNullOrWhitespace(t),i=r;if(r)for(var o=0;o0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]1&&(n=this.getFirstLetters(r,this.charCount)),null==n&&(n=this.unicodeSafeSubstring(r,this.charCount)),n.match(a.Utils.regexpEmojiPresentation)&&(n=n.match(a.Utils.regexpEmojiPresentation)[0]),o=this.getCharText(n),s=this.stringToColor(r),(l=this.getSvg(this.size,s)).appendChild(o),c=window.document.createElement("div").appendChild(l).outerHTML,p=window.btoa(unescape(encodeURIComponent(c))),this.src="data:image/svg+xml;base64,"+p,i.label=4;case 4:return[2]}}))}))},e.prototype.stringToColor=function(e){for(var t=0,n=0;n>8*n&255).toString(16)).substr(-2)}return r},e.prototype.getFirstLetters=function(e,t){var n=e.split(" ");if(n.length>1){for(var r="",i=0;i'}]}],(function(){return[{type:l.DomSanitizer},{type:c.CryptoFunctionService},{type:p.StateService}]}),{data:[{type:o.Input}],email:[{type:o.Input}],size:[{type:o.Input}],charCount:[{type:o.Input}],textColor:[{type:o.Input}],fontSize:[{type:o.Input}],fontWeight:[{type:o.Input}],dynamic:[{type:o.Input}],circle:[{type:o.Input}]})},,,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KeyConnectorService=void 0;var r=function(){};t.KeyConnectorService=r},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]-1?e[a]=s||null:e[a]=s?new o.EncString(s):null}},e.prototype.buildDataModel=function(e,t,n,r){for(var i in void 0===r&&(r=[]),n)if(n.hasOwnProperty(i)){var o=e[n[i]||i];r.indexOf(i)>-1?t[i]=null!=o?o:null:t[i]=null!=o?o.encryptedString:null}},e.prototype.decryptObj=function(e,t,n,o){return void 0===o&&(o=null),r(this,void 0,void 0,(function(){var r,a,s;return i(this,(function(i){switch(i.label){case 0:for(s in r=[],a=this,t)t.hasOwnProperty(s)&&function(i){var s=Promise.resolve().then((function(){var e=t[i]||i;return a[e]?a[e].decrypt(n,o):null})).then((function(t){e[i]=t}));r.push(s)}(s);return[4,Promise.all(r)];case 1:return i.sent(),[2,e]}}))}))},e}();t.default=a},,,,,,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ValidationService=void 0;var r=n(0),i=(n(1),n(4),n(0)),o=n(1),a=n(4),s=function(){function e(e,t){this.i18nService=e,this.platformUtilsService=t}return e.prototype.showError=function(e){var t=this.i18nService.t("unexpectedError"),n=[];return null!=e&&"string"==typeof e?n.push(e):null==e||"object"!=typeof e?n.push(t):null!=e.validationErrors?n=n.concat(e.getAllMessages()):n.push(e.message?e.message:t),1===n.length?this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),n[0]):n.length>1&&this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),n,{timeout:5e3*n.length}),n},e.ɵfac=function(t){return new(t||e)(i.ɵɵinject(o.I18nService),i.ɵɵinject(a.PlatformUtilsService))},e.ɵprov=i.ɵɵdefineInjectable({token:e,factory:e.ɵfac}),e}();t.ValidationService=s,("undefined"==typeof ngDevMode||ngDevMode)&&i.ɵsetClassMetadata(s,[{type:r.Injectable}],(function(){return[{type:o.I18nService},{type:a.PlatformUtilsService}]}),null)},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),o=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.CardView=void 0;var s=n(315),l=n(408),c=n(409),p=function(e){function t(t){var n=e.call(this)||this;return n.cardholderName=null,n.expMonth=null,n.expYear=null,n.code=null,n._brand=null,n._number=null,n._subTitle=null,n}return i(t,e),Object.defineProperty(t.prototype,"maskedCode",{get:function(){return null!=this.code?"•".repeat(this.code.length):null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maskedNumber",{get:function(){return null!=this.number?"•".repeat(this.number.length):null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"brand",{get:function(){return this._brand},set:function(e){this._brand=e,this._subTitle=null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"number",{get:function(){return this._number},set:function(e){this._number=e,this._subTitle=null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"subTitle",{get:function(){if(null==this._subTitle&&(this._subTitle=this.brand,null!=this.number&&this.number.length>=4)){null!=this._subTitle&&""!==this._subTitle?this._subTitle+=", ":this._subTitle="";var e=this.number.length>=5&&null!=this.number.match(new RegExp("^3[47]"))?5:4;this._subTitle+="*"+this.number.substr(this.number.length-e)}return this._subTitle},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"expiration",{get:function(){if(!this.expMonth&&!this.expYear)return null;var e=null!=this.expMonth?("0"+this.expMonth).slice(-2):"__";return e+=" / "+(null!=this.expYear?this.formatYear(this.expYear):"____")},enumerable:!1,configurable:!0}),t.prototype.formatYear=function(e){return 2===e.length?"20"+e:e},o([c.linkedFieldOption(l.CardLinkedId.CardholderName),a("design:type",String)],t.prototype,"cardholderName",void 0),o([c.linkedFieldOption(l.CardLinkedId.ExpMonth,"expirationMonth"),a("design:type",String)],t.prototype,"expMonth",void 0),o([c.linkedFieldOption(l.CardLinkedId.ExpYear,"expirationYear"),a("design:type",String)],t.prototype,"expYear",void 0),o([c.linkedFieldOption(l.CardLinkedId.Code,"securityCode"),a("design:type",String)],t.prototype,"code",void 0),o([c.linkedFieldOption(l.CardLinkedId.Brand),a("design:type",String),a("design:paramtypes",[String])],t.prototype,"brand",null),o([c.linkedFieldOption(l.CardLinkedId.Number),a("design:type",String),a("design:paramtypes",[String])],t.prototype,"number",null),t}(s.ItemView);t.CardView=p},,,,,,,,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CryptoFunctionService=void 0;var r=function(){};t.CryptoFunctionService=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VaultTimeoutService=void 0;var r=function(){};t.VaultTimeoutService=r},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]-1?(e="http://"+e,t=!0):this.imageEnabled&&(t=0===e.indexOf("http")&&e.indexOf(".")>-1),this.imageEnabled&&t)try{this.image=this.iconsUrl+"/"+l.Utils.getHostname(e)+"/icon.png",this.fallbackImage="images/fa-globe.png"}catch(n){}}else this.image=null},e.ɵfac=function(t){return new(t||e)(c.ɵɵdirectiveInject(p.EnvironmentService),c.ɵɵdirectiveInject(u.StateService))},e.ɵcmp=c.ɵɵdefineComponent({type:e,selectors:[["app-vault-icon"]],inputs:{cipher:"cipher"},features:[c.ɵɵNgOnChangesFeature],decls:7,vars:2,consts:[["aria-hidden","true",1,"icon"],["alt","",3,"src","appFallbackSrc",4,"ngIf"],[3,"class",4,"ngIf"],["alt","",3,"src","appFallbackSrc"]],template:function(e,t){1&e&&(c.ɵɵelementStart(0,"div",0),c.ɵɵtext(1," "),c.ɵɵtemplate(2,f,1,2,"img",1),c.ɵɵtext(3," "),c.ɵɵtemplate(4,h,1,3,"i",2),c.ɵɵtext(5," "),c.ɵɵelementEnd(),c.ɵɵtext(6," ")),2&e&&(c.ɵɵadvance(2),c.ɵɵproperty("ngIf",t.imageEnabled&&t.image),c.ɵɵadvance(2),c.ɵɵproperty("ngIf",!t.imageEnabled||!t.image))},directives:[d.NgIf,m.FallbackSrcDirective],encapsulation:2}),e}();t.IconComponent=y,("undefined"==typeof ngDevMode||ngDevMode)&&c.ɵsetClassMetadata(y,[{type:o.Component,args:[{selector:"app-vault-icon",templateUrl:"icon.component.html"}]}],(function(){return[{type:p.EnvironmentService},{type:u.StateService}]}),{cipher:[{type:o.Input}]})},,,,,,,,,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TokenService=void 0;var r=function(){};t.TokenService=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExportService=void 0;var r=function(){};t.ExportService=r},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.BroadcasterService=void 0;var o=n(0),a=n(1023),s=n(0),l=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.ɵfac=function(e){return c(e||t)},t.ɵprov=s.ɵɵdefineInjectable({token:t,factory:t.ɵfac}),t}(a.BroadcasterService);t.BroadcasterService=l;var c=s.ɵɵgetInheritedFactory(l);("undefined"==typeof ngDevMode||ngDevMode)&&s.ɵsetClassMetadata(l,[{type:o.Injectable}],null,null)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TwoFactorProviderType=void 0,function(e){e[e.Authenticator=0]="Authenticator",e[e.Email=1]="Email",e[e.Duo=2]="Duo",e[e.Yubikey=3]="Yubikey",e[e.U2f=4]="U2f",e[e.Remember=5]="Remember",e[e.OrganizationDuo=6]="OrganizationDuo",e[e.WebAuthn=7]="WebAuthn"}(t.TwoFactorProviderType||(t.TwoFactorProviderType={}))},,,,,,,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BasePolicyComponent=t.BasePolicy=void 0;var r=n(0),i=n(12),o=n(1057),a=(n(314),n(0)),s=function(){function e(){}return e.prototype.display=function(e){return!0},e}();t.BasePolicy=s;var l=function(){function e(){this.enabled=new i.FormControl(!1),this.data=null}return e.prototype.ngOnInit=function(){this.enabled.setValue(this.policyResponse.enabled),null!=this.policyResponse.data&&this.loadData()},e.prototype.loadData=function(){var e;this.data.patchValue(null!==(e=this.policyResponse.data)&&void 0!==e?e:{})},e.prototype.buildRequestData=function(){return null!=this.data?this.data.value:null},e.prototype.buildRequest=function(e){var t=new o.PolicyRequest;return t.enabled=this.enabled.value,t.type=this.policy.type,t.data=this.buildRequestData(),Promise.resolve(t)},e.ɵfac=function(t){return new(t||e)},e.ɵdir=a.ɵɵdefineDirective({type:e,inputs:{policyResponse:"policyResponse",policy:"policy"}}),e}();t.BasePolicyComponent=l,("undefined"==typeof ngDevMode||ngDevMode)&&a.ɵsetClassMetadata(l,[{type:r.Directive}],null,{policyResponse:[{type:r.Input}],policy:[{type:r.Input}]})},,,,,,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SearchPipe=void 0;var r=n(0),i=n(0),o=function(){function e(){}return e.prototype.transform=function(e,t,n,r,i){return null==e||0===e.length?[]:null==t||t.length<2?e:(t=t.trim().toLowerCase(),e.filter((function(e){return null!=n&&null!=e[n]&&e[n].toString().toLowerCase().indexOf(t)>-1||(null!=r&&null!=e[r]&&e[r].toString().toLowerCase().indexOf(t)>-1||null!=i&&null!=e[i]&&e[i].toString().toLowerCase().indexOf(t)>-1)})))},e.ɵfac=function(t){return new(t||e)},e.ɵpipe=i.ɵɵdefinePipe({name:"search",type:e,pure:!0}),e}();t.SearchPipe=o,("undefined"==typeof ngDevMode||ngDevMode)&&i.ɵsetClassMetadata(o,[{type:r.Pipe,args:[{name:"search"}]}],null,null)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TotpService=void 0;var r=function(){};t.TotpService=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FieldType=void 0,function(e){e[e.Text=0]="Text",e[e.Hidden=1]="Hidden",e[e.Boolean=2]="Boolean",e[e.Linked=3]="Linked"}(t.FieldType||(t.FieldType={}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SendService=void 0;var r=function(){};t.SendService=r},,,,,function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]-1)try{window.document.body.removeChild(t)}catch(n){e.logService.error(n)}}))}),500),this.hidePaypal||(window.document.head.removeChild(this.btScript),window.setTimeout((function(){Array.from(window.document.head.querySelectorAll("script")).forEach((function(t){if(null!=t.src&&t.src.indexOf("paypal")>-1)try{window.document.head.removeChild(t)}catch(n){e.logService.error(n)}}));var t=window.document.head.querySelector("#braintree-dropin-stylesheet");if(null!=t)try{window.document.head.removeChild(t)}catch(n){e.logService.error(n)}}),500))},e.prototype.changeMethod=function(){var e=this;this.btInstance=null,this.method===a.PaymentMethodType.PayPal?window.setTimeout((function(){window.braintree.dropin.create({authorization:"production_qfbsv8kc_njj2zjtyngtjmbjd",container:"#bt-dropin-container",paymentOptionPriority:["paypal"],paypal:{flow:"vault",buttonStyle:{label:"pay",size:"medium",shape:"pill",color:"blue",tagline:"false"}}},(function(t,n){null==t?e.btInstance=n:console.error(t)}))}),250):this.setStripeElement()},e.prototype.createPaymentToken=function(){var e=this;return new Promise((function(t,n){e.method===a.PaymentMethodType.Credit?t([null,e.method]):e.method===a.PaymentMethodType.PayPal?e.btInstance.requestPaymentMethod().then((function(n){t([n.nonce,e.method])})).catch((function(e){n(e.message)})):e.method!==a.PaymentMethodType.Card&&e.method!==a.PaymentMethodType.BankAccount||(e.method===a.PaymentMethodType.Card?e.apiService.postSetupPayment().then((function(t){return e.stripe.handleCardSetup(t,e.stripeCardNumberElement)})).then((function(r){r.error?n(r.error.message):r.setupIntent&&"succeeded"===r.setupIntent.status?t([r.setupIntent.payment_method,e.method]):n()})):e.stripe.createToken("bank_account",e.bank).then((function(r){r.error?n(r.error.message):r.token&&null!=r.token.id?t([r.token.id,e.method]):n()})))}))},e.prototype.handleStripeCardPayment=function(e,t){var n=this;return new Promise((function(o,a){if(!n.showMethods||null!=n.stripeCardNumberElement){return(n.showMethods?n.stripe.handleCardSetup(e,n.stripeCardNumberElement):n.stripe.handleCardSetup(e)).then((function(e){return r(n,void 0,void 0,(function(){return i(this,(function(n){switch(n.label){case 0:return e.error?(a(e.error.message),[3,5]):[3,1];case 1:return e.paymentIntent&&"succeeded"===e.paymentIntent.status?null==t?[3,3]:[4,t()]:[3,4];case 2:n.sent(),n.label=3;case 3:return o(),[3,5];case 4:a(),n.label=5;case 5:return[2]}}))}))}))}a()}))},e.prototype.setStripeElement=function(){var e=this;window.setTimeout((function(){e.showMethods&&e.method===a.PaymentMethodType.Card&&(null==e.stripeCardNumberElement&&(e.stripeCardNumberElement=e.stripeElements.create("cardNumber",{style:e.StripeElementStyle,classes:e.StripeElementClasses,placeholder:""})),null==e.stripeCardExpiryElement&&(e.stripeCardExpiryElement=e.stripeElements.create("cardExpiry",{style:e.StripeElementStyle,classes:e.StripeElementClasses})),null==e.stripeCardCvcElement&&(e.stripeCardCvcElement=e.stripeElements.create("cardCvc",{style:e.StripeElementStyle,classes:e.StripeElementClasses,placeholder:""})),e.stripeCardNumberElement.mount("#stripe-card-number-element"),e.stripeCardExpiryElement.mount("#stripe-card-expiry-element"),e.stripeCardCvcElement.mount("#stripe-card-cvc-element"))}),50)},e.prototype.setTheme=function(){return r(this,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,this.platformUtilsService.getEffectiveTheme()];case 1:return e.sent()===s.ThemeType.Dark?(this.StripeElementStyle.base.color=_,this.StripeElementStyle.base["::placeholder"].color=A,this.StripeElementStyle.invalid.color=_):(this.StripeElementStyle.base.color=k,this.StripeElementStyle.base["::placeholder"].color=O,this.StripeElementStyle.invalid.color=k),[2]}}))}))},e.ɵfac=function(t){return new(t||e)(c.ɵɵdirectiveInject(p.PlatformUtilsService),c.ɵɵdirectiveInject(u.ApiService),c.ɵɵdirectiveInject(d.LogService))},e.ɵcmp=c.ɵɵdefineComponent({type:e,selectors:[["app-payment"]],inputs:{showMethods:"showMethods",showOptions:"showOptions",method:"method",hideBank:"hideBank",hidePaypal:"hidePaypal",hideCredit:"hideCredit"},decls:10,vars:5,consts:[["class","mb-4 text-lg",4,"ngIf"],[4,"ngIf"],[1,"mb-4","text-lg"],[1,"form-check","form-check-inline","mr-4"],["type","radio","name","Method","id","method-card",1,"form-check-input",3,"value","ngModel","ngModelChange","change"],["for","method-card",1,"form-check-label"],["aria-hidden","true",1,"fa","fa-fw","fa-credit-card"],["class","form-check form-check-inline mr-4",4,"ngIf"],["class","form-check form-check-inline",4,"ngIf"],["type","radio","name","Method","id","method-bank",1,"form-check-input",3,"value","ngModel","ngModelChange","change"],["for","method-bank",1,"form-check-label"],["aria-hidden","true",1,"fa","fa-fw","fa-university"],[1,"form-check","form-check-inline"],["type","radio","name","Method","id","method-paypal",1,"form-check-input",3,"value","ngModel","ngModelChange","change"],["for","method-paypal",1,"form-check-label"],["aria-hidden","true",1,"fa","fa-fw","fa-paypal"],["type","radio","name","Method","id","method-credit",1,"form-check-input",3,"value","ngModel","ngModelChange","change"],["for","method-credit",1,"form-check-label"],["aria-hidden","true",1,"fa","fa-fw","fa-dollar"],[1,"row"],[1,"form-group","col-4"],["for","stripe-card-number-element"],["id","stripe-card-number-element",1,"form-control","stripe-form-control"],[1,"form-group","col-8","d-flex","align-items-end"],["src","images/cards.png","alt","Visa, MasterCard, Discover, AmEx, JCB, Diners Club, UnionPay","width","323","height","32"],["for","stripe-card-expiry-element"],["id","stripe-card-expiry-element",1,"form-control","stripe-form-control"],[1,"d-flex"],["for","stripe-card-cvc-element"],["href","https://www.cvvnumber.com/cvv.html","tabindex","-1","target","_blank","rel","noopener noreferrer",1,"ml-auto",3,"appA11yTitle"],["aria-hidden","true",1,"fa","fa-question-circle-o"],["id","stripe-card-cvc-element",1,"form-control","stripe-form-control"],["type","warning",3,"title"],[1,"form-group","col-6"],["for","routing_number"],["id","routing_number","type","text","name","routing_number","required","","appInputVerbatim","",1,"form-control",3,"ngModel","ngModelChange"],["for","account_number"],["id","account_number","type","text","name","account_number","required","","appInputVerbatim","",1,"form-control",3,"ngModel","ngModelChange"],["for","account_holder_name"],["id","account_holder_name","type","text","name","account_holder_name","required","",1,"form-control",3,"ngModel","ngModelChange"],["for","account_holder_type"],["id","account_holder_type","name","account_holder_type","required","",1,"form-control",3,"ngModel","ngModelChange"],["value",""],["value","company"],["value","individual"],[1,"mb-3"],["id","bt-dropin-container",1,"mb-1"],[1,"text-muted"],["type","note"]],template:function(e,t){1&e&&(c.ɵɵtemplate(0,w,19,8,"div",0),c.ɵɵtext(1," "),c.ɵɵtemplate(2,C,46,12,"ng-container",1),c.ɵɵtext(3," "),c.ɵɵtemplate(4,I,60,34,"ng-container",1),c.ɵɵtext(5," "),c.ɵɵtemplate(6,E,11,3,"ng-container",1),c.ɵɵtext(7," "),c.ɵɵtemplate(8,P,6,3,"ng-container",1),c.ɵɵtext(9," ")),2&e&&(c.ɵɵproperty("ngIf",t.showOptions&&t.showMethods),c.ɵɵadvance(2),c.ɵɵproperty("ngIf",t.showMethods&&t.method===t.paymentMethodType.Card),c.ɵɵadvance(2),c.ɵɵproperty("ngIf",t.showMethods&&t.method===t.paymentMethodType.BankAccount),c.ɵɵadvance(2),c.ɵɵproperty("ngIf",t.showMethods&&t.method===t.paymentMethodType.PayPal),c.ɵɵadvance(2),c.ɵɵproperty("ngIf",t.showMethods&&t.method===t.paymentMethodType.Credit))},directives:[m.NgIf,f.RadioControlValueAccessor,f.DefaultValueAccessor,f.NgControlStatus,f.NgModel,h.A11yTitleDirective,v.CalloutComponent,f.RequiredValidator,y.InputVerbatimDirective,f.SelectControlValueAccessor,f.NgSelectOption,f.ɵangular_packages_forms_forms_z],pipes:[g.I18nPipe],encapsulation:2}),e}();t.PaymentComponent=T,("undefined"==typeof ngDevMode||ngDevMode)&&c.ɵsetClassMetadata(T,[{type:o.Component,args:[{selector:"app-payment",templateUrl:"payment.component.html"}]}],(function(){return[{type:p.PlatformUtilsService},{type:u.ApiService},{type:d.LogService}]}),{showMethods:[{type:o.Input}],showOptions:[{type:o.Input}],method:[{type:o.Input}],hideBank:[{type:o.Input}],hidePaypal:[{type:o.Input}],hideCredit:[{type:o.Input}]})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CipherView=void 0;var r=n(187),i=n(43),o=n(92),a=n(145),s=n(165),l=n(108),c=function(){function e(e){var t;this.id=null,this.organizationId=null,this.folderId=null,this.name=null,this.notes=null,this.type=null,this.favorite=!1,this.organizationUseTotp=!1,this.edit=!1,this.viewPassword=!0,this.login=new s.LoginView,this.identity=new a.IdentityView,this.card=new o.CardView,this.secureNote=new l.SecureNoteView,this.attachments=null,this.fields=null,this.passwordHistory=null,this.collectionIds=null,this.revisionDate=null,this.deletedDate=null,this.reprompt=r.CipherRepromptType.None,e&&(this.id=e.id,this.organizationId=e.organizationId,this.folderId=e.folderId,this.favorite=e.favorite,this.organizationUseTotp=e.organizationUseTotp,this.edit=e.edit,this.viewPassword=e.viewPassword,this.type=e.type,this.localData=e.localData,this.collectionIds=e.collectionIds,this.revisionDate=e.revisionDate,this.deletedDate=e.deletedDate,this.reprompt=null!==(t=e.reprompt)&&void 0!==t?t:r.CipherRepromptType.None)}return Object.defineProperty(e.prototype,"item",{get:function(){switch(this.type){case i.CipherType.Login:return this.login;case i.CipherType.SecureNote:return this.secureNote;case i.CipherType.Card:return this.card;case i.CipherType.Identity:return this.identity}return null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"subTitle",{get:function(){return this.item.subTitle},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasPasswordHistory",{get:function(){return this.passwordHistory&&this.passwordHistory.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasAttachments",{get:function(){return this.attachments&&this.attachments.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasOldAttachments",{get:function(){if(this.hasAttachments)for(var e=0;e0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"passwordRevisionDisplayDate",{get:function(){return this.type!==i.CipherType.Login||null==this.login||null==this.login.password||""===this.login.password?null:this.login.passwordRevisionDate},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isDeleted",{get:function(){return null!=this.deletedDate},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"linkedFieldOptions",{get:function(){return this.item.linkedFieldOptions},enumerable:!1,configurable:!0}),e.prototype.linkedFieldValue=function(e){var t,n=null===(t=this.linkedFieldOptions)||void 0===t?void 0:t.get(e);if(null==n)return null;this.item;return this.item[n.propertyKey]},e.prototype.linkedFieldI18nKey=function(e){var t;return null===(t=this.linkedFieldOptions.get(e))||void 0===t?void 0:t.i18nKey},e}();t.CipherView=c},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),o=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.IdentityView=void 0;var s=n(315),l=n(28),c=n(408),p=n(409),u=function(e){function t(t){var n=e.call(this)||this;return n.title=null,n.middleName=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._firstName=null,n._lastName=null,n._subTitle=null,n}return i(t,e),Object.defineProperty(t.prototype,"firstName",{get:function(){return this._firstName},set:function(e){this._firstName=e,this._subTitle=null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastName",{get:function(){return this._lastName},set:function(e){this._lastName=e,this._subTitle=null},enumerable:!1,configurable:!0}),Object.defineProperty(t.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:!1,configurable:!0}),Object.defineProperty(t.prototype,"fullName",{get:function(){if(null!=this.title||null!=this.firstName||null!=this.middleName||null!=this.lastName){var e="";return null!=this.title&&(e+=this.title+" "),null!=this.firstName&&(e+=this.firstName+" "),null!=this.middleName&&(e+=this.middleName+" "),null!=this.lastName&&(e+=this.lastName),e.trim()}return null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fullAddress",{get:function(){var e=this.address1;return l.Utils.isNullOrWhitespace(this.address2)||(l.Utils.isNullOrWhitespace(e)||(e+=", "),e+=this.address2),l.Utils.isNullOrWhitespace(this.address3)||(l.Utils.isNullOrWhitespace(e)||(e+=", "),e+=this.address3),e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fullAddressPart2",{get:function(){if(null==this.city&&null==this.state&&null==this.postalCode)return null;var e=this.city||"-",t=this.state,n=this.postalCode||"-",r=e;return l.Utils.isNullOrWhitespace(t)||(r+=", "+t),r+=", "+n},enumerable:!1,configurable:!0}),o([p.linkedFieldOption(c.IdentityLinkedId.Title),a("design:type",String)],t.prototype,"title",void 0),o([p.linkedFieldOption(c.IdentityLinkedId.MiddleName),a("design:type",String)],t.prototype,"middleName",void 0),o([p.linkedFieldOption(c.IdentityLinkedId.Address1),a("design:type",String)],t.prototype,"address1",void 0),o([p.linkedFieldOption(c.IdentityLinkedId.Address2),a("design:type",String)],t.prototype,"address2",void 0),o([p.linkedFieldOption(c.IdentityLinkedId.Address3),a("design:type",String)],t.prototype,"address3",void 0),o([p.linkedFieldOption(c.IdentityLinkedId.City,"cityTown"),a("design:type",String)],t.prototype,"city",void 0),o([p.linkedFieldOption(c.IdentityLinkedId.State,"stateProvince"),a("design:type",String)],t.prototype,"state",void 0),o([p.linkedFieldOption(c.IdentityLinkedId.PostalCode,"zipPostalCode"),a("design:type",String)],t.prototype,"postalCode",void 0),o([p.linkedFieldOption(c.IdentityLinkedId.Country),a("design:type",String)],t.prototype,"country",void 0),o([p.linkedFieldOption(c.IdentityLinkedId.Company),a("design:type",String)],t.prototype,"company",void 0),o([p.linkedFieldOption(c.IdentityLinkedId.Email),a("design:type",String)],t.prototype,"email",void 0),o([p.linkedFieldOption(c.IdentityLinkedId.Phone),a("design:type",String)],t.prototype,"phone",void 0),o([p.linkedFieldOption(c.IdentityLinkedId.Ssn),a("design:type",String)],t.prototype,"ssn",void 0),o([p.linkedFieldOption(c.IdentityLinkedId.Username),a("design:type",String)],t.prototype,"username",void 0),o([p.linkedFieldOption(c.IdentityLinkedId.PassportNumber),a("design:type",String)],t.prototype,"passportNumber",void 0),o([p.linkedFieldOption(c.IdentityLinkedId.LicenseNumber),a("design:type",String)],t.prototype,"licenseNumber",void 0),o([p.linkedFieldOption(c.IdentityLinkedId.FirstName),a("design:type",String),a("design:paramtypes",[String])],t.prototype,"firstName",null),o([p.linkedFieldOption(c.IdentityLinkedId.LastName),a("design:type",String),a("design:paramtypes",[String])],t.prototype,"lastName",null),o([p.linkedFieldOption(c.IdentityLinkedId.FullName),a("design:type",String),a("design:paramtypes",[])],t.prototype,"fullName",null),t}(s.ItemView);t.IdentityView=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FolderView=void 0;var r=function(e){this.id=null,this.name=null,this.revisionDate=null,e&&(this.id=e.id,this.revisionDate=e.revisionDate)};t.FolderView=r},,,,,,,,,,,,,,,,function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]"+n+"";var r=this.makeAnchor(n);return r.setAttribute("href","#/organizations/"+e.organizationId+"/vault?search="+n+"&viewEvents="+e.cipherId),r.outerHTML},e.prototype.formatGroupId=function(e){var t=this.getShortId(e.groupId),n=this.makeAnchor(t);return n.setAttribute("href","#/organizations/"+e.organizationId+"/manage/groups?search="+t),n.outerHTML},e.prototype.formatCollectionId=function(e){var t=this.getShortId(e.collectionId),n=this.makeAnchor(t);return n.setAttribute("href","#/organizations/"+e.organizationId+"/manage/collections?search="+t),n.outerHTML},e.prototype.formatOrgUserId=function(e){var t=this.getShortId(e.organizationUserId),n=this.makeAnchor(t);return n.setAttribute("href","#/organizations/"+e.organizationId+"/manage/people?search="+t+"&viewEvents="+e.organizationUserId),n.outerHTML},e.prototype.formatProviderUserId=function(e){var t=this.getShortId(e.providerUserId),n=this.makeAnchor(t);return n.setAttribute("href","#/providers/"+e.providerId+"/manage/people?search="+t+"&viewEvents="+e.providerUserId),n.outerHTML},e.prototype.formatProviderOrganizationId=function(e){var t=this.getShortId(e.providerOrganizationId),n=this.makeAnchor(t);return n.setAttribute("href","#/providers/"+e.providerId+"/clients?search="+t),n.outerHTML},e.prototype.formatPolicyId=function(e){var t=this.getShortId(e.policyId),n=this.makeAnchor(t);return n.setAttribute("href","#/organizations/"+e.organizationId+"/manage/policies?policyId="+e.policyId),n.outerHTML},e.prototype.makeAnchor=function(e){var t=document.createElement("a");return t.title=this.i18nService.t("view"),t.innerHTML=""+e+"",t},e.prototype.getShortId=function(e){return null==e?void 0:e.substring(0,8)},e.prototype.toDateTimeLocalString=function(e){return e.getFullYear()+"-"+this.pad(e.getMonth()+1)+"-"+this.pad(e.getDate())+"T"+this.pad(e.getHours())+":"+this.pad(e.getMinutes())},e.prototype.pad=function(e){var t=Math.floor(Math.abs(e));return(t<10?"0":"")+t},e.ɵfac=function(t){return new(t||e)(c.ɵɵinject(p.I18nService),c.ɵɵinject(u.PolicyService))},e.ɵprov=c.ɵɵdefineInjectable({token:e,factory:e.ɵfac}),e}();t.EventService=d,("undefined"==typeof ngDevMode||ngDevMode)&&c.ɵsetClassMetadata(d,[{type:o.Injectable}],(function(){return[{type:p.I18nService},{type:u.PolicyService}]}),null);var m=function(){};t.EventInfo=m;var f=function(){this.cipherInfo=!0};t.EventOptions=f},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.LoginView=void 0;var s=n(315),l=n(28),c=n(408),p=n(409),u=function(e){function t(t){var n=e.call(this)||this;return n.username=null,n.password=null,n.passwordRevisionDate=null,n.totp=null,n.uris=null,n.autofillOnPageLoad=null,t?(n.passwordRevisionDate=t.passwordRevisionDate,n.autofillOnPageLoad=t.autofillOnPageLoad,n):n}return i(t,e),Object.defineProperty(t.prototype,"uri",{get:function(){return this.hasUris?this.uris[0].uri:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maskedPassword",{get:function(){return null!=this.password?"••••••••":null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"subTitle",{get:function(){return this.username},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canLaunch",{get:function(){return this.hasUris&&this.uris.some((function(e){return e.canLaunch}))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hasTotp",{get:function(){return!l.Utils.isNullOrWhitespace(this.totp)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"launchUri",{get:function(){if(this.hasUris){var e=this.uris.find((function(e){return e.canLaunch}));if(null!=e)return e.launchUri}return null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hasUris",{get:function(){return null!=this.uris&&this.uris.length>0},enumerable:!1,configurable:!0}),o([p.linkedFieldOption(c.LoginLinkedId.Username),a("design:type",String)],t.prototype,"username",void 0),o([p.linkedFieldOption(c.LoginLinkedId.Password),a("design:type",String)],t.prototype,"password",void 0),t}(s.ItemView);t.LoginView=u},,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]-1&&t.indexOf("]")>-1){var i=t.lastIndexOf(".");r=t.substr(0,i>-1?i:t.length)+": "}e.push(r+n)}))},n=this;for(var r in this.validationErrors)t(r);return e},t}(n(26).BaseResponse);t.ErrorResponse=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EventType=void 0,function(e){e[e.User_LoggedIn=1e3]="User_LoggedIn",e[e.User_ChangedPassword=1001]="User_ChangedPassword",e[e.User_Updated2fa=1002]="User_Updated2fa",e[e.User_Disabled2fa=1003]="User_Disabled2fa",e[e.User_Recovered2fa=1004]="User_Recovered2fa",e[e.User_FailedLogIn=1005]="User_FailedLogIn",e[e.User_FailedLogIn2fa=1006]="User_FailedLogIn2fa",e[e.User_ClientExportedVault=1007]="User_ClientExportedVault",e[e.User_UpdatedTempPassword=1008]="User_UpdatedTempPassword",e[e.User_MigratedKeyToKeyConnector=1009]="User_MigratedKeyToKeyConnector",e[e.Cipher_Created=1100]="Cipher_Created",e[e.Cipher_Updated=1101]="Cipher_Updated",e[e.Cipher_Deleted=1102]="Cipher_Deleted",e[e.Cipher_AttachmentCreated=1103]="Cipher_AttachmentCreated",e[e.Cipher_AttachmentDeleted=1104]="Cipher_AttachmentDeleted",e[e.Cipher_Shared=1105]="Cipher_Shared",e[e.Cipher_UpdatedCollections=1106]="Cipher_UpdatedCollections",e[e.Cipher_ClientViewed=1107]="Cipher_ClientViewed",e[e.Cipher_ClientToggledPasswordVisible=1108]="Cipher_ClientToggledPasswordVisible",e[e.Cipher_ClientToggledHiddenFieldVisible=1109]="Cipher_ClientToggledHiddenFieldVisible",e[e.Cipher_ClientToggledCardCodeVisible=1110]="Cipher_ClientToggledCardCodeVisible",e[e.Cipher_ClientCopiedPassword=1111]="Cipher_ClientCopiedPassword",e[e.Cipher_ClientCopiedHiddenField=1112]="Cipher_ClientCopiedHiddenField",e[e.Cipher_ClientCopiedCardCode=1113]="Cipher_ClientCopiedCardCode",e[e.Cipher_ClientAutofilled=1114]="Cipher_ClientAutofilled",e[e.Cipher_SoftDeleted=1115]="Cipher_SoftDeleted",e[e.Cipher_Restored=1116]="Cipher_Restored",e[e.Cipher_ClientToggledCardNumberVisible=1117]="Cipher_ClientToggledCardNumberVisible",e[e.Collection_Created=1300]="Collection_Created",e[e.Collection_Updated=1301]="Collection_Updated",e[e.Collection_Deleted=1302]="Collection_Deleted",e[e.Group_Created=1400]="Group_Created",e[e.Group_Updated=1401]="Group_Updated",e[e.Group_Deleted=1402]="Group_Deleted",e[e.OrganizationUser_Invited=1500]="OrganizationUser_Invited",e[e.OrganizationUser_Confirmed=1501]="OrganizationUser_Confirmed",e[e.OrganizationUser_Updated=1502]="OrganizationUser_Updated",e[e.OrganizationUser_Removed=1503]="OrganizationUser_Removed",e[e.OrganizationUser_UpdatedGroups=1504]="OrganizationUser_UpdatedGroups",e[e.OrganizationUser_UnlinkedSso=1505]="OrganizationUser_UnlinkedSso",e[e.OrganizationUser_ResetPassword_Enroll=1506]="OrganizationUser_ResetPassword_Enroll",e[e.OrganizationUser_ResetPassword_Withdraw=1507]="OrganizationUser_ResetPassword_Withdraw",e[e.OrganizationUser_AdminResetPassword=1508]="OrganizationUser_AdminResetPassword",e[e.OrganizationUser_ResetSsoLink=1509]="OrganizationUser_ResetSsoLink",e[e.OrganizationUser_FirstSsoLogin=1510]="OrganizationUser_FirstSsoLogin",e[e.Organization_Updated=1600]="Organization_Updated",e[e.Organization_PurgedVault=1601]="Organization_PurgedVault",e[e.Organization_VaultAccessed=1603]="Organization_VaultAccessed",e[e.Organization_EnabledSso=1604]="Organization_EnabledSso",e[e.Organization_DisabledSso=1605]="Organization_DisabledSso",e[e.Organization_EnabledKeyConnector=1606]="Organization_EnabledKeyConnector",e[e.Organization_DisabledKeyConnector=1607]="Organization_DisabledKeyConnector",e[e.Policy_Updated=1700]="Policy_Updated",e[e.ProviderUser_Invited=1800]="ProviderUser_Invited",e[e.ProviderUser_Confirmed=1801]="ProviderUser_Confirmed",e[e.ProviderUser_Updated=1802]="ProviderUser_Updated",e[e.ProviderUser_Removed=1803]="ProviderUser_Removed",e[e.ProviderOrganization_Created=1900]="ProviderOrganization_Created",e[e.ProviderOrganization_Added=1901]="ProviderOrganization_Added",e[e.ProviderOrganization_Removed=1902]="ProviderOrganization_Removed",e[e.ProviderOrganization_VaultAccessed=1903]="ProviderOrganization_VaultAccessed"}(t.EventType||(t.EventType={}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OrganizationUserStatusType=void 0,function(e){e[e.Invited=0]="Invited",e[e.Accepted=1]="Accepted",e[e.Confirmed=2]="Confirmed"}(t.OrganizationUserStatusType||(t.OrganizationUserStatusType={}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PasswordStrengthComponent=void 0;var r=n(0),i=(n(1),n(0)),o=n(1),a=n(2);function s(e,t){if(1&e&&(i.ɵɵelementContainerStart(0),i.ɵɵtext(1),i.ɵɵelementContainerEnd()),2&e){var n=i.ɵɵnextContext();i.ɵɵadvance(1),i.ɵɵtextInterpolate1(" ",n.text," ")}}var l=function(e){return{width:e}},c=function(){function e(e){this.i18nService=e,this.showText=!1,this.scoreWidth=0,this.color="bg-danger"}return e.prototype.ngOnChanges=function(){switch(this.scoreWidth=null==this.score?0:20*(this.score+1),this.score){case 4:this.color="bg-success",this.text=this.i18nService.t("strong");break;case 3:this.color="bg-primary",this.text=this.i18nService.t("good");break;case 2:this.color="bg-warning",this.text=this.i18nService.t("weak");break;default:this.color="bg-danger",this.text=null!=this.score?this.i18nService.t("weak"):null}},e.ɵfac=function(t){return new(t||e)(i.ɵɵdirectiveInject(o.I18nService))},e.ɵcmp=i.ɵɵdefineComponent({type:e,selectors:[["app-password-strength"]],inputs:{score:"score",showText:"showText"},features:[i.ɵɵNgOnChangesFeature],decls:8,vars:8,consts:[[1,"progress"],["role","progressbar","aria-valuemin","0","aria-valuemax","100",3,"ngStyle"],[4,"ngIf"]],template:function(e,t){1&e&&(i.ɵɵelementStart(0,"div",0),i.ɵɵtext(1," "),i.ɵɵelementStart(2,"div",1),i.ɵɵtext(3," "),i.ɵɵtemplate(4,s,2,1,"ng-container",2),i.ɵɵtext(5," "),i.ɵɵelementEnd(),i.ɵɵtext(6," "),i.ɵɵelementEnd(),i.ɵɵtext(7," ")),2&e&&(i.ɵɵadvance(2),i.ɵɵclassMapInterpolate1("progress-bar ",t.color,""),i.ɵɵproperty("ngStyle",i.ɵɵpureFunction1(6,l,t.scoreWidth+"%")),i.ɵɵattribute("aria-valuenow",t.scoreWidth),i.ɵɵadvance(2),i.ɵɵproperty("ngIf",t.showText&&t.text))},directives:[a.NgStyle,a.NgIf],encapsulation:2}),e}();t.PasswordStrengthComponent=c,("undefined"==typeof ngDevMode||ngDevMode)&&i.ɵsetClassMetadata(c,[{type:r.Component,args:[{selector:"app-password-strength",templateUrl:"password-strength.component.html"}]}],(function(){return[{type:o.I18nService}]}),{score:[{type:r.Input}],showText:[{type:r.Input}]})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CollectionData=void 0;var r=function(e){this.id=e.id,this.organizationId=e.organizationId,this.name=e.name,this.externalId=e.externalId,this.readOnly=e.readOnly};t.CollectionData=r},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0?(p=[],[4,this.attachments.reduce((function(t,n){return t.then((function(){return n.decrypt(l,e)})).then((function(e){p.push(e)}))}),Promise.resolve())]):[3,13];case 12:a.sent(),t.attachments=p,a.label=13;case 13:return null!=this.fields&&this.fields.length>0?(u=[],[4,this.fields.reduce((function(t,n){return t.then((function(){return n.decrypt(l,e)})).then((function(e){u.push(e)}))}),Promise.resolve())]):[3,15];case 14:a.sent(),t.fields=u,a.label=15;case 15:return null!=this.passwordHistory&&this.passwordHistory.length>0?(d=[],[4,this.passwordHistory.reduce((function(t,n){return t.then((function(){return n.decrypt(l,e)})).then((function(e){d.push(e)}))}),Promise.resolve())]):[3,17];case 16:a.sent(),t.passwordHistory=d,a.label=17;case 17:return[2,t]}}))}))},t.prototype.toCipherData=function(e){var t=new l.CipherData;switch(t.id=this.id,t.organizationId=this.organizationId,t.folderId=this.folderId,t.userId=null!=this.organizationId?e:null,t.edit=this.edit,t.viewPassword=this.viewPassword,t.organizationUseTotp=this.organizationUseTotp,t.favorite=this.favorite,t.revisionDate=null!=this.revisionDate?this.revisionDate.toISOString():null,t.type=this.type,t.collectionIds=this.collectionIds,t.deletedDate=null!=this.deletedDate?this.deletedDate.toISOString():null,t.reprompt=this.reprompt,this.buildDataModel(this,t,{name:null,notes:null}),t.type){case s.CipherType.Login:t.login=this.login.toLoginData();break;case s.CipherType.SecureNote:t.secureNote=this.secureNote.toSecureNoteData();break;case s.CipherType.Card:t.card=this.card.toCardData();break;case s.CipherType.Identity:t.identity=this.identity.toIdentityData()}return null!=this.fields&&(t.fields=this.fields.map((function(e){return e.toFieldData()}))),null!=this.attachments&&(t.attachments=this.attachments.map((function(e){return e.toAttachmentData()}))),null!=this.passwordHistory&&(t.passwordHistory=this.passwordHistory.map((function(e){return e.toPasswordHistoryData()}))),t},t}(d.default);t.Cipher=g},,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]1)}}function w(e,t){if(1&e&&(a.ɵɵelementStart(0,"div",31),a.ɵɵtext(1," "),a.ɵɵelement(2,"app-avatar",32),a.ɵɵtext(3," "),a.ɵɵelementStart(4,"div",33),a.ɵɵtext(5," "),a.ɵɵelementStart(6,"span"),a.ɵɵtext(7),a.ɵɵpipe(8,"i18n"),a.ɵɵelementEnd(),a.ɵɵtext(9," "),a.ɵɵelementStart(10,"small",34),a.ɵɵtext(11),a.ɵɵelementEnd(),a.ɵɵtext(12," "),a.ɵɵelementEnd(),a.ɵɵtext(13," "),a.ɵɵelementEnd()),2&e){var n=a.ɵɵnextContext();a.ɵɵadvance(2),a.ɵɵproperty("data",n.name)("email",n.email)("circle",!0),a.ɵɵadvance(5),a.ɵɵtextInterpolate(a.ɵɵpipeBind1(8,5,"loggedInAs")),a.ɵɵadvance(4),a.ɵɵtextInterpolate(n.name)}}var C=function(e){return{"nav-background-alt":e}},I=function(){function e(e,t,n,r,i){this.messagingService=e,this.platformUtilsService=t,this.tokenService=n,this.userService=r,this.syncService=i,this.selfHosted=!1,this.providers=[],this.selfHosted=this.platformUtilsService.isSelfHost()}return e.prototype.ngOnInit=function(){return r(this,void 0,void 0,(function(){var e,t,n;return i(this,(function(r){switch(r.label){case 0:return e=this,[4,this.tokenService.getName()];case 1:return e.name=r.sent(),t=this,[4,this.tokenService.getEmail()];case 2:return t.email=r.sent(),null!=this.name&&""!==this.name.trim()||(this.name=this.email),[4,this.syncService.getLastSync()];case 3:return null!=r.sent()?[3,5]:[4,this.syncService.fullSync(!1)];case 4:r.sent(),r.label=5;case 5:return n=this,[4,this.userService.getAllProviders()];case 6:return n.providers=r.sent(),[2]}}))}))},e.prototype.lock=function(){this.messagingService.send("lockVault")},e.prototype.logOut=function(){this.messagingService.send("logout")},e.ɵfac=function(t){return new(t||e)(a.ɵɵdirectiveInject(s.MessagingService),a.ɵɵdirectiveInject(l.PlatformUtilsService),a.ɵɵdirectiveInject(c.TokenService),a.ɵɵdirectiveInject(p.UserService),a.ɵɵdirectiveInject(u.SyncService))},e.ɵcmp=a.ɵɵdefineComponent({type:e,selectors:[["app-navbar"]],decls:98,vars:36,consts:[[1,"navbar","navbar-expand","navbar-dark",3,"ngClass"],[1,"container"],["routerLink","/",1,"navbar-brand",3,"appA11yTitle"],["aria-hidden","true",1,"fa","fa-shield"],[1,"collapse","navbar-collapse"],[1,"navbar-nav"],["routerLinkActive","active",1,"nav-item"],["routerLink","/vault",1,"nav-link"],["routerLink","/sends",1,"nav-link"],[4,"ngIf"],["routerLink","/tools",1,"nav-link"],["routerLink","/settings",1,"nav-link"],[1,"navbar-nav","flex-row","ml-md-auto","d-none","d-md-flex"],[1,"nav-item","dropdown"],["href","#","id","nav-profile","data-toggle","dropdown","aria-haspopup","true","aria-expanded","false",1,"nav-item","nav-link","dropdown-toggle"],["aria-hidden","true",1,"fa","fa-user-circle","fa-lg"],["aria-labelledby","nav-profile",1,"dropdown-menu","dropdown-menu-right"],["class","dropdown-item-text d-flex align-items-center","appStopProp","",4,"ngIf"],[1,"dropdown-divider"],["href","#","routerLink","/settings/account",1,"dropdown-item"],["aria-hidden","true",1,"fa","fa-fw","fa-user"],["href","https://help.bitwarden.com","target","_blank","rel","noopener",1,"dropdown-item"],["aria-hidden","true",1,"fa","fa-fw","fa-question-circle"],["href","https://bitwarden.com/download/","target","_blank","rel","noopener",1,"dropdown-item"],["aria-hidden","true",1,"fa","fa-fw","fa-download"],["type","button",1,"dropdown-item",3,"click"],["aria-hidden","true",1,"fa","fa-fw","fa-lock"],["aria-hidden","true",1,"fa","fa-fw","fa-sign-out"],["class","nav-item","routerLinkActive","active",4,"ngIf"],[1,"nav-link",3,"routerLink"],["routerLink","/providers",1,"nav-link"],["appStopProp","",1,"dropdown-item-text","d-flex","align-items-center"],["size","25","fontSize","14",3,"data","email","circle"],[1,"ml-2","overflow-hidden"],[1,"text-muted"]],template:function(e,t){1&e&&(a.ɵɵelementStart(0,"nav",0),a.ɵɵtext(1," "),a.ɵɵelementStart(2,"div",1),a.ɵɵtext(3," "),a.ɵɵelementStart(4,"a",2),a.ɵɵpipe(5,"i18n"),a.ɵɵtext(6," "),a.ɵɵelement(7,"i",3),a.ɵɵtext(8," "),a.ɵɵelementEnd(),a.ɵɵtext(9," "),a.ɵɵelementStart(10,"div",4),a.ɵɵtext(11," "),a.ɵɵelementStart(12,"ul",5),a.ɵɵtext(13," "),a.ɵɵelementStart(14,"li",6),a.ɵɵtext(15," "),a.ɵɵelementStart(16,"a",7),a.ɵɵtext(17),a.ɵɵpipe(18,"i18n"),a.ɵɵelementEnd(),a.ɵɵtext(19," "),a.ɵɵelementEnd(),a.ɵɵtext(20," "),a.ɵɵelementStart(21,"li",6),a.ɵɵtext(22," "),a.ɵɵelementStart(23,"a",8),a.ɵɵtext(24),a.ɵɵpipe(25,"i18n"),a.ɵɵelementEnd(),a.ɵɵtext(26," "),a.ɵɵelementEnd(),a.ɵɵtext(27," "),a.ɵɵtemplate(28,b,6,2,"ng-container",9),a.ɵɵtext(29," "),a.ɵɵelementStart(30,"li",6),a.ɵɵtext(31," "),a.ɵɵelementStart(32,"a",10),a.ɵɵtext(33),a.ɵɵpipe(34,"i18n"),a.ɵɵelementEnd(),a.ɵɵtext(35," "),a.ɵɵelementEnd(),a.ɵɵtext(36," "),a.ɵɵelementStart(37,"li",6),a.ɵɵtext(38," "),a.ɵɵelementStart(39,"a",11),a.ɵɵtext(40),a.ɵɵpipe(41,"i18n"),a.ɵɵelementEnd(),a.ɵɵtext(42," "),a.ɵɵelementEnd(),a.ɵɵtext(43," "),a.ɵɵelementEnd(),a.ɵɵtext(44," "),a.ɵɵelementEnd(),a.ɵɵtext(45," "),a.ɵɵelementStart(46,"ul",12),a.ɵɵtext(47," "),a.ɵɵelementStart(48,"li",13),a.ɵɵtext(49," "),a.ɵɵelementStart(50,"a",14),a.ɵɵtext(51," "),a.ɵɵelement(52,"i",15),a.ɵɵtext(53," "),a.ɵɵelementEnd(),a.ɵɵtext(54," "),a.ɵɵelementStart(55,"div",16),a.ɵɵtext(56," "),a.ɵɵtemplate(57,w,14,7,"div",17),a.ɵɵtext(58," "),a.ɵɵelement(59,"div",18),a.ɵɵtext(60," "),a.ɵɵelementStart(61,"a",19),a.ɵɵtext(62," "),a.ɵɵelement(63,"i",20),a.ɵɵtext(64),a.ɵɵpipe(65,"i18n"),a.ɵɵelementEnd(),a.ɵɵtext(66," "),a.ɵɵelementStart(67,"a",21),a.ɵɵtext(68," "),a.ɵɵelement(69,"i",22),a.ɵɵtext(70),a.ɵɵpipe(71,"i18n"),a.ɵɵelementEnd(),a.ɵɵtext(72," "),a.ɵɵelementStart(73,"a",23),a.ɵɵtext(74," "),a.ɵɵelement(75,"i",24),a.ɵɵtext(76),a.ɵɵpipe(77,"i18n"),a.ɵɵelementEnd(),a.ɵɵtext(78," "),a.ɵɵelement(79,"div",18),a.ɵɵtext(80," "),a.ɵɵelementStart(81,"button",25),a.ɵɵlistener("click",(function(){return t.lock()})),a.ɵɵtext(82," "),a.ɵɵelement(83,"i",26),a.ɵɵtext(84),a.ɵɵpipe(85,"i18n"),a.ɵɵelementEnd(),a.ɵɵtext(86," "),a.ɵɵelementStart(87,"button",25),a.ɵɵlistener("click",(function(){return t.logOut()})),a.ɵɵtext(88," "),a.ɵɵelement(89,"i",27),a.ɵɵtext(90),a.ɵɵpipe(91,"i18n"),a.ɵɵelementEnd(),a.ɵɵtext(92," "),a.ɵɵelementEnd(),a.ɵɵtext(93," "),a.ɵɵelementEnd(),a.ɵɵtext(94," "),a.ɵɵelementEnd(),a.ɵɵtext(95," "),a.ɵɵelementEnd(),a.ɵɵtext(96," "),a.ɵɵelementEnd(),a.ɵɵtext(97," ")),2&e&&(a.ɵɵproperty("ngClass",a.ɵɵpureFunction1(34,C,t.selfHosted)),a.ɵɵadvance(4),a.ɵɵpropertyInterpolate("appA11yTitle",a.ɵɵpipeBind2(5,13,"pageTitle","Bitwarden")),a.ɵɵadvance(13),a.ɵɵtextInterpolate(a.ɵɵpipeBind1(18,16,"myVault")),a.ɵɵadvance(7),a.ɵɵtextInterpolate(a.ɵɵpipeBind1(25,18,"send")),a.ɵɵadvance(4),a.ɵɵproperty("ngIf",t.providers.length>=1),a.ɵɵadvance(5),a.ɵɵtextInterpolate(a.ɵɵpipeBind1(34,20,"tools")),a.ɵɵadvance(7),a.ɵɵtextInterpolate(a.ɵɵpipeBind1(41,22,"settings")),a.ɵɵadvance(17),a.ɵɵproperty("ngIf",t.name),a.ɵɵadvance(7),a.ɵɵtextInterpolate1(" ",a.ɵɵpipeBind1(65,24,"myAccount")," "),a.ɵɵadvance(6),a.ɵɵtextInterpolate1(" ",a.ɵɵpipeBind1(71,26,"getHelp")," "),a.ɵɵadvance(6),a.ɵɵtextInterpolate1(" ",a.ɵɵpipeBind1(77,28,"getApps")," "),a.ɵɵadvance(8),a.ɵɵtextInterpolate1(" ",a.ɵɵpipeBind1(85,30,"lockNow")," "),a.ɵɵadvance(6),a.ɵɵtextInterpolate1(" ",a.ɵɵpipeBind1(91,32,"logOut")," "))},directives:[d.NgClass,m.RouterLinkWithHref,f.A11yTitleDirective,m.RouterLinkActive,d.NgIf,h.StopPropDirective,v.AvatarComponent],pipes:[y.I18nPipe],encapsulation:2}),e}();t.NavbarComponent=I,("undefined"==typeof ngDevMode||ngDevMode)&&a.ɵsetClassMetadata(I,[{type:o.Component,args:[{selector:"app-navbar",templateUrl:"navbar.component.html"}]}],(function(){return[{type:s.MessagingService},{type:l.PlatformUtilsService},{type:c.TokenService},{type:p.UserService},{type:u.SyncService}]}),null)},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]4?(t=Math.floor(this.totpCode.length/2),this.totpCodeFormatted=this.totpCode.substring(0,t)+" "+this.totpCode.substring(t)):this.totpCodeFormatted=this.totpCode:(this.totpCodeFormatted=null,this.totpInterval&&window.clearInterval(this.totpInterval)),[2]}}))}))},t.prototype.allowOwnershipAssignment=function(){return(!this.editMode||this.cloneMode)&&null!=this.ownershipOptions&&(this.ownershipOptions.length>1||!this.allowPersonal)},t.prototype.totpTick=function(e){return o(this,void 0,void 0,(function(){var t,n;return a(this,(function(r){switch(r.label){case 0:return t=Math.round((new Date).getTime()/1e3),n=t%e,this.totpSec=e-n,this.totpDash=+(Math.round(78.6/e*n+"e+2")+"e-2"),this.totpLow=this.totpSec<=7,0!==n?[3,2]:[4,this.totpUpdateCode()];case 1:r.sent(),r.label=2;case 2:return[2]}}))}))},t.ɵfac=function(e){return new(e||t)(u.ɵɵdirectiveInject(d.CipherService),u.ɵɵdirectiveInject(m.FolderService),u.ɵɵdirectiveInject(f.I18nService),u.ɵɵdirectiveInject(h.PlatformUtilsService),u.ɵɵdirectiveInject(v.AuditService),u.ɵɵdirectiveInject(y.StateService),u.ɵɵdirectiveInject(g.UserService),u.ɵɵdirectiveInject(x.CollectionService),u.ɵɵdirectiveInject(S.TotpService),u.ɵɵdirectiveInject(b.PasswordGenerationService),u.ɵɵdirectiveInject(w.MessagingService),u.ɵɵdirectiveInject(C.EventService),u.ɵɵdirectiveInject(I.PolicyService),u.ɵɵdirectiveInject(E.PasswordRepromptService),u.ɵɵdirectiveInject(P.LogService))},t.ɵcmp=u.ɵɵdefineComponent({type:t,selectors:[["app-vault-add-edit"]],features:[u.ɵɵInheritDefinitionFeature],decls:36,vars:11,consts:[["role","dialog","aria-modal","true","aria-labelledby","cipherAddEditTitle",1,"modal","fade"],["role","document",1,"modal-dialog","modal-dialog-scrollable","modal-lg"],["ngNativeValidate","","autocomplete","off",1,"modal-content",3,"appApiAction","ngSubmit"],["form",""],[1,"modal-header"],["id","cipherAddEditTitle",1,"modal-title"],["type","button","data-dismiss","modal",1,"close",3,"appA11yTitle"],["aria-hidden","true"],["class","modal-body",4,"ngIf"],[1,"modal-footer"],["type","submit","class","btn btn-primary btn-submit",3,"disabled",4,"ngIf"],["type","button","data-dismiss","modal",1,"btn","btn-outline-secondary"],["class","ml-auto",4,"ngIf"],[1,"modal-body"],["type","info",4,"ngIf"],["class","row",4,"ngIf"],[1,"row"],[1,"col-6","form-group"],["for","name"],["id","name","type","text","name","Name","required","",1,"form-control",3,"ngModel","disabled","ngModelChange"],["class","col-6 form-group",4,"ngIf"],[4,"ngIf"],[1,"form-group"],["for","notes"],["id","notes","name","Notes","rows","6",1,"form-control",3,"ngModel","disabled","ngModelChange"],[3,"cipher","thisCipherType","viewOnly","copy"],["type","info"],["for","type"],["id","type","name","Type","appAutofocus","",1,"form-control",3,"ngModel","disabled","ngModelChange"],[3,"ngValue",4,"ngFor","ngForOf"],[3,"ngValue"],["for","folder"],["id","folder","name","FolderId",1,"form-control",3,"ngModel","disabled","ngModelChange"],["for","loginUsername"],[1,"input-group"],["id","loginUsername","type","text","name","Login.Username","appInputVerbatim","",1,"form-control",3,"ngModel","disabled","ngModelChange"],["class","input-group-append",4,"ngIf"],[1,"d-flex"],["for","loginPassword"],["class","ml-auto d-flex",4,"ngIf"],["id","loginPassword","name","Login.Password","appInputVerbatim","","autocomplete","new-password",1,"form-control","text-monospace",3,"type","ngModel","disabled","ngModelChange"],[1,"input-group-append"],["type","button",1,"btn","btn-outline-secondary",3,"appA11yTitle","disabled","click"],["aria-hidden","true",1,"fa","fa-lg",3,"ngClass"],["aria-hidden","true",1,"fa","fa-lg","fa-clone"],["for","loginTotp"],["id","loginTotp","name","Login.Totp","appInputVerbatim","",1,"form-control","text-monospace",3,"type","ngModel","disabled","ngModelChange"],[1,"col-6","form-group","totp","d-flex","align-items-end",3,"ngClass"],["class","d-flex align-items-center",4,"ngIf"],["href","#","appStopClick","","class","d-inline-block mb-3",3,"click",4,"ngIf"],["type","button",1,"btn","btn-outline-secondary",3,"appA11yTitle","click"],[1,"ml-auto","d-flex"],["href","#","class","d-block mr-2 fa-icon-above-input","appStopClick","",3,"appA11yTitle","click",4,"ngIf"],["href","#","appStopClick","",1,"d-block","fa-icon-above-input",3,"appA11yTitle","appApiAction","click"],["checkPasswordBtn",""],["aria-hidden","true",1,"fa","fa-lg","fa-fw","fa-check-circle",3,"hidden"],["aria-hidden","true",1,"fa","fa-lg","fa-fw","fa-spinner","fa-spin",3,"hidden","title"],["href","#","appStopClick","",1,"d-block","mr-2","fa-icon-above-input",3,"appA11yTitle","click"],["aria-hidden","true",1,"fa","fa-lg","fa-fw","fa-refresh"],["src","images/totp-countdown.png","id","totpImage",1,"ml-2",3,"title"],["href","#","appStopClick","","class","badge badge-primary ml-3",3,"click",4,"ngIf"],["href","#","appStopClick","",1,"badge","badge-primary","ml-3",3,"click"],[1,"d-flex","align-items-center"],[1,"totp-countdown","mr-3","ml-2"],[1,"totp-sec"],["r","12.6","cy","16","cx","16",1,"totp-circle","inner",3,"ngStyle"],["r","14","cy","16","cx","16",1,"totp-circle","outer"],[1,"totp-code","mr-2",3,"title"],["type","button",1,"btn","btn-link",3,"appA11yTitle","click"],["aria-hidden","true",1,"fa","fa-clone"],["class","row",4,"ngFor","ngForOf","ngForTrackBy"],[1,"col-7","form-group"],[3,"for"],["type","text","appInputVerbatim","",1,"form-control",3,"id","name","ngModel","disabled","placeholder","ngModelChange"],["aria-hidden","true",1,"fa","fa-lg","fa-share"],[1,"col-5","form-group"],["href","https://help.bitwarden.com/article/uri-match-detection/","target","_blank","rel","noopener",1,"ml-auto",3,"appA11yTitle"],["aria-hidden","true",1,"fa","fa-question-circle-o"],[1,"form-control","overflow-hidden",3,"id","name","ngModel","disabled","ngModelChange","change"],["type","button","class","btn btn-link text-danger ml-2",3,"appA11yTitle","click",4,"ngIf"],["type","button",1,"btn","btn-link","text-danger","ml-2",3,"appA11yTitle","click"],["aria-hidden","true",1,"fa","fa-minus-circle","fa-lg"],["href","#","appStopClick","",1,"d-inline-block","mb-3",3,"click"],["aria-hidden","true",1,"fa","fa-plus-circle","fa-fw"],["for","cardCardholderName"],["id","cardCardholderName","type","text","name","Card.CardCardholderName",1,"form-control",3,"ngModel","disabled","ngModelChange"],["for","cardBrand"],["id","cardBrand","name","Card.Brand",1,"form-control",3,"ngModel","disabled","ngModelChange"],["for","cardNumber"],["id","cardNumber","name","Card.Number","appInputVerbatim","","autocomplete","new-password",1,"form-control","text-monospace",3,"type","ngModel","disabled","ngModelChange"],[1,"col","form-group"],["for","cardExpMonth"],["id","cardExpMonth","name","Card.ExpMonth",1,"form-control",3,"ngModel","disabled","ngModelChange"],["for","cardExpYear"],["id","cardExpYear","type","text","name","Card.ExpYear",1,"form-control",3,"ngModel","placeholder","disabled","ngModelChange"],["for","cardCode"],["id","cardCode","name","Card.Code","appInputVerbatim","","autocomplete","new-password",1,"form-control","text-monospace",3,"type","ngModel","disabled","ngModelChange"],[1,"col-4","form-group"],["for","idTitle"],["id","idTitle","name","Identity.Title",1,"form-control",3,"ngModel","disabled","ngModelChange"],["for","idFirstName"],["id","idFirstName","type","text","name","Identity.FirstName",1,"form-control",3,"ngModel","disabled","ngModelChange"],["for","idMiddleName"],["id","idMiddleName","type","text","name","Identity.MiddleName",1,"form-control",3,"ngModel","disabled","ngModelChange"],["for","idLastName"],["id","idLastName","type","text","name","Identity.LastName",1,"form-control",3,"ngModel","disabled","ngModelChange"],["for","idUsername"],["id","idUsername","type","text","name","Identity.Username","appInputVerbatim","",1,"form-control",3,"ngModel","disabled","ngModelChange"],["for","idCompany"],["id","idCompany","type","text","name","Identity.Company",1,"form-control",3,"ngModel","disabled","ngModelChange"],["for","idSsn"],["id","idSsn","type","text","name","Identity.SSN","appInputVerbatim","",1,"form-control",3,"ngModel","disabled","ngModelChange"],["for","idPassportNumber"],["id","idPassportNumber","type","text","name","Identity.PassportNumber","appInputVerbatim","",1,"form-control",3,"ngModel","disabled","ngModelChange"],["for","idLicenseNumber"],["id","idLicenseNumber","type","text","name","Identity.LicenseNumber","appInputVerbatim","",1,"form-control",3,"ngModel","disabled","ngModelChange"],["for","idEmail"],["id","idEmail","type","text","name","Identity.Email","appInputVerbatim","",1,"form-control",3,"ngModel","disabled","ngModelChange"],["for","idPhone"],["id","idPhone","type","text","name","Identity.Phone",1,"form-control",3,"ngModel","disabled","ngModelChange"],["for","idAddress1"],["id","idAddress1","type","text","name","Identity.Address1",1,"form-control",3,"ngModel","disabled","ngModelChange"],["for","idAddress2"],["id","idAddress2","type","text","name","Identity.Address2",1,"form-control",3,"ngModel","disabled","ngModelChange"],["for","idAddress3"],["id","idAddress3","type","text","name","Identity.Address3",1,"form-control",3,"ngModel","disabled","ngModelChange"],["for","idCity"],["id","idCity","type","text","name","Identity.City",1,"form-control",3,"ngModel","disabled","ngModelChange"],["for","idState"],["id","idState","type","text","name","Identity.State",1,"form-control",3,"ngModel","disabled","ngModelChange"],["for","idPostalCode"],["id","idPostalCode","type","text","name","Identity.PostalCode",1,"form-control",3,"ngModel","disabled","ngModelChange"],["for","idCountry"],["id","idCountry","type","text","name","Identity.Country",1,"form-control",3,"ngModel","disabled","ngModelChange"],[1,"mt-4"],[1,"col-5"],["for","organizationId"],["id","organizationId","name","OrganizationId",1,"form-control",3,"ngModel","disabled","ngModelChange","change"],["class","form-check",4,"ngFor","ngForOf"],[1,"form-check"],["type","checkbox",1,"form-check-input",3,"ngModel","id","name","disabled","ngModelChange"],[1,"form-check-label",3,"for"],[1,"small","text-muted","mt-4"],[1,"font-weight-semibold"],["class","ml-3",4,"ngIf"],["href","#","appStopClick","",3,"title","click"],[1,"ml-3"],[4,"ngFor","ngForOf"],[1,"password-wrapper","text-monospace","ml-2"],["type","checkbox","id","passwordPrompt","name","passwordPrompt",1,"form-check-input",3,"ngModel","disabled","change"],["for","passwordPrompt",1,"form-check-label"],["target","_blank","rel","noopener","href","https://bitwarden.com/help/article/managing-items/#protect-individual-items",3,"appA11yTitle"],["type","submit",1,"btn","btn-primary","btn-submit",3,"disabled"],["aria-hidden","true",1,"fa","fa-spinner","fa-spin",3,"title"],[1,"ml-auto"],["type","button","class","btn btn-link",3,"appA11yTitle","click",4,"ngIf"],["type","button","class","btn btn-outline-danger",3,"appA11yTitle","disabled","appApiAction","click",4,"ngIf"],["type","button",1,"btn","btn-outline-danger",3,"appA11yTitle","disabled","appApiAction","click"],["deleteBtn",""],["aria-hidden","true",1,"fa","fa-trash-o","fa-lg","fa-fw",3,"hidden"],["aria-hidden","true",1,"fa","fa-spinner","fa-spin","fa-lg","fa-fw",3,"hidden","title"]],template:function(e,t){1&e&&(u.ɵɵelementStart(0,"div",0),u.ɵɵtext(1," "),u.ɵɵelementStart(2,"div",1),u.ɵɵtext(3," "),u.ɵɵelementStart(4,"form",2,3),u.ɵɵlistener("ngSubmit",(function(){return t.submit()})),u.ɵɵtext(6," "),u.ɵɵelementStart(7,"div",4),u.ɵɵtext(8," "),u.ɵɵelementStart(9,"h2",5),u.ɵɵtext(10),u.ɵɵelementEnd(),u.ɵɵtext(11," "),u.ɵɵelementStart(12,"button",6),u.ɵɵpipe(13,"i18n"),u.ɵɵtext(14," "),u.ɵɵelementStart(15,"span",7),u.ɵɵtext(16,"×"),u.ɵɵelementEnd(),u.ɵɵtext(17," "),u.ɵɵelementEnd(),u.ɵɵtext(18," "),u.ɵɵelementEnd(),u.ɵɵtext(19," "),u.ɵɵtemplate(20,be,45,24,"div",8),u.ɵɵtext(21," "),u.ɵɵelementStart(22,"div",9),u.ɵɵtext(23," "),u.ɵɵtemplate(24,we,9,7,"button",10),u.ɵɵtext(25," "),u.ɵɵelementStart(26,"button",11),u.ɵɵtext(27),u.ɵɵpipe(28,"i18n"),u.ɵɵelementEnd(),u.ɵɵtext(29," "),u.ɵɵtemplate(30,Pe,6,2,"div",12),u.ɵɵtext(31," "),u.ɵɵelementEnd(),u.ɵɵtext(32," "),u.ɵɵelementEnd(),u.ɵɵtext(33," "),u.ɵɵelementEnd(),u.ɵɵtext(34," "),u.ɵɵelementEnd(),u.ɵɵtext(35," ")),2&e&&(u.ɵɵadvance(4),u.ɵɵproperty("appApiAction",t.formPromise),u.ɵɵadvance(6),u.ɵɵtextInterpolate(t.title),u.ɵɵadvance(2),u.ɵɵpropertyInterpolate("appA11yTitle",u.ɵɵpipeBind1(13,7,"close")),u.ɵɵadvance(8),u.ɵɵproperty("ngIf",t.cipher),u.ɵɵadvance(4),u.ɵɵproperty("ngIf",!t.viewOnly),u.ɵɵadvance(3),u.ɵɵtextInterpolate1(" ",u.ɵɵpipeBind1(28,9,t.viewOnly?"close":"cancel")," "),u.ɵɵadvance(3),u.ɵɵproperty("ngIf",t.cipher&&!t.viewOnly))},directives:[k.NgControlStatusGroup,k.NgForm,O.ApiActionDirective,_.A11yTitleDirective,A.NgIf,k.DefaultValueAccessor,k.RequiredValidator,k.NgControlStatus,k.NgModel,T.AddEditCustomFieldsComponent,M.CalloutComponent,k.SelectControlValueAccessor,D.AutofocusDirective,A.NgForOf,k.NgSelectOption,k.ɵangular_packages_forms_forms_z,R.InputVerbatimDirective,A.NgClass,B.StopClickDirective,A.NgStyle,k.CheckboxControlValueAccessor],pipes:[j.I18nPipe,A.DatePipe],encapsulation:2}),t}(p.AddEditComponent);t.AddEditComponent=ke,("undefined"==typeof ngDevMode||ngDevMode)&&u.ɵsetClassMetadata(ke,[{type:s.Component,args:[{selector:"app-vault-add-edit",templateUrl:"add-edit.component.html"}]}],(function(){return[{type:d.CipherService},{type:m.FolderService},{type:f.I18nService},{type:h.PlatformUtilsService},{type:v.AuditService},{type:y.StateService},{type:g.UserService},{type:x.CollectionService},{type:S.TotpService},{type:b.PasswordGenerationService},{type:w.MessagingService},{type:C.EventService},{type:I.PolicyService},{type:E.PasswordRepromptService},{type:P.LogService}]}),null)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ImportService=void 0;var r=function(){};t.ImportService=r},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]this.pageSize&&(t=this.pagedCiphersCount),this.ciphers.length>e&&(this.pagedCiphers=this.pagedCiphers.concat(this.ciphers.slice(e,e+t))),this.pagedCiphersCount=this.pagedCiphers.length,this.didScroll=this.pagedCiphers.length>this.pageSize}},t.prototype.refresh=function(){return o(this,void 0,void 0,(function(){return a(this,(function(e){switch(e.label){case 0:return e.trys.push([0,,2,3]),this.refreshing=!0,[4,this.reload(this.filter,this.deleted)];case 1:return e.sent(),[3,3];case 2:return this.refreshing=!1,[7];case 3:return[2]}}))}))},t.prototype.isPaging=function(){var e=this.isSearching();return e&&this.didScroll&&this.resetPaging(),!e&&this.ciphers.length>this.pageSize},t.prototype.resetPaging=function(){return o(this,void 0,void 0,(function(){return a(this,(function(e){return this.pagedCiphers=[],this.loadMore(),[2]}))}))},t.prototype.doSearch=function(e){return o(this,void 0,void 0,(function(){var t;return a(this,(function(n){switch(n.label){case 0:return t=this,[4,this.searchService.searchCiphers(this.searchText,[this.filter,this.deletedFilter],e)];case 1:return t.ciphers=n.sent(),this.resetPaging(),[2]}}))}))},t.prototype.launch=function(e){this.platformUtilsService.launchUri(e)},t.prototype.attachments=function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){switch(t.label){case 0:return[4,this.repromptCipher(e)];case 1:return t.sent()?(this.onAttachmentsClicked.emit(e),[2]):[2]}}))}))},t.prototype.share=function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){switch(t.label){case 0:return[4,this.repromptCipher(e)];case 1:return t.sent()?(this.onShareClicked.emit(e),[2]):[2]}}))}))},t.prototype.collections=function(e){this.onCollectionsClicked.emit(e)},t.prototype.clone=function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){switch(t.label){case 0:return[4,this.repromptCipher(e)];case 1:return t.sent()?(this.onCloneClicked.emit(e),[2]):[2]}}))}))},t.prototype.delete=function(e){return o(this,void 0,void 0,(function(){var t,n;return a(this,(function(r){switch(r.label){case 0:return[4,this.repromptCipher(e)];case 1:return r.sent()?null!=this.actionPromise?[2]:(t=e.isDeleted,[4,this.platformUtilsService.showDialog(this.i18nService.t(t?"permanentlyDeleteItemConfirmation":"deleteItemConfirmation"),this.i18nService.t(t?"permanentlyDeleteItem":"deleteItem"),this.i18nService.t("yes"),this.i18nService.t("no"),"warning")]):[2];case 2:if(!r.sent())return[2,!1];r.label=3;case 3:return r.trys.push([3,5,,6]),this.actionPromise=this.deleteCipher(e.id,t),[4,this.actionPromise];case 4:return r.sent(),this.toasterService.popAsync("success",null,this.i18nService.t(t?"permanentlyDeletedItem":"deletedItem")),this.refresh(),[3,6];case 5:return n=r.sent(),this.logService.error(n),[3,6];case 6:return this.actionPromise=null,[2]}}))}))},t.prototype.restore=function(e){return o(this,void 0,void 0,(function(){var t;return a(this,(function(n){switch(n.label){case 0:return null==this.actionPromise&&e.isDeleted?[4,this.platformUtilsService.showDialog(this.i18nService.t("restoreItemConfirmation"),this.i18nService.t("restoreItem"),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.actionPromise=this.cipherService.restoreWithServer(e.id),[4,this.actionPromise];case 3:return n.sent(),this.toasterService.popAsync("success",null,this.i18nService.t("restoredItem")),this.refresh(),[3,5];case 4:return t=n.sent(),this.logService.error(t),[3,5];case 5:return this.actionPromise=null,[2]}}))}))},t.prototype.copy=function(e,t,n,r){return o(this,void 0,void 0,(function(){var i;return a(this,(function(o){switch(o.label){case 0:return(i=this.passwordRepromptService.protectedFields().includes(r))?[4,this.repromptCipher(e)]:[3,2];case 1:i=!o.sent(),o.label=2;case 2:return i||(null==t||"TOTP"===r&&!this.displayTotpCopyButton(e))?[2]:[3,3];case 3:return t!==e.login.totp?[3,5]:[4,this.totpService.getCode(t)];case 4:t=o.sent(),o.label=5;case 5:return e.viewPassword?(this.platformUtilsService.copyToClipboard(t,{window:window}),this.toasterService.popAsync("info",null,this.i18nService.t("valueCopied",this.i18nService.t(n))),"password"===n||"verificationCodeTotp"===n?this.eventService.collect(u.EventType.Cipher_ClientToggledHiddenFieldVisible,e.id):"securityCode"===n&&this.eventService.collect(u.EventType.Cipher_ClientCopiedCardCode,e.id),[2]):[2]}}))}))},t.prototype.selectAll=function(e){e&&this.selectAll(!1);for(var t=e&&this.ciphers.length>500?500:this.ciphers.length,n=0;n0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0?this.events=this.events.concat(s):this.events=s,this.loading=!1,this.morePromise=null,this.refreshPromise=null,[2]}}))}))},e.ɵfac=function(t){return new(t||e)(a.ɵɵdirectiveInject(s.ApiService),a.ɵɵdirectiveInject(l.I18nService),a.ɵɵdirectiveInject(c.EventService),a.ɵɵdirectiveInject(p.ToasterService),a.ɵɵdirectiveInject(u.UserNamePipe),a.ɵɵdirectiveInject(d.LogService))},e.ɵcmp=a.ɵɵdefineComponent({type:e,selectors:[["app-entity-events"]],inputs:{name:"name",entity:"entity",entityId:"entityId",organizationId:"organizationId",providerId:"providerId",showUser:"showUser"},decls:36,vars:12,consts:[["role","dialog","aria-modal","true","aria-labelledby","eventLogsTitle",1,"modal","fade"],["role","document",1,"modal-dialog","modal-dialog-scrollable","modal-lg"],[1,"modal-content"],[1,"modal-header"],["id","eventLogsTitle",1,"modal-title"],["class","text-muted",4,"ngIf"],["type","button","data-dismiss","modal",1,"close",3,"appA11yTitle"],["aria-hidden","true"],["class","modal-body",4,"ngIf"],[1,"modal-footer"],["type","button","data-dismiss","modal",1,"btn","btn-outline-secondary"],[1,"text-muted"],[1,"modal-body"],["aria-hidden","true",1,"fa","fa-spinner","fa-spin","text-muted",3,"title"],[1,"sr-only"],[1,"d-flex"],[1,"form-inline"],["for","start",1,"sr-only"],["type","datetime-local","id","start","placeholder","YYYY-MM-DDTHH:MM",1,"form-control","form-control-sm",3,"placeholder","ngModel","ngModelChange"],[1,"mx-2"],["for","end",1,"sr-only"],["type","datetime-local","id","end","placeholder","YYYY-MM-DDTHH:MM",1,"form-control","form-control-sm",3,"placeholder","ngModel","ngModelChange"],["type","button",1,"btn","btn-sm","btn-outline-primary","ml-3",3,"appApiAction","disabled","click"],["refreshBtn",""],["aria-hidden","true",1,"fa","fa-refresh","fa-fw",3,"ngClass"],[4,"ngIf"],["class","table table-hover mb-0",4,"ngIf"],["type","button","class","btn btn-block btn-link btn-submit",3,"appApiAction","disabled","click",4,"ngIf"],[1,"table","table-hover","mb-0"],["width","210",1,"border-top-0"],["width","40",1,"border-top-0"],["class","border-top-0","width","150",4,"ngIf"],[1,"border-top-0"],[4,"ngFor","ngForOf"],["width","150",1,"border-top-0"],["aria-hidden","true",3,"title"],[3,"innerHTML"],[3,"appA11yTitle"],["type","button",1,"btn","btn-block","btn-link","btn-submit",3,"appApiAction","disabled","click"],["moreBtn",""],["aria-hidden","true",1,"fa","fa-spinner","fa-spin",3,"title"]],template:function(e,t){1&e&&(a.ɵɵelementStart(0,"div",0),a.ɵɵtext(1," "),a.ɵɵelementStart(2,"div",1),a.ɵɵtext(3," "),a.ɵɵelementStart(4,"div",2),a.ɵɵtext(5," "),a.ɵɵelementStart(6,"div",3),a.ɵɵtext(7," "),a.ɵɵelementStart(8,"h2",4),a.ɵɵtext(9),a.ɵɵpipe(10,"i18n"),a.ɵɵtemplate(11,g,2,1,"small",5),a.ɵɵtext(12," "),a.ɵɵelementEnd(),a.ɵɵtext(13," "),a.ɵɵelementStart(14,"button",6),a.ɵɵpipe(15,"i18n"),a.ɵɵtext(16," "),a.ɵɵelementStart(17,"span",7),a.ɵɵtext(18,"×"),a.ɵɵelementEnd(),a.ɵɵtext(19," "),a.ɵɵelementEnd(),a.ɵɵtext(20," "),a.ɵɵelementEnd(),a.ɵɵtext(21," "),a.ɵɵtemplate(22,x,9,6,"div",8),a.ɵɵtext(23," "),a.ɵɵtemplate(24,k,40,25,"div",8),a.ɵɵtext(25," "),a.ɵɵelementStart(26,"div",9),a.ɵɵtext(27," "),a.ɵɵelementStart(28,"button",10),a.ɵɵtext(29),a.ɵɵpipe(30,"i18n"),a.ɵɵelementEnd(),a.ɵɵtext(31," "),a.ɵɵelementEnd(),a.ɵɵtext(32," "),a.ɵɵelementEnd(),a.ɵɵtext(33," "),a.ɵɵelementEnd(),a.ɵɵtext(34," "),a.ɵɵelementEnd(),a.ɵɵtext(35," ")),2&e&&(a.ɵɵadvance(9),a.ɵɵtextInterpolate1(" ",a.ɵɵpipeBind1(10,6,"eventLogs")," "),a.ɵɵadvance(2),a.ɵɵproperty("ngIf",t.name),a.ɵɵadvance(3),a.ɵɵpropertyInterpolate("appA11yTitle",a.ɵɵpipeBind1(15,8,"close")),a.ɵɵadvance(8),a.ɵɵproperty("ngIf",!t.loaded),a.ɵɵadvance(2),a.ɵɵproperty("ngIf",t.loaded),a.ɵɵadvance(5),a.ɵɵtextInterpolate(a.ɵɵpipeBind1(30,10,"close")))},directives:[m.NgIf,f.A11yTitleDirective,h.DefaultValueAccessor,h.NgControlStatus,h.NgModel,v.ApiActionDirective,m.NgClass,m.NgForOf],pipes:[y.I18nPipe,m.DatePipe],encapsulation:2}),e}();t.EntityEventsComponent=O,("undefined"==typeof ngDevMode||ngDevMode)&&a.ɵsetClassMetadata(O,[{type:o.Component,args:[{selector:"app-entity-events",templateUrl:"entity-events.component.html"}]}],(function(){return[{type:s.ApiService},{type:l.I18nService},{type:c.EventService},{type:p.ToasterService},{type:u.UserNamePipe},{type:d.LogService}]}),{name:[{type:o.Input}],entity:[{type:o.Input}],entityId:[{type:o.Input}],organizationId:[{type:o.Input}],providerId:[{type:o.Input}],showUser:[{type:o.Input}]})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OrganizationUserResetPasswordEnrollmentRequest=void 0;var r=function(){};t.OrganizationUserResetPasswordEnrollmentRequest=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HashPurpose=void 0,function(e){e[e.ServerAuthorization=1]="ServerAuthorization",e[e.LocalAuthorization=2]="LocalAuthorization"}(t.HashPurpose||(t.HashPurpose={}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PolicyData=void 0;var r=function(e){this.id=e.id,this.organizationId=e.organizationId,this.type=e.type,this.data=e.data,this.enabled=e.enabled};t.PolicyData=r},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]-1&&(e=e.concat(this.email.substr(0,t).trim().toLowerCase().split(/[^A-Za-z0-9]/))),e},e.ɵfac=function(t){return new(t||e)(a.ɵɵdirectiveInject(s.I18nService),a.ɵɵdirectiveInject(l.CryptoService),a.ɵɵdirectiveInject(c.MessagingService),a.ɵɵdirectiveInject(p.UserService),a.ɵɵdirectiveInject(u.PasswordGenerationService),a.ɵɵdirectiveInject(d.PlatformUtilsService),a.ɵɵdirectiveInject(m.PolicyService))},e.ɵdir=a.ɵɵdefineDirective({type:e}),e}();t.ChangePasswordComponent=f,("undefined"==typeof ngDevMode||ngDevMode)&&a.ɵsetClassMetadata(f,[{type:o.Directive}],(function(){return[{type:s.I18nService},{type:l.CryptoService},{type:c.MessagingService},{type:p.UserService},{type:u.PasswordGenerationService},{type:d.PlatformUtilsService},{type:m.PolicyService}]}),null)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SelectionReadOnlyRequest=void 0;var r=function(e,t,n){this.id=e,this.readOnly=t,this.hidePasswords=n};t.SelectionReadOnlyRequest=r},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.PolicyResponse=void 0;var o=function(e){function t(t){var n=e.call(this,t)||this;return n.id=n.getResponseProperty("Id"),n.organizationId=n.getResponseProperty("OrganizationId"),n.type=n.getResponseProperty("Type"),n.data=n.getResponseProperty("Data"),n.enabled=n.getResponseProperty("Enabled"),n}return i(t,e),t}(n(26).BaseResponse);t.PolicyResponse=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ItemView=void 0;var r=function(){};t.ItemView=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LoginUriView=void 0;var r=n(317),i=n(28),o=["https://","http://","ssh://","ftp://","sftp://","irc://","vnc://","rdp://","ms-rd:","chrome://","iosapp://","androidapp://"],a=function(){function e(e){this.match=null,this._uri=null,this._domain=null,this._hostname=null,this._host=null,this._canLaunch=null,e&&(this.match=e.match)}return Object.defineProperty(e.prototype,"uri",{get:function(){return this._uri},set:function(e){this._uri=e,this._domain=null,this._canLaunch=null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"domain",{get:function(){return null==this._domain&&null!=this.uri&&(this._domain=i.Utils.getDomain(this.uri),""===this._domain&&(this._domain=null)),this._domain},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hostname",{get:function(){return this.match===r.UriMatchType.RegularExpression?null:(null==this._hostname&&null!=this.uri&&(this._hostname=i.Utils.getHostname(this.uri),""===this._hostname&&(this._hostname=null)),this._hostname)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"host",{get:function(){return this.match===r.UriMatchType.RegularExpression?null:(null==this._host&&null!=this.uri&&(this._host=i.Utils.getHost(this.uri),""===this._host&&(this._host=null)),this._host)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hostnameOrUri",{get:function(){return null!=this.hostname?this.hostname:this.uri},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hostOrUri",{get:function(){return null!=this.host?this.host:this.uri},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isWebsite",{get:function(){return null!=this.uri&&(0===this.uri.indexOf("http://")||0===this.uri.indexOf("https://")||this.uri.indexOf("://")<0&&i.Utils.tldEndingRegex.test(this.uri))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"canLaunch",{get:function(){if(null!=this._canLaunch)return this._canLaunch;if(null!=this.uri&&this.match!==r.UriMatchType.RegularExpression)for(var e=this.launchUri,t=0;t0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&!n.error),s.ɵɵadvance(9),s.ɵɵtextInterpolate(s.ɵɵpipeBind1(12,3,"user")),s.ɵɵadvance(5),s.ɵɵproperty("ngForOf",n.users)}}function w(e,t){if(1&e&&(s.ɵɵelementStart(0,"small",24),s.ɵɵtext(1),s.ɵɵelementEnd()),2&e){var n=s.ɵɵnextContext().$implicit;s.ɵɵadvance(1),s.ɵɵtextInterpolate(n.name)}}function C(e,t){if(1&e&&(s.ɵɵelementStart(0,"td"),s.ɵɵtext(1),s.ɵɵelementEnd()),2&e){var n=s.ɵɵnextContext().$implicit,r=s.ɵɵnextContext(2);s.ɵɵadvance(1),s.ɵɵtextInterpolate1(" ",r.statuses.get(n.id)," ")}}function I(e,t){1&e&&(s.ɵɵelementStart(0,"td"),s.ɵɵtext(1),s.ɵɵpipe(2,"i18n"),s.ɵɵelementEnd()),2&e&&(s.ɵɵadvance(1),s.ɵɵtextInterpolate1(" ",s.ɵɵpipeBind1(2,1,"bulkFilteredMessage")," "))}function E(e,t){if(1&e&&(s.ɵɵelementStart(0,"tr"),s.ɵɵtext(1," "),s.ɵɵelementStart(2,"td",21),s.ɵɵtext(3," "),s.ɵɵelement(4,"app-avatar",22),s.ɵɵpipe(5,"userName"),s.ɵɵtext(6," "),s.ɵɵelementEnd(),s.ɵɵtext(7," "),s.ɵɵelementStart(8,"td"),s.ɵɵtext(9),s.ɵɵtemplate(10,w,2,1,"small",23),s.ɵɵtext(11," "),s.ɵɵelementEnd(),s.ɵɵtext(12," "),s.ɵɵtemplate(13,C,2,1,"td",10),s.ɵɵtext(14," "),s.ɵɵtemplate(15,I,3,3,"td",10),s.ɵɵtext(16," "),s.ɵɵelementEnd()),2&e){var n=t.$implicit,r=s.ɵɵnextContext(2);s.ɵɵadvance(4),s.ɵɵproperty("data",s.ɵɵpipeBind1(5,8,n))("email",n.email)("circle",!0)("fontSize",14),s.ɵɵadvance(5),s.ɵɵtextInterpolate1(" ",n.email," "),s.ɵɵadvance(1),s.ɵɵproperty("ngIf",n.name),s.ɵɵadvance(3),s.ɵɵproperty("ngIf",r.statuses.has(n.id)),s.ɵɵadvance(2),s.ɵɵproperty("ngIf",!r.statuses.has(n.id))}}function P(e,t){if(1&e&&(s.ɵɵelementContainerStart(0),s.ɵɵtext(1," "),s.ɵɵelementStart(2,"table",17),s.ɵɵtext(3," "),s.ɵɵelementStart(4,"thead"),s.ɵɵtext(5," "),s.ɵɵelementStart(6,"tr"),s.ɵɵtext(7," "),s.ɵɵelementStart(8,"th",18),s.ɵɵtext(9),s.ɵɵpipe(10,"i18n"),s.ɵɵelementEnd(),s.ɵɵtext(11," "),s.ɵɵelementStart(12,"th"),s.ɵɵtext(13),s.ɵɵpipe(14,"i18n"),s.ɵɵelementEnd(),s.ɵɵtext(15," "),s.ɵɵelementEnd(),s.ɵɵtext(16," "),s.ɵɵelementEnd(),s.ɵɵtext(17," "),s.ɵɵtemplate(18,E,17,10,"tr",19),s.ɵɵtext(19," "),s.ɵɵelementEnd(),s.ɵɵtext(20," "),s.ɵɵelementContainerEnd()),2&e){var n=s.ɵɵnextContext();s.ɵɵadvance(9),s.ɵɵtextInterpolate(s.ɵɵpipeBind1(10,3,"user")),s.ɵɵadvance(4),s.ɵɵtextInterpolate(s.ɵɵpipeBind1(14,5,"status")),s.ɵɵadvance(5),s.ɵɵproperty("ngForOf",n.users)}}function k(e,t){if(1&e){var n=s.ɵɵgetCurrentView();s.ɵɵelementStart(0,"button",25),s.ɵɵlistener("click",(function(){return s.ɵɵrestoreView(n),s.ɵɵnextContext().submit()})),s.ɵɵtext(1," "),s.ɵɵelement(2,"i",26),s.ɵɵpipe(3,"i18n"),s.ɵɵtext(4," "),s.ɵɵelementStart(5,"span"),s.ɵɵtext(6),s.ɵɵpipe(7,"i18n"),s.ɵɵelementEnd(),s.ɵɵtext(8," "),s.ɵɵelementEnd()}if(2&e){var r=s.ɵɵnextContext();s.ɵɵproperty("disabled",r.loading),s.ɵɵadvance(2),s.ɵɵpropertyInterpolate("title",s.ɵɵpipeBind1(3,3,"loading")),s.ɵɵadvance(4),s.ɵɵtextInterpolate(s.ɵɵpipeBind1(7,5,"removeUsers"))}}var O=function(){function e(e,t){this.apiService=e,this.i18nService=t,this.statuses=new Map,this.loading=!1,this.done=!1}return e.prototype.submit=function(){return r(this,void 0,void 0,(function(){var e,t=this;return i(this,(function(n){switch(n.label){case 0:this.loading=!0,n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this.deleteUsers()];case 2:return n.sent().data.forEach((function(e){var n=""!==e.error?e.error:t.i18nService.t("bulkRemovedMessage");t.statuses.set(e.id,n)})),this.done=!0,[3,4];case 3:return e=n.sent(),this.error=e.message,[3,4];case 4:return this.loading=!1,[2]}}))}))},e.prototype.deleteUsers=function(){return r(this,void 0,void 0,(function(){var e;return i(this,(function(t){switch(t.label){case 0:return e=new a.OrganizationUserBulkRequest(this.users.map((function(e){return e.id}))),[4,this.apiService.deleteManyOrganizationUsers(this.organizationId,e)];case 1:return[2,t.sent()]}}))}))},e.ɵfac=function(t){return new(t||e)(s.ɵɵdirectiveInject(l.ApiService),s.ɵɵdirectiveInject(c.I18nService))},e.ɵcmp=s.ɵɵdefineComponent({type:e,selectors:[["app-bulk-remove"]],inputs:{organizationId:"organizationId",users:"users"},decls:43,vars:14,consts:[["role","dialog","aria-modal","true","aria-labelledby","bulkTitle",1,"modal","fade"],["role","document",1,"modal-dialog","modal-dialog-scrollable","modal-lg"],[1,"modal-content"],[1,"modal-header"],["id","bulkTitle",1,"modal-title"],["type","button","data-dismiss","modal",1,"close",3,"appA11yTitle"],["aria-hidden","true"],[1,"modal-body"],["type","danger",4,"ngIf"],["type","error",4,"ngIf"],[4,"ngIf"],[1,"modal-footer"],["type","submit","class","btn btn-primary btn-submit",3,"disabled","click",4,"ngIf"],["type","button","data-dismiss","modal",1,"btn","btn-outline-secondary"],["type","danger"],["type","error"],["type","warning",4,"ngIf"],[1,"table","table-hover","table-list"],["colspan","2"],[4,"ngFor","ngForOf"],["type","warning"],["width","30"],["size","25",3,"data","email","circle","fontSize"],["class","text-muted d-block",4,"ngIf"],[1,"text-muted","d-block"],["type","submit",1,"btn","btn-primary","btn-submit",3,"disabled","click"],["aria-hidden","true",1,"fa","fa-spinner","fa-spin",3,"title"]],template:function(e,t){1&e&&(s.ɵɵelementStart(0,"div",0),s.ɵɵtext(1," "),s.ɵɵelementStart(2,"div",1),s.ɵɵtext(3," "),s.ɵɵelementStart(4,"div",2),s.ɵɵtext(5," "),s.ɵɵelementStart(6,"div",3),s.ɵɵtext(7," "),s.ɵɵelementStart(8,"h2",4),s.ɵɵtext(9),s.ɵɵpipe(10,"i18n"),s.ɵɵelementEnd(),s.ɵɵtext(11," "),s.ɵɵelementStart(12,"button",5),s.ɵɵpipe(13,"i18n"),s.ɵɵtext(14," "),s.ɵɵelementStart(15,"span",6),s.ɵɵtext(16,"×"),s.ɵɵelementEnd(),s.ɵɵtext(17," "),s.ɵɵelementEnd(),s.ɵɵtext(18," "),s.ɵɵelementEnd(),s.ɵɵtext(19," "),s.ɵɵelementStart(20,"div",7),s.ɵɵtext(21," "),s.ɵɵtemplate(22,v,3,3,"app-callout",8),s.ɵɵtext(23," "),s.ɵɵtemplate(24,y,2,1,"app-callout",9),s.ɵɵtext(25," "),s.ɵɵtemplate(26,b,19,5,"ng-container",10),s.ɵɵtext(27," "),s.ɵɵtemplate(28,P,21,7,"ng-container",10),s.ɵɵtext(29," "),s.ɵɵelementEnd(),s.ɵɵtext(30," "),s.ɵɵelementStart(31,"div",11),s.ɵɵtext(32," "),s.ɵɵtemplate(33,k,9,7,"button",12),s.ɵɵtext(34," "),s.ɵɵelementStart(35,"button",13),s.ɵɵtext(36),s.ɵɵpipe(37,"i18n"),s.ɵɵelementEnd(),s.ɵɵtext(38," "),s.ɵɵelementEnd(),s.ɵɵtext(39," "),s.ɵɵelementEnd(),s.ɵɵtext(40," "),s.ɵɵelementEnd(),s.ɵɵtext(41," "),s.ɵɵelementEnd(),s.ɵɵtext(42," ")),2&e&&(s.ɵɵadvance(9),s.ɵɵtextInterpolate1(" ",s.ɵɵpipeBind1(10,8,"removeUsers")," "),s.ɵɵadvance(3),s.ɵɵpropertyInterpolate("appA11yTitle",s.ɵɵpipeBind1(13,10,"close")),s.ɵɵadvance(10),s.ɵɵproperty("ngIf",t.users.length<=0),s.ɵɵadvance(2),s.ɵɵproperty("ngIf",t.error),s.ɵɵadvance(2),s.ɵɵproperty("ngIf",!t.done),s.ɵɵadvance(2),s.ɵɵproperty("ngIf",t.done),s.ɵɵadvance(5),s.ɵɵproperty("ngIf",!t.done&&t.users.length>0),s.ɵɵadvance(3),s.ɵɵtextInterpolate(s.ɵɵpipeBind1(37,12,"close")))},directives:[p.A11yTitleDirective,u.NgIf,d.CalloutComponent,u.NgForOf,m.AvatarComponent],pipes:[f.I18nPipe,h.UserNamePipe],encapsulation:2}),e}();t.BulkRemoveComponent=O,("undefined"==typeof ngDevMode||ngDevMode)&&s.ɵsetClassMetadata(O,[{type:o.Component,args:[{selector:"app-bulk-remove",templateUrl:"bulk-remove.component.html"}]}],(function(){return[{type:l.ApiService},{type:c.I18nService}]}),{organizationId:[{type:o.Input}],users:[{type:o.Input}]})},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]r){if(o===s.TwoFactorProviderType.WebAuthn&&!e)return;n=o,r=a.priority}})),n},e.prototype.makePreloginKey=function(e,t){return i(this,void 0,void 0,(function(){var n,r,i,a;return o(this,(function(o){switch(o.label){case 0:t=t.trim().toLowerCase(),n=null,r=null,o.label=1;case 1:return o.trys.push([1,3,,4]),[4,this.apiService.postPrelogin(new m.PreloginRequest(t))];case 2:return null!=(i=o.sent())&&(n=i.kdf,r=i.kdfIterations),[3,4];case 3:if(null==(a=o.sent())||404!==a.statusCode)throw a;return[3,4];case 4:return[2,this.cryptoService.makeKey(e,t,n,r)]}}))}))},e.prototype.authingWithApiKey=function(){return null!=this.clientId&&null!=this.clientSecret},e.prototype.authingWithSso=function(){return null!=this.code&&null!=this.codeVerifier&&null!=this.ssoRedirectUrl},e.prototype.authingWithPassword=function(){return null!=this.email&&null!=this.masterPasswordHash},e.prototype.logInHelper=function(e,t,n,r,a,m,v,y,g,x,S,b,w,C){return i(this,void 0,void 0,(function(){var i,I,E,P,k,O,_,A,T,M,D,R,B,j,U,V,F,N,z,L,K,q,G;return o(this,(function(o){switch(o.label){case 0:return[4,this.tokenService.getTwoFactorToken(e)];case 1:return i=o.sent(),[4,this.appIdService.getAppId()];case 2:return I=o.sent(),E=new p.DeviceRequest(I,this.platformUtilsService),P=[],k=[],O=[null,null],P=null!=e&&null!=t?[e,t]:null,k=null!=r&&null!=a&&null!=m?[r,a,m]:null,O=null!=v&&null!=y?[v,y]:null,_=null!=S&&null!=x?new f.TokenRequest(P,k,O,x,S,b,w,E):null!=i?new f.TokenRequest(P,k,O,s.TwoFactorProviderType.Remember,i,!1,w,E):new f.TokenRequest(P,k,O,null,null,!1,w,E),[4,this.apiService.postIdentityToken(_)];case 3:return A=o.sent(),this.clearState(),(T=new l.AuthResult).captchaSiteKey=A.siteKey,T.captchaSiteKey?[2,T]:(T.twoFactor=!!A.twoFactorProviders2,T.twoFactor?(this.email=e,this.masterPasswordHash=t,this.localMasterPasswordHash=n,this.code=r,this.codeVerifier=a,this.ssoRedirectUrl=m,this.clientId=v,this.clientSecret=y,this.key=this.setCryptoKeys?g:null,M=A,this.twoFactorProvidersData=M.twoFactorProviders2,T.twoFactorProviders=M.twoFactorProviders2,this.captchaToken=M.captchaToken,[2,T]):(D=A,T.resetMasterPassword=D.resetMasterPassword,T.forcePasswordReset=D.forcePasswordReset,null==D.twoFactorToken?[3,5]:[4,this.tokenService.setTwoFactorToken(D.twoFactorToken,e)]));case 4:o.sent(),o.label=5;case 5:return[4,this.tokenService.setTokens(D.accessToken,D.refreshToken,O)];case 6:return o.sent(),[4,this.userService.setInformation(this.tokenService.getUserId(),this.tokenService.getEmail(),D.kdf,D.kdfIterations)];case 7:return o.sent(),this.setCryptoKeys?null==g?[3,9]:[4,this.cryptoService.setKey(g)]:[3,35];case 8:o.sent(),o.label=9;case 9:return null==n?[3,11]:[4,this.cryptoService.setKeyHash(n)];case 10:o.sent(),o.label=11;case 11:return null!=r&&null==D.key?[3,23]:null==D.keyConnectorUrl?[3,13]:[4,this.keyConnectorService.getAndSetKey(D.keyConnectorUrl)];case 12:return o.sent(),[3,15];case 13:return D.apiUseKeyConnector?(R=this.environmentService.getKeyConnectorUrl(),[4,this.keyConnectorService.getAndSetKey(R)]):[3,15];case 14:o.sent(),o.label=15;case 15:return[4,this.cryptoService.setEncKey(D.key)];case 16:if(o.sent(),null!=D.privateKey)return[3,21];o.label=17;case 17:return o.trys.push([17,20,,21]),[4,this.cryptoService.makeKeyPair()];case 18:return B=o.sent(),[4,this.apiService.postAccountKeys(new d.KeysRequest(B[0],B[1].encryptedString))];case 19:return o.sent(),D.privateKey=B[1].encryptedString,[3,21];case 20:return j=o.sent(),this.logService.error(j),[3,21];case 21:return[4,this.cryptoService.setEncPrivateKey(D.privateKey)];case 22:return o.sent(),[3,35];case 23:return null==D.keyConnectorUrl?[3,35]:[4,this.cryptoFunctionService.randomBytes(64)];case 24:return U=o.sent(),[4,this.cryptoService.makeKey(h.Utils.fromBufferToB64(U),this.tokenService.getEmail(),D.kdf,D.kdfIterations)];case 25:return V=o.sent(),F=new u.KeyConnectorUserKeyRequest(V.encKeyB64),[4,this.cryptoService.setKey(V)];case 26:return o.sent(),[4,this.cryptoService.makeEncKey(V)];case 27:return N=o.sent(),[4,this.cryptoService.setEncKey(N[1].encryptedString)];case 28:return o.sent(),[4,this.cryptoService.makeKeyPair()];case 29:z=o.sent(),L=z[0],K=z[1],o.label=30;case 30:return o.trys.push([30,32,,33]),[4,this.apiService.postUserKeyToKeyConnector(D.keyConnectorUrl,F)];case 31:return o.sent(),[3,33];case 32:throw o.sent(),new Error("Unable to reach key connector");case 33:return q=new d.KeysRequest(L,K.encryptedString),G=new c.SetKeyConnectorKeyRequest(N[1].encryptedString,D.kdf,D.kdfIterations,C,q),[4,this.apiService.postSetKeyConnectorKey(G)];case 34:o.sent(),o.label=35;case 35:return null!=this.vaultTimeoutService&&(this.vaultTimeoutService.biometricLocked=!1),this.messagingService.send("loggedIn"),[2,T]}}))}))},e.prototype.clearState=function(){this.key=null,this.email=null,this.masterPasswordHash=null,this.localMasterPasswordHash=null,this.code=null,this.codeVerifier=null,this.ssoRedirectUrl=null,this.clientId=null,this.clientSecret=null,this.twoFactorProvidersData=null,this.selectedTwoFactorProviderType=null},e}();t.AuthService=v},,function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&t.forEach((function(t){var n=e.data.filter((function(e){return e.id===t}));null!=n&&n.length>0&&(n[0].checked=!0)})),[3,5];case 3:return"collection"!==this.entity?[3,5]:[4,this.apiService.getCollectionUsers(this.organizationId,this.entityId)];case 4:null!=(t=r.sent())&&e.data.length>0&&t.forEach((function(t){var n=e.data.filter((function(e){return!e.accessAll&&e.id===t.id}));null!=n&&n.length>0&&(n[0].checked=!0,n[0].readOnly=t.readOnly,n[0].hidePasswords=t.hidePasswords)})),r.label=5;case 5:return this.allUsers.forEach((function(e){"collection"===n.entity&&e.accessAll&&(e.checked=!0),e.checked&&n.selectedCount++})),[2]}}))}))},e.prototype.check=function(e){"collection"===this.entity&&e.accessAll||(e.checked=!e.checked,this.selectedChanged(e))},e.prototype.selectedChanged=function(e){e.checked?this.selectedCount++:("collection"===this.entity&&(e.readOnly=!1,e.hidePasswords=!1),this.selectedCount--)},e.prototype.filterSelected=function(e){this.showSelected=e},e.prototype.submit=function(){return r(this,void 0,void 0,(function(){var e,t;return i(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),"group"===this.entity?(e=this.users.filter((function(e){return e.checked})).map((function(e){return e.id})),this.formPromise=this.apiService.putGroupUsers(this.organizationId,this.entityId,e)):(e=this.users.filter((function(e){return e.checked&&!e.accessAll})).map((function(e){return new l.SelectionReadOnlyRequest(e.id,!!e.readOnly,!!e.hidePasswords)})),this.formPromise=this.apiService.putCollectionUsers(this.organizationId,this.entityId,e)),[4,this.formPromise];case 1:return n.sent(),this.toasterService.popAsync("success",null,this.i18nService.t("updatedUsers")),this.onEditedUsers.emit(),[3,3];case 2:return t=n.sent(),this.logService.error(t),[3,3];case 3:return[2]}}))}))},e.ɵfac=function(t){return new(t||e)(p.ɵɵdirectiveInject(u.ApiService),p.ɵɵdirectiveInject(d.I18nService),p.ɵɵdirectiveInject(m.ToasterService),p.ɵɵdirectiveInject(f.LogService))},e.ɵcmp=p.ɵɵdefineComponent({type:e,selectors:[["app-entity-users"]],inputs:{entity:"entity",entityId:"entityId",entityName:"entityName",organizationId:"organizationId"},outputs:{onEditedUsers:"onEditedUsers"},decls:49,vars:29,consts:[["role","dialog","aria-modal","true","aria-labelledby","userAccessTitle",1,"modal","fade"],["role","document",1,"modal-dialog","modal-dialog-scrollable","modal-lg"],["ngNativeValidate","",1,"modal-content",3,"appApiAction","ngSubmit"],["form",""],[1,"modal-header"],["id","userAccessTitle",1,"modal-title"],["type","button","data-dismiss","modal",1,"close",3,"appA11yTitle"],["aria-hidden","true"],["class","modal-body",4,"ngIf"],[1,"modal-footer"],["type","submit",1,"btn","btn-primary","btn-submit",3,"disabled"],["aria-hidden","true",1,"fa","fa-spinner","fa-spin",3,"title"],["type","button","data-dismiss","modal",1,"btn","btn-outline-secondary"],[1,"modal-body"],["aria-hidden","true",1,"fa","fa-spinner","fa-spin","text-muted",3,"title"],[1,"sr-only"],[1,"d-flex"],[1,"mr-3"],["for","search",1,"sr-only"],["type","search","id","search","name","SearchText",1,"form-control","form-control-sm",3,"placeholder","ngModel","ngModelChange"],["role","group",1,"btn-group","btn-group-sm"],["type","button",1,"btn","btn-outline-secondary",3,"ngClass","click"],["class","badge badge-pill badge-info",4,"ngIf"],[4,"ngIf"],[1,"badge","badge-pill","badge-info"],[1,"table","table-hover","table-list","mb-0"],["width","100","class","text-center",4,"ngIf"],[4,"ngFor","ngForOf"],["width","100",1,"text-center"],[1,"table-list-checkbox",3,"click"],["type","checkbox","appStopProp","",3,"ngModel","name","disabled","ngModelChange","change"],["width","30",3,"click"],["size","25",3,"data","email","circle","fontSize"],["class","badge badge-secondary",4,"ngIf"],["class","badge badge-warning",4,"ngIf"],["class","text-muted d-block",4,"ngIf"],["class","text-center",4,"ngIf"],[1,"badge","badge-secondary"],[1,"badge","badge-warning"],[1,"text-muted","d-block"],["aria-hidden","true",1,"fa","fa-th",3,"title"],[1,"text-center"],["type","checkbox",3,"ngModel","name","disabled","ngModelChange"]],template:function(e,t){if(1&e&&(p.ɵɵelementStart(0,"div",0),p.ɵɵtext(1," "),p.ɵɵelementStart(2,"div",1),p.ɵɵtext(3," "),p.ɵɵelementStart(4,"form",2,3),p.ɵɵlistener("ngSubmit",(function(){return t.submit()})),p.ɵɵtext(6," "),p.ɵɵelementStart(7,"div",4),p.ɵɵtext(8," "),p.ɵɵelementStart(9,"h2",5),p.ɵɵtext(10),p.ɵɵpipe(11,"i18n"),p.ɵɵelementStart(12,"small"),p.ɵɵtext(13),p.ɵɵelementEnd(),p.ɵɵtext(14," "),p.ɵɵelementEnd(),p.ɵɵtext(15," "),p.ɵɵelementStart(16,"button",6),p.ɵɵpipe(17,"i18n"),p.ɵɵtext(18," "),p.ɵɵelementStart(19,"span",7),p.ɵɵtext(20,"×"),p.ɵɵelementEnd(),p.ɵɵtext(21," "),p.ɵɵelementEnd(),p.ɵɵtext(22," "),p.ɵɵelementEnd(),p.ɵɵtext(23," "),p.ɵɵtemplate(24,I,9,6,"div",8),p.ɵɵtext(25," "),p.ɵɵtemplate(26,G,32,22,"div",8),p.ɵɵpipe(27,"search"),p.ɵɵtext(28," "),p.ɵɵelementStart(29,"div",9),p.ɵɵtext(30," "),p.ɵɵelementStart(31,"button",10),p.ɵɵtext(32," "),p.ɵɵelement(33,"i",11),p.ɵɵpipe(34,"i18n"),p.ɵɵtext(35," "),p.ɵɵelementStart(36,"span"),p.ɵɵtext(37),p.ɵɵpipe(38,"i18n"),p.ɵɵelementEnd(),p.ɵɵtext(39," "),p.ɵɵelementEnd(),p.ɵɵtext(40," "),p.ɵɵelementStart(41,"button",12),p.ɵɵtext(42),p.ɵɵpipe(43,"i18n"),p.ɵɵelementEnd(),p.ɵɵtext(44," "),p.ɵɵelementEnd(),p.ɵɵtext(45," "),p.ɵɵelementEnd(),p.ɵɵtext(46," "),p.ɵɵelementEnd(),p.ɵɵtext(47," "),p.ɵɵelementEnd(),p.ɵɵtext(48," ")),2&e){var n=p.ɵɵreference(5);p.ɵɵadvance(4),p.ɵɵproperty("appApiAction",t.formPromise),p.ɵɵadvance(6),p.ɵɵtextInterpolate1(" ",p.ɵɵpipeBind1(11,10,"userAccess")," "),p.ɵɵadvance(3),p.ɵɵtextInterpolate(t.entityName),p.ɵɵadvance(3),p.ɵɵpropertyInterpolate("appA11yTitle",p.ɵɵpipeBind1(17,12,"close")),p.ɵɵadvance(8),p.ɵɵproperty("ngIf",t.loading||!t.users),p.ɵɵadvance(2),p.ɵɵproperty("ngIf",!t.loading&&t.users&&p.ɵɵpipeBindV(27,14,p.ɵɵpureFunction2(26,W,t.users,t.searchText))),p.ɵɵadvance(5),p.ɵɵproperty("disabled",n.loading),p.ɵɵadvance(2),p.ɵɵpropertyInterpolate("title",p.ɵɵpipeBind1(34,20,"loading")),p.ɵɵadvance(4),p.ɵɵtextInterpolate(p.ɵɵpipeBind1(38,22,"save")),p.ɵɵadvance(5),p.ɵɵtextInterpolate(p.ɵɵpipeBind1(43,24,"close"))}},directives:[h.NgControlStatusGroup,h.NgForm,v.ApiActionDirective,y.A11yTitleDirective,g.NgIf,h.DefaultValueAccessor,h.NgControlStatus,h.NgModel,g.NgClass,g.NgForOf,h.CheckboxControlValueAccessor,x.StopPropDirective,S.AvatarComponent],pipes:[b.I18nPipe,w.SearchPipe,C.UserNamePipe],encapsulation:2}),e}();t.EntityUsersComponent=H,("undefined"==typeof ngDevMode||ngDevMode)&&p.ɵsetClassMetadata(H,[{type:o.Component,args:[{selector:"app-entity-users",templateUrl:"entity-users.component.html"}]}],(function(){return[{type:u.ApiService},{type:d.I18nService},{type:m.ToasterService},{type:f.LogService}]}),{entity:[{type:o.Input}],entityId:[{type:o.Input}],entityName:[{type:o.Input}],organizationId:[{type:o.Input}],onEditedUsers:[{type:o.Output}]})},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0)return void(this.creditAmount=parseFloat((Math.round(100*e)/100).toString()).toFixed(2).toString())}}catch(t){this.logService.error(t)}this.creditAmount=""},Object.defineProperty(e.prototype,"creditAmountNumber",{get:function(){if(null!=this.creditAmount&&""!==this.creditAmount)try{return parseFloat(this.creditAmount)}catch(e){this.logService.error(e)}return null},enumerable:!1,configurable:!0}),e.ɵfac=function(t){return new(t||e)(l.ɵɵdirectiveInject(c.UserService),l.ɵɵdirectiveInject(p.ApiService),l.ɵɵdirectiveInject(u.PlatformUtilsService),l.ɵɵdirectiveInject(d.LogService))},e.ɵcmp=l.ɵɵdefineComponent({type:e,selectors:[["app-add-credit"]],viewQuery:function(e,t){if(1&e&&l.ɵɵviewQuery(g,3,o.ElementRef),2&e){var n;l.ɵɵqueryRefresh(n=l.ɵɵloadQuery())&&(t.ppButtonFormRef=n.first)}},inputs:{creditAmount:"creditAmount",showOptions:"showOptions",method:"method",organizationId:"organizationId"},outputs:{onAdded:"onAdded",onCanceled:"onCanceled"},decls:92,vars:32,consts:[["ngNativeValidate","",1,"card",3,"appApiAction","ngSubmit"],["form",""],[1,"card-body"],["type","button",1,"close",3,"appA11yTitle","click"],["aria-hidden","true"],[1,"card-body-header"],["class","mb-4 text-lg",4,"ngIf"],[1,"form-group"],[1,"row"],[1,"col-4"],["for","creditAmount"],[1,"input-group"],[1,"input-group-prepend"],[1,"input-group-text"],["id","creditAmount","type","text","name","CreditAmount","required","",1,"form-control",3,"ngModel","ngModelChange","blur"],[1,"form-text","text-muted"],["type","submit",1,"btn","btn-primary","btn-submit",3,"disabled"],["aria-hidden","true",1,"fa","fa-spinner","fa-spin",3,"title"],["type","button",1,"btn","btn-outline-secondary",3,"click"],["method","post","target","_top",3,"action"],["ppButtonForm",""],["type","hidden","name","cmd","value","_xclick"],["type","hidden","name","business",3,"value"],["type","hidden","name","button_subtype","value","services"],["type","hidden","name","no_note","value","1"],["type","hidden","name","no_shipping","value","1"],["type","hidden","name","rm","value","1"],["type","hidden","name","return",3,"value"],["type","hidden","name","cancel_return",3,"value"],["type","hidden","name","currency_code","value","USD"],["type","hidden","name","image_url","value","https://bitwarden.com/images/paypal-banner.png"],["type","hidden","name","bn","value","PP-BuyNowBF:btn_buynow_LG.gif:NonHosted"],["type","hidden","name","amount",3,"value"],["type","hidden","name","custom",3,"value"],["type","hidden","name","item_name","value","Bitwarden Account Credit"],["type","hidden","name","item_number",3,"value"],[1,"mb-4","text-lg"],[1,"form-check","form-check-inline"],["type","radio","name","Method","id","credit-method-paypal",1,"form-check-input",3,"value","ngModel","ngModelChange"],["for","credit-method-paypal",1,"form-check-label"],["aria-hidden","true",1,"fa","fa-fw","fa-paypal"],["type","radio","name","Method","id","credit-method-bitcoin",1,"form-check-input",3,"value","ngModel","ngModelChange"],["for","credit-method-bitcoin",1,"form-check-label"],["aria-hidden","true",1,"fa","fa-fw","fa-bitcoin"]],template:function(e,t){if(1&e&&(l.ɵɵelementStart(0,"form",0,1),l.ɵɵlistener("ngSubmit",(function(){return t.submit()})),l.ɵɵtext(2," "),l.ɵɵelementStart(3,"div",2),l.ɵɵtext(4," "),l.ɵɵelementStart(5,"button",3),l.ɵɵlistener("click",(function(){return t.cancel()})),l.ɵɵpipe(6,"i18n"),l.ɵɵelementStart(7,"span",4),l.ɵɵtext(8,"×"),l.ɵɵelementEnd(),l.ɵɵelementEnd(),l.ɵɵtext(9," "),l.ɵɵelementStart(10,"h3",5),l.ɵɵtext(11),l.ɵɵpipe(12,"i18n"),l.ɵɵelementEnd(),l.ɵɵtext(13," "),l.ɵɵtemplate(14,x,22,4,"div",6),l.ɵɵtext(15," "),l.ɵɵelementStart(16,"div",7),l.ɵɵtext(17," "),l.ɵɵelementStart(18,"div",8),l.ɵɵtext(19," "),l.ɵɵelementStart(20,"div",9),l.ɵɵtext(21," "),l.ɵɵelementStart(22,"label",10),l.ɵɵtext(23),l.ɵɵpipe(24,"i18n"),l.ɵɵelementEnd(),l.ɵɵtext(25," "),l.ɵɵelementStart(26,"div",11),l.ɵɵtext(27," "),l.ɵɵelementStart(28,"div",12),l.ɵɵelementStart(29,"span",13),l.ɵɵtext(30,"$USD"),l.ɵɵelementEnd(),l.ɵɵelementEnd(),l.ɵɵtext(31," "),l.ɵɵelementStart(32,"input",14),l.ɵɵlistener("ngModelChange",(function(e){return t.creditAmount=e}))("blur",(function(){return t.formatAmount()})),l.ɵɵelementEnd(),l.ɵɵtext(33," "),l.ɵɵelementEnd(),l.ɵɵtext(34," "),l.ɵɵelementEnd(),l.ɵɵtext(35," "),l.ɵɵelementEnd(),l.ɵɵtext(36," "),l.ɵɵelementStart(37,"small",15),l.ɵɵtext(38),l.ɵɵpipe(39,"i18n"),l.ɵɵelementEnd(),l.ɵɵtext(40," "),l.ɵɵelementEnd(),l.ɵɵtext(41," "),l.ɵɵelementStart(42,"button",16),l.ɵɵtext(43," "),l.ɵɵelement(44,"i",17),l.ɵɵpipe(45,"i18n"),l.ɵɵtext(46," "),l.ɵɵelementStart(47,"span"),l.ɵɵtext(48),l.ɵɵpipe(49,"i18n"),l.ɵɵelementEnd(),l.ɵɵtext(50," "),l.ɵɵelementEnd(),l.ɵɵtext(51," "),l.ɵɵelementStart(52,"button",18),l.ɵɵlistener("click",(function(){return t.cancel()})),l.ɵɵtext(53),l.ɵɵpipe(54,"i18n"),l.ɵɵelementEnd(),l.ɵɵtext(55," "),l.ɵɵelementEnd(),l.ɵɵtext(56," "),l.ɵɵelementEnd(),l.ɵɵtext(57," "),l.ɵɵelementStart(58,"form",19,20),l.ɵɵtext(60," "),l.ɵɵelement(61,"input",21),l.ɵɵtext(62," "),l.ɵɵelement(63,"input",22),l.ɵɵtext(64," "),l.ɵɵelement(65,"input",23),l.ɵɵtext(66," "),l.ɵɵelement(67,"input",24),l.ɵɵtext(68," "),l.ɵɵelement(69,"input",25),l.ɵɵtext(70," "),l.ɵɵelement(71,"input",26),l.ɵɵtext(72," "),l.ɵɵelement(73,"input",27),l.ɵɵtext(74," "),l.ɵɵelement(75,"input",28),l.ɵɵtext(76," "),l.ɵɵelement(77,"input",29),l.ɵɵtext(78," "),l.ɵɵelement(79,"input",30),l.ɵɵtext(80," "),l.ɵɵelement(81,"input",31),l.ɵɵtext(82," "),l.ɵɵelement(83,"input",32),l.ɵɵtext(84," "),l.ɵɵelement(85,"input",33),l.ɵɵtext(86," "),l.ɵɵelement(87,"input",34),l.ɵɵtext(88," "),l.ɵɵelement(89,"input",35),l.ɵɵtext(90," "),l.ɵɵelementEnd(),l.ɵɵtext(91," ")),2&e){var n=l.ɵɵreference(1);l.ɵɵproperty("appApiAction",t.formPromise),l.ɵɵadvance(5),l.ɵɵpropertyInterpolate("appA11yTitle",l.ɵɵpipeBind1(6,18,"cancel")),l.ɵɵadvance(6),l.ɵɵtextInterpolate(l.ɵɵpipeBind1(12,20,"addCredit")),l.ɵɵadvance(3),l.ɵɵproperty("ngIf",t.showOptions),l.ɵɵadvance(9),l.ɵɵtextInterpolate(l.ɵɵpipeBind1(24,22,"amount")),l.ɵɵadvance(9),l.ɵɵproperty("ngModel",t.creditAmount),l.ɵɵadvance(6),l.ɵɵtextInterpolate(l.ɵɵpipeBind1(39,24,"creditDelayed")),l.ɵɵadvance(4),l.ɵɵproperty("disabled",n.loading||t.ppLoading),l.ɵɵadvance(2),l.ɵɵpropertyInterpolate("title",l.ɵɵpipeBind1(45,26,"loading")),l.ɵɵadvance(4),l.ɵɵtextInterpolate(l.ɵɵpipeBind1(49,28,"submit")),l.ɵɵadvance(5),l.ɵɵtextInterpolate1(" ",l.ɵɵpipeBind1(54,30,"cancel")," "),l.ɵɵadvance(5),l.ɵɵpropertyInterpolate("action",t.ppButtonFormAction,l.ɵɵsanitizeUrl),l.ɵɵadvance(5),l.ɵɵpropertyInterpolate("value",t.ppButtonBusinessId),l.ɵɵadvance(10),l.ɵɵpropertyInterpolate("value",t.returnUrl),l.ɵɵadvance(2),l.ɵɵpropertyInterpolate("value",t.returnUrl),l.ɵɵadvance(8),l.ɵɵpropertyInterpolate("value",t.creditAmount),l.ɵɵadvance(2),l.ɵɵpropertyInterpolate("value",t.ppButtonCustomField),l.ɵɵadvance(4),l.ɵɵpropertyInterpolate("value",t.subject)}},directives:[m.NgControlStatusGroup,m.NgForm,f.ApiActionDirective,h.A11yTitleDirective,v.NgIf,m.DefaultValueAccessor,m.RequiredValidator,m.NgControlStatus,m.NgModel,m.ɵangular_packages_forms_forms_ba,m.RadioControlValueAccessor],pipes:[y.I18nPipe],encapsulation:2}),e}();t.AddCreditComponent=S,("undefined"==typeof ngDevMode||ngDevMode)&&l.ɵsetClassMetadata(S,[{type:o.Component,args:[{selector:"app-add-credit",templateUrl:"add-credit.component.html"}]}],(function(){return[{type:c.UserService},{type:p.ApiService},{type:u.PlatformUtilsService},{type:d.LogService}]}),{creditAmount:[{type:o.Input}],showOptions:[{type:o.Input}],method:[{type:o.Input}],organizationId:[{type:o.Input}],onAdded:[{type:o.Output}],onCanceled:[{type:o.Output}],ppButtonFormRef:[{type:o.ViewChild,args:["ppButtonForm",{read:o.ElementRef,static:!0}]}]})},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&(t.push(e),r.exposedPasswordMap.set(e.id,n))}));n.push(i)}})),[4,Promise.all(n)];case 2:return i.sent(),this.ciphers=t,[2]}}))}))},t.prototype.getAllCiphers=function(){return this.cipherService.getAllDecrypted()},t.prototype.canManageCipher=function(e){return!0},t.ɵfac=function(e){return new(e||t)(p.ɵɵdirectiveInject(u.CipherService),p.ɵɵdirectiveInject(d.AuditService),p.ɵɵdirectiveInject(m.ModalService),p.ɵɵdirectiveInject(f.MessagingService),p.ɵɵdirectiveInject(h.UserService),p.ɵɵdirectiveInject(v.PasswordRepromptService))},t.ɵcmp=p.ɵɵdefineComponent({type:t,selectors:[["app-exposed-passwords-report"]],features:[p.ɵɵInheritDefinitionFeature],decls:26,vars:14,consts:[[1,"page-header"],["type","button",1,"btn","btn-primary","btn-submit",3,"disabled","click"],["aria-hidden","true",1,"fa","fa-spinner","fa-spin",3,"title"],["class","mt-4",4,"ngIf"],["cipherAddEdit",""],[1,"mt-4"],["type","success",3,"title",4,"ngIf"],[4,"ngIf"],["type","success",3,"title"],["type","danger",3,"title","useAlertRole"],[1,"table","table-hover","table-list","table-ciphers"],[4,"ngFor","ngForOf"],[1,"table-list-icon"],[3,"cipher"],[1,"reduced-lh","wrap"],[4,"ngIf","ngIfElse"],["cantManage",""],[1,"text-right"],[1,"badge","badge-warning"],["href","#","appStopClick","",3,"title","click"],["appStopProp","","aria-hidden","true",1,"fa","fa-cube",3,"title"],[1,"sr-only"],["appStopProp","","aria-hidden","true",1,"fa","fa-paperclip",3,"title"]],template:function(e,t){1&e&&(p.ɵɵelementStart(0,"div",0),p.ɵɵtext(1," "),p.ɵɵelementStart(2,"h1"),p.ɵɵtext(3),p.ɵɵpipe(4,"i18n"),p.ɵɵelementEnd(),p.ɵɵtext(5," "),p.ɵɵelementEnd(),p.ɵɵtext(6," "),p.ɵɵelementStart(7,"p"),p.ɵɵtext(8),p.ɵɵpipe(9,"i18n"),p.ɵɵelementEnd(),p.ɵɵtext(10," "),p.ɵɵelementStart(11,"button",1),p.ɵɵlistener("click",(function(){return t.load()})),p.ɵɵtext(12," "),p.ɵɵelement(13,"i",2),p.ɵɵpipe(14,"i18n"),p.ɵɵtext(15," "),p.ɵɵelementStart(16,"span"),p.ɵɵtext(17),p.ɵɵpipe(18,"i18n"),p.ɵɵelementEnd(),p.ɵɵtext(19," "),p.ɵɵelementEnd(),p.ɵɵtext(20," "),p.ɵɵtemplate(21,A,6,2,"div",3),p.ɵɵtext(22," "),p.ɵɵtemplate(23,T,0,0,"ng-template",null,4,p.ɵɵtemplateRefExtractor),p.ɵɵtext(25," ")),2&e&&(p.ɵɵadvance(3),p.ɵɵtextInterpolate(p.ɵɵpipeBind1(4,6,"exposedPasswordsReport")),p.ɵɵadvance(5),p.ɵɵtextInterpolate(p.ɵɵpipeBind1(9,8,"exposedPasswordsReportDesc")),p.ɵɵadvance(3),p.ɵɵproperty("disabled",t.loading),p.ɵɵadvance(2),p.ɵɵpropertyInterpolate("title",p.ɵɵpipeBind1(14,10,"loading")),p.ɵɵadvance(4),p.ɵɵtextInterpolate(p.ɵɵpipeBind1(18,12,"checkExposedPasswords")),p.ɵɵadvance(4),p.ɵɵproperty("ngIf",t.hasLoaded))},directives:[y.NgIf,g.CalloutComponent,y.NgForOf,x.IconComponent,S.StopClickDirective,b.StopPropDirective],pipes:[w.I18nPipe,y.DecimalPipe],encapsulation:2}),t}(c.CipherReportComponent);t.ExposedPasswordsReportComponent=M,("undefined"==typeof ngDevMode||ngDevMode)&&p.ɵsetClassMetadata(M,[{type:s.Component,args:[{selector:"app-exposed-passwords-report",templateUrl:"exposed-passwords-report.component.html"}]}],(function(){return[{type:u.CipherService},{type:d.AuditService},{type:m.ModalService},{type:f.MessagingService},{type:h.UserService},{type:v.PasswordRepromptService}]}),null)},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]1||!this.allowPersonal)&&(null!=this.organization?this.cloneMode&&this.organization.canEditAnyCollection:!this.editMode||this.cloneMode)},t.prototype.loadCollections=function(){return this.organization.canEditAnyCollection?Promise.resolve(this.collections):e.prototype.loadCollections.call(this)},t.prototype.loadCipher=function(){return o(this,void 0,void 0,(function(){var t,n;return a(this,(function(r){switch(r.label){case 0:return this.organization.canEditAnyCollection?[3,2]:[4,e.prototype.loadCipher.call(this)];case 1:return[2,r.sent()];case 2:return[4,this.apiService.getCipherAdmin(this.cipherId)];case 3:return t=r.sent(),n=new l.CipherData(t),this.originalCipher=new c.Cipher(n),[2,new c.Cipher(n)]}}))}))},t.prototype.encryptCipher=function(){return this.organization.canEditAnyCollection?this.cipherService.encrypt(this.cipher,null,this.originalCipher):e.prototype.encryptCipher.call(this)},t.prototype.saveCipher=function(t){return o(this,void 0,void 0,(function(){var n;return a(this,(function(r){return this.organization.canEditAnyCollection&&null!=t.organizationId?this.editMode&&!this.cloneMode?(n=new u.CipherRequest(t),[2,this.apiService.putCipherAdmin(this.cipherId,n)]):(n=new p.CipherCreateRequest(t),[2,this.apiService.postCipherAdmin(n)]):[2,e.prototype.saveCipher.call(this,t)]}))}))},t.prototype.deleteCipher=function(){return o(this,void 0,void 0,(function(){return a(this,(function(t){return this.organization.canEditAnyCollection?[2,this.cipher.isDeleted?this.apiService.deleteCipherAdmin(this.cipherId):this.apiService.putDeleteCipherAdmin(this.cipherId)]:[2,e.prototype.deleteCipher.call(this)]}))}))},t.ɵfac=function(e){return new(e||t)(m.ɵɵdirectiveInject(f.CipherService),m.ɵɵdirectiveInject(h.FolderService),m.ɵɵdirectiveInject(v.I18nService),m.ɵɵdirectiveInject(y.PlatformUtilsService),m.ɵɵdirectiveInject(g.AuditService),m.ɵɵdirectiveInject(x.StateService),m.ɵɵdirectiveInject(S.UserService),m.ɵɵdirectiveInject(b.CollectionService),m.ɵɵdirectiveInject(w.TotpService),m.ɵɵdirectiveInject(C.PasswordGenerationService),m.ɵɵdirectiveInject(I.ApiService),m.ɵɵdirectiveInject(E.MessagingService),m.ɵɵdirectiveInject(P.EventService),m.ɵɵdirectiveInject(k.PolicyService),m.ɵɵdirectiveInject(O.LogService),m.ɵɵdirectiveInject(_.PasswordRepromptService))},t.ɵcmp=m.ɵɵdefineComponent({type:t,selectors:[["app-org-vault-add-edit"]],features:[m.ɵɵInheritDefinitionFeature],decls:36,vars:11,consts:[["role","dialog","aria-modal","true","aria-labelledby","cipherAddEditTitle",1,"modal","fade"],["role","document",1,"modal-dialog","modal-dialog-scrollable","modal-lg"],["ngNativeValidate","","autocomplete","off",1,"modal-content",3,"appApiAction","ngSubmit"],["form",""],[1,"modal-header"],["id","cipherAddEditTitle",1,"modal-title"],["type","button","data-dismiss","modal",1,"close",3,"appA11yTitle"],["aria-hidden","true"],["class","modal-body",4,"ngIf"],[1,"modal-footer"],["type","submit","class","btn btn-primary btn-submit",3,"disabled",4,"ngIf"],["type","button","data-dismiss","modal",1,"btn","btn-outline-secondary"],["class","ml-auto",4,"ngIf"],[1,"modal-body"],["type","info",4,"ngIf"],["class","row",4,"ngIf"],[1,"row"],[1,"col-6","form-group"],["for","name"],["id","name","type","text","name","Name","required","",1,"form-control",3,"ngModel","disabled","ngModelChange"],["class","col-6 form-group",4,"ngIf"],[4,"ngIf"],[1,"form-group"],["for","notes"],["id","notes","name","Notes","rows","6",1,"form-control",3,"ngModel","disabled","ngModelChange"],[3,"cipher","thisCipherType","viewOnly","copy"],["type","info"],["for","type"],["id","type","name","Type","appAutofocus","",1,"form-control",3,"ngModel","disabled","ngModelChange"],[3,"ngValue",4,"ngFor","ngForOf"],[3,"ngValue"],["for","folder"],["id","folder","name","FolderId",1,"form-control",3,"ngModel","disabled","ngModelChange"],["for","loginUsername"],[1,"input-group"],["id","loginUsername","type","text","name","Login.Username","appInputVerbatim","",1,"form-control",3,"ngModel","disabled","ngModelChange"],["class","input-group-append",4,"ngIf"],[1,"d-flex"],["for","loginPassword"],["class","ml-auto d-flex",4,"ngIf"],["id","loginPassword","name","Login.Password","appInputVerbatim","","autocomplete","new-password",1,"form-control","text-monospace",3,"type","ngModel","disabled","ngModelChange"],[1,"input-group-append"],["type","button",1,"btn","btn-outline-secondary",3,"appA11yTitle","disabled","click"],["aria-hidden","true",1,"fa","fa-lg",3,"ngClass"],["aria-hidden","true",1,"fa","fa-lg","fa-clone"],["for","loginTotp"],["id","loginTotp","name","Login.Totp","appInputVerbatim","",1,"form-control","text-monospace",3,"type","ngModel","disabled","ngModelChange"],[1,"col-6","form-group","totp","d-flex","align-items-end",3,"ngClass"],["class","d-flex align-items-center",4,"ngIf"],["href","#","appStopClick","","class","d-inline-block mb-3",3,"click",4,"ngIf"],["type","button",1,"btn","btn-outline-secondary",3,"appA11yTitle","click"],[1,"ml-auto","d-flex"],["href","#","class","d-block mr-2 fa-icon-above-input","appStopClick","",3,"appA11yTitle","click",4,"ngIf"],["href","#","appStopClick","",1,"d-block","fa-icon-above-input",3,"appA11yTitle","appApiAction","click"],["checkPasswordBtn",""],["aria-hidden","true",1,"fa","fa-lg","fa-fw","fa-check-circle",3,"hidden"],["aria-hidden","true",1,"fa","fa-lg","fa-fw","fa-spinner","fa-spin",3,"hidden","title"],["href","#","appStopClick","",1,"d-block","mr-2","fa-icon-above-input",3,"appA11yTitle","click"],["aria-hidden","true",1,"fa","fa-lg","fa-fw","fa-refresh"],["src","images/totp-countdown.png","id","totpImage",1,"ml-2",3,"title"],["href","#","appStopClick","","class","badge badge-primary ml-3",3,"click",4,"ngIf"],["href","#","appStopClick","",1,"badge","badge-primary","ml-3",3,"click"],[1,"d-flex","align-items-center"],[1,"totp-countdown","mr-3","ml-2"],[1,"totp-sec"],["r","12.6","cy","16","cx","16",1,"totp-circle","inner",3,"ngStyle"],["r","14","cy","16","cx","16",1,"totp-circle","outer"],[1,"totp-code","mr-2",3,"title"],["type","button",1,"btn","btn-link",3,"appA11yTitle","click"],["aria-hidden","true",1,"fa","fa-clone"],["class","row",4,"ngFor","ngForOf","ngForTrackBy"],[1,"col-7","form-group"],[3,"for"],["type","text","appInputVerbatim","",1,"form-control",3,"id","name","ngModel","disabled","placeholder","ngModelChange"],["aria-hidden","true",1,"fa","fa-lg","fa-share"],[1,"col-5","form-group"],["href","https://help.bitwarden.com/article/uri-match-detection/","target","_blank","rel","noopener",1,"ml-auto",3,"appA11yTitle"],["aria-hidden","true",1,"fa","fa-question-circle-o"],[1,"form-control","overflow-hidden",3,"id","name","ngModel","disabled","ngModelChange","change"],["type","button","class","btn btn-link text-danger ml-2",3,"appA11yTitle","click",4,"ngIf"],["type","button",1,"btn","btn-link","text-danger","ml-2",3,"appA11yTitle","click"],["aria-hidden","true",1,"fa","fa-minus-circle","fa-lg"],["href","#","appStopClick","",1,"d-inline-block","mb-3",3,"click"],["aria-hidden","true",1,"fa","fa-plus-circle","fa-fw"],["for","cardCardholderName"],["id","cardCardholderName","type","text","name","Card.CardCardholderName",1,"form-control",3,"ngModel","disabled","ngModelChange"],["for","cardBrand"],["id","cardBrand","name","Card.Brand",1,"form-control",3,"ngModel","disabled","ngModelChange"],["for","cardNumber"],["id","cardNumber","name","Card.Number","appInputVerbatim","","autocomplete","new-password",1,"form-control","text-monospace",3,"type","ngModel","disabled","ngModelChange"],[1,"col","form-group"],["for","cardExpMonth"],["id","cardExpMonth","name","Card.ExpMonth",1,"form-control",3,"ngModel","disabled","ngModelChange"],["for","cardExpYear"],["id","cardExpYear","type","text","name","Card.ExpYear",1,"form-control",3,"ngModel","placeholder","disabled","ngModelChange"],["for","cardCode"],["id","cardCode","name","Card.Code","appInputVerbatim","","autocomplete","new-password",1,"form-control","text-monospace",3,"type","ngModel","disabled","ngModelChange"],[1,"col-4","form-group"],["for","idTitle"],["id","idTitle","name","Identity.Title",1,"form-control",3,"ngModel","disabled","ngModelChange"],["for","idFirstName"],["id","idFirstName","type","text","name","Identity.FirstName",1,"form-control",3,"ngModel","disabled","ngModelChange"],["for","idMiddleName"],["id","idMiddleName","type","text","name","Identity.MiddleName",1,"form-control",3,"ngModel","disabled","ngModelChange"],["for","idLastName"],["id","idLastName","type","text","name","Identity.LastName",1,"form-control",3,"ngModel","disabled","ngModelChange"],["for","idUsername"],["id","idUsername","type","text","name","Identity.Username","appInputVerbatim","",1,"form-control",3,"ngModel","disabled","ngModelChange"],["for","idCompany"],["id","idCompany","type","text","name","Identity.Company",1,"form-control",3,"ngModel","disabled","ngModelChange"],["for","idSsn"],["id","idSsn","type","text","name","Identity.SSN","appInputVerbatim","",1,"form-control",3,"ngModel","disabled","ngModelChange"],["for","idPassportNumber"],["id","idPassportNumber","type","text","name","Identity.PassportNumber","appInputVerbatim","",1,"form-control",3,"ngModel","disabled","ngModelChange"],["for","idLicenseNumber"],["id","idLicenseNumber","type","text","name","Identity.LicenseNumber","appInputVerbatim","",1,"form-control",3,"ngModel","disabled","ngModelChange"],["for","idEmail"],["id","idEmail","type","text","name","Identity.Email","appInputVerbatim","",1,"form-control",3,"ngModel","disabled","ngModelChange"],["for","idPhone"],["id","idPhone","type","text","name","Identity.Phone",1,"form-control",3,"ngModel","disabled","ngModelChange"],["for","idAddress1"],["id","idAddress1","type","text","name","Identity.Address1",1,"form-control",3,"ngModel","disabled","ngModelChange"],["for","idAddress2"],["id","idAddress2","type","text","name","Identity.Address2",1,"form-control",3,"ngModel","disabled","ngModelChange"],["for","idAddress3"],["id","idAddress3","type","text","name","Identity.Address3",1,"form-control",3,"ngModel","disabled","ngModelChange"],["for","idCity"],["id","idCity","type","text","name","Identity.City",1,"form-control",3,"ngModel","disabled","ngModelChange"],["for","idState"],["id","idState","type","text","name","Identity.State",1,"form-control",3,"ngModel","disabled","ngModelChange"],["for","idPostalCode"],["id","idPostalCode","type","text","name","Identity.PostalCode",1,"form-control",3,"ngModel","disabled","ngModelChange"],["for","idCountry"],["id","idCountry","type","text","name","Identity.Country",1,"form-control",3,"ngModel","disabled","ngModelChange"],[1,"mt-4"],[1,"col-5"],["for","organizationId"],["id","organizationId","name","OrganizationId",1,"form-control",3,"ngModel","disabled","ngModelChange","change"],["class","form-check",4,"ngFor","ngForOf"],[1,"form-check"],["type","checkbox",1,"form-check-input",3,"ngModel","id","name","disabled","ngModelChange"],[1,"form-check-label",3,"for"],[1,"small","text-muted","mt-4"],[1,"font-weight-semibold"],["class","ml-3",4,"ngIf"],["href","#","appStopClick","",3,"title","click"],[1,"ml-3"],[4,"ngFor","ngForOf"],[1,"password-wrapper","text-monospace","ml-2"],["type","checkbox","id","passwordPrompt","name","passwordPrompt",1,"form-check-input",3,"ngModel","disabled","change"],["for","passwordPrompt",1,"form-check-label"],["target","_blank","rel","noopener","href","https://bitwarden.com/help/article/managing-items/#protect-individual-items",3,"appA11yTitle"],["type","submit",1,"btn","btn-primary","btn-submit",3,"disabled"],["aria-hidden","true",1,"fa","fa-spinner","fa-spin",3,"title"],[1,"ml-auto"],["type","button","class","btn btn-link",3,"appA11yTitle","click",4,"ngIf"],["type","button","class","btn btn-outline-danger",3,"appA11yTitle","disabled","appApiAction","click",4,"ngIf"],["type","button",1,"btn","btn-outline-danger",3,"appA11yTitle","disabled","appApiAction","click"],["deleteBtn",""],["aria-hidden","true",1,"fa","fa-trash-o","fa-lg","fa-fw",3,"hidden"],["aria-hidden","true",1,"fa","fa-spinner","fa-spin","fa-lg","fa-fw",3,"hidden","title"]],template:function(e,t){1&e&&(m.ɵɵelementStart(0,"div",0),m.ɵɵtext(1," "),m.ɵɵelementStart(2,"div",1),m.ɵɵtext(3," "),m.ɵɵelementStart(4,"form",2,3),m.ɵɵlistener("ngSubmit",(function(){return t.submit()})),m.ɵɵtext(6," "),m.ɵɵelementStart(7,"div",4),m.ɵɵtext(8," "),m.ɵɵelementStart(9,"h2",5),m.ɵɵtext(10),m.ɵɵelementEnd(),m.ɵɵtext(11," "),m.ɵɵelementStart(12,"button",6),m.ɵɵpipe(13,"i18n"),m.ɵɵtext(14," "),m.ɵɵelementStart(15,"span",7),m.ɵɵtext(16,"×"),m.ɵɵelementEnd(),m.ɵɵtext(17," "),m.ɵɵelementEnd(),m.ɵɵtext(18," "),m.ɵɵelementEnd(),m.ɵɵtext(19," "),m.ɵɵtemplate(20,Ie,45,24,"div",8),m.ɵɵtext(21," "),m.ɵɵelementStart(22,"div",9),m.ɵɵtext(23," "),m.ɵɵtemplate(24,Ee,9,7,"button",10),m.ɵɵtext(25," "),m.ɵɵelementStart(26,"button",11),m.ɵɵtext(27),m.ɵɵpipe(28,"i18n"),m.ɵɵelementEnd(),m.ɵɵtext(29," "),m.ɵɵtemplate(30,_e,6,2,"div",12),m.ɵɵtext(31," "),m.ɵɵelementEnd(),m.ɵɵtext(32," "),m.ɵɵelementEnd(),m.ɵɵtext(33," "),m.ɵɵelementEnd(),m.ɵɵtext(34," "),m.ɵɵelementEnd(),m.ɵɵtext(35," ")),2&e&&(m.ɵɵadvance(4),m.ɵɵproperty("appApiAction",t.formPromise),m.ɵɵadvance(6),m.ɵɵtextInterpolate(t.title),m.ɵɵadvance(2),m.ɵɵpropertyInterpolate("appA11yTitle",m.ɵɵpipeBind1(13,7,"close")),m.ɵɵadvance(8),m.ɵɵproperty("ngIf",t.cipher),m.ɵɵadvance(4),m.ɵɵproperty("ngIf",!t.viewOnly),m.ɵɵadvance(3),m.ɵɵtextInterpolate1(" ",m.ɵɵpipeBind1(28,9,t.viewOnly?"close":"cancel")," "),m.ɵɵadvance(3),m.ɵɵproperty("ngIf",t.cipher&&!t.viewOnly))},directives:[A.NgControlStatusGroup,A.NgForm,T.ApiActionDirective,M.A11yTitleDirective,D.NgIf,A.DefaultValueAccessor,A.RequiredValidator,A.NgControlStatus,A.NgModel,R.AddEditCustomFieldsComponent,B.CalloutComponent,A.SelectControlValueAccessor,j.AutofocusDirective,D.NgForOf,A.NgSelectOption,A.ɵangular_packages_forms_forms_z,U.InputVerbatimDirective,D.NgClass,V.StopClickDirective,D.NgStyle,A.CheckboxControlValueAccessor],pipes:[F.I18nPipe,D.DatePipe],encapsulation:2}),t}(d.AddEditComponent);t.AddEditComponent=Ae,("undefined"==typeof ngDevMode||ngDevMode)&&m.ɵsetClassMetadata(Ae,[{type:s.Component,args:[{selector:"app-org-vault-add-edit",templateUrl:"../../vault/add-edit.component.html"}]}],(function(){return[{type:f.CipherService},{type:h.FolderService},{type:v.I18nService},{type:y.PlatformUtilsService},{type:g.AuditService},{type:x.StateService},{type:S.UserService},{type:b.CollectionService},{type:w.TotpService},{type:C.PasswordGenerationService},{type:I.ApiService},{type:E.MessagingService},{type:P.EventService},{type:k.PolicyService},{type:O.LogService},{type:_.PasswordRepromptService}]}),null)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IdentityLinkedId=t.CardLinkedId=t.LoginLinkedId=void 0,function(e){e[e.Username=100]="Username",e[e.Password=101]="Password"}(t.LoginLinkedId||(t.LoginLinkedId={})),function(e){e[e.CardholderName=300]="CardholderName",e[e.ExpMonth=301]="ExpMonth",e[e.ExpYear=302]="ExpYear",e[e.Code=303]="Code",e[e.Brand=304]="Brand",e[e.Number=305]="Number"}(t.CardLinkedId||(t.CardLinkedId={})),function(e){e[e.Title=400]="Title",e[e.MiddleName=401]="MiddleName",e[e.Address1=402]="Address1",e[e.Address2=403]="Address2",e[e.Address3=404]="Address3",e[e.City=405]="City",e[e.State=406]="State",e[e.PostalCode=407]="PostalCode",e[e.Country=408]="Country",e[e.Company=409]="Company",e[e.Email=410]="Email",e[e.Phone=411]="Phone",e[e.Ssn=412]="Ssn",e[e.Username=413]="Username",e[e.PassportNumber=414]="PassportNumber",e[e.LicenseNumber=415]="LicenseNumber",e[e.FirstName=416]="FirstName",e[e.LastName=417]="LastName",e[e.FullName=418]="FullName"}(t.IdentityLinkedId||(t.IdentityLinkedId={}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.linkedFieldOption=t.LinkedMetadata=void 0;var r=function(){function e(e,t){this.propertyKey=e,this._i18nKey=t}return Object.defineProperty(e.prototype,"i18nKey",{get:function(){var e;return null!==(e=this._i18nKey)&&void 0!==e?e:this.propertyKey},enumerable:!1,configurable:!0}),e}();t.LinkedMetadata=r,t.linkedFieldOption=function(e,t){return function(n,i){null==n.linkedFieldOptions&&(n.linkedFieldOptions=new Map),n.linkedFieldOptions.set(e,new r(i,t))}}},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.Card=void 0;var o=n(594),a=n(85),s=n(92),l=function(e){function t(t,n){void 0===n&&(n=!1);var r=e.call(this)||this;return null==t||r.buildDomainModel(r,t,{cardholderName:null,brand:null,number:null,expMonth:null,expYear:null,code:null},n,[]),r}return i(t,e),t.prototype.decrypt=function(e,t){return this.decryptObj(new s.CardView(this),{cardholderName:null,brand:null,number:null,expMonth:null,expYear:null,code:null},e,t)},t.prototype.toCardData=function(){var e=new o.CardData;return this.buildDataModel(this,e,{cardholderName:null,brand:null,number:null,expMonth:null,expYear:null,code:null}),e},t}(a.default);t.Card=l},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.Field=void 0;var o=n(595),a=n(85),s=n(266),l=function(e){function t(t,n){void 0===n&&(n=!1);var r=e.call(this)||this;return null==t||(r.type=t.type,r.linkedId=t.linkedId,r.buildDomainModel(r,t,{name:null,value:null},n,[])),r}return i(t,e),t.prototype.decrypt=function(e,t){return this.decryptObj(new s.FieldView(this),{name:null,value:null},e,t)},t.prototype.toFieldData=function(){var e=new o.FieldData;return this.buildDataModel(this,e,{name:null,value:null,type:null,linkedId:null},["type","linkedId"]),e},t}(a.default);t.Field=l},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.Identity=void 0;var o=n(596),a=n(85),s=n(145),l=function(e){function t(t,n){void 0===n&&(n=!1);var r=e.call(this)||this;return null==t||r.buildDomainModel(r,t,{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,[]),r}return i(t,e),t.prototype.decrypt=function(e,t){return this.decryptObj(new s.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},e,t)},t.prototype.toIdentityData=function(){var e=new o.IdentityData;return this.buildDataModel(this,e,{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}(a.default);t.Identity=l},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&(e.uris=[],this.uris.forEach((function(t){e.uris.push(t.toLoginUriData())}))),e},t}(n(85).default);t.Login=p},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.LoginUri=void 0;var o=n(598),a=n(316),s=function(e){function t(t,n){void 0===n&&(n=!1);var r=e.call(this)||this;return null==t||(r.match=t.match,r.buildDomainModel(r,t,{uri:null},n,[])),r}return i(t,e),t.prototype.decrypt=function(e,t){return this.decryptObj(new a.LoginUriView(this),{uri:null},e,t)},t.prototype.toLoginUriData=function(){var e=new o.LoginUriData;return this.buildDataModel(this,e,{uri:null},["match"]),e},t}(n(85).default);t.LoginUri=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PasswordHistoryView=void 0;var r=function(e){this.password=null,this.lastUsedDate=null,e&&(this.lastUsedDate=e.lastUsedDate)};t.PasswordHistoryView=r},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.SecureNote=void 0;var o=n(600),a=n(85),s=n(108),l=function(e){function t(t,n){void 0===n&&(n=!1);var r=e.call(this)||this;return null==t||(r.type=t.type),r}return i(t,e),t.prototype.decrypt=function(e,t){return Promise.resolve(new s.SecureNoteView(this))},t.prototype.toSecureNoteData=function(){var e=new o.SecureNoteData;return e.type=this.type,e},t}(a.default);t.SecureNote=l},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0))return[3,4];i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this.getFileContents(n[0])];case 2:return null!=(o=i.sent())&&(r=o),[3,4];case 3:return a=i.sent(),this.logService.error(a),[3,4];case 4:if(null==r||""===r)return this.toasterService.popAsync("error",this.i18nService.t("errorOccurred"),this.i18nService.t("selectFile")),this.loading=!1,[2];i.label=5;case 5:return i.trys.push([5,7,,8]),this.formPromise=this.importService.import(e,r,this.organizationId),[4,this.formPromise];case 6:return null!=(s=i.sent())?(this.error(s),this.loading=!1,[2]):(this.toasterService.popAsync("success",null,this.i18nService.t("importSuccess")),this.router.navigate(this.successNavigate),[3,8]);case 7:return l=i.sent(),this.logService.error(l),[3,8];case 8:return this.loading=!1,[2]}}))}))},e.prototype.getFormatInstructionTitle=function(){var e=this;if(null==this.format)return null;var t=this.featuredImportOptions.concat(this.importOptions).filter((function(t){return t.id===e.format}));return t.length>0?this.i18nService.t("instructionsFor",t[0].name):null},e.prototype.setImportOptions=function(){this.featuredImportOptions=o([{id:null,name:"-- "+this.i18nService.t("select")+" --"}],this.importService.featuredImportOptions),this.importOptions=this.importService.regularImportOptions},e.prototype.error=function(e){return r(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,l.default.fire({heightAuto:!1,buttonsStyling:!1,icon:"error",iconHtml:'',input:"textarea",inputValue:e.message,inputAttributes:{readonly:"true"},titleText:this.i18nService.t("importError"),text:this.i18nService.t("importErrorDesc"),showConfirmButton:!0,confirmButtonText:this.i18nService.t("ok"),onOpen:function(e){e.querySelector(".swal2-textarea").scrollTo(0,0)}})];case 1:return t.sent(),[2]}}))}))},e.prototype.getFileContents=function(e){var t=this;return new Promise((function(n,r){var i=new FileReader;i.readAsText(e,"utf-8"),i.onload=function(i){if("lastpasscsv"===t.format&&"text/html"===e.type){var o=(new DOMParser).parseFromString(i.target.result,"text/html").querySelector("pre");return null!=o?void n(o.textContent):void r()}n(i.target.result)},i.onerror=function(){r()}}))},e.ɵfac=function(t){return new(t||e)(c.ɵɵdirectiveInject(p.I18nService),c.ɵɵdirectiveInject(u.ToasterService),c.ɵɵdirectiveInject(d.ImportService),c.ɵɵdirectiveInject(m.Router),c.ɵɵdirectiveInject(f.PlatformUtilsService),c.ɵɵdirectiveInject(h.PolicyService),c.ɵɵdirectiveInject(v.LogService))},e.ɵcmp=c.ɵɵdefineComponent({type:e,selectors:[["app-import"]],decls:69,vars:31,consts:[[1,"page-header"],["type","info",4,"ngIf"],["ngNativeValidate","",3,"ngSubmit"],["form",""],[1,"row"],[1,"col-6"],[1,"form-group"],["for","type"],["id","type","name","Format","required","",1,"form-control",3,"ngModel","disabled","ngModelChange"],[3,"ngValue",4,"ngFor","ngForOf"],[4,"ngIf"],["type","info",3,"title",4,"ngIf"],["for","file"],["type","file","id","file","name","file",1,"form-control-file",3,"disabled"],["for","fileContents"],["id","fileContents","name","FileContents",1,"form-control",3,"ngModel","disabled","ngModelChange"],["type","submit",1,"btn","btn-primary","btn-submit",3,"disabled","ngClass"],["aria-hidden","true",1,"fa","fa-spinner","fa-spin",3,"title"],["type","info"],[3,"ngValue"],["value","-","disabled","disabled"],["type","info",3,"title"],["target","_blank","rel","noopener","href","https://help.bitwarden.com/article/export-your-data/"],["target","_blank","rel","noopener","href","https://help.bitwarden.com/article/import-from-lastpass/"],["target","_blank","rel","noopener","href","https://help.bitwarden.com/article/import-from-chrome/"],["target","_blank","rel","noopener","href","https://bitwarden.com/help/article/import-from-firefox/"],["target","_blank","rel","noopener","href","https://bitwarden.com/help/article/import-from-safari/"],["target","_blank","rel","noopener","href","https://help.bitwarden.com/article/import-from-1password/"],["target","_blank","rel","noopener","href","https://bit.ly/2GpOMTg"]],template:function(e,t){1&e&&(c.ɵɵelementStart(0,"div",0),c.ɵɵtext(1," "),c.ɵɵelementStart(2,"h1"),c.ɵɵtext(3),c.ɵɵpipe(4,"i18n"),c.ɵɵelementEnd(),c.ɵɵtext(5," "),c.ɵɵelementEnd(),c.ɵɵtext(6," "),c.ɵɵtemplate(7,b,3,3,"app-callout",1),c.ɵɵtext(8," "),c.ɵɵelementStart(9,"form",2,3),c.ɵɵlistener("ngSubmit",(function(){return t.submit()})),c.ɵɵtext(11," "),c.ɵɵelementStart(12,"div",4),c.ɵɵtext(13," "),c.ɵɵelementStart(14,"div",5),c.ɵɵtext(15," "),c.ɵɵelementStart(16,"div",6),c.ɵɵtext(17," "),c.ɵɵelementStart(18,"label",7),c.ɵɵtext(19),c.ɵɵpipe(20,"i18n"),c.ɵɵelementEnd(),c.ɵɵtext(21," "),c.ɵɵelementStart(22,"select",8),c.ɵɵlistener("ngModelChange",(function(e){return t.format=e})),c.ɵɵtext(23," "),c.ɵɵtemplate(24,w,2,2,"option",9),c.ɵɵtext(25," "),c.ɵɵtemplate(26,I,6,1,"ng-container",10),c.ɵɵtext(27," "),c.ɵɵelementEnd(),c.ɵɵtext(28," "),c.ɵɵelementEnd(),c.ɵɵtext(29," "),c.ɵɵelementEnd(),c.ɵɵtext(30," "),c.ɵɵelementEnd(),c.ɵɵtext(31," "),c.ɵɵtemplate(32,we,102,51,"app-callout",11),c.ɵɵtext(33," "),c.ɵɵelementStart(34,"div",4),c.ɵɵtext(35," "),c.ɵɵelementStart(36,"div",5),c.ɵɵtext(37," "),c.ɵɵelementStart(38,"div",6),c.ɵɵtext(39," "),c.ɵɵelementStart(40,"label",12),c.ɵɵtext(41),c.ɵɵpipe(42,"i18n"),c.ɵɵelementEnd(),c.ɵɵtext(43," "),c.ɵɵelement(44,"input",13),c.ɵɵtext(45," "),c.ɵɵelementEnd(),c.ɵɵtext(46," "),c.ɵɵelementEnd(),c.ɵɵtext(47," "),c.ɵɵelementEnd(),c.ɵɵtext(48," "),c.ɵɵelementStart(49,"div",6),c.ɵɵtext(50," "),c.ɵɵelementStart(51,"label",14),c.ɵɵtext(52),c.ɵɵpipe(53,"i18n"),c.ɵɵelementEnd(),c.ɵɵtext(54," "),c.ɵɵelementStart(55,"textarea",15),c.ɵɵlistener("ngModelChange",(function(e){return t.fileContents=e})),c.ɵɵelementEnd(),c.ɵɵtext(56," "),c.ɵɵelementEnd(),c.ɵɵtext(57," "),c.ɵɵelementStart(58,"button",16),c.ɵɵtext(59," "),c.ɵɵelement(60,"i",17),c.ɵɵpipe(61,"i18n"),c.ɵɵtext(62," "),c.ɵɵelementStart(63,"span"),c.ɵɵtext(64),c.ɵɵpipe(65,"i18n"),c.ɵɵelementEnd(),c.ɵɵtext(66," "),c.ɵɵelementEnd(),c.ɵɵtext(67," "),c.ɵɵelementEnd(),c.ɵɵtext(68," ")),2&e&&(c.ɵɵadvance(3),c.ɵɵtextInterpolate(c.ɵɵpipeBind1(4,17,"importData")),c.ɵɵadvance(4),c.ɵɵproperty("ngIf",t.importBlockedByPolicy),c.ɵɵadvance(12),c.ɵɵtextInterpolate1("1. ",c.ɵɵpipeBind1(20,19,"selectFormat"),""),c.ɵɵadvance(3),c.ɵɵproperty("ngModel",t.format)("disabled",t.importBlockedByPolicy),c.ɵɵadvance(2),c.ɵɵproperty("ngForOf",t.featuredImportOptions),c.ɵɵadvance(2),c.ɵɵproperty("ngIf",t.importOptions&&t.importOptions.length),c.ɵɵadvance(6),c.ɵɵproperty("ngIf",t.format),c.ɵɵadvance(9),c.ɵɵtextInterpolate1("2. ",c.ɵɵpipeBind1(42,21,"selectImportFile"),""),c.ɵɵadvance(3),c.ɵɵproperty("disabled",t.importBlockedByPolicy),c.ɵɵadvance(8),c.ɵɵtextInterpolate(c.ɵɵpipeBind1(53,23,"orCopyPasteFileContents")),c.ɵɵadvance(3),c.ɵɵproperty("ngModel",t.fileContents)("disabled",t.importBlockedByPolicy),c.ɵɵadvance(3),c.ɵɵproperty("disabled",t.loading||t.importBlockedByPolicy)("ngClass",c.ɵɵpureFunction1(29,Ce,t.importBlockedByPolicy)),c.ɵɵadvance(2),c.ɵɵpropertyInterpolate("title",c.ɵɵpipeBind1(61,25,"loading")),c.ɵɵadvance(4),c.ɵɵtextInterpolate(c.ɵɵpipeBind1(65,27,"importData")))},directives:[y.NgIf,g.NgControlStatusGroup,g.NgForm,g.SelectControlValueAccessor,g.RequiredValidator,g.NgControlStatus,g.NgModel,y.NgForOf,g.DefaultValueAccessor,y.NgClass,x.CalloutComponent,g.NgSelectOption,g.ɵangular_packages_forms_forms_z],pipes:[S.I18nPipe],encapsulation:2}),e}();t.ImportComponent=Ie,("undefined"==typeof ngDevMode||ngDevMode)&&c.ɵsetClassMetadata(Ie,[{type:a.Component,args:[{selector:"app-import",templateUrl:"import.component.html"}]}],(function(){return[{type:p.I18nService},{type:u.ToasterService},{type:d.ImportService},{type:m.Router},{type:f.PlatformUtilsService},{type:h.PolicyService},{type:v.LogService}]}),null)},,function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0?[4,this.getAllCiphers()]:[3,6];case 4:return t=a.sent(),n=[],r=[],i=new Map,t.forEach((function(e){if(e.type===l.CipherType.Login&&(null==e.login.totp||""===e.login.totp)&&e.login.hasUris&&!e.isDeleted)for(var t=0;t0?[2]:[4,fetch(new Request("https://2fa.directory/api/v2/totp.json"))];case 1:if(200!==(e=a.sent()).status)throw new Error;return[4,e.json()];case 2:for(n in t=a.sent())if(t.hasOwnProperty(n))for(i in r=t[n])r.hasOwnProperty(i)&&null!=(o=r[i]).url&&null!=(s=c.Utils.getHostname(o.url))&&this.services.set(s,o.doc);return[2]}}))}))},t.ɵfac=function(e){return new(e||t)(u.ɵɵdirectiveInject(d.CipherService),u.ɵɵdirectiveInject(m.ModalService),u.ɵɵdirectiveInject(f.MessagingService),u.ɵɵdirectiveInject(h.UserService),u.ɵɵdirectiveInject(v.LogService),u.ɵɵdirectiveInject(y.PasswordRepromptService))},t.ɵcmp=u.ɵɵdefineComponent({type:t,selectors:[["app-inactive-two-factor-report"]],features:[u.ɵɵInheritDefinitionFeature],decls:20,vars:9,consts:[[1,"page-header"],[4,"ngIf"],["class","mt-4",4,"ngIf"],["cipherAddEdit",""],["aria-hidden","true",1,"fa","fa-spinner","fa-spin","text-muted",3,"title"],[1,"sr-only"],[1,"mt-4"],["type","success",3,"title",4,"ngIf"],["type","success",3,"title"],["type","danger",3,"title"],[1,"table","table-hover","table-list","table-ciphers"],[4,"ngFor","ngForOf"],[1,"table-list-icon"],[3,"cipher"],[1,"reduced-lh","wrap"],["href","#","appStopClick","",3,"title","click"],[1,"text-right"],["class","badge badge-primary","target","_blank","rel","noopener",3,"href",4,"ngIf"],["appStopProp","","aria-hidden","true",1,"fa","fa-cube",3,"title"],["appStopProp","","aria-hidden","true",1,"fa","fa-paperclip",3,"title"],["target","_blank","rel","noopener",1,"badge","badge-primary",3,"href"]],template:function(e,t){1&e&&(u.ɵɵelementStart(0,"div",0),u.ɵɵtext(1," "),u.ɵɵelementStart(2,"h1"),u.ɵɵtext(3),u.ɵɵpipe(4,"i18n"),u.ɵɵtemplate(5,I,9,6,"small",1),u.ɵɵtext(6," "),u.ɵɵelementEnd(),u.ɵɵtext(7," "),u.ɵɵelementEnd(),u.ɵɵtext(8," "),u.ɵɵelementStart(9,"p"),u.ɵɵtext(10),u.ɵɵpipe(11,"i18n"),u.ɵɵelementEnd(),u.ɵɵtext(12," "),u.ɵɵtemplate(13,E,9,6,"div",1),u.ɵɵtext(14," "),u.ɵɵtemplate(15,M,6,2,"div",2),u.ɵɵtext(16," "),u.ɵɵtemplate(17,D,0,0,"ng-template",null,3,u.ɵɵtemplateRefExtractor),u.ɵɵtext(19," ")),2&e&&(u.ɵɵadvance(3),u.ɵɵtextInterpolate1(" ",u.ɵɵpipeBind1(4,5,"inactive2faReport")," "),u.ɵɵadvance(2),u.ɵɵproperty("ngIf",t.hasLoaded&&t.loading),u.ɵɵadvance(5),u.ɵɵtextInterpolate(u.ɵɵpipeBind1(11,7,"inactive2faReportDesc")),u.ɵɵadvance(3),u.ɵɵproperty("ngIf",!t.hasLoaded&&t.loading),u.ɵɵadvance(2),u.ɵɵproperty("ngIf",t.hasLoaded))},directives:[g.NgIf,x.CalloutComponent,g.NgForOf,S.IconComponent,b.StopClickDirective,w.StopPropDirective],pipes:[C.I18nPipe,g.DecimalPipe],encapsulation:2}),t}(p.CipherReportComponent);t.InactiveTwoFactorReportComponent=R,("undefined"==typeof ngDevMode||ngDevMode)&&u.ɵsetClassMetadata(R,[{type:s.Component,args:[{selector:"app-inactive-two-factor-report",templateUrl:"inactive-two-factor-report.component.html"}]}],(function(){return[{type:d.CipherService},{type:m.ModalService},{type:f.MessagingService},{type:h.UserService},{type:v.LogService},{type:y.PasswordRepromptService}]}),null)},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]1})),this.ciphers=n,[2]}}))}))},t.prototype.getAllCiphers=function(){return this.cipherService.getAllDecrypted()},t.prototype.canManageCipher=function(e){return!0},t.ɵfac=function(e){return new(e||t)(p.ɵɵdirectiveInject(u.CipherService),p.ɵɵdirectiveInject(d.ModalService),p.ɵɵdirectiveInject(m.MessagingService),p.ɵɵdirectiveInject(f.UserService),p.ɵɵdirectiveInject(h.PasswordRepromptService))},t.ɵcmp=p.ɵɵdefineComponent({type:t,selectors:[["app-reused-passwords-report"]],features:[p.ɵɵInheritDefinitionFeature],decls:20,vars:9,consts:[[1,"page-header"],[4,"ngIf"],["class","mt-4",4,"ngIf"],["cipherAddEdit",""],["aria-hidden","true",1,"fa","fa-spinner","fa-spin","text-muted",3,"title"],[1,"sr-only"],[1,"mt-4"],["type","success",3,"title",4,"ngIf"],["type","success",3,"title"],["type","danger",3,"title"],[1,"table","table-hover","table-list","table-ciphers"],[4,"ngFor","ngForOf"],[1,"table-list-icon"],[3,"cipher"],[1,"reduced-lh","wrap"],[4,"ngIf","ngIfElse"],["cantManage",""],[1,"text-right"],[1,"badge","badge-warning"],["href","#","appStopClick","",3,"title","click"],["appStopProp","","aria-hidden","true",1,"fa","fa-cube",3,"title"],["appStopProp","","aria-hidden","true",1,"fa","fa-paperclip",3,"title"]],template:function(e,t){1&e&&(p.ɵɵelementStart(0,"div",0),p.ɵɵtext(1," "),p.ɵɵelementStart(2,"h1"),p.ɵɵtext(3),p.ɵɵpipe(4,"i18n"),p.ɵɵtemplate(5,w,9,6,"small",1),p.ɵɵtext(6," "),p.ɵɵelementEnd(),p.ɵɵtext(7," "),p.ɵɵelementEnd(),p.ɵɵtext(8," "),p.ɵɵelementStart(9,"p"),p.ɵɵtext(10),p.ɵɵpipe(11,"i18n"),p.ɵɵelementEnd(),p.ɵɵtext(12," "),p.ɵɵtemplate(13,C,9,6,"div",1),p.ɵɵtext(14," "),p.ɵɵtemplate(15,T,6,2,"div",2),p.ɵɵtext(16," "),p.ɵɵtemplate(17,M,0,0,"ng-template",null,3,p.ɵɵtemplateRefExtractor),p.ɵɵtext(19," ")),2&e&&(p.ɵɵadvance(3),p.ɵɵtextInterpolate1(" ",p.ɵɵpipeBind1(4,5,"reusedPasswordsReport")," "),p.ɵɵadvance(2),p.ɵɵproperty("ngIf",t.hasLoaded&&t.loading),p.ɵɵadvance(5),p.ɵɵtextInterpolate(p.ɵɵpipeBind1(11,7,"reusedPasswordsReportDesc")),p.ɵɵadvance(3),p.ɵɵproperty("ngIf",!t.hasLoaded&&t.loading),p.ɵɵadvance(2),p.ɵɵproperty("ngIf",t.hasLoaded))},directives:[v.NgIf,y.CalloutComponent,v.NgForOf,g.IconComponent,x.StopClickDirective,S.StopPropDirective],pipes:[b.I18nPipe,v.DecimalPipe],encapsulation:2}),t}(c.CipherReportComponent);t.ReusedPasswordsReportComponent=D,("undefined"==typeof ngDevMode||ngDevMode)&&p.ɵsetClassMetadata(D,[{type:s.Component,args:[{selector:"app-reused-passwords-report",templateUrl:"reused-passwords-report.component.html"}]}],(function(){return[{type:u.CipherService},{type:d.ModalService},{type:m.MessagingService},{type:f.UserService},{type:h.PasswordRepromptService}]}),null)},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]-1?s.concat(e.login.username.substr(0,c).trim().toLowerCase().split(/[^A-Za-z0-9]/)).filter((function(e){return e.length>=3})):e.login.username.trim().toLowerCase().split(/[^A-Za-z0-9]/).filter((function(e){return e.length>=3}))}var p=i.passwordGenerationService.passwordStrength(e.login.password,s.length>0?s:null);i.passwordStrengthCache.set(a,p.score)}var u=i.passwordStrengthCache.get(a);null!=u&&u<=2&&(i.passwordStrengthMap.set(e.id,i.scoreKey(u)),t.push(e))}})),t.sort((function(e,t){return i.passwordStrengthCache.get(r(e))-i.passwordStrengthCache.get(r(t))})),this.ciphers=t,[2]}}))}))},t.prototype.getAllCiphers=function(){return this.cipherService.getAllDecrypted()},t.prototype.canManageCipher=function(e){return!0},t.prototype.scoreKey=function(e){switch(e){case 4:return["strong","success"];case 3:return["good","primary"];case 2:return["weak","warning"];default:return["veryWeak","danger"]}},t.ɵfac=function(e){return new(e||t)(p.ɵɵdirectiveInject(u.CipherService),p.ɵɵdirectiveInject(d.PasswordGenerationService),p.ɵɵdirectiveInject(m.ModalService),p.ɵɵdirectiveInject(f.MessagingService),p.ɵɵdirectiveInject(h.UserService),p.ɵɵdirectiveInject(v.PasswordRepromptService))},t.ɵcmp=p.ɵɵdefineComponent({type:t,selectors:[["app-weak-passwords-report"]],features:[p.ɵɵInheritDefinitionFeature],decls:20,vars:9,consts:[[1,"page-header"],[4,"ngIf"],["class","mt-4",4,"ngIf"],["cipherAddEdit",""],["aria-hidden","true",1,"fa","fa-spinner","fa-spin","text-muted",3,"title"],[1,"sr-only"],[1,"mt-4"],["type","success",3,"title",4,"ngIf"],["type","success",3,"title"],["type","danger",3,"title"],[1,"table","table-hover","table-list","table-ciphers"],[4,"ngFor","ngForOf"],[1,"table-list-icon"],[3,"cipher"],[1,"reduced-lh","wrap"],[4,"ngIf","ngIfElse"],["cantManage",""],[1,"text-right"],["href","#","appStopClick","",3,"title","click"],["appStopProp","","aria-hidden","true",1,"fa","fa-cube",3,"title"],["appStopProp","","aria-hidden","true",1,"fa","fa-paperclip",3,"title"]],template:function(e,t){1&e&&(p.ɵɵelementStart(0,"div",0),p.ɵɵtext(1," "),p.ɵɵelementStart(2,"h1"),p.ɵɵtext(3),p.ɵɵpipe(4,"i18n"),p.ɵɵtemplate(5,C,9,6,"small",1),p.ɵɵtext(6," "),p.ɵɵelementEnd(),p.ɵɵtext(7," "),p.ɵɵelementEnd(),p.ɵɵtext(8," "),p.ɵɵelementStart(9,"p"),p.ɵɵtext(10),p.ɵɵpipe(11,"i18n"),p.ɵɵelementEnd(),p.ɵɵtext(12," "),p.ɵɵtemplate(13,I,9,6,"div",1),p.ɵɵtext(14," "),p.ɵɵtemplate(15,M,6,2,"div",2),p.ɵɵtext(16," "),p.ɵɵtemplate(17,D,0,0,"ng-template",null,3,p.ɵɵtemplateRefExtractor),p.ɵɵtext(19," ")),2&e&&(p.ɵɵadvance(3),p.ɵɵtextInterpolate1(" ",p.ɵɵpipeBind1(4,5,"weakPasswordsReport")," "),p.ɵɵadvance(2),p.ɵɵproperty("ngIf",t.hasLoaded&&t.loading),p.ɵɵadvance(5),p.ɵɵtextInterpolate(p.ɵɵpipeBind1(11,7,"weakPasswordsReportDesc")),p.ɵɵadvance(3),p.ɵɵproperty("ngIf",!t.hasLoaded&&t.loading),p.ɵɵadvance(2),p.ɵɵproperty("ngIf",t.hasLoaded))},directives:[y.NgIf,g.CalloutComponent,y.NgForOf,x.IconComponent,S.StopClickDirective,b.StopPropDirective],pipes:[w.I18nPipe,y.DecimalPipe],encapsulation:2}),t}(c.CipherReportComponent);t.WeakPasswordsReportComponent=R,("undefined"==typeof ngDevMode||ngDevMode)&&p.ɵsetClassMetadata(R,[{type:s.Component,args:[{selector:"app-weak-passwords-report",templateUrl:"weak-passwords-report.component.html"}]}],(function(){return[{type:u.CipherService},{type:d.PasswordGenerationService},{type:m.ModalService},{type:f.MessagingService},{type:h.UserService},{type:v.PasswordRepromptService}]}),null)},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]-1)""===r.substr(o).trim()&&(i=o);e+=r.substring(0,i)}this.platformUtilsService.copyToClipboard(e,{window:window})}},e.ɵfac=function(t){return new(t||e)(i.ɵɵdirectiveInject(i.ElementRef),i.ɵɵdirectiveInject(o.PlatformUtilsService))},e.ɵdir=i.ɵɵdefineDirective({type:e,selectors:[["","appSelectCopy",""]],hostBindings:function(e,t){1&e&&i.ɵɵlistener("copy",(function(){return t.onCopy()}))}}),e}();t.SelectCopyDirective=a,("undefined"==typeof ngDevMode||ngDevMode)&&i.ɵsetClassMetadata(a,[{type:r.Directive,args:[{selector:"[appSelectCopy]"}]}],(function(){return[{type:i.ElementRef},{type:o.PlatformUtilsService}]}),{onCopy:[{type:r.HostListener,args:["copy"]}]})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ColorPasswordPipe=void 0;var r=n(0),i=n(28),o=n(0),a=function(){function e(){}return e.prototype.transform=function(e){for(var t=Array.from(e),n="",r=0;r":o=">",a=!0;break;case" ":o=" ",a=!0}var s="letter";o.match(i.Utils.regexpEmojiPresentation)?s="emoji":a||o.match(/[^\w ]/)?s="special":o.match(/\d/)&&(s="number"),n+=''+o+""}return n},e.ɵfac=function(t){return new(t||e)},e.ɵpipe=o.ɵɵdefinePipe({name:"colorPassword",type:e,pure:!0}),e}();t.ColorPasswordPipe=a,("undefined"==typeof ngDevMode||ngDevMode)&&o.ɵsetClassMetadata(a,[{type:r.Pipe,args:[{name:"colorPassword"}]}],null,null)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NotificationsService=void 0;var r=function(){};t.NotificationsService=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SettingsService=void 0;var r=function(){};t.SettingsService=r},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0?e.data:[],t=this,[4,this.userService.getProvider(this.providerId)];case 2:return t.manageOrganizations=i.sent().type===l.ProviderUserType.ProviderAdmin,[4,this.userService.getAllOrganizations()];case 3:return n=i.sent().filter((function(e){return e.isOwner&&null==e.providerId})),[4,Promise.all(n.map((function(e){return o.apiService.getOrganization(e.id)}))).then((function(e){return e.filter((function(e){return!N.includes(e.planType)})).map((function(e){return e.id}))}))];case 4:return r=i.sent(),this.addableOrganizations=n.filter((function(e){return r.includes(e.id)})),this.showAddExisting=0!==this.addableOrganizations.length,this.loading=!1,[2]}}))}))},e.prototype.isPaging=function(){var e=this.isSearching();return e&&this.didScroll&&this.resetPaging(),!e&&this.clients&&this.clients.length>this.pageSize},e.prototype.isSearching=function(){return this.searchService.isSearchable(this.searchText)},e.prototype.resetPaging=function(){return r(this,void 0,void 0,(function(){return i(this,(function(e){return this.pagedClients=[],this.loadMore(),[2]}))}))},e.prototype.loadMore=function(){if(this.clients&&!(this.clients.length<=this.pageSize)){var e=this.pagedClients.length,t=this.pageSize;0===e&&this.pagedClientsCount>this.pageSize&&(t=this.pagedClientsCount),this.clients.length>e&&(this.pagedClients=this.pagedClients.concat(this.clients.slice(e,e+t))),this.pagedClientsCount=this.pagedClients.length,this.didScroll=this.pagedClients.length>this.pageSize}},e.prototype.addExistingOrganization=function(){return r(this,void 0,void 0,(function(){var e,t=this;return i(this,(function(n){switch(n.label){case 0:return[4,this.modalService.openViewRef(c.AddOrganizationComponent,this.addModalRef,(function(n){n.providerId=t.providerId,n.organizations=t.addableOrganizations,n.onAddedOrganization.subscribe((function(){return r(t,void 0,void 0,(function(){var t;return i(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.load()];case 1:return n.sent(),e.close(),[3,3];case 2:return t=n.sent(),this.logService.error("Handled exception: "+t),[3,3];case 3:return[2]}}))}))}))}))];case 1:return e=n.sent()[0],[2]}}))}))},e.prototype.remove=function(e){return r(this,void 0,void 0,(function(){var t;return i(this,(function(n){switch(n.label){case 0:return[4,this.platformUtilsService.showDialog(this.i18nService.t("detachOrganizationConfirmation"),e.organizationName,this.i18nService.t("yes"),this.i18nService.t("no"),"warning")];case 1:if(!n.sent())return[2,!1];this.actionPromise=this.providerService.detachOrganizastion(this.providerId,e.id),n.label=2;case 2:return n.trys.push([2,5,,6]),[4,this.actionPromise];case 3:return n.sent(),this.toasterService.popAsync("success",null,this.i18nService.t("detachedOrganization",e.organizationName)),[4,this.load()];case 4:return n.sent(),[3,6];case 5:return t=n.sent(),this.validationService.showError(t),[3,6];case 6:return this.actionPromise=null,[2]}}))}))},e.ɵfac=function(t){return new(t||e)(p.ɵɵdirectiveInject(u.ActivatedRoute),p.ɵɵdirectiveInject(d.UserService),p.ɵɵdirectiveInject(m.ApiService),p.ɵɵdirectiveInject(f.SearchService),p.ɵɵdirectiveInject(h.PlatformUtilsService),p.ɵɵdirectiveInject(v.I18nService),p.ɵɵdirectiveInject(y.ToasterService),p.ɵɵdirectiveInject(g.ValidationService),p.ɵɵdirectiveInject(x.ProviderService),p.ɵɵdirectiveInject(S.LogService),p.ɵɵdirectiveInject(b.ModalService))},e.ɵcmp=p.ɵɵdefineComponent({type:e,selectors:[["ng-component"]],viewQuery:function(e,t){if(1&e&&p.ɵɵviewQuery(_,3,o.ViewContainerRef),2&e){var n;p.ɵɵqueryRefresh(n=p.ɵɵloadQuery())&&(t.addModalRef=n.first)}},decls:32,vars:19,consts:[[1,"page-header","d-flex"],[1,"ml-auto","d-flex"],["for","search",1,"sr-only"],["type","search","id","search",1,"form-control","form-control-sm",3,"placeholder","ngModel","ngModelChange"],["class","btn btn-sm btn-outline-primary ml-3","routerLink","create",4,"ngIf"],["class","btn btn-sm btn-outline-primary ml-3",3,"click",4,"ngIf"],[4,"ngIf"],["add",""],["routerLink","create",1,"btn","btn-sm","btn-outline-primary","ml-3"],["aria-hidden","true",1,"fa","fa-plus","fa-fw"],[1,"btn","btn-sm","btn-outline-primary","ml-3",3,"click"],["aria-hidden","true",1,"fa","fa-spinner","fa-spin","text-muted",3,"title"],[1,"sr-only"],["infiniteScroll","",1,"table","table-hover","table-list",3,"infiniteScrollDistance","infiniteScrollDisabled","scrolled"],[4,"ngFor","ngForOf"],["width","30"],["size","25",3,"data","circle","fontSize"],[3,"routerLink"],["class","table-list-options",4,"ngIf"],[1,"table-list-options"],["appListDropdown","",1,"dropdown"],["type","button","data-toggle","dropdown","aria-haspopup","true","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle",3,"appA11yTitle"],["aria-hidden","true",1,"fa","fa-cog","fa-lg"],[1,"dropdown-menu","dropdown-menu-right"],["href","#","appStopClick","",1,"dropdown-item","text-danger",3,"click"],["aria-hidden","true",1,"fa","fa-fw","fa-remove"]],template:function(e,t){1&e&&(p.ɵɵelementStart(0,"div",0),p.ɵɵtext(1," "),p.ɵɵelementStart(2,"h1"),p.ɵɵtext(3),p.ɵɵpipe(4,"i18n"),p.ɵɵelementEnd(),p.ɵɵtext(5," "),p.ɵɵelementStart(6,"div",1),p.ɵɵtext(7," "),p.ɵɵelementStart(8,"div"),p.ɵɵtext(9," "),p.ɵɵelementStart(10,"label",2),p.ɵɵtext(11),p.ɵɵpipe(12,"i18n"),p.ɵɵelementEnd(),p.ɵɵtext(13," "),p.ɵɵelementStart(14,"input",3),p.ɵɵlistener("ngModelChange",(function(e){return t.searchText=e})),p.ɵɵpipe(15,"i18n"),p.ɵɵelementEnd(),p.ɵɵtext(16," "),p.ɵɵelementEnd(),p.ɵɵtext(17," "),p.ɵɵtemplate(18,A,5,3,"a",4),p.ɵɵtext(19," "),p.ɵɵtemplate(20,T,5,3,"button",5),p.ɵɵtext(21," "),p.ɵɵelementEnd(),p.ɵɵtext(22," "),p.ɵɵelementEnd(),p.ɵɵtext(23," "),p.ɵɵtemplate(24,M,9,6,"ng-container",6),p.ɵɵtext(25," "),p.ɵɵtemplate(26,V,6,2,"ng-container",6),p.ɵɵpipe(27,"search"),p.ɵɵtext(28," "),p.ɵɵtemplate(29,F,0,0,"ng-template",null,7,p.ɵɵtemplateRefExtractor),p.ɵɵtext(31," ")),2&e&&(p.ɵɵadvance(3),p.ɵɵtextInterpolate(p.ɵɵpipeBind1(4,8,"clients")),p.ɵɵadvance(8),p.ɵɵtextInterpolate(p.ɵɵpipeBind1(12,10,"search")),p.ɵɵadvance(3),p.ɵɵpropertyInterpolate("placeholder",p.ɵɵpipeBind1(15,12,"search")),p.ɵɵproperty("ngModel",t.searchText),p.ɵɵadvance(4),p.ɵɵproperty("ngIf",t.manageOrganizations),p.ɵɵadvance(2),p.ɵɵproperty("ngIf",t.manageOrganizations&&t.showAddExisting),p.ɵɵadvance(4),p.ɵɵproperty("ngIf",t.loading),p.ɵɵadvance(2),p.ɵɵproperty("ngIf",!t.loading&&p.ɵɵpipeBind4(27,14,t.clients,t.searchText,"organizationName","id")))},directives:[w.DefaultValueAccessor,w.NgControlStatus,w.NgModel,C.NgIf,u.RouterLinkWithHref,C.NgForOf,I.AvatarComponent,E.A11yTitleDirective,P.StopClickDirective],pipes:[k.I18nPipe,O.SearchPipe],encapsulation:2}),e}();t.ClientsComponent=z,("undefined"==typeof ngDevMode||ngDevMode)&&p.ɵsetClassMetadata(z,[{type:o.Component,args:[{templateUrl:"clients.component.html"}]}],(function(){return[{type:u.ActivatedRoute},{type:d.UserService},{type:m.ApiService},{type:f.SearchService},{type:h.PlatformUtilsService},{type:v.I18nService},{type:y.ToasterService},{type:g.ValidationService},{type:x.ProviderService},{type:S.LogService},{type:b.ModalService}]}),{addModalRef:[{type:o.ViewChild,args:["add",{read:o.ViewContainerRef,static:!0}]}]})},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0?this.events=this.events.concat(n):this.events=n,this.dirtyDates=!1,this.loading=!1,this.morePromise=null,this.refreshPromise=null,[2]}}))}))},e.prototype.loadAndParseEvents=function(e,t,n){return r(this,void 0,void 0,(function(){var o,s,l=this;return i(this,(function(c){switch(c.label){case 0:return[4,this.requestEvents(e,t,n)];case 1:return o=c.sent(),[4,Promise.all(o.data.map((function(e){return r(l,void 0,void 0,(function(){var t,n,r;return i(this,(function(i){switch(i.label){case 0:return t=null==e.actingUserId?e.userId:e.actingUserId,[4,this.eventService.getEventInfo(e)];case 1:return n=i.sent(),r=this.getUserName(e,t),[2,new a.EventView({message:n.message,humanReadableMessage:n.humanReadableMessage,appIcon:n.appIcon,appName:n.appName,userId:t,userName:null!=r?r.name:this.i18nService.t("unknown"),userEmail:null!=r?r.email:"",date:e.date,ip:e.ipAddress,type:e.type})]}}))}))})))];case 2:return s=c.sent(),[2,{continuationToken:o.continuationToken,events:s}]}}))}))},e.prototype.parseDates=function(){var e=null;try{e=this.eventService.formatDateFilters(this.start,this.end)}catch(t){return this.toasterService.popAsync("error",this.i18nService.t("errorOccurred"),this.i18nService.t("invalidDateRange")),null}return e},e.prototype.appApiPromiseUnfulfilled=function(){return null!=this.refreshPromise||null!=this.morePromise||null!=this.exportPromise},e.prototype.export=function(e,t){return r(this,void 0,void 0,(function(){var n,r,o,a,s;return i(this,(function(i){switch(i.label){case 0:n=this.continuationToken,r=[].concat(this.events),i.label=1;case 1:return null==n?[3,3]:[4,this.loadAndParseEvents(e,t,n)];case 2:return o=i.sent(),n=o.continuationToken,r=r.concat(o.events),[3,1];case 3:return[4,this.exportService.getEventExport(r)];case 4:return a=i.sent(),s=this.exportService.getFileName(this.exportFileName,"csv"),this.platformUtilsService.saveFile(window,a,{type:"text/plain"},s),[2]}}))}))},e.ɵfac=function(t){return new(t||e)(s.ɵɵdirectiveInject(l.EventService),s.ɵɵdirectiveInject(c.I18nService),s.ɵɵdirectiveInject(p.ToasterService),s.ɵɵdirectiveInject(u.ExportService),s.ɵɵdirectiveInject(d.PlatformUtilsService),s.ɵɵdirectiveInject(m.LogService))},e.ɵdir=s.ɵɵdefineDirective({type:e}),e}();t.BaseEventsComponent=f,("undefined"==typeof ngDevMode||ngDevMode)&&s.ɵsetClassMetadata(f,[{type:o.Directive}],(function(){return[{type:l.EventService},{type:c.I18nService},{type:p.ToasterService},{type:u.ExportService},{type:d.PlatformUtilsService},{type:m.LogService}]}),null)},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&t[0].status===p.ProviderUserStatusType.Confirmed&&this.events(t[0]),[2]}))}))})),[2]}}))}))}))},t.prototype.getUsers=function(){return this.apiService.getProviderUsers(this.providerId)},t.prototype.deleteUser=function(e){return this.apiService.deleteProviderUser(this.providerId,e)},t.prototype.reinviteUser=function(e){return this.apiService.postProviderUserReinvite(this.providerId,e)},t.prototype.confirmUser=function(e,t){return a(this,void 0,void 0,(function(){var n,r,i;return s(this,(function(o){switch(o.label){case 0:return[4,this.cryptoService.getProviderKey(this.providerId)];case 1:return n=o.sent(),[4,this.cryptoService.rsaEncrypt(n.key,t.buffer)];case 2:return r=o.sent(),(i=new m.ProviderUserConfirmRequest).key=r.encryptedString,[4,this.apiService.postProviderUserConfirm(this.providerId,e.id,i)];case 3:return o.sent(),[2]}}))}))},t.prototype.edit=function(e){return a(this,void 0,void 0,(function(){var t,n=this;return s(this,(function(r){switch(r.label){case 0:return[4,this.modalService.openViewRef(x.UserAddEditComponent,this.addEditModalRef,(function(r){r.name=n.userNamePipe.transform(e),r.providerId=n.providerId,r.providerUserId=null!=e?e.id:null,r.onSavedUser.subscribe((function(){t.close(),n.load()})),r.onDeletedUser.subscribe((function(){t.close(),n.removeUser(e)}))}))];case 1:return t=r.sent()[0],[2]}}))}))},t.prototype.events=function(e){return a(this,void 0,void 0,(function(){var t=this;return s(this,(function(n){switch(n.label){case 0:return[4,this.modalService.openViewRef(v.EntityEventsComponent,this.eventsModalRef,(function(n){n.name=t.userNamePipe.transform(e),n.providerId=t.providerId,n.entityId=e.id,n.showUser=!1,n.entity="user"}))];case 1:return n.sent()[0],[2]}}))}))},t.prototype.bulkRemove=function(){return a(this,void 0,void 0,(function(){var e=this;return s(this,(function(t){switch(t.label){case 0:return null!=this.actionPromise?[2]:[4,this.modalService.openViewRef(g.BulkRemoveComponent,this.bulkRemoveModalRef,(function(t){t.providerId=e.providerId,t.users=e.getCheckedUsers()}))];case 1:return[4,t.sent()[0].onClosedPromise()];case 2:return t.sent(),[4,this.load()];case 3:return t.sent(),[2]}}))}))},t.prototype.bulkReinvite=function(){return a(this,void 0,void 0,(function(){var e,t,n,r;return s(this,(function(i){if(null!=this.actionPromise)return[2];if(e=this.getCheckedUsers(),(t=e.filter((function(e){return e.status===p.ProviderUserStatusType.Invited}))).length<=0)return this.toasterService.popAsync("error",this.i18nService.t("errorOccurred"),this.i18nService.t("noSelectedUsersApplicable")),[2];try{n=new d.ProviderUserBulkRequest(t.map((function(e){return e.id}))),r=this.apiService.postManyProviderUserReinvite(this.providerId,n),this.showBulkStatus(e,t,r,this.i18nService.t("bulkReinviteMessage"))}catch(o){this.validationService.showError(o)}return this.actionPromise=null,[2]}))}))},t.prototype.bulkConfirm=function(){return a(this,void 0,void 0,(function(){var e=this;return s(this,(function(t){switch(t.label){case 0:return null!=this.actionPromise?[2]:[4,this.modalService.openViewRef(y.BulkConfirmComponent,this.bulkConfirmModalRef,(function(t){t.providerId=e.providerId,t.users=e.getCheckedUsers()}))];case 1:return[4,t.sent()[0].onClosedPromise()];case 2:return t.sent(),[4,this.load()];case 3:return t.sent(),[2]}}))}))},t.prototype.showBulkStatus=function(e,t,n,r){return a(this,void 0,void 0,(function(){var i,a,l,c,p,u,d,m=this;return s(this,(function(s){switch(s.label){case 0:return[4,this.modalService.openViewRef(h.BulkStatusComponent,this.bulkStatusModalRef,(function(e){e.loading=!0}))];case 1:i=s.sent(),a=i[0],l=i[1],c=!1,a.onShown.subscribe((function(){c&&a.close()})),s.label=2;case 2:return s.trys.push([2,4,,5]),[4,n];case 3:return p=s.sent(),a&&(u=p.data.filter((function(e){return""!==e.error})).reduce((function(e,t){var n;return o(o({},e),((n={})[t.id]=t.error,n))}),{}),d=t.reduce((function(e,t){var n;return o(o({},e),((n={})[t.id]=t,n))}),{}),l.users=e.map((function(e){var t,n=null!==(t=u[e.id])&&void 0!==t?t:r;return d.hasOwnProperty(e.id)||(n=m.i18nService.t("bulkFilteredMessage")),{user:e,error:u.hasOwnProperty(e.id),message:n}})),l.loading=!1),[3,5];case 4:return s.sent(),c=!0,a.close(),[3,5];case 5:return[2]}}))}))},t.ɵfac=function(e){return new(e||t)(S.ɵɵdirectiveInject(b.ApiService),S.ɵɵdirectiveInject(w.ActivatedRoute),S.ɵɵdirectiveInject(C.I18nService),S.ɵɵdirectiveInject(I.ModalService),S.ɵɵdirectiveInject(E.PlatformUtilsService),S.ɵɵdirectiveInject(P.ToasterService),S.ɵɵdirectiveInject(k.CryptoService),S.ɵɵdirectiveInject(O.UserService),S.ɵɵdirectiveInject(w.Router),S.ɵɵdirectiveInject(_.StorageService),S.ɵɵdirectiveInject(A.SearchService),S.ɵɵdirectiveInject(T.ValidationService),S.ɵɵdirectiveInject(M.LogService),S.ɵɵdirectiveInject(D.SearchPipe),S.ɵɵdirectiveInject(R.UserNamePipe))},t.ɵcmp=S.ɵɵdefineComponent({type:t,selectors:[["provider-people"]],viewQuery:function(e,t){if(1&e&&(S.ɵɵviewQuery(K,3,l.ViewContainerRef),S.ɵɵviewQuery(q,3,l.ViewContainerRef),S.ɵɵviewQuery(G,3,l.ViewContainerRef),S.ɵɵviewQuery(W,3,l.ViewContainerRef),S.ɵɵviewQuery(H,3,l.ViewContainerRef),S.ɵɵviewQuery($,3,l.ViewContainerRef)),2&e){var n=void 0;S.ɵɵqueryRefresh(n=S.ɵɵloadQuery())&&(t.addEditModalRef=n.first),S.ɵɵqueryRefresh(n=S.ɵɵloadQuery())&&(t.groupsModalRef=n.first),S.ɵɵqueryRefresh(n=S.ɵɵloadQuery())&&(t.eventsModalRef=n.first),S.ɵɵqueryRefresh(n=S.ɵɵloadQuery())&&(t.bulkStatusModalRef=n.first),S.ɵɵqueryRefresh(n=S.ɵɵloadQuery())&&(t.bulkConfirmModalRef=n.first),S.ɵɵqueryRefresh(n=S.ɵɵloadQuery())&&(t.bulkRemoveModalRef=n.first)}},features:[S.ɵɵInheritDefinitionFeature],decls:110,vars:61,consts:[[1,"page-header","d-flex"],[1,"ml-auto","d-flex"],["role","group",1,"btn-group","btn-group-sm"],["type","button",1,"btn","btn-outline-secondary",3,"ngClass","click"],["class","badge badge-pill badge-info",4,"ngIf"],["class","badge badge-pill badge-warning",4,"ngIf"],[1,"ml-3"],["for","search",1,"sr-only"],["type","search","id","search",1,"form-control","form-control-sm",3,"placeholder","ngModel","ngModelChange"],["appListDropdown","",1,"dropdown","ml-3"],["type","button","id","bulkActionsButton","data-toggle","dropdown","aria-haspopup","true","aria-expanded","false",1,"btn","btn-sm","btn-outline-secondary","dropdown-toggle",3,"appA11yTitle"],["aria-hidden","true",1,"fa","fa-cog"],["aria-labelledby","bulkActionsButton",1,"dropdown-menu","dropdown-menu-right"],["appStopClick","",1,"dropdown-item",3,"click"],["aria-hidden","true",1,"fa","fa-fw","fa-envelope-o"],["class","dropdown-item text-success","appStopClick","",3,"click",4,"ngIf"],["appStopClick","",1,"dropdown-item","text-danger",3,"click"],["aria-hidden","true",1,"fa","fa-fw","fa-remove"],[1,"dropdown-divider"],["aria-hidden","true",1,"fa","fa-fw","fa-check-square-o"],["aria-hidden","true",1,"fa","fa-fw","fa-minus-square-o"],["type","button",1,"btn","btn-sm","btn-outline-primary","ml-3",3,"click"],["aria-hidden","true",1,"fa","fa-plus","fa-fw"],[4,"ngIf"],["addEdit",""],["eventsTemplate",""],["confirmTemplate",""],["bulkStatusTemplate",""],["bulkConfirmTemplate",""],["bulkRemoveTemplate",""],[1,"badge","badge-pill","badge-info"],[1,"badge","badge-pill","badge-warning"],["appStopClick","",1,"dropdown-item","text-success",3,"click"],["aria-hidden","true",1,"fa","fa-fw","fa-check"],["aria-hidden","true",1,"fa","fa-spinner","fa-spin","text-muted",3,"title"],[1,"sr-only"],["type","info","icon","fa-check-circle",3,"title",4,"ngIf"],["infiniteScroll","",1,"table","table-hover","table-list",3,"infiniteScrollDistance","infiniteScrollDisabled","scrolled"],[4,"ngFor","ngForOf"],["type","info","icon","fa-check-circle",3,"title"],[1,"table-list-checkbox",3,"click"],["type","checkbox","appStopProp","",3,"ngModel","ngModelChange"],["width","30"],["size","25",3,"data","email","circle","fontSize"],["href","#","appStopClick","",3,"click"],["class","badge badge-secondary",4,"ngIf"],["class","badge badge-warning",4,"ngIf"],["class","text-muted d-block",4,"ngIf"],[1,"table-list-options"],["appListDropdown","",1,"dropdown"],["type","button","data-toggle","dropdown","aria-haspopup","true","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle",3,"appA11yTitle"],["aria-hidden","true",1,"fa","fa-cog","fa-lg"],[1,"dropdown-menu","dropdown-menu-right"],["class","dropdown-item","href","#","appStopClick","",3,"click",4,"ngIf"],["class","dropdown-item text-success","href","#","appStopClick","",3,"click",4,"ngIf"],["href","#","appStopClick","",1,"dropdown-item","text-danger",3,"click"],[1,"badge","badge-secondary"],[1,"badge","badge-warning"],[1,"text-muted","d-block"],["aria-hidden","true",1,"fa","fa-lock",3,"title"],["href","#","appStopClick","",1,"dropdown-item",3,"click"],["href","#","appStopClick","",1,"dropdown-item","text-success",3,"click"],["aria-hidden","true",1,"fa","fa-fw","fa-sitemap"],["aria-hidden","true",1,"fa","fa-fw","fa-file-text-o"]],template:function(e,t){1&e&&(S.ɵɵelementStart(0,"div",0),S.ɵɵtext(1," "),S.ɵɵelementStart(2,"h1"),S.ɵɵtext(3),S.ɵɵpipe(4,"i18n"),S.ɵɵelementEnd(),S.ɵɵtext(5," "),S.ɵɵelementStart(6,"div",1),S.ɵɵtext(7," "),S.ɵɵelementStart(8,"div",2),S.ɵɵtext(9," "),S.ɵɵelementStart(10,"button",3),S.ɵɵlistener("click",(function(){return t.filter(null)})),S.ɵɵtext(11),S.ɵɵpipe(12,"i18n"),S.ɵɵtemplate(13,Q,2,1,"span",4),S.ɵɵtext(14," "),S.ɵɵelementEnd(),S.ɵɵtext(15," "),S.ɵɵelementStart(16,"button",3),S.ɵɵlistener("click",(function(){return t.filter(t.userStatusType.Invited)})),S.ɵɵtext(17),S.ɵɵpipe(18,"i18n"),S.ɵɵtemplate(19,Y,2,1,"span",4),S.ɵɵtext(20," "),S.ɵɵelementEnd(),S.ɵɵtext(21," "),S.ɵɵelementStart(22,"button",3),S.ɵɵlistener("click",(function(){return t.filter(t.userStatusType.Accepted)})),S.ɵɵtext(23),S.ɵɵpipe(24,"i18n"),S.ɵɵtemplate(25,J,2,1,"span",5),S.ɵɵtext(26," "),S.ɵɵelementEnd(),S.ɵɵtext(27," "),S.ɵɵelementEnd(),S.ɵɵtext(28," "),S.ɵɵelementStart(29,"div",6),S.ɵɵtext(30," "),S.ɵɵelementStart(31,"label",7),S.ɵɵtext(32),S.ɵɵpipe(33,"i18n"),S.ɵɵelementEnd(),S.ɵɵtext(34," "),S.ɵɵelementStart(35,"input",8),S.ɵɵlistener("ngModelChange",(function(e){return t.searchText=e})),S.ɵɵpipe(36,"i18n"),S.ɵɵelementEnd(),S.ɵɵtext(37," "),S.ɵɵelementEnd(),S.ɵɵtext(38," "),S.ɵɵelementStart(39,"div",9),S.ɵɵtext(40," "),S.ɵɵelementStart(41,"button",10),S.ɵɵpipe(42,"i18n"),S.ɵɵtext(43," "),S.ɵɵelement(44,"i",11),S.ɵɵtext(45," "),S.ɵɵelementEnd(),S.ɵɵtext(46," "),S.ɵɵelementStart(47,"div",12),S.ɵɵtext(48," "),S.ɵɵelementStart(49,"button",13),S.ɵɵlistener("click",(function(){return t.bulkReinvite()})),S.ɵɵtext(50," "),S.ɵɵelement(51,"i",14),S.ɵɵtext(52),S.ɵɵpipe(53,"i18n"),S.ɵɵelementEnd(),S.ɵɵtext(54," "),S.ɵɵtemplate(55,X,5,3,"button",15),S.ɵɵtext(56," "),S.ɵɵelementStart(57,"button",16),S.ɵɵlistener("click",(function(){return t.bulkRemove()})),S.ɵɵtext(58," "),S.ɵɵelement(59,"i",17),S.ɵɵtext(60),S.ɵɵpipe(61,"i18n"),S.ɵɵelementEnd(),S.ɵɵtext(62," "),S.ɵɵelement(63,"div",18),S.ɵɵtext(64," "),S.ɵɵelementStart(65,"button",13),S.ɵɵlistener("click",(function(){return t.selectAll(!0)})),S.ɵɵtext(66," "),S.ɵɵelement(67,"i",19),S.ɵɵtext(68),S.ɵɵpipe(69,"i18n"),S.ɵɵelementEnd(),S.ɵɵtext(70," "),S.ɵɵelementStart(71,"button",13),S.ɵɵlistener("click",(function(){return t.selectAll(!1)})),S.ɵɵtext(72," "),S.ɵɵelement(73,"i",20),S.ɵɵtext(74),S.ɵɵpipe(75,"i18n"),S.ɵɵelementEnd(),S.ɵɵtext(76," "),S.ɵɵelementEnd(),S.ɵɵtext(77," "),S.ɵɵelementEnd(),S.ɵɵtext(78," "),S.ɵɵelementStart(79,"button",21),S.ɵɵlistener("click",(function(){return t.invite()})),S.ɵɵtext(80," "),S.ɵɵelement(81,"i",22),S.ɵɵtext(82),S.ɵɵpipe(83,"i18n"),S.ɵɵelementEnd(),S.ɵɵtext(84," "),S.ɵɵelementEnd(),S.ɵɵtext(85," "),S.ɵɵelementEnd(),S.ɵɵtext(86," "),S.ɵɵtemplate(87,Z,9,6,"ng-container",23),S.ɵɵtext(88," "),S.ɵɵtemplate(89,he,6,2,"ng-container",23),S.ɵɵpipe(90,"search"),S.ɵɵtext(91," "),S.ɵɵtemplate(92,ve,0,0,"ng-template",null,24,S.ɵɵtemplateRefExtractor),S.ɵɵtext(94," "),S.ɵɵtemplate(95,ye,0,0,"ng-template",null,25,S.ɵɵtemplateRefExtractor),S.ɵɵtext(97," "),S.ɵɵtemplate(98,ge,0,0,"ng-template",null,26,S.ɵɵtemplateRefExtractor),S.ɵɵtext(100," "),S.ɵɵtemplate(101,xe,0,0,"ng-template",null,27,S.ɵɵtemplateRefExtractor),S.ɵɵtext(103," "),S.ɵɵtemplate(104,Se,0,0,"ng-template",null,28,S.ɵɵtemplateRefExtractor),S.ɵɵtext(106," "),S.ɵɵtemplate(107,be,0,0,"ng-template",null,29,S.ɵɵtemplateRefExtractor),S.ɵɵtext(109," ")),2&e&&(S.ɵɵadvance(3),S.ɵɵtextInterpolate(S.ɵɵpipeBind1(4,22,"people")),S.ɵɵadvance(7),S.ɵɵproperty("ngClass",S.ɵɵpureFunction1(52,we,null==t.status)),S.ɵɵadvance(1),S.ɵɵtextInterpolate1(" ",S.ɵɵpipeBind1(12,24,"all")," "),S.ɵɵadvance(2),S.ɵɵproperty("ngIf",t.allCount),S.ɵɵadvance(3),S.ɵɵproperty("ngClass",S.ɵɵpureFunction1(54,we,t.status==t.userStatusType.Invited)),S.ɵɵadvance(1),S.ɵɵtextInterpolate1(" ",S.ɵɵpipeBind1(18,26,"invited")," "),S.ɵɵadvance(2),S.ɵɵproperty("ngIf",t.invitedCount),S.ɵɵadvance(3),S.ɵɵproperty("ngClass",S.ɵɵpureFunction1(56,we,t.status==t.userStatusType.Accepted)),S.ɵɵadvance(1),S.ɵɵtextInterpolate1(" ",S.ɵɵpipeBind1(24,28,"accepted")," "),S.ɵɵadvance(2),S.ɵɵproperty("ngIf",t.acceptedCount),S.ɵɵadvance(7),S.ɵɵtextInterpolate(S.ɵɵpipeBind1(33,30,"search")),S.ɵɵadvance(3),S.ɵɵpropertyInterpolate("placeholder",S.ɵɵpipeBind1(36,32,"search")),S.ɵɵproperty("ngModel",t.searchText),S.ɵɵadvance(6),S.ɵɵpropertyInterpolate("appA11yTitle",S.ɵɵpipeBind1(42,34,"options")),S.ɵɵadvance(11),S.ɵɵtextInterpolate1(" ",S.ɵɵpipeBind1(53,36,"reinviteSelected")," "),S.ɵɵadvance(3),S.ɵɵproperty("ngIf",t.showBulkConfirmUsers),S.ɵɵadvance(5),S.ɵɵtextInterpolate1(" ",S.ɵɵpipeBind1(61,38,"remove")," "),S.ɵɵadvance(8),S.ɵɵtextInterpolate1(" ",S.ɵɵpipeBind1(69,40,"selectAll")," "),S.ɵɵadvance(6),S.ɵɵtextInterpolate1(" ",S.ɵɵpipeBind1(75,42,"unselectAll")," "),S.ɵɵadvance(8),S.ɵɵtextInterpolate1(" ",S.ɵɵpipeBind1(83,44,"inviteUser")," "),S.ɵɵadvance(5),S.ɵɵproperty("ngIf",t.loading),S.ɵɵadvance(2),S.ɵɵproperty("ngIf",!t.loading&&(t.isPaging()?t.pagedUsers:S.ɵɵpipeBindV(90,46,S.ɵɵpureFunction2(58,Ce,t.users,t.searchText)))))},directives:[B.NgClass,B.NgIf,j.DefaultValueAccessor,j.NgControlStatus,j.NgModel,U.A11yTitleDirective,V.StopClickDirective,B.NgForOf,F.CalloutComponent,j.CheckboxControlValueAccessor,N.StopPropDirective,z.AvatarComponent],pipes:[L.I18nPipe,D.SearchPipe,R.UserNamePipe],encapsulation:2}),t}(f.BasePeopleComponent);t.PeopleComponent=Ie,("undefined"==typeof ngDevMode||ngDevMode)&&S.ɵsetClassMetadata(Ie,[{type:l.Component,args:[{selector:"provider-people",templateUrl:"people.component.html"}]}],(function(){return[{type:b.ApiService},{type:w.ActivatedRoute},{type:C.I18nService},{type:I.ModalService},{type:E.PlatformUtilsService},{type:P.ToasterService},{type:k.CryptoService},{type:O.UserService},{type:w.Router},{type:_.StorageService},{type:A.SearchService},{type:T.ValidationService},{type:M.LogService},{type:D.SearchPipe},{type:R.UserNamePipe}]}),{addEditModalRef:[{type:l.ViewChild,args:["addEdit",{read:l.ViewContainerRef,static:!0}]}],groupsModalRef:[{type:l.ViewChild,args:["groupsTemplate",{read:l.ViewContainerRef,static:!0}]}],eventsModalRef:[{type:l.ViewChild,args:["eventsTemplate",{read:l.ViewContainerRef,static:!0}]}],bulkStatusModalRef:[{type:l.ViewChild,args:["bulkStatusTemplate",{read:l.ViewContainerRef,static:!0}]}],bulkConfirmModalRef:[{type:l.ViewChild,args:["bulkConfirmTemplate",{read:l.ViewContainerRef,static:!0}]}],bulkRemoveModalRef:[{type:l.ViewChild,args:["bulkRemoveTemplate",{read:l.ViewContainerRef,static:!0}]}]})},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]1&&this.confirmedCount>0&&this.confirmedCount<3&&this.acceptedCount>0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"showBulkConfirmUsers",{get:function(){return this.acceptedCount>0},enumerable:!1,configurable:!0}),e.prototype.load=function(){return r(this,void 0,void 0,(function(){var e,t,n,r,o=this;return i(this,(function(i){switch(i.label){case 0:return[4,this.getUsers()];case 1:for(e=i.sent(),this.statusMap.clear(),t=0,n=s.Utils.iterateEnum(this.userStatusType);t0?e.data:[],this.allUsers.sort(s.Utils.getSortFunction(this.i18nService,"email")),this.allUsers.forEach((function(e){o.statusMap.has(e.status)?o.statusMap.get(e.status).push(e):o.statusMap.set(e.status,[e])})),this.filter(this.status),this.loading=!1,[2]}}))}))},e.prototype.filter=function(e){this.status=e,null!=this.status?this.users=this.statusMap.get(this.status):this.users=this.allUsers,this.selectAll(!1),this.resetPaging()},e.prototype.loadMore=function(){if(this.users&&!(this.users.length<=this.pageSize)){var e=this.pagedUsers.length,t=this.pageSize;0===e&&this.pagedUsersCount>this.pageSize&&(t=this.pagedUsersCount),this.users.length>e&&(this.pagedUsers=this.pagedUsers.concat(this.users.slice(e,e+t))),this.pagedUsersCount=this.pagedUsers.length,this.didScroll=this.pagedUsers.length>this.pageSize}},e.prototype.checkUser=function(e,t){e.checked=null==t?!e.checked:t},e.prototype.selectAll=function(e){e&&this.selectAll(!1);for(var t=this.searchPipe.transform(this.users,this.searchText,"name","email","id"),n=e&&t.length>500?500:t.length,r=0;r-1&&(t.statusMap.get(t.userStatusType.Accepted).splice(n,1),t.statusMap.get(t.userStatusType.Confirmed).push(e))}(this),this.toasterService.popAsync("success",null,this.i18nService.t("hasBeenConfirmed",this.userNamePipe.transform(e))),[3,4];case 2:throw n=r.sent(),this.validationService.showError(n),n;case 3:return this.actionPromise=null,[7];case 4:return[2]}}))}))},null!=this.actionPromise)return[2];h.label=1;case 1:return h.trys.push([1,10,,11]),[4,this.apiService.getUserPublicKey(e.userId)];case 2:return n=h.sent(),o=s.Utils.fromB64ToArray(n.publicKey),[4,this.storageService.get(a.ConstantsService.autoConfirmFingerprints)];case 3:return null!=(c=h.sent())&&c?[3,5]:[4,this.modalService.openViewRef(l.UserConfirmComponent,this.confirmModalRef,(function(n){n.name=f.userNamePipe.transform(e),n.userId=null!=e?e.userId:null,n.publicKey=o,n.onConfirmedUser.subscribe((function(){return r(f,void 0,void 0,(function(){var e;return i(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),n.formPromise=t(o),[4,n.formPromise];case 1:return r.sent(),p.close(),[3,3];case 2:return e=r.sent(),this.logService.error(e),[3,3];case 3:return[2]}}))}))}))}))];case 4:return p=h.sent()[0],[2];case 5:return h.trys.push([5,7,,8]),[4,this.cryptoService.getFingerprint(e.userId,o.buffer)];case 6:return u=h.sent(),this.logService.info("User's fingerprint: "+u.join("-")),[3,8];case 7:return d=h.sent(),this.logService.error(d),[3,8];case 8:return[4,t(o)];case 9:return h.sent(),[3,11];case 10:return m=h.sent(),this.logService.error("Handled exception: "+m),[3,11];case 11:return[2]}}))}))},e.prototype.isSearching=function(){return this.searchService.isSearchable(this.searchText)},e.prototype.isPaging=function(){var e=this.isSearching();return e&&this.didScroll&&this.resetPaging(),!e&&this.users&&this.users.length>this.pageSize},e.prototype.deleteWarningMessage=function(e){return this.i18nService.t("removeUserConfirmation")},e.prototype.getCheckedUsers=function(){return this.users.filter((function(e){return e.checked}))},e.prototype.removeUser=function(e){var t=this.users.indexOf(e);t>-1&&(this.users.splice(t,1),this.resetPaging()),this.statusMap.has(e.status)&&(t=this.statusMap.get(e.status).indexOf(e))>-1&&this.statusMap.get(e.status).splice(t,1)},e.ɵfac=function(t){return new(t||e)(c.ɵɵdirectiveInject(p.ApiService),c.ɵɵdirectiveInject(u.SearchService),c.ɵɵdirectiveInject(d.I18nService),c.ɵɵdirectiveInject(m.PlatformUtilsService),c.ɵɵdirectiveInject(f.ToasterService),c.ɵɵdirectiveInject(h.CryptoService),c.ɵɵdirectiveInject(v.StorageService),c.ɵɵdirectiveInject(y.ValidationService),c.ɵɵdirectiveInject(g.ModalService),c.ɵɵdirectiveInject(x.LogService),c.ɵɵdirectiveInject(S.SearchPipe),c.ɵɵdirectiveInject(b.UserNamePipe))},e.ɵdir=c.ɵɵdefineDirective({type:e,viewQuery:function(e,t){if(1&e&&c.ɵɵviewQuery(w,3,o.ViewContainerRef),2&e){var n;c.ɵɵqueryRefresh(n=c.ɵɵloadQuery())&&(t.confirmModalRef=n.first)}}}),e}();t.BasePeopleComponent=C,("undefined"==typeof ngDevMode||ngDevMode)&&c.ɵsetClassMetadata(C,[{type:o.Directive}],(function(){return[{type:p.ApiService},{type:u.SearchService},{type:d.I18nService},{type:m.PlatformUtilsService},{type:f.ToasterService},{type:h.CryptoService},{type:v.StorageService},{type:y.ValidationService},{type:g.ModalService},{type:x.LogService},{type:S.SearchPipe},{type:b.UserNamePipe}]}),{confirmModalRef:[{type:o.ViewChild,args:["confirmTemplate",{read:o.ViewContainerRef,static:!0}]}]})},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&!n.error),p.ɵɵadvance(9),p.ɵɵtextInterpolate(p.ɵɵpipeBind1(12,3,"user")),p.ɵɵadvance(5),p.ɵɵproperty("ngForOf",n.users)}}function C(e,t){if(1&e&&(p.ɵɵelementStart(0,"small",24),p.ɵɵtext(1),p.ɵɵelementEnd()),2&e){var n=p.ɵɵnextContext().$implicit;p.ɵɵadvance(1),p.ɵɵtextInterpolate(n.name)}}function I(e,t){if(1&e&&(p.ɵɵelementStart(0,"td"),p.ɵɵtext(1),p.ɵɵelementEnd()),2&e){var n=p.ɵɵnextContext().$implicit,r=p.ɵɵnextContext(2);p.ɵɵadvance(1),p.ɵɵtextInterpolate1(" ",r.statuses.get(n.id)," ")}}function E(e,t){1&e&&(p.ɵɵelementStart(0,"td"),p.ɵɵtext(1),p.ɵɵpipe(2,"i18n"),p.ɵɵelementEnd()),2&e&&(p.ɵɵadvance(1),p.ɵɵtextInterpolate1(" ",p.ɵɵpipeBind1(2,1,"bulkFilteredMessage")," "))}function P(e,t){if(1&e&&(p.ɵɵelementStart(0,"tr"),p.ɵɵtext(1," "),p.ɵɵelementStart(2,"td",21),p.ɵɵtext(3," "),p.ɵɵelement(4,"app-avatar",22),p.ɵɵpipe(5,"userName"),p.ɵɵtext(6," "),p.ɵɵelementEnd(),p.ɵɵtext(7," "),p.ɵɵelementStart(8,"td"),p.ɵɵtext(9),p.ɵɵtemplate(10,C,2,1,"small",23),p.ɵɵtext(11," "),p.ɵɵelementEnd(),p.ɵɵtext(12," "),p.ɵɵtemplate(13,I,2,1,"td",10),p.ɵɵtext(14," "),p.ɵɵtemplate(15,E,3,3,"td",10),p.ɵɵtext(16," "),p.ɵɵelementEnd()),2&e){var n=t.$implicit,r=p.ɵɵnextContext(2);p.ɵɵadvance(4),p.ɵɵproperty("data",p.ɵɵpipeBind1(5,8,n))("email",n.email)("circle",!0)("fontSize",14),p.ɵɵadvance(5),p.ɵɵtextInterpolate1(" ",n.email," "),p.ɵɵadvance(1),p.ɵɵproperty("ngIf",n.name),p.ɵɵadvance(3),p.ɵɵproperty("ngIf",r.statuses.has(n.id)),p.ɵɵadvance(2),p.ɵɵproperty("ngIf",!r.statuses.has(n.id))}}function k(e,t){if(1&e&&(p.ɵɵelementContainerStart(0),p.ɵɵtext(1," "),p.ɵɵelementStart(2,"table",17),p.ɵɵtext(3," "),p.ɵɵelementStart(4,"thead"),p.ɵɵtext(5," "),p.ɵɵelementStart(6,"tr"),p.ɵɵtext(7," "),p.ɵɵelementStart(8,"th",18),p.ɵɵtext(9),p.ɵɵpipe(10,"i18n"),p.ɵɵelementEnd(),p.ɵɵtext(11," "),p.ɵɵelementStart(12,"th"),p.ɵɵtext(13),p.ɵɵpipe(14,"i18n"),p.ɵɵelementEnd(),p.ɵɵtext(15," "),p.ɵɵelementEnd(),p.ɵɵtext(16," "),p.ɵɵelementEnd(),p.ɵɵtext(17," "),p.ɵɵtemplate(18,P,17,10,"tr",19),p.ɵɵtext(19," "),p.ɵɵelementEnd(),p.ɵɵtext(20," "),p.ɵɵelementContainerEnd()),2&e){var n=p.ɵɵnextContext();p.ɵɵadvance(9),p.ɵɵtextInterpolate(p.ɵɵpipeBind1(10,3,"user")),p.ɵɵadvance(4),p.ɵɵtextInterpolate(p.ɵɵpipeBind1(14,5,"status")),p.ɵɵadvance(5),p.ɵɵproperty("ngForOf",n.users)}}function O(e,t){if(1&e){var n=p.ɵɵgetCurrentView();p.ɵɵelementStart(0,"button",25),p.ɵɵlistener("click",(function(){return p.ɵɵrestoreView(n),p.ɵɵnextContext().submit()})),p.ɵɵtext(1," "),p.ɵɵelement(2,"i",26),p.ɵɵpipe(3,"i18n"),p.ɵɵtext(4," "),p.ɵɵelementStart(5,"span"),p.ɵɵtext(6),p.ɵɵpipe(7,"i18n"),p.ɵɵelementEnd(),p.ɵɵtext(8," "),p.ɵɵelementEnd()}if(2&e){var r=p.ɵɵnextContext();p.ɵɵproperty("disabled",r.loading),p.ɵɵadvance(2),p.ɵɵpropertyInterpolate("title",p.ɵɵpipeBind1(3,3,"loading")),p.ɵɵadvance(4),p.ɵɵtextInterpolate(p.ɵɵpipeBind1(7,5,"removeUsers"))}}var _=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.deleteUsers=function(){return o(this,void 0,void 0,(function(){var e;return a(this,(function(t){switch(t.label){case 0:return e=new l.ProviderUserBulkRequest(this.users.map((function(e){return e.id}))),[4,this.apiService.deleteManyProviderUsers(this.providerId,e)];case 1:return[2,t.sent()]}}))}))},t.ɵfac=function(e){return A(e||t)},t.ɵcmp=p.ɵɵdefineComponent({type:t,selectors:[["ng-component"]],inputs:{providerId:"providerId"},features:[p.ɵɵInheritDefinitionFeature],decls:43,vars:14,consts:[["role","dialog","aria-modal","true","aria-labelledby","bulkTitle",1,"modal","fade"],["role","document",1,"modal-dialog","modal-dialog-scrollable","modal-lg"],[1,"modal-content"],[1,"modal-header"],["id","bulkTitle",1,"modal-title"],["type","button","data-dismiss","modal",1,"close",3,"appA11yTitle"],["aria-hidden","true"],[1,"modal-body"],["type","danger",4,"ngIf"],["type","error",4,"ngIf"],[4,"ngIf"],[1,"modal-footer"],["type","submit","class","btn btn-primary btn-submit",3,"disabled","click",4,"ngIf"],["type","button","data-dismiss","modal",1,"btn","btn-outline-secondary"],["type","danger"],["type","error"],["type","warning",4,"ngIf"],[1,"table","table-hover","table-list"],["colspan","2"],[4,"ngFor","ngForOf"],["type","warning"],["width","30"],["size","25",3,"data","email","circle","fontSize"],["class","text-muted d-block",4,"ngIf"],[1,"text-muted","d-block"],["type","submit",1,"btn","btn-primary","btn-submit",3,"disabled","click"],["aria-hidden","true",1,"fa","fa-spinner","fa-spin",3,"title"]],template:function(e,t){1&e&&(p.ɵɵelementStart(0,"div",0),p.ɵɵtext(1," "),p.ɵɵelementStart(2,"div",1),p.ɵɵtext(3," "),p.ɵɵelementStart(4,"div",2),p.ɵɵtext(5," "),p.ɵɵelementStart(6,"div",3),p.ɵɵtext(7," "),p.ɵɵelementStart(8,"h2",4),p.ɵɵtext(9),p.ɵɵpipe(10,"i18n"),p.ɵɵelementEnd(),p.ɵɵtext(11," "),p.ɵɵelementStart(12,"button",5),p.ɵɵpipe(13,"i18n"),p.ɵɵtext(14," "),p.ɵɵelementStart(15,"span",6),p.ɵɵtext(16,"×"),p.ɵɵelementEnd(),p.ɵɵtext(17," "),p.ɵɵelementEnd(),p.ɵɵtext(18," "),p.ɵɵelementEnd(),p.ɵɵtext(19," "),p.ɵɵelementStart(20,"div",7),p.ɵɵtext(21," "),p.ɵɵtemplate(22,y,3,3,"app-callout",8),p.ɵɵtext(23," "),p.ɵɵtemplate(24,g,2,1,"app-callout",9),p.ɵɵtext(25," "),p.ɵɵtemplate(26,w,19,5,"ng-container",10),p.ɵɵtext(27," "),p.ɵɵtemplate(28,k,21,7,"ng-container",10),p.ɵɵtext(29," "),p.ɵɵelementEnd(),p.ɵɵtext(30," "),p.ɵɵelementStart(31,"div",11),p.ɵɵtext(32," "),p.ɵɵtemplate(33,O,9,7,"button",12),p.ɵɵtext(34," "),p.ɵɵelementStart(35,"button",13),p.ɵɵtext(36),p.ɵɵpipe(37,"i18n"),p.ɵɵelementEnd(),p.ɵɵtext(38," "),p.ɵɵelementEnd(),p.ɵɵtext(39," "),p.ɵɵelementEnd(),p.ɵɵtext(40," "),p.ɵɵelementEnd(),p.ɵɵtext(41," "),p.ɵɵelementEnd(),p.ɵɵtext(42," ")),2&e&&(p.ɵɵadvance(9),p.ɵɵtextInterpolate1(" ",p.ɵɵpipeBind1(10,8,"removeUsers")," "),p.ɵɵadvance(3),p.ɵɵpropertyInterpolate("appA11yTitle",p.ɵɵpipeBind1(13,10,"close")),p.ɵɵadvance(10),p.ɵɵproperty("ngIf",t.users.length<=0),p.ɵɵadvance(2),p.ɵɵproperty("ngIf",t.error),p.ɵɵadvance(2),p.ɵɵproperty("ngIf",!t.done),p.ɵɵadvance(2),p.ɵɵproperty("ngIf",t.done),p.ɵɵadvance(5),p.ɵɵproperty("ngIf",!t.done&&t.users.length>0),p.ɵɵadvance(3),p.ɵɵtextInterpolate(p.ɵɵpipeBind1(37,12,"close")))},directives:[u.A11yTitleDirective,d.NgIf,m.CalloutComponent,d.NgForOf,f.AvatarComponent],pipes:[h.I18nPipe,v.UserNamePipe],encapsulation:2}),t}(c.BulkRemoveComponent);t.BulkRemoveComponent=_;var A=p.ɵɵgetInheritedFactory(_);("undefined"==typeof ngDevMode||ngDevMode)&&p.ɵsetClassMetadata(_,[{type:s.Component,args:[{templateUrl:"/src/app/organizations/manage/bulk/bulk-remove.component.html"}]}],null,{providerId:[{type:s.Input}]})},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]-1&&(this.email=t.email),null!=t.premium?this.stateService.save("loginRedirect",{route:"/settings/premium"}):null!=t.org&&this.stateService.save("loginRedirect",{route:"/settings/create-organization",qParams:{plan:t.org}}),null!=t.sponsorshipToken&&this.stateService.save("loginRedirect",{route:"/setup/families-for-enterprise",qParams:{token:t.sponsorshipToken}}),[4,e.prototype.ngOnInit.call(this)];case 1:return n.sent(),[2]}}))}))})),[4,this.stateService.get("orgInvitation")];case 1:if(null==(t=p.sent()))return[3,6];n=null,p.label=2;case 2:return p.trys.push([2,4,,5]),[4,this.apiService.getPoliciesByToken(t.organizationId,t.token,t.email,t.organizationUserId)];case 3:return r=p.sent(),n=this.policyService.mapPoliciesFromToken(r),[3,5];case 4:return i=p.sent(),this.logService.error(i),[3,5];case 5:null!=n&&(s=this.policyService.getResetPasswordPolicyOptions(n,t.organizationId),this.showResetPasswordAutoEnrollWarning=s[1]&&s[0].autoEnrollEnabled),p.label=6;case 6:return[2]}}))}))},t.prototype.goAfterLogIn=function(){return o(this,void 0,void 0,(function(){var e;return a(this,(function(t){switch(t.label){case 0:return[4,this.stateService.get("loginRedirect")];case 1:return null==(e=t.sent())?[3,3]:(this.router.navigate([e.route],{queryParams:e.qParams}),[4,this.stateService.remove("loginRedirect")]);case 2:return t.sent(),[3,4];case 3:this.router.navigate([this.successRoute]),t.label=4;case 4:return[2]}}))}))},t.ɵfac=function(e){return new(e||t)(p.ɵɵdirectiveInject(u.AuthService),p.ɵɵdirectiveInject(d.Router),p.ɵɵdirectiveInject(m.I18nService),p.ɵɵdirectiveInject(d.ActivatedRoute),p.ɵɵdirectiveInject(f.StorageService),p.ɵɵdirectiveInject(h.StateService),p.ɵɵdirectiveInject(v.PlatformUtilsService),p.ɵɵdirectiveInject(y.EnvironmentService),p.ɵɵdirectiveInject(g.PasswordGenerationService),p.ɵɵdirectiveInject(x.CryptoFunctionService),p.ɵɵdirectiveInject(S.ApiService),p.ɵɵdirectiveInject(b.PolicyService),p.ɵɵdirectiveInject(w.LogService))},t.ɵcmp=p.ɵɵdefineComponent({type:t,selectors:[["app-login"]],features:[p.ɵɵInheritDefinitionFeature],decls:102,vars:45,consts:[["ngNativeValidate","",1,"container",3,"appApiAction","ngSubmit"],["form",""],[1,"row","justify-content-md-center","mt-5"],[1,"col-5"],["alt","Bitwarden",1,"mb-2","logo","logo-themed"],[1,"lead","text-center","mx-4","mb-4"],[1,"card","d-block"],[1,"card-body"],["type","warning",3,"title",4,"ngIf"],[1,"form-group"],["for","email"],["id","email","type","text","name","Email","required","","inputmode","email","appInputVerbatim","false",1,"form-control",3,"ngModel","ngModelChange"],["for","masterPassword"],[1,"d-flex"],["id","masterPassword","name","MasterPassword","required","","appInputVerbatim","",1,"text-monospace","form-control",3,"type","ngModel","ngModelChange"],["type","button",1,"ml-1","btn","btn-link",3,"appA11yTitle","click"],["aria-hidden","true",1,"fa","fa-lg",3,"ngClass"],[1,"form-text"],["routerLink","/hint"],[1,"form-check","mb-3"],["type","checkbox","id","rememberEmail","name","RememberEmail",1,"form-check-input",3,"ngModel","ngModelChange"],["for","rememberEmail",1,"form-check-label"],[1,"mb-n3",3,"hidden"],["id","hcaptcha_iframe","height","80"],["type","submit",1,"btn","btn-primary","btn-block","btn-submit",3,"disabled"],["aria-hidden","true",1,"fa","fa-sign-in"],["aria-hidden","true",1,"fa","fa-spinner","fa-spin",3,"title"],["routerLink","/register",1,"btn","btn-outline-secondary","btn-block","ml-2","mt-0",3,"queryParams"],["aria-hidden","true",1,"fa","fa-pencil-square-o"],["routerLink","/sso",1,"btn","btn-outline-secondary","btn-block","mt-2"],["aria-hidden","true",1,"fa","fa-bank"],["type","warning",3,"title"]],template:function(e,t){if(1&e&&(p.ɵɵelementStart(0,"form",0,1),p.ɵɵlistener("ngSubmit",(function(){return t.submit()})),p.ɵɵtext(2," "),p.ɵɵelementStart(3,"div",2),p.ɵɵtext(4," "),p.ɵɵelementStart(5,"div",3),p.ɵɵtext(6," "),p.ɵɵelement(7,"img",4),p.ɵɵtext(8," "),p.ɵɵelementStart(9,"p",5),p.ɵɵtext(10),p.ɵɵpipe(11,"i18n"),p.ɵɵelementEnd(),p.ɵɵtext(12," "),p.ɵɵelementStart(13,"div",6),p.ɵɵtext(14," "),p.ɵɵelementStart(15,"div",7),p.ɵɵtext(16," "),p.ɵɵtemplate(17,A,4,6,"app-callout",8),p.ɵɵtext(18," "),p.ɵɵelementStart(19,"div",9),p.ɵɵtext(20," "),p.ɵɵelementStart(21,"label",10),p.ɵɵtext(22),p.ɵɵpipe(23,"i18n"),p.ɵɵelementEnd(),p.ɵɵtext(24," "),p.ɵɵelementStart(25,"input",11),p.ɵɵlistener("ngModelChange",(function(e){return t.email=e})),p.ɵɵelementEnd(),p.ɵɵtext(26," "),p.ɵɵelementEnd(),p.ɵɵtext(27," "),p.ɵɵelementStart(28,"div",9),p.ɵɵtext(29," "),p.ɵɵelementStart(30,"label",12),p.ɵɵtext(31),p.ɵɵpipe(32,"i18n"),p.ɵɵelementEnd(),p.ɵɵtext(33," "),p.ɵɵelementStart(34,"div",13),p.ɵɵtext(35," "),p.ɵɵelementStart(36,"input",14),p.ɵɵlistener("ngModelChange",(function(e){return t.masterPassword=e})),p.ɵɵelementEnd(),p.ɵɵtext(37," "),p.ɵɵelementStart(38,"button",15),p.ɵɵlistener("click",(function(){return t.togglePassword()})),p.ɵɵpipe(39,"i18n"),p.ɵɵtext(40," "),p.ɵɵelement(41,"i",16),p.ɵɵtext(42," "),p.ɵɵelementEnd(),p.ɵɵtext(43," "),p.ɵɵelementEnd(),p.ɵɵtext(44," "),p.ɵɵelementStart(45,"small",17),p.ɵɵtext(46," "),p.ɵɵelementStart(47,"a",18),p.ɵɵtext(48),p.ɵɵpipe(49,"i18n"),p.ɵɵelementEnd(),p.ɵɵtext(50," "),p.ɵɵelementEnd(),p.ɵɵtext(51," "),p.ɵɵelementEnd(),p.ɵɵtext(52," "),p.ɵɵelementStart(53,"div",19),p.ɵɵtext(54," "),p.ɵɵelementStart(55,"input",20),p.ɵɵlistener("ngModelChange",(function(e){return t.rememberEmail=e})),p.ɵɵelementEnd(),p.ɵɵtext(56," "),p.ɵɵelementStart(57,"label",21),p.ɵɵtext(58),p.ɵɵpipe(59,"i18n"),p.ɵɵelementEnd(),p.ɵɵtext(60," "),p.ɵɵelementEnd(),p.ɵɵtext(61," "),p.ɵɵelementStart(62,"div",22),p.ɵɵelement(63,"iframe",23),p.ɵɵelementEnd(),p.ɵɵtext(64," "),p.ɵɵelement(65,"hr"),p.ɵɵtext(66," "),p.ɵɵelementStart(67,"div",13),p.ɵɵtext(68," "),p.ɵɵelementStart(69,"button",24),p.ɵɵtext(70," "),p.ɵɵelementStart(71,"span"),p.ɵɵtext(72," "),p.ɵɵelement(73,"i",25),p.ɵɵtext(74),p.ɵɵpipe(75,"i18n"),p.ɵɵelementEnd(),p.ɵɵtext(76," "),p.ɵɵelement(77,"i",26),p.ɵɵpipe(78,"i18n"),p.ɵɵtext(79," "),p.ɵɵelementEnd(),p.ɵɵtext(80," "),p.ɵɵelementStart(81,"a",27),p.ɵɵtext(82," "),p.ɵɵelement(83,"i",28),p.ɵɵtext(84),p.ɵɵpipe(85,"i18n"),p.ɵɵelementEnd(),p.ɵɵtext(86," "),p.ɵɵelementEnd(),p.ɵɵtext(87," "),p.ɵɵelementStart(88,"div",13),p.ɵɵtext(89," "),p.ɵɵelementStart(90,"a",29),p.ɵɵtext(91," "),p.ɵɵelement(92,"i",30),p.ɵɵtext(93),p.ɵɵpipe(94,"i18n"),p.ɵɵelementEnd(),p.ɵɵtext(95," "),p.ɵɵelementEnd(),p.ɵɵtext(96," "),p.ɵɵelementEnd(),p.ɵɵtext(97," "),p.ɵɵelementEnd(),p.ɵɵtext(98," "),p.ɵɵelementEnd(),p.ɵɵtext(99," "),p.ɵɵelementEnd(),p.ɵɵtext(100," "),p.ɵɵelementEnd(),p.ɵɵtext(101," ")),2&e){var n=p.ɵɵreference(1);p.ɵɵproperty("appApiAction",t.formPromise),p.ɵɵadvance(10),p.ɵɵtextInterpolate(p.ɵɵpipeBind1(11,20,"loginOrCreateNewAccount")),p.ɵɵadvance(7),p.ɵɵproperty("ngIf",t.showResetPasswordAutoEnrollWarning),p.ɵɵadvance(5),p.ɵɵtextInterpolate(p.ɵɵpipeBind1(23,22,"emailAddress")),p.ɵɵadvance(3),p.ɵɵproperty("ngModel",t.email),p.ɵɵadvance(6),p.ɵɵtextInterpolate(p.ɵɵpipeBind1(32,24,"masterPass")),p.ɵɵadvance(5),p.ɵɵpropertyInterpolate("type",t.showPassword?"text":"password"),p.ɵɵproperty("ngModel",t.masterPassword),p.ɵɵadvance(2),p.ɵɵpropertyInterpolate("appA11yTitle",p.ɵɵpipeBind1(39,26,"toggleVisibility")),p.ɵɵadvance(3),p.ɵɵproperty("ngClass",p.ɵɵpureFunction2(40,T,!t.showPassword,t.showPassword)),p.ɵɵadvance(7),p.ɵɵtextInterpolate(p.ɵɵpipeBind1(49,28,"getMasterPasswordHint")),p.ɵɵadvance(7),p.ɵɵproperty("ngModel",t.rememberEmail),p.ɵɵadvance(3),p.ɵɵtextInterpolate(p.ɵɵpipeBind1(59,30,"rememberEmail")),p.ɵɵadvance(4),p.ɵɵproperty("hidden",!t.showCaptcha()),p.ɵɵadvance(7),p.ɵɵproperty("disabled",n.loading),p.ɵɵadvance(5),p.ɵɵtextInterpolate1(" ",p.ɵɵpipeBind1(75,32,"logIn")," "),p.ɵɵadvance(3),p.ɵɵpropertyInterpolate("title",p.ɵɵpipeBind1(78,34,"loading")),p.ɵɵadvance(4),p.ɵɵproperty("queryParams",p.ɵɵpureFunction1(43,M,t.email)),p.ɵɵadvance(3),p.ɵɵtextInterpolate1(" ",p.ɵɵpipeBind1(85,36,"createAccount")," "),p.ɵɵadvance(9),p.ɵɵtextInterpolate1(" ",p.ɵɵpipeBind1(94,38,"enterpriseSingleSignOn")," ")}},directives:[C.NgControlStatusGroup,C.NgForm,I.ApiActionDirective,E.NgIf,C.DefaultValueAccessor,C.RequiredValidator,P.InputVerbatimDirective,C.NgControlStatus,C.NgModel,k.A11yTitleDirective,E.NgClass,d.RouterLinkWithHref,C.CheckboxControlValueAccessor,O.CalloutComponent],pipes:[_.I18nPipe],encapsulation:2}),t}(c.LoginComponent);t.LoginComponent=D,("undefined"==typeof ngDevMode||ngDevMode)&&p.ɵsetClassMetadata(D,[{type:s.Component,args:[{selector:"app-login",templateUrl:"login.component.html"}]}],(function(){return[{type:u.AuthService},{type:d.Router},{type:m.I18nService},{type:d.ActivatedRoute},{type:f.StorageService},{type:h.StateService},{type:v.PlatformUtilsService},{type:y.EnvironmentService},{type:g.PasswordGenerationService},{type:x.CryptoFunctionService},{type:S.ApiService},{type:b.PolicyService},{type:w.LogService}]}),null)},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]-1&&(s.email=e.email),null!=e.premium?s.stateService.save("loginRedirect",{route:"/settings/premium"}):null!=e.org&&(s.showCreateOrgMessage=!0,s.referenceData.flow=e.org,s.stateService.save("loginRedirect",{route:"/settings/create-organization",qParams:{plan:e.org}})),null!=e.layout&&(s.layout=s.referenceData.layout=e.layout),null!=e.reference?s.referenceData.id=e.reference:s.referenceData.id=("; "+document.cookie).split("; reference=").pop().split(";").shift(),null!=e.sponsorshipToken&&s.stateService.save("loginRedirect",{route:"/setup/families-for-enterprise",qParams:{token:e.sponsorshipToken}}),""===s.referenceData.id&&(s.referenceData.id=null)})),[4,this.stateService.get("orgInvitation")];case 1:if(null==(t=a.sent()))return[3,5];a.label=2;case 2:return a.trys.push([2,4,,5]),[4,this.apiService.getPoliciesByToken(t.organizationId,t.token,t.email,t.organizationUserId)];case 3:return null!=(n=a.sent()).data&&(r=n.data.map((function(e){return new u.PolicyData(e)})),this.policies=r.map((function(e){return new p.Policy(e)}))),[3,5];case 4:return i=a.sent(),this.logService.error(i),[3,5];case 5:return null==this.policies?[3,7]:(o=this,[4,this.policyService.getMasterPasswordPolicyOptions(this.policies)]);case 6:o.enforcedPolicyOptions=a.sent(),a.label=7;case 7:return[4,e.prototype.ngOnInit.call(this)];case 8:return a.sent(),[2]}}))}))},t.prototype.submit=function(){return o(this,void 0,void 0,(function(){return a(this,(function(t){switch(t.label){case 0:return null==this.enforcedPolicyOptions||this.policyService.evaluateMasterPassword(this.masterPasswordScore,this.masterPassword,this.enforcedPolicyOptions)?[4,e.prototype.submit.call(this)]:(this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("masterPasswordPolicyRequirementsNotMet")),[2]);case 1:return t.sent(),[2]}}))}))},t.ɵfac=function(e){return new(e||t)(m.ɵɵdirectiveInject(f.AuthService),m.ɵɵdirectiveInject(h.Router),m.ɵɵdirectiveInject(v.I18nService),m.ɵɵdirectiveInject(y.CryptoService),m.ɵɵdirectiveInject(g.ApiService),m.ɵɵdirectiveInject(h.ActivatedRoute),m.ɵɵdirectiveInject(x.StateService),m.ɵɵdirectiveInject(S.PlatformUtilsService),m.ɵɵdirectiveInject(b.PasswordGenerationService),m.ɵɵdirectiveInject(w.PolicyService),m.ɵɵdirectiveInject(C.EnvironmentService),m.ɵɵdirectiveInject(I.LogService))},t.ɵcmp=m.ɵɵdefineComponent({type:t,selectors:[["app-register"]],features:[m.ɵɵInheritDefinitionFeature],decls:149,vars:81,consts:[[1,"layout",3,"ngClass"],["class","header",4,"ngIf"],["ngNativeValidate","",1,"container",3,"appApiAction","ngSubmit"],["form",""],[1,"row"],["class","col-7",4,"ngIf"],[3,"ngClass"],[1,"row","justify-content-md-center","mt-5"],["class","lead text-center mb-4",4,"ngIf"],[1,"card","d-block"],[1,"card-body"],["type","info","icon","fa-thumb-tack",3,"title",4,"ngIf"],[1,"form-group"],["for","email"],["id","email","type","text","name","Email","required","","inputmode","email","appInputVerbatim","false",1,"form-control",3,"ngModel","appAutofocus","ngModelChange"],[1,"form-text","text-muted"],["for","name"],["id","name","type","text","name","Name",1,"form-control",3,"ngModel","appAutofocus","ngModelChange"],["type","info",3,"enforcedPolicyOptions",4,"ngIf"],["for","masterPassword"],[1,"d-flex"],[1,"w-100"],["id","masterPassword","name","MasterPassword","required","","appInputVerbatim","",1,"text-monospace","form-control","mb-1",3,"type","ngModel","ngModelChange","input"],[3,"score","showText"],["type","button",1,"ml-1","btn","btn-link",3,"appA11yTitle","click"],["aria-hidden","true",1,"fa","fa-lg",3,"ngClass"],[1,"progress-bar","invisible"],["for","masterPasswordRetype"],["id","masterPasswordRetype","name","MasterPasswordRetype","required","","appInputVerbatim","",1,"text-monospace","form-control",3,"type","ngModel","ngModelChange"],["for","hint"],["id","hint","type","text","name","Hint",1,"form-control",3,"ngModel","ngModelChange"],[3,"hidden"],["id","hcaptcha_iframe","height","80"],["class","form-group",4,"ngIf"],[1,"d-flex","mb-2"],["type","submit",1,"btn","btn-primary","btn-block","btn-submit",3,"disabled"],["aria-hidden","true",1,"fa","fa-spinner","fa-spin",3,"title"],["routerLink","/",1,"btn","btn-outline-secondary","btn-block","ml-2","mt-0"],[1,"header"],[1,"container"],[1,"col-7"],["alt","Bitwarden","src","images/logo-horizontal-white.png",1,"logo","mb-2"],[1,"mt-5"],[4,"ngIf"],[1,"highlight"],["src","images/wired-logo.png","alt","Wired"],[1,"lead","text-center","mb-4"],["type","info","icon","fa-thumb-tack",3,"title"],["type","info",3,"enforcedPolicyOptions"],[1,"form-check"],["type","checkbox","id","acceptPolicies","name","AcceptPolicies",1,"form-check-input",3,"ngModel","ngModelChange"],["for","acceptPolicies",1,"form-check-label","small","text-muted"],["href","https://bitwarden.com/terms/","target","_blank","rel","noopener"],["href","https://bitwarden.com/privacy/","target","_blank","rel","noopener"]],template:function(e,t){if(1&e&&(m.ɵɵelementStart(0,"div",0),m.ɵɵtext(1," "),m.ɵɵtemplate(2,R,13,0,"header",1),m.ɵɵtext(3," "),m.ɵɵelementStart(4,"form",2,3),m.ɵɵlistener("ngSubmit",(function(){return t.submit()})),m.ɵɵtext(6," "),m.ɵɵelementStart(7,"div",4),m.ɵɵtext(8," "),m.ɵɵtemplate(9,V,11,3,"div",5),m.ɵɵtext(10," "),m.ɵɵelementStart(11,"div",6),m.ɵɵtext(12," "),m.ɵɵelementStart(13,"div",7),m.ɵɵtext(14," "),m.ɵɵelementStart(15,"div",6),m.ɵɵtext(16," "),m.ɵɵtemplate(17,F,3,3,"p",8),m.ɵɵtext(18," "),m.ɵɵelementStart(19,"div",9),m.ɵɵtext(20," "),m.ɵɵelementStart(21,"div",10),m.ɵɵtext(22," "),m.ɵɵtemplate(23,N,4,6,"app-callout",11),m.ɵɵtext(24," "),m.ɵɵelementStart(25,"div",12),m.ɵɵtext(26," "),m.ɵɵelementStart(27,"label",13),m.ɵɵtext(28),m.ɵɵpipe(29,"i18n"),m.ɵɵelementEnd(),m.ɵɵtext(30," "),m.ɵɵelementStart(31,"input",14),m.ɵɵlistener("ngModelChange",(function(e){return t.email=e})),m.ɵɵelementEnd(),m.ɵɵtext(32," "),m.ɵɵelementStart(33,"small",15),m.ɵɵtext(34),m.ɵɵpipe(35,"i18n"),m.ɵɵelementEnd(),m.ɵɵtext(36," "),m.ɵɵelementEnd(),m.ɵɵtext(37," "),m.ɵɵelementStart(38,"div",12),m.ɵɵtext(39," "),m.ɵɵelementStart(40,"label",16),m.ɵɵtext(41),m.ɵɵpipe(42,"i18n"),m.ɵɵelementEnd(),m.ɵɵtext(43," "),m.ɵɵelementStart(44,"input",17),m.ɵɵlistener("ngModelChange",(function(e){return t.name=e})),m.ɵɵelementEnd(),m.ɵɵtext(45," "),m.ɵɵelementStart(46,"small",15),m.ɵɵtext(47),m.ɵɵpipe(48,"i18n"),m.ɵɵelementEnd(),m.ɵɵtext(49," "),m.ɵɵelementEnd(),m.ɵɵtext(50," "),m.ɵɵelementStart(51,"div",12),m.ɵɵtext(52," "),m.ɵɵtemplate(53,z,2,1,"app-callout",18),m.ɵɵtext(54," "),m.ɵɵelementStart(55,"label",19),m.ɵɵtext(56),m.ɵɵpipe(57,"i18n"),m.ɵɵelementEnd(),m.ɵɵtext(58," "),m.ɵɵelementStart(59,"div",20),m.ɵɵtext(60," "),m.ɵɵelementStart(61,"div",21),m.ɵɵtext(62," "),m.ɵɵelementStart(63,"input",22),m.ɵɵlistener("ngModelChange",(function(e){return t.masterPassword=e}))("input",(function(){return t.updatePasswordStrength()})),m.ɵɵelementEnd(),m.ɵɵtext(64," "),m.ɵɵelementStart(65,"app-password-strength",23),m.ɵɵtext(66," "),m.ɵɵelementEnd(),m.ɵɵtext(67," "),m.ɵɵelementEnd(),m.ɵɵtext(68," "),m.ɵɵelementStart(69,"div"),m.ɵɵtext(70," "),m.ɵɵelementStart(71,"button",24),m.ɵɵlistener("click",(function(){return t.togglePassword(!1)})),m.ɵɵpipe(72,"i18n"),m.ɵɵtext(73," "),m.ɵɵelement(74,"i",25),m.ɵɵtext(75," "),m.ɵɵelementEnd(),m.ɵɵtext(76," "),m.ɵɵelement(77,"div",26),m.ɵɵtext(78," "),m.ɵɵelementEnd(),m.ɵɵtext(79," "),m.ɵɵelementEnd(),m.ɵɵtext(80," "),m.ɵɵelementStart(81,"small",15),m.ɵɵtext(82),m.ɵɵpipe(83,"i18n"),m.ɵɵelementEnd(),m.ɵɵtext(84," "),m.ɵɵelementEnd(),m.ɵɵtext(85," "),m.ɵɵelementStart(86,"div",12),m.ɵɵtext(87," "),m.ɵɵelementStart(88,"label",27),m.ɵɵtext(89),m.ɵɵpipe(90,"i18n"),m.ɵɵelementEnd(),m.ɵɵtext(91," "),m.ɵɵelementStart(92,"div",20),m.ɵɵtext(93," "),m.ɵɵelementStart(94,"input",28),m.ɵɵlistener("ngModelChange",(function(e){return t.confirmMasterPassword=e})),m.ɵɵelementEnd(),m.ɵɵtext(95," "),m.ɵɵelementStart(96,"button",24),m.ɵɵlistener("click",(function(){return t.togglePassword(!0)})),m.ɵɵpipe(97,"i18n"),m.ɵɵtext(98," "),m.ɵɵelement(99,"i",25),m.ɵɵtext(100," "),m.ɵɵelementEnd(),m.ɵɵtext(101," "),m.ɵɵelementEnd(),m.ɵɵtext(102," "),m.ɵɵelementEnd(),m.ɵɵtext(103," "),m.ɵɵelementStart(104,"div",12),m.ɵɵtext(105," "),m.ɵɵelementStart(106,"label",29),m.ɵɵtext(107),m.ɵɵpipe(108,"i18n"),m.ɵɵelementEnd(),m.ɵɵtext(109," "),m.ɵɵelementStart(110,"input",30),m.ɵɵlistener("ngModelChange",(function(e){return t.hint=e})),m.ɵɵelementEnd(),m.ɵɵtext(111," "),m.ɵɵelementStart(112,"small",15),m.ɵɵtext(113),m.ɵɵpipe(114,"i18n"),m.ɵɵelementEnd(),m.ɵɵtext(115," "),m.ɵɵelementEnd(),m.ɵɵtext(116," "),m.ɵɵelementStart(117,"div",31),m.ɵɵelement(118,"iframe",32),m.ɵɵelementEnd(),m.ɵɵtext(119," "),m.ɵɵtemplate(120,L,21,10,"div",33),m.ɵɵtext(121," "),m.ɵɵelement(122,"hr"),m.ɵɵtext(123," "),m.ɵɵelementStart(124,"div",34),m.ɵɵtext(125," "),m.ɵɵelementStart(126,"button",35),m.ɵɵtext(127," "),m.ɵɵelementStart(128,"span"),m.ɵɵtext(129),m.ɵɵpipe(130,"i18n"),m.ɵɵelementEnd(),m.ɵɵtext(131," "),m.ɵɵelement(132,"i",36),m.ɵɵpipe(133,"i18n"),m.ɵɵtext(134," "),m.ɵɵelementEnd(),m.ɵɵtext(135," "),m.ɵɵelementStart(136,"a",37),m.ɵɵtext(137),m.ɵɵpipe(138,"i18n"),m.ɵɵelementEnd(),m.ɵɵtext(139," "),m.ɵɵelementEnd(),m.ɵɵtext(140," "),m.ɵɵelementEnd(),m.ɵɵtext(141," "),m.ɵɵelementEnd(),m.ɵɵtext(142," "),m.ɵɵelementEnd(),m.ɵɵtext(143," "),m.ɵɵelementEnd(),m.ɵɵtext(144," "),m.ɵɵelementEnd(),m.ɵɵtext(145," "),m.ɵɵelementEnd(),m.ɵɵtext(146," "),m.ɵɵelementEnd(),m.ɵɵtext(147," "),m.ɵɵelementEnd(),m.ɵɵtext(148," ")),2&e){var n=m.ɵɵreference(5);m.ɵɵproperty("ngClass",m.ɵɵpureFunction1(67,K,t.layout)),m.ɵɵadvance(2),m.ɵɵproperty("ngIf","enterprise2"===t.layout),m.ɵɵadvance(2),m.ɵɵproperty("appApiAction",t.formPromise),m.ɵɵadvance(5),m.ɵɵproperty("ngIf",t.layout),m.ɵɵadvance(2),m.ɵɵproperty("ngClass",m.ɵɵpureFunction2(69,q,t.layout,!t.layout)),m.ɵɵadvance(4),m.ɵɵproperty("ngClass",m.ɵɵpureFunction2(72,q,!t.layout,t.layout)),m.ɵɵadvance(2),m.ɵɵproperty("ngIf",!t.layout),m.ɵɵadvance(6),m.ɵɵproperty("ngIf",t.showCreateOrgMessage),m.ɵɵadvance(5),m.ɵɵtextInterpolate(m.ɵɵpipeBind1(29,39,"emailAddress")),m.ɵɵadvance(3),m.ɵɵproperty("ngModel",t.email)("appAutofocus",""===t.email),m.ɵɵadvance(3),m.ɵɵtextInterpolate(m.ɵɵpipeBind1(35,41,"emailAddressDesc")),m.ɵɵadvance(7),m.ɵɵtextInterpolate(m.ɵɵpipeBind1(42,43,"yourName")),m.ɵɵadvance(3),m.ɵɵproperty("ngModel",t.name)("appAutofocus",""!==t.email),m.ɵɵadvance(3),m.ɵɵtextInterpolate(m.ɵɵpipeBind1(48,45,"yourNameDesc")),m.ɵɵadvance(6),m.ɵɵproperty("ngIf",t.enforcedPolicyOptions),m.ɵɵadvance(3),m.ɵɵtextInterpolate(m.ɵɵpipeBind1(57,47,"masterPass")),m.ɵɵadvance(7),m.ɵɵpropertyInterpolate("type",t.showPassword?"text":"password"),m.ɵɵproperty("ngModel",t.masterPassword),m.ɵɵadvance(2),m.ɵɵproperty("score",t.masterPasswordScore)("showText",!0),m.ɵɵadvance(6),m.ɵɵpropertyInterpolate("appA11yTitle",m.ɵɵpipeBind1(72,49,"toggleVisibility")),m.ɵɵadvance(3),m.ɵɵproperty("ngClass",m.ɵɵpureFunction2(75,G,!t.showPassword,t.showPassword)),m.ɵɵadvance(8),m.ɵɵtextInterpolate(m.ɵɵpipeBind1(83,51,"masterPassDesc")),m.ɵɵadvance(7),m.ɵɵtextInterpolate(m.ɵɵpipeBind1(90,53,"reTypeMasterPass")),m.ɵɵadvance(5),m.ɵɵpropertyInterpolate("type",t.showPassword?"text":"password"),m.ɵɵproperty("ngModel",t.confirmMasterPassword),m.ɵɵadvance(2),m.ɵɵpropertyInterpolate("appA11yTitle",m.ɵɵpipeBind1(97,55,"toggleVisibility")),m.ɵɵadvance(3),m.ɵɵproperty("ngClass",m.ɵɵpureFunction2(78,G,!t.showPassword,t.showPassword)),m.ɵɵadvance(8),m.ɵɵtextInterpolate(m.ɵɵpipeBind1(108,57,"masterPassHint")),m.ɵɵadvance(3),m.ɵɵproperty("ngModel",t.hint),m.ɵɵadvance(3),m.ɵɵtextInterpolate(m.ɵɵpipeBind1(114,59,"masterPassHintDesc")),m.ɵɵadvance(4),m.ɵɵproperty("hidden",!t.showCaptcha()),m.ɵɵadvance(3),m.ɵɵproperty("ngIf",t.showTerms),m.ɵɵadvance(6),m.ɵɵproperty("disabled",n.loading),m.ɵɵadvance(3),m.ɵɵtextInterpolate(m.ɵɵpipeBind1(130,61,"submit")),m.ɵɵadvance(3),m.ɵɵpropertyInterpolate("title",m.ɵɵpipeBind1(133,63,"loading")),m.ɵɵadvance(5),m.ɵɵtextInterpolate1(" ",m.ɵɵpipeBind1(138,65,"cancel")," ")}},directives:[E.NgClass,E.NgIf,P.NgControlStatusGroup,P.NgForm,k.ApiActionDirective,P.DefaultValueAccessor,P.RequiredValidator,O.InputVerbatimDirective,P.NgControlStatus,P.NgModel,_.AutofocusDirective,A.PasswordStrengthComponent,T.A11yTitleDirective,h.RouterLinkWithHref,M.CalloutComponent,P.CheckboxControlValueAccessor],pipes:[D.I18nPipe],encapsulation:2}),t}(c.RegisterComponent);t.RegisterComponent=W,("undefined"==typeof ngDevMode||ngDevMode)&&m.ɵsetClassMetadata(W,[{type:s.Component,args:[{selector:"app-register",templateUrl:"register.component.html"}]}],(function(){return[{type:f.AuthService},{type:h.Router},{type:v.I18nService},{type:y.CryptoService},{type:g.ApiService},{type:h.ActivatedRoute},{type:x.StateService},{type:S.PlatformUtilsService},{type:b.PasswordGenerationService},{type:w.PolicyService},{type:C.EnvironmentService},{type:I.LogService}]}),null)},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.RemovePasswordComponent=void 0;var o=n(0),a=n(1037),s=n(0),l=n(2),c=n(9);function p(e,t){1&e&&(s.ɵɵelementStart(0,"div",2),s.ɵɵtext(1," "),s.ɵɵelementStart(2,"div"),s.ɵɵtext(3," "),s.ɵɵelement(4,"img",3),s.ɵɵtext(5," "),s.ɵɵelementStart(6,"p",4),s.ɵɵtext(7," "),s.ɵɵelement(8,"i",5),s.ɵɵpipe(9,"i18n"),s.ɵɵtext(10," "),s.ɵɵelementStart(11,"span",6),s.ɵɵtext(12),s.ɵɵpipe(13,"i18n"),s.ɵɵelementEnd(),s.ɵɵtext(14," "),s.ɵɵelementEnd(),s.ɵɵtext(15," "),s.ɵɵelementEnd(),s.ɵɵtext(16," "),s.ɵɵelementEnd()),2&e&&(s.ɵɵadvance(8),s.ɵɵpropertyInterpolate("title",s.ɵɵpipeBind1(9,2,"loading")),s.ɵɵadvance(4),s.ɵɵtextInterpolate(s.ɵɵpipeBind1(13,4,"loading")))}function u(e,t){1&e&&(s.ɵɵelement(0,"i",16),s.ɵɵpipe(1,"i18n")),2&e&&s.ɵɵpropertyInterpolate("title",s.ɵɵpipeBind1(1,1,"loading"))}function d(e,t){1&e&&(s.ɵɵelement(0,"i",16),s.ɵɵpipe(1,"i18n")),2&e&&s.ɵɵpropertyInterpolate("title",s.ɵɵpipeBind1(1,1,"loading"))}function m(e,t){if(1&e){var n=s.ɵɵgetCurrentView();s.ɵɵelementStart(0,"div",7),s.ɵɵtext(1," "),s.ɵɵelementStart(2,"div",8),s.ɵɵtext(3," "),s.ɵɵelementStart(4,"div",9),s.ɵɵtext(5," "),s.ɵɵelementStart(6,"p",10),s.ɵɵtext(7),s.ɵɵpipe(8,"i18n"),s.ɵɵelementEnd(),s.ɵɵtext(9," "),s.ɵɵelement(10,"hr"),s.ɵɵtext(11," "),s.ɵɵelementStart(12,"div",11),s.ɵɵtext(13," "),s.ɵɵelementStart(14,"div",12),s.ɵɵtext(15," "),s.ɵɵelementStart(16,"p"),s.ɵɵtext(17),s.ɵɵpipe(18,"i18n"),s.ɵɵelementEnd(),s.ɵɵtext(19," "),s.ɵɵelementStart(20,"button",13),s.ɵɵlistener("click",(function(){return s.ɵɵrestoreView(n),s.ɵɵnextContext().convert()})),s.ɵɵtext(21," "),s.ɵɵtemplate(22,u,2,3,"i",14),s.ɵɵtext(23),s.ɵɵpipe(24,"i18n"),s.ɵɵelementEnd(),s.ɵɵtext(25," "),s.ɵɵelementStart(26,"button",15),s.ɵɵlistener("click",(function(){return s.ɵɵrestoreView(n),s.ɵɵnextContext().leave()})),s.ɵɵtext(27," "),s.ɵɵtemplate(28,d,2,3,"i",14),s.ɵɵtext(29),s.ɵɵpipe(30,"i18n"),s.ɵɵelementEnd(),s.ɵɵtext(31," "),s.ɵɵelementEnd(),s.ɵɵtext(32," "),s.ɵɵelementEnd(),s.ɵɵtext(33," "),s.ɵɵelementEnd(),s.ɵɵtext(34," "),s.ɵɵelementEnd(),s.ɵɵtext(35," "),s.ɵɵelementEnd()}if(2&e){var r=s.ɵɵnextContext();s.ɵɵadvance(7),s.ɵɵtextInterpolate(s.ɵɵpipeBind1(8,8,"removeMasterPassword")),s.ɵɵadvance(10),s.ɵɵtextInterpolate(s.ɵɵpipeBind2(18,10,"convertOrganizationEncryptionDesc",r.organization.name)),s.ɵɵadvance(3),s.ɵɵproperty("disabled",r.actionPromise),s.ɵɵadvance(2),s.ɵɵproperty("ngIf",r.continuing),s.ɵɵadvance(1),s.ɵɵtextInterpolate1(" ",s.ɵɵpipeBind1(24,13,"removeMasterPassword")," "),s.ɵɵadvance(3),s.ɵɵproperty("disabled",r.actionPromise),s.ɵɵadvance(2),s.ɵɵproperty("ngIf",r.leaving),s.ɵɵadvance(1),s.ɵɵtextInterpolate1(" ",s.ɵɵpipeBind1(30,15,"leaveOrganization")," ")}}var f=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.ɵfac=function(e){return h(e||t)},t.ɵcmp=s.ɵɵdefineComponent({type:t,selectors:[["app-remove-password"]],features:[s.ɵɵInheritDefinitionFeature],decls:4,vars:2,consts:[["class","mt-5 d-flex justify-content-center",4,"ngIf"],["class","container",4,"ngIf"],[1,"mt-5","d-flex","justify-content-center"],["alt","Bitwarden",1,"mb-4","logo","logo-themed"],[1,"text-center"],["aria-hidden","true",1,"fa","fa-spinner","fa-spin","fa-2x","text-muted",3,"title"],[1,"sr-only"],[1,"container"],[1,"row","justify-content-md-center","mt-5"],[1,"col-5"],[1,"lead","text-center","mb-4"],[1,"card","d-block"],[1,"card-body"],["type","button",1,"btn","btn-primary","btn-block",3,"disabled","click"],["class","fa fa-spinner fa-spin","aria-hidden","true",3,"title",4,"ngIf"],["type","button",1,"btn","btn-outline-secondary","btn-block",3,"disabled","click"],["aria-hidden","true",1,"fa","fa-spinner","fa-spin",3,"title"]],template:function(e,t){1&e&&(s.ɵɵtemplate(0,p,17,6,"div",0),s.ɵɵtext(1," "),s.ɵɵtemplate(2,m,36,17,"div",1),s.ɵɵtext(3," ")),2&e&&(s.ɵɵproperty("ngIf",t.loading),s.ɵɵadvance(2),s.ɵɵproperty("ngIf",!t.loading))},directives:[l.NgIf],pipes:[c.I18nPipe],encapsulation:2}),t}(a.RemovePasswordComponent);t.RemovePasswordComponent=f;var h=s.ɵɵgetInheritedFactory(f);("undefined"==typeof ngDevMode||ngDevMode)&&s.ɵsetClassMetadata(f,[{type:o.Component,args:[{selector:"app-remove-password",templateUrl:"remove-password.component.html"}]}],null,null)},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.SetPasswordComponent=void 0;var o=n(0),a=(n(8),n(5),n(19),n(1),n(17),n(32),n(4),n(27),n(39),n(6),n(1038)),s=n(0),l=n(5),c=n(1),p=n(19),u=n(17),d=n(6),m=n(32),f=n(4),h=n(27),v=n(8),y=n(39),g=n(12),x=n(20),S=n(2),b=n(22),w=n(65),C=n(204),I=n(16),E=n(9);function P(e,t){1&e&&(s.ɵɵelementStart(0,"div",8),s.ɵɵtext(1," "),s.ɵɵelement(2,"i",9),s.ɵɵpipe(3,"i18n"),s.ɵɵtext(4),s.ɵɵpipe(5,"i18n"),s.ɵɵelementEnd()),2&e&&(s.ɵɵadvance(2),s.ɵɵpropertyInterpolate("title",s.ɵɵpipeBind1(3,2,"loading")),s.ɵɵadvance(2),s.ɵɵtextInterpolate1(" ",s.ɵɵpipeBind1(5,4,"loading")," "))}function k(e,t){1&e&&(s.ɵɵelementStart(0,"app-callout",30),s.ɵɵpipe(1,"i18n"),s.ɵɵtext(2),s.ɵɵpipe(3,"i18n"),s.ɵɵelementEnd()),2&e&&(s.ɵɵpropertyInterpolate("title",s.ɵɵpipeBind1(1,2,"resetPasswordPolicyAutoEnroll")),s.ɵɵadvance(2),s.ɵɵtextInterpolate1(" ",s.ɵɵpipeBind1(3,4,"resetPasswordAutoEnrollInviteWarning")," "))}function O(e,t){if(1&e&&(s.ɵɵelementStart(0,"app-callout",31),s.ɵɵtext(1," "),s.ɵɵelementEnd()),2&e){var n=s.ɵɵnextContext(2);s.ɵɵproperty("enforcedPolicyOptions",n.enforcedPolicyOptions)}}var _=function(e,t){return{"fa-eye":e,"fa-eye-slash":t}};function A(e,t){if(1&e){var n=s.ɵɵgetCurrentView();s.ɵɵelementStart(0,"div",10),s.ɵɵtext(1," "),s.ɵɵelementStart(2,"app-callout",11),s.ɵɵtext(3),s.ɵɵpipe(4,"i18n"),s.ɵɵelementEnd(),s.ɵɵtext(5," "),s.ɵɵtemplate(6,k,4,6,"app-callout",12),s.ɵɵtext(7," "),s.ɵɵelementStart(8,"div",13),s.ɵɵtext(9," "),s.ɵɵtemplate(10,O,2,1,"app-callout",14),s.ɵɵtext(11," "),s.ɵɵelementStart(12,"label",15),s.ɵɵtext(13),s.ɵɵpipe(14,"i18n"),s.ɵɵelementEnd(),s.ɵɵtext(15," "),s.ɵɵelementStart(16,"div",16),s.ɵɵtext(17," "),s.ɵɵelementStart(18,"div",17),s.ɵɵtext(19," "),s.ɵɵelementStart(20,"input",18),s.ɵɵlistener("ngModelChange",(function(e){return s.ɵɵrestoreView(n),s.ɵɵnextContext().masterPassword=e}))("input",(function(){return s.ɵɵrestoreView(n),s.ɵɵnextContext().updatePasswordStrength()})),s.ɵɵelementEnd(),s.ɵɵtext(21," "),s.ɵɵelementStart(22,"app-password-strength",19),s.ɵɵtext(23," "),s.ɵɵelementEnd(),s.ɵɵtext(24," "),s.ɵɵelementEnd(),s.ɵɵtext(25," "),s.ɵɵelementStart(26,"div"),s.ɵɵtext(27," "),s.ɵɵelementStart(28,"button",20),s.ɵɵlistener("click",(function(){return s.ɵɵrestoreView(n),s.ɵɵnextContext().togglePassword(!1)})),s.ɵɵpipe(29,"i18n"),s.ɵɵtext(30," "),s.ɵɵelement(31,"i",21),s.ɵɵtext(32," "),s.ɵɵelementEnd(),s.ɵɵtext(33," "),s.ɵɵelement(34,"div",22),s.ɵɵtext(35," "),s.ɵɵelementEnd(),s.ɵɵtext(36," "),s.ɵɵelementEnd(),s.ɵɵtext(37," "),s.ɵɵelementStart(38,"small",23),s.ɵɵtext(39),s.ɵɵpipe(40,"i18n"),s.ɵɵelementEnd(),s.ɵɵtext(41," "),s.ɵɵelementEnd(),s.ɵɵtext(42," "),s.ɵɵelementStart(43,"div",13),s.ɵɵtext(44," "),s.ɵɵelementStart(45,"label",24),s.ɵɵtext(46),s.ɵɵpipe(47,"i18n"),s.ɵɵelementEnd(),s.ɵɵtext(48," "),s.ɵɵelementStart(49,"div",16),s.ɵɵtext(50," "),s.ɵɵelementStart(51,"input",25),s.ɵɵlistener("ngModelChange",(function(e){return s.ɵɵrestoreView(n),s.ɵɵnextContext().masterPasswordRetype=e})),s.ɵɵelementEnd(),s.ɵɵtext(52," "),s.ɵɵelementStart(53,"button",20),s.ɵɵlistener("click",(function(){return s.ɵɵrestoreView(n),s.ɵɵnextContext().togglePassword(!0)})),s.ɵɵpipe(54,"i18n"),s.ɵɵtext(55," "),s.ɵɵelement(56,"i",21),s.ɵɵtext(57," "),s.ɵɵelementEnd(),s.ɵɵtext(58," "),s.ɵɵelementEnd(),s.ɵɵtext(59," "),s.ɵɵelementEnd(),s.ɵɵtext(60," "),s.ɵɵelementStart(61,"div",13),s.ɵɵtext(62," "),s.ɵɵelementStart(63,"label",26),s.ɵɵtext(64),s.ɵɵpipe(65,"i18n"),s.ɵɵelementEnd(),s.ɵɵtext(66," "),s.ɵɵelementStart(67,"input",27),s.ɵɵlistener("ngModelChange",(function(e){return s.ɵɵrestoreView(n),s.ɵɵnextContext().hint=e})),s.ɵɵelementEnd(),s.ɵɵtext(68," "),s.ɵɵelementStart(69,"small",23),s.ɵɵtext(70),s.ɵɵpipe(71,"i18n"),s.ɵɵelementEnd(),s.ɵɵtext(72," "),s.ɵɵelementEnd(),s.ɵɵtext(73," "),s.ɵɵelement(74,"hr"),s.ɵɵtext(75," "),s.ɵɵelementStart(76,"div",16),s.ɵɵtext(77," "),s.ɵɵelementStart(78,"button",28),s.ɵɵtext(79," "),s.ɵɵelement(80,"i",9),s.ɵɵpipe(81,"i18n"),s.ɵɵtext(82," "),s.ɵɵelementStart(83,"span"),s.ɵɵtext(84),s.ɵɵpipe(85,"i18n"),s.ɵɵelementEnd(),s.ɵɵtext(86," "),s.ɵɵelementEnd(),s.ɵɵtext(87," "),s.ɵɵelementStart(88,"button",29),s.ɵɵlistener("click",(function(){return s.ɵɵrestoreView(n),s.ɵɵnextContext().logOut()})),s.ɵɵtext(89),s.ɵɵpipe(90,"i18n"),s.ɵɵelementEnd(),s.ɵɵtext(91," "),s.ɵɵelementEnd(),s.ɵɵtext(92," "),s.ɵɵelementEnd()}if(2&e){var r=s.ɵɵnextContext(),i=s.ɵɵreference(1);s.ɵɵadvance(3),s.ɵɵtextInterpolate(s.ɵɵpipeBind1(4,23,"ssoCompleteRegistration")),s.ɵɵadvance(3),s.ɵɵproperty("ngIf",r.resetPasswordAutoEnroll),s.ɵɵadvance(4),s.ɵɵproperty("ngIf",r.enforcedPolicyOptions),s.ɵɵadvance(3),s.ɵɵtextInterpolate(s.ɵɵpipeBind1(14,25,"masterPass")),s.ɵɵadvance(7),s.ɵɵpropertyInterpolate("type",r.showPassword?"text":"password"),s.ɵɵproperty("ngModel",r.masterPassword),s.ɵɵadvance(2),s.ɵɵproperty("score",r.masterPasswordScore)("showText",!0),s.ɵɵadvance(6),s.ɵɵpropertyInterpolate("appA11yTitle",s.ɵɵpipeBind1(29,27,"toggleVisibility")),s.ɵɵadvance(3),s.ɵɵproperty("ngClass",s.ɵɵpureFunction2(45,_,!r.showPassword,r.showPassword)),s.ɵɵadvance(8),s.ɵɵtextInterpolate(s.ɵɵpipeBind1(40,29,"masterPassDesc")),s.ɵɵadvance(7),s.ɵɵtextInterpolate(s.ɵɵpipeBind1(47,31,"reTypeMasterPass")),s.ɵɵadvance(5),s.ɵɵpropertyInterpolate("type",r.showPassword?"text":"password"),s.ɵɵproperty("ngModel",r.masterPasswordRetype),s.ɵɵadvance(2),s.ɵɵpropertyInterpolate("appA11yTitle",s.ɵɵpipeBind1(54,33,"toggleVisibility")),s.ɵɵadvance(3),s.ɵɵproperty("ngClass",s.ɵɵpureFunction2(48,_,!r.showPassword,r.showPassword)),s.ɵɵadvance(8),s.ɵɵtextInterpolate(s.ɵɵpipeBind1(65,35,"masterPassHint")),s.ɵɵadvance(3),s.ɵɵproperty("ngModel",r.hint),s.ɵɵadvance(3),s.ɵɵtextInterpolate(s.ɵɵpipeBind1(71,37,"masterPassHintDesc")),s.ɵɵadvance(8),s.ɵɵproperty("disabled",i.loading),s.ɵɵadvance(2),s.ɵɵpropertyInterpolate("title",s.ɵɵpipeBind1(81,39,"loading")),s.ɵɵadvance(4),s.ɵɵtextInterpolate(s.ɵɵpipeBind1(85,41,"submit")),s.ɵɵadvance(5),s.ɵɵtextInterpolate1(" ",s.ɵɵpipeBind1(90,43,"logOut")," ")}}var T=function(e){function t(t,n,r,i,o,a,s,l,c,p,u){return e.call(this,n,r,i,o,a,s,l,c,t,p,u)||this}return i(t,e),t.ɵfac=function(e){return new(e||t)(s.ɵɵdirectiveInject(l.ApiService),s.ɵɵdirectiveInject(c.I18nService),s.ɵɵdirectiveInject(p.CryptoService),s.ɵɵdirectiveInject(u.MessagingService),s.ɵɵdirectiveInject(d.UserService),s.ɵɵdirectiveInject(m.PasswordGenerationService),s.ɵɵdirectiveInject(f.PlatformUtilsService),s.ɵɵdirectiveInject(h.PolicyService),s.ɵɵdirectiveInject(v.Router),s.ɵɵdirectiveInject(y.SyncService),s.ɵɵdirectiveInject(v.ActivatedRoute))},t.ɵcmp=s.ɵɵdefineComponent({type:t,selectors:[["app-set-password"]],features:[s.ɵɵInheritDefinitionFeature],decls:21,vars:6,consts:[["ngNativeValidate","","autocomplete","off",3,"appApiAction","ngSubmit"],["form",""],[1,"row","justify-content-md-center","mt-5"],[1,"col-5"],[1,"lead","text-center","mb-4"],[1,"card","d-block"],["class","card-body text-center",4,"ngIf"],["class","card-body",4,"ngIf"],[1,"card-body","text-center"],["aria-hidden","true",1,"fa","fa-spinner","fa-spin",3,"title"],[1,"card-body"],["type","info"],["type","warning",3,"title",4,"ngIf"],[1,"form-group"],["type","info",3,"enforcedPolicyOptions",4,"ngIf"],["for","masterPassword"],[1,"d-flex"],[1,"w-100"],["id","masterPassword","name","MasterPasswordHash","required","","appInputVerbatim","",1,"text-monospace","form-control","mb-1",3,"type","ngModel","ngModelChange","input"],[3,"score","showText"],["type","button",1,"ml-1","btn","btn-link",3,"appA11yTitle","click"],["aria-hidden","true",1,"fa","fa-lg",3,"ngClass"],[1,"progress-bar","invisible"],[1,"form-text","text-muted"],["for","masterPasswordRetype"],["id","masterPasswordRetype","name","MasterPasswordRetype","required","","appInputVerbatim","",1,"text-monospace","form-control",3,"type","ngModel","ngModelChange"],["for","hint"],["id","hint","type","text","name","Hint",1,"form-control",3,"ngModel","ngModelChange"],["type","submit",1,"btn","btn-primary","btn-block","btn-submit",3,"disabled"],["type","button",1,"btn","btn-outline-secondary","btn-block","ml-2","mt-0",3,"click"],["type","warning",3,"title"],["type","info",3,"enforcedPolicyOptions"]],template:function(e,t){1&e&&(s.ɵɵelementStart(0,"form",0,1),s.ɵɵlistener("ngSubmit",(function(){return t.submit()})),s.ɵɵtext(2," "),s.ɵɵelementStart(3,"div",2),s.ɵɵtext(4," "),s.ɵɵelementStart(5,"div",3),s.ɵɵtext(6," "),s.ɵɵelementStart(7,"p",4),s.ɵɵtext(8),s.ɵɵpipe(9,"i18n"),s.ɵɵelementEnd(),s.ɵɵtext(10," "),s.ɵɵelementStart(11,"div",5),s.ɵɵtext(12," "),s.ɵɵtemplate(13,P,6,6,"div",6),s.ɵɵtext(14," "),s.ɵɵtemplate(15,A,93,51,"div",7),s.ɵɵtext(16," "),s.ɵɵelementEnd(),s.ɵɵtext(17," "),s.ɵɵelementEnd(),s.ɵɵtext(18," "),s.ɵɵelementEnd(),s.ɵɵtext(19," "),s.ɵɵelementEnd(),s.ɵɵtext(20," ")),2&e&&(s.ɵɵproperty("appApiAction",t.formPromise),s.ɵɵadvance(8),s.ɵɵtextInterpolate(s.ɵɵpipeBind1(9,4,"setMasterPassword")),s.ɵɵadvance(5),s.ɵɵproperty("ngIf",t.syncLoading),s.ɵɵadvance(2),s.ɵɵproperty("ngIf",!t.syncLoading))},directives:[g.NgControlStatusGroup,g.NgForm,x.ApiActionDirective,S.NgIf,b.CalloutComponent,g.DefaultValueAccessor,g.RequiredValidator,w.InputVerbatimDirective,g.NgControlStatus,g.NgModel,C.PasswordStrengthComponent,I.A11yTitleDirective,S.NgClass],pipes:[E.I18nPipe],encapsulation:2}),t}(a.SetPasswordComponent);t.SetPasswordComponent=T,("undefined"==typeof ngDevMode||ngDevMode)&&s.ɵsetClassMetadata(T,[{type:o.Component,args:[{selector:"app-set-password",templateUrl:"set-password.component.html"}]}],(function(){return[{type:l.ApiService},{type:c.I18nService},{type:p.CryptoService},{type:u.MessagingService},{type:d.UserService},{type:m.PasswordGenerationService},{type:f.PlatformUtilsService},{type:h.PolicyService},{type:v.Router},{type:y.SyncService},{type:v.ActivatedRoute}]}),null)},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]1?t[1]:null},e.prototype.checkState=function(e,t){if(null==e)return!1;if(null==t)return!1;var n=e.split("_identifier="),r=t.split("_identifier=");return n[0]===r[0]},e.ɵfac=function(t){return new(t||e)(c.ɵɵdirectiveInject(p.AuthService),c.ɵɵdirectiveInject(u.Router),c.ɵɵdirectiveInject(d.I18nService),c.ɵɵdirectiveInject(u.ActivatedRoute),c.ɵɵdirectiveInject(m.StorageService),c.ɵɵdirectiveInject(f.StateService),c.ɵɵdirectiveInject(h.PlatformUtilsService),c.ɵɵdirectiveInject(v.ApiService),c.ɵɵdirectiveInject(y.CryptoFunctionService),c.ɵɵdirectiveInject(g.EnvironmentService),c.ɵɵdirectiveInject(x.PasswordGenerationService),c.ɵɵdirectiveInject(S.LogService))},e.ɵdir=c.ɵɵdefineDirective({type:e}),e}();t.SsoComponent=b,("undefined"==typeof ngDevMode||ngDevMode)&&c.ɵsetClassMetadata(b,[{type:o.Directive}],(function(){return[{type:p.AuthService},{type:u.Router},{type:d.I18nService},{type:u.ActivatedRoute},{type:m.StorageService},{type:f.StateService},{type:h.PlatformUtilsService},{type:v.ApiService},{type:y.CryptoFunctionService},{type:g.EnvironmentService},{type:x.PasswordGenerationService},{type:S.LogService}]}),null)},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.TwoFactorOptionsComponent=void 0;var o=n(0),a=(n(8),n(67),n(1),n(4),n(1040)),s=n(0),l=n(67),c=n(8),p=n(1),u=n(4),d=n(16),m=n(2),f=n(9);function h(e,t){if(1&e){var n=s.ɵɵgetCurrentView();s.ɵɵelementStart(0,"div",19),s.ɵɵtext(1," "),s.ɵɵelementStart(2,"div",11),s.ɵɵtext(3," "),s.ɵɵelementStart(4,"div",12),s.ɵɵtext(5," "),s.ɵɵelement(6,"img",20),s.ɵɵtext(7," "),s.ɵɵelementEnd(),s.ɵɵtext(8," "),s.ɵɵelementStart(9,"div",14),s.ɵɵtext(10," "),s.ɵɵelementStart(11,"h3"),s.ɵɵtext(12),s.ɵɵelementEnd(),s.ɵɵtext(13),s.ɵɵelementEnd(),s.ɵɵtext(14," "),s.ɵɵelementStart(15,"div",15),s.ɵɵtext(16," "),s.ɵɵelementStart(17,"button",16),s.ɵɵlistener("click",(function(){s.ɵɵrestoreView(n);var e=t.$implicit;return s.ɵɵnextContext().choose(e)})),s.ɵɵtext(18),s.ɵɵpipe(19,"i18n"),s.ɵɵelementEnd(),s.ɵɵtext(20," "),s.ɵɵelementEnd(),s.ɵɵtext(21," "),s.ɵɵelementEnd(),s.ɵɵtext(22," "),s.ɵɵelementEnd()}if(2&e){var r=t.$implicit;s.ɵɵadvance(6),s.ɵɵclassMap("mfaType"+r.type),s.ɵɵproperty("alt",r.name+" logo"),s.ɵɵadvance(6),s.ɵɵtextInterpolate(r.name),s.ɵɵadvance(1),s.ɵɵtextInterpolate1(" ",r.description," "),s.ɵɵadvance(4),s.ɵɵattribute("aria-describedby",r.name),s.ɵɵadvance(1),s.ɵɵtextInterpolate1(" ",s.ɵɵpipeBind1(19,7,"select")," ")}}var v=function(e){function t(t,n,r,i){return e.call(this,t,n,r,i,window)||this}return i(t,e),t.ɵfac=function(e){return new(e||t)(s.ɵɵdirectiveInject(l.AuthService),s.ɵɵdirectiveInject(c.Router),s.ɵɵdirectiveInject(p.I18nService),s.ɵɵdirectiveInject(u.PlatformUtilsService))},t.ɵcmp=s.ɵɵdefineComponent({type:t,selectors:[["app-two-factor-options"]],features:[s.ɵɵInheritDefinitionFeature],decls:65,vars:22,consts:[["role","dialog","aria-modal","true","aria-labelledby","twoStepOptionsTitle",1,"modal","fade"],["role","document",1,"modal-dialog","modal-dialog-scrollable","modal-lg"],[1,"modal-content"],[1,"modal-header"],["id","twoStepOptionsTitle",1,"modal-title"],["type","button","data-dismiss","modal",1,"close",3,"appA11yTitle"],["aria-hidden","true"],[1,"modal-body"],[1,"list-group","list-group-flush-2fa"],["class","list-group-item list-group-item-action",4,"ngFor","ngForOf"],[1,"list-group-item","list-group-item-action",3,"click"],[1,"two-factor-content"],[1,"logo-col"],["alt","rc logo",1,"recovery-code-img"],[1,"text-col"],[1,"btn-col"],["type","button",1,"btn","btn-outline-secondary","btn-sm",3,"click"],[1,"modal-footer"],["type","button","data-dismiss","modal",1,"btn","btn-outline-secondary"],[1,"list-group-item","list-group-item-action"],[3,"alt"]],template:function(e,t){1&e&&(s.ɵɵelementStart(0,"div",0),s.ɵɵtext(1," "),s.ɵɵelementStart(2,"div",1),s.ɵɵtext(3," "),s.ɵɵelementStart(4,"div",2),s.ɵɵtext(5," "),s.ɵɵelementStart(6,"div",3),s.ɵɵtext(7," "),s.ɵɵelementStart(8,"h2",4),s.ɵɵtext(9),s.ɵɵpipe(10,"i18n"),s.ɵɵelementEnd(),s.ɵɵtext(11," "),s.ɵɵelementStart(12,"button",5),s.ɵɵpipe(13,"i18n"),s.ɵɵtext(14," "),s.ɵɵelementStart(15,"span",6),s.ɵɵtext(16,"×"),s.ɵɵelementEnd(),s.ɵɵtext(17," "),s.ɵɵelementEnd(),s.ɵɵtext(18," "),s.ɵɵelementEnd(),s.ɵɵtext(19," "),s.ɵɵelementStart(20,"div",7),s.ɵɵtext(21," "),s.ɵɵelementStart(22,"div",8),s.ɵɵtext(23," "),s.ɵɵtemplate(24,h,23,9,"div",9),s.ɵɵtext(25," "),s.ɵɵelementStart(26,"div",10),s.ɵɵlistener("click",(function(){return t.recover()})),s.ɵɵtext(27," "),s.ɵɵelementStart(28,"div",11),s.ɵɵtext(29," "),s.ɵɵelementStart(30,"div",12),s.ɵɵtext(31," "),s.ɵɵelement(32,"img",13),s.ɵɵtext(33," "),s.ɵɵelementEnd(),s.ɵɵtext(34," "),s.ɵɵelementStart(35,"div",14),s.ɵɵtext(36," "),s.ɵɵelementStart(37,"h3"),s.ɵɵtext(38),s.ɵɵpipe(39,"i18n"),s.ɵɵelementEnd(),s.ɵɵtext(40),s.ɵɵpipe(41,"i18n"),s.ɵɵelementEnd(),s.ɵɵtext(42," "),s.ɵɵelementStart(43,"div",15),s.ɵɵtext(44," "),s.ɵɵelementStart(45,"button",16),s.ɵɵlistener("click",(function(){return t.recover()})),s.ɵɵpipe(46,"i18n"),s.ɵɵtext(47),s.ɵɵpipe(48,"i18n"),s.ɵɵelementEnd(),s.ɵɵtext(49," "),s.ɵɵelementEnd(),s.ɵɵtext(50," "),s.ɵɵelementEnd(),s.ɵɵtext(51," "),s.ɵɵelementEnd(),s.ɵɵtext(52," "),s.ɵɵelementEnd(),s.ɵɵtext(53," "),s.ɵɵelementEnd(),s.ɵɵtext(54," "),s.ɵɵelementStart(55,"div",17),s.ɵɵtext(56," "),s.ɵɵelementStart(57,"button",18),s.ɵɵtext(58),s.ɵɵpipe(59,"i18n"),s.ɵɵelementEnd(),s.ɵɵtext(60," "),s.ɵɵelementEnd(),s.ɵɵtext(61," "),s.ɵɵelementEnd(),s.ɵɵtext(62," "),s.ɵɵelementEnd(),s.ɵɵtext(63," "),s.ɵɵelementEnd(),s.ɵɵtext(64," ")),2&e&&(s.ɵɵadvance(9),s.ɵɵtextInterpolate(s.ɵɵpipeBind1(10,8,"twoStepOptions")),s.ɵɵadvance(3),s.ɵɵpropertyInterpolate("appA11yTitle",s.ɵɵpipeBind1(13,10,"close")),s.ɵɵadvance(12),s.ɵɵproperty("ngForOf",t.providers),s.ɵɵadvance(14),s.ɵɵtextInterpolate(s.ɵɵpipeBind1(39,12,"recoveryCodeTitle")),s.ɵɵadvance(2),s.ɵɵtextInterpolate1(" ",s.ɵɵpipeBind1(41,14,"recoveryCodeDesc")," "),s.ɵɵadvance(5),s.ɵɵattribute("aria-descibedby",s.ɵɵpipeBind1(46,16,"recoveryCodeTitle")),s.ɵɵadvance(2),s.ɵɵtextInterpolate1(" ",s.ɵɵpipeBind1(48,18,"select")," "),s.ɵɵadvance(11),s.ɵɵtextInterpolate(s.ɵɵpipeBind1(59,20,"close")))},directives:[d.A11yTitleDirective,m.NgForOf],pipes:[f.I18nPipe],encapsulation:2}),t}(a.TwoFactorOptionsComponent);t.TwoFactorOptionsComponent=v,("undefined"==typeof ngDevMode||ngDevMode)&&s.ɵsetClassMetadata(v,[{type:o.Component,args:[{selector:"app-two-factor-options",templateUrl:"two-factor-options.component.html"}]}],(function(){return[{type:l.AuthService},{type:c.Router},{type:p.I18nService},{type:u.PlatformUtilsService}]}),null)},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&r.groups.forEach((function(e){var t=l.groups.filter((function(t){return!t.accessAll&&t.id===e.id}));null!=t&&t.length>0&&(t[0].checked=!0,t[0].readOnly=e.readOnly,t[0].hidePasswords=e.hidePasswords)})),[3,9];case 8:return s=i.sent(),this.logService.error(s),[3,9];case 9:return[3,11];case 10:this.title=this.i18nService.t("addCollection"),i.label=11;case 11:return this.groups.forEach((function(e){e.accessAll&&(e.checked=!0)})),this.loading=!1,[2]}}))}))},e.prototype.check=function(e,t){e.accessAll||(e.checked=null==t?!e.checked:t,e.checked||(e.readOnly=!1,e.hidePasswords=!1))},e.prototype.selectAll=function(e){var t=this;this.groups.forEach((function(n){return t.check(n,e)}))},e.prototype.submit=function(){return r(this,void 0,void 0,(function(){var e,t,n;return i(this,(function(r){switch(r.label){case 0:if(null==this.orgKey)throw new Error("No encryption key for this organization.");return e=new s.CollectionRequest,t=e,[4,this.cryptoService.encrypt(this.name,this.orgKey)];case 1:t.name=r.sent().encryptedString,e.externalId=this.externalId,e.groups=this.groups.filter((function(e){return e.checked&&!e.accessAll})).map((function(e){return new l.SelectionReadOnlyRequest(e.id,!!e.readOnly,!!e.hidePasswords)})),r.label=2;case 2:return r.trys.push([2,4,,5]),this.editMode?this.formPromise=this.apiService.putCollection(this.organizationId,this.collectionId,e):this.formPromise=this.apiService.postCollection(this.organizationId,e),[4,this.formPromise];case 3:return r.sent(),this.toasterService.popAsync("success",null,this.i18nService.t(this.editMode?"editedCollectionId":"createdCollectionId",this.name)),this.onSavedCollection.emit(),[3,5];case 4:return n=r.sent(),this.logService.error(n),[3,5];case 5:return[2]}}))}))},e.prototype.delete=function(){return r(this,void 0,void 0,(function(){var e;return i(this,(function(t){switch(t.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(!t.sent())return[2,!1];t.label=2;case 2:return t.trys.push([2,4,,5]),this.deletePromise=this.apiService.deleteCollection(this.organizationId,this.collectionId),[4,this.deletePromise];case 3:return t.sent(),this.toasterService.popAsync("success",null,this.i18nService.t("deletedCollectionId",this.name)),this.onDeletedCollection.emit(),[3,5];case 4:return e=t.sent(),this.logService.error(e),[3,5];case 5:return[2]}}))}))},e.ɵfac=function(t){return new(t||e)(p.ɵɵdirectiveInject(u.ApiService),p.ɵɵdirectiveInject(d.I18nService),p.ɵɵdirectiveInject(m.ToasterService),p.ɵɵdirectiveInject(f.PlatformUtilsService),p.ɵɵdirectiveInject(h.CryptoService),p.ɵɵdirectiveInject(v.UserService),p.ɵɵdirectiveInject(y.LogService))},e.ɵcmp=p.ɵɵdefineComponent({type:e,selectors:[["app-collection-add-edit"]],inputs:{collectionId:"collectionId",organizationId:"organizationId",canSave:"canSave",canDelete:"canDelete"},outputs:{onSavedCollection:"onSavedCollection",onDeletedCollection:"onDeletedCollection"},decls:38,vars:12,consts:[["role","dialog","aria-modal","true","aria-labelledby","collectionAddEditTitle",1,"modal","fade"],["role","document",1,"modal-dialog","modal-dialog-scrollable"],["ngNativeValidate","",1,"modal-content",3,"appApiAction","ngSubmit"],["form",""],[1,"modal-header"],["id","collectionAddEditTitle",1,"modal-title"],["type","button","data-dismiss","modal",1,"close",3,"appA11yTitle"],["aria-hidden","true"],["class","modal-body",4,"ngIf"],[1,"modal-footer"],["type","submit","class","btn btn-primary btn-submit",3,"disabled",4,"ngIf"],["type","button","data-dismiss","modal",1,"btn","btn-outline-secondary"],["class","ml-auto",4,"ngIf"],[1,"modal-body"],["aria-hidden","true",1,"fa","fa-spinner","fa-spin","text-muted",3,"title"],[1,"sr-only"],[1,"form-group"],["for","name"],["id","name","type","text","name","Name","required","","appAutofocus","",1,"form-control",3,"ngModel","disabled","ngModelChange"],["for","externalId"],["id","externalId","type","text","name","ExternalId",1,"form-control",3,"ngModel","disabled","ngModelChange"],[1,"form-text","text-muted"],[4,"ngIf"],[1,"mt-4","d-flex","mb-0"],["class","table table-hover table-list mb-0",4,"ngIf"],[1,"ml-auto"],["type","button",1,"btn","btn-link","btn-sm","py-0",3,"click"],[1,"table","table-hover","table-list","mb-0"],["width","100",1,"text-center"],[4,"ngFor","ngForOf"],[1,"table-list-checkbox",3,"click"],["type","checkbox","appStopProp","",3,"ngModel","name","disabled","ngModelChange"],[3,"click"],[1,"text-center"],["type","checkbox",3,"ngModel","name","disabled","ngModelChange"],["aria-hidden","true",1,"fa","fa-th","text-muted","fa-fw",3,"title"],["type","submit",1,"btn","btn-primary","btn-submit",3,"disabled"],["aria-hidden","true",1,"fa","fa-spinner","fa-spin",3,"title"],["type","button","class","btn btn-outline-danger",3,"appA11yTitle","disabled","appApiAction","click",4,"ngIf"],["type","button",1,"btn","btn-outline-danger",3,"appA11yTitle","disabled","appApiAction","click"],["deleteBtn",""],["aria-hidden","true",1,"fa","fa-trash-o","fa-lg","fa-fw",3,"hidden"],["aria-hidden","true",1,"fa","fa-spinner","fa-spin","fa-lg","fa-fw",3,"hidden","title"]],template:function(e,t){1&e&&(p.ɵɵelementStart(0,"div",0),p.ɵɵtext(1," "),p.ɵɵelementStart(2,"div",1),p.ɵɵtext(3," "),p.ɵɵelementStart(4,"form",2,3),p.ɵɵlistener("ngSubmit",(function(){return t.submit()})),p.ɵɵtext(6," "),p.ɵɵelementStart(7,"div",4),p.ɵɵtext(8," "),p.ɵɵelementStart(9,"h2",5),p.ɵɵtext(10),p.ɵɵelementEnd(),p.ɵɵtext(11," "),p.ɵɵelementStart(12,"button",6),p.ɵɵpipe(13,"i18n"),p.ɵɵtext(14," "),p.ɵɵelementStart(15,"span",7),p.ɵɵtext(16,"×"),p.ɵɵelementEnd(),p.ɵɵtext(17," "),p.ɵɵelementEnd(),p.ɵɵtext(18," "),p.ɵɵelementEnd(),p.ɵɵtext(19," "),p.ɵɵtemplate(20,E,9,6,"div",8),p.ɵɵtext(21," "),p.ɵɵtemplate(22,M,26,14,"div",8),p.ɵɵtext(23," "),p.ɵɵelementStart(24,"div",9),p.ɵɵtext(25," "),p.ɵɵtemplate(26,D,9,7,"button",10),p.ɵɵtext(27," "),p.ɵɵelementStart(28,"button",11),p.ɵɵtext(29),p.ɵɵpipe(30,"i18n"),p.ɵɵelementEnd(),p.ɵɵtext(31," "),p.ɵɵtemplate(32,B,4,1,"div",12),p.ɵɵtext(33," "),p.ɵɵelementEnd(),p.ɵɵtext(34," "),p.ɵɵelementEnd(),p.ɵɵtext(35," "),p.ɵɵelementEnd(),p.ɵɵtext(36," "),p.ɵɵelementEnd(),p.ɵɵtext(37," ")),2&e&&(p.ɵɵadvance(4),p.ɵɵproperty("appApiAction",t.formPromise),p.ɵɵadvance(6),p.ɵɵtextInterpolate(t.title),p.ɵɵadvance(2),p.ɵɵpropertyInterpolate("appA11yTitle",p.ɵɵpipeBind1(13,8,"close")),p.ɵɵadvance(8),p.ɵɵproperty("ngIf",t.loading),p.ɵɵadvance(2),p.ɵɵproperty("ngIf",!t.loading),p.ɵɵadvance(4),p.ɵɵproperty("ngIf",t.canSave),p.ɵɵadvance(3),p.ɵɵtextInterpolate(p.ɵɵpipeBind1(30,10,"cancel")),p.ɵɵadvance(3),p.ɵɵproperty("ngIf",t.canDelete))},directives:[g.NgControlStatusGroup,g.NgForm,x.ApiActionDirective,S.A11yTitleDirective,b.NgIf,g.DefaultValueAccessor,g.RequiredValidator,w.AutofocusDirective,g.NgControlStatus,g.NgModel,b.NgForOf,g.CheckboxControlValueAccessor,C.StopPropDirective],pipes:[I.I18nPipe],encapsulation:2}),e}();t.CollectionAddEditComponent=j,("undefined"==typeof ngDevMode||ngDevMode)&&p.ɵsetClassMetadata(j,[{type:o.Component,args:[{selector:"app-collection-add-edit",templateUrl:"collection-add-edit.component.html"}]}],(function(){return[{type:u.ApiService},{type:d.I18nService},{type:m.ToasterService},{type:f.PlatformUtilsService},{type:h.CryptoService},{type:v.UserService},{type:y.LogService}]}),{collectionId:[{type:o.Input}],organizationId:[{type:o.Input}],canSave:[{type:o.Input}],canDelete:[{type:o.Input}],onSavedCollection:[{type:o.Output}],onDeletedCollection:[{type:o.Output}]})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CollectionRequest=void 0;var r=function(e){this.groups=[],null!=e&&(this.name=e.name?e.name.encryptedString:null,this.externalId=e.externalId)};t.CollectionRequest=r},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]this.pageSize&&(t=this.pagedCollectionsCount),this.collections.length>e&&(this.pagedCollections=this.pagedCollections.concat(this.collections.slice(e,e+t))),this.pagedCollectionsCount=this.pagedCollections.length,this.didScroll=this.pagedCollections.length>this.pageSize}},e.prototype.edit=function(e){return r(this,void 0,void 0,(function(){var t,n,r,o,a=this;return i(this,(function(i){switch(i.label){case 0:return t=null==e&&this.canCreate,n=null!=e&&this.canEdit(e),r=null!=e&&this.canDelete(e),t||n||r?[4,this.modalService.openViewRef(c.CollectionAddEditComponent,this.addEditModalRef,(function(i){i.organizationId=a.organizationId,i.collectionId=null!=e?e.id:null,i.canSave=t||n,i.canDelete=r,i.onSavedCollection.subscribe((function(){o.close(),a.load()})),i.onDeletedCollection.subscribe((function(){o.close(),a.removeCollection(e)}))}))]:(this.toasterService.popAsync("error",null,this.i18nService.t("missingPermissions")),[2]);case 1:return o=i.sent()[0],[2]}}))}))},e.prototype.add=function(){this.edit(null)},e.prototype.delete=function(e){return r(this,void 0,void 0,(function(){var t;return i(this,(function(n){switch(n.label){case 0:return[4,this.platformUtilsService.showDialog(this.i18nService.t("deleteCollectionConfirmation"),e.name,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]),[4,this.apiService.deleteCollection(this.organizationId,e.id)];case 3:return n.sent(),this.toasterService.popAsync("success",null,this.i18nService.t("deletedCollectionId",e.name)),this.removeCollection(e),[3,5];case 4:return t=n.sent(),this.logService.error(t),this.toasterService.popAsync("error",null,this.i18nService.t("missingPermissions")),[3,5];case 5:return[2]}}))}))},e.prototype.users=function(e){return r(this,void 0,void 0,(function(){var t,n=this;return i(this,(function(r){switch(r.label){case 0:return[4,this.modalService.openViewRef(p.EntityUsersComponent,this.usersModalRef,(function(r){r.organizationId=n.organizationId,r.entity="collection",r.entityId=e.id,r.entityName=e.name,r.onEditedUsers.subscribe((function(){n.load(),t.close()}))}))];case 1:return t=r.sent()[0],[2]}}))}))},e.prototype.resetPaging=function(){return r(this,void 0,void 0,(function(){return i(this,(function(e){return this.pagedCollections=[],this.loadMore(),[2]}))}))},e.prototype.isSearching=function(){return this.searchService.isSearchable(this.searchText)},e.prototype.isPaging=function(){var e=this.isSearching();return e&&this.didScroll&&this.resetPaging(),!e&&this.collections&&this.collections.length>this.pageSize},e.prototype.canEdit=function(e){return!!this.organization.canEditAnyCollection||!(!this.organization.canEditAssignedCollections||!this.assignedCollections.some((function(t){return t.id===e.id})))},e.prototype.canDelete=function(e){return!!this.organization.canDeleteAnyCollection||!(!this.organization.canDeleteAssignedCollections||!this.assignedCollections.some((function(t){return t.id===e.id})))},e.prototype.removeCollection=function(e){var t=this.collections.indexOf(e);t>-1&&(this.collections.splice(t,1),this.resetPaging())},e.ɵfac=function(t){return new(t||e)(u.ɵɵdirectiveInject(d.ApiService),u.ɵɵdirectiveInject(m.ActivatedRoute),u.ɵɵdirectiveInject(f.CollectionService),u.ɵɵdirectiveInject(h.ModalService),u.ɵɵdirectiveInject(v.ToasterService),u.ɵɵdirectiveInject(y.I18nService),u.ɵɵdirectiveInject(g.PlatformUtilsService),u.ɵɵdirectiveInject(x.UserService),u.ɵɵdirectiveInject(S.SearchService),u.ɵɵdirectiveInject(b.LogService))},e.ɵcmp=u.ɵɵdefineComponent({type:e,selectors:[["app-org-manage-collections"]],viewQuery:function(e,t){if(1&e&&(u.ɵɵviewQuery(_,3,o.ViewContainerRef),u.ɵɵviewQuery(A,3,o.ViewContainerRef)),2&e){var n=void 0;u.ɵɵqueryRefresh(n=u.ɵɵloadQuery())&&(t.addEditModalRef=n.first),u.ɵɵqueryRefresh(n=u.ɵɵloadQuery())&&(t.usersModalRef=n.first)}},decls:33,vars:18,consts:[[1,"page-header","d-flex"],[1,"ml-auto","d-flex"],["for","search",1,"sr-only"],["type","search","id","search",1,"form-control","form-control-sm",3,"placeholder","ngModel","ngModelChange"],["type","button","class","btn btn-sm btn-outline-primary ml-3",3,"click",4,"ngIf"],[4,"ngIf"],["addEdit",""],["usersTemplate",""],["type","button",1,"btn","btn-sm","btn-outline-primary","ml-3",3,"click"],["aria-hidden","true",1,"fa","fa-plus","fa-fw"],["aria-hidden","true",1,"fa","fa-spinner","fa-spin","text-muted",3,"title"],[1,"sr-only"],["class","table table-hover table-list","infiniteScroll","",3,"infiniteScrollDistance","infiniteScrollDisabled","scrolled",4,"ngIf"],["infiniteScroll","",1,"table","table-hover","table-list",3,"infiniteScrollDistance","infiniteScrollDisabled","scrolled"],[4,"ngFor","ngForOf"],["href","#","appStopClick","",3,"click"],[1,"table-list-options"],["class","dropdown","appListDropdown","",4,"ngIf"],["appListDropdown","",1,"dropdown"],["type","button","data-toggle","dropdown","aria-haspopup","true","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle",3,"appA11yTitle"],["aria-hidden","true",1,"fa","fa-cog","fa-lg"],[1,"dropdown-menu","dropdown-menu-right"],["class","dropdown-item","href","#","appStopClick","",3,"click",4,"ngIf"],["class","dropdown-item text-danger","href","#","appStopClick","",3,"click",4,"ngIf"],["href","#","appStopClick","",1,"dropdown-item",3,"click"],["aria-hidden","true",1,"fa","fa-fw","fa-users"],["href","#","appStopClick","",1,"dropdown-item","text-danger",3,"click"],["aria-hidden","true",1,"fa","fa-fw","fa-trash-o"]],template:function(e,t){1&e&&(u.ɵɵelementStart(0,"div",0),u.ɵɵtext(1," "),u.ɵɵelementStart(2,"h1"),u.ɵɵtext(3),u.ɵɵpipe(4,"i18n"),u.ɵɵelementEnd(),u.ɵɵtext(5," "),u.ɵɵelementStart(6,"div",1),u.ɵɵtext(7," "),u.ɵɵelementStart(8,"div"),u.ɵɵtext(9," "),u.ɵɵelementStart(10,"label",2),u.ɵɵtext(11),u.ɵɵpipe(12,"i18n"),u.ɵɵelementEnd(),u.ɵɵtext(13," "),u.ɵɵelementStart(14,"input",3),u.ɵɵlistener("ngModelChange",(function(e){return t.searchText=e})),u.ɵɵpipe(15,"i18n"),u.ɵɵelementEnd(),u.ɵɵtext(16," "),u.ɵɵelementEnd(),u.ɵɵtext(17," "),u.ɵɵtemplate(18,T,5,3,"button",4),u.ɵɵtext(19," "),u.ɵɵelementEnd(),u.ɵɵtext(20," "),u.ɵɵelementEnd(),u.ɵɵtext(21," "),u.ɵɵtemplate(22,M,9,6,"ng-container",5),u.ɵɵtext(23," "),u.ɵɵtemplate(24,F,6,2,"ng-container",5),u.ɵɵpipe(25,"search"),u.ɵɵtext(26," "),u.ɵɵtemplate(27,N,0,0,"ng-template",null,6,u.ɵɵtemplateRefExtractor),u.ɵɵtext(29," "),u.ɵɵtemplate(30,z,0,0,"ng-template",null,7,u.ɵɵtemplateRefExtractor),u.ɵɵtext(32," ")),2&e&&(u.ɵɵadvance(3),u.ɵɵtextInterpolate(u.ɵɵpipeBind1(4,7,"collections")),u.ɵɵadvance(8),u.ɵɵtextInterpolate(u.ɵɵpipeBind1(12,9,"search")),u.ɵɵadvance(3),u.ɵɵpropertyInterpolate("placeholder",u.ɵɵpipeBind1(15,11,"search")),u.ɵɵproperty("ngModel",t.searchText),u.ɵɵadvance(4),u.ɵɵproperty("ngIf",t.canCreate),u.ɵɵadvance(4),u.ɵɵproperty("ngIf",t.loading),u.ɵɵadvance(2),u.ɵɵproperty("ngIf",!t.loading&&(t.isPaging()?t.pagedCollections:u.ɵɵpipeBind4(25,13,t.collections,t.searchText,"name","id"))))},directives:[w.DefaultValueAccessor,w.NgControlStatus,w.NgModel,C.NgIf,I.InfiniteScrollDirective,C.NgForOf,E.StopClickDirective,P.A11yTitleDirective],pipes:[k.I18nPipe,O.SearchPipe],encapsulation:2}),e}();t.CollectionsComponent=L,("undefined"==typeof ngDevMode||ngDevMode)&&u.ɵsetClassMetadata(L,[{type:o.Component,args:[{selector:"app-org-manage-collections",templateUrl:"collections.component.html"}]}],(function(){return[{type:d.ApiService},{type:m.ActivatedRoute},{type:f.CollectionService},{type:h.ModalService},{type:v.ToasterService},{type:y.I18nService},{type:g.PlatformUtilsService},{type:x.UserService},{type:S.SearchService},{type:b.LogService}]}),{addEditModalRef:[{type:o.ViewChild,args:["addEdit",{read:o.ViewContainerRef,static:!0}]}],usersModalRef:[{type:o.ViewChild,args:["usersTemplate",{read:o.ViewContainerRef,static:!0}]}]})},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&(t[0].checked=!0,t[0].readOnly=e.readOnly,t[0].hidePasswords=e.hidePasswords)})),[3,5];case 4:return t=r.sent(),this.logService.error(t),[3,5];case 5:return[3,7];case 6:this.title=this.i18nService.t("addGroup"),r.label=7;case 7:return this.loading=!1,[2]}}))}))},e.prototype.loadCollections=function(){return r(this,void 0,void 0,(function(){var e,t,n;return i(this,(function(r){switch(r.label){case 0:return[4,this.apiService.getCollections(this.organizationId)];case 1:return e=r.sent(),t=e.data.map((function(e){return new s.Collection(new a.CollectionData(e))})),n=this,[4,this.collectionService.decryptMany(t)];case 2:return n.collections=r.sent(),[2]}}))}))},e.prototype.check=function(e,t){e.checked=null==t?!e.checked:t,e.checked||(e.readOnly=!1)},e.prototype.selectAll=function(e){var t=this;this.collections.forEach((function(n){return t.check(n,e)}))},e.prototype.submit=function(){return r(this,void 0,void 0,(function(){var e,t;return i(this,(function(n){switch(n.label){case 0:(e=new l.GroupRequest).name=this.name,e.externalId=this.externalId,e.accessAll="all"===this.access,e.accessAll||(e.collections=this.collections.filter((function(e){return e.checked})).map((function(e){return new c.SelectionReadOnlyRequest(e.id,!!e.readOnly,!!e.hidePasswords)}))),n.label=1;case 1:return n.trys.push([1,3,,4]),this.editMode?this.formPromise=this.apiService.putGroup(this.organizationId,this.groupId,e):this.formPromise=this.apiService.postGroup(this.organizationId,e),[4,this.formPromise];case 2:return n.sent(),this.toasterService.popAsync("success",null,this.i18nService.t(this.editMode?"editedGroupId":"createdGroupId",this.name)),this.onSavedGroup.emit(),[3,4];case 3:return t=n.sent(),this.logService.error(t),[3,4];case 4:return[2]}}))}))},e.prototype.delete=function(){return r(this,void 0,void 0,(function(){var e;return i(this,(function(t){switch(t.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(!t.sent())return[2,!1];t.label=2;case 2:return t.trys.push([2,4,,5]),this.deletePromise=this.apiService.deleteGroup(this.organizationId,this.groupId),[4,this.deletePromise];case 3:return t.sent(),this.toasterService.popAsync("success",null,this.i18nService.t("deletedGroupId",this.name)),this.onDeletedGroup.emit(),[3,5];case 4:return e=t.sent(),this.logService.error(e),[3,5];case 5:return[2]}}))}))},e.ɵfac=function(t){return new(t||e)(p.ɵɵdirectiveInject(u.ApiService),p.ɵɵdirectiveInject(d.I18nService),p.ɵɵdirectiveInject(m.ToasterService),p.ɵɵdirectiveInject(f.CollectionService),p.ɵɵdirectiveInject(h.PlatformUtilsService),p.ɵɵdirectiveInject(v.LogService))},e.ɵcmp=p.ɵɵdefineComponent({type:e,selectors:[["app-group-add-edit"]],inputs:{groupId:"groupId",organizationId:"organizationId"},outputs:{onSavedGroup:"onSavedGroup",onDeletedGroup:"onDeletedGroup"},decls:49,vars:18,consts:[["role","dialog","aria-modal","true","aria-labelledby","groupAddEditTitle",1,"modal","fade"],["role","document",1,"modal-dialog","modal-dialog-scrollable","modal-lg"],["ngNativeValidate","",1,"modal-content",3,"appApiAction","ngSubmit"],["form",""],[1,"modal-header"],["id","groupAddEditTitle",1,"modal-title"],["type","button","data-dismiss","modal",1,"close",3,"appA11yTitle"],["aria-hidden","true"],["class","modal-body",4,"ngIf"],[1,"modal-footer"],["type","submit",1,"btn","btn-primary","btn-submit",3,"disabled"],["aria-hidden","true",1,"fa","fa-spinner","fa-spin",3,"title"],["type","button","data-dismiss","modal",1,"btn","btn-outline-secondary"],[1,"ml-auto"],["type","button","class","btn btn-outline-danger",3,"appA11yTitle","disabled","appApiAction","click",4,"ngIf"],[1,"modal-body"],["aria-hidden","true",1,"fa","fa-spinner","fa-spin","text-muted",3,"title"],[1,"sr-only"],[1,"form-group"],["for","name"],["id","name","type","text","name","Name","required","",1,"form-control",3,"ngModel","ngModelChange"],["for","externalId"],["id","externalId","type","text","name","ExternalId",1,"form-control",3,"ngModel","ngModelChange"],[1,"form-text","text-muted"],[1,"mt-4","d-flex"],[1,"mb-2"],["target","_blank","rel","noopener","href","https://bitwarden.com/help/article/user-types-access-control/#access-control",3,"appA11yTitle"],["aria-hidden","true",1,"fa","fa-question-circle-o"],["class","ml-auto",4,"ngIf"],[1,"form-group",3,"ngClass"],[1,"form-check"],["type","radio","name","access","id","accessAll","value","all",1,"form-check-input",3,"ngModel","ngModelChange"],["for","accessAll",1,"form-check-label"],["type","radio","name","access","id","accessSelected","value","selected",1,"form-check-input",3,"ngModel","ngModelChange"],["for","accessSelected",1,"form-check-label"],[4,"ngIf"],["type","button",1,"btn","btn-link","btn-sm","py-0",3,"click"],["class","table table-hover table-list mb-0",4,"ngIf"],[1,"table","table-hover","table-list","mb-0"],["width","100",1,"text-center"],[4,"ngFor","ngForOf"],[1,"table-list-checkbox",3,"click"],["type","checkbox","appStopProp","",3,"ngModel","name","ngModelChange"],[3,"click"],[1,"text-center"],["type","checkbox",3,"ngModel","name","disabled","ngModelChange"],["type","button",1,"btn","btn-outline-danger",3,"appA11yTitle","disabled","appApiAction","click"],["deleteBtn",""],["aria-hidden","true",1,"fa","fa-trash-o","fa-lg","fa-fw",3,"hidden"],["aria-hidden","true",1,"fa","fa-spinner","fa-spin","fa-lg","fa-fw",3,"hidden","title"]],template:function(e,t){if(1&e&&(p.ɵɵelementStart(0,"div",0),p.ɵɵtext(1," "),p.ɵɵelementStart(2,"div",1),p.ɵɵtext(3," "),p.ɵɵelementStart(4,"form",2,3),p.ɵɵlistener("ngSubmit",(function(){return t.submit()})),p.ɵɵtext(6," "),p.ɵɵelementStart(7,"div",4),p.ɵɵtext(8," "),p.ɵɵelementStart(9,"h2",5),p.ɵɵtext(10),p.ɵɵelementEnd(),p.ɵɵtext(11," "),p.ɵɵelementStart(12,"button",6),p.ɵɵpipe(13,"i18n"),p.ɵɵtext(14," "),p.ɵɵelementStart(15,"span",7),p.ɵɵtext(16,"×"),p.ɵɵelementEnd(),p.ɵɵtext(17," "),p.ɵɵelementEnd(),p.ɵɵtext(18," "),p.ɵɵelementEnd(),p.ɵɵtext(19," "),p.ɵɵtemplate(20,C,9,6,"div",8),p.ɵɵtext(21," "),p.ɵɵtemplate(22,A,62,30,"div",8),p.ɵɵtext(23," "),p.ɵɵelementStart(24,"div",9),p.ɵɵtext(25," "),p.ɵɵelementStart(26,"button",10),p.ɵɵtext(27," "),p.ɵɵelement(28,"i",11),p.ɵɵpipe(29,"i18n"),p.ɵɵtext(30," "),p.ɵɵelementStart(31,"span"),p.ɵɵtext(32),p.ɵɵpipe(33,"i18n"),p.ɵɵelementEnd(),p.ɵɵtext(34," "),p.ɵɵelementEnd(),p.ɵɵtext(35," "),p.ɵɵelementStart(36,"button",12),p.ɵɵtext(37),p.ɵɵpipe(38,"i18n"),p.ɵɵelementEnd(),p.ɵɵtext(39," "),p.ɵɵelementStart(40,"div",13),p.ɵɵtext(41," "),p.ɵɵtemplate(42,T,9,10,"button",14),p.ɵɵtext(43," "),p.ɵɵelementEnd(),p.ɵɵtext(44," "),p.ɵɵelementEnd(),p.ɵɵtext(45," "),p.ɵɵelementEnd(),p.ɵɵtext(46," "),p.ɵɵelementEnd(),p.ɵɵtext(47," "),p.ɵɵelementEnd(),p.ɵɵtext(48," ")),2&e){var n=p.ɵɵreference(5);p.ɵɵadvance(4),p.ɵɵproperty("appApiAction",t.formPromise),p.ɵɵadvance(6),p.ɵɵtextInterpolate(t.title),p.ɵɵadvance(2),p.ɵɵpropertyInterpolate("appA11yTitle",p.ɵɵpipeBind1(13,10,"close")),p.ɵɵadvance(8),p.ɵɵproperty("ngIf",t.loading),p.ɵɵadvance(2),p.ɵɵproperty("ngIf",!t.loading),p.ɵɵadvance(4),p.ɵɵproperty("disabled",n.loading),p.ɵɵadvance(2),p.ɵɵpropertyInterpolate("title",p.ɵɵpipeBind1(29,12,"loading")),p.ɵɵadvance(4),p.ɵɵtextInterpolate(p.ɵɵpipeBind1(33,14,"save")),p.ɵɵadvance(5),p.ɵɵtextInterpolate(p.ɵɵpipeBind1(38,16,"cancel")),p.ɵɵadvance(5),p.ɵɵproperty("ngIf",t.editMode)}},directives:[y.NgControlStatusGroup,y.NgForm,g.ApiActionDirective,x.A11yTitleDirective,S.NgIf,y.DefaultValueAccessor,y.RequiredValidator,y.NgControlStatus,y.NgModel,S.NgClass,y.RadioControlValueAccessor,S.NgForOf,y.CheckboxControlValueAccessor,b.StopPropDirective],pipes:[w.I18nPipe],encapsulation:2}),e}();t.GroupAddEditComponent=M,("undefined"==typeof ngDevMode||ngDevMode)&&p.ɵsetClassMetadata(M,[{type:o.Component,args:[{selector:"app-group-add-edit",templateUrl:"group-add-edit.component.html"}]}],(function(){return[{type:u.ApiService},{type:d.I18nService},{type:m.ToasterService},{type:f.CollectionService},{type:h.PlatformUtilsService},{type:v.LogService}]}),{groupId:[{type:o.Input}],organizationId:[{type:o.Input}],onSavedGroup:[{type:o.Output}],onDeletedGroup:[{type:o.Output}]})},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0?e.data:[]).sort(s.Utils.getSortFunction(this.i18nService,"name")),this.groups=t,this.resetPaging(),this.loading=!1,[2]}}))}))},e.prototype.loadMore=function(){if(this.groups&&!(this.groups.length<=this.pageSize)){var e=this.pagedGroups.length,t=this.pageSize;0===e&&this.pagedGroupsCount>this.pageSize&&(t=this.pagedGroupsCount),this.groups.length>e&&(this.pagedGroups=this.pagedGroups.concat(this.groups.slice(e,e+t))),this.pagedGroupsCount=this.pagedGroups.length,this.didScroll=this.pagedGroups.length>this.pageSize}},e.prototype.edit=function(e){return r(this,void 0,void 0,(function(){var t,n=this;return i(this,(function(r){switch(r.label){case 0:return[4,this.modalService.openViewRef(c.GroupAddEditComponent,this.addEditModalRef,(function(r){r.organizationId=n.organizationId,r.groupId=null!=e?e.id:null,r.onSavedGroup.subscribe((function(){t.close(),n.load()})),r.onDeletedGroup.subscribe((function(){t.close(),n.removeGroup(e)}))}))];case 1:return t=r.sent()[0],[2]}}))}))},e.prototype.add=function(){this.edit(null)},e.prototype.delete=function(e){return r(this,void 0,void 0,(function(){var t;return i(this,(function(n){switch(n.label){case 0:return[4,this.platformUtilsService.showDialog(this.i18nService.t("deleteGroupConfirmation"),e.name,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]),[4,this.apiService.deleteGroup(this.organizationId,e.id)];case 3:return n.sent(),this.toasterService.popAsync("success",null,this.i18nService.t("deletedGroupId",e.name)),this.removeGroup(e),[3,5];case 4:return t=n.sent(),this.logService.error(t),[3,5];case 5:return[2]}}))}))},e.prototype.users=function(e){return r(this,void 0,void 0,(function(){var t,n=this;return i(this,(function(r){switch(r.label){case 0:return[4,this.modalService.openViewRef(l.EntityUsersComponent,this.usersModalRef,(function(r){r.organizationId=n.organizationId,r.entity="group",r.entityId=e.id,r.entityName=e.name,r.onEditedUsers.subscribe((function(){t.close()}))}))];case 1:return t=r.sent()[0],[2]}}))}))},e.prototype.resetPaging=function(){return r(this,void 0,void 0,(function(){return i(this,(function(e){return this.pagedGroups=[],this.loadMore(),[2]}))}))},e.prototype.isSearching=function(){return this.searchService.isSearchable(this.searchText)},e.prototype.isPaging=function(){var e=this.isSearching();return e&&this.didScroll&&this.resetPaging(),!e&&this.groups&&this.groups.length>this.pageSize},e.prototype.removeGroup=function(e){var t=this.groups.indexOf(e);t>-1&&(this.groups.splice(t,1),this.resetPaging())},e.ɵfac=function(t){return new(t||e)(p.ɵɵdirectiveInject(u.ApiService),p.ɵɵdirectiveInject(d.ActivatedRoute),p.ɵɵdirectiveInject(m.I18nService),p.ɵɵdirectiveInject(f.ModalService),p.ɵɵdirectiveInject(h.ToasterService),p.ɵɵdirectiveInject(v.PlatformUtilsService),p.ɵɵdirectiveInject(y.UserService),p.ɵɵdirectiveInject(d.Router),p.ɵɵdirectiveInject(g.SearchService),p.ɵɵdirectiveInject(x.LogService))},e.ɵcmp=p.ɵɵdefineComponent({type:e,selectors:[["app-org-groups"]],viewQuery:function(e,t){if(1&e&&(p.ɵɵviewQuery(k,3,o.ViewContainerRef),p.ɵɵviewQuery(O,3,o.ViewContainerRef)),2&e){var n=void 0;p.ɵɵqueryRefresh(n=p.ɵɵloadQuery())&&(t.addEditModalRef=n.first),p.ɵɵqueryRefresh(n=p.ɵɵloadQuery())&&(t.usersModalRef=n.first)}},decls:37,vars:20,consts:[[1,"page-header","d-flex"],[1,"ml-auto","d-flex"],["for","search",1,"sr-only"],["type","search","id","search",1,"form-control","form-control-sm",3,"placeholder","ngModel","ngModelChange"],["type","button",1,"btn","btn-sm","btn-outline-primary","ml-3",3,"click"],["aria-hidden","true",1,"fa","fa-plus","fa-fw"],[4,"ngIf"],["addEdit",""],["usersTemplate",""],["aria-hidden","true",1,"fa","fa-spinner","fa-spin","text-muted",3,"title"],[1,"sr-only"],["class","table table-hover table-list","infiniteScroll","",3,"infiniteScrollDistance","infiniteScrollDisabled","scrolled",4,"ngIf"],["infiniteScroll","",1,"table","table-hover","table-list",3,"infiniteScrollDistance","infiniteScrollDisabled","scrolled"],[4,"ngFor","ngForOf"],["href","#","appStopClick","",3,"click"],[1,"table-list-options"],["appListDropdown","",1,"dropdown"],["type","button","data-toggle","dropdown","aria-haspopup","true","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle",3,"appA11yTitle"],["aria-hidden","true",1,"fa","fa-cog","fa-lg"],[1,"dropdown-menu","dropdown-menu-right"],["href","#","appStopClick","",1,"dropdown-item",3,"click"],["aria-hidden","true",1,"fa","fa-fw","fa-users"],["href","#","appStopClick","",1,"dropdown-item","text-danger",3,"click"],["aria-hidden","true",1,"fa","fa-fw","fa-trash-o"]],template:function(e,t){1&e&&(p.ɵɵelementStart(0,"div",0),p.ɵɵtext(1," "),p.ɵɵelementStart(2,"h1"),p.ɵɵtext(3),p.ɵɵpipe(4,"i18n"),p.ɵɵelementEnd(),p.ɵɵtext(5," "),p.ɵɵelementStart(6,"div",1),p.ɵɵtext(7," "),p.ɵɵelementStart(8,"div"),p.ɵɵtext(9," "),p.ɵɵelementStart(10,"label",2),p.ɵɵtext(11),p.ɵɵpipe(12,"i18n"),p.ɵɵelementEnd(),p.ɵɵtext(13," "),p.ɵɵelementStart(14,"input",3),p.ɵɵlistener("ngModelChange",(function(e){return t.searchText=e})),p.ɵɵpipe(15,"i18n"),p.ɵɵelementEnd(),p.ɵɵtext(16," "),p.ɵɵelementEnd(),p.ɵɵtext(17," "),p.ɵɵelementStart(18,"button",4),p.ɵɵlistener("click",(function(){return t.add()})),p.ɵɵtext(19," "),p.ɵɵelement(20,"i",5),p.ɵɵtext(21),p.ɵɵpipe(22,"i18n"),p.ɵɵelementEnd(),p.ɵɵtext(23," "),p.ɵɵelementEnd(),p.ɵɵtext(24," "),p.ɵɵelementEnd(),p.ɵɵtext(25," "),p.ɵɵtemplate(26,_,9,6,"ng-container",6),p.ɵɵtext(27," "),p.ɵɵtemplate(28,D,6,2,"ng-container",6),p.ɵɵpipe(29,"search"),p.ɵɵtext(30," "),p.ɵɵtemplate(31,R,0,0,"ng-template",null,7,p.ɵɵtemplateRefExtractor),p.ɵɵtext(33," "),p.ɵɵtemplate(34,B,0,0,"ng-template",null,8,p.ɵɵtemplateRefExtractor),p.ɵɵtext(36," ")),2&e&&(p.ɵɵadvance(3),p.ɵɵtextInterpolate(p.ɵɵpipeBind1(4,7,"groups")),p.ɵɵadvance(8),p.ɵɵtextInterpolate(p.ɵɵpipeBind1(12,9,"search")),p.ɵɵadvance(3),p.ɵɵpropertyInterpolate("placeholder",p.ɵɵpipeBind1(15,11,"search")),p.ɵɵproperty("ngModel",t.searchText),p.ɵɵadvance(7),p.ɵɵtextInterpolate1(" ",p.ɵɵpipeBind1(22,13,"newGroup")," "),p.ɵɵadvance(5),p.ɵɵproperty("ngIf",t.loading),p.ɵɵadvance(2),p.ɵɵproperty("ngIf",!t.loading&&(t.isPaging()?t.pagedGroups:p.ɵɵpipeBind4(29,15,t.groups,t.searchText,"name","id"))))},directives:[S.DefaultValueAccessor,S.NgControlStatus,S.NgModel,b.NgIf,w.InfiniteScrollDirective,b.NgForOf,C.StopClickDirective,I.A11yTitleDirective],pipes:[E.I18nPipe,P.SearchPipe],encapsulation:2}),e}();t.GroupsComponent=j,("undefined"==typeof ngDevMode||ngDevMode)&&p.ɵsetClassMetadata(j,[{type:o.Component,args:[{selector:"app-org-groups",templateUrl:"groups.component.html"}]}],(function(){return[{type:u.ApiService},{type:d.ActivatedRoute},{type:m.I18nService},{type:f.ModalService},{type:h.ToasterService},{type:v.PlatformUtilsService},{type:y.UserService},{type:d.Router},{type:g.SearchService},{type:x.LogService}]}),{addEditModalRef:[{type:o.ViewChild,args:["addEdit",{read:o.ViewContainerRef,static:!0}]}],usersModalRef:[{type:o.ViewChild,args:["usersTemplate",{read:o.ViewContainerRef,static:!0}]}]})},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),o=this&&this.__assign||function(){return o=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&t[0].status===m.OrganizationUserStatusType.Confirmed&&this.events(t[0]),[2]}))}))})),[2]}}))}))})),[2]}))}))},t.prototype.load=function(){return a(this,void 0,void 0,(function(){var t;return s(this,(function(n){switch(n.label){case 0:return[4,this.policyService.getPolicyForOrganization(h.PolicyType.ResetPassword,this.organizationId)];case 1:return t=n.sent(),this.orgResetPasswordPolicyEnabled=null==t?void 0:t.enabled,e.prototype.load.call(this),[2]}}))}))},t.prototype.getUsers=function(){return this.apiService.getOrganizationUsers(this.organizationId)},t.prototype.deleteUser=function(e){return this.apiService.deleteOrganizationUser(this.organizationId,e)},t.prototype.reinviteUser=function(e){return this.apiService.postOrganizationUserReinvite(this.organizationId,e)},t.prototype.confirmUser=function(e,t){return a(this,void 0,void 0,(function(){var n,r,i;return s(this,(function(o){switch(o.label){case 0:return[4,this.cryptoService.getOrgKey(this.organizationId)];case 1:return n=o.sent(),[4,this.cryptoService.rsaEncrypt(n.key,t.buffer)];case 2:return r=o.sent(),(i=new d.OrganizationUserConfirmRequest).key=r.encryptedString,[4,this.apiService.postOrganizationUserConfirm(this.organizationId,e.id,i)];case 3:return o.sent(),[2]}}))}))},t.prototype.allowResetPassword=function(e){var t=!1;switch(this.callingUserType){case f.OrganizationUserType.Owner:t=!0;break;case f.OrganizationUserType.Admin:t=e.type!==f.OrganizationUserType.Owner;break;case f.OrganizationUserType.Custom:t=e.type!==f.OrganizationUserType.Owner&&e.type!==f.OrganizationUserType.Admin}return this.canResetPassword&&t&&this.orgUseResetPassword&&this.orgHasKeys&&e.resetPasswordEnrolled&&this.orgResetPasswordPolicyEnabled&&e.status===m.OrganizationUserStatusType.Confirmed},t.prototype.showEnrolledStatus=function(e){return this.orgUseResetPassword&&e.resetPasswordEnrolled&&this.orgResetPasswordPolicyEnabled},t.prototype.edit=function(e){return a(this,void 0,void 0,(function(){var t,n=this;return s(this,(function(r){switch(r.label){case 0:return[4,this.modalService.openViewRef(w.UserAddEditComponent,this.addEditModalRef,(function(r){r.name=n.userNamePipe.transform(e),r.organizationId=n.organizationId,r.organizationUserId=null!=e?e.id:null,r.usesKeyConnector=null==e?void 0:e.usesKeyConnector,r.onSavedUser.subscribe((function(){t.close(),n.load()})),r.onDeletedUser.subscribe((function(){t.close(),n.removeUser(e)}))}))];case 1:return t=r.sent()[0],[2]}}))}))},t.prototype.groups=function(e){return a(this,void 0,void 0,(function(){var t,n=this;return s(this,(function(r){switch(r.label){case 0:return[4,this.modalService.openViewRef(C.UserGroupsComponent,this.groupsModalRef,(function(r){r.name=n.userNamePipe.transform(e),r.organizationId=n.organizationId,r.organizationUserId=null!=e?e.id:null,r.onSavedUser.subscribe((function(){t.close()}))}))];case 1:return t=r.sent()[0],[2]}}))}))},t.prototype.bulkRemove=function(){return a(this,void 0,void 0,(function(){var e=this;return s(this,(function(t){switch(t.label){case 0:return null!=this.actionPromise?[2]:[4,this.modalService.openViewRef(g.BulkRemoveComponent,this.bulkRemoveModalRef,(function(t){t.organizationId=e.organizationId,t.users=e.getCheckedUsers()}))];case 1:return[4,t.sent()[0].onClosedPromise()];case 2:return t.sent(),[4,this.load()];case 3:return t.sent(),[2]}}))}))},t.prototype.bulkReinvite=function(){return a(this,void 0,void 0,(function(){var e,t,n,r;return s(this,(function(i){if(null!=this.actionPromise)return[2];if(e=this.getCheckedUsers(),(t=e.filter((function(e){return e.status===m.OrganizationUserStatusType.Invited}))).length<=0)return this.toasterService.popAsync("error",this.i18nService.t("errorOccurred"),this.i18nService.t("noSelectedUsersApplicable")),[2];try{n=new u.OrganizationUserBulkRequest(t.map((function(e){return e.id}))),r=this.apiService.postManyOrganizationUserReinvite(this.organizationId,n),this.showBulkStatus(e,t,r,this.i18nService.t("bulkReinviteMessage"))}catch(o){this.validationService.showError(o)}return this.actionPromise=null,[2]}))}))},t.prototype.bulkConfirm=function(){return a(this,void 0,void 0,(function(){var e=this;return s(this,(function(t){switch(t.label){case 0:return null!=this.actionPromise?[2]:[4,this.modalService.openViewRef(y.BulkConfirmComponent,this.bulkConfirmModalRef,(function(t){t.organizationId=e.organizationId,t.users=e.getCheckedUsers()}))];case 1:return[4,t.sent()[0].onClosedPromise()];case 2:return t.sent(),[4,this.load()];case 3:return t.sent(),[2]}}))}))},t.prototype.events=function(e){return a(this,void 0,void 0,(function(){var t=this;return s(this,(function(n){switch(n.label){case 0:return[4,this.modalService.openViewRef(S.EntityEventsComponent,this.eventsModalRef,(function(n){n.name=t.userNamePipe.transform(e),n.organizationId=t.organizationId,n.entityId=e.id,n.showUser=!1,n.entity="user"}))];case 1:return n.sent()[0],[2]}}))}))},t.prototype.resetPassword=function(e){return a(this,void 0,void 0,(function(){var t,n=this;return s(this,(function(r){switch(r.label){case 0:return[4,this.modalService.openViewRef(b.ResetPasswordComponent,this.resetPasswordModalRef,(function(r){r.name=n.userNamePipe.transform(e),r.email=null!=e?e.email:null,r.organizationId=n.organizationId,r.id=null!=e?e.id:null,r.onPasswordReset.subscribe((function(){t.close(),n.load()}))}))];case 1:return t=r.sent()[0],[2]}}))}))},t.prototype.deleteWarningMessage=function(t){return t.usesKeyConnector?this.i18nService.t("removeUserConfirmationKeyConnector"):e.prototype.deleteWarningMessage.call(this,t)},t.prototype.showBulkStatus=function(e,t,n,r){return a(this,void 0,void 0,(function(){var i,a,l,c,p,u,d,m=this;return s(this,(function(s){switch(s.label){case 0:return[4,this.modalService.openViewRef(x.BulkStatusComponent,this.bulkStatusModalRef,(function(e){e.loading=!0}))];case 1:i=s.sent(),a=i[0],l=i[1],c=!1,a.onShown.subscribe((function(){c&&a.close()})),s.label=2;case 2:return s.trys.push([2,4,,5]),[4,n];case 3:return p=s.sent(),a&&(u=p.data.filter((function(e){return""!==e.error})).reduce((function(e,t){var n;return o(o({},e),((n={})[t.id]=t.error,n))}),{}),d=t.reduce((function(e,t){var n;return o(o({},e),((n={})[t.id]=t,n))}),{}),l.users=e.map((function(e){var t,n=null!==(t=u[e.id])&&void 0!==t?t:r;return d.hasOwnProperty(e.id)||(n=m.i18nService.t("bulkFilteredMessage")),{user:e,error:u.hasOwnProperty(e.id),message:n}})),l.loading=!1),[3,5];case 4:return s.sent(),c=!0,a.close(),[3,5];case 5:return[2]}}))}))},t.ɵfac=function(e){return new(e||t)(I.ɵɵdirectiveInject(E.ApiService),I.ɵɵdirectiveInject(P.ActivatedRoute),I.ɵɵdirectiveInject(k.I18nService),I.ɵɵdirectiveInject(O.ModalService),I.ɵɵdirectiveInject(_.PlatformUtilsService),I.ɵɵdirectiveInject(A.ToasterService),I.ɵɵdirectiveInject(T.CryptoService),I.ɵɵdirectiveInject(M.UserService),I.ɵɵdirectiveInject(P.Router),I.ɵɵdirectiveInject(D.StorageService),I.ɵɵdirectiveInject(R.SearchService),I.ɵɵdirectiveInject(B.ValidationService),I.ɵɵdirectiveInject(j.PolicyService),I.ɵɵdirectiveInject(U.LogService),I.ɵɵdirectiveInject(V.SearchPipe),I.ɵɵdirectiveInject(F.UserNamePipe),I.ɵɵdirectiveInject(N.SyncService))},t.ɵcmp=I.ɵɵdefineComponent({type:t,selectors:[["app-org-people"]],viewQuery:function(e,t){if(1&e&&(I.ɵɵviewQuery(Y,3,l.ViewContainerRef),I.ɵɵviewQuery(J,3,l.ViewContainerRef),I.ɵɵviewQuery(X,3,l.ViewContainerRef),I.ɵɵviewQuery(Z,3,l.ViewContainerRef),I.ɵɵviewQuery(ee,3,l.ViewContainerRef),I.ɵɵviewQuery(te,3,l.ViewContainerRef),I.ɵɵviewQuery(ne,3,l.ViewContainerRef),I.ɵɵviewQuery(re,3,l.ViewContainerRef)),2&e){var n=void 0;I.ɵɵqueryRefresh(n=I.ɵɵloadQuery())&&(t.addEditModalRef=n.first),I.ɵɵqueryRefresh(n=I.ɵɵloadQuery())&&(t.groupsModalRef=n.first),I.ɵɵqueryRefresh(n=I.ɵɵloadQuery())&&(t.eventsModalRef=n.first),I.ɵɵqueryRefresh(n=I.ɵɵloadQuery())&&(t.confirmModalRef=n.first),I.ɵɵqueryRefresh(n=I.ɵɵloadQuery())&&(t.resetPasswordModalRef=n.first),I.ɵɵqueryRefresh(n=I.ɵɵloadQuery())&&(t.bulkStatusModalRef=n.first),I.ɵɵqueryRefresh(n=I.ɵɵloadQuery())&&(t.bulkConfirmModalRef=n.first),I.ɵɵqueryRefresh(n=I.ɵɵloadQuery())&&(t.bulkRemoveModalRef=n.first)}},features:[I.ɵɵInheritDefinitionFeature],decls:116,vars:61,consts:[[1,"page-header","d-flex"],[1,"ml-auto","d-flex"],["role","group",1,"btn-group","btn-group-sm"],["type","button",1,"btn","btn-outline-secondary",3,"ngClass","click"],["class","badge badge-pill badge-info",4,"ngIf"],["class","badge badge-pill badge-warning",4,"ngIf"],[1,"ml-3"],["for","search",1,"sr-only"],["type","search","id","search",1,"form-control","form-control-sm",3,"placeholder","ngModel","ngModelChange"],["appListDropdown","",1,"dropdown","ml-3"],["type","button","id","bulkActionsButton","data-toggle","dropdown","aria-haspopup","true","aria-expanded","false",1,"btn","btn-sm","btn-outline-secondary","dropdown-toggle",3,"appA11yTitle"],["aria-hidden","true",1,"fa","fa-cog"],["aria-labelledby","bulkActionsButton",1,"dropdown-menu","dropdown-menu-right"],["appStopClick","",1,"dropdown-item",3,"click"],["aria-hidden","true",1,"fa","fa-fw","fa-envelope-o"],["class","dropdown-item text-success","appStopClick","",3,"click",4,"ngIf"],["appStopClick","",1,"dropdown-item","text-danger",3,"click"],["aria-hidden","true",1,"fa","fa-fw","fa-remove"],[1,"dropdown-divider"],["aria-hidden","true",1,"fa","fa-fw","fa-check-square-o"],["aria-hidden","true",1,"fa","fa-fw","fa-minus-square-o"],["type","button",1,"btn","btn-sm","btn-outline-primary","ml-3",3,"click"],["aria-hidden","true",1,"fa","fa-plus","fa-fw"],[4,"ngIf"],["addEdit",""],["groupsTemplate",""],["eventsTemplate",""],["confirmTemplate",""],["resetPasswordTemplate",""],["bulkStatusTemplate",""],["bulkConfirmTemplate",""],["bulkRemoveTemplate",""],[1,"badge","badge-pill","badge-info"],[1,"badge","badge-pill","badge-warning"],["appStopClick","",1,"dropdown-item","text-success",3,"click"],["aria-hidden","true",1,"fa","fa-fw","fa-check"],["aria-hidden","true",1,"fa","fa-spinner","fa-spin","text-muted",3,"title"],[1,"sr-only"],["type","info","icon","fa-check-circle",3,"title",4,"ngIf"],["infiniteScroll","",1,"table","table-hover","table-list",3,"infiniteScrollDistance","infiniteScrollDisabled","scrolled"],[4,"ngFor","ngForOf"],["type","info","icon","fa-check-circle",3,"title"],[1,"table-list-checkbox",3,"click"],["type","checkbox","appStopProp","",3,"ngModel","ngModelChange"],["width","30"],["size","25",3,"data","email","circle","fontSize"],["href","#","appStopClick","",3,"click"],["class","badge badge-secondary",4,"ngIf"],["class","badge badge-warning",4,"ngIf"],["class","text-muted d-block",4,"ngIf"],[1,"table-list-options"],["appListDropdown","",1,"dropdown"],["type","button","data-toggle","dropdown","aria-haspopup","true","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle",3,"appA11yTitle"],["aria-hidden","true",1,"fa","fa-cog","fa-lg"],[1,"dropdown-menu","dropdown-menu-right"],["class","dropdown-item","href","#","appStopClick","",3,"click",4,"ngIf"],["class","dropdown-item text-success","href","#","appStopClick","",3,"click",4,"ngIf"],["href","#","appStopClick","",1,"dropdown-item","text-danger",3,"click"],[1,"badge","badge-secondary"],[1,"badge","badge-warning"],[1,"text-muted","d-block"],["aria-hidden","true",1,"fa","fa-lock",3,"title"],["aria-hidden","true",1,"fa","fa-key",3,"title"],["href","#","appStopClick","",1,"dropdown-item",3,"click"],["href","#","appStopClick","",1,"dropdown-item","text-success",3,"click"],["aria-hidden","true",1,"fa","fa-fw","fa-sitemap"],["aria-hidden","true",1,"fa","fa-fw","fa-file-text-o"],["aria-hidden","true",1,"fa","fa-fw","fa-key"]],template:function(e,t){1&e&&(I.ɵɵelementStart(0,"div",0),I.ɵɵtext(1," "),I.ɵɵelementStart(2,"h1"),I.ɵɵtext(3),I.ɵɵpipe(4,"i18n"),I.ɵɵelementEnd(),I.ɵɵtext(5," "),I.ɵɵelementStart(6,"div",1),I.ɵɵtext(7," "),I.ɵɵelementStart(8,"div",2),I.ɵɵtext(9," "),I.ɵɵelementStart(10,"button",3),I.ɵɵlistener("click",(function(){return t.filter(null)})),I.ɵɵtext(11),I.ɵɵpipe(12,"i18n"),I.ɵɵtemplate(13,ie,2,1,"span",4),I.ɵɵtext(14," "),I.ɵɵelementEnd(),I.ɵɵtext(15," "),I.ɵɵelementStart(16,"button",3),I.ɵɵlistener("click",(function(){return t.filter(t.userStatusType.Invited)})),I.ɵɵtext(17),I.ɵɵpipe(18,"i18n"),I.ɵɵtemplate(19,oe,2,1,"span",4),I.ɵɵtext(20," "),I.ɵɵelementEnd(),I.ɵɵtext(21," "),I.ɵɵelementStart(22,"button",3),I.ɵɵlistener("click",(function(){return t.filter(t.userStatusType.Accepted)})),I.ɵɵtext(23),I.ɵɵpipe(24,"i18n"),I.ɵɵtemplate(25,ae,2,1,"span",5),I.ɵɵtext(26," "),I.ɵɵelementEnd(),I.ɵɵtext(27," "),I.ɵɵelementEnd(),I.ɵɵtext(28," "),I.ɵɵelementStart(29,"div",6),I.ɵɵtext(30," "),I.ɵɵelementStart(31,"label",7),I.ɵɵtext(32),I.ɵɵpipe(33,"i18n"),I.ɵɵelementEnd(),I.ɵɵtext(34," "),I.ɵɵelementStart(35,"input",8),I.ɵɵlistener("ngModelChange",(function(e){return t.searchText=e})),I.ɵɵpipe(36,"i18n"),I.ɵɵelementEnd(),I.ɵɵtext(37," "),I.ɵɵelementEnd(),I.ɵɵtext(38," "),I.ɵɵelementStart(39,"div",9),I.ɵɵtext(40," "),I.ɵɵelementStart(41,"button",10),I.ɵɵpipe(42,"i18n"),I.ɵɵtext(43," "),I.ɵɵelement(44,"i",11),I.ɵɵtext(45," "),I.ɵɵelementEnd(),I.ɵɵtext(46," "),I.ɵɵelementStart(47,"div",12),I.ɵɵtext(48," "),I.ɵɵelementStart(49,"button",13),I.ɵɵlistener("click",(function(){return t.bulkReinvite()})),I.ɵɵtext(50," "),I.ɵɵelement(51,"i",14),I.ɵɵtext(52),I.ɵɵpipe(53,"i18n"),I.ɵɵelementEnd(),I.ɵɵtext(54," "),I.ɵɵtemplate(55,se,5,3,"button",15),I.ɵɵtext(56," "),I.ɵɵelementStart(57,"button",16),I.ɵɵlistener("click",(function(){return t.bulkRemove()})),I.ɵɵtext(58," "),I.ɵɵelement(59,"i",17),I.ɵɵtext(60),I.ɵɵpipe(61,"i18n"),I.ɵɵelementEnd(),I.ɵɵtext(62," "),I.ɵɵelement(63,"div",18),I.ɵɵtext(64," "),I.ɵɵelementStart(65,"button",13),I.ɵɵlistener("click",(function(){return t.selectAll(!0)})),I.ɵɵtext(66," "),I.ɵɵelement(67,"i",19),I.ɵɵtext(68),I.ɵɵpipe(69,"i18n"),I.ɵɵelementEnd(),I.ɵɵtext(70," "),I.ɵɵelementStart(71,"button",13),I.ɵɵlistener("click",(function(){return t.selectAll(!1)})),I.ɵɵtext(72," "),I.ɵɵelement(73,"i",20),I.ɵɵtext(74),I.ɵɵpipe(75,"i18n"),I.ɵɵelementEnd(),I.ɵɵtext(76," "),I.ɵɵelementEnd(),I.ɵɵtext(77," "),I.ɵɵelementEnd(),I.ɵɵtext(78," "),I.ɵɵelementStart(79,"button",21),I.ɵɵlistener("click",(function(){return t.invite()})),I.ɵɵtext(80," "),I.ɵɵelement(81,"i",22),I.ɵɵtext(82),I.ɵɵpipe(83,"i18n"),I.ɵɵelementEnd(),I.ɵɵtext(84," "),I.ɵɵelementEnd(),I.ɵɵtext(85," "),I.ɵɵelementEnd(),I.ɵɵtext(86," "),I.ɵɵtemplate(87,le,9,6,"ng-container",23),I.ɵɵtext(88," "),I.ɵɵtemplate(89,Oe,6,2,"ng-container",23),I.ɵɵpipe(90,"search"),I.ɵɵtext(91," "),I.ɵɵtemplate(92,_e,0,0,"ng-template",null,24,I.ɵɵtemplateRefExtractor),I.ɵɵtext(94," "),I.ɵɵtemplate(95,Ae,0,0,"ng-template",null,25,I.ɵɵtemplateRefExtractor),I.ɵɵtext(97," "),I.ɵɵtemplate(98,Te,0,0,"ng-template",null,26,I.ɵɵtemplateRefExtractor),I.ɵɵtext(100," "),I.ɵɵtemplate(101,Me,0,0,"ng-template",null,27,I.ɵɵtemplateRefExtractor),I.ɵɵtext(103," "),I.ɵɵtemplate(104,De,0,0,"ng-template",null,28,I.ɵɵtemplateRefExtractor),I.ɵɵtext(106," "),I.ɵɵtemplate(107,Re,0,0,"ng-template",null,29,I.ɵɵtemplateRefExtractor),I.ɵɵtext(109," "),I.ɵɵtemplate(110,Be,0,0,"ng-template",null,30,I.ɵɵtemplateRefExtractor),I.ɵɵtext(112," "),I.ɵɵtemplate(113,je,0,0,"ng-template",null,31,I.ɵɵtemplateRefExtractor),I.ɵɵtext(115," ")),2&e&&(I.ɵɵadvance(3),I.ɵɵtextInterpolate(I.ɵɵpipeBind1(4,22,"people")),I.ɵɵadvance(7),I.ɵɵproperty("ngClass",I.ɵɵpureFunction1(52,Ue,null==t.status)),I.ɵɵadvance(1),I.ɵɵtextInterpolate1(" ",I.ɵɵpipeBind1(12,24,"all")," "),I.ɵɵadvance(2),I.ɵɵproperty("ngIf",t.allCount),I.ɵɵadvance(3),I.ɵɵproperty("ngClass",I.ɵɵpureFunction1(54,Ue,t.status==t.userStatusType.Invited)),I.ɵɵadvance(1),I.ɵɵtextInterpolate1(" ",I.ɵɵpipeBind1(18,26,"invited")," "),I.ɵɵadvance(2),I.ɵɵproperty("ngIf",t.invitedCount),I.ɵɵadvance(3),I.ɵɵproperty("ngClass",I.ɵɵpureFunction1(56,Ue,t.status==t.userStatusType.Accepted)),I.ɵɵadvance(1),I.ɵɵtextInterpolate1(" ",I.ɵɵpipeBind1(24,28,"accepted")," "),I.ɵɵadvance(2),I.ɵɵproperty("ngIf",t.acceptedCount),I.ɵɵadvance(7),I.ɵɵtextInterpolate(I.ɵɵpipeBind1(33,30,"search")),I.ɵɵadvance(3),I.ɵɵpropertyInterpolate("placeholder",I.ɵɵpipeBind1(36,32,"search")),I.ɵɵproperty("ngModel",t.searchText),I.ɵɵadvance(6),I.ɵɵpropertyInterpolate("appA11yTitle",I.ɵɵpipeBind1(42,34,"options")),I.ɵɵadvance(11),I.ɵɵtextInterpolate1(" ",I.ɵɵpipeBind1(53,36,"reinviteSelected")," "),I.ɵɵadvance(3),I.ɵɵproperty("ngIf",t.showBulkConfirmUsers),I.ɵɵadvance(5),I.ɵɵtextInterpolate1(" ",I.ɵɵpipeBind1(61,38,"remove")," "),I.ɵɵadvance(8),I.ɵɵtextInterpolate1(" ",I.ɵɵpipeBind1(69,40,"selectAll")," "),I.ɵɵadvance(6),I.ɵɵtextInterpolate1(" ",I.ɵɵpipeBind1(75,42,"unselectAll")," "),I.ɵɵadvance(8),I.ɵɵtextInterpolate1(" ",I.ɵɵpipeBind1(83,44,"inviteUser")," "),I.ɵɵadvance(5),I.ɵɵproperty("ngIf",t.loading),I.ɵɵadvance(2),I.ɵɵproperty("ngIf",!t.loading&&(t.isPaging()?t.pagedUsers:I.ɵɵpipeBindV(90,46,I.ɵɵpureFunction2(58,Ve,t.users,t.searchText)))))},directives:[z.NgClass,z.NgIf,L.DefaultValueAccessor,L.NgControlStatus,L.NgModel,K.A11yTitleDirective,q.StopClickDirective,G.InfiniteScrollDirective,z.NgForOf,W.CalloutComponent,L.CheckboxControlValueAccessor,H.StopPropDirective,$.AvatarComponent],pipes:[Q.I18nPipe,V.SearchPipe,F.UserNamePipe],encapsulation:2}),t}(v.BasePeopleComponent);t.PeopleComponent=Fe,("undefined"==typeof ngDevMode||ngDevMode)&&I.ɵsetClassMetadata(Fe,[{type:l.Component,args:[{selector:"app-org-people",templateUrl:"people.component.html"}]}],(function(){return[{type:E.ApiService},{type:P.ActivatedRoute},{type:k.I18nService},{type:O.ModalService},{type:_.PlatformUtilsService},{type:A.ToasterService},{type:T.CryptoService},{type:M.UserService},{type:P.Router},{type:D.StorageService},{type:R.SearchService},{type:B.ValidationService},{type:j.PolicyService},{type:U.LogService},{type:V.SearchPipe},{type:F.UserNamePipe},{type:N.SyncService}]}),{addEditModalRef:[{type:l.ViewChild,args:["addEdit",{read:l.ViewContainerRef,static:!0}]}],groupsModalRef:[{type:l.ViewChild,args:["groupsTemplate",{read:l.ViewContainerRef,static:!0}]}],eventsModalRef:[{type:l.ViewChild,args:["eventsTemplate",{read:l.ViewContainerRef,static:!0}]}],confirmModalRef:[{type:l.ViewChild,args:["confirmTemplate",{read:l.ViewContainerRef,static:!0}]}],resetPasswordModalRef:[{type:l.ViewChild,args:["resetPasswordTemplate",{read:l.ViewContainerRef,static:!0}]}],bulkStatusModalRef:[{type:l.ViewChild,args:["bulkStatusTemplate",{read:l.ViewContainerRef,static:!0}]}],bulkConfirmModalRef:[{type:l.ViewChild,args:["bulkConfirmTemplate",{read:l.ViewContainerRef,static:!0}]}],bulkRemoveModalRef:[{type:l.ViewChild,args:["bulkRemoveTemplate",{read:l.ViewContainerRef,static:!0}]}]})},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]-1&&(e=e.concat(this.email.substr(0,t).trim().toLowerCase().split(/[^A-Za-z0-9]/))),null!=this.name&&""!==this.name&&(e=e.concat(this.name.trim().toLowerCase().split(" "))),e},e.ɵfac=function(t){return new(t||e)(c.ɵɵdirectiveInject(p.ApiService),c.ɵɵdirectiveInject(u.I18nService),c.ɵɵdirectiveInject(d.PlatformUtilsService),c.ɵɵdirectiveInject(m.PasswordGenerationService),c.ɵɵdirectiveInject(f.PolicyService),c.ɵɵdirectiveInject(h.CryptoService),c.ɵɵdirectiveInject(v.LogService))},e.ɵcmp=c.ɵɵdefineComponent({type:e,selectors:[["app-reset-password"]],inputs:{name:"name",email:"email",id:"id",organizationId:"organizationId"},outputs:{onPasswordReset:"onPasswordReset"},decls:97,vars:43,consts:[["role","dialog","aria-modal","true","aria-labelledby","resetPasswordTitle",1,"modal","fade"],["role","document",1,"modal-dialog"],[1,"modal-content",3,"appApiAction","ngSubmit"],["form",""],[1,"modal-header"],["id","resetPasswordTitle",1,"modal-title"],["class","text-muted",4,"ngIf"],["type","button","data-dismiss","modal",1,"close",3,"appA11yTitle"],["aria-hidden","true"],[1,"modal-body"],["type","warning"],["type","info",3,"enforcedPolicyOptions","enforcedPolicyMessage",4,"ngIf"],[1,"row"],[1,"col","form-group"],[1,"d-flex"],["for","newPassword"],[1,"ml-auto","d-flex"],["href","#","appStopClick","",1,"d-block","mr-2","fa-icon-above-input",3,"appA11yTitle","click"],["aria-hidden","true",1,"fa","fa-lg","fa-fw","fa-refresh"],[1,"input-group","mb-1"],["id","newPassword","appAutofocus","","name","NewPassword","required","","appInputVerbatim","","autocomplete","new-password",1,"form-control","text-monospace",3,"type","ngModel","ngModelChange","input"],[1,"input-group-append"],["type","button",1,"btn","btn-outline-secondary",3,"appA11yTitle","click"],["aria-hidden","true",1,"fa","fa-lg",3,"ngClass"],["aria-hidden","true",1,"fa","fa-lg","fa-clone"],[3,"score","showText"],[1,"modal-footer"],["type","submit",1,"btn","btn-primary","btn-submit",3,"disabled"],["aria-hidden","true",1,"fa","fa-spinner","fa-spin",3,"title"],["type","button","data-dismiss","modal",1,"btn","btn-outline-secondary"],[1,"text-muted"],["type","info",3,"enforcedPolicyOptions","enforcedPolicyMessage"]],template:function(e,t){if(1&e&&(c.ɵɵelementStart(0,"div",0),c.ɵɵtext(1," "),c.ɵɵelementStart(2,"div",1),c.ɵɵtext(3," "),c.ɵɵelementStart(4,"form",2,3),c.ɵɵlistener("ngSubmit",(function(){return t.submit()})),c.ɵɵtext(6," "),c.ɵɵelementStart(7,"div",4),c.ɵɵtext(8," "),c.ɵɵelementStart(9,"h2",5),c.ɵɵtext(10),c.ɵɵpipe(11,"i18n"),c.ɵɵtemplate(12,k,2,1,"small",6),c.ɵɵtext(13," "),c.ɵɵelementEnd(),c.ɵɵtext(14," "),c.ɵɵelementStart(15,"button",7),c.ɵɵpipe(16,"i18n"),c.ɵɵtext(17," "),c.ɵɵelementStart(18,"span",8),c.ɵɵtext(19,"×"),c.ɵɵelementEnd(),c.ɵɵtext(20," "),c.ɵɵelementEnd(),c.ɵɵtext(21," "),c.ɵɵelementEnd(),c.ɵɵtext(22," "),c.ɵɵelementStart(23,"div",9),c.ɵɵtext(24," "),c.ɵɵelementStart(25,"app-callout",10),c.ɵɵtext(26),c.ɵɵpipe(27,"i18n"),c.ɵɵelementEnd(),c.ɵɵtext(28," "),c.ɵɵtemplate(29,O,3,4,"app-callout",11),c.ɵɵtext(30," "),c.ɵɵelementStart(31,"div",12),c.ɵɵtext(32," "),c.ɵɵelementStart(33,"div",13),c.ɵɵtext(34," "),c.ɵɵelementStart(35,"div",14),c.ɵɵtext(36," "),c.ɵɵelementStart(37,"label",15),c.ɵɵtext(38),c.ɵɵpipe(39,"i18n"),c.ɵɵelementEnd(),c.ɵɵtext(40," "),c.ɵɵelementStart(41,"div",16),c.ɵɵtext(42," "),c.ɵɵelementStart(43,"a",17),c.ɵɵlistener("click",(function(){return t.generatePassword()})),c.ɵɵpipe(44,"i18n"),c.ɵɵtext(45," "),c.ɵɵelement(46,"i",18),c.ɵɵtext(47," "),c.ɵɵelementEnd(),c.ɵɵtext(48," "),c.ɵɵelementEnd(),c.ɵɵtext(49," "),c.ɵɵelementEnd(),c.ɵɵtext(50," "),c.ɵɵelementStart(51,"div",19),c.ɵɵtext(52," "),c.ɵɵelementStart(53,"input",20),c.ɵɵlistener("ngModelChange",(function(e){return t.newPassword=e}))("input",(function(){return t.updatePasswordStrength()})),c.ɵɵelementEnd(),c.ɵɵtext(54," "),c.ɵɵelementStart(55,"div",21),c.ɵɵtext(56," "),c.ɵɵelementStart(57,"button",22),c.ɵɵlistener("click",(function(){return t.togglePassword()})),c.ɵɵpipe(58,"i18n"),c.ɵɵtext(59," "),c.ɵɵelement(60,"i",23),c.ɵɵtext(61," "),c.ɵɵelementEnd(),c.ɵɵtext(62," "),c.ɵɵelementStart(63,"button",22),c.ɵɵlistener("click",(function(){return t.copy(t.newPassword)})),c.ɵɵpipe(64,"i18n"),c.ɵɵtext(65," "),c.ɵɵelement(66,"i",24),c.ɵɵtext(67," "),c.ɵɵelementEnd(),c.ɵɵtext(68," "),c.ɵɵelementEnd(),c.ɵɵtext(69," "),c.ɵɵelementEnd(),c.ɵɵtext(70," "),c.ɵɵelementStart(71,"app-password-strength",25),c.ɵɵtext(72," "),c.ɵɵelementEnd(),c.ɵɵtext(73," "),c.ɵɵelementEnd(),c.ɵɵtext(74," "),c.ɵɵelementEnd(),c.ɵɵtext(75," "),c.ɵɵelementEnd(),c.ɵɵtext(76," "),c.ɵɵelementStart(77,"div",26),c.ɵɵtext(78," "),c.ɵɵelementStart(79,"button",27),c.ɵɵtext(80," "),c.ɵɵelement(81,"i",28),c.ɵɵpipe(82,"i18n"),c.ɵɵtext(83," "),c.ɵɵelementStart(84,"span"),c.ɵɵtext(85),c.ɵɵpipe(86,"i18n"),c.ɵɵelementEnd(),c.ɵɵtext(87," "),c.ɵɵelementEnd(),c.ɵɵtext(88," "),c.ɵɵelementStart(89,"button",29),c.ɵɵtext(90),c.ɵɵpipe(91,"i18n"),c.ɵɵelementEnd(),c.ɵɵtext(92," "),c.ɵɵelementEnd(),c.ɵɵtext(93," "),c.ɵɵelementEnd(),c.ɵɵtext(94," "),c.ɵɵelementEnd(),c.ɵɵtext(95," "),c.ɵɵelementEnd(),c.ɵɵtext(96," ")),2&e){var n=c.ɵɵreference(5);c.ɵɵadvance(4),c.ɵɵproperty("appApiAction",t.formPromise),c.ɵɵadvance(6),c.ɵɵtextInterpolate1(" ",c.ɵɵpipeBind1(11,19,"resetPassword")," "),c.ɵɵadvance(2),c.ɵɵproperty("ngIf",t.name),c.ɵɵadvance(3),c.ɵɵpropertyInterpolate("appA11yTitle",c.ɵɵpipeBind1(16,21,"close")),c.ɵɵadvance(11),c.ɵɵtextInterpolate1("",c.ɵɵpipeBind2(27,23,"resetPasswordLoggedOutWarning",t.loggedOutWarningName)," "),c.ɵɵadvance(3),c.ɵɵproperty("ngIf",t.enforcedPolicyOptions),c.ɵɵadvance(9),c.ɵɵtextInterpolate(c.ɵɵpipeBind1(39,26,"newPassword")),c.ɵɵadvance(5),c.ɵɵpropertyInterpolate("appA11yTitle",c.ɵɵpipeBind1(44,28,"generatePassword")),c.ɵɵadvance(10),c.ɵɵpropertyInterpolate("type",t.showPassword?"text":"password"),c.ɵɵproperty("ngModel",t.newPassword),c.ɵɵadvance(4),c.ɵɵpropertyInterpolate("appA11yTitle",c.ɵɵpipeBind1(58,30,"toggleVisibility")),c.ɵɵadvance(3),c.ɵɵproperty("ngClass",c.ɵɵpureFunction2(40,_,!t.showPassword,t.showPassword)),c.ɵɵadvance(3),c.ɵɵpropertyInterpolate("appA11yTitle",c.ɵɵpipeBind1(64,32,"copyPassword")),c.ɵɵadvance(8),c.ɵɵproperty("score",t.masterPasswordScore)("showText",!0),c.ɵɵadvance(8),c.ɵɵproperty("disabled",n.loading),c.ɵɵadvance(2),c.ɵɵpropertyInterpolate("title",c.ɵɵpipeBind1(82,34,"loading")),c.ɵɵadvance(4),c.ɵɵtextInterpolate(c.ɵɵpipeBind1(86,36,"save")),c.ɵɵadvance(5),c.ɵɵtextInterpolate(c.ɵɵpipeBind1(91,38,"cancel"))}},directives:[y.ɵangular_packages_forms_forms_ba,y.NgControlStatusGroup,y.NgForm,g.ApiActionDirective,x.NgIf,S.A11yTitleDirective,b.CalloutComponent,w.StopClickDirective,y.DefaultValueAccessor,C.AutofocusDirective,y.RequiredValidator,I.InputVerbatimDirective,y.NgControlStatus,y.NgModel,x.NgClass,E.PasswordStrengthComponent],pipes:[P.I18nPipe],encapsulation:2}),e}();t.ResetPasswordComponent=A,("undefined"==typeof ngDevMode||ngDevMode)&&c.ɵsetClassMetadata(A,[{type:o.Component,args:[{selector:"app-reset-password",templateUrl:"reset-password.component.html"}]}],(function(){return[{type:p.ApiService},{type:u.I18nService},{type:d.PlatformUtilsService},{type:m.PasswordGenerationService},{type:f.PolicyService},{type:h.CryptoService},{type:v.LogService}]}),{name:[{type:o.Input}],email:[{type:o.Input}],id:[{type:o.Input}],organizationId:[{type:o.Input}],onPasswordReset:[{type:o.Output}]})},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&(t[0].checked=!0,t[0].readOnly=e.readOnly,t[0].hidePasswords=e.hidePasswords)})),[3,5];case 4:return t=r.sent(),this.logService.error(t),[3,5];case 5:return[3,7];case 6:this.title=this.i18nService.t("inviteUser"),r.label=7;case 7:return this.loading=!1,[2]}}))}))},e.prototype.loadCollections=function(){return r(this,void 0,void 0,(function(){var e,t,n;return i(this,(function(r){switch(r.label){case 0:return[4,this.apiService.getCollections(this.organizationId)];case 1:return e=r.sent(),t=e.data.map((function(e){return new s.Collection(new a.CollectionData(e))})),n=this,[4,this.collectionService.decryptMany(t)];case 2:return n.collections=r.sent(),[2]}}))}))},e.prototype.check=function(e,t){e.checked=null==t?!e.checked:t,e.checked||(e.readOnly=!1)},e.prototype.selectAll=function(e){var t=this;this.collections.forEach((function(n){return t.check(n,e)}))},e.prototype.setRequestPermissions=function(e,t){return Object.assign(e,t?new d.PermissionsApi:this.permissions),e},e.prototype.handleDependentPermissions=function(){this.permissions.manageResetPassword&&!this.permissions.manageUsers&&(this.permissions.manageUsers=!0,document.getElementById("manageUsers").checked=!0,this.platformUtilsService.showToast("info",null,this.i18nService.t("resetPasswordManageUsers")))},e.prototype.submit=function(){var e,t;return r(this,void 0,void 0,(function(){var n,r,o;return i(this,(function(i){switch(i.label){case 0:n=null,"all"!==this.access&&(n=this.collections.filter((function(e){return e.checked})).map((function(e){return new p.SelectionReadOnlyRequest(e.id,!!e.readOnly,!!e.hidePasswords)}))),i.label=1;case 1:return i.trys.push([1,3,,4]),this.editMode?((r=new c.OrganizationUserUpdateRequest).accessAll="all"===this.access,r.type=this.type,r.collections=n,r.permissions=this.setRequestPermissions(null!==(e=r.permissions)&&void 0!==e?e:new d.PermissionsApi,r.type!==u.OrganizationUserType.Custom),this.formPromise=this.apiService.putOrganizationUser(this.organizationId,this.organizationUserId,r)):((r=new l.OrganizationUserInviteRequest).emails=this.emails.trim().split(/\s*,\s*/),r.accessAll="all"===this.access,r.type=this.type,r.permissions=this.setRequestPermissions(null!==(t=r.permissions)&&void 0!==t?t:new d.PermissionsApi,r.type!==u.OrganizationUserType.Custom),r.collections=n,this.formPromise=this.apiService.postOrganizationUserInvite(this.organizationId,r)),[4,this.formPromise];case 2:return i.sent(),this.toasterService.popAsync("success",null,this.i18nService.t(this.editMode?"editedUserId":"invitedUsers",this.name)),this.onSavedUser.emit(),[3,4];case 3:return o=i.sent(),this.logService.error(o),[3,4];case 4:return[2]}}))}))},e.prototype.delete=function(){return r(this,void 0,void 0,(function(){var e,t;return i(this,(function(n){switch(n.label){case 0:return this.editMode?(e=this.usesKeyConnector?"removeUserConfirmationKeyConnector":"removeUserConfirmation",[4,this.platformUtilsService.showDialog(this.i18nService.t(e),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.toasterService.popAsync("success",null,this.i18nService.t("removedUserId",this.name)),this.onDeletedUser.emit(),[3,5];case 4:return t=n.sent(),this.logService.error(t),[3,5];case 5:return[2]}}))}))},e.ɵfac=function(t){return new(t||e)(m.ɵɵdirectiveInject(f.ApiService),m.ɵɵdirectiveInject(h.I18nService),m.ɵɵdirectiveInject(v.ToasterService),m.ɵɵdirectiveInject(y.CollectionService),m.ɵɵdirectiveInject(g.PlatformUtilsService),m.ɵɵdirectiveInject(x.LogService))},e.ɵcmp=m.ɵɵdefineComponent({type:e,selectors:[["app-user-add-edit"]],inputs:{name:"name",organizationUserId:"organizationUserId",organizationId:"organizationId",usesKeyConnector:"usesKeyConnector"},outputs:{onSavedUser:"onSavedUser",onDeletedUser:"onDeletedUser"},decls:51,vars:19,consts:[["role","dialog","aria-modal","true","aria-labelledby","userAddEditTitle",1,"modal","fade"],["role","document",1,"modal-dialog","modal-dialog-scrollable","modal-lg"],["ngNativeValidate","",1,"modal-content",3,"appApiAction","ngSubmit"],["form",""],[1,"modal-header"],["id","userAddEditTitle",1,"modal-title"],["class","text-muted",4,"ngIf"],["type","button","data-dismiss","modal",1,"close",3,"appA11yTitle"],["aria-hidden","true"],["class","modal-body",4,"ngIf"],[1,"modal-footer"],["type","submit",1,"btn","btn-primary","btn-submit",3,"disabled"],["aria-hidden","true",1,"fa","fa-spinner","fa-spin",3,"title"],["type","button","data-dismiss","modal",1,"btn","btn-outline-secondary"],[1,"ml-auto"],["type","button","class","btn btn-outline-danger",3,"appA11yTitle","disabled","appApiAction","click",4,"ngIf"],[1,"text-muted"],[1,"modal-body"],["aria-hidden","true",1,"fa","fa-spinner","fa-spin","text-muted",3,"title"],[1,"sr-only"],[4,"ngIf"],["target","_blank","rel","noopener","href","https://bitwarden.com/help/article/user-types-access-control/#user-types",3,"appA11yTitle"],["aria-hidden","true",1,"fa","fa-question-circle-o"],[1,"form-check","mt-2","form-check-block"],["type","radio","name","userType","id","userTypeUser",1,"form-check-input",3,"value","ngModel","ngModelChange"],["for","userTypeUser",1,"form-check-label"],["type","radio","name","userType","id","userTypeManager",1,"form-check-input",3,"value","ngModel","ngModelChange"],["for","userTypeManager",1,"form-check-label"],["type","radio","name","userType","id","userTypeAdmin",1,"form-check-input",3,"value","ngModel","ngModelChange"],["for","userTypeAdmin",1,"form-check-label"],["type","radio","name","userType","id","userTypeOwner",1,"form-check-input",3,"value","ngModel","ngModelChange"],["for","userTypeOwner",1,"form-check-label"],["type","radio","name","userType","id","userTypeCustom",1,"form-check-input",3,"value","ngModel","ngModelChange"],["for","userTypeCustom",1,"form-check-label"],[1,"mt-4","d-flex"],[1,"mb-3"],["target","_blank","rel","noopener","href","https://bitwarden.com/help/article/user-types-access-control/#access-control",3,"appA11yTitle"],["class","ml-auto",4,"ngIf"],[1,"form-group",3,"ngClass"],[1,"form-check"],["type","radio","name","access","id","accessAll","value","all",1,"form-check-input",3,"ngModel","ngModelChange"],["for","accessAll",1,"form-check-label"],["type","radio","name","access","id","accessSelected","value","selected",1,"form-check-input",3,"ngModel","ngModelChange"],["for","accessSelected",1,"form-check-label"],[1,"form-group","mb-4"],["for","emails"],["id","emails","type","text","name","Emails","required","","appAutoFocus","",1,"form-control",3,"ngModel","ngModelChange"],[1,"row"],[1,"col-6"],[1,"font-weight-bold","mb-0"],[1,"my-0","mr-2"],["parentId","manageAssignedCollections",3,"checkboxes"],[1,"form-group","mb-0"],[1,"form-check","mt-1","form-check-block"],["type","checkbox","name","accessEventLogs","id","accessEventLogs",1,"form-check-input",3,"ngModel","ngModelChange"],["for","accessEventLogs",1,"form-check-label","font-weight-normal"],["type","checkbox","name","accessImportExport","id","accessImportExport",1,"form-check-input",3,"ngModel","ngModelChange"],["for","accessImportExport",1,"form-check-label","font-weight-normal"],["type","checkbox","name","accessReports","id","accessReports",1,"form-check-input",3,"ngModel","ngModelChange"],["for","accessReports",1,"form-check-label","font-weight-normal"],["parentId","manageAllCollections",3,"checkboxes"],["type","checkbox","name","manageGroups","id","manageGroups",1,"form-check-input",3,"ngModel","ngModelChange"],["for","manageGroups",1,"form-check-label","font-weight-normal"],["type","checkbox","name","manageSso","id","managePolicies",1,"form-check-input",3,"ngModel","ngModelChange"],["for","manageSso",1,"form-check-label","font-weight-normal"],["type","checkbox","name","managePolicies","id","managePolicies",1,"form-check-input",3,"ngModel","ngModelChange"],["for","managePolicies",1,"form-check-label","font-weight-normal"],["type","checkbox","name","manageUsers","id","manageUsers",1,"form-check-input",3,"ngModel","ngModelChange","change"],["for","manageUsers",1,"form-check-label","font-weight-normal"],["type","checkbox","name","manageResetPassword","id","manageResetPassword",1,"form-check-input",3,"ngModel","ngModelChange","change"],["for","manageResetPassword",1,"form-check-label","font-weight-normal"],["type","button",1,"btn","btn-link","btn-sm","py-0",3,"click"],["class","table table-hover table-list mb-0",4,"ngIf"],[1,"table","table-hover","table-list","mb-0"],["width","100",1,"text-center"],[4,"ngFor","ngForOf"],[1,"table-list-checkbox",3,"click"],["type","checkbox","appStopProp","",3,"ngModel","name","ngModelChange"],[3,"click"],[1,"text-center"],["type","checkbox",3,"ngModel","name","disabled","ngModelChange"],["type","button",1,"btn","btn-outline-danger",3,"appA11yTitle","disabled","appApiAction","click"],["deleteBtn",""],["aria-hidden","true",1,"fa","fa-trash-o","fa-lg","fa-fw",3,"hidden"],["aria-hidden","true",1,"fa","fa-spinner","fa-spin","fa-lg","fa-fw",3,"hidden","title"]],template:function(e,t){if(1&e&&(m.ɵɵelementStart(0,"div",0),m.ɵɵtext(1," "),m.ɵɵelementStart(2,"div",1),m.ɵɵtext(3," "),m.ɵɵelementStart(4,"form",2,3),m.ɵɵlistener("ngSubmit",(function(){return t.submit()})),m.ɵɵtext(6," "),m.ɵɵelementStart(7,"div",4),m.ɵɵtext(8," "),m.ɵɵelementStart(9,"h2",5),m.ɵɵtext(10),m.ɵɵtemplate(11,k,2,1,"small",6),m.ɵɵtext(12," "),m.ɵɵelementEnd(),m.ɵɵtext(13," "),m.ɵɵelementStart(14,"button",7),m.ɵɵpipe(15,"i18n"),m.ɵɵtext(16," "),m.ɵɵelementStart(17,"span",8),m.ɵɵtext(18,"×"),m.ɵɵelementEnd(),m.ɵɵtext(19," "),m.ɵɵelementEnd(),m.ɵɵtext(20," "),m.ɵɵelementEnd(),m.ɵɵtext(21," "),m.ɵɵtemplate(22,O,9,6,"div",9),m.ɵɵtext(23," "),m.ɵɵtemplate(24,U,119,67,"div",9),m.ɵɵtext(25," "),m.ɵɵelementStart(26,"div",10),m.ɵɵtext(27," "),m.ɵɵelementStart(28,"button",11),m.ɵɵtext(29," "),m.ɵɵelement(30,"i",12),m.ɵɵpipe(31,"i18n"),m.ɵɵtext(32," "),m.ɵɵelementStart(33,"span"),m.ɵɵtext(34),m.ɵɵpipe(35,"i18n"),m.ɵɵelementEnd(),m.ɵɵtext(36," "),m.ɵɵelementEnd(),m.ɵɵtext(37," "),m.ɵɵelementStart(38,"button",13),m.ɵɵtext(39),m.ɵɵpipe(40,"i18n"),m.ɵɵelementEnd(),m.ɵɵtext(41," "),m.ɵɵelementStart(42,"div",14),m.ɵɵtext(43," "),m.ɵɵtemplate(44,V,9,10,"button",15),m.ɵɵtext(45," "),m.ɵɵelementEnd(),m.ɵɵtext(46," "),m.ɵɵelementEnd(),m.ɵɵtext(47," "),m.ɵɵelementEnd(),m.ɵɵtext(48," "),m.ɵɵelementEnd(),m.ɵɵtext(49," "),m.ɵɵelementEnd(),m.ɵɵtext(50," ")),2&e){var n=m.ɵɵreference(5);m.ɵɵadvance(4),m.ɵɵproperty("appApiAction",t.formPromise),m.ɵɵadvance(6),m.ɵɵtextInterpolate1(" ",t.title," "),m.ɵɵadvance(1),m.ɵɵproperty("ngIf",t.name),m.ɵɵadvance(3),m.ɵɵpropertyInterpolate("appA11yTitle",m.ɵɵpipeBind1(15,11,"close")),m.ɵɵadvance(8),m.ɵɵproperty("ngIf",t.loading),m.ɵɵadvance(2),m.ɵɵproperty("ngIf",!t.loading),m.ɵɵadvance(4),m.ɵɵproperty("disabled",n.loading),m.ɵɵadvance(2),m.ɵɵpropertyInterpolate("title",m.ɵɵpipeBind1(31,13,"loading")),m.ɵɵadvance(4),m.ɵɵtextInterpolate(m.ɵɵpipeBind1(35,15,"save")),m.ɵɵadvance(5),m.ɵɵtextInterpolate1(" ",m.ɵɵpipeBind1(40,17,"cancel")," "),m.ɵɵadvance(5),m.ɵɵproperty("ngIf",t.editMode)}},directives:[S.NgControlStatusGroup,S.NgForm,b.ApiActionDirective,w.NgIf,C.A11yTitleDirective,S.RadioControlValueAccessor,S.DefaultValueAccessor,S.NgControlStatus,S.NgModel,w.NgClass,S.RequiredValidator,I.NestedCheckboxComponent,S.CheckboxControlValueAccessor,w.NgForOf,E.StopPropDirective],pipes:[P.I18nPipe],encapsulation:2}),e}();t.UserAddEditComponent=F,("undefined"==typeof ngDevMode||ngDevMode)&&m.ɵsetClassMetadata(F,[{type:o.Component,args:[{selector:"app-user-add-edit",templateUrl:"user-add-edit.component.html"}]}],(function(){return[{type:f.ApiService},{type:h.I18nService},{type:v.ToasterService},{type:y.CollectionService},{type:g.PlatformUtilsService},{type:x.LogService}]}),{name:[{type:o.Input}],organizationUserId:[{type:o.Input}],organizationId:[{type:o.Input}],usesKeyConnector:[{type:o.Input}],onSavedUser:[{type:o.Output}],onDeletedUser:[{type:o.Output}]})},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&(t[0].checked=!0)})),[3,5];case 4:return r=i.sent(),this.logService.error(r),[3,5];case 5:return this.loading=!1,[2]}}))}))},e.prototype.check=function(e,t){e.checked=null==t?!e.checked:t,e.checked||(e.readOnly=!1)},e.prototype.selectAll=function(e){var t=this;this.groups.forEach((function(n){return t.check(n,e)}))},e.prototype.submit=function(){return r(this,void 0,void 0,(function(){var e,t;return i(this,(function(n){switch(n.label){case 0:(e=new a.OrganizationUserUpdateGroupsRequest).groupIds=this.groups.filter((function(e){return e.checked})).map((function(e){return e.id})),n.label=1;case 1:return n.trys.push([1,3,,4]),this.formPromise=this.apiService.putOrganizationUserGroups(this.organizationId,this.organizationUserId,e),[4,this.formPromise];case 2:return n.sent(),this.toasterService.popAsync("success",null,this.i18nService.t("editedGroupsForUser",this.name)),this.onSavedUser.emit(),[3,4];case 3:return t=n.sent(),this.logService.error(t),[3,4];case 4:return[2]}}))}))},e.ɵfac=function(t){return new(t||e)(l.ɵɵdirectiveInject(c.ApiService),l.ɵɵdirectiveInject(p.I18nService),l.ɵɵdirectiveInject(u.ToasterService),l.ɵɵdirectiveInject(d.LogService))},e.ɵcmp=l.ɵɵdefineComponent({type:e,selectors:[["app-user-groups"]],inputs:{name:"name",organizationUserId:"organizationUserId",organizationId:"organizationId"},outputs:{onSavedUser:"onSavedUser"},decls:47,vars:20,consts:[["role","dialog","aria-modal","true","aria-labelledby","groupAccessTitle",1,"modal","fade"],["role","document",1,"modal-dialog","modal-dialog-scrollable"],[1,"modal-content",3,"appApiAction","ngSubmit"],["form",""],[1,"modal-header"],["id","groupAccessTitle",1,"modal-title"],["class","text-muted",4,"ngIf"],["type","button","data-dismiss","modal",1,"close",3,"appA11yTitle"],["aria-hidden","true"],["class","modal-body",4,"ngIf"],[1,"modal-footer"],["type","submit",1,"btn","btn-primary","btn-submit",3,"disabled"],["aria-hidden","true",1,"fa","fa-spinner","fa-spin",3,"title"],["type","button","data-dismiss","modal",1,"btn","btn-outline-secondary"],[1,"text-muted"],[1,"modal-body"],["aria-hidden","true",1,"fa","fa-spinner","fa-spin","text-muted",3,"title"],[1,"sr-only"],[4,"ngIf"],["class","table table-hover table-list mb-0",4,"ngIf"],[1,"table","table-hover","table-list","mb-0"],[4,"ngFor","ngForOf"],[1,"table-list-checkbox",3,"click"],["type","checkbox","appStopProp","",3,"ngModel","name","ngModelChange"],[3,"click"]],template:function(e,t){if(1&e&&(l.ɵɵelementStart(0,"div",0),l.ɵɵtext(1," "),l.ɵɵelementStart(2,"div",1),l.ɵɵtext(3," "),l.ɵɵelementStart(4,"form",2,3),l.ɵɵlistener("ngSubmit",(function(){return t.submit()})),l.ɵɵtext(6," "),l.ɵɵelementStart(7,"div",4),l.ɵɵtext(8," "),l.ɵɵelementStart(9,"h2",5),l.ɵɵtext(10),l.ɵɵpipe(11,"i18n"),l.ɵɵtemplate(12,x,2,1,"small",6),l.ɵɵtext(13," "),l.ɵɵelementEnd(),l.ɵɵtext(14," "),l.ɵɵelementStart(15,"button",7),l.ɵɵpipe(16,"i18n"),l.ɵɵtext(17," "),l.ɵɵelementStart(18,"span",8),l.ɵɵtext(19,"×"),l.ɵɵelementEnd(),l.ɵɵtext(20," "),l.ɵɵelementEnd(),l.ɵɵtext(21," "),l.ɵɵelementEnd(),l.ɵɵtext(22," "),l.ɵɵtemplate(23,S,9,6,"div",9),l.ɵɵtext(24," "),l.ɵɵtemplate(25,I,10,5,"div",9),l.ɵɵtext(26," "),l.ɵɵelementStart(27,"div",10),l.ɵɵtext(28," "),l.ɵɵelementStart(29,"button",11),l.ɵɵtext(30," "),l.ɵɵelement(31,"i",12),l.ɵɵpipe(32,"i18n"),l.ɵɵtext(33," "),l.ɵɵelementStart(34,"span"),l.ɵɵtext(35),l.ɵɵpipe(36,"i18n"),l.ɵɵelementEnd(),l.ɵɵtext(37," "),l.ɵɵelementEnd(),l.ɵɵtext(38," "),l.ɵɵelementStart(39,"button",13),l.ɵɵtext(40),l.ɵɵpipe(41,"i18n"),l.ɵɵelementEnd(),l.ɵɵtext(42," "),l.ɵɵelementEnd(),l.ɵɵtext(43," "),l.ɵɵelementEnd(),l.ɵɵtext(44," "),l.ɵɵelementEnd(),l.ɵɵtext(45," "),l.ɵɵelementEnd(),l.ɵɵtext(46," ")),2&e){var n=l.ɵɵreference(5);l.ɵɵadvance(4),l.ɵɵproperty("appApiAction",t.formPromise),l.ɵɵadvance(6),l.ɵɵtextInterpolate1(" ",l.ɵɵpipeBind1(11,10,"groupAccess")," "),l.ɵɵadvance(2),l.ɵɵproperty("ngIf",t.name),l.ɵɵadvance(3),l.ɵɵpropertyInterpolate("appA11yTitle",l.ɵɵpipeBind1(16,12,"close")),l.ɵɵadvance(8),l.ɵɵproperty("ngIf",t.loading),l.ɵɵadvance(2),l.ɵɵproperty("ngIf",!t.loading),l.ɵɵadvance(4),l.ɵɵproperty("disabled",n.loading),l.ɵɵadvance(2),l.ɵɵpropertyInterpolate("title",l.ɵɵpipeBind1(32,14,"loading")),l.ɵɵadvance(4),l.ɵɵtextInterpolate(l.ɵɵpipeBind1(36,16,"save")),l.ɵɵadvance(5),l.ɵɵtextInterpolate(l.ɵɵpipeBind1(41,18,"cancel"))}},directives:[m.ɵangular_packages_forms_forms_ba,m.NgControlStatusGroup,m.NgForm,f.ApiActionDirective,h.NgIf,v.A11yTitleDirective,h.NgForOf,m.CheckboxControlValueAccessor,y.StopPropDirective,m.NgControlStatus,m.NgModel],pipes:[g.I18nPipe],encapsulation:2}),e}();t.UserGroupsComponent=E,("undefined"==typeof ngDevMode||ngDevMode)&&l.ɵsetClassMetadata(E,[{type:o.Component,args:[{selector:"app-user-groups",templateUrl:"user-groups.component.html"}]}],(function(){return[{type:c.ApiService},{type:p.I18nService},{type:u.ToasterService},{type:d.LogService}]}),{name:[{type:o.Input}],organizationUserId:[{type:o.Input}],organizationId:[{type:o.Input}],onSavedUser:[{type:o.Output}]})},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0?e.data:[],this.orgPolicies.forEach((function(e){t.policiesEnabledMap.set(e.type,e.enabled)})),this.loading=!1,[2]}}))}))},e.prototype.edit=function(e){return r(this,void 0,void 0,(function(){var t,n=this;return i(this,(function(r){switch(r.label){case 0:return[4,this.modalService.openViewRef(s.PolicyEditComponent,this.editModalRef,(function(r){r.policy=e,r.organizationId=n.organizationId,r.policiesEnabledMap=n.policiesEnabledMap,r.onSavedPolicy.subscribe((function(){t.close(),n.load()}))}))];case 1:return t=r.sent()[0],[2]}}))}))},e.ɵfac=function(t){return new(t||e)(l.ɵɵdirectiveInject(c.ApiService),l.ɵɵdirectiveInject(p.ActivatedRoute),l.ɵɵdirectiveInject(u.ModalService),l.ɵɵdirectiveInject(d.UserService),l.ɵɵdirectiveInject(m.PolicyListService),l.ɵɵdirectiveInject(p.Router))},e.ɵcmp=l.ɵɵdefineComponent({type:e,selectors:[["app-org-policies"]],viewQuery:function(e,t){if(1&e&&l.ɵɵviewQuery(y,3,o.ViewContainerRef),2&e){var n;l.ɵɵqueryRefresh(n=l.ɵɵloadQuery())&&(t.editModalRef=n.first)}},decls:14,vars:5,consts:[[1,"page-header","d-flex"],[4,"ngIf"],["class","table table-hover table-list",4,"ngIf"],["editTemplate",""],["aria-hidden","true",1,"fa","fa-spinner","fa-spin","text-muted",3,"title"],[1,"sr-only"],[1,"table","table-hover","table-list"],[4,"ngFor","ngForOf"],["href","#","appStopClick","",3,"click"],["class","badge badge-success",4,"ngIf"],[1,"text-muted","d-block"],[1,"badge","badge-success"]],template:function(e,t){1&e&&(l.ɵɵelementStart(0,"div",0),l.ɵɵtext(1," "),l.ɵɵelementStart(2,"h1"),l.ɵɵtext(3),l.ɵɵpipe(4,"i18n"),l.ɵɵelementEnd(),l.ɵɵtext(5," "),l.ɵɵelementEnd(),l.ɵɵtext(6," "),l.ɵɵtemplate(7,g,9,6,"ng-container",1),l.ɵɵtext(8," "),l.ɵɵtemplate(9,w,7,1,"table",2),l.ɵɵtext(10," "),l.ɵɵtemplate(11,C,0,0,"ng-template",null,3,l.ɵɵtemplateRefExtractor),l.ɵɵtext(13," ")),2&e&&(l.ɵɵadvance(3),l.ɵɵtextInterpolate(l.ɵɵpipeBind1(4,3,"policies")),l.ɵɵadvance(4),l.ɵɵproperty("ngIf",t.loading),l.ɵɵadvance(2),l.ɵɵproperty("ngIf",!t.loading))},directives:[f.NgIf,f.NgForOf,h.StopClickDirective],pipes:[v.I18nPipe],encapsulation:2}),e}();t.PoliciesComponent=I,("undefined"==typeof ngDevMode||ngDevMode)&&l.ɵsetClassMetadata(I,[{type:o.Component,args:[{selector:"app-org-policies",templateUrl:"policies.component.html"}]}],(function(){return[{type:c.ApiService},{type:p.ActivatedRoute},{type:u.ModalService},{type:d.UserService},{type:m.PolicyListService},{type:p.Router}]}),{editModalRef:[{type:o.ViewChild,args:["editTemplate",{read:o.ViewContainerRef,static:!0}]}]})},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]1?"×"+n.quantity:""," @ ",s.ɵɵpipeBind2(4,5,n.amount,"$")," "),s.ɵɵadvance(4),s.ɵɵtextInterpolate2(" ",s.ɵɵpipeBind2(8,8,n.quantity*n.amount,"$")," /",s.ɵɵpipeBind1(9,11,n.interval)," ")}}function D(e,t){if(1&e&&(s.ɵɵelementStart(0,"div",27),s.ɵɵtext(1," "),s.ɵɵelementStart(2,"strong",28),s.ɵɵtext(3),s.ɵɵpipe(4,"i18n"),s.ɵɵelementEnd(),s.ɵɵtext(5," "),s.ɵɵelementStart(6,"table",29),s.ɵɵtext(7," "),s.ɵɵelementStart(8,"tbody"),s.ɵɵtext(9," "),s.ɵɵtemplate(10,M,11,13,"tr",30),s.ɵɵtext(11," "),s.ɵɵelementEnd(),s.ɵɵtext(12," "),s.ɵɵelementEnd(),s.ɵɵtext(13," "),s.ɵɵelementEnd()),2&e){var n=s.ɵɵnextContext(3);s.ɵɵadvance(3),s.ɵɵtextInterpolate(s.ɵɵpipeBind1(4,2,"details")),s.ɵɵadvance(7),s.ɵɵproperty("ngForOf",n.subscription.items)}}function R(e,t){if(1&e&&(s.ɵɵelementContainerStart(0),s.ɵɵtext(1," "),s.ɵɵelementStart(2,"div",31),s.ɵɵtext(3," "),s.ɵɵelementStart(4,"dl"),s.ɵɵtext(5," "),s.ɵɵelementStart(6,"dt"),s.ɵɵtext(7),s.ɵɵpipe(8,"i18n"),s.ɵɵelementEnd(),s.ɵɵtext(9," "),s.ɵɵelementStart(10,"dd"),s.ɵɵtext(11),s.ɵɵpipe(12,"i18n"),s.ɵɵelementEnd(),s.ɵɵtext(13," "),s.ɵɵelementEnd(),s.ɵɵtext(14," "),s.ɵɵelementEnd(),s.ɵɵtext(15," "),s.ɵɵelementContainerEnd()),2&e){var n=s.ɵɵnextContext(3);s.ɵɵadvance(7),s.ɵɵtextInterpolate(s.ɵɵpipeBind1(8,2,"provider")),s.ɵɵadvance(4),s.ɵɵtextInterpolate(s.ɵɵpipeBind2(12,4,"yourProviderIs",n.userOrg.providerName))}}function B(e,t){if(1&e){var n=s.ɵɵgetCurrentView();s.ɵɵelementStart(0,"button",32),s.ɵɵlistener("click",(function(){return s.ɵɵrestoreView(n),s.ɵɵnextContext(3).changePlan()})),s.ɵɵtext(1),s.ɵɵpipe(2,"i18n"),s.ɵɵelementEnd()}2&e&&(s.ɵɵadvance(1),s.ɵɵtextInterpolate1(" ",s.ɵɵpipeBind1(2,1,"changeBillingPlan")," "))}function j(e,t){if(1&e){var n=s.ɵɵgetCurrentView();s.ɵɵelementStart(0,"app-change-plan",33),s.ɵɵlistener("onChanged",(function(){return s.ɵɵrestoreView(n),s.ɵɵnextContext(3).closeChangePlan(!0)}))("onCanceled",(function(){return s.ɵɵrestoreView(n),s.ɵɵnextContext(3).closeChangePlan(!1)})),s.ɵɵelementEnd()}if(2&e){var r=s.ɵɵnextContext(3);s.ɵɵproperty("organizationId",r.organizationId)}}function U(e,t){if(1&e){var n=s.ɵɵgetCurrentView();s.ɵɵelementContainerStart(0),s.ɵɵtext(1," "),s.ɵɵelementStart(2,"div",34),s.ɵɵtext(3," "),s.ɵɵelementStart(4,"app-adjust-subscription",35),s.ɵɵlistener("onAdjusted",(function(){return s.ɵɵrestoreView(n),s.ɵɵnextContext(3).subscriptionAdjusted()})),s.ɵɵtext(5," "),s.ɵɵelementEnd(),s.ɵɵtext(6," "),s.ɵɵelementEnd(),s.ɵɵtext(7," "),s.ɵɵelementContainerEnd()}if(2&e){var r=s.ɵɵnextContext(3);s.ɵɵadvance(4),s.ɵɵproperty("seatPrice",r.seatPrice)("organizationId",r.organizationId)("interval",r.billingInterval)("currentSeatCount",r.seats)("maxAutoscaleSeats",r.maxAutoscaleSeats)}}function V(e,t){if(1&e){var n=s.ɵɵgetCurrentView();s.ɵɵelementStart(0,"button",36,37),s.ɵɵlistener("click",(function(){return s.ɵɵrestoreView(n),s.ɵɵnextContext(3).removeSponsorship()})),s.ɵɵtext(2," "),s.ɵɵelement(3,"i",9),s.ɵɵpipe(4,"i18n"),s.ɵɵtext(5," "),s.ɵɵelementStart(6,"span"),s.ɵɵtext(7),s.ɵɵpipe(8,"i18n"),s.ɵɵelementEnd(),s.ɵɵtext(9," "),s.ɵɵelementEnd()}if(2&e){var r=s.ɵɵreference(1),i=s.ɵɵnextContext(3);s.ɵɵproperty("appApiAction",i.removeSponsorshipPromise)("disabled",r.loading),s.ɵɵadvance(3),s.ɵɵpropertyInterpolate("title",s.ɵɵpipeBind1(4,4,"loading")),s.ɵɵadvance(4),s.ɵɵtextInterpolate(s.ɵɵpipeBind1(8,6,"removeSponsorship"))}}function F(e,t){if(1&e){var n=s.ɵɵgetCurrentView();s.ɵɵelementStart(0,"div",20),s.ɵɵtext(1," "),s.ɵɵelementStart(2,"button",32),s.ɵɵlistener("click",(function(){return s.ɵɵrestoreView(n),s.ɵɵnextContext(4).adjustStorage(!0)})),s.ɵɵtext(3),s.ɵɵpipe(4,"i18n"),s.ɵɵelementEnd(),s.ɵɵtext(5," "),s.ɵɵelementStart(6,"button",40),s.ɵɵlistener("click",(function(){return s.ɵɵrestoreView(n),s.ɵɵnextContext(4).adjustStorage(!1)})),s.ɵɵtext(7),s.ɵɵpipe(8,"i18n"),s.ɵɵelementEnd(),s.ɵɵtext(9," "),s.ɵɵelementEnd()}2&e&&(s.ɵɵadvance(3),s.ɵɵtextInterpolate1(" ",s.ɵɵpipeBind1(4,2,"addStorage")," "),s.ɵɵadvance(4),s.ɵɵtextInterpolate1(" ",s.ɵɵpipeBind1(8,4,"removeStorage")," "))}function N(e,t){if(1&e){var n=s.ɵɵgetCurrentView();s.ɵɵelementStart(0,"app-adjust-storage",41),s.ɵɵlistener("onAdjusted",(function(){return s.ɵɵrestoreView(n),s.ɵɵnextContext(4).closeStorage(!0)}))("onCanceled",(function(){return s.ɵɵrestoreView(n),s.ɵɵnextContext(4).closeStorage(!1)})),s.ɵɵelementEnd()}if(2&e){var r=s.ɵɵnextContext(4);s.ɵɵproperty("storageGbPrice",r.storageGbPrice)("add",r.adjustStorageAdd)("organizationId",r.organizationId)("interval",r.billingInterval)}}function z(e,t){if(1&e&&(s.ɵɵelementContainerStart(0),s.ɵɵtext(1," "),s.ɵɵelementStart(2,"div",34),s.ɵɵtext(3," "),s.ɵɵtemplate(4,F,10,6,"div",38),s.ɵɵtext(5," "),s.ɵɵtemplate(6,N,1,4,"app-adjust-storage",39),s.ɵɵtext(7," "),s.ɵɵelementEnd(),s.ɵɵtext(8," "),s.ɵɵelementContainerEnd()),2&e){var n=s.ɵɵnextContext(3);s.ɵɵadvance(4),s.ɵɵproperty("ngIf",!n.showAdjustStorage),s.ɵɵadvance(2),s.ɵɵproperty("ngIf",n.showAdjustStorage)}}function L(e,t){if(1&e){var n=s.ɵɵgetCurrentView();s.ɵɵelementStart(0,"button",42),s.ɵɵlistener("click",(function(){return s.ɵɵrestoreView(n),s.ɵɵnextContext(3).downloadLicense()})),s.ɵɵtext(1),s.ɵɵpipe(2,"i18n"),s.ɵɵelementEnd()}if(2&e){var r=s.ɵɵnextContext(3);s.ɵɵproperty("disabled",r.showDownloadLicense),s.ɵɵadvance(1),s.ɵɵtextInterpolate1(" ",s.ɵɵpipeBind1(2,2,"downloadLicense")," ")}}function K(e,t){if(1&e){var n=s.ɵɵgetCurrentView();s.ɵɵelementStart(0,"button",43,44),s.ɵɵlistener("click",(function(){return s.ɵɵrestoreView(n),s.ɵɵnextContext(3).cancel()})),s.ɵɵtext(2," "),s.ɵɵelement(3,"i",9),s.ɵɵpipe(4,"i18n"),s.ɵɵtext(5," "),s.ɵɵelementStart(6,"span"),s.ɵɵtext(7),s.ɵɵpipe(8,"i18n"),s.ɵɵelementEnd(),s.ɵɵtext(9," "),s.ɵɵelementEnd()}if(2&e){var r=s.ɵɵreference(1),i=s.ɵɵnextContext(3);s.ɵɵproperty("appApiAction",i.cancelPromise)("disabled",r.loading),s.ɵɵadvance(3),s.ɵɵpropertyInterpolate("title",s.ɵɵpipeBind1(4,4,"loading")),s.ɵɵadvance(4),s.ɵɵtextInterpolate(s.ɵɵpipeBind1(8,6,"cancelSubscription"))}}function q(e,t){if(1&e){var n=s.ɵɵgetCurrentView();s.ɵɵelementStart(0,"div",34),s.ɵɵtext(1," "),s.ɵɵelementStart(2,"app-download-license",45),s.ɵɵlistener("onDownloaded",(function(){return s.ɵɵrestoreView(n),s.ɵɵnextContext(3).closeDownloadLicense()}))("onCanceled",(function(){return s.ɵɵrestoreView(n),s.ɵɵnextContext(3).closeDownloadLicense()})),s.ɵɵelementEnd(),s.ɵɵtext(3," "),s.ɵɵelementEnd()}if(2&e){var r=s.ɵɵnextContext(3);s.ɵɵadvance(2),s.ɵɵproperty("organizationId",r.organizationId)}}var G=function(e){return{width:e}};function W(e,t){if(1&e&&(s.ɵɵelementContainerStart(0),s.ɵɵtext(1," "),s.ɵɵelementStart(2,"div",10),s.ɵɵtext(3," "),s.ɵɵelementStart(4,"div",11),s.ɵɵtext(5," "),s.ɵɵelementStart(6,"dl"),s.ɵɵtext(7," "),s.ɵɵelementStart(8,"dt"),s.ɵɵtext(9),s.ɵɵpipe(10,"i18n"),s.ɵɵelementEnd(),s.ɵɵtext(11," "),s.ɵɵelementStart(12,"dd"),s.ɵɵtext(13),s.ɵɵelementEnd(),s.ɵɵtext(14," "),s.ɵɵtemplate(15,T,23,15,"ng-container",1),s.ɵɵtext(16," "),s.ɵɵelementEnd(),s.ɵɵtext(17," "),s.ɵɵelementEnd(),s.ɵɵtext(18," "),s.ɵɵtemplate(19,D,14,4,"div",12),s.ɵɵtext(20," "),s.ɵɵtemplate(21,R,16,7,"ng-container",1),s.ɵɵtext(22," "),s.ɵɵelementEnd(),s.ɵɵtext(23," "),s.ɵɵelementContainerStart(24),s.ɵɵtext(25," "),s.ɵɵtemplate(26,B,3,3,"button",13),s.ɵɵtext(27," "),s.ɵɵtemplate(28,j,1,1,"app-change-plan",14),s.ɵɵtext(29," "),s.ɵɵelementContainerEnd(),s.ɵɵtext(30," "),s.ɵɵelementStart(31,"h2",15),s.ɵɵtext(32),s.ɵɵpipe(33,"i18n"),s.ɵɵelementEnd(),s.ɵɵtext(34," "),s.ɵɵelementStart(35,"p",16),s.ɵɵtext(36),s.ɵɵelementEnd(),s.ɵɵtext(37," "),s.ɵɵtemplate(38,U,8,5,"ng-container",1),s.ɵɵtext(39," "),s.ɵɵtemplate(40,V,10,8,"button",17),s.ɵɵtext(41," "),s.ɵɵelementStart(42,"h2",15),s.ɵɵtext(43),s.ɵɵpipe(44,"i18n"),s.ɵɵelementEnd(),s.ɵɵtext(45," "),s.ɵɵelementStart(46,"p"),s.ɵɵtext(47),s.ɵɵpipe(48,"i18n"),s.ɵɵelementEnd(),s.ɵɵtext(49," "),s.ɵɵelementStart(50,"div",18),s.ɵɵtext(51," "),s.ɵɵelementStart(52,"div",19),s.ɵɵtext(53),s.ɵɵpipe(54,"percent"),s.ɵɵelementEnd(),s.ɵɵtext(55," "),s.ɵɵelementEnd(),s.ɵɵtext(56," "),s.ɵɵtemplate(57,z,9,2,"ng-container",1),s.ɵɵtext(58," "),s.ɵɵelementStart(59,"h2",15),s.ɵɵtext(60),s.ɵɵpipe(61,"i18n"),s.ɵɵelementEnd(),s.ɵɵtext(62," "),s.ɵɵelementStart(63,"p",16),s.ɵɵtext(64),s.ɵɵpipe(65,"i18n"),s.ɵɵelementEnd(),s.ɵɵtext(66," "),s.ɵɵelementStart(67,"div",20),s.ɵɵtext(68," "),s.ɵɵtemplate(69,L,3,4,"button",21),s.ɵɵtext(70," "),s.ɵɵtemplate(71,K,10,8,"button",22),s.ɵɵtext(72," "),s.ɵɵelementEnd(),s.ɵɵtext(73," "),s.ɵɵtemplate(74,q,4,1,"div",23),s.ɵɵtext(75," "),s.ɵɵelementContainerEnd()),2&e){var n=s.ɵɵnextContext(2);s.ɵɵadvance(9),s.ɵɵtextInterpolate(s.ɵɵpipeBind1(10,22,"billingPlan")),s.ɵɵadvance(4),s.ɵɵtextInterpolate(n.sub.plan.name),s.ɵɵadvance(2),s.ɵɵproperty("ngIf",n.subscription),s.ɵɵadvance(4),s.ɵɵproperty("ngIf",n.subscription),s.ɵɵadvance(2),s.ɵɵproperty("ngIf",null!=(null==n.userOrg?null:n.userOrg.providerId)),s.ɵɵadvance(5),s.ɵɵproperty("ngIf",n.showChangePlanButton),s.ɵɵadvance(2),s.ɵɵproperty("ngIf",n.showChangePlan),s.ɵɵadvance(4),s.ɵɵtextInterpolate(s.ɵɵpipeBind1(33,24,"manageSubscription")),s.ɵɵadvance(4),s.ɵɵtextInterpolate(n.subscriptionDesc),s.ɵɵadvance(2),s.ɵɵproperty("ngIf",n.subscription&&n.canAdjustSeats&&!n.subscription.cancelled&&!n.subscriptionMarkedForCancel),s.ɵɵadvance(2),s.ɵɵproperty("ngIf",n.isSponsoredSubscription),s.ɵɵadvance(3),s.ɵɵtextInterpolate(s.ɵɵpipeBind1(44,26,"storage")),s.ɵɵadvance(4),s.ɵɵtextInterpolate(s.ɵɵpipeBind3(48,28,"subscriptionStorage",n.sub.maxStorageGb||0,n.sub.storageName||"0 MB")),s.ɵɵadvance(5),s.ɵɵproperty("ngStyle",s.ɵɵpureFunction1(38,G,n.storageProgressWidth+"%")),s.ɵɵattribute("aria-valuenow",n.storagePercentage),s.ɵɵadvance(1),s.ɵɵtextInterpolate1(" ",s.ɵɵpipeBind1(54,32,n.storagePercentage/100),""),s.ɵɵadvance(4),s.ɵɵproperty("ngIf",n.subscription&&!n.subscription.cancelled&&!n.subscriptionMarkedForCancel),s.ɵɵadvance(3),s.ɵɵtextInterpolate(s.ɵɵpipeBind1(61,34,"additionalOptions")),s.ɵɵadvance(4),s.ɵɵtextInterpolate1(" ",s.ɵɵpipeBind1(65,36,"additionalOptionsDesc")," "),s.ɵɵadvance(5),s.ɵɵproperty("ngIf",n.canDownloadLicense),s.ɵɵadvance(2),s.ɵɵproperty("ngIf",n.subscription&&!n.subscription.cancelled&&!n.subscriptionMarkedForCancel),s.ɵɵadvance(3),s.ɵɵproperty("ngIf",n.showDownloadLicense)}}function H(e,t){1&e&&(s.ɵɵelementStart(0,"span",49),s.ɵɵtext(1," "),s.ɵɵelement(2,"i",50),s.ɵɵtext(3),s.ɵɵpipe(4,"i18n"),s.ɵɵelementEnd()),2&e&&(s.ɵɵadvance(3),s.ɵɵtextInterpolate1(" ",s.ɵɵpipeBind1(4,1,"licenseIsExpired")," "))}function $(e,t){if(1&e&&(s.ɵɵelementStart(0,"dd"),s.ɵɵtext(1),s.ɵɵpipe(2,"date"),s.ɵɵtemplate(3,H,5,3,"span",48),s.ɵɵtext(4," "),s.ɵɵelementEnd()),2&e){var n=s.ɵɵnextContext(3);s.ɵɵadvance(1),s.ɵɵtextInterpolate1(" ",s.ɵɵpipeBind2(2,2,n.sub.expiration,"mediumDate")," "),s.ɵɵadvance(2),s.ɵɵproperty("ngIf",n.isExpired)}}function Q(e,t){1&e&&(s.ɵɵelementStart(0,"dd"),s.ɵɵtext(1),s.ɵɵpipe(2,"i18n"),s.ɵɵelementEnd()),2&e&&(s.ɵɵadvance(1),s.ɵɵtextInterpolate(s.ɵɵpipeBind1(2,1,"neverExpires")))}function Y(e,t){if(1&e){var n=s.ɵɵgetCurrentView();s.ɵɵelementStart(0,"div",51),s.ɵɵtext(1," "),s.ɵɵelementStart(2,"div",52),s.ɵɵtext(3," "),s.ɵɵelementStart(4,"button",53),s.ɵɵlistener("click",(function(){return s.ɵɵrestoreView(n),s.ɵɵnextContext(3).closeUpdateLicense(!1)})),s.ɵɵpipe(5,"i18n"),s.ɵɵelementStart(6,"span",54),s.ɵɵtext(7,"×"),s.ɵɵelementEnd(),s.ɵɵelementEnd(),s.ɵɵtext(8," "),s.ɵɵelementStart(9,"h3",55),s.ɵɵtext(10),s.ɵɵpipe(11,"i18n"),s.ɵɵelementEnd(),s.ɵɵtext(12," "),s.ɵɵelementStart(13,"app-update-license",56),s.ɵɵlistener("onUpdated",(function(){return s.ɵɵrestoreView(n),s.ɵɵnextContext(3).closeUpdateLicense(!0)}))("onCanceled",(function(){return s.ɵɵrestoreView(n),s.ɵɵnextContext(3).closeUpdateLicense(!1)})),s.ɵɵelementEnd(),s.ɵɵtext(14," "),s.ɵɵelementEnd(),s.ɵɵtext(15," "),s.ɵɵelementEnd()}if(2&e){var r=s.ɵɵnextContext(3);s.ɵɵadvance(4),s.ɵɵpropertyInterpolate("appA11yTitle",s.ɵɵpipeBind1(5,3,"cancel")),s.ɵɵadvance(6),s.ɵɵtextInterpolate(s.ɵɵpipeBind1(11,5,"updateLicense")),s.ɵɵadvance(3),s.ɵɵproperty("organizationId",r.organizationId)}}function J(e,t){if(1&e){var n=s.ɵɵgetCurrentView();s.ɵɵelementContainerStart(0),s.ɵɵtext(1," "),s.ɵɵelementStart(2,"dl"),s.ɵɵtext(3," "),s.ɵɵelementStart(4,"dt"),s.ɵɵtext(5),s.ɵɵpipe(6,"i18n"),s.ɵɵelementEnd(),s.ɵɵtext(7," "),s.ɵɵelementStart(8,"dd"),s.ɵɵtext(9),s.ɵɵelementEnd(),s.ɵɵtext(10," "),s.ɵɵelementStart(11,"dt"),s.ɵɵtext(12),s.ɵɵpipe(13,"i18n"),s.ɵɵelementEnd(),s.ɵɵtext(14," "),s.ɵɵtemplate(15,$,5,5,"dd",1),s.ɵɵtext(16," "),s.ɵɵtemplate(17,Q,3,3,"dd",1),s.ɵɵtext(18," "),s.ɵɵelementEnd(),s.ɵɵtext(19," "),s.ɵɵelementStart(20,"div"),s.ɵɵtext(21," "),s.ɵɵelementStart(22,"button",32),s.ɵɵlistener("click",(function(){return s.ɵɵrestoreView(n),s.ɵɵnextContext(2).updateLicense()})),s.ɵɵtext(23),s.ɵɵpipe(24,"i18n"),s.ɵɵelementEnd(),s.ɵɵtext(25," "),s.ɵɵelementStart(26,"a",46),s.ɵɵtext(27),s.ɵɵpipe(28,"i18n"),s.ɵɵelementEnd(),s.ɵɵtext(29," "),s.ɵɵelementEnd(),s.ɵɵtext(30," "),s.ɵɵtemplate(31,Y,16,7,"div",47),s.ɵɵtext(32," "),s.ɵɵelementContainerEnd()}if(2&e){var r=s.ɵɵnextContext(2);s.ɵɵadvance(5),s.ɵɵtextInterpolate(s.ɵɵpipeBind1(6,8,"billingPlan")),s.ɵɵadvance(4),s.ɵɵtextInterpolate(r.sub.plan.name),s.ɵɵadvance(3),s.ɵɵtextInterpolate(s.ɵɵpipeBind1(13,10,"expiration")),s.ɵɵadvance(3),s.ɵɵproperty("ngIf",r.sub.expiration),s.ɵɵadvance(2),s.ɵɵproperty("ngIf",!r.sub.expiration),s.ɵɵadvance(6),s.ɵɵtextInterpolate1(" ",s.ɵɵpipeBind1(24,12,"updateLicense")," "),s.ɵɵadvance(4),s.ɵɵtextInterpolate1(" ",s.ɵɵpipeBind1(28,14,"manageSubscription")," "),s.ɵɵadvance(4),s.ɵɵproperty("ngIf",r.showUpdateLicense)}}function X(e,t){if(1&e&&(s.ɵɵelementContainerStart(0),s.ɵɵtext(1," "),s.ɵɵtemplate(2,O,4,6,"app-callout",5),s.ɵɵtext(3," "),s.ɵɵtemplate(4,_,18,14,"app-callout",5),s.ɵɵtext(5," "),s.ɵɵtemplate(6,W,76,40,"ng-container",1),s.ɵɵtext(7," "),s.ɵɵtemplate(8,J,33,16,"ng-container",1),s.ɵɵtext(9," "),s.ɵɵelementContainerEnd()),2&e){var n=s.ɵɵnextContext();s.ɵɵadvance(2),s.ɵɵproperty("ngIf",n.subscription&&n.subscription.cancelled),s.ɵɵadvance(2),s.ɵɵproperty("ngIf",n.subscriptionMarkedForCancel),s.ɵɵadvance(2),s.ɵɵproperty("ngIf",!n.selfHosted),s.ɵɵadvance(2),s.ɵɵproperty("ngIf",n.selfHosted)}}var Z=function(){function e(e,t,n,r,i,o,a,s){this.apiService=e,this.platformUtilsService=t,this.i18nService=n,this.toasterService=r,this.messagingService=i,this.route=o,this.userService=a,this.logService=s,this.loading=!1,this.firstLoaded=!1,this.adjustSeatsAdd=!0,this.showAdjustSeats=!1,this.showAdjustSeatAutoscale=!1,this.adjustStorageAdd=!0,this.showAdjustStorage=!1,this.showUpdateLicense=!1,this.showDownloadLicense=!1,this.showChangePlan=!1,this.selfHosted=!1,this.selfHosted=t.isSelfHost()}return e.prototype.ngOnInit=function(){return r(this,void 0,void 0,(function(){var e=this;return i(this,(function(t){return this.route.parent.parent.params.subscribe((function(t){return r(e,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return this.organizationId=t.organizationId,[4,this.load()];case 1:return e.sent(),this.firstLoaded=!0,[2]}}))}))})),[2]}))}))},e.prototype.load=function(){return r(this,void 0,void 0,(function(){var e,t;return i(this,(function(n){switch(n.label){case 0:return this.loading?[2]:(this.loading=!0,e=this,[4,this.userService.getOrganization(this.organizationId)]);case 1:return e.userOrg=n.sent(),t=this,[4,this.apiService.getOrganizationSubscription(this.organizationId)];case 2:return t.sub=n.sent(),this.loading=!1,[2]}}))}))},e.prototype.reinstate=function(){return r(this,void 0,void 0,(function(){var e;return i(this,(function(t){switch(t.label){case 0:return this.loading?[2]:[4,this.platformUtilsService.showDialog(this.i18nService.t("reinstateConfirmation"),this.i18nService.t("reinstateSubscription"),this.i18nService.t("yes"),this.i18nService.t("cancel"))];case 1:if(!t.sent())return[2];t.label=2;case 2:return t.trys.push([2,4,,5]),this.reinstatePromise=this.apiService.postOrganizationReinstate(this.organizationId),[4,this.reinstatePromise];case 3:return t.sent(),this.toasterService.popAsync("success",null,this.i18nService.t("reinstated")),this.load(),[3,5];case 4:return e=t.sent(),this.logService.error(e),[3,5];case 5:return[2]}}))}))},e.prototype.cancel=function(){return r(this,void 0,void 0,(function(){var e;return i(this,(function(t){switch(t.label){case 0:return this.loading?[2]:[4,this.platformUtilsService.showDialog(this.i18nService.t("cancelConfirmation"),this.i18nService.t("cancelSubscription"),this.i18nService.t("yes"),this.i18nService.t("no"),"warning")];case 1:if(!t.sent())return[2];t.label=2;case 2:return t.trys.push([2,4,,5]),this.cancelPromise=this.apiService.postOrganizationCancel(this.organizationId),[4,this.cancelPromise];case 3:return t.sent(),this.toasterService.popAsync("success",null,this.i18nService.t("canceledSubscription")),this.load(),[3,5];case 4:return e=t.sent(),this.logService.error(e),[3,5];case 5:return[2]}}))}))},e.prototype.changePlan=function(){return r(this,void 0,void 0,(function(){return i(this,(function(e){return this.showChangePlan=!this.showChangePlan,[2]}))}))},e.prototype.closeChangePlan=function(e){this.showChangePlan=!1},e.prototype.downloadLicense=function(){this.showDownloadLicense=!this.showDownloadLicense},e.prototype.closeDownloadLicense=function(){this.showDownloadLicense=!1},e.prototype.updateLicense=function(){this.loading||(this.showUpdateLicense=!0)},e.prototype.closeUpdateLicense=function(e){this.showUpdateLicense=!1,e&&(this.load(),this.messagingService.send("updatedOrgLicense"))},e.prototype.subscriptionAdjusted=function(){this.load()},e.prototype.adjustStorage=function(e){this.adjustStorageAdd=e,this.showAdjustStorage=!0},e.prototype.closeStorage=function(e){this.showAdjustStorage=!1,e&&this.load()},e.prototype.removeSponsorship=function(){return r(this,void 0,void 0,(function(){var e;return i(this,(function(t){switch(t.label){case 0:return[4,this.platformUtilsService.showDialog(this.i18nService.t("removeSponsorshipConfirmation"),this.i18nService.t("removeSponsorship"),this.i18nService.t("remove"),this.i18nService.t("cancel"),"warning")];case 1:if(!t.sent())return[2];t.label=2;case 2:return t.trys.push([2,5,,6]),this.removeSponsorshipPromise=this.apiService.deleteRemoveSponsorship(this.organizationId),[4,this.removeSponsorshipPromise];case 3:return t.sent(),this.toasterService.popAsync("success",null,this.i18nService.t("removeSponsorshipSuccess")),[4,this.load()];case 4:return t.sent(),[3,6];case 5:return e=t.sent(),this.logService.error(e),[3,6];case 6:return[2]}}))}))},Object.defineProperty(e.prototype,"isExpired",{get:function(){return null!=this.sub&&null!=this.sub.expiration&&new Date(this.sub.expiration)0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]

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

"+this.code+'

'+new Date+"

"),e.onafterprint=function(){return e.close()},e.print()},e.prototype.formatString=function(e){return null==e?null:e.replace(/(.{4})/g,"$1 ").trim().toUpperCase()},e.prototype.processResponse=function(e){this.code=this.formatString(e.code)},e.ɵfac=function(t){return new(t||e)(o.ɵɵdirectiveInject(a.I18nService))},e.ɵcmp=o.ɵɵdefineComponent({type:e,selectors:[["app-two-factor-recovery"]],decls:31,vars:11,consts:[["role","dialog","aria-modal","true","aria-labelledby","2faRecoveryTitle",1,"modal","fade"],["role","document",1,"modal-dialog"],[1,"modal-content"],[1,"modal-header"],["id","2faRecoveryTitle",1,"modal-title"],["type","button","data-dismiss","modal",1,"close",3,"appA11yTitle"],["aria-hidden","true"],[3,"organizationId","type","onAuthed",4,"ngIf"],[4,"ngIf"],[3,"organizationId","type","onAuthed"],[1,"modal-body","text-center"],[1,"modal-footer"],["type","button","class","btn btn-primary",3,"click",4,"ngIf"],["type","button","data-dismiss","modal",1,"btn","btn-outline-secondary"],[1,"text-lg"],["type","button",1,"btn","btn-primary",3,"click"]],template:function(e,t){1&e&&(o.ɵɵelementStart(0,"div",0),o.ɵɵtext(1," "),o.ɵɵelementStart(2,"div",1),o.ɵɵtext(3," "),o.ɵɵelementStart(4,"div",2),o.ɵɵtext(5," "),o.ɵɵelementStart(6,"div",3),o.ɵɵtext(7," "),o.ɵɵelementStart(8,"h2",4),o.ɵɵtext(9),o.ɵɵpipe(10,"i18n"),o.ɵɵelementStart(11,"small"),o.ɵɵtext(12),o.ɵɵpipe(13,"i18n"),o.ɵɵelementEnd(),o.ɵɵtext(14," "),o.ɵɵelementEnd(),o.ɵɵtext(15," "),o.ɵɵelementStart(16,"button",5),o.ɵɵpipe(17,"i18n"),o.ɵɵtext(18," "),o.ɵɵelementStart(19,"span",6),o.ɵɵtext(20,"×"),o.ɵɵelementEnd(),o.ɵɵtext(21," "),o.ɵɵelementEnd(),o.ɵɵtext(22," "),o.ɵɵelementEnd(),o.ɵɵtext(23," "),o.ɵɵtemplate(24,u,2,2,"app-two-factor-verify",7),o.ɵɵtext(25," "),o.ɵɵtemplate(26,h,18,6,"ng-container",8),o.ɵɵtext(27," "),o.ɵɵelementEnd(),o.ɵɵtext(28," "),o.ɵɵelementEnd(),o.ɵɵtext(29," "),o.ɵɵelementEnd(),o.ɵɵtext(30," ")),2&e&&(o.ɵɵadvance(9),o.ɵɵtextInterpolate1(" ",o.ɵɵpipeBind1(10,5,"twoStepLogin")," "),o.ɵɵadvance(3),o.ɵɵtextInterpolate(o.ɵɵpipeBind1(13,7,"recoveryCodeTitle")),o.ɵɵadvance(4),o.ɵɵpropertyInterpolate("appA11yTitle",o.ɵɵpipeBind1(17,9,"close")),o.ɵɵadvance(8),o.ɵɵproperty("ngIf",!t.authed),o.ɵɵadvance(2),o.ɵɵproperty("ngIf",t.authed))},directives:[s.A11yTitleDirective,l.NgIf,c.TwoFactorVerifyComponent],pipes:[p.I18nPipe],encapsulation:2}),e}();t.TwoFactorRecoveryComponent=v,("undefined"==typeof ngDevMode||ngDevMode)&&o.ɵsetClassMetadata(v,[{type:r.Component,args:[{selector:"app-two-factor-recovery",templateUrl:"two-factor-recovery.component.html"}]}],(function(){return[{type:a.I18nService}]}),null)},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]1&&n.configured)}}function U(e,t){1&e&&(m.ɵɵelementContainerStart(0),m.ɵɵtext(1," "),m.ɵɵelement(2,"i",38),m.ɵɵtext(3," "),m.ɵɵelementContainerEnd())}function V(e,t){1&e&&(m.ɵɵelementContainerStart(0),m.ɵɵtext(1," "),m.ɵɵelement(2,"i",38),m.ɵɵtext(3),m.ɵɵpipe(4,"i18n"),m.ɵɵelementContainerEnd()),2&e&&(m.ɵɵadvance(3),m.ɵɵtextInterpolate1(" ",m.ɵɵpipeBind1(4,1,"twoFactorU2fWaiting"),"... "))}function F(e,t){1&e&&(m.ɵɵelementContainerStart(0),m.ɵɵtext(1," "),m.ɵɵelement(2,"i",39),m.ɵɵtext(3),m.ɵɵpipe(4,"i18n"),m.ɵɵelementContainerEnd()),2&e&&(m.ɵɵadvance(3),m.ɵɵtextInterpolate1(" ",m.ɵɵpipeBind1(4,1,"twoFactorU2fClickSave")," "))}function N(e,t){1&e&&(m.ɵɵelementContainerStart(0),m.ɵɵtext(1," "),m.ɵɵelement(2,"i",40),m.ɵɵtext(3),m.ɵɵpipe(4,"i18n"),m.ɵɵelementContainerEnd()),2&e&&(m.ɵɵadvance(3),m.ɵɵtextInterpolate1(" ",m.ɵɵpipeBind1(4,1,"twoFactorU2fProblemReadingTryAgain")," "))}function z(e,t){if(1&e&&(m.ɵɵelementContainerStart(0),m.ɵɵtext(1," "),m.ɵɵtemplate(2,V,5,3,"ng-container",25),m.ɵɵtext(3," "),m.ɵɵtemplate(4,F,5,3,"ng-container",25),m.ɵɵtext(5," "),m.ɵɵtemplate(6,N,5,3,"ng-container",25),m.ɵɵtext(7," "),m.ɵɵelementContainerEnd()),2&e){var n=m.ɵɵnextContext(2);m.ɵɵadvance(2),m.ɵɵproperty("ngIf",n.webAuthnListening),m.ɵɵadvance(2),m.ɵɵproperty("ngIf",n.webAuthnResponse),m.ɵɵadvance(2),m.ɵɵproperty("ngIf",n.webAuthnError)}}function L(e,t){1&e&&(m.ɵɵelement(0,"i",41),m.ɵɵpipe(1,"i18n")),2&e&&m.ɵɵpropertyInterpolate("title",m.ɵɵpipeBind1(1,1,"loading"))}function K(e,t){1&e&&(m.ɵɵelementStart(0,"span"),m.ɵɵtext(1),m.ɵɵpipe(2,"i18n"),m.ɵɵelementEnd()),2&e&&(m.ɵɵadvance(1),m.ɵɵtextInterpolate(m.ɵɵpipeBind1(2,1,"save")))}function q(e,t){if(1&e){var n=m.ɵɵgetCurrentView();m.ɵɵelementStart(0,"button",42,43),m.ɵɵlistener("click",(function(){return m.ɵɵrestoreView(n),m.ɵɵnextContext(2).disable()})),m.ɵɵtext(2," "),m.ɵɵelement(3,"i",41),m.ɵɵpipe(4,"i18n"),m.ɵɵtext(5," "),m.ɵɵelementStart(6,"span"),m.ɵɵtext(7),m.ɵɵpipe(8,"i18n"),m.ɵɵelementEnd(),m.ɵɵtext(9," "),m.ɵɵelementEnd()}if(2&e){var r=m.ɵɵreference(1),i=m.ɵɵnextContext(2);m.ɵɵproperty("appApiAction",i.disablePromise)("disabled",r.loading),m.ɵɵadvance(3),m.ɵɵpropertyInterpolate("title",m.ɵɵpipeBind1(4,4,"loading")),m.ɵɵadvance(4),m.ɵɵtextInterpolate(m.ɵɵpipeBind1(8,6,"disableAllKeys"))}}function G(e,t){if(1&e){var n=m.ɵɵgetCurrentView();m.ɵɵelementStart(0,"form",10,11),m.ɵɵlistener("ngSubmit",(function(){return m.ɵɵrestoreView(n),m.ɵɵnextContext().submit()})),m.ɵɵtext(2," "),m.ɵɵelementStart(3,"div",12),m.ɵɵtext(4," "),m.ɵɵtemplate(5,_,4,6,"app-callout",13),m.ɵɵtext(6," "),m.ɵɵelementStart(7,"app-callout",14),m.ɵɵtext(8," "),m.ɵɵelementStart(9,"p"),m.ɵɵtext(10),m.ɵɵpipe(11,"i18n"),m.ɵɵelementEnd(),m.ɵɵtext(12," "),m.ɵɵelementStart(13,"ul",15),m.ɵɵtext(14," "),m.ɵɵelementStart(15,"li"),m.ɵɵtext(16),m.ɵɵpipe(17,"i18n"),m.ɵɵelementEnd(),m.ɵɵtext(18," "),m.ɵɵelementEnd(),m.ɵɵtext(19," "),m.ɵɵelementEnd(),m.ɵɵtext(20," "),m.ɵɵelement(21,"img",16),m.ɵɵtext(22," "),m.ɵɵelementStart(23,"ul",17),m.ɵɵtext(24," "),m.ɵɵtemplate(25,j,13,5,"li",18),m.ɵɵtext(26," "),m.ɵɵelementEnd(),m.ɵɵtext(27," "),m.ɵɵelement(28,"hr"),m.ɵɵtext(29," "),m.ɵɵelementStart(30,"p"),m.ɵɵtext(31),m.ɵɵpipe(32,"i18n"),m.ɵɵelementEnd(),m.ɵɵtext(33," "),m.ɵɵelementStart(34,"ol"),m.ɵɵtext(35," "),m.ɵɵelementStart(36,"li"),m.ɵɵtext(37),m.ɵɵpipe(38,"i18n"),m.ɵɵelementEnd(),m.ɵɵtext(39," "),m.ɵɵelementStart(40,"li"),m.ɵɵtext(41),m.ɵɵpipe(42,"i18n"),m.ɵɵelementEnd(),m.ɵɵtext(43," "),m.ɵɵelementStart(44,"li"),m.ɵɵtext(45),m.ɵɵpipe(46,"i18n"),m.ɵɵelementEnd(),m.ɵɵtext(47," "),m.ɵɵelementStart(48,"li"),m.ɵɵtext(49),m.ɵɵpipe(50,"i18n"),m.ɵɵelementEnd(),m.ɵɵtext(51," "),m.ɵɵelementEnd(),m.ɵɵtext(52," "),m.ɵɵelementStart(53,"div",19),m.ɵɵtext(54," "),m.ɵɵelementStart(55,"div",20),m.ɵɵtext(56," "),m.ɵɵelementStart(57,"label",21),m.ɵɵtext(58),m.ɵɵpipe(59,"i18n"),m.ɵɵelementEnd(),m.ɵɵtext(60," "),m.ɵɵelementStart(61,"input",22),m.ɵɵlistener("ngModelChange",(function(e){return m.ɵɵrestoreView(n),m.ɵɵnextContext().name=e})),m.ɵɵelementEnd(),m.ɵɵtext(62," "),m.ɵɵelementEnd(),m.ɵɵtext(63," "),m.ɵɵelementEnd(),m.ɵɵtext(64," "),m.ɵɵelementStart(65,"button",23,24),m.ɵɵlistener("click",(function(){return m.ɵɵrestoreView(n),m.ɵɵnextContext().readKey()})),m.ɵɵtext(67),m.ɵɵpipe(68,"i18n"),m.ɵɵelementEnd(),m.ɵɵtext(69," "),m.ɵɵtemplate(70,U,4,0,"ng-container",25),m.ɵɵtext(71," "),m.ɵɵtemplate(72,z,8,3,"ng-container",25),m.ɵɵtext(73," "),m.ɵɵelementEnd(),m.ɵɵtext(74," "),m.ɵɵelementStart(75,"div",26),m.ɵɵtext(76," "),m.ɵɵelementStart(77,"button",27),m.ɵɵtext(78," "),m.ɵɵtemplate(79,L,2,3,"i",28),m.ɵɵtext(80," "),m.ɵɵtemplate(81,K,3,3,"span",25),m.ɵɵtext(82," "),m.ɵɵelementEnd(),m.ɵɵtext(83," "),m.ɵɵtemplate(84,q,10,8,"button",29),m.ɵɵtext(85," "),m.ɵɵelementStart(86,"button",30),m.ɵɵtext(87),m.ɵɵpipe(88,"i18n"),m.ɵɵelementEnd(),m.ɵɵtext(89," "),m.ɵɵelementEnd(),m.ɵɵtext(90," "),m.ɵɵelementEnd()}if(2&e){var r=m.ɵɵreference(1),i=m.ɵɵreference(66),o=m.ɵɵnextContext();m.ɵɵproperty("appApiAction",o.formPromise),m.ɵɵadvance(5),m.ɵɵproperty("ngIf",o.enabled),m.ɵɵadvance(5),m.ɵɵtextInterpolate(m.ɵɵpipeBind1(11,23,"twoFactorWebAuthnWarning")),m.ɵɵadvance(6),m.ɵɵtextInterpolate(m.ɵɵpipeBind1(17,25,"twoFactorWebAuthnSupportWeb")),m.ɵɵadvance(9),m.ɵɵproperty("ngForOf",o.keys),m.ɵɵadvance(6),m.ɵɵtextInterpolate1("",m.ɵɵpipeBind1(32,27,"twoFactorWebAuthnAdd"),":"),m.ɵɵadvance(6),m.ɵɵtextInterpolate(m.ɵɵpipeBind1(38,29,"twoFactorU2fGiveName")),m.ɵɵadvance(4),m.ɵɵtextInterpolate(m.ɵɵpipeBind1(42,31,"twoFactorU2fPlugInReadKey")),m.ɵɵadvance(4),m.ɵɵtextInterpolate(m.ɵɵpipeBind1(46,33,"twoFactorU2fTouchButton")),m.ɵɵadvance(4),m.ɵɵtextInterpolate(m.ɵɵpipeBind1(50,35,"twoFactorU2fSaveForm")),m.ɵɵadvance(9),m.ɵɵtextInterpolate(m.ɵɵpipeBind1(59,37,"name")),m.ɵɵadvance(3),m.ɵɵproperty("ngModel",o.name)("disabled",!o.keyIdAvailable),m.ɵɵadvance(4),m.ɵɵproperty("disabled",i.loading||o.webAuthnListening||!o.keyIdAvailable)("appApiAction",o.challengePromise),m.ɵɵadvance(2),m.ɵɵtextInterpolate1(" ",m.ɵɵpipeBind1(68,39,"readKey")," "),m.ɵɵadvance(3),m.ɵɵproperty("ngIf",i.loading),m.ɵɵadvance(2),m.ɵɵproperty("ngIf",!i.loading),m.ɵɵadvance(5),m.ɵɵproperty("disabled",r.loading||!o.webAuthnResponse),m.ɵɵadvance(2),m.ɵɵproperty("ngIf",r.loading),m.ɵɵadvance(2),m.ɵɵproperty("ngIf",!r.loading),m.ɵɵadvance(3),m.ɵɵproperty("ngIf",o.enabled),m.ɵɵadvance(3),m.ɵɵtextInterpolate(m.ɵɵpipeBind1(88,41,"close"))}}var W=function(e){function t(t,n,r,i,o,a,s){var c=e.call(this,t,n,r,i,a,s)||this;return c.ngZone=o,c.type=l.TwoFactorProviderType.WebAuthn,c.keyIdAvailable=null,c.keysConfiguredCount=0,c}return i(t,e),t.prototype.auth=function(t){e.prototype.auth.call(this,t),this.processResponse(t.response)},t.prototype.submit=function(){return o(this,void 0,void 0,(function(){var t,n=this;return a(this,(function(r){switch(r.label){case 0:return null==this.webAuthnResponse||null==this.keyIdAvailable?[2,Promise.reject()]:[4,this.buildRequestModel(u.UpdateTwoFactorWebAuthnRequest)];case 1:return(t=r.sent()).deviceResponse=this.webAuthnResponse,t.id=this.keyIdAvailable,t.name=this.name,[2,e.prototype.enable.call(this,(function(){return o(n,void 0,void 0,(function(){var e;return a(this,(function(n){switch(n.label){case 0:return this.formPromise=this.apiService.putTwoFactorWebAuthn(t),[4,this.formPromise];case 1:return e=n.sent(),[4,this.processResponse(e)];case 2:return n.sent(),[2]}}))}))}))]}}))}))},t.prototype.disable=function(){return e.prototype.disable.call(this,this.formPromise)},t.prototype.remove=function(e){return o(this,void 0,void 0,(function(){var t,n,r,i;return a(this,(function(o){switch(o.label){case 0:return this.keysConfiguredCount<=1||null!=e.removePromise?[2]:(t=null!=e.name?e.name:this.i18nService.t("webAuthnkeyX",e.id),[4,this.platformUtilsService.showDialog(this.i18nService.t("removeU2fConfirmation"),t,this.i18nService.t("yes"),this.i18nService.t("no"),"warning")]);case 1:return o.sent()?[4,this.buildRequestModel(p.UpdateTwoFactorWebAuthnDeleteRequest)]:[2];case 2:(n=o.sent()).id=e.id,o.label=3;case 3:return o.trys.push([3,6,,7]),e.removePromise=this.apiService.deleteTwoFactorWebAuthn(n),[4,e.removePromise];case 4:return r=o.sent(),e.removePromise=null,[4,this.processResponse(r)];case 5:return o.sent(),[3,7];case 6:return i=o.sent(),this.logService.error(i),[3,7];case 7:return[2]}}))}))},t.prototype.readKey=function(){return o(this,void 0,void 0,(function(){var e,t,n;return a(this,(function(r){switch(r.label){case 0:return null==this.keyIdAvailable?[2]:[4,this.buildRequestModel(c.SecretVerificationRequest)];case 1:e=r.sent(),r.label=2;case 2:return r.trys.push([2,4,,5]),this.challengePromise=this.apiService.getTwoFactorWebAuthnChallenge(e),[4,this.challengePromise];case 3:return t=r.sent(),this.readDevice(t),[3,5];case 4:return n=r.sent(),this.logService.error(n),[3,5];case 5:return[2]}}))}))},t.prototype.readDevice=function(e){var t=this;console.log("listening for key..."),this.resetWebAuthn(!0),navigator.credentials.create({publicKey:e}).then((function(e){t.ngZone.run((function(){t.webAuthnListening=!1,t.webAuthnResponse=e}))})).catch((function(e){console.error(e),t.resetWebAuthn(!1),t.webAuthnError=!0}))},t.prototype.resetWebAuthn=function(e){void 0===e&&(e=!1),this.webAuthnResponse=null,this.webAuthnError=!1,this.webAuthnListening=e},t.prototype.processResponse=function(e){this.resetWebAuthn(),this.keys=[],this.keyIdAvailable=null,this.name=null,this.keysConfiguredCount=0;for(var t=function(t){if(null!=e.keys){var r=e.keys.filter((function(e){return e.id===t}));if(r.length>0)return n.keysConfiguredCount++,n.keys.push({id:t,name:r[0].name,configured:!0,migrated:r[0].migrated,removePromise:null}),"continue"}n.keys.push({id:t,name:null,configured:!1,removePromise:null}),null==n.keyIdAvailable&&(n.keyIdAvailable=t)},n=this,r=1;r<=5;r++)t(r);this.enabled=e.enabled},t.ɵfac=function(e){return new(e||t)(m.ɵɵdirectiveInject(f.ApiService),m.ɵɵdirectiveInject(h.I18nService),m.ɵɵdirectiveInject(v.ToasterService),m.ɵɵdirectiveInject(y.PlatformUtilsService),m.ɵɵdirectiveInject(m.NgZone),m.ɵɵdirectiveInject(g.LogService),m.ɵɵdirectiveInject(x.UserVerificationService))},t.ɵcmp=m.ɵɵdefineComponent({type:t,selectors:[["app-two-factor-webauthn"]],features:[m.ɵɵInheritDefinitionFeature],decls:31,vars:11,consts:[["role","dialog","aria-modal","true","aria-labelledby","2faU2fTitle",1,"modal","fade"],["role","document",1,"modal-dialog","modal-lg"],[1,"modal-content"],[1,"modal-header"],["id","2faU2fTitle",1,"modal-title"],["type","button","data-dismiss","modal",1,"close",3,"appA11yTitle"],["aria-hidden","true"],[3,"organizationId","type","onAuthed",4,"ngIf"],["ngNativeValidate","",3,"appApiAction","ngSubmit",4,"ngIf"],[3,"organizationId","type","onAuthed"],["ngNativeValidate","",3,"appApiAction","ngSubmit"],["form",""],[1,"modal-body"],["type","success","icon","fa-check-circle",3,"title",4,"ngIf"],["type","warning"],[1,"mb-0"],["alt","FIDO2 WebAuthn logo'",1,"float-right","ml-5","mfaType7"],[1,"fa-ul"],[3,"appApiAction",4,"ngFor","ngForOf"],[1,"row"],[1,"form-group","col-6"],["for","name"],["id","name","type","text","name","Name",1,"form-control",3,"ngModel","disabled","ngModelChange"],["type","button",1,"btn","btn-outline-secondary","mr-2",3,"disabled","appApiAction","click"],["readKeyBtn",""],[4,"ngIf"],[1,"modal-footer"],["type","submit",1,"btn","btn-primary",3,"disabled"],["class","fa fa-spinner fa-spin","aria-hidden","true",3,"title",4,"ngIf"],["type","button","class","btn btn-outline-secondary btn-submit",3,"appApiAction","disabled","click",4,"ngIf"],["type","button","data-dismiss","modal",1,"btn","btn-outline-secondary"],["type","success","icon","fa-check-circle",3,"title"],[3,"appApiAction"],["removeKeyBtn",""],[1,"fa-li","fa","fa-key"],["class","fa fa-spin fa-spinner text-muted fa-fw","aria-hidden","true",3,"title",4,"ngIf"],["href","#","appStopClick","",3,"click"],["aria-hidden","true",1,"fa","fa-spin","fa-spinner","text-muted","fa-fw",3,"title"],["aria-hidden","true",1,"fa","fa-spinner","fa-spin","text-muted"],["aria-hidden","true",1,"fa","fa-check-circle","text-success"],["aria-hidden","true",1,"fa","fa-warning","text-danger"],["aria-hidden","true",1,"fa","fa-spinner","fa-spin",3,"title"],["type","button",1,"btn","btn-outline-secondary","btn-submit",3,"appApiAction","disabled","click"],["disableBtn",""]],template:function(e,t){1&e&&(m.ɵɵelementStart(0,"div",0),m.ɵɵtext(1," "),m.ɵɵelementStart(2,"div",1),m.ɵɵtext(3," "),m.ɵɵelementStart(4,"div",2),m.ɵɵtext(5," "),m.ɵɵelementStart(6,"div",3),m.ɵɵtext(7," "),m.ɵɵelementStart(8,"h2",4),m.ɵɵtext(9),m.ɵɵpipe(10,"i18n"),m.ɵɵelementStart(11,"small"),m.ɵɵtext(12),m.ɵɵpipe(13,"i18n"),m.ɵɵelementEnd(),m.ɵɵtext(14," "),m.ɵɵelementEnd(),m.ɵɵtext(15," "),m.ɵɵelementStart(16,"button",5),m.ɵɵpipe(17,"i18n"),m.ɵɵtext(18," "),m.ɵɵelementStart(19,"span",6),m.ɵɵtext(20,"×"),m.ɵɵelementEnd(),m.ɵɵtext(21," "),m.ɵɵelementEnd(),m.ɵɵtext(22," "),m.ɵɵelementEnd(),m.ɵɵtext(23," "),m.ɵɵtemplate(24,O,2,2,"app-two-factor-verify",7),m.ɵɵtext(25," "),m.ɵɵtemplate(26,G,91,43,"form",8),m.ɵɵtext(27," "),m.ɵɵelementEnd(),m.ɵɵtext(28," "),m.ɵɵelementEnd(),m.ɵɵtext(29," "),m.ɵɵelementEnd(),m.ɵɵtext(30," ")),2&e&&(m.ɵɵadvance(9),m.ɵɵtextInterpolate1(" ",m.ɵɵpipeBind1(10,5,"twoStepLogin")," "),m.ɵɵadvance(3),m.ɵɵtextInterpolate(m.ɵɵpipeBind1(13,7,"webAuthnTitle")),m.ɵɵadvance(4),m.ɵɵpropertyInterpolate("appA11yTitle",m.ɵɵpipeBind1(17,9,"close")),m.ɵɵadvance(8),m.ɵɵproperty("ngIf",!t.authed),m.ɵɵadvance(2),m.ɵɵproperty("ngIf",t.authed))},directives:[S.A11yTitleDirective,b.NgIf,w.TwoFactorVerifyComponent,C.NgControlStatusGroup,C.NgForm,I.ApiActionDirective,E.CalloutComponent,b.NgForOf,C.DefaultValueAccessor,C.NgControlStatus,C.NgModel,P.StopClickDirective],pipes:[k.I18nPipe],encapsulation:2}),t}(d.TwoFactorBaseComponent);t.TwoFactorWebAuthnComponent=W,("undefined"==typeof ngDevMode||ngDevMode)&&m.ɵsetClassMetadata(W,[{type:s.Component,args:[{selector:"app-two-factor-webauthn",templateUrl:"two-factor-webauthn.component.html"}]}],(function(){return[{type:f.ApiService},{type:h.I18nService},{type:v.ToasterService},{type:y.PlatformUtilsService},{type:m.NgZone},{type:g.LogService},{type:x.UserVerificationService}]}),null)},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0?this.keys[0].key:null,t.key2=null!=this.keys&&this.keys.length>1?this.keys[1].key:null,t.key3=null!=this.keys&&this.keys.length>2?this.keys[2].key:null,t.key4=null!=this.keys&&this.keys.length>3?this.keys[3].key:null,t.key5=null!=this.keys&&this.keys.length>4?this.keys[4].key:null,t.nfc=this.nfc,[2,e.prototype.enable.call(this,(function(){return o(n,void 0,void 0,(function(){var e;return a(this,(function(n){switch(n.label){case 0:return this.formPromise=this.apiService.putTwoFactorYubiKey(t),[4,this.formPromise];case 1:return e=n.sent(),[4,this.processResponse(e)];case 2:return n.sent(),this.toasterService.popAsync("success",null,this.i18nService.t("yubikeysUpdated")),[2]}}))}))}))]}}))}))},t.prototype.disable=function(){return e.prototype.disable.call(this,this.disablePromise)},t.prototype.remove=function(e){e.existingKey=null,e.key=null},t.prototype.processResponse=function(e){this.enabled=e.enabled,this.keys=[{key:e.key1,existingKey:this.padRight(e.key1)},{key:e.key2,existingKey:this.padRight(e.key2)},{key:e.key3,existingKey:this.padRight(e.key3)},{key:e.key4,existingKey:this.padRight(e.key4)},{key:e.key5,existingKey:this.padRight(e.key5)}],this.nfc=e.nfc||!e.enabled},t.prototype.padRight=function(e,t,n){if(void 0===t&&(t="•"),void 0===n&&(n=44),null==e||null==t||e.length>=n)return e;for(var r=(n-e.length)/t.length,i=0;i0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]524288e3)return this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("maxFileSize")),[2];i.label=1;case 1:return i.trys.push([1,4,,5]),this.formPromise=this.saveCipherAttachment(t[0]),n=this,[4,this.formPromise];case 2:return n.cipherDomain=i.sent(),r=this,[4,this.cipherDomain.decrypt()];case 3:return r.cipher=i.sent(),this.platformUtilsService.showToast("success",null,this.i18nService.t("attachmentSaved")),this.onUploadedAttachment.emit(),[3,5];case 4:return o=i.sent(),this.logService.error(o),[3,5];case 5:return e.type="",e.type="file",e.value="",[2]}}))}))},e.prototype.delete=function(e){return r(this,void 0,void 0,(function(){var t,n;return i(this,(function(r){switch(r.label){case 0:return null!=this.deletePromises[e.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(!r.sent())return[2];r.label=2;case 2:return r.trys.push([2,4,,5]),this.deletePromises[e.id]=this.deleteCipherAttachment(e.id),[4,this.deletePromises[e.id]];case 3:return r.sent(),this.platformUtilsService.showToast("success",null,this.i18nService.t("deletedAttachment")),(t=this.cipher.attachments.indexOf(e))>-1&&this.cipher.attachments.splice(t,1),[3,5];case 4:return n=r.sent(),this.logService.error(n),[3,5];case 5:return this.deletePromises[e.id]=null,this.onDeletedAttachment.emit(),[2]}}))}))},e.prototype.download=function(e){return r(this,void 0,void 0,(function(){var t,n,r,o,s,l,c,p,u;return i(this,(function(i){switch(i.label){case 0:if((t=e).downloading)return[2];if(!this.canAccessAttachments)return this.platformUtilsService.showToast("error",this.i18nService.t("premiumRequired"),this.i18nService.t("premiumRequiredDesc")),[2];i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this.apiService.getAttachmentData(this.cipher.id,e.id,this.emergencyAccessId)];case 2:return r=i.sent(),n=r.url,[3,4];case 3:if(!((o=i.sent())instanceof a.ErrorResponse&&404===o.statusCode))throw o instanceof a.ErrorResponse?new Error(o.getSingleMessage()):o;return n=e.url,[3,4];case 4:return t.downloading=!0,[4,fetch(new Request(n,{cache:"no-store"}))];case 5:if(200!==(s=i.sent()).status)return this.platformUtilsService.showToast("error",null,this.i18nService.t("errorOccurred")),t.downloading=!1,[2];i.label=6;case 6:return i.trys.push([6,12,,13]),[4,s.arrayBuffer()];case 7:return l=i.sent(),null==e.key?[3,8]:(p=e.key,[3,10]);case 8:return[4,this.cryptoService.getOrgKey(this.cipher.organizationId)];case 9:p=i.sent(),i.label=10;case 10:return c=p,[4,this.cryptoService.decryptFromBytes(l,c)];case 11:return u=i.sent(),this.platformUtilsService.saveFile(this.win,u,null,e.fileName),[3,13];case 12:return i.sent(),this.platformUtilsService.showToast("error",null,this.i18nService.t("errorOccurred")),[3,13];case 13:return t.downloading=!1,[2]}}))}))},e.prototype.init=function(){return r(this,void 0,void 0,(function(){var e,t,n,r;return i(this,(function(i){switch(i.label){case 0:return e=this,[4,this.loadCipher()];case 1:return e.cipherDomain=i.sent(),t=this,[4,this.cipherDomain.decrypt()];case 2:return t.cipher=i.sent(),n=this,[4,this.cryptoService.hasEncKey()];case 3:return n.hasUpdatedKey=i.sent(),[4,this.userService.canAccessPremium()];case 4:return r=i.sent(),this.canAccessAttachments=r||null!=this.cipher.organizationId,this.canAccessAttachments?[3,6]:[4,this.platformUtilsService.showDialog(this.i18nService.t("premiumRequiredDesc"),this.i18nService.t("premiumRequired"),this.i18nService.t("learnMore"),this.i18nService.t("cancel"))];case 5:return i.sent()&&this.platformUtilsService.launchUri("https://vault.bitwarden.com/#/?premium=purchase"),[3,8];case 6:return this.hasUpdatedKey?[3,8]:[4,this.platformUtilsService.showDialog(this.i18nService.t("updateKey"),this.i18nService.t("featureUnavailable"),this.i18nService.t("learnMore"),this.i18nService.t("cancel"),"warning")];case 7:i.sent()&&this.platformUtilsService.launchUri("https://help.bitwarden.com/article/update-encryption-key/"),i.label=8;case 8:return[2]}}))}))},e.prototype.reuploadCipherAttachment=function(e,t){return r(this,void 0,void 0,(function(){var n,o,a=this;return i(this,(function(s){switch(s.label){case 0:if(n=e,null!=e.key||n.downloading||null!=this.reuploadPromises[e.id])return[2];s.label=1;case 1:return s.trys.push([1,3,,4]),this.reuploadPromises[e.id]=Promise.resolve().then((function(){return r(a,void 0,void 0,(function(){var r,o,a,s,l,c,p,u,d;return i(this,(function(i){switch(i.label){case 0:return n.downloading=!0,[4,fetch(new Request(e.url,{cache:"no-store"}))];case 1:if(200!==(r=i.sent()).status)return this.platformUtilsService.showToast("error",null,this.i18nService.t("errorOccurred")),n.downloading=!1,[2];i.label=2;case 2:return i.trys.push([2,11,,12]),[4,r.arrayBuffer()];case 3:return o=i.sent(),null==e.key?[3,4]:(s=e.key,[3,6]);case 4:return[4,this.cryptoService.getOrgKey(this.cipher.organizationId)];case 5:s=i.sent(),i.label=6;case 6:return a=s,[4,this.cryptoService.decryptFromBytes(o,a)];case 7:return l=i.sent(),c=this,[4,this.cipherService.saveAttachmentRawWithServer(this.cipherDomain,e.fileName,l,t)];case 8:return c.cipherDomain=i.sent(),p=this,[4,this.cipherDomain.decrypt()];case 9:return p.cipher=i.sent(),this.deletePromises[e.id]=this.deleteCipherAttachment(e.id),[4,this.deletePromises[e.id]];case 10:return i.sent(),(u=this.cipher.attachments.filter((function(t){return t.id===e.id}))).length>0&&(d=this.cipher.attachments.indexOf(u[0]))>-1&&this.cipher.attachments.splice(d,1),this.platformUtilsService.showToast("success",null,this.i18nService.t("attachmentSaved")),this.onReuploadedAttachment.emit(),[3,12];case 11:return i.sent(),this.platformUtilsService.showToast("error",null,this.i18nService.t("errorOccurred")),[3,12];case 12:return n.downloading=!1,[2]}}))}))})),[4,this.reuploadPromises[e.id]];case 2:return s.sent(),[3,4];case 3:return o=s.sent(),this.logService.error(o),[3,4];case 4:return[2]}}))}))},e.prototype.loadCipher=function(){return this.cipherService.get(this.cipherId)},e.prototype.saveCipherAttachment=function(e){return this.cipherService.saveAttachmentWithServer(this.cipherDomain,e)},e.prototype.deleteCipherAttachment=function(e){return this.cipherService.deleteAttachmentWithServer(this.cipher.id,e)},e.ɵfac=function(t){return new(t||e)(s.ɵɵdirectiveInject(l.CipherService),s.ɵɵdirectiveInject(c.I18nService),s.ɵɵdirectiveInject(p.CryptoService),s.ɵɵdirectiveInject(u.UserService),s.ɵɵdirectiveInject(d.PlatformUtilsService),s.ɵɵdirectiveInject(m.ApiService),s.ɵɵdirectiveInject(Window),s.ɵɵdirectiveInject(f.LogService))},e.ɵdir=s.ɵɵdefineDirective({type:e,inputs:{cipherId:"cipherId"},outputs:{onUploadedAttachment:"onUploadedAttachment",onDeletedAttachment:"onDeletedAttachment",onReuploadedAttachment:"onReuploadedAttachment"}}),e}();t.AttachmentsComponent=h,("undefined"==typeof ngDevMode||ngDevMode)&&s.ɵsetClassMetadata(h,[{type:o.Directive}],(function(){return[{type:l.CipherService},{type:c.I18nService},{type:p.CryptoService},{type:u.UserService},{type:d.PlatformUtilsService},{type:m.ApiService},{type:Window},{type:f.LogService}]}),{cipherId:[{type:o.Input}],onUploadedAttachment:[{type:o.Output}],onDeletedAttachment:[{type:o.Output}],onReuploadedAttachment:[{type:o.Output}]})},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&this.viewEvents(n[0]),[2]}}))}))})),[2]}}))}))}))},e.prototype.ngOnDestroy=function(){this.broadcasterService.unsubscribe(N)},e.prototype.clearGroupingFilters=function(){return r(this,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return this.ciphersComponent.showAddNew=!0,this.ciphersComponent.deleted=!1,this.groupingsComponent.searchPlaceholder=this.i18nService.t("searchVault"),[4,this.ciphersComponent.applyFilter()];case 1:return e.sent(),this.clearFilters(),this.go(),[2]}}))}))},e.prototype.filterCipherType=function(e,t){return void 0===t&&(t=!1),r(this,void 0,void 0,(function(){var n;return i(this,(function(r){switch(r.label){case 0:return this.ciphersComponent.showAddNew=!0,this.ciphersComponent.deleted=!1,this.groupingsComponent.searchPlaceholder=this.i18nService.t("searchType"),n=function(t){return t.type===e},t?[4,this.ciphersComponent.reload(n)]:[3,2];case 1:return r.sent(),[3,4];case 2:return[4,this.ciphersComponent.applyFilter(n)];case 3:r.sent(),r.label=4;case 4:return this.clearFilters(),this.type=e,this.go(),[2]}}))}))},e.prototype.filterCollection=function(e,t){return void 0===t&&(t=!1),r(this,void 0,void 0,(function(){var n;return i(this,(function(r){switch(r.label){case 0:return this.ciphersComponent.showAddNew=!0,this.ciphersComponent.deleted=!1,this.groupingsComponent.searchPlaceholder=this.i18nService.t("searchCollection"),n=function(t){return"unassigned"===e?null==t.collectionIds||0===t.collectionIds.length:null!=t.collectionIds&&t.collectionIds.indexOf(e)>-1},t?[4,this.ciphersComponent.reload(n)]:[3,2];case 1:return r.sent(),[3,4];case 2:return[4,this.ciphersComponent.applyFilter(n)];case 3:r.sent(),r.label=4;case 4:return this.clearFilters(),this.collectionId=e,this.go(),[2]}}))}))},e.prototype.filterDeleted=function(e){return void 0===e&&(e=!1),r(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return this.ciphersComponent.showAddNew=!1,this.ciphersComponent.deleted=!0,this.groupingsComponent.searchPlaceholder=this.i18nService.t("searchTrash"),e?[4,this.ciphersComponent.reload(null,!0)]:[3,2];case 1:return t.sent(),[3,4];case 2:return[4,this.ciphersComponent.applyFilter(null)];case 3:t.sent(),t.label=4;case 4:return this.clearFilters(),this.deleted=!0,this.go(),[2]}}))}))},e.prototype.filterSearchText=function(e){this.ciphersComponent.searchText=e,this.ciphersComponent.search(200)},e.prototype.editCipherAttachments=function(e){return r(this,void 0,void 0,(function(){var t,n=this;return i(this,(function(o){switch(o.label){case 0:return null==this.organization.maxStorageGb||0===this.organization.maxStorageGb?(this.messagingService.send("upgradeOrganization",{organizationId:e.organizationId}),[2]):(t=!1,[4,this.modalService.openViewRef(c.AttachmentsComponent,this.attachmentsModalRef,(function(r){r.organization=n.organization,r.cipherId=e.id,r.onUploadedAttachment.subscribe((function(){return t=!0})),r.onDeletedAttachment.subscribe((function(){return t=!0}))}))]);case 1:return o.sent()[0].onClosed.subscribe((function(){return r(n,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return t?[4,this.ciphersComponent.refresh()]:[3,2];case 1:e.sent(),e.label=2;case 2:return t=!1,[2]}}))}))})),[2]}}))}))},e.prototype.editCipherCollections=function(e){return r(this,void 0,void 0,(function(){var t,n=this;return i(this,(function(o){switch(o.label){case 0:return[4,this.modalService.openViewRef(u.CollectionsComponent,this.collectionsModalRef,(function(o){n.organization.canEditAnyCollection&&(o.collectionIds=e.collectionIds,o.collections=n.groupingsComponent.collections.filter((function(e){return!e.readOnly}))),o.organization=n.organization,o.cipherId=e.id,o.onSavedCollections.subscribe((function(){return r(n,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return t.close(),[4,this.ciphersComponent.refresh()];case 1:return e.sent(),[2]}}))}))}))}))];case 1:return t=o.sent()[0],[2]}}))}))},e.prototype.addCipher=function(){return r(this,void 0,void 0,(function(){var e;return i(this,(function(t){switch(t.label){case 0:return[4,this.editCipher(null)];case 1:return(e=t.sent()).organizationId=this.organization.id,e.type=this.type,this.organization.canEditAnyCollection&&(e.collections=this.groupingsComponent.collections.filter((function(e){return!e.readOnly}))),null!=this.collectionId&&(e.collectionIds=[this.collectionId]),[2]}}))}))},e.prototype.editCipher=function(e){return r(this,void 0,void 0,(function(){var t,n,o=this;return i(this,(function(a){switch(a.label){case 0:return[4,this.modalService.openViewRef(l.AddEditComponent,this.cipherAddEditModalRef,(function(t){t.organization=o.organization,t.cipherId=null==e?null:e.id,t.onSavedCipher.subscribe((function(e){return r(o,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return n.close(),[4,this.ciphersComponent.refresh()];case 1:return e.sent(),[2]}}))}))})),t.onDeletedCipher.subscribe((function(e){return r(o,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return n.close(),[4,this.ciphersComponent.refresh()];case 1:return e.sent(),[2]}}))}))})),t.onRestoredCipher.subscribe((function(e){return r(o,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return n.close(),[4,this.ciphersComponent.refresh()];case 1:return e.sent(),[2]}}))}))}))}))];case 1:return t=a.sent(),n=t[0],[2,t[1]]}}))}))},e.prototype.cloneCipher=function(e){return r(this,void 0,void 0,(function(){var t;return i(this,(function(n){switch(n.label){case 0:return[4,this.editCipher(e)];case 1:return(t=n.sent()).cloneMode=!0,t.organizationId=this.organization.id,this.organization.canEditAnyCollection&&(t.collections=this.groupingsComponent.collections.filter((function(e){return!e.readOnly}))),t.collectionIds=e.collectionIds,[2]}}))}))},e.prototype.viewEvents=function(e){return r(this,void 0,void 0,(function(){var t=this;return i(this,(function(n){switch(n.label){case 0:return[4,this.modalService.openViewRef(s.EntityEventsComponent,this.eventsModalRef,(function(n){n.name=e.name,n.organizationId=t.organization.id,n.entityId=e.id,n.showUser=!0,n.entity="cipher"}))];case 1:return n.sent(),[2]}}))}))},e.prototype.clearFilters=function(){this.collectionId=null,this.type=null,this.deleted=!1},e.prototype.go=function(e){void 0===e&&(e=null),null==e&&(e={type:this.type,collectionId:this.collectionId,deleted:!!this.deleted||null}),this.router.navigate([],{relativeTo:this.route,queryParams:e,replaceUrl:!0})},e.ɵfac=function(t){return new(t||e)(m.ɵɵdirectiveInject(f.ActivatedRoute),m.ɵɵdirectiveInject(h.UserService),m.ɵɵdirectiveInject(f.Router),m.ɵɵdirectiveInject(m.ChangeDetectorRef),m.ɵɵdirectiveInject(v.SyncService),m.ɵɵdirectiveInject(y.I18nService),m.ɵɵdirectiveInject(g.ModalService),m.ɵɵdirectiveInject(x.MessagingService),m.ɵɵdirectiveInject(S.BroadcasterService),m.ɵɵdirectiveInject(m.NgZone),m.ɵɵdirectiveInject(b.PlatformUtilsService))},e.ɵcmp=m.ɵɵdefineComponent({type:e,selectors:[["app-org-vault"]],viewQuery:function(e,t){if(1&e&&(m.ɵɵviewQuery(d.GroupingsComponent,3),m.ɵɵviewQuery(p.CiphersComponent,3),m.ɵɵviewQuery(_,3,o.ViewContainerRef),m.ɵɵviewQuery(A,3,o.ViewContainerRef),m.ɵɵviewQuery(T,3,o.ViewContainerRef),m.ɵɵviewQuery(M,3,o.ViewContainerRef)),2&e){var n=void 0;m.ɵɵqueryRefresh(n=m.ɵɵloadQuery())&&(t.groupingsComponent=n.first),m.ɵɵqueryRefresh(n=m.ɵɵloadQuery())&&(t.ciphersComponent=n.first),m.ɵɵqueryRefresh(n=m.ɵɵloadQuery())&&(t.attachmentsModalRef=n.first),m.ɵɵqueryRefresh(n=m.ɵɵloadQuery())&&(t.cipherAddEditModalRef=n.first),m.ɵɵqueryRefresh(n=m.ɵɵloadQuery())&&(t.collectionsModalRef=n.first),m.ɵɵqueryRefresh(n=m.ɵɵloadQuery())&&(t.eventsModalRef=n.first)}},decls:53,vars:13,consts:[[1,"container","page-content"],[1,"row"],[1,"col-3"],[3,"showFolders","showFavorites","showTrash","onAllClicked","onCipherTypeClicked","onCollectionClicked","onSearchTextChanged","onTrashClicked"],[1,"col-9"],[1,"page-header","d-flex"],[3,"appApiAction"],["actionSpinner",""],[4,"ngIf"],[1,"ml-auto","d-flex"],[3,"ciphersComponent","deleted","organization"],["type","button","class","btn btn-outline-primary btn-sm ml-auto",3,"click",4,"ngIf"],["type","warning","icon","fa-warning",4,"ngIf"],[3,"onCipherClicked","onAttachmentsClicked","onAddCipher","onCollectionsClicked","onEventsClicked","onCloneClicked"],["attachments",""],["cipherAddEdit",""],["collections",""],["eventsTemplate",""],["aria-hidden","true",1,"fa","fa-spinner","fa-spin","text-muted",3,"title"],[1,"sr-only"],["type","button",1,"btn","btn-outline-primary","btn-sm","ml-auto",3,"click"],["aria-hidden","true",1,"fa","fa-plus","fa-fw"],["type","warning","icon","fa-warning"]],template:function(e,t){if(1&e&&(m.ɵɵelementStart(0,"div",0),m.ɵɵtext(1," "),m.ɵɵelementStart(2,"div",1),m.ɵɵtext(3," "),m.ɵɵelementStart(4,"div",2),m.ɵɵtext(5," "),m.ɵɵelementStart(6,"app-org-vault-groupings",3),m.ɵɵlistener("onAllClicked",(function(){return t.clearGroupingFilters()}))("onCipherTypeClicked",(function(e){return t.filterCipherType(e)}))("onCollectionClicked",(function(e){return t.filterCollection(e.id)}))("onSearchTextChanged",(function(e){return t.filterSearchText(e)}))("onTrashClicked",(function(){return t.filterDeleted()})),m.ɵɵtext(7," "),m.ɵɵelementEnd(),m.ɵɵtext(8," "),m.ɵɵelementEnd(),m.ɵɵtext(9," "),m.ɵɵelementStart(10,"div",4),m.ɵɵtext(11," "),m.ɵɵelementStart(12,"div",5),m.ɵɵtext(13," "),m.ɵɵelementStart(14,"h1"),m.ɵɵtext(15),m.ɵɵpipe(16,"i18n"),m.ɵɵelementStart(17,"small",6,7),m.ɵɵtext(19," "),m.ɵɵtemplate(20,D,9,6,"ng-container",8),m.ɵɵtext(21," "),m.ɵɵelementEnd(),m.ɵɵtext(22," "),m.ɵɵelementEnd(),m.ɵɵtext(23," "),m.ɵɵelementStart(24,"div",9),m.ɵɵtext(25," "),m.ɵɵelementStart(26,"app-vault-bulk-actions",10),m.ɵɵtext(27," "),m.ɵɵelementEnd(),m.ɵɵtext(28," "),m.ɵɵtemplate(29,R,5,3,"button",11),m.ɵɵtext(30," "),m.ɵɵelementEnd(),m.ɵɵtext(31," "),m.ɵɵelementEnd(),m.ɵɵtext(32," "),m.ɵɵtemplate(33,B,2,1,"app-callout",12),m.ɵɵtext(34," "),m.ɵɵelementStart(35,"app-org-vault-ciphers",13),m.ɵɵlistener("onCipherClicked",(function(e){return t.editCipher(e)}))("onAttachmentsClicked",(function(e){return t.editCipherAttachments(e)}))("onAddCipher",(function(){return t.addCipher()}))("onCollectionsClicked",(function(e){return t.editCipherCollections(e)}))("onEventsClicked",(function(e){return t.viewEvents(e)}))("onCloneClicked",(function(e){return t.cloneCipher(e)})),m.ɵɵtext(36," "),m.ɵɵelementEnd(),m.ɵɵtext(37," "),m.ɵɵelementEnd(),m.ɵɵtext(38," "),m.ɵɵelementEnd(),m.ɵɵtext(39," "),m.ɵɵelementEnd(),m.ɵɵtext(40," "),m.ɵɵtemplate(41,j,0,0,"ng-template",null,14,m.ɵɵtemplateRefExtractor),m.ɵɵtext(43," "),m.ɵɵtemplate(44,U,0,0,"ng-template",null,15,m.ɵɵtemplateRefExtractor),m.ɵɵtext(46," "),m.ɵɵtemplate(47,V,0,0,"ng-template",null,16,m.ɵɵtemplateRefExtractor),m.ɵɵtext(49," "),m.ɵɵtemplate(50,F,0,0,"ng-template",null,17,m.ɵɵtemplateRefExtractor),m.ɵɵtext(52," ")),2&e){var n=m.ɵɵreference(18);m.ɵɵadvance(6),m.ɵɵproperty("showFolders",!1)("showFavorites",!1)("showTrash",!0),m.ɵɵadvance(9),m.ɵɵtextInterpolate1(" ",m.ɵɵpipeBind1(16,11,"vault")," "),m.ɵɵadvance(2),m.ɵɵproperty("appApiAction",t.ciphersComponent.actionPromise),m.ɵɵadvance(3),m.ɵɵproperty("ngIf",n.loading),m.ɵɵadvance(6),m.ɵɵproperty("ciphersComponent",t.ciphersComponent)("deleted",t.deleted)("organization",t.organization),m.ɵɵadvance(3),m.ɵɵproperty("ngIf",!t.deleted),m.ɵɵadvance(4),m.ɵɵproperty("ngIf",t.deleted)}},directives:[w.GroupingsComponent,C.ApiActionDirective,I.NgIf,E.BulkActionsComponent,P.CiphersComponent,k.CalloutComponent],pipes:[O.I18nPipe],encapsulation:2}),e}();t.VaultComponent=z,("undefined"==typeof ngDevMode||ngDevMode)&&m.ɵsetClassMetadata(z,[{type:o.Component,args:[{selector:"app-org-vault",templateUrl:"vault.component.html"}]}],(function(){return[{type:f.ActivatedRoute},{type:h.UserService},{type:f.Router},{type:m.ChangeDetectorRef},{type:v.SyncService},{type:y.I18nService},{type:g.ModalService},{type:x.MessagingService},{type:S.BroadcasterService},{type:m.NgZone},{type:b.PlatformUtilsService}]}),{groupingsComponent:[{type:o.ViewChild,args:[d.GroupingsComponent,{static:!0}]}],ciphersComponent:[{type:o.ViewChild,args:[p.CiphersComponent,{static:!0}]}],attachmentsModalRef:[{type:o.ViewChild,args:["attachments",{read:o.ViewContainerRef,static:!0}]}],cipherAddEditModalRef:[{type:o.ViewChild,args:["cipherAddEdit",{read:o.ViewContainerRef,static:!0}]}],collectionsModalRef:[{type:o.ViewChild,args:["collections",{read:o.ViewContainerRef,static:!0}]}],eventsModalRef:[{type:o.ViewChild,args:["eventsTemplate",{read:o.ViewContainerRef,static:!0}]}]})},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&(this.organizationId=this.organizations[0].id),this.filterCollections(),[2]}}))}))},e.prototype.ngOnDestroy=function(){this.selectAll(!1)},e.prototype.filterCollections=function(){var e=this;this.selectAll(!1),null==this.organizationId||0===this.writeableCollections.length?this.collections=[]:this.collections=this.writeableCollections.filter((function(t){return t.organizationId===e.organizationId}))},e.prototype.submit=function(){var e,t;return r(this,void 0,void 0,(function(){var n,r,o,a=this;return i(this,(function(i){switch(i.label){case 0:n=this.collections.filter((function(e){return e.checked})).map((function(e){return e.id})),i.label=1;case 1:return i.trys.push([1,3,,4]),this.formPromise=this.cipherService.shareManyWithServer(this.shareableCiphers,this.organizationId,n),[4,this.formPromise];case 2:return i.sent(),this.onShared.emit(),r=null!==(t=null===(e=this.organizations.find((function(e){return e.id===a.organizationId})))||void 0===e?void 0:e.name)&&void 0!==t?t:this.i18nService.t("organization"),this.toasterService.popAsync("success",null,this.i18nService.t("movedItemsToOrg",r)),[3,4];case 3:return o=i.sent(),this.logService.error(o),[3,4];case 4:return[2]}}))}))},e.prototype.check=function(e,t){e.checked=null==t?!e.checked:t},e.prototype.selectAll=function(e){var t=this;(e?this.collections:this.writeableCollections).forEach((function(n){return t.check(n,e)}))},Object.defineProperty(e.prototype,"canSave",{get:function(){if(null!=this.shareableCiphers&&this.shareableCiphers.length>0&&null!=this.collections)for(var e=0;e0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=this.maxAccessCount},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"expired",{get:function(){return null!=this.expirationDate&&this.expirationDate<=new Date},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pendingDelete",{get:function(){return this.deletionDate<=new Date},enumerable:!1,configurable:!0}),e}();t.SendView=a},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.EffluxDatesComponent=void 0;n(2);var o=n(0),a=n(12),s=(n(1),n(4),n(1085)),l=n(0),c=n(1),p=n(4),u=n(2),d=n(12),m=n(37),f=n(9);function h(e,t){if(1&e&&(l.ɵɵelementContainerStart(0),l.ɵɵtext(1," "),l.ɵɵelementStart(2,"div",13),l.ɵɵtext(3," "),l.ɵɵelement(4,"input",14),l.ɵɵtext(5," "),l.ɵɵelement(6,"input",15),l.ɵɵtext(7," "),l.ɵɵelementEnd(),l.ɵɵtext(8," "),l.ɵɵelementContainerEnd()),2&e){var n=l.ɵɵnextContext(2);l.ɵɵadvance(4),l.ɵɵproperty("readOnly",n.disableSend),l.ɵɵadvance(2),l.ɵɵproperty("readOnly",n.disableSend)}}function v(e,t){if(1&e&&(l.ɵɵelementStart(0,"option",18),l.ɵɵtext(1),l.ɵɵelementEnd()),2&e){var n=t.$implicit;l.ɵɵproperty("ngValue",n.twentyFourHour),l.ɵɵadvance(1),l.ɵɵtextInterpolate(n.twelveHour)}}function y(e,t){if(1&e&&(l.ɵɵelementContainerStart(0),l.ɵɵtext(1," "),l.ɵɵelementStart(2,"div",13),l.ɵɵtext(3," "),l.ɵɵelement(4,"input",14),l.ɵɵtext(5," "),l.ɵɵelementStart(6,"select",16),l.ɵɵtext(7," "),l.ɵɵtemplate(8,v,2,2,"option",17),l.ɵɵtext(9," "),l.ɵɵelementEnd(),l.ɵɵtext(10," "),l.ɵɵelementEnd(),l.ɵɵtext(11," "),l.ɵɵelementContainerEnd()),2&e){var n=l.ɵɵnextContext(2);l.ɵɵadvance(4),l.ɵɵproperty("readOnly",n.disableSend),l.ɵɵadvance(2),l.ɵɵproperty("required",!n.editMode),l.ɵɵadvance(2),l.ɵɵproperty("ngForOf",n.safariDeletionTimePresetOptions)}}function g(e,t){if(1&e&&(l.ɵɵelementContainerStart(0),l.ɵɵtext(1," "),l.ɵɵelement(2,"input",19),l.ɵɵtext(3," "),l.ɵɵelementContainerEnd()),2&e){var n=l.ɵɵnextContext(2);l.ɵɵadvance(2),l.ɵɵproperty("readOnly",n.disabled)}}function x(e,t){if(1&e&&(l.ɵɵtext(0," "),l.ɵɵelementContainerStart(1,10),l.ɵɵtext(2," "),l.ɵɵtemplate(3,h,9,2,"ng-container",11),l.ɵɵtext(4," "),l.ɵɵtemplate(5,y,12,3,"ng-container",11),l.ɵɵtext(6," "),l.ɵɵtemplate(7,g,4,1,"ng-container",12),l.ɵɵtext(8," "),l.ɵɵelementContainerEnd(),l.ɵɵtext(9," ")),2&e){var n=l.ɵɵnextContext();l.ɵɵadvance(1),l.ɵɵproperty("ngSwitch",n.browserPath),l.ɵɵadvance(2),l.ɵɵproperty("ngSwitchCase","firefox"),l.ɵɵadvance(2),l.ɵɵproperty("ngSwitchCase","safari")}}function S(e,t){if(1&e&&(l.ɵɵelementStart(0,"option",18),l.ɵɵtext(1),l.ɵɵelementEnd()),2&e){var n=t.$implicit;l.ɵɵproperty("ngValue",n.value),l.ɵɵadvance(1),l.ɵɵtextInterpolate1("",n.name," ")}}function b(e,t){1&e&&(l.ɵɵelementContainerStart(0),l.ɵɵtext(1," "),l.ɵɵelementContainerEnd())}function w(e,t){if(1&e&&(l.ɵɵelementContainerStart(0),l.ɵɵtext(1," "),l.ɵɵtemplate(2,b,2,0,"ng-container",21),l.ɵɵtext(3," "),l.ɵɵelementContainerEnd()),2&e){l.ɵɵnextContext(2);var n=l.ɵɵreference(9);l.ɵɵadvance(2),l.ɵɵproperty("ngTemplateOutlet",n)}}function C(e,t){if(1&e&&(l.ɵɵelementStart(0,"div"),l.ɵɵtext(1," "),l.ɵɵelementStart(2,"select",20),l.ɵɵtext(3," "),l.ɵɵtemplate(4,S,2,2,"option",17),l.ɵɵtext(5," "),l.ɵɵelementEnd(),l.ɵɵtext(6," "),l.ɵɵtemplate(7,w,4,1,"ng-container",4),l.ɵɵtext(8," "),l.ɵɵelementEnd()),2&e){var n=l.ɵɵnextContext();l.ɵɵadvance(4),l.ɵɵproperty("ngForOf",n.deletionDatePresets),l.ɵɵadvance(3),l.ɵɵproperty("ngIf",0===n.selectedDeletionDatePreset.value)}}function I(e,t){1&e&&(l.ɵɵelementContainerStart(0),l.ɵɵtext(1," "),l.ɵɵelementContainerEnd())}function E(e,t){if(1&e&&(l.ɵɵelementStart(0,"div"),l.ɵɵtext(1," "),l.ɵɵtemplate(2,I,2,0,"ng-container",21),l.ɵɵtext(3," "),l.ɵɵelementEnd()),2&e){l.ɵɵnextContext();var n=l.ɵɵreference(9);l.ɵɵadvance(2),l.ɵɵproperty("ngTemplateOutlet",n)}}function P(e,t){if(1&e){var n=l.ɵɵgetCurrentView();l.ɵɵelementStart(0,"a",22),l.ɵɵlistener("click",(function(){return l.ɵɵrestoreView(n),l.ɵɵnextContext().clearExpiration()})),l.ɵɵtext(1),l.ɵɵpipe(2,"i18n"),l.ɵɵelementEnd()}2&e&&(l.ɵɵadvance(1),l.ɵɵtextInterpolate1(" ",l.ɵɵpipeBind1(2,1,"clear")," "))}function k(e,t){if(1&e&&(l.ɵɵelementStart(0,"div",13),l.ɵɵtext(1," "),l.ɵɵelement(2,"input",24),l.ɵɵtext(3," "),l.ɵɵelement(4,"input",25),l.ɵɵtext(5," "),l.ɵɵelementEnd()),2&e){var n=l.ɵɵnextContext(2);l.ɵɵadvance(2),l.ɵɵproperty("required",!n.editMode)("readOnly",n.disabled),l.ɵɵadvance(2),l.ɵɵproperty("required",!n.editMode)("readOnly",n.disabled)}}function O(e,t){if(1&e&&(l.ɵɵelementStart(0,"option",18),l.ɵɵtext(1),l.ɵɵelementEnd()),2&e){var n=t.$implicit;l.ɵɵproperty("ngValue",n.twentyFourHour),l.ɵɵadvance(1),l.ɵɵtextInterpolate(n.twelveHour)}}function _(e,t){if(1&e&&(l.ɵɵelementStart(0,"div",13),l.ɵɵtext(1," "),l.ɵɵelement(2,"input",24),l.ɵɵtext(3," "),l.ɵɵelementStart(4,"select",26),l.ɵɵtext(5," "),l.ɵɵtemplate(6,O,2,2,"option",17),l.ɵɵtext(7," "),l.ɵɵelementEnd(),l.ɵɵtext(8," "),l.ɵɵelementEnd()),2&e){var n=l.ɵɵnextContext(2);l.ɵɵadvance(2),l.ɵɵproperty("required",!n.editMode)("readOnly",n.disabled),l.ɵɵadvance(2),l.ɵɵproperty("required",!n.editMode),l.ɵɵadvance(2),l.ɵɵproperty("ngForOf",n.safariExpirationTimePresetOptions)}}function A(e,t){if(1&e&&(l.ɵɵelementContainerStart(0),l.ɵɵtext(1," "),l.ɵɵelement(2,"input",27),l.ɵɵtext(3," "),l.ɵɵelementContainerEnd()),2&e){var n=l.ɵɵnextContext(2);l.ɵɵadvance(2),l.ɵɵproperty("readOnly",n.disabled)}}function T(e,t){if(1&e&&(l.ɵɵtext(0," "),l.ɵɵelementContainerStart(1,10),l.ɵɵtext(2," "),l.ɵɵtemplate(3,k,6,4,"div",23),l.ɵɵtext(4," "),l.ɵɵtemplate(5,_,9,4,"div",23),l.ɵɵtext(6," "),l.ɵɵtemplate(7,A,4,1,"ng-container",12),l.ɵɵtext(8," "),l.ɵɵelementContainerEnd(),l.ɵɵtext(9," ")),2&e){var n=l.ɵɵnextContext();l.ɵɵadvance(1),l.ɵɵproperty("ngSwitch",n.browserPath),l.ɵɵadvance(2),l.ɵɵproperty("ngSwitchCase","firefox"),l.ɵɵadvance(2),l.ɵɵproperty("ngSwitchCase","safari")}}function M(e,t){if(1&e&&(l.ɵɵelementStart(0,"option",18),l.ɵɵtext(1),l.ɵɵelementEnd()),2&e){var n=t.$implicit;l.ɵɵproperty("ngValue",n.value),l.ɵɵadvance(1),l.ɵɵtextInterpolate1("",n.name," ")}}function D(e,t){1&e&&(l.ɵɵelementContainerStart(0),l.ɵɵtext(1," "),l.ɵɵelementContainerEnd())}function R(e,t){if(1&e&&(l.ɵɵelementContainerStart(0),l.ɵɵtext(1," "),l.ɵɵtemplate(2,D,2,0,"ng-container",21),l.ɵɵtext(3," "),l.ɵɵelementContainerEnd()),2&e){l.ɵɵnextContext(2);var n=l.ɵɵreference(32);l.ɵɵadvance(2),l.ɵɵproperty("ngTemplateOutlet",n)}}function B(e,t){if(1&e&&(l.ɵɵelementStart(0,"div"),l.ɵɵtext(1," "),l.ɵɵelementStart(2,"select",28),l.ɵɵtext(3," "),l.ɵɵtemplate(4,M,2,2,"option",17),l.ɵɵtext(5," "),l.ɵɵelementEnd(),l.ɵɵtext(6," "),l.ɵɵtemplate(7,R,4,1,"ng-container",4),l.ɵɵtext(8," "),l.ɵɵelementEnd()),2&e){var n=l.ɵɵnextContext();l.ɵɵadvance(4),l.ɵɵproperty("ngForOf",n.expirationDatePresets),l.ɵɵadvance(3),l.ɵɵproperty("ngIf",0===n.selectedExpirationDatePreset.value)}}function j(e,t){1&e&&(l.ɵɵelementContainerStart(0),l.ɵɵtext(1," "),l.ɵɵelementContainerEnd())}function U(e,t){if(1&e&&(l.ɵɵelementStart(0,"div"),l.ɵɵtext(1," "),l.ɵɵtemplate(2,j,2,0,"ng-container",21),l.ɵɵtext(3," "),l.ɵɵelementEnd()),2&e){l.ɵɵnextContext();var n=l.ɵɵreference(32);l.ɵɵadvance(2),l.ɵɵproperty("ngTemplateOutlet",n)}}var V=function(e){function t(t,n,r){var i=e.call(this,t,n,r)||this;return i.i18nService=t,i.platformUtilsService=n,i.datePipe=r,i}return i(t,e),t.ɵfac=function(e){return new(e||t)(l.ɵɵdirectiveInject(c.I18nService),l.ɵɵdirectiveInject(p.PlatformUtilsService),l.ɵɵdirectiveInject(u.DatePipe))},t.ɵcmp=l.ɵɵdefineComponent({type:t,selectors:[["app-send-efflux-dates"]],features:[l.ɵɵProvidersFeature([],[{provide:a.ControlContainer,useExisting:a.NgForm}]),l.ɵɵInheritDefinitionFeature],decls:44,vars:18,consts:[[1,"row",3,"formGroup"],[1,"col-6","form-group"],["for","deletionDate"],["deletionDateCustom",""],[4,"ngIf"],[1,"form-text","text-muted","small"],[1,"d-flex"],["for","expirationDate"],["href","#","appStopClick","","class","ml-auto",3,"click",4,"ngIf"],["expirationDateCustom",""],[3,"ngSwitch"],[4,"ngSwitchCase"],[4,"ngSwitchDefault"],[1,"d-flex","justify-content-around"],["id","deletionDateCustomFallback","type","date","name","DeletionDateFallback","formControlName","fallbackDeletionDate","required","","placeholder","MM/DD/YYYY","data-date-format","mm/dd/yyyy",1,"form-control","mt-1",3,"readOnly"],["id","deletionTimeCustomFallback","type","time","name","DeletionTimeDate","formControlName","fallbackDeletionTime","required","","placeholder","HH:MM AM/PM",1,"form-control","mt-1","ml-1",3,"readOnly"],["id","deletionTimeCustomFallback","formControlName","fallbackDeletionTime","name","SafariDeletionTime",1,"form-control","mt-1","ml-1",3,"required"],[3,"ngValue",4,"ngFor","ngForOf"],[3,"ngValue"],["id","deletionDateCustom","type","datetime-local","name","DeletionDate","formControlName","defaultDeletionDateTime","required","","placeholder","MM/DD/YYYY HH:MM AM/PM",1,"form-control","mt-1",3,"readOnly"],["id","deletionDate","name","SelectedDeletionDatePreset","formControlName","selectedDeletionDatePreset","required","",1,"form-control"],[4,"ngTemplateOutlet"],["href","#","appStopClick","",1,"ml-auto",3,"click"],["class","d-flex justify-content-around",4,"ngSwitchCase"],["id","expirationDateCustomFallback","type","date","name","ExpirationDateFallback","formControlName","fallbackExpirationDate","placeholder","MM/DD/YYYY","data-date-format","mm/dd/yyyy",1,"form-control","mt-1",3,"required","readOnly"],["id","expirationTimeCustomFallback","type","time","name","ExpirationTimeFallback","formControlName","fallbackExpirationTime","placeholder","HH:MM AM/PM",1,"form-control","mt-1","ml-1",3,"required","readOnly"],["id","expirationTimeCustomFallback","formControlName","fallbackExpirationTime","name","SafariExpirationTime",1,"form-control","mt-1","ml-1",3,"required"],["id","expirationDateCustom","type","datetime-local","name","ExpirationDate","formControlName","defaultExpirationDateTime","placeholder","MM/DD/YYYY HH:MM AM/PM",1,"form-control","mt-1",3,"readOnly"],["id","expirationDate","name","SelectedExpirationDatePreset","formControlName","selectedExpirationDatePreset","required","",1,"form-control"]],template:function(e,t){1&e&&(l.ɵɵelementStart(0,"div",0),l.ɵɵtext(1," "),l.ɵɵelementStart(2,"div",1),l.ɵɵtext(3," "),l.ɵɵelementStart(4,"label",2),l.ɵɵtext(5),l.ɵɵpipe(6,"i18n"),l.ɵɵelementEnd(),l.ɵɵtext(7," "),l.ɵɵtemplate(8,x,10,3,"ng-template",null,3,l.ɵɵtemplateRefExtractor),l.ɵɵtext(10," "),l.ɵɵtemplate(11,C,9,2,"div",4),l.ɵɵtext(12," "),l.ɵɵtemplate(13,E,4,1,"div",4),l.ɵɵtext(14," "),l.ɵɵelementStart(15,"div",5),l.ɵɵtext(16),l.ɵɵpipe(17,"i18n"),l.ɵɵelementEnd(),l.ɵɵtext(18," "),l.ɵɵelementEnd(),l.ɵɵtext(19," "),l.ɵɵelementStart(20,"div",1),l.ɵɵtext(21," "),l.ɵɵelementStart(22,"div",6),l.ɵɵtext(23," "),l.ɵɵelementStart(24,"label",7),l.ɵɵtext(25),l.ɵɵpipe(26,"i18n"),l.ɵɵelementEnd(),l.ɵɵtext(27," "),l.ɵɵtemplate(28,P,3,3,"a",8),l.ɵɵtext(29," "),l.ɵɵelementEnd(),l.ɵɵtext(30," "),l.ɵɵtemplate(31,T,10,3,"ng-template",null,9,l.ɵɵtemplateRefExtractor),l.ɵɵtext(33," "),l.ɵɵtemplate(34,B,9,2,"div",4),l.ɵɵtext(35," "),l.ɵɵtemplate(36,U,4,1,"div",4),l.ɵɵtext(37," "),l.ɵɵelementStart(38,"div",5),l.ɵɵtext(39),l.ɵɵpipe(40,"i18n"),l.ɵɵelementEnd(),l.ɵɵtext(41," "),l.ɵɵelementEnd(),l.ɵɵtext(42," "),l.ɵɵelementEnd(),l.ɵɵtext(43," ")),2&e&&(l.ɵɵproperty("formGroup",t.datesForm),l.ɵɵadvance(5),l.ɵɵtextInterpolate(l.ɵɵpipeBind1(6,10,"deletionDate")),l.ɵɵadvance(6),l.ɵɵproperty("ngIf",!t.editMode),l.ɵɵadvance(2),l.ɵɵproperty("ngIf",t.editMode),l.ɵɵadvance(3),l.ɵɵtextInterpolate(l.ɵɵpipeBind1(17,12,"deletionDateDesc")),l.ɵɵadvance(9),l.ɵɵtextInterpolate(l.ɵɵpipeBind1(26,14,"expirationDate")),l.ɵɵadvance(3),l.ɵɵproperty("ngIf",t.editMode&&!t.disabled),l.ɵɵadvance(6),l.ɵɵproperty("ngIf",!t.editMode),l.ɵɵadvance(2),l.ɵɵproperty("ngIf",t.editMode),l.ɵɵadvance(3),l.ɵɵtextInterpolate(l.ɵɵpipeBind1(40,16,"expirationDateDesc")))},directives:[d.NgControlStatusGroup,d.FormGroupDirective,u.NgIf,u.NgSwitch,u.NgSwitchCase,u.NgSwitchDefault,d.DefaultValueAccessor,d.NgControlStatus,d.FormControlName,d.RequiredValidator,d.SelectControlValueAccessor,u.NgForOf,d.NgSelectOption,d.ɵangular_packages_forms_forms_z,u.NgTemplateOutlet,m.StopClickDirective],pipes:[f.I18nPipe],encapsulation:2}),t}(s.EffluxDatesComponent);t.EffluxDatesComponent=V,("undefined"==typeof ngDevMode||ngDevMode)&&l.ɵsetClassMetadata(V,[{type:o.Component,args:[{selector:"app-send-efflux-dates",templateUrl:"efflux-dates.component.html",viewProviders:[{provide:a.ControlContainer,useExisting:a.NgForm}]}]}],(function(){return[{type:c.I18nService},{type:p.PlatformUtilsService},{type:u.DatePipe}]}),null)},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0),s.ɵɵadvance(2),s.ɵɵproperty("disabled",n.loading),s.ɵɵadvance(2),s.ɵɵpropertyInterpolate("title",s.ɵɵpipeBind1(43,27,"loading")),s.ɵɵadvance(4),s.ɵɵtextInterpolate(s.ɵɵpipeBind1(47,29,"save"))}},directives:[d.NgControlStatusGroup,d.NgForm,m.ApiActionDirective,f.NgIf,f.NgForOf,d.DefaultValueAccessor,d.RequiredValidator,d.NgControlStatus,d.NgModel,h.A11yTitleDirective,f.NgClass,v.StopClickDirective],pipes:[y.I18nPipe],encapsulation:2}),e}();t.DomainRulesComponent=k,("undefined"==typeof ngDevMode||ngDevMode)&&s.ɵsetClassMetadata(k,[{type:o.Component,args:[{selector:"app-domain-rules",templateUrl:"domain-rules.component.html"}]}],(function(){return[{type:l.ApiService},{type:c.I18nService},{type:p.ToasterService},{type:u.LogService}]}),null)},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0?(t=e.data.map((function(e){return new c.Policy(new l.PolicyData(e))})),n=this,[4,this.policyService.getMasterPasswordPolicyOptions(t)]):[3,3];case 2:n.enforcedPolicyOptions=r.sent(),r.label=3;case 3:return[2]}}))}))},t.prototype.submit=function(){return o(this,void 0,void 0,(function(){var e,t,n,r,i,o,s;return a(this,(function(a){switch(a.label){case 0:return[4,this.strongPassword()];case 1:return a.sent()?[4,this.apiService.postEmergencyAccessTakeover(this.emergencyAccessId)]:[2];case 2:return e=a.sent(),[4,this.cryptoService.rsaDecrypt(e.keyEncrypted)];case 3:return t=a.sent(),null==(n=new p.SymmetricCryptoKey(t))?(this.toasterService.popAsync("error",this.i18nService.t("errorOccurred"),this.i18nService.t("unexpectedError")),[2]):[4,this.cryptoService.makeKey(this.masterPassword,this.email,e.kdf,e.kdfIterations)];case 4:return r=a.sent(),[4,this.cryptoService.hashPassword(this.masterPassword,r)];case 5:return i=a.sent(),[4,this.cryptoService.remakeEncKey(r,n)];case 6:o=a.sent(),(s=new u.EmergencyAccessPasswordRequest).newMasterPasswordHash=i,s.key=o[1].encryptedString,this.apiService.postEmergencyAccessPassword(this.emergencyAccessId,s);try{this.onDone.emit()}catch(l){this.logService.error(l)}return[2]}}))}))},t.ɵfac=function(e){return new(e||t)(m.ɵɵdirectiveInject(f.I18nService),m.ɵɵdirectiveInject(h.CryptoService),m.ɵɵdirectiveInject(v.MessagingService),m.ɵɵdirectiveInject(y.UserService),m.ɵɵdirectiveInject(g.PasswordGenerationService),m.ɵɵdirectiveInject(x.PlatformUtilsService),m.ɵɵdirectiveInject(S.PolicyService),m.ɵɵdirectiveInject(b.ApiService),m.ɵɵdirectiveInject(w.ToasterService),m.ɵɵdirectiveInject(C.LogService))},t.ɵcmp=m.ɵɵdefineComponent({type:t,selectors:[["emergency-access-takeover"]],inputs:{emergencyAccessId:"emergencyAccessId",name:"name",email:"email",kdf:"kdf",kdfIterations:"kdfIterations"},outputs:{onDone:"onDone"},features:[m.ɵɵInheritDefinitionFeature],decls:82,vars:32,consts:[["role","dialog","aria-modal","true","aria-labelledby","userAddEditTitle",1,"modal","fade"],["role","document",1,"modal-dialog","modal-dialog-scrollable","modal-lg"],["ngNativeValidate","",1,"modal-content",3,"appApiAction","ngSubmit"],["form",""],[1,"modal-header"],["id","userAddEditTitle",1,"modal-title"],["class","text-muted",4,"ngIf"],["type","button","data-dismiss","modal",1,"close",3,"appA11yTitle"],["aria-hidden","true"],[1,"modal-body"],["type","warning"],["type","info",3,"enforcedPolicyOptions",4,"ngIf"],[1,"row"],[1,"col-6"],[1,"form-group"],["for","masterPassword"],["id","masterPassword","type","password","name","NewMasterPasswordHash","required","","appInputVerbatim","","autocomplete","new-password",1,"form-control","mb-1",3,"ngModel","ngModelChange","input"],[3,"score","showText"],["for","masterPasswordRetype"],["id","masterPasswordRetype","type","password","name","MasterPasswordRetype","required","","appInputVerbatim","","autocomplete","new-password",1,"form-control",3,"ngModel","ngModelChange"],[1,"modal-footer"],["type","submit",1,"btn","btn-primary","btn-submit",3,"disabled"],["aria-hidden","true",1,"fa","fa-spinner","fa-spin",3,"title"],["type","button","data-dismiss","modal",1,"btn","btn-outline-secondary"],[1,"text-muted"],["type","info",3,"enforcedPolicyOptions"]],template:function(e,t){if(1&e&&(m.ɵɵelementStart(0,"div",0),m.ɵɵtext(1," "),m.ɵɵelementStart(2,"div",1),m.ɵɵtext(3," "),m.ɵɵelementStart(4,"form",2,3),m.ɵɵlistener("ngSubmit",(function(){return t.submit()})),m.ɵɵtext(6," "),m.ɵɵelementStart(7,"div",4),m.ɵɵtext(8," "),m.ɵɵelementStart(9,"h2",5),m.ɵɵtext(10),m.ɵɵpipe(11,"i18n"),m.ɵɵtemplate(12,M,2,1,"small",6),m.ɵɵtext(13," "),m.ɵɵelementEnd(),m.ɵɵtext(14," "),m.ɵɵelementStart(15,"button",7),m.ɵɵpipe(16,"i18n"),m.ɵɵtext(17," "),m.ɵɵelementStart(18,"span",8),m.ɵɵtext(19,"×"),m.ɵɵelementEnd(),m.ɵɵtext(20," "),m.ɵɵelementEnd(),m.ɵɵtext(21," "),m.ɵɵelementEnd(),m.ɵɵtext(22," "),m.ɵɵelementStart(23,"div",9),m.ɵɵtext(24," "),m.ɵɵelementStart(25,"app-callout",10),m.ɵɵtext(26),m.ɵɵpipe(27,"i18n"),m.ɵɵelementEnd(),m.ɵɵtext(28," "),m.ɵɵtemplate(29,D,2,1,"app-callout",11),m.ɵɵtext(30," "),m.ɵɵelementStart(31,"div",12),m.ɵɵtext(32," "),m.ɵɵelementStart(33,"div",13),m.ɵɵtext(34," "),m.ɵɵelementStart(35,"div",14),m.ɵɵtext(36," "),m.ɵɵelementStart(37,"label",15),m.ɵɵtext(38),m.ɵɵpipe(39,"i18n"),m.ɵɵelementEnd(),m.ɵɵtext(40," "),m.ɵɵelementStart(41,"input",16),m.ɵɵlistener("ngModelChange",(function(e){return t.masterPassword=e}))("input",(function(){return t.updatePasswordStrength()})),m.ɵɵelementEnd(),m.ɵɵtext(42," "),m.ɵɵelementStart(43,"app-password-strength",17),m.ɵɵtext(44," "),m.ɵɵelementEnd(),m.ɵɵtext(45," "),m.ɵɵelementEnd(),m.ɵɵtext(46," "),m.ɵɵelementEnd(),m.ɵɵtext(47," "),m.ɵɵelementStart(48,"div",13),m.ɵɵtext(49," "),m.ɵɵelementStart(50,"div",14),m.ɵɵtext(51," "),m.ɵɵelementStart(52,"label",18),m.ɵɵtext(53),m.ɵɵpipe(54,"i18n"),m.ɵɵelementEnd(),m.ɵɵtext(55," "),m.ɵɵelementStart(56,"input",19),m.ɵɵlistener("ngModelChange",(function(e){return t.masterPasswordRetype=e})),m.ɵɵelementEnd(),m.ɵɵtext(57," "),m.ɵɵelementEnd(),m.ɵɵtext(58," "),m.ɵɵelementEnd(),m.ɵɵtext(59," "),m.ɵɵelementEnd(),m.ɵɵtext(60," "),m.ɵɵelementEnd(),m.ɵɵtext(61," "),m.ɵɵelementStart(62,"div",20),m.ɵɵtext(63," "),m.ɵɵelementStart(64,"button",21),m.ɵɵtext(65," "),m.ɵɵelement(66,"i",22),m.ɵɵpipe(67,"i18n"),m.ɵɵtext(68," "),m.ɵɵelementStart(69,"span"),m.ɵɵtext(70),m.ɵɵpipe(71,"i18n"),m.ɵɵelementEnd(),m.ɵɵtext(72," "),m.ɵɵelementEnd(),m.ɵɵtext(73," "),m.ɵɵelementStart(74,"button",23),m.ɵɵtext(75),m.ɵɵpipe(76,"i18n"),m.ɵɵelementEnd(),m.ɵɵtext(77," "),m.ɵɵelementEnd(),m.ɵɵtext(78," "),m.ɵɵelementEnd(),m.ɵɵtext(79," "),m.ɵɵelementEnd(),m.ɵɵtext(80," "),m.ɵɵelementEnd(),m.ɵɵtext(81," ")),2&e){var n=m.ɵɵreference(5);m.ɵɵadvance(4),m.ɵɵproperty("appApiAction",t.formPromise),m.ɵɵadvance(6),m.ɵɵtextInterpolate1(" ",m.ɵɵpipeBind1(11,16,"takeover")," "),m.ɵɵadvance(2),m.ɵɵproperty("ngIf",t.name),m.ɵɵadvance(3),m.ɵɵpropertyInterpolate("appA11yTitle",m.ɵɵpipeBind1(16,18,"close")),m.ɵɵadvance(11),m.ɵɵtextInterpolate(m.ɵɵpipeBind1(27,20,"loggedOutWarning")),m.ɵɵadvance(3),m.ɵɵproperty("ngIf",t.enforcedPolicyOptions),m.ɵɵadvance(9),m.ɵɵtextInterpolate(m.ɵɵpipeBind1(39,22,"newMasterPass")),m.ɵɵadvance(3),m.ɵɵproperty("ngModel",t.masterPassword),m.ɵɵadvance(2),m.ɵɵproperty("score",t.masterPasswordScore)("showText",!0),m.ɵɵadvance(10),m.ɵɵtextInterpolate(m.ɵɵpipeBind1(54,24,"confirmNewMasterPass")),m.ɵɵadvance(3),m.ɵɵproperty("ngModel",t.masterPasswordRetype),m.ɵɵadvance(8),m.ɵɵproperty("disabled",n.loading),m.ɵɵadvance(2),m.ɵɵpropertyInterpolate("title",m.ɵɵpipeBind1(67,26,"loading")),m.ɵɵadvance(4),m.ɵɵtextInterpolate(m.ɵɵpipeBind1(71,28,"save")),m.ɵɵadvance(5),m.ɵɵtextInterpolate1(" ",m.ɵɵpipeBind1(76,30,"cancel")," ")}},directives:[I.NgControlStatusGroup,I.NgForm,E.ApiActionDirective,P.NgIf,k.A11yTitleDirective,O.CalloutComponent,I.DefaultValueAccessor,I.RequiredValidator,_.InputVerbatimDirective,I.NgControlStatus,I.NgModel,A.PasswordStrengthComponent],pipes:[T.I18nPipe],encapsulation:2}),t}(d.ChangePasswordComponent);t.EmergencyAccessTakeoverComponent=R,("undefined"==typeof ngDevMode||ngDevMode)&&m.ɵsetClassMetadata(R,[{type:s.Component,args:[{selector:"emergency-access-takeover",templateUrl:"emergency-access-takeover.component.html"}]}],(function(){return[{type:f.I18nService},{type:h.CryptoService},{type:v.MessagingService},{type:y.UserService},{type:g.PasswordGenerationService},{type:x.PlatformUtilsService},{type:S.PolicyService},{type:b.ApiService},{type:w.ToasterService},{type:C.LogService}]}),{onDone:[{type:s.Output}],emergencyAccessId:[{type:s.Input}],name:[{type:s.Input}],email:[{type:s.Input}],kdf:[{type:s.Input}],kdfIterations:[{type:s.Input}]})},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]-1&&this.trustedContacts.splice(t,1)},e.prototype.removeGrantor=function(e){var t=this.grantedContacts.indexOf(e);t>-1&&this.grantedContacts.splice(t,1)},e.prototype.doConfirmation=function(e){return r(this,void 0,void 0,(function(){var t,n,r,o,a,s,p,u;return i(this,(function(i){switch(i.label){case 0:return[4,this.cryptoService.getEncKey()];case 1:return t=i.sent(),[4,this.apiService.getUserPublicKey(e.granteeId)];case 2:n=i.sent(),r=l.Utils.fromB64ToArray(n.publicKey),i.label=3;case 3:return i.trys.push([3,5,,6]),a=(o=this.logService).debug,s="User's fingerprint: ",[4,this.cryptoService.getFingerprint(e.granteeId,r.buffer)];case 4:return a.apply(o,[s+i.sent().join("-")]),[3,6];case 5:return i.sent(),[3,6];case 6:return[4,this.cryptoService.rsaEncrypt(t.key,r.buffer)];case 7:return p=i.sent(),(u=new c.EmergencyAccessConfirmRequest).key=p.encryptedString,[4,this.apiService.postEmergencyAccessConfirm(e.id,u)];case 8:return i.sent(),[2]}}))}))},e.ɵfac=function(t){return new(t||e)(h.ɵɵdirectiveInject(v.ApiService),h.ɵɵdirectiveInject(y.I18nService),h.ɵɵdirectiveInject(g.ModalService),h.ɵɵdirectiveInject(x.PlatformUtilsService),h.ɵɵdirectiveInject(S.ToasterService),h.ɵɵdirectiveInject(b.CryptoService),h.ɵɵdirectiveInject(w.StorageService),h.ɵɵdirectiveInject(C.UserService),h.ɵɵdirectiveInject(I.MessagingService),h.ɵɵdirectiveInject(E.UserNamePipe),h.ɵɵdirectiveInject(P.LogService))},e.ɵcmp=h.ɵɵdefineComponent({type:e,selectors:[["emergency-access"]],viewQuery:function(e,t){if(1&e&&(h.ɵɵviewQuery(D,3,o.ViewContainerRef),h.ɵɵviewQuery(R,3,o.ViewContainerRef),h.ɵɵviewQuery(B,3,o.ViewContainerRef)),2&e){var n=void 0;h.ɵɵqueryRefresh(n=h.ɵɵloadQuery())&&(t.addEditModalRef=n.first),h.ɵɵqueryRefresh(n=h.ɵɵloadQuery())&&(t.takeoverModalRef=n.first),h.ɵɵqueryRefresh(n=h.ɵɵloadQuery())&&(t.confirmModalRef=n.first)}},decls:59,vars:25,consts:[[1,"page-header"],["href","https://bitwarden.com/help/article/emergency-access/","target","_blank","rel","noopener"],[4,"ngIf"],[1,"page-header","d-flex"],["href","#","appStopClick","","class","badge badge-primary",3,"click",4,"ngIf"],[1,"ml-auto","d-flex"],["type","button",1,"btn","btn-sm","btn-outline-primary","ml-3",3,"disabled","click"],["aria-hidden","true",1,"fa","fa-plus","fa-fw"],["class","table table-hover table-list mb-0",4,"ngIf"],[1,"page-header","spaced-header"],["addEdit",""],["takeoverTemplate",""],["confirmTemplate",""],["href","#","appStopClick","",1,"badge","badge-primary",3,"click"],[1,"table","table-hover","table-list","mb-0"],[4,"ngFor","ngForOf"],["width","30"],["size","25",3,"data","email","circle","fontSize"],["href","#","appStopClick","",3,"click"],["class","badge badge-secondary",4,"ngIf"],["class","badge badge-warning",4,"ngIf"],["class","badge badge-success",4,"ngIf"],["class","badge badge-primary",4,"ngIf"],["class","text-muted d-block",4,"ngIf"],[1,"table-list-options"],["appListDropdown","",1,"dropdown"],["type","button","data-toggle","dropdown","aria-haspopup","true","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle",3,"appA11yTitle"],["aria-hidden","true",1,"fa","fa-cog","fa-lg"],[1,"dropdown-menu","dropdown-menu-right"],["class","dropdown-item","href","#","appStopClick","",3,"click",4,"ngIf"],["class","dropdown-item text-success","href","#","appStopClick","",3,"click",4,"ngIf"],["class","dropdown-item text-warning","href","#","appStopClick","",3,"click",4,"ngIf"],["href","#","appStopClick","",1,"dropdown-item","text-danger",3,"click"],["aria-hidden","true",1,"fa","fa-fw","fa-remove"],[1,"badge","badge-secondary"],[1,"badge","badge-warning"],[1,"badge","badge-success"],[1,"badge","badge-primary"],[1,"text-muted","d-block"],["href","#","appStopClick","",1,"dropdown-item",3,"click"],["aria-hidden","true",1,"fa","fa-fw","fa-envelope-o"],["href","#","appStopClick","",1,"dropdown-item","text-success",3,"click"],["aria-hidden","true",1,"fa","fa-fw","fa-check"],["href","#","appStopClick","",1,"dropdown-item","text-warning",3,"click"],["class","dropdown-item",3,"routerLink",4,"ngIf"],["aria-hidden","true",1,"fa","fa-fw","fa-key"],[1,"dropdown-item",3,"routerLink"],["aria-hidden","true",1,"fa","fa-fw","fa-eye"]],template:function(e,t){1&e&&(h.ɵɵelementStart(0,"div",0),h.ɵɵtext(1," "),h.ɵɵelementStart(2,"h1"),h.ɵɵtext(3),h.ɵɵpipe(4,"i18n"),h.ɵɵelementEnd(),h.ɵɵtext(5," "),h.ɵɵelementEnd(),h.ɵɵtext(6," "),h.ɵɵelementStart(7,"p"),h.ɵɵtext(8),h.ɵɵpipe(9,"i18n"),h.ɵɵelementStart(10,"a",1),h.ɵɵtext(11),h.ɵɵpipe(12,"i18n"),h.ɵɵelementEnd(),h.ɵɵtext(13," "),h.ɵɵelementEnd(),h.ɵɵtext(14," "),h.ɵɵtemplate(15,j,7,6,"p",2),h.ɵɵtext(16," "),h.ɵɵelementStart(17,"div",3),h.ɵɵtext(18," "),h.ɵɵelementStart(19,"h2"),h.ɵɵtext(20),h.ɵɵpipe(21,"i18n"),h.ɵɵtemplate(22,U,3,3,"a",4),h.ɵɵtext(23," "),h.ɵɵelementEnd(),h.ɵɵtext(24," "),h.ɵɵelementStart(25,"div",5),h.ɵɵtext(26," "),h.ɵɵelementStart(27,"button",6),h.ɵɵlistener("click",(function(){return t.invite()})),h.ɵɵtext(28," "),h.ɵɵelement(29,"i",7),h.ɵɵtext(30),h.ɵɵpipe(31,"i18n"),h.ɵɵelementEnd(),h.ɵɵtext(32," "),h.ɵɵelementEnd(),h.ɵɵtext(33," "),h.ɵɵelementEnd(),h.ɵɵtext(34," "),h.ɵɵtemplate(35,Y,7,1,"table",8),h.ɵɵtext(36," "),h.ɵɵtemplate(37,J,3,3,"p",2),h.ɵɵtext(38," "),h.ɵɵelementStart(39,"div",9),h.ɵɵtext(40," "),h.ɵɵelementStart(41,"h2"),h.ɵɵtext(42),h.ɵɵpipe(43,"i18n"),h.ɵɵelementEnd(),h.ɵɵtext(44," "),h.ɵɵelementEnd(),h.ɵɵtext(45," "),h.ɵɵtemplate(46,ce,7,1,"table",8),h.ɵɵtext(47," "),h.ɵɵtemplate(48,pe,3,3,"p",2),h.ɵɵtext(49," "),h.ɵɵtemplate(50,ue,0,0,"ng-template",null,10,h.ɵɵtemplateRefExtractor),h.ɵɵtext(52," "),h.ɵɵtemplate(53,de,0,0,"ng-template",null,11,h.ɵɵtemplateRefExtractor),h.ɵɵtext(55," "),h.ɵɵtemplate(56,me,0,0,"ng-template",null,12,h.ɵɵtemplateRefExtractor),h.ɵɵtext(58," ")),2&e&&(h.ɵɵadvance(3),h.ɵɵtextInterpolate(h.ɵɵpipeBind1(4,13,"emergencyAccess")),h.ɵɵadvance(5),h.ɵɵtextInterpolate1(" ",h.ɵɵpipeBind1(9,15,"emergencyAccessDesc")," "),h.ɵɵadvance(3),h.ɵɵtextInterpolate1(" ",h.ɵɵpipeBind1(12,17,"learnMore"),". "),h.ɵɵadvance(4),h.ɵɵproperty("ngIf",t.isOrganizationOwner),h.ɵɵadvance(5),h.ɵɵtextInterpolate1(" ",h.ɵɵpipeBind1(21,19,"trustedEmergencyContacts")," "),h.ɵɵadvance(2),h.ɵɵproperty("ngIf",!t.canAccessPremium),h.ɵɵadvance(5),h.ɵɵproperty("disabled",!t.canAccessPremium),h.ɵɵadvance(3),h.ɵɵtextInterpolate1(" ",h.ɵɵpipeBind1(31,21,"addEmergencyContact")," "),h.ɵɵadvance(5),h.ɵɵproperty("ngIf",t.trustedContacts&&t.trustedContacts.length),h.ɵɵadvance(2),h.ɵɵproperty("ngIf",!t.trustedContacts||!t.trustedContacts.length),h.ɵɵadvance(5),h.ɵɵtextInterpolate(h.ɵɵpipeBind1(43,23,"designatedEmergencyContacts")),h.ɵɵadvance(4),h.ɵɵproperty("ngIf",t.grantedContacts&&t.grantedContacts.length),h.ɵɵadvance(2),h.ɵɵproperty("ngIf",!t.grantedContacts||!t.grantedContacts.length))},directives:[k.NgIf,O.StopClickDirective,k.NgForOf,_.AvatarComponent,A.A11yTitleDirective,T.RouterLinkWithHref],pipes:[M.I18nPipe,E.UserNamePipe],encapsulation:2}),e}();t.EmergencyAccessComponent=fe,("undefined"==typeof ngDevMode||ngDevMode)&&h.ɵsetClassMetadata(fe,[{type:o.Component,args:[{selector:"emergency-access",templateUrl:"emergency-access.component.html"}]}],(function(){return[{type:v.ApiService},{type:y.I18nService},{type:g.ModalService},{type:x.PlatformUtilsService},{type:S.ToasterService},{type:b.CryptoService},{type:w.StorageService},{type:C.UserService},{type:I.MessagingService},{type:E.UserNamePipe},{type:P.LogService}]}),{addEditModalRef:[{type:o.ViewChild,args:["addEdit",{read:o.ViewContainerRef,static:!0}]}],takeoverModalRef:[{type:o.ViewChild,args:["takeoverTemplate",{read:o.ViewContainerRef,static:!0}]}],confirmModalRef:[{type:o.ViewChild,args:["confirmTemplate",{read:o.ViewContainerRef,static:!0}]}]})},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.EmergencyAccessViewResponse=t.EmergencyAccessTakeoverResponse=t.EmergencyAccessGrantorDetailsResponse=t.EmergencyAccessGranteeDetailsResponse=void 0;var o=n(26),a=n(322),s=function(e){function t(t){var n=e.call(this,t)||this;return n.id=n.getResponseProperty("Id"),n.granteeId=n.getResponseProperty("GranteeId"),n.name=n.getResponseProperty("Name"),n.email=n.getResponseProperty("Email"),n.type=n.getResponseProperty("Type"),n.status=n.getResponseProperty("Status"),n.waitTimeDays=n.getResponseProperty("WaitTimeDays"),n.creationDate=n.getResponseProperty("CreationDate"),n}return i(t,e),t}(o.BaseResponse);t.EmergencyAccessGranteeDetailsResponse=s;var l=function(e){function t(t){var n=e.call(this,t)||this;return n.id=n.getResponseProperty("Id"),n.grantorId=n.getResponseProperty("GrantorId"),n.name=n.getResponseProperty("Name"),n.email=n.getResponseProperty("Email"),n.type=n.getResponseProperty("Type"),n.status=n.getResponseProperty("Status"),n.waitTimeDays=n.getResponseProperty("WaitTimeDays"),n.creationDate=n.getResponseProperty("CreationDate"),n}return i(t,e),t}(o.BaseResponse);t.EmergencyAccessGrantorDetailsResponse=l;var c=function(e){function t(t){var n=e.call(this,t)||this;return n.keyEncrypted=n.getResponseProperty("KeyEncrypted"),n.kdf=n.getResponseProperty("Kdf"),n.kdfIterations=n.getResponseProperty("KdfIterations"),n}return i(t,e),t}(o.BaseResponse);t.EmergencyAccessTakeoverResponse=c;var p=function(e){function t(t){var n=e.call(this,t)||this;n.ciphers=[],n.keyEncrypted=n.getResponseProperty("KeyEncrypted");var r=n.getResponseProperty("Ciphers");return null!=r&&(n.ciphers=r.map((function(e){return new a.CipherResponse(e)}))),n}return i(t,e),t}(o.BaseResponse);t.EmergencyAccessViewResponse=p},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.AttachmentResponse=void 0;var o=function(e){function t(t){var n=e.call(this,t)||this;return n.id=n.getResponseProperty("Id"),n.url=n.getResponseProperty("Url"),n.fileName=n.getResponseProperty("FileName"),n.key=n.getResponseProperty("Key"),n.size=n.getResponseProperty("Size"),n.sizeName=n.getResponseProperty("SizeName"),n}return i(t,e),t}(n(26).BaseResponse);t.AttachmentResponse=o},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"anyOrgsAvailable",{get:function(){return this.availableSponsorshipOrgs.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"moreThanOneOrgAvailable",{get:function(){return this.availableSponsorshipOrgs.length>1},enumerable:!1,configurable:!0}),e.ɵfac=function(t){return new(t||e)(s.ɵɵdirectiveInject(l.UserService),s.ɵɵdirectiveInject(c.ApiService),s.ɵɵdirectiveInject(p.I18nService),s.ɵɵdirectiveInject(u.ToasterService),s.ɵɵdirectiveInject(d.SyncService))},e.ɵcmp=s.ɵɵdefineComponent({type:e,selectors:[["app-sponsored-families"]],decls:11,vars:5,consts:[[1,"page-header"],[4,"ngIf"],[1,"fa","fa-spinner","fa-spin","text-muted",3,"title"],[1,"sr-only"],[1,"inset-list"],["ngNativeValidate","",3,"appApiAction","ngSubmit",4,"ngIf"],["ngNativeValidate","",3,"appApiAction","ngSubmit"],["form",""],["class","form-group col-7",4,"ngIf"],[1,"form-group","col-7"],["for","accountEmail"],["id","accountEmail","inputmode","email","name","sponsorshipEmail","required","",1,"form-control",3,"ngModel","ngModelChange"],["type","submit",1,"btn","btn-primary","btn-submit","mt-4",3,"disabled"],["aria-hidden","true",1,"fa","fa-spinner","fa-spin",3,"title"],["for","availableSponsorshipOrg"],["id","availableSponsorshipOrg","name","Available Sponsorship Organization","required","",1,"form-control",3,"ngModel","ngModelChange"],["value",""],[3,"ngValue",4,"ngFor","ngForOf"],[3,"ngValue"],[1,"border-bottom"],[1,"table","table-hover","table-list"],[4,"ngFor","ngForOf"],["sponsoring-org-row","",3,"sponsoringOrg","sponsorshipRemoved"]],template:function(e,t){1&e&&(s.ɵɵelementStart(0,"div",0),s.ɵɵtext(1," "),s.ɵɵelementStart(2,"h1"),s.ɵɵtext(3),s.ɵɵpipe(4,"i18n"),s.ɵɵelementEnd(),s.ɵɵtext(5," "),s.ɵɵelementEnd(),s.ɵɵtext(6," "),s.ɵɵtemplate(7,g,9,6,"ng-container",1),s.ɵɵtext(8," "),s.ɵɵtemplate(9,I,25,14,"ng-container",1),s.ɵɵtext(10," ")),2&e&&(s.ɵɵadvance(3),s.ɵɵtextInterpolate(s.ɵɵpipeBind1(4,3,"sponsoredFamilies")),s.ɵɵadvance(4),s.ɵɵproperty("ngIf",t.loading),s.ɵɵadvance(2),s.ɵɵproperty("ngIf",!t.loading))},directives:[m.NgIf,f.NgControlStatusGroup,f.NgForm,h.ApiActionDirective,f.DefaultValueAccessor,f.RequiredValidator,f.NgControlStatus,f.NgModel,f.SelectControlValueAccessor,f.NgSelectOption,f.ɵangular_packages_forms_forms_z,m.NgForOf,v.SponsoringOrgRowComponent],pipes:[y.I18nPipe],encapsulation:2}),e}();t.SponsoredFamiliesComponent=E,("undefined"==typeof ngDevMode||ngDevMode)&&s.ɵsetClassMetadata(E,[{type:o.Component,args:[{selector:"app-sponsored-families",templateUrl:"sponsored-families.component.html"}]}],(function(){return[{type:l.UserService},{type:c.ApiService},{type:p.I18nService},{type:u.ToasterService},{type:d.SyncService}]}),null)},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]1?"×"+n.quantity:""," @ ",a.ɵɵpipeBind2(4,5,n.amount,"$")," "),a.ɵɵadvance(4),a.ɵɵtextInterpolate2(" ",a.ɵɵpipeBind2(8,8,n.quantity*n.amount,"$")," /",a.ɵɵpipeBind1(9,11,n.interval)," ")}}function A(e,t){if(1&e&&(a.ɵɵelementStart(0,"div",16),a.ɵɵtext(1," "),a.ɵɵelementStart(2,"strong",17),a.ɵɵtext(3),a.ɵɵpipe(4,"i18n"),a.ɵɵelementEnd(),a.ɵɵtext(5," "),a.ɵɵelementStart(6,"table",18),a.ɵɵtext(7," "),a.ɵɵelementStart(8,"tbody"),a.ɵɵtext(9," "),a.ɵɵtemplate(10,_,11,13,"tr",19),a.ɵɵtext(11," "),a.ɵɵelementEnd(),a.ɵɵtext(12," "),a.ɵɵelementEnd(),a.ɵɵtext(13," "),a.ɵɵelementEnd()),2&e){var n=a.ɵɵnextContext(3);a.ɵɵadvance(3),a.ɵɵtextInterpolate(a.ɵɵpipeBind1(4,2,"details")),a.ɵɵadvance(7),a.ɵɵproperty("ngForOf",n.subscription.items)}}function T(e,t){if(1&e&&(a.ɵɵelementStart(0,"div",10),a.ɵɵtext(1," "),a.ɵɵelementStart(2,"div",11),a.ɵɵtext(3," "),a.ɵɵelementStart(4,"dl"),a.ɵɵtext(5," "),a.ɵɵelementStart(6,"dt"),a.ɵɵtext(7),a.ɵɵpipe(8,"i18n"),a.ɵɵelementEnd(),a.ɵɵtext(9," "),a.ɵɵelementStart(10,"dd"),a.ɵɵtext(11," "),a.ɵɵelementStart(12,"span",12),a.ɵɵtext(13),a.ɵɵelementEnd(),a.ɵɵtext(14," "),a.ɵɵtemplate(15,O,3,3,"span",13),a.ɵɵtext(16," "),a.ɵɵelementEnd(),a.ɵɵtext(17," "),a.ɵɵelementStart(18,"dt"),a.ɵɵtext(19),a.ɵɵpipe(20,"i18n"),a.ɵɵelementEnd(),a.ɵɵtext(21," "),a.ɵɵelementStart(22,"dd"),a.ɵɵtext(23),a.ɵɵpipe(24,"date"),a.ɵɵpipe(25,"currency"),a.ɵɵelementEnd(),a.ɵɵtext(26," "),a.ɵɵelementEnd(),a.ɵɵtext(27," "),a.ɵɵelementEnd(),a.ɵɵtext(28," "),a.ɵɵtemplate(29,A,14,4,"div",14),a.ɵɵtext(30," "),a.ɵɵelementEnd()),2&e){var n=a.ɵɵnextContext(2);a.ɵɵadvance(7),a.ɵɵtextInterpolate(a.ɵɵpipeBind1(8,6,"status")),a.ɵɵadvance(6),a.ɵɵtextInterpolate(n.subscription&&n.subscription.status||"-"),a.ɵɵadvance(2),a.ɵɵproperty("ngIf",n.subscriptionMarkedForCancel),a.ɵɵadvance(4),a.ɵɵtextInterpolate(a.ɵɵpipeBind1(20,8,"nextCharge")),a.ɵɵadvance(4),a.ɵɵtextInterpolate1("",n.nextInvoice?a.ɵɵpipeBind2(24,10,n.nextInvoice.date,"mediumDate")+", "+a.ɵɵpipeBind2(25,13,n.nextInvoice.amount,"$"):"-"," "),a.ɵɵadvance(6),a.ɵɵproperty("ngIf",n.subscription)}}function M(e,t){if(1&e){var n=a.ɵɵgetCurrentView();a.ɵɵelementStart(0,"div",23),a.ɵɵtext(1," "),a.ɵɵelementStart(2,"div",24),a.ɵɵtext(3," "),a.ɵɵelementStart(4,"button",25),a.ɵɵlistener("click",(function(){return a.ɵɵrestoreView(n),a.ɵɵnextContext(3).closeUpdateLicense(!1)})),a.ɵɵpipe(5,"i18n"),a.ɵɵelementStart(6,"span",26),a.ɵɵtext(7,"×"),a.ɵɵelementEnd(),a.ɵɵelementEnd(),a.ɵɵtext(8," "),a.ɵɵelementStart(9,"h3",27),a.ɵɵtext(10),a.ɵɵpipe(11,"i18n"),a.ɵɵelementEnd(),a.ɵɵtext(12," "),a.ɵɵelementStart(13,"app-update-license",28),a.ɵɵlistener("onUpdated",(function(){return a.ɵɵrestoreView(n),a.ɵɵnextContext(3).closeUpdateLicense(!0)}))("onCanceled",(function(){return a.ɵɵrestoreView(n),a.ɵɵnextContext(3).closeUpdateLicense(!1)})),a.ɵɵtext(14," "),a.ɵɵelementEnd(),a.ɵɵtext(15," "),a.ɵɵelementEnd(),a.ɵɵtext(16," "),a.ɵɵelementEnd()}2&e&&(a.ɵɵadvance(4),a.ɵɵpropertyInterpolate("appA11yTitle",a.ɵɵpipeBind1(5,2,"cancel")),a.ɵɵadvance(6),a.ɵɵtextInterpolate(a.ɵɵpipeBind1(11,4,"updateLicense")))}function D(e,t){if(1&e){var n=a.ɵɵgetCurrentView();a.ɵɵelementContainerStart(0),a.ɵɵtext(1," "),a.ɵɵelementStart(2,"div"),a.ɵɵtext(3," "),a.ɵɵelementStart(4,"button",20),a.ɵɵlistener("click",(function(){return a.ɵɵrestoreView(n),a.ɵɵnextContext(2).updateLicense()})),a.ɵɵtext(5),a.ɵɵpipe(6,"i18n"),a.ɵɵelementEnd(),a.ɵɵtext(7," "),a.ɵɵelementStart(8,"a",21),a.ɵɵtext(9),a.ɵɵpipe(10,"i18n"),a.ɵɵelementEnd(),a.ɵɵtext(11," "),a.ɵɵelementEnd(),a.ɵɵtext(12," "),a.ɵɵtemplate(13,M,17,6,"div",22),a.ɵɵtext(14," "),a.ɵɵelementContainerEnd()}if(2&e){var r=a.ɵɵnextContext(2);a.ɵɵadvance(5),a.ɵɵtextInterpolate1(" ",a.ɵɵpipeBind1(6,3,"updateLicense")," "),a.ɵɵadvance(4),a.ɵɵtextInterpolate1(" ",a.ɵɵpipeBind1(10,5,"manageSubscription")," "),a.ɵɵadvance(4),a.ɵɵproperty("ngIf",r.showUpdateLicense)}}function R(e,t){if(1&e){var n=a.ɵɵgetCurrentView();a.ɵɵelementStart(0,"button",20),a.ɵɵlistener("click",(function(){return a.ɵɵrestoreView(n),a.ɵɵnextContext(3).downloadLicense()})),a.ɵɵtext(1),a.ɵɵpipe(2,"i18n"),a.ɵɵelementEnd()}2&e&&(a.ɵɵadvance(1),a.ɵɵtextInterpolate1(" ",a.ɵɵpipeBind1(2,1,"downloadLicense")," "))}function B(e,t){if(1&e){var n=a.ɵɵgetCurrentView();a.ɵɵelementStart(0,"button",35,36),a.ɵɵlistener("click",(function(){return a.ɵɵrestoreView(n),a.ɵɵnextContext(3).cancel()})),a.ɵɵtext(2," "),a.ɵɵelement(3,"i",9),a.ɵɵpipe(4,"i18n"),a.ɵɵtext(5," "),a.ɵɵelementStart(6,"span"),a.ɵɵtext(7),a.ɵɵpipe(8,"i18n"),a.ɵɵelementEnd(),a.ɵɵtext(9," "),a.ɵɵelementEnd()}if(2&e){var r=a.ɵɵreference(1),i=a.ɵɵnextContext(3);a.ɵɵproperty("appApiAction",i.cancelPromise)("disabled",r.loading),a.ɵɵadvance(3),a.ɵɵpropertyInterpolate("title",a.ɵɵpipeBind1(4,4,"loading")),a.ɵɵadvance(4),a.ɵɵtextInterpolate(a.ɵɵpipeBind1(8,6,"cancelSubscription"))}}function j(e,t){if(1&e){var n=a.ɵɵgetCurrentView();a.ɵɵelementStart(0,"div",29),a.ɵɵtext(1," "),a.ɵɵelementStart(2,"button",20),a.ɵɵlistener("click",(function(){return a.ɵɵrestoreView(n),a.ɵɵnextContext(4).adjustStorage(!0)})),a.ɵɵtext(3),a.ɵɵpipe(4,"i18n"),a.ɵɵelementEnd(),a.ɵɵtext(5," "),a.ɵɵelementStart(6,"button",40),a.ɵɵlistener("click",(function(){return a.ɵɵrestoreView(n),a.ɵɵnextContext(4).adjustStorage(!1)})),a.ɵɵtext(7),a.ɵɵpipe(8,"i18n"),a.ɵɵelementEnd(),a.ɵɵtext(9," "),a.ɵɵelementEnd()}2&e&&(a.ɵɵadvance(3),a.ɵɵtextInterpolate1(" ",a.ɵɵpipeBind1(4,2,"addStorage")," "),a.ɵɵadvance(4),a.ɵɵtextInterpolate1(" ",a.ɵɵpipeBind1(8,4,"removeStorage")," "))}function U(e,t){if(1&e){var n=a.ɵɵgetCurrentView();a.ɵɵelementStart(0,"app-adjust-storage",41),a.ɵɵlistener("onAdjusted",(function(){return a.ɵɵrestoreView(n),a.ɵɵnextContext(4).closeStorage(!0)}))("onCanceled",(function(){return a.ɵɵrestoreView(n),a.ɵɵnextContext(4).closeStorage(!1)})),a.ɵɵelementEnd()}if(2&e){var r=a.ɵɵnextContext(4);a.ɵɵproperty("storageGbPrice",4)("add",r.adjustStorageAdd)}}function V(e,t){if(1&e&&(a.ɵɵelementContainerStart(0),a.ɵɵtext(1," "),a.ɵɵelementStart(2,"div",37),a.ɵɵtext(3," "),a.ɵɵtemplate(4,j,10,6,"div",38),a.ɵɵtext(5," "),a.ɵɵtemplate(6,U,1,2,"app-adjust-storage",39),a.ɵɵtext(7," "),a.ɵɵelementEnd(),a.ɵɵtext(8," "),a.ɵɵelementContainerEnd()),2&e){var n=a.ɵɵnextContext(3);a.ɵɵadvance(4),a.ɵɵproperty("ngIf",!n.showAdjustStorage),a.ɵɵadvance(2),a.ɵɵproperty("ngIf",n.showAdjustStorage)}}var F=function(e){return{width:e}};function N(e,t){if(1&e&&(a.ɵɵelementContainerStart(0),a.ɵɵtext(1," "),a.ɵɵelementStart(2,"div",29),a.ɵɵtext(3," "),a.ɵɵtemplate(4,R,3,3,"button",30),a.ɵɵtext(5," "),a.ɵɵtemplate(6,B,10,8,"button",31),a.ɵɵtext(7," "),a.ɵɵelementEnd(),a.ɵɵtext(8," "),a.ɵɵelementStart(9,"h2",32),a.ɵɵtext(10),a.ɵɵpipe(11,"i18n"),a.ɵɵelementEnd(),a.ɵɵtext(12," "),a.ɵɵelementStart(13,"p"),a.ɵɵtext(14),a.ɵɵpipe(15,"i18n"),a.ɵɵelementEnd(),a.ɵɵtext(16," "),a.ɵɵelementStart(17,"div",33),a.ɵɵtext(18," "),a.ɵɵelementStart(19,"div",34),a.ɵɵtext(20),a.ɵɵpipe(21,"percent"),a.ɵɵelementEnd(),a.ɵɵtext(22," "),a.ɵɵelementEnd(),a.ɵɵtext(23," "),a.ɵɵtemplate(24,V,9,2,"ng-container",1),a.ɵɵtext(25," "),a.ɵɵelementContainerEnd()),2&e){var n=a.ɵɵnextContext(2);a.ɵɵadvance(4),a.ɵɵproperty("ngIf",!n.subscription||!n.subscription.cancelled),a.ɵɵadvance(2),a.ɵɵproperty("ngIf",n.subscription&&!n.subscription.cancelled&&!n.subscriptionMarkedForCancel),a.ɵɵadvance(4),a.ɵɵtextInterpolate(a.ɵɵpipeBind1(11,8,"storage")),a.ɵɵadvance(4),a.ɵɵtextInterpolate(a.ɵɵpipeBind3(15,10,"subscriptionStorage",n.sub.maxStorageGb||0,n.sub.storageName||"0 MB")),a.ɵɵadvance(5),a.ɵɵproperty("ngStyle",a.ɵɵpureFunction1(16,F,n.storageProgressWidth+"%")),a.ɵɵattribute("aria-valuenow",n.storagePercentage),a.ɵɵadvance(1),a.ɵɵtextInterpolate1(" ",a.ɵɵpipeBind1(21,14,n.storagePercentage/100),""),a.ɵɵadvance(4),a.ɵɵproperty("ngIf",n.subscription&&!n.subscription.cancelled&&!n.subscriptionMarkedForCancel)}}function z(e,t){if(1&e&&(a.ɵɵelementContainerStart(0),a.ɵɵtext(1," "),a.ɵɵtemplate(2,C,4,6,"app-callout",4),a.ɵɵtext(3," "),a.ɵɵtemplate(4,I,18,14,"app-callout",4),a.ɵɵtext(5," "),a.ɵɵtemplate(6,k,10,5,"dl",1),a.ɵɵtext(7," "),a.ɵɵtemplate(8,T,31,16,"div",5),a.ɵɵtext(9," "),a.ɵɵtemplate(10,D,15,7,"ng-container",1),a.ɵɵtext(11," "),a.ɵɵtemplate(12,N,26,18,"ng-container",1),a.ɵɵtext(13," "),a.ɵɵelementContainerEnd()),2&e){var n=a.ɵɵnextContext();a.ɵɵadvance(2),a.ɵɵproperty("ngIf",n.subscription&&n.subscription.cancelled),a.ɵɵadvance(2),a.ɵɵproperty("ngIf",n.subscriptionMarkedForCancel),a.ɵɵadvance(2),a.ɵɵproperty("ngIf",n.selfHosted),a.ɵɵadvance(2),a.ɵɵproperty("ngIf",!n.selfHosted),a.ɵɵadvance(2),a.ɵɵproperty("ngIf",n.selfHosted),a.ɵɵadvance(2),a.ɵɵproperty("ngIf",!n.selfHosted)}}var L=function(){function e(e,t,n,r,i,o,a){this.tokenService=e,this.apiService=t,this.platformUtilsService=n,this.i18nService=r,this.toasterService=i,this.router=o,this.logService=a,this.loading=!1,this.firstLoaded=!1,this.adjustStorageAdd=!0,this.showAdjustStorage=!1,this.showUpdateLicense=!1,this.selfHosted=!1,this.selfHosted=n.isSelfHost()}return e.prototype.ngOnInit=function(){return r(this,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,this.load()];case 1:return e.sent(),this.firstLoaded=!0,[2]}}))}))},e.prototype.load=function(){return r(this,void 0,void 0,(function(){var e;return i(this,(function(t){switch(t.label){case 0:return this.loading?[2]:this.tokenService.getPremium()?(this.loading=!0,e=this,[4,this.apiService.getUserSubscription()]):[3,2];case 1:return e.sub=t.sent(),[3,3];case 2:return this.router.navigate(["/settings/premium"]),[2];case 3:return this.loading=!1,[2]}}))}))},e.prototype.reinstate=function(){return r(this,void 0,void 0,(function(){var e;return i(this,(function(t){switch(t.label){case 0:return this.loading?[2]:this.usingInAppPurchase?(this.platformUtilsService.showDialog(this.i18nService.t("manageSubscriptionFromStore"),this.i18nService.t("cancelSubscription"),null,null,"warning"),[2]):[4,this.platformUtilsService.showDialog(this.i18nService.t("reinstateConfirmation"),this.i18nService.t("reinstateSubscription"),this.i18nService.t("yes"),this.i18nService.t("cancel"))];case 1:if(!t.sent())return[2];t.label=2;case 2:return t.trys.push([2,4,,5]),this.reinstatePromise=this.apiService.postReinstatePremium(),[4,this.reinstatePromise];case 3:return t.sent(),this.toasterService.popAsync("success",null,this.i18nService.t("reinstated")),this.load(),[3,5];case 4:return e=t.sent(),this.logService.error(e),[3,5];case 5:return[2]}}))}))},e.prototype.cancel=function(){return r(this,void 0,void 0,(function(){var e;return i(this,(function(t){switch(t.label){case 0:return this.loading?[2]:this.usingInAppPurchase?(this.platformUtilsService.showDialog(this.i18nService.t("manageSubscriptionFromStore"),this.i18nService.t("cancelSubscription"),null,null,"warning"),[2]):[4,this.platformUtilsService.showDialog(this.i18nService.t("cancelConfirmation"),this.i18nService.t("cancelSubscription"),this.i18nService.t("yes"),this.i18nService.t("no"),"warning")];case 1:if(!t.sent())return[2];t.label=2;case 2:return t.trys.push([2,4,,5]),this.cancelPromise=this.apiService.postCancelPremium(),[4,this.cancelPromise];case 3:return t.sent(),this.toasterService.popAsync("success",null,this.i18nService.t("canceledSubscription")),this.load(),[3,5];case 4:return e=t.sent(),this.logService.error(e),[3,5];case 5:return[2]}}))}))},e.prototype.downloadLicense=function(){if(!this.loading){var e=JSON.stringify(this.sub.license,null,2);this.platformUtilsService.saveFile(window,e,null,"bitwarden_premium_license.json")}},e.prototype.updateLicense=function(){this.loading||(this.showUpdateLicense=!0)},e.prototype.closeUpdateLicense=function(e){this.showUpdateLicense=!1,e&&this.load()},e.prototype.adjustStorage=function(e){this.usingInAppPurchase?this.platformUtilsService.showDialog(this.i18nService.t("cannotPerformInAppPurchase"),this.i18nService.t(e?"addStorage":"removeStorage"),null,null,"warning"):(this.adjustStorageAdd=e,this.showAdjustStorage=!0)},e.prototype.closeStorage=function(e){this.showAdjustStorage=!1,e&&this.load()},Object.defineProperty(e.prototype,"subscriptionMarkedForCancel",{get:function(){return null!=this.subscription&&!this.subscription.cancelled&&this.subscription.cancelAtEndDate},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"subscription",{get:function(){return null!=this.sub?this.sub.subscription:null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"nextInvoice",{get:function(){return null!=this.sub?this.sub.upcomingInvoice:null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"storagePercentage",{get:function(){return null!=this.sub&&this.sub.maxStorageGb?+(this.sub.storageGb/this.sub.maxStorageGb*100).toFixed(2):0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"storageProgressWidth",{get:function(){return this.storagePercentage<5?5:0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"usingInAppPurchase",{get:function(){return null!=this.sub&&this.sub.usingInAppPurchase},enumerable:!1,configurable:!0}),e.ɵfac=function(t){return new(t||e)(a.ɵɵdirectiveInject(s.TokenService),a.ɵɵdirectiveInject(l.ApiService),a.ɵɵdirectiveInject(c.PlatformUtilsService),a.ɵɵdirectiveInject(p.I18nService),a.ɵɵdirectiveInject(u.ToasterService),a.ɵɵdirectiveInject(d.Router),a.ɵɵdirectiveInject(m.LogService))},e.ɵcmp=a.ɵɵdefineComponent({type:e,selectors:[["app-user-subscription"]],decls:13,vars:6,consts:[[1,"page-header"],[4,"ngIf"],["aria-hidden","true",1,"fa","fa-spinner","fa-spin","text-muted",3,"title"],[1,"sr-only"],["type","warning",3,"title",4,"ngIf"],["class","row",4,"ngIf"],["type","warning",3,"title"],["type","button",1,"btn","btn-outline-secondary","btn-submit",3,"appApiAction","disabled","click"],["reinstateBtn",""],["aria-hidden","true",1,"fa","fa-spinner","fa-spin",3,"title"],[1,"row"],[1,"col-4"],[1,"text-capitalize"],["class","badge badge-warning",4,"ngIf"],["class","col-8",4,"ngIf"],[1,"badge","badge-warning"],[1,"col-8"],[1,"d-block","mb-1"],[1,"table"],[4,"ngFor","ngForOf"],["type","button",1,"btn","btn-outline-secondary",3,"click"],["href","https://vault.bitwarden.com/#/settings/subscription","target","_blank","rel","noopener",1,"btn","btn-outline-secondary"],["class","card mt-3",4,"ngIf"],[1,"card","mt-3"],[1,"card-body"],["type","button",1,"close",3,"appA11yTitle","click"],["aria-hidden","true"],[1,"card-body-header"],[3,"onUpdated","onCanceled"],[1,"d-flex"],["type","button","class","btn btn-outline-secondary",3,"click",4,"ngIf"],["type","button","class","btn btn-outline-danger btn-submit ml-auto",3,"appApiAction","disabled","click",4,"ngIf"],[1,"spaced-header"],[1,"progress"],["role","progressbar","aria-valuemin","0","aria-valuemax","100",1,"progress-bar","bg-success",3,"ngStyle"],["type","button",1,"btn","btn-outline-danger","btn-submit","ml-auto",3,"appApiAction","disabled","click"],["cancelBtn",""],[1,"mt-3"],["class","d-flex",4,"ngIf"],[3,"storageGbPrice","add","onAdjusted","onCanceled",4,"ngIf"],["type","button",1,"ml-1","btn","btn-outline-secondary",3,"click"],[3,"storageGbPrice","add","onAdjusted","onCanceled"]],template:function(e,t){1&e&&(a.ɵɵelementStart(0,"div",0),a.ɵɵtext(1," "),a.ɵɵelementStart(2,"h1"),a.ɵɵtext(3),a.ɵɵpipe(4,"i18n"),a.ɵɵtemplate(5,b,9,6,"small",1),a.ɵɵtext(6," "),a.ɵɵelementEnd(),a.ɵɵtext(7," "),a.ɵɵelementEnd(),a.ɵɵtext(8," "),a.ɵɵtemplate(9,w,9,6,"ng-container",1),a.ɵɵtext(10," "),a.ɵɵtemplate(11,z,14,6,"ng-container",1),a.ɵɵtext(12," ")),2&e&&(a.ɵɵadvance(3),a.ɵɵtextInterpolate1(" ",a.ɵɵpipeBind1(4,4,"premiumMembership")," "),a.ɵɵadvance(2),a.ɵɵproperty("ngIf",t.firstLoaded&&t.loading),a.ɵɵadvance(4),a.ɵɵproperty("ngIf",!t.firstLoaded&&t.loading),a.ɵɵadvance(2),a.ɵɵproperty("ngIf",t.sub))},directives:[f.NgIf,h.CalloutComponent,v.ApiActionDirective,f.NgForOf,y.A11yTitleDirective,g.UpdateLicenseComponent,f.NgStyle,x.AdjustStorageComponent],pipes:[S.I18nPipe,f.DatePipe,f.CurrencyPipe,f.PercentPipe],encapsulation:2}),e}();t.UserSubscriptionComponent=L,("undefined"==typeof ngDevMode||ngDevMode)&&a.ɵsetClassMetadata(L,[{type:o.Component,args:[{selector:"app-user-subscription",templateUrl:"user-subscription.component.html"}]}],(function(){return[{type:s.TokenService},{type:l.ApiService},{type:c.PlatformUtilsService},{type:p.I18nService},{type:u.ToasterService},{type:d.Router},{type:m.LogService}]}),null)},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0,[4,this.userService.getAllOrganizations()];case 5:return a=c.sent(),this.showRedeemSponsorship=a.some((function(e){return e.familySponsorshipAvailable}))&&!a.some((function(e){return null!=e.familySponsorshipFriendlyName})),[4,Promise.all([this.groupingsComponent.load(),this.organizationsComponent.load()])];case 6:return c.sent(),null!=e?[3,8]:(this.groupingsComponent.selectedAll=!0,[4,this.ciphersComponent.reload()]);case 7:return c.sent(),[3,20];case 8:return e.deleted?(this.groupingsComponent.selectedTrash=!0,[4,this.filterDeleted()]):[3,10];case 9:return c.sent(),[3,20];case 10:return e.favorites?(this.groupingsComponent.selectedFavorites=!0,[4,this.filterFavorites()]):[3,12];case 11:return c.sent(),[3,20];case 12:return e.type?(s=parseInt(e.type,null),this.groupingsComponent.selectedType=s,[4,this.filterCipherType(s)]):[3,14];case 13:return c.sent(),[3,20];case 14:return e.folderId?(this.groupingsComponent.selectedFolder=!0,this.groupingsComponent.selectedFolderId=e.folderId,[4,this.filterFolder(e.folderId)]):[3,16];case 15:return c.sent(),[3,20];case 16:return e.collectionId?(this.groupingsComponent.selectedCollectionId=e.collectionId,[4,this.filterCollection(e.collectionId)]):[3,18];case 17:return c.sent(),[3,20];case 18:return this.groupingsComponent.selectedAll=!0,[4,this.ciphersComponent.reload()];case 19:c.sent(),c.label=20;case 20:return this.broadcasterService.subscribe(oe,(function(e){l.ngZone.run((function(){return r(l,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return"syncCompleted"===e.command?[3,1]:[3,4];case 1:return e.successfully?[4,Promise.all([this.groupingsComponent.load(),this.organizationsComponent.load(),this.ciphersComponent.load(this.ciphersComponent.filter)])]:[3,3];case 2:t.sent(),this.changeDetectorRef.detectChanges(),t.label=3;case 3:return[3,4];case 4:return[2]}}))}))}))})),[2]}}))}))})),[2]}}))}))},e.prototype.ngOnDestroy=function(){this.broadcasterService.unsubscribe(oe)},e.prototype.clearGroupingFilters=function(){return r(this,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return this.ciphersComponent.showAddNew=!0,this.groupingsComponent.searchPlaceholder=this.i18nService.t("searchVault"),[4,this.ciphersComponent.reload()];case 1:return e.sent(),this.clearFilters(),this.go(),[2]}}))}))},e.prototype.filterFavorites=function(){return r(this,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return this.ciphersComponent.showAddNew=!0,this.groupingsComponent.searchPlaceholder=this.i18nService.t("searchFavorites"),[4,this.ciphersComponent.reload((function(e){return e.favorite}))];case 1:return e.sent(),this.clearFilters(),this.favorites=!0,this.go(),[2]}}))}))},e.prototype.filterDeleted=function(){return r(this,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return this.ciphersComponent.showAddNew=!1,this.ciphersComponent.deleted=!0,this.groupingsComponent.searchPlaceholder=this.i18nService.t("searchTrash"),[4,this.ciphersComponent.reload(null,!0)];case 1:return e.sent(),this.clearFilters(),this.deleted=!0,this.go(),[2]}}))}))},e.prototype.filterCipherType=function(e){return r(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return this.ciphersComponent.showAddNew=!0,this.groupingsComponent.searchPlaceholder=this.i18nService.t("searchType"),[4,this.ciphersComponent.reload((function(t){return t.type===e}))];case 1:return t.sent(),this.clearFilters(),this.type=e,this.go(),[2]}}))}))},e.prototype.filterFolder=function(e){return r(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return this.ciphersComponent.showAddNew=!0,e="none"===e?null:e,this.groupingsComponent.searchPlaceholder=this.i18nService.t("searchFolder"),[4,this.ciphersComponent.reload((function(t){return t.folderId===e}))];case 1:return t.sent(),this.clearFilters(),this.folderId=null==e?"none":e,this.go(),[2]}}))}))},e.prototype.filterCollection=function(e){return r(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return this.ciphersComponent.showAddNew=!0,this.groupingsComponent.searchPlaceholder=this.i18nService.t("searchCollection"),[4,this.ciphersComponent.reload((function(t){return null!=t.collectionIds&&t.collectionIds.indexOf(e)>-1}))];case 1:return t.sent(),this.clearFilters(),this.collectionId=e,this.go(),[2]}}))}))},e.prototype.filterSearchText=function(e){this.ciphersComponent.searchText=e,this.ciphersComponent.search(200)},e.prototype.editCipherAttachments=function(e){return r(this,void 0,void 0,(function(){var t,n,o,a=this;return i(this,(function(s){switch(s.label){case 0:return[4,this.userService.canAccessPremium()];case 1:return t=s.sent(),null!=e.organizationId||t?[3,2]:(this.messagingService.send("premiumRequired"),[2]);case 2:return null==e.organizationId?[3,4]:[4,this.userService.getOrganization(e.organizationId)];case 3:if(null!=(n=s.sent())&&(null==n.maxStorageGb||0===n.maxStorageGb))return this.messagingService.send("upgradeOrganization",{organizationId:e.organizationId}),[2];s.label=4;case 4:return o=!1,[4,this.modalService.openViewRef(p.AttachmentsComponent,this.attachmentsModalRef,(function(t){t.cipherId=e.id,t.onUploadedAttachment.subscribe((function(){return o=!0})),t.onDeletedAttachment.subscribe((function(){return o=!0})),t.onReuploadedAttachment.subscribe((function(){return o=!0}))}))];case 5:return s.sent()[0].onClosed.subscribe((function(){return r(a,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return o?[4,this.ciphersComponent.refresh()]:[3,2];case 1:e.sent(),e.label=2;case 2:return o=!1,[2]}}))}))})),[2]}}))}))},e.prototype.shareCipher=function(e){return r(this,void 0,void 0,(function(){var t,n=this;return i(this,(function(o){switch(o.label){case 0:return[4,this.modalService.openViewRef(h.ShareComponent,this.shareModalRef,(function(o){o.cipherId=e.id,o.onSharedCipher.subscribe((function(){return r(n,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return t.close(),[4,this.ciphersComponent.refresh()];case 1:return e.sent(),[2]}}))}))}))}))];case 1:return t=o.sent()[0],[2]}}))}))},e.prototype.editCipherCollections=function(e){return r(this,void 0,void 0,(function(){var t,n=this;return i(this,(function(o){switch(o.label){case 0:return[4,this.modalService.openViewRef(d.CollectionsComponent,this.collectionsModalRef,(function(o){o.cipherId=e.id,o.onSavedCollections.subscribe((function(){return r(n,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return t.close(),[4,this.ciphersComponent.refresh()];case 1:return e.sent(),[2]}}))}))}))}))];case 1:return t=o.sent()[0],[2]}}))}))},e.prototype.addFolder=function(){return r(this,void 0,void 0,(function(){var e,t=this;return i(this,(function(n){switch(n.label){case 0:return[4,this.modalService.openViewRef(m.FolderAddEditComponent,this.folderAddEditModalRef,(function(n){n.folderId=null,n.onSavedFolder.subscribe((function(){return r(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return e.close(),[4,this.groupingsComponent.loadFolders()];case 1:return t.sent(),[2]}}))}))}))}))];case 1:return e=n.sent()[0],[2]}}))}))},e.prototype.editFolder=function(e){return r(this,void 0,void 0,(function(){var t,n=this;return i(this,(function(o){switch(o.label){case 0:return[4,this.modalService.openViewRef(m.FolderAddEditComponent,this.folderAddEditModalRef,(function(o){o.folderId=e,o.onSavedFolder.subscribe((function(){return r(n,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return t.close(),[4,this.groupingsComponent.loadFolders()];case 1:return e.sent(),[2]}}))}))})),o.onDeletedFolder.subscribe((function(){return r(n,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return t.close(),[4,this.groupingsComponent.loadFolders()];case 1:return e.sent(),[4,this.filterFolder("none")];case 2:return e.sent(),this.groupingsComponent.selectedFolderId=null,[2]}}))}))}))}))];case 1:return t=o.sent()[0],[2]}}))}))},e.prototype.addCipher=function(){return r(this,void 0,void 0,(function(){var e,t,n=this;return i(this,(function(r){switch(r.label){case 0:return[4,this.editCipher(null)];case 1:return(e=r.sent()).type=this.type,e.folderId="none"===this.folderId?null:this.folderId,null!=this.collectionId&&(t=this.groupingsComponent.collections.filter((function(e){return e.id===n.collectionId}))).length>0&&(e.organizationId=t[0].organizationId,e.collectionIds=[this.collectionId]),[2]}}))}))},e.prototype.editCipher=function(e){return r(this,void 0,void 0,(function(){var t,n,o=this;return i(this,(function(a){switch(a.label){case 0:return[4,this.modalService.openViewRef(c.AddEditComponent,this.cipherAddEditModalRef,(function(t){t.cipherId=null==e?null:e.id,t.onSavedCipher.subscribe((function(e){return r(o,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return n.close(),[4,this.ciphersComponent.refresh()];case 1:return e.sent(),[2]}}))}))})),t.onDeletedCipher.subscribe((function(e){return r(o,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return n.close(),[4,this.ciphersComponent.refresh()];case 1:return e.sent(),[2]}}))}))})),t.onRestoredCipher.subscribe((function(e){return r(o,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return n.close(),[4,this.ciphersComponent.refresh()];case 1:return e.sent(),[2]}}))}))}))}))];case 1:return t=a.sent(),n=t[0],[2,t[1]]}}))}))},e.prototype.cloneCipher=function(e){return r(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.editCipher(e)];case 1:return t.sent().cloneMode=!0,[2]}}))}))},e.prototype.updateKey=function(){return r(this,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,this.modalService.openViewRef(l.UpdateKeyComponent,this.updateKeyModalRef)];case 1:return e.sent(),[2]}}))}))},e.prototype.clearFilters=function(){this.folderId=null,this.collectionId=null,this.favorites=!1,this.type=null,this.deleted=!1},e.prototype.go=function(e){void 0===e&&(e=null),null==e&&(e={favorites:!!this.favorites||null,type:this.type,folderId:this.folderId,collectionId:this.collectionId,deleted:!!this.deleted||null}),this.router.navigate([],{relativeTo:this.route,queryParams:e,replaceUrl:!0})},e.ɵfac=function(t){return new(t||e)(v.ɵɵdirectiveInject(y.SyncService),v.ɵɵdirectiveInject(g.ActivatedRoute),v.ɵɵdirectiveInject(g.Router),v.ɵɵdirectiveInject(v.ChangeDetectorRef),v.ɵɵdirectiveInject(x.I18nService),v.ɵɵdirectiveInject(S.ModalService),v.ɵɵdirectiveInject(b.TokenService),v.ɵɵdirectiveInject(w.CryptoService),v.ɵɵdirectiveInject(C.MessagingService),v.ɵɵdirectiveInject(I.UserService),v.ɵɵdirectiveInject(E.PlatformUtilsService),v.ɵɵdirectiveInject(P.BroadcasterService),v.ɵɵdirectiveInject(v.NgZone))},e.ɵcmp=v.ɵɵdefineComponent({type:e,selectors:[["app-vault"]],viewQuery:function(e,t){if(1&e&&(v.ɵɵviewQuery(f.GroupingsComponent,3),v.ɵɵviewQuery(u.CiphersComponent,3),v.ɵɵviewQuery(s.OrganizationsComponent,3),v.ɵɵviewQuery(V,3,o.ViewContainerRef),v.ɵɵviewQuery(F,3,o.ViewContainerRef),v.ɵɵviewQuery(N,3,o.ViewContainerRef),v.ɵɵviewQuery(z,3,o.ViewContainerRef),v.ɵɵviewQuery(L,3,o.ViewContainerRef),v.ɵɵviewQuery(K,3,o.ViewContainerRef)),2&e){var n=void 0;v.ɵɵqueryRefresh(n=v.ɵɵloadQuery())&&(t.groupingsComponent=n.first),v.ɵɵqueryRefresh(n=v.ɵɵloadQuery())&&(t.ciphersComponent=n.first),v.ɵɵqueryRefresh(n=v.ɵɵloadQuery())&&(t.organizationsComponent=n.first),v.ɵɵqueryRefresh(n=v.ɵɵloadQuery())&&(t.attachmentsModalRef=n.first),v.ɵɵqueryRefresh(n=v.ɵɵloadQuery())&&(t.folderAddEditModalRef=n.first),v.ɵɵqueryRefresh(n=v.ɵɵloadQuery())&&(t.cipherAddEditModalRef=n.first),v.ɵɵqueryRefresh(n=v.ɵɵloadQuery())&&(t.shareModalRef=n.first),v.ɵɵqueryRefresh(n=v.ɵɵloadQuery())&&(t.collectionsModalRef=n.first),v.ɵɵqueryRefresh(n=v.ɵɵloadQuery())&&(t.updateKeyModalRef=n.first)}},decls:92,vars:22,consts:[[1,"container","page-content"],[1,"row"],[1,"col-3"],[3,"onAllClicked","onFavoritesClicked","onCipherTypeClicked","onFolderClicked","onAddFolder","onEditFolder","onCollectionClicked","onSearchTextChanged","onTrashClicked"],[1,"col-6"],[1,"page-header","d-flex"],[3,"appApiAction"],["actionSpinner",""],[4,"ngIf"],[1,"ml-auto","d-flex"],[3,"ciphersComponent","deleted"],["type","button","class","btn btn-outline-primary btn-sm",3,"click",4,"ngIf"],["type","warning","icon","fa-warning",4,"ngIf"],[3,"onCipherClicked","onAttachmentsClicked","onAddCipher","onShareClicked","onCollectionsClicked","onCloneClicked"],["class","card border-warning mb-4",4,"ngIf"],["class","d-block mb-4",4,"ngIf"],["class","card border-success mb-4",4,"ngIf"],[1,"card","mb-4"],[1,"card-header","d-flex"],["href","https://help.bitwarden.com/article/what-is-an-organization/","target","_blank","rel","noopener",1,"ml-auto",3,"appA11yTitle"],["aria-hidden","true",1,"fa","fa-question-circle-o"],[1,"card-body"],[3,"vault"],["class","card mt-4",4,"ngIf"],["attachments",""],["folderAddEdit",""],["cipherAddEdit",""],["share",""],["collections",""],["updateKeyTemplate",""],["aria-hidden","true",1,"fa","fa-spinner","fa-spin","text-muted",3,"title"],[1,"sr-only"],["type","button",1,"btn","btn-outline-primary","btn-sm",3,"click"],["aria-hidden","true",1,"fa","fa-plus","fa-fw"],["type","warning","icon","fa-warning"],[1,"card","border-warning","mb-4"],[1,"card-header","bg-warning","text-white"],["aria-hidden","true",1,"fa","fa-warning","fa-fw"],["type","button",1,"btn","btn-block","btn-outline-secondary",3,"click"],[1,"d-block","mb-4"],["target","_blank","href","https://browser-update.org/update-browser.html","rel","noopener",1,"btn","btn-block","btn-outline-secondary"],[1,"card","border-success","mb-4"],[1,"card-header","bg-success","text-white"],["aria-hidden","true",1,"fa","fa-star","fa-fw"],["routerLink","/settings/premium",1,"btn","btn-block","btn-outline-secondary"],["routerLink","/settings/sponsored-families",1,"btn","btn-block","btn-outline-secondary"],[1,"card","mt-4"],["href","https://bitwarden.com/help/article/about-providers/","target","_blank","rel","noopener",1,"ml-auto",3,"appA11yTitle"],["vault","true"]],template:function(e,t){if(1&e&&(v.ɵɵelementStart(0,"div",0),v.ɵɵtext(1," "),v.ɵɵelementStart(2,"div",1),v.ɵɵtext(3," "),v.ɵɵelementStart(4,"div",2),v.ɵɵtext(5," "),v.ɵɵelementStart(6,"app-vault-groupings",3),v.ɵɵlistener("onAllClicked",(function(){return t.clearGroupingFilters()}))("onFavoritesClicked",(function(){return t.filterFavorites()}))("onCipherTypeClicked",(function(e){return t.filterCipherType(e)}))("onFolderClicked",(function(e){return t.filterFolder(e.id)}))("onAddFolder",(function(){return t.addFolder()}))("onEditFolder",(function(e){return t.editFolder(e.id)}))("onCollectionClicked",(function(e){return t.filterCollection(e.id)}))("onSearchTextChanged",(function(e){return t.filterSearchText(e)}))("onTrashClicked",(function(){return t.filterDeleted()})),v.ɵɵtext(7," "),v.ɵɵelementEnd(),v.ɵɵtext(8," "),v.ɵɵelementEnd(),v.ɵɵtext(9," "),v.ɵɵelementStart(10,"div",4),v.ɵɵtext(11," "),v.ɵɵelementStart(12,"div",5),v.ɵɵtext(13," "),v.ɵɵelementStart(14,"h1"),v.ɵɵtext(15),v.ɵɵpipe(16,"i18n"),v.ɵɵelementStart(17,"small",6,7),v.ɵɵtext(19," "),v.ɵɵtemplate(20,q,9,6,"ng-container",8),v.ɵɵtext(21," "),v.ɵɵelementEnd(),v.ɵɵtext(22," "),v.ɵɵelementEnd(),v.ɵɵtext(23," "),v.ɵɵelementStart(24,"div",9),v.ɵɵtext(25," "),v.ɵɵelementStart(26,"app-vault-bulk-actions",10),v.ɵɵtext(27," "),v.ɵɵelementEnd(),v.ɵɵtext(28," "),v.ɵɵtemplate(29,G,5,3,"button",11),v.ɵɵtext(30," "),v.ɵɵelementEnd(),v.ɵɵtext(31," "),v.ɵɵelementEnd(),v.ɵɵtext(32," "),v.ɵɵtemplate(33,W,2,1,"app-callout",12),v.ɵɵtext(34," "),v.ɵɵelementStart(35,"app-vault-ciphers",13),v.ɵɵlistener("onCipherClicked",(function(e){return t.editCipher(e)}))("onAttachmentsClicked",(function(e){return t.editCipherAttachments(e)}))("onAddCipher",(function(){return t.addCipher()}))("onShareClicked",(function(e){return t.shareCipher(e)}))("onCollectionsClicked",(function(e){return t.editCipherCollections(e)}))("onCloneClicked",(function(e){return t.cloneCipher(e)})),v.ɵɵtext(36," "),v.ɵɵelementEnd(),v.ɵɵtext(37," "),v.ɵɵelementEnd(),v.ɵɵtext(38," "),v.ɵɵelementStart(39,"div",2),v.ɵɵtext(40," "),v.ɵɵtemplate(41,H,19,9,"div",14),v.ɵɵtext(42," "),v.ɵɵtemplate(43,$,1,0,"app-verify-email",15),v.ɵɵtext(44," "),v.ɵɵtemplate(45,Q,19,9,"div",14),v.ɵɵtext(46," "),v.ɵɵtemplate(47,Y,19,9,"div",16),v.ɵɵtext(48," "),v.ɵɵelementStart(49,"div",17),v.ɵɵtext(50," "),v.ɵɵelementStart(51,"div",18),v.ɵɵtext(52),v.ɵɵpipe(53,"i18n"),v.ɵɵelementStart(54,"a",19),v.ɵɵpipe(55,"i18n"),v.ɵɵtext(56," "),v.ɵɵelement(57,"i",20),v.ɵɵtext(58," "),v.ɵɵelementEnd(),v.ɵɵtext(59," "),v.ɵɵelementEnd(),v.ɵɵtext(60," "),v.ɵɵelementStart(61,"div",21),v.ɵɵtext(62," "),v.ɵɵelement(63,"app-organizations",22),v.ɵɵtext(64," "),v.ɵɵelementEnd(),v.ɵɵtext(65," "),v.ɵɵelementEnd(),v.ɵɵtext(66," "),v.ɵɵtemplate(67,J,17,9,"div",16),v.ɵɵtext(68," "),v.ɵɵtemplate(69,X,17,6,"div",23),v.ɵɵtext(70," "),v.ɵɵelementEnd(),v.ɵɵtext(71," "),v.ɵɵelementEnd(),v.ɵɵtext(72," "),v.ɵɵelementEnd(),v.ɵɵtext(73," "),v.ɵɵtemplate(74,Z,0,0,"ng-template",null,24,v.ɵɵtemplateRefExtractor),v.ɵɵtext(76," "),v.ɵɵtemplate(77,ee,0,0,"ng-template",null,25,v.ɵɵtemplateRefExtractor),v.ɵɵtext(79," "),v.ɵɵtemplate(80,te,0,0,"ng-template",null,26,v.ɵɵtemplateRefExtractor),v.ɵɵtext(82," "),v.ɵɵtemplate(83,ne,0,0,"ng-template",null,27,v.ɵɵtemplateRefExtractor),v.ɵɵtext(85," "),v.ɵɵtemplate(86,re,0,0,"ng-template",null,28,v.ɵɵtemplateRefExtractor),v.ɵɵtext(88," "),v.ɵɵtemplate(89,ie,0,0,"ng-template",null,29,v.ɵɵtemplateRefExtractor),v.ɵɵtext(91," ")),2&e){var n=v.ɵɵreference(18);v.ɵɵadvance(15),v.ɵɵtextInterpolate1(" ",v.ɵɵpipeBind1(16,16,"myVault")," "),v.ɵɵadvance(2),v.ɵɵproperty("appApiAction",t.ciphersComponent.actionPromise),v.ɵɵadvance(3),v.ɵɵproperty("ngIf",n.loading),v.ɵɵadvance(6),v.ɵɵproperty("ciphersComponent",t.ciphersComponent)("deleted",t.deleted),v.ɵɵadvance(3),v.ɵɵproperty("ngIf",!t.deleted),v.ɵɵadvance(4),v.ɵɵproperty("ngIf",t.deleted),v.ɵɵadvance(8),v.ɵɵproperty("ngIf",t.showUpdateKey),v.ɵɵadvance(2),v.ɵɵproperty("ngIf",t.showVerifyEmail),v.ɵɵadvance(2),v.ɵɵproperty("ngIf",t.showBrowserOutdated),v.ɵɵadvance(2),v.ɵɵproperty("ngIf",t.showPremiumCallout),v.ɵɵadvance(5),v.ɵɵtextInterpolate1(" ",v.ɵɵpipeBind1(53,18,"organizations")," "),v.ɵɵadvance(2),v.ɵɵpropertyInterpolate("appA11yTitle",v.ɵɵpipeBind1(55,20,"learnMore")),v.ɵɵadvance(9),v.ɵɵproperty("vault",!0),v.ɵɵadvance(4),v.ɵɵproperty("ngIf",t.showRedeemSponsorship),v.ɵɵadvance(2),v.ɵɵproperty("ngIf",t.showProviders)}},directives:[k.GroupingsComponent,O.ApiActionDirective,_.NgIf,A.BulkActionsComponent,T.CiphersComponent,M.A11yTitleDirective,D.OrganizationsComponent,R.CalloutComponent,B.VerifyEmailComponent,g.RouterLinkWithHref,j.ProvidersComponent],pipes:[U.I18nPipe],encapsulation:2}),e}();t.VaultComponent=ae,("undefined"==typeof ngDevMode||ngDevMode)&&v.ɵsetClassMetadata(ae,[{type:o.Component,args:[{selector:"app-vault",templateUrl:"vault.component.html"}]}],(function(){return[{type:y.SyncService},{type:g.ActivatedRoute},{type:g.Router},{type:v.ChangeDetectorRef},{type:x.I18nService},{type:S.ModalService},{type:b.TokenService},{type:w.CryptoService},{type:C.MessagingService},{type:I.UserService},{type:E.PlatformUtilsService},{type:P.BroadcasterService},{type:v.NgZone}]}),{groupingsComponent:[{type:o.ViewChild,args:[f.GroupingsComponent,{static:!0}]}],ciphersComponent:[{type:o.ViewChild,args:[u.CiphersComponent,{static:!0}]}],organizationsComponent:[{type:o.ViewChild,args:[s.OrganizationsComponent,{static:!0}]}],attachmentsModalRef:[{type:o.ViewChild,args:["attachments",{read:o.ViewContainerRef,static:!0}]}],folderAddEditModalRef:[{type:o.ViewChild,args:["folderAddEdit",{read:o.ViewContainerRef,static:!0}]}],cipherAddEditModalRef:[{type:o.ViewChild,args:["cipherAddEdit",{read:o.ViewContainerRef,static:!0}]}],shareModalRef:[{type:o.ViewChild,args:["share",{read:o.ViewContainerRef,static:!0}]}],collectionsModalRef:[{type:o.ViewChild,args:["collections",{read:o.ViewContainerRef,static:!0}]}],updateKeyModalRef:[{type:o.ViewChild,args:["updateKeyTemplate",{read:o.ViewContainerRef,static:!0}]}]})},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.DisableSendPolicyComponent=t.DisableSendPolicy=void 0;var o=n(0),a=n(70),s=n(129),l=n(0),c=n(22),p=n(12),u=n(9),d=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.name="disableSend",t.description="disableSendPolicyDesc",t.type=a.PolicyType.DisableSend,t.component=m,t}return i(t,e),t}(s.BasePolicy);t.DisableSendPolicy=d;var m=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.ɵfac=function(e){return f(e||t)},t.ɵcmp=l.ɵɵdefineComponent({type:t,selectors:[["policy-disable-send"]],features:[l.ɵɵInheritDefinitionFeature],decls:16,vars:7,consts:[["type","warning"],[1,"form-group"],[1,"form-check"],["type","checkbox","id","enabled","name","Enabled",1,"form-check-input",3,"formControl"],["for","enabled",1,"form-check-label"]],template:function(e,t){1&e&&(l.ɵɵelementStart(0,"app-callout",0),l.ɵɵtext(1),l.ɵɵpipe(2,"i18n"),l.ɵɵelementEnd(),l.ɵɵtext(3," "),l.ɵɵelementStart(4,"div",1),l.ɵɵtext(5," "),l.ɵɵelementStart(6,"div",2),l.ɵɵtext(7," "),l.ɵɵelement(8,"input",3),l.ɵɵtext(9," "),l.ɵɵelementStart(10,"label",4),l.ɵɵtext(11),l.ɵɵpipe(12,"i18n"),l.ɵɵelementEnd(),l.ɵɵtext(13," "),l.ɵɵelementEnd(),l.ɵɵtext(14," "),l.ɵɵelementEnd(),l.ɵɵtext(15," ")),2&e&&(l.ɵɵadvance(1),l.ɵɵtextInterpolate1(" ",l.ɵɵpipeBind1(2,3,"disableSendExemption")," "),l.ɵɵadvance(7),l.ɵɵproperty("formControl",t.enabled),l.ɵɵadvance(3),l.ɵɵtextInterpolate(l.ɵɵpipeBind1(12,5,"enabled")))},directives:[c.CalloutComponent,p.CheckboxControlValueAccessor,p.NgControlStatus,p.FormControlDirective],pipes:[u.I18nPipe],encapsulation:2}),t}(s.BasePolicyComponent);t.DisableSendPolicyComponent=m;var f=l.ɵɵgetInheritedFactory(m);("undefined"==typeof ngDevMode||ngDevMode)&&l.ɵsetClassMetadata(m,[{type:o.Component,args:[{selector:"policy-disable-send",templateUrl:"disable-send.component.html"}]}],null,null)},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]"}]}],(function(){return[{type:o.ModalService},{type:i.ChangeDetectorRef},{type:i.ElementRef},{type:a.ConfigurableFocusTrapFactory},{type:s.ModalRef}]}),{modalContentRef:[{type:r.ViewChild,args:["modalContent",{read:r.ViewContainerRef,static:!0}]}]})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ModalInjector=void 0;var r=function(){function e(e,t){this._parentInjector=e,this._additionalTokens=t}return e.prototype.get=function(e,t,n){var r;return null!==(r=this._additionalTokens.get(e))&&void 0!==r?r:this._parentInjector.get(e,t)},e}();t.ModalInjector=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ProviderAddOrganizationRequest=void 0;var r=function(){};t.ProviderAddOrganizationRequest=r},,,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isValid=t.getDomain=void 0,t.getDomain=function(e){return null},t.isValid=function(e){return!0}},,,,,,,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ProvidersRoutingModule=void 0;var r=n(0),i=n(8),o=n(302),a=n(258),s=n(520),l=n(522),c=n(526),p=n(527),u=n(529),d=n(530),m=n(517),f=n(536),h=n(537),v=n(538),y=n(385),g=n(386),x=n(515),S=n(516),b=n(539),w=n(0),C=n(8),I=[{path:"",canActivate:[o.AuthGuardService],component:g.ProvidersComponent},{path:"",component:y.FrontendLayoutComponent,children:[{path:"setup-provider",component:h.SetupProviderComponent,data:{titleId:"setupProvider"}},{path:"accept-provider",component:c.AcceptProviderComponent,data:{titleId:"acceptProvider"}}]},{path:"",canActivate:[o.AuthGuardService],children:[{path:"setup",component:v.SetupComponent},{path:":providerId",component:m.ProvidersLayoutComponent,canActivate:[x.ProviderGuardService],children:[{path:"",pathMatch:"full",redirectTo:"clients"},{path:"clients/create",component:l.CreateOrganizationComponent},{path:"clients",component:s.ClientsComponent,data:{titleId:"clients"}},{path:"manage",component:u.ManageComponent,children:[{path:"",pathMatch:"full",redirectTo:"people"},{path:"people",component:d.PeopleComponent,canActivate:[S.ProviderTypeGuardService],data:{titleId:"people",permissions:[a.Permissions.ManageUsers]}},{path:"events",component:p.EventsComponent,canActivate:[S.ProviderTypeGuardService],data:{titleId:"eventLogs",permissions:[a.Permissions.AccessEventLogs]}}]},{path:"settings",component:f.SettingsComponent,children:[{path:"",pathMatch:"full",redirectTo:"account"},{path:"account",component:b.AccountComponent,canActivate:[S.ProviderTypeGuardService],data:{titleId:"myProvider",permissions:[a.Permissions.ManageProvider]}}]}]}]}],E=function(){function e(){}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=w.ɵɵdefineNgModule({type:e}),e.ɵinj=w.ɵɵdefineInjector({imports:[[i.RouterModule.forChild(I)],i.RouterModule]}),e}();t.ProvidersRoutingModule=E,("undefined"==typeof ngJitMode||ngJitMode)&&w.ɵɵsetNgModuleScope(E,{imports:[C.RouterModule],exports:[i.RouterModule]}),("undefined"==typeof ngDevMode||ngDevMode)&&w.ɵsetClassMetadata(E,[{type:r.NgModule,args:[{imports:[i.RouterModule.forChild(I)],exports:[i.RouterModule]}]}],null,null)},function(e,t,n){"use strict";n.r(t),t.default={darkInputColor:"#fff",darkInputPlaceholderColor:"#bac0ce",lightInputColor:"#465057",lightInputPlaceholderColor:"#b6b8b8"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OrganizationCreateRequest=void 0;var r=function(){};t.OrganizationCreateRequest=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OrganizationUpgradeRequest=void 0;var r=function(){};t.OrganizationUpgradeRequest=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ProviderOrganizationCreateRequest=void 0;var r=function(e,t){this.clientOwnerEmail=e,this.organizationCreateRequest=t};t.ProviderOrganizationCreateRequest=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ProviderUserAcceptRequest=void 0;var r=function(){};t.ProviderUserAcceptRequest=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EventView=void 0;var r=function(e){this.message=e.message,this.humanReadableMessage=e.humanReadableMessage,this.appIcon=e.appIcon,this.appName=e.appName,this.userId=e.userId,this.userName=e.userName,this.userEmail=e.userEmail,this.date=e.date,this.ip=e.ip,this.type=e.type};t.EventView=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ProviderUserConfirmRequest=void 0;var r=function(){};t.ProviderUserConfirmRequest=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ProviderUserBulkConfirmRequest=void 0;var r=function(e){this.keys=e};t.ProviderUserBulkConfirmRequest=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OrganizationUserBulkConfirmRequest=void 0;var r=function(e){this.keys=e};t.OrganizationUserBulkConfirmRequest=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ProviderUserInviteRequest=void 0;var r=function(){this.emails=[]};t.ProviderUserInviteRequest=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ProviderUserUpdateRequest=void 0;var r=function(){};t.ProviderUserUpdateRequest=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ProviderSetupRequest=void 0;var r=function(){};t.ProviderSetupRequest=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ProviderUpdateRequest=void 0;var r=function(){};t.ProviderUpdateRequest=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BroadcasterService=void 0;var r=function(){function e(){this.subscribers=new Map}return e.prototype.send=function(e,t){null==t?this.subscribers.forEach((function(t){t(e)})):this.subscribers.has(t)&&this.subscribers.get(t)(e)},e.prototype.subscribe=function(e,t){this.subscribers.set(e,t)},e.prototype.unsubscribe=function(e){this.subscribers.has(e)&&this.subscribers.delete(e)},e}();t.BroadcasterService=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EmergencyAccessAcceptRequest=void 0;var r=function(){};t.EmergencyAccessAcceptRequest=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OrganizationUserAcceptRequest=void 0;var r=function(){};t.OrganizationUserAcceptRequest=r},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=5)return this.messagingService.send("logout"),[2];this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("invalidPin"))}return[3,35];case 16:return[4,this.cryptoService.makeKey(this.masterPassword,this.email,e,t)];case 17:return r=i.sent(),[4,this.cryptoService.getKeyHash()];case 18:return o=i.sent(),c=!1,null==o?[3,20]:[4,this.cryptoService.compareAndUpdateKeyHash(this.masterPassword,r)];case 19:return c=i.sent(),[3,27];case 20:return u=new l.SecretVerificationRequest,[4,this.cryptoService.hashPassword(this.masterPassword,r,p.HashPurpose.ServerAuthorization)];case 21:d=i.sent(),u.masterPasswordHash=d,i.label=22;case 22:return i.trys.push([22,26,,27]),this.formPromise=this.apiService.postAccountVerifyPassword(u),[4,this.formPromise];case 23:return i.sent(),c=!0,[4,this.cryptoService.hashPassword(this.masterPassword,r,p.HashPurpose.LocalAuthorization)];case 24:return m=i.sent(),[4,this.cryptoService.setKeyHash(m)];case 25:return i.sent(),[3,27];case 26:return f=i.sent(),this.logService.error(f),[3,27];case 27:return c?this.pinSet[0]?[4,this.storageService.get(a.ConstantsService.protectedPin)]:[3,33]:[3,34];case 28:return h=i.sent(),[4,this.cryptoService.getEncKey(r)];case 29:return v=i.sent(),[4,this.cryptoService.decryptToUtf8(new s.EncString(h),v)];case 30:return y=i.sent(),[4,this.cryptoService.makePinKey(y,this.email,e,t)];case 31:return g=i.sent(),x=this.vaultTimeoutService,[4,this.cryptoService.encrypt(r.key,g)];case 32:x.pinProtectedKey=i.sent(),i.label=33;case 33:return this.setKeyAndContinue(r),[3,35];case 34:this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("invalidMasterPassword")),i.label=35;case 35:return[2]}}))}))},e.prototype.logOut=function(){return r(this,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,this.platformUtilsService.showDialog(this.i18nService.t("logOutConfirmation"),this.i18nService.t("logOut"),this.i18nService.t("logOut"),this.i18nService.t("cancel"))];case 1:return e.sent()&&this.messagingService.send("logout"),[2]}}))}))},e.prototype.unlockBiometric=function(){return r(this,void 0,void 0,(function(){var e;return i(this,(function(t){switch(t.label){case 0:return this.biometricLock?[4,this.cryptoService.getKey("biometric")]:[2];case 1:return(e=null!=t.sent())?[4,this.doContinue()]:[3,3];case 2:t.sent(),t.label=3;case 3:return[2,e]}}))}))},e.prototype.togglePassword=function(){this.showPassword=!this.showPassword,document.getElementById(this.pinLock?"pin":"masterPassword").focus()},e.prototype.setKeyAndContinue=function(e){return r(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.cryptoService.setKey(e)];case 1:return t.sent(),this.doContinue(),[2]}}))}))},e.prototype.doContinue=function(){return r(this,void 0,void 0,(function(){var e;return i(this,(function(t){switch(t.label){case 0:return this.vaultTimeoutService.biometricLocked=!1,this.vaultTimeoutService.everBeenUnlocked=!0,[4,this.storageService.get(a.ConstantsService.disableFaviconKey)];case 1:return e=t.sent(),[4,this.stateService.save(a.ConstantsService.disableFaviconKey,!!e)];case 2:return t.sent(),this.messagingService.send("unlocked"),null!=this.onSuccessfulSubmit?this.onSuccessfulSubmit():null!=this.router&&this.router.navigate([this.successRoute]),[2]}}))}))},e.ɵfac=function(t){return new(t||e)(u.ɵɵdirectiveInject(d.Router),u.ɵɵdirectiveInject(m.I18nService),u.ɵɵdirectiveInject(f.PlatformUtilsService),u.ɵɵdirectiveInject(h.MessagingService),u.ɵɵdirectiveInject(v.UserService),u.ɵɵdirectiveInject(y.CryptoService),u.ɵɵdirectiveInject(g.StorageService),u.ɵɵdirectiveInject(x.VaultTimeoutService),u.ɵɵdirectiveInject(S.EnvironmentService),u.ɵɵdirectiveInject(b.StateService),u.ɵɵdirectiveInject(w.ApiService),u.ɵɵdirectiveInject(C.LogService),u.ɵɵdirectiveInject(I.KeyConnectorService))},e.ɵdir=u.ɵɵdefineDirective({type:e}),e}();t.LockComponent=E,("undefined"==typeof ngDevMode||ngDevMode)&&u.ɵsetClassMetadata(E,[{type:o.Directive}],(function(){return[{type:d.Router},{type:m.I18nService},{type:f.PlatformUtilsService},{type:h.MessagingService},{type:v.UserService},{type:y.CryptoService},{type:g.StorageService},{type:x.VaultTimeoutService},{type:S.EnvironmentService},{type:b.StateService},{type:w.ApiService},{type:C.LogService},{type:I.KeyConnectorService}]}),null)},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]-1&&(e=e.concat(this.email.substr(0,t).trim().toLowerCase().split(/[^A-Za-z0-9]/))),null!=this.name&&""!==this.name&&(e=e.concat(this.name.trim().toLowerCase().split(" "))),e},t.ɵfac=function(e){return new(e||t)(d.ɵɵdirectiveInject(m.AuthService),d.ɵɵdirectiveInject(f.Router),d.ɵɵdirectiveInject(h.I18nService),d.ɵɵdirectiveInject(v.CryptoService),d.ɵɵdirectiveInject(y.ApiService),d.ɵɵdirectiveInject(g.StateService),d.ɵɵdirectiveInject(x.PlatformUtilsService),d.ɵɵdirectiveInject(S.PasswordGenerationService),d.ɵɵdirectiveInject(b.EnvironmentService),d.ɵɵdirectiveInject(w.LogService))},t.ɵdir=d.ɵɵdefineDirective({type:t,features:[d.ɵɵInheritDefinitionFeature]}),t}(u.CaptchaProtectedComponent);t.RegisterComponent=C,("undefined"==typeof ngDevMode||ngDevMode)&&d.ɵsetClassMetadata(C,[{type:s.Directive}],(function(){return[{type:m.AuthService},{type:f.Router},{type:h.I18nService},{type:v.CryptoService},{type:y.ApiService},{type:g.StateService},{type:x.PlatformUtilsService},{type:S.PasswordGenerationService},{type:b.EnvironmentService},{type:w.LogService}]}),null)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RegisterRequest=void 0;var r=function(e,t,n,r,i,o,a,s,l){this.email=e,this.name=t,this.masterPasswordHash=n,this.key=i,this.kdf=o,this.kdfIterations=a,this.referenceData=s,this.captchaResponse=l,this.masterPasswordHint=r||null};t.RegisterRequest=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ReferenceEventRequest=void 0;var r=function(){};t.ReferenceEventRequest=r},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]1?[4,this.sendEmail(!1)]:[3,5];case 4:n.sent(),n.label=5;case 5:case 6:return[3,7];case 7:return[2]}}))}))},e.prototype.submit=function(){return r(this,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:if(null==this.token||""===this.token)return this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("verificationCodeRequired")),[2];if(this.selectedProviderType===s.TwoFactorProviderType.WebAuthn){if(null==this.webAuthn)return[2];this.webAuthn.stop()}else this.selectedProviderType!==s.TwoFactorProviderType.Email&&this.selectedProviderType!==s.TwoFactorProviderType.Authenticator||(this.token=this.token.replace(" ","").trim());e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.doSubmit()];case 2:return e.sent(),[3,4];case 3:return e.sent(),this.selectedProviderType===s.TwoFactorProviderType.WebAuthn&&null!=this.webAuthn&&this.webAuthn.start(),[3,4];case 4:return[2]}}))}))},e.prototype.doSubmit=function(){return r(this,void 0,void 0,(function(){var e,t;return i(this,(function(n){switch(n.label){case 0:return this.formPromise=this.authService.logInTwoFactor(this.selectedProviderType,this.token,this.remember),[4,this.formPromise];case 1:return e=n.sent(),[4,this.storageService.get(p.ConstantsService.disableFaviconKey)];case 2:return t=n.sent(),[4,this.stateService.save(p.ConstantsService.disableFaviconKey,!!t)];case 3:return n.sent(),null!=this.onSuccessfulLogin&&this.onSuccessfulLogin(),e.resetMasterPassword&&(this.successRoute="set-password"),e.forcePasswordReset&&(this.successRoute="update-temp-password"),null!=this.onSuccessfulLoginNavigate?this.onSuccessfulLoginNavigate():this.router.navigate([this.successRoute],{queryParams:{identifier:this.identifier}}),[2]}}))}))},e.prototype.sendEmail=function(e){return r(this,void 0,void 0,(function(){var t,n;return i(this,(function(r){switch(r.label){case 0:if(this.selectedProviderType!==s.TwoFactorProviderType.Email)return[2];if(null!=this.emailPromise)return[2];r.label=1;case 1:return r.trys.push([1,3,,4]),(t=new l.TwoFactorEmailRequest).email=this.authService.email,t.masterPasswordHash=this.authService.masterPasswordHash,this.emailPromise=this.apiService.postTwoFactorEmail(t),[4,this.emailPromise];case 2:return r.sent(),e&&this.platformUtilsService.showToast("success",null,this.i18nService.t("verificationCodeEmailSent",this.twoFactorEmail)),[3,4];case 3:return n=r.sent(),this.logService.error(n),[3,4];case 4:return this.emailPromise=null,[2]}}))}))},e.prototype.authWebAuthn=function(){var e=this.authService.twoFactorProvidersData.get(this.selectedProviderType);this.webAuthnSupported&&null!=this.webAuthn&&this.webAuthn.init(e)},e.prototype.cleanupWebAuthn=function(){null!=this.webAuthn&&(this.webAuthn.stop(),this.webAuthn.cleanup())},Object.defineProperty(e.prototype,"authing",{get:function(){return this.authService.authingWithPassword()||this.authService.authingWithSso()||this.authService.authingWithApiKey()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"needsLock",{get:function(){return this.authService.authingWithSso()||this.authService.authingWithApiKey()},enumerable:!1,configurable:!0}),e.ɵfac=function(t){return new(t||e)(m.ɵɵdirectiveInject(f.AuthService),m.ɵɵdirectiveInject(h.Router),m.ɵɵdirectiveInject(v.I18nService),m.ɵɵdirectiveInject(y.ApiService),m.ɵɵdirectiveInject(g.PlatformUtilsService),m.ɵɵdirectiveInject(Window),m.ɵɵdirectiveInject(x.EnvironmentService),m.ɵɵdirectiveInject(S.StateService),m.ɵɵdirectiveInject(b.StorageService),m.ɵɵdirectiveInject(h.ActivatedRoute),m.ɵɵdirectiveInject(w.LogService))},e.ɵdir=m.ɵɵdefineDirective({type:e}),e}();t.TwoFactorComponent=C,("undefined"==typeof ngDevMode||ngDevMode)&&m.ɵsetClassMetadata(C,[{type:o.Directive}],(function(){return[{type:f.AuthService},{type:h.Router},{type:v.I18nService},{type:y.ApiService},{type:g.PlatformUtilsService},{type:Window},{type:x.EnvironmentService},{type:S.StateService},{type:b.StorageService},{type:h.ActivatedRoute},{type:w.LogService}]}),null)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AuthResult=void 0;var r=function(){this.twoFactor=!1,this.captchaSiteKey="",this.resetMasterPassword=!1,this.forcePasswordReset=!1,this.twoFactorProviders=null};t.AuthResult=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SetKeyConnectorKeyRequest=void 0;var r=function(e,t,n,r,i){this.key=e,this.kdf=t,this.kdfIterations=n,this.orgIdentifier=r,this.keys=i};t.SetKeyConnectorKeyRequest=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DeviceRequest=void 0;var r=function(e,t){this.type=t.getDevice(),this.name=t.getDeviceString(),this.identifier=e,this.pushToken=null};t.DeviceRequest=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PreloginRequest=void 0;var r=function(e){this.email=e};t.PreloginRequest=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TokenRequest=void 0;var r=n(28),i=function(){function e(e,t,n,r,i,o,a,s){this.provider=r,this.token=i,this.remember=o,this.captchaResponse=a,null!=e&&e.length>1?(this.email=e[0],this.masterPasswordHash=e[1]):null!=t&&t.length>2?(this.code=t[0],this.codeVerifier=t[1],this.redirectUri=t[2]):null!=n&&n.length>1&&(this.clientId=n[0],this.clientSecret=n[1]),this.device=null!=s?s:null}return e.prototype.toIdentityToken=function(e){var t={scope:"api offline_access",client_id:e};if(null!=this.clientSecret)t.scope=e.startsWith("organization")?"api.organization":"api",t.grant_type="client_credentials",t.client_secret=this.clientSecret;else if(null!=this.masterPasswordHash&&null!=this.email)t.grant_type="password",t.username=this.email,t.password=this.masterPasswordHash;else{if(null==this.code||null==this.codeVerifier||null==this.redirectUri)throw new Error("must provide credentials or codes");t.grant_type="authorization_code",t.code=this.code,t.code_verifier=this.codeVerifier,t.redirect_uri=this.redirectUri}return this.device&&(t.deviceType=this.device.type,t.deviceIdentifier=this.device.identifier,t.deviceName=this.device.name),this.token&&null!=this.provider&&(t.twoFactorToken=this.token,t.twoFactorProvider=this.provider,t.twoFactorRemember=this.remember?"1":"0"),null!=this.captchaResponse&&(t.captchaResponse=this.captchaResponse),t},e.prototype.alterIdentityTokenHeaders=function(e){null==this.clientSecret&&null!=this.masterPasswordHash&&null!=this.email&&e.set("Auth-Email",r.Utils.fromUtf8ToUrlB64(this.email))},e}();t.TokenRequest=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WebAuthnIFrame=void 0;var r=function(){function e(e,t,n,r,i,o,a,s){this.win=e,this.webVaultUrl=t,this.webAuthnNewTab=n,this.platformUtilsService=r,this.i18nService=i,this.successCallback=o,this.errorCallback=a,this.infoCallback=s,this.iframe=null,this.parseFunction=this.parseMessage.bind(this),this.connectorLink=e.document.createElement("a")}return e.prototype.init=function(e){var t=new URLSearchParams({data:this.base64Encode(JSON.stringify(e)),parent:encodeURIComponent(this.win.document.location.href),btnText:encodeURIComponent(this.i18nService.t("webAuthnAuthenticate")),v:"1"});this.webAuthnNewTab?(t.append("locale",this.i18nService.translationLocale),this.platformUtilsService.launchUri(this.webVaultUrl+"/webauthn-fallback-connector.html?"+t)):(this.connectorLink.href=this.webVaultUrl+"/webauthn-connector.html?"+t,this.iframe=this.win.document.getElementById("webauthn_iframe"),this.iframe.allow="publickey-credentials-get "+new URL(this.webVaultUrl).origin,this.iframe.src=this.connectorLink.href,this.win.addEventListener("message",this.parseFunction,!1))},e.prototype.stop=function(){this.sendMessage("stop")},e.prototype.start=function(){this.sendMessage("start")},e.prototype.sendMessage=function(e){this.iframe&&this.iframe.src&&this.iframe.contentWindow&&this.iframe.contentWindow.postMessage(e,this.iframe.src)},e.prototype.base64Encode=function(e){return btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,(function(e,t){return String.fromCharCode("0x"+t)})))},e.prototype.cleanup=function(){this.win.removeEventListener("message",this.parseFunction,!1)},e.prototype.parseMessage=function(e){if(this.validMessage(e)){var t=e.data.split("|");"success"===t[0]&&this.successCallback?this.successCallback(t[1]):"error"===t[0]&&this.errorCallback?this.errorCallback(t[1]):"info"===t[0]&&this.infoCallback&&this.infoCallback(t[1])}},e.prototype.validMessage=function(e){return null!=e.origin&&""!==e.origin&&e.origin===this.connectorLink.origin&&null!=e.data&&"string"==typeof e.data&&(0===e.data.indexOf("success|")||0===e.data.indexOf("error|")||0===e.data.indexOf("info|"))},e}();t.WebAuthnIFrame=r},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]"+this.i18nService.t("encExportKeyWarningDesc")+"

"+this.i18nService.t("encExportAccountWarningDesc"),this.i18nService.t("confirmVaultExport"),this.i18nService.t("exportVault"),this.i18nService.t("cancel"),"warning",!0)]:[3,2];case 1:case 3:return[2,e.sent()];case 2:return[4,this.platformUtilsService.showDialog(this.i18nService.t("exportWarningDesc"),this.i18nService.t("confirmVaultExport"),this.i18nService.t("exportVault"),this.i18nService.t("cancel"),"warning")]}}))}))},e.prototype.saved=function(){this.onSaved.emit()},e.prototype.getExportData=function(){return this.exportService.getExport(this.format)},e.prototype.getFileName=function(e){var t=this.format;return"encrypted_json"===this.format&&(e=null==e?"encrypted":"encrypted_"+e,t="json"),this.exportService.getFileName(e,t)},e.prototype.collectEvent=function(){return r(this,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,this.eventService.collect(a.EventType.User_ClientExportedVault)];case 1:return e.sent(),[2]}}))}))},Object.defineProperty(e.prototype,"format",{get:function(){return this.exportForm.get("format").value},enumerable:!1,configurable:!0}),e.prototype.downloadFile=function(e){var t=this.getFileName();this.platformUtilsService.saveFile(this.win,e,{type:"text/plain"},t)},e.ɵfac=function(t){return new(t||e)(l.ɵɵdirectiveInject(c.CryptoService),l.ɵɵdirectiveInject(p.I18nService),l.ɵɵdirectiveInject(u.PlatformUtilsService),l.ɵɵdirectiveInject(d.ExportService),l.ɵɵdirectiveInject(m.EventService),l.ɵɵdirectiveInject(f.PolicyService),l.ɵɵdirectiveInject(Window),l.ɵɵdirectiveInject(h.LogService),l.ɵɵdirectiveInject(v.UserVerificationService),l.ɵɵdirectiveInject(y.FormBuilder))},e.ɵdir=l.ɵɵdefineDirective({type:e,outputs:{onSaved:"onSaved"}}),e}();t.ExportComponent=g,("undefined"==typeof ngDevMode||ngDevMode)&&l.ɵsetClassMetadata(g,[{type:o.Directive}],(function(){return[{type:c.CryptoService},{type:p.I18nService},{type:u.PlatformUtilsService},{type:d.ExportService},{type:m.EventService},{type:f.PolicyService},{type:Window},{type:h.LogService},{type:v.UserVerificationService},{type:y.FormBuilder}]}),{onSaved:[{type:o.Output}]})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AttachmentView=void 0;var r=function(){function e(e){this.id=null,this.url=null,this.size=null,this.sizeName=null,this.fileName=null,this.key=null,e&&(this.id=e.id,this.url=e.url,this.size=e.size,this.sizeName=e.sizeName)}return Object.defineProperty(e.prototype,"fileSize",{get:function(){try{if(null!=this.size)return parseInt(this.size,null)}catch(e){}return 0},enumerable:!1,configurable:!0}),e}();t.AttachmentView=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AttachmentRequest=void 0;var r=function(){};t.AttachmentRequest=r},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&this.collections.length>0&&this.collections.forEach((function(e){o.collectionIds.indexOf(e.id)>-1&&(e.checked=!0)})),i.label=8;case 8:return r=this,[4,this.folderService.getAllDecrypted()];case 9:return r.folders=i.sent(),this.editMode&&this.previousCipherId!==this.cipherId&&this.eventService.collect(l.EventType.Cipher_ClientViewed,this.cipherId),this.previousCipherId=this.cipherId,this.reprompt=this.cipher.reprompt!==a.CipherRepromptType.None,[2]}}))}))},e.prototype.submit=function(){return r(this,void 0,void 0,(function(){var e,t;return i(this,(function(n){switch(n.label){case 0:return this.cipher.isDeleted?[2,this.restore()]:null==this.cipher.name||""===this.cipher.name?(this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("nameRequired")),[2,!1]):this.editMode&&!this.cloneMode||this.allowPersonal||null!=this.cipher.organizationId?(this.editMode&&!this.cloneMode||this.cipher.type!==s.CipherType.Login||null==this.cipher.login.uris||1!==this.cipher.login.uris.length||null!=this.cipher.login.uris[0].uri&&""!==this.cipher.login.uris[0].uri||(this.cipher.login.uris=null),this.editMode&&!this.cloneMode||null==this.cipher.organizationId||(this.cipher.collectionIds=null==this.collections?[]:this.collections.filter((function(e){return e.checked})).map((function(e){return e.id}))),this.cloneMode&&(this.cipher.id=null),[4,this.encryptCipher()]):(this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("personalOwnershipSubmitError")),[2,!1]);case 1:e=n.sent(),n.label=2;case 2:return n.trys.push([2,4,,5]),this.formPromise=this.saveCipher(e),[4,this.formPromise];case 3:return n.sent(),this.cipher.id=e.id,this.platformUtilsService.showToast("success",null,this.i18nService.t(this.editMode&&!this.cloneMode?"editedItem":"addedItem")),this.onSavedCipher.emit(this.cipher),this.messagingService.send(this.editMode&&!this.cloneMode?"editedCipher":"addedCipher"),[2,!0];case 4:return t=n.sent(),this.logService.error(t),[3,5];case 5:return[2,!1]}}))}))},e.prototype.addUri=function(){this.cipher.type===s.CipherType.Login&&(null==this.cipher.login.uris&&(this.cipher.login.uris=[]),this.cipher.login.uris.push(new v.LoginUriView))},e.prototype.removeUri=function(e){if(this.cipher.type===s.CipherType.Login&&null!=this.cipher.login.uris){var t=this.cipher.login.uris.indexOf(e);t>-1&&this.cipher.login.uris.splice(t,1)}},e.prototype.trackByFunction=function(e,t){return e},e.prototype.cancel=function(){this.onCancelled.emit(this.cipher)},e.prototype.attachments=function(){this.onEditAttachments.emit(this.cipher)},e.prototype.share=function(){this.onShareCipher.emit(this.cipher)},e.prototype.editCollections=function(){this.onEditCollections.emit(this.cipher)},e.prototype.delete=function(){return r(this,void 0,void 0,(function(){var e;return i(this,(function(t){switch(t.label){case 0:return[4,this.platformUtilsService.showDialog(this.i18nService.t(this.cipher.isDeleted?"permanentlyDeleteItemConfirmation":"deleteItemConfirmation"),this.i18nService.t("deleteItem"),this.i18nService.t("yes"),this.i18nService.t("no"),"warning")];case 1:if(!t.sent())return[2,!1];t.label=2;case 2:return t.trys.push([2,4,,5]),this.deletePromise=this.deleteCipher(),[4,this.deletePromise];case 3:return t.sent(),this.platformUtilsService.showToast("success",null,this.i18nService.t(this.cipher.isDeleted?"permanentlyDeletedItem":"deletedItem")),this.onDeletedCipher.emit(this.cipher),this.messagingService.send(this.cipher.isDeleted?"permanentlyDeletedCipher":"deletedCipher"),[3,5];case 4:return e=t.sent(),this.logService.error(e),[3,5];case 5:return[2,!0]}}))}))},e.prototype.restore=function(){return r(this,void 0,void 0,(function(){var e;return i(this,(function(t){switch(t.label){case 0:return this.cipher.isDeleted?[4,this.platformUtilsService.showDialog(this.i18nService.t("restoreItemConfirmation"),this.i18nService.t("restoreItem"),this.i18nService.t("yes"),this.i18nService.t("no"),"warning")]:[2,!1];case 1:if(!t.sent())return[2,!1];t.label=2;case 2:return t.trys.push([2,4,,5]),this.restorePromise=this.restoreCipher(),[4,this.restorePromise];case 3:return t.sent(),this.platformUtilsService.showToast("success",null,this.i18nService.t("restoredItem")),this.onRestoredCipher.emit(this.cipher),this.messagingService.send("restoredCipher"),[3,5];case 4:return e=t.sent(),this.logService.error(e),[3,5];case 5:return[2,!0]}}))}))},e.prototype.generatePassword=function(){return r(this,void 0,void 0,(function(){return i(this,(function(e){switch(e.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(!e.sent())return[2,!1];e.label=2;case 2:return this.onGeneratePassword.emit(),[2,!0]}}))}))},e.prototype.togglePassword=function(){this.showPassword=!this.showPassword,document.getElementById("loginPassword").focus(),this.editMode&&this.showPassword&&this.eventService.collect(l.EventType.Cipher_ClientToggledPasswordVisible,this.cipherId)},e.prototype.toggleCardNumber=function(){return r(this,void 0,void 0,(function(){return i(this,(function(e){return this.showCardNumber=!this.showCardNumber,this.showCardNumber&&this.eventService.collect(l.EventType.Cipher_ClientToggledCardNumberVisible,this.cipherId),[2]}))}))},e.prototype.toggleCardCode=function(){this.showCardCode=!this.showCardCode,document.getElementById("cardCode").focus(),this.editMode&&this.showCardCode&&this.eventService.collect(l.EventType.Cipher_ClientToggledCardCodeVisible,this.cipherId)},e.prototype.toggleUriOptions=function(e){var t=e;t.showOptions=(null!=t.showOptions||null==e.match)&&!t.showOptions},e.prototype.loginUriMatchChanged=function(e){var t=e;t.showOptions=null==t.showOptions||t.showOptions},e.prototype.organizationChanged=function(){return r(this,void 0,void 0,(function(){var e,t=this;return i(this,(function(n){switch(n.label){case 0:return null!=this.writeableCollections&&this.writeableCollections.forEach((function(e){return e.checked=!1})),null==this.cipher.organizationId?[3,2]:(this.collections=this.writeableCollections.filter((function(e){return e.organizationId===t.cipher.organizationId})),[4,this.userService.getOrganization(this.cipher.organizationId)]);case 1:return null!=(e=n.sent())&&(this.cipher.organizationUseTotp=e.useTotp),[3,3];case 2:this.collections=[],n.label=3;case 3:return[2]}}))}))},e.prototype.checkPassword=function(){return r(this,void 0,void 0,(function(){var e;return i(this,(function(t){switch(t.label){case 0:return null!=this.checkPasswordPromise||(null==this.cipher.login||null==this.cipher.login.password||""===this.cipher.login.password)?[2]:(this.checkPasswordPromise=this.auditService.passwordLeaked(this.cipher.login.password),[4,this.checkPasswordPromise]);case 1:return e=t.sent(),this.checkPasswordPromise=null,e>0?this.platformUtilsService.showToast("warning",null,this.i18nService.t("passwordExposed",e.toString())):this.platformUtilsService.showToast("success",null,this.i18nService.t("passwordSafe")),[2]}}))}))},e.prototype.repromptChanged=function(){this.reprompt=!this.reprompt,this.reprompt?this.cipher.reprompt=a.CipherRepromptType.Password:this.cipher.reprompt=a.CipherRepromptType.None},e.prototype.loadCollections=function(){return r(this,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,this.collectionService.getAllDecrypted()];case 1:return[2,e.sent().filter((function(e){return!e.readOnly}))]}}))}))},e.prototype.loadCipher=function(){return this.cipherService.get(this.cipherId)},e.prototype.encryptCipher=function(){return this.cipherService.encrypt(this.cipher)},e.prototype.saveCipher=function(e){return this.cipherService.saveWithServer(e)},e.prototype.deleteCipher=function(){return this.cipher.isDeleted?this.cipherService.deleteWithServer(this.cipher.id):this.cipherService.softDeleteWithServer(this.cipher.id)},e.prototype.restoreCipher=function(){return this.cipherService.restoreWithServer(this.cipher.id)},e.ɵfac=function(t){return new(t||e)(S.ɵɵdirectiveInject(b.CipherService),S.ɵɵdirectiveInject(w.FolderService),S.ɵɵdirectiveInject(C.I18nService),S.ɵɵdirectiveInject(I.PlatformUtilsService),S.ɵɵdirectiveInject(E.AuditService),S.ɵɵdirectiveInject(P.StateService),S.ɵɵdirectiveInject(k.UserService),S.ɵɵdirectiveInject(O.CollectionService),S.ɵɵdirectiveInject(_.MessagingService),S.ɵɵdirectiveInject(A.EventService),S.ɵɵdirectiveInject(T.PolicyService),S.ɵɵdirectiveInject(M.PasswordRepromptService),S.ɵɵdirectiveInject(D.LogService))},e.ɵdir=S.ɵɵdefineDirective({type:e,inputs:{cloneMode:"cloneMode",folderId:"folderId",cipherId:"cipherId",type:"type",collectionIds:"collectionIds",organizationId:"organizationId"},outputs:{onSavedCipher:"onSavedCipher",onDeletedCipher:"onDeletedCipher",onRestoredCipher:"onRestoredCipher",onCancelled:"onCancelled",onEditAttachments:"onEditAttachments",onShareCipher:"onShareCipher",onEditCollections:"onEditCollections",onGeneratePassword:"onGeneratePassword"}}),e}();t.AddEditComponent=R,("undefined"==typeof ngDevMode||ngDevMode)&&S.ɵsetClassMetadata(R,[{type:o.Directive}],(function(){return[{type:b.CipherService},{type:w.FolderService},{type:C.I18nService},{type:I.PlatformUtilsService},{type:E.AuditService},{type:P.StateService},{type:k.UserService},{type:O.CollectionService},{type:_.MessagingService},{type:A.EventService},{type:T.PolicyService},{type:M.PasswordRepromptService},{type:D.LogService}]}),{cloneMode:[{type:o.Input}],folderId:[{type:o.Input}],cipherId:[{type:o.Input}],type:[{type:o.Input}],collectionIds:[{type:o.Input}],organizationId:[{type:o.Input}],onSavedCipher:[{type:o.Output}],onDeletedCipher:[{type:o.Output}],onRestoredCipher:[{type:o.Output}],onCancelled:[{type:o.Output}],onEditAttachments:[{type:o.Output}],onShareCipher:[{type:o.Output}],onEditCollections:[{type:o.Output}],onGeneratePassword:[{type:o.Output}]})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AddEditCustomFieldsComponent=void 0;var r=n(0),i=n(330),o=(n(73),n(1),n(144),n(266)),a=n(43),s=n(202),l=n(137),c=n(28),p=n(0),u=n(1),d=n(73),m=function(){function e(e,t){this.i18nService=e,this.eventService=t,this.addFieldType=l.FieldType.Text,this.linkedFieldOptions=[],this.cipherType=a.CipherType,this.fieldType=l.FieldType,this.eventType=s.EventType,this.addFieldTypeOptions=[{name:e.t("cfTypeText"),value:l.FieldType.Text},{name:e.t("cfTypeHidden"),value:l.FieldType.Hidden},{name:e.t("cfTypeBoolean"),value:l.FieldType.Boolean}],this.addFieldLinkedTypeOption={name:this.i18nService.t("cfTypeLinked"),value:l.FieldType.Linked}}return e.prototype.ngOnChanges=function(e){null!=e.thisCipherType&&(this.setLinkedFieldOptions(),e.thisCipherType.firstChange||this.resetCipherLinkedFields())},e.prototype.addField=function(){null==this.cipher.fields&&(this.cipher.fields=[]);var e=new o.FieldView;e.type=this.addFieldType,e.newField=!0,e.type===l.FieldType.Linked&&(e.linkedId=this.linkedFieldOptions[0].value),this.cipher.fields.push(e)},e.prototype.removeField=function(e){var t=this.cipher.fields.indexOf(e);t>-1&&this.cipher.fields.splice(t,1)},e.prototype.toggleFieldValue=function(e){var t=e;t.showValue=!t.showValue,this.editMode&&t.showValue&&this.eventService.collect(s.EventType.Cipher_ClientToggledHiddenFieldVisible,this.cipher.id)},e.prototype.trackByFunction=function(e,t){return e},e.prototype.drop=function(e){i.moveItemInArray(this.cipher.fields,e.previousIndex,e.currentIndex)},e.prototype.setLinkedFieldOptions=function(){var e=this;if(null!=this.cipher.linkedFieldOptions){var t=[];this.cipher.linkedFieldOptions.forEach((function(n,r){return t.push({name:e.i18nService.t(n.i18nKey),value:r})})),this.linkedFieldOptions=t.sort(c.Utils.getSortFunction(this.i18nService,"name"))}},e.prototype.resetCipherLinkedFields=function(){var e=this;null!=this.cipher.fields&&0!==this.cipher.fields.length&&(null!=this.cipher.linkedFieldOptions?this.cipher.fields.filter((function(e){return e.type===l.FieldType.Linked})).forEach((function(t){return t.linkedId=e.linkedFieldOptions[0].value})):this.cipher.fields=this.cipher.fields.filter((function(e){return e.type!==l.FieldType.Linked})))},e.ɵfac=function(t){return new(t||e)(p.ɵɵdirectiveInject(u.I18nService),p.ɵɵdirectiveInject(d.EventService))},e.ɵdir=p.ɵɵdefineDirective({type:e,inputs:{cipher:"cipher",thisCipherType:"thisCipherType",editMode:"editMode"},features:[p.ɵɵNgOnChangesFeature]}),e}();t.AddEditCustomFieldsComponent=m,("undefined"==typeof ngDevMode||ngDevMode)&&p.ɵsetClassMetadata(m,[{type:r.Directive}],(function(){return[{type:u.I18nService},{type:d.EventService}]}),{cipher:[{type:r.Input}],thisCipherType:[{type:r.Input}],editMode:[{type:r.Input}]})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OrganizationSponsorshipRedeemRequest=void 0;var r=function(){};t.OrganizationSponsorshipRedeemRequest=r},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]-1})),[2]}}))}))},e.prototype.submit=function(){return r(this,void 0,void 0,(function(){var e,t;return i(this,(function(n){switch(n.label){case 0:if(e=this.collections.filter((function(e){return!!e.checked})).map((function(e){return e.id})),!this.allowSelectNone&&0===e.length)return this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("selectOneCollection")),[2];this.cipherDomain.collectionIds=e,n.label=1;case 1:return n.trys.push([1,3,,4]),this.formPromise=this.saveCollections(),[4,this.formPromise];case 2:return n.sent(),this.onSavedCollections.emit(),this.platformUtilsService.showToast("success",null,this.i18nService.t("editedItem")),[3,4];case 3:return t=n.sent(),this.logService.error(t),[3,4];case 4:return[2]}}))}))},e.prototype.loadCipher=function(){return this.cipherService.get(this.cipherId)},e.prototype.loadCipherCollections=function(){return this.cipherDomain.collectionIds},e.prototype.loadCollections=function(){return r(this,void 0,void 0,(function(){var e=this;return i(this,(function(t){switch(t.label){case 0:return[4,this.collectionService.getAllDecrypted()];case 1:return[2,t.sent().filter((function(t){return!t.readOnly&&t.organizationId===e.cipher.organizationId}))]}}))}))},e.prototype.saveCollections=function(){return this.cipherService.saveCollectionsWithServer(this.cipherDomain)},e.ɵfac=function(t){return new(t||e)(a.ɵɵdirectiveInject(s.CollectionService),a.ɵɵdirectiveInject(l.PlatformUtilsService),a.ɵɵdirectiveInject(c.I18nService),a.ɵɵdirectiveInject(p.CipherService),a.ɵɵdirectiveInject(u.LogService))},e.ɵdir=a.ɵɵdefineDirective({type:e,inputs:{cipherId:"cipherId",allowSelectNone:"allowSelectNone"},outputs:{onSavedCollections:"onSavedCollections"}}),e}();t.CollectionsComponent=d,("undefined"==typeof ngDevMode||ngDevMode)&&a.ɵsetClassMetadata(d,[{type:o.Directive}],(function(){return[{type:s.CollectionService},{type:l.PlatformUtilsService},{type:c.I18nService},{type:p.CipherService},{type:u.LogService}]}),{cipherId:[{type:o.Input}],allowSelectNone:[{type:o.Input}],onSavedCollections:[{type:o.Output}]})},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]524288e3)return this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("maxFileSize")),[2]}null!=this.password&&""===this.password.trim()&&(this.password=null),this.formPromise=this.encryptSend(e).then((function(e){return r(a,void 0,void 0,(function(){var t;return i(this,(function(n){switch(n.label){case 0:return[4,this.sendService.saveWithServer(e)];case 1:return n.sent(),null==this.send.id&&(this.send.id=e[0].id),null==this.send.accessId&&(this.send.accessId=e[0].accessId),this.onSavedSend.emit(this.send),this.copyLink&&null!=this.link?[4,this.copyLinkToClipboard(this.link)]:[3,6];case 2:return null==(t=n.sent())||t?(this.platformUtilsService.showToast("success",null,this.i18nService.t(this.editMode?"editedSend":"createdSend")),[3,6]):[3,3];case 3:return[4,this.platformUtilsService.showDialog(this.i18nService.t(this.editMode?"editedSend":"createdSend"),null,this.i18nService.t("ok"),null,"success",null)];case 4:return n.sent(),[4,this.copyLinkToClipboard(this.link)];case 5:n.sent(),n.label=6;case 6:return[2]}}))}))})),l.label=1;case 1:return l.trys.push([1,3,,4]),[4,this.formPromise];case 2:return l.sent(),[2,!0];case 3:return o=l.sent(),this.logService.error(o),[3,4];case 4:return[2,!1]}}))}))},e.prototype.copyLinkToClipboard=function(e){return r(this,void 0,void 0,(function(){return i(this,(function(t){return[2,Promise.resolve(this.platformUtilsService.copyToClipboard(e))]}))}))},e.prototype.delete=function(){return r(this,void 0,void 0,(function(){var e;return i(this,(function(t){switch(t.label){case 0:return null!=this.deletePromise?[2,!1]:[4,this.platformUtilsService.showDialog(this.i18nService.t("deleteSendConfirmation"),this.i18nService.t("deleteSend"),this.i18nService.t("yes"),this.i18nService.t("no"),"warning")];case 1:if(!t.sent())return[2,!1];t.label=2;case 2:return t.trys.push([2,5,,6]),this.deletePromise=this.sendService.deleteWithServer(this.send.id),[4,this.deletePromise];case 3:return t.sent(),this.platformUtilsService.showToast("success",null,this.i18nService.t("deletedSend")),[4,this.load()];case 4:return t.sent(),this.onDeletedSend.emit(this.send),[2,!0];case 5:return e=t.sent(),this.logService.error(e),[3,6];case 6:return[2,!1]}}))}))},e.prototype.typeChanged=function(){this.send.type!==s.SendType.File||this.alertShown||(this.canAccessPremium?this.emailVerified||(this.alertShown=!0,this.messagingService.send("emailVerificationRequired")):(this.alertShown=!0,this.messagingService.send("premiumRequired")))},e.prototype.toggleOptions=function(){this.showOptions=!this.showOptions},e.prototype.loadSend=function(){return r(this,void 0,void 0,(function(){return i(this,(function(e){return[2,this.sendService.get(this.sendId)]}))}))},e.prototype.encryptSend=function(e){return r(this,void 0,void 0,(function(){var t;return i(this,(function(n){switch(n.label){case 0:return[4,this.sendService.encrypt(this.send,e,this.password,null)];case 1:t=n.sent();try{t[0].deletionDate=null==this.deletionDate?null:new Date(this.deletionDate)}catch(r){t[0].deletionDate=null}try{t[0].expirationDate=null==this.expirationDate?null:new Date(this.expirationDate)}catch(i){t[0].expirationDate=null}return[2,t]}}))}))},e.prototype.togglePasswordVisible=function(){this.showPassword=!this.showPassword,document.getElementById("password").focus()},e.ɵfac=function(t){return new(t||e)(u.ɵɵdirectiveInject(d.I18nService),u.ɵɵdirectiveInject(m.PlatformUtilsService),u.ɵɵdirectiveInject(f.EnvironmentService),u.ɵɵdirectiveInject(h.DatePipe),u.ɵɵdirectiveInject(v.SendService),u.ɵɵdirectiveInject(y.UserService),u.ɵɵdirectiveInject(g.MessagingService),u.ɵɵdirectiveInject(x.PolicyService),u.ɵɵdirectiveInject(S.LogService))},e.ɵdir=u.ɵɵdefineDirective({type:e,inputs:{sendId:"sendId",type:"type"},outputs:{onSavedSend:"onSavedSend",onDeletedSend:"onDeletedSend",onCancelled:"onCancelled"}}),e}();t.AddEditComponent=b,("undefined"==typeof ngDevMode||ngDevMode)&&u.ɵsetClassMetadata(b,[{type:o.Directive}],(function(){return[{type:d.I18nService},{type:m.PlatformUtilsService},{type:f.EnvironmentService},{type:h.DatePipe},{type:v.SendService},{type:y.UserService},{type:g.MessagingService},{type:x.PolicyService},{type:S.LogService}]}),{sendId:[{type:o.Input}],type:[{type:o.Input}],onSavedSend:[{type:o.Output}],onDeletedSend:[{type:o.Output}],onCancelled:[{type:o.Output}]})},function(e,t,n){"use strict";var r=this&&this.__spreadArrays||function(){for(var e=0,t=0,n=arguments.length;t0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0||t.value===e.CUSTOM_VALUE)&&null!=t.value})),this.validatorChange(),o.label=3;case 3:return this.form.valueChanges.subscribe((function(e){return r(n,void 0,void 0,(function(){return i(this,(function(t){return this.onChange(this.getVaultTimeout(e)),[2]}))}))})),this.form.get("vaultTimeout").valueChanges.subscribe((function(t){if(t===e.CUSTOM_VALUE){var r=Math.max(n.form.value.vaultTimeout,0);n.form.patchValue({custom:{hours:Math.floor(r/60),minutes:r%60}})}})),[2]}}))}))},e.prototype.ngOnChanges=function(){this.vaultTimeouts.push({name:this.i18nService.t("custom"),value:e.CUSTOM_VALUE})},e.prototype.getVaultTimeout=function(t){return t.vaultTimeout!==e.CUSTOM_VALUE?t.vaultTimeout:60*t.custom.hours+t.custom.minutes},e.prototype.writeValue=function(t){null!=t&&(this.vaultTimeouts.every((function(e){return e.value!==t}))?this.form.setValue({vaultTimeout:e.CUSTOM_VALUE,custom:{hours:Math.floor(t/60),minutes:t%60}}):this.form.patchValue({vaultTimeout:t}))},e.prototype.registerOnChange=function(e){this.onChange=e},e.prototype.registerOnTouched=function(e){},e.prototype.setDisabledState=function(e){},e.prototype.validate=function(e){var t,n;return this.vaultTimeoutPolicy&&(null===(n=null===(t=this.vaultTimeoutPolicy)||void 0===t?void 0:t.data)||void 0===n?void 0:n.minutes)0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&(this.organizationId=this.organizations[0].id),this.filterCollections(),[2]}}))}))},e.prototype.filterCollections=function(){var e=this;this.writeableCollections.forEach((function(e){return e.checked=!1})),null==this.organizationId||0===this.writeableCollections.length?this.collections=[]:this.collections=this.writeableCollections.filter((function(t){return t.organizationId===e.organizationId}))},e.prototype.submit=function(){var e,t;return r(this,void 0,void 0,(function(){var n,o,a,s,l=this;return i(this,(function(c){switch(c.label){case 0:return 0===(n=this.collections.filter((function(e){return!!e.checked})).map((function(e){return e.id}))).length?(this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),this.i18nService.t("selectOneCollection")),[2]):[4,this.cipherService.get(this.cipherId)];case 1:return[4,c.sent().decrypt()];case 2:o=c.sent(),a=null!==(t=null===(e=this.organizations.find((function(e){return e.id===l.organizationId})))||void 0===e?void 0:e.name)&&void 0!==t?t:this.i18nService.t("organization"),c.label=3;case 3:return c.trys.push([3,5,,6]),this.formPromise=this.cipherService.shareWithServer(o,this.organizationId,n).then((function(){return r(l,void 0,void 0,(function(){return i(this,(function(e){return this.onSharedCipher.emit(),this.platformUtilsService.showToast("success",null,this.i18nService.t("movedItemToOrg",o.name,a)),[2]}))}))})),[4,this.formPromise];case 4:return c.sent(),[2,!0];case 5:return s=c.sent(),this.logService.error(s),[3,6];case 6:return[2,!1]}}))}))},Object.defineProperty(e.prototype,"canSave",{get:function(){if(null!=this.collections)for(var e=0;e0){var n=this.formEls[0];if("input"===n.tagName.toLowerCase()){var r=n;if(null!=r.type&&"checkbox"===r.type.toLowerCase())return void r.click()}n.focus()}},e.ɵfac=function(t){return new(t||e)(i.ɵɵdirectiveInject(i.ElementRef))},e.ɵdir=i.ɵɵdefineDirective({type:e,selectors:[["","appBoxRow",""]],hostBindings:function(e,t){1&e&&i.ɵɵlistener("click",(function(e){return t.onClick(e)}))}}),e}();t.BoxRowDirective=o,("undefined"==typeof ngDevMode||ngDevMode)&&i.ɵsetClassMetadata(o,[{type:r.Directive,args:[{selector:"[appBoxRow]"}]}],(function(){return[{type:i.ElementRef}]}),{onClick:[{type:r.HostListener,args:["click",["$event"]]}]})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SearchCiphersPipe=void 0;var r=n(0),i=n(0),o=function(){function e(){}return e.prototype.transform=function(e,t,n){return void 0===n&&(n=!1),null==e||0===e.length?[]:null==t||t.length<2?e.filter((function(e){return n!==e.isDeleted})):(t=t.trim().toLowerCase(),e.filter((function(e){return n===e.isDeleted&&(null!=e.name&&e.name.toLowerCase().indexOf(t)>-1||(!!(t.length>=8&&e.id.startsWith(t))||(null!=e.subTitle&&e.subTitle.toLowerCase().indexOf(t)>-1||!!(e.login&&null!=e.login.uri&&e.login.uri.toLowerCase().indexOf(t)>-1))))})))},e.ɵfac=function(t){return new(t||e)},e.ɵpipe=i.ɵɵdefinePipe({name:"searchCiphers",type:e,pure:!0}),e}();t.SearchCiphersPipe=o,("undefined"==typeof ngDevMode||ngDevMode)&&i.ɵsetClassMetadata(o,[{type:r.Pipe,args:[{name:"searchCiphers"}]}],null,null)},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.AppComponent=void 0;var o=n(0),a=n(1142),s=n(687),l=n(688),c=n(0),p=n(11),u=n(8),d=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.ngOnInit=function(){e.prototype.ngOnInit.call(this),this.policyListService.addPolicies([new l.MaximumVaultTimeoutPolicy,new s.DisablePersonalVaultExportPolicy])},t.ɵfac=function(e){return m(e||t)},t.ɵcmp=c.ɵɵdefineComponent({type:t,selectors:[["app-root"]],features:[c.ɵɵInheritDefinitionFeature],decls:4,vars:1,consts:[["aria-live","polite",3,"toasterconfig"]],template:function(e,t){1&e&&(c.ɵɵelement(0,"toaster-container",0),c.ɵɵtext(1," "),c.ɵɵelement(2,"router-outlet"),c.ɵɵtext(3," ")),2&e&&c.ɵɵproperty("toasterconfig",t.toasterConfig)},directives:[p.ToasterContainerComponent,u.RouterOutlet],encapsulation:2}),t}(a.AppComponent);t.AppComponent=d;var m=c.ɵɵgetInheritedFactory(d);("undefined"==typeof ngDevMode||ngDevMode)&&c.ɵsetClassMetadata(d,[{type:o.Component,args:[{selector:"app-root",templateUrl:"../../../src/app/app.component.html"}]}],null,null)},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]"})),n.body=r,n.bodyOutputType=s.BodyOutputType.TrustedHtml}null!=e.options&&(!0===e.options.trustedHtml&&(n.bodyOutputType=s.BodyOutputType.TrustedHtml),null!=e.options.timeout&&e.options.timeout>0&&(n.timeout=e.options.timeout)),this.toasterService.popAsync(n)},e.prototype.idleStateChanged=function(){this.isIdle?this.notificationsService.disconnectFromInactivity():this.notificationsService.reconnectFromActivity()},e.prototype.setFullWidth=function(){return r(this,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,this.storageService.get("enableFullWidth")];case 1:return e.sent()?document.body.classList.add("full-width"):document.body.classList.remove("full-width"),[2]}}))}))},e.ɵfac=function(t){return new(t||e)(S.ɵɵdirectiveInject(b.BroadcasterService),S.ɵɵdirectiveInject(w.UserService),S.ɵɵdirectiveInject(C.TokenService),S.ɵɵdirectiveInject(I.FolderService),S.ɵɵdirectiveInject(E.SettingsService),S.ɵɵdirectiveInject(P.SyncService),S.ɵɵdirectiveInject(k.PasswordGenerationService),S.ɵɵdirectiveInject(O.CipherService),S.ɵɵdirectiveInject(_.AuthService),S.ɵɵdirectiveInject(A.Router),S.ɵɵdirectiveInject(T.ToasterService),S.ɵɵdirectiveInject(M.I18nService),S.ɵɵdirectiveInject(D.PlatformUtilsService),S.ɵɵdirectiveInject(S.NgZone),S.ɵɵdirectiveInject(R.VaultTimeoutService),S.ɵɵdirectiveInject(B.StorageService),S.ɵɵdirectiveInject(j.CryptoService),S.ɵɵdirectiveInject(U.CollectionService),S.ɵɵdirectiveInject(V.DomSanitizer),S.ɵɵdirectiveInject(F.SearchService),S.ɵɵdirectiveInject(N.NotificationsService),S.ɵɵdirectiveInject(z.RouterService),S.ɵɵdirectiveInject(L.StateService),S.ɵɵdirectiveInject(K.EventService),S.ɵɵdirectiveInject(q.PolicyService),S.ɵɵdirectiveInject(G.PolicyListService),S.ɵɵdirectiveInject(W.KeyConnectorService))},e.ɵcmp=S.ɵɵdefineComponent({type:e,selectors:[["app-root"]],decls:4,vars:1,consts:[["aria-live","polite",3,"toasterconfig"]],template:function(e,t){1&e&&(S.ɵɵelement(0,"toaster-container",0),S.ɵɵtext(1," "),S.ɵɵelement(2,"router-outlet"),S.ɵɵtext(3," ")),2&e&&S.ɵɵproperty("toasterconfig",t.toasterConfig)},directives:[T.ToasterContainerComponent,A.RouterOutlet],encapsulation:2}),e}();t.AppComponent=$,("undefined"==typeof ngDevMode||ngDevMode)&&S.ɵsetClassMetadata($,[{type:l.Component,args:[{selector:"app-root",templateUrl:"app.component.html"}]}],(function(){return[{type:b.BroadcasterService},{type:w.UserService},{type:C.TokenService},{type:I.FolderService},{type:E.SettingsService},{type:P.SyncService},{type:k.PasswordGenerationService},{type:O.CipherService},{type:_.AuthService},{type:A.Router},{type:T.ToasterService},{type:M.I18nService},{type:D.PlatformUtilsService},{type:S.NgZone},{type:R.VaultTimeoutService},{type:B.StorageService},{type:j.CryptoService},{type:U.CollectionService},{type:V.DomSanitizer},{type:F.SearchService},{type:N.NotificationsService},{type:z.RouterService},{type:L.StateService},{type:K.EventService},{type:q.PolicyService},{type:G.PolicyListService},{type:W.KeyConnectorService}]}),null)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OrganizationsModule=void 0;var r=n(2),i=n(0),o=n(12),a=n(387),s=n(689),l=n(1145),c=n(0),p=function(){function e(){}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=c.ɵɵdefineNgModule({type:e}),e.ɵinj=c.ɵɵdefineInjector({imports:[[r.CommonModule,o.FormsModule,o.ReactiveFormsModule,a.OssModule,l.OrganizationsRoutingModule]]}),e}();t.OrganizationsModule=p,("undefined"==typeof ngJitMode||ngJitMode)&&c.ɵɵsetNgModuleScope(p,{declarations:[s.SsoComponent],imports:[r.CommonModule,o.FormsModule,o.ReactiveFormsModule,a.OssModule,l.OrganizationsRoutingModule]}),("undefined"==typeof ngDevMode||ngDevMode)&&c.ɵsetClassMetadata(p,[{type:i.NgModule,args:[{imports:[r.CommonModule,o.FormsModule,o.ReactiveFormsModule,a.OssModule,l.OrganizationsRoutingModule],declarations:[s.SsoComponent]}]}],null,null)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OrganizationSsoRequest=void 0;var r=function(){this.enabled=!1};t.OrganizationSsoRequest=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OrganizationsRoutingModule=void 0;var r=n(0),i=n(8),o=n(302),a=n(258),s=n(388),l=n(393),c=n(438),p=n(439),u=n(689),d=n(0),m=n(8),f=[{path:"organizations/:organizationId",component:s.OrganizationLayoutComponent,canActivate:[o.AuthGuardService,c.OrganizationGuardService],children:[{path:"manage",component:l.ManageComponent,canActivate:[p.OrganizationTypeGuardService],data:{permissions:[a.Permissions.CreateNewCollections,a.Permissions.EditAnyCollection,a.Permissions.DeleteAnyCollection,a.Permissions.EditAssignedCollections,a.Permissions.DeleteAssignedCollections,a.Permissions.AccessEventLogs,a.Permissions.ManageGroups,a.Permissions.ManageUsers,a.Permissions.ManagePolicies,a.Permissions.ManageSso]},children:[{path:"sso",component:u.SsoComponent}]}]}],h=function(){function e(){}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=d.ɵɵdefineNgModule({type:e}),e.ɵinj=d.ɵɵdefineInjector({imports:[[i.RouterModule.forChild(f)],i.RouterModule]}),e}();t.OrganizationsRoutingModule=h,("undefined"==typeof ngJitMode||ngJitMode)&&d.ɵɵsetNgModuleScope(h,{imports:[m.RouterModule],exports:[i.RouterModule]}),("undefined"==typeof ngDevMode||ngDevMode)&&d.ɵsetClassMetadata(h,[{type:r.NgModule,args:[{imports:[i.RouterModule.forChild(f)],exports:[i.RouterModule]}]}],null,null)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OssRoutingModule=void 0;var r=n(0),i=n(8),o=n(385),a=n(388),s=n(544),l=n(545),c=n(546),p=n(547),u=n(548),d=n(549),m=n(551),f=n(552),h=n(553),v=n(554),y=n(555),g=n(556),x=n(559),S=n(562),b=n(564),w=n(565),C=n(568),I=n(569),E=n(571),P=n(393),k=n(572),O=n(576),_=n(578),A=n(582),T=n(583),M=n(584),D=n(585),R=n(618),B=n(591),j=n(592),U=n(612),V=n(613),F=n(614),N=n(615),z=n(616),L=n(617),K=n(624),q=n(630),G=n(634),W=n(635),H=n(649),$=n(650),Q=n(662),Y=n(323),J=n(664),X=n(665),Z=n(404),ee=n(398),te=n(669),ne=n(671),re=n(405),ie=n(406),oe=n(417),ae=n(419),se=n(673),le=n(420),ce=n(674),pe=n(421),ue=n(422),de=n(677),me=n(438),fe=n(439),he=n(302),ve=n(690),ye=n(691),ge=n(258),xe=n(656),Se=n(658),be=n(666),we=n(0),Ce=n(8),Ie=[{path:"",component:o.FrontendLayoutComponent,children:[{path:"",pathMatch:"full",component:d.LoginComponent,canActivate:[ye.UnauthGuardService]},{path:"2fa",component:x.TwoFactorComponent,canActivate:[ye.UnauthGuardService]},{path:"register",component:h.RegisterComponent,canActivate:[ye.UnauthGuardService],data:{titleId:"createAccount"}},{path:"sso",component:g.SsoComponent,canActivate:[ye.UnauthGuardService],data:{titleId:"enterpriseSingleSignOn"}},{path:"set-password",component:y.SetPasswordComponent,data:{titleId:"setMasterPassword"}},{path:"hint",component:p.HintComponent,canActivate:[ye.UnauthGuardService],data:{titleId:"passwordHint"}},{path:"lock",component:u.LockComponent,canActivate:[ve.LockGuardService]},{path:"verify-email",component:b.VerifyEmailTokenComponent},{path:"accept-organization",component:c.AcceptOrganizationComponent,data:{titleId:"joinOrganization"}},{path:"accept-emergency",component:l.AcceptEmergencyComponent,data:{titleId:"acceptEmergency"}},{path:"recover",pathMatch:"full",redirectTo:"recover-2fa"},{path:"recover-2fa",component:f.RecoverTwoFactorComponent,canActivate:[ye.UnauthGuardService],data:{titleId:"recoverAccountTwoStep"}},{path:"recover-delete",component:m.RecoverDeleteComponent,canActivate:[ye.UnauthGuardService],data:{titleId:"deleteAccount"}},{path:"verify-recover-delete",component:w.VerifyRecoverDeleteComponent,canActivate:[ye.UnauthGuardService],data:{titleId:"deleteAccount"}},{path:"send/:sendId/:key",component:q.AccessComponent,data:{title:"Bitwarden Send"}},{path:"update-temp-password",component:S.UpdateTempPasswordComponent,canActivate:[he.AuthGuardService],data:{titleId:"updateTempPassword"}},{path:"remove-password",component:v.RemovePasswordComponent,canActivate:[he.AuthGuardService],data:{titleId:"removeMasterPassword"}}]},{path:"",component:s.UserLayoutComponent,canActivate:[he.AuthGuardService],children:[{path:"vault",component:de.VaultComponent,data:{titleId:"myVault"}},{path:"sends",component:G.SendComponent,data:{title:"Send"}},{path:"settings",component:X.SettingsComponent,children:[{path:"",pathMatch:"full",redirectTo:"account"},{path:"account",component:W.AccountComponent,data:{titleId:"myAccount"}},{path:"options",component:Q.OptionsComponent,data:{titleId:"options"}},{path:"domain-rules",component:$.DomainRulesComponent,data:{titleId:"domainRules"}},{path:"two-factor",component:Z.TwoFactorSetupComponent,data:{titleId:"twoStepLogin"}},{path:"premium",component:J.PremiumComponent,data:{titleId:"goPremium"}},{path:"billing",component:ee.UserBillingComponent,data:{titleId:"billing"}},{path:"subscription",component:te.UserSubscriptionComponent,data:{titleId:"premiumMembership"}},{path:"organizations",component:Y.OrganizationsComponent,data:{titleId:"organizations"}},{path:"create-organization",component:H.CreateOrganizationComponent,data:{titleId:"newOrganization"}},{path:"emergency-access",children:[{path:"",component:Se.EmergencyAccessComponent,data:{titleId:"emergencyAccess"}},{path:":id",component:xe.EmergencyAccessViewComponent,data:{titleId:"emergencyAccess"}}]},{path:"sponsored-families",component:be.SponsoredFamiliesComponent,data:{titleId:"sponsoredFamilies"}}]},{path:"tools",component:ce.ToolsComponent,canActivate:[he.AuthGuardService],children:[{path:"",pathMatch:"full",redirectTo:"generator"},{path:"import",component:oe.ImportComponent,data:{titleId:"importData"}},{path:"export",component:re.ExportComponent,data:{titleId:"exportVault"}},{path:"generator",component:se.PasswordGeneratorComponent,data:{titleId:"passwordGenerator"}},{path:"breach-report",component:ne.BreachReportComponent,data:{titleId:"dataBreachReport"}},{path:"reused-passwords-report",component:le.ReusedPasswordsReportComponent,data:{titleId:"reusedPasswordsReport"}},{path:"unsecured-websites-report",component:pe.UnsecuredWebsitesReportComponent,data:{titleId:"unsecuredWebsitesReport"}},{path:"weak-passwords-report",component:ue.WeakPasswordsReportComponent,data:{titleId:"weakPasswordsReport"}},{path:"exposed-passwords-report",component:ie.ExposedPasswordsReportComponent,data:{titleId:"exposedPasswordsReport"}},{path:"inactive-two-factor-report",component:ae.InactiveTwoFactorReportComponent,data:{titleId:"inactive2faReport"}}]},{path:"setup/families-for-enterprise",component:R.FamiliesForEnterpriseSetupComponent}]},{path:"organizations/:organizationId",component:a.OrganizationLayoutComponent,canActivate:[he.AuthGuardService,me.OrganizationGuardService],children:[{path:"",pathMatch:"full",redirectTo:"vault"},{path:"vault",component:K.VaultComponent,data:{titleId:"vault"}},{path:"tools",component:N.ToolsComponent,canActivate:[fe.OrganizationTypeGuardService],data:{permissions:[ge.Permissions.AccessImportExport,ge.Permissions.AccessReports]},children:[{path:"",pathMatch:"full",redirectTo:"import"},{path:"import",component:U.ImportComponent,canActivate:[fe.OrganizationTypeGuardService],data:{titleId:"importData",permissions:[ge.Permissions.AccessImportExport]}},{path:"export",component:B.ExportComponent,canActivate:[fe.OrganizationTypeGuardService],data:{titleId:"exportVault",permissions:[ge.Permissions.AccessImportExport]}},{path:"exposed-passwords-report",component:j.ExposedPasswordsReportComponent,canActivate:[fe.OrganizationTypeGuardService],data:{titleId:"exposedPasswordsReport",permissions:[ge.Permissions.AccessReports]}},{path:"inactive-two-factor-report",component:V.InactiveTwoFactorReportComponent,canActivate:[fe.OrganizationTypeGuardService],data:{titleId:"inactive2faReport",permissions:[ge.Permissions.AccessReports]}},{path:"reused-passwords-report",component:F.ReusedPasswordsReportComponent,canActivate:[fe.OrganizationTypeGuardService],data:{titleId:"reusedPasswordsReport",permissions:[ge.Permissions.AccessReports]}},{path:"unsecured-websites-report",component:z.UnsecuredWebsitesReportComponent,canActivate:[fe.OrganizationTypeGuardService],data:{titleId:"unsecuredWebsitesReport",permissions:[ge.Permissions.AccessReports]}},{path:"weak-passwords-report",component:L.WeakPasswordsReportComponent,canActivate:[fe.OrganizationTypeGuardService],data:{titleId:"weakPasswordsReport",permissions:[ge.Permissions.AccessReports]}}]},{path:"manage",component:P.ManageComponent,canActivate:[fe.OrganizationTypeGuardService],data:{permissions:[ge.Permissions.CreateNewCollections,ge.Permissions.EditAnyCollection,ge.Permissions.DeleteAnyCollection,ge.Permissions.EditAssignedCollections,ge.Permissions.DeleteAssignedCollections,ge.Permissions.AccessEventLogs,ge.Permissions.ManageGroups,ge.Permissions.ManageUsers,ge.Permissions.ManagePolicies]},children:[{path:"",pathMatch:"full",redirectTo:"people"},{path:"collections",component:C.CollectionsComponent,canActivate:[fe.OrganizationTypeGuardService],data:{titleId:"collections",permissions:[ge.Permissions.CreateNewCollections,ge.Permissions.EditAnyCollection,ge.Permissions.DeleteAnyCollection,ge.Permissions.EditAssignedCollections,ge.Permissions.DeleteAssignedCollections]}},{path:"events",component:I.EventsComponent,canActivate:[fe.OrganizationTypeGuardService],data:{titleId:"eventLogs",permissions:[ge.Permissions.AccessEventLogs]}},{path:"groups",component:E.GroupsComponent,canActivate:[fe.OrganizationTypeGuardService],data:{titleId:"groups",permissions:[ge.Permissions.ManageGroups]}},{path:"people",component:k.PeopleComponent,canActivate:[fe.OrganizationTypeGuardService],data:{titleId:"people",permissions:[ge.Permissions.ManageUsers,ge.Permissions.ManageUsersPassword]}},{path:"policies",component:O.PoliciesComponent,canActivate:[fe.OrganizationTypeGuardService],data:{titleId:"policies",permissions:[ge.Permissions.ManagePolicies]}}]},{path:"settings",component:M.SettingsComponent,canActivate:[fe.OrganizationTypeGuardService],data:{permissions:[ge.Permissions.ManageOrganization]},children:[{path:"",pathMatch:"full",redirectTo:"account"},{path:"account",component:_.AccountComponent,data:{titleId:"myOrganization"}},{path:"two-factor",component:D.TwoFactorSetupComponent,data:{titleId:"twoStepLogin"}},{path:"billing",component:A.OrganizationBillingComponent,data:{titleId:"billing"}},{path:"subscription",component:T.OrganizationSubscriptionComponent,data:{titleId:"subscription"}}]}]}],Ee=function(){function e(){}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=we.ɵɵdefineNgModule({type:e}),e.ɵinj=we.ɵɵdefineInjector({imports:[[i.RouterModule.forRoot(Ie,{useHash:!0,paramsInheritanceStrategy:"always"})],i.RouterModule]}),e}();t.OssRoutingModule=Ee,("undefined"==typeof ngJitMode||ngJitMode)&&we.ɵɵsetNgModuleScope(Ee,{imports:[Ce.RouterModule],exports:[i.RouterModule]}),("undefined"==typeof ngDevMode||ngDevMode)&&we.ɵsetClassMetadata(Ee,[{type:r.NgModule,args:[{imports:[i.RouterModule.forRoot(Ie,{useHash:!0,paramsInheritanceStrategy:"always"})],exports:[i.RouterModule]}]}],null,null)},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=0?this.browserCache=a.DeviceType.OperaBrowser:-1!==navigator.userAgent.indexOf(" Edg/")?this.browserCache=a.DeviceType.EdgeBrowser:-1!==navigator.userAgent.indexOf(" Vivaldi/")?this.browserCache=a.DeviceType.VivaldiBrowser:-1!==navigator.userAgent.indexOf(" Safari/")&&-1===navigator.userAgent.indexOf("Chrome")?this.browserCache=a.DeviceType.SafariBrowser:window.chrome&&-1!==navigator.userAgent.indexOf(" Chrome/")?this.browserCache=a.DeviceType.ChromeBrowser:-1!==navigator.userAgent.indexOf(" Trident/")?this.browserCache=a.DeviceType.IEBrowser:this.browserCache=a.DeviceType.UnknownBrowser),this.browserCache},e.prototype.getDeviceString=function(){return a.DeviceType[this.getDevice()].toLowerCase().replace("browser","")},e.prototype.isFirefox=function(){return this.getDevice()===a.DeviceType.FirefoxBrowser},e.prototype.isChrome=function(){return this.getDevice()===a.DeviceType.ChromeBrowser},e.prototype.isEdge=function(){return this.getDevice()===a.DeviceType.EdgeBrowser},e.prototype.isOpera=function(){return this.getDevice()===a.DeviceType.OperaBrowser},e.prototype.isVivaldi=function(){return this.getDevice()===a.DeviceType.VivaldiBrowser},e.prototype.isSafari=function(){return this.getDevice()===a.DeviceType.SafariBrowser},e.prototype.isIE=function(){return this.getDevice()===a.DeviceType.IEBrowser},e.prototype.isMacAppStore=function(){return!1},e.prototype.isViewOpen=function(){return Promise.resolve(!1)},e.prototype.launchUri=function(e,t){var n=document.createElement("a");n.href=e,null!=t&&t.sameWindow||(n.target="_blank",n.rel="noreferrer noopener"),n.classList.add("d-none"),document.body.appendChild(n),n.click(),document.body.removeChild(n)},e.prototype.saveFile=function(e,t,n,r){var i=null,o=null,a=r.toLowerCase(),s=!0;if(a.endsWith(".pdf")?(o="application/pdf",s=!1):a.endsWith(".xlsx")?o="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":a.endsWith(".docx")?o="application/vnd.openxmlformats-officedocument.wordprocessingml.document":a.endsWith(".pptx")?o="application/vnd.openxmlformats-officedocument.presentationml.presentation":a.endsWith(".csv")?o="text/csv":a.endsWith(".png")?o="image/png":a.endsWith(".jpg")||a.endsWith(".jpeg")?o="image/jpeg":a.endsWith(".gif")&&(o="image/gif"),null!=o&&null==(n=n||{}).type&&(n.type=o),i=null==n||this.isIE()?new Blob([t]):new Blob([t],n),navigator.msSaveOrOpenBlob)navigator.msSaveBlob(i,r);else{var l=e.document.createElement("a");s?l.download=r:this.isSafari()||(l.target="_blank"),l.href=URL.createObjectURL(i),l.style.position="fixed",e.document.body.appendChild(l),l.click(),e.document.body.removeChild(l)}},e.prototype.getApplicationVersion=function(){return Promise.resolve("2.25.0")},e.prototype.supportsWebAuthn=function(e){return"undefined"!=typeof PublicKeyCredential},e.prototype.supportsDuo=function(){return!0},e.prototype.showToast=function(e,t,n,r){this.messagingService.send("showToast",{text:n,title:t,type:e,options:r})},e.prototype.showDialog=function(e,t,n,a,s,l){return void 0===l&&(l=!1),r(this,void 0,void 0,(function(){var r,c,p,u;return i(this,(function(i){switch(i.label){case 0:if(r=null,null!=s)switch(s){case"success":r="fa-check text-success";break;case"warning":r="fa-warning text-warning";break;case"error":r="fa-bolt text-danger";break;case"info":r="fa-info-circle text-info"}return null!=(c=document.querySelector("div.modal"))&&c.removeAttribute("tabindex"),p=null!=r?'':void 0,[4,o.default.fire({heightAuto:!1,buttonsStyling:!1,icon:s,iconHtml:p,text:l?null:e,html:l?e:null,titleText:t,showCancelButton:null!=a,cancelButtonText:a,showConfirmButton:!0,confirmButtonText:null==n?this.i18nService.t("ok"):n})];case 1:return u=i.sent(),null!=c&&c.setAttribute("tabindex","-1"),[2,u.value]}}))}))},e.prototype.isDev=function(){return!1},e.prototype.isSelfHost=function(){return"selfhosted"==="cloud".toString()},e.prototype.copyToClipboard=function(e,t){var n=window,r=window.document;if(t&&(t.window||t.win)?r=(n=t.window||t.win).document:t&&t.doc&&(r=t.doc),n.clipboardData&&n.clipboardData.setData)n.clipboardData.setData("Text",e);else if(r.queryCommandSupported&&r.queryCommandSupported("copy")){var i=r.createElement("textarea");i.textContent=e,i.style.position="fixed";var o=r.body;r.body.classList.contains("modal-open")&&(o=r.body.querySelector(".modal")),o.appendChild(i),i.select();var a=!1;try{(a=r.execCommand("copy"))||this.logService.debug("Copy command unsupported or disabled.")}catch(s){console.warn("Copy to clipboard failed.",s)}finally{o.removeChild(i)}return a}},e.prototype.readFromClipboard=function(e){throw new Error("Cannot read from clipboard on web.")},e.prototype.supportsBiometric=function(){return Promise.resolve(!1)},e.prototype.authenticateBiometric=function(){return Promise.resolve(!1)},e.prototype.supportsSecureStorage=function(){return!1},e.prototype.getDefaultSystemTheme=function(){return Promise.resolve(this.prefersColorSchemeDark.matches?s.ThemeType.Dark:s.ThemeType.Light)},e.prototype.getEffectiveTheme=function(){return r(this,void 0,void 0,(function(){var e;return i(this,(function(t){switch(t.label){case 0:return[4,this.storageService().get(l.ConstantsService.themeKey)];case 1:return(e=t.sent())===s.ThemeType.Dark?[2,s.ThemeType.Dark]:e===s.ThemeType.System?[2,this.getDefaultSystemTheme()]:[2,s.ThemeType.Light]}}))}))},e.prototype.onDefaultSystemThemeChange=function(e){try{this.prefersColorSchemeDark.addEventListener("change",(function(t){var n=t.matches;e(n?s.ThemeType.Dark:s.ThemeType.Light)}))}catch(t){this.prefersColorSchemeDark.addListener((function(t){e(t.matches?s.ThemeType.Dark:s.ThemeType.Light)}))}},e}();t.WebPlatformUtilsService=c},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]-1?"&":"?",e+="end="+n),null!=r&&(e+=e.indexOf("?")>-1?"&":"?",e+="continuationToken="+r),e},e.prototype.isJsonResponse=function(e){var t=e.headers.get("content-type");return null!=t&&t.indexOf("application/json")>-1},e.prototype.isTextResponse=function(e){var t=e.headers.get("content-type");return null!=t&&t.indexOf("text")>-1},e}();t.ApiService=se},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.ApiKeyResponse=void 0;var o=function(e){function t(t){var n=e.call(this,t)||this;return n.apiKey=n.getResponseProperty("ApiKey"),n}return i(t,e),t}(n(26).BaseResponse);t.ApiKeyResponse=o},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.AttachmentUploadDataResponse=void 0;var o=n(26),a=n(322),s=function(e){function t(t){var n=e.call(this,t)||this;n.url=null,n.attachmentId=n.getResponseProperty("AttachmentId"),n.fileUploadType=n.getResponseProperty("FileUploadType");var r=n.getResponseProperty("CipherResponse"),i=n.getResponseProperty("CipherMiniResponse");return n.cipherResponse=null==r?null:new a.CipherResponse(r),n.cipherMiniResponse=null==i?null:new a.CipherResponse(i),n.url=n.getResponseProperty("Url"),n}return i(t,e),t}(o.BaseResponse);t.AttachmentUploadDataResponse=s},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.BillingTransactionResponse=t.BillingInvoiceResponse=t.BillingSourceResponse=t.BillingResponse=void 0;var o=n(26),a=function(e){function t(t){var n=e.call(this,t)||this;n.invoices=[],n.transactions=[],n.balance=n.getResponseProperty("Balance");var r=n.getResponseProperty("PaymentSource"),i=n.getResponseProperty("Transactions"),o=n.getResponseProperty("Invoices");return n.paymentSource=null==r?null:new s(r),null!=i&&(n.transactions=i.map((function(e){return new c(e)}))),null!=o&&(n.invoices=o.map((function(e){return new l(e)}))),n}return i(t,e),t}(o.BaseResponse);t.BillingResponse=a;var s=function(e){function t(t){var n=e.call(this,t)||this;return n.type=n.getResponseProperty("Type"),n.cardBrand=n.getResponseProperty("CardBrand"),n.description=n.getResponseProperty("Description"),n.needsVerification=n.getResponseProperty("NeedsVerification"),n}return i(t,e),t}(o.BaseResponse);t.BillingSourceResponse=s;var l=function(e){function t(t){var n=e.call(this,t)||this;return n.url=n.getResponseProperty("Url"),n.pdfUrl=n.getResponseProperty("PdfUrl"),n.number=n.getResponseProperty("Number"),n.paid=n.getResponseProperty("Paid"),n.date=n.getResponseProperty("Date"),n.amount=n.getResponseProperty("Amount"),n}return i(t,e),t}(o.BaseResponse);t.BillingInvoiceResponse=l;var c=function(e){function t(t){var n=e.call(this,t)||this;return n.createdDate=n.getResponseProperty("CreatedDate"),n.amount=n.getResponseProperty("Amount"),n.refunded=n.getResponseProperty("Refunded"),n.partiallyRefunded=n.getResponseProperty("PartiallyRefunded"),n.refundedAmount=n.getResponseProperty("RefundedAmount"),n.type=n.getResponseProperty("Type"),n.paymentMethodType=n.getResponseProperty("PaymentMethodType"),n.details=n.getResponseProperty("Details"),n}return i(t,e),t}(o.BaseResponse);t.BillingTransactionResponse=c},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.BreachAccountResponse=void 0;var o=function(e){function t(t){var n=e.call(this,t)||this;return n.addedDate=n.getResponseProperty("AddedDate"),n.breachDate=n.getResponseProperty("BreachDate"),n.dataClasses=n.getResponseProperty("DataClasses"),n.description=n.getResponseProperty("Description"),n.domain=n.getResponseProperty("Domain"),n.isActive=n.getResponseProperty("IsActive"),n.isVerified=n.getResponseProperty("IsVerified"),n.logoPath=n.getResponseProperty("LogoPath"),n.modifiedDate=n.getResponseProperty("ModifiedDate"),n.name=n.getResponseProperty("Name"),n.pwnCount=n.getResponseProperty("PwnCount"),n.title=n.getResponseProperty("Title"),n}return i(t,e),t}(n(26).BaseResponse);t.BreachAccountResponse=o},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.GlobalDomainResponse=void 0;var o=function(e){function t(t){var n=e.call(this,t)||this;return n.type=n.getResponseProperty("Type"),n.domains=n.getResponseProperty("Domains"),n.excluded=n.getResponseProperty("Excluded"),n}return i(t,e),t}(n(26).BaseResponse);t.GlobalDomainResponse=o},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.EventResponse=void 0;var o=function(e){function t(t){var n=e.call(this,t)||this;return n.type=n.getResponseProperty("Type"),n.userId=n.getResponseProperty("UserId"),n.organizationId=n.getResponseProperty("OrganizationId"),n.providerId=n.getResponseProperty("ProviderId"),n.cipherId=n.getResponseProperty("CipherId"),n.collectionId=n.getResponseProperty("CollectionId"),n.groupId=n.getResponseProperty("GroupId"),n.policyId=n.getResponseProperty("PolicyId"),n.organizationUserId=n.getResponseProperty("OrganizationUserId"),n.providerUserId=n.getResponseProperty("ProviderUserId"),n.providerOrganizationId=n.getResponseProperty("ProviderOrganizationId"),n.actingUserId=n.getResponseProperty("ActingUserId"),n.date=n.getResponseProperty("Date"),n.deviceType=n.getResponseProperty("DeviceType"),n.ipAddress=n.getResponseProperty("IpAddress"),n}return i(t,e),t}(n(26).BaseResponse);t.EventResponse=o},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.GroupDetailsResponse=t.GroupResponse=void 0;var o=n(26),a=n(324),s=function(e){function t(t){var n=e.call(this,t)||this;return n.id=n.getResponseProperty("Id"),n.organizationId=n.getResponseProperty("OrganizationId"),n.name=n.getResponseProperty("Name"),n.accessAll=n.getResponseProperty("AccessAll"),n.externalId=n.getResponseProperty("ExternalId"),n}return i(t,e),t}(o.BaseResponse);t.GroupResponse=s;var l=function(e){function t(t){var n=e.call(this,t)||this;n.collections=[];var r=n.getResponseProperty("Collections");return null!=r&&(n.collections=r.map((function(e){return new a.SelectionReadOnlyResponse(e)}))),n}return i(t,e),t}(s);t.GroupDetailsResponse=l},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.IdentityCaptchaResponse=void 0;var o=function(e){function t(t){var n=e.call(this,t)||this;return n.siteKey=n.getResponseProperty("HCaptcha_SiteKey"),n}return i(t,e),t}(n(26).BaseResponse);t.IdentityCaptchaResponse=o},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.IdentityTokenResponse=void 0;var o=function(e){function t(t){var n=e.call(this,t)||this;return n.accessToken=t.access_token,n.expiresIn=t.expires_in,n.refreshToken=t.refresh_token,n.tokenType=t.token_type,n.resetMasterPassword=n.getResponseProperty("ResetMasterPassword"),n.privateKey=n.getResponseProperty("PrivateKey"),n.key=n.getResponseProperty("Key"),n.twoFactorToken=n.getResponseProperty("TwoFactorToken"),n.kdf=n.getResponseProperty("Kdf"),n.kdfIterations=n.getResponseProperty("KdfIterations"),n.forcePasswordReset=n.getResponseProperty("ForcePasswordReset"),n.apiUseKeyConnector=n.getResponseProperty("ApiUseKeyConnector"),n.keyConnectorUrl=n.getResponseProperty("KeyConnectorUrl"),n}return i(t,e),t}(n(26).BaseResponse);t.IdentityTokenResponse=o},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.IdentityTwoFactorResponse=void 0;var o=function(e){function t(t){var n=e.call(this,t)||this;n.twoFactorProviders2=new Map,n.captchaToken=n.getResponseProperty("CaptchaBypassToken"),n.twoFactorProviders=n.getResponseProperty("TwoFactorProviders");var r=n.getResponseProperty("TwoFactorProviders2");if(null!=r)for(var i in r)r.hasOwnProperty(i)&&n.twoFactorProviders2.set(parseInt(i,null),r[i]);return n}return i(t,e),t}(n(26).BaseResponse);t.IdentityTwoFactorResponse=o},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.ListResponse=void 0;var o=function(e){function t(t,n){var r=e.call(this,t)||this,i=r.getResponseProperty("Data");return r.data=null==i?[]:i.map((function(e){return new n(e)})),r.continuationToken=r.getResponseProperty("ContinuationToken"),r}return i(t,e),t}(n(26).BaseResponse);t.ListResponse=o},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.OrganizationSsoResponse=void 0;var o=n(1169),a=n(26),s=function(e){function t(t){var n=e.call(this,t)||this;return n.enabled=n.getResponseProperty("Enabled"),n.data=new o.SsoConfigApi(n.getResponseProperty("Data")),n.urls=new l(n.getResponseProperty("Urls")),n}return i(t,e),t}(a.BaseResponse);t.OrganizationSsoResponse=s;var l=function(e){function t(t){var n=e.call(this,t)||this;return n.callbackPath=n.getResponseProperty("CallbackPath"),n.signedOutCallbackPath=n.getResponseProperty("SignedOutCallbackPath"),n.spEntityId=n.getResponseProperty("SpEntityId"),n.spMetadataUrl=n.getResponseProperty("SpMetadataUrl"),n.spAcsUrl=n.getResponseProperty("SpAcsUrl"),n}return i(t,e),t}(a.BaseResponse)},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.SsoConfigApi=void 0;var o,a,s,l,c,p=n(26);!function(e){e[e.OpenIdConnect=1]="OpenIdConnect",e[e.Saml2=2]="Saml2"}(o||(o={})),function(e){e[e.RedirectGet=0]="RedirectGet",e[e.FormPost=1]="FormPost"}(a||(a={})),function(e){e[e.HttpRedirect=1]="HttpRedirect",e[e.HttpPost=2]="HttpPost",e[e.Artifact=4]="Artifact"}(s||(s={})),function(e){e[e.NotConfigured=0]="NotConfigured",e[e.Unspecified=1]="Unspecified",e[e.EmailAddress=2]="EmailAddress",e[e.X509SubjectName=3]="X509SubjectName",e[e.WindowsDomainQualifiedName=4]="WindowsDomainQualifiedName",e[e.KerberosPrincipalName=5]="KerberosPrincipalName",e[e.EntityIdentifier=6]="EntityIdentifier",e[e.Persistent=7]="Persistent",e[e.Transient=8]="Transient"}(l||(l={})),function(e){e[e.IfIdpWantAuthnRequestsSigned=0]="IfIdpWantAuthnRequestsSigned",e[e.Always=1]="Always",e[e.Never=3]="Never"}(c||(c={}));var u=function(e){function t(t){void 0===t&&(t=null);var n=e.call(this,t)||this;return null==t||(n.configType=n.getResponseProperty("ConfigType"),n.keyConnectorEnabled=n.getResponseProperty("KeyConnectorEnabled"),n.keyConnectorUrl=n.getResponseProperty("KeyConnectorUrl"),n.authority=n.getResponseProperty("Authority"),n.clientId=n.getResponseProperty("ClientId"),n.clientSecret=n.getResponseProperty("ClientSecret"),n.metadataAddress=n.getResponseProperty("MetadataAddress"),n.redirectBehavior=n.getResponseProperty("RedirectBehavior"),n.getClaimsFromUserInfoEndpoint=n.getResponseProperty("GetClaimsFromUserInfoEndpoint"),n.additionalScopes=n.getResponseProperty("AdditionalScopes"),n.additionalUserIdClaimTypes=n.getResponseProperty("AdditionalUserIdClaimTypes"),n.additionalEmailClaimTypes=n.getResponseProperty("AdditionalEmailClaimTypes"),n.additionalNameClaimTypes=n.getResponseProperty("AdditionalNameClaimTypes"),n.acrValues=n.getResponseProperty("AcrValues"),n.expectedReturnAcrValue=n.getResponseProperty("ExpectedReturnAcrValue"),n.spNameIdFormat=n.getResponseProperty("SpNameIdFormat"),n.spOutboundSigningAlgorithm=n.getResponseProperty("SpOutboundSigningAlgorithm"),n.spSigningBehavior=n.getResponseProperty("SpSigningBehavior"),n.spMinIncomingSigningAlgorithm=n.getResponseProperty("SpMinIncomingSigningAlgorithm"),n.spWantAssertionsSigned=n.getResponseProperty("SpWantAssertionsSigned"),n.spValidateCertificates=n.getResponseProperty("SpValidateCertificates"),n.idpEntityId=n.getResponseProperty("IdpEntityId"),n.idpBindingType=n.getResponseProperty("IdpBindingType"),n.idpSingleSignOnServiceUrl=n.getResponseProperty("IdpSingleSignOnServiceUrl"),n.idpSingleLogoutServiceUrl=n.getResponseProperty("IdpSingleLogoutServiceUrl"),n.idpArtifactResolutionServiceUrl=n.getResponseProperty("IdpArtifactResolutionServiceUrl"),n.idpX509PublicCert=n.getResponseProperty("IdpX509PublicCert"),n.idpOutboundSigningAlgorithm=n.getResponseProperty("IdpOutboundSigningAlgorithm"),n.idpAllowUnsolicitedAuthnResponse=n.getResponseProperty("IdpAllowUnsolicitedAuthnResponse"),n.idpDisableOutboundLogoutRequests=n.getResponseProperty("IdpDisableOutboundLogoutRequests"),n.idpWantAuthnRequestsSigned=n.getResponseProperty("IdpWantAuthnRequestsSigned")),n}return i(t,e),t}(p.BaseResponse);t.SsoConfigApi=u},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.OrganizationAutoEnrollStatusResponse=void 0;var o=function(e){function t(t){var n=e.call(this,t)||this;return n.id=n.getResponseProperty("Id"),n.resetPasswordEnabled=n.getResponseProperty("ResetPasswordEnabled"),n}return i(t,e),t}(n(26).BaseResponse);t.OrganizationAutoEnrollStatusResponse=o},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.OrganizationKeysResponse=void 0;var o=function(e){function t(t){return e.call(this,t)||this}return i(t,e),t}(n(1172).KeysResponse);t.OrganizationKeysResponse=o},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.KeysResponse=void 0;var o=function(e){function t(t){var n=e.call(this,t)||this;return n.privateKey=n.getResponseProperty("PrivateKey"),n.publicKey=n.getResponseProperty("PublicKey"),n}return i(t,e),t}(n(26).BaseResponse);t.KeysResponse=o},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.OrganizationSubscriptionResponse=void 0;var o=n(695),a=n(697),s=function(e){function t(t){var n=e.call(this,t)||this;n.storageName=n.getResponseProperty("StorageName"),n.storageGb=n.getResponseProperty("StorageGb");var r=n.getResponseProperty("Subscription");n.subscription=null==r?null:new a.BillingSubscriptionResponse(r);var i=n.getResponseProperty("UpcomingInvoice");return n.upcomingInvoice=null==i?null:new a.BillingSubscriptionUpcomingInvoiceResponse(i),n.expiration=n.getResponseProperty("Expiration"),n}return i(t,e),t}(o.OrganizationResponse);t.OrganizationSubscriptionResponse=s},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.OrganizationUserBulkResponse=void 0;var o=function(e){function t(t){var n=e.call(this,t)||this;return n.id=n.getResponseProperty("Id"),n.error=n.getResponseProperty("Error"),n}return i(t,e),t}(n(26).BaseResponse);t.OrganizationUserBulkResponse=o},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.OrganizationUserResetPasswordDetailsReponse=t.OrganizationUserDetailsResponse=t.OrganizationUserUserDetailsResponse=t.OrganizationUserResponse=void 0;var o=n(26),a=n(324),s=n(228),l=function(e){function t(t){var n=e.call(this,t)||this;return n.id=n.getResponseProperty("Id"),n.userId=n.getResponseProperty("UserId"),n.type=n.getResponseProperty("Type"),n.status=n.getResponseProperty("Status"),n.permissions=new s.PermissionsApi(n.getResponseProperty("Permissions")),n.accessAll=n.getResponseProperty("AccessAll"),n.resetPasswordEnrolled=n.getResponseProperty("ResetPasswordEnrolled"),n}return i(t,e),t}(o.BaseResponse);t.OrganizationUserResponse=l;var c=function(e){function t(t){var n,r=e.call(this,t)||this;return r.name=r.getResponseProperty("Name"),r.email=r.getResponseProperty("Email"),r.twoFactorEnabled=r.getResponseProperty("TwoFactorEnabled"),r.usesKeyConnector=null!==(n=r.getResponseProperty("UsesKeyConnector"))&&void 0!==n&&n,r}return i(t,e),t}(l);t.OrganizationUserUserDetailsResponse=c;var p=function(e){function t(t){var n=e.call(this,t)||this;n.collections=[];var r=n.getResponseProperty("Collections");return null!=r&&(n.collections=r.map((function(e){return new a.SelectionReadOnlyResponse(e)}))),n}return i(t,e),t}(l);t.OrganizationUserDetailsResponse=p;var u=function(e){function t(t){var n=e.call(this,t)||this;return n.kdf=n.getResponseProperty("Kdf"),n.kdfIterations=n.getResponseProperty("KdfIterations"),n.resetPasswordKey=n.getResponseProperty("ResetPasswordKey"),n.encryptedPrivateKey=n.getResponseProperty("EncryptedPrivateKey"),n}return i(t,e),t}(o.BaseResponse);t.OrganizationUserResetPasswordDetailsReponse=u},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.PaymentResponse=void 0;var o=n(26),a=n(440),s=function(e){function t(t){var n=e.call(this,t)||this,r=n.getResponseProperty("UserProfile");return null!=r&&(n.userProfile=new a.ProfileResponse(r)),n.paymentIntentClientSecret=n.getResponseProperty("PaymentIntentClientSecret"),n.success=n.getResponseProperty("Success"),n}return i(t,e),t}(o.BaseResponse);t.PaymentResponse=s},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.ProfileProviderOrganizationResponse=void 0;var o=function(e){function t(t){var n=e.call(this,t)||this;return n.keyConnectorEnabled=!1,n}return i(t,e),t}(n(699).ProfileOrganizationResponse);t.ProfileProviderOrganizationResponse=o},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.ProfileProviderResponse=void 0;var o=n(26),a=n(228),s=function(e){function t(t){var n=e.call(this,t)||this;return n.id=n.getResponseProperty("Id"),n.name=n.getResponseProperty("Name"),n.key=n.getResponseProperty("Key"),n.status=n.getResponseProperty("Status"),n.type=n.getResponseProperty("Type"),n.enabled=n.getResponseProperty("Enabled"),n.permissions=new a.PermissionsApi(n.getResponseProperty("permissions")),n.userId=n.getResponseProperty("UserId"),n.useEvents=n.getResponseProperty("UseEvents"),n}return i(t,e),t}(o.BaseResponse);t.ProfileProviderResponse=s},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.PreloginResponse=void 0;var o=function(e){function t(t){var n=e.call(this,t)||this;return n.kdf=n.getResponseProperty("Kdf"),n.kdfIterations=n.getResponseProperty("KdfIterations"),n}return i(t,e),t}(n(26).BaseResponse);t.PreloginResponse=o},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.ProviderOrganizationOrganizationDetailsResponse=t.ProviderOrganizationResponse=void 0;var o=function(e){function t(t){var n=e.call(this,t)||this;return n.id=n.getResponseProperty("Id"),n.providerId=n.getResponseProperty("ProviderId"),n.organizationId=n.getResponseProperty("OrganizationId"),n.key=n.getResponseProperty("Key"),n.settings=n.getResponseProperty("Settings"),n.creationDate=n.getResponseProperty("CreationDate"),n.revisionDate=n.getResponseProperty("RevisionDate"),n}return i(t,e),t}(n(26).BaseResponse);t.ProviderOrganizationResponse=o;var a=function(e){function t(t){var n=e.call(this,t)||this;return n.organizationName=n.getResponseProperty("OrganizationName"),n}return i(t,e),t}(o);t.ProviderOrganizationOrganizationDetailsResponse=a},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.ProviderResponse=void 0;var o=function(e){function t(t){var n=e.call(this,t)||this;return n.id=n.getResponseProperty("Id"),n.name=n.getResponseProperty("Name"),n.businessName=n.getResponseProperty("BusinessName"),n.billingEmail=n.getResponseProperty("BillingEmail"),n}return i(t,e),t}(n(26).BaseResponse);t.ProviderResponse=o},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.ProviderUserBulkPublicKeyResponse=void 0;var o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t}(n(698).OrganizationUserBulkPublicKeyResponse);t.ProviderUserBulkPublicKeyResponse=o},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.ProviderUserBulkResponse=void 0;var o=function(e){function t(t){var n=e.call(this,t)||this;return n.id=n.getResponseProperty("Id"),n.error=n.getResponseProperty("Error"),n}return i(t,e),t}(n(26).BaseResponse);t.ProviderUserBulkResponse=o},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.ProviderUserUserDetailsResponse=t.ProviderUserResponse=void 0;var o=n(26),a=n(228),s=function(e){function t(t){var n=e.call(this,t)||this;return n.id=n.getResponseProperty("Id"),n.userId=n.getResponseProperty("UserId"),n.type=n.getResponseProperty("Type"),n.status=n.getResponseProperty("Status"),n.permissions=new a.PermissionsApi(n.getResponseProperty("Permissions")),n}return i(t,e),t}(o.BaseResponse);t.ProviderUserResponse=s;var l=function(e){function t(t){var n=e.call(this,t)||this;return n.name=n.getResponseProperty("Name"),n.email=n.getResponseProperty("Email"),n}return i(t,e),t}(s);t.ProviderUserUserDetailsResponse=l},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.SendAccessResponse=void 0;var o=n(26),a=n(432),s=n(433),l=function(e){function t(t){var n=e.call(this,t)||this;n.id=n.getResponseProperty("Id"),n.type=n.getResponseProperty("Type"),n.name=n.getResponseProperty("Name");var r=n.getResponseProperty("Text");null!=r&&(n.text=new s.SendTextApi(r));var i=n.getResponseProperty("File");return null!=i&&(n.file=new a.SendFileApi(i)),n.expirationDate=n.getResponseProperty("ExpirationDate"),n.creatorIdentifier=n.getResponseProperty("CreatorIdentifier"),n}return i(t,e),t}(o.BaseResponse);t.SendAccessResponse=l},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.SendFileDownloadDataResponse=void 0;var o=function(e){function t(t){var n=e.call(this,t)||this;return n.id=null,n.url=null,n.id=n.getResponseProperty("Id"),n.url=n.getResponseProperty("Url"),n}return i(t,e),t}(n(26).BaseResponse);t.SendFileDownloadDataResponse=o},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.SendFileUploadDataResponse=void 0;var o=n(26),a=n(441),s=function(e){function t(t){var n=e.call(this,t)||this;n.url=null,n.fileUploadType=n.getResponseProperty("FileUploadType");var r=n.getResponseProperty("SendResponse");return n.sendResponse=null==r?null:new a.SendResponse(r),n.url=n.getResponseProperty("Url"),n}return i(t,e),t}(o.BaseResponse);t.SendFileUploadDataResponse=s},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.SyncResponse=void 0;var o=n(26),a=n(322),s=n(692),l=n(693),c=n(694),p=n(314),u=n(440),d=n(441),m=function(e){function t(t){var n=e.call(this,t)||this;n.folders=[],n.collections=[],n.ciphers=[],n.policies=[],n.sends=[];var r=n.getResponseProperty("Profile");null!=r&&(n.profile=new u.ProfileResponse(r));var i=n.getResponseProperty("Folders");null!=i&&(n.folders=i.map((function(e){return new c.FolderResponse(e)})));var o=n.getResponseProperty("Collections");null!=o&&(n.collections=o.map((function(e){return new s.CollectionDetailsResponse(e)})));var m=n.getResponseProperty("Ciphers");null!=m&&(n.ciphers=m.map((function(e){return new a.CipherResponse(e)})));var f=n.getResponseProperty("Domains");null!=f&&(n.domains=new l.DomainsResponse(f));var h=n.getResponseProperty("Policies");null!=h&&(n.policies=h.map((function(e){return new p.PolicyResponse(e)})));var v=n.getResponseProperty("Sends");return null!=v&&(n.sends=v.map((function(e){return new d.SendResponse(e)}))),n}return i(t,e),t}(o.BaseResponse);t.SyncResponse=m},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.TaxInfoResponse=void 0;var o=function(e){function t(t){var n=e.call(this,t)||this;return n.taxId=n.getResponseProperty("TaxIdNumber"),n.taxIdType=n.getResponseProperty("TaxIdType"),n.line1=n.getResponseProperty("Line1"),n.line2=n.getResponseProperty("Line2"),n.city=n.getResponseProperty("City"),n.state=n.getResponseProperty("State"),n.postalCode=n.getResponseProperty("PostalCode"),n.country=n.getResponseProperty("Country"),n}return i(t,e),t}(n(26).BaseResponse);t.TaxInfoResponse=o},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.TaxRateResponse=void 0;var o=function(e){function t(t){var n=e.call(this,t)||this;return n.id=n.getResponseProperty("Id"),n.country=n.getResponseProperty("Country"),n.state=n.getResponseProperty("State"),n.postalCode=n.getResponseProperty("PostalCode"),n.rate=n.getResponseProperty("Rate"),n}return i(t,e),t}(n(26).BaseResponse);t.TaxRateResponse=o},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.TwoFactorAuthenticatorResponse=void 0;var o=function(e){function t(t){var n=e.call(this,t)||this;return n.enabled=n.getResponseProperty("Enabled"),n.key=n.getResponseProperty("Key"),n}return i(t,e),t}(n(26).BaseResponse);t.TwoFactorAuthenticatorResponse=o},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.TwoFactorDuoResponse=void 0;var o=function(e){function t(t){var n=e.call(this,t)||this;return n.enabled=n.getResponseProperty("Enabled"),n.host=n.getResponseProperty("Host"),n.secretKey=n.getResponseProperty("SecretKey"),n.integrationKey=n.getResponseProperty("IntegrationKey"),n}return i(t,e),t}(n(26).BaseResponse);t.TwoFactorDuoResponse=o},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.TwoFactorEmailResponse=void 0;var o=function(e){function t(t){var n=e.call(this,t)||this;return n.enabled=n.getResponseProperty("Enabled"),n.email=n.getResponseProperty("Email"),n}return i(t,e),t}(n(26).BaseResponse);t.TwoFactorEmailResponse=o},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.TwoFactorProviderResponse=void 0;var o=function(e){function t(t){var n=e.call(this,t)||this;return n.enabled=n.getResponseProperty("Enabled"),n.type=n.getResponseProperty("Type"),n}return i(t,e),t}(n(26).BaseResponse);t.TwoFactorProviderResponse=o},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.TwoFactorRecoverResponse=void 0;var o=function(e){function t(t){var n=e.call(this,t)||this;return n.code=n.getResponseProperty("Code"),n}return i(t,e),t}(n(26).BaseResponse);t.TwoFactorRecoverResponse=o},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.TwoFactorYubiKeyResponse=void 0;var o=function(e){function t(t){var n=e.call(this,t)||this;return n.enabled=n.getResponseProperty("Enabled"),n.key1=n.getResponseProperty("Key1"),n.key2=n.getResponseProperty("Key2"),n.key3=n.getResponseProperty("Key3"),n.key4=n.getResponseProperty("Key4"),n.key5=n.getResponseProperty("Key5"),n.nfc=n.getResponseProperty("Nfc"),n}return i(t,e),t}(n(26).BaseResponse);t.TwoFactorYubiKeyResponse=o},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.UserKeyResponse=void 0;var o=function(e){function t(t){var n=e.call(this,t)||this;return n.userId=n.getResponseProperty("UserId"),n.publicKey=n.getResponseProperty("PublicKey"),n}return i(t,e),t}(n(26).BaseResponse);t.UserKeyResponse=o},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.KeyConnectorUserKeyResponse=void 0;var o=function(e){function t(t){var n=e.call(this,t)||this;return n.key=n.getResponseProperty("Key"),n}return i(t,e),t}(n(26).BaseResponse);t.KeyConnectorUserKeyResponse=o},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=e?p[e-1]():0===p.length&&(l.delete(c),0===l.size&&a.delete(n))};o.apply(n,r).then((function(e){return u(),e})).catch((function(e){throw u(),e})).then(t,i)};p.push(s),p.length<=e&&s()}))}}}}},function(e,t,n){"use strict";(function(e){var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]5&&(e.passwordHistory=e.passwordHistory.slice(0,5)),a.label=5;case 5:return(p=new m.Cipher).id=e.id,p.folderId=e.folderId,p.favorite=e.favorite,p.organizationId=e.organizationId,p.type=e.type,p.collectionIds=e.collectionIds,p.revisionDate=e.revisionDate,p.reprompt=e.reprompt,null!=t||null==p.organizationId?[3,7]:[4,this.cryptoService.getOrgKey(p.organizationId)];case 6:if(null==(t=a.sent()))throw new Error("Cannot encrypt cipher for organization. No key.");a.label=7;case 7:return[4,Promise.all([this.encryptObjProperty(e,p,{name:null,notes:null},t),this.encryptCipherData(p,e,t),this.encryptFields(e.fields,t).then((function(e){p.fields=e})),this.encryptPasswordHistories(e.passwordHistory,t).then((function(e){p.passwordHistory=e})),this.encryptAttachments(e.attachments,t).then((function(e){p.attachments=e}))])];case 8:return a.sent(),[2,p]}}))}))},t.prototype.encryptAttachments=function(e,t){return o(this,void 0,void 0,(function(){var n,r,i=this;return a(this,(function(s){switch(s.label){case 0:return null==e||0===e.length?[2,null]:(n=[],r=[],e.forEach((function(e){return o(i,void 0,void 0,(function(){var i,s,l=this;return a(this,(function(c){return(i=new u.Attachment).id=e.id,i.size=e.size,i.sizeName=e.sizeName,i.url=e.url,s=this.encryptObjProperty(e,i,{fileName:null},t).then((function(){return o(l,void 0,void 0,(function(){var n;return a(this,(function(o){switch(o.label){case 0:return null==e.key?[3,2]:(n=i,[4,this.cryptoService.encrypt(e.key.key,t)]);case 1:n.key=o.sent(),o.label=2;case 2:return r.push(i),[2]}}))}))})),n.push(s),[2]}))}))})),[4,Promise.all(n)]);case 1:return s.sent(),[2,r]}}))}))},t.prototype.encryptFields=function(e,t){return o(this,void 0,void 0,(function(){var n,r;return a(this,(function(i){switch(i.label){case 0:return e&&e.length?(n=this,r=[],[4,e.reduce((function(e,i){return e.then((function(){return n.encryptField(i,t)})).then((function(e){r.push(e)}))}),Promise.resolve())]):[2,null];case 1:return i.sent(),[2,r]}}))}))},t.prototype.encryptField=function(e,t){return o(this,void 0,void 0,(function(){var n;return a(this,(function(r){switch(r.label){case 0:return(n=new f.Field).type=e.type,n.linkedId=e.linkedId,e.type===l.FieldType.Boolean&&"true"!==e.value&&(e.value="false"),[4,this.encryptObjProperty(e,n,{name:null,value:null},t)];case 1:return r.sent(),[2,n]}}))}))},t.prototype.encryptPasswordHistories=function(e,t){return o(this,void 0,void 0,(function(){var n,r;return a(this,(function(i){switch(i.label){case 0:return e&&e.length?(n=this,r=[],[4,e.reduce((function(e,i){return e.then((function(){return n.encryptPasswordHistory(i,t)})).then((function(e){r.push(e)}))}),Promise.resolve())]):[2,null];case 1:return i.sent(),[2,r]}}))}))},t.prototype.encryptPasswordHistory=function(e,t){return o(this,void 0,void 0,(function(){var n;return a(this,(function(r){switch(r.label){case 0:return(n=new g.Password).lastUsedDate=e.lastUsedDate,[4,this.encryptObjProperty(e,n,{password:null},t)];case 1:return r.sent(),[2,n]}}))}))},t.prototype.get=function(e){return o(this,void 0,void 0,(function(){var t,n,r;return a(this,(function(i){switch(i.label){case 0:return[4,this.userService.getUserId()];case 1:return t=i.sent(),[4,this.storageService.get(B)];case 2:return n=i.sent(),[4,this.storageService.get(R+t)];case 3:return null!=(r=i.sent())&&r.hasOwnProperty(e)?[2,new m.Cipher(r[e],!1,n?n[e]:null)]:[2,null]}}))}))},t.prototype.getAll=function(){return o(this,void 0,void 0,(function(){var e,t,n,r,i;return a(this,(function(o){switch(o.label){case 0:return[4,this.userService.getUserId()];case 1:return e=o.sent(),[4,this.storageService.get(B)];case 2:return t=o.sent(),[4,this.storageService.get(R+e)];case 3:for(i in n=o.sent(),r=[],n)n.hasOwnProperty(i)&&r.push(new m.Cipher(n[i],!1,t?t[i]:null));return[2,r]}}))}))},t.prototype.getAllDecrypted=function(){var e;return o(this,void 0,void 0,(function(){var t,n,r;return a(this,(function(i){switch(i.label){case 0:return null==this.decryptedCipherCache?[3,4]:[4,this.userService.getUserId()];case 1:return t=i.sent(),null==this.searchService||(null!==(e=this.searchService().indexedEntityId)&&void 0!==e?e:t)===t?[3,3]:[4,this.searchService().indexCiphers(t,this.decryptedCipherCache)];case 2:i.sent(),i.label=3;case 3:return[2,this.decryptedCipherCache];case 4:return n=[],[4,this.cryptoService.hasKey()];case 5:if(!i.sent())throw new Error("No key.");return r=[],[4,this.getAll()];case 6:return i.sent().forEach((function(e){r.push(e.decrypt().then((function(e){return n.push(e)})))})),[4,Promise.all(r)];case 7:return i.sent(),n.sort(this.getLocaleSortingFunction()),this.decryptedCipherCache=n,[2,this.decryptedCipherCache]}}))}))},t.prototype.getAllDecryptedForGrouping=function(e,t){return void 0===t&&(t=!0),o(this,void 0,void 0,(function(){return a(this,(function(n){switch(n.label){case 0:return[4,this.getAllDecrypted()];case 1:return[2,n.sent().filter((function(n){return!n.isDeleted&&(!(!t||n.folderId!==e)||!t&&null!=n.collectionIds&&n.collectionIds.indexOf(e)>-1)}))]}}))}))},t.prototype.getAllDecryptedForUrl=function(e,t,n){return void 0===n&&(n=null),o(this,void 0,void 0,(function(){var r,i,o,l,p,u=this;return a(this,(function(a){switch(a.label){case 0:return null==e&&null==t?[2,Promise.resolve([])]:(r=D.Utils.getDomain(e),i=null==r?Promise.resolve([]):this.settingsService.getEquivalentDomains().then((function(e){var t=[];return e.forEach((function(e){e.length&&e.indexOf(r)>=0&&(t=t.concat(e))})),t.length||t.push(r),t})),[4,Promise.all([i,this.getAllDecrypted()])]);case 1:return o=a.sent(),l=o[0],p=o[1],null!=n?[3,3]:[4,this.storageService.get(T.ConstantsService.defaultUriMatch)];case 2:null==(n=a.sent())&&(n=c.UriMatchType.Domain),a.label=3;case 3:return[2,p.filter((function(i){if(null!=i.deletedDate)return!1;if(null!=t&&t.indexOf(i.type)>-1)return!0;if(null!=e&&i.type===s.CipherType.Login&&null!=i.login.uris)for(var o=0;o-1){if(!U.has(a.domain))return!0;var p=D.Utils.getHost(e);if(!U.get(a.domain).has(p))return!0}break;case c.UriMatchType.Host:var d=D.Utils.getHost(e);if(null!=d&&d===D.Utils.getHost(a.uri))return!0;break;case c.UriMatchType.Exact:if(e===a.uri)return!0;break;case c.UriMatchType.StartsWith:if(e.startsWith(a.uri))return!0;break;case c.UriMatchType.RegularExpression:try{if(new RegExp(a.uri,"i").test(e))return!0}catch(m){u.logService.error(m)}case c.UriMatchType.Never:}}return!1}))]}}))}))},t.prototype.getAllFromApiForOrganization=function(e){return o(this,void 0,void 0,(function(){var t,n,r;return a(this,(function(i){switch(i.label){case 0:return[4,this.apiService.getCiphersOrganization(e)];case 1:return null!=(t=i.sent())&&null!=t.data&&t.data.length?(n=[],r=[],t.data.forEach((function(e){var t=new p.CipherData(e),i=new m.Cipher(t);r.push(i.decrypt().then((function(e){return n.push(e)})))})),[4,Promise.all(r)]):[3,3];case 2:return i.sent(),n.sort(this.getLocaleSortingFunction()),[2,n];case 3:return[2,[]]}}))}))},t.prototype.getLastUsedForUrl=function(e,t){return void 0===t&&(t=!1),o(this,void 0,void 0,(function(){return a(this,(function(n){return[2,this.getCipherForUrl(e,!0,!1,t)]}))}))},t.prototype.getLastLaunchedForUrl=function(e,t){return void 0===t&&(t=!1),o(this,void 0,void 0,(function(){return a(this,(function(n){return[2,this.getCipherForUrl(e,!1,!0,t)]}))}))},t.prototype.getNextCipherForUrl=function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){return[2,this.getCipherForUrl(e,!1,!1,!1)]}))}))},t.prototype.updateLastUsedIndexForUrl=function(e){this.sortedCiphersCache.updateLastUsedIndex(e)},t.prototype.updateLastUsedDate=function(e){return o(this,void 0,void 0,(function(){var t,n,r;return a(this,(function(i){switch(i.label){case 0:return[4,this.storageService.get(B)];case 1:return(t=i.sent())||(t={}),t[e]?t[e].lastUsedDate=(new Date).getTime():t[e]={lastUsedDate:(new Date).getTime()},[4,this.storageService.save(B,t)];case 2:if(i.sent(),null==this.decryptedCipherCache)return[2];for(n=0;nr?-1:null!=r&&null==n?1:0},t.prototype.sortCiphersByLastUsedThenName=function(e,t){var n=this.sortCiphersByLastUsed(e,t);return 0!==n?n:this.getLocaleSortingFunction()(e,t)},t.prototype.getLocaleSortingFunction=function(){var e=this;return function(t,n){var r=t.name,i=n.name;if(null==r&&null!=i)return-1;if(null!=r&&null==i)return 1;if(null==r&&null==i)return 0;var o=e.i18nService.collator?e.i18nService.collator.compare(r,i):r.localeCompare(i);return 0!==o||t.type!==s.CipherType.Login||n.type!==s.CipherType.Login?o:(null!=t.login.username&&(r+=t.login.username),null!=n.login.username&&(i+=n.login.username),e.i18nService.collator?e.i18nService.collator.compare(r,i):r.localeCompare(i))}},t.prototype.softDelete=function(e){return o(this,void 0,void 0,(function(){var t,n,r;return a(this,(function(i){switch(i.label){case 0:return[4,this.userService.getUserId()];case 1:return t=i.sent(),[4,this.storageService.get(R+t)];case 2:return null==(n=i.sent())?[2]:(r=function(e){null!=n[e]&&(n[e].deletedDate=(new Date).toISOString())},"string"==typeof e?r(e):e.forEach(r),[4,this.storageService.save(R+t,n)]);case 3:return i.sent(),this.decryptedCipherCache=null,[2]}}))}))},t.prototype.softDeleteWithServer=function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){switch(t.label){case 0:return[4,this.apiService.putDeleteCipher(e)];case 1:return t.sent(),[4,this.softDelete(e)];case 2:return t.sent(),[2]}}))}))},t.prototype.softDeleteManyWithServer=function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){switch(t.label){case 0:return[4,this.apiService.putDeleteManyCiphers(new S.CipherBulkDeleteRequest(e))];case 1:return t.sent(),[4,this.softDelete(e)];case 2:return t.sent(),[2]}}))}))},t.prototype.restore=function(e){return o(this,void 0,void 0,(function(){var t,n,r;return a(this,(function(i){switch(i.label){case 0:return[4,this.userService.getUserId()];case 1:return t=i.sent(),[4,this.storageService.get(R+t)];case 2:return null==(n=i.sent())?[2]:(r=function(e){null!=n[e.id]&&(n[e.id].deletedDate=null,n[e.id].revisionDate=e.revisionDate)},"Array"===e.constructor.name?e.forEach(r):r(e),[4,this.storageService.save(R+t,n)]);case 3:return i.sent(),this.decryptedCipherCache=null,[2]}}))}))},t.prototype.restoreWithServer=function(e){return o(this,void 0,void 0,(function(){var t;return a(this,(function(n){switch(n.label){case 0:return[4,this.apiService.putRestoreCipher(e)];case 1:return t=n.sent(),[4,this.restore({id:e,revisionDate:t.revisionDate})];case 2:return n.sent(),[2]}}))}))},t.prototype.restoreManyWithServer=function(e){return o(this,void 0,void 0,(function(){var t,n,r,i,o;return a(this,(function(a){switch(a.label){case 0:return[4,this.apiService.putRestoreManyCiphers(new w.CipherBulkRestoreRequest(e))];case 1:for(t=a.sent(),n=[],r=0,i=t.data;r0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0?[2,this.orgKeys]:[4,this.storageService.get(t.Keys.encOrgKeys)];case 1:if(null==(e=a.sent()))return[2,null];for(o in n=new Map,r=!1,i=[],e)i.push(o);s=0,a.label=2;case 2:return s0?[2,this.providerKeys]:[4,this.storageService.get(t.Keys.encProviderKeys)];case 1:if(null==(e=a.sent()))return[2,null];for(o in n=new Map,r=!1,i=[],e)i.push(o);s=0,a.label=2;case 2:return s53)throw new Error("We cannot generate numbers larger than 53 bits.");return o=Math.ceil(i/8),s=Math.pow(2,i)-1,c=Uint8Array.bind,[4,this.cryptoFunctionService.randomBytes(o)];case 1:for(l=new(c.apply(Uint8Array,[void 0,a.sent()])),p=8*(o-1),u=0;u=r?[2,this.randomNumber(e,t)]:[2,e+n]}}))}))},e.prototype.validateKey=function(e){return o(this,void 0,void 0,(function(){var n,r,i;return a(this,(function(o){switch(o.label){case 0:return o.trys.push([0,5,,6]),[4,this.storageService.get(t.Keys.encPrivateKey)];case 1:return n=o.sent(),[4,this.getEncKey(e)];case 2:return r=o.sent(),null==n||null==r?[2,!1]:[4,this.decryptToBytes(new m.EncString(n),r)];case 3:return i=o.sent(),[4,this.cryptoFunctionService.rsaExtractPublicKey(i)];case 4:return o.sent(),[3,6];case 5:return o.sent(),[2,!1];case 6:return[2,!0]}}))}))},e.prototype.storeKey=function(e){return o(this,void 0,void 0,(function(){var n;return a(this,(function(r){switch(r.label){case 0:return[4,this.shouldStoreKey("auto")];case 1:return(n=r.sent())?[3,3]:[4,this.shouldStoreKey("biometric")];case 2:n=r.sent(),r.label=3;case 3:return n?this.secureStorageService.save(t.Keys.key,e.keyB64):this.secureStorageService.remove(t.Keys.key),[2]}}))}))},e.prototype.shouldStoreKey=function(e){return o(this,void 0,void 0,(function(){var t,n,r;return a(this,(function(i){switch(i.label){case 0:return t=!1,"auto"!==e?[3,2]:[4,this.storageService.get(h.ConstantsService.vaultTimeoutKey)];case 1:return n=i.sent(),t=null==n,[3,4];case 2:return"biometric"!==e?[3,4]:[4,this.storageService.get(h.ConstantsService.biometricUnlockKey)];case 3:r=i.sent(),t=r&&this.platformUtilService.supportsSecureStorage(),i.label=4;case 4:return[2,t]}}))}))},e.prototype.retrieveKeyFromStorage=function(e){return this.secureStorageService.get(t.Keys.key,{keySuffix:e})},e.prototype.aesEncrypt=function(e,t){return o(this,void 0,void 0,(function(){var n,r,i,o,s,l;return a(this,(function(a){switch(a.label){case 0:return n=new d.EncryptedObject,r=n,[4,this.getKeyForEncryption(t)];case 1:return r.key=a.sent(),i=n,[4,this.cryptoFunctionService.randomBytes(16)];case 2:return i.iv=a.sent(),o=n,[4,this.cryptoFunctionService.aesEncrypt(e,n.iv,n.key.encKey)];case 3:return o.data=a.sent(),null==n.key.macKey?[3,5]:((s=new Uint8Array(n.iv.byteLength+n.data.byteLength)).set(new Uint8Array(n.iv),0),s.set(new Uint8Array(n.data),n.iv.byteLength),l=n,[4,this.cryptoFunctionService.hmac(s.buffer,n.key.macKey,"sha256")]);case 4:l.mac=a.sent(),a.label=5;case 5:return[2,n]}}))}))},e.prototype.aesDecryptToUtf8=function(e,t,n,r,i){return o(this,void 0,void 0,(function(){var o,s,l,c;return a(this,(function(a){switch(a.label){case 0:return[4,this.getKeyForEncryption(i)];case 1:return o=a.sent(),null!=(s=this.resolveLegacyKey(e,o)).macKey&&null==r?(this.logService.error("mac required."),[2,null]):s.encType!==e?(this.logService.error("encType unavailable."),[2,null]):null==(l=this.cryptoFunctionService.aesDecryptFastParameters(t,n,r,s)).macKey||null==l.mac?[3,4]:[4,this.cryptoFunctionService.hmacFast(l.macData,l.macKey,"sha256")];case 2:return c=a.sent(),[4,this.cryptoFunctionService.compareFast(l.mac,c)];case 3:if(!a.sent())return this.logService.error("mac failed."),[2,null];a.label=4;case 4:return[2,this.cryptoFunctionService.aesDecryptFast(l)]}}))}))},e.prototype.aesDecryptToBytes=function(e,t,n,r,i){return o(this,void 0,void 0,(function(){var o,s,l,c;return a(this,(function(a){switch(a.label){case 0:return[4,this.getKeyForEncryption(i)];case 1:return o=a.sent(),null!=(s=this.resolveLegacyKey(e,o)).macKey&&null==r?[2,null]:s.encType!==e?[2,null]:null==s.macKey||null==r?[3,4]:((l=new Uint8Array(n.byteLength+t.byteLength)).set(new Uint8Array(n),0),l.set(new Uint8Array(t),n.byteLength),[4,this.cryptoFunctionService.hmac(l.buffer,s.macKey,"sha256")]);case 2:return null===(c=a.sent())?[2,null]:[4,this.cryptoFunctionService.compare(r,c)];case 3:if(!a.sent())return this.logService.error("mac failed."),[2,null];a.label=4;case 4:return[4,this.cryptoFunctionService.aesDecrypt(t,n,s.encKey)];case 5:return[2,a.sent()]}}))}))},e.prototype.getKeyForEncryption=function(e){return o(this,void 0,void 0,(function(){var t;return a(this,(function(n){switch(n.label){case 0:return null!=e?[2,e]:[4,this.getEncKey()];case 1:return null!=(t=n.sent())?[2,t]:[4,this.getKey()];case 2:return[2,n.sent()]}}))}))},e.prototype.resolveLegacyKey=function(e,t){return e===l.EncryptionType.AesCbc128_HmacSha256_B64&&t.encType===l.EncryptionType.AesCbc256_B64?(null==this.legacyEtmKey&&(this.legacyEtmKey=new f.SymmetricCryptoKey(t.key,l.EncryptionType.AesCbc128_HmacSha256_B64)),this.legacyEtmKey):t},e.prototype.stretchKey=function(e){return o(this,void 0,void 0,(function(){var t,n,r;return a(this,(function(i){switch(i.label){case 0:return t=new Uint8Array(64),[4,this.cryptoFunctionService.hkdfExpand(e.key,"enc",32,"sha256")];case 1:return n=i.sent(),[4,this.cryptoFunctionService.hkdfExpand(e.key,"mac",32,"sha256")];case 2:return r=i.sent(),t.set(new Uint8Array(n)),t.set(new Uint8Array(r),32),[2,new f.SymmetricCryptoKey(t.buffer)]}}))}))},e.prototype.hashPhrase=function(e,t){return void 0===t&&(t=64),o(this,void 0,void 0,(function(){var n,r,i,o,l,c,p;return a(this,(function(a){if(n=Math.log(g.EEFLongWordList.length)/Math.log(2),r=Math.ceil(t/n),i=Array.from(new Uint8Array(e)),o=4*i.length,r*n>o)throw new Error("Output entropy of hash function is too small");for(l=[],c=s.fromArray(i,256);r--;)p=c.mod(g.EEFLongWordList.length),c=c.divide(g.EEFLongWordList.length),l.push(g.EEFLongWordList[p]);return[2,l]}))}))},e.prototype.buildEncKey=function(e,t){return o(this,void 0,void 0,(function(){var n,r;return a(this,(function(i){switch(i.label){case 0:return n=null,32!==e.key.byteLength?[3,3]:[4,this.stretchKey(e)];case 1:return r=i.sent(),[4,this.encrypt(t,r)];case 2:case 4:return n=i.sent(),[3,6];case 3:return 64!==e.key.byteLength?[3,5]:[4,this.encrypt(t,e)];case 5:throw new Error("Invalid key size.");case 6:return[2,[new f.SymmetricCryptoKey(t),n]]}}))}))},r([v.sequentialize((function(){return"getEncKey"})),i("design:type",Function),i("design:paramtypes",[f.SymmetricCryptoKey]),i("design:returntype",Promise)],e.prototype,"getEncKey",null),r([v.sequentialize((function(){return"getOrgKeys"})),i("design:type",Function),i("design:paramtypes",[]),i("design:returntype",Promise)],e.prototype,"getOrgKeys",null),r([v.sequentialize((function(){return"getProviderKeys"})),i("design:type",Function),i("design:paramtypes",[]),i("design:returntype",Promise)],e.prototype,"getProviderKeys",null),e}();t.CryptoService=x},,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EncArrayBuffer=void 0;var r=function(e){this.buffer=e};t.EncArrayBuffer=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EncryptedObject=void 0;var r=function(){};t.EncryptedObject=r},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&e.data.forEach((function(e){var r=new l.Collection(new p.CollectionData(e));t.push(r.decrypt().then((function(e){n.push(e)})))})),Promise.all(t)}))),m.push(this.apiService.getCiphersOrganization(e).then((function(e){var t=[];return null!=e&&null!=e.data&&e.data.length>0&&e.data.filter((function(e){return null===e.deletedDate})).forEach((function(e){var n=new s.Cipher(new c.CipherData(e));t.push(n.decrypt().then((function(e){r.push(e)})))})),Promise.all(t)}))),[4,Promise.all(m)];case 1:return i.sent(),"csv"===t?(f=new Map,n.forEach((function(e){f.set(e.id,e)})),h=[],r.forEach((function(e){if(e.type===a.CipherType.Login||e.type===a.CipherType.SecureNote){var t={collections:[]};null!=e.collectionIds&&(t.collections=e.collectionIds.filter((function(e){return f.has(e)})).map((function(e){return f.get(e).name}))),y.buildCommonCipher(t,e),h.push(t)}})),[2,o.unparse(h)]):(v={encrypted:!1,collections:[],items:[]},n.forEach((function(e){var t=new d.CollectionWithId;t.build(e),v.collections.push(t)})),r.forEach((function(e){var t=new u.CipherWithIds;t.build(e),v.items.push(t)})),[2,JSON.stringify(v,null," ")])}}))}))},e.prototype.getOrganizationEncryptedExport=function(e){return r(this,void 0,void 0,(function(){var t,n,r,o,a,m;return i(this,(function(i){switch(i.label){case 0:return t=[],n=[],(r=[]).push(this.apiService.getCollections(e).then((function(e){return null!=e&&null!=e.data&&e.data.length>0&&e.data.forEach((function(e){var n=new l.Collection(new p.CollectionData(e));t.push(n)})),Promise.all([])}))),r.push(this.apiService.getCiphersOrganization(e).then((function(e){return null!=e&&null!=e.data&&e.data.length>0&&e.data.filter((function(e){return null===e.deletedDate})).forEach((function(e){var t=new s.Cipher(new c.CipherData(e));n.push(t)})),Promise.all([])}))),[4,Promise.all(r)];case 1:return i.sent(),[4,this.cryptoService.getOrgKey(e)];case 2:return o=i.sent(),[4,this.cryptoService.encrypt(h.Utils.newGuid(),o)];case 3:return a=i.sent(),m={encrypted:!0,encKeyValidation_DO_NOT_EDIT:a.encryptedString,collections:[],items:[]},t.forEach((function(e){var t=new d.CollectionWithId;t.build(e),m.collections.push(t)})),n.forEach((function(e){var t=new u.CipherWithIds;t.build(e),m.items.push(t)})),[2,JSON.stringify(m,null," ")]}}))}))},e.prototype.padNumber=function(e,t,n){void 0===n&&(n="0");var r=e.toString();return r.length>=t?r:new Array(t-r.length+1).join(n)+r},e.prototype.buildCommonCipher=function(e,t){switch(e.type=null,e.name=t.name,e.notes=t.notes,e.fields=null,e.reprompt=t.reprompt,e.login_uri=null,e.login_username=null,e.login_password=null,e.login_totp=null,t.fields&&t.fields.forEach((function(t){e.fields?e.fields+="\n":e.fields="",e.fields+=(t.name||"")+": "+t.value})),t.type){case a.CipherType.Login:e.type="login",e.login_username=t.login.username,e.login_password=t.login.password,e.login_totp=t.login.totp,t.login.uris&&(e.login_uri=[],t.login.uris.forEach((function(t){e.login_uri.push(t.uri)})));break;case a.CipherType.SecureNote:e.type="note";break;default:return}return e},e}();t.ExportService=v},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Cipher=void 0;var r=n(187),i=n(43),o=n(144),a=n(207),s=n(102),l=n(1224),c=n(1225),p=n(1226),u=n(1227),d=n(1229),m=function(){function e(){}return e.template=function(){var t=new e;return t.organizationId=null,t.collectionIds=null,t.folderId=null,t.type=i.CipherType.Login,t.name="Item name",t.notes="Some notes about this item.",t.favorite=!1,t.fields=[],t.login=null,t.secureNote=null,t.card=null,t.identity=null,t.reprompt=r.CipherRepromptType.None,t},e.toView=function(e,t){var n,a,s;if(void 0===t&&(t=new o.CipherView),t.type=e.type,t.folderId=e.folderId,null==t.organizationId&&(t.organizationId=e.organizationId),t.collectionIds||e.collectionIds){var m=new Set((null!==(n=t.collectionIds)&&void 0!==n?n:[]).concat(null!==(a=e.collectionIds)&&void 0!==a?a:[]));t.collectionIds=Array.from(m.values())}switch(t.name=e.name,t.notes=e.notes,t.favorite=e.favorite,t.reprompt=null!==(s=e.reprompt)&&void 0!==s?s:r.CipherRepromptType.None,null!=e.fields&&(t.fields=e.fields.map((function(e){return c.Field.toView(e)}))),e.type){case i.CipherType.Login:t.login=u.Login.toView(e.login);break;case i.CipherType.SecureNote:t.secureNote=d.SecureNote.toView(e.secureNote);break;case i.CipherType.Card:t.card=l.Card.toView(e.card);break;case i.CipherType.Identity:t.identity=p.Identity.toView(e.identity)}return t},e.toDomain=function(e,t){var n;switch(void 0===t&&(t=new a.Cipher),t.type=e.type,t.folderId=e.folderId,null==t.organizationId&&(t.organizationId=e.organizationId),t.name=null!=e.name?new s.EncString(e.name):null,t.notes=null!=e.notes?new s.EncString(e.notes):null,t.favorite=e.favorite,t.reprompt=null!==(n=e.reprompt)&&void 0!==n?n:r.CipherRepromptType.None,null!=e.fields&&(t.fields=e.fields.map((function(e){return c.Field.toDomain(e)}))),e.type){case i.CipherType.Login:t.login=u.Login.toDomain(e.login);break;case i.CipherType.SecureNote:t.secureNote=d.SecureNote.toDomain(e.secureNote);break;case i.CipherType.Card:t.card=l.Card.toDomain(e.card);break;case i.CipherType.Identity:t.identity=p.Identity.toDomain(e.identity)}return t},e.prototype.build=function(e){var t,n;switch(this.organizationId=e.organizationId,this.folderId=e.folderId,this.type=e.type,this.reprompt=e.reprompt,e instanceof o.CipherView?(this.name=e.name,this.notes=e.notes):(this.name=null===(t=e.name)||void 0===t?void 0:t.encryptedString,this.notes=null===(n=e.notes)||void 0===n?void 0:n.encryptedString),this.favorite=e.favorite,null!=e.fields&&(o.CipherView,this.fields=e.fields.map((function(e){return new c.Field(e)}))),e.type){case i.CipherType.Login:this.login=new u.Login(e.login);break;case i.CipherType.SecureNote:this.secureNote=new d.SecureNote(e.secureNote);break;case i.CipherType.Card:this.card=new l.Card(e.card);break;case i.CipherType.Identity:this.identity=new p.Identity(e.identity)}},e}();t.Cipher=m},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Card=void 0;var r=n(92),i=n(410),o=n(102),a=function(){function e(e){var t,n,i,o,a,s;null!=e&&(e instanceof r.CardView?(this.cardholderName=e.cardholderName,this.brand=e.brand,this.number=e.number,this.expMonth=e.expMonth,this.expYear=e.expYear,this.code=e.code):(this.cardholderName=null===(t=e.cardholderName)||void 0===t?void 0:t.encryptedString,this.brand=null===(n=e.brand)||void 0===n?void 0:n.encryptedString,this.number=null===(i=e.number)||void 0===i?void 0:i.encryptedString,this.expMonth=null===(o=e.expMonth)||void 0===o?void 0:o.encryptedString,this.expYear=null===(a=e.expYear)||void 0===a?void 0:a.encryptedString,this.code=null===(s=e.code)||void 0===s?void 0:s.encryptedString))}return e.template=function(){var t=new e;return t.cardholderName="John Doe",t.brand="visa",t.number="4242424242424242",t.expMonth="04",t.expYear="2023",t.code="123",t},e.toView=function(e,t){return void 0===t&&(t=new r.CardView),t.cardholderName=e.cardholderName,t.brand=e.brand,t.number=e.number,t.expMonth=e.expMonth,t.expYear=e.expYear,t.code=e.code,t},e.toDomain=function(e,t){return void 0===t&&(t=new i.Card),t.cardholderName=null!=e.cardholderName?new o.EncString(e.cardholderName):null,t.brand=null!=e.brand?new o.EncString(e.brand):null,t.number=null!=e.number?new o.EncString(e.number):null,t.expMonth=null!=e.expMonth?new o.EncString(e.expMonth):null,t.expYear=null!=e.expYear?new o.EncString(e.expYear):null,t.code=null!=e.code?new o.EncString(e.code):null,t},e}();t.Card=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Field=void 0;var r=n(137),i=n(266),o=n(102),a=n(411),s=function(){function e(e){var t,n;null!=e&&(e instanceof i.FieldView?(this.name=e.name,this.value=e.value):(this.name=null===(t=e.name)||void 0===t?void 0:t.encryptedString,this.value=null===(n=e.value)||void 0===n?void 0:n.encryptedString),this.type=e.type,this.linkedId=e.linkedId)}return e.template=function(){var t=new e;return t.name="Field name",t.value="Some value",t.type=r.FieldType.Text,t},e.toView=function(e,t){return void 0===t&&(t=new i.FieldView),t.type=e.type,t.value=e.value,t.name=e.name,t.linkedId=e.linkedId,t},e.toDomain=function(e,t){return void 0===t&&(t=new a.Field),t.type=e.type,t.value=null!=e.value?new o.EncString(e.value):null,t.name=null!=e.name?new o.EncString(e.name):null,t.linkedId=e.linkedId,t},e}();t.Field=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Identity=void 0;var r=n(145),i=n(102),o=n(412),a=function(){function e(e){var t,n,i,o,a,s,l,c,p,u,d,m,f,h,v,y,g,x;null!=e&&(e instanceof r.IdentityView?(this.title=e.title,this.firstName=e.firstName,this.middleName=e.middleName,this.lastName=e.lastName,this.address1=e.address1,this.address2=e.address2,this.address3=e.address3,this.city=e.city,this.state=e.state,this.postalCode=e.postalCode,this.country=e.country,this.company=e.company,this.email=e.email,this.phone=e.phone,this.ssn=e.ssn,this.username=e.username,this.passportNumber=e.passportNumber,this.licenseNumber=e.licenseNumber):(this.title=null===(t=e.title)||void 0===t?void 0:t.encryptedString,this.firstName=null===(n=e.firstName)||void 0===n?void 0:n.encryptedString,this.middleName=null===(i=e.middleName)||void 0===i?void 0:i.encryptedString,this.lastName=null===(o=e.lastName)||void 0===o?void 0:o.encryptedString,this.address1=null===(a=e.address1)||void 0===a?void 0:a.encryptedString,this.address2=null===(s=e.address2)||void 0===s?void 0:s.encryptedString,this.address3=null===(l=e.address3)||void 0===l?void 0:l.encryptedString,this.city=null===(c=e.city)||void 0===c?void 0:c.encryptedString,this.state=null===(p=e.state)||void 0===p?void 0:p.encryptedString,this.postalCode=null===(u=e.postalCode)||void 0===u?void 0:u.encryptedString,this.country=null===(d=e.country)||void 0===d?void 0:d.encryptedString,this.company=null===(m=e.company)||void 0===m?void 0:m.encryptedString,this.email=null===(f=e.email)||void 0===f?void 0:f.encryptedString,this.phone=null===(h=e.phone)||void 0===h?void 0:h.encryptedString,this.ssn=null===(v=e.ssn)||void 0===v?void 0:v.encryptedString,this.username=null===(y=e.username)||void 0===y?void 0:y.encryptedString,this.passportNumber=null===(g=e.passportNumber)||void 0===g?void 0:g.encryptedString,this.licenseNumber=null===(x=e.licenseNumber)||void 0===x?void 0:x.encryptedString))}return e.template=function(){var t=new e;return t.title="Mr",t.firstName="John",t.middleName="William",t.lastName="Doe",t.address1="123 Any St",t.address2="Apt #123",t.address3=null,t.city="New York",t.state="NY",t.postalCode="10001",t.country="US",t.company="Acme Inc.",t.email="john@company.com",t.phone="5555551234",t.ssn="000-123-4567",t.username="jdoe",t.passportNumber="US-123456789",t.licenseNumber="D123-12-123-12333",t},e.toView=function(e,t){return void 0===t&&(t=new r.IdentityView),t.title=e.title,t.firstName=e.firstName,t.middleName=e.middleName,t.lastName=e.lastName,t.address1=e.address1,t.address2=e.address2,t.address3=e.address3,t.city=e.city,t.state=e.state,t.postalCode=e.postalCode,t.country=e.country,t.company=e.company,t.email=e.email,t.phone=e.phone,t.ssn=e.ssn,t.username=e.username,t.passportNumber=e.passportNumber,t.licenseNumber=e.licenseNumber,t},e.toDomain=function(e,t){return void 0===t&&(t=new o.Identity),t.title=null!=e.title?new i.EncString(e.title):null,t.firstName=null!=e.firstName?new i.EncString(e.firstName):null,t.middleName=null!=e.middleName?new i.EncString(e.middleName):null,t.lastName=null!=e.lastName?new i.EncString(e.lastName):null,t.address1=null!=e.address1?new i.EncString(e.address1):null,t.address2=null!=e.address2?new i.EncString(e.address2):null,t.address3=null!=e.address3?new i.EncString(e.address3):null,t.city=null!=e.city?new i.EncString(e.city):null,t.state=null!=e.state?new i.EncString(e.state):null,t.postalCode=null!=e.postalCode?new i.EncString(e.postalCode):null,t.country=null!=e.country?new i.EncString(e.country):null,t.company=null!=e.company?new i.EncString(e.company):null,t.email=null!=e.email?new i.EncString(e.email):null,t.phone=null!=e.phone?new i.EncString(e.phone):null,t.ssn=null!=e.ssn?new i.EncString(e.ssn):null,t.username=null!=e.username?new i.EncString(e.username):null,t.passportNumber=null!=e.passportNumber?new i.EncString(e.passportNumber):null,t.licenseNumber=null!=e.licenseNumber?new i.EncString(e.licenseNumber):null,t},e}();t.Identity=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Login=void 0;var r=n(1228),i=n(165),o=n(102),a=n(413),s=function(){function e(e){var t,n,o;null!=e&&(null!=e.uris&&(i.LoginView,this.uris=e.uris.map((function(e){return new r.LoginUri(e)}))),e instanceof i.LoginView?(this.username=e.username,this.password=e.password,this.totp=e.totp):(this.username=null===(t=e.username)||void 0===t?void 0:t.encryptedString,this.password=null===(n=e.password)||void 0===n?void 0:n.encryptedString,this.totp=null===(o=e.totp)||void 0===o?void 0:o.encryptedString))}return e.template=function(){var t=new e;return t.uris=[],t.username="jdoe",t.password="myp@ssword123",t.totp="JBSWY3DPEHPK3PXP",t},e.toView=function(e,t){return void 0===t&&(t=new i.LoginView),null!=e.uris&&(t.uris=e.uris.map((function(e){return r.LoginUri.toView(e)}))),t.username=e.username,t.password=e.password,t.totp=e.totp,t},e.toDomain=function(e,t){return void 0===t&&(t=new a.Login),null!=e.uris&&(t.uris=e.uris.map((function(e){return r.LoginUri.toDomain(e)}))),t.username=null!=e.username?new o.EncString(e.username):null,t.password=null!=e.password?new o.EncString(e.password):null,t.totp=null!=e.totp?new o.EncString(e.totp):null,t},e}();t.Login=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LoginUri=void 0;var r=n(316),i=n(102),o=n(414),a=function(){function e(e){var t;this.match=null,null!=e&&(e instanceof r.LoginUriView?this.uri=e.uri:this.uri=null===(t=e.uri)||void 0===t?void 0:t.encryptedString,this.match=e.match)}return e.template=function(){var t=new e;return t.uri="https://google.com",t.match=null,t},e.toView=function(e,t){return void 0===t&&(t=new r.LoginUriView),t.uri=e.uri,t.match=e.match,t},e.toDomain=function(e,t){return void 0===t&&(t=new o.LoginUri),t.uri=null!=e.uri?new i.EncString(e.uri):null,t.match=e.match,t},e}();t.LoginUri=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SecureNote=void 0;var r=n(109),i=n(108),o=n(416),a=function(){function e(e){null!=e&&(this.type=e.type)}return e.template=function(){var t=new e;return t.type=r.SecureNoteType.Generic,t},e.toView=function(e,t){return void 0===t&&(t=new i.SecureNoteView),t.type=e.type,t},e.toDomain=function(e,t){return void 0===t&&(t=new o.SecureNote),t.type=e.type,t},e}();t.SecureNote=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Collection=void 0;var r=n(185),i=n(184),o=n(102),a=function(){function e(){}return e.template=function(){var t=new e;return t.organizationId="00000000-0000-0000-0000-000000000000",t.name="Collection name",t.externalId=null,t},e.toView=function(e,t){return void 0===t&&(t=new r.CollectionView),t.name=e.name,t.externalId=e.externalId,null==t.organizationId&&(t.organizationId=e.organizationId),t},e.toDomain=function(e,t){return void 0===t&&(t=new i.Collection),t.name=null!=e.name?new o.EncString(e.name):null,t.externalId=e.externalId,null==t.organizationId&&(t.organizationId=e.organizationId),t},e.prototype.build=function(e){var t;this.organizationId=e.organizationId,e instanceof r.CollectionView?this.name=e.name:this.name=null===(t=e.name)||void 0===t?void 0:t.encryptedString,this.externalId=e.externalId},e}();t.Collection=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Event=void 0;var r=n(202),i=function(e){this.message=e.humanReadableMessage,this.appIcon=e.appIcon,this.appName=e.appName,this.userId=e.userId,this.userName=e.userName,this.userEmail=e.userEmail,this.date=e.date,this.ip=e.ip,this.type=r.EventType[e.type]};t.Event=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Folder=void 0;var r=n(146),i=n(102),o=n(709),a=function(){function e(){}return e.template=function(){var t=new e;return t.name="Folder name",t},e.toView=function(e,t){return void 0===t&&(t=new r.FolderView),t.name=e.name,t},e.toDomain=function(e,t){return void 0===t&&(t=new o.Folder),t.name=null!=e.name?new i.EncString(e.name):null,t},e.prototype.build=function(e){var t;e instanceof r.FolderView?this.name=e.name:this.name=null===(t=e.name)||void 0===t?void 0:t.encryptedString},e}();t.Folder=a},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]5e4)throw new Error("Cannot upload file, exceeds maximum size of "+5e4*a);i.label=1;case 1:i.trys.push([1,12,,13]),i.label=2;case 2:return s"})),t+=""},e.prototype.getMaxBlockSize=function(e){return s.compare(e,"2019-12-12")>=0?4194304e3:s.compare(e,"2016-05-31")>=0?104857600:4194304},e}();t.AzureFileUploadService=a;var s=function(){function e(e){this.year=0,this.month=0,this.day=0;try{var t=e.split("-").map((function(e){return Number.parseInt(e,10)}));this.year=t[0],this.month=t[1],this.day=t[2]}catch(n){}}return e.compare=function(t,n){return"string"==typeof t&&(t=new e(t)),"string"==typeof n&&(n=new e(n)),t.year!==n.year?t.year-n.year:t.month!==n.month?t.month-n.month:t.day!==n.day?t.day-n.day:0},e.prototype.compare=function(t){return e.compare(this,t)},e}()},function(e,t,n){"use strict";(function(e){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&this.cipherService.upsert(o)}return[2]}}))}))},e.prototype.deleteWithServer=function(e){return r(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.apiService.deleteFolder(e)];case 1:return t.sent(),[4,this.delete(e)];case 2:return t.sent(),[2]}}))}))},e}();t.FolderService=m},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&(o=Math.floor(r.ciphers.length/2),s=r.ciphers.length-1,this.badData(r.ciphers[0])&&this.badData(r.ciphers[o])&&this.badData(r.ciphers[s])))return[2,new Error(this.i18nService.t("importFormatError"))];i.label=2;case 2:return i.trys.push([2,4,,5]),[4,this.postImport(r,n)];case 3:return i.sent(),[3,5];case 4:return l=i.sent(),c=new m.ErrorResponse(l,400),[2,this.handleServerError(c,r)];case 5:return[2,null];case 6:return a.Utils.isNullOrWhitespace(r.errorMessage)?[2,new Error(this.i18nService.t("importFormatError"))]:[2,new Error(r.errorMessage)];case 7:return[2]}}))}))},e.prototype.getImporter=function(e,t){void 0===t&&(t=null);var n=this.getImporterInstance(e);return null==n?null:(n.organizationId=t,n)},e.prototype.getImporterInstance=function(e){if(null==e||""===e)return null;switch(e){case"bitwardencsv":return new g.BitwardenCsvImporter;case"bitwardenjson":return new x.BitwardenJsonImporter(this.cryptoService,this.i18nService);case"lastpasscsv":case"passboltcsv":return new U.LastPassCsvImporter;case"keepassxcsv":return new B.KeePassXCsvImporter;case"aviracsv":return new y.AviraCsvImporter;case"blurcsv":return new b.BlurCsvImporter;case"safeincloudxml":return new ie.SafeInCloudXmlImporter;case"padlockcsv":return new W.PadlockCsvImporter;case"keepass2xml":return new R.KeePass2XmlImporter;case"chromecsv":case"operacsv":case"vivaldicsv":return new C.ChromeCsvImporter;case"firefoxcsv":return new A.FirefoxCsvImporter;case"upmcsv":return new pe.UpmCsvImporter;case"saferpasscsv":return new oe.SaferPassCsvImporter;case"safaricsv":return new re.SafariCsvImporter;case"meldiumcsv":return new F.MeldiumCsvImporter;case"1password1pif":return new K.OnePassword1PifImporter;case"1passwordwincsv":return new G.OnePasswordWinCsvImporter;case"1passwordmaccsv":return new q.OnePasswordMacCsvImporter;case"keepercsv":return new j.KeeperCsvImporter;case"passworddragonxml":return new X.PasswordDragonXmlImporter;case"enpasscsv":return new O.EnpassCsvImporter;case"enpassjson":return new _.EnpassJsonImporter;case"pwsafexml":return new Z.PasswordSafeXmlImporter;case"dashlanejson":return new P.DashlaneJsonImporter;case"msecurecsv":return new N.MSecureCsvImporter;case"stickypasswordxml":return new le.StickyPasswordXmlImporter;case"truekeycsv":return new ce.TrueKeyCsvImporter;case"clipperzhtml":return new I.ClipperzHtmlImporter;case"roboformcsv":return new ne.RoboFormCsvImporter;case"ascendocsv":return new f.AscendoCsvImporter;case"passwordbossjson":return new J.PasswordBossJsonImporter;case"zohovaultcsv":return new de.ZohoVaultCsvImporter;case"splashidcsv":return new se.SplashIdCsvImporter;case"passkeepcsv":return new H.PassKeepCsvImporter;case"gnomejson":return new M.GnomeJsonImporter;case"passwordagentcsv":return new Y.PasswordAgentCsvImporter;case"passpackcsv":return new Q.PasspackCsvImporter;case"passmanjson":return new $.PassmanJsonImporter;case"avastcsv":return new h.AvastCsvImporter;case"avastjson":return new v.AvastJsonImporter;case"fsecurefsk":return new T.FSecureFskImporter;case"kasperskytxt":return new D.KasperskyTxtImporter;case"remembearcsv":return new te.RememBearCsvImporter;case"passwordwallettxt":return new ee.PasswordWalletTxtImporter;case"mykicsv":return new z.MykiCsvImporter;case"securesafecsv":return new ae.SecureSafeCsvImporter;case"logmeoncecsv":return new V.LogMeOnceCsvImporter;case"blackberrycsv":return new S.BlackBerryCsvImporter;case"buttercupcsv":return new w.ButtercupCsvImporter;case"codebookcsv":return new E.CodebookCsvImporter;case"encryptrcsv":return new k.EncryptrCsvImporter;case"yoticsv":return new ue.YotiCsvImporter;case"nordpasscsv":return new L.NordPassCsvImporter;default:return null}},e.prototype.postImport=function(e,t){return void 0===t&&(t=null),r(this,void 0,void 0,(function(){var n,r,o,a,m;return i(this,(function(i){switch(i.label){case 0:if(null!=t)return[3,10];n=new p.ImportCiphersRequest,a=0,i.label=1;case 1:return a0&&(n+="\n\n"),"Folder"!==a&&"Collection"!==a&&(n+="["+(c+1)+"] "),n+="["+a+'] "'+i.name+'": '+l})),new Error(n)},e}();t.ImportService=me},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ImportCiphersRequest=void 0;var r=function(){this.ciphers=[],this.folders=[],this.folderRelationships=[]};t.ImportCiphersRequest=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ImportOrganizationCiphersRequest=void 0;var r=function(){this.ciphers=[],this.collections=[],this.collectionRelationships=[]};t.ImportOrganizationCiphersRequest=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KvpRequest=void 0;var r=function(e,t){this.key=e,this.value=t};t.KvpRequest=r},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.AscendoCsvImporter=void 0;var o=n(30),a=n(31),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.parse=function(e){var t=this,n=new a.ImportResult,r=this.parseCsv(e,!1);return null==r?(n.success=!1,Promise.resolve(n)):(r.forEach((function(e){if(!(e.length<2)){var r=t.initLoginCipher();if(r.notes=t.getValueOrDefault(e[e.length-1]),r.name=t.getValueOrDefault(e[0],"--"),e.length>2&&e.length%2==0)for(var i=0;i-1?r.login.password=t.getValueOrDefault(o):null==r.login.username&&t.usernameFieldNames.indexOf(s)>-1?r.login.username=t.getValueOrDefault(o):(null==r.login.uris||0===r.login.uris.length)&&t.uriFieldNames.indexOf(s)>-1?r.login.uris=t.makeUriArray(o):t.processKvp(r,a,o)}}t.convertToNoteIfNeeded(r),t.cleanupCipher(r),n.ciphers.push(r)}})),n.success=!0,Promise.resolve(n))},t}(o.BaseImporter);t.AscendoCsvImporter=s},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.AvastCsvImporter=void 0;var o=n(30),a=n(31),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.parse=function(e){var t=this,n=new a.ImportResult,r=this.parseCsv(e,!0);return null==r?(n.success=!1,Promise.resolve(n)):(r.forEach((function(e){var r=t.initLoginCipher();r.name=t.getValueOrDefault(e.name),r.login.uris=t.makeUriArray(e.web),r.login.password=t.getValueOrDefault(e.password),r.login.username=t.getValueOrDefault(e.login),t.cleanupCipher(r),n.ciphers.push(r)})),n.success=!0,Promise.resolve(n))},t}(o.BaseImporter);t.AvastCsvImporter=s},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.AvastJsonImporter=void 0;var o=n(30),a=n(31),s=n(43),l=n(109),c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.parse=function(e){var t=this,n=new a.ImportResult,r=JSON.parse(e);return null==r?(n.success=!1,Promise.resolve(n)):(null!=r.logins&&r.logins.forEach((function(e){var r=t.initLoginCipher();r.name=t.getValueOrDefault(e.custName),r.notes=t.getValueOrDefault(e.note),r.login.uris=t.makeUriArray(e.url),r.login.password=t.getValueOrDefault(e.pwd),r.login.username=t.getValueOrDefault(e.loginName),t.cleanupCipher(r),n.ciphers.push(r)})),null!=r.notes&&r.notes.forEach((function(e){var r=t.initLoginCipher();r.type=s.CipherType.SecureNote,r.secureNote.type=l.SecureNoteType.Generic,r.name=t.getValueOrDefault(e.label),r.notes=t.getValueOrDefault(e.text),t.cleanupCipher(r),n.ciphers.push(r)})),null!=r.cards&&r.cards.forEach((function(e){var r=t.initLoginCipher();r.type=s.CipherType.Card,r.name=t.getValueOrDefault(e.custName),r.notes=t.getValueOrDefault(e.note),r.card.cardholderName=t.getValueOrDefault(e.holderName),r.card.number=t.getValueOrDefault(e.cardNumber),r.card.code=t.getValueOrDefault(e.cvv),r.card.brand=t.getCardBrand(r.card.number),null!=e.expirationDate&&(null!=e.expirationDate.month&&(r.card.expMonth=e.expirationDate.month+""),null!=e.expirationDate.year&&(r.card.expYear=e.expirationDate.year+"")),t.cleanupCipher(r),n.ciphers.push(r)})),n.success=!0,Promise.resolve(n))},t}(o.BaseImporter);t.AvastJsonImporter=c},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.AviraCsvImporter=void 0;var o=n(30),a=n(31),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.parse=function(e){var t=this,n=new a.ImportResult,r=this.parseCsv(e,!0);return null==r?(n.success=!1,Promise.resolve(n)):(r.forEach((function(e){var r=t.initLoginCipher();r.name=t.getValueOrDefault(e.name,t.getValueOrDefault(t.nameFromUrl(e.website),"--")),r.login.uris=t.makeUriArray(e.website),r.login.password=t.getValueOrDefault(e.password),t.isNullOrWhitespace(e.username)&&!t.isNullOrWhitespace(e.secondary_username)?r.login.username=e.secondary_username:(r.login.username=t.getValueOrDefault(e.username),r.notes=t.getValueOrDefault(e.secondary_username)),t.cleanupCipher(r),n.ciphers.push(r)})),n.success=!0,Promise.resolve(n))},t}(o.BaseImporter);t.AviraCsvImporter=s},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.BitwardenCsvImporter=void 0;var o=n(30),a=n(31),s=n(144),l=n(185),c=n(266),p=n(165),u=n(108),d=n(187),m=n(43),f=n(137),h=n(109),v=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.parse=function(e){var t=this,n=new a.ImportResult,r=this.parseCsv(e,!0);return null==r?(n.success=!1,Promise.resolve(n)):(r.forEach((function(e){t.organization&&!t.isNullOrWhitespace(e.collections)?e.collections.split(",").forEach((function(e){for(var t=!0,r=n.collections.length,i=0;ia+2&&(v.value=i[o].substr(a+2)),r.fields.push(v)}}if("note"===(null!=e.type?e.type.toLowerCase():null))r.type=m.CipherType.SecureNote,r.secureNote=new u.SecureNoteView,r.secureNote.type=h.SecureNoteType.Generic;else{r.type=m.CipherType.Login,r.login=new p.LoginView,r.login.totp=t.getValueOrDefault(e.login_totp||e.totp),r.login.username=t.getValueOrDefault(e.login_username||e.username),r.login.password=t.getValueOrDefault(e.login_password||e.password);var y=t.parseSingleRowCsv(e.login_uri||e.uri);r.login.uris=t.makeUriArray(y)}n.ciphers.push(r)})),n.success=!0,Promise.resolve(n))},t}(o.BaseImporter);t.BitwardenCsvImporter=v},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]5&&(g.passwordHistory=g.passwordHistory.slice(0,5)),!this.organization&&null!=y.folderId&&n.has(y.folderId)?this.result.folderRelationships.push([this.result.ciphers.length,n.get(y.folderId)]):this.organization&&null!=y.collectionIds&&y.collectionIds.forEach((function(e){n.has(e)&&S.result.collectionRelationships.push([S.result.ciphers.length,n.get(e)])})),[4,g.decrypt()]):[3,16];case 14:x=a.sent(),this.cleanupCipher(x),this.result.ciphers.push(x),a.label=15;case 15:return h++,[3,13];case 16:return this.result.success=!0,[2]}}))}))},t.prototype.parseDecrypted=function(){var e=this,t=new Map;this.organization&&null!=this.results.collections?this.results.collections.forEach((function(n){var r=u.CollectionWithId.toView(n);null!=r&&(r.id=null,r.organizationId=null,t.set(n.id,e.result.collections.length),e.result.collections.push(r))})):this.organization||null==this.results.folders||this.results.folders.forEach((function(n){var r=d.FolderWithId.toView(n);null!=r&&(r.id=null,t.set(n.id,e.result.folders.length),e.result.folders.push(r))})),this.results.items.forEach((function(n){var r=p.CipherWithIds.toView(n);r.id=null,r.folderId=null,r.organizationId=null,r.collectionIds=null,null!=r.passwordHistory&&r.passwordHistory.length>5&&(r.passwordHistory=r.passwordHistory.slice(0,5)),!e.organization&&null!=n.folderId&&t.has(n.folderId)?e.result.folderRelationships.push([e.result.ciphers.length,t.get(n.folderId)]):e.organization&&null!=n.collectionIds&&n.collectionIds.forEach((function(n){t.has(n)&&e.result.collectionRelationships.push([e.result.ciphers.length,t.get(n)])})),e.cleanupCipher(r),e.result.ciphers.push(r)})),this.result.success=!0},t}(s.BaseImporter);t.BitwardenJsonImporter=m},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.BlackBerryCsvImporter=void 0;var o=n(30),a=n(31),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.parse=function(e){var t=this,n=new a.ImportResult,r=this.parseCsv(e,!0);return null==r?(n.success=!1,Promise.resolve(n)):(r.forEach((function(e){if("list"!==e.grouping){var r=t.initLoginCipher();r.favorite="1"===e.fav,r.name=t.getValueOrDefault(e.name),r.notes=t.getValueOrDefault(e.extra),"note"!==e.grouping&&(r.login.uris=t.makeUriArray(e.url),r.login.password=t.getValueOrDefault(e.password),r.login.username=t.getValueOrDefault(e.username)),t.convertToNoteIfNeeded(r),t.cleanupCipher(r),n.ciphers.push(r)}})),n.success=!0,Promise.resolve(n))},t}(o.BaseImporter);t.BlackBerryCsvImporter=s},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.BlurCsvImporter=void 0;var o=n(30),a=n(31),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.parse=function(e){var t=this,n=new a.ImportResult,r=this.parseCsv(e,!0);return null==r?(n.success=!1,Promise.resolve(n)):(r.forEach((function(e){"null"===e.label&&(e.label=null);var r=t.initLoginCipher();r.name=t.getValueOrDefault(e.label,t.getValueOrDefault(t.nameFromUrl(e.domain),"--")),r.login.uris=t.makeUriArray(e.domain),r.login.password=t.getValueOrDefault(e.password),t.isNullOrWhitespace(e.email)&&!t.isNullOrWhitespace(e.username)?r.login.username=e.username:(r.login.username=t.getValueOrDefault(e.email),r.notes=t.getValueOrDefault(e.username)),t.cleanupCipher(r),n.ciphers.push(r)})),n.success=!0,Promise.resolve(n))},t}(o.BaseImporter);t.BlurCsvImporter=s},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.ButtercupCsvImporter=void 0;var o=n(30),a=n(31),s=["!group_id","!group_name","title","username","password","URL","id"],l=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.parse=function(e){var t=this,n=new a.ImportResult,r=this.parseCsv(e,!0);return null==r?(n.success=!1,Promise.resolve(n)):(r.forEach((function(e){t.processFolder(n,t.getValueOrDefault(e["!group_name"]));var r=t.initLoginCipher();r.name=t.getValueOrDefault(e.title,"--"),r.login.username=t.getValueOrDefault(e.username),r.login.password=t.getValueOrDefault(e.password),r.login.uris=t.makeUriArray(e.URL);var i=!1;for(var o in e)e.hasOwnProperty(o)&&(i||-1!==s.indexOf(o)||(i=!0),i&&t.processKvp(r,o,e[o]));t.cleanupCipher(r),n.ciphers.push(r)})),this.organization&&this.moveFoldersToCollections(n),n.success=!0,Promise.resolve(n))},t}(o.BaseImporter);t.ButtercupCsvImporter=l},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.ChromeCsvImporter=void 0;var o=n(30),a=n(31),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.parse=function(e){var t=this,n=new a.ImportResult,r=this.parseCsv(e,!0);return null==r?(n.success=!1,Promise.resolve(n)):(r.forEach((function(e){var r=t.initLoginCipher();r.name=t.getValueOrDefault(e.name,"--"),r.login.username=t.getValueOrDefault(e.username),r.login.password=t.getValueOrDefault(e.password),r.login.uris=t.makeUriArray(e.url),t.cleanupCipher(r),n.ciphers.push(r)})),n.success=!0,Promise.resolve(n))},t}(o.BaseImporter);t.ChromeCsvImporter=s},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.ClipperzHtmlImporter=void 0;var o=n(30),a=n(31),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.parse=function(e){var t=this,n=new a.ImportResult,r=this.parseXml(e);if(null==r)return n.success=!1,Promise.resolve(n);var i=r.querySelector("textarea");return null==i||this.isNullOrWhitespace(i.textContent)?(n.errorMessage="Missing textarea.",n.success=!1,Promise.resolve(n)):(JSON.parse(i.textContent).forEach((function(e){var r=t.initLoginCipher();if(t.isNullOrWhitespace(e.label)||(r.name=e.label.split(" ")[0]),null==e.data||t.isNullOrWhitespace(e.data.notes)||(r.notes=e.data.notes.split("\\n").join("\n")),null!=e.currentVersion&&null!=e.currentVersion.fields)for(var i in e.currentVersion.fields)if(e.currentVersion.fields.hasOwnProperty(i)){var o=e.currentVersion.fields[i];switch(null!=o.actionType?o.actionType.toLowerCase():null){case"password":r.login.password=t.getValueOrDefault(o.value);break;case"email":case"username":case"user":case"name":r.login.username=t.getValueOrDefault(o.value);break;case"url":r.login.uris=t.makeUriArray(o.value);break;default:var a=null!=o.label?o.label.toLowerCase():null;null==r.login.password&&t.passwordFieldNames.indexOf(a)>-1?r.login.password=t.getValueOrDefault(o.value):null==r.login.username&&t.usernameFieldNames.indexOf(a)>-1?r.login.username=t.getValueOrDefault(o.value):(null==r.login.uris||0===r.login.uris.length)&&t.uriFieldNames.indexOf(a)>-1?r.login.uris=t.makeUriArray(o.value):t.processKvp(r,o.label,o.value)}}t.convertToNoteIfNeeded(r),t.cleanupCipher(r),n.ciphers.push(r)})),n.success=!0,Promise.resolve(n))},t}(o.BaseImporter);t.ClipperzHtmlImporter=s},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.CodebookCsvImporter=void 0;var o=n(30),a=n(31),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.parse=function(e){var t=this,n=new a.ImportResult,r=this.parseCsv(e,!0);return null==r?(n.success=!1,Promise.resolve(n)):(r.forEach((function(e){t.processFolder(n,t.getValueOrDefault(e.Category));var r=t.initLoginCipher();r.favorite="True"===t.getValueOrDefault(e.Favorite),r.name=t.getValueOrDefault(e.Entry,"--"),r.notes=t.getValueOrDefault(e.Note),r.login.username=t.getValueOrDefault(e.Username,e.Email),r.login.password=t.getValueOrDefault(e.Password),r.login.totp=t.getValueOrDefault(e.TOTP),r.login.uris=t.makeUriArray(e.Website),t.isNullOrWhitespace(e.Username)||t.processKvp(r,"Email",e.Email),t.processKvp(r,"Phone",e.Phone),t.processKvp(r,"PIN",e.PIN),t.processKvp(r,"Account",e.Account),t.processKvp(r,"Date",e.Date),t.convertToNoteIfNeeded(r),t.cleanupCipher(r),n.ciphers.push(r)})),this.organization&&this.moveFoldersToCollections(n),n.success=!0,Promise.resolve(n))},t}(o.BaseImporter);t.CodebookCsvImporter=s},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.DashlaneJsonImporter=void 0;var o=n(30),a=n(31),s=n(92),l=n(144),c=n(145),p=n(108),u=n(43),d=n(109),m=new Set(["ADDRESS","AUTHENTIFIANT","BANKSTATEMENT","IDCARD","IDENTITY","PAYMENTMEANS_CREDITCARD","PAYMENTMEAN_PAYPAL","EMAIL"]),f=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.parse=function(e){this.result=new a.ImportResult;var t=JSON.parse(e);if(null==t||0===t.length)return this.result.success=!1,Promise.resolve(this.result);for(var n in null!=t.ADDRESS&&this.processAddress(t.ADDRESS),null!=t.AUTHENTIFIANT&&this.processAuth(t.AUTHENTIFIANT),null!=t.BANKSTATEMENT&&this.processNote(t.BANKSTATEMENT,"BankAccountName"),null!=t.IDCARD&&this.processNote(t.IDCARD,"Fullname"),null!=t.PAYMENTMEANS_CREDITCARD&&this.processCard(t.PAYMENTMEANS_CREDITCARD),null!=t.IDENTITY&&this.processIdentity(t.IDENTITY),t)t.hasOwnProperty(n)&&!m.has(n)&&this.processNote(t[n],null,"Generic Note");return this.result.success=!0,Promise.resolve(this.result)},t.prototype.processAuth=function(e){var t=this;e.forEach((function(e){var n=t.initLoginCipher();n.name=t.getValueOrDefault(e.title),n.login.username=t.getValueOrDefault(e.login,t.getValueOrDefault(e.secondaryLogin)),t.isNullOrWhitespace(n.login.username)?n.login.username=t.getValueOrDefault(e.email):t.isNullOrWhitespace(e.email)||(n.notes="Email: "+e.email+"\n"),n.login.password=t.getValueOrDefault(e.password),n.login.uris=t.makeUriArray(e.domain),n.notes+=t.getValueOrDefault(e.note,""),t.convertToNoteIfNeeded(n),t.cleanupCipher(n),t.result.ciphers.push(n)}))},t.prototype.processIdentity=function(e){var t=this;e.forEach((function(e){var n=new l.CipherView;n.identity=new c.IdentityView,n.type=u.CipherType.Identity,n.name=t.getValueOrDefault(e.fullName,"");var r=n.name.split(" ");r.length>0&&(n.identity.firstName=t.getValueOrDefault(r[0])),2===r.length?n.identity.lastName=t.getValueOrDefault(r[1]):3===r.length&&(n.identity.middleName=t.getValueOrDefault(r[1]),n.identity.lastName=t.getValueOrDefault(r[2])),n.identity.username=t.getValueOrDefault(e.pseudo),t.cleanupCipher(n),t.result.ciphers.push(n)}))},t.prototype.processAddress=function(e){var t=this;e.forEach((function(e){var n=new l.CipherView;n.identity=new c.IdentityView,n.type=u.CipherType.Identity,n.name=t.getValueOrDefault(e.addressName),n.identity.address1=t.getValueOrDefault(e.addressFull),n.identity.city=t.getValueOrDefault(e.city),n.identity.state=t.getValueOrDefault(e.state),n.identity.postalCode=t.getValueOrDefault(e.zipcode),n.identity.country=t.getValueOrDefault(e.country),null!=n.identity.country&&(n.identity.country=n.identity.country.toUpperCase()),t.cleanupCipher(n),t.result.ciphers.push(n)}))},t.prototype.processCard=function(e){var t=this;e.forEach((function(e){var n=new l.CipherView;n.card=new s.CardView,n.type=u.CipherType.Card,n.name=t.getValueOrDefault(e.bank),n.card.number=t.getValueOrDefault(e.cardNumber),n.card.brand=t.getCardBrand(n.card.number),n.card.cardholderName=t.getValueOrDefault(e.owner),t.isNullOrWhitespace(n.card.brand)||(t.isNullOrWhitespace(n.name)?n.name=n.card.brand:n.name+=" - "+n.card.brand),t.cleanupCipher(n),t.result.ciphers.push(n)}))},t.prototype.processNote=function(e,t,n){var r=this;void 0===n&&(n=null),e.forEach((function(e){var i=new l.CipherView;for(var o in i.secureNote=new p.SecureNoteView,i.type=u.CipherType.SecureNote,i.secureNote.type=d.SecureNoteType.Generic,i.name=null!=n?n:r.getValueOrDefault(e[t]),e)e.hasOwnProperty(o)&&o!==t&&r.processKvp(i,o,e[o].toString());r.cleanupCipher(i),r.result.ciphers.push(i)}))},t}(o.BaseImporter);t.DashlaneJsonImporter=f},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.EncryptrCsvImporter=void 0;var o=n(30),a=n(31),s=n(92),l=n(43),c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.parse=function(e){var t=this,n=new a.ImportResult,r=this.parseCsv(e,!0);return null==r?(n.success=!1,Promise.resolve(n)):(r.forEach((function(e){var r=t.initLoginCipher();r.name=t.getValueOrDefault(e.Label,"--"),r.notes=t.getValueOrDefault(e.Notes);var i=t.getValueOrDefault(e.Text);t.isNullOrWhitespace(i)||(t.isNullOrWhitespace(r.notes)?r.notes=i:r.notes+="\n\n"+i);var o=e["Entry Type"];if("Password"===o)r.login.username=t.getValueOrDefault(e.Username),r.login.password=t.getValueOrDefault(e.Password),r.login.uris=t.makeUriArray(e["Site URL"]);else if("Credit Card"===o){r.type=l.CipherType.Card,r.card=new s.CardView,r.card.cardholderName=t.getValueOrDefault(e["Name on card"]),r.card.number=t.getValueOrDefault(e["Card Number"]),r.card.brand=t.getCardBrand(r.card.number),r.card.code=t.getValueOrDefault(e.CVV);var a=t.getValueOrDefault(e.Expiry);if(!t.isNullOrWhitespace(a)){var c=a.split("/");c.length>1&&(r.card.expMonth=parseInt(c[0],null).toString(),r.card.expYear=(2e3+parseInt(c[1],null)).toString())}}t.convertToNoteIfNeeded(r),t.cleanupCipher(r),n.ciphers.push(r)})),n.success=!0,Promise.resolve(n))},t}(o.BaseImporter);t.EncryptrCsvImporter=c},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.EnpassCsvImporter=void 0;var o=n(30),a=n(31),s=n(43),l=n(109),c=n(92),p=n(108),u=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.parse=function(e){var t=this,n=new a.ImportResult,r=this.parseCsv(e,!1);if(null==r)return n.success=!1,Promise.resolve(n);var i=!0;return r.forEach((function(e){if(e.length<2||i&&("Title"===e[0]||"title"===e[0]))i=!1;else{var r=t.initLoginCipher();if(r.notes=t.getValueOrDefault(e[e.length-1]),r.name=t.getValueOrDefault(e[0],"--"),2!==e.length&&(t.containsField(e,"username")||t.containsField(e,"password")||t.containsField(e,"email")||t.containsField(e,"url"))||(r.type=s.CipherType.SecureNote,r.secureNote=new p.SecureNoteView,r.secureNote.type=l.SecureNoteType.Generic),t.containsField(e,"cardholder")&&t.containsField(e,"number")&&t.containsField(e,"expiry date")&&(r.type=s.CipherType.Card,r.card=new c.CardView),e.length>2&&e.length%2==0)for(var o=0;o0},t}(o.BaseImporter);t.EnpassCsvImporter=u},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.EnpassJsonImporter=void 0;var o=n(30),a=n(31),s=n(92),l=n(146),c=n(43),p=n(137),u=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.parse=function(e){var t=this,n=new a.ImportResult,r=JSON.parse(e);if(null==r||null==r.items||0===r.items.length)return n.success=!1,Promise.resolve(n);var i=new Map,o=new Map,s=this.buildFolderTree(r.folders);return this.flattenFolderTree(null,s,i),i.forEach((function(e,t){o.set(t,n.folders.length);var r=new l.FolderView;r.name=e,n.folders.push(r)})),r.items.forEach((function(e){null!=e.folders&&e.folders.length>0&&o.has(e.folders[0])&&n.folderRelationships.push([n.ciphers.length,o.get(e.folders[0])]);var r=t.initLoginCipher();r.name=t.getValueOrDefault(e.title),r.favorite=e.favorite>0,null!=e.template_type&&null!=e.fields&&e.fields.length>0&&(0===e.template_type.indexOf("login.")||0===e.template_type.indexOf("password.")?t.processLogin(r,e.fields):0===e.template_type.indexOf("creditcard.")?t.processCard(r,e.fields):e.template_type.indexOf("identity.")<0&&e.fields.some((function(e){return"password"===e.type&&!t.isNullOrWhitespace(e.value)}))?t.processLogin(r,e.fields):t.processNote(r,e.fields)),r.notes+="\n"+t.getValueOrDefault(e.note,""),t.convertToNoteIfNeeded(r),t.cleanupCipher(r),n.ciphers.push(r)})),n.success=!0,Promise.resolve(n)},t.prototype.processLogin=function(e,t){var n=this,r=[];t.forEach((function(t){n.isNullOrWhitespace(t.value)||"section"===t.type||("username"!==t.type&&"email"!==t.type||!n.isNullOrWhitespace(e.login.username)?"password"===t.type&&n.isNullOrWhitespace(e.login.password)?e.login.password=t.value:"totp"===t.type&&n.isNullOrWhitespace(e.login.totp)?e.login.totp=t.value:"url"===t.type?r.push(t.value):n.processKvp(e,t.label,t.value,1===t.sensitive?p.FieldType.Hidden:p.FieldType.Text):e.login.username=t.value)})),e.login.uris=this.makeUriArray(r)},t.prototype.processCard=function(e,t){var n=this;e.card=new s.CardView,e.type=c.CipherType.Card,t.forEach((function(t){n.isNullOrWhitespace(t.value)||"section"===t.type||"ccType"===t.type||("ccName"===t.type&&n.isNullOrWhitespace(e.card.cardholderName)?e.card.cardholderName=t.value:"ccNumber"===t.type&&n.isNullOrWhitespace(e.card.number)?(e.card.number=t.value,e.card.brand=n.getCardBrand(e.card.number)):"ccCvc"===t.type&&n.isNullOrWhitespace(e.card.code)?e.card.code=t.value:"ccExpiry"===t.type&&n.isNullOrWhitespace(e.card.expYear)&&n.setCardExpiration(e,t.value)||n.processKvp(e,t.label,t.value,1===t.sensitive?p.FieldType.Hidden:p.FieldType.Text))}))},t.prototype.processNote=function(e,t){var n=this;t.forEach((function(t){n.isNullOrWhitespace(t.value)||"section"===t.type||n.processKvp(e,t.label,t.value,1===t.sensitive?p.FieldType.Hidden:p.FieldType.Text)}))},t.prototype.buildFolderTree=function(e){if(null==e)return[];var t=[],n=new Map([]);return e.forEach((function(e){n.set(e.uuid,e),e.children=[]})),e.forEach((function(e){null!=e.parent_uuid&&""!==e.parent_uuid&&n.has(e.parent_uuid)?n.get(e.parent_uuid).children.push(e):t.push(e)})),t},t.prototype.flattenFolderTree=function(e,t,n){var r=this;null!=t&&t.forEach((function(t){if(null!=t.title&&""!==t.title.trim()){var i=t.title.trim();null!=e&&""!==e.trim()&&(i=e+"/"+i),n.set(t.uuid,i),null!=t.children&&0!==t.children.length&&r.flattenFolderTree(i,t.children,n)}}))},t}(o.BaseImporter);t.EnpassJsonImporter=u},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.FirefoxCsvImporter=void 0;var o=n(30),a=n(31),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.parse=function(e){var t=this,n=new a.ImportResult,r=this.parseCsv(e,!0);return null==r?(n.success=!1,Promise.resolve(n)):(r.filter((function(e){return"chrome://FirefoxAccounts"!==e.url})).forEach((function(e){var r=t.initLoginCipher(),i=t.getValueOrDefault(e.url,t.getValueOrDefault(e.hostname));r.name=t.getValueOrDefault(t.nameFromUrl(i),"--"),r.login.username=t.getValueOrDefault(e.username),r.login.password=t.getValueOrDefault(e.password),r.login.uris=t.makeUriArray(i),t.cleanupCipher(r),n.ciphers.push(r)})),n.success=!0,Promise.resolve(n))},t}(o.BaseImporter);t.FirefoxCsvImporter=s},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.FSecureFskImporter=void 0;var o=n(30),a=n(31),s=n(92),l=n(43),c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.parse=function(e){var t=new a.ImportResult,n=JSON.parse(e);if(null==n||null==n.data)return t.success=!1,Promise.resolve(t);for(var r in n.data)if(n.data.hasOwnProperty(r)){var i=n.data[r],o=this.initLoginCipher();if(o.name=this.getValueOrDefault(i.service),o.notes=this.getValueOrDefault(i.notes),"website"===i.style)o.login.username=this.getValueOrDefault(i.username),o.login.password=this.getValueOrDefault(i.password),o.login.uris=this.makeUriArray(i.url);else{if("creditcard"!==i.style)continue;o.type=l.CipherType.Card,o.card=new s.CardView,o.card.cardholderName=this.getValueOrDefault(i.username),o.card.number=this.getValueOrDefault(i.creditNumber),o.card.brand=this.getCardBrand(o.card.number),o.card.code=this.getValueOrDefault(i.creditCvv),this.isNullOrWhitespace(i.creditExpiry)||this.setCardExpiration(o,i.creditExpiry)||this.processKvp(o,"Expiration",i.creditExpiry),this.isNullOrWhitespace(i.password)||this.processKvp(o,"PIN",i.password)}this.convertToNoteIfNeeded(o),this.cleanupCipher(o),t.ciphers.push(o)}return t.success=!0,Promise.resolve(t)},t}(o.BaseImporter);t.FSecureFskImporter=c},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.GnomeJsonImporter=void 0;var o=n(30),a=n(31),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.parse=function(e){var t=this,n=new a.ImportResult,r=JSON.parse(e);if(null==r||0===Object.keys(r).length)return n.success=!1,Promise.resolve(n);var i=function(e){if(!r.hasOwnProperty(e)||o.isNullOrWhitespace(e)||0===r[e].length)return"continue";r[e].forEach((function(r){if(!t.isNullOrWhitespace(r.display_name)&&0===r.display_name.indexOf("http")){t.processFolder(n,e);var i=t.initLoginCipher();if(i.name=r.display_name.replace("http://","").replace("https://",""),i.name.length>30&&(i.name=i.name.substring(0,30)),i.login.password=t.getValueOrDefault(r.secret),i.login.uris=t.makeUriArray(r.display_name),null!=r.attributes)for(var o in i.login.username=null!=r.attributes?t.getValueOrDefault(r.attributes.username_value):null,r.attributes)r.attributes.hasOwnProperty(o)&&"username_value"!==o&&"xdg:schema"!==o&&t.processKvp(i,o,r.attributes[o]);t.convertToNoteIfNeeded(i),t.cleanupCipher(i),n.ciphers.push(i)}}))},o=this;for(var s in r)i(s);return this.organization&&this.moveFoldersToCollections(n),n.success=!0,Promise.resolve(n)},t}(o.BaseImporter);t.GnomeJsonImporter=s},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.KasperskyTxtImporter=void 0;var o=n(30),a=n(31),s="Notes\n\n",l="Applications\n\n",c="Websites\n\n",p="\n---\n",u=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.parse=function(e){var t,n,r,i,o=this,p=new a.ImportResult,u=this.splitNewLine(e).join("\n");-1!==u.indexOf(s)&&((i=u.split(s)).length>1&&(u=i[0],t=i[1]));-1!==u.indexOf(l)&&((i=u.split(l)).length>1&&(u=i[0],n=i[1]));0===u.indexOf(c)&&((i=u.split(c)).length>1&&(u=i[0],r=i[1]));var d=this.parseDataCategory(t),m=this.parseDataCategory(n),f=this.parseDataCategory(r);return d.forEach((function(e){var t=o.initLoginCipher();t.name=o.getValueOrDefault(e.get("Name")),t.notes=o.getValueOrDefault(e.get("Text")),o.cleanupCipher(t),p.ciphers.push(t)})),f.concat(m).forEach((function(e){var t=o.initLoginCipher(),n=e.has("Website name")?"Website name":"Application";t.name=o.getValueOrDefault(e.get(n),""),o.isNullOrWhitespace(e.get("Login name"))||(o.isNullOrWhitespace(t.name)||(t.name+=": "),t.name+=e.get("Login name")),t.notes=o.getValueOrDefault(e.get("Comment")),e.has("Website URL")&&(t.login.uris=o.makeUriArray(e.get("Website URL"))),t.login.username=o.getValueOrDefault(e.get("Login")),t.login.password=o.getValueOrDefault(e.get("Password")),o.cleanupCipher(t),p.ciphers.push(t)})),p.success=!0,Promise.resolve(p)},t.prototype.parseDataCategory=function(e){if(this.isNullOrWhitespace(e)||-1===e.indexOf(p))return[];var t=[];return e.split(p).forEach((function(e){if(-1!==e.indexOf("\n")){var n,r,i=new Map;e.split("\n").forEach((function(e){if(null==n){var t,o,a=e.indexOf(":");-1!==a&&(t=e.substring(0,a),e.length>a+1&&(o=e.substring(a+2)),null!=t&&i.set(t,o),"Comment"!==t&&"Text"!==t||(n=o,r=t))}else n+="\n"+e})),null!=n&&null!=r&&i.set(r,n),0!==i.size&&t.push(i)}})),t},t}(o.BaseImporter);t.KasperskyTxtImporter=u},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.KeePass2XmlImporter=void 0;var o=n(30),a=n(137),s=n(31),l=n(146),c=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.result=new s.ImportResult,t}return i(t,e),t.prototype.parse=function(e){var t=this.parseXml(e);if(null==t)return this.result.success=!1,Promise.resolve(this.result);var n=t.querySelector("KeePassFile > Root > Group");return null==n?(this.result.errorMessage="Missing `KeePassFile > Root > Group` node.",this.result.success=!1,Promise.resolve(this.result)):(this.traverse(n,!0,""),this.organization&&this.moveFoldersToCollections(this.result),this.result.success=!0,Promise.resolve(this.result))},t.prototype.traverse=function(e,t,n){var r=this,i=this.result.folders.length,o=n;if(!t){""!==o&&(o+="/");var s=this.querySelectorDirectChild(e,"Name");o+=null==s?"-":s.textContent;var c=new l.FolderView;c.name=o,this.result.folders.push(c)}this.querySelectorAllDirectChild(e,"Entry").forEach((function(e){var n=r.result.ciphers.length,o=r.initLoginCipher();r.querySelectorAllDirectChild(e,"String").forEach((function(e){var t=r.querySelectorDirectChild(e,"Value"),n=null!=t?t.textContent:null;if(!r.isNullOrWhitespace(n)){var i=r.querySelectorDirectChild(e,"Key"),s=null!=i?i.textContent:null;if("URL"===s)o.login.uris=r.makeUriArray(n);else if("UserName"===s)o.login.username=n;else if("Password"===s)o.login.password=n;else if("otp"===s)o.login.totp=n.replace("key=","");else if("Title"===s)o.name=n;else if("Notes"===s)o.notes+=n+"\n";else{var l=a.FieldType.Text,c=t.attributes;c.length>0&&null!=c.ProtectInMemory&&"True"===c.ProtectInMemory.value&&(l=a.FieldType.Hidden),r.processKvp(o,s,n,l)}}})),r.cleanupCipher(o),r.result.ciphers.push(o),t||r.result.folderRelationships.push([n,i])})),this.querySelectorAllDirectChild(e,"Group").forEach((function(e){r.traverse(e,!1,o)}))},t}(o.BaseImporter);t.KeePass2XmlImporter=c},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.KeePassXCsvImporter=void 0;var o=n(30),a=n(31),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.parse=function(e){var t=this,n=new a.ImportResult,r=this.parseCsv(e,!0);return null==r?(n.success=!1,Promise.resolve(n)):(r.forEach((function(e){if(!t.isNullOrWhitespace(e.Title)){e.Group=!t.isNullOrWhitespace(e.Group)&&e.Group.startsWith("Root/")?e.Group.replace("Root/",""):e.Group;var r=t.isNullOrWhitespace(e.Group)?null:e.Group;t.processFolder(n,r);var i=t.initLoginCipher();i.notes=t.getValueOrDefault(e.Notes),i.name=t.getValueOrDefault(e.Title,"--"),i.login.username=t.getValueOrDefault(e.Username),i.login.password=t.getValueOrDefault(e.Password),i.login.uris=t.makeUriArray(e.URL),t.cleanupCipher(i),n.ciphers.push(i)}})),this.organization&&this.moveFoldersToCollections(n),n.success=!0,Promise.resolve(n))},t}(o.BaseImporter);t.KeePassXCsvImporter=s},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.KeeperCsvImporter=void 0;var o=n(30),a=n(31),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.parse=function(e){var t=this,n=new a.ImportResult,r=this.parseCsv(e,!1);return null==r?(n.success=!1,Promise.resolve(n)):(r.forEach((function(e){if(!(e.length<6)){t.processFolder(n,e[0]);var r=t.initLoginCipher();if(r.notes=t.getValueOrDefault(e[5])+"\n",r.name=t.getValueOrDefault(e[1],"--"),r.login.username=t.getValueOrDefault(e[2]),r.login.password=t.getValueOrDefault(e[3]),r.login.uris=t.makeUriArray(e[4]),e.length>7)for(var i=7;i-1){var n=e.ccexp.split("-");n.length>1&&(t.expYear=n[0],t.expMonth=n[1],2===t.expMonth.length&&"0"===t.expMonth[0]&&(t.expMonth=t.expMonth[1]))}return t},t.prototype.parseIdentity=function(e){var t=new p.IdentityView;return t.title=this.getValueOrDefault(e.title),t.firstName=this.getValueOrDefault(e.firstname),t.middleName=this.getValueOrDefault(e.middlename),t.lastName=this.getValueOrDefault(e.lastname),t.username=this.getValueOrDefault(e.username),t.company=this.getValueOrDefault(e.company),t.ssn=this.getValueOrDefault(e.ssn),t.address1=this.getValueOrDefault(e.address1),t.address2=this.getValueOrDefault(e.address2),t.address3=this.getValueOrDefault(e.address3),t.city=this.getValueOrDefault(e.city),t.state=this.getValueOrDefault(e.state),t.postalCode=this.getValueOrDefault(e.zip),t.country=this.getValueOrDefault(e.country),t.email=this.getValueOrDefault(e.email),t.phone=this.getValueOrDefault(e.phone),this.isNullOrWhitespace(t.title)||(t.title=t.title.charAt(0).toUpperCase()+t.title.slice(1)),t},t.prototype.parseSecureNote=function(e,t){var n=this.splitNewLine(e.extra),r=!1;if(n.length){var i=n[0].split(":");if(i.length>1&&"NoteType"===i[0]&&("Credit Card"===i[1]||"Address"===i[1])){if("Credit Card"===i[1]){var o=this.parseSecureNoteMapping(t,n,{Number:"number","Name on Card":"cardholderName","Security Code":"code","Expiration Date":"expMonth"});if(this.isNullOrWhitespace(o.expMonth)||","===o.expMonth)o.expMonth=void 0;else{var a=o.expMonth.split(","),s=a[0],l=a[1];if(this.isNullOrWhitespace(s))o.expMonth=void 0;else{var c=new Date(Date.parse(s.trim()+" 1, 2012")).getMonth()+1;isNaN(c)?o.expMonth=void 0:o.expMonth=c.toString()}this.isNullOrWhitespace(l)||(o.expYear=l)}t.type=m.CipherType.Card,t.card=o}else if("Address"===i[1]){o=this.parseSecureNoteMapping(t,n,{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"});t.type=m.CipherType.Identity,t.identity=o}r=!0}}r||(t.secureNote=new d.SecureNoteView,t.secureNote.type=f.SecureNoteType.Generic,t.notes=this.getValueOrDefault(e.extra))},t.prototype.parseSecureNoteMapping=function(e,t,n){var r=this,i={},o=!1;return t.forEach((function(t){var a=null,s=null;if(!o){if(r.isNullOrWhitespace(t))return;var l=t.indexOf(":");if(-1===l?a=t:(a=t.substring(0,l),t.length>l&&(s=t.substring(l+1))),r.isNullOrWhitespace(a)||r.isNullOrWhitespace(s)||"NoteType"===a)return}o?e.notes+="\n"+t:"Notes"===a?(r.isNullOrWhitespace(e.notes)?e.notes=s:e.notes+="\n"+s,o=!0):n.hasOwnProperty(a)?i[n[a]]=s:r.processKvp(e,a,s)})),i},t}(o.BaseImporter);t.LastPassCsvImporter=h},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.LogMeOnceCsvImporter=void 0;var o=n(30),a=n(31),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.parse=function(e){var t=this,n=new a.ImportResult,r=this.parseCsv(e,!1);return null==r?(n.success=!1,Promise.resolve(n)):(r.forEach((function(e){if(!(e.length<4)){var r=t.initLoginCipher();r.name=t.getValueOrDefault(e[0],"--"),r.login.username=t.getValueOrDefault(e[2]),r.login.password=t.getValueOrDefault(e[3]),r.login.uris=t.makeUriArray(e[1]),t.cleanupCipher(r),n.ciphers.push(r)}})),n.success=!0,Promise.resolve(n))},t}(o.BaseImporter);t.LogMeOnceCsvImporter=s},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.MeldiumCsvImporter=void 0;var o=n(30),a=n(31),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.parse=function(e){var t=this,n=new a.ImportResult,r=this.parseCsv(e,!0);return null==r?(n.success=!1,Promise.resolve(n)):(r.forEach((function(e){var r=t.initLoginCipher();r.name=t.getValueOrDefault(e.DisplayName,"--"),r.notes=t.getValueOrDefault(e.Notes),r.login.username=t.getValueOrDefault(e.UserName),r.login.password=t.getValueOrDefault(e.Password),r.login.uris=t.makeUriArray(e.Url),t.cleanupCipher(r),n.ciphers.push(r)})),n.success=!0,Promise.resolve(n))},t}(o.BaseImporter);t.MeldiumCsvImporter=s},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.MSecureCsvImporter=void 0;var o=n(30),a=n(31),s=n(43),l=n(109),c=n(108),p=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.parse=function(e){var t=this,n=new a.ImportResult,r=this.parseCsv(e,!1);return null==r?(n.success=!1,Promise.resolve(n)):(r.forEach((function(e){if(!(e.length<3)){var r="Unassigned"!==t.getValueOrDefault(e[0],"Unassigned")?e[0]:null;t.processFolder(n,r);var i=t.initLoginCipher();if(i.name=t.getValueOrDefault(e[2],"--"),"Web Logins"===e[1]||"Login"===e[1])i.login.uris=t.makeUriArray(e[4]),i.login.username=t.getValueOrDefault(e[5]),i.login.password=t.getValueOrDefault(e[6]),i.notes=t.isNullOrWhitespace(e[3])?null:e[3].split("\\n").join("\n");else if(e.length>3){i.type=s.CipherType.SecureNote,i.secureNote=new c.SecureNoteView,i.secureNote.type=l.SecureNoteType.Generic;for(var o=3;o0&&(e.identity.firstName=this.getValueOrDefault(n[0])),2===n.length?e.identity.lastName=this.getValueOrDefault(n[1]):n.length>=3&&(e.identity.middleName=this.getValueOrDefault(n[1]),e.identity.lastName=n.slice(2,n.length).join(" "))}},t}(o.BaseImporter);t.NordPassCsvImporter=u},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.OnePassword1PifImporter=void 0;var o=n(30),a=n(31),s=n(92),l=n(145),c=n(415),p=n(108),u=n(43),d=n(137),m=n(109),f=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.result=new a.ImportResult,t}return i(t,e),t.prototype.parse=function(e){var t=this;return e.split(this.newLineRegex).forEach((function(e){if(!t.isNullOrWhitespace(e)&&"{"===e[0]){var n=JSON.parse(e);if(!0!==n.trashed){var r=t.initLoginCipher();t.isNullOrWhitespace(n.hmac)?t.processStandardItem(n,r):t.processWinOpVaultItem(n,r),t.convertToNoteIfNeeded(r),t.cleanupCipher(r),t.result.ciphers.push(r)}}})),this.result.success=!0,Promise.resolve(this.result)},t.prototype.processWinOpVaultItem=function(e,t){var n=this;if(null!=e.overview&&(t.name=this.getValueOrDefault(e.overview.title),null!=e.overview.URLs)){var r=[];e.overview.URLs.forEach((function(e){n.isNullOrWhitespace(e.u)||r.push(e.u)})),t.login.uris=this.makeUriArray(r)}null!=e.details&&(null!=e.details.passwordHistory&&this.parsePasswordHistory(e.details.passwordHistory,t),this.isNullOrWhitespace(e.details.ccnum)&&this.isNullOrWhitespace(e.details.cvv)?this.isNullOrWhitespace(e.details.firstname)&&this.isNullOrWhitespace(e.details.address1)||(t.type=u.CipherType.Identity,t.identity=new l.IdentityView):(t.type=u.CipherType.Card,t.card=new s.CardView),t.type!==u.CipherType.Login||this.isNullOrWhitespace(e.details.password)||(t.login.password=e.details.password),this.isNullOrWhitespace(e.details.notesPlain)||(t.notes=e.details.notesPlain.split(this.newLineRegex).join("\n")+"\n"),null!=e.details.fields&&this.parseFields(e.details.fields,t,"designation","value","name"),null!=e.details.sections&&e.details.sections.forEach((function(e){null!=e.fields&&n.parseFields(e.fields,t,"n","v","t")})))},t.prototype.processStandardItem=function(e,t){var n=this;if(t.favorite=!(!e.openContents||!e.openContents.faveIndex),t.name=this.getValueOrDefault(e.title),"securenotes.SecureNote"===e.typeName?(t.type=u.CipherType.SecureNote,t.secureNote=new p.SecureNoteView,t.secureNote.type=m.SecureNoteType.Generic):"wallet.financial.CreditCard"===e.typeName?(t.type=u.CipherType.Card,t.card=new s.CardView):"identities.Identity"===e.typeName?(t.type=u.CipherType.Identity,t.identity=new l.IdentityView):t.login.uris=this.makeUriArray(e.location),null!=e.secureContents){if(null!=e.secureContents.passwordHistory&&this.parsePasswordHistory(e.secureContents.passwordHistory,t),this.isNullOrWhitespace(e.secureContents.notesPlain)||(t.notes=e.secureContents.notesPlain.split(this.newLineRegex).join("\n")+"\n"),t.type===u.CipherType.Login&&(this.isNullOrWhitespace(e.secureContents.password)||(t.login.password=e.secureContents.password),null!=e.secureContents.URLs)){var r=[];e.secureContents.URLs.forEach((function(e){n.isNullOrWhitespace(e.url)||r.push(e.url)})),r.length>0&&(t.login.uris=this.makeUriArray(r))}null!=e.secureContents.fields&&this.parseFields(e.secureContents.fields,t,"designation","value","name"),null!=e.secureContents.sections&&e.secureContents.sections.forEach((function(e){null!=e.fields&&n.parseFields(e.fields,t,"n","v","t")}))}},t.prototype.parsePasswordHistory=function(e,t){var n=this,r=e.length>5?5:e.length;t.passwordHistory=e.filter((function(e){return!n.isNullOrWhitespace(e.value)&&null!=e.time})).sort((function(e,t){return t.time-e.time})).slice(0,r).map((function(e){var t=new c.PasswordHistoryView;return t.password=e.value,t.lastUsedDate=new Date((""+e.time).length>=13?e.time:1e3*e.time),t}))},t.prototype.parseFields=function(e,t,n,r,i){var o=this;e.forEach((function(e){if(null!=e[r]&&""!==e[r].toString().trim()){var a=e[r].toString(),s=null!=e[n]?e[n].toString():null;if(t.type===u.CipherType.Login){if(o.isNullOrWhitespace(t.login.username)&&"username"===s)return void(t.login.username=a);if(o.isNullOrWhitespace(t.login.password)&&"password"===s)return void(t.login.password=a);if(o.isNullOrWhitespace(t.login.totp)&&null!=s&&s.startsWith("TOTP_"))return void(t.login.totp=a)}else if(t.type===u.CipherType.Card){if(o.isNullOrWhitespace(t.card.number)&&"ccnum"===s)return t.card.number=a,void(t.card.brand=o.getCardBrand(a));if(o.isNullOrWhitespace(t.card.code)&&"cvv"===s)return void(t.card.code=a);if(o.isNullOrWhitespace(t.card.cardholderName)&&"cardholder"===s)return void(t.card.cardholderName=a);if(o.isNullOrWhitespace(t.card.expiration)&&"expiry"===s&&6===a.length)return t.card.expMonth=a.substr(4,2),"0"===t.card.expMonth[0]&&(t.card.expMonth=t.card.expMonth.substr(1,1)),void(t.card.expYear=a.substr(0,4));if("type"===s)return}else if(t.type===u.CipherType.Identity){var l=t.identity;if(o.isNullOrWhitespace(l.firstName)&&"firstname"===s)return void(l.firstName=a);if(o.isNullOrWhitespace(l.lastName)&&"lastname"===s)return void(l.lastName=a);if(o.isNullOrWhitespace(l.middleName)&&"initial"===s)return void(l.middleName=a);if(o.isNullOrWhitespace(l.phone)&&"defphone"===s)return void(l.phone=a);if(o.isNullOrWhitespace(l.company)&&"company"===s)return void(l.company=a);if(o.isNullOrWhitespace(l.email)&&"email"===s)return void(l.email=a);if(o.isNullOrWhitespace(l.username)&&"username"===s)return void(l.username=a);if("address"===s){var c=e[r],p=c.street,m=c.city,f=c.country,h=c.zip;return l.address1=o.getValueOrDefault(p),l.city=o.getValueOrDefault(m),o.isNullOrWhitespace(f)||(l.country=f.toUpperCase()),void(l.postalCode=o.getValueOrDefault(h))}}var v=o.isNullOrWhitespace(e[i])?"no_name":e[i];if("password"!==v||null==t.passwordHistory||!t.passwordHistory.some((function(e){return e.password===a}))){var y="concealed"===e.k?d.FieldType.Hidden:d.FieldType.Text;o.processKvp(t,v,a,y)}}}))},t}(o.BaseImporter);t.OnePassword1PifImporter=f},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.OnePasswordMacCsvImporter=void 0;var o=n(711),a=n(43),s=n(92),l=n(145),c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.setCipherType=function(e,t){switch(this.getValueOrDefault(this.getProp(e,"type"),"Login")){case"Credit Card":t.type=a.CipherType.Card,t.card=new s.CardView,o.IgnoredProperties.push("type");break;case"Identity":t.type=a.CipherType.Identity,t.identity=new l.IdentityView,o.IgnoredProperties.push("type");break;case"Login":case"Secure Note":o.IgnoredProperties.push("type")}},t}(o.OnePasswordCsvImporter);t.OnePasswordMacCsvImporter=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CipherImportContext=void 0;var r=function(e,t,n){this.importRecord=e,this.property=t,this.cipher=n,this.lowerProperty=t.toLowerCase()};t.CipherImportContext=r},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.OnePasswordWinCsvImporter=void 0;var o=n(711),a=n(43),s=n(92),l=n(145),c=n(165),p=function(e){function t(){var t=e.call(this)||this;return t.identityPropertyParsers.push(t.setIdentityAddress),t}return i(t,e),t.prototype.setCipherType=function(e,t){t.type=a.CipherType.Login,t.login=new c.LoginView,this.isNullOrWhitespace(this.getPropByRegexp(e,/\d+: number/i))||this.isNullOrWhitespace(this.getPropByRegexp(e,/\d+: expiry date/i))||(t.type=a.CipherType.Card,t.card=new s.CardView),this.isNullOrWhitespace(this.getPropByRegexp(e,/name \d+: first name/i))&&this.isNullOrWhitespace(this.getPropByRegexp(e,/name \d+: initial/i))&&this.isNullOrWhitespace(this.getPropByRegexp(e,/name \d+: last name/i))&&this.isNullOrWhitespace(this.getPropByRegexp(e,/internet \d+: email/i))||(t.type=a.CipherType.Identity,t.identity=new l.IdentityView)},t.prototype.setIdentityAddress=function(e){return!!e.lowerProperty.match(/address \d+: address/i)&&(this.processKvp(e.cipher,"address",e.importRecord[e.property]),!0)},t.prototype.setCreditCardExpiry=function(e){if(this.isNullOrWhitespace(e.cipher.card.expiration)&&e.lowerProperty.includes("expiry date")){var t=e.importRecord[e.property].split("/");return e.cipher.card.expMonth=t[0],"0"===e.cipher.card.expMonth[0]&&2===e.cipher.card.expMonth.length&&(e.cipher.card.expMonth=e.cipher.card.expMonth.substr(1,1)),e.cipher.card.expYear=t[2].length>4?t[2].substr(0,4):t[2],!0}return!1},t}(o.OnePasswordCsvImporter);t.OnePasswordWinCsvImporter=p},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.PadlockCsvImporter=void 0;var o=n(30),a=n(31),s=n(185),l=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.parse=function(e){var t=this,n=new a.ImportResult,r=this.parseCsv(e,!1);if(null==r)return n.success=!1,Promise.resolve(n);var i=null;return r.forEach((function(e){if(null!=i){if(!(e.length<2||e.length!==i.length)){if(!t.isNullOrWhitespace(e[1]))if(t.organization){(r=e[1].split(",")).forEach((function(e){e=e.trim();for(var t=!0,r=n.collections.length,i=0;i0?r[0].trim():null;t.processFolder(n,o)}var a=t.initLoginCipher();a.name=t.getValueOrDefault(e[0],"--");for(var l=2;l-1?a.login.username=e[l]:t.passwordFieldNames.indexOf(c)>-1?a.login.password=e[l]:t.uriFieldNames.indexOf(c)>-1?a.login.uris=t.makeUriArray(e[l]):t.processKvp(a,i[l],e[l]))}t.cleanupCipher(a),n.ciphers.push(a)}}else i=e.map((function(e){return e}))})),n.success=!0,Promise.resolve(n)},t}(o.BaseImporter);t.PadlockCsvImporter=l},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.PassKeepCsvImporter=void 0;var o=n(30),a=n(31),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.parse=function(e){var t=this,n=new a.ImportResult,r=this.parseCsv(e,!0);return null==r?(n.success=!1,Promise.resolve(n)):(r.forEach((function(e){t.processFolder(n,t.getValue("category",e));var r=t.initLoginCipher();r.notes=t.getValue("description",e),r.name=t.getValueOrDefault(t.getValue("title",e),"--"),r.login.username=t.getValue("username",e),r.login.password=t.getValue("password",e),r.login.uris=t.makeUriArray(t.getValue("site",e)),t.processKvp(r,"Password 2",t.getValue("password2",e)),t.cleanupCipher(r),n.ciphers.push(r)})),this.organization&&this.moveFoldersToCollections(n),n.success=!0,Promise.resolve(n))},t.prototype.getValue=function(e,t){return this.getValueOrDefault(t[e],this.getValueOrDefault(t[" "+e]))},t}(o.BaseImporter);t.PassKeepCsvImporter=s},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.PassmanJsonImporter=void 0;var o=n(30),a=n(31),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.parse=function(e){var t=this,n=new a.ImportResult,r=JSON.parse(e);return null==r||0===r.length?(n.success=!1,Promise.resolve(n)):(r.forEach((function(e){if(null!=e.tags&&e.tags.length>0){var r=e.tags[0].text;t.processFolder(n,r)}var i=t.initLoginCipher();i.name=e.label,i.login.username=t.getValueOrDefault(e.username),t.isNullOrWhitespace(i.login.username)?i.login.username=t.getValueOrDefault(e.email):t.isNullOrWhitespace(e.email)||(i.notes="Email: "+e.email+"\n"),i.login.password=t.getValueOrDefault(e.password),i.login.uris=t.makeUriArray(e.url),i.notes+=t.getValueOrDefault(e.description,""),null!=e.otp&&(i.login.totp=t.getValueOrDefault(e.otp.secret)),null!=e.custom_fields&&e.custom_fields.forEach((function(e){switch(e.field_type){case"text":case"password":t.processKvp(i,e.label,e.value)}})),t.convertToNoteIfNeeded(i),t.cleanupCipher(i),n.ciphers.push(i)})),this.organization&&this.moveFoldersToCollections(n),n.success=!0,Promise.resolve(n))},t}(o.BaseImporter);t.PassmanJsonImporter=s},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.PasspackCsvImporter=void 0;var o=n(30),a=n(31),s=n(185),l=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.parse=function(e){var t=this,n=new a.ImportResult,r=this.parseCsv(e,!0);return null==r?(n.success=!1,Promise.resolve(n)):(r.forEach((function(e){var r=t.isNullOrWhitespace(e.Tags)?null:JSON.parse(e.Tags),i=null!=r&&null!=r.tags&&r.tags.length>0?r.tags.map((function(e){try{var n=JSON.parse(e);return t.getValueOrDefault(n.tag)}catch(r){}return null})).filter((function(e){return!t.isNullOrWhitespace(e)})):null;t.organization&&null!=i&&i.length>0?i.forEach((function(e){for(var t=!0,r=n.collections.length,i=0;i0&&t.processFolder(n,i[0]);var o=t.initLoginCipher();o.notes=t.getValueOrDefault(e.Notes,""),o.notes+="\n\n"+t.getValueOrDefault(e["Shared Notes"],"")+"\n",o.name=t.getValueOrDefault(e["Entry Name"],"--"),o.login.username=t.getValueOrDefault(e["User ID"]),o.login.password=t.getValueOrDefault(e.Password),o.login.uris=t.makeUriArray(e.URL),null!=e.__parsed_extra&&e.__parsed_extra.length>0&&e.__parsed_extra.forEach((function(e){t.isNullOrWhitespace(e)||(o.notes+="\n"+e)}));var a=t.isNullOrWhitespace(e["Extra Fields"])?null:JSON.parse(e["Extra Fields"]),l=null!=a&&null!=a.extraFields&&a.extraFields.length>0?a.extraFields.map((function(e){try{return JSON.parse(e)}catch(t){}return null})):null;null!=l&&l.forEach((function(e){null!=e&&t.processKvp(o,e.name,e.data)})),t.cleanupCipher(o),n.ciphers.push(o)})),n.success=!0,Promise.resolve(n))},t}(o.BaseImporter);t.PasspackCsvImporter=l},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.PasswordAgentCsvImporter=void 0;var o=n(30),a=n(31),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.parse=function(e){var t=this,n=new a.ImportResult,r=this.parseCsv(e,!1);if(null==r)return n.success=!1,Promise.resolve(n);var i=!0;return r.forEach((function(e){if(!(5!==e.length&&e.length<9)){var r=10===e.length&&"0"===e[0],o=t.initLoginCipher();if(o.name=t.getValueOrDefault(e[r?1:0],"--"),o.login.username=t.getValueOrDefault(e[r?2:1]),o.login.password=t.getValueOrDefault(e[r?3:2]),5===e.length)i=!1,o.notes=t.getValueOrDefault(e[4]),o.login.uris=t.makeUriArray(e[3]);else{var a=t.getValueOrDefault(e[r?9:8],"(None)"),s="(None)"!==a?a.split("\\").join("/"):null;null!=s&&(s=a.split(" > ").join("/"),s=a.split(">").join("/")),t.processFolder(n,s),o.notes=t.getValueOrDefault(e[r?5:3]),o.login.uris=t.makeUriArray(e[4])}t.convertToNoteIfNeeded(o),t.cleanupCipher(o),n.ciphers.push(o)}})),i&&this.organization&&this.moveFoldersToCollections(n),n.success=!0,Promise.resolve(n)},t}(o.BaseImporter);t.PasswordAgentCsvImporter=s},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.PasswordBossJsonImporter=void 0;var o=n(30),a=n(31),s=n(92),l=n(146),c=n(43),p=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.parse=function(e){var t=this,n=new a.ImportResult,r=JSON.parse(e);if(null==r||null==r.items)return n.success=!1,Promise.resolve(n);var i=new Map;r.folders.forEach((function(e){i.set(e.id,e.name)}));var o=new Map;return i.forEach((function(e,t){o.set(t,n.folders.length);var r=new l.FolderView;r.name=e,n.folders.push(r)})),r.items.forEach((function(e){var r=t.initLoginCipher();if(r.name=t.getValueOrDefault(e.name,"--"),r.login.uris=t.makeUriArray(e.login_url),null!=e.folder&&o.has(e.folder)&&n.folderRelationships.push([n.ciphers.length,o.get(e.folder)]),null!=e.identifiers){for(var i in t.isNullOrWhitespace(e.identifiers.notes)||(r.notes=e.identifiers.notes.split("\\r\\n").join("\n").split("\\n").join("\n")),"CreditCard"===e.type&&(r.card=new s.CardView,r.type=c.CipherType.Card),e.identifiers)if(e.identifiers.hasOwnProperty(i)){var a=e.identifiers[i],l=null!=a?a.toString():null;if(!t.isNullOrWhitespace(l)&&"notes"!==i&&"ignoreItemInSecurityScore"!==i)if("custom_fields"!==i){if(r.type===c.CipherType.Card){if("cardNumber"===i){r.card.number=l,r.card.brand=t.getCardBrand(l);continue}if("nameOnCard"===i){r.card.cardholderName=l;continue}if("security_code"===i){r.card.code=l;continue}if("expires"===i){try{var p=new Date(l);r.card.expYear=p.getFullYear().toString(),r.card.expMonth=(p.getMonth()+1).toString()}catch(u){}continue}if("cardType"===i)continue}else{if(("username"===i||"email"===i)&&t.isNullOrWhitespace(r.login.username)){r.login.username=l;continue}if("password"===i){r.login.password=l;continue}if("totp"===i){r.login.totp=l;continue}if((null==r.login.uris||0===r.login.uris.length)&&t.uriFieldNames.indexOf(i)>-1){r.login.uris=t.makeUriArray(l);continue}}t.processKvp(r,i,l)}else a.forEach((function(e){t.processKvp(r,e.name,e.value)}))}t.convertToNoteIfNeeded(r),t.cleanupCipher(r),n.ciphers.push(r)}})),n.success=!0,Promise.resolve(n)},t}(o.BaseImporter);t.PasswordBossJsonImporter=p},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.PasswordDragonXmlImporter=void 0;var o=n(30),a=n(31),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.parse=function(e){var t=this,n=new a.ImportResult,r=this.parseXml(e);if(null==r)return n.success=!1,Promise.resolve(n);var i=r.querySelectorAll("PasswordManager > record");return Array.from(i).forEach((function(e){var r=t.querySelectorDirectChild(e,"Category"),i=null==r||t.isNullOrWhitespace(r.textContent)||"Unfiled"===r.textContent?null:r.textContent;t.processFolder(n,i);var o=t.querySelectorDirectChild(e,"Account-Name"),a=t.querySelectorDirectChild(e,"User-Id"),s=t.querySelectorDirectChild(e,"Password"),l=t.querySelectorDirectChild(e,"URL"),c=t.querySelectorDirectChild(e,"Notes"),p=t.initLoginCipher();p.name=null!=o?t.getValueOrDefault(o.textContent,"--"):"--",p.notes=null!=c?t.getValueOrDefault(c.textContent):"",p.login.username=null!=a?t.getValueOrDefault(a.textContent):null,p.login.password=null!=s?t.getValueOrDefault(s.textContent):null,p.login.uris=null!=l?t.makeUriArray(l.textContent):null;for(var u=[],d=1;d<=10;d++)u.push("Attribute-"+d);t.querySelectorAllDirectChild(e,u.join(",")).forEach((function(e){t.isNullOrWhitespace(e.textContent)||"null"===e.textContent||t.processKvp(p,e.tagName,e.textContent)})),t.cleanupCipher(p),n.ciphers.push(p)})),this.organization&&this.moveFoldersToCollections(n),n.success=!0,Promise.resolve(n)},t}(o.BaseImporter);t.PasswordDragonXmlImporter=s},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.PasswordSafeXmlImporter=void 0;var o=n(30),a=n(31),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.parse=function(e){var t=this,n=new a.ImportResult,r=this.parseXml(e);if(null==r)return n.success=!1,Promise.resolve(n);var i=r.querySelector("passwordsafe");if(null==i)return n.errorMessage="Missing `passwordsafe` node.",n.success=!1,Promise.resolve(n);var o=i.getAttribute("delimiter"),s=r.querySelectorAll("passwordsafe > entry");return Array.from(s).forEach((function(e){var r=t.querySelectorDirectChild(e,"group"),i=null==r||t.isNullOrWhitespace(r.textContent)?null:r.textContent.split(".").join("/");t.processFolder(n,i);var a=t.querySelectorDirectChild(e,"title"),s=t.querySelectorDirectChild(e,"username"),l=t.querySelectorDirectChild(e,"email"),c=t.querySelectorDirectChild(e,"password"),p=t.querySelectorDirectChild(e,"url"),u=t.querySelectorDirectChild(e,"notes"),d=t.initLoginCipher();d.name=null!=a?t.getValueOrDefault(a.textContent,"--"):"--",d.notes=null!=u?t.getValueOrDefault(u.textContent,"").split(o).join("\n"):null,d.login.username=null!=s?t.getValueOrDefault(s.textContent):null,d.login.password=null!=c?t.getValueOrDefault(c.textContent):null,d.login.uris=null!=p?t.makeUriArray(p.textContent):null,t.isNullOrWhitespace(d.login.username)&&null!=l?d.login.username=t.getValueOrDefault(l.textContent):null==l||t.isNullOrWhitespace(l.textContent)||(d.notes=t.isNullOrWhitespace(d.notes)?"Email: "+l.textContent:d.notes+"\nEmail: "+l.textContent),t.cleanupCipher(d),n.ciphers.push(d)})),this.organization&&this.moveFoldersToCollections(n),n.success=!0,Promise.resolve(n)},t}(o.BaseImporter);t.PasswordSafeXmlImporter=s},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.PasswordWalletTxtImporter=void 0;var o=n(30),a=n(31),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.parse=function(e){var t=this,n=new a.ImportResult,r=this.parseCsv(e,!1);return null==r?(n.success=!1,Promise.resolve(n)):(r.forEach((function(e){if(!(e.length<1)){e.length>5&&t.processFolder(n,e[5]);var r=t.initLoginCipher();r.name=t.getValueOrDefault(e[0],"--"),e.length>4&&(r.notes=t.getValueOrDefault(e[4],"").split("¬").join("\n")),e.length>2&&(r.login.username=t.getValueOrDefault(e[2])),e.length>3&&(r.login.password=t.getValueOrDefault(e[3])),e.length>1&&(r.login.uris=t.makeUriArray(e[1])),t.cleanupCipher(r),n.ciphers.push(r)}})),this.organization&&this.moveFoldersToCollections(n),n.success=!0,Promise.resolve(n))},t}(o.BaseImporter);t.PasswordWalletTxtImporter=s},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.RememBearCsvImporter=void 0;var o=n(30),a=n(43),s=n(31),l=n(92),c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.parse=function(e){var t=this,n=new s.ImportResult,r=this.parseCsv(e,!0);return null==r?(n.success=!1,Promise.resolve(n)):(r.forEach((function(e){if("true"!==e.trash){var r=t.initLoginCipher();if(r.name=t.getValueOrDefault(e.name),r.notes=t.getValueOrDefault(e.notes),"LoginItem"===e.type)r.login.uris=t.makeUriArray(e.website),r.login.password=t.getValueOrDefault(e.password),r.login.username=t.getValueOrDefault(e.username);else if("CreditCardItem"===e.type){r.type=a.CipherType.Card,r.card=new l.CardView,r.card.cardholderName=t.getValueOrDefault(e.cardholder),r.card.number=t.getValueOrDefault(e.number),r.card.brand=t.getCardBrand(r.card.number),r.card.code=t.getValueOrDefault(e.verification);try{var i=t.getValueOrDefault(e.expiryMonth);if(null!=i){var o=parseInt(i,null);null!=o&&o>=1&&o<=12&&(r.card.expMonth=o.toString())}}catch(d){}try{var s=t.getValueOrDefault(e.expiryYear);if(null!=s){var c=parseInt(s,null);null!=c&&(r.card.expYear=c.toString())}}catch(m){}var p=t.getValueOrDefault(e.pin);null!=p&&t.processKvp(r,"PIN",p);var u=t.getValueOrDefault(e.zipCode);null!=u&&t.processKvp(r,"Zip Code",u)}t.cleanupCipher(r),n.ciphers.push(r)}})),n.success=!0,Promise.resolve(n))},t}(o.BaseImporter);t.RememBearCsvImporter=c},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.RoboFormCsvImporter=void 0;var o=n(30),a=n(31),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.parse=function(e){var t=this,n=new a.ImportResult,r=this.parseCsv(e,!0);if(null==r)return n.success=!1,Promise.resolve(n);var i=1;return r.forEach((function(e){var o=!t.isNullOrWhitespace(e.Folder)&&e.Folder.startsWith("/")?e.Folder.replace("/",""):e.Folder,a=t.isNullOrWhitespace(o)?null:o;t.processFolder(n,a);var s=t.initLoginCipher();if(s.notes=t.getValueOrDefault(e.Note),s.name=t.getValueOrDefault(e.Name,"--"),s.login.username=t.getValueOrDefault(e.Login),s.login.password=t.getValueOrDefault(e.Pwd),s.login.uris=t.makeUriArray(e.Url),!t.isNullOrWhitespace(e.Rf_fields)){var l=[e.Rf_fields];null!=e.__parsed_extra&&e.__parsed_extra.length>0&&(l=l.concat(e.__parsed_extra)),l.forEach((function(e){var n=e.split(":");if(!(n.length<3)){var r="-no-name-"===n[0]?null:n[0],i=4===n.length&&"rck"===n[2]?n[1]:n[2];t.processKvp(s,r,i)}}))}t.convertToNoteIfNeeded(s),t.cleanupCipher(s),i===r.length&&"--"===s.name&&t.isNullOrWhitespace(s.login.password)||(n.ciphers.push(s),i++)})),this.organization&&this.moveFoldersToCollections(n),n.success=!0,Promise.resolve(n)},t}(o.BaseImporter);t.RoboFormCsvImporter=s},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.SafariCsvImporter=void 0;var o=n(30),a=n(31),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.parse=function(e){var t=this,n=new a.ImportResult,r=this.parseCsv(e,!0);return null==r?(n.success=!1,Promise.resolve(n)):(r.forEach((function(e){var r=t.initLoginCipher();r.name=t.getValueOrDefault(e.Title,"--"),r.login.username=t.getValueOrDefault(e.Username),r.login.password=t.getValueOrDefault(e.Password),r.login.uris=t.makeUriArray(e.Url),r.login.totp=t.getValueOrDefault(e.OTPAuth),t.cleanupCipher(r),n.ciphers.push(r)})),n.success=!0,Promise.resolve(n))},t}(o.BaseImporter);t.SafariCsvImporter=s},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.SafeInCloudXmlImporter=void 0;var o=n(30),a=n(31),s=n(146),l=n(108),c=n(43),p=n(109),u=n(137),d=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.parse=function(e){var t=this,n=new a.ImportResult,r=this.parseXml(e);if(null==r)return n.success=!1,Promise.resolve(n);if(null==r.querySelector("database"))return n.errorMessage="Missing `database` node.",n.success=!1,Promise.resolve(n);var i=new Map;return Array.from(r.querySelectorAll("database > label")).forEach((function(e){var r=e.getAttribute("name"),o=e.getAttribute("id");if(!t.isNullOrWhitespace(r)&&!t.isNullOrWhitespace(o)){i.set(o,n.folders.length);var a=new s.FolderView;a.name=r,n.folders.push(a)}})),Array.from(r.querySelectorAll("database > card")).forEach((function(e){if("true"!==e.getAttribute("template")&&"true"!==e.getAttribute("deleted")){var r=t.querySelectorDirectChild(e,"label_id");if(null!=r){var o=r.textContent;!t.isNullOrWhitespace(o)&&i.has(o)&&n.folderRelationships.push([n.ciphers.length,i.get(o)])}var a=t.initLoginCipher();a.name=t.getValueOrDefault(e.getAttribute("title"),"--"),"true"===e.getAttribute("star")&&(a.favorite=!0),"note"===e.getAttribute("type")?(a.type=c.CipherType.SecureNote,a.secureNote=new l.SecureNoteView,a.secureNote.type=p.SecureNoteType.Generic):Array.from(t.querySelectorAllDirectChild(e,"field")).forEach((function(e){var n=e.textContent;if(!t.isNullOrWhitespace(n)){var r=e.getAttribute("name"),i=t.getValueOrDefault(e.getAttribute("type"),"").toLowerCase();"login"===i?a.login.username=n:"password"===i||"secret"===i?t.processKvp(a,r,n,u.FieldType.Hidden):"one_time_password"===i?a.login.totp=n:"notes"===i?a.notes+=n+"\n":"weblogin"===i||"website"===i?a.login.uris=t.makeUriArray(n):t.processKvp(a,r,n)}})),Array.from(t.querySelectorAllDirectChild(e,"notes")).forEach((function(e){a.notes+=e.textContent+"\n"})),t.setPassword(a),t.cleanupCipher(a),n.ciphers.push(a)}})),this.organization&&this.moveFoldersToCollections(n),n.success=!0,Promise.resolve(n)},t.prototype.setPassword=function(e){var t=e.fields.filter((function(e){return e.type===u.FieldType.Hidden}));if(t.length){for(var n,r=0,i=t;r Database > Logins > Login");return Array.from(i).forEach((function(e){var i=e.getAttribute("ID");if(!t.isNullOrWhitespace(i)){var o=e.getAttribute("Name"),a=e.getAttribute("Password"),s=null,l=null,c=null,p=null,u=null,d=r.querySelector('root > Database > Accounts > Account > LoginLinks > Login[SourceLoginID="'+i+'"]');if(null!=d){var m=d.parentElement.parentElement;null!=m&&(s=m.getAttribute("Name"),l=m.getAttribute("Link"),p=m.getAttribute("ParentID"),c=m.getAttribute("Comments"),t.isNullOrWhitespace(c)||(c=c.split("/n").join("\n")))}t.isNullOrWhitespace(p)||(u=t.buildGroupText(r,p,""),t.processFolder(n,u));var f=t.initLoginCipher();f.name=t.getValueOrDefault(s,"--"),f.notes=t.getValueOrDefault(c),f.login.username=t.getValueOrDefault(o),f.login.password=t.getValueOrDefault(a),f.login.uris=t.makeUriArray(l),t.cleanupCipher(f),n.ciphers.push(f)}})),this.organization&&this.moveFoldersToCollections(n),n.success=!0,Promise.resolve(n)},t.prototype.buildGroupText=function(e,t,n){var r=e.querySelector('root > Database > Groups > Group[ID="'+t+'"]');return null==r?n:(this.isNullOrWhitespace(n)||(n="/"+n),n=r.getAttribute("Name")+n,this.buildGroupText(e,r.getAttribute("ParentID"),n))},t}(o.BaseImporter);t.StickyPasswordXmlImporter=s},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.TrueKeyCsvImporter=void 0;var o=n(30),a=n(31),s=n(92),l=n(108),c=n(43),p=n(109),u=["kind","autologin","favorite","hexcolor","protectedwithpassword","subdomainonly","type","tk_export_version","note","title","document_content"],d=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.parse=function(e){var t=this,n=new a.ImportResult,r=this.parseCsv(e,!0);return null==r?(n.success=!1,Promise.resolve(n)):(r.forEach((function(e){var r=t.initLoginCipher();if(r.favorite="true"===t.getValueOrDefault(e.favorite,"").toLowerCase(),r.name=t.getValueOrDefault(e.name,"--"),r.notes=t.getValueOrDefault(e.memo,""),r.login.username=t.getValueOrDefault(e.login),r.login.password=t.getValueOrDefault(e.password),r.login.uris=t.makeUriArray(e.url),"login"!==e.kind&&(r.name=t.getValueOrDefault(e.title,"--"),r.notes=t.getValueOrDefault(e.note,"")),"cc"===e.kind){if(r.type=c.CipherType.Card,r.card=new s.CardView,r.card.cardholderName=t.getValueOrDefault(e.cardholder),r.card.number=t.getValueOrDefault(e.number),r.card.brand=t.getCardBrand(r.card.number),!t.isNullOrWhitespace(e.expiryDate))try{var i=new Date(e.expiryDate);r.card.expYear=i.getFullYear().toString(),r.card.expMonth=(i.getMonth()+1).toString()}catch(a){}}else if("login"!==e.kind)for(var o in r.type=c.CipherType.SecureNote,r.secureNote=new l.SecureNoteView,r.secureNote.type=p.SecureNoteType.Generic,t.isNullOrWhitespace(r.notes)||(r.notes=t.getValueOrDefault(e.document_content,"")),e)e.hasOwnProperty(o)&&u.indexOf(o.toLowerCase())<0&&!t.isNullOrWhitespace(e[o])&&t.processKvp(r,o,e[o]);t.cleanupCipher(r),n.ciphers.push(r)})),n.success=!0,Promise.resolve(n))},t}(o.BaseImporter);t.TrueKeyCsvImporter=d},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.UpmCsvImporter=void 0;var o=n(30),a=n(31),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.parse=function(e){var t=this,n=new a.ImportResult,r=this.parseCsv(e,!1);return null==r?(n.success=!1,Promise.resolve(n)):(r.forEach((function(e){if(5===e.length){var r=t.initLoginCipher();r.name=t.getValueOrDefault(e[0],"--"),r.notes=t.getValueOrDefault(e[4]),r.login.username=t.getValueOrDefault(e[1]),r.login.password=t.getValueOrDefault(e[2]),r.login.uris=t.makeUriArray(e[3]),t.cleanupCipher(r),n.ciphers.push(r)}})),n.success=!0,Promise.resolve(n))},t}(o.BaseImporter);t.UpmCsvImporter=s},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.YotiCsvImporter=void 0;var o=n(30),a=n(31),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.parse=function(e){var t=this,n=new a.ImportResult,r=this.parseCsv(e,!0);return null==r?(n.success=!1,Promise.resolve(n)):(r.forEach((function(e){var r=t.initLoginCipher();r.name=t.getValueOrDefault(e.Name,"--"),r.login.username=t.getValueOrDefault(e["User name"]),r.login.password=t.getValueOrDefault(e.Password),r.login.uris=t.makeUriArray(e.URL),t.cleanupCipher(r),n.ciphers.push(r)})),n.success=!0,Promise.resolve(n))},t}(o.BaseImporter);t.YotiCsvImporter=s},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.ZohoVaultCsvImporter=void 0;var o=n(30),a=n(31),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.parse=function(e){var t=this,n=new a.ImportResult,r=this.parseCsv(e,!0);return null==r?(n.success=!1,Promise.resolve(n)):(r.forEach((function(e){if(!t.isNullOrWhitespace(e["Password Name"])||!t.isNullOrWhitespace(e["Secret Name"])){t.processFolder(n,t.getValueOrDefault(e.ChamberName));var r=t.initLoginCipher();r.favorite="1"===t.getValueOrDefault(e.Favorite,"0"),r.notes=t.getValueOrDefault(e.Notes),r.name=t.getValueOrDefault(e["Password Name"],t.getValueOrDefault(e["Secret Name"],"--")),r.login.uris=t.makeUriArray(t.getValueOrDefault(e["Password URL"],t.getValueOrDefault(e["Secret URL"]))),t.parseData(r,e.SecretData),t.parseData(r,e.CustomData),t.convertToNoteIfNeeded(r),t.cleanupCipher(r),n.ciphers.push(r)}})),this.organization&&this.moveFoldersToCollections(n),n.success=!0,Promise.resolve(n))},t.prototype.parseData=function(e,t){var n=this;this.isNullOrWhitespace(t)||this.splitNewLine(t).forEach((function(t){var r=t.indexOf(":");if(!(r<0)){var i=t.substring(0,r),o=t.length>r?t.substring(r+1):null;if(!n.isNullOrWhitespace(i)&&!n.isNullOrWhitespace(o)&&"SecretType"!==i){var a=i.toLowerCase();null==e.login.username&&n.usernameFieldNames.indexOf(a)>-1?e.login.username=o:null==e.login.password&&n.passwordFieldNames.indexOf(a)>-1?e.login.password=o:n.processKvp(e,i,o)}}}))},t}(o.BaseImporter);t.ZohoVaultCsvImporter=s},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0)for(d=0;d0)for(d=0;d0)for(d=0;d0)for(d=0;d1)&&(t.wordSeparator=" "),null==t.capitalize&&(t.capitalize=!1),null==t.includeNumber&&(t.includeNumber=!1),n=c.EEFLongWordList.length-1,r=new Array(t.numWords),o=0,i.label=1;case 1:return oe.length&&(e.minSpecial=e.length-e.minNumber),e.numWordsn.minLength&&(n.minLength=e.data.minLength),e.data.useUpper&&(n.useUppercase=!0),e.data.useLower&&(n.useLowercase=!0),e.data.useNumbers&&(n.useNumbers=!0),null!=e.data.minNumbers&&e.data.minNumbers>n.numberCount&&(n.numberCount=e.data.minNumbers),e.data.useSpecial&&(n.useSpecial=!0),null!=e.data.minSpecial&&e.data.minSpecial>n.specialCount&&(n.specialCount=e.data.minSpecial),null!=e.data.minNumberWords&&e.data.minNumberWords>n.minNumberWords&&(n.minNumberWords=e.data.minNumberWords),e.data.capitalize&&(n.capitalize=!0),e.data.includeNumber&&(n.includeNumber=!0))})),[2,n])}}))}))},e.prototype.saveOptions=function(e){return r(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.storageService.save(d,e)];case 1:return t.sent(),this.optionsCache=e,[2]}}))}))},e.prototype.getHistory=function(){return r(this,void 0,void 0,(function(){var e,t;return i(this,(function(n){switch(n.label){case 0:return[4,this.cryptoService.hasKey()];case 1:return n.sent()?this.history?[3,4]:[4,this.storageService.get(m)]:[2,new Array];case 2:return e=n.sent(),t=this,[4,this.decryptHistory(e)];case 3:t.history=n.sent(),n.label=4;case 4:return[2,this.history||new Array]}}))}))},e.prototype.addHistory=function(e){return r(this,void 0,void 0,(function(){var t,n;return i(this,(function(r){switch(r.label){case 0:return[4,this.cryptoService.hasKey()];case 1:return r.sent()?[4,this.getHistory()]:[2];case 2:return t=r.sent(),this.matchesPrevious(e,t)?[2]:(t.unshift(new s.GeneratedPasswordHistory(e,Date.now())),t.length>100&&t.pop(),[4,this.encryptHistory(t)]);case 3:return n=r.sent(),[4,this.storageService.save(m,n)];case 4:return[2,r.sent()]}}))}))},e.prototype.clear=function(){return r(this,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return this.history=[],[4,this.storageService.remove(m)];case 1:return[2,e.sent()]}}))}))},e.prototype.passwordStrength=function(e,t){if(void 0===t&&(t=null),null==e||0===e.length)return null;var n=["bitwarden","bit","warden"];null!=t&&t.length>0&&(n=n.concat(t));var r=Array.from(new Set(n));return o(e,r)},e.prototype.normalizeOptions=function(e,t){e.minLowercase=0,e.minUppercase=0,!e.length||e.length<5?e.length=5:e.length>128&&(e.length=128),e.lengthe.length?e.minNumber=e.length:e.minNumber>9&&(e.minNumber=9):e.minNumber=0,e.minNumbere.length?e.minSpecial=e.length:e.minSpecial>9&&(e.minSpecial=9):e.minSpecial=0,e.minSpeciale.length&&(e.minSpecial=e.length-e.minNumber),null==e.numWords||e.length<3?e.numWords=3:e.numWords>20&&(e.numWords=20),e.numWords1&&(e.wordSeparator=e.wordSeparator[0]),this.sanitizePasswordLength(e,!1)},e.prototype.capitalize=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},e.prototype.appendRandomNumberToRandomWord=function(e){return r(this,void 0,void 0,(function(){var t,n;return i(this,(function(r){switch(r.label){case 0:return null==e||e.length<=0?[2]:[4,this.cryptoService.randomNumber(0,e.length-1)];case 1:return t=r.sent(),[4,this.cryptoService.randomNumber(0,9)];case 2:return n=r.sent(),e[t]=e[t]+n,[2]}}))}))},e.prototype.encryptHistory=function(e){return r(this,void 0,void 0,(function(){var t,n=this;return i(this,(function(o){switch(o.label){case 0:return null==e||0===e.length?[2,Promise.resolve([])]:(t=e.map((function(e){return r(n,void 0,void 0,(function(){var t;return i(this,(function(n){switch(n.label){case 0:return[4,this.cryptoService.encrypt(e.password)];case 1:return t=n.sent(),[2,new s.GeneratedPasswordHistory(t.encryptedString,e.date)]}}))}))})),[4,Promise.all(t)]);case 1:return[2,o.sent()]}}))}))},e.prototype.decryptHistory=function(e){return r(this,void 0,void 0,(function(){var t,n=this;return i(this,(function(o){switch(o.label){case 0:return null==e||0===e.length?[2,Promise.resolve([])]:(t=e.map((function(e){return r(n,void 0,void 0,(function(){var t;return i(this,(function(n){switch(n.label){case 0:return[4,this.cryptoService.decryptToUtf8(new a.EncString(e.password))];case 1:return t=n.sent(),[2,new s.GeneratedPasswordHistory(t,e.date)]}}))}))})),[4,Promise.all(t)]);case 1:return[2,o.sent()]}}))}))},e.prototype.matchesPrevious=function(e,t){return null!=t&&0!==t.length&&t[t.length-1].password===e},e.prototype.shuffleArray=function(e){return r(this,void 0,void 0,(function(){var t,n,r;return i(this,(function(i){switch(i.label){case 0:t=e.length-1,i.label=1;case 1:return t>0?[4,this.cryptoService.randomNumber(0,t)]:[3,4];case 2:n=i.sent(),r=[e[n],e[t]],e[t]=r[0],e[n]=r[1],i.label=3;case 3:return t--,[3,1];case 4:return[2]}}))}))},e.prototype.sanitizePasswordLength=function(e,t){var n=0,r=0,i=e.minNumber,o=e.minSpecial;e.uppercase&&e.minUppercase<=0?n=1:e.uppercase||(n=0),e.lowercase&&e.minLowercase<=0?r=1:e.lowercase||(r=0),e.number&&e.minNumber<=0?i=1:e.number||(i=0),e.special&&e.minSpecial<=0?o=1:e.special||(o=0),(!e.length||e.length<1)&&(e.length=10);var a=n+r+i+o;e.length0||this.numberCount>0||this.specialCount>0||this.useUppercase||this.useLowercase||this.useNumbers||this.useSpecial||this.minNumberWords>0||this.capitalize||this.includeNumber},t}(n(85).default);t.PasswordGeneratorPolicyOptions=o},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]t.minComplexity&&(t.minComplexity=e.data.minComplexity),null!=e.data.minLength&&e.data.minLength>t.minLength&&(t.minLength=e.data.minLength),e.data.requireUpper&&(t.requireUpper=!0),e.data.requireLower&&(t.requireLower=!0),e.data.requireNumbers&&(t.requireNumbers=!0),e.data.requireSpecial&&(t.requireSpecial=!0))})),[2,t]}}))}))},e.prototype.evaluateMasterPassword=function(e,t,n){return null==n||!(n.minComplexity>0&&n.minComplexity>e)&&(!(n.minLength>0&&n.minLength>t.length)&&((!n.requireUpper||t.toLocaleLowerCase()!==t)&&((!n.requireLower||t.toLocaleUpperCase()!==t)&&(!(n.requireNumbers&&!/[0-9]/.test(t))&&!(n.requireSpecial&&!/[!@#$%\^&*]/g.test(t))))))},e.prototype.getResetPasswordPolicyOptions=function(e,t){var n,r,i,o=new l.ResetPasswordPolicyOptions;if(null==e||null==t)return[o,!1];var a=e.find((function(e){return e.organizationId===t&&e.type===u.PolicyType.ResetPassword&&e.enabled}));return o.autoEnrollEnabled=null!==(r=null===(n=null==a?void 0:a.data)||void 0===n?void 0:n.autoEnrollEnabled)&&void 0!==r&&r,[o,null!==(i=null==a?void 0:a.enabled)&&void 0!==i&&i]},e.prototype.mapPoliciesFromToken=function(e){return null==e||null==e.data?null:e.data.map((function(e){return new o.PolicyData(e)})).map((function(e){return new s.Policy(e)}))},e.prototype.policyAppliesToUser=function(e,t){return r(this,void 0,void 0,(function(){var n,r,o,a,s=this;return i(this,(function(i){switch(i.label){case 0:return[4,this.getAll(e)];case 1:return n=i.sent(),[4,this.userService.getAllOrganizations()];case 2:return r=i.sent(),o=null!=t?n.filter((function(e){return e.enabled&&t(e)})):n.filter((function(e){return e.enabled})),a=new Set(o.map((function(e){return e.organizationId}))),[2,r.some((function(t){return t.enabled&&t.status>=c.OrganizationUserStatusType.Accepted&&t.usePolicies&&!s.isExcemptFromPolicies(t,e)&&a.has(t.id)}))]}}))}))},e.prototype.isExcemptFromPolicies=function(e,t){return t===u.PolicyType.MaximumVaultTimeout?e.type===p.OrganizationUserType.Owner:e.isExemptFromPolicies},e}();t.PolicyService=m},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.ResetPasswordPolicyOptions=void 0;var o=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.autoEnrollEnabled=!1,t}return i(t,e),t}(n(85).default);t.ResetPasswordPolicyOptions=o},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]"))},e.prototype.indexCiphers=function(e,t){return r(this,void 0,void 0,(function(){var n,r,s=this;return i(this,(function(i){switch(i.label){case 0:return this.indexing?[2]:(this.logService.time("search indexing"),this.indexing=!0,this.indexedEntityId=e,this.index=null,(n=new o.Builder).ref("id"),n.field("shortid",{boost:100,extractor:function(e){return e.id.substr(0,8)}}),n.field("name",{boost:10}),n.field("subtitle",{boost:5,extractor:function(e){return null!=e.subTitle&&e.type===a.CipherType.Card?e.subTitle.replace(/\*/g,""):e.subTitle}}),n.field("notes"),n.field("login.username",{extractor:function(e){return e.type===a.CipherType.Login&&null!=e.login?e.login.username:null}}),n.field("login.uris",{boost:2,extractor:function(e){return s.uriExtractor(e)}}),n.field("fields",{extractor:function(e){return s.fieldExtractor(e,!1)}}),n.field("fields_joined",{extractor:function(e){return s.fieldExtractor(e,!0)}}),n.field("attachments",{extractor:function(e){return s.attachmentExtractor(e,!1)}}),n.field("attachments_joined",{extractor:function(e){return s.attachmentExtractor(e,!0)}}),n.field("organizationid",{extractor:function(e){return e.organizationId}}),(r=t)?[3,2]:[4,this.cipherService.getAllDecrypted()]);case 1:r=i.sent(),i.label=2;case 2:return(t=r).forEach((function(e){return n.add(e)})),this.index=n.build(),this.indexing=!1,this.logService.timeEnd("search indexing"),[2]}}))}))},e.prototype.searchCiphers=function(e,t,n){return void 0===t&&(t=null),void 0===n&&(n=null),r(this,void 0,void 0,(function(){var r,a,s,l,c;return i(this,(function(i){switch(i.label){case 0:return r=[],null!=e&&(e=e.trim().toLowerCase()),""===e&&(e=null),null!=n?[3,2]:[4,this.cipherService.getAllDecrypted()];case 1:n=i.sent(),i.label=2;case 2:return null!=t&&Array.isArray(t)&&t.length>0?n=n.filter((function(e){return t.every((function(t){return null==t||t(e)}))})):null!=t&&(n=n.filter(t)),this.isSearchable(e)?this.indexing?[4,new Promise((function(e){return setTimeout(e,250)}))]:[3,5]:[2,n];case 3:return i.sent(),this.indexing?[4,new Promise((function(e){return setTimeout(e,500)}))]:[3,5];case 4:i.sent(),i.label=5;case 5:if(null==(a=this.getIndexForSearch()))return[2,this.searchCiphersBasic(n,e)];if(s=new Map,n.forEach((function(e){return s.set(e.id,e)})),l=null,null!=e&&e.length>1&&0===e.indexOf(">"))try{l=a.search(e.substr(1).trim())}catch(p){this.logService.error(p)}else c=o.Query.wildcard.LEADING|o.Query.wildcard.TRAILING,l=a.query((function(t){o.tokenizer(e).forEach((function(e){var n=e.toString();t.term(n,{fields:["name"],wildcard:c}),t.term(n,{fields:["subtitle"],wildcard:c}),t.term(n,{fields:["login.uris"],wildcard:c}),t.term(n,{})}))}));return null!=l&&l.forEach((function(e){s.has(e.ref)&&r.push(s.get(e.ref))})),[2,r]}}))}))},e.prototype.searchCiphersBasic=function(e,t,n){return void 0===n&&(n=!1),t=t.trim().toLowerCase(),e.filter((function(e){return n===e.isDeleted&&(null!=e.name&&e.name.toLowerCase().indexOf(t)>-1||(!!(t.length>=8&&e.id.startsWith(t))||(null!=e.subTitle&&e.subTitle.toLowerCase().indexOf(t)>-1||!!(e.login&&null!=e.login.uri&&e.login.uri.toLowerCase().indexOf(t)>-1))))}))},e.prototype.searchSends=function(e,t){return t=t.trim().toLocaleLowerCase(),e.filter((function(e){var n,r,i;return null!=e.name&&e.name.toLowerCase().indexOf(t)>-1||(!!(t.length>=8&&(e.id.startsWith(t)||e.accessId.toLocaleLowerCase().startsWith(t)||null!=(null===(n=e.file)||void 0===n?void 0:n.id)&&e.file.id.startsWith(t)))||(null!=e.notes&&e.notes.toLowerCase().indexOf(t)>-1||(null!=(null===(r=e.text)||void 0===r?void 0:r.text)&&e.text.text.toLowerCase().indexOf(t)>-1||(null!=(null===(i=e.file)||void 0===i?void 0:i.fileName)&&e.file.fileName.toLowerCase().indexOf(t)>-1||void 0))))}))},e.prototype.getIndexForSearch=function(){return this.index},e.prototype.fieldExtractor=function(e,t){if(!e.hasFields)return null;var n=[];return e.fields.forEach((function(e){null!=e.name&&n.push(e.name),e.type===s.FieldType.Text&&null!=e.value&&n.push(e.value)})),0===(n=n.filter((function(e){return""!==e.trim()}))).length?null:t?n.join(" "):n},e.prototype.attachmentExtractor=function(e,t){if(!e.hasAttachments)return null;var n=[];return e.attachments.forEach((function(e){null!=e&&null!=e.fileName&&(t&&e.fileName.indexOf(".")>-1?n.push(e.fileName.substr(0,e.fileName.lastIndexOf("."))):n.push(e.fileName))})),0===(n=n.filter((function(e){return""!==e.trim()}))).length?null:t?n.join(" "):n},e.prototype.uriExtractor=function(e){if(e.type!==a.CipherType.Login||null==e.login||!e.login.hasUris)return null;var t=[];return e.login.uris.forEach((function(e){if(null!=e.uri&&""!==e.uri)if(null==e.hostname){var n=e.uri;if(e.match!==l.UriMatchType.RegularExpression){var r=n.indexOf("://");r>-1&&(n=n.substr(r+3));var i=n.search(/\?|&|#/);i>-1&&(n=n.substring(0,i))}t.push(n)}else t.push(e.hostname)})),t.length>0?t:null},e}();t.SearchService=c},,function(e,t,n){"use strict";(function(e){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=e.revisionDate&&(n=!1),a=!1,n&&(t?(n=null!=r,a=!0):null==e.collectionIds||null==e.organizationId?n=null==r:(n=!1,a=!0)),!n&&a&&null!=e.organizationId&&null!=e.collectionIds&&e.collectionIds.length>0?[4,this.collectionService.getAll()]:[3,5];case 4:if(null!=(s=i.sent()))for(l=0;l-1){n=!0;break}i.label=5;case 5:return n?[4,this.apiService.getCipher(e.id)]:[3,9];case 6:return null==(c=i.sent())?[3,9]:[4,this.userService.getUserId()];case 7:return p=i.sent(),[4,this.cipherService.upsert(new o.CipherData(c,p))];case 8:return i.sent(),this.messagingService.send("syncedUpsertedCipher",{cipherId:e.id}),[2,this.syncCompleted(!0)];case 9:return[3,13];case 10:return null!=(u=i.sent())&&404===u.statusCode&&t?[4,this.cipherService.delete(e.id)]:[3,12];case 11:return i.sent(),this.messagingService.send("syncedDeletedCipher",{cipherId:e.id}),[2,this.syncCompleted(!0)];case 12:return[3,13];case 13:return[2,this.syncCompleted(!1)]}}))}))},e.prototype.syncDeleteCipher=function(e){return r(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return this.syncStarted(),[4,this.userService.isAuthenticated()];case 1:return t.sent()?[4,this.cipherService.delete(e.id)]:[3,3];case 2:return t.sent(),this.messagingService.send("syncedDeletedCipher",{cipherId:e.id}),[2,this.syncCompleted(!0)];case 3:return[2,this.syncCompleted(!1)]}}))}))},e.prototype.syncUpsertSend=function(e,t){return r(this,void 0,void 0,(function(){var n,r,o,a;return i(this,(function(i){switch(i.label){case 0:return this.syncStarted(),[4,this.userService.isAuthenticated()];case 1:if(!i.sent())return[3,9];i.label=2;case 2:return i.trys.push([2,8,,9]),[4,this.sendService.get(e.id)];case 3:return n=i.sent(),!t&&null==n||t&&null!=n&&n.revisionDate0&&e.push(t.domains)})),[2,this.settingsService.setEquivalentDomains(e)]}))}))},e.prototype.syncPolicies=function(e){return r(this,void 0,void 0,(function(){var t;return i(this,(function(n){switch(n.label){case 0:return t={},null!=e&&e.forEach((function(e){t[e.id]=new c.PolicyData(e)})),[4,this.policyService.replace(t)];case 1:return[2,n.sent()]}}))}))},e}();t.SyncService=m},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OrganizationData=void 0;var r=function(e){this.id=e.id,this.name=e.name,this.status=e.status,this.type=e.type,this.enabled=e.enabled,this.usePolicies=e.usePolicies,this.useGroups=e.useGroups,this.useDirectory=e.useDirectory,this.useEvents=e.useEvents,this.useTotp=e.useTotp,this.use2fa=e.use2fa,this.useApi=e.useApi,this.useSso=e.useSso,this.useKeyConnector=e.useKeyConnector,this.useResetPassword=e.useResetPassword,this.selfHost=e.selfHost,this.usersGetPremium=e.usersGetPremium,this.seats=e.seats,this.maxCollections=e.maxCollections,this.maxStorageGb=e.maxStorageGb,this.ssoBound=e.ssoBound,this.identifier=e.identifier,this.permissions=e.permissions,this.resetPasswordEnrolled=e.resetPasswordEnrolled,this.userId=e.userId,this.hasPublicAndPrivateKeys=e.hasPublicAndPrivateKeys,this.providerId=e.providerId,this.providerName=e.providerName,this.familySponsorshipFriendlyName=e.familySponsorshipFriendlyName,this.familySponsorshipAvailable=e.familySponsorshipAvailable,this.planProductType=e.planProductType,this.keyConnectorEnabled=e.keyConnectorEnabled,this.keyConnectorUrl=e.keyConnectorUrl};t.OrganizationData=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ProviderData=void 0;var r=function(e){this.id=e.id,this.name=e.name,this.status=e.status,this.type=e.type,this.enabled=e.enabled,this.userId=e.userId,this.useEvents=e.useEvents};t.ProviderData=r},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]10?r=10:u>0&&(r=u)}catch(I){this.logService.error("Invalid digits param.")}if(p.has("period")&&null!=p.get("period"))try{(d=parseInt(p.get("period").trim(),null))>0&&(t=d)}catch(E){this.logService.error("Invalid period param.")}p.has("secret")&&null!=p.get("secret")&&(o=p.get("secret")),p.has("algorithm")&&null!=p.get("algorithm")&&("sha1"!==(m=p.get("algorithm").toLowerCase())&&"sha256"!==m&&"sha512"!==m||(n=m))}else c&&(o=e.substr("steam://".length),r=5);return f=Math.round((new Date).getTime()/1e3),h=this.leftPad(this.decToHex(Math.floor(f/t)),16,"0"),v=a.Utils.fromHexToArray(h),(y=this.b32ToBytes(o)).length&&v.length?[4,this.sign(y,v,n)]:[2,null];case 1:if(0===(g=i.sent()).length)return[2,null];if(x=15&g[g.length-1],S=(127&g[x])<<24|(255&g[x+1])<<16|(255&g[x+2])<<8|255&g[x+3],b="",c)for(w=2147483647&S,C=0;C=e.length&&(e=Array(t+1-e.length).join(n)+e),e},e.prototype.decToHex=function(e){return(e<15.5?"0":"")+Math.round(e).toString(16)},e.prototype.b32ToHex=function(e){e=e.toUpperCase();for(var t="",n=0;n0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=n?[4,this.storageService.get(o.ConstantsService.vaultTimeoutActionKey)]:[3,11]);case 6:return"logOut"!==r.sent()?[3,8]:[4,this.logOut()];case 7:return r.sent(),[3,10];case 8:return[4,this.lock(!0)];case 9:r.sent(),r.label=10;case 10:r.label=11;case 11:return[2]}}))}))},e.prototype.lock=function(e){return void 0===e&&(e=!1),r(this,void 0,void 0,(function(){var e,t,n;return i(this,(function(r){switch(r.label){case 0:return[4,this.userService.isAuthenticated()];case 1:return r.sent()?[4,this.keyConnectorService.getUsesKeyConnector()]:[2];case 2:return r.sent()?[4,this.isPinLockSet()]:[3,7];case 3:return e=r.sent(),t=e[0]&&null!=this.pinProtectedKey||e[1],(n=!t)?[4,this.isBiometricLockSet()]:[3,5];case 4:n=!r.sent(),r.label=5;case 5:return n?[4,this.logOut()]:[3,7];case 6:r.sent(),r.label=7;case 7:return this.biometricLocked=!0,this.everBeenUnlocked=!0,[4,this.cryptoService.clearKey(!1)];case 8:return r.sent(),[4,this.cryptoService.clearOrgKeys(!0)];case 9:return r.sent(),[4,this.cryptoService.clearKeyPair(!0)];case 10:return r.sent(),[4,this.cryptoService.clearEncKey(!0)];case 11:return r.sent(),this.folderService.clearCache(),this.cipherService.clearCache(),this.collectionService.clearCache(),this.searchService.clearIndex(),this.messagingService.send("locked"),null==this.lockedCallback?[3,13]:[4,this.lockedCallback()];case 12:r.sent(),r.label=13;case 13:return[2]}}))}))},e.prototype.logOut=function(){return r(this,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return null==this.loggedOutCallback?[3,2]:[4,this.loggedOutCallback()];case 1:e.sent(),e.label=2;case 2:return[2]}}))}))},e.prototype.setVaultTimeoutOptions=function(e,t){return r(this,void 0,void 0,(function(){return i(this,(function(n){switch(n.label){case 0:return[4,this.storageService.save(o.ConstantsService.vaultTimeoutKey,e)];case 1:return n.sent(),[4,this.storageService.save(o.ConstantsService.vaultTimeoutActionKey,t)];case 2:return n.sent(),[4,this.cryptoService.toggleKey()];case 3:return n.sent(),[4,this.tokenService.toggleTokens()];case 4:return n.sent(),[2]}}))}))},e.prototype.isPinLockSet=function(){return r(this,void 0,void 0,(function(){var e,t;return i(this,(function(n){switch(n.label){case 0:return[4,this.storageService.get(o.ConstantsService.protectedPin)];case 1:return e=n.sent(),[4,this.storageService.get(o.ConstantsService.pinProtectedKey)];case 2:return t=n.sent(),[2,[null!=e,null!=t]]}}))}))},e.prototype.isBiometricLockSet=function(){return r(this,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,this.storageService.get(o.ConstantsService.biometricUnlockKey)];case 1:return[2,e.sent()]}}))}))},e.prototype.getVaultTimeout=function(){return r(this,void 0,void 0,(function(){var e,t,n;return i(this,(function(r){switch(r.label){case 0:return[4,this.storageService.get(o.ConstantsService.vaultTimeoutKey)];case 1:return e=r.sent(),[4,this.policyService.policyAppliesToUser(a.PolicyType.MaximumVaultTimeout)];case 2:return r.sent()?[4,this.policyService.getAll(a.PolicyType.MaximumVaultTimeout)]:[3,6];case 3:return t=r.sent(),n=Math.min(e,t[0].data.minutes),(null==e||n<0)&&(n=t[0].data.minutes),e===n?[3,5]:[4,this.storageService.save(o.ConstantsService.vaultTimeoutKey,n)];case 4:r.sent(),r.label=5;case 5:return[2,n];case 6:return[2,e]}}))}))},e.prototype.clear=function(){return this.everBeenUnlocked=!1,this.pinProtectedKey=null,this.storageService.remove(o.ConstantsService.protectedPin)},e}();t.VaultTimeoutService=s},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]-1||n.indexOf(" Version/9.")>-1)}return e.prototype.pbkdf2=function(e,t,n,s){return r(this,void 0,void 0,(function(){var r,l,c,p,u,d,m,f,h;return i(this,(function(i){switch(i.label){case 0:return this.isIE||this.isOldSafari?(r="sha256"===n?32:64,l=this.toByteString(e),c=this.toByteString(t),p=o.pbkdf2(l,c,s,r,n),[2,a.Utils.fromByteStringToArray(p).buffer]):(u="sha256"===n?256:512,d=this.toBuf(e),m=this.toBuf(t),f={name:"PBKDF2",salt:m,iterations:s,hash:{name:this.toWebCryptoAlgorithm(n)}},[4,this.subtle.importKey("raw",d,{name:"PBKDF2"},!1,["deriveBits"])]);case 1:return h=i.sent(),[4,this.subtle.deriveBits(f,h,u)];case 2:return[2,i.sent()]}}))}))},e.prototype.hkdf=function(e,t,n,o,a){return r(this,void 0,void 0,(function(){var r,s,l,c;return i(this,(function(i){switch(i.label){case 0:return r=this.toBuf(t),s=this.toBuf(n),l={name:"HKDF",salt:r,info:s,hash:{name:this.toWebCryptoAlgorithm(a)}},[4,this.subtle.importKey("raw",e,{name:"HKDF"},!1,["deriveBits"])];case 1:return c=i.sent(),[4,this.subtle.deriveBits(l,c,8*o)];case 2:return[2,i.sent()]}}))}))},e.prototype.hkdfExpand=function(e,t,n,o){return r(this,void 0,void 0,(function(){var r,a,s,l,c,p,u,d,m,f;return i(this,(function(i){switch(i.label){case 0:if(n>255*(r="sha256"===o?32:64))throw new Error("outputByteSize is too large.");if(new Uint8Array(e).length=n)return[3,4];i.label=3;case 3:return d++,[3,1];case 4:return[2,u.slice(0,n).buffer]}}))}))},e.prototype.hash=function(e,t){return r(this,void 0,void 0,(function(){var n,r,s;return i(this,(function(i){switch(i.label){case 0:return this.isIE&&"sha1"===t||"md5"===t?(n="md5"===t?o.md.md5.create():o.md.sha1.create(),r=this.toByteString(e),n.update(r,"raw"),[2,a.Utils.fromByteStringToArray(n.digest().data).buffer]):(s=this.toBuf(e),[4,this.subtle.digest({name:this.toWebCryptoAlgorithm(t)},s)]);case 1:return[2,i.sent()]}}))}))},e.prototype.hmac=function(e,t,n){return r(this,void 0,void 0,(function(){var r,s,l,c,p;return i(this,(function(i){switch(i.label){case 0:return this.isIE&&"sha512"===n?(r=o.hmac.create(),s=this.toByteString(t),l=this.toByteString(e),r.start(n,s),r.update(l,"raw"),[2,a.Utils.fromByteStringToArray(r.digest().data).buffer]):(c={name:"HMAC",hash:{name:this.toWebCryptoAlgorithm(n)}},[4,this.subtle.importKey("raw",t,c,!1,["sign"])]);case 1:return p=i.sent(),[4,this.subtle.sign(c,p,e)];case 2:return[2,i.sent()]}}))}))},e.prototype.compare=function(e,t){return r(this,void 0,void 0,(function(){var n,r,o,a,s,l,c,p;return i(this,(function(i){switch(i.label){case 0:return[4,this.randomBytes(32)];case 1:return n=i.sent(),r={name:"HMAC",hash:{name:"SHA-256"}},[4,this.subtle.importKey("raw",n,r,!1,["sign"])];case 2:return o=i.sent(),[4,this.subtle.sign(r,o,e)];case 3:return a=i.sent(),[4,this.subtle.sign(r,o,t)];case 4:if(s=i.sent(),a.byteLength!==s.byteLength)return[2,!1];for(l=new Uint8Array(a),c=new Uint8Array(s),p=0;p0&&(t.el=a(n[0]),t.el.modal("show"),t.el.on("show.bs.modal",(function(){e.show(),t.messagingService.send("modalShow")})),t.el.on("shown.bs.modal",(function(){e.shown(),t.messagingService.send("modalShown"),c.Utils.isMobileBrowser||t.el.find("*[appAutoFocus]").focus()})),t.el.on("hide.bs.modal",(function(){t.messagingService.send("modalClose")})),t.el.on("hidden.bs.modal",(function(){e.closed(),t.messagingService.send("modalClosed")})))})),e.onClose.pipe(s.first()).subscribe((function(){null!=t.el&&t.el.modal("hide")}))},t.ɵfac=function(e){return new(e||t)(p.ɵɵinject(p.ComponentFactoryResolver),p.ɵɵinject(p.ApplicationRef),p.ɵɵinject(p.Injector),p.ɵɵinject(u.MessagingService))},t.ɵprov=p.ɵɵdefineInjectable({token:t,factory:t.ɵfac}),t}(l.ModalService);t.ModalService=d,("undefined"==typeof ngDevMode||ngDevMode)&&p.ɵsetClassMetadata(d,[{type:o.Injectable}],(function(){return[{type:p.ComponentFactoryResolver},{type:p.ApplicationRef},{type:p.Injector},{type:u.MessagingService}]}),null)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WildcardRoutingModule=void 0;var r=n(0),i=n(8),o=n(0),a=n(8),s=[{path:"**",redirectTo:""}],l=function(){function e(){}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=o.ɵɵdefineNgModule({type:e}),e.ɵinj=o.ɵɵdefineInjector({imports:[[i.RouterModule.forChild(s)],i.RouterModule]}),e}();t.WildcardRoutingModule=l,("undefined"==typeof ngJitMode||ngJitMode)&&o.ɵɵsetNgModuleScope(l,{imports:[a.RouterModule],exports:[i.RouterModule]}),("undefined"==typeof ngDevMode||ngDevMode)&&o.ɵsetClassMetadata(l,[{type:r.NgModule,args:[{imports:[i.RouterModule.forChild(s)],exports:[i.RouterModule]}]}],null,null)}]); //# sourceMappingURL=main.b90e386127b8336955c4.js.map