passbolt-styleguide 5.14.5 → 5.14.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/RELEASE_NOTES.md +6 -5
- package/build/css/help.min.css +2 -2
- package/build/css/public.min.css +2 -2
- package/build/css/themes/default/api_authentication.min.css +2 -2
- package/build/css/themes/default/api_cloud.min.css +2 -2
- package/build/css/themes/default/api_main.min.css +2 -2
- package/build/css/themes/default/api_reports.min.css +2 -2
- package/build/css/themes/default/api_webinstaller.min.css +2 -2
- package/build/css/themes/default/ext_app.min.css +2 -2
- package/build/css/themes/default/ext_authentication.min.css +2 -2
- package/build/css/themes/default/ext_external.min.css +2 -2
- package/build/css/themes/default/ext_in_form_cta.min.css +2 -2
- package/build/css/themes/default/ext_in_form_menu.min.css +2 -2
- package/build/css/themes/default/ext_quickaccess.min.css +2 -2
- package/build/css/themes/midgar/api_authentication.min.css +2 -2
- package/build/css/themes/midgar/api_main.min.css +2 -2
- package/build/css/themes/midgar/api_reports.min.css +2 -2
- package/build/css/themes/midgar/ext_app.min.css +2 -2
- package/build/css/themes/midgar/ext_authentication.min.css +2 -2
- package/build/css/themes/midgar/ext_in_form_cta.min.css +2 -2
- package/build/css/themes/midgar/ext_in_form_menu.min.css +2 -2
- package/build/css/themes/midgar/ext_quickaccess.min.css +2 -2
- package/build/css/themes/solarized_dark/api_authentication.min.css +2 -2
- package/build/css/themes/solarized_dark/api_main.min.css +2 -2
- package/build/css/themes/solarized_dark/api_reports.min.css +2 -2
- package/build/css/themes/solarized_dark/ext_app.min.css +2 -2
- package/build/css/themes/solarized_dark/ext_authentication.min.css +2 -2
- package/build/css/themes/solarized_dark/ext_in_form_cta.min.css +2 -2
- package/build/css/themes/solarized_dark/ext_in_form_menu.min.css +2 -2
- package/build/css/themes/solarized_dark/ext_quickaccess.min.css +2 -2
- package/build/css/themes/solarized_light/api_authentication.min.css +2 -2
- package/build/css/themes/solarized_light/api_main.min.css +2 -2
- package/build/css/themes/solarized_light/api_reports.min.css +2 -2
- package/build/css/themes/solarized_light/ext_app.min.css +2 -2
- package/build/css/themes/solarized_light/ext_authentication.min.css +2 -2
- package/build/css/themes/solarized_light/ext_in_form_cta.min.css +2 -2
- package/build/css/themes/solarized_light/ext_in_form_menu.min.css +2 -2
- package/build/css/themes/solarized_light/ext_quickaccess.min.css +2 -2
- package/build/js/dist/api-account-recovery.js +1 -1
- package/build/js/dist/api-account-recovery.js.LICENSE.txt +70 -0
- package/build/js/dist/api-app.js +1 -1
- package/build/js/dist/api-app.js.LICENSE.txt +0 -14
- package/build/js/dist/api-recover.js +1 -1
- package/build/js/dist/api-recover.js.LICENSE.txt +70 -0
- package/build/js/dist/api-setup.js +1 -1
- package/build/js/dist/api-setup.js.LICENSE.txt +70 -0
- package/build/js/dist/api-triage.js +1 -1
- package/build/js/dist/api-triage.js.LICENSE.txt +70 -0
- package/build/js/dist/api-vendors.js +1 -1
- package/build/locales/en-UK/common.json +3 -7
- package/package.json +1 -1
- package/src/locales/en-UK/common.json +3 -7
- package/src/react-extension/components/Administration/DisplaySubscriptionKey/DisplaySubscriptionKey.js +13 -9
- package/src/react-extension/components/Administration/DowngradeToCe/DowngradeToCe.js +6 -2
- package/src/react-extension/components/Common/Footer/Footer.js +11 -13
- package/src/react-extension/components/Resource/HandlePermissionWorkflow/flows/ResourceShareFlow.test.js +26 -27
- package/src/shared/services/permission/permissionSnapshotService.js +61 -35
- package/src/shared/services/permission/permissionSnapshotService.test.js +84 -29
- package/src/shared/services/serviceWorker/permission/permissionServiceWorkerService.js +10 -0
- package/src/shared/services/serviceWorker/permission/permissionServiceWorkerService.test.js +21 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see api-account-recovery.js.LICENSE.txt */
|
|
2
|
-
(()=>{"use strict";var e,t={7350(e,t,r){var s=r(6540),n=r(5338);function o(){return o=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var s in r)({}).hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e},o.apply(null,arguments)}const i=s.createContext({user:null,users:null,roles:null,rememberMeOptions:{},resources:null,resource:null,shareResources:null,selectedResources:null,selectedUser:null,folders:null,resourceCommentId:null,mustRefreshComments:!1,siteSettings:null,userSettings:null,onCheckIsAuthenticatedRequested:null});function a(e){return class extends s.Component{render(){return s.createElement(i.Consumer,null,t=>s.createElement(e,o({context:t},this.props)))}}}const l=i;var c=r(5556),h=r.n(c);class u extends Error{constructor(e,t){super(e),this.name="PassboltApiFetchError",this.data=t||{}}}const p=u;class d extends Error{constructor(){super("An internal error occurred. The server response could not be parsed. Please contact your administrator."),this.name="PassboltBadResponseError"}}const m=d;class g extends Error{constructor(e){super(e=e||"The service is unavailable"),this.name="PassboltServiceUnavailableError"}}const y=g,f=["GET","POST","PUT","DELETE"];class E{constructor(e){if(this.options=e,!this.options.getBaseUrl())throw new TypeError("ApiClient constructor error: baseUrl is required.");if(!this.options.getResourceName())throw new TypeError("ApiClient constructor error: resourceName is required.");try{let e=this.options.getBaseUrl().toString();e.endsWith("/")&&(e=e.slice(0,-1));let t=this.options.getResourceName();t.startsWith("/")&&(t=t.slice(1)),t.endsWith("/")&&(t=t.slice(0,-1)),this.baseUrl=`${e}/${t}`,this.baseUrl=new URL(this.baseUrl)}catch(e){throw new TypeError("ApiClient constructor error: b.",{cause:e})}this.apiVersion="api-version=v2"}getDefaultHeaders(){return{Accept:"application/json","content-type":"application/json"}}async buildFetchOptions(){const e=await this.options.getHeaders();return{credentials:"include",headers:{...this.getDefaultHeaders(),...e}}}async get(e,t){this.assertValidId(e);const r=this.buildUrl(`${this.baseUrl}/${e}`,t||{});return this.fetchAndHandleResponse("GET",r)}async delete(e,t,r,s){let n;this.assertValidId(e),void 0===s&&(s=!1),n=s?this.buildUrl(`${this.baseUrl}/${e}/dry-run`,r||{}):this.buildUrl(`${this.baseUrl}/${e}`,r||{});let o=null;return t&&(o=this.buildBody(t)),this.fetchAndHandleResponse("DELETE",n,o)}async findAll(e){const t=this.buildUrl(this.baseUrl.toString(),e||{});return this.fetchAndHandleResponse("GET",t)}async create(e,t){const r=this.buildUrl(this.baseUrl.toString(),t||{}),s=this.buildBody(e);return this.fetchAndHandleResponse("POST",r,s)}async update(e,t,r,s){let n;this.assertValidId(e),void 0===s&&(s=!1),n=s?this.buildUrl(`${this.baseUrl}/${e}/dry-run`,r||{}):this.buildUrl(`${this.baseUrl}/${e}`,r||{});let o=null;return t&&(o=this.buildBody(t)),this.fetchAndHandleResponse("PUT",n,o)}async updateAll(e,t={}){const r=this.buildUrl(this.baseUrl.toString(),t),s=e?this.buildBody(e):null;return this.fetchAndHandleResponse("PUT",r,s)}assertValidId(e){if(!e)throw new TypeError("ApiClient.assertValidId error: id cannot be empty");if("string"!=typeof e)throw new TypeError("ApiClient.assertValidId error: id should be a string")}assertMethod(e){if("string"!=typeof e)throw new TypeError("ApiClient.assertValidMethod method should be a string.");if(f.indexOf(e.toUpperCase())<0)throw new TypeError(`ApiClient.assertValidMethod error: method ${e} is not supported.`)}assertUrl(e){if(!e)throw new TypeError("ApliClient.assertUrl error: url is required.");if(!(e instanceof URL))throw new TypeError("ApliClient.assertUrl error: url should be a valid URL object.");if("https:"!==e.protocol&&"http:"!==e.protocol)throw new TypeError("ApliClient.assertUrl error: url protocol should only be https or http.")}assertBody(e){if(!(e instanceof FormData)&&"string"!=typeof e)throw new TypeError("ApiClient.assertBody error: body should be a string or a FormData.")}buildBody(e){return JSON.stringify(e)}buildUrl(e,t){if("string"!=typeof e)throw new TypeError("ApiClient.buildUrl error: url should be a string.");const r=new URL(`${e}.json?${this.apiVersion}`);t=t||{};for(const[e,s]of Object.entries(t)){if("string"!=typeof e)throw new TypeError("ApiClient.buildUrl error: urlOptions key should be a string.");if("string"==typeof s)r.searchParams.append(e,s);else{if(!Array.isArray(s))throw new TypeError("ApiClient.buildUrl error: urlOptions value should be a string or array.");s.forEach(t=>{r.searchParams.append(e,t)})}}return r}async sendRequest(e,t,r,s){this.assertUrl(t),this.assertMethod(e),r&&this.assertBody(r);const n="undefined"!=typeof customApiClientFetch?customApiClientFetch:fetch,o={...await this.buildFetchOptions(),...s};o.method=e,r&&(o.body=r);try{return await n(t.toString(),o)}catch(e){throw console.error(e),navigator.onLine?new y("Unable to reach the server, an unexpected error occurred"):new y("Unable to reach the server, you are not connected to the network")}}async fetchAndHandleResponse(e,t,r,s){const n=await this.sendRequest(e,t,r,s);return this.parseResponseJson(n)}async parseResponseJson(e){let t;try{t=await e.json()}catch(t){throw console.debug(e.url.toString(),t),new m(t,e)}if(!e.ok){const r=t.header.message;throw new p(r,{code:e.status,body:t.body})}return t}}const v=class{constructor(e){e.setResourceName("auth"),this.apiClient=new E(e)}async logout(){const e=this.apiClient.buildUrl(`${this.apiClient.baseUrl}/logout`,{}),t=await this.apiClient.sendRequest("POST",e,null,{redirect:"manual"});if(!t.ok&&0!==t.status)return this._logoutLegacy()}async _logoutLegacy(){const e=this.apiClient.buildUrl(`${this.apiClient.baseUrl}/logout`,{}),t=await this.apiClient.sendRequest("GET",e,null,{redirect:"manual"});if(!t.ok&&0!==t.status)throw new p("An unexpected error happened during the legacy logout process",{code:t.status})}};class b{static reload(){window.location.reload()}}function w(){return w=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var s in r)({}).hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e},w.apply(null,arguments)}const T=s.createContext({userId:null,authenticationToken:null,state:null,unexpectedError:null,onInitializeAccountRecoveryRequested:()=>{},logoutUserAndRefresh:()=>{}});class S extends s.Component{constructor(e){super(e),this.state=Object.assign(this.defaultState,e.value),this.authLogoutService=new v(e.context.getApiClientOptions())}get defaultState(){return{userId:null,authenticationToken:null,state:R.INITIAL_STATE,unexpectedError:null,onInitializeAccountRecoveryRequested:this.onInitializeAccountRecoveryRequested.bind(this),logoutUserAndRefresh:this.logoutUserAndRefresh.bind(this)}}async onInitializeAccountRecoveryRequested(){if(!this.state.userId||!this.state.authenticationToken)return this.setState({state:R.REQUEST_INVITATION_ERROR});try{await this.verifyCanContinueAccountRecovery(),this.setState({state:R.RESTART_FROM_SCRATCH})}catch(e){await this.handleVerifyCanContinueAccountRecoveryError(e)}}async verifyCanContinueAccountRecovery(){const e=this.props.context.getApiClientOptions();e.setResourceName("account-recovery");const t=new E(e);await t.get(`continue/${this.state.userId}/${this.state.authenticationToken}`)}async handleVerifyCanContinueAccountRecoveryError(e){if(e instanceof p){if(403===e.data.code)return this.setState({state:R.ERROR_ALREADY_SIGNED_IN_STATE});const t=Boolean(e?.data?.body?.token?.expired),r=Boolean(e?.data?.body?.token?.isActive);if(t||r)return this.setState({state:R.TOKEN_EXPIRED_STATE})}this.setState({state:R.UNEXPECTED_ERROR_STATE,unexpectedError:e})}async logoutUserAndRefresh(){try{await this.authLogoutService.logout()}catch(e){const t=new y(e.message);return this.setState({unexpectedError:t,state:R.UNEXPECTED_ERROR_STATE})}b.reload()}render(){return s.createElement(T.Provider,{value:this.state},this.props.children)}}S.propTypes={context:h().any,value:h().any,children:h().any};const A=a(S),R={INITIAL_STATE:"Initial state",RESTART_FROM_SCRATCH:"Restart from scratch state",TOKEN_EXPIRED_STATE:"Token expired state",ERROR_ALREADY_SIGNED_IN_STATE:"Error, already signed in state",REQUEST_INVITATION_ERROR:"Request inviration error state",UNEXPECTED_ERROR_STATE:"Unexpected error state"};class C{setBaseUrl(e){if(!e)throw new TypeError("ApiClientOption baseUrl is required.");if("string"==typeof e)try{this.baseUrl=new URL(e)}catch(e){throw new TypeError("ApiClientOption baseUrl is invalid.",{cause:e})}else{if(!(e instanceof URL))throw new TypeError("ApiClientOptions baseurl should be a string or URL");this.baseUrl=e}return this}setResourceName(e){if(!e)throw new TypeError("ApiClientOptions.setResourceName resourceName is required.");if("string"!=typeof e)throw new TypeError("ApiClientOptions.setResourceName resourceName should be a valid string.");return this.resourceName=e,this}getBaseUrl(){return this.baseUrl}getResourceName(){return this.resourceName}async getHeaders(){const e=await this.getCsrfToken();if(e)return{"X-CSRF-Token":e}}async getCsrfToken(){if("undefined"==typeof browser||void 0===browser.cookies){const e=document?.cookie?.split("; ")?.find(e=>e.startsWith("csrfToken"))?.split("=");return e&&2===e.length?e[1]:null}const e=this.baseUrl.toString(),t="/"===e.slice(-1)?e:`${e}/`,r=await browser.cookies.get({name:"csrfToken",url:t});return r?.value||null}}var x;function O(){return O=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var s in r)({}).hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e},O.apply(null,arguments)}const _=function(e){return s.createElement("svg",O({xmlns:"http://www.w3.org/2000/svg",width:17,height:16,fill:"none",viewBox:"0 0 17 16"},e),x||(x=s.createElement("g",{clipPath:"url(#heart_svg__clip0_93_734678)"},s.createElement("path",{stroke:"var(--icon-color)",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M13.497 9.333c.993-.973 2-2.14 2-3.666A3.667 3.667 0 0 0 11.83 2c-1.173 0-2 .333-3 1.333-1-1-1.827-1.333-3-1.333a3.667 3.667 0 0 0-3.667 3.667c0 1.533 1 2.7 2 3.666L8.83 14z"}))))};var I=r(9762);class N extends s.Component{render(){return s.createElement("div",{className:"tooltip",tabIndex:"0"},this.props.children,s.createElement("span",{className:`tooltip-text ${this.props.direction}`},this.props.message))}}N.defaultProps={direction:"right"},N.propTypes={children:h().any,message:h().any.isRequired,direction:h().string};const P=N;class L extends s.Component{get privacyUrl(){return this.props.context.siteSettings.privacyLink}get creditsUrl(){return"https://www.passbolt.com/terms"}get unsafeUrl(){return"https://www.passbolt.com/docs/hosting/faq/why-I-see-unsafe-mode-banner/"}get termsUrl(){return this.props.context.siteSettings.termsLink}get versions(){const e=this.props.context.extensionVersion,t=this.props.context.siteSettings.version;return s.createElement("div",null,e&&s.createElement("div",null,this.props.t("Client")," ",e),t&&s.createElement(s.Fragment,null,e&&s.createElement("hr",null),s.createElement("div",null,this.props.t("Server")," ",t)))}get isUnsafeMode(){if(!this.props.context.siteSettings)return!1;const e=this.props.context.siteSettings.debug,t=this.props.context.siteSettings.url.startsWith("http://");return e||t}get isCloud(){const e=new URL(this.props.context.siteSettings.url);return"https:"===e.protocol&&Boolean(e.hostname.match(/cloud.passbolt.com$/))}render(){return s.createElement("footer",{className:"footer"},s.createElement("ul",{className:"footer-links"},this.isUnsafeMode&&s.createElement("li",{className:"error-message"},s.createElement("a",{href:this.unsafeUrl,target:"_blank",rel:"noopener noreferrer"},s.createElement(I.x6,null,"Unsafe mode"))),!this.isCloud&&s.createElement(s.Fragment,null,this.props.context.siteSettings.isCommunityEdition&&s.createElement("li",null,s.createElement(I.x6,null,"Community Edition",s.createElement("span",{className:"edition-suffix"}," (free)"))),!this.props.context.siteSettings.isCommunityEdition&&s.createElement("li",null,s.createElement(I.x6,null,"Pro Edition"))),this.isCloud&&s.createElement("li",null,s.createElement(I.x6,null,"Cloud")),s.createElement("li",null,this.versions&&s.createElement(P,{message:this.versions,direction:"top-left"},s.createElement("a",{className:"button button-transparent inline",href:this.creditsUrl,target:"_blank",rel:"noopener noreferrer"},s.createElement(_,null))),!this.versions&&s.createElement("a",{className:"button button-transparent inline",href:this.creditsUrl,target:"_blank",rel:"noopener noreferrer"},s.createElement(_,null)))))}}L.propTypes={context:h().any,t:h().func};const k=a((0,I.CI)("common")(L));var U=r(5648);class D extends Error{constructor(e="Collection validation error."){super(e),this.name="CollectionValidationError",this.errors=[]}addItemValidationError(e,t){if(!Number.isInteger(e))throw new TypeError('CollectionValidationError::addEntityValidationError expects "position" to be an integer.');if(!(t instanceof j||t instanceof D))throw new TypeError('CollectionValidationError::addEntityValidationError expects "entityValidationError" to be an instance of EntityValidationError or CollectionValidationError.');this.errors[e]=t}addCollectionValidationError(e,t){if("string"!=typeof e)throw new TypeError('CollectionValidationError::addCollectionValidationError expects "rule" to be a string.');if("string"!=typeof t)throw new TypeError('CollectionValidationError::addCollectionValidationError expects "error" to be a string.');this.errors[e]=t}hasErrors(){return this.errors.some(e=>Object.keys(e.details).length>0)}get details(){const e={};for(const t in this.errors)this.errors[t]instanceof j||this.errors[t]instanceof D?e[t]=this.errors[t].details:e[t]=this.errors[t];return e}}const $=D;class V extends Error{constructor(e="Entity validation error."){super(e),this.name="EntityValidationError",this.details={}}addError(e,t,r){if("string"!=typeof e)throw new TypeError("EntityValidationError addError property should be a string.");if("string"!=typeof t)throw new TypeError("EntityValidationError addError rule should be a string.");if("string"!=typeof r)throw new TypeError("EntityValidationError addError message should be a string.");Object.prototype.hasOwnProperty.call(this.details,e)||(this.details[e]={}),this.details[e][t]=r}addAssociationError(e,t){if("string"!=typeof e)throw new TypeError("EntityValidationError addAssociationError associationName should be a string.");if(!(t instanceof V||t instanceof $))throw new TypeError("EntityValidationError addAssociationError errorDetails should be an object.");this.details[e]=t}getError(e,t){if(!this.hasError(e,t))return null;const r=this.details[e];return t?r[t]:r}hasError(e,t){if("string"!=typeof e)throw new TypeError("EntityValidationError hasError property should be a string.");const r=this.details&&Object.prototype.hasOwnProperty.call(this.details,e);if(!r)return!1;if(!t)return r;if("string"!=typeof t)throw new TypeError("EntityValidationError hasError rule should be a string.");return Object.prototype.hasOwnProperty.call(this.details[e],t)}hasErrors(){return Object.keys(this.details).length>0}getFirstRuleErrorByField(e){if(!this.hasError(e))return null;const t=this.details[e];return t[Object.keys(t)[0]]}}const j=V;var B=r(7761),q=r.n(B);class F{static validateSchema(e,t){if(!t)throw new TypeError(`Could not validate entity ${e}. No schema for entity ${e}.`);if(!t.type)throw new TypeError(`Could not validate entity ${e}. Type missing.`);if("array"!==t.type){if("object"===t.type){if(!t.required||!Array.isArray(t.required))throw new TypeError(`Could not validate entity ${e}. Schema error: no required properties.`);if(!t.properties||!Object.keys(t).length)throw new TypeError(`Could not validate entity ${e}. Schema error: no properties.`);const r=t.properties;for(const e in r){if(!Object.prototype.hasOwnProperty.call(r,e)||!r[e].type&&!r[e].anyOf)throw TypeError(`Invalid schema. Type missing for ${e}...`);if(r[e].anyOf&&(!Array.isArray(r[e].anyOf)||!r[e].anyOf.length))throw new TypeError(`Invalid schema, prop ${e} anyOf should be an array`)}}}else if(!t.items)throw new TypeError(`Could not validate entity ${e}. Schema error: missing item definition.`)}static validate(e,t,r){if(!e||!t||!r)throw new TypeError(`Could not validate entity ${e}. No data provided.`);switch(r.type){case"object":return F.validateObject(e,t,r);case"array":return F.validateArray(e,t,r);default:throw new TypeError(`Could not validate entity ${e}. Unsupported type.`)}}static validateArray(e,t,r){let s;const n=F.validateProp("items",t,r);if("number"==typeof r.minItems&&(F.isGreaterThanOrEqual(t.length,r.minItems)||(s=F.handleCollectionValidationError("minItems",`The items array should contain at least ${r.minItems} item(s).`,s))),"number"==typeof r.maxItems&&(F.isLessThanOrEqual(t.length,r.maxItems)||(s=F.handleCollectionValidationError("maxItems",`The items array should contain at maximum ${r.maxItems} item(s).`,s))),s)throw s;return n}static validateObject(e,t,r){const s=r.required,n=r.properties,o={};let i;for(const r in n)if(Object.prototype.hasOwnProperty.call(n,r))if(null!==t?.[r]||!0!==n[r]?.nullable){if(s.includes(r)){if(!Object.prototype.hasOwnProperty.call(t,r)){i=F.getOrInitEntityValidationError(e,i),i.addError(r,"required",`The ${r} is required.`);continue}}else if(!Object.prototype.hasOwnProperty.call(t,r))continue;try{o[r]=F.validateProp(r,t[r],n[r])}catch(t){if(!(t instanceof j))throw t;i=F.getOrInitEntityValidationError(e,i),i.details[r]=t.details[r]}}else o[r]=null;if(i)throw i;return o}static getOrInitEntityValidationError(e,t){return t||new j(`Could not validate entity ${e}.`)}static validateProp(e,t,r){if(r.anyOf)return F.validateAnyOf(e,t,r.anyOf),t;if(!0===r.nullable&&null===t)return t;if(F.validatePropType(e,t,r),r.enum)return F.validatePropEnum(e,t,r),t;switch(r.type){case"string":F.validatePropTypeString(e,t,r);break;case"integer":case"number":F.validatePropTypeNumber(e,t,r);break;case"array":F.validatePropTypeArray(e,t,r);break;case"object":case"boolean":case"blob":case"null":break;case"x-custom":F.validatePropCustom(e,t,r);break;default:throw new TypeError(`Could not validate property ${e}. Unsupported prop type ${r.type}`)}return t}static validatePropType(e,t,r){if(!F.isValidPropType(t,r.type))throw F.handlePropertyValidationError(e,"type",`The ${e} is not a valid ${r.type}.`)}static validatePropCustom(e,t,r){try{r.validationCallback(t)}catch(t){throw F.handlePropertyValidationError(e,"custom",`The ${e} is not valid: ${t.message}`)}}static validatePropTypeString(e,t,r){let s;if(r.format&&(F.isValidStringFormat(t,r.format)||(s=F.handlePropertyValidationError(e,"format",`The ${e} is not a valid ${r.format}.`,s))),r.length&&(F.isValidStringLength(t,r.length,r.length)||(s=F.handlePropertyValidationError(e,"length",`The ${e} should be ${r.length} character in length.`,s))),r.minLength&&(F.isValidStringLength(t,r.minLength)||(s=F.handlePropertyValidationError(e,"minLength",`The ${e} should be ${r.minLength} character in length minimum.`,s))),r.maxLength&&(F.isValidStringLength(t,0,r.maxLength)||(s=F.handlePropertyValidationError(e,"maxLength",`The ${e} should be ${r.maxLength} character in length maximum.`,s))),r.pattern&&(q().matches(t,r.pattern)||(s=F.handlePropertyValidationError(e,"pattern",`The ${e} is not valid.`,s))),r.custom&&(r.custom(t)||(s=F.handlePropertyValidationError(e,"custom",`The ${e} is not valid.`,s))),s)throw s}static handlePropertyValidationError(e,t,r,s=null){return(s=s||new j(`Could not validate property ${e}.`)).addError(e,t,r),s}static handleCollectionValidationError(e,t,r=null){return(r=r||new $("Could not validate collection.")).addCollectionValidationError(e,t),r}static validatePropTypeNumber(e,t,r){let s;if("number"==typeof r.minimum&&(F.isGreaterThanOrEqual(t,r.minimum)||(s=F.handlePropertyValidationError(e,"minimum",`The ${e} should be greater or equal to ${r.minimum}.`,s))),"number"==typeof r.maximum&&(F.isLesserThanOrEqual(t,r.maximum)||(s=F.handlePropertyValidationError(e,"maximum",`The ${e} should be lesser or equal to ${r.maximum}.`,s))),s)throw s}static validatePropTypeArray(e,t,r){let s;if(r?.items&&"object"==typeof r.items){for(let n=0;n<t.length;n++){const o=`${e}.${n}`;try{this.validateProp(o,t[n],r.items)}catch(t){if(!(t instanceof j))throw t;{s=F.getOrInitEntityValidationError(e,s);const r=t.details[o];s.details[e]={...s.details[e],[n]:r}}}}if(s)throw s}}static validatePropEnum(e,t,r){if(!F.isPropInEnum(t,r.enum)){const t=new j(`Could not validate property ${e}.`);throw t.addError(e,"enum",`The ${e} value is not included in the supported list.`),t}}static validateAnyOf(e,t,r){for(let s=0;s<r.length;s++)try{return void F.validateProp(e,t,r[s])}catch{}const s=new j(`Could not validate property ${e}.`);throw s.addError(e,"type",`The ${e} does not match any of the supported types.`),s}static isValidPropType(e,t){if(Array.isArray(t))throw new TypeError("EntitySchema isValidPropType multiple types are not supported.");if("string"!=typeof t)throw new TypeError("EntitySchema isValidPropType type is invalid.");switch(t){case"null":return null===e;case"boolean":return"boolean"==typeof e;case"string":return"string"==typeof e;case"integer":return Number.isInteger(e);case"number":return"number"==typeof e;case"object":return"object"==typeof e;case"array":return Array.isArray(e);case"blob":return e instanceof Blob;case"x-custom":return!0;default:throw new TypeError("EntitySchema validation type not supported.")}}static isValidStringFormat(e,t){if("string"!=typeof t)throw new TypeError("EntitySchema validPropFormat format is invalid.");switch(t){case"uuid":return q().isUUID(e);case"email":case"idn-email":return q().isEmail(e);case"date-time":return q().isISO8601(e);case"x-hex-color":return q().isHexColor(e);case"x-base64":return q().isBase64(e);default:throw new TypeError(`EntitySchema string validation format ${t} is not supported.`)}}static isValidStringLength(e,t,r){return t=t||0,q().isLength(e,t,r)}static isPropInEnum(e,t){if(!t||!Array.isArray(t)||!t.length)throw new TypeError("EntitySchema enum schema cannot be empty.");return t.includes(e)}static isGreaterThanOrEqual(e,t){return e>=t}static isLessThanOrEqual(e,t){return e<=t}static isLesserThanOrEqual(e,t){return e<=t}}const M=F;class z{constructor(e,t={}){(t?.clone??!0)&&(e=JSON.parse(JSON.stringify(e))),this._props=e}toDto(){return JSON.parse(JSON.stringify(this))}toJSON(){return this._props}_hasProp(e){if(!e.includes(".")){const t=z._normalizePropName(e);return Object.prototype.hasOwnProperty.call(this._props,t)}try{return this._getPropByPath(e),!0}catch(t){return console.error(`Failed to check if property "${e}" is set:`,t),!1}}_getPropByPath(e){return z._normalizePropName(e).split(".").reduce((e,t)=>{if(Object.prototype.hasOwnProperty.call(e,t))return e[t];throw new Error},this._props)}static _normalizePropName(e){return e.replace(/([A-Z])/g,(e,t)=>`_${t.toLowerCase()}`).replace(/\._/,".").replace(/^_/,"").replace(/^\./,"")}}const H=z,X=e=>e?.replace(/_([a-z])/g,(e,t)=>t.toUpperCase());class G extends Error{constructor(e,t,r){if(super(r=r||"Entity collection error."),"number"!=typeof e)throw new TypeError("EntityCollectionError requires a valid position");if(!t||"string"!=typeof t)throw new TypeError("EntityCollectionError requires a valid rule");if(!r||"string"!=typeof r)throw new TypeError("EntityCollectionError requires a valid message");this.position=e,this.rule=t}}const K=G;class W{constructor(e=[],t={}){const r=t?.clone??!0;this._items=[],r&&(e=JSON.parse(JSON.stringify(e))),this._props=e}toDto(){return JSON.parse(JSON.stringify(this._items))}toJSON(){return this.toDto()}get items(){return this._items}get length(){return this._items.length}[Symbol.iterator](){let e=0;return{next:()=>e<this._items.length?{value:this._items[e++],done:!1}:{done:!0}}}getAll(e,t){if("string"!=typeof e)throw new TypeError("EntityCollection excludeAll expects propName to be string.");if("string"!=typeof t)throw new TypeError("EntityCollection excludeAll expects search to be string.");return this._items.filter(r=>Object.prototype.hasOwnProperty.call(r._props,e)&&r._props[e]===t)}getFirst(e,t){if("string"!=typeof e||"string"!=typeof t)throw new TypeError("EntityCollection getFirst by expect propName and search to be strings");const r=this.getAll(e,t);if(r&&r.length)return r[0]}extract(e){if("string"!=typeof e)throw new TypeError("EntityCollection extract expects propName to be a string.");return this._items.reduce((t,r)=>(void 0!==r._props[e]&&t.push(r._props[e]),t),[])}push(e){return this._items.push(e),this._items.length}unshift(e){return this._items.unshift(e),this._items.length}filterByPropertyValueIn(e,t,r=!0){if("string"!=typeof e)throw new TypeError("EntityCollection filterByPropertyValueIn expects propName to be a string.");if(!Array.isArray(t))throw new TypeError("EntityCollection filterByPropertyValueIn expects needles to be an array.");this.filterByCallback(s=>{const n=Object.prototype.hasOwnProperty.call(s._props,e);return!(r&&!n||n&&!t.includes(s._props[e]))})}filterByCallback(e){if("function"!=typeof e)throw new TypeError("EntityCollection filterByCallback expects callback to be a function.");for(let t=this._items.length-1;t>=0;t--)e(this._items[t])||this._items.splice(t,1)}assertUniqueByProperty(e,t){const r=`unique_${e}`,s=this.extract(e),n=new Set;t=t||`The collection should only contain items with unique values for the property: ${e}.`,s.forEach((e,s)=>{if(n.add(e),s!==n.size-1)throw new K(s,r,t)})}assertNotExist(e,t,r={}){if(void 0===t)return;let s=r?.haystackSet;if(!s){const t=this.extract(e);s=new Set(t)}if(s.has(t)){const t=new j,s=r?.message||`The collection already includes an element that has a property (${e}) with an identical value.`;throw t.addError(e,"unique",s),t}}}const J=W,Y=["string","number","integer","boolean"];class Q extends H{static _cachedSchema={};constructor(e={},t={}){const r=t?.validate??!0;super(e,t),this.marshall(),r&&this.validateSchema({schema:t?.schema,skipSchemaAssociationValidation:t?.skipSchemaAssociationValidation}),this.createAssociations(t),r&&this.validateBuildRules(t?.validateBuildRules)}marshall(){}validate(e={}){try{this.validateSchema({schema:e?.schema,skipSchemaAssociationValidation:e?.skipSchemaAssociationValidation}),this.validateBuildRules(e?.validateBuildRules),this.validateAssociations(e)}catch(e){if(!(e instanceof j))throw e;return e}return null}validateSchema(e=null){let t=e?.schema??this.cachedSchema;if(e?.skipSchemaAssociationValidation){t={...t};const e=Object.keys(this.constructor.associations),r=t.required.filter(t=>!e.includes(t));t.required=r}this._props=M.validate(this.constructor.name,this._props,t)}get cachedSchema(){return this.constructor._cachedSchema[this.constructor.name]||(this.constructor._cachedSchema[this.constructor.name]=this.constructor.getSchema()),this.constructor._cachedSchema[this.constructor.name]}static getSchema(){throw new Error("The entity class should declare its schema.")}validateBuildRules(e={}){}createAssociations(e={}){if(Object.keys(this.constructor.associations).length>0){const t=new j;for(const[r,s]of Object.entries(this.constructor.associations))try{this._props[r]&&(this[`_${X(r)}`]=new s(this._props[r],{...e,clone:!1}),delete this._props[r])}catch(e){if(!(e instanceof j))throw e;t.addAssociationError(r,e)}if(t.hasErrors())throw t}}static get associations(){return{}}get(e){(0,U.A)(e);const t=this.constructor.getSchema().properties[e];if(!t)throw new Error(`The property "${e}" has no schema definition.`);if(!Y.includes(t?.type))throw new Error('The property "associated_entity" should reference scalar properties only.');return this._props[e]}set(e,t,r={}){(0,U.A)(e);const s=r?.validate??!0;if(this.isAssociation(e))this.setAssociation(e,t,r);else{const n=e.split(".")[0],o=this.constructor.getSchema().properties[n];if(!o)throw new Error(`The property "${n}" has no schema definition.`);if("array"===o?.type)this.setArrayProp(e,t,r);else{if(o?.type&&!Y.includes(o?.type))throw new Error('The property "associated_entity" should reference scalar properties only.');if(o?.anyOf?.some(e=>!Y.includes(e.type)))throw new Error('The property "associated_entity" should reference scalar properties only.');s&&M.validateProp(n,t,o),this._props[n]=t}}}setArrayProp(e,t,r){(0,U.A)(e);const s=e.split("."),n=s[0];let o=null;const i=this.constructor.getSchema().properties[n],a=r?.validate??!0;if(2!==s.length)throw new Error(`The property "${s[0]}" has no index passed.`);{const e=s[1].match(/^(\d+)$/);if(!e)throw new Error(`The property "${s[0]}" has an invalid index format. Expected format: digits.`);o=parseInt(e[1],10)}if(!Y.includes(i.items.type))throw new Error('The property "associated_entity" with array type should reference scalar properties only.');a&&M.validateProp(n,t,i.items),this._props[n]||(this._props[n]=[]),null!=t?this._props[n][o]=t:this._props[n].splice(o,1)}setCollection(e,t,r){(0,U.A)(e);const s=e.split("."),n=s[0];let o=null;if(1===s.length)t instanceof this.constructor.associations[e]?this[`_${n}`]=t:this[`_${n}`]=new this.constructor.associations[e](t,r);else{if(!(s.length>1))throw new Error(`The property "${s[0]}" has no index passed.`);{const e=s[1].match(/^(\d+)$/);if(!e)throw new Error(`The property "${s[0]}" has an invalid index format. Expected format: digits.`);o=parseInt(e[1],10)}}if(!this[`_${n}`])throw new Error(`The collection "${s[0]}" has no item".`);if(null!=t)if(s.length>2){if(!this[`_${n}`]._items[o])throw new Error(`The collection "${s[0]}" has no item at the index "${s[1]}".`);const e=s.slice(2).join(".");this[`_${n}`]._items[o].set(e,t,r)}else this[`_${n}`].push(t,r,r);else this[`_${n}`].items.splice(o,1)}setAssociation(e,t,r={}){if((0,U.A)(e),this.isAssociation(e)){const s=e.split("."),n=X(s[0]);if(s.length>1)if(this[`_${n}`]||(this[`_${n}`]=new this.constructor.associations[s[0]]({},{validate:!1})),this[`_${n}`]instanceof J){const e=s.toSpliced(0,1,n).join(".");this.setCollection(e,t,r)}else{const e=s.slice(1).join(".");this[`_${n}`].set(e,t,r)}else t instanceof this.constructor.associations[e]?this[`_${n}`]=t:this[`_${n}`]=new this.constructor.associations[e](t,r)}}validateAssociations(e={}){const t=new j;if(Object.keys(this.constructor.associations).length>0&&Object.keys(this.constructor.associations).forEach(r=>{const s=X(r);if(this[`_${s}`]){const n=this[s].validate(e);n&&t.addAssociationError(r,n)}}),t.hasErrors())throw t}diffProps(e){if(!(e instanceof Q))throw new TypeError('The property "compareEntity" should be of "EntityV2" type.');const t={},r=this.constructor.getSchema(),s=Object.keys(r.properties).filter(e=>Y.includes(r.properties[e].type));for(const r of s){const s=this.get(r),n=e.get(r);s!==n&&(t[r]=n)}return t}hasDiffProps(e){const t=this.diffProps(e);return Object.keys(t).length>0}isAssociation(e){const t=e.split(".")[0];return Boolean(this.constructor.associations?.[t])}}const Z=Q,ee=(e,t)=>t.split(".").reduce((e,t)=>e?.[t],e);r.dn(ee);const te=(e,t)=>{if(void 0===e||"string"!=typeof e||!e.length)return!1;if((t=t||{}).whitelistedProtocols&&!Array.isArray(t.whitelistedProtocols))throw new TypeError("The whitelistedProtocols should be an array of string.");if(t.defaultProtocol&&"string"!=typeof t.defaultProtocol)throw new TypeError("The defaultProtocol should be a string.");const r=t.whitelistedProtocols||[re.HTTP,re.HTTPS],s=[re.JAVASCRIPT],n=t.defaultProtocol||"";!/^(?:(?!:\/\/).)*:\/\//.test(e)&&n&&(e=`${n}//${e}`);try{const t=new URL(e);return!s.includes(t.protocol)&&!!r.includes(t.protocol)&&t.href}catch(e){return console.error("Failed to sanitize URL:",e),!1}};r.dn(te);const re={FTP:"http:",FTPS:"https:",HTTP:"http:",HTTPS:"https:",JAVASCRIPT:"javascript:",SSH:"ssh:"},se="enabled",ne="disabled",oe="not found";class ie extends Z{static getSchema(){return{type:"object",required:[],properties:{status:{type:"string",enum:[se,ne,oe]},app:{type:"object"},passbolt:{type:"object"},serverTimeDiff:{type:"integer",nullable:!0}}}}marshall(){void 0===this._props.status&&(this._props.status=se),ie.sanitizeEmailValidateRegex(this._props)}static sanitizeEmailValidateRegex(e){const t=e?.passbolt?.email?.validate?.regex;t&&"string"==typeof t&&t.trim().length&&(e.passbolt.email.validate.regex=t.trim().replace(/^\/+/,"").replace(/\/+$/,""))}static get disabledSiteSettings(){return{status:ne}}toDto(){return{...this._props}}toJSON(){return this.toDto()}canIUse(e){const t=this._props?.passbolt?.plugins?.[e];return!(!t||"object"!=typeof t)&&!1!==t.enabled}isPluginEnabled(e){return this.canIUse(e)}isFeatureBeta(e){return(0,U.A)(e),ee(this._props,`passbolt.plugins.${e}.isInBeta`)||!1}getPluginSettings(e){return ee(this._props,`passbolt.plugins.${e}`)}getRememberMeOptions(){return(this.getPluginSettings("rememberMe")||{}).options||{}}get hasRememberMeUntilILogoutOption(){return void 0!==(this.getRememberMeOptions()||{})[-1]}get generatorConfiguration(){return ee(this._props,"passbolt.plugins.generator.configuration")}get locale(){return ee(this._props,"app.locale")||ie.DEFAULT_LOCALE.locale}async setLocale(e){this._props.app||(this._props.app={}),this._props.app.locale=e}get supportedLocales(){return ee(this._props,"passbolt.plugins.locale.options")||ie.DEFAULT_SUPPORTED_LOCALES}getServerTimezone(){return ee(this._props,"passbolt.app.server_timezone")}get termsLink(){const e=ee(this._props,"passbolt.legal.terms.url");return!!e&&te(e)}get privacyLink(){const e=ee(this._props,"passbolt.legal.privacy_policy.url");return!!e&&te(e)}get registrationPublic(){return!0===ee(this._props,"passbolt.registration.public")}get debug(){return!0===ee(this._props,"app.debug")}get url(){return ee(this._props,"app.url")||""}get version(){return ee(this._props,"app.version.number")}get isCommunityEdition(){return"ce"===ee(this._props,"passbolt.edition")}get emailValidateRegex(){return ee(this._props,"passbolt.email.validate.regex")||null}isServerInPast(){return(this._props.serverTimeDiff||0)<0}get serverTime(){const e=this._props.serverTimeDiff||0;return(new Date).getTime()+e}static get ENTITY_NAME(){return"SiteSettings"}static get ORGANIZATION_ENABLED(){return se}static get ORGANIZATION_DISABLED(){return ne}static get ORGANIZATION_NOT_FOUND(){return oe}static get DEFAULT_LOCALE(){return{locale:"en-UK",label:"English"}}static get DEFAULT_SUPPORTED_LOCALES(){return[ie.DEFAULT_LOCALE]}}const ae=ie;var le=r(2635),ce=r(2107);class he extends s.Component{constructor(e){super(e),this.state=this.defaultState}get defaultState(){return{ready:!1}}async componentDidMount(){await(0,le.Yx)(I.r9).use(ce.A).init({lng:this.locale,load:"currentOnly",interpolation:{escapeValue:!1},react:{useSuspense:!1},backend:{loadPath:(e,t)=>this.getTranslationPath(e,t)},supportedLngs:this.supportedLocales,fallbackLng:!1,ns:["common"],defaultNS:"common",keySeparator:!1,nsSeparator:!1,debug:!1}),this.setState({ready:!0})}getTranslationPath(e,t){const r=e[0],s=t[0],n="en-GB"===r?"en-UK":r;return(this.props.loadingPath||"/locales/{{lng}}/{{ns}}.json").replace("{{lng}}",n).replace("{{ns}}",s)}get supportedLocales(){let e=[];return this.props.context.siteSettings?.supportedLocales?e=this.props.context.siteSettings?.supportedLocales.map(e=>e.locale):e.push(this.locale),e.includes("en-UK")&&e.push("en-GB"),e}get locale(){return this.props.context.locale}async componentDidUpdate(e){await this.handleLocaleChange(e.context.locale)}async handleLocaleChange(e){this.locale!==e&&await(0,le.v2)(this.locale)}get isReady(){return this.state.ready}render(){return s.createElement(s.Fragment,null,this.isReady&&this.props.children)}}he.propTypes={context:h().any,loadingPath:h().any,children:h().any};const ue=a(he),pe=new class{allPropTypes=(...e)=>(...t)=>{const r=e.map(e=>e(...t)).filter(Boolean);if(0===r.length)return;const s=r.map(e=>e.message).join("\n");return new Error(s)}};var de;function me(){return me=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var s in r)({}).hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e},me.apply(null,arguments)}const ge=function(e){return s.createElement("svg",me({width:25,height:24,fill:"none",viewBox:"0 0 25 24"},e),de||(de=s.createElement("path",{stroke:"var(--icon-color)",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M11.597 19a8 8 0 1 0 0-16 8 8 0 0 0 0 16M21.597 21l-4.35-4.35"})))};var ye;function fe(){return fe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var s in r)({}).hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e},fe.apply(null,arguments)}const Ee=function(e){return s.createElement("svg",fe({xmlns:"http://www.w3.org/2000/svg",width:10,height:8,fill:"none",viewBox:"0 0 10 8"},e),ye||(ye=s.createElement("path",{stroke:"var(--icon-color)",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"m1 2 4 4 4-4"})))};class ve extends s.Component{constructor(e){super(e),this.state=this.getDefaultState(e),this.bindCallback(),this.createRefs()}getDefaultState(e){return{selectedValue:e.value,search:"",open:!1,style:void 0}}get listItemsFiltered(){const e=this.props.items.filter(e=>e.value!==this.state.selectedValue);return this.props.search&&""!==this.state.search?this.getItemsMatch(e,this.state.search):e}get selectedItemLabel(){const e=this.props.items&&this.props.items.find(e=>e.value===this.state.selectedValue);return e&&e.label||s.createElement(s.Fragment,null," ")}static getDerivedStateFromProps(e,t){return void 0!==e.value&&e.value!==t.selectedValue?{selectedValue:e.value}:null}bindCallback(){this.handleDocumentClickEvent=this.handleDocumentClickEvent.bind(this),this.handleDocumentContextualMenuEvent=this.handleDocumentContextualMenuEvent.bind(this),this.handleDocumentDragStartEvent=this.handleDocumentDragStartEvent.bind(this),this.handleDocumentScrollEvent=this.handleDocumentScrollEvent.bind(this),this.handleSelectClick=this.handleSelectClick.bind(this),this.handleInputChange=this.handleInputChange.bind(this),this.handleItemClick=this.handleItemClick.bind(this),this.handleSelectKeyDown=this.handleSelectKeyDown.bind(this),this.handleItemKeyDown=this.handleItemKeyDown.bind(this),this.handleBlur=this.handleBlur.bind(this)}createRefs(){this.selectedItemRef=s.createRef(),this.selectItemsRef=s.createRef(),this.itemsRef=s.createRef()}componentDidMount(){document.addEventListener("click",this.handleDocumentClickEvent,{capture:!0}),document.addEventListener("contextmenu",this.handleDocumentContextualMenuEvent,{capture:!0}),document.addEventListener("dragstart",this.handleDocumentDragStartEvent,{capture:!0}),document.addEventListener("scroll",this.handleDocumentScrollEvent,{capture:!0})}componentWillUnmount(){document.removeEventListener("click",this.handleDocumentClickEvent,{capture:!0}),document.removeEventListener("contextmenu",this.handleDocumentContextualMenuEvent,{capture:!0}),document.removeEventListener("dragstart",this.handleDocumentDragStartEvent,{capture:!0}),document.removeEventListener("scroll",this.handleDocumentScrollEvent,{capture:!0})}handleDocumentClickEvent(e){this.selectedItemRef.current.contains(e.target)||this.selectItemsRef.current.contains(e.target)||this.closeSelect()}handleDocumentContextualMenuEvent(e){this.selectedItemRef.current.contains(e.target)||this.selectItemsRef.current.contains(e.target)||this.closeSelect()}handleDocumentDragStartEvent(){this.closeSelect()}handleDocumentScrollEvent(e){this.itemsRef.current.contains(e.target)||this.selectItemsRef.current.contains(e.target)||this.closeSelect()}handleSelectClick(){if(this.props.disabled)this.closeSelect();else{const e=!this.state.open;e?this.forceVisibilitySelect():this.resetStyleSelect(),this.setState({open:e})}}getFirstParentWithTransform(){let e=this.selectedItemRef.current.parentElement;for(;null!==e&&""===e.style.getPropertyValue("transform");)e=e.parentElement;return e}forceVisibilitySelect(){const e=this.selectedItemRef.current.getBoundingClientRect(),{width:t,height:r}=e;let{top:s,left:n}=e;const o=this.getFirstParentWithTransform();if(o){const e=o.getBoundingClientRect();s-=e.top,n-=e.left}const i={position:"fixed",zIndex:1,width:t,height:r,top:s,left:n};this.setState({style:i})}handleBlur(e){e.currentTarget.contains(e.relatedTarget)||this.closeSelect()}closeSelect(){this.resetStyleSelect(),this.setState({open:!1})}resetStyleSelect(){this.setState({style:void 0})}handleInputChange(e){const t=e.target,r=t.value,s=t.name;this.setState({[s]:r})}handleItemClick(e){if(this.setState({selectedValue:e.value,open:!1}),"function"==typeof this.props.onChange){const t={target:{value:e.value,name:this.props.name}};this.props.onChange(t)}this.closeSelect()}getItemsMatch(e,t){const r=t&&t.split(/\s+/)||[""];return e.filter(e=>r.every(t=>((e,t)=>(e=>new RegExp((e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"))(e),"i"))(e).test(t))(t,e.label)))}handleSelectKeyDown(e){switch(e.keyCode){case 13:return e.stopPropagation(),void this.handleSelectClick();case 40:return e.preventDefault(),e.stopPropagation(),void(this.state.open?this.focusItem(0):this.handleSelectClick());case 38:return e.preventDefault(),e.stopPropagation(),void(this.state.open?this.focusItem(this.listItemsFiltered.length-1):this.handleSelectClick());case 27:return e.stopPropagation(),void this.closeSelect();default:return}}focusItem(e){this.itemsRef.current.childNodes[e]?.focus()}handleItemKeyDown(e,t){switch(e.keyCode){case 13:return e.stopPropagation(),void this.handleItemClick(t);case 40:return e.stopPropagation(),e.preventDefault(),void(e.target.nextSibling?e.target.nextSibling.focus():this.focusItem(0));case 38:return e.stopPropagation(),e.preventDefault(),void(e.target.previousSibling?e.target.previousSibling.focus():this.focusItem(this.listItemsFiltered.length-1));default:return}}hasFilteredItems(){return this.listItemsFiltered.length>0}render(){return s.createElement("div",{className:`select-container ${this.props.className}`,style:{width:this.state.style?.width,height:this.state.style?.height}},s.createElement("div",{onKeyDown:this.handleSelectKeyDown,onBlur:this.handleBlur,id:this.props.id,className:`select ${this.props.direction} ${this.state.open?"open":""}`,style:this.state.style},s.createElement("div",{ref:this.selectedItemRef,className:"selected-value "+(this.props.disabled?"disabled":""),tabIndex:this.props.disabled?-1:0,onClick:this.handleSelectClick},s.createElement("span",{className:"value"},this.selectedItemLabel),s.createElement(Ee,null)),s.createElement("div",{ref:this.selectItemsRef,className:"select-items "+(this.state.open?"visible":"")},this.props.search&&s.createElement(s.Fragment,null,s.createElement("input",{className:"search-input",name:"search",value:this.state.search,onChange:this.handleInputChange,type:"text"}),s.createElement(ge,{className:"search"})),s.createElement("ul",{ref:this.itemsRef,className:"items"},this.hasFilteredItems()&&this.listItemsFiltered.map(e=>s.createElement("li",{tabIndex:e.disabled?-1:0,key:e.value,title:e.title,className:`option ${e.value}`,onKeyDown:t=>this.handleItemKeyDown(t,e),onClick:()=>this.handleItemClick(e)},e.label)),!this.hasFilteredItems()&&this.props.search&&s.createElement("li",{className:"option no-results"},s.createElement(I.x6,null,"No results match")," ",s.createElement("span",null,this.state.search))))))}}ve.defaultProps={id:"",name:"select",className:"",direction:"bottom"},ve.propTypes={id:h().string,name:h().string,className:h().string,direction:h().oneOf(Object.values({top:"top",bottom:"bottom",left:"left",right:"right"})),search:h().bool,items:h().array,value:pe.allPropTypes(h().oneOfType([h().string,h().number,h().bool]),(e,t,r)=>{const s=e[t],n=e.items;if(null!==s&&n.length>0&&n.every(e=>e.value!==s))return new Error(`Invalid prop ${t} passed to ${r}. Expected the value ${s} in items.`)}),disabled:h().bool,onChange:h().func};const be=(0,I.CI)("common")(ve);class we extends s.Component{constructor(e){super(e),this.state=this.defaultState,this.bindHandlers()}componentDidMount(){this.initLocale()}componentDidUpdate(e){this.handleLocaleChange(e.context.locale)}handleLocaleChange(e){this.props.context.locale!==e&&this.setState({locale:this.props.context.locale})}get defaultState(){return{loading:!0,locale:null,processing:!1}}get areActionsAllowed(){return!this.state.processing}bindHandlers(){this.handleLocaleInputChange=this.handleLocaleInputChange.bind(this)}async handleLocaleInputChange(e){const t=e.target.value;this.updateLocale(t)}async updateLocale(e){this.setState({processing:!0}),await this.props.context.onUpdateLocaleRequested(e),this.setState({processing:!1})}initLocale(){this.setState({locale:this.props.context.locale,loading:!1})}isLoading(){return this.state.loading}get supportedLocales(){return this.props.context.siteSettings.supportedLocales?this.props.context.siteSettings.supportedLocales.map(e=>({value:e.locale,label:e.label})):[]}render(){return s.createElement(s.Fragment,null,!this.isLoading()&&s.createElement("div",{className:"select-wrapper input"},s.createElement(be,{id:"user-locale-input",className:"setup-extension",name:"locale",value:this.state.locale,disabled:!this.areActionsAllowed,items:this.supportedLocales,onChange:this.handleLocaleInputChange})))}}we.propTypes={context:h().any};const Te=a(we),Se="chrome",Ae="edge",Re="firefox",Ce="safari";function xe(){const e=window.navigator.userAgent.toLowerCase();let t;return t=e.indexOf("firefox")>-1?Re:e.indexOf("samsungbrowser")>-1?"samsung":e.indexOf("opera")>-1||e.indexOf("opr")>-1?"opera":e.indexOf("trident")>-1?"internet-explorer":e.indexOf("edg")>-1?Ae:e.indexOf("chrome")>-1?Se:e.indexOf("safari")>-1?Ce:"unknown",t}function Oe(){return Oe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var s in r)({}).hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e},Oe.apply(null,arguments)}const _e=s.createContext({userId:null,token:null,state:null,unexpectedError:null,onInitializeRecoverRequested:()=>{},logoutUserAndRefresh:()=>{}});class Ie extends s.Component{constructor(e){super(e),this.state=Object.assign(this.defaultState,e.value),this.authLogoutService=new v(e.context.getApiClientOptions())}get defaultState(){return{userId:null,token:null,state:Ne.INITIAL_STATE,unexpectedError:null,onInitializeRecoverRequested:this.onInitializeRecoverRequested.bind(this),logoutUserAndRefresh:this.logoutUserAndRefresh.bind(this),handleSafariExtensionDownloading:this.handleSafariExtensionDownloading.bind(this),handleSafariExtensionNotDownloaded:this.handleSafariExtensionNotDownloaded.bind(this),handleExtensionAlreadyInstalled:this.handleExtensionAlreadyInstalled.bind(this)}}async onInitializeRecoverRequested(){return this.state.userId&&this.state.token?this.isBrowserSupported()?void await this.startRecover().then(this.handleStartRecoverSuccess.bind(this)).catch(this.handleStartRecoverError.bind(this)):this.setState({state:Ne.DOWNLOAD_SUPPORTED_BROWSER_STATE}):this.setState({state:Ne.REQUEST_INVITATION_ERROR})}handleStartRecoverSuccess(){const e=xe()===Ce?Ne.INSTALL_SAFARI_EXTENSION_STATE:Ne.INSTALL_EXTENSION_STATE;this.setState({state:e})}handleSafariExtensionDownloading(){const e=Ne.CONFIGURE_SAFARI_EXTENSION_STATE;this.setState({state:e})}handleSafariExtensionNotDownloaded(){const e=Ne.INSTALL_SAFARI_EXTENSION_STATE;this.setState({state:e})}handleExtensionAlreadyInstalled(){const e=Ne.CONFIGURE_SAFARI_EXTENSION_STATE;this.setState({state:e})}handleStartRecoverError(e){if(e instanceof p){if(403===e.data.code)return this.setState({state:Ne.ERROR_ALREADY_SIGNED_IN_STATE});const t=Boolean(e.data.body?.token?.expired),r=Boolean(e.data.body?.token?.isActive);if(t||r)return this.setState({state:Ne.TOKEN_EXPIRED_STATE});if(400===e?.data?.code)return this.setState({state:Ne.REQUEST_INVITATION_ERROR})}return this.setState({state:Ne.UNEXPECTED_ERROR_STATE})}async logoutUserAndRefresh(){try{await this.authLogoutService.logout()}catch(e){const t=new y(e.message);return this.setState({unexpectedError:t,state:Ne.UNEXPECTED_ERROR_STATE})}b.reload()}isBrowserSupported(){const e=xe(),t=[Se,Re,Ae];return this.props.context.siteSettings.canIUse("safari")&&t.push(Ce),t.includes(e)}async startRecover(){const e=this.props.context.getApiClientOptions();e.setResourceName("setup");const t=new E(e);await t.get(`recover/${this.state.userId}/${this.state.token}`)}render(){return s.createElement(_e.Provider,{value:this.state},this.props.children)}}Ie.propTypes={context:h().any,value:h().any,children:h().any},a(Ie);const Ne={INITIAL_STATE:"Initial state",DOWNLOAD_SUPPORTED_BROWSER_STATE:"Download supported browser state",INSTALL_EXTENSION_STATE:"Install extension state",INSTALL_SAFARI_EXTENSION_STATE:"Install Safari extension state",CONFIGURE_SAFARI_EXTENSION_STATE:"Configure Safari extension state",TOKEN_EXPIRED_STATE:"Token expired state",ERROR_ALREADY_SIGNED_IN_STATE:"Error, already signed in state",REQUEST_INVITATION_ERROR:"Request inviration error state",UNEXPECTED_ERROR_STATE:"Unexpected error state"};class Pe extends s.Component{get statesToHideLocaleSwitch(){return[Ne.INITIAL_STATE]}get mustDisplayLocaleSwitch(){return!this.statesToHideLocaleSwitch.includes(this.props.apiRecoverContext.state)}render(){return s.createElement(s.Fragment,null,this.mustDisplayLocaleSwitch&&s.createElement(Te,null))}}Pe.propTypes={apiRecoverContext:h().any};const Le=(ke=Pe,class extends s.Component{render(){return s.createElement(_e.Consumer,null,e=>s.createElement(ke,Oe({apiRecoverContext:e},this.props)))}});var ke,Ue,De;function $e(){return $e=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var s in r)({}).hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e},$e.apply(null,arguments)}const Ve=function(e){return s.createElement("svg",$e({width:18,height:18,fill:"none",className:"svg-icon spinner",viewBox:"0 0 18 18"},e),Ue||(Ue=s.createElement("circle",{id:"background",cx:8,cy:8,r:8,fill:"none",stroke:"var(--spinner-background)",strokeWidth:"var(--spinner-stroke-width)",transform:"translate(1 1)"})),De||(De=s.createElement("circle",{id:"loading",r:8,fill:"none",stroke:"var(--spinner-color)",strokeLinecap:"round",strokeWidth:"var(--spinner-stroke-width)",transform:"translate(9 9)"})))};class je extends s.Component{render(){return s.createElement("div",{className:"login-processing"},s.createElement("h1",null,this.props.title),s.createElement("div",{className:"processing-wrapper"},s.createElement(Ve,null)))}}je.propTypes={title:h().oneOfType([h().arrayOf(h().node),h().node,h().string])},je.defaultProps={title:s.createElement(I.x6,null,"Please wait...")};const Be=(0,I.CI)("common")(je);var qe;function Fe(){return Fe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var s in r)({}).hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e},Fe.apply(null,arguments)}const Me=function(e){return s.createElement("svg",Fe({xmlns:"http://www.w3.org/2000/svg",width:8,height:10,fill:"none",viewBox:"0 0 8 10"},e),qe||(qe=s.createElement("path",{stroke:"var(--icon-color)",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"m2 9 4-4-4-4"})))};class ze extends s.Component{constructor(e){super(e),this.state=this.defaultState,this.bindCallbacks()}get defaultState(){return{showErrorDetails:!1}}bindCallbacks(){this.handleErrorDetailsToggle=this.handleErrorDetailsToggle.bind(this)}onClick(){this.props.context.port?this.props.context.port.request("passbolt.tab.reload"):b.reload()}handleErrorDetailsToggle(){this.setState({showErrorDetails:!this.state.showErrorDetails})}get hasErrorDetails(){const e=this.props?.error;return Boolean(e?.details)||Boolean(e?.data?.body)}formatErrors(){const e=this.props.error?.details||this.props.error?.data;return JSON.stringify(e,null,4)}render(){return s.createElement("div",{className:"setup-error"},s.createElement("h1",null,this.props.title),s.createElement("p",null,this.props.message),s.createElement("p",null,this.props.error&&this.props.error.message),this.hasErrorDetails&&s.createElement("div",{className:"accordion error-details"},s.createElement("div",{className:"accordion-header"},s.createElement("button",{className:"no-border",type:"button",onClick:this.handleErrorDetailsToggle},this.state.showErrorDetails?s.createElement(Ee,{className:"caret-down"}):s.createElement(Me,{className:"caret-right"}),s.createElement("span",null,s.createElement(I.x6,null,"Error details")))),this.state.showErrorDetails&&s.createElement("div",{className:"accordion-content"},s.createElement("div",{className:"input text"},s.createElement("label",{htmlFor:"js_field_debug",className:"visuallyhidden"},s.createElement(I.x6,null,"Error details")),s.createElement("textarea",{id:"js_field_debug",defaultValue:`${this.formatErrors()}`,readOnly:!0})))),s.createElement("div",{className:"form-actions"},s.createElement("button",{onClick:this.onClick.bind(this),className:"button primary big full-width",role:"button"},s.createElement(I.x6,null,"Try again"))))}}ze.defaultProps={title:s.createElement(I.x6,null,"Something went wrong!"),message:s.createElement(I.x6,null,"The operation failed with the following error:")},ze.propTypes={context:h().any,title:h().oneOfType([h().arrayOf(h().node),h().node,h().string]),message:h().oneOfType([h().arrayOf(h().node),h().node,h().string]),error:h().any};const He=a((0,I.CI)("common")(ze));class Xe extends s.Component{render(){return s.createElement("div",{className:"setup-error"},s.createElement("h1",null,s.createElement(I.x6,null,"Sorry, wrong computer or browser...")),s.createElement("p",null,s.createElement(I.x6,null,"You need to finalize the account recovery process with the same computer you used for the account recovery request."),s.createElement("br",null),s.createElement("br",null),s.createElement(I.x6,null,"If you changed systems, or reinstalled passbolt web extension in the meantime, you will need to start the account recovery process from scratch.")),s.createElement("div",{className:"form-actions"},s.createElement("a",{href:`${this.props.context.trustedDomain}/users/recover`,className:"button primary big full-width",role:"button",rel:"noopener noreferrer"},s.createElement(I.x6,null,"Restart from scratch"))))}}Xe.propTypes={context:h().any};const Ge=a((0,I.CI)("common")(Xe));class Ke extends s.Component{render(){return s.createElement("div",{className:"setup-error"},s.createElement("h1",null,s.createElement(I.x6,null,"The request is expired.")),s.createElement("p",null,s.createElement(I.x6,null,"If you still need to recover your account, you will need to start the process from scratch.")),s.createElement("div",{className:"form-actions"},s.createElement("a",{href:`${this.props.context.trustedDomain}`,className:"button primary big full-width",role:"button",rel:"noopener noreferrer"},s.createElement(I.x6,null,"Continue"))))}}Ke.propTypes={context:h().any};const We=a((0,I.CI)("common")(Ke)),Je="setup",Ye="recover",Qe="account-recovery";class Ze extends s.Component{render(){return s.createElement("div",{className:"setup-error"},s.createElement("h1",null,s.createElement(I.x6,null,"Cannot perform the action while being logged in")),s.createElement("p",null,{[Je]:s.createElement(I.x6,null,"It is not possible to perform a setup of a new account as you are still logged in. You need to log out first before continuing."),[Ye]:s.createElement(I.x6,null,"It is not possible to perform the recovery of your account as you are still logged in. You need to log out first before continuing."),[Qe]:s.createElement(I.x6,null,"It is not possible to recover your private key of your account as you are still logged in. You need to log out first before continuing.")}[this.props.displayAs]),s.createElement("div",{className:"form-actions"},s.createElement("button",{onClick:this.props.onLogoutButtonClick.bind(this),className:"button primary big full-width",role:"button"},s.createElement(I.x6,null,"Sign out"))))}}Ze.propTypes={displayAs:h().oneOf([Je,Ye,Qe]).isRequired,onLogoutButtonClick:h().func.isRequired};const et=(0,I.CI)("common")(Ze);class tt extends s.Component{componentDidMount(){this.initializeAccountRecovery()}initializeAccountRecovery(){setTimeout(()=>this.props.apiAccountRecoveryContext.onInitializeAccountRecoveryRequested(),1e3)}render(){switch(this.props.apiAccountRecoveryContext.state){case R.RESTART_FROM_SCRATCH:return s.createElement(Ge,null);case R.TOKEN_EXPIRED_STATE:return s.createElement(We,null);case R.ERROR_ALREADY_SIGNED_IN_STATE:return s.createElement(et,{onLogoutButtonClick:this.props.apiAccountRecoveryContext.logoutUserAndRefresh,displayAs:Qe});case R.UNEXPECTED_ERROR_STATE:return s.createElement(He,{error:this.props.apiAccountRecoveryContext.unexpectedError});default:return s.createElement(Be,null)}}}tt.propTypes={apiAccountRecoveryContext:h().object};const rt=function(e){return class extends s.Component{render(){return s.createElement(T.Consumer,null,t=>s.createElement(e,w({apiAccountRecoveryContext:t},this.props)))}}}(tt);var st,nt,ot,it,at;function lt(){return lt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var s in r)({}).hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e},lt.apply(null,arguments)}const ct=function(e){return s.createElement("svg",lt({xmlns:"http://www.w3.org/2000/svg",width:151,height:27,fill:"none","aria-labelledby":"logo-title logo-description",viewBox:"0 0 151 27"},e),st||(st=s.createElement("title",{id:"logo-title"},"Passbolt logo")),nt||(nt=s.createElement("desc",{id:"logo-description"},"This is the logo of passbolt.")),ot||(ot=s.createElement("path",{fill:"var(--icon-color)",d:"M4.648 9.234v8.607h2.48c1.646 0 2.786-.349 3.47-1.012.685-.664 1.013-1.823 1.013-3.395 0-1.52-.305-2.595-.938-3.218-.633-.673-1.695-.972-3.24-.972zM.597 5.963h7.797c2.357 0 4.178.676 5.496 2.048q1.976 2.058 1.974 5.689a8.6 8.6 0 0 1-.406 2.749 7.1 7.1 0 0 1-1.24 2.278 5.9 5.9 0 0 1-2.38 1.773c-.937.349-2.152.524-3.697.524H4.648V26.5H.597zM24.016 18.016h5.064v-3.119h-4.76c-.937 0-1.594.124-1.95.375-.357.25-.517.698-.517 1.321 0 .524.15.899.429 1.122.28.223.848.301 1.734.301M18.649 5.963h8.268c2.103 0 3.672.476 4.736 1.423 1.065.947 1.594 2.347 1.594 4.217v9.456H22.37c-1.52 0-2.708-.375-3.52-1.121-.81-.747-1.2-1.823-1.2-3.22 0-1.722.454-2.945 1.392-3.692s2.483-1.134 4.697-1.134h5.315v-.365c0-.898-.276-1.518-.809-1.896-.532-.377-1.47-.55-2.86-.55H18.65zM36.55 17.915h8.525c.76 0 1.318-.124 1.646-.35.183-.122.328-.29.423-.486.094-.197.134-.414.115-.63a1.2 1.2 0 0 0-.112-.632 1.24 1.24 0 0 0-.42-.492c-.355-.253-.91-.374-1.646-.374h-3.494c-2.067 0-3.467-.325-4.203-.947-.737-.623-1.088-1.747-1.088-3.32 0-1.62.431-2.82 1.318-3.592.886-.772 2.255-1.152 4.064-1.152h8.684v3.142h-7.134q-1.75 0-2.279.301c-.354.198-.532.547-.532 1.071-.017.193.016.387.096.564s.204.332.361.449c.302.223.809.324 1.468.324h3.676c1.672 0 2.961.397 3.824 1.172s1.315 1.871 1.315 3.32c0 1.397-.405 2.53-1.188 3.417-.37.427-.833.768-1.354.996-.522.23-1.09.34-1.661.325H36.549zM53.822 17.915h8.526c.76 0 1.318-.124 1.646-.35a1.23 1.23 0 0 0 .42-.487c.093-.196.132-.413.112-.629a1.2 1.2 0 0 0-.111-.632 1.24 1.24 0 0 0-.421-.492c-.354-.253-.91-.374-1.646-.374h-3.493c-2.067 0-3.467-.325-4.204-.947-.736-.623-1.088-1.752-1.088-3.324 0-1.62.432-2.82 1.318-3.593.886-.772 2.253-1.147 4.075-1.147h8.686v3.142h-7.141q-1.747 0-2.28.301c-.353.198-.531.547-.531 1.071-.017.193.016.387.096.564s.204.332.361.449c.302.223.809.324 1.468.324h3.671c1.672 0 2.963.397 3.824 1.172s1.315 1.871 1.315 3.32c0 1.397-.403 2.53-1.188 3.417-.37.427-.832.767-1.354.996a3.9 3.9 0 0 1-1.66.325H53.769v-3.106zM75.387.5v5.463h3.47c1.55 0 2.759.175 3.694.55.946.362 1.77.976 2.38 1.772a7.2 7.2 0 0 1 1.243 2.296c.281.888.417 1.814.403 2.744q0 3.63-1.974 5.689c-1.315 1.372-3.14 2.046-5.493 2.046h-7.8V.5zm2.462 8.734h-2.483v8.608h2.785c1.55 0 2.633-.324 3.243-.95s.935-1.721.935-3.268-.354-2.694-1.033-3.367c-.68-.673-1.832-1.023-3.447-1.023M92.3 13.525c0 1.445.328 2.532 1.013 3.367s1.62 1.198 2.86 1.198 2.152-.398 2.863-1.198 1.033-1.921 1.033-3.367-.356-2.547-1.033-3.344c-.677-.798-1.62-1.198-2.863-1.198a3.64 3.64 0 0 0-1.57.279 3.6 3.6 0 0 0-1.29.919c-.685.797-1.013 1.921-1.013 3.344m12.002 0q0 3.544-2.202 5.689c-1.47 1.397-3.42 2.121-5.901 2.121s-4.457-.699-5.924-2.121-2.202-3.292-2.202-5.664q0-3.558 2.202-5.69c1.467-1.424 3.444-2.145 5.919-2.145s4.431.724 5.901 2.144 2.207 3.294 2.207 5.666M110.935 21.06h-4.202V.5h4.202zM112.884 5.963h2.86V.5h4.052v5.463h4.278v3.02h-4.278v6.09c0 1.12.204 1.895.581 2.343.377.449 1.064.649 2.026.649h1.671v3.02h-3.72c-1.494 0-2.636-.4-3.444-1.223-.809-.823-1.189-1.995-1.189-3.519v-7.36h-2.863v-3.02z"})),it||(it=s.createElement("path",{fill:"#D40101",d:"m149.951 10.68-9.059-8.36a2.12 2.12 0 0 0-1.421-.543c-.526 0-1.033.194-1.421.544l-5.684 5.268c.745.271 1.414.71 1.952 1.282.539.572.933 1.26 1.149 2.01h7.673a.73.73 0 0 1 .504.204.69.69 0 0 1 .207.494v1.147a.68.68 0 0 1-.207.494.72.72 0 0 1-.504.204h-.886v1.623a.68.68 0 0 1-.205.494.72.72 0 0 1-.503.205h-1.945a.73.73 0 0 1-.503-.205.69.69 0 0 1-.205-.494v-1.623h-3.426a4.84 4.84 0 0 1-1.135 2.033 5 5 0 0 1-1.966 1.287l5.71 5.276c.388.349.895.543 1.421.543a2.12 2.12 0 0 0 1.421-.543l9.043-8.355a2.03 2.03 0 0 0-.01-2.985"})),at||(at=s.createElement("path",{fill:"#D40101",d:"M130.683 9.867a2.6 2.6 0 0 0-1.064.253c-.371.18-.686.455-.913.794a2.242 2.242 0 0 0-.113 2.305 2.3 2.3 0 0 0 .831.877 2.36 2.36 0 0 0 2.355.059c.362-.197.664-.484.875-.833a2.24 2.24 0 0 0 .324-1.153 2.21 2.21 0 0 0-.653-1.625 2.3 2.3 0 0 0-.751-.5 2.3 2.3 0 0 0-.891-.177"})))};class ht extends s.Component{constructor(e){super(e),this.state=this.defaultState,this.userId=null,this.authenticationToken=null,this.initializeProperties()}get defaultState(){return{siteSettings:null,trustedDomain:this.baseUrl,getApiClientOptions:this.getApiClientOptions.bind(this),locale:null,onUpdateLocaleRequested:this.onUpdateLocaleRequested.bind(this)}}async componentDidMount(){const e=await this.getSiteSettings();this.initLocale(e)}initializeProperties(){const e="[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[0-5][a-fA-F0-9]{3}-[089aAbB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}",t=new RegExp(`account-recovery/continue/(${e})/(${e})$`),r=window.location.pathname.match(t);r?(this.userId=r[1],this.authenticationToken=r[2]):console.error("Unable to parse the url.")}get baseUrl(){const e=document.getElementsByTagName("base")&&document.getElementsByTagName("base")[0];return e?e.attributes.href.value.replace(/\/*$/g,""):(console.error("Unable to retrieve the page base tag"),"")}getApiClientOptions(){return(new C).setBaseUrl(this.state.trustedDomain)}async getSiteSettings(){const e=this.getApiClientOptions().setResourceName("settings"),t=new E(e),{body:r}=await t.findAll(),s=new ae(r);return this.setState({siteSettings:s}),s}initLocale(e){const t=this.getUrlLocale(e)||this.getBrowserLocale(e)||this.getBrowserSimilarLocale(e)||e.locale;this.setState({locale:t})}getUrlLocale(e){const t=new URL(window.location.href).searchParams.get("locale");if(t){const r=e.supportedLocales.find(e=>t===e.locale);if(r)return r.locale}}getBrowserLocale(e){const t=e.supportedLocales.find(e=>navigator.language===e.locale);if(t)return t.locale}getBrowserSimilarLocale(e){const t=navigator.language.split("-")[0],r=e.supportedLocales.find(e=>t===e.locale.split("-")[0]);if(r)return r.locale}onUpdateLocaleRequested(e){this.setState({locale:e}),this.setUrlLocale(e)}setUrlLocale(e){const t=new URL(window.location.href);t.searchParams.set("locale",e),window.history.replaceState(null,null,t)}isReady(){return null!==this.state.siteSettings&&null!==this.state.locale}render(){return s.createElement(l.Provider,{value:this.state},this.isReady()&&s.createElement(ue,{loadingPath:`${this.state.trustedDomain}/locales/{{lng}}/{{ns}}.json`},s.createElement(A,{value:{userId:this.userId,authenticationToken:this.authenticationToken}},s.createElement("div",{id:"container",className:"container page login"},s.createElement("div",{className:"content"},s.createElement("div",{className:"header"},s.createElement("div",{className:"logo-svg"},s.createElement(ct,{role:"img",width:"20rem",height:"3.5rem"}))),s.createElement("div",{className:"login-form"},s.createElement(rt,null)),s.createElement(Le,null)),s.createElement(k,null)))))}}const ut=ht,pt=document.createElement("div");document.body.appendChild(pt),(0,n.H)(pt).render(s.createElement(ut,null))}},r={};function s(e){var n=r[e];if(void 0!==n)return n.exports;var o=r[e]={exports:{}};return t[e].call(o.exports,o,o.exports,s),o.exports}s.m=t,e=[],s.O=(t,r,n,o)=>{if(!r){var i=1/0;for(h=0;h<e.length;h++){for(var[r,n,o]=e[h],a=!0,l=0;l<r.length;l++)(!1&o||i>=o)&&Object.keys(s.O).every(e=>s.O[e](r[l]))?r.splice(l--,1):(a=!1,o<i&&(i=o));if(a){e.splice(h--,1);var c=n();void 0!==c&&(t=c)}}return t}o=o||0;for(var h=e.length;h>0&&e[h-1][2]>o;h--)e[h]=e[h-1];e[h]=[r,n,o]},s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},s.d=(e,t)=>{for(var r in t)s.o(t,r)&&!s.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),s.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.j=673,s.dn=e=>{(Object.getOwnPropertyDescriptor(e,"name")||{}).writable||Object.defineProperty(e,"name",{value:"default",configurable:!0})},(()=>{var e={673:0};s.O.j=t=>0===e[t];var t=(t,r)=>{var n,o,[i,a,l]=r,c=0;if(i.some(t=>0!==e[t])){for(n in a)s.o(a,n)&&(s.m[n]=a[n]);if(l)var h=l(s)}for(t&&t(r);c<i.length;c++)o=i[c],s.o(e,o)&&e[o]&&e[o][0](),e[o]=0;return s.O(h)},r=self.webpackChunkpassbolt_styleguide=self.webpackChunkpassbolt_styleguide||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))})();var n=s.O(void 0,[847],()=>s(7350));n=s.O(n)})();
|
|
2
|
+
(()=>{"use strict";var e,t={6943(e,t,s){var n=s(6540),i=s(5338);function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var n in s)({}).hasOwnProperty.call(s,n)&&(e[n]=s[n])}return e},r.apply(null,arguments)}const o=n.createContext({user:null,users:null,roles:null,rememberMeOptions:{},resources:null,resource:null,shareResources:null,selectedResources:null,selectedUser:null,folders:null,resourceCommentId:null,mustRefreshComments:!1,siteSettings:null,userSettings:null,onCheckIsAuthenticatedRequested:null});function a(e){return class extends n.Component{render(){return n.createElement(o.Consumer,null,t=>n.createElement(e,r({context:t},this.props)))}}}const l=o;var c=s(5556),d=s.n(c);class p extends Error{constructor(e,t){super(e),this.name="PassboltApiFetchError",this.data=t||{}}}const u=p;class h extends Error{constructor(){super("An internal error occurred. The server response could not be parsed. Please contact your administrator."),this.name="PassboltBadResponseError"}}const m=h;class g extends Error{constructor(e){super(e=e||"The service is unavailable"),this.name="PassboltServiceUnavailableError"}}const E=g,y=["GET","POST","PUT","DELETE"];class b{constructor(e){if(this.options=e,!this.options.getBaseUrl())throw new TypeError("ApiClient constructor error: baseUrl is required.");if(!this.options.getResourceName())throw new TypeError("ApiClient constructor error: resourceName is required.");try{let e=this.options.getBaseUrl().toString();e.endsWith("/")&&(e=e.slice(0,-1));let t=this.options.getResourceName();t.startsWith("/")&&(t=t.slice(1)),t.endsWith("/")&&(t=t.slice(0,-1)),this.baseUrl=`${e}/${t}`,this.baseUrl=new URL(this.baseUrl)}catch(e){throw new TypeError("ApiClient constructor error: b.",{cause:e})}this.apiVersion="api-version=v2"}getDefaultHeaders(){return{Accept:"application/json","content-type":"application/json"}}async buildFetchOptions(){const e=await this.options.getHeaders();return{credentials:"include",headers:{...this.getDefaultHeaders(),...e}}}async get(e,t){this.assertValidId(e);const s=this.buildUrl(`${this.baseUrl}/${e}`,t||{});return this.fetchAndHandleResponse("GET",s)}async delete(e,t,s,n){let i;this.assertValidId(e),void 0===n&&(n=!1),i=n?this.buildUrl(`${this.baseUrl}/${e}/dry-run`,s||{}):this.buildUrl(`${this.baseUrl}/${e}`,s||{});let r=null;return t&&(r=this.buildBody(t)),this.fetchAndHandleResponse("DELETE",i,r)}async findAll(e){const t=this.buildUrl(this.baseUrl.toString(),e||{});return this.fetchAndHandleResponse("GET",t)}async create(e,t){const s=this.buildUrl(this.baseUrl.toString(),t||{}),n=this.buildBody(e);return this.fetchAndHandleResponse("POST",s,n)}async update(e,t,s,n){let i;this.assertValidId(e),void 0===n&&(n=!1),i=n?this.buildUrl(`${this.baseUrl}/${e}/dry-run`,s||{}):this.buildUrl(`${this.baseUrl}/${e}`,s||{});let r=null;return t&&(r=this.buildBody(t)),this.fetchAndHandleResponse("PUT",i,r)}async updateAll(e,t={}){const s=this.buildUrl(this.baseUrl.toString(),t),n=e?this.buildBody(e):null;return this.fetchAndHandleResponse("PUT",s,n)}assertValidId(e){if(!e)throw new TypeError("ApiClient.assertValidId error: id cannot be empty");if("string"!=typeof e)throw new TypeError("ApiClient.assertValidId error: id should be a string")}assertMethod(e){if("string"!=typeof e)throw new TypeError("ApiClient.assertValidMethod method should be a string.");if(y.indexOf(e.toUpperCase())<0)throw new TypeError(`ApiClient.assertValidMethod error: method ${e} is not supported.`)}assertUrl(e){if(!e)throw new TypeError("ApliClient.assertUrl error: url is required.");if(!(e instanceof URL))throw new TypeError("ApliClient.assertUrl error: url should be a valid URL object.");if("https:"!==e.protocol&&"http:"!==e.protocol)throw new TypeError("ApliClient.assertUrl error: url protocol should only be https or http.")}assertBody(e){if(!(e instanceof FormData)&&"string"!=typeof e)throw new TypeError("ApiClient.assertBody error: body should be a string or a FormData.")}buildBody(e){return JSON.stringify(e)}buildUrl(e,t){if("string"!=typeof e)throw new TypeError("ApiClient.buildUrl error: url should be a string.");const s=new URL(`${e}.json?${this.apiVersion}`);t=t||{};for(const[e,n]of Object.entries(t)){if("string"!=typeof e)throw new TypeError("ApiClient.buildUrl error: urlOptions key should be a string.");if("string"==typeof n)s.searchParams.append(e,n);else{if(!Array.isArray(n))throw new TypeError("ApiClient.buildUrl error: urlOptions value should be a string or array.");n.forEach(t=>{s.searchParams.append(e,t)})}}return s}async sendRequest(e,t,s,n){this.assertUrl(t),this.assertMethod(e),s&&this.assertBody(s);const i="undefined"!=typeof customApiClientFetch?customApiClientFetch:fetch,r={...await this.buildFetchOptions(),...n};r.method=e,s&&(r.body=s);try{return await i(t.toString(),r)}catch(e){throw console.error(e),navigator.onLine?new E("Unable to reach the server, an unexpected error occurred"):new E("Unable to reach the server, you are not connected to the network")}}async fetchAndHandleResponse(e,t,s,n){const i=await this.sendRequest(e,t,s,n);return this.parseResponseJson(i)}async parseResponseJson(e){let t;try{t=await e.json()}catch(t){throw console.debug(e.url.toString(),t),new m(t,e)}if(!e.ok){const s=t.header.message;throw new u(s,{code:e.status,body:t.body})}return t}}const f=class{constructor(e){e.setResourceName("auth"),this.apiClient=new b(e)}async logout(){const e=this.apiClient.buildUrl(`${this.apiClient.baseUrl}/logout`,{}),t=await this.apiClient.sendRequest("POST",e,null,{redirect:"manual"});if(!t.ok&&0!==t.status)return this._logoutLegacy()}async _logoutLegacy(){const e=this.apiClient.buildUrl(`${this.apiClient.baseUrl}/logout`,{}),t=await this.apiClient.sendRequest("GET",e,null,{redirect:"manual"});if(!t.ok&&0!==t.status)throw new u("An unexpected error happened during the legacy logout process",{code:t.status})}};class T{static reload(){window.location.reload()}}function S(){return S=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var n in s)({}).hasOwnProperty.call(s,n)&&(e[n]=s[n])}return e},S.apply(null,arguments)}const w=n.createContext({userId:null,authenticationToken:null,state:null,unexpectedError:null,onInitializeAccountRecoveryRequested:()=>{},logoutUserAndRefresh:()=>{}});class v extends n.Component{constructor(e){super(e),this.state=Object.assign(this.defaultState,e.value),this.authLogoutService=new f(e.context.getApiClientOptions())}get defaultState(){return{userId:null,authenticationToken:null,state:R.INITIAL_STATE,unexpectedError:null,onInitializeAccountRecoveryRequested:this.onInitializeAccountRecoveryRequested.bind(this),logoutUserAndRefresh:this.logoutUserAndRefresh.bind(this)}}async onInitializeAccountRecoveryRequested(){if(!this.state.userId||!this.state.authenticationToken)return this.setState({state:R.REQUEST_INVITATION_ERROR});try{await this.verifyCanContinueAccountRecovery(),this.setState({state:R.RESTART_FROM_SCRATCH})}catch(e){await this.handleVerifyCanContinueAccountRecoveryError(e)}}async verifyCanContinueAccountRecovery(){const e=this.props.context.getApiClientOptions();e.setResourceName("account-recovery");const t=new b(e);await t.get(`continue/${this.state.userId}/${this.state.authenticationToken}`)}async handleVerifyCanContinueAccountRecoveryError(e){if(e instanceof u){if(403===e.data.code)return this.setState({state:R.ERROR_ALREADY_SIGNED_IN_STATE});const t=Boolean(e?.data?.body?.token?.expired),s=Boolean(e?.data?.body?.token?.isActive);if(t||s)return this.setState({state:R.TOKEN_EXPIRED_STATE})}this.setState({state:R.UNEXPECTED_ERROR_STATE,unexpectedError:e})}async logoutUserAndRefresh(){try{await this.authLogoutService.logout()}catch(e){const t=new E(e.message);return this.setState({unexpectedError:t,state:R.UNEXPECTED_ERROR_STATE})}T.reload()}render(){return n.createElement(w.Provider,{value:this.state},this.props.children)}}v.propTypes={context:d().any,value:d().any,children:d().any};const A=a(v),R={INITIAL_STATE:"Initial state",RESTART_FROM_SCRATCH:"Restart from scratch state",TOKEN_EXPIRED_STATE:"Token expired state",ERROR_ALREADY_SIGNED_IN_STATE:"Error, already signed in state",REQUEST_INVITATION_ERROR:"Request inviration error state",UNEXPECTED_ERROR_STATE:"Unexpected error state"};class C{setBaseUrl(e){if(!e)throw new TypeError("ApiClientOption baseUrl is required.");if("string"==typeof e)try{this.baseUrl=new URL(e)}catch(e){throw new TypeError("ApiClientOption baseUrl is invalid.",{cause:e})}else{if(!(e instanceof URL))throw new TypeError("ApiClientOptions baseurl should be a string or URL");this.baseUrl=e}return this}setResourceName(e){if(!e)throw new TypeError("ApiClientOptions.setResourceName resourceName is required.");if("string"!=typeof e)throw new TypeError("ApiClientOptions.setResourceName resourceName should be a valid string.");return this.resourceName=e,this}getBaseUrl(){return this.baseUrl}getResourceName(){return this.resourceName}async getHeaders(){const e=await this.getCsrfToken();if(e)return{"X-CSRF-Token":e}}async getCsrfToken(){if("undefined"==typeof browser||void 0===browser.cookies){const e=document?.cookie?.split("; ")?.find(e=>e.startsWith("csrfToken"))?.split("=");return e&&2===e.length?e[1]:null}const e=this.baseUrl.toString(),t="/"===e.slice(-1)?e:`${e}/`,s=await browser.cookies.get({name:"csrfToken",url:t});return s?.value||null}}var x;function N(){return N=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var n in s)({}).hasOwnProperty.call(s,n)&&(e[n]=s[n])}return e},N.apply(null,arguments)}const O=function(e){return n.createElement("svg",N({xmlns:"http://www.w3.org/2000/svg",width:17,height:16,fill:"none",viewBox:"0 0 17 16"},e),x||(x=n.createElement("g",{clipPath:"url(#heart_svg__clip0_93_734678)"},n.createElement("path",{stroke:"var(--icon-color)",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M13.497 9.333c.993-.973 2-2.14 2-3.666A3.667 3.667 0 0 0 11.83 2c-1.173 0-2 .333-3 1.333-1-1-1.827-1.333-3-1.333a3.667 3.667 0 0 0-3.667 3.667c0 1.533 1 2.7 2 3.666L8.83 14z"}))))};var I=s(9762);class P extends n.Component{render(){return n.createElement("div",{className:"tooltip",tabIndex:"0"},this.props.children,n.createElement("span",{className:`tooltip-text ${this.props.direction}`},this.props.message))}}P.defaultProps={direction:"right"},P.propTypes={children:d().any,message:d().any.isRequired,direction:d().string};const _=P;var k=s(8097),D=s(4296);function U(){return U=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var n in s)({}).hasOwnProperty.call(s,n)&&(e[n]=s[n])}return e},U.apply(null,arguments)}const q=n.createContext({dialogs:[],open:()=>{},close:()=>{}});class G extends n.Component{constructor(e){super(e),this.state=this.defaultState}get defaultState(){return{dialogs:[],open:(e,t)=>{const s=(0,D.A)();return this.setState(n=>({dialogs:[...n.dialogs,{key:s,Dialog:e,DialogProps:t}]})),s},close:e=>{this.setState(t=>({dialogs:t.dialogs.filter(t=>e!==t.key)}))},closeAll:()=>this.setState({dialogs:[]})}}render(){return n.createElement(q.Provider,{value:this.state},this.props.children)}}function L(e){return class extends n.Component{render(){return n.createElement(q.Consumer,null,t=>n.createElement(e,U({dialogContext:t},this.props)))}}}G.displayName="DialogContextProvider",G.propTypes={children:d().any};var M=s(6347);function $(){return $=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var n in s)({}).hasOwnProperty.call(s,n)&&(e[n]=s[n])}return e},$.apply(null,arguments)}const F=n.createContext({onGoToAdministrationRequested:()=>{},onGoToAdministrationSelfRegistrationRequested:()=>{},onGoToAdministrationMfaRequested:()=>{},onGoToAdministrationUsersDirectoryRequested:()=>{},onGoToAdministrationEmailNotificationsRequested:()=>{},onGoToAdministrationSubscriptionRequested:()=>{},onGoToAdministrationDowngradeToCeRequested:()=>{},onGoToAdministrationInternationalizationRequested:()=>{},onGoToAdministrationAccountRecoveryRequested:()=>{},onGoToAdministrationSmtpSettingsRequested:()=>{},onGoToAdministrationSsoRequested:()=>{},onGoToAdministrationPasswordPoliciesRequested:()=>{},onGoToAdministrationSecretHistoryRequested:()=>{},onGoToAdministrationUserPassphrasePoliciesRequested:()=>{},onGoToAdministrationPasswordExpirySettingsRequested:()=>{},onGoToAdministrationHealthcheckRequested:()=>{},onGoToPasswordsRequested:()=>{},onGoToUsersRequested:()=>{},onGoToTermsRequested:()=>{},onGoToHelpRequested:()=>{},onGoToUserSettingsProfileRequested:()=>{},onGoToUserSettingsPassphraseRequested:()=>{},onGoToUserSettingsSecurityTokenRequested:()=>{},onGoToUserSettingsThemeRequested:()=>{},onGoToUserSettingsMfaRequested:()=>{},onGoToUserSettingsKeysRequested:()=>{},onGoToUserSettingsMobileRequested:()=>{},onGoToUserSettingsDesktopRequested:()=>{},onGoToUserSettingsAccountRecoveryRequested:()=>{},onGoToNewTab:()=>{},onGoToAdministrationRbacsRequested:()=>{},onGoToAdministrationMigrateMetadataRequested:()=>{},onGoToAdministrationAllowContentTypesRequested:()=>{},onGoToAdministrationMetadataGettingStartedRequested:()=>{},onGoToAdministrationSubscriptionRequestedTeasing:()=>{},onGoToAdministrationPasswordPoliciesRequestedTeasing:()=>{},onGoToAdministrationUserPassphrasePoliciesRequestedTeasing:()=>{},onGoToAdministrationAccountRecoveryRequestedTeasing:()=>{},onGoToAdministrationSsoRequestedTeasing:()=>{},onGoToAdministrationMfaPolicyRequestedTeasing:()=>{},onGoToAdministrationUsersDirectoryRequestedTeasing:()=>{},onGoToAdministrationScimRequestedTeasing:()=>{},onGoToAdministrationScimRequested:()=>{}});class j extends n.Component{constructor(e){super(e),this.state=this.defaultState}get defaultState(){return{onGoToNewTab:this.onGoToNewTab.bind(this),onGoToAdministrationRequested:this.onGoToAdministrationRequested.bind(this),onGoToAdministrationMfaRequested:this.onGoToAdministrationMfaRequested.bind(this),onGoToAdministrationUsersDirectoryRequested:this.onGoToAdministrationUsersDirectoryRequested.bind(this),onGoToAdministrationEmailNotificationsRequested:this.onGoToAdministrationEmailNotificationsRequested.bind(this),onGoToAdministrationSubscriptionRequested:this.onGoToAdministrationSubscriptionRequested.bind(this),onGoToAdministrationDowngradeToCeRequested:this.onGoToAdministrationDowngradeToCeRequested.bind(this),onGoToAdministrationInternationalizationRequested:this.onGoToAdministrationInternationalizationRequested.bind(this),onGoToAdministrationAccountRecoveryRequested:this.onGoToAdministrationAccountRecoveryRequested.bind(this),onGoToAdministrationSmtpSettingsRequested:this.onGoToAdministrationSmtpSettingsRequested.bind(this),onGoToAdministrationSelfRegistrationRequested:this.onGoToAdministrationSelfRegistrationRequested.bind(this),onGoToAdministrationSsoRequested:this.onGoToAdministrationSsoRequested.bind(this),onGoToAdministrationMfaPolicyRequested:this.onGoToAdministrationMfaPolicyRequested.bind(this),onGoToAdministrationPasswordPoliciesRequested:this.onGoToAdministrationPasswordPoliciesRequested.bind(this),onGoToAdministrationSecretHistoryRequested:this.onGoToAdministrationSecretHistoryRequested.bind(this),onGoToAdministrationUserPassphrasePoliciesRequested:this.onGoToAdministrationUserPassphrasePoliciesRequested.bind(this),onGoToAdministrationPasswordExpirySettingsRequested:this.onGoToAdministrationPasswordExpirySettingsRequested.bind(this),onGoToAdministrationHealthcheckRequested:this.onGoToAdministrationHealthcheckRequested.bind(this),onGoToAdministrationContentTypesEncryptedMetadataRequested:this.onGoToAdministrationContentTypesEncryptedMetadataRequested.bind(this),onGoToAdministrationContentTypesMetadataKeyRequested:this.onGoToAdministrationContentTypesMetadataKeyRequested.bind(this),onGoToAdministrationMigrateMetadataRequested:this.onGoToAdministrationMigrateMetadataRequested.bind(this),onGoToAdministrationAllowContentTypesRequested:this.onGoToAdministrationAllowContentTypesRequested.bind(this),onGoToPasswordsRequested:this.onGoToPasswordsRequested.bind(this),onGoToUsersRequested:this.onGoToUsersRequested.bind(this),onGoToHelpRequested:this.onGoToHelpRequested.bind(this),onGoToTermsRequested:this.onGoToTermsRequested.bind(this),onGoToUserSettingsProfileRequested:this.onGoToUserSettingsProfileRequested.bind(this),onGoToUserSettingsPassphraseRequested:this.onGoToUserSettingsPassphraseRequested.bind(this),onGoToUserSettingsSecurityTokenRequested:this.onGoToUserSettingsSecurityTokenRequested.bind(this),onGoToUserSettingsThemeRequested:this.onGoToUserSettingsThemeRequested.bind(this),onGoToUserSettingsMfaRequested:this.onGoToUserSettingsMfaRequested.bind(this),onGoToUserSettingsKeysRequested:this.onGoToUserSettingsKeysRequested.bind(this),onGoToUserSettingsMobileRequested:this.onGoToUserSettingsMobileRequested.bind(this),onGoToUserSettingsDesktopRequested:this.onGoToUserSettingsDesktopRequested.bind(this),onGoToUserSettingsAccountRecoveryRequested:this.onGoToUserSettingsAccountRecoveryRequested.bind(this),onGoToAdministrationRbacsRequested:this.onGoToAdministrationRbacsRequested.bind(this),onGoToAdministrationMetadataGettingStartedRequested:this.onGoToAdministrationMetadataGettingStartedRequested.bind(this),onGoToAdministrationSubscriptionRequestedTeasing:this.onGoToAdministrationSubscriptionRequestedTeasing.bind(this),onGoToAdministrationPasswordPoliciesRequestedTeasing:this.onGoToAdministrationPasswordPoliciesRequestedTeasing.bind(this),onGoToAdministrationUserPassphrasePoliciesRequestedTeasing:this.onGoToAdministrationUserPassphrasePoliciesRequestedTeasing.bind(this),onGoToAdministrationAccountRecoveryRequestedTeasing:this.onGoToAdministrationAccountRecoveryRequestedTeasing.bind(this),onGoToAdministrationSsoRequestedTeasing:this.onGoToAdministrationSsoRequestedTeasing.bind(this),onGoToAdministrationMfaPolicyRequestedTeasing:this.onGoToAdministrationMfaPolicyRequestedTeasing.bind(this),onGoToAdministrationUsersDirectoryRequestedTeasing:this.onGoToAdministrationUsersDirectoryRequestedTeasing.bind(this),onGoToAdministrationScimRequestedTeasing:this.onGoToAdministrationScimRequestedTeasing.bind(this),onGoToAdministrationScimRequested:this.onGoToAdministrationScimRequested.bind(this)}}async goTo(e,t){if(e===this.props.context.name)return void await this.props.history.push({pathname:t});if("api"===e)return void await this.props.context.port.request("passbolt.tabs.open-admin-page",t);const s=`${this.props.context.userSettings?this.props.context.userSettings.getTrustedDomain():this.props.context.trustedDomain}${t}`;window.open(s,"_parent","noopener,noreferrer")}onGoToNewTab(e){window.open(e,"_blank","noopener,noreferrer")}async onGoToAdministrationRequested(){await this.goTo("browser-extension","/app/administration")}async onGoToAdministrationMfaRequested(){await this.goTo("api","/app/administration/mfa")}async onGoToAdministrationMfaPolicyRequested(){await this.goTo("api","/app/administration/mfa-policy")}async onGoToAdministrationPasswordPoliciesRequested(){await this.goTo("browser-extension","/app/administration/password-policies")}async onGoToAdministrationSecretHistoryRequested(){await this.goTo("browser-extension","/app/administration/secret-history")}async onGoToAdministrationSelfRegistrationRequested(){await this.goTo("api","/app/administration/self-registration")}async onGoToAdministrationUsersDirectoryRequested(){await this.goTo("api","/app/administration/users-directory")}async onGoToAdministrationHealthcheckRequested(){await this.goTo("api","/app/administration/healthcheck")}async onGoToAdministrationEmailNotificationsRequested(){await this.goTo("api","/app/administration/email-notification")}async onGoToAdministrationSmtpSettingsRequested(){await this.goTo("api","/app/administration/smtp-settings")}async onGoToAdministrationSubscriptionRequested(){await this.goTo("browser-extension","/app/administration/subscription")}async onGoToAdministrationDowngradeToCeRequested(){await this.goTo("browser-extension","/app/administration/ce-downgrade")}async onGoToAdministrationInternationalizationRequested(){await this.goTo("api","/app/administration/internationalization")}async onGoToAdministrationAccountRecoveryRequested(){await this.goTo("browser-extension","/app/administration/account-recovery")}async onGoToAdministrationSsoRequested(){await this.goTo("browser-extension","/app/administration/sso")}async onGoToAdministrationRbacsRequested(){await this.goTo("api","/app/administration/rbacs")}async onGoToAdministrationMetadataGettingStartedRequested(){await this.goTo("browser-extension","/app/administration/content-types/metadata-getting-started")}async onGoToAdministrationScimRequested(){await this.goTo("browser-extension","/app/administration/user-provisionning/scim")}async onGoToAdministrationUserPassphrasePoliciesRequested(){await this.goTo("browser-extension","/app/administration/user-passphrase-policies")}async onGoToAdministrationPasswordExpirySettingsRequested(){await this.goTo("browser-extension","/app/administration/password-expiry")}async onGoToAdministrationContentTypesEncryptedMetadataRequested(){await this.goTo("browser-extension","/app/administration/content-types/metadata")}async onGoToAdministrationContentTypesMetadataKeyRequested(){await this.goTo("browser-extension","/app/administration/content-types/metadata-key")}async onGoToAdministrationMigrateMetadataRequested(){await this.goTo("browser-extension","/app/administration/migrate-metadata")}async onGoToAdministrationAllowContentTypesRequested(){await this.goTo("browser-extension","/app/administration/allow-content-types")}async onGoToAdministrationSubscriptionRequestedTeasing(){await this.goTo("browser-extension","/app/administration/subscription-teasing")}async onGoToAdministrationPasswordPoliciesRequestedTeasing(){await this.goTo("browser-extension","/app/administration/password-policies-teasing")}async onGoToAdministrationUserPassphrasePoliciesRequestedTeasing(){await this.goTo("browser-extension","/app/administration/user-passphrase-policies-teasing")}async onGoToAdministrationAccountRecoveryRequestedTeasing(){await this.goTo("browser-extension","/app/administration/account-recovery-teasing")}async onGoToAdministrationSsoRequestedTeasing(){await this.goTo("browser-extension","/app/administration/sso-teasing")}async onGoToAdministrationMfaPolicyRequestedTeasing(){await this.goTo("browser-extension","/app/administration/mfa-policy-teasing")}async onGoToAdministrationUsersDirectoryRequestedTeasing(){await this.goTo("browser-extension","/app/administration/users-directory-teasing")}async onGoToAdministrationScimRequestedTeasing(){await this.goTo("browser-extension","/app/administration/scim-teasing")}get isMfaEnabled(){const e=this.props.context.siteSettings;return e&&e.canIUse("multiFactorAuthentication")}get isUserDirectoryEnabled(){const e=this.props.context.siteSettings;return e&&e.canIUse("directorySync")}get isSmtpSettingsEnable(){const e=this.props.context.siteSettings;return e&&e.canIUse("smtpSettings")}get isSelfRegistrationEnable(){const e=this.props.context.siteSettings;return e&&e.canIUse("selfRegistration")}get isPasswordPoliciesEnable(){const e=this.props.context.siteSettings;return e&&e.canIUse("passwordPoliciesUpdate")}get isUserPassphrasePoliciesEnable(){const e=this.props.context.siteSettings;return e&&e.canIUse("userPassphrasePolicies")}get isPasswordExpiryEnable(){const e=this.props.context.siteSettings;return e&&e.canIUse("passwordExpiry")}async onGoToPasswordsRequested(){await this.goTo("browser-extension","/app/passwords")}async onGoToUsersRequested(){await this.goTo("browser-extension","/app/users")}async onGoToHelpRequested(){await this.onGoToNewTab("https://www.passbolt.com/docs/")}async onGoToTermsRequested(){await this.onGoToNewTab("https://www.passbolt.com/terms")}async onGoToUserSettingsProfileRequested(){await this.goTo("browser-extension","/app/settings/profile")}async onGoToUserSettingsPassphraseRequested(){await this.goTo("browser-extension","/app/settings/passphrase")}async onGoToUserSettingsSecurityTokenRequested(){await this.goTo("browser-extension","/app/settings/security-token")}async onGoToUserSettingsThemeRequested(){await this.goTo("browser-extension","/app/settings/theme")}async onGoToUserSettingsMfaRequested(){await this.goTo("browser-extension","/app/settings/mfa")}async onGoToUserSettingsDuoSetupRequested(){let e="api";window.chrome?.webview&&(e="browser-extension"),await this.goTo(e,"/app/settings/mfa")}async onGoToUserSettingsKeysRequested(){await this.goTo("browser-extension","/app/settings/keys")}async onGoToUserSettingsMobileRequested(){await this.goTo("browser-extension","/app/settings/mobile")}async onGoToUserSettingsDesktopRequested(){await this.goTo("browser-extension","/app/settings/desktop")}async onGoToUserSettingsAccountRecoveryRequested(){await this.goTo("browser-extension","/app/settings/account-recovery")}render(){return n.createElement(F.Provider,{value:this.state},this.props.children)}}function K(){return K=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var n in s)({}).hasOwnProperty.call(s,n)&&(e[n]=s[n])}return e},K.apply(null,arguments)}j.displayName="NavigationContextProvider",j.propTypes={context:d().object,children:d().any,location:d().object,match:d().object,history:d().object},(0,M.withRouter)(a(j));const V=n.createContext({counter:[],add:()=>{},remove:()=>{}});class B extends n.Component{constructor(e){super(e),this.state=this.defaultState}get defaultState(){return{counter:0,add:()=>{this.setState(e=>({counter:e.counter+1}))},remove:()=>{this.setState(e=>({counter:Math.min(e.counter-1,0)}))}}}render(){return n.createElement(V.Provider,{value:this.state},this.props.children)}}B.propTypes={children:d().any};class H{}class W extends H{static execute(){return!0}}class Y extends H{static execute(){return!1}}const z="Folders.use",X="Administration.viewWorkspace",J="GroupsAdd.addPost",Z="AccountRecoveryRequestsView.view",Q="AccountRecoveryRequestsIndex.index",ee="AccountRecoveryResponsesCreate.post",te="Allow",se="Deny",ne="AllowIfGroupManagerInOneGroup",ie={[te]:W,[se]:Y,[ne]:class extends H{static execute(e){return e.groups_users.some(e=>e.is_admin)}}},re={[z]:ie[te]},oe={[X]:ie[se],[J]:ie[se],[Z]:ie[se],[Q]:ie[se],[ee]:ie[se]};class ae{static getByRbac(e){return ie[e.controlFunction]||(console.warn(`Could not find control function for the given rbac entity (${e.id})`),Y)}static getDefaultForAdminAndAction(e){return re[e]||W}static getDefaultForUserAndAction(e){return oe[e]||W}}class le extends Error{constructor(e="Collection validation error."){super(e),this.name="CollectionValidationError",this.errors=[]}addItemValidationError(e,t){if(!Number.isInteger(e))throw new TypeError('CollectionValidationError::addEntityValidationError expects "position" to be an integer.');if(!(t instanceof pe||t instanceof le))throw new TypeError('CollectionValidationError::addEntityValidationError expects "entityValidationError" to be an instance of EntityValidationError or CollectionValidationError.');this.errors[e]=t}addCollectionValidationError(e,t){if("string"!=typeof e)throw new TypeError('CollectionValidationError::addCollectionValidationError expects "rule" to be a string.');if("string"!=typeof t)throw new TypeError('CollectionValidationError::addCollectionValidationError expects "error" to be a string.');this.errors[e]=t}hasErrors(){return this.errors.some(e=>Object.keys(e.details).length>0)}get details(){const e={};for(const t in this.errors)this.errors[t]instanceof pe||this.errors[t]instanceof le?e[t]=this.errors[t].details:e[t]=this.errors[t];return e}}const ce=le;class de extends Error{constructor(e="Entity validation error."){super(e),this.name="EntityValidationError",this.details={}}addError(e,t,s){if("string"!=typeof e)throw new TypeError("EntityValidationError addError property should be a string.");if("string"!=typeof t)throw new TypeError("EntityValidationError addError rule should be a string.");if("string"!=typeof s)throw new TypeError("EntityValidationError addError message should be a string.");Object.prototype.hasOwnProperty.call(this.details,e)||(this.details[e]={}),this.details[e][t]=s}addAssociationError(e,t){if("string"!=typeof e)throw new TypeError("EntityValidationError addAssociationError associationName should be a string.");if(!(t instanceof de||t instanceof ce))throw new TypeError("EntityValidationError addAssociationError errorDetails should be an object.");this.details[e]=t}getError(e,t){if(!this.hasError(e,t))return null;const s=this.details[e];return t?s[t]:s}hasError(e,t){if("string"!=typeof e)throw new TypeError("EntityValidationError hasError property should be a string.");const s=this.details&&Object.prototype.hasOwnProperty.call(this.details,e);if(!s)return!1;if(!t)return s;if("string"!=typeof t)throw new TypeError("EntityValidationError hasError rule should be a string.");return Object.prototype.hasOwnProperty.call(this.details[e],t)}hasErrors(){return Object.keys(this.details).length>0}getFirstRuleErrorByField(e){if(!this.hasError(e))return null;const t=this.details[e];return t[Object.keys(t)[0]]}}const pe=de;var ue=s(7761),he=s.n(ue);class me{static validateSchema(e,t){if(!t)throw new TypeError(`Could not validate entity ${e}. No schema for entity ${e}.`);if(!t.type)throw new TypeError(`Could not validate entity ${e}. Type missing.`);if("array"!==t.type){if("object"===t.type){if(!t.required||!Array.isArray(t.required))throw new TypeError(`Could not validate entity ${e}. Schema error: no required properties.`);if(!t.properties||!Object.keys(t).length)throw new TypeError(`Could not validate entity ${e}. Schema error: no properties.`);const s=t.properties;for(const e in s){if(!Object.prototype.hasOwnProperty.call(s,e)||!s[e].type&&!s[e].anyOf)throw TypeError(`Invalid schema. Type missing for ${e}...`);if(s[e].anyOf&&(!Array.isArray(s[e].anyOf)||!s[e].anyOf.length))throw new TypeError(`Invalid schema, prop ${e} anyOf should be an array`)}}}else if(!t.items)throw new TypeError(`Could not validate entity ${e}. Schema error: missing item definition.`)}static validate(e,t,s){if(!e||!t||!s)throw new TypeError(`Could not validate entity ${e}. No data provided.`);switch(s.type){case"object":return me.validateObject(e,t,s);case"array":return me.validateArray(e,t,s);default:throw new TypeError(`Could not validate entity ${e}. Unsupported type.`)}}static validateArray(e,t,s){let n;const i=me.validateProp("items",t,s);if("number"==typeof s.minItems&&(me.isGreaterThanOrEqual(t.length,s.minItems)||(n=me.handleCollectionValidationError("minItems",`The items array should contain at least ${s.minItems} item(s).`,n))),"number"==typeof s.maxItems&&(me.isLessThanOrEqual(t.length,s.maxItems)||(n=me.handleCollectionValidationError("maxItems",`The items array should contain at maximum ${s.maxItems} item(s).`,n))),n)throw n;return i}static validateObject(e,t,s){const n=s.required,i=s.properties,r={};let o;for(const s in i)if(Object.prototype.hasOwnProperty.call(i,s))if(null!==t?.[s]||!0!==i[s]?.nullable){if(n.includes(s)){if(!Object.prototype.hasOwnProperty.call(t,s)){o=me.getOrInitEntityValidationError(e,o),o.addError(s,"required",`The ${s} is required.`);continue}}else if(!Object.prototype.hasOwnProperty.call(t,s))continue;try{r[s]=me.validateProp(s,t[s],i[s])}catch(t){if(!(t instanceof pe))throw t;o=me.getOrInitEntityValidationError(e,o),o.details[s]=t.details[s]}}else r[s]=null;if(o)throw o;return r}static getOrInitEntityValidationError(e,t){return t||new pe(`Could not validate entity ${e}.`)}static validateProp(e,t,s){if(s.anyOf)return me.validateAnyOf(e,t,s.anyOf),t;if(!0===s.nullable&&null===t)return t;if(me.validatePropType(e,t,s),s.enum)return me.validatePropEnum(e,t,s),t;switch(s.type){case"string":me.validatePropTypeString(e,t,s);break;case"integer":case"number":me.validatePropTypeNumber(e,t,s);break;case"array":me.validatePropTypeArray(e,t,s);break;case"object":case"boolean":case"blob":case"null":break;case"x-custom":me.validatePropCustom(e,t,s);break;default:throw new TypeError(`Could not validate property ${e}. Unsupported prop type ${s.type}`)}return t}static validatePropType(e,t,s){if(!me.isValidPropType(t,s.type))throw me.handlePropertyValidationError(e,"type",`The ${e} is not a valid ${s.type}.`)}static validatePropCustom(e,t,s){try{s.validationCallback(t)}catch(t){throw me.handlePropertyValidationError(e,"custom",`The ${e} is not valid: ${t.message}`)}}static validatePropTypeString(e,t,s){let n;if(s.format&&(me.isValidStringFormat(t,s.format)||(n=me.handlePropertyValidationError(e,"format",`The ${e} is not a valid ${s.format}.`,n))),s.length&&(me.isValidStringLength(t,s.length,s.length)||(n=me.handlePropertyValidationError(e,"length",`The ${e} should be ${s.length} character in length.`,n))),s.minLength&&(me.isValidStringLength(t,s.minLength)||(n=me.handlePropertyValidationError(e,"minLength",`The ${e} should be ${s.minLength} character in length minimum.`,n))),s.maxLength&&(me.isValidStringLength(t,0,s.maxLength)||(n=me.handlePropertyValidationError(e,"maxLength",`The ${e} should be ${s.maxLength} character in length maximum.`,n))),s.pattern&&(he().matches(t,s.pattern)||(n=me.handlePropertyValidationError(e,"pattern",`The ${e} is not valid.`,n))),s.custom&&(s.custom(t)||(n=me.handlePropertyValidationError(e,"custom",`The ${e} is not valid.`,n))),n)throw n}static handlePropertyValidationError(e,t,s,n=null){return(n=n||new pe(`Could not validate property ${e}.`)).addError(e,t,s),n}static handleCollectionValidationError(e,t,s=null){return(s=s||new ce("Could not validate collection.")).addCollectionValidationError(e,t),s}static validatePropTypeNumber(e,t,s){let n;if("number"==typeof s.minimum&&(me.isGreaterThanOrEqual(t,s.minimum)||(n=me.handlePropertyValidationError(e,"minimum",`The ${e} should be greater or equal to ${s.minimum}.`,n))),"number"==typeof s.maximum&&(me.isLesserThanOrEqual(t,s.maximum)||(n=me.handlePropertyValidationError(e,"maximum",`The ${e} should be lesser or equal to ${s.maximum}.`,n))),n)throw n}static validatePropTypeArray(e,t,s){let n;if(s?.items&&"object"==typeof s.items){for(let i=0;i<t.length;i++){const r=`${e}.${i}`;try{this.validateProp(r,t[i],s.items)}catch(t){if(!(t instanceof pe))throw t;{n=me.getOrInitEntityValidationError(e,n);const s=t.details[r];n.details[e]={...n.details[e],[i]:s}}}}if(n)throw n}}static validatePropEnum(e,t,s){if(!me.isPropInEnum(t,s.enum)){const t=new pe(`Could not validate property ${e}.`);throw t.addError(e,"enum",`The ${e} value is not included in the supported list.`),t}}static validateAnyOf(e,t,s){for(let n=0;n<s.length;n++)try{return void me.validateProp(e,t,s[n])}catch{}const n=new pe(`Could not validate property ${e}.`);throw n.addError(e,"type",`The ${e} does not match any of the supported types.`),n}static isValidPropType(e,t){if(Array.isArray(t))throw new TypeError("EntitySchema isValidPropType multiple types are not supported.");if("string"!=typeof t)throw new TypeError("EntitySchema isValidPropType type is invalid.");switch(t){case"null":return null===e;case"boolean":return"boolean"==typeof e;case"string":return"string"==typeof e;case"integer":return Number.isInteger(e);case"number":return"number"==typeof e;case"object":return"object"==typeof e;case"array":return Array.isArray(e);case"blob":return e instanceof Blob;case"x-custom":return!0;default:throw new TypeError("EntitySchema validation type not supported.")}}static isValidStringFormat(e,t){if("string"!=typeof t)throw new TypeError("EntitySchema validPropFormat format is invalid.");switch(t){case"uuid":return he().isUUID(e);case"email":case"idn-email":return he().isEmail(e);case"date-time":return he().isISO8601(e);case"x-hex-color":return he().isHexColor(e);case"x-base64":return he().isBase64(e);default:throw new TypeError(`EntitySchema string validation format ${t} is not supported.`)}}static isValidStringLength(e,t,s){return t=t||0,he().isLength(e,t,s)}static isPropInEnum(e,t){if(!t||!Array.isArray(t)||!t.length)throw new TypeError("EntitySchema enum schema cannot be empty.");return t.includes(e)}static isGreaterThanOrEqual(e,t){return e>=t}static isLessThanOrEqual(e,t){return e<=t}static isLesserThanOrEqual(e,t){return e<=t}}const ge=me;class Ee{constructor(e,t={}){(t?.clone??!0)&&(e=JSON.parse(JSON.stringify(e))),this._props=e}toDto(){return JSON.parse(JSON.stringify(this))}toJSON(){return this._props}_hasProp(e){if(!e.includes(".")){const t=Ee._normalizePropName(e);return Object.prototype.hasOwnProperty.call(this._props,t)}try{return this._getPropByPath(e),!0}catch(t){return console.error(`Failed to check if property "${e}" is set:`,t),!1}}_getPropByPath(e){return Ee._normalizePropName(e).split(".").reduce((e,t)=>{if(Object.prototype.hasOwnProperty.call(e,t))return e[t];throw new Error},this._props)}static _normalizePropName(e){return e.replace(/([A-Z])/g,(e,t)=>`_${t.toLowerCase()}`).replace(/\._/,".").replace(/^_/,"").replace(/^\./,"")}}const ye=Ee;var be=s(5648);const fe=e=>e?.replace(/_([a-z])/g,(e,t)=>t.toUpperCase());class Te extends Error{constructor(e,t,s){if(super(s=s||"Entity collection error."),"number"!=typeof e)throw new TypeError("EntityCollectionError requires a valid position");if(!t||"string"!=typeof t)throw new TypeError("EntityCollectionError requires a valid rule");if(!s||"string"!=typeof s)throw new TypeError("EntityCollectionError requires a valid message");this.position=e,this.rule=t}}const Se=Te;class we{constructor(e=[],t={}){const s=t?.clone??!0;this._items=[],s&&(e=JSON.parse(JSON.stringify(e))),this._props=e}toDto(){return JSON.parse(JSON.stringify(this._items))}toJSON(){return this.toDto()}get items(){return this._items}get length(){return this._items.length}[Symbol.iterator](){let e=0;return{next:()=>e<this._items.length?{value:this._items[e++],done:!1}:{done:!0}}}getAll(e,t){if("string"!=typeof e)throw new TypeError("EntityCollection excludeAll expects propName to be string.");if("string"!=typeof t)throw new TypeError("EntityCollection excludeAll expects search to be string.");return this._items.filter(s=>Object.prototype.hasOwnProperty.call(s._props,e)&&s._props[e]===t)}getFirst(e,t){if("string"!=typeof e||"string"!=typeof t)throw new TypeError("EntityCollection getFirst by expect propName and search to be strings");const s=this.getAll(e,t);if(s&&s.length)return s[0]}extract(e){if("string"!=typeof e)throw new TypeError("EntityCollection extract expects propName to be a string.");return this._items.reduce((t,s)=>(void 0!==s._props[e]&&t.push(s._props[e]),t),[])}push(e){return this._items.push(e),this._items.length}unshift(e){return this._items.unshift(e),this._items.length}filterByPropertyValueIn(e,t,s=!0){if("string"!=typeof e)throw new TypeError("EntityCollection filterByPropertyValueIn expects propName to be a string.");if(!Array.isArray(t))throw new TypeError("EntityCollection filterByPropertyValueIn expects needles to be an array.");this.filterByCallback(n=>{const i=Object.prototype.hasOwnProperty.call(n._props,e);return!(s&&!i||i&&!t.includes(n._props[e]))})}filterByCallback(e){if("function"!=typeof e)throw new TypeError("EntityCollection filterByCallback expects callback to be a function.");for(let t=this._items.length-1;t>=0;t--)e(this._items[t])||this._items.splice(t,1)}assertUniqueByProperty(e,t){const s=`unique_${e}`,n=this.extract(e),i=new Set;t=t||`The collection should only contain items with unique values for the property: ${e}.`,n.forEach((e,n)=>{if(i.add(e),n!==i.size-1)throw new Se(n,s,t)})}assertNotExist(e,t,s={}){if(void 0===t)return;let n=s?.haystackSet;if(!n){const t=this.extract(e);n=new Set(t)}if(n.has(t)){const t=new pe,n=s?.message||`The collection already includes an element that has a property (${e}) with an identical value.`;throw t.addError(e,"unique",n),t}}}const ve=we,Ae=["string","number","integer","boolean"];class Re extends ye{static _cachedSchema={};constructor(e={},t={}){const s=t?.validate??!0;super(e,t),this.marshall(),s&&this.validateSchema({schema:t?.schema,skipSchemaAssociationValidation:t?.skipSchemaAssociationValidation}),this.createAssociations(t),s&&this.validateBuildRules(t?.validateBuildRules)}marshall(){}validate(e={}){try{this.validateSchema({schema:e?.schema,skipSchemaAssociationValidation:e?.skipSchemaAssociationValidation}),this.validateBuildRules(e?.validateBuildRules),this.validateAssociations(e)}catch(e){if(!(e instanceof pe))throw e;return e}return null}validateSchema(e=null){let t=e?.schema??this.cachedSchema;if(e?.skipSchemaAssociationValidation){t={...t};const e=Object.keys(this.constructor.associations),s=t.required.filter(t=>!e.includes(t));t.required=s}this._props=ge.validate(this.constructor.name,this._props,t)}get cachedSchema(){return this.constructor._cachedSchema[this.constructor.name]||(this.constructor._cachedSchema[this.constructor.name]=this.constructor.getSchema()),this.constructor._cachedSchema[this.constructor.name]}static getSchema(){throw new Error("The entity class should declare its schema.")}validateBuildRules(e={}){}createAssociations(e={}){if(Object.keys(this.constructor.associations).length>0){const t=new pe;for(const[s,n]of Object.entries(this.constructor.associations))try{this._props[s]&&(this[`_${fe(s)}`]=new n(this._props[s],{...e,clone:!1}),delete this._props[s])}catch(e){if(!(e instanceof pe))throw e;t.addAssociationError(s,e)}if(t.hasErrors())throw t}}static get associations(){return{}}get(e){(0,be.A)(e);const t=this.constructor.getSchema().properties[e];if(!t)throw new Error(`The property "${e}" has no schema definition.`);if(!Ae.includes(t?.type))throw new Error('The property "associated_entity" should reference scalar properties only.');return this._props[e]}set(e,t,s={}){(0,be.A)(e);const n=s?.validate??!0;if(this.isAssociation(e))this.setAssociation(e,t,s);else{const i=e.split(".")[0],r=this.constructor.getSchema().properties[i];if(!r)throw new Error(`The property "${i}" has no schema definition.`);if("array"===r?.type)this.setArrayProp(e,t,s);else{if(r?.type&&!Ae.includes(r?.type))throw new Error('The property "associated_entity" should reference scalar properties only.');if(r?.anyOf?.some(e=>!Ae.includes(e.type)))throw new Error('The property "associated_entity" should reference scalar properties only.');n&&ge.validateProp(i,t,r),this._props[i]=t}}}setArrayProp(e,t,s){(0,be.A)(e);const n=e.split("."),i=n[0];let r=null;const o=this.constructor.getSchema().properties[i],a=s?.validate??!0;if(2!==n.length)throw new Error(`The property "${n[0]}" has no index passed.`);{const e=n[1].match(/^(\d+)$/);if(!e)throw new Error(`The property "${n[0]}" has an invalid index format. Expected format: digits.`);r=parseInt(e[1],10)}if(!Ae.includes(o.items.type))throw new Error('The property "associated_entity" with array type should reference scalar properties only.');a&&ge.validateProp(i,t,o.items),this._props[i]||(this._props[i]=[]),null!=t?this._props[i][r]=t:this._props[i].splice(r,1)}setCollection(e,t,s){(0,be.A)(e);const n=e.split("."),i=n[0];let r=null;if(1===n.length)t instanceof this.constructor.associations[e]?this[`_${i}`]=t:this[`_${i}`]=new this.constructor.associations[e](t,s);else{if(!(n.length>1))throw new Error(`The property "${n[0]}" has no index passed.`);{const e=n[1].match(/^(\d+)$/);if(!e)throw new Error(`The property "${n[0]}" has an invalid index format. Expected format: digits.`);r=parseInt(e[1],10)}}if(!this[`_${i}`])throw new Error(`The collection "${n[0]}" has no item".`);if(null!=t)if(n.length>2){if(!this[`_${i}`]._items[r])throw new Error(`The collection "${n[0]}" has no item at the index "${n[1]}".`);const e=n.slice(2).join(".");this[`_${i}`]._items[r].set(e,t,s)}else this[`_${i}`].push(t,s,s);else this[`_${i}`].items.splice(r,1)}setAssociation(e,t,s={}){if((0,be.A)(e),this.isAssociation(e)){const n=e.split("."),i=fe(n[0]);if(n.length>1)if(this[`_${i}`]||(this[`_${i}`]=new this.constructor.associations[n[0]]({},{validate:!1})),this[`_${i}`]instanceof ve){const e=n.toSpliced(0,1,i).join(".");this.setCollection(e,t,s)}else{const e=n.slice(1).join(".");this[`_${i}`].set(e,t,s)}else t instanceof this.constructor.associations[e]?this[`_${i}`]=t:this[`_${i}`]=new this.constructor.associations[e](t,s)}}validateAssociations(e={}){const t=new pe;if(Object.keys(this.constructor.associations).length>0&&Object.keys(this.constructor.associations).forEach(s=>{const n=fe(s);if(this[`_${n}`]){const i=this[n].validate(e);i&&t.addAssociationError(s,i)}}),t.hasErrors())throw t}diffProps(e){if(!(e instanceof Re))throw new TypeError('The property "compareEntity" should be of "EntityV2" type.');const t={},s=this.constructor.getSchema(),n=Object.keys(s.properties).filter(e=>Ae.includes(s.properties[e].type));for(const s of n){const n=this.get(s),i=e.get(s);n!==i&&(t[s]=i)}return t}hasDiffProps(e){const t=this.diffProps(e);return Object.keys(t).length>0}isAssociation(e){const t=e.split(".")[0];return Boolean(this.constructor.associations?.[t])}}const Ce=Re;class xe extends Ce{static getSchema(){return{type:"object",required:["name"],properties:{id:{type:"string",format:"uuid"},name:{type:"string",minLength:1,maxLength:50},description:{type:"string",maxLength:255,nullable:!0},created:{type:"string",format:"date-time"},modified:{type:"string",format:"date-time"}}}}validateBuildRules(){this.assertNoTrailingSpaces("name",this._props.name)}get id(){return this._props.id||null}get name(){return this._props.name}isAdmin(){return this.name.toLowerCase()===xe.ROLE_ADMIN}isUser(){return this.name.toLowerCase()===xe.ROLE_USER}isGuest(){return this.name.toLowerCase()===xe.ROLE_GUEST}isAReservedRole(){return this.isAdmin()||this.isUser()||this.isGuest()}verifyHealth(){let e=null;return 50===this.name.length&&(e=new pe,e.addError("name","maxLength","name reached maximum length limit")),e}assertNoTrailingSpaces(e,t){if(t.trim()!==t){const t=new pe;throw t.addError(e,"trailing-spaces",`The property (${e}) contains forbidden trailing spaces.`),t}}static get ENTITY_NAME(){return"Role"}static get ROLE_ADMIN(){return"admin"}static get ROLE_USER(){return"user"}static get ROLE_GUEST(){return"guest"}static get ROLE_NAME_MAX_LENGTH(){return 50}toUpdateDto(){return{name:this.name}}}class Ne{static canRoleUseAction(e,t,s){if(window.chrome?.webview){const n=t.findRbacByActionName(s);if(n)return ae.getByRbac(n).execute(e)}const n=new xe(e.role);if(n.isAdmin())return ae.getDefaultForAdminAndAction(s).execute();const i=t.findRbacByRoleAndActionName(n,s);return this.getByRbacOrDefault(i,s,e)}static getByRbacOrDefault(e,t,s){return e?ae.getByRbac(e).execute(s):ae.getDefaultForUserAndAction(t).execute()}}function Oe(){return Oe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var n in s)({}).hasOwnProperty.call(s,n)&&(e[n]=s[n])}return e},Oe.apply(null,arguments)}const Ie=n.createContext({canIUseAction:()=>{}});class Pe extends n.Component{constructor(e){super(e),this.state=this.defaultState}get defaultState(){return{canIUseAction:this.canIUseAction.bind(this)}}canIUseAction(e){return Ne.canRoleUseAction(this.props.context.loggedInUser,this.props.context.rbacs,e)}render(){return n.createElement(Ie.Provider,{value:this.state},this.props.children)}}function _e(){return _e=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var n in s)({}).hasOwnProperty.call(s,n)&&(e[n]=s[n])}return e},_e.apply(null,arguments)}Pe.propTypes={context:d().any,children:d().any},a(Pe);const ke=n.createContext({selectedAdministration:null,can:{save:!1},must:{save:!1,editSubscriptionKey:!1,refreshSubscriptionKey:!1},administrationWorkspaceAction:null,setDisplayAdministrationWorkspaceAction:()=>{},resetDisplayAdministrationWorkspaceAction:()=>{},onUpdateSubscriptionKeyRequested:()=>{},onSaveEnabled:()=>{},onMustSaveSettings:()=>{},onMustEditSubscriptionKey:()=>{},onMustRefreshSubscriptionKey:()=>{},onResetActionsSettings:()=>{}});class De extends n.Component{constructor(e){super(e),this.state=this.defaultState}get defaultState(){return{selectedAdministration:Ge.NONE,can:{save:!1},must:{save:!1,editSubscriptionKey:!1,refreshSubscriptionKey:!1},administrationWorkspaceAction:()=>n.createElement(n.Fragment,null),setDisplayAdministrationWorkspaceAction:this.setDisplayAdministrationWorkspaceAction.bind(this),resetDisplayAdministrationWorkspaceAction:this.resetDisplayAdministrationWorkspaceAction.bind(this),onSaveEnabled:this.handleSaveEnabled.bind(this),onMustSaveSettings:this.handleMustSaveSettings.bind(this),onMustEditSubscriptionKey:this.handleMustEditSubscriptionKey.bind(this),onMustRefreshSubscriptionKey:this.handleMustRefreshSubscriptionKey.bind(this),onResetActionsSettings:this.handleResetActionsSettings.bind(this)}}componentDidMount(){this.handleAdministrationMenuRouteChange()}componentDidUpdate(e){this.handleRouteChange(e.location)}handleSaveEnabled(){this.setState({can:{...this.state.can,save:!0}})}handleMustSaveSettings(){this.setState({must:{...this.state.must,save:!0}})}handleMustEditSubscriptionKey(){this.setState({must:{...this.state.must,editSubscriptionKey:!0}})}handleMustRefreshSubscriptionKey(){this.setState({must:{...this.state.must,refreshSubscriptionKey:!0}})}handleResetActionsSettings(){this.setState({must:{save:!1,test:!1,synchronize:!1,editSubscriptionKey:!1,refreshSubscriptionKey:!1}})}handleRouteChange(e){this.props.location.key!==e.key&&this.handleAdministrationMenuRouteChange()}handleAdministrationMenuRouteChange(){const e={can:{save:!1,test:!1,synchronize:!1},must:{save:!1,test:!1,synchronize:!1,editSubscriptionKey:!1,refreshSubscriptionKey:!1}};if(!this.props.rbacContext.canIUseAction(X))return e.selectedAdministration=Ge.HTTP_403_ACCESS_DENIED,void this.setState(e);const t=this.props.location.pathname,s=Me.homePage.test(t),n=Me.mfa.test(t),i=Me.mfaPolicy.test(t),r=Me.passwordPolicies.test(t),o=Me.usersDirectory.test(t),a=Me.emailNotification.test(t),l=Me.subscription.test(t),c=Me.internationalization.test(t),d=Me.accountRecovery.test(t),p=Me.smtpSettings.test(t),u=Me.selfRegistration.test(t),h=Me.sso.test(t),m=Me.rbac.test(t),g=Me.userPassphrasePolicies.test(t),E=Me.passwordExpirySettings.test(t),y=Me.healthcheck.test(t),b=Me.contentTypesEncryptedMetadata.test(t),f=Me.contentTypesMetadataKey.test(t),T=Me.migrateEncryptedMetadata.test(t),S=Me.allowContentTypes.test(t),w=Me.gettingStarted.test(t),v=Me.scim.test(t),A=Me.secretHistory.test(t),R=Me.ceDowngrade.test(t),C=Me.mfaPolicyTeasing.test(t),x=Me.passwordPoliciesTeasing.test(t),N=Me.usersDirectoryTeasing.test(t),O=Me.subscriptionTeasing.test(t),I=Me.accountRecoveryTeasing.test(t),P=Me.userPassphrasePoliciesTeasing.test(t),_=Me.ssoTeasing.test(t),k=Me.scimTeasing.test(t);let D;if(s?D=Ge.HOME:i||C?D=Ge.MFA_POLICY:r||x?D=Ge.PASSWORD_POLICIES:n?D=Ge.MFA:o||N?D=Ge.USER_DIRECTORY:a?D=Ge.EMAIL_NOTIFICATION:l||O?D=Ge.SUBSCRIPTION:c?D=Ge.INTERNATIONALIZATION:d||I?D=Ge.ACCOUNT_RECOVERY:p?D=Ge.SMTP_SETTINGS:u?D=Ge.SELF_REGISTRATION:h||_?D=Ge.SSO:m?D=Ge.RBAC:g||P?D=Ge.USER_PASSPHRASE_POLICIES:E?D=Ge.PASSWORD_EXPIRY:y?D=Ge.HEALTHCHECK:b?D=Ge.CONTENT_TYPES_ENCRYPTED_METADATA:f?D=Ge.CONTENT_TYPES_METADATA_KEY:T?D=Ge.MIGRATE_METADATA:S?D=Ge.ALLOW_CONTENT_TYPES:w?D=Ge.METADATA_GETTING_STARTED:v||k?D=Ge.SCIM:A?D=Ge.SECRET_HISTORY:R&&(D=Ge.CE_DOWNGRADE),!D)return e.selectedAdministration=Ge.HTTP_404_NOT_FOUND,void this.setState(e);const U=Le?.[D];e.selectedAdministration=U&&!(this.props.context.siteSettings.canIUse(U)||$e.includes(D)&&this.props.context.siteSettings.isCommunityEdition)?Ge.HTTP_404_NOT_FOUND:D,this.setState(e)}setDisplayAdministrationWorkspaceAction(e){this.setState({administrationWorkspaceAction:e})}resetDisplayAdministrationWorkspaceAction(){this.setState({administrationWorkspaceAction:()=>n.createElement(n.Fragment,null)})}render(){return n.createElement(ke.Provider,{value:this.state},this.props.children)}}var Ue;function qe(e){return class extends n.Component{render(){return n.createElement(ke.Consumer,null,t=>n.createElement(e,_e({administrationWorkspaceContext:t},this.props)))}}}De.displayName="AdministrationWorkspaceContextProvider",De.propTypes={context:d().object,children:d().any,location:d().object,match:d().object,history:d().object,loadingContext:d().object,rbacContext:d().object},(0,M.withRouter)(a(function(e){return class extends n.Component{render(){return n.createElement(Ie.Consumer,null,t=>n.createElement(e,Oe({rbacContext:t},this.props)))}}}((Ue=De,class extends n.Component{render(){return n.createElement(V.Consumer,null,e=>n.createElement(Ue,K({loadingContext:e},this.props)))}}))));const Ge={NONE:"NONE",HOME:"HOME",MFA:"MFA",MFA_POLICY:"MFA-POLICY",PASSWORD_POLICIES:"PASSWORD-POLICIES",USER_DIRECTORY:"USER-DIRECTORY",EMAIL_NOTIFICATION:"EMAIL-NOTIFICATION",SUBSCRIPTION:"SUBSCRIPTION",INTERNATIONALIZATION:"INTERNATIONALIZATION",ACCOUNT_RECOVERY:"ACCOUNT-RECOVERY",SMTP_SETTINGS:"SMTP-SETTINGS",SELF_REGISTRATION:"SELF-REGISTRATION",SSO:"SSO",RBAC:"RBAC",USER_PASSPHRASE_POLICIES:"USER-PASSPHRASE-POLICIES",PASSWORD_EXPIRY:"PASSWORD-EXPIRY",HTTP_403_ACCESS_DENIED:"403-ACCESS-DENIED",HTTP_404_NOT_FOUND:"404-NOT-FOUND",HEALTHCHECK:"HEALTHCHECK",CONTENT_TYPES_ENCRYPTED_METADATA:"CONTENT_TYPES_ENCRYPTED_METADATA",CONTENT_TYPES_METADATA_KEY:"CONTENT_TYPES_METADATA_KEY",MIGRATE_METADATA:"MIGRATE_METADATA",ALLOW_CONTENT_TYPES:"ALLOW_CONTENT_TYPES",METADATA_GETTING_STARTED:"METADATA_GETTING_STARTED",SCIM:"SCIM",SECRET_HISTORY:"SECRET_HISTORY",CE_DOWNGRADE:"DOWNGRADE-TO-CE"},Le={[Ge.MFA]:"multiFactorAuthentication",[Ge.MFA_POLICY]:"mfaPolicies",[Ge.PASSWORD_POLICIES]:"passwordPoliciesUpdate",[Ge.USER_DIRECTORY]:"directorySync",[Ge.SUBSCRIPTION]:"ee",[Ge.INTERNATIONALIZATION]:"locale",[Ge.ACCOUNT_RECOVERY]:"accountRecovery",[Ge.SMTP_SETTINGS]:"smtpSettings",[Ge.SELF_REGISTRATION]:"selfRegistration",[Ge.SSO]:"sso",[Ge.RBAC]:"rbacs",[Ge.USER_PASSPHRASE_POLICIES]:"userPassphrasePolicies",[Ge.PASSWORD_EXPIRY]:"passwordExpiry",[Ge.HEALTHCHECK]:"healthcheckUi",[Ge.CONTENT_TYPES_ENCRYPTED_METADATA]:"metadata",[Ge.CONTENT_TYPES_METADATA_KEY]:"metadata",[Ge.MIGRATE_METADATA]:"metadata",[Ge.ALLOW_CONTENT_TYPES]:"metadata",[Ge.METADATA_GETTING_STARTED]:"metadata",[Ge.SCIM]:"scim",[Ge.SECRET_HISTORY]:"secretRevisions",[Ge.CE_DOWNGRADE]:"ee"},Me={homePage:/^\/app\/administration\/?$/,mfa:/^\/app\/administration\/mfa\/?$/,mfaPolicy:/^\/app\/administration\/mfa-policy\/?$/,mfaPolicyTeasing:/^\/app\/administration\/mfa-policy-teasing\/?$/,passwordPolicies:/^\/app\/administration\/password-policies\/?$/,passwordPoliciesTeasing:/^\/app\/administration\/password-policies-teasing\/?$/,usersDirectory:/^\/app\/administration\/users-directory\/?$/,usersDirectoryTeasing:/^\/app\/administration\/users-directory-teasing\/?$/,emailNotification:/^\/app\/administration\/email-notification\/?$/,subscription:/^\/app\/administration\/subscription\/?$/,subscriptionTeasing:/^\/app\/administration\/subscription-teasing\/?$/,internationalization:/^\/app\/administration\/internationalization\/?$/,accountRecovery:/^\/app\/administration\/account-recovery\/?$/,accountRecoveryTeasing:/^\/app\/administration\/account-recovery-teasing\/?$/,smtpSettings:/^\/app\/administration\/smtp-settings\/?$/,selfRegistration:/^\/app\/administration\/self-registration\/?$/,sso:/^\/app\/administration\/sso\/?$/,ssoTeasing:/^\/app\/administration\/sso-teasing\/?$/,rbac:/^\/app\/administration\/rbacs\/?$/,userPassphrasePolicies:/^\/app\/administration\/user-passphrase-policies\/?$/,userPassphrasePoliciesTeasing:/^\/app\/administration\/user-passphrase-policies-teasing\/?$/,passwordExpirySettings:/^\/app\/administration\/password-expiry\/?$/,healthcheck:/^\/app\/administration\/healthcheck\/?$/,contentTypesEncryptedMetadata:/^\/app\/administration\/content-types\/metadata\/?$/,contentTypesMetadataKey:/^\/app\/administration\/content-types\/metadata-key\/?$/,migrateEncryptedMetadata:/^\/app\/administration\/migrate-metadata\/?$/,allowContentTypes:/^\/app\/administration\/allow-content-types\/?$/,gettingStarted:/^\/app\/administration\/content-types\/metadata-getting-started\/?$/,scim:/^\/app\/administration\/user-provisionning\/scim\/?$/,scimTeasing:/^\/app\/administration\/scim-teasing\/?$/,secretHistory:/^\/app\/administration\/secret-history\/?$/,ceDowngrade:/^\/app\/administration\/ce-downgrade\/?$/},$e=[Ge.SUBSCRIPTION,Ge.PASSWORD_POLICIES,Ge.USER_PASSPHRASE_POLICIES,Ge.ACCOUNT_RECOVERY,Ge.SSO,Ge.MFA_POLICY,Ge.USER_DIRECTORY,Ge.SCIM],Fe=class{constructor(e){this.customerId=e?.customer_id||"",this.subscriptionId=e?"subscription_id"in e?e.subscription_id:"N/A":"",this.users=e?.users||null,this.email=e?"email"in e?e.email:"N/A":"",this.expiry=e?.expiry||null,this.created=e?.created||null,this.data=e?.data||null}};function je(){return je=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var n in s)({}).hasOwnProperty.call(s,n)&&(e[n]=s[n])}return e},je.apply(null,arguments)}const Ke=n.createContext({getSubscription:()=>{},findSubscriptionKey:()=>{},isProcessing:()=>{},setProcessing:()=>{},getActiveUsers:()=>{},clearContext:()=>{}});class Ve extends n.Component{constructor(e){super(e),this.state=this.defaultState}get defaultState(){return{subscription:new Fe,processing:!1,getSubscription:this.getSubscription.bind(this),findSubscriptionKey:this.findSubscriptionKey.bind(this),isProcessing:this.isProcessing.bind(this),setProcessing:this.setProcessing.bind(this),getActiveUsers:this.getActiveUsers.bind(this),clearContext:this.clearContext.bind(this)}}async findSubscriptionKey(){this.setProcessing(!0);let e=new Fe;try{const t=await this.props.context.onGetSubscriptionKeyRequested();e=new Fe(t.toDto())}catch(t){"PassboltSubscriptionError"===t.name&&(e=new Fe(t.subscription))}finally{this.setState({subscription:e}),this.setProcessing(!1)}}async getActiveUsers(){return(await this.props.context.port.request("passbolt.users.get-all")).filter(e=>e.active).length}getSubscription(){return this.state.subscription}isProcessing(){return this.state.processing}setProcessing(e){this.setState({processing:e})}clearContext(){const{subscription:e,processing:t}=this.defaultState;this.setState({subscription:e,processing:t})}render(){return n.createElement(Ke.Provider,{value:this.state},this.props.children)}}function Be(e){return class extends n.Component{render(){return n.createElement(Ke.Consumer,null,t=>n.createElement(e,je({adminSubscriptionContext:t},this.props)))}}}var He;function We(){return We=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var n in s)({}).hasOwnProperty.call(s,n)&&(e[n]=s[n])}return e},We.apply(null,arguments)}Ve.propTypes={context:d().any,children:d().any},a(Ve);const Ye=function(e){return n.createElement("svg",We({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none",viewBox:"0 0 16 16"},e),He||(He=n.createElement("path",{stroke:"var(--icon-color)",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"m12 4-8 8M4 4l8 8"})))};class ze extends n.Component{constructor(e){super(e),this.bindCallbacks()}bindCallbacks(){this.handleCloseClick=this.handleCloseClick.bind(this)}handleCloseClick(){this.props.onClose()}render(){return n.createElement("button",{type:"button",disabled:this.props.disabled,className:"dialog-close button button-transparent",onClick:this.handleCloseClick},n.createElement(Ye,{className:"svg-icon close"}),n.createElement("span",{className:"visually-hidden"},n.createElement(I.x6,null,"Close")))}}ze.propTypes={onClose:d().func,disabled:d().bool};const Xe=(0,I.CI)("common")(ze);var Je;function Ze(){return Ze=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var n in s)({}).hasOwnProperty.call(s,n)&&(e[n]=s[n])}return e},Ze.apply(null,arguments)}const Qe=function(e){return n.createElement("svg",Ze({xmlns:"http://www.w3.org/2000/svg",width:17,height:18,fill:"none",viewBox:"0 0 17 18"},e),Je||(Je=n.createElement("path",{stroke:"var(--icon-color)",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M8.5 16.5a7.5 7.5 0 1 0 0-15 7.5 7.5 0 0 0 0 15M8.5 12V9M8.5 6h.008"})))};class et extends n.Component{constructor(e){super(e),this.bindCallbacks()}bindCallbacks(){this.handleKeyDown=this.handleKeyDown.bind(this),this.handleClose=this.handleClose.bind(this)}handleKeyDown(e){27===e.keyCode&&this.handleClose()}handleClose(){this.props.disabled||this.props.onClose()}componentDidMount(){document.addEventListener("keydown",this.handleKeyDown,{capture:!1})}componentWillUnmount(){document.removeEventListener("keydown",this.handleKeyDown,{capture:!1})}render(){return n.createElement("div",{className:`${this.props.className} dialog-wrapper`},n.createElement("div",{className:"dialog"},n.createElement("div",{className:"dialog-header"},n.createElement("div",{className:"dialog-title-wrapper"},n.createElement("h2",null,n.createElement("span",{className:"dialog-header-title"},this.props.title),this.props.subtitle&&n.createElement("span",{className:"dialog-header-subtitle"},this.props.subtitle)),this.props.tooltip&&""!==this.props.tooltip&&n.createElement(_,{message:this.props.tooltip},n.createElement(Qe,null))),n.createElement(Xe,{onClose:this.handleClose,disabled:this.props.disabled})),n.createElement("div",{className:"dialog-content"},this.props.children)))}}et.propTypes={children:d().node,className:d().string,title:d().oneOfType([d().arrayOf(d().node),d().node,d().string]),subtitle:d().string,tooltip:d().string,disabled:d().bool,onClose:d().func};const tt=et;function st(){return st=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var n in s)({}).hasOwnProperty.call(s,n)&&(e[n]=s[n])}return e},st.apply(null,arguments)}const nt=n.createContext({feedbacks:[],displaySuccess:()=>{},displayWarning:()=>{},displayError:()=>{},remove:()=>{}});class it extends n.Component{constructor(e){super(e),this.state=this.defaultState}get defaultState(){return{feedbacks:[],displaySuccess:this.displaySuccess.bind(this),displayWarning:this.displayWarning.bind(this),displayError:this.displayError.bind(this),remove:this.remove.bind(this)}}displaySuccess(e){this.setState({feedbacks:[...this.state.feedbacks,{id:(0,D.A)(),type:"success",message:e}]})}displayWarning(e){this.setState({feedbacks:[...this.state.feedbacks,{id:(0,D.A)(),type:"warning",message:e}]})}displayError(e){this.setState({feedbacks:[...this.state.feedbacks,{id:(0,D.A)(),type:"error",message:e}]})}remove(e){this.setState(t=>({feedbacks:t.feedbacks.filter(t=>e.id!==t.id)}))}render(){return n.createElement(nt.Provider,{value:this.state},this.props.children)}}var rt;function ot(){return ot=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var n in s)({}).hasOwnProperty.call(s,n)&&(e[n]=s[n])}return e},ot.apply(null,arguments)}it.displayName="ActionFeedbackContextProvider",it.propTypes={children:d().any};const at=function(e){return n.createElement("svg",ot({xmlns:"http://www.w3.org/2000/svg",width:10,height:8,fill:"none",viewBox:"0 0 10 8"},e),rt||(rt=n.createElement("path",{stroke:"var(--icon-color)",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"m1 2 4 4 4-4"})))};var lt;function ct(){return ct=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var n in s)({}).hasOwnProperty.call(s,n)&&(e[n]=s[n])}return e},ct.apply(null,arguments)}const dt=function(e){return n.createElement("svg",ct({xmlns:"http://www.w3.org/2000/svg",width:8,height:10,fill:"none",viewBox:"0 0 8 10"},e),lt||(lt=n.createElement("path",{stroke:"var(--icon-color)",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"m2 9 4-4-4-4"})))};class pt extends n.Component{constructor(e){super(e),this.state=this.defaultState,this.bindCallbacks()}get defaultState(){return{showErrorDetails:!1}}bindCallbacks(){this.handleKeyDown=this.handleKeyDown.bind(this),this.handleErrorDetailsToggle=this.handleErrorDetailsToggle.bind(this)}componentDidMount(){document.addEventListener("keydown",this.handleKeyDown,{capture:!0})}componentWillUnmount(){document.removeEventListener("keydown",this.handleKeyDown,{capture:!0})}getTitle(){return this.props.title?this.props.title:this.props.t("There was an unexpected error...")}getMessage(){return this.props.error.message}handleKeyDown(e){27!==e.keyCode&&13!==e.keyCode||(e.stopPropagation(),this.props.onClose())}handleErrorDetailsToggle(){this.setState({showErrorDetails:!this.state.showErrorDetails})}get hasErrorDetails(){return Boolean(this.props.error.data?.body)||Boolean(this.props.error.details)}formatErrors(){const e=this.props.error?.details||this.props.error?.data;return JSON.stringify(e,null,4)}render(){return n.createElement(tt,{className:"dialog-wrapper error-dialog",onClose:this.props.onClose,title:this.getTitle()},n.createElement("div",{className:"form-content"},n.createElement("p",null,this.getMessage()),this.hasErrorDetails&&n.createElement("div",{className:"accordion error-details"},n.createElement("div",{className:"accordion-header"},n.createElement("button",{type:"button",className:"link no-border",onClick:this.handleErrorDetailsToggle},n.createElement("span",null,n.createElement(I.x6,null,"Error details")),this.state.showErrorDetails?n.createElement(at,{className:"baseline svg-icon"}):n.createElement(dt,{className:"baseline svg-icon"}))),this.state.showErrorDetails&&n.createElement("div",{className:"accordion-content"},n.createElement("div",{className:"input text"},n.createElement("label",{htmlFor:"js_field_debug",className:"visuallyhidden"},n.createElement(I.x6,null,"Error details")),n.createElement("textarea",{id:"js_field_debug",defaultValue:this.formatErrors(),readOnly:!0}))))),n.createElement("div",{className:"submit-wrapper clearfix"},n.createElement("button",{type:"button",className:"button primary warning",onClick:this.props.onClose},"Ok")))}}pt.propTypes={title:d().string,error:d().object.isRequired,onClose:d().func,t:d().func};const ut=(0,I.CI)("common")(pt);var ht,mt;function gt(){return gt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var n in s)({}).hasOwnProperty.call(s,n)&&(e[n]=s[n])}return e},gt.apply(null,arguments)}const Et=function(e){return n.createElement("svg",gt({width:18,height:18,fill:"none",className:"svg-icon spinner",viewBox:"0 0 18 18"},e),ht||(ht=n.createElement("circle",{id:"background",cx:8,cy:8,r:8,fill:"none",stroke:"var(--spinner-background)",strokeWidth:"var(--spinner-stroke-width)",transform:"translate(1 1)"})),mt||(mt=n.createElement("circle",{id:"loading",r:8,fill:"none",stroke:"var(--spinner-color)",strokeLinecap:"round",strokeWidth:"var(--spinner-stroke-width)",transform:"translate(9 9)"})))};class yt extends n.Component{constructor(e){super(e),this.bindCallbacks()}bindCallbacks(){this.getClassName=this.getClassName.bind(this)}getClassName(){let e="button primary form";return this.props.warning?e+=" warning":this.props.attention&&(e+=" attention"),this.props.disabled&&(e+=" disabled"),this.props.processing&&(e+=" processing"),this.props.big&&(e+=" big"),this.props.medium&&(e+=" medium"),this.props.fullWidth&&(e+=" full-width"),e}render(){return n.createElement("button",{type:"submit",className:this.getClassName(),disabled:this.props.disabled},this.props.value||n.createElement(I.x6,null,"Save"),this.props.processing&&n.createElement(Et,null))}}yt.defaultProps={warning:!1,attention:!1},yt.propTypes={processing:d().bool,disabled:d().bool,value:d().oneOfType([d().arrayOf(d().node),d().node,d().string]),warning:d().bool,attention:d().bool,big:d().bool,medium:d().bool,fullWidth:d().bool};const bt=(0,I.CI)("common")(yt);class ft extends n.Component{constructor(e){super(e),this.bindCallbacks()}bindCallbacks(){this.handleClick=this.handleClick.bind(this)}handleClick(){this.props.disabled||this.props.onClick()}render(){return n.createElement("button",{type:"button",disabled:this.props.disabled,className:"link cancel",onClick:this.handleClick},this.props.value)}}ft.defaultProps={value:n.createElement(I.x6,null,"Cancel")},ft.propTypes={disabled:d().bool,onClick:d().func,value:d().oneOfType([d().arrayOf(d().node),d().node,d().string])};const Tt=(0,I.CI)("common")(ft),St=class extends Ce{static getSchema(){return{type:"object",required:["subscription_id","users","expiry","created","data"],properties:{customer_id:{type:"string"},subscription_id:{type:"string"},users:{type:"integer"},email:{type:"string",format:"email"},created:{type:"string",format:"date-time"},expiry:{type:"string",format:"date-time"},data:{type:"string"}}}}get expiry(){return this._props.expiry}toDto(){return Object.assign({},this._props)}toJSON(){return this.toDto()}static get ENTITY_NAME(){return"Subscription"}},wt=class{constructor(e){this.port=e}async createOrganizationSubscriptionKey(e){(0,be.A)(e);const t=await this.port.request("passbolt.subscription.create",{data:e});return new St(t)}async findOrganizationSubscriptionKey(){const e=await this.port.request("passbolt.subscription.get");return new St(e)}async updateOrganizationSubscriptionKey(e){(0,be.A)(e);const t=await this.port.request("passbolt.subscription.update",{data:e});return new St(t)}async deleteOrganizationSubscriptionKey(){await this.port.request("passbolt.subscription.downgrade")}};class vt extends n.Component{constructor(e){super(e),this.state=this.getDefaultState(),this.initEventHandlers(),this.createInputRef(),this.subscriptionKeyService=new wt(e.context.port)}getDefaultState(){return{selectedFile:null,key:"",keyError:"",processing:!1,hasBeenValidated:!1}}initEventHandlers(){this.handleCloseClick=this.handleCloseClick.bind(this),this.handleFormSubmit=this.handleFormSubmit.bind(this),this.handleInputChange=this.handleInputChange.bind(this),this.handleKeyInputKeyUp=this.handleKeyInputKeyUp.bind(this),this.handleSelectSubscriptionKeyFile=this.handleSelectSubscriptionKeyFile.bind(this),this.handleSelectFile=this.handleSelectFile.bind(this)}createInputRef(){this.keyInputRef=n.createRef(),this.fileUploaderRef=n.createRef()}componentDidMount(){this.setState({key:this.props.context.editSubscriptionKey?.key||""})}async handleFormSubmit(e){e.preventDefault(),this.state.processing||await this.save()}handleInputChange(e){const t=e.target,s=t.value,n=t.name;this.setState({[n]:s})}handleKeyInputKeyUp(){if(this.state.hasAlreadyBeenValidated){const e=this.validateNameInput();this.setState(e)}}handleCloseClick(){this.props.context.setContext({editSubscriptionKey:null}),this.props.onClose()}handleSelectFile(){this.fileUploaderRef.current.click()}get selectedFilename(){return this.state.selectedFile?this.state.selectedFile.name:""}async handleSelectSubscriptionKeyFile(e){const[t]=e.target.files,s=await this.readSubscriptionKeyFile(t);this.setState({key:s,selectedFile:t}),this.state.hasBeenValidated&&await this.validate()}readSubscriptionKeyFile(e){const t=new FileReader;return new Promise((s,n)=>{t.onloadend=()=>{try{s(t.result)}catch(e){n(e)}},t.readAsText(e)})}async save(){if(!this.state.processing){if(this.setState({hasBeenValidated:!0,processing:!0}),!await this.validate())return this.handleValidateError(),void this.setState({processing:!1});try{this.props.onSave?await this.props.onSave(this.state.key):await this.subscriptionKeyService.updateOrganizationSubscriptionKey(this.state.key),await this.handleSaveSuccess(),await this.props.adminSubscriptionContext.findSubscriptionKey()}catch(e){this.setState({processing:!1}),this.handleSaveError(e),this.focusFieldError()}}}handleValidateError(){this.focusFieldError()}async handleSaveSuccess(){await this.props.actionFeedbackContext.displaySuccess(this.translate("The subscription key has been updated successfully.")),this.props.administrationWorkspaceContext.onMustRefreshSubscriptionKey(),this.props.context.setContext({editSubscriptionKey:null,refreshSubscriptionAnnouncement:!0}),this.props.onClose()}handleSaveError(e){if("PassboltSubscriptionError"===e.name)this.setState({keyError:e.message});else if("EntityValidationError"===e.name)this.setState({keyError:this.translate("The subscription key is invalid.")});else if("PassboltApiFetchError"===e.name&&e.data&&400===e.data.code)this.setState({keyError:e.message});else{console.error(e);const t={error:e};this.props.dialogContext.open(ut,t)}}focusFieldError(){this.state.keyError&&this.keyInputRef.current.focus()}validateKeyInput(){const e=this.state.key.trim();let t="";return e.length||(t=this.translate("A subscription key is required.")),new Promise(e=>{this.setState({keyError:t},e)})}async validate(){return this.setState({keyError:""}),await this.validateKeyInput(),""===this.state.keyError}hasAllInputDisabled(){return this.state.processing}get translate(){return this.props.t}render(){return n.createElement(tt,{title:this.props.title??this.translate("Edit subscription key"),onClose:this.handleCloseClick,disabled:this.state.processing,className:"edit-subscription-dialog"},n.createElement("form",{onSubmit:this.handleFormSubmit,noValidate:!0},n.createElement("div",{className:"form-content"},n.createElement("div",{className:`input textarea required ${this.state.keyError?"error":""} ${this.hasAllInputDisabled()?"disabled":""}`},n.createElement("label",{htmlFor:"edit-tag-form-name"},n.createElement(I.x6,null,"Subscription key")),n.createElement("textarea",{id:"edit-subscription-form-key",name:"key",value:this.state.key,onKeyUp:this.handleKeyInputKeyUp,onChange:this.handleInputChange,disabled:this.hasAllInputDisabled(),ref:this.keyInputRef,className:"required full_report",required:"required",autoComplete:"off",autoFocus:!0})),n.createElement("div",{className:"input file "+(this.hasAllInputDisabled()?"disabled":"")},n.createElement("input",{type:"file",ref:this.fileUploaderRef,disabled:this.hasAllInputDisabled(),onChange:this.handleSelectSubscriptionKeyFile}),n.createElement("div",{className:"input-file-inline"},n.createElement("input",{type:"text",disabled:!0,placeholder:this.translate("No key file selected"),value:this.selectedFilename}),n.createElement("button",{type:"button",className:"button primary",onClick:this.handleSelectFile,disabled:this.hasAllInputDisabled()},n.createElement("span",null,n.createElement(I.x6,null,"Choose a file")))),this.state.keyError&&n.createElement("div",{className:"key error-message"},this.state.keyError),this.props.warning&&n.createElement("p",null,this.props.warning))),n.createElement("div",{className:"submit-wrapper clearfix"},n.createElement(Tt,{disabled:this.hasAllInputDisabled(),onClick:this.handleCloseClick}),n.createElement(bt,{disabled:this.hasAllInputDisabled(),processing:this.state.processing,value:this.translate("Save")}))))}}vt.propTypes={context:d().any,onClose:d().func,actionFeedbackContext:d().any,adminSubscriptionContext:d().object,dialogContext:d().any,administrationWorkspaceContext:d().any,title:d().string,warning:d().string,onSave:d().func,t:d().func};const At=a(Be(qe(function(e){return class extends n.Component{render(){return n.createElement(nt.Consumer,null,t=>n.createElement(e,st({actionFeedbackContext:t},this.props)))}}}(L((0,I.CI)("common")(vt))))));class Rt{constructor(e){this.context=e.context,this.dialogContext=e.dialogContext,this.subscriptionContext=e.adminSubscriptionContext}static getInstance(e){return this.instance||(this.instance=new Rt(e)),this.instance}static killInstance(){this.instance=null}editSubscription(){const e={key:this.subscriptionContext.getSubscription().data};this.context.setContext({editSubscriptionKey:e}),this.dialogContext.open(At)}}const Ct=Rt;var xt=s(961);var Nt,Ot;function It(){return It=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var n in s)({}).hasOwnProperty.call(s,n)&&(e[n]=s[n])}return e},It.apply(null,arguments)}const Pt=function(e){return n.createElement("svg",It({xmlns:"http://www.w3.org/2000/svg",width:18,height:18,fill:"none",viewBox:"0 0 18 18"},e),Nt||(Nt=n.createElement("path",{stroke:"var(--icon-color)",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M15 3H3a1.5 1.5 0 0 0-1.5 1.5v9A1.5 1.5 0 0 0 3 15h12a1.5 1.5 0 0 0 1.5-1.5v-9A1.5 1.5 0 0 0 15 3"})),Ot||(Ot=n.createElement("path",{stroke:"var(--icon-color)",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M16.5 5.25 9.773 9.525a1.46 1.46 0 0 1-1.546 0L1.5 5.25"})))};var _t;function kt(){return kt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var n in s)({}).hasOwnProperty.call(s,n)&&(e[n]=s[n])}return e},kt.apply(null,arguments)}const Dt=function(e){return n.createElement("svg",kt({xmlns:"http://www.w3.org/2000/svg",width:18,height:18,fill:"none",viewBox:"0 0 18 18"},e),_t||(_t=n.createElement("path",{stroke:"var(--icon-color)",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"m16.298 13.5-6-10.5a1.5 1.5 0 0 0-2.61 0l-6 10.5A1.5 1.5 0 0 0 3 15.75h12a1.5 1.5 0 0 0 1.297-2.25M9 6.75v3M9 12.75h.008"})))},Ut="Pro Edition",qt="Community Edition";class Gt extends n.Component{constructor(e){super(e),this.state=this.defaultState,this.bindCallbacks(),this.subscriptionActionService=Ct.getInstance(this.props),this.subscriptionKeyService=new wt(this.props.context.port)}get defaultState(){return{activeUsers:null}}async componentDidMount(){this.props.context.siteSettings.isCommunityEdition&&this.hasEditionPlugin()||this.props.adminSubscriptionContext.findSubscriptionKey();const e=await this.props.adminSubscriptionContext.getActiveUsers();this.setState({activeUsers:e})}componentWillUnmount(){this.props.adminSubscriptionContext.clearContext(),Ct.killInstance()}bindCallbacks(){this.handleRenewKey=this.handleRenewKey.bind(this),this.handleUpdateKey=this.handleUpdateKey.bind(this),this.handleDowngradeClick=this.handleDowngradeClick.bind(this),this.handleAddSubscriptionKey=this.handleAddSubscriptionKey.bind(this),this.handleSaveSubscriptionKey=this.handleSaveSubscriptionKey.bind(this)}handleSaveSubscriptionKey(e){return this.subscriptionKeyService.createOrganizationSubscriptionKey(e)}handleAddSubscriptionKey(){this.props.dialogContext.open(At,{title:this.props.t("New subscription key"),onSave:this.handleSaveSubscriptionKey,warning:this.translate("You and your team will be disconnected at the end of the process.")})}handleDowngradeClick(){this.props.navigationContext.onGoToAdministrationDowngradeToCeRequested()}handleRenewKey(){const e=this.props.adminSubscriptionContext.getSubscription();this.hasLimitUsersExceeded()?this.props.navigationContext.onGoToNewTab(`https://www.passbolt.com/subscription/ee/update/qty?subscription_id=${e.subscriptionId}&customer_id=${e.customerId}`):(this.hasSubscriptionKeyExpired()||this.hasSubscriptionKeyGoingToExpire())&&this.props.navigationContext.onGoToNewTab(`https://www.passbolt.com/subscription/ee/update/renew?subscription_id=${e.subscriptionId}&customer_id=${e.customerId}`)}handleUpdateKey(){this.subscriptionActionService.editSubscription()}hasEditionPlugin(){return this.props.context.siteSettings.canIUse("edition")}hasSubscriptionKeyExpired(){return k.c9.fromISO(this.props.adminSubscriptionContext.getSubscription().expiry)<k.c9.now()}hasSubscriptionKeyGoingToExpire(){return!this.hasSubscriptionKeyExpired()&&k.c9.fromISO(this.props.adminSubscriptionContext.getSubscription().expiry)<k.c9.now().plus({days:30})}shouldShowDowngradeSection(){return this.hasEditionPlugin()&&!this.props.context.siteSettings.isCommunityEdition&&(this.hasSubscriptionKeyExpired()||this.hasSubscriptionKeyGoingToExpire())}hasLimitUsersExceeded(){return this.props.adminSubscriptionContext.getSubscription().users<this.state.activeUsers}hasValidSubscription(){return!this.props.context.siteSettings.isCommunityEdition&&!this.hasLimitUsersExceeded()&&!this.hasSubscriptionKeyExpired()}hasInvalidSubscription(){return!this.props.context.siteSettings.isCommunityEdition&&!this.props.adminSubscriptionContext.getSubscription().data}formatDate(e){try{return k.c9.fromISO(e).setLocale(this.props.context.locale).toLocaleString(k.c9.DATE_SHORT)}catch(t){return console.error(`Failed to format date "${e}":`,t),""}}get translate(){return this.props.t}render(){const e=this.props.adminSubscriptionContext.getSubscription(),t=this.props.adminSubscriptionContext.isProcessing();return n.createElement("div",{className:"row"},!t&&n.createElement("div",{className:"subscription-key main-column"},n.createElement("div",{className:"main-content"},n.createElement("h1",null,n.createElement(I.x6,null,"Subscription")),n.createElement("h3",null,n.createElement(I.x6,null,"Details")),n.createElement("div",{className:"subscription-information"},n.createElement("div",{className:"information container"},n.createElement("div",{className:"information"},n.createElement("div",{className:"information-label"},n.createElement("span",{className:"edition label"},n.createElement(I.x6,null,"Edition:")),n.createElement("span",{className:"server-version label"},n.createElement(I.x6,null,"Server version:")),n.createElement("span",{className:"client-version label"},n.createElement(I.x6,null,"Client version:")),!this.props.context.siteSettings.isCommunityEdition&&n.createElement(n.Fragment,null,n.createElement("span",{className:"email label"},n.createElement(I.x6,null,"Email:")),n.createElement("span",{className:"users label"},n.createElement(I.x6,null,"Users limit:")))),n.createElement("div",{className:"information-value"},n.createElement("span",{className:"edition value"},!this.props.context.siteSettings.isCommunityEdition&&Ut,this.props.context.siteSettings.isCommunityEdition&&n.createElement(n.Fragment,null,qt,n.createElement("span",{className:"subtitle"},n.createElement(I.x6,null,"(Free forever)")))),n.createElement("span",{className:"server-version value"},this.props.context.siteSettings.version),n.createElement("span",{className:"client-version value"},this.props.context.extensionVersion),!this.props.context.siteSettings.isCommunityEdition&&n.createElement(n.Fragment,null,n.createElement("span",{className:"email value"},e.email),n.createElement("span",{className:"users value "+(this.hasLimitUsersExceeded()?"error":"")},e.users," ",n.createElement("span",{className:"secondary-information"},"(",n.createElement(I.x6,null,"currently:")," ",this.state.activeUsers,")"))))),n.createElement("div",{className:"information"},n.createElement("div",{className:"information-label"},!this.props.context.siteSettings.isCommunityEdition&&n.createElement(n.Fragment,null,n.createElement("span",{className:"customer-id label"},n.createElement(I.x6,null,"Customer id:")),n.createElement("span",{className:"subscription-id label"},n.createElement(I.x6,null,"Subscription id:")),n.createElement("span",{className:"created label"},n.createElement(I.x6,null,"Valid from:")),n.createElement("span",{className:"expiry label"},n.createElement(I.x6,null,"Expires on:")))),n.createElement("div",{className:"information-value"},!this.props.context.siteSettings.isCommunityEdition&&n.createElement(n.Fragment,null,n.createElement("span",{className:"customer-id value"},e.customerId),n.createElement("span",{className:"subscription-id value"},e.subscriptionId),n.createElement("span",{className:"created value"},this.formatDate(e.created)),n.createElement("span",{className:`expiry value ${this.hasSubscriptionKeyExpired()?"error":""} ${this.hasSubscriptionKeyGoingToExpire()?"warning":""}`},this.formatDate(e.expiry)," ",n.createElement("span",{className:"secondary-information",title:e.expiry},"(",`${this.hasSubscriptionKeyExpired()?this.translate("expired "):""}${((e,t,s)=>{if(null===e)return"n/a";if("Infinity"===e)return t("Never");const n=k.c9.fromISO(e),i=n.diffNow().toMillis();return i>-1e3&&i<0?t("Just now"):n.toRelative({locale:s})})(e.expiry,this.props.t,this.props.context.locale)}`,")"))))))),!this.props.context.siteSettings.isCommunityEdition&&n.createElement(n.Fragment,null,!this.props.context.siteSettings.isCommunityEdition&&n.createElement("div",{className:"subscription-actions"},this.hasSubscriptionKeyExpired()&&n.createElement("div",{className:"subscription-warning"},n.createElement(Dt,null),n.createElement(I.x6,null,"Your subscription key is expired.")),this.hasLimitUsersExceeded()&&n.createElement("div",{className:"subscription-warning"},n.createElement(Dt,null),n.createElement(I.x6,null,"Your users limit has been reached.")),this.hasInvalidSubscription()&&n.createElement("div",{className:"subscription-warning"},n.createElement(Dt,null),n.createElement(I.x6,null,"Your subscription key is either missing or not valid.")))),n.createElement("div",{className:"subscription-actions"},!this.props.context.siteSettings.isCommunityEdition&&n.createElement(n.Fragment,null,(this.shouldShowDowngradeSection()||this.hasLimitUsersExceeded())&&n.createElement("button",{className:"button",type:"button",onClick:this.handleRenewKey},n.createElement(I.x6,null,"Renew subscription key")),n.createElement("button",{className:"button primary form",type:"button",onClick:this.handleUpdateKey},n.createElement(I.x6,null,"Update subscription key"))),this.props.context.siteSettings.isCommunityEdition&&this.hasEditionPlugin()&&n.createElement(n.Fragment,null,n.createElement("button",{className:"button primary form",type:"button",onClick:this.handleAddSubscriptionKey},n.createElement(I.x6,null,"Upload subscription key")))),n.createElement("h3",{className:"title"},n.createElement(I.x6,null,"Plans")),n.createElement("div",{className:"subscription-editions"},n.createElement("div",{className:"edition "+(this.props.context.siteSettings.isCommunityEdition?"current-edition":"")},n.createElement("div",{className:"content"},n.createElement("div",{className:"title"},n.createElement("div",{className:"community-title"},n.createElement("h3",null,qt),n.createElement("span",{className:"subtitle"},n.createElement(I.x6,null,"(Free forever)"))),this.props.context.siteSettings.isCommunityEdition&&n.createElement("div",{className:"current-edition-indicator-wrapper"},n.createElement("div",{className:"current-edition-indicator"},n.createElement(I.x6,null,"Current plan")))),n.createElement("div",{className:"features"},n.createElement("span",{className:"subtitle"},n.createElement(I.x6,null,"Features included:")),n.createElement("ul",null,n.createElement("li",null,n.createElement(I.x6,null,"Open source under AGPLV3 license")),n.createElement("li",null,n.createElement(I.x6,null,"Passwords management & sharing")),n.createElement("li",null,n.createElement(I.x6,null,"Private and shared folders")),n.createElement("li",null,n.createElement(I.x6,null,"Users and groups management")),n.createElement("li",null,n.createElement(I.x6,null,"Secret key authentication (2FA)")),n.createElement("li",null,n.createElement(I.x6,null,"Additional factor authentication (3-step verification)")),n.createElement("li",null,n.createElement(I.x6,null,"Open API")),n.createElement("li",null,n.createElement(I.x6,null,"Role Based Access Control")),n.createElement("li",null,n.createElement(I.x6,null,"Password expiry")),n.createElement("li",null,n.createElement(I.x6,null,"Secret history")),n.createElement("li",null,n.createElement(I.x6,null,"Community support"))))),this.shouldShowDowngradeSection()&&n.createElement("div",{className:"subscription-actions"},n.createElement("button",{className:"button",type:"button",onClick:this.handleDowngradeClick},n.createElement(I.x6,null,"Downgrade to ",{edition:"Community"})))),n.createElement("div",{className:"edition "+(this.props.context.siteSettings.isCommunityEdition?"":"current-edition")},n.createElement("div",{className:"content"},n.createElement("div",{className:"title"},n.createElement("h3",null,Ut),!this.props.context.siteSettings.isCommunityEdition&&n.createElement("div",{className:"current-edition-indicator-wrapper"},n.createElement("div",{className:"current-edition-indicator"},n.createElement(I.x6,null,"Current plan")))),n.createElement("div",{className:"features"},n.createElement("span",{className:"subtitle"},n.createElement(I.x6,null,"Features include everything in Community, plus:")),n.createElement("ul",null,n.createElement("li",null,n.createElement(I.x6,null,"Account recovery (Escrow)")),n.createElement("li",null,n.createElement(I.x6,null,"Users provisioning (AD / OpenLDAP / SCIM)")),n.createElement("li",null,n.createElement(I.x6,null,"Single Sign On (SSO) with Microsoft, Google and more")),n.createElement("li",null,n.createElement(I.x6,null,"Activity log (audit changes)")),n.createElement("li",null,n.createElement(I.x6,null,"Additional policies")),n.createElement("li",null,n.createElement(I.x6,null,"Tags management")),n.createElement("li",null,n.createElement(I.x6,null,"VM appliance")),n.createElement("li",null,n.createElement(I.x6,null,"Next business day support"))),n.createElement("div",null,n.createElement("a",{target:"_blank",rel:"noopener noreferrer",href:"https://www.passbolt.com/pricing/pro?utm_campaign=21060976-CE%20to%20Pro&utm_source=product"},n.createElement(I.x6,null,"See pricing page"))))),this.props.context.siteSettings.isCommunityEdition&&n.createElement("div",{className:"subscription-actions"},n.createElement("a",{className:"button primary",target:"_blank",rel:"noopener noreferrer",href:"https://www.passbolt.com/pricing/pro?utm_campaign=21060976-CE%20to%20Pro&utm_source=product"},n.createElement(I.x6,null,"Buy now")),n.createElement("a",{className:"button",target:"_blank",rel:"noopener noreferrer",href:"https://www.passbolt.com/contact/pro/free-trial?utm_campaign=21060976-CE%20to%20Pro&utm_source=product"},n.createElement(I.x6,null,"Start a free trial"))))))),(s=n.createElement("div",{className:"sidebar-help-section"},n.createElement("h3",null,n.createElement(I.x6,null,"Need help?")),n.createElement("p",null,n.createElement(I.x6,null,"For any change or question related to your passbolt subscription, kindly contact our sales team.")),n.createElement("a",{className:"button",target:"_blank",rel:"noopener noreferrer",href:"https://www.passbolt.com/contact"},n.createElement(Pt,null),n.createElement("span",null,n.createElement(I.x6,null,"Contact Sales")))),i=document.getElementById("administration-help-panel"),n.createElement(n.Fragment,null,i&&(0,xt.createPortal)(s,i,void 0))));var s,i}}a(function(e){return class extends n.Component{render(){return n.createElement(F.Consumer,null,t=>n.createElement(e,$({navigationContext:t},this.props)))}}}(Be(qe(L((0,I.CI)("common")(Gt))))));class Lt extends n.Component{get privacyUrl(){return this.props.context.siteSettings.privacyLink}get creditsUrl(){return"https://www.passbolt.com/terms"}get unsafeUrl(){return"https://www.passbolt.com/docs/hosting/faq/why-I-see-unsafe-mode-banner/"}get termsUrl(){return this.props.context.siteSettings.termsLink}get versions(){const e=this.props.context.extensionVersion,t=this.props.context.siteSettings.version;return n.createElement("div",null,e&&n.createElement("div",null,this.props.t("Client")," ",e),t&&n.createElement(n.Fragment,null,e&&n.createElement("hr",null),n.createElement("div",null,this.props.t("Server")," ",t)))}get isUnsafeMode(){if(!this.props.context.siteSettings)return!1;const e=this.props.context.siteSettings.debug,t=this.props.context.siteSettings.url.startsWith("http://");return e||t}get isCloud(){const e=new URL(this.props.context.siteSettings.url);return"https:"===e.protocol&&Boolean(e.hostname.match(/cloud.passbolt.com$/))}render(){return n.createElement("footer",{className:"footer"},n.createElement("ul",{className:"footer-links"},this.isUnsafeMode&&n.createElement("li",{className:"error-message"},n.createElement("a",{href:this.unsafeUrl,target:"_blank",rel:"noopener noreferrer"},n.createElement(I.x6,null,"Unsafe mode"))),!this.isCloud&&n.createElement(n.Fragment,null,this.props.context.siteSettings.isCommunityEdition&&n.createElement("li",null,qt,n.createElement("span",{className:"edition-suffix"},n.createElement(I.x6,null," (free)"))),!this.props.context.siteSettings.isCommunityEdition&&n.createElement("li",null,Ut)),this.isCloud&&n.createElement("li",null,"Cloud"),n.createElement("li",null,this.versions&&n.createElement(_,{message:this.versions,direction:"top-left"},n.createElement("a",{className:"button button-transparent inline",href:this.creditsUrl,target:"_blank",rel:"noopener noreferrer"},n.createElement(O,null))),!this.versions&&n.createElement("a",{className:"button button-transparent inline",href:this.creditsUrl,target:"_blank",rel:"noopener noreferrer"},n.createElement(O,null)))))}}Lt.propTypes={context:d().any,t:d().func};const Mt=a((0,I.CI)("common")(Lt)),$t=(e,t)=>t.split(".").reduce((e,t)=>e?.[t],e);s.dn($t);const Ft=(e,t)=>{if(void 0===e||"string"!=typeof e||!e.length)return!1;if((t=t||{}).whitelistedProtocols&&!Array.isArray(t.whitelistedProtocols))throw new TypeError("The whitelistedProtocols should be an array of string.");if(t.defaultProtocol&&"string"!=typeof t.defaultProtocol)throw new TypeError("The defaultProtocol should be a string.");const s=t.whitelistedProtocols||[jt.HTTP,jt.HTTPS],n=[jt.JAVASCRIPT],i=t.defaultProtocol||"";!/^(?:(?!:\/\/).)*:\/\//.test(e)&&i&&(e=`${i}//${e}`);try{const t=new URL(e);return!n.includes(t.protocol)&&!!s.includes(t.protocol)&&t.href}catch(e){return console.error("Failed to sanitize URL:",e),!1}};s.dn(Ft);const jt={FTP:"http:",FTPS:"https:",HTTP:"http:",HTTPS:"https:",JAVASCRIPT:"javascript:",SSH:"ssh:"},Kt="enabled",Vt="disabled",Bt="not found";class Ht extends Ce{static getSchema(){return{type:"object",required:[],properties:{status:{type:"string",enum:[Kt,Vt,Bt]},app:{type:"object"},passbolt:{type:"object"},serverTimeDiff:{type:"integer",nullable:!0}}}}marshall(){void 0===this._props.status&&(this._props.status=Kt),Ht.sanitizeEmailValidateRegex(this._props)}static sanitizeEmailValidateRegex(e){const t=e?.passbolt?.email?.validate?.regex;t&&"string"==typeof t&&t.trim().length&&(e.passbolt.email.validate.regex=t.trim().replace(/^\/+/,"").replace(/\/+$/,""))}static get disabledSiteSettings(){return{status:Vt}}toDto(){return{...this._props}}toJSON(){return this.toDto()}canIUse(e){const t=this._props?.passbolt?.plugins?.[e];return!(!t||"object"!=typeof t)&&!1!==t.enabled}isPluginEnabled(e){return this.canIUse(e)}isFeatureBeta(e){return(0,be.A)(e),$t(this._props,`passbolt.plugins.${e}.isInBeta`)||!1}getPluginSettings(e){return $t(this._props,`passbolt.plugins.${e}`)}getRememberMeOptions(){return(this.getPluginSettings("rememberMe")||{}).options||{}}get hasRememberMeUntilILogoutOption(){return void 0!==(this.getRememberMeOptions()||{})[-1]}get generatorConfiguration(){return $t(this._props,"passbolt.plugins.generator.configuration")}get locale(){return $t(this._props,"app.locale")||Ht.DEFAULT_LOCALE.locale}async setLocale(e){this._props.app||(this._props.app={}),this._props.app.locale=e}get supportedLocales(){return $t(this._props,"passbolt.plugins.locale.options")||Ht.DEFAULT_SUPPORTED_LOCALES}getServerTimezone(){return $t(this._props,"passbolt.app.server_timezone")}get termsLink(){const e=$t(this._props,"passbolt.legal.terms.url");return!!e&&Ft(e)}get privacyLink(){const e=$t(this._props,"passbolt.legal.privacy_policy.url");return!!e&&Ft(e)}get registrationPublic(){return!0===$t(this._props,"passbolt.registration.public")}get debug(){return!0===$t(this._props,"app.debug")}get url(){return $t(this._props,"app.url")||""}get version(){return $t(this._props,"app.version.number")}get isCommunityEdition(){return"ce"===$t(this._props,"passbolt.edition")}get emailValidateRegex(){return $t(this._props,"passbolt.email.validate.regex")||null}isServerInPast(){return(this._props.serverTimeDiff||0)<0}get serverTime(){const e=this._props.serverTimeDiff||0;return(new Date).getTime()+e}static get ENTITY_NAME(){return"SiteSettings"}static get ORGANIZATION_ENABLED(){return Kt}static get ORGANIZATION_DISABLED(){return Vt}static get ORGANIZATION_NOT_FOUND(){return Bt}static get DEFAULT_LOCALE(){return{locale:"en-UK",label:"English"}}static get DEFAULT_SUPPORTED_LOCALES(){return[Ht.DEFAULT_LOCALE]}}const Wt=Ht;var Yt=s(2635),zt=s(2107);class Xt extends n.Component{constructor(e){super(e),this.state=this.defaultState}get defaultState(){return{ready:!1}}async componentDidMount(){await(0,Yt.Yx)(I.r9).use(zt.A).init({lng:this.locale,load:"currentOnly",interpolation:{escapeValue:!1},react:{useSuspense:!1},backend:{loadPath:(e,t)=>this.getTranslationPath(e,t)},supportedLngs:this.supportedLocales,fallbackLng:!1,ns:["common"],defaultNS:"common",keySeparator:!1,nsSeparator:!1,debug:!1}),this.setState({ready:!0})}getTranslationPath(e,t){const s=e[0],n=t[0],i="en-GB"===s?"en-UK":s;return(this.props.loadingPath||"/locales/{{lng}}/{{ns}}.json").replace("{{lng}}",i).replace("{{ns}}",n)}get supportedLocales(){let e=[];return this.props.context.siteSettings?.supportedLocales?e=this.props.context.siteSettings?.supportedLocales.map(e=>e.locale):e.push(this.locale),e.includes("en-UK")&&e.push("en-GB"),e}get locale(){return this.props.context.locale}async componentDidUpdate(e){await this.handleLocaleChange(e.context.locale)}async handleLocaleChange(e){this.locale!==e&&await(0,Yt.v2)(this.locale)}get isReady(){return this.state.ready}render(){return n.createElement(n.Fragment,null,this.isReady&&this.props.children)}}Xt.propTypes={context:d().any,loadingPath:d().any,children:d().any};const Jt=a(Xt),Zt=new class{allPropTypes=(...e)=>(...t)=>{const s=e.map(e=>e(...t)).filter(Boolean);if(0===s.length)return;const n=s.map(e=>e.message).join("\n");return new Error(n)}};var Qt;function es(){return es=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var n in s)({}).hasOwnProperty.call(s,n)&&(e[n]=s[n])}return e},es.apply(null,arguments)}const ts=function(e){return n.createElement("svg",es({width:25,height:24,fill:"none",viewBox:"0 0 25 24"},e),Qt||(Qt=n.createElement("path",{stroke:"var(--icon-color)",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M11.597 19a8 8 0 1 0 0-16 8 8 0 0 0 0 16M21.597 21l-4.35-4.35"})))};class ss extends n.Component{constructor(e){super(e),this.state=this.getDefaultState(e),this.bindCallback(),this.createRefs()}getDefaultState(e){return{selectedValue:e.value,search:"",open:!1,style:void 0}}get listItemsFiltered(){const e=this.props.items.filter(e=>e.value!==this.state.selectedValue);return this.props.search&&""!==this.state.search?this.getItemsMatch(e,this.state.search):e}get selectedItemLabel(){const e=this.props.items&&this.props.items.find(e=>e.value===this.state.selectedValue);return e&&e.label||n.createElement(n.Fragment,null," ")}static getDerivedStateFromProps(e,t){return void 0!==e.value&&e.value!==t.selectedValue?{selectedValue:e.value}:null}bindCallback(){this.handleDocumentClickEvent=this.handleDocumentClickEvent.bind(this),this.handleDocumentContextualMenuEvent=this.handleDocumentContextualMenuEvent.bind(this),this.handleDocumentDragStartEvent=this.handleDocumentDragStartEvent.bind(this),this.handleDocumentScrollEvent=this.handleDocumentScrollEvent.bind(this),this.handleSelectClick=this.handleSelectClick.bind(this),this.handleInputChange=this.handleInputChange.bind(this),this.handleItemClick=this.handleItemClick.bind(this),this.handleSelectKeyDown=this.handleSelectKeyDown.bind(this),this.handleItemKeyDown=this.handleItemKeyDown.bind(this),this.handleBlur=this.handleBlur.bind(this)}createRefs(){this.selectedItemRef=n.createRef(),this.selectItemsRef=n.createRef(),this.itemsRef=n.createRef()}componentDidMount(){document.addEventListener("click",this.handleDocumentClickEvent,{capture:!0}),document.addEventListener("contextmenu",this.handleDocumentContextualMenuEvent,{capture:!0}),document.addEventListener("dragstart",this.handleDocumentDragStartEvent,{capture:!0}),document.addEventListener("scroll",this.handleDocumentScrollEvent,{capture:!0})}componentWillUnmount(){document.removeEventListener("click",this.handleDocumentClickEvent,{capture:!0}),document.removeEventListener("contextmenu",this.handleDocumentContextualMenuEvent,{capture:!0}),document.removeEventListener("dragstart",this.handleDocumentDragStartEvent,{capture:!0}),document.removeEventListener("scroll",this.handleDocumentScrollEvent,{capture:!0})}handleDocumentClickEvent(e){this.selectedItemRef.current.contains(e.target)||this.selectItemsRef.current.contains(e.target)||this.closeSelect()}handleDocumentContextualMenuEvent(e){this.selectedItemRef.current.contains(e.target)||this.selectItemsRef.current.contains(e.target)||this.closeSelect()}handleDocumentDragStartEvent(){this.closeSelect()}handleDocumentScrollEvent(e){this.itemsRef.current.contains(e.target)||this.selectItemsRef.current.contains(e.target)||this.closeSelect()}handleSelectClick(){if(this.props.disabled)this.closeSelect();else{const e=!this.state.open;e?this.forceVisibilitySelect():this.resetStyleSelect(),this.setState({open:e})}}getFirstParentWithTransform(){let e=this.selectedItemRef.current.parentElement;for(;null!==e&&""===e.style.getPropertyValue("transform");)e=e.parentElement;return e}forceVisibilitySelect(){const e=this.selectedItemRef.current.getBoundingClientRect(),{width:t,height:s}=e;let{top:n,left:i}=e;const r=this.getFirstParentWithTransform();if(r){const e=r.getBoundingClientRect();n-=e.top,i-=e.left}const o={position:"fixed",zIndex:1,width:t,height:s,top:n,left:i};this.setState({style:o})}handleBlur(e){e.currentTarget.contains(e.relatedTarget)||this.closeSelect()}closeSelect(){this.resetStyleSelect(),this.setState({open:!1})}resetStyleSelect(){this.setState({style:void 0})}handleInputChange(e){const t=e.target,s=t.value,n=t.name;this.setState({[n]:s})}handleItemClick(e){if(this.setState({selectedValue:e.value,open:!1}),"function"==typeof this.props.onChange){const t={target:{value:e.value,name:this.props.name}};this.props.onChange(t)}this.closeSelect()}getItemsMatch(e,t){const s=t&&t.split(/\s+/)||[""];return e.filter(e=>s.every(t=>((e,t)=>(e=>new RegExp((e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"))(e),"i"))(e).test(t))(t,e.label)))}handleSelectKeyDown(e){switch(e.keyCode){case 13:return e.stopPropagation(),void this.handleSelectClick();case 40:return e.preventDefault(),e.stopPropagation(),void(this.state.open?this.focusItem(0):this.handleSelectClick());case 38:return e.preventDefault(),e.stopPropagation(),void(this.state.open?this.focusItem(this.listItemsFiltered.length-1):this.handleSelectClick());case 27:return e.stopPropagation(),void this.closeSelect();default:return}}focusItem(e){this.itemsRef.current.childNodes[e]?.focus()}handleItemKeyDown(e,t){switch(e.keyCode){case 13:return e.stopPropagation(),void this.handleItemClick(t);case 40:return e.stopPropagation(),e.preventDefault(),void(e.target.nextSibling?e.target.nextSibling.focus():this.focusItem(0));case 38:return e.stopPropagation(),e.preventDefault(),void(e.target.previousSibling?e.target.previousSibling.focus():this.focusItem(this.listItemsFiltered.length-1));default:return}}hasFilteredItems(){return this.listItemsFiltered.length>0}render(){return n.createElement("div",{className:`select-container ${this.props.className}`,style:{width:this.state.style?.width,height:this.state.style?.height}},n.createElement("div",{onKeyDown:this.handleSelectKeyDown,onBlur:this.handleBlur,id:this.props.id,className:`select ${this.props.direction} ${this.state.open?"open":""}`,style:this.state.style},n.createElement("div",{ref:this.selectedItemRef,className:"selected-value "+(this.props.disabled?"disabled":""),tabIndex:this.props.disabled?-1:0,onClick:this.handleSelectClick},n.createElement("span",{className:"value"},this.selectedItemLabel),n.createElement(at,null)),n.createElement("div",{ref:this.selectItemsRef,className:"select-items "+(this.state.open?"visible":"")},this.props.search&&n.createElement(n.Fragment,null,n.createElement("input",{className:"search-input",name:"search",value:this.state.search,onChange:this.handleInputChange,type:"text"}),n.createElement(ts,{className:"search"})),n.createElement("ul",{ref:this.itemsRef,className:"items"},this.hasFilteredItems()&&this.listItemsFiltered.map(e=>n.createElement("li",{tabIndex:e.disabled?-1:0,key:e.value,title:e.title,className:`option ${e.value}`,onKeyDown:t=>this.handleItemKeyDown(t,e),onClick:()=>this.handleItemClick(e)},e.label)),!this.hasFilteredItems()&&this.props.search&&n.createElement("li",{className:"option no-results"},n.createElement(I.x6,null,"No results match")," ",n.createElement("span",null,this.state.search))))))}}ss.defaultProps={id:"",name:"select",className:"",direction:"bottom"},ss.propTypes={id:d().string,name:d().string,className:d().string,direction:d().oneOf(Object.values({top:"top",bottom:"bottom",left:"left",right:"right"})),search:d().bool,items:d().array,value:Zt.allPropTypes(d().oneOfType([d().string,d().number,d().bool]),(e,t,s)=>{const n=e[t],i=e.items;if(null!==n&&i.length>0&&i.every(e=>e.value!==n))return new Error(`Invalid prop ${t} passed to ${s}. Expected the value ${n} in items.`)}),disabled:d().bool,onChange:d().func};const ns=(0,I.CI)("common")(ss);class is extends n.Component{constructor(e){super(e),this.state=this.defaultState,this.bindHandlers()}componentDidMount(){this.initLocale()}componentDidUpdate(e){this.handleLocaleChange(e.context.locale)}handleLocaleChange(e){this.props.context.locale!==e&&this.setState({locale:this.props.context.locale})}get defaultState(){return{loading:!0,locale:null,processing:!1}}get areActionsAllowed(){return!this.state.processing}bindHandlers(){this.handleLocaleInputChange=this.handleLocaleInputChange.bind(this)}async handleLocaleInputChange(e){const t=e.target.value;this.updateLocale(t)}async updateLocale(e){this.setState({processing:!0}),await this.props.context.onUpdateLocaleRequested(e),this.setState({processing:!1})}initLocale(){this.setState({locale:this.props.context.locale,loading:!1})}isLoading(){return this.state.loading}get supportedLocales(){return this.props.context.siteSettings.supportedLocales?this.props.context.siteSettings.supportedLocales.map(e=>({value:e.locale,label:e.label})):[]}render(){return n.createElement(n.Fragment,null,!this.isLoading()&&n.createElement("div",{className:"select-wrapper input"},n.createElement(ns,{id:"user-locale-input",className:"setup-extension",name:"locale",value:this.state.locale,disabled:!this.areActionsAllowed,items:this.supportedLocales,onChange:this.handleLocaleInputChange})))}}is.propTypes={context:d().any};const rs=a(is),os="chrome",as="edge",ls="firefox",cs="safari";function ds(){const e=window.navigator.userAgent.toLowerCase();let t;return t=e.indexOf("firefox")>-1?ls:e.indexOf("samsungbrowser")>-1?"samsung":e.indexOf("opera")>-1||e.indexOf("opr")>-1?"opera":e.indexOf("trident")>-1?"internet-explorer":e.indexOf("edg")>-1?as:e.indexOf("chrome")>-1?os:e.indexOf("safari")>-1?cs:"unknown",t}function ps(){return ps=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var n in s)({}).hasOwnProperty.call(s,n)&&(e[n]=s[n])}return e},ps.apply(null,arguments)}const us=n.createContext({userId:null,token:null,state:null,unexpectedError:null,onInitializeRecoverRequested:()=>{},logoutUserAndRefresh:()=>{}});class hs extends n.Component{constructor(e){super(e),this.state=Object.assign(this.defaultState,e.value),this.authLogoutService=new f(e.context.getApiClientOptions())}get defaultState(){return{userId:null,token:null,state:ms.INITIAL_STATE,unexpectedError:null,onInitializeRecoverRequested:this.onInitializeRecoverRequested.bind(this),logoutUserAndRefresh:this.logoutUserAndRefresh.bind(this),handleSafariExtensionDownloading:this.handleSafariExtensionDownloading.bind(this),handleSafariExtensionNotDownloaded:this.handleSafariExtensionNotDownloaded.bind(this),handleExtensionAlreadyInstalled:this.handleExtensionAlreadyInstalled.bind(this)}}async onInitializeRecoverRequested(){return this.state.userId&&this.state.token?this.isBrowserSupported()?void await this.startRecover().then(this.handleStartRecoverSuccess.bind(this)).catch(this.handleStartRecoverError.bind(this)):this.setState({state:ms.DOWNLOAD_SUPPORTED_BROWSER_STATE}):this.setState({state:ms.REQUEST_INVITATION_ERROR})}handleStartRecoverSuccess(){const e=ds()===cs?ms.INSTALL_SAFARI_EXTENSION_STATE:ms.INSTALL_EXTENSION_STATE;this.setState({state:e})}handleSafariExtensionDownloading(){const e=ms.CONFIGURE_SAFARI_EXTENSION_STATE;this.setState({state:e})}handleSafariExtensionNotDownloaded(){const e=ms.INSTALL_SAFARI_EXTENSION_STATE;this.setState({state:e})}handleExtensionAlreadyInstalled(){const e=ms.CONFIGURE_SAFARI_EXTENSION_STATE;this.setState({state:e})}handleStartRecoverError(e){if(e instanceof u){if(403===e.data.code)return this.setState({state:ms.ERROR_ALREADY_SIGNED_IN_STATE});const t=Boolean(e.data.body?.token?.expired),s=Boolean(e.data.body?.token?.isActive);if(t||s)return this.setState({state:ms.TOKEN_EXPIRED_STATE});if(400===e?.data?.code)return this.setState({state:ms.REQUEST_INVITATION_ERROR})}return this.setState({state:ms.UNEXPECTED_ERROR_STATE})}async logoutUserAndRefresh(){try{await this.authLogoutService.logout()}catch(e){const t=new E(e.message);return this.setState({unexpectedError:t,state:ms.UNEXPECTED_ERROR_STATE})}T.reload()}isBrowserSupported(){const e=ds(),t=[os,ls,as];return this.props.context.siteSettings.canIUse("safari")&&t.push(cs),t.includes(e)}async startRecover(){const e=this.props.context.getApiClientOptions();e.setResourceName("setup");const t=new b(e);await t.get(`recover/${this.state.userId}/${this.state.token}`)}render(){return n.createElement(us.Provider,{value:this.state},this.props.children)}}hs.propTypes={context:d().any,value:d().any,children:d().any},a(hs);const ms={INITIAL_STATE:"Initial state",DOWNLOAD_SUPPORTED_BROWSER_STATE:"Download supported browser state",INSTALL_EXTENSION_STATE:"Install extension state",INSTALL_SAFARI_EXTENSION_STATE:"Install Safari extension state",CONFIGURE_SAFARI_EXTENSION_STATE:"Configure Safari extension state",TOKEN_EXPIRED_STATE:"Token expired state",ERROR_ALREADY_SIGNED_IN_STATE:"Error, already signed in state",REQUEST_INVITATION_ERROR:"Request inviration error state",UNEXPECTED_ERROR_STATE:"Unexpected error state"};class gs extends n.Component{get statesToHideLocaleSwitch(){return[ms.INITIAL_STATE]}get mustDisplayLocaleSwitch(){return!this.statesToHideLocaleSwitch.includes(this.props.apiRecoverContext.state)}render(){return n.createElement(n.Fragment,null,this.mustDisplayLocaleSwitch&&n.createElement(rs,null))}}gs.propTypes={apiRecoverContext:d().any};const Es=function(e){return class extends n.Component{render(){return n.createElement(us.Consumer,null,t=>n.createElement(e,ps({apiRecoverContext:t},this.props)))}}}(gs);class ys extends n.Component{render(){return n.createElement("div",{className:"login-processing"},n.createElement("h1",null,this.props.title),n.createElement("div",{className:"processing-wrapper"},n.createElement(Et,null)))}}ys.propTypes={title:d().oneOfType([d().arrayOf(d().node),d().node,d().string])},ys.defaultProps={title:n.createElement(I.x6,null,"Please wait...")};const bs=(0,I.CI)("common")(ys);class fs extends n.Component{constructor(e){super(e),this.state=this.defaultState,this.bindCallbacks()}get defaultState(){return{showErrorDetails:!1}}bindCallbacks(){this.handleErrorDetailsToggle=this.handleErrorDetailsToggle.bind(this)}onClick(){this.props.context.port?this.props.context.port.request("passbolt.tab.reload"):T.reload()}handleErrorDetailsToggle(){this.setState({showErrorDetails:!this.state.showErrorDetails})}get hasErrorDetails(){const e=this.props?.error;return Boolean(e?.details)||Boolean(e?.data?.body)}formatErrors(){const e=this.props.error?.details||this.props.error?.data;return JSON.stringify(e,null,4)}render(){return n.createElement("div",{className:"setup-error"},n.createElement("h1",null,this.props.title),n.createElement("p",null,this.props.message),n.createElement("p",null,this.props.error&&this.props.error.message),this.hasErrorDetails&&n.createElement("div",{className:"accordion error-details"},n.createElement("div",{className:"accordion-header"},n.createElement("button",{className:"no-border",type:"button",onClick:this.handleErrorDetailsToggle},this.state.showErrorDetails?n.createElement(at,{className:"caret-down"}):n.createElement(dt,{className:"caret-right"}),n.createElement("span",null,n.createElement(I.x6,null,"Error details")))),this.state.showErrorDetails&&n.createElement("div",{className:"accordion-content"},n.createElement("div",{className:"input text"},n.createElement("label",{htmlFor:"js_field_debug",className:"visuallyhidden"},n.createElement(I.x6,null,"Error details")),n.createElement("textarea",{id:"js_field_debug",defaultValue:`${this.formatErrors()}`,readOnly:!0})))),n.createElement("div",{className:"form-actions"},n.createElement("button",{onClick:this.onClick.bind(this),className:"button primary big full-width",role:"button"},n.createElement(I.x6,null,"Try again"))))}}fs.defaultProps={title:n.createElement(I.x6,null,"Something went wrong!"),message:n.createElement(I.x6,null,"The operation failed with the following error:")},fs.propTypes={context:d().any,title:d().oneOfType([d().arrayOf(d().node),d().node,d().string]),message:d().oneOfType([d().arrayOf(d().node),d().node,d().string]),error:d().any};const Ts=a((0,I.CI)("common")(fs));class Ss extends n.Component{render(){return n.createElement("div",{className:"setup-error"},n.createElement("h1",null,n.createElement(I.x6,null,"Sorry, wrong computer or browser...")),n.createElement("p",null,n.createElement(I.x6,null,"You need to finalize the account recovery process with the same computer you used for the account recovery request."),n.createElement("br",null),n.createElement("br",null),n.createElement(I.x6,null,"If you changed systems, or reinstalled passbolt web extension in the meantime, you will need to start the account recovery process from scratch.")),n.createElement("div",{className:"form-actions"},n.createElement("a",{href:`${this.props.context.trustedDomain}/users/recover`,className:"button primary big full-width",role:"button",rel:"noopener noreferrer"},n.createElement(I.x6,null,"Restart from scratch"))))}}Ss.propTypes={context:d().any};const ws=a((0,I.CI)("common")(Ss));class vs extends n.Component{render(){return n.createElement("div",{className:"setup-error"},n.createElement("h1",null,n.createElement(I.x6,null,"The request is expired.")),n.createElement("p",null,n.createElement(I.x6,null,"If you still need to recover your account, you will need to start the process from scratch.")),n.createElement("div",{className:"form-actions"},n.createElement("a",{href:`${this.props.context.trustedDomain}`,className:"button primary big full-width",role:"button",rel:"noopener noreferrer"},n.createElement(I.x6,null,"Continue"))))}}vs.propTypes={context:d().any};const As=a((0,I.CI)("common")(vs)),Rs="setup",Cs="recover",xs="account-recovery";class Ns extends n.Component{render(){return n.createElement("div",{className:"setup-error"},n.createElement("h1",null,n.createElement(I.x6,null,"Cannot perform the action while being logged in")),n.createElement("p",null,{[Rs]:n.createElement(I.x6,null,"It is not possible to perform a setup of a new account as you are still logged in. You need to log out first before continuing."),[Cs]:n.createElement(I.x6,null,"It is not possible to perform the recovery of your account as you are still logged in. You need to log out first before continuing."),[xs]:n.createElement(I.x6,null,"It is not possible to recover your private key of your account as you are still logged in. You need to log out first before continuing.")}[this.props.displayAs]),n.createElement("div",{className:"form-actions"},n.createElement("button",{onClick:this.props.onLogoutButtonClick.bind(this),className:"button primary big full-width",role:"button"},n.createElement(I.x6,null,"Sign out"))))}}Ns.propTypes={displayAs:d().oneOf([Rs,Cs,xs]).isRequired,onLogoutButtonClick:d().func.isRequired};const Os=(0,I.CI)("common")(Ns);class Is extends n.Component{componentDidMount(){this.initializeAccountRecovery()}initializeAccountRecovery(){setTimeout(()=>this.props.apiAccountRecoveryContext.onInitializeAccountRecoveryRequested(),1e3)}render(){switch(this.props.apiAccountRecoveryContext.state){case R.RESTART_FROM_SCRATCH:return n.createElement(ws,null);case R.TOKEN_EXPIRED_STATE:return n.createElement(As,null);case R.ERROR_ALREADY_SIGNED_IN_STATE:return n.createElement(Os,{onLogoutButtonClick:this.props.apiAccountRecoveryContext.logoutUserAndRefresh,displayAs:xs});case R.UNEXPECTED_ERROR_STATE:return n.createElement(Ts,{error:this.props.apiAccountRecoveryContext.unexpectedError});default:return n.createElement(bs,null)}}}Is.propTypes={apiAccountRecoveryContext:d().object};const Ps=function(e){return class extends n.Component{render(){return n.createElement(w.Consumer,null,t=>n.createElement(e,S({apiAccountRecoveryContext:t},this.props)))}}}(Is);var _s,ks,Ds,Us,qs;function Gs(){return Gs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var n in s)({}).hasOwnProperty.call(s,n)&&(e[n]=s[n])}return e},Gs.apply(null,arguments)}const Ls=function(e){return n.createElement("svg",Gs({xmlns:"http://www.w3.org/2000/svg",width:151,height:27,fill:"none","aria-labelledby":"logo-title logo-description",viewBox:"0 0 151 27"},e),_s||(_s=n.createElement("title",{id:"logo-title"},"Passbolt logo")),ks||(ks=n.createElement("desc",{id:"logo-description"},"This is the logo of passbolt.")),Ds||(Ds=n.createElement("path",{fill:"var(--icon-color)",d:"M4.648 9.234v8.607h2.48c1.646 0 2.786-.349 3.47-1.012.685-.664 1.013-1.823 1.013-3.395 0-1.52-.305-2.595-.938-3.218-.633-.673-1.695-.972-3.24-.972zM.597 5.963h7.797c2.357 0 4.178.676 5.496 2.048q1.976 2.058 1.974 5.689a8.6 8.6 0 0 1-.406 2.749 7.1 7.1 0 0 1-1.24 2.278 5.9 5.9 0 0 1-2.38 1.773c-.937.349-2.152.524-3.697.524H4.648V26.5H.597zM24.016 18.016h5.064v-3.119h-4.76c-.937 0-1.594.124-1.95.375-.357.25-.517.698-.517 1.321 0 .524.15.899.429 1.122.28.223.848.301 1.734.301M18.649 5.963h8.268c2.103 0 3.672.476 4.736 1.423 1.065.947 1.594 2.347 1.594 4.217v9.456H22.37c-1.52 0-2.708-.375-3.52-1.121-.81-.747-1.2-1.823-1.2-3.22 0-1.722.454-2.945 1.392-3.692s2.483-1.134 4.697-1.134h5.315v-.365c0-.898-.276-1.518-.809-1.896-.532-.377-1.47-.55-2.86-.55H18.65zM36.55 17.915h8.525c.76 0 1.318-.124 1.646-.35.183-.122.328-.29.423-.486.094-.197.134-.414.115-.63a1.2 1.2 0 0 0-.112-.632 1.24 1.24 0 0 0-.42-.492c-.355-.253-.91-.374-1.646-.374h-3.494c-2.067 0-3.467-.325-4.203-.947-.737-.623-1.088-1.747-1.088-3.32 0-1.62.431-2.82 1.318-3.592.886-.772 2.255-1.152 4.064-1.152h8.684v3.142h-7.134q-1.75 0-2.279.301c-.354.198-.532.547-.532 1.071-.017.193.016.387.096.564s.204.332.361.449c.302.223.809.324 1.468.324h3.676c1.672 0 2.961.397 3.824 1.172s1.315 1.871 1.315 3.32c0 1.397-.405 2.53-1.188 3.417-.37.427-.833.768-1.354.996-.522.23-1.09.34-1.661.325H36.549zM53.822 17.915h8.526c.76 0 1.318-.124 1.646-.35a1.23 1.23 0 0 0 .42-.487c.093-.196.132-.413.112-.629a1.2 1.2 0 0 0-.111-.632 1.24 1.24 0 0 0-.421-.492c-.354-.253-.91-.374-1.646-.374h-3.493c-2.067 0-3.467-.325-4.204-.947-.736-.623-1.088-1.752-1.088-3.324 0-1.62.432-2.82 1.318-3.593.886-.772 2.253-1.147 4.075-1.147h8.686v3.142h-7.141q-1.747 0-2.28.301c-.353.198-.531.547-.531 1.071-.017.193.016.387.096.564s.204.332.361.449c.302.223.809.324 1.468.324h3.671c1.672 0 2.963.397 3.824 1.172s1.315 1.871 1.315 3.32c0 1.397-.403 2.53-1.188 3.417-.37.427-.832.767-1.354.996a3.9 3.9 0 0 1-1.66.325H53.769v-3.106zM75.387.5v5.463h3.47c1.55 0 2.759.175 3.694.55.946.362 1.77.976 2.38 1.772a7.2 7.2 0 0 1 1.243 2.296c.281.888.417 1.814.403 2.744q0 3.63-1.974 5.689c-1.315 1.372-3.14 2.046-5.493 2.046h-7.8V.5zm2.462 8.734h-2.483v8.608h2.785c1.55 0 2.633-.324 3.243-.95s.935-1.721.935-3.268-.354-2.694-1.033-3.367c-.68-.673-1.832-1.023-3.447-1.023M92.3 13.525c0 1.445.328 2.532 1.013 3.367s1.62 1.198 2.86 1.198 2.152-.398 2.863-1.198 1.033-1.921 1.033-3.367-.356-2.547-1.033-3.344c-.677-.798-1.62-1.198-2.863-1.198a3.64 3.64 0 0 0-1.57.279 3.6 3.6 0 0 0-1.29.919c-.685.797-1.013 1.921-1.013 3.344m12.002 0q0 3.544-2.202 5.689c-1.47 1.397-3.42 2.121-5.901 2.121s-4.457-.699-5.924-2.121-2.202-3.292-2.202-5.664q0-3.558 2.202-5.69c1.467-1.424 3.444-2.145 5.919-2.145s4.431.724 5.901 2.144 2.207 3.294 2.207 5.666M110.935 21.06h-4.202V.5h4.202zM112.884 5.963h2.86V.5h4.052v5.463h4.278v3.02h-4.278v6.09c0 1.12.204 1.895.581 2.343.377.449 1.064.649 2.026.649h1.671v3.02h-3.72c-1.494 0-2.636-.4-3.444-1.223-.809-.823-1.189-1.995-1.189-3.519v-7.36h-2.863v-3.02z"})),Us||(Us=n.createElement("path",{fill:"#D40101",d:"m149.951 10.68-9.059-8.36a2.12 2.12 0 0 0-1.421-.543c-.526 0-1.033.194-1.421.544l-5.684 5.268c.745.271 1.414.71 1.952 1.282.539.572.933 1.26 1.149 2.01h7.673a.73.73 0 0 1 .504.204.69.69 0 0 1 .207.494v1.147a.68.68 0 0 1-.207.494.72.72 0 0 1-.504.204h-.886v1.623a.68.68 0 0 1-.205.494.72.72 0 0 1-.503.205h-1.945a.73.73 0 0 1-.503-.205.69.69 0 0 1-.205-.494v-1.623h-3.426a4.84 4.84 0 0 1-1.135 2.033 5 5 0 0 1-1.966 1.287l5.71 5.276c.388.349.895.543 1.421.543a2.12 2.12 0 0 0 1.421-.543l9.043-8.355a2.03 2.03 0 0 0-.01-2.985"})),qs||(qs=n.createElement("path",{fill:"#D40101",d:"M130.683 9.867a2.6 2.6 0 0 0-1.064.253c-.371.18-.686.455-.913.794a2.242 2.242 0 0 0-.113 2.305 2.3 2.3 0 0 0 .831.877 2.36 2.36 0 0 0 2.355.059c.362-.197.664-.484.875-.833a2.24 2.24 0 0 0 .324-1.153 2.21 2.21 0 0 0-.653-1.625 2.3 2.3 0 0 0-.751-.5 2.3 2.3 0 0 0-.891-.177"})))};class Ms extends n.Component{constructor(e){super(e),this.state=this.defaultState,this.userId=null,this.authenticationToken=null,this.initializeProperties()}get defaultState(){return{siteSettings:null,trustedDomain:this.baseUrl,getApiClientOptions:this.getApiClientOptions.bind(this),locale:null,onUpdateLocaleRequested:this.onUpdateLocaleRequested.bind(this)}}async componentDidMount(){const e=await this.getSiteSettings();this.initLocale(e)}initializeProperties(){const e="[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[0-5][a-fA-F0-9]{3}-[089aAbB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}",t=new RegExp(`account-recovery/continue/(${e})/(${e})$`),s=window.location.pathname.match(t);s?(this.userId=s[1],this.authenticationToken=s[2]):console.error("Unable to parse the url.")}get baseUrl(){const e=document.getElementsByTagName("base")&&document.getElementsByTagName("base")[0];return e?e.attributes.href.value.replace(/\/*$/g,""):(console.error("Unable to retrieve the page base tag"),"")}getApiClientOptions(){return(new C).setBaseUrl(this.state.trustedDomain)}async getSiteSettings(){const e=this.getApiClientOptions().setResourceName("settings"),t=new b(e),{body:s}=await t.findAll(),n=new Wt(s);return this.setState({siteSettings:n}),n}initLocale(e){const t=this.getUrlLocale(e)||this.getBrowserLocale(e)||this.getBrowserSimilarLocale(e)||e.locale;this.setState({locale:t})}getUrlLocale(e){const t=new URL(window.location.href).searchParams.get("locale");if(t){const s=e.supportedLocales.find(e=>t===e.locale);if(s)return s.locale}}getBrowserLocale(e){const t=e.supportedLocales.find(e=>navigator.language===e.locale);if(t)return t.locale}getBrowserSimilarLocale(e){const t=navigator.language.split("-")[0],s=e.supportedLocales.find(e=>t===e.locale.split("-")[0]);if(s)return s.locale}onUpdateLocaleRequested(e){this.setState({locale:e}),this.setUrlLocale(e)}setUrlLocale(e){const t=new URL(window.location.href);t.searchParams.set("locale",e),window.history.replaceState(null,null,t)}isReady(){return null!==this.state.siteSettings&&null!==this.state.locale}render(){return n.createElement(l.Provider,{value:this.state},this.isReady()&&n.createElement(Jt,{loadingPath:`${this.state.trustedDomain}/locales/{{lng}}/{{ns}}.json`},n.createElement(A,{value:{userId:this.userId,authenticationToken:this.authenticationToken}},n.createElement("div",{id:"container",className:"container page login"},n.createElement("div",{className:"content"},n.createElement("div",{className:"header"},n.createElement("div",{className:"logo-svg"},n.createElement(Ls,{role:"img",width:"20rem",height:"3.5rem"}))),n.createElement("div",{className:"login-form"},n.createElement(Ps,null)),n.createElement(Es,null)),n.createElement(Mt,null)))))}}const $s=Ms,Fs=document.createElement("div");document.body.appendChild(Fs),(0,i.H)(Fs).render(n.createElement($s,null))}},s={};function n(e){var i=s[e];if(void 0!==i)return i.exports;var r=s[e]={exports:{}};return t[e].call(r.exports,r,r.exports,n),r.exports}n.m=t,e=[],n.O=(t,s,i,r)=>{if(!s){var o=1/0;for(d=0;d<e.length;d++){for(var[s,i,r]=e[d],a=!0,l=0;l<s.length;l++)(!1&r||o>=r)&&Object.keys(n.O).every(e=>n.O[e](s[l]))?s.splice(l--,1):(a=!1,r<o&&(o=r));if(a){e.splice(d--,1);var c=i();void 0!==c&&(t=c)}}return t}r=r||0;for(var d=e.length;d>0&&e[d-1][2]>r;d--)e[d]=e[d-1];e[d]=[s,i,r]},n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var s in t)n.o(t,s)&&!n.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.j=673,n.dn=e=>{(Object.getOwnPropertyDescriptor(e,"name")||{}).writable||Object.defineProperty(e,"name",{value:"default",configurable:!0})},(()=>{var e={673:0};n.O.j=t=>0===e[t];var t=(t,s)=>{var i,r,[o,a,l]=s,c=0;if(o.some(t=>0!==e[t])){for(i in a)n.o(a,i)&&(n.m[i]=a[i]);if(l)var d=l(n)}for(t&&t(s);c<o.length;c++)r=o[c],n.o(e,r)&&e[r]&&e[r][0](),e[r]=0;return n.O(d)},s=self.webpackChunkpassbolt_styleguide=self.webpackChunkpassbolt_styleguide||[];s.forEach(t.bind(null,0)),s.push=t.bind(null,s.push.bind(s))})();var i=n.O(void 0,[847],()=>n(6943));i=n.O(i)})();
|
|
@@ -88,6 +88,34 @@
|
|
|
88
88
|
* @since 3.6.0
|
|
89
89
|
*/
|
|
90
90
|
|
|
91
|
+
/**
|
|
92
|
+
* Passbolt ~ Open source password manager for teams
|
|
93
|
+
* Copyright (c) 2022 Passbolt SA (https://www.passbolt.com)
|
|
94
|
+
*
|
|
95
|
+
* Licensed under GNU Affero General Public License version 3 of the or any later version.
|
|
96
|
+
* For full copyright and license information, please see the LICENSE.txt
|
|
97
|
+
* Redistributions of files must retain the above copyright notice.
|
|
98
|
+
*
|
|
99
|
+
* @copyright Copyright (c) 2022 Passbolt SA (https://www.passbolt.com)
|
|
100
|
+
* @license https://opensource.org/licenses/AGPL-3.0 AGPL License
|
|
101
|
+
* @link https://www.passbolt.com Passbolt(tm)
|
|
102
|
+
* @since 3.8.0
|
|
103
|
+
*/
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Passbolt ~ Open source password manager for teams
|
|
107
|
+
* Copyright (c) 2022 Passbolt SA (https://www.passbolt.com)
|
|
108
|
+
*
|
|
109
|
+
* Licensed under GNU Affero General Public License version 3 of the or any later version.
|
|
110
|
+
* For full copyright and license information, please see the LICENSE.txt
|
|
111
|
+
* Redistributions of files must retain the above copyright notice.
|
|
112
|
+
*
|
|
113
|
+
* @copyright Copyright (c) 2022 Passbolt SA (https://www.passbolt.com)
|
|
114
|
+
* @license https://opensource.org/licenses/AGPL-3.0 AGPL License
|
|
115
|
+
* @link https=//www.passbolt.com Passbolt(tm)
|
|
116
|
+
* @since 3.8.0
|
|
117
|
+
*/
|
|
118
|
+
|
|
91
119
|
/**
|
|
92
120
|
* Passbolt ~ Open source password manager for teams
|
|
93
121
|
* Copyright (c) Passbolt SA (https://www.passbolt.com)
|
|
@@ -102,6 +130,34 @@
|
|
|
102
130
|
* @since 2.13.0
|
|
103
131
|
*/
|
|
104
132
|
|
|
133
|
+
/**
|
|
134
|
+
* Passbolt ~ Open source password manager for teams
|
|
135
|
+
* Copyright (c) Passbolt SA (https://www.passbolt.com)
|
|
136
|
+
*
|
|
137
|
+
* Licensed under GNU Affero General Public License version 3 of the or any later version.
|
|
138
|
+
* For full copyright and license information, please see the LICENSE.txt
|
|
139
|
+
* Redistributions of files must retain the above copyright notice.
|
|
140
|
+
*
|
|
141
|
+
* @copyright Copyright (c) Passbolt SA (https://www.passbolt.com)
|
|
142
|
+
* @license https://opensource.org/licenses/AGPL-3.0 AGPL License
|
|
143
|
+
* @link https://www.passbolt.com Passbolt(tm)
|
|
144
|
+
* @since 4.1.0
|
|
145
|
+
*/
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Passbolt ~ Open source password manager for teams
|
|
149
|
+
* Copyright (c) Passbolt SA (https://www.passbolt.com)
|
|
150
|
+
*
|
|
151
|
+
* Licensed under GNU Affero General Public License version 3 of the or any later version.
|
|
152
|
+
* For full copyright and license information, please see the LICENSE.txt
|
|
153
|
+
* Redistributions of files must retain the above copyright notice.
|
|
154
|
+
*
|
|
155
|
+
* @copyright Copyright (c) Passbolt SA (https://www.passbolt.com)
|
|
156
|
+
* @license https://opensource.org/licenses/AGPL-3.0 AGPL License
|
|
157
|
+
* @link https://www.passbolt.com Passbolt(tm)
|
|
158
|
+
* @since 4.5.0
|
|
159
|
+
*/
|
|
160
|
+
|
|
105
161
|
/**
|
|
106
162
|
* Passbolt ~ Open source password manager for teams
|
|
107
163
|
* Copyright (c) Passbolt SA (https://www.passbolt.com)
|
|
@@ -116,6 +172,20 @@
|
|
|
116
172
|
* @since 4.7.0
|
|
117
173
|
*/
|
|
118
174
|
|
|
175
|
+
/**
|
|
176
|
+
* Passbolt ~ Open source password manager for teams
|
|
177
|
+
* Copyright (c) Passbolt SA (https://www.passbolt.com)
|
|
178
|
+
*
|
|
179
|
+
* Licensed under GNU Affero General Public License version 3 of the or any later version.
|
|
180
|
+
* For full copyright and license information, please see the LICENSE.txt
|
|
181
|
+
* Redistributions of files must retain the above copyright notice.
|
|
182
|
+
*
|
|
183
|
+
* @copyright Copyright (c) Passbolt SA (https://www.passbolt.com)
|
|
184
|
+
* @license https://opensource.org/licenses/AGPL-3.0 AGPL License
|
|
185
|
+
* @link https://www.passbolt.com Passbolt(tm)
|
|
186
|
+
* @since 5.0.0
|
|
187
|
+
*/
|
|
188
|
+
|
|
119
189
|
/**
|
|
120
190
|
* Passbolt ~ Open source password manager for teams
|
|
121
191
|
* Copyright (c) Passbolt SA (https://www.passbolt.com)
|