@cloudbase/js-sdk 2.5.44-beta.0 → 2.5.46-beta.0

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.
@@ -1 +1 @@
1
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("cloudbase_oauth",[],e):"object"==typeof exports?exports.cloudbase_oauth=e():t.cloudbase_oauth=e()}("undefined"!=typeof window?window:this,(()=>(()=>{"use strict";var t={842:(t,e,r)=>{r.r(e),r.d(e,{Auth:()=>Wt,AuthClient:()=>Yt,CloudbaseOAuth:()=>Zt,ErrorType:()=>i,OAuth2Client:()=>A,Syntax:()=>n,authModels:()=>h,defaultRequest:()=>E,defaultStorage:()=>_,generateRequestId:()=>S,toResponseError:()=>T});var n,i,o,s,a,u,h={};function c(){return"xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)}))}r.r(h),function(t){t.CLIENT_ID="client_id",t.CLIENT_SECRET="client_secret",t.RESPONSE_TYPE="response_type",t.SCOPE="scope",t.STATE="state",t.REDIRECT_URI="redirect_uri",t.ERROR="error",t.ERROR_DESCRIPTION="error_description",t.ERROR_URI="error_uri",t.GRANT_TYPE="grant_type",t.CODE="code",t.ACCESS_TOKEN="access_token",t.TOKEN_TYPE="token_type",t.EXPIRES_IN="expires_in",t.USERNAME="username",t.PASSWORD="password",t.REFRESH_TOKEN="refresh_token"}(n||(n={})),function(t){t.UNREACHABLE="unreachable",t.LOCAL="local",t.CANCELLED="cancelled",t.UNKNOWN="unknown",t.INVALID_ARGUMENT="invalid_argument",t.DEADLINE_EXCEEDED="deadline_exceeded",t.NOT_FOUND="not_found",t.ALREADY_EXISTS="already_exists",t.PERMISSION_DENIED="permission_denied",t.UNAUTHENTICATED="unauthenticated",t.RESOURCE_EXHAUSTED="resource_exhausted",t.FAILED_PRECONDITION="failed_precondition",t.ABORTED="aborted",t.OUT_OF_RANGE="out_of_range",t.UNIMPLEMENTED="unimplemented",t.INTERNAL="internal",t.UNAVAILABLE="unavailable",t.DATA_LOSS="data_loss",t.CAPTCHA_REQUIRED="captcha_required",t.CAPTCHA_INVALID="captcha_invalid",t.INVALID_PASSWORD="invalid_password",t.INVALID_STATUS="invalid_status",t.USER_PENDING="user_pending",t.USER_BLOCKED="user_blocked",t.INVALID_VERIFICATION_CODE="invalid_verification_code",t.TWO_FACTOR_REQUIRED="two_factor_required",t.INVALID_TWO_FACTOR="invalid_two_factor",t.INVALID_TWO_FACTOR_RECOVERY="invalid_two_factor_recovery",t.UNDER_REVIEW="under_review",t.INVALID_REQUEST="invalid_request",t.UNAUTHORIZED_CLIENT="unauthorized_client",t.ACCESS_DENIED="access_denied",t.UNSUPPORTED_RESPONSE_TYPE="unsupported_response_type",t.INVALID_SCOPE="invalid_scope",t.INVALID_GRANT="invalid_grant",t.SERVER_ERROR="server_error",t.TEMPORARILY_UNAVAILABLE="temporarily_unavailable",t.INTERACTION_REQUIRED="interaction_required",t.LOGIN_REQUIRED="login_required",t.ACCOUNT_SELECTION_REQUIRED="account_selection_required",t.CONSENT_REQUIRED="consent_required",t.INVALID_REQUEST_URI="invalid_request_uri",t.INVALID_REQUEST_OBJECT="invalid_request_object",t.REQUEST_NOT_SUPPORTED="request_not_supported",t.REQUEST_URI_NOT_SUPPORTED="request_uri_not_supported",t.REGISTRATION_NOT_SUPPORTED="registration_not_supported"}(i||(i={})),function(t){t.AUTH_SIGN_IN_URL="/auth/v1/signin",t.AUTH_SIGN_IN_ANONYMOUSLY_URL="/auth/v1/signin/anonymously",t.AUTH_SIGN_IN_WITH_PROVIDER_URL="/auth/v1/signin/with/provider",t.AUTH_SIGN_UP_URL="/auth/v1/signup",t.AUTH_TOKEN_URL="/auth/v1/token",t.AUTH_REVOKE_URL="/auth/v1/revoke",t.PROVIDER_BIND_URL="/auth/v1/user/provider/bind",t.PROVIDER_TOKEN_URL="/auth/v1/provider/token",t.PROVIDER_URI_URL="/auth/v1/provider/uri",t.USER_ME_URL="/auth/v1/user/me",t.WEDA_USER_URL="/auth/v1/plugin/weda/userinfo",t.USER_QUERY_URL="/auth/v1/user/query",t.USER_PRIFILE_URL="/auth/v1/user/profile",t.USER_TRANS_BY_PROVIDER_URL="/auth/v1/user/trans/by/provider",t.VERIFICATION_URL="/auth/v1/verification",t.VERIFY_URL="/auth/v1/verification/verify",t.CAPTCHA_DATA_URL="/auth/v1/captcha/data",t.VARIFY_CAPTCHA_DATA_URL="/auth/v1/captcha/data/verify",t.GET_CAPTCHA_URL="/auth/v1/captcha/init",t.PROVIDER_LIST="/auth/v1/user/provider",t.PROVIDER_UNBIND_URL="/auth/v1/user/provider",t.CHECK_PWD_URL="/auth/v1/user/sudo",t.SUDO_URL="/auth/v1/user/sudo",t.BIND_CONTACT_URL="/auth/v1/user/contact",t.AUTH_SET_PASSWORD="/auth/v1/user/password",t.AUTH_RESET_PASSWORD="/auth/v1/reset",t.AUTH_GET_DEVICE_CODE="/auth/v1/device/code",t.CHECK_USERNAME="/auth/v1/checkUsername",t.CHECK_IF_USER_EXIST="/auth/v1/checkIfUserExist",t.GET_PROVIDER_TYPE="/auth/v1/mgr/provider/providerSubType"}(o||(o={})),function(t){t.AUTH_SIGN_IN_URL="/auth/v2/signin/username",t.AUTH_TOKEN_URL="/auth/v2/token",t.USER_ME_URL="/auth/v2/user/me",t.VERIFY_URL="/auth/v2/signin/verificationcode",t.AUTH_SIGN_IN_WITH_PROVIDER_URL="/auth/v2/signin/with/provider",t.AUTH_PUBLIC_KEY="/auth/v2/signin/publichkey"}(s||(s={})),function(t){t.REGISTER="REGISTER",t.SIGN_IN="SIGN_IN",t.PASSWORD_RESET="PASSWORD_RESET",t.EMAIL_ADDRESS_CHANGE="EMAIL_ADDRESS_CHANGE",t.PHONE_NUMBER_CHANGE="PHONE_NUMBER_CHANGE"}(a||(a={})),function(t){t.INVALID_ARGUMENT="invalid_argument",t.DEADLINE_EXCEEDED="deadline_exceeded",t.NOT_FOUND="not_found",t.ALREADY_EXISTS="already_exists",t.PERMISSION_DENIED="permission_denied",t.ABORTED="aborted",t.OUT_OF_RANGE="out_of_range",t.UNIMPLEMENTED="unimplemented",t.INTERNAL="internal",t.UNAVAILABLE="unavailable",t.DATA_LOSS="data_loss",t.CAPTCHA_REQUIRED="captcha_required",t.CAPTCHA_INVALID="captcha_invalid",t.INVALID_PASSWORD="invalid_password",t.PASSWORD_NOT_SET="password_not_set",t.INVALID_STATUS="invalid_status",t.USER_PENDING="user_pending",t.USER_BLOCKED="user_blocked"}(u||(u={}));var l=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))},f=function(t,e){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(u){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,n=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=e.call(t,s)}catch(t){a=[6,t],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}},d=function(){function t(){this.fnPromiseMap=new Map}return t.prototype.run=function(t,e){return l(this,void 0,void 0,(function(){var r,n=this;return f(this,(function(i){switch(i.label){case 0:return[4,r=this.fnPromiseMap.get(t)];case 1:return i.sent()||(r=new Promise((function(r,i){l(n,void 0,void 0,(function(){var n,o,s;return f(this,(function(a){switch(a.label){case 0:return a.trys.push([0,3,4,5]),[4,this.runIdlePromise()];case 1:return a.sent(),n=e(),o=r,[4,n];case 2:return o.apply(void 0,[a.sent()]),[3,5];case 3:return s=a.sent(),i(s),[3,5];case 4:return this.fnPromiseMap.delete(t),[7];case 5:return[2]}}))}))})),this.fnPromiseMap.set(t,r)),[2,r]}}))}))},t.prototype.runIdlePromise=function(){return Promise.resolve()},t}(),p=function(){return p=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},p.apply(this,arguments)},g=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))},v=function(t,e){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(u){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,n=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=e.call(t,s)}catch(t){a=[6,t],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}},y="x-request-id",m="x-device-id",b="device_id",E=function(t,e){return g(this,void 0,void 0,(function(){var r,n,o,s,a;return v(this,(function(u){switch(u.label){case 0:r=null,n=null,u.label=1;case 1:return u.trys.push([1,4,,5]),(o=Object.assign({},e)).method||(o.method="GET"),o.body&&"string"!=typeof o.body&&(o.body=JSON.stringify(o.body)),[4,fetch(t,o)];case 2:return[4,u.sent().json()];case 3:return(null==(s=u.sent())?void 0:s.error)?(n=s).error_uri=new URL(t).pathname:r=s,[3,5];case 4:return a=u.sent(),n={error:i.UNREACHABLE,error_description:a.message,error_uri:new URL(t).pathname},[3,5];case 5:if(n)throw n;return[2,r]}}))}))},T=function(t,e){var r,n=e||{};if(t instanceof Error)r={error:n.error||i.LOCAL,error_description:n.error_description||t.message,error_uri:n.error_uri,details:n.details||t.stack};else{var o=t||{};r={error:n.error||o.error||i.LOCAL,error_description:n.error_description||o.error_description,error_uri:n.error_uri||o.error_uri,details:n.details||o.details}}return r};function S(){return c()}var _=new(function(){function t(){}return t.prototype.getItem=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,window.localStorage.getItem(t)]}))}))},t.prototype.removeItem=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return window.localStorage.removeItem(t),[2]}))}))},t.prototype.setItem=function(t,e){return g(this,void 0,void 0,(function(){return v(this,(function(r){return window.localStorage.setItem(t,e),[2]}))}))},t.prototype.getItemSync=function(t){return window.localStorage.getItem(t)},t.prototype.removeItemSync=function(t){window.localStorage.removeItem(t)},t.prototype.setItemSync=function(t,e){window.localStorage.setItem(t,e)},t}());function w(t){var e=!0;return(null==t?void 0:t.expires_at)&&(null==t?void 0:t.access_token)&&(e=t.expires_at<new Date),e}var R,I,D=function(){function t(t){this.credentials=null,this.singlePromise=new d,this.tokenSectionName=t.tokenSectionName,this.storage=t.storage}return t.prototype.getStorageCredentialsSync=function(){var t=null,e=this.storage.getItemSync(this.tokenSectionName);if(null!=e)try{(null==(t=JSON.parse(e))?void 0:t.expires_at)&&(t.expires_at=new Date(t.expires_at))}catch(e){this.storage.removeItem(this.tokenSectionName),t=null}return t},t.prototype.setCredentials=function(t){return g(this,void 0,void 0,(function(){var e;return v(this,(function(r){switch(r.label){case 0:return(null==t?void 0:t.expires_in)?(t.expires_at=new Date(Date.now()+1e3*(t.expires_in-30)),this.storage?(e=JSON.stringify(t),[4,this.storage.setItem(this.tokenSectionName,e)]):[3,2]):[3,3];case 1:r.sent(),r.label=2;case 2:return this.credentials=t,[3,6];case 3:return this.storage?[4,this.storage.removeItem(this.tokenSectionName)]:[3,5];case 4:r.sent(),r.label=5;case 5:this.credentials=null,r.label=6;case 6:return[2]}}))}))},t.prototype.getCredentials=function(){return g(this,void 0,void 0,(function(){var t=this;return v(this,(function(e){return[2,this.singlePromise.run("getCredentials",(function(){return g(t,void 0,void 0,(function(){var t;return v(this,(function(e){switch(e.label){case 0:return w(this.credentials)?(t=this,[4,this.getStorageCredentials()]):[3,2];case 1:t.credentials=e.sent(),e.label=2;case 2:return[2,this.credentials]}}))}))}))]}))}))},t.prototype.getStorageCredentials=function(){return g(this,void 0,void 0,(function(){var t=this;return v(this,(function(e){return[2,this.singlePromise.run("_getStorageCredentials",(function(){return g(t,void 0,void 0,(function(){var t,e;return v(this,(function(r){switch(r.label){case 0:return t=null,[4,this.storage.getItem(this.tokenSectionName)];case 1:if(null==(e=r.sent()))return[3,5];r.label=2;case 2:return r.trys.push([2,3,,5]),(null==(t=JSON.parse(e))?void 0:t.expires_at)&&(t.expires_at=new Date(t.expires_at)),[3,5];case 3:return r.sent(),[4,this.storage.removeItem(this.tokenSectionName)];case 4:return r.sent(),t=null,[3,5];case 5:return[2,t]}}))}))}))]}))}))},t}(),A=function(){function t(e){this.singlePromise=new d,this.apiOrigin=e.apiOrigin,this.clientId=e.clientId,this.retry=this.formatRetry(e.retry,t.defaultRetry),e.baseRequest?this.baseRequest=e.baseRequest:this.baseRequest=E,this.tokenInURL=e.tokenInURL,this.headers=e.headers,this.storage=e.storage||_,this.localCredentials=new D({tokenSectionName:"credentials_".concat(e.clientId),storage:this.storage}),this.clientSecret=e.clientSecret,this.refreshTokenFunc=e.refreshTokenFunc||this.defaultRefreshTokenFunc,this.anonymousSignInFunc=e.anonymousSignInFunc}return t.prototype.setCredentials=function(t){return this.localCredentials.setCredentials(t)},t.prototype.getAccessToken=function(){return g(this,void 0,void 0,(function(){var t,e;return v(this,(function(r){switch(r.label){case 0:return[4,this.getCredentials()];case 1:return(null==(t=r.sent())?void 0:t.access_token)?[2,Promise.resolve(t.access_token)]:(e={error:i.UNAUTHENTICATED},[2,Promise.reject(e)])}}))}))},t.prototype.request=function(e,r){return g(this,void 0,void 0,(function(){var n,o,s,a,u,h,c;return v(this,(function(l){switch(l.label){case 0:return r||(r={}),n=this.formatRetry(r.retry,this.retry),r.headers=r.headers||{},this.headers&&(r.headers=p(p({},this.headers),r.headers)),r.headers[y]||(r.headers[y]=S()),r.headers[m]?[3,2]:[4,this.getDeviceId()];case 1:o=l.sent(),r.headers[m]=o,l.label=2;case 2:return(null==r?void 0:r.withCredentials)?[4,this.getCredentials()]:[3,4];case 3:return(s=l.sent())&&(this.tokenInURL?(e.indexOf("?")<0&&(e+="?"),e+="access_token=".concat(s.access_token)):r.headers.Authorization="".concat(s.token_type," ").concat(s.access_token)),[3,5];case 4:this.clientId&&e.indexOf("client_id")<0&&(e+=e.indexOf("?")<0?"?":"&",e+="client_id=".concat(this.clientId)),l.label=5;case 5:e.startsWith("/")&&(e=this.apiOrigin+e),a=null,u=n+1,h=0,l.label=6;case 6:if(!(h<u))return[3,15];l.label=7;case 7:return l.trys.push([7,9,,12]),[4,this.baseRequest(e,r)];case 8:return a=l.sent(),[3,15];case 9:return c=l.sent(),r.withCredentials&&c&&c.error===i.UNAUTHENTICATED?[4,this.setCredentials(null)]:[3,11];case 10:return l.sent(),[2,Promise.reject(c)];case 11:return h!==n&&c&&"unreachable"===c.error?[3,12]:[2,Promise.reject(c)];case 12:return[4,this.sleep(t.retryInterval)];case 13:l.sent(),l.label=14;case 14:return h++,[3,6];case 15:return[2,a]}}))}))},t.prototype.getCredentials=function(){return g(this,void 0,void 0,(function(){var t,e,r;return v(this,(function(n){switch(n.label){case 0:return[4,this.localCredentials.getCredentials()];case 1:return w(t=n.sent())?t&&"anonymous"===t.scope?this.anonymousSignInFunc?[4,this.anonymousSignInFunc(t)]:[3,5]:[3,8]:[3,10];case 2:return e=n.sent(),(r=e)?[3,4]:[4,this.localCredentials.getCredentials()];case 3:r=n.sent(),n.label=4;case 4:return t=r,[3,7];case 5:return[4,this.anonymousSignIn(t)];case 6:t=n.sent(),n.label=7;case 7:return[3,10];case 8:return[4,this.refreshToken(t)];case 9:t=n.sent(),n.label=10;case 10:return[2,t]}}))}))},t.prototype.getCredentialsSync=function(){return this.localCredentials.getStorageCredentialsSync()},t.prototype.getCredentialsAsync=function(){return this.getCredentials()},t.prototype.getScope=function(){return g(this,void 0,void 0,(function(){var t;return v(this,(function(e){switch(e.label){case 0:return[4,this.localCredentials.getCredentials()];case 1:return(t=e.sent())?[2,t.scope]:[2,this.unAuthenticatedError("credentials not found")]}}))}))},t.prototype.getGroups=function(){return g(this,void 0,void 0,(function(){var t;return v(this,(function(e){switch(e.label){case 0:return[4,this.localCredentials.getCredentials()];case 1:return(t=e.sent())?[2,t.groups]:[2,this.unAuthenticatedError("credentials not found")]}}))}))},t.prototype.refreshToken=function(t){return g(this,void 0,void 0,(function(){var e=this;return v(this,(function(r){return[2,this.singlePromise.run("_refreshToken",(function(){return g(e,void 0,void 0,(function(){var e,r;return v(this,(function(n){switch(n.label){case 0:if(!t||!t.refresh_token)return[2,this.unAuthenticatedError("no refresh token found in credentials")];n.label=1;case 1:return n.trys.push([1,4,,7]),[4,this.refreshTokenFunc(t.refresh_token,t)];case 2:return e=n.sent(),[4,this.localCredentials.setCredentials(e)];case 3:return n.sent(),[2,e];case 4:return(r=n.sent()).error!==i.INVALID_GRANT?[3,6]:[4,this.localCredentials.setCredentials(null)];case 5:return n.sent(),[2,this.unAuthenticatedError(r.error_description)];case 6:return[2,Promise.reject(r)];case 7:return[2]}}))}))}))]}))}))},t.prototype.checkRetry=function(e){var r=null;if(("number"!=typeof e||e<t.minRetry||e>t.maxRetry)&&(r={error:i.UNREACHABLE,error_description:"wrong options param: retry"}),r)throw r;return e},t.prototype.formatRetry=function(t,e){return void 0===t?e:this.checkRetry(t)},t.prototype.sleep=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,new Promise((function(e){setTimeout((function(){e()}),t)}))]}))}))},t.prototype.anonymousSignIn=function(t){return g(this,void 0,void 0,(function(){var e=this;return v(this,(function(r){return[2,this.singlePromise.run("_anonymous",(function(){return g(e,void 0,void 0,(function(){var e,r;return v(this,(function(n){switch(n.label){case 0:if(!t||"anonymous"!==t.scope)return[2,this.unAuthenticatedError("no anonymous in credentials")];n.label=1;case 1:return n.trys.push([1,4,,7]),[4,this.request("/auth/v1/signin/anonymously",{method:"POST",body:{client_id:this.clientId,client_secret:this.clientSecret}})];case 2:return e=n.sent(),[4,this.localCredentials.setCredentials(e)];case 3:return n.sent(),[2,e];case 4:return(r=n.sent()).error!==i.INVALID_GRANT?[3,6]:[4,this.localCredentials.setCredentials(null)];case 5:return n.sent(),[2,this.unAuthenticatedError(r.error_description)];case 6:return[2,Promise.reject(r)];case 7:return[2]}}))}))}))]}))}))},t.prototype.defaultRefreshTokenFunc=function(t,e){return g(this,void 0,void 0,(function(){var r,n;return v(this,(function(i){switch(i.label){case 0:return void 0===t||""===t?[2,this.unAuthenticatedError("refresh token not found")]:(r=o.AUTH_TOKEN_URL,"v2"===(null==e?void 0:e.version)&&(r=s.AUTH_TOKEN_URL),[4,this.request(r,{method:"POST",body:{client_id:this.clientId,client_secret:this.clientSecret,grant_type:"refresh_token",refresh_token:t}})]);case 1:return n=i.sent(),[2,p(p({},n),{version:(null==e?void 0:e.version)||"v1"})]}}))}))},t.prototype.getDeviceId=function(){return g(this,void 0,void 0,(function(){var t;return v(this,(function(e){switch(e.label){case 0:return this.deviceID?[2,this.deviceID]:[4,this.storage.getItem(b)];case 1:return"string"==typeof(t=e.sent())&&t.length>=16&&t.length<=48?[3,3]:(t=c(),[4,this.storage.setItem(b,t)]);case 2:e.sent(),e.label=3;case 3:return this.deviceID=t,[2,t]}}))}))},t.prototype.unAuthenticatedError=function(t){var e={error:i.UNAUTHENTICATED,error_description:t};return Promise.reject(e)},t.defaultRetry=2,t.minRetry=0,t.maxRetry=5,t.retryInterval=1e3,t}();function O(){var t=globalThis.wx;if(void 0===t)return!1;if(void 0===globalThis.Page)return!1;if(!t.getSystemInfoSync)return!1;if(!t.getStorageSync)return!1;if(!t.setStorageSync)return!1;if(!t.connectSocket)return!1;if(!t.request)return!1;try{if(!t.getSystemInfoSync())return!1;if("qq"===t.getSystemInfoSync().AppPlatform)return!1}catch(t){return!1}return!0}var C=!!navigator.userAgent.match(/miniprogram/i)||"miniprogram"===window.__wxjs_environment;function N(){C=C||void 0!==typeof window&&"miniprogram"===window.__wxjs_environment}function P(){return C}O()||((null===(R=null===window||void 0===window?void 0:window.WeixinJSBridge)||void 0===R?void 0:R.invoke)?N():"undefined"!=typeof document&&(null===(I=document.addEventListener)||void 0===I||I.call(document,"WeixinJSBridgeReady",N,!1)));var x,U=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))},L=function(t,e){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(u){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,n=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=e.call(t,s)}catch(t){a=[6,t],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}},V=function(){function t(t){t.openURIWithCallback||(t.openURIWithCallback=this.getDefaultOpenURIWithCallback()),t.storage||(t.storage=_),this.config=t,this.tokenSectionName="captcha_".concat(t.clientId)}return t.prototype.request=function(t,e){return U(this,void 0,void 0,(function(){var r,n,i,o;return L(this,(function(s){switch(s.label){case 0:return e||(e={}),e.method||(e.method="GET"),r="".concat(e.method,":").concat(t),n=t,e.withCaptcha?[4,this.appendCaptchaTokenToURL(t,r,!1)]:[3,2];case 1:n=s.sent(),s.label=2;case 2:return s.trys.push([2,4,,7]),[4,this.config.request(n,e)];case 3:return i=s.sent(),[3,7];case 4:return(o=s.sent()).error!==u.CAPTCHA_REQUIRED&&o.error!==u.CAPTCHA_INVALID?[3,6]:[4,this.appendCaptchaTokenToURL(t,r,o.error===u.CAPTCHA_INVALID)];case 5:return t=s.sent(),[2,this.config.request(t,e)];case 6:return[2,Promise.reject(o)];case 7:return[2,i]}}))}))},t.prototype.getDefaultOpenURIWithCallback=function(){if(!O()&&!P()&&(window.location.search.indexOf("__captcha")>0&&(document.body.style.display="none"),null===document.getElementById("captcha_panel_wrap"))){var t=document.createElement("div");t.style.cssText="background-color: rgba(0, 0, 0, 0.7);position: fixed;left: 0px;right: 0px;top: 0px;bottom: 0px;padding: 9vw 0 0 0;display: none;z-index:100;",t.setAttribute("id","captcha_panel_wrap"),setTimeout((function(){document.body.appendChild(t)}),0)}return this.defaultOpenURIWithCallback},t.prototype.defaultOpenURIWithCallback=function(t,e){return U(this,void 0,void 0,(function(){var r,n,i,o,s,a,h;return L(this,(function(c){return n=(r=e||{}).width,i=void 0===n?"355px":n,o=r.height,s=void 0===o?"355px":o,t.match(/^(data:.*)$/)?[2,Promise.reject({error:u.UNIMPLEMENTED,error_description:"need to impl captcha data"})]:(a=document.getElementById("captcha_panel_wrap"),h=document.createElement("iframe"),a.innerHTML="",h.setAttribute("src",t),h.setAttribute("id","review-panel-iframe"),h.style.cssText="min-width:".concat(i,";display:block;height:").concat(s,";margin:0 auto;background-color: rgb(255, 255, 255);border: none;"),a.appendChild(h),a.style.display="block",[2,new Promise((function(t,e){h.onload=function(){try{var r=window.location,n=h.contentWindow.location;if(n.host+n.pathname===r.host+r.pathname){a.style.display="none";var i=new URLSearchParams(n.search),o=i.get("captcha_token");return o?t({captcha_token:o,expires_in:Number(i.get("expires_in"))}):e({error:i.get("error"),error_description:i.get("error_description")})}a.style.display="block"}catch(t){a.style.display="block"}}}))])}))}))},t.prototype.getCaptchaToken=function(t,e){return U(this,void 0,void 0,(function(){var r,n,i,s,a,u;return L(this,(function(h){switch(h.label){case 0:return t?[3,2]:[4,this.findCaptchaToken()];case 1:if(r=h.sent())return[2,r];h.label=2;case 2:return O()||P()?[3,4]:(i="".concat(window.location.origin+window.location.pathname,"?__captcha=on"),[4,this.config.request(o.GET_CAPTCHA_URL,{method:"POST",body:{client_id:this.config.clientId,redirect_uri:i,state:e},withCredentials:!1})]);case 3:return(n=h.sent()).captcha_token?(s={captcha_token:n.captcha_token,expires_in:n.expires_in},this.saveCaptchaToken(s),[2,n.captcha_token]):[3,6];case 4:return[4,this.config.request(o.CAPTCHA_DATA_URL,{method:"POST",body:{state:e,redirect_uri:""},withCredentials:!1})];case 5:a=h.sent(),n={url:"".concat(a.data,"?state=").concat(encodeURIComponent(e),"&token=").concat(encodeURIComponent(a.token))},h.label=6;case 6:return[4,this.config.openURIWithCallback(n.url)];case 7:return u=h.sent(),this.saveCaptchaToken(u),[2,u.captcha_token]}}))}))},t.prototype.appendCaptchaTokenToURL=function(t,e,r){return U(this,void 0,void 0,(function(){var n;return L(this,(function(i){switch(i.label){case 0:return[4,this.getCaptchaToken(r,e)];case 1:return n=i.sent(),t.indexOf("?")>0?t+="&captcha_token=".concat(n):t+="?captcha_token=".concat(n),[2,t]}}))}))},t.prototype.saveCaptchaToken=function(t){return U(this,void 0,void 0,(function(){var e;return L(this,(function(r){switch(r.label){case 0:return t.expires_at=new Date(Date.now()+1e3*(t.expires_in-10)),e=JSON.stringify(t),[4,this.config.storage.setItem(this.tokenSectionName,e)];case 1:return r.sent(),[2]}}))}))},t.prototype.findCaptchaToken=function(){return U(this,void 0,void 0,(function(){var t,e;return L(this,(function(r){switch(r.label){case 0:return[4,this.config.storage.getItem(this.tokenSectionName)];case 1:if(null==(t=r.sent()))return[3,5];r.label=2;case 2:return r.trys.push([2,3,,5]),(null==(e=JSON.parse(t))?void 0:e.expires_at)&&(e.expires_at=new Date(e.expires_at)),e.expires_at<new Date?[2,null]:[2,e.captcha_token];case 3:return r.sent(),[4,this.config.storage.removeItem(this.tokenSectionName)];case 4:return r.sent(),[2,null];case 5:return[2,null]}}))}))},t}(),B=function(t){var e=function(e){for(var r in t)t.hasOwnProperty(r)&&(e[r]=B(t[r]));return e},r=null==t?"NullOrUndefined":Object.prototype.toString.call(t).slice(8,-1);if(["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"].includes(r))return t.slice();switch(r){case"Object":return e(Object.create(Object.getPrototypeOf(t)));case"Array":return e([]);case"Date":return new Date(t.valueOf());case"RegExp":return new RegExp(t.source,(t.global?"g":"")+(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.sticky?"y":"")+(t.unicode?"u":""));default:return t}},k=(x=function(t,e){return x=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},x(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}x(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),q="0123456789abcdefghijklmnopqrstuvwxyz";function H(t){return q.charAt(t)}function M(t,e){return t&e}function j(t,e){return t|e}function F(t,e){return t^e}function K(t,e){return t&~e}function G(t){if(0==t)return-1;var e=0;return 0==(65535&t)&&(t>>=16,e+=16),0==(255&t)&&(t>>=8,e+=8),0==(15&t)&&(t>>=4,e+=4),0==(3&t)&&(t>>=2,e+=2),0==(1&t)&&++e,e}function W(t){for(var e=0;0!=t;)t&=t-1,++e;return e}var Y="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",z="=";function Z(t){var e,r,n="";for(e=0;e+3<=t.length;e+=3)r=parseInt(t.substring(e,e+3),16),n+=Y.charAt(r>>6)+Y.charAt(63&r);for(e+1==t.length?(r=parseInt(t.substring(e,e+1),16),n+=Y.charAt(r<<2)):e+2==t.length&&(r=parseInt(t.substring(e,e+2),16),n+=Y.charAt(r>>2)+Y.charAt((3&r)<<4));(3&n.length)>0;)n+=z;return n}function Q(t){var e,r="",n=0,i=0;for(e=0;e<t.length&&t.charAt(e)!=z;++e){var o=Y.indexOf(t.charAt(e));o<0||(0==n?(r+=H(o>>2),i=3&o,n=1):1==n?(r+=H(i<<2|o>>4),i=15&o,n=2):2==n?(r+=H(i),r+=H(o>>2),i=3&o,n=3):(r+=H(i<<2|o>>4),r+=H(15&o),n=0))}return 1==n&&(r+=H(i<<2)),r}var $,J,X={decode:function(t){var e;if(void 0===J){var r="= \f\n\r\t \u2028\u2029";for(J=Object.create(null),e=0;e<64;++e)J["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e)]=e;for(e=0;e<r.length;++e)J[r.charAt(e)]=-1}var n=[],i=0,o=0;for(e=0;e<t.length;++e){var s=t.charAt(e);if("="==s)break;if(-1!=(s=J[s])){if(void 0===s)throw new Error("Illegal character at offset "+e);i|=s,++o>=4?(n[n.length]=i>>16,n[n.length]=i>>8&255,n[n.length]=255&i,i=0,o=0):i<<=6}}switch(o){case 1:throw new Error("Base64 encoding incomplete: at least 2 bits missing");case 2:n[n.length]=i>>10;break;case 3:n[n.length]=i>>16,n[n.length]=i>>8&255}return n},re:/-----BEGIN [^-]+-----([A-Za-z0-9+\/=\s]+)-----END [^-]+-----|begin-base64[^\n]+\n([A-Za-z0-9+\/=\s]+)====/,unarmor:function(t){var e=X.re.exec(t);if(e)if(e[1])t=e[1];else{if(!e[2])throw new Error("RegExp out of sync");t=e[2]}return X.decode(t)}},tt=1e13,et=function(){function t(t){this.buf=[+t||0]}return t.prototype.mulAdd=function(t,e){var r,n,i=this.buf,o=i.length;for(r=0;r<o;++r)(n=i[r]*t+e)<tt?e=0:n-=(e=0|n/tt)*tt,i[r]=n;e>0&&(i[r]=e)},t.prototype.sub=function(t){var e,r,n=this.buf,i=n.length;for(e=0;e<i;++e)(r=n[e]-t)<0?(r+=tt,t=1):t=0,n[e]=r;for(;0===n[n.length-1];)n.pop()},t.prototype.toString=function(t){if(10!=(t||10))throw new Error("only base 10 is supported");for(var e=this.buf,r=e[e.length-1].toString(),n=e.length-2;n>=0;--n)r+=(tt+e[n]).toString().substring(1);return r},t.prototype.valueOf=function(){for(var t=this.buf,e=0,r=t.length-1;r>=0;--r)e=e*tt+t[r];return e},t.prototype.simplify=function(){var t=this.buf;return 1==t.length?t[0]:this},t}(),rt="…",nt=/^(\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/,it=/^(\d\d\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/;function ot(t,e){return t.length>e&&(t=t.substring(0,e)+rt),t}var st,at=function(){function t(e,r){this.hexDigits="0123456789ABCDEF",e instanceof t?(this.enc=e.enc,this.pos=e.pos):(this.enc=e,this.pos=r)}return t.prototype.get=function(t){if(void 0===t&&(t=this.pos++),t>=this.enc.length)throw new Error("Requesting byte offset "+t+" on a stream of length "+this.enc.length);return"string"==typeof this.enc?this.enc.charCodeAt(t):this.enc[t]},t.prototype.hexByte=function(t){return this.hexDigits.charAt(t>>4&15)+this.hexDigits.charAt(15&t)},t.prototype.hexDump=function(t,e,r){for(var n="",i=t;i<e;++i)if(n+=this.hexByte(this.get(i)),!0!==r)switch(15&i){case 7:n+=" ";break;case 15:n+="\n";break;default:n+=" "}return n},t.prototype.isASCII=function(t,e){for(var r=t;r<e;++r){var n=this.get(r);if(n<32||n>176)return!1}return!0},t.prototype.parseStringISO=function(t,e){for(var r="",n=t;n<e;++n)r+=String.fromCharCode(this.get(n));return r},t.prototype.parseStringUTF=function(t,e){for(var r="",n=t;n<e;){var i=this.get(n++);r+=i<128?String.fromCharCode(i):i>191&&i<224?String.fromCharCode((31&i)<<6|63&this.get(n++)):String.fromCharCode((15&i)<<12|(63&this.get(n++))<<6|63&this.get(n++))}return r},t.prototype.parseStringBMP=function(t,e){for(var r,n,i="",o=t;o<e;)r=this.get(o++),n=this.get(o++),i+=String.fromCharCode(r<<8|n);return i},t.prototype.parseTime=function(t,e,r){var n=this.parseStringISO(t,e),i=(r?nt:it).exec(n);return i?(r&&(i[1]=+i[1],i[1]+=+i[1]<70?2e3:1900),n=i[1]+"-"+i[2]+"-"+i[3]+" "+i[4],i[5]&&(n+=":"+i[5],i[6]&&(n+=":"+i[6],i[7]&&(n+="."+i[7]))),i[8]&&(n+=" UTC","Z"!=i[8]&&(n+=i[8],i[9]&&(n+=":"+i[9]))),n):"Unrecognized time: "+n},t.prototype.parseInteger=function(t,e){for(var r,n=this.get(t),i=n>127,o=i?255:0,s="";n==o&&++t<e;)n=this.get(t);if(0==(r=e-t))return i?-1:0;if(r>4){for(s=n,r<<=3;0==(128&(+s^o));)s=+s<<1,--r;s="("+r+" bit)\n"}i&&(n-=256);for(var a=new et(n),u=t+1;u<e;++u)a.mulAdd(256,this.get(u));return s+a.toString()},t.prototype.parseBitString=function(t,e,r){for(var n=this.get(t),i="("+((e-t-1<<3)-n)+" bit)\n",o="",s=t+1;s<e;++s){for(var a=this.get(s),u=s==e-1?n:0,h=7;h>=u;--h)o+=a>>h&1?"1":"0";if(o.length>r)return i+ot(o,r)}return i+o},t.prototype.parseOctetString=function(t,e,r){if(this.isASCII(t,e))return ot(this.parseStringISO(t,e),r);var n=e-t,i="("+n+" byte)\n";n>(r/=2)&&(e=t+r);for(var o=t;o<e;++o)i+=this.hexByte(this.get(o));return n>r&&(i+=rt),i},t.prototype.parseOID=function(t,e,r){for(var n="",i=new et,o=0,s=t;s<e;++s){var a=this.get(s);if(i.mulAdd(128,127&a),o+=7,!(128&a)){if(""===n)if((i=i.simplify())instanceof et)i.sub(80),n="2."+i.toString();else{var u=i<80?i<40?0:1:2;n=u+"."+(i-40*u)}else n+="."+i.toString();if(n.length>r)return ot(n,r);i=new et,o=0}}return o>0&&(n+=".incomplete"),n},t}(),ut=function(){function t(t,e,r,n,i){if(!(n instanceof ht))throw new Error("Invalid tag value.");this.stream=t,this.header=e,this.length=r,this.tag=n,this.sub=i}return t.prototype.typeName=function(){switch(this.tag.tagClass){case 0:switch(this.tag.tagNumber){case 0:return"EOC";case 1:return"BOOLEAN";case 2:return"INTEGER";case 3:return"BIT_STRING";case 4:return"OCTET_STRING";case 5:return"NULL";case 6:return"OBJECT_IDENTIFIER";case 7:return"ObjectDescriptor";case 8:return"EXTERNAL";case 9:return"REAL";case 10:return"ENUMERATED";case 11:return"EMBEDDED_PDV";case 12:return"UTF8String";case 16:return"SEQUENCE";case 17:return"SET";case 18:return"NumericString";case 19:return"PrintableString";case 20:return"TeletexString";case 21:return"VideotexString";case 22:return"IA5String";case 23:return"UTCTime";case 24:return"GeneralizedTime";case 25:return"GraphicString";case 26:return"VisibleString";case 27:return"GeneralString";case 28:return"UniversalString";case 30:return"BMPString"}return"Universal_"+this.tag.tagNumber.toString();case 1:return"Application_"+this.tag.tagNumber.toString();case 2:return"["+this.tag.tagNumber.toString()+"]";case 3:return"Private_"+this.tag.tagNumber.toString()}},t.prototype.content=function(t){if(void 0===this.tag)return null;void 0===t&&(t=1/0);var e=this.posContent(),r=Math.abs(this.length);if(!this.tag.isUniversal())return null!==this.sub?"("+this.sub.length+" elem)":this.stream.parseOctetString(e,e+r,t);switch(this.tag.tagNumber){case 1:return 0===this.stream.get(e)?"false":"true";case 2:return this.stream.parseInteger(e,e+r);case 3:return this.sub?"("+this.sub.length+" elem)":this.stream.parseBitString(e,e+r,t);case 4:return this.sub?"("+this.sub.length+" elem)":this.stream.parseOctetString(e,e+r,t);case 6:return this.stream.parseOID(e,e+r,t);case 16:case 17:return null!==this.sub?"("+this.sub.length+" elem)":"(no elem)";case 12:return ot(this.stream.parseStringUTF(e,e+r),t);case 18:case 19:case 20:case 21:case 22:case 26:return ot(this.stream.parseStringISO(e,e+r),t);case 30:return ot(this.stream.parseStringBMP(e,e+r),t);case 23:case 24:return this.stream.parseTime(e,e+r,23==this.tag.tagNumber)}return null},t.prototype.toString=function(){return this.typeName()+"@"+this.stream.pos+"[header:"+this.header+",length:"+this.length+",sub:"+(null===this.sub?"null":this.sub.length)+"]"},t.prototype.toPrettyString=function(t){void 0===t&&(t="");var e=t+this.typeName()+" @"+this.stream.pos;if(this.length>=0&&(e+="+"),e+=this.length,this.tag.tagConstructed?e+=" (constructed)":!this.tag.isUniversal()||3!=this.tag.tagNumber&&4!=this.tag.tagNumber||null===this.sub||(e+=" (encapsulates)"),e+="\n",null!==this.sub){t+=" ";for(var r=0,n=this.sub.length;r<n;++r)e+=this.sub[r].toPrettyString(t)}return e},t.prototype.posStart=function(){return this.stream.pos},t.prototype.posContent=function(){return this.stream.pos+this.header},t.prototype.posEnd=function(){return this.stream.pos+this.header+Math.abs(this.length)},t.prototype.toHexString=function(){return this.stream.hexDump(this.posStart(),this.posEnd(),!0)},t.decodeLength=function(t){var e=t.get(),r=127&e;if(r==e)return r;if(r>6)throw new Error("Length over 48 bits not supported at position "+(t.pos-1));if(0===r)return null;e=0;for(var n=0;n<r;++n)e=256*e+t.get();return e},t.prototype.getHexStringValue=function(){var t=this.toHexString(),e=2*this.header,r=2*this.length;return t.substr(e,r)},t.decode=function(e){var r;r=e instanceof at?e:new at(e,0);var n=new at(r),i=new ht(r),o=t.decodeLength(r),s=r.pos,a=s-n.pos,u=null,h=function(){var e=[];if(null!==o){for(var n=s+o;r.pos<n;)e[e.length]=t.decode(r);if(r.pos!=n)throw new Error("Content size is not correct for container starting at offset "+s)}else try{for(;;){var i=t.decode(r);if(i.tag.isEOC())break;e[e.length]=i}o=s-r.pos}catch(t){throw new Error("Exception while decoding undefined length content: "+t)}return e};if(i.tagConstructed)u=h();else if(i.isUniversal()&&(3==i.tagNumber||4==i.tagNumber))try{if(3==i.tagNumber&&0!=r.get())throw new Error("BIT STRINGs with unused bits cannot encapsulate.");u=h();for(var c=0;c<u.length;++c)if(u[c].tag.isEOC())throw new Error("EOC is not supposed to be actual content.")}catch(t){u=null}if(null===u){if(null===o)throw new Error("We can't skip over an invalid tag with undefined length at offset "+s);r.pos=s+Math.abs(o)}return new t(n,a,o,i,u)},t}(),ht=function(){function t(t){var e=t.get();if(this.tagClass=e>>6,this.tagConstructed=0!=(32&e),this.tagNumber=31&e,31==this.tagNumber){var r=new et;do{e=t.get(),r.mulAdd(128,127&e)}while(128&e);this.tagNumber=r.simplify()}}return t.prototype.isUniversal=function(){return 0===this.tagClass},t.prototype.isEOC=function(){return 0===this.tagClass&&0===this.tagNumber},t}(),ct=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],lt=(1<<26)/ct[ct.length-1],ft=function(){function t(t,e,r){null!=t&&("number"==typeof t?this.fromNumber(t,e,r):null==e&&"string"!=typeof t?this.fromString(t,256):this.fromString(t,e))}return t.prototype.toString=function(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(16==t)e=4;else if(8==t)e=3;else if(2==t)e=1;else if(32==t)e=5;else{if(4!=t)return this.toRadix(t);e=2}var r,n=(1<<e)-1,i=!1,o="",s=this.t,a=this.DB-s*this.DB%e;if(s-- >0)for(a<this.DB&&(r=this[s]>>a)>0&&(i=!0,o=H(r));s>=0;)a<e?(r=(this[s]&(1<<a)-1)<<e-a,r|=this[--s]>>(a+=this.DB-e)):(r=this[s]>>(a-=e)&n,a<=0&&(a+=this.DB,--s)),r>0&&(i=!0),i&&(o+=H(r));return i?o:"0"},t.prototype.negate=function(){var e=yt();return t.ZERO.subTo(this,e),e},t.prototype.abs=function(){return this.s<0?this.negate():this},t.prototype.compareTo=function(t){var e=this.s-t.s;if(0!=e)return e;var r=this.t;if(0!=(e=r-t.t))return this.s<0?-e:e;for(;--r>=0;)if(0!=(e=this[r]-t[r]))return e;return 0},t.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+wt(this[this.t-1]^this.s&this.DM)},t.prototype.mod=function(e){var r=yt();return this.abs().divRemTo(e,null,r),this.s<0&&r.compareTo(t.ZERO)>0&&e.subTo(r,r),r},t.prototype.modPowInt=function(t,e){var r;return r=t<256||e.isEven()?new pt(e):new gt(e),this.exp(t,r)},t.prototype.clone=function(){var t=yt();return this.copyTo(t),t},t.prototype.intValue=function(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]},t.prototype.byteValue=function(){return 0==this.t?this.s:this[0]<<24>>24},t.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},t.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},t.prototype.toByteArray=function(){var t=this.t,e=[];e[0]=this.s;var r,n=this.DB-t*this.DB%8,i=0;if(t-- >0)for(n<this.DB&&(r=this[t]>>n)!=(this.s&this.DM)>>n&&(e[i++]=r|this.s<<this.DB-n);t>=0;)n<8?(r=(this[t]&(1<<n)-1)<<8-n,r|=this[--t]>>(n+=this.DB-8)):(r=this[t]>>(n-=8)&255,n<=0&&(n+=this.DB,--t)),0!=(128&r)&&(r|=-256),0==i&&(128&this.s)!=(128&r)&&++i,(i>0||r!=this.s)&&(e[i++]=r);return e},t.prototype.equals=function(t){return 0==this.compareTo(t)},t.prototype.min=function(t){return this.compareTo(t)<0?this:t},t.prototype.max=function(t){return this.compareTo(t)>0?this:t},t.prototype.and=function(t){var e=yt();return this.bitwiseTo(t,M,e),e},t.prototype.or=function(t){var e=yt();return this.bitwiseTo(t,j,e),e},t.prototype.xor=function(t){var e=yt();return this.bitwiseTo(t,F,e),e},t.prototype.andNot=function(t){var e=yt();return this.bitwiseTo(t,K,e),e},t.prototype.not=function(){for(var t=yt(),e=0;e<this.t;++e)t[e]=this.DM&~this[e];return t.t=this.t,t.s=~this.s,t},t.prototype.shiftLeft=function(t){var e=yt();return t<0?this.rShiftTo(-t,e):this.lShiftTo(t,e),e},t.prototype.shiftRight=function(t){var e=yt();return t<0?this.lShiftTo(-t,e):this.rShiftTo(t,e),e},t.prototype.getLowestSetBit=function(){for(var t=0;t<this.t;++t)if(0!=this[t])return t*this.DB+G(this[t]);return this.s<0?this.t*this.DB:-1},t.prototype.bitCount=function(){for(var t=0,e=this.s&this.DM,r=0;r<this.t;++r)t+=W(this[r]^e);return t},t.prototype.testBit=function(t){var e=Math.floor(t/this.DB);return e>=this.t?0!=this.s:0!=(this[e]&1<<t%this.DB)},t.prototype.setBit=function(t){return this.changeBit(t,j)},t.prototype.clearBit=function(t){return this.changeBit(t,K)},t.prototype.flipBit=function(t){return this.changeBit(t,F)},t.prototype.add=function(t){var e=yt();return this.addTo(t,e),e},t.prototype.subtract=function(t){var e=yt();return this.subTo(t,e),e},t.prototype.multiply=function(t){var e=yt();return this.multiplyTo(t,e),e},t.prototype.divide=function(t){var e=yt();return this.divRemTo(t,e,null),e},t.prototype.remainder=function(t){var e=yt();return this.divRemTo(t,null,e),e},t.prototype.divideAndRemainder=function(t){var e=yt(),r=yt();return this.divRemTo(t,e,r),[e,r]},t.prototype.modPow=function(t,e){var r,n,i=t.bitLength(),o=_t(1);if(i<=0)return o;r=i<18?1:i<48?3:i<144?4:i<768?5:6,n=i<8?new pt(e):e.isEven()?new vt(e):new gt(e);var s=[],a=3,u=r-1,h=(1<<r)-1;if(s[1]=n.convert(this),r>1){var c=yt();for(n.sqrTo(s[1],c);a<=h;)s[a]=yt(),n.mulTo(c,s[a-2],s[a]),a+=2}var l,f,d=t.t-1,p=!0,g=yt();for(i=wt(t[d])-1;d>=0;){for(i>=u?l=t[d]>>i-u&h:(l=(t[d]&(1<<i+1)-1)<<u-i,d>0&&(l|=t[d-1]>>this.DB+i-u)),a=r;0==(1&l);)l>>=1,--a;if((i-=a)<0&&(i+=this.DB,--d),p)s[l].copyTo(o),p=!1;else{for(;a>1;)n.sqrTo(o,g),n.sqrTo(g,o),a-=2;a>0?n.sqrTo(o,g):(f=o,o=g,g=f),n.mulTo(g,s[l],o)}for(;d>=0&&0==(t[d]&1<<i);)n.sqrTo(o,g),f=o,o=g,g=f,--i<0&&(i=this.DB-1,--d)}return n.revert(o)},t.prototype.modInverse=function(e){var r=e.isEven();if(this.isEven()&&r||0==e.signum())return t.ZERO;for(var n=e.clone(),i=this.clone(),o=_t(1),s=_t(0),a=_t(0),u=_t(1);0!=n.signum();){for(;n.isEven();)n.rShiftTo(1,n),r?(o.isEven()&&s.isEven()||(o.addTo(this,o),s.subTo(e,s)),o.rShiftTo(1,o)):s.isEven()||s.subTo(e,s),s.rShiftTo(1,s);for(;i.isEven();)i.rShiftTo(1,i),r?(a.isEven()&&u.isEven()||(a.addTo(this,a),u.subTo(e,u)),a.rShiftTo(1,a)):u.isEven()||u.subTo(e,u),u.rShiftTo(1,u);n.compareTo(i)>=0?(n.subTo(i,n),r&&o.subTo(a,o),s.subTo(u,s)):(i.subTo(n,i),r&&a.subTo(o,a),u.subTo(s,u))}return 0!=i.compareTo(t.ONE)?t.ZERO:u.compareTo(e)>=0?u.subtract(e):u.signum()<0?(u.addTo(e,u),u.signum()<0?u.add(e):u):u},t.prototype.pow=function(t){return this.exp(t,new dt)},t.prototype.gcd=function(t){var e=this.s<0?this.negate():this.clone(),r=t.s<0?t.negate():t.clone();if(e.compareTo(r)<0){var n=e;e=r,r=n}var i=e.getLowestSetBit(),o=r.getLowestSetBit();if(o<0)return e;for(i<o&&(o=i),o>0&&(e.rShiftTo(o,e),r.rShiftTo(o,r));e.signum()>0;)(i=e.getLowestSetBit())>0&&e.rShiftTo(i,e),(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),e.compareTo(r)>=0?(e.subTo(r,e),e.rShiftTo(1,e)):(r.subTo(e,r),r.rShiftTo(1,r));return o>0&&r.lShiftTo(o,r),r},t.prototype.isProbablePrime=function(t){var e,r=this.abs();if(1==r.t&&r[0]<=ct[ct.length-1]){for(e=0;e<ct.length;++e)if(r[0]==ct[e])return!0;return!1}if(r.isEven())return!1;for(e=1;e<ct.length;){for(var n=ct[e],i=e+1;i<ct.length&&n<lt;)n*=ct[i++];for(n=r.modInt(n);e<i;)if(n%ct[e++]==0)return!1}return r.millerRabin(t)},t.prototype.copyTo=function(t){for(var e=this.t-1;e>=0;--e)t[e]=this[e];t.t=this.t,t.s=this.s},t.prototype.fromInt=function(t){this.t=1,this.s=t<0?-1:0,t>0?this[0]=t:t<-1?this[0]=t+this.DV:this.t=0},t.prototype.fromString=function(e,r){var n;if(16==r)n=4;else if(8==r)n=3;else if(256==r)n=8;else if(2==r)n=1;else if(32==r)n=5;else{if(4!=r)return void this.fromRadix(e,r);n=2}this.t=0,this.s=0;for(var i=e.length,o=!1,s=0;--i>=0;){var a=8==n?255&+e[i]:St(e,i);a<0?"-"==e.charAt(i)&&(o=!0):(o=!1,0==s?this[this.t++]=a:s+n>this.DB?(this[this.t-1]|=(a&(1<<this.DB-s)-1)<<s,this[this.t++]=a>>this.DB-s):this[this.t-1]|=a<<s,(s+=n)>=this.DB&&(s-=this.DB))}8==n&&0!=(128&+e[0])&&(this.s=-1,s>0&&(this[this.t-1]|=(1<<this.DB-s)-1<<s)),this.clamp(),o&&t.ZERO.subTo(this,this)},t.prototype.clamp=function(){for(var t=this.s&this.DM;this.t>0&&this[this.t-1]==t;)--this.t},t.prototype.dlShiftTo=function(t,e){var r;for(r=this.t-1;r>=0;--r)e[r+t]=this[r];for(r=t-1;r>=0;--r)e[r]=0;e.t=this.t+t,e.s=this.s},t.prototype.drShiftTo=function(t,e){for(var r=t;r<this.t;++r)e[r-t]=this[r];e.t=Math.max(this.t-t,0),e.s=this.s},t.prototype.lShiftTo=function(t,e){for(var r=t%this.DB,n=this.DB-r,i=(1<<n)-1,o=Math.floor(t/this.DB),s=this.s<<r&this.DM,a=this.t-1;a>=0;--a)e[a+o+1]=this[a]>>n|s,s=(this[a]&i)<<r;for(a=o-1;a>=0;--a)e[a]=0;e[o]=s,e.t=this.t+o+1,e.s=this.s,e.clamp()},t.prototype.rShiftTo=function(t,e){e.s=this.s;var r=Math.floor(t/this.DB);if(r>=this.t)e.t=0;else{var n=t%this.DB,i=this.DB-n,o=(1<<n)-1;e[0]=this[r]>>n;for(var s=r+1;s<this.t;++s)e[s-r-1]|=(this[s]&o)<<i,e[s-r]=this[s]>>n;n>0&&(e[this.t-r-1]|=(this.s&o)<<i),e.t=this.t-r,e.clamp()}},t.prototype.subTo=function(t,e){for(var r=0,n=0,i=Math.min(t.t,this.t);r<i;)n+=this[r]-t[r],e[r++]=n&this.DM,n>>=this.DB;if(t.t<this.t){for(n-=t.s;r<this.t;)n+=this[r],e[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<t.t;)n-=t[r],e[r++]=n&this.DM,n>>=this.DB;n-=t.s}e.s=n<0?-1:0,n<-1?e[r++]=this.DV+n:n>0&&(e[r++]=n),e.t=r,e.clamp()},t.prototype.multiplyTo=function(e,r){var n=this.abs(),i=e.abs(),o=n.t;for(r.t=o+i.t;--o>=0;)r[o]=0;for(o=0;o<i.t;++o)r[o+n.t]=n.am(0,i[o],r,o,0,n.t);r.s=0,r.clamp(),this.s!=e.s&&t.ZERO.subTo(r,r)},t.prototype.squareTo=function(t){for(var e=this.abs(),r=t.t=2*e.t;--r>=0;)t[r]=0;for(r=0;r<e.t-1;++r){var n=e.am(r,e[r],t,2*r,0,1);(t[r+e.t]+=e.am(r+1,2*e[r],t,2*r+1,n,e.t-r-1))>=e.DV&&(t[r+e.t]-=e.DV,t[r+e.t+1]=1)}t.t>0&&(t[t.t-1]+=e.am(r,e[r],t,2*r,0,1)),t.s=0,t.clamp()},t.prototype.divRemTo=function(e,r,n){var i=e.abs();if(!(i.t<=0)){var o=this.abs();if(o.t<i.t)return null!=r&&r.fromInt(0),void(null!=n&&this.copyTo(n));null==n&&(n=yt());var s=yt(),a=this.s,u=e.s,h=this.DB-wt(i[i.t-1]);h>0?(i.lShiftTo(h,s),o.lShiftTo(h,n)):(i.copyTo(s),o.copyTo(n));var c=s.t,l=s[c-1];if(0!=l){var f=l*(1<<this.F1)+(c>1?s[c-2]>>this.F2:0),d=this.FV/f,p=(1<<this.F1)/f,g=1<<this.F2,v=n.t,y=v-c,m=null==r?yt():r;for(s.dlShiftTo(y,m),n.compareTo(m)>=0&&(n[n.t++]=1,n.subTo(m,n)),t.ONE.dlShiftTo(c,m),m.subTo(s,s);s.t<c;)s[s.t++]=0;for(;--y>=0;){var b=n[--v]==l?this.DM:Math.floor(n[v]*d+(n[v-1]+g)*p);if((n[v]+=s.am(0,b,n,y,0,c))<b)for(s.dlShiftTo(y,m),n.subTo(m,n);n[v]<--b;)n.subTo(m,n)}null!=r&&(n.drShiftTo(c,r),a!=u&&t.ZERO.subTo(r,r)),n.t=c,n.clamp(),h>0&&n.rShiftTo(h,n),a<0&&t.ZERO.subTo(n,n)}}},t.prototype.invDigit=function(){if(this.t<1)return 0;var t=this[0];if(0==(1&t))return 0;var e=3&t;return(e=(e=(e=(e=e*(2-(15&t)*e)&15)*(2-(255&t)*e)&255)*(2-((65535&t)*e&65535))&65535)*(2-t*e%this.DV)%this.DV)>0?this.DV-e:-e},t.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)},t.prototype.exp=function(e,r){if(e>4294967295||e<1)return t.ONE;var n=yt(),i=yt(),o=r.convert(this),s=wt(e)-1;for(o.copyTo(n);--s>=0;)if(r.sqrTo(n,i),(e&1<<s)>0)r.mulTo(i,o,n);else{var a=n;n=i,i=a}return r.revert(n)},t.prototype.chunkSize=function(t){return Math.floor(Math.LN2*this.DB/Math.log(t))},t.prototype.toRadix=function(t){if(null==t&&(t=10),0==this.signum()||t<2||t>36)return"0";var e=this.chunkSize(t),r=Math.pow(t,e),n=_t(r),i=yt(),o=yt(),s="";for(this.divRemTo(n,i,o);i.signum()>0;)s=(r+o.intValue()).toString(t).substr(1)+s,i.divRemTo(n,i,o);return o.intValue().toString(t)+s},t.prototype.fromRadix=function(e,r){this.fromInt(0),null==r&&(r=10);for(var n=this.chunkSize(r),i=Math.pow(r,n),o=!1,s=0,a=0,u=0;u<e.length;++u){var h=St(e,u);h<0?"-"==e.charAt(u)&&0==this.signum()&&(o=!0):(a=r*a+h,++s>=n&&(this.dMultiply(i),this.dAddOffset(a,0),s=0,a=0))}s>0&&(this.dMultiply(Math.pow(r,s)),this.dAddOffset(a,0)),o&&t.ZERO.subTo(this,this)},t.prototype.fromNumber=function(e,r,n){if("number"==typeof r)if(e<2)this.fromInt(1);else for(this.fromNumber(e,n),this.testBit(e-1)||this.bitwiseTo(t.ONE.shiftLeft(e-1),j,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(r);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(t.ONE.shiftLeft(e-1),this);else{var i=[],o=7&e;i.length=1+(e>>3),r.nextBytes(i),o>0?i[0]&=(1<<o)-1:i[0]=0,this.fromString(i,256)}},t.prototype.bitwiseTo=function(t,e,r){var n,i,o=Math.min(t.t,this.t);for(n=0;n<o;++n)r[n]=e(this[n],t[n]);if(t.t<this.t){for(i=t.s&this.DM,n=o;n<this.t;++n)r[n]=e(this[n],i);r.t=this.t}else{for(i=this.s&this.DM,n=o;n<t.t;++n)r[n]=e(i,t[n]);r.t=t.t}r.s=e(this.s,t.s),r.clamp()},t.prototype.changeBit=function(e,r){var n=t.ONE.shiftLeft(e);return this.bitwiseTo(n,r,n),n},t.prototype.addTo=function(t,e){for(var r=0,n=0,i=Math.min(t.t,this.t);r<i;)n+=this[r]+t[r],e[r++]=n&this.DM,n>>=this.DB;if(t.t<this.t){for(n+=t.s;r<this.t;)n+=this[r],e[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<t.t;)n+=t[r],e[r++]=n&this.DM,n>>=this.DB;n+=t.s}e.s=n<0?-1:0,n>0?e[r++]=n:n<-1&&(e[r++]=this.DV+n),e.t=r,e.clamp()},t.prototype.dMultiply=function(t){this[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()},t.prototype.dAddOffset=function(t,e){if(0!=t){for(;this.t<=e;)this[this.t++]=0;for(this[e]+=t;this[e]>=this.DV;)this[e]-=this.DV,++e>=this.t&&(this[this.t++]=0),++this[e]}},t.prototype.multiplyLowerTo=function(t,e,r){var n=Math.min(this.t+t.t,e);for(r.s=0,r.t=n;n>0;)r[--n]=0;for(var i=r.t-this.t;n<i;++n)r[n+this.t]=this.am(0,t[n],r,n,0,this.t);for(i=Math.min(t.t,e);n<i;++n)this.am(0,t[n],r,n,0,e-n);r.clamp()},t.prototype.multiplyUpperTo=function(t,e,r){--e;var n=r.t=this.t+t.t-e;for(r.s=0;--n>=0;)r[n]=0;for(n=Math.max(e-this.t,0);n<t.t;++n)r[this.t+n-e]=this.am(e-n,t[n],r,0,0,this.t+n-e);r.clamp(),r.drShiftTo(1,r)},t.prototype.modInt=function(t){if(t<=0)return 0;var e=this.DV%t,r=this.s<0?t-1:0;if(this.t>0)if(0==e)r=this[0]%t;else for(var n=this.t-1;n>=0;--n)r=(e*r+this[n])%t;return r},t.prototype.millerRabin=function(e){var r=this.subtract(t.ONE),n=r.getLowestSetBit();if(n<=0)return!1;var i=r.shiftRight(n);(e=e+1>>1)>ct.length&&(e=ct.length);for(var o=yt(),s=0;s<e;++s){o.fromInt(ct[Math.floor(Math.random()*ct.length)]);var a=o.modPow(i,this);if(0!=a.compareTo(t.ONE)&&0!=a.compareTo(r)){for(var u=1;u++<n&&0!=a.compareTo(r);)if(0==(a=a.modPowInt(2,this)).compareTo(t.ONE))return!1;if(0!=a.compareTo(r))return!1}}return!0},t.prototype.square=function(){var t=yt();return this.squareTo(t),t},t.prototype.gcda=function(t,e){var r=this.s<0?this.negate():this.clone(),n=t.s<0?t.negate():t.clone();if(r.compareTo(n)<0){var i=r;r=n,n=i}var o=r.getLowestSetBit(),s=n.getLowestSetBit();if(s<0)e(r);else{o<s&&(s=o),s>0&&(r.rShiftTo(s,r),n.rShiftTo(s,n));var a=function(){(o=r.getLowestSetBit())>0&&r.rShiftTo(o,r),(o=n.getLowestSetBit())>0&&n.rShiftTo(o,n),r.compareTo(n)>=0?(r.subTo(n,r),r.rShiftTo(1,r)):(n.subTo(r,n),n.rShiftTo(1,n)),r.signum()>0?setTimeout(a,0):(s>0&&n.lShiftTo(s,n),setTimeout((function(){e(n)}),0))};setTimeout(a,10)}},t.prototype.fromNumberAsync=function(e,r,n,i){if("number"==typeof r)if(e<2)this.fromInt(1);else{this.fromNumber(e,n),this.testBit(e-1)||this.bitwiseTo(t.ONE.shiftLeft(e-1),j,this),this.isEven()&&this.dAddOffset(1,0);var o=this,s=function(){o.dAddOffset(2,0),o.bitLength()>e&&o.subTo(t.ONE.shiftLeft(e-1),o),o.isProbablePrime(r)?setTimeout((function(){i()}),0):setTimeout(s,0)};setTimeout(s,0)}else{var a=[],u=7&e;a.length=1+(e>>3),r.nextBytes(a),u>0?a[0]&=(1<<u)-1:a[0]=0,this.fromString(a,256)}},t}(),dt=function(){function t(){}return t.prototype.convert=function(t){return t},t.prototype.revert=function(t){return t},t.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r)},t.prototype.sqrTo=function(t,e){t.squareTo(e)},t}(),pt=function(){function t(t){this.m=t}return t.prototype.convert=function(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t},t.prototype.revert=function(t){return t},t.prototype.reduce=function(t){t.divRemTo(this.m,null,t)},t.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},t.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},t}(),gt=function(){function t(t){this.m=t,this.mp=t.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<t.DB-15)-1,this.mt2=2*t.t}return t.prototype.convert=function(t){var e=yt();return t.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),t.s<0&&e.compareTo(ft.ZERO)>0&&this.m.subTo(e,e),e},t.prototype.revert=function(t){var e=yt();return t.copyTo(e),this.reduce(e),e},t.prototype.reduce=function(t){for(;t.t<=this.mt2;)t[t.t++]=0;for(var e=0;e<this.m.t;++e){var r=32767&t[e],n=r*this.mpl+((r*this.mph+(t[e]>>15)*this.mpl&this.um)<<15)&t.DM;for(t[r=e+this.m.t]+=this.m.am(0,n,t,e,0,this.m.t);t[r]>=t.DV;)t[r]-=t.DV,t[++r]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)},t.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},t.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},t}(),vt=function(){function t(t){this.m=t,this.r2=yt(),this.q3=yt(),ft.ONE.dlShiftTo(2*t.t,this.r2),this.mu=this.r2.divide(t)}return t.prototype.convert=function(t){if(t.s<0||t.t>2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=yt();return t.copyTo(e),this.reduce(e),e},t.prototype.revert=function(t){return t},t.prototype.reduce=function(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)},t.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},t.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},t}();function yt(){return new ft(null)}function mt(t,e){return new ft(t,e)}"Microsoft Internet Explorer"==(null===navigator||void 0===navigator?void 0:navigator.appName)?(ft.prototype.am=function(t,e,r,n,i,o){for(var s=32767&e,a=e>>15;--o>=0;){var u=32767&this[t],h=this[t++]>>15,c=a*u+h*s;i=((u=s*u+((32767&c)<<15)+r[n]+(1073741823&i))>>>30)+(c>>>15)+a*h+(i>>>30),r[n++]=1073741823&u}return i},st=30):"Netscape"!=(null===navigator||void 0===navigator?void 0:navigator.appName)?(ft.prototype.am=function(t,e,r,n,i,o){for(;--o>=0;){var s=e*this[t++]+r[n]+i;i=Math.floor(s/67108864),r[n++]=67108863&s}return i},st=26):(ft.prototype.am=function(t,e,r,n,i,o){for(var s=16383&e,a=e>>14;--o>=0;){var u=16383&this[t],h=this[t++]>>14,c=a*u+h*s;i=((u=s*u+((16383&c)<<14)+r[n]+i)>>28)+(c>>14)+a*h,r[n++]=268435455&u}return i},st=28),ft.prototype.DB=st,ft.prototype.DM=(1<<st)-1,ft.prototype.DV=1<<st,ft.prototype.FV=Math.pow(2,52),ft.prototype.F1=52-st,ft.prototype.F2=2*st-52;var bt,Et,Tt=[];for(bt="0".charCodeAt(0),Et=0;Et<=9;++Et)Tt[bt++]=Et;for(bt="a".charCodeAt(0),Et=10;Et<36;++Et)Tt[bt++]=Et;for(bt="A".charCodeAt(0),Et=10;Et<36;++Et)Tt[bt++]=Et;function St(t,e){var r=Tt[t.charCodeAt(e)];return null==r?-1:r}function _t(t){var e=yt();return e.fromInt(t),e}function wt(t){var e,r=1;return 0!=(e=t>>>16)&&(t=e,r+=16),0!=(e=t>>8)&&(t=e,r+=8),0!=(e=t>>4)&&(t=e,r+=4),0!=(e=t>>2)&&(t=e,r+=2),0!=(e=t>>1)&&(t=e,r+=1),r}ft.ZERO=_t(0),ft.ONE=_t(1);var Rt,It,Dt=function(){function t(){this.i=0,this.j=0,this.S=[]}return t.prototype.init=function(t){var e,r,n;for(e=0;e<256;++e)this.S[e]=e;for(r=0,e=0;e<256;++e)r=r+this.S[e]+t[e%t.length]&255,n=this.S[e],this.S[e]=this.S[r],this.S[r]=n;this.i=0,this.j=0},t.prototype.next=function(){var t;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,t=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=t,this.S[t+this.S[this.i]&255]},t}(),At=256,Ot=null;if(null==Ot){Ot=[],It=0;var Ct=void 0;if((null===window||void 0===window?void 0:window.crypto)&&(null===window||void 0===window?void 0:window.crypto.getRandomValues)){var Nt=new Uint32Array(256);for(null===window||void 0===window||window.crypto.getRandomValues(Nt),Ct=0;Ct<Nt.length;++Ct)Ot[It++]=255&Nt[Ct]}var Pt=function(t){if(this.count=this.count||0,this.count>=256||It>=At)(null===window||void 0===window?void 0:window.removeEventListener)?null===window||void 0===window||window.removeEventListener("mousemove",Pt,!1):(null===window||void 0===window?void 0:window.detachEvent)&&(null===window||void 0===window||window.detachEvent("onmousemove",Pt));else try{var e=t.x+t.y;Ot[It++]=255&e,this.count+=1}catch(t){}};(null===window||void 0===window?void 0:window.addEventListener)?null===window||void 0===window||window.addEventListener("mousemove",Pt,!1):(null===window||void 0===window?void 0:window.attachEvent)&&(null===window||void 0===window||window.attachEvent("onmousemove",Pt))}function xt(){if(null==Rt){for(Rt=new Dt;It<At;){var t=Math.floor(65536*Math.random());Ot[It++]=255&t}for(Rt.init(Ot),It=0;It<Ot.length;++It)Ot[It]=0;It=0}return Rt.next()}var Ut=function(){function t(){}return t.prototype.nextBytes=function(t){for(var e=0;e<t.length;++e)t[e]=xt()},t}(),Lt=function(){function t(){this.n=null,this.e=0,this.d=null,this.p=null,this.q=null,this.dmp1=null,this.dmq1=null,this.coeff=null}return t.prototype.doPublic=function(t){return t.modPowInt(this.e,this.n)},t.prototype.doPrivate=function(t){if(null==this.p||null==this.q)return t.modPow(this.d,this.n);for(var e=t.mod(this.p).modPow(this.dmp1,this.p),r=t.mod(this.q).modPow(this.dmq1,this.q);e.compareTo(r)<0;)e=e.add(this.p);return e.subtract(r).multiply(this.coeff).mod(this.p).multiply(this.q).add(r)},t.prototype.setPublic=function(t,e){null!=t&&null!=e&&t.length>0&&e.length>0?(this.n=mt(t,16),this.e=parseInt(e,16)):console.error("Invalid RSA public key")},t.prototype.encrypt=function(t){var e=function(t,e){if(e<t.length+11)return console.error("Message too long for RSA"),null;for(var r=[],n=t.length-1;n>=0&&e>0;){var i=t.charCodeAt(n--);i<128?r[--e]=i:i>127&&i<2048?(r[--e]=63&i|128,r[--e]=i>>6|192):(r[--e]=63&i|128,r[--e]=i>>6&63|128,r[--e]=i>>12|224)}r[--e]=0;for(var o=new Ut,s=[];e>2;){for(s[0]=0;0==s[0];)o.nextBytes(s);r[--e]=s[0]}return r[--e]=2,r[--e]=0,new ft(r)}(t,this.n.bitLength()+7>>3);if(null==e)return null;var r=this.doPublic(e);if(null==r)return null;var n=r.toString(16);return 0==(1&n.length)?n:"0"+n},t.prototype.encryptLong=function(t){var e=this,r=(this.n.bitLength()+7>>3)-11;try{var n="";return t.length>r?(t.match(/.{1,117}/g).forEach((function(t){var r=e.encrypt(t);n+=r})),Z(n)):Z(this.encrypt(t))}catch(t){return!1}},t.prototype.decryptLong=function(t){var e=this,r=this.n.bitLength()+7>>3;t=Q(t);try{if(t.length>r){var n="";return t.match(/.{1,256}/g).forEach((function(t){var r=e.decrypt(t);n+=r})),n}return this.decrypt(t)}catch(t){return!1}},t.prototype.setPrivate=function(t,e,r){null!=t&&null!=e&&t.length>0&&e.length>0?(this.n=mt(t,16),this.e=parseInt(e,16),this.d=mt(r,16)):console.error("Invalid RSA private key")},t.prototype.setPrivateEx=function(t,e,r,n,i,o,s,a){null!=t&&null!=e&&t.length>0&&e.length>0?(this.n=mt(t,16),this.e=parseInt(e,16),this.d=mt(r,16),this.p=mt(n,16),this.q=mt(i,16),this.dmp1=mt(o,16),this.dmq1=mt(s,16),this.coeff=mt(a,16)):console.error("Invalid RSA private key")},t.prototype.generate=function(t,e){var r=new Ut,n=t>>1;this.e=parseInt(e,16);for(var i=new ft(e,16);;){for(;this.p=new ft(t-n,1,r),0!=this.p.subtract(ft.ONE).gcd(i).compareTo(ft.ONE)||!this.p.isProbablePrime(10););for(;this.q=new ft(n,1,r),0!=this.q.subtract(ft.ONE).gcd(i).compareTo(ft.ONE)||!this.q.isProbablePrime(10););if(this.p.compareTo(this.q)<=0){var o=this.p;this.p=this.q,this.q=o}var s=this.p.subtract(ft.ONE),a=this.q.subtract(ft.ONE),u=s.multiply(a);if(0==u.gcd(i).compareTo(ft.ONE)){this.n=this.p.multiply(this.q),this.d=i.modInverse(u),this.dmp1=this.d.mod(s),this.dmq1=this.d.mod(a),this.coeff=this.q.modInverse(this.p);break}}},t.prototype.decrypt=function(t){var e=mt(t,16),r=this.doPrivate(e);return null==r?null:function(t,e){for(var r=t.toByteArray(),n=0;n<r.length&&0==r[n];)++n;if(r.length-n!=e-1||2!=r[n])return null;for(++n;0!=r[n];)if(++n>=r.length)return null;for(var i="";++n<r.length;){var o=255&r[n];o<128?i+=String.fromCharCode(o):o>191&&o<224?(i+=String.fromCharCode((31&o)<<6|63&r[n+1]),++n):(i+=String.fromCharCode((15&o)<<12|(63&r[n+1])<<6|63&r[n+2]),n+=2)}return i}(r,this.n.bitLength()+7>>3)},t.prototype.generateAsync=function(t,e,r){var n=new Ut,i=t>>1;this.e=parseInt(e,16);var o=new ft(e,16),s=this,a=function(){var e=function(){if(s.p.compareTo(s.q)<=0){var t=s.p;s.p=s.q,s.q=t}var e=s.p.subtract(ft.ONE),n=s.q.subtract(ft.ONE),i=e.multiply(n);0==i.gcd(o).compareTo(ft.ONE)?(s.n=s.p.multiply(s.q),s.d=o.modInverse(i),s.dmp1=s.d.mod(e),s.dmq1=s.d.mod(n),s.coeff=s.q.modInverse(s.p),setTimeout((function(){r()}),0)):setTimeout(a,0)},u=function(){s.q=yt(),s.q.fromNumberAsync(i,1,n,(function(){s.q.subtract(ft.ONE).gcda(o,(function(t){0==t.compareTo(ft.ONE)&&s.q.isProbablePrime(10)?setTimeout(e,0):setTimeout(u,0)}))}))},h=function(){s.p=yt(),s.p.fromNumberAsync(t-i,1,n,(function(){s.p.subtract(ft.ONE).gcda(o,(function(t){0==t.compareTo(ft.ONE)&&s.p.isProbablePrime(10)?setTimeout(u,0):setTimeout(h,0)}))}))};setTimeout(h,0)};setTimeout(a,0)},t.prototype.sign=function(t,e,r){var n=function(t,e){if(e<t.length+22)return console.error("Message too long for RSA"),null;for(var r=e-t.length-6,n="",i=0;i<r;i+=2)n+="ff";return mt("0001"+n+"00"+t,16)}((Vt[r]||"")+e(t).toString(),this.n.bitLength()/4);if(null==n)return null;var i=this.doPrivate(n);if(null==i)return null;var o=i.toString(16);return 0==(1&o.length)?o:"0"+o},t.prototype.verify=function(t,e,r){var n=mt(e,16),i=this.doPublic(n);return null==i?null:function(t){for(var e in Vt)if(Vt.hasOwnProperty(e)){var r=Vt[e],n=r.length;if(t.substr(0,n)==r)return t.substr(n)}return t}(i.toString(16).replace(/^1f+00/,""))==r(t).toString()},t}(),Vt={md2:"3020300c06082a864886f70d020205000410",md5:"3020300c06082a864886f70d020505000410",sha1:"3021300906052b0e03021a05000414",sha224:"302d300d06096086480165030402040500041c",sha256:"3031300d060960864801650304020105000420",sha384:"3041300d060960864801650304020205000430",sha512:"3051300d060960864801650304020305000440",ripemd160:"3021300906052b2403020105000414"},Bt={};Bt.lang={extend:function(t,e,r){if(!e||!t)throw new Error("YAHOO.lang.extend failed, please check that all dependencies are included.");var n=function(){};if(n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t,t.superclass=e.prototype,e.prototype.constructor==Object.prototype.constructor&&(e.prototype.constructor=e),r){var i;for(i in r)t.prototype[i]=r[i];var o=function(){},s=["toString","valueOf"];try{/MSIE/.test(navigator.userAgent)&&(o=function(t,e){for(i=0;i<s.length;i+=1){var r=s[i],n=e[r];"function"==typeof n&&n!=Object.prototype[r]&&(t[r]=n)}})}catch(t){}o(t.prototype,r)}}};var kt={};void 0!==kt.asn1&&kt.asn1||(kt.asn1={}),kt.asn1.ASN1Util=new function(){this.integerToByteHex=function(t){var e=t.toString(16);return e.length%2==1&&(e="0"+e),e},this.bigIntToMinTwosComplementsHex=function(t){var e=t.toString(16);if("-"!=e.substr(0,1))e.length%2==1?e="0"+e:e.match(/^[0-7]/)||(e="00"+e);else{var r=e.substr(1).length;r%2==1?r+=1:e.match(/^[0-7]/)||(r+=2);for(var n="",i=0;i<r;i++)n+="f";e=new ft(n,16).xor(t).add(ft.ONE).toString(16).replace(/^-/,"")}return e},this.getPEMStringFromHex=function(t,e){return hextopem(t,e)},this.newObject=function(t){var e=kt.asn1,r=e.DERBoolean,n=e.DERInteger,i=e.DERBitString,o=e.DEROctetString,s=e.DERNull,a=e.DERObjectIdentifier,u=e.DEREnumerated,h=e.DERUTF8String,c=e.DERNumericString,l=e.DERPrintableString,f=e.DERTeletexString,d=e.DERIA5String,p=e.DERUTCTime,g=e.DERGeneralizedTime,v=e.DERSequence,y=e.DERSet,m=e.DERTaggedObject,b=e.ASN1Util.newObject,E=Object.keys(t);if(1!=E.length)throw"key of param shall be only one.";var T=E[0];if(-1==":bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:seq:set:tag:".indexOf(":"+T+":"))throw"undefined key: "+T;if("bool"==T)return new r(t[T]);if("int"==T)return new n(t[T]);if("bitstr"==T)return new i(t[T]);if("octstr"==T)return new o(t[T]);if("null"==T)return new s(t[T]);if("oid"==T)return new a(t[T]);if("enum"==T)return new u(t[T]);if("utf8str"==T)return new h(t[T]);if("numstr"==T)return new c(t[T]);if("prnstr"==T)return new l(t[T]);if("telstr"==T)return new f(t[T]);if("ia5str"==T)return new d(t[T]);if("utctime"==T)return new p(t[T]);if("gentime"==T)return new g(t[T]);if("seq"==T){for(var S=t[T],_=[],w=0;w<S.length;w++){var R=b(S[w]);_.push(R)}return new v({array:_})}if("set"==T){for(S=t[T],_=[],w=0;w<S.length;w++)R=b(S[w]),_.push(R);return new y({array:_})}if("tag"==T){var I=t[T];if("[object Array]"===Object.prototype.toString.call(I)&&3==I.length){var D=b(I[2]);return new m({tag:I[0],explicit:I[1],obj:D})}var A={};if(void 0!==I.explicit&&(A.explicit=I.explicit),void 0!==I.tag&&(A.tag=I.tag),void 0===I.obj)throw"obj shall be specified for 'tag'.";return A.obj=b(I.obj),new m(A)}},this.jsonToASN1HEX=function(t){return this.newObject(t).getEncodedHex()}},kt.asn1.ASN1Util.oidHexToInt=function(t){for(var e="",r=parseInt(t.substr(0,2),16),n=(e=Math.floor(r/40)+"."+r%40,""),i=2;i<t.length;i+=2){var o=("00000000"+parseInt(t.substr(i,2),16).toString(2)).slice(-8);n+=o.substr(1,7),"0"==o.substr(0,1)&&(e=e+"."+new ft(n,2).toString(10),n="")}return e},kt.asn1.ASN1Util.oidIntToHex=function(t){var e=function(t){var e=t.toString(16);return 1==e.length&&(e="0"+e),e},r=function(t){var r="",n=new ft(t,10).toString(2),i=7-n.length%7;7==i&&(i=0);for(var o="",s=0;s<i;s++)o+="0";for(n=o+n,s=0;s<n.length-1;s+=7){var a=n.substr(s,7);s!=n.length-7&&(a="1"+a),r+=e(parseInt(a,2))}return r};if(!t.match(/^[0-9.]+$/))throw"malformed oid string: "+t;var n="",i=t.split("."),o=40*parseInt(i[0])+parseInt(i[1]);n+=e(o),i.splice(0,2);for(var s=0;s<i.length;s++)n+=r(i[s]);return n},kt.asn1.ASN1Object=function(){this.getLengthHexFromValue=function(){if(void 0===this.hV||null==this.hV)throw"this.hV is null or undefined.";if(this.hV.length%2==1)throw"value hex must be even length: n="+"".length+",v="+this.hV;var t=this.hV.length/2,e=t.toString(16);if(e.length%2==1&&(e="0"+e),t<128)return e;var r=e.length/2;if(r>15)throw"ASN.1 length too long to represent by 8x: n = "+t.toString(16);return(128+r).toString(16)+e},this.getEncodedHex=function(){return(null==this.hTLV||this.isModified)&&(this.hV=this.getFreshValueHex(),this.hL=this.getLengthHexFromValue(),this.hTLV=this.hT+this.hL+this.hV,this.isModified=!1),this.hTLV},this.getValueHex=function(){return this.getEncodedHex(),this.hV},this.getFreshValueHex=function(){return""}},kt.asn1.DERAbstractString=function(t){kt.asn1.DERAbstractString.superclass.constructor.call(this),this.getString=function(){return this.s},this.setString=function(t){this.hTLV=null,this.isModified=!0,this.s=t,this.hV=stohex(this.s)},this.setStringHex=function(t){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=t},this.getFreshValueHex=function(){return this.hV},void 0!==t&&("string"==typeof t?this.setString(t):void 0!==t.str?this.setString(t.str):void 0!==t.hex&&this.setStringHex(t.hex))},Bt.lang.extend(kt.asn1.DERAbstractString,kt.asn1.ASN1Object),kt.asn1.DERAbstractTime=function(t){kt.asn1.DERAbstractTime.superclass.constructor.call(this),this.localDateToUTC=function(t){return utc=t.getTime()+6e4*t.getTimezoneOffset(),new Date(utc)},this.formatDate=function(t,e,r){var n=this.zeroPadding,i=this.localDateToUTC(t),o=String(i.getFullYear());"utc"==e&&(o=o.substr(2,2));var s=o+n(String(i.getMonth()+1),2)+n(String(i.getDate()),2)+n(String(i.getHours()),2)+n(String(i.getMinutes()),2)+n(String(i.getSeconds()),2);if(!0===r){var a=i.getMilliseconds();if(0!=a){var u=n(String(a),3);s=s+"."+(u=u.replace(/[0]+$/,""))}}return s+"Z"},this.zeroPadding=function(t,e){return t.length>=e?t:new Array(e-t.length+1).join("0")+t},this.getString=function(){return this.s},this.setString=function(t){this.hTLV=null,this.isModified=!0,this.s=t,this.hV=stohex(t)},this.setByDateValue=function(t,e,r,n,i,o){var s=new Date(Date.UTC(t,e-1,r,n,i,o,0));this.setByDate(s)},this.getFreshValueHex=function(){return this.hV}},Bt.lang.extend(kt.asn1.DERAbstractTime,kt.asn1.ASN1Object),kt.asn1.DERAbstractStructured=function(t){kt.asn1.DERAbstractString.superclass.constructor.call(this),this.setByASN1ObjectArray=function(t){this.hTLV=null,this.isModified=!0,this.asn1Array=t},this.appendASN1Object=function(t){this.hTLV=null,this.isModified=!0,this.asn1Array.push(t)},this.asn1Array=new Array,void 0!==t&&void 0!==t.array&&(this.asn1Array=t.array)},Bt.lang.extend(kt.asn1.DERAbstractStructured,kt.asn1.ASN1Object),kt.asn1.DERBoolean=function(){kt.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV="0101ff"},Bt.lang.extend(kt.asn1.DERBoolean,kt.asn1.ASN1Object),kt.asn1.DERInteger=function(t){kt.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.setByBigInteger=function(t){this.hTLV=null,this.isModified=!0,this.hV=kt.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t)},this.setByInteger=function(t){var e=new ft(String(t),10);this.setByBigInteger(e)},this.setValueHex=function(t){this.hV=t},this.getFreshValueHex=function(){return this.hV},void 0!==t&&(void 0!==t.bigint?this.setByBigInteger(t.bigint):void 0!==t.int?this.setByInteger(t.int):"number"==typeof t?this.setByInteger(t):void 0!==t.hex&&this.setValueHex(t.hex))},Bt.lang.extend(kt.asn1.DERInteger,kt.asn1.ASN1Object),kt.asn1.DERBitString=function(t){if(void 0!==t&&void 0!==t.obj){var e=kt.asn1.ASN1Util.newObject(t.obj);t.hex="00"+e.getEncodedHex()}kt.asn1.DERBitString.superclass.constructor.call(this),this.hT="03",this.setHexValueIncludingUnusedBits=function(t){this.hTLV=null,this.isModified=!0,this.hV=t},this.setUnusedBitsAndHexValue=function(t,e){if(t<0||7<t)throw"unused bits shall be from 0 to 7: u = "+t;var r="0"+t;this.hTLV=null,this.isModified=!0,this.hV=r+e},this.setByBinaryString=function(t){var e=8-(t=t.replace(/0+$/,"")).length%8;8==e&&(e=0);for(var r=0;r<=e;r++)t+="0";var n="";for(r=0;r<t.length-1;r+=8){var i=t.substr(r,8),o=parseInt(i,2).toString(16);1==o.length&&(o="0"+o),n+=o}this.hTLV=null,this.isModified=!0,this.hV="0"+e+n},this.setByBooleanArray=function(t){for(var e="",r=0;r<t.length;r++)1==t[r]?e+="1":e+="0";this.setByBinaryString(e)},this.newFalseArray=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=!1;return e},this.getFreshValueHex=function(){return this.hV},void 0!==t&&("string"==typeof t&&t.toLowerCase().match(/^[0-9a-f]+$/)?this.setHexValueIncludingUnusedBits(t):void 0!==t.hex?this.setHexValueIncludingUnusedBits(t.hex):void 0!==t.bin?this.setByBinaryString(t.bin):void 0!==t.array&&this.setByBooleanArray(t.array))},Bt.lang.extend(kt.asn1.DERBitString,kt.asn1.ASN1Object),kt.asn1.DEROctetString=function(t){if(void 0!==t&&void 0!==t.obj){var e=kt.asn1.ASN1Util.newObject(t.obj);t.hex=e.getEncodedHex()}kt.asn1.DEROctetString.superclass.constructor.call(this,t),this.hT="04"},Bt.lang.extend(kt.asn1.DEROctetString,kt.asn1.DERAbstractString),kt.asn1.DERNull=function(){kt.asn1.DERNull.superclass.constructor.call(this),this.hT="05",this.hTLV="0500"},Bt.lang.extend(kt.asn1.DERNull,kt.asn1.ASN1Object),kt.asn1.DERObjectIdentifier=function(t){var e=function(t){var e=t.toString(16);return 1==e.length&&(e="0"+e),e},r=function(t){var r="",n=new ft(t,10).toString(2),i=7-n.length%7;7==i&&(i=0);for(var o="",s=0;s<i;s++)o+="0";for(n=o+n,s=0;s<n.length-1;s+=7){var a=n.substr(s,7);s!=n.length-7&&(a="1"+a),r+=e(parseInt(a,2))}return r};kt.asn1.DERObjectIdentifier.superclass.constructor.call(this),this.hT="06",this.setValueHex=function(t){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=t},this.setValueOidString=function(t){if(!t.match(/^[0-9.]+$/))throw"malformed oid string: "+t;var n="",i=t.split("."),o=40*parseInt(i[0])+parseInt(i[1]);n+=e(o),i.splice(0,2);for(var s=0;s<i.length;s++)n+=r(i[s]);this.hTLV=null,this.isModified=!0,this.s=null,this.hV=n},this.setValueName=function(t){var e=kt.asn1.x509.OID.name2oid(t);if(""===e)throw"DERObjectIdentifier oidName undefined: "+t;this.setValueOidString(e)},this.getFreshValueHex=function(){return this.hV},void 0!==t&&("string"==typeof t?t.match(/^[0-2].[0-9.]+$/)?this.setValueOidString(t):this.setValueName(t):void 0!==t.oid?this.setValueOidString(t.oid):void 0!==t.hex?this.setValueHex(t.hex):void 0!==t.name&&this.setValueName(t.name))},Bt.lang.extend(kt.asn1.DERObjectIdentifier,kt.asn1.ASN1Object),kt.asn1.DEREnumerated=function(t){kt.asn1.DEREnumerated.superclass.constructor.call(this),this.hT="0a",this.setByBigInteger=function(t){this.hTLV=null,this.isModified=!0,this.hV=kt.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t)},this.setByInteger=function(t){var e=new ft(String(t),10);this.setByBigInteger(e)},this.setValueHex=function(t){this.hV=t},this.getFreshValueHex=function(){return this.hV},void 0!==t&&(void 0!==t.int?this.setByInteger(t.int):"number"==typeof t?this.setByInteger(t):void 0!==t.hex&&this.setValueHex(t.hex))},Bt.lang.extend(kt.asn1.DEREnumerated,kt.asn1.ASN1Object),kt.asn1.DERUTF8String=function(t){kt.asn1.DERUTF8String.superclass.constructor.call(this,t),this.hT="0c"},Bt.lang.extend(kt.asn1.DERUTF8String,kt.asn1.DERAbstractString),kt.asn1.DERNumericString=function(t){kt.asn1.DERNumericString.superclass.constructor.call(this,t),this.hT="12"},Bt.lang.extend(kt.asn1.DERNumericString,kt.asn1.DERAbstractString),kt.asn1.DERPrintableString=function(t){kt.asn1.DERPrintableString.superclass.constructor.call(this,t),this.hT="13"},Bt.lang.extend(kt.asn1.DERPrintableString,kt.asn1.DERAbstractString),kt.asn1.DERTeletexString=function(t){kt.asn1.DERTeletexString.superclass.constructor.call(this,t),this.hT="14"},Bt.lang.extend(kt.asn1.DERTeletexString,kt.asn1.DERAbstractString),kt.asn1.DERIA5String=function(t){kt.asn1.DERIA5String.superclass.constructor.call(this,t),this.hT="16"},Bt.lang.extend(kt.asn1.DERIA5String,kt.asn1.DERAbstractString),kt.asn1.DERUTCTime=function(t){kt.asn1.DERUTCTime.superclass.constructor.call(this,t),this.hT="17",this.setByDate=function(t){this.hTLV=null,this.isModified=!0,this.date=t,this.s=this.formatDate(this.date,"utc"),this.hV=stohex(this.s)},this.getFreshValueHex=function(){return void 0===this.date&&void 0===this.s&&(this.date=new Date,this.s=this.formatDate(this.date,"utc"),this.hV=stohex(this.s)),this.hV},void 0!==t&&(void 0!==t.str?this.setString(t.str):"string"==typeof t&&t.match(/^[0-9]{12}Z$/)?this.setString(t):void 0!==t.hex?this.setStringHex(t.hex):void 0!==t.date&&this.setByDate(t.date))},Bt.lang.extend(kt.asn1.DERUTCTime,kt.asn1.DERAbstractTime),kt.asn1.DERGeneralizedTime=function(t){kt.asn1.DERGeneralizedTime.superclass.constructor.call(this,t),this.hT="18",this.withMillis=!1,this.setByDate=function(t){this.hTLV=null,this.isModified=!0,this.date=t,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=stohex(this.s)},this.getFreshValueHex=function(){return void 0===this.date&&void 0===this.s&&(this.date=new Date,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=stohex(this.s)),this.hV},void 0!==t&&(void 0!==t.str?this.setString(t.str):"string"==typeof t&&t.match(/^[0-9]{14}Z$/)?this.setString(t):void 0!==t.hex?this.setStringHex(t.hex):void 0!==t.date&&this.setByDate(t.date),!0===t.millis&&(this.withMillis=!0))},Bt.lang.extend(kt.asn1.DERGeneralizedTime,kt.asn1.DERAbstractTime),kt.asn1.DERSequence=function(t){kt.asn1.DERSequence.superclass.constructor.call(this,t),this.hT="30",this.getFreshValueHex=function(){for(var t="",e=0;e<this.asn1Array.length;e++)t+=this.asn1Array[e].getEncodedHex();return this.hV=t,this.hV}},Bt.lang.extend(kt.asn1.DERSequence,kt.asn1.DERAbstractStructured),kt.asn1.DERSet=function(t){kt.asn1.DERSet.superclass.constructor.call(this,t),this.hT="31",this.sortFlag=!0,this.getFreshValueHex=function(){for(var t=new Array,e=0;e<this.asn1Array.length;e++){var r=this.asn1Array[e];t.push(r.getEncodedHex())}return 1==this.sortFlag&&t.sort(),this.hV=t.join(""),this.hV},void 0!==t&&void 0!==t.sortflag&&0==t.sortflag&&(this.sortFlag=!1)},Bt.lang.extend(kt.asn1.DERSet,kt.asn1.DERAbstractStructured),kt.asn1.DERTaggedObject=function(t){kt.asn1.DERTaggedObject.superclass.constructor.call(this),this.hT="a0",this.hV="",this.isExplicit=!0,this.asn1Object=null,this.setASN1Object=function(t,e,r){this.hT=e,this.isExplicit=t,this.asn1Object=r,this.isExplicit?(this.hV=this.asn1Object.getEncodedHex(),this.hTLV=null,this.isModified=!0):(this.hV=null,this.hTLV=r.getEncodedHex(),this.hTLV=this.hTLV.replace(/^../,e),this.isModified=!1)},this.getFreshValueHex=function(){return this.hV},void 0!==t&&(void 0!==t.tag&&(this.hT=t.tag),void 0!==t.explicit&&(this.isExplicit=t.explicit),void 0!==t.obj&&(this.asn1Object=t.obj,this.setASN1Object(this.isExplicit,this.hT,this.asn1Object)))},Bt.lang.extend(kt.asn1.DERTaggedObject,kt.asn1.ASN1Object);var qt=function(t){function e(t){void 0===t&&(t="");var e=this;return t&&("string"==typeof t?e.parseKey(t):(e.hasPrivateKeyProperty(t)||e.hasPublicKeyProperty(t))&&e.parsePropertiesFrom(t)),e}return k(e,t),e.prototype.parseKey=function(t){try{var e=0,r=0,n=/^\s*(?:[0-9A-Fa-f][0-9A-Fa-f]\s*)+$/.test(t)?function(t){var e;if(void 0===$){var r="0123456789ABCDEF",n=" \f\n\r\t \u2028\u2029";for($={},e=0;e<16;++e)$[r.charAt(e)]=e;for(r=r.toLowerCase(),e=10;e<16;++e)$[r.charAt(e)]=e;for(e=0;e<n.length;++e)$[n.charAt(e)]=-1}var i=[],o=0,s=0;for(e=0;e<t.length;++e){var a=t.charAt(e);if("="==a)break;if(-1!=(a=$[a])){if(void 0===a)throw new Error("Illegal character at offset "+e);o|=a,++s>=2?(i[i.length]=o,o=0,s=0):o<<=4}}if(s)throw new Error("Hex encoding incomplete: 4 bits missing");return i}(t):X.unarmor(t),i=ut.decode(n);if(3===i.sub.length&&(i=i.sub[2].sub[0]),9===i.sub.length){e=i.sub[1].getHexStringValue(),this.n=mt(e,16),r=i.sub[2].getHexStringValue(),this.e=parseInt(r,16);var o=i.sub[3].getHexStringValue();this.d=mt(o,16);var s=i.sub[4].getHexStringValue();this.p=mt(s,16);var a=i.sub[5].getHexStringValue();this.q=mt(a,16);var u=i.sub[6].getHexStringValue();this.dmp1=mt(u,16);var h=i.sub[7].getHexStringValue();this.dmq1=mt(h,16);var c=i.sub[8].getHexStringValue();this.coeff=mt(c,16)}else{if(2!==i.sub.length)return!1;var l=i.sub[1].sub[0];e=l.sub[0].getHexStringValue(),this.n=mt(e,16),r=l.sub[1].getHexStringValue(),this.e=parseInt(r,16)}return!0}catch(t){return!1}},e.prototype.getPrivateBaseKey=function(){var t={array:[new kt.asn1.DERInteger({int:0}),new kt.asn1.DERInteger({bigint:this.n}),new kt.asn1.DERInteger({int:this.e}),new kt.asn1.DERInteger({bigint:this.d}),new kt.asn1.DERInteger({bigint:this.p}),new kt.asn1.DERInteger({bigint:this.q}),new kt.asn1.DERInteger({bigint:this.dmp1}),new kt.asn1.DERInteger({bigint:this.dmq1}),new kt.asn1.DERInteger({bigint:this.coeff})]};return new kt.asn1.DERSequence(t).getEncodedHex()},e.prototype.getPrivateBaseKeyB64=function(){return Z(this.getPrivateBaseKey())},e.prototype.getPublicBaseKey=function(){var t=new kt.asn1.DERSequence({array:[new kt.asn1.DERObjectIdentifier({oid:"1.2.840.113549.1.1.1"}),new kt.asn1.DERNull]}),e=new kt.asn1.DERSequence({array:[new kt.asn1.DERInteger({bigint:this.n}),new kt.asn1.DERInteger({int:this.e})]}),r=new kt.asn1.DERBitString({hex:"00"+e.getEncodedHex()});return new kt.asn1.DERSequence({array:[t,r]}).getEncodedHex()},e.prototype.getPublicBaseKeyB64=function(){return Z(this.getPublicBaseKey())},e.wordwrap=function(t,e){if(void 0===e&&(e=void 0),!t)return t;var r="(.{1,"+(e=e||64)+"})( +|$\n?)|(.{1,"+e+"})";return t.match(RegExp(r,"g")).join("\n")},e.prototype.getPrivateKey=function(){var t="-----BEGIN RSA PRIVATE KEY-----\n";return(t+=e.wordwrap(this.getPrivateBaseKeyB64())+"\n")+"-----END RSA PRIVATE KEY-----"},e.prototype.getPublicKey=function(){var t="-----BEGIN PUBLIC KEY-----\n";return(t+=e.wordwrap(this.getPublicBaseKeyB64())+"\n")+"-----END PUBLIC KEY-----"},e.prototype.hasPublicKeyProperty=function(t){return(t=t||{}).hasOwnProperty("n")&&t.hasOwnProperty("e")},e.prototype.hasPrivateKeyProperty=function(t){return(t=t||{}).hasOwnProperty("n")&&t.hasOwnProperty("e")&&t.hasOwnProperty("d")&&t.hasOwnProperty("p")&&t.hasOwnProperty("q")&&t.hasOwnProperty("dmp1")&&t.hasOwnProperty("dmq1")&&t.hasOwnProperty("coeff")},e.prototype.parsePropertiesFrom=function(t){this.n=t.n,this.e=t.e,t.hasOwnProperty("d")&&(this.d=t.d,this.p=t.p,this.q=t.q,this.dmp1=t.dmp1,this.dmq1=t.dmq1,this.coeff=t.coeff)},e}(Lt);function Ht(t){t=t||{},this.default_key_size=parseInt(t.default_key_size,10)||1024,this.default_public_exponent=t.default_public_exponent||"010001",this.log=t.log||!1,this.key=null}Ht.prototype.setKey=function(t){this.log&&this.key&&console.warn("A key was already set, overriding existing."),this.key=new qt(t)},Ht.prototype.setPrivateKey=function(t){this.setKey(t)},Ht.prototype.setPublicKey=function(t){this.setKey(t)},Ht.prototype.decrypt=function(t){try{return this.getKey().decrypt(Q(t))}catch(t){return!1}},Ht.prototype.encrypt=function(t){try{return Z(this.getKey().encrypt(t))}catch(t){return!1}},Ht.prototype.encryptLong=function(t){try{for(var e=this.getKey().encryptLong(t)||"",r=this.getKey().decryptLong(e)||"",n=0,i=/null$/g;i.test(r)&&(n++,e=this.getKey().encryptLong(t)||"",r=this.getKey().decryptLong(e)||"",!(n>10)););return e}catch(t){return!1}},Ht.prototype.decryptLong=function(t){try{return this.getKey().decryptLong(t)}catch(t){return!1}},Ht.prototype.sign=function(t,e,r){try{return Z(this.getKey().sign(t,e,r))}catch(t){return!1}},Ht.prototype.verify=function(t,e,r){try{return this.getKey().verify(t,Q(e),r)}catch(t){return!1}},Ht.prototype.getKey=function(t){if(!this.key){if(this.key=new qt,t&&"[object Function]"==={}.toString.call(t))return void this.key.generateAsync(this.default_key_size,this.default_public_exponent,t);this.key.generate(this.default_key_size,this.default_public_exponent)}return this.key},Ht.prototype.getPrivateKey=function(){return this.getKey().getPrivateKey()},Ht.prototype.getPrivateKeyB64=function(){return this.getKey().getPrivateBaseKeyB64()},Ht.prototype.getPublicKey=function(){return this.getKey().getPublicKey()},Ht.prototype.getPublicKeyB64=function(){return this.getKey().getPublicBaseKeyB64()},Ht.version="3.1.4";const Mt=Ht;var jt=function(t){var e=void 0===t?{}:t,r=e.publicKey,n=void 0===r?"":r,i=e.payload,o=void 0===i?{}:i;if(!n)return"";try{var s=B(o),a=new Mt;return a.setPublicKey(n),a.encryptLong(JSON.stringify(s))}catch(t){}return""},Ft=function(){return Ft=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},Ft.apply(this,arguments)},Kt=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))},Gt=function(t,e){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(u){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,n=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=e.call(t,s)}catch(t){a=[6,t],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}},Wt=function(){function t(t){var e=t.request,r=t.credentialsClient;if(!r){var n={apiOrigin:t.apiOrigin,clientId:t.clientId,storage:t.storage};r=new A(n)}if(!e){var i=r.request.bind(r),o=new V(Ft({clientId:t.clientId,request:i,storage:t.storage},t.captchaOptions));e=o.request.bind(o)}this.config={apiOrigin:t.apiOrigin,clientId:t.clientId,request:e,credentialsClient:r,storage:t.storage||_}}return t.parseParamsToSearch=function(t){return Object.keys(t).forEach((function(e){t[e]||delete t[e]})),new URLSearchParams(t).toString()},t.prototype.getParamsByVersion=function(t,e){var r,n=B(t),i=(null===(r={v2:s}[null==n?void 0:n.version])||void 0===r?void 0:r[e])||o[e];return n&&delete n.version,{params:n,url:i}},t.prototype.signIn=function(t){return Kt(this,void 0,void 0,(function(){var e,r,n,i;return Gt(this,(function(o){switch(o.label){case 0:return e=t.version||"v1",(r=this.getParamsByVersion(t,"AUTH_SIGN_IN_URL")).params.query&&delete r.params.query,[4,this.getEncryptParams(r.params)];case 1:return n=o.sent(),[4,this.config.request(r.url,{method:"POST",body:n})];case 2:return i=o.sent(),[4,this.config.credentialsClient.setCredentials(Ft(Ft({},i),{version:e}))];case 3:return o.sent(),[2,Promise.resolve(i)]}}))}))},t.prototype.signInAnonymously=function(t){return void 0===t&&(t={}),Kt(this,void 0,void 0,(function(){var e;return Gt(this,(function(r){switch(r.label){case 0:return[4,this.config.request(o.AUTH_SIGN_IN_ANONYMOUSLY_URL,{method:"POST",body:t})];case 1:return e=r.sent(),[4,this.config.credentialsClient.setCredentials(e)];case 2:return r.sent(),[2,Promise.resolve(e)]}}))}))},t.prototype.signUp=function(t){return Kt(this,void 0,void 0,(function(){var e;return Gt(this,(function(r){switch(r.label){case 0:return[4,this.config.request(o.AUTH_SIGN_UP_URL,{method:"POST",body:t})];case 1:return e=r.sent(),[4,this.config.credentialsClient.setCredentials(e)];case 2:return r.sent(),[2,Promise.resolve(e)]}}))}))},t.prototype.signOut=function(){return Kt(this,void 0,void 0,(function(){var t,e;return Gt(this,(function(r){switch(r.label){case 0:return[4,this.config.credentialsClient.getAccessToken()];case 1:return t=r.sent(),[4,this.config.request(o.AUTH_REVOKE_URL,{method:"POST",body:{token:t}})];case 2:return e=r.sent(),[4,this.config.credentialsClient.setCredentials()];case 3:return r.sent(),[2,Promise.resolve(e)]}}))}))},t.prototype.getVerification=function(t){return Kt(this,void 0,void 0,(function(){var e;return Gt(this,(function(r){switch(r.label){case 0:return e=!1,"CUR_USER"!==t.target?[3,1]:(e=!0,[3,3]);case 1:return[4,this.hasLoginState()];case 2:r.sent()&&(e=!0),r.label=3;case 3:return[2,this.config.request(o.VERIFICATION_URL,{method:"POST",body:t,withCaptcha:!0,withCredentials:e})]}}))}))},t.prototype.verify=function(t){return Kt(this,void 0,void 0,(function(){var e,r;return Gt(this,(function(n){switch(n.label){case 0:return e=this.getParamsByVersion(t,"VERIFY_URL"),[4,this.config.request(e.url,{method:"POST",body:e.params})];case 1:return r=n.sent(),"v2"!==(null==t?void 0:t.version)?[3,3]:[4,this.config.credentialsClient.setCredentials(Ft(Ft({},r),{version:"v2"}))];case 2:n.sent(),n.label=3;case 3:return[2,r]}}))}))},t.prototype.genProviderRedirectUri=function(t){return Kt(this,void 0,void 0,(function(){var e,r;return Gt(this,(function(n){return e="".concat(o.PROVIDER_URI_URL,"?client_id=").concat(this.config.clientId,"&provider_id=").concat(t.provider_id,"&redirect_uri=").concat(encodeURIComponent(t.provider_redirect_uri),"&state=").concat(t.state),(r=t.other_params)&&"string"==typeof r.sign_out_uri&&r.sign_out_uri.length>0&&(e+="&other_params[sign_out_uri]=".concat(r.sign_out_uri)),[2,this.config.request(e,{method:"GET"})]}))}))},t.prototype.grantProviderToken=function(t){return Kt(this,void 0,void 0,(function(){return Gt(this,(function(e){return[2,this.config.request(o.PROVIDER_TOKEN_URL,{method:"POST",body:t})]}))}))},t.prototype.patchProviderToken=function(t){return Kt(this,void 0,void 0,(function(){return Gt(this,(function(e){return[2,this.config.request(o.PROVIDER_TOKEN_URL,{method:"PATCH",body:t})]}))}))},t.prototype.signInWithProvider=function(t){return Kt(this,void 0,void 0,(function(){var e,r;return Gt(this,(function(n){switch(n.label){case 0:return e=this.getParamsByVersion(t,"AUTH_SIGN_IN_WITH_PROVIDER_URL"),[4,this.config.request(e.url,{method:"POST",body:e.params})];case 1:return r=n.sent(),[4,this.config.credentialsClient.setCredentials(Ft(Ft({},r),{version:(null==t?void 0:t.version)||"v1"}))];case 2:return n.sent(),[2,Promise.resolve(r)]}}))}))},t.prototype.bindWithProvider=function(t){return Kt(this,void 0,void 0,(function(){return Gt(this,(function(e){return[2,this.config.request(o.PROVIDER_BIND_URL,{method:"POST",body:t,withCredentials:!0})]}))}))},t.prototype.getUserProfile=function(t){return Kt(this,void 0,void 0,(function(){return Gt(this,(function(e){return[2,this.getUserInfo(t)]}))}))},t.prototype.getUserInfo=function(t){var e;return void 0===t&&(t={}),Kt(this,void 0,void 0,(function(){var r,n,i;return Gt(this,(function(o){switch(o.label){case 0:return r=this.getParamsByVersion(t,"USER_ME_URL"),(null===(e=r.params)||void 0===e?void 0:e.query)&&(n=new URLSearchParams(r.params.query),r.url+="?".concat(n.toString())),[4,this.config.request(r.url,{method:"GET",withCredentials:!0})];case 1:return(i=o.sent()).sub&&(i.uid=i.sub),[2,i]}}))}))},t.prototype.getWedaUserInfo=function(){return Kt(this,void 0,void 0,(function(){return Gt(this,(function(t){switch(t.label){case 0:return[4,this.config.request(o.WEDA_USER_URL,{method:"GET",withCredentials:!0})];case 1:return[2,t.sent()]}}))}))},t.prototype.deleteMe=function(e){return Kt(this,void 0,void 0,(function(){var r,n;return Gt(this,(function(i){return r=this.getParamsByVersion(e,"USER_ME_URL"),n="".concat(r.url,"?").concat(t.parseParamsToSearch(r.params)),[2,this.config.request(n,{method:"DELETE",withCredentials:!0})]}))}))},t.prototype.hasLoginState=function(){return Kt(this,void 0,void 0,(function(){return Gt(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.config.credentialsClient.getAccessToken()];case 1:return t.sent(),[2,!0];case 2:return t.sent(),[2,!1];case 3:return[2]}}))}))},t.prototype.hasLoginStateSync=function(){return this.config.credentialsClient.getCredentialsSync()},t.prototype.getLoginState=function(){return Kt(this,void 0,void 0,(function(){return Gt(this,(function(t){return[2,this.config.credentialsClient.getCredentialsAsync()]}))}))},t.prototype.transByProvider=function(t){return Kt(this,void 0,void 0,(function(){return Gt(this,(function(e){return[2,this.config.request(o.USER_TRANS_BY_PROVIDER_URL,{method:"PATCH",body:t,withCredentials:!0})]}))}))},t.prototype.grantToken=function(t){return Kt(this,void 0,void 0,(function(){var e;return Gt(this,(function(r){return e=this.getParamsByVersion(t,"AUTH_TOKEN_URL"),[2,this.config.request(e.url,{method:"POST",body:e.params})]}))}))},t.prototype.getProviders=function(){return Kt(this,void 0,void 0,(function(){return Gt(this,(function(t){return[2,this.config.request(o.PROVIDER_LIST,{method:"GET",withCredentials:!0})]}))}))},t.prototype.unbindProvider=function(t){return Kt(this,void 0,void 0,(function(){return Gt(this,(function(e){return[2,this.config.request("".concat(o.PROVIDER_UNBIND_URL,"/").concat(t.provider_id),{method:"DELETE",withCredentials:!0})]}))}))},t.prototype.checkPassword=function(t){return Kt(this,void 0,void 0,(function(){return Gt(this,(function(e){return[2,this.config.request("".concat(o.CHECK_PWD_URL),{method:"POST",withCredentials:!0,body:t})]}))}))},t.prototype.bindPhone=function(t){return Kt(this,void 0,void 0,(function(){return Gt(this,(function(e){return[2,this.config.request("".concat(o.BIND_CONTACT_URL),{method:"PATCH",withCredentials:!0,body:t})]}))}))},t.prototype.bindEmail=function(t){return Kt(this,void 0,void 0,(function(){return Gt(this,(function(e){return[2,this.config.request("".concat(o.BIND_CONTACT_URL),{method:"PATCH",withCredentials:!0,body:t})]}))}))},t.prototype.setPassword=function(t){return Kt(this,void 0,void 0,(function(){return Gt(this,(function(e){return[2,this.config.request("".concat(o.AUTH_SET_PASSWORD),{method:"PATCH",withCredentials:!0,body:t})]}))}))},t.prototype.updatePasswordByOld=function(t){return Kt(this,void 0,void 0,(function(){var e;return Gt(this,(function(r){switch(r.label){case 0:return[4,this.sudo({password:t.old_password})];case 1:return e=r.sent(),[2,this.setPassword({sudo_token:e.sudo_token,new_password:t.new_password})]}}))}))},t.prototype.sudo=function(t){return Kt(this,void 0,void 0,(function(){return Gt(this,(function(e){return[2,this.config.request("".concat(o.SUDO_URL),{method:"POST",withCredentials:!0,body:t})]}))}))},t.prototype.getCurUserVerification=function(t){return Kt(this,void 0,void 0,(function(){return Gt(this,(function(e){return t.target="CUR_USER",[2,this.config.request(o.VERIFICATION_URL,{method:"POST",body:t,withCredentials:!0,withCaptcha:!0})]}))}))},t.prototype.changeBindedProvider=function(t){return Kt(this,void 0,void 0,(function(){return Gt(this,(function(e){return[2,this.config.request("".concat(o.PROVIDER_LIST,"/").concat(t.provider_id,"/trans"),{method:"POST",body:{provider_trans_token:t.trans_token},withCredentials:!0})]}))}))},t.prototype.setUserProfile=function(t){return Kt(this,void 0,void 0,(function(){return Gt(this,(function(e){return[2,this.config.request(o.USER_PRIFILE_URL,{method:"PATCH",body:t,withCredentials:!0})]}))}))},t.prototype.queryUserProfile=function(t){return Kt(this,void 0,void 0,(function(){var e;return Gt(this,(function(r){return e=new URLSearchParams(t),[2,this.config.request("".concat(o.USER_QUERY_URL,"?").concat(e.toString()),{method:"GET",withCredentials:!0})]}))}))},t.prototype.setCustomSignFunc=function(t){this.getCustomSignTicketFn=t},t.prototype.signInWithCustomTicket=function(t){return Kt(this,void 0,void 0,(function(){var e;return Gt(this,(function(r){switch(r.label){case 0:return[4,this.getCustomSignTicketFn()];case 1:return e=r.sent(),[2,this.signInWithProvider(Ft(Ft({},t),{provider_id:"custom",provider_token:e}))]}}))}))},t.prototype.resetPassword=function(t){return Kt(this,void 0,void 0,(function(){return Gt(this,(function(e){return[2,this.config.request(o.AUTH_RESET_PASSWORD,{method:"POST",body:t})]}))}))},t.prototype.deviceAuthorize=function(t){return Kt(this,void 0,void 0,(function(){return Gt(this,(function(e){return[2,this.config.request(o.AUTH_GET_DEVICE_CODE,{method:"POST",body:t,withCredentials:!0})]}))}))},t.prototype.checkUsername=function(t){return Kt(this,void 0,void 0,(function(){return Gt(this,(function(e){return[2,this.config.request(o.CHECK_USERNAME,{method:"GET",body:t,withCredentials:!0})]}))}))},t.prototype.checkIfUserExist=function(t){return Kt(this,void 0,void 0,(function(){var e;return Gt(this,(function(r){return e=new URLSearchParams(t),[2,this.config.request("".concat(o.CHECK_IF_USER_EXIST,"?").concat(e.toString()),{method:"GET"})]}))}))},t.prototype.loginScope=function(){return Kt(this,void 0,void 0,(function(){return Gt(this,(function(t){return[2,this.config.credentialsClient.getScope()]}))}))},t.prototype.loginGroups=function(){return Kt(this,void 0,void 0,(function(){return Gt(this,(function(t){return[2,this.config.credentialsClient.getGroups()]}))}))},t.prototype.refreshTokenForce=function(t){return Kt(this,void 0,void 0,(function(){var e;return Gt(this,(function(r){switch(r.label){case 0:return[4,this.config.credentialsClient.getCredentials()];case 1:return e=r.sent(),[4,this.config.credentialsClient.refreshToken(Ft(Ft({},e),{version:(null==t?void 0:t.version)||"v1"}))];case 2:return[2,r.sent()]}}))}))},t.prototype.getCredentials=function(){return Kt(this,void 0,void 0,(function(){return Gt(this,(function(t){return[2,this.config.credentialsClient.getCredentials()]}))}))},t.prototype.getPublicKey=function(){return Kt(this,void 0,void 0,(function(){return Gt(this,(function(t){return[2,this.config.request(s.AUTH_PUBLIC_KEY,{method:"POST",body:{}})]}))}))},t.prototype.getEncryptParams=function(t){return Kt(this,void 0,void 0,(function(){var e,r,n,i;return Gt(this,(function(o){switch(o.label){case 0:if(!(e=B(t)).isEncrypt)return[2,t];r="",n="",o.label=1;case 1:return o.trys.push([1,3,,4]),[4,this.getPublicKey()];case 2:return i=o.sent(),r=i.public_key,n=i.public_key_thumbprint,[3,4];case 3:return o.sent(),[3,4];case 4:if(!r||!n)throw new Error("public_key or public_key_thumbprint is empty");return delete e.isEncrypt,[2,{params:jt({publicKey:r,payload:e}),public_key_thumbprint:n}]}}))}))},t.prototype.getProviderSubType=function(){return Kt(this,void 0,void 0,(function(){return Gt(this,(function(t){return[2,this.config.request(o.GET_PROVIDER_TYPE,{method:"POST",body:{provider_id:"weda"}})]}))}))},t.prototype.varifyCaptchaData=function(t){var e=t.token,r=t.key;return Kt(this,void 0,void 0,(function(){return Gt(this,(function(t){return[2,this.config.request(o.VARIFY_CAPTCHA_DATA_URL,{method:"POST",body:{token:e,key:r},withCredentials:!1})]}))}))},t.prototype.createCaptchaData=function(t){var e=t.state,r=t.redirect_uri,n=void 0===r?void 0:r;return Kt(this,void 0,void 0,(function(){return Gt(this,(function(t){return[2,this.config.request(o.CAPTCHA_DATA_URL,{method:"POST",body:{state:e,redirect_uri:n},withCredentials:!1})]}))}))},t}(),Yt=function(){},zt=function(){return zt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},zt.apply(this,arguments)},Zt=function(t){var e=t.apiOrigin,r=t.clientId,n=t.storage,i=t.request,o=t.baseRequest,s=t.anonymousSignInFunc;this.oauth2client=new A({apiOrigin:e,clientId:r,storage:n,baseRequest:o||i,anonymousSignInFunc:s}),this.authApi=new Wt(zt(zt({credentialsClient:this.oauth2client},t),{request:i?this.oauth2client.request.bind(this.oauth2client):void 0}))}},118:function(t,e,r){var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(842),e)}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={exports:{}};return t[n].call(o.exports,o,o.exports,r),o.exports}return r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r(118)})()));
1
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("cloudbase_oauth",[],e):"object"==typeof exports?exports.cloudbase_oauth=e():t.cloudbase_oauth=e()}("undefined"!=typeof window?window:this,(()=>(()=>{"use strict";var t={842:(t,e,r)=>{r.r(e),r.d(e,{Auth:()=>Gt,AuthClient:()=>Kt,CloudbaseOAuth:()=>Yt,ErrorType:()=>i,OAuth2Client:()=>I,Syntax:()=>n,authModels:()=>h,defaultRequest:()=>b,defaultStorage:()=>_,generateRequestId:()=>S,toResponseError:()=>T});var n,i,o,s,a,u,h={};function c(){return"xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)}))}r.r(h),function(t){t.CLIENT_ID="client_id",t.CLIENT_SECRET="client_secret",t.RESPONSE_TYPE="response_type",t.SCOPE="scope",t.STATE="state",t.REDIRECT_URI="redirect_uri",t.ERROR="error",t.ERROR_DESCRIPTION="error_description",t.ERROR_URI="error_uri",t.GRANT_TYPE="grant_type",t.CODE="code",t.ACCESS_TOKEN="access_token",t.TOKEN_TYPE="token_type",t.EXPIRES_IN="expires_in",t.USERNAME="username",t.PASSWORD="password",t.REFRESH_TOKEN="refresh_token"}(n||(n={})),function(t){t.UNREACHABLE="unreachable",t.LOCAL="local",t.CANCELLED="cancelled",t.UNKNOWN="unknown",t.INVALID_ARGUMENT="invalid_argument",t.DEADLINE_EXCEEDED="deadline_exceeded",t.NOT_FOUND="not_found",t.ALREADY_EXISTS="already_exists",t.PERMISSION_DENIED="permission_denied",t.UNAUTHENTICATED="unauthenticated",t.RESOURCE_EXHAUSTED="resource_exhausted",t.FAILED_PRECONDITION="failed_precondition",t.ABORTED="aborted",t.OUT_OF_RANGE="out_of_range",t.UNIMPLEMENTED="unimplemented",t.INTERNAL="internal",t.UNAVAILABLE="unavailable",t.DATA_LOSS="data_loss",t.CAPTCHA_REQUIRED="captcha_required",t.CAPTCHA_INVALID="captcha_invalid",t.INVALID_PASSWORD="invalid_password",t.INVALID_STATUS="invalid_status",t.USER_PENDING="user_pending",t.USER_BLOCKED="user_blocked",t.INVALID_VERIFICATION_CODE="invalid_verification_code",t.TWO_FACTOR_REQUIRED="two_factor_required",t.INVALID_TWO_FACTOR="invalid_two_factor",t.INVALID_TWO_FACTOR_RECOVERY="invalid_two_factor_recovery",t.UNDER_REVIEW="under_review",t.INVALID_REQUEST="invalid_request",t.UNAUTHORIZED_CLIENT="unauthorized_client",t.ACCESS_DENIED="access_denied",t.UNSUPPORTED_RESPONSE_TYPE="unsupported_response_type",t.INVALID_SCOPE="invalid_scope",t.INVALID_GRANT="invalid_grant",t.SERVER_ERROR="server_error",t.TEMPORARILY_UNAVAILABLE="temporarily_unavailable",t.INTERACTION_REQUIRED="interaction_required",t.LOGIN_REQUIRED="login_required",t.ACCOUNT_SELECTION_REQUIRED="account_selection_required",t.CONSENT_REQUIRED="consent_required",t.INVALID_REQUEST_URI="invalid_request_uri",t.INVALID_REQUEST_OBJECT="invalid_request_object",t.REQUEST_NOT_SUPPORTED="request_not_supported",t.REQUEST_URI_NOT_SUPPORTED="request_uri_not_supported",t.REGISTRATION_NOT_SUPPORTED="registration_not_supported"}(i||(i={})),function(t){t.AUTH_SIGN_IN_URL="/auth/v1/signin",t.AUTH_SIGN_IN_ANONYMOUSLY_URL="/auth/v1/signin/anonymously",t.AUTH_SIGN_IN_WITH_PROVIDER_URL="/auth/v1/signin/with/provider",t.AUTH_SIGN_IN_WITH_WECHAT_URL="/auth/v1/signin/wechat/noauth",t.AUTH_SIGN_UP_URL="/auth/v1/signup",t.AUTH_TOKEN_URL="/auth/v1/token",t.AUTH_REVOKE_URL="/auth/v1/revoke",t.PROVIDER_BIND_URL="/auth/v1/user/provider/bind",t.PROVIDER_TOKEN_URL="/auth/v1/provider/token",t.PROVIDER_URI_URL="/auth/v1/provider/uri",t.USER_ME_URL="/auth/v1/user/me",t.WEDA_USER_URL="/auth/v1/plugin/weda/userinfo",t.USER_QUERY_URL="/auth/v1/user/query",t.USER_PRIFILE_URL="/auth/v1/user/profile",t.USER_BASIC_EDIT_URL="/auth/v1/user/basic/edit",t.USER_TRANS_BY_PROVIDER_URL="/auth/v1/user/trans/by/provider",t.VERIFICATION_URL="/auth/v1/verification",t.VERIFY_URL="/auth/v1/verification/verify",t.CAPTCHA_DATA_URL="/auth/v1/captcha/data",t.VERIFY_CAPTCHA_DATA_URL="/auth/v1/captcha/data/verify",t.GET_CAPTCHA_URL="/auth/v1/captcha/init",t.PROVIDER_LIST="/auth/v1/user/provider",t.PROVIDER_UNBIND_URL="/auth/v1/user/provider",t.CHECK_PWD_URL="/auth/v1/user/sudo",t.SUDO_URL="/auth/v1/user/sudo",t.BIND_CONTACT_URL="/auth/v1/user/contact",t.AUTH_SET_PASSWORD="/auth/v1/user/password",t.AUTH_RESET_PASSWORD="/auth/v1/reset",t.AUTH_GET_DEVICE_CODE="/auth/v1/device/code",t.CHECK_USERNAME="/auth/v1/checkUsername",t.CHECK_IF_USER_EXIST="/auth/v1/checkIfUserExist",t.GET_PROVIDER_TYPE="/auth/v1/mgr/provider/providerSubType",t.GET_MINIPROGRAM_QRCODE="/auth/v1/qrcode/generate",t.GET_MINIPROGRAM_QRCODE_STATUS="/auth/v1/qrcode/get/status"}(o||(o={})),function(t){t.AUTH_SIGN_IN_URL="/auth/v2/signin/username",t.AUTH_TOKEN_URL="/auth/v2/token",t.USER_ME_URL="/auth/v2/user/me",t.VERIFY_URL="/auth/v2/signin/verificationcode",t.AUTH_SIGN_IN_WITH_PROVIDER_URL="/auth/v2/signin/with/provider",t.AUTH_PUBLIC_KEY="/auth/v2/signin/publichkey"}(s||(s={})),function(t){t.REGISTER="REGISTER",t.SIGN_IN="SIGN_IN",t.PASSWORD_RESET="PASSWORD_RESET",t.EMAIL_ADDRESS_CHANGE="EMAIL_ADDRESS_CHANGE",t.PHONE_NUMBER_CHANGE="PHONE_NUMBER_CHANGE"}(a||(a={})),function(t){t.INVALID_ARGUMENT="invalid_argument",t.DEADLINE_EXCEEDED="deadline_exceeded",t.NOT_FOUND="not_found",t.ALREADY_EXISTS="already_exists",t.PERMISSION_DENIED="permission_denied",t.ABORTED="aborted",t.OUT_OF_RANGE="out_of_range",t.UNIMPLEMENTED="unimplemented",t.INTERNAL="internal",t.UNAVAILABLE="unavailable",t.DATA_LOSS="data_loss",t.CAPTCHA_REQUIRED="captcha_required",t.CAPTCHA_INVALID="captcha_invalid",t.INVALID_PASSWORD="invalid_password",t.PASSWORD_NOT_SET="password_not_set",t.INVALID_STATUS="invalid_status",t.USER_PENDING="user_pending",t.USER_BLOCKED="user_blocked"}(u||(u={}));var l=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))},f=function(t,e){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(u){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,n=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=e.call(t,s)}catch(t){a=[6,t],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}},d=function(){function t(){this.fnPromiseMap=new Map}return t.prototype.run=function(t,e){return l(this,void 0,void 0,(function(){var r,n=this;return f(this,(function(i){switch(i.label){case 0:return[4,r=this.fnPromiseMap.get(t)];case 1:return i.sent()||(r=new Promise((function(r,i){l(n,void 0,void 0,(function(){var n,o,s;return f(this,(function(a){switch(a.label){case 0:return a.trys.push([0,3,4,5]),[4,this.runIdlePromise()];case 1:return a.sent(),n=e(),o=r,[4,n];case 2:return o.apply(void 0,[a.sent()]),[3,5];case 3:return s=a.sent(),i(s),[3,5];case 4:return this.fnPromiseMap.delete(t),[7];case 5:return[2]}}))}))})),this.fnPromiseMap.set(t,r)),[2,r]}}))}))},t.prototype.runIdlePromise=function(){return Promise.resolve()},t}(),p=function(){return p=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},p.apply(this,arguments)},g=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))},v=function(t,e){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(u){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,n=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=e.call(t,s)}catch(t){a=[6,t],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}},y="x-request-id",m="x-device-id",E="device_id",b=function(t,e){return g(this,void 0,void 0,(function(){var r,n,o,s,a;return v(this,(function(u){switch(u.label){case 0:r=null,n=null,u.label=1;case 1:return u.trys.push([1,4,,5]),(o=Object.assign({},e)).method||(o.method="GET"),o.body&&"string"!=typeof o.body&&(o.body=JSON.stringify(o.body)),[4,fetch(t,o)];case 2:return[4,u.sent().json()];case 3:return(null==(s=u.sent())?void 0:s.error)?(n=s).error_uri=new URL(t).pathname:r=s,[3,5];case 4:return a=u.sent(),n={error:i.UNREACHABLE,error_description:a.message,error_uri:new URL(t).pathname},[3,5];case 5:if(n)throw n;return[2,r]}}))}))},T=function(t,e){var r,n=e||{};if(t instanceof Error)r={error:n.error||i.LOCAL,error_description:n.error_description||t.message,error_uri:n.error_uri,details:n.details||t.stack};else{var o=t||{};r={error:n.error||o.error||i.LOCAL,error_description:n.error_description||o.error_description,error_uri:n.error_uri||o.error_uri,details:n.details||o.details}}return r};function S(){return c()}var _=new(function(){function t(){}return t.prototype.getItem=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,window.localStorage.getItem(t)]}))}))},t.prototype.removeItem=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return window.localStorage.removeItem(t),[2]}))}))},t.prototype.setItem=function(t,e){return g(this,void 0,void 0,(function(){return v(this,(function(r){return window.localStorage.setItem(t,e),[2]}))}))},t.prototype.getItemSync=function(t){return window.localStorage.getItem(t)},t.prototype.removeItemSync=function(t){window.localStorage.removeItem(t)},t.prototype.setItemSync=function(t,e){window.localStorage.setItem(t,e)},t}());function w(t){var e=!0;return(null==t?void 0:t.expires_at)&&(null==t?void 0:t.access_token)&&(e=t.expires_at<new Date),e}var R=function(){function t(t){this.credentials=null,this.singlePromise=new d,this.tokenSectionName=t.tokenSectionName,this.storage=t.storage}return t.prototype.getStorageCredentialsSync=function(){var t=null,e=this.storage.getItemSync(this.tokenSectionName);if(null!=e)try{(null==(t=JSON.parse(e))?void 0:t.expires_at)&&(t.expires_at=new Date(t.expires_at))}catch(e){this.storage.removeItem(this.tokenSectionName),t=null}return t},t.prototype.setCredentials=function(t){return g(this,void 0,void 0,(function(){var e;return v(this,(function(r){switch(r.label){case 0:return(null==t?void 0:t.expires_in)?(t.expires_at=new Date(Date.now()+1e3*(t.expires_in-30)),this.storage?(e=JSON.stringify(t),[4,this.storage.setItem(this.tokenSectionName,e)]):[3,2]):[3,3];case 1:r.sent(),r.label=2;case 2:return this.credentials=t,[3,6];case 3:return this.storage?[4,this.storage.removeItem(this.tokenSectionName)]:[3,5];case 4:r.sent(),r.label=5;case 5:this.credentials=null,r.label=6;case 6:return[2]}}))}))},t.prototype.getCredentials=function(){return g(this,void 0,void 0,(function(){var t=this;return v(this,(function(e){return[2,this.singlePromise.run("getCredentials",(function(){return g(t,void 0,void 0,(function(){var t;return v(this,(function(e){switch(e.label){case 0:return w(this.credentials)?(t=this,[4,this.getStorageCredentials()]):[3,2];case 1:t.credentials=e.sent(),e.label=2;case 2:return[2,this.credentials]}}))}))}))]}))}))},t.prototype.getStorageCredentials=function(){return g(this,void 0,void 0,(function(){var t=this;return v(this,(function(e){return[2,this.singlePromise.run("_getStorageCredentials",(function(){return g(t,void 0,void 0,(function(){var t,e;return v(this,(function(r){switch(r.label){case 0:return t=null,[4,this.storage.getItem(this.tokenSectionName)];case 1:if(null==(e=r.sent()))return[3,5];r.label=2;case 2:return r.trys.push([2,3,,5]),(null==(t=JSON.parse(e))?void 0:t.expires_at)&&(t.expires_at=new Date(t.expires_at)),[3,5];case 3:return r.sent(),[4,this.storage.removeItem(this.tokenSectionName)];case 4:return r.sent(),t=null,[3,5];case 5:return[2,t]}}))}))}))]}))}))},t}(),I=function(){function t(e){this.singlePromise=new d,this.apiOrigin=e.apiOrigin,this.clientId=e.clientId,this.retry=this.formatRetry(e.retry,t.defaultRetry),e.baseRequest?this.baseRequest=e.baseRequest:this.baseRequest=b,this.tokenInURL=e.tokenInURL,this.headers=e.headers,this.storage=e.storage||_,this.localCredentials=new R({tokenSectionName:"credentials_".concat(e.clientId),storage:this.storage}),this.clientSecret=e.clientSecret,this.refreshTokenFunc=e.refreshTokenFunc||this.defaultRefreshTokenFunc,this.anonymousSignInFunc=e.anonymousSignInFunc}return t.prototype.setCredentials=function(t){return this.localCredentials.setCredentials(t)},t.prototype.getAccessToken=function(){return g(this,void 0,void 0,(function(){var t,e;return v(this,(function(r){switch(r.label){case 0:return[4,this.getCredentials()];case 1:return(null==(t=r.sent())?void 0:t.access_token)?[2,Promise.resolve(t.access_token)]:(e={error:i.UNAUTHENTICATED},[2,Promise.reject(e)])}}))}))},t.prototype.request=function(e,r){return g(this,void 0,void 0,(function(){var n,o,s,a,u,h,c;return v(this,(function(l){switch(l.label){case 0:return r||(r={}),n=this.formatRetry(r.retry,this.retry),r.headers=r.headers||{},this.headers&&(r.headers=p(p({},this.headers),r.headers)),r.headers[y]||(r.headers[y]=S()),r.headers[m]?[3,2]:[4,this.getDeviceId()];case 1:o=l.sent(),r.headers[m]=o,l.label=2;case 2:return(null==r?void 0:r.withCredentials)?[4,this.getCredentials()]:[3,4];case 3:return(s=l.sent())&&(this.tokenInURL?(e.indexOf("?")<0&&(e+="?"),e+="access_token=".concat(s.access_token)):r.headers.Authorization="".concat(s.token_type," ").concat(s.access_token)),[3,5];case 4:this.clientId&&e.indexOf("client_id")<0&&(e+=e.indexOf("?")<0?"?":"&",e+="client_id=".concat(this.clientId)),l.label=5;case 5:e.startsWith("/")&&(e=this.apiOrigin+e),a=null,u=n+1,h=0,l.label=6;case 6:if(!(h<u))return[3,15];l.label=7;case 7:return l.trys.push([7,9,,12]),[4,this.baseRequest(e,r)];case 8:return a=l.sent(),[3,15];case 9:return c=l.sent(),r.withCredentials&&c&&c.error===i.UNAUTHENTICATED?[4,this.setCredentials(null)]:[3,11];case 10:return l.sent(),[2,Promise.reject(c)];case 11:return h!==n&&c&&"unreachable"===c.error?[3,12]:[2,Promise.reject(c)];case 12:return[4,this.sleep(t.retryInterval)];case 13:l.sent(),l.label=14;case 14:return h++,[3,6];case 15:return[2,a]}}))}))},t.prototype.getCredentials=function(){return g(this,void 0,void 0,(function(){var t,e,r;return v(this,(function(n){switch(n.label){case 0:return[4,this.localCredentials.getCredentials()];case 1:return w(t=n.sent())?t&&"anonymous"===t.scope?this.anonymousSignInFunc?[4,this.anonymousSignInFunc(t)]:[3,5]:[3,8]:[3,10];case 2:return e=n.sent(),(r=e)?[3,4]:[4,this.localCredentials.getCredentials()];case 3:r=n.sent(),n.label=4;case 4:return t=r,[3,7];case 5:return[4,this.anonymousSignIn(t)];case 6:t=n.sent(),n.label=7;case 7:return[3,10];case 8:return[4,this.refreshToken(t)];case 9:t=n.sent(),n.label=10;case 10:return[2,t]}}))}))},t.prototype.getCredentialsSync=function(){return this.localCredentials.getStorageCredentialsSync()},t.prototype.getCredentialsAsync=function(){return this.getCredentials()},t.prototype.getScope=function(){return g(this,void 0,void 0,(function(){var t;return v(this,(function(e){switch(e.label){case 0:return[4,this.localCredentials.getCredentials()];case 1:return(t=e.sent())?[2,t.scope]:[2,this.unAuthenticatedError("credentials not found")]}}))}))},t.prototype.getGroups=function(){return g(this,void 0,void 0,(function(){var t;return v(this,(function(e){switch(e.label){case 0:return[4,this.localCredentials.getCredentials()];case 1:return(t=e.sent())?[2,t.groups]:[2,this.unAuthenticatedError("credentials not found")]}}))}))},t.prototype.refreshToken=function(t){return g(this,void 0,void 0,(function(){var e=this;return v(this,(function(r){return[2,this.singlePromise.run("_refreshToken",(function(){return g(e,void 0,void 0,(function(){var e,r;return v(this,(function(n){switch(n.label){case 0:if(!t||!t.refresh_token)return[2,this.unAuthenticatedError("no refresh token found in credentials")];n.label=1;case 1:return n.trys.push([1,4,,7]),[4,this.refreshTokenFunc(t.refresh_token,t)];case 2:return e=n.sent(),[4,this.localCredentials.setCredentials(e)];case 3:return n.sent(),[2,e];case 4:return(r=n.sent()).error!==i.INVALID_GRANT?[3,6]:[4,this.localCredentials.setCredentials(null)];case 5:return n.sent(),[2,this.unAuthenticatedError(r.error_description)];case 6:return[2,Promise.reject(r)];case 7:return[2]}}))}))}))]}))}))},t.prototype.checkRetry=function(e){var r=null;if(("number"!=typeof e||e<t.minRetry||e>t.maxRetry)&&(r={error:i.UNREACHABLE,error_description:"wrong options param: retry"}),r)throw r;return e},t.prototype.formatRetry=function(t,e){return void 0===t?e:this.checkRetry(t)},t.prototype.sleep=function(t){return g(this,void 0,void 0,(function(){return v(this,(function(e){return[2,new Promise((function(e){setTimeout((function(){e()}),t)}))]}))}))},t.prototype.anonymousSignIn=function(t){return g(this,void 0,void 0,(function(){var e=this;return v(this,(function(r){return[2,this.singlePromise.run("_anonymous",(function(){return g(e,void 0,void 0,(function(){var e,r;return v(this,(function(n){switch(n.label){case 0:if(!t||"anonymous"!==t.scope)return[2,this.unAuthenticatedError("no anonymous in credentials")];n.label=1;case 1:return n.trys.push([1,4,,7]),[4,this.request("/auth/v1/signin/anonymously",{method:"POST",body:{client_id:this.clientId,client_secret:this.clientSecret}})];case 2:return e=n.sent(),[4,this.localCredentials.setCredentials(e)];case 3:return n.sent(),[2,e];case 4:return(r=n.sent()).error!==i.INVALID_GRANT?[3,6]:[4,this.localCredentials.setCredentials(null)];case 5:return n.sent(),[2,this.unAuthenticatedError(r.error_description)];case 6:return[2,Promise.reject(r)];case 7:return[2]}}))}))}))]}))}))},t.prototype.defaultRefreshTokenFunc=function(t,e){return g(this,void 0,void 0,(function(){var r,n;return v(this,(function(i){switch(i.label){case 0:return void 0===t||""===t?[2,this.unAuthenticatedError("refresh token not found")]:(r=o.AUTH_TOKEN_URL,"v2"===(null==e?void 0:e.version)&&(r=s.AUTH_TOKEN_URL),[4,this.request(r,{method:"POST",body:{client_id:this.clientId,client_secret:this.clientSecret,grant_type:"refresh_token",refresh_token:t}})]);case 1:return n=i.sent(),[2,p(p({},n),{version:(null==e?void 0:e.version)||"v1"})]}}))}))},t.prototype.getDeviceId=function(){return g(this,void 0,void 0,(function(){var t;return v(this,(function(e){switch(e.label){case 0:return this.deviceID?[2,this.deviceID]:[4,this.storage.getItem(E)];case 1:return"string"==typeof(t=e.sent())&&t.length>=16&&t.length<=48?[3,3]:(t=c(),[4,this.storage.setItem(E,t)]);case 2:e.sent(),e.label=3;case 3:return this.deviceID=t,[2,t]}}))}))},t.prototype.unAuthenticatedError=function(t){var e={error:i.UNAUTHENTICATED,error_description:t};return Promise.reject(e)},t.defaultRetry=2,t.minRetry=0,t.maxRetry=5,t.retryInterval=1e3,t}();function D(){var t=globalThis.wx;if(void 0===t)return!1;if(void 0===globalThis.Page)return!1;if(!t.getSystemInfoSync)return!1;if(!t.getStorageSync)return!1;if(!t.setStorageSync)return!1;if(!t.connectSocket)return!1;if(!t.request)return!1;try{if(!t.getSystemInfoSync())return!1;if("qq"===t.getSystemInfoSync().AppPlatform)return!1}catch(t){return!1}return!0}var A=!1;function O(){A=A||void 0!==typeof window&&"miniprogram"===window.__wxjs_environment}try{D()||(A=A||!!navigator.userAgent.match(/miniprogram/i)||"miniprogram"===window.__wxjs_environment,window&&window.WeixinJSBridge&&window.WeixinJSBridge.invoke?O():"undefined"!=typeof document&&document.addEventListener("WeixinJSBridgeReady",O,!1))}catch(t){}function C(){return A}var N,P=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))},x=function(t,e){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(u){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,n=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=e.call(t,s)}catch(t){a=[6,t],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}},U=function(){function t(t){t.openURIWithCallback||(t.openURIWithCallback=this.getDefaultOpenURIWithCallback()),t.storage||(t.storage=_),this.config=t,this.tokenSectionName="captcha_".concat(t.clientId)}return t.prototype.request=function(t,e){return P(this,void 0,void 0,(function(){var r,n,i,o;return x(this,(function(s){switch(s.label){case 0:return e||(e={}),e.method||(e.method="GET"),r="".concat(e.method,":").concat(t),n=t,e.withCaptcha?[4,this.appendCaptchaTokenToURL(t,r,!1)]:[3,2];case 1:n=s.sent(),s.label=2;case 2:return s.trys.push([2,4,,7]),[4,this.config.request(n,e)];case 3:return i=s.sent(),[3,7];case 4:return(o=s.sent()).error!==u.CAPTCHA_REQUIRED&&o.error!==u.CAPTCHA_INVALID?[3,6]:[4,this.appendCaptchaTokenToURL(t,r,o.error===u.CAPTCHA_INVALID)];case 5:return t=s.sent(),[2,this.config.request(t,e)];case 6:return[2,Promise.reject(o)];case 7:return[2,i]}}))}))},t.prototype.getDefaultOpenURIWithCallback=function(){if(!D()&&!C()&&(window.location.search.indexOf("__captcha")>0&&(document.body.style.display="none"),null===document.getElementById("captcha_panel_wrap"))){var t=document.createElement("div");t.style.cssText="background-color: rgba(0, 0, 0, 0.7);position: fixed;left: 0px;right: 0px;top: 0px;bottom: 0px;padding: 9vw 0 0 0;display: none;z-index:100;",t.setAttribute("id","captcha_panel_wrap"),setTimeout((function(){document.body.appendChild(t)}),0)}return this.defaultOpenURIWithCallback},t.prototype.defaultOpenURIWithCallback=function(t,e){return P(this,void 0,void 0,(function(){var r,n,i,o,s,a,h;return x(this,(function(c){return n=(r=e||{}).width,i=void 0===n?"355px":n,o=r.height,s=void 0===o?"355px":o,t.match(/^(data:.*)$/)?[2,Promise.reject({error:u.UNIMPLEMENTED,error_description:"need to impl captcha data"})]:(a=document.getElementById("captcha_panel_wrap"),h=document.createElement("iframe"),a.innerHTML="",h.setAttribute("src",t),h.setAttribute("id","review-panel-iframe"),h.style.cssText="min-width:".concat(i,";display:block;height:").concat(s,";margin:0 auto;background-color: rgb(255, 255, 255);border: none;"),a.appendChild(h),a.style.display="block",[2,new Promise((function(t,e){h.onload=function(){try{var r=window.location,n=h.contentWindow.location;if(n.host+n.pathname===r.host+r.pathname){a.style.display="none";var i=new URLSearchParams(n.search),o=i.get("captcha_token");return o?t({captcha_token:o,expires_in:Number(i.get("expires_in"))}):e({error:i.get("error"),error_description:i.get("error_description")})}a.style.display="block"}catch(t){a.style.display="block"}}}))])}))}))},t.prototype.getCaptchaToken=function(t,e){return P(this,void 0,void 0,(function(){var r,n,i,s,a,u;return x(this,(function(h){switch(h.label){case 0:return t?[3,2]:[4,this.findCaptchaToken()];case 1:if(r=h.sent())return[2,r];h.label=2;case 2:return D()||C()?[3,4]:(i="".concat(window.location.origin+window.location.pathname,"?__captcha=on"),[4,this.config.request(o.GET_CAPTCHA_URL,{method:"POST",body:{client_id:this.config.clientId,redirect_uri:i,state:e},withCredentials:!1})]);case 3:return(n=h.sent()).captcha_token?(s={captcha_token:n.captcha_token,expires_in:n.expires_in},this.saveCaptchaToken(s),[2,n.captcha_token]):[3,6];case 4:return[4,this.config.request(o.CAPTCHA_DATA_URL,{method:"POST",body:{state:e,redirect_uri:""},withCredentials:!1})];case 5:a=h.sent(),n={url:"".concat(a.data,"?state=").concat(encodeURIComponent(e),"&token=").concat(encodeURIComponent(a.token))},h.label=6;case 6:return[4,this.config.openURIWithCallback(n.url)];case 7:return u=h.sent(),this.saveCaptchaToken(u),[2,u.captcha_token]}}))}))},t.prototype.appendCaptchaTokenToURL=function(t,e,r){return P(this,void 0,void 0,(function(){var n;return x(this,(function(i){switch(i.label){case 0:return[4,this.getCaptchaToken(r,e)];case 1:return n=i.sent(),t.indexOf("?")>0?t+="&captcha_token=".concat(n):t+="?captcha_token=".concat(n),[2,t]}}))}))},t.prototype.saveCaptchaToken=function(t){return P(this,void 0,void 0,(function(){var e;return x(this,(function(r){switch(r.label){case 0:return t.expires_at=new Date(Date.now()+1e3*(t.expires_in-10)),e=JSON.stringify(t),[4,this.config.storage.setItem(this.tokenSectionName,e)];case 1:return r.sent(),[2]}}))}))},t.prototype.findCaptchaToken=function(){return P(this,void 0,void 0,(function(){var t,e;return x(this,(function(r){switch(r.label){case 0:return[4,this.config.storage.getItem(this.tokenSectionName)];case 1:if(null==(t=r.sent()))return[3,5];r.label=2;case 2:return r.trys.push([2,3,,5]),(null==(e=JSON.parse(t))?void 0:e.expires_at)&&(e.expires_at=new Date(e.expires_at)),e.expires_at<new Date?[2,null]:[2,e.captcha_token];case 3:return r.sent(),[4,this.config.storage.removeItem(this.tokenSectionName)];case 4:return r.sent(),[2,null];case 5:return[2,null]}}))}))},t}(),L=function(t){var e=function(e){for(var r in t)t.hasOwnProperty(r)&&(e[r]=L(t[r]));return e},r=null==t?"NullOrUndefined":Object.prototype.toString.call(t).slice(8,-1);if(["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"].includes(r))return t.slice();switch(r){case"Object":return e(Object.create(Object.getPrototypeOf(t)));case"Array":return e([]);case"Date":return new Date(t.valueOf());case"RegExp":return new RegExp(t.source,(t.global?"g":"")+(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.sticky?"y":"")+(t.unicode?"u":""));default:return t}},V=(N=function(t,e){return N=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},N(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}N(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),B="0123456789abcdefghijklmnopqrstuvwxyz";function k(t){return B.charAt(t)}function q(t,e){return t&e}function H(t,e){return t|e}function M(t,e){return t^e}function j(t,e){return t&~e}function F(t){if(0==t)return-1;var e=0;return 0==(65535&t)&&(t>>=16,e+=16),0==(255&t)&&(t>>=8,e+=8),0==(15&t)&&(t>>=4,e+=4),0==(3&t)&&(t>>=2,e+=2),0==(1&t)&&++e,e}function G(t){for(var e=0;0!=t;)t&=t-1,++e;return e}var K="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",W="=";function Y(t){var e,r,n="";for(e=0;e+3<=t.length;e+=3)r=parseInt(t.substring(e,e+3),16),n+=K.charAt(r>>6)+K.charAt(63&r);for(e+1==t.length?(r=parseInt(t.substring(e,e+1),16),n+=K.charAt(r<<2)):e+2==t.length&&(r=parseInt(t.substring(e,e+2),16),n+=K.charAt(r>>2)+K.charAt((3&r)<<4));(3&n.length)>0;)n+=W;return n}function z(t){var e,r="",n=0,i=0;for(e=0;e<t.length&&t.charAt(e)!=W;++e){var o=K.indexOf(t.charAt(e));o<0||(0==n?(r+=k(o>>2),i=3&o,n=1):1==n?(r+=k(i<<2|o>>4),i=15&o,n=2):2==n?(r+=k(i),r+=k(o>>2),i=3&o,n=3):(r+=k(i<<2|o>>4),r+=k(15&o),n=0))}return 1==n&&(r+=k(i<<2)),r}var Q,Z,J={decode:function(t){var e;if(void 0===Z){var r="= \f\n\r\t \u2028\u2029";for(Z=Object.create(null),e=0;e<64;++e)Z["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e)]=e;for(e=0;e<r.length;++e)Z[r.charAt(e)]=-1}var n=[],i=0,o=0;for(e=0;e<t.length;++e){var s=t.charAt(e);if("="==s)break;if(-1!=(s=Z[s])){if(void 0===s)throw new Error("Illegal character at offset "+e);i|=s,++o>=4?(n[n.length]=i>>16,n[n.length]=i>>8&255,n[n.length]=255&i,i=0,o=0):i<<=6}}switch(o){case 1:throw new Error("Base64 encoding incomplete: at least 2 bits missing");case 2:n[n.length]=i>>10;break;case 3:n[n.length]=i>>16,n[n.length]=i>>8&255}return n},re:/-----BEGIN [^-]+-----([A-Za-z0-9+\/=\s]+)-----END [^-]+-----|begin-base64[^\n]+\n([A-Za-z0-9+\/=\s]+)====/,unarmor:function(t){var e=J.re.exec(t);if(e)if(e[1])t=e[1];else{if(!e[2])throw new Error("RegExp out of sync");t=e[2]}return J.decode(t)}},$=1e13,X=function(){function t(t){this.buf=[+t||0]}return t.prototype.mulAdd=function(t,e){var r,n,i=this.buf,o=i.length;for(r=0;r<o;++r)(n=i[r]*t+e)<$?e=0:n-=(e=0|n/$)*$,i[r]=n;e>0&&(i[r]=e)},t.prototype.sub=function(t){var e,r,n=this.buf,i=n.length;for(e=0;e<i;++e)(r=n[e]-t)<0?(r+=$,t=1):t=0,n[e]=r;for(;0===n[n.length-1];)n.pop()},t.prototype.toString=function(t){if(10!=(t||10))throw new Error("only base 10 is supported");for(var e=this.buf,r=e[e.length-1].toString(),n=e.length-2;n>=0;--n)r+=($+e[n]).toString().substring(1);return r},t.prototype.valueOf=function(){for(var t=this.buf,e=0,r=t.length-1;r>=0;--r)e=e*$+t[r];return e},t.prototype.simplify=function(){var t=this.buf;return 1==t.length?t[0]:this},t}(),tt="…",et=/^(\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/,rt=/^(\d\d\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/;function nt(t,e){return t.length>e&&(t=t.substring(0,e)+tt),t}var it,ot=function(){function t(e,r){this.hexDigits="0123456789ABCDEF",e instanceof t?(this.enc=e.enc,this.pos=e.pos):(this.enc=e,this.pos=r)}return t.prototype.get=function(t){if(void 0===t&&(t=this.pos++),t>=this.enc.length)throw new Error("Requesting byte offset "+t+" on a stream of length "+this.enc.length);return"string"==typeof this.enc?this.enc.charCodeAt(t):this.enc[t]},t.prototype.hexByte=function(t){return this.hexDigits.charAt(t>>4&15)+this.hexDigits.charAt(15&t)},t.prototype.hexDump=function(t,e,r){for(var n="",i=t;i<e;++i)if(n+=this.hexByte(this.get(i)),!0!==r)switch(15&i){case 7:n+=" ";break;case 15:n+="\n";break;default:n+=" "}return n},t.prototype.isASCII=function(t,e){for(var r=t;r<e;++r){var n=this.get(r);if(n<32||n>176)return!1}return!0},t.prototype.parseStringISO=function(t,e){for(var r="",n=t;n<e;++n)r+=String.fromCharCode(this.get(n));return r},t.prototype.parseStringUTF=function(t,e){for(var r="",n=t;n<e;){var i=this.get(n++);r+=i<128?String.fromCharCode(i):i>191&&i<224?String.fromCharCode((31&i)<<6|63&this.get(n++)):String.fromCharCode((15&i)<<12|(63&this.get(n++))<<6|63&this.get(n++))}return r},t.prototype.parseStringBMP=function(t,e){for(var r,n,i="",o=t;o<e;)r=this.get(o++),n=this.get(o++),i+=String.fromCharCode(r<<8|n);return i},t.prototype.parseTime=function(t,e,r){var n=this.parseStringISO(t,e),i=(r?et:rt).exec(n);return i?(r&&(i[1]=+i[1],i[1]+=+i[1]<70?2e3:1900),n=i[1]+"-"+i[2]+"-"+i[3]+" "+i[4],i[5]&&(n+=":"+i[5],i[6]&&(n+=":"+i[6],i[7]&&(n+="."+i[7]))),i[8]&&(n+=" UTC","Z"!=i[8]&&(n+=i[8],i[9]&&(n+=":"+i[9]))),n):"Unrecognized time: "+n},t.prototype.parseInteger=function(t,e){for(var r,n=this.get(t),i=n>127,o=i?255:0,s="";n==o&&++t<e;)n=this.get(t);if(0==(r=e-t))return i?-1:0;if(r>4){for(s=n,r<<=3;0==(128&(+s^o));)s=+s<<1,--r;s="("+r+" bit)\n"}i&&(n-=256);for(var a=new X(n),u=t+1;u<e;++u)a.mulAdd(256,this.get(u));return s+a.toString()},t.prototype.parseBitString=function(t,e,r){for(var n=this.get(t),i="("+((e-t-1<<3)-n)+" bit)\n",o="",s=t+1;s<e;++s){for(var a=this.get(s),u=s==e-1?n:0,h=7;h>=u;--h)o+=a>>h&1?"1":"0";if(o.length>r)return i+nt(o,r)}return i+o},t.prototype.parseOctetString=function(t,e,r){if(this.isASCII(t,e))return nt(this.parseStringISO(t,e),r);var n=e-t,i="("+n+" byte)\n";n>(r/=2)&&(e=t+r);for(var o=t;o<e;++o)i+=this.hexByte(this.get(o));return n>r&&(i+=tt),i},t.prototype.parseOID=function(t,e,r){for(var n="",i=new X,o=0,s=t;s<e;++s){var a=this.get(s);if(i.mulAdd(128,127&a),o+=7,!(128&a)){if(""===n)if((i=i.simplify())instanceof X)i.sub(80),n="2."+i.toString();else{var u=i<80?i<40?0:1:2;n=u+"."+(i-40*u)}else n+="."+i.toString();if(n.length>r)return nt(n,r);i=new X,o=0}}return o>0&&(n+=".incomplete"),n},t}(),st=function(){function t(t,e,r,n,i){if(!(n instanceof at))throw new Error("Invalid tag value.");this.stream=t,this.header=e,this.length=r,this.tag=n,this.sub=i}return t.prototype.typeName=function(){switch(this.tag.tagClass){case 0:switch(this.tag.tagNumber){case 0:return"EOC";case 1:return"BOOLEAN";case 2:return"INTEGER";case 3:return"BIT_STRING";case 4:return"OCTET_STRING";case 5:return"NULL";case 6:return"OBJECT_IDENTIFIER";case 7:return"ObjectDescriptor";case 8:return"EXTERNAL";case 9:return"REAL";case 10:return"ENUMERATED";case 11:return"EMBEDDED_PDV";case 12:return"UTF8String";case 16:return"SEQUENCE";case 17:return"SET";case 18:return"NumericString";case 19:return"PrintableString";case 20:return"TeletexString";case 21:return"VideotexString";case 22:return"IA5String";case 23:return"UTCTime";case 24:return"GeneralizedTime";case 25:return"GraphicString";case 26:return"VisibleString";case 27:return"GeneralString";case 28:return"UniversalString";case 30:return"BMPString"}return"Universal_"+this.tag.tagNumber.toString();case 1:return"Application_"+this.tag.tagNumber.toString();case 2:return"["+this.tag.tagNumber.toString()+"]";case 3:return"Private_"+this.tag.tagNumber.toString()}},t.prototype.content=function(t){if(void 0===this.tag)return null;void 0===t&&(t=1/0);var e=this.posContent(),r=Math.abs(this.length);if(!this.tag.isUniversal())return null!==this.sub?"("+this.sub.length+" elem)":this.stream.parseOctetString(e,e+r,t);switch(this.tag.tagNumber){case 1:return 0===this.stream.get(e)?"false":"true";case 2:return this.stream.parseInteger(e,e+r);case 3:return this.sub?"("+this.sub.length+" elem)":this.stream.parseBitString(e,e+r,t);case 4:return this.sub?"("+this.sub.length+" elem)":this.stream.parseOctetString(e,e+r,t);case 6:return this.stream.parseOID(e,e+r,t);case 16:case 17:return null!==this.sub?"("+this.sub.length+" elem)":"(no elem)";case 12:return nt(this.stream.parseStringUTF(e,e+r),t);case 18:case 19:case 20:case 21:case 22:case 26:return nt(this.stream.parseStringISO(e,e+r),t);case 30:return nt(this.stream.parseStringBMP(e,e+r),t);case 23:case 24:return this.stream.parseTime(e,e+r,23==this.tag.tagNumber)}return null},t.prototype.toString=function(){return this.typeName()+"@"+this.stream.pos+"[header:"+this.header+",length:"+this.length+",sub:"+(null===this.sub?"null":this.sub.length)+"]"},t.prototype.toPrettyString=function(t){void 0===t&&(t="");var e=t+this.typeName()+" @"+this.stream.pos;if(this.length>=0&&(e+="+"),e+=this.length,this.tag.tagConstructed?e+=" (constructed)":!this.tag.isUniversal()||3!=this.tag.tagNumber&&4!=this.tag.tagNumber||null===this.sub||(e+=" (encapsulates)"),e+="\n",null!==this.sub){t+=" ";for(var r=0,n=this.sub.length;r<n;++r)e+=this.sub[r].toPrettyString(t)}return e},t.prototype.posStart=function(){return this.stream.pos},t.prototype.posContent=function(){return this.stream.pos+this.header},t.prototype.posEnd=function(){return this.stream.pos+this.header+Math.abs(this.length)},t.prototype.toHexString=function(){return this.stream.hexDump(this.posStart(),this.posEnd(),!0)},t.decodeLength=function(t){var e=t.get(),r=127&e;if(r==e)return r;if(r>6)throw new Error("Length over 48 bits not supported at position "+(t.pos-1));if(0===r)return null;e=0;for(var n=0;n<r;++n)e=256*e+t.get();return e},t.prototype.getHexStringValue=function(){var t=this.toHexString(),e=2*this.header,r=2*this.length;return t.substr(e,r)},t.decode=function(e){var r;r=e instanceof ot?e:new ot(e,0);var n=new ot(r),i=new at(r),o=t.decodeLength(r),s=r.pos,a=s-n.pos,u=null,h=function(){var e=[];if(null!==o){for(var n=s+o;r.pos<n;)e[e.length]=t.decode(r);if(r.pos!=n)throw new Error("Content size is not correct for container starting at offset "+s)}else try{for(;;){var i=t.decode(r);if(i.tag.isEOC())break;e[e.length]=i}o=s-r.pos}catch(t){throw new Error("Exception while decoding undefined length content: "+t)}return e};if(i.tagConstructed)u=h();else if(i.isUniversal()&&(3==i.tagNumber||4==i.tagNumber))try{if(3==i.tagNumber&&0!=r.get())throw new Error("BIT STRINGs with unused bits cannot encapsulate.");u=h();for(var c=0;c<u.length;++c)if(u[c].tag.isEOC())throw new Error("EOC is not supposed to be actual content.")}catch(t){u=null}if(null===u){if(null===o)throw new Error("We can't skip over an invalid tag with undefined length at offset "+s);r.pos=s+Math.abs(o)}return new t(n,a,o,i,u)},t}(),at=function(){function t(t){var e=t.get();if(this.tagClass=e>>6,this.tagConstructed=0!=(32&e),this.tagNumber=31&e,31==this.tagNumber){var r=new X;do{e=t.get(),r.mulAdd(128,127&e)}while(128&e);this.tagNumber=r.simplify()}}return t.prototype.isUniversal=function(){return 0===this.tagClass},t.prototype.isEOC=function(){return 0===this.tagClass&&0===this.tagNumber},t}(),ut=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],ht=(1<<26)/ut[ut.length-1],ct=function(){function t(t,e,r){null!=t&&("number"==typeof t?this.fromNumber(t,e,r):null==e&&"string"!=typeof t?this.fromString(t,256):this.fromString(t,e))}return t.prototype.toString=function(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(16==t)e=4;else if(8==t)e=3;else if(2==t)e=1;else if(32==t)e=5;else{if(4!=t)return this.toRadix(t);e=2}var r,n=(1<<e)-1,i=!1,o="",s=this.t,a=this.DB-s*this.DB%e;if(s-- >0)for(a<this.DB&&(r=this[s]>>a)>0&&(i=!0,o=k(r));s>=0;)a<e?(r=(this[s]&(1<<a)-1)<<e-a,r|=this[--s]>>(a+=this.DB-e)):(r=this[s]>>(a-=e)&n,a<=0&&(a+=this.DB,--s)),r>0&&(i=!0),i&&(o+=k(r));return i?o:"0"},t.prototype.negate=function(){var e=gt();return t.ZERO.subTo(this,e),e},t.prototype.abs=function(){return this.s<0?this.negate():this},t.prototype.compareTo=function(t){var e=this.s-t.s;if(0!=e)return e;var r=this.t;if(0!=(e=r-t.t))return this.s<0?-e:e;for(;--r>=0;)if(0!=(e=this[r]-t[r]))return e;return 0},t.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+St(this[this.t-1]^this.s&this.DM)},t.prototype.mod=function(e){var r=gt();return this.abs().divRemTo(e,null,r),this.s<0&&r.compareTo(t.ZERO)>0&&e.subTo(r,r),r},t.prototype.modPowInt=function(t,e){var r;return r=t<256||e.isEven()?new ft(e):new dt(e),this.exp(t,r)},t.prototype.clone=function(){var t=gt();return this.copyTo(t),t},t.prototype.intValue=function(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]},t.prototype.byteValue=function(){return 0==this.t?this.s:this[0]<<24>>24},t.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},t.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},t.prototype.toByteArray=function(){var t=this.t,e=[];e[0]=this.s;var r,n=this.DB-t*this.DB%8,i=0;if(t-- >0)for(n<this.DB&&(r=this[t]>>n)!=(this.s&this.DM)>>n&&(e[i++]=r|this.s<<this.DB-n);t>=0;)n<8?(r=(this[t]&(1<<n)-1)<<8-n,r|=this[--t]>>(n+=this.DB-8)):(r=this[t]>>(n-=8)&255,n<=0&&(n+=this.DB,--t)),0!=(128&r)&&(r|=-256),0==i&&(128&this.s)!=(128&r)&&++i,(i>0||r!=this.s)&&(e[i++]=r);return e},t.prototype.equals=function(t){return 0==this.compareTo(t)},t.prototype.min=function(t){return this.compareTo(t)<0?this:t},t.prototype.max=function(t){return this.compareTo(t)>0?this:t},t.prototype.and=function(t){var e=gt();return this.bitwiseTo(t,q,e),e},t.prototype.or=function(t){var e=gt();return this.bitwiseTo(t,H,e),e},t.prototype.xor=function(t){var e=gt();return this.bitwiseTo(t,M,e),e},t.prototype.andNot=function(t){var e=gt();return this.bitwiseTo(t,j,e),e},t.prototype.not=function(){for(var t=gt(),e=0;e<this.t;++e)t[e]=this.DM&~this[e];return t.t=this.t,t.s=~this.s,t},t.prototype.shiftLeft=function(t){var e=gt();return t<0?this.rShiftTo(-t,e):this.lShiftTo(t,e),e},t.prototype.shiftRight=function(t){var e=gt();return t<0?this.lShiftTo(-t,e):this.rShiftTo(t,e),e},t.prototype.getLowestSetBit=function(){for(var t=0;t<this.t;++t)if(0!=this[t])return t*this.DB+F(this[t]);return this.s<0?this.t*this.DB:-1},t.prototype.bitCount=function(){for(var t=0,e=this.s&this.DM,r=0;r<this.t;++r)t+=G(this[r]^e);return t},t.prototype.testBit=function(t){var e=Math.floor(t/this.DB);return e>=this.t?0!=this.s:0!=(this[e]&1<<t%this.DB)},t.prototype.setBit=function(t){return this.changeBit(t,H)},t.prototype.clearBit=function(t){return this.changeBit(t,j)},t.prototype.flipBit=function(t){return this.changeBit(t,M)},t.prototype.add=function(t){var e=gt();return this.addTo(t,e),e},t.prototype.subtract=function(t){var e=gt();return this.subTo(t,e),e},t.prototype.multiply=function(t){var e=gt();return this.multiplyTo(t,e),e},t.prototype.divide=function(t){var e=gt();return this.divRemTo(t,e,null),e},t.prototype.remainder=function(t){var e=gt();return this.divRemTo(t,null,e),e},t.prototype.divideAndRemainder=function(t){var e=gt(),r=gt();return this.divRemTo(t,e,r),[e,r]},t.prototype.modPow=function(t,e){var r,n,i=t.bitLength(),o=Tt(1);if(i<=0)return o;r=i<18?1:i<48?3:i<144?4:i<768?5:6,n=i<8?new ft(e):e.isEven()?new pt(e):new dt(e);var s=[],a=3,u=r-1,h=(1<<r)-1;if(s[1]=n.convert(this),r>1){var c=gt();for(n.sqrTo(s[1],c);a<=h;)s[a]=gt(),n.mulTo(c,s[a-2],s[a]),a+=2}var l,f,d=t.t-1,p=!0,g=gt();for(i=St(t[d])-1;d>=0;){for(i>=u?l=t[d]>>i-u&h:(l=(t[d]&(1<<i+1)-1)<<u-i,d>0&&(l|=t[d-1]>>this.DB+i-u)),a=r;0==(1&l);)l>>=1,--a;if((i-=a)<0&&(i+=this.DB,--d),p)s[l].copyTo(o),p=!1;else{for(;a>1;)n.sqrTo(o,g),n.sqrTo(g,o),a-=2;a>0?n.sqrTo(o,g):(f=o,o=g,g=f),n.mulTo(g,s[l],o)}for(;d>=0&&0==(t[d]&1<<i);)n.sqrTo(o,g),f=o,o=g,g=f,--i<0&&(i=this.DB-1,--d)}return n.revert(o)},t.prototype.modInverse=function(e){var r=e.isEven();if(this.isEven()&&r||0==e.signum())return t.ZERO;for(var n=e.clone(),i=this.clone(),o=Tt(1),s=Tt(0),a=Tt(0),u=Tt(1);0!=n.signum();){for(;n.isEven();)n.rShiftTo(1,n),r?(o.isEven()&&s.isEven()||(o.addTo(this,o),s.subTo(e,s)),o.rShiftTo(1,o)):s.isEven()||s.subTo(e,s),s.rShiftTo(1,s);for(;i.isEven();)i.rShiftTo(1,i),r?(a.isEven()&&u.isEven()||(a.addTo(this,a),u.subTo(e,u)),a.rShiftTo(1,a)):u.isEven()||u.subTo(e,u),u.rShiftTo(1,u);n.compareTo(i)>=0?(n.subTo(i,n),r&&o.subTo(a,o),s.subTo(u,s)):(i.subTo(n,i),r&&a.subTo(o,a),u.subTo(s,u))}return 0!=i.compareTo(t.ONE)?t.ZERO:u.compareTo(e)>=0?u.subtract(e):u.signum()<0?(u.addTo(e,u),u.signum()<0?u.add(e):u):u},t.prototype.pow=function(t){return this.exp(t,new lt)},t.prototype.gcd=function(t){var e=this.s<0?this.negate():this.clone(),r=t.s<0?t.negate():t.clone();if(e.compareTo(r)<0){var n=e;e=r,r=n}var i=e.getLowestSetBit(),o=r.getLowestSetBit();if(o<0)return e;for(i<o&&(o=i),o>0&&(e.rShiftTo(o,e),r.rShiftTo(o,r));e.signum()>0;)(i=e.getLowestSetBit())>0&&e.rShiftTo(i,e),(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),e.compareTo(r)>=0?(e.subTo(r,e),e.rShiftTo(1,e)):(r.subTo(e,r),r.rShiftTo(1,r));return o>0&&r.lShiftTo(o,r),r},t.prototype.isProbablePrime=function(t){var e,r=this.abs();if(1==r.t&&r[0]<=ut[ut.length-1]){for(e=0;e<ut.length;++e)if(r[0]==ut[e])return!0;return!1}if(r.isEven())return!1;for(e=1;e<ut.length;){for(var n=ut[e],i=e+1;i<ut.length&&n<ht;)n*=ut[i++];for(n=r.modInt(n);e<i;)if(n%ut[e++]==0)return!1}return r.millerRabin(t)},t.prototype.copyTo=function(t){for(var e=this.t-1;e>=0;--e)t[e]=this[e];t.t=this.t,t.s=this.s},t.prototype.fromInt=function(t){this.t=1,this.s=t<0?-1:0,t>0?this[0]=t:t<-1?this[0]=t+this.DV:this.t=0},t.prototype.fromString=function(e,r){var n;if(16==r)n=4;else if(8==r)n=3;else if(256==r)n=8;else if(2==r)n=1;else if(32==r)n=5;else{if(4!=r)return void this.fromRadix(e,r);n=2}this.t=0,this.s=0;for(var i=e.length,o=!1,s=0;--i>=0;){var a=8==n?255&+e[i]:bt(e,i);a<0?"-"==e.charAt(i)&&(o=!0):(o=!1,0==s?this[this.t++]=a:s+n>this.DB?(this[this.t-1]|=(a&(1<<this.DB-s)-1)<<s,this[this.t++]=a>>this.DB-s):this[this.t-1]|=a<<s,(s+=n)>=this.DB&&(s-=this.DB))}8==n&&0!=(128&+e[0])&&(this.s=-1,s>0&&(this[this.t-1]|=(1<<this.DB-s)-1<<s)),this.clamp(),o&&t.ZERO.subTo(this,this)},t.prototype.clamp=function(){for(var t=this.s&this.DM;this.t>0&&this[this.t-1]==t;)--this.t},t.prototype.dlShiftTo=function(t,e){var r;for(r=this.t-1;r>=0;--r)e[r+t]=this[r];for(r=t-1;r>=0;--r)e[r]=0;e.t=this.t+t,e.s=this.s},t.prototype.drShiftTo=function(t,e){for(var r=t;r<this.t;++r)e[r-t]=this[r];e.t=Math.max(this.t-t,0),e.s=this.s},t.prototype.lShiftTo=function(t,e){for(var r=t%this.DB,n=this.DB-r,i=(1<<n)-1,o=Math.floor(t/this.DB),s=this.s<<r&this.DM,a=this.t-1;a>=0;--a)e[a+o+1]=this[a]>>n|s,s=(this[a]&i)<<r;for(a=o-1;a>=0;--a)e[a]=0;e[o]=s,e.t=this.t+o+1,e.s=this.s,e.clamp()},t.prototype.rShiftTo=function(t,e){e.s=this.s;var r=Math.floor(t/this.DB);if(r>=this.t)e.t=0;else{var n=t%this.DB,i=this.DB-n,o=(1<<n)-1;e[0]=this[r]>>n;for(var s=r+1;s<this.t;++s)e[s-r-1]|=(this[s]&o)<<i,e[s-r]=this[s]>>n;n>0&&(e[this.t-r-1]|=(this.s&o)<<i),e.t=this.t-r,e.clamp()}},t.prototype.subTo=function(t,e){for(var r=0,n=0,i=Math.min(t.t,this.t);r<i;)n+=this[r]-t[r],e[r++]=n&this.DM,n>>=this.DB;if(t.t<this.t){for(n-=t.s;r<this.t;)n+=this[r],e[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<t.t;)n-=t[r],e[r++]=n&this.DM,n>>=this.DB;n-=t.s}e.s=n<0?-1:0,n<-1?e[r++]=this.DV+n:n>0&&(e[r++]=n),e.t=r,e.clamp()},t.prototype.multiplyTo=function(e,r){var n=this.abs(),i=e.abs(),o=n.t;for(r.t=o+i.t;--o>=0;)r[o]=0;for(o=0;o<i.t;++o)r[o+n.t]=n.am(0,i[o],r,o,0,n.t);r.s=0,r.clamp(),this.s!=e.s&&t.ZERO.subTo(r,r)},t.prototype.squareTo=function(t){for(var e=this.abs(),r=t.t=2*e.t;--r>=0;)t[r]=0;for(r=0;r<e.t-1;++r){var n=e.am(r,e[r],t,2*r,0,1);(t[r+e.t]+=e.am(r+1,2*e[r],t,2*r+1,n,e.t-r-1))>=e.DV&&(t[r+e.t]-=e.DV,t[r+e.t+1]=1)}t.t>0&&(t[t.t-1]+=e.am(r,e[r],t,2*r,0,1)),t.s=0,t.clamp()},t.prototype.divRemTo=function(e,r,n){var i=e.abs();if(!(i.t<=0)){var o=this.abs();if(o.t<i.t)return null!=r&&r.fromInt(0),void(null!=n&&this.copyTo(n));null==n&&(n=gt());var s=gt(),a=this.s,u=e.s,h=this.DB-St(i[i.t-1]);h>0?(i.lShiftTo(h,s),o.lShiftTo(h,n)):(i.copyTo(s),o.copyTo(n));var c=s.t,l=s[c-1];if(0!=l){var f=l*(1<<this.F1)+(c>1?s[c-2]>>this.F2:0),d=this.FV/f,p=(1<<this.F1)/f,g=1<<this.F2,v=n.t,y=v-c,m=null==r?gt():r;for(s.dlShiftTo(y,m),n.compareTo(m)>=0&&(n[n.t++]=1,n.subTo(m,n)),t.ONE.dlShiftTo(c,m),m.subTo(s,s);s.t<c;)s[s.t++]=0;for(;--y>=0;){var E=n[--v]==l?this.DM:Math.floor(n[v]*d+(n[v-1]+g)*p);if((n[v]+=s.am(0,E,n,y,0,c))<E)for(s.dlShiftTo(y,m),n.subTo(m,n);n[v]<--E;)n.subTo(m,n)}null!=r&&(n.drShiftTo(c,r),a!=u&&t.ZERO.subTo(r,r)),n.t=c,n.clamp(),h>0&&n.rShiftTo(h,n),a<0&&t.ZERO.subTo(n,n)}}},t.prototype.invDigit=function(){if(this.t<1)return 0;var t=this[0];if(0==(1&t))return 0;var e=3&t;return(e=(e=(e=(e=e*(2-(15&t)*e)&15)*(2-(255&t)*e)&255)*(2-((65535&t)*e&65535))&65535)*(2-t*e%this.DV)%this.DV)>0?this.DV-e:-e},t.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)},t.prototype.exp=function(e,r){if(e>4294967295||e<1)return t.ONE;var n=gt(),i=gt(),o=r.convert(this),s=St(e)-1;for(o.copyTo(n);--s>=0;)if(r.sqrTo(n,i),(e&1<<s)>0)r.mulTo(i,o,n);else{var a=n;n=i,i=a}return r.revert(n)},t.prototype.chunkSize=function(t){return Math.floor(Math.LN2*this.DB/Math.log(t))},t.prototype.toRadix=function(t){if(null==t&&(t=10),0==this.signum()||t<2||t>36)return"0";var e=this.chunkSize(t),r=Math.pow(t,e),n=Tt(r),i=gt(),o=gt(),s="";for(this.divRemTo(n,i,o);i.signum()>0;)s=(r+o.intValue()).toString(t).substr(1)+s,i.divRemTo(n,i,o);return o.intValue().toString(t)+s},t.prototype.fromRadix=function(e,r){this.fromInt(0),null==r&&(r=10);for(var n=this.chunkSize(r),i=Math.pow(r,n),o=!1,s=0,a=0,u=0;u<e.length;++u){var h=bt(e,u);h<0?"-"==e.charAt(u)&&0==this.signum()&&(o=!0):(a=r*a+h,++s>=n&&(this.dMultiply(i),this.dAddOffset(a,0),s=0,a=0))}s>0&&(this.dMultiply(Math.pow(r,s)),this.dAddOffset(a,0)),o&&t.ZERO.subTo(this,this)},t.prototype.fromNumber=function(e,r,n){if("number"==typeof r)if(e<2)this.fromInt(1);else for(this.fromNumber(e,n),this.testBit(e-1)||this.bitwiseTo(t.ONE.shiftLeft(e-1),H,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(r);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(t.ONE.shiftLeft(e-1),this);else{var i=[],o=7&e;i.length=1+(e>>3),r.nextBytes(i),o>0?i[0]&=(1<<o)-1:i[0]=0,this.fromString(i,256)}},t.prototype.bitwiseTo=function(t,e,r){var n,i,o=Math.min(t.t,this.t);for(n=0;n<o;++n)r[n]=e(this[n],t[n]);if(t.t<this.t){for(i=t.s&this.DM,n=o;n<this.t;++n)r[n]=e(this[n],i);r.t=this.t}else{for(i=this.s&this.DM,n=o;n<t.t;++n)r[n]=e(i,t[n]);r.t=t.t}r.s=e(this.s,t.s),r.clamp()},t.prototype.changeBit=function(e,r){var n=t.ONE.shiftLeft(e);return this.bitwiseTo(n,r,n),n},t.prototype.addTo=function(t,e){for(var r=0,n=0,i=Math.min(t.t,this.t);r<i;)n+=this[r]+t[r],e[r++]=n&this.DM,n>>=this.DB;if(t.t<this.t){for(n+=t.s;r<this.t;)n+=this[r],e[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<t.t;)n+=t[r],e[r++]=n&this.DM,n>>=this.DB;n+=t.s}e.s=n<0?-1:0,n>0?e[r++]=n:n<-1&&(e[r++]=this.DV+n),e.t=r,e.clamp()},t.prototype.dMultiply=function(t){this[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()},t.prototype.dAddOffset=function(t,e){if(0!=t){for(;this.t<=e;)this[this.t++]=0;for(this[e]+=t;this[e]>=this.DV;)this[e]-=this.DV,++e>=this.t&&(this[this.t++]=0),++this[e]}},t.prototype.multiplyLowerTo=function(t,e,r){var n=Math.min(this.t+t.t,e);for(r.s=0,r.t=n;n>0;)r[--n]=0;for(var i=r.t-this.t;n<i;++n)r[n+this.t]=this.am(0,t[n],r,n,0,this.t);for(i=Math.min(t.t,e);n<i;++n)this.am(0,t[n],r,n,0,e-n);r.clamp()},t.prototype.multiplyUpperTo=function(t,e,r){--e;var n=r.t=this.t+t.t-e;for(r.s=0;--n>=0;)r[n]=0;for(n=Math.max(e-this.t,0);n<t.t;++n)r[this.t+n-e]=this.am(e-n,t[n],r,0,0,this.t+n-e);r.clamp(),r.drShiftTo(1,r)},t.prototype.modInt=function(t){if(t<=0)return 0;var e=this.DV%t,r=this.s<0?t-1:0;if(this.t>0)if(0==e)r=this[0]%t;else for(var n=this.t-1;n>=0;--n)r=(e*r+this[n])%t;return r},t.prototype.millerRabin=function(e){var r=this.subtract(t.ONE),n=r.getLowestSetBit();if(n<=0)return!1;var i=r.shiftRight(n);(e=e+1>>1)>ut.length&&(e=ut.length);for(var o=gt(),s=0;s<e;++s){o.fromInt(ut[Math.floor(Math.random()*ut.length)]);var a=o.modPow(i,this);if(0!=a.compareTo(t.ONE)&&0!=a.compareTo(r)){for(var u=1;u++<n&&0!=a.compareTo(r);)if(0==(a=a.modPowInt(2,this)).compareTo(t.ONE))return!1;if(0!=a.compareTo(r))return!1}}return!0},t.prototype.square=function(){var t=gt();return this.squareTo(t),t},t.prototype.gcda=function(t,e){var r=this.s<0?this.negate():this.clone(),n=t.s<0?t.negate():t.clone();if(r.compareTo(n)<0){var i=r;r=n,n=i}var o=r.getLowestSetBit(),s=n.getLowestSetBit();if(s<0)e(r);else{o<s&&(s=o),s>0&&(r.rShiftTo(s,r),n.rShiftTo(s,n));var a=function(){(o=r.getLowestSetBit())>0&&r.rShiftTo(o,r),(o=n.getLowestSetBit())>0&&n.rShiftTo(o,n),r.compareTo(n)>=0?(r.subTo(n,r),r.rShiftTo(1,r)):(n.subTo(r,n),n.rShiftTo(1,n)),r.signum()>0?setTimeout(a,0):(s>0&&n.lShiftTo(s,n),setTimeout((function(){e(n)}),0))};setTimeout(a,10)}},t.prototype.fromNumberAsync=function(e,r,n,i){if("number"==typeof r)if(e<2)this.fromInt(1);else{this.fromNumber(e,n),this.testBit(e-1)||this.bitwiseTo(t.ONE.shiftLeft(e-1),H,this),this.isEven()&&this.dAddOffset(1,0);var o=this,s=function(){o.dAddOffset(2,0),o.bitLength()>e&&o.subTo(t.ONE.shiftLeft(e-1),o),o.isProbablePrime(r)?setTimeout((function(){i()}),0):setTimeout(s,0)};setTimeout(s,0)}else{var a=[],u=7&e;a.length=1+(e>>3),r.nextBytes(a),u>0?a[0]&=(1<<u)-1:a[0]=0,this.fromString(a,256)}},t}(),lt=function(){function t(){}return t.prototype.convert=function(t){return t},t.prototype.revert=function(t){return t},t.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r)},t.prototype.sqrTo=function(t,e){t.squareTo(e)},t}(),ft=function(){function t(t){this.m=t}return t.prototype.convert=function(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t},t.prototype.revert=function(t){return t},t.prototype.reduce=function(t){t.divRemTo(this.m,null,t)},t.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},t.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},t}(),dt=function(){function t(t){this.m=t,this.mp=t.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<t.DB-15)-1,this.mt2=2*t.t}return t.prototype.convert=function(t){var e=gt();return t.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),t.s<0&&e.compareTo(ct.ZERO)>0&&this.m.subTo(e,e),e},t.prototype.revert=function(t){var e=gt();return t.copyTo(e),this.reduce(e),e},t.prototype.reduce=function(t){for(;t.t<=this.mt2;)t[t.t++]=0;for(var e=0;e<this.m.t;++e){var r=32767&t[e],n=r*this.mpl+((r*this.mph+(t[e]>>15)*this.mpl&this.um)<<15)&t.DM;for(t[r=e+this.m.t]+=this.m.am(0,n,t,e,0,this.m.t);t[r]>=t.DV;)t[r]-=t.DV,t[++r]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)},t.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},t.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},t}(),pt=function(){function t(t){this.m=t,this.r2=gt(),this.q3=gt(),ct.ONE.dlShiftTo(2*t.t,this.r2),this.mu=this.r2.divide(t)}return t.prototype.convert=function(t){if(t.s<0||t.t>2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=gt();return t.copyTo(e),this.reduce(e),e},t.prototype.revert=function(t){return t},t.prototype.reduce=function(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)},t.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},t.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},t}();function gt(){return new ct(null)}function vt(t,e){return new ct(t,e)}"Microsoft Internet Explorer"==(null===navigator||void 0===navigator?void 0:navigator.appName)?(ct.prototype.am=function(t,e,r,n,i,o){for(var s=32767&e,a=e>>15;--o>=0;){var u=32767&this[t],h=this[t++]>>15,c=a*u+h*s;i=((u=s*u+((32767&c)<<15)+r[n]+(1073741823&i))>>>30)+(c>>>15)+a*h+(i>>>30),r[n++]=1073741823&u}return i},it=30):"Netscape"!=(null===navigator||void 0===navigator?void 0:navigator.appName)?(ct.prototype.am=function(t,e,r,n,i,o){for(;--o>=0;){var s=e*this[t++]+r[n]+i;i=Math.floor(s/67108864),r[n++]=67108863&s}return i},it=26):(ct.prototype.am=function(t,e,r,n,i,o){for(var s=16383&e,a=e>>14;--o>=0;){var u=16383&this[t],h=this[t++]>>14,c=a*u+h*s;i=((u=s*u+((16383&c)<<14)+r[n]+i)>>28)+(c>>14)+a*h,r[n++]=268435455&u}return i},it=28),ct.prototype.DB=it,ct.prototype.DM=(1<<it)-1,ct.prototype.DV=1<<it,ct.prototype.FV=Math.pow(2,52),ct.prototype.F1=52-it,ct.prototype.F2=2*it-52;var yt,mt,Et=[];for(yt="0".charCodeAt(0),mt=0;mt<=9;++mt)Et[yt++]=mt;for(yt="a".charCodeAt(0),mt=10;mt<36;++mt)Et[yt++]=mt;for(yt="A".charCodeAt(0),mt=10;mt<36;++mt)Et[yt++]=mt;function bt(t,e){var r=Et[t.charCodeAt(e)];return null==r?-1:r}function Tt(t){var e=gt();return e.fromInt(t),e}function St(t){var e,r=1;return 0!=(e=t>>>16)&&(t=e,r+=16),0!=(e=t>>8)&&(t=e,r+=8),0!=(e=t>>4)&&(t=e,r+=4),0!=(e=t>>2)&&(t=e,r+=2),0!=(e=t>>1)&&(t=e,r+=1),r}ct.ZERO=Tt(0),ct.ONE=Tt(1);var _t,wt,Rt=function(){function t(){this.i=0,this.j=0,this.S=[]}return t.prototype.init=function(t){var e,r,n;for(e=0;e<256;++e)this.S[e]=e;for(r=0,e=0;e<256;++e)r=r+this.S[e]+t[e%t.length]&255,n=this.S[e],this.S[e]=this.S[r],this.S[r]=n;this.i=0,this.j=0},t.prototype.next=function(){var t;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,t=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=t,this.S[t+this.S[this.i]&255]},t}(),It=256,Dt=null;if(null==Dt){Dt=[],wt=0;var At=void 0;if((null===window||void 0===window?void 0:window.crypto)&&(null===window||void 0===window?void 0:window.crypto.getRandomValues)){var Ot=new Uint32Array(256);for(null===window||void 0===window||window.crypto.getRandomValues(Ot),At=0;At<Ot.length;++At)Dt[wt++]=255&Ot[At]}var Ct=function(t){if(this.count=this.count||0,this.count>=256||wt>=It)(null===window||void 0===window?void 0:window.removeEventListener)?null===window||void 0===window||window.removeEventListener("mousemove",Ct,!1):(null===window||void 0===window?void 0:window.detachEvent)&&(null===window||void 0===window||window.detachEvent("onmousemove",Ct));else try{var e=t.x+t.y;Dt[wt++]=255&e,this.count+=1}catch(t){}};(null===window||void 0===window?void 0:window.addEventListener)?null===window||void 0===window||window.addEventListener("mousemove",Ct,!1):(null===window||void 0===window?void 0:window.attachEvent)&&(null===window||void 0===window||window.attachEvent("onmousemove",Ct))}function Nt(){if(null==_t){for(_t=new Rt;wt<It;){var t=Math.floor(65536*Math.random());Dt[wt++]=255&t}for(_t.init(Dt),wt=0;wt<Dt.length;++wt)Dt[wt]=0;wt=0}return _t.next()}var Pt=function(){function t(){}return t.prototype.nextBytes=function(t){for(var e=0;e<t.length;++e)t[e]=Nt()},t}(),xt=function(){function t(){this.n=null,this.e=0,this.d=null,this.p=null,this.q=null,this.dmp1=null,this.dmq1=null,this.coeff=null}return t.prototype.doPublic=function(t){return t.modPowInt(this.e,this.n)},t.prototype.doPrivate=function(t){if(null==this.p||null==this.q)return t.modPow(this.d,this.n);for(var e=t.mod(this.p).modPow(this.dmp1,this.p),r=t.mod(this.q).modPow(this.dmq1,this.q);e.compareTo(r)<0;)e=e.add(this.p);return e.subtract(r).multiply(this.coeff).mod(this.p).multiply(this.q).add(r)},t.prototype.setPublic=function(t,e){null!=t&&null!=e&&t.length>0&&e.length>0?(this.n=vt(t,16),this.e=parseInt(e,16)):console.error("Invalid RSA public key")},t.prototype.encrypt=function(t){var e=function(t,e){if(e<t.length+11)return console.error("Message too long for RSA"),null;for(var r=[],n=t.length-1;n>=0&&e>0;){var i=t.charCodeAt(n--);i<128?r[--e]=i:i>127&&i<2048?(r[--e]=63&i|128,r[--e]=i>>6|192):(r[--e]=63&i|128,r[--e]=i>>6&63|128,r[--e]=i>>12|224)}r[--e]=0;for(var o=new Pt,s=[];e>2;){for(s[0]=0;0==s[0];)o.nextBytes(s);r[--e]=s[0]}return r[--e]=2,r[--e]=0,new ct(r)}(t,this.n.bitLength()+7>>3);if(null==e)return null;var r=this.doPublic(e);if(null==r)return null;var n=r.toString(16);return 0==(1&n.length)?n:"0"+n},t.prototype.encryptLong=function(t){var e=this,r=(this.n.bitLength()+7>>3)-11;try{var n="";return t.length>r?(t.match(/.{1,117}/g).forEach((function(t){var r=e.encrypt(t);n+=r})),Y(n)):Y(this.encrypt(t))}catch(t){return!1}},t.prototype.decryptLong=function(t){var e=this,r=this.n.bitLength()+7>>3;t=z(t);try{if(t.length>r){var n="";return t.match(/.{1,256}/g).forEach((function(t){var r=e.decrypt(t);n+=r})),n}return this.decrypt(t)}catch(t){return!1}},t.prototype.setPrivate=function(t,e,r){null!=t&&null!=e&&t.length>0&&e.length>0?(this.n=vt(t,16),this.e=parseInt(e,16),this.d=vt(r,16)):console.error("Invalid RSA private key")},t.prototype.setPrivateEx=function(t,e,r,n,i,o,s,a){null!=t&&null!=e&&t.length>0&&e.length>0?(this.n=vt(t,16),this.e=parseInt(e,16),this.d=vt(r,16),this.p=vt(n,16),this.q=vt(i,16),this.dmp1=vt(o,16),this.dmq1=vt(s,16),this.coeff=vt(a,16)):console.error("Invalid RSA private key")},t.prototype.generate=function(t,e){var r=new Pt,n=t>>1;this.e=parseInt(e,16);for(var i=new ct(e,16);;){for(;this.p=new ct(t-n,1,r),0!=this.p.subtract(ct.ONE).gcd(i).compareTo(ct.ONE)||!this.p.isProbablePrime(10););for(;this.q=new ct(n,1,r),0!=this.q.subtract(ct.ONE).gcd(i).compareTo(ct.ONE)||!this.q.isProbablePrime(10););if(this.p.compareTo(this.q)<=0){var o=this.p;this.p=this.q,this.q=o}var s=this.p.subtract(ct.ONE),a=this.q.subtract(ct.ONE),u=s.multiply(a);if(0==u.gcd(i).compareTo(ct.ONE)){this.n=this.p.multiply(this.q),this.d=i.modInverse(u),this.dmp1=this.d.mod(s),this.dmq1=this.d.mod(a),this.coeff=this.q.modInverse(this.p);break}}},t.prototype.decrypt=function(t){var e=vt(t,16),r=this.doPrivate(e);return null==r?null:function(t,e){for(var r=t.toByteArray(),n=0;n<r.length&&0==r[n];)++n;if(r.length-n!=e-1||2!=r[n])return null;for(++n;0!=r[n];)if(++n>=r.length)return null;for(var i="";++n<r.length;){var o=255&r[n];o<128?i+=String.fromCharCode(o):o>191&&o<224?(i+=String.fromCharCode((31&o)<<6|63&r[n+1]),++n):(i+=String.fromCharCode((15&o)<<12|(63&r[n+1])<<6|63&r[n+2]),n+=2)}return i}(r,this.n.bitLength()+7>>3)},t.prototype.generateAsync=function(t,e,r){var n=new Pt,i=t>>1;this.e=parseInt(e,16);var o=new ct(e,16),s=this,a=function(){var e=function(){if(s.p.compareTo(s.q)<=0){var t=s.p;s.p=s.q,s.q=t}var e=s.p.subtract(ct.ONE),n=s.q.subtract(ct.ONE),i=e.multiply(n);0==i.gcd(o).compareTo(ct.ONE)?(s.n=s.p.multiply(s.q),s.d=o.modInverse(i),s.dmp1=s.d.mod(e),s.dmq1=s.d.mod(n),s.coeff=s.q.modInverse(s.p),setTimeout((function(){r()}),0)):setTimeout(a,0)},u=function(){s.q=gt(),s.q.fromNumberAsync(i,1,n,(function(){s.q.subtract(ct.ONE).gcda(o,(function(t){0==t.compareTo(ct.ONE)&&s.q.isProbablePrime(10)?setTimeout(e,0):setTimeout(u,0)}))}))},h=function(){s.p=gt(),s.p.fromNumberAsync(t-i,1,n,(function(){s.p.subtract(ct.ONE).gcda(o,(function(t){0==t.compareTo(ct.ONE)&&s.p.isProbablePrime(10)?setTimeout(u,0):setTimeout(h,0)}))}))};setTimeout(h,0)};setTimeout(a,0)},t.prototype.sign=function(t,e,r){var n=function(t,e){if(e<t.length+22)return console.error("Message too long for RSA"),null;for(var r=e-t.length-6,n="",i=0;i<r;i+=2)n+="ff";return vt("0001"+n+"00"+t,16)}((Ut[r]||"")+e(t).toString(),this.n.bitLength()/4);if(null==n)return null;var i=this.doPrivate(n);if(null==i)return null;var o=i.toString(16);return 0==(1&o.length)?o:"0"+o},t.prototype.verify=function(t,e,r){var n=vt(e,16),i=this.doPublic(n);return null==i?null:function(t){for(var e in Ut)if(Ut.hasOwnProperty(e)){var r=Ut[e],n=r.length;if(t.substr(0,n)==r)return t.substr(n)}return t}(i.toString(16).replace(/^1f+00/,""))==r(t).toString()},t}(),Ut={md2:"3020300c06082a864886f70d020205000410",md5:"3020300c06082a864886f70d020505000410",sha1:"3021300906052b0e03021a05000414",sha224:"302d300d06096086480165030402040500041c",sha256:"3031300d060960864801650304020105000420",sha384:"3041300d060960864801650304020205000430",sha512:"3051300d060960864801650304020305000440",ripemd160:"3021300906052b2403020105000414"},Lt={};Lt.lang={extend:function(t,e,r){if(!e||!t)throw new Error("YAHOO.lang.extend failed, please check that all dependencies are included.");var n=function(){};if(n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t,t.superclass=e.prototype,e.prototype.constructor==Object.prototype.constructor&&(e.prototype.constructor=e),r){var i;for(i in r)t.prototype[i]=r[i];var o=function(){},s=["toString","valueOf"];try{/MSIE/.test(navigator.userAgent)&&(o=function(t,e){for(i=0;i<s.length;i+=1){var r=s[i],n=e[r];"function"==typeof n&&n!=Object.prototype[r]&&(t[r]=n)}})}catch(t){}o(t.prototype,r)}}};var Vt={};void 0!==Vt.asn1&&Vt.asn1||(Vt.asn1={}),Vt.asn1.ASN1Util=new function(){this.integerToByteHex=function(t){var e=t.toString(16);return e.length%2==1&&(e="0"+e),e},this.bigIntToMinTwosComplementsHex=function(t){var e=t.toString(16);if("-"!=e.substr(0,1))e.length%2==1?e="0"+e:e.match(/^[0-7]/)||(e="00"+e);else{var r=e.substr(1).length;r%2==1?r+=1:e.match(/^[0-7]/)||(r+=2);for(var n="",i=0;i<r;i++)n+="f";e=new ct(n,16).xor(t).add(ct.ONE).toString(16).replace(/^-/,"")}return e},this.getPEMStringFromHex=function(t,e){return hextopem(t,e)},this.newObject=function(t){var e=Vt.asn1,r=e.DERBoolean,n=e.DERInteger,i=e.DERBitString,o=e.DEROctetString,s=e.DERNull,a=e.DERObjectIdentifier,u=e.DEREnumerated,h=e.DERUTF8String,c=e.DERNumericString,l=e.DERPrintableString,f=e.DERTeletexString,d=e.DERIA5String,p=e.DERUTCTime,g=e.DERGeneralizedTime,v=e.DERSequence,y=e.DERSet,m=e.DERTaggedObject,E=e.ASN1Util.newObject,b=Object.keys(t);if(1!=b.length)throw"key of param shall be only one.";var T=b[0];if(-1==":bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:seq:set:tag:".indexOf(":"+T+":"))throw"undefined key: "+T;if("bool"==T)return new r(t[T]);if("int"==T)return new n(t[T]);if("bitstr"==T)return new i(t[T]);if("octstr"==T)return new o(t[T]);if("null"==T)return new s(t[T]);if("oid"==T)return new a(t[T]);if("enum"==T)return new u(t[T]);if("utf8str"==T)return new h(t[T]);if("numstr"==T)return new c(t[T]);if("prnstr"==T)return new l(t[T]);if("telstr"==T)return new f(t[T]);if("ia5str"==T)return new d(t[T]);if("utctime"==T)return new p(t[T]);if("gentime"==T)return new g(t[T]);if("seq"==T){for(var S=t[T],_=[],w=0;w<S.length;w++){var R=E(S[w]);_.push(R)}return new v({array:_})}if("set"==T){for(S=t[T],_=[],w=0;w<S.length;w++)R=E(S[w]),_.push(R);return new y({array:_})}if("tag"==T){var I=t[T];if("[object Array]"===Object.prototype.toString.call(I)&&3==I.length){var D=E(I[2]);return new m({tag:I[0],explicit:I[1],obj:D})}var A={};if(void 0!==I.explicit&&(A.explicit=I.explicit),void 0!==I.tag&&(A.tag=I.tag),void 0===I.obj)throw"obj shall be specified for 'tag'.";return A.obj=E(I.obj),new m(A)}},this.jsonToASN1HEX=function(t){return this.newObject(t).getEncodedHex()}},Vt.asn1.ASN1Util.oidHexToInt=function(t){for(var e="",r=parseInt(t.substr(0,2),16),n=(e=Math.floor(r/40)+"."+r%40,""),i=2;i<t.length;i+=2){var o=("00000000"+parseInt(t.substr(i,2),16).toString(2)).slice(-8);n+=o.substr(1,7),"0"==o.substr(0,1)&&(e=e+"."+new ct(n,2).toString(10),n="")}return e},Vt.asn1.ASN1Util.oidIntToHex=function(t){var e=function(t){var e=t.toString(16);return 1==e.length&&(e="0"+e),e},r=function(t){var r="",n=new ct(t,10).toString(2),i=7-n.length%7;7==i&&(i=0);for(var o="",s=0;s<i;s++)o+="0";for(n=o+n,s=0;s<n.length-1;s+=7){var a=n.substr(s,7);s!=n.length-7&&(a="1"+a),r+=e(parseInt(a,2))}return r};if(!t.match(/^[0-9.]+$/))throw"malformed oid string: "+t;var n="",i=t.split("."),o=40*parseInt(i[0])+parseInt(i[1]);n+=e(o),i.splice(0,2);for(var s=0;s<i.length;s++)n+=r(i[s]);return n},Vt.asn1.ASN1Object=function(){this.getLengthHexFromValue=function(){if(void 0===this.hV||null==this.hV)throw"this.hV is null or undefined.";if(this.hV.length%2==1)throw"value hex must be even length: n="+"".length+",v="+this.hV;var t=this.hV.length/2,e=t.toString(16);if(e.length%2==1&&(e="0"+e),t<128)return e;var r=e.length/2;if(r>15)throw"ASN.1 length too long to represent by 8x: n = "+t.toString(16);return(128+r).toString(16)+e},this.getEncodedHex=function(){return(null==this.hTLV||this.isModified)&&(this.hV=this.getFreshValueHex(),this.hL=this.getLengthHexFromValue(),this.hTLV=this.hT+this.hL+this.hV,this.isModified=!1),this.hTLV},this.getValueHex=function(){return this.getEncodedHex(),this.hV},this.getFreshValueHex=function(){return""}},Vt.asn1.DERAbstractString=function(t){Vt.asn1.DERAbstractString.superclass.constructor.call(this),this.getString=function(){return this.s},this.setString=function(t){this.hTLV=null,this.isModified=!0,this.s=t,this.hV=stohex(this.s)},this.setStringHex=function(t){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=t},this.getFreshValueHex=function(){return this.hV},void 0!==t&&("string"==typeof t?this.setString(t):void 0!==t.str?this.setString(t.str):void 0!==t.hex&&this.setStringHex(t.hex))},Lt.lang.extend(Vt.asn1.DERAbstractString,Vt.asn1.ASN1Object),Vt.asn1.DERAbstractTime=function(t){Vt.asn1.DERAbstractTime.superclass.constructor.call(this),this.localDateToUTC=function(t){return utc=t.getTime()+6e4*t.getTimezoneOffset(),new Date(utc)},this.formatDate=function(t,e,r){var n=this.zeroPadding,i=this.localDateToUTC(t),o=String(i.getFullYear());"utc"==e&&(o=o.substr(2,2));var s=o+n(String(i.getMonth()+1),2)+n(String(i.getDate()),2)+n(String(i.getHours()),2)+n(String(i.getMinutes()),2)+n(String(i.getSeconds()),2);if(!0===r){var a=i.getMilliseconds();if(0!=a){var u=n(String(a),3);s=s+"."+(u=u.replace(/[0]+$/,""))}}return s+"Z"},this.zeroPadding=function(t,e){return t.length>=e?t:new Array(e-t.length+1).join("0")+t},this.getString=function(){return this.s},this.setString=function(t){this.hTLV=null,this.isModified=!0,this.s=t,this.hV=stohex(t)},this.setByDateValue=function(t,e,r,n,i,o){var s=new Date(Date.UTC(t,e-1,r,n,i,o,0));this.setByDate(s)},this.getFreshValueHex=function(){return this.hV}},Lt.lang.extend(Vt.asn1.DERAbstractTime,Vt.asn1.ASN1Object),Vt.asn1.DERAbstractStructured=function(t){Vt.asn1.DERAbstractString.superclass.constructor.call(this),this.setByASN1ObjectArray=function(t){this.hTLV=null,this.isModified=!0,this.asn1Array=t},this.appendASN1Object=function(t){this.hTLV=null,this.isModified=!0,this.asn1Array.push(t)},this.asn1Array=new Array,void 0!==t&&void 0!==t.array&&(this.asn1Array=t.array)},Lt.lang.extend(Vt.asn1.DERAbstractStructured,Vt.asn1.ASN1Object),Vt.asn1.DERBoolean=function(){Vt.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV="0101ff"},Lt.lang.extend(Vt.asn1.DERBoolean,Vt.asn1.ASN1Object),Vt.asn1.DERInteger=function(t){Vt.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.setByBigInteger=function(t){this.hTLV=null,this.isModified=!0,this.hV=Vt.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t)},this.setByInteger=function(t){var e=new ct(String(t),10);this.setByBigInteger(e)},this.setValueHex=function(t){this.hV=t},this.getFreshValueHex=function(){return this.hV},void 0!==t&&(void 0!==t.bigint?this.setByBigInteger(t.bigint):void 0!==t.int?this.setByInteger(t.int):"number"==typeof t?this.setByInteger(t):void 0!==t.hex&&this.setValueHex(t.hex))},Lt.lang.extend(Vt.asn1.DERInteger,Vt.asn1.ASN1Object),Vt.asn1.DERBitString=function(t){if(void 0!==t&&void 0!==t.obj){var e=Vt.asn1.ASN1Util.newObject(t.obj);t.hex="00"+e.getEncodedHex()}Vt.asn1.DERBitString.superclass.constructor.call(this),this.hT="03",this.setHexValueIncludingUnusedBits=function(t){this.hTLV=null,this.isModified=!0,this.hV=t},this.setUnusedBitsAndHexValue=function(t,e){if(t<0||7<t)throw"unused bits shall be from 0 to 7: u = "+t;var r="0"+t;this.hTLV=null,this.isModified=!0,this.hV=r+e},this.setByBinaryString=function(t){var e=8-(t=t.replace(/0+$/,"")).length%8;8==e&&(e=0);for(var r=0;r<=e;r++)t+="0";var n="";for(r=0;r<t.length-1;r+=8){var i=t.substr(r,8),o=parseInt(i,2).toString(16);1==o.length&&(o="0"+o),n+=o}this.hTLV=null,this.isModified=!0,this.hV="0"+e+n},this.setByBooleanArray=function(t){for(var e="",r=0;r<t.length;r++)1==t[r]?e+="1":e+="0";this.setByBinaryString(e)},this.newFalseArray=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=!1;return e},this.getFreshValueHex=function(){return this.hV},void 0!==t&&("string"==typeof t&&t.toLowerCase().match(/^[0-9a-f]+$/)?this.setHexValueIncludingUnusedBits(t):void 0!==t.hex?this.setHexValueIncludingUnusedBits(t.hex):void 0!==t.bin?this.setByBinaryString(t.bin):void 0!==t.array&&this.setByBooleanArray(t.array))},Lt.lang.extend(Vt.asn1.DERBitString,Vt.asn1.ASN1Object),Vt.asn1.DEROctetString=function(t){if(void 0!==t&&void 0!==t.obj){var e=Vt.asn1.ASN1Util.newObject(t.obj);t.hex=e.getEncodedHex()}Vt.asn1.DEROctetString.superclass.constructor.call(this,t),this.hT="04"},Lt.lang.extend(Vt.asn1.DEROctetString,Vt.asn1.DERAbstractString),Vt.asn1.DERNull=function(){Vt.asn1.DERNull.superclass.constructor.call(this),this.hT="05",this.hTLV="0500"},Lt.lang.extend(Vt.asn1.DERNull,Vt.asn1.ASN1Object),Vt.asn1.DERObjectIdentifier=function(t){var e=function(t){var e=t.toString(16);return 1==e.length&&(e="0"+e),e},r=function(t){var r="",n=new ct(t,10).toString(2),i=7-n.length%7;7==i&&(i=0);for(var o="",s=0;s<i;s++)o+="0";for(n=o+n,s=0;s<n.length-1;s+=7){var a=n.substr(s,7);s!=n.length-7&&(a="1"+a),r+=e(parseInt(a,2))}return r};Vt.asn1.DERObjectIdentifier.superclass.constructor.call(this),this.hT="06",this.setValueHex=function(t){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=t},this.setValueOidString=function(t){if(!t.match(/^[0-9.]+$/))throw"malformed oid string: "+t;var n="",i=t.split("."),o=40*parseInt(i[0])+parseInt(i[1]);n+=e(o),i.splice(0,2);for(var s=0;s<i.length;s++)n+=r(i[s]);this.hTLV=null,this.isModified=!0,this.s=null,this.hV=n},this.setValueName=function(t){var e=Vt.asn1.x509.OID.name2oid(t);if(""===e)throw"DERObjectIdentifier oidName undefined: "+t;this.setValueOidString(e)},this.getFreshValueHex=function(){return this.hV},void 0!==t&&("string"==typeof t?t.match(/^[0-2].[0-9.]+$/)?this.setValueOidString(t):this.setValueName(t):void 0!==t.oid?this.setValueOidString(t.oid):void 0!==t.hex?this.setValueHex(t.hex):void 0!==t.name&&this.setValueName(t.name))},Lt.lang.extend(Vt.asn1.DERObjectIdentifier,Vt.asn1.ASN1Object),Vt.asn1.DEREnumerated=function(t){Vt.asn1.DEREnumerated.superclass.constructor.call(this),this.hT="0a",this.setByBigInteger=function(t){this.hTLV=null,this.isModified=!0,this.hV=Vt.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t)},this.setByInteger=function(t){var e=new ct(String(t),10);this.setByBigInteger(e)},this.setValueHex=function(t){this.hV=t},this.getFreshValueHex=function(){return this.hV},void 0!==t&&(void 0!==t.int?this.setByInteger(t.int):"number"==typeof t?this.setByInteger(t):void 0!==t.hex&&this.setValueHex(t.hex))},Lt.lang.extend(Vt.asn1.DEREnumerated,Vt.asn1.ASN1Object),Vt.asn1.DERUTF8String=function(t){Vt.asn1.DERUTF8String.superclass.constructor.call(this,t),this.hT="0c"},Lt.lang.extend(Vt.asn1.DERUTF8String,Vt.asn1.DERAbstractString),Vt.asn1.DERNumericString=function(t){Vt.asn1.DERNumericString.superclass.constructor.call(this,t),this.hT="12"},Lt.lang.extend(Vt.asn1.DERNumericString,Vt.asn1.DERAbstractString),Vt.asn1.DERPrintableString=function(t){Vt.asn1.DERPrintableString.superclass.constructor.call(this,t),this.hT="13"},Lt.lang.extend(Vt.asn1.DERPrintableString,Vt.asn1.DERAbstractString),Vt.asn1.DERTeletexString=function(t){Vt.asn1.DERTeletexString.superclass.constructor.call(this,t),this.hT="14"},Lt.lang.extend(Vt.asn1.DERTeletexString,Vt.asn1.DERAbstractString),Vt.asn1.DERIA5String=function(t){Vt.asn1.DERIA5String.superclass.constructor.call(this,t),this.hT="16"},Lt.lang.extend(Vt.asn1.DERIA5String,Vt.asn1.DERAbstractString),Vt.asn1.DERUTCTime=function(t){Vt.asn1.DERUTCTime.superclass.constructor.call(this,t),this.hT="17",this.setByDate=function(t){this.hTLV=null,this.isModified=!0,this.date=t,this.s=this.formatDate(this.date,"utc"),this.hV=stohex(this.s)},this.getFreshValueHex=function(){return void 0===this.date&&void 0===this.s&&(this.date=new Date,this.s=this.formatDate(this.date,"utc"),this.hV=stohex(this.s)),this.hV},void 0!==t&&(void 0!==t.str?this.setString(t.str):"string"==typeof t&&t.match(/^[0-9]{12}Z$/)?this.setString(t):void 0!==t.hex?this.setStringHex(t.hex):void 0!==t.date&&this.setByDate(t.date))},Lt.lang.extend(Vt.asn1.DERUTCTime,Vt.asn1.DERAbstractTime),Vt.asn1.DERGeneralizedTime=function(t){Vt.asn1.DERGeneralizedTime.superclass.constructor.call(this,t),this.hT="18",this.withMillis=!1,this.setByDate=function(t){this.hTLV=null,this.isModified=!0,this.date=t,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=stohex(this.s)},this.getFreshValueHex=function(){return void 0===this.date&&void 0===this.s&&(this.date=new Date,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=stohex(this.s)),this.hV},void 0!==t&&(void 0!==t.str?this.setString(t.str):"string"==typeof t&&t.match(/^[0-9]{14}Z$/)?this.setString(t):void 0!==t.hex?this.setStringHex(t.hex):void 0!==t.date&&this.setByDate(t.date),!0===t.millis&&(this.withMillis=!0))},Lt.lang.extend(Vt.asn1.DERGeneralizedTime,Vt.asn1.DERAbstractTime),Vt.asn1.DERSequence=function(t){Vt.asn1.DERSequence.superclass.constructor.call(this,t),this.hT="30",this.getFreshValueHex=function(){for(var t="",e=0;e<this.asn1Array.length;e++)t+=this.asn1Array[e].getEncodedHex();return this.hV=t,this.hV}},Lt.lang.extend(Vt.asn1.DERSequence,Vt.asn1.DERAbstractStructured),Vt.asn1.DERSet=function(t){Vt.asn1.DERSet.superclass.constructor.call(this,t),this.hT="31",this.sortFlag=!0,this.getFreshValueHex=function(){for(var t=new Array,e=0;e<this.asn1Array.length;e++){var r=this.asn1Array[e];t.push(r.getEncodedHex())}return 1==this.sortFlag&&t.sort(),this.hV=t.join(""),this.hV},void 0!==t&&void 0!==t.sortflag&&0==t.sortflag&&(this.sortFlag=!1)},Lt.lang.extend(Vt.asn1.DERSet,Vt.asn1.DERAbstractStructured),Vt.asn1.DERTaggedObject=function(t){Vt.asn1.DERTaggedObject.superclass.constructor.call(this),this.hT="a0",this.hV="",this.isExplicit=!0,this.asn1Object=null,this.setASN1Object=function(t,e,r){this.hT=e,this.isExplicit=t,this.asn1Object=r,this.isExplicit?(this.hV=this.asn1Object.getEncodedHex(),this.hTLV=null,this.isModified=!0):(this.hV=null,this.hTLV=r.getEncodedHex(),this.hTLV=this.hTLV.replace(/^../,e),this.isModified=!1)},this.getFreshValueHex=function(){return this.hV},void 0!==t&&(void 0!==t.tag&&(this.hT=t.tag),void 0!==t.explicit&&(this.isExplicit=t.explicit),void 0!==t.obj&&(this.asn1Object=t.obj,this.setASN1Object(this.isExplicit,this.hT,this.asn1Object)))},Lt.lang.extend(Vt.asn1.DERTaggedObject,Vt.asn1.ASN1Object);var Bt=function(t){function e(t){void 0===t&&(t="");var e=this;return t&&("string"==typeof t?e.parseKey(t):(e.hasPrivateKeyProperty(t)||e.hasPublicKeyProperty(t))&&e.parsePropertiesFrom(t)),e}return V(e,t),e.prototype.parseKey=function(t){try{var e=0,r=0,n=/^\s*(?:[0-9A-Fa-f][0-9A-Fa-f]\s*)+$/.test(t)?function(t){var e;if(void 0===Q){var r="0123456789ABCDEF",n=" \f\n\r\t \u2028\u2029";for(Q={},e=0;e<16;++e)Q[r.charAt(e)]=e;for(r=r.toLowerCase(),e=10;e<16;++e)Q[r.charAt(e)]=e;for(e=0;e<n.length;++e)Q[n.charAt(e)]=-1}var i=[],o=0,s=0;for(e=0;e<t.length;++e){var a=t.charAt(e);if("="==a)break;if(-1!=(a=Q[a])){if(void 0===a)throw new Error("Illegal character at offset "+e);o|=a,++s>=2?(i[i.length]=o,o=0,s=0):o<<=4}}if(s)throw new Error("Hex encoding incomplete: 4 bits missing");return i}(t):J.unarmor(t),i=st.decode(n);if(3===i.sub.length&&(i=i.sub[2].sub[0]),9===i.sub.length){e=i.sub[1].getHexStringValue(),this.n=vt(e,16),r=i.sub[2].getHexStringValue(),this.e=parseInt(r,16);var o=i.sub[3].getHexStringValue();this.d=vt(o,16);var s=i.sub[4].getHexStringValue();this.p=vt(s,16);var a=i.sub[5].getHexStringValue();this.q=vt(a,16);var u=i.sub[6].getHexStringValue();this.dmp1=vt(u,16);var h=i.sub[7].getHexStringValue();this.dmq1=vt(h,16);var c=i.sub[8].getHexStringValue();this.coeff=vt(c,16)}else{if(2!==i.sub.length)return!1;var l=i.sub[1].sub[0];e=l.sub[0].getHexStringValue(),this.n=vt(e,16),r=l.sub[1].getHexStringValue(),this.e=parseInt(r,16)}return!0}catch(t){return!1}},e.prototype.getPrivateBaseKey=function(){var t={array:[new Vt.asn1.DERInteger({int:0}),new Vt.asn1.DERInteger({bigint:this.n}),new Vt.asn1.DERInteger({int:this.e}),new Vt.asn1.DERInteger({bigint:this.d}),new Vt.asn1.DERInteger({bigint:this.p}),new Vt.asn1.DERInteger({bigint:this.q}),new Vt.asn1.DERInteger({bigint:this.dmp1}),new Vt.asn1.DERInteger({bigint:this.dmq1}),new Vt.asn1.DERInteger({bigint:this.coeff})]};return new Vt.asn1.DERSequence(t).getEncodedHex()},e.prototype.getPrivateBaseKeyB64=function(){return Y(this.getPrivateBaseKey())},e.prototype.getPublicBaseKey=function(){var t=new Vt.asn1.DERSequence({array:[new Vt.asn1.DERObjectIdentifier({oid:"1.2.840.113549.1.1.1"}),new Vt.asn1.DERNull]}),e=new Vt.asn1.DERSequence({array:[new Vt.asn1.DERInteger({bigint:this.n}),new Vt.asn1.DERInteger({int:this.e})]}),r=new Vt.asn1.DERBitString({hex:"00"+e.getEncodedHex()});return new Vt.asn1.DERSequence({array:[t,r]}).getEncodedHex()},e.prototype.getPublicBaseKeyB64=function(){return Y(this.getPublicBaseKey())},e.wordwrap=function(t,e){if(void 0===e&&(e=void 0),!t)return t;var r="(.{1,"+(e=e||64)+"})( +|$\n?)|(.{1,"+e+"})";return t.match(RegExp(r,"g")).join("\n")},e.prototype.getPrivateKey=function(){var t="-----BEGIN RSA PRIVATE KEY-----\n";return(t+=e.wordwrap(this.getPrivateBaseKeyB64())+"\n")+"-----END RSA PRIVATE KEY-----"},e.prototype.getPublicKey=function(){var t="-----BEGIN PUBLIC KEY-----\n";return(t+=e.wordwrap(this.getPublicBaseKeyB64())+"\n")+"-----END PUBLIC KEY-----"},e.prototype.hasPublicKeyProperty=function(t){return(t=t||{}).hasOwnProperty("n")&&t.hasOwnProperty("e")},e.prototype.hasPrivateKeyProperty=function(t){return(t=t||{}).hasOwnProperty("n")&&t.hasOwnProperty("e")&&t.hasOwnProperty("d")&&t.hasOwnProperty("p")&&t.hasOwnProperty("q")&&t.hasOwnProperty("dmp1")&&t.hasOwnProperty("dmq1")&&t.hasOwnProperty("coeff")},e.prototype.parsePropertiesFrom=function(t){this.n=t.n,this.e=t.e,t.hasOwnProperty("d")&&(this.d=t.d,this.p=t.p,this.q=t.q,this.dmp1=t.dmp1,this.dmq1=t.dmq1,this.coeff=t.coeff)},e}(xt);function kt(t){t=t||{},this.default_key_size=parseInt(t.default_key_size,10)||1024,this.default_public_exponent=t.default_public_exponent||"010001",this.log=t.log||!1,this.key=null}kt.prototype.setKey=function(t){this.log&&this.key&&console.warn("A key was already set, overriding existing."),this.key=new Bt(t)},kt.prototype.setPrivateKey=function(t){this.setKey(t)},kt.prototype.setPublicKey=function(t){this.setKey(t)},kt.prototype.decrypt=function(t){try{return this.getKey().decrypt(z(t))}catch(t){return!1}},kt.prototype.encrypt=function(t){try{return Y(this.getKey().encrypt(t))}catch(t){return!1}},kt.prototype.encryptLong=function(t){try{for(var e=this.getKey().encryptLong(t)||"",r=this.getKey().decryptLong(e)||"",n=0,i=/null$/g;i.test(r)&&(n++,e=this.getKey().encryptLong(t)||"",r=this.getKey().decryptLong(e)||"",!(n>10)););return e}catch(t){return!1}},kt.prototype.decryptLong=function(t){try{return this.getKey().decryptLong(t)}catch(t){return!1}},kt.prototype.sign=function(t,e,r){try{return Y(this.getKey().sign(t,e,r))}catch(t){return!1}},kt.prototype.verify=function(t,e,r){try{return this.getKey().verify(t,z(e),r)}catch(t){return!1}},kt.prototype.getKey=function(t){if(!this.key){if(this.key=new Bt,t&&"[object Function]"==={}.toString.call(t))return void this.key.generateAsync(this.default_key_size,this.default_public_exponent,t);this.key.generate(this.default_key_size,this.default_public_exponent)}return this.key},kt.prototype.getPrivateKey=function(){return this.getKey().getPrivateKey()},kt.prototype.getPrivateKeyB64=function(){return this.getKey().getPrivateBaseKeyB64()},kt.prototype.getPublicKey=function(){return this.getKey().getPublicKey()},kt.prototype.getPublicKeyB64=function(){return this.getKey().getPublicBaseKeyB64()},kt.version="3.1.4";const qt=kt;var Ht=function(t){var e=void 0===t?{}:t,r=e.publicKey,n=void 0===r?"":r,i=e.payload,o=void 0===i?{}:i;if(!n)return"";try{var s=L(o),a=new qt;return a.setPublicKey(n),a.encryptLong(JSON.stringify(s))}catch(t){}return""},Mt=function(){return Mt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},Mt.apply(this,arguments)},jt=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))},Ft=function(t,e){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(u){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,n=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=e.call(t,s)}catch(t){a=[6,t],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}},Gt=function(){function t(t){var e=t.request,r=t.credentialsClient;if(!r){var n={apiOrigin:t.apiOrigin,clientId:t.clientId,storage:t.storage};r=new I(n)}if(!e){var i=r.request.bind(r),o=new U(Mt({clientId:t.clientId,request:i,storage:t.storage},t.captchaOptions));e=o.request.bind(o)}this.config={apiOrigin:t.apiOrigin,clientId:t.clientId,request:e,credentialsClient:r,storage:t.storage||_}}return t.parseParamsToSearch=function(t){return Object.keys(t).forEach((function(e){t[e]||delete t[e]})),new URLSearchParams(t).toString()},t.prototype.getParamsByVersion=function(t,e){var r,n=L(t),i=(null===(r={v2:s}[null==n?void 0:n.version])||void 0===r?void 0:r[e])||o[e];return n&&delete n.version,{params:n,url:i}},t.prototype.signIn=function(t){return jt(this,void 0,void 0,(function(){var e,r,n,i;return Ft(this,(function(o){switch(o.label){case 0:return e=t.version||"v1",(r=this.getParamsByVersion(t,"AUTH_SIGN_IN_URL")).params.query&&delete r.params.query,[4,this.getEncryptParams(r.params)];case 1:return n=o.sent(),[4,this.config.request(r.url,{method:"POST",body:n})];case 2:return i=o.sent(),[4,this.config.credentialsClient.setCredentials(Mt(Mt({},i),{version:e}))];case 3:return o.sent(),[2,Promise.resolve(i)]}}))}))},t.prototype.signInAnonymously=function(t){return void 0===t&&(t={}),jt(this,void 0,void 0,(function(){var e;return Ft(this,(function(r){switch(r.label){case 0:return[4,this.config.request(o.AUTH_SIGN_IN_ANONYMOUSLY_URL,{method:"POST",body:t})];case 1:return e=r.sent(),[4,this.config.credentialsClient.setCredentials(e)];case 2:return r.sent(),[2,Promise.resolve(e)]}}))}))},t.prototype.signUp=function(t){return jt(this,void 0,void 0,(function(){var e;return Ft(this,(function(r){switch(r.label){case 0:return[4,this.config.request(o.AUTH_SIGN_UP_URL,{method:"POST",body:t})];case 1:return e=r.sent(),[4,this.config.credentialsClient.setCredentials(e)];case 2:return r.sent(),[2,Promise.resolve(e)]}}))}))},t.prototype.signOut=function(){return jt(this,void 0,void 0,(function(){var t,e;return Ft(this,(function(r){switch(r.label){case 0:return[4,this.config.credentialsClient.getAccessToken()];case 1:return t=r.sent(),[4,this.config.request(o.AUTH_REVOKE_URL,{method:"POST",body:{token:t}})];case 2:return e=r.sent(),[4,this.config.credentialsClient.setCredentials()];case 3:return r.sent(),[2,Promise.resolve(e)]}}))}))},t.prototype.getVerification=function(t){return jt(this,void 0,void 0,(function(){var e;return Ft(this,(function(r){switch(r.label){case 0:return e=!1,"CUR_USER"!==t.target?[3,1]:(e=!0,[3,3]);case 1:return[4,this.hasLoginState()];case 2:r.sent()&&(e=!0),r.label=3;case 3:return[2,this.config.request(o.VERIFICATION_URL,{method:"POST",body:t,withCaptcha:!0,withCredentials:e})]}}))}))},t.prototype.verify=function(t){return jt(this,void 0,void 0,(function(){var e,r;return Ft(this,(function(n){switch(n.label){case 0:return e=this.getParamsByVersion(t,"VERIFY_URL"),[4,this.config.request(e.url,{method:"POST",body:e.params})];case 1:return r=n.sent(),"v2"!==(null==t?void 0:t.version)?[3,3]:[4,this.config.credentialsClient.setCredentials(Mt(Mt({},r),{version:"v2"}))];case 2:n.sent(),n.label=3;case 3:return[2,r]}}))}))},t.prototype.genProviderRedirectUri=function(t){return jt(this,void 0,void 0,(function(){var e,r;return Ft(this,(function(n){return e="".concat(o.PROVIDER_URI_URL,"?client_id=").concat(this.config.clientId,"&provider_id=").concat(t.provider_id,"&redirect_uri=").concat(encodeURIComponent(t.provider_redirect_uri),"&state=").concat(t.state),(r=t.other_params)&&"string"==typeof r.sign_out_uri&&r.sign_out_uri.length>0&&(e+="&other_params[sign_out_uri]=".concat(r.sign_out_uri)),[2,this.config.request(e,{method:"GET"})]}))}))},t.prototype.grantProviderToken=function(t){return jt(this,void 0,void 0,(function(){return Ft(this,(function(e){return[2,this.config.request(o.PROVIDER_TOKEN_URL,{method:"POST",body:t})]}))}))},t.prototype.patchProviderToken=function(t){return jt(this,void 0,void 0,(function(){return Ft(this,(function(e){return[2,this.config.request(o.PROVIDER_TOKEN_URL,{method:"PATCH",body:t})]}))}))},t.prototype.signInWithProvider=function(t){return jt(this,void 0,void 0,(function(){var e,r;return Ft(this,(function(n){switch(n.label){case 0:return e=this.getParamsByVersion(t,"AUTH_SIGN_IN_WITH_PROVIDER_URL"),[4,this.config.request(e.url,{method:"POST",body:e.params})];case 1:return r=n.sent(),[4,this.config.credentialsClient.setCredentials(Mt(Mt({},r),{version:(null==t?void 0:t.version)||"v1"}))];case 2:return n.sent(),[2,Promise.resolve(r)]}}))}))},t.prototype.signInWithWechat=function(t){return void 0===t&&(t={}),jt(this,void 0,void 0,(function(){var e;return Ft(this,(function(r){switch(r.label){case 0:return[4,this.config.request(o.AUTH_SIGN_IN_WITH_WECHAT_URL,{method:"POST",body:t})];case 1:return e=r.sent(),[4,this.config.credentialsClient.setCredentials(e)];case 2:return r.sent(),[2,Promise.resolve(e)]}}))}))},t.prototype.bindWithProvider=function(t){return jt(this,void 0,void 0,(function(){return Ft(this,(function(e){return[2,this.config.request(o.PROVIDER_BIND_URL,{method:"POST",body:t,withCredentials:!0})]}))}))},t.prototype.getUserProfile=function(t){return jt(this,void 0,void 0,(function(){return Ft(this,(function(e){return[2,this.getUserInfo(t)]}))}))},t.prototype.getUserInfo=function(t){var e;return void 0===t&&(t={}),jt(this,void 0,void 0,(function(){var r,n,i;return Ft(this,(function(o){switch(o.label){case 0:return r=this.getParamsByVersion(t,"USER_ME_URL"),(null===(e=r.params)||void 0===e?void 0:e.query)&&(n=new URLSearchParams(r.params.query),r.url+="?".concat(n.toString())),[4,this.config.request(r.url,{method:"GET",withCredentials:!0})];case 1:return(i=o.sent()).sub&&(i.uid=i.sub),[2,i]}}))}))},t.prototype.getWedaUserInfo=function(){return jt(this,void 0,void 0,(function(){return Ft(this,(function(t){switch(t.label){case 0:return[4,this.config.request(o.WEDA_USER_URL,{method:"GET",withCredentials:!0})];case 1:return[2,t.sent()]}}))}))},t.prototype.deleteMe=function(e){return jt(this,void 0,void 0,(function(){var r,n;return Ft(this,(function(i){return r=this.getParamsByVersion(e,"USER_ME_URL"),n="".concat(r.url,"?").concat(t.parseParamsToSearch(r.params)),[2,this.config.request(n,{method:"DELETE",withCredentials:!0})]}))}))},t.prototype.hasLoginState=function(){return jt(this,void 0,void 0,(function(){return Ft(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.config.credentialsClient.getAccessToken()];case 1:return t.sent(),[2,!0];case 2:return t.sent(),[2,!1];case 3:return[2]}}))}))},t.prototype.hasLoginStateSync=function(){return this.config.credentialsClient.getCredentialsSync()},t.prototype.getLoginState=function(){return jt(this,void 0,void 0,(function(){return Ft(this,(function(t){return[2,this.config.credentialsClient.getCredentialsAsync()]}))}))},t.prototype.transByProvider=function(t){return jt(this,void 0,void 0,(function(){return Ft(this,(function(e){return[2,this.config.request(o.USER_TRANS_BY_PROVIDER_URL,{method:"PATCH",body:t,withCredentials:!0})]}))}))},t.prototype.grantToken=function(t){return jt(this,void 0,void 0,(function(){var e;return Ft(this,(function(r){return e=this.getParamsByVersion(t,"AUTH_TOKEN_URL"),[2,this.config.request(e.url,{method:"POST",body:e.params})]}))}))},t.prototype.getProviders=function(){return jt(this,void 0,void 0,(function(){return Ft(this,(function(t){return[2,this.config.request(o.PROVIDER_LIST,{method:"GET",withCredentials:!0})]}))}))},t.prototype.unbindProvider=function(t){return jt(this,void 0,void 0,(function(){return Ft(this,(function(e){return[2,this.config.request("".concat(o.PROVIDER_UNBIND_URL,"/").concat(t.provider_id),{method:"DELETE",withCredentials:!0})]}))}))},t.prototype.checkPassword=function(t){return jt(this,void 0,void 0,(function(){return Ft(this,(function(e){return[2,this.config.request("".concat(o.CHECK_PWD_URL),{method:"POST",withCredentials:!0,body:t})]}))}))},t.prototype.bindPhone=function(t){return jt(this,void 0,void 0,(function(){return Ft(this,(function(e){return[2,this.config.request("".concat(o.BIND_CONTACT_URL),{method:"PATCH",withCredentials:!0,body:t})]}))}))},t.prototype.bindEmail=function(t){return jt(this,void 0,void 0,(function(){return Ft(this,(function(e){return[2,this.config.request("".concat(o.BIND_CONTACT_URL),{method:"PATCH",withCredentials:!0,body:t})]}))}))},t.prototype.setPassword=function(t){return jt(this,void 0,void 0,(function(){return Ft(this,(function(e){return[2,this.config.request("".concat(o.AUTH_SET_PASSWORD),{method:"PATCH",withCredentials:!0,body:t})]}))}))},t.prototype.updatePasswordByOld=function(t){return jt(this,void 0,void 0,(function(){var e;return Ft(this,(function(r){switch(r.label){case 0:return[4,this.sudo({password:t.old_password})];case 1:return e=r.sent(),[2,this.setPassword({sudo_token:e.sudo_token,new_password:t.new_password})]}}))}))},t.prototype.sudo=function(t){return jt(this,void 0,void 0,(function(){return Ft(this,(function(e){return[2,this.config.request("".concat(o.SUDO_URL),{method:"POST",withCredentials:!0,body:t})]}))}))},t.prototype.getCurUserVerification=function(t){return jt(this,void 0,void 0,(function(){return Ft(this,(function(e){return t.target="CUR_USER",[2,this.config.request(o.VERIFICATION_URL,{method:"POST",body:t,withCredentials:!0,withCaptcha:!0})]}))}))},t.prototype.changeBindedProvider=function(t){return jt(this,void 0,void 0,(function(){return Ft(this,(function(e){return[2,this.config.request("".concat(o.PROVIDER_LIST,"/").concat(t.provider_id,"/trans"),{method:"POST",body:{provider_trans_token:t.trans_token},withCredentials:!0})]}))}))},t.prototype.setUserProfile=function(t){return jt(this,void 0,void 0,(function(){return Ft(this,(function(e){return[2,this.config.request(o.USER_PRIFILE_URL,{method:"PATCH",body:t,withCredentials:!0})]}))}))},t.prototype.updateUserBasicInfo=function(t){return jt(this,void 0,void 0,(function(){return Ft(this,(function(e){return[2,this.config.request(o.USER_BASIC_EDIT_URL,{method:"POST",withCredentials:!0,body:t})]}))}))},t.prototype.queryUserProfile=function(t){return jt(this,void 0,void 0,(function(){var e;return Ft(this,(function(r){return e=new URLSearchParams(t),[2,this.config.request("".concat(o.USER_QUERY_URL,"?").concat(e.toString()),{method:"GET",withCredentials:!0})]}))}))},t.prototype.setCustomSignFunc=function(t){this.getCustomSignTicketFn=t},t.prototype.signInWithCustomTicket=function(t){return jt(this,void 0,void 0,(function(){var e;return Ft(this,(function(r){switch(r.label){case 0:return[4,this.getCustomSignTicketFn()];case 1:return e=r.sent(),[2,this.signInWithProvider(Mt(Mt({},t),{provider_id:"custom",provider_token:e}))]}}))}))},t.prototype.resetPassword=function(t){return jt(this,void 0,void 0,(function(){return Ft(this,(function(e){return[2,this.config.request(o.AUTH_RESET_PASSWORD,{method:"POST",body:t})]}))}))},t.prototype.deviceAuthorize=function(t){return jt(this,void 0,void 0,(function(){return Ft(this,(function(e){return[2,this.config.request(o.AUTH_GET_DEVICE_CODE,{method:"POST",body:t,withCredentials:!0})]}))}))},t.prototype.checkUsername=function(t){return jt(this,void 0,void 0,(function(){return Ft(this,(function(e){return[2,this.config.request(o.CHECK_USERNAME,{method:"GET",body:t,withCredentials:!0})]}))}))},t.prototype.checkIfUserExist=function(t){return jt(this,void 0,void 0,(function(){var e;return Ft(this,(function(r){return e=new URLSearchParams(t),[2,this.config.request("".concat(o.CHECK_IF_USER_EXIST,"?").concat(e.toString()),{method:"GET"})]}))}))},t.prototype.loginScope=function(){return jt(this,void 0,void 0,(function(){return Ft(this,(function(t){return[2,this.config.credentialsClient.getScope()]}))}))},t.prototype.loginGroups=function(){return jt(this,void 0,void 0,(function(){return Ft(this,(function(t){return[2,this.config.credentialsClient.getGroups()]}))}))},t.prototype.refreshTokenForce=function(t){return jt(this,void 0,void 0,(function(){var e;return Ft(this,(function(r){switch(r.label){case 0:return[4,this.config.credentialsClient.getCredentials()];case 1:return e=r.sent(),[4,this.config.credentialsClient.refreshToken(Mt(Mt({},e),{version:(null==t?void 0:t.version)||"v1"}))];case 2:return[2,r.sent()]}}))}))},t.prototype.getCredentials=function(){return jt(this,void 0,void 0,(function(){return Ft(this,(function(t){return[2,this.config.credentialsClient.getCredentials()]}))}))},t.prototype.getPublicKey=function(){return jt(this,void 0,void 0,(function(){return Ft(this,(function(t){return[2,this.config.request(s.AUTH_PUBLIC_KEY,{method:"POST",body:{}})]}))}))},t.prototype.getEncryptParams=function(t){return jt(this,void 0,void 0,(function(){var e,r,n,i;return Ft(this,(function(o){switch(o.label){case 0:if(!(e=L(t)).isEncrypt)return[2,t];r="",n="",o.label=1;case 1:return o.trys.push([1,3,,4]),[4,this.getPublicKey()];case 2:return i=o.sent(),r=i.public_key,n=i.public_key_thumbprint,[3,4];case 3:return o.sent(),[3,4];case 4:if(!r||!n)throw new Error("public_key or public_key_thumbprint is empty");return delete e.isEncrypt,[2,{params:Ht({publicKey:r,payload:e}),public_key_thumbprint:n}]}}))}))},t.prototype.getProviderSubType=function(){return jt(this,void 0,void 0,(function(){return Ft(this,(function(t){return[2,this.config.request(o.GET_PROVIDER_TYPE,{method:"POST",body:{provider_id:"weda"}})]}))}))},t.prototype.verifyCaptchaData=function(t){var e=t.token,r=t.key;return jt(this,void 0,void 0,(function(){return Ft(this,(function(t){return[2,this.config.request(o.VERIFY_CAPTCHA_DATA_URL,{method:"POST",body:{token:e,key:r},withCredentials:!1})]}))}))},t.prototype.createCaptchaData=function(t){var e=t.state,r=t.redirect_uri,n=void 0===r?void 0:r;return jt(this,void 0,void 0,(function(){return Ft(this,(function(t){return[2,this.config.request(o.CAPTCHA_DATA_URL,{method:"POST",body:{state:e,redirect_uri:n},withCredentials:!1})]}))}))},t.prototype.getMiniProgramCode=function(t){return jt(this,void 0,void 0,(function(){return Ft(this,(function(e){return[2,this.config.request(o.GET_MINIPROGRAM_QRCODE,{method:"POST",body:t})]}))}))},t.prototype.checkMiniProgramCode=function(t){return jt(this,void 0,void 0,(function(){return Ft(this,(function(e){return[2,this.config.request(o.GET_MINIPROGRAM_QRCODE_STATUS,{method:"POST",body:t})]}))}))},t}(),Kt=function(){},Wt=function(){return Wt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},Wt.apply(this,arguments)},Yt=function(t){var e=t.apiOrigin,r=t.clientId,n=t.storage,i=t.request,o=t.baseRequest,s=t.anonymousSignInFunc;this.oauth2client=new I({apiOrigin:e,clientId:r,storage:n,baseRequest:o||i,anonymousSignInFunc:s}),this.authApi=new Gt(Wt(Wt({credentialsClient:this.oauth2client},t),{request:i?this.oauth2client.request.bind(this.oauth2client):void 0}))}},118:function(t,e,r){var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(842),e)}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={exports:{}};return t[n].call(o.exports,o,o.exports,r),o.exports}return r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r(118)})()));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudbase/js-sdk",
3
- "version": "2.5.44-beta.0",
3
+ "version": "2.5.46-beta.0",
4
4
  "description": "cloudbase javascript sdk",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
