@authing/guard-shim-react 4.5.17-alpha.3 → 4.5.17

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.js CHANGED
@@ -17582,8 +17582,8 @@ var $D=i(4232),HD=i(4631),WD=i(1062),GD=i(8787),KD={zhCN:$D/* default */.Z,enUS:
17582
17582
  * 多账号 状态
17583
17583
  */
17584
17584
  multipleInstance:{isMultipleAccount:!1,instance:void 0,referMultipleState:void 0,multipleAccountData:void 0,clearBackFillData:void 0},phoneRegex:null,defaultLanguageConfig:"zh-CN",tenantInstance:void 0},nL=y().createContext(tL),rL=y().createContext({spin:!1,spinChange:function(){}}),oL=function(){return XD(rL)},iL=function(){return XD(nL).publicConfig},aL=function(){return XD(nL).httpClient},sL=function(){return XD(nL).appId},cL=function(){return XD(nL).tenantId};function lL(){return XD(nL).initData}var uL=function(){return XD(nL).currentModule},dL=function(){return XD(nL).events},fL=function(){var e=XD(nL);return{changeModule:e.changeModule,backModule:e.backModule,currentModule:e.currentModule}},pL=function(){return XD(nL).finallyConfig},hL=function(){return XD(nL).isAuthFlow},mL=function(){return XD(nL).multipleInstance},vL=function(){return XD(nL).phoneRegex},gL=function(){return XD(nL).defaultLanguageConfig},yL=function(){var e=iL(),t=e.customSecurityEnabled,n=e.appRobotVerify,r=e.userpoolRobotVerify;return t?n:r},bL=function(e){var t,n,r=iL(),o=r.loginSmsConfig,i=r.registerSmsConfig,a=!1;switch(e){case"login":a="ON"===(null===(t=null==o?void 0:o.robot)||void 0===t?void 0:t.switch);break;case"register":a="ON"===(null===(n=null==i?void 0:i.robot)||void 0===n?void 0:n.switch)}return a},wL=y().useMemo,CL={"zh-CN":{label:"简体中文"},"zh-TW":{label:"繁體中文"},"en-US":{label:"English"},"ja-JP":{label:"日本語"}},EL=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=XD(nL).guardPageConfig,a=pL(),s=wL((function(){return"g2-change-language-text ".concat(a.mode)}),[a]),c=wL((function(){var e;return null===(e=i.global)||void 0===e?void 0:e.showChangeLanguage}),[i]),l=wL((function(){return Object.keys(CL).includes(o.resolvedLanguage)?o.resolvedLanguage:dd(o.resolvedLanguage)[0]||"en-US"}),[o.resolvedLanguage]),u=wL((function(){return y().createElement(y().Fragment,null,y().createElement("span",null,CL[l].label))}),[l]),d=wL((function(){return Object.keys(CL).filter((function(e){return n.includes(e)})).map((function(e){return{key:e,label:CL[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(C_,{menu:f,trigger:["click"],placement:"bottom",overlayClassName:"authing-g2-change-language-menu"},y().createElement("span",{className:s},u,y().createElement(JD,{type:"authing-arrow-down-s-fill",className:"down-fill-svg"}))))};// CONCATENATED MODULE: ./package.json
17585
- const kL=JSON.parse('{"i8":"4.5.17-alpha.3"}');// CONCATENATED MODULE: ./src/_utils/getVersion.ts
17586
- function SL(){return kL.i8}// CONCATENATED MODULE: ./src/_utils/flowHandleStorage.ts
17585
+ const kL="4.5.17";// CONCATENATED MODULE: ./src/_utils/getVersion.ts
17586
+ function SL(){return kL}// CONCATENATED MODULE: ./src/_utils/flowHandleStorage.ts
17587
17587
  var xL,PL=function(){return xL},_L=function(e){xL=e},TL=function(){return TL=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},TL.apply(this,arguments)},OL=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())}))},NL=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(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},IL=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},AL=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))},RL=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return OL(void 0,void 0,void 0,(function(){return NL(this,(function(t){switch(t.label){case 0:return[4/*yield*/,fetch.apply(void 0,AL([],IL(e),!1))];case 1:return[2/*return*/,t.sent().json()]}}))}))},ML=function(e){return new Promise((function(t){setTimeout((function(){t({data:{code:-1}}),e()}),1e4)}))};RL.get=function(e,t,n){return void 0===t&&(t={}),OL(void 0,void 0,void 0,(function(){var r,o,i,a,s;return NL(this,(function(c){switch(c.label){case 0:r=TL(TL({},null==n?void 0:n.headers),((s={"Content-Type":"application/json"})[RL.langHeader]=DQ(),s)),""!==RL.tenantId&&(r[RL.tenantHeader]=RL.tenantId),c.label=1;case 1:return c.trys.push([1,3,,4]),o=ma().CancelToken,i=o.source(),[4/*yield*/,Promise.race([ML(i.cancel),ma()("".concat(RL.baseUrl).concat(e).concat(jc().stringify(t,{addQueryPrefix:!0})),TL(TL({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*/]}}))}))},RL.post=function(e,t,n){return OL(void 0,void 0,void 0,(function(){var r,o,i,a,s,c;return NL(this,(function(l){switch(l.label){case 0:r=TL(TL({},null==n?void 0:n.headers),((s={"Content-Type":"application/json"})[RL.langHeader]=cu.resolvedLanguage,s)),""!==RL.tenantId&&(r[RL.tenantHeader]=RL.tenantId),l.label=1;case 1:return l.trys.push([1,3,,4]),o=ma().CancelToken,i=o.source(),[4/*yield*/,Promise.race([ML(i.cancel),ma()("".concat(RL.baseUrl).concat(e),{data:t,method:"POST",withCredentials:!0,cancelToken:i.token,headers:TL(TL({"Content-Type":"application/json"},null==n?void 0:n.headers),(c={},c[RL.langHeader]=DQ(),c))})])];case 2:return[2/*return*/,null==(a=l.sent())?void 0:a.data];case 3:return l.sent(),[2/*return*/,Promise.resolve({code:-2})];case 4:return[2/*return*/]}}))}))},RL.postForm=function(e,t,n){return OL(void 0,void 0,void 0,(function(){var r,o,i,a;return NL(this,(function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),r=ma().CancelToken,o=r.source(),[4/*yield*/,Promise.race([ML(o.cancel),ma()("".concat(RL.baseUrl).concat(e),{method:"POST",data:t,withCredentials:!0,cancelToken:o.token,headers:TL(TL({},null==n?void 0:n.headers),(a={},a[RL.langHeader]=DQ(),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*/]}}))}))},RL.baseUrl="",RL.setBaseUrl=function(e){RL.baseUrl=e.replace(/\/$/,"")};var DL,LL="x-authing-lang";RL.langHeader=LL,RL.tenantHeader="x-authing-app-tenant-idåå",RL.tenantId="",RL.setLangHeader=function(e){RL.langHeader=e||LL},RL.setTenantHeader=function(e){RL.tenantHeader=e||LL},RL.setTenantId=function(e){RL.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",
17588
17588
  /** 多租户门户选择页 */
17589
17589
  e.TENANT_PORTAL="tenant-portal",e.New_SUBMIT_SUCCESS="newSubmitSuccess",e.SELECT_ACCOUNT_2_LOGIN="selectAccout2Login",e.RESET_ACCOUNT_NAME="resetAccountName"}(DL||(DL={}));// CONCATENATED MODULE: ./src/AuthClientProvider/context.tsx
@@ -18134,7 +18134,7 @@ var lz=function(){return lz=Object.assign||function(e){for(var t,n=1,r=arguments
18134
18134
  /** 是否可以注册 */
18135
18135
  var l=pz((function(){
18136
18136
  /** 所有必须勾选的都勾了就可以通过 */
18137
- return i.filter((function(e){return e.required})).every((function(e){return s.includes(e.id)}))}),[s,i]);return hz((function(){r(l,s)}),[l,r,s]),y().createElement("div",{className:bQ(["authing-agreements",t&&"authing-agreements-error"])},i.map((function(e){return y().createElement("div",{key:e.id,style:lz({},o),className:bQ(["authing-agreements-item",e.required&&!s.includes(e.id)&&"authing-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})):dz(dz([],uz(t),!1),[e],!1)}))}(e.id)}},y().createElement(m_,{align:"start",size:5},y().createElement(tw,{className:"authing-agreements-checkbox",checked:s.includes(e.id)}),y().createElement("div",{className:"authing-agreements-item-content",dangerouslySetInnerHTML:{__html:e.title}})))})))},vz=y().useEffect,gz=y().useCallback,yz=y().useRef,bz=y().useLayoutEffect;
18137
+ return i.filter((function(e){return e.required})).every((function(e){return s.includes(e.id)}))}),[s,i]);return hz((function(){r(l)}),[l,r]),y().createElement("div",{className:bQ(["authing-agreements",t&&"authing-agreements-error"])},i.map((function(e){return y().createElement("div",{key:e.id,style:lz({},o),className:bQ(["authing-agreements-item",e.required&&!s.includes(e.id)&&"authing-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})):dz(dz([],uz(t),!1),[e],!1)}))}(e.id)}},y().createElement(m_,{align:"start",size:5},y().createElement(tw,{className:"authing-agreements-checkbox",checked:s.includes(e.id)}),y().createElement("div",{className:"authing-agreements-item-content",dangerouslySetInnerHTML:{__html:e.title}})))})))},vz=y().useEffect,gz=y().useCallback,yz=y().useRef,bz=y().useLayoutEffect;
18138
18138
  /**
18139
18139
  * 多账号登录下 账户 & 登录方式自动回填
18140
18140
  * TODO: HOOK 参数有时间整理成为对象,开始没有想到有这么多
@@ -18149,69 +18149,69 @@ vz((function(){var e,i=(null==o?void 0:o.way)===n;if(o&&i&&!s){var u=l(),d=u.acc
18149
18149
  * @param setLoginWay
18150
18150
  * @returns
18151
18151
  */ // CONCATENATED MODULE: ./src/_utils/getCaptchaUrl.ts
18152
- var Cz,Ez=function(e){var t=new URL(e);return t.pathname="/api/v2/security/captcha",t.search="?r=".concat(+new Date),t.href},kz=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())}))},Sz=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(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},xz=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},Pz=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().useCallback,Tz=y().useEffect,Oz=y().useMemo,Nz=y().useRef,Iz=y().useState,Az=function(e){var t,n=e.agreements,r=e.onLoginFailed,o=e.onLoginSuccess,i=e.saveIdentify,a=e.multipleInstance,s=e.backfillData,c=e.passwordLoginMethods,l=xz(cT.useForm(),1)[0],u=lL(),d=u._firstItemInitialValue,f=void 0===d?"":d,p=u.specifyDefaultLoginMethod;wz({form:l,way:zs.Password,formKey:"account",backfillData:s,cancelBackfill:zs.Password===p});var h=xz(Iz(!1),2),m=h[0],v=h[1],g=Nz([]),b=uj().isPhoneMedia,w=xz(Iz(!1),2),C=w[0],E=w[1],k=_u(),S=k.t,x=k.i18n,P=oQ().post,_=GL(),T=iL(),O=pL(),N=gL(),I=yL(),A=Nz(null),R=xz(Iz("always_enable"===I),2),M=R[0],D=R[1],L=xz(Iz(""),2),F=L[0],j=L[1],B=xz(Iz(0),2),q=B[0],U=B[1],V=xz(Iz(!1),2),z=V[0],$=V[1],H=_.options.encryptFunction,W=_z((function(t){return kz(void 0,void 0,void 0,(function(){var r,o,i,a,s,c;return Sz(this,(function(l){switch(l.label){case 0:return e.onLoginRequest?[4/*yield*/,e.onLoginRequest(t)]:[3/*break*/,2];case 1:return[2/*return*/,l.sent()];case 2:return r=t.data,o=(null==T?void 0:T.mergeAdAndAccountPasswordLogin)?"/api/v2/login/ad-all-in-one":"/api/v2/login/account",i=r.identity&&r.identity.trim(),a=r.password,s=r.captchaCode&&r.captchaCode.trim(),c={account:i},[4/*yield*/,H(a,e.publicKey)];case 3:return c.password=l.sent(),c.captchaCode=s,c.customData=(null==O?void 0:O.isHost)?CQ(["login_page_context"]):void 0,c.autoRegister=e.autoRegister,c.withCustomData=!1,c.agreementIds=n.length?g.current:void 0,[4/*yield*/,P(o,c)];case 4:return[2/*return*/,l.sent()]}}))}))}),[null==O?void 0:O.isHost,H,P,e,null==T?void 0:T.mergeAdAndAccountPasswordLogin,g,n]),G=function(t,n){var i,s,c,l,u=t.code,d=t.apiCode,f=t.message,p=t.data,h=t.onGuardHandling;if(null===(i=null==A?void 0:A.current)||void 0===i||i.onSpin(!1),
18152
+ var Cz,Ez=function(e){var t=new URL(e);return t.pathname="/api/v2/security/captcha",t.search="?r=".concat(+new Date),t.href},kz=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())}))},Sz=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(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},xz=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},Pz=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().useCallback,Tz=y().useEffect,Oz=y().useMemo,Nz=y().useRef,Iz=y().useState,Az=function(e){var t,n=e.agreements,r=e.onLoginFailed,o=e.onLoginSuccess,i=e.saveIdentify,a=e.multipleInstance,s=e.backfillData,c=e.passwordLoginMethods,l=xz(cT.useForm(),1)[0],u=lL(),d=u._firstItemInitialValue,f=void 0===d?"":d,p=u.specifyDefaultLoginMethod;wz({form:l,way:zs.Password,formKey:"account",backfillData:s,cancelBackfill:zs.Password===p});var h=xz(Iz(!1),2),m=h[0],v=h[1],g=uj().isPhoneMedia,b=xz(Iz(!1),2),w=b[0],C=b[1],E=_u(),k=E.t,S=E.i18n,x=oQ().post,P=GL(),_=iL(),T=pL(),O=gL(),N=yL(),I=Nz(null),A=xz(Iz("always_enable"===N),2),R=A[0],M=A[1],D=xz(Iz(""),2),L=D[0],F=D[1],j=xz(Iz(0),2),B=j[0],q=j[1],U=xz(Iz(!1),2),V=U[0],z=U[1],$=P.options.encryptFunction,H=_z((function(t){return kz(void 0,void 0,void 0,(function(){var n,r,o,i,a,s;return Sz(this,(function(c){switch(c.label){case 0:return e.onLoginRequest?[4/*yield*/,e.onLoginRequest(t)]:[3/*break*/,2];case 1:return[2/*return*/,c.sent()];case 2:return n=t.data,r=(null==_?void 0:_.mergeAdAndAccountPasswordLogin)?"/api/v2/login/ad-all-in-one":"/api/v2/login/account",o=n.identity&&n.identity.trim(),i=n.password,a=n.captchaCode&&n.captchaCode.trim(),s={account:o},[4/*yield*/,$(i,e.publicKey)];case 3:return s.password=c.sent(),s.captchaCode=a,s.customData=(null==T?void 0:T.isHost)?CQ(["login_page_context"]):void 0,s.autoRegister=e.autoRegister,s.withCustomData=!1,[4/*yield*/,x(r,s)];case 4:return[2/*return*/,c.sent()]}}))}))}),[null==T?void 0:T.isHost,$,x,e,null==_?void 0:_.mergeAdAndAccountPasswordLogin]),W=function(t,n){var i,s,c,l,u=t.code,d=t.apiCode,f=t.message,p=t.data,h=t.onGuardHandling;if(null===(i=null==I?void 0:I.current)||void 0===i||i.onSpin(!1),
18153
18153
  // 更新本次登录方式
18154
18154
  p&&a&&a.setLoginWayByHttpData(n,p),200===u)o(p,f);else{if(
18155
18155
  // 需要「图形验证码」并且是第一次,就发一次,后面存在的时候会在点击登录,表单校验通过后,不论对错都要重新请求验证码
18156
- d!==UF.INPUT_CAPTCHACODE||F||(j(Ez(e.host)),D(!0)),d===UF.PASSWORD_ERROR&&null!==(s=null==p?void 0:p.remainCount)&&void 0!==s&&s)return U(null!==(c=null==p?void 0:p.remainCount)&&void 0!==c?c:0),null===(l=null==A?void 0:A.current)||void 0===l||l.onSpin(!1),void(
18156
+ d!==UF.INPUT_CAPTCHACODE||L||(F(Ez(e.host)),M(!0)),d===UF.PASSWORD_ERROR&&null!==(s=null==p?void 0:p.remainCount)&&void 0!==s&&s)return q(null!==(c=null==p?void 0:p.remainCount)&&void 0!==c?c:0),null===(l=null==I?void 0:I.current)||void 0===l||l.onSpin(!1),void(
18157
18157
  // TODO 临时拦截密码错误限制不报 message
18158
18158
  // props.onLogin(9999, data, msg)
18159
18159
  null==r||r(9999,p,f));d!==UF.ACCOUNT_LOCK&&d!==UF.MULTIPLE_ERROR_LOCK||
18160
18160
  // 账号锁定
18161
- $(!0);
18161
+ z(!0);
18162
18162
  // 响应拦截器处理通用错误以及changeModule
18163
18163
  // 本次请求成功 && 当前请求
18164
18164
  var m=null==h?void 0:h();
18165
18165
  // 向上层抛出错误
18166
- m===AZ.RENDER_MESSAGE&&(null==r||r(u,p,f))}};Tz((function(){U(0),$(!1)}),[e.loginWay]),Tz((function(){D("always_enable"===I),"always_enable"===I&&j(Ez(e.host))}),[I,e.host]);var K=Oz((function(){var t,n;return e.submitButText?e.submitButText:e.autoRegister&&!T.registerDisabled&&(null===(n=null===(t=O.registerMethods)||void 0===t?void 0:t.filter((function(e){
18166
+ m===AZ.RENDER_MESSAGE&&(null==r||r(u,p,f))}};Tz((function(){q(0),z(!1)}),[e.loginWay]),Tz((function(){M("always_enable"===N),"always_enable"===N&&F(Ez(e.host))}),[N,e.host]);var G=Oz((function(){var t,n;return e.submitButText?e.submitButText:e.autoRegister&&!_.registerDisabled&&(null===(n=null===(t=T.registerMethods)||void 0===t?void 0:t.filter((function(e){
18167
18167
  // @ts-ignore
18168
- return![Gs.Phone,Gs.EmailCode].includes(e)})))||void 0===n?void 0:n.length)?"".concat(S("common.login")," / ").concat(S("common.register")):S("common.login")}),[e,S,T.registerDisabled,O.registerMethods]),Y=Oz((function(){var e=new Map;return T.tabMethodsFields.forEach((function(t){e.set(t.key,t)})),e}),[T.tabMethodsFields]),J=Oz((function(){
18168
+ return![Gs.Phone,Gs.EmailCode].includes(e)})))||void 0===n?void 0:n.length)?"".concat(k("common.login")," / ").concat(k("common.register")):k("common.login")}),[e,k,_.registerDisabled,T.registerMethods]),K=Oz((function(){var e=new Map;return _.tabMethodsFields.forEach((function(t){e.set(t.key,t)})),e}),[_.tabMethodsFields]),Y=Oz((function(){
18169
18169
  // 登录注册合并
18170
- if(null==O?void 0:O.autoRegister){
18170
+ if(null==T?void 0:T.autoRegister){
18171
18171
  // 密码 placeholder
18172
- var e=Pz([],xz(c),!1);return S("login.inputAccount",{text:jQ(e,Y,N)})}
18172
+ var e=Pz([],xz(c),!1);return k("login.inputAccount",{text:jQ(e,K,O)})}
18173
18173
  // 登录注册分页
18174
- return S("login.inputAccount",{text:jQ(Pz([],xz(c),!1),Y,N)})}),[null==O?void 0:O.autoRegister,x,Y,N,c,S]);return y().createElement("div",{className:"authing-g2-login-password"},y().createElement(cT,{name:"passworLogin",onFinish:function(t){return kz(void 0,void 0,void 0,(function(){var r,o,i,a,s;return Sz(this,(function(c){switch(c.label){case 0:return E(!0),(null==n?void 0:n.length)&&!m?(A.current.onError(),[2/*return*/]):(U(0),$(!1),
18174
+ return k("login.inputAccount",{text:jQ(Pz([],xz(c),!1),K,O)})}),[null==T?void 0:T.autoRegister,S,K,O,c,k]);return y().createElement("div",{className:"authing-g2-login-password"},y().createElement(cT,{name:"passworLogin",onFinish:function(t){return kz(void 0,void 0,void 0,(function(){var r,o,i,a,s;return Sz(this,(function(c){switch(c.label){case 0:return C(!0),(null==n?void 0:n.length)&&!m?(I.current.onError(),[2/*return*/]):(q(0),z(!1),
18175
18175
  // onBeforeLogin
18176
- null===(i=null==A?void 0:A.current)||void 0===i||i.onSpin(!0),r={type:zs.Password,data:{identity:t.account,password:t.password,captchaCode:t.captchaCode}},[4/*yield*/,null===(a=e.onBeforeLogin)||void 0===a?void 0:a.call(e,r)]);case 1:return!c.sent()&&e.onBeforeLogin?(null===(s=null==A?void 0:A.current)||void 0===s||s.onSpin(!1),[2/*return*/]):(
18176
+ null===(i=null==I?void 0:I.current)||void 0===i||i.onSpin(!0),r={type:zs.Password,data:{identity:t.account,password:t.password,captchaCode:t.captchaCode}},[4/*yield*/,null===(a=e.onBeforeLogin)||void 0===a?void 0:a.call(e,r)]);case 1:return!c.sent()&&e.onBeforeLogin?(null===(s=null==I?void 0:I.current)||void 0===s||s.onSpin(!1),[2/*return*/]):(
18177
18177
  // 图形验证码出现后,不管是「图形验证码」错了,还是「账号」「密码」错了,都要重新发验证码
18178
- F&&j(Ez(e.host)),[4/*yield*/,W(r)]);case 2:return o=c.sent(),G(o,t.account),[2/*return*/]}}))}))},onFinishFailed:function(){return A.current.onError()},autoComplete:"off",form:l,onValuesChange:function(e){(null==e?void 0:e.account)&&i&&i(zs.Password,null==e?void 0:e.account)}},y().createElement(ez,{name:"account",className:"authing-g2-input-form",validPasswordLoginMethods:(null===(t=null==T?void 0:T.passwordTabConfig)||void 0===t?void 0:t.validLoginMethods)||[],initialValue:p===zs.Password?f:""},y().createElement(oz,{className:"authing-g2-input",autoComplete:"off",size:"large",autoFocus:!b,prefix:y().createElement(JD,{type:"authing-a-user-line1",style:{color:"#878A95"}}),passwordLoginMethods:c,placeholder:J})),y().createElement(cT.Item,{name:"password",validateTrigger:["onBlur","onChange"],className:"authing-g2-input-form",rules:hQ(S("common.password"))},y().createElement(HB,{className:"authing-g2-input",size:"large",placeholder:S("login.inputLoginPwd"),prefix:y().createElement(JD,{type:"authing-a-lock-line1",style:{color:"#878A95"}})})),M&&y().createElement(cT.Item,{className:"authing-g2-input-form",validateTrigger:["onBlur","onChange"],name:"captchaCode",rules:hQ(S("common.captchaCode"))},y().createElement(sz,{className:"authing-g2-input",size:"large",placeholder:S("login.inputCaptchaCode"),verifyCodeUrl:F,changeCode:function(){return j(Ez(e.host))}})),0!==q&&!z&&y().createElement("span",{style:{marginBottom:23,fontSize:12,color:"#E8353E",display:"block"}},S("common.loginFailCheck",{number:q})),z&&y().createElement("span",{style:{marginBottom:23,fontSize:12,color:"#E8353E",display:"block"}},S("common.accountLock")),Boolean(null==n?void 0:n.length)&&y().createElement(mz,{onChange:function(e,t){v(e),g.current=t},agreements:n,showError:C}),y().createElement(cT.Item,{className:"authing-g2-sumbit-form"},y().createElement(Ej,{
18178
+ L&&F(Ez(e.host)),[4/*yield*/,H(r)]);case 2:return o=c.sent(),W(o,t.account),[2/*return*/]}}))}))},onFinishFailed:function(){return I.current.onError()},autoComplete:"off",form:l,onValuesChange:function(e){(null==e?void 0:e.account)&&i&&i(zs.Password,null==e?void 0:e.account)}},y().createElement(ez,{name:"account",className:"authing-g2-input-form",validPasswordLoginMethods:(null===(t=null==_?void 0:_.passwordTabConfig)||void 0===t?void 0:t.validLoginMethods)||[],initialValue:p===zs.Password?f:""},y().createElement(oz,{className:"authing-g2-input",autoComplete:"off",size:"large",autoFocus:!g,prefix:y().createElement(JD,{type:"authing-a-user-line1",style:{color:"#878A95"}}),passwordLoginMethods:c,placeholder:Y})),y().createElement(cT.Item,{name:"password",validateTrigger:["onBlur","onChange"],className:"authing-g2-input-form",rules:hQ(k("common.password"))},y().createElement(HB,{className:"authing-g2-input",size:"large",placeholder:k("login.inputLoginPwd"),prefix:y().createElement(JD,{type:"authing-a-lock-line1",style:{color:"#878A95"}})})),R&&y().createElement(cT.Item,{className:"authing-g2-input-form",validateTrigger:["onBlur","onChange"],name:"captchaCode",rules:hQ(k("common.captchaCode"))},y().createElement(sz,{className:"authing-g2-input",size:"large",placeholder:k("login.inputCaptchaCode"),verifyCodeUrl:L,changeCode:function(){return F(Ez(e.host))}})),0!==B&&!V&&y().createElement("span",{style:{marginBottom:23,fontSize:12,color:"#E8353E",display:"block"}},k("common.loginFailCheck",{number:B})),V&&y().createElement("span",{style:{marginBottom:23,fontSize:12,color:"#E8353E",display:"block"}},k("common.accountLock")),Boolean(null==n?void 0:n.length)&&y().createElement(mz,{onChange:v,agreements:n,showError:w}),y().createElement(cT.Item,{className:"authing-g2-sumbit-form"},y().createElement(Ej,{
18179
18179
  // TODO 产品还没想好 暂时不上
18180
18180
  // disabled={
18181
18181
  // !!agreements.find((item) => item.required && !acceptedAgreements)
18182
18182
  // }
18183
- text:K,className:"password",ref:A}))))},Rz=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())}))},Mz=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(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},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},Lz=y().useRef,Fz=y().useState,jz=function(e){var t=e.agreements,n=e.onLoginSuccess,r=e.onLoginFailed,o=e.multipleInstance,i=e.backfillData,a=Dz(cT.useForm(),1)[0];
18183
+ text:G,className:"password",ref:I}))))},Rz=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())}))},Mz=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(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},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},Lz=y().useRef,Fz=y().useState,jz=function(e){var t=e.agreements,n=e.onLoginSuccess,r=e.onLoginFailed,o=e.multipleInstance,i=e.backfillData,a=Dz(cT.useForm(),1)[0];
18184
18184
  // const { responseIntercept } = useGuardHttpClient()
18185
- wz({form:a,way:"ldap",formKey:"account",backfillData:i});var s=Dz(Fz(!1),2),c=s[0],l=s[1],u=Dz(Fz([]),2),d=u[0],f=u[1],p=uj().isPhoneMedia,h=Dz(Fz(!1),2),m=h[0],v=h[1],g=aL().post,b=_u().t,w=Lz(null),C=Dz(Fz(!1),2),E=C[0],k=C[1],S=Dz(Fz(""),2),x=S[0],P=S[1],_="".concat(e.host,"/api/v2/security/captcha"),T=function(){return"".concat(_,"?r=").concat(+new Date)};return y().createElement("div",{className:"authing-g2-login-ldap"},y().createElement(cT,{form:a,name:"passworLogin",onFinish:function(i){return Rz(void 0,void 0,void 0,(function(){var a,s,l,u,f,p,h,m,y,C,E,S,x;return Mz(this,(function(_){switch(_.label){case 0:return v(!0),(null==t?void 0:t.length)&&!c?(null===(C=w.current)||void 0===C||C.onError(),[2/*return*/]):(
18185
+ wz({form:a,way:"ldap",formKey:"account",backfillData:i});var s=Dz(Fz(!1),2),c=s[0],l=s[1],u=uj().isPhoneMedia,d=Dz(Fz(!1),2),f=d[0],p=d[1],h=aL().post,m=_u().t,v=Lz(null),g=Dz(Fz(!1),2),b=g[0],w=g[1],C=Dz(Fz(""),2),E=C[0],k=C[1],S="".concat(e.host,"/api/v2/security/captcha"),x=function(){return"".concat(S,"?r=").concat(+new Date)};return y().createElement("div",{className:"authing-g2-login-ldap"},y().createElement(cT,{form:a,name:"passworLogin",onFinish:function(i){return Rz(void 0,void 0,void 0,(function(){var a,s,l,u,d,f,g,y,b,C,E,S,P;return Mz(this,(function(_){switch(_.label){case 0:return p(!0),(null==t?void 0:t.length)&&!c?(null===(C=v.current)||void 0===C||C.onError(),[2/*return*/]):(
18186
18186
  // onBeforeLogin
18187
- null===(E=w.current)||void 0===E||E.onSpin(!0),a={type:zs.LDAP,data:{identity:i.account,password:i.password,captchaCode:i.captchaCode}},[4/*yield*/,e.onBeforeLogin(a)]);case 1:if(!_.sent())return null===(S=w.current)||void 0===S||S.onSpin(!1),[2/*return*/];s=i.account&&i.account.trim(),l=i.password,_.label=2;case 2:return _.trys.push([2,4,,5]),[4/*yield*/,g("/api/v2/ldap/verify-user",{username:s,password:l,agreementIds:t.length?d:void 0})];case 3:return u=_.sent(),f=u.code,p=u.data,h=u.onGuardHandling,m=u.message,w.current.onSpin(!1),
18187
+ null===(E=v.current)||void 0===E||E.onSpin(!0),a={type:zs.LDAP,data:{identity:i.account,password:i.password,captchaCode:i.captchaCode}},[4/*yield*/,e.onBeforeLogin(a)]);case 1:if(!_.sent())return null===(S=v.current)||void 0===S||S.onSpin(!1),[2/*return*/];s=i.account&&i.account.trim(),l=i.password,_.label=2;case 2:return _.trys.push([2,4,,5]),[4/*yield*/,h("/api/v2/ldap/verify-user",{username:s,password:l})];case 3:return u=_.sent(),d=u.code,f=u.data,g=u.onGuardHandling,y=u.message,v.current.onSpin(!1),
18188
18188
  // 更新本次登录方式
18189
- p&&o&&o.setLoginWayByLDAPData(s,p),200===f?n(p):(f===UF.INPUT_CAPTCHACODE&&(P(T()),k(!0)),
18189
+ f&&o&&o.setLoginWayByLDAPData(s,f),200===d?n(f):(d===UF.INPUT_CAPTCHACODE&&(k(x()),w(!0)),
18190
18190
  // 向上层抛出错误
18191
- (null==h?void 0:h())===AZ.RENDER_MESSAGE&&r(f,p,m)),[3/*break*/,5];case 4:return y=_.sent(),null===(x=w.current)||void 0===x||x.onSpin(!1),"ECONNABORTED"===y.code&&(gC.error(b("common.timeoutLDAP")),r(2333,{},JSON.stringify(y))),[3/*break*/,5];case 5:return[2/*return*/]}}))}))},onFinishFailed:function(){var e;return null===(e=w.current)||void 0===e?void 0:e.onError()},autoComplete:"off"},y().createElement(cT.Item,{validateTrigger:["onBlur","onChange"],className:"authing-g2-input-form",name:"account",rules:hQ(b("common.account"))},y().createElement(oO,{autoFocus:!p,className:"authing-g2-input",autoComplete:"off",size:"large",placeholder:b("login.inputLdapUsername"),prefix:y().createElement(JD,{type:"authing-a-user-line1",style:{color:"#878A95"}})})),y().createElement(cT.Item,{validateTrigger:["onBlur","onChange"],className:"authing-g2-input-form",name:"password",rules:hQ(b("common.password"))},y().createElement(HB,{className:"authing-g2-input",size:"large",placeholder:b("login.inputLdapPwd"),
18191
+ (null==g?void 0:g())===AZ.RENDER_MESSAGE&&r(d,f,y)),[3/*break*/,5];case 4:return b=_.sent(),null===(P=v.current)||void 0===P||P.onSpin(!1),"ECONNABORTED"===b.code&&(gC.error(m("common.timeoutLDAP")),r(2333,{},JSON.stringify(b))),[3/*break*/,5];case 5:return[2/*return*/]}}))}))},onFinishFailed:function(){var e;return null===(e=v.current)||void 0===e?void 0:e.onError()},autoComplete:"off"},y().createElement(cT.Item,{validateTrigger:["onBlur","onChange"],className:"authing-g2-input-form",name:"account",rules:hQ(m("common.account"))},y().createElement(oO,{autoFocus:!u,className:"authing-g2-input",autoComplete:"off",size:"large",placeholder:m("login.inputLdapUsername"),prefix:y().createElement(JD,{type:"authing-a-user-line1",style:{color:"#878A95"}})})),y().createElement(cT.Item,{validateTrigger:["onBlur","onChange"],className:"authing-g2-input-form",name:"password",rules:hQ(m("common.password"))},y().createElement(HB,{className:"authing-g2-input",size:"large",placeholder:m("login.inputLdapPwd"),
18192
18192
  // prefix={<LockOutlined style={{ color: '#878A95' }} />}
18193
- prefix:y().createElement(JD,{type:"authing-a-lock-line1",style:{color:"#878A95"}})})),E&&y().createElement(cT.Item,{validateTrigger:["onBlur","onChange"],className:"authing-g2-input-form",name:"captchaCode",rules:[{required:!0,message:b("login.inputCaptchaCode")}]},y().createElement(oO,{className:"authing-g2-input add-after",size:"large",placeholder:b("login.inputCaptchaCode"),addonAfter:y().createElement("img",{className:"g2-captcha-code-image",src:x,alt:b("login.captchaCode"),style:{height:"2em",cursor:"pointer"},onClick:function(){return P(T())}})})),Boolean(null==t?void 0:t.length)&&y().createElement(mz,{onChange:function(e,t){l(e),f(t)},agreements:t,showError:m}),y().createElement(cT.Item,{className:"authing-g2-sumbit-form"},y().createElement(Ej,{
18193
+ prefix:y().createElement(JD,{type:"authing-a-lock-line1",style:{color:"#878A95"}})})),b&&y().createElement(cT.Item,{validateTrigger:["onBlur","onChange"],className:"authing-g2-input-form",name:"captchaCode",rules:[{required:!0,message:m("login.inputCaptchaCode")}]},y().createElement(oO,{className:"authing-g2-input add-after",size:"large",placeholder:m("login.inputCaptchaCode"),addonAfter:y().createElement("img",{className:"g2-captcha-code-image",src:E,alt:m("login.captchaCode"),style:{height:"2em",cursor:"pointer"},onClick:function(){return k(x())}})})),Boolean(null==t?void 0:t.length)&&y().createElement(mz,{onChange:l,agreements:t,showError:f}),y().createElement(cT.Item,{className:"authing-g2-sumbit-form"},y().createElement(Ej,{
18194
18194
  // disabled={
18195
18195
  // !!agreements.find((item) => item.required && !acceptedAgreements)
18196
18196
  // }
18197
- text:b("common.login"),className:"password",ref:w}))))},Bz=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())}))},qz=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(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},Uz=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},Vz=y().useEffect,zz=y().useRef,$z=y().useState,Hz=function(e){var t=e.agreements,n=e.onLoginFailed,r=e.onLoginSuccess,o=Uz($z(!1),2),i=o[0],a=o[1],s=Uz($z([]),2),c=s[0],l=s[1],u=Uz($z(!1),2),d=u[0],f=u[1],p=yL(),h=Uz($z("always_enable"===p),2),m=h[0],v=h[1],g=Uz($z(""),2),b=g[0],w=g[1],C=iL(),E=pL().host,k=sL(),S=aL().responseIntercept,x=_u().t,P=uj().isPhoneMedia,_=GL(),T=Uz(cT.useForm(),1)[0],O=zz(null);return Vz((function(){v("always_enable"===p),"always_enable"===p&&w(Ez(E))}),[p,E]),y().createElement("div",{className:"authing-g2-login-ad"},y().createElement(cT,{form:T,name:"adLogin",onFinish:function(o){return Bz(void 0,void 0,void 0,(function(){var a,s,l,u,d,p,h,m,g,y,P,T,N,I,A,R,M,D,L,F,j;return qz(this,(function(B){switch(B.label){case 0:return f(!0),(null==t?void 0:t.length)&&!i?(null===(M=O.current)||void 0===M||M.onError(),[2/*return*/]):(
18197
+ text:m("common.login"),className:"password",ref:v}))))},Bz=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())}))},qz=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(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},Uz=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},Vz=y().useEffect,zz=y().useRef,$z=y().useState,Hz=function(e){var t=e.agreements,n=e.onLoginFailed,r=e.onLoginSuccess,o=Uz($z(!1),2),i=o[0],a=o[1],s=Uz($z(!1),2),c=s[0],l=s[1],u=yL(),d=Uz($z("always_enable"===u),2),f=d[0],p=d[1],h=Uz($z(""),2),m=h[0],v=h[1],g=iL(),b=pL().host,w=sL(),C=aL().responseIntercept,E=_u().t,k=uj().isPhoneMedia,S=GL(),x=Uz(cT.useForm(),1)[0],P=zz(null);return Vz((function(){p("always_enable"===u),"always_enable"===u&&v(Ez(b))}),[u,b]),y().createElement("div",{className:"authing-g2-login-ad"},y().createElement(cT,{form:x,name:"adLogin",onFinish:function(o){return Bz(void 0,void 0,void 0,(function(){var a,s,c,u,d,f,h,y,k,x,_,T,O,N,I,A,R,M,D,L,F;return qz(this,(function(j){switch(j.label){case 0:return l(!0),(null==t?void 0:t.length)&&!i?(null===(R=P.current)||void 0===R||R.onError(),[2/*return*/]):(
18198
18198
  // onBeforeLogin
18199
- null===(D=O.current)||void 0===D||D.onSpin(!0),a={type:Oi.AD,data:{identity:o.account,password:o.password,captchaCode:o.captchaCode}},[4/*yield*/,e.onBeforeLogin(a)]);case 1:return B.sent()?(s=o.account&&o.account.trim(),l=o.password,u=o.captchaCode,[4/*yield*/,(0,_.options.encryptFunction)(l,e.publicKey)]):(null===(L=O.current)||void 0===L||L.onSpin(!1),[2/*return*/]);case 2:d=B.sent(),
18199
+ null===(M=P.current)||void 0===M||M.onSpin(!0),a={type:Oi.AD,data:{identity:o.account,password:o.password,captchaCode:o.captchaCode}},[4/*yield*/,e.onBeforeLogin(a)]);case 1:return j.sent()?(s=o.account&&o.account.trim(),c=o.password,u=o.captchaCode,[4/*yield*/,(0,S.options.encryptFunction)(c,e.publicKey)]):(null===(D=P.current)||void 0===D||D.onSpin(!1),[2/*return*/]);case 2:d=j.sent(),
18200
18200
  // 图形验证码出现后,不管是「图形验证码」错了,还是「账号」「密码」错了,都要重新发验证码
18201
- b&&w(Ez(E)),B.label=3;case 3:return B.trys.push([3,6,,7]),p="".concat(E,"/api/v2/ad/verify-user"),h=SL(),[4/*yield*/,fetch(p,{method:"POST",body:JSON.stringify({username:s,password:d,captchaCode:u,agreementIds:t.length?c:void 0}),credentials:"include",headers:(R={"Content-Type":"application/json"},R[RL.langHeader]=cu.resolvedLanguage,R["x-authing-userpool-id"]=C.userPoolId,R["x-authing-app-id"]=k,R["x-authing-sdk-version"]=h,R["x-authing-request-from"]="Guard@".concat(h),R)})];case 4:return[4/*yield*/,B.sent().json()];case 5:return m=B.sent(),g=S(m),y=g.code,P=g.apiCode,T=g.data,N=g.onGuardHandling,I=g.message,
18201
+ m&&v(Ez(b)),j.label=3;case 3:return j.trys.push([3,6,,7]),f="".concat(b,"/api/v2/ad/verify-user"),h=SL(),[4/*yield*/,fetch(f,{method:"POST",body:JSON.stringify({username:s,password:d,captchaCode:u}),credentials:"include",headers:(A={"Content-Type":"application/json"},A[RL.langHeader]=cu.resolvedLanguage,A["x-authing-userpool-id"]=g.userPoolId,A["x-authing-app-id"]=w,A["x-authing-sdk-version"]=h,A["x-authing-request-from"]="Guard@".concat(h),A)})];case 4:return[4/*yield*/,j.sent().json()];case 5:return y=j.sent(),k=C(y),x=k.code,_=k.apiCode,T=k.data,O=k.onGuardHandling,N=k.message,
18202
18202
  // // 更新本次登录方式
18203
18203
  // data && multipleInstance && multipleInstance.setLoginWay('input', 'ad')
18204
- null===(F=O.current)||void 0===F||F.onSpin(!1),200===y?r(T):(
18204
+ null===(L=P.current)||void 0===L||L.onSpin(!1),200===x?r(T):(
18205
18205
  // 需要「图形验证码」并且是第一次,就发一次,后面存在的时候会在点击登录,表单校验通过后,不论对错都要重新请求验证码
18206
- P!==UF.INPUT_CAPTCHACODE||b||(w(Ez(E)),v(!0)),
18206
+ _!==UF.INPUT_CAPTCHACODE||m||(v(Ez(b)),p(!0)),
18207
18207
  // 向上层抛出错误
18208
- (null==N?void 0:N())===AZ.RENDER_MESSAGE&&n(y,T,I)),[3/*break*/,7];case 6:return A=B.sent(),null===(j=O.current)||void 0===j||j.onSpin(!1),"ECONNABORTED"===A.code&&(gC.error(x("common.timeoutAD")),n(2333,{},JSON.stringify(A))),[3/*break*/,7];case 7:return[2/*return*/]}}))}))},onFinishFailed:function(){return O.current.onError()},autoComplete:"off"},(null==C?void 0:C.ssoPageComponentDisplay.userPasswordInput)&&y().createElement(y().Fragment,null,y().createElement(cT.Item,{className:"authing-g2-input-form",name:"account",validateTrigger:["onBlur","onChange"],rules:hQ(x("common.account"))},y().createElement(oO,{autoFocus:!P,className:"authing-g2-input",autoComplete:"off",size:"large",placeholder:(null==C?void 0:C.mergeAdAndAccountPasswordLogin)?x("common.jobNumber"):x("login.inputAdUsername"),prefix:y().createElement(JD,{type:"authing-a-user-line1",style:{color:"#878A95"}})})),y().createElement(cT.Item,{validateTrigger:["onBlur","onChange"],className:"authing-g2-input-form",name:"password",rules:hQ(x("common.password"))},y().createElement(HB,{autoComplete:"off",className:"authing-g2-input",size:"large",placeholder:(null==C?void 0:C.mergeAdAndAccountPasswordLogin)?x("login.inputPwd"):x("login.inputAdPwd"),prefix:y().createElement(JD,{type:"authing-a-lock-line1",style:{color:"#878A95"}})})),m&&y().createElement(cT.Item,{className:"authing-g2-input-form",validateTrigger:["onBlur","onChange"],name:"captchaCode",rules:hQ(x("common.captchaCode"))},y().createElement(sz,{className:"authing-g2-input",size:"large",placeholder:x("login.inputCaptchaCode"),verifyCodeUrl:b,changeCode:function(){return w(Ez(E))}})),Boolean(null==t?void 0:t.length)&&y().createElement(mz,{onChange:function(e,t){a(e),l(t)},agreements:t,showError:d}),y().createElement(cT.Item,{className:"authing-g2-sumbit-form"},y().createElement(Ej,{
18208
+ (null==O?void 0:O())===AZ.RENDER_MESSAGE&&n(x,T,N)),[3/*break*/,7];case 6:return I=j.sent(),null===(F=P.current)||void 0===F||F.onSpin(!1),"ECONNABORTED"===I.code&&(gC.error(E("common.timeoutAD")),n(2333,{},JSON.stringify(I))),[3/*break*/,7];case 7:return[2/*return*/]}}))}))},onFinishFailed:function(){return P.current.onError()},autoComplete:"off"},(null==g?void 0:g.ssoPageComponentDisplay.userPasswordInput)&&y().createElement(y().Fragment,null,y().createElement(cT.Item,{className:"authing-g2-input-form",name:"account",validateTrigger:["onBlur","onChange"],rules:hQ(E("common.account"))},y().createElement(oO,{autoFocus:!k,className:"authing-g2-input",autoComplete:"off",size:"large",placeholder:(null==g?void 0:g.mergeAdAndAccountPasswordLogin)?E("common.jobNumber"):E("login.inputAdUsername"),prefix:y().createElement(JD,{type:"authing-a-user-line1",style:{color:"#878A95"}})})),y().createElement(cT.Item,{validateTrigger:["onBlur","onChange"],className:"authing-g2-input-form",name:"password",rules:hQ(E("common.password"))},y().createElement(HB,{autoComplete:"off",className:"authing-g2-input",size:"large",placeholder:(null==g?void 0:g.mergeAdAndAccountPasswordLogin)?E("login.inputPwd"):E("login.inputAdPwd"),prefix:y().createElement(JD,{type:"authing-a-lock-line1",style:{color:"#878A95"}})})),f&&y().createElement(cT.Item,{className:"authing-g2-input-form",validateTrigger:["onBlur","onChange"],name:"captchaCode",rules:hQ(E("common.captchaCode"))},y().createElement(sz,{className:"authing-g2-input",size:"large",placeholder:E("login.inputCaptchaCode"),verifyCodeUrl:m,changeCode:function(){return v(Ez(b))}})),Boolean(null==t?void 0:t.length)&&y().createElement(mz,{onChange:a,agreements:t,showError:c}),y().createElement(cT.Item,{className:"authing-g2-sumbit-form"},y().createElement(Ej,{
18209
18209
  // disabled={
18210
18210
  // !!agreements.find(
18211
18211
  // (item) => item.required && !acceptedAgreements
18212
18212
  // )
18213
18213
  // }
18214
- text:x("common.login"),className:"password",ref:O})))))},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())}))},Gz=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(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},Kz=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},Yz=y().useCallback,Jz=y().useEffect,Zz=y().useState,Qz=y().useMemo,Xz=function(e){var t="".concat(k$,"-qrcode--").concat(e),n=_u().t;return[t,Qz((function(){return{loading:null,ready:null,already:y().createElement(y().Fragment,null,y().createElement(JD,{type:"authing-checkbox-circle-fill",style:{width:"40px",height:"40px"}}),y().createElement("span",{className:"".concat(k$,"-inner__title--already")},n("login.scanSuccess"))),cancel:y().createElement(y().Fragment,null,y().createElement(JD,{type:"authing-refer-qr-code",style:{width:"40px",height:"40px"}}),y().createElement("span",{className:"".concat(k$,"-inner__title--refer")},n("login.qrcodeRefer"))),expired:y().createElement(y().Fragment,null,y().createElement(JD,{type:"authing-refer-qr-code",style:{width:"40px",height:"40px"}}),y().createElement("span",{className:"".concat(k$,"-inner__title--refer")},n("login.qrcodeRefer"))),error:y().createElement(y().Fragment,null,y().createElement(JD,{type:"authing-refer-qr-code",style:{width:"40px",height:"40px"}}),y().createElement("span",{className:"".concat(k$,"-inner__title--refer")},n("login.qrcodeNetWorkError"))),success:y().createElement(y().Fragment,null,y().createElement(JD,{type:"authing-checkbox-circle-fill",style:{width:"40px",height:"40px"}}),y().createElement("span",{className:"".concat(k$,"-inner__title--already")},n("login.scanSuccess"))),MFA:null}[e]}),[e,n])]},e$=Object.defineProperty,t$=Object.getOwnPropertySymbols,n$=Object.prototype.hasOwnProperty,r$=Object.prototype.propertyIsEnumerable,o$=(e,t,n)=>t in e?e$(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,i$=(e,t)=>{for(var n in t||(t={}))n$.call(t,n)&&o$(e,n,t[n]);if(t$)for(var n of t$(t))r$.call(t,n)&&o$(e,n,t[n]);return e},a$=(e,t)=>{var n={};for(var r in e)n$.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&t$)for(var r of t$(e))t.indexOf(r)<0&&r$.call(e,r)&&(n[r]=e[r]);return n};(e=>{const t=class{constructor(e,n,r,o){if(this.version=e,this.errorCorrectionLevel=n,this.modules=[],this.isFunction=[],e<t.MIN_VERSION||e>t.MAX_VERSION)throw new RangeError("Version value out of range");if(o<-1||o>7)throw new RangeError("Mask value out of range");this.size=4*e+17;let a=[];for(let e=0;e<this.size;e++)a.push(!1);for(let e=0;e<this.size;e++)this.modules.push(a.slice()),this.isFunction.push(a.slice());this.drawFunctionPatterns();const s=this.addEccAndInterleave(r);if(this.drawCodewords(s),-1==o){let e=1e9;for(let t=0;t<8;t++){this.applyMask(t),this.drawFormatBits(t);const n=this.getPenaltyScore();n<e&&(o=t,e=n),this.applyMask(t)}}i(0<=o&&o<=7),this.mask=o,this.applyMask(o),this.drawFormatBits(o),this.isFunction=[]}static encodeText(n,r){const o=e.QrSegment.makeSegments(n);return t.encodeSegments(o,r)}static encodeBinary(n,r){const o=e.QrSegment.makeBytes(n);return t.encodeSegments([o],r)}static encodeSegments(e,n,o=1,a=40,c=-1,l=!0){if(!(t.MIN_VERSION<=o&&o<=a&&a<=t.MAX_VERSION)||c<-1||c>7)throw new RangeError("Invalid value");let u,d;for(u=o;;u++){const r=8*t.getNumDataCodewords(u,n),o=s.getTotalBits(e,u);if(o<=r){d=o;break}if(u>=a)throw new RangeError("Data too long")}for(const e of[t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])l&&d<=8*t.getNumDataCodewords(u,e)&&(n=e);let f=[];for(const t of e){r(t.mode.modeBits,4,f),r(t.numChars,t.mode.numCharCountBits(u),f);for(const e of t.getData())f.push(e)}i(f.length==d);const p=8*t.getNumDataCodewords(u,n);i(f.length<=p),r(0,Math.min(4,p-f.length),f),r(0,(8-f.length%8)%8,f),i(f.length%8==0);for(let e=236;f.length<p;e^=253)r(e,8,f);let h=[];for(;8*h.length<f.length;)h.push(0);return f.forEach(((e,t)=>h[t>>>3]|=e<<7-(7&t))),new t(u,n,h,c)}getModule(e,t){return 0<=e&&e<this.size&&0<=t&&t<this.size&&this.modules[t][e]}getModules(){return this.modules}drawFunctionPatterns(){for(let e=0;e<this.size;e++)this.setFunctionModule(6,e,e%2==0),this.setFunctionModule(e,6,e%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const e=this.getAlignmentPatternPositions(),t=e.length;for(let n=0;n<t;n++)for(let r=0;r<t;r++)0==n&&0==r||0==n&&r==t-1||n==t-1&&0==r||this.drawAlignmentPattern(e[n],e[r]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(e){const t=this.errorCorrectionLevel.formatBits<<3|e;let n=t;for(let e=0;e<10;e++)n=n<<1^1335*(n>>>9);const r=21522^(t<<10|n);i(r>>>15==0);for(let e=0;e<=5;e++)this.setFunctionModule(8,e,o(r,e));this.setFunctionModule(8,7,o(r,6)),this.setFunctionModule(8,8,o(r,7)),this.setFunctionModule(7,8,o(r,8));for(let e=9;e<15;e++)this.setFunctionModule(14-e,8,o(r,e));for(let e=0;e<8;e++)this.setFunctionModule(this.size-1-e,8,o(r,e));for(let e=8;e<15;e++)this.setFunctionModule(8,this.size-15+e,o(r,e));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let e=this.version;for(let t=0;t<12;t++)e=e<<1^7973*(e>>>11);const t=this.version<<12|e;i(t>>>18==0);for(let e=0;e<18;e++){const n=o(t,e),r=this.size-11+e%3,i=Math.floor(e/3);this.setFunctionModule(r,i,n),this.setFunctionModule(i,r,n)}}drawFinderPattern(e,t){for(let n=-4;n<=4;n++)for(let r=-4;r<=4;r++){const o=Math.max(Math.abs(r),Math.abs(n)),i=e+r,a=t+n;0<=i&&i<this.size&&0<=a&&a<this.size&&this.setFunctionModule(i,a,2!=o&&4!=o)}}drawAlignmentPattern(e,t){for(let n=-2;n<=2;n++)for(let r=-2;r<=2;r++)this.setFunctionModule(e+r,t+n,1!=Math.max(Math.abs(r),Math.abs(n)))}setFunctionModule(e,t,n){this.modules[t][e]=n,this.isFunction[t][e]=!0}addEccAndInterleave(e){const n=this.version,r=this.errorCorrectionLevel;if(e.length!=t.getNumDataCodewords(n,r))throw new RangeError("Invalid argument");const o=t.NUM_ERROR_CORRECTION_BLOCKS[r.ordinal][n],a=t.ECC_CODEWORDS_PER_BLOCK[r.ordinal][n],s=Math.floor(t.getNumRawDataModules(n)/8),c=o-s%o,l=Math.floor(s/o);let u=[];const d=t.reedSolomonComputeDivisor(a);for(let n=0,r=0;n<o;n++){let o=e.slice(r,r+l-a+(n<c?0:1));r+=o.length;const i=t.reedSolomonComputeRemainder(o,d);n<c&&o.push(0),u.push(o.concat(i))}let f=[];for(let e=0;e<u[0].length;e++)u.forEach(((t,n)=>{(e!=l-a||n>=c)&&f.push(t[e])}));return i(f.length==s),f}drawCodewords(e){if(e.length!=Math.floor(t.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let n=0;for(let t=this.size-1;t>=1;t-=2){6==t&&(t=5);for(let r=0;r<this.size;r++)for(let i=0;i<2;i++){const a=t-i,s=0==(t+1&2)?this.size-1-r:r;!this.isFunction[s][a]&&n<8*e.length&&(this.modules[s][a]=o(e[n>>>3],7-(7&n)),n++)}}i(n==8*e.length)}applyMask(e){if(e<0||e>7)throw new RangeError("Mask value out of range");for(let t=0;t<this.size;t++)for(let n=0;n<this.size;n++){let r;switch(e){case 0:r=(n+t)%2==0;break;case 1:r=t%2==0;break;case 2:r=n%3==0;break;case 3:r=(n+t)%3==0;break;case 4:r=(Math.floor(n/3)+Math.floor(t/2))%2==0;break;case 5:r=n*t%2+n*t%3==0;break;case 6:r=(n*t%2+n*t%3)%2==0;break;case 7:r=((n+t)%2+n*t%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[t][n]&&r&&(this.modules[t][n]=!this.modules[t][n])}}getPenaltyScore(){let e=0;for(let n=0;n<this.size;n++){let r=!1,o=0,i=[0,0,0,0,0,0,0];for(let a=0;a<this.size;a++)this.modules[n][a]==r?(o++,5==o?e+=t.PENALTY_N1:o>5&&e++):(this.finderPenaltyAddHistory(o,i),r||(e+=this.finderPenaltyCountPatterns(i)*t.PENALTY_N3),r=this.modules[n][a],o=1);e+=this.finderPenaltyTerminateAndCount(r,o,i)*t.PENALTY_N3}for(let n=0;n<this.size;n++){let r=!1,o=0,i=[0,0,0,0,0,0,0];for(let a=0;a<this.size;a++)this.modules[a][n]==r?(o++,5==o?e+=t.PENALTY_N1:o>5&&e++):(this.finderPenaltyAddHistory(o,i),r||(e+=this.finderPenaltyCountPatterns(i)*t.PENALTY_N3),r=this.modules[a][n],o=1);e+=this.finderPenaltyTerminateAndCount(r,o,i)*t.PENALTY_N3}for(let n=0;n<this.size-1;n++)for(let r=0;r<this.size-1;r++){const o=this.modules[n][r];o==this.modules[n][r+1]&&o==this.modules[n+1][r]&&o==this.modules[n+1][r+1]&&(e+=t.PENALTY_N2)}let n=0;for(const e of this.modules)n=e.reduce(((e,t)=>e+(t?1:0)),n);const r=this.size*this.size,o=Math.ceil(Math.abs(20*n-10*r)/r)-1;return i(0<=o&&o<=9),e+=o*t.PENALTY_N4,i(0<=e&&e<=2568888),e}getAlignmentPatternPositions(){if(1==this.version)return[];{const e=Math.floor(this.version/7)+2,t=32==this.version?26:2*Math.ceil((4*this.version+4)/(2*e-2));let n=[6];for(let r=this.size-7;n.length<e;r-=t)n.splice(1,0,r);return n}}static getNumRawDataModules(e){if(e<t.MIN_VERSION||e>t.MAX_VERSION)throw new RangeError("Version number out of range");let n=(16*e+128)*e+64;if(e>=2){const t=Math.floor(e/7)+2;n-=(25*t-10)*t-55,e>=7&&(n-=36)}return i(208<=n&&n<=29648),n}static getNumDataCodewords(e,n){return Math.floor(t.getNumRawDataModules(e)/8)-t.ECC_CODEWORDS_PER_BLOCK[n.ordinal][e]*t.NUM_ERROR_CORRECTION_BLOCKS[n.ordinal][e]}static reedSolomonComputeDivisor(e){if(e<1||e>255)throw new RangeError("Degree out of range");let n=[];for(let t=0;t<e-1;t++)n.push(0);n.push(1);let r=1;for(let o=0;o<e;o++){for(let e=0;e<n.length;e++)n[e]=t.reedSolomonMultiply(n[e],r),e+1<n.length&&(n[e]^=n[e+1]);r=t.reedSolomonMultiply(r,2)}return n}static reedSolomonComputeRemainder(e,n){let r=n.map((e=>0));for(const o of e){const e=o^r.shift();r.push(0),n.forEach(((n,o)=>r[o]^=t.reedSolomonMultiply(n,e)))}return r}static reedSolomonMultiply(e,t){if(e>>>8!=0||t>>>8!=0)throw new RangeError("Byte out of range");let n=0;for(let r=7;r>=0;r--)n=n<<1^285*(n>>>7),n^=(t>>>r&1)*e;return i(n>>>8==0),n}finderPenaltyCountPatterns(e){const t=e[1];i(t<=3*this.size);const n=t>0&&e[2]==t&&e[3]==3*t&&e[4]==t&&e[5]==t;return(n&&e[0]>=4*t&&e[6]>=t?1:0)+(n&&e[6]>=4*t&&e[0]>=t?1:0)}finderPenaltyTerminateAndCount(e,t,n){return e&&(this.finderPenaltyAddHistory(t,n),t=0),t+=this.size,this.finderPenaltyAddHistory(t,n),this.finderPenaltyCountPatterns(n)}finderPenaltyAddHistory(e,t){0==t[0]&&(e+=this.size),t.pop(),t.unshift(e)}};let n=t;function r(e,t,n){if(t<0||t>31||e>>>t!=0)throw new RangeError("Value out of range");for(let r=t-1;r>=0;r--)n.push(e>>>r&1)}function o(e,t){return 0!=(e>>>t&1)}function i(e){if(!e)throw new Error("Assertion error")}n.MIN_VERSION=1,n.MAX_VERSION=40,n.PENALTY_N1=3,n.PENALTY_N2=3,n.PENALTY_N3=40,n.PENALTY_N4=10,n.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],n.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e.QrCode=n;const a=class{constructor(e,t,n){if(this.mode=e,this.numChars=t,this.bitData=n,t<0)throw new RangeError("Invalid argument");this.bitData=n.slice()}static makeBytes(e){let t=[];for(const n of e)r(n,8,t);return new a(a.Mode.BYTE,e.length,t)}static makeNumeric(e){if(!a.isNumeric(e))throw new RangeError("String contains non-numeric characters");let t=[];for(let n=0;n<e.length;){const o=Math.min(e.length-n,3);r(parseInt(e.substr(n,o),10),3*o+1,t),n+=o}return new a(a.Mode.NUMERIC,e.length,t)}static makeAlphanumeric(e){if(!a.isAlphanumeric(e))throw new RangeError("String contains unencodable characters in alphanumeric mode");let t,n=[];for(t=0;t+2<=e.length;t+=2){let o=45*a.ALPHANUMERIC_CHARSET.indexOf(e.charAt(t));o+=a.ALPHANUMERIC_CHARSET.indexOf(e.charAt(t+1)),r(o,11,n)}return t<e.length&&r(a.ALPHANUMERIC_CHARSET.indexOf(e.charAt(t)),6,n),new a(a.Mode.ALPHANUMERIC,e.length,n)}static makeSegments(e){return""==e?[]:a.isNumeric(e)?[a.makeNumeric(e)]:a.isAlphanumeric(e)?[a.makeAlphanumeric(e)]:[a.makeBytes(a.toUtf8ByteArray(e))]}static makeEci(e){let t=[];if(e<0)throw new RangeError("ECI assignment value out of range");if(e<128)r(e,8,t);else if(e<16384)r(2,2,t),r(e,14,t);else{if(!(e<1e6))throw new RangeError("ECI assignment value out of range");r(6,3,t),r(e,21,t)}return new a(a.Mode.ECI,0,t)}static isNumeric(e){return a.NUMERIC_REGEX.test(e)}static isAlphanumeric(e){return a.ALPHANUMERIC_REGEX.test(e)}getData(){return this.bitData.slice()}static getTotalBits(e,t){let n=0;for(const r of e){const e=r.mode.numCharCountBits(t);if(r.numChars>=1<<e)return 1/0;n+=4+e+r.bitData.length}return n}static toUtf8ByteArray(e){e=encodeURI(e);let t=[];for(let n=0;n<e.length;n++)"%"!=e.charAt(n)?t.push(e.charCodeAt(n)):(t.push(parseInt(e.substr(n+1,2),16)),n+=2);return t}};let s=a;s.NUMERIC_REGEX=/^[0-9]*$/,s.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,s.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",e.QrSegment=s})(Cz||(Cz={})),(e=>{let t;(e=>{const t=class{constructor(e,t){this.ordinal=e,this.formatBits=t}};let n=t;n.LOW=new t(0,1),n.MEDIUM=new t(1,0),n.QUARTILE=new t(2,3),n.HIGH=new t(3,2),e.Ecc=n})(t=e.QrCode||(e.QrCode={}))})(Cz||(Cz={})),(e=>{let t;(e=>{const t=class{constructor(e,t){this.modeBits=e,this.numBitsCharCount=t}numCharCountBits(e){return this.numBitsCharCount[Math.floor((e+7)/17)]}};let n=t;n.NUMERIC=new t(1,[10,12,14]),n.ALPHANUMERIC=new t(2,[9,11,13]),n.BYTE=new t(4,[8,16,16]),n.KANJI=new t(8,[8,10,12]),n.ECI=new t(7,[0,0,0]),e.Mode=n})(t=e.QrSegment||(e.QrSegment={}))})(Cz||(Cz={}));var s$=Cz,c$={L:s$.QrCode.Ecc.LOW,M:s$.QrCode.Ecc.MEDIUM,Q:s$.QrCode.Ecc.QUARTILE,H:s$.QrCode.Ecc.HIGH},l$=128,u$="L",d$="#FFFFFF",f$="#000000",p$=!1,h$=4,m$=.1;
18214
+ text:E("common.login"),className:"password",ref:P})))))},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())}))},Gz=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(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},Kz=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},Yz=y().useCallback,Jz=y().useEffect,Zz=y().useState,Qz=y().useMemo,Xz=function(e){var t="".concat(k$,"-qrcode--").concat(e),n=_u().t;return[t,Qz((function(){return{loading:null,ready:null,already:y().createElement(y().Fragment,null,y().createElement(JD,{type:"authing-checkbox-circle-fill",style:{width:"40px",height:"40px"}}),y().createElement("span",{className:"".concat(k$,"-inner__title--already")},n("login.scanSuccess"))),cancel:y().createElement(y().Fragment,null,y().createElement(JD,{type:"authing-refer-qr-code",style:{width:"40px",height:"40px"}}),y().createElement("span",{className:"".concat(k$,"-inner__title--refer")},n("login.qrcodeRefer"))),expired:y().createElement(y().Fragment,null,y().createElement(JD,{type:"authing-refer-qr-code",style:{width:"40px",height:"40px"}}),y().createElement("span",{className:"".concat(k$,"-inner__title--refer")},n("login.qrcodeRefer"))),error:y().createElement(y().Fragment,null,y().createElement(JD,{type:"authing-refer-qr-code",style:{width:"40px",height:"40px"}}),y().createElement("span",{className:"".concat(k$,"-inner__title--refer")},n("login.qrcodeNetWorkError"))),success:y().createElement(y().Fragment,null,y().createElement(JD,{type:"authing-checkbox-circle-fill",style:{width:"40px",height:"40px"}}),y().createElement("span",{className:"".concat(k$,"-inner__title--already")},n("login.scanSuccess"))),MFA:null}[e]}),[e,n])]},e$=Object.defineProperty,t$=Object.getOwnPropertySymbols,n$=Object.prototype.hasOwnProperty,r$=Object.prototype.propertyIsEnumerable,o$=(e,t,n)=>t in e?e$(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,i$=(e,t)=>{for(var n in t||(t={}))n$.call(t,n)&&o$(e,n,t[n]);if(t$)for(var n of t$(t))r$.call(t,n)&&o$(e,n,t[n]);return e},a$=(e,t)=>{var n={};for(var r in e)n$.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&t$)for(var r of t$(e))t.indexOf(r)<0&&r$.call(e,r)&&(n[r]=e[r]);return n};(e=>{const t=class{constructor(e,n,r,o){if(this.version=e,this.errorCorrectionLevel=n,this.modules=[],this.isFunction=[],e<t.MIN_VERSION||e>t.MAX_VERSION)throw new RangeError("Version value out of range");if(o<-1||o>7)throw new RangeError("Mask value out of range");this.size=4*e+17;let a=[];for(let e=0;e<this.size;e++)a.push(!1);for(let e=0;e<this.size;e++)this.modules.push(a.slice()),this.isFunction.push(a.slice());this.drawFunctionPatterns();const s=this.addEccAndInterleave(r);if(this.drawCodewords(s),-1==o){let e=1e9;for(let t=0;t<8;t++){this.applyMask(t),this.drawFormatBits(t);const n=this.getPenaltyScore();n<e&&(o=t,e=n),this.applyMask(t)}}i(0<=o&&o<=7),this.mask=o,this.applyMask(o),this.drawFormatBits(o),this.isFunction=[]}static encodeText(n,r){const o=e.QrSegment.makeSegments(n);return t.encodeSegments(o,r)}static encodeBinary(n,r){const o=e.QrSegment.makeBytes(n);return t.encodeSegments([o],r)}static encodeSegments(e,n,o=1,a=40,c=-1,l=!0){if(!(t.MIN_VERSION<=o&&o<=a&&a<=t.MAX_VERSION)||c<-1||c>7)throw new RangeError("Invalid value");let u,d;for(u=o;;u++){const r=8*t.getNumDataCodewords(u,n),o=s.getTotalBits(e,u);if(o<=r){d=o;break}if(u>=a)throw new RangeError("Data too long")}for(const e of[t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])l&&d<=8*t.getNumDataCodewords(u,e)&&(n=e);let f=[];for(const t of e){r(t.mode.modeBits,4,f),r(t.numChars,t.mode.numCharCountBits(u),f);for(const e of t.getData())f.push(e)}i(f.length==d);const p=8*t.getNumDataCodewords(u,n);i(f.length<=p),r(0,Math.min(4,p-f.length),f),r(0,(8-f.length%8)%8,f),i(f.length%8==0);for(let e=236;f.length<p;e^=253)r(e,8,f);let h=[];for(;8*h.length<f.length;)h.push(0);return f.forEach(((e,t)=>h[t>>>3]|=e<<7-(7&t))),new t(u,n,h,c)}getModule(e,t){return 0<=e&&e<this.size&&0<=t&&t<this.size&&this.modules[t][e]}getModules(){return this.modules}drawFunctionPatterns(){for(let e=0;e<this.size;e++)this.setFunctionModule(6,e,e%2==0),this.setFunctionModule(e,6,e%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const e=this.getAlignmentPatternPositions(),t=e.length;for(let n=0;n<t;n++)for(let r=0;r<t;r++)0==n&&0==r||0==n&&r==t-1||n==t-1&&0==r||this.drawAlignmentPattern(e[n],e[r]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(e){const t=this.errorCorrectionLevel.formatBits<<3|e;let n=t;for(let e=0;e<10;e++)n=n<<1^1335*(n>>>9);const r=21522^(t<<10|n);i(r>>>15==0);for(let e=0;e<=5;e++)this.setFunctionModule(8,e,o(r,e));this.setFunctionModule(8,7,o(r,6)),this.setFunctionModule(8,8,o(r,7)),this.setFunctionModule(7,8,o(r,8));for(let e=9;e<15;e++)this.setFunctionModule(14-e,8,o(r,e));for(let e=0;e<8;e++)this.setFunctionModule(this.size-1-e,8,o(r,e));for(let e=8;e<15;e++)this.setFunctionModule(8,this.size-15+e,o(r,e));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let e=this.version;for(let t=0;t<12;t++)e=e<<1^7973*(e>>>11);const t=this.version<<12|e;i(t>>>18==0);for(let e=0;e<18;e++){const n=o(t,e),r=this.size-11+e%3,i=Math.floor(e/3);this.setFunctionModule(r,i,n),this.setFunctionModule(i,r,n)}}drawFinderPattern(e,t){for(let n=-4;n<=4;n++)for(let r=-4;r<=4;r++){const o=Math.max(Math.abs(r),Math.abs(n)),i=e+r,a=t+n;0<=i&&i<this.size&&0<=a&&a<this.size&&this.setFunctionModule(i,a,2!=o&&4!=o)}}drawAlignmentPattern(e,t){for(let n=-2;n<=2;n++)for(let r=-2;r<=2;r++)this.setFunctionModule(e+r,t+n,1!=Math.max(Math.abs(r),Math.abs(n)))}setFunctionModule(e,t,n){this.modules[t][e]=n,this.isFunction[t][e]=!0}addEccAndInterleave(e){const n=this.version,r=this.errorCorrectionLevel;if(e.length!=t.getNumDataCodewords(n,r))throw new RangeError("Invalid argument");const o=t.NUM_ERROR_CORRECTION_BLOCKS[r.ordinal][n],a=t.ECC_CODEWORDS_PER_BLOCK[r.ordinal][n],s=Math.floor(t.getNumRawDataModules(n)/8),c=o-s%o,l=Math.floor(s/o);let u=[];const d=t.reedSolomonComputeDivisor(a);for(let n=0,r=0;n<o;n++){let o=e.slice(r,r+l-a+(n<c?0:1));r+=o.length;const i=t.reedSolomonComputeRemainder(o,d);n<c&&o.push(0),u.push(o.concat(i))}let f=[];for(let e=0;e<u[0].length;e++)u.forEach(((t,n)=>{(e!=l-a||n>=c)&&f.push(t[e])}));return i(f.length==s),f}drawCodewords(e){if(e.length!=Math.floor(t.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let n=0;for(let t=this.size-1;t>=1;t-=2){6==t&&(t=5);for(let r=0;r<this.size;r++)for(let i=0;i<2;i++){const a=t-i,s=0==(t+1&2)?this.size-1-r:r;!this.isFunction[s][a]&&n<8*e.length&&(this.modules[s][a]=o(e[n>>>3],7-(7&n)),n++)}}i(n==8*e.length)}applyMask(e){if(e<0||e>7)throw new RangeError("Mask value out of range");for(let t=0;t<this.size;t++)for(let n=0;n<this.size;n++){let r;switch(e){case 0:r=(n+t)%2==0;break;case 1:r=t%2==0;break;case 2:r=n%3==0;break;case 3:r=(n+t)%3==0;break;case 4:r=(Math.floor(n/3)+Math.floor(t/2))%2==0;break;case 5:r=n*t%2+n*t%3==0;break;case 6:r=(n*t%2+n*t%3)%2==0;break;case 7:r=((n+t)%2+n*t%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[t][n]&&r&&(this.modules[t][n]=!this.modules[t][n])}}getPenaltyScore(){let e=0;for(let n=0;n<this.size;n++){let r=!1,o=0,i=[0,0,0,0,0,0,0];for(let a=0;a<this.size;a++)this.modules[n][a]==r?(o++,5==o?e+=t.PENALTY_N1:o>5&&e++):(this.finderPenaltyAddHistory(o,i),r||(e+=this.finderPenaltyCountPatterns(i)*t.PENALTY_N3),r=this.modules[n][a],o=1);e+=this.finderPenaltyTerminateAndCount(r,o,i)*t.PENALTY_N3}for(let n=0;n<this.size;n++){let r=!1,o=0,i=[0,0,0,0,0,0,0];for(let a=0;a<this.size;a++)this.modules[a][n]==r?(o++,5==o?e+=t.PENALTY_N1:o>5&&e++):(this.finderPenaltyAddHistory(o,i),r||(e+=this.finderPenaltyCountPatterns(i)*t.PENALTY_N3),r=this.modules[a][n],o=1);e+=this.finderPenaltyTerminateAndCount(r,o,i)*t.PENALTY_N3}for(let n=0;n<this.size-1;n++)for(let r=0;r<this.size-1;r++){const o=this.modules[n][r];o==this.modules[n][r+1]&&o==this.modules[n+1][r]&&o==this.modules[n+1][r+1]&&(e+=t.PENALTY_N2)}let n=0;for(const e of this.modules)n=e.reduce(((e,t)=>e+(t?1:0)),n);const r=this.size*this.size,o=Math.ceil(Math.abs(20*n-10*r)/r)-1;return i(0<=o&&o<=9),e+=o*t.PENALTY_N4,i(0<=e&&e<=2568888),e}getAlignmentPatternPositions(){if(1==this.version)return[];{const e=Math.floor(this.version/7)+2,t=32==this.version?26:2*Math.ceil((4*this.version+4)/(2*e-2));let n=[6];for(let r=this.size-7;n.length<e;r-=t)n.splice(1,0,r);return n}}static getNumRawDataModules(e){if(e<t.MIN_VERSION||e>t.MAX_VERSION)throw new RangeError("Version number out of range");let n=(16*e+128)*e+64;if(e>=2){const t=Math.floor(e/7)+2;n-=(25*t-10)*t-55,e>=7&&(n-=36)}return i(208<=n&&n<=29648),n}static getNumDataCodewords(e,n){return Math.floor(t.getNumRawDataModules(e)/8)-t.ECC_CODEWORDS_PER_BLOCK[n.ordinal][e]*t.NUM_ERROR_CORRECTION_BLOCKS[n.ordinal][e]}static reedSolomonComputeDivisor(e){if(e<1||e>255)throw new RangeError("Degree out of range");let n=[];for(let t=0;t<e-1;t++)n.push(0);n.push(1);let r=1;for(let o=0;o<e;o++){for(let e=0;e<n.length;e++)n[e]=t.reedSolomonMultiply(n[e],r),e+1<n.length&&(n[e]^=n[e+1]);r=t.reedSolomonMultiply(r,2)}return n}static reedSolomonComputeRemainder(e,n){let r=n.map((e=>0));for(const o of e){const e=o^r.shift();r.push(0),n.forEach(((n,o)=>r[o]^=t.reedSolomonMultiply(n,e)))}return r}static reedSolomonMultiply(e,t){if(e>>>8!=0||t>>>8!=0)throw new RangeError("Byte out of range");let n=0;for(let r=7;r>=0;r--)n=n<<1^285*(n>>>7),n^=(t>>>r&1)*e;return i(n>>>8==0),n}finderPenaltyCountPatterns(e){const t=e[1];i(t<=3*this.size);const n=t>0&&e[2]==t&&e[3]==3*t&&e[4]==t&&e[5]==t;return(n&&e[0]>=4*t&&e[6]>=t?1:0)+(n&&e[6]>=4*t&&e[0]>=t?1:0)}finderPenaltyTerminateAndCount(e,t,n){return e&&(this.finderPenaltyAddHistory(t,n),t=0),t+=this.size,this.finderPenaltyAddHistory(t,n),this.finderPenaltyCountPatterns(n)}finderPenaltyAddHistory(e,t){0==t[0]&&(e+=this.size),t.pop(),t.unshift(e)}};let n=t;function r(e,t,n){if(t<0||t>31||e>>>t!=0)throw new RangeError("Value out of range");for(let r=t-1;r>=0;r--)n.push(e>>>r&1)}function o(e,t){return 0!=(e>>>t&1)}function i(e){if(!e)throw new Error("Assertion error")}n.MIN_VERSION=1,n.MAX_VERSION=40,n.PENALTY_N1=3,n.PENALTY_N2=3,n.PENALTY_N3=40,n.PENALTY_N4=10,n.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],n.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e.QrCode=n;const a=class{constructor(e,t,n){if(this.mode=e,this.numChars=t,this.bitData=n,t<0)throw new RangeError("Invalid argument");this.bitData=n.slice()}static makeBytes(e){let t=[];for(const n of e)r(n,8,t);return new a(a.Mode.BYTE,e.length,t)}static makeNumeric(e){if(!a.isNumeric(e))throw new RangeError("String contains non-numeric characters");let t=[];for(let n=0;n<e.length;){const o=Math.min(e.length-n,3);r(parseInt(e.substr(n,o),10),3*o+1,t),n+=o}return new a(a.Mode.NUMERIC,e.length,t)}static makeAlphanumeric(e){if(!a.isAlphanumeric(e))throw new RangeError("String contains unencodable characters in alphanumeric mode");let t,n=[];for(t=0;t+2<=e.length;t+=2){let o=45*a.ALPHANUMERIC_CHARSET.indexOf(e.charAt(t));o+=a.ALPHANUMERIC_CHARSET.indexOf(e.charAt(t+1)),r(o,11,n)}return t<e.length&&r(a.ALPHANUMERIC_CHARSET.indexOf(e.charAt(t)),6,n),new a(a.Mode.ALPHANUMERIC,e.length,n)}static makeSegments(e){return""==e?[]:a.isNumeric(e)?[a.makeNumeric(e)]:a.isAlphanumeric(e)?[a.makeAlphanumeric(e)]:[a.makeBytes(a.toUtf8ByteArray(e))]}static makeEci(e){let t=[];if(e<0)throw new RangeError("ECI assignment value out of range");if(e<128)r(e,8,t);else if(e<16384)r(2,2,t),r(e,14,t);else{if(!(e<1e6))throw new RangeError("ECI assignment value out of range");r(6,3,t),r(e,21,t)}return new a(a.Mode.ECI,0,t)}static isNumeric(e){return a.NUMERIC_REGEX.test(e)}static isAlphanumeric(e){return a.ALPHANUMERIC_REGEX.test(e)}getData(){return this.bitData.slice()}static getTotalBits(e,t){let n=0;for(const r of e){const e=r.mode.numCharCountBits(t);if(r.numChars>=1<<e)return 1/0;n+=4+e+r.bitData.length}return n}static toUtf8ByteArray(e){e=encodeURI(e);let t=[];for(let n=0;n<e.length;n++)"%"!=e.charAt(n)?t.push(e.charCodeAt(n)):(t.push(parseInt(e.substr(n+1,2),16)),n+=2);return t}};let s=a;s.NUMERIC_REGEX=/^[0-9]*$/,s.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,s.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",e.QrSegment=s})(Cz||(Cz={})),(e=>{let t;(e=>{const t=class{constructor(e,t){this.ordinal=e,this.formatBits=t}};let n=t;n.LOW=new t(0,1),n.MEDIUM=new t(1,0),n.QUARTILE=new t(2,3),n.HIGH=new t(3,2),e.Ecc=n})(t=e.QrCode||(e.QrCode={}))})(Cz||(Cz={})),(e=>{let t;(e=>{const t=class{constructor(e,t){this.modeBits=e,this.numBitsCharCount=t}numCharCountBits(e){return this.numBitsCharCount[Math.floor((e+7)/17)]}};let n=t;n.NUMERIC=new t(1,[10,12,14]),n.ALPHANUMERIC=new t(2,[9,11,13]),n.BYTE=new t(4,[8,16,16]),n.KANJI=new t(8,[8,10,12]),n.ECI=new t(7,[0,0,0]),e.Mode=n})(t=e.QrSegment||(e.QrSegment={}))})(Cz||(Cz={}));var s$=Cz,c$={L:s$.QrCode.Ecc.LOW,M:s$.QrCode.Ecc.MEDIUM,Q:s$.QrCode.Ecc.QUARTILE,H:s$.QrCode.Ecc.HIGH},l$=128,u$="L",d$="#FFFFFF",f$="#000000",p$=!1,h$=4,m$=.1;
18215
18215
  // src/index.tsx
18216
18216
  /**
18217
18217
  * @license qrcode.react
@@ -18382,54 +18382,50 @@ var t=null==n?void 0:n.getMemoSingleUser(e);null==r||r("login",t)},handleDel:fun
18382
18382
  // 7.15: 如果仅剩一个需求跳转
18383
18383
  null==r||r("login"):i()}})})),KH=function(){return KH=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},KH.apply(this,arguments)},YH=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())}))},JH=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(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},ZH=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())}))},QH=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(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},XH=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,tW=y().useRef,nW=function(){var e=tW(null),t=XH(cT.useForm(),1)[0],n=dL(),r=GL(),o=eW((function(t){return ZH(void 0,void 0,void 0,(function(){var o,i,a,s,c,l,u,d,f;return QH(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,YH(void 0,void 0,void 0,(function(){return JH(this,(function(e){switch(e.label){case 0:return[4/*yield*/,(0,rQ().authFlow)(h,KH({},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===RZ.RESET_ACCOUNT_NAME?
18384
18384
  // 用户名重复
18385
- 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"},cu.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(VB.UserName,null,y().createElement(oO,{className:"authing-g2-input",size:"large",prefix:y().createElement(JD,{type:"authing-a-user-line1",style:{color:"#878A95"}}),placeholder:cu.t("login.inputUsername")})),y().createElement(cT.Item,{className:"authing-g2-sumbit-form"},y().createElement(Ej,{text:cu.t("common.sure"),className:"password",ref:e}))))},rW=function(){return rW=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},rW.apply(this,arguments)},oW=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},iW=y().useMemo,aW=function(e){var t=e.methods,n=oW(e,["methods"]),r=iL(),o=_u().t,i=iW((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=iW((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=iW((function(){return 1===t.length&&"phone-code"===t[0]?y().createElement(Pq,rW({maxLength:11,placeholder:a},n)):y().createElement(oO,rW({placeholder:a},n,{prefix:y().createElement(JD,{type:"authing-a-user-line1",style:{color:"#878A95"}})}))}),[n,t,a]);return y().createElement(y().Fragment,null,s)},sW=function(){return sW=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},sW.apply(this,arguments)},cW=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())}))},lW=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(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},uW=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},dW=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"}(AH||(AH={}));var fW=y().useCallback,pW=y().useEffect,hW=y().useMemo,mW=y().useRef,vW=y().useState,gW=function(e){var t,n,r,o=iL(),i=pL(),a=lL(),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=null!==(t=null==o?void 0:o.verifyCodeLength)&&void 0!==t?t:4,k=aL().post,S=uj().isPhoneMedia,x=(null===(n=null==o?void 0:o.internationalSmsConfig)||void 0===n?void 0:n.enabled)||!1,P=mW(!1),_=mW([]),T=uW(vW(!1),2),O=T[0],N=T[1],I=uW(vW(""),2),A=I[0],R=I[1],M=uW(vW(l&&null!=u?u:f[0]),2),D=M[0],L=M[1],F=uW(vW(!1),2),j=F[0],B=F[1],q=uW(vW(!1),2),U=q[0],V=q[1],z=uW(vW((null===(r=null==o?void 0:o.internationalSmsConfig)||void 0===r?void 0:r.defaultISOType)||"CN"),2),$=z[0],H=z[1],W=bL("login"),G=uW(vW(""),2),K=G[0],Y=G[1],J=uW(cT.useForm(),1)[0],Z=fW((function(e){1!==f.length&&(pQ("email",e)?L(Tc.EmailCode):
18385
+ 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"},cu.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(VB.UserName,null,y().createElement(oO,{className:"authing-g2-input",size:"large",prefix:y().createElement(JD,{type:"authing-a-user-line1",style:{color:"#878A95"}}),placeholder:cu.t("login.inputUsername")})),y().createElement(cT.Item,{className:"authing-g2-sumbit-form"},y().createElement(Ej,{text:cu.t("common.sure"),className:"password",ref:e}))))},rW=function(){return rW=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},rW.apply(this,arguments)},oW=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},iW=y().useMemo,aW=function(e){var t=e.methods,n=oW(e,["methods"]),r=iL(),o=_u().t,i=iW((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=iW((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=iW((function(){return 1===t.length&&"phone-code"===t[0]?y().createElement(Pq,rW({maxLength:11,placeholder:a},n)):y().createElement(oO,rW({placeholder:a},n,{prefix:y().createElement(JD,{type:"authing-a-user-line1",style:{color:"#878A95"}})}))}),[n,t,a]);return y().createElement(y().Fragment,null,s)},sW=function(){return sW=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},sW.apply(this,arguments)},cW=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())}))},lW=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(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},uW=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},dW=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"}(AH||(AH={}));var fW=y().useCallback,pW=y().useEffect,hW=y().useMemo,mW=y().useRef,vW=y().useState,gW=function(e){var t,n,r,o=iL(),i=pL(),a=lL(),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=null!==(t=null==o?void 0:o.verifyCodeLength)&&void 0!==t?t:4,k=aL().post,S=uj().isPhoneMedia,x=(null===(n=null==o?void 0:o.internationalSmsConfig)||void 0===n?void 0:n.enabled)||!1,P=mW(!1),_=uW(vW(!1),2),T=_[0],O=_[1],N=uW(vW(""),2),I=N[0],A=N[1],R=uW(vW(l&&null!=u?u:f[0]),2),M=R[0],D=R[1],L=uW(vW(!1),2),F=L[0],j=L[1],B=uW(vW(!1),2),q=B[0],U=B[1],V=uW(vW((null===(r=null==o?void 0:o.internationalSmsConfig)||void 0===r?void 0:r.defaultISOType)||"CN"),2),z=V[0],$=V[1],H=bL("login"),W=uW(vW(""),2),G=W[0],K=W[1],Y=uW(cT.useForm(),1)[0],J=fW((function(e){1!==f.length&&(pQ("email",e)?D(Tc.EmailCode):
18386
18386
  // 放开手机号校验 方便同时开启邮箱和短信国际化手机号通过
18387
- L(Tc.PhoneCode))}),[f.length]),Q=fW((function(e){R(e),Z(e)}),[Z]);wz({form:J,way:zs.PhoneCode,formKey:"identify",backfillData:w,isOnlyInternationSms:j,setAreaCode:H,cancelBackfill:l===zs.PhoneCode,changeCurrentMethod:Q});var X=mW(null),ee=_u().t,te=fW((function(e){return j?y().createElement(Mq,sW({},e,{form:J,fieldName:"identify",className:"authing-g2-input g2-send-code-input",autoComplete:"off",size:"large",placeholder:ee("common.inputFourVerifyCode",{length:E}),areaCode:$,prefix:y().createElement(JD,{type:"authing-a-shield-check-line1",style:{color:"#878A95"}}),isInternationSms:x,scene:Ii.SCENE_TYPE_LOGIN,maxLength:E,onSendCodeBefore:function(){return cW(void 0,void 0,void 0,(function(){return lW(this,(function(e){switch(e.label){case 0:return[4/*yield*/,J.validateFields(["identify"])];case 1:return e.sent(),[4/*yield*/,J.validateFields(["captchaCode"])];case 2:return e.sent(),[2/*return*/]}}))}))}})):y().createElement(y().Fragment,null,D===Tc.PhoneCode&&y().createElement(Mq,sW({},e,{isInternationSms:x,className:"authing-g2-input g2-send-code-input",autoComplete:"off",size:"large",placeholder:ee("common.inputFourVerifyCode",{length:E}),areaCode:$,prefix:y().createElement(JD,{type:"authing-a-shield-check-line1",style:{color:"#878A95"}}),scene:Ii.SCENE_TYPE_LOGIN,maxLength:E,form:J,fieldName:"identify",data:A,codeFieldName:"captchaCode",onSendCodeBefore:function(){return cW(void 0,void 0,void 0,(function(){return lW(this,(function(e){switch(e.label){case 0:return[4/*yield*/,J.validateFields(["identify"])];case 1:return e.sent(),[4/*yield*/,J.validateFields(["captchaCode"])];case 2:return e.sent(),[2/*return*/]}}))}))}})),D===Tc.EmailCode&&y().createElement(CU,sW({},e,{className:"authing-g2-input g2-send-code-input",autoComplete:"off",size:"large",placeholder:ee("common.inputFourVerifyCode",{length:E}),prefix:y().createElement(JD,{type:"authing-a-shield-check-line1",style:{color:"#878A95"}}),form:J,fieldName:"identify",scene:Nc.LOGIN_VERIFY_CODE,maxLength:E,data:A,onSendCodeBefore:function(){return cW(void 0,void 0,void 0,(function(){return lW(this,(function(e){switch(e.label){case 0:return[4/*yield*/,J.validateFields(["identify"])];case 1:return e.sent(),[2/*return*/]}}))}))}})))}),[$,D,J,A,x,j,ee,E]);pW((function(){var e;
18387
+ D(Tc.PhoneCode))}),[f.length]),Z=fW((function(e){A(e),J(e)}),[J]);wz({form:Y,way:zs.PhoneCode,formKey:"identify",backfillData:w,isOnlyInternationSms:F,setAreaCode:$,cancelBackfill:l===zs.PhoneCode,changeCurrentMethod:Z});var Q=mW(null),X=_u().t,ee=fW((function(e){return F?y().createElement(Mq,sW({},e,{form:Y,fieldName:"identify",className:"authing-g2-input g2-send-code-input",autoComplete:"off",size:"large",placeholder:X("common.inputFourVerifyCode",{length:E}),areaCode:z,prefix:y().createElement(JD,{type:"authing-a-shield-check-line1",style:{color:"#878A95"}}),isInternationSms:x,scene:Ii.SCENE_TYPE_LOGIN,maxLength:E,onSendCodeBefore:function(){return cW(void 0,void 0,void 0,(function(){return lW(this,(function(e){switch(e.label){case 0:return[4/*yield*/,Y.validateFields(["identify"])];case 1:return e.sent(),[4/*yield*/,Y.validateFields(["captchaCode"])];case 2:return e.sent(),[2/*return*/]}}))}))}})):y().createElement(y().Fragment,null,M===Tc.PhoneCode&&y().createElement(Mq,sW({},e,{isInternationSms:x,className:"authing-g2-input g2-send-code-input",autoComplete:"off",size:"large",placeholder:X("common.inputFourVerifyCode",{length:E}),areaCode:z,prefix:y().createElement(JD,{type:"authing-a-shield-check-line1",style:{color:"#878A95"}}),scene:Ii.SCENE_TYPE_LOGIN,maxLength:E,form:Y,fieldName:"identify",data:I,codeFieldName:"captchaCode",onSendCodeBefore:function(){return cW(void 0,void 0,void 0,(function(){return lW(this,(function(e){switch(e.label){case 0:return[4/*yield*/,Y.validateFields(["identify"])];case 1:return e.sent(),[4/*yield*/,Y.validateFields(["captchaCode"])];case 2:return e.sent(),[2/*return*/]}}))}))}})),M===Tc.EmailCode&&y().createElement(CU,sW({},e,{className:"authing-g2-input g2-send-code-input",autoComplete:"off",size:"large",placeholder:X("common.inputFourVerifyCode",{length:E}),prefix:y().createElement(JD,{type:"authing-a-shield-check-line1",style:{color:"#878A95"}}),form:Y,fieldName:"identify",scene:Nc.LOGIN_VERIFY_CODE,maxLength:E,data:I,onSendCodeBefore:function(){return cW(void 0,void 0,void 0,(function(){return lW(this,(function(e){switch(e.label){case 0:return[4/*yield*/,Y.validateFields(["identify"])];case 1:return e.sent(),[2/*return*/]}}))}))}})))}),[z,M,Y,I,x,F,X,E]);pW((function(){var e;
18388
18388
  // 开启国际化配置且登录方式为手机号码时
18389
- (1===f.length&&"phone-code"===f[0]&&(null===(e=null==o?void 0:o.internationalSmsConfig)||void 0===e?void 0:e.enabled)||C===AH.Phone)&&(B(!0),L(Tc.PhoneCode)),
18389
+ (1===f.length&&"phone-code"===f[0]&&(null===(e=null==o?void 0:o.internationalSmsConfig)||void 0===e?void 0:e.enabled)||C===AH.Phone)&&(j(!0),D(Tc.PhoneCode)),
18390
18390
  // 指定了只用邮箱验证码
18391
- C===AH.Email&&(V(!0),L(Tc.EmailCode))}),[o,f,C]),pW((function(){
18391
+ C===AH.Email&&(U(!0),D(Tc.EmailCode))}),[o,f,C]),pW((function(){
18392
18392
  /** 如果是国外用户池,那么有图形验证码,需要请求图片 */
18393
- W&&Y(Ez(i.host))}),[W,null==i?void 0:i.host]),pW((function(){
18393
+ H&&K(Ez(i.host))}),[H,null==i?void 0:i.host]),pW((function(){
18394
18394
  // 方法发生变化时,图像验证码数据应该清空
18395
- W&&(null==J||J.setFieldsValue({captchaCode:void 0}))}),[J,D,W]);var ne=function(e){return cW(void 0,void 0,void 0,(function(){var t,n,r,a,s,c,l,u;return lW(this,(function(f){switch(f.label){case 0:return t={phone:e.phoneNumber,code:e.code,customData:(null==i?void 0:i.isHost)?CQ(["login_page_context"]):void 0,autoRegister:p,withCustomData:!1,agreementIds:d.length?_.current:void 0},o&&(null===(l=o.internationalSmsConfig)||void 0===l?void 0:l.enabled)&&(t.phoneCountryCode=e.phoneCountryCode),[4/*yield*/,k("/api/v2/login/phone-code",t)];case 1:return n=f.sent(),r=n.code,a=n.data,s=n.onGuardHandling,c=n.message,null===(u=X.current)||void 0===u||u.onSpin(!1),200===r?
18395
+ H&&(null==Y||Y.setFieldsValue({captchaCode:void 0}))}),[Y,M,H]);var te=function(e){return cW(void 0,void 0,void 0,(function(){var t,n,r,a,s,c,l,u;return lW(this,(function(d){switch(d.label){case 0:return t={phone:e.phoneNumber,code:e.code,customData:(null==i?void 0:i.isHost)?CQ(["login_page_context"]):void 0,autoRegister:p,withCustomData:!1},o&&(null===(l=o.internationalSmsConfig)||void 0===l?void 0:l.enabled)&&(t.phoneCountryCode=e.phoneCountryCode),[4/*yield*/,k("/api/v2/login/phone-code",t)];case 1:return n=d.sent(),r=n.code,a=n.data,s=n.onGuardHandling,c=n.message,null===(u=Q.current)||void 0===u||u.onSpin(!1),200===r?
18396
18396
  // props.onLogin(200, data)
18397
18397
  v(a):
18398
18398
  // 向上层抛出错误
18399
- (null==s?void 0:s())===AZ.RENDER_MESSAGE&&m(r,a,c),[2/*return*/]}}))}))},re=function(e){return cW(void 0,void 0,void 0,(function(){var t,n,r,o,a,s,c;return lW(this,(function(l){switch(l.label){case 0:return t={email:e.identify,code:e.code,customData:(null==i?void 0:i.isHost)?CQ(["login_page_context"]):void 0,autoRegister:p,withCustomData:!1,agreementIds:d.length?_.current:void 0},[4/*yield*/,k("/api/v2/login/email-code",t)];case 1:return n=l.sent(),r=n.code,o=n.data,a=n.onGuardHandling,s=n.message,null===(c=X.current)||void 0===c||c.onSpin(!1),200===r?
18399
+ (null==s?void 0:s())===AZ.RENDER_MESSAGE&&m(r,a,c),[2/*return*/]}}))}))},ne=function(e){return cW(void 0,void 0,void 0,(function(){var t,n,r,o,a,s,c;return lW(this,(function(l){switch(l.label){case 0:return t={email:e.identify,code:e.code,customData:(null==i?void 0:i.isHost)?CQ(["login_page_context"]):void 0,autoRegister:p,withCustomData:!1},[4/*yield*/,k("/api/v2/login/email-code",t)];case 1:return n=l.sent(),r=n.code,o=n.data,a=n.onGuardHandling,s=n.message,null===(c=Q.current)||void 0===c||c.onSpin(!1),200===r?
18400
18400
  // props.onLogin(200, data)
18401
18401
  v(o):
18402
18402
  // 向上层抛出错误
18403
- (null==a?void 0:a())===AZ.RENDER_MESSAGE&&m(r,o,s),[2/*return*/]}}))}))},oe=hW((function(){var e,t;return h||(p&&!o.registerDisabled&&(null===(t=null===(e=i.registerMethods)||void 0===e?void 0:e.filter((function(e){
18403
+ (null==a?void 0:a())===AZ.RENDER_MESSAGE&&m(r,o,s),[2/*return*/]}}))}))},re=hW((function(){var e,t;return h||(p&&!o.registerDisabled&&(null===(t=null===(e=i.registerMethods)||void 0===e?void 0:e.filter((function(e){
18404
18404
  // @ts-ignore
18405
- return[Gs.Phone,Gs.EmailCode].includes(e)})))||void 0===t?void 0:t.length)?"".concat(ee("common.login")," / ").concat(ee("common.register")):ee("common.login"))}),[p,h,ee,i.registerMethods,o.registerDisabled]),ie=fW((function(e){return y().createElement(OU,sW({},e,{className:"authing-g2-input",size:"large",areaCode:$,onAreaCodeChange:function(e){H(e),J.getFieldValue(["identify"])&&J.validateFields(["identify"])}}))}),[$,J]),ae=zc();
18405
+ return[Gs.Phone,Gs.EmailCode].includes(e)})))||void 0===t?void 0:t.length)?"".concat(X("common.login")," / ").concat(X("common.register")):X("common.login"))}),[p,h,X,i.registerMethods,o.registerDisabled]),oe=fW((function(e){return y().createElement(OU,sW({},e,{className:"authing-g2-input",size:"large",areaCode:z,onAreaCodeChange:function(e){$(e),Y.getFieldValue(["identify"])&&Y.validateFields(["identify"])}}))}),[z,Y]),ie=zc();
18406
18406
  // 邮箱验证码登录
18407
- return y().createElement("div",{className:"authing-g2-login-phone-code"},y().createElement(cT,{name:"phoneCode",form:J,onFinish:function(t){return cW(void 0,void 0,void 0,(function(){var n,r,o,i,a,s,c,l,u,f,p,h,g,y,w;return lW(this,(function(C){switch(C.label){case 0:return N(!0),(null==d?void 0:d.length)&&!P.current?(
18407
+ return y().createElement("div",{className:"authing-g2-login-phone-code"},y().createElement(cT,{name:"phoneCode",form:Y,onFinish:function(t){return cW(void 0,void 0,void 0,(function(){var n,r,o,i,a,s,c,l,u,f,p,h,g,y,w;return lW(this,(function(C){switch(C.label){case 0:return O(!0),(null==d?void 0:d.length)&&!P.current?(
18408
18408
  // message.error(t('common.loginProtocolTips'))
18409
- X.current.onError(),[2/*return*/]):(n=dj(x,t.identify,$),r=n.phoneNumber,o=n.countryCode,
18409
+ Q.current.onError(),[2/*return*/]):(n=dj(x,t.identify,z),r=n.phoneNumber,o=n.countryCode,
18410
18410
  // onBeforeLogin
18411
- null===(p=X.current)||void 0===p||p.onSpin(!0),i={type:D,data:{identity:r,code:t.code,phoneCountryCode:o}},[4/*yield*/,null===(h=e.onBeforeLogin)||void 0===h?void 0:h.call(e,i)]);case 1:return!C.sent()&&e.onBeforeLogin?(null===(g=X.current)||void 0===g||g.onSpin(!1),[2/*return*/]):e.onLoginRequest?[4/*yield*/,null===(y=e.onLoginRequest)||void 0===y?void 0:y.call(e,i)]:[3/*break*/,3];case 2:return a=C.sent(),s=a.code,c=a.apiCode,l=a.data,u=a.onGuardHandling,f=a.message,null===(w=X.current)||void 0===w||w.onSpin(!1),200===s?v(l):
18411
+ null===(p=Q.current)||void 0===p||p.onSpin(!0),i={type:M,data:{identity:M===Tc.EmailCode?t.identify:r,code:t.code,phoneCountryCode:o}},[4/*yield*/,null===(h=e.onBeforeLogin)||void 0===h?void 0:h.call(e,i)]);case 1:return!C.sent()&&e.onBeforeLogin?(null===(g=Q.current)||void 0===g||g.onSpin(!1),[2/*return*/]):e.onLoginRequest?[4/*yield*/,null===(y=e.onLoginRequest)||void 0===y?void 0:y.call(e,i)]:[3/*break*/,3];case 2:return a=C.sent(),s=a.code,c=a.apiCode,l=a.data,u=a.onGuardHandling,f=a.message,null===(w=Q.current)||void 0===w||w.onSpin(!1),200===s?v(l):
18412
18412
  // 向上层抛出错误 执行绑定失败钩子
18413
18413
  (null==u?void 0:u())===AZ.RENDER_MESSAGE&&m(null!=c?c:s,l,f),[2/*return*/];case 3:
18414
18414
  // 其实这里应该是保存两个 一个是 countryCode 一个是对应的 code
18415
- return b&&b.setLoginWay("input","phone-code"===D?"phone-code":"email-code",void 0,x?{phoneCountryCode:o,areaCode:$}:void 0),"phone-code"!==D?[3/*break*/,5]:[4/*yield*/,ne(sW(sW({},t),{phoneNumber:r,phoneCountryCode:o}))];case 4:return C.sent(),[3/*break*/,7];case 5:return[4/*yield*/,re(t)];case 6:C.sent(),C.label=7;case 7:return[2/*return*/]}}))}))},onFinishFailed:function(){return X.current.onError()},autoComplete:"off",onValuesChange:function(e){(null==e?void 0:e.identify)&&g&&g(zs.PhoneCode,null==e?void 0:e.identify)}},y().createElement(PV,{initialValue:l===zs.PhoneCode?c:"phone"!==C&&x||!ae?"":ae,name:"identify",className:j?"authing-g2-input-form remove-padding":"authing-g2-input-form",methods:f,checkExist:!p,currentMethod:D,areaCode:$},j?y().createElement(ie,{autoFocus:!S}):y().createElement(aW,{className:"authing-g2-input",size:"large",autoFocus:!S,value:A,methods:U?["email-code"]:f,onChange:function(e){var t=e.target.value;Z(t)},onBlur:function(e){var t=e.target.value;Z(t)},prefix:y().createElement(JD,{type:"authing-a-user-line1",style:{color:"#878A95"}})})),W&&D===Tc.PhoneCode&&y().createElement(cT.Item,{className:"authing-g2-input-form",validateTrigger:["onBlur","onChange"],name:"captchaCode",rules:hQ(ee("common.captchaCode"))},y().createElement(sz,{className:"authing-g2-input",size:"large",placeholder:ee("login.inputCaptchaCode"),verifyCodeUrl:K,changeCode:function(){return Y(Ez(i.host))}})),y().createElement(cT.Item,{validateTrigger:["onBlur","onChange"],className:"authing-g2-input-form",name:"code",rules:dW([],uW(hQ(ee("common.captchaCode"))),!1)},y().createElement(te,null)),Boolean(null==d?void 0:d.length)&&y().createElement(mz,{
18416
- // onChange={val => {
18417
- // acceptedAgreements.current = val
18418
- // }}
18419
- onChange:function(e,t){P.current=e,_.current=t},agreements:d,showError:O}),y().createElement(cT.Item,{className:"authing-g2-sumbit-form"},y().createElement(Ej,{text:oe,className:"password",ref:X}))))};// CONCATENATED MODULE: ./src/Login/core/withAuthingOtpPush/PushLoginGuideSelector.tsx
18415
+ return b&&b.setLoginWay("input","phone-code"===M?"phone-code":"email-code",void 0,x?{phoneCountryCode:o,areaCode:z}:void 0),"phone-code"!==M?[3/*break*/,5]:[4/*yield*/,te(sW(sW({},t),{phoneNumber:r,phoneCountryCode:o}))];case 4:return C.sent(),[3/*break*/,7];case 5:return[4/*yield*/,ne(t)];case 6:C.sent(),C.label=7;case 7:return[2/*return*/]}}))}))},onFinishFailed:function(){return Q.current.onError()},autoComplete:"off",onValuesChange:function(e){(null==e?void 0:e.identify)&&g&&g(zs.PhoneCode,null==e?void 0:e.identify)}},y().createElement(PV,{initialValue:l===zs.PhoneCode?c:"phone"!==C&&x||!ie?"":ie,name:"identify",className:F?"authing-g2-input-form remove-padding":"authing-g2-input-form",methods:f,checkExist:!p,currentMethod:M,areaCode:z},F?y().createElement(oe,{autoFocus:!S}):y().createElement(aW,{className:"authing-g2-input",size:"large",autoFocus:!S,value:I,methods:q?["email-code"]:f,onChange:function(e){var t=e.target.value;J(t)},onBlur:function(e){var t=e.target.value;J(t)},prefix:y().createElement(JD,{type:"authing-a-user-line1",style:{color:"#878A95"}})})),H&&M===Tc.PhoneCode&&y().createElement(cT.Item,{className:"authing-g2-input-form",validateTrigger:["onBlur","onChange"],name:"captchaCode",rules:hQ(X("common.captchaCode"))},y().createElement(sz,{className:"authing-g2-input",size:"large",placeholder:X("login.inputCaptchaCode"),verifyCodeUrl:G,changeCode:function(){return K(Ez(i.host))}})),y().createElement(cT.Item,{validateTrigger:["onBlur","onChange"],className:"authing-g2-input-form",name:"code",rules:dW([],uW(hQ(X("common.captchaCode"))),!1)},y().createElement(ee,null)),Boolean(null==d?void 0:d.length)&&y().createElement(mz,{onChange:function(e){P.current=e},agreements:d,showError:T}),y().createElement(cT.Item,{className:"authing-g2-sumbit-form"},y().createElement(Ej,{text:re,className:"password",ref:Q}))))};// CONCATENATED MODULE: ./src/Login/core/withAuthingOtpPush/PushLoginGuideSelector.tsx
18420
18416
  function yW(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
18421
18417
  var bW=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},wW=y().useEffect,CW=y().useState;function EW(e){var t=e.src,n=e.placeholder,r=e.className,o=e.style,i=e.alt,a=e.width,s=e.height,c=bW(CW(!1),2),l=c[0],u=c[1],d=new Image(0,0);return d.src=t,wW((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
18422
18418
  var kW=y().useMemo;function SW(){var e=_u().t,t=pL(),n=iL(),r=sL(),o=kW((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(EW,{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(EW,{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(EW,{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(EW,{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(b$,{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(EW,{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
18423
18419
  function xW(){var e=_u().t;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.inputAccountInWeb"))),y().createElement("div",{className:"desc"},e("login.clickLoginButton")),y().createElement("div",{className:"qrcode-container center grey"},y().createElement(EW,{src:"https://files.authing.co/authing-guard/push-login-input-account.svg",placeholder:y().createElement(CI,null),className:"qrcode-verifier",alt:e("login.clickLoginButton")}))),y().createElement("div",{className:"guide-step"},y().createElement("div",{className:"title"},y().createElement("span",{className:"dot"}),y().createElement("span",null,"2. ",e("login.receiveMessageInApp"))),y().createElement("div",{className:"desc"},e("login.confirmLoginInApp")),y().createElement("div",{className:"qrcode-container center grey"},y().createElement(EW,{src:"https://files.authing.co/authing-guard/push-login-receive-message-in-app.svg",placeholder:y().createElement(CI,null),className:"qrcode-verifier",alt:e("login.confirmLoginInApp")}))))}// CONCATENATED MODULE: ./src/Login/core/withAuthingOtpPush/HowGetAppLoginUrl.tsx
18424
18420
  function PW(){var e=_u().t;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.getCodeFromAdmin"))),y().createElement("div",{className:"desc"},e("login.getCodeFromAdminTips")),y().createElement("div",{className:"qrcode-container center grey"},y().createElement(EW,{src:"https://files.authing.co/authing-guard/push-login-get-associated-qrcode-from-admin.svg",placeholder:y().createElement(CI,null),className:"qrcode-verifier",alt:e("login.getCodeFromAdmin")}))),y().createElement("div",{className:"guide-step"},y().createElement("div",{className:"title"},y().createElement("span",{className:"dot"}),y().createElement("span",null,"2. ",e("login.getCodeFromPersonalCenter"))),y().createElement("div",{className:"desc"},e("login.getCodeFromPersonalCenterTips")),y().createElement("div",{className:"qrcode-container center grey"},y().createElement(EW,{src:"https://files.authing.co/authing-guard/push-login-get-code-from-personal.svg",placeholder:y().createElement(CI,null),className:"qrcode-verifier",alt:e("login.getCodeFromPersonalCenter")}))),y().createElement("div",{className:"guide-step"},y().createElement("div",{className:"title"},y().createElement("span",{className:"dot"}),y().createElement("span",null,"3. ",e("login.getLoginUrlFromConsole"))),y().createElement("div",{className:"desc"},e("login.getLoginUrlFromConsoleTips")),y().createElement("div",{className:"qrcode-container center grey"},y().createElement(EW,{src:"https://files.authing.co/authing-guard/push-login-get-login-url-from-console.png",placeholder:y().createElement(CI,null),className:"qrcode-verifier",alt:e("login.getLoginUrlFromConsole")}))))}// CONCATENATED MODULE: ./src/Login/core/withAuthingOtpPush/PushLoginGuideModal.tsx
18425
18421
  var _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},TW=y().useMemo,OW=y().useState;function NW(e){var t=e.visible,n=e.onClose,r=_u().t,o=r("login.howBindClient"),i=r("login.howGetAppLoginUrl"),a=r("login.howUsePushLogin"),s=_W(OW("howUsePushLogin"),2),c=s[0],l=s[1],u=uj().isPhoneMedia,d=TW((function(){return[{value:"howUsePushLogin",label:a},{value:"howBindClient",label:o},{value:"howGetAppLoginUrl",label:i}]}),[a,o,i]),f={howBindClient:y().createElement(SW,null),howGetAppLoginUrl:y().createElement(PW,null),howUsePushLogin:y().createElement(xW,null)};return y().createElement(zS,{title:y().createElement(yW,{defaultValue:"howUsePushLogin",onChange:function(e){var t=d.find((function(t){return t.value===e}));t&&l(t.value)},options:d}),placement:"right",onClose:n,open:t,width:u?"375":"640",closeIcon:y().createElement(JD,{type:"authing-close-line"})},f[c])}// CONCATENATED MODULE: ./src/Login/core/withAuthingOtpPush/BeforeLogin.tsx
18426
- var IW=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())}))},AW=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(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},RW=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},MW=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))},DW=y().useMemo,LW=y().useRef,FW=y().useState;function jW(e){var t,n=this,r=e.onPushSuccess,o=e.signinByPush,i=e.pushLoginStatus,a=e.setAccount,s=e.agreements,c=uj().isPhoneMedia,l=_u().t,u=pL(),d=iL(),f=gL(),p=RW(cT.useForm(),1)[0],h=RW(FW(!1),2),m=h[0],v=h[1],g=RW(FW([]),2),b=g[0],w=g[1],C=RW(FW(!1),2),E=C[0],k=C[1],S=LW(null),x=DW((function(){var e=new Map;return d.tabMethodsFields.forEach((function(t){e.set(t.key,t)})),e}),[d.tabMethodsFields]),P=RW(FW(!1),2),_=P[0],T=P[1],O=DW((function(){var e,t=(null===(e=d.authingOtpPushTabConfig)||void 0===e?void 0:e.validLoginMethods)||[];
18422
+ var IW=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())}))},AW=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(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},RW=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},MW=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))},DW=y().useMemo,LW=y().useRef,FW=y().useState;function jW(e){var t,n=this,r=e.onPushSuccess,o=e.signinByPush,i=e.pushLoginStatus,a=e.setAccount,s=e.agreements,c=uj().isPhoneMedia,l=_u().t,u=pL(),d=iL(),f=gL(),p=RW(cT.useForm(),1)[0],h=RW(FW(!1),2),m=h[0],v=h[1],g=RW(FW(!1),2),b=g[0],w=g[1],C=LW(null),E=DW((function(){var e=new Map;return d.tabMethodsFields.forEach((function(t){e.set(t.key,t)})),e}),[d.tabMethodsFields]),k=RW(FW(!1),2),S=k[0],x=k[1],P=DW((function(){var e,t=(null===(e=d.authingOtpPushTabConfig)||void 0===e?void 0:e.validLoginMethods)||[];
18427
18423
  // 登录注册合并
18428
- return(null==u?void 0:u.autoRegister)?l("login.inputAccount",{text:jQ(t,x,f)}):l("login.inputAccount",{text:jQ(MW([],RW(t),!1),x,f)});
18424
+ return(null==u?void 0:u.autoRegister)?l("login.inputAccount",{text:jQ(t,E,f)}):l("login.inputAccount",{text:jQ(MW([],RW(t),!1),E,f)});
18429
18425
  // 登录注册分页
18430
- }),[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(JD,{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(JD,{type:"authing-close-line",className:"close-line"}))),y().createElement(cT,{onFinish:function(e){return IW(n,void 0,void 0,(function(){return AW(this,(function(t){return function(e){IW(n,void 0,void 0,(function(){var t,n,i,c;return AW(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(oO,{className:"authing-g2-input",autoComplete:"off",size:"large",autoFocus:!c,placeholder:O,prefix:y().createElement(JD,{type:"authing-a-user-line1",style:{color:"#878A95"}})})),Boolean(null==s?void 0:s.length)&&y().createElement(mz,{agreements:s,showError:E,onChange:function(e,t){v(e),w(t)}}),y().createElement(cT.Item,{className:"authing-g2-sumbit-form"},y().createElement(Ej,{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(NW,{visible:_,onClose:function(){T(!1)}}))}// CONCATENATED MODULE: ./src/Login/core/withAuthingOtpPush/PendingLogin.tsx
18426
+ }),[null==u?void 0:u.autoRegister,E,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(JD,{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(JD,{type:"authing-close-line",className:"close-line"}))),y().createElement(cT,{onFinish:function(e){return IW(n,void 0,void 0,(function(){return AW(this,(function(t){return function(e){IW(n,void 0,void 0,(function(){var t,n,i,c;return AW(this,(function(u){switch(u.label){case 0:return w(!0),(null==s?void 0:s.length)&&!m?(null==C||C.current.onError(),[2/*return*/]):e?[4/*yield*/,o({account:e})]:[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(oO,{className:"authing-g2-input",autoComplete:"off",size:"large",autoFocus:!c,placeholder:P,prefix:y().createElement(JD,{type:"authing-a-user-line1",style:{color:"#878A95"}})})),Boolean(null==s?void 0:s.length)&&y().createElement(mz,{agreements:s,showError:b,onChange:v}),y().createElement(cT.Item,{className:"authing-g2-sumbit-form"},y().createElement(Ej,{text:l("login.loginText"),htmlType:"submit",ref:C}))),y().createElement("div",{className:"how-use-push-login",onClick:function(){x(!0)}},l("login.howUsePushLogin"),"?"),y().createElement(NW,{visible:S,onClose:function(){x(!1)}}))}// CONCATENATED MODULE: ./src/Login/core/withAuthingOtpPush/PendingLogin.tsx
18431
18427
  function BW(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(JD,{type:"authing-checkbox-circle-fill"})),y().createElement("div",null,t("login.otpLoginPendingText"))),y().createElement(cT,null,y().createElement(cT.Item,{className:"authing-g2-sumbit-form"},y().createElement(ly,{block:!0,style:{width:"348px",height:"44px",background:"#F2F3F5",borderRadius:"4px",border:"none"},onClick:function(){e.onCancelLogin()}},t("login.authingOtpPushCancelLogin")))))}// CONCATENATED MODULE: ./src/Login/core/withAuthingOtpPush/index.tsx
18432
- var qW=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())}))},UW=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(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},VW=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},zW=y().useCallback,$W=y().useEffect,HW=y().useRef,WW=y().useState;function GW(e){var t=this,n=e.onLoginSuccess,r=e.multipleInstance,o=e.agreements,i=VW(WW("before"),2),a=i[0],s=i[1],c=VW(WW(""),2),l=c[0],u=c[1],d=VW(WW(!0),2),f=d[0],p=d[1],h=HW(),m=VW(WW(""),2),v=m[0],g=m[1],b=function(){h.current&&clearInterval(h.current)},w=oQ(),C=w.post,E=w.get,k=iL(),S=zW((function(){b(),s("before")}),[]),x=zW((function(e){void 0===e&&(e=!0),p(e)}),[]),P=zW((function(e){return qW(t,void 0,void 0,(function(){var t,n;return UW(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]),_=zW((function(e){return qW(t,void 0,void 0,(function(){var t;return UW(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 qW(t,void 0,void 0,(function(){var e,t,o,i,a,s,c,u,d;return UW(this,(function(f){switch(f.label){case 0:return[4/*yield*/,P({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*/,_(a)]);case 2:if(s=f.sent(),c=s.code,u=s.data,d=s.message,200===c)return null==r||r.setLoginWay("input",zs.AuthingOtpPush),n(u,d),[2/*return*/];f.label=3;case 3:return"PUSHED"!==o.status&&(p(!1),S()),[2/*return*/]}}))}))};$W((function(){if(l)return h.current=setInterval(T,1e3),function(){b()}}),[l,P,_,n,S]);var O={before:y().createElement(jW,{defaultAccount:v,setAccount:g,onPushSuccess:function(e){s("pending"),u(e.pushCodeId)},signinByPush:function(e){return qW(t,void 0,void 0,(function(){var t,n;return UW(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(BW,{onCancelLogin:S})};return y().createElement("div",null,O[a])}// CONCATENATED MODULE: ./src/Login/socialLogin/postMessage.ts
18428
+ var qW=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())}))},UW=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(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},VW=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},zW=y().useCallback,$W=y().useEffect,HW=y().useRef,WW=y().useState;function GW(e){var t=this,n=e.onLoginSuccess,r=e.multipleInstance,o=e.agreements,i=VW(WW("before"),2),a=i[0],s=i[1],c=VW(WW(""),2),l=c[0],u=c[1],d=VW(WW(!0),2),f=d[0],p=d[1],h=HW(),m=VW(WW(""),2),v=m[0],g=m[1],b=function(){h.current&&clearInterval(h.current)},w=oQ(),C=w.post,E=w.get,k=iL(),S=zW((function(){b(),s("before")}),[]),x=zW((function(e){void 0===e&&(e=!0),p(e)}),[]),P=zW((function(e){return qW(t,void 0,void 0,(function(){var t,n;return UW(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]),_=zW((function(e){return qW(t,void 0,void 0,(function(){var t;return UW(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 qW(t,void 0,void 0,(function(){var e,t,o,i,a,s,c,u,d;return UW(this,(function(f){switch(f.label){case 0:return[4/*yield*/,P({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*/,_(a)]);case 2:if(s=f.sent(),c=s.code,u=s.data,d=s.message,200===c)return null==r||r.setLoginWay("input",zs.AuthingOtpPush),n(u,d),[2/*return*/];f.label=3;case 3:return"PUSHED"!==o.status&&(p(!1),S()),[2/*return*/]}}))}))};$W((function(){if(l)return h.current=setInterval(T,1e3),function(){b()}}),[l,P,_,n,S]);var O={before:y().createElement(jW,{defaultAccount:v,setAccount:g,onPushSuccess:function(e){s("pending"),u(e.pushCodeId)},signinByPush:function(e){return qW(t,void 0,void 0,(function(){var t;return UW(this,(function(n){switch(n.label){case 0:return t=e.account,"/api/v3/signin-by-push",[4/*yield*/,C("/api/v3/signin-by-push",{account:t})];case 1:return[2/*return*/,n.sent()]}}))}))},pushLoginStatus:f,onchangePushLoginStatus:x,agreements:o}),pending:y().createElement(BW,{onCancelLogin:S})};return y().createElement("div",null,O[a])}// CONCATENATED MODULE: ./src/Login/socialLogin/postMessage.ts
18433
18429
  // 处理所有使用 postMessage 方式的登录
18434
18430
  var KW=function(){return KW=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},KW.apply(this,arguments)},YW=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())}))},JW=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(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},ZW=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},QW=SL(),XW=y().useCallback,eG=y().useEffect,tG=y().useState,nG=(y().useMemo,function(e){var t=e.QRConfig,n=e.id,r=window.WwLogin,o=ZW(tG(!0),2),i=o[0],a=o[1],s=aL().get,c=cL(),l=sL(),u=pL(),d=iL(),f=dL(),p=GL(),h=XW((function(){return YW(void 0,void 0,void 0,(function(){var e,o,i,s;return JW(this,(function(f){return e=KW({from_guard:"1",app_id:l,guard_version:"Guard@".concat(QW)},c&&{tenant_id:c}),(null==u?void 0:u.isHost)&&(delete e.from_guard,e.from_hosted_guard="1",Vc()&&(e.redirected="1",(o=zQ())&&(
18435
18431
  // 如果 isHost 是 true,则从 url 获取 finish_login_url 作为 social.authorize 方法的 targetUrl 参数
@@ -18596,41 +18592,41 @@ null===(g=s.current)||void 0===g||g.onError(),[3/*break*/,6];case 5:return null=
18596
18592
  // 开关控制 如果没有 register 就不开启了
18597
18593
  return!!iL().complateFiledsPlace.includes("register")&&(
18598
18594
  // 排除掉已有的字段
18599
- !(!Boolean(md()(t,e))||0===t.length)&&(1!==t.length||t[0].name!==e))},_Y=function(){return _Y=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},_Y.apply(this,arguments)},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())}))},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(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},NY=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},IY=y().useRef,AY=y().useState,RY=y().useCallback,MY=y().useMemo,DY=y().useEffect,LY=function(e){var t,n,r,o,i=e.label,a=e.method,s=e.onRegisterSuccess,c=e.onRegisterFailed,l=e.onBeforeRegister,u=e.agreements,d=e.registeContext,f=e.publicConfig,p=_u().t,h=IY(null),m=uj().isPhoneMedia,v=GL(),g=NY(cT.useForm(),1)[0],b=pL(),w=PY((a||"email").split("-")[0]),C=fL().changeModule,E=aL().post,k=bL("register"),S=NY(AY(!1),2),x=S[0],P=S[1],_=IY([]),T=NY(AY(!1),2),O=T[0],N=T[1],I=NY(AY(""),2),A=I[0],R=I[1],M=NY(AY((null===(t=null==f?void 0:f.internationalSmsConfig)||void 0===t?void 0:t.defaultISOType)||"CN"),2),D=M[0],L=M[1],F=(null===(n=null==f?void 0:f.internationalSmsConfig)||void 0===n?void 0:n.enabled)||!1,j=!b.autoRegister&&(null==f?void 0:f.enabledPPRegisterValid),B=null!==(r=null==f?void 0:f.verifyCodeLength)&&void 0!==r?r:4,q=KB(),U=q.getPassWordUnsafeText,V=q.setPasswordErrorTextShow,z=NY(tj((function(e){return TY(void 0,void 0,void 0,(function(){var t,n,r,o,i,f,p,m,g,y,k,S,P,T,O,I,A,R,M,L,B,q;return OY(this,(function(U){switch(U.label){case 0:if(null===(L=h.current)||void 0===L||L.onSpin(!0),!l)return[3/*break*/,4];U.label=1;case 1:return U.trys.push([1,3,,4]),[4/*yield*/,l({type:Ti.Email,data:{identity:e.email||e.account,password:e.password,code:e.code}},v)];case 2:return U.sent()?[3/*break*/,4]:(null===(B=h.current)||void 0===B||B.onSpin(!1),[2/*return*/]);case 3:return"string"==typeof(t=U.sent())?gC.error(t):gC.error(null==t?void 0:t.message),null===(q=h.current)||void 0===q||q.onSpin(!1),[2/*return*/];case 4:
18595
+ !(!Boolean(md()(t,e))||0===t.length)&&(1!==t.length||t[0].name!==e))},_Y=function(){return _Y=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},_Y.apply(this,arguments)},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())}))},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(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},NY=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},IY=y().useRef,AY=y().useState,RY=y().useCallback,MY=y().useMemo,DY=y().useEffect,LY=function(e){var t,n,r,o,i=e.label,a=e.method,s=e.onRegisterSuccess,c=e.onRegisterFailed,l=e.onBeforeRegister,u=e.agreements,d=e.registeContext,f=e.publicConfig,p=_u().t,h=IY(null),m=uj().isPhoneMedia,v=GL(),g=NY(cT.useForm(),1)[0],b=pL(),w=PY((a||"email").split("-")[0]),C=fL().changeModule,E=aL().post,k=bL("register"),S=NY(AY(!1),2),x=S[0],P=S[1],_=NY(AY(!1),2),T=_[0],O=_[1],N=NY(AY(""),2),I=N[0],A=N[1],R=NY(AY((null===(t=null==f?void 0:f.internationalSmsConfig)||void 0===t?void 0:t.defaultISOType)||"CN"),2),M=R[0],D=R[1],L=(null===(n=null==f?void 0:f.internationalSmsConfig)||void 0===n?void 0:n.enabled)||!1,F=!b.autoRegister&&(null==f?void 0:f.enabledPPRegisterValid),j=null!==(r=null==f?void 0:f.verifyCodeLength)&&void 0!==r?r:4,B=KB(),q=B.getPassWordUnsafeText,U=B.setPasswordErrorTextShow,V=NY(tj((function(e){return TY(void 0,void 0,void 0,(function(){var t,n,r,o,i,f,p,m,g,y,k,S,P,_,T,N,I,A,R,D,j,B;return OY(this,(function(q){switch(q.label){case 0:if(null===(D=h.current)||void 0===D||D.onSpin(!0),!l)return[3/*break*/,4];q.label=1;case 1:return q.trys.push([1,3,,4]),[4/*yield*/,l({type:Ti.Email,data:{identity:e.email||e.account,password:e.password,code:e.code}},v)];case 2:return q.sent()?[3/*break*/,4]:(null===(j=h.current)||void 0===j||j.onSpin(!1),[2/*return*/]);case 3:return"string"==typeof(t=q.sent())?gC.error(t):gC.error(null==t?void 0:t.message),null===(B=h.current)||void 0===B||B.onSpin(!1),[2/*return*/];case 4:
18600
18596
  // await form.validateFields()
18601
- return N(!0),(null==u?void 0:u.length)&&!x?(h.current.onError(),[2/*return*/]):(n=e.email,r=e.password,o=e.account,[4/*yield*/,(0,v.options.encryptFunction)(r,b.publicKey)]);case 5:return i=U.sent(),f=null!=d?d:{},"phone-password"===a&&(y=dj(F,o,D),k=y.phoneNumber,S=y.countryCode,o=k,p=S,j&&(m=null==e?void 0:e.code,g={phone:k})),P={account:o,email:n,password:i,phoneCountryCode:p,profile:_Y({browser:"undefined"!=typeof navigator?navigator.userAgent:null,device:mQ()},g),forceLogin:!1,generateToken:!0,clientIp:void 0,params:(null==b?void 0:b.isHost)?JSON.stringify(CQ(["login_page_context"])):void 0,context:JSON.stringify(f),phoneToken:m,agreementIds:u.length?_.current:void 0},T=function(e){s(e,{registerFrom:Ti.Email,account:n||o})},w?(null==C||C(DL.REGISTER_COMPLETE_INFO,{businessRequestName:a||"registerByEmail",content:_Y({},P),onRegisterSuccess:T,onRegisterFailed:c}),[2/*return*/]):[4/*yield*/,E("/api/v2/register-".concat((a||"email").split("-")[0]),_Y(_Y({},P),{postUserInfoPipeline:!1}))];case 6:return O=U.sent(),I=O.statusCode,A=O.data,R=O.message,M=O.apiCode,200===I?T(A):(M===RZ.UNSAFE_PASSWORD_TIP&&V(!0),h.current.onError(),c(M,A,R),gC.error(R)),[2/*return*/]}}))}))}),[g,x,D],{loading:!1}),2),$=z[1],H=RY((function(e){var t;return f&&(null===(t=f.internationalSmsConfig)||void 0===t?void 0:t.enabled)?y().createElement(OU,_Y({},e,{className:"authing-g2-input",size:"large",areaCode:D,onAreaCodeChange:function(e){L(e),g.getFieldValue(["phone"])&&g.validateFields(["phone"])},maxLength:20})):y().createElement(Pq,_Y({},e,{className:"authing-g2-input",size:"large",placeholder:p("login.inputPhone"),prefix:y().createElement(JD,{type:"authing-a-user-line1",style:{color:"#878A95"}}),maxLength:11}))}),[D,g,f,p]),W=RY((function(e){return F?y().createElement(Mq,_Y({},e,{isInternationSms:F,form:g,fieldName:"account",className:"authing-g2-input g2-send-code-input",autoComplete:"off",size:"large",placeholder:p("common.inputFourVerifyCode",{length:B}),areaCode:D,prefix:y().createElement(JD,{type:"authing-a-shield-check-line1",style:{color:"#878A95"}}),scene:Ii.SCENE_TYPE_REGISTER,maxLength:B,codeFieldName:"captchaCode",onSendCodeBefore:function(){return TY(void 0,void 0,void 0,(function(){return OY(this,(function(e){switch(e.label){case 0:return[4/*yield*/,g.validateFields(["account"])];case 1:return e.sent(),[4/*yield*/,g.validateFields(["captchaCode"])];case 2:return e.sent(),[2/*return*/]}}))}))}})):y().createElement(Mq,_Y({},e,{form:g,fieldName:"account",className:"authing-g2-input g2-send-code-input",autoComplete:"off",size:"large",placeholder:p("common.inputFourVerifyCode",{length:B}),maxLength:B,scene:Ii.SCENE_TYPE_REGISTER,prefix:y().createElement(JD,{type:"authing-a-shield-check-line1",style:{color:"#878A95"}}),codeFieldName:"captchaCode",onSendCodeBefore:function(){return TY(void 0,void 0,void 0,(function(){return OY(this,(function(e){switch(e.label){case 0:return[4/*yield*/,g.validateFields(["account"])];case 1:return e.sent(),[4/*yield*/,g.validateFields(["captchaCode"])];case 2:return e.sent(),[2/*return*/]}}))}))}}))}),[D,g,F,p,B]);DY((function(){
18597
+ return O(!0),(null==u?void 0:u.length)&&!x?(h.current.onError(),[2/*return*/]):(n=e.email,r=e.password,o=e.account,[4/*yield*/,(0,v.options.encryptFunction)(r,b.publicKey)]);case 5:return i=q.sent(),f=null!=d?d:{},"phone-password"===a&&(y=dj(L,o,M),k=y.phoneNumber,S=y.countryCode,o=k,p=S,F&&(m=null==e?void 0:e.code,g={phone:k})),P={account:o,email:n,password:i,phoneCountryCode:p,profile:_Y({browser:"undefined"!=typeof navigator?navigator.userAgent:null,device:mQ()},g),forceLogin:!1,generateToken:!0,clientIp:void 0,params:(null==b?void 0:b.isHost)?JSON.stringify(CQ(["login_page_context"])):void 0,context:JSON.stringify(f),phoneToken:m},_=function(e){s(e,{registerFrom:Ti.Email,account:n||o})},w?(null==C||C(DL.REGISTER_COMPLETE_INFO,{businessRequestName:a||"registerByEmail",content:_Y({},P),onRegisterSuccess:_,onRegisterFailed:c}),[2/*return*/]):[4/*yield*/,E("/api/v2/register-".concat((a||"email").split("-")[0]),_Y(_Y({},P),{postUserInfoPipeline:!1}))];case 6:return T=q.sent(),N=T.statusCode,I=T.data,A=T.message,R=T.apiCode,200===N?_(I):(R===RZ.UNSAFE_PASSWORD_TIP&&U(!0),h.current.onError(),c(R,I,A),gC.error(A)),[2/*return*/]}}))}))}),[g,x,M],{loading:!1}),2),z=V[1],$=RY((function(e){var t;return f&&(null===(t=f.internationalSmsConfig)||void 0===t?void 0:t.enabled)?y().createElement(OU,_Y({},e,{className:"authing-g2-input",size:"large",areaCode:M,onAreaCodeChange:function(e){D(e),g.getFieldValue(["phone"])&&g.validateFields(["phone"])},maxLength:20})):y().createElement(Pq,_Y({},e,{className:"authing-g2-input",size:"large",placeholder:p("login.inputPhone"),prefix:y().createElement(JD,{type:"authing-a-user-line1",style:{color:"#878A95"}}),maxLength:11}))}),[M,g,f,p]),H=RY((function(e){return L?y().createElement(Mq,_Y({},e,{isInternationSms:L,form:g,fieldName:"account",className:"authing-g2-input g2-send-code-input",autoComplete:"off",size:"large",placeholder:p("common.inputFourVerifyCode",{length:j}),areaCode:M,prefix:y().createElement(JD,{type:"authing-a-shield-check-line1",style:{color:"#878A95"}}),scene:Ii.SCENE_TYPE_REGISTER,maxLength:j,codeFieldName:"captchaCode",onSendCodeBefore:function(){return TY(void 0,void 0,void 0,(function(){return OY(this,(function(e){switch(e.label){case 0:return[4/*yield*/,g.validateFields(["account"])];case 1:return e.sent(),[4/*yield*/,g.validateFields(["captchaCode"])];case 2:return e.sent(),[2/*return*/]}}))}))}})):y().createElement(Mq,_Y({},e,{form:g,fieldName:"account",className:"authing-g2-input g2-send-code-input",autoComplete:"off",size:"large",placeholder:p("common.inputFourVerifyCode",{length:j}),maxLength:j,scene:Ii.SCENE_TYPE_REGISTER,prefix:y().createElement(JD,{type:"authing-a-shield-check-line1",style:{color:"#878A95"}}),codeFieldName:"captchaCode",onSendCodeBefore:function(){return TY(void 0,void 0,void 0,(function(){return OY(this,(function(e){switch(e.label){case 0:return[4/*yield*/,g.validateFields(["account"])];case 1:return e.sent(),[4/*yield*/,g.validateFields(["captchaCode"])];case 2:return e.sent(),[2/*return*/]}}))}))}}))}),[M,g,L,p,j]);DY((function(){
18602
18598
  /** 如果是国外用户池,那么有图形验证码,需要请求图片 */
18603
- k&&R(Ez(b.host))}),[k,null==b?void 0:b.host]),DY((function(){
18599
+ k&&A(Ez(b.host))}),[k,null==b?void 0:b.host]),DY((function(){
18604
18600
  // 方法发生变化时,图像验证码数据应该清空
18605
- k&&(null==g||g.setFieldsValue({captchaCode:void 0}))}),[g,k]);var G=MY((function(){var e;return a?"phone-password"===a?y().createElement(y().Fragment,null,y().createElement(VB.Phone,{key:"account",name:"account",className:(null===(e=null==f?void 0:f.internationalSmsConfig)||void 0===e?void 0:e.enabled)?"authing-g2-input-form remove-padding":"authing-g2-input-form",
18601
+ k&&(null==g||g.setFieldsValue({captchaCode:void 0}))}),[g,k]);var W=MY((function(){var e;return a?"phone-password"===a?y().createElement(y().Fragment,null,y().createElement(VB.Phone,{key:"account",name:"account",className:(null===(e=null==f?void 0:f.internationalSmsConfig)||void 0===e?void 0:e.enabled)?"authing-g2-input-form remove-padding":"authing-g2-input-form",
18606
18602
  // validateFirst={true} // 会多次触发 find 接口
18607
- form:g,checkRepeat:!0,required:!0,areaCode:D},y().createElement(H,{autoFocus:!m})),j&&y().createElement(y().Fragment,null,k&&y().createElement(cT.Item,{className:"authing-g2-input-form",validateTrigger:["onBlur","onChange"],name:"captchaCode",rules:hQ(p("common.captchaCode"))},y().createElement(sz,{className:"authing-g2-input",size:"large",placeholder:p("login.inputCaptchaCode"),verifyCodeUrl:A,changeCode:function(){return R(Ez(b.host))}})),y().createElement(cT.Item,{key:"code",name:"code",validateTrigger:["onBlur","onChange"],rules:hQ(p("common.captchaCode")),className:"authing-g2-input-form"},y().createElement(W,null)))):y().createElement(VB.CustomName,{method:null==a?void 0:a.split("-")[0],key:a,name:"account",className:"authing-g2-input-form",validateFirst:!0,form:g,checkRepeat:!0,required:!0},y().createElement(oO,{maxLength:50,autoFocus:!m,className:"authing-g2-input",autoComplete:"off",size:"large",placeholder:p("login.inputAccount",{text:i}),prefix:y().createElement(JD,{type:"authing-a-user-line1",style:{color:"#878A95"}})})):null}),[H,a,m,D,i,p,g,A,null===(o=null==f?void 0:f.internationalSmsConfig)||void 0===o?void 0:o.enabled]);return y().createElement("div",{className:"authing-g2-register-email"},y().createElement(cT,{form:g,name:"emailRegister",autoComplete:"off",onSubmitCapture:function(){return h.current.onSpin(!0)},onFinish:function(e){$(e)},onFinishFailed:function(){return h.current.onError()},onValuesChange:function(e,t){t.password&&t["new-password"]&&g.validateFields(["new-password"])}},a&&i?G:y().createElement(VB.Email,{key:"email",name:"email",className:"authing-g2-input-form",validateFirst:!0,form:g,checkRepeat:!0,required:!0},y().createElement(oO,{autoFocus:!m,className:"authing-g2-input",autoComplete:"off",size:"large",placeholder:p("login.inputEmail"),
18603
+ form:g,checkRepeat:!0,required:!0,areaCode:M},y().createElement($,{autoFocus:!m})),F&&y().createElement(y().Fragment,null,k&&y().createElement(cT.Item,{className:"authing-g2-input-form",validateTrigger:["onBlur","onChange"],name:"captchaCode",rules:hQ(p("common.captchaCode"))},y().createElement(sz,{className:"authing-g2-input",size:"large",placeholder:p("login.inputCaptchaCode"),verifyCodeUrl:I,changeCode:function(){return A(Ez(b.host))}})),y().createElement(cT.Item,{key:"code",name:"code",validateTrigger:["onBlur","onChange"],rules:hQ(p("common.captchaCode")),className:"authing-g2-input-form"},y().createElement(H,null)))):y().createElement(VB.CustomName,{method:null==a?void 0:a.split("-")[0],key:a,name:"account",className:"authing-g2-input-form",validateFirst:!0,form:g,checkRepeat:!0,required:!0},y().createElement(oO,{maxLength:50,autoFocus:!m,className:"authing-g2-input",autoComplete:"off",size:"large",placeholder:p("login.inputAccount",{text:i}),prefix:y().createElement(JD,{type:"authing-a-user-line1",style:{color:"#878A95"}})})):null}),[$,a,m,M,i,p,g,I,null===(o=null==f?void 0:f.internationalSmsConfig)||void 0===o?void 0:o.enabled]);return y().createElement("div",{className:"authing-g2-register-email"},y().createElement(cT,{form:g,name:"emailRegister",autoComplete:"off",onSubmitCapture:function(){return h.current.onSpin(!0)},onFinish:function(e){z(e)},onFinishFailed:function(){return h.current.onError()},onValuesChange:function(e,t){t.password&&t["new-password"]&&g.validateFields(["new-password"])}},a&&i?W:y().createElement(VB.Email,{key:"email",name:"email",className:"authing-g2-input-form",validateFirst:!0,form:g,checkRepeat:!0,required:!0},y().createElement(oO,{autoFocus:!m,className:"authing-g2-input",autoComplete:"off",size:"large",placeholder:p("login.inputEmail"),
18608
18604
  // prefix={<UserOutlined style={{ color: '#878A95' }} />}
18609
18605
  prefix:y().createElement(JD,{type:"authing-a-user-line1",style:{color:"#878A95"}})})),y().createElement(VB.Password,{key:"password",name:"password",className:"authing-g2-input-form",validateFirst:!0},y().createElement(HB,{className:"authing-g2-input",size:"large",placeholder:p("login.inputPwd"),prefix:y().createElement(JD,{type:"authing-a-lock-line1",style:{color:"#878A95"}})})),y().createElement(VB.Password,{key:"new-password",name:"new-password",fieldRequiredRuleMessage:p("common.repeatPasswordDoc"),rules:[{validateTrigger:"onBlur",validator:function(e,t){return t!==g.getFieldValue("password")&&t?Promise.reject(p("common.repeatPasswordDoc")):Promise.resolve()}}],className:"authing-g2-input-form",validateFirst:!0},y().createElement(HB,{className:"authing-g2-input",size:"large",placeholder:p("common.passwordAgain"),
18610
18606
  // prefix={<LockOutlined style={{ color: '#878A95' }} />}
18611
- prefix:y().createElement(JD,{type:"authing-a-lock-line1",style:{color:"#878A95"}})})),Boolean(null==u?void 0:u.length)&&y().createElement(mz,{onChange:function(e,t){P(e),_.current=t},agreements:u,showError:O}),U(),y().createElement(cT.Item,{className:"authing-g2-sumbit-form"},y().createElement(Ej,{
18607
+ prefix:y().createElement(JD,{type:"authing-a-lock-line1",style:{color:"#878A95"}})})),Boolean(null==u?void 0:u.length)&&y().createElement(mz,{onChange:P,agreements:u,showError:T}),q(),y().createElement(cT.Item,{className:"authing-g2-sumbit-form"},y().createElement(Ej,{
18612
18608
  // disabled={
18613
18609
  // !!agreements.find((item) => item.required && !acceptedAgreements)
18614
18610
  // }
18615
- text:p("common.register"),ref:h}))))},FY=function(){return FY=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},FY.apply(this,arguments)},jY=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())}))},BY=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(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},qY=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},UY=y().useCallback,VY=y().useEffect,zY=y().useRef,$Y=y().useState,HY=function(e){var t,n,r,o=e.onRegisterSuccess,i=e.onRegisterFailed,a=e.onBeforeRegister,s=e.agreements,c=e.publicConfig,l=e.registeContext,u=e.methods,d=void 0===u?[]:u,f=_u().t,p=PY("phone"),h=PY("email"),m=pL(),v=uj().isPhoneMedia,g=GL(),b=fL().changeModule,w=oQ().post,C=zY(null),E=qY(cT.useForm(),1)[0],k=qY($Y(!1),2),S=k[0],x=k[1],P=zY([]),_=qY($Y(!1),2),T=_[0],O=_[1],N=qY($Y((null===(t=null==c?void 0:c.internationalSmsConfig)||void 0===t?void 0:t.defaultISOType)||"CN"),2),I=N[0],A=N[1],R=null!==(n=null==c?void 0:c.verifyCodeLength)&&void 0!==n?n:4,M=qY($Y(d[0]),2),D=M[0],L=M[1],F=qY($Y(""),2),j=F[0],B=F[1],q=qY($Y(""),2),U=q[0],V=q[1],z=qY($Y(!1),2),$=z[0],H=z[1],W=(null===(r=null==c?void 0:c.internationalSmsConfig)||void 0===r?void 0:r.enabled)||!1,G=bL("register"),K=qY($Y(""),2),Y=K[0],J=K[1];VY((function(){var e;
18611
+ text:p("common.register"),ref:h}))))},FY=function(){return FY=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},FY.apply(this,arguments)},jY=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())}))},BY=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(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},qY=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},UY=y().useCallback,VY=y().useEffect,zY=y().useRef,$Y=y().useState,HY=function(e){var t,n,r,o=e.onRegisterSuccess,i=e.onRegisterFailed,a=e.onBeforeRegister,s=e.agreements,c=e.publicConfig,l=e.registeContext,u=e.methods,d=void 0===u?[]:u,f=_u().t,p=PY("phone"),h=PY("email"),m=pL(),v=uj().isPhoneMedia,g=GL(),b=fL().changeModule,w=oQ().post,C=zY(null),E=qY(cT.useForm(),1)[0],k=qY($Y(!1),2),S=k[0],x=k[1],P=qY($Y(!1),2),_=P[0],T=P[1],O=qY($Y((null===(t=null==c?void 0:c.internationalSmsConfig)||void 0===t?void 0:t.defaultISOType)||"CN"),2),N=O[0],I=O[1],A=null!==(n=null==c?void 0:c.verifyCodeLength)&&void 0!==n?n:4,R=qY($Y(d[0]),2),M=R[0],D=R[1],L=qY($Y(""),2),F=L[0],j=L[1],B=qY($Y(""),2),q=B[0],U=B[1],V=qY($Y(!1),2),z=V[0],$=V[1],H=(null===(r=null==c?void 0:c.internationalSmsConfig)||void 0===r?void 0:r.enabled)||!1,W=bL("register"),G=qY($Y(""),2),K=G[0],Y=G[1];VY((function(){var e;
18616
18612
  // 开启国际化配置且登录方式为手机号码时
18617
- 1===d.length&&"phone-code"===d[0]&&c&&(null===(e=c.internationalSmsConfig)||void 0===e?void 0:e.enabled)&&H(!0)}),[d,c]),VY((function(){
18613
+ 1===d.length&&"phone-code"===d[0]&&c&&(null===(e=c.internationalSmsConfig)||void 0===e?void 0:e.enabled)&&$(!0)}),[d,c]),VY((function(){
18618
18614
  /** 如果是国外用户池,那么有图形验证码,需要请求图片 */
18619
- G&&J(Ez(m.host))}),[G,null==m?void 0:m.host]),VY((function(){
18615
+ W&&Y(Ez(m.host))}),[W,null==m?void 0:m.host]),VY((function(){
18620
18616
  // 方法发生变化时,图像验证码数据应该清空
18621
- G&&(null==E||E.setFieldsValue({captchaCode:void 0}))}),[E,D,G]);var Z=UY((function(e){return jY(void 0,void 0,void 0,(function(){var t,n,r,u,d,f,h,v,y,k,x,_,T,N,A,R,M,D,L,F,j,B,q,U,V,z,$,H;return BY(this,(function(G){switch(G.label){case 0:if(t=(null===(V=m.passwordLoginMethods)||void 0===V?void 0:V.includes("phone-password"))&&(null==c?void 0:c.enableCompletePassword),null===(z=C.current)||void 0===z||z.onSpin(!0),e.phone=e.identify,!a)return[3/*break*/,4];G.label=1;case 1:return G.trys.push([1,3,,4]),[4/*yield*/,a({type:Gs.Phone,data:{identity:e.phone,password:e.password,code:e.code}},g)];case 2:return G.sent()?[3/*break*/,4]:(C.current.onSpin(!1),[2/*return*/]);case 3:return"string"==typeof(n=G.sent())?gC.error(n):gC.error(null==n?void 0:n.message),C.current.onSpin(!1),[2/*return*/];case 4:return G.trys.push([4,12,13,14]),[4/*yield*/,E.validateFields()];case 5:return G.sent(),O(!0),(null==s?void 0:s.length)&&!S?(
18617
+ W&&(null==E||E.setFieldsValue({captchaCode:void 0}))}),[E,M,W]);var J=UY((function(e){return jY(void 0,void 0,void 0,(function(){var t,n,r,u,d,f,h,v,y,k,x,P,_,O,I,A,R,M,D,L,F,j,B,q,U,V,z,$;return BY(this,(function(W){switch(W.label){case 0:if(t=(null===(U=m.passwordLoginMethods)||void 0===U?void 0:U.includes("phone-password"))&&(null==c?void 0:c.enableCompletePassword),null===(V=C.current)||void 0===V||V.onSpin(!0),e.phone=e.identify,!a)return[3/*break*/,4];W.label=1;case 1:return W.trys.push([1,3,,4]),[4/*yield*/,a({type:Gs.Phone,data:{identity:e.phone,password:e.password,code:e.code}},g)];case 2:return W.sent()?[3/*break*/,4]:(C.current.onSpin(!1),[2/*return*/]);case 3:return"string"==typeof(n=W.sent())?gC.error(n):gC.error(null==n?void 0:n.message),C.current.onSpin(!1),[2/*return*/];case 4:return W.trys.push([4,12,13,14]),[4/*yield*/,E.validateFields()];case 5:return W.sent(),T(!0),(null==s?void 0:s.length)&&!S?(
18622
18618
  // message.error(t('common.registerProtocolTips'))
18623
- C.current.onError(),[2/*return*/]):(r=e.phone,q=e.code,u=null!=l?l:{},d=dj(W,r,I),f=d.phoneNumber,h=d.countryCode,v={phone:f,code:q,phoneCountryCode:W?h:void 0,
18619
+ C.current.onError(),[2/*return*/]):(r=e.phone,B=e.code,u=null!=l?l:{},d=dj(H,r,N),f=d.phoneNumber,h=d.countryCode,v={phone:f,code:B,phoneCountryCode:H?h:void 0,
18624
18620
  // password: undefined, // TODO: 手机号验证码不需要密码
18625
- profile:{browser:"undefined"!=typeof navigator?navigator.userAgent:null,device:mQ()},forceLogin:!1,generateToken:!0,clientIp:void 0,params:(null==m?void 0:m.isHost)?JSON.stringify(CQ(["login_page_context"])):void 0,context:JSON.stringify(u),emailToken:void 0,agreementIds:s.length?P.current:void 0},y=function(e){o(e,{registerFrom:Gs.Phone,account:W?"":f})},t?[4/*yield*/,w("/api/v2/sms/preCheckCode",{phone:f,phoneCode:q,phoneCountryCode:h})]:[3/*break*/,7]);case 6:
18621
+ profile:{browser:"undefined"!=typeof navigator?navigator.userAgent:null,device:mQ()},forceLogin:!1,generateToken:!0,clientIp:void 0,params:(null==m?void 0:m.isHost)?JSON.stringify(CQ(["login_page_context"])):void 0,context:JSON.stringify(u),emailToken:void 0},y=function(e){o(e,{registerFrom:Gs.Phone,account:H?"":f})},t?[4/*yield*/,w("/api/v2/sms/preCheckCode",{phone:f,phoneCode:B,phoneCountryCode:h})]:[3/*break*/,7]);case 6:
18626
18622
  // 验证码校验通过 进入密码补全流程
18627
- return k=G.sent(),T=k.statusCode,x=k.data,A=x.valid,R=x.message,200===T&&A?(null==b||b(DL.REGISTER_PASSWORD,{businessRequestName:"registerByPhoneCode",content:FY({},v),isChangeComplete:p,onRegisterSuccess:y,onRegisterFailed:i}),[2/*return*/]):(C.current.onError(),gC.error(R),[2/*return*/]);case 7:return p?[4/*yield*/,w("/api/v2/sms/preCheckCode",{phone:f,phoneCode:q,phoneCountryCode:h})]:[3/*break*/,9];case 8:return _=G.sent(),T=_.statusCode,N=_.data,A=N.valid,R=N.message,200===T&&A?(null==b||b(DL.REGISTER_COMPLETE_INFO,{businessRequestName:"registerByPhoneCode",content:FY({},v),onRegisterSuccess:y,onRegisterFailed:i}),[2/*return*/]):(C.current.onError(),gC.error(R),[2/*return*/]);case 9:return[4/*yield*/,w("/api/v2/register-phone-code",FY(FY({},v),{postUserInfoPipeline:!1}))];case 10:M=G.sent(),U=M.data,D=M.statusCode,L=M.apiCode,F=M.message,200===D?(null===($=C.current)||void 0===$||$.onSpin(!1),y(U)):(C.current.onError(),gC.error(F),!t&&i(L,U,F)),G.label=11;case 11:return[3/*break*/,14];case 12:return j=G.sent(),B=j.message,q=j.code,U=j.data,C.current.onError(),gC.error(B),!t&&i(q,U,B),[3/*break*/,14];case 13:return null===(H=C.current)||void 0===H||H.onSpin(!1),[7/*endfinally*/];case 14:return[2/*return*/]}}))}))}),[null==m?void 0:m.isHost,m.passwordLoginMethods,a,g,E,null==s?void 0:s.length,S,l,W,I,w,b,p,o,i,null==c?void 0:c.enableCompletePassword,P]),Q=UY((function(e){return jY(void 0,void 0,void 0,(function(){var t,n,r,u,d,f,p,v,y,k,x,P,_,T,N,I,A,R,M,D,L,F,j,B;return BY(this,(function(q){switch(q.label){case 0:if(t=(null===(j=m.passwordLoginMethods)||void 0===j?void 0:j.includes("email-password"))&&(null==c?void 0:c.enableCompletePassword),C.current.onSpin(!0),e.email=e.identify,!a)return[3/*break*/,4];q.label=1;case 1:return q.trys.push([1,3,,4]),[4/*yield*/,a({type:Gs.EmailCode,data:{identity:e.email,password:e.password,code:e.code}},g)];case 2:return q.sent()?[3/*break*/,4]:(C.current.onSpin(!1),[2/*return*/]);case 3:return"string"==typeof(n=q.sent())?gC.error(n):gC.error(null==n?void 0:n.message),C.current.onSpin(!1),[2/*return*/];case 4:return q.trys.push([4,12,13,14]),[4/*yield*/,E.validateFields()];case 5:return q.sent(),O(!0),(null==s?void 0:s.length)&&!S?(C.current.onError(),[2/*return*/]):(r=e.email,L=e.code,u=null!=l?l:{},d={email:r,code:L,profile:{browser:"undefined"!=typeof navigator?navigator.userAgent:null,device:mQ()},context:JSON.stringify(u),generateToken:!0,
18623
+ return k=W.sent(),_=k.statusCode,x=k.data,I=x.valid,A=x.message,200===_&&I?(null==b||b(DL.REGISTER_PASSWORD,{businessRequestName:"registerByPhoneCode",content:FY({},v),isChangeComplete:p,onRegisterSuccess:y,onRegisterFailed:i}),[2/*return*/]):(C.current.onError(),gC.error(A),[2/*return*/]);case 7:return p?[4/*yield*/,w("/api/v2/sms/preCheckCode",{phone:f,phoneCode:B,phoneCountryCode:h})]:[3/*break*/,9];case 8:return P=W.sent(),_=P.statusCode,O=P.data,I=O.valid,A=O.message,200===_&&I?(null==b||b(DL.REGISTER_COMPLETE_INFO,{businessRequestName:"registerByPhoneCode",content:FY({},v),onRegisterSuccess:y,onRegisterFailed:i}),[2/*return*/]):(C.current.onError(),gC.error(A),[2/*return*/]);case 9:return[4/*yield*/,w("/api/v2/register-phone-code",FY(FY({},v),{postUserInfoPipeline:!1}))];case 10:R=W.sent(),q=R.data,M=R.statusCode,D=R.apiCode,L=R.message,200===M?(null===(z=C.current)||void 0===z||z.onSpin(!1),y(q)):(C.current.onError(),gC.error(L),!t&&i(D,q,L)),W.label=11;case 11:return[3/*break*/,14];case 12:return F=W.sent(),j=F.message,B=F.code,q=F.data,C.current.onError(),gC.error(j),!t&&i(B,q,j),[3/*break*/,14];case 13:return null===($=C.current)||void 0===$||$.onSpin(!1),[7/*endfinally*/];case 14:return[2/*return*/]}}))}))}),[null==m?void 0:m.isHost,m.passwordLoginMethods,a,g,E,null==s?void 0:s.length,S,l,H,N,w,b,p,o,i,null==c?void 0:c.enableCompletePassword]),Z=UY((function(e){return jY(void 0,void 0,void 0,(function(){var t,n,r,u,d,f,p,v,y,k,x,P,_,O,N,I,A,R,M,D,L,F,j,B;return BY(this,(function(q){switch(q.label){case 0:if(t=(null===(j=m.passwordLoginMethods)||void 0===j?void 0:j.includes("email-password"))&&(null==c?void 0:c.enableCompletePassword),C.current.onSpin(!0),e.email=e.identify,!a)return[3/*break*/,4];q.label=1;case 1:return q.trys.push([1,3,,4]),[4/*yield*/,a({type:Gs.EmailCode,data:{identity:e.email,password:e.password,code:e.code}},g)];case 2:return q.sent()?[3/*break*/,4]:(C.current.onSpin(!1),[2/*return*/]);case 3:return"string"==typeof(n=q.sent())?gC.error(n):gC.error(null==n?void 0:n.message),C.current.onSpin(!1),[2/*return*/];case 4:return q.trys.push([4,12,13,14]),[4/*yield*/,E.validateFields()];case 5:return q.sent(),T(!0),(null==s?void 0:s.length)&&!S?(C.current.onError(),[2/*return*/]):(r=e.email,L=e.code,u=null!=l?l:{},d={email:r,code:L,profile:{browser:"undefined"!=typeof navigator?navigator.userAgent:null,device:mQ()},context:JSON.stringify(u),generateToken:!0,
18628
18624
  // 托管模式下注册携带query上自定义参数login_page_context
18629
18625
  params:(null==m?void 0:m.isHost)?JSON.stringify(CQ(["login_page_context"])):void 0},f=function(e){o(e,{registerFrom:Gs.EmailCode,account:r})},t?[4/*yield*/,w("/api/v2/email/preCheckCode",{email:r,emailCode:L})]:[3/*break*/,7]);case 6:
18630
18626
  // 验证码校验通过 进入密码补全流程
18631
- return p=q.sent(),k=p.statusCode,v=p.data,P=v.valid,_=v.message,200===k&&P?(null==b||b(DL.REGISTER_PASSWORD,{businessRequestName:"registerByEmailCode",content:FY({},d),isChangeComplete:h,onRegisterSuccess:f,onRegisterFailed:i}),[2/*return*/]):(C.current.onError(),gC.error(_),[2/*return*/]);case 7:return h?[4/*yield*/,w("/api/v2/email/preCheckCode",{email:r,emailCode:L})]:[3/*break*/,9];case 8:return y=q.sent(),k=y.statusCode,x=y.data,P=x.valid,_=x.message,200===k&&P?(null==b||b(DL.REGISTER_COMPLETE_INFO,{businessRequestName:"registerByEmailCode",content:FY({},d),onRegisterSuccess:f,onRegisterFailed:i}),[2/*return*/]):(C.current.onError(),gC.error(_),[2/*return*/]);case 9:return[4/*yield*/,w("/api/v2/register-email-code",FY(FY({},d),{postUserInfoPipeline:!1}))];case 10:T=q.sent(),N=T.statusCode,F=T.data,I=T.apiCode,A=T.onGuardHandling,R=T.message,C.current.onSpin(!1),200===N?f(F):(null==A||A(),i(I,F,R)),q.label=11;case 11:return[3/*break*/,14];case 12:return M=q.sent(),D=M.message,L=M.code,F=M.data,C.current.onError(),gC.error(D),!t&&i(L,F,gC),[3/*break*/,14];case 13:return null===(B=C.current)||void 0===B||B.onSpin(!1),[7/*endfinally*/];case 14:return[2/*return*/]}}))}))}),[null==m?void 0:m.isHost,m.passwordLoginMethods,a,g,E,null==s?void 0:s.length,S,l,w,b,h,o,i,null==c?void 0:c.enableCompletePassword]),X=UY((function(e){return jY(void 0,void 0,void 0,(function(){return BY(this,(function(t){switch(t.label){case 0:return D!==Tc.EmailCode?[3/*break*/,2]:[4/*yield*/,Q(e)];case 1:return t.sent(),[3/*break*/,4];case 2:return D!==Tc.PhoneCode?[3/*break*/,4]:[4/*yield*/,Z(e)];case 3:t.sent(),t.label=4;case 4:return[2/*return*/]}}))}))}),[D,Q,Z]),ee=UY((function(e){return $?y().createElement(Mq,FY({},e,{form:E,fieldName:"identify",className:"authing-g2-input g2-send-code-input",autoComplete:"off",size:"large",placeholder:f("common.inputFourVerifyCode",{length:R}),areaCode:I,prefix:y().createElement(JD,{type:"authing-a-shield-check-line1",style:{color:"#878A95"}}),isInternationSms:W,scene:Ii.SCENE_TYPE_REGISTER,maxLength:R,onSendCodeBefore:function(){return jY(void 0,void 0,void 0,(function(){return BY(this,(function(e){switch(e.label){case 0:return[4/*yield*/,E.validateFields(["identify"])];case 1:return e.sent(),[4/*yield*/,E.validateFields(["captchaCode"])];case 2:return e.sent(),[2/*return*/]}}))}))}})):y().createElement(y().Fragment,null,D===Tc.PhoneCode&&y().createElement(Mq,FY({},e,{isInternationSms:W,className:"authing-g2-input g2-send-code-input",autoComplete:"off",size:"large",placeholder:f("common.inputFourVerifyCode",{length:R}),areaCode:I,prefix:y().createElement(JD,{type:"authing-a-shield-check-line1",style:{color:"#878A95"}}),scene:Ii.SCENE_TYPE_REGISTER,maxLength:R,data:j,captchaCode:U,onSendCodeBefore:function(){return jY(void 0,void 0,void 0,(function(){return BY(this,(function(e){switch(e.label){case 0:return[4/*yield*/,E.validateFields(["identify"])];case 1:return e.sent(),[4/*yield*/,E.validateFields(["captchaCode"])];case 2:return e.sent(),[2/*return*/]}}))}))}})),D===Tc.EmailCode&&y().createElement(CU,FY({},e,{className:"authing-g2-input g2-send-code-input",autoComplete:"off",size:"large",placeholder:f("common.inputFourVerifyCode",{length:R}),prefix:y().createElement(JD,{type:"authing-a-shield-check-line1",style:{color:"#878A95"}}),scene:Nc.REGISTER_VERIFY_CODE,maxLength:R,data:j,onSendCodeBefore:function(){return jY(void 0,void 0,void 0,(function(){return BY(this,(function(e){switch(e.label){case 0:return[4/*yield*/,E.validateFields(["identify"])];case 1:return e.sent(),[2/*return*/]}}))}))}})))}),[I,D,E,j,W,$,f,R,U]),te=UY((function(e){return y().createElement(OU,FY({},e,{className:"authing-g2-input",size:"large",areaCode:I,onAreaCodeChange:function(e){A(e),E.getFieldValue(["identify"])&&E.validateFields(["identify"])}}))}),[I,E]);return y().createElement("div",{className:"authing-g2-register-email"},y().createElement(cT,{form:E,name:"emailRegister",autoComplete:"off",onSubmitCapture:function(){return C.current.onSpin(!0)},onFinish:X,onFinishFailed:function(){return C.current.onError()}},y().createElement(PV,{name:"identify",className:$?"authing-g2-input-form remove-padding":"authing-g2-input-form",methods:d,currentMethod:D,areaCode:I,checkRepeat:!0,required:!0},$?y().createElement(te,{autoFocus:!v}):y().createElement(aW,{className:"authing-g2-input",size:"large",autoFocus:!v,value:j,methods:d,onChange:function(e){var t=e.target.value;B(t),1!==d.length&&(pQ("email",t)?L(Tc.EmailCode):
18627
+ return p=q.sent(),k=p.statusCode,v=p.data,P=v.valid,_=v.message,200===k&&P?(null==b||b(DL.REGISTER_PASSWORD,{businessRequestName:"registerByEmailCode",content:FY({},d),isChangeComplete:h,onRegisterSuccess:f,onRegisterFailed:i}),[2/*return*/]):(C.current.onError(),gC.error(_),[2/*return*/]);case 7:return h?[4/*yield*/,w("/api/v2/email/preCheckCode",{email:r,emailCode:L})]:[3/*break*/,9];case 8:return y=q.sent(),k=y.statusCode,x=y.data,P=x.valid,_=x.message,200===k&&P?(null==b||b(DL.REGISTER_COMPLETE_INFO,{businessRequestName:"registerByEmailCode",content:FY({},d),onRegisterSuccess:f,onRegisterFailed:i}),[2/*return*/]):(C.current.onError(),gC.error(_),[2/*return*/]);case 9:return[4/*yield*/,w("/api/v2/register-email-code",FY(FY({},d),{postUserInfoPipeline:!1}))];case 10:O=q.sent(),N=O.statusCode,F=O.data,I=O.apiCode,A=O.onGuardHandling,R=O.message,C.current.onSpin(!1),200===N?f(F):(null==A||A(),i(I,F,R)),q.label=11;case 11:return[3/*break*/,14];case 12:return M=q.sent(),D=M.message,L=M.code,F=M.data,C.current.onError(),gC.error(D),!t&&i(L,F,gC),[3/*break*/,14];case 13:return null===(B=C.current)||void 0===B||B.onSpin(!1),[7/*endfinally*/];case 14:return[2/*return*/]}}))}))}),[null==m?void 0:m.isHost,m.passwordLoginMethods,a,g,E,null==s?void 0:s.length,S,l,w,b,h,o,i,null==c?void 0:c.enableCompletePassword]),Q=UY((function(e){return jY(void 0,void 0,void 0,(function(){return BY(this,(function(t){switch(t.label){case 0:return M!==Tc.EmailCode?[3/*break*/,2]:[4/*yield*/,Z(e)];case 1:return t.sent(),[3/*break*/,4];case 2:return M!==Tc.PhoneCode?[3/*break*/,4]:[4/*yield*/,J(e)];case 3:t.sent(),t.label=4;case 4:return[2/*return*/]}}))}))}),[M,Z,J]),X=UY((function(e){return z?y().createElement(Mq,FY({},e,{form:E,fieldName:"identify",className:"authing-g2-input g2-send-code-input",autoComplete:"off",size:"large",placeholder:f("common.inputFourVerifyCode",{length:A}),areaCode:N,prefix:y().createElement(JD,{type:"authing-a-shield-check-line1",style:{color:"#878A95"}}),isInternationSms:H,scene:Ii.SCENE_TYPE_REGISTER,maxLength:A,onSendCodeBefore:function(){return jY(void 0,void 0,void 0,(function(){return BY(this,(function(e){switch(e.label){case 0:return[4/*yield*/,E.validateFields(["identify"])];case 1:return e.sent(),[4/*yield*/,E.validateFields(["captchaCode"])];case 2:return e.sent(),[2/*return*/]}}))}))}})):y().createElement(y().Fragment,null,M===Tc.PhoneCode&&y().createElement(Mq,FY({},e,{isInternationSms:H,className:"authing-g2-input g2-send-code-input",autoComplete:"off",size:"large",placeholder:f("common.inputFourVerifyCode",{length:A}),areaCode:N,prefix:y().createElement(JD,{type:"authing-a-shield-check-line1",style:{color:"#878A95"}}),scene:Ii.SCENE_TYPE_REGISTER,maxLength:A,data:F,captchaCode:q,onSendCodeBefore:function(){return jY(void 0,void 0,void 0,(function(){return BY(this,(function(e){switch(e.label){case 0:return[4/*yield*/,E.validateFields(["identify"])];case 1:return e.sent(),[4/*yield*/,E.validateFields(["captchaCode"])];case 2:return e.sent(),[2/*return*/]}}))}))}})),M===Tc.EmailCode&&y().createElement(CU,FY({},e,{className:"authing-g2-input g2-send-code-input",autoComplete:"off",size:"large",placeholder:f("common.inputFourVerifyCode",{length:A}),prefix:y().createElement(JD,{type:"authing-a-shield-check-line1",style:{color:"#878A95"}}),scene:Nc.REGISTER_VERIFY_CODE,maxLength:A,data:F,onSendCodeBefore:function(){return jY(void 0,void 0,void 0,(function(){return BY(this,(function(e){switch(e.label){case 0:return[4/*yield*/,E.validateFields(["identify"])];case 1:return e.sent(),[2/*return*/]}}))}))}})))}),[N,M,E,F,H,z,f,A,q]),ee=UY((function(e){return y().createElement(OU,FY({},e,{className:"authing-g2-input",size:"large",areaCode:N,onAreaCodeChange:function(e){I(e),E.getFieldValue(["identify"])&&E.validateFields(["identify"])}}))}),[N,E]);return y().createElement("div",{className:"authing-g2-register-email"},y().createElement(cT,{form:E,name:"emailRegister",autoComplete:"off",onSubmitCapture:function(){return C.current.onSpin(!0)},onFinish:Q,onFinishFailed:function(){return C.current.onError()}},y().createElement(PV,{name:"identify",className:z?"authing-g2-input-form remove-padding":"authing-g2-input-form",methods:d,currentMethod:M,areaCode:N,checkRepeat:!0,required:!0},z?y().createElement(ee,{autoFocus:!v}):y().createElement(aW,{className:"authing-g2-input",size:"large",autoFocus:!v,value:F,methods:d,onChange:function(e){var t=e.target.value;j(t),1!==d.length&&(pQ("email",t)?D(Tc.EmailCode):
18632
18628
  // 放开手机号校验 方便同时开启邮箱和短信国际化手机号通过
18633
- L(Tc.PhoneCode))},prefix:y().createElement(JD,{type:"authing-a-user-line1",style:{color:"#878A95"}})})),G&&D===Tc.PhoneCode&&y().createElement(cT.Item,{className:"authing-g2-input-form",validateTrigger:["onBlur","onChange"],name:"captchaCode",rules:hQ(f("common.captchaCode"))},y().createElement(sz,{className:"authing-g2-input",size:"large",placeholder:f("login.inputCaptchaCode"),verifyCodeUrl:Y,changeCode:function(){return J(Ez(m.host))},onChange:function(e){V(e.target.value)}})),y().createElement(cT.Item,{key:"code",name:"code",validateTrigger:["onBlur","onChange"],rules:hQ(f("common.captchaCode")),className:"authing-g2-input-form",validateFirst:!0},y().createElement(ee,null)),Boolean(null==s?void 0:s.length)&&y().createElement(mz,{onChange:function(e,t){x(e),P.current=t},agreements:s,showError:T}),y().createElement(cT.Item,{className:"authing-g2-sumbit-form"},y().createElement(Ej,{
18629
+ D(Tc.PhoneCode))},prefix:y().createElement(JD,{type:"authing-a-user-line1",style:{color:"#878A95"}})})),W&&M===Tc.PhoneCode&&y().createElement(cT.Item,{className:"authing-g2-input-form",validateTrigger:["onBlur","onChange"],name:"captchaCode",rules:hQ(f("common.captchaCode"))},y().createElement(sz,{className:"authing-g2-input",size:"large",placeholder:f("login.inputCaptchaCode"),verifyCodeUrl:K,changeCode:function(){return Y(Ez(m.host))},onChange:function(e){U(e.target.value)}})),y().createElement(cT.Item,{key:"code",name:"code",validateTrigger:["onBlur","onChange"],rules:hQ(f("common.captchaCode")),className:"authing-g2-input-form",validateFirst:!0},y().createElement(X,null)),Boolean(null==s?void 0:s.length)&&y().createElement(mz,{onChange:x,agreements:s,showError:_}),y().createElement(cT.Item,{className:"authing-g2-sumbit-form"},y().createElement(Ej,{
18634
18630
  // disabled={
18635
18631
  // !!agreements.find((item) => item.required && !acceptedAgreements)
18636
18632
  // }
@@ -8,7 +8,6 @@ export interface CheckPushCodeStatusProps {
8
8
  }
9
9
  export interface OnLoginProps {
10
10
  account: string;
11
- agreementIds?: (string | number)[];
12
11
  }
13
12
  export declare type LoginStatus = 'before' | 'pending';
14
13
  export interface LoginWithAuthingOtpPushProps {
@@ -3,7 +3,7 @@ import './style.less';
3
3
  import { Agreement } from '../../../Type/application';
4
4
  export interface AgreementsProps {
5
5
  value?: boolean;
6
- onChange?: (value: boolean, acceptList: (string | number)[]) => void;
6
+ onChange?: (value: boolean) => void;
7
7
  style?: React.CSSProperties;
8
8
  agreements: Agreement[];
9
9
  showError?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@authing/guard-shim-react",
3
- "version": "4.5.17-alpha.3",
3
+ "version": "4.5.17",
4
4
  "description": "Guard shim for react 16 / 17, only be used to internal",
5
5
  "types": "dist/typings/src/index.d.ts",
6
6
  "module": "dist/guard.min.js",