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-feedback.js.LICENSE.txt */
|
|
2
|
-
(()=>{"use strict";var e={66313(e,t,r){var n,a,s=r(96540),o=r(5338),i=r(5556),c=r.n(i),l=r(13279),d=r(91352);function h(){return h=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},h.apply(null,arguments)}const u=function(e){return s.createElement("svg",h({shapeRendering:"geometricPrecision",textRendering:"geometricPrecision",viewBox:"0 0 128 128"},e),n||(n=s.createElement("circle",{id:"success-circle",r:62.5,fill:"none",strokeDasharray:392.7,strokeDashoffset:392.7,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:3,transform:"rotate(-90 64 0)"})),a||(a=s.createElement("path",{id:"success-check",fill:"none",strokeDasharray:65.24,strokeDashoffset:65.24,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:7,d:"M87.062 46.703 55.351 78.415 40.936 64"})))};var m,p,g;function f(){return f=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},f.apply(null,arguments)}const v=function(e){return s.createElement("svg",f({shapeRendering:"geometricPrecision",textRendering:"geometricPrecision",viewBox:"0 0 128 128"},e),m||(m=s.createElement("path",{id:"warning-dot",fill:"none",strokeDasharray:23.42,strokeDashoffset:23.42,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:7,d:"M64.038 46.76v23.413"})),p||(p=s.createElement("path",{id:"warning-bar",fill:"none",strokeDasharray:.09,strokeDashoffset:.09,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:7,d:"M64.038 93.585h.088"})),g||(g=s.createElement("path",{id:"warning-triangle",fill:"none",strokeDasharray:364.98,strokeDashoffset:364.98,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:3,d:"M53.954 16.685 4.412 99.459a11.66 11.66 0 0 0-1.167 8.872 11.66 11.66 0 0 0 5.464 7.087 10.97 10.97 0 0 0 5.7 1.578h99.17a11.67 11.67 0 0 0 8.253-3.508 11.68 11.68 0 0 0 3.323-8.329 11 11 0 0 0-1.579-5.7L74.033 16.685A11.66 11.66 0 0 0 57.9 12.739a12.1 12.1 0 0 0-3.946 3.946"})))};var k,E,b;function y(){return y=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},y.apply(null,arguments)}const w=function(e){return s.createElement("svg",y({shapeRendering:"geometricPrecision",textRendering:"geometricPrecision",viewBox:"0 0 128 128"},e),k||(k=s.createElement("circle",{id:"attention-circle",r:62.5,fill:"none",strokeDasharray:392.7,strokeDashoffset:392.7,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:3,transform:"rotate(-90 64 0)"})),E||(E=s.createElement("path",{id:"attention-dot",fill:"none",strokeDasharray:23.42,strokeDashoffset:23.42,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:7,d:"M63.956 40.588V64",transform:"rotate(180 63.956 52.294)"})),b||(b=s.createElement("path",{id:"attention-bar",fill:"none",strokeDasharray:.09,strokeDashoffset:.09,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:7,d:"M63.956 87.412h.088"})))};var j,L,O;function x(){return x=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},x.apply(null,arguments)}const D=function(e){return s.createElement("svg",x({shapeRendering:"geometricPrecision",textRendering:"geometricPrecision",viewBox:"0 0 128 128"},e),j||(j=s.createElement("circle",{id:"error-circle",r:62.5,fill:"none",strokeDasharray:392.7,strokeDashoffset:392.7,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:3,transform:"rotate(-90 64 0)"})),L||(L=s.createElement("path",{id:"error-stroke-1",fill:"none",strokeDasharray:37.96,strokeDashoffset:37.96,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:7,d:"m50.58 50.58 26.84 26.84",transform:"rotate(180 64 64)"})),O||(O=s.createElement("path",{id:"error-stroke-2",fill:"none",strokeDasharray:37.96,strokeDashoffset:37.96,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:7,d:"M77.42 50.58 50.58 77.42"})))};var P,M;function C(){return C=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},C.apply(null,arguments)}const N=function(e){return s.createElement("svg",C({xmlns:"http://www.w3.org/2000/svg",width:128,height:129,fill:"none",viewBox:"0 0 128 129"},e),P||(P=s.createElement("circle",{cx:64,cy:64.844,r:62.5,stroke:"var(--Palette-Contrast-1)",strokeWidth:3})),M||(M=s.createElement("path",{stroke:"var(--Palette-Contrast-1)",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:7,d:"M69.932 57.034c6.386-6.402 12.773-9.594 19.16-9.594a17 17 0 0 1 12.02 29.018 17 17 0 0 1-12.02 4.979c-8.499 0-16.998-5.652-25.497-16.998-8.5-11.347-16.998-16.999-25.497-16.999a16.998 16.998 0 0 0 0 33.997c6.372 0 12.744-3.177 19.117-9.55"})))},W={success:s.createElement(u,null),warning:s.createElement(v,null),attention:s.createElement(w,null),error:s.createElement(D,null),infinity_illustration:s.createElement(N,null)};class S extends s.Component{get animatedIconSVG(){return W[this.props.name]}render(){return s.createElement("div",{className:"illustration icon-feedback"},s.createElement("div",{className:this.props.name},this.animatedIconSVG))}}S.defaultProps={},S.propTypes={name:c().string};const B=S;var R;function q(){return q=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},q.apply(null,arguments)}const z=function(e){return s.createElement("svg",q({xmlns:"http://www.w3.org/2000/svg",width:10,height:8,fill:"none",viewBox:"0 0 10 8"},e),R||(R=s.createElement("path",{stroke:"var(--icon-color)",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"m1 2 4 4 4-4"})))};var T;function H(){return H=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},H.apply(null,arguments)}const V=function(e){return s.createElement("svg",H({xmlns:"http://www.w3.org/2000/svg",width:8,height:10,fill:"none",viewBox:"0 0 8 10"},e),T||(T=s.createElement("path",{stroke:"var(--icon-color)",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"m2 9 4-4-4-4"})))};var _,I,A,F,G;function J(){return J=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},J.apply(null,arguments)}const K=function(e){return s.createElement("svg",J({xmlns:"http://www.w3.org/2000/svg",width:151,height:27,fill:"none","aria-labelledby":"logo-title logo-description",viewBox:"0 0 151 27"},e),_||(_=s.createElement("title",{id:"logo-title"},"Passbolt logo")),I||(I=s.createElement("desc",{id:"logo-description"},"This is the logo of passbolt.")),A||(A=s.createElement("path",{fill:"var(--icon-color)",d:"M4.648 9.234v8.607h2.48c1.646 0 2.786-.349 3.47-1.012.685-.664 1.013-1.823 1.013-3.395 0-1.52-.305-2.595-.938-3.218-.633-.673-1.695-.972-3.24-.972zM.597 5.963h7.797c2.357 0 4.178.676 5.496 2.048q1.976 2.058 1.974 5.689a8.6 8.6 0 0 1-.406 2.749 7.1 7.1 0 0 1-1.24 2.278 5.9 5.9 0 0 1-2.38 1.773c-.937.349-2.152.524-3.697.524H4.648V26.5H.597zM24.016 18.016h5.064v-3.119h-4.76c-.937 0-1.594.124-1.95.375-.357.25-.517.698-.517 1.321 0 .524.15.899.429 1.122.28.223.848.301 1.734.301M18.649 5.963h8.268c2.103 0 3.672.476 4.736 1.423 1.065.947 1.594 2.347 1.594 4.217v9.456H22.37c-1.52 0-2.708-.375-3.52-1.121-.81-.747-1.2-1.823-1.2-3.22 0-1.722.454-2.945 1.392-3.692s2.483-1.134 4.697-1.134h5.315v-.365c0-.898-.276-1.518-.809-1.896-.532-.377-1.47-.55-2.86-.55H18.65zM36.55 17.915h8.525c.76 0 1.318-.124 1.646-.35.183-.122.328-.29.423-.486.094-.197.134-.414.115-.63a1.2 1.2 0 0 0-.112-.632 1.24 1.24 0 0 0-.42-.492c-.355-.253-.91-.374-1.646-.374h-3.494c-2.067 0-3.467-.325-4.203-.947-.737-.623-1.088-1.747-1.088-3.32 0-1.62.431-2.82 1.318-3.592.886-.772 2.255-1.152 4.064-1.152h8.684v3.142h-7.134q-1.75 0-2.279.301c-.354.198-.532.547-.532 1.071-.017.193.016.387.096.564s.204.332.361.449c.302.223.809.324 1.468.324h3.676c1.672 0 2.961.397 3.824 1.172s1.315 1.871 1.315 3.32c0 1.397-.405 2.53-1.188 3.417-.37.427-.833.768-1.354.996-.522.23-1.09.34-1.661.325H36.549zM53.822 17.915h8.526c.76 0 1.318-.124 1.646-.35a1.23 1.23 0 0 0 .42-.487c.093-.196.132-.413.112-.629a1.2 1.2 0 0 0-.111-.632 1.24 1.24 0 0 0-.421-.492c-.354-.253-.91-.374-1.646-.374h-3.493c-2.067 0-3.467-.325-4.204-.947-.736-.623-1.088-1.752-1.088-3.324 0-1.62.432-2.82 1.318-3.593.886-.772 2.253-1.147 4.075-1.147h8.686v3.142h-7.141q-1.747 0-2.28.301c-.353.198-.531.547-.531 1.071-.017.193.016.387.096.564s.204.332.361.449c.302.223.809.324 1.468.324h3.671c1.672 0 2.963.397 3.824 1.172s1.315 1.871 1.315 3.32c0 1.397-.403 2.53-1.188 3.417-.37.427-.832.767-1.354.996a3.9 3.9 0 0 1-1.66.325H53.769v-3.106zM75.387.5v5.463h3.47c1.55 0 2.759.175 3.694.55.946.362 1.77.976 2.38 1.772a7.2 7.2 0 0 1 1.243 2.296c.281.888.417 1.814.403 2.744q0 3.63-1.974 5.689c-1.315 1.372-3.14 2.046-5.493 2.046h-7.8V.5zm2.462 8.734h-2.483v8.608h2.785c1.55 0 2.633-.324 3.243-.95s.935-1.721.935-3.268-.354-2.694-1.033-3.367c-.68-.673-1.832-1.023-3.447-1.023M92.3 13.525c0 1.445.328 2.532 1.013 3.367s1.62 1.198 2.86 1.198 2.152-.398 2.863-1.198 1.033-1.921 1.033-3.367-.356-2.547-1.033-3.344c-.677-.798-1.62-1.198-2.863-1.198a3.64 3.64 0 0 0-1.57.279 3.6 3.6 0 0 0-1.29.919c-.685.797-1.013 1.921-1.013 3.344m12.002 0q0 3.544-2.202 5.689c-1.47 1.397-3.42 2.121-5.901 2.121s-4.457-.699-5.924-2.121-2.202-3.292-2.202-5.664q0-3.558 2.202-5.69c1.467-1.424 3.444-2.145 5.919-2.145s4.431.724 5.901 2.144 2.207 3.294 2.207 5.666M110.935 21.06h-4.202V.5h4.202zM112.884 5.963h2.86V.5h4.052v5.463h4.278v3.02h-4.278v6.09c0 1.12.204 1.895.581 2.343.377.449 1.064.649 2.026.649h1.671v3.02h-3.72c-1.494 0-2.636-.4-3.444-1.223-.809-.823-1.189-1.995-1.189-3.519v-7.36h-2.863v-3.02z"})),F||(F=s.createElement("path",{fill:"#D40101",d:"m149.951 10.68-9.059-8.36a2.12 2.12 0 0 0-1.421-.543c-.526 0-1.033.194-1.421.544l-5.684 5.268c.745.271 1.414.71 1.952 1.282.539.572.933 1.26 1.149 2.01h7.673a.73.73 0 0 1 .504.204.69.69 0 0 1 .207.494v1.147a.68.68 0 0 1-.207.494.72.72 0 0 1-.504.204h-.886v1.623a.68.68 0 0 1-.205.494.72.72 0 0 1-.503.205h-1.945a.73.73 0 0 1-.503-.205.69.69 0 0 1-.205-.494v-1.623h-3.426a4.84 4.84 0 0 1-1.135 2.033 5 5 0 0 1-1.966 1.287l5.71 5.276c.388.349.895.543 1.421.543a2.12 2.12 0 0 0 1.421-.543l9.043-8.355a2.03 2.03 0 0 0-.01-2.985"})),G||(G=s.createElement("path",{fill:"#D40101",d:"M130.683 9.867a2.6 2.6 0 0 0-1.064.253c-.371.18-.686.455-.913.794a2.242 2.242 0 0 0-.113 2.305 2.3 2.3 0 0 0 .831.877 2.36 2.36 0 0 0 2.355.059c.362-.197.664-.484.875-.833a2.24 2.24 0 0 0 .324-1.153 2.21 2.21 0 0 0-.653-1.625 2.3 2.3 0 0 0-.751-.5 2.3 2.3 0 0 0-.891-.177"})))};class Q extends s.Component{constructor(e){super(e),this.state=this.defaultState,this.bindCallbacks()}get defaultState(){return{displayLogs:!1}}bindCallbacks(){this.handleDisplayLogsClick=this.handleDisplayLogsClick.bind(this)}handleDisplayLogsClick(){this.setState({displayLogs:!this.state.displayLogs})}render(){return s.createElement("div",{id:"container",className:"container api-feedback page"},s.createElement("div",{className:"content"},s.createElement("div",{className:"header"},s.createElement("div",{className:"logo-svg"},s.createElement(K,{role:"img",width:"20rem",height:"3.5rem"}))),s.createElement("div",{className:"api-feedback-card"},s.createElement(B,{name:"attention"}),s.createElement("h1",null,s.createElement(d.x,null,"Something went wrong!")),s.createElement("p",null,s.createElement(d.x,null,"Please try again later or contact your administrator.")),s.createElement("div",{className:"accordion-header"},s.createElement("button",{type:"button",className:"link no-border",onClick:this.handleDisplayLogsClick},s.createElement(d.x,null,"Logs")," ",this.state.displayLogs?s.createElement(z,null):s.createElement(V,null))),this.state.displayLogs&&s.createElement("div",{className:"accordion-content"},s.createElement("textarea",{readOnly:!0,value:this.props.message})))))}}Q.propTypes={message:c().string.isRequired,t:c().func};const U=(0,l.C)("common")(Q);class X extends s.Component{render(){return s.createElement("div",{id:"container",className:"container api-feedback page"},s.createElement("div",{className:"content"},s.createElement("div",{className:"header"},s.createElement("div",{className:"logo-svg"},s.createElement(K,{role:"img",width:"20rem",height:"3.5rem"}))),s.createElement("div",{className:"api-feedback-card"},s.createElement(B,{name:"success"}),s.createElement("p",null,this.props.message))))}}X.propTypes={message:c().string.isRequired,t:c().func};const Y=(0,l.C)("common")(X),Z="loading",$="Error",ee="Success";class te extends s.Component{constructor(e){super(e),this.state=this.defaultState}get defaultState(){return{state:Z,message:null}}componentDidMount(){const e=document.getElementById("api-error-details"),t=document.getElementById("api-success");e?this.setState({state:$,message:e?.textContent}):this.setState({state:ee,message:t?.textContent})}render(){switch(this.state.state){case Z:return s.createElement(s.Fragment,null);case $:return s.createElement(U,{message:this.state.message});case ee:return s.createElement(Y,{message:this.state.message})}}}te.propTypes={t:c().func};const re=(0,l.C)("common")(te),ne=document.createElement("div");document.body.appendChild(ne),(0,o.H)(ne).render(s.createElement(re,null))}};const t={};function r(n){const a=t[n];if(void 0!==a)return a.exports;const s=t[n]={exports:{}};return e[n].call(s.exports,s,s.exports,r),s.exports}r.m=e,(()=>{const e=[];r.O=(t,n,a)=>{if(!n){for(var s=0;s<e.length;s++){let[n,a]=e[s],i=!0;for(var o=0;o<n.length;o++)r.O.j(n[o])?n.splice(o--,1):i=!1;if(i){e.splice(s--,1);const r=a();void 0!==r&&(t=r)}}return t}e.push([n,a])}})(),r.n=e=>{const t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.cw=e=>{var t;return()=>{if(e){var r=e;e=0,t={exports:{}},r.call(t.exports,t,t.exports)}return t.exports}},r.d=(e,t)=>{if(Array.isArray(t))for(var n=0;n<t.length;){var a=t[n++],s=t[n++],o=0===s?{enumerable:!0,value:t[n++]}:{enumerable:!0,get:s};r.o(e,a)||Object.defineProperty(e,a,o)}else for(var a in t)r.o(t,a)&&!r.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.j=7647,(()=>{const e={7647:0};r.O.j=t=>0===e[t];const t=(t,n)=>{let[a,s,o]=n;var i,c,l=0;if(a.some(t=>0!==e[t])){for(i in s)r.o(s,i)&&(r.m[i]=s[i]);if(o)var d=o(r)}for(t&&t(n);l<a.length;l++)c=a[l],r.o(e,c)&&e[c]&&e[c][0](),e[c]=0;return r.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=r.O(void 0,[3847],()=>r(66313));n=r.O(n)})();
|
|
2
|
+
(()=>{"use strict";var e={66313(e,t,r){var n,a,o=r(96540),s=r(5338),i=r(5556),c=r.n(i),l=r(13279),d=r(91352);function h(){return h=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},h.apply(null,arguments)}const u=function(e){return o.createElement("svg",h({shapeRendering:"geometricPrecision",textRendering:"geometricPrecision",viewBox:"0 0 128 128"},e),n||(n=o.createElement("circle",{id:"success-circle",r:62.5,fill:"none",strokeDasharray:392.7,strokeDashoffset:392.7,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:3,transform:"rotate(-90 64 0)"})),a||(a=o.createElement("path",{id:"success-check",fill:"none",strokeDasharray:65.24,strokeDashoffset:65.24,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:7,d:"M87.062 46.703 55.351 78.415 40.936 64"})))};var m,p,g;function f(){return f=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},f.apply(null,arguments)}const v=function(e){return o.createElement("svg",f({shapeRendering:"geometricPrecision",textRendering:"geometricPrecision",viewBox:"0 0 128 128"},e),m||(m=o.createElement("path",{id:"warning-dot",fill:"none",strokeDasharray:23.42,strokeDashoffset:23.42,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:7,d:"M64.038 46.76v23.413"})),p||(p=o.createElement("path",{id:"warning-bar",fill:"none",strokeDasharray:.09,strokeDashoffset:.09,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:7,d:"M64.038 93.585h.088"})),g||(g=o.createElement("path",{id:"warning-triangle",fill:"none",strokeDasharray:364.98,strokeDashoffset:364.98,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:3,d:"M53.954 16.685 4.412 99.459a11.66 11.66 0 0 0-1.167 8.872 11.66 11.66 0 0 0 5.464 7.087 10.97 10.97 0 0 0 5.7 1.578h99.17a11.67 11.67 0 0 0 8.253-3.508 11.68 11.68 0 0 0 3.323-8.329 11 11 0 0 0-1.579-5.7L74.033 16.685A11.66 11.66 0 0 0 57.9 12.739a12.1 12.1 0 0 0-3.946 3.946"})))};var k,E,b;function y(){return y=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},y.apply(null,arguments)}const w=function(e){return o.createElement("svg",y({shapeRendering:"geometricPrecision",textRendering:"geometricPrecision",viewBox:"0 0 128 128"},e),k||(k=o.createElement("circle",{id:"attention-circle",r:62.5,fill:"none",strokeDasharray:392.7,strokeDashoffset:392.7,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:3,transform:"rotate(-90 64 0)"})),E||(E=o.createElement("path",{id:"attention-dot",fill:"none",strokeDasharray:23.42,strokeDashoffset:23.42,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:7,d:"M63.956 40.588V64",transform:"rotate(180 63.956 52.294)"})),b||(b=o.createElement("path",{id:"attention-bar",fill:"none",strokeDasharray:.09,strokeDashoffset:.09,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:7,d:"M63.956 87.412h.088"})))};var j,L,O;function x(){return x=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},x.apply(null,arguments)}const P=function(e){return o.createElement("svg",x({shapeRendering:"geometricPrecision",textRendering:"geometricPrecision",viewBox:"0 0 128 128"},e),j||(j=o.createElement("circle",{id:"error-circle",r:62.5,fill:"none",strokeDasharray:392.7,strokeDashoffset:392.7,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:3,transform:"rotate(-90 64 0)"})),L||(L=o.createElement("path",{id:"error-stroke-1",fill:"none",strokeDasharray:37.96,strokeDashoffset:37.96,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:7,d:"m50.58 50.58 26.84 26.84",transform:"rotate(180 64 64)"})),O||(O=o.createElement("path",{id:"error-stroke-2",fill:"none",strokeDasharray:37.96,strokeDashoffset:37.96,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:7,d:"M77.42 50.58 50.58 77.42"})))};var D,M;function C(){return C=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},C.apply(null,arguments)}const N=function(e){return o.createElement("svg",C({xmlns:"http://www.w3.org/2000/svg",width:128,height:129,fill:"none",viewBox:"0 0 128 129"},e),D||(D=o.createElement("circle",{cx:64,cy:64.844,r:62.5,stroke:"var(--Palette-Contrast-1)",strokeWidth:3})),M||(M=o.createElement("path",{stroke:"var(--Palette-Contrast-1)",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:7,d:"M69.932 57.034c6.386-6.402 12.773-9.594 19.16-9.594a17 17 0 0 1 12.02 29.018 17 17 0 0 1-12.02 4.979c-8.499 0-16.998-5.652-25.497-16.998-8.5-11.347-16.998-16.999-25.497-16.999a16.998 16.998 0 0 0 0 33.997c6.372 0 12.744-3.177 19.117-9.55"})))},W={success:o.createElement(u,null),warning:o.createElement(v,null),attention:o.createElement(w,null),error:o.createElement(P,null),infinity_illustration:o.createElement(N,null)};class S extends o.Component{get animatedIconSVG(){return W[this.props.name]}render(){return o.createElement("div",{className:"illustration icon-feedback"},o.createElement("div",{className:this.props.name},this.animatedIconSVG))}}S.defaultProps={},S.propTypes={name:c().string};const B=S;var R;function q(){return q=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},q.apply(null,arguments)}const z=function(e){return o.createElement("svg",q({xmlns:"http://www.w3.org/2000/svg",width:10,height:8,fill:"none",viewBox:"0 0 10 8"},e),R||(R=o.createElement("path",{stroke:"var(--icon-color)",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"m1 2 4 4 4-4"})))};var T;function H(){return H=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},H.apply(null,arguments)}const V=function(e){return o.createElement("svg",H({xmlns:"http://www.w3.org/2000/svg",width:8,height:10,fill:"none",viewBox:"0 0 8 10"},e),T||(T=o.createElement("path",{stroke:"var(--icon-color)",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"m2 9 4-4-4-4"})))};var _,I,A,F,G;function J(){return J=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},J.apply(null,arguments)}const K=function(e){return o.createElement("svg",J({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),_||(_=o.createElement("title",{id:"logo-title"},"Passbolt logo")),I||(I=o.createElement("desc",{id:"logo-description"},"This is the logo of passbolt.")),A||(A=o.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"})),F||(F=o.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"})),G||(G=o.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 Q extends o.Component{constructor(e){super(e),this.state=this.defaultState,this.bindCallbacks()}get defaultState(){return{displayLogs:!1}}bindCallbacks(){this.handleDisplayLogsClick=this.handleDisplayLogsClick.bind(this)}handleDisplayLogsClick(){this.setState({displayLogs:!this.state.displayLogs})}render(){return o.createElement("div",{id:"container",className:"container api-feedback page"},o.createElement("div",{className:"content"},o.createElement("div",{className:"header"},o.createElement("div",{className:"logo-svg"},o.createElement(K,{role:"img",width:"20rem",height:"3.5rem"}))),o.createElement("div",{className:"api-feedback-card"},o.createElement(B,{name:"attention"}),o.createElement("h1",null,o.createElement(d.x,null,"Something went wrong!")),o.createElement("p",null,o.createElement(d.x,null,"Please try again later or contact your administrator.")),o.createElement("div",{className:"accordion-header"},o.createElement("button",{type:"button",className:"link no-border",onClick:this.handleDisplayLogsClick},o.createElement(d.x,null,"Logs")," ",this.state.displayLogs?o.createElement(z,null):o.createElement(V,null))),this.state.displayLogs&&o.createElement("div",{className:"accordion-content"},o.createElement("textarea",{readOnly:!0,value:this.props.message})))))}}Q.propTypes={message:c().string.isRequired,t:c().func};const U=(0,l.C)("common")(Q);class X extends o.Component{render(){return o.createElement("div",{id:"container",className:"container api-feedback page"},o.createElement("div",{className:"content"},o.createElement("div",{className:"header"},o.createElement("div",{className:"logo-svg"},o.createElement(K,{role:"img",width:"20rem",height:"3.5rem"}))),o.createElement("div",{className:"api-feedback-card"},o.createElement(B,{name:"success"}),o.createElement("p",null,this.props.message))))}}X.propTypes={message:c().string.isRequired,t:c().func};const Y=(0,l.C)("common")(X),Z="loading",$="Error",ee="Success";class te extends o.Component{constructor(e){super(e),this.state=this.defaultState}get defaultState(){return{state:Z,message:null}}componentDidMount(){const e=document.getElementById("api-error-details"),t=document.getElementById("api-success");e?this.setState({state:$,message:e?.textContent}):this.setState({state:ee,message:t?.textContent})}render(){switch(this.state.state){case Z:return o.createElement(o.Fragment,null);case $:return o.createElement(U,{message:this.state.message});case ee:return o.createElement(Y,{message:this.state.message})}}}te.propTypes={t:c().func};const re=(0,l.C)("common")(te),ne=document.createElement("div");document.body.appendChild(ne),(0,s.H)(ne).render(o.createElement(re,null))}};const t={};function r(n){const a=t[n];if(void 0!==a)return a.exports;const o=t[n]={exports:{}};return e[n].call(o.exports,o,o.exports,r),o.exports}r.m=e,(()=>{const e=[];r.O=(t,n,a)=>{if(!n){for(var o=0;o<e.length;o++){let[n,a]=e[o],i=!0;for(var s=0;s<n.length;s++)r.O.j(n[s])?n.splice(s--,1):i=!1;if(i){e.splice(o--,1);const r=a();void 0!==r&&(t=r)}}return t}e.push([n,a])}})(),r.n=e=>{const t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.cw=e=>{var t;return()=>{if(e){var r=e;e=0,t={exports:{}},r.call(t.exports,t,t.exports)}return t.exports}},r.d=(e,t)=>{if(Array.isArray(t))for(var n=0;n<t.length;){var a=t[n++],o=t[n++],s=0===o?{enumerable:!0,value:t[n++]}:{enumerable:!0,get:o};r.o(e,a)||Object.defineProperty(e,a,s)}else for(var a in t)r.o(t,a)&&!r.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.j=7647,(()=>{const e={7647:0};r.O.j=t=>0===e[t];const t=(t,n)=>{let[a,o,s]=n;var i,c,l=0;if(a.some(t=>0!==e[t])){for(i in o)r.o(o,i)&&(r.m[i]=o[i]);if(s)var d=s(r)}for(t&&t(n);l<a.length;l++)c=a[l],r.o(e,c)&&e[c]&&e[c][0](),e[c]=0;return r.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=r.O(void 0,[3847],()=>r(66313));n=r.O(n)})();
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see api-mfa-verify-delegated.js.LICENSE.txt */
|
|
2
|
-
(()=>{"use strict";var e={11364(e,t,r){var n=r(96540),s=r(5338);const a=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 i(e){return class extends n.Component{render(){return n.createElement(a.Consumer,null,t=>n.createElement(e,{context:t,...this.props}))}}}const o=a;class l{setBaseUrl(e){if(!e)throw new TypeError("ApiClientOption baseUrl is required.");if("string"==typeof e)try{this.baseUrl=new URL(e)}catch(e){throw new TypeError("ApiClientOption baseUrl is invalid.",{cause:e})}else{if(!(e instanceof URL))throw new TypeError("ApiClientOptions baseurl should be a string or URL");this.baseUrl=e}return this}setResourceName(e){if(!e)throw new TypeError("ApiClientOptions.setResourceName resourceName is required.");if("string"!=typeof e)throw new TypeError("ApiClientOptions.setResourceName resourceName should be a valid string.");return this.resourceName=e,this}getBaseUrl(){return this.baseUrl}getResourceName(){return this.resourceName}async getHeaders(){const e=await this.getCsrfToken();if(e)return{"X-CSRF-Token":e}}async getCsrfToken(){if("undefined"==typeof browser||void 0===browser.cookies){const e=document?.cookie?.split("; ")?.find(e=>e.startsWith("csrfToken"))?.split("=");return e&&2===e.length?e[1]:null}const e=this.baseUrl.toString(),t="/"===e.slice(-1)?e:`${e}/`,r=await browser.cookies.get({name:"csrfToken",url:t});return r?.value||null}}var c=r(5556),d=r.n(c);class h extends Error{constructor(e,t){super(e),this.name="PassboltApiFetchError",this.data=t||{}}}const u=h;class p extends Error{constructor(){super("An internal error occurred. The server response could not be parsed. Please contact your administrator."),this.name="PassboltBadResponseError"}}const m=p;class f extends Error{constructor(e){super(e=e||"The service is unavailable"),this.name="PassboltServiceUnavailableError"}}const g=f,y=["GET","POST","PUT","DELETE"];class E{constructor(e){if(this.options=e,!this.options.getBaseUrl())throw new TypeError("ApiClient constructor error: baseUrl is required.");if(!this.options.getResourceName())throw new TypeError("ApiClient constructor error: resourceName is required.");try{let e=this.options.getBaseUrl().toString();e.endsWith("/")&&(e=e.slice(0,-1));let t=this.options.getResourceName();t.startsWith("/")&&(t=t.slice(1)),t.endsWith("/")&&(t=t.slice(0,-1)),this.baseUrl=`${e}/${t}`,this.baseUrl=new URL(this.baseUrl)}catch(e){throw new TypeError("ApiClient constructor error: b.",{cause:e})}this.apiVersion="api-version=v2"}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 r=this.buildUrl(`${this.baseUrl}/${e}`,t||{});return this.fetchAndHandleResponse("GET",r)}async delete(e,t,r,n){let s;this.assertValidId(e),void 0===n&&(n=!1),s=n?this.buildUrl(`${this.baseUrl}/${e}/dry-run`,r||{}):this.buildUrl(`${this.baseUrl}/${e}`,r||{});let a=null;return t&&(a=this.buildBody(t)),this.fetchAndHandleResponse("DELETE",s,a)}async findAll(e){const t=this.buildUrl(this.baseUrl.toString(),e||{});return this.fetchAndHandleResponse("GET",t)}async create(e,t){const r=this.buildUrl(this.baseUrl.toString(),t||{}),n=this.buildBody(e);return this.fetchAndHandleResponse("POST",r,n)}async update(e,t,r,n){let s;this.assertValidId(e),void 0===n&&(n=!1),s=n?this.buildUrl(`${this.baseUrl}/${e}/dry-run`,r||{}):this.buildUrl(`${this.baseUrl}/${e}`,r||{});let a=null;return t&&(a=this.buildBody(t)),this.fetchAndHandleResponse("PUT",s,a)}async updateAll(e,t={}){const r=this.buildUrl(this.baseUrl.toString(),t),n=e?this.buildBody(e):null;return this.fetchAndHandleResponse("PUT",r,n)}assertValidId(e){if(!e)throw new TypeError("ApiClient.assertValidId error: id cannot be empty");if("string"!=typeof e)throw new TypeError("ApiClient.assertValidId error: id should be a string")}assertMethod(e){if("string"!=typeof e)throw new TypeError("ApiClient.assertValidMethod method should be a string.");if(y.indexOf(e.toUpperCase())<0)throw new TypeError(`ApiClient.assertValidMethod error: method ${e} is not supported.`)}assertUrl(e){if(!e)throw new TypeError("ApliClient.assertUrl error: url is required.");if(!(e instanceof URL))throw new TypeError("ApliClient.assertUrl error: url should be a valid URL object.");if("https:"!==e.protocol&&"http:"!==e.protocol)throw new TypeError("ApliClient.assertUrl error: url protocol should only be https or http.")}assertBody(e){if(!(e instanceof FormData)&&"string"!=typeof e)throw new TypeError("ApiClient.assertBody error: body should be a string or a FormData.")}buildBody(e){return JSON.stringify(e)}buildUrl(e,t){if("string"!=typeof e)throw new TypeError("ApiClient.buildUrl error: url should be a string.");const r=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)r.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=>{r.searchParams.append(e,t)})}}return r}async sendRequest(e,t,r,n){this.assertUrl(t),this.assertMethod(e),r&&this.assertBody(r);const s="undefined"!=typeof customApiClientFetch?customApiClientFetch:fetch,a={...await this.buildFetchOptions(),...n};a.method=e,r&&(a.body=r);try{return await s(t.toString(),a)}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,r,n){const s=await this.sendRequest(e,t,r,n);return this.parseResponseJson(s)}async parseResponseJson(e){let t;try{t=await e.json()}catch(t){throw console.debug(e.url.toString(),t),new m(t,e)}if(!e.ok){const r=t.header.message;throw new u(r,{header:t.header,code:e.status,body:t.body})}return t}}const b=class{constructor(e){this.apiClientOptions=e}async findSettings(){return this.initClient("verify/webauthn"),(await this.apiClient.findAll()).body}async begin(){return this.initClient("verify/webauthn/begin"),(await this.apiClient.create({})).body}async finish(e){return this.initClient("verify/webauthn/finish"),(await this.apiClient.create(e)).body}initClient(e){this.apiClientOptions.setResourceName(`mfa/${e}`),this.apiClient=new E(this.apiClientOptions)}};r(53050);var v=r(57761),w=r.n(v);class T extends Error{constructor(e){super(e=e||"Passkeys require Passbolt to be reached through a domain name, not an IP address."),this.name="WebauthnRelyingPartyIpAddressError"}}class C{static reload(){window.location.reload()}static assign(e){window.location.assign(e)}static getHostname(){return window.location.hostname}}class R{static async run(e,t){(e=>{if(w().isIP(e.replace(/^\[(.*)\]$/,"$1")))throw new T})(C.getHostname());const r=PublicKeyCredential.parseRequestOptionsFromJSON(e);return(await navigator.credentials.get({publicKey:r,signal:t})).toJSON()}}var k=r(13279);const x=n.createContext({state:null,providers:[],isRememberMeForAMonthEnabled:!1,redirect:"/",error:null,hideErrorLogs:!1,onInitializeRequested:()=>{},onVerifyRequested:()=>{},onRetryRequested:()=>{},getNextProviderUrl:()=>{}});class A extends n.Component{constructor(e){super(e),this.state={...this.defaultState,...e.value},this.mfaWebauthnVerifyService=new b(e.context.getApiClientOptions()),this.abortController=null}get defaultState(){return{state:O.INITIAL_STATE,providers:[],isRememberMeForAMonthEnabled:!1,redirect:"/",error:null,onInitializeRequested:this.onInitializeRequested.bind(this),onVerifyRequested:this.onVerifyRequested.bind(this),onRetryRequested:this.onRetryRequested.bind(this),getNextProviderUrl:this.getNextProviderUrl.bind(this)}}componentWillUnmount(){this.abortController?.abort()}async onInitializeRequested(){try{const{providers:e,isRememberMeForAMonthEnabled:t}=await this.mfaWebauthnVerifyService.findSettings();this.setState({state:O.VERIFY_STATE,providers:e,isRememberMeForAMonthEnabled:t})}catch(e){this.isUnauthorized(e)?this.navigateToLogin():400===e.data?.code?this.navigateToRedirect():this.handleError(e)}}async onVerifyRequested(e){let t;this.setState({state:O.CEREMONY_STATE});try{const{handle:r,credentialRequestOptions:n}=await this.mfaWebauthnVerifyService.begin();this.abortController=new AbortController;const s=this.abortController.signal;t={handle:r,credential:await R.run(n,s),remember:e}}catch(e){return void(this.isUnauthorized(e)?this.navigateToLogin():this.handleError(e))}this.setState({state:O.PROCESSING_STATE});try{await this.mfaWebauthnVerifyService.finish(t)}catch(e){return void await this.handleFinishError(e)}this.navigateToRedirect()}async handleFinishError(e){try{await this.mfaWebauthnVerifyService.findSettings()}catch(e){if(this.isUnauthorized(e))return void this.navigateToLogin()}this.handleError(e)}async onRetryRequested(){this.setState({error:null,state:O.INITIAL_STATE}),await this.onInitializeRequested()}getNextProviderUrl(){const e=this.state.providers;if(e.length<2)return null;const t=e.indexOf("webauthn"),r=e[(t+1)%e.length];return`${this.props.context.trustedDomain}/mfa/verify/${r}?redirect=${encodeURIComponent(this.state.redirect)}`}handleError(e){let t;switch(console.dir(e),e.name){case"SecurityError":t=new Error(this.props.t("The operation requires a secure connection. Passkeys were blocked due to an untrusted TLS certificate or an invalid Relying Party ID.")),t.cause=e;break;case"ConstraintError":t=new Error(this.props.t("A passkey prompt is already opened in another window. Please complete or cancel it to continue.")),t.cause=e;break;case"WebauthnRelyingPartyIpAddressError":t=new Error(this.props.t("Passkeys require Passbolt to be reached through a domain name, not an IP address.")),t.cause=e;break;default:t=e}this.setState({state:O.ERROR_STATE,error:t})}isUnauthorized(e){return 401===e.data?.code}navigateToRedirect(){const e=this.props.context.trustedDomain,t=/^\/[A-Z/-9\-]*$/i.test(this.state.redirect);C.assign(t?`${e}${this.state.redirect}`:`${e}/`)}navigateToLogin(){C.assign(`${this.props.context.trustedDomain}/auth/login`)}render(){return n.createElement(x.Provider,{value:this.state},this.props.children)}}function S(e){return class extends n.Component{render(){return n.createElement(x.Consumer,null,t=>n.createElement(e,{apiMfaVerifyContext:t,...this.props}))}}}A.propTypes={context:d().any,value:d().any,children:d().any},i((0,k.C)("common")(A));const O={INITIAL_STATE:"Initial state",VERIFY_STATE:"Verify state",CEREMONY_STATE:"Ceremony state",PROCESSING_STATE:"Processing state",ERROR_STATE:"Error state"},U=class{constructor(e){this.apiClientOptions=e}async begin(e){return this.initClient("verify/webauthn/delegated/begin"),(await this.apiClient.create({mfa_delegated_state:e})).body}async finish(e){return this.initClient("verify/webauthn/delegated/finish"),(await this.apiClient.create(e)).body}initClient(e){this.apiClientOptions.setResourceName(`mfa/${e}`),this.apiClient=new E(this.apiClientOptions)}},P={...O,VERIFIED_STATE:"Verified state",EXPIRED_STATE:"Expired state",UNSUPPORTED_STATE:"Unsupported state"},V="cancelled",N="unknown";class M extends n.Component{constructor(e){super(e),this.state={...this.defaultState,...e.value},this.mfaWebauthnDelegatedVerifyService=new U(e.context.getApiClientOptions()),this.abortController=null}get defaultState(){return{state:this.isBrowserSupported()?P.VERIFY_STATE:P.UNSUPPORTED_STATE,providers:[],isRememberMeForAMonthEnabled:!1,error:null,errorCode:null,hideErrorLogs:!0,delegatedToken:null,delegatedState:null,redirectUri:null,onVerifyRequested:this.onVerifyRequested.bind(this),onRetryRequested:this.onRetryRequested.bind(this),getNextProviderUrl:()=>null,getReturnToApplicationUrl:this.getReturnToApplicationUrl.bind(this)}}componentDidMount(){this.state.state===P.UNSUPPORTED_STATE?C.assign(this.getReturnToApplicationUrl()):this.onVerifyRequested()}componentWillUnmount(){this.abortController?.abort()}isBrowserSupported(){return"function"==typeof globalThis.PublicKeyCredential?.parseRequestOptionsFromJSON&&"function"==typeof globalThis.PublicKeyCredential?.prototype?.toJSON}async onVerifyRequested(){this.setState({state:P.CEREMONY_STATE});const e=this.state.delegatedState;let t;try{t=await this.mfaWebauthnDelegatedVerifyService.begin(e)}catch(e){return void this.returnToApplication(this.getFailureOutcome(e,N))}try{this.abortController=new AbortController;const r=this.abortController.signal,n=await R.run(t.credentialRequestOptions,r);this.setState({state:P.PROCESSING_STATE});const s={mfa_delegated_state:e,handle:t.handle,credential:n},{mfa_delegated_token:a}=await this.mfaWebauthnDelegatedVerifyService.finish(s);this.returnToApplication({state:P.VERIFIED_STATE,delegatedToken:a})}catch(e){this.returnToApplication(this.getFailureOutcome(e,this.getErrorCode(e)))}}getFailureOutcome(e,t){const r=e?.data?.body?.error;return r?.invalidDelegatedState||r?.missingDelegatedState?{state:P.EXPIRED_STATE}:{state:P.ERROR_STATE,error:e,errorCode:t}}onRetryRequested(){this.setState({error:null,errorCode:null,state:P.VERIFY_STATE})}getReturnToApplicationUrl(){return this.buildReturnToApplicationUrl(this.state)}buildReturnToApplicationUrl({state:e,errorCode:t,delegatedToken:r,redirectUri:n}){switch(e){case P.VERIFIED_STATE:return`${n}?mfa_delegated_token=${encodeURIComponent(r)}`;case P.EXPIRED_STATE:return`${n}?error=state_invalid`;case P.UNSUPPORTED_STATE:return`${n}?error=browser_unsupported`;case P.VERIFY_STATE:return`${n}?error=${V}`;case P.ERROR_STATE:return`${n}?error=${t}`;default:return null}}getErrorCode(e){return e instanceof u&&400===e.data?.code?"verification_failed":["NotAllowedError","AbortError"].includes(e?.name)?V:N}returnToApplication(e){this.setState(e),C.assign(this.buildReturnToApplicationUrl({...this.state,...e}))}render(){return n.createElement(x.Provider,{value:this.state},this.props.children)}}M.propTypes={context:d().any,value:d().any,children:d().any};const L=i(M);var D,j,I=r(91352);function _(){return _=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},_.apply(null,arguments)}const q=function(e){return n.createElement("svg",_({width:18,height:18,fill:"none",className:"svg-icon spinner",viewBox:"0 0 18 18"},e),D||(D=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)"})),j||(j=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 $ 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(q,null)))}}$.propTypes={title:d().oneOfType([d().arrayOf(d().node),d().node,d().string])},$.defaultProps={title:n.createElement(I.x,null,"Please wait...")};const F=(0,k.C)("common")($);class W extends n.Component{render(){const e=this.props.apiMfaVerifyContext.getNextProviderUrl();return e&&this.props.apiMfaVerifyContext.state!==O.CEREMONY_STATE?n.createElement("a",{href:e},n.createElement(I.x,null,"Or try with another provider")):null}}W.propTypes={apiMfaVerifyContext:d().object};const B=S((0,k.C)("common")(W));class H extends n.Component{render(){const e=this.props.apiMfaVerifyContext.getReturnToApplicationUrl?.();return e&&this.props.apiMfaVerifyContext.state!==O.CEREMONY_STATE?n.createElement("a",{href:e,className:"return-to-application"},n.createElement(I.x,null,"Return to app")):null}}H.propTypes={apiMfaVerifyContext:d().object};const z=S((0,k.C)("common")(H));var Y,G,J,K;function X(){return X=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},X.apply(null,arguments)}const Z=function(e){return n.createElement("svg",X({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 42 42"},e),Y||(Y=n.createElement("path",{fill:"#EBAC21",d:"M27.883.545H14.081C6.765.545.833 6.565.833 13.989v14.006c0 7.424 5.932 13.444 13.248 13.444h13.802c7.316 0 13.248-6.02 13.248-13.444V13.989c0-7.426-5.932-13.444-13.248-13.444"})),G||(G=n.createElement("path",{fill:"#353535",fillRule:"evenodd",d:"M34.956 19.269c0 2.63-1.619 4.866-3.871 5.682l1.364 2.258-2.016 2.48 2.016 2.423-3.253 4.365-2.293-2.446v-9.246c-2.037-.926-3.465-3.047-3.465-5.516 0-3.32 2.58-6.012 5.758-6.012 3.18.003 5.76 2.692 5.76 6.012m-5.76.923c.767 0 1.39-.649 1.39-1.452s-.623-1.452-1.39-1.452c-.768 0-1.391.65-1.391 1.452 0 .803.623 1.452 1.391 1.452",clipRule:"evenodd"})),J||(J=n.createElement("path",{fillRule:"evenodd",d:"M34.972 19.287c0 2.598-1.575 4.813-3.782 5.661l1.257 2.26-1.858 2.48 1.858 2.424-3.251 4.399V20.189c.768 0 1.391-.65 1.391-1.452 0-.803-.623-1.452-1.391-1.452v-4.026c3.192 0 5.776 2.697 5.776 6.028M25.018 25.88c-1.86-1.527-3.108-3.873-3.28-6.538H11.77c-2.091 0-3.785 1.72-3.785 3.841v4.801c0 1.061.848 1.922 1.892 1.922h13.249c1.044 0 1.892-.859 1.892-1.922z",clipRule:"evenodd"})),K||(K=n.createElement("path",{fill:"#141313",d:"M16.034 18.19c-.462-.089-.921-.172-1.356-.355-1.65-.692-2.611-1.97-2.922-3.773-.215-1.235-.113-2.456.386-3.61.709-1.64 1.984-2.532 3.653-2.832.998-.18 1.994-.14 2.958.22 1.449.539 2.418 1.575 2.869 3.1.454 1.535.387 3.073-.298 4.525-.708 1.519-1.948 2.333-3.516 2.652q-.195.041-.392.078-.689-.006-1.382-.005"})))};class Q extends n.Component{constructor(e){super(e),this.state={remember:!1},this.bindCallbacks()}bindCallbacks(){this.handleToggleRemember=this.handleToggleRemember.bind(this),this.handleSubmit=this.handleSubmit.bind(this)}get isProcessing(){return this.props.apiMfaVerifyContext.state===O.CEREMONY_STATE}handleToggleRemember(){this.setState({remember:!this.state.remember})}handleSubmit(e){e.preventDefault(),this.props.apiMfaVerifyContext.onVerifyRequested(this.state.remember)}render(){const e=this.isProcessing?"processing":"";return n.createElement("form",{onSubmit:this.handleSubmit},n.createElement(Z,{className:"centered-login-provider-icon"}),n.createElement("h1",{className:"centered-text login-title"},n.createElement(I.x,null,"Additional Authentication with Passkey")),this.props.apiMfaVerifyContext.isRememberMeForAMonthEnabled&&n.createElement("div",{className:"input checkbox"},n.createElement("input",{id:"remember",type:"checkbox",name:"remember",checked:this.state.remember,onChange:this.handleToggleRemember,disabled:this.isProcessing}),n.createElement("label",{htmlFor:"remember"},n.createElement(I.x,null,"Remember this device for a month."))),n.createElement("div",{className:"form-actions"},n.createElement("button",{type:"submit",className:`button primary big full-width ${e}`,disabled:this.isProcessing},n.createElement(I.x,null,"Verify with Passkey"),this.isProcessing&&n.createElement(q,null)),n.createElement(B,null),n.createElement(z,null)))}}Q.propTypes={apiMfaVerifyContext:d().object};const ee=S((0,k.C)("common")(Q));var te,re;function ne(){return ne=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ne.apply(null,arguments)}const se=function(e){return n.createElement("svg",ne({shapeRendering:"geometricPrecision",textRendering:"geometricPrecision",viewBox:"0 0 128 128"},e),te||(te=n.createElement("circle",{id:"success-circle",r:62.5,fill:"none",strokeDasharray:392.7,strokeDashoffset:392.7,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:3,transform:"rotate(-90 64 0)"})),re||(re=n.createElement("path",{id:"success-check",fill:"none",strokeDasharray:65.24,strokeDashoffset:65.24,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:7,d:"M87.062 46.703 55.351 78.415 40.936 64"})))};var ae,ie,oe;function le(){return le=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},le.apply(null,arguments)}const ce=function(e){return n.createElement("svg",le({shapeRendering:"geometricPrecision",textRendering:"geometricPrecision",viewBox:"0 0 128 128"},e),ae||(ae=n.createElement("path",{id:"warning-dot",fill:"none",strokeDasharray:23.42,strokeDashoffset:23.42,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:7,d:"M64.038 46.76v23.413"})),ie||(ie=n.createElement("path",{id:"warning-bar",fill:"none",strokeDasharray:.09,strokeDashoffset:.09,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:7,d:"M64.038 93.585h.088"})),oe||(oe=n.createElement("path",{id:"warning-triangle",fill:"none",strokeDasharray:364.98,strokeDashoffset:364.98,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:3,d:"M53.954 16.685 4.412 99.459a11.66 11.66 0 0 0-1.167 8.872 11.66 11.66 0 0 0 5.464 7.087 10.97 10.97 0 0 0 5.7 1.578h99.17a11.67 11.67 0 0 0 8.253-3.508 11.68 11.68 0 0 0 3.323-8.329 11 11 0 0 0-1.579-5.7L74.033 16.685A11.66 11.66 0 0 0 57.9 12.739a12.1 12.1 0 0 0-3.946 3.946"})))};var de,he,ue;function pe(){return pe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},pe.apply(null,arguments)}const me=function(e){return n.createElement("svg",pe({shapeRendering:"geometricPrecision",textRendering:"geometricPrecision",viewBox:"0 0 128 128"},e),de||(de=n.createElement("circle",{id:"attention-circle",r:62.5,fill:"none",strokeDasharray:392.7,strokeDashoffset:392.7,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:3,transform:"rotate(-90 64 0)"})),he||(he=n.createElement("path",{id:"attention-dot",fill:"none",strokeDasharray:23.42,strokeDashoffset:23.42,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:7,d:"M63.956 40.588V64",transform:"rotate(180 63.956 52.294)"})),ue||(ue=n.createElement("path",{id:"attention-bar",fill:"none",strokeDasharray:.09,strokeDashoffset:.09,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:7,d:"M63.956 87.412h.088"})))};var fe,ge,ye;function Ee(){return Ee=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ee.apply(null,arguments)}const be=function(e){return n.createElement("svg",Ee({shapeRendering:"geometricPrecision",textRendering:"geometricPrecision",viewBox:"0 0 128 128"},e),fe||(fe=n.createElement("circle",{id:"error-circle",r:62.5,fill:"none",strokeDasharray:392.7,strokeDashoffset:392.7,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:3,transform:"rotate(-90 64 0)"})),ge||(ge=n.createElement("path",{id:"error-stroke-1",fill:"none",strokeDasharray:37.96,strokeDashoffset:37.96,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:7,d:"m50.58 50.58 26.84 26.84",transform:"rotate(180 64 64)"})),ye||(ye=n.createElement("path",{id:"error-stroke-2",fill:"none",strokeDasharray:37.96,strokeDashoffset:37.96,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:7,d:"M77.42 50.58 50.58 77.42"})))};var ve,we;function Te(){return Te=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Te.apply(null,arguments)}const Ce=function(e){return n.createElement("svg",Te({xmlns:"http://www.w3.org/2000/svg",width:128,height:129,fill:"none",viewBox:"0 0 128 129"},e),ve||(ve=n.createElement("circle",{cx:64,cy:64.844,r:62.5,stroke:"var(--Palette-Contrast-1)",strokeWidth:3})),we||(we=n.createElement("path",{stroke:"var(--Palette-Contrast-1)",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:7,d:"M69.932 57.034c6.386-6.402 12.773-9.594 19.16-9.594a17 17 0 0 1 12.02 29.018 17 17 0 0 1-12.02 4.979c-8.499 0-16.998-5.652-25.497-16.998-8.5-11.347-16.998-16.999-25.497-16.999a16.998 16.998 0 0 0 0 33.997c6.372 0 12.744-3.177 19.117-9.55"})))},Re={success:n.createElement(se,null),warning:n.createElement(ce,null),attention:n.createElement(me,null),error:n.createElement(be,null),infinity_illustration:n.createElement(Ce,null)};class ke extends n.Component{get animatedIconSVG(){return Re[this.props.name]}render(){return n.createElement("div",{className:"illustration icon-feedback"},n.createElement("div",{className:this.props.name},this.animatedIconSVG))}}ke.defaultProps={},ke.propTypes={name:d().string};const xe=ke;var Ae;function Se(){return Se=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Se.apply(null,arguments)}const Oe=function(e){return n.createElement("svg",Se({xmlns:"http://www.w3.org/2000/svg",width:10,height:8,fill:"none",viewBox:"0 0 10 8"},e),Ae||(Ae=n.createElement("path",{stroke:"var(--icon-color)",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"m1 2 4 4 4-4"})))};var Ue;function Pe(){return Pe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Pe.apply(null,arguments)}const Ve=function(e){return n.createElement("svg",Pe({xmlns:"http://www.w3.org/2000/svg",width:8,height:10,fill:"none",viewBox:"0 0 8 10"},e),Ue||(Ue=n.createElement("path",{stroke:"var(--icon-color)",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"m2 9 4-4-4-4"})))};class Ne extends n.Component{constructor(e){super(e),this.state={displayLogs:!1},this.bindCallbacks()}bindCallbacks(){this.handleDisplayLogsClick=this.handleDisplayLogsClick.bind(this),this.handleTryAgainClick=this.handleTryAgainClick.bind(this)}handleDisplayLogsClick(){this.setState({displayLogs:!this.state.displayLogs})}handleTryAgainClick(){this.props.apiMfaVerifyContext.onRetryRequested()}get logs(){const{name:e,message:t,data:r}=this.props.apiMfaVerifyContext.error||{};return JSON.stringify({name:e,message:t,data:r},null,4)}render(){const e=this.props.apiMfaVerifyContext.hideErrorLogs;return n.createElement("div",{className:"mfa-verify-error"},n.createElement(xe,{name:"attention"}),n.createElement("h1",null,n.createElement(I.x,null,"Something went wrong!")),n.createElement("p",null,e?n.createElement(I.x,null,"Please try again, or return to the application."):n.createElement(I.x,null,"Please try again later or check the logs for more information.")),n.createElement("div",{className:"form-actions"},n.createElement("button",{type:"button",className:"button primary big full-width",onClick:this.handleTryAgainClick},n.createElement(I.x,null,"Try again")),n.createElement(B,null),n.createElement(z,null)),!e&&n.createElement("div",{className:"accordion-header"},n.createElement("button",{type:"button",className:"link no-border",onClick:this.handleDisplayLogsClick},n.createElement(I.x,null,"Logs")," ",this.state.displayLogs?n.createElement(Oe,null):n.createElement(Ve,null))),this.state.displayLogs&&n.createElement("div",{className:"accordion-content"},n.createElement("textarea",{readOnly:!0,value:this.logs})))}}Ne.propTypes={apiMfaVerifyContext:d().object};const Me=S((0,k.C)("common")(Ne));class Le extends n.Component{render(){return n.createElement("div",{className:"mfa-verify-delegated-result mfa-verify-delegated-success"},n.createElement(xe,{name:"success"}),n.createElement("h1",null,n.createElement(I.x,null,"Passkey verified")),n.createElement("p",null,n.createElement(I.x,null,"You can now return to the application.")),n.createElement("div",{className:"form-actions"},n.createElement("a",{className:"button primary big full-width",href:this.props.apiMfaVerifyContext.getReturnToApplicationUrl()},n.createElement(I.x,null,"Return to app"))))}}Le.propTypes={apiMfaVerifyContext:d().object};const De=S((0,k.C)("common")(Le));class je extends n.Component{render(){return n.createElement("div",{className:"mfa-verify-delegated-result mfa-verify-delegated-expired"},n.createElement(xe,{name:"attention"}),n.createElement("h1",null,n.createElement(I.x,null,"This verification link is no longer valid.")),n.createElement("p",null,n.createElement(I.x,null,"It has already been used, or it expired. Start the verification again from the application.")),n.createElement("div",{className:"form-actions"},n.createElement("a",{className:"button primary big full-width",href:this.props.apiMfaVerifyContext.getReturnToApplicationUrl()},n.createElement(I.x,null,"Return to app"))))}}je.propTypes={apiMfaVerifyContext:d().object};const Ie=S((0,k.C)("common")(je));class _e extends n.Component{render(){return n.createElement("div",{className:"mfa-verify-delegated-result mfa-verify-delegated-unsupported"},n.createElement(xe,{name:"attention"}),n.createElement("h1",null,n.createElement(I.x,null,"This browser cannot verify with a passkey.")),n.createElement("p",null,n.createElement(I.x,null,"Update your browser or your operating system, then start the verification again from the application.")),n.createElement("div",{className:"form-actions"},n.createElement("a",{className:"button primary big full-width",href:this.props.apiMfaVerifyContext.getReturnToApplicationUrl()},n.createElement(I.x,null,"Return to app"))))}}_e.propTypes={apiMfaVerifyContext:d().object};const qe=S((0,k.C)("common")(_e));class $e extends n.Component{render(){switch(this.props.apiMfaVerifyContext.state){case P.VERIFY_STATE:case P.CEREMONY_STATE:return n.createElement(ee,null);case P.VERIFIED_STATE:return n.createElement(De,null);case P.EXPIRED_STATE:return n.createElement(Ie,null);case P.UNSUPPORTED_STATE:return n.createElement(qe,null);case P.ERROR_STATE:return n.createElement(Me,null);default:return n.createElement(F,null)}}}$e.propTypes={apiMfaVerifyContext:d().object};const Fe=S($e);var We=r(72635),Be=r(51831),He=r(32107);class ze extends n.Component{constructor(e){super(e),this.state=this.defaultState}get defaultState(){return{ready:!1}}async componentDidMount(){await(0,We.Yx)(Be.r).use(He.A).init({lng:this.locale,load:"currentOnly",interpolation:{escapeValue:!1},react:{useSuspense:!1},backend:{loadPath:(e,t)=>this.getTranslationPath(e,t)},supportedLngs:this.supportedLocales,fallbackLng:!1,ns:["common"],defaultNS:"common",keySeparator:!1,nsSeparator:!1,debug:!1}),this.setState({ready:!0})}getTranslationPath(e,t){const r=e[0],n=t[0],s="en-GB"===r?"en-UK":r;return(this.props.loadingPath||"/locales/{{lng}}/{{ns}}.json").replace("{{lng}}",s).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,We.v2)(this.locale)}get isReady(){return this.state.ready}render(){return n.createElement(n.Fragment,null,this.isReady&&this.props.children)}}ze.propTypes={context:d().any,loadingPath:d().any,children:d().any};const Ye=i(ze);var Ge,Je,Ke,Xe,Ze;function Qe(){return Qe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Qe.apply(null,arguments)}const et=function(e){return n.createElement("svg",Qe({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),Ge||(Ge=n.createElement("title",{id:"logo-title"},"Passbolt logo")),Je||(Je=n.createElement("desc",{id:"logo-description"},"This is the logo of passbolt.")),Ke||(Ke=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"})),Xe||(Xe=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"})),Ze||(Ze=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 tt extends n.Component{constructor(e){super(e),this.state=this.defaultState}get defaultState(){return{trustedDomain:this.baseUrl,getApiClientOptions:this.getApiClientOptions.bind(this),locale:this.appElement?.dataset.locale||"en-UK"}}get baseUrl(){const e=document.getElementsByTagName("base")?.[0];return e?e.attributes.href.value.replace(/\/*$/g,""):(console.error("Unable to retrieve the page base tag"),"")}get appElement(){return document.getElementById("api-mfa-verify-delegated")}get delegatedValue(){return{delegatedState:this.appElement?.dataset.state,redirectUri:this.appElement?.dataset.redirectUri}}getApiClientOptions(){return(new l).setBaseUrl(this.state.trustedDomain)}render(){return n.createElement(o.Provider,{value:this.state},n.createElement(Ye,{loadingPath:`${this.state.trustedDomain}/locales/{{lng}}/{{ns}}.json`},n.createElement(L,{value:this.delegatedValue},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(et,{role:"img",width:"20rem",height:"3.5rem"}))),n.createElement("div",{className:"login-form"},n.createElement(Fe,null)))))))}}const rt=tt,nt=document.createElement("div");document.body.appendChild(nt),(0,s.H)(nt).render(n.createElement(rt,null))}};const t={};function r(n){const s=t[n];if(void 0!==s)return s.exports;const a=t[n]={exports:{}};return e[n].call(a.exports,a,a.exports,r),a.exports}r.m=e,(()=>{const e=[];r.O=(t,n,s)=>{if(!n){for(var a=0;a<e.length;a++){let[n,s]=e[a],o=!0;for(var i=0;i<n.length;i++)r.O.j(n[i])?n.splice(i--,1):o=!1;if(o){e.splice(a--,1);const r=s();void 0!==r&&(t=r)}}return t}e.push([n,s])}})(),r.n=e=>{const t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.cw=e=>{var t;return()=>{if(e){var r=e;e=0,t={exports:{}},r.call(t.exports,t,t.exports)}return t.exports}},r.d=(e,t)=>{if(Array.isArray(t))for(var n=0;n<t.length;){var s=t[n++],a=t[n++],i=0===a?{enumerable:!0,value:t[n++]}:{enumerable:!0,get:a};r.o(e,s)||Object.defineProperty(e,s,i)}else for(var s in t)r.o(t,s)&&!r.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.j=1786,(()=>{const e={1786:0};r.O.j=t=>0===e[t];const t=(t,n)=>{let[s,a,i]=n;var o,l,c=0;if(s.some(t=>0!==e[t])){for(o in a)r.o(a,o)&&(r.m[o]=a[o]);if(i)var d=i(r)}for(t&&t(n);c<s.length;c++)l=s[c],r.o(e,l)&&e[l]&&e[l][0](),e[l]=0;return r.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=r.O(void 0,[3847],()=>r(11364));n=r.O(n)})();
|
|
2
|
+
(()=>{"use strict";var e={11364(e,t,r){var n=r(96540),s=r(5338);const a=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 i(e){return class extends n.Component{render(){return n.createElement(a.Consumer,null,t=>n.createElement(e,{context:t,...this.props}))}}}const o=a;class l{setBaseUrl(e){if(!e)throw new TypeError("ApiClientOption baseUrl is required.");if("string"==typeof e)try{this.baseUrl=new URL(e)}catch(e){throw new TypeError("ApiClientOption baseUrl is invalid.",{cause:e})}else{if(!(e instanceof URL))throw new TypeError("ApiClientOptions baseurl should be a string or URL");this.baseUrl=e}return this}setResourceName(e){if(!e)throw new TypeError("ApiClientOptions.setResourceName resourceName is required.");if("string"!=typeof e)throw new TypeError("ApiClientOptions.setResourceName resourceName should be a valid string.");return this.resourceName=e,this}getBaseUrl(){return this.baseUrl}getResourceName(){return this.resourceName}async getHeaders(){const e=await this.getCsrfToken();if(e)return{"X-CSRF-Token":e}}async getCsrfToken(){if("undefined"==typeof browser||void 0===browser.cookies){const e=document?.cookie?.split("; ")?.find(e=>e.startsWith("csrfToken"))?.split("=");return e&&2===e.length?e[1]:null}const e=this.baseUrl.toString(),t="/"===e.slice(-1)?e:`${e}/`,r=await browser.cookies.get({name:"csrfToken",url:t});return r?.value||null}}var c=r(5556),d=r.n(c);class h extends Error{constructor(e,t){super(e),this.name="PassboltApiFetchError",this.data=t||{}}}const u=h;class p extends Error{constructor(){super("An internal error occurred. The server response could not be parsed. Please contact your administrator."),this.name="PassboltBadResponseError"}}const m=p;class f extends Error{constructor(e){super(e=e||"The service is unavailable"),this.name="PassboltServiceUnavailableError"}}const g=f,y=["GET","POST","PUT","DELETE"];class E{constructor(e){if(this.options=e,!this.options.getBaseUrl())throw new TypeError("ApiClient constructor error: baseUrl is required.");if(!this.options.getResourceName())throw new TypeError("ApiClient constructor error: resourceName is required.");try{let e=this.options.getBaseUrl().toString();e.endsWith("/")&&(e=e.slice(0,-1));let t=this.options.getResourceName();t.startsWith("/")&&(t=t.slice(1)),t.endsWith("/")&&(t=t.slice(0,-1)),this.baseUrl=`${e}/${t}`,this.baseUrl=new URL(this.baseUrl)}catch(e){throw new TypeError("ApiClient constructor error: b.",{cause:e})}this.apiVersion="api-version=v2"}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 r=this.buildUrl(`${this.baseUrl}/${e}`,t||{});return this.fetchAndHandleResponse("GET",r)}async delete(e,t,r,n){let s;this.assertValidId(e),void 0===n&&(n=!1),s=n?this.buildUrl(`${this.baseUrl}/${e}/dry-run`,r||{}):this.buildUrl(`${this.baseUrl}/${e}`,r||{});let a=null;return t&&(a=this.buildBody(t)),this.fetchAndHandleResponse("DELETE",s,a)}async findAll(e){const t=this.buildUrl(this.baseUrl.toString(),e||{});return this.fetchAndHandleResponse("GET",t)}async create(e,t){const r=this.buildUrl(this.baseUrl.toString(),t||{}),n=this.buildBody(e);return this.fetchAndHandleResponse("POST",r,n)}async update(e,t,r,n){let s;this.assertValidId(e),void 0===n&&(n=!1),s=n?this.buildUrl(`${this.baseUrl}/${e}/dry-run`,r||{}):this.buildUrl(`${this.baseUrl}/${e}`,r||{});let a=null;return t&&(a=this.buildBody(t)),this.fetchAndHandleResponse("PUT",s,a)}async updateAll(e,t={}){const r=this.buildUrl(this.baseUrl.toString(),t),n=e?this.buildBody(e):null;return this.fetchAndHandleResponse("PUT",r,n)}assertValidId(e){if(!e)throw new TypeError("ApiClient.assertValidId error: id cannot be empty");if("string"!=typeof e)throw new TypeError("ApiClient.assertValidId error: id should be a string")}assertMethod(e){if("string"!=typeof e)throw new TypeError("ApiClient.assertValidMethod method should be a string.");if(y.indexOf(e.toUpperCase())<0)throw new TypeError(`ApiClient.assertValidMethod error: method ${e} is not supported.`)}assertUrl(e){if(!e)throw new TypeError("ApliClient.assertUrl error: url is required.");if(!(e instanceof URL))throw new TypeError("ApliClient.assertUrl error: url should be a valid URL object.");if("https:"!==e.protocol&&"http:"!==e.protocol)throw new TypeError("ApliClient.assertUrl error: url protocol should only be https or http.")}assertBody(e){if(!(e instanceof FormData)&&"string"!=typeof e)throw new TypeError("ApiClient.assertBody error: body should be a string or a FormData.")}buildBody(e){return JSON.stringify(e)}buildUrl(e,t){if("string"!=typeof e)throw new TypeError("ApiClient.buildUrl error: url should be a string.");const r=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)r.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=>{r.searchParams.append(e,t)})}}return r}async sendRequest(e,t,r,n){this.assertUrl(t),this.assertMethod(e),r&&this.assertBody(r);const s="undefined"!=typeof customApiClientFetch?customApiClientFetch:fetch,a={...await this.buildFetchOptions(),...n};a.method=e,r&&(a.body=r);try{return await s(t.toString(),a)}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,r,n){const s=await this.sendRequest(e,t,r,n);return this.parseResponseJson(s)}async parseResponseJson(e){let t;try{t=await e.json()}catch(t){throw console.debug(e.url.toString(),t),new m(t,e)}if(!e.ok){const r=t.header.message;throw new u(r,{header:t.header,code:e.status,body:t.body})}return t}}const b=class{constructor(e){this.apiClientOptions=e}async findSettings(){return this.initClient("verify/webauthn"),(await this.apiClient.findAll()).body}async begin(){return this.initClient("verify/webauthn/begin"),(await this.apiClient.create({})).body}async finish(e){return this.initClient("verify/webauthn/finish"),(await this.apiClient.create(e)).body}initClient(e){this.apiClientOptions.setResourceName(`mfa/${e}`),this.apiClient=new E(this.apiClientOptions)}};r(53050);var v=r(57761),w=r.n(v);class T extends Error{constructor(e){super(e=e||"Passkeys require Passbolt to be reached through a domain name, not an IP address."),this.name="WebauthnRelyingPartyIpAddressError"}}class C{static reload(){window.location.reload()}static assign(e){window.location.assign(e)}static getHostname(){return window.location.hostname}}class R{static async run(e,t){(e=>{if(w().isIP(e.replace(/^\[(.*)\]$/,"$1")))throw new T})(C.getHostname());const r=PublicKeyCredential.parseRequestOptionsFromJSON(e);return(await navigator.credentials.get({publicKey:r,signal:t})).toJSON()}}var k=r(13279);const x=n.createContext({state:null,providers:[],isRememberMeForAMonthEnabled:!1,redirect:"/",error:null,hideErrorLogs:!1,onInitializeRequested:()=>{},onVerifyRequested:()=>{},onRetryRequested:()=>{},getNextProviderUrl:()=>{}});class A extends n.Component{constructor(e){super(e),this.state={...this.defaultState,...e.value},this.mfaWebauthnVerifyService=new b(e.context.getApiClientOptions()),this.abortController=null}get defaultState(){return{state:O.INITIAL_STATE,providers:[],isRememberMeForAMonthEnabled:!1,redirect:"/",error:null,onInitializeRequested:this.onInitializeRequested.bind(this),onVerifyRequested:this.onVerifyRequested.bind(this),onRetryRequested:this.onRetryRequested.bind(this),getNextProviderUrl:this.getNextProviderUrl.bind(this)}}componentWillUnmount(){this.abortController?.abort()}async onInitializeRequested(){try{const{providers:e,isRememberMeForAMonthEnabled:t}=await this.mfaWebauthnVerifyService.findSettings();this.setState({state:O.VERIFY_STATE,providers:e,isRememberMeForAMonthEnabled:t})}catch(e){this.isUnauthorized(e)?this.navigateToLogin():400===e.data?.code?this.navigateToRedirect():this.handleError(e)}}async onVerifyRequested(e){let t;this.setState({state:O.CEREMONY_STATE});try{const{handle:r,credentialRequestOptions:n}=await this.mfaWebauthnVerifyService.begin();this.abortController=new AbortController;const s=this.abortController.signal;t={handle:r,credential:await R.run(n,s),remember:e}}catch(e){return void(this.isUnauthorized(e)?this.navigateToLogin():this.handleError(e))}this.setState({state:O.PROCESSING_STATE});try{await this.mfaWebauthnVerifyService.finish(t)}catch(e){return void await this.handleFinishError(e)}this.navigateToRedirect()}async handleFinishError(e){try{await this.mfaWebauthnVerifyService.findSettings()}catch(e){if(this.isUnauthorized(e))return void this.navigateToLogin()}this.handleError(e)}async onRetryRequested(){this.setState({error:null,state:O.INITIAL_STATE}),await this.onInitializeRequested()}getNextProviderUrl(){const e=this.state.providers;if(e.length<2)return null;const t=e.indexOf("webauthn"),r=e[(t+1)%e.length];return`${this.props.context.trustedDomain}/mfa/verify/${r}?redirect=${encodeURIComponent(this.state.redirect)}`}handleError(e){let t;switch(console.dir(e),e.name){case"SecurityError":t=new Error(this.props.t("The operation requires a secure connection. Passkeys were blocked due to an untrusted TLS certificate or an invalid Relying Party ID.")),t.cause=e;break;case"ConstraintError":t=new Error(this.props.t("A passkey prompt is already opened in another window. Please complete or cancel it to continue.")),t.cause=e;break;case"WebauthnRelyingPartyIpAddressError":t=new Error(this.props.t("Passkeys require Passbolt to be reached through a domain name, not an IP address.")),t.cause=e;break;default:t=e}this.setState({state:O.ERROR_STATE,error:t})}isUnauthorized(e){return 401===e.data?.code}navigateToRedirect(){const e=this.props.context.trustedDomain,t=/^\/[A-Z/-9\-]*$/i.test(this.state.redirect);C.assign(t?`${e}${this.state.redirect}`:`${e}/`)}navigateToLogin(){C.assign(`${this.props.context.trustedDomain}/auth/login`)}render(){return n.createElement(x.Provider,{value:this.state},this.props.children)}}function S(e){return class extends n.Component{render(){return n.createElement(x.Consumer,null,t=>n.createElement(e,{apiMfaVerifyContext:t,...this.props}))}}}A.propTypes={context:d().any,value:d().any,children:d().any},i((0,k.C)("common")(A));const O={INITIAL_STATE:"Initial state",VERIFY_STATE:"Verify state",CEREMONY_STATE:"Ceremony state",PROCESSING_STATE:"Processing state",ERROR_STATE:"Error state"},U=class{constructor(e){this.apiClientOptions=e}async begin(e){return this.initClient("verify/webauthn/delegated/begin"),(await this.apiClient.create({mfa_delegated_state:e})).body}async finish(e){return this.initClient("verify/webauthn/delegated/finish"),(await this.apiClient.create(e)).body}initClient(e){this.apiClientOptions.setResourceName(`mfa/${e}`),this.apiClient=new E(this.apiClientOptions)}},P={...O,VERIFIED_STATE:"Verified state",EXPIRED_STATE:"Expired state",UNSUPPORTED_STATE:"Unsupported state"},V="cancelled",N="unknown";class M extends n.Component{constructor(e){super(e),this.state={...this.defaultState,...e.value},this.mfaWebauthnDelegatedVerifyService=new U(e.context.getApiClientOptions()),this.abortController=null}get defaultState(){return{state:this.isBrowserSupported()?P.VERIFY_STATE:P.UNSUPPORTED_STATE,providers:[],isRememberMeForAMonthEnabled:!1,error:null,errorCode:null,hideErrorLogs:!0,delegatedToken:null,delegatedState:null,redirectUri:null,onVerifyRequested:this.onVerifyRequested.bind(this),onRetryRequested:this.onRetryRequested.bind(this),getNextProviderUrl:()=>null,getReturnToApplicationUrl:this.getReturnToApplicationUrl.bind(this)}}componentDidMount(){this.state.state===P.UNSUPPORTED_STATE?C.assign(this.getReturnToApplicationUrl()):this.onVerifyRequested()}componentWillUnmount(){this.abortController?.abort()}isBrowserSupported(){return"function"==typeof globalThis.PublicKeyCredential?.parseRequestOptionsFromJSON&&"function"==typeof globalThis.PublicKeyCredential?.prototype?.toJSON}async onVerifyRequested(){this.setState({state:P.CEREMONY_STATE});const e=this.state.delegatedState;let t;try{t=await this.mfaWebauthnDelegatedVerifyService.begin(e)}catch(e){return void this.returnToApplication(this.getFailureOutcome(e,N))}try{this.abortController=new AbortController;const r=this.abortController.signal,n=await R.run(t.credentialRequestOptions,r);this.setState({state:P.PROCESSING_STATE});const s={mfa_delegated_state:e,handle:t.handle,credential:n},{mfa_delegated_token:a}=await this.mfaWebauthnDelegatedVerifyService.finish(s);this.returnToApplication({state:P.VERIFIED_STATE,delegatedToken:a})}catch(e){this.returnToApplication(this.getFailureOutcome(e,this.getErrorCode(e)))}}getFailureOutcome(e,t){const r=e?.data?.body?.error;return r?.invalidDelegatedState||r?.missingDelegatedState?{state:P.EXPIRED_STATE}:{state:P.ERROR_STATE,error:e,errorCode:t}}onRetryRequested(){this.setState({error:null,errorCode:null,state:P.VERIFY_STATE})}getReturnToApplicationUrl(){return this.buildReturnToApplicationUrl(this.state)}buildReturnToApplicationUrl({state:e,errorCode:t,delegatedToken:r,redirectUri:n}){switch(e){case P.VERIFIED_STATE:return`${n}?mfa_delegated_token=${encodeURIComponent(r)}`;case P.EXPIRED_STATE:return`${n}?error=state_invalid`;case P.UNSUPPORTED_STATE:return`${n}?error=browser_unsupported`;case P.VERIFY_STATE:return`${n}?error=${V}`;case P.ERROR_STATE:return`${n}?error=${t}`;default:return null}}getErrorCode(e){return e instanceof u&&400===e.data?.code?"verification_failed":["NotAllowedError","AbortError"].includes(e?.name)?V:N}returnToApplication(e){this.setState(e),C.assign(this.buildReturnToApplicationUrl({...this.state,...e}))}render(){return n.createElement(x.Provider,{value:this.state},this.props.children)}}M.propTypes={context:d().any,value:d().any,children:d().any};const L=i(M);var D,j,I=r(91352);function _(){return _=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},_.apply(null,arguments)}const q=function(e){return n.createElement("svg",_({width:18,height:18,fill:"none",className:"svg-icon spinner",viewBox:"0 0 18 18"},e),D||(D=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)"})),j||(j=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 $ 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(q,null)))}}$.propTypes={title:d().oneOfType([d().arrayOf(d().node),d().node,d().string])},$.defaultProps={title:n.createElement(I.x,null,"Please wait...")};const F=(0,k.C)("common")($);class W extends n.Component{render(){const e=this.props.apiMfaVerifyContext.getNextProviderUrl();return e&&this.props.apiMfaVerifyContext.state!==O.CEREMONY_STATE?n.createElement("a",{href:e},n.createElement(I.x,null,"Or try with another provider")):null}}W.propTypes={apiMfaVerifyContext:d().object};const B=S((0,k.C)("common")(W));class H extends n.Component{render(){const e=this.props.apiMfaVerifyContext.getReturnToApplicationUrl?.();return e&&this.props.apiMfaVerifyContext.state!==O.CEREMONY_STATE?n.createElement("a",{href:e,className:"return-to-application"},n.createElement(I.x,null,"Return to app")):null}}H.propTypes={apiMfaVerifyContext:d().object};const z=S((0,k.C)("common")(H));var Y,G,J,K;function X(){return X=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},X.apply(null,arguments)}const Z=function(e){return n.createElement("svg",X({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 42 42"},e),Y||(Y=n.createElement("path",{fill:"#EBAC21",d:"M27.883.545H14.081C6.765.545.833 6.565.833 13.989v14.006c0 7.424 5.932 13.444 13.248 13.444h13.802c7.316 0 13.248-6.02 13.248-13.444V13.989c0-7.426-5.932-13.444-13.248-13.444"})),G||(G=n.createElement("path",{fill:"#353535",fillRule:"evenodd",d:"M34.956 19.269c0 2.63-1.619 4.866-3.871 5.682l1.364 2.258-2.016 2.48 2.016 2.423-3.253 4.365-2.293-2.446v-9.246c-2.037-.926-3.465-3.047-3.465-5.516 0-3.32 2.58-6.012 5.758-6.012 3.18.003 5.76 2.692 5.76 6.012m-5.76.923c.767 0 1.39-.649 1.39-1.452s-.623-1.452-1.39-1.452c-.768 0-1.391.65-1.391 1.452 0 .803.623 1.452 1.391 1.452",clipRule:"evenodd"})),J||(J=n.createElement("path",{fillRule:"evenodd",d:"M34.972 19.287c0 2.598-1.575 4.813-3.782 5.661l1.257 2.26-1.858 2.48 1.858 2.424-3.251 4.399V20.189c.768 0 1.391-.65 1.391-1.452 0-.803-.623-1.452-1.391-1.452v-4.026c3.192 0 5.776 2.697 5.776 6.028M25.018 25.88c-1.86-1.527-3.108-3.873-3.28-6.538H11.77c-2.091 0-3.785 1.72-3.785 3.841v4.801c0 1.061.848 1.922 1.892 1.922h13.249c1.044 0 1.892-.859 1.892-1.922z",clipRule:"evenodd"})),K||(K=n.createElement("path",{fill:"#141313",d:"M16.034 18.19c-.462-.089-.921-.172-1.356-.355-1.65-.692-2.611-1.97-2.922-3.773-.215-1.235-.113-2.456.386-3.61.709-1.64 1.984-2.532 3.653-2.832.998-.18 1.994-.14 2.958.22 1.449.539 2.418 1.575 2.869 3.1.454 1.535.387 3.073-.298 4.525-.708 1.519-1.948 2.333-3.516 2.652q-.195.041-.392.078-.689-.006-1.382-.005"})))};class Q extends n.Component{constructor(e){super(e),this.state={remember:!1},this.bindCallbacks()}bindCallbacks(){this.handleToggleRemember=this.handleToggleRemember.bind(this),this.handleSubmit=this.handleSubmit.bind(this)}get isProcessing(){return this.props.apiMfaVerifyContext.state===O.CEREMONY_STATE}handleToggleRemember(){this.setState({remember:!this.state.remember})}handleSubmit(e){e.preventDefault(),this.props.apiMfaVerifyContext.onVerifyRequested(this.state.remember)}render(){const e=this.isProcessing?"processing":"";return n.createElement("form",{onSubmit:this.handleSubmit},n.createElement(Z,{className:"centered-login-provider-icon"}),n.createElement("h1",{className:"centered-text login-title"},n.createElement(I.x,null,"Additional Authentication with Passkey")),this.props.apiMfaVerifyContext.isRememberMeForAMonthEnabled&&n.createElement("div",{className:"input checkbox"},n.createElement("input",{id:"remember",type:"checkbox",name:"remember",checked:this.state.remember,onChange:this.handleToggleRemember,disabled:this.isProcessing}),n.createElement("label",{htmlFor:"remember"},n.createElement(I.x,null,"Remember this device for a month."))),n.createElement("div",{className:"form-actions"},n.createElement("button",{type:"submit",className:`button primary big full-width ${e}`,disabled:this.isProcessing},n.createElement(I.x,null,"Verify with Passkey"),this.isProcessing&&n.createElement(q,null)),n.createElement(B,null),n.createElement(z,null)))}}Q.propTypes={apiMfaVerifyContext:d().object};const ee=S((0,k.C)("common")(Q));var te,re;function ne(){return ne=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ne.apply(null,arguments)}const se=function(e){return n.createElement("svg",ne({shapeRendering:"geometricPrecision",textRendering:"geometricPrecision",viewBox:"0 0 128 128"},e),te||(te=n.createElement("circle",{id:"success-circle",r:62.5,fill:"none",strokeDasharray:392.7,strokeDashoffset:392.7,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:3,transform:"rotate(-90 64 0)"})),re||(re=n.createElement("path",{id:"success-check",fill:"none",strokeDasharray:65.24,strokeDashoffset:65.24,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:7,d:"M87.062 46.703 55.351 78.415 40.936 64"})))};var ae,ie,oe;function le(){return le=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},le.apply(null,arguments)}const ce=function(e){return n.createElement("svg",le({shapeRendering:"geometricPrecision",textRendering:"geometricPrecision",viewBox:"0 0 128 128"},e),ae||(ae=n.createElement("path",{id:"warning-dot",fill:"none",strokeDasharray:23.42,strokeDashoffset:23.42,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:7,d:"M64.038 46.76v23.413"})),ie||(ie=n.createElement("path",{id:"warning-bar",fill:"none",strokeDasharray:.09,strokeDashoffset:.09,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:7,d:"M64.038 93.585h.088"})),oe||(oe=n.createElement("path",{id:"warning-triangle",fill:"none",strokeDasharray:364.98,strokeDashoffset:364.98,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:3,d:"M53.954 16.685 4.412 99.459a11.66 11.66 0 0 0-1.167 8.872 11.66 11.66 0 0 0 5.464 7.087 10.97 10.97 0 0 0 5.7 1.578h99.17a11.67 11.67 0 0 0 8.253-3.508 11.68 11.68 0 0 0 3.323-8.329 11 11 0 0 0-1.579-5.7L74.033 16.685A11.66 11.66 0 0 0 57.9 12.739a12.1 12.1 0 0 0-3.946 3.946"})))};var de,he,ue;function pe(){return pe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},pe.apply(null,arguments)}const me=function(e){return n.createElement("svg",pe({shapeRendering:"geometricPrecision",textRendering:"geometricPrecision",viewBox:"0 0 128 128"},e),de||(de=n.createElement("circle",{id:"attention-circle",r:62.5,fill:"none",strokeDasharray:392.7,strokeDashoffset:392.7,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:3,transform:"rotate(-90 64 0)"})),he||(he=n.createElement("path",{id:"attention-dot",fill:"none",strokeDasharray:23.42,strokeDashoffset:23.42,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:7,d:"M63.956 40.588V64",transform:"rotate(180 63.956 52.294)"})),ue||(ue=n.createElement("path",{id:"attention-bar",fill:"none",strokeDasharray:.09,strokeDashoffset:.09,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:7,d:"M63.956 87.412h.088"})))};var fe,ge,ye;function Ee(){return Ee=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ee.apply(null,arguments)}const be=function(e){return n.createElement("svg",Ee({shapeRendering:"geometricPrecision",textRendering:"geometricPrecision",viewBox:"0 0 128 128"},e),fe||(fe=n.createElement("circle",{id:"error-circle",r:62.5,fill:"none",strokeDasharray:392.7,strokeDashoffset:392.7,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:3,transform:"rotate(-90 64 0)"})),ge||(ge=n.createElement("path",{id:"error-stroke-1",fill:"none",strokeDasharray:37.96,strokeDashoffset:37.96,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:7,d:"m50.58 50.58 26.84 26.84",transform:"rotate(180 64 64)"})),ye||(ye=n.createElement("path",{id:"error-stroke-2",fill:"none",strokeDasharray:37.96,strokeDashoffset:37.96,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:7,d:"M77.42 50.58 50.58 77.42"})))};var ve,we;function Te(){return Te=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Te.apply(null,arguments)}const Ce=function(e){return n.createElement("svg",Te({xmlns:"http://www.w3.org/2000/svg",width:128,height:129,fill:"none",viewBox:"0 0 128 129"},e),ve||(ve=n.createElement("circle",{cx:64,cy:64.844,r:62.5,stroke:"var(--Palette-Contrast-1)",strokeWidth:3})),we||(we=n.createElement("path",{stroke:"var(--Palette-Contrast-1)",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:7,d:"M69.932 57.034c6.386-6.402 12.773-9.594 19.16-9.594a17 17 0 0 1 12.02 29.018 17 17 0 0 1-12.02 4.979c-8.499 0-16.998-5.652-25.497-16.998-8.5-11.347-16.998-16.999-25.497-16.999a16.998 16.998 0 0 0 0 33.997c6.372 0 12.744-3.177 19.117-9.55"})))},Re={success:n.createElement(se,null),warning:n.createElement(ce,null),attention:n.createElement(me,null),error:n.createElement(be,null),infinity_illustration:n.createElement(Ce,null)};class ke extends n.Component{get animatedIconSVG(){return Re[this.props.name]}render(){return n.createElement("div",{className:"illustration icon-feedback"},n.createElement("div",{className:this.props.name},this.animatedIconSVG))}}ke.defaultProps={},ke.propTypes={name:d().string};const xe=ke;var Ae;function Se(){return Se=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Se.apply(null,arguments)}const Oe=function(e){return n.createElement("svg",Se({xmlns:"http://www.w3.org/2000/svg",width:10,height:8,fill:"none",viewBox:"0 0 10 8"},e),Ae||(Ae=n.createElement("path",{stroke:"var(--icon-color)",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"m1 2 4 4 4-4"})))};var Ue;function Pe(){return Pe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Pe.apply(null,arguments)}const Ve=function(e){return n.createElement("svg",Pe({xmlns:"http://www.w3.org/2000/svg",width:8,height:10,fill:"none",viewBox:"0 0 8 10"},e),Ue||(Ue=n.createElement("path",{stroke:"var(--icon-color)",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"m2 9 4-4-4-4"})))};class Ne extends n.Component{constructor(e){super(e),this.state={displayLogs:!1},this.bindCallbacks()}bindCallbacks(){this.handleDisplayLogsClick=this.handleDisplayLogsClick.bind(this),this.handleTryAgainClick=this.handleTryAgainClick.bind(this)}handleDisplayLogsClick(){this.setState({displayLogs:!this.state.displayLogs})}handleTryAgainClick(){this.props.apiMfaVerifyContext.onRetryRequested()}get logs(){const{name:e,message:t,data:r}=this.props.apiMfaVerifyContext.error||{};return JSON.stringify({name:e,message:t,data:r},null,4)}render(){const e=this.props.apiMfaVerifyContext.hideErrorLogs;return n.createElement("div",{className:"mfa-verify-error"},n.createElement(xe,{name:"attention"}),n.createElement("h1",null,n.createElement(I.x,null,"Something went wrong!")),n.createElement("p",null,e?n.createElement(I.x,null,"Please try again, or return to the application."):n.createElement(I.x,null,"Please try again later or check the logs for more information.")),n.createElement("div",{className:"form-actions"},n.createElement("button",{type:"button",className:"button primary big full-width",onClick:this.handleTryAgainClick},n.createElement(I.x,null,"Try again")),n.createElement(B,null),n.createElement(z,null)),!e&&n.createElement("div",{className:"accordion-header"},n.createElement("button",{type:"button",className:"link no-border",onClick:this.handleDisplayLogsClick},n.createElement(I.x,null,"Logs")," ",this.state.displayLogs?n.createElement(Oe,null):n.createElement(Ve,null))),this.state.displayLogs&&n.createElement("div",{className:"accordion-content"},n.createElement("textarea",{readOnly:!0,value:this.logs})))}}Ne.propTypes={apiMfaVerifyContext:d().object};const Me=S((0,k.C)("common")(Ne));class Le extends n.Component{render(){return n.createElement("div",{className:"mfa-verify-delegated-result mfa-verify-delegated-success"},n.createElement(xe,{name:"success"}),n.createElement("h1",null,n.createElement(I.x,null,"Passkey verified")),n.createElement("p",null,n.createElement(I.x,null,"You can now return to the application.")),n.createElement("div",{className:"form-actions"},n.createElement("a",{className:"button primary big full-width",href:this.props.apiMfaVerifyContext.getReturnToApplicationUrl()},n.createElement(I.x,null,"Return to app"))))}}Le.propTypes={apiMfaVerifyContext:d().object};const De=S((0,k.C)("common")(Le));class je extends n.Component{render(){return n.createElement("div",{className:"mfa-verify-delegated-result mfa-verify-delegated-expired"},n.createElement(xe,{name:"attention"}),n.createElement("h1",null,n.createElement(I.x,null,"This verification link is no longer valid.")),n.createElement("p",null,n.createElement(I.x,null,"It has already been used, or it expired. Start the verification again from the application.")),n.createElement("div",{className:"form-actions"},n.createElement("a",{className:"button primary big full-width",href:this.props.apiMfaVerifyContext.getReturnToApplicationUrl()},n.createElement(I.x,null,"Return to app"))))}}je.propTypes={apiMfaVerifyContext:d().object};const Ie=S((0,k.C)("common")(je));class _e extends n.Component{render(){return n.createElement("div",{className:"mfa-verify-delegated-result mfa-verify-delegated-unsupported"},n.createElement(xe,{name:"attention"}),n.createElement("h1",null,n.createElement(I.x,null,"This browser cannot verify with a passkey.")),n.createElement("p",null,n.createElement(I.x,null,"Update your browser or your operating system, then start the verification again from the application.")),n.createElement("div",{className:"form-actions"},n.createElement("a",{className:"button primary big full-width",href:this.props.apiMfaVerifyContext.getReturnToApplicationUrl()},n.createElement(I.x,null,"Return to app"))))}}_e.propTypes={apiMfaVerifyContext:d().object};const qe=S((0,k.C)("common")(_e));class $e extends n.Component{render(){switch(this.props.apiMfaVerifyContext.state){case P.VERIFY_STATE:case P.CEREMONY_STATE:return n.createElement(ee,null);case P.VERIFIED_STATE:return n.createElement(De,null);case P.EXPIRED_STATE:return n.createElement(Ie,null);case P.UNSUPPORTED_STATE:return n.createElement(qe,null);case P.ERROR_STATE:return n.createElement(Me,null);default:return n.createElement(F,null)}}}$e.propTypes={apiMfaVerifyContext:d().object};const Fe=S($e);var We=r(72635),Be=r(51831),He=r(32107);class ze extends n.Component{constructor(e){super(e),this.state=this.defaultState}get defaultState(){return{ready:!1}}async componentDidMount(){await(0,We.Yx)(Be.r).use(He.A).init({lng:this.locale,load:"currentOnly",interpolation:{escapeValue:!1},react:{useSuspense:!1},backend:{loadPath:(e,t)=>this.getTranslationPath(e,t)},supportedLngs:this.supportedLocales,fallbackLng:!1,ns:["common"],defaultNS:"common",keySeparator:!1,nsSeparator:!1,debug:!1}),this.setState({ready:!0})}getTranslationPath(e,t){const r=e[0],n=t[0],s="en-GB"===r?"en-UK":r;return(this.props.loadingPath||"/locales/{{lng}}/{{ns}}.json").replace("{{lng}}",s).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,We.v2)(this.locale)}get isReady(){return this.state.ready}render(){return n.createElement(n.Fragment,null,this.isReady&&this.props.children)}}ze.propTypes={context:d().any,loadingPath:d().any,children:d().any};const Ye=i(ze);var Ge,Je,Ke,Xe,Ze;function Qe(){return Qe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Qe.apply(null,arguments)}const et=function(e){return n.createElement("svg",Qe({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),Ge||(Ge=n.createElement("title",{id:"logo-title"},"Passbolt logo")),Je||(Je=n.createElement("desc",{id:"logo-description"},"This is the logo of passbolt.")),Ke||(Ke=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"})),Xe||(Xe=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"})),Ze||(Ze=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 tt extends n.Component{constructor(e){super(e),this.state=this.defaultState}get defaultState(){return{trustedDomain:this.baseUrl,getApiClientOptions:this.getApiClientOptions.bind(this),locale:this.appElement?.dataset.locale||"en-UK"}}get baseUrl(){const e=document.getElementsByTagName("base")?.[0];return e?e.attributes.href.value.replace(/\/*$/g,""):(console.error("Unable to retrieve the page base tag"),"")}get appElement(){return document.getElementById("api-mfa-verify-delegated")}get delegatedValue(){return{delegatedState:this.appElement?.dataset.state,redirectUri:this.appElement?.dataset.redirectUri}}getApiClientOptions(){return(new l).setBaseUrl(this.state.trustedDomain)}render(){return n.createElement(o.Provider,{value:this.state},n.createElement(Ye,{loadingPath:`${this.state.trustedDomain}/locales/{{lng}}/{{ns}}.json`},n.createElement(L,{value:this.delegatedValue},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(et,{role:"img",width:"20rem",height:"3.5rem"}))),n.createElement("div",{className:"login-form"},n.createElement(Fe,null)))))))}}const rt=tt,nt=document.createElement("div");document.body.appendChild(nt),(0,s.H)(nt).render(n.createElement(rt,null))}};const t={};function r(n){const s=t[n];if(void 0!==s)return s.exports;const a=t[n]={exports:{}};return e[n].call(a.exports,a,a.exports,r),a.exports}r.m=e,(()=>{const e=[];r.O=(t,n,s)=>{if(!n){for(var a=0;a<e.length;a++){let[n,s]=e[a],o=!0;for(var i=0;i<n.length;i++)r.O.j(n[i])?n.splice(i--,1):o=!1;if(o){e.splice(a--,1);const r=s();void 0!==r&&(t=r)}}return t}e.push([n,s])}})(),r.n=e=>{const t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.cw=e=>{var t;return()=>{if(e){var r=e;e=0,t={exports:{}},r.call(t.exports,t,t.exports)}return t.exports}},r.d=(e,t)=>{if(Array.isArray(t))for(var n=0;n<t.length;){var s=t[n++],a=t[n++],i=0===a?{enumerable:!0,value:t[n++]}:{enumerable:!0,get:a};r.o(e,s)||Object.defineProperty(e,s,i)}else for(var s in t)r.o(t,s)&&!r.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.j=1786,(()=>{const e={1786:0};r.O.j=t=>0===e[t];const t=(t,n)=>{let[s,a,i]=n;var o,l,c=0;if(s.some(t=>0!==e[t])){for(o in a)r.o(a,o)&&(r.m[o]=a[o]);if(i)var d=i(r)}for(t&&t(n);c<s.length;c++)l=s[c],r.o(e,l)&&e[l]&&e[l][0](),e[l]=0;return r.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=r.O(void 0,[3847],()=>r(11364));n=r.O(n)})();
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see api-mfa-verify.js.LICENSE.txt */
|
|
2
|
-
(()=>{"use strict";var e={45306(e,t,r){var n=r(96540),s=r(5338);const i=n.createContext({user:null,users:null,roles:null,rememberMeOptions:{},resources:null,resource:null,shareResources:null,selectedResources:null,selectedUser:null,folders:null,resourceCommentId:null,mustRefreshComments:!1,siteSettings:null,userSettings:null,onCheckIsAuthenticatedRequested:null});function a(e){return class extends n.Component{render(){return n.createElement(i.Consumer,null,t=>n.createElement(e,{context:t,...this.props}))}}}const o=i;class l{setBaseUrl(e){if(!e)throw new TypeError("ApiClientOption baseUrl is required.");if("string"==typeof e)try{this.baseUrl=new URL(e)}catch(e){throw new TypeError("ApiClientOption baseUrl is invalid.",{cause:e})}else{if(!(e instanceof URL))throw new TypeError("ApiClientOptions baseurl should be a string or URL");this.baseUrl=e}return this}setResourceName(e){if(!e)throw new TypeError("ApiClientOptions.setResourceName resourceName is required.");if("string"!=typeof e)throw new TypeError("ApiClientOptions.setResourceName resourceName should be a valid string.");return this.resourceName=e,this}getBaseUrl(){return this.baseUrl}getResourceName(){return this.resourceName}async getHeaders(){const e=await this.getCsrfToken();if(e)return{"X-CSRF-Token":e}}async getCsrfToken(){if("undefined"==typeof browser||void 0===browser.cookies){const e=document?.cookie?.split("; ")?.find(e=>e.startsWith("csrfToken"))?.split("=");return e&&2===e.length?e[1]:null}const e=this.baseUrl.toString(),t="/"===e.slice(-1)?e:`${e}/`,r=await browser.cookies.get({name:"csrfToken",url:t});return r?.value||null}}var c=r(5556),h=r.n(c);class d extends Error{constructor(e,t){super(e),this.name="PassboltApiFetchError",this.data=t||{}}}const u=d;class p extends Error{constructor(){super("An internal error occurred. The server response could not be parsed. Please contact your administrator."),this.name="PassboltBadResponseError"}}const m=p;class f extends Error{constructor(e){super(e=e||"The service is unavailable"),this.name="PassboltServiceUnavailableError"}}const g=f,y=["GET","POST","PUT","DELETE"];class b{constructor(e){if(this.options=e,!this.options.getBaseUrl())throw new TypeError("ApiClient constructor error: baseUrl is required.");if(!this.options.getResourceName())throw new TypeError("ApiClient constructor error: resourceName is required.");try{let e=this.options.getBaseUrl().toString();e.endsWith("/")&&(e=e.slice(0,-1));let t=this.options.getResourceName();t.startsWith("/")&&(t=t.slice(1)),t.endsWith("/")&&(t=t.slice(0,-1)),this.baseUrl=`${e}/${t}`,this.baseUrl=new URL(this.baseUrl)}catch(e){throw new TypeError("ApiClient constructor error: b.",{cause:e})}this.apiVersion="api-version=v2"}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 r=this.buildUrl(`${this.baseUrl}/${e}`,t||{});return this.fetchAndHandleResponse("GET",r)}async delete(e,t,r,n){let s;this.assertValidId(e),void 0===n&&(n=!1),s=n?this.buildUrl(`${this.baseUrl}/${e}/dry-run`,r||{}):this.buildUrl(`${this.baseUrl}/${e}`,r||{});let i=null;return t&&(i=this.buildBody(t)),this.fetchAndHandleResponse("DELETE",s,i)}async findAll(e){const t=this.buildUrl(this.baseUrl.toString(),e||{});return this.fetchAndHandleResponse("GET",t)}async create(e,t){const r=this.buildUrl(this.baseUrl.toString(),t||{}),n=this.buildBody(e);return this.fetchAndHandleResponse("POST",r,n)}async update(e,t,r,n){let s;this.assertValidId(e),void 0===n&&(n=!1),s=n?this.buildUrl(`${this.baseUrl}/${e}/dry-run`,r||{}):this.buildUrl(`${this.baseUrl}/${e}`,r||{});let i=null;return t&&(i=this.buildBody(t)),this.fetchAndHandleResponse("PUT",s,i)}async updateAll(e,t={}){const r=this.buildUrl(this.baseUrl.toString(),t),n=e?this.buildBody(e):null;return this.fetchAndHandleResponse("PUT",r,n)}assertValidId(e){if(!e)throw new TypeError("ApiClient.assertValidId error: id cannot be empty");if("string"!=typeof e)throw new TypeError("ApiClient.assertValidId error: id should be a string")}assertMethod(e){if("string"!=typeof e)throw new TypeError("ApiClient.assertValidMethod method should be a string.");if(y.indexOf(e.toUpperCase())<0)throw new TypeError(`ApiClient.assertValidMethod error: method ${e} is not supported.`)}assertUrl(e){if(!e)throw new TypeError("ApliClient.assertUrl error: url is required.");if(!(e instanceof URL))throw new TypeError("ApliClient.assertUrl error: url should be a valid URL object.");if("https:"!==e.protocol&&"http:"!==e.protocol)throw new TypeError("ApliClient.assertUrl error: url protocol should only be https or http.")}assertBody(e){if(!(e instanceof FormData)&&"string"!=typeof e)throw new TypeError("ApiClient.assertBody error: body should be a string or a FormData.")}buildBody(e){return JSON.stringify(e)}buildUrl(e,t){if("string"!=typeof e)throw new TypeError("ApiClient.buildUrl error: url should be a string.");const r=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)r.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=>{r.searchParams.append(e,t)})}}return r}async sendRequest(e,t,r,n){this.assertUrl(t),this.assertMethod(e),r&&this.assertBody(r);const s="undefined"!=typeof customApiClientFetch?customApiClientFetch:fetch,i={...await this.buildFetchOptions(),...n};i.method=e,r&&(i.body=r);try{return await s(t.toString(),i)}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,r,n){const s=await this.sendRequest(e,t,r,n);return this.parseResponseJson(s)}async parseResponseJson(e){let t;try{t=await e.json()}catch(t){throw console.debug(e.url.toString(),t),new m(t,e)}if(!e.ok){const r=t.header.message;throw new u(r,{header:t.header,code:e.status,body:t.body})}return t}}const E=class{constructor(e){this.apiClientOptions=e}async findSettings(){return this.initClient("verify/webauthn"),(await this.apiClient.findAll()).body}async begin(){return this.initClient("verify/webauthn/begin"),(await this.apiClient.create({})).body}async finish(e){return this.initClient("verify/webauthn/finish"),(await this.apiClient.create(e)).body}initClient(e){this.apiClientOptions.setResourceName(`mfa/${e}`),this.apiClient=new b(this.apiClientOptions)}};r(53050);var v=r(57761),w=r.n(v);class k extends Error{constructor(e){super(e=e||"Passkeys require Passbolt to be reached through a domain name, not an IP address."),this.name="WebauthnRelyingPartyIpAddressError"}}class C{static reload(){window.location.reload()}static assign(e){window.location.assign(e)}static getHostname(){return window.location.hostname}}class T{static async run(e,t){(e=>{if(w().isIP(e.replace(/^\[(.*)\]$/,"$1")))throw new k})(C.getHostname());const r=PublicKeyCredential.parseRequestOptionsFromJSON(e);return(await navigator.credentials.get({publicKey:r,signal:t})).toJSON()}}var R=r(13279);const x=n.createContext({state:null,providers:[],isRememberMeForAMonthEnabled:!1,redirect:"/",error:null,hideErrorLogs:!1,onInitializeRequested:()=>{},onVerifyRequested:()=>{},onRetryRequested:()=>{},getNextProviderUrl:()=>{}});class A extends n.Component{constructor(e){super(e),this.state={...this.defaultState,...e.value},this.mfaWebauthnVerifyService=new E(e.context.getApiClientOptions()),this.abortController=null}get defaultState(){return{state:S.INITIAL_STATE,providers:[],isRememberMeForAMonthEnabled:!1,redirect:"/",error:null,onInitializeRequested:this.onInitializeRequested.bind(this),onVerifyRequested:this.onVerifyRequested.bind(this),onRetryRequested:this.onRetryRequested.bind(this),getNextProviderUrl:this.getNextProviderUrl.bind(this)}}componentWillUnmount(){this.abortController?.abort()}async onInitializeRequested(){try{const{providers:e,isRememberMeForAMonthEnabled:t}=await this.mfaWebauthnVerifyService.findSettings();this.setState({state:S.VERIFY_STATE,providers:e,isRememberMeForAMonthEnabled:t})}catch(e){this.isUnauthorized(e)?this.navigateToLogin():400===e.data?.code?this.navigateToRedirect():this.handleError(e)}}async onVerifyRequested(e){let t;this.setState({state:S.CEREMONY_STATE});try{const{handle:r,credentialRequestOptions:n}=await this.mfaWebauthnVerifyService.begin();this.abortController=new AbortController;const s=this.abortController.signal;t={handle:r,credential:await T.run(n,s),remember:e}}catch(e){return void(this.isUnauthorized(e)?this.navigateToLogin():this.handleError(e))}this.setState({state:S.PROCESSING_STATE});try{await this.mfaWebauthnVerifyService.finish(t)}catch(e){return void await this.handleFinishError(e)}this.navigateToRedirect()}async handleFinishError(e){try{await this.mfaWebauthnVerifyService.findSettings()}catch(e){if(this.isUnauthorized(e))return void this.navigateToLogin()}this.handleError(e)}async onRetryRequested(){this.setState({error:null,state:S.INITIAL_STATE}),await this.onInitializeRequested()}getNextProviderUrl(){const e=this.state.providers;if(e.length<2)return null;const t=e.indexOf("webauthn"),r=e[(t+1)%e.length];return`${this.props.context.trustedDomain}/mfa/verify/${r}?redirect=${encodeURIComponent(this.state.redirect)}`}handleError(e){let t;switch(console.dir(e),e.name){case"SecurityError":t=new Error(this.props.t("The operation requires a secure connection. Passkeys were blocked due to an untrusted TLS certificate or an invalid Relying Party ID.")),t.cause=e;break;case"ConstraintError":t=new Error(this.props.t("A passkey prompt is already opened in another window. Please complete or cancel it to continue.")),t.cause=e;break;case"WebauthnRelyingPartyIpAddressError":t=new Error(this.props.t("Passkeys require Passbolt to be reached through a domain name, not an IP address.")),t.cause=e;break;default:t=e}this.setState({state:S.ERROR_STATE,error:t})}isUnauthorized(e){return 401===e.data?.code}navigateToRedirect(){const e=this.props.context.trustedDomain,t=/^\/[A-Z/-9\-]*$/i.test(this.state.redirect);C.assign(t?`${e}${this.state.redirect}`:`${e}/`)}navigateToLogin(){C.assign(`${this.props.context.trustedDomain}/auth/login`)}render(){return n.createElement(x.Provider,{value:this.state},this.props.children)}}A.propTypes={context:h().any,value:h().any,children:h().any};const O=a((0,R.C)("common")(A));function P(e){return class extends n.Component{render(){return n.createElement(x.Consumer,null,t=>n.createElement(e,{apiMfaVerifyContext:t,...this.props}))}}}const S={INITIAL_STATE:"Initial state",VERIFY_STATE:"Verify state",CEREMONY_STATE:"Ceremony state",PROCESSING_STATE:"Processing state",ERROR_STATE:"Error state"};var U,L,M=r(91352);function j(){return j=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},j.apply(null,arguments)}const V=function(e){return n.createElement("svg",j({width:18,height:18,fill:"none",className:"svg-icon spinner",viewBox:"0 0 18 18"},e),U||(U=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)"})),L||(L=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 N 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(V,null)))}}N.propTypes={title:h().oneOfType([h().arrayOf(h().node),h().node,h().string])},N.defaultProps={title:n.createElement(M.x,null,"Please wait...")};const D=(0,R.C)("common")(N);class I extends n.Component{render(){const e=this.props.apiMfaVerifyContext.getNextProviderUrl();return e&&this.props.apiMfaVerifyContext.state!==S.CEREMONY_STATE?n.createElement("a",{href:e},n.createElement(M.x,null,"Or try with another provider")):null}}I.propTypes={apiMfaVerifyContext:h().object};const q=P((0,R.C)("common")(I));class $ extends n.Component{render(){const e=this.props.apiMfaVerifyContext.getReturnToApplicationUrl?.();return e&&this.props.apiMfaVerifyContext.state!==S.CEREMONY_STATE?n.createElement("a",{href:e,className:"return-to-application"},n.createElement(M.x,null,"Return to app")):null}}$.propTypes={apiMfaVerifyContext:h().object};const B=P((0,R.C)("common")($));var W,_,F,H;function z(){return z=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},z.apply(null,arguments)}const Y=function(e){return n.createElement("svg",z({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 42 42"},e),W||(W=n.createElement("path",{fill:"#EBAC21",d:"M27.883.545H14.081C6.765.545.833 6.565.833 13.989v14.006c0 7.424 5.932 13.444 13.248 13.444h13.802c7.316 0 13.248-6.02 13.248-13.444V13.989c0-7.426-5.932-13.444-13.248-13.444"})),_||(_=n.createElement("path",{fill:"#353535",fillRule:"evenodd",d:"M34.956 19.269c0 2.63-1.619 4.866-3.871 5.682l1.364 2.258-2.016 2.48 2.016 2.423-3.253 4.365-2.293-2.446v-9.246c-2.037-.926-3.465-3.047-3.465-5.516 0-3.32 2.58-6.012 5.758-6.012 3.18.003 5.76 2.692 5.76 6.012m-5.76.923c.767 0 1.39-.649 1.39-1.452s-.623-1.452-1.39-1.452c-.768 0-1.391.65-1.391 1.452 0 .803.623 1.452 1.391 1.452",clipRule:"evenodd"})),F||(F=n.createElement("path",{fillRule:"evenodd",d:"M34.972 19.287c0 2.598-1.575 4.813-3.782 5.661l1.257 2.26-1.858 2.48 1.858 2.424-3.251 4.399V20.189c.768 0 1.391-.65 1.391-1.452 0-.803-.623-1.452-1.391-1.452v-4.026c3.192 0 5.776 2.697 5.776 6.028M25.018 25.88c-1.86-1.527-3.108-3.873-3.28-6.538H11.77c-2.091 0-3.785 1.72-3.785 3.841v4.801c0 1.061.848 1.922 1.892 1.922h13.249c1.044 0 1.892-.859 1.892-1.922z",clipRule:"evenodd"})),H||(H=n.createElement("path",{fill:"#141313",d:"M16.034 18.19c-.462-.089-.921-.172-1.356-.355-1.65-.692-2.611-1.97-2.922-3.773-.215-1.235-.113-2.456.386-3.61.709-1.64 1.984-2.532 3.653-2.832.998-.18 1.994-.14 2.958.22 1.449.539 2.418 1.575 2.869 3.1.454 1.535.387 3.073-.298 4.525-.708 1.519-1.948 2.333-3.516 2.652q-.195.041-.392.078-.689-.006-1.382-.005"})))};class G extends n.Component{constructor(e){super(e),this.state={remember:!1},this.bindCallbacks()}bindCallbacks(){this.handleToggleRemember=this.handleToggleRemember.bind(this),this.handleSubmit=this.handleSubmit.bind(this)}get isProcessing(){return this.props.apiMfaVerifyContext.state===S.CEREMONY_STATE}handleToggleRemember(){this.setState({remember:!this.state.remember})}handleSubmit(e){e.preventDefault(),this.props.apiMfaVerifyContext.onVerifyRequested(this.state.remember)}render(){const e=this.isProcessing?"processing":"";return n.createElement("form",{onSubmit:this.handleSubmit},n.createElement(Y,{className:"centered-login-provider-icon"}),n.createElement("h1",{className:"centered-text login-title"},n.createElement(M.x,null,"Additional Authentication with Passkey")),this.props.apiMfaVerifyContext.isRememberMeForAMonthEnabled&&n.createElement("div",{className:"input checkbox"},n.createElement("input",{id:"remember",type:"checkbox",name:"remember",checked:this.state.remember,onChange:this.handleToggleRemember,disabled:this.isProcessing}),n.createElement("label",{htmlFor:"remember"},n.createElement(M.x,null,"Remember this device for a month."))),n.createElement("div",{className:"form-actions"},n.createElement("button",{type:"submit",className:`button primary big full-width ${e}`,disabled:this.isProcessing},n.createElement(M.x,null,"Verify with Passkey"),this.isProcessing&&n.createElement(V,null)),n.createElement(q,null),n.createElement(B,null)))}}G.propTypes={apiMfaVerifyContext:h().object};const J=P((0,R.C)("common")(G));var K,X;function Z(){return Z=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Z.apply(null,arguments)}const Q=function(e){return n.createElement("svg",Z({shapeRendering:"geometricPrecision",textRendering:"geometricPrecision",viewBox:"0 0 128 128"},e),K||(K=n.createElement("circle",{id:"success-circle",r:62.5,fill:"none",strokeDasharray:392.7,strokeDashoffset:392.7,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:3,transform:"rotate(-90 64 0)"})),X||(X=n.createElement("path",{id:"success-check",fill:"none",strokeDasharray:65.24,strokeDashoffset:65.24,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:7,d:"M87.062 46.703 55.351 78.415 40.936 64"})))};var ee,te,re;function ne(){return ne=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ne.apply(null,arguments)}const se=function(e){return n.createElement("svg",ne({shapeRendering:"geometricPrecision",textRendering:"geometricPrecision",viewBox:"0 0 128 128"},e),ee||(ee=n.createElement("path",{id:"warning-dot",fill:"none",strokeDasharray:23.42,strokeDashoffset:23.42,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:7,d:"M64.038 46.76v23.413"})),te||(te=n.createElement("path",{id:"warning-bar",fill:"none",strokeDasharray:.09,strokeDashoffset:.09,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:7,d:"M64.038 93.585h.088"})),re||(re=n.createElement("path",{id:"warning-triangle",fill:"none",strokeDasharray:364.98,strokeDashoffset:364.98,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:3,d:"M53.954 16.685 4.412 99.459a11.66 11.66 0 0 0-1.167 8.872 11.66 11.66 0 0 0 5.464 7.087 10.97 10.97 0 0 0 5.7 1.578h99.17a11.67 11.67 0 0 0 8.253-3.508 11.68 11.68 0 0 0 3.323-8.329 11 11 0 0 0-1.579-5.7L74.033 16.685A11.66 11.66 0 0 0 57.9 12.739a12.1 12.1 0 0 0-3.946 3.946"})))};var ie,ae,oe;function le(){return le=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},le.apply(null,arguments)}const ce=function(e){return n.createElement("svg",le({shapeRendering:"geometricPrecision",textRendering:"geometricPrecision",viewBox:"0 0 128 128"},e),ie||(ie=n.createElement("circle",{id:"attention-circle",r:62.5,fill:"none",strokeDasharray:392.7,strokeDashoffset:392.7,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:3,transform:"rotate(-90 64 0)"})),ae||(ae=n.createElement("path",{id:"attention-dot",fill:"none",strokeDasharray:23.42,strokeDashoffset:23.42,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:7,d:"M63.956 40.588V64",transform:"rotate(180 63.956 52.294)"})),oe||(oe=n.createElement("path",{id:"attention-bar",fill:"none",strokeDasharray:.09,strokeDashoffset:.09,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:7,d:"M63.956 87.412h.088"})))};var he,de,ue;function pe(){return pe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},pe.apply(null,arguments)}const me=function(e){return n.createElement("svg",pe({shapeRendering:"geometricPrecision",textRendering:"geometricPrecision",viewBox:"0 0 128 128"},e),he||(he=n.createElement("circle",{id:"error-circle",r:62.5,fill:"none",strokeDasharray:392.7,strokeDashoffset:392.7,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:3,transform:"rotate(-90 64 0)"})),de||(de=n.createElement("path",{id:"error-stroke-1",fill:"none",strokeDasharray:37.96,strokeDashoffset:37.96,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:7,d:"m50.58 50.58 26.84 26.84",transform:"rotate(180 64 64)"})),ue||(ue=n.createElement("path",{id:"error-stroke-2",fill:"none",strokeDasharray:37.96,strokeDashoffset:37.96,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:7,d:"M77.42 50.58 50.58 77.42"})))};var fe,ge;function ye(){return ye=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ye.apply(null,arguments)}const be=function(e){return n.createElement("svg",ye({xmlns:"http://www.w3.org/2000/svg",width:128,height:129,fill:"none",viewBox:"0 0 128 129"},e),fe||(fe=n.createElement("circle",{cx:64,cy:64.844,r:62.5,stroke:"var(--Palette-Contrast-1)",strokeWidth:3})),ge||(ge=n.createElement("path",{stroke:"var(--Palette-Contrast-1)",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:7,d:"M69.932 57.034c6.386-6.402 12.773-9.594 19.16-9.594a17 17 0 0 1 12.02 29.018 17 17 0 0 1-12.02 4.979c-8.499 0-16.998-5.652-25.497-16.998-8.5-11.347-16.998-16.999-25.497-16.999a16.998 16.998 0 0 0 0 33.997c6.372 0 12.744-3.177 19.117-9.55"})))},Ee={success:n.createElement(Q,null),warning:n.createElement(se,null),attention:n.createElement(ce,null),error:n.createElement(me,null),infinity_illustration:n.createElement(be,null)};class ve extends n.Component{get animatedIconSVG(){return Ee[this.props.name]}render(){return n.createElement("div",{className:"illustration icon-feedback"},n.createElement("div",{className:this.props.name},this.animatedIconSVG))}}ve.defaultProps={},ve.propTypes={name:h().string};const we=ve;var ke;function Ce(){return Ce=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ce.apply(null,arguments)}const Te=function(e){return n.createElement("svg",Ce({xmlns:"http://www.w3.org/2000/svg",width:10,height:8,fill:"none",viewBox:"0 0 10 8"},e),ke||(ke=n.createElement("path",{stroke:"var(--icon-color)",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"m1 2 4 4 4-4"})))};var Re;function xe(){return xe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},xe.apply(null,arguments)}const Ae=function(e){return n.createElement("svg",xe({xmlns:"http://www.w3.org/2000/svg",width:8,height:10,fill:"none",viewBox:"0 0 8 10"},e),Re||(Re=n.createElement("path",{stroke:"var(--icon-color)",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"m2 9 4-4-4-4"})))};class Oe extends n.Component{constructor(e){super(e),this.state={displayLogs:!1},this.bindCallbacks()}bindCallbacks(){this.handleDisplayLogsClick=this.handleDisplayLogsClick.bind(this),this.handleTryAgainClick=this.handleTryAgainClick.bind(this)}handleDisplayLogsClick(){this.setState({displayLogs:!this.state.displayLogs})}handleTryAgainClick(){this.props.apiMfaVerifyContext.onRetryRequested()}get logs(){const{name:e,message:t,data:r}=this.props.apiMfaVerifyContext.error||{};return JSON.stringify({name:e,message:t,data:r},null,4)}render(){const e=this.props.apiMfaVerifyContext.hideErrorLogs;return n.createElement("div",{className:"mfa-verify-error"},n.createElement(we,{name:"attention"}),n.createElement("h1",null,n.createElement(M.x,null,"Something went wrong!")),n.createElement("p",null,e?n.createElement(M.x,null,"Please try again, or return to the application."):n.createElement(M.x,null,"Please try again later or check the logs for more information.")),n.createElement("div",{className:"form-actions"},n.createElement("button",{type:"button",className:"button primary big full-width",onClick:this.handleTryAgainClick},n.createElement(M.x,null,"Try again")),n.createElement(q,null),n.createElement(B,null)),!e&&n.createElement("div",{className:"accordion-header"},n.createElement("button",{type:"button",className:"link no-border",onClick:this.handleDisplayLogsClick},n.createElement(M.x,null,"Logs")," ",this.state.displayLogs?n.createElement(Te,null):n.createElement(Ae,null))),this.state.displayLogs&&n.createElement("div",{className:"accordion-content"},n.createElement("textarea",{readOnly:!0,value:this.logs})))}}Oe.propTypes={apiMfaVerifyContext:h().object};const Pe=P((0,R.C)("common")(Oe));class Se extends n.Component{componentDidMount(){this.props.apiMfaVerifyContext.onInitializeRequested()}render(){switch(this.props.apiMfaVerifyContext.state){case S.VERIFY_STATE:case S.CEREMONY_STATE:return n.createElement(J,null);case S.ERROR_STATE:return n.createElement(Pe,null);default:return n.createElement(D,null)}}}Se.propTypes={apiMfaVerifyContext:h().object};const Ue=P(Se);var Le=r(72635),Me=r(51831),je=r(32107);class Ve extends n.Component{constructor(e){super(e),this.state=this.defaultState}get defaultState(){return{ready:!1}}async componentDidMount(){await(0,Le.Yx)(Me.r).use(je.A).init({lng:this.locale,load:"currentOnly",interpolation:{escapeValue:!1},react:{useSuspense:!1},backend:{loadPath:(e,t)=>this.getTranslationPath(e,t)},supportedLngs:this.supportedLocales,fallbackLng:!1,ns:["common"],defaultNS:"common",keySeparator:!1,nsSeparator:!1,debug:!1}),this.setState({ready:!0})}getTranslationPath(e,t){const r=e[0],n=t[0],s="en-GB"===r?"en-UK":r;return(this.props.loadingPath||"/locales/{{lng}}/{{ns}}.json").replace("{{lng}}",s).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,Le.v2)(this.locale)}get isReady(){return this.state.ready}render(){return n.createElement(n.Fragment,null,this.isReady&&this.props.children)}}Ve.propTypes={context:h().any,loadingPath:h().any,children:h().any};const Ne=a(Ve);var De,Ie,qe,$e,Be;function We(){return We=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},We.apply(null,arguments)}const _e=function(e){return n.createElement("svg",We({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),De||(De=n.createElement("title",{id:"logo-title"},"Passbolt logo")),Ie||(Ie=n.createElement("desc",{id:"logo-description"},"This is the logo of passbolt.")),qe||(qe=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"})),$e||($e=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"})),Be||(Be=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 Fe extends n.Component{constructor(e){super(e),this.state=this.defaultState}get defaultState(){return{trustedDomain:this.baseUrl,getApiClientOptions:this.getApiClientOptions.bind(this),locale:this.appElement?.dataset.locale||"en-UK"}}get baseUrl(){const e=document.getElementsByTagName("base")?.[0];return e?e.attributes.href.value.replace(/\/*$/g,""):(console.error("Unable to retrieve the page base tag"),"")}get appElement(){return document.getElementById("api-mfa-verify")}get redirect(){return this.appElement?.dataset.redirect||"/"}getApiClientOptions(){return(new l).setBaseUrl(this.state.trustedDomain)}render(){return n.createElement(o.Provider,{value:this.state},n.createElement(Ne,{loadingPath:`${this.state.trustedDomain}/locales/{{lng}}/{{ns}}.json`},n.createElement(O,{value:{redirect:this.redirect}},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(_e,{role:"img",width:"20rem",height:"3.5rem"}))),n.createElement("div",{className:"login-form"},n.createElement(Ue,null)))))))}}const He=Fe,ze=document.createElement("div");document.body.appendChild(ze),(0,s.H)(ze).render(n.createElement(He,null))}};const t={};function r(n){const s=t[n];if(void 0!==s)return s.exports;const i=t[n]={exports:{}};return e[n].call(i.exports,i,i.exports,r),i.exports}r.m=e,(()=>{const e=[];r.O=(t,n,s)=>{if(!n){for(var i=0;i<e.length;i++){let[n,s]=e[i],o=!0;for(var a=0;a<n.length;a++)r.O.j(n[a])?n.splice(a--,1):o=!1;if(o){e.splice(i--,1);const r=s();void 0!==r&&(t=r)}}return t}e.push([n,s])}})(),r.n=e=>{const t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.cw=e=>{var t;return()=>{if(e){var r=e;e=0,t={exports:{}},r.call(t.exports,t,t.exports)}return t.exports}},r.d=(e,t)=>{if(Array.isArray(t))for(var n=0;n<t.length;){var s=t[n++],i=t[n++],a=0===i?{enumerable:!0,value:t[n++]}:{enumerable:!0,get:i};r.o(e,s)||Object.defineProperty(e,s,a)}else for(var s in t)r.o(t,s)&&!r.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.j=4546,(()=>{const e={4546:0};r.O.j=t=>0===e[t];const t=(t,n)=>{let[s,i,a]=n;var o,l,c=0;if(s.some(t=>0!==e[t])){for(o in i)r.o(i,o)&&(r.m[o]=i[o]);if(a)var h=a(r)}for(t&&t(n);c<s.length;c++)l=s[c],r.o(e,l)&&e[l]&&e[l][0](),e[l]=0;return r.O(h)},n=self.webpackChunkpassbolt_styleguide=self.webpackChunkpassbolt_styleguide||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})();let n=r.O(void 0,[3847],()=>r(45306));n=r.O(n)})();
|
|
2
|
+
(()=>{"use strict";var e={45306(e,t,r){var n=r(96540),s=r(5338);const i=n.createContext({user:null,users:null,roles:null,rememberMeOptions:{},resources:null,resource:null,shareResources:null,selectedResources:null,selectedUser:null,folders:null,resourceCommentId:null,mustRefreshComments:!1,siteSettings:null,userSettings:null,onCheckIsAuthenticatedRequested:null});function a(e){return class extends n.Component{render(){return n.createElement(i.Consumer,null,t=>n.createElement(e,{context:t,...this.props}))}}}const o=i;class l{setBaseUrl(e){if(!e)throw new TypeError("ApiClientOption baseUrl is required.");if("string"==typeof e)try{this.baseUrl=new URL(e)}catch(e){throw new TypeError("ApiClientOption baseUrl is invalid.",{cause:e})}else{if(!(e instanceof URL))throw new TypeError("ApiClientOptions baseurl should be a string or URL");this.baseUrl=e}return this}setResourceName(e){if(!e)throw new TypeError("ApiClientOptions.setResourceName resourceName is required.");if("string"!=typeof e)throw new TypeError("ApiClientOptions.setResourceName resourceName should be a valid string.");return this.resourceName=e,this}getBaseUrl(){return this.baseUrl}getResourceName(){return this.resourceName}async getHeaders(){const e=await this.getCsrfToken();if(e)return{"X-CSRF-Token":e}}async getCsrfToken(){if("undefined"==typeof browser||void 0===browser.cookies){const e=document?.cookie?.split("; ")?.find(e=>e.startsWith("csrfToken"))?.split("=");return e&&2===e.length?e[1]:null}const e=this.baseUrl.toString(),t="/"===e.slice(-1)?e:`${e}/`,r=await browser.cookies.get({name:"csrfToken",url:t});return r?.value||null}}var c=r(5556),h=r.n(c);class d extends Error{constructor(e,t){super(e),this.name="PassboltApiFetchError",this.data=t||{}}}const u=d;class p extends Error{constructor(){super("An internal error occurred. The server response could not be parsed. Please contact your administrator."),this.name="PassboltBadResponseError"}}const m=p;class f extends Error{constructor(e){super(e=e||"The service is unavailable"),this.name="PassboltServiceUnavailableError"}}const g=f,y=["GET","POST","PUT","DELETE"];class b{constructor(e){if(this.options=e,!this.options.getBaseUrl())throw new TypeError("ApiClient constructor error: baseUrl is required.");if(!this.options.getResourceName())throw new TypeError("ApiClient constructor error: resourceName is required.");try{let e=this.options.getBaseUrl().toString();e.endsWith("/")&&(e=e.slice(0,-1));let t=this.options.getResourceName();t.startsWith("/")&&(t=t.slice(1)),t.endsWith("/")&&(t=t.slice(0,-1)),this.baseUrl=`${e}/${t}`,this.baseUrl=new URL(this.baseUrl)}catch(e){throw new TypeError("ApiClient constructor error: b.",{cause:e})}this.apiVersion="api-version=v2"}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 r=this.buildUrl(`${this.baseUrl}/${e}`,t||{});return this.fetchAndHandleResponse("GET",r)}async delete(e,t,r,n){let s;this.assertValidId(e),void 0===n&&(n=!1),s=n?this.buildUrl(`${this.baseUrl}/${e}/dry-run`,r||{}):this.buildUrl(`${this.baseUrl}/${e}`,r||{});let i=null;return t&&(i=this.buildBody(t)),this.fetchAndHandleResponse("DELETE",s,i)}async findAll(e){const t=this.buildUrl(this.baseUrl.toString(),e||{});return this.fetchAndHandleResponse("GET",t)}async create(e,t){const r=this.buildUrl(this.baseUrl.toString(),t||{}),n=this.buildBody(e);return this.fetchAndHandleResponse("POST",r,n)}async update(e,t,r,n){let s;this.assertValidId(e),void 0===n&&(n=!1),s=n?this.buildUrl(`${this.baseUrl}/${e}/dry-run`,r||{}):this.buildUrl(`${this.baseUrl}/${e}`,r||{});let i=null;return t&&(i=this.buildBody(t)),this.fetchAndHandleResponse("PUT",s,i)}async updateAll(e,t={}){const r=this.buildUrl(this.baseUrl.toString(),t),n=e?this.buildBody(e):null;return this.fetchAndHandleResponse("PUT",r,n)}assertValidId(e){if(!e)throw new TypeError("ApiClient.assertValidId error: id cannot be empty");if("string"!=typeof e)throw new TypeError("ApiClient.assertValidId error: id should be a string")}assertMethod(e){if("string"!=typeof e)throw new TypeError("ApiClient.assertValidMethod method should be a string.");if(y.indexOf(e.toUpperCase())<0)throw new TypeError(`ApiClient.assertValidMethod error: method ${e} is not supported.`)}assertUrl(e){if(!e)throw new TypeError("ApliClient.assertUrl error: url is required.");if(!(e instanceof URL))throw new TypeError("ApliClient.assertUrl error: url should be a valid URL object.");if("https:"!==e.protocol&&"http:"!==e.protocol)throw new TypeError("ApliClient.assertUrl error: url protocol should only be https or http.")}assertBody(e){if(!(e instanceof FormData)&&"string"!=typeof e)throw new TypeError("ApiClient.assertBody error: body should be a string or a FormData.")}buildBody(e){return JSON.stringify(e)}buildUrl(e,t){if("string"!=typeof e)throw new TypeError("ApiClient.buildUrl error: url should be a string.");const r=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)r.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=>{r.searchParams.append(e,t)})}}return r}async sendRequest(e,t,r,n){this.assertUrl(t),this.assertMethod(e),r&&this.assertBody(r);const s="undefined"!=typeof customApiClientFetch?customApiClientFetch:fetch,i={...await this.buildFetchOptions(),...n};i.method=e,r&&(i.body=r);try{return await s(t.toString(),i)}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,r,n){const s=await this.sendRequest(e,t,r,n);return this.parseResponseJson(s)}async parseResponseJson(e){let t;try{t=await e.json()}catch(t){throw console.debug(e.url.toString(),t),new m(t,e)}if(!e.ok){const r=t.header.message;throw new u(r,{header:t.header,code:e.status,body:t.body})}return t}}const v=class{constructor(e){this.apiClientOptions=e}async findSettings(){return this.initClient("verify/webauthn"),(await this.apiClient.findAll()).body}async begin(){return this.initClient("verify/webauthn/begin"),(await this.apiClient.create({})).body}async finish(e){return this.initClient("verify/webauthn/finish"),(await this.apiClient.create(e)).body}initClient(e){this.apiClientOptions.setResourceName(`mfa/${e}`),this.apiClient=new b(this.apiClientOptions)}};r(53050);var E=r(57761),w=r.n(E);class k extends Error{constructor(e){super(e=e||"Passkeys require Passbolt to be reached through a domain name, not an IP address."),this.name="WebauthnRelyingPartyIpAddressError"}}class C{static reload(){window.location.reload()}static assign(e){window.location.assign(e)}static getHostname(){return window.location.hostname}}class T{static async run(e,t){(e=>{if(w().isIP(e.replace(/^\[(.*)\]$/,"$1")))throw new k})(C.getHostname());const r=PublicKeyCredential.parseRequestOptionsFromJSON(e);return(await navigator.credentials.get({publicKey:r,signal:t})).toJSON()}}var R=r(13279);const x=n.createContext({state:null,providers:[],isRememberMeForAMonthEnabled:!1,redirect:"/",error:null,hideErrorLogs:!1,onInitializeRequested:()=>{},onVerifyRequested:()=>{},onRetryRequested:()=>{},getNextProviderUrl:()=>{}});class A extends n.Component{constructor(e){super(e),this.state={...this.defaultState,...e.value},this.mfaWebauthnVerifyService=new v(e.context.getApiClientOptions()),this.abortController=null}get defaultState(){return{state:S.INITIAL_STATE,providers:[],isRememberMeForAMonthEnabled:!1,redirect:"/",error:null,onInitializeRequested:this.onInitializeRequested.bind(this),onVerifyRequested:this.onVerifyRequested.bind(this),onRetryRequested:this.onRetryRequested.bind(this),getNextProviderUrl:this.getNextProviderUrl.bind(this)}}componentWillUnmount(){this.abortController?.abort()}async onInitializeRequested(){try{const{providers:e,isRememberMeForAMonthEnabled:t}=await this.mfaWebauthnVerifyService.findSettings();this.setState({state:S.VERIFY_STATE,providers:e,isRememberMeForAMonthEnabled:t})}catch(e){this.isUnauthorized(e)?this.navigateToLogin():400===e.data?.code?this.navigateToRedirect():this.handleError(e)}}async onVerifyRequested(e){let t;this.setState({state:S.CEREMONY_STATE});try{const{handle:r,credentialRequestOptions:n}=await this.mfaWebauthnVerifyService.begin();this.abortController=new AbortController;const s=this.abortController.signal;t={handle:r,credential:await T.run(n,s),remember:e}}catch(e){return void(this.isUnauthorized(e)?this.navigateToLogin():this.handleError(e))}this.setState({state:S.PROCESSING_STATE});try{await this.mfaWebauthnVerifyService.finish(t)}catch(e){return void await this.handleFinishError(e)}this.navigateToRedirect()}async handleFinishError(e){try{await this.mfaWebauthnVerifyService.findSettings()}catch(e){if(this.isUnauthorized(e))return void this.navigateToLogin()}this.handleError(e)}async onRetryRequested(){this.setState({error:null,state:S.INITIAL_STATE}),await this.onInitializeRequested()}getNextProviderUrl(){const e=this.state.providers;if(e.length<2)return null;const t=e.indexOf("webauthn"),r=e[(t+1)%e.length];return`${this.props.context.trustedDomain}/mfa/verify/${r}?redirect=${encodeURIComponent(this.state.redirect)}`}handleError(e){let t;switch(console.dir(e),e.name){case"SecurityError":t=new Error(this.props.t("The operation requires a secure connection. Passkeys were blocked due to an untrusted TLS certificate or an invalid Relying Party ID.")),t.cause=e;break;case"ConstraintError":t=new Error(this.props.t("A passkey prompt is already opened in another window. Please complete or cancel it to continue.")),t.cause=e;break;case"WebauthnRelyingPartyIpAddressError":t=new Error(this.props.t("Passkeys require Passbolt to be reached through a domain name, not an IP address.")),t.cause=e;break;default:t=e}this.setState({state:S.ERROR_STATE,error:t})}isUnauthorized(e){return 401===e.data?.code}navigateToRedirect(){const e=this.props.context.trustedDomain,t=/^\/[A-Z/-9\-]*$/i.test(this.state.redirect);C.assign(t?`${e}${this.state.redirect}`:`${e}/`)}navigateToLogin(){C.assign(`${this.props.context.trustedDomain}/auth/login`)}render(){return n.createElement(x.Provider,{value:this.state},this.props.children)}}A.propTypes={context:h().any,value:h().any,children:h().any};const O=a((0,R.C)("common")(A));function P(e){return class extends n.Component{render(){return n.createElement(x.Consumer,null,t=>n.createElement(e,{apiMfaVerifyContext:t,...this.props}))}}}const S={INITIAL_STATE:"Initial state",VERIFY_STATE:"Verify state",CEREMONY_STATE:"Ceremony state",PROCESSING_STATE:"Processing state",ERROR_STATE:"Error state"};var U,L,M=r(91352);function j(){return j=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},j.apply(null,arguments)}const V=function(e){return n.createElement("svg",j({width:18,height:18,fill:"none",className:"svg-icon spinner",viewBox:"0 0 18 18"},e),U||(U=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)"})),L||(L=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 N 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(V,null)))}}N.propTypes={title:h().oneOfType([h().arrayOf(h().node),h().node,h().string])},N.defaultProps={title:n.createElement(M.x,null,"Please wait...")};const D=(0,R.C)("common")(N);class I extends n.Component{render(){const e=this.props.apiMfaVerifyContext.getNextProviderUrl();return e&&this.props.apiMfaVerifyContext.state!==S.CEREMONY_STATE?n.createElement("a",{href:e},n.createElement(M.x,null,"Or try with another provider")):null}}I.propTypes={apiMfaVerifyContext:h().object};const q=P((0,R.C)("common")(I));class $ extends n.Component{render(){const e=this.props.apiMfaVerifyContext.getReturnToApplicationUrl?.();return e&&this.props.apiMfaVerifyContext.state!==S.CEREMONY_STATE?n.createElement("a",{href:e,className:"return-to-application"},n.createElement(M.x,null,"Return to app")):null}}$.propTypes={apiMfaVerifyContext:h().object};const B=P((0,R.C)("common")($));var W,_,F,H;function z(){return z=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},z.apply(null,arguments)}const Y=function(e){return n.createElement("svg",z({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 42 42"},e),W||(W=n.createElement("path",{fill:"#EBAC21",d:"M27.883.545H14.081C6.765.545.833 6.565.833 13.989v14.006c0 7.424 5.932 13.444 13.248 13.444h13.802c7.316 0 13.248-6.02 13.248-13.444V13.989c0-7.426-5.932-13.444-13.248-13.444"})),_||(_=n.createElement("path",{fill:"#353535",fillRule:"evenodd",d:"M34.956 19.269c0 2.63-1.619 4.866-3.871 5.682l1.364 2.258-2.016 2.48 2.016 2.423-3.253 4.365-2.293-2.446v-9.246c-2.037-.926-3.465-3.047-3.465-5.516 0-3.32 2.58-6.012 5.758-6.012 3.18.003 5.76 2.692 5.76 6.012m-5.76.923c.767 0 1.39-.649 1.39-1.452s-.623-1.452-1.39-1.452c-.768 0-1.391.65-1.391 1.452 0 .803.623 1.452 1.391 1.452",clipRule:"evenodd"})),F||(F=n.createElement("path",{fillRule:"evenodd",d:"M34.972 19.287c0 2.598-1.575 4.813-3.782 5.661l1.257 2.26-1.858 2.48 1.858 2.424-3.251 4.399V20.189c.768 0 1.391-.65 1.391-1.452 0-.803-.623-1.452-1.391-1.452v-4.026c3.192 0 5.776 2.697 5.776 6.028M25.018 25.88c-1.86-1.527-3.108-3.873-3.28-6.538H11.77c-2.091 0-3.785 1.72-3.785 3.841v4.801c0 1.061.848 1.922 1.892 1.922h13.249c1.044 0 1.892-.859 1.892-1.922z",clipRule:"evenodd"})),H||(H=n.createElement("path",{fill:"#141313",d:"M16.034 18.19c-.462-.089-.921-.172-1.356-.355-1.65-.692-2.611-1.97-2.922-3.773-.215-1.235-.113-2.456.386-3.61.709-1.64 1.984-2.532 3.653-2.832.998-.18 1.994-.14 2.958.22 1.449.539 2.418 1.575 2.869 3.1.454 1.535.387 3.073-.298 4.525-.708 1.519-1.948 2.333-3.516 2.652q-.195.041-.392.078-.689-.006-1.382-.005"})))};class G extends n.Component{constructor(e){super(e),this.state={remember:!1},this.bindCallbacks()}bindCallbacks(){this.handleToggleRemember=this.handleToggleRemember.bind(this),this.handleSubmit=this.handleSubmit.bind(this)}get isProcessing(){return this.props.apiMfaVerifyContext.state===S.CEREMONY_STATE}handleToggleRemember(){this.setState({remember:!this.state.remember})}handleSubmit(e){e.preventDefault(),this.props.apiMfaVerifyContext.onVerifyRequested(this.state.remember)}render(){const e=this.isProcessing?"processing":"";return n.createElement("form",{onSubmit:this.handleSubmit},n.createElement(Y,{className:"centered-login-provider-icon"}),n.createElement("h1",{className:"centered-text login-title"},n.createElement(M.x,null,"Additional Authentication with Passkey")),this.props.apiMfaVerifyContext.isRememberMeForAMonthEnabled&&n.createElement("div",{className:"input checkbox"},n.createElement("input",{id:"remember",type:"checkbox",name:"remember",checked:this.state.remember,onChange:this.handleToggleRemember,disabled:this.isProcessing}),n.createElement("label",{htmlFor:"remember"},n.createElement(M.x,null,"Remember this device for a month."))),n.createElement("div",{className:"form-actions"},n.createElement("button",{type:"submit",className:`button primary big full-width ${e}`,disabled:this.isProcessing},n.createElement(M.x,null,"Verify with Passkey"),this.isProcessing&&n.createElement(V,null)),n.createElement(q,null),n.createElement(B,null)))}}G.propTypes={apiMfaVerifyContext:h().object};const J=P((0,R.C)("common")(G));var K,X;function Z(){return Z=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Z.apply(null,arguments)}const Q=function(e){return n.createElement("svg",Z({shapeRendering:"geometricPrecision",textRendering:"geometricPrecision",viewBox:"0 0 128 128"},e),K||(K=n.createElement("circle",{id:"success-circle",r:62.5,fill:"none",strokeDasharray:392.7,strokeDashoffset:392.7,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:3,transform:"rotate(-90 64 0)"})),X||(X=n.createElement("path",{id:"success-check",fill:"none",strokeDasharray:65.24,strokeDashoffset:65.24,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:7,d:"M87.062 46.703 55.351 78.415 40.936 64"})))};var ee,te,re;function ne(){return ne=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ne.apply(null,arguments)}const se=function(e){return n.createElement("svg",ne({shapeRendering:"geometricPrecision",textRendering:"geometricPrecision",viewBox:"0 0 128 128"},e),ee||(ee=n.createElement("path",{id:"warning-dot",fill:"none",strokeDasharray:23.42,strokeDashoffset:23.42,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:7,d:"M64.038 46.76v23.413"})),te||(te=n.createElement("path",{id:"warning-bar",fill:"none",strokeDasharray:.09,strokeDashoffset:.09,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:7,d:"M64.038 93.585h.088"})),re||(re=n.createElement("path",{id:"warning-triangle",fill:"none",strokeDasharray:364.98,strokeDashoffset:364.98,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:3,d:"M53.954 16.685 4.412 99.459a11.66 11.66 0 0 0-1.167 8.872 11.66 11.66 0 0 0 5.464 7.087 10.97 10.97 0 0 0 5.7 1.578h99.17a11.67 11.67 0 0 0 8.253-3.508 11.68 11.68 0 0 0 3.323-8.329 11 11 0 0 0-1.579-5.7L74.033 16.685A11.66 11.66 0 0 0 57.9 12.739a12.1 12.1 0 0 0-3.946 3.946"})))};var ie,ae,oe;function le(){return le=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},le.apply(null,arguments)}const ce=function(e){return n.createElement("svg",le({shapeRendering:"geometricPrecision",textRendering:"geometricPrecision",viewBox:"0 0 128 128"},e),ie||(ie=n.createElement("circle",{id:"attention-circle",r:62.5,fill:"none",strokeDasharray:392.7,strokeDashoffset:392.7,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:3,transform:"rotate(-90 64 0)"})),ae||(ae=n.createElement("path",{id:"attention-dot",fill:"none",strokeDasharray:23.42,strokeDashoffset:23.42,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:7,d:"M63.956 40.588V64",transform:"rotate(180 63.956 52.294)"})),oe||(oe=n.createElement("path",{id:"attention-bar",fill:"none",strokeDasharray:.09,strokeDashoffset:.09,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:7,d:"M63.956 87.412h.088"})))};var he,de,ue;function pe(){return pe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},pe.apply(null,arguments)}const me=function(e){return n.createElement("svg",pe({shapeRendering:"geometricPrecision",textRendering:"geometricPrecision",viewBox:"0 0 128 128"},e),he||(he=n.createElement("circle",{id:"error-circle",r:62.5,fill:"none",strokeDasharray:392.7,strokeDashoffset:392.7,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:3,transform:"rotate(-90 64 0)"})),de||(de=n.createElement("path",{id:"error-stroke-1",fill:"none",strokeDasharray:37.96,strokeDashoffset:37.96,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:7,d:"m50.58 50.58 26.84 26.84",transform:"rotate(180 64 64)"})),ue||(ue=n.createElement("path",{id:"error-stroke-2",fill:"none",strokeDasharray:37.96,strokeDashoffset:37.96,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:7,d:"M77.42 50.58 50.58 77.42"})))};var fe,ge;function ye(){return ye=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ye.apply(null,arguments)}const be=function(e){return n.createElement("svg",ye({xmlns:"http://www.w3.org/2000/svg",width:128,height:129,fill:"none",viewBox:"0 0 128 129"},e),fe||(fe=n.createElement("circle",{cx:64,cy:64.844,r:62.5,stroke:"var(--Palette-Contrast-1)",strokeWidth:3})),ge||(ge=n.createElement("path",{stroke:"var(--Palette-Contrast-1)",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:7,d:"M69.932 57.034c6.386-6.402 12.773-9.594 19.16-9.594a17 17 0 0 1 12.02 29.018 17 17 0 0 1-12.02 4.979c-8.499 0-16.998-5.652-25.497-16.998-8.5-11.347-16.998-16.999-25.497-16.999a16.998 16.998 0 0 0 0 33.997c6.372 0 12.744-3.177 19.117-9.55"})))},ve={success:n.createElement(Q,null),warning:n.createElement(se,null),attention:n.createElement(ce,null),error:n.createElement(me,null),infinity_illustration:n.createElement(be,null)};class Ee extends n.Component{get animatedIconSVG(){return ve[this.props.name]}render(){return n.createElement("div",{className:"illustration icon-feedback"},n.createElement("div",{className:this.props.name},this.animatedIconSVG))}}Ee.defaultProps={},Ee.propTypes={name:h().string};const we=Ee;var ke;function Ce(){return Ce=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ce.apply(null,arguments)}const Te=function(e){return n.createElement("svg",Ce({xmlns:"http://www.w3.org/2000/svg",width:10,height:8,fill:"none",viewBox:"0 0 10 8"},e),ke||(ke=n.createElement("path",{stroke:"var(--icon-color)",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"m1 2 4 4 4-4"})))};var Re;function xe(){return xe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},xe.apply(null,arguments)}const Ae=function(e){return n.createElement("svg",xe({xmlns:"http://www.w3.org/2000/svg",width:8,height:10,fill:"none",viewBox:"0 0 8 10"},e),Re||(Re=n.createElement("path",{stroke:"var(--icon-color)",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"m2 9 4-4-4-4"})))};class Oe extends n.Component{constructor(e){super(e),this.state={displayLogs:!1},this.bindCallbacks()}bindCallbacks(){this.handleDisplayLogsClick=this.handleDisplayLogsClick.bind(this),this.handleTryAgainClick=this.handleTryAgainClick.bind(this)}handleDisplayLogsClick(){this.setState({displayLogs:!this.state.displayLogs})}handleTryAgainClick(){this.props.apiMfaVerifyContext.onRetryRequested()}get logs(){const{name:e,message:t,data:r}=this.props.apiMfaVerifyContext.error||{};return JSON.stringify({name:e,message:t,data:r},null,4)}render(){const e=this.props.apiMfaVerifyContext.hideErrorLogs;return n.createElement("div",{className:"mfa-verify-error"},n.createElement(we,{name:"attention"}),n.createElement("h1",null,n.createElement(M.x,null,"Something went wrong!")),n.createElement("p",null,e?n.createElement(M.x,null,"Please try again, or return to the application."):n.createElement(M.x,null,"Please try again later or check the logs for more information.")),n.createElement("div",{className:"form-actions"},n.createElement("button",{type:"button",className:"button primary big full-width",onClick:this.handleTryAgainClick},n.createElement(M.x,null,"Try again")),n.createElement(q,null),n.createElement(B,null)),!e&&n.createElement("div",{className:"accordion-header"},n.createElement("button",{type:"button",className:"link no-border",onClick:this.handleDisplayLogsClick},n.createElement(M.x,null,"Logs")," ",this.state.displayLogs?n.createElement(Te,null):n.createElement(Ae,null))),this.state.displayLogs&&n.createElement("div",{className:"accordion-content"},n.createElement("textarea",{readOnly:!0,value:this.logs})))}}Oe.propTypes={apiMfaVerifyContext:h().object};const Pe=P((0,R.C)("common")(Oe));class Se extends n.Component{componentDidMount(){this.props.apiMfaVerifyContext.onInitializeRequested()}render(){switch(this.props.apiMfaVerifyContext.state){case S.VERIFY_STATE:case S.CEREMONY_STATE:return n.createElement(J,null);case S.ERROR_STATE:return n.createElement(Pe,null);default:return n.createElement(D,null)}}}Se.propTypes={apiMfaVerifyContext:h().object};const Ue=P(Se);var Le=r(72635),Me=r(51831),je=r(32107);class Ve extends n.Component{constructor(e){super(e),this.state=this.defaultState}get defaultState(){return{ready:!1}}async componentDidMount(){await(0,Le.Yx)(Me.r).use(je.A).init({lng:this.locale,load:"currentOnly",interpolation:{escapeValue:!1},react:{useSuspense:!1},backend:{loadPath:(e,t)=>this.getTranslationPath(e,t)},supportedLngs:this.supportedLocales,fallbackLng:!1,ns:["common"],defaultNS:"common",keySeparator:!1,nsSeparator:!1,debug:!1}),this.setState({ready:!0})}getTranslationPath(e,t){const r=e[0],n=t[0],s="en-GB"===r?"en-UK":r;return(this.props.loadingPath||"/locales/{{lng}}/{{ns}}.json").replace("{{lng}}",s).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,Le.v2)(this.locale)}get isReady(){return this.state.ready}render(){return n.createElement(n.Fragment,null,this.isReady&&this.props.children)}}Ve.propTypes={context:h().any,loadingPath:h().any,children:h().any};const Ne=a(Ve);var De,Ie,qe,$e,Be;function We(){return We=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},We.apply(null,arguments)}const _e=function(e){return n.createElement("svg",We({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),De||(De=n.createElement("title",{id:"logo-title"},"Passbolt logo")),Ie||(Ie=n.createElement("desc",{id:"logo-description"},"This is the logo of passbolt.")),qe||(qe=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"})),$e||($e=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"})),Be||(Be=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 Fe extends n.Component{constructor(e){super(e),this.state=this.defaultState}get defaultState(){return{trustedDomain:this.baseUrl,getApiClientOptions:this.getApiClientOptions.bind(this),locale:this.appElement?.dataset.locale||"en-UK"}}get baseUrl(){const e=document.getElementsByTagName("base")?.[0];return e?e.attributes.href.value.replace(/\/*$/g,""):(console.error("Unable to retrieve the page base tag"),"")}get appElement(){return document.getElementById("api-mfa-verify")}get redirect(){return this.appElement?.dataset.redirect||"/"}getApiClientOptions(){return(new l).setBaseUrl(this.state.trustedDomain)}render(){return n.createElement(o.Provider,{value:this.state},n.createElement(Ne,{loadingPath:`${this.state.trustedDomain}/locales/{{lng}}/{{ns}}.json`},n.createElement(O,{value:{redirect:this.redirect}},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(_e,{role:"img",width:"20rem",height:"3.5rem"}))),n.createElement("div",{className:"login-form"},n.createElement(Ue,null)))))))}}const He=Fe,ze=document.createElement("div");document.body.appendChild(ze),(0,s.H)(ze).render(n.createElement(He,null))}};const t={};function r(n){const s=t[n];if(void 0!==s)return s.exports;const i=t[n]={exports:{}};return e[n].call(i.exports,i,i.exports,r),i.exports}r.m=e,(()=>{const e=[];r.O=(t,n,s)=>{if(!n){for(var i=0;i<e.length;i++){let[n,s]=e[i],o=!0;for(var a=0;a<n.length;a++)r.O.j(n[a])?n.splice(a--,1):o=!1;if(o){e.splice(i--,1);const r=s();void 0!==r&&(t=r)}}return t}e.push([n,s])}})(),r.n=e=>{const t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.cw=e=>{var t;return()=>{if(e){var r=e;e=0,t={exports:{}},r.call(t.exports,t,t.exports)}return t.exports}},r.d=(e,t)=>{if(Array.isArray(t))for(var n=0;n<t.length;){var s=t[n++],i=t[n++],a=0===i?{enumerable:!0,value:t[n++]}:{enumerable:!0,get:i};r.o(e,s)||Object.defineProperty(e,s,a)}else for(var s in t)r.o(t,s)&&!r.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.j=4546,(()=>{const e={4546:0};r.O.j=t=>0===e[t];const t=(t,n)=>{let[s,i,a]=n;var o,l,c=0;if(s.some(t=>0!==e[t])){for(o in i)r.o(i,o)&&(r.m[o]=i[o]);if(a)var h=a(r)}for(t&&t(n);c<s.length;c++)l=s[c],r.o(e,l)&&e[l]&&e[l][0](),e[l]=0;return r.O(h)},n=self.webpackChunkpassbolt_styleguide=self.webpackChunkpassbolt_styleguide||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})();let n=r.O(void 0,[3847],()=>r(45306));n=r.O(n)})();
|