@@ -46,15 +46,15 @@
46
46
  "license": "Apache-2.0",
47
47
  "dependencies": {
48
48
  "@cloudbase/adapter-interface": "^0.4.1",
49
- "@cloudbase/analytics": "^2.5.44-beta.0",
50
- "@cloudbase/app": "^2.5.44-beta.0",
51
- "@cloudbase/auth": "^2.5.44-beta.0",
49
+ "@cloudbase/analytics": "^2.5.46-beta.0",
50
+ "@cloudbase/app": "^2.5.46-beta.0",
51
+ "@cloudbase/auth": "^2.5.46-beta.0",
52
52
  "@cloudbase/database": "0.9.21",
53
- "@cloudbase/functions": "^2.5.44-beta.0",
54
- "@cloudbase/realtime": "^2.5.44-beta.0",
55
- "@cloudbase/storage": "^2.5.44-beta.0",
56
- "@cloudbase/types": "^2.5.44-beta.0",
57
- "@cloudbase/utilities": "^2.5.44-beta.0"
53
+ "@cloudbase/functions": "^2.5.46-beta.0",
54
+ "@cloudbase/realtime": "^2.5.46-beta.0",
55
+ "@cloudbase/storage": "^2.5.46-beta.0",
56
+ "@cloudbase/types": "^2.5.46-beta.0",
57
+ "@cloudbase/utilities": "^2.5.46-beta.0"
58
58
  },
59
59
  "browserslist": [
60
60
  "last 2 version",
@@ -62,5 +62,5 @@
62
62
  "not dead",
63
63
  "chrome 53"
64
64
  ],
65
- "gitHead": "f3612f789fe731b7ac25f5fb0eaf6c5a07d011ba"
65
+ "gitHead": "b90d74de0cdcc63ba408acbafc7a7c386f582291"
66
66
  }