passbolt-styleguide 5.18.2 → 5.19.0-alpha.2
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 +7 -2
- package/build/css/themes/default/api_authentication.min.css +4 -4
- package/build/css/themes/default/api_main.min.css +4 -4
- package/build/css/themes/default/ext_app.min.css +4 -4
- package/build/css/themes/default/ext_authentication.min.css +4 -4
- package/build/css/themes/default/ext_external.min.css +2 -2
- package/build/css/themes/default/ext_in_form_cta.min.css +4 -4
- package/build/css/themes/default/ext_in_form_menu.min.css +4 -4
- package/build/css/themes/default/ext_quickaccess.min.css +4 -4
- package/build/css/themes/layette/api_authentication.min.css +4 -4
- package/build/css/themes/layette/api_main.min.css +4 -4
- package/build/css/themes/layette/ext_app.min.css +4 -4
- package/build/css/themes/layette/ext_authentication.min.css +4 -4
- package/build/css/themes/layette/ext_in_form_cta.min.css +4 -4
- package/build/css/themes/layette/ext_in_form_menu.min.css +4 -4
- package/build/css/themes/layette/ext_quickaccess.min.css +4 -4
- package/build/css/themes/midgar/api_authentication.min.css +4 -4
- package/build/css/themes/midgar/api_main.min.css +4 -4
- package/build/css/themes/midgar/ext_app.min.css +4 -4
- package/build/css/themes/midgar/ext_authentication.min.css +4 -4
- package/build/css/themes/midgar/ext_in_form_cta.min.css +4 -4
- package/build/css/themes/midgar/ext_in_form_menu.min.css +4 -4
- package/build/css/themes/midgar/ext_quickaccess.min.css +4 -4
- package/build/css/themes/sakura/api_authentication.min.css +4 -4
- package/build/css/themes/sakura/api_main.min.css +4 -4
- package/build/css/themes/sakura/ext_app.min.css +4 -4
- package/build/css/themes/sakura/ext_authentication.min.css +4 -4
- package/build/css/themes/sakura/ext_in_form_cta.min.css +4 -4
- package/build/css/themes/sakura/ext_in_form_menu.min.css +4 -4
- package/build/css/themes/sakura/ext_quickaccess.min.css +4 -4
- package/build/css/themes/solarized_dark/api_authentication.min.css +4 -4
- package/build/css/themes/solarized_dark/api_main.min.css +4 -4
- package/build/css/themes/solarized_dark/ext_app.min.css +4 -4
- package/build/css/themes/solarized_dark/ext_authentication.min.css +4 -4
- package/build/css/themes/solarized_dark/ext_in_form_cta.min.css +4 -4
- package/build/css/themes/solarized_dark/ext_in_form_menu.min.css +4 -4
- package/build/css/themes/solarized_dark/ext_quickaccess.min.css +4 -4
- package/build/css/themes/solarized_light/api_authentication.min.css +4 -4
- package/build/css/themes/solarized_light/api_main.min.css +4 -4
- package/build/css/themes/solarized_light/ext_app.min.css +4 -4
- package/build/css/themes/solarized_light/ext_authentication.min.css +4 -4
- package/build/css/themes/solarized_light/ext_in_form_cta.min.css +4 -4
- package/build/css/themes/solarized_light/ext_in_form_menu.min.css +4 -4
- package/build/css/themes/solarized_light/ext_quickaccess.min.css +4 -4
- package/build/css/themes/themes.json +1 -0
- package/build/js/dist/api-account-recovery.js +1 -1
- package/build/js/dist/api-app.js +1 -1
- package/build/js/dist/api-feedback.js +1 -1
- package/build/js/dist/api-mfa-verify-delegated.js +1 -1
- package/build/js/dist/api-mfa-verify.js +1 -1
- package/build/js/dist/api-recover.js +1 -1
- package/build/js/dist/api-setup.js +1 -1
- package/build/js/dist/api-triage.js +1 -1
- package/build/locales/cs-CZ/common.json +167 -13
- package/build/locales/de-DE/common.json +165 -13
- package/build/locales/es-ES/common.json +165 -13
- package/build/locales/fr-FR/common.json +165 -13
- package/build/locales/it-IT/common.json +165 -13
- package/build/locales/ja-JP/common.json +164 -13
- package/build/locales/ko-KR/common.json +164 -13
- package/build/locales/lt-LT/common.json +167 -13
- package/build/locales/nl-NL/common.json +165 -13
- package/build/locales/pl-PL/common.json +167 -13
- package/build/locales/pt-BR/common.json +165 -13
- package/build/locales/ro-RO/common.json +166 -13
- package/build/locales/ru-RU/common.json +167 -13
- package/build/locales/sl-SI/common.json +167 -13
- package/build/locales/sv-SE/common.json +165 -13
- package/build/locales/uk-UA/common.json +167 -13
- package/package.json +2 -2
- package/src/img/svg/logo.svg +2 -2
- package/src/locales/cs-CZ/common.json +167 -13
- package/src/locales/de-DE/common.json +165 -13
- package/src/locales/es-ES/common.json +165 -13
- package/src/locales/fr-FR/common.json +165 -13
- package/src/locales/it-IT/common.json +165 -13
- package/src/locales/ja-JP/common.json +164 -13
- package/src/locales/ko-KR/common.json +164 -13
- package/src/locales/lt-LT/common.json +167 -13
- package/src/locales/nl-NL/common.json +165 -13
- package/src/locales/pl-PL/common.json +167 -13
- package/src/locales/pt-BR/common.json +165 -13
- package/src/locales/ro-RO/common.json +166 -13
- package/src/locales/ru-RU/common.json +167 -13
- package/src/locales/sl-SI/common.json +167 -13
- package/src/locales/sv-SE/common.json +165 -13
- package/src/locales/uk-UA/common.json +167 -13
- package/src/react-extension/ExtAuthenticationLogin.js +1 -0
- package/src/react-extension/components/Administration/DisplayHealthcheckAdministration/DisplayHealthcheckAdministration.js +14 -23
- package/src/react-extension/components/UserSetting/DisplayUserTheme/DisplayUserTheme.js +2 -1
- package/src/react-extension/components/UserSetting/DisplayUserTheme/DisplayUserTheme.test.data.js +5 -0
- package/src/react-extension/components/UserSetting/DisplayUserTheme/DisplayUserTheme.test.js +13 -1
- package/src/react-extension/contexts/ResourceWorkspaceContext.js +3 -1
- package/src/react-extension/contexts/ResourceWorkspaceContext.test.js +8 -0
- package/src/react-web-integration/lib/Dom/DomUtils.js +1 -1
- package/src/react-web-integration/lib/Dom/DomUtils.test.js +19 -0
- package/src/react-web-integration/lib/InForm/InFormCallToActionField.js +5 -1
- package/src/react-web-integration/lib/InForm/InFormCallToActionField.test.js +39 -0
- package/src/react-web-integration/lib/InForm/InFormManager.js +36 -13
- package/src/react-web-integration/lib/InForm/InformManager.test.js +255 -6
- package/src/react-web-integration/lib/InForm/InformManager.test.page.js +7 -7
- package/src/react-web-integration/lib/InForm/ScrapingDictionary.js +1 -1
- package/src/react-web-integration/services/Scraping/FieldScraperService.js +7 -4
- package/src/react-web-integration/services/Scraping/LabelIndex.js +86 -0
- package/src/react-web-integration/services/Scraping/LabelIndex.test.js +111 -0
- package/src/react-web-integration/services/Scraping/LabelScraperService.js +18 -14
- package/src/react-web-integration/services/Scraping/LabelScraperService.test.js +5 -5
- package/src/react-web-integration/services/Scraping/PageScraperHelpers.js +21 -5
- package/src/react-web-integration/services/Scraping/PageScraperHelpers.test.js +116 -0
- package/src/react-web-integration/services/Scraping/PageScraperService.js +6 -3
- package/src/react-web-integration/services/classification/FieldClassificationService.js +46 -40
- package/src/react-web-integration/services/classification/FieldClassificationService.test.data.js +3 -2
- package/src/react-web-integration/services/classification/FieldClassificationService.test.js +72 -0
- package/src/react-web-integration/services/classification/FieldFeatureService.js +12 -14
- package/src/react-web-integration/services/classification/FieldFeatureService.test.js +25 -11
- package/src/react-web-integration/services/classification/FieldsRationalizationService.js +1 -1
- package/src/react-web-integration/services/classification/KeywordMatchingService.js +18 -4
- package/src/react-web-integration/services/classification/KeywordMatchingService.test.js +35 -0
- package/src/react-web-integration/services/classification/KeywordsDictionary.js +21 -1
- package/src/react-web-integration/services/classification/PasswordRoleResolutionService.js +2 -2
- package/src/react-web-integration/services/classification/SegmentedOtpResolutionService.js +2 -2
- package/src/shared/utils/filterUtils.js +3 -2
- package/src/shared/utils/filterUtils.test.js +15 -0
- package/build/css/help.min.css +0 -9
- package/build/css/public.min.css +0 -8
- package/build/css/themes/default/api_cloud.min.css +0 -8
- package/build/css/themes/default/api_reports.min.css +0 -9
- package/build/css/themes/default/api_webinstaller.min.css +0 -9
- package/build/css/themes/layette/api_reports.min.css +0 -9
- package/build/css/themes/midgar/api_reports.min.css +0 -9
- package/build/css/themes/sakura/api_reports.min.css +0 -9
- package/build/css/themes/solarized_dark/api_reports.min.css +0 -9
- package/build/css/themes/solarized_light/api_reports.min.css +0 -9
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see api-account-recovery.js.LICENSE.txt */
|
|
2
|
-
(()=>{"use strict";var e={86943(e,t,s){var n=s(96540),i=s(5338);const r=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 o(e){return class extends n.Component{render(){return n.createElement(r.Consumer,null,t=>n.createElement(e,{context:t,...this.props}))}}}const a=r;var l=s(5556),c=s.n(l);class d extends Error{constructor(e,t){super(e),this.name="PassboltApiFetchError",this.data=t||{}}}const p=d;class u extends Error{constructor(){super("An internal error occurred. The server response could not be parsed. Please contact your administrator."),this.name="PassboltBadResponseError"}}const h=u;class m extends Error{constructor(e){super(e=e||"The service is unavailable"),this.name="PassboltServiceUnavailableError"}}const g=m,E=["GET","POST","PUT","DELETE"];class y{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"}setApiVersion(e){if("string"!=typeof e)throw new TypeError("ApiClient.setApiVersion error: apiVersion should be a string.");this.apiVersion=`api-version=${e}`}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(E.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 g("Unable to reach the server, an unexpected error occurred"):new g("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 h(t,e)}if(!e.ok){const s=t.header.message;throw new p(s,{header:t.header,code:e.status,body:t.body})}return t}}const b=class{constructor(e){e.setResourceName("auth"),this.apiClient=new y(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 f{static reload(){window.location.reload()}static assign(e){window.location.assign(e)}static getHostname(){return window.location.hostname}}const T=n.createContext({userId:null,authenticationToken:null,state:null,unexpectedError:null,onInitializeAccountRecoveryRequested:()=>{},logoutUserAndRefresh:()=>{}});class S extends n.Component{constructor(e){super(e),this.state=Object.assign(this.defaultState,e.value),this.authLogoutService=new b(e.context.getApiClientOptions())}get defaultState(){return{userId:null,authenticationToken:null,state:v.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:v.REQUEST_INVITATION_ERROR});try{await this.verifyCanContinueAccountRecovery(),this.setState({state:v.RESTART_FROM_SCRATCH})}catch(e){await this.handleVerifyCanContinueAccountRecoveryError(e)}}async verifyCanContinueAccountRecovery(){const e=this.props.context.getApiClientOptions();e.setResourceName("account-recovery");const t=new y(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:v.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:v.TOKEN_EXPIRED_STATE})}this.setState({state:v.UNEXPECTED_ERROR_STATE,unexpectedError:e})}async logoutUserAndRefresh(){try{await this.authLogoutService.logout()}catch(e){const t=new g(e.message);return this.setState({unexpectedError:t,state:v.UNEXPECTED_ERROR_STATE})}f.reload()}render(){return n.createElement(T.Provider,{value:this.state},this.props.children)}}S.propTypes={context:c().any,value:c().any,children:c().any};const w=o(S),v={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 A{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 R;function C(){return C=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},C.apply(null,arguments)}const x=function(e){return n.createElement("svg",C({xmlns:"http://www.w3.org/2000/svg",width:17,height:16,fill:"none",viewBox:"0 0 17 16"},e),R||(R=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 N=s(91352),I=s(13279);class O 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))}}O.defaultProps={direction:"right"},O.propTypes={children:c().any,message:c().any.isRequired,direction:c().string};const _=O;var P=s(28097),k=s(44296);const U=n.createContext({dialogs:[],open:()=>{},close:()=>{}});class D extends n.Component{constructor(e){super(e),this.state=this.defaultState}get defaultState(){return{dialogs:[],open:(e,t)=>{const s=(0,k.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(U.Provider,{value:this.state},this.props.children)}}function q(e){return class extends n.Component{render(){return n.createElement(U.Consumer,null,t=>n.createElement(e,{dialogContext:t,...this.props}))}}}D.displayName="DialogContextProvider",D.propTypes={children:c().any};var G=s(75410);const L=["/app/administration","/app/administration/mfa","/app/administration/mfa-policy","/app/administration/password-policies","/app/administration/secret-history","/app/administration/self-registration","/app/administration/users-directory","/app/administration/healthcheck","/app/administration/email-notification","/app/administration/smtp-settings","/app/administration/subscription","/app/administration/ce-downgrade","/app/administration/internationalization","/app/administration/account-recovery","/app/administration/sso","/app/administration/rbacs","/app/administration/content-types/metadata-getting-started","/app/administration/user-provisionning/scim","/app/administration/user-passphrase-policies","/app/administration/password-expiry","/app/administration/content-types/metadata","/app/administration/content-types/metadata-key","/app/administration/migrate-metadata","/app/administration/allow-content-types","/app/administration/subscription-teasing","/app/administration/password-policies-teasing","/app/administration/user-passphrase-policies-teasing","/app/administration/account-recovery-teasing","/app/administration/sso-teasing","/app/administration/mfa-policy-teasing","/app/administration/users-directory-teasing","/app/administration/scim-teasing","/app/administration/offline","/app/passwords","/app/users","/app/settings/profile","/app/settings/passphrase","/app/settings/security-token","/app/settings/theme","/app/settings/mfa","/app/settings/keys","/app/settings/mobile","/app/settings/desktop","/app/settings/account-recovery"],M=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:()=>{},onGoToSubscriptionUpdateQuantityRequested:()=>{},onGoToSubscriptionRenewRequested:()=>{},onGoToAdministrationRbacsRequested:()=>{},onGoToAdministrationMigrateMetadataRequested:()=>{},onGoToAdministrationAllowContentTypesRequested:()=>{},onGoToAdministrationMetadataGettingStartedRequested:()=>{},onGoToAdministrationSubscriptionRequestedTeasing:()=>{},onGoToAdministrationPasswordPoliciesRequestedTeasing:()=>{},onGoToAdministrationUserPassphrasePoliciesRequestedTeasing:()=>{},onGoToAdministrationAccountRecoveryRequestedTeasing:()=>{},onGoToAdministrationSsoRequestedTeasing:()=>{},onGoToAdministrationMfaPolicyRequestedTeasing:()=>{},onGoToAdministrationUsersDirectoryRequestedTeasing:()=>{},onGoToAdministrationScimRequestedTeasing:()=>{},onGoToAdministrationScimRequested:()=>{},onGoToAdministrationOfflineRequested:()=>{}});class $ extends n.Component{constructor(e){super(e),this.state=this.defaultState}get defaultState(){return{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),onGoToSubscriptionUpdateQuantityRequested:this.onGoToSubscriptionUpdateQuantityRequested.bind(this),onGoToSubscriptionRenewRequested:this.onGoToSubscriptionRenewRequested.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),onGoToAdministrationOfflineRequested:this.onGoToAdministrationOfflineRequested.bind(this)}}async goTo(e,t){if(!L.includes(t))throw new Error("The pathname is not part of the allowed list of pathnames.");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")}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 onGoToAdministrationOfflineRequested(){await this.goTo("browser-extension","/app/administration/offline")}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(){window.open("https://www.passbolt.com/docs/","_blank","noopener,noreferrer")}async onGoToTermsRequested(){window.open("https://www.passbolt.com/terms","_blank","noopener,noreferrer")}async onGoToSubscriptionUpdateQuantityRequested(e,t){const s=`https://www.passbolt.com/subscription/ee/update/qty?subscription_id=${encodeURIComponent(e)}&customer_id=${encodeURIComponent(t)}`;window.open(s,"_blank","noopener,noreferrer")}async onGoToSubscriptionRenewRequested(e,t){const s=`https://www.passbolt.com/subscription/ee/update/renew?subscription_id=${encodeURIComponent(e)}&customer_id=${encodeURIComponent(t)}`;window.open(s,"_blank","noopener,noreferrer")}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 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(M.Provider,{value:this.state},this.props.children)}}$.displayName="NavigationContextProvider",$.propTypes={context:c().object,children:c().any,location:c().object,match:c().object,history:c().object},(0,G.withRouter)(o($));const F=n.createContext({counter:[],add:()=>{},remove:()=>{}});class K 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(F.Provider,{value:this.state},this.props.children)}}K.propTypes={children:c().any};class V{}class j extends V{static execute(){return!0}}class B extends V{static execute(){return!1}}const H="Folders.use",W="Administration.viewWorkspace",Y="GroupsAdd.addPost",z="AccountRecoveryRequestsView.view",X="AccountRecoveryRequestsIndex.index",J="AccountRecoveryResponsesCreate.post",Q="Allow",Z="Deny",ee="AllowIfGroupManagerInOneGroup",te={[Q]:j,[Z]:B,[ee]:class extends V{static execute(e){return e.groups_users.some(e=>e.is_admin)}}},se={[H]:te[Q]},ne={[W]:te[Z],[Y]:te[Z],[z]:te[Z],[X]:te[Z],[J]:te[Z]};class ie{static getByRbac(e){return te[e.controlFunction]||(console.warn(`Could not find control function for the given rbac entity (${e.id})`),B)}static getDefaultForAdminAndAction(e){return se[e]||j}static getDefaultForUserAndAction(e){return ne[e]||j}}class re 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 le||t instanceof re))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 le||this.errors[t]instanceof re?e[t]=this.errors[t].details:e[t]=this.errors[t];return e}}const oe=re;class ae 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 ae||t instanceof oe))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 le=ae;var ce=s(57761),de=s.n(ce);class pe{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 pe.validateObject(e,t,s);case"array":return pe.validateArray(e,t,s);default:throw new TypeError(`Could not validate entity ${e}. Unsupported type.`)}}static validateArray(e,t,s){let n;const i=pe.validateProp("items",t,s);if("number"==typeof s.minItems&&(pe.isGreaterThanOrEqual(t.length,s.minItems)||(n=pe.handleCollectionValidationError("minItems",`The items array should contain at least ${s.minItems} item(s).`,n))),"number"==typeof s.maxItems&&(pe.isLessThanOrEqual(t.length,s.maxItems)||(n=pe.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=pe.getOrInitEntityValidationError(e,o),o.addError(s,"required",`The ${s} is required.`);continue}}else if(!Object.prototype.hasOwnProperty.call(t,s))continue;try{r[s]=pe.validateProp(s,t[s],i[s])}catch(t){if(!(t instanceof le))throw t;o=pe.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 le(`Could not validate entity ${e}.`)}static validateProp(e,t,s){if(s.anyOf)return pe.validateAnyOf(e,t,s.anyOf),t;if(!0===s.nullable&&null===t)return t;if(pe.validatePropType(e,t,s),s.enum)return pe.validatePropEnum(e,t,s),t;switch(s.type){case"string":pe.validatePropTypeString(e,t,s);break;case"integer":case"number":pe.validatePropTypeNumber(e,t,s);break;case"array":pe.validatePropTypeArray(e,t,s);break;case"object":case"boolean":case"blob":case"null":break;case"x-custom":pe.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(!pe.isValidPropType(t,s.type))throw pe.handlePropertyValidationError(e,"type",`The ${e} is not a valid ${s.type}.`)}static validatePropCustom(e,t,s){try{s.validationCallback(t)}catch(t){throw pe.handlePropertyValidationError(e,"custom",`The ${e} is not valid: ${t.message}`)}}static validatePropTypeString(e,t,s){let n;if(s.format&&(pe.isValidStringFormat(t,s.format)||(n=pe.handlePropertyValidationError(e,"format",`The ${e} is not a valid ${s.format}.`,n))),s.length&&(pe.isValidStringLength(t,s.length,s.length)||(n=pe.handlePropertyValidationError(e,"length",`The ${e} should be ${s.length} character in length.`,n))),s.minLength&&(pe.isValidStringLength(t,s.minLength)||(n=pe.handlePropertyValidationError(e,"minLength",`The ${e} should be ${s.minLength} character in length minimum.`,n))),s.maxLength&&(pe.isValidStringLength(t,0,s.maxLength)||(n=pe.handlePropertyValidationError(e,"maxLength",`The ${e} should be ${s.maxLength} character in length maximum.`,n))),s.pattern&&(de().matches(t,s.pattern)||(n=pe.handlePropertyValidationError(e,"pattern",`The ${e} is not valid.`,n))),s.custom&&(s.custom(t)||(n=pe.handlePropertyValidationError(e,"custom",`The ${e} is not valid.`,n))),n)throw n}static handlePropertyValidationError(e,t,s,n=null){return(n=n||new le(`Could not validate property ${e}.`)).addError(e,t,s),n}static handleCollectionValidationError(e,t,s=null){return(s=s||new oe("Could not validate collection.")).addCollectionValidationError(e,t),s}static validatePropTypeNumber(e,t,s){let n;if("number"==typeof s.minimum&&(pe.isGreaterThanOrEqual(t,s.minimum)||(n=pe.handlePropertyValidationError(e,"minimum",`The ${e} should be greater or equal to ${s.minimum}.`,n))),"number"==typeof s.maximum&&(pe.isLesserThanOrEqual(t,s.maximum)||(n=pe.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 le))throw t;{n=pe.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(!pe.isPropInEnum(t,s.enum)){const t=new le(`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 pe.validateProp(e,t,s[n])}catch{}const n=new le(`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 de().isUUID(e);case"email":case"idn-email":return de().isEmail(e);case"date-time":return de().isISO8601(e);case"x-hex-color":return de().isHexColor(e);case"x-base64":return de().isBase64(e);default:throw new TypeError(`EntitySchema string validation format ${t} is not supported.`)}}static isValidStringLength(e,t,s){return t=t||0,de().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 ue=pe;class he{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=he._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 he._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 me=he;var ge=s(5648);const Ee=e=>e?.replace(/_([a-z])/g,(e,t)=>t.toUpperCase());class ye 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 be=ye;class fe{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 be(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 le,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 Te=fe,Se=["string","number","integer","boolean"];class we extends me{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 le))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=ue.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 le;for(const[s,n]of Object.entries(this.constructor.associations))try{this._props[s]&&(this[`_${Ee(s)}`]=new n(this._props[s],{...e,clone:!1}),delete this._props[s])}catch(e){if(!(e instanceof le))throw e;t.addAssociationError(s,e)}if(t.hasErrors())throw t}}static get associations(){return{}}get(e){(0,ge.A)(e);const t=this.constructor.getSchema().properties[e];if(!t)throw new Error(`The property "${e}" has no schema definition.`);if(!Se.includes(t?.type))throw new Error('The property "associated_entity" should reference scalar properties only.');return this._props[e]}set(e,t,s={}){(0,ge.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&&!Se.includes(r?.type))throw new Error('The property "associated_entity" should reference scalar properties only.');if(r?.anyOf?.some(e=>!Se.includes(e.type)))throw new Error('The property "associated_entity" should reference scalar properties only.');n&&ue.validateProp(i,t,r),this._props[i]=t}}}setArrayProp(e,t,s){(0,ge.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(!Se.includes(o.items.type))throw new Error('The property "associated_entity" with array type should reference scalar properties only.');a&&ue.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,ge.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,ge.A)(e),this.isAssociation(e)){const n=e.split("."),i=Ee(n[0]);if(n.length>1)if(this[`_${i}`]||(this[`_${i}`]=new this.constructor.associations[n[0]]({},{validate:!1})),this[`_${i}`]instanceof Te){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 le;if(Object.keys(this.constructor.associations).length>0&&Object.keys(this.constructor.associations).forEach(s=>{const n=Ee(s);if(this[`_${n}`]){const i=this[n].validate(e);i&&t.addAssociationError(s,i)}}),t.hasErrors())throw t}diffProps(e){if(!(e instanceof we))throw new TypeError('The property "compareEntity" should be of "EntityV2" type.');const t={},s=this.constructor.getSchema(),n=Object.keys(s.properties).filter(e=>Se.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 ve=we;class Ae extends ve{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()===Ae.ROLE_ADMIN}isUser(){return this.name.toLowerCase()===Ae.ROLE_USER}isGuest(){return this.name.toLowerCase()===Ae.ROLE_GUEST}isAReservedRole(){return this.isAdmin()||this.isUser()||this.isGuest()}verifyHealth(){let e=null;return 50===this.name.length&&(e=new le,e.addError("name","maxLength","name reached maximum length limit")),e}assertNoTrailingSpaces(e,t){if(t.trim()!==t){const t=new le;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 Re{static canRoleUseAction(e,t,s){if("undefined"!=typeof window&&window.chrome?.webview){const n=t.findRbacByActionName(s);if(n)return ie.getByRbac(n).execute(e)}const n=new Ae(e.role);if(n.isAdmin())return ie.getDefaultForAdminAndAction(s).execute();const i=t.findRbacByRoleAndActionName(n,s);return this.getByRbacOrDefault(i,s,e)}static getByRbacOrDefault(e,t,s){return e?ie.getByRbac(e).execute(s):ie.getDefaultForUserAndAction(t).execute()}}const Ce=n.createContext({canIUseAction:()=>{}});class xe extends n.Component{constructor(e){super(e),this.state=this.defaultState}get defaultState(){return{canIUseAction:this.canIUseAction.bind(this)}}canIUseAction(e){return Re.canRoleUseAction(this.props.context.loggedInUser,this.props.context.rbacs,e)}render(){return n.createElement(Ce.Provider,{value:this.state},this.props.children)}}xe.propTypes={context:c().any,children:c().any},o(xe);const Ne=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 Ie extends n.Component{constructor(e){super(e),this.state=this.defaultState}get defaultState(){return{selectedAdministration:Pe.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(W))return e.selectedAdministration=Pe.HTTP_403_ACCESS_DENIED,void this.setState(e);const t=this.props.location.pathname,s=Ue.homePage.test(t),n=Ue.mfa.test(t),i=Ue.mfaPolicy.test(t),r=Ue.passwordPolicies.test(t),o=Ue.usersDirectory.test(t),a=Ue.emailNotification.test(t),l=Ue.subscription.test(t),c=Ue.internationalization.test(t),d=Ue.accountRecovery.test(t),p=Ue.smtpSettings.test(t),u=Ue.selfRegistration.test(t),h=Ue.sso.test(t),m=Ue.rbac.test(t),g=Ue.userPassphrasePolicies.test(t),E=Ue.passwordExpirySettings.test(t),y=Ue.healthcheck.test(t),b=Ue.contentTypesEncryptedMetadata.test(t),f=Ue.contentTypesMetadataKey.test(t),T=Ue.migrateEncryptedMetadata.test(t),S=Ue.allowContentTypes.test(t),w=Ue.gettingStarted.test(t),v=Ue.scim.test(t),A=Ue.secretHistory.test(t),R=Ue.ceDowngrade.test(t),C=Ue.offline.test(t),x=Ue.mfaPolicyTeasing.test(t),N=Ue.passwordPoliciesTeasing.test(t),I=Ue.usersDirectoryTeasing.test(t),O=Ue.subscriptionTeasing.test(t),_=Ue.accountRecoveryTeasing.test(t),P=Ue.userPassphrasePoliciesTeasing.test(t),k=Ue.ssoTeasing.test(t),U=Ue.scimTeasing.test(t);let D;if(s?D=Pe.HOME:i||x?D=Pe.MFA_POLICY:r||N?D=Pe.PASSWORD_POLICIES:n?D=Pe.MFA:o||I?D=Pe.USER_DIRECTORY:a?D=Pe.EMAIL_NOTIFICATION:l||O?D=Pe.SUBSCRIPTION:c?D=Pe.INTERNATIONALIZATION:d||_?D=Pe.ACCOUNT_RECOVERY:p?D=Pe.SMTP_SETTINGS:u?D=Pe.SELF_REGISTRATION:h||k?D=Pe.SSO:m?D=Pe.RBAC:g||P?D=Pe.USER_PASSPHRASE_POLICIES:E?D=Pe.PASSWORD_EXPIRY:y?D=Pe.HEALTHCHECK:b?D=Pe.CONTENT_TYPES_ENCRYPTED_METADATA:f?D=Pe.CONTENT_TYPES_METADATA_KEY:T?D=Pe.MIGRATE_METADATA:S?D=Pe.ALLOW_CONTENT_TYPES:w?D=Pe.METADATA_GETTING_STARTED:v||U?D=Pe.SCIM:A?D=Pe.SECRET_HISTORY:R?D=Pe.CE_DOWNGRADE:C&&(D=Pe.OFFLINE),!D)return e.selectedAdministration=Pe.HTTP_404_NOT_FOUND,void this.setState(e);const q=ke?.[D];e.selectedAdministration=q&&!(this.props.context.siteSettings.canIUse(q)||De.includes(D)&&this.props.context.siteSettings.isCommunityEdition)?Pe.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(Ne.Provider,{value:this.state},this.props.children)}}var Oe;function _e(e){return class extends n.Component{render(){return n.createElement(Ne.Consumer,null,t=>n.createElement(e,{administrationWorkspaceContext:t,...this.props}))}}}Ie.displayName="AdministrationWorkspaceContextProvider",Ie.propTypes={context:c().object,children:c().any,location:c().object,match:c().object,history:c().object,loadingContext:c().object,rbacContext:c().object},(0,G.withRouter)(o(function(e){return class extends n.Component{render(){return n.createElement(Ce.Consumer,null,t=>n.createElement(e,{rbacContext:t,...this.props}))}}}((Oe=Ie,class extends n.Component{render(){return n.createElement(F.Consumer,null,e=>n.createElement(Oe,{loadingContext:e,...this.props}))}}))));const Pe={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",OFFLINE:"OFFLINE"},ke={[Pe.MFA]:"multiFactorAuthentication",[Pe.MFA_POLICY]:"mfaPolicies",[Pe.PASSWORD_POLICIES]:"passwordPoliciesUpdate",[Pe.USER_DIRECTORY]:"directorySync",[Pe.SUBSCRIPTION]:"ee",[Pe.INTERNATIONALIZATION]:"locale",[Pe.ACCOUNT_RECOVERY]:"accountRecovery",[Pe.SMTP_SETTINGS]:"smtpSettings",[Pe.SELF_REGISTRATION]:"selfRegistration",[Pe.SSO]:"sso",[Pe.RBAC]:"rbacs",[Pe.USER_PASSPHRASE_POLICIES]:"userPassphrasePolicies",[Pe.PASSWORD_EXPIRY]:"passwordExpiry",[Pe.HEALTHCHECK]:"healthcheckUi",[Pe.CONTENT_TYPES_ENCRYPTED_METADATA]:"metadata",[Pe.CONTENT_TYPES_METADATA_KEY]:"metadata",[Pe.MIGRATE_METADATA]:"metadata",[Pe.ALLOW_CONTENT_TYPES]:"metadata",[Pe.METADATA_GETTING_STARTED]:"metadata",[Pe.SCIM]:"scim",[Pe.SECRET_HISTORY]:"secretRevisions",[Pe.CE_DOWNGRADE]:"ee",[Pe.OFFLINE]:"offlineMode"},Ue={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\/?$/,offline:/^\/app\/administration\/offline\/?$/},De=[Pe.SUBSCRIPTION,Pe.PASSWORD_POLICIES,Pe.USER_PASSPHRASE_POLICIES,Pe.ACCOUNT_RECOVERY,Pe.SSO,Pe.MFA_POLICY,Pe.USER_DIRECTORY,Pe.SCIM],qe=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}},Ge=n.createContext({getSubscription:()=>{},findSubscriptionKey:()=>{},isProcessing:()=>{},setProcessing:()=>{},getActiveUsers:()=>{},clearContext:()=>{}});class Le extends n.Component{constructor(e){super(e),this.state=this.defaultState}get defaultState(){return{subscription:new qe,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 qe;try{const t=await this.props.context.onGetSubscriptionKeyRequested();e=new qe(t.toDto())}catch(t){"PassboltSubscriptionError"===t.name&&(e=new qe(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(Ge.Provider,{value:this.state},this.props.children)}}function Me(e){return class extends n.Component{render(){return n.createElement(Ge.Consumer,null,t=>n.createElement(e,{adminSubscriptionContext:t,...this.props}))}}}var $e;function Fe(){return Fe=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},Fe.apply(null,arguments)}Le.propTypes={context:c().any,children:c().any},o(Le);const Ke=function(e){return n.createElement("svg",Fe({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none",viewBox:"0 0 16 16"},e),$e||($e=n.createElement("path",{stroke:"var(--icon-color)",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"m12 4-8 8M4 4l8 8"})))};class Ve 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(Ke,{className:"svg-icon close"}),n.createElement("span",{className:"visually-hidden"},n.createElement(N.x,null,"Close")))}}Ve.propTypes={onClose:c().func,disabled:c().bool};const je=(0,I.C)("common")(Ve);var Be;function He(){return He=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},He.apply(null,arguments)}const We=function(e){return n.createElement("svg",He({xmlns:"http://www.w3.org/2000/svg",width:17,height:18,fill:"none",viewBox:"0 0 17 18"},e),Be||(Be=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 Ye 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(We,null))),n.createElement(je,{onClose:this.handleClose,disabled:this.props.disabled})),n.createElement("div",{className:"dialog-content"},this.props.children)))}}Ye.propTypes={children:c().node,className:c().string,title:c().oneOfType([c().arrayOf(c().node),c().node,c().string]),subtitle:c().string,tooltip:c().node,disabled:c().bool,onClose:c().func};const ze=Ye,Xe=n.createContext({feedbacks:[],displaySuccess:()=>{},displayWarning:()=>{},displayError:()=>{},remove:()=>{}});class Je 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,k.A)(),type:"success",message:e}]})}displayWarning(e){this.setState({feedbacks:[...this.state.feedbacks,{id:(0,k.A)(),type:"warning",message:e}]})}displayError(e){this.setState({feedbacks:[...this.state.feedbacks,{id:(0,k.A)(),type:"error",message:e}]})}remove(e){this.setState(t=>({feedbacks:t.feedbacks.filter(t=>e.id!==t.id)}))}render(){return n.createElement(Xe.Provider,{value:this.state},this.props.children)}}var Qe;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)}Je.displayName="ActionFeedbackContextProvider",Je.propTypes={children:c().any};const et=function(e){return n.createElement("svg",Ze({xmlns:"http://www.w3.org/2000/svg",width:10,height:8,fill:"none",viewBox:"0 0 10 8"},e),Qe||(Qe=n.createElement("path",{stroke:"var(--icon-color)",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"m1 2 4 4 4-4"})))};var tt;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=function(e){return n.createElement("svg",st({xmlns:"http://www.w3.org/2000/svg",width:8,height:10,fill:"none",viewBox:"0 0 8 10"},e),tt||(tt=n.createElement("path",{stroke:"var(--icon-color)",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"m2 9 4-4-4-4"})))};class it 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(ze,{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(N.x,null,"Error details")),this.state.showErrorDetails?n.createElement(et,{className:"baseline svg-icon"}):n.createElement(nt,{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(N.x,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")))}}it.propTypes={title:c().string,error:c().object.isRequired,onClose:c().func,t:c().func};const rt=(0,I.C)("common")(it);var ot,at;function lt(){return lt=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},lt.apply(null,arguments)}const ct=function(e){return n.createElement("svg",lt({width:18,height:18,fill:"none",className:"svg-icon spinner",viewBox:"0 0 18 18"},e),ot||(ot=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)"})),at||(at=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 dt 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(N.x,null,"Save"),this.props.processing&&n.createElement(ct,null))}}dt.defaultProps={warning:!1,attention:!1},dt.propTypes={processing:c().bool,disabled:c().bool,value:c().oneOfType([c().arrayOf(c().node),c().node,c().string]),warning:c().bool,attention:c().bool,big:c().bool,medium:c().bool,fullWidth:c().bool};const pt=(0,I.C)("common")(dt);class ut 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)}}ut.defaultProps={value:n.createElement(N.x,null,"Cancel")},ut.propTypes={disabled:c().bool,onClick:c().func,value:c().oneOfType([c().arrayOf(c().node),c().node,c().string])};const ht=(0,I.C)("common")(ut),mt=class extends ve{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"}},gt=class{constructor(e){this.port=e}async createOrganizationSubscriptionKey(e){(0,ge.A)(e);const t=await this.port.request("passbolt.subscription.create",{data:e});return new mt(t)}async findOrganizationSubscriptionKey(){const e=await this.port.request("passbolt.subscription.get");return new mt(e)}async updateOrganizationSubscriptionKey(e){(0,ge.A)(e);const t=await this.port.request("passbolt.subscription.update",{data:e});return new mt(t)}async deleteOrganizationSubscriptionKey(){await this.port.request("passbolt.subscription.downgrade")}};class Et extends n.Component{constructor(e){super(e),this.state=this.getDefaultState(),this.initEventHandlers(),this.createInputRef(),this.subscriptionKeyService=new gt(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(rt,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(ze,{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(N.x,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(N.x,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(ht,{disabled:this.hasAllInputDisabled(),onClick:this.handleCloseClick}),n.createElement(pt,{disabled:this.hasAllInputDisabled(),processing:this.state.processing,value:this.translate("Save")}))))}}Et.propTypes={context:c().any,onClose:c().func,actionFeedbackContext:c().any,adminSubscriptionContext:c().object,dialogContext:c().any,administrationWorkspaceContext:c().any,title:c().string,warning:c().string,onSave:c().func,t:c().func};const yt=o(Me(_e(function(e){return class extends n.Component{render(){return n.createElement(Xe.Consumer,null,t=>n.createElement(e,{actionFeedbackContext:t,...this.props}))}}}(q((0,I.C)("common")(Et))))));class bt{constructor(e){this.context=e.context,this.dialogContext=e.dialogContext,this.subscriptionContext=e.adminSubscriptionContext}static getInstance(e){return this.instance||(this.instance=new bt(e)),this.instance}static killInstance(){this.instance=null}editSubscription(){const e={key:this.subscriptionContext.getSubscription().data};this.context.setContext({editSubscriptionKey:e}),this.dialogContext.open(yt)}}const ft=bt;var Tt=s(40961);var St,wt;function vt(){return vt=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},vt.apply(null,arguments)}const At=function(e){return n.createElement("svg",vt({xmlns:"http://www.w3.org/2000/svg",width:18,height:18,fill:"none",viewBox:"0 0 18 18"},e),St||(St=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"})),wt||(wt=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 Rt;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 xt=function(e){return n.createElement("svg",Ct({xmlns:"http://www.w3.org/2000/svg",width:18,height:18,fill:"none",viewBox:"0 0 18 18"},e),Rt||(Rt=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"})))},Nt="Pro Edition",It="Community Edition";class Ot extends n.Component{constructor(e){super(e),this.state=this.defaultState,this.bindCallbacks(),this.subscriptionActionService=ft.getInstance(this.props),this.subscriptionKeyService=new gt(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(),ft.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(yt,{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.onGoToSubscriptionUpdateQuantityRequested(e.subscriptionId,e.customerId):(this.hasSubscriptionKeyExpired()||this.hasSubscriptionKeyGoingToExpire())&&this.props.navigationContext.onGoToSubscriptionRenewRequested(e.subscriptionId,e.customerId)}handleUpdateKey(){this.subscriptionActionService.editSubscription()}hasEditionPlugin(){return this.props.context.siteSettings.canIUse("edition")}hasSubscriptionKeyExpired(){return P.c9.fromISO(this.props.adminSubscriptionContext.getSubscription().expiry)<P.c9.now()}hasSubscriptionKeyGoingToExpire(){return!this.hasSubscriptionKeyExpired()&&P.c9.fromISO(this.props.adminSubscriptionContext.getSubscription().expiry)<P.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 P.c9.fromISO(e).setLocale(this.props.context.locale).toLocaleString(P.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(N.x,null,"Subscription")),n.createElement("h3",null,n.createElement(N.x,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(N.x,null,"Edition:")),n.createElement("span",{className:"server-version label"},n.createElement(N.x,null,"Server version:")),n.createElement("span",{className:"client-version label"},n.createElement(N.x,null,"Client version:")),!this.props.context.siteSettings.isCommunityEdition&&n.createElement(n.Fragment,null,n.createElement("span",{className:"email label"},n.createElement(N.x,null,"Email:")),n.createElement("span",{className:"users label"},n.createElement(N.x,null,"Users limit:")))),n.createElement("div",{className:"information-value"},n.createElement("span",{className:"edition value"},!this.props.context.siteSettings.isCommunityEdition&&Nt,this.props.context.siteSettings.isCommunityEdition&&n.createElement(n.Fragment,null,It,n.createElement("span",{className:"subtitle"},n.createElement(N.x,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(N.x,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(N.x,null,"Customer id:")),n.createElement("span",{className:"subscription-id label"},n.createElement(N.x,null,"Subscription id:")),n.createElement("span",{className:"created label"},n.createElement(N.x,null,"Valid from:")),n.createElement("span",{className:"expiry label"},n.createElement(N.x,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=P.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(xt,null),n.createElement(N.x,null,"Your subscription key is expired.")),this.hasLimitUsersExceeded()&&n.createElement("div",{className:"subscription-warning"},n.createElement(xt,null),n.createElement(N.x,null,"Your users limit has been reached.")),this.hasInvalidSubscription()&&n.createElement("div",{className:"subscription-warning"},n.createElement(xt,null),n.createElement(N.x,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(N.x,null,"Renew subscription key")),n.createElement("button",{className:"button primary form",type:"button",onClick:this.handleUpdateKey},n.createElement(N.x,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(N.x,null,"Upload subscription key")))),n.createElement("h3",{className:"title"},n.createElement(N.x,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,It),n.createElement("span",{className:"subtitle"},n.createElement(N.x,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(N.x,null,"Current plan")))),n.createElement("div",{className:"features"},n.createElement("span",{className:"subtitle"},n.createElement(N.x,null,"Features included:")),n.createElement("ul",null,n.createElement("li",null,n.createElement(N.x,null,"Open source under AGPLV3 license")),n.createElement("li",null,n.createElement(N.x,null,"Passwords management & sharing")),n.createElement("li",null,n.createElement(N.x,null,"Private and shared folders")),n.createElement("li",null,n.createElement(N.x,null,"Users and groups management")),n.createElement("li",null,n.createElement(N.x,null,"Secret key authentication (2FA)")),n.createElement("li",null,n.createElement(N.x,null,"Additional factor authentication (3-step verification)")),n.createElement("li",null,n.createElement(N.x,null,"Open API")),n.createElement("li",null,n.createElement(N.x,null,"Role Based Access Control")),n.createElement("li",null,n.createElement(N.x,null,"Password expiry")),n.createElement("li",null,n.createElement(N.x,null,"Secret history")),n.createElement("li",null,n.createElement(N.x,null,"Community support"))))),this.shouldShowDowngradeSection()&&n.createElement("div",{className:"subscription-actions"},n.createElement("button",{className:"button",type:"button",onClick:this.handleDowngradeClick},n.createElement(N.x,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,Nt),!this.props.context.siteSettings.isCommunityEdition&&n.createElement("div",{className:"current-edition-indicator-wrapper"},n.createElement("div",{className:"current-edition-indicator"},n.createElement(N.x,null,"Current plan")))),n.createElement("div",{className:"features"},n.createElement("span",{className:"subtitle"},n.createElement(N.x,null,"Features include everything in Community, plus:")),n.createElement("ul",null,n.createElement("li",null,n.createElement(N.x,null,"Account recovery (Escrow)")),n.createElement("li",null,n.createElement(N.x,null,"Users provisioning (AD / OpenLDAP / SCIM)")),n.createElement("li",null,n.createElement(N.x,null,"Single Sign On (SSO) with Microsoft, Google and more")),n.createElement("li",null,n.createElement(N.x,null,"Activity log (audit changes)")),n.createElement("li",null,n.createElement(N.x,null,"Additional policies")),n.createElement("li",null,n.createElement(N.x,null,"Tags management")),n.createElement("li",null,n.createElement(N.x,null,"VM appliance")),n.createElement("li",null,n.createElement(N.x,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(N.x,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(N.x,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(N.x,null,"Start a free trial"))))))),(s=n.createElement("div",{className:"sidebar-help-section"},n.createElement("h3",null,n.createElement(N.x,null,"Need help?")),n.createElement("p",null,n.createElement(N.x,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(At,null),n.createElement("span",null,n.createElement(N.x,null,"Contact Sales")))),i=document.getElementById("administration-help-panel"),n.createElement(n.Fragment,null,i&&(0,Tt.createPortal)(s,i,void 0))));var s,i}}o(function(e){return class extends n.Component{render(){return n.createElement(M.Consumer,null,t=>n.createElement(e,{navigationContext:t,...this.props}))}}}(Me(_e(q((0,I.C)("common")(Ot))))));class _t 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(N.x,null,"Unsafe mode"))),!this.isCloud&&n.createElement(n.Fragment,null,this.props.context.siteSettings.isCommunityEdition&&n.createElement("li",null,It,n.createElement("span",{className:"edition-suffix"},n.createElement(N.x,null," (free)"))),!this.props.context.siteSettings.isCommunityEdition&&n.createElement("li",null,Nt)),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(x,null))),!this.versions&&n.createElement("a",{className:"button button-transparent inline",href:this.creditsUrl,target:"_blank",rel:"noopener noreferrer"},n.createElement(x,null)))))}}_t.propTypes={context:c().any,t:c().func};const Pt=o((0,I.C)("common")(_t)),kt=(e,t)=>t.split(".").reduce((e,t)=>e?.[t],e);s.dn(kt);const Ut=(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||[Dt.HTTP,Dt.HTTPS],n=[Dt.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(Ut);const Dt={FTP:"http:",FTPS:"https:",HTTP:"http:",HTTPS:"https:",JAVASCRIPT:"javascript:",SSH:"ssh:"},qt="enabled",Gt="disabled",Lt="not found";class Mt extends ve{static getSchema(){return{type:"object",required:[],properties:{status:{type:"string",enum:[qt,Gt,Lt]},app:{type:"object"},passbolt:{type:"object"},serverTimeDiff:{type:"integer",nullable:!0}}}}marshall(){void 0===this._props.status&&(this._props.status=qt),Mt.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:Gt}}toDto(){return{...this._props}}toJSON(){return this.toDto()}canIUse(e){const t=this._props?.passbolt?.plugins?.[e];return!(!t||"object"!=typeof t||void 0!==t.enabled&&!0!==t.enabled&&"true"!==t.enabled)}isPluginEnabled(e){return this.canIUse(e)}isFeatureBeta(e){return(0,ge.A)(e),kt(this._props,`passbolt.plugins.${e}.isInBeta`)||!1}getPluginSettings(e){return kt(this._props,`passbolt.plugins.${e}`)}getRememberMeOptions(){return(this.getPluginSettings("rememberMe")||{}).options||{}}get hasRememberMeUntilILogoutOption(){return void 0!==(this.getRememberMeOptions()||{})[-1]}get generatorConfiguration(){return kt(this._props,"passbolt.plugins.generator.configuration")}get locale(){return kt(this._props,"app.locale")||Mt.DEFAULT_LOCALE.locale}async setLocale(e){this._props.app||(this._props.app={}),this._props.app.locale=e}get supportedLocales(){return kt(this._props,"passbolt.plugins.locale.options")||Mt.DEFAULT_SUPPORTED_LOCALES}getServerTimezone(){return kt(this._props,"passbolt.app.server_timezone")}get termsLink(){const e=kt(this._props,"passbolt.legal.terms.url");return!!e&&Ut(e)}get privacyLink(){const e=kt(this._props,"passbolt.legal.privacy_policy.url");return!!e&&Ut(e)}get registrationPublic(){return!0===kt(this._props,"passbolt.registration.public")}get debug(){return!0===kt(this._props,"app.debug")}get url(){return kt(this._props,"app.url")||""}get version(){return kt(this._props,"app.version.number")}get isCommunityEdition(){return"ce"===kt(this._props,"passbolt.edition")}get emailValidateRegex(){return kt(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 qt}static get ORGANIZATION_DISABLED(){return Gt}static get ORGANIZATION_NOT_FOUND(){return Lt}static get DEFAULT_LOCALE(){return{locale:"en-UK",label:"English"}}static get DEFAULT_SUPPORTED_LOCALES(){return[Mt.DEFAULT_LOCALE]}}const $t=Mt;var Ft=s(72635),Kt=s(51831),Vt=s(32107);class jt extends n.Component{constructor(e){super(e),this.state=this.defaultState}get defaultState(){return{ready:!1}}async componentDidMount(){await(0,Ft.Yx)(Kt.r).use(Vt.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,Ft.v2)(this.locale)}get isReady(){return this.state.ready}render(){return n.createElement(n.Fragment,null,this.isReady&&this.props.children)}}jt.propTypes={context:c().any,loadingPath:c().any,children:c().any};const Bt=o(jt),Ht=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 Wt;function Yt(){return Yt=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},Yt.apply(null,arguments)}const zt=function(e){return n.createElement("svg",Yt({width:25,height:24,fill:"none",viewBox:"0 0 25 24"},e),Wt||(Wt=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 Xt 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(et,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(zt,{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(N.x,null,"No results match")," ",n.createElement("span",null,this.state.search))))))}}Xt.defaultProps={id:"",name:"select",className:"",direction:"bottom"},Xt.propTypes={id:c().string,name:c().string,className:c().string,direction:c().oneOf(Object.values({top:"top",bottom:"bottom",left:"left",right:"right"})),search:c().bool,items:c().array,value:Ht.allPropTypes(c().oneOfType([c().string,c().number,c().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:c().bool,onChange:c().func};const Jt=(0,I.C)("common")(Xt);class Qt 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(Jt,{id:"user-locale-input",className:"setup-extension",name:"locale",value:this.state.locale,disabled:!this.areActionsAllowed,items:this.supportedLocales,onChange:this.handleLocaleInputChange})))}}Qt.propTypes={context:c().any};const Zt=o(Qt),es="chrome",ts="edge",ss="firefox",ns="safari";function is(){const e=window.navigator.userAgent.toLowerCase();let t;return t=e.indexOf("firefox")>-1?ss:e.indexOf("samsungbrowser")>-1?"samsung":e.indexOf("opera")>-1||e.indexOf("opr")>-1?"opera":e.indexOf("trident")>-1?"internet-explorer":e.indexOf("edg")>-1?ts:e.indexOf("chrome")>-1?es:e.indexOf("safari")>-1?ns:"unknown",t}const rs=n.createContext({userId:null,token:null,state:null,unexpectedError:null,onInitializeRecoverRequested:()=>{},logoutUserAndRefresh:()=>{}});class os extends n.Component{constructor(e){super(e),this.state=Object.assign(this.defaultState,e.value),this.authLogoutService=new b(e.context.getApiClientOptions())}get defaultState(){return{userId:null,token:null,state:as.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:as.DOWNLOAD_SUPPORTED_BROWSER_STATE}):this.setState({state:as.REQUEST_INVITATION_ERROR})}handleStartRecoverSuccess(){const e=is()===ns?as.INSTALL_SAFARI_EXTENSION_STATE:as.INSTALL_EXTENSION_STATE;this.setState({state:e})}handleSafariExtensionDownloading(){const e=as.CONFIGURE_SAFARI_EXTENSION_STATE;this.setState({state:e})}handleSafariExtensionNotDownloaded(){const e=as.INSTALL_SAFARI_EXTENSION_STATE;this.setState({state:e})}handleExtensionAlreadyInstalled(){const e=as.CONFIGURE_SAFARI_EXTENSION_STATE;this.setState({state:e})}handleStartRecoverError(e){if(e instanceof p){if(403===e.data.code)return this.setState({state:as.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:as.TOKEN_EXPIRED_STATE});if(400===e?.data?.code)return this.setState({state:as.REQUEST_INVITATION_ERROR})}return this.setState({state:as.UNEXPECTED_ERROR_STATE})}async logoutUserAndRefresh(){try{await this.authLogoutService.logout()}catch(e){const t=new g(e.message);return this.setState({unexpectedError:t,state:as.UNEXPECTED_ERROR_STATE})}f.reload()}isBrowserSupported(){const e=is(),t=[es,ss,ts];return this.props.context.siteSettings.canIUse("safari")&&t.push(ns),t.includes(e)}async startRecover(){const e=this.props.context.getApiClientOptions();e.setResourceName("setup");const t=new y(e);await t.get(`recover/${this.state.userId}/${this.state.token}`)}render(){return n.createElement(rs.Provider,{value:this.state},this.props.children)}}os.propTypes={context:c().any,value:c().any,children:c().any},o(os);const as={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 ls extends n.Component{get statesToHideLocaleSwitch(){return[as.INITIAL_STATE]}get mustDisplayLocaleSwitch(){return!this.statesToHideLocaleSwitch.includes(this.props.apiRecoverContext.state)}render(){return n.createElement(n.Fragment,null,this.mustDisplayLocaleSwitch&&n.createElement(Zt,null))}}ls.propTypes={apiRecoverContext:c().any};const cs=function(e){return class extends n.Component{render(){return n.createElement(rs.Consumer,null,t=>n.createElement(e,{apiRecoverContext:t,...this.props}))}}}(ls);class ds 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(ct,null)))}}ds.propTypes={title:c().oneOfType([c().arrayOf(c().node),c().node,c().string])},ds.defaultProps={title:n.createElement(N.x,null,"Please wait...")};const ps=(0,I.C)("common")(ds);class us 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"):f.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(et,{className:"caret-down"}):n.createElement(nt,{className:"caret-right"}),n.createElement("span",null,n.createElement(N.x,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(N.x,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(N.x,null,"Try again"))))}}us.defaultProps={title:n.createElement(N.x,null,"Something went wrong!"),message:n.createElement(N.x,null,"The operation failed with the following error:")},us.propTypes={context:c().any,title:c().oneOfType([c().arrayOf(c().node),c().node,c().string]),message:c().oneOfType([c().arrayOf(c().node),c().node,c().string]),error:c().any};const hs=o((0,I.C)("common")(us));class ms extends n.Component{render(){return n.createElement("div",{className:"setup-error"},n.createElement("h1",null,n.createElement(N.x,null,"Sorry, wrong computer or browser...")),n.createElement("p",null,n.createElement(N.x,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(N.x,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(N.x,null,"Restart from scratch"))))}}ms.propTypes={context:c().any};const gs=o((0,I.C)("common")(ms));class Es extends n.Component{render(){return n.createElement("div",{className:"setup-error"},n.createElement("h1",null,n.createElement(N.x,null,"The request is expired.")),n.createElement("p",null,n.createElement(N.x,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(N.x,null,"Continue"))))}}Es.propTypes={context:c().any};const ys=o((0,I.C)("common")(Es)),bs="setup",fs="recover",Ts="account-recovery";class Ss extends n.Component{render(){return n.createElement("div",{className:"setup-error"},n.createElement("h1",null,n.createElement(N.x,null,"Cannot perform the action while being logged in")),n.createElement("p",null,{[bs]:n.createElement(N.x,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."),[fs]:n.createElement(N.x,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."),[Ts]:n.createElement(N.x,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(N.x,null,"Sign out"))))}}Ss.propTypes={displayAs:c().oneOf([bs,fs,Ts]).isRequired,onLogoutButtonClick:c().func.isRequired};const ws=(0,I.C)("common")(Ss);class vs extends n.Component{componentDidMount(){this.initializeAccountRecovery()}initializeAccountRecovery(){setTimeout(()=>this.props.apiAccountRecoveryContext.onInitializeAccountRecoveryRequested(),1e3)}render(){switch(this.props.apiAccountRecoveryContext.state){case v.RESTART_FROM_SCRATCH:return n.createElement(gs,null);case v.TOKEN_EXPIRED_STATE:return n.createElement(ys,null);case v.ERROR_ALREADY_SIGNED_IN_STATE:return n.createElement(ws,{onLogoutButtonClick:this.props.apiAccountRecoveryContext.logoutUserAndRefresh,displayAs:Ts});case v.UNEXPECTED_ERROR_STATE:return n.createElement(hs,{error:this.props.apiAccountRecoveryContext.unexpectedError});default:return n.createElement(ps,null)}}}vs.propTypes={apiAccountRecoveryContext:c().object};const As=function(e){return class extends n.Component{render(){return n.createElement(T.Consumer,null,t=>n.createElement(e,{apiAccountRecoveryContext:t,...this.props}))}}}(vs);var Rs,Cs,xs,Ns,Is;function Os(){return Os=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},Os.apply(null,arguments)}const _s=function(e){return n.createElement("svg",Os({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),Rs||(Rs=n.createElement("title",{id:"logo-title"},"Passbolt logo")),Cs||(Cs=n.createElement("desc",{id:"logo-description"},"This is the logo of passbolt.")),xs||(xs=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"})),Ns||(Ns=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"})),Is||(Is=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 Ps 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 A).setBaseUrl(this.state.trustedDomain)}async getSiteSettings(){const e=this.getApiClientOptions().setResourceName("settings"),t=new y(e),{body:s}=await t.findAll(),n=new $t(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(a.Provider,{value:this.state},this.isReady()&&n.createElement(Bt,{loadingPath:`${this.state.trustedDomain}/locales/{{lng}}/{{ns}}.json`},n.createElement(w,{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(_s,{role:"img",width:"20rem",height:"3.5rem"}))),n.createElement("div",{className:"login-form"},n.createElement(As,null)),n.createElement(cs,null)),n.createElement(Pt,null)))))}}const ks=Ps,Us=document.createElement("div");document.body.appendChild(Us),(0,i.H)(Us).render(n.createElement(ks,null))}};const t={};function s(n){const i=t[n];if(void 0!==i)return i.exports;const r=t[n]={exports:{}};return e[n].call(r.exports,r,r.exports,s),r.exports}s.m=e,(()=>{const e=[];s.O=(t,n,i)=>{if(!n){for(var r=0;r<e.length;r++){let[n,i]=e[r],a=!0;for(var o=0;o<n.length;o++)s.O.j(n[o])?n.splice(o--,1):a=!1;if(a){e.splice(r--,1);const s=i();void 0!==s&&(t=s)}}return t}e.push([n,i])}})(),s.n=e=>{const t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},s.cw=e=>{var t;return()=>{if(e){var s=e;e=0,t={exports:{}},s.call(t.exports,t,t.exports)}return t.exports}},s.d=(e,t)=>{if(Array.isArray(t))for(var n=0;n<t.length;){var i=t[n++],r=t[n++],o=0===r?{enumerable:!0,value:t[n++]}:{enumerable:!0,get:r};s.o(e,i)||Object.defineProperty(e,i,o)}else for(var i in t)s.o(t,i)&&!s.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},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=>{Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.j=673,s.dn=e=>{var t=Object.getOwnPropertyDescriptor(e,"name");(!t||!t.writable&&t.configurable)&&Object.defineProperty(e,"name",{value:"default",configurable:!0})},(()=>{const e={673:0};s.O.j=t=>0===e[t];const t=(t,n)=>{let[i,r,o]=n;var a,l,c=0;if(i.some(t=>0!==e[t])){for(a in r)s.o(r,a)&&(s.m[a]=r[a]);if(o)var d=o(s)}for(t&&t(n);c<i.length;c++)l=i[c],s.o(e,l)&&e[l]&&e[l][0](),e[l]=0;return s.O(d)},n=self.webpackChunkpassbolt_styleguide=self.webpackChunkpassbolt_styleguide||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})();let n=s.O(void 0,[3847],()=>s(86943));n=s.O(n)})();
|
|
2
|
+
(()=>{"use strict";var e={86943(e,t,s){var n=s(96540),i=s(5338);const r=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 o(e){return class extends n.Component{render(){return n.createElement(r.Consumer,null,t=>n.createElement(e,{context:t,...this.props}))}}}const a=r;var l=s(5556),c=s.n(l);class d extends Error{constructor(e,t){super(e),this.name="PassboltApiFetchError",this.data=t||{}}}const p=d;class u extends Error{constructor(){super("An internal error occurred. The server response could not be parsed. Please contact your administrator."),this.name="PassboltBadResponseError"}}const h=u;class m extends Error{constructor(e){super(e=e||"The service is unavailable"),this.name="PassboltServiceUnavailableError"}}const g=m,E=["GET","POST","PUT","DELETE"];class y{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"}setApiVersion(e){if("string"!=typeof e)throw new TypeError("ApiClient.setApiVersion error: apiVersion should be a string.");this.apiVersion=`api-version=${e}`}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(E.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 g("Unable to reach the server, an unexpected error occurred"):new g("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 h(t,e)}if(!e.ok){const s=t.header.message;throw new p(s,{header:t.header,code:e.status,body:t.body})}return t}}const b=class{constructor(e){e.setResourceName("auth"),this.apiClient=new y(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 f{static reload(){window.location.reload()}static assign(e){window.location.assign(e)}static getHostname(){return window.location.hostname}}const T=n.createContext({userId:null,authenticationToken:null,state:null,unexpectedError:null,onInitializeAccountRecoveryRequested:()=>{},logoutUserAndRefresh:()=>{}});class S extends n.Component{constructor(e){super(e),this.state=Object.assign(this.defaultState,e.value),this.authLogoutService=new b(e.context.getApiClientOptions())}get defaultState(){return{userId:null,authenticationToken:null,state:v.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:v.REQUEST_INVITATION_ERROR});try{await this.verifyCanContinueAccountRecovery(),this.setState({state:v.RESTART_FROM_SCRATCH})}catch(e){await this.handleVerifyCanContinueAccountRecoveryError(e)}}async verifyCanContinueAccountRecovery(){const e=this.props.context.getApiClientOptions();e.setResourceName("account-recovery");const t=new y(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:v.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:v.TOKEN_EXPIRED_STATE})}this.setState({state:v.UNEXPECTED_ERROR_STATE,unexpectedError:e})}async logoutUserAndRefresh(){try{await this.authLogoutService.logout()}catch(e){const t=new g(e.message);return this.setState({unexpectedError:t,state:v.UNEXPECTED_ERROR_STATE})}f.reload()}render(){return n.createElement(T.Provider,{value:this.state},this.props.children)}}S.propTypes={context:c().any,value:c().any,children:c().any};const w=o(S),v={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 A{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 R;function C(){return C=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},C.apply(null,arguments)}const x=function(e){return n.createElement("svg",C({xmlns:"http://www.w3.org/2000/svg",width:17,height:16,fill:"none",viewBox:"0 0 17 16"},e),R||(R=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 N=s(91352),I=s(13279);class O 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))}}O.defaultProps={direction:"right"},O.propTypes={children:c().any,message:c().any.isRequired,direction:c().string};const _=O;var P=s(28097),k=s(44296);const U=n.createContext({dialogs:[],open:()=>{},close:()=>{}});class D extends n.Component{constructor(e){super(e),this.state=this.defaultState}get defaultState(){return{dialogs:[],open:(e,t)=>{const s=(0,k.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(U.Provider,{value:this.state},this.props.children)}}function q(e){return class extends n.Component{render(){return n.createElement(U.Consumer,null,t=>n.createElement(e,{dialogContext:t,...this.props}))}}}D.displayName="DialogContextProvider",D.propTypes={children:c().any};var G=s(75410);const L=["/app/administration","/app/administration/mfa","/app/administration/mfa-policy","/app/administration/password-policies","/app/administration/secret-history","/app/administration/self-registration","/app/administration/users-directory","/app/administration/healthcheck","/app/administration/email-notification","/app/administration/smtp-settings","/app/administration/subscription","/app/administration/ce-downgrade","/app/administration/internationalization","/app/administration/account-recovery","/app/administration/sso","/app/administration/rbacs","/app/administration/content-types/metadata-getting-started","/app/administration/user-provisionning/scim","/app/administration/user-passphrase-policies","/app/administration/password-expiry","/app/administration/content-types/metadata","/app/administration/content-types/metadata-key","/app/administration/migrate-metadata","/app/administration/allow-content-types","/app/administration/subscription-teasing","/app/administration/password-policies-teasing","/app/administration/user-passphrase-policies-teasing","/app/administration/account-recovery-teasing","/app/administration/sso-teasing","/app/administration/mfa-policy-teasing","/app/administration/users-directory-teasing","/app/administration/scim-teasing","/app/administration/offline","/app/passwords","/app/users","/app/settings/profile","/app/settings/passphrase","/app/settings/security-token","/app/settings/theme","/app/settings/mfa","/app/settings/keys","/app/settings/mobile","/app/settings/desktop","/app/settings/account-recovery"],M=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:()=>{},onGoToSubscriptionUpdateQuantityRequested:()=>{},onGoToSubscriptionRenewRequested:()=>{},onGoToAdministrationRbacsRequested:()=>{},onGoToAdministrationMigrateMetadataRequested:()=>{},onGoToAdministrationAllowContentTypesRequested:()=>{},onGoToAdministrationMetadataGettingStartedRequested:()=>{},onGoToAdministrationSubscriptionRequestedTeasing:()=>{},onGoToAdministrationPasswordPoliciesRequestedTeasing:()=>{},onGoToAdministrationUserPassphrasePoliciesRequestedTeasing:()=>{},onGoToAdministrationAccountRecoveryRequestedTeasing:()=>{},onGoToAdministrationSsoRequestedTeasing:()=>{},onGoToAdministrationMfaPolicyRequestedTeasing:()=>{},onGoToAdministrationUsersDirectoryRequestedTeasing:()=>{},onGoToAdministrationScimRequestedTeasing:()=>{},onGoToAdministrationScimRequested:()=>{},onGoToAdministrationOfflineRequested:()=>{}});class $ extends n.Component{constructor(e){super(e),this.state=this.defaultState}get defaultState(){return{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),onGoToSubscriptionUpdateQuantityRequested:this.onGoToSubscriptionUpdateQuantityRequested.bind(this),onGoToSubscriptionRenewRequested:this.onGoToSubscriptionRenewRequested.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),onGoToAdministrationOfflineRequested:this.onGoToAdministrationOfflineRequested.bind(this)}}async goTo(e,t){if(!L.includes(t))throw new Error("The pathname is not part of the allowed list of pathnames.");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")}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 onGoToAdministrationOfflineRequested(){await this.goTo("browser-extension","/app/administration/offline")}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(){window.open("https://www.passbolt.com/docs/","_blank","noopener,noreferrer")}async onGoToTermsRequested(){window.open("https://www.passbolt.com/terms","_blank","noopener,noreferrer")}async onGoToSubscriptionUpdateQuantityRequested(e,t){const s=`https://www.passbolt.com/subscription/ee/update/qty?subscription_id=${encodeURIComponent(e)}&customer_id=${encodeURIComponent(t)}`;window.open(s,"_blank","noopener,noreferrer")}async onGoToSubscriptionRenewRequested(e,t){const s=`https://www.passbolt.com/subscription/ee/update/renew?subscription_id=${encodeURIComponent(e)}&customer_id=${encodeURIComponent(t)}`;window.open(s,"_blank","noopener,noreferrer")}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 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(M.Provider,{value:this.state},this.props.children)}}$.displayName="NavigationContextProvider",$.propTypes={context:c().object,children:c().any,location:c().object,match:c().object,history:c().object},(0,G.withRouter)(o($));const F=n.createContext({counter:[],add:()=>{},remove:()=>{}});class K 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(F.Provider,{value:this.state},this.props.children)}}K.propTypes={children:c().any};class V{}class j extends V{static execute(){return!0}}class B extends V{static execute(){return!1}}const H="Folders.use",W="Administration.viewWorkspace",Y="GroupsAdd.addPost",z="AccountRecoveryRequestsView.view",X="AccountRecoveryRequestsIndex.index",J="AccountRecoveryResponsesCreate.post",Q="Allow",Z="Deny",ee="AllowIfGroupManagerInOneGroup",te={[Q]:j,[Z]:B,[ee]:class extends V{static execute(e){return e.groups_users.some(e=>e.is_admin)}}},se={[H]:te[Q]},ne={[W]:te[Z],[Y]:te[Z],[z]:te[Z],[X]:te[Z],[J]:te[Z]};class ie{static getByRbac(e){return te[e.controlFunction]||(console.warn(`Could not find control function for the given rbac entity (${e.id})`),B)}static getDefaultForAdminAndAction(e){return se[e]||j}static getDefaultForUserAndAction(e){return ne[e]||j}}class re 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 le||t instanceof re))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 le||this.errors[t]instanceof re?e[t]=this.errors[t].details:e[t]=this.errors[t];return e}}const oe=re;class ae 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 ae||t instanceof oe))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 le=ae;var ce=s(57761),de=s.n(ce);class pe{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 pe.validateObject(e,t,s);case"array":return pe.validateArray(e,t,s);default:throw new TypeError(`Could not validate entity ${e}. Unsupported type.`)}}static validateArray(e,t,s){let n;const i=pe.validateProp("items",t,s);if("number"==typeof s.minItems&&(pe.isGreaterThanOrEqual(t.length,s.minItems)||(n=pe.handleCollectionValidationError("minItems",`The items array should contain at least ${s.minItems} item(s).`,n))),"number"==typeof s.maxItems&&(pe.isLessThanOrEqual(t.length,s.maxItems)||(n=pe.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=pe.getOrInitEntityValidationError(e,o),o.addError(s,"required",`The ${s} is required.`);continue}}else if(!Object.prototype.hasOwnProperty.call(t,s))continue;try{r[s]=pe.validateProp(s,t[s],i[s])}catch(t){if(!(t instanceof le))throw t;o=pe.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 le(`Could not validate entity ${e}.`)}static validateProp(e,t,s){if(s.anyOf)return pe.validateAnyOf(e,t,s.anyOf),t;if(!0===s.nullable&&null===t)return t;if(pe.validatePropType(e,t,s),s.enum)return pe.validatePropEnum(e,t,s),t;switch(s.type){case"string":pe.validatePropTypeString(e,t,s);break;case"integer":case"number":pe.validatePropTypeNumber(e,t,s);break;case"array":pe.validatePropTypeArray(e,t,s);break;case"object":case"boolean":case"blob":case"null":break;case"x-custom":pe.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(!pe.isValidPropType(t,s.type))throw pe.handlePropertyValidationError(e,"type",`The ${e} is not a valid ${s.type}.`)}static validatePropCustom(e,t,s){try{s.validationCallback(t)}catch(t){throw pe.handlePropertyValidationError(e,"custom",`The ${e} is not valid: ${t.message}`)}}static validatePropTypeString(e,t,s){let n;if(s.format&&(pe.isValidStringFormat(t,s.format)||(n=pe.handlePropertyValidationError(e,"format",`The ${e} is not a valid ${s.format}.`,n))),s.length&&(pe.isValidStringLength(t,s.length,s.length)||(n=pe.handlePropertyValidationError(e,"length",`The ${e} should be ${s.length} character in length.`,n))),s.minLength&&(pe.isValidStringLength(t,s.minLength)||(n=pe.handlePropertyValidationError(e,"minLength",`The ${e} should be ${s.minLength} character in length minimum.`,n))),s.maxLength&&(pe.isValidStringLength(t,0,s.maxLength)||(n=pe.handlePropertyValidationError(e,"maxLength",`The ${e} should be ${s.maxLength} character in length maximum.`,n))),s.pattern&&(de().matches(t,s.pattern)||(n=pe.handlePropertyValidationError(e,"pattern",`The ${e} is not valid.`,n))),s.custom&&(s.custom(t)||(n=pe.handlePropertyValidationError(e,"custom",`The ${e} is not valid.`,n))),n)throw n}static handlePropertyValidationError(e,t,s,n=null){return(n=n||new le(`Could not validate property ${e}.`)).addError(e,t,s),n}static handleCollectionValidationError(e,t,s=null){return(s=s||new oe("Could not validate collection.")).addCollectionValidationError(e,t),s}static validatePropTypeNumber(e,t,s){let n;if("number"==typeof s.minimum&&(pe.isGreaterThanOrEqual(t,s.minimum)||(n=pe.handlePropertyValidationError(e,"minimum",`The ${e} should be greater or equal to ${s.minimum}.`,n))),"number"==typeof s.maximum&&(pe.isLesserThanOrEqual(t,s.maximum)||(n=pe.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 le))throw t;{n=pe.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(!pe.isPropInEnum(t,s.enum)){const t=new le(`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 pe.validateProp(e,t,s[n])}catch{}const n=new le(`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 de().isUUID(e);case"email":case"idn-email":return de().isEmail(e);case"date-time":return de().isISO8601(e);case"x-hex-color":return de().isHexColor(e);case"x-base64":return de().isBase64(e);default:throw new TypeError(`EntitySchema string validation format ${t} is not supported.`)}}static isValidStringLength(e,t,s){return t=t||0,de().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 ue=pe;class he{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=he._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 he._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 me=he;var ge=s(5648);const Ee=e=>e?.replace(/_([a-z])/g,(e,t)=>t.toUpperCase());class ye 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 be=ye;class fe{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 be(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 le,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 Te=fe,Se=["string","number","integer","boolean"];class we extends me{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 le))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=ue.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 le;for(const[s,n]of Object.entries(this.constructor.associations))try{this._props[s]&&(this[`_${Ee(s)}`]=new n(this._props[s],{...e,clone:!1}),delete this._props[s])}catch(e){if(!(e instanceof le))throw e;t.addAssociationError(s,e)}if(t.hasErrors())throw t}}static get associations(){return{}}get(e){(0,ge.A)(e);const t=this.constructor.getSchema().properties[e];if(!t)throw new Error(`The property "${e}" has no schema definition.`);if(!Se.includes(t?.type))throw new Error('The property "associated_entity" should reference scalar properties only.');return this._props[e]}set(e,t,s={}){(0,ge.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&&!Se.includes(r?.type))throw new Error('The property "associated_entity" should reference scalar properties only.');if(r?.anyOf?.some(e=>!Se.includes(e.type)))throw new Error('The property "associated_entity" should reference scalar properties only.');n&&ue.validateProp(i,t,r),this._props[i]=t}}}setArrayProp(e,t,s){(0,ge.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(!Se.includes(o.items.type))throw new Error('The property "associated_entity" with array type should reference scalar properties only.');a&&ue.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,ge.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,ge.A)(e),this.isAssociation(e)){const n=e.split("."),i=Ee(n[0]);if(n.length>1)if(this[`_${i}`]||(this[`_${i}`]=new this.constructor.associations[n[0]]({},{validate:!1})),this[`_${i}`]instanceof Te){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 le;if(Object.keys(this.constructor.associations).length>0&&Object.keys(this.constructor.associations).forEach(s=>{const n=Ee(s);if(this[`_${n}`]){const i=this[n].validate(e);i&&t.addAssociationError(s,i)}}),t.hasErrors())throw t}diffProps(e){if(!(e instanceof we))throw new TypeError('The property "compareEntity" should be of "EntityV2" type.');const t={},s=this.constructor.getSchema(),n=Object.keys(s.properties).filter(e=>Se.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 ve=we;class Ae extends ve{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()===Ae.ROLE_ADMIN}isUser(){return this.name.toLowerCase()===Ae.ROLE_USER}isGuest(){return this.name.toLowerCase()===Ae.ROLE_GUEST}isAReservedRole(){return this.isAdmin()||this.isUser()||this.isGuest()}verifyHealth(){let e=null;return 50===this.name.length&&(e=new le,e.addError("name","maxLength","name reached maximum length limit")),e}assertNoTrailingSpaces(e,t){if(t.trim()!==t){const t=new le;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 Re{static canRoleUseAction(e,t,s){if("undefined"!=typeof window&&window.chrome?.webview){const n=t.findRbacByActionName(s);if(n)return ie.getByRbac(n).execute(e)}const n=new Ae(e.role);if(n.isAdmin())return ie.getDefaultForAdminAndAction(s).execute();const i=t.findRbacByRoleAndActionName(n,s);return this.getByRbacOrDefault(i,s,e)}static getByRbacOrDefault(e,t,s){return e?ie.getByRbac(e).execute(s):ie.getDefaultForUserAndAction(t).execute()}}const Ce=n.createContext({canIUseAction:()=>{}});class xe extends n.Component{constructor(e){super(e),this.state=this.defaultState}get defaultState(){return{canIUseAction:this.canIUseAction.bind(this)}}canIUseAction(e){return Re.canRoleUseAction(this.props.context.loggedInUser,this.props.context.rbacs,e)}render(){return n.createElement(Ce.Provider,{value:this.state},this.props.children)}}xe.propTypes={context:c().any,children:c().any},o(xe);const Ne=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 Ie extends n.Component{constructor(e){super(e),this.state=this.defaultState}get defaultState(){return{selectedAdministration:Pe.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(W))return e.selectedAdministration=Pe.HTTP_403_ACCESS_DENIED,void this.setState(e);const t=this.props.location.pathname,s=Ue.homePage.test(t),n=Ue.mfa.test(t),i=Ue.mfaPolicy.test(t),r=Ue.passwordPolicies.test(t),o=Ue.usersDirectory.test(t),a=Ue.emailNotification.test(t),l=Ue.subscription.test(t),c=Ue.internationalization.test(t),d=Ue.accountRecovery.test(t),p=Ue.smtpSettings.test(t),u=Ue.selfRegistration.test(t),h=Ue.sso.test(t),m=Ue.rbac.test(t),g=Ue.userPassphrasePolicies.test(t),E=Ue.passwordExpirySettings.test(t),y=Ue.healthcheck.test(t),b=Ue.contentTypesEncryptedMetadata.test(t),f=Ue.contentTypesMetadataKey.test(t),T=Ue.migrateEncryptedMetadata.test(t),S=Ue.allowContentTypes.test(t),w=Ue.gettingStarted.test(t),v=Ue.scim.test(t),A=Ue.secretHistory.test(t),R=Ue.ceDowngrade.test(t),C=Ue.offline.test(t),x=Ue.mfaPolicyTeasing.test(t),N=Ue.passwordPoliciesTeasing.test(t),I=Ue.usersDirectoryTeasing.test(t),O=Ue.subscriptionTeasing.test(t),_=Ue.accountRecoveryTeasing.test(t),P=Ue.userPassphrasePoliciesTeasing.test(t),k=Ue.ssoTeasing.test(t),U=Ue.scimTeasing.test(t);let D;if(s?D=Pe.HOME:i||x?D=Pe.MFA_POLICY:r||N?D=Pe.PASSWORD_POLICIES:n?D=Pe.MFA:o||I?D=Pe.USER_DIRECTORY:a?D=Pe.EMAIL_NOTIFICATION:l||O?D=Pe.SUBSCRIPTION:c?D=Pe.INTERNATIONALIZATION:d||_?D=Pe.ACCOUNT_RECOVERY:p?D=Pe.SMTP_SETTINGS:u?D=Pe.SELF_REGISTRATION:h||k?D=Pe.SSO:m?D=Pe.RBAC:g||P?D=Pe.USER_PASSPHRASE_POLICIES:E?D=Pe.PASSWORD_EXPIRY:y?D=Pe.HEALTHCHECK:b?D=Pe.CONTENT_TYPES_ENCRYPTED_METADATA:f?D=Pe.CONTENT_TYPES_METADATA_KEY:T?D=Pe.MIGRATE_METADATA:S?D=Pe.ALLOW_CONTENT_TYPES:w?D=Pe.METADATA_GETTING_STARTED:v||U?D=Pe.SCIM:A?D=Pe.SECRET_HISTORY:R?D=Pe.CE_DOWNGRADE:C&&(D=Pe.OFFLINE),!D)return e.selectedAdministration=Pe.HTTP_404_NOT_FOUND,void this.setState(e);const q=ke?.[D];e.selectedAdministration=q&&!(this.props.context.siteSettings.canIUse(q)||De.includes(D)&&this.props.context.siteSettings.isCommunityEdition)?Pe.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(Ne.Provider,{value:this.state},this.props.children)}}var Oe;function _e(e){return class extends n.Component{render(){return n.createElement(Ne.Consumer,null,t=>n.createElement(e,{administrationWorkspaceContext:t,...this.props}))}}}Ie.displayName="AdministrationWorkspaceContextProvider",Ie.propTypes={context:c().object,children:c().any,location:c().object,match:c().object,history:c().object,loadingContext:c().object,rbacContext:c().object},(0,G.withRouter)(o(function(e){return class extends n.Component{render(){return n.createElement(Ce.Consumer,null,t=>n.createElement(e,{rbacContext:t,...this.props}))}}}((Oe=Ie,class extends n.Component{render(){return n.createElement(F.Consumer,null,e=>n.createElement(Oe,{loadingContext:e,...this.props}))}}))));const Pe={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",OFFLINE:"OFFLINE"},ke={[Pe.MFA]:"multiFactorAuthentication",[Pe.MFA_POLICY]:"mfaPolicies",[Pe.PASSWORD_POLICIES]:"passwordPoliciesUpdate",[Pe.USER_DIRECTORY]:"directorySync",[Pe.SUBSCRIPTION]:"ee",[Pe.INTERNATIONALIZATION]:"locale",[Pe.ACCOUNT_RECOVERY]:"accountRecovery",[Pe.SMTP_SETTINGS]:"smtpSettings",[Pe.SELF_REGISTRATION]:"selfRegistration",[Pe.SSO]:"sso",[Pe.RBAC]:"rbacs",[Pe.USER_PASSPHRASE_POLICIES]:"userPassphrasePolicies",[Pe.PASSWORD_EXPIRY]:"passwordExpiry",[Pe.HEALTHCHECK]:"healthcheckUi",[Pe.CONTENT_TYPES_ENCRYPTED_METADATA]:"metadata",[Pe.CONTENT_TYPES_METADATA_KEY]:"metadata",[Pe.MIGRATE_METADATA]:"metadata",[Pe.ALLOW_CONTENT_TYPES]:"metadata",[Pe.METADATA_GETTING_STARTED]:"metadata",[Pe.SCIM]:"scim",[Pe.SECRET_HISTORY]:"secretRevisions",[Pe.CE_DOWNGRADE]:"ee",[Pe.OFFLINE]:"offlineMode"},Ue={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\/?$/,offline:/^\/app\/administration\/offline\/?$/},De=[Pe.SUBSCRIPTION,Pe.PASSWORD_POLICIES,Pe.USER_PASSPHRASE_POLICIES,Pe.ACCOUNT_RECOVERY,Pe.SSO,Pe.MFA_POLICY,Pe.USER_DIRECTORY,Pe.SCIM],qe=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}},Ge=n.createContext({getSubscription:()=>{},findSubscriptionKey:()=>{},isProcessing:()=>{},setProcessing:()=>{},getActiveUsers:()=>{},clearContext:()=>{}});class Le extends n.Component{constructor(e){super(e),this.state=this.defaultState}get defaultState(){return{subscription:new qe,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 qe;try{const t=await this.props.context.onGetSubscriptionKeyRequested();e=new qe(t.toDto())}catch(t){"PassboltSubscriptionError"===t.name&&(e=new qe(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(Ge.Provider,{value:this.state},this.props.children)}}function Me(e){return class extends n.Component{render(){return n.createElement(Ge.Consumer,null,t=>n.createElement(e,{adminSubscriptionContext:t,...this.props}))}}}var $e;function Fe(){return Fe=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},Fe.apply(null,arguments)}Le.propTypes={context:c().any,children:c().any},o(Le);const Ke=function(e){return n.createElement("svg",Fe({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none",viewBox:"0 0 16 16"},e),$e||($e=n.createElement("path",{stroke:"var(--icon-color)",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"m12 4-8 8M4 4l8 8"})))};class Ve 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(Ke,{className:"svg-icon close"}),n.createElement("span",{className:"visually-hidden"},n.createElement(N.x,null,"Close")))}}Ve.propTypes={onClose:c().func,disabled:c().bool};const je=(0,I.C)("common")(Ve);var Be;function He(){return He=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},He.apply(null,arguments)}const We=function(e){return n.createElement("svg",He({xmlns:"http://www.w3.org/2000/svg",width:17,height:18,fill:"none",viewBox:"0 0 17 18"},e),Be||(Be=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 Ye 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(We,null))),n.createElement(je,{onClose:this.handleClose,disabled:this.props.disabled})),n.createElement("div",{className:"dialog-content"},this.props.children)))}}Ye.propTypes={children:c().node,className:c().string,title:c().oneOfType([c().arrayOf(c().node),c().node,c().string]),subtitle:c().string,tooltip:c().node,disabled:c().bool,onClose:c().func};const ze=Ye,Xe=n.createContext({feedbacks:[],displaySuccess:()=>{},displayWarning:()=>{},displayError:()=>{},remove:()=>{}});class Je 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,k.A)(),type:"success",message:e}]})}displayWarning(e){this.setState({feedbacks:[...this.state.feedbacks,{id:(0,k.A)(),type:"warning",message:e}]})}displayError(e){this.setState({feedbacks:[...this.state.feedbacks,{id:(0,k.A)(),type:"error",message:e}]})}remove(e){this.setState(t=>({feedbacks:t.feedbacks.filter(t=>e.id!==t.id)}))}render(){return n.createElement(Xe.Provider,{value:this.state},this.props.children)}}var Qe;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)}Je.displayName="ActionFeedbackContextProvider",Je.propTypes={children:c().any};const et=function(e){return n.createElement("svg",Ze({xmlns:"http://www.w3.org/2000/svg",width:10,height:8,fill:"none",viewBox:"0 0 10 8"},e),Qe||(Qe=n.createElement("path",{stroke:"var(--icon-color)",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"m1 2 4 4 4-4"})))};var tt;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=function(e){return n.createElement("svg",st({xmlns:"http://www.w3.org/2000/svg",width:8,height:10,fill:"none",viewBox:"0 0 8 10"},e),tt||(tt=n.createElement("path",{stroke:"var(--icon-color)",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"m2 9 4-4-4-4"})))};class it 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(ze,{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(N.x,null,"Error details")),this.state.showErrorDetails?n.createElement(et,{className:"baseline svg-icon"}):n.createElement(nt,{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(N.x,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")))}}it.propTypes={title:c().string,error:c().object.isRequired,onClose:c().func,t:c().func};const rt=(0,I.C)("common")(it);var ot,at;function lt(){return lt=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},lt.apply(null,arguments)}const ct=function(e){return n.createElement("svg",lt({width:18,height:18,fill:"none",className:"svg-icon spinner",viewBox:"0 0 18 18"},e),ot||(ot=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)"})),at||(at=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 dt 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(N.x,null,"Save"),this.props.processing&&n.createElement(ct,null))}}dt.defaultProps={warning:!1,attention:!1},dt.propTypes={processing:c().bool,disabled:c().bool,value:c().oneOfType([c().arrayOf(c().node),c().node,c().string]),warning:c().bool,attention:c().bool,big:c().bool,medium:c().bool,fullWidth:c().bool};const pt=(0,I.C)("common")(dt);class ut 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)}}ut.defaultProps={value:n.createElement(N.x,null,"Cancel")},ut.propTypes={disabled:c().bool,onClick:c().func,value:c().oneOfType([c().arrayOf(c().node),c().node,c().string])};const ht=(0,I.C)("common")(ut),mt=class extends ve{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"}},gt=class{constructor(e){this.port=e}async createOrganizationSubscriptionKey(e){(0,ge.A)(e);const t=await this.port.request("passbolt.subscription.create",{data:e});return new mt(t)}async findOrganizationSubscriptionKey(){const e=await this.port.request("passbolt.subscription.get");return new mt(e)}async updateOrganizationSubscriptionKey(e){(0,ge.A)(e);const t=await this.port.request("passbolt.subscription.update",{data:e});return new mt(t)}async deleteOrganizationSubscriptionKey(){await this.port.request("passbolt.subscription.downgrade")}};class Et extends n.Component{constructor(e){super(e),this.state=this.getDefaultState(),this.initEventHandlers(),this.createInputRef(),this.subscriptionKeyService=new gt(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(rt,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(ze,{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(N.x,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(N.x,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(ht,{disabled:this.hasAllInputDisabled(),onClick:this.handleCloseClick}),n.createElement(pt,{disabled:this.hasAllInputDisabled(),processing:this.state.processing,value:this.translate("Save")}))))}}Et.propTypes={context:c().any,onClose:c().func,actionFeedbackContext:c().any,adminSubscriptionContext:c().object,dialogContext:c().any,administrationWorkspaceContext:c().any,title:c().string,warning:c().string,onSave:c().func,t:c().func};const yt=o(Me(_e(function(e){return class extends n.Component{render(){return n.createElement(Xe.Consumer,null,t=>n.createElement(e,{actionFeedbackContext:t,...this.props}))}}}(q((0,I.C)("common")(Et))))));class bt{constructor(e){this.context=e.context,this.dialogContext=e.dialogContext,this.subscriptionContext=e.adminSubscriptionContext}static getInstance(e){return this.instance||(this.instance=new bt(e)),this.instance}static killInstance(){this.instance=null}editSubscription(){const e={key:this.subscriptionContext.getSubscription().data};this.context.setContext({editSubscriptionKey:e}),this.dialogContext.open(yt)}}const ft=bt;var Tt=s(40961);var St,wt;function vt(){return vt=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},vt.apply(null,arguments)}const At=function(e){return n.createElement("svg",vt({xmlns:"http://www.w3.org/2000/svg",width:18,height:18,fill:"none",viewBox:"0 0 18 18"},e),St||(St=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"})),wt||(wt=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 Rt;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 xt=function(e){return n.createElement("svg",Ct({xmlns:"http://www.w3.org/2000/svg",width:18,height:18,fill:"none",viewBox:"0 0 18 18"},e),Rt||(Rt=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"})))},Nt="Pro Edition",It="Community Edition";class Ot extends n.Component{constructor(e){super(e),this.state=this.defaultState,this.bindCallbacks(),this.subscriptionActionService=ft.getInstance(this.props),this.subscriptionKeyService=new gt(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(),ft.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(yt,{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.onGoToSubscriptionUpdateQuantityRequested(e.subscriptionId,e.customerId):(this.hasSubscriptionKeyExpired()||this.hasSubscriptionKeyGoingToExpire())&&this.props.navigationContext.onGoToSubscriptionRenewRequested(e.subscriptionId,e.customerId)}handleUpdateKey(){this.subscriptionActionService.editSubscription()}hasEditionPlugin(){return this.props.context.siteSettings.canIUse("edition")}hasSubscriptionKeyExpired(){return P.c9.fromISO(this.props.adminSubscriptionContext.getSubscription().expiry)<P.c9.now()}hasSubscriptionKeyGoingToExpire(){return!this.hasSubscriptionKeyExpired()&&P.c9.fromISO(this.props.adminSubscriptionContext.getSubscription().expiry)<P.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 P.c9.fromISO(e).setLocale(this.props.context.locale).toLocaleString(P.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(N.x,null,"Subscription")),n.createElement("h3",null,n.createElement(N.x,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(N.x,null,"Edition:")),n.createElement("span",{className:"server-version label"},n.createElement(N.x,null,"Server version:")),n.createElement("span",{className:"client-version label"},n.createElement(N.x,null,"Client version:")),!this.props.context.siteSettings.isCommunityEdition&&n.createElement(n.Fragment,null,n.createElement("span",{className:"email label"},n.createElement(N.x,null,"Email:")),n.createElement("span",{className:"users label"},n.createElement(N.x,null,"Users limit:")))),n.createElement("div",{className:"information-value"},n.createElement("span",{className:"edition value"},!this.props.context.siteSettings.isCommunityEdition&&Nt,this.props.context.siteSettings.isCommunityEdition&&n.createElement(n.Fragment,null,It,n.createElement("span",{className:"subtitle"},n.createElement(N.x,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(N.x,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(N.x,null,"Customer id:")),n.createElement("span",{className:"subscription-id label"},n.createElement(N.x,null,"Subscription id:")),n.createElement("span",{className:"created label"},n.createElement(N.x,null,"Valid from:")),n.createElement("span",{className:"expiry label"},n.createElement(N.x,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=P.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(xt,null),n.createElement(N.x,null,"Your subscription key is expired.")),this.hasLimitUsersExceeded()&&n.createElement("div",{className:"subscription-warning"},n.createElement(xt,null),n.createElement(N.x,null,"Your users limit has been reached.")),this.hasInvalidSubscription()&&n.createElement("div",{className:"subscription-warning"},n.createElement(xt,null),n.createElement(N.x,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(N.x,null,"Renew subscription key")),n.createElement("button",{className:"button primary form",type:"button",onClick:this.handleUpdateKey},n.createElement(N.x,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(N.x,null,"Upload subscription key")))),n.createElement("h3",{className:"title"},n.createElement(N.x,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,It),n.createElement("span",{className:"subtitle"},n.createElement(N.x,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(N.x,null,"Current plan")))),n.createElement("div",{className:"features"},n.createElement("span",{className:"subtitle"},n.createElement(N.x,null,"Features included:")),n.createElement("ul",null,n.createElement("li",null,n.createElement(N.x,null,"Open source under AGPLV3 license")),n.createElement("li",null,n.createElement(N.x,null,"Passwords management & sharing")),n.createElement("li",null,n.createElement(N.x,null,"Private and shared folders")),n.createElement("li",null,n.createElement(N.x,null,"Users and groups management")),n.createElement("li",null,n.createElement(N.x,null,"Secret key authentication (2FA)")),n.createElement("li",null,n.createElement(N.x,null,"Additional factor authentication (3-step verification)")),n.createElement("li",null,n.createElement(N.x,null,"Open API")),n.createElement("li",null,n.createElement(N.x,null,"Role Based Access Control")),n.createElement("li",null,n.createElement(N.x,null,"Password expiry")),n.createElement("li",null,n.createElement(N.x,null,"Secret history")),n.createElement("li",null,n.createElement(N.x,null,"Community support"))))),this.shouldShowDowngradeSection()&&n.createElement("div",{className:"subscription-actions"},n.createElement("button",{className:"button",type:"button",onClick:this.handleDowngradeClick},n.createElement(N.x,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,Nt),!this.props.context.siteSettings.isCommunityEdition&&n.createElement("div",{className:"current-edition-indicator-wrapper"},n.createElement("div",{className:"current-edition-indicator"},n.createElement(N.x,null,"Current plan")))),n.createElement("div",{className:"features"},n.createElement("span",{className:"subtitle"},n.createElement(N.x,null,"Features include everything in Community, plus:")),n.createElement("ul",null,n.createElement("li",null,n.createElement(N.x,null,"Account recovery (Escrow)")),n.createElement("li",null,n.createElement(N.x,null,"Users provisioning (AD / OpenLDAP / SCIM)")),n.createElement("li",null,n.createElement(N.x,null,"Single Sign On (SSO) with Microsoft, Google and more")),n.createElement("li",null,n.createElement(N.x,null,"Activity log (audit changes)")),n.createElement("li",null,n.createElement(N.x,null,"Additional policies")),n.createElement("li",null,n.createElement(N.x,null,"Tags management")),n.createElement("li",null,n.createElement(N.x,null,"VM appliance")),n.createElement("li",null,n.createElement(N.x,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(N.x,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(N.x,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(N.x,null,"Start a free trial"))))))),(s=n.createElement("div",{className:"sidebar-help-section"},n.createElement("h3",null,n.createElement(N.x,null,"Need help?")),n.createElement("p",null,n.createElement(N.x,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(At,null),n.createElement("span",null,n.createElement(N.x,null,"Contact Sales")))),i=document.getElementById("administration-help-panel"),n.createElement(n.Fragment,null,i&&(0,Tt.createPortal)(s,i,void 0))));var s,i}}o(function(e){return class extends n.Component{render(){return n.createElement(M.Consumer,null,t=>n.createElement(e,{navigationContext:t,...this.props}))}}}(Me(_e(q((0,I.C)("common")(Ot))))));class _t 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(N.x,null,"Unsafe mode"))),!this.isCloud&&n.createElement(n.Fragment,null,this.props.context.siteSettings.isCommunityEdition&&n.createElement("li",null,It,n.createElement("span",{className:"edition-suffix"},n.createElement(N.x,null," (free)"))),!this.props.context.siteSettings.isCommunityEdition&&n.createElement("li",null,Nt)),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(x,null))),!this.versions&&n.createElement("a",{className:"button button-transparent inline",href:this.creditsUrl,target:"_blank",rel:"noopener noreferrer"},n.createElement(x,null)))))}}_t.propTypes={context:c().any,t:c().func};const Pt=o((0,I.C)("common")(_t)),kt=(e,t)=>t.split(".").reduce((e,t)=>e?.[t],e);s.dn(kt);const Ut=(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||[Dt.HTTP,Dt.HTTPS],n=[Dt.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(Ut);const Dt={FTP:"http:",FTPS:"https:",HTTP:"http:",HTTPS:"https:",JAVASCRIPT:"javascript:",SSH:"ssh:"},qt="enabled",Gt="disabled",Lt="not found";class Mt extends ve{static getSchema(){return{type:"object",required:[],properties:{status:{type:"string",enum:[qt,Gt,Lt]},app:{type:"object"},passbolt:{type:"object"},serverTimeDiff:{type:"integer",nullable:!0}}}}marshall(){void 0===this._props.status&&(this._props.status=qt),Mt.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:Gt}}toDto(){return{...this._props}}toJSON(){return this.toDto()}canIUse(e){const t=this._props?.passbolt?.plugins?.[e];return!(!t||"object"!=typeof t||void 0!==t.enabled&&!0!==t.enabled&&"true"!==t.enabled)}isPluginEnabled(e){return this.canIUse(e)}isFeatureBeta(e){return(0,ge.A)(e),kt(this._props,`passbolt.plugins.${e}.isInBeta`)||!1}getPluginSettings(e){return kt(this._props,`passbolt.plugins.${e}`)}getRememberMeOptions(){return(this.getPluginSettings("rememberMe")||{}).options||{}}get hasRememberMeUntilILogoutOption(){return void 0!==(this.getRememberMeOptions()||{})[-1]}get generatorConfiguration(){return kt(this._props,"passbolt.plugins.generator.configuration")}get locale(){return kt(this._props,"app.locale")||Mt.DEFAULT_LOCALE.locale}async setLocale(e){this._props.app||(this._props.app={}),this._props.app.locale=e}get supportedLocales(){return kt(this._props,"passbolt.plugins.locale.options")||Mt.DEFAULT_SUPPORTED_LOCALES}getServerTimezone(){return kt(this._props,"passbolt.app.server_timezone")}get termsLink(){const e=kt(this._props,"passbolt.legal.terms.url");return!!e&&Ut(e)}get privacyLink(){const e=kt(this._props,"passbolt.legal.privacy_policy.url");return!!e&&Ut(e)}get registrationPublic(){return!0===kt(this._props,"passbolt.registration.public")}get debug(){return!0===kt(this._props,"app.debug")}get url(){return kt(this._props,"app.url")||""}get version(){return kt(this._props,"app.version.number")}get isCommunityEdition(){return"ce"===kt(this._props,"passbolt.edition")}get emailValidateRegex(){return kt(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 qt}static get ORGANIZATION_DISABLED(){return Gt}static get ORGANIZATION_NOT_FOUND(){return Lt}static get DEFAULT_LOCALE(){return{locale:"en-UK",label:"English"}}static get DEFAULT_SUPPORTED_LOCALES(){return[Mt.DEFAULT_LOCALE]}}const $t=Mt;var Ft=s(72635),Kt=s(51831),Vt=s(32107);class jt extends n.Component{constructor(e){super(e),this.state=this.defaultState}get defaultState(){return{ready:!1}}async componentDidMount(){await(0,Ft.Yx)(Kt.r).use(Vt.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,Ft.v2)(this.locale)}get isReady(){return this.state.ready}render(){return n.createElement(n.Fragment,null,this.isReady&&this.props.children)}}jt.propTypes={context:c().any,loadingPath:c().any,children:c().any};const Bt=o(jt),Ht=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 Wt;function Yt(){return Yt=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},Yt.apply(null,arguments)}const zt=function(e){return n.createElement("svg",Yt({width:25,height:24,fill:"none",viewBox:"0 0 25 24"},e),Wt||(Wt=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 Xt 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(et,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(zt,{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(N.x,null,"No results match")," ",n.createElement("span",null,this.state.search))))))}}Xt.defaultProps={id:"",name:"select",className:"",direction:"bottom"},Xt.propTypes={id:c().string,name:c().string,className:c().string,direction:c().oneOf(Object.values({top:"top",bottom:"bottom",left:"left",right:"right"})),search:c().bool,items:c().array,value:Ht.allPropTypes(c().oneOfType([c().string,c().number,c().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:c().bool,onChange:c().func};const Jt=(0,I.C)("common")(Xt);class Qt 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(Jt,{id:"user-locale-input",className:"setup-extension",name:"locale",value:this.state.locale,disabled:!this.areActionsAllowed,items:this.supportedLocales,onChange:this.handleLocaleInputChange})))}}Qt.propTypes={context:c().any};const Zt=o(Qt),es="chrome",ts="edge",ss="firefox",ns="safari";function is(){const e=window.navigator.userAgent.toLowerCase();let t;return t=e.indexOf("firefox")>-1?ss:e.indexOf("samsungbrowser")>-1?"samsung":e.indexOf("opera")>-1||e.indexOf("opr")>-1?"opera":e.indexOf("trident")>-1?"internet-explorer":e.indexOf("edg")>-1?ts:e.indexOf("chrome")>-1?es:e.indexOf("safari")>-1?ns:"unknown",t}const rs=n.createContext({userId:null,token:null,state:null,unexpectedError:null,onInitializeRecoverRequested:()=>{},logoutUserAndRefresh:()=>{}});class os extends n.Component{constructor(e){super(e),this.state=Object.assign(this.defaultState,e.value),this.authLogoutService=new b(e.context.getApiClientOptions())}get defaultState(){return{userId:null,token:null,state:as.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:as.DOWNLOAD_SUPPORTED_BROWSER_STATE}):this.setState({state:as.REQUEST_INVITATION_ERROR})}handleStartRecoverSuccess(){const e=is()===ns?as.INSTALL_SAFARI_EXTENSION_STATE:as.INSTALL_EXTENSION_STATE;this.setState({state:e})}handleSafariExtensionDownloading(){const e=as.CONFIGURE_SAFARI_EXTENSION_STATE;this.setState({state:e})}handleSafariExtensionNotDownloaded(){const e=as.INSTALL_SAFARI_EXTENSION_STATE;this.setState({state:e})}handleExtensionAlreadyInstalled(){const e=as.CONFIGURE_SAFARI_EXTENSION_STATE;this.setState({state:e})}handleStartRecoverError(e){if(e instanceof p){if(403===e.data.code)return this.setState({state:as.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:as.TOKEN_EXPIRED_STATE});if(400===e?.data?.code)return this.setState({state:as.REQUEST_INVITATION_ERROR})}return this.setState({state:as.UNEXPECTED_ERROR_STATE})}async logoutUserAndRefresh(){try{await this.authLogoutService.logout()}catch(e){const t=new g(e.message);return this.setState({unexpectedError:t,state:as.UNEXPECTED_ERROR_STATE})}f.reload()}isBrowserSupported(){const e=is(),t=[es,ss,ts];return this.props.context.siteSettings.canIUse("safari")&&t.push(ns),t.includes(e)}async startRecover(){const e=this.props.context.getApiClientOptions();e.setResourceName("setup");const t=new y(e);await t.get(`recover/${this.state.userId}/${this.state.token}`)}render(){return n.createElement(rs.Provider,{value:this.state},this.props.children)}}os.propTypes={context:c().any,value:c().any,children:c().any},o(os);const as={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 ls extends n.Component{get statesToHideLocaleSwitch(){return[as.INITIAL_STATE]}get mustDisplayLocaleSwitch(){return!this.statesToHideLocaleSwitch.includes(this.props.apiRecoverContext.state)}render(){return n.createElement(n.Fragment,null,this.mustDisplayLocaleSwitch&&n.createElement(Zt,null))}}ls.propTypes={apiRecoverContext:c().any};const cs=function(e){return class extends n.Component{render(){return n.createElement(rs.Consumer,null,t=>n.createElement(e,{apiRecoverContext:t,...this.props}))}}}(ls);class ds 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(ct,null)))}}ds.propTypes={title:c().oneOfType([c().arrayOf(c().node),c().node,c().string])},ds.defaultProps={title:n.createElement(N.x,null,"Please wait...")};const ps=(0,I.C)("common")(ds);class us 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"):f.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(et,{className:"caret-down"}):n.createElement(nt,{className:"caret-right"}),n.createElement("span",null,n.createElement(N.x,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(N.x,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(N.x,null,"Try again"))))}}us.defaultProps={title:n.createElement(N.x,null,"Something went wrong!"),message:n.createElement(N.x,null,"The operation failed with the following error:")},us.propTypes={context:c().any,title:c().oneOfType([c().arrayOf(c().node),c().node,c().string]),message:c().oneOfType([c().arrayOf(c().node),c().node,c().string]),error:c().any};const hs=o((0,I.C)("common")(us));class ms extends n.Component{render(){return n.createElement("div",{className:"setup-error"},n.createElement("h1",null,n.createElement(N.x,null,"Sorry, wrong computer or browser...")),n.createElement("p",null,n.createElement(N.x,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(N.x,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(N.x,null,"Restart from scratch"))))}}ms.propTypes={context:c().any};const gs=o((0,I.C)("common")(ms));class Es extends n.Component{render(){return n.createElement("div",{className:"setup-error"},n.createElement("h1",null,n.createElement(N.x,null,"The request is expired.")),n.createElement("p",null,n.createElement(N.x,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(N.x,null,"Continue"))))}}Es.propTypes={context:c().any};const ys=o((0,I.C)("common")(Es)),bs="setup",fs="recover",Ts="account-recovery";class Ss extends n.Component{render(){return n.createElement("div",{className:"setup-error"},n.createElement("h1",null,n.createElement(N.x,null,"Cannot perform the action while being logged in")),n.createElement("p",null,{[bs]:n.createElement(N.x,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."),[fs]:n.createElement(N.x,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."),[Ts]:n.createElement(N.x,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(N.x,null,"Sign out"))))}}Ss.propTypes={displayAs:c().oneOf([bs,fs,Ts]).isRequired,onLogoutButtonClick:c().func.isRequired};const ws=(0,I.C)("common")(Ss);class vs extends n.Component{componentDidMount(){this.initializeAccountRecovery()}initializeAccountRecovery(){setTimeout(()=>this.props.apiAccountRecoveryContext.onInitializeAccountRecoveryRequested(),1e3)}render(){switch(this.props.apiAccountRecoveryContext.state){case v.RESTART_FROM_SCRATCH:return n.createElement(gs,null);case v.TOKEN_EXPIRED_STATE:return n.createElement(ys,null);case v.ERROR_ALREADY_SIGNED_IN_STATE:return n.createElement(ws,{onLogoutButtonClick:this.props.apiAccountRecoveryContext.logoutUserAndRefresh,displayAs:Ts});case v.UNEXPECTED_ERROR_STATE:return n.createElement(hs,{error:this.props.apiAccountRecoveryContext.unexpectedError});default:return n.createElement(ps,null)}}}vs.propTypes={apiAccountRecoveryContext:c().object};const As=function(e){return class extends n.Component{render(){return n.createElement(T.Consumer,null,t=>n.createElement(e,{apiAccountRecoveryContext:t,...this.props}))}}}(vs);var Rs,Cs,xs,Ns,Is;function Os(){return Os=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},Os.apply(null,arguments)}const _s=function(e){return n.createElement("svg",Os({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),Rs||(Rs=n.createElement("title",{id:"logo-title"},"Passbolt logo")),Cs||(Cs=n.createElement("desc",{id:"logo-description"},"This is the logo of passbolt.")),xs||(xs=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"})),Ns||(Ns=n.createElement("path",{fill:"var(--Passbolt-logo-passbolt-logo)",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"})),Is||(Is=n.createElement("path",{fill:"var(--Passbolt-logo-passbolt-logo)",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 Ps 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 A).setBaseUrl(this.state.trustedDomain)}async getSiteSettings(){const e=this.getApiClientOptions().setResourceName("settings"),t=new y(e),{body:s}=await t.findAll(),n=new $t(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(a.Provider,{value:this.state},this.isReady()&&n.createElement(Bt,{loadingPath:`${this.state.trustedDomain}/locales/{{lng}}/{{ns}}.json`},n.createElement(w,{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(_s,{role:"img",width:"20rem",height:"3.5rem"}))),n.createElement("div",{className:"login-form"},n.createElement(As,null)),n.createElement(cs,null)),n.createElement(Pt,null)))))}}const ks=Ps,Us=document.createElement("div");document.body.appendChild(Us),(0,i.H)(Us).render(n.createElement(ks,null))}};const t={};function s(n){const i=t[n];if(void 0!==i)return i.exports;const r=t[n]={exports:{}};return e[n].call(r.exports,r,r.exports,s),r.exports}s.m=e,(()=>{const e=[];s.O=(t,n,i)=>{if(!n){for(var r=0;r<e.length;r++){let[n,i]=e[r],a=!0;for(var o=0;o<n.length;o++)s.O.j(n[o])?n.splice(o--,1):a=!1;if(a){e.splice(r--,1);const s=i();void 0!==s&&(t=s)}}return t}e.push([n,i])}})(),s.n=e=>{const t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},s.cw=e=>{var t;return()=>{if(e){var s=e;e=0,t={exports:{}},s.call(t.exports,t,t.exports)}return t.exports}},s.d=(e,t)=>{if(Array.isArray(t))for(var n=0;n<t.length;){var i=t[n++],r=t[n++],o=0===r?{enumerable:!0,value:t[n++]}:{enumerable:!0,get:r};s.o(e,i)||Object.defineProperty(e,i,o)}else for(var i in t)s.o(t,i)&&!s.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},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=>{Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.j=673,s.dn=e=>{var t=Object.getOwnPropertyDescriptor(e,"name");(!t||!t.writable&&t.configurable)&&Object.defineProperty(e,"name",{value:"default",configurable:!0})},(()=>{const e={673:0};s.O.j=t=>0===e[t];const t=(t,n)=>{let[i,r,o]=n;var a,l,c=0;if(i.some(t=>0!==e[t])){for(a in r)s.o(r,a)&&(s.m[a]=r[a]);if(o)var d=o(s)}for(t&&t(n);c<i.length;c++)l=i[c],s.o(e,l)&&e[l]&&e[l][0](),e[l]=0;return s.O(d)},n=self.webpackChunkpassbolt_styleguide=self.webpackChunkpassbolt_styleguide||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})();let n=s.O(void 0,[3847],()=>s(86943));n=s.O(n)})();
|