@authing/guard-shim-react18 4.5.51-eak.1 → 4.5.51-eak.10
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/dist/guard.min.css +2 -2
- package/dist/guard.min.js +84 -84
- package/package.json +1 -1
package/dist/guard.min.js
CHANGED
|
@@ -27324,8 +27324,8 @@ var $L=i(4232),HL=i(4631),WL=i(1062),GL=i(8787),KL={zhCN:$L/* default */.Z,enUS:
|
|
|
27324
27324
|
/**
|
|
27325
27325
|
* 多账号 状态
|
|
27326
27326
|
*/
|
|
27327
|
-
multipleInstance:{isMultipleAccount:!1,instance:void 0,referMultipleState:void 0,multipleAccountData:void 0,clearBackFillData:void 0},phoneRegex:null,defaultLanguageConfig:"zh-CN",tenantInstance:void 0,isSpecialBrowser:!1},nD=y().createContext(tD),rD=y().createContext({spin:!1,spinChange:function(){}}),oD=function(){return XL(rD)},iD=function(){return XL(nD).publicConfig},aD=function(){return XL(nD).httpClient},sD=function(){return XL(nD).isSpecialBrowser},cD=function(){return XL(nD).appId},lD=function(){return XL(nD).tenantId};function uD(){return XL(nD).initData}var dD=function(){return XL(nD).currentModule},fD=function(){return XL(nD).events},pD=function(){var e=XL(nD);return{changeModule:e.changeModule,backModule:e.backModule,currentModule:e.currentModule}},hD=function(){return XL(nD).finallyConfig},mD=function(){return XL(nD).isAuthFlow},vD=function(){return XL(nD).multipleInstance},gD=function(){return XL(nD).phoneRegex},yD=function(){return XL(nD).defaultLanguageConfig},bD=function(){var e=iD(),t=e.customSecurityEnabled,n=e.appRobotVerify,r=e.userpoolRobotVerify;return t?n:r},wD=function(e){var t,n,r,o=iD(),i=o.loginSmsConfig,a=o.registerSmsConfig,s=o.forgetPasswordSmsConfig,c=!1;switch(e){case"login":c="ON"===(null===(t=null==i?void 0:i.robot)||void 0===t?void 0:t.switch);break;case"register":c="ON"===(null===(n=null==a?void 0:a.robot)||void 0===n?void 0:n.switch);break;case"forget-password":c="ON"===(null===(r=null==s?void 0:s.robot)||void 0===r?void 0:r.switch)}return c},CD=function(e){var t,n,r,o=iD(),i=o.loginEmailConfig,a=o.registerEmailConfig,s=o.forgetPasswordEmailConfig,c=!1;switch(e){case"login":c="ON"===(null===(t=null==i?void 0:i.robot)||void 0===t?void 0:t.switch);break;case"register":c="ON"===(null===(n=null==a?void 0:a.robot)||void 0===n?void 0:n.switch);break;case"forget-password":c="ON"===(null===(r=null==s?void 0:s.robot)||void 0===r?void 0:r.switch)}return c},ED=y().useMemo,kD={"zh-CN":{label:"简体中文"},"zh-TW":{label:"繁體中文"},"en-US":{label:"English"},"ja-JP":{label:"日本語"}},SD=function(e){var t=e.langRange,n=void 0===t?["zh-CN","zh-TW","en-US","ja-JP"]:t,r=e.onLangChange,o=_u().i18n,i=XL(nD).guardPageConfig,a=hD(),s=ED((function(){return"g2-change-language-text ".concat(a.mode)}),[a]),c=ED((function(){var e;return null===(e=i.global)||void 0===e?void 0:e.showChangeLanguage}),[i]),l=ED((function(){var e,t=null!==(e=o.resolvedLanguage)&&void 0!==e?e:o.language;return Object.keys(kD).includes(t)?t:ud(t)[0]||"en-US"}),[o.resolvedLanguage,o.language]),u=ED((function(){return y().createElement(y().Fragment,null,y().createElement("span",null,kD[l].label))}),[l]),d=ED((function(){return Object.keys(kD).filter((function(e){return n.includes(e)})).map((function(e){return{key:e,label:kD[e].label}}))}),[n]);if(!c||0===n.length)return null;var f={items:d,onClick:function(e){l!==e.key&&(o.changeLanguage(e.key),null==r||r(e.key))}};return y().createElement("div",{className:"g2-change-language-container"},y().createElement(CP,{menu:f,trigger:["click"],placement:"bottom",overlayClassName:"
|
|
27328
|
-
const xD=JSON.parse('{"i8":"4.5.51-eak.
|
|
27327
|
+
multipleInstance:{isMultipleAccount:!1,instance:void 0,referMultipleState:void 0,multipleAccountData:void 0,clearBackFillData:void 0},phoneRegex:null,defaultLanguageConfig:"zh-CN",tenantInstance:void 0,isSpecialBrowser:!1},nD=y().createContext(tD),rD=y().createContext({spin:!1,spinChange:function(){}}),oD=function(){return XL(rD)},iD=function(){return XL(nD).publicConfig},aD=function(){return XL(nD).httpClient},sD=function(){return XL(nD).isSpecialBrowser},cD=function(){return XL(nD).appId},lD=function(){return XL(nD).tenantId};function uD(){return XL(nD).initData}var dD=function(){return XL(nD).currentModule},fD=function(){return XL(nD).events},pD=function(){var e=XL(nD);return{changeModule:e.changeModule,backModule:e.backModule,currentModule:e.currentModule}},hD=function(){return XL(nD).finallyConfig},mD=function(){return XL(nD).isAuthFlow},vD=function(){return XL(nD).multipleInstance},gD=function(){return XL(nD).phoneRegex},yD=function(){return XL(nD).defaultLanguageConfig},bD=function(){var e=iD(),t=e.customSecurityEnabled,n=e.appRobotVerify,r=e.userpoolRobotVerify;return t?n:r},wD=function(e){var t,n,r,o=iD(),i=o.loginSmsConfig,a=o.registerSmsConfig,s=o.forgetPasswordSmsConfig,c=!1;switch(e){case"login":c="ON"===(null===(t=null==i?void 0:i.robot)||void 0===t?void 0:t.switch);break;case"register":c="ON"===(null===(n=null==a?void 0:a.robot)||void 0===n?void 0:n.switch);break;case"forget-password":c="ON"===(null===(r=null==s?void 0:s.robot)||void 0===r?void 0:r.switch)}return c},CD=function(e){var t,n,r,o=iD(),i=o.loginEmailConfig,a=o.registerEmailConfig,s=o.forgetPasswordEmailConfig,c=!1;switch(e){case"login":c="ON"===(null===(t=null==i?void 0:i.robot)||void 0===t?void 0:t.switch);break;case"register":c="ON"===(null===(n=null==a?void 0:a.robot)||void 0===n?void 0:n.switch);break;case"forget-password":c="ON"===(null===(r=null==s?void 0:s.robot)||void 0===r?void 0:r.switch)}return c},ED=y().useMemo,kD={"zh-CN":{label:"简体中文"},"zh-TW":{label:"繁體中文"},"en-US":{label:"English"},"ja-JP":{label:"日本語"}},SD=function(e){var t=e.langRange,n=void 0===t?["zh-CN","zh-TW","en-US","ja-JP"]:t,r=e.onLangChange,o=_u().i18n,i=XL(nD).guardPageConfig,a=hD(),s=ED((function(){return"g2-change-language-text ".concat(a.mode)}),[a]),c=ED((function(){var e;return null===(e=i.global)||void 0===e?void 0:e.showChangeLanguage}),[i]),l=ED((function(){var e,t=null!==(e=o.resolvedLanguage)&&void 0!==e?e:o.language;return Object.keys(kD).includes(t)?t:ud(t)[0]||"en-US"}),[o.resolvedLanguage,o.language]),u=ED((function(){return y().createElement(y().Fragment,null,y().createElement("span",null,kD[l].label))}),[l]),d=ED((function(){return Object.keys(kD).filter((function(e){return n.includes(e)})).map((function(e){return{key:e,label:kD[e].label}}))}),[n]);if(!c||0===n.length)return null;var f={items:d,onClick:function(e){l!==e.key&&(o.changeLanguage(e.key),null==r||r(e.key))}};return y().createElement("div",{className:"g2-change-language-container"},y().createElement(CP,{menu:f,trigger:["click"],placement:"bottom",overlayClassName:"genauth-g2-change-language-menu"},y().createElement("span",{className:s},u,y().createElement(JL,{type:"authing-arrow-down-s-fill",className:"down-fill-svg"}))))};// CONCATENATED MODULE: ./package.json
|
|
27328
|
+
const xD=JSON.parse('{"i8":"4.5.51-eak.10"}');// CONCATENATED MODULE: ./src/_utils/getVersion.ts
|
|
27329
27329
|
function _D(){return xD.i8}// CONCATENATED MODULE: ./src/_utils/flowHandleStorage.ts
|
|
27330
27330
|
var PD,TD=function(){return PD},ND=function(e){PD=e},OD=function(){return OD=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},OD.apply(this,arguments)},ID=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},AD=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},RD=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},MD=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},LD=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return ID(void 0,void 0,void 0,(function(){return AD(this,(function(t){switch(t.label){case 0:return[4/*yield*/,fetch.apply(void 0,MD([],RD(e),!1))];case 1:return[2/*return*/,t.sent().json()]}}))}))},DD=function(e){return new Promise((function(t){setTimeout((function(){t({data:{code:-1}}),e()}),1e4)}))};LD.get=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return ID(void 0,MD([e],RD(t),!1),void 0,(function(e,t,n){var r,o,i,a,s;return void 0===t&&(t={}),AD(this,(function(c){switch(c.label){case 0:r=OD(OD({},null==n?void 0:n.headers),((s={"Content-Type":"application/json"})[LD.langHeader]=y0(),s)),""!==LD.tenantId&&(r[LD.tenantHeader]=LD.tenantId),c.label=1;case 1:return c.trys.push([1,3,,4]),o=ha().CancelToken,i=o.source(),[4/*yield*/,Promise.race([DD(i.cancel),ha()("".concat(LD.baseUrl).concat(e).concat(Fc().stringify(t,{addQueryPrefix:!0})),OD(OD({method:"GET"},n),{withCredentials:!0,headers:r,cancelToken:i.token}))])];case 2:return[2/*return*/,null==(a=c.sent())?void 0:a.data];case 3:return c.sent(),[2/*return*/,Promise.resolve({code:-2})];case 4:return[2/*return*/]}}))}))},LD.post=function(e,t,n){return ID(void 0,void 0,void 0,(function(){var r,o,i,a,s,c,l;return AD(this,(function(u){switch(u.label){case 0:r=OD(OD({},null==n?void 0:n.headers),((s={"Content-Type":"application/json"})[LD.langHeader]=null!==(l=su.resolvedLanguage)&&void 0!==l?l:su.language,s)),""!==LD.tenantId&&(r[LD.tenantHeader]=LD.tenantId),u.label=1;case 1:return u.trys.push([1,3,,4]),o=ha().CancelToken,i=o.source(),[4/*yield*/,Promise.race([DD(i.cancel),ha()("".concat(LD.baseUrl).concat(e),{data:t,method:"POST",withCredentials:!0,cancelToken:i.token,headers:OD(OD({"Content-Type":"application/json"},null==n?void 0:n.headers),(c={},c[LD.langHeader]=y0(),c))})])];case 2:return[2/*return*/,null==(a=u.sent())?void 0:a.data];case 3:return u.sent(),[2/*return*/,Promise.resolve({code:-2})];case 4:return[2/*return*/]}}))}))},LD.postForm=function(e,t,n){return ID(void 0,void 0,void 0,(function(){var r,o,i,a;return AD(this,(function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),r=ha().CancelToken,o=r.source(),[4/*yield*/,Promise.race([DD(o.cancel),ha()("".concat(LD.baseUrl).concat(e),{method:"POST",data:t,withCredentials:!0,cancelToken:o.token,headers:OD(OD({},null==n?void 0:n.headers),(a={},a[LD.langHeader]=y0(),a))})])];case 1:return[2/*return*/,null==(i=s.sent())?void 0:i.data];case 2:return s.sent(),[2/*return*/,Promise.resolve({code:-2})];case 3:return[2/*return*/]}}))}))},LD.baseUrl="",LD.setBaseUrl=function(e){LD.baseUrl=e.replace(/\/$/,"")};var FD,jD="x-authing-lang";LD.langHeader=jD,LD.tenantHeader="x-authing-app-tenant-idåå",LD.tenantId="",LD.setLangHeader=function(e){LD.langHeader=e||jD},LD.setTenantHeader=function(e){LD.tenantHeader=e||jD},LD.setTenantId=function(e){LD.tenantId=e},function(e){e.ERROR="error",e.LOGIN="login",e.REGISTER="register",e.MFA="mfa",e.FORGET_PWD="forgetPassword",e.FORCED_PASSWORD_RESET="forcedPasswordReset",e.NOTICE_PASSWORD_RESET="noticePasswordReset",e.FIRST_LOGIN_PASSWORD="firstLoginPassword",e.UNSAFE_PASSWORD_RESET="unsafePasswordReset",e.DOWNLOAD_AT="downloadAT",e.BIND_TOTP="bindTotp",e.ANY_QUESTIONS="anyQuestions",e.LOGIN_COMPLETE_INFO="loginCompleteInfo",e.REGISTER_PASSWORD="registerPassword",e.REGISTER_COMPLETE_INFO="registerCompleteInfo",e.RECOVERY_CODE="recoveryCode",e.SUBMIT_SUCCESS="submitSuccess",e.IDENTITY_BINDING_ASK="identityBindingAsk",e.IDENTITY_BINDING="identityBinding",e.IDENTITY_BINDING_NO_ASK="identityBindingNoAsk",e.SELF_UNLOCK="selfUnlock",e.FLOW_SELECT_ACCOUNT="flowSelectAccount",
|
|
27331
27331
|
/** 多租户门户选择页 */
|
|
@@ -27343,7 +27343,7 @@ n[r]=function(){for(var n,o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];
|
|
|
27343
27343
|
// @ts-ignore
|
|
27344
27344
|
t&&rF[r].apply(rF,tF([],eF(o),!1)),
|
|
27345
27345
|
// @ts-ignore
|
|
27346
|
-
null===(n=e[r])||void 0===n||n.call.apply(n,tF([e],eF(o),!1))}})),XD(XD({},e),n)},iF={onLoad:"load",onLoadError:"load-error",onLogin:"login",onBeforeLogin:"before-login",onLoginError:"login-error",onRegister:"register",onBeforeRegister:"before-register",onRegisterError:"register-error",onEmailSend:"email-send",onEmailSendError:"email-send-error",onPhoneSend:"phone-send",onPhoneSendError:"phone-send-error",onPwdReset:"pwd-reset",onPwdResetError:"pwd-reset-error",onClose:"close",onLoginTabChange:"login-tab-change",onRegisterTabChange:"register-tab-change",onRegisterInfoCompleted:"register-info-completed",onRegisterInfoCompletedError:"register-info-completed-error",onLangChange:"lang-change",onBeforeChangeModule:"before-change-module",onAfterChangeModule:"after-change-module",onTenantSelect:"tenant-select"},aF=function(){return aF=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},aF.apply(this,arguments)},sF=((UD={})[Hs.OIDC]="/connections/oidc/init",UD[Hs.SAML]="/connections/saml/init",UD[Hs.CAS]="/connections/cas/init",UD[Hs.OAUTH]="/connections/oauth2/init",UD[Hs.AZURE_AD]="/connections/azure-ad/init",UD[Hs.AD_KERBEROS]="/connections/ad-kerberos/init",UD),cF=((qD={})[Hs.OIDC]="oidcConnectionLoginUrl",qD[Hs.SAML]="samlRequest",qD[Hs.CAS]="casConnectionLoginUrl",qD[Hs.OAUTH]="authUrl",qD[Hs.AZURE_AD]="authorizationUrl",qD[Hs.AD_KERBEROS]="authorizationUrl",qD),lF=function(){return lF=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},lF.apply(this,arguments)},uF=lF({},Ac()),dF=function(){return lF(lF({},Ac()),uF)},fF=function(){return fF=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},fF.apply(this,arguments)},pF=function(e){return y().createElement("div",fF({dangerouslySetInnerHTML:{__html:'<svg width="100%" height="100%"
|
|
27346
|
+
null===(n=e[r])||void 0===n||n.call.apply(n,tF([e],eF(o),!1))}})),XD(XD({},e),n)},iF={onLoad:"load",onLoadError:"load-error",onLogin:"login",onBeforeLogin:"before-login",onLoginError:"login-error",onRegister:"register",onBeforeRegister:"before-register",onRegisterError:"register-error",onEmailSend:"email-send",onEmailSendError:"email-send-error",onPhoneSend:"phone-send",onPhoneSendError:"phone-send-error",onPwdReset:"pwd-reset",onPwdResetError:"pwd-reset-error",onClose:"close",onLoginTabChange:"login-tab-change",onRegisterTabChange:"register-tab-change",onRegisterInfoCompleted:"register-info-completed",onRegisterInfoCompletedError:"register-info-completed-error",onLangChange:"lang-change",onBeforeChangeModule:"before-change-module",onAfterChangeModule:"after-change-module",onTenantSelect:"tenant-select"},aF=function(){return aF=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},aF.apply(this,arguments)},sF=((UD={})[Hs.OIDC]="/connections/oidc/init",UD[Hs.SAML]="/connections/saml/init",UD[Hs.CAS]="/connections/cas/init",UD[Hs.OAUTH]="/connections/oauth2/init",UD[Hs.AZURE_AD]="/connections/azure-ad/init",UD[Hs.AD_KERBEROS]="/connections/ad-kerberos/init",UD),cF=((qD={})[Hs.OIDC]="oidcConnectionLoginUrl",qD[Hs.SAML]="samlRequest",qD[Hs.CAS]="casConnectionLoginUrl",qD[Hs.OAUTH]="authUrl",qD[Hs.AZURE_AD]="authorizationUrl",qD[Hs.AD_KERBEROS]="authorizationUrl",qD),lF=function(){return lF=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},lF.apply(this,arguments)},uF=lF({},Ac()),dF=function(){return lF(lF({},Ac()),uF)},fF=function(){return fF=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},fF.apply(this,arguments)},pF=function(e){return y().createElement("div",fF({dangerouslySetInnerHTML:{__html:'<svg width="100%" height="100%" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg" style="overflow: visible;">\n <defs>\n <style>\n #ring-outer { fill: none; stroke: rgba(47,84,235,0.12); stroke-width: 2; }\n .orbit-dot {\n fill: #2F54EB;\n transform-origin: 50px 50px;\n animation: orbitSpin 1.6s linear infinite;\n }\n .orbit-dot2 {\n fill: rgba(47,84,235,0.45);\n transform-origin: 50px 50px;\n animation: orbitSpin 1.6s linear infinite;\n animation-delay: -0.8s;\n }\n .orbit-dot3 {\n fill: rgba(47,84,235,0.20);\n transform-origin: 50px 50px;\n animation: orbitSpin 1.6s linear infinite;\n animation-delay: -0.4s;\n }\n .arc-sweep {\n fill: none;\n stroke: #2F54EB;\n stroke-width: 2;\n stroke-dasharray: 50 158;\n stroke-linecap: round;\n transform-origin: 50px 50px;\n animation: arcSpin 1.6s linear infinite;\n }\n .arc-sweep2 {\n fill: none;\n stroke: rgba(47,84,235,0.25);\n stroke-width: 1.5;\n stroke-dasharray: 90 118;\n stroke-linecap: round;\n transform-origin: 50px 50px;\n animation: arcSpin 2.4s linear infinite reverse;\n }\n #core-pulse {\n fill: #2F54EB;\n animation: corePulse 1.6s ease-in-out infinite;\n }\n @keyframes orbitSpin {\n to { transform: rotate(360deg); }\n }\n @keyframes arcSpin {\n to { transform: rotate(360deg); }\n }\n @keyframes corePulse {\n 0%, 100% { opacity: 0.4; r: 3; }\n 50% { opacity: 1; r: 4.5; }\n }\n </style>\n </defs>\n\n <circle id="ring-outer" cx="50" cy="50" r="38"/>\n <circle cx="50" cy="50" r="26" fill="none" stroke="rgba(47,84,235,0.07)" stroke-width="1.5"/>\n <circle class="arc-sweep2" cx="50" cy="50" r="26"/>\n <circle class="arc-sweep" cx="50" cy="50" r="38"/>\n <circle id="core-pulse" cx="50" cy="50" r="4"/>\n <g class="orbit-dot"><circle cx="50" cy="12" r="4"/></g>\n <g class="orbit-dot2"><circle cx="50" cy="24" r="3"/></g>\n <g class="orbit-dot3"><circle cx="50" cy="38" r="2.5"/></g>\n </svg>'}},e))},hF=function(e){var t=iD(),n=e.size?e.size:50;return y().createElement("div",{style:{width:n,height:n},className:e.className},(null==t?void 0:t.customLoading)?y().createElement("img",{src:t.customLoading,alt:"",width:n}):y().createElement(pF,{width:n,height:n}))},mF=function(){return y().createElement("div",{className:"g2-init-setting-loading"},y().createElement(hF,{size:100}))},vF=function(){return vF=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},vF.apply(this,arguments)},gF=vF(vF(vF({},aF({},Ac())),dF()),{isSSO:!1,defaultInitData:{},showLoading:!0,openEventsMapping:!0,_closeLoopCheckQrcode:!1,loadingComponent:y().createElement("div",{className:"g2-init-setting-loading"},y().createElement(hF,{size:100}))}),yF=function(){return gF},bF=function(){return bF=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},bF.apply(this,arguments)};!function(e){e.ChangeModule="ChangeModule",e.Back="Back",e.Init="Init"}(VD||(VD={}));var wF=function(e,t){var n,r=this;
|
|
27347
27347
|
// 计数器
|
|
27348
27348
|
this.order=0,
|
|
27349
27349
|
// 总体的配置信息
|
|
@@ -27733,15 +27733,15 @@ c=c.filter((function(e){return!gj(gj([],vj(h),!1),vj(_),!1).includes(e.provider)
|
|
|
27733
27733
|
// 嵌入模式下特殊浏览器不显示所有身份源登录
|
|
27734
27734
|
c=[],s=[])
|
|
27735
27735
|
/** 过滤掉企业身份源中开启内嵌模式的身份源连接 如:企业微信自建 钉钉 */,s=s.filter((function(e){return!(null==e?void 0:e.embedded)}));var T=f&&(!(null==u?void 0:u.ssoPageComponentDisplay.socialLoginBtns)||!c.length)&&(!(null==u?void 0:u.ssoPageComponentDisplay.idpBtns)||!s.length);return[c,s,T]}},Pj=function(){return Pj=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Pj.apply(this,arguments)},Tj=y().useMemo,Nj=function(e){var t=oD().spin,n=e.type,r=Tj((function(){return t}),[t]),o=Tj((function(){var t=e.className;return n&&(t+=" guard-button-link-like"),r&&(t+=" guard-button-disabled"),t}),[r,e,n]);return y().createElement(ly,Pj({},e,{className:o,onClick:function(t){r||e.onClick&&e.onClick(t)}}))},Oj=function(){return Oj=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Oj.apply(this,arguments)},Ij=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},Aj=y().forwardRef,Rj=y().useState,Mj=y().useImperativeHandle,Lj=y().useEffect;
|
|
27736
|
-
/* harmony default export */const Dj=Aj((function(e,t){var n,r,o,i,a,s,c,l,u=oD(),d=u.spinChange,f=u.spin,p=Ij(Rj(!1),2),h=p[0],m=p[1],v=Ij(Rj(!1),2),g=v[0],b=v[1],w=(a=document.getElementsByClassName("
|
|
27736
|
+
/* harmony default export */const Dj=Aj((function(e,t){var n,r,o,i,a,s,c,l,u=oD(),d=u.spinChange,f=u.spin,p=Ij(Rj(!1),2),h=p[0],m=p[1],v=Ij(Rj(!1),2),g=v[0],b=v[1],w=(a=document.getElementsByClassName("genauth-g2-input"),s=document.getElementsByClassName("genauth-agreements-item-invalid"),c=document.getElementsByClassName("genauth-g2-code-input"),l=document.getElementsByClassName("g2-mfa-bindTotp-secretSave"),{MountShaking:function(){Array.from(a).forEach((function(e){e.classList.add("shaking")})),Array.from(s).forEach((function(e){e.classList.add("shaking")})),c[0]&&c[0].classList.add("shaking"),l[0]&&l[0].classList.add("shaking")},UnMountShaking:function(){Array.from(a).forEach((function(e){e.classList.remove("shaking")})),Array.from(s).forEach((function(e){e.classList.remove("shaking")})),c[0]&&c[0].classList.remove("shaking"),l[0]&&l[0].classList.remove("shaking")}}),C=w.MountShaking,E=w.UnMountShaking;// 协议和 form input 抖动的挂载和卸载
|
|
27737
27737
|
Lj((function(){var e;return!0===g&&(e=setTimeout((function(){E()}),820)),function(){clearTimeout(e)}}),[E,g]),Mj(t,(function(){return{onError:function(e){var t;m(!1),b(!0),d(!1),t=setTimeout((function(){C(),clearTimeout(t)}))},onSpin:function(e){m(e),d(e)}}}));var k=e.className?e.className:"";
|
|
27738
27738
|
// let shakingCls = shaking ? 'shaking' : ''
|
|
27739
|
-
return y().createElement(Nj,Oj({},e,{size:null!==(n=null==e?void 0:e.size)&&void 0!==n?n:"large",type:null!==(r=null==e?void 0:e.type)&&void 0!==r?r:"primary",htmlType:null!==(o=null==e?void 0:e.htmlType)&&void 0!==o?o:"submit",loading:h,disabled:!!f||(null!==(i=null==e?void 0:e.disabled)&&void 0!==i?i:h),onClick:e.onClick?e.onClick:function(){},className:"
|
|
27739
|
+
return y().createElement(Nj,Oj({},e,{size:null!==(n=null==e?void 0:e.size)&&void 0!==n?n:"large",type:null!==(r=null==e?void 0:e.type)&&void 0!==r?r:"primary",htmlType:null!==(o=null==e?void 0:e.htmlType)&&void 0!==o?o:"submit",loading:h,disabled:!!f||(null!==(i=null==e?void 0:e.disabled)&&void 0!==i?i:h),onClick:e.onClick?e.onClick:function(){},className:"genauth-g2-submit-button ".concat(k," ").concat("")}),e.text)}));// CONCATENATED MODULE: ./src/BindTotp/businessRequest.ts
|
|
27740
27740
|
var Fj,jj=function(){return jj=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},jj.apply(this,arguments)},Bj=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},Uj=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};!function(e){e.VerifyTotpFirstTime="verify-totp-first-time",e.ConfirmTotpRecoveryCode="confirm-totp-recovery-code"}(Fj||(Fj={}));var qj=function(e,t){return Bj(void 0,void 0,void 0,(function(){return Uj(this,(function(n){switch(n.label){case 0:return[4/*yield*/,(0,BX().authFlow)(e,jj({},t))];case 1:return[2/*return*/,n.sent()]}}))}))},Vj=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},zj=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},$j=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},Hj=y().useRef,Wj=mM.Paragraph,Gj=function(e){var t=e.secret,n=e.onBind,r=Hj(null),o=$j(cT.useForm(),1)[0],i=_u().t,a=mD();
|
|
27741
27741
|
// const [isSaved, setIsSaved] = useState(false)
|
|
27742
|
-
return y().createElement(y().Fragment,null,y().createElement("p",{className:"
|
|
27742
|
+
return y().createElement(y().Fragment,null,y().createElement("p",{className:"genauth-g2-mfa-title"},i("common.totpText1")),y().createElement("p",{className:"genauth-g2-mfa-tips"},i("common.totpText2")),y().createElement("div",{className:"g2-mfa-bindTotp-copySecret"},y().createElement(Wj,{copyable:!0},t)),y().createElement(cT,{form:o,onFinish:function(){return Vj(void 0,void 0,void 0,(function(){var e,t,i,s,c,l,u,d;return zj(this,(function(f){switch(f.label){case 0:return null===(c=r.current)||void 0===c||c.onSpin(!0),[4/*yield*/,o.validateFields()];case 1:return f.sent(),a?[4/*yield*/,qj(Fj.ConfirmTotpRecoveryCode,{})]:[3/*break*/,3];case 2:return e=f.sent(),t=e.data,i=e.isFlowEnd,s=e.onGuardHandling,null===(l=r.current)||void 0===l||l.onSpin(!1),i?n(t):(
|
|
27743
27743
|
// TODO 需要 onError 抖动吗 当 from 表单校验通过的时候 onError 是没有意义的
|
|
27744
|
-
null===(u=r.current)||void 0===u||u.onError(),null==s||s()),[3/*break*/,4];case 3:null===(d=r.current)||void 0===d||d.onSpin(!1),n(),f.label=4;case 4:return[2/*return*/]}}))}))},style:{width:"100%"},onFinishFailed:function(){var e;return null===(e=r.current)||void 0===e?void 0:e.onError()}},y().createElement(cT.Item,{className:"
|
|
27744
|
+
null===(u=r.current)||void 0===u||u.onError(),null==s||s()),[3/*break*/,4];case 3:null===(d=r.current)||void 0===d||d.onSpin(!1),n(),f.label=4;case 4:return[2/*return*/]}}))}))},style:{width:"100%"},onFinishFailed:function(){var e;return null===(e=r.current)||void 0===e?void 0:e.onError()}},y().createElement(cT.Item,{className:"genauth-g2-input-form g2-mfa-totp-verify-input",name:"remember",rules:[{validator:function(e,t){return t?Promise.resolve():Promise.reject()}}],valuePropName:"checked"},y().createElement(tw,{className:"g2-mfa-bindTotp-secretSave"},i("login.rememberedSecret"))),y().createElement(Dj,{text:i("common.bindSuccess"),ref:r})))},Kj=function(){return Kj=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Kj.apply(this,arguments)},Yj=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},Jj=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},Qj=y().useRef,Zj=y().useState,Xj=function(e){var t=e.borderRadius,n=e.noSpin,r=e.alt,o=e.style,i=Yj(e,["borderRadius","noSpin","alt","style"]),a=Jj(Zj(!0===n),2),s=a[0],c=a[1],l=0,u=0;return e.size?(
|
|
27745
27745
|
// size 存在,说明是正方形,让宽高等于 size
|
|
27746
27746
|
l=e.size,u=e.size):(
|
|
27747
27747
|
// 如果 size 不存在,说明长方形,尝试读取宽高
|
|
@@ -27753,7 +27753,7 @@ u=e.width?e.width:"auto",d=e.height?e.height:"auto"),y().createElement("div",{st
|
|
|
27753
27753
|
// type: 'array',
|
|
27754
27754
|
validateTrigger:["onChange"],message:t("common.isMissing",{name:o}),required:!0},{
|
|
27755
27755
|
// type: 'array',
|
|
27756
|
-
validateTrigger:[""],message:t("common.fullCaptchaCode",{name:o}),min:n}]},i))},oB=i(5996),iB=i.n(oB),aB=Object.defineProperty,sB=Object.defineProperties,cB=Object.getOwnPropertyDescriptors,lB=Object.getOwnPropertySymbols,uB=Object.prototype.hasOwnProperty,dB=Object.prototype.propertyIsEnumerable,fB=(e,t,n)=>t in e?aB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,pB="^\\d+$";var hB=["[data-lastpass-icon-root]","com-1password-button","[data-dashlanecreated]",'[style$="2147483647 !important;"]'].join(",");var mB=g.createContext({}),vB=g.forwardRef(((e,t)=>{var n,r,o,i,a,s=e,{value:c,onChange:l,maxLength:u,textAlign:d="left",pattern:f=pB,inputMode:p="numeric",onComplete:h,pushPasswordManagerStrategy:m="increase-width",containerClassName:v,noScriptCSSFallback:y=bB,render:b,children:w}=s,C=((e,t)=>{var n={};for(var r in e)uB.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&lB)for(var r of lB(e))t.indexOf(r)<0&&dB.call(e,r)&&(n[r]=e[r]);return n})(s,["value","onChange","maxLength","textAlign","pattern","inputMode","onComplete","pushPasswordManagerStrategy","containerClassName","noScriptCSSFallback","render","children"]);let[E,k]=g.useState("string"==typeof C.defaultValue?C.defaultValue:""),S=null!=c?c:E,x=function(e){let t=g.useRef();return g.useEffect((()=>{t.current=e})),t.current}(S),_=g.useCallback((e=>{null==l||l(e),k(e)}),[l]),P=g.useMemo((()=>f?"string"==typeof f?new RegExp(f):f:null),[f]),T=g.useRef(null),N=g.useRef(null),O=g.useRef({value:S,onChange:_,isIOS:"undefined"!=typeof window&&(null==(r=null==(n=null==window?void 0:window.CSS)?void 0:n.supports)?void 0:r.call(n,"-webkit-touch-callout","none"))}),I=g.useRef({prev:[null==(o=T.current)?void 0:o.selectionStart,null==(i=T.current)?void 0:i.selectionEnd,null==(a=T.current)?void 0:a.selectionDirection]});g.useImperativeHandle(t,(()=>T.current),[]),g.useEffect((()=>{let e=T.current,t=N.current;if(!e||!t)return;function n(){if(document.activeElement!==e)return F(null),void B(null);let t,n=e.selectionStart,r=e.selectionEnd,o=e.selectionDirection,i=e.maxLength,a=e.value,s=I.current.prev,c=-1,l=-1;if(0!==a.length&&null!==n&&null!==r){let e=n===r,o=n===a.length&&a.length<i;if(e&&!o){let e=n;if(0===e)c=0,l=1,t="forward";else if(e===i)c=e-1,l=e,t="backward";else if(i>1&&a.length>1){let n=0;if(null!==s[0]&&null!==s[1]){t=e<s[1]?"backward":"forward";let r=s[0]===s[1]&&s[0]<i;"backward"===t&&!r&&(n=-1)}c=n+e,l=n+e+1}}-1!==c&&-1!==l&&c!==l&&T.current.setSelectionRange(c,l,t)}let u=-1!==c?c:n,d=-1!==l?l:r,f=null!=t?t:o;F(u),B(d),I.current.prev=[u,d,f]}if(O.current.value!==e.value&&O.current.onChange(e.value),I.current.prev=[e.selectionStart,e.selectionEnd,e.selectionDirection],document.addEventListener("selectionchange",n,{capture:!0}),n(),document.activeElement===e&&L(!0),!document.getElementById("input-otp-style")){let e=document.createElement("style");if(e.id="input-otp-style",document.head.appendChild(e),e.sheet){let t="background: transparent !important; color: transparent !important; border-color: transparent !important; opacity: 0 !important; box-shadow: none !important; -webkit-box-shadow: none !important; -webkit-text-fill-color: transparent !important;";gB(e.sheet,"[data-input-otp]::selection { background: transparent !important; color: transparent !important; }"),gB(e.sheet,`[data-input-otp]:autofill { ${t} }`),gB(e.sheet,`[data-input-otp]:-webkit-autofill { ${t} }`),gB(e.sheet,"@supports (-webkit-touch-callout: none) { [data-input-otp] { letter-spacing: -.6em !important; font-weight: 100 !important; font-stretch: ultra-condensed; font-optical-sizing: none !important; left: -1px !important; right: 1px !important; } }"),gB(e.sheet,"[data-input-otp] + * { pointer-events: all !important; }")}}let r=()=>{t&&t.style.setProperty("--root-height",`${e.clientHeight}px`)};r();let o=new ResizeObserver(r);return o.observe(e),()=>{document.removeEventListener("selectionchange",n,{capture:!0}),o.disconnect()}}),[]);let[A,R]=g.useState(!1),[M,L]=g.useState(!1),[D,F]=g.useState(null),[j,B]=g.useState(null);g.useEffect((()=>{!function(e){setTimeout(e,0),setTimeout(e,10),setTimeout(e,50)}((()=>{var e,t,n,r;null==(e=T.current)||e.dispatchEvent(new Event("input"));let o=null==(t=T.current)?void 0:t.selectionStart,i=null==(n=T.current)?void 0:n.selectionEnd,a=null==(r=T.current)?void 0:r.selectionDirection;null!==o&&null!==i&&(F(o),B(i),I.current.prev=[o,i,a])}))}),[S,M]),g.useEffect((()=>{void 0!==x&&S!==x&&x.length<u&&S.length===u&&(null==h||h(S))}),[u,h,x,S]);let U=function({containerRef:e,inputRef:t,pushPasswordManagerStrategy:n,isFocused:r}){let o=g.useRef({done:!1,refocused:!1}),[i,a]=g.useState(!1),[s,c]=g.useState(!1),[l,u]=g.useState(!1),d=g.useMemo((()=>"none"!==n&&("increase-width"===n||"experimental-no-flickering"===n)&&i&&s),[i,s,n]),f=g.useCallback((()=>{let r=e.current,i=t.current;if(!r||!i||l||"none"===n)return;let s=r,c=s.getBoundingClientRect().left+s.offsetWidth-18,d=s.getBoundingClientRect().top+s.offsetHeight/2;if((0!==document.querySelectorAll(hB).length||document.elementFromPoint(c,d)!==r)&&(a(!0),u(!0),!o.current.refocused&&document.activeElement===i)){let e=[i.selectionStart,i.selectionEnd];i.blur(),i.focus(),i.setSelectionRange(e[0],e[1]),o.current.refocused=!0}}),[e,t,l,n]);return g.useEffect((()=>{let t=e.current;if(!t||"none"===n)return;function r(){let e=window.innerWidth-t.getBoundingClientRect().right;c(e>=40)}r();let o=setInterval(r,1e3);return()=>{clearInterval(o)}}),[e,n]),g.useEffect((()=>{let e=r||document.activeElement===t.current;if("none"===n||!e)return;let o=setTimeout(f,0),i=setTimeout(f,2e3),a=setTimeout(f,5e3),s=setTimeout((()=>{u(!0)}),6e3);return()=>{clearTimeout(o),clearTimeout(i),clearTimeout(a),clearTimeout(s)}}),[t,r,n,f]),{hasPWMBadge:i,willPushPWMBadge:d,PWM_BADGE_SPACE_WIDTH:"40px"}}({containerRef:N,inputRef:T,pushPasswordManagerStrategy:m,isFocused:M}),q=g.useCallback((e=>{let t=e.currentTarget.value.slice(0,u);t.length>0&&P&&!P.test(t)?e.preventDefault():("string"==typeof x&&t.length<x.length&&document.dispatchEvent(new Event("selectionchange")),_(t))}),[u,_,x,P]),V=g.useCallback((()=>{var e;if(T.current){let t=Math.min(T.current.value.length,u-1),n=T.current.value.length;null==(e=T.current)||e.setSelectionRange(t,n),F(t),B(n)}L(!0)}),[u]),z=g.useCallback((e=>{var t,n;let r=T.current;if(!O.current.isIOS||!e.clipboardData||!r)return;let o=e.clipboardData.getData("text/plain");e.preventDefault();let i=null==(t=T.current)?void 0:t.selectionStart,a=null==(n=T.current)?void 0:n.selectionEnd,s=(i!==a?S.slice(0,i)+o+S.slice(a):S.slice(0,i)+o+S.slice(i)).slice(0,u);if(s.length>0&&P&&!P.test(s))return;r.value=s,_(s);let c=Math.min(s.length,u-1),l=s.length;r.setSelectionRange(c,l),F(c),B(l)}),[u,_,P,S]),$=g.useMemo((()=>({position:"relative",cursor:C.disabled?"default":"text",userSelect:"none",WebkitUserSelect:"none",pointerEvents:"none"})),[C.disabled]),H=g.useMemo((()=>({position:"absolute",inset:0,width:U.willPushPWMBadge?`calc(100% + ${U.PWM_BADGE_SPACE_WIDTH})`:"100%",clipPath:U.willPushPWMBadge?`inset(0 ${U.PWM_BADGE_SPACE_WIDTH} 0 0)`:void 0,height:"100%",display:"flex",textAlign:d,opacity:"1",color:"transparent",pointerEvents:"all",background:"transparent",caretColor:"transparent",border:"0 solid transparent",outline:"0 solid transparent",boxShadow:"none",lineHeight:"1",letterSpacing:"-.5em",fontSize:"var(--root-height)",fontFamily:"monospace",fontVariantNumeric:"tabular-nums"})),[U.PWM_BADGE_SPACE_WIDTH,U.willPushPWMBadge,d]),W=g.useMemo((()=>g.createElement("input",((e,t)=>sB(e,cB(t)))(((e,t)=>{for(var n in t||(t={}))uB.call(t,n)&&fB(e,n,t[n]);if(lB)for(var n of lB(t))dB.call(t,n)&&fB(e,n,t[n]);return e})({autoComplete:C.autoComplete||"one-time-code"},C),{"data-input-otp":!0,"data-input-otp-mss":D,"data-input-otp-mse":j,inputMode:p,pattern:null==P?void 0:P.source,style:H,maxLength:u,value:S,ref:T,onPaste:e=>{var t;z(e),null==(t=C.onPaste)||t.call(C,e)},onChange:q,onMouseOver:e=>{var t;R(!0),null==(t=C.onMouseOver)||t.call(C,e)},onMouseLeave:e=>{var t;R(!1),null==(t=C.onMouseLeave)||t.call(C,e)},onFocus:e=>{var t;V(),null==(t=C.onFocus)||t.call(C,e)},onBlur:e=>{var t;L(!1),null==(t=C.onBlur)||t.call(C,e)}}))),[q,V,z,p,H,u,j,D,C,null==P?void 0:P.source,S]),G=g.useMemo((()=>({slots:Array.from({length:u}).map(((e,t)=>{let n=M&&null!==D&&null!==j&&(D===j&&t===D||t>=D&&t<j),r=void 0!==S[t]?S[t]:null;return{char:r,isActive:n,hasFakeCaret:n&&null===r}})),isFocused:M,isHovering:!C.disabled&&A})),[M,A,u,j,D,C.disabled,S]),K=g.useMemo((()=>b?b(G):g.createElement(mB.Provider,{value:G},w)),[w,G,b]);return g.createElement(g.Fragment,null,null!==y&&g.createElement("noscript",null,g.createElement("style",null,y)),g.createElement("div",{ref:N,"data-input-otp-container":!0,style:$,className:v},K,g.createElement("div",{style:{position:"absolute",inset:0,pointerEvents:"none"}},W)))}));function gB(e,t){try{e.insertRule(t)}catch(e){}}vB.displayName="Input";var yB,bB="\n[data-input-otp] {\n --nojs-bg: white !important;\n --nojs-fg: black !important;\n\n background-color: var(--nojs-bg) !important;\n color: var(--nojs-fg) !important;\n caret-color: var(--nojs-fg) !important;\n letter-spacing: .25em !important;\n text-align: center !important;\n border: 1px solid var(--nojs-fg) !important;\n border-radius: 4px !important;\n width: 100% !important;\n}\n@media (prefers-color-scheme: dark) {\n [data-input-otp] {\n --nojs-bg: black !important;\n --nojs-fg: white !important;\n }\n}",wB=function(){return wB=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},wB.apply(this,arguments)},CB=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},EB=function(){return y().createElement("div",{className:"authing-g2-otp-input-cursor"})},kB=function(e){return y().createElement("div",{style:e.style,className:iB()("authing-g2-code-input-item",{focus:e.isActive})},null!==e.char&&y().createElement("div",null,e.char),e.hasFakeCaret&&y().createElement(EB,null))},SB=function(e){var t=e.length,n=void 0===t?4:t,r=(e.size,e.gutter),o=void 0===r?n>4?"14px":"24px":r,i=(e.className,e.onEenter,e.showDivider),a=void 0!==i&&i,s=e.onChange,c=e.value,l=e.onFinish,u=CB(e,["length","size","gutter","className","onEenter","showDivider","onChange","value","onFinish"]);return y().createElement("div",wB({className:"authing-g2-code-input"},u),y().createElement(vB,{value:c,onChange:s,maxLength:n,onComplete:l,render:function(e){var t=e.slots;return y().createElement("div",{className:"authing-g2-otp-wrapper"},t.map((function(e,t){return y().createElement(y().Fragment,null,y().createElement(kB,wB({key:t},e,{style:{marginLeft:0===t?0:o}})),a&&t===Math.floor(n/2-1)&&y().createElement(CS,{className:"authing-g2-code-input-divider"}))})))}}))},xB=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},_B=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},PB=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},TB=y().useRef,NB=function(e){var t=e.mfaToken,n=e.qrcode,r=e.onNext,o=e.changeModule,i=PB(cT.useForm(),1)[0],a=TB(null),s=_u().t,c=UX().post,l=mD(),u=PB(dj((function(){return xB(void 0,void 0,void 0,(function(){var e,n,o,s,u,d,f,p,h,m,v,g;return _B(this,(function(y){switch(y.label){case 0:return null===(p=a.current)||void 0===p||p.onSpin(!0),[4/*yield*/,i.validateFields()];case 1:return y.sent(),e=i.getFieldValue("saftyCode"),l?[4/*yield*/,qj(Fj.VerifyTotpFirstTime,{totp:e})]:[3/*break*/,3];case 2:return n=y.sent(),o=n.statusCode,f=n.onGuardHandling,null===(h=a.current)||void 0===h||h.onSpin(!1),200===o?r():(null===(m=a.current)||void 0===m||m.onError(),null==f||f()),[3/*break*/,5];case 3:return[4/*yield*/,c("/api/v2/mfa/totp/associate/confirm",{authenticator_type:"totp",totp:e,source:"APPLICATION"},{headers:{authorization:t}})];case 4:s=y.sent(),u=s.code,d=s.data,f=s.onGuardHandling,null===(v=a.current)||void 0===v||v.onSpin(!1),200===u?r(d):(null===(g=a.current)||void 0===g||g.onError(),null==f||f()),y.label=5;case 5:return[2/*return*/]}}))}))}),[t]),2),d=u[1];return y().createElement(y().Fragment,null,y().createElement("p",{className:"authing-g2-mfa-title"},s("user.mfaBind")),y().createElement("p",{className:"authing-g2-mfa-tips",style:{textAlign:"left"}},s("common.usePhoneOpen"),"(",s("common.noValidator")," ",y().createElement("span",{style:{color:"#EE5C2A",cursor:"pointer"},onClick:function(){null==o||o(FD.DOWNLOAD_AT)}},s("common.clickTodownload")),") ",s("common.mfaText1")),y().createElement(Xj,{className:"g2-mfa-bindTotp-qrcode",src:n,alt:"qrcode"}),y().createElement(cT,{className:"g2-mfa-bindTotp-securityCode-form",form:i,onSubmitCapture:function(){},onFinish:d,onFinishFailed:function(){a.current.onError()}},y().createElement(rB,{codeLength:6,name:"saftyCode",ruleKeyword:s("user.numberSafteyCode")},y().createElement(SB,{length:6,showDivider:!1,gutter:"10px",onFinish:d})),y().createElement(Dj,{text:s("user.nextStep"),ref:a})))},OB=function(){return OB=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},OB.apply(this,arguments)};
|
|
27756
|
+
validateTrigger:[""],message:t("common.fullCaptchaCode",{name:o}),min:n}]},i))},oB=i(5996),iB=i.n(oB),aB=Object.defineProperty,sB=Object.defineProperties,cB=Object.getOwnPropertyDescriptors,lB=Object.getOwnPropertySymbols,uB=Object.prototype.hasOwnProperty,dB=Object.prototype.propertyIsEnumerable,fB=(e,t,n)=>t in e?aB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,pB="^\\d+$";var hB=["[data-lastpass-icon-root]","com-1password-button","[data-dashlanecreated]",'[style$="2147483647 !important;"]'].join(",");var mB=g.createContext({}),vB=g.forwardRef(((e,t)=>{var n,r,o,i,a,s=e,{value:c,onChange:l,maxLength:u,textAlign:d="left",pattern:f=pB,inputMode:p="numeric",onComplete:h,pushPasswordManagerStrategy:m="increase-width",containerClassName:v,noScriptCSSFallback:y=bB,render:b,children:w}=s,C=((e,t)=>{var n={};for(var r in e)uB.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&lB)for(var r of lB(e))t.indexOf(r)<0&&dB.call(e,r)&&(n[r]=e[r]);return n})(s,["value","onChange","maxLength","textAlign","pattern","inputMode","onComplete","pushPasswordManagerStrategy","containerClassName","noScriptCSSFallback","render","children"]);let[E,k]=g.useState("string"==typeof C.defaultValue?C.defaultValue:""),S=null!=c?c:E,x=function(e){let t=g.useRef();return g.useEffect((()=>{t.current=e})),t.current}(S),_=g.useCallback((e=>{null==l||l(e),k(e)}),[l]),P=g.useMemo((()=>f?"string"==typeof f?new RegExp(f):f:null),[f]),T=g.useRef(null),N=g.useRef(null),O=g.useRef({value:S,onChange:_,isIOS:"undefined"!=typeof window&&(null==(r=null==(n=null==window?void 0:window.CSS)?void 0:n.supports)?void 0:r.call(n,"-webkit-touch-callout","none"))}),I=g.useRef({prev:[null==(o=T.current)?void 0:o.selectionStart,null==(i=T.current)?void 0:i.selectionEnd,null==(a=T.current)?void 0:a.selectionDirection]});g.useImperativeHandle(t,(()=>T.current),[]),g.useEffect((()=>{let e=T.current,t=N.current;if(!e||!t)return;function n(){if(document.activeElement!==e)return F(null),void B(null);let t,n=e.selectionStart,r=e.selectionEnd,o=e.selectionDirection,i=e.maxLength,a=e.value,s=I.current.prev,c=-1,l=-1;if(0!==a.length&&null!==n&&null!==r){let e=n===r,o=n===a.length&&a.length<i;if(e&&!o){let e=n;if(0===e)c=0,l=1,t="forward";else if(e===i)c=e-1,l=e,t="backward";else if(i>1&&a.length>1){let n=0;if(null!==s[0]&&null!==s[1]){t=e<s[1]?"backward":"forward";let r=s[0]===s[1]&&s[0]<i;"backward"===t&&!r&&(n=-1)}c=n+e,l=n+e+1}}-1!==c&&-1!==l&&c!==l&&T.current.setSelectionRange(c,l,t)}let u=-1!==c?c:n,d=-1!==l?l:r,f=null!=t?t:o;F(u),B(d),I.current.prev=[u,d,f]}if(O.current.value!==e.value&&O.current.onChange(e.value),I.current.prev=[e.selectionStart,e.selectionEnd,e.selectionDirection],document.addEventListener("selectionchange",n,{capture:!0}),n(),document.activeElement===e&&L(!0),!document.getElementById("input-otp-style")){let e=document.createElement("style");if(e.id="input-otp-style",document.head.appendChild(e),e.sheet){let t="background: transparent !important; color: transparent !important; border-color: transparent !important; opacity: 0 !important; box-shadow: none !important; -webkit-box-shadow: none !important; -webkit-text-fill-color: transparent !important;";gB(e.sheet,"[data-input-otp]::selection { background: transparent !important; color: transparent !important; }"),gB(e.sheet,`[data-input-otp]:autofill { ${t} }`),gB(e.sheet,`[data-input-otp]:-webkit-autofill { ${t} }`),gB(e.sheet,"@supports (-webkit-touch-callout: none) { [data-input-otp] { letter-spacing: -.6em !important; font-weight: 100 !important; font-stretch: ultra-condensed; font-optical-sizing: none !important; left: -1px !important; right: 1px !important; } }"),gB(e.sheet,"[data-input-otp] + * { pointer-events: all !important; }")}}let r=()=>{t&&t.style.setProperty("--root-height",`${e.clientHeight}px`)};r();let o=new ResizeObserver(r);return o.observe(e),()=>{document.removeEventListener("selectionchange",n,{capture:!0}),o.disconnect()}}),[]);let[A,R]=g.useState(!1),[M,L]=g.useState(!1),[D,F]=g.useState(null),[j,B]=g.useState(null);g.useEffect((()=>{!function(e){setTimeout(e,0),setTimeout(e,10),setTimeout(e,50)}((()=>{var e,t,n,r;null==(e=T.current)||e.dispatchEvent(new Event("input"));let o=null==(t=T.current)?void 0:t.selectionStart,i=null==(n=T.current)?void 0:n.selectionEnd,a=null==(r=T.current)?void 0:r.selectionDirection;null!==o&&null!==i&&(F(o),B(i),I.current.prev=[o,i,a])}))}),[S,M]),g.useEffect((()=>{void 0!==x&&S!==x&&x.length<u&&S.length===u&&(null==h||h(S))}),[u,h,x,S]);let U=function({containerRef:e,inputRef:t,pushPasswordManagerStrategy:n,isFocused:r}){let o=g.useRef({done:!1,refocused:!1}),[i,a]=g.useState(!1),[s,c]=g.useState(!1),[l,u]=g.useState(!1),d=g.useMemo((()=>"none"!==n&&("increase-width"===n||"experimental-no-flickering"===n)&&i&&s),[i,s,n]),f=g.useCallback((()=>{let r=e.current,i=t.current;if(!r||!i||l||"none"===n)return;let s=r,c=s.getBoundingClientRect().left+s.offsetWidth-18,d=s.getBoundingClientRect().top+s.offsetHeight/2;if((0!==document.querySelectorAll(hB).length||document.elementFromPoint(c,d)!==r)&&(a(!0),u(!0),!o.current.refocused&&document.activeElement===i)){let e=[i.selectionStart,i.selectionEnd];i.blur(),i.focus(),i.setSelectionRange(e[0],e[1]),o.current.refocused=!0}}),[e,t,l,n]);return g.useEffect((()=>{let t=e.current;if(!t||"none"===n)return;function r(){let e=window.innerWidth-t.getBoundingClientRect().right;c(e>=40)}r();let o=setInterval(r,1e3);return()=>{clearInterval(o)}}),[e,n]),g.useEffect((()=>{let e=r||document.activeElement===t.current;if("none"===n||!e)return;let o=setTimeout(f,0),i=setTimeout(f,2e3),a=setTimeout(f,5e3),s=setTimeout((()=>{u(!0)}),6e3);return()=>{clearTimeout(o),clearTimeout(i),clearTimeout(a),clearTimeout(s)}}),[t,r,n,f]),{hasPWMBadge:i,willPushPWMBadge:d,PWM_BADGE_SPACE_WIDTH:"40px"}}({containerRef:N,inputRef:T,pushPasswordManagerStrategy:m,isFocused:M}),q=g.useCallback((e=>{let t=e.currentTarget.value.slice(0,u);t.length>0&&P&&!P.test(t)?e.preventDefault():("string"==typeof x&&t.length<x.length&&document.dispatchEvent(new Event("selectionchange")),_(t))}),[u,_,x,P]),V=g.useCallback((()=>{var e;if(T.current){let t=Math.min(T.current.value.length,u-1),n=T.current.value.length;null==(e=T.current)||e.setSelectionRange(t,n),F(t),B(n)}L(!0)}),[u]),z=g.useCallback((e=>{var t,n;let r=T.current;if(!O.current.isIOS||!e.clipboardData||!r)return;let o=e.clipboardData.getData("text/plain");e.preventDefault();let i=null==(t=T.current)?void 0:t.selectionStart,a=null==(n=T.current)?void 0:n.selectionEnd,s=(i!==a?S.slice(0,i)+o+S.slice(a):S.slice(0,i)+o+S.slice(i)).slice(0,u);if(s.length>0&&P&&!P.test(s))return;r.value=s,_(s);let c=Math.min(s.length,u-1),l=s.length;r.setSelectionRange(c,l),F(c),B(l)}),[u,_,P,S]),$=g.useMemo((()=>({position:"relative",cursor:C.disabled?"default":"text",userSelect:"none",WebkitUserSelect:"none",pointerEvents:"none"})),[C.disabled]),H=g.useMemo((()=>({position:"absolute",inset:0,width:U.willPushPWMBadge?`calc(100% + ${U.PWM_BADGE_SPACE_WIDTH})`:"100%",clipPath:U.willPushPWMBadge?`inset(0 ${U.PWM_BADGE_SPACE_WIDTH} 0 0)`:void 0,height:"100%",display:"flex",textAlign:d,opacity:"1",color:"transparent",pointerEvents:"all",background:"transparent",caretColor:"transparent",border:"0 solid transparent",outline:"0 solid transparent",boxShadow:"none",lineHeight:"1",letterSpacing:"-.5em",fontSize:"var(--root-height)",fontFamily:"monospace",fontVariantNumeric:"tabular-nums"})),[U.PWM_BADGE_SPACE_WIDTH,U.willPushPWMBadge,d]),W=g.useMemo((()=>g.createElement("input",((e,t)=>sB(e,cB(t)))(((e,t)=>{for(var n in t||(t={}))uB.call(t,n)&&fB(e,n,t[n]);if(lB)for(var n of lB(t))dB.call(t,n)&&fB(e,n,t[n]);return e})({autoComplete:C.autoComplete||"one-time-code"},C),{"data-input-otp":!0,"data-input-otp-mss":D,"data-input-otp-mse":j,inputMode:p,pattern:null==P?void 0:P.source,style:H,maxLength:u,value:S,ref:T,onPaste:e=>{var t;z(e),null==(t=C.onPaste)||t.call(C,e)},onChange:q,onMouseOver:e=>{var t;R(!0),null==(t=C.onMouseOver)||t.call(C,e)},onMouseLeave:e=>{var t;R(!1),null==(t=C.onMouseLeave)||t.call(C,e)},onFocus:e=>{var t;V(),null==(t=C.onFocus)||t.call(C,e)},onBlur:e=>{var t;L(!1),null==(t=C.onBlur)||t.call(C,e)}}))),[q,V,z,p,H,u,j,D,C,null==P?void 0:P.source,S]),G=g.useMemo((()=>({slots:Array.from({length:u}).map(((e,t)=>{let n=M&&null!==D&&null!==j&&(D===j&&t===D||t>=D&&t<j),r=void 0!==S[t]?S[t]:null;return{char:r,isActive:n,hasFakeCaret:n&&null===r}})),isFocused:M,isHovering:!C.disabled&&A})),[M,A,u,j,D,C.disabled,S]),K=g.useMemo((()=>b?b(G):g.createElement(mB.Provider,{value:G},w)),[w,G,b]);return g.createElement(g.Fragment,null,null!==y&&g.createElement("noscript",null,g.createElement("style",null,y)),g.createElement("div",{ref:N,"data-input-otp-container":!0,style:$,className:v},K,g.createElement("div",{style:{position:"absolute",inset:0,pointerEvents:"none"}},W)))}));function gB(e,t){try{e.insertRule(t)}catch(e){}}vB.displayName="Input";var yB,bB="\n[data-input-otp] {\n --nojs-bg: white !important;\n --nojs-fg: black !important;\n\n background-color: var(--nojs-bg) !important;\n color: var(--nojs-fg) !important;\n caret-color: var(--nojs-fg) !important;\n letter-spacing: .25em !important;\n text-align: center !important;\n border: 1px solid var(--nojs-fg) !important;\n border-radius: 4px !important;\n width: 100% !important;\n}\n@media (prefers-color-scheme: dark) {\n [data-input-otp] {\n --nojs-bg: black !important;\n --nojs-fg: white !important;\n }\n}",wB=function(){return wB=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},wB.apply(this,arguments)},CB=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},EB=function(){return y().createElement("div",{className:"genauth-g2-otp-input-cursor"})},kB=function(e){return y().createElement("div",{style:e.style,className:iB()("genauth-g2-code-input-item",{focus:e.isActive})},null!==e.char&&y().createElement("div",null,e.char),e.hasFakeCaret&&y().createElement(EB,null))},SB=function(e){var t=e.length,n=void 0===t?4:t,r=(e.size,e.gutter),o=void 0===r?n>4?"14px":"24px":r,i=(e.className,e.onEenter,e.showDivider),a=void 0!==i&&i,s=e.onChange,c=e.value,l=e.onFinish,u=CB(e,["length","size","gutter","className","onEenter","showDivider","onChange","value","onFinish"]);return y().createElement("div",wB({className:"genauth-g2-code-input"},u),y().createElement(vB,{value:c,onChange:s,maxLength:n,onComplete:l,render:function(e){var t=e.slots;return y().createElement("div",{className:"genauth-g2-otp-wrapper"},t.map((function(e,t){return y().createElement(y().Fragment,null,y().createElement(kB,wB({key:t},e,{style:{marginLeft:0===t?0:o}})),a&&t===Math.floor(n/2-1)&&y().createElement(CS,{className:"genauth-g2-code-input-divider"}))})))}}))},xB=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},_B=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},PB=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},TB=y().useRef,NB=function(e){var t=e.mfaToken,n=e.qrcode,r=e.onNext,o=e.changeModule,i=PB(cT.useForm(),1)[0],a=TB(null),s=_u().t,c=UX().post,l=mD(),u=PB(dj((function(){return xB(void 0,void 0,void 0,(function(){var e,n,o,s,u,d,f,p,h,m,v,g;return _B(this,(function(y){switch(y.label){case 0:return null===(p=a.current)||void 0===p||p.onSpin(!0),[4/*yield*/,i.validateFields()];case 1:return y.sent(),e=i.getFieldValue("saftyCode"),l?[4/*yield*/,qj(Fj.VerifyTotpFirstTime,{totp:e})]:[3/*break*/,3];case 2:return n=y.sent(),o=n.statusCode,f=n.onGuardHandling,null===(h=a.current)||void 0===h||h.onSpin(!1),200===o?r():(null===(m=a.current)||void 0===m||m.onError(),null==f||f()),[3/*break*/,5];case 3:return[4/*yield*/,c("/api/v2/mfa/totp/associate/confirm",{authenticator_type:"totp",totp:e,source:"APPLICATION"},{headers:{authorization:t}})];case 4:s=y.sent(),u=s.code,d=s.data,f=s.onGuardHandling,null===(v=a.current)||void 0===v||v.onSpin(!1),200===u?r(d):(null===(g=a.current)||void 0===g||g.onError(),null==f||f()),y.label=5;case 5:return[2/*return*/]}}))}))}),[t]),2),d=u[1];return y().createElement(y().Fragment,null,y().createElement("p",{className:"genauth-g2-mfa-title"},s("user.mfaBind")),y().createElement("p",{className:"genauth-g2-mfa-tips",style:{textAlign:"left"}},s("common.usePhoneOpen"),"(",s("common.noValidator")," ",y().createElement("span",{style:{color:"#2F54EB",cursor:"pointer"},onClick:function(){null==o||o(FD.DOWNLOAD_AT)}},s("common.clickTodownload")),") ",s("common.mfaText1")),y().createElement(Xj,{className:"g2-mfa-bindTotp-qrcode",src:n,alt:"qrcode"}),y().createElement(cT,{className:"g2-mfa-bindTotp-securityCode-form",form:i,onSubmitCapture:function(){},onFinish:d,onFinishFailed:function(){a.current.onError()}},y().createElement(rB,{codeLength:6,name:"saftyCode",ruleKeyword:s("user.numberSafteyCode")},y().createElement(SB,{length:6,showDivider:!1,gutter:"10px",onFinish:d})),y().createElement(Dj,{text:s("user.nextStep"),ref:a})))},OB=function(){return OB=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},OB.apply(this,arguments)};
|
|
27757
27757
|
//# sourceMappingURL=index.mjs.map
|
|
27758
27758
|
OB(OB({},Ac()),{autoRegister:!1});!function(e){e.SMS="SMS",e.EMAIL="EMAIL",e.TOTP="OTP",e.FACE="FACE",e.PASSKEY="PASSKEY"}(yB||(yB={}));// CONCATENATED MODULE: ./src/Back/index.tsx
|
|
27759
27759
|
var IB=y().useCallback,AB=y().useMemo,RB=function(e){var t=pD().changeModule,n=hD(),r=_u().t,o=IB((function(){return null==t?void 0:t(FD.LOGIN)}),[t]),i=e.isRender,a=void 0===i||i,s=AB((function(){if(!a)return null;var e=[FD.LOGIN,FD.REGISTER];
|
|
@@ -27781,20 +27781,20 @@ return e.push(_),
|
|
|
27781
27781
|
// 是否校验重复
|
|
27782
27782
|
(i||s)&&e.push({validator:x,validateTrigger:[]}),e}),[u,S.field,_,i,s,x]);return y().createElement(cT.Item,oU({validateFirst:!0,validateTrigger:["onBlur","onChange"],rules:lU(lU([],cU(P),!1),cU(null!==(r=null==h?void 0:h.rules)&&void 0!==r?r:[]),!1),name:null!=l?l:c,validateStatus:w},h))},pU=cT.Item;pU.Password=function(e){var t,n=e.rules,r=e.fieldRequiredRuleMessage,o=YB(e,["rules","fieldRequiredRuleMessage"]),i=JB(y().useState([]),2),a=i[0],s=i[1],c=iD(),l=uD(),u=c.passwordStrength,d=c.customPasswordStrength,f=l.passwordStrength,p=l.customPasswordStrength,h=l.userId;return(f||p)&&(u=f,d=p),c?y().createElement(cT.Item,KB({validateTrigger:["onChange","onBlur"],validateFirst:!0,name:"password",rules:QB(QB([],JB(null!==(t=c0(u,d,r,h,s))&&void 0!==t?t:[]),!1),JB(null!=n?n:[]),!1)},o,{help:a.length>0?y().createElement(GB,{ruleResults:a}):void 0})):y().createElement(cT.Item,KB({},e))},pU.Email=function(e){return y().createElement(fU,oU({required:!0,method:"email"},e))},pU.Phone=function(e){return y().createElement(fU,oU({required:!0,method:"phone"},e))},pU.UserName=function(e){return y().createElement(fU,oU({required:!0,method:"username"},e))},pU.CustomName=function(e){return y().createElement(fU,oU({required:!0},e))};
|
|
27783
27783
|
/* harmony default export */const hU=pU;// CONCATENATED MODULE: ./src/InputPassword/index.tsx
|
|
27784
|
-
var mU,vU=function(){return vU=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},vU.apply(this,arguments)},gU=function(e){return y().createElement(oN.Password,vU({autoComplete:"off"},e,{iconRender:function(e){return y().createElement("span",{style:{display:"flex",height:"100%",alignItems:"center"}},e?y().createElement(JL,{type:"authing-a-eye-line1"}):y().createElement(JL,{type:"authing-a-eye-close-line1"}))}}))},yU=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},bU=y().useState,wU=function(){var e=_u().t,t=yU(bU(!1),2),n=t[0];return{setPasswordErrorTextShow:t[1],getPassWordUnsafeText:function(){return y().createElement(y().Fragment,null,n?y().createElement("div",{style:{marginBottom:23,fontSize:12,color:"#
|
|
27784
|
+
var mU,vU=function(){return vU=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},vU.apply(this,arguments)},gU=function(e){return y().createElement(oN.Password,vU({autoComplete:"off"},e,{iconRender:function(e){return y().createElement("span",{style:{display:"flex",height:"100%",alignItems:"center"}},e?y().createElement(JL,{type:"authing-a-eye-line1"}):y().createElement(JL,{type:"authing-a-eye-close-line1"}))}}))},yU=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},bU=y().useState,wU=function(){var e=_u().t,t=yU(bU(!1),2),n=t[0];return{setPasswordErrorTextShow:t[1],getPassWordUnsafeText:function(){return y().createElement(y().Fragment,null,n?y().createElement("div",{style:{marginBottom:23,fontSize:12,color:"#DC2626",display:"block"}},e("common.passwordUnsafeTip")):y().createElement(y().Fragment,null))}}},CU=function(){return CU=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},CU.apply(this,arguments)},EU=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},kU=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},SU=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},xU=y().useRef,_U=y().useCallback,PU=function(){var e=_u().t,t=fD(),n=SU(cT.useForm(),1)[0],r=Sj().autoFocus,o=BX().post,i=uD(),a=i.businessRequestName,s=i.content,c=i.isChangeComplete,l=i.onRegisterSuccess,u=i.onRegisterFailed,d=xU(null),f=pD().changeModule,p=iD(),h=p.publicKey,m=p.enableAccountTypeSelect,v=ZD().options.encryptFunction,g=wU(),b=g.getPassWordUnsafeText,w=g.setPasswordErrorTextShow,C=_U((function(e){return EU(void 0,void 0,void 0,(function(){var n,r,i,p,g,y,b,C,E,k,S,x,_,P;return kU(this,(function(T){switch(T.label){case 0:return[4/*yield*/,v(e.password,h)];case 1:return n=T.sent(),null===(E=d.current)||void 0===E||E.onSpin(!0),m?(
|
|
27785
27785
|
// todo 是否开启了区分账号类型
|
|
27786
27786
|
null==f||f(FD.REGISTER_ACCOUNT_TYPE_SELECT,{businessRequestName:a,content:CU(CU({},s),{password:n}),isChangeComplete:c,onRegisterSuccess:l,onRegisterFailed:u}),[2/*return*/]):c?(
|
|
27787
27787
|
// 需要进行信息补全
|
|
27788
|
-
null==f||f(FD.REGISTER_COMPLETE_INFO,{businessRequestName:a,content:CU(CU({},s),{password:n}),onRegisterSuccess:l,onRegisterFailed:u}),[2/*return*/]):[3/*break*/,2];case 2:return T.trys.push([2,7,,8]),"registerByEmailCode"!==a?[3/*break*/,4]:[4/*yield*/,o("/api/v2/register-email-code",CU(CU({},s),{password:n,postUserInfoPipeline:!1}))];case 3:return r=T.sent(),g=r.statusCode,y=r.apiCode,p=r.data,b=r.onGuardHandling,C=r.message,d.current.onSpin(!1),200===g?l(p):(g===pX.UNSAFE_PASSWORD_TIP&&w(!0),null==b||b(),u(y,p,C),null===(k=null==t?void 0:t.onRegisterError)||void 0===k||k.call(t,{code:y,data:p,message:C})),[3/*break*/,6];case 4:return"registerByPhoneCode"!==a?[3/*break*/,6]:[4/*yield*/,o("/api/v2/register-phone-code",CU(CU({},s),{password:n,postUserInfoPipeline:!1}))];case 5:i=T.sent(),p=i.data,g=i.statusCode,y=i.apiCode,b=i.onGuardHandling,C=i.message,200===g?(null===(S=d.current)||void 0===S||S.onSpin(!1),l(p)):(y===pX.UNSAFE_PASSWORD_TIP&&w(!0),null==b||b(),null===(x=d.current)||void 0===x||x.onSpin(!1),u(y,p,C),null===(_=null==t?void 0:t.onRegisterError)||void 0===_||_.call(t,{apiCode:y,data:p,message:C})),T.label=6;case 6:return[3/*break*/,8];case 7:return T.sent(),null===(P=d.current)||void 0===P||P.onSpin(!1),[3/*break*/,8];case 8:return[2/*return*/]}}))}))}),[a,f,s,v,t,c,u,l,o,h,m,w]);return y().createElement("div",{className:"authing-g2-login-phone-code"},y().createElement(cT,{name:"resetPassword",form:n,onFinish:C,onFinishFailed:function(){var e;null===(e=null==d?void 0:d.current)||void 0===e||e.onError()},autoComplete:"off"},y().createElement(hU.Password,{className:"authing-g2-input-form",name:"password",required:!0},y().createElement(gU,{autoFocus:r,className:"authing-g2-input",size:"large",placeholder:e("login.inputPwd"),prefix:y().createElement(JL,{type:"authing-a-lock-line1",style:{color:"#737373"}})})),y().createElement(cT.Item,{validateTrigger:["onBlur","onChange"],className:"authing-g2-input-form",name:"password2",rules:[{validator:function(t,r){var o=n.getFieldValue("password");return r?r!==o?Promise.reject(e("common.repeatPasswordDoc")):Promise.resolve():Promise.reject(e("login.inputPwd"))}}]},y().createElement(gU,{className:"authing-g2-input",size:"large",placeholder:e("login.inputPwdAgain"),prefix:y().createElement(JL,{type:"authing-a-lock-line1",style:{color:"#737373"}})})),b(),y().createElement(cT.Item,{className:"authing-g2-sumbit-form submit-form"},y().createElement(Dj,{className:"forget-password",text:e("common.confirm"),ref:d}))))},TU=function(){return TU=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},TU.apply(this,arguments)},NU=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},OU=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};!function(e){e.ResetPassword="reset-password-first-time",e.FirstLoginReset="reset-password-forced",e.ResetPasswordStrengthDetection="reset-password-strength-detection"}(mU||(mU={}));var IU,AU,RU,MU,LU=function(e,t){return NU(void 0,void 0,void 0,(function(){return OU(this,(function(n){switch(n.label){case 0:return[4/*yield*/,(0,BX().authFlow)(e,TU({},t))];case 1:return[2/*return*/,n.sent()]}}))}))},DU=function(){return DU=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},DU.apply(this,arguments)},FU=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},jU=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},BU=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},UU=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},qU=y().useState,VU=y().useRef,zU=y().useEffect,$U=y().useMemo,HU=function(e){var t,n,r=_u().t,o=e.sendDesc,i=void 0===o?r("login.reSent"):o,a=e.beforeSend,s=e.btnRef,c=e.setSent,l=BU(e,["sendDesc","beforeSend","btnRef","setSent"]),u=null!==(t=su.resolvedLanguage)&&void 0!==t?t:su.language,d=function(e){var t=UU(qU(0),2),n=t[0],r=t[1],o=VU(0);return zU((function(){return function(){return clearInterval(o.current)}}),[]),zU((function(){n<=0?(clearInterval(o.current),null==e||e(!1)):null==e||e(!0)}),[n,e]),{enabled:$U((function(){return n<=0}),[n]),send:function(){r(60),o.current=setInterval((function(){r((function(e){return e-1}))}),1e3)},countDown:n}}(c),f=d.enabled,p=d.send,h=d.countDown,m=UU(qU(!1),2),v=m[0],g=m[1],b=$U((function(){return!f||v}),[f,v]);return y().createElement(ly,DU({},l,{className:"".concat(null!==(n=l.type)&&void 0!==n?n:"authing-g2-send-code-btn g2-loading-btn-center"," ").concat("ja-JP"===u?"send-code-btn-jp":""),disabled:b,loading:v,onClick:function(e){return FU(void 0,void 0,void 0,(function(){return jU(this,(function(e){switch(e.label){case 0:return g(!0),b?[2/*return*/]:[4/*yield*/,a()];case 1:return!e.sent()?(g(!1),[2/*return*/]):(g(!1),p(),[2/*return*/])}}))}))},ref:s}),!0===v&&y().createElement("span",null),!1===v&&y().createElement("span",null,f?i:r("common.retryAfterTime",{time:h})))},WU=function(){return WU=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},WU.apply(this,arguments)},GU=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},KU=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},YU=y().useEffect,JU=y().useState,QU=function(e){return/^[0-9]*$/.test(String(e))},ZU=y().forwardRef((function(e,t){var n=e.onChange,r=e.value,o=GU(e,["onChange","value"]),i=KU(JU(QU(r)?r:""),2),a=i[0],s=i[1];return YU((function(){s(QU(r)?r:"")}),[r]),y().createElement(oN,WU({autoComplete:"off"},o,{ref:t,value:a,type:"tel",pattern:"[0-9]*",onChange:function(e){var t=e.target.value;/^[0-9]*$/.test(t)&&function(e){s(e.target.value),null==n||n(e)}(e)}}))})),XU=function(){return XU=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},XU.apply(this,arguments)},eq=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},tq=function(e){var t,n=e.value,r=e.onChange,o=e.autoSubmit,i=void 0!==o&&o,a=e.form,s=e.beforeSend,c=e.maxLength,l=eq(e,["value","onChange","autoSubmit","form","beforeSend","maxLength"]),u=_u().t,d=null!==(t=su.resolvedLanguage)&&void 0!==t?t:su.language;return y().createElement(y().Fragment,null,y().createElement(FA,{justify:"space-between",align:"middle"},y().createElement(sw,{span:/ja/.test(d)?9:15,className:"g2-send-code-input-col"},y().createElement(ZU,XU({value:n,onChange:function(e){null==r||r(e),i&&c&&e.target.value.length>=c&&(null==a||a.submit())}},l,{maxLength:c}))),y().createElement(sw,{offset:1,span:/ja/.test(d)?14:8},y().createElement(HU,{beforeSend:s,sendDesc:u("common.sendVerifyCode")}))))},nq=function(){return nq=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},nq.apply(this,arguments)},rq=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},oq=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},iq=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},aq=function(e){var t=e.scene,n=e.data,r=e.form,o=e.areaCode,i=e.onSendCodeBefore,a=e.onSendCodeAfter,s=e.fieldName,c=e.isInternationSms,l=void 0!==c&&c,u=e.codeFieldName,d=e.captchaCode,f=e.onSendCodeError,p=iq(e,["scene","data","form","areaCode","onSendCodeBefore","onSendCodeAfter","fieldName","isInternationSms","codeFieldName","captchaCode","onSendCodeError"]),h=_u().t,m=ZD(),v=fD(),g=UX().post,b=function(e,n,r){return rq(void 0,void 0,void 0,(function(){var o,i,a,s,c,l;return oq(this,(function(u){switch(u.label){case 0:return u.trys.push([0,2,,3]),[4/*yield*/,g("/api/v2/sms/send",{phone:e,phoneCountryCode:n,scene:t,captchaCode:r})];case 1:
|
|
27788
|
+
null==f||f(FD.REGISTER_COMPLETE_INFO,{businessRequestName:a,content:CU(CU({},s),{password:n}),onRegisterSuccess:l,onRegisterFailed:u}),[2/*return*/]):[3/*break*/,2];case 2:return T.trys.push([2,7,,8]),"registerByEmailCode"!==a?[3/*break*/,4]:[4/*yield*/,o("/api/v2/register-email-code",CU(CU({},s),{password:n,postUserInfoPipeline:!1}))];case 3:return r=T.sent(),g=r.statusCode,y=r.apiCode,p=r.data,b=r.onGuardHandling,C=r.message,d.current.onSpin(!1),200===g?l(p):(g===pX.UNSAFE_PASSWORD_TIP&&w(!0),null==b||b(),u(y,p,C),null===(k=null==t?void 0:t.onRegisterError)||void 0===k||k.call(t,{code:y,data:p,message:C})),[3/*break*/,6];case 4:return"registerByPhoneCode"!==a?[3/*break*/,6]:[4/*yield*/,o("/api/v2/register-phone-code",CU(CU({},s),{password:n,postUserInfoPipeline:!1}))];case 5:i=T.sent(),p=i.data,g=i.statusCode,y=i.apiCode,b=i.onGuardHandling,C=i.message,200===g?(null===(S=d.current)||void 0===S||S.onSpin(!1),l(p)):(y===pX.UNSAFE_PASSWORD_TIP&&w(!0),null==b||b(),null===(x=d.current)||void 0===x||x.onSpin(!1),u(y,p,C),null===(_=null==t?void 0:t.onRegisterError)||void 0===_||_.call(t,{apiCode:y,data:p,message:C})),T.label=6;case 6:return[3/*break*/,8];case 7:return T.sent(),null===(P=d.current)||void 0===P||P.onSpin(!1),[3/*break*/,8];case 8:return[2/*return*/]}}))}))}),[a,f,s,v,t,c,u,l,o,h,m,w]);return y().createElement("div",{className:"genauth-g2-login-phone-code"},y().createElement(cT,{name:"resetPassword",form:n,onFinish:C,onFinishFailed:function(){var e;null===(e=null==d?void 0:d.current)||void 0===e||e.onError()},autoComplete:"off"},y().createElement(hU.Password,{className:"genauth-g2-input-form",name:"password",required:!0},y().createElement(gU,{autoFocus:r,className:"genauth-g2-input",size:"large",placeholder:e("login.inputPwd"),prefix:y().createElement(JL,{type:"authing-a-lock-line1",style:{color:"#6B7280"}})})),y().createElement(cT.Item,{validateTrigger:["onBlur","onChange"],className:"genauth-g2-input-form",name:"password2",rules:[{validator:function(t,r){var o=n.getFieldValue("password");return r?r!==o?Promise.reject(e("common.repeatPasswordDoc")):Promise.resolve():Promise.reject(e("login.inputPwd"))}}]},y().createElement(gU,{className:"genauth-g2-input",size:"large",placeholder:e("login.inputPwdAgain"),prefix:y().createElement(JL,{type:"authing-a-lock-line1",style:{color:"#6B7280"}})})),b(),y().createElement(cT.Item,{className:"genauth-g2-sumbit-form submit-form"},y().createElement(Dj,{className:"forget-password",text:e("common.confirm"),ref:d}))))},TU=function(){return TU=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},TU.apply(this,arguments)},NU=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},OU=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};!function(e){e.ResetPassword="reset-password-first-time",e.FirstLoginReset="reset-password-forced",e.ResetPasswordStrengthDetection="reset-password-strength-detection"}(mU||(mU={}));var IU,AU,RU,MU,LU=function(e,t){return NU(void 0,void 0,void 0,(function(){return OU(this,(function(n){switch(n.label){case 0:return[4/*yield*/,(0,BX().authFlow)(e,TU({},t))];case 1:return[2/*return*/,n.sent()]}}))}))},DU=function(){return DU=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},DU.apply(this,arguments)},FU=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},jU=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},BU=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},UU=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},qU=y().useState,VU=y().useRef,zU=y().useEffect,$U=y().useMemo,HU=function(e){var t,n,r=_u().t,o=e.sendDesc,i=void 0===o?r("login.reSent"):o,a=e.beforeSend,s=e.btnRef,c=e.setSent,l=BU(e,["sendDesc","beforeSend","btnRef","setSent"]),u=null!==(t=su.resolvedLanguage)&&void 0!==t?t:su.language,d=function(e){var t=UU(qU(0),2),n=t[0],r=t[1],o=VU(0);return zU((function(){return function(){return clearInterval(o.current)}}),[]),zU((function(){n<=0?(clearInterval(o.current),null==e||e(!1)):null==e||e(!0)}),[n,e]),{enabled:$U((function(){return n<=0}),[n]),send:function(){r(60),o.current=setInterval((function(){r((function(e){return e-1}))}),1e3)},countDown:n}}(c),f=d.enabled,p=d.send,h=d.countDown,m=UU(qU(!1),2),v=m[0],g=m[1],b=$U((function(){return!f||v}),[f,v]);return y().createElement(ly,DU({},l,{className:"".concat(null!==(n=l.type)&&void 0!==n?n:"genauth-g2-send-code-btn g2-loading-btn-center"," ").concat("ja-JP"===u?"send-code-btn-jp":""),disabled:b,loading:v,onClick:function(e){return FU(void 0,void 0,void 0,(function(){return jU(this,(function(e){switch(e.label){case 0:return g(!0),b?[2/*return*/]:[4/*yield*/,a()];case 1:return!e.sent()?(g(!1),[2/*return*/]):(g(!1),p(),[2/*return*/])}}))}))},ref:s}),!0===v&&y().createElement("span",null),!1===v&&y().createElement("span",null,f?i:r("common.retryAfterTime",{time:h})))},WU=function(){return WU=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},WU.apply(this,arguments)},GU=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},KU=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},YU=y().useEffect,JU=y().useState,QU=function(e){return/^[0-9]*$/.test(String(e))},ZU=y().forwardRef((function(e,t){var n=e.onChange,r=e.value,o=GU(e,["onChange","value"]),i=KU(JU(QU(r)?r:""),2),a=i[0],s=i[1];return YU((function(){s(QU(r)?r:"")}),[r]),y().createElement(oN,WU({autoComplete:"off"},o,{ref:t,value:a,type:"tel",pattern:"[0-9]*",onChange:function(e){var t=e.target.value;/^[0-9]*$/.test(t)&&function(e){s(e.target.value),null==n||n(e)}(e)}}))})),XU=function(){return XU=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},XU.apply(this,arguments)},eq=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},tq=function(e){var t,n=e.value,r=e.onChange,o=e.autoSubmit,i=void 0!==o&&o,a=e.form,s=e.beforeSend,c=e.maxLength,l=eq(e,["value","onChange","autoSubmit","form","beforeSend","maxLength"]),u=_u().t,d=null!==(t=su.resolvedLanguage)&&void 0!==t?t:su.language;return y().createElement(y().Fragment,null,y().createElement(FA,{justify:"space-between",align:"middle"},y().createElement(sw,{span:/ja/.test(d)?9:15,className:"g2-send-code-input-col"},y().createElement(ZU,XU({value:n,onChange:function(e){null==r||r(e),i&&c&&e.target.value.length>=c&&(null==a||a.submit())}},l,{maxLength:c}))),y().createElement(sw,{offset:1,span:/ja/.test(d)?14:8},y().createElement(HU,{beforeSend:s,sendDesc:u("common.sendVerifyCode")}))))},nq=function(){return nq=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},nq.apply(this,arguments)},rq=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},oq=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},iq=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},aq=function(e){var t=e.scene,n=e.data,r=e.form,o=e.areaCode,i=e.onSendCodeBefore,a=e.onSendCodeAfter,s=e.fieldName,c=e.isInternationSms,l=void 0!==c&&c,u=e.codeFieldName,d=e.captchaCode,f=e.onSendCodeError,p=iq(e,["scene","data","form","areaCode","onSendCodeBefore","onSendCodeAfter","fieldName","isInternationSms","codeFieldName","captchaCode","onSendCodeError"]),h=_u().t,m=ZD(),v=fD(),g=UX().post,b=function(e,n,r){return rq(void 0,void 0,void 0,(function(){var o,i,a,s,c,l;return oq(this,(function(u){switch(u.label){case 0:return u.trys.push([0,2,,3]),[4/*yield*/,g("/api/v2/sms/send",{phone:e,phoneCountryCode:n,scene:t,captchaCode:r})];case 1:
|
|
27789
27789
|
// 200 表示请求成功,不报错
|
|
27790
27790
|
return o=u.sent(),i=o.code,a=o.statusCode,s=o.message,200===a||200===i?[2/*return*/,{status:!0}]:
|
|
27791
27791
|
// 由于使用项目中 post 方法进行请求,外层进行了处理,不会抛错,catch 不会走,在这对 code 进行针对处理
|
|
27792
27792
|
// 'ECONNABORTED' 不知道是不是只有 sdk 报错,所以我在接口这也写了,防止接口也会1报这个错
|
|
27793
27793
|
"ECONNABORTED"===i?(gC.error(h("login.sendCodeTimeout")),[2/*return*/,{status:!1,error:o}]):(
|
|
27794
27794
|
// code 不是 -1、-2 时,并且 msg 存在, 那么进行报错
|
|
27795
|
-
-1!==i&&-2!==i&&s&&gC.error(s),[2/*return*/,{status:!1,error:o}]);case 2:if("ECONNABORTED"===(c=u.sent()).code)return gC.error(h("login.sendCodeTimeout")),[2/*return*/,{status:!1,error:c}];try{l=JSON.parse(c.message),gC.error(l.message)}catch(e){gC.error(c)}return[2/*return*/,{status:!1,error:c}];case 3:return[2/*return*/]}}))}))};return y().createElement(y().Fragment,null,y().createElement(tq,nq({beforeSend:function(){return i().then((function(e){return rq(void 0,void 0,void 0,(function(){var e,i,c,p,h,g,y,w,C,E;return oq(this,(function(k){switch(k.label){case 0:return e=r?r.getFieldValue(s||"phone"):n,i=xj(l,e,o),c=i.phoneNumber,p=i.countryCode,h=r?null==r?void 0:r.getFieldValue(u||"captchaCode"):d,[4/*yield*/,b(c,p,h)];case 1:return g=k.sent(),y=g.status,w=g.error,null==a||a(),y?null===(C=null==v?void 0:v.onPhoneSend)||void 0===C||C.call(v,m,t):(null==f||f(w),null===(E=null==v?void 0:v.onPhoneSendError)||void 0===E||E.call(v,w,m,t)),[2/*return*/,y]}}))}))})).catch((function(e){var n;return null==a||a(),null==f||f(e),null===(n=null==v?void 0:v.onPhoneSendError)||void 0===n||n.call(v,e,m,t),!1}))},form:r},p)))},sq=function(){return sq=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},sq.apply(this,arguments)},cq=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},lq=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},uq=function(e){var t,n,r=_u().t,o=null!==(t=e.publicConfig.verifyCodeLength)&&void 0!==t?t:4,i=(null===(n=e.publicConfig.internationalSmsConfig)||void 0===n?void 0:n.enabled)||!1,a=uD().phone;return y().createElement("div",{className:"authing-g2-login-phone-code"},y().createElement(aq,sq({},e,{isInternationSms:i,className:"authing-g2-input g2-send-code-input",autoComplete:"off",size:"large",placeholder:r("login.resetPassword.inputFourVerifyCode",{length:o}),prefix:y().createElement(JL,{type:"authing-a-shield-check-line1",style:{color:"#737373"}}),scene:Oi.SCENE_TYPE_RESET,maxLength:o,data:a,onSendCodeBefore:function(){return cq(void 0,void 0,void 0,(function(){return lq(this,(function(e){return[2/*return*/]}))}))}})))},dq=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},fq=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},pq=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},hq=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},mq=y().useRef,vq=function(e){var t=e.onReset,n=_u().t,r=uD(),o=mD(),i=iD(),a=i.publicKey,s=pq(cT.useForm(),1)[0],c=ZD(),l=c.options.encryptFunction,u=Sj().autoFocus,d=mq(null),f=wU(),p=f.getPassWordUnsafeText,h=f.setPasswordErrorTextShow;return y().createElement("div",{className:"authing-g2-login-phone-code"},y().createElement(cT,{name:"resetPassword",form:s,onFinish:function(e){return dq(void 0,void 0,void 0,(function(){var n,i,s,u,f,p,m,v,g,y,b,w,C,E;return fq(this,(function(k){switch(k.label){case 0:return n=e.password,null===(y=d.current)||void 0===y||y.onSpin(!0),o?(g={},[4/*yield*/,l(n,a)]):[3/*break*/,3];case 1:return g.password=k.sent(),i=g,e.code&&(i.code=e.code),[4/*yield*/,LU(mU.FirstLoginReset,i)];case 2:return s=k.sent(),u=s.apiCode,f=s.onGuardHandling,p=s.message,null===(b=d.current)||void 0===b||b.onSpin(!1),u===pX.ABORT_FLOW?t():u===pX.UNSAFE_PASSWORD_TIP?(gC.error(p),h(!0)):(null===(w=d.current)||void 0===w||w.onError(),null==f||f()),[3/*break*/,7];case 3:return k.trys.push([3,5,6,7]),[4/*yield*/,c.resetPasswordByFirstLoginToken({token:r.token,password:n})];case 4:return m=k.sent(),t(m),[3/*break*/,7];case 5:return v=k.sent(),gC.error(v.message),null===(C=null==d?void 0:d.current)||void 0===C||C.onError(),[3/*break*/,7];case 6:return null===(E=d.current)||void 0===E||E.onSpin(!1),[7/*endfinally*/];case 7:return[2/*return*/]}}))}))},onFinishFailed:function(){var e;null===(e=null==d?void 0:d.current)||void 0===e||e.onError()},autoComplete:"off"},(null==r?void 0:r.enableFirstLoginResetPasswordVerifyPhone)&&(null==r?void 0:r.phone)&&y().createElement(cT.Item,{validateTrigger:["onBlur","onChange"],className:"authing-g2-input-form",name:"code",rules:hq([],pq(QX(n("common.captchaCode"))),!1)},y().createElement(uq,{publicConfig:i})),y().createElement(hU.Password,{className:"authing-g2-input-form",name:"password",required:!0},y().createElement(gU,{autoFocus:u,className:"authing-g2-input",size:"large",placeholder:n("login.inputNewPwd"),prefix:y().createElement(JL,{type:"authing-a-lock-line1",style:{color:"#737373"}})})),y().createElement(cT.Item,{validateTrigger:["onBlur","onChange"],className:"authing-g2-input-form",name:"password2",rules:[{validator:function(e,t){var r=s.getFieldValue("password");return t?t!==r?Promise.reject(n("common.repeatPasswordDoc")):Promise.resolve():Promise.reject(n("login.inputPwd"))}}]},y().createElement(gU,{className:"authing-g2-input",size:"large",placeholder:n("login.inputPwdAgain"),prefix:y().createElement(JL,{type:"authing-a-lock-line1",style:{color:"#737373"}})})),p(),y().createElement(cT.Item,{className:"authing-g2-sumbit-form submit-form"},y().createElement(Dj,{className:"forget-password",text:n("common.confirm"),ref:d}))))},gq=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},yq=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},bq=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},wq=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},Cq=y().useRef,Eq=function(e){var t=_u().t,n=e.onReset,r=e.onFinishCallBack,o=bq(cT.useForm(),1)[0],i=iD().publicKey,a=ZD(),s=Sj().autoFocus,c=a.options.encryptFunction,l=mD(),u=Cq(null),d=uD(),f=wU(),p=f.getPassWordUnsafeText,h=f.setPasswordErrorTextShow;return y().createElement("div",{className:"authing-g2-login-phone-code"},y().createElement(cT,{name:"resetPassword",form:o,onFinish:function(t){return gq(void 0,void 0,void 0,(function(){var o,s,f,p,m,v,g,y,b,w,C,E,k,S,x,_,P;return yq(this,(function(T){switch(T.label){case 0:return r instanceof Function?[4/*yield*/,r(t)]:[3/*break*/,2];case 1:return(o=T.sent()).code===pX.UNSAFE_PASSWORD_TIP&&(gC.error(o.message),h(!0)),[2/*return*/];case 2:return s=t.password,f=t.oldPassword,null===(k=null==u?void 0:u.current)||void 0===k||k.onSpin(!0),l?(y=LU,b=[mU.ResetPassword],E={},[4/*yield*/,c(s,i)]):[3/*break*/,6];case 3:return E.password=T.sent(),[4/*yield*/,c(f,i)];case 4:return[4/*yield*/,y.apply(void 0,b.concat([(E.oldPassword=T.sent(),E)]))];case 5:return p=T.sent(),m=p.apiCode,v=p.onGuardHandling,g=p.message,null===(S=null==u?void 0:u.current)||void 0===S||S.onSpin(!1),
|
|
27795
|
+
-1!==i&&-2!==i&&s&&gC.error(s),[2/*return*/,{status:!1,error:o}]);case 2:if("ECONNABORTED"===(c=u.sent()).code)return gC.error(h("login.sendCodeTimeout")),[2/*return*/,{status:!1,error:c}];try{l=JSON.parse(c.message),gC.error(l.message)}catch(e){gC.error(c)}return[2/*return*/,{status:!1,error:c}];case 3:return[2/*return*/]}}))}))};return y().createElement(y().Fragment,null,y().createElement(tq,nq({beforeSend:function(){return i().then((function(e){return rq(void 0,void 0,void 0,(function(){var e,i,c,p,h,g,y,w,C,E;return oq(this,(function(k){switch(k.label){case 0:return e=r?r.getFieldValue(s||"phone"):n,i=xj(l,e,o),c=i.phoneNumber,p=i.countryCode,h=r?null==r?void 0:r.getFieldValue(u||"captchaCode"):d,[4/*yield*/,b(c,p,h)];case 1:return g=k.sent(),y=g.status,w=g.error,null==a||a(),y?null===(C=null==v?void 0:v.onPhoneSend)||void 0===C||C.call(v,m,t):(null==f||f(w),null===(E=null==v?void 0:v.onPhoneSendError)||void 0===E||E.call(v,w,m,t)),[2/*return*/,y]}}))}))})).catch((function(e){var n;return null==a||a(),null==f||f(e),null===(n=null==v?void 0:v.onPhoneSendError)||void 0===n||n.call(v,e,m,t),!1}))},form:r},p)))},sq=function(){return sq=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},sq.apply(this,arguments)},cq=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},lq=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},uq=function(e){var t,n,r=_u().t,o=null!==(t=e.publicConfig.verifyCodeLength)&&void 0!==t?t:4,i=(null===(n=e.publicConfig.internationalSmsConfig)||void 0===n?void 0:n.enabled)||!1,a=uD().phone;return y().createElement("div",{className:"genauth-g2-login-phone-code"},y().createElement(aq,sq({},e,{isInternationSms:i,className:"genauth-g2-input g2-send-code-input",autoComplete:"off",size:"large",placeholder:r("login.resetPassword.inputFourVerifyCode",{length:o}),prefix:y().createElement(JL,{type:"authing-a-shield-check-line1",style:{color:"#6B7280"}}),scene:Oi.SCENE_TYPE_RESET,maxLength:o,data:a,onSendCodeBefore:function(){return cq(void 0,void 0,void 0,(function(){return lq(this,(function(e){return[2/*return*/]}))}))}})))},dq=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},fq=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},pq=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},hq=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},mq=y().useRef,vq=function(e){var t=e.onReset,n=_u().t,r=uD(),o=mD(),i=iD(),a=i.publicKey,s=pq(cT.useForm(),1)[0],c=ZD(),l=c.options.encryptFunction,u=Sj().autoFocus,d=mq(null),f=wU(),p=f.getPassWordUnsafeText,h=f.setPasswordErrorTextShow;return y().createElement("div",{className:"genauth-g2-login-phone-code"},y().createElement(cT,{name:"resetPassword",form:s,onFinish:function(e){return dq(void 0,void 0,void 0,(function(){var n,i,s,u,f,p,m,v,g,y,b,w,C,E;return fq(this,(function(k){switch(k.label){case 0:return n=e.password,null===(y=d.current)||void 0===y||y.onSpin(!0),o?(g={},[4/*yield*/,l(n,a)]):[3/*break*/,3];case 1:return g.password=k.sent(),i=g,e.code&&(i.code=e.code),[4/*yield*/,LU(mU.FirstLoginReset,i)];case 2:return s=k.sent(),u=s.apiCode,f=s.onGuardHandling,p=s.message,null===(b=d.current)||void 0===b||b.onSpin(!1),u===pX.ABORT_FLOW?t():u===pX.UNSAFE_PASSWORD_TIP?(gC.error(p),h(!0)):(null===(w=d.current)||void 0===w||w.onError(),null==f||f()),[3/*break*/,7];case 3:return k.trys.push([3,5,6,7]),[4/*yield*/,c.resetPasswordByFirstLoginToken({token:r.token,password:n})];case 4:return m=k.sent(),t(m),[3/*break*/,7];case 5:return v=k.sent(),gC.error(v.message),null===(C=null==d?void 0:d.current)||void 0===C||C.onError(),[3/*break*/,7];case 6:return null===(E=d.current)||void 0===E||E.onSpin(!1),[7/*endfinally*/];case 7:return[2/*return*/]}}))}))},onFinishFailed:function(){var e;null===(e=null==d?void 0:d.current)||void 0===e||e.onError()},autoComplete:"off"},(null==r?void 0:r.enableFirstLoginResetPasswordVerifyPhone)&&(null==r?void 0:r.phone)&&y().createElement(cT.Item,{validateTrigger:["onBlur","onChange"],className:"genauth-g2-input-form",name:"code",rules:hq([],pq(QX(n("common.captchaCode"))),!1)},y().createElement(uq,{publicConfig:i})),y().createElement(hU.Password,{className:"genauth-g2-input-form",name:"password",required:!0},y().createElement(gU,{autoFocus:u,className:"genauth-g2-input",size:"large",placeholder:n("login.inputNewPwd"),prefix:y().createElement(JL,{type:"authing-a-lock-line1",style:{color:"#6B7280"}})})),y().createElement(cT.Item,{validateTrigger:["onBlur","onChange"],className:"genauth-g2-input-form",name:"password2",rules:[{validator:function(e,t){var r=s.getFieldValue("password");return t?t!==r?Promise.reject(n("common.repeatPasswordDoc")):Promise.resolve():Promise.reject(n("login.inputPwd"))}}]},y().createElement(gU,{className:"genauth-g2-input",size:"large",placeholder:n("login.inputPwdAgain"),prefix:y().createElement(JL,{type:"authing-a-lock-line1",style:{color:"#6B7280"}})})),p(),y().createElement(cT.Item,{className:"genauth-g2-sumbit-form submit-form"},y().createElement(Dj,{className:"forget-password",text:n("common.confirm"),ref:d}))))},gq=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},yq=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},bq=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},wq=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},Cq=y().useRef,Eq=function(e){var t=_u().t,n=e.onReset,r=e.onFinishCallBack,o=bq(cT.useForm(),1)[0],i=iD().publicKey,a=ZD(),s=Sj().autoFocus,c=a.options.encryptFunction,l=mD(),u=Cq(null),d=uD(),f=wU(),p=f.getPassWordUnsafeText,h=f.setPasswordErrorTextShow;return y().createElement("div",{className:"genauth-g2-login-phone-code"},y().createElement(cT,{name:"resetPassword",form:o,onFinish:function(t){return gq(void 0,void 0,void 0,(function(){var o,s,f,p,m,v,g,y,b,w,C,E,k,S,x,_,P;return yq(this,(function(T){switch(T.label){case 0:return r instanceof Function?[4/*yield*/,r(t)]:[3/*break*/,2];case 1:return(o=T.sent()).code===pX.UNSAFE_PASSWORD_TIP&&(gC.error(o.message),h(!0)),[2/*return*/];case 2:return s=t.password,f=t.oldPassword,null===(k=null==u?void 0:u.current)||void 0===k||k.onSpin(!0),l?(y=LU,b=[mU.ResetPassword],E={},[4/*yield*/,c(s,i)]):[3/*break*/,6];case 3:return E.password=T.sent(),[4/*yield*/,c(f,i)];case 4:return[4/*yield*/,y.apply(void 0,b.concat([(E.oldPassword=T.sent(),E)]))];case 5:return p=T.sent(),m=p.apiCode,v=p.onGuardHandling,g=p.message,null===(S=null==u?void 0:u.current)||void 0===S||S.onSpin(!1),
|
|
27796
27796
|
// 重置密码 返回的是流程终止
|
|
27797
|
-
m===pX.ABORT_FLOW?n():m===pX.UNSAFE_PASSWORD_TIP?(gC.error(g),h(!0)):(null===(x=null==u?void 0:u.current)||void 0===x||x.onError(),null==v||v()),[3/*break*/,10];case 6:return T.trys.push([6,8,9,10]),[4/*yield*/,a.resetPasswordByForceResetToken({token:d.token,newPassword:s,oldPassword:f})];case 7:return w=T.sent(),e.onReset({code:200,data:w}),[3/*break*/,10];case 8:return C=T.sent(),gC.error(C.message),null===(_=null==u?void 0:u.current)||void 0===_||_.onError(),[3/*break*/,10];case 9:return null===(P=null==u?void 0:u.current)||void 0===P||P.onSpin(!1),[7/*endfinally*/];case 10:return[2/*return*/]}}))}))},onFinishFailed:function(){var e;null===(e=null==u?void 0:u.current)||void 0===e||e.onError()},autoComplete:"off"},y().createElement(cT.Item,{validateTrigger:["onBlur","onChange"],className:"
|
|
27797
|
+
m===pX.ABORT_FLOW?n():m===pX.UNSAFE_PASSWORD_TIP?(gC.error(g),h(!0)):(null===(x=null==u?void 0:u.current)||void 0===x||x.onError(),null==v||v()),[3/*break*/,10];case 6:return T.trys.push([6,8,9,10]),[4/*yield*/,a.resetPasswordByForceResetToken({token:d.token,newPassword:s,oldPassword:f})];case 7:return w=T.sent(),e.onReset({code:200,data:w}),[3/*break*/,10];case 8:return C=T.sent(),gC.error(C.message),null===(_=null==u?void 0:u.current)||void 0===_||_.onError(),[3/*break*/,10];case 9:return null===(P=null==u?void 0:u.current)||void 0===P||P.onSpin(!1),[7/*endfinally*/];case 10:return[2/*return*/]}}))}))},onFinishFailed:function(){var e;null===(e=null==u?void 0:u.current)||void 0===e||e.onError()},autoComplete:"off"},y().createElement(cT.Item,{validateTrigger:["onBlur","onChange"],className:"genauth-g2-input-form",name:"oldPassword",rules:wq([],bq(QX(t("common.password"))),!1)},y().createElement(gU,{autoFocus:s,className:"genauth-g2-input",size:"large",placeholder:t("user.inputCurrPwd"),prefix:y().createElement(JL,{type:"authing-a-lock-line1",style:{color:"#6B7280"}})})),y().createElement(hU.Password,{className:"genauth-g2-input-form",name:"password"},y().createElement(gU,{className:"genauth-g2-input",size:"large",placeholder:t("login.inputNewPwd"),prefix:y().createElement(JL,{type:"authing-a-lock-line1",style:{color:"#6B7280"}})})),y().createElement(hU.Password,{className:"genauth-g2-input-form",name:"password2",rules:[{validator:function(e,n){var r=o.getFieldValue("password");return n?n!==r?Promise.reject(t("common.repeatPasswordDoc")):Promise.resolve():Promise.reject(t("login.inputPwd"))}}]},y().createElement(gU,{className:"genauth-g2-input",size:"large",placeholder:t("login.inputPwdAgain"),prefix:y().createElement(JL,{type:"authing-a-lock-line1",style:{color:"#6B7280"}})})),p(),y().createElement(cT.Item,{className:"genauth-g2-sumbit-form submit-form"},y().createElement(Dj,{className:"forget-password",text:t("common.confirm"),ref:u}))))},kq=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},Sq=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},xq=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},_q=y().useRef,Pq=function(e){var t=e.onReset,n=_u().t,r=uD(),o=mD(),i=iD().publicKey,a=xq(cT.useForm(),1)[0],s=ZD(),c=s.options.encryptFunction,l=Sj().autoFocus,u=_q(null),d=wU(),f=d.getPassWordUnsafeText,p=d.setPasswordErrorTextShow;return y().createElement("div",{className:"genauth-g2-login-phone-code"},y().createElement(cT,{name:"resetPassword",form:a,onFinish:function(e){return kq(void 0,void 0,void 0,(function(){var n,a,l,d,f,h,m,v,g,y,b,w,C,E,k;return Sq(this,(function(S){switch(S.label){case 0:return n=e.password,null===(b=u.current)||void 0===b||b.onSpin(!0),o?(h=LU,m=[mU.ResetPasswordStrengthDetection],y={},[4/*yield*/,c(n,i)]):[3/*break*/,3];case 1:return[4/*yield*/,h.apply(void 0,m.concat([(y.password=S.sent(),y)]))];case 2:return a=S.sent(),l=a.apiCode,d=a.onGuardHandling,f=a.message,null===(w=u.current)||void 0===w||w.onSpin(!1),l===pX.ABORT_FLOW?t():l===pX.UNSAFE_PASSWORD_TIP?(gC.error(f),p(!0)):(null===(C=u.current)||void 0===C||C.onError(),null==d||d()),[3/*break*/,7];case 3:return S.trys.push([3,5,6,7]),[4/*yield*/,s.resetPasswordByFirstLoginToken({token:r.token,password:n})];case 4:return v=S.sent(),t(v),[3/*break*/,7];case 5:return g=S.sent(),gC.error(g.message),null===(E=null==u?void 0:u.current)||void 0===E||E.onError(),[3/*break*/,7];case 6:return null===(k=u.current)||void 0===k||k.onSpin(!1),[7/*endfinally*/];case 7:return[2/*return*/]}}))}))},onFinishFailed:function(){var e;null===(e=null==u?void 0:u.current)||void 0===e||e.onError()},autoComplete:"off"},y().createElement(hU.Password,{className:"genauth-g2-input-form",name:"password",required:!0},y().createElement(gU,{autoFocus:l,className:"genauth-g2-input",size:"large",placeholder:n("login.inputNewPwd"),prefix:y().createElement(JL,{type:"authing-a-lock-line1",style:{color:"#6B7280"}})})),y().createElement(cT.Item,{validateTrigger:["onBlur","onChange"],className:"genauth-g2-input-form",name:"password2",rules:[{validator:function(e,t){var r=a.getFieldValue("password");return t?t!==r?Promise.reject(n("common.repeatPasswordDoc")):Promise.resolve():Promise.reject(n("login.inputPwd"))}}]},y().createElement(gU,{className:"genauth-g2-input",size:"large",placeholder:n("login.inputPwdAgain"),prefix:y().createElement(JL,{type:"authing-a-lock-line1",style:{color:"#6B7280"}})})),f(),y().createElement(cT.Item,{className:"genauth-g2-sumbit-form submit-form"},y().createElement(Dj,{className:"forget-password",text:n("common.confirm"),ref:u}))))},Tq=y().useMemo,Nq=function(e){var t=e.title,n=e.explain,r=e.children,o=e.logo,i=hD(),a=Tq((function(){return{title:t,explain:n}}),[n,t]);return FB(),y().createElement("div",{className:"g2-view-container g2-change-password"},y().createElement("div",{className:"g2-view-header"},y().createElement(Xj,{src:null!=o?o:null==i?void 0:i.logo,size:48,borderRadius:4,alt:"",className:"icon"}),y().createElement("div",{className:"title"},a.title),y().createElement("div",{className:"title-explain"},a.explain)),y().createElement("div",{className:"g2-view-tabs"},r))},Oq=function(){var e=_u().t,t=pD().changeModule,n=hD(),r=y().createElement(vq,{onReset:function(){gC.success(e("common.updatePsswordSuccess")),setTimeout((function(){null==t||t(FD.LOGIN)}),500)}});return y().createElement(Nq,{title:"".concat(e("common.welcome")," ").concat(n.title),explain:e("common.initPasswordText")},r)},Iq=function(){var e=_u().t,t=pD().changeModule,n=hD(),r=y().createElement(Pq,{onReset:function(){gC.success(e("common.updatePsswordSuccess")),setTimeout((function(){null==t||t(FD.LOGIN)}),500)}});return y().createElement(Nq,{title:"".concat(e("common.welcome")," ").concat(n.title),explain:e("common.unsafePasswordChangeText")},r)},Aq=function(){var e,t=_u().t,n=pD().changeModule,r=null!==(e=su.resolvedLanguage)&&void 0!==e?e:su.language,o=iD(),i=y().createElement(Eq,{onReset:function(){gC.success(t("common.updatePsswordSuccess")),setTimeout((function(){null==n||n(FD.LOGIN)}),500)}}),a=Tq((function(){var e,n,i,a,s,c=null===(e=null==o?void 0:o.noticePwdTipsConfig)||void 0===e?void 0:e.title;return null!==(s=(null===(n=null==c?void 0:c.i18n)||void 0===n?void 0:n[r].enabled)?null===(a=null===(i=null==c?void 0:c.i18n)||void 0===i?void 0:i[r])||void 0===a?void 0:a.value:null==c?void 0:c.default)&&void 0!==s?s:t("user.modifyPwd")}),[o,r]),s=Tq((function(){var e,n,i,a,s=null===(e=null==o?void 0:o.noticePwdTipsConfig)||void 0===e?void 0:e.desc,c=(null===(n=null==s?void 0:s.i18n)||void 0===n?void 0:n[r].enabled)?null===(a=null===(i=null==s?void 0:s.i18n)||void 0===i?void 0:i[r])||void 0===a?void 0:a.value:null==s?void 0:s.default;
|
|
27798
27798
|
// if (brandText) {
|
|
27799
27799
|
// brandText = brandText.replaceAll(
|
|
27800
27800
|
// '{time}',
|
|
@@ -27810,9 +27810,9 @@ return y().createElement(lI,{showSearch:!0,popupClassName:"areacode-virtual-drop
|
|
|
27810
27810
|
// 当formValue变化时候
|
|
27811
27811
|
Xq((function(){l(/^[^a-zA-Z]*$/.test(String(o))?o:"")}),[o]);return y().createElement(y().Fragment,null,y().createElement(oN,Jq({autoComplete:"off",pattern:"[^a-zA-Z]*",value:c,placeholder:a("login.inputPhone")},i,{onChange:function(e){var t=e.target.value;/^[^a-zA-Z]*$/.test(t)&&function(e){l(e.target.value),null==r||r(e)}(e)},prefix:y().createElement(Yq,{value:t,onChange:n}),maxLength:20})))},nV=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},rV=y().useState,oV=function(e){var t=e.value,n=e.onChange,r=nV(rV(!1),2),o=r[0],i=r[1],a=_u().t,s=hD().host,c=y().createElement("div",null,y().createElement(zL,null),y().createElement("div",{style:{marginTop:8}},"Upload"));return y().createElement(uL,{name:"file",accept:"image/*",listType:"picture-card",showUploadList:!1,action:"".concat(s,"/api/v2/upload?folder=photos"),onChange:function(e){var t=e.file.status;if(i("uploading"===t),"done"===t){var r=e.file.response,o=r.code,s=r.message,c=r.data;if(200!==o)return gC.error(s);var l=c.url;null==n||n(l)}else"error"===t&&gC.error(a("common.uploadFail",{name:e.file.name}))}},y().createElement(CI,{size:"small",spinning:o},t?y().createElement("img",{src:t,alt:"",style:{width:"100%"}}):c))},iV=function(e,t){return void 0===e&&(e=[]),e.map((function(e){var n;return{type:e.inputType,label:e.label,name:e.name,required:e.required,validateRules:e.validateRules.map((function(e){return{type:e.type,content:e.content,errorMessage:e.errorMessage,i18n:e.i18n}})),options:null===(n=t.find((function(t){return t.key===e.name})))||void 0===n?void 0:n.options}}))},aV=function(e,t){var n=[],r={};return null==t||t.forEach((function(t){var o,i=t.name,a=t.value,s=t.code,c=null===(o=e.find((function(e){return e.name===i})))||void 0===o?void 0:o.type;
|
|
27812
27812
|
// 根据字段类型生成不同的数据结构
|
|
27813
|
-
"internal"===c?("phone"===i&&(r.phoneToken=s),"email"===i&&(r.emailToken=s),r[i]=a):"user"===c&&n.push({key:i,value:a})})),{registerProfile:r,udf:n}},sV=function(e,t){var n,r,o=null!==(n=su.resolvedLanguage)&&void 0!==n?n:su.language,i=null==e?void 0:e[t],a=(null===(r=null==e?void 0:e.i18n)||void 0===r?void 0:r[t])||{},s=null==a?void 0:a[o];return(null==s?void 0:s.enabled)&&(null==s?void 0:s.value)||i},cV=function(){return cV=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},cV.apply(this,arguments)},lV=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},uV=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},dV=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},fV=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},pV=y().useCallback,hV=y().useEffect,mV=y().useMemo,vV=y().useRef,gV=y().useState,yV=bS,bV=function(e,t){return t.props.value.toLowerCase().indexOf(e.toLowerCase())>=0||t.props.label.toLowerCase().indexOf(e.toLowerCase())>=0},wV=function(e){var t,n,r=e.metaData,o=e.businessRequest,i=e.extendsFieldsI18n,a=iD(),s=null==a?void 0:a.verifyCodeLength,c=vV(null),l=dV(gV([]),2),u=l[0],d=l[1],f=(null===(t=null==a?void 0:a.internationalSmsConfig)||void 0===t?void 0:t.enabled)||!1,p=dV(gV((null===(n=null==a?void 0:a.internationalSmsConfig)||void 0===n?void 0:n.defaultISOType)||"CN"),2),h=p[0],m=p[1],v=UX(),g=v.get,b=v.post,w=_u().t,C=dV(cT.useForm(),1)[0],E=pV((function(){return lV(void 0,void 0,void 0,(function(){var e,t,n,r,o,i,a,s,c,l,u;return uV(this,(function(f){switch(f.label){case 0:return[4/*yield*/,g("/api/v2/country-list")];case 1:e=f.sent().data,null!==(u=su.resolvedLanguage)&&void 0!==u?u:su.language,t="zh-CN"===su.resolvedLanguage?null==e?void 0:e.zh:null==e?void 0:e.en,n=[];try{for(r=fV(Object.entries(t)),o=r.next();!o.done;o=r.next())i=dV(o.value,2),a=i[0],s=i[1],n.push({label:s+" (".concat(a,")"),value:a})}catch(e){c={error:e}}finally{try{o&&!o.done&&(l=r.return)&&l.call(r)}finally{if(c)throw c.error}}return d(n),[2/*return*/]}}))}))}),[g]);hV((function(){r.map((function(e){return e.name})).includes("country")&&E()}),[E,r]);var k=pV((function(e){return f?y().createElement(tV,cV({},e,{className:"
|
|
27814
|
-
// className="
|
|
27815
|
-
className:iB()("
|
|
27813
|
+
"internal"===c?("phone"===i&&(r.phoneToken=s),"email"===i&&(r.emailToken=s),r[i]=a):"user"===c&&n.push({key:i,value:a})})),{registerProfile:r,udf:n}},sV=function(e,t){var n,r,o=null!==(n=su.resolvedLanguage)&&void 0!==n?n:su.language,i=null==e?void 0:e[t],a=(null===(r=null==e?void 0:e.i18n)||void 0===r?void 0:r[t])||{},s=null==a?void 0:a[o];return(null==s?void 0:s.enabled)&&(null==s?void 0:s.value)||i},cV=function(){return cV=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},cV.apply(this,arguments)},lV=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},uV=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},dV=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},fV=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},pV=y().useCallback,hV=y().useEffect,mV=y().useMemo,vV=y().useRef,gV=y().useState,yV=bS,bV=function(e,t){return t.props.value.toLowerCase().indexOf(e.toLowerCase())>=0||t.props.label.toLowerCase().indexOf(e.toLowerCase())>=0},wV=function(e){var t,n,r=e.metaData,o=e.businessRequest,i=e.extendsFieldsI18n,a=iD(),s=null==a?void 0:a.verifyCodeLength,c=vV(null),l=dV(gV([]),2),u=l[0],d=l[1],f=(null===(t=null==a?void 0:a.internationalSmsConfig)||void 0===t?void 0:t.enabled)||!1,p=dV(gV((null===(n=null==a?void 0:a.internationalSmsConfig)||void 0===n?void 0:n.defaultISOType)||"CN"),2),h=p[0],m=p[1],v=UX(),g=v.get,b=v.post,w=_u().t,C=dV(cT.useForm(),1)[0],E=pV((function(){return lV(void 0,void 0,void 0,(function(){var e,t,n,r,o,i,a,s,c,l,u;return uV(this,(function(f){switch(f.label){case 0:return[4/*yield*/,g("/api/v2/country-list")];case 1:e=f.sent().data,null!==(u=su.resolvedLanguage)&&void 0!==u?u:su.language,t="zh-CN"===su.resolvedLanguage?null==e?void 0:e.zh:null==e?void 0:e.en,n=[];try{for(r=fV(Object.entries(t)),o=r.next();!o.done;o=r.next())i=dV(o.value,2),a=i[0],s=i[1],n.push({label:s+" (".concat(a,")"),value:a})}catch(e){c={error:e}}finally{try{o&&!o.done&&(l=r.return)&&l.call(r)}finally{if(c)throw c.error}}return d(n),[2/*return*/]}}))}))}),[g]);hV((function(){r.map((function(e){return e.name})).includes("country")&&E()}),[E,r]);var k=pV((function(e){return f?y().createElement(tV,cV({},e,{className:"genauth-g2-input",size:"large",areaCode:h,onAreaCodeChange:function(e){m(e),C.getFieldValue(["internal phone:phone"])&&C.validateFields(["internal phone:phone"])},maxLength:20})):y().createElement(ZU,cV({},e,{className:"genauth-g2-input",autoComplete:"off",key:"internal-phone:phone123",type:"tel",size:"large",maxLength:11,placeholder:w("login.inputPhone")}))}),[h,C,f,w]),S=mV((function(){return{gender:function(e){return y().createElement(lI,{key:e.key,className:iB()("genauth-g2-select","genauth-g2-input"),popupClassName:"genauth-g2-dropdown",options:[{label:su.t("common.man"),value:"M"},{label:su.t("common.female"),value:"F"}]})},country:function(e){return y().createElement(lI,{key:e.key,className:iB()("genauth-g2-select","genauth-g2-input"),popupClassName:"genauth-g2-dropdown",options:u,showSearch:!0,filterOption:bV})},image:function(){return y().createElement(oV,null)},number:function(e){return y().createElement(ZU,{key:e.key,style:{width:"100%"},className:"genauth-g2-input"})},date:function(e){return y().createElement(yV,{key:e.key,className:"genauth-g2-input",style:{width:"100%"},placeholder:su.t("common.pleaseSelectDate")})},datetime:function(e){return y().createElement(yV,{key:e.key,className:"genauth-g2-input",style:{width:"100%"},placeholder:su.t("common.pleaseSelectDate")})},select:function(e){return y().createElement(lI,{key:e.key,className:iB()("genauth-g2-select","genauth-g2-input"),popupClassName:"genauth-g2-dropdown",showSearch:!0,options:e.options,filterOption:bV})},dropdown:function(e){return y().createElement(lI,{key:e.key,className:iB()("genauth-g2-select","genauth-g2-input"),popupClassName:"genauth-g2-dropdown",showSearch:!0,options:e.options,filterOption:bV})},boolean:function(e){return y().createElement(lI,{key:e.key,className:iB()("genauth-g2-select","genauth-g2-input"),popupClassName:"genauth-g2-dropdown",options:[{label:su.t("common.yes"),value:!0},{label:su.t("common.no"),value:!1}]})},string:function(e){return y().createElement(oN,{key:e.key,type:"text",size:"large",className:"genauth-g2-input",autoComplete:"off"})},text:function(e){return y().createElement(oN,{key:e.key,type:"text",size:"large",className:"genauth-g2-input",autoComplete:"off"})},textarea:function(e){return y().createElement(oN.TextArea,{key:e.key,
|
|
27814
|
+
// className="genauth-g2-textarea"
|
|
27815
|
+
className:iB()("genauth-g2-textarea","genauth-g2-input"),maxLength:200,rows:4,style:{marginBottom:10}})}}}),[u]),x=mV((function(){return{username:function(e){var t;return y().createElement(hU.UserName,{validateFirst:!0,className:"genauth-g2-input-form",name:"username",key:e.key,label:null!==(t=e.label)&&void 0!==t?t:su.t("common.username"),required:e.required,checkRepeat:!0},y().createElement(oN,{className:"genauth-g2-input",autoComplete:"username",key:"internal-username:asdf",size:"large",maxLength:11,placeholder:w("login.inputUsername")}))},phone:function(e){var t;return y().createElement(y().Fragment,null,y().createElement(hU.Phone,{validateFirst:!0,className:f?"genauth-g2-input-form remove-padding":"genauth-g2-input-form",name:"phone",key:"internal-phone:phone",label:null!==(t=e.label)&&void 0!==t?t:su.t("common.phoneLabel"),required:e.required,checkRepeat:!0,areaCode:h},y().createElement(k,null)),y().createElement(cT.Item,{validateTrigger:["onBlur","onChange"],className:"genauth-g2-input-form",name:"phoneCode",key:"internal-phone:code",rules:e.required?QX(w("common.captchaCode")):void 0},y().createElement(aq,{isInternationSms:f,areaCode:h,className:"genauth-g2-input g2-send-code-input",autoComplete:"one-time-code",size:"large",placeholder:w("common.inputFourVerifyCode",{length:s}),scene:Oi.SCENE_TYPE_COMPLETE_PHONE,maxLength:s,fieldName:"phone",form:C,onSendCodeBefore:function(){return lV(void 0,void 0,void 0,(function(){return uV(this,(function(e){switch(e.label){case 0:return(null==a?void 0:a.closeCheckSendUser)?[3/*break*/,2]:[4/*yield*/,C.validateFields(["phone"])];case 1:return e.sent(),[3/*break*/,3];case 2:Promise.resolve(!0),e.label=3;case 3:return[2/*return*/]}}))}))}})))},email:function(e){var t;return y().createElement(y().Fragment,null,y().createElement(hU.Email,{className:"genauth-g2-input-form",name:"email",checkRepeat:!0,label:null!==(t=e.label)&&void 0!==t?t:su.t("common.email"),required:e.required,key:"internal email:email13",validateFirst:!0},y().createElement(oN,{className:"genauth-g2-input",autoComplete:"email",size:"large",placeholder:w("login.inputEmail")})),y().createElement(cT.Item,{validateTrigger:["onBlur","onChange"],className:"genauth-g2-input-form",name:"emailCode",key:"internal email:code1432",rules:e.required?QX(w("common.captchaCode")):void 0},y().createElement(Gq,{className:"genauth-g2-input g2-send-code-input",autoComplete:"one-time-code",size:"large",placeholder:w("common.inputFourVerifyCode",{length:s}),maxLength:s,data:"",scene:Nc.INFORMATION_COMPLETION_VERIFY_CODE,fieldName:"email",form:C,onSendCodeBefore:function(){return lV(void 0,void 0,void 0,(function(){return uV(this,(function(e){switch(e.label){case 0:return(null==a?void 0:a.closeCheckSendUser)?[3/*break*/,2]:[4/*yield*/,C.validateFields(["email"])];case 1:return e.sent(),[3/*break*/,3];case 2:Promise.resolve(!0),e.label=3;case 3:return[2/*return*/]}}))}))}})))}}}),[k,h,C,f,w,s]),_=pV((function(e){var t,n,r=null===(t=i||a.extendsFieldsI18n)||void 0===t?void 0:t[e.name],o=y0();return(null===(n=null==r?void 0:r[o])||void 0===n?void 0:n.enabled)&&(null==r?void 0:r[o].value)?null==r?void 0:r[o].value:e.label||e.name}),[a.extendsFieldsI18n,i]),P=pV((function(e){var t,n,r=[],o=_(e),i=null!==(t=e.validateRules)&&void 0!==t?t:[];return null!==(n=e.required)&&void 0!==n&&n&&r.push({required:!0,validateTrigger:"onChange",message:w("login.noEmpty",{label:o})}),
|
|
27816
27816
|
// TODO 后端的 rule Type 有很多 前端目前只做了两种的映射
|
|
27817
27817
|
i.forEach((function(e){switch(e.type){case"isNumber":r.push({type:"number",validateTrigger:"onBlur",message:sV(e,"errorMessage")||e.errorMessage||"请填写数字"});break;case"regExp":r.push({validateTrigger:"onBlur",pattern:new RegExp(e.content.replaceAll("/","")),message:sV(e,"errorMessage")||e.errorMessage})}})),r}),[_,w]),T=pV((function(e){
|
|
27818
27818
|
// const label =
|
|
@@ -27821,15 +27821,15 @@ i.forEach((function(e){switch(e.type){case"isNumber":r.push({type:"number",valid
|
|
|
27821
27821
|
// : metaData.name
|
|
27822
27822
|
var t=_(e);
|
|
27823
27823
|
// 这部分的控件分两种 一个集成控件(手机号 + 验证码)一种是基础控件 分开处理
|
|
27824
|
-
if(Object.values(AU).includes(e.type)||"username"===e.name)return x[e.name]({required:e.required,label:t});var n=function(n){return y().createElement(cT.Item,{validateTrigger:["onBlur","onChange"],className:"
|
|
27824
|
+
if(Object.values(AU).includes(e.type)||"username"===e.name)return x[e.name]({required:e.required,label:t});var n=function(n){return y().createElement(cT.Item,{validateTrigger:["onBlur","onChange"],className:"genauth-g2-input-form",rules:P(e),key:e.name,name:e.name,label:t,style:{marginBottom:8}},n)};
|
|
27825
27825
|
// 国家名和性别的控件需要单独和name匹配
|
|
27826
|
-
return["country","gender"].includes(e.name)?n(S[e.name]({options:e.options,key:e.name})):Object.keys(S).includes(e.type)?n(S[e.type]({options:e.options,key:e.name})):n(y().createElement(oN,{type:"text",className:"
|
|
27826
|
+
return["country","gender"].includes(e.name)?n(S[e.name]({options:e.options,key:e.name})):Object.keys(S).includes(e.type)?n(S[e.type]({options:e.options,key:e.name})):n(y().createElement(oN,{type:"text",className:"genauth-g2-input",autoComplete:"off"}))}),[S,P,_,x]),N=mV((function(){return r.map((function(e){return T(e)}))}),[T,r]),O=dV(dj((function(e){return lV(void 0,void 0,void 0,(function(){var t,n,r,i,a,s,l,u,d,p,m,v,y,C,E;return uV(this,(function(k){switch(k.label){case 0:t=Object.keys(e).filter((function(t){return void 0!==e[t]&&""!==e[t]})),null===(C=c.current)||void 0===C||C.onSpin(!0),n=t.filter((function(e){return!["phoneCode","emailCode"].includes(e)})).map((function(t){var n={name:t,value:e[t]};
|
|
27827
27827
|
// 给这两个字段添加一个验证码
|
|
27828
27828
|
// 国际化短信 需要携带区号
|
|
27829
27829
|
// TODO 默认这里手机号与邮箱 都是有验证码的
|
|
27830
27830
|
if("phone"===t){if(f){var r=xj(f,e[t],h).countryCode;return cV(cV({},n),{code:e.phoneCode,phoneCountryCode:r})}return cV(cV({},n),{code:e.phoneCode})}return"email"===t?cV(cV({},n),{code:e.emailCode}):n})),k.label=1;case 1:return k.trys.push([1,9,10,11]),t.includes("username")?[4/*yield*/,g("/api/v2/users/is-user-exists",{username:e.username})]:[3/*break*/,3];case 2:
|
|
27831
27831
|
// checkResult 为 true 时 代表用户名已存在 直接报message 并且不调用注册接口
|
|
27832
|
-
if(r=k.sent(),i=r.data,200===(p=r.code)&&i)return gC.error(w("common.userNameIsExists")),[2/*return*/];k.label=3;case 3:return t.includes("phone")?(a={phone:e.phone,phoneCode:e.phoneCode},f&&(s=xj(f,e.phone,h).countryCode,a.phoneCountryCode=s),[4/*yield*/,b("/api/v2/sms/preCheckCode",a)]):[3/*break*/,5];case 4:if(l=k.sent(),p=l.statusCode,u=l.data,v=u.valid,y=u.message,200!==p||!v)return gC.error(y),[2/*return*/];k.label=5;case 5:return t.includes("email")?[4/*yield*/,b("/api/v2/email/preCheckCode",{email:e.email,emailCode:e.emailCode})]:[3/*break*/,7];case 6:if(d=k.sent(),p=d.statusCode,m=d.data,v=m.valid,y=m.message,200!==p||!v)return gC.error(y),[2/*return*/];k.label=7;case 7:return[4/*yield*/,null==o?void 0:o({fieldValues:n})];case 8:return k.sent(),[3/*break*/,11];case 9:return k.sent(),[3/*break*/,11];case 10:return null===(E=c.current)||void 0===E||E.onSpin(!1),[7/*endfinally*/];case 11:return[2/*return*/]}}))}))}),[h]),2),I=O[1];return y().createElement(cT,{layout:"vertical",form:C,onFinish:I,onFinishFailed:function(){return c.current.onError()},className:"authing-g2-completeInfo-form authing-g2-form-required-item-icon-after"},N,y().createElement(cT.Item,{className:"authing-g2-sumbit-form"},y().createElement(Dj,{text:w("common.problem.form.submit"),ref:c,className:"password g2-completeInfo-submit"})))},CV=function(){return CV=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},CV.apply(this,arguments)},EV=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},kV=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};!function(e){e.Complete="complete-completion",e.Skip="skip-completion"}(Vq||(Vq={}));var SV,xV=function(e,t){return EV(void 0,void 0,void 0,(function(){return kV(this,(function(n){switch(n.label){case 0:return[4/*yield*/,(0,BX().authFlow)(e,t)];case 1:return[2/*return*/,n.sent()]}}))}))},_V=function(e,t,n){var r,o,i=BX().post;if("registerByEmail"===e){var a=n.phoneToken;return delete n.phoneToken,i("/api/v2/register-email",CV(CV({},t),{profile:CV(CV({},t.profile),n),phoneToken:a,postUserInfoPipeline:!0}))}if("registerByPhoneCode"===e){var s=null==n?void 0:n.emailToken;return null==n||delete n.emailToken,i("/api/v2/register-phone-code",CV(CV({},t),{profile:CV(CV({},t.profile),n),emailToken:s,postUserInfoPipeline:!0}))}if("registerByEmailCode"===e){a=n.phoneToken;return delete n.phoneToken,i("/api/v2/register-email-code",CV(CV({},t),{profile:CV(CV({},t.profile),n),phoneToken:a,postUserInfoPipeline:!0}))}a=null!==(r=n.phoneToken)&&void 0!==r?r:null==t?void 0:t.phoneToken,s=null!==(o=n.emailToken)&&void 0!==o?o:null==t?void 0:t.emailToken;return delete n.phoneToken,delete n.emailToken,i("/api/v2/register-".concat(e.split("-")[0]),CV(CV({},t),{profile:CV(CV({},t.profile),n),postUserInfoPipeline:!0,phoneToken:a,emailToken:s}))},PV=function(e,t){var n=BX().post;return n("registerByEmail"===e?"/api/v2/register-email":"registerByPhoneCode"===e?"/api/v2/register-phone-code":"registerByEmailCode"===e?"/api/v2/register-email-code":"/api/v2/register-".concat(e.split("-")[0]),t)},TV=function(e,t,n,r){return EV(void 0,void 0,void 0,(function(){return kV(this,(function(o){switch(o.label){case 0:return e!==Vq.Skip?[3/*break*/,2]:[4/*yield*/,PV(t,n)];case 1:case 3:return[2/*return*/,o.sent()];case 2:return e!==Vq.Complete?[3/*break*/,4]:[4/*yield*/,_V(t,n,r)];case 4:return[2/*return*/]}}))}))},NV=function(){return NV=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},NV.apply(this,arguments)},OV=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},IV=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},AV=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},RV=y().useCallback,MV=y().useEffect,LV=y().useMemo,DV=y().useState,FV=function(e){var t=e.metaData,n=e.businessRequest,r=e.skipComplateFileds;FB();var o=hD(),i=_u().t,a=oD().spinChange,s=AV(DV(!1),2),c=s[0],l=s[1];return y().createElement("div",{className:"g2-view-container g2-complete-info"},y().createElement("div",{className:"g2-view-header"},y().createElement("div",{className:"g2-completeInfo-header"},y().createElement(Xj,{src:null==o?void 0:o.logo,size:48,borderRadius:4,alt:"",className:"icon"}),r&&y().createElement(Nj,{className:"g2-completeInfo-header-skip",type:"link",loading:c,onClick:function(){return OV(void 0,void 0,void 0,(function(){return IV(this,(function(e){switch(e.label){case 0:return a(!0),l(!0),[4/*yield*/,n(Vq.Skip)];case 1:return e.sent(),l(!1),a(!1),[2/*return*/]}}))}))}},!c&&y().createElement(JL,{type:"authing-a-share-forward-line1"}),y().createElement("span",null,i("common.skip")))),y().createElement("div",{className:"title"},i("common.perfectUserInfo")),y().createElement("div",{className:"title-explain"},i("common.welcomeDoc",{name:o.title}))),y().createElement("div",{className:"g2-view-tabs g2-completeInfo-content"},y().createElement(wV,{metaData:t,businessRequest:function(e){return OV(void 0,void 0,void 0,(function(){return IV(this,(function(t){switch(t.label){case 0:return[4/*yield*/,null==n?void 0:n(Vq.Complete,e)];case 1:return[2/*return*/,t.sent()]}}))}))}})))},jV=function(){var e=uD(),t=e.metaData,n=e.skip,r=fD(),o=ZD(),i=vD().instance;return y().createElement(FV,{metaData:t,businessRequest:function(e,t){return OV(void 0,void 0,void 0,(function(){var n,a,s,c,l,u,d;return IV(this,(function(f){switch(f.label){case 0:return[4/*yield*/,xV(e,t)];case 1:return n=f.sent(),a=n.isFlowEnd,s=n.data,c=n.onGuardHandling,l=null==i?void 0:i.getOriginAccount(),u="password"===(null==i?void 0:i.getOriginWay())?null==i?void 0:i.setLoginWayByHttpData:null==i?void 0:i.setLoginWayByLDAPData,s&&i&&l&&u(l,s),a?null===(d=null==r?void 0:r.onLogin)||void 0===d||d.call(r,s,o):null==c||c(),[2/*return*/]}}))}))},skipComplateFileds:n})},BV=function(){var e=uD(),t=iD(),n=fD(),r=ZD(),o=aD().get,i=hD(),a=AV(DV(),2),s=a[0],c=a[1],l=AV(DV(),2),u=l[0],d=l[1],f=LV((function(){return null==t?void 0:t.extendsFields.filter((function(t){return t.name!==MU[e.businessRequestName]}))}),[e.businessRequestName,null==t?void 0:t.extendsFields]),p=null==t?void 0:t.skipComplateFileds,h=LV((function(){return i.loadingComponent}),[i.loadingComponent]),m=RV((function(){return OV(void 0,void 0,void 0,(function(){var e;return IV(this,(function(t){switch(t.label){case 0:return[4/*yield*/,o("/api/v2/udfs/field-metadata-for-completion",void 0,{})];case 1:return e=t.sent().data,c(e),[2/*return*/]}}))}))}),[o]);return MV((function(){m()}),[m]),MV((function(){if(s){var e=iV(f,s);d(e)}}),[f,s]),y().createElement(y().Fragment,null,u?y().createElement(FV,{metaData:u,skipComplateFileds:p,businessRequest:function(t,o){return OV(void 0,void 0,void 0,(function(){var i,a,s,c,l,u,d,p,h,m,v,g,y;return IV(this,(function(b){switch(b.label){case 0:return i=aV(f,null==o?void 0:o.fieldValues),a=i.registerProfile,s=i.udf,c=NV(NV({},e.content),{params:JSON.stringify(JSON.parse((null===(h=e.content)||void 0===h?void 0:h.params)?null===(m=e.content)||void 0===m?void 0:m.params:"[]").concat(s))}),[4/*yield*/,TV(t,e.businessRequestName,c,a)];case 1:return 200===(l=b.sent()).statusCode?(e.onRegisterSuccess(l.data),null===(v=null==n?void 0:n.onRegisterInfoCompleted)||void 0===v||v.call(n,l.data,c,r)):(null===(g=null==l?void 0:l.onGuardHandling)||void 0===g||g.call(l),u=l.apiCode,d=l.message,p=l.data,e.onRegisterFailed(u,p,d),null===(y=null==n?void 0:n.onRegisterInfoCompletedError)||void 0===y||y.call(n,{code:u,message:d},c,r)),[2/*return*/]}}))}))}}):h)},UV=y().useMemo;!function(e){e.IOS="ios",e.Android="Android"}(SV||(SV={}));var qV,VV=function(){FB();var e=_u().t,t=iD(),n=pD().backModule,r=null==t?void 0:t.cdnBase,o=UV((function(){var t;return(t={})[SV.IOS]={title:e("common.downloadTotpAppIOS"),google:"".concat(r,"/GoogleAuthenticator-Apple.png"),microsoft:"".concat(r,"/MicrosoftAuthenticator-Apple.png")},t[SV.Android]={title:e("common.downloadTotpAppAndroid"),google:"".concat(r,"/GoogleAuthenticator-Authing.png"),microsoft:"".concat(r,"/MicrosoftAuthenticator-Baidu.png")},t}),[r,e]),i=UV((function(){return Object.keys(o).map((function(t,n){return y().createElement(xR.TabPane,{tab:o[t].title,key:n,className:"g2-mfa-download-at-tab"},y().createElement("span",{className:"g2-mfa-totp-download-subtitle"},e("common.downloadTotpAppDocs")),y().createElement("div",{className:"g2-mfa-totp-download-qrcode"},y().createElement("div",{className:"g2-mfa-totp-download-qrcode-item"},y().createElement(Xj,{width:120,height:120,className:"g2-mfa-totp-download-image",src:o[t].google,alt:"Google Authenticator"}),y().createElement("span",{className:"g2-mfa-totp-download-qrcode-text"},"Google Authenticator")),y().createElement("div",{className:"g2-mfa-totp-download-qrcode-item"},y().createElement(Xj,{width:120,height:120,className:"g2-mfa-totp-download-image",src:o[t].microsoft,alt:"Microsoft Authenticator"}),y().createElement("span",{className:"g2-mfa-totp-download-qrcode-text"},"Microsoft Authenticator"))))}))}),[o,e]),a=UV((function(){return y().createElement(MB,{onBack:function(){return null==n?void 0:n()}},e("common.backToMFA"))}),[n,e]);return y().createElement("div",{className:"g2-view-container g2-download-authenticator"},a,y().createElement("div",{className:"g2-view-tabs g2-mfa-totp-download-tabs"},y().createElement(xR,{defaultActiveKey:SV.IOS},i)))},zV=y().useMemo,$V=function(e){var t=uD();FB();var n=zV((function(){var n,r,o=null!==(n=null==e?void 0:e.error)&&void 0!==n?n:null==t?void 0:t.error;return null!==(r="".concat(null==o?void 0:o.message))&&void 0!==r?r:"".concat(su.t("user.contactAdministrator"))}),[null==t?void 0:t.error,null==e?void 0:e.error]);return y().createElement("div",{className:"g2-view-container g2-view-error"},y().createElement("div",{className:"g2-error-content"},y().createElement("div",{style:{display:"flex",justifyContent:"center"}},y().createElement("div",{style:{width:240,height:160,backgroundImage:"url(https://authing-files.oss-cn-zhangjiakou.aliyuncs.com/authing-guard/authing_error.svg)",backgroundSize:"contain"}})),y().createElement("div",{className:"g2-error-message"},su.t("user.error")),y().createElement("span",{className:"g2-error-message-text",dangerouslySetInnerHTML:{__html:n}})))},HV=function(){return HV=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},HV.apply(this,arguments)},WV=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},GV=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},KV=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},YV=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},JV=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},QV=y().useMemo,ZV=y().useState,XV={"phone-code":"phone","email-code":"email"},ez=function(e){var t,n=e.methods,r=e.areaCode,o=void 0===r?"CN":r,i=e.currentMethod,a=e.checkRepeat,s=e.checkExist,c=KV(e,["methods","areaCode","currentMethod","checkRepeat","checkExist"]),l=iD(),u=_u().t,d=YV(ZV(),2),f=d[0],p=d[1],h=aD().get,m=gD(),v=(null===(t=l.internationalSmsConfig)||void 0===t?void 0:t.enabled)&&"phone-code"===i,g=QV((function(){return"email-code"===i?{field:u("common.emailLabel"),checkRepeatErrorMessage:u("common.checkEmail"),checkExistErrorMessage:u("common.noFindEmail"),formatErrorMessage:u("login.inputCorrectPhone"),delayFindErrorMessage:u("common.emailorcodeError"),pattern:YX.email}:{field:u("common.phone"),checkRepeatErrorMessage:u("common.checkPhone"),checkExistErrorMessage:u("common.noFindPhone"),formatErrorMessage:u("login.inputCorrectPhone"),delayFindErrorMessage:u("common.phoneorcodeError"),pattern:m||YX.phone}}),[i,m,u]),b=rU((function(e,t,n){var r=e;"phone-code"===i&&v&&(r=xj(v,r,o).phoneNumber);h("/api/v2/users/find",{userPoolId:null==l?void 0:l.userPoolId,key:r,type:XV[i]}).then((function(e){var r=e.data;s&&(Boolean(r)?t(!0):
|
|
27832
|
+
if(r=k.sent(),i=r.data,200===(p=r.code)&&i)return gC.error(w("common.userNameIsExists")),[2/*return*/];k.label=3;case 3:return t.includes("phone")?(a={phone:e.phone,phoneCode:e.phoneCode},f&&(s=xj(f,e.phone,h).countryCode,a.phoneCountryCode=s),[4/*yield*/,b("/api/v2/sms/preCheckCode",a)]):[3/*break*/,5];case 4:if(l=k.sent(),p=l.statusCode,u=l.data,v=u.valid,y=u.message,200!==p||!v)return gC.error(y),[2/*return*/];k.label=5;case 5:return t.includes("email")?[4/*yield*/,b("/api/v2/email/preCheckCode",{email:e.email,emailCode:e.emailCode})]:[3/*break*/,7];case 6:if(d=k.sent(),p=d.statusCode,m=d.data,v=m.valid,y=m.message,200!==p||!v)return gC.error(y),[2/*return*/];k.label=7;case 7:return[4/*yield*/,null==o?void 0:o({fieldValues:n})];case 8:return k.sent(),[3/*break*/,11];case 9:return k.sent(),[3/*break*/,11];case 10:return null===(E=c.current)||void 0===E||E.onSpin(!1),[7/*endfinally*/];case 11:return[2/*return*/]}}))}))}),[h]),2),I=O[1];return y().createElement(cT,{layout:"vertical",form:C,onFinish:I,onFinishFailed:function(){return c.current.onError()},className:"genauth-g2-completeInfo-form genauth-g2-form-required-item-icon-after"},N,y().createElement(cT.Item,{className:"genauth-g2-sumbit-form"},y().createElement(Dj,{text:w("common.problem.form.submit"),ref:c,className:"password g2-completeInfo-submit"})))},CV=function(){return CV=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},CV.apply(this,arguments)},EV=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},kV=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};!function(e){e.Complete="complete-completion",e.Skip="skip-completion"}(Vq||(Vq={}));var SV,xV=function(e,t){return EV(void 0,void 0,void 0,(function(){return kV(this,(function(n){switch(n.label){case 0:return[4/*yield*/,(0,BX().authFlow)(e,t)];case 1:return[2/*return*/,n.sent()]}}))}))},_V=function(e,t,n){var r,o,i=BX().post;if("registerByEmail"===e){var a=n.phoneToken;return delete n.phoneToken,i("/api/v2/register-email",CV(CV({},t),{profile:CV(CV({},t.profile),n),phoneToken:a,postUserInfoPipeline:!0}))}if("registerByPhoneCode"===e){var s=null==n?void 0:n.emailToken;return null==n||delete n.emailToken,i("/api/v2/register-phone-code",CV(CV({},t),{profile:CV(CV({},t.profile),n),emailToken:s,postUserInfoPipeline:!0}))}if("registerByEmailCode"===e){a=n.phoneToken;return delete n.phoneToken,i("/api/v2/register-email-code",CV(CV({},t),{profile:CV(CV({},t.profile),n),phoneToken:a,postUserInfoPipeline:!0}))}a=null!==(r=n.phoneToken)&&void 0!==r?r:null==t?void 0:t.phoneToken,s=null!==(o=n.emailToken)&&void 0!==o?o:null==t?void 0:t.emailToken;return delete n.phoneToken,delete n.emailToken,i("/api/v2/register-".concat(e.split("-")[0]),CV(CV({},t),{profile:CV(CV({},t.profile),n),postUserInfoPipeline:!0,phoneToken:a,emailToken:s}))},PV=function(e,t){var n=BX().post;return n("registerByEmail"===e?"/api/v2/register-email":"registerByPhoneCode"===e?"/api/v2/register-phone-code":"registerByEmailCode"===e?"/api/v2/register-email-code":"/api/v2/register-".concat(e.split("-")[0]),t)},TV=function(e,t,n,r){return EV(void 0,void 0,void 0,(function(){return kV(this,(function(o){switch(o.label){case 0:return e!==Vq.Skip?[3/*break*/,2]:[4/*yield*/,PV(t,n)];case 1:case 3:return[2/*return*/,o.sent()];case 2:return e!==Vq.Complete?[3/*break*/,4]:[4/*yield*/,_V(t,n,r)];case 4:return[2/*return*/]}}))}))},NV=function(){return NV=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},NV.apply(this,arguments)},OV=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},IV=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},AV=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},RV=y().useCallback,MV=y().useEffect,LV=y().useMemo,DV=y().useState,FV=function(e){var t=e.metaData,n=e.businessRequest,r=e.skipComplateFileds;FB();var o=hD(),i=_u().t,a=oD().spinChange,s=AV(DV(!1),2),c=s[0],l=s[1];return y().createElement("div",{className:"g2-view-container g2-complete-info"},y().createElement("div",{className:"g2-view-header"},y().createElement("div",{className:"g2-completeInfo-header"},y().createElement(Xj,{src:null==o?void 0:o.logo,size:48,borderRadius:4,alt:"",className:"icon"}),r&&y().createElement(Nj,{className:"g2-completeInfo-header-skip",type:"link",loading:c,onClick:function(){return OV(void 0,void 0,void 0,(function(){return IV(this,(function(e){switch(e.label){case 0:return a(!0),l(!0),[4/*yield*/,n(Vq.Skip)];case 1:return e.sent(),l(!1),a(!1),[2/*return*/]}}))}))}},!c&&y().createElement(JL,{type:"authing-a-share-forward-line1"}),y().createElement("span",null,i("common.skip")))),y().createElement("div",{className:"title"},i("common.perfectUserInfo")),y().createElement("div",{className:"title-explain"},i("common.welcomeDoc",{name:o.title}))),y().createElement("div",{className:"g2-view-tabs g2-completeInfo-content"},y().createElement(wV,{metaData:t,businessRequest:function(e){return OV(void 0,void 0,void 0,(function(){return IV(this,(function(t){switch(t.label){case 0:return[4/*yield*/,null==n?void 0:n(Vq.Complete,e)];case 1:return[2/*return*/,t.sent()]}}))}))}})))},jV=function(){var e=uD(),t=e.metaData,n=e.skip,r=fD(),o=ZD(),i=vD().instance;return y().createElement(FV,{metaData:t,businessRequest:function(e,t){return OV(void 0,void 0,void 0,(function(){var n,a,s,c,l,u,d;return IV(this,(function(f){switch(f.label){case 0:return[4/*yield*/,xV(e,t)];case 1:return n=f.sent(),a=n.isFlowEnd,s=n.data,c=n.onGuardHandling,l=null==i?void 0:i.getOriginAccount(),u="password"===(null==i?void 0:i.getOriginWay())?null==i?void 0:i.setLoginWayByHttpData:null==i?void 0:i.setLoginWayByLDAPData,s&&i&&l&&u(l,s),a?null===(d=null==r?void 0:r.onLogin)||void 0===d||d.call(r,s,o):null==c||c(),[2/*return*/]}}))}))},skipComplateFileds:n})},BV=function(){var e=uD(),t=iD(),n=fD(),r=ZD(),o=aD().get,i=hD(),a=AV(DV(),2),s=a[0],c=a[1],l=AV(DV(),2),u=l[0],d=l[1],f=LV((function(){return null==t?void 0:t.extendsFields.filter((function(t){return t.name!==MU[e.businessRequestName]}))}),[e.businessRequestName,null==t?void 0:t.extendsFields]),p=null==t?void 0:t.skipComplateFileds,h=LV((function(){return i.loadingComponent}),[i.loadingComponent]),m=RV((function(){return OV(void 0,void 0,void 0,(function(){var e;return IV(this,(function(t){switch(t.label){case 0:return[4/*yield*/,o("/api/v2/udfs/field-metadata-for-completion",void 0,{})];case 1:return e=t.sent().data,c(e),[2/*return*/]}}))}))}),[o]);return MV((function(){m()}),[m]),MV((function(){if(s){var e=iV(f,s);d(e)}}),[f,s]),y().createElement(y().Fragment,null,u?y().createElement(FV,{metaData:u,skipComplateFileds:p,businessRequest:function(t,o){return OV(void 0,void 0,void 0,(function(){var i,a,s,c,l,u,d,p,h,m,v,g,y;return IV(this,(function(b){switch(b.label){case 0:return i=aV(f,null==o?void 0:o.fieldValues),a=i.registerProfile,s=i.udf,c=NV(NV({},e.content),{params:JSON.stringify(JSON.parse((null===(h=e.content)||void 0===h?void 0:h.params)?null===(m=e.content)||void 0===m?void 0:m.params:"[]").concat(s))}),[4/*yield*/,TV(t,e.businessRequestName,c,a)];case 1:return 200===(l=b.sent()).statusCode?(e.onRegisterSuccess(l.data),null===(v=null==n?void 0:n.onRegisterInfoCompleted)||void 0===v||v.call(n,l.data,c,r)):(null===(g=null==l?void 0:l.onGuardHandling)||void 0===g||g.call(l),u=l.apiCode,d=l.message,p=l.data,e.onRegisterFailed(u,p,d),null===(y=null==n?void 0:n.onRegisterInfoCompletedError)||void 0===y||y.call(n,{code:u,message:d},c,r)),[2/*return*/]}}))}))}}):h)},UV=y().useMemo;!function(e){e.IOS="ios",e.Android="Android"}(SV||(SV={}));var qV,VV=function(){FB();var e=_u().t,t=iD(),n=pD().backModule,r=null==t?void 0:t.cdnBase,o=UV((function(){var t;return(t={})[SV.IOS]={title:e("common.downloadTotpAppIOS"),google:"".concat(r,"/GoogleAuthenticator-Apple.png"),microsoft:"".concat(r,"/MicrosoftAuthenticator-Apple.png")},t[SV.Android]={title:e("common.downloadTotpAppAndroid"),google:"".concat(r,"/GoogleAuthenticator-Authing.png"),microsoft:"".concat(r,"/MicrosoftAuthenticator-Baidu.png")},t}),[r,e]),i=UV((function(){return Object.keys(o).map((function(t,n){return y().createElement(xR.TabPane,{tab:o[t].title,key:n,className:"g2-mfa-download-at-tab"},y().createElement("span",{className:"g2-mfa-totp-download-subtitle"},e("common.downloadTotpAppDocs")),y().createElement("div",{className:"g2-mfa-totp-download-qrcode"},y().createElement("div",{className:"g2-mfa-totp-download-qrcode-item"},y().createElement(Xj,{width:120,height:120,className:"g2-mfa-totp-download-image",src:o[t].google,alt:"Google Authenticator"}),y().createElement("span",{className:"g2-mfa-totp-download-qrcode-text"},"Google Authenticator")),y().createElement("div",{className:"g2-mfa-totp-download-qrcode-item"},y().createElement(Xj,{width:120,height:120,className:"g2-mfa-totp-download-image",src:o[t].microsoft,alt:"Microsoft Authenticator"}),y().createElement("span",{className:"g2-mfa-totp-download-qrcode-text"},"Microsoft Authenticator"))))}))}),[o,e]),a=UV((function(){return y().createElement(MB,{onBack:function(){return null==n?void 0:n()}},e("common.backToMFA"))}),[n,e]);return y().createElement("div",{className:"g2-view-container g2-download-authenticator"},a,y().createElement("div",{className:"g2-view-tabs g2-mfa-totp-download-tabs"},y().createElement(xR,{defaultActiveKey:SV.IOS},i)))},zV=y().useMemo,$V=function(e){var t=uD();FB();var n=zV((function(){var n,r,o=null!==(n=null==e?void 0:e.error)&&void 0!==n?n:null==t?void 0:t.error;return null!==(r="".concat(null==o?void 0:o.message))&&void 0!==r?r:"".concat(su.t("user.contactAdministrator"))}),[null==t?void 0:t.error,null==e?void 0:e.error]);return y().createElement("div",{className:"g2-view-container g2-view-error"},y().createElement("div",{className:"g2-error-content"},y().createElement("div",{style:{display:"flex",justifyContent:"center"}},y().createElement("div",{style:{width:240,height:160,backgroundImage:"url(https://authing-files.oss-cn-zhangjiakou.aliyuncs.com/authing-guard/authing_error.svg)",backgroundSize:"contain"}})),y().createElement("div",{className:"g2-error-message"},su.t("user.error")),y().createElement("span",{className:"g2-error-message-text",dangerouslySetInnerHTML:{__html:n}})))},HV=function(){return HV=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},HV.apply(this,arguments)},WV=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},GV=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},KV=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},YV=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},JV=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},QV=y().useMemo,ZV=y().useState,XV={"phone-code":"phone","email-code":"email"},ez=function(e){var t,n=e.methods,r=e.areaCode,o=void 0===r?"CN":r,i=e.currentMethod,a=e.checkRepeat,s=e.checkExist,c=KV(e,["methods","areaCode","currentMethod","checkRepeat","checkExist"]),l=iD(),u=_u().t,d=YV(ZV(),2),f=d[0],p=d[1],h=aD().get,m=gD(),v=(null===(t=l.internationalSmsConfig)||void 0===t?void 0:t.enabled)&&"phone-code"===i,g=QV((function(){return"email-code"===i?{field:u("common.emailLabel"),checkRepeatErrorMessage:u("common.checkEmail"),checkExistErrorMessage:u("common.noFindEmail"),formatErrorMessage:u("login.inputCorrectPhone"),delayFindErrorMessage:u("common.emailorcodeError"),pattern:YX.email}:{field:u("common.phone"),checkRepeatErrorMessage:u("common.checkPhone"),checkExistErrorMessage:u("common.noFindPhone"),formatErrorMessage:u("login.inputCorrectPhone"),delayFindErrorMessage:u("common.phoneorcodeError"),pattern:m||YX.phone}}),[i,m,u]),b=rU((function(e,t,n){var r=e;"phone-code"===i&&v&&(r=xj(v,r,o).phoneNumber);h("/api/v2/users/find",{userPoolId:null==l?void 0:l.userPoolId,key:r,type:XV[i]}).then((function(e){var r=e.data;s&&(Boolean(r)?t(!0):
|
|
27833
27833
|
// 对该场景 主要是阻止表单 onfinish 执行 但不要触发 form error
|
|
27834
27834
|
(null==l?void 0:l.closeCheckSendUser)?(p("validating"),gC.error(g.delayFindErrorMessage)):n(g.checkExistErrorMessage)),a&&(Boolean(r)?(null==l?void 0:l.closeCheckSendUser)?(p("validating"),gC.error(g.delayFindErrorMessage)):n(g.checkRepeatErrorMessage):t(!0))})).finally((function(){p(void 0)}))})),w=QV((function(){return v?{validateTrigger:"onBlur",validator:function(e,t){return WV(void 0,void 0,void 0,(function(){return GV(this,(function(e){return!t||(0,hj.phone)(t,{country:o}).isValid||(0,hj.phone)(t).isValid?[2/*return*/,Promise.resolve()]:[2/*return*/,Promise.reject(u("common.i18nCheckErrorMessage"))]}))}))}}:{validateTrigger:"onBlur",pattern:g.pattern,message:g.formatErrorMessage}}),[o,v,g.formatErrorMessage,g.pattern,u]),C=QV((function(){
|
|
27835
27835
|
// 如果不是必填就不校验
|
|
@@ -27838,9 +27838,9 @@ var e=JV([],YV(QX(u("common.phoneOrEmail"))),!1);
|
|
|
27838
27838
|
// 格式校验
|
|
27839
27839
|
return e.push(w),
|
|
27840
27840
|
// 是否校验重复
|
|
27841
|
-
(a||s)&&e.push({validator:b,validateTrigger:[]}),e}),[u,w,a,s,b]),E=QV((function(){if(1!==n.length)return y().createElement(cT.Item,HV({validateTrigger:["onBlur","onChange"],validateFirst:!0,rules:C,validateStatus:f},c));switch(i){case"phone-code":return y().createElement(hU.Phone,HV({},c,{validateStatus:f,areaCode:o,checkRepeat:a,checkExist:s}));case"email-code":return y().createElement(hU.Email,HV({},c,{validateStatus:f,checkRepeat:a,checkExist:s}))}}),[o,s,a,i,c,n.length,C]);return y().createElement(y().Fragment,null,E)},tz=function(){return tz=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},tz.apply(this,arguments)},nz=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},rz=y().useMemo,oz=function(e){var t,n=e.methods,r=nz(e,["methods"]),o=iD(),i=_u().t,a=rz((function(){var e;return{"email-code":{t:i("common.email"),sort:2},"phone-code":{t:(null===(e=null==o?void 0:o.internationalSmsConfig)||void 0===e?void 0:e.enabled)?i("common.areaCodePhone"):i("common.phoneNumber"),sort:1}}}),[o,i]),s=rz((function(){var e;return(null===(e=null==o?void 0:o.internationalSmsConfig)||void 0===e?void 0:e.enabled)?i("login.inputAccount",{text:null==n?void 0:n.map((function(e){return a[e]})).sort((function(e,t){return e.sort-t.sort})).map((function(e){return e.t})).map((function(e,t){return 0===t?"「".concat(e,"」"):e})).join(" / ")}):i("login.inputAccount",{text:null==n?void 0:n.map((function(e){return a[e]})).sort((function(e,t){return e.sort-t.sort})).map((function(e){return e.t})).join(" / ")})}),[n,i,a,null===(t=null==o?void 0:o.internationalSmsConfig)||void 0===t?void 0:t.enabled]),c=rz((function(){return 1===n.length&&"phone-code"===n[0]?y().createElement(ZU,tz({maxLength:11,placeholder:s},r)):y().createElement(oN,tz({maxLength:50,placeholder:s},r,{prefix:y().createElement(JL,{type:"authing-a-user-line1",style:{color:"#
|
|
27841
|
+
(a||s)&&e.push({validator:b,validateTrigger:[]}),e}),[u,w,a,s,b]),E=QV((function(){if(1!==n.length)return y().createElement(cT.Item,HV({validateTrigger:["onBlur","onChange"],validateFirst:!0,rules:C,validateStatus:f},c));switch(i){case"phone-code":return y().createElement(hU.Phone,HV({},c,{validateStatus:f,areaCode:o,checkRepeat:a,checkExist:s}));case"email-code":return y().createElement(hU.Email,HV({},c,{validateStatus:f,checkRepeat:a,checkExist:s}))}}),[o,s,a,i,c,n.length,C]);return y().createElement(y().Fragment,null,E)},tz=function(){return tz=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},tz.apply(this,arguments)},nz=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},rz=y().useMemo,oz=function(e){var t,n=e.methods,r=nz(e,["methods"]),o=iD(),i=_u().t,a=rz((function(){var e;return{"email-code":{t:i("common.email"),sort:2},"phone-code":{t:(null===(e=null==o?void 0:o.internationalSmsConfig)||void 0===e?void 0:e.enabled)?i("common.areaCodePhone"):i("common.phoneNumber"),sort:1}}}),[o,i]),s=rz((function(){var e;return(null===(e=null==o?void 0:o.internationalSmsConfig)||void 0===e?void 0:e.enabled)?i("login.inputAccount",{text:null==n?void 0:n.map((function(e){return a[e]})).sort((function(e,t){return e.sort-t.sort})).map((function(e){return e.t})).map((function(e,t){return 0===t?"「".concat(e,"」"):e})).join(" / ")}):i("login.inputAccount",{text:null==n?void 0:n.map((function(e){return a[e]})).sort((function(e,t){return e.sort-t.sort})).map((function(e){return e.t})).join(" / ")})}),[n,i,a,null===(t=null==o?void 0:o.internationalSmsConfig)||void 0===t?void 0:t.enabled]),c=rz((function(){return 1===n.length&&"phone-code"===n[0]?y().createElement(ZU,tz({maxLength:11,placeholder:s},r)):y().createElement(oN,tz({maxLength:50,placeholder:s},r,{prefix:y().createElement(JL,{type:"authing-a-user-line1",style:{color:"#6B7280"}})}))}),[r,n,s]);return y().createElement(y().Fragment,null,c)},iz=function(){return iz=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},iz.apply(this,arguments)},az=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},sz=function(e){var t=e.verifyCodeUrl,n=e.changeCode,r=az(e,["verifyCodeUrl","changeCode"]),o=_u().t;return y().createElement("div",{className:"g2-graphic-verify-code"},y().createElement(oN,iz({},r)),y().createElement(eB,{className:"g2-captcha-code-image",src:t,alt:o("login.captchaCode"),height:"46px",width:"134px",style:{cursor:"pointer"},onClick:function(){return n()}}))},cz=function(){return cz=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},cz.apply(this,arguments)},lz=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},uz=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},dz=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},fz=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},pz=y().useCallback,hz=y().useRef,mz=y().useState,vz=y().useEffect,gz=y().useMemo;!function(e){e.email="email-code",e.phone="phone-code"}(qV||(qV={}));var yz=function(e){var t,n,r=hD(),o=_u().t,i=dz(cT.useForm(),1)[0],a=dz(mz(""),2),s=a[0],c=a[1],l=hz(null),u=Sj().autoFocus,d=BX().post,f=wD("forget-password"),p=CD("forget-password"),h=dz(mz(""),2),m=h[0],v=h[1],g=dz(mz(""),2),b=g[0],w=g[1],C=iD(),E=gz((function(){switch(null==C?void 0:C.resetPwdSelectEmailPhone){case"email":return["email-code"];case"phone":return["phone-code"];default:return["email-code","phone-code"]}}),[null==C?void 0:C.resetPwdSelectEmailPhone]),k=gz((function(){return 1===E.length&&"email-code"===E[0]?"email":"phone"}),[E]),S=dz(mz(k),2),x=S[0],_=S[1],P=null!==(t=e.publicConfig.verifyCodeLength)&&void 0!==t?t:4,T=(null===(n=e.publicConfig.internationalSmsConfig)||void 0===n?void 0:n.enabled)||!1,N=pz((function(e){return y().createElement(y().Fragment,null,"phone"===x&&y().createElement(aq,cz({},e,{isInternationSms:T,className:"genauth-g2-input g2-send-code-input",autoComplete:"off",size:"large",placeholder:o("login.resetPassword.inputFourVerifyCode",{length:P}),prefix:y().createElement(JL,{type:"authing-a-shield-check-line1",style:{color:"#6B7280"}}),captchaCode:b,scene:Oi.SCENE_TYPE_RESET,maxLength:P,data:s,onSendCodeBefore:function(){return lz(void 0,void 0,void 0,(function(){return uz(this,(function(e){switch(e.label){case 0:return(null==C?void 0:C.closeCheckSendUser)?[3/*break*/,2]:[4/*yield*/,i.validateFields(["identify"])];case 1:e.sent(),e.label=2;case 2:return[4/*yield*/,i.validateFields(["captchaCode"])];case 3:return e.sent(),[2/*return*/]}}))}))},onSendCodeError:function(){v(n$(r.host))}})),"email"===x&&y().createElement(Gq,cz({},e,{className:"genauth-g2-input g2-send-code-input",autoComplete:"off",size:"large",placeholder:o("login.resetPassword.inputFourVerifyCode",{length:P}),prefix:y().createElement(JL,{type:"authing-a-shield-check-line1",style:{color:"#6B7280"}}),scene:Nc.RESET_PASSWORD_VERIFY_CODE,captchaCode:b,maxLength:P,data:s,onSendCodeBefore:function(){return lz(void 0,void 0,void 0,(function(){return uz(this,(function(e){switch(e.label){case 0:return(null==C?void 0:C.closeCheckSendUser)?[3/*break*/,2]:[4/*yield*/,i.validateFields(["identify"])];case 1:e.sent(),e.label=2;case 2:return[4/*yield*/,i.validateFields(["captchaCode"])];case 3:return e.sent(),[2/*return*/]}}))}))},onSendCodeError:function(){v(n$(r.host))}})))}),[x,i,s,T,o,P,b]);return vz((function(){_(k)}),[k]),vz((function(){
|
|
27842
27842
|
// 方法发生变化时,图像验证码数据应该清空
|
|
27843
|
-
(f||p)&&(null==i||i.setFieldsValue({captchaCode:void 0}))}),[i,x,f,p]),vz((function(){(f||p)&&v(n$(r.host))}),[f,p,null==r?void 0:r.host]),y().createElement("div",{className:"
|
|
27843
|
+
(f||p)&&(null==i||i.setFieldsValue({captchaCode:void 0}))}),[i,x,f,p]),vz((function(){(f||p)&&v(n$(r.host))}),[f,p,null==r?void 0:r.host]),y().createElement("div",{className:"genauth-g2-login-phone-code"},y().createElement(cT,{name:"rePassword",form:i,onFinish:function(t){return lz(void 0,void 0,void 0,(function(){var n,o,i,a,s,c,u;return uz(this,(function(h){return null===(u=l.current)||void 0===u||u.onSpin(!0),n=t.identify,o=t.code,i=new Promise((function(){})),
|
|
27844
27844
|
// const newPassword = await authClient.options?.encryptFunction?.(
|
|
27845
27845
|
// tempPassword,
|
|
27846
27846
|
// publicKey
|
|
@@ -27858,7 +27858,7 @@ return("phone"===x&&f||"email"===x&&p)&&v(n$(r.host)),void gC.error(null==t?void
|
|
|
27858
27858
|
200===m&&(e.setPhoneOrEmailText(n),e.setPolicyStrength(g),(null===(u=null===(c=null==t?void 0:t.data)||void 0===c?void 0:c.customPasswordStrength)||void 0===u?void 0:u.enabled)&&e.setCustomPasswordStrength(y),e.setControlShow(!1),e.setResetToken(null===(d=null==t?void 0:t.data)||void 0===d?void 0:d.resetPasswordToken),e.setUserId(null===(h=null==t?void 0:t.data)||void 0===h?void 0:h.userId))})).catch((function(e){
|
|
27859
27859
|
// submitButtonRef.current.onError()
|
|
27860
27860
|
// props.onSendError(codeMethod, e)
|
|
27861
|
-
gC.error(e.message)})),[2/*return*/]}))}))},onFinishFailed:function(){var e;null===(e=null==l?void 0:l.current)||void 0===e||e.onError()},autoComplete:"off"},y().createElement(ez,{name:"identify",className:"
|
|
27861
|
+
gC.error(e.message)})),[2/*return*/]}))}))},onFinishFailed:function(){var e;null===(e=null==l?void 0:l.current)||void 0===e||e.onError()},autoComplete:"off"},y().createElement(ez,{name:"identify",className:"genauth-g2-input-form",methods:E,currentMethod:qV[x],checkExist:!0},y().createElement(oz,{methods:E,className:"genauth-g2-input",autoComplete:"off",autoFocus:u,size:"large",value:s,onChange:function(e){var t=e.target.value;c(t),1===E.length?_(k):JX("email",t)?_("email"):_("phone")},prefix:y().createElement(JL,{type:"authing-a-user-line1",style:{color:"#6B7280"}})})),(f&&"phone"===x||"email"===x&&p)&&y().createElement(cT.Item,{className:"genauth-g2-input-form",validateTrigger:["onBlur","onChange"],name:"captchaCode",rules:QX(o("common.captchaCode"))},y().createElement(sz,{className:"genauth-g2-input",size:"large",placeholder:o("login.inputCaptchaCode"),verifyCodeUrl:m,changeCode:function(){return v(n$(r.host))},onChange:function(e){w(e.target.value)}})),y().createElement(cT.Item,{validateTrigger:["onBlur","onChange"],className:"genauth-g2-input-form-sendCode",name:"code",rules:fz([],dz(QX(o("common.captchaCode"))),!1)},y().createElement(N,null)),y().createElement(cT.Item,{className:"genauth-g2-sumbit-form submit-form"},y().createElement(Dj,{className:"validater-account-btn",text:o("login.resetPassword.nextStep"),ref:l}))))},bz=function(){return bz=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},bz.apply(this,arguments)},wz=y().forwardRef((function(e,t){return y().createElement(oN.Password,bz({autoComplete:"off",ref:t},e,{iconRender:function(e){return y().createElement("span",{style:{display:"flex",height:"100%",alignItems:"center"}},e?y().createElement(JL,{type:"authing-authing-eye-fill",style:{color:"#3A3A3C"}}):y().createElement(JL,{type:"authing-authing-eye-off-fill",style:{color:"#9CA3AF"}}))},maxLength:35}))})),Cz=function(){return Cz=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Cz.apply(this,arguments)},Ez=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},kz=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},Sz=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},xz=y().useRef,_z=y().useState,Pz=y().useMemo,Tz=y().useEffect,Nz=function(){var e,t,n=_u().t,r=fD(),o=iD(),i=uD(),a=ZD(),s=hD(),c=null!==(e=su.resolvedLanguage)&&void 0!==e?e:su.language;FB();var l=(null==o?void 0:o.resetPwdCustomLogo)||(null==s?void 0:s.logo),u=pD().changeModule,d=Sz(_z(!0),2),f=d[0],p=d[1],h=Sz(_z(0),2),m=h[0],v=h[1],g=Sz(_z([]),2),b=g[0],w=g[1],C=Sz(_z({}),2),E=C[0],k=C[1],S=Sz(_z(""),2),x=S[0],_=S[1],P=wU(),T=P.getPassWordUnsafeText,N=P.setPasswordErrorTextShow,O=Sz(_z(""),2),I=O[0],A=O[1],R=Sz(_z(""),2),M=R[0],L=R[1],D=null!==(null==s?void 0:s.goBack),F=null!==(t=null==s?void 0:s.goBack)&&void 0!==t?t:function(){return null==u?void 0:u(FD.LOGIN)},j=Sz(cT.useForm(),1)[0],B=BX().post,U=xz(null);Tz((function(){var e,t,n,r,o,a;i&&(A(null!==(e=i.resetPasswordToken)&&void 0!==e?e:""),L(null!==(t=i.userId)&&void 0!==t?t:""),p(null===(n=i.controlShow)||void 0===n||n),_(null!==(r=i.phoneOrEmailText)&&void 0!==r?r:""),v(null!==(o=i.policyStrength)&&void 0!==o?o:0),k(null!==(a=i.customPasswordStrength)&&void 0!==a?a:{}))}),[i]);var q,V=Pz((function(){var e,t,r,i,a,s=null===(e=null==o?void 0:o.resetPwdTipsConfig)||void 0===e?void 0:e.title;return null!==(a=(null===(t=null==s?void 0:s.i18n)||void 0===t?void 0:t[c].enabled)?null===(i=null===(r=null==s?void 0:s.i18n)||void 0===r?void 0:r[c])||void 0===i?void 0:i.value:null==s?void 0:s.default)&&void 0!==a?a:n("login.resetPwd")}),[o,c]),z=Pz((function(){var e,t,r,i,a,s=null===(e=null==o?void 0:o.resetPwdTipsConfig)||void 0===e?void 0:e.desc;return null!==(a=(null===(t=null==s?void 0:s.i18n)||void 0===t?void 0:t[c].enabled)?null===(i=null===(r=null==s?void 0:s.i18n)||void 0===r?void 0:r[c])||void 0===i?void 0:i.value:null==s?void 0:s.default)&&void 0!==a?a:n("login.resetPassword.resetPasswordText1",{text:n("common.phoneOrEmail")})}),[o,c,n]);return f?y().createElement("div",{className:"g2-view-container g2-forget-password g2-password-reset-pageWrap g2-password-reset-step1"},y().createElement("div",{className:"g2-view-header"},y().createElement(Xj,{src:l,size:48,borderRadius:4,alt:"",className:"icon"}),y().createElement("div",{className:"title"},V),y().createElement("div",{className:"title-explain"},z)),y().createElement("div",{className:"g2-view-tabs"},y().createElement(yz,{
|
|
27862
27862
|
// onReset={onReset}
|
|
27863
27863
|
publicConfig:o,setControlShow:p,setPolicyStrength:v,setCustomPasswordStrength:k,setPhoneOrEmailText:_,setResetToken:A,setUserId:L})),D&&y().createElement("div",{className:"g2-tips-line"},y().createElement("div",{className:"link-like back-to-login",onClick:F},n("login.resetPassword.back")))):y().createElement("div",{className:"g2-view-container g2-forget-password g2-password-reset-pageWrap g2-password-reset-step2"},y().createElement("div",{className:"g2-view-header"},y().createElement(Xj,{src:l,size:48,borderRadius:4,alt:"",className:"icon"}),y().createElement("div",{className:"title"},V),x&&y().createElement("div",{className:"title-explain"},n("login.resetPassword.resetPasswordText2",{account:x}))),y().createElement("div",{className:"g2-view-tabs"},y().createElement(cT,{name:"resetPassword",form:j,onFinish:function(){return Ez(void 0,void 0,void 0,(function(){var e,t,i,s,c,l,d,f;return kz(this,(function(p){switch(p.label){case 0:return null===(s=U.current)||void 0===s||s.onSpin(!0),e=j.getFieldsValue(),[4/*yield*/,null===(l=null===(c=a.options)||void 0===c?void 0:c.encryptFunction)||void 0===l?void 0:l.call(c,e.password,o.publicKey)];case 1:return t=p.sent(),[4/*yield*/,null===(f=null===(d=a.options)||void 0===d?void 0:d.encryptFunction)||void 0===f?void 0:f.call(d,e.repeatPassword,o.publicKey)];case 2:return i=p.sent(),B("/api/v2/users/password/password-reset",{newPassword:t,repeatPassword:i,
|
|
27864
27864
|
// ...phoneOrEmail, // 不用传 phone 和 email 了
|
|
@@ -27866,12 +27866,12 @@ resetPasswordToken:I}).then((function(e){var t,o,i;null===(t=U.current)||void 0=
|
|
|
27866
27866
|
// 返回登录
|
|
27867
27867
|
var c={title:n("common.resetSuccess"),message:n("common.resetSuccessMessage"),needBack:D,goBack:F};null==u||u(FD.New_SUBMIT_SUCCESS,Cz({},c))})).catch((function(e){var t;U.current.onError(),
|
|
27868
27868
|
// props.onSendError(codeMethod, e)
|
|
27869
|
-
null===(t=null==r?void 0:r.onPwdResetError)||void 0===t||t.call(r,e,a),gC.error(e.message)})),[2/*return*/]}}))}))},onFinishFailed:function(){var e;null===(e=null==U?void 0:U.current)||void 0===e||e.onError()},autoComplete:"off"},y().createElement(cT.Item,{className:"
|
|
27869
|
+
null===(t=null==r?void 0:r.onPwdResetError)||void 0===t||t.call(r,e,a),gC.error(e.message)})),[2/*return*/]}}))}))},onFinishFailed:function(){var e;null===(e=null==U?void 0:U.current)||void 0===e||e.onError()},autoComplete:"off"},y().createElement(cT.Item,{className:"genauth-g2-input-form",name:"password",rules:(q=[r0.NoCheck,r0.Low,r0.Middle,r0.High,r0.AUTO,r0.Custom],l0(q[m],E,"onChange",n("login.resetPassword.pleaseInputPassword"),M,w)),help:b.length>0?y().createElement(GB,{ruleResults:b}):void 0},y().createElement(wz,{className:"genauth-g2-input",size:"large",placeholder:n("login.resetPassword.inputNewPwd"),prefix:y().createElement(JL,{type:"authing-a-lock-line1",style:{color:"#6B7280",marginBottom:2}})})),y().createElement(cT.Item,{className:"genauth-g2-input-form",name:"repeatPassword",validateFirst:!0,rules:[{required:!0,message:n("login.resetPassword.pleaseInputPassword")},function(e){var t=e.getFieldValue;return{validator:function(e,r){var o=t("password");return void 0===o&&void 0===r||o===r?Promise.resolve():Promise.reject(n("login.resetPassword.checkPasswordDiff"))}}}]},y().createElement(wz,{className:"genauth-g2-input",size:"large",placeholder:n("login.resetPassword.confirmNewPwd"),prefix:y().createElement(JL,{type:"authing-a-lock-line1",style:{color:"#6B7280",marginBottom:2}})})),T(),y().createElement(cT.Item,{className:"genauth-g2-sumbit-form submit-form"},y().createElement(Dj,{className:"reset-password-button",text:n("login.resetPassword.reset"),ref:U})))),!(null==i?void 0:i.noBack)&&y().createElement("div",{className:"g2-tips-line"},y().createElement("div",{className:"link-like back-to-login",onClick:function(){return p(!0)}},n("login.resetPassword.back"))))},Oz=i(1766),Iz=i.n(Oz),Az=function(){return Az=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Az.apply(this,arguments)},Rz=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},Mz=y().useMemo,Lz=function(e){var t=e.validPasswordLoginMethods,n=Rz(e,["validPasswordLoginMethods"]),r=_u().t,o=Mz((function(){if(1!==t.length)return y().createElement(cT.Item,Az({validateTrigger:["onBlur","onChange"],rules:QX(r("common.account"))},n));switch(t[0]){case"phone-password":return y().createElement(hU.Phone,Az({},n,{isCheckPattern:!1}));case"email-password":return y().createElement(hU.Email,Az({},n))}return y().createElement(hU.UserName,Az({},n))}),[n,t,r]);return y().createElement(y().Fragment,null,o)},Dz=function(){return Dz=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Dz.apply(this,arguments)},Fz=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},jz=y().useMemo,Bz=function(e){var t=e.passwordLoginMethods,n=e.placeholder,r=Fz(e,["passwordLoginMethods","placeholder"]),o=jz((function(){return 1===t.length&&"phone-password"===t[0]?y().createElement(ZU,Dz({maxLength:20,placeholder:n},r)):y().createElement(oN,Dz({placeholder:n},r))}),[r,t,n]);return y().createElement(y().Fragment,null,o)},Uz=y().useEffect;// CONCATENATED MODULE: ./src/Register/components/Agreements/index.tsx
|
|
27870
27870
|
var qz=function(){return qz=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},qz.apply(this,arguments)},Vz=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},zz=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},$z=y().useState,Hz=y().useMemo,Wz=y().useEffect,Gz=function(e){var t=e.showError,n=e.onChange,r=void 0===n?function(){}:n,o=e.style,i=e.agreements,a=Vz($z([]),2),s=a[0],c=a[1];!function(e){var t=e.agreements,n=e.checkedAgreements,r={agreements:t,checkedAgreements:n,checkAllAgreements:e.checkAllAgreements,unCheckAllAgreements:e.unCheckAllAgreements};Uz((function(){window.$$guard=Object.assign({},window.$$guard,{agreementsContext:r})}),[t,n])}({agreements:i,checkedAgreements:s,checkAllAgreements:function(){var e=i.map((function(e){return e.id}));c(e)},unCheckAllAgreements:function(){c([])}});
|
|
27871
27871
|
/** 是否可以注册 */
|
|
27872
27872
|
var l=Hz((function(){
|
|
27873
27873
|
/** 所有必须勾选的都勾了就可以通过 */
|
|
27874
|
-
return i.filter((function(e){return e.required})).every((function(e){return s.includes(e.id)}))}),[s,i]);return Wz((function(){r(l,s)}),[l,r,s]),y().createElement("div",{className:n0(["
|
|
27874
|
+
return i.filter((function(e){return e.required})).every((function(e){return s.includes(e.id)}))}),[s,i]);return Wz((function(){r(l,s)}),[l,r,s]),y().createElement("div",{className:n0(["genauth-agreements",t&&"genauth-agreements-error"])},i.map((function(e){return y().createElement("div",{key:e.id,style:qz({},o),className:n0(["genauth-agreements-item",e.required&&!s.includes(e.id)&&"genauth-agreements-item-invalid"]),onClick:function(t){t.persist(),"A"!==t.target.nodeName&&function(e){c((function(t){return t.includes(e)?t.filter((function(t){return t!==e})):zz(zz([],Vz(t),!1),[e],!1)}))}(e.id)}},y().createElement(mP,{align:"start",size:5},y().createElement(tw,{className:"genauth-agreements-checkbox",checked:s.includes(e.id)}),y().createElement("div",{className:"genauth-agreements-item-content",dangerouslySetInnerHTML:{__html:e.title}})))})))},Kz=i(4917),Yz=y().useEffect,Jz=y().useCallback,Qz=y().useRef,Zz=y().useLayoutEffect;function Xz(e,t){if(!e)return!1;var n=(0,Kz.castArray)(t);return e.filter(Boolean).some((function(e){return n.includes(e)}))}
|
|
27875
27875
|
/**
|
|
27876
27876
|
* 登录账号选择时:账户 & 登录方式自动回填
|
|
27877
27877
|
* oidc 时:login_hint 回填账号
|
|
@@ -27915,7 +27915,7 @@ if(null==L?void 0:L.autoRegister){
|
|
|
27915
27915
|
// 密码 placeholder
|
|
27916
27916
|
var e=s$([],a$(l),!1);return O("login.inputAccount",{text:C0(e,ue,D)})}
|
|
27917
27917
|
// 登录注册分页
|
|
27918
|
-
return O("login.inputAccount",{text:C0(s$([],a$(l),!1),ue,D)})}),[null==L?void 0:L.autoRegister,I,ue,D,l,O]);return y().createElement("div",{className:"
|
|
27918
|
+
return O("login.inputAccount",{text:C0(s$([],a$(l),!1),ue,D)})}),[null==L?void 0:L.autoRegister,I,ue,D,l,O]);return y().createElement("div",{className:"genauth-g2-login-password"},y().createElement(cT,{name:"passworLogin",onFinish:function(t){return o$(void 0,void 0,void 0,(function(){var o,i,a,s,c,l,u,f,v;return i$(this,(function(g){switch(g.label){case 0:return T(!0),(null==r?void 0:r.length)&&!E?(j.current.onError(),[2/*return*/]):(G(0),J(!1),
|
|
27919
27919
|
// onBeforeLogin
|
|
27920
27920
|
null===(l=null==j?void 0:j.current)||void 0===l||l.onSpin(!0),o={type:Vs.Password,data:{identity:t.account,password:t.password,captchaCode:t.captchaCode}},[4/*yield*/,null===(u=e.onBeforeLogin)||void 0===u?void 0:u.call(e,o)]);case 1:if(!g.sent()&&e.onBeforeLogin)return null===(f=null==j?void 0:j.current)||void 0===f||f.onSpin(!1),[2/*return*/];g.label=2;case 2:return g.trys.push([2,7,8,9]),re?[4/*yield*/,se({account:t.account})]:[3/*break*/,4];case 3:return i=g.sent(),a=i.code,s=i.data,null===(v=null==j?void 0:j.current)||void 0===v||v.onSpin(!1),200===a&&s.matched?
|
|
27921
27921
|
// gene idp init url
|
|
@@ -27927,32 +27927,32 @@ o.identifier=e.identifier;var a=sF[e.protocol];if(!a)return null;r="".concat(n).
|
|
|
27927
27927
|
// 嵌入式组件,从配置字段获取登录 URL
|
|
27928
27928
|
r=e.config[s]}o.redirected?window.location.replace(r):qX(r)}(s.identityProvider):ne("fail"),[3/*break*/,6];case 4:return[4/*yield*/,ae(o)];case 5:c=g.sent(),ce(c,t.account),g.label=6;case 6:return[3/*break*/,9];case 7:throw g.sent();case 8:
|
|
27929
27929
|
// 图形验证码出现后,不管是「图形验证码」错了,还是「账号」「密码」错了,都要重新发验证码
|
|
27930
|
-
return z&&$(n$(e.host)),[7/*endfinally*/];case 9:return[2/*return*/]}}))}))},onFinishFailed:function(){return j.current.onError()},autoComplete:"off",form:f,onValuesChange:function(e){(null==e?void 0:e.account)&&a&&a(Vs.Password,null==e?void 0:e.account)}},y().createElement(Lz,{name:"account",className:"
|
|
27930
|
+
return z&&$(n$(e.host)),[7/*endfinally*/];case 9:return[2/*return*/]}}))}))},onFinishFailed:function(){return j.current.onError()},autoComplete:"off",form:f,onValuesChange:function(e){(null==e?void 0:e.account)&&a&&a(Vs.Password,null==e?void 0:e.account)}},y().createElement(Lz,{name:"account",className:"genauth-g2-input-form",validPasswordLoginMethods:(null===(t=null==M?void 0:M.passwordTabConfig)||void 0===t?void 0:t.validLoginMethods)||[],initialValue:w===Vs.Password?b:""},y().createElement(Bz,{className:"genauth-g2-input",autoComplete:"off",size:"large",autoFocus:x,prefix:y().createElement(JL,{type:"authing-a-user-line1",style:{color:"#6B7280"}}),
|
|
27931
27931
|
// onChange={e => {
|
|
27932
27932
|
// let v = e.target.value
|
|
27933
27933
|
// console.log(v, '22')
|
|
27934
27934
|
// changeMethod(v)
|
|
27935
27935
|
// }}
|
|
27936
|
-
onBlur:function(e){var t=e.target.value;ie(t)},passwordLoginMethods:l,placeholder:de})),!re&&y().createElement(cT.Item,{name:"password",validateTrigger:["onBlur","onChange"],className:"
|
|
27936
|
+
onBlur:function(e){var t=e.target.value;ie(t)},passwordLoginMethods:l,placeholder:de})),!re&&y().createElement(cT.Item,{name:"password",validateTrigger:["onBlur","onChange"],className:"genauth-g2-input-form",rules:QX(O("common.password"))},y().createElement(gU,{className:"genauth-g2-input",size:"large",placeholder:O("login.inputLoginPwd"),prefix:y().createElement(JL,{type:"authing-a-lock-line1",style:{color:"#6B7280"}})})),U&&!re&&y().createElement(cT.Item,{className:"genauth-g2-input-form",validateTrigger:["onBlur","onChange"],name:"captchaCode",rules:QX(O("common.captchaCode"))},y().createElement(sz,{className:"genauth-g2-input",size:"large",placeholder:O("login.inputCaptchaCode"),verifyCodeUrl:z,changeCode:function(){return $(n$(e.host))}})),0!==W&&!Y&&y().createElement("span",{style:{marginBottom:23,fontSize:12,color:"#DC2626",display:"block"}},O("common.loginFailCheck",{number:W})),Y&&y().createElement("span",{style:{marginBottom:23,fontSize:12,color:"#DC2626",display:"block"}},O("common.accountLock")),Boolean(null==r?void 0:r.length)&&y().createElement(Gz,{onChange:function(e,t){k(e),S.current=t},agreements:r,showError:P}),y().createElement(cT.Item,{className:"genauth-g2-sumbit-form"},y().createElement(Dj,{
|
|
27937
27937
|
// TODO 产品还没想好 暂时不上
|
|
27938
27938
|
// disabled={
|
|
27939
27939
|
// !!agreements.find((item) => item.required && !acceptedAgreements)
|
|
27940
27940
|
// }
|
|
27941
27941
|
text:le,className:"password",ref:j}))))},h$=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},m$=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},v$=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},g$=y().useRef,y$=y().useState,b$=function(e){var t=e.agreements,n=e.onLoginSuccess,r=e.onLoginFailed,o=e.multipleInstance,i=e.backfillData,a=e.loginHint,s=v$(cT.useForm(),1)[0];
|
|
27942
27942
|
// const { responseIntercept } = useGuardHttpClient()
|
|
27943
|
-
e$({form:s,way:"ldap",formKey:"account",backfillData:i,loginHint:a});var c=v$(y$(!1),2),l=c[0],u=c[1],d=v$(y$([]),2),f=d[0],p=d[1],h=Sj().autoFocus,m=v$(y$(!1),2),v=m[0],g=m[1],b=aD().post,w=_u().t,C=g$(null),E=v$(y$(!1),2),k=E[0],S=E[1],x=v$(y$(""),2),_=x[0],P=x[1],T="".concat(e.host,"/api/v2/security/captcha"),N=function(){return"".concat(T,"?r=").concat(+new Date)},O=ZD();return y().createElement("div",{className:"
|
|
27943
|
+
e$({form:s,way:"ldap",formKey:"account",backfillData:i,loginHint:a});var c=v$(y$(!1),2),l=c[0],u=c[1],d=v$(y$([]),2),f=d[0],p=d[1],h=Sj().autoFocus,m=v$(y$(!1),2),v=m[0],g=m[1],b=aD().post,w=_u().t,C=g$(null),E=v$(y$(!1),2),k=E[0],S=E[1],x=v$(y$(""),2),_=x[0],P=x[1],T="".concat(e.host,"/api/v2/security/captcha"),N=function(){return"".concat(T,"?r=").concat(+new Date)},O=ZD();return y().createElement("div",{className:"genauth-g2-login-ldap"},y().createElement(cT,{form:s,name:"passworLogin",onFinish:function(i){return h$(void 0,void 0,void 0,(function(){var a,s,c,u,d,p,h,m,v,y,E,k,x,_;return m$(this,(function(T){switch(T.label){case 0:return g(!0),(null==t?void 0:t.length)&&!l?(null===(E=C.current)||void 0===E||E.onError(),[2/*return*/]):(
|
|
27944
27944
|
// onBeforeLogin
|
|
27945
27945
|
null===(k=C.current)||void 0===k||k.onSpin(!0),a={type:Vs.LDAP,data:{identity:i.account,password:i.password,captchaCode:i.captchaCode}},[4/*yield*/,e.onBeforeLogin(a)]);case 1:return T.sent()?(s=i.account&&i.account.trim(),c=i.password,[4/*yield*/,(0,O.options.encryptFunction)(c,e.publicKey)]):(null===(x=C.current)||void 0===x||x.onSpin(!1),[2/*return*/]);case 2:u=T.sent(),T.label=3;case 3:return T.trys.push([3,5,,6]),[4/*yield*/,b("/api/v2/ldap/verify-user",{username:s,password:u,agreementIds:t.length?f:void 0})];case 4:return d=T.sent(),p=d.code,h=d.data,m=d.onGuardHandling,v=d.message,C.current.onSpin(!1),
|
|
27946
27946
|
// 更新本次登录方式
|
|
27947
27947
|
h&&o&&o.setLoginWayByLDAPData(s,h),200===p?n(h):(p===JF.INPUT_CAPTCHACODE&&(P(N()),S(!0)),
|
|
27948
27948
|
// 向上层抛出错误
|
|
27949
|
-
(null==m?void 0:m())===fX.RENDER_MESSAGE&&r(p,h,v)),[3/*break*/,6];case 5:return y=T.sent(),null===(_=C.current)||void 0===_||_.onSpin(!1),"ECONNABORTED"===y.code&&(gC.error(w("common.timeoutLDAP")),r(2333,{},JSON.stringify(y))),[3/*break*/,6];case 6:return[2/*return*/]}}))}))},onFinishFailed:function(){var e;return null===(e=C.current)||void 0===e?void 0:e.onError()},autoComplete:"off"},y().createElement(cT.Item,{validateTrigger:["onBlur","onChange"],className:"
|
|
27950
|
-
// prefix={<LockOutlined style={{ color: '#
|
|
27951
|
-
prefix:y().createElement(JL,{type:"authing-a-lock-line1",style:{color:"#
|
|
27949
|
+
(null==m?void 0:m())===fX.RENDER_MESSAGE&&r(p,h,v)),[3/*break*/,6];case 5:return y=T.sent(),null===(_=C.current)||void 0===_||_.onSpin(!1),"ECONNABORTED"===y.code&&(gC.error(w("common.timeoutLDAP")),r(2333,{},JSON.stringify(y))),[3/*break*/,6];case 6:return[2/*return*/]}}))}))},onFinishFailed:function(){var e;return null===(e=C.current)||void 0===e?void 0:e.onError()},autoComplete:"off"},y().createElement(cT.Item,{validateTrigger:["onBlur","onChange"],className:"genauth-g2-input-form",name:"account",rules:QX(w("common.account"))},y().createElement(oN,{autoFocus:h,className:"genauth-g2-input",autoComplete:"off",size:"large",placeholder:w("login.inputLdapUsername"),prefix:y().createElement(JL,{type:"authing-a-user-line1",style:{color:"#6B7280"}})})),y().createElement(cT.Item,{validateTrigger:["onBlur","onChange"],className:"genauth-g2-input-form",name:"password",rules:QX(w("common.password"))},y().createElement(gU,{className:"genauth-g2-input",size:"large",placeholder:w("login.inputLdapPwd"),
|
|
27950
|
+
// prefix={<LockOutlined style={{ color: '#6B7280' }} />}
|
|
27951
|
+
prefix:y().createElement(JL,{type:"authing-a-lock-line1",style:{color:"#6B7280"}})})),k&&y().createElement(cT.Item,{validateTrigger:["onBlur","onChange"],className:"genauth-g2-input-form",name:"captchaCode",rules:[{required:!0,message:w("login.inputCaptchaCode")}]},y().createElement(oN,{className:"genauth-g2-input add-after",size:"large",placeholder:w("login.inputCaptchaCode"),addonAfter:y().createElement("img",{className:"g2-captcha-code-image",src:_,alt:w("login.captchaCode"),style:{height:"2em",cursor:"pointer"},onClick:function(){return P(N())}})})),Boolean(null==t?void 0:t.length)&&y().createElement(Gz,{onChange:function(e,t){u(e),p(t)},agreements:t,showError:v}),y().createElement(cT.Item,{className:"genauth-g2-sumbit-form"},y().createElement(Dj,{
|
|
27952
27952
|
// disabled={
|
|
27953
27953
|
// !!agreements.find((item) => item.required && !acceptedAgreements)
|
|
27954
27954
|
// }
|
|
27955
|
-
text:w("common.login"),className:"password",ref:C}))))},w$=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},C$=y().useState,E$=function(){var e=w$(C$(null),2),t=e[0],n=e[1],r=aD();return(0,g.useEffect)((function(){var e=r.getHeaders()["x-authing-device-id"]||localStorage.getItem("browserId");n(e)}),[]),t},k$=function(){return k$=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},k$.apply(this,arguments)},S$=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},x$=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},_$=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},P$=y().useEffect,T$=y().useRef,N$=y().useState,O$=function(e){var t,n=e.agreements,r=e.onLoginFailed,o=e.onLoginSuccess,i=null!==(t=su.resolvedLanguage)&&void 0!==t?t:su.language,a=_$(N$(!1),2),s=a[0],c=a[1],l=_$(N$([]),2),u=l[0],d=l[1],f=_$(N$(!1),2),p=f[0],h=f[1],m=bD(),v=_$(N$("always_enable"===m),2),g=v[0],b=v[1],w=_$(N$(""),2),C=w[0],E=w[1],k=iD(),S=hD().host,x=cD(),_=E$(),P=aD().responseIntercept,T=_u().t,N=Sj().autoFocus,O=ZD(),I=_$(cT.useForm(),1)[0],A=T$(null);return P$((function(){b("always_enable"===m),"always_enable"===m&&E(n$(S))}),[m,S]),y().createElement("div",{className:"
|
|
27955
|
+
text:w("common.login"),className:"password",ref:C}))))},w$=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},C$=y().useState,E$=function(){var e=w$(C$(null),2),t=e[0],n=e[1],r=aD();return(0,g.useEffect)((function(){var e=r.getHeaders()["x-authing-device-id"]||localStorage.getItem("browserId");n(e)}),[]),t},k$=function(){return k$=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},k$.apply(this,arguments)},S$=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},x$=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},_$=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},P$=y().useEffect,T$=y().useRef,N$=y().useState,O$=function(e){var t,n=e.agreements,r=e.onLoginFailed,o=e.onLoginSuccess,i=null!==(t=su.resolvedLanguage)&&void 0!==t?t:su.language,a=_$(N$(!1),2),s=a[0],c=a[1],l=_$(N$([]),2),u=l[0],d=l[1],f=_$(N$(!1),2),p=f[0],h=f[1],m=bD(),v=_$(N$("always_enable"===m),2),g=v[0],b=v[1],w=_$(N$(""),2),C=w[0],E=w[1],k=iD(),S=hD().host,x=cD(),_=E$(),P=aD().responseIntercept,T=_u().t,N=Sj().autoFocus,O=ZD(),I=_$(cT.useForm(),1)[0],A=T$(null);return P$((function(){b("always_enable"===m),"always_enable"===m&&E(n$(S))}),[m,S]),y().createElement("div",{className:"genauth-g2-login-ad"},y().createElement(cT,{form:I,name:"adLogin",onFinish:function(t){return S$(void 0,void 0,void 0,(function(){var a,c,l,d,f,p,m,v,g,y,w,N,I,R,M,L,D,F,j,B,U;return x$(this,(function(q){switch(q.label){case 0:return h(!0),(null==n?void 0:n.length)&&!s?(null===(D=A.current)||void 0===D||D.onError(),[2/*return*/]):(
|
|
27956
27956
|
// onBeforeLogin
|
|
27957
27957
|
null===(F=A.current)||void 0===F||F.onSpin(!0),a={type:Ti.AD,data:{identity:t.account,password:t.password,captchaCode:t.captchaCode}},[4/*yield*/,e.onBeforeLogin(a)]);case 1:return q.sent()?(c=t.account&&t.account.trim(),l=t.password,d=t.captchaCode,[4/*yield*/,(0,O.options.encryptFunction)(l,e.publicKey)]):(null===(j=A.current)||void 0===j||j.onSpin(!1),[2/*return*/]);case 2:f=q.sent(),q.label=3;case 3:return q.trys.push([3,6,7,8]),p="".concat(S,"/api/v2/ad/verify-user"),m=_D(),[4/*yield*/,fetch(p,{method:"POST",body:JSON.stringify({username:c,password:f,captchaCode:d,agreementIds:n.length?u:void 0}),credentials:"include",headers:k$((L={"Content-Type":"application/json"},L[LD.langHeader]=i,L["x-authing-userpool-id"]=k.userPoolId,L["x-authing-app-id"]=x,L["x-authing-sdk-version"]=m,L["x-authing-request-from"]="Guard@".concat(m),L),_&&{"x-authing-device-id":_})})];case 4:return[4/*yield*/,q.sent().json()];case 5:return v=q.sent(),g=P(v),y=g.code,w=g.apiCode,N=g.data,I=g.onGuardHandling,R=g.message,
|
|
27958
27958
|
// // 更新本次登录方式
|
|
@@ -27963,7 +27963,7 @@ w!==JF.INPUT_CAPTCHACODE||C||(E(n$(S)),b(!0)),
|
|
|
27963
27963
|
// 向上层抛出错误
|
|
27964
27964
|
(null==I?void 0:I())===fX.RENDER_MESSAGE&&r(y,N,R)),[3/*break*/,8];case 6:return M=q.sent(),null===(U=A.current)||void 0===U||U.onSpin(!1),"ECONNABORTED"===M.code&&(gC.error(T("common.timeoutAD")),r(2333,{},JSON.stringify(M))),[3/*break*/,8];case 7:
|
|
27965
27965
|
// 图形验证码出现后,不管是「图形验证码」错了,还是「账号」「密码」错了,都要重新发验证码
|
|
27966
|
-
return C&&E(n$(S)),[7/*endfinally*/];case 8:return[2/*return*/]}}))}))},onFinishFailed:function(){return A.current.onError()},autoComplete:"off"},(null==k?void 0:k.ssoPageComponentDisplay.userPasswordInput)&&y().createElement(y().Fragment,null,y().createElement(cT.Item,{className:"
|
|
27966
|
+
return C&&E(n$(S)),[7/*endfinally*/];case 8:return[2/*return*/]}}))}))},onFinishFailed:function(){return A.current.onError()},autoComplete:"off"},(null==k?void 0:k.ssoPageComponentDisplay.userPasswordInput)&&y().createElement(y().Fragment,null,y().createElement(cT.Item,{className:"genauth-g2-input-form",name:"account",validateTrigger:["onBlur","onChange"],rules:QX(T("common.account"))},y().createElement(oN,{autoFocus:N,className:"genauth-g2-input",autoComplete:"off",size:"large",placeholder:(null==k?void 0:k.mergeAdAndAccountPasswordLogin)?T("common.jobNumber"):T("login.inputAdUsername"),prefix:y().createElement(JL,{type:"authing-a-user-line1",style:{color:"#6B7280"}})})),y().createElement(cT.Item,{validateTrigger:["onBlur","onChange"],className:"genauth-g2-input-form",name:"password",rules:QX(T("common.password"))},y().createElement(gU,{autoComplete:"off",className:"genauth-g2-input",size:"large",placeholder:(null==k?void 0:k.mergeAdAndAccountPasswordLogin)?T("login.inputPwd"):T("login.inputAdPwd"),prefix:y().createElement(JL,{type:"authing-a-lock-line1",style:{color:"#6B7280"}})})),g&&y().createElement(cT.Item,{className:"genauth-g2-input-form",validateTrigger:["onBlur","onChange"],name:"captchaCode",rules:QX(T("common.captchaCode"))},y().createElement(sz,{className:"genauth-g2-input",size:"large",placeholder:T("login.inputCaptchaCode"),verifyCodeUrl:C,changeCode:function(){return E(n$(S))}})),Boolean(null==n?void 0:n.length)&&y().createElement(Gz,{onChange:function(e,t){c(e),d(t)},agreements:n,showError:p}),y().createElement(cT.Item,{className:"genauth-g2-sumbit-form"},y().createElement(Dj,{
|
|
27967
27967
|
// disabled={
|
|
27968
27968
|
// !!agreements.find(
|
|
27969
27969
|
// (item) => item.required && !acceptedAgreements
|
|
@@ -28112,11 +28112,11 @@ var t=e.i,n=e.appId,r=e.appHost,o=e.isHost,i=e.isLastLogin,a=e.status,s=void 0==
|
|
|
28112
28112
|
// 如果 isHost 是 true,则从 url 获取 finish_login_url 作为 social.authorize 方法的 targetUrl 参数
|
|
28113
28113
|
p.redirect_url=null===(e=Fc().parse(h.location.search))||void 0===e?void 0:e.finish_login_url)}if(null==t?void 0:t.provider){
|
|
28114
28114
|
// 社交身份源
|
|
28115
|
-
var m="authing-".concat(t.provider.replace(/:/g,"-"));return y().createElement(Nj,{key:t.identifier,className:"g2-guard-third-login-btn",block:!0,size:"large",icon:y().createElement(JL,{type:"".concat(m,"-fill"),style:{fontSize:20,marginRight:8}}),onClick:function(){var e,n;if(t.action===fj.Message)gC.error(l("login.socialConnectionMessage",{provider:null!==(n=null!==(e=t.displayName)&&void 0!==e?e:"zh-CN"===su.resolvedLanguage?t.name:t.name_en)&&void 0!==n?n:t.provider}));else if(t.action===fj.Auth){var o="".concat(r,"/connections/social/").concat(t.identifier,"?").concat(Fc().stringify(p));p.redirected?window.location.replace(o):"lark-internal"===t.provider?VX(o):qX(o)}}},l("login.loginBy",{name:t.displayName}),!s&&y().createElement(JL,{type:"authing-error-warning-line1",style:{color:"#
|
|
28115
|
+
var m="authing-".concat(t.provider.replace(/:/g,"-"));return y().createElement(Nj,{key:t.identifier,className:"g2-guard-third-login-btn",block:!0,size:"large",icon:y().createElement(JL,{type:"".concat(m,"-fill"),style:{fontSize:20,marginRight:8}}),onClick:function(){var e,n;if(t.action===fj.Message)gC.error(l("login.socialConnectionMessage",{provider:null!==(n=null!==(e=t.displayName)&&void 0!==e?e:"zh-CN"===su.resolvedLanguage?t.name:t.name_en)&&void 0!==n?n:t.provider}));else if(t.action===fj.Auth){var o="".concat(r,"/connections/social/").concat(t.identifier,"?").concat(Fc().stringify(p));p.redirected?window.location.replace(o):"lark-internal"===t.provider?VX(o):qX(o)}}},l("login.loginBy",{name:t.displayName}),!s&&y().createElement(JL,{type:"authing-error-warning-line1",style:{color:"#2F54EB",fontSize:16,marginLeft:8}}),i&&y().createElement("div",{className:"last-login-tag"},l("common.lastUsed")))}if(o){
|
|
28116
28116
|
// 托管登录页,直接写死登录 URL
|
|
28117
28117
|
p.identifier=t.identifier;var v=sF[t.protocol];if(!v)return null;a="".concat(r).concat(v,"?").concat(Fc().stringify(p))}else{var g=cF[t.protocol];if(!g)return null;
|
|
28118
28118
|
// 嵌入式组件,从配置字段获取登录 URL
|
|
28119
|
-
a=t.config[g]}return y().createElement(Nj,{key:t.identifier,className:"g2-guard-third-login-btn",block:!0,size:"large",icon:y().createElement(bv,{size:20,src:t.logo,style:{marginRight:8}}),onClick:function(){p.redirected?window.location.replace(a):qX(a)}},l("login.loginBy",{name:t.displayName}),!s&&y().createElement(JL,{type:"authing-error-warning-line1",style:{color:"#
|
|
28119
|
+
a=t.config[g]}return y().createElement(Nj,{key:t.identifier,className:"g2-guard-third-login-btn",block:!0,size:"large",icon:y().createElement(bv,{size:20,src:t.logo,style:{marginRight:8}}),onClick:function(){p.redirected?window.location.replace(a):qX(a)}},l("login.loginBy",{name:t.displayName}),!s&&y().createElement(JL,{type:"authing-error-warning-line1",style:{color:"#2F54EB",fontSize:16,marginLeft:8}}),i&&y().createElement("div",{className:"last-login-tag"},l("common.lastUsed")))}),[n,t,l,o,r,u,c]);return p()},rW=function(e){var t,n,r,
|
|
28120
28120
|
// 回调函数
|
|
28121
28121
|
o,
|
|
28122
28122
|
// 延迟时间
|
|
@@ -28126,7 +28126,7 @@ return n&&r}))}),[v,c,w]),T=(o=function(e){C(e)},i=500,a=wj({time:null}),s=wj({b
|
|
|
28126
28126
|
// fn.apply(this, args);
|
|
28127
28127
|
var t=o.apply(void 0,gj([],vj(e),!1));a.current.time=null,s.current.body=t}),i)}),[a.current,i])),N=eW((function(){var e,t,n,r;return null!==(r=(null===(e=null==h?void 0:h.i18n)||void 0===e?void 0:e[u].enabled)?null===(n=null===(t=null==h?void 0:h.i18n)||void 0===t?void 0:t[u])||void 0===n?void 0:n.value:null==h?void 0:h.default)&&void 0!==r?r:l("common.more")}),[h,u]);
|
|
28128
28128
|
// 点击非 g2-guard-more-idp-wrapper 区域关闭弹窗
|
|
28129
|
-
return XH((function(){var e=function(e){e.target.closest(".g2-guard-more-idp-wrapper")||x(!1)};return S?document.addEventListener("click",e):document.removeEventListener("click",e),function(){document.removeEventListener("click",e)}}),[S]),y().createElement(y().Fragment,null,y().createElement(Nj,{className:"g2-guard-third-login-btn",block:!0,size:"large",onClick:function(){return x(!0)}},N),y().createElement("section",{className:iB()("g2-guard-more-idp-wrapper",{open:S})},y().createElement("div",{className:"g2-guard-more-idp-container"},y().createElement("div",{className:"g2-guard-more-idp-ops"},y().createElement("div",{className:"g2-guard-more-idp-header"},y().createElement("div",null,l("common.moreIdps")),y().createElement("div",{className:"g2-guard-more-idp-header-arrow-icon",onClick:function(){return x(!1)}},y().createElement(JL,{type:"authing-arrow-down-s-line"}))),y().createElement("div",null,y().createElement(oN.Search,{enterButton:!1,prefix:y().createElement(JL,{type:"authing-search-line"}),addonAfter:!1,addonBefore:!1,className:"g2-guard-search-input
|
|
28129
|
+
return XH((function(){var e=function(e){e.target.closest(".g2-guard-more-idp-wrapper")||x(!1)};return S?document.addEventListener("click",e):document.removeEventListener("click",e),function(){document.removeEventListener("click",e)}}),[S]),y().createElement(y().Fragment,null,y().createElement(Nj,{className:"g2-guard-third-login-btn",block:!0,size:"large",onClick:function(){return x(!0)}},N),y().createElement("section",{className:iB()("g2-guard-more-idp-wrapper",{open:S})},y().createElement("div",{className:"g2-guard-more-idp-container"},y().createElement("div",{className:"g2-guard-more-idp-ops"},y().createElement("div",{className:"g2-guard-more-idp-header"},y().createElement("div",null,l("common.moreIdps")),y().createElement("div",{className:"g2-guard-more-idp-header-arrow-icon",onClick:function(){return x(!1)}},y().createElement(JL,{type:"authing-arrow-down-s-line"}))),y().createElement("div",null,y().createElement(oN.Search,{enterButton:!1,prefix:y().createElement(JL,{type:"authing-search-line"}),addonAfter:!1,addonBefore:!1,className:"g2-guard-search-input genauth-g2-input",placeholder:"搜索",onChange:function(e){return T(e.target.value)}})),y().createElement("div",{className:"g2-guard-tag-list"},y().createElement("div",{className:iB()("g2-guard-tag-item",{active:v===tW}),onClick:function(){return g(tW)}},l("common.all")),_.map((function(e){return y().createElement("div",{className:iB()("g2-guard-tag-item",{active:v===e}),onClick:function(){return g(e)}},e)})))),y().createElement("div",{className:"g2-guard-more-idp-list"},P.map((function(e){return y().createElement(nW,{status:e.tagsStatus,key:e.identifier,i:e,appId:d,appHost:null==f?void 0:f.host,userPoolId:E,isHost:null==f?void 0:f.isHost})})),w&&0===P.length&&y().createElement("div",{className:"g2-tags-empty-filter"},l("common.noFindIdps",[w]))))))},oW=function(){return oW=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},oW.apply(this,arguments)},iW=y().useMemo,aW=function(e){var t,n,r,o=e.appId,i=e.config,a=e.enterpriseConnectionObjs,s=e.socialConnectionObjs,c=!(null===(t=null==i?void 0:i.loginMethods)||void 0===t?void 0:t.length),l=E$(),u=iD(),d=null==u?void 0:u.userPoolId,f=null!==(r=null===(n=u.ssoPageComponentDisplay)||void 0===n?void 0:n.idpLayout)&&void 0!==r?r:{maxConns:10,topLastUsed:!1},p=f.maxConns,h=f.topLastUsed,m=_u().t,v=kj().isPhoneMedia,g=lD(),b=sD(),w=iW((function(){var e,t,n=JSON.parse(null!==(t=null!==(e=localStorage.getItem("".concat($F,"_").concat(o)))&&void 0!==e?e:localStorage.getItem($F))&&void 0!==t?t:"{}").connectionId,r=(0,Kz.cloneDeep)(a);
|
|
28130
28130
|
// 是否有「置顶上次登录身份源」需求
|
|
28131
28131
|
if(
|
|
28132
28132
|
// 让 enterpriseConnectionObjs 根据 lastLoginSocial 进行排序
|
|
@@ -28140,7 +28140,7 @@ return r.map((function(e){return y().createElement(nW,{key:e.identifier,status:e
|
|
|
28140
28140
|
// 只展示前两个,后面加个更多
|
|
28141
28141
|
var s=r.slice(0,p).map((function(e){return y().createElement(nW,{key:e.identifier,status:e.tagsStatus,i:e,appId:o,appHost:null==i?void 0:i.host,userPoolId:d,isHost:null==i?void 0:i.isHost,isLastLogin:e._isLastLogin})}));return s.push(y().createElement(rW,{idps:r})),s}),[]),C=s.map((function(e){var t,n,r,a,s,u,d,f="authing-".concat(e.provider.replace(/:/g,"-")),p=_D(),h=oW({from_guard:"1",app_id:o,guard_version:"Guard@".concat(p)},l&&{device_id:l});if(g&&(h.tenant_id=g),(null==i?void 0:i.isHost)&&(h.from_hosted_guard="1",b)){h.redirected="1";var w=_0();w&&(
|
|
28142
28142
|
// 如果 isHost 是 true,则从 url 获取 finish_login_url 作为 social.authorize 方法的 targetUrl 参数
|
|
28143
|
-
h.redirect_url=null===(t=GH.parse(w.location.search))||void 0===t?void 0:t.finish_login_url)}var C=function(){var t,n;if(e.action===fj.Message)gC.error(m("login.socialConnectionMessage",{provider:null!==(n=null!==(t=e.displayName)&&void 0!==t?t:"zh-CN"===su.resolvedLanguage?e.name:e.name_en)&&void 0!==n?n:e.provider}));else if(e.action===fj.Auth){var r="".concat(i.host,"/connections/social/").concat(e.identifier,"?").concat(GH.stringify(h));h.redirected?window.location.replace(r):qX(r)}},E=i.socialConnectionsBtnShape;return"button"===E?y().createElement(Nj,{key:e.id,block:!0,size:"large",className:"g2-guard-third-login-btn",icon:y().createElement(JL,{type:"".concat(f,"-fill"),style:{fontSize:20,marginRight:8}}),onClick:C,style:{marginBottom:8}},null!==(r=null!==(n=e.displayName)&&void 0!==n?n:"zh-CN"===su.resolvedLanguage?e.name:e.name_en)&&void 0!==r?r:e.provider):"icon"===E?v?y().createElement(Nj,{className:"g2-social-login-item",onClick:C,icon:y().createElement(JL,{type:"".concat(f,"-fill")})}):y().createElement(fv,{key:e.id,title:(null===(a=e.tooltip)||void 0===a?void 0:a[su.resolvedLanguage])||e.name,trigger:["hover","click","contextMenu"]},y().createElement(Nj,{className:"g2-social-login-item",onClick:C,icon:y().createElement(JL,{type:"".concat(f,"-fill")})})):c?y().createElement(Nj,{key:e.id,block:!0,size:"large",className:"g2-guard-third-login-btn",icon:y().createElement(JL,{type:"".concat(f,"-fill"),style:{fontSize:20,marginRight:8}}),onClick:C},null!==(u=null!==(s=e.displayName)&&void 0!==s?s:"zh-CN"===su.resolvedLanguage?e.name:e.name_en)&&void 0!==u?u:e.provider):v?y().createElement(Nj,{className:"g2-social-login-item",onClick:C,key:e.id,icon:y().createElement(JL,{type:"".concat(f,"-fill")})}):y().createElement(fv,{overlayStyle:{fontFamily:"sans-serif
|
|
28143
|
+
h.redirect_url=null===(t=GH.parse(w.location.search))||void 0===t?void 0:t.finish_login_url)}var C=function(){var t,n;if(e.action===fj.Message)gC.error(m("login.socialConnectionMessage",{provider:null!==(n=null!==(t=e.displayName)&&void 0!==t?t:"zh-CN"===su.resolvedLanguage?e.name:e.name_en)&&void 0!==n?n:e.provider}));else if(e.action===fj.Auth){var r="".concat(i.host,"/connections/social/").concat(e.identifier,"?").concat(GH.stringify(h));h.redirected?window.location.replace(r):qX(r)}},E=i.socialConnectionsBtnShape;return"button"===E?y().createElement(Nj,{key:e.id,block:!0,size:"large",className:"g2-guard-third-login-btn",icon:y().createElement(JL,{type:"".concat(f,"-fill"),style:{fontSize:20,marginRight:8}}),onClick:C,style:{marginBottom:8}},null!==(r=null!==(n=e.displayName)&&void 0!==n?n:"zh-CN"===su.resolvedLanguage?e.name:e.name_en)&&void 0!==r?r:e.provider):"icon"===E?v?y().createElement(Nj,{className:"g2-social-login-item",onClick:C,icon:y().createElement(JL,{type:"".concat(f,"-fill")})}):y().createElement(fv,{key:e.id,title:(null===(a=e.tooltip)||void 0===a?void 0:a[su.resolvedLanguage])||e.name,trigger:["hover","click","contextMenu"]},y().createElement(Nj,{className:"g2-social-login-item",onClick:C,icon:y().createElement(JL,{type:"".concat(f,"-fill")})})):c?y().createElement(Nj,{key:e.id,block:!0,size:"large",className:"g2-guard-third-login-btn",icon:y().createElement(JL,{type:"".concat(f,"-fill"),style:{fontSize:20,marginRight:8}}),onClick:C},null!==(u=null!==(s=e.displayName)&&void 0!==s?s:"zh-CN"===su.resolvedLanguage?e.name:e.name_en)&&void 0!==u?u:e.provider):v?y().createElement(Nj,{className:"g2-social-login-item",onClick:C,key:e.id,icon:y().createElement(JL,{type:"".concat(f,"-fill")})}):y().createElement(fv,{overlayStyle:{fontFamily:'"Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif'},key:e.id,title:e.displayName||(null===(d=e.tooltip)||void 0===d?void 0:d[su.resolvedLanguage])||e.name,trigger:["hover","click","contextMenu"]},y().createElement(Nj,{className:"g2-social-login-item",onClick:C,icon:y().createElement(JL,{type:"".concat(f,"-fill")})}))})),E=a.length?y().createElement(y().Fragment,null,!c&&y().createElement("div",{className:"g2-social-login-title"},su.t("login.otherLoginWay")),y().createElement("div",{className:"g2-social-login-list g2-enterprise-connection-space"},w)):null,k=C.length>0&&c?y().createElement(mP,{size:c?0:12,className:"g2-guard-full-width-space no-login-methods",direction:"vertical"},C):C.length>0&&y().createElement(y().Fragment,null,y().createElement("div",{className:"g2-social-login-title"},m("login.thridAccLogin")),y().createElement("div",{className:"g2-social-login-list g2-social-connection-space"},C));
|
|
28144
28144
|
// const otherLogin = (
|
|
28145
28145
|
// <div
|
|
28146
28146
|
// className="g2-social-login-list"
|
|
@@ -28154,7 +28154,7 @@ h.redirect_url=null===(t=GH.parse(w.location.search))||void 0===t?void 0:t.finis
|
|
|
28154
28154
|
// />
|
|
28155
28155
|
// </div>
|
|
28156
28156
|
// )
|
|
28157
|
-
return y().createElement(y().Fragment,null,!c&&y().createElement("div",{style:{flex:1,minHeight:16}}),y().createElement(mP,{size:c?0:8,direction:"vertical",className:"g2-guard-full-width-space"},!(null==u?void 0:u.ssoPageComponentDisplay.idpBtns)||E,!(null==u?void 0:u.ssoPageComponentDisplay.socialLoginBtns)||k))},sW=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},cW=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},lW=y().useMemo,uW=y().useCallback,dW=function(e){var t=e.lists,n=e.handleDel,r=e.onClick,o=_u().t,i=kj().isPhoneMedia,a=lW((function(){return i?"click":"hover"}),[i]),s=lW((function(){return cW(cW([],sW(t),!1),[{operation:!1,id:"other",title:o("login.useOtherAccount"),element:y().createElement("div",{className:"g2-multiple__icon--add-line"},y().createElement(JL,{style:{fontSize:24,color:"#
|
|
28157
|
+
return y().createElement(y().Fragment,null,!c&&y().createElement("div",{style:{flex:1,minHeight:16}}),y().createElement(mP,{size:c?0:8,direction:"vertical",className:"g2-guard-full-width-space"},!(null==u?void 0:u.ssoPageComponentDisplay.idpBtns)||E,!(null==u?void 0:u.ssoPageComponentDisplay.socialLoginBtns)||k))},sW=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},cW=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},lW=y().useMemo,uW=y().useCallback,dW=function(e){var t=e.lists,n=e.handleDel,r=e.onClick,o=_u().t,i=kj().isPhoneMedia,a=lW((function(){return i?"click":"hover"}),[i]),s=lW((function(){return cW(cW([],sW(t),!1),[{operation:!1,id:"other",title:o("login.useOtherAccount"),element:y().createElement("div",{className:"g2-multiple__icon--add-line"},y().createElement(JL,{style:{fontSize:24,color:"#3A3A3C"},type:"authing-add-line"}))}],!1)}),[t,o]),c=uW((function(e,t){n(t),e.stopPropagation()}),[n]),l=lW((function(){return s.map((function(e){var t=e,n=t.photo,i=t.title,s=t.description,l=t.id,u=t.operation,d=void 0===u||u,f=t.element;return y().createElement("li",{className:"g2-multiple__li",key:l,onClick:function(){return r(l)}},f||y().createElement("img",{className:"g2-multiple__avatar",alt:"",src:n}),y().createElement("section",{className:"g2-multiple__body"},i&&y().createElement("span",{className:"g2-multiple__title"},i),y().createElement("span",{className:i?"g2-multiple__desc":"g2-multiple__title"},s)),d&&y().createElement("span",{className:"g2-multiple__op",onClick:function(e){return e.stopPropagation()}},y().createElement(vv,{trigger:a,overlayClassName:"g2-multiple__op-wrapper",getPopupContainer:function(e){return e},content:y().createElement("div",{className:"g2-multiple__del",onClick:function(e){return c(e,l)}},y().createElement(JL,{style:{fontSize:20,marginRight:8},type:"authing-indeterminate-circle-line"}),o("common.del"))},y().createElement("div",{className:"g2-multiple__icon"},y().createElement(JL,{type:"authing-more-fill"})))))}))}),[s,r,c,o,a]);return y().createElement("ul",{className:"g2-multiple"},l)},fW=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},pW=y().useCallback,hW=y().useState,mW=y().memo((function(e){var t=fW(hW(0),2)[1],n=e.multipleInstance,r=e.referMultipleState,o=null==n?void 0:n.getMemoUser(),i=pW((function(){return t(Math.random)}),[]);if(!o)
|
|
28158
28158
|
// 这里应该额外处理下 其实本质上应该是存在的
|
|
28159
28159
|
return null;
|
|
28160
28160
|
/**
|
|
@@ -28165,9 +28165,9 @@ var t=null==n?void 0:n.getMemoSingleUser(e);null==r||r("login",t)},handleDel:fun
|
|
|
28165
28165
|
// 7.15: 如果仅剩一个需求跳转
|
|
28166
28166
|
null==r||r("login"):i()}})})),vW=function(){return vW=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},vW.apply(this,arguments)},gW=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},yW=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},bW=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},wW=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},CW=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},EW=y().useCallback,kW=y().useRef,SW=function(){var e=kW(null),t=CW(cT.useForm(),1)[0],n=fD(),r=ZD(),o=EW((function(t){return bW(void 0,void 0,void 0,(function(){var o,i,a,s,c,l,u,d,f;return wW(this,(function(p){switch(p.label){case 0:return p.trys.push([0,2,,3]),[4/*yield*/,(h="reset-username-before-auth"/* ResetAccountBusinessAction.ResetName */,m=t,gW(void 0,void 0,void 0,(function(){return yW(this,(function(e){switch(e.label){case 0:return[4/*yield*/,(0,BX().authFlow)(h,vW({},m))];case 1:return[2/*return*/,e.sent()]}}))})))];case 1:return o=p.sent(),i=o.apiCode,a=o.onGuardHandling,s=o.message,c=o.isFlowEnd,l=o.data,null===(u=e.current)||void 0===u||u.onSpin(!1),c?null===(d=null==n?void 0:n.onLogin)||void 0===d||d.call(n,l,r):i===pX.RESET_ACCOUNT_NAME?
|
|
28167
28167
|
// 用户名重复
|
|
28168
|
-
gC.error(s):(null===(f=e.current)||void 0===f||f.onError(),null==a||a()),[3/*break*/,3];case 2:return p.sent(),[3/*break*/,3];case 3:return[2/*return*/]}var h,m}))}))}),[r,n]);return y().createElement("div",{className:"g2-view-reset-username"},y().createElement("div",{className:"g2-view-reset-username__title"},su.t("common.resetAccount.title")),y().createElement(cT,{name:"passworLogin",onFinish:o,onFinishFailed:function(){var t;return null===(t=e.current)||void 0===t?void 0:t.onError()},autoComplete:"off",form:t},y().createElement(hU.UserName,null,y().createElement(oN,{className:"
|
|
28168
|
+
gC.error(s):(null===(f=e.current)||void 0===f||f.onError(),null==a||a()),[3/*break*/,3];case 2:return p.sent(),[3/*break*/,3];case 3:return[2/*return*/]}var h,m}))}))}),[r,n]);return y().createElement("div",{className:"g2-view-reset-username"},y().createElement("div",{className:"g2-view-reset-username__title"},su.t("common.resetAccount.title")),y().createElement(cT,{name:"passworLogin",onFinish:o,onFinishFailed:function(){var t;return null===(t=e.current)||void 0===t?void 0:t.onError()},autoComplete:"off",form:t},y().createElement(hU.UserName,null,y().createElement(oN,{className:"genauth-g2-input",size:"large",prefix:y().createElement(JL,{type:"authing-a-user-line1",style:{color:"#6B7280"}}),placeholder:su.t("login.inputUsername")})),y().createElement(cT.Item,{className:"genauth-g2-sumbit-form"},y().createElement(Dj,{text:su.t("common.sure"),className:"password",ref:e}))))},xW=function(){return xW=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},xW.apply(this,arguments)},_W=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},PW=y().useMemo,TW=function(e){var t=e.methods,n=_W(e,["methods"]),r=iD(),o=_u().t,i=PW((function(){var e;return{"email-code":{t:o("common.email"),sort:2},"phone-code":{t:(null===(e=null==r?void 0:r.internationalSmsConfig)||void 0===e?void 0:e.enabled)?o("common.areaCodePhone"):o("common.phoneNumber"),sort:1}}}),[r,o]),a=PW((function(){return o("login.inputAccount",{text:null==t?void 0:t.map((function(e){return i[e]})).sort((function(e,t){return e.sort-t.sort})).map((function(e){return e.t})).join(" / ")})}),[t,o,i]),s=PW((function(){return 1===t.length&&"phone-code"===t[0]?y().createElement(ZU,xW({maxLength:11,placeholder:a},n)):y().createElement(oN,xW({placeholder:a},n,{prefix:y().createElement(JL,{type:"authing-a-user-line1",style:{color:"#6B7280"}})}))}),[n,t,a]);return y().createElement(y().Fragment,null,s)},NW=function(){return NW=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},NW.apply(this,arguments)},OW=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},IW=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},AW=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},RW=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))};!function(e){e.Phone="phone",e.Email="email"}(LH||(LH={}));var MW=y().useCallback,LW=y().useEffect,DW=y().useMemo,FW=y().useRef,jW=y().useState,BW=function(e){var t,n,r,o=iD(),i=hD(),a=uD(),s=a._firstItemInitialValue,c=void 0===s?"":s,l=a.specifyDefaultLoginMethod,u=a._lockMethod,d=e.agreements,f=e.methods,p=e.autoRegister,h=e.submitButText,m=e.onLoginFailed,v=e.onLoginSuccess,g=e.saveIdentify,b=e.multipleInstance,w=e.backfillData,C=e.specifyCodeMethod,E=e.loginHint,k=null!==(t=null==o?void 0:o.verifyCodeLength)&&void 0!==t?t:4,S=aD().post,x=Sj().autoFocus,_=(null===(n=null==o?void 0:o.internationalSmsConfig)||void 0===n?void 0:n.enabled)||!1,P=FW(!1),T=FW([]),N=AW(jW(!1),2),O=N[0],I=N[1],A=AW(jW(""),2),R=A[0],M=A[1],L=AW(jW(l&&null!=u?u:f[0]),2),D=L[0],F=L[1],j=AW(jW(!1),2),B=j[0],U=j[1],q=AW(jW(!1),2),V=q[0],z=q[1],$=AW(jW((null===(r=null==o?void 0:o.internationalSmsConfig)||void 0===r?void 0:r.defaultISOType)||"CN"),2),H=$[0],W=$[1],G=wD("login"),K=CD("login"),Y=AW(jW(""),2),J=Y[0],Q=Y[1],Z=AW(cT.useForm(),1)[0],X=MW((function(e){1!==f.length&&(JX("email",e)?F(Pc.EmailCode):
|
|
28169
28169
|
// 放开手机号校验 方便同时开启邮箱和短信国际化手机号通过
|
|
28170
|
-
F(Pc.PhoneCode))}),[f.length]),ee=MW((function(e){M(e),X(e)}),[X]);e$({form:Z,way:f,formKey:"identify",backfillData:w,isOnlyInternationSms:B,setAreaCode:W,cancelBackfill:l===Vs.PhoneCode,changeCurrentMethod:ee,loginHint:E});var te=FW(null),ne=_u().t,re=MW((function(e){return B?y().createElement(aq,NW({},e,{form:Z,fieldName:"identify",className:"
|
|
28170
|
+
F(Pc.PhoneCode))}),[f.length]),ee=MW((function(e){M(e),X(e)}),[X]);e$({form:Z,way:f,formKey:"identify",backfillData:w,isOnlyInternationSms:B,setAreaCode:W,cancelBackfill:l===Vs.PhoneCode,changeCurrentMethod:ee,loginHint:E});var te=FW(null),ne=_u().t,re=MW((function(e){return B?y().createElement(aq,NW({},e,{form:Z,fieldName:"identify",className:"genauth-g2-input g2-send-code-input",autoComplete:"off",size:"large",placeholder:ne("common.inputFourVerifyCode",{length:k}),areaCode:H,prefix:y().createElement(JL,{type:"authing-a-shield-check-line1",style:{color:"#6B7280"}}),isInternationSms:_,scene:Oi.SCENE_TYPE_LOGIN,maxLength:k,onSendCodeBefore:function(){return OW(void 0,void 0,void 0,(function(){return IW(this,(function(e){switch(e.label){case 0:return(null==o?void 0:o.closeCheckSendUser)?[3/*break*/,2]:[4/*yield*/,Z.validateFields(["identify"])];case 1:e.sent(),e.label=2;case 2:return[4/*yield*/,Z.validateFields(["captchaCode"])];case 3:return e.sent(),[2/*return*/]}}))}))},onSendCodeError:function(){Q(n$(i.host))}})):y().createElement(y().Fragment,null,D===Pc.PhoneCode&&y().createElement(aq,NW({},e,{isInternationSms:_,className:"genauth-g2-input g2-send-code-input",autoComplete:"off",size:"large",placeholder:ne("common.inputFourVerifyCode",{length:k}),areaCode:H,prefix:y().createElement(JL,{type:"authing-a-shield-check-line1",style:{color:"#6B7280"}}),scene:Oi.SCENE_TYPE_LOGIN,maxLength:k,form:Z,fieldName:"identify",data:R,codeFieldName:"captchaCode",onSendCodeBefore:function(){return OW(void 0,void 0,void 0,(function(){return IW(this,(function(e){switch(e.label){case 0:return(null==o?void 0:o.closeCheckSendUser)?[3/*break*/,2]:[4/*yield*/,Z.validateFields(["identify"])];case 1:e.sent(),e.label=2;case 2:return[4/*yield*/,Z.validateFields(["captchaCode"])];case 3:return e.sent(),[2/*return*/]}}))}))},onSendCodeError:function(){Q(n$(i.host))}})),D===Pc.EmailCode&&y().createElement(Gq,NW({},e,{className:"genauth-g2-input g2-send-code-input",autoComplete:"off",size:"large",placeholder:ne("common.inputFourVerifyCode",{length:k}),prefix:y().createElement(JL,{type:"authing-a-shield-check-line1",style:{color:"#6B7280"}}),form:Z,fieldName:"identify",scene:Nc.LOGIN_VERIFY_CODE,maxLength:k,data:R,codeFieldName:"captchaCode",onSendCodeBefore:function(){return OW(void 0,void 0,void 0,(function(){return IW(this,(function(e){switch(e.label){case 0:return(null==o?void 0:o.closeCheckSendUser)?[3/*break*/,2]:[4/*yield*/,Z.validateFields(["identify"])];case 1:e.sent(),e.label=2;case 2:return[4/*yield*/,Z.validateFields(["captchaCode"])];case 3:return e.sent(),[2/*return*/]}}))}))},onSendCodeError:function(){Q(n$(i.host))}})))}),[H,D,Z,R,_,B,ne,k]);LW((function(){var e;
|
|
28171
28171
|
// 开启国际化配置且登录方式为手机号码时
|
|
28172
28172
|
(1===f.length&&"phone-code"===f[0]&&(null===(e=null==o?void 0:o.internationalSmsConfig)||void 0===e?void 0:e.enabled)||C===LH.Phone)&&(U(!0),F(Pc.PhoneCode)),
|
|
28173
28173
|
// 指定了只用邮箱验证码
|
|
@@ -28189,9 +28189,9 @@ K&&Q(n$(i.host)),
|
|
|
28189
28189
|
// 向上层抛出错误
|
|
28190
28190
|
(null==c?void 0:c())===fX.RENDER_MESSAGE&&m(a,s,l)),[2/*return*/]}}))}))},ae=DW((function(){var e,t;return h||(p&&!o.registerDisabled&&(null===(t=null===(e=i.registerMethods)||void 0===e?void 0:e.filter((function(e){
|
|
28191
28191
|
// @ts-ignore
|
|
28192
|
-
return[Ws.Phone,Ws.EmailCode].includes(e)})))||void 0===t?void 0:t.length)?"".concat(ne("common.login")," / ").concat(ne("common.register")):ne("common.login"))}),[p,h,ne,i.registerMethods,o.registerDisabled]),se=MW((function(e){return y().createElement(tV,NW({},e,{className:"
|
|
28192
|
+
return[Ws.Phone,Ws.EmailCode].includes(e)})))||void 0===t?void 0:t.length)?"".concat(ne("common.login")," / ").concat(ne("common.register")):ne("common.login"))}),[p,h,ne,i.registerMethods,o.registerDisabled]),se=MW((function(e){return y().createElement(tV,NW({},e,{className:"genauth-g2-input",size:"large",areaCode:H,onAreaCodeChange:function(e){W(e),Z.getFieldValue(["identify"])&&Z.validateFields(["identify"])}}))}),[H,Z]),ce=Vc();
|
|
28193
28193
|
// 邮箱验证码登录
|
|
28194
|
-
return y().createElement("div",{className:"
|
|
28194
|
+
return y().createElement("div",{className:"genauth-g2-login-phone-code"},y().createElement(cT,{name:"phoneCode",form:Z,onFinish:function(t){return OW(void 0,void 0,void 0,(function(){var n,r,o,i,a,s,c,l,u,f,p,h,g,y,w;return IW(this,(function(C){switch(C.label){case 0:return I(!0),(null==d?void 0:d.length)&&!P.current?(
|
|
28195
28195
|
// message.error(t('common.loginProtocolTips'))
|
|
28196
28196
|
te.current.onError(),[2/*return*/]):(n=xj(_,t.identify,H),r=n.phoneNumber,o=n.countryCode,
|
|
28197
28197
|
// onBeforeLogin
|
|
@@ -28199,11 +28199,11 @@ null===(p=te.current)||void 0===p||p.onSpin(!0),i={type:D,data:{identity:D===Pc.
|
|
|
28199
28199
|
// 向上层抛出错误 执行绑定失败钩子
|
|
28200
28200
|
(null==u?void 0:u())===fX.RENDER_MESSAGE&&m(null!=c?c:s,l,f),[2/*return*/];case 3:
|
|
28201
28201
|
// 其实这里应该是保存两个 一个是 countryCode 一个是对应的 code
|
|
28202
|
-
return b&&b.setLoginWay("input","phone-code"===D?"phone-code":"email-code",void 0,_?{phoneCountryCode:o,areaCode:H}:void 0),"phone-code"!==D?[3/*break*/,5]:[4/*yield*/,oe(NW(NW({},t),{phoneNumber:r,phoneCountryCode:o}))];case 4:return C.sent(),[3/*break*/,7];case 5:return[4/*yield*/,ie(t)];case 6:C.sent(),C.label=7;case 7:return[2/*return*/]}}))}))},onFinishFailed:function(){return te.current.onError()},autoComplete:"off",onValuesChange:function(e){(null==e?void 0:e.identify)&&g&&g(Vs.PhoneCode,null==e?void 0:e.identify)}},y().createElement(ez,{initialValue:l===Vs.PhoneCode?c:"phone"!==C&&_||!ce?"":ce,name:"identify",className:B?"
|
|
28202
|
+
return b&&b.setLoginWay("input","phone-code"===D?"phone-code":"email-code",void 0,_?{phoneCountryCode:o,areaCode:H}:void 0),"phone-code"!==D?[3/*break*/,5]:[4/*yield*/,oe(NW(NW({},t),{phoneNumber:r,phoneCountryCode:o}))];case 4:return C.sent(),[3/*break*/,7];case 5:return[4/*yield*/,ie(t)];case 6:C.sent(),C.label=7;case 7:return[2/*return*/]}}))}))},onFinishFailed:function(){return te.current.onError()},autoComplete:"off",onValuesChange:function(e){(null==e?void 0:e.identify)&&g&&g(Vs.PhoneCode,null==e?void 0:e.identify)}},y().createElement(ez,{initialValue:l===Vs.PhoneCode?c:"phone"!==C&&_||!ce?"":ce,name:"identify",className:B?"genauth-g2-input-form remove-padding":"genauth-g2-input-form",methods:f,checkExist:!p,currentMethod:D,areaCode:H},B?y().createElement(se,{autoFocus:x}):y().createElement(TW,{className:"genauth-g2-input",size:"large",autoFocus:x,value:R,methods:V?["email-code"]:f,onChange:function(e){var t=e.target.value;X(t)},onBlur:function(e){var t=e.target.value;X(t)},prefix:y().createElement(JL,{type:"authing-a-user-line1",style:{color:"#6B7280"}})})),(G&&D===Pc.PhoneCode||K&&D===Pc.EmailCode)&&y().createElement(cT.Item,{className:"genauth-g2-input-form",validateTrigger:["onBlur","onChange"],name:"captchaCode",rules:QX(ne("common.captchaCode"))},y().createElement(sz,{className:"genauth-g2-input",size:"large",placeholder:ne("login.inputCaptchaCode"),verifyCodeUrl:J,changeCode:function(){return Q(n$(i.host))}})),y().createElement(cT.Item,{validateTrigger:["onBlur","onChange"],className:"genauth-g2-input-form",name:"code",rules:RW([],AW(QX(ne("common.captchaCode"))),!1)},y().createElement(re,null)),Boolean(null==d?void 0:d.length)&&y().createElement(Gz,{
|
|
28203
28203
|
// onChange={val => {
|
|
28204
28204
|
// acceptedAgreements.current = val
|
|
28205
28205
|
// }}
|
|
28206
|
-
onChange:function(e,t){P.current=e,T.current=t},agreements:d,showError:O}),y().createElement(cT.Item,{className:"
|
|
28206
|
+
onChange:function(e,t){P.current=e,T.current=t},agreements:d,showError:O}),y().createElement(cT.Item,{className:"genauth-g2-sumbit-form"},y().createElement(Dj,{text:ae,className:"password",ref:te}))))};// CONCATENATED MODULE: ./src/Login/core/withAuthingOtpPush/PushLoginGuideSelector.tsx
|
|
28207
28207
|
function UW(e){var t=e.defaultValue,n=e.onChange,r=e.options;return y().createElement(lI,{defaultValue:t,onChange:n,options:r,dropdownMatchSelectWidth:!1,showArrow:!0})}// CONCATENATED MODULE: ./src/LazyloadImage/index.tsx
|
|
28208
28208
|
var qW=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},VW=y().useEffect,zW=y().useState;function $W(e){var t=e.src,n=e.placeholder,r=e.className,o=e.style,i=e.alt,a=e.width,s=e.height,c=qW(zW(!1),2),l=c[0],u=c[1],d=new Image(0,0);return d.src=t,VW((function(){d.onload=function(){u(!0)}})),y().createElement(y().Fragment,null,l&&y().createElement("img",{src:t,width:a,height:s,className:r,style:o,alt:i})||n)}// CONCATENATED MODULE: ./src/Login/core/withAuthingOtpPush/HowBindClient.tsx
|
|
28209
28209
|
var HW=y().useMemo;function WW(){var e=_u().t,t=hD(),n=iD(),r=cD(),o=HW((function(){var e={appId:r,appHost:t.host,scene:"APP_OPTIONS",userPoolId:n.userPoolId};return JSON.stringify(e)}),[t,r]);return y().createElement(y().Fragment,null,y().createElement("div",{className:"guide-step"},y().createElement("div",{className:"title"},y().createElement("span",{className:"dot"}),y().createElement("span",null,"1. ",e("login.installAuthingToken"))),y().createElement("div",{className:"desc"},e("login.downloadAuthingToken")),y().createElement("div",{className:"qrcode-container space-between"},y().createElement("div",{className:"qrcode-app grey-bg"},y().createElement($W,{src:"https://cdn.authing.co/authing-assets/qrcode-download-android.png",placeholder:y().createElement(CI,null),className:"qrcode-verifier download-app",alt:e("login.downloadAndroid")}),y().createElement("div",{className:"qrcode-tips"},e("login.downloadAndroid"))),y().createElement("div",{className:"qrcode-app grey-bg"},y().createElement($W,{src:"https://cdn.authing.co/authing-assets/qrcode-download-ios.png",placeholder:y().createElement(CI,null),className:"qrcode-verifier download-app",alt:e("login.downloadIOS")}),y().createElement("div",{className:"qrcode-tips"},e("login.downloadIOS"))))),y().createElement("div",{className:"guide-step"},y().createElement("div",{className:"title"},y().createElement("span",{className:"dot"}),y().createElement("span",null,"2. ",e("login.openAppList"))),y().createElement("div",{className:"desc"},e("login.addApp")),y().createElement($W,{src:"https://files.authing.co/authing-guard/push-login-open-application-list.svg",placeholder:y().createElement(CI,null),className:"qrcode-verifier",alt:e("login.downloadIOS")})),y().createElement("div",{className:"guide-step"},y().createElement("div",{className:"title"},y().createElement("span",{className:"dot"}),y().createElement("span",null,"3. ",e("login.openLoginPage"))),y().createElement("div",{className:"desc"},e("login.scanQrcode")),y().createElement($W,{src:"https://files.authing.co/authing-guard/push-login-open-application.svg",placeholder:y().createElement(CI,null),className:"qrcode-verifier",alt:e("login.downloadIOS")})),y().createElement("div",{className:"guide-step"},y().createElement("div",{className:"title"},y().createElement("span",{className:"dot"}),y().createElement("span",null,"4. ",e("login.scanFollowingQrcode"))),y().createElement("div",{className:"qrcode-container center grey-bg",style:{marginTop:"16px",padding:"25px 0",boxSizing:"border-box"}},y().createElement(oH,{size:80,value:o,style:{padding:"5px",backgroundColor:"#fff"}}))),y().createElement("div",{className:"guide-step"},y().createElement("div",{className:"title"},y().createElement("span",{className:"dot"}),y().createElement("span",null,"5. ",e("login.relevanceApp"))),y().createElement("div",{className:"desc"},e("login.receiveMessageFromAuthingToken")),y().createElement("div",{className:"qrcode-container center grey-bg"},y().createElement($W,{src:"https://files.authing.co/authing-guard/push-login-relevance-application.svg",placeholder:y().createElement(CI,null),className:"qrcode-verifier",alt:e("login.receiveMessageFromAuthingToken")}))))}// CONCATENATED MODULE: ./src/Login/core/withAuthingOtpPush/HowUsePushLogin.tsx
|
|
@@ -28214,8 +28214,8 @@ var XW=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e)
|
|
|
28214
28214
|
// 登录注册合并
|
|
28215
28215
|
return(null==u?void 0:u.autoRegister)?l("login.inputAccount",{text:C0(t,x,f)}):l("login.inputAccount",{text:C0(nG([],tG(t),!1),x,f)});
|
|
28216
28216
|
// 登录注册分页
|
|
28217
|
-
}),[null==u?void 0:u.autoRegister,x,f,null===(t=d.authingOtpPushTabConfig)||void 0===t?void 0:t.validLoginMethods,l]);return y().createElement("div",null,!i&&y().createElement("div",{className:"push-login-error-tips-container"},y().createElement("div",{className:"push-login-error-warning-box"},y().createElement(JL,{type:"authing-error-warning-fill1",className:"icon-push-login-error-warning"}),y().createElement("div",null,l("login.getOtpLoginRequestAgain"))),y().createElement("div",{onClick:e.onchangePushLoginStatus},y().createElement(JL,{type:"authing-close-line",className:"close-line"}))),y().createElement(cT,{onFinish:function(e){return XW(n,void 0,void 0,(function(){return eG(this,(function(t){return function(e){XW(n,void 0,void 0,(function(){var t,n,i,c;return eG(this,(function(u){switch(u.label){case 0:return k(!0),(null==s?void 0:s.length)&&!m?(null==S||S.current.onError(),[2/*return*/]):e?[4/*yield*/,o({account:e,agreementIds:s.length?b:void 0})]:[2/*return*/,gC.error(l("login.enterAccount"))];case 1:return t=u.sent(),n=t.statusCode,i=t.message,c=t.data,200===n?(a(e),r({pushCodeId:(null==c?void 0:c.pushCodeId)||""})):gC.error(i),[2/*return*/]}}))}))}(e.account),[2/*return*/]}))}))},form:p},y().createElement(cT.Item,{name:"account"},y().createElement(oN,{className:"
|
|
28218
|
-
function sG(e){var t=_u().t;return y().createElement(y().Fragment,null,y().createElement("div",{className:"pending-tips"},y().createElement("div",{className:"code-success"},y().createElement(JL,{type:"authing-checkbox-circle-fill"})),y().createElement("div",null,t("login.otpLoginPendingText"))),y().createElement(cT,null,y().createElement(cT.Item,{className:"
|
|
28217
|
+
}),[null==u?void 0:u.autoRegister,x,f,null===(t=d.authingOtpPushTabConfig)||void 0===t?void 0:t.validLoginMethods,l]);return y().createElement("div",null,!i&&y().createElement("div",{className:"push-login-error-tips-container"},y().createElement("div",{className:"push-login-error-warning-box"},y().createElement(JL,{type:"authing-error-warning-fill1",className:"icon-push-login-error-warning"}),y().createElement("div",null,l("login.getOtpLoginRequestAgain"))),y().createElement("div",{onClick:e.onchangePushLoginStatus},y().createElement(JL,{type:"authing-close-line",className:"close-line"}))),y().createElement(cT,{onFinish:function(e){return XW(n,void 0,void 0,(function(){return eG(this,(function(t){return function(e){XW(n,void 0,void 0,(function(){var t,n,i,c;return eG(this,(function(u){switch(u.label){case 0:return k(!0),(null==s?void 0:s.length)&&!m?(null==S||S.current.onError(),[2/*return*/]):e?[4/*yield*/,o({account:e,agreementIds:s.length?b:void 0})]:[2/*return*/,gC.error(l("login.enterAccount"))];case 1:return t=u.sent(),n=t.statusCode,i=t.message,c=t.data,200===n?(a(e),r({pushCodeId:(null==c?void 0:c.pushCodeId)||""})):gC.error(i),[2/*return*/]}}))}))}(e.account),[2/*return*/]}))}))},form:p},y().createElement(cT.Item,{name:"account"},y().createElement(oN,{className:"genauth-g2-input",autoComplete:"off",size:"large",autoFocus:c,placeholder:N,prefix:y().createElement(JL,{type:"authing-a-user-line1",style:{color:"#6B7280"}})})),Boolean(null==s?void 0:s.length)&&y().createElement(Gz,{agreements:s,showError:E,onChange:function(e,t){v(e),w(t)}}),y().createElement(cT.Item,{className:"genauth-g2-sumbit-form"},y().createElement(Dj,{text:l("login.loginText"),htmlType:"submit",ref:S}))),y().createElement("div",{className:"how-use-push-login",onClick:function(){T(!0)}},l("login.howUsePushLogin"),"?"),y().createElement(ZW,{visible:P,onClose:function(){T(!1)}}))}// CONCATENATED MODULE: ./src/Login/core/withAuthingOtpPush/PendingLogin.tsx
|
|
28218
|
+
function sG(e){var t=_u().t;return y().createElement(y().Fragment,null,y().createElement("div",{className:"pending-tips"},y().createElement("div",{className:"code-success"},y().createElement(JL,{type:"authing-checkbox-circle-fill"})),y().createElement("div",null,t("login.otpLoginPendingText"))),y().createElement(cT,null,y().createElement(cT.Item,{className:"genauth-g2-sumbit-form"},y().createElement(ly,{block:!0,style:{width:"348px",height:"44px",background:"#F5F5F7",borderRadius:"4px",border:"none"},onClick:function(){e.onCancelLogin()}},t("login.authingOtpPushCancelLogin")))))}// CONCATENATED MODULE: ./src/Login/core/withAuthingOtpPush/index.tsx
|
|
28219
28219
|
var cG=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},lG=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},uG=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},dG=y().useCallback,fG=y().useEffect,pG=y().useRef,hG=y().useState;function mG(e){var t=this,n=e.onLoginSuccess,r=e.multipleInstance,o=e.agreements,i=uG(hG("before"),2),a=i[0],s=i[1],c=uG(hG(""),2),l=c[0],u=c[1],d=uG(hG(!0),2),f=d[0],p=d[1],h=pG(),m=uG(hG(""),2),v=m[0],g=m[1],b=function(){h.current&&clearInterval(h.current)},w=UX(),C=w.post,E=w.get,k=iD(),S=dG((function(){b(),s("before")}),[]),x=dG((function(e){void 0===e&&(e=!0),p(e)}),[]),_=dG((function(e){return cG(t,void 0,void 0,(function(){var t,n;return lG(this,(function(r){switch(r.label){case 0:return t=e.pushCodeId,n="/api/v3/check-pushcode-status?pushCodeId=".concat(t),[4/*yield*/,E(n)];case 1:return[2/*return*/,r.sent()]}}))}))}),[E]),P=dG((function(e){return cG(t,void 0,void 0,(function(){var t;return lG(this,(function(n){switch(n.label){case 0:return"/api/v2/users/me/info",t={headers:{"x-authing-userpool-id":k.userPoolId,authorization:"Bearer ".concat(e)}},[4/*yield*/,E("/api/v2/users/me/info",{},t)];case 1:return[2/*return*/,n.sent()]}}))}))}),[E,k.userPoolId]),T=function(){return cG(t,void 0,void 0,(function(){var e,t,o,i,a,s,c,u,d;return lG(this,(function(f){switch(f.label){case 0:return[4/*yield*/,_({pushCodeId:l})];case 1:return e=f.sent(),t=e.statusCode,o=e.data,i=e.message,200!==t?(gC.error(i),S(),[2/*return*/]):"AUTHORIZED"!==o.status?[3/*break*/,3]:(a=o.tokenSet.access_token,b(),[4/*yield*/,P(a)]);case 2:if(s=f.sent(),c=s.code,u=s.data,d=s.message,200===c)return null==r||r.setLoginWay("input",Vs.AuthingOtpPush),n(u,d),[2/*return*/];f.label=3;case 3:return"PUSHED"!==o.status&&(p(!1),S()),[2/*return*/]}}))}))};fG((function(){if(l)return h.current=setInterval(T,1e3),function(){b()}}),[l,_,P,n,S]);var N={before:y().createElement(aG,{defaultAccount:v,setAccount:g,onPushSuccess:function(e){s("pending"),u(e.pushCodeId)},signinByPush:function(e){return cG(t,void 0,void 0,(function(){var t,n;return lG(this,(function(r){switch(r.label){case 0:return t=e.account,n=e.agreementIds,"/api/v3/signin-by-push",[4/*yield*/,C("/api/v3/signin-by-push",{account:t,agreementIds:n})];case 1:return[2/*return*/,r.sent()]}}))}))},pushLoginStatus:f,onchangePushLoginStatus:x,agreements:o}),pending:y().createElement(sG,{onCancelLogin:S})};return y().createElement("div",null,N[a])}// CONCATENATED MODULE: ./src/Login/socialLogin/postMessage.ts
|
|
28220
28220
|
// 处理所有使用 postMessage 方式的登录
|
|
28221
28221
|
var vG=function(){return vG=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},vG.apply(this,arguments)},gG=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},yG=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},bG=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},wG=_D(),CG=y().useCallback,EG=y().useEffect,kG=y().useState,SG=(y().useMemo,function(e){var t,n=e.QRConfig,r=e.id,o=null!==(t=su.resolvedLanguage)&&void 0!==t?t:su.language,i=window.WwLogin,a=bG(kG(!0),2),s=a[0],c=a[1],l=aD().get,u=E$(),d=lD(),f=cD(),p=hD(),h=iD(),m=fD(),v=ZD(),g=sD(),b=CG((function(){return gG(void 0,void 0,void 0,(function(){var e,t,a,s;return yG(this,(function(l){return e=vG(vG({from_guard:"1",app_id:f,guard_version:"Guard@".concat(wG)},d&&{tenant_id:d}),u&&{device_id:u}),(null==p?void 0:p.isHost)&&(delete e.from_guard,e.from_hosted_guard="1",g&&(e.redirected="1",(t=_0())&&(
|
|
@@ -28251,7 +28251,7 @@ var WG={type:$G(UG),id:$G(qG),transports:HG(UG)},GG={appid:HG(UG),appidExclude:H
|
|
|
28251
28251
|
function(e){return VG(jG,YG,e)}(e));return function(e){return VG(BG,JG,e)}(t)}async function eK(e){const t=await navigator.credentials.get(function(e){return VG(jG,QG,e)}(e));return function(e){return VG(BG,ZG,e)}(t)}
|
|
28252
28252
|
// src/webauthn-json/basic/supported.ts
|
|
28253
28253
|
// CONCATENATED MODULE: ./src/Login/socialLogin/PasskeyButton/index.tsx
|
|
28254
|
-
var tK=function(){return tK=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},tK.apply(this,arguments)},nK=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},rK=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},oK=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},iK=(y().useCallback,function(e){var t,n=e.onLoginFailed,r=e.onLoginSuccess,o=null!==(t=su.resolvedLanguage)&&void 0!==t?t:su.language,i=iD(),a=oK((0,g.useState)(),2),s=a[0],c=a[1],l=oK((0,g.useState)(!1),2),u=l[0],d=l[1],f=hD().host,p=cD(),h=_D(),m=aD().responseIntercept,v=E$(),b=_u().t;return y().createElement(y().Fragment,null,y().createElement(Nj,{className:"g2-guard-third-login-btn",block:!0,loading:u,size:"large",onClick:function(){return nK(void 0,void 0,void 0,(function(){var e,t,a,l,u,g,y,b,w,C,E,k,S,x,_,P,T,N,O;return rK(this,(function(I){switch(I.label){case 0:d(!0),I.label=1;case 1:return I.trys.push([1,7,8,9]),e="".concat(f,"/api/v3/webauthn/login/initialize"),[4/*yield*/,fetch(e,{method:"POST",body:JSON.stringify({}),credentials:"include",headers:tK((N={"Content-Type":"application/json"},N[LD.langHeader]=o,N["x-authing-userpool-id"]=i.userPoolId,N["x-authing-app-id"]=p,N["x-authing-sdk-version"]=h,N["x-authing-request-from"]="Guard@".concat(h),N),v&&{"x-authing-device-id":v})})];case 2:return[4/*yield*/,I.sent().json()];case 3:return t=I.sent(),a=m(t),l=a.statusCode,u=a.data,g=a.message,y=a.onGuardHandling,200!==l?((null==y?void 0:y())===fX.RENDER_MESSAGE&&n(l,void 0,g),[2/*return*/]):(u.mediation="required",u.signal=function(){s&&s.abort();var e=new AbortController;return c(e),e.signal}(),b=u.ticket,[4/*yield*/,eK(u)]);case 4:return w=I.sent(),C="".concat(f,"/api/v3/webauthn/login/finalize"),[4/*yield*/,fetch(C,{method:"POST",body:JSON.stringify({credential:w,ticket:b}),credentials:"include",headers:tK((O={"Content-Type":"application/json"},O[LD.langHeader]=o,O["x-authing-userpool-id"]=i.userPoolId,O["x-authing-app-id"]=p,O["x-authing-sdk-version"]=h,O["x-authing-request-from"]="Guard@".concat(h),O),v&&{"x-authing-device-id":v})})];case 5:return[4/*yield*/,I.sent().json()];case 6:return E=I.sent(),k=m(E),S=k.statusCode,x=k.data,_=k.message,P=k.onGuardHandling,200!==S?((null==P?void 0:P())===fX.RENDER_MESSAGE&&n(S,void 0,_),[2/*return*/]):(r(x),[3/*break*/,9]);case 7:return T=I.sent(),n(500,void 0,T.message),[3/*break*/,9];case 8:return d(!1),[7/*endfinally*/];case 9:return[2/*return*/]}}))}))},icon:y().createElement(JL,{type:"authing-slideshow-3-line",style:{fontSize:16,marginRight:8,color:"#
|
|
28254
|
+
var tK=function(){return tK=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},tK.apply(this,arguments)},nK=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},rK=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},oK=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},iK=(y().useCallback,function(e){var t,n=e.onLoginFailed,r=e.onLoginSuccess,o=null!==(t=su.resolvedLanguage)&&void 0!==t?t:su.language,i=iD(),a=oK((0,g.useState)(),2),s=a[0],c=a[1],l=oK((0,g.useState)(!1),2),u=l[0],d=l[1],f=hD().host,p=cD(),h=_D(),m=aD().responseIntercept,v=E$(),b=_u().t;return y().createElement(y().Fragment,null,y().createElement(Nj,{className:"g2-guard-third-login-btn",block:!0,loading:u,size:"large",onClick:function(){return nK(void 0,void 0,void 0,(function(){var e,t,a,l,u,g,y,b,w,C,E,k,S,x,_,P,T,N,O;return rK(this,(function(I){switch(I.label){case 0:d(!0),I.label=1;case 1:return I.trys.push([1,7,8,9]),e="".concat(f,"/api/v3/webauthn/login/initialize"),[4/*yield*/,fetch(e,{method:"POST",body:JSON.stringify({}),credentials:"include",headers:tK((N={"Content-Type":"application/json"},N[LD.langHeader]=o,N["x-authing-userpool-id"]=i.userPoolId,N["x-authing-app-id"]=p,N["x-authing-sdk-version"]=h,N["x-authing-request-from"]="Guard@".concat(h),N),v&&{"x-authing-device-id":v})})];case 2:return[4/*yield*/,I.sent().json()];case 3:return t=I.sent(),a=m(t),l=a.statusCode,u=a.data,g=a.message,y=a.onGuardHandling,200!==l?((null==y?void 0:y())===fX.RENDER_MESSAGE&&n(l,void 0,g),[2/*return*/]):(u.mediation="required",u.signal=function(){s&&s.abort();var e=new AbortController;return c(e),e.signal}(),b=u.ticket,[4/*yield*/,eK(u)]);case 4:return w=I.sent(),C="".concat(f,"/api/v3/webauthn/login/finalize"),[4/*yield*/,fetch(C,{method:"POST",body:JSON.stringify({credential:w,ticket:b}),credentials:"include",headers:tK((O={"Content-Type":"application/json"},O[LD.langHeader]=o,O["x-authing-userpool-id"]=i.userPoolId,O["x-authing-app-id"]=p,O["x-authing-sdk-version"]=h,O["x-authing-request-from"]="Guard@".concat(h),O),v&&{"x-authing-device-id":v})})];case 5:return[4/*yield*/,I.sent().json()];case 6:return E=I.sent(),k=m(E),S=k.statusCode,x=k.data,_=k.message,P=k.onGuardHandling,200!==S?((null==P?void 0:P())===fX.RENDER_MESSAGE&&n(S,void 0,_),[2/*return*/]):(r(x),[3/*break*/,9]);case 7:return T=I.sent(),n(500,void 0,T.message),[3/*break*/,9];case 8:return d(!1),[7/*endfinally*/];case 9:return[2/*return*/]}}))}))},icon:y().createElement(JL,{type:"authing-slideshow-3-line",style:{fontSize:16,marginRight:8,color:"#2F54EB"}})},b("login.loginWithPasskey")))}),aK=function(){return aK=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},aK.apply(this,arguments)},sK=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},cK=y().useEffect,lK=y().useLayoutEffect,uK=y().useState,dK=y().useRef,fK=y().useMemo,pK=y().useCallback,hK=[Vs.Password,Vs.PhoneCode,Vs.AD,Vs.LDAP,Vs.AuthingOtpPush,Vs.EmailCode,Vs.Passkey],mK=[Vs.AppQr,Vs.WxMinQr,Vs.WechatMpQrcode,Vs.WechatworkCorpQrconnect,Vs.WECHATWORKAGENCYQRCONNECT,Vs.WECHATWORKQRCONNECTOFAUTHINGAGENCY,Vs.DingTalkQrcode,Vs.ZJZWFWQrcode],vK=[Vs.WechatMpQrcode,Vs.WxMinQr,Vs.DingTalkQrcode,Vs.WechatworkCorpQrconnect,Vs.WECHATWORKAGENCYQRCONNECT,Vs.WECHATWORKQRCONNECTOFAUTHINGAGENCY,Vs.ZJZWFWQrcode];var gK,yK=function(e){return e.length>20?"".concat(e.substring(0,20),"..."):e},bK=function(e){var t,n,r,o,i,a,s,c,l,u,d,f=e.isResetPage,p=void 0!==f&&f,h=uD().specifyDefaultLoginMethod,m=null!==(t=su.resolvedLanguage)&&void 0!==t?t:su.language,v=hD(),g=cD(),b=pD().changeModule,w=fD(),C=iD(),E=sK(function(e){var t=null==e?void 0:e.defaultLoginMethod,n=null==e?void 0:e.loginMethods;return(null==n?void 0:n.includes(t))||(t=null==n?void 0:n[0]),[t,Iz()(n,hK).length>0,Iz()(n,mK).length>0]}(v),3),k=E[0],S=E[1],x=E[2],_=null==v?void 0:v.agreementEnabled,P=_u().t,T=(d=aD().responseIntercept,function(e){var t=e.data,n=t.message,r=t.data,o=t.event,i=t.code;
|
|
28255
28255
|
// 社会化登录是用 authing-js-sdk 实现的,不用再在这里回调了
|
|
28256
28256
|
// if (source === 'authing' && eventType === 'socialLogin') {
|
|
28257
28257
|
// return
|
|
@@ -28323,7 +28323,7 @@ localStorage.setItem("".concat($F,"_").concat(g),JSON.stringify({connectionId:nu
|
|
|
28323
28323
|
// 如果有第三方身份源开启监听
|
|
28324
28324
|
return(Ee.length>0||ke.length>0)&&(null==t||t.addEventListener("message",e)),function(){null==t||t.removeEventListener("message",e)}}),[pe,j,de,T]),y().createElement("div",{className:"g2-view-container g2-view-login"},y().createElement("div",{className:"g2-view-container-inner"},Se?y().createElement(y().Fragment,null,y().createElement("div",{className:"g2-view-header"},y().createElement("img",{src:null==v?void 0:v.logo,alt:"",className:"icon"}),y().createElement("div",{className:"title"},null==v?void 0:v.title),!!(null==C?void 0:C.welcomeMessage)&&y().createElement("div",{className:"title-description"},null==C?void 0:C.welcomeMessage[m])),y().createElement("div",{className:"no-login-methods-view"},y().createElement(JL,{type:"authing-bianzu",style:{width:178,height:120}}),y().createElement("span",{className:"no-login-methods-desc"},P("login.noLoginMethodsDesc")))):y().createElement(y().Fragment,null,!B&&S&&x&&y().createElement("div",{className:"g2-qrcode-switch"},y().createElement(vv,{placement:"leftTop",content:ve,overlayClassName:ve===su.t("login.moreWays")?"long-switch-text":"switch-text",getPopupContainer:function(e){return e?e.parentElement:document.body}},y().createElement("div",{className:"switch-img",onClick:function(){gC.destroy(),hK.includes(O)?(M("qrcode"),I(ie)):mK.includes(O)&&(M("input"),I(oe))}},y().createElement("div",{className:"imgae-mask"}),y().createElement(JL,{type:"authing-a-erweima22",className:"qrcode-switch-image ".concat(ge)}),y().createElement(JL,{type:"authing-diannao",className:"qrcode-switch-image ".concat(ye)})))),y().createElement("div",{className:"g2-view-header"},y().createElement("img",{src:null==v?void 0:v.logo,alt:"",className:"icon"}),y().createElement("div",{className:"title"},B?P("login.selectLoginAccount"):null==v?void 0:v.title),!!(null==C?void 0:C.welcomeMessage)&&y().createElement("div",{className:"title-description"},null==C?void 0:C.welcomeMessage[m]),null===(u=null==te?void 0:te.map)||void 0===u?void 0:u.call(te,(function(e,t){
|
|
28325
28325
|
// @ts-ignore
|
|
28326
|
-
return y().createElement(yE,{className:"
|
|
28326
|
+
return y().createElement(yE,{className:"genauth-header-tag",style:{color:null==e?void 0:e.color,backgroundColor:null==e?void 0:e.backgroundColor},key:t},e.name)}))),B?y().createElement(mW,{multipleInstance:j,referMultipleState:U,changeModule:b}):y().createElement(y().Fragment,null,S&&["input","collapsed"].includes(R)&&y().createElement("div",{className:ge},p?y().createElement(SW,null):y().createElement("div",{className:"g2-view-tabs"},y().createElement(xR,{destroyInactiveTabPane:!0,onChange:function(e){var t;I(e),gC.destroy(),null===(t=null==w?void 0:w.onLoginTabChange)||void 0===t||t.call(w,e)},activeKey:O},null==He?void 0:He.flat())),y().createElement("div",{className:"g2-tips-line"},!se&&!p&&y().createElement("div",null,y().createElement(Nj,{type:"link",className:"link-like forget-password-link",onClick:function(){return null==b?void 0:b(FD.FORGET_PWD,{})}},P("login.forgetPwd")),(K>=2||Q)&&y().createElement("span",{style:{margin:"0 4px",color:"#D1D1D6"}},"丨")),p&&y().createElement(Nj,{type:"link",onClick:function(){null==b||b(FD.LOGIN)}},P("common.backLoginPage")),(K>=2||Q)&&y().createElement(fv,{title:P("common.feedback")},y().createElement("div",{className:"touch-tip question-feedback",onClick:function(){return null==b?void 0:b(FD.ANY_QUESTIONS,{identify:X.current[O]})}},y().createElement(JL,{type:"authing-a-question-line1",style:{fontSize:16}}))),!ce&&y().createElement("span",{className:"go-to-register"},y().createElement(Nj,{type:"link",className:"link-like register-link",onClick:function(){return null==b?void 0:b(FD.REGISTER,{})}},P("common.registerImmediate"))))),x&&["qrcode","collapsed"].includes(R)&&y().createElement("div",{className:"g2-view-tabs ".concat(ye," ").concat(le&&"hidden_tab")},y().createElement(xR,{destroyInactiveTabPane:!0,defaultActiveKey:ue,onChange:function(e){var t;gC.destroy(),null===(t=null==w?void 0:w.onLoginTabChange)||void 0===t||t.call(w,e)}},Ge))),y().createElement("div",{className:"g2-social-login"},y().createElement(aW,{appId:g,config:v,multipleInstance:j,
|
|
28327
28327
|
// onLogin={onLogin}
|
|
28328
28328
|
onLoginSuccess:de,onLoginFailed:pe,socialConnectionObjs:Ee,enterpriseConnectionObjs:ke})))),y().createElement(SD,{langRange:null==v?void 0:v.langRange,onLangChange:null==w?void 0:w.onLangChange}))},wK=function(){return wK=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},wK.apply(this,arguments)},CK=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},EK=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};!function(e){e.VerifyEmail="verify-email",e.VerifySms="verify-sms",e.VerifyTotp="verify-totp",e.VerifyFace="verify-face",e.AssociateFace="associate-face",e.PasskeyBind="passkey-bind",e.PasskeyVerify="passkey-verify"}(gK||(gK={}));var kK=function(e,t){return CK(void 0,void 0,void 0,(function(){return EK(this,(function(n){switch(n.label){case 0:return[4/*yield*/,(0,BX().authFlow)(e,wK({},t))];case 1:return[2/*return*/,n.sent()]}}))}))},SK=function(e){return CK(void 0,void 0,void 0,(function(){var t;return EK(this,(function(n){switch(n.label){case 0:return t=e.mfaToken,[4/*yield*/,(0,BX().post)("/api/v3/webauthn/mfa-bind/initialize",{ignoreExcludeCredentials:!0},{headers:{authorization:"Bearer ".concat(t)}})];case 1:return[2/*return*/,n.sent()]}}))}))},xK=function(){var e,t=mD();return(e={})[gK.VerifyEmail]=function(e){return t?kK(gK.VerifyEmail,e):function(e){return CK(void 0,void 0,void 0,(function(){var t,n,r;return EK(this,(function(o){switch(o.label){case 0:return t=e.email,n=e.code,r=e.mfaToken,[4/*yield*/,(0,BX().post)("/api/v2/applications/mfa/email/verify",{email:t,code:n},{headers:{authorization:"Bearer ".concat(r)}})];case 1:return[2/*return*/,o.sent()]}}))}))}(e)},e[gK.VerifySms]=function(e){return t?kK(gK.VerifySms,e):function(e){return CK(void 0,void 0,void 0,(function(){var t,n,r,o;return EK(this,(function(i){switch(i.label){case 0:return t=e.phone,n=e.code,r=e.mfaToken,o=e.phoneCountryCode,[4/*yield*/,(0,BX().post)("/api/v2/applications/mfa/sms/verify",{phone:t,code:n,phoneCountryCode:o},{headers:{authorization:"Bearer ".concat(r)}})];case 1:return[2/*return*/,i.sent()]}}))}))}(e)},e[gK.VerifyTotp]=function(e){return t?kK(gK.VerifyTotp,e):function(e){return CK(void 0,void 0,void 0,(function(){var t,n;return EK(this,(function(r){switch(r.label){case 0:return t=e.totp,n=e.mfaToken,[4/*yield*/,(0,BX().post)("/api/v2/applications/mfa/totp/verify",{totp:t},{headers:{authorization:"Bearer ".concat(n)}})];case 1:return[2/*return*/,r.sent()]}}))}))}(e)},e[gK.VerifyFace]=function(e){return t?kK(gK.VerifyFace,e):function(e){return CK(void 0,void 0,void 0,(function(){var t,n;return EK(this,(function(r){switch(r.label){case 0:return t=e.photo,n=e.mfaToken,[4/*yield*/,(0,BX().post)("/api/v2/applications/mfa/face/verify",{photo:t},{headers:{authorization:"Bearer ".concat(n)}})];case 1:return[2/*return*/,r.sent()]}}))}))}(e)},e[gK.AssociateFace]=function(e){return t?kK(gK.AssociateFace,e):function(e){return CK(void 0,void 0,void 0,(function(){var t,n,r,o;return EK(this,(function(i){switch(i.label){case 0:return t=e.photoA,n=e.photoB,r=e.isExternalPhoto,o=e.mfaToken,[4/*yield*/,(0,BX().post)("/api/v2/mfa/face/associate",{photoA:t,photoB:n,isExternalPhoto:r},{headers:{authorization:"Bearer ".concat(o)}})];case 1:return[2/*return*/,i.sent()]}}))}))}(e)},e[gK.PasskeyBind]=function(e){return t?kK(gK.PasskeyBind,e):null;
|
|
28329
28329
|
// return AssociateFace(content)
|
|
@@ -28331,15 +28331,15 @@ onLoginSuccess:de,onLoginFailed:pe,socialConnectionObjs:Ee,enterpriseConnectionO
|
|
|
28331
28331
|
// return AssociateFace(content)
|
|
28332
28332
|
},e};
|
|
28333
28333
|
/* harmony default export */const _K=function(e){(0,g.useEffect)(e,[])};// CONCATENATED MODULE: ./src/MFA/core/email.tsx
|
|
28334
|
-
var PK,TK,NK=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},OK=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},IK=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},AK=y().useRef,RK=y().useState,MK=function(e){e.mfaToken;var t=e.onBind,n=(e.config,AK(null)),r=_u().t,o=IK(cT.useForm(),1)[0];return y().createElement(y().Fragment,null,y().createElement("p",{className:"
|
|
28334
|
+
var PK,TK,NK=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},OK=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},IK=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},AK=y().useRef,RK=y().useState,MK=function(e){e.mfaToken;var t=e.onBind,n=(e.config,AK(null)),r=_u().t,o=IK(cT.useForm(),1)[0];return y().createElement(y().Fragment,null,y().createElement("p",{className:"genauth-g2-mfa-title"},r("common.mfaCertification")),y().createElement("p",{className:"genauth-g2-mfa-tips"},r("common.bindEmailDoc")),y().createElement(cT,{form:o,onSubmitCapture:function(){return n.current.onSpin(!0)},onFinish:function(e){return NK(void 0,[e],void 0,(function(e){var r,i,a=e.email;return OK(this,(function(e){switch(e.label){case 0:return[4/*yield*/,o.validateFields()];case 1:e.sent(),null===(i=n.current)||void 0===i||i.onSpin(!1);try{t(a)}catch(e){r=JSON.parse(null==e?void 0:e.message),n.current.onError(),gC.error(r.message)}return[2/*return*/]}}))}))},onFinishFailed:function(){return n.current.onError()}},y().createElement(hU.Email,{className:"genauth-g2-input-form",name:"email",form:o,
|
|
28335
28335
|
// checkRepeat={true}
|
|
28336
|
-
required:!0},y().createElement(oN,{className:"
|
|
28336
|
+
required:!0},y().createElement(oN,{className:"genauth-g2-input",autoComplete:"off",size:"large",placeholder:r("login.inputEmail"),prefix:y().createElement(JL,{type:"authing-a-mail-line3",style:{color:"#6B7280"}})})),y().createElement(Dj,{text:r("common.sure"),ref:n})))},LK=function(e){var t=e.email,n=e.mfaToken,r=e.onVerify,o=e.sendCodeRef,i=e.codeLength,a=BX().post,s=xK()[gK.VerifyEmail],c=AK(null),l=_u().t,u=IK(cT.useForm(),1)[0],d=IK(RK(!1),2),f=d[0],p=d[1];_K((function(){var e;null===(e=o.current)||void 0===e||e.click()}));var h=function(e){return NK(void 0,void 0,void 0,(function(){var e,o,i,a,l,d,f,p;return OK(this,(function(h){switch(h.label){case 0:return null===(d=c.current)||void 0===d||d.onSpin(!0),e=u.getFieldValue("mfaCode"),[4/*yield*/,s({mfaToken:n,email:t,code:e})];case 1:return o=h.sent(),i=o.isFlowEnd,a=o.data,l=o.onGuardHandling,null===(f=c.current)||void 0===f||f.onSpin(!1),i?r(200,a):(null===(p=c.current)||void 0===p||p.onError(),null==l||l()),[2/*return*/]}}))}))};return y().createElement(y().Fragment,null,y().createElement("p",{className:"genauth-g2-mfa-title"},l("common.mfaCertification")),y().createElement("p",{className:"genauth-g2-mfa-tips"},f?"".concat(l("login.verifyCodeSended")," ").concat(f0(t)):l("common.emailMfaCheck")),y().createElement(cT,{form:u,onFinish:h,onFinishFailed:function(){var e;return null===(e=c.current)||void 0===e?void 0:e.onError()}},y().createElement(rB,{codeLength:i,ruleKeyword:l("common.captchaCode")},y().createElement(SB,{length:i,onFinish:h})),y().createElement(HU,{btnRef:o,setSent:p,beforeSend:function(){return NK(void 0,void 0,void 0,(function(){var e,n,r,o,i;return OK(this,(function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),[4/*yield*/,a("/api/v2/email/send",{email:t,scene:Nc.MFA_VERIFY_CODE})];case 1:return e=s.sent(),n=e.code,r=e.message,2080===e.apiCode?(
|
|
28337
28337
|
// 一分钟只能发一次邮箱验证码的提示信息,特殊处理
|
|
28338
|
-
gC.error(r),[2/*return*/,!1]):200===n?(p(!0),[2/*return*/,!0]):(gC.error(r||l("login.sendCodeTimeout")),[2/*return*/,!1]);case 2:if("ECONNABORTED"===(o=s.sent()).code)return gC.error(l("login.sendCodeTimeout")),[2/*return*/,!1];try{i=JSON.parse(o.message),gC.error(i.message)}catch(e){gC.error(o)}return[2/*return*/,!1];case 3:return[2/*return*/]}}))}))},type:"link"}),y().createElement(Dj,{text:l("common.sure"),ref:c,className:"g2-mfa-submit-button"})))},DK=function(e){var t=e.email,n=e.mfaToken,r=e.mfaLogin,o=e.config,i=IK(RK(t),2),a=i[0],s=i[1],c=AK(null),l=iD(),u=null==l?void 0:l.verifyCodeLength;return y().createElement(y().Fragment,null,a?y().createElement(LK,{mfaToken:n,email:a,onVerify:function(e,t){r(e,t)},sendCodeRef:c,codeLength:null!=u?u:4}):y().createElement(MK,{config:o,mfaToken:n,onBind:function(e){var t;s(e),null===(t=c.current)||void 0===t||t.click()}}))},FK=function(){return FK=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},FK.apply(this,arguments)},jK=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},BK=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},UK=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},qK=y().useCallback,VK=y().useMemo,zK=y().useRef,$K=y().useState,HK=function(e){e.mfaToken;var t=e.onBind,n=(e.config,e.areaCode),r=e.setAreaCode,o=e.isInternationSms,i=e.mfaConfigsMap,a=zK(null),s=_u().t,c=UK(cT.useForm(),1)[0],l=qK((function(e){return o?y().createElement(tV,FK({},e,{className:"
|
|
28338
|
+
gC.error(r),[2/*return*/,!1]):200===n?(p(!0),[2/*return*/,!0]):(gC.error(r||l("login.sendCodeTimeout")),[2/*return*/,!1]);case 2:if("ECONNABORTED"===(o=s.sent()).code)return gC.error(l("login.sendCodeTimeout")),[2/*return*/,!1];try{i=JSON.parse(o.message),gC.error(i.message)}catch(e){gC.error(o)}return[2/*return*/,!1];case 3:return[2/*return*/]}}))}))},type:"link"}),y().createElement(Dj,{text:l("common.sure"),ref:c,className:"g2-mfa-submit-button"})))},DK=function(e){var t=e.email,n=e.mfaToken,r=e.mfaLogin,o=e.config,i=IK(RK(t),2),a=i[0],s=i[1],c=AK(null),l=iD(),u=null==l?void 0:l.verifyCodeLength;return y().createElement(y().Fragment,null,a?y().createElement(LK,{mfaToken:n,email:a,onVerify:function(e,t){r(e,t)},sendCodeRef:c,codeLength:null!=u?u:4}):y().createElement(MK,{config:o,mfaToken:n,onBind:function(e){var t;s(e),null===(t=c.current)||void 0===t||t.click()}}))},FK=function(){return FK=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},FK.apply(this,arguments)},jK=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},BK=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},UK=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},qK=y().useCallback,VK=y().useMemo,zK=y().useRef,$K=y().useState,HK=function(e){e.mfaToken;var t=e.onBind,n=(e.config,e.areaCode),r=e.setAreaCode,o=e.isInternationSms,i=e.mfaConfigsMap,a=zK(null),s=_u().t,c=UK(cT.useForm(),1)[0],l=qK((function(e){return o?y().createElement(tV,FK({},e,{className:"genauth-g2-input",size:"large",areaCode:n,onAreaCodeChange:function(e){r(e),c.getFieldValue(["phone"])&&c.validateFields(["phone"])},maxLength:20})):y().createElement(ZU,FK({},e,{className:"genauth-g2-input",autoComplete:"off",size:"large",placeholder:s("login.inputPhone"),prefix:y().createElement(JL,{type:"authing-a-smartphone-line1",style:{color:"#6B7280"}}),maxLength:20}))}),[n,c,o,r,s]);return y().createElement(y().Fragment,null,y().createElement("h3",{className:"genauth-g2-mfa-title"},s("common.mfaCertification")),y().createElement("p",{className:"genauth-g2-mfa-tips"},i.get(yB.SMS)?s("login.bindWarning"):s("login.bindPhoneInfo")),i.get(yB.SMS)?y().createElement("div",{style:{display:"flex",justifyContent:"center"}},y().createElement(JL,{type:"authing-bianzu",style:{width:178,height:120}})):y().createElement(cT,{form:c,onSubmitCapture:function(){return a.current.onSpin(!0)},onFinish:function(e){return jK(void 0,[e],void 0,(function(e){var n,r,o=e.phone;return BK(this,(function(e){switch(e.label){case 0:return[4/*yield*/,c.validateFields()];case 1:e.sent(),null===(n=a.current)||void 0===n||n.onSpin(!1);try{t(o)}catch(e){
|
|
28339
28339
|
// do nothing
|
|
28340
|
-
null===(r=a.current)||void 0===r||r.onError()}return[2/*return*/]}}))}))},onFinishFailed:function(){return a.current.onError()}},y().createElement(hU.Phone,{className:o?"
|
|
28340
|
+
null===(r=a.current)||void 0===r||r.onError()}return[2/*return*/]}}))}))},onFinishFailed:function(){return a.current.onError()}},y().createElement(hU.Phone,{className:o?"genauth-g2-input-form remove-padding":"genauth-g2-input-form",name:"phone",form:c,
|
|
28341
28341
|
// checkRepeat={true}
|
|
28342
|
-
required:!0,areaCode:n},y().createElement(l,null)),y().createElement(Dj,{text:s("common.sure"),ref:a})))},WK=function(e){var t=e.mfaToken,n=e.phone,r=e.userPhone,o=e.onVerify,i=e.sendCodeRef,a=e.codeLength,s=void 0===a?4:a,c=e.areaCode,l=e.phoneCountryCode,u=e.isInternationSms,d=ZD(),f=zK(null),p=_u().t,h=UK(cT.useForm(),1)[0],m=UK($K(!1),2),v=m[0],g=m[1],b=xj(u,n,c),w=b.phoneNumber,C=b.countryCode;_K((function(){var e;null===(e=i.current)||void 0===e||e.click()}));var E=xK()[gK.VerifySms],k=function(e){return jK(void 0,void 0,void 0,(function(){var e,r,i,a,s,c,u;return BK(this,(function(d){switch(d.label){case 0:return null===(c=f.current)||void 0===c||c.onSpin(!0),e=h.getFieldValue("mfaCode"),[4/*yield*/,E({mfaToken:t,phone:n,code:e,phoneCountryCode:l||C})];case 1:return r=d.sent(),i=r.isFlowEnd,a=r.data,s=r.onGuardHandling,null===(u=f.current)||void 0===u||u.onSpin(!1),i?o(200,a):(f.current.onError(),null==s||s()),[2/*return*/]}}))}))},S=VK((function(){return v?"".concat(p("login.verifyCodeSended")," ").concat(u?l||C:""," ").concat(p0(n)):p("common.SmsMfaCheck")}),[C,u,n,l,v,p]);return y().createElement(y().Fragment,null,y().createElement("h3",{className:"
|
|
28342
|
+
required:!0,areaCode:n},y().createElement(l,null)),y().createElement(Dj,{text:s("common.sure"),ref:a})))},WK=function(e){var t=e.mfaToken,n=e.phone,r=e.userPhone,o=e.onVerify,i=e.sendCodeRef,a=e.codeLength,s=void 0===a?4:a,c=e.areaCode,l=e.phoneCountryCode,u=e.isInternationSms,d=ZD(),f=zK(null),p=_u().t,h=UK(cT.useForm(),1)[0],m=UK($K(!1),2),v=m[0],g=m[1],b=xj(u,n,c),w=b.phoneNumber,C=b.countryCode;_K((function(){var e;null===(e=i.current)||void 0===e||e.click()}));var E=xK()[gK.VerifySms],k=function(e){return jK(void 0,void 0,void 0,(function(){var e,r,i,a,s,c,u;return BK(this,(function(d){switch(d.label){case 0:return null===(c=f.current)||void 0===c||c.onSpin(!0),e=h.getFieldValue("mfaCode"),[4/*yield*/,E({mfaToken:t,phone:n,code:e,phoneCountryCode:l||C})];case 1:return r=d.sent(),i=r.isFlowEnd,a=r.data,s=r.onGuardHandling,null===(u=f.current)||void 0===u||u.onSpin(!1),i?o(200,a):(f.current.onError(),null==s||s()),[2/*return*/]}}))}))},S=VK((function(){return v?"".concat(p("login.verifyCodeSended")," ").concat(u?l||C:""," ").concat(p0(n)):p("common.SmsMfaCheck")}),[C,u,n,l,v,p]);return y().createElement(y().Fragment,null,y().createElement("h3",{className:"genauth-g2-mfa-title"},p("common.mfaCertification")),y().createElement("p",{className:"genauth-g2-mfa-tips"},S),y().createElement(cT,{form:h,onFinish:k,onFinishFailed:function(){return f.current.onError()}},y().createElement(rB,{codeLength:s,ruleKeyword:p("common.captchaCode")},y().createElement(SB,{length:s,onFinish:k})),y().createElement(HU,{btnRef:i,beforeSend:function(){return jK(void 0,void 0,void 0,(function(){var e,t;return BK(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4/*yield*/,d.sendSmsCode(r||w,l||C,Oi.SCENE_TYPE_MFA_VERIFY)];case 1:return n.sent(),[2/*return*/,!0];case 2:if("ECONNABORTED"===(e=n.sent()).code)return gC.error(p("login.sendCodeTimeout")),[2/*return*/,!1];try{t=JSON.parse(e.message),gC.error(t.message)}catch(t){gC.error(e)}return[2/*return*/,!1];case 3:return[2/*return*/]}}))}))},type:"link",setSent:g}),y().createElement(Dj,{text:p("common.sure"),ref:f,className:"g2-mfa-submit-button"})))},GK=function(e){var t,n,r=e.mfaLogin,o=e.config,i=e.initData,a=i.mfaPhone,s=i.mfaToken,c=i.mfaPhoneCountryCode,l=e.mfaConfigsMap,u=UK($K(a),2),d=u[0],f=u[1],p=zK(null),h=iD(),m=null==h?void 0:h.verifyCodeLength,v=UK($K((null===(t=null==h?void 0:h.internationalSmsConfig)||void 0===t?void 0:t.defaultISOType)||"CN"),2),g=v[0],b=v[1],w=Boolean(null===(n=null==h?void 0:h.internationalSmsConfig)||void 0===n?void 0:n.enabled);
|
|
28343
28343
|
// todo 后续改 不用 phone 作为判断模式
|
|
28344
28344
|
return y().createElement(y().Fragment,null,d?y().createElement(WK,{mfaToken:s,phone:d,userPhone:a,phoneCountryCode:c,isInternationSms:w,onVerify:function(e,t){r(e,t)},codeLength:null!=m?m:4,sendCodeRef:p,areaCode:g}):y().createElement(HK,{config:o,mfaToken:s,areaCode:g,setAreaCode:b,isInternationSms:w,onBind:function(e){var t;f(e),null===(t=p.current)||void 0===t||t.click()},mfaConfigsMap:l}))},KK=function(){if(PK)return PK},YK={video:{width:210,height:210}};function JK(){var e=KK();if(e)return e.nets.tinyFaceDetector}!function(e){e.NotAllowedError="NotAllowedError",e.AbortError="AbortError",e.NotReadableError="NotReadableError",e.OverconstrainedError="OverconstrainedError",e.SecurityError="SecurityError"}(TK||(TK={}));var QK,ZK,XK,eY=y().createContext(void 0),tY=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},nY=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},rY=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},oY=y().useCallback,iY=y().useContext,aY=y().useEffect,sY=y().useRef,cY=y().useState,lY=function(e){var t,n,r,o=iY(eY),i=UX().postForm,a=_u().t,s=rY(cY("ready"),2),c=s[0],l=s[1],u=rY(cY(0),2),d=u[0],f=u[1],p=xK(),h=oD().spinChange,m=p[gK.VerifyFace],v=p[gK.AssociateFace],g=sY(null),b=sY(null),w=sY(),C=sY(),E=sY(),k=sY(0),S=iD(),x=null==S?void 0:S.cdnBase,_=function(e){return{offset:7*e,dashStyle:{}}}(d),P=_.offset,T=_.dashStyle,N=null!==(n=null===(t=null==S?void 0:S.mfa)||void 0===t?void 0:t.faceScore)&&void 0!==n?n:.65;
|
|
28345
28345
|
// 预加载数据
|
|
@@ -28363,16 +28363,16 @@ w.current&&clearInterval(w.current),tY(void 0,void 0,void 0,(function(){var t,n,
|
|
|
28363
28363
|
// 识别失败,但是有结果,设置相似性
|
|
28364
28364
|
f((function(){return r.score/N*100})):f(10),[2/*return*/]}}))}))}),[]);
|
|
28365
28365
|
// get base 64
|
|
28366
|
-
return y().createElement("div",null,y().createElement("h3",{className:"
|
|
28366
|
+
return y().createElement("div",null,y().createElement("h3",{className:"genauth-g2-mfa-title"},a("common.mfaCertification")),"ready"===c||"login"===(null==o?void 0:o.mfaBackState)?y().createElement(y().Fragment,null,y().createElement("p",{className:"genauth-g2-mfa-tips"},(null===(r=e.initData)||void 0===r?void 0:r.faceMfaEnabled)?a("common.faceCheck"):a("common.faceText2")),y().createElement(Xj,{className:"g2-mfa-face-image",width:247,height:131,src:"".concat(x,"/face.png"),alt:""}),y().createElement(Dj,{onClick:function(){
|
|
28367
28367
|
// 设置状态之前 校验是否支持面容 (api 和 设备)
|
|
28368
28368
|
// TODO 之后添加人脸识别插件支持 减小包体积
|
|
28369
|
-
navigator.mediaDevices?(l("identifying"),(null==o?void 0:o.setMfaBackState)&&o.setMfaBackState("check"),R()):gC.error(a("login.mediaDevicesSupport"))},text:a("common.faceText3"),className:"mfa-face"})):y().createElement("p",{className:"
|
|
28369
|
+
navigator.mediaDevices?(l("identifying"),(null==o?void 0:o.setMfaBackState)&&o.setMfaBackState("check"),R()):gC.error(a("login.mediaDevicesSupport"))},text:a("common.faceText3"),className:"mfa-face"})):y().createElement("p",{className:"genauth-g2-mfa-tips"},a("common.faceCheck")),y().createElement("div",{className:"g2-mfa-face-identifying",style:{display:"ready"!==c&&"login"!==(null==o?void 0:o.mfaBackState)?"flex":"none"}},y().createElement("video",{className:"video-round",ref:g,style:{transform:"rotateY(180deg)"},
|
|
28370
28370
|
// onLoadedMetadata={() => onIdentify()}
|
|
28371
|
-
id:"inputVideo",autoPlay:!0,muted:!0,playsInline:!0}),y().createElement("div",{className:"video-round mesh",style:{display:"retry"===c?"flex":"none"},onClick:function(){l("identifying"),f(0),R()}},a("common.faceText4")),y().createElement("div",{className:"video-round ring"},y().createElement("svg",{width:240,height:240,fill:"none"},y().createElement("circle",{className:"svg-circle-running",style:T,strokeDasharray:700,strokeDashoffset:700-P,cx:120,cy:120,r:110})))),y().createElement("canvas",{style:{width:210,height:210,opacity:0,position:"absolute",display:"none"},ref:b}))},uY=function(){return uY=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},uY.apply(this,arguments)},dY=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},fY=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},pY=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},hY=y().useRef,mY=function(e){var t=e.changeModule,n=e.initData,r=_u().t;return y().createElement(y().Fragment,null,y().createElement("p",{className:"
|
|
28371
|
+
id:"inputVideo",autoPlay:!0,muted:!0,playsInline:!0}),y().createElement("div",{className:"video-round mesh",style:{display:"retry"===c?"flex":"none"},onClick:function(){l("identifying"),f(0),R()}},a("common.faceText4")),y().createElement("div",{className:"video-round ring"},y().createElement("svg",{width:240,height:240,fill:"none"},y().createElement("circle",{className:"svg-circle-running",style:T,strokeDasharray:700,strokeDashoffset:700-P,cx:120,cy:120,r:110})))),y().createElement("canvas",{style:{width:210,height:210,opacity:0,position:"absolute",display:"none"},ref:b}))},uY=function(){return uY=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},uY.apply(this,arguments)},dY=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},fY=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},pY=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},hY=y().useRef,mY=function(e){var t=e.changeModule,n=e.initData,r=_u().t;return y().createElement(y().Fragment,null,y().createElement("p",{className:"genauth-g2-mfa-title"},r("common.mfaCertification")),y().createElement("p",{className:"genauth-g2-mfa-tips"},r("common.otpText1")),y().createElement("div",{style:{display:"flex",justifyContent:"center"}},y().createElement(JL,{type:"authing-otp",style:{width:247,height:131}})),y().createElement(Dj,{text:r("common.sure"),onClick:function(){return t(FD.BIND_TOTP,n)},className:"g2-mfa-submit-button bind-totp"}))},vY=function(e){var t=e.mfaToken,n=e.mfaLogin,r=e.changeModule,o=_u().t,i=pY(cT.useForm(),1)[0],a=hY(null),s=uD(),c=xK()[gK.VerifyTotp],l=pY(dj((function(){return dY(void 0,void 0,void 0,(function(){var e,r,o,s,l,u,d;return fY(this,(function(f){switch(f.label){case 0:return null===(u=a.current)||void 0===u||u.onSpin(!0),e=i.getFieldValue("mfaCode"),[4/*yield*/,c({totp:e,mfaToken:t})];case 1:return r=f.sent(),o=r.isFlowEnd,s=r.data,l=r.onGuardHandling,null===(d=a.current)||void 0===d||d.onSpin(!1),o?n(200,s):(a.current.onError(),null==l||l()),[2/*return*/]}}))}))}),[t]),2),u=l[1];return y().createElement(y().Fragment,null,y().createElement("p",{className:"genauth-g2-mfa-title"},o("common.mfaCertification")),y().createElement("p",{className:"genauth-g2-mfa-tips"},o("login.inputSixCode")),y().createElement(cT,{form:i,onSubmitCapture:function(){},onFinish:u,onFinishFailed:function(){return a.current.onError()}},y().createElement(rB,{codeLength:6},y().createElement(SB,{length:6,showDivider:!1,gutter:"10px",onFinish:u})),y().createElement(Dj,{text:o("common.sure"),ref:a}),y().createElement("p",{className:"genauth-g2-mfa-totp-recoveryCode"},o("common.hasLooseSaftyCode"),y().createElement(Nj,{type:"link",onClick:function(){r(FD.RECOVERY_CODE,uY({},s))}},o("common.useRecoverCode")))))},gY=function(e){var t=e.changeModule,n=e.initData,r=e.mfaLogin;return y().createElement(y().Fragment,null,n.totpMfaEnabled?y().createElement(vY,{mfaToken:n.mfaToken,mfaLogin:r,changeModule:t}):y().createElement(mY,{initData:n,changeModule:t}))},yY=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},bY=y().useMemo,wY=y().useState,CY=((QK={})[yB.EMAIL]={title:function(){return su.t("common.EmailVerification")},icon:"authing-mail"},QK[yB.SMS]={title:function(){return su.t("common.SMS")},icon:"authing-phone"},QK[yB.TOTP]={title:function(){return su.t("common.OTPVerification")},icon:"authing-totp"},QK[yB.FACE]={title:function(){return su.t("common.faceVerification")},icon:"authing-face"},QK[yB.PASSKEY]={title:function(){return"Passkey"},icon:"authing-slideshow-3-line"},QK),EY=function(e){var t=e.method,n=e.onChangeMethod,r=yY(wY(t),2),o=r[0],i=r[1],a=_u().t,s=uD().applicationMfa,c=bY((function(){return s.filter((function(e){return Object.keys(CY).includes(e.mfaPolicy)})).filter((function(e){return e.mfaPolicy!==o})).filter((function(e){if(e.mfaPolicy===yB.FACE){var t=KK();return Boolean(t)}return!0})).sort((function(e,t){return e.sort-t.sort})).map((function(e){return y().createElement(Nj,{className:"g2-guard-mfa-methods-btn",onClick:function(t){n(e.mfaPolicy),i(e.mfaPolicy)},key:e.mfaPolicy},y().createElement(JL,{type:CY[e.mfaPolicy].icon}),"".concat(CY[e.mfaPolicy].title()))}))}),[s,o,n]);return y().createElement(y().Fragment,null,0!==c.length&&y().createElement(y().Fragment,null,y().createElement("div",{style:{minHeight:32}}),y().createElement("div",{className:"g2-mfa-method"},y().createElement("div",{className:"g2-mfa-method-title"},a("login.otherVerifyWay")),c)))},kY={
|
|
28372
28372
|
// 待添加
|
|
28373
|
-
2021:{action:"changeModule",module:FD.LOGIN},1700:{action:"insideFix",message:"verification failed, let components inside fix is fine."},1701:{action:"insideFix",message:"verification failed, let components inside fix is fine."},1702:{action:"insideFix",message:"verification failed, let components inside fix is fine."},500:{action:"message"},6001:{action:"message"},602:{action:"message"}},SY=function(){return SY=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},SY.apply(this,arguments)},xY=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},_Y=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},PY=function(e){return xY(void 0,void 0,void 0,(function(){return _Y(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4/*yield*/,XG(e)];case 1:return[2/*return*/,t.sent()];case 2:return t.sent(),[3/*break*/,3];case 3:return[2/*return*/]}}))}))},TY=function(e){return xY(void 0,void 0,void 0,(function(){return _Y(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4/*yield*/,eK(SY({mediation:"required"},e))];case 1:return[2/*return*/,t.sent()];case 2:return t.sent(),[3/*break*/,3];case 3:return[2/*return*/]}}))}))},NY=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},OY=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},IY=function(e){var t=e.mfaToken,n=e.mfaLogin,r=e.mfaConfigsMap,o=y().useRef(null),i=xK()[gK.PasskeyBind],a=_u().t,s=iD(),c=null==s?void 0:s.cdnBase;return y().createElement(y().Fragment,null,y().createElement("h3",{className:"
|
|
28373
|
+
2021:{action:"changeModule",module:FD.LOGIN},1700:{action:"insideFix",message:"verification failed, let components inside fix is fine."},1701:{action:"insideFix",message:"verification failed, let components inside fix is fine."},1702:{action:"insideFix",message:"verification failed, let components inside fix is fine."},500:{action:"message"},6001:{action:"message"},602:{action:"message"}},SY=function(){return SY=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},SY.apply(this,arguments)},xY=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},_Y=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},PY=function(e){return xY(void 0,void 0,void 0,(function(){return _Y(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4/*yield*/,XG(e)];case 1:return[2/*return*/,t.sent()];case 2:return t.sent(),[3/*break*/,3];case 3:return[2/*return*/]}}))}))},TY=function(e){return xY(void 0,void 0,void 0,(function(){return _Y(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4/*yield*/,eK(SY({mediation:"required"},e))];case 1:return[2/*return*/,t.sent()];case 2:return t.sent(),[3/*break*/,3];case 3:return[2/*return*/]}}))}))},NY=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},OY=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},IY=function(e){var t=e.mfaToken,n=e.mfaLogin,r=e.mfaConfigsMap,o=y().useRef(null),i=xK()[gK.PasskeyBind],a=_u().t,s=iD(),c=null==s?void 0:s.cdnBase;return y().createElement(y().Fragment,null,y().createElement("h3",{className:"genauth-g2-mfa-title"},a("common.cratePasskeyTitle")),r.get(yB.PASSKEY)?y().createElement(y().Fragment,null,y().createElement("p",{className:"genauth-g2-mfa-tips"},a("common.onBindPasskeyTitle")),y().createElement("div",{style:{display:"flex",justifyContent:"center"}},y().createElement(JL,{type:"authing-bianzu",style:{width:178,height:120}}))):y().createElement(y().Fragment,null,y().createElement("p",{className:"genauth-g2-mfa-tips"},a("common.cratePasskeyTips")),y().createElement(Xj,{
|
|
28374
28374
|
// className="g2-mfa-passkey-empty-image"
|
|
28375
|
-
width:215,height:145,src:"".concat(c,"/passkey/guard-bind-passkey-press.png"),alt:"",className:"g2-mfa-register-passkey-image"}),y().createElement(Dj,{onClick:function(){return NY(void 0,void 0,void 0,(function(){var e,r,a,s,c,l,u,d,f;return OY(this,(function(p){switch(p.label){case 0:null===(u=o.current)||void 0===u||u.onSpin(!0),p.label=1;case 1:return p.trys.push([1,5,6,7]),[4/*yield*/,SK({mfaToken:t})];case 2:return 200!==(e=p.sent()).statusCode?(gC.error(e.message),[2/*return*/]):[4/*yield*/,PY(e.data)];case 3:return r=p.sent(),[4/*yield*/,i(r)];case 4:return a=p.sent()||{},s=a.isFlowEnd,c=a.data,l=a.onGuardHandling,s?n(200,c):(null===(d=o.current)||void 0===d||d.onError(),null==l||l()),[3/*break*/,7];case 5:return p.sent(),[3/*break*/,7];case 6:return null===(f=o.current)||void 0===f||f.onSpin(!1),[7/*endfinally*/];case 7:return[2/*return*/]}}))}))},text:a("common.createNow"),className:"bind-passkey-btn",htmlType:"button",ref:o})))},AY=function(e){var t=e.mfaToken,n=e.mfaLogin,r=e.mfaConfigsMap,o=y().useRef(null),i=y().useRef(null),a=xK()[gK.PasskeyVerify],s=xK()[gK.PasskeyBind],c=_u().t,l=iD(),u=null==l?void 0:l.cdnBase,d=y().useCallback((function(){return NY(void 0,void 0,void 0,(function(){var e,r,i,s,c,l,u,d,f,p;return OY(this,(function(h){switch(h.label){case 0:null===(u=o.current)||void 0===u||u.onSpin(!0),h.label=1;case 1:return h.trys.push([1,5,6,7]),[4/*yield*/,(m={mfaToken:t},CK(void 0,void 0,void 0,(function(){var e;return EK(this,(function(t){switch(t.label){case 0:return e=m.mfaToken,[4/*yield*/,(0,BX().post)("/api/v3/webauthn/mfa-verify/initialize",{},{headers:{authorization:"Bearer ".concat(e)}})];case 1:return[2/*return*/,t.sent()]}}))})))];case 2:return 200!==(e=h.sent()).statusCode?(gC.error(e.message),[2/*return*/]):[4/*yield*/,TY(e.data)];case 3:return r=h.sent(),[4/*yield*/,a({credential:r,ticket:(null===(d=e.data)||void 0===d?void 0:d.ticket)||""})];case 4:return i=h.sent()||{},s=i.isFlowEnd,c=i.data,l=i.onGuardHandling,s?n(200,c):(null===(f=o.current)||void 0===f||f.onError(),null==l||l()),[3/*break*/,7];case 5:return h.sent(),[3/*break*/,7];case 6:return null===(p=o.current)||void 0===p||p.onSpin(!1),[7/*endfinally*/];case 7:return[2/*return*/]}var m}))}))}),[]),f=y().useCallback((function(){return NY(void 0,void 0,void 0,(function(){var e,r,o,a,c,l,u,d,f;return OY(this,(function(p){switch(p.label){case 0:null===(u=i.current)||void 0===u||u.onSpin(!0),p.label=1;case 1:return p.trys.push([1,5,6,7]),[4/*yield*/,SK({mfaToken:t})];case 2:return 200!==(e=p.sent()).statusCode?(gC.error(e.message),[2/*return*/]):[4/*yield*/,PY(e.data)];case 3:return r=p.sent(),[4/*yield*/,s(r)];case 4:return o=p.sent()||{},a=o.isFlowEnd,c=o.data,l=o.onGuardHandling,a?n(200,c):(null===(d=i.current)||void 0===d||d.onError(),null==l||l()),[3/*break*/,7];case 5:return p.sent(),[3/*break*/,7];case 6:return null===(f=i.current)||void 0===f||f.onSpin(!1),[7/*endfinally*/];case 7:return[2/*return*/]}}))}))}),[t,n,s]);return y().createElement(y().Fragment,null,y().createElement("h3",{className:"
|
|
28375
|
+
width:215,height:145,src:"".concat(c,"/passkey/guard-bind-passkey-press.png"),alt:"",className:"g2-mfa-register-passkey-image"}),y().createElement(Dj,{onClick:function(){return NY(void 0,void 0,void 0,(function(){var e,r,a,s,c,l,u,d,f;return OY(this,(function(p){switch(p.label){case 0:null===(u=o.current)||void 0===u||u.onSpin(!0),p.label=1;case 1:return p.trys.push([1,5,6,7]),[4/*yield*/,SK({mfaToken:t})];case 2:return 200!==(e=p.sent()).statusCode?(gC.error(e.message),[2/*return*/]):[4/*yield*/,PY(e.data)];case 3:return r=p.sent(),[4/*yield*/,i(r)];case 4:return a=p.sent()||{},s=a.isFlowEnd,c=a.data,l=a.onGuardHandling,s?n(200,c):(null===(d=o.current)||void 0===d||d.onError(),null==l||l()),[3/*break*/,7];case 5:return p.sent(),[3/*break*/,7];case 6:return null===(f=o.current)||void 0===f||f.onSpin(!1),[7/*endfinally*/];case 7:return[2/*return*/]}}))}))},text:a("common.createNow"),className:"bind-passkey-btn",htmlType:"button",ref:o})))},AY=function(e){var t=e.mfaToken,n=e.mfaLogin,r=e.mfaConfigsMap,o=y().useRef(null),i=y().useRef(null),a=xK()[gK.PasskeyVerify],s=xK()[gK.PasskeyBind],c=_u().t,l=iD(),u=null==l?void 0:l.cdnBase,d=y().useCallback((function(){return NY(void 0,void 0,void 0,(function(){var e,r,i,s,c,l,u,d,f,p;return OY(this,(function(h){switch(h.label){case 0:null===(u=o.current)||void 0===u||u.onSpin(!0),h.label=1;case 1:return h.trys.push([1,5,6,7]),[4/*yield*/,(m={mfaToken:t},CK(void 0,void 0,void 0,(function(){var e;return EK(this,(function(t){switch(t.label){case 0:return e=m.mfaToken,[4/*yield*/,(0,BX().post)("/api/v3/webauthn/mfa-verify/initialize",{},{headers:{authorization:"Bearer ".concat(e)}})];case 1:return[2/*return*/,t.sent()]}}))})))];case 2:return 200!==(e=h.sent()).statusCode?(gC.error(e.message),[2/*return*/]):[4/*yield*/,TY(e.data)];case 3:return r=h.sent(),[4/*yield*/,a({credential:r,ticket:(null===(d=e.data)||void 0===d?void 0:d.ticket)||""})];case 4:return i=h.sent()||{},s=i.isFlowEnd,c=i.data,l=i.onGuardHandling,s?n(200,c):(null===(f=o.current)||void 0===f||f.onError(),null==l||l()),[3/*break*/,7];case 5:return h.sent(),[3/*break*/,7];case 6:return null===(p=o.current)||void 0===p||p.onSpin(!1),[7/*endfinally*/];case 7:return[2/*return*/]}var m}))}))}),[]),f=y().useCallback((function(){return NY(void 0,void 0,void 0,(function(){var e,r,o,a,c,l,u,d,f;return OY(this,(function(p){switch(p.label){case 0:null===(u=i.current)||void 0===u||u.onSpin(!0),p.label=1;case 1:return p.trys.push([1,5,6,7]),[4/*yield*/,SK({mfaToken:t})];case 2:return 200!==(e=p.sent()).statusCode?(gC.error(e.message),[2/*return*/]):[4/*yield*/,PY(e.data)];case 3:return r=p.sent(),[4/*yield*/,s(r)];case 4:return o=p.sent()||{},a=o.isFlowEnd,c=o.data,l=o.onGuardHandling,a?n(200,c):(null===(d=i.current)||void 0===d||d.onError(),null==l||l()),[3/*break*/,7];case 5:return p.sent(),[3/*break*/,7];case 6:return null===(f=i.current)||void 0===f||f.onSpin(!1),[7/*endfinally*/];case 7:return[2/*return*/]}}))}))}),[t,n,s]);return y().createElement(y().Fragment,null,y().createElement("h3",{className:"genauth-g2-mfa-title"},c("common.passkeyVerifyTitle")),y().createElement("p",{className:"genauth-g2-mfa-tips"},c("common.passkeyVerifyTips")),y().createElement(Xj,{
|
|
28376
28376
|
// className="g2-mfa-passkey-empty-image"
|
|
28377
28377
|
width:215,height:145,src:"".concat(u,"/passkey/guard-bind-passkey-press.png"),alt:"",className:"g2-mfa-verify-passkey-image"}),y().createElement(Dj,{onClick:d,text:c("common.reVerify"),className:"bind-passkey-btn",htmlType:"button",ref:o}),!r.get(yB.PASSKEY)&&y().createElement(Dj,{onClick:f,text:c("common.bindPasskey"),className:"bind-passkey-btn",htmlType:"button",style:{marginTop:16},ref:i}))},RY=function(e){var t=e.passkeyEnabled,n=e.mfaLogin,r=e.mfaToken,o=e.mfaConfigsMap;return t?y().createElement(AY,{mfaLogin:n,mfaToken:r,mfaConfigsMap:o}):y().createElement(IY,{mfaLogin:n,mfaToken:r,mfaConfigsMap:o})},MY=function(){return MY=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},MY.apply(this,arguments)},LY=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},DY=y().useMemo,FY=y().useState,jY=((ZK={})[yB.EMAIL]=function(e){var t=e.config,n=e.initData,r=e.mfaLogin;return y().createElement(DK,{config:t,mfaToken:n.mfaToken,email:n.mfaEmail,mfaLogin:r})},ZK[yB.SMS]=function(e){var t=e.config,n=e.initData,r=e.mfaLogin,o=e.mfaConfigsMap;return y().createElement(GK,{config:t,initData:n,mfaLogin:r,mfaConfigsMap:o})},ZK[yB.TOTP]=function(e){var t=e.initData,n=e.config,r=e.changeModule,o=e.mfaLogin;return y().createElement(gY,{changeModule:r,config:n,initData:t,mfaLogin:o})},ZK[yB.FACE]=function(e){var t=e.config,n=e.initData,r=e.mfaLogin,o=e.setShowMethods;return y().createElement(lY,{config:t,initData:n,mfaLogin:r,setShowMethods:o})},ZK[yB.PASSKEY]=function(e){e.config;var t=e.initData,n=e.mfaLogin,r=(e.setShowMethods,e.mfaConfigsMap);return y().createElement(RY,{mfaToken:t.mfaToken,mfaLogin:n,passkeyEnabled:t.passkeyEnabled,mfaConfigsMap:r})},ZK),BY=function(){var e,t,n=uD(),r=hD(),o=iD(),i=pD().changeModule;FB();var a=fD(),s=LY(FY(null!==(e=n.current)&&void 0!==e?e:null===(t=n.applicationMfa)||void 0===t?void 0:t.sort((function(e,t){return e.sort-t.sort}))[0].mfaPolicy),2),c=s[0],l=s[1],u=LY(FY("login"),2),d=u[0],f=u[1],p=LY(FY(!0),2),h=p[0],m=p[1],v=ZD(),g=_u().t,b=function(e,t){var n=kY[e];if(200===e)return function(e){var t;null===(t=null==a?void 0:a.onLogin)||void 0===t||t.call(a,e,v)};if(!n)return function(e){
|
|
28378
28378
|
// message.error(data.message)
|
|
@@ -28380,22 +28380,22 @@ width:215,height:145,src:"".concat(u,"/passkey/guard-bind-passkey-press.png"),al
|
|
|
28380
28380
|
// 解析成功
|
|
28381
28381
|
if("changeModule"===(null==n?void 0:n.action)){var r=n.module?n.module:FD.ERROR,o=n.initData?n.initData:{};return function(e){return null==i?void 0:i(r,MY(MY({},e),{init:o}))}}return"insideFix"===(null==n?void 0:n.action)?function(){}:"message"===(null==n?void 0:n.action)?function(e){e.message?gC.error(e.message):gC.error(t)}:function(){}},w=DY((function(){return c===yB.FACE&&"check"===d?y().createElement(MB,{onBack:function(){var e;l(n.applicationMfa.find((function(e){return e.mfaPolicy===yB.FACE}))?yB.FACE:null===(e=n.applicationMfa)||void 0===e?void 0:e.sort((function(e,t){return e.sort-t.sort}))[0].mfaPolicy),m(!0),f("login")}},g("common.backToVerify")):y().createElement(RB,null)}),[c,n.applicationMfa,d,g]),C=DY((function(){var e,t=new Map;return null===(e=o.mfaBindConfigs)||void 0===e||e.forEach((function(e){t.set(e.mfa,!e.changeable)})),t}),[null==o?void 0:o.mfaBindConfigs]);
|
|
28382
28382
|
// 返回验证页和返回登录页 需要获取内部 face 模式下的状态
|
|
28383
|
-
return y().createElement(eY.Provider,{value:{setMfaBackState:f,mfaBackState:d}},y().createElement("div",{className:"g2-view-container g2-view-mfa"},w,y().createElement("div",{className:"g2-mfa-content"},jY[c]({config:r,initData:n,changeModule:i,mfaLogin:function(e,t,n){var r=null==b?void 0:b(e,n);t||(t={}),t.__message=n,null==r||r(t)},setShowMethods:m,mfaConfigsMap:C})),h&&y().createElement(EY,{method:c,onChangeMethod:function(e){l(e)}}),y().createElement(SD,{langRange:null==r?void 0:r.langRange,onLangChange:null==a?void 0:a.onLangChange})))},UY=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},qY=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},VY=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},zY=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},$Y=y().useRef,HY=y().useState,WY=function(e){var t=_u().t,n=uD(),r={0:[t("common.problem.noVerifyTip.tip"),t("common.problem.noVerifyTip.type1"),t("common.problem.noVerifyTip.type2"),t("common.problem.noVerifyTip.type3")],1:[t("common.problem.noLoginTips"),t("common.problem.noLoginTip.type1"),t("common.problem.noLoginTip.type2")],2:[t("common.problem.noRegisterTip.tip"),t("common.problem.noRegisterTip.type1"),t("common.problem.noRegisterTip.type2"),t("common.problem.noRegisterTip.type3")],3:[t("common.problem.noAccountTip.tip"),t("common.problem.noAccountTip.type1"),t("common.problem.noAccountTip.type2")],4:[t("common.problem.noResetPassTip.tip"),t("common.problem.noResetPassTip.type1"),t("common.problem.noResetPassTip.type2")],5:[t("common.problem.lockedTips")],6:[]},o=[{label:t("common.problem.noVerify"),value:0},{label:t("common.problem.noLogin"),value:1},{label:t("common.problem.noRegister"),value:2},{label:t("common.problem.noAccount"),value:3},{label:t("common.problem.noResetPass"),value:4},{label:t("common.problem.locked"),value:5},{label:t("common.problem.other"),value:6}],i=VY(cT.useForm(),1)[0],a=UX().post,s=VY(HY([]),2),c=s[0],l=s[1],u=VY(HY(!1),2),d=u[0],f=u[1],p=VY(HY(),2),h=p[0],m=p[1],v=VY(HY([]),2),g=v[0],b=v[1],w=VY(HY(0),2),C=w[0],E=w[1],k=$Y(null),S=r[C];return y().createElement("div",{className:"
|
|
28383
|
+
return y().createElement(eY.Provider,{value:{setMfaBackState:f,mfaBackState:d}},y().createElement("div",{className:"g2-view-container g2-view-mfa"},w,y().createElement("div",{className:"g2-mfa-content"},jY[c]({config:r,initData:n,changeModule:i,mfaLogin:function(e,t,n){var r=null==b?void 0:b(e,n);t||(t={}),t.__message=n,null==r||r(t)},setShowMethods:m,mfaConfigsMap:C})),h&&y().createElement(EY,{method:c,onChangeMethod:function(e){l(e)}}),y().createElement(SD,{langRange:null==r?void 0:r.langRange,onLangChange:null==a?void 0:a.onLangChange})))},UY=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},qY=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},VY=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},zY=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},$Y=y().useRef,HY=y().useState,WY=function(e){var t=_u().t,n=uD(),r={0:[t("common.problem.noVerifyTip.tip"),t("common.problem.noVerifyTip.type1"),t("common.problem.noVerifyTip.type2"),t("common.problem.noVerifyTip.type3")],1:[t("common.problem.noLoginTips"),t("common.problem.noLoginTip.type1"),t("common.problem.noLoginTip.type2")],2:[t("common.problem.noRegisterTip.tip"),t("common.problem.noRegisterTip.type1"),t("common.problem.noRegisterTip.type2"),t("common.problem.noRegisterTip.type3")],3:[t("common.problem.noAccountTip.tip"),t("common.problem.noAccountTip.type1"),t("common.problem.noAccountTip.type2")],4:[t("common.problem.noResetPassTip.tip"),t("common.problem.noResetPassTip.type1"),t("common.problem.noResetPassTip.type2")],5:[t("common.problem.lockedTips")],6:[]},o=[{label:t("common.problem.noVerify"),value:0},{label:t("common.problem.noLogin"),value:1},{label:t("common.problem.noRegister"),value:2},{label:t("common.problem.noAccount"),value:3},{label:t("common.problem.noResetPass"),value:4},{label:t("common.problem.locked"),value:5},{label:t("common.problem.other"),value:6}],i=VY(cT.useForm(),1)[0],a=UX().post,s=VY(HY([]),2),c=s[0],l=s[1],u=VY(HY(!1),2),d=u[0],f=u[1],p=VY(HY(),2),h=p[0],m=p[1],v=VY(HY([]),2),g=v[0],b=v[1],w=VY(HY(0),2),C=w[0],E=w[1],k=$Y(null),S=r[C];return y().createElement("div",{className:"genauth-g2-describe-questions genauth-g2-form-required-item-icon-after"},y().createElement(cT,{name:"resetPassword",layout:"vertical",form:i,onFinish:function(t){var n;null===(n=null==k?void 0:k.current)||void 0===n||n.onSpin(!0);var r={type:C,description:t.description,phone:t.identify,images:c,appId:e.appId};
|
|
28384
28384
|
// TODO 暂不支持国际化短信参数
|
|
28385
|
-
a("/api/v2/feedback",r).then((function(t){var n,r;200===t.code?(null===(n=null==k?void 0:k.current)||void 0===n||n.onSpin(!1),e.onSuccess()):(null===(r=null==k?void 0:k.current)||void 0===r||r.onSpin(!1),gC.error(t.message))}))},onFinishFailed:function(){var e;null===(e=null==k?void 0:k.current)||void 0===e||e.onError()},autoComplete:"off"},y().createElement(cT.Item,{validateTrigger:["onBlur","onChange"],className:"
|
|
28385
|
+
a("/api/v2/feedback",r).then((function(t){var n,r;200===t.code?(null===(n=null==k?void 0:k.current)||void 0===n||n.onSpin(!1),e.onSuccess()):(null===(r=null==k?void 0:k.current)||void 0===r||r.onSpin(!1),gC.error(t.message))}))},onFinishFailed:function(){var e;null===(e=null==k?void 0:k.current)||void 0===e||e.onError()},autoComplete:"off"},y().createElement(cT.Item,{validateTrigger:["onBlur","onChange"],className:"genauth-g2-input-form",name:"identify",label:t("common.problem.form.phone"),validateFirst:!0,initialValue:null==n?void 0:n.identify,rules:zY(zY([],VY(QX(t("common.problem.form.phone"))),!1),[{validator:function(e,n){return UY(void 0,void 0,void 0,(function(){return qY(this,(function(e){if(!n)return[2/*return*/];if(JX("email",n)||JX("phone",n))return[2/*return*/];throw new Error(t("login.inputCorrectPhoneOrEmail"))}))}))}}],!1)},y().createElement(oN,{className:"genauth-g2-input",autoComplete:"off",size:"large",placeholder:t("login.inputPhoneOrEmail"),prefix:y().createElement(JL,{type:"authing-a-user-line1",style:{color:"#6B7280"}})})),y().createElement(cT.Item,{validateTrigger:["onBlur","onChange"],className:"genauth-g2-input-form ",label:t("common.problem.form.question"),name:"questionPicker",initialValue:C},y().createElement(lI,{className:"genauth-g2-select",onChange:function(e){E(e)}},null==o?void 0:o.map((function(e){var t=e.value,n=e.label;
|
|
28386
28386
|
// @ts-ignore
|
|
28387
|
-
return y().createElement(lI.Option,{key:t,value:t,className:"
|
|
28387
|
+
return y().createElement(lI.Option,{key:t,value:t,className:"genauth-g2-question-option ".concat(C===t?"genauth-g2-question-option-active":"")},n)})))),y().createElement("div",{className:"genauth-g2-input-form"},null==S?void 0:S.map((function(e,t){return y().createElement("div",{key:t},e)}))),y().createElement(cT.Item,{validateTrigger:["onBlur","onChange"],className:"genauth-g2-input-form",name:"description",label:t("common.problem.form.questionDescript")},y().createElement(oN.TextArea,{className:"genauth-g2-questions-textarea",maxLength:200,showCount:!0,rows:4,style:{marginBottom:10}})),y().createElement("div",{className:"genauth-g2-input-form"},y().createElement("div",{className:"label-title"},t("common.problem.form.questionClip")),y().createElement("div",{className:"g2-questions"},y().createElement(uL,{action:"".concat(e.host,"/api/v2/upload?folder=photos"),listType:"picture-card",accept:"image/png, image/jpeg, image/jpg",className:"genauth-g2-questions-upload-self",fileList:g,onPreview:function(e){return UY(void 0,void 0,void 0,(function(){var t;return qY(this,(function(n){switch(n.label){case 0:return"error"===e.status||e.response?[4/*yield*/,new Promise((function(t){var n=new FileReader;n.readAsDataURL(e.originFileObj),n.onload=function(){return t(n.result)}}))]:[3/*break*/,2];case 1:return t=n.sent(),[3/*break*/,3];case 2:t=e.response.data.url,n.label=3;case 3:
|
|
28388
28388
|
// setPreviewImage(file.url);
|
|
28389
28389
|
// file 没有 url 属性,需要改成下面的用法
|
|
28390
28390
|
// let url = file.response.data.url
|
|
28391
|
-
return m(t),f(!0),[2/*return*/]}}))}))},onChange:function(e){b(e.fileList);var t=e.fileList.map((function(e){var t=e.response;return null==t?void 0:t.data.url}));l(t)},beforeUpload:function(e){return!!["image/png","image/jpeg","image/jpg"].includes(e.type)||Promise.reject(e)},itemRender:function(e,t){return y().createElement(y().Fragment,null,"uploading"===t.status?y().createElement("div",{style:{padding:6,borderRadius:2,border:"1px solid #
|
|
28392
|
-
var ZY,XY,eJ=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},tJ=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},nJ=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},rJ=y().useRef,oJ=mM.Paragraph,iJ=function(e){var t=e.secret,n=e.onBind,r=_u().t,o=nJ(cT.useForm(),1)[0],i=mD(),a=rJ(null);return y().createElement(y().Fragment,null,y().createElement("p",{className:"
|
|
28391
|
+
return m(t),f(!0),[2/*return*/]}}))}))},onChange:function(e){b(e.fileList);var t=e.fileList.map((function(e){var t=e.response;return null==t?void 0:t.data.url}));l(t)},beforeUpload:function(e){return!!["image/png","image/jpeg","image/jpg"].includes(e.type)||Promise.reject(e)},itemRender:function(e,t){return y().createElement(y().Fragment,null,"uploading"===t.status?y().createElement("div",{style:{padding:6,borderRadius:2,border:"1px solid #D1D1D6"}},y().createElement(DA,{showInfo:!1,style:{margin:1},width:40,type:"circle",percent:t.percent})):e)}},g.length<4&&y().createElement(zL,null)))),y().createElement(cT.Item,{className:"genauth-g2-sumbit-form submit-form"},y().createElement(Dj,{className:"forget-password",text:t("common.problem.form.submit"),ref:k}))),y().createElement(dA,{visible:d,title:null,footer:null,onCancel:function(){return f(!1)}},y().createElement("img",{alt:"example",style:{width:"100%"},src:h})))},GY=function(e){var t=_u().t,n=cD(),r=pD().changeModule,o=hD();return FB(),y().createElement("div",{className:"g2-view-container g2-need-help"},y().createElement("div",{className:"g2-view-header"},y().createElement(Xj,{src:o.logo,size:48,borderRadius:4,alt:"",className:"icon"}),y().createElement("div",{className:"title"},t("common.problem.title"))),y().createElement("div",{className:"g2-view-tabs"},y().createElement(WY,{appId:n,host:o.host,onSuccess:function(){null==r||r(FD.SUBMIT_SUCCESS)}})),y().createElement("div",{className:"g2-tips-line "},y().createElement("div",{className:"back-to-login"},y().createElement("span",{className:"gray"},t("common.noQuestions")),y().createElement("span",{className:"link-like",onClick:function(){return null==r?void 0:r(FD.LOGIN)}},t("common.goToLogin")))))},KY=function(){return KY=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},KY.apply(this,arguments)},YY=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},JY=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};function QY(e,t){return YY(this,void 0,void 0,(function(){return JY(this,(function(n){switch(n.label){case 0:return[4/*yield*/,(0,BX().authFlow)(e,KY({},t))];case 1:return[2/*return*/,n.sent()]}}))}))}!function(e){e.RecoveryTotp="recovery-totp",e.ConfirmTotpRecoveryCode="confirm-totp-recovery-code"}(XK||(XK={}));// CONCATENATED MODULE: ./src/RecoveryCode/core/saveCode.tsx
|
|
28392
|
+
var ZY,XY,eJ=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},tJ=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},nJ=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},rJ=y().useRef,oJ=mM.Paragraph,iJ=function(e){var t=e.secret,n=e.onBind,r=_u().t,o=nJ(cT.useForm(),1)[0],i=mD(),a=rJ(null);return y().createElement(y().Fragment,null,y().createElement("p",{className:"genauth-g2-mfa-title"},r("common.useRecoverCode")),y().createElement("p",{className:"genauth-g2-mfa-tips"},r("common.totpGenerateCode")),y().createElement("div",{className:"g2-mfa-bindTotp-copySecret"},y().createElement(oJ,{copyable:!0},t)),y().createElement(cT,{form:o,onFinish:function(){return eJ(void 0,void 0,void 0,(function(){var e,t,r,s,c,l,u,d,f;return tJ(this,(function(p){switch(p.label){case 0:return null===(c=a.current)||void 0===c||c.onSpin(!0),i?[4/*yield*/,QY(XK.ConfirmTotpRecoveryCode,{})]:[3/*break*/,2];case 1:return e=p.sent(),t=e.isFlowEnd,r=e.data,s=e.onGuardHandling,null===(l=a.current)||void 0===l||l.onSpin(!1),t?n(r):(null===(u=a.current)||void 0===u||u.onError(),null==s||s()),[3/*break*/,6];case 2:return p.trys.push([2,4,5,6]),[4/*yield*/,o.validateFields()];case 3:return p.sent(),n(),[3/*break*/,6];case 4:return p.sent(),null===(d=a.current)||void 0===d||d.onError(),[3/*break*/,6];case 5:return null===(f=a.current)||void 0===f||f.onSpin(!1),[7/*endfinally*/];case 6:return[2/*return*/]}}))}))},style:{width:"100%"},onFinishFailed:function(){var e;return null===(e=a.current)||void 0===e?void 0:e.onError()}},y().createElement(cT.Item,{className:"genauth-g2-input-form g2-mfa-totp-recoveryCode-input",name:"remember",rules:[{validator:function(e,t){return t?Promise.resolve():Promise.reject(r("common.pleaseRecordKey"))}}],valuePropName:"checked"},y().createElement(tw,{className:"g2-mfa-bindTotp-secretSave"},r("login.rememberedSecret"))),y().createElement(Dj,{text:r("common.confirm"),ref:a})))},aJ=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},sJ=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},cJ=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},lJ=y().useRef,uJ=function(e){var t=e.mfaToken,n=e.onSubmit,r=_u().t,o=mD(),i=cJ(cT.useForm(),1)[0],a=UX().post,s=lJ(null);return y().createElement(y().Fragment,null,y().createElement("p",{className:"genauth-g2-mfa-title"},r("common.useRecoverCode")),y().createElement("p",{className:"genauth-g2-mfa-tips"},r("login.mfaAfterReset")),y().createElement(cT,{form:i,onFinish:function(e){return aJ(void 0,void 0,void 0,(function(){var r,c,l,u,d,f,p,h,m,v,g,y;return sJ(this,(function(b){switch(b.label){case 0:return null===(f=s.current)||void 0===f||f.onSpin(!0),o?[4/*yield*/,QY(XK.RecoveryTotp,{recoveryCode:e.recoveryCode})]:[3/*break*/,2];case 1:return r=b.sent(),c=r.data,l=r.onGuardHandling,u=r.statusCode,null===(p=s.current)||void 0===p||p.onSpin(!1),200===u?n(c.recoveryCode):(null===(h=s.current)||void 0===h||h.onError(),null==l||l()),[3/*break*/,6];case 2:return b.trys.push([2,4,5,6]),[4/*yield*/,a("/api/v2/mfa/totp/recovery",{recoveryCode:i.getFieldValue("recoveryCode")},{headers:{authorization:t}})];case 3:return 200===(d=b.sent()).code?
|
|
28393
28393
|
// @ts-ignore
|
|
28394
28394
|
n(d.recoveryCode,d.data):(
|
|
28395
28395
|
// message.error(res.message)
|
|
28396
28396
|
null===(m=s.current)||void 0===m||m.onError(),null===(v=d.onGuardHandling)||void 0===v||v.call(d)),[3/*break*/,6];case 4:return b.sent(),
|
|
28397
28397
|
// TODO: handle error
|
|
28398
|
-
null===(g=s.current)||void 0===g||g.onError(),[3/*break*/,6];case 5:return null===(y=s.current)||void 0===y||y.onSpin(!1),[7/*endfinally*/];case 6:return[2/*return*/]}}))}))},onFinishFailed:function(){return s.current.onError()}},y().createElement(cT.Item,{validateTrigger:["onBlur","onChange"],className:"
|
|
28398
|
+
null===(g=s.current)||void 0===g||g.onError(),[3/*break*/,6];case 5:return null===(y=s.current)||void 0===y||y.onSpin(!1),[7/*endfinally*/];case 6:return[2/*return*/]}}))}))},onFinishFailed:function(){return s.current.onError()}},y().createElement(cT.Item,{validateTrigger:["onBlur","onChange"],className:"genauth-g2-input-form",name:"recoveryCode",rules:[{required:!0,message:r("login.inputRecoverCode")}]},y().createElement(oN,{className:"genauth-g2-input",autoComplete:"off",size:"large",placeholder:r("login.inputRecoverCode"),prefix:y().createElement(JL,{type:"authing-a-lock-line1",style:{color:"#6B7280"}})})),y().createElement(cT.Item,{className:"genauth-g2-sumbit-form submit-form"},y().createElement(Dj,{text:r("common.sure"),ref:s}))))},dJ=function(){return dJ=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},dJ.apply(this,arguments)},fJ=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},pJ=y().useMemo,hJ=y().useState,mJ=function(){var e=pD().changeModule,t=uD(),n=fD(),r=_u().t;FB();var o=fJ(hJ(),2),i=o[0],a=o[1],s=fJ(hJ(),2),c=s[0],l=s[1],u=ZD(),d=pJ((function(){return y().createElement(MB,{onBack:function(){return null==e?void 0:e(FD.MFA,dJ(dJ({},t),{current:yB.TOTP}))}},r("common.backToVerify"))}),[e,t,r]);return y().createElement("div",{className:"g2-view-container g2-mfa-recovery-code"},d,y().createElement("div",{className:"g2-mfa-content"},i&&c?y().createElement(iJ,{secret:c,onBind:function(){var e;i&&(null===(e=null==n?void 0:n.onLogin)||void 0===e||e.call(n,i,u))}}):y().createElement(uJ,{mfaToken:t.mfaToken,onSubmit:function(e,t){a(t),l(e)}})))},vJ=function(){var e=pD().changeModule,t=uD(),n=fJ(hJ(),2),r=n[0],o=n[1],i=fD(),a=ZD(),s=_u().t,c=pJ((function(){return y().createElement(MB,{onBack:function(){return null==e?void 0:e(FD.MFA,dJ(dJ({},t),{current:yB.TOTP}))}},s("common.backToVerify"))}),[e,t,s]);return y().createElement("div",{className:"g2-view-container g2-mfa-recovery-code"},c,y().createElement("div",{className:"g2-mfa-content"},r?y().createElement(iJ,{secret:r,onBind:function(e){var t;e&&(null===(t=null==i?void 0:i.onLogin)||void 0===t||t.call(i,e,a))}}):y().createElement(uJ,{mfaToken:t.mfaToken,onSubmit:function(e){o(e)}})))},gJ=function(){var e=mD();return y().createElement(y().Fragment,null,e?y().createElement(vJ,null):y().createElement(mJ,null))},yJ=function(e){var t=iD().extendsFields;
|
|
28399
28399
|
// 开关控制 如果没有 register 就不开启了
|
|
28400
28400
|
return!!iD().complateFiledsPlace.includes("register")&&(
|
|
28401
28401
|
// 排除掉已有的字段
|
|
@@ -28408,17 +28408,17 @@ email:n,password:i,phoneCountryCode:p,profile:bJ({browser:"undefined"!=typeof na
|
|
|
28408
28408
|
// 信息补全
|
|
28409
28409
|
C?(null==E||E(FD.REGISTER_COMPLETE_INFO,{businessRequestName:s||"registerByEmail",content:bJ({},O),onRegisterSuccess:I,onRegisterFailed:l}),[2/*return*/]):[4/*yield*/,k("/api/v2/register-".concat((s||"email").split("-")[0]),bJ(bJ({},O),{postUserInfoPipeline:!1}))];case 6:return R=K.sent(),M=R.statusCode,D=R.data,j=R.message,V=R.apiCode,200===M?I(D):(
|
|
28410
28410
|
// 更新图形验证码
|
|
28411
|
-
(S||x)&&L(n$(w.host)),V===pX.UNSAFE_PASSWORD_TIP&&W(!0),m.current.onError(),l(V,D,j),gC.error(j)),[2/*return*/]}}))}))}),[b,P,F],{loading:!1}),2),K=G[1],Y=xJ((function(e){var t;return p&&(null===(t=p.internationalSmsConfig)||void 0===t?void 0:t.enabled)?y().createElement(tV,bJ({},e,{className:"
|
|
28411
|
+
(S||x)&&L(n$(w.host)),V===pX.UNSAFE_PASSWORD_TIP&&W(!0),m.current.onError(),l(V,D,j),gC.error(j)),[2/*return*/]}}))}))}),[b,P,F],{loading:!1}),2),K=G[1],Y=xJ((function(e){var t;return p&&(null===(t=p.internationalSmsConfig)||void 0===t?void 0:t.enabled)?y().createElement(tV,bJ({},e,{className:"genauth-g2-input",size:"large",areaCode:F,onAreaCodeChange:function(e){j(e),b.getFieldValue(["phone"])&&b.validateFields(["phone"])},maxLength:20})):y().createElement(ZU,bJ({},e,{className:"genauth-g2-input",size:"large",placeholder:h("login.inputPhone"),prefix:y().createElement(JL,{type:"authing-a-user-line1",style:{color:"#6B7280"}}),maxLength:11}))}),[F,b,p,h]),J=xJ((function(e){return B?y().createElement(aq,bJ({},e,{isInternationSms:B,form:b,fieldName:"account",className:"genauth-g2-input g2-send-code-input",autoComplete:"off",size:"large",placeholder:h("common.inputFourVerifyCode",{length:V}),areaCode:F,prefix:y().createElement(JL,{type:"authing-a-shield-check-line1",style:{color:"#6B7280"}}),scene:Oi.SCENE_TYPE_REGISTER,maxLength:V,codeFieldName:"captchaCode",onSendCodeBefore:function(){return wJ(void 0,void 0,void 0,(function(){return CJ(this,(function(e){switch(e.label){case 0:return(null==p?void 0:p.closeCheckSendUser)?[3/*break*/,2]:[4/*yield*/,b.validateFields(["account"])];case 1:e.sent(),e.label=2;case 2:return[4/*yield*/,b.validateFields(["captchaCode"])];case 3:return e.sent(),[2/*return*/]}}))}))},onSendCodeError:function(){L(n$(w.host))}})):y().createElement(aq,bJ({},e,{form:b,fieldName:"account",className:"genauth-g2-input g2-send-code-input",autoComplete:"off",size:"large",placeholder:h("common.inputFourVerifyCode",{length:V}),maxLength:V,scene:Oi.SCENE_TYPE_REGISTER,prefix:y().createElement(JL,{type:"authing-a-shield-check-line1",style:{color:"#6B7280"}}),codeFieldName:"captchaCode",onSendCodeBefore:function(){return wJ(void 0,void 0,void 0,(function(){return CJ(this,(function(e){switch(e.label){case 0:return(null==p?void 0:p.closeCheckSendUser)?[3/*break*/,2]:[4/*yield*/,b.validateFields(["account"])];case 1:e.sent(),e.label=2;case 2:return[4/*yield*/,b.validateFields(["captchaCode"])];case 3:return e.sent(),[2/*return*/]}}))}))},onSendCodeError:function(){L(n$(w.host))}}))}),[F,b,B,h,V]);PJ((function(){
|
|
28412
28412
|
/** 如果是国外用户池,那么有图形验证码,需要请求图片 */
|
|
28413
28413
|
(S||x)&&L(n$(w.host))}),[S,x,null==w?void 0:w.host]),PJ((function(){
|
|
28414
28414
|
// 方法发生变化时,图像验证码数据应该清空
|
|
28415
|
-
(S||x)&&(null==b||b.setFieldsValue({captchaCode:void 0}))}),[b,S,x]);var Q=_J((function(){var e;return s?"phone-password"===s?y().createElement(y().Fragment,null,y().createElement(hU.Phone,{key:"account",name:"account",className:(null===(e=null==p?void 0:p.internationalSmsConfig)||void 0===e?void 0:e.enabled)?"
|
|
28415
|
+
(S||x)&&(null==b||b.setFieldsValue({captchaCode:void 0}))}),[b,S,x]);var Q=_J((function(){var e;return s?"phone-password"===s?y().createElement(y().Fragment,null,y().createElement(hU.Phone,{key:"account",name:"account",className:(null===(e=null==p?void 0:p.internationalSmsConfig)||void 0===e?void 0:e.enabled)?"genauth-g2-input-form remove-padding":"genauth-g2-input-form",
|
|
28416
28416
|
// validateFirst={true} // 会多次触发 find 接口
|
|
28417
|
-
form:b,checkRepeat:!0,required:!0,areaCode:F},y().createElement(Y,{autoFocus:v})),U&&y().createElement(y().Fragment,null,S&&y().createElement(cT.Item,{className:"
|
|
28418
|
-
// prefix={<UserOutlined style={{ color: '#
|
|
28419
|
-
prefix:y().createElement(JL,{type:"authing-a-user-line1",style:{color:"#
|
|
28420
|
-
// prefix={<LockOutlined style={{ color: '#
|
|
28421
|
-
prefix:y().createElement(JL,{type:"authing-a-lock-line1",style:{color:"#
|
|
28417
|
+
form:b,checkRepeat:!0,required:!0,areaCode:F},y().createElement(Y,{autoFocus:v})),U&&y().createElement(y().Fragment,null,S&&y().createElement(cT.Item,{className:"genauth-g2-input-form",validateTrigger:["onBlur","onChange"],name:"captchaCode",rules:QX(h("common.captchaCode"))},y().createElement(sz,{className:"genauth-g2-input",size:"large",placeholder:h("login.inputCaptchaCode"),verifyCodeUrl:M,changeCode:function(){return L(n$(w.host))}})),y().createElement(cT.Item,{key:"code",name:"code",validateTrigger:["onBlur","onChange"],rules:QX(h("common.captchaCode")),className:"genauth-g2-input-form"},y().createElement(J,null)))):y().createElement(y().Fragment,null,y().createElement(hU.CustomName,{method:null==s?void 0:s.split("-")[0],key:s,name:"account",className:"genauth-g2-input-form",validateFirst:!0,form:b,checkRepeat:!0,required:!0},y().createElement(oN,{maxLength:50,autoFocus:v,className:"genauth-g2-input",autoComplete:"off",size:"large",placeholder:h("login.inputAccount",{text:a}),prefix:y().createElement(JL,{type:"authing-a-user-line1",style:{color:"#6B7280"}})})),"email-password"===s&&q&&y().createElement(y().Fragment,null,x&&y().createElement(cT.Item,{className:"genauth-g2-input-form",validateTrigger:["onBlur","onChange"],name:"captchaCode",rules:QX(h("common.captchaCode"))},y().createElement(sz,{className:"genauth-g2-input",size:"large",placeholder:h("login.inputCaptchaCode"),verifyCodeUrl:M,changeCode:function(){return L(n$(w.host))}})),y().createElement(cT.Item,{key:"code",name:"code",validateTrigger:["onBlur","onChange"],rules:QX(h("common.captchaCode")),className:"genauth-g2-input-form"},y().createElement(Gq,{className:"genauth-g2-input g2-send-code-input",autoComplete:"off",size:"large",placeholder:h("common.inputFourVerifyCode",{length:V}),prefix:y().createElement(JL,{type:"authing-a-shield-check-line1",style:{color:"#6B7280"}}),scene:Nc.REGISTER_VERIFY_CODE,maxLength:V,fieldName:"account",codeFieldName:"captchaCode",form:b,onSendCodeBefore:function(){return wJ(void 0,void 0,void 0,(function(){return CJ(this,(function(e){switch(e.label){case 0:return(null==p?void 0:p.closeCheckSendUser)?[3/*break*/,2]:[4/*yield*/,b.validateFields(["account"])];case 1:e.sent(),e.label=2;case 2:return[4/*yield*/,b.validateFields(["captchaCode"])];case 3:return e.sent(),[2/*return*/]}}))}))},onSendCodeError:function(){L(n$(w.host))}})))):null}),[Y,s,v,F,a,h,b,M,null===(i=null==p?void 0:p.internationalSmsConfig)||void 0===i?void 0:i.enabled]);return y().createElement("div",{className:"genauth-g2-register-email"},y().createElement(cT,{form:b,name:"emailRegister",autoComplete:"off",onSubmitCapture:function(){return m.current.onSpin(!0)},onFinish:K,onFinishFailed:function(){return m.current.onError()},onValuesChange:function(e,t){t.password&&t["new-password"]&&b.validateFields(["new-password"])}},s&&a?Q:y().createElement(hU.Email,{key:"email",name:"email",className:"genauth-g2-input-form",validateFirst:!0,form:b,checkRepeat:!0,required:!0},y().createElement(oN,{autoFocus:v,className:"genauth-g2-input",autoComplete:"off",size:"large",placeholder:h("login.inputEmail"),
|
|
28418
|
+
// prefix={<UserOutlined style={{ color: '#6B7280' }} />}
|
|
28419
|
+
prefix:y().createElement(JL,{type:"authing-a-user-line1",style:{color:"#6B7280"}})})),y().createElement(hU.Password,{key:"password",name:"password",className:"genauth-g2-input-form",validateFirst:!0},y().createElement(gU,{className:"genauth-g2-input",size:"large",placeholder:h("login.inputPwd"),prefix:y().createElement(JL,{type:"authing-a-lock-line1",style:{color:"#6B7280"}})})),y().createElement(hU.Password,{key:"new-password",name:"new-password",fieldRequiredRuleMessage:h("common.repeatPasswordDoc"),rules:[{validateTrigger:"onBlur",validator:function(e,t){return t!==b.getFieldValue("password")&&t?Promise.reject(h("common.repeatPasswordDoc")):Promise.resolve()}}],className:"genauth-g2-input-form",validateFirst:!0},y().createElement(gU,{className:"genauth-g2-input",size:"large",placeholder:h("common.passwordAgain"),
|
|
28420
|
+
// prefix={<LockOutlined style={{ color: '#6B7280' }} />}
|
|
28421
|
+
prefix:y().createElement(JL,{type:"authing-a-lock-line1",style:{color:"#6B7280"}})})),Boolean(null==d?void 0:d.length)&&y().createElement(Gz,{onChange:function(e,t){T(e),N.current=t},agreements:d,showError:I}),H(),y().createElement(cT.Item,{className:"genauth-g2-sumbit-form"},y().createElement(Dj,{
|
|
28422
28422
|
// disabled={
|
|
28423
28423
|
// !!agreements.find((item) => item.required && !acceptedAgreements)
|
|
28424
28424
|
// }
|
|
@@ -28440,9 +28440,9 @@ params:(null==v?void 0:v.isHost)?JSON.stringify(o0()):void 0},f=function(e){i(e,
|
|
|
28440
28440
|
// 验证码校验通过 进入密码补全流程
|
|
28441
28441
|
return p=U.sent(),y=p.statusCode,h=p.data,S=h.valid,_=h.message,200===y&&S?(null==w||w(FD.REGISTER_PASSWORD,{businessRequestName:"registerByEmailCode",//用于判断后续使用哪个注册api
|
|
28442
28442
|
content:NJ({},d),isChangeComplete:m,onRegisterSuccess:f,onRegisterFailed:a}),[2/*return*/]):(J&&X(n$(v.host)),E.current.onError(),gC.error(_),[2/*return*/]);case 6:return m||L?[4/*yield*/,C("/api/v2/email/preCheckCode",{email:r,emailCode:D})]:[3/*break*/,8];case 7:return g=U.sent(),y=g.statusCode,k=g.data,S=k.valid,_=k.message,200===y&&S?(L&&(null==w||w(FD.REGISTER_ACCOUNT_TYPE_SELECT,{businessRequestName:"registerByEmailCode",content:NJ({},d),isChangeComplete:m,onRegisterSuccess:f,onRegisterFailed:a})),m&&(null==w||w(FD.REGISTER_COMPLETE_INFO,{businessRequestName:"registerByEmailCode",//用于判断后续使用哪个注册api
|
|
28443
|
-
content:NJ({},d),onRegisterSuccess:f,onRegisterFailed:a})),[2/*return*/]):(J&&X(n$(v.host)),E.current.onError(),gC.error(_),[2/*return*/]);case 8:return[4/*yield*/,PV("registerByEmailCode",NJ(NJ({},d),{postUserInfoPipeline:!1}))];case 9:P=U.sent(),T=P.statusCode,F=P.data,N=P.apiCode,I=P.onGuardHandling,A=P.message,E.current.onSpin(!1),200===T?f(F):(J&&X(n$(v.host)),null==I||I(),a(N,F,A)),U.label=10;case 10:return[3/*break*/,13];case 11:return R=U.sent(),M=R.message,D=R.code,F=R.data,E.current.onError(),gC.error(M),!t&&a(D,F,gC),[3/*break*/,13];case 12:return null===(B=E.current)||void 0===B||B.onSpin(!1),[7/*endfinally*/];case 13:return[2/*return*/]}}))}))}),[null==v?void 0:v.isHost,v.passwordLoginMethods,s,b,k,null==c?void 0:c.length,x,u,C,w,m,i,a,null==l?void 0:l.enableCompletePassword]),ne=RJ((function(e){return OJ(void 0,void 0,void 0,(function(){return IJ(this,(function(t){switch(t.label){case 0:return F!==Pc.EmailCode?[3/*break*/,2]:[4/*yield*/,te(e)];case 1:return t.sent(),[3/*break*/,4];case 2:return F!==Pc.PhoneCode?[3/*break*/,4]:[4/*yield*/,ee(e)];case 3:t.sent(),t.label=4;case 4:return[2/*return*/]}}))}))}),[F,te,ee]),re=RJ((function(e){return W?y().createElement(aq,NJ({},e,{form:k,fieldName:"identify",className:"
|
|
28443
|
+
content:NJ({},d),onRegisterSuccess:f,onRegisterFailed:a})),[2/*return*/]):(J&&X(n$(v.host)),E.current.onError(),gC.error(_),[2/*return*/]);case 8:return[4/*yield*/,PV("registerByEmailCode",NJ(NJ({},d),{postUserInfoPipeline:!1}))];case 9:P=U.sent(),T=P.statusCode,F=P.data,N=P.apiCode,I=P.onGuardHandling,A=P.message,E.current.onSpin(!1),200===T?f(F):(J&&X(n$(v.host)),null==I||I(),a(N,F,A)),U.label=10;case 10:return[3/*break*/,13];case 11:return R=U.sent(),M=R.message,D=R.code,F=R.data,E.current.onError(),gC.error(M),!t&&a(D,F,gC),[3/*break*/,13];case 12:return null===(B=E.current)||void 0===B||B.onSpin(!1),[7/*endfinally*/];case 13:return[2/*return*/]}}))}))}),[null==v?void 0:v.isHost,v.passwordLoginMethods,s,b,k,null==c?void 0:c.length,x,u,C,w,m,i,a,null==l?void 0:l.enableCompletePassword]),ne=RJ((function(e){return OJ(void 0,void 0,void 0,(function(){return IJ(this,(function(t){switch(t.label){case 0:return F!==Pc.EmailCode?[3/*break*/,2]:[4/*yield*/,te(e)];case 1:return t.sent(),[3/*break*/,4];case 2:return F!==Pc.PhoneCode?[3/*break*/,4]:[4/*yield*/,ee(e)];case 3:t.sent(),t.label=4;case 4:return[2/*return*/]}}))}))}),[F,te,ee]),re=RJ((function(e){return W?y().createElement(aq,NJ({},e,{form:k,fieldName:"identify",className:"genauth-g2-input g2-send-code-input",autoComplete:"off",size:"large",placeholder:p("common.inputFourVerifyCode",{length:M}),areaCode:A,prefix:y().createElement(JL,{type:"authing-a-shield-check-line1",style:{color:"#6B7280"}}),isInternationSms:K,scene:Oi.SCENE_TYPE_REGISTER,maxLength:M,onSendCodeBefore:function(){return OJ(void 0,void 0,void 0,(function(){return IJ(this,(function(e){switch(e.label){case 0:return(null==l?void 0:l.closeCheckSendUser)?[3/*break*/,2]:[4/*yield*/,k.validateFields(["identify"])];case 1:e.sent(),e.label=2;case 2:return[4/*yield*/,k.validateFields(["captchaCode"])];case 3:return e.sent(),[2/*return*/]}}))}))},onSendCodeError:function(){X(n$(v.host))}})):y().createElement(y().Fragment,null,F===Pc.PhoneCode&&y().createElement(aq,NJ({},e,{isInternationSms:K,className:"genauth-g2-input g2-send-code-input",autoComplete:"off",size:"large",placeholder:p("common.inputFourVerifyCode",{length:M}),areaCode:A,prefix:y().createElement(JL,{type:"authing-a-shield-check-line1",style:{color:"#6B7280"}}),scene:Oi.SCENE_TYPE_REGISTER,maxLength:M,data:U,captchaCode:z,onSendCodeBefore:function(){return OJ(void 0,void 0,void 0,(function(){return IJ(this,(function(e){switch(e.label){case 0:return(null==l?void 0:l.closeCheckSendUser)?[3/*break*/,2]:[4/*yield*/,k.validateFields(["identify"])];case 1:e.sent(),e.label=2;case 2:return[4/*yield*/,k.validateFields(["captchaCode"])];case 3:return e.sent(),[2/*return*/]}}))}))},onSendCodeError:function(){X(n$(v.host))}})),F===Pc.EmailCode&&y().createElement(Gq,NJ({},e,{className:"genauth-g2-input g2-send-code-input",autoComplete:"off",size:"large",placeholder:p("common.inputFourVerifyCode",{length:M}),prefix:y().createElement(JL,{type:"authing-a-shield-check-line1",style:{color:"#6B7280"}}),scene:Nc.REGISTER_VERIFY_CODE,maxLength:M,data:U,captchaCode:z,onSendCodeBefore:function(){return OJ(void 0,void 0,void 0,(function(){return IJ(this,(function(e){switch(e.label){case 0:return(null==l?void 0:l.closeCheckSendUser)?[3/*break*/,2]:[4/*yield*/,k.validateFields(["identify"])];case 1:e.sent(),e.label=2;case 2:return[4/*yield*/,k.validateFields(["captchaCode"])];case 3:return e.sent(),[2/*return*/]}}))}))},onSendCodeError:function(){X(n$(v.host))}})))}),[A,F,k,U,K,W,p,M,z]),oe=RJ((function(e){return y().createElement(tV,NJ({},e,{className:"genauth-g2-input",size:"large",areaCode:A,onAreaCodeChange:function(e){R(e),k.getFieldValue(["identify"])&&k.validateFields(["identify"])}}))}),[A,k]);return y().createElement("div",{className:"genauth-g2-register-email"},y().createElement(cT,{form:k,name:"emailRegister",autoComplete:"off",onSubmitCapture:function(){return E.current.onSpin(!0)},onFinish:ne,onFinishFailed:function(){return E.current.onError()}},y().createElement(ez,{name:"identify",className:W?"genauth-g2-input-form remove-padding":"genauth-g2-input-form",methods:f,currentMethod:F,areaCode:A,checkRepeat:!0,required:!0},W?y().createElement(oe,{autoFocus:g}):y().createElement(TW,{className:"genauth-g2-input",size:"large",autoFocus:g,value:U,methods:f,onChange:function(e){var t=e.target.value;q(t),1!==f.length&&(JX("email",t)?j(Pc.EmailCode):
|
|
28444
28444
|
// 放开手机号校验 方便同时开启邮箱和短信国际化手机号通过
|
|
28445
|
-
j(Pc.PhoneCode))},prefix:y().createElement(JL,{type:"authing-a-user-line1",style:{color:"#
|
|
28445
|
+
j(Pc.PhoneCode))},prefix:y().createElement(JL,{type:"authing-a-user-line1",style:{color:"#6B7280"}})})),(Y&&F===Pc.PhoneCode||J&&F===Pc.EmailCode)&&y().createElement(cT.Item,{className:"genauth-g2-input-form",validateTrigger:["onBlur","onChange"],name:"captchaCode",rules:QX(p("common.captchaCode"))},y().createElement(sz,{className:"genauth-g2-input",size:"large",placeholder:p("login.inputCaptchaCode"),verifyCodeUrl:Z,changeCode:function(){return X(n$(v.host))},onChange:function(e){$(e.target.value)}})),y().createElement(cT.Item,{key:"code",name:"code",validateTrigger:["onBlur","onChange"],rules:QX(p("common.captchaCode")),className:"genauth-g2-input-form",validateFirst:!0},y().createElement(re,null)),Boolean(null==c?void 0:c.length)&&y().createElement(Gz,{onChange:function(e,t){_(e),P.current=t},agreements:c,showError:N}),y().createElement(cT.Item,{className:"genauth-g2-sumbit-form"},y().createElement(Dj,{
|
|
28446
28446
|
// disabled={
|
|
28447
28447
|
// !!agreements.find((item) => item.required && !acceptedAgreements)
|
|
28448
28448
|
// }
|
|
@@ -28458,32 +28458,32 @@ return o.methods.filter((function(t){return e.includes(t)}))}),[o.methods]),_=tQ
|
|
|
28458
28458
|
// onLogin={onLogin}
|
|
28459
28459
|
onLoginSuccess:C,onLoginFailed:E,agreements:S,methods:_,submitButText:P})},{key:"password",title:s("login.bindPwdLogin"),component:y().createElement(p$,{publicKey:l,autoRegister:!!r,host:i.host,onLoginRequest:k,passwordLoginMethods:x,
|
|
28460
28460
|
// onLogin={onLogin}
|
|
28461
|
-
onLoginSuccess:C,onLoginFailed:E,agreements:S,submitButText:P})}],N=tQ((function(){return o.source===FD.IDENTITY_BINDING_ASK?y().createElement(MB,{onBack:function(){return null==a?void 0:a()}},s("common.back")):y().createElement(RB,null)}),[a,o.source,s]);return y().createElement("div",{className:"g2-view-container g2-view-identity-binding"},N,y().createElement("div",{className:"g2-view-identity-binding-content"},y().createElement("div",{className:"g2-view-identity-binding-content-logo"},y().createElement("img",{src:null==i?void 0:i.logo,alt:"",className:"logo"})),y().createElement("div",{className:"g2-view-identity-binding-content-title"},y().createElement("span",null,s(r?"common.identityBindingSkipAskTitle":"common.identityBindingTitle"))),y().createElement("div",{className:"g2-view-identity-binding-content-desc"},y().createElement("span",null,s(r?"common.identityBindingSkipAskDesc":"common.identityBindingDesc"))),y().createElement("div",{className:"g2-view-identity-binding-content-login"},y().createElement(xR,null,T.filter((function(e){return"password"===e.key?0!==x.length:"code"!==e.key||0!==_.length})).map((function(e){return y().createElement(xR.TabPane,{key:e.key,tab:e.title},e.component)}))))))},rQ=function(){return rQ=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},rQ.apply(this,arguments)},oQ=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},iQ=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},aQ=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},sQ=function(){var e=uD(),t=pD().changeModule;FB();var n=_u().t,r=UX().authFlow,o=ZD(),i=fD(),a=oD().spinChange,s=aQ(dj((function(){return oQ(void 0,void 0,void 0,(function(){var e,t,n,s,c;return iQ(this,(function(l){switch(l.label){case 0:return a(!0),[4/*yield*/,r(XY.CreateUser)];case 1:return e=l.sent(),t=e.code,n=e.onGuardHandling,s=e.data,c=e.isFlowEnd,a(!1),c?function(e){var t,n;null===(t=null==i?void 0:i.onLogin)||void 0===t||t.call(i,e,o),null===(n=null==i?void 0:i.onCreate)||void 0===n||n.call(i,e,o)}(s):(!function(e,t){var n,r;null===(n=null==i?void 0:i.onCreateError)||void 0===n||n.call(i,{code:e,data:t}),null===(r=null==i?void 0:i.onLoginError)||void 0===r||r.call(i,{code:e,data:t})}(t,s),null==n||n()),[2/*return*/]}}))}))}),[]),2),c=s[0],l=s[1];return y().createElement("div",{className:"g2-view-container g2-view-identity-binding-ask"},y().createElement(RB,null),y().createElement("div",{className:"g2-view-identity-binding-ask-content"},y().createElement("div",{className:"g2-view-identity-binding-ask-content-title"},y().createElement("span",null,n("common.identityBindingAskTitle"))),y().createElement("div",{className:"g2-view-identity-binding-ask-content-desc"},y().createElement("span",null,n("common.identityBindingAskDesc"))),y().createElement("div",{className:"g2-view-identity-binding-ask-content-img"},y().createElement(JL,{type:"authing-bind"})),y().createElement("div",{className:"g2-view-identity-binding-ask-content-button-group"},y().createElement(Nj,{className:"g2-view-identity-binding-ask-content-button g2-view-identity-binding-ask-content-button-create",loading:c.loading,onClick:l},n("common.identityBindingCreate")),y().createElement(Nj,{className:" g2-view-identity-binding-ask-content-button g2-view-identity-binding-ask-content-button-binding
|
|
28461
|
+
onLoginSuccess:C,onLoginFailed:E,agreements:S,submitButText:P})}],N=tQ((function(){return o.source===FD.IDENTITY_BINDING_ASK?y().createElement(MB,{onBack:function(){return null==a?void 0:a()}},s("common.back")):y().createElement(RB,null)}),[a,o.source,s]);return y().createElement("div",{className:"g2-view-container g2-view-identity-binding"},N,y().createElement("div",{className:"g2-view-identity-binding-content"},y().createElement("div",{className:"g2-view-identity-binding-content-logo"},y().createElement("img",{src:null==i?void 0:i.logo,alt:"",className:"logo"})),y().createElement("div",{className:"g2-view-identity-binding-content-title"},y().createElement("span",null,s(r?"common.identityBindingSkipAskTitle":"common.identityBindingTitle"))),y().createElement("div",{className:"g2-view-identity-binding-content-desc"},y().createElement("span",null,s(r?"common.identityBindingSkipAskDesc":"common.identityBindingDesc"))),y().createElement("div",{className:"g2-view-identity-binding-content-login"},y().createElement(xR,null,T.filter((function(e){return"password"===e.key?0!==x.length:"code"!==e.key||0!==_.length})).map((function(e){return y().createElement(xR.TabPane,{key:e.key,tab:e.title},e.component)}))))))},rQ=function(){return rQ=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},rQ.apply(this,arguments)},oQ=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},iQ=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},aQ=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},sQ=function(){var e=uD(),t=pD().changeModule;FB();var n=_u().t,r=UX().authFlow,o=ZD(),i=fD(),a=oD().spinChange,s=aQ(dj((function(){return oQ(void 0,void 0,void 0,(function(){var e,t,n,s,c;return iQ(this,(function(l){switch(l.label){case 0:return a(!0),[4/*yield*/,r(XY.CreateUser)];case 1:return e=l.sent(),t=e.code,n=e.onGuardHandling,s=e.data,c=e.isFlowEnd,a(!1),c?function(e){var t,n;null===(t=null==i?void 0:i.onLogin)||void 0===t||t.call(i,e,o),null===(n=null==i?void 0:i.onCreate)||void 0===n||n.call(i,e,o)}(s):(!function(e,t){var n,r;null===(n=null==i?void 0:i.onCreateError)||void 0===n||n.call(i,{code:e,data:t}),null===(r=null==i?void 0:i.onLoginError)||void 0===r||r.call(i,{code:e,data:t})}(t,s),null==n||n()),[2/*return*/]}}))}))}),[]),2),c=s[0],l=s[1];return y().createElement("div",{className:"g2-view-container g2-view-identity-binding-ask"},y().createElement(RB,null),y().createElement("div",{className:"g2-view-identity-binding-ask-content"},y().createElement("div",{className:"g2-view-identity-binding-ask-content-title"},y().createElement("span",null,n("common.identityBindingAskTitle"))),y().createElement("div",{className:"g2-view-identity-binding-ask-content-desc"},y().createElement("span",null,n("common.identityBindingAskDesc"))),y().createElement("div",{className:"g2-view-identity-binding-ask-content-img"},y().createElement(JL,{type:"authing-bind"})),y().createElement("div",{className:"g2-view-identity-binding-ask-content-button-group"},y().createElement(Nj,{className:"g2-view-identity-binding-ask-content-button g2-view-identity-binding-ask-content-button-create",loading:c.loading,onClick:l},n("common.identityBindingCreate")),y().createElement(Nj,{className:" g2-view-identity-binding-ask-content-button g2-view-identity-binding-ask-content-button-binding genauth-g2-submit-button",onClick:function(){null==t||t(FD.IDENTITY_BINDING,rQ(rQ({},e),{source:FD.IDENTITY_BINDING_ASK}))},type:"primary"},n("common.identityBindingBinding")))))},cQ=function(){return cQ=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},cQ.apply(this,arguments)},lQ=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},uQ=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},dQ=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},fQ=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},pQ=y().useCallback,hQ=y().useEffect,mQ=y().useRef,vQ=y().useState;!function(e){e.email="email-code",e.phone="phone-code"}(JJ||(JJ={}));var gQ,yQ=function(e){var t=e.identifyRef,n=_u().t,r=dQ(cT.useForm(),1)[0],o=dQ(vQ(""),2),i=o[0],a=o[1],s=dQ(vQ("phone"),2),c=s[0],l=s[1],u=mQ(null),d=Sj().autoFocus,f=ZD(),p=fD(),h=uD();hQ((function(){h.defaultEmail&&(a(h.defaultEmail),r.setFieldsValue({identify:h.defaultEmail}),l("email")),h.defaultPhone&&(a(h.defaultPhone),r.setFieldsValue({identify:h.defaultPhone}),l("phone"))}),[h,r]),hQ((function(){t&&(t.current=g0(i))}),[i,t]);var m=UX().authFlow,v=iD(),g=v.publicKey,b=v.verifyCodeLength,w=v.internationalSmsConfig,C=v.selfUnlockStrategy,E=void 0===C?"password-captcha":C,k=(null==w?void 0:w.enabled)||!1,S=pQ((function(e){return y().createElement(y().Fragment,null,"phone"===c&&y().createElement(aq,cQ({},e,{isInternationSms:k,className:"genauth-g2-input g2-send-code-input",autoComplete:"off",size:"large",placeholder:n("common.inputFourVerifyCode",{length:b}),prefix:y().createElement(JL,{type:"authing-a-shield-check-line1",style:{color:"#6B7280"}}),scene:Oi.SCENE_TYPE_RESET,maxLength:b,data:i,onSendCodeBefore:function(){return lQ(void 0,void 0,void 0,(function(){return uQ(this,(function(e){switch(e.label){case 0:return[4/*yield*/,r.validateFields(["identify"])];case 1:return e.sent(),[2/*return*/]}}))}))}})),"email"===c&&y().createElement(Gq,cQ({},e,{className:"genauth-g2-input g2-send-code-input",autoComplete:"off",size:"large",placeholder:n("common.inputFourVerifyCode",{length:b}),prefix:y().createElement(JL,{type:"authing-a-shield-check-line1",style:{color:"#6B7280"}}),scene:Nc.SELF_UNLOCKING_VERIFY_CODE,maxLength:b,data:i,onSendCodeBefore:function(){return lQ(void 0,void 0,void 0,(function(){return uQ(this,(function(e){switch(e.label){case 0:return[4/*yield*/,r.validateFields(["identify"])];case 1:return e.sent(),[2/*return*/]}}))}))},value:i})))}),[c,r,i,k,n,b]);return y().createElement("div",{className:"genauth-g2-login-phone-code"},y().createElement(cT,{name:"resetPassword",form:r,onFinish:function(e){return lQ(void 0,void 0,void 0,(function(){var t,n,r,o,i,a,s,l,d,h,v,y,b,w,C,S;return uQ(this,(function(x){switch(x.label){case 0:return t=e.identify,n=e.code,r=e.password||"",[4/*yield*/,null===(y=null===(v=f.options)||void 0===v?void 0:v.encryptFunction)||void 0===y?void 0:y.call(v,r,g)];case 1:return o=x.sent(),
|
|
28462
28462
|
// 密码,经过加密后的, 仅“验证码”时不传 password 字段
|
|
28463
28463
|
r="password-captcha"===E?o:void 0,"email"!==c?[3/*break*/,3]:[4/*yield*/,m("unlock-account-by-email",{email:t,// 用户输入的邮箱
|
|
28464
28464
|
code:n,// 验证码
|
|
28465
28465
|
password:r})];case 2:i=x.sent(),l=i.isFlowEnd,d=i.data,h=i.onGuardHandling,null===(b=u.current)||void 0===b||b.onSpin(!1),l?null===(w=null==p?void 0:p.onLogin)||void 0===w||w.call(p,d,f):null==h||h(),x.label=3;case 3:return"phone"!==c?[3/*break*/,5]:(a=xj(k,t).phoneNumber,[4/*yield*/,m("unlock-account-by-phone",{phone:a,// 用户输入的邮箱
|
|
28466
28466
|
code:n,// 验证码
|
|
28467
|
-
password:r})]);case 4:s=x.sent(),l=s.isFlowEnd,d=s.data,h=s.onGuardHandling,null===(C=u.current)||void 0===C||C.onSpin(!1),l?null===(S=null==p?void 0:p.onLogin)||void 0===S||S.call(p,d,f):null==h||h(),x.label=5;case 5:return[2/*return*/]}}))}))},onFinishFailed:function(){var e;null===(e=null==u?void 0:u.current)||void 0===e||e.onError()},autoComplete:"off"},y().createElement(ez,{name:"identify",className:"
|
|
28467
|
+
password:r})]);case 4:s=x.sent(),l=s.isFlowEnd,d=s.data,h=s.onGuardHandling,null===(C=u.current)||void 0===C||C.onSpin(!1),l?null===(S=null==p?void 0:p.onLogin)||void 0===S||S.call(p,d,f):null==h||h(),x.label=5;case 5:return[2/*return*/]}}))}))},onFinishFailed:function(){var e;null===(e=null==u?void 0:u.current)||void 0===e||e.onError()},autoComplete:"off"},y().createElement(ez,{name:"identify",className:"genauth-g2-input-form",methods:["email-code","phone-code"],currentMethod:JJ[c]},y().createElement(TW,{methods:["email-code","phone-code"],className:"genauth-g2-input",autoComplete:"off",autoFocus:d,size:"large",value:i,onChange:function(e){var t=e.target.value;a(t),JX("email",t)?l("email"):l("phone")},prefix:y().createElement(JL,{type:"authing-a-user-line1",style:{color:"#6B7280"}})})),y().createElement(cT.Item,{validateTrigger:["onBlur","onChange"],className:"genauth-g2-input-form",name:"code",rules:fQ([],dQ(QX(n("common.captchaCode"))),!1)},y().createElement(S,null)),"password-captcha"===E&&y().createElement(cT.Item,{validateTrigger:["onBlur","onChange"],className:"genauth-g2-input-form",name:"password",rules:fQ([],dQ(QX(n("common.password"))),!1)},y().createElement(gU,{className:"genauth-g2-input",size:"large",placeholder:n("user.inputOldPwd"),prefix:y().createElement(JL,{type:"authing-a-lock-line1",style:{color:"#6B7280"}})})),y().createElement(cT.Item,{className:"genauth-g2-sumbit-form submit-form"},y().createElement(Dj,{className:"forget-password",text:n("common.unlock"),ref:u}))))},bQ=y().useRef,wQ=function(){var e=_u().t,t=hD(),n=pD().changeModule,r=bQ("");return FB(),y().createElement("div",{className:"g2-view-container g2-forget-password"},y().createElement("div",{className:"g2-view-header"},y().createElement(Xj,{src:null==t?void 0:t.logo,size:48,borderRadius:4,alt:"",className:"icon"}),y().createElement("div",{className:"title"},e("login.selfUnlock")),y().createElement("div",{className:"title-explain"},e("login.selfUnlockText"))),y().createElement("div",{className:"g2-view-tabs"},y().createElement(yQ,{identifyRef:r})),y().createElement("div",{className:"g2-tips-line"},y().createElement("span",null,e("user.unlockTip")," "),y().createElement("span",{className:"link-like",onClick:function(){return null==n?void 0:n(FD.ANY_QUESTIONS,{identify:r.current})}},e("common.feedback")),y().createElement("div",{className:"link-like back-to-login",onClick:function(){return null==n?void 0:n(FD.LOGIN)}},e("common.backLoginPage"))))},CQ=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},EQ=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},kQ=y().useCallback,SQ=y().useMemo,xQ=function(){var e=hD(),t=fD(),n=ZD(),r=aD().post,o=SQ((function(){return e.loadingComponent}),[e.loadingComponent]),i=uD();FB();var a=kQ((function(e){return CQ(void 0,void 0,void 0,(function(){var o,i,a,s,c;return EQ(this,(function(l){switch(l.label){case 0:return[4/*yield*/,r("/interaction/federation/binding/select",{account:e.id})];case 1:return o=l.sent(),i=o.isFlowEnd,a=o.data,s=o.onGuardHandling,i?null===(c=null==t?void 0:t.onLogin)||void 0===c||c.call(t,a,n):null==s||s(),[2/*return*/]}}))}))}),[n,r,t]),s=SQ((function(){return i?null==i?void 0:i.accounts.map((function(e){var t=e.id,n=e.photo,r=e.phone,o=e.email,i=e.username,s=e.nickname,c=e.name||s||i||void 0,l=r||o;return y().createElement("li",{className:"g2-select-account__li",key:t,onClick:function(){return a(e)}},y().createElement("img",{className:"g2-select-account__avatar",alt:"",src:n||""}),y().createElement("div",{className:"g2-select-account__body"},c&&y().createElement("span",{className:"g2-select-account__title"},c),y().createElement("span",{className:c?"g2-multiple__desc":"g2-multiple__title"},l)))})):null}),[a,i]),c=SQ((function(){return i?i.i18n:""}),[i]);return y().createElement(y().Fragment,null,i?y().createElement("div",{className:"g2-view-container"},y().createElement("div",{className:"g2-view-header"},y().createElement(Xj,{src:null==e?void 0:e.logo,size:48,borderRadius:4,alt:"",className:"icon"}),y().createElement("div",{className:"title"},c)),y().createElement("div",{className:"g2-view-tabs"},y().createElement("ul",{className:"g2-select-account_wrapper"},s))):o)},_Q=function(){return _Q=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},_Q.apply(this,arguments)},PQ=function(e){var t,n=e.avatar,r=e.title,o=e.description,i=e.tags,a="string"==typeof n?{shape:"square",size:48,src:n}:n;return y().createElement("div",{className:"g2-view-header"},y().createElement(bv,_Q({className:"g2-view-avatar icon"},a)),y().createElement("div",{className:"title"},r),y().createElement("div",{className:"title-description"},o),null===(t=null==i?void 0:i.map)||void 0===t?void 0:t.call(i,(function(e,t){
|
|
28468
28468
|
// @ts-ignore
|
|
28469
|
-
return y().createElement(yE,_Q({key:t,className:"
|
|
28469
|
+
return y().createElement(yE,_Q({key:t,className:"genauth-header-tag"},e))})))},TQ=function(){return TQ=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},TQ.apply(this,arguments)},NQ=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},OQ=function(e){var t=e.dataSource,n=e.onSelect,r=e.gap,o=void 0===r?20:r,i=(e.isNewStyle,NQ(e,["dataSource","onSelect","gap","isNewStyle"]));
|
|
28470
28470
|
// @ts-ignore
|
|
28471
|
-
return y().createElement(NI,TQ({split:!1,size:"small"},i,{className:iB()(i.className,"
|
|
28471
|
+
return y().createElement(NI,TQ({split:!1,size:"small"},i,{className:iB()(i.className,"genauth-guard-select-list"),dataSource:t,renderItem:function(e,r){
|
|
28472
28472
|
// @ts-ignore
|
|
28473
|
-
return y().createElement(NI.Item,{actions:null==e?void 0:e.actions,extra:null==e?void 0:e.extra,key:r,onClick:function(){return null==n?void 0:n(e,r)},className:iB()("
|
|
28473
|
+
return y().createElement(NI.Item,{actions:null==e?void 0:e.actions,extra:null==e?void 0:e.extra,key:r,onClick:function(){return null==n?void 0:n(e,r)},className:iB()("genauth-guard-select-list-item"),style:(null==t?void 0:t.length)!==r+1?{marginBottom:o}:{}},y().createElement(NI.Item.Meta,{avatar:"string"==typeof(null==e?void 0:e.avatar)?y().createElement(bv,{size:40,src:e.avatar}):y().createElement(bv,TQ({size:40},e.avatar)),title:null==e?void 0:e.title,description:null==e?void 0:e.description}))}}))};!function(e){e.InputTenantCode="inputTenantCode",e.InputEnterpriseEmail="inputEnterpriseEmail",e.VerifyEmailCode="verifyEmailCode",e.NoEnterpriseDomain="noEnterpriseDomain",e.JoinSuccess="joinSuccess",e.JoinFailed="joinFailed"}(gQ||(gQ={}));// CONCATENATED MODULE: ./src/TenantPortalSelect/InputEmailCode/index.tsx
|
|
28474
28474
|
var IQ,AQ=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},RQ=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},MQ=y().useRef,LQ=(y().useState,y().useEffect),DQ=function(e){var t=e.email,n=e.setSent,r=e.onFinish,o=_u().t,i=UX(),a=i.post,s=(i.get,iD()),c=null==s?void 0:s.verifyCodeLength,l=MQ(null);return LQ((function(){setTimeout((function(){var e;null===(e=l.current)||void 0===e||e.click()}))}),[]),y().createElement(y().Fragment,null,y().createElement(rB,{name:"emailCode",codeLength:c,ruleKeyword:o("common.captchaCode")},y().createElement(SB,{length:c,onFinish:r})),y().createElement(HU,{btnRef:l,setSent:n,beforeSend:function(){return AQ(void 0,void 0,void 0,(function(){var e,r,i,s,c;return RQ(this,(function(l){switch(l.label){case 0:return l.trys.push([0,2,,3]),[4/*yield*/,a("/api/v2/email/send",{email:t,scene:v.VerifyCode})];case 1:return e=l.sent(),r=e.code,i=e.message,2080===e.apiCode?(
|
|
28475
28475
|
// 一分钟只能发一次邮箱验证码的提示信息,特殊处理
|
|
28476
|
-
gC.error(i),[2/*return*/,!1]):200===r?(n(!0),[2/*return*/,!0]):(gC.error(i||o("login.sendCodeTimeout")),[2/*return*/,!1]);case 2:if("ECONNABORTED"===(s=l.sent()).code)return gC.error(o("login.sendCodeTimeout")),[2/*return*/,!1];try{c=JSON.parse(s.message),gC.error(c.message)}catch(e){gC.error(s)}return[2/*return*/,!1];case 3:return[2/*return*/]}}))}))},type:"link",className:"
|
|
28476
|
+
gC.error(i),[2/*return*/,!1]):200===r?(n(!0),[2/*return*/,!0]):(gC.error(i||o("login.sendCodeTimeout")),[2/*return*/,!1]);case 2:if("ECONNABORTED"===(s=l.sent()).code)return gC.error(o("login.sendCodeTimeout")),[2/*return*/,!1];try{c=JSON.parse(s.message),gC.error(c.message)}catch(e){gC.error(s)}return[2/*return*/,!1];case 3:return[2/*return*/]}}))}))},type:"link",className:"genauth-join-send-btn"}))},FQ=function(){return FQ=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},FQ.apply(this,arguments)},jQ=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},BQ=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};!function(e){e.JoinTenant="join-tenant-portal",e.CreateTenant="create-tenant-portal"}(IQ||(IQ={}));var UQ,qQ,VQ=function(e,t){return jQ(void 0,void 0,void 0,(function(){return BQ(this,(function(n){switch(n.label){case 0:return[4/*yield*/,(0,BX().authFlow)(e,FQ({},t))];case 1:return[2/*return*/,n.sent()]}}))}))},zQ=function(){return zQ=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},zQ.apply(this,arguments)},$Q=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},HQ=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},WQ=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},GQ=y().useMemo,KQ=y().useState,YQ=y().useRef,JQ=y().useCallback,QQ=function(e){var t,n,r=e.onBack,o=_u().t,i=fD(),a=iD(),s=ZD(),c=aD(),l=WQ(KQ(null),2),u=l[0],d=l[1],f=WQ(KQ(gQ.InputTenantCode),2),p=f[0],h=f[1],m=WQ(cT.useForm(),1)[0],v=YQ(null),g=WQ(KQ(!1),2),b=g[0],w=g[1],C=WQ(KQ(""),2),E=C[0],k=C[1],S=function(e,t){return $Q(void 0,void 0,void 0,(function(){var n,r,o,a,l,u;return HQ(this,(function(d){switch(d.label){case 0:return d.trys.push([0,2,,3]),(null==e?void 0:e.host)&&c.setBaseUrl(null==e?void 0:e.host),!(null==e?void 0:e.isUserPool)&&(null==e?void 0:e.tenantId)?c.setTenantId(null==e?void 0:e.tenantId):c.setTenantId(""),[4/*yield*/,VQ(IQ.JoinTenant,{tenantId:e.tenantId,email:E||void 0,passCode:t})];case 1:return n=d.sent(),r=n.isFlowEnd,o=n.data,a=n.onGuardHandling,null===(u=null==i?void 0:i.onTenantSelect)||void 0===u||u.call(i,e),r?setTimeout((function(){var e;null===(e=null==i?void 0:i.onLogin)||void 0===e||e.call(i,o,s)})):null==a||a(),[3/*break*/,3];case 2:return(null==(l=d.sent())?void 0:l.message)&&gC.error(null==l?void 0:l.message),[3/*break*/,3];case 3:return[2/*return*/]}}))}))},x=JQ((function(){return $Q(void 0,void 0,void 0,(function(){var e,t,n,r;return HQ(this,(function(i){switch(i.label){case 0:return i.trys.push([0,7,,8]),[4/*yield*/,(s=m.getFieldValue("code"),jQ(void 0,void 0,void 0,(function(){return BQ(this,(function(e){switch(e.label){case 0:return[4/*yield*/,(0,BX().get)("/api/v3/get-tenant-public-info-by-code",{code:s})];case 1:return[2/*return*/,e.sent()]}}))})))];case 1:return e=i.sent(),t=e.data,n=e.message,d(t),t?a.enableVerifyDomainInJoinTenant?((null===(r=t.enterpriseDomains)||void 0===r?void 0:r.length)?
|
|
28477
28477
|
// 输入企业邮箱
|
|
28478
28478
|
h(gQ.InputEnterpriseEmail):
|
|
28479
28479
|
// 当前组织管理员未设置企业邮箱域名,请联系管理员设置后加入组织。
|
|
28480
|
-
h(gQ.NoEnterpriseDomain),[3/*break*/,4]):[3/*break*/,2]:[3/*break*/,5];case 2:return[4/*yield*/,S(t)];case 3:i.sent(),i.label=4;case 4:return[3/*break*/,6];case 5:gC.error(n),i.label=6;case 6:return[3/*break*/,8];case 7:return i.sent(),gC.error(o("common.codeError")),[3/*break*/,8];case 8:return[2/*return*/]}var s}))}))}),[]),_=GQ((function(){var e;return[{key:gQ.InputTenantCode,title:o("common.joinTenant"),okBtnText:o("common.sure"),formFields:[{type:"text",placeholder:o("common.tenantExample"),name:"code",rules:[{required:!0}],prefix:y().createElement(JL,{type:"authing-account-circle-line",style:{color:"#737373"}}),inputClassName:"authing-g2-input"}],onNext:function(){x()},onPrevOrCancel:function(){r()}},{key:gQ.InputEnterpriseEmail,title:o("common.emailVerify"),okBtnText:o("common.verify"),formFields:[{type:"text",placeholder:o("common.inputBusinessEmail"),name:"email",rules:[{required:!0}],addonAfter:"@".concat(null===(e=null==u?void 0:u.enterpriseDomains)||void 0===e?void 0:e[0]),inputClassName:"authing-g2-input-group authing-g2-input-group-email"}],onNext:function(){var e;h(gQ.VerifyEmailCode),k("".concat(m.getFieldValue("email"),"@").concat(null===(e=null==u?void 0:u.enterpriseDomains)||void 0===e?void 0:e[0]))},onPrevOrCancel:function(){h(gQ.InputTenantCode)}},{key:gQ.NoEnterpriseDomain,title:o("common.emailVerify"),hiddenConfirm:!0,formFields:[{type:"custom",customComponent:y().createElement("div",{className:"authing-warning-tips"},y().createElement(JL,{type:"authing-information-fill",className:"authing-warning-tips-icon"}),y().createElement("span",null,o("common.domainNotFound")))}],onPrevOrCancel:function(){h(gQ.InputTenantCode)}},{key:gQ.VerifyEmailCode,title:o("common.inputCode"),description:b?"".concat(o("login.verifyCodeSended")," ").concat(f0(E)):o("common.emailMfaCheck"),okBtnText:o("common.sure"),formFields:[{type:"custom",customComponent:y().createElement(DQ,{email:E,setSent:w,onFinish:function(){var e;S(u,null===(e=m.getFieldValue("emailCode"))||void 0===e?void 0:e.join(""))}}),noStyle:!0}],hiddenConfirm:!0,onPrevOrCancel:function(){h(gQ.InputEnterpriseEmail)}}]}),[u,E,b,w]),P=GQ((function(){return _.find((function(e){return e.key===p}))}),[p,_]),T=GQ((function(){return y().createElement(MB,{onBack:null==P?void 0:P.onPrevOrCancel},o("common.back"))}),[o,P]);return y().createElement("div",{className:"g2-view-container g2-view-join"},T,y().createElement("div",{className:"g2-join-content"},y().createElement("p",{className:"authing-g2-join-title"},null==P?void 0:P.title),y().createElement("p",{className:"authing-g2-join-description"},null==P?void 0:P.description),y().createElement(cT,{form:m,onFinish:null==P?void 0:P.onNext,style:{width:"100%"},onFinishFailed:function(){var e;return null===(e=v.current)||void 0===e?void 0:e.onError()}},null===(n=null===(t=null==P?void 0:P.formFields)||void 0===t?void 0:t.map)||void 0===n?void 0:n.call(t,(function(e){return y().createElement(cT.Item,{className:"authing-g2-input-form",name:null==e?void 0:e.name,rules:null==e?void 0:e.rules,noStyle:null==e?void 0:e.noStyle},function(e){switch(e.type){case"text":return y().createElement(oN,{className:e.inputClassName,autoComplete:"off",size:"large",addonBefore:e.addonBefore,addonAfter:e.addonAfter,prefix:e.prefix,suffix:e.suffix,disabled:e.disabled,placeholder:e.placeholder,readOnly:e.readOnly,style:zQ({},e.style),maxLength:e.maxLength});case"custom":return e.customComponent}}(e))})),!(null==P?void 0:P.hiddenConfirm)&&y().createElement(Dj,{text:o("common.sure"),ref:v,className:"authing-g2-join-button"}))))},ZQ=function(e){var t=e.className,n=e.onClick,r=e.style,o=e.icon,i=e.text;_u().t;return y().createElement("div",{className:iB()("authing-add-button",t),onClick:n,style:r},y().createElement("span",{className:"authing-add-button-icon"},y().createElement(JL,{type:o})),i)},XQ=function(){return XQ=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},XQ.apply(this,arguments)},eZ=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},tZ=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},nZ=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},rZ=y().useMemo,oZ=y().useRef,iZ=function(e){var t=e.onBack,n=_u().t,r=fD(),o=ZD(),i=aD(),a=iD(),s=null==a?void 0:a.cdnBase,c=dD().moduleName,l=nZ(cT.useForm(),1)[0],u=oZ(null),d=rZ((function(){return y().createElement(MB,{onBack:t},n("common.back"))}),[n]);return y().createElement("div",{className:"g2-view-container g2-view-join"},d,y().createElement("div",{className:"g2-join-content"},y().createElement("p",{className:"authing-g2-join-title"},n("common.createTenant")),y().createElement(cT,{layout:"vertical",form:l,onFinish:function(){return eZ(void 0,void 0,void 0,(function(){var e,t,n,a,u,d,f,p,h,m,v,g;return tZ(this,(function(y){switch(y.label){case 0:return e=l.getFieldsValue(),[4/*yield*/,VQ(IQ.CreateTenant,XQ(XQ({},e),{logo:"".concat(s,"/tenant-default-logo.svg")}))];case 1:return t=y.sent(),n=t.isFlowEnd,a=t.data,u=t.onGuardHandling,d=t.apiCode,n?(setTimeout((function(){var e;null===(e=null==r?void 0:r.onLogin)||void 0===e||e.call(r,a,o)})),[3/*break*/,5]):[3/*break*/,2];case 2:return 1708!==d?[3/*break*/,4]:(f=XQ({},a),null===(g=null==r?void 0:r.onTenantSelect)||void 0===g||g.call(r,f),(null==f?void 0:f.host)&&i.setBaseUrl(null==f?void 0:f.host),!(null==f?void 0:f.isUserPool)&&(null==f?void 0:f.tenantId)?i.setTenantId(null==f?void 0:f.tenantId):i.setTenantId(""),[4/*yield*/,i.authFlow(c)]);case 3:return p=y.sent(),h=p.isFlowEnd,m=p.onGuardHandling,v=p.data,h?setTimeout((function(){var e;return null===(e=null==r?void 0:r.onLogin)||void 0===e?void 0:e.call(r,v,o)})):null==m||m(),[3/*break*/,5];case 4:null==u||u(),y.label=5;case 5:return[2/*return*/]}}))}))},style:{width:"100%"},onFinishFailed:function(){var e;return null===(e=u.current)||void 0===e?void 0:e.onError()}},y().createElement(cT.Item,{className:"authing-g2-input-form",name:"name",label:n("common.tenantName"),required:!0,rules:[{required:!0}]},y().createElement(oN,{className:"authing-g2-input",autoComplete:"off",size:"large",placeholder:n("common.pleaseInput")})),y().createElement(cT.Item,{className:"authing-g2-input-form",name:"enterpriseDomains",label:n("common.tenantEmail")},y().createElement(oN,{className:"authing-g2-input-group",autoComplete:"off",size:"large",placeholder:n("common.pleaseInput"),addonBefore:"@"})),y().createElement(cT.Item,{className:"authing-g2-input-form",name:"description",label:n("common.tenantDesc")},y().createElement(oN.TextArea,{className:"authing-g2-input",autoComplete:"off",size:"large",placeholder:n("common.pleaseInput")})),y().createElement(Dj,{text:n("common.sure"),ref:u,className:"authing-g2-join-button"}))))},aZ=function(){return aZ=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},aZ.apply(this,arguments)},sZ=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},cZ=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},lZ=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},uZ=y().useCallback,dZ=y().useMemo,fZ=y().useState,pZ=function(){var e=_u().t,t=dD().moduleName,n=uD(),r=n.list,o=n.title,i=n.description,a=n.logo,s=fD(),c=ZD(),l=aD(),u=iD(),d=lZ(fZ("default"),2),f=d[0],p=d[1];FB();var h=uZ((function(e){return sZ(void 0,void 0,void 0,(function(){var n,r,o,i,a,u;return cZ(this,(function(d){switch(d.label){case 0:return n=hd()(e,["avatar","extra","userName","title"]),null===(u=null==s?void 0:s.onTenantSelect)||void 0===u||u.call(s,n),(null==e?void 0:e.host)&&l.setBaseUrl(null==e?void 0:e.host),!(null==e?void 0:e.isUserPool)&&(null==e?void 0:e.tenantId)?l.setTenantId(null==e?void 0:e.tenantId):l.setTenantId(""),[4/*yield*/,l.authFlow(t)];case 1:return r=d.sent(),o=r.isFlowEnd,i=r.onGuardHandling,a=r.data,o?setTimeout((function(){var e;return null===(e=null==s?void 0:s.onLogin)||void 0===e?void 0:e.call(s,a,c)})):null==i||i(),[2/*return*/]}}))}))}),[c,s,l,t]),m=dZ((function(){var t;return null===(t=null==r?void 0:r.map)||void 0===t?void 0:t.call(r,(function(t){return aZ(aZ({},t),{title:t.isUserPool?y().createElement(y().Fragment,null,t.tenantName,y().createElement(yE,{className:"authing-tag blue"},e("common.visitor"))):t.tenantName,
|
|
28480
|
+
h(gQ.NoEnterpriseDomain),[3/*break*/,4]):[3/*break*/,2]:[3/*break*/,5];case 2:return[4/*yield*/,S(t)];case 3:i.sent(),i.label=4;case 4:return[3/*break*/,6];case 5:gC.error(n),i.label=6;case 6:return[3/*break*/,8];case 7:return i.sent(),gC.error(o("common.codeError")),[3/*break*/,8];case 8:return[2/*return*/]}var s}))}))}),[]),_=GQ((function(){var e;return[{key:gQ.InputTenantCode,title:o("common.joinTenant"),okBtnText:o("common.sure"),formFields:[{type:"text",placeholder:o("common.tenantExample"),name:"code",rules:[{required:!0}],prefix:y().createElement(JL,{type:"authing-account-circle-line",style:{color:"#6B7280"}}),inputClassName:"genauth-g2-input"}],onNext:function(){x()},onPrevOrCancel:function(){r()}},{key:gQ.InputEnterpriseEmail,title:o("common.emailVerify"),okBtnText:o("common.verify"),formFields:[{type:"text",placeholder:o("common.inputBusinessEmail"),name:"email",rules:[{required:!0}],addonAfter:"@".concat(null===(e=null==u?void 0:u.enterpriseDomains)||void 0===e?void 0:e[0]),inputClassName:"genauth-g2-input-group genauth-g2-input-group-email"}],onNext:function(){var e;h(gQ.VerifyEmailCode),k("".concat(m.getFieldValue("email"),"@").concat(null===(e=null==u?void 0:u.enterpriseDomains)||void 0===e?void 0:e[0]))},onPrevOrCancel:function(){h(gQ.InputTenantCode)}},{key:gQ.NoEnterpriseDomain,title:o("common.emailVerify"),hiddenConfirm:!0,formFields:[{type:"custom",customComponent:y().createElement("div",{className:"genauth-warning-tips"},y().createElement(JL,{type:"authing-information-fill",className:"genauth-warning-tips-icon"}),y().createElement("span",null,o("common.domainNotFound")))}],onPrevOrCancel:function(){h(gQ.InputTenantCode)}},{key:gQ.VerifyEmailCode,title:o("common.inputCode"),description:b?"".concat(o("login.verifyCodeSended")," ").concat(f0(E)):o("common.emailMfaCheck"),okBtnText:o("common.sure"),formFields:[{type:"custom",customComponent:y().createElement(DQ,{email:E,setSent:w,onFinish:function(){var e;S(u,null===(e=m.getFieldValue("emailCode"))||void 0===e?void 0:e.join(""))}}),noStyle:!0}],hiddenConfirm:!0,onPrevOrCancel:function(){h(gQ.InputEnterpriseEmail)}}]}),[u,E,b,w]),P=GQ((function(){return _.find((function(e){return e.key===p}))}),[p,_]),T=GQ((function(){return y().createElement(MB,{onBack:null==P?void 0:P.onPrevOrCancel},o("common.back"))}),[o,P]);return y().createElement("div",{className:"g2-view-container g2-view-join"},T,y().createElement("div",{className:"g2-join-content"},y().createElement("p",{className:"genauth-g2-join-title"},null==P?void 0:P.title),y().createElement("p",{className:"genauth-g2-join-description"},null==P?void 0:P.description),y().createElement(cT,{form:m,onFinish:null==P?void 0:P.onNext,style:{width:"100%"},onFinishFailed:function(){var e;return null===(e=v.current)||void 0===e?void 0:e.onError()}},null===(n=null===(t=null==P?void 0:P.formFields)||void 0===t?void 0:t.map)||void 0===n?void 0:n.call(t,(function(e){return y().createElement(cT.Item,{className:"genauth-g2-input-form",name:null==e?void 0:e.name,rules:null==e?void 0:e.rules,noStyle:null==e?void 0:e.noStyle},function(e){switch(e.type){case"text":return y().createElement(oN,{className:e.inputClassName,autoComplete:"off",size:"large",addonBefore:e.addonBefore,addonAfter:e.addonAfter,prefix:e.prefix,suffix:e.suffix,disabled:e.disabled,placeholder:e.placeholder,readOnly:e.readOnly,style:zQ({},e.style),maxLength:e.maxLength});case"custom":return e.customComponent}}(e))})),!(null==P?void 0:P.hiddenConfirm)&&y().createElement(Dj,{text:o("common.sure"),ref:v,className:"genauth-g2-join-button"}))))},ZQ=function(e){var t=e.className,n=e.onClick,r=e.style,o=e.icon,i=e.text;_u().t;return y().createElement("div",{className:iB()("genauth-add-button",t),onClick:n,style:r},y().createElement("span",{className:"genauth-add-button-icon"},y().createElement(JL,{type:o})),i)},XQ=function(){return XQ=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},XQ.apply(this,arguments)},eZ=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},tZ=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},nZ=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},rZ=y().useMemo,oZ=y().useRef,iZ=function(e){var t=e.onBack,n=_u().t,r=fD(),o=ZD(),i=aD(),a=iD(),s=null==a?void 0:a.cdnBase,c=dD().moduleName,l=nZ(cT.useForm(),1)[0],u=oZ(null),d=rZ((function(){return y().createElement(MB,{onBack:t},n("common.back"))}),[n]);return y().createElement("div",{className:"g2-view-container g2-view-join"},d,y().createElement("div",{className:"g2-join-content"},y().createElement("p",{className:"genauth-g2-join-title"},n("common.createTenant")),y().createElement(cT,{layout:"vertical",form:l,onFinish:function(){return eZ(void 0,void 0,void 0,(function(){var e,t,n,a,u,d,f,p,h,m,v,g;return tZ(this,(function(y){switch(y.label){case 0:return e=l.getFieldsValue(),[4/*yield*/,VQ(IQ.CreateTenant,XQ(XQ({},e),{logo:"".concat(s,"/tenant-default-logo.svg")}))];case 1:return t=y.sent(),n=t.isFlowEnd,a=t.data,u=t.onGuardHandling,d=t.apiCode,n?(setTimeout((function(){var e;null===(e=null==r?void 0:r.onLogin)||void 0===e||e.call(r,a,o)})),[3/*break*/,5]):[3/*break*/,2];case 2:return 1708!==d?[3/*break*/,4]:(f=XQ({},a),null===(g=null==r?void 0:r.onTenantSelect)||void 0===g||g.call(r,f),(null==f?void 0:f.host)&&i.setBaseUrl(null==f?void 0:f.host),!(null==f?void 0:f.isUserPool)&&(null==f?void 0:f.tenantId)?i.setTenantId(null==f?void 0:f.tenantId):i.setTenantId(""),[4/*yield*/,i.authFlow(c)]);case 3:return p=y.sent(),h=p.isFlowEnd,m=p.onGuardHandling,v=p.data,h?setTimeout((function(){var e;return null===(e=null==r?void 0:r.onLogin)||void 0===e?void 0:e.call(r,v,o)})):null==m||m(),[3/*break*/,5];case 4:null==u||u(),y.label=5;case 5:return[2/*return*/]}}))}))},style:{width:"100%"},onFinishFailed:function(){var e;return null===(e=u.current)||void 0===e?void 0:e.onError()}},y().createElement(cT.Item,{className:"genauth-g2-input-form",name:"name",label:n("common.tenantName"),required:!0,rules:[{required:!0}]},y().createElement(oN,{className:"genauth-g2-input",autoComplete:"off",size:"large",placeholder:n("common.pleaseInput")})),y().createElement(cT.Item,{className:"genauth-g2-input-form",name:"enterpriseDomains",label:n("common.tenantEmail")},y().createElement(oN,{className:"genauth-g2-input-group",autoComplete:"off",size:"large",placeholder:n("common.pleaseInput"),addonBefore:"@"})),y().createElement(cT.Item,{className:"genauth-g2-input-form",name:"description",label:n("common.tenantDesc")},y().createElement(oN.TextArea,{className:"genauth-g2-input",autoComplete:"off",size:"large",placeholder:n("common.pleaseInput")})),y().createElement(Dj,{text:n("common.sure"),ref:u,className:"genauth-g2-join-button"}))))},aZ=function(){return aZ=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},aZ.apply(this,arguments)},sZ=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},cZ=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},lZ=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},uZ=y().useCallback,dZ=y().useMemo,fZ=y().useState,pZ=function(){var e=_u().t,t=dD().moduleName,n=uD(),r=n.list,o=n.title,i=n.description,a=n.logo,s=fD(),c=ZD(),l=aD(),u=iD(),d=lZ(fZ("default"),2),f=d[0],p=d[1];FB();var h=uZ((function(e){return sZ(void 0,void 0,void 0,(function(){var n,r,o,i,a,u;return cZ(this,(function(d){switch(d.label){case 0:return n=hd()(e,["avatar","extra","userName","title"]),null===(u=null==s?void 0:s.onTenantSelect)||void 0===u||u.call(s,n),(null==e?void 0:e.host)&&l.setBaseUrl(null==e?void 0:e.host),!(null==e?void 0:e.isUserPool)&&(null==e?void 0:e.tenantId)?l.setTenantId(null==e?void 0:e.tenantId):l.setTenantId(""),[4/*yield*/,l.authFlow(t)];case 1:return r=d.sent(),o=r.isFlowEnd,i=r.onGuardHandling,a=r.data,o?setTimeout((function(){var e;return null===(e=null==s?void 0:s.onLogin)||void 0===e?void 0:e.call(s,a,c)})):null==i||i(),[2/*return*/]}}))}))}),[c,s,l,t]),m=dZ((function(){var t;return null===(t=null==r?void 0:r.map)||void 0===t?void 0:t.call(r,(function(t){return aZ(aZ({},t),{title:t.isUserPool?y().createElement(y().Fragment,null,t.tenantName,y().createElement(yE,{className:"genauth-tag blue"},e("common.visitor"))):t.tenantName,
|
|
28481
28481
|
// description: it.userName!,
|
|
28482
|
-
avatar:{size:40,src:t.tenantLogo,style:{borderRadius:4}},extra:y().createElement("div",{className:"
|
|
28482
|
+
avatar:{size:40,src:t.tenantLogo,style:{borderRadius:4}},extra:y().createElement("div",{className:"genauth-gaurd-select-extra"},y().createElement("span",null,e("common.enter")),y().createElement(JL,{type:"authing-arrow-left-s-line",className:"genauth-gaurd-select-extra-icon"}))})}))}),[r]),v={default:y().createElement("div",{className:"g2-view-container g2-view-tenant"},y().createElement("div",{className:"g2-view-container-inner"},y().createElement(PQ,{title:o,description:i,avatar:a}),(null==m?void 0:m.length)?y().createElement(y().Fragment,null,y().createElement(OQ,{dataSource:m,onSelect:h,className:"g2-view-container-tenant",gap:8}),y().createElement("div",{className:"g2-view-container-tenant g2-view-container-tenant-footer"},u.enableJoinTenant&&y().createElement(ZQ,{onClick:function(){p("join")},icon:"authing-user-received-2-line",text:e("common.joinTenant")}),u.enableCreateTenant&&y().createElement(ZQ,{onClick:function(){p("create")},icon:"authing-add-line",text:e("common.createTenant")}))):y().createElement("div",{className:"g2-error-content g2-error-content-tenant"},y().createElement("div",{style:{display:"flex",justifyContent:"center"}},y().createElement("div",{style:{width:240,height:160,backgroundImage:"url(https://authing-files.oss-cn-zhangjiakou.aliyuncs.com/authing-guard/authing_error.svg)",backgroundSize:"contain"}})),y().createElement("span",{className:"g2-error-message-text",dangerouslySetInnerHTML:{__html:e("common.noTenant")}}),y().createElement(ZQ,{className:"genauth-tenant-join",onClick:function(){p("join")},icon:"authing-add-line",text:e("common.joinTenant")})))),join:y().createElement(QQ,{onBack:function(){p("default")}}),create:y().createElement(iZ,{onBack:function(){p("default")}})};return y().createElement(y().Fragment,null,v[f])},hZ=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},mZ=y().useEffect,vZ=y().useRef,gZ=y().useState,yZ=function(){var e=_u().t,t=uD(),n=pD().changeModule,r=hZ(gZ(5),2),o=r[0],i=r[1],a=vZ(0),s=iD();FB();var c=null!=t?t:{},l=c.title,u=void 0===l?e("login.resetPassword.successTip"):l,d=c.message,f=void 0===d?e("login.resetPassword.successTipMsg"):d,p=c.text,h=void 0===p?e("login.resetPassword.back"):p,m=c.countDesc,v=void 0===m?e("login.resetPassword.backLogin"):m,
|
|
28483
28483
|
// changeModule = GuardModuleType.LOGIN,
|
|
28484
28484
|
g=c.needBack,
|
|
28485
28485
|
// changeModule = GuardModuleType.LOGIN,
|
|
28486
|
-
b=void 0===g||g,w=c.goBack,C=void 0===w?function(){return null==n?void 0:n(FD.LOGIN)}:w,E=null==s?void 0:s.cdnBase;return mZ((function(){return a.current=setInterval((function(){i((function(e){return e-1}))}),1e3),function(){return clearInterval(a.current)}}),[]),mZ((function(){o<=0&&(clearInterval(a.current),b&&(null==C||C()))}),[o,b,C]),y().createElement("div",{className:"g2-view-container g2-submit-success g2-view-container-submit-success"},y().createElement("div",{className:"g2-view-tabs g2-questions-send-success-pageWrap"},y().createElement(Xj,{className:"plate-submit-success",src:"".concat(E,"/questions-send-ok.png"),alt:"",width:157,height:120}),y().createElement("div",{className:"success-page-title "},u),y().createElement("div",{className:"success-page-message"},f),b&&y().createElement(y().Fragment,null,y().createElement(Dj,{className:"success-page-btn",onClick:function(){null==C||C()},text:h}),y().createElement("div",{className:"success-page-timer-tip"},o," ",v))))},bZ=function(){return bZ=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},bZ.apply(this,arguments)},wZ=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},CZ=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},EZ=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},kZ=y().useRef,SZ=(y().useState,y().useCallback,y().useEffect,function(){var e,t,n,r=_u().t,o=hD(),i=fD(),a=uD(),s=pD().changeModule,c=iD(),l=UX(),u=(l.get,l.post),d=EZ(cT.useForm(),1)[0],f=kZ(null),p=null==c?void 0:c.verifyCodeLength;return y().createElement("div",{className:"g2-view-container g2-view-invitation-apply"},y().createElement("div",{className:"g2-view-container-inner"},y().createElement("div",{className:"g2-view-header"},y().createElement("img",{src:null===(e=null==a?void 0:a.userPool)||void 0===e?void 0:e.logo,alt:"",className:"icon"}),y().createElement("div",{className:"g2-view-header-container"},y().createElement("div",{className:"invitation-welcome"},null===(t=null==a?void 0:a.inviter)||void 0===t?void 0:t.displayName," ",r("common.welcomeJoin")),y().createElement("div",{className:"title"},null===(n=null==a?void 0:a.userPool)||void 0===n?void 0:n.name))),y().createElement("div",{className:"g2-view-content"},y().createElement(cT,{layout:"vertical",name:"et-pre-check-email",onFinish:function(){return wZ(void 0,void 0,void 0,(function(){var e,t,n,i,c,l;return CZ(this,(function(p){switch(p.label){case 0:return p.trys.push([0,2,3,4]),null===(c=f.current)||void 0===c||c.onSpin(!0),[4/*yield*/,u("/api/v3/signup-by-invitation",bZ(bZ({},d.getFieldsValue()),{identifier:null==a?void 0:a.identifier,profile:bZ({},d.getFieldsValue())}))];case 1:return e=p.sent(),t=e.statusCode,n=e.message,i=e.data,200!==t?gC.error(n):null==s||s(FD.MESSAGE,{message:"PENDING"===i.status?r("common.pendingMsg",[o.title]):r("common.doneMsg")}),[3/*break*/,4];case 2:return p.sent(),[3/*break*/,4];case 3:return null===(l=f.current)||void 0===l||l.onSpin(!1),[7/*endfinally*/];case 4:return[2/*return*/]}}))}))},onFinishFailed:function(){return f.current.onError()},autoComplete:"off",form:d,className:"authing-g2-form-required-item-icon-after"},y().createElement(cT.Item,{name:"name",label:r("common.name"),rules:[{required:!0}],className:"authing-g2-input-form"},y().createElement(oN,{type:"text",size:"large",className:"authing-g2-input",autoComplete:"off"})),y().createElement(hU.Email,{className:"authing-g2-input-form",name:"email",checkRepeat:!0,label:su.t("common.email"),key:"internal email:email13",validateFirst:!0,required:!0},y().createElement(oN,{className:"authing-g2-input",autoComplete:"email",size:"large",placeholder:r("login.inputEmail")})),y().createElement(cT.Item,{validateTrigger:["onBlur","onChange"],className:"authing-g2-input-form",name:"emailCode",key:"internal email:code1432",rules:QX(r("common.captchaCode"))},y().createElement(Gq,{className:"authing-g2-input g2-send-code-input",autoComplete:"one-time-code",size:"large",placeholder:r("common.inputFourVerifyCode",{length:p}),maxLength:p,data:"",scene:Nc.VERIFY_CODE,fieldName:"email",form:d,onSendCodeBefore:function(){return wZ(void 0,void 0,void 0,(function(){return CZ(this,(function(e){switch(e.label){case 0:return(null==c?void 0:c.closeCheckSendUser)?[3/*break*/,2]:[4/*yield*/,d.validateFields(["email"])];case 1:return e.sent(),[3/*break*/,3];case 2:Promise.resolve(!0),e.label=3;case 3:return[2/*return*/]}}))}))}})),y().createElement(cT.Item,{className:"authing-g2-sumbit-form"},y().createElement(Dj,{text:r("common.applyJoin"),className:"password",ref:f})))),y().createElement(SD,{langRange:null==o?void 0:o.langRange,onLangChange:null==i?void 0:i.onLangChange})))}),xZ=y().useMemo,_Z=function(e){var t=uD(),n=iD();FB();var r=xZ((function(){var n,r,o=null!==(n=null==e?void 0:e.message)&&void 0!==n?n:null==t?void 0:t.message;return null!==(r="".concat(o))&&void 0!==r?r:"".concat(su.t("user.contactAdministrator"))}),[null==t?void 0:t.message,null==e?void 0:e.message]);return y().createElement("div",{className:"g2-view-container g2-view-message"},y().createElement("div",{className:"g2-message-content"},y().createElement("div",{style:{display:"flex",justifyContent:"center"}},y().createElement("div",{style:{width:135,height:103,backgroundImage:"url(".concat(n.cdnBase,"/authing_message.svg?v=1)"),backgroundSize:"contain"}})),y().createElement("span",{className:"g2-message-text",dangerouslySetInnerHTML:{__html:r}})))},PZ=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},TZ=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},NZ=y().useCallback,OZ=function(e,t){var n=ZD(),r=fD(),o=aD().post,i=BX().authFlow,a=pD().changeModule,s=NZ((function(e){return PZ(void 0,void 0,void 0,(function(){var i,s,c,l,u,d,f,p,h,m,v,g;return TZ(this,(function(y){switch(y.label){case 0:if(!(i=null==r?void 0:r.onBeforeRegister))return[3/*break*/,4];y.label=1;case 1:return y.trys.push([1,3,,4]),[4/*yield*/,i({type:e.verifyType,data:e},n)];case 2:return y.sent()?[3/*break*/,4]:(null===(h=null==t?void 0:t.current)||void 0===h||h.onSpin(!1),[2/*return*/]);case 3:return"string"==typeof(s=y.sent())?gC.error(s):gC.error(null==s?void 0:s.message),null===(m=null==t?void 0:t.current)||void 0===m||m.onSpin(!1),[2/*return*/];case 4:return[4/*yield*/,o("/api/v3/join-by-invitation",e)];case 5:return c=y.sent(),l=c.statusCode,u=c.code,c.apiCode,d=c.data,f=c.onGuardHandling,p=c.message,200===l?(null===(v=null==r?void 0:r.onRegister)||void 0===v||v.call(r,d,n),null==a||a(FD.INVITE_SUCCESS)):(null==f||f(),null===(g=null==r?void 0:r.onRegisterError)||void 0===g||g.call(r,{code:u,data:d,message:p})),[2/*return*/]}}))}))}),[n,i,a,r,o,t]);return s},IZ=function(){return IZ=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},IZ.apply(this,arguments)},AZ=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},RZ=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},MZ=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},LZ=y().useCallback,DZ=y().useEffect,FZ=y().useMemo,jZ=y().useRef,BZ=y().useState,UZ=function(){var e=uD(),t=fD(),n=hD(),r=_u().t,o=jZ(null);FB();var i=pD().changeModule,a=aD().post,s=iD(),c=null==s?void 0:s.verifyCodeLength,l=MZ(cT.useForm(),1)[0],u=jZ(null),d=MZ(BZ(!0),2),f=d[0],p=d[1],h=MZ(BZ("prioritySMS"===e.sendVerifyCodeMethod&&e.phone?"smsCode":"emailCode"),2),m=h[0],v=h[1],g=jZ(null),b=FZ((function(){return"emailCode"===m?e.email:"smsCode"===m?e.phone:void 0}),[e.email,e.phone,m]),w=FZ((function(){var t={prioritySMS:{emailCode:{desc:r("common.sendSms"),show:e.phone,receiverType:"smsCode"},smsCode:{desc:r("common.sendEmail"),show:e.email,receiverType:"emailCode"}},priorityEmail:{emailCode:{desc:r("common.sendSms"),show:e.phone,receiverType:"smsCode"},smsCode:{desc:r("common.sendEmail"),show:e.email,receiverType:"emailCode"}}},n=e.sendVerifyCodeMethod;return["prioritySMS","priorityEmail"].some((function(e){return n===e}))?IZ({},t[n][m]):t[n]}),[e,r,m]),C=LZ((function(e){return AZ(void 0,void 0,void 0,(function(){return RZ(this,(function(t){switch(t.label){case 0:return[4/*yield*/,a("emailCode"===e.receiverType?"/api/v2/email/send":"/api/v2/sms/send",IZ(IZ({},e),{scene:"emailCode"===e.receiverType?Nc.REGISTER_VERIFY_CODE:Oi.SCENE_TYPE_REGISTER}))];case 1:return[2/*return*/,t.sent()]}}))}))}),[a]),E=OZ(0,u);DZ((function(){var e;o.current&&(null===(e=o.current)||void 0===e||e.click())}),[]);var k=function(t){return AZ(void 0,void 0,void 0,(function(){var n,r,o;return RZ(this,(function(i){switch(i.label){case 0:return n="default"===t?m:w.receiverType,[4/*yield*/,C({phone:e.phone,phoneCountryCode:e.phoneCountryCode,email:e.email,receiverType:n})];case 1:return 200===(r=i.sent()).code?(v(n),[2/*return*/,!0]):(null===(o=r.onGuardHandling)||void 0===o||o.call(r),[2/*return*/,!1])}}))}))};return y().createElement("div",{className:"g2-view-container g2-view-invite"},y().createElement("div",{className:"g2-invite-content"},y().createElement("div",{className:"g2-view-invite-header"},y().createElement("div",{className:"title"},r("common.inputCaptcha")),y().createElement("div",{className:"tips"},r("common.verifyAccount",[b&&("emailCode"===m?f0(b):p0(b))])),y().createElement("div",{className:"tips errorTips"},r("common.captchaMaxErrorCount",[e.verifyCodeMaxErrCount]))),y().createElement(cT,{form:l,onFinish:function(t){return AZ(void 0,void 0,void 0,(function(){var n,r,o,s,c,l,u,d,f,p,h,v;return RZ(this,(function(g){switch(g.label){case 0:return n=t.code,[4/*yield*/,a("/api/v3/verify-invite-code",{code:n,receiverType:m,token:e.token})];case 1:return r=g.sent(),o=r.statusCode,s=r.onGuardHandling,200!==o?[3/*break*/,5]:(c=e.extendsFields,l=void 0===c?[]:c,u=e.extendsFieldsOptions,d=void 0===u?[]:u,f=e.enabledInfoFill,p={code:n,token:e.token,receiverType:m},h=null==l?void 0:l.filter((function(t){return"email"===t.name&&"internal"===t.type?!e.email:"phone"===t.name&&"internal"===t.type?!e.phone:"username"===t.name&&"internal"===t.type?!e.username:"name"!==t.name||"internal"!==t.type||!e.name})),v=iV(h,d),f&&v.length>0?(null==i||i(FD.INVITE_COMPLETE,IZ(IZ({},e),{
|
|
28486
|
+
b=void 0===g||g,w=c.goBack,C=void 0===w?function(){return null==n?void 0:n(FD.LOGIN)}:w,E=null==s?void 0:s.cdnBase;return mZ((function(){return a.current=setInterval((function(){i((function(e){return e-1}))}),1e3),function(){return clearInterval(a.current)}}),[]),mZ((function(){o<=0&&(clearInterval(a.current),b&&(null==C||C()))}),[o,b,C]),y().createElement("div",{className:"g2-view-container g2-submit-success g2-view-container-submit-success"},y().createElement("div",{className:"g2-view-tabs g2-questions-send-success-pageWrap"},y().createElement(Xj,{className:"plate-submit-success",src:"".concat(E,"/questions-send-ok.png"),alt:"",width:157,height:120}),y().createElement("div",{className:"success-page-title "},u),y().createElement("div",{className:"success-page-message"},f),b&&y().createElement(y().Fragment,null,y().createElement(Dj,{className:"success-page-btn",onClick:function(){null==C||C()},text:h}),y().createElement("div",{className:"success-page-timer-tip"},o," ",v))))},bZ=function(){return bZ=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},bZ.apply(this,arguments)},wZ=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},CZ=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},EZ=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},kZ=y().useRef,SZ=(y().useState,y().useCallback,y().useEffect,function(){var e,t,n,r=_u().t,o=hD(),i=fD(),a=uD(),s=pD().changeModule,c=iD(),l=UX(),u=(l.get,l.post),d=EZ(cT.useForm(),1)[0],f=kZ(null),p=null==c?void 0:c.verifyCodeLength;return y().createElement("div",{className:"g2-view-container g2-view-invitation-apply"},y().createElement("div",{className:"g2-view-container-inner"},y().createElement("div",{className:"g2-view-header"},y().createElement("img",{src:null===(e=null==a?void 0:a.userPool)||void 0===e?void 0:e.logo,alt:"",className:"icon"}),y().createElement("div",{className:"g2-view-header-container"},y().createElement("div",{className:"invitation-welcome"},null===(t=null==a?void 0:a.inviter)||void 0===t?void 0:t.displayName," ",r("common.welcomeJoin")),y().createElement("div",{className:"title"},null===(n=null==a?void 0:a.userPool)||void 0===n?void 0:n.name))),y().createElement("div",{className:"g2-view-content"},y().createElement(cT,{layout:"vertical",name:"et-pre-check-email",onFinish:function(){return wZ(void 0,void 0,void 0,(function(){var e,t,n,i,c,l;return CZ(this,(function(p){switch(p.label){case 0:return p.trys.push([0,2,3,4]),null===(c=f.current)||void 0===c||c.onSpin(!0),[4/*yield*/,u("/api/v3/signup-by-invitation",bZ(bZ({},d.getFieldsValue()),{identifier:null==a?void 0:a.identifier,profile:bZ({},d.getFieldsValue())}))];case 1:return e=p.sent(),t=e.statusCode,n=e.message,i=e.data,200!==t?gC.error(n):null==s||s(FD.MESSAGE,{message:"PENDING"===i.status?r("common.pendingMsg",[o.title]):r("common.doneMsg")}),[3/*break*/,4];case 2:return p.sent(),[3/*break*/,4];case 3:return null===(l=f.current)||void 0===l||l.onSpin(!1),[7/*endfinally*/];case 4:return[2/*return*/]}}))}))},onFinishFailed:function(){return f.current.onError()},autoComplete:"off",form:d,className:"genauth-g2-form-required-item-icon-after"},y().createElement(cT.Item,{name:"name",label:r("common.name"),rules:[{required:!0}],className:"genauth-g2-input-form"},y().createElement(oN,{type:"text",size:"large",className:"genauth-g2-input",autoComplete:"off"})),y().createElement(hU.Email,{className:"genauth-g2-input-form",name:"email",checkRepeat:!0,label:su.t("common.email"),key:"internal email:email13",validateFirst:!0,required:!0},y().createElement(oN,{className:"genauth-g2-input",autoComplete:"email",size:"large",placeholder:r("login.inputEmail")})),y().createElement(cT.Item,{validateTrigger:["onBlur","onChange"],className:"genauth-g2-input-form",name:"emailCode",key:"internal email:code1432",rules:QX(r("common.captchaCode"))},y().createElement(Gq,{className:"genauth-g2-input g2-send-code-input",autoComplete:"one-time-code",size:"large",placeholder:r("common.inputFourVerifyCode",{length:p}),maxLength:p,data:"",scene:Nc.VERIFY_CODE,fieldName:"email",form:d,onSendCodeBefore:function(){return wZ(void 0,void 0,void 0,(function(){return CZ(this,(function(e){switch(e.label){case 0:return(null==c?void 0:c.closeCheckSendUser)?[3/*break*/,2]:[4/*yield*/,d.validateFields(["email"])];case 1:return e.sent(),[3/*break*/,3];case 2:Promise.resolve(!0),e.label=3;case 3:return[2/*return*/]}}))}))}})),y().createElement(cT.Item,{className:"genauth-g2-sumbit-form"},y().createElement(Dj,{text:r("common.applyJoin"),className:"password",ref:f})))),y().createElement(SD,{langRange:null==o?void 0:o.langRange,onLangChange:null==i?void 0:i.onLangChange})))}),xZ=y().useMemo,_Z=function(e){var t=uD(),n=iD();FB();var r=xZ((function(){var n,r,o=null!==(n=null==e?void 0:e.message)&&void 0!==n?n:null==t?void 0:t.message;return null!==(r="".concat(o))&&void 0!==r?r:"".concat(su.t("user.contactAdministrator"))}),[null==t?void 0:t.message,null==e?void 0:e.message]);return y().createElement("div",{className:"g2-view-container g2-view-message"},y().createElement("div",{className:"g2-message-content"},y().createElement("div",{style:{display:"flex",justifyContent:"center"}},y().createElement("div",{style:{width:135,height:103,backgroundImage:"url(".concat(n.cdnBase,"/authing_message.svg?v=1)"),backgroundSize:"contain"}})),y().createElement("span",{className:"g2-message-text",dangerouslySetInnerHTML:{__html:r}})))},PZ=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},TZ=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},NZ=y().useCallback,OZ=function(e,t){var n=ZD(),r=fD(),o=aD().post,i=BX().authFlow,a=pD().changeModule,s=NZ((function(e){return PZ(void 0,void 0,void 0,(function(){var i,s,c,l,u,d,f,p,h,m,v,g;return TZ(this,(function(y){switch(y.label){case 0:if(!(i=null==r?void 0:r.onBeforeRegister))return[3/*break*/,4];y.label=1;case 1:return y.trys.push([1,3,,4]),[4/*yield*/,i({type:e.verifyType,data:e},n)];case 2:return y.sent()?[3/*break*/,4]:(null===(h=null==t?void 0:t.current)||void 0===h||h.onSpin(!1),[2/*return*/]);case 3:return"string"==typeof(s=y.sent())?gC.error(s):gC.error(null==s?void 0:s.message),null===(m=null==t?void 0:t.current)||void 0===m||m.onSpin(!1),[2/*return*/];case 4:return[4/*yield*/,o("/api/v3/join-by-invitation",e)];case 5:return c=y.sent(),l=c.statusCode,u=c.code,c.apiCode,d=c.data,f=c.onGuardHandling,p=c.message,200===l?(null===(v=null==r?void 0:r.onRegister)||void 0===v||v.call(r,d,n),null==a||a(FD.INVITE_SUCCESS)):(null==f||f(),null===(g=null==r?void 0:r.onRegisterError)||void 0===g||g.call(r,{code:u,data:d,message:p})),[2/*return*/]}}))}))}),[n,i,a,r,o,t]);return s},IZ=function(){return IZ=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},IZ.apply(this,arguments)},AZ=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},RZ=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},MZ=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},LZ=y().useCallback,DZ=y().useEffect,FZ=y().useMemo,jZ=y().useRef,BZ=y().useState,UZ=function(){var e=uD(),t=fD(),n=hD(),r=_u().t,o=jZ(null);FB();var i=pD().changeModule,a=aD().post,s=iD(),c=null==s?void 0:s.verifyCodeLength,l=MZ(cT.useForm(),1)[0],u=jZ(null),d=MZ(BZ(!0),2),f=d[0],p=d[1],h=MZ(BZ("prioritySMS"===e.sendVerifyCodeMethod&&e.phone?"smsCode":"emailCode"),2),m=h[0],v=h[1],g=jZ(null),b=FZ((function(){return"emailCode"===m?e.email:"smsCode"===m?e.phone:void 0}),[e.email,e.phone,m]),w=FZ((function(){var t={prioritySMS:{emailCode:{desc:r("common.sendSms"),show:e.phone,receiverType:"smsCode"},smsCode:{desc:r("common.sendEmail"),show:e.email,receiverType:"emailCode"}},priorityEmail:{emailCode:{desc:r("common.sendSms"),show:e.phone,receiverType:"smsCode"},smsCode:{desc:r("common.sendEmail"),show:e.email,receiverType:"emailCode"}}},n=e.sendVerifyCodeMethod;return["prioritySMS","priorityEmail"].some((function(e){return n===e}))?IZ({},t[n][m]):t[n]}),[e,r,m]),C=LZ((function(e){return AZ(void 0,void 0,void 0,(function(){return RZ(this,(function(t){switch(t.label){case 0:return[4/*yield*/,a("emailCode"===e.receiverType?"/api/v2/email/send":"/api/v2/sms/send",IZ(IZ({},e),{scene:"emailCode"===e.receiverType?Nc.REGISTER_VERIFY_CODE:Oi.SCENE_TYPE_REGISTER}))];case 1:return[2/*return*/,t.sent()]}}))}))}),[a]),E=OZ(0,u);DZ((function(){var e;o.current&&(null===(e=o.current)||void 0===e||e.click())}),[]);var k=function(t){return AZ(void 0,void 0,void 0,(function(){var n,r,o;return RZ(this,(function(i){switch(i.label){case 0:return n="default"===t?m:w.receiverType,[4/*yield*/,C({phone:e.phone,phoneCountryCode:e.phoneCountryCode,email:e.email,receiverType:n})];case 1:return 200===(r=i.sent()).code?(v(n),[2/*return*/,!0]):(null===(o=r.onGuardHandling)||void 0===o||o.call(r),[2/*return*/,!1])}}))}))};return y().createElement("div",{className:"g2-view-container g2-view-invite"},y().createElement("div",{className:"g2-invite-content"},y().createElement("div",{className:"g2-view-invite-header"},y().createElement("div",{className:"title"},r("common.inputCaptcha")),y().createElement("div",{className:"tips"},r("common.verifyAccount",[b&&("emailCode"===m?f0(b):p0(b))])),y().createElement("div",{className:"tips errorTips"},r("common.captchaMaxErrorCount",[e.verifyCodeMaxErrCount]))),y().createElement(cT,{form:l,onFinish:function(t){return AZ(void 0,void 0,void 0,(function(){var n,r,o,s,c,l,u,d,f,p,h,v;return RZ(this,(function(g){switch(g.label){case 0:return n=t.code,[4/*yield*/,a("/api/v3/verify-invite-code",{code:n,receiverType:m,token:e.token})];case 1:return r=g.sent(),o=r.statusCode,s=r.onGuardHandling,200!==o?[3/*break*/,5]:(c=e.extendsFields,l=void 0===c?[]:c,u=e.extendsFieldsOptions,d=void 0===u?[]:u,f=e.enabledInfoFill,p={code:n,token:e.token,receiverType:m},h=null==l?void 0:l.filter((function(t){return"email"===t.name&&"internal"===t.type?!e.email:"phone"===t.name&&"internal"===t.type?!e.phone:"username"===t.name&&"internal"===t.type?!e.username:"name"!==t.name||"internal"!==t.type||!e.name})),v=iV(h,d),f&&v.length>0?(null==i||i(FD.INVITE_COMPLETE,IZ(IZ({},e),{
|
|
28487
28487
|
// ...data,
|
|
28488
28488
|
verifyAccount:b,metaData:v,originModule:FD.INVITE_AUTH,originContext:e,context:p})),[3/*break*/,4]):[3/*break*/,2]);case 2:return[4/*yield*/,E(p)];case 3:g.sent(),g.label=4;case 4:return[3/*break*/,6];case 5:null==s||s(),g.label=6;case 6:return[2/*return*/]}}))}))},onFinishFailed:function(){var e;return null===(e=u.current)||void 0===e?void 0:e.onError()}},y().createElement(rB,{codeLength:c,name:"code"},y().createElement(SB,{length:c,showDivider:!0,gutter:"10px",onFinish:function(){p(!1)}})),y().createElement("div",{className:"resend_container"},y().createElement(HU,{btnRef:o,beforeSend:function(){return AZ(void 0,void 0,void 0,(function(){return RZ(this,(function(e){switch(e.label){case 0:return[4/*yield*/,k("default")];case 1:return[2/*return*/,e.sent()]}}))}))},type:"link"})),y().createElement(Dj,{text:r("login.nextStep"),ref:u,disabled:f})),(null==w?void 0:w.show)&&y().createElement("div",{className:"resend_container"},y().createElement(HU,{btnRef:g,sendDesc:w.desc,beforeSend:function(){return AZ(void 0,void 0,void 0,(function(){return RZ(this,(function(e){switch(e.label){case 0:return[4/*yield*/,k("reSend")];case 1:return[2/*return*/,e.sent()]}}))}))},type:"link",className:"resend_code"})),y().createElement(SD,{langRange:null==n?void 0:n.langRange,onLangChange:null==t?void 0:t.onLangChange})))},qZ=function(){return qZ=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},qZ.apply(this,arguments)},VZ=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},zZ=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},$Z=function(){var e=uD(),t=hD(),n=fD(),r=_u().t,o=e.metaData,i=e.extendsFieldsI18n,a=e.extendsFields,s=e.canBack,c=void 0===s||s,l=e.registerInfoFillMsg,u=pD().changeModule,d=OZ();return y().createElement("div",{className:"g2-view-container g2-complete-info g2-invitation-complete"},y().createElement("div",{className:"g2-view-header"},c&&(null==e?void 0:e.originModule)&&y().createElement(MB,{onBack:function(){(null==e?void 0:e.originModule)&&(null==u||u(e.originModule,e.originContext))}},r("common.back")),y().createElement("div",{className:"content"},y().createElement("div",{className:"title"},r("common.invitation.completeInfo")),y().createElement("div",{className:"title-explain"},l||r("common.invitation.completeInfoDesc")))),y().createElement("div",{className:"g2-view-tabs g2-completeInfo-content"},y().createElement(wV,{extendsFieldsI18n:i,metaData:o,businessRequest:function(t){return VZ(void 0,void 0,void 0,(function(){var n,r,o,i,s,c,l,u;return zZ(this,(function(f){switch(f.label){case 0:return n=t.fieldValues,r=aV(a,n),o=r.registerProfile,i=r.udf,s=null,c=null,Reflect.has(o,"phoneToken")&&(s=o.phoneToken,Reflect.deleteProperty(o,"phoneToken")),Reflect.has(o,"emailToken")&&(c=o.emailToken,Reflect.deleteProperty(o,"emailToken")),l={profile:qZ(qZ({},o),{customData:i}),options:{phonePassCodeForInformationCompletion:s,emailPassCodeForInformationCompletion:c}},u=qZ(qZ({},e.context),l),[4/*yield*/,null==d?void 0:d(u)];case 1:return f.sent(),[2/*return*/]}}))}))}})),y().createElement(SD,{langRange:null==t?void 0:t.langRange,onLangChange:null==n?void 0:n.onLangChange}))},HZ=function(e){var t=_u().t;return y().createElement($V,{error:{name:"invite_expire",message:e.key===FD.INVITE_EXPIRE?t("common.inviteExpired"):t("common.pageExpired")}})},WZ=function(){var e=_u().t;return y().createElement(_Z,{message:e("common.inviteSuccess")})},GZ=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},KZ=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},YZ=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},JZ=y().useRef,QZ=y().useMemo,ZZ=function(){var e,t=_u().t,n=uD(),r=iD(),o=ZD(),i=YZ(y().useState([]),2),a=i[0],s=i[1],c=hD(),l=pD().changeModule;FB();var u=null!==(e=su.resolvedLanguage)&&void 0!==e?e:su.language,d=(null==r?void 0:r.resetPwdLinkCustomLogo)||(null==c?void 0:c.logo),f=(n.account,n.userId),p=n.goBack,h=n.token,m=wU(),v=m.getPassWordUnsafeText,g=m.setPasswordErrorTextShow,b=YZ(cT.useForm(),1)[0],w=BX().post,C=JZ(null),E=QZ((function(){var e,n,o,i,a,s=null===(e=null==r?void 0:r.resetPwdLinkTipsConfig)||void 0===e?void 0:e.title;return null!==(a=(null===(n=null==s?void 0:s.i18n)||void 0===n?void 0:n[u].enabled)?null===(i=null===(o=null==s?void 0:s.i18n)||void 0===o?void 0:o[u])||void 0===i?void 0:i.value:null==s?void 0:s.default)&&void 0!==a?a:t("login.resetPwd")}),[r,u]),k=QZ((function(){var e,n,o,i,a,s=null===(e=null==r?void 0:r.resetPwdLinkTipsConfig)||void 0===e?void 0:e.desc;return null!==(a=(null===(n=null==s?void 0:s.i18n)||void 0===n?void 0:n[u].enabled)?null===(i=null===(o=null==s?void 0:s.i18n)||void 0===o?void 0:o[u])||void 0===i?void 0:i.value:null==s?void 0:s.default)&&void 0!==a?a:t("login.resetPassword.resetPasswordText1",{text:t("common.phoneOrEmail")})}),[r,u,t]);return y().createElement("div",{className:"g2-view-container g2-forget-password g2-password-reset-pageWrap g2-password-reset-step2"},y().createElement("div",{className:"g2-view-header"},y().createElement(Xj,{src:d,size:48,borderRadius:4,alt:"",className:"icon"}),y().createElement("div",{className:"title"},E),y().createElement("div",{className:"title-explain"},k)),y().createElement("div",{className:"g2-view-tabs"},y().createElement(cT,{name:"resetPassword",form:b,onFinish:function(){return GZ(void 0,void 0,void 0,(function(){var e,t,n,i,a;return KZ(this,(function(s){switch(s.label){case 0:return null===(n=C.current)||void 0===n||n.onSpin(!0),e=b.getFieldsValue(),[4/*yield*/,null===(a=null===(i=o.options)||void 0===i?void 0:i.encryptFunction)||void 0===a?void 0:a.call(i,e.password,r.publicKey)];case 1:return t=s.sent(),w("/api/v2/users/password/forget/link-reset-password",{token:h,newPassword:t}).then((function(e){var t;null===(t=C.current)||void 0===t||t.onSpin(!1);var n=e.code;n===pX.UNSAFE_PASSWORD_TIP&&g(!0),200===n?
|
|
28489
28489
|
// events?.onPwdReset?.(authClient)
|
|
@@ -28492,13 +28492,13 @@ null==l||l(FD.LOGIN):
|
|
|
28492
28492
|
gC.error(null==e?void 0:e.message)})).catch((function(e){C.current.onError(),
|
|
28493
28493
|
// props.onSendError(codeMethod, e)
|
|
28494
28494
|
// events?.onPwdResetError?.(e, authClient)
|
|
28495
|
-
gC.error(e.message)})),[2/*return*/]}}))}))},onFinishFailed:function(){var e;null===(e=null==C?void 0:C.current)||void 0===e||e.onError()},autoComplete:"off"},y().createElement(cT.Item,{className:"
|
|
28495
|
+
gC.error(e.message)})),[2/*return*/]}}))}))},onFinishFailed:function(){var e;null===(e=null==C?void 0:C.current)||void 0===e||e.onError()},autoComplete:"off"},y().createElement(cT.Item,{className:"genauth-g2-input-form",name:"password",validateTrigger:["onBlur"],rules:[{validateTrigger:"onBlur",validator:function(e,n){return GZ(this,void 0,void 0,(function(){var e,r,o,i;return KZ(this,(function(a){switch(a.label){case 0:return n&&0!==(null==n?void 0:n.length)?[3/*break*/,1]:(s([]),[2/*return*/,Promise.reject(t("login.inputPwd"))]);case 1:return[4/*yield*/,w("/api/v2/password/user-action/check",{password:n,userId:f})];case 2:return 200===(null==(e=a.sent())?void 0:e.code)?(null===(r=null==e?void 0:e.data)||void 0===r?void 0:r.valid)?(s([]),[2/*return*/,Promise.resolve(!0)]):(s((null===(o=null==e?void 0:e.data)||void 0===o?void 0:o.ruleResults)||[]),[2/*return*/,Promise.reject(null===(i=null==e?void 0:e.data)||void 0===i?void 0:i.message)]):[2/*return*/,Promise.reject(null==e?void 0:e.message)];case 3:return[2/*return*/]}}))}))}}],help:a.length>0?y().createElement(GB,{ruleResults:a}):void 0},y().createElement(wz,{className:"genauth-g2-input",size:"large",placeholder:t("login.resetPassword.inputNewPwd"),prefix:y().createElement(JL,{type:"authing-a-lock-line1",style:{color:"#6B7280",marginBottom:2}})})),y().createElement(cT.Item,{className:"genauth-g2-input-form",name:"repeatPassword",validateFirst:!0,rules:[{required:!0,message:t("login.resetPassword.pleaseInputPassword")},function(e){var n=e.getFieldValue;return{validator:function(e,r){var o=n("password");return void 0===o&&void 0===r||o===r?Promise.resolve():Promise.reject(t("login.resetPassword.checkPasswordDiff"))}}}]},y().createElement(wz,{className:"genauth-g2-input",size:"large",placeholder:t("login.resetPassword.confirmNewPwd"),prefix:y().createElement(JL,{type:"authing-a-lock-line1",style:{color:"#6B7280",marginBottom:2}})})),v(),y().createElement(cT.Item,{className:"genauth-g2-sumbit-form submit-form"},y().createElement(Dj,{className:"reset-password-button",text:t("login.resetPassword.reset"),ref:C})))),p&&y().createElement("div",{className:"g2-tips-line"},y().createElement("div",{className:"link-like back-to-login",onClick:p},t("login.resetPassword.back"))))},XZ=function(){return XZ=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},XZ.apply(this,arguments)},eX=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},tX=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},nX=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},rX=y().useRef,oX=y().useState,iX=y().useCallback,aX=function(){var e=_u().t,t=uD(),n=t.businessRequestName,r=t.content,o=t.isChangeComplete,i=t.onRegisterSuccess,a=t.onRegisterFailed,s=pD().changeModule,c=hD(),l=nX(cT.useForm(),1)[0],u=rX(null),d=rX(null),f=nX(oX(0),2),p=f[0],h=f[1],m=iX((function(e,t){return eX(void 0,void 0,void 0,(function(){var r,c,l,u,d;return tX(this,(function(f){switch(f.label){case 0:return o?(null==s||s(FD.REGISTER_COMPLETE_INFO,{businessRequestName:n,content:e,onRegisterSuccess:i,onRegisterFailed:a}),[3/*break*/,3]):[3/*break*/,1];case 1:return[4/*yield*/,PV(n,e)];case 2:r=f.sent(),c=r.data,l=r.statusCode,u=r.apiCode,d=r.message,200===l?(null==t||t.onSpin(!1),i(c)):(null==t||t.onError(),gC.error(d),a(u,c,d)),f.label=3;case 3:return[2/*return*/]}}))}))}),[]);return y().createElement("div",{className:"g2-view-container g2-register-account-type"},y().createElement("div",{className:"g2-view-header"},1===p&&y().createElement(Nj,{type:"link",onClick:function(){return h(0)},className:"back-btn"},y().createElement(JL,{type:"authing-arrow-left-s-line",style:{fontSize:24}}),y().createElement("span",null,e("common.back"))),y().createElement(Xj,{src:null==c?void 0:c.logo,size:48,borderRadius:4,alt:"",className:"icon"}),y().createElement("div",{className:"title"},null==c?void 0:c.title)),y().createElement("div",{className:"g2-view-tabs"},0===p&&y().createElement(cT,{className:"genauth-g2-completeInfo-form genauth-g2-form-required-item-icon-after",layout:"vertical",form:l,onSubmitCapture:function(){},onFinishFailed:function(){u.current.onError()},onFinish:function(e){return eX(void 0,void 0,void 0,(function(){return tX(this,(function(t){switch(t.label){case 0:return"enterprise"!==e.accountType?[3/*break*/,1]:(
|
|
28496
28496
|
// 企业账号
|
|
28497
28497
|
h(1),[3/*break*/,3]);case 1:
|
|
28498
28498
|
// 私人账号 直接走后续流程
|
|
28499
28499
|
return[4/*yield*/,m(XZ(XZ({},r),{accountType:"personal"}),u.current)];case 2:
|
|
28500
28500
|
// 私人账号 直接走后续流程
|
|
28501
|
-
t.sent(),t.label=3;case 3:return[2/*return*/]}}))}))}},y().createElement(cT.Item,{className:"
|
|
28501
|
+
t.sent(),t.label=3;case 3:return[2/*return*/]}}))}))}},y().createElement(cT.Item,{className:"genauth-g2-input-form",name:"accountType",label:e("common.registerAccountType.title"),initialValue:"personal"},y().createElement(lI,{className:iB()("genauth-g2-select","genauth-g2-input"),popupClassName:"genauth-g2-dropdown",options:[{label:e("common.registerAccountType.personal"),value:"personal"},{label:e("common.registerAccountType.enterprise"),value:"enterprise"}],placeholder:e("common.pleaseSelect")})),y().createElement(Dj,{text:e("user.nextStep"),ref:u})),1===p&&y().createElement(cT,{className:"genauth-g2-completeInfo-form genauth-g2-form-required-item-icon-after",layout:"vertical",form:l,onSubmitCapture:function(){},onFinishFailed:function(){d.current.onError()},onFinish:function(e){return eX(void 0,void 0,void 0,(function(){return tX(this,(function(t){switch(t.label){case 0:return[4/*yield*/,m(XZ(XZ({},r),{accountType:"enterprise",tenantEnterpriseCertification:e}),d.current)];case 1:return t.sent(),[2/*return*/]}}))}))}},y().createElement(cT.Item,{className:"genauth-g2-input-form",name:"businessName",label:e("common.registerAccountType.enterpriseName"),rules:[{required:!0,validateTrigger:"onBlur",message:e("login.noEmpty",{label:e("common.registerAccountType.enterpriseName")})}]},y().createElement(oN,{type:"text",size:"large",className:"genauth-g2-input",autoComplete:"off"})),y().createElement(cT.Item,{className:"genauth-g2-input-form",name:"businessRegistrationName",label:e("common.registerAccountType.businessRegistrationName"),rules:[{required:!0,validateTrigger:"onBlur",message:e("login.noEmpty",{label:e("common.registerAccountType.businessRegistrationName")})}]},y().createElement(oN,{type:"text",size:"large",className:"genauth-g2-input",autoComplete:"off"})),y().createElement(cT.Item,{className:"genauth-g2-input-form",name:"unifiedSocialCredit",label:e("common.registerAccountType.unifiedSocialCredit"),rules:[{required:!0,validateTrigger:"onBlur",message:e("login.noEmpty",{label:e("common.registerAccountType.unifiedSocialCredit")})}]},y().createElement(oN,{type:"text",size:"large",className:"genauth-g2-input",autoComplete:"off"})),y().createElement(cT.Item,{className:"genauth-g2-input-form",name:"legalRepresentativeName",label:e("common.registerAccountType.legalRepresentativeName"),rules:[{required:!0,validateTrigger:"onBlur",message:e("login.noEmpty",{label:e("common.registerAccountType.legalRepresentativeName")})}]},y().createElement(oN,{type:"text",size:"large",className:"genauth-g2-input",autoComplete:"off"})),y().createElement(cT.Item,{className:"genauth-g2-input-form",name:"nationalIdentificationNumber",label:e("common.registerAccountType.nationalIdentificationNumber"),rules:[{required:!0,validateTrigger:"onBlur",message:e("login.noEmpty",{label:e("common.registerAccountType.nationalIdentificationNumber")})}]},y().createElement(oN,{type:"text",size:"large",className:"genauth-g2-input",autoComplete:"off"})),y().createElement(Dj,{text:e("user.nextStep"),ref:d}))))},sX=function(){return sX=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},sX.apply(this,arguments)},cX=y().useEffect,lX=y().useMemo,uX="genauth-ant";gC.config({prefixCls:"".concat(uX,"-message")}),function(e){e.zhCn="zh-CN",e.enUs="en-US",e.jaJp="ja-JP",e.zhTw="zh-TW"}(qQ||(qQ={}));var dX,fX,pX,hX=((UQ={})[qQ.zhCn]=KL.zhCN,UQ[qQ.enUs]=KL.enUS,UQ[qQ.jaJp]=KL.jaJP,UQ[qQ.zhTw]=KL.zhTW,UQ),mX=function(e){var t,n,r,o,i,a=e.guardProps,s=XL(nD).defaultMergedConfig,c=XL(nD).contextLoaded,l=dD().moduleName,u=aD(),d=pD().changeModule,f=(i=rD.Provider,{GuardButtonProvider:function(e){var t=e.children,n=ZL(y().useState(!1),2),r=n[0],o=n[1];return y().createElement(i,{value:{spin:r,spinChange:function(e){o(e)}}},t)}}).GuardButtonProvider,p=lX((function(){return s.loadingComponent}),[s]),h=(
|
|
28502
28502
|
// Error
|
|
28503
28503
|
(t={})[FD.ERROR]=function(e){return y().createElement($V,{key:e})},
|
|
28504
28504
|
// Login
|
|
@@ -28548,7 +28548,7 @@ t.flowHandle&&ND(t.flowHandle);var r=((n={})[fX.CHANGE_MODULE]=function(){var e=
|
|
|
28548
28548
|
// 错误码处理回调 切换 module 和 错误信息提示
|
|
28549
28549
|
}),[u,d]);var m=lX((function(){return c?
|
|
28550
28550
|
// 传入的渲染指令不正确的情况处理
|
|
28551
|
-
l&&h[l]?h[l]((new Date).toString()):y().createElement($V,{error:new Error("未知错误!moduleName 为 <b>".concat(l,"</b> 无法识别"))}):p||null}),[h,c,p,l]),v=lX((function(){return a.visible}),[a.visible]),g=lX((function(){return y().createElement(f,null,m)}),[f,m]);return y().createElement(aE,{prefixCls:uX,locale:hX[null!==(n=su.resolvedLanguage)&&void 0!==n?n:su.language]},s.mode===Ks.Modal?y().createElement(dA,{className:"
|
|
28551
|
+
l&&h[l]?h[l]((new Date).toString()):y().createElement($V,{error:new Error("未知错误!moduleName 为 <b>".concat(l,"</b> 无法识别"))}):p||null}),[h,c,p,l]),v=lX((function(){return a.visible}),[a.visible]),g=lX((function(){return y().createElement(f,null,m)}),[f,m]);return y().createElement(aE,{prefixCls:uX,locale:hX[null!==(n=su.resolvedLanguage)&&void 0!==n?n:su.language]},s.mode===Ks.Modal?y().createElement(dA,{className:"genauth-g2-render-module-modal",closeIcon:y().createElement(JL,{type:"authing-close-line",className:"g2-modal-close"}),closable:null===(r=s.clickCloseable)||void 0===r||r,open:v,onCancel:null==a?void 0:a.onClose,keyboard:s.escCloseable,maskClosable:!1,getContainer:null!==(o=s.target)&&void 0!==o&&o},y().createElement("div",{className:"genauth-g2-render-module"},g)):y().createElement("div",{style:s.style,className:"genauth-g2-render-module ".concat(s.__internalRequest__?"":"genauth-g2-render-module-normal")},g))},vX=function(e){if(!e)return!0;var t=function(e){return PK=e}(e);return fd()(t,e)},gX=function(e){var t,n=e.guardProps,r=e.initState;return t=n.facePlugin,vX(t),y().createElement(uj,{guardProps:n,initState:r},y().createElement(mX,{guardProps:n}))},yX=function(){return yX=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},yX.apply(this,arguments)},bX=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},wX=y().memo,CX=y().useEffect,EX=y().useRef,kX=y().useState,SX=wX((function(e){var t,n,r=e.config,o=EX(null),i=bX(kX(!1),2),a=i[0],s=i[1];
|
|
28552
28552
|
// 锁定 Guard 中 window 指向
|
|
28553
28553
|
CX((function(){if(null==o?void 0:o.current){var e=m0(o.current);ad(e),s(!0)}}),[]);
|
|
28554
28554
|
// 首页 init 数据
